ft2-clone

Fasttracker 2 clone
Log | Files | Refs | README | LICENSE

commit 08789ac8d8f793d2ebbfd30e4d9565c1a5445085
parent 469933f85da9eb2b175a045388059b85140e7982
Author: Olav Sørensen <olav.sorensen@live.no>
Date:   Thu,  4 Apr 2024 15:32:47 +0200

Small cleanup

Diffstat:
Msrc/ft2_checkboxes.c | 4++--
Msrc/ft2_gui.c | 6+++---
Msrc/ft2_header.h | 12+++++-------
Msrc/ft2_help.c | 2+-
Msrc/ft2_radiobuttons.c | 2+-
5 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/ft2_checkboxes.c b/src/ft2_checkboxes.c @@ -26,8 +26,8 @@ checkBox_t checkBoxes[NUM_CHECKBOXES] = ** -- STRUCT INFO: -- ** x = x position ** y = y position - ** w = clickable width space, relative to x - ** h = clickable height space, relative to y + ** w = clickable width in pixels, relative to x + ** h = clickable height in pixels, relative to y ** funcOnUp = function to call when released */ diff --git a/src/ft2_gui.c b/src/ft2_gui.c @@ -139,15 +139,15 @@ bool setupGUI(void) // set uninitialized GUI struct entries - textBox_t *t = &textBoxes[1]; // skip first entry, it's reserved for inputBox()) + textBox_t *t = &textBoxes[1]; // skip first entry, it's reserved for inputBox() for (int32_t i = 1; i < NUM_TEXTBOXES; i++, t++) { t->visible = false; t->bufOffset = 0; t->cursorPos = 0; t->textPtr = NULL; - t->renderBufW = (9 + 1) * t->maxChars; // 9 = max character/glyph width possible - t->renderBufH = 10; // 10 = max character height possible + t->renderBufW = (9 + 1) * t->maxChars; // 9 = max text glyph width (+1 for kerning) + t->renderBufH = 10; // 10 = max text glyph height t->renderW = t->w - (t->tx * 2); t->renderBuf = (uint8_t *)malloc(t->renderBufW * t->renderBufH * sizeof (int8_t)); diff --git a/src/ft2_header.h b/src/ft2_header.h @@ -12,26 +12,24 @@ #endif #include "ft2_replayer.h" -#define PROG_VER_STR "1.79" +#define PROG_VER_STR "1.80" // do NOT change these! It will only mess things up... #define FT2_VBLANK_HZ 70.086302895323 /* nominal, 640x400 @ 70Hz */ #define SCREEN_W 632 #define SCREEN_H 400 - -/* "60Hz" ranges everywhere from 59..61Hz depending on the monitor, so with -** no vsync we will get stuttering because the rate is not perfect... -*/ #define VBLANK_HZ 60 // 70Hz (FT2 vblank) delta -> 60Hz vblank delta (rounded) #define SCALE_VBLANK_DELTA(x) (int32_t)(((x) * ((double)VBLANK_HZ / FT2_VBLANK_HZ)) + 0.5) -// scopes must be clocked slightly higher than the nominal vblank rate +/* Scopes must be clocked slightly higher than the nominal vblank rate +** to prevent update/draw racing issues. Setting it too high will +** cause more issues! +*/ #define SCOPE_HZ 64 - /* Amount of extra bytes to allocate for every instrument sample, ** this is used for a hack for resampling interpolation to be ** branchless in the inner channel mixer loop. diff --git a/src/ft2_help.c b/src/ft2_help.c @@ -393,7 +393,7 @@ void showHelpScreen(void) default: case 0: tmpID = RB_HELP_FEATURES; break; case 1: tmpID = RB_HELP_EFFECTS; break; - case 2: tmpID = RB_HELP_KEYBINDINGS; break; + case 2: tmpID = RB_HELP_KEYBINDINGS; break; case 3: tmpID = RB_HELP_HOW_TO_USE_FT2; break; case 4: tmpID = RB_HELP_FAQ; break; case 5: tmpID = RB_HELP_KNOWN_BUGS; break; diff --git a/src/ft2_radiobuttons.c b/src/ft2_radiobuttons.c @@ -24,7 +24,7 @@ radioButton_t radioButtons[NUM_RADIOBUTTONS] = ** -- STRUCT INFO: -- ** x = x position ** y = y position - ** w = clickable width space, relative to x + ** w = clickable width in pixels, relative to x ** group = what group the radiobutton belongs to ** funcOnUp = function to call when released */