mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	C++11 cleanup on constructors guiEngine (#6036)
* C++11 cleanup on constructors guiEngine
This commit is contained in:
		@@ -45,14 +45,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
/** TextDestGuiEngine                                                         */
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
TextDestGuiEngine::TextDestGuiEngine(GUIEngine* engine)
 | 
			
		||||
{
 | 
			
		||||
	m_engine = engine;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
void TextDestGuiEngine::gotText(const StringMap &fields)
 | 
			
		||||
{
 | 
			
		||||
@@ -65,14 +57,6 @@ void TextDestGuiEngine::gotText(const std::wstring &text)
 | 
			
		||||
	m_engine->getScriptIface()->handleMainMenuEvent(wide_to_utf8(text));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
/** MenuTextureSource                                                         */
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
MenuTextureSource::MenuTextureSource(video::IVideoDriver *driver)
 | 
			
		||||
{
 | 
			
		||||
	m_driver = driver;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
MenuTextureSource::~MenuTextureSource()
 | 
			
		||||
{
 | 
			
		||||
@@ -85,7 +69,7 @@ MenuTextureSource::~MenuTextureSource()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
video::ITexture* MenuTextureSource::getTexture(const std::string &name, u32 *id)
 | 
			
		||||
video::ITexture *MenuTextureSource::getTexture(const std::string &name, u32 *id)
 | 
			
		||||
{
 | 
			
		||||
	if(id)
 | 
			
		||||
		*id = 0;
 | 
			
		||||
@@ -130,13 +114,13 @@ void MenuMusicFetcher::fetchSounds(const std::string &name,
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
/** GUIEngine                                                                 */
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
GUIEngine::GUIEngine(	irr::IrrlichtDevice* dev,
 | 
			
		||||
						JoystickController *joystick,
 | 
			
		||||
						gui::IGUIElement* parent,
 | 
			
		||||
						IMenuManager *menumgr,
 | 
			
		||||
						scene::ISceneManager* smgr,
 | 
			
		||||
						MainMenuData* data,
 | 
			
		||||
						bool& kill) :
 | 
			
		||||
GUIEngine::GUIEngine(irr::IrrlichtDevice *dev,
 | 
			
		||||
		JoystickController *joystick,
 | 
			
		||||
		gui::IGUIElement *parent,
 | 
			
		||||
		IMenuManager *menumgr,
 | 
			
		||||
		scene::ISceneManager *smgr,
 | 
			
		||||
		MainMenuData *data,
 | 
			
		||||
		bool &kill) :
 | 
			
		||||
	m_device(dev),
 | 
			
		||||
	m_parent(parent),
 | 
			
		||||
	m_menumanager(menumgr),
 | 
			
		||||
@@ -388,7 +372,7 @@ void GUIEngine::cloudPostProcess()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
void GUIEngine::drawBackground(video::IVideoDriver* driver)
 | 
			
		||||
void GUIEngine::drawBackground(video::IVideoDriver *driver)
 | 
			
		||||
{
 | 
			
		||||
	v2u32 screensize = driver->getScreenSize();
 | 
			
		||||
 | 
			
		||||
@@ -430,7 +414,7 @@ void GUIEngine::drawBackground(video::IVideoDriver* driver)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
void GUIEngine::drawOverlay(video::IVideoDriver* driver)
 | 
			
		||||
void GUIEngine::drawOverlay(video::IVideoDriver *driver)
 | 
			
		||||
{
 | 
			
		||||
	v2u32 screensize = driver->getScreenSize();
 | 
			
		||||
 | 
			
		||||
@@ -449,7 +433,7 @@ void GUIEngine::drawOverlay(video::IVideoDriver* driver)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
void GUIEngine::drawHeader(video::IVideoDriver* driver)
 | 
			
		||||
void GUIEngine::drawHeader(video::IVideoDriver *driver)
 | 
			
		||||
{
 | 
			
		||||
	core::dimension2d<u32> screensize = driver->getScreenSize();
 | 
			
		||||
 | 
			
		||||
@@ -483,7 +467,7 @@ void GUIEngine::drawHeader(video::IVideoDriver* driver)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************************/
 | 
			
		||||
void GUIEngine::drawFooter(video::IVideoDriver* driver)
 | 
			
		||||
void GUIEngine::drawFooter(video::IVideoDriver *driver)
 | 
			
		||||
{
 | 
			
		||||
	core::dimension2d<u32> screensize = driver->getScreenSize();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ typedef enum {
 | 
			
		||||
} texture_layer;
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
	video::ITexture* texture;
 | 
			
		||||
	video::ITexture *texture = nullptr;
 | 
			
		||||
	bool             tile;
 | 
			
		||||
	unsigned int     minsize;
 | 
			
		||||
} image_definition;
 | 
			
		||||
@@ -68,7 +68,7 @@ public:
 | 
			
		||||
	 * default constructor
 | 
			
		||||
	 * @param engine the engine data is transmitted for further processing
 | 
			
		||||
	 */
 | 
			
		||||
	TextDestGuiEngine(GUIEngine* engine);
 | 
			
		||||
	TextDestGuiEngine(GUIEngine* engine) : m_engine(engine) {};
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * receive fields transmitted by guiFormSpecMenu
 | 
			
		||||
@@ -84,7 +84,7 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	/** target to transmit data to */
 | 
			
		||||
	GUIEngine* m_engine;
 | 
			
		||||
	GUIEngine *m_engine = nullptr;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/** GUIEngine specific implementation of ISimpleTextureSource */
 | 
			
		||||
@@ -95,7 +95,7 @@ public:
 | 
			
		||||
	 * default constructor
 | 
			
		||||
	 * @param driver the video driver to load textures from
 | 
			
		||||
	 */
 | 
			
		||||
	MenuTextureSource(video::IVideoDriver *driver);
 | 
			
		||||
	MenuTextureSource(video::IVideoDriver *driver) : m_driver(driver) {};
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * destructor, removes all loaded textures
 | 
			
		||||
@@ -107,11 +107,11 @@ public:
 | 
			
		||||
	 * @param name path to the texture
 | 
			
		||||
	 * @param id receives the texture ID, always 0 in this implementation
 | 
			
		||||
	 */
 | 
			
		||||
	video::ITexture* getTexture(const std::string &name, u32 *id = NULL);
 | 
			
		||||
	video::ITexture *getTexture(const std::string &name, u32 *id = NULL);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	/** driver to get textures from */
 | 
			
		||||
	video::IVideoDriver *m_driver;
 | 
			
		||||
	video::IVideoDriver *m_driver = nullptr;
 | 
			
		||||
	/** set of texture names to delete */
 | 
			
		||||
	std::set<std::string> m_to_delete;
 | 
			
		||||
};
 | 
			
		||||
@@ -150,13 +150,13 @@ public:
 | 
			
		||||
	 * @param smgr scene manager to add scene elements to
 | 
			
		||||
	 * @param data struct to transfer data to main game handling
 | 
			
		||||
	 */
 | 
			
		||||
	GUIEngine(irr::IrrlichtDevice* dev,
 | 
			
		||||
	GUIEngine(irr::IrrlichtDevice *dev,
 | 
			
		||||
			JoystickController *joystick,
 | 
			
		||||
			gui::IGUIElement* parent,
 | 
			
		||||
			gui::IGUIElement *parent,
 | 
			
		||||
			IMenuManager *menumgr,
 | 
			
		||||
			scene::ISceneManager* smgr,
 | 
			
		||||
			MainMenuData* data,
 | 
			
		||||
			bool& kill);
 | 
			
		||||
			scene::ISceneManager *smgr,
 | 
			
		||||
			MainMenuData *data,
 | 
			
		||||
			bool &kill);
 | 
			
		||||
 | 
			
		||||
	/** default destructor */
 | 
			
		||||
	virtual ~GUIEngine();
 | 
			
		||||
@@ -164,7 +164,7 @@ public:
 | 
			
		||||
	/**
 | 
			
		||||
	 * return MainMenuScripting interface
 | 
			
		||||
	 */
 | 
			
		||||
	MainMenuScripting* getScriptIface()
 | 
			
		||||
	MainMenuScripting *getScriptIface()
 | 
			
		||||
	{
 | 
			
		||||
		return m_script;
 | 
			
		||||
	}
 | 
			
		||||
@@ -193,15 +193,15 @@ private:
 | 
			
		||||
	void updateTopLeftTextSize();
 | 
			
		||||
 | 
			
		||||
	/** device to draw at */
 | 
			
		||||
	irr::IrrlichtDevice*     m_device;
 | 
			
		||||
	irr::IrrlichtDevice     *m_device = nullptr;
 | 
			
		||||
	/** parent gui element */
 | 
			
		||||
	gui::IGUIElement*        m_parent;
 | 
			
		||||
	gui::IGUIElement        *m_parent = nullptr;
 | 
			
		||||
	/** manager to add menus to */
 | 
			
		||||
	IMenuManager*            m_menumanager;
 | 
			
		||||
	IMenuManager            *m_menumanager = nullptr;
 | 
			
		||||
	/** scene manager to add scene elements to */
 | 
			
		||||
	scene::ISceneManager*    m_smgr;
 | 
			
		||||
	scene::ISceneManager    *m_smgr = nullptr;
 | 
			
		||||
	/** pointer to data beeing transfered back to main game handling */
 | 
			
		||||
	MainMenuData*            m_data;
 | 
			
		||||
	MainMenuData            *m_data = nullptr;
 | 
			
		||||
	/** pointer to texture source */
 | 
			
		||||
	ISimpleTextureSource    *m_texture_source = nullptr;
 | 
			
		||||
	/** pointer to soundmanager*/
 | 
			
		||||
@@ -215,7 +215,7 @@ private:
 | 
			
		||||
	GUIFormSpecMenu         *m_menu = nullptr;
 | 
			
		||||
 | 
			
		||||
	/** reference to kill variable managed by SIGINT handler */
 | 
			
		||||
	bool&                    m_kill;
 | 
			
		||||
	bool                    &m_kill;
 | 
			
		||||
 | 
			
		||||
	/** variable used to abort menu and return back to main game handling */
 | 
			
		||||
	bool                     m_startgame = false;
 | 
			
		||||
@@ -230,22 +230,22 @@ private:
 | 
			
		||||
	 * draw background layer
 | 
			
		||||
	 * @param driver to use for drawing
 | 
			
		||||
	 */
 | 
			
		||||
	void drawBackground(video::IVideoDriver* driver);
 | 
			
		||||
	void drawBackground(video::IVideoDriver *driver);
 | 
			
		||||
	/**
 | 
			
		||||
	 * draw overlay layer
 | 
			
		||||
	 * @param driver to use for drawing
 | 
			
		||||
	 */
 | 
			
		||||
	void drawOverlay(video::IVideoDriver* driver);
 | 
			
		||||
	void drawOverlay(video::IVideoDriver *driver);
 | 
			
		||||
	/**
 | 
			
		||||
	 * draw header layer
 | 
			
		||||
	 * @param driver to use for drawing
 | 
			
		||||
	 */
 | 
			
		||||
	void drawHeader(video::IVideoDriver* driver);
 | 
			
		||||
	void drawHeader(video::IVideoDriver *driver);
 | 
			
		||||
	/**
 | 
			
		||||
	 * draw footer layer
 | 
			
		||||
	 * @param driver to use for drawing
 | 
			
		||||
	 */
 | 
			
		||||
	void drawFooter(video::IVideoDriver* driver);
 | 
			
		||||
	void drawFooter(video::IVideoDriver *driver);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * load a texture for a specified layer
 | 
			
		||||
@@ -290,9 +290,9 @@ private:
 | 
			
		||||
		/** absolute time of last cloud processing */
 | 
			
		||||
		u32     lasttime;
 | 
			
		||||
		/** pointer to cloud class */
 | 
			
		||||
		Clouds* clouds;
 | 
			
		||||
		Clouds *clouds = nullptr;
 | 
			
		||||
		/** camera required for drawing clouds */
 | 
			
		||||
		scene::ICameraSceneNode* camera;
 | 
			
		||||
		scene::ICameraSceneNode *camera = nullptr;
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	/** is drawing of clouds enabled atm */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user