diff options
| author | sfan5 <sfan5@live.de> | 2023-03-05 15:10:44 +0100 |
|---|---|---|
| committer | sfan5 <sfan5@live.de> | 2023-04-08 20:19:35 +0200 |
| commit | 9d736e8b8baeeacad9cfa94edd18adfcaf000029 (patch) | |
| tree | 6799a199edaeb82481edea6f101dc744b4507e9f /src/client | |
| parent | c26e122485a7180edf434c0c1211713ff377d6d7 (diff) | |
| download | minetest-9d736e8b8baeeacad9cfa94edd18adfcaf000029.tar.xz | |
Drop ENABLE_GLES option
ENABLE_GLES predates forking Irrlicht. Its primary use was to distinguish Irrlicht-ogles from upstream version as Minetest could be compiled with either.
That's not necessary anymore and gets in the way sometimes.
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/camera.cpp | 6 | ||||
| -rw-r--r-- | src/client/guiscalingfilter.cpp | 2 | ||||
| -rw-r--r-- | src/client/renderingengine.cpp | 9 | ||||
| -rw-r--r-- | src/client/shader.cpp | 39 | ||||
| -rw-r--r-- | src/client/tile.cpp | 9 | ||||
| -rw-r--r-- | src/client/tile.h | 8 |
6 files changed, 20 insertions, 53 deletions
diff --git a/src/client/camera.cpp b/src/client/camera.cpp index 13ca7aa5c..dce94495b 100644 --- a/src/client/camera.cpp +++ b/src/client/camera.cpp @@ -599,13 +599,7 @@ void Camera::updateViewingRange() { f32 viewing_range = g_settings->getFloat("viewing_range"); - // Ignore near_plane setting on all other platforms to prevent abuse -#if ENABLE_GLES - m_cameranode->setNearValue(rangelim( - g_settings->getFloat("near_plane"), 0.0f, 0.25f) * BS); -#else m_cameranode->setNearValue(0.1f * BS); -#endif m_draw_control.wanted_range = std::fmin(adjustDist(viewing_range, getFovMax()), 4000); if (m_draw_control.range_all) { diff --git a/src/client/guiscalingfilter.cpp b/src/client/guiscalingfilter.cpp index 42508259f..fda525e3f 100644 --- a/src/client/guiscalingfilter.cpp +++ b/src/client/guiscalingfilter.cpp @@ -119,7 +119,6 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver, (u32)destrect.getHeight())); imageScaleNNAA(srcimg, srcrect, destimg); -#if ENABLE_GLES // Some platforms are picky about textures being powers of 2, so expand // the image dimensions to the next power of 2, if necessary. if (!driver->queryFeature(video::EVDF_TEXTURE_NPOT)) { @@ -131,7 +130,6 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver, destimg->drop(); destimg = po2img; } -#endif // Convert the scaled image back into a texture. scaled = driver->addTexture(scalename, destimg); diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index 1392b5567..74151423f 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "render/factory.h" #include "inputhandler.h" #include "gettext.h" +#include "filesys.h" #include "../gui/guiSkin.h" #if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && \ @@ -51,10 +52,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <winuser.h> #endif -#if ENABLE_GLES -#include "filesys.h" -#endif - RenderingEngine *RenderingEngine::s_singleton = nullptr; const float RenderingEngine::BASE_BLOOM_STRENGTH = 1.0f; @@ -136,12 +133,10 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver) #ifdef __ANDROID__ params.PrivateData = porting::app_global; #endif -#if ENABLE_GLES // there is no standardized path for these on desktop std::string rel_path = std::string("client") + DIR_DELIM + "shaders" + DIR_DELIM + "Irrlicht"; params.OGLES2ShaderPath = (porting::path_share + DIR_DELIM + rel_path + DIR_DELIM).c_str(); -#endif m_device = createDeviceEx(params); driver = m_device->getVideoDriver(); @@ -289,10 +284,8 @@ static bool getWindowHandle(irr::video::IVideoDriver *driver, HWND &hWnd) const video::SExposedVideoData exposedData = driver->getExposedVideoData(); switch (driver->getDriverType()) { -#if ENABLE_GLES case video::EDT_OGLES1: case video::EDT_OGLES2: -#endif case video::EDT_OPENGL: hWnd = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd); break; diff --git a/src/client/shader.cpp b/src/client/shader.cpp index ccecb22c3..ce662b41d 100644 --- a/src/client/shader.cpp +++ b/src/client/shader.cpp @@ -229,14 +229,12 @@ class MainShaderConstantSetter : public IShaderConstantSetter CachedVertexShaderSetting<f32> m_perspective_zbias_vertex; CachedPixelShaderSetting<f32> m_perspective_zbias_pixel; -#if ENABLE_GLES // Modelview matrix CachedVertexShaderSetting<float, 16> m_world_view; // Texture matrix CachedVertexShaderSetting<float, 16> m_texture; // Normal matrix CachedVertexShaderSetting<float, 9> m_normal; -#endif public: MainShaderConstantSetter() : @@ -256,11 +254,9 @@ public: , m_perspective_bias1_pixel("xyPerspectiveBias1") , m_perspective_zbias_vertex("zPerspectiveBias") , m_perspective_zbias_pixel("zPerspectiveBias") -#if ENABLE_GLES , m_world_view("mWorldView") , m_texture("mTexture") , m_normal("mNormal") -#endif {} ~MainShaderConstantSetter() = default; @@ -283,21 +279,21 @@ public: worldViewProj *= worldView; m_world_view_proj.set(*reinterpret_cast<float(*)[16]>(worldViewProj.pointer()), services); -#if ENABLE_GLES - core::matrix4 texture = driver->getTransform(video::ETS_TEXTURE_0); - m_world_view.set(*reinterpret_cast<float(*)[16]>(worldView.pointer()), services); - m_texture.set(*reinterpret_cast<float(*)[16]>(texture.pointer()), services); - - core::matrix4 normal; - worldView.getTransposed(normal); - sanity_check(normal.makeInverse()); - float m[9] = { - normal[0], normal[1], normal[2], - normal[4], normal[5], normal[6], - normal[8], normal[9], normal[10], - }; - m_normal.set(m, services); -#endif + if (driver->getDriverType() == video::EDT_OGLES2) { + core::matrix4 texture = driver->getTransform(video::ETS_TEXTURE_0); + m_world_view.set(*reinterpret_cast<float(*)[16]>(worldView.pointer()), services); + m_texture.set(*reinterpret_cast<float(*)[16]>(texture.pointer()), services); + + core::matrix4 normal; + worldView.getTransposed(normal); + sanity_check(normal.makeInverse()); + float m[9] = { + normal[0], normal[1], normal[2], + normal[4], normal[5], normal[6], + normal[8], normal[9], normal[10], + }; + m_normal.set(m, services); + } // Set uniforms for Shadow shader if (ShadowRenderer *shadow = RenderingEngine::get_shadow_renderer()) { @@ -628,10 +624,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name, video::IGPUProgrammingServices *gpu = driver->getGPUProgrammingServices(); // Create shaders header - bool use_gles = false; -#if ENABLE_GLES - use_gles = driver->getDriverType() == video::EDT_OGLES2; -#endif + bool use_gles = driver->getDriverType() == video::EDT_OGLES2; std::stringstream shaders_header; shaders_header << std::noboolalpha diff --git a/src/client/tile.cpp b/src/client/tile.cpp index 14fc316e7..8421465c4 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <algorithm> #include <ICameraSceneNode.h> +#include <IVideoDriver.h> #include "util/string.h" #include "util/container.h" #include "util/thread.h" @@ -617,9 +618,7 @@ u32 TextureSource::generateTexture(const std::string &name) video::ITexture *tex = NULL; if (img != NULL) { -#if ENABLE_GLES img = Align2Npot2(img, driver); -#endif // Create texture from resulting image tex = driver->addTexture(name.c_str(), img); guiScalingCache(io::path(name.c_str()), driver, img); @@ -819,9 +818,7 @@ void TextureSource::rebuildTexture(video::IVideoDriver *driver, TextureInfo &ti) // shouldn't really need to be done, but can't hurt std::set<std::string> source_image_names; video::IImage *img = generateImage(ti.name, source_image_names); -#if ENABLE_GLES img = Align2Npot2(img, driver); -#endif // Create texture from resulting image video::ITexture *t = NULL; if (img) { @@ -1055,8 +1052,6 @@ video::IImage* TextureSource::generateImage(const std::string &name, std::set<st return baseimg; } -#if ENABLE_GLES - /** * Check and align image to npot2 if required by hardware * @param image image to check for npot2 alignment @@ -1094,8 +1089,6 @@ video::IImage *Align2Npot2(video::IImage *image, return targetimage; } -#endif - static std::string unescape_string(const std::string &str, const char esc = '\\') { std::string out; diff --git a/src/client/tile.h b/src/client/tile.h index c60418d12..0597d093e 100644 --- a/src/client/tile.h +++ b/src/client/tile.h @@ -28,14 +28,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/numeric.h" #include "config.h" -#if ENABLE_GLES -#include <IVideoDriver.h> -#endif - class IGameDef; struct TileSpec; struct TileDef; +namespace irr { namespace video { class IVideoDriver; } } + typedef std::vector<video::SColor> Palette; /* @@ -133,9 +131,7 @@ public: IWritableTextureSource *createTextureSource(); -#if ENABLE_GLES video::IImage *Align2Npot2(video::IImage *image, video::IVideoDriver *driver); -#endif enum MaterialType{ TILE_MATERIAL_BASIC, |
