aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-10-03 02:06:45 +0200
committerRaymaekers Luca <luca@spacehb.net>2025-10-03 02:06:45 +0200
commit4fa4a450e53ee5211cb022895481c228adc55158 (patch)
tree7414a8627dde9e6f13988132cd0ef9fbac90cd74
parentcddcf10b7863b5da4c9af40ee228fb8c27727ac6 (diff)
parent5fe6980a944fcd05bbcc26e98fd964bf032f5fee (diff)
checkpoint
-rwxr-xr-xbuild/handmade.sobin264728 -> 264736 bytes
-rwxr-xr-xbuild/linux_handmadebin88824 -> 88824 bytes
-rwxr-xr-xcode/build.sh1
-rw-r--r--code/handmade.cpp23
4 files changed, 12 insertions, 12 deletions
diff --git a/build/handmade.so b/build/handmade.so
index 1805456..daf4888 100755
--- a/build/handmade.so
+++ b/build/handmade.so
Binary files differ
diff --git a/build/linux_handmade b/build/linux_handmade
index f570a08..1b03ed9 100755
--- a/build/linux_handmade
+++ b/build/linux_handmade
Binary files differ
diff --git a/code/build.sh b/code/build.sh
index 9575bfe..8244c49 100755
--- a/code/build.sh
+++ b/code/build.sh
@@ -34,6 +34,7 @@ WarningFlags="-Wall
"
ClangCompilerFlags="
+-fdiagnostics-absolute-paths
-ftime-trace
"
ClangWarningFlags="
diff --git a/code/handmade.cpp b/code/handmade.cpp
index 277ab6c..3f41a1b 100644
--- a/code/handmade.cpp
+++ b/code/handmade.cpp
@@ -26,7 +26,7 @@ GetColorRGBForColorIndex(u32 Index)
#define MemoryCopy memcpy
-psize StringLength(char *String)
+psize CStringLength(char *String)
{
psize Result = 0;
@@ -1117,7 +1117,7 @@ extern "C" GAME_UPDATE_AND_RENDER(GameUpdateAndRender)
{
r32 FontScale = stbtt_ScaleForPixelHeight(&DefaultFont.Info, 20.0);
- char *Sentences[] =
+ char *HelpLines[] =
{
"key binds",
"- [Enter] to use new word",
@@ -1127,25 +1127,24 @@ extern "C" GAME_UPDATE_AND_RENDER(GameUpdateAndRender)
"- [Left Button] paint with color",
"- [Scroll Up/Down] change color",
};
- u32 SentencesCount = ArrayCount(Sentences);
- u8 *Text = 0;
- u32 TextLen = 0;
- color_rgb TextColor = {0.8f, 0.8f, 0.8f};
+ u32 LinesCount = ArrayCount(HelpLines);
+ // color_rgb TextColor = {0.8f, 0.8f, 0.8f};
+ color_rgb TextColor = {0.71f, 0.62f, 0.53f};
v2 Offset = {650.0f, 50.0f};
YAdvance = FontScale*(DefaultFont.Ascent -
DefaultFont.Descent +
DefaultFont.LineGap);
- for(u32 SentencesIndex = 0;
- SentencesIndex < ArrayCount(Sentences);
- SentencesIndex++)
+ for(u32 LinesIndex = 0;
+ LinesIndex < ArrayCount(HelpLines);
+ LinesIndex++)
{
- Text = (u8 *)Sentences[SentencesIndex];
- TextLen = StringLength((char *)Text);
+ char *Text = HelpLines[LinesIndex];
+ u32 TextLen = CStringLength(Text);
DrawText(Buffer, &DefaultFont, FontScale,
- TextLen, Text, Offset, TextColor, false);
+ TextLen, (u8 *)Text, Offset, TextColor, false);
Offset.Y += YAdvance;
}