diff --git a/irr/src/COSOperator.cpp b/irr/src/COSOperator.cpp index b26463799..d53223916 100644 --- a/irr/src/COSOperator.cpp +++ b/irr/src/COSOperator.cpp @@ -29,18 +29,6 @@ #include "fast_atof.h" -#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) -static const bool sdl_supports_primary_selection = [] { -#if SDL_VERSION_ATLEAST(2, 25, 0) - SDL_version linked_version; - SDL_GetVersion(&linked_version); - return (linked_version.major == 2 && linked_version.minor >= 25) || linked_version.major > 2; -#else - return false; -#endif -}(); -#endif - namespace irr { @@ -131,8 +119,7 @@ void COSOperator::copyToPrimarySelection(const c8 *text) const #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) #if SDL_VERSION_ATLEAST(2, 25, 0) - if (sdl_supports_primary_selection) - SDL_SetPrimarySelectionText(text); + SDL_SetPrimarySelectionText(text); #endif #elif defined(_IRR_COMPILE_WITH_X11_DEVICE_) @@ -195,11 +182,9 @@ const c8 *COSOperator::getTextFromPrimarySelection() const { #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) #if SDL_VERSION_ATLEAST(2, 25, 0) - if (sdl_supports_primary_selection) { - SDL_free(PrimarySelectionText); - PrimarySelectionText = SDL_GetPrimarySelectionText(); - return PrimarySelectionText; - } + SDL_free(PrimarySelectionText); + PrimarySelectionText = SDL_GetPrimarySelectionText(); + return PrimarySelectionText; #endif return 0; diff --git a/irr/src/OpenGL/Driver.cpp b/irr/src/OpenGL/Driver.cpp index bf9334e15..0dd6ea1bb 100644 --- a/irr/src/OpenGL/Driver.cpp +++ b/irr/src/OpenGL/Driver.cpp @@ -704,12 +704,6 @@ IRenderTarget *COpenGL3DriverBase::addRenderTarget() return renderTarget; } -// small helper function to create vertex buffer object adress offsets -static inline u8 *buffer_offset(const long offset) -{ - return ((u8 *)0 + offset); -} - //! draws a vertex primitive list void COpenGL3DriverBase::drawVertexPrimitiveList(const void *vertices, u32 vertexCount, const void *indexList, u32 primitiveCount, diff --git a/irr/src/OpenGL/Driver.h b/irr/src/OpenGL/Driver.h index 80eeaf0da..51554334b 100644 --- a/irr/src/OpenGL/Driver.h +++ b/irr/src/OpenGL/Driver.h @@ -102,6 +102,8 @@ class COpenGL3DriverBase : public CNullDriver, public IMaterialRendererServices, // internally used virtual void draw2DImage(const video::ITexture *texture, u32 layer, bool flip); + using CNullDriver::draw2DImage; + void draw2DImageBatch(const video::ITexture *texture, const core::array> &positions, const core::array> &sourceRects, diff --git a/irr/src/OpenGL/MaterialRenderer.h b/irr/src/OpenGL/MaterialRenderer.h index be74461e3..fa37cfff3 100644 --- a/irr/src/OpenGL/MaterialRenderer.h +++ b/irr/src/OpenGL/MaterialRenderer.h @@ -37,15 +37,15 @@ class COpenGL3MaterialRenderer : public IMaterialRenderer, public IMaterialRende GLuint getProgram() const; virtual void OnSetMaterial(const SMaterial &material, const SMaterial &lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices *services); + bool resetAllRenderstates, IMaterialRendererServices *services) override; - virtual bool OnRender(IMaterialRendererServices *service, E_VERTEX_TYPE vtxtype); + virtual bool OnRender(IMaterialRendererServices *service, E_VERTEX_TYPE vtxtype) override; - virtual void OnUnsetMaterial(); + virtual void OnUnsetMaterial() override; - virtual bool isTransparent() const; + virtual bool isTransparent() const override; - virtual s32 getRenderCapability() const; + virtual s32 getRenderCapability() const override; void setBasicRenderStates(const SMaterial &material, const SMaterial &lastMaterial, bool resetAllRenderstates) override; diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp index 1d74b70cb..f06dcfa58 100644 --- a/src/client/mapblock_mesh.cpp +++ b/src/client/mapblock_mesh.cpp @@ -329,32 +329,6 @@ void final_color_blend(video::SColor *result, Mesh generation helpers */ -// This table is moved outside getNodeVertexDirs to avoid the compiler using -// a mutex to initialize this table at runtime right in the hot path. -// For details search the internet for "cxa_guard_acquire". -static const v3s16 vertex_dirs_table[] = { - // ( 1, 0, 0) - v3s16( 1,-1, 1), v3s16( 1,-1,-1), - v3s16( 1, 1,-1), v3s16( 1, 1, 1), - // ( 0, 1, 0) - v3s16( 1, 1,-1), v3s16(-1, 1,-1), - v3s16(-1, 1, 1), v3s16( 1, 1, 1), - // ( 0, 0, 1) - v3s16(-1,-1, 1), v3s16( 1,-1, 1), - v3s16( 1, 1, 1), v3s16(-1, 1, 1), - // invalid - v3s16(), v3s16(), v3s16(), v3s16(), - // ( 0, 0,-1) - v3s16( 1,-1,-1), v3s16(-1,-1,-1), - v3s16(-1, 1,-1), v3s16( 1, 1,-1), - // ( 0,-1, 0) - v3s16( 1,-1, 1), v3s16(-1,-1, 1), - v3s16(-1,-1,-1), v3s16( 1,-1,-1), - // (-1, 0, 0) - v3s16(-1,-1,-1), v3s16(-1,-1, 1), - v3s16(-1, 1, 1), v3s16(-1, 1,-1) -}; - /* Gets nth node tile (0 <= n <= 5). */ @@ -1006,7 +980,6 @@ video::SColor encode_light(u16 light, u8 emissive_light) u8 get_solid_sides(MeshMakeData *data) { std::unordered_map results; - v3s16 ofs; v3s16 blockpos_nodes = data->m_blockpos * MAP_BLOCKSIZE; const NodeDefManager *ndef = data->nodedef; diff --git a/src/client/shadows/dynamicshadows.cpp b/src/client/shadows/dynamicshadows.cpp index f717cc8b0..11db9bea7 100644 --- a/src/client/shadows/dynamicshadows.cpp +++ b/src/client/shadows/dynamicshadows.cpp @@ -42,7 +42,6 @@ static v3f quantizeDirection(v3f direction, float step) void DirectionalLight::createSplitMatrices(const Camera *cam) { static const float COS_15_DEG = 0.965926f; - v3f newCenter; v3f look = cam->getDirection().normalize(); // if current look direction is < 15 degrees away from the captured diff --git a/src/collision.cpp b/src/collision.cpp index 01daaf309..2db0e127d 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -218,14 +218,6 @@ bool wouldCollideWithCeiling( return false; } -static inline void getNeighborConnectingFace(const v3s16 &p, - const NodeDefManager *nodedef, Map *map, MapNode n, int v, int *neighbors) -{ - MapNode n2 = map->getNode(p); - if (nodedef->nodeboxConnects(n, n2, v)) - *neighbors |= v; -} - collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, f32 pos_max_d, const aabb3f &box_0, f32 stepheight, f32 dtime, diff --git a/src/gui/guiTable.cpp b/src/gui/guiTable.cpp index 530580124..498090413 100644 --- a/src/gui/guiTable.cpp +++ b/src/gui/guiTable.cpp @@ -183,7 +183,6 @@ void GUITable::setTable(const TableOptions &options, } // Handle table options - video::SColor default_color(255, 255, 255, 255); s32 opendepth = 0; for (const Option &option : options) { const std::string &name = option.name; diff --git a/src/irrlicht_changes/static_text.cpp b/src/irrlicht_changes/static_text.cpp index 61f4da5e1..eba397963 100644 --- a/src/irrlicht_changes/static_text.cpp +++ b/src/irrlicht_changes/static_text.cpp @@ -94,7 +94,6 @@ void StaticText::draw() getTextWidth(); } - irr::video::SColor previous_color(255, 255, 255, 255); for (const EnrichedString &str : BrokenText) { if (HAlign == EGUIA_LOWERRIGHT) { diff --git a/src/network/connection_internal.h b/src/network/connection_internal.h index 95f523be2..a528f3fef 100644 --- a/src/network/connection_internal.h +++ b/src/network/connection_internal.h @@ -455,7 +455,7 @@ class UDPPeer final : public Peer void PutReliableSendCommand(ConnectionCommandPtr &c, unsigned int max_packet_size) override; - virtual const Address &getAddress() const { + virtual const Address &getAddress() const override { return address; }