X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=gl_rmain.c;h=04b58483d06656df52ff864123951609a2c2525f;hp=ba4911de296663031ea808d6ecc9d4c3655bb4c9;hb=e25ec73b388ad038b3999b26d70c03c4a1b9c482;hpb=3558031f52b2116fbf2bf4ef4660ec2576fbf831 diff --git a/gl_rmain.c b/gl_rmain.c index ba4911de..04b58483 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3722,6 +3722,7 @@ void R_SetupShader_SetPermutationGLSL(unsigned int mode, unsigned int permutatio } if (r_glsl_permutation->loc_ModelViewProjectionMatrix >= 0) qglUniformMatrix4fvARB(r_glsl_permutation->loc_ModelViewProjectionMatrix, 1, false, gl_modelviewprojection16f); if (r_glsl_permutation->loc_ModelViewMatrix >= 0) qglUniformMatrix4fvARB(r_glsl_permutation->loc_ModelViewMatrix, 1, false, gl_modelview16f); + if (r_glsl_permutation->loc_ClientTime >= 0) qglUniform1fARB(r_glsl_permutation->loc_ClientTime, cl.time); } #ifdef SUPPORTCG @@ -4210,6 +4211,7 @@ void R_SetupShader_SetPermutationCG(unsigned int mode, unsigned int permutation) CHECKCGERROR if (r_cg_permutation->vp_ModelViewProjectionMatrix) cgGLSetMatrixParameterfc(r_cg_permutation->vp_ModelViewProjectionMatrix, gl_modelviewprojection16f);CHECKCGERROR if (r_cg_permutation->vp_ModelViewMatrix) cgGLSetMatrixParameterfc(r_cg_permutation->vp_ModelViewMatrix, gl_modelview16f);CHECKCGERROR + if (r_cg_permutation->fp_ClientTime) cgGLSetParameter1f(r_cg_permutation->fp_ClientTime, cl.time);CHECKCGERROR } void CG_BindTexture(CGparameter param, rtexture_t *tex) @@ -7788,7 +7790,6 @@ static void R_BlendView(void) if (r_glsl_permutation->loc_Texture_Second >= 0) R_Mesh_TexBind(GL20TU_SECOND , r_bloomstate.texture_bloom ); if (r_glsl_permutation->loc_Texture_GammaRamps >= 0) R_Mesh_TexBind(GL20TU_GAMMARAMPS, r_texture_gammaramps ); if (r_glsl_permutation->loc_ViewTintColor >= 0) qglUniform4fARB(r_glsl_permutation->loc_ViewTintColor , r_refdef.viewblend[0], r_refdef.viewblend[1], r_refdef.viewblend[2], r_refdef.viewblend[3]); - if (r_glsl_permutation->loc_ClientTime >= 0) qglUniform1fARB(r_glsl_permutation->loc_ClientTime , cl.time); if (r_glsl_permutation->loc_PixelSize >= 0) qglUniform2fARB(r_glsl_permutation->loc_PixelSize , 1.0/r_bloomstate.screentexturewidth, 1.0/r_bloomstate.screentextureheight); if (r_glsl_permutation->loc_UserVec1 >= 0) qglUniform4fARB(r_glsl_permutation->loc_UserVec1 , uservecs[0][0], uservecs[0][1], uservecs[0][2], uservecs[0][3]); if (r_glsl_permutation->loc_UserVec2 >= 0) qglUniform4fARB(r_glsl_permutation->loc_UserVec2 , uservecs[1][0], uservecs[1][1], uservecs[1][2], uservecs[1][3]); @@ -7804,7 +7805,6 @@ static void R_BlendView(void) if (r_cg_permutation->fp_Texture_Second ) CG_BindTexture(r_cg_permutation->fp_Texture_Second , r_bloomstate.texture_bloom );CHECKCGERROR if (r_cg_permutation->fp_Texture_GammaRamps) CG_BindTexture(r_cg_permutation->fp_Texture_GammaRamps, r_texture_gammaramps );CHECKCGERROR if (r_cg_permutation->fp_ViewTintColor ) cgGLSetParameter4f( r_cg_permutation->fp_ViewTintColor , r_refdef.viewblend[0], r_refdef.viewblend[1], r_refdef.viewblend[2], r_refdef.viewblend[3]);CHECKCGERROR - if (r_cg_permutation->fp_ClientTime ) cgGLSetParameter1f( r_cg_permutation->fp_ClientTime , cl.time);CHECKCGERROR if (r_cg_permutation->fp_PixelSize ) cgGLSetParameter2f( r_cg_permutation->fp_PixelSize , 1.0/r_bloomstate.screentexturewidth, 1.0/r_bloomstate.screentextureheight);CHECKCGERROR if (r_cg_permutation->fp_UserVec1 ) cgGLSetParameter4f( r_cg_permutation->fp_UserVec1 , uservecs[0][0], uservecs[0][1], uservecs[0][2], uservecs[0][3]);CHECKCGERROR if (r_cg_permutation->fp_UserVec2 ) cgGLSetParameter4f( r_cg_permutation->fp_UserVec2 , uservecs[1][0], uservecs[1][1], uservecs[1][2], uservecs[1][3]);CHECKCGERROR @@ -8196,11 +8196,8 @@ void R_RenderScene(void) if (skyrendermasked && skyrenderlater) { // we have to force off the water clipping plane while rendering sky - qboolean save = r_refdef.view.showdebug; R_SetupView(false); - r_refdef.view.showdebug = false; R_Sky(); - r_refdef.view.showdebug = save; R_SetupView(true); if (r_timereport_active) R_TimeReport("sky"); @@ -8860,7 +8857,7 @@ void R_LoadQWSkin(r_qwskincache_t *cache, const char *skinname) f = FS_LoadFile(name, tempmempool, true, &filesize); if (f) { - if (LoadPCX_QWSkin(f, filesize, pixels, 296, 194)) + if (LoadPCX_QWSkin(f, (int)filesize, pixels, 296, 194)) skinframe = R_SkinFrame_LoadInternalQuake(name, textureflags, true, r_fullbrights.integer, pixels, image_width, image_height); Mem_Free(f); } @@ -10980,7 +10977,7 @@ static void R_DrawWorldTextureSurfaceList(int texturenumsurfaces, const msurface { CHECKGLERROR RSurf_SetupDepthAndCulling(); - if (r_showsurfaces.integer == 3 && !prepass) + if (r_showsurfaces.integer == 3 && !prepass && (rsurface.texture->currentmaterialflags & MATERIALFLAG_SKY)) { R_DrawTextureSurfaceList_ShowSurfaces3(texturenumsurfaces, texturesurfacelist, writedepth); return; @@ -11005,7 +11002,7 @@ static void R_DrawModelTextureSurfaceList(int texturenumsurfaces, const msurface { CHECKGLERROR RSurf_SetupDepthAndCulling(); - if (r_showsurfaces.integer == 3 && !prepass) + if (r_showsurfaces.integer == 3 && !prepass && (rsurface.texture->currentmaterialflags & MATERIALFLAG_SKY)) { R_DrawTextureSurfaceList_ShowSurfaces3(texturenumsurfaces, texturesurfacelist, writedepth); return; @@ -11436,7 +11433,6 @@ static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float tridecal_t *decal; tridecal_t *decals; int i; - int maxdecals; // expand or initialize the system if (decalsystem->maxdecals <= decalsystem->numdecals) @@ -11463,7 +11459,6 @@ static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float } // grab a decal and search for another free slot for the next one - maxdecals = decalsystem->maxdecals; decals = decalsystem->decals; decal = decalsystem->decals + (i = decalsystem->freedecal++); for (i = decalsystem->freedecal;i < decalsystem->numdecals && decals[i].color4ub[0][3];i++) @@ -11520,13 +11515,11 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor const msurface_t *surfaces; const int *surfacelist; const texture_t *texture; - int numvertices; int numtriangles; int numsurfacelist; int surfacelistindex; int surfaceindex; int triangleindex; - int decalsurfaceindex; int cornerindex; int index; int numpoints; @@ -11536,7 +11529,6 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor float localmins[3]; float localmaxs[3]; float localsize; - float ilocalsize; float v[9][3]; float tc[9][2]; float c[9][4]; @@ -11572,7 +11564,6 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor Matrix4x4_Transform3x3(&rsurface.inversematrix, worldnormal, localnormal); VectorNormalize(localnormal); localsize = worldsize*rsurface.inversematrixscale; - ilocalsize = 1.0f / localsize; localmins[0] = localorigin[0] - localsize; localmins[1] = localorigin[1] - localsize; localmins[2] = localorigin[2] - localsize; @@ -11642,8 +11633,6 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor continue; if (texture->surfaceflags & Q3SURFACEFLAG_NOMARKS) continue; - decalsurfaceindex = ent == r_refdef.scene.worldentity ? surfaceindex : -1; - numvertices = surface->num_vertices; numtriangles = surface->num_triangles; for (triangleindex = 0, e = model->surfmesh.data_element3i + 3*surface->num_firsttriangle;triangleindex < numtriangles;triangleindex++, e += 3) { @@ -11858,7 +11847,6 @@ static void R_DrawModelDecals_Entity(entity_render_t *ent) decalsystem_t *decalsystem = &ent->decalsystem; int numdecals; tridecal_t *decal; - float fadedelay; float faderate; float alpha; float *v3f; @@ -11892,7 +11880,6 @@ static void R_DrawModelDecals_Entity(entity_render_t *ent) decalsystem->lastupdatetime = cl.time; decal = decalsystem->decals; - fadedelay = cl_decals_time.value; faderate = 1.0f / max(0.001f, cl_decals_fadetime.value); // update vertex positions for animated models @@ -12038,7 +12025,6 @@ void R_DrawDebugModel(void) { entity_render_t *ent = rsurface.entity; int i, j, k, l, flagsmask; - const int *elements; q3mbrush_t *brush; const msurface_t *surface; dp_model_t *model = ent->model; @@ -12107,7 +12093,6 @@ void R_DrawDebugModel(void) GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, r_showtris.value); else GL_Color(0, r_refdef.view.colorscale, 0, r_showtris.value); - elements = (model->surfmesh.data_element3i + 3 * surface->num_firsttriangle); R_Mesh_VertexPointer(rsurface.vertex3f, 0, 0); R_Mesh_ColorPointer(NULL, 0, 0); R_Mesh_TexCoordPointer(0, 0, NULL, 0, 0); @@ -12182,8 +12167,7 @@ int r_maxsurfacelist = 0; const msurface_t **r_surfacelist = NULL; void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass) { - int i, j, endj, f, flagsmask; - texture_t *t; + int i, j, endj, flagsmask; dp_model_t *model = r_refdef.scene.worldmodel; msurface_t *surfaces; unsigned char *update; @@ -12229,8 +12213,6 @@ void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean dep return; } - f = 0; - t = NULL; rsurface.uselightmaptexture = false; rsurface.texture = NULL; rsurface.rtlight = NULL; @@ -12279,8 +12261,7 @@ void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean dep void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass) { - int i, j, endj, f, flagsmask; - texture_t *t; + int i, j, endj, flagsmask; dp_model_t *model = ent->model; msurface_t *surfaces; unsigned char *update; @@ -12350,8 +12331,6 @@ void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean wr return; } - f = 0; - t = NULL; rsurface.uselightmaptexture = false; rsurface.texture = NULL; rsurface.rtlight = NULL;