]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_explosion.c
the big chat area/font patch... hope it works well. Tested in Nexuiz and Quake. Fonts...
[xonotic/darkplaces.git] / r_explosion.c
index 3d8efefbf5c4452d0ebe6e5e47c0e986bcd6599e..90a5fcf5d664ad3e763d19705b7b1ebb2ec2e4cc 100644 (file)
@@ -73,17 +73,17 @@ static void r_explosion_start(void)
                        g = (j * 256) / 256;
                        b = (j * 128) / 256;
                        a = noise3[y][x] * 3 - 128;
-                       data[y][x][0] = bound(0, r, 255);
+                       data[y][x][2] = bound(0, r, 255);
                        data[y][x][1] = bound(0, g, 255);
-                       data[y][x][2] = bound(0, b, 255);
+                       data[y][x][0] = bound(0, b, 255);
                        data[y][x][3] = bound(0, a, 255);
                }
        }
-       explosiontexture = R_LoadTexture2D(explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE, NULL);
+       explosiontexture = R_LoadTexture2D(explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE, NULL);
        for (y = 0;y < 128;y++)
                for (x = 0;x < 128;x++)
                        data[y][x][0] = data[y][x][1] = data[y][x][2] = 255;
-       explosiontexturefog = R_LoadTexture2D(explosiontexturepool, "explosiontexturefog", 128, 128, &data[0][0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE, NULL);
+       explosiontexturefog = R_LoadTexture2D(explosiontexturepool, "explosiontexturefog", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE, NULL);
        // note that explosions survive the restart
 }
 
@@ -187,8 +187,10 @@ static void R_DrawExplosion_TransparentCallback(const entity_render_t *ent, cons
        rmeshstate_t m;
        GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
        GL_DepthMask(false);
+       GL_DepthRange(0, 1);
+       GL_PolygonOffset(r_refdef.polygonfactor, r_refdef.polygonoffset);
        GL_DepthTest(true);
-       GL_CullFace(GL_FRONT); // quake is backwards, this culls back faces
+       GL_CullFace(r_view.cullface_back);
        R_Mesh_Matrix(&identitymatrix);
 
        R_Mesh_ColorPointer(NULL, 0, 0);