Moved code and assets for the game to a seperate folder. Moved jansson and raylib to third_party.

This commit is contained in:
2025-12-16 11:47:55 +01:00
parent fd2dbf232d
commit 8cdbd5b162
63 changed files with 14 additions and 14 deletions

View File

@@ -12,7 +12,7 @@ else
endif endif
BUILD_DIR := build/$(PLATFORM) BUILD_DIR := build/$(PLATFORM)
CFLAGS := -g -Isrc -Wextra -MMD -MP -Wall -pedantic CFLAGS := -g -Isrc -Isrc/game -Wextra -MMD -MP -Wall -pedantic
LDFLAGS := -flto -Wl,--gc-sections LDFLAGS := -flto -Wl,--gc-sections
LIB_DIR := $(abspath libs/$(PLATFORM)) LIB_DIR := $(abspath libs/$(PLATFORM))
@@ -43,7 +43,7 @@ run: $(BIN)
$(BIN): $(OBJ) $(BIN): $(OBJ)
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
@cp -r $(SRC_DIR)/assets $(BUILD_DIR) @cp -r $(SRC_DIR)/game/assets $(BUILD_DIR)/game/assets
@cp -r libs $(BUILD_DIR) @cp -r libs $(BUILD_DIR)
@$(CC) $(LDFLAGS) $(OBJ) -o $@ $(LIBS) @$(CC) $(LDFLAGS) $(OBJ) -o $@ $(LIBS)

View File

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View File

Before

Width:  |  Height:  |  Size: 653 B

After

Width:  |  Height:  |  Size: 653 B

View File

Before

Width:  |  Height:  |  Size: 592 B

After

Width:  |  Height:  |  Size: 592 B

View File

Before

Width:  |  Height:  |  Size: 592 B

After

Width:  |  Height:  |  Size: 592 B

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

@@ -5,8 +5,8 @@
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include "raylib.h" #include "third_party/raylib.h"
#include "raygui.h" #include "third_party/raygui.h"
#include "session/game_session.h" #include "session/game_session.h"
@@ -31,15 +31,15 @@ static void state_enter(Presentation_State *state) {
// TODO: SS - Maybe put the textures in an array and index them using an enum? // TODO: SS - Maybe put the textures in an array and index them using an enum?
// These should probably be loaded at start-up instead of here. // These should probably be loaded at start-up instead of here.
ctx->texture_shadow_basic = LoadTexture("assets/sprites/spr_shadow_basic.png"); ctx->texture_shadow_basic = LoadTexture("game/assets/sprites/spr_shadow_basic.png");
assert(IsTextureValid(ctx->texture_shadow_basic)); assert(IsTextureValid(ctx->texture_shadow_basic));
ctx->texture_grass = LoadTexture("assets/sprites/spr_floor_grass.png"); ctx->texture_grass = LoadTexture("game/assets/sprites/spr_floor_grass.png");
assert(IsTextureValid(ctx->texture_grass)); assert(IsTextureValid(ctx->texture_grass));
ctx->texture_apple = LoadTexture("assets/sprites/spr_food_apple.png"); ctx->texture_apple = LoadTexture("game/assets/sprites/spr_food_apple.png");
assert(IsTextureValid(ctx->texture_apple)); assert(IsTextureValid(ctx->texture_apple));
ctx->texture_snake_head = LoadTexture("assets/sprites/spr_snake_head.png"); ctx->texture_snake_head = LoadTexture("game/assets/sprites/spr_snake_head.png");
assert(IsTextureValid(ctx->texture_snake_head)); assert(IsTextureValid(ctx->texture_snake_head));
ctx->texture_snake_body = LoadTexture("assets/sprites/spr_snake_body.png"); ctx->texture_snake_body = LoadTexture("game/assets/sprites/spr_snake_body.png");
assert(IsTextureValid(ctx->texture_snake_body)); assert(IsTextureValid(ctx->texture_snake_body));
} }

View File

@@ -4,7 +4,7 @@
#include "states.h" #include "states.h"
#include "simulation/simulation_world.h" #include "simulation/simulation_world.h"
#include "raylib.h" #include "third_party/raylib.h"
#include "instance/game_instance.h" #include "instance/game_instance.h"
typedef struct { typedef struct {

View File

@@ -4,8 +4,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <assert.h> #include <assert.h>
#include "raylib.h" #include "third_party/raylib.h"
#include "raygui.h" #include "third_party/raygui.h"
#include "session/networking.h" #include "session/networking.h"

View File

@@ -2,7 +2,7 @@
#define MULTIPLAYER_API_H #define MULTIPLAYER_API_H
#include <stdint.h> #include <stdint.h>
#include "jansson/jansson.h" #include "third_party/jansson/jansson.h"
typedef struct MultiplayerApi MultiplayerApi; typedef struct MultiplayerApi MultiplayerApi;

View File

@@ -5,7 +5,7 @@
#include "presentation/states/state_ingame.h" #include "presentation/states/state_ingame.h"
#include "presentation/states/state_main_menu.h" #include "presentation/states/state_main_menu.h"
#include "raylib.h" #include "third_party/raylib.h"
#include "session/networking.h" #include "session/networking.h"
#include "instance/game_instance.h" #include "instance/game_instance.h"