1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Move Minetest GUISkin -> Irrlicht CGUISkin

This commit is contained in:
Gregor Parzefall 2024-09-06 21:05:38 +02:00 committed by sfan5
parent c8ebc2e5d0
commit 2208fc0632
7 changed files with 42 additions and 115 deletions

View file

@ -36,7 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "inputhandler.h"
#include "gettext.h"
#include "filesys.h"
#include "../gui/guiSkin.h"
#include "irrlicht_changes/static_text.h"
#include "irr_ptr.h"
@ -126,27 +125,6 @@ IShaderConstantSetter *FogShaderConstantSetterFactory::create()
/* Other helpers */
static gui::GUISkin *createSkin(gui::IGUIEnvironment *environment,
gui::EGUI_SKIN_TYPE type, video::IVideoDriver *driver)
{
gui::GUISkin *skin = new gui::GUISkin(type, driver);
gui::IGUIFont *builtinfont = environment->getBuiltInFont();
gui::IGUIFontBitmap *bitfont = nullptr;
if (builtinfont && builtinfont->getType() == gui::EGFT_BITMAP)
bitfont = (gui::IGUIFontBitmap*)builtinfont;
gui::IGUISpriteBank *bank = 0;
skin->setFont(builtinfont);
if (bitfont)
bank = bitfont->getSpriteBank();
skin->setSpriteBank(bank);
return skin;
}
static std::optional<video::E_DRIVER_TYPE> chooseVideoDriver()
{
auto &&configured_name = g_settings->get("video_driver");
@ -250,11 +228,6 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
s_singleton = this;
auto skin = createSkin(m_device->getGUIEnvironment(),
gui::EGST_WINDOWS_METALLIC, driver);
m_device->getGUIEnvironment()->setSkin(skin);
skin->drop();
g_settings->registerChangedCallback("fullscreen", settingChangedCallback, this);
g_settings->registerChangedCallback("window_maximized", settingChangedCallback, this);
}