1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Irrlicht support code maintenance

This commit is contained in:
sfan5 2021-03-31 13:15:47 +02:00 committed by GitHub
parent 0d90ed6d92
commit 1e4913cd76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 5 additions and 79 deletions

View file

@ -1021,11 +1021,7 @@ video::IImage* CGUITTFont::createTextureFromChar(const uchar32_t& ch)
video::ITexture* tex = page->texture;
// Acquire a read-only lock of the corresponding page texture.
#if IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR>=8
void* ptr = tex->lock(video::ETLM_READ_ONLY);
#else
void* ptr = tex->lock(true);
#endif
video::ECOLOR_FORMAT format = tex->getColorFormat();
core::dimension2du tex_size = tex->getOriginalSize();
@ -1182,11 +1178,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
// Now we copy planes corresponding to the letter size.
IMeshManipulator* mani = smgr->getMeshManipulator();
IMesh* meshcopy = mani->createMeshCopy(shared_plane_ptr_);
#if IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR>=8
mani->scale(meshcopy, vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
#else
mani->scaleMesh(meshcopy, vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
#endif
ISceneNode* current_node = smgr->addMeshSceneNode(meshcopy, parent, -1, current_pos);
meshcopy->drop();

View file

@ -34,7 +34,7 @@
#include <irrlicht.h>
#include <ft2build.h>
#include <vector>
#include "irrUString.h"
#include <irrUString.h>
#include "util/enriched_string.h"
#include FT_FREETYPE_H

View file

@ -246,11 +246,7 @@ void StaticText::setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vert
}
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
const video::SColor& StaticText::getOverrideColor() const
#else
video::SColor StaticText::getOverrideColor() const
#endif
{
return ColoredText.getDefaultColor();
}

View file

@ -134,11 +134,7 @@ namespace gui
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical);
//! Gets the override color
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
virtual const video::SColor& getOverrideColor() const;
#else
virtual video::SColor getOverrideColor() const;
#endif
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
//! Gets the currently used text color