jni/src/player.cpp \
jni/src/porting_android.cpp \
jni/src/porting.cpp \
+ jni/src/profiler.cpp \
jni/src/quicktune.cpp \
jni/src/rollback.cpp \
jni/src/rollback_interface.cpp \
pathfinder.cpp
player.cpp
porting.cpp
+ profiler.cpp
quicktune.cpp
rollback.cpp
rollback_interface.cpp
#include "camera.h"
#include "debug.h"
#include "client.h"
-#include "main.h" // for g_settings
#include "map.h"
-#include "clientmap.h" // MapDrawControl
+#include "clientmap.h" // MapDrawControl
#include "player.h"
#include <cmath>
#include "settings.h"
#include "wieldmesh.h"
-#include "noise.h" // easeCurve
+#include "noise.h" // easeCurve
#include "gamedef.h"
#include "sound.h"
#include "event.h"
#include "util/string.h"
#include "client.h"
#include "network/clientopcodes.h"
-#include "main.h"
#include "filesys.h"
#include "porting.h"
#include "mapblock_mesh.h"
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "main.h"
#include "mainmenumanager.h"
#include "debug.h"
#include "clouds.h"
#include "fontengine.h"
#include "clientlauncher.h"
-// A pointer to a global instance of the time getter
-// TODO: why?
-TimeGetter *g_timegetter = NULL;
+/* mainmenumanager.h
+ */
+gui::IGUIEnvironment *guienv = NULL;
+gui::IGUIStaticText *guiroot = NULL;
+MainMenuManager g_menumgr;
+
+bool noMenuActive()
+{
+ return g_menumgr.menuCount() == 0;
+}
+
+// Passed to menus to allow disconnecting and exiting
+MainGameCallback *g_gamecallback = NULL;
+
+
+// Instance of the time getter
+static TimeGetter *g_timegetter = NULL;
u32 getTimeMs()
{
#include "util/numeric.h"
#include "irrlichttypes_extrabloated.h"
#include "debug.h"
-#include "main.h" // for g_settings
#include "filesys.h"
#include "settings.h"
#include "mesh.h"
#include "map.h"
#include "emerge.h"
#include "serverobject.h" // TODO this is used for cleanup of only
-#include "main.h" // for g_settings
#include "log.h"
const char *ClientInterface::statenames[] = {
#include <matrix4.h>
#include "log.h"
#include "mapsector.h"
-#include "main.h" // dout_client, g_settings
#include "nodedef.h"
#include "mapblock.h"
#include "profiler.h"
#include "settings.h"
-#include "camera.h" // CameraModes
+#include "camera.h" // CameraModes
#include "util/mathconstants.h"
#include <algorithm>
#include "log.h"
#include "porting.h"
#include "settings.h"
-#include "main.h"
#include "network/networkprotocol.h"
#include "util/hex.h"
#include "util/serialize.h"
#include "noise.h"
#include "constants.h"
#include "debug.h"
-#include "main.h" // For g_profiler and g_settings
#include "profiler.h"
#include "settings.h"
+
+// Menu clouds are created later
+class Clouds;
+Clouds *g_menuclouds = NULL;
+irr::scene::ISceneManager *g_menucloudsmgr = NULL;
+
Clouds::Clouds(
scene::ISceneNode* parent,
scene::ISceneManager* mgr,
#include <iostream>
#include "constants.h"
+// Menu clouds
+class Clouds;
+extern Clouds *g_menuclouds;
+
+// Scene manager used for menu clouds
+namespace irr{namespace scene{class ISceneManager;}}
+extern irr::scene::ISceneManager *g_menucloudsmgr;
+
class Clouds : public scene::ISceneNode
{
public:
#include <vector>
#include <set>
#include "util/timetaker.h"
-#include "main.h" // g_profiler
#include "profiler.h"
// float error is 10 - 9.96875 = 0.03125
#include "content_sao.h"
#include "settings.h"
#include "mapblock.h" // For getNodeBlockPos
-#include "main.h" // for g_settings
#include "map.h"
#include "scripting_game.h"
#include "log.h"
#include "nodedef.h"
#include "localplayer.h"
#include "map.h"
-#include "main.h" // g_settings
#include "camera.h" // CameraModes
#include "wieldmesh.h"
#include "log.h"
#include "content_mapblock.h"
#include "util/numeric.h"
#include "util/directiontables.h"
-#include "main.h" // For g_settings
#include "mapblock_mesh.h" // For MapBlock_LightColor() and MeshCollector
#include "settings.h"
#include "nodedef.h"
#include "collision.h"
#include "environment.h"
#include "settings.h"
-#include "main.h" // For g_profiler
#include "profiler.h"
#include "serialization.h" // For compressZlib
#include "tool.h" // For ToolCapabilities
#include "mods.h"
#include "config.h"
#include "log.h"
-#include "main.h" // for g_settings
#include "settings.h"
#include "httpfetch.h"
#include "porting.h"
#include "log.h"
#include "filesys.h"
#include "exceptions.h"
-#include "main.h"
#include "settings.h"
#include "util/string.h"
*/
#include "drawscene.h"
-#include "main.h" // for g_settings
#include "settings.h"
#include "clouds.h"
#include "clientmap.h"
#include "map.h"
#include "nodedef.h"
#include "profiler.h"
-#include "settings.h" // For g_settings
-#include "main.h" // For g_profiler
+#include "settings.h"
//#define DGEN_USE_TORCHES
#include "environment.h"
#include "util/container.h"
#include "util/thread.h"
-#include "main.h"
#include "constants.h"
#include "voxel.h"
#include "config.h"
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <fstream>
#include "environment.h"
#include "filesys.h"
#include "porting.h"
#include "scripting_game.h"
#include "nodedef.h"
#include "nodemetadata.h"
-#include "main.h" // For g_settings, g_profiler
#include "gamedef.h"
#ifndef SERVER
#include "clientmap.h"
*/
#include "fontengine.h"
#include "log.h"
-#include "main.h"
#include "config.h"
#include "porting.h"
#include "constants.h"
#include "gettime.h"
#include "keycode.h"
#include "settings.h"
-#include "main.h" // for g_settings
#include "porting.h"
#include "client/tile.h"
#include "fontengine.h"
#include "guiEngine.h"
+#include <fstream>
#include <IGUIStaticText.h>
#include <ICameraSceneNode.h>
#include "scripting_mainmenu.h"
#include "version.h"
#include "porting.h"
#include "filesys.h"
-#include "main.h"
#include "settings.h"
#include "guiMainMenu.h"
#include "sound.h"
#include "gettext.h"
#include "scripting_game.h"
#include "porting.h"
-#include "main.h"
#include "settings.h"
#include "client.h"
#include "fontengine.h"
#include "guiKeyChangeMenu.h"
#include "debug.h"
#include "serialization.h"
-#include "main.h"
#include <string>
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>
#include "util/string.h"
#include "util/numeric.h"
#include "util/string.h" // for parseColorString()
-#include "main.h"
#include "settings.h" // for settings
#include "porting.h" // for dpi
#include "guiscalingfilter.h"
#include <IGUIScrollBar.h>
#include <IGUIStaticText.h>
#include <IGUIFont.h>
-#include "main.h"
#include "settings.h"
#include "gettext.h"
#include "guiscalingfilter.h"
#include "imagefilters.h"
#include "settings.h"
-#include "main.h" // for g_settings
#include "util/numeric.h"
#include <stdio.h>
#include "util/container.h"
#include "util/thread.h"
#include "version.h"
-#include "main.h"
#include "settings.h"
JMutex g_httpfetch_mutex;
*/
#include "hud.h"
-#include "main.h"
#include "settings.h"
#include "util/numeric.h"
#include "log.h"
#include "environment.h"
#include "scripting_game.h"
#include "serverobject.h"
-#include "main.h" // for g_settings
#include "settings.h"
#include "craftdef.h"
#include "rollback_interface.h"
#include "client/tile.h"
#endif
#include "log.h"
-#include "main.h" // g_settings
#include "settings.h"
#include "util/serialize.h"
#include "util/container.h"
*/
#include "keycode.h"
-#include "main.h" // For g_settings
#include "exceptions.h"
#include "settings.h"
#include "log.h"
#include "localplayer.h"
-#include "main.h" // For g_settings
#include "event.h"
#include "collision.h"
#include "gamedef.h"
#include "porting.h"
#include "config.h"
+// Connection
+std::ostream *dout_con_ptr = &dummyout;
+std::ostream *derr_con_ptr = &verbosestream;
+
+// Server
+std::ostream *dout_server_ptr = &infostream;
+std::ostream *derr_server_ptr = &errorstream;
+
+#ifndef SERVER
+// Client
+std::ostream *dout_client_ptr = &infostream;
+std::ostream *derr_client_ptr = &errorstream;
+#endif
+
#ifdef __ANDROID__
unsigned int android_log_level_mapping[] = {
/* LMT_ERROR */ ANDROID_LOG_ERROR,
#define TRACESTREAM(x){ if(log_trace_level_enabled) verbosestream x; }
#define TRACEDO(x){ if(log_trace_level_enabled){ x ;} }
+extern std::ostream *dout_con_ptr;
+extern std::ostream *derr_con_ptr;
+extern std::ostream *dout_server_ptr;
+extern std::ostream *derr_server_ptr;
+#define dout_con (*dout_con_ptr)
+#define derr_con (*derr_con_ptr)
+#define dout_server (*dout_server_ptr)
+#define derr_server (*derr_server_ptr)
+
+#ifndef SERVER
+extern std::ostream *dout_client_ptr;
+extern std::ostream *derr_client_ptr;
+#define dout_client (*dout_client_ptr)
+#define derr_client (*derr_client_ptr)
+
+#endif
+
#endif
#include "irrlicht.h" // createDevice
-#include "main.h"
#include "mainmenumanager.h"
#include "irrlichttypes_extrabloated.h"
#include "debug.h"
#include "touchscreengui.h"
#endif
-/*
- Settings.
- These are loaded from the config file.
-*/
-static Settings main_settings;
-Settings *g_settings = &main_settings;
-std::string g_settings_path;
-
-// Global profiler
-Profiler main_profiler;
-Profiler *g_profiler = &main_profiler;
-
-// Menu clouds are created later
-Clouds *g_menuclouds = 0;
-irr::scene::ISceneManager *g_menucloudsmgr = 0;
-
-/*
- Debug streams
-*/
-
-// Connection
-std::ostream *dout_con_ptr = &dummyout;
-std::ostream *derr_con_ptr = &verbosestream;
-
-// Server
-std::ostream *dout_server_ptr = &infostream;
-std::ostream *derr_server_ptr = &errorstream;
-
-// Client
-std::ostream *dout_client_ptr = &infostream;
-std::ostream *derr_client_ptr = &errorstream;
-
#define DEBUGFILE "debug.txt"
#define DEFAULT_SERVER_PORT 30000
/**********************************************************************/
-#ifndef SERVER
-/*
- Random stuff
-*/
-
-/* mainmenumanager.h */
-
-gui::IGUIEnvironment* guienv = NULL;
-gui::IGUIStaticText *guiroot = NULL;
-MainMenuManager g_menumgr;
-
-bool noMenuActive()
-{
- return (g_menumgr.menuCount() == 0);
-}
-
-// Passed to menus to allow disconnecting and exiting
-MainGameCallback *g_gamecallback = NULL;
-#endif
-
/*
gettime.h implementation
*/
+++ /dev/null
-/*
-Minetest
-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.
-*/
-
-#ifndef MAIN_HEADER
-#define MAIN_HEADER
-
-#include <string>
-
-// Settings
-class Settings;
-extern Settings *g_settings;
-extern std::string g_settings_path;
-
-// Global profiler
-class Profiler;
-extern Profiler *g_profiler;
-
-// Menu clouds
-class Clouds;
-extern Clouds *g_menuclouds;
-
-// Scene manager used for menu clouds
-namespace irr{namespace scene{class ISceneManager;}}
-extern irr::scene::ISceneManager *g_menucloudsmgr;
-
-// Debug streams
-
-#include <fstream>
-
-extern std::ostream *dout_con_ptr;
-extern std::ostream *derr_con_ptr;
-extern std::ostream *dout_client_ptr;
-extern std::ostream *derr_client_ptr;
-extern std::ostream *dout_server_ptr;
-extern std::ostream *derr_server_ptr;
-
-#define dout_con (*dout_con_ptr)
-#define derr_con (*derr_con_ptr)
-#define dout_client (*dout_client_ptr)
-#define derr_client (*derr_client_ptr)
-#define dout_server (*dout_server_ptr)
-#define derr_server (*derr_server_ptr)
-
-#endif
-
virtual void signalKeyConfigChange() = 0;
};
-extern gui::IGUIEnvironment* guienv;
+extern gui::IGUIEnvironment *guienv;
extern gui::IGUIStaticText *guiroot;
// Handler for the modal menus
#include "map.h"
#include "mapsector.h"
#include "mapblock.h"
-#include "main.h"
#include "filesys.h"
#include "voxel.h"
#include "porting.h"
#include "light.h"
#include "mapblock.h"
#include "map.h"
-#include "main.h" // for g_profiler
#include "profiler.h"
#include "nodedef.h"
#include "gamedef.h"
#include "content_mapnode.h" // For content_mapnode_get_new_name
#include "voxelalgorithms.h"
#include "profiler.h"
-#include "settings.h" // For g_settings
-#include "main.h" // For g_profiler
+#include "settings.h"
#include "treegen.h"
#include "serialization.h"
#include "util/serialize.h"
#include "voxelalgorithms.h"
#include "profiler.h"
#include "settings.h" // For g_settings
-#include "main.h" // For g_profiler
#include "emerge.h"
#include "dungeongen.h"
#include "cavegen.h"
#include "voxelalgorithms.h"
#include "profiler.h"
#include "settings.h" // For g_settings
-#include "main.h" // For g_profiler
#include "emerge.h"
#include "dungeongen.h"
#include "cavegen.h"
#include "voxelalgorithms.h"
#include "profiler.h"
#include "settings.h" // For g_settings
-#include "main.h" // For g_profiler
#include "emerge.h"
#include "dungeongen.h"
#include "cavegen.h"
#include "irrlichttypes_extrabloated.h"
#include "mapnode.h"
#include "porting.h"
-#include "main.h" // For g_settings
#include "nodedef.h"
#include "content_mapnode.h" // For mapnode_translate_*_internal
#include "serialization.h" // For ser_ver_supported
#include "map.h" //for MMVManip
#include "log.h"
#include "util/numeric.h"
-#include "main.h"
#include "util/mathconstants.h"
#include "porting.h"
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <cctype>
+#include <fstream>
#include "mods.h"
-#include "main.h"
#include "filesys.h"
#include "strfnd.h"
#include "log.h"
#include "subgame.h"
#include "settings.h"
#include "strfnd.h"
-#include <cctype>
#include "convert_json.h"
static bool parseDependsLine(std::istream &is,
#include <iomanip>
#include <errno.h>
#include "connection.h"
-#include "main.h"
#include "serialization.h"
#include "log.h"
#include "porting.h"
#include "content_abm.h"
#include "content_sao.h"
#include "emerge.h"
-#include "main.h"
#include "nodedef.h"
#include "player.h"
#include "rollback_interface.h"
#include "nodedef.h"
-#include "main.h" // For g_settings
#include "itemdef.h"
#ifndef SERVER
#include "client/tile.h"
#include "particles.h"
#include "constants.h"
#include "debug.h"
-#include "main.h" // For g_profiler and g_settings
#include "settings.h"
#include "client/tile.h"
#include "gamedef.h"
#include "filesys.h"
#include "log.h"
#include "util/string.h"
-#include "main.h"
#include "settings.h"
#include <list>
--- /dev/null
+/*
+Minetest
+Copyright (C) 2015 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.
+*/
+
+#include "profiler.h"
+
+static Profiler main_profiler;
+Profiler *g_profiler = &main_profiler;
#include "jthread/jmutex.h"
#include "jthread/jmutexautolock.h"
#include "util/timetaker.h"
-#include "util/numeric.h" // paging()
-#include "debug.h" // assert()
+#include "util/numeric.h" // paging()
+#include "debug.h" // assert()
#define MAX_PROFILER_TEXT_ROWS 20
+// Global profiler
+class Profiler;
+extern Profiler *g_profiler;
+
/*
Time profiler
*/
#include "common/c_internal.h"
#include "debug.h"
#include "log.h"
-#include "main.h"
#include "settings.h"
std::string script_get_backtrace(lua_State *L)
#if (defined(WIN32) || defined(_WIN32_WCE))
#define NO_MAP_LOCK_REQUIRED
#else
-#include "main.h"
#include "profiler.h"
#define NO_MAP_LOCK_REQUIRED \
ScopeProfiler nolocktime(g_profiler,"Scriptapi: unlockable time",SPT_ADD)
#include "emerge.h"
#include "sound.h"
#include "settings.h"
-#include "main.h" // for g_settings
#include "log.h"
#include "EDriverTypes.h"
#include "mapgen_v5.h"
#include "mapgen_v7.h"
#include "settings.h"
-#include "main.h"
#include "log.h"
#include "tool.h"
#include "filesys.h"
#include "settings.h"
-#include "main.h" //required for g_settings, g_settings_path
// debug(...)
// Writes a line to dstream
#include "environment.h"
#include "map.h"
#include "jthread/jmutexautolock.h"
-#include "main.h"
#include "constants.h"
#include "voxel.h"
#include "config.h"
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <fstream>
#include <iostream>
#include <sstream>
#include <algorithm>
#include "version.h"
-#include "main.h" // for g_settings
#include "settings.h"
#include "serverlist.h"
#include "filesys.h"
#include <cctype>
#include <algorithm>
+static Settings main_settings;
+Settings *g_settings = &main_settings;
+std::string g_settings_path;
Settings::~Settings()
{
class Settings;
struct NoiseParams;
+// Global objects
+extern Settings *g_settings;
+extern std::string g_settings_path;
+
/** function type to register a changed callback */
typedef void (*setting_changed_callback)(const std::string, void*);
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <fstream>
+#include <iterator>
#include "shader.h"
#include "irrlichttypes_extrabloated.h"
#include "debug.h"
-#include "main.h" // for g_settings
#include "filesys.h"
#include "util/container.h"
#include "util/thread.h"
#include "settings.h"
-#include <iterator>
#include <ICameraSceneNode.h>
#include <IGPUProgrammingServices.h>
#include <IMaterialRenderer.h>
#include "ICameraSceneNode.h"
#include "S3DVertex.h"
#include "client/tile.h"
-#include "noise.h" // easeCurve
-#include "main.h" // g_profiler
+#include "noise.h" // easeCurve
#include "profiler.h"
-#include "util/numeric.h" // MYMIN
+#include "util/numeric.h"
#include <cmath>
#include "settings.h"
-#include "camera.h" // CameraModes
+#include "camera.h" // CameraModes
//! constructor
Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
#include "debug.h"
#include "settings.h"
#include "log.h"
-#include "main.h" // for g_settings
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#include "porting.h"
#include "filesys.h"
#include "settings.h"
-#include "main.h"
#include "log.h"
#include "strfnd.h"
#include "defaultsettings.h" // for override_default_settings
#include "mapgen.h" // for MapgenParams
-#include "main.h" // for g_settings
+#include "util/string.h"
+
#ifndef SERVER
-#include "client/tile.h" // getImagePath
+ #include "client/tile.h" // getImagePath
#endif
-#include "util/string.h"
bool getGameMinetestConfig(const std::string &game_path, Settings &conf)
{
#include "debug.h"
#include "map.h"
#include "player.h"
-#include "main.h"
#include "socket.h"
#include "network/connection.h"
#include "serialization.h"
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "main.h"
#include "settings.h"
#include "wieldmesh.h"
#include "inventory.h"