Compare commits

...

2 Commits

6 changed files with 22 additions and 13 deletions

View File

@ -9,9 +9,18 @@ CORE_SOURCES := \
# Compiler and flags
CORE_CC = gcc
CORE_CFLAGS = -Wall -Wextra -std=c17 -fPIC -g -DASSET_FILENAME=$(ASSET_OUTPUT)
#CORE_CFLAGS = -std=c17 -pedantic -O3 -fPIC -DASSET_FILENAME=$(ASSET_OUTPUT) # RELEASE
CORE_CFLAGS = -std=c17 --pedantic -O0 -g -fPIC -DASSET_FILENAME=$(BUILD_DIR)/$(ASSET_OUTPUT) \
-Wall -Wno-missing-braces -Wextra -Wno-missing-field-initializers \
-Wformat=2 -Wswitch-default -Wswitch-enum -Wcast-align \
-Wpointer-arith -Wbad-function-cast -Wstrict-overflow=5 \
-Wstrict-prototypes -Winline -Wundef -Wnested-externs \
-Wcast-qual -Wshadow -Wunreachable-code -Wlogical-op \
-Wfloat-equal -Wstrict-aliasing=2 -Wredundant-decls \
-Wold-style-definition # DEVELOPEMENT
CORE_INCLUDE_DIRS = $(CORE_DIR)/headers
CORE_LDFLAGS = $(shell sdl2-config --cflags --libs) -lSDL2_image
CORE_LDFLAGS = $(shell sdl2-config --cflags --libs) -lSDL2_image $(shell pkg-config --libs liblz4) -ltar
# Deduce objects
CORE_OBJECTS = $(CORE_SOURCES:%.c=$(BUILD_DIR)/$(CORE_DIR)/%.o)

View File

@ -1,10 +1,9 @@
#include "asset_manager.h"
#include <SDL2/SDL.h>
#include <libtar.h>
#include "display.h"
#ifndef ASSET_FILENAME
#define ASSET_FILENAME "game.data"
#endif
void asset_manager_init(void)
{
}
void asset_manager_exit(void)
{
}

View File

@ -22,7 +22,7 @@ void display_update(void)
void display_clear(void)
{
SDL_SetRenderDrawColor(renderer, COLOR_WHITE);
SDL_SetRenderDrawColor(renderer, C_BLACK);
SDL_RenderClear(renderer);
}

View File

@ -3,6 +3,9 @@
#include <SDL2/SDL_image.h>
void asset_manager_init(void);
void asset_manager_exit(void);
SDL_Texture load_image(const char *path);
#endif // ASSET_MANAGER_H

View File

@ -5,7 +5,7 @@
#include "image.h"
#include "vector2d.h"
#define COLOR_WHITE 255, 255, 255, 255
#define C_BLACK 0, 0, 0, 255
#define DISPLAY_WIDTH 396
#define DISPLAY_HEIGHT 224

View File

@ -42,8 +42,6 @@ typedef SDL_FRect frect_t;
#define EPSILON 0.000001f
__attribute__((const)) float fabsf(float x);
#define is_equal_to_zero(X) (fabsf(X) <= EPSILON)
#define is_not_zero(X) (fabsf(X) > EPSILON)