From c8bc76dcbed7d53ff80735376bbe3b6a8c2e5c01 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 17 Feb 2020 17:00:58 +1100 Subject: [PATCH] Don't include Options.h in Game.h --- misc/buildbot.sh | 8 ++++---- src/Audio.c | 1 + src/Builder.c | 1 + src/Camera.c | 1 + src/Chat.c | 1 + src/Drawer2D.c | 1 + src/Entity.c | 1 + src/EnvRenderer.c | 1 + src/Game.h | 2 +- src/Gui.c | 1 + src/HeldBlockRenderer.c | 1 + src/LScreens.c | 1 + src/Launcher.c | 1 + src/MapRenderer.c | 1 + src/Menus.c | 1 + src/Model.c | 1 + src/Options.h | 10 +++++----- src/Program.c | 1 + 18 files changed, 25 insertions(+), 10 deletions(-) diff --git a/misc/buildbot.sh b/misc/buildbot.sh index b7f55f88a..eef663bcf 100644 --- a/misc/buildbot.sh +++ b/misc/buildbot.sh @@ -27,16 +27,16 @@ WEB_CC=~/emscripten/emsdk/emscripten/tag-1.38.30/emcc MAC32_CC=/usr/bin/clang/osx32 MAC64_CC=/usr/bin/clang/osx64 WIN32_CC=i686-w64-mingw32-gcc -WIN64_CC=x86_64-w64-mingw32-gccnostartfiles -Wl,-emain_real -DCC_NOMAIN" -LINUX_FLAGS="-fvisibility=hidden +WIN64_CC=x86_64-w64-mingw32-gcc # to simplify stuff ALL_FLAGS="-O1 -s -fno-stack-protector -fno-math-errno -w" WIN32_FLAGS="-mwindows -nostartfiles -Wl,-e_main_real -DCC_NOMAIN" -WIN64_FLAGS="-mwindows - -rdynamic -DCC_BUILD_X11ICON" +WIN64_FLAGS="-mwindows -nostartfiles -Wl,-emain_real -DCC_NOMAIN" +LINUX_FLAGS="-fvisibility=hidden -rdynamic -DCC_BUILD_X11ICON" # I cloned https://github.com/raspberrypi/tools to get prebuilt cross compilers -# Then I copied across various files/folders from /usr/include and /usr/lib as needed +# Then I copied across various files/folders from /usr/include and /usr/lib from a real Raspberry pi as needed RPI_CC=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.8.3 # ----------------------------- diff --git a/src/Audio.c b/src/Audio.c index 6c0a1d0a1..0e066def6 100644 --- a/src/Audio.c +++ b/src/Audio.c @@ -12,6 +12,7 @@ #include "Chat.h" #include "Stream.h" #include "Utils.h" +#include "Options.h" int Audio_SoundsVolume, Audio_MusicVolume; diff --git a/src/Builder.c b/src/Builder.c index bd153ef93..db566665a 100644 --- a/src/Builder.c +++ b/src/Builder.c @@ -14,6 +14,7 @@ #include "TexturePack.h" #include "VertexStructs.h" #include "Game.h" +#include "Options.h" int Builder_SidesLevel, Builder_EdgeLevel; /* Packs an index into the 16x16x16 count array. Coordinates range from 0 to 15. */ diff --git a/src/Camera.c b/src/Camera.c index 60846f842..c3488a57d 100644 --- a/src/Camera.c +++ b/src/Camera.c @@ -8,6 +8,7 @@ #include "Entity.h" #include "Input.h" #include "Event.h" +#include "Options.h" struct _CameraData Camera; static struct PickedPos cameraClipPos; diff --git a/src/Chat.c b/src/Chat.c index 7924f56ca..5a537cc0b 100644 --- a/src/Chat.c +++ b/src/Chat.c @@ -16,6 +16,7 @@ #include "GameStructs.h" #include "Utils.h" #include "TexturePack.h" +#include "Options.h" static char msgs[10][STRING_SIZE]; String Chat_Status[4] = { String_FromArray(msgs[0]), String_FromArray(msgs[1]), String_FromArray(msgs[2]), String_FromArray(msgs[3]) }; diff --git a/src/Drawer2D.c b/src/Drawer2D.c index cb66b331a..86d287580 100644 --- a/src/Drawer2D.c +++ b/src/Drawer2D.c @@ -11,6 +11,7 @@ #include "Utils.h" #include "Errors.h" #include "Window.h" +#include "Options.h" cc_bool Drawer2D_BitmappedText; cc_bool Drawer2D_BlackTextShadows; diff --git a/src/Entity.c b/src/Entity.c index a70a6c198..e12cf4876 100644 --- a/src/Entity.c +++ b/src/Entity.c @@ -19,6 +19,7 @@ #include "Stream.h" #include "Bitmap.h" #include "Logger.h" +#include "Options.h" const char* const NameMode_Names[NAME_MODE_COUNT] = { "None", "Hovered", "All", "AllHovered", "AllUnscaled" }; const char* const ShadowMode_Names[SHADOW_MODE_COUNT] = { "None", "SnapToBlock", "Circle", "CircleAll" }; diff --git a/src/EnvRenderer.c b/src/EnvRenderer.c index ac740ccc8..c1162315d 100644 --- a/src/EnvRenderer.c +++ b/src/EnvRenderer.c @@ -17,6 +17,7 @@ #include "Platform.h" #include "Camera.h" #include "Particle.h" +#include "Options.h" cc_bool EnvRenderer_Legacy, EnvRenderer_Minimal; diff --git a/src/Game.h b/src/Game.h index deb375cdb..a7cf46ab2 100644 --- a/src/Game.h +++ b/src/Game.h @@ -1,7 +1,7 @@ #ifndef CC_GAME_H #define CC_GAME_H #include "Picking.h" -#include "Options.h" +#include "String.h" #include "Bitmap.h" /* Represents the game. Copyright 2014-2019 ClassiCube | Licensed under BSD-3 diff --git a/src/Gui.c b/src/Gui.c index d87375de0..e71537acf 100644 --- a/src/Gui.c +++ b/src/Gui.c @@ -11,6 +11,7 @@ #include "Logger.h" #include "Platform.h" #include "Bitmap.h" +#include "Options.h" cc_bool Gui_ClassicTexture, Gui_ClassicTabList, Gui_ClassicMenu; int Gui_Chatlines; diff --git a/src/HeldBlockRenderer.c b/src/HeldBlockRenderer.c index 0b098e688..24331a49b 100644 --- a/src/HeldBlockRenderer.c +++ b/src/HeldBlockRenderer.c @@ -9,6 +9,7 @@ #include "Entity.h" #include "Model.h" #include "GameStructs.h" +#include "Options.h" cc_bool HeldBlockRenderer_Show; static BlockID held_block; diff --git a/src/LScreens.c b/src/LScreens.c index e83089d74..45bd67122 100644 --- a/src/LScreens.c +++ b/src/LScreens.c @@ -13,6 +13,7 @@ #include "Logger.h" #include "Window.h" #include "Input.h" +#include "Options.h" #ifndef CC_BUILD_WEB /*########################################################################################################################* diff --git a/src/Launcher.c b/src/Launcher.c index 45fb1f799..46c7ddb83 100644 --- a/src/Launcher.c +++ b/src/Launcher.c @@ -15,6 +15,7 @@ #include "ExtMath.h" #include "Funcs.h" #include "Logger.h" +#include "Options.h" #ifndef CC_BUILD_WEB struct LScreen* Launcher_Screen; diff --git a/src/MapRenderer.c b/src/MapRenderer.c index 6dec149d3..1d45c951c 100644 --- a/src/MapRenderer.c +++ b/src/MapRenderer.c @@ -13,6 +13,7 @@ #include "TexturePack.h" #include "Utils.h" #include "World.h" +#include "Options.h" int MapRenderer_ChunksX, MapRenderer_ChunksY, MapRenderer_ChunksZ; int MapRenderer_1DUsedCount, MapRenderer_ChunksCount; diff --git a/src/Menus.c b/src/Menus.c index 89c7e712e..f8042c54d 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -28,6 +28,7 @@ #include "Stream.h" #include "Builder.h" #include "Logger.h" +#include "Options.h" /* Describes a menu option button */ struct MenuOptionDesc { diff --git a/src/Model.c b/src/Model.c index 48b918f0b..581dae977 100644 --- a/src/Model.c +++ b/src/Model.c @@ -12,6 +12,7 @@ #include "Block.h" #include "Stream.h" #include "Funcs.h" +#include "Options.h" struct _ModelsData Models; diff --git a/src/Options.h b/src/Options.h index f8ced55e0..255149900 100644 --- a/src/Options.h +++ b/src/Options.h @@ -77,16 +77,16 @@ void Options_Free(void); /* Returns whether the option was actually found. */ STRING_REF cc_bool Options_UNSAFE_Get(const char* keyRaw, String* value); /* Returns value of given option, or defalt value if not found. */ -CC_API void Options_Get(const char* key, String* value, const char* defValue); +CC_API void Options_Get(const char* key, String* value, const char* defValue); /* Returns value of given option as an integer, or defalt value if could not be converted. */ -CC_API int Options_GetInt(const char* key, int min, int max, int defValue); +CC_API int Options_GetInt(const char* key, int min, int max, int defValue); /* Returns value of given option as a bool, or defalt value if could not be converted. */ -CC_API cc_bool Options_GetBool(const char* key, cc_bool defValue); +CC_API cc_bool Options_GetBool(const char* key, cc_bool defValue); /* Returns value of given option as a float, or defalt value if could not be converted. */ -CC_API float Options_GetFloat(const char* key, float min, float max, float defValue); +CC_API float Options_GetFloat(const char* key, float min, float max, float defValue); /* Returns value of given option as an integer, or defalt value if could not be converted. */ /* NOTE: Conversion is done by going through all elements of names, returning index of a match. */ -CC_API int Options_GetEnum(const char* key, int defValue, const char* const* names, int namesCount); +CC_API int Options_GetEnum(const char* key, int defValue, const char* const* names, int namesCount); /* Sets value of given option to either "true" or "false". */ CC_API void Options_SetBool(const char* keyRaw, cc_bool value); diff --git a/src/Program.c b/src/Program.c index 260e342e0..1554d92da 100644 --- a/src/Program.c +++ b/src/Program.c @@ -7,6 +7,7 @@ #include "Utils.h" #include "Launcher.h" #include "Server.h" +#include "Options.h" /*#define CC_TEST_VORBIS*/ #ifdef CC_TEST_VORBIS