From 6950a3b9a1f224b5df164e6753512707ea06214d Mon Sep 17 00:00:00 2001 From: Maksim Date: Sun, 6 Mar 2022 11:58:25 +0100 Subject: [PATCH] Fix few GLES issues --- src/client/minimap.cpp | 2 +- src/client/shader.cpp | 6 +++--- src/client/sky.cpp | 5 +---- src/client/tile.cpp | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/client/minimap.cpp b/src/client/minimap.cpp index 4cc8b82a2..412dba31f 100644 --- a/src/client/minimap.cpp +++ b/src/client/minimap.cpp @@ -631,7 +631,7 @@ void Minimap::drawMinimap(core::rect rect) { material.setFlag(video::EMF_TRILINEAR_FILTER, true); material.Lighting = false; material.TextureLayer[0].Texture = minimap_texture; - material.TextureLayer[1].Texture = data->heightmap_texture; + material.TextureLayer[1].Texture = data->mode.type == MINIMAP_TYPE_RADAR ? 0 : data->heightmap_texture; if (m_enable_shaders && data->mode.type == MINIMAP_TYPE_SURFACE) { u16 sid = m_shdrsrc->getShader("minimap_shader", TILE_MATERIAL_ALPHA); diff --git a/src/client/shader.cpp b/src/client/shader.cpp index b6ee5d570..1b3964e66 100644 --- a/src/client/shader.cpp +++ b/src/client/shader.cpp @@ -40,7 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/tile.h" #include "config.h" -#if ENABLE_GLES +#if ENABLE_GLES && !defined(__APPLE__) #ifdef _IRR_COMPILE_WITH_OGLES1_ #include #else @@ -49,7 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #else #ifndef __APPLE__ #include -#else +#elif !defined(__IOS__) #define GL_SILENCE_DEPRECATION #include #endif @@ -604,7 +604,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name, } bool use_discard = use_gles; -#ifdef __unix__ +#if defined(__unix__) && !defined(__APPLE__) // For renderers that should use discard instead of GL_ALPHA_TEST const char* gl_renderer = (const char*)glGetString(GL_RENDERER); if (strstr(gl_renderer, "GC7000")) diff --git a/src/client/sky.cpp b/src/client/sky.cpp index 46bfc4e2c..a38509513 100644 --- a/src/client/sky.cpp +++ b/src/client/sky.cpp @@ -39,10 +39,7 @@ static video::SMaterial baseMaterial() { video::SMaterial mat; mat.Lighting = false; -#if ENABLE_GLES - mat.ZBuffer = video::ECFN_DISABLED; -#elif defined(__MACH__) && defined(__APPLE__) && IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8 - // ugly but for making cpp_lint happy... +#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8 mat.ZBuffer = video::ECFN_DISABLED; #else mat.ZBuffer = video::ECFN_NEVER; diff --git a/src/client/tile.cpp b/src/client/tile.cpp index f25caf26f..97ced0b62 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "renderingengine.h" -#if ENABLE_GLES +#if ENABLE_GLES && !defined(__APPLE__) #ifdef _IRR_COMPILE_WITH_OGLES1_ #include #else