1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +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();