diff options
| author | Raymaekers Luca <luca@spacehb.net> | 2025-10-03 02:06:45 +0200 |
|---|---|---|
| committer | Raymaekers Luca <luca@spacehb.net> | 2025-10-03 02:06:45 +0200 |
| commit | 4fa4a450e53ee5211cb022895481c228adc55158 (patch) | |
| tree | 7414a8627dde9e6f13988132cd0ef9fbac90cd74 /code | |
| parent | cddcf10b7863b5da4c9af40ee228fb8c27727ac6 (diff) | |
| parent | 5fe6980a944fcd05bbcc26e98fd964bf032f5fee (diff) | |
checkpoint
Diffstat (limited to 'code')
| -rwxr-xr-x | code/build.sh | 1 | ||||
| -rw-r--r-- | code/handmade.cpp | 23 |
2 files changed, 12 insertions, 12 deletions
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; } |
