Compare commits

..

No commits in common. "02b8c4aa0642575332e904f25cdfc7badccf86e3" and "e370ea5b3177302aafd751028c4c6213b8aa59b5" have entirely different histories.

7 changed files with 4 additions and 37 deletions

2
.ccls
View File

@ -7,4 +7,4 @@ gcc
# Macros # Macros
-DASSET_FILE_NAME="$(make print-ASSET_OUTPUT)" -DASSET_FILE_NAME="$(make print-ASSET_OUTPUT)"
-DDEBUG=2 -DDEBUG=1

2
.vscode/launch.json vendored
View File

@ -9,7 +9,7 @@
"type": "gdb", "type": "gdb",
"request": "launch", "request": "launch",
"target": "${workspaceFolder}/build/2D_Engine", "target": "${workspaceFolder}/build/2D_Engine",
"cwd": "${workspaceFolder}/build", "cwd": "${workspaceFolder}",
"valuesFormatting": "parseText", "valuesFormatting": "parseText",
"preLaunchTask": "Build" "preLaunchTask": "Build"
} }

@ -1 +1 @@
Subproject commit 7f66cb41728fdea5e1f71b8a8f7212e54088f81c Subproject commit 4dbee83e8d89c965714fc521fa324e237dd35129

View File

@ -11,7 +11,7 @@ SRC_CC = gcc
ifeq ($(RELEASE), 1) ifeq ($(RELEASE), 1)
SRC_CFLAGS = --std=c17 --pedantic -O3 # RELEASE SRC_CFLAGS = --std=c17 --pedantic -O3 # RELEASE
else else
SRC_CFLAGS = --std=c17 --pedantic -O0 -g -DDEBUG=2 \ SRC_CFLAGS = --std=c17 --pedantic -O0 -g \
-Wall -Wno-missing-braces -Wextra -Wno-missing-field-initializers \ -Wall -Wno-missing-braces -Wextra -Wno-missing-field-initializers \
-Wformat=2 -Wswitch-default -Wswitch-enum -Wcast-align \ -Wformat=2 -Wswitch-default -Wswitch-enum -Wcast-align \
-Wpointer-arith -Wbad-function-cast -Wstrict-overflow=5 \ -Wpointer-arith -Wbad-function-cast -Wstrict-overflow=5 \

View File

@ -2,12 +2,7 @@
#define DRAW(PREFIX) PREFIX##_draw #define DRAW(PREFIX) PREFIX##_draw
#define NO_DRAW(...) NULL #define NO_DRAW(...) NULL
#if DEBUG >= 2
COMPONENT(TRANSFORM_COMPONENT, transform_component, DRAW)
#else
COMPONENT(TRANSFORM_COMPONENT, transform_component, NO_DRAW) COMPONENT(TRANSFORM_COMPONENT, transform_component, NO_DRAW)
#endif // DEBUG >= 2
COMPONENT(SPRITE_COMPONENT, sprite_component, DRAW) COMPONENT(SPRITE_COMPONENT, sprite_component, DRAW)
COMPONENT(ANIMATION_SYSTEM, animation_system, NO_DRAW) COMPONENT(ANIMATION_SYSTEM, animation_system, NO_DRAW)
COMPONENT(PLAYER_SYSTEM, player_system, NO_DRAW) COMPONENT(PLAYER_SYSTEM, player_system, NO_DRAW)

View File

@ -14,10 +14,6 @@ int transform_component_init(component_t *component);
int transform_component_update(component_t *component); int transform_component_update(component_t *component);
#if DEBUG >= 2
int transform_component_draw(component_t *component);
#endif
int transform_component_destroy(component_t *component); int transform_component_destroy(component_t *component);
#endif // TRANSFORM_COMPONENT_H #endif // TRANSFORM_COMPONENT_H

View File

@ -34,30 +34,6 @@ int transform_component_update(component_t *component)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#if DEBUG >= 2
#include "display.h"
#include "errors.h"
int transform_component_draw(component_t *component)
{
transform_component_data_t *component_data = component->component_data;
if(!SDL_SetRenderDrawColor(renderer, C_BLUE))
{
error_printf("Failed to change renderer draw color : %s", SDL_GetError());
return EXIT_FAILURE;
}
if(!SDL_RenderRect(renderer, &component_data->bounds))
{
error_printf("Failed to draw rectangle to renderer : %s", SDL_GetError());
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
#endif // DEBUG >= 2
inline int transform_component_destroy(component_t *component) inline int transform_component_destroy(component_t *component)
{ {
transform_component_data_t *component_data = component->component_data; transform_component_data_t *component_data = component->component_data;