#include "quakedef.h"
-
-/*
-==================
-R_InitTextures
-==================
-*/
-void R_InitTextures (void)
-{
- int x,y, m;
- byte *dest;
-
-// create a simple checkerboard texture for the default
- r_notexture_mip = Hunk_AllocName (sizeof(texture_t) + 16*16+8*8+4*4+2*2, "notexture");
-
- r_notexture_mip->width = r_notexture_mip->height = 16;
- r_notexture_mip->offsets[0] = sizeof(texture_t);
- r_notexture_mip->offsets[1] = r_notexture_mip->offsets[0] + 16*16;
- r_notexture_mip->offsets[2] = r_notexture_mip->offsets[1] + 8*8;
- r_notexture_mip->offsets[3] = r_notexture_mip->offsets[2] + 4*4;
- r_notexture_mip->transparent = false;
-
- for (m=0 ; m<4 ; m++)
- {
- dest = (byte *)r_notexture_mip + r_notexture_mip->offsets[m];
- for (y=0 ; y< (16>>m) ; y++)
- for (x=0 ; x< (16>>m) ; x++)
- {
- if ( (y< (8>>m) ) ^ (x< (8>>m) ) )
- *dest++ = 0;
- else
- *dest++ = 0xff;
- }
- }
-}
-
/*
===============
R_Envmap_f
void R_InitParticles (void);
-void gl_misc_start()
+void gl_misc_start(void)
{
}
-void gl_misc_shutdown()
+void gl_misc_shutdown(void)
{
}
-void gl_misc_newmap()
+void gl_misc_newmap(void)
{
}
R_RegisterModule("GL_Misc", gl_misc_start, gl_misc_shutdown, gl_misc_newmap);
}
-void R_ClearParticles (void);
-void GL_BuildLightmaps (void);
+extern void R_ClearParticles (void);
+extern void GL_BuildLightmaps (void);
/*
===============
R_NewMap
===============
*/
-void SHOWLMP_clear();
void R_NewMap (void)
{
int i;
r_worldentity.render.model = cl.worldmodel;
currententity = &r_worldentity;
-// clear out efrags in case the level hasn't been reloaded
-// FIXME: is this one short?
- for (i=0 ; i<cl.worldmodel->numleafs ; i++)
- cl.worldmodel->leafs[i].efrags = NULL;
-
r_viewleaf = NULL;
R_Modules_NewMap();
GL_BuildLightmaps ();
- // identify sky texture
- skytexturenum = -1;
- for (i=0 ; i<cl.worldmodel->numtextures ; i++)
- {
- if (!cl.worldmodel->textures[i])
- continue;
- if (!strncmp(cl.worldmodel->textures[i]->name,"sky",3) )
- skytexturenum = i;
- cl.worldmodel->textures[i]->texturechain = NULL;
- }
SHOWLMP_clear();
}
float start, stop, time;
intimerefresh = 1;
- start = Sys_FloatTime ();
- for (i=0 ; i<128 ; i++)
+ start = Sys_DoubleTime ();
+ for (i = 0;i < 128;i++)
{
+ r_refdef.viewangles[0] = 0;
r_refdef.viewangles[1] = i/128.0*360.0;
+ r_refdef.viewangles[2] = 0;
SCR_UpdateScreen();
}
- stop = Sys_FloatTime ();
+ stop = Sys_DoubleTime ();
intimerefresh = 0;
time = stop-start;
Con_Printf ("%f seconds (%f fps)\n", time, 128/time);