]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/game.h
Handle particle spawners in env and delete expired ids
[dragonfireclient.git] / src / game.h
index de0b8483b07500d4adbea2915bfe8f0151dc3ad8..e1f4e9346a77df11abf2a4f14afe244e0046084b 100644 (file)
@@ -35,11 +35,14 @@ class KeyList : protected std::list<KeyPress>
        {
                const_iterator f(begin());
                const_iterator e(end());
-               while (f!=e) {
+
+               while (f != e) {
                        if (*f == key)
                                return f;
+
                        ++f;
                }
+
                return e;
        }
 
@@ -47,16 +50,22 @@ class KeyList : protected std::list<KeyPress>
        {
                iterator f(begin());
                iterator e(end());
-               while (f!=e) {
+
+               while (f != e) {
                        if (*f == key)
                                return f;
+
                        ++f;
                }
+
                return e;
        }
 
 public:
-       void clear() { super::clear(); }
+       void clear()
+       {
+               super::clear();
+       }
 
        void set(const KeyPress &key)
        {
@@ -67,6 +76,7 @@ class KeyList : protected std::list<KeyPress>
        void unset(const KeyPress &key)
        {
                iterator p(find(key));
+
                if (p != end())
                        erase(p);
        }
@@ -74,6 +84,7 @@ class KeyList : protected std::list<KeyPress>
        void toggle(const KeyPress &key)
        {
                iterator p(this->find(key));
+
                if (p != end())
                        erase(p);
                else
@@ -98,7 +109,7 @@ class InputHandler
 
        virtual bool isKeyDown(const KeyPress &keyCode) = 0;
        virtual bool wasKeyDown(const KeyPress &keyCode) = 0;
-       
+
        virtual v2s32 getMousePos() = 0;
        virtual void setMousePos(s32 x, s32 y) = 0;
 
@@ -114,34 +125,31 @@ class InputHandler
        virtual bool getRightReleased() = 0;
        virtual void resetLeftReleased() = 0;
        virtual void resetRightReleased() = 0;
-       
+
        virtual s32 getMouseWheel() = 0;
 
-       virtual void step(float dtime) {};
+       virtual void step(float dtime) {}
 
-       virtual void clear() {};
+       virtual void clear() {}
 };
 
 class ChatBackend;  /* to avoid having to include chat.h */
 struct SubgameSpec;
-enum CameraModes {CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT};
-
-void the_game(
-       bool &kill,
-       bool random_input,
-       InputHandler *input,
-       IrrlichtDevice *device,
-       gui::IGUIFont* font,
-       std::string map_dir,
-       std::string playername,
-       std::string password,
-       std::string address, // If "", local server is used
-       u16 port,
-       std::wstring &error_message,
-       ChatBackend &chat_backend,
-       const SubgameSpec &gamespec, // Used for local game
-       bool simple_singleplayer_mode
-);
+
+void the_game(bool *kill,
+               bool random_input,
+               InputHandler *input,
+               IrrlichtDevice *device,
+               const std::string &map_dir,
+               const std::string &playername,
+               const std::string &password,
+               const std::string &address, // If "", local server is used
+               u16 port,
+               std::string &error_message,
+               ChatBackend &chat_backend,
+               bool *reconnect_requested,
+               const SubgameSpec &gamespec, // Used for local game
+               bool simple_singleplayer_mode);
 
 #endif