mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
renders: fix maps with hardcoded image extensions
This commit is contained in:
parent
fbdc7e3f79
commit
e673301dfb
1 changed files with 28 additions and 2 deletions
|
@ -597,6 +597,7 @@ R_LoadImage(const char *name, const char* namewe, const char *ext, imagetype_t t
|
|||
|
||||
/* original name */
|
||||
image = LoadImage_Ext(name, namewe, ext, type, r_retexturing, load_image);
|
||||
|
||||
/* pcx check */
|
||||
if (!image)
|
||||
{
|
||||
|
@ -672,7 +673,6 @@ GetSkyImage(const char *skyname, const char* surfname, qboolean palettedtexture,
|
|||
struct image_s *
|
||||
GetTexImage(const char *name, findimage_t find_image)
|
||||
{
|
||||
struct image_s *image = NULL;
|
||||
char pathname[MAX_QPATH];
|
||||
|
||||
/* Quake 2 */
|
||||
|
@ -688,10 +688,36 @@ R_FindPic(const char *name, findimage_t find_image)
|
|||
if ((name[0] != '/') && (name[0] != '\\'))
|
||||
{
|
||||
char pathname[MAX_QPATH];
|
||||
char namewe[MAX_QPATH];
|
||||
const char* ext;
|
||||
|
||||
ext = COM_FileExtension(name);
|
||||
if(!ext[0])
|
||||
{
|
||||
/* file has no extension */
|
||||
strncpy(namewe, name, MAX_QPATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
len = strlen(name);
|
||||
|
||||
/* Remove the extension */
|
||||
memset(namewe, 0, MAX_QPATH);
|
||||
memcpy(namewe, name, len - (strlen(ext) + 1));
|
||||
}
|
||||
|
||||
/* Quake 2 */
|
||||
Com_sprintf(pathname, sizeof(pathname), "pics/%s.pcx", name);
|
||||
Com_sprintf(pathname, sizeof(pathname), "pics/%s.pcx", namewe);
|
||||
image = find_image(pathname, it_pic);
|
||||
|
||||
/* Heretic 2 */
|
||||
if (!image)
|
||||
{
|
||||
Com_sprintf(pathname, sizeof(pathname), "pics/misc/%s.m32", name);
|
||||
image = find_image(pathname, it_pic);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue