чување e2fef8f1d90de8455ca1e0c85f23ead9ca07ab7e
родитељ d8640af43c65c9f5d3aa6bcbdcd06b664aed8463
Аутор: Страхиња Радић <sr@strahinja.org>
Датум: Sun, 10 Aug 2025 14:02:55 +0200
Add macros for text bold/normal opacity amounts
Diffstat:
измењених датотека: 1, додавања: 10(+), брисања: 8(-)
diff --git a/linije.c b/linije.c
@@ -41,11 +41,13 @@
#define POP_STRING_CELL_VALUE 100 /* Multiplied by # of balls in a string and
* added to score when popping a string */
/* clang-format on */
-#define PRINT_BUFSIZE 4096
-#define PROGNAME "linije"
-#define TER12_WIDTH 6
-#define TER12_HEIGHT 12
-#define WIN_TITLE "Linije"
+#define PRINT_BUFSIZE 4096
+#define PROGNAME "linije"
+#define TER12_WIDTH 6
+#define TER12_HEIGHT 12
+#define TEXT_OPACITY_NORMAL 0.6f
+#define TEXT_OPACITY_BOLD 1.0f
+#define WIN_TITLE "Linije"
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
@@ -1422,7 +1424,7 @@ render_text(struct State* state, const int x, const int y, const int font_width,
char first_char = ' ';
char last_char = '~';
float tex_w, tex_h;
- float opacity = 0.4f;
+ float opacity = TEXT_OPACITY_NORMAL;
assert((font_tex != NULL) && (text != NULL));
assert(state->text_scale_factor != 0.0f);
@@ -1465,13 +1467,13 @@ render_text(struct State* state, const int x, const int y, const int font_width,
}
else if (*pbuf == BOLD_START)
{
- opacity = 0.9f;
+ opacity = TEXT_OPACITY_BOLD;
pbuf++;
continue;
}
else if (*pbuf == BOLD_END)
{
- opacity = 0.4f;
+ opacity = TEXT_OPACITY_NORMAL;
pbuf++;
continue;
}