mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-18 22:41:49 +00:00
Removed size limit of 512x256 for .wal textures.
This commit is contained in:
parent
2efcb5a672
commit
f1b6052f15
2 changed files with 41 additions and 46 deletions
|
@ -18,6 +18,8 @@ Changes as of v0.20 update 8:
|
||||||
|
|
||||||
- Screenshots now go up to 9999.
|
- Screenshots now go up to 9999.
|
||||||
|
|
||||||
|
- Removed size limit of 512x256 for .wal textures. This fixes the "GL_Upload8: too large" error with 512x512 or larger .wal textures.
|
||||||
|
|
||||||
- Added cvar r_fog_skyratio, for proportional sky fog distance. Default is 10.
|
- Added cvar r_fog_skyratio, for proportional sky fog distance. Default is 10.
|
||||||
|
|
||||||
- Added basegame3 cvar to load data from up to 3 other other mods. Works in conjunction with basegame and basegame2,
|
- Added basegame3 cvar to load data from up to 3 other other mods. Works in conjunction with basegame and basegame2,
|
||||||
|
|
|
@ -1910,34 +1910,19 @@ Returns has_alpha
|
||||||
*/
|
*/
|
||||||
qboolean GL_Upload8 (byte *data, int width, int height, imagetype_t type)
|
qboolean GL_Upload8 (byte *data, int width, int height, imagetype_t type)
|
||||||
{
|
{
|
||||||
unsigned trans[512*256];
|
// unsigned trans[512*256];
|
||||||
|
unsigned *trans = NULL; // Knightmare- changed to dynamic allocation
|
||||||
int i, s;
|
int i, s;
|
||||||
int p;
|
int p;
|
||||||
|
qboolean has_alpha; // Knightmare added
|
||||||
|
|
||||||
s = width*height;
|
s = width*height;
|
||||||
|
|
||||||
if (s > sizeof(trans)/4)
|
// if (s > sizeof(trans)/4)
|
||||||
VID_Error (ERR_DROP, "GL_Upload8: too large");
|
// VID_Error (ERR_DROP, "GL_Upload8: too large");
|
||||||
|
|
||||||
/*if ( qglColorTableEXT &&
|
trans = (unsigned *)malloc(s*4); // Knightmare- changed to dynamic allocation
|
||||||
gl_ext_palettedtexture->value &&
|
|
||||||
(type == it_sky) )
|
|
||||||
{
|
|
||||||
qglTexImage2D( GL_TEXTURE_2D,
|
|
||||||
0,
|
|
||||||
GL_COLOR_INDEX8_EXT,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
0,
|
|
||||||
GL_COLOR_INDEX,
|
|
||||||
GL_UNSIGNED_BYTE,
|
|
||||||
data );
|
|
||||||
|
|
||||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max);
|
|
||||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
|
||||||
}
|
|
||||||
else*/
|
|
||||||
{
|
|
||||||
for (i=0 ; i<s ; i++)
|
for (i=0 ; i<s ; i++)
|
||||||
{
|
{
|
||||||
p = data[i];
|
p = data[i];
|
||||||
|
@ -1964,8 +1949,16 @@ qboolean GL_Upload8 (byte *data, int width, int height, imagetype_t type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_Upload32 (trans, width, height, type);
|
// return GL_Upload32 (trans, width, height, type);
|
||||||
}
|
|
||||||
|
// Knightmare- changed to dynamic allocation
|
||||||
|
has_alpha = GL_Upload32 (trans, width, height, type);
|
||||||
|
|
||||||
|
free (trans);
|
||||||
|
trans = NULL;
|
||||||
|
|
||||||
|
return has_alpha;
|
||||||
|
// end Knightmare
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue