twn_skybox.c

This commit is contained in:
2024-09-26 21:02:56 +03:00
parent 0fe1023667
commit c0dcdf8c0a
22 changed files with 268 additions and 13 deletions

View File

@ -42,7 +42,7 @@ static int load_eof_callback(void *user) {
return context->position == context->size;
}
static SDL_Surface *image_to_surface(const char *path) {
SDL_Surface *textures_load_surface(const char *path) {
SDL_RWops *handle = PHYSFSRWOPS_openRead(path);
if (handle == NULL)
goto ERR_CANNOT_OPEN_FILE;
@ -359,7 +359,7 @@ static TextureKey textures_load(TextureCache *cache, const char *path) {
if (i >= 0)
return (TextureKey){ (uint16_t)i };
SDL_Surface *surface = image_to_surface(path);
SDL_Surface *surface = textures_load_surface(path);
Texture new_texture = {
.data = surface,
.mode = infer_texture_mode(surface),