mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Fixed a bug were black squares would render in the world after switching to a new level.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user