#include "util/enriched_string.h"
/******************************************************************************/
-/* Typedefs and macros */
+/* Structs and macros */
/******************************************************************************/
/** texture layer ids */
-typedef enum
-{
+enum texture_layer {
TEX_LAYER_BACKGROUND = 0,
TEX_LAYER_OVERLAY,
TEX_LAYER_HEADER,
TEX_LAYER_FOOTER,
TEX_LAYER_MAX
-} texture_layer;
+};
-typedef struct
-{
+struct image_definition {
video::ITexture *texture = nullptr;
- bool tile;
- unsigned int minsize;
-} image_definition;
+ bool tile;
+ unsigned int minsize;
+};
/******************************************************************************/
/* forward declarations */
/******************************************************************************/
class GUIEngine;
+class RenderingEngine;
class MainMenuScripting;
class Clouds;
struct MainMenuData;
* default constructor
* @param engine the engine data is transmitted for further processing
*/
- TextDestGuiEngine(GUIEngine *engine) : m_engine(engine){};
+ TextDestGuiEngine(GUIEngine* engine) : m_engine(engine) {};
/**
* receive fields transmitted by guiFormSpecMenu
* default constructor
* @param driver the video driver to load textures from
*/
- MenuTextureSource(video::IVideoDriver *driver) : m_driver(driver){};
+ MenuTextureSource(video::IVideoDriver *driver) : m_driver(driver) {};
/**
* destructor, removes all loaded textures
};
/** GUIEngine specific implementation of OnDemandSoundFetcher */
-class MenuMusicFetcher : public OnDemandSoundFetcher
+class MenuMusicFetcher: public OnDemandSoundFetcher
{
public:
/**
* @param dst_paths receives possible paths to sound files
* @param dst_datas receives binary sound data (not used here)
*/
- void fetchSounds(const std::string &name, std::set<std::string> &dst_paths,
+ void fetchSounds(const std::string &name,
+ std::set<std::string> &dst_paths,
std::set<std::string> &dst_datas);
private:
};
/** implementation of main menu based uppon formspecs */
-class GUIEngine
-{
+class GUIEngine {
/** grant ModApiMainMenu access to private members */
friend class ModApiMainMenu;
friend class ModApiSound;
* @param smgr scene manager to add scene elements to
* @param data struct to transfer data to main game handling
*/
- GUIEngine(JoystickController *joystick, gui::IGUIElement *parent,
- IMenuManager *menumgr, MainMenuData *data, bool &kill);
+ GUIEngine(JoystickController *joystick,
+ gui::IGUIElement *parent,
+ RenderingEngine *rendering_engine,
+ IMenuManager *menumgr,
+ MainMenuData *data,
+ bool &kill);
/** default destructor */
virtual ~GUIEngine();
/**
* return MainMenuScripting interface
*/
- MainMenuScripting *getScriptIface() { return m_script; }
+ MainMenuScripting *getScriptIface()
+ {
+ return m_script;
+ }
/**
* return dir of current menuscript
*/
- std::string getScriptDir() { return m_scriptdir; }
+ std::string getScriptDir()
+ {
+ return m_scriptdir;
+ }
/** pass async callback to scriptengine **/
unsigned int queueAsync(const std::string &serialized_fct,
const std::string &serialized_params);
private:
+
/** find and run the main menu script */
bool loadMainMenuScript();
/** update size of topleftext element */
void updateTopLeftTextSize();
+ RenderingEngine *m_rendering_engine = nullptr;
/** parent gui element */
- gui::IGUIElement *m_parent = nullptr;
+ gui::IGUIElement *m_parent = nullptr;
/** manager to add menus to */
- IMenuManager *m_menumanager = nullptr;
+ IMenuManager *m_menumanager = nullptr;
/** scene manager to add scene elements to */
- scene::ISceneManager *m_smgr = nullptr;
+ scene::ISceneManager *m_smgr = nullptr;
/** pointer to data beeing transfered back to main game handling */
- MainMenuData *m_data = nullptr;
+ MainMenuData *m_data = nullptr;
/** pointer to texture source */
- ISimpleTextureSource *m_texture_source = nullptr;
+ ISimpleTextureSource *m_texture_source = nullptr;
/** pointer to soundmanager*/
- ISoundManager *m_sound_manager = nullptr;
+ ISoundManager *m_sound_manager = nullptr;
/** representation of form source to be used in mainmenu formspec */
- FormspecFormSource *m_formspecgui = nullptr;
+ FormspecFormSource *m_formspecgui = nullptr;
/** formspec input receiver */
- TextDestGuiEngine *m_buttonhandler = nullptr;
+ TextDestGuiEngine *m_buttonhandler = nullptr;
/** the formspec menu */
- GUIFormSpecMenu *m_menu = nullptr;
+ 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;
+ bool m_startgame = false;
/** scripting interface */
- MainMenuScripting *m_script = nullptr;
+ MainMenuScripting *m_script = nullptr;
/** script basefolder */
- std::string m_scriptdir = "";
+ std::string m_scriptdir = "";
void setFormspecPrepend(const std::string &fs);
/** do preprocessing for cloud subsystem */
void cloudPreProcess();
/** do postprocessing for cloud subsystem */
- void cloudPostProcess();
+ void cloudPostProcess(u32 frametime_min, IrrlichtDevice *device);
/** internam data required for drawing clouds */
- struct clouddata
- {
+ struct clouddata {
/** delta time since last cloud processing */
- f32 dtime;
+ f32 dtime;
/** absolute time of last cloud processing */
- u32 lasttime;
+ u32 lasttime;
/** pointer to cloud class */
Clouds *clouds = nullptr;
/** camera required for drawing clouds */
};
/** is drawing of clouds enabled atm */
- bool m_clouds_enabled = true;
+ bool m_clouds_enabled = true;
/** data used to draw clouds */
- clouddata m_cloud;
+ clouddata m_cloud;
/** start playing a sound and return handle */
s32 playSound(const SimpleSoundSpec &spec, bool looped);
/** stop playing a sound started with playSound() */
void stopSound(s32 handle);
+
+
};