mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
In polymost_glinit, pass a dummy 4x4 texture to uploadtexture in order to detect what compressed texture formats are acceptable without wasting time compressing the first texture it encounters, such as the 3D Realms screen, in case the graphics chip won't take it.
git-svn-id: https://svn.eduke32.com/eduke32@5704 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
9b4957aa17
commit
b529af4b55
1 changed files with 20 additions and 0 deletions
|
@ -338,6 +338,7 @@ void polymost_glreset()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Polymost_InitDummyTexture(void);
|
||||||
|
|
||||||
// one-time initialization of OpenGL for polymost
|
// one-time initialization of OpenGL for polymost
|
||||||
void polymost_glinit()
|
void polymost_glinit()
|
||||||
|
@ -391,6 +392,8 @@ void polymost_glinit()
|
||||||
|
|
||||||
texcache_setupmemcache();
|
texcache_setupmemcache();
|
||||||
texcache_checkgarbage();
|
texcache_checkgarbage();
|
||||||
|
|
||||||
|
Polymost_InitDummyTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////// VISIBILITY FOG ROUTINES //////////
|
////////// VISIBILITY FOG ROUTINES //////////
|
||||||
|
@ -1212,6 +1215,23 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Polymost_InitDummyTexture(void)
|
||||||
|
{
|
||||||
|
// init dummy texture to trigger possible failure of all compression modes
|
||||||
|
coltype dummypic[4*4] = { { 0, 0, 0, 0 } };
|
||||||
|
vec2_t const dummysiz = { 4, 4 };
|
||||||
|
GLuint dummytex = 0;
|
||||||
|
|
||||||
|
bglGenTextures(1, &dummytex);
|
||||||
|
bglBindTexture(GL_TEXTURE_2D, dummytex);
|
||||||
|
|
||||||
|
uploadtexture(1, dummysiz, GL_RGBA, dummypic, dummysiz, DAMETH_NOMASK|DAMETH_NOFIX|DAMETH_NODOWNSIZE);
|
||||||
|
uploadtexture(1, dummysiz, GL_RGBA, dummypic, dummysiz, DAMETH_MASK|DAMETH_HASALPHA|DAMETH_NOFIX|DAMETH_NODOWNSIZE);
|
||||||
|
uploadtexture(1, dummysiz, GL_RGBA, dummypic, dummysiz, DAMETH_MASK|DAMETH_ONEBITALPHA|DAMETH_NOFIX|DAMETH_NODOWNSIZE);
|
||||||
|
|
||||||
|
bglDeleteTextures(1, &dummytex);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp *hicr,
|
int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp *hicr,
|
||||||
int32_t dameth, pthtyp *pth, int32_t doalloc, char effect)
|
int32_t dameth, pthtyp *pth, int32_t doalloc, char effect)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue