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

C++11 cleanup on constructors guiEngine (#6036)

* C++11 cleanup on constructors guiEngine
This commit is contained in:
Vincent Glize 2017-06-24 13:41:30 +02:00 committed by Loïc Blot
parent 8a84e89922
commit 9da5fb1583
2 changed files with 36 additions and 52 deletions

View file

@ -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 */