Clean project structure

Moved resources to a new resources directory and moved headers to src/
This commit is contained in:
duarteapcoelho 2022-11-11 16:07:25 +00:00
parent cca9791e12
commit 7c2a6c8341
17 changed files with 6 additions and 6 deletions

View File

@ -3,12 +3,11 @@ CFLAGS += -Wall -Wextra
CFLAGS += -DSDL
LIB += -lSDL2 -lSDL2_ttf
LDFLAGS = $(LIB)
INCLUDES = -Iinclude
INCLUDES =
SRCDIR = src
SOURCES = $(wildcard src/*.cpp)
HEADERS = $(wildcard $(INCDIR)/*.h)
OBJECTS = $(patsubst $(SRCDIR)/%,build_sdl/%,$(SOURCES:.cpp=.o))
DEPS = $(patsubst $(SRCDIR)/%,build_sdl/%,$(SOURCES:.cpp=.d))
@ -39,7 +38,8 @@ build_sdl/%.o: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ -MMD $< -MF "build_sdl/$(patsubst $(SRCDIR)/%,%,$(<:.cpp=.d))"
clean:
rm $(TARGET) build_sdl/*
rm $(TARGET)
rm build_sdl -r
.PHONY: clean

4
Makefile-prizm Executable file → Normal file
View File

@ -23,13 +23,13 @@ TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src
DATA := data
INCLUDES := include
INCLUDES :=
#---------------------------------------------------------------------------------
# options for code and add-in generation
#---------------------------------------------------------------------------------
MKG3AFLAGS := -n basic:racing -i uns:../unselected.bmp -i sel:../selected.bmp
MKG3AFLAGS := -n basic:racing -i uns:../resources/unselected.bmp -i sel:../resources/selected.bmp
# Optional: add -flto to CFLAGS and LDFLAGS to enable link-time optimization
# (LTO). Doing so will usually allow the compiler to generate much better code

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -33,7 +33,7 @@ namespace Display {
show();
TTF_Init();
font = TTF_OpenFont("font.ttf", 10);
font = TTF_OpenFont("resources/font.ttf", 10);
TTF_SizeText(font, "A", NULL, &textHeight);
}