From ba73268470b5db6ad4901c40e0e95b9557afd46f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Sep 2019 21:04:09 +0200 Subject: [PATCH] - removed GLES support and most related files. My future plans do not include mobile support due tp poor support of modern APIs so this is essentially just baggage. # Conflicts: # source/build/src/2d.cpp # source/build/src/dxtfilter.cpp # source/build/src/mdsprite.cpp # source/build/src/polymost.cpp # source/build/src/sdlayer.cpp # source/build/src/texcache.cpp --- source/build/include/compat.h | 4 ---- source/build/include/glbuild.h | 2 +- source/build/src/2d.cpp | 16 ---------------- source/build/src/baselayer.cpp | 2 -- source/build/src/polymost.cpp | 17 ----------------- source/build/src/sdlayer.cpp | 28 ---------------------------- 6 files changed, 1 insertion(+), 68 deletions(-) diff --git a/source/build/include/compat.h b/source/build/include/compat.h index 76e764695..9ea874d98 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -1394,10 +1394,6 @@ static inline void maybe_grow_buffer(char ** const buffer, int32_t * const buffe #define WITHKPLIB -#if defined __ANDROID__ || defined EDUKE32_IOS -# define EDUKE32_TOUCH_DEVICES -# define EDUKE32_GLES -#endif #if DEBUGGINGAIDS>=2 # define DEBUG_MAIN_ARRAYS diff --git a/source/build/include/glbuild.h b/source/build/include/glbuild.h index 66abbd973..360213b7a 100644 --- a/source/build/include/glbuild.h +++ b/source/build/include/glbuild.h @@ -4,7 +4,7 @@ #ifdef USE_OPENGL -#if !defined GEKKO && !defined EDUKE32_GLES +#if !defined GEKKO # define DYNAMIC_GL # define DYNAMIC_GLU # define DYNAMIC_GLEXT diff --git a/source/build/src/2d.cpp b/source/build/src/2d.cpp index c9bf1d2be..86a0faede 100644 --- a/source/build/src/2d.cpp +++ b/source/build/src/2d.cpp @@ -32,22 +32,6 @@ static void drawpixel_safe(void *s, char a) if ((intptr_t) s >= frameplace && (intptr_t) s < frameplace+bytesperline*ydim) #endif drawpixel(s, a); -#ifdef DEBUGGINGAIDS - else - { - const char c = editorcolors[15]; - - drawpixel((intptr_t *) frameplace, c); - drawpixel((intptr_t *) frameplace+1, c); - drawpixel((intptr_t *) frameplace+2, c); - drawpixel((intptr_t *) frameplace+bytesperline, c); - drawpixel((intptr_t *) frameplace+bytesperline+1, c); - drawpixel((intptr_t *) frameplace+bytesperline+2, c); - drawpixel((intptr_t *) frameplace+2*bytesperline, c); - drawpixel((intptr_t *) frameplace+2*bytesperline+1, c); - drawpixel((intptr_t *) frameplace+2*bytesperline+2, c); - } -#endif } diff --git a/source/build/src/baselayer.cpp b/source/build/src/baselayer.cpp index 38d8f2c72..709aaef86 100644 --- a/source/build/src/baselayer.cpp +++ b/source/build/src/baselayer.cpp @@ -402,7 +402,6 @@ int osdcmd_glinfo(osdcmdptr_t UNUSED(parm)) initprintf(" Clamp-to-edge: %s\n", SUPPORTED(glinfo.clamptoedge)); initprintf(" Multi-texturing: %s\n", SUPPORTED(glinfo.multitex)); initprintf(" Framebuffer objects: %s\n", SUPPORTED(glinfo.fbos)); -#ifndef EDUKE32_GLES initprintf(" Texture compression: %s\n", SUPPORTED(glinfo.texcompr)); initprintf(" Multi-sampling: %s\n", SUPPORTED(glinfo.multisample)); initprintf(" NVIDIA multisample hint: %s\n", SUPPORTED(glinfo.nvmultisamplehint)); @@ -418,7 +417,6 @@ int osdcmd_glinfo(osdcmdptr_t UNUSED(parm)) initprintf(" Debug output: %s\n", SUPPORTED(glinfo.debugoutput)); initprintf(" Buffer storage: %s\n", SUPPORTED(glinfo.bufferstorage)); initprintf(" Sync: %s\n", SUPPORTED(glinfo.sync)); -#endif initprintf(" Maximum anisotropy: %.1f%s\n", glinfo.maxanisotropy, glinfo.maxanisotropy > 1.0 ? "" : " (no anisotropic filtering)"); #undef SUPPORTED diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 756e0485b..ee48d97b1 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -485,10 +485,6 @@ void polymost_glreset() #endif } -#if defined EDUKE32_GLES -static void Polymost_DetermineTextureFormatSupport(void); -#endif - // reset vertex pointers to polymost default void polymost_resetVertexPointers() { @@ -951,9 +947,6 @@ void polymost_glinit() polymost_resetVertexPointers(); -#if defined EDUKE32_GLES - Polymost_DetermineTextureFormatSupport(); -#endif } void polymost_init() @@ -1166,7 +1159,6 @@ static float get_projhack_ratio(void) static void resizeglcheck(void) { -#ifndef EDUKE32_GLES //FUK if (lastglpolygonmode != r_polygonmode) { @@ -1187,9 +1179,6 @@ static void resizeglcheck(void) glClearColor(1.0,1.0,1.0,0.0); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); } -#else - glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); -#endif if ((glox1 != windowxy1.x) || (gloy1 != windowxy1.y) || (glox2 != windowxy2.x) || (gloy2 != windowxy2.y) || (gloxyaspect != gxyaspect) || (gloyxscale != gyxscale) || (glohoriz2 != ghoriz2) || (glohorizcorrect != ghorizcorrect) || (glotang != gtang)) { @@ -7790,22 +7779,16 @@ void polymost_initosdfuncs(void) static osdcvardata_t cvars_polymost[] = { - { "r_enablepolymost2","enable/disable polymost2",(void *) &r_enablepolymost2, CVAR_BOOL, 0, 0 }, //POGO: temporarily disable this variable - { "r_pogoDebug","",(void *) &r_pogoDebug, CVAR_BOOL | CVAR_NOSAVE, 0, 1 }, { "r_animsmoothing","enable/disable model animation smoothing",(void *) &r_animsmoothing, CVAR_BOOL, 0, 1 }, - { "r_downsize","controls downsizing factor (quality) for hires textures",(void *) &r_downsize, CVAR_INT|CVAR_FUNCPTR, 0, 5 }, { "r_fullbrights","enable/disable fullbright textures",(void *) &r_fullbrights, CVAR_BOOL, 0, 1 }, { "r_parallaxskyclamping","enable/disable parallaxed floor/ceiling sky texture clamping", (void *) &r_parallaxskyclamping, CVAR_BOOL, 0, 1 }, { "r_parallaxskypanning","enable/disable parallaxed floor/ceiling panning when drawing a parallaxing sky", (void *) &r_parallaxskypanning, CVAR_BOOL, 0, 1 }, - { "r_polymostDebug","Set the verbosity of Polymost GL debug messages",(void *) &r_polymostDebug, CVAR_INT, 0, 3 }, #ifdef USE_GLEXT { "r_detailmapping","enable/disable detail mapping",(void *) &r_detailmapping, CVAR_BOOL, 0, 1 }, { "r_glowmapping","enable/disable glow mapping",(void *) &r_glowmapping, CVAR_BOOL, 0, 1 }, #endif -#ifndef EDUKE32_GLES { "r_polygonmode","debugging feature",(void *) &r_polygonmode, CVAR_INT | CVAR_NOSAVE, 0, 3 }, -#endif { "r_shadescale","multiplier for shading",(void *) &shadescale, CVAR_FLOAT, 0, 10 }, { "r_shadescale_unbounded","enable/disable allowance of complete blackness",(void *) &shadescale_unbounded, CVAR_BOOL, 0, 1 }, diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 928852750..9a6921f38 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -77,9 +77,7 @@ char modechange=1; char offscreenrendering=0; char videomodereset = 0; int32_t nofog=0; -#ifndef EDUKE32_GLES static uint16_t sysgamma[3][256]; -#endif #ifdef USE_OPENGL // OpenGL stuff char nogl=0; @@ -1314,9 +1312,7 @@ void sdlayer_setvideomode_opengl(void) glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Use FASTEST for ortho! // glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); -#ifndef EDUKE32_GLES glDisable(GL_DITHER); -#endif glinfo.vendor = (const char *) glGetString(GL_VENDOR); glinfo.renderer = (const char *) glGetString(GL_RENDERER); @@ -1447,7 +1443,6 @@ void setvideomode_sdlcommonpost(int32_t x, int32_t y, int32_t c, int32_t fs, int videomodereset = 0; // save the current system gamma to determine if gamma is available -#ifndef EDUKE32_GLES if (!gammabrightness) { // float f = 1.0 + ((float)curbrightness / 10.0); @@ -1458,7 +1453,6 @@ void setvideomode_sdlcommonpost(int32_t x, int32_t y, int32_t c, int32_t fs, int if (gammabrightness && videoSetGamma() < 0) gammabrightness = 0; // nope } -#endif videoFadePalette(palfadergb.r, palfadergb.g, palfadergb.b, palfadedelta); @@ -1533,10 +1527,6 @@ int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs) int32_t value; } sdlayer_gl_attributes[] = { -#ifdef EDUKE32_GLES - { SDL_GL_CONTEXT_MAJOR_VERSION, 1 }, - { SDL_GL_CONTEXT_MINOR_VERSION, 1 }, -#endif { SDL_GL_DOUBLEBUFFER, 1 }, { SDL_GL_MULTISAMPLEBUFFERS, glmultisample > 0 }, { SDL_GL_MULTISAMPLESAMPLES, glmultisample }, @@ -1836,10 +1826,6 @@ int32_t videoSetGamma(void) gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (uint16_t)max(0.f, min(65535.f, val * 256.f)); } -#if SDL_MAJOR_VERSION == 1 - i = SDL_SetGammaRamp(&gammaTable[0], &gammaTable[256], &gammaTable[512]); - if (i != -1) -#else i = INT32_MIN; if (sdl_window) @@ -1847,28 +1833,14 @@ int32_t videoSetGamma(void) if (i < 0) { -#ifndef __ANDROID__ // Don't do this check, it is really supported, TODO -/* - if (i != INT32_MIN) - initprintf("Unable to set gamma: SDL_SetWindowGammaRamp failed: %s\n", SDL_GetError()); -*/ -#endif - OSD_Printf("videoSetGamma(): %s\n", SDL_GetError()); -#ifndef EDUKE32_GLES -#if SDL_MAJOR_VERSION == 1 - SDL_SetGammaRamp(&sysgamma[0][0], &sysgamma[1][0], &sysgamma[2][0]); -#else if (sdl_window) SDL_SetWindowGammaRamp(sdl_window, &sysgamma[0][0], &sysgamma[1][0], &sysgamma[2][0]); -#endif gammabrightness = 0; -#endif } else -#endif { lastvidgcb[0] = gamma; lastvidgcb[1] = contrast;