mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-29 07:41:47 +00:00
render: support texture name with full field size
This commit is contained in:
parent
ea91764196
commit
2f0d3e2189
1 changed files with 6 additions and 2 deletions
|
@ -505,6 +505,7 @@ Mod_LoadTexinfoQ2(const char *name, mtexinfo_t **texinfo, int *numtexinfo,
|
|||
{
|
||||
struct image_s *image;
|
||||
int j, next;
|
||||
char imagename[sizeof(in->texture) + 1];
|
||||
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
|
@ -529,11 +530,14 @@ Mod_LoadTexinfoQ2(const char *name, mtexinfo_t **texinfo, int *numtexinfo,
|
|||
out->next = NULL;
|
||||
}
|
||||
|
||||
image = GetTexImage(in->texture, find_image);
|
||||
memcpy(imagename, in->texture, sizeof(in->texture));
|
||||
/* add last zero if name is too long */
|
||||
imagename[sizeof(in->texture)] = 0;
|
||||
image = GetTexImage(imagename, find_image);
|
||||
if (!image)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Couldn't load %s\n",
|
||||
__func__, in->texture);
|
||||
__func__, imagename);
|
||||
image = notexture;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue