commit d1d22263bd05fcaa92a0ff25a133e9599b1ef57f
parent df47a034427994de8c0e81748bf6c53b0931b203
Author: bsandro <email@bsandro.tech>
Date: Wed, 18 Jan 2023 23:51:11 +0200
Menu rendering bugfix.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,6 +1,6 @@
NAME=$(shell basename ${PWD})
SDL2FLAGS=$(shell pkg-config --cflags sdl2 SDL2_image SDL2_ttf)
-CFLAGS?=-std=c99 -Wall -Wextra -pedantic -I. -O0 -g
+CFLAGS?=-std=c99 -Wall -Wextra -pedantic -I. -Og -g
LDFLAGS?=$(shell pkg-config --libs sdl2 SDL2_image SDL2_ttf)
SRC=$(wildcard *.c)
DEPS:=$(wildcard *.h)
diff --git a/main.c b/main.c
@@ -151,7 +151,7 @@ void draw_menu(struct menu_t *menu, int score) {
assert(menu->texture != NULL);
}
- SDL_Rect rect;
+ SDL_Rect rect = {0};
SDL_QueryTexture(menu->texture, NULL, NULL, &rect.w, &rect.h);
SDL_RenderClear(menu->game->renderer);
@@ -207,7 +207,7 @@ int main(int argc, char *argv[]) {
game.state = GAME_STATE_INIT;
SDL_Init(SDL_INIT_VIDEO);
- TTF_Init();
+ assert(TTF_Init() == 0);
srand(time(0));