]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
rewrite of map texture loading (mainly to do with HL textures and wads)
[xonotic/darkplaces.git] / gl_rmain.c
index 907822e19cbc1295a82a4bacd4eb131960d25e88..11a1c481cc255973d7946c656d628386afbb506d 100644 (file)
@@ -80,9 +80,9 @@ cvar_t        r_novis = {"r_novis","0"};
 cvar_t r_waterripple = {"r_waterripple","0"};
 cvar_t r_fullbrights = {"r_fullbrights", "1"};
 
-cvar_t contrast = {"contrast", "1.0", TRUE}; // LordHavoc: a method of operating system independent color correction
-cvar_t brightness = {"brightness", "1.0", TRUE}; // LordHavoc: a method of operating system independent color correction
-cvar_t gl_lightmode = {"gl_lightmode", "1", TRUE}; // LordHavoc: overbright lighting
+cvar_t contrast = {"contrast", "1.0", true}; // LordHavoc: a method of operating system independent color correction
+cvar_t brightness = {"brightness", "1.0", true}; // LordHavoc: a method of operating system independent color correction
+cvar_t gl_lightmode = {"gl_lightmode", "1", true}; // LordHavoc: overbright lighting
 //cvar_t       r_dynamicbothsides = {"r_dynamicbothsides", "1"}; // LordHavoc: can disable dynamic lighting of backfaces, but quake maps are weird so it doesn't always work right...
 cvar_t r_farclip = {"r_farclip", "6144"};
 
@@ -256,6 +256,7 @@ extern void GL_Misc_Init();
 extern void R_Crosshairs_Init();
 extern void R_Light_Init();
 extern void R_Particles_Init();
+extern void R_Explosion_Init();
 
 void Render_Init()
 {
@@ -270,6 +271,7 @@ void Render_Init()
        R_Crosshairs_Init();
        R_Light_Init();
        R_Particles_Init();
+       R_Explosion_Init();
        R_StartModules();
 }
 
@@ -380,7 +382,7 @@ void R_DrawEntitiesOnList2 (void)
                switch (currententity->model->type)
                {
                case mod_alias:
-                       R_DrawAliasModel (currententity, true, modelalpha, currententity->model, currententity->frame, currententity->skinnum, currententity->origin, currententity->effects, currententity->model->flags, currententity->colormap);
+                       R_DrawAliasModel (currententity, true, modelalpha, currententity->model, currententity->frame, currententity->skinnum, currententity->origin, currententity->angles, currententity->effects, currententity->model->flags, currententity->colormap);
                        break;
 
                case mod_sprite:
@@ -411,7 +413,7 @@ void R_DrawViewModel (void)
 
        // hack the depth range to prevent view model from poking into walls
        glDepthRange (gldepthmin, gldepthmin + 0.3*(gldepthmax-gldepthmin));
-       R_DrawAliasModel (currententity, FALSE, modelalpha, currententity->model, currententity->frame, currententity->skinnum, currententity->origin, currententity->effects, currententity->model->flags, currententity->colormap);
+       R_DrawAliasModel (currententity, false, modelalpha, currententity->model, currententity->frame, currententity->skinnum, currententity->origin, currententity->angles, currententity->effects, currententity->model->flags, currententity->colormap);
        glDepthRange (gldepthmin, gldepthmax);
 }
 
@@ -499,8 +501,7 @@ void R_SetupFrame (void)
        c_bmodels = 0;
        c_sprites = 0;
        c_particles = 0;
-       c_dlights = 0;
-
+//     c_dlights = 0;
 }
 
 
@@ -706,7 +707,9 @@ void GL_BlendView()
                temptime = currtime;\
                currtime = Sys_FloatTime();\
                VAR = (int) ((currtime - temptime) * 1000000.0);\
-       }
+       }\
+       else\
+               VAR = 0;
 
 /*
 ================
@@ -723,7 +726,7 @@ char r_speeds2_string1[81], r_speeds2_string2[81], r_speeds2_string3[81], r_spee
 void R_RenderView (void)
 {
        double starttime, currtime, temptime;
-       int time_clear, time_setup, time_world, time_bmodels, time_upload, time_sky, time_wall, time_models, time_moveparticles, time_drawparticles, time_transpoly, time_blend, time_total;
+       int time_clear, time_setup, time_world, time_bmodels, time_upload, time_sky, time_wall, time_models, time_moveparticles, time_drawparticles, time_moveexplosions, time_drawexplosions, time_transpoly, time_blend, time_total;
 //     double currtime, temptime;
 //     if (r_norefresh.value)
 //             return;
@@ -740,6 +743,8 @@ void R_RenderView (void)
                starttime = currtime = Sys_FloatTime();
 //             Con_Printf("render time: ");
        }
+       else
+               starttime = currtime = 0;
        R_Clear();
        skypolyclear();
        wallpolyclear();
@@ -783,6 +788,10 @@ void R_RenderView (void)
        TIMEREPORT(time_moveparticles)
        R_DrawParticles ();
        TIMEREPORT(time_drawparticles)
+       R_MoveExplosions();
+       TIMEREPORT(time_moveexplosions)
+       R_DrawExplosions();
+       TIMEREPORT(time_drawexplosions)
 
        transpolyrender();
        TIMEREPORT(time_transpoly)