minetest/src/client/game.h

57 lines
1.6 KiB
C
Raw Normal View History

/*
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>
This program is free software; you can redistribute it and/or modify
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
(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
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "irrlichttypes.h"
#include <string>
class InputHandler;
class ChatBackend; /* to avoid having to include chat.h */
2012-03-11 13:54:23 +01:00
struct SubgameSpec;
struct Jitter {
f32 max, min, avg, counter, max_sample, min_sample, max_fraction;
};
struct RunStats {
u32 drawtime;
Jitter dtime_jitter, busy_time_jitter;
};
struct CameraOrientation {
f32 camera_yaw; // "right/left"
f32 camera_pitch; // "up/down"
};
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,
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,
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,
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);