Texture cache fix.

This commit is contained in:
Steve 2015-11-22 16:52:27 +00:00
parent b6616c23de
commit 84e0b88d00
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ typedef struct {
} PointF; } PointF;
struct Texture { struct Texture {
char name[MAX_NAME_LENGTH]; char name[MAX_DESCRIPTION_LENGTH];
long hash; long hash;
SDL_Texture *texture; SDL_Texture *texture;
Texture *next; Texture *next;

View File

@ -48,7 +48,7 @@ static void addTextureToCache(char *name, SDL_Texture *texture)
new = malloc(sizeof(Texture)); new = malloc(sizeof(Texture));
memset(new, 0, sizeof(Texture)); memset(new, 0, sizeof(Texture));
STRNCPY(new->name, name, MAX_NAME_LENGTH); STRNCPY(new->name, name, MAX_DESCRIPTION_LENGTH);
new->texture = texture; new->texture = texture;
t->next = new; t->next = new;
@ -84,6 +84,8 @@ SDL_Texture *getTexture(char *filename)
} }
} }
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "%s not in texture cache", filename);
return loadTexture(filename); return loadTexture(filename);
} }