shithub: ft²

Download patch

ref: 3ac27a045f216fe44bad86c85c37fec385af74dc
parent: c4b01841033fea3a265f1e33f6c8fde91c2c50f4
author: Olav Sørensen <olav.sorensen@live.no>
date: Thu Apr 4 11:33:14 EDT 2024

Small cleanup

--- a/src/ft2_checkboxes.c
+++ b/src/ft2_checkboxes.c
@@ -26,8 +26,8 @@
 	** -- 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
 	*/
 
--- a/src/ft2_gui.c
+++ b/src/ft2_gui.c
@@ -139,7 +139,7 @@
 
 	// 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;
@@ -146,8 +146,8 @@
 		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));
--- a/src/ft2_header.h
+++ b/src/ft2_header.h
@@ -13,7 +13,7 @@
 #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...
 
@@ -20,18 +20,16 @@
 #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
--- a/src/ft2_help.c
+++ b/src/ft2_help.c
@@ -393,7 +393,7 @@
 		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;
--- a/src/ft2_radiobuttons.c
+++ b/src/ft2_radiobuttons.c
@@ -24,7 +24,7 @@
 	** -- 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
 	*/