mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-28 14:31:15 +00:00
Stop using NextTexAvail you dunce
This commit is contained in:
parent
b9b1958886
commit
c219a170da
1 changed files with 11 additions and 30 deletions
|
@ -55,7 +55,6 @@ static float NEAR_CLIPPING_PLANE = NZCLIP_PLANE;
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
|
||||||
static GLuint NextTexAvail = FIRST_TEX_AVAIL;
|
|
||||||
static GLuint tex_downloaded = 0;
|
static GLuint tex_downloaded = 0;
|
||||||
static GLfloat fov = 90.0f;
|
static GLfloat fov = 90.0f;
|
||||||
static FBITFIELD CurrentPolyFlags;
|
static FBITFIELD CurrentPolyFlags;
|
||||||
|
@ -1245,33 +1244,12 @@ void Flush(void)
|
||||||
|
|
||||||
while (gr_cachehead)
|
while (gr_cachehead)
|
||||||
{
|
{
|
||||||
// this is not necessary at all, because you have loaded them normally,
|
if (gr_cachehead->downloaded)
|
||||||
// and so they already are in your list!
|
|
||||||
#if 0
|
|
||||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
|
||||||
FTextureInfo *tmp = gr_cachehead->nextskin;
|
|
||||||
|
|
||||||
// The memory should be freed in the main code
|
|
||||||
while (tmp)
|
|
||||||
{
|
|
||||||
pglDeleteTextures(1, &tmp->downloaded);
|
|
||||||
tmp->downloaded = 0;
|
|
||||||
tmp = tmp->nextcolormap;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
pglDeleteTextures(1, (GLuint *)&gr_cachehead->downloaded);
|
pglDeleteTextures(1, (GLuint *)&gr_cachehead->downloaded);
|
||||||
gr_cachehead->downloaded = 0;
|
gr_cachehead->downloaded = 0;
|
||||||
gr_cachehead = gr_cachehead->nextmipmap;
|
gr_cachehead = gr_cachehead->nextmipmap;
|
||||||
}
|
}
|
||||||
gr_cachetail = gr_cachehead = NULL; //Hurdler: well, gr_cachehead is already NULL
|
gr_cachetail = gr_cachehead = NULL; //Hurdler: well, gr_cachehead is already NULL
|
||||||
NextTexAvail = FIRST_TEX_AVAIL;
|
|
||||||
#if 0
|
|
||||||
if (screentexture != FIRST_TEX_AVAIL)
|
|
||||||
{
|
|
||||||
pglDeleteTextures(1, &screentexture);
|
|
||||||
screentexture = FIRST_TEX_AVAIL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
tex_downloaded = 0;
|
tex_downloaded = 0;
|
||||||
}
|
}
|
||||||
|
@ -1648,8 +1626,10 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
||||||
static RGBA_t tex[2048*2048];
|
static RGBA_t tex[2048*2048];
|
||||||
const GLvoid *ptex = tex;
|
const GLvoid *ptex = tex;
|
||||||
INT32 w, h;
|
INT32 w, h;
|
||||||
|
GLuint texnum = 0;
|
||||||
|
|
||||||
//GL_DBG_Printf ("DownloadMipmap %d %x\n",NextTexAvail,pTexInfo->grInfo.data);
|
pglGenTextures(1, &texnum);
|
||||||
|
//GL_DBG_Printf ("DownloadMipmap %d %x\n",(INT32)texnum,pTexInfo->grInfo.data);
|
||||||
|
|
||||||
w = pTexInfo->width;
|
w = pTexInfo->width;
|
||||||
h = pTexInfo->height;
|
h = pTexInfo->height;
|
||||||
|
@ -1737,9 +1717,10 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
||||||
else
|
else
|
||||||
GL_DBG_Printf ("SetTexture(bad format) %ld\n", pTexInfo->grInfo.format);
|
GL_DBG_Printf ("SetTexture(bad format) %ld\n", pTexInfo->grInfo.format);
|
||||||
|
|
||||||
pTexInfo->downloaded = NextTexAvail++;
|
// the texture number was already generated by pglGenTextures
|
||||||
tex_downloaded = pTexInfo->downloaded;
|
pglBindTexture(GL_TEXTURE_2D, texnum);
|
||||||
pglBindTexture(GL_TEXTURE_2D, pTexInfo->downloaded);
|
pTexInfo->downloaded = texnum;
|
||||||
|
tex_downloaded = texnum;
|
||||||
|
|
||||||
// disable texture filtering on any texture that has holes so there's no dumb borders or blending issues
|
// disable texture filtering on any texture that has holes so there's no dumb borders or blending issues
|
||||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||||
|
|
Loading…
Reference in a new issue