diff --git a/code/game/header/utils/raylib_helpers.h b/code/game/header/utils/raylib_helpers.h index bffdf98..d65bf5d 100644 --- a/code/game/header/utils/raylib_helpers.h +++ b/code/game/header/utils/raylib_helpers.h @@ -50,6 +50,6 @@ void DrawRectangleEco(float posX, float posY, int width, int height, Color color } static inline -Texture2D GetBlockTexture(uint8_t id) { - return *(Texture2D*)blocks_get_tex(id); +Image GetBlockImage(uint8_t id) { + return *(Image*)blocks_get_img(id); } \ No newline at end of file diff --git a/code/game/header/world/blocks.h b/code/game/header/world/blocks.h index b053120..e855d4c 100644 --- a/code/game/header/world/blocks.h +++ b/code/game/header/world/blocks.h @@ -21,4 +21,4 @@ uint32_t blocks_get_biome(uint8_t id); uint32_t blocks_get_kind(uint8_t id); // NOTE(zaklaus): viewer-related functions -void *blocks_get_tex(uint8_t id); \ No newline at end of file +void *blocks_get_img(uint8_t id); \ No newline at end of file diff --git a/code/game/source/world/blocks.c b/code/game/source/world/blocks.c index 4d17eda..5976b04 100644 --- a/code/game/source/world/blocks.c +++ b/code/game/source/world/blocks.c @@ -14,7 +14,7 @@ typedef struct { char symbol; // NOTE(zaklaus): viewer data - Texture2D tex; + Image img; } block; #include "blocks_list.c" @@ -24,17 +24,14 @@ int32_t blocks_setup(void) { block *b = &blocks[i]; // TODO(zaklaus): introduce texgen - Image img = GenImageColor(WORLD_BLOCK_SIZE, WORLD_BLOCK_SIZE, RAYWHITE); - - b->tex = LoadTextureFromImage(img); - UnloadImage(img); + b->img = GenImageColor(WORLD_BLOCK_SIZE, WORLD_BLOCK_SIZE, RAYWHITE); } return 0; } void blocks_destroy(void) { for (uint32_t i=0; i