]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix for .alpha and other effects on sprites that use the same frame,
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 27 Feb 2012 18:31:30 +0000 (18:31 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 3 Mar 2012 11:22:31 +0000 (12:22 +0100)
they were all reusing the same alpha value, probably also broke
interpolation at the same time

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11735 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=8dc32923fc2d7d54c02c1b7646fdb2c5fce858b1

gl_rmain.c
render.h

index e659c81428c74c70d373bb81250daf218a984c1b..96c2c8a43cb3e4a9b17ce1ce3e3893ce03a86b85 100644 (file)
@@ -7752,7 +7752,7 @@ texture_t *R_GetCurrentTexture(texture_t *t)
        dp_model_t *model = ent->model;
        q3shaderinfo_layer_tcmod_t *tcmod;
 
-       if (t->update_lastrenderframe == r_textureframe && t->update_lastrenderentity == (void *)ent)
+       if (t->update_lastrenderframe == r_textureframe && t->update_lastrenderentity == (void *)ent && !rsurface.forcecurrenttextureupdate)
                return t->currentframe;
        t->update_lastrenderframe = r_textureframe;
        t->update_lastrenderentity = (void *)ent;
@@ -8167,6 +8167,7 @@ void RSurf_ActiveWorldEntity(void)
        rsurface.passcolor4f = NULL;
        rsurface.passcolor4f_vertexbuffer = NULL;
        rsurface.passcolor4f_bufferoffset = 0;
+       rsurface.forcecurrenttextureupdate = false;
 }
 
 void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, qboolean wanttangents, qboolean prepass)
@@ -8340,6 +8341,7 @@ void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, q
        rsurface.passcolor4f = NULL;
        rsurface.passcolor4f_vertexbuffer = NULL;
        rsurface.passcolor4f_bufferoffset = 0;
+       rsurface.forcecurrenttextureupdate = false;
 }
 
 void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, int entflags, double shadertime, float r, float g, float b, float a, int numvertices, const float *vertex3f, const float *texcoord2f, const float *normal3f, const float *svector3f, const float *tvector3f, const float *color4f, int numtriangles, const int *element3i, const unsigned short *element3s, qboolean wantnormals, qboolean wanttangents)
@@ -8463,6 +8465,7 @@ void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inve
        rsurface.passcolor4f = NULL;
        rsurface.passcolor4f_vertexbuffer = NULL;
        rsurface.passcolor4f_bufferoffset = 0;
+       rsurface.forcecurrenttextureupdate = true;
 
        if (rsurface.modelnumvertices && rsurface.modelelement3i)
        {
index 60fc6afe5b6e7c7e3ce53e0f960bc33ae6a7d38d..7e60e5048e08878cf69fb38f5744edbb813ee768 100644 (file)
--- a/render.h
+++ b/render.h
@@ -244,6 +244,7 @@ typedef struct rsurfacestate_s
        //
        // this indicates the model* arrays are pointed at array_model* buffers
        // (in other words, the model has been animated in software)
+       qboolean                    forcecurrenttextureupdate; // set for RSurf_ActiveCustomEntity to force R_GetCurrentTexture to recalculate the texture parameters (such as entity alpha)
        qboolean                    modelgeneratedvertex;
        float                      *modelvertex3f;
        const r_meshbuffer_t       *modelvertex3f_vertexbuffer;