mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-18 23:41:38 +00:00
Enable TGA sky textures when retexturing is disabled
This commit is contained in:
parent
1e52d35e84
commit
8a28470a7a
1 changed files with 22 additions and 6 deletions
|
@ -1050,10 +1050,7 @@ R_FindImage(char *name, imagetype_t type)
|
|||
int width, height;
|
||||
char *ptr;
|
||||
char namewe[256];
|
||||
|
||||
#ifdef RETEXTURE
|
||||
int realwidth = 0, realheight = 0;
|
||||
#endif
|
||||
|
||||
if (!name)
|
||||
{
|
||||
|
@ -1202,14 +1199,33 @@ R_FindImage(char *name, imagetype_t type)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef RETEXTURE
|
||||
else if (!strcmp(name + len - 4, ".tga"))
|
||||
{
|
||||
char tmp_name[256];
|
||||
|
||||
realwidth = 0;
|
||||
realheight = 0;
|
||||
|
||||
strcpy(tmp_name, namewe);
|
||||
strcat(tmp_name, ".wal");
|
||||
GetWalInfo(tmp_name, &realwidth, &realheight);
|
||||
|
||||
if (realwidth == 0 || realheight == 0) {
|
||||
/* It's a sky. */
|
||||
strcpy(tmp_name, namewe);
|
||||
strcat(tmp_name, ".pcx");
|
||||
GetPCXInfo(tmp_name, &realwidth, &realheight);
|
||||
}
|
||||
|
||||
if (realwidth == 0 || realheight == 0)
|
||||
return NULL;
|
||||
|
||||
LoadTGA(name, &pic, &width, &height);
|
||||
image = R_LoadPic(name, pic, width, realwidth,
|
||||
height, realwidth, type, 32);
|
||||
height, realheight, type, 32);
|
||||
}
|
||||
|
||||
#ifdef RETEXTURE
|
||||
else if (!strcmp(name + len - 4, ".jpg"))
|
||||
{
|
||||
LoadJPG(name, &pic, &width, &height);
|
||||
|
|
Loading…
Reference in a new issue