engine/EngineVideoTextureManager.c
/*	Called during init, and after a vid_restart.

	Choose safe warpimage size and resize existing warpimage textures.
*/
Called during init, and after a vid_restart.
Choose safe warpimage size and resize existing warpimage textures.
Called during init and after a vid_restart . Choose safe warpimage size and resize existing warpimage textures .
void TexMgr_RecalcWarpImageSize (void)
{
	int	mark, oldsize;
	gltexture_t *glt;
	uint8_t *dummy;
	 find the new correct size
	oldsize = gl_warpimagesize;
	gl_warpimagesize = TexMgr_SafeTextureSize (512);
	while((unsigned)gl_warpimagesize > Video.iWidth)
		gl_warpimagesize >>= 1;
	while((unsigned)gl_warpimagesize > Video.iHeight)
		gl_warpimagesize >>= 1;
	if (gl_warpimagesize == oldsize)
		return;
	 resize the textures in opengl
	mark = Hunk_LowMark();
	dummy = (uint8_t*)Hunk_Alloc (gl_warpimagesize*gl_warpimagesize*4);
	for (glt=active_gltextures; glt; glt=glt->next)
	{
		if (glt->flags & TEXPREF_WARPIMAGE)
		{
			Video_SetTexture(glt);
			glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, gl_warpimagesize, gl_warpimagesize, 0, GL_RGBA, GL_UNSIGNED_BYTE, dummy);
			glt->width = glt->height = gl_warpimagesize;
		}
	}
	Hunk_FreeToLowMark (mark);
}
void TexMgr_RecalcWarpImageSize ( void ) { int mark , oldsize ; gltexture_t * glt ; uint8_t * dummy ; oldsize = gl_warpimagesize ; gl_warpimagesize = TexMgr_SafeTextureSize ( 512 ) ; while ( ( unsigned ) gl_warpimagesize > Video . iWidth ) gl_warpimagesize >>= 1 ; while ( ( unsigned ) gl_warpimagesize > Video . iHeight ) gl_warpimagesize >>= 1 ; if ( gl_warpimagesize == oldsize ) return ; mark = Hunk_LowMark ( ) ; dummy = ( uint8_t * ) Hunk_Alloc ( gl_warpimagesize * gl_warpimagesize * 4 ) ; for ( glt = active_gltextures ; glt ; glt = glt -> next ) { if ( glt -> flags & TEXPREF_WARPIMAGE ) { Video_SetTexture ( glt ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , gl_solid_format , gl_warpimagesize , gl_warpimagesize , 0 , GL_RGBA , GL_UNSIGNED_BYTE , dummy ) ; glt -> width = glt -> height = gl_warpimagesize ; } } Hunk_FreeToLowMark ( mark ) ; }
Called during init, and after a vid_restart.
Called during init and after a vid_restart .
// // find the new correct size // // // resize the textures in opengl //