save a whopping 2ms from gamestart to race start on texture updating
This commit is contained in:
1 parent
d82acd060c
commit
b77673550e
2 files changed
+8
-20
No files matched your search
@@ -319,7 +319,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
||||
patch_t *realpatch;
|
||||
INT32 blockwidth, blockheight, blocksize;
|
||||
|
||||
INT32 i;
|
||||
INT32 i, idx;
|
||||
boolean skyspecial = false; //poor hack for Legacy large skies..
|
||||
|
||||
RGBA_t *palette;
|
||||
@@ -368,12 +368,10 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
||||
|
||||
col = palette[HWR_CHROMAKEY_EQUIVALENTCOLORINDEX];
|
||||
|
||||
for (j = 0; j < blockheight; j++)
|
||||
for (idx = 0, j = 0; j < blockheight; j++)
|
||||
{
|
||||
for (i = 0; i < blockwidth; i++)
|
||||
for (i = 0; i < blockwidth; i++, idx++)
|
||||
{
|
||||
int idx = (j*blockwidth+i);
|
||||
|
||||
block[4*idx+0] = col.s.red;
|
||||
block[4*idx+1] = col.s.green;
|
||||
block[4*idx+2] = col.s.blue;
|
||||
|
||||
@@ -1644,10 +1644,7 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
{
|
||||
if (chromakeyed && (*pImgData == HWR_PATCHES_CHROMAKEY_COLORINDEX))
|
||||
{
|
||||
tex[idx].s.red = 0;
|
||||
tex[idx].s.green = 0;
|
||||
tex[idx].s.blue = 0;
|
||||
tex[idx].s.alpha = 0;
|
||||
tex[idx].s = (byteColor_t){0, 0, 0, 0};
|
||||
pTexInfo->flags |= TF_TRANSPARENT; // there is a hole in it
|
||||
}
|
||||
else
|
||||
@@ -1680,12 +1677,7 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
{
|
||||
for (i = 0; i < w; i++, idx++)
|
||||
{
|
||||
tex[idx].s.red = *pImgData;
|
||||
tex[idx].s.green = *pImgData;
|
||||
tex[idx].s.blue = *pImgData;
|
||||
pImgData++;
|
||||
tex[idx].s.alpha = *pImgData;
|
||||
pImgData++;
|
||||
tex[idx].s = (byteColor_t){*pImgData, *pImgData, *pImgData++, *pImgData++};
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1694,15 +1686,13 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
ptex = tex = textureBuffer;
|
||||
texformat = GL_ALPHA;
|
||||
|
||||
memset(&tex->s, 255, sizeof(byteColor_t)*w*h); // 255 because the fade mask is modulated with the screen texture, so alpha affects it while the colours don't
|
||||
|
||||
for (idx = 0, j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++, idx++)
|
||||
{
|
||||
tex[idx].s.red = 255; // 255 because the fade mask is modulated with the screen texture, so alpha affects it while the colours don't
|
||||
tex[idx].s.green = 255;
|
||||
tex[idx].s.blue = 255;
|
||||
tex[idx].s.alpha = *pImgData;
|
||||
pImgData++;
|
||||
tex[idx].s.alpha = *pImgData++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user