From 30c47a8511273a4d6532fa9c48adf6d228856a64 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 21 Sep 2019 20:59:54 +0200 Subject: [PATCH] - include namespace file in all sources as the very first include. --- platform/Windows/eduke32.vcxproj | 2 - platform/Windows/eduke32.vcxproj.filters | 9 - platform/Windows/rednukem.vcxproj | 1 - platform/Windows/rednukem.vcxproj.filters | 3 - source/blood/src/actor.cpp | 5 +- source/blood/src/ai.cpp | 3 + source/blood/src/aibat.cpp | 3 + source/blood/src/aibeast.cpp | 3 + source/blood/src/aiboneel.cpp | 3 + source/blood/src/aiburn.cpp | 3 + source/blood/src/aicaleb.cpp | 3 + source/blood/src/aicerber.cpp | 3 + source/blood/src/aicult.cpp | 3 + source/blood/src/aigarg.cpp | 3 + source/blood/src/aighost.cpp | 3 + source/blood/src/aigilbst.cpp | 3 + source/blood/src/aihand.cpp | 3 + source/blood/src/aihound.cpp | 3 + source/blood/src/aiinnoc.cpp | 3 + source/blood/src/aipod.cpp | 3 + source/blood/src/airat.cpp | 3 + source/blood/src/aispid.cpp | 3 + source/blood/src/aitchern.cpp | 3 + source/blood/src/aiunicult.cpp | 3 + source/blood/src/aizomba.cpp | 3 + source/blood/src/aizombf.cpp | 3 + source/blood/src/asound.cpp | 3 + source/blood/src/barf.cpp | 2 + source/blood/src/blood.cpp | 3 + source/blood/src/callback.cpp | 2 + source/blood/src/choke.cpp | 3 + source/blood/src/common.cpp | 2 + source/blood/src/config.cpp | 3 + source/blood/src/controls.cpp | 3 + source/blood/src/credits.cpp | 3 + source/blood/src/db.cpp | 6 +- source/blood/src/demo.cpp | 3 + source/blood/src/dude.cpp | 3 + source/blood/src/endgame.cpp | 3 + source/blood/src/eventq.cpp | 3 + source/blood/src/fire.cpp | 3 + source/blood/src/fx.cpp | 2 + source/blood/src/gamemenu.cpp | 3 + source/blood/src/gameutil.cpp | 3 + source/blood/src/getopt.cpp | 3 + source/blood/src/gib.cpp | 3 + source/blood/src/globals.cpp | 3 + source/blood/src/inifile.cpp | 2 + source/blood/src/iob.cpp | 2 + source/blood/src/levels.cpp | 2 + source/blood/src/loadsave.cpp | 2 + source/blood/src/map2d.cpp | 2 + source/blood/src/menu.cpp | 2 + source/blood/src/messages.cpp | 2 + source/blood/src/mirrors.cpp | 5 +- source/blood/src/misc.cpp | 2 + source/blood/src/network.cpp | 2 + source/blood/src/osdcmd.cpp | 1 + source/blood/src/player.cpp | 2 + source/blood/src/qav.cpp | 2 + source/blood/src/qheap.cpp | 2 + source/blood/src/replace.cpp | 2 + source/blood/src/resource.cpp | 2 + source/blood/src/screen.cpp | 2 + source/blood/src/sectorfx.cpp | 2 + source/blood/src/seq.cpp | 2 + source/blood/src/sfx.cpp | 2 + source/blood/src/sound.cpp | 2 + source/blood/src/startgtk.game.cpp | 1 + source/blood/src/startosx.game.mm | 2 + source/blood/src/startwin.game.cpp | 2 + source/blood/src/tile.cpp | 2 + source/blood/src/trig.cpp | 2 + source/blood/src/triggers.cpp | 3 +- source/blood/src/view.cpp | 2 + source/blood/src/warp.cpp | 2 + source/blood/src/weapon.cpp | 2 + source/blood/src/winbits.cpp | 2 + source/build/include/ns.h | 31 ++ source/duke3d/src/GameListSource.game.mm | 2 + source/duke3d/src/GrpFile.game.mm | 1 + source/duke3d/src/actors.cpp | 2 + source/duke3d/src/anim.cpp | 2 + source/duke3d/src/cheats.cpp | 2 + source/duke3d/src/cmdline.cpp | 2 + source/duke3d/src/common.cpp | 2 + source/duke3d/src/config.cpp | 2 + source/duke3d/src/demo.cpp | 2 + source/duke3d/src/game.cpp | 2 + source/duke3d/src/gamedef.cpp | 2 + source/duke3d/src/gameexec.cpp | 2 + source/duke3d/src/gamevars.cpp | 2 + source/duke3d/src/global.cpp | 2 + source/duke3d/src/grpscan.cpp | 2 + source/duke3d/src/in_android.cpp | 354 ---------------------- source/duke3d/src/input.cpp | 2 + source/duke3d/src/mdump.cpp | 1 + source/duke3d/src/menus.cpp | 2 + source/duke3d/src/namesdyn.cpp | 2 + source/duke3d/src/network.cpp | 2 + source/duke3d/src/osdcmds.cpp | 2 + source/duke3d/src/osdfuncs.cpp | 4 + source/duke3d/src/player.cpp | 2 + source/duke3d/src/premap.cpp | 2 + source/duke3d/src/rts.cpp | 2 + source/duke3d/src/savegame.cpp | 2 + source/duke3d/src/sbar.cpp | 2 + source/duke3d/src/screens.cpp | 2 + source/duke3d/src/screentext.cpp | 2 + source/duke3d/src/sector.cpp | 2 + source/duke3d/src/sounds.cpp | 2 + source/duke3d/src/soundsdyn.cpp | 2 + source/duke3d/src/startgtk.game.cpp | 2 + source/duke3d/src/startosx.game.mm | 2 + source/duke3d/src/startwin.game.cpp | 2 + source/duke3d/src/winbits.cpp | 2 + source/rr/src/GameListSource.game.mm | 2 + source/rr/src/GrpFile.game.mm | 2 + source/rr/src/actors.cpp | 2 + source/rr/src/anim.cpp | 2 + source/rr/src/cheats.cpp | 2 + source/rr/src/cmdline.cpp | 2 + source/rr/src/common.cpp | 1 + source/rr/src/config.cpp | 2 + source/rr/src/demo.cpp | 2 + source/rr/src/game.cpp | 2 + source/rr/src/gamedef.cpp | 2 + source/rr/src/gameexec.cpp | 2 + source/rr/src/global.cpp | 1 + source/rr/src/grpscan.cpp | 1 + source/rr/src/in_android.cpp | 354 ---------------------- source/rr/src/input.cpp | 1 + source/rr/src/mdump.cpp | 1 + source/rr/src/menus.cpp | 1 + source/rr/src/namesdyn.cpp | 1 + source/rr/src/net.cpp | 1 + source/rr/src/osdcmds.cpp | 1 + source/rr/src/osdfuncs.cpp | 2 + source/rr/src/player.cpp | 1 + source/rr/src/premap.cpp | 1 + source/rr/src/rts.cpp | 1 + source/rr/src/savegame.cpp | 1 + source/rr/src/sbar.cpp | 1 + source/rr/src/screens.cpp | 1 + source/rr/src/screentext.cpp | 1 + source/rr/src/sector.cpp | 1 + source/rr/src/sounds.cpp | 1 + source/rr/src/soundsdyn.cpp | 1 + source/rr/src/startgtk.game.cpp | 1 + source/rr/src/startosx.game.mm | 2 + source/rr/src/startwin.game.cpp | 1 + 151 files changed, 336 insertions(+), 731 deletions(-) create mode 100644 source/build/include/ns.h delete mode 100644 source/duke3d/src/in_android.cpp delete mode 100644 source/rr/src/in_android.cpp diff --git a/platform/Windows/eduke32.vcxproj b/platform/Windows/eduke32.vcxproj index 5c97e50a5..00203ecd2 100644 --- a/platform/Windows/eduke32.vcxproj +++ b/platform/Windows/eduke32.vcxproj @@ -169,8 +169,6 @@ - - diff --git a/platform/Windows/eduke32.vcxproj.filters b/platform/Windows/eduke32.vcxproj.filters index e969d0f0a..3fa224fe2 100644 --- a/platform/Windows/eduke32.vcxproj.filters +++ b/platform/Windows/eduke32.vcxproj.filters @@ -7,9 +7,6 @@ {82d4000f-cd8c-4737-88dc-4ada5775a68e} - - {52ce6149-4982-41a4-9adf-c7a9468421fd} - {598e3748-14c8-47c3-9bb6-eea06f762413} @@ -126,12 +123,6 @@ Header Files - - Header Files\android - - - Header Files - Header Files diff --git a/platform/Windows/rednukem.vcxproj b/platform/Windows/rednukem.vcxproj index 7408d4f3b..d489a64b7 100644 --- a/platform/Windows/rednukem.vcxproj +++ b/platform/Windows/rednukem.vcxproj @@ -232,7 +232,6 @@ true true - diff --git a/platform/Windows/rednukem.vcxproj.filters b/platform/Windows/rednukem.vcxproj.filters index bfdba08c9..71dad28d2 100644 --- a/platform/Windows/rednukem.vcxproj.filters +++ b/platform/Windows/rednukem.vcxproj.filters @@ -173,9 +173,6 @@ Source Files - - Source Files - Source Files diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 5a9a6c16b..9dffdc8bb 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -22,7 +22,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #include -#include +//#include + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/ai.cpp b/source/blood/src/ai.cpp index bea67805f..6b4322ef6 100644 --- a/source/blood/src/ai.cpp +++ b/source/blood/src/ai.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "pragmas.h" #include "mmulti.h" diff --git a/source/blood/src/aibat.cpp b/source/blood/src/aibat.cpp index f138c9cbd..0b5a73e4c 100644 --- a/source/blood/src/aibat.cpp +++ b/source/blood/src/aibat.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aibeast.cpp b/source/blood/src/aibeast.cpp index 01f6bc010..305364b34 100644 --- a/source/blood/src/aibeast.cpp +++ b/source/blood/src/aibeast.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aiboneel.cpp b/source/blood/src/aiboneel.cpp index 35e8921ef..868ea9b62 100644 --- a/source/blood/src/aiboneel.cpp +++ b/source/blood/src/aiboneel.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "pragmas.h" #include "mmulti.h" diff --git a/source/blood/src/aiburn.cpp b/source/blood/src/aiburn.cpp index 0b8477b30..6b6aacf29 100644 --- a/source/blood/src/aiburn.cpp +++ b/source/blood/src/aiburn.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aicaleb.cpp b/source/blood/src/aicaleb.cpp index 5ad414ded..05afb0b73 100644 --- a/source/blood/src/aicaleb.cpp +++ b/source/blood/src/aicaleb.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aicerber.cpp b/source/blood/src/aicerber.cpp index 8d509bf9b..e83f4f023 100644 --- a/source/blood/src/aicerber.cpp +++ b/source/blood/src/aicerber.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aicult.cpp b/source/blood/src/aicult.cpp index b64311e43..eca69f7f7 100644 --- a/source/blood/src/aicult.cpp +++ b/source/blood/src/aicult.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aigarg.cpp b/source/blood/src/aigarg.cpp index ddb7042dd..be0381044 100644 --- a/source/blood/src/aigarg.cpp +++ b/source/blood/src/aigarg.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aighost.cpp b/source/blood/src/aighost.cpp index 502d5768f..b34fefc0e 100644 --- a/source/blood/src/aighost.cpp +++ b/source/blood/src/aighost.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aigilbst.cpp b/source/blood/src/aigilbst.cpp index ea31fccad..089ae5f7b 100644 --- a/source/blood/src/aigilbst.cpp +++ b/source/blood/src/aigilbst.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aihand.cpp b/source/blood/src/aihand.cpp index f611f12c5..eb6c047ac 100644 --- a/source/blood/src/aihand.cpp +++ b/source/blood/src/aihand.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aihound.cpp b/source/blood/src/aihound.cpp index ab60ae2e8..ce6530307 100644 --- a/source/blood/src/aihound.cpp +++ b/source/blood/src/aihound.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aiinnoc.cpp b/source/blood/src/aiinnoc.cpp index 360551b97..ffda2d354 100644 --- a/source/blood/src/aiinnoc.cpp +++ b/source/blood/src/aiinnoc.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aipod.cpp b/source/blood/src/aipod.cpp index ac69d947d..3bc90094d 100644 --- a/source/blood/src/aipod.cpp +++ b/source/blood/src/aipod.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/airat.cpp b/source/blood/src/airat.cpp index ac3884044..439f56e96 100644 --- a/source/blood/src/airat.cpp +++ b/source/blood/src/airat.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aispid.cpp b/source/blood/src/aispid.cpp index 5b619b213..546a4582e 100644 --- a/source/blood/src/aispid.cpp +++ b/source/blood/src/aispid.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aitchern.cpp b/source/blood/src/aitchern.cpp index 715e40a0b..91b5f4fd3 100644 --- a/source/blood/src/aitchern.cpp +++ b/source/blood/src/aitchern.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aiunicult.cpp b/source/blood/src/aiunicult.cpp index 95a463170..0b13c025f 100644 --- a/source/blood/src/aiunicult.cpp +++ b/source/blood/src/aiunicult.cpp @@ -21,6 +21,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aizomba.cpp b/source/blood/src/aizomba.cpp index dab725a83..ab9fd0fd8 100644 --- a/source/blood/src/aizomba.cpp +++ b/source/blood/src/aizomba.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/aizombf.cpp b/source/blood/src/aizombf.cpp index d41b1604f..5801a28cb 100644 --- a/source/blood/src/aizombf.cpp +++ b/source/blood/src/aizombf.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/asound.cpp b/source/blood/src/asound.cpp index 61e059466..3db4c513a 100644 --- a/source/blood/src/asound.cpp +++ b/source/blood/src/asound.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "fx_man.h" #include "common_game.h" diff --git a/source/blood/src/barf.cpp b/source/blood/src/barf.cpp index d1797dbee..73fd848a4 100644 --- a/source/blood/src/barf.cpp +++ b/source/blood/src/barf.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #ifdef WITHKPLIB #include "kplib.h" diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 024c8c54b..a33b4f849 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "mmulti.h" #include "compat.h" diff --git a/source/blood/src/callback.cpp b/source/blood/src/callback.cpp index 47ff1c568..e93c5591f 100644 --- a/source/blood/src/callback.cpp +++ b/source/blood/src/callback.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "common_game.h" diff --git a/source/blood/src/choke.cpp b/source/blood/src/choke.cpp index d96550c4e..60c129bf1 100644 --- a/source/blood/src/choke.cpp +++ b/source/blood/src/choke.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" #include "common_game.h" diff --git a/source/blood/src/common.cpp b/source/blood/src/common.cpp index 9e20fe7ad..ec8d170ce 100644 --- a/source/blood/src/common.cpp +++ b/source/blood/src/common.cpp @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Common non-engine code/data for EDuke32 and Mapster32 // +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "baselayer.h" diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index a9dedeec0..f38a1194f 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + + #include "baselayer.h" #include "common_game.h" #include "build.h" diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index 3a7d9b4a8..b2de91de9 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "baselayer.h" #include "keyboard.h" diff --git a/source/blood/src/credits.cpp b/source/blood/src/credits.cpp index 9d318c974..481f20ab0 100644 --- a/source/blood/src/credits.cpp +++ b/source/blood/src/credits.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" #include "SmackerDecoder.h" diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index 93902da09..466095cbc 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -20,10 +20,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" -#ifdef POLYMER -#include "polymer.h" -#endif #include "compat.h" #include "common_game.h" #include "crc32.h" diff --git a/source/blood/src/demo.cpp b/source/blood/src/demo.cpp index e096b5d0d..a07a072c9 100644 --- a/source/blood/src/demo.cpp +++ b/source/blood/src/demo.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include #include #include "common.h" diff --git a/source/blood/src/dude.cpp b/source/blood/src/dude.cpp index 9c110c563..01c9a35c7 100644 --- a/source/blood/src/dude.cpp +++ b/source/blood/src/dude.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "common.h" #include "blood.h" diff --git a/source/blood/src/endgame.cpp b/source/blood/src/endgame.cpp index bca6db976..766716cfd 100644 --- a/source/blood/src/endgame.cpp +++ b/source/blood/src/endgame.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "common.h" #include "mmulti.h" diff --git a/source/blood/src/eventq.cpp b/source/blood/src/eventq.cpp index 1801d9397..a0ea9456b 100644 --- a/source/blood/src/eventq.cpp +++ b/source/blood/src/eventq.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/fire.cpp b/source/blood/src/fire.cpp index 3e07f1b8e..edabd7a2e 100644 --- a/source/blood/src/fire.cpp +++ b/source/blood/src/fire.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/fx.cpp b/source/blood/src/fx.cpp index 2ead31993..773eb4736 100644 --- a/source/blood/src/fx.cpp +++ b/source/blood/src/fx.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "common_game.h" diff --git a/source/blood/src/gamemenu.cpp b/source/blood/src/gamemenu.cpp index 0119220cc..5ff539a20 100644 --- a/source/blood/src/gamemenu.cpp +++ b/source/blood/src/gamemenu.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" #include "mouse.h" diff --git a/source/blood/src/gameutil.cpp b/source/blood/src/gameutil.cpp index 93752447e..ac8363b0d 100644 --- a/source/blood/src/gameutil.cpp +++ b/source/blood/src/gameutil.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/getopt.cpp b/source/blood/src/getopt.cpp index aed9da806..b472071d0 100644 --- a/source/blood/src/getopt.cpp +++ b/source/blood/src/getopt.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include #include #include "compat.h" diff --git a/source/blood/src/gib.cpp b/source/blood/src/gib.cpp index 58cfa0a4d..40a31cc40 100644 --- a/source/blood/src/gib.cpp +++ b/source/blood/src/gib.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/globals.cpp b/source/blood/src/globals.cpp index bb825302e..de03e7f1f 100644 --- a/source/blood/src/globals.cpp +++ b/source/blood/src/globals.cpp @@ -20,6 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + #include #include "compat.h" diff --git a/source/blood/src/inifile.cpp b/source/blood/src/inifile.cpp index a3ee29364..84ff7e45b 100644 --- a/source/blood/src/inifile.cpp +++ b/source/blood/src/inifile.cpp @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- // Note: This module is based on the sirlemonhead's work +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/iob.cpp b/source/blood/src/iob.cpp index e0c0accfa..f0b377820 100644 --- a/source/blood/src/iob.cpp +++ b/source/blood/src/iob.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include "compat.h" diff --git a/source/blood/src/levels.cpp b/source/blood/src/levels.cpp index 57b67f0ca..632496828 100644 --- a/source/blood/src/levels.cpp +++ b/source/blood/src/levels.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include "compat.h" diff --git a/source/blood/src/loadsave.cpp b/source/blood/src/loadsave.cpp index 99941ebf7..239267eb2 100644 --- a/source/blood/src/loadsave.cpp +++ b/source/blood/src/loadsave.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include "build.h" #include "compat.h" diff --git a/source/blood/src/map2d.cpp b/source/blood/src/map2d.cpp index 4db5dce93..d5530ede3 100644 --- a/source/blood/src/map2d.cpp +++ b/source/blood/src/map2d.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "mmulti.h" #include "common_game.h" diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index 1c8bf1196..bd5a5ac03 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "mmulti.h" #include "common_game.h" diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index 6981527a0..24abae951 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "mmulti.h" #include "compat.h" diff --git a/source/blood/src/mirrors.cpp b/source/blood/src/mirrors.cpp index dfca579b0..acb5f5ddd 100644 --- a/source/blood/src/mirrors.cpp +++ b/source/blood/src/mirrors.cpp @@ -20,11 +20,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" -#ifdef POLYMER -#include "polymer.h" -#endif #include "common_game.h" #include "blood.h" #include "db.h" diff --git a/source/blood/src/misc.cpp b/source/blood/src/misc.cpp index cce0ce438..8338fc106 100644 --- a/source/blood/src/misc.cpp +++ b/source/blood/src/misc.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include "common_game.h" diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index b65488cb6..ba220a08a 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "mmulti.h" #include "pragmas.h" diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 09ed3fd3e..cd663beb2 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -20,6 +20,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "build.h" #include "baselayer.h" diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index e959a59a5..1f8d6a574 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include "compat.h" diff --git a/source/blood/src/qav.cpp b/source/blood/src/qav.cpp index 80a73e282..441356d2c 100644 --- a/source/blood/src/qav.cpp +++ b/source/blood/src/qav.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" #include "common_game.h" diff --git a/source/blood/src/qheap.cpp b/source/blood/src/qheap.cpp index 138a899e5..feb1a5d8d 100644 --- a/source/blood/src/qheap.cpp +++ b/source/blood/src/qheap.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #ifdef USE_QHEAP #include diff --git a/source/blood/src/replace.cpp b/source/blood/src/replace.cpp index 69cd07b3c..54f5bc970 100644 --- a/source/blood/src/replace.cpp +++ b/source/blood/src/replace.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "common_game.h" #include "crc32.h" diff --git a/source/blood/src/resource.cpp b/source/blood/src/resource.cpp index e319c8624..c23af3796 100644 --- a/source/blood/src/resource.cpp +++ b/source/blood/src/resource.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/screen.cpp b/source/blood/src/screen.cpp index a6d34ce86..dd1e7423e 100644 --- a/source/blood/src/screen.cpp +++ b/source/blood/src/screen.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include "a.h" #include "build.h" diff --git a/source/blood/src/sectorfx.cpp b/source/blood/src/sectorfx.cpp index 5b39adbbb..6edac91fb 100644 --- a/source/blood/src/sectorfx.cpp +++ b/source/blood/src/sectorfx.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "pragmas.h" diff --git a/source/blood/src/seq.cpp b/source/blood/src/seq.cpp index 8527a07bb..6fca9efe3 100644 --- a/source/blood/src/seq.cpp +++ b/source/blood/src/seq.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include "build.h" #include "common_game.h" diff --git a/source/blood/src/sfx.cpp b/source/blood/src/sfx.cpp index 74d8dd403..6455f7e9d 100644 --- a/source/blood/src/sfx.cpp +++ b/source/blood/src/sfx.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include "build.h" #include "compat.h" diff --git a/source/blood/src/sound.cpp b/source/blood/src/sound.cpp index 4d8e56323..abe6be5ba 100644 --- a/source/blood/src/sound.cpp +++ b/source/blood/src/sound.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" #include "music.h" diff --git a/source/blood/src/startgtk.game.cpp b/source/blood/src/startgtk.game.cpp index 45603cd3a..692f17c71 100644 --- a/source/blood/src/startgtk.game.cpp +++ b/source/blood/src/startgtk.game.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "build.h" #include "common.h" diff --git a/source/blood/src/startosx.game.mm b/source/blood/src/startosx.game.mm index 8fe8f147c..c7545729b 100644 --- a/source/blood/src/startosx.game.mm +++ b/source/blood/src/startosx.game.mm @@ -5,6 +5,8 @@ #undef Rect +#include "ns.h" // Must come before everything else! + #include "blood.h" #include "common.h" #include "common_game.h" diff --git a/source/blood/src/startwin.game.cpp b/source/blood/src/startwin.game.cpp index 2635135cf..62c8630a4 100644 --- a/source/blood/src/startwin.game.cpp +++ b/source/blood/src/startwin.game.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #ifndef _WIN32 #error Only for Windows #endif diff --git a/source/blood/src/tile.cpp b/source/blood/src/tile.cpp index 3a208597c..3744fcb0e 100644 --- a/source/blood/src/tile.cpp +++ b/source/blood/src/tile.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/trig.cpp b/source/blood/src/trig.cpp index 0fd0b4115..3ece7f234 100644 --- a/source/blood/src/trig.cpp +++ b/source/blood/src/trig.cpp @@ -1,3 +1,5 @@ +#include "ns.h" // Must come before everything else! + #include "build.h" #include "pragmas.h" #include "common_game.h" diff --git a/source/blood/src/triggers.cpp b/source/blood/src/triggers.cpp index bbaa763d0..da3431ec8 100644 --- a/source/blood/src/triggers.cpp +++ b/source/blood/src/triggers.cpp @@ -20,8 +20,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include -#include #include "build.h" #include "compat.h" diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 8508c3776..6bfdfd31d 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include diff --git a/source/blood/src/warp.cpp b/source/blood/src/warp.cpp index ce7a0ca3a..7ff6bea66 100644 --- a/source/blood/src/warp.cpp +++ b/source/blood/src/warp.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "compat.h" #include "common_game.h" diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 397eecf44..0f40c2fed 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include #include #include diff --git a/source/blood/src/winbits.cpp b/source/blood/src/winbits.cpp index 235c86157..9d1e32cb2 100644 --- a/source/blood/src/winbits.cpp +++ b/source/blood/src/winbits.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #ifdef _WIN32 #include "compat.h" diff --git a/source/build/include/ns.h b/source/build/include/ns.h new file mode 100644 index 000000000..3787b5246 --- /dev/null +++ b/source/build/include/ns.h @@ -0,0 +1,31 @@ +#pragma once + +#ifndef NO_NAMESPACE + +#define BEGIN_DUKE_NS namespace Duke { +#define END_DUKE_NS } + +#define BEGIN_RR_NS namespace Redneck { +#define END_RR_NS } + +#define BEGIN_BLD_NS namespace Blood { +#define END_BLD_NS } + +#define BEGIN_SW_NS namespace Blood { +#define END_SW_NS } + +#else + +#define BEGIN_DUKE_NS +#define END_DUKE_NS + +#define BEGIN_RR_NS +#define END_RR_NS + +#define BEGIN_BLD_NS +#define END_BLD_NS + +#define BEGIN_SW_NS +#define END_SW_NS + +#endif diff --git a/source/duke3d/src/GameListSource.game.mm b/source/duke3d/src/GameListSource.game.mm index 20fa4fe06..257385dec 100644 --- a/source/duke3d/src/GameListSource.game.mm +++ b/source/duke3d/src/GameListSource.game.mm @@ -9,6 +9,8 @@ #import +#include "ns.h" // Must come before everything else! + #include "compat.h" #import "GrpFile.game.h" diff --git a/source/duke3d/src/GrpFile.game.mm b/source/duke3d/src/GrpFile.game.mm index 3dc3ea3b6..07248aa02 100644 --- a/source/duke3d/src/GrpFile.game.mm +++ b/source/duke3d/src/GrpFile.game.mm @@ -6,6 +6,7 @@ * Copyright 2009 __MyCompanyName__. All rights reserved. * */ +#include "ns.h" // Must come before everything else! #include "GrpFile.game.h" diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index faa37b61e..7244a01e3 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #define actors_c_ #include "duke3d.h" diff --git a/source/duke3d/src/anim.cpp b/source/duke3d/src/anim.cpp index 82392b825..465583904 100644 --- a/source/duke3d/src/anim.cpp +++ b/source/duke3d/src/anim.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "baselayer.h" #include "renderlayer.h" #include "duke3d.h" diff --git a/source/duke3d/src/cheats.cpp b/source/duke3d/src/cheats.cpp index 76d1374d3..a7cc47563 100644 --- a/source/duke3d/src/cheats.cpp +++ b/source/duke3d/src/cheats.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "osdcmds.h" #include "cheats.h" diff --git a/source/duke3d/src/cmdline.cpp b/source/duke3d/src/cmdline.cpp index ffbeed6ac..d0eb264bd 100644 --- a/source/duke3d/src/cmdline.cpp +++ b/source/duke3d/src/cmdline.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "demo.h" #include "screens.h" diff --git a/source/duke3d/src/common.cpp b/source/duke3d/src/common.cpp index 53d1a0590..54f587473 100644 --- a/source/duke3d/src/common.cpp +++ b/source/duke3d/src/common.cpp @@ -2,6 +2,8 @@ // Common non-engine code/data for EDuke32 and Mapster32 // +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" #include "baselayer.h" diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index f4af6314b..77b76b257 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "scriplib.h" #include "osdcmds.h" diff --git a/source/duke3d/src/demo.cpp b/source/duke3d/src/demo.cpp index dfe57ecf8..5478a59fe 100644 --- a/source/duke3d/src/demo.cpp +++ b/source/duke3d/src/demo.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "demo.h" #include "duke3d.h" #include "input.h" diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 2a0262ba3..64a4f8581 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #define game_c_ #include "duke3d.h" diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index b53cf358a..7d813f916 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "gamedef.h" #include "cheats.h" diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 898514a1f..d53a566f4 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "anim.h" #include "cmdline.h" #include "colmatch.h" diff --git a/source/duke3d/src/gamevars.cpp b/source/duke3d/src/gamevars.cpp index 0ef77f944..4172bead6 100644 --- a/source/duke3d/src/gamevars.cpp +++ b/source/duke3d/src/gamevars.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "menus.h" #include "savegame.h" diff --git a/source/duke3d/src/global.cpp b/source/duke3d/src/global.cpp index 2487d2f59..8c059db4a 100644 --- a/source/duke3d/src/global.cpp +++ b/source/duke3d/src/global.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #define global_c_ #include "global.h" #include "duke3d.h" diff --git a/source/duke3d/src/grpscan.cpp b/source/duke3d/src/grpscan.cpp index aef317ab4..c9a9ca876 100644 --- a/source/duke3d/src/grpscan.cpp +++ b/source/duke3d/src/grpscan.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "baselayer.h" #include "cache1d.h" #include "common_game.h" diff --git a/source/duke3d/src/in_android.cpp b/source/duke3d/src/in_android.cpp deleted file mode 100644 index b6c3fd863..000000000 --- a/source/duke3d/src/in_android.cpp +++ /dev/null @@ -1,354 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2015 EDuke32 developers and contributors -Copyright (C) 2015 Voidpoint, LLC - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -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 General Public License for more details. - -You should have received a copy of the GNU 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 "compat.h" -#include "sdl_inc.h" -#include "baselayer.h" -#include "keys.h" -#include "duke3d.h" -#include "common_game.h" -#include "osd.h" -#include "player.h" -#include "game.h" -#include "build.h" -#include "anim.h" -#include "player.h" - -#include "keyboard.h" -#include "control.h" -#include "_control.h" - -#include "menus.h" - -#ifdef __cplusplus -extern "C" { -#endif -extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode); -extern int SDL_SendKeyboardText(const char *text); -extern int SDL_SendMouseMotion(SDL_Window * window, Uint32 mouseID, int relative, int x, int y); -extern int SDL_SendMouseButton(SDL_Window * window, Uint32 mouseID, Uint8 state, Uint8 button); - -#ifdef __cplusplus -} -#endif - -#include "in_android.h" -#include - -#if defined __GNUC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO,"DUKE", __VA_ARGS__)) - -static char sdl_text[2]; - -droidinput_t droidinput; - -void AndroidTimer(int tics) { G_InitTimer(tics); } - -int AndroidKeyEvent(int state, int code,int unicode) -{ - LOGI("AndroidKeyEvent %d %d %d",state,(SDL_Scancode)code,unicode); - SDL_SendKeyboardKey(state ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)code); - SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE); - - // if (code == 42) - // unicode = 42; - - if (state) - { - //if (unicode < 128) - { - sdl_text[0] = unicode; - sdl_text[1] = 0; - - int posted = SDL_SendKeyboardText((const char*)sdl_text); - LOGI("posted = %d",posted); - } - - if (state == 2) - AndroidKeyEvent(0, code, unicode); - } - - return 0; -} - -void AndroidMouseMenu(float x,float y) -{ - SDL_SendMouseMotion(NULL,0,0,x,y); -} - -void AndroidMouseMenuButton(int state,int button) -{ - SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, state?SDL_PRESSED:SDL_RELEASED, SDL_BUTTON_LEFT); -} - -void changeActionState(int state, int action) -{ - if (state) - { - //BUTTONSET(action,1); - droidinput.functionSticky |= ((uint64_t)1<<((uint64_t)(action))); - droidinput.functionHeld |= ((uint64_t)1<<((uint64_t)(action))); - return; - } - - //BUTTONCLEAR(action); - droidinput.functionHeld &= ~((uint64_t) 1<<((uint64_t) (action))); -} - -void AndroidAction(int state, int action) -{ - LOGI("AndroidAction action = %d, state = %d", action, state); - - if (action >= MENU_UP && action <= MENU_BACK) - { - int const sdl_code [] = { SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, - SDL_SCANCODE_RIGHT, SDL_SCANCODE_RETURN, SDL_SCANCODE_ESCAPE }; - AndroidKeyEvent(state, sdl_code[action-MENU_UP], 0); - return; - } - else - { - //if (AndroidRead(READ_SCREEN_MODE) != TOUCH_SCREEN_GAME) //If not in game don't do any of this - /// return; - - //Special toggle for crouch, NOT when using jetpack or in water - if (droidinput.toggleCrouch) - { - int lotag = sector[g_player[myconnectindex].ps->cursectnum].lotag; - - if (droidinput.crouchToggleState && (lotag == ST_2_UNDERWATER || lotag == ST_1_ABOVE_WATER)) - { - droidinput.crouchToggleState = 0; - if (action == gamefunc_Crouch) - state = 0; - else AndroidAction(0, gamefunc_Crouch); - } - - if (action == gamefunc_Crouch) - { - if (!g_player[myconnectindex].ps->jetpack_on && g_player[myconnectindex].ps->on_ground && - lotag != ST_2_UNDERWATER && lotag != ST_1_ABOVE_WATER) - { - if (state) - droidinput.crouchToggleState = !droidinput.crouchToggleState; - - state = droidinput.crouchToggleState; - } - } - - } - - //Check if jumping while crouched - if (action == gamefunc_Jump) - { - if (droidinput.crouchToggleState) - { - droidinput.crouchToggleState = 0; - changeActionState(0, gamefunc_Crouch); - } - else - changeActionState(state, action); - } - else - changeActionState(state, action); - - if (state == 2) - AndroidAction(0, action); - - // LOGI("AndroidAction state = 0x%016llX", CONTROL_ButtonState); - } -} - -int const deadRegion = 0.3; - -float analogCalibrate(float v) -{ - float rv = 0; - - if (v > deadRegion) rv = (v - deadRegion) * (v - deadRegion); - else if (-v > deadRegion) rv = -(-v - deadRegion) * (-v - deadRegion); - - return rv; -} - -//Need these NAN check as not cumulative. -void AndroidMove(float fwd, float strafe) -{ - if (!ud.auto_run) - { - fwd *= 0.5f; - strafe *= 0.5f; - } - - if (!isnan(fwd)) - droidinput.forwardmove = fclamp2(analogCalibrate(fwd), -1.f, 1.f); - - if (!isnan(strafe)) - droidinput.sidemove = fclamp2(analogCalibrate(strafe), -1.f, 1.f); -} - -void AndroidLook(float yaw, float pitch) -{ - droidinput.pitch += pitch; - droidinput.yaw += yaw; -} - -void AndroidLookJoystick(float yaw, float pitch) -{ - if (!isnan(pitch)) - droidinput.pitch_joystick = analogCalibrate(pitch); - - if (!isnan(yaw)) - droidinput.yaw_joystick = analogCalibrate(yaw); -} - -void AndroidOSD(const char * cmd) -{ - OSD_Dispatch(cmd); -} - -int consoleShown = 0; -void AndroidSetConsoleShown(int onf) -{ - consoleShown = onf; -} - -extern int inExtraScreens; //In game.c -int32_t AndroidRead(portableread_t r) -{ - int32_t rv; - - switch (r) - { - case R_TOUCH_MODE: - if (g_animPtr || inExtraScreens) - rv = TOUCH_SCREEN_BLANK_TAP; - else if (consoleShown) - rv = TOUCH_SCREEN_CONSOLE; - else if ((g_player[myconnectindex].ps->gm & MODE_MENU) == MODE_MENU && g_currentMenu != MENU_MAIN) - rv = (m_currentMenu->type == Verify && totalclock > (m_animation.length + m_animation.start)) ? TOUCH_SCREEN_YES_NO : TOUCH_SCREEN_MENU; - else if ((g_player[myconnectindex].ps->gm & MODE_MENU) == MODE_MENU && g_currentMenu == MENU_MAIN) - rv = TOUCH_SCREEN_MENU_NOBACK; -/* - else if (ud.overhead_on == 2) - rv = TOUCH_SCREEN_AUTOMAP; -*/ - else if ((g_player[myconnectindex].ps->gm & MODE_GAME)) - if (AndroidRead(R_PLAYER_DEAD_FLAG)) - rv = TOUCH_SCREEN_BLANK_TAP; - else - rv = TOUCH_SCREEN_GAME; - else - rv = TOUCH_SCREEN_BLANK_TAP; - break; - case R_PLAYER_GOTWEAPON: - rv = g_player[myconnectindex].ps->gotweapon; break; - case R_UD_OVERHEAD_ON: - rv = 0; break;//ud.overhead_on != 0; break;// ud.overhead_on ranges from 0-2 - case R_UD_SCROLLMODE: - rv = ud.scrollmode; break; - case R_PLAYER_LASTWEAPON: - rv = droidinput.lastWeapon; - if ((unsigned)rv < MAX_WEAPONS && !g_player[myconnectindex].ps->ammo_amount[rv]) - rv = -1; - break; - case R_GAME_PAUSED: - rv = ud.pause_on != 0; break; - case R_PLAYER_DEAD_FLAG: - rv = g_player[myconnectindex].ps->dead_flag; break; - case R_PLAYER_INV_AMOUNT: - rv = 0; - for (bssize_t i = 0; i < GET_MAX; i++) - { - if (g_player[myconnectindex].ps->inv_amount[i]) - rv += (1 << i); - } - break; - case R_SOMETHINGONPLAYER: - rv = g_player[myconnectindex].ps->somethingonplayer != -1; - break; - default: - rv = 0; break; - } - - return rv; -} - -static float map_zoom,map_dx,map_dy = 0; - -void AndroidAutomapControl(float zoom,float dx,float dy) -{ - map_zoom += zoom; - map_dx += dx; - map_dy += dy; -} - -///This stuff is called from the game/engine - -extern void CONTROL_Android_ScrollMap(int32_t *angle,int32_t *x, int32_t *y, uint16_t *zoom ) -{ - - *x += ((int)(map_dx * -30000)*sintable[(512+2048-*angle)&2047])>>14; - *y += ((int)(map_dy * -30000)*sintable[(512+1024-512-*angle)&2047])>>14; - -// *zoom += map_zoom * 2000; - //*angle = 0; - map_dx = map_dy = map_zoom = 0; -} - -void CONTROL_Android_SetLastWeapon(int w) -{ - droidinput.lastWeapon = w; -} - -void CONTROL_Android_ClearButton(int32_t whichbutton) -{ - droidinput.functionHeld &= ~((uint64_t)1<<((uint64_t)(whichbutton))); -} - -void CONTROL_Android_PollDevices(ControlInfo *info) -{ - //LOGI("CONTROL_Android_PollDevices %f %f",forwardmove,sidemove); - //LOGI("CONTROL_Android_PollDevices %f %f",droidinput.pitch,droidinput.yaw); - - info->dz = (int32_t)nearbyintf(-droidinput.forwardmove * ANDROIDMOVEFACTOR); - info->dx = (int32_t)nearbyintf(droidinput.sidemove * ANDROIDMOVEFACTOR) >> 5; - info->dpitch = - (int32_t)nearbyintf(droidinput.pitch * ANDROIDLOOKFACTOR + droidinput.pitch_joystick * ANDROIDPITCHFACTORJOYSTICK); - info->dyaw = - (int32_t)nearbyintf(-droidinput.yaw * ANDROIDLOOKFACTOR - droidinput.yaw_joystick * ANDROIDYAWFACTORJOYSTICK); - - droidinput.pitch = droidinput.yaw = 0.f; - CONTROL_ButtonState = droidinput.functionSticky | droidinput.functionHeld; - droidinput.functionSticky = 0; - - //LOGI("poll state = 0x%016llX",CONTROL_ButtonState); -} - -#if defined __GNUC__ -# pragma GCC diagnostic pop -#endif diff --git a/source/duke3d/src/input.cpp b/source/duke3d/src/input.cpp index c2e3fa633..50cb303e6 100644 --- a/source/duke3d/src/input.cpp +++ b/source/duke3d/src/input.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "global.h" #include "game.h" #include "function.h" diff --git a/source/duke3d/src/mdump.cpp b/source/duke3d/src/mdump.cpp index e3ee4c224..8c03c014e 100644 --- a/source/duke3d/src/mdump.cpp +++ b/source/duke3d/src/mdump.cpp @@ -1,3 +1,4 @@ +#include "ns.h" // Must come before everything else! #include "compat.h" #include "mdump.h" diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index d1a86c0fd..40ed33a12 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "cheats.h" #include "compat.h" #include "demo.h" diff --git a/source/duke3d/src/namesdyn.cpp b/source/duke3d/src/namesdyn.cpp index bdd6278a8..0f6675692 100644 --- a/source/duke3d/src/namesdyn.cpp +++ b/source/duke3d/src/namesdyn.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" diff --git a/source/duke3d/src/network.cpp b/source/duke3d/src/network.cpp index bf7e9742f..e2749698b 100644 --- a/source/duke3d/src/network.cpp +++ b/source/duke3d/src/network.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + /// Preprocessor directives: /// /// ITERATE_ON_UPDATE: Every time the netcode updates the sprite linked lists, attempt to iterate through all of them. diff --git a/source/duke3d/src/osdcmds.cpp b/source/duke3d/src/osdcmds.cpp index 5d18bba03..f474ec03a 100644 --- a/source/duke3d/src/osdcmds.cpp +++ b/source/duke3d/src/osdcmds.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "cheats.h" #include "cmdline.h" #include "demo.h" // g_firstDemoFile[] diff --git a/source/duke3d/src/osdfuncs.cpp b/source/duke3d/src/osdfuncs.cpp index f56e64344..171c3d133 100644 --- a/source/duke3d/src/osdfuncs.cpp +++ b/source/duke3d/src/osdfuncs.cpp @@ -19,6 +19,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- + +#include "ns.h" // Must come before everything else! + + #include "compat.h" #include "duke3d.h" #include "build.h" diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 9b4b9e967..e77253d96 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "demo.h" #include "enet/enet.h" diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index 7fc2e51b3..c35cd9993 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "anim.h" #include "cmdline.h" #include "demo.h" diff --git a/source/duke3d/src/rts.cpp b/source/duke3d/src/rts.cpp index 0818c6dac..25202c428 100644 --- a/source/duke3d/src/rts.cpp +++ b/source/duke3d/src/rts.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "vfs.h" diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 3da02518b..7f82b0caf 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "premap.h" #include "prlights.h" diff --git a/source/duke3d/src/sbar.cpp b/source/duke3d/src/sbar.cpp index 4351ecdae..9300d5a51 100644 --- a/source/duke3d/src/sbar.cpp +++ b/source/duke3d/src/sbar.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "compat.h" #include "sbar.h" diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index ec33515c0..e1b883edf 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "anim.h" #include "colmatch.h" #include "compat.h" diff --git a/source/duke3d/src/screentext.cpp b/source/duke3d/src/screentext.cpp index aee05502c..16b89be25 100644 --- a/source/duke3d/src/screentext.cpp +++ b/source/duke3d/src/screentext.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "compat.h" #include "sbar.h" diff --git a/source/duke3d/src/sector.cpp b/source/duke3d/src/sector.cpp index 4c24b7395..aebae6462 100644 --- a/source/duke3d/src/sector.cpp +++ b/source/duke3d/src/sector.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #define sector_c_ #include "duke3d.h" diff --git a/source/duke3d/src/sounds.cpp b/source/duke3d/src/sounds.cpp index b849965ea..3e390495b 100644 --- a/source/duke3d/src/sounds.cpp +++ b/source/duke3d/src/sounds.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "duke3d.h" diff --git a/source/duke3d/src/soundsdyn.cpp b/source/duke3d/src/soundsdyn.cpp index 67c0ea803..db2c9fdef 100644 --- a/source/duke3d/src/soundsdyn.cpp +++ b/source/duke3d/src/soundsdyn.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "build.h" diff --git a/source/duke3d/src/startgtk.game.cpp b/source/duke3d/src/startgtk.game.cpp index 7e90c64ee..4cdb7cf3e 100644 --- a/source/duke3d/src/startgtk.game.cpp +++ b/source/duke3d/src/startgtk.game.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "build.h" #include "cmdline.h" #include "common.h" diff --git a/source/duke3d/src/startosx.game.mm b/source/duke3d/src/startosx.game.mm index 6f6dad123..d2db5e86a 100644 --- a/source/duke3d/src/startosx.game.mm +++ b/source/duke3d/src/startosx.game.mm @@ -1,6 +1,8 @@ #import +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "game.h" #include "common.h" diff --git a/source/duke3d/src/startwin.game.cpp b/source/duke3d/src/startwin.game.cpp index ac6bd3a58..bff547289 100644 --- a/source/duke3d/src/startwin.game.cpp +++ b/source/duke3d/src/startwin.game.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #ifndef _WIN32 #error Only for Windows #endif diff --git a/source/duke3d/src/winbits.cpp b/source/duke3d/src/winbits.cpp index 9cbdccf48..851ffa093 100644 --- a/source/duke3d/src/winbits.cpp +++ b/source/duke3d/src/winbits.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #ifdef _WIN32 #include "compat.h" diff --git a/source/rr/src/GameListSource.game.mm b/source/rr/src/GameListSource.game.mm index c78dc3153..148a3c055 100644 --- a/source/rr/src/GameListSource.game.mm +++ b/source/rr/src/GameListSource.game.mm @@ -9,6 +9,8 @@ #import +#include "ns.h" // Must come before everything else! + #include "compat.h" #import "GrpFile.game.h" diff --git a/source/rr/src/GrpFile.game.mm b/source/rr/src/GrpFile.game.mm index 2118f1442..fd460e6c6 100644 --- a/source/rr/src/GrpFile.game.mm +++ b/source/rr/src/GrpFile.game.mm @@ -7,6 +7,8 @@ * */ +#include "ns.h" // Must come before everything else! + #include "GrpFile.game.h" @implementation GrpFile diff --git a/source/rr/src/actors.cpp b/source/rr/src/actors.cpp index 131c1cf7e..896d18e13 100644 --- a/source/rr/src/actors.cpp +++ b/source/rr/src/actors.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #define actors_c_ #include "duke3d.h" diff --git a/source/rr/src/anim.cpp b/source/rr/src/anim.cpp index 534cc0be7..e6e777343 100644 --- a/source/rr/src/anim.cpp +++ b/source/rr/src/anim.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "baselayer.h" #include "renderlayer.h" #include "duke3d.h" diff --git a/source/rr/src/cheats.cpp b/source/rr/src/cheats.cpp index 3ef4bb1a2..011316247 100644 --- a/source/rr/src/cheats.cpp +++ b/source/rr/src/cheats.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "osdcmds.h" #include "cheats.h" diff --git a/source/rr/src/cmdline.cpp b/source/rr/src/cmdline.cpp index 17cd12100..7f4cdb22c 100644 --- a/source/rr/src/cmdline.cpp +++ b/source/rr/src/cmdline.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "demo.h" #include "screens.h" diff --git a/source/rr/src/common.cpp b/source/rr/src/common.cpp index beaf82954..0b9365a6e 100644 --- a/source/rr/src/common.cpp +++ b/source/rr/src/common.cpp @@ -1,6 +1,7 @@ // // Common non-engine code/data for EDuke32 and Mapster32 // +#include "ns.h" // Must come before everything else! #include "compat.h" #include "build.h" diff --git a/source/rr/src/config.cpp b/source/rr/src/config.cpp index 739f33890..b1bf4ec00 100644 --- a/source/rr/src/config.cpp +++ b/source/rr/src/config.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "scriplib.h" #include "osdcmds.h" diff --git a/source/rr/src/demo.cpp b/source/rr/src/demo.cpp index 6bbf2f51e..029ad2197 100644 --- a/source/rr/src/demo.cpp +++ b/source/rr/src/demo.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "demo.h" //#include "premap.h" // G_UpdateScreenArea() diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 9e3539790..9fe47f722 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #define game_c_ #include "duke3d.h" diff --git a/source/rr/src/gamedef.cpp b/source/rr/src/gamedef.cpp index 0bf07e15f..195593579 100644 --- a/source/rr/src/gamedef.cpp +++ b/source/rr/src/gamedef.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "namesdyn.h" #include "gamedef.h" diff --git a/source/rr/src/gameexec.cpp b/source/rr/src/gameexec.cpp index e78645cd1..cf82e0476 100644 --- a/source/rr/src/gameexec.cpp +++ b/source/rr/src/gameexec.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "colmatch.h" #include "compat.h" diff --git a/source/rr/src/global.cpp b/source/rr/src/global.cpp index a3eb3b12f..345494b2d 100644 --- a/source/rr/src/global.cpp +++ b/source/rr/src/global.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #define global_c_ #include "global.h" diff --git a/source/rr/src/grpscan.cpp b/source/rr/src/grpscan.cpp index 055ab0895..44ad3e851 100644 --- a/source/rr/src/grpscan.cpp +++ b/source/rr/src/grpscan.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "compat.h" #include "baselayer.h" diff --git a/source/rr/src/in_android.cpp b/source/rr/src/in_android.cpp deleted file mode 100644 index b6c3fd863..000000000 --- a/source/rr/src/in_android.cpp +++ /dev/null @@ -1,354 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2015 EDuke32 developers and contributors -Copyright (C) 2015 Voidpoint, LLC - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -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 General Public License for more details. - -You should have received a copy of the GNU 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 "compat.h" -#include "sdl_inc.h" -#include "baselayer.h" -#include "keys.h" -#include "duke3d.h" -#include "common_game.h" -#include "osd.h" -#include "player.h" -#include "game.h" -#include "build.h" -#include "anim.h" -#include "player.h" - -#include "keyboard.h" -#include "control.h" -#include "_control.h" - -#include "menus.h" - -#ifdef __cplusplus -extern "C" { -#endif -extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode); -extern int SDL_SendKeyboardText(const char *text); -extern int SDL_SendMouseMotion(SDL_Window * window, Uint32 mouseID, int relative, int x, int y); -extern int SDL_SendMouseButton(SDL_Window * window, Uint32 mouseID, Uint8 state, Uint8 button); - -#ifdef __cplusplus -} -#endif - -#include "in_android.h" -#include - -#if defined __GNUC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO,"DUKE", __VA_ARGS__)) - -static char sdl_text[2]; - -droidinput_t droidinput; - -void AndroidTimer(int tics) { G_InitTimer(tics); } - -int AndroidKeyEvent(int state, int code,int unicode) -{ - LOGI("AndroidKeyEvent %d %d %d",state,(SDL_Scancode)code,unicode); - SDL_SendKeyboardKey(state ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)code); - SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE); - - // if (code == 42) - // unicode = 42; - - if (state) - { - //if (unicode < 128) - { - sdl_text[0] = unicode; - sdl_text[1] = 0; - - int posted = SDL_SendKeyboardText((const char*)sdl_text); - LOGI("posted = %d",posted); - } - - if (state == 2) - AndroidKeyEvent(0, code, unicode); - } - - return 0; -} - -void AndroidMouseMenu(float x,float y) -{ - SDL_SendMouseMotion(NULL,0,0,x,y); -} - -void AndroidMouseMenuButton(int state,int button) -{ - SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, state?SDL_PRESSED:SDL_RELEASED, SDL_BUTTON_LEFT); -} - -void changeActionState(int state, int action) -{ - if (state) - { - //BUTTONSET(action,1); - droidinput.functionSticky |= ((uint64_t)1<<((uint64_t)(action))); - droidinput.functionHeld |= ((uint64_t)1<<((uint64_t)(action))); - return; - } - - //BUTTONCLEAR(action); - droidinput.functionHeld &= ~((uint64_t) 1<<((uint64_t) (action))); -} - -void AndroidAction(int state, int action) -{ - LOGI("AndroidAction action = %d, state = %d", action, state); - - if (action >= MENU_UP && action <= MENU_BACK) - { - int const sdl_code [] = { SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, - SDL_SCANCODE_RIGHT, SDL_SCANCODE_RETURN, SDL_SCANCODE_ESCAPE }; - AndroidKeyEvent(state, sdl_code[action-MENU_UP], 0); - return; - } - else - { - //if (AndroidRead(READ_SCREEN_MODE) != TOUCH_SCREEN_GAME) //If not in game don't do any of this - /// return; - - //Special toggle for crouch, NOT when using jetpack or in water - if (droidinput.toggleCrouch) - { - int lotag = sector[g_player[myconnectindex].ps->cursectnum].lotag; - - if (droidinput.crouchToggleState && (lotag == ST_2_UNDERWATER || lotag == ST_1_ABOVE_WATER)) - { - droidinput.crouchToggleState = 0; - if (action == gamefunc_Crouch) - state = 0; - else AndroidAction(0, gamefunc_Crouch); - } - - if (action == gamefunc_Crouch) - { - if (!g_player[myconnectindex].ps->jetpack_on && g_player[myconnectindex].ps->on_ground && - lotag != ST_2_UNDERWATER && lotag != ST_1_ABOVE_WATER) - { - if (state) - droidinput.crouchToggleState = !droidinput.crouchToggleState; - - state = droidinput.crouchToggleState; - } - } - - } - - //Check if jumping while crouched - if (action == gamefunc_Jump) - { - if (droidinput.crouchToggleState) - { - droidinput.crouchToggleState = 0; - changeActionState(0, gamefunc_Crouch); - } - else - changeActionState(state, action); - } - else - changeActionState(state, action); - - if (state == 2) - AndroidAction(0, action); - - // LOGI("AndroidAction state = 0x%016llX", CONTROL_ButtonState); - } -} - -int const deadRegion = 0.3; - -float analogCalibrate(float v) -{ - float rv = 0; - - if (v > deadRegion) rv = (v - deadRegion) * (v - deadRegion); - else if (-v > deadRegion) rv = -(-v - deadRegion) * (-v - deadRegion); - - return rv; -} - -//Need these NAN check as not cumulative. -void AndroidMove(float fwd, float strafe) -{ - if (!ud.auto_run) - { - fwd *= 0.5f; - strafe *= 0.5f; - } - - if (!isnan(fwd)) - droidinput.forwardmove = fclamp2(analogCalibrate(fwd), -1.f, 1.f); - - if (!isnan(strafe)) - droidinput.sidemove = fclamp2(analogCalibrate(strafe), -1.f, 1.f); -} - -void AndroidLook(float yaw, float pitch) -{ - droidinput.pitch += pitch; - droidinput.yaw += yaw; -} - -void AndroidLookJoystick(float yaw, float pitch) -{ - if (!isnan(pitch)) - droidinput.pitch_joystick = analogCalibrate(pitch); - - if (!isnan(yaw)) - droidinput.yaw_joystick = analogCalibrate(yaw); -} - -void AndroidOSD(const char * cmd) -{ - OSD_Dispatch(cmd); -} - -int consoleShown = 0; -void AndroidSetConsoleShown(int onf) -{ - consoleShown = onf; -} - -extern int inExtraScreens; //In game.c -int32_t AndroidRead(portableread_t r) -{ - int32_t rv; - - switch (r) - { - case R_TOUCH_MODE: - if (g_animPtr || inExtraScreens) - rv = TOUCH_SCREEN_BLANK_TAP; - else if (consoleShown) - rv = TOUCH_SCREEN_CONSOLE; - else if ((g_player[myconnectindex].ps->gm & MODE_MENU) == MODE_MENU && g_currentMenu != MENU_MAIN) - rv = (m_currentMenu->type == Verify && totalclock > (m_animation.length + m_animation.start)) ? TOUCH_SCREEN_YES_NO : TOUCH_SCREEN_MENU; - else if ((g_player[myconnectindex].ps->gm & MODE_MENU) == MODE_MENU && g_currentMenu == MENU_MAIN) - rv = TOUCH_SCREEN_MENU_NOBACK; -/* - else if (ud.overhead_on == 2) - rv = TOUCH_SCREEN_AUTOMAP; -*/ - else if ((g_player[myconnectindex].ps->gm & MODE_GAME)) - if (AndroidRead(R_PLAYER_DEAD_FLAG)) - rv = TOUCH_SCREEN_BLANK_TAP; - else - rv = TOUCH_SCREEN_GAME; - else - rv = TOUCH_SCREEN_BLANK_TAP; - break; - case R_PLAYER_GOTWEAPON: - rv = g_player[myconnectindex].ps->gotweapon; break; - case R_UD_OVERHEAD_ON: - rv = 0; break;//ud.overhead_on != 0; break;// ud.overhead_on ranges from 0-2 - case R_UD_SCROLLMODE: - rv = ud.scrollmode; break; - case R_PLAYER_LASTWEAPON: - rv = droidinput.lastWeapon; - if ((unsigned)rv < MAX_WEAPONS && !g_player[myconnectindex].ps->ammo_amount[rv]) - rv = -1; - break; - case R_GAME_PAUSED: - rv = ud.pause_on != 0; break; - case R_PLAYER_DEAD_FLAG: - rv = g_player[myconnectindex].ps->dead_flag; break; - case R_PLAYER_INV_AMOUNT: - rv = 0; - for (bssize_t i = 0; i < GET_MAX; i++) - { - if (g_player[myconnectindex].ps->inv_amount[i]) - rv += (1 << i); - } - break; - case R_SOMETHINGONPLAYER: - rv = g_player[myconnectindex].ps->somethingonplayer != -1; - break; - default: - rv = 0; break; - } - - return rv; -} - -static float map_zoom,map_dx,map_dy = 0; - -void AndroidAutomapControl(float zoom,float dx,float dy) -{ - map_zoom += zoom; - map_dx += dx; - map_dy += dy; -} - -///This stuff is called from the game/engine - -extern void CONTROL_Android_ScrollMap(int32_t *angle,int32_t *x, int32_t *y, uint16_t *zoom ) -{ - - *x += ((int)(map_dx * -30000)*sintable[(512+2048-*angle)&2047])>>14; - *y += ((int)(map_dy * -30000)*sintable[(512+1024-512-*angle)&2047])>>14; - -// *zoom += map_zoom * 2000; - //*angle = 0; - map_dx = map_dy = map_zoom = 0; -} - -void CONTROL_Android_SetLastWeapon(int w) -{ - droidinput.lastWeapon = w; -} - -void CONTROL_Android_ClearButton(int32_t whichbutton) -{ - droidinput.functionHeld &= ~((uint64_t)1<<((uint64_t)(whichbutton))); -} - -void CONTROL_Android_PollDevices(ControlInfo *info) -{ - //LOGI("CONTROL_Android_PollDevices %f %f",forwardmove,sidemove); - //LOGI("CONTROL_Android_PollDevices %f %f",droidinput.pitch,droidinput.yaw); - - info->dz = (int32_t)nearbyintf(-droidinput.forwardmove * ANDROIDMOVEFACTOR); - info->dx = (int32_t)nearbyintf(droidinput.sidemove * ANDROIDMOVEFACTOR) >> 5; - info->dpitch = - (int32_t)nearbyintf(droidinput.pitch * ANDROIDLOOKFACTOR + droidinput.pitch_joystick * ANDROIDPITCHFACTORJOYSTICK); - info->dyaw = - (int32_t)nearbyintf(-droidinput.yaw * ANDROIDLOOKFACTOR - droidinput.yaw_joystick * ANDROIDYAWFACTORJOYSTICK); - - droidinput.pitch = droidinput.yaw = 0.f; - CONTROL_ButtonState = droidinput.functionSticky | droidinput.functionHeld; - droidinput.functionSticky = 0; - - //LOGI("poll state = 0x%016llX",CONTROL_ButtonState); -} - -#if defined __GNUC__ -# pragma GCC diagnostic pop -#endif diff --git a/source/rr/src/input.cpp b/source/rr/src/input.cpp index 3461fb740..28f48d5cf 100644 --- a/source/rr/src/input.cpp +++ b/source/rr/src/input.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "global.h" #include "game.h" diff --git a/source/rr/src/mdump.cpp b/source/rr/src/mdump.cpp index 16de19350..5a98f6487 100644 --- a/source/rr/src/mdump.cpp +++ b/source/rr/src/mdump.cpp @@ -1,3 +1,4 @@ +#include "ns.h" // Must come before everything else! #include "compat.h" #include "mdump.h" diff --git a/source/rr/src/menus.cpp b/source/rr/src/menus.cpp index 6d9c5f7e1..ef6904893 100644 --- a/source/rr/src/menus.cpp +++ b/source/rr/src/menus.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "compat.h" #include "duke3d.h" diff --git a/source/rr/src/namesdyn.cpp b/source/rr/src/namesdyn.cpp index 6f35cca9a..722c299c7 100644 --- a/source/rr/src/namesdyn.cpp +++ b/source/rr/src/namesdyn.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "compat.h" #include "build.h" diff --git a/source/rr/src/net.cpp b/source/rr/src/net.cpp index ca501c393..e9e3baccd 100644 --- a/source/rr/src/net.cpp +++ b/source/rr/src/net.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "game.h" diff --git a/source/rr/src/osdcmds.cpp b/source/rr/src/osdcmds.cpp index 07b03c840..409cec8d8 100644 --- a/source/rr/src/osdcmds.cpp +++ b/source/rr/src/osdcmds.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "cheats.h" #include "cmdline.h" diff --git a/source/rr/src/osdfuncs.cpp b/source/rr/src/osdfuncs.cpp index b84d31ba0..202793d6a 100644 --- a/source/rr/src/osdfuncs.cpp +++ b/source/rr/src/osdfuncs.cpp @@ -19,6 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! + #include "compat.h" #include "duke3d.h" #include "build.h" diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index 331bf873b..2fb175823 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "demo.h" diff --git a/source/rr/src/premap.cpp b/source/rr/src/premap.cpp index bf4c09736..0c7ec1e0a 100644 --- a/source/rr/src/premap.cpp +++ b/source/rr/src/premap.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "anim.h" diff --git a/source/rr/src/rts.cpp b/source/rr/src/rts.cpp index 2c6c07d36..815080374 100644 --- a/source/rr/src/rts.cpp +++ b/source/rr/src/rts.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" diff --git a/source/rr/src/savegame.cpp b/source/rr/src/savegame.cpp index 0503b11ea..6e9e1c3ef 100644 --- a/source/rr/src/savegame.cpp +++ b/source/rr/src/savegame.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "premap.h" diff --git a/source/rr/src/sbar.cpp b/source/rr/src/sbar.cpp index 048d48b1c..70e18d353 100644 --- a/source/rr/src/sbar.cpp +++ b/source/rr/src/sbar.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "compat.h" diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index f07c035cc..08262dd94 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "compat.h" diff --git a/source/rr/src/screentext.cpp b/source/rr/src/screentext.cpp index 344fe1ba2..df34bd47a 100644 --- a/source/rr/src/screentext.cpp +++ b/source/rr/src/screentext.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "duke3d.h" #include "compat.h" diff --git a/source/rr/src/sector.cpp b/source/rr/src/sector.cpp index 1d471cfb0..7660fe98c 100644 --- a/source/rr/src/sector.cpp +++ b/source/rr/src/sector.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #define sector_c_ diff --git a/source/rr/src/sounds.cpp b/source/rr/src/sounds.cpp index 03692ed55..fed841091 100644 --- a/source/rr/src/sounds.cpp +++ b/source/rr/src/sounds.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "compat.h" diff --git a/source/rr/src/soundsdyn.cpp b/source/rr/src/soundsdyn.cpp index 6c700921f..c438a74fa 100644 --- a/source/rr/src/soundsdyn.cpp +++ b/source/rr/src/soundsdyn.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "compat.h" #include "build.h" diff --git a/source/rr/src/startgtk.game.cpp b/source/rr/src/startgtk.game.cpp index 7e90c64ee..c50a94483 100644 --- a/source/rr/src/startgtk.game.cpp +++ b/source/rr/src/startgtk.game.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #include "build.h" #include "cmdline.h" diff --git a/source/rr/src/startosx.game.mm b/source/rr/src/startosx.game.mm index 405db11da..97c0db66e 100644 --- a/source/rr/src/startosx.game.mm +++ b/source/rr/src/startosx.game.mm @@ -1,6 +1,8 @@ #import +#include "ns.h" // Must come before everything else! + #include "duke3d.h" #include "game.h" #include "common.h" diff --git a/source/rr/src/startwin.game.cpp b/source/rr/src/startwin.game.cpp index 65713419e..d87654f06 100644 --- a/source/rr/src/startwin.game.cpp +++ b/source/rr/src/startwin.game.cpp @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "ns.h" // Must come before everything else! #ifndef _WIN32 #error Only for Windows