Move globals from main.cpp to more sane locations

Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
This commit is contained in:
Craig Robbins 2015-04-01 23:01:28 +10:00
parent 113bdd3ec0
commit 9527984dbc
72 changed files with 120 additions and 194 deletions

View File

@ -183,6 +183,7 @@ LOCAL_SRC_FILES := \
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 \

View File

@ -329,6 +329,7 @@ set(common_SRCS
pathfinder.cpp
player.cpp
porting.cpp
profiler.cpp
quicktune.cpp
rollback.cpp
rollback_interface.cpp

View File

@ -20,14 +20,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -28,7 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/string.h"
#include "client.h"
#include "network/clientopcodes.h"
#include "main.h"
#include "filesys.h"
#include "porting.h"
#include "mapblock_mesh.h"

View File

@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "main.h"
#include "mainmenumanager.h"
#include "debug.h"
#include "clouds.h"
@ -35,9 +34,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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()
{

View File

@ -26,7 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -30,7 +30,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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[] = {

View File

@ -24,12 +24,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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>

View File

@ -26,7 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "porting.h"
#include "settings.h"
#include "main.h"
#include "network/networkprotocol.h"
#include "util/hex.h"
#include "util/serialize.h"

View File

@ -21,10 +21,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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,

View File

@ -24,6 +24,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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:

View File

@ -28,7 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <vector>
#include <set>
#include "util/timetaker.h"
#include "main.h" // g_profiler
#include "profiler.h"
// float error is 10 - 9.96875 = 0.03125

View File

@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -42,7 +42,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodedef.h"
#include "localplayer.h"
#include "map.h"
#include "main.h" // g_settings
#include "camera.h" // CameraModes
#include "wieldmesh.h"
#include "log.h"

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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

View File

@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mods.h"
#include "config.h"
#include "log.h"
#include "main.h" // for g_settings
#include "settings.h"
#include "httpfetch.h"
#include "porting.h"

View File

@ -30,7 +30,6 @@ SQLite format specification:
#include "log.h"
#include "filesys.h"
#include "exceptions.h"
#include "main.h"
#include "settings.h"
#include "util/string.h"

View File

@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "drawscene.h"
#include "main.h" // for g_settings
#include "settings.h"
#include "clouds.h"
#include "clientmap.h"

View File

@ -26,8 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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

View File

@ -28,7 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "environment.h"
#include "util/container.h"
#include "util/thread.h"
#include "main.h"
#include "constants.h"
#include "voxel.h"
#include "config.h"

View File

@ -17,6 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <fstream>
#include "environment.h"
#include "filesys.h"
#include "porting.h"
@ -31,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "fontengine.h"
#include "log.h"
#include "main.h"
#include "config.h"
#include "porting.h"
#include "constants.h"

View File

@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiEngine.h"
#include <fstream>
#include <IGUIStaticText.h>
#include <ICameraSceneNode.h>
#include "scripting_mainmenu.h"
@ -27,7 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "version.h"
#include "porting.h"
#include "filesys.h"
#include "main.h"
#include "settings.h"
#include "guiMainMenu.h"
#include "sound.h"

View File

@ -44,7 +44,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "gettext.h"
#include "scripting_game.h"
#include "porting.h"
#include "main.h"
#include "settings.h"
#include "client.h"
#include "fontengine.h"

View File

@ -22,7 +22,6 @@
#include "guiKeyChangeMenu.h"
#include "debug.h"
#include "serialization.h"
#include "main.h"
#include <string>
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>

View File

@ -33,7 +33,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -26,7 +26,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <IGUIScrollBar.h>
#include <IGUIStaticText.h>
#include <IGUIFont.h>
#include "main.h"
#include "settings.h"
#include "gettext.h"

View File

@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiscalingfilter.h"
#include "imagefilters.h"
#include "settings.h"
#include "main.h" // for g_settings
#include "util/numeric.h"
#include <stdio.h>

View File

@ -33,7 +33,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/container.h"
#include "util/thread.h"
#include "version.h"
#include "main.h"
#include "settings.h"
JMutex g_httpfetch_mutex;

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "hud.h"
#include "main.h"
#include "settings.h"
#include "util/numeric.h"
#include "log.h"

View File

@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -31,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client/tile.h"
#endif
#include "log.h"
#include "main.h" // g_settings
#include "settings.h"
#include "util/serialize.h"
#include "util/container.h"

View File

@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "keycode.h"
#include "main.h" // For g_settings
#include "exceptions.h"
#include "settings.h"
#include "log.h"

View File

@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "localplayer.h"
#include "main.h" // For g_settings
#include "event.h"
#include "collision.h"
#include "gamedef.h"

View File

@ -30,6 +30,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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,

View File

@ -81,5 +81,22 @@ extern bool log_trace_level_enabled;
#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

View File

@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlicht.h" // createDevice
#include "main.h"
#include "mainmenumanager.h"
#include "irrlichttypes_extrabloated.h"
#include "debug.h"
@ -59,38 +58,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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
@ -137,26 +104,6 @@ static bool migrate_database(const GameParams &game_params, const Settings &cmd_
/**********************************************************************/
#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
*/

View File

@ -1,61 +0,0 @@
/*
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

View File

@ -39,7 +39,7 @@ public:
virtual void signalKeyConfigChange() = 0;
};
extern gui::IGUIEnvironment* guienv;
extern gui::IGUIEnvironment *guienv;
extern gui::IGUIStaticText *guiroot;
// Handler for the modal menus

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "map.h"
#include "mapsector.h"
#include "mapblock.h"
#include "main.h"
#include "filesys.h"
#include "voxel.h"
#include "porting.h"

View File

@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "light.h"
#include "mapblock.h"
#include "map.h"
#include "main.h" // for g_profiler
#include "profiler.h"
#include "nodedef.h"
#include "gamedef.h"

View File

@ -31,8 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -30,7 +30,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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

View File

@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "map.h" //for MMVManip
#include "log.h"
#include "util/numeric.h"
#include "main.h"
#include "util/mathconstants.h"
#include "porting.h"

View File

@ -17,15 +17,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
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,

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <iomanip>
#include <errno.h>
#include "connection.h"
#include "main.h"
#include "serialization.h"
#include "log.h"
#include "porting.h"

View File

@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "content_abm.h"
#include "content_sao.h"
#include "emerge.h"
#include "main.h"
#include "nodedef.h"
#include "player.h"
#include "rollback_interface.h"

View File

@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodedef.h"
#include "main.h" // For g_settings
#include "itemdef.h"
#ifndef SERVER
#include "client/tile.h"

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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"

View File

@ -51,7 +51,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "filesys.h"
#include "log.h"
#include "util/string.h"
#include "main.h"
#include "settings.h"
#include <list>

23
src/profiler.cpp Normal file
View File

@ -0,0 +1,23 @@
/*
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;

View File

@ -27,11 +27,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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
*/

View File

@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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)

View File

@ -36,7 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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)

View File

@ -34,7 +34,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "emerge.h"
#include "sound.h"
#include "settings.h"
#include "main.h" // for g_settings
#include "log.h"
#include "EDriverTypes.h"

View File

@ -33,7 +33,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mapgen_v5.h"
#include "mapgen_v7.h"
#include "settings.h"
#include "main.h"
#include "log.h"

View File

@ -30,7 +30,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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

View File

@ -27,7 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "environment.h"
#include "map.h"
#include "jthread/jmutexautolock.h"
#include "main.h"
#include "constants.h"
#include "voxel.h"
#include "config.h"

View File

@ -17,12 +17,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
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"

View File

@ -33,6 +33,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <cctype>
#include <algorithm>
static Settings main_settings;
Settings *g_settings = &main_settings;
std::string g_settings_path;
Settings::~Settings()
{

View File

@ -31,6 +31,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
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*);

View File

@ -18,15 +18,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
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>

View File

@ -4,13 +4,12 @@
#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,

View File

@ -32,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "debug.h"
#include "settings.h"
#include "log.h"
#include "main.h" // for g_settings
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN

View File

@ -21,17 +21,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#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
#ifndef SERVER
#include "client/tile.h" // getImagePath
#endif
#include "util/string.h"
#ifndef SERVER
#include "client/tile.h" // getImagePath
#endif
bool getGameMinetestConfig(const std::string &game_path, Settings &conf)
{
std::string conf_path = game_path + DIR_DELIM + "minetest.conf";

View File

@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "debug.h"
#include "map.h"
#include "player.h"
#include "main.h"
#include "socket.h"
#include "network/connection.h"
#include "serialization.h"

View File

@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "main.h"
#include "settings.h"
#include "wieldmesh.h"
#include "inventory.h"