Fixed a bug were black squares would render in the world after switching to a new level.

This commit is contained in:
Justin Marshall
2020-06-23 20:44:47 -07:00
parent e76e8ed828
commit 61ca0cfa5a
2 changed files with 21 additions and 2 deletions
+8 -1
View File
@@ -194,7 +194,7 @@ Image_t* Load_StampHD(int theater, const char* iconName, const void* icondata) {
char filename[2048];
Image_t* image = NULL;
IconControlType* tileset = (IconControlType*)icondata;
IconControlType* tileset = (IconControlType*)icondata;
if (!tileset) {
return NULL;
@@ -222,6 +222,13 @@ Image_t* Load_StampHD(int theater, const char* iconName, const void* icondata) {
COM_SetExtension(filename, sizeof(filename), ".dds");
if (image == NULL) {
// If the image is already loaded, then we are done.
image = Find_Image(filename);
if (image) {
return image;
}
// Load the initial terrain image.
image = Image_LoadImage(filename);
if (image != NULL && i != 0) {
+13 -1
View File
@@ -158,7 +158,19 @@ static bool Image_LoadFromCache(Image_t* image, const char* name, int houseid, i
return true;
}
static bool Image_loadHDImage(Image_t *image, const char* name, int houseid, int animid, int frameId, int64_t hash) {
static bool Image_loadHDImage(Image_t *image, const char* name, int houseid, int animid, int frameId, int64_t hash) {
// Don't load the image if its already loaded.
if (houseid == -1) {
if (image->HouseImages[0].image[animid][frameId] != 0) {
return true;
}
}
else {
if (image->HouseImages[houseid].image[animid][frameId] != 0) {
return true;
}
}
const char* generatedName = Image_GetGeneratedName(image, name, houseid, animid, frameId, hash);
hash = generateHashValue(generatedName, strlen(generatedName));