The first set of changes are in the texture loader. Break open gl_model.c and change the following.
In Mod_LoadTextures, replace:
Code: Select all
tx = Hunk_AllocName (sizeof(texture_t) +pixels, loadname );
Code: Select all
tx = Hunk_AllocName (sizeof(texture_t), loadname );
Code: Select all
// the pixels immediately follow the structures
memcpy ( tx+1, mt+1, pixels);
Code: Select all
tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx+1), true, false);
Code: Select all
tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(mt+1), true, false);
Code: Select all
R_InitSky (tx);
Code: Select all
R_InitSky (mt);
change
Code: Select all
void R_InitSky (struct texture_s *mt); // called at level load
Code: Select all
void R_InitSky (struct miptex_s *mt); // called at level load
replace
Code: Select all
void R_InitSky (texture_t *mt)
Code: Select all
void R_InitSky (miptex_t *mt)
The saving for this one? I loaded e1m3, before was 421104 bytes for textures, after was 4992 bytes. That's almost half a MB wasted in stock GLQuake.