From 03596021592cff9040e3b871aecd14656787531c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 16 Sep 2019 21:27:07 +0200 Subject: [PATCH] - some missed parts. --- source/build/src/animvpx.cpp | 2 +- source/build/src/glsurface.cpp | 4 ++-- source/build/src/mdsprite.cpp | 3 --- source/build/src/polymost.cpp | 5 +---- source/build/src/voxmodel.cpp | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/source/build/src/animvpx.cpp b/source/build/src/animvpx.cpp index 98dbb9bb6..fc4b2b177 100644 --- a/source/build/src/animvpx.cpp +++ b/source/build/src/animvpx.cpp @@ -463,7 +463,7 @@ void animvpx_setup_glstate(int32_t animvpx_flags) #ifdef USE_GLEXT glActiveTexture(GL_TEXTURE0); #endif - glGenTextures(1, &texname); + GetTextureHandle(&texname); glBindTexture(GL_TEXTURE_2D, texname); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); diff --git a/source/build/src/glsurface.cpp b/source/build/src/glsurface.cpp index a4897fdce..b1c8ab0cd 100644 --- a/source/build/src/glsurface.cpp +++ b/source/build/src/glsurface.cpp @@ -65,7 +65,7 @@ bool glsurface_initialize(vec2_t bufferResolution) buffer = Xaligned_alloc(16, bufferRes.x * bufferRes.y); glActiveTexture(GL_TEXTURE0); - glGenTextures(1, &bufferTexID); + GetTextureHandle(&bufferTexID); glBindTexture(GL_TEXTURE_2D, bufferTexID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); @@ -172,7 +172,7 @@ void glsurface_setPalette(void* pPalette) } else { - glGenTextures(1, &paletteTexID); + GetTextureHandle(&paletteTexID); glBindTexture(GL_TEXTURE_2D, paletteTexID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 2e89456be..f68bb8f04 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -2109,9 +2109,6 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) if (m->usesalpha) //Sprites with alpha in texture { - // glEnable(GL_BLEND);// glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - // glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER,0.32); - // float al = 0.32; // PLAG : default cutoff removed float al = 0.0; if (alphahackarray[globalpicnum] != 0) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index bbaf9d0ce..1196a1f29 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -889,7 +889,7 @@ void polymost_glinit() } for (uint32_t i = 0; i < numTilesheets; ++i) { - glGenTextures(1, tilesheetTexIDs+i); + GetTextureHandle(tilesheetTexIDs+i); glBindTexture(GL_TEXTURE_2D, tilesheetTexIDs[i]); uploadtextureindexed(true, {0, 0}, maxTexDimensions, (intptr_t) NULL); } @@ -1229,9 +1229,6 @@ void polymost_glinit() uploadpalswap(palookupnum); } - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - polymost_resetVertexPointers(); texcache_init(); diff --git a/source/build/src/voxmodel.cpp b/source/build/src/voxmodel.cpp index ab441cded..c02e581d2 100644 --- a/source/build/src/voxmodel.cpp +++ b/source/build/src/voxmodel.cpp @@ -74,7 +74,7 @@ uint32_t gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8 uint32_t rtexid; - glGenTextures(1, (GLuint *) &rtexid); + GetTextureHandle((GLuint *) &rtexid); glBindTexture(GL_TEXTURE_2D, rtexid); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);