Skip to content

Commit 1e4913c

Browse files
authored
Irrlicht support code maintenance
1 parent 0d90ed6 commit 1e4913c

11 files changed

Lines changed: 5 additions & 79 deletions

File tree

src/client/clientlauncher.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,9 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
178178
g_fontengine = new FontEngine(guienv);
179179
FATAL_ERROR_IF(g_fontengine == NULL, "Font engine creation failed.");
180180

181-
#if (IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2
182181
// Irrlicht 1.8 input colours
183182
skin->setColor(gui::EGDC_EDITABLE, video::SColor(255, 128, 128, 128));
184183
skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 96, 134, 49));
185-
#endif
186184

187185
// Create the menu clouds
188186
if (!g_menucloudsmgr)

src/client/content_cao.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,11 +1473,8 @@ void GenericCAO::updateAnimation()
14731473
if (m_animated_meshnode->getAnimationSpeed() != m_animation_speed)
14741474
m_animated_meshnode->setAnimationSpeed(m_animation_speed);
14751475
m_animated_meshnode->setTransitionTime(m_animation_blend);
1476-
// Requires Irrlicht 1.8 or greater
1477-
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR > 1
14781476
if (m_animated_meshnode->getLoopMode() != m_animation_loop)
14791477
m_animated_meshnode->setLoopMode(m_animation_loop);
1480-
#endif
14811478
}
14821479

14831480
void GenericCAO::updateAnimationSpeed()

src/client/game.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,7 @@ class GameOnDemandSoundFetcher: public OnDemandSoundFetcher
400400
};
401401

402402

403-
// before 1.8 there isn't a "integer interface", only float
404-
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
405-
typedef f32 SamplerLayer_t;
406-
#else
407403
typedef s32 SamplerLayer_t;
408-
#endif
409404

410405

411406
class GameGlobalShaderConstantSetter : public IShaderConstantSetter
@@ -513,38 +508,20 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
513508

514509
float eye_position_array[3];
515510
v3f epos = m_client->getEnv().getLocalPlayer()->getEyePosition();
516-
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
517-
eye_position_array[0] = epos.X;
518-
eye_position_array[1] = epos.Y;
519-
eye_position_array[2] = epos.Z;
520-
#else
521511
epos.getAs3Values(eye_position_array);
522-
#endif
523512
m_eye_position_pixel.set(eye_position_array, services);
524513
m_eye_position_vertex.set(eye_position_array, services);
525514

526515
if (m_client->getMinimap()) {
527516
float minimap_yaw_array[3];
528517
v3f minimap_yaw = m_client->getMinimap()->getYawVec();
529-
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
530-
minimap_yaw_array[0] = minimap_yaw.X;
531-
minimap_yaw_array[1] = minimap_yaw.Y;
532-
minimap_yaw_array[2] = minimap_yaw.Z;
533-
#else
534518
minimap_yaw.getAs3Values(minimap_yaw_array);
535-
#endif
536519
m_minimap_yaw.set(minimap_yaw_array, services);
537520
}
538521

539522
float camera_offset_array[3];
540523
v3f offset = intToFloat(m_client->getCamera()->getOffset(), BS);
541-
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
542-
camera_offset_array[0] = offset.X;
543-
camera_offset_array[1] = offset.Y;
544-
camera_offset_array[2] = offset.Z;
545-
#else
546524
offset.getAs3Values(camera_offset_array);
547-
#endif
548525
m_camera_offset_pixel.set(camera_offset_array, services);
549526
m_camera_offset_vertex.set(camera_offset_array, services);
550527

src/client/keycode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ static const struct table_key table[] = {
197197
DEFINEKEY1(KEY_MODECHANGE, N_("IME Mode Change"))
198198
DEFINEKEY1(KEY_APPS, N_("Apps"))
199199
DEFINEKEY1(KEY_SLEEP, N_("Sleep"))
200-
#if !(IRRLICHT_VERSION_MAJOR <= 1 && IRRLICHT_VERSION_MINOR <= 7 && IRRLICHT_VERSION_REVISION < 3)
201200
DEFINEKEY1(KEY_OEM_1, "OEM 1") // KEY_OEM_[0-9] and KEY_OEM_102 are assigned to multiple
202201
DEFINEKEY1(KEY_OEM_2, "OEM 2") // different chars (on different platforms too) and thus w/o char
203202
DEFINEKEY1(KEY_OEM_3, "OEM 3")
@@ -208,7 +207,6 @@ static const struct table_key table[] = {
208207
DEFINEKEY1(KEY_OEM_8, "OEM 8")
209208
DEFINEKEY1(KEY_OEM_AX, "OEM AX")
210209
DEFINEKEY1(KEY_OEM_102, "OEM 102")
211-
#endif
212210
DEFINEKEY1(KEY_ATTN, "Attn")
213211
DEFINEKEY1(KEY_CRSEL, "CrSel")
214212
DEFINEKEY1(KEY_EXSEL, "ExSel")

src/client/mesh.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2727
#include <SAnimatedMesh.h>
2828
#include <IAnimatedMeshSceneNode.h>
2929

30-
// In Irrlicht 1.8 the signature of ITexture::lock was changed from
31-
// (bool, u32) to (E_TEXTURE_LOCK_MODE, u32).
32-
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
33-
#define MY_ETLM_READ_ONLY true
34-
#else
35-
#define MY_ETLM_READ_ONLY video::ETLM_READ_ONLY
36-
#endif
37-
3830
inline static void applyShadeFactor(video::SColor& color, float factor)
3931
{
4032
color.setRed(core::clamp(core::round32(color.getRed()*factor), 0, 255));

src/client/wieldmesh.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,7 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
294294
}
295295
material.setFlag(video::EMF_ANISOTROPIC_FILTER, m_anisotropic_filter);
296296
// mipmaps cause "thin black line" artifacts
297-
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2
298297
material.setFlag(video::EMF_USE_MIP_MAPS, false);
299-
#endif
300298
if (m_enable_shaders) {
301299
material.setTexture(2, tsrc->getShaderFlagsTexture(false));
302300
}

src/irrlicht_changes/CGUITTFont.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,11 +1021,7 @@ video::IImage* CGUITTFont::createTextureFromChar(const uchar32_t& ch)
10211021
video::ITexture* tex = page->texture;
10221022

10231023
// Acquire a read-only lock of the corresponding page texture.
1024-
#if IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR>=8
10251024
void* ptr = tex->lock(video::ETLM_READ_ONLY);
1026-
#else
1027-
void* ptr = tex->lock(true);
1028-
#endif
10291025

10301026
video::ECOLOR_FORMAT format = tex->getColorFormat();
10311027
core::dimension2du tex_size = tex->getOriginalSize();
@@ -1182,11 +1178,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
11821178
// Now we copy planes corresponding to the letter size.
11831179
IMeshManipulator* mani = smgr->getMeshManipulator();
11841180
IMesh* meshcopy = mani->createMeshCopy(shared_plane_ptr_);
1185-
#if IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR>=8
11861181
mani->scale(meshcopy, vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
1187-
#else
1188-
mani->scaleMesh(meshcopy, vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
1189-
#endif
11901182

11911183
ISceneNode* current_node = smgr->addMeshSceneNode(meshcopy, parent, -1, current_pos);
11921184
meshcopy->drop();

src/irrlicht_changes/CGUITTFont.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <irrlicht.h>
3535
#include <ft2build.h>
3636
#include <vector>
37-
#include "irrUString.h"
37+
#include <irrUString.h>
3838
#include "util/enriched_string.h"
3939
#include FT_FREETYPE_H
4040

src/irrlicht_changes/static_text.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,7 @@ void StaticText::setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vert
246246
}
247247

248248

249-
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
250-
const video::SColor& StaticText::getOverrideColor() const
251-
#else
252249
video::SColor StaticText::getOverrideColor() const
253-
#endif
254250
{
255251
return ColoredText.getDefaultColor();
256252
}

src/irrlicht_changes/static_text.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ namespace gui
134134
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical);
135135

136136
//! Gets the override color
137-
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
138-
virtual const video::SColor& getOverrideColor() const;
139-
#else
140137
virtual video::SColor getOverrideColor() const;
141-
#endif
142138

143139
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
144140
//! Gets the currently used text color

0 commit comments

Comments
 (0)