2011-04-23 17:31:31 +02:00
|
|
|
/*
|
2013-02-24 18:40:43 +01:00
|
|
|
Minetest
|
2013-02-24 19:38:45 +01:00
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2011-04-23 17:31:31 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
2012-06-05 16:56:56 +02:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2011-04-23 17:31:31 +02:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2012-06-05 16:56:56 +02:00
|
|
|
GNU Lesser General Public License for more details.
|
2011-04-23 17:31:31 +02:00
|
|
|
|
2012-06-05 16:56:56 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
2011-04-23 17:31:31 +02:00
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GAME_HEADER
|
|
|
|
#define GAME_HEADER
|
|
|
|
|
2012-06-17 03:00:31 +02:00
|
|
|
#include "irrlichttypes_extrabloated.h"
|
2011-04-23 17:31:31 +02:00
|
|
|
#include <string>
|
2016-05-25 09:22:20 +02:00
|
|
|
#include "client/keys.h"
|
2016-05-27 08:35:07 +02:00
|
|
|
#include "client/joystick_controller.h"
|
2011-08-13 22:44:31 +02:00
|
|
|
#include "keycode.h"
|
2012-12-20 18:19:49 +01:00
|
|
|
#include <list>
|
2011-08-13 22:44:31 +02:00
|
|
|
|
2012-12-20 18:19:49 +01:00
|
|
|
class KeyList : protected std::list<KeyPress>
|
2011-08-13 22:44:31 +02:00
|
|
|
{
|
2012-12-20 18:19:49 +01:00
|
|
|
typedef std::list<KeyPress> super;
|
|
|
|
typedef super::iterator iterator;
|
|
|
|
typedef super::const_iterator const_iterator;
|
2011-08-13 22:44:31 +02:00
|
|
|
|
2012-12-20 18:19:49 +01:00
|
|
|
virtual const_iterator find(const KeyPress &key) const
|
2011-08-13 22:44:31 +02:00
|
|
|
{
|
2012-12-20 18:19:49 +01:00
|
|
|
const_iterator f(begin());
|
|
|
|
const_iterator e(end());
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
|
|
|
while (f != e) {
|
2011-08-13 22:44:31 +02:00
|
|
|
if (*f == key)
|
|
|
|
return f;
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
++f;
|
|
|
|
}
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
return e;
|
|
|
|
}
|
|
|
|
|
2012-12-20 18:19:49 +01:00
|
|
|
virtual iterator find(const KeyPress &key)
|
2011-08-13 22:44:31 +02:00
|
|
|
{
|
2012-12-20 18:19:49 +01:00
|
|
|
iterator f(begin());
|
|
|
|
iterator e(end());
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
|
|
|
while (f != e) {
|
2011-08-13 22:44:31 +02:00
|
|
|
if (*f == key)
|
|
|
|
return f;
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
++f;
|
|
|
|
}
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
return e;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
super::clear();
|
|
|
|
}
|
2011-08-13 22:44:31 +02:00
|
|
|
|
|
|
|
void set(const KeyPress &key)
|
|
|
|
{
|
|
|
|
if (find(key) == end())
|
|
|
|
push_back(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
void unset(const KeyPress &key)
|
|
|
|
{
|
2012-12-20 18:19:49 +01:00
|
|
|
iterator p(find(key));
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
if (p != end())
|
|
|
|
erase(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
void toggle(const KeyPress &key)
|
|
|
|
{
|
2012-12-20 18:19:49 +01:00
|
|
|
iterator p(this->find(key));
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
if (p != end())
|
|
|
|
erase(p);
|
|
|
|
else
|
|
|
|
push_back(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator[](const KeyPress &key) const
|
|
|
|
{
|
|
|
|
return find(key) != end();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-04-23 17:31:31 +02:00
|
|
|
class InputHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
InputHandler()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
virtual ~InputHandler()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-08-13 22:44:31 +02:00
|
|
|
virtual bool isKeyDown(const KeyPress &keyCode) = 0;
|
|
|
|
virtual bool wasKeyDown(const KeyPress &keyCode) = 0;
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2016-05-14 16:25:57 +02:00
|
|
|
virtual void listenForKey(const KeyPress &keyCode) {}
|
|
|
|
virtual void dontListenForKeys() {}
|
|
|
|
|
2011-04-23 17:31:31 +02:00
|
|
|
virtual v2s32 getMousePos() = 0;
|
|
|
|
virtual void setMousePos(s32 x, s32 y) = 0;
|
|
|
|
|
|
|
|
virtual bool getLeftState() = 0;
|
|
|
|
virtual bool getRightState() = 0;
|
|
|
|
|
|
|
|
virtual bool getLeftClicked() = 0;
|
|
|
|
virtual bool getRightClicked() = 0;
|
|
|
|
virtual void resetLeftClicked() = 0;
|
|
|
|
virtual void resetRightClicked() = 0;
|
|
|
|
|
|
|
|
virtual bool getLeftReleased() = 0;
|
|
|
|
virtual bool getRightReleased() = 0;
|
|
|
|
virtual void resetLeftReleased() = 0;
|
|
|
|
virtual void resetRightReleased() = 0;
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
|
2011-04-23 17:31:31 +02:00
|
|
|
virtual s32 getMouseWheel() = 0;
|
|
|
|
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
virtual void step(float dtime) {}
|
2011-04-23 17:31:31 +02:00
|
|
|
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
virtual void clear() {}
|
2016-05-27 08:35:07 +02:00
|
|
|
|
|
|
|
JoystickController joystick;
|
2011-04-23 17:31:31 +02:00
|
|
|
};
|
|
|
|
|
2011-12-03 09:01:14 +01:00
|
|
|
class ChatBackend; /* to avoid having to include chat.h */
|
2012-03-11 13:54:23 +01:00
|
|
|
struct SubgameSpec;
|
2011-12-03 09:01:14 +01:00
|
|
|
|
2017-03-19 13:18:52 +01:00
|
|
|
// Flags that can, or may, change during main game loop
|
|
|
|
struct GameUIFlags
|
|
|
|
{
|
|
|
|
bool show_chat;
|
|
|
|
bool show_hud;
|
|
|
|
bool show_minimap;
|
|
|
|
bool force_fog_off;
|
|
|
|
bool show_debug;
|
|
|
|
bool show_profiler_graph;
|
|
|
|
bool disable_camera_update;
|
|
|
|
};
|
|
|
|
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
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,
|
2015-03-28 01:24:04 +01:00
|
|
|
std::string &error_message,
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
ChatBackend &chat_backend,
|
2015-07-17 16:40:41 +02:00
|
|
|
bool *reconnect_requested,
|
Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:
Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"
This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.
Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered
Start "outlining" what a MinetestApp class might look like
Add MinetestApp::shutdown()
Converted class member functions to camelCase and created protos for new functions
First stage of connect to server done
Add get itemdefs/nodedefs/media code
Init clouds, camera, sky, init GUI, HUD
Input handling
Client events, camera, sound, draw
Fix wield hand getting stuck digging and add debug text back
Fix FPS
Added profiler graph back
Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff
Annotate
Various:
Rewrote limitFps()
Limited scope of some variables
Jitter calcs
Reduce scope of objects
Move some stuff out of ::run and minor formatting cleanup
Scope reduction
Function splits
Removed old (broken) limitFps()
Added exception handling back
Fixed some formatting
Reverted commented out unit tests (uncommented them)
Slow clouds down on loading and media screens so the behaviour is like the original the_game()
Formatting/style (no functional changes)
Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism
Fixed silly errors on my part
Minor formatting cleanups
Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense
Cleaning up
Add some comments
2014-10-31 13:13:04 +01:00
|
|
|
const SubgameSpec &gamespec, // Used for local game
|
|
|
|
bool simple_singleplayer_mode);
|
2011-04-23 17:31:31 +02:00
|
|
|
|
|
|
|
#endif
|