mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 14:01:26 +00:00
gl_sky.c (skybox_name): lazily increase array size from 32 to 1024.
See: https://sourceforge.net/p/quakespasm/bugs/38/ Also move its initializer to Sky_Init() and use q_strlcpy() instead of strcpy() for copying to it in Sky_LoadSkyBox(). git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1669 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
ca71fe55db
commit
bda9912002
1 changed files with 3 additions and 2 deletions
|
@ -35,7 +35,7 @@ extern int rs_skypasses; //for r_speeds readout
|
|||
float skyflatcolor[3];
|
||||
float skymins[2][6], skymaxs[2][6];
|
||||
|
||||
char skybox_name[32] = ""; //name of current skybox, or "" if no skybox
|
||||
char skybox_name[1024]; //name of current skybox, or "" if no skybox
|
||||
|
||||
gltexture_t *skybox_textures[6];
|
||||
gltexture_t *solidskytexture, *alphaskytexture;
|
||||
|
@ -205,7 +205,7 @@ void Sky_LoadSkyBox (const char *name)
|
|||
return;
|
||||
}
|
||||
|
||||
strcpy(skybox_name, name);
|
||||
q_strlcpy(skybox_name, name, sizeof(skybox_name));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -321,6 +321,7 @@ void Sky_Init (void)
|
|||
|
||||
Cmd_AddCommand ("sky",Sky_SkyCommand_f);
|
||||
|
||||
skybox_name[0] = 0;
|
||||
for (i=0; i<6; i++)
|
||||
skybox_textures[i] = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue