diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 13ef32a7a..0874299e1 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -866,7 +866,7 @@ if( UNIX ) endif() endif() -target_link_libraries( demolition ${DEMOLITION_LIBS} gdtoa lzma duke3d blood rr sw zmusic ) +target_link_libraries( demolition ${DEMOLITION_LIBS} gdtoa lzma duke3d blood rr sw exhumed zmusic ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/source/common/ns.h b/source/common/ns.h index e7a3b0d85..af3ae9f65 100644 --- a/source/common/ns.h +++ b/source/common/ns.h @@ -14,6 +14,9 @@ #define BEGIN_SW_NS namespace ShadowWarrior { #define END_SW_NS } +#define BEGIN_PS_NS namespace Powerslave { +#define END_PS_NS } + #else #define BEGIN_DUKE_NS @@ -28,6 +31,9 @@ #define BEGIN_SW_NS #define END_SW_NS +#define BEGIN_PS_NS +#define END_PS_NS + #endif #ifndef APPNAME diff --git a/source/exhumed/CMakeLists.txt b/source/exhumed/CMakeLists.txt new file mode 100644 index 000000000..11dc103f2 --- /dev/null +++ b/source/exhumed/CMakeLists.txt @@ -0,0 +1,121 @@ +cmake_minimum_required( VERSION 3.1.0 ) + +if (MSVC) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" ) +endif() + +include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" ) + +if (WIN32) + include_directories( "${ZLIB_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2" ) +else () +include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}") +endif() + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/../build/include + ${CMAKE_CURRENT_SOURCE_DIR}/../mact/include + ${CMAKE_CURRENT_SOURCE_DIR}/../audiolib/include + ${CMAKE_CURRENT_SOURCE_DIR}/../libsmackerdec/include + ${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/include + ${CMAKE_CURRENT_SOURCE_DIR}/../common + ${CMAKE_CURRENT_SOURCE_DIR}/../common/utility + ${CMAKE_CURRENT_SOURCE_DIR}/../common/console + ${CMAKE_CURRENT_SOURCE_DIR}/../common/textures + ${CMAKE_CURRENT_SOURCE_DIR}/../common/fonts + ${CMAKE_CURRENT_SOURCE_DIR}/../common/2d + ${CMAKE_CURRENT_SOURCE_DIR}/../common/music + ${CMAKE_CURRENT_SOURCE_DIR}/../platform +) + + + +#set( NOT_COMPILED_SOURCE_FILES +# src/gamestructures.cpp +#) + +#set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE ) + +set( PCH_SOURCES + src/aistuff.cpp + src/anims.cpp + src/anubis.cpp + src/bubbles.cpp + src/bullet.cpp + src/cd.cpp + src/cdaudio.cpp + src/cdrom.cpp + src/config.cpp + src/enginesubs.cpp + src/exhumed.cpp + src/exscript.cpp + src/fish.cpp + src/grenade.cpp + src/grpscan.cpp + src/gun.cpp + src/init.cpp + src/input.cpp + src/items.cpp + src/lavadude.cpp + src/light.cpp + src/lighting.cpp + src/lion.cpp + src/main.cpp + src/map.cpp + src/menu.cpp + src/mono.cpp + src/move.cpp + src/movie.cpp + src/mummy.cpp + src/network.cpp + src/object.cpp + src/osdcmds.cpp + src/paul.cpp + src/player.cpp + src/queen.cpp + src/ra.cpp + src/random.cpp + src/rat.cpp + src/record.cpp + src/rex.cpp + src/roach.cpp + src/runlist.cpp + src/save.cpp + src/scorp.cpp + src/sequence.cpp + src/serial.cpp + src/set.cpp + src/snake.cpp + src/sound.cpp + src/spider.cpp + src/status.cpp + src/stream.cpp + src/switch.cpp + src/text2.cpp + src/timer.cpp + src/trigdat.cpp + src/version.cpp + src/view.cpp + src/wasp.cpp +) + +if( MSVC ) + enable_precompiled_headers( ../g_pch.h PCH_SOURCES ) + # The original Build code was written with unsigned chars and unfortunately they still haven't been eliminated entirely. + # All other code should stay with signed chars. What a mess... :( + #set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "/J" ) +else() + # Temporary solution for compilers other than MSVC + set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "-include g_pch.h" ) +endif() + +file( GLOB HEADER_FILES + src/*.h + ) +add_library( exhumed STATIC + ${HEADER_FILES} + ${PCH_SOURCES} + #${NOT_COMPILED_SOURCE_FILES} + ) + + diff --git a/source/exhumed/src/aistuff.cpp b/source/exhumed/src/aistuff.cpp index 0109727cd..0d69f1c5f 100644 --- a/source/exhumed/src/aistuff.cpp +++ b/source/exhumed/src/aistuff.cpp @@ -15,8 +15,11 @@ 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" #include "aistuff.h" + +BEGIN_PS_NS + extern int localclock; int TimeSlot[KMaxTimeSlots]; @@ -64,3 +67,4 @@ int GrabTimeSlot(int nVal) } #endif } +END_PS_NS diff --git a/source/exhumed/src/aistuff.h b/source/exhumed/src/aistuff.h index ba37156ee..c5365b31c 100644 --- a/source/exhumed/src/aistuff.h +++ b/source/exhumed/src/aistuff.h @@ -39,9 +39,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "lavadude.h" #include "bullet.h" +BEGIN_PS_NS + #define KMaxTimeSlots 16 void InitTimeSlot(); int GrabTimeSlot(int nVal); +END_PS_NS + #endif diff --git a/source/exhumed/src/anims.cpp b/source/exhumed/src/anims.cpp index 20cecb00f..2caa62881 100644 --- a/source/exhumed/src/anims.cpp +++ b/source/exhumed/src/anims.cpp @@ -15,7 +15,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" #include "engine.h" #include "anims.h" #include "sequence.h" @@ -26,6 +26,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "init.h" #include +BEGIN_PS_NS + + #define kMaxAnims 400 short nMagicSeq = -1; @@ -329,3 +332,4 @@ int BuildSplash(int nSprite, int nSector) return AnimList[nAnim].nSprite; } +END_PS_NS diff --git a/source/exhumed/src/anims.h b/source/exhumed/src/anims.h index 02cb6b7b4..43b80e5e1 100644 --- a/source/exhumed/src/anims.h +++ b/source/exhumed/src/anims.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + struct Anim { short nSeq; @@ -41,4 +43,6 @@ void FuncAnim(int, int, int); void BuildExplosion(short nSprite); int BuildSplash(int nSprite, int nSector); +END_PS_NS + #endif diff --git a/source/exhumed/src/anubis.cpp b/source/exhumed/src/anubis.cpp index bcb0bc679..16dac1b16 100644 --- a/source/exhumed/src/anubis.cpp +++ b/source/exhumed/src/anubis.cpp @@ -15,7 +15,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" #include "exhumed.h" #include "anubis.h" #include "engine.h" @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trigdat.h" #include +BEGIN_PS_NS + #define kMaxAnubis 80 struct Anubis @@ -486,3 +488,4 @@ void FuncAnubis(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/anubis.h b/source/exhumed/src/anubis.h index 4801677a4..208b9e2bb 100644 --- a/source/exhumed/src/anubis.h +++ b/source/exhumed/src/anubis.h @@ -21,9 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + void InitAnubis(); int BuildAnubis(int nSprite, int x, int y, int z, int nSector, int nAngle, uint8_t bIsDrummer); void FuncAnubis(int a, int b, int c); +END_PS_NS + #endif diff --git a/source/exhumed/src/bubbles.cpp b/source/exhumed/src/bubbles.cpp index 9c9be0ffb..29d2bf707 100644 --- a/source/exhumed/src/bubbles.cpp +++ b/source/exhumed/src/bubbles.cpp @@ -15,7 +15,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" #include "bubbles.h" #include "runlist.h" #include "exhumed.h" @@ -29,6 +29,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "anims.h" #include +BEGIN_PS_NS + + #define kMaxBubbles 200 #define kMaxMachines 125 @@ -238,3 +241,4 @@ void DoBubbles(int nPlayer) sprite[nSprite].hitag = nPlayer; } +END_PS_NS diff --git a/source/exhumed/src/bubbles.h b/source/exhumed/src/bubbles.h index d35082fa9..af609ab39 100644 --- a/source/exhumed/src/bubbles.h +++ b/source/exhumed/src/bubbles.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __bubbles_h__ #define __bubbles_h__ +BEGIN_PS_NS + void InitBubbles(); void BuildBubbleMachine(int nSprite); @@ -27,4 +29,6 @@ void DoBubbleMachines(); void DoBubbles(int nPlayer); void FuncBubble(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/bullet.cpp b/source/exhumed/src/bullet.cpp index ca86c2115..e0d13b0c0 100644 --- a/source/exhumed/src/bullet.cpp +++ b/source/exhumed/src/bullet.cpp @@ -15,7 +15,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" #include "engine.h" #include "bullet.h" #include "runlist.h" @@ -40,6 +40,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #endif +BEGIN_PS_NS + #define kMaxBullets 500 short BulletFree[kMaxBullets]; @@ -848,3 +850,4 @@ void FuncBullet(int a, int b, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/bullet.h b/source/exhumed/src/bullet.h index a8592fd28..c51ea97a6 100644 --- a/source/exhumed/src/bullet.h +++ b/source/exhumed/src/bullet.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __bullet_h__ #define __bullet_h__ +BEGIN_PS_NS + // 32 bytes struct bulletInfo { @@ -52,4 +54,6 @@ void IgniteSprite(int nSprite); void FuncBullet(int, int, int); void BackUpBullet(int *x, int *y, short nAngle); +END_PS_NS + #endif diff --git a/source/exhumed/src/cd.cpp b/source/exhumed/src/cd.cpp index b6329a691..db5d46ed1 100644 --- a/source/exhumed/src/cd.cpp +++ b/source/exhumed/src/cd.cpp @@ -15,13 +15,15 @@ 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" #include "compat.h" #include "baselayer.h" #include "cd.h" #include #include +BEGIN_PS_NS + extern short word_9AC30; int cd_check_device_present() @@ -71,4 +73,5 @@ int CDplaying() void StopCD() { -} \ No newline at end of file +} +END_PS_NS diff --git a/source/exhumed/src/cd.h b/source/exhumed/src/cd.h index 9ab2c99dc..9a2300cbc 100644 --- a/source/exhumed/src/cd.h +++ b/source/exhumed/src/cd.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __cd_h__ #define __cd_h__ +BEGIN_PS_NS + int initcdaudio(); void setCDaudiovolume(int val); int playCDtrack(int nTrack); @@ -27,4 +29,6 @@ int StepFadeCDaudio(); int CDplaying(); void StopCD(); +END_PS_NS + #endif diff --git a/source/exhumed/src/cdaudio.cpp b/source/exhumed/src/cdaudio.cpp index 0dc6f6ec0..fb9fa425a 100644 --- a/source/exhumed/src/cdaudio.cpp +++ b/source/exhumed/src/cdaudio.cpp @@ -15,9 +15,11 @@ 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" #include "cdaudio.h" +BEGIN_PS_NS + int fadecdaudio() { /* TODO @@ -40,3 +42,4 @@ void CheckCD() { } +END_PS_NS diff --git a/source/exhumed/src/cdaudio.h b/source/exhumed/src/cdaudio.h index 09edb9131..6a012429a 100644 --- a/source/exhumed/src/cdaudio.h +++ b/source/exhumed/src/cdaudio.h @@ -19,7 +19,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __cdaudio_h__ #define __cdaudio_h__ +BEGIN_PS_NS + void CheckCD(); int fadecdaudio(); +END_PS_NS + #endif diff --git a/source/exhumed/src/cdrom.cpp b/source/exhumed/src/cdrom.cpp index b951bd69f..e80ba83c8 100644 --- a/source/exhumed/src/cdrom.cpp +++ b/source/exhumed/src/cdrom.cpp @@ -15,9 +15,11 @@ 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" #include "cdrom.h" +BEGIN_PS_NS + int checkcdrom() { return 1; @@ -27,3 +29,4 @@ char GetCDDriveLetter() { return 'D'; } +END_PS_NS diff --git a/source/exhumed/src/cdrom.h b/source/exhumed/src/cdrom.h index 66529eaad..b5d329499 100644 --- a/source/exhumed/src/cdrom.h +++ b/source/exhumed/src/cdrom.h @@ -19,7 +19,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __cdrom_h__ #define __cdrom_h__ +BEGIN_PS_NS + int checkcdrom(); char GetCDDriveLetter(); +END_PS_NS + #endif diff --git a/source/exhumed/src/config.cpp b/source/exhumed/src/config.cpp index c20f9ea59..eae9707e6 100644 --- a/source/exhumed/src/config.cpp +++ b/source/exhumed/src/config.cpp @@ -15,7 +15,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" #include "compat.h" #include "renderlayer.h" #include "_control.h" @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + const char gamefunctions[kMaxGameFunctions][kMaxGameFuncLen] = { "Move_Forward", @@ -1016,3 +1018,4 @@ void CONFIG_WriteSetup(uint32_t flags) CONFIG_WriteSettings(); Bfflush(NULL); } +END_PS_NS diff --git a/source/exhumed/src/config.h b/source/exhumed/src/config.h index e9bc6255c..10e5f0a6a 100644 --- a/source/exhumed/src/config.h +++ b/source/exhumed/src/config.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + #define kMaxGameFunctions 40 #define kMaxGameFuncLen 64 @@ -154,4 +156,6 @@ void CONFIG_SetDefaultKeys(const char(*keyptr)[kMaxGameFuncLen], bool lazy=false void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2); int32_t CONFIG_FunctionNameToNum(const char* func); +END_PS_NS + #endif diff --git a/source/exhumed/src/engine.h b/source/exhumed/src/engine.h index bb143f4d5..1c3d804b0 100644 --- a/source/exhumed/src/engine.h +++ b/source/exhumed/src/engine.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "typedefs.h" #include "trigdat.h" +BEGIN_PS_NS + #define kMaxTiles 6144 #define kMaxSprites 4096 #define kMaxSectors 1024 @@ -60,4 +62,6 @@ void resettiming(); void printext(int x, int y, const char* buffer, short tilenum, char invisiblecol); void kensetpalette(unsigned char *vgapal); +END_PS_NS + #endif diff --git a/source/exhumed/src/enginesubs.cpp b/source/exhumed/src/enginesubs.cpp index 52784ad7f..57ea6d140 100644 --- a/source/exhumed/src/enginesubs.cpp +++ b/source/exhumed/src/enginesubs.cpp @@ -15,7 +15,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" #include "engine.h" //#include @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // static int globhiz, globloz, globhihit, globlohit; +BEGIN_PS_NS + void overwritesprite(int thex, int they, short tilenum, signed char shade, char stat, char dapalnum) { @@ -147,3 +149,4 @@ void precache() } } } +END_PS_NS diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 924a28ec6..299c482df 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -15,7 +15,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" #include "compat.h" #include "baselayer.h" #include "renderlayer.h" @@ -81,6 +81,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # include "winbits.h" #endif /* _WIN32 */ +BEGIN_PS_NS + + #ifdef __cplusplus extern "C" { #endif @@ -4468,3 +4471,4 @@ int DoSpiritHead() return 0; } #endif +END_PS_NS diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 882f6ef8d..ee1c16b59 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "vfs.h" #include "grpscan.h" +BEGIN_PS_NS + #define kTimerTicks 120 #ifdef __WATCOMC__ @@ -243,4 +245,6 @@ extern int loaddefinitions_game(const char* fn, int32_t preload); void G_LoadGroupsInDir(const char* dirname); void G_DoAutoload(const char* dirname); +END_PS_NS + #endif diff --git a/source/exhumed/src/exscript.cpp b/source/exhumed/src/exscript.cpp index 83f1045fa..f665817a4 100644 --- a/source/exhumed/src/exscript.cpp +++ b/source/exhumed/src/exscript.cpp @@ -15,7 +15,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" // Our replacement for the MACT scripting library as the one Exhumed/Powerslave uses is from an older version. This code is based on that older version #include "typedefs.h" @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + #if 0 // 16 bytes in size? @@ -439,3 +441,4 @@ void LoadScript(char *filename, int nVal) } #endif +END_PS_NS diff --git a/source/exhumed/src/fish.cpp b/source/exhumed/src/fish.cpp index bbea5b313..4117fac66 100644 --- a/source/exhumed/src/fish.cpp +++ b/source/exhumed/src/fish.cpp @@ -15,7 +15,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" #include "fish.h" #include "anims.h" #include "engine.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include +BEGIN_PS_NS + #define kMaxFishes 128 #define kMaxChunks 128 @@ -586,3 +588,4 @@ void FuncFish(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/fish.h b/source/exhumed/src/fish.h index b29d0a859..6a3d2bc95 100644 --- a/source/exhumed/src/fish.h +++ b/source/exhumed/src/fish.h @@ -19,10 +19,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __fish_h__ #define __fish_h__ +BEGIN_PS_NS + void InitFishes(); int BuildFish(int nSprite, int x, int y, int z, int nSector, int nAngle); void FuncFish(int, int, int); void FuncFishLimb(int a, int b, int c); +END_PS_NS + #endif diff --git a/source/exhumed/src/grenade.cpp b/source/exhumed/src/grenade.cpp index b546b7c87..7f9f2e283 100644 --- a/source/exhumed/src/grenade.cpp +++ b/source/exhumed/src/grenade.cpp @@ -15,7 +15,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" #include "grenade.h" #include "engine.h" #include "player.h" @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "random.h" #include +BEGIN_PS_NS + int nGrenadeCount = 0; int nGrenadesFree; @@ -434,3 +436,4 @@ void FuncGrenade(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/grenade.h b/source/exhumed/src/grenade.h index 7100ac1b6..a7d783cef 100644 --- a/source/exhumed/src/grenade.h +++ b/source/exhumed/src/grenade.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __grenade_h__ #define __grenade_h__ +BEGIN_PS_NS + #define kMaxGrenades 50 void InitGrenades(); @@ -27,4 +29,6 @@ void DestroyGrenade(short nGrenade); int ThrowGrenade(short nPlayer, int edx, int ebx, int ecx, int push1); void FuncGrenade(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/grpscan.cpp b/source/exhumed/src/grpscan.cpp index a063a1410..4466dad71 100644 --- a/source/exhumed/src/grpscan.cpp +++ b/source/exhumed/src/grpscan.cpp @@ -19,7 +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" #include "baselayer.h" #include "cache1d.h" #include "exhumed.h" @@ -31,6 +31,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "vfs.h" +BEGIN_PS_NS + + #ifndef EDUKE32_STANDALONE static void process_vaca13(int32_t crcval); static void process_vacapp15(int32_t crcval); @@ -470,3 +473,4 @@ void FreeGroups(void) FreeGameList(); } +END_PS_NS diff --git a/source/exhumed/src/grpscan.h b/source/exhumed/src/grpscan.h index 34a4f53d4..4616f2f85 100644 --- a/source/exhumed/src/grpscan.h +++ b/source/exhumed/src/grpscan.h @@ -23,9 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef grpscan_h_ #define grpscan_h_ -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_PS_NS #define MAXLISTNAMELEN 32 @@ -77,8 +75,6 @@ extern grpfile_t * FindGroup(int32_t crcval); int32_t ScanGroups(void); void FreeGroups(void); -#ifdef __cplusplus -} -#endif +END_PS_NS #endif diff --git a/source/exhumed/src/gun.cpp b/source/exhumed/src/gun.cpp index 8e55c9c4d..9af55f69a 100644 --- a/source/exhumed/src/gun.cpp +++ b/source/exhumed/src/gun.cpp @@ -15,7 +15,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" #include "gun.h" #include "engine.h" #include "init.h" @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + /* struct Weapon { @@ -1120,3 +1122,4 @@ void DrawWeapons(int smooth) } } } +END_PS_NS diff --git a/source/exhumed/src/gun.h b/source/exhumed/src/gun.h index d689d2e8a..4058ae687 100644 --- a/source/exhumed/src/gun.h +++ b/source/exhumed/src/gun.h @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "sequence.h" +BEGIN_PS_NS + #define kMaxWeapons 7 enum @@ -64,4 +66,6 @@ void CheckClip(short nPlayer); void MoveWeapons(short nPlayer); void DrawWeapons(int smooth); +END_PS_NS + #endif diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index dba7dd39e..fd75808b3 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -15,7 +15,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" #include "compat.h" #include "keyboard.h" #include "control.h" @@ -45,6 +45,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + enum { kTagRamses = 61, @@ -1272,3 +1274,4 @@ int mysaveconfig() fclose(fp); return 1; } +END_PS_NS diff --git a/source/exhumed/src/init.h b/source/exhumed/src/init.h index d9a184b10..33b4847fb 100644 --- a/source/exhumed/src/init.h +++ b/source/exhumed/src/init.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + #define kMap20 20 enum { @@ -62,5 +64,6 @@ void LoadObjects(); int myloadconfig(); int mysaveconfig(); +END_PS_NS #endif diff --git a/source/exhumed/src/input.cpp b/source/exhumed/src/input.cpp index 11530951d..44379b185 100644 --- a/source/exhumed/src/input.cpp +++ b/source/exhumed/src/input.cpp @@ -15,7 +15,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" #include "input.h" #include "engine.h" #include "exhumed.h" @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "config.h" #include +BEGIN_PS_NS + int nNetMoves = 0; short nInputStack = 0; @@ -228,4 +230,5 @@ int WaitAnyKey(int nSecs) Name: _pStackPtr Name: _sInputStack - */ \ No newline at end of file + */ + END_PS_NS diff --git a/source/exhumed/src/input.h b/source/exhumed/src/input.h index c09b1dd70..b27185990 100644 --- a/source/exhumed/src/input.h +++ b/source/exhumed/src/input.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + enum { kButtonJump = 0x1, kButtonOpen = 0x4, @@ -63,4 +65,6 @@ void GetLocalInput(); extern PlayerInput sPlayerInput[]; extern int nNetMoves; +END_PS_NS + #endif diff --git a/source/exhumed/src/items.cpp b/source/exhumed/src/items.cpp index b9ea9816e..1a1fc56bf 100644 --- a/source/exhumed/src/items.cpp +++ b/source/exhumed/src/items.cpp @@ -15,7 +15,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" #include "items.h" #include "anims.h" #include "player.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "input.h" #include "object.h" +BEGIN_PS_NS + struct AnimInfo { short a; @@ -495,3 +497,4 @@ void DoRegenerates() } } } +END_PS_NS diff --git a/source/exhumed/src/items.h b/source/exhumed/src/items.h index ec333897d..961d6479d 100644 --- a/source/exhumed/src/items.h +++ b/source/exhumed/src/items.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __items_h__ #define __items_h__ +BEGIN_PS_NS + enum { kItemHeart = 0, @@ -49,4 +51,6 @@ void InitItems(); void StartRegenerate(short nSprite); void DoRegenerates(); +END_PS_NS + #endif diff --git a/source/exhumed/src/lavadude.cpp b/source/exhumed/src/lavadude.cpp index fb1841754..9d96cf203 100644 --- a/source/exhumed/src/lavadude.cpp +++ b/source/exhumed/src/lavadude.cpp @@ -15,7 +15,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" #include "engine.h" #include "lavadude.h" #include "random.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include +BEGIN_PS_NS + #define kMaxLavas 20 struct Lava @@ -514,3 +516,4 @@ void FuncLava(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/lavadude.h b/source/exhumed/src/lavadude.h index 9152eff54..8be004d66 100644 --- a/source/exhumed/src/lavadude.h +++ b/source/exhumed/src/lavadude.h @@ -19,10 +19,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __lavadude_h__ #define __lavadude_h__ +BEGIN_PS_NS + void InitLava(); int BuildLava(short nSprite, int x, int y, int z, short nSector, short nAngle, int lastArg); int BuildLavaLimb(int nSprite, int edx, int ebx); void FuncLavaLimb(int, int, int); void FuncLava(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/light.cpp b/source/exhumed/src/light.cpp index cb9634468..f94e7c8d3 100644 --- a/source/exhumed/src/light.cpp +++ b/source/exhumed/src/light.cpp @@ -15,7 +15,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" #include "light.h" #include "engine.h" #include "exhumed.h" @@ -26,6 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + #define kMaxGrads 12 const char *GradList[kMaxGrads] = { @@ -745,3 +747,4 @@ void SetOverscan(int id) DoOverscanSet(overscanindex); } +END_PS_NS diff --git a/source/exhumed/src/light.h b/source/exhumed/src/light.h index e7c547811..5c65fae0e 100644 --- a/source/exhumed/src/light.h +++ b/source/exhumed/src/light.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + void MyLoadPalette(); int LoadPaletteLookups(); void WaitVBL(); @@ -41,4 +43,6 @@ extern char *origpalookup[]; extern short nPalDiff; +END_PS_NS + #endif diff --git a/source/exhumed/src/lighting.cpp b/source/exhumed/src/lighting.cpp index 069acc08a..8800a1365 100644 --- a/source/exhumed/src/lighting.cpp +++ b/source/exhumed/src/lighting.cpp @@ -15,7 +15,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" #include "typedefs.h" #include "lighting.h" #include "player.h" @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + #define kMaxFlashes 2000 #define kMaxFlickerMask 25 #define kMaxGlows 50 @@ -776,3 +778,5 @@ void BuildFlash(short nPlayer, short nSector, int nVal) flash = -nVal; // ??? } } + +END_PS_NS diff --git a/source/exhumed/src/lighting.h b/source/exhumed/src/lighting.h index aded34d95..fdd146486 100644 --- a/source/exhumed/src/lighting.h +++ b/source/exhumed/src/lighting.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __lighting_h__ #define __lighting_h__ +BEGIN_PS_NS + extern short nFlashDepth; void InitLights(); @@ -33,4 +35,6 @@ void AddFlicker(short nSector, int nVal); extern short bTorch; +END_PS_NS + #endif \ No newline at end of file diff --git a/source/exhumed/src/lion.cpp b/source/exhumed/src/lion.cpp index 63c3a40bc..5c5ba7e39 100644 --- a/source/exhumed/src/lion.cpp +++ b/source/exhumed/src/lion.cpp @@ -15,7 +15,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" #include "lion.h" #include "engine.h" #include "runlist.h" @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "items.h" #include +BEGIN_PS_NS + #define kMaxLions 40 short LionCount = -1; @@ -590,3 +592,4 @@ void FuncLion(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/lion.h b/source/exhumed/src/lion.h index 991c9190e..b074cab75 100644 --- a/source/exhumed/src/lion.h +++ b/source/exhumed/src/lion.h @@ -19,8 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __lion_h__ #define __lion_h__ +BEGIN_PS_NS + void InitLion(); int BuildLion(short nSprite, int x, int y, int z, short nSector, short nAngle); void FuncLion(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/map.cpp b/source/exhumed/src/map.cpp index 94300f64a..5d8e27ef9 100644 --- a/source/exhumed/src/map.cpp +++ b/source/exhumed/src/map.cpp @@ -15,7 +15,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" #include "typedefs.h" #include #include "player.h" @@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "view.h" +BEGIN_PS_NS + + short bShowTowers = kTrue; //kFalse; REVERT to kFalse int ldMapZoom; int lMapZoom; @@ -625,3 +628,4 @@ void DrawMap() G_DrawOverheadMap(initx, inity, lMapZoom, inita); } } +END_PS_NS diff --git a/source/exhumed/src/map.h b/source/exhumed/src/map.h index aa9d585b9..359dca0ca 100644 --- a/source/exhumed/src/map.h +++ b/source/exhumed/src/map.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + extern short bShowTowers; extern int ldMapZoom; extern int lMapZoom; @@ -30,4 +32,6 @@ void GrabMap(); void UpdateMap(); void DrawMap(); +END_PS_NS + #endif diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index abd94315b..98c02f0fe 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -15,7 +15,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" #include "compat.h" #include "build.h" #include "exhumed.h" @@ -46,6 +46,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #endif +BEGIN_PS_NS + + #define kSaveFileName "savgamea.sav" #define kMaxSaveSlots 5 #define kMaxSaveSlotChars 25 @@ -2420,3 +2423,4 @@ LABEL_28: MySetView(nViewLeft, nViewTop, nViewRight, nViewBottom); MaskStatus(); } +END_PS_NS diff --git a/source/exhumed/src/menu.h b/source/exhumed/src/menu.h index 644d7584b..ecef7ca78 100644 --- a/source/exhumed/src/menu.h +++ b/source/exhumed/src/menu.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "typedefs.h" #include +BEGIN_PS_NS + #pragma pack(1) // should be 75 bytes struct GameStat @@ -74,4 +76,6 @@ void DoAfterCinemaScene(int nLevel); void InitEnergyTile(); +END_PS_NS + #endif diff --git a/source/exhumed/src/mono.cpp b/source/exhumed/src/mono.cpp index 86fda76ba..77e7bf72b 100644 --- a/source/exhumed/src/mono.cpp +++ b/source/exhumed/src/mono.cpp @@ -15,7 +15,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" /* Name: MonoClear_ address = 0001:0001CF5A @@ -66,5 +66,9 @@ kind: (data) */ #include "mono.h" +BEGIN_PS_NS + int rowCur = 0; int colCur = 0; + +END_PS_NS diff --git a/source/exhumed/src/move.cpp b/source/exhumed/src/move.cpp index a71a28e96..80ae9e9e2 100644 --- a/source/exhumed/src/move.cpp +++ b/source/exhumed/src/move.cpp @@ -15,7 +15,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" #include "engine.h" #include "exhumed.h" #include "move.h" @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //#include #endif +BEGIN_PS_NS + short NearSector[kMaxSectors] = { 0 }; short nPushBlocks; @@ -1498,3 +1500,4 @@ short UpdateEnemy(short *nEnemy) return *nEnemy; } +END_PS_NS diff --git a/source/exhumed/src/move.h b/source/exhumed/src/move.h index a7570d9ad..6ca531d75 100644 --- a/source/exhumed/src/move.h +++ b/source/exhumed/src/move.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __move_h__ #define __move_h__ +BEGIN_PS_NS + // 16 bytes struct BlockInfo { @@ -74,4 +76,6 @@ int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1); void SetQuake(short nSprite, int nVal); +END_PS_NS + #endif diff --git a/source/exhumed/src/movie.cpp b/source/exhumed/src/movie.cpp index f062bf475..c70d911d8 100644 --- a/source/exhumed/src/movie.cpp +++ b/source/exhumed/src/movie.cpp @@ -15,7 +15,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" #include "engine.h" #include "exhumed.h" #include "names.h" @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "typedefs.h" #include "keyboard.h" +BEGIN_PS_NS + enum { kFramePalette = 0, kFrameSound, @@ -235,3 +237,4 @@ void PlayMovie(const char *fileName) fclose(fp); } +END_PS_NS diff --git a/source/exhumed/src/movie.h b/source/exhumed/src/movie.h index ddffa4378..cad9d61cd 100644 --- a/source/exhumed/src/movie.h +++ b/source/exhumed/src/movie.h @@ -19,6 +19,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __movie_h__ #define __movie_h__ +BEGIN_PS_NS + void PlayMovie(const char *fileName); +END_PS_NS + #endif diff --git a/source/exhumed/src/mummy.cpp b/source/exhumed/src/mummy.cpp index 8507b629f..220a71b90 100644 --- a/source/exhumed/src/mummy.cpp +++ b/source/exhumed/src/mummy.cpp @@ -15,7 +15,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" #include "mummy.h" #include "sequence.h" #include "move.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include "engine.h" +BEGIN_PS_NS + short nMummies = -1; struct Mummy @@ -526,3 +528,4 @@ void FuncMummy(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/mummy.h b/source/exhumed/src/mummy.h index 77df73318..ceb2d0ce9 100644 --- a/source/exhumed/src/mummy.h +++ b/source/exhumed/src/mummy.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "runlist.h" +BEGIN_PS_NS + #define kMaxMummies 150 void InitMummy(); @@ -28,4 +30,6 @@ int BuildMummy(int val, int x, int y, int z, int nSector, int angle); void FuncMummy(int nSector, int edx, int nRun); +END_PS_NS + #endif diff --git a/source/exhumed/src/network.cpp b/source/exhumed/src/network.cpp index 91e0b5d49..d72a0b07f 100644 --- a/source/exhumed/src/network.cpp +++ b/source/exhumed/src/network.cpp @@ -15,7 +15,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" // this is net.c in the original code #include "typedefs.h" @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "serial.h" #include "input.h" +BEGIN_PS_NS + short nNetMoveFrames = 0; @@ -56,3 +58,4 @@ void UnInitNet() { } +END_PS_NS diff --git a/source/exhumed/src/network.h b/source/exhumed/src/network.h index 96adfd310..18a39fa8f 100644 --- a/source/exhumed/src/network.h +++ b/source/exhumed/src/network.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __network_h__ #define __network_h__ +BEGIN_PS_NS + extern short nNetMoveFrames; void SendGoodbye(); @@ -28,4 +30,6 @@ int InitSerial(); void AbortNetworkPlay(); void UnInitNet(); +END_PS_NS + #endif diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index e656ffc7c..cbc033518 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -15,7 +15,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" #include "engine.h" #include "object.h" #include "exhumed.h" @@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + #define kMaxBobs 200 #define kMaxDrips 50 #define kMaxMoveSects 50 @@ -2672,3 +2674,4 @@ void PostProcess() } } } +END_PS_NS diff --git a/source/exhumed/src/object.h b/source/exhumed/src/object.h index 08b3b184f..38d071eb9 100644 --- a/source/exhumed/src/object.h +++ b/source/exhumed/src/object.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __object_h__ #define __object_h__ +BEGIN_PS_NS + #define kMaxPoints 1024 #define kMaxSlides 128 #define kMaxElevs 1024 @@ -83,4 +85,6 @@ int BuildWallFace(short nChannel, short nWall, short nCount, ...); int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int arg3); +END_PS_NS + #endif diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index c9ef98e42..d4e1fd26c 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -19,7 +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" #include "compat.h" #include "build.h" #include "common.h" @@ -31,6 +31,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "vfs.h" +BEGIN_PS_NS + + static inline int osdcmd_quit(osdcmdptr_t UNUSED(parm)) { UNREFERENCED_CONST_PARAMETER(parm); @@ -123,27 +126,6 @@ static int osdcmd_initgroupfile(osdcmdptr_t parm) void onvideomodechange(int32_t newmode) { uint8_t palid = BASEPAL; - -#if 0 -#ifdef POLYMER - if (videoGetRenderMode() == REND_POLYMER) - { - int32_t i = 0; - - while (i < MAXSPRITES) - { - if (actor[i].lightptr) - { - polymer_deletelight(actor[i].lightId); - actor[i].lightptr = NULL; - actor[i].lightId = -1; - } - i++; - } - } -#endif -#endif - videoSetPalette(0, palid, 0); } @@ -160,207 +142,6 @@ static int osdcmd_button(osdcmdptr_t parm) return OSDCMD_OK; } -const char *const ConsoleButtons[] = -{ - "mouse1", "mouse2", "mouse3", "mouse4", "mwheelup", - "mwheeldn", "mouse5", "mouse6", "mouse7", "mouse8" -}; - -static int osdcmd_bind(osdcmdptr_t parm) -{ - char tempbuf[256]; - if (parm->numparms==1 && !Bstrcasecmp(parm->parms[0],"showkeys")) - { - for (auto & s : sctokeylut) - OSD_Printf("%s\n", s.key); - for (auto ConsoleButton : ConsoleButtons) - OSD_Printf("%s\n",ConsoleButton); - return OSDCMD_OK; - } - - if (parm->numparms==0) - { - int j=0; - - OSD_Printf("Current key bindings:\n"); - - for (int i=0; iparms[0], sctokeylut[i].key)) - break; - } - - // didn't find the key - if (i == ARRAY_SSIZE(sctokeylut)) - { - for (i=0; iparms[0],ConsoleButtons[i])) - break; - - if (i >= MAXMOUSEBUTTONS) - return OSDCMD_SHOWHELP; - - if (parm->numparms < 2) - { - if (CONTROL_KeyBinds[MAXBOUNDKEYS + i].cmdstr && CONTROL_KeyBinds[MAXBOUNDKEYS + i ].key) - OSD_Printf("%-9s %s\"%s\"\n", ConsoleButtons[i], CONTROL_KeyBinds[MAXBOUNDKEYS + i].repeat?"":"norepeat ", - CONTROL_KeyBinds[MAXBOUNDKEYS + i].cmdstr); - else OSD_Printf("%s is unbound\n", ConsoleButtons[i]); - return OSDCMD_OK; - } - - j = 1; - - repeat = 1; - if (!Bstrcasecmp(parm->parms[j],"norepeat")) - { - repeat = 0; - j++; - } - - Bstrcpy(tempbuf,parm->parms[j++]); - for (; jnumparms; j++) - { - Bstrcat(tempbuf," "); - Bstrcat(tempbuf,parm->parms[j++]); - } - - CONTROL_BindMouse(i, tempbuf, repeat, ConsoleButtons[i]); - - if (!OSD_ParsingScript()) - OSD_Printf("%s\n",parm->raw); - return OSDCMD_OK; - } - - if (parm->numparms < 2) - { - if (CONTROL_KeyIsBound(sctokeylut[i].sc)) - OSD_Printf("%-9s %s\"%s\"\n", sctokeylut[i].key, CONTROL_KeyBinds[sctokeylut[i].sc].repeat?"":"norepeat ", - CONTROL_KeyBinds[sctokeylut[i].sc].cmdstr); - else OSD_Printf("%s is unbound\n", sctokeylut[i].key); - - return OSDCMD_OK; - } - - j = 1; - - repeat = 1; - if (!Bstrcasecmp(parm->parms[j],"norepeat")) - { - repeat = 0; - j++; - } - - Bstrcpy(tempbuf,parm->parms[j++]); - for (; jnumparms; j++) - { - Bstrcat(tempbuf," "); - Bstrcat(tempbuf,parm->parms[j++]); - } - - CONTROL_BindKey(sctokeylut[i].sc, tempbuf, repeat, sctokeylut[i].key); - - char *cp = tempbuf; - - // Populate the keyboard config menu based on the bind. - // Take care of processing one-to-many bindings properly, too. - static char const s_gamefunc_[] = "gamefunc_"; - int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1; - - while ((cp = Bstrstr(cp, s_gamefunc_))) - { - cp += strlen_gamefunc_; - - char *semi = Bstrchr(cp, ';'); - - if (semi) - *semi = 0; - - j = CONFIG_FunctionNameToNum(cp); - - if (semi) - cp = semi+1; - - if (j != -1) - { - KeyboardKeys[j][1] = KeyboardKeys[j][0]; - KeyboardKeys[j][0] = sctokeylut[i].sc; -// CONTROL_MapKey(j, sctokeylut[i].sc, ud.config.KeyboardKeys[j][0]); - - if (j == gamefunc_Show_Console) - OSD_CaptureKey(sctokeylut[i].sc); - } - } - - if (!OSD_ParsingScript()) - OSD_Printf("%s\n",parm->raw); - - return OSDCMD_OK; -} - -static int osdcmd_unbindall(osdcmdptr_t UNUSED(parm)) -{ - UNREFERENCED_CONST_PARAMETER(parm); - - for (int i = 0; i < MAXBOUNDKEYS; ++i) - CONTROL_FreeKeyBind(i); - - for (int i = 0; i < MAXMOUSEBUTTONS; ++i) - CONTROL_FreeMouseBind(i); - - for (auto &KeyboardKey : KeyboardKeys) - KeyboardKey[0] = KeyboardKey[1] = 0xff; - - if (!OSD_ParsingScript()) - OSD_Printf("unbound all controls\n"); - - return OSDCMD_OK; -} - -static int osdcmd_unbind(osdcmdptr_t parm) -{ - if (parm->numparms != 1) - return OSDCMD_SHOWHELP; - - for (auto & ConsoleKey : sctokeylut) - { - if (ConsoleKey.key && !Bstrcasecmp(parm->parms[0], ConsoleKey.key)) - { - CONTROL_FreeKeyBind(ConsoleKey.sc); - OSD_Printf("unbound key %s\n", ConsoleKey.key); - return OSDCMD_OK; - } - } - - for (int i = 0; i < MAXMOUSEBUTTONS; i++) - { - if (!Bstrcasecmp(parm->parms[0], ConsoleButtons[i])) - { - CONTROL_FreeMouseBind(i); - OSD_Printf("unbound %s\n", ConsoleButtons[i]); - return OSDCMD_OK; - } - } - - return OSDCMD_SHOWHELP; -} - static int osdcmd_unbound(osdcmdptr_t parm) { if (parm->numparms != 1) @@ -392,31 +173,12 @@ static int osdcmd_cvar_set_game(osdcmdptr_t parm) if (r != OSDCMD_OK) return r; - // TODO: - /*if (!Bstrcasecmp(parm->name, "r_upscalefactor")) - { - if (in3dmode()) - { - videoSetGameMode(fullscreen, xres, yres, bpp, ud.detail); - } - } - else if (!Bstrcasecmp(parm->name, "r_size")) - { - ud.statusbarmode = (ud.screen_size < 8); - G_UpdateScreenArea(); - }*/ - else if (!Bstrcasecmp(parm->name, "r_maxfps") || !Bstrcasecmp(parm->name, "r_maxfpsoffset")) + if (!Bstrcasecmp(parm->name, "r_maxfps") || !Bstrcasecmp(parm->name, "r_maxfpsoffset")) { if (r_maxfps != 0) r_maxfps = clamp(r_maxfps, 30, 1000); g_frameDelay = calcFrameDelay(r_maxfps + r_maxfpsoffset); - }/* - else if (!Bstrcasecmp(parm->name, "r_ambientlight")) - { - if (r_ambientlight == 0) - r_ambientlightrecip = 256.f; - else r_ambientlightrecip = 1.f/r_ambientlight; } - else */if (!Bstrcasecmp(parm->name, "in_mouse")) + if (!Bstrcasecmp(parm->name, "in_mouse")) { CONTROL_MouseEnabled = (gSetup.usemouse && CONTROL_MousePresent); } @@ -424,91 +186,6 @@ static int osdcmd_cvar_set_game(osdcmdptr_t parm) { CONTROL_JoystickEnabled = (gSetup.usejoystick && CONTROL_JoyPresent); } - else if (!Bstrcasecmp(parm->name, "vid_gamma")) - { - // TODO - //ud.brightness = GAMMA_CALC; - //ud.brightness <<= 2; - //videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); - } - else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast")) - { - // TODO - //videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); - } - //else if (!Bstrcasecmp(parm->name, "hud_scale") - // || !Bstrcasecmp(parm->name, "hud_statusbarmode") - // || !Bstrcasecmp(parm->name, "r_rotatespritenowidescreen")) - //{ - // G_UpdateScreenArea(); - //} - //else if (!Bstrcasecmp(parm->name, "skill")) - //{ - // if (numplayers > 1) - // return r; - // - // ud.player_skill = ud.m_player_skill; - //} - //else if (!Bstrcasecmp(parm->name, "color")) - //{ - // ud.color = G_CheckPlayerColor(ud.color); - // g_player[0].ps->palookup = g_player[0].pcolor = ud.color; - //} - //else if (!Bstrcasecmp(parm->name, "osdscale")) - //{ - // osdrscale = 1.f/osdscale; - // - // if (xdim && ydim) - // OSD_ResizeDisplay(xdim, ydim); - //} - //else if (!Bstrcasecmp(parm->name, "wchoice")) - //{ - // if (parm->numparms == 1) - // { - // if (g_forceWeaponChoice) // rewrite ud.wchoice because osdcmd_cvar_set already changed it - // { - // int j = 0; - // - // while (j < 10) - // { - // ud.wchoice[j] = g_player[myconnectindex].wchoice[j] + '0'; - // j++; - // } - // - // ud.wchoice[j] = 0; - // } - // else - // { - // char const *c = parm->parms[0]; - // - // if (*c) - // { - // int j = 0; - // - // while (*c && j < 10) - // { - // g_player[myconnectindex].wchoice[j] = *c - '0'; - // c++; - // j++; - // } - // - // while (j < 10) - // { - // if (j == 9) - // g_player[myconnectindex].wchoice[9] = 1; - // else - // g_player[myconnectindex].wchoice[j] = 2; - // - // j++; - // } - // } - // } - // - // g_forceWeaponChoice = 0; - // } - // - // /* Net_SendClientInfo();*/ - //} return r; } @@ -699,22 +376,6 @@ int32_t registerosdcommands(void) //OSD_RegisterFunction("activatecheat","activatecheat : activates a cheat code", osdcmd_activatecheat); OSD_RegisterFunction("initgroupfile","initgroupfile : adds a grp file into the game filesystem", osdcmd_initgroupfile); -//#ifdef DEBUGGINGAIDS -// OSD_RegisterFunction("inittimer","debug", osdcmd_inittimer); -//#endif - //OSD_RegisterFunction("music","music EL: change music", osdcmd_music); - - //OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); - - - //OSD_RegisterFunction("printtimes", "printtimes: prints VM timing statistics", osdcmd_printtimes); - - //OSD_RegisterFunction("purgesaves", "purgesaves: deletes obsolete and unreadable save files", osdcmd_purgesaves); - - //OSD_RegisterFunction("quicksave","quicksave: performs a quick save", osdcmd_quicksave); - //OSD_RegisterFunction("quickload","quickload: performs a quick load", osdcmd_quickload); - OSD_RegisterFunction("quit","quit: exits the game immediately", osdcmd_quit); - OSD_RegisterFunction("exit","exit: exits the game immediately", osdcmd_quit); //OSD_RegisterFunction("restartmap", "restartmap: restarts the current map", osdcmd_restartmap); //OSD_RegisterFunction("restartsound","restartsound: reinitializes the sound system",osdcmd_restartsound); @@ -723,8 +384,6 @@ int32_t registerosdcommands(void) //OSD_RegisterFunction("spawn","spawn [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn); - OSD_RegisterFunction("unbind","unbind : unbinds a key", osdcmd_unbind); - OSD_RegisterFunction("unbindall","unbindall: unbinds all keys", osdcmd_unbindall); OSD_RegisterFunction("unbound", NULL, osdcmd_unbound); OSD_RegisterFunction("vidmode","vidmode : change the video mode",osdcmd_vidmode); @@ -753,3 +412,4 @@ void GAME_clearbackground(int numcols, int numrows) COMMON_clearbackground(numcols, numrows); } +END_PS_NS diff --git a/source/exhumed/src/osdcmds.h b/source/exhumed/src/osdcmds.h index 955a2a9e1..b028441e1 100644 --- a/source/exhumed/src/osdcmds.h +++ b/source/exhumed/src/osdcmds.h @@ -23,9 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef osdcmds_h_ #define osdcmds_h_ -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_PS_NS + int32_t registerosdcommands(void); void onvideomodechange(int32_t newmode); @@ -38,9 +37,7 @@ extern const char *const ConsoleButtons[]; //extern uint32_t cl_cheatmask; -#ifdef __cplusplus -} -#endif +END_PS_NS #endif // osdcmds_h_ diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index a36ac29e7..132a97433 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -15,7 +15,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" #include "compat.h" #include "player.h" #include "runlist.h" @@ -53,6 +53,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + struct PlayerSave { int x; @@ -3350,3 +3352,4 @@ do_default_b: } } } +END_PS_NS diff --git a/source/exhumed/src/player.h b/source/exhumed/src/player.h index fdbe28d41..1ac79976a 100644 --- a/source/exhumed/src/player.h +++ b/source/exhumed/src/player.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + void PlayerInterruptKeys(); void RestoreSavePoint(int nPlayer, int *x, int *y, int *z, short *nSector, short *nAngle); void SetSavePoint(int nPlayer, int x, int y, int z, short nSector, short nAngle); @@ -123,4 +125,6 @@ void SetPlayerMummified(int nPlayer, int bIsMummified); int AddAmmo(int nPlayer, int nWeapon, int nAmmoAmount); void ShootStaff(int nPlayer); +END_PS_NS + #endif diff --git a/source/exhumed/src/queen.cpp b/source/exhumed/src/queen.cpp index 9ce62c069..8fa7b2c07 100644 --- a/source/exhumed/src/queen.cpp +++ b/source/exhumed/src/queen.cpp @@ -15,7 +15,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" #include "exhumed.h" #include "aistuff.h" #include "engine.h" @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "names.h" #include +BEGIN_PS_NS + #define kMaxQueens 1 #define kMaxEggs 10 #define kMaxTails 7 @@ -1482,3 +1484,4 @@ void FuncQueen(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/queen.h b/source/exhumed/src/queen.h index a141466fd..67c7359b3 100644 --- a/source/exhumed/src/queen.h +++ b/source/exhumed/src/queen.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __queen_h__ #define __queen_h__ +BEGIN_PS_NS + void InitQueens(); int BuildQueen(int nSprite, int x, int y, int z, int nSector, int nAngle, int nVal); @@ -27,4 +29,6 @@ void FuncQueenEgg(int, int, int); void FuncQueenHead(int, int, int); void FuncQueen(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/ra.cpp b/source/exhumed/src/ra.cpp index e7eb9356e..a796f7003 100644 --- a/source/exhumed/src/ra.cpp +++ b/source/exhumed/src/ra.cpp @@ -15,7 +15,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" #include "ra.h" #include "runlist.h" #include "engine.h" @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "bullet.h" #include +BEGIN_PS_NS + /* bjd - the content of the ra.* files originally resided in gun.c I think... */ //#define kMaxRA 8 @@ -291,3 +293,4 @@ void FuncRa(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/ra.h b/source/exhumed/src/ra.h index 3815c84ca..4dbea3b6f 100644 --- a/source/exhumed/src/ra.h +++ b/source/exhumed/src/ra.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __ra_h__ #define __ra_h__ +BEGIN_PS_NS + struct RA { short field_0; @@ -39,4 +41,6 @@ void InitRa(); void MoveRaToEnemy(short nPlayer); void FuncRa(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/random.cpp b/source/exhumed/src/random.cpp index 1098d16dd..dff326b0d 100644 --- a/source/exhumed/src/random.cpp +++ b/source/exhumed/src/random.cpp @@ -15,9 +15,11 @@ 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" #include "random.h" +BEGIN_PS_NS + int randA = 0; int randB = 0x11111111; int randC = 0x1010101; @@ -78,3 +80,4 @@ int RandomSize(int nSize) return randSize; } +END_PS_NS diff --git a/source/exhumed/src/random.h b/source/exhumed/src/random.h index 611f0d39b..a6e847146 100644 --- a/source/exhumed/src/random.h +++ b/source/exhumed/src/random.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __random_h__ #define __random_h__ +BEGIN_PS_NS + void InitRandom(); int RandomBit(); char RandomByte(); @@ -26,4 +28,6 @@ short RandomWord(); int RandomLong(); int RandomSize(int nSize); +END_PS_NS + #endif diff --git a/source/exhumed/src/rat.cpp b/source/exhumed/src/rat.cpp index bbec0ab3e..233c19f5f 100644 --- a/source/exhumed/src/rat.cpp +++ b/source/exhumed/src/rat.cpp @@ -15,7 +15,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" #include "engine.h" #include "rat.h" #include "sequence.h" @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "move.h" #include +BEGIN_PS_NS + #define kMaxRats 50 short nMinChunk; @@ -398,3 +400,4 @@ void FuncRat(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/rat.h b/source/exhumed/src/rat.h index e2cd19d98..6bf83c85a 100644 --- a/source/exhumed/src/rat.h +++ b/source/exhumed/src/rat.h @@ -19,10 +19,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __rat_h__ #define __rat_h__ +BEGIN_PS_NS + void InitRats(); void SetRatVel(short nSprite); int BuildRat(short nSprite, int x, int y, int z, short nSector, int nAngle); int FindFood(short nSprite); void FuncRat(int a, int b, int nRun); +END_PS_NS + #endif diff --git a/source/exhumed/src/record.cpp b/source/exhumed/src/record.cpp index 62cebadac..9871a0139 100644 --- a/source/exhumed/src/record.cpp +++ b/source/exhumed/src/record.cpp @@ -15,7 +15,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" #include "compat.h" #include "record.h" #include "typedefs.h" @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + short record_mode = 0; int record_limit = -1; int record_index = 16384; @@ -168,3 +170,4 @@ int CloseRecord() fclose(record_file); return 1; } +END_PS_NS diff --git a/source/exhumed/src/record.h b/source/exhumed/src/record.h index c0a71b29e..8e12f12ad 100644 --- a/source/exhumed/src/record.h +++ b/source/exhumed/src/record.h @@ -19,6 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __record_h__ #define __record_h__ +BEGIN_PS_NS + + extern short record_mode; + +END_PS_NS + #endif diff --git a/source/exhumed/src/rex.cpp b/source/exhumed/src/rex.cpp index b5107c66d..c7f90cb0e 100644 --- a/source/exhumed/src/rex.cpp +++ b/source/exhumed/src/rex.cpp @@ -15,7 +15,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" #include "rex.h" #include "exhumed.h" #include "engine.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistuff.h" #include +BEGIN_PS_NS + #define kMaxRex 50 short RexCount = 0; @@ -475,3 +477,4 @@ void FuncRex(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/rex.h b/source/exhumed/src/rex.h index d5572eebe..4dfdb46c0 100644 --- a/source/exhumed/src/rex.h +++ b/source/exhumed/src/rex.h @@ -19,8 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __rex_h__ #define __rex_h__ +BEGIN_PS_NS + void InitRexs(); int BuildRex(short nSprite, int x, int y, int z, short nSector, short nAngle, int nVal); void FuncRex(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/roach.cpp b/source/exhumed/src/roach.cpp index 4b45242f0..1281f0f54 100644 --- a/source/exhumed/src/roach.cpp +++ b/source/exhumed/src/roach.cpp @@ -15,7 +15,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" #include "exhumed.h" #include "engine.h" #include "runlist.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "items.h" #include +BEGIN_PS_NS + #define kMaxRoach 100 int16_t RoachSprite = -1; @@ -409,3 +411,4 @@ void FuncRoach(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/roach.h b/source/exhumed/src/roach.h index 9eed2203f..ffe71b155 100644 --- a/source/exhumed/src/roach.h +++ b/source/exhumed/src/roach.h @@ -19,8 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __roach_h__ #define __roach_h__ +BEGIN_PS_NS + void InitRoachs(); int BuildRoach(int nType, int nSprite, int x, int y, int z, short nSector, int angle); void FuncRoach(int a, int nDamage, int nRun); +END_PS_NS + #endif diff --git a/source/exhumed/src/runlist.cpp b/source/exhumed/src/runlist.cpp index 625f7a193..421106169 100644 --- a/source/exhumed/src/runlist.cpp +++ b/source/exhumed/src/runlist.cpp @@ -15,7 +15,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" #include "exhumed.h" #include "engine.h" #include "runlist.h" @@ -49,6 +49,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "lighting.h" #include +BEGIN_PS_NS + //#define kFuncMax 0x260000 // the number 38 stored in the high word of an int #define kFuncMax 39 #define kMaxRunStack 200 @@ -1844,3 +1846,4 @@ void runlist_DamageEnemy(int nSprite, int nSprite2, short nDamage) nTauntTimer[nPlayer] = RandomSize(3) + 3; } } +END_PS_NS diff --git a/source/exhumed/src/runlist.h b/source/exhumed/src/runlist.h index faa78563f..543d7c9aa 100644 --- a/source/exhumed/src/runlist.h +++ b/source/exhumed/src/runlist.h @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + + #define kMaxRuns 25600 #define kMaxChannels 4096 @@ -78,4 +81,6 @@ void runlist_SignalRun(int NxtPtr, int edx); void runlist_CleanRunRecs(); void runlist_ExecObjects(); +END_PS_NS + #endif diff --git a/source/exhumed/src/save.cpp b/source/exhumed/src/save.cpp index 7eeeec19d..7590ae7c8 100644 --- a/source/exhumed/src/save.cpp +++ b/source/exhumed/src/save.cpp @@ -15,7 +15,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" #include "save.h" #include //#include @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //#include #include "engine.h" +BEGIN_PS_NS + int savegame(int nSlot) { char filename[92]; @@ -119,3 +121,4 @@ int loadgame(int nSlot) return 1; // CHECKME } +END_PS_NS diff --git a/source/exhumed/src/save.h b/source/exhumed/src/save.h index 8705b8aa7..a7a48dbb1 100644 --- a/source/exhumed/src/save.h +++ b/source/exhumed/src/save.h @@ -19,7 +19,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __save_h__ #define __save_h__ +BEGIN_PS_NS + int savegame(int nSlot); int loadgame(int nSlot); +END_PS_NS + #endif diff --git a/source/exhumed/src/scorp.cpp b/source/exhumed/src/scorp.cpp index 424738725..ca1bef335 100644 --- a/source/exhumed/src/scorp.cpp +++ b/source/exhumed/src/scorp.cpp @@ -15,7 +15,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" #include "engine.h" #include "scorp.h" #include "runlist.h" @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "spider.h" #include +BEGIN_PS_NS + /* Selkis Boss AI code */ @@ -503,3 +505,4 @@ FS_Red: sprite[nSprite].yvel = 0; } } +END_PS_NS diff --git a/source/exhumed/src/scorp.h b/source/exhumed/src/scorp.h index def468bcf..11667afad 100644 --- a/source/exhumed/src/scorp.h +++ b/source/exhumed/src/scorp.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + /* Selkis Boss AI code */ @@ -44,4 +46,6 @@ void InitScorp(); int BuildScorp(short nSprite, int x, int y, int z, short nSector, short nAngle, int nChannel); void FuncScorp(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/sequence.cpp b/source/exhumed/src/sequence.cpp index 1e7c36ec4..1ca59fc99 100644 --- a/source/exhumed/src/sequence.cpp +++ b/source/exhumed/src/sequence.cpp @@ -15,7 +15,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" #include "typedefs.h" #include "sequence.h" #include "engine.h" @@ -38,6 +38,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // TEMP #include +BEGIN_PS_NS + #define kMaxSequences 4096 #define kMaxSEQFiles 78 #define kMaxSEQFrames 18000 @@ -665,3 +667,4 @@ int seq_PlotSequence(short nSprite, short edx, short nFrame, short ecx) return nPict; } +END_PS_NS diff --git a/source/exhumed/src/sequence.h b/source/exhumed/src/sequence.h index 3d59b79ae..a6a306e16 100644 --- a/source/exhumed/src/sequence.h +++ b/source/exhumed/src/sequence.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +BEGIN_PS_NS + enum { kSeqRothands = 0, kSeqSword, @@ -140,4 +142,6 @@ int seq_PlotSequence(short nSprite, short edx, short nFrame, short ecx); int seq_PlotArrowSequence(short nSprite, short nSeq, int nVal); void seq_DrawPilotLightSeq(int xOffset, int yOffset); +END_PS_NS + #endif diff --git a/source/exhumed/src/serial.cpp b/source/exhumed/src/serial.cpp index 1b091f7cd..2cf20ee5a 100644 --- a/source/exhumed/src/serial.cpp +++ b/source/exhumed/src/serial.cpp @@ -15,10 +15,12 @@ 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" #include "typedefs.h" #include "serial.h" +BEGIN_PS_NS + short bSendBye = kFalse; @@ -41,3 +43,4 @@ void UnInitSerial() { } +END_PS_NS diff --git a/source/exhumed/src/serial.h b/source/exhumed/src/serial.h index 9743935bb..d86f9187b 100644 --- a/source/exhumed/src/serial.h +++ b/source/exhumed/src/serial.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __serial_h__ #define __serial_h__ +BEGIN_PS_NS + extern short bSendBye; void UpdateSerialInputs(); @@ -26,4 +28,6 @@ void ClearSerialInbuf(); void HangUp(); void UnInitSerial(); +END_PS_NS + #endif diff --git a/source/exhumed/src/set.cpp b/source/exhumed/src/set.cpp index 5b68b15bb..15f4233da 100644 --- a/source/exhumed/src/set.cpp +++ b/source/exhumed/src/set.cpp @@ -15,7 +15,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" #include "set.h" #include "engine.h" #include "exhumed.h" @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "bullet.h" #include +BEGIN_PS_NS + #define kMaxSets 10 short SetCount = 0; @@ -685,3 +687,4 @@ void FuncSet(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/set.h b/source/exhumed/src/set.h index e4c562223..74d4ddd45 100644 --- a/source/exhumed/src/set.h +++ b/source/exhumed/src/set.h @@ -19,9 +19,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __set_h__ #define __set_h__ +BEGIN_PS_NS + void InitSets(); int BuildSet(short nSprite, int x, int y, int z, short nSector, short nAngle, int nVal); void FuncSoul(int, int, int); void FuncSet(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/snake.cpp b/source/exhumed/src/snake.cpp index 8f1a4ff9d..72c4e5a19 100644 --- a/source/exhumed/src/snake.cpp +++ b/source/exhumed/src/snake.cpp @@ -15,7 +15,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" #include "engine.h" #include "exhumed.h" #include "snake.h" @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + #define kMaxSnakes 50 int nSnakeCount = 0; @@ -422,3 +424,4 @@ SEARCH_ENEMY: } } } +END_PS_NS diff --git a/source/exhumed/src/snake.h b/source/exhumed/src/snake.h index 8809830df..33a84cffa 100644 --- a/source/exhumed/src/snake.h +++ b/source/exhumed/src/snake.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __snake_h__ #define __snake_h__ +BEGIN_PS_NS + #define kSnakeSprites 8 // or rename to kSnakeParts? // 32bytes @@ -53,4 +55,6 @@ short GrabSnake(); int BuildSnake(short nPlayer, short zVal); void FuncSnake(int, int, int); +END_PS_NS + #endif diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index 3ee66b5df..091cbcbe8 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -15,7 +15,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" #include "compat.h" #include "baselayer.h" #include "renderlayer.h" // for win_gethwnd() @@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trigdat.h" #include "sequence.h" +BEGIN_PS_NS + #if 0 extern "C" { #include "usrhooks.h" @@ -1259,3 +1261,4 @@ void Unlock(void) } #endif +END_PS_NS diff --git a/source/exhumed/src/sound.h b/source/exhumed/src/sound.h index 5d4a784aa..b1387f1c0 100644 --- a/source/exhumed/src/sound.h +++ b/source/exhumed/src/sound.h @@ -19,6 +19,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __sound_h__ #define __sound_h__ +BEGIN_PS_NS + + #define kMaxSoundFiles 80 #define kMaxSounds 200 #define kMaxSoundNameLen 8 @@ -143,4 +146,6 @@ void PlayGameOverSound(void); void SoundBigEntrance(void); +END_PS_NS + #endif diff --git a/source/exhumed/src/spider.cpp b/source/exhumed/src/spider.cpp index 85439a7fb..cd4accf89 100644 --- a/source/exhumed/src/spider.cpp +++ b/source/exhumed/src/spider.cpp @@ -15,7 +15,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" #include "exhumed.h" #include "spider.h" #include "engine.h" @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trigdat.h" #include +BEGIN_PS_NS + short SpiderSprite = -1; short SpiderCount = 0; @@ -432,3 +434,4 @@ case_3: } } } +END_PS_NS diff --git a/source/exhumed/src/spider.h b/source/exhumed/src/spider.h index dcb24d1b3..072be0fb8 100644 --- a/source/exhumed/src/spider.h +++ b/source/exhumed/src/spider.h @@ -19,8 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __spider_h__ #define __spider_h__ +BEGIN_PS_NS + void InitSpider(); int BuildSpider(int nSprite, int x, int y, int z, short nSector, int angle); void FuncSpider(int a, int b, int nRun); +END_PS_NS + #endif diff --git a/source/exhumed/src/startgtk.game.cpp b/source/exhumed/src/startgtk.game.cpp deleted file mode 100644 index 0c3fc64d2..000000000 --- a/source/exhumed/src/startgtk.game.cpp +++ /dev/null @@ -1,887 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010 EDuke32 developers and contributors - -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 "build.h" -#include "common.h" -#include "compat.h" -#include "keyboard.h" -#include "control.h" -#include "config.h" -#include "exhumed.h" -#include "dynamicgtk.h" -#include "grpscan.h" -#include "gtkpixdata.h" - -enum -{ - NONE, - ALL, - POPULATE_VIDEO, - POPULATE_CONFIG, - POPULATE_GAME, -}; - -enum -{ - TAB_CONFIG, - TAB_GAME, - TAB_MESSAGES, -}; - -enum -{ - INPUT_KB, - INPUT_MOUSE, - INPUT_JOYSTICK, - INPUT_ALL, -}; - -static struct -{ - GtkWidget *startwin; - GtkWidget *hlayout; - GtkWidget *banner; - GtkWidget *vlayout; - GtkWidget *tabs; - GtkWidget *configtlayout; - GtkWidget *displayvlayout; - GtkWidget *vmode3dlabel; - GtkWidget *vmode3dcombo; - GtkWidget *fullscreencheck; -#ifdef POLYMER - GtkWidget *polymercheck; -#endif - GtkWidget *inputdevlabel; - GtkWidget *inputdevcombo; - GtkWidget *custommodlabel; - GtkWidget *custommodcombo; - GtkWidget *emptyhlayout; - GtkWidget *autoloadcheck; - GtkWidget *alwaysshowcheck; - GtkWidget *configtab; - GtkWidget *gamevlayout; - GtkWidget *gamelabel; - GtkWidget *gamescroll; - GtkWidget *gamelist; - GtkWidget *gametab; - GtkWidget *messagesscroll; - GtkWidget *messagestext; - GtkWidget *messagestab; - GtkWidget *buttons; - GtkWidget *cancelbutton; - GtkWidget *cancelbuttonalign; - GtkWidget *cancelbuttonlayout; - GtkWidget *cancelbuttonicon; - GtkWidget *cancelbuttonlabel; - GtkWidget *startbutton; - GtkWidget *startbuttonalign; - GtkWidget *startbuttonlayout; - GtkWidget *startbuttonicon; - GtkWidget *startbuttonlabel; -} stwidgets; - -static struct -{ - grpfile_t const * grp; - char *gamedir; - ud_setup_t shared; -#ifdef POLYMER - int polymer; -#endif -} settings; - -static int32_t retval = -1, mode = TAB_MESSAGES; -extern int32_t gtkenabled; -static void PopulateForm(unsigned char pgs); - - -// -- EVENT CALLBACKS AND CREATION STUFF -------------------------------------- - -static void on_vmode3dcombo_changed(GtkComboBox *combobox, gpointer user_data) -{ - GtkTreeModel *data; - GtkTreeIter iter; - int32_t val; - UNREFERENCED_PARAMETER(user_data); - - if (!gtk_combo_box_get_active_iter(combobox, &iter)) return; - if (!(data = gtk_combo_box_get_model(combobox))) return; - gtk_tree_model_get(data, &iter, 1, &val, -1); - settings.shared.xdim = validmode[val].xdim; - settings.shared.ydim = validmode[val].ydim; - settings.shared.bpp = validmode[val].bpp; -} - -static void on_fullscreencheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) -{ - UNREFERENCED_PARAMETER(user_data); - settings.shared.fullscreen = gtk_toggle_button_get_active(togglebutton); - PopulateForm(POPULATE_VIDEO); -} - -#ifdef POLYMER -static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) -{ - UNREFERENCED_PARAMETER(user_data); - if (gtk_toggle_button_get_active(togglebutton)) - { - glrendmode = REND_POLYMER; - settings.polymer = TRUE; - if (settings.shared.bpp == 8) - { - settings.shared.bpp = 32; - PopulateForm(POPULATE_VIDEO); - } - } - else - { - glrendmode = REND_POLYMOST; - settings.polymer = FALSE; - } -} -#endif - -static void on_inputdevcombo_changed(GtkComboBox *combobox, gpointer user_data) -{ - UNREFERENCED_PARAMETER(user_data); - switch (gtk_combo_box_get_active(combobox)) - { - case 0: settings.shared.usemouse = 0; settings.shared.usejoystick = 0; break; - case 1: settings.shared.usemouse = 1; settings.shared.usejoystick = 0; break; - case 2: settings.shared.usemouse = 0; settings.shared.usejoystick = 1; break; - case 3: settings.shared.usemouse = 1; settings.shared.usejoystick = 1; break; - } -} - -static void on_custommodcombo_changed(GtkComboBox *combobox, gpointer user_data) -{ - GtkTreeIter iter; - GtkTreeModel *model; - GtkTreePath *path; - char *value; - UNREFERENCED_PARAMETER(user_data); - - if (gtk_combo_box_get_active_iter(combobox, &iter)) - { - model = gtk_combo_box_get_model(combobox); - gtk_tree_model_get(model, &iter, 0,&value, -1); - path = gtk_tree_model_get_path(model, &iter); - - if (*gtk_tree_path_get_indices(path) == NONE) - settings.gamedir = NULL; - else settings.gamedir = value; - } -} - -static void on_autoloadcheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) -{ - UNREFERENCED_PARAMETER(user_data); - settings.shared.noautoload = !gtk_toggle_button_get_active(togglebutton); -} - -static void on_alwaysshowcheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) -{ - UNREFERENCED_PARAMETER(user_data); - settings.shared.forcesetup = gtk_toggle_button_get_active(togglebutton); -} - -static void on_cancelbutton_clicked(GtkButton *button, gpointer user_data) -{ - UNREFERENCED_PARAMETER(button); - UNREFERENCED_PARAMETER(user_data); - if (mode == TAB_CONFIG) { retval = 0; gtk_main_quit(); } - else quitevent++; -} - -static void on_startbutton_clicked(GtkButton *button, gpointer user_data) -{ - UNREFERENCED_PARAMETER(button); - UNREFERENCED_PARAMETER(user_data); - retval = 1; - gtk_main_quit(); -} - -static void on_gamelist_selection_changed(GtkTreeSelection *selection, gpointer user_data) -{ - GtkTreeIter iter; - GtkTreeModel *model; - UNREFERENCED_PARAMETER(user_data); - - if (gtk_tree_selection_get_selected(selection, &model, &iter)) - { - grpfile_t const *fg; - gtk_tree_model_get(model, &iter, 2, (gpointer)&fg, -1); - settings.grp = fg; - } -} - -static gboolean on_startwin_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) -{ - UNREFERENCED_PARAMETER(widget); - UNREFERENCED_PARAMETER(event); - UNREFERENCED_PARAMETER(user_data); - if (mode == TAB_CONFIG) { retval = 0; gtk_main_quit(); } - else quitevent++; - return TRUE; // FALSE would let the event go through. we want the game to decide when to close -} - - -// -- SUPPORT FUNCTIONS ------------------------------------------------------- - -static GdkPixbuf *load_banner(void) -{ - return gdk_pixbuf_from_pixdata((GdkPixdata const *)&startbanner_pixdata, FALSE, NULL); -} - -static void SetPage(int32_t n) -{ - if (!gtkenabled || !stwidgets.startwin) return; - mode = n; - gtk_notebook_set_current_page(GTK_NOTEBOOK(stwidgets.tabs), n); - - // each control in the config page vertical layout plus the start button should be made (in)sensitive - if (n == TAB_CONFIG) n = TRUE; else n = FALSE; - gtk_widget_set_sensitive(stwidgets.startbutton, n); - gtk_container_foreach(GTK_CONTAINER(stwidgets.configtlayout), - (GtkCallback)gtk_widget_set_sensitive, - (gpointer)&n); -} - -static unsigned char GetModsDirNames(GtkListStore *list) -{ - char *homedir; - char pdir[BMAX_PATH]; - unsigned char iternumb = 0; - CACHE1D_FIND_REC *dirs = NULL; - GtkTreeIter iter; - - pathsearchmode = 1; - - if ((homedir = Bgethomedir())) - { - Bsnprintf(pdir, sizeof(pdir), "%s/" ".eduke32", homedir); - dirs = klistpath(pdir, "*", CACHE1D_FIND_DIR); - for (; dirs != NULL; dirs=dirs->next) - { - if ((Bstrcmp(dirs->name, "autoload") == 0) || - (Bstrcmp(dirs->name, "..") == 0) || - (Bstrcmp(dirs->name, ".") == 0)) - continue; - else - { - gtk_list_store_append(list, &iter); - gtk_list_store_set(list, &iter, 0,dirs->name, -1); - iternumb++; - } - } - } - - klistfree(dirs); - dirs = NULL; - - return iternumb; -} - -static void PopulateForm(unsigned char pgs) -{ - if ((pgs == ALL) || (pgs == POPULATE_VIDEO)) - { - int32_t mode3d, i; - GtkListStore *modes3d; - GtkTreeIter iter; - char buf[64]; - - mode3d = videoCheckMode(&settings.shared.xdim, &settings.shared.ydim, settings.shared.bpp, settings.shared.fullscreen, 1); - if (mode3d < 0) - { - int32_t i, cd[] = { 32, 24, 16, 15, 8, 0 }; - - for (i=0; cd[i];) { if (cd[i] >= settings.shared.bpp) i++; else break; } - for (; cd[i]; i++) - { - mode3d = videoCheckMode(&settings.shared.xdim, &settings.shared.ydim, cd[i], settings.shared.fullscreen, 1); - if (mode3d < 0) continue; - settings.shared.bpp = cd[i]; - break; - } - } - - modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(stwidgets.vmode3dcombo))); - gtk_list_store_clear(modes3d); - - for (i=0; inext) - { - gtk_list_store_append(list, &iter); - gtk_list_store_set(list, &iter, 0, fg->type->name, 1, fg->filename, 2, (void const *)fg, -1); - if (settings.grp == fg) - { - GtkTreeSelection *sel = gtk_tree_view_get_selection(gamelist); - g_signal_handlers_block_by_func(sel, (gpointer)on_gamelist_selection_changed, NULL); - gtk_tree_selection_select_iter(sel, &iter); - g_signal_handlers_unblock_by_func(sel, (gpointer)on_gamelist_selection_changed, NULL); - } - } - } -} - -static gint name_sorter(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) -{ - gchar *as, *bs; - gint r; - UNREFERENCED_PARAMETER(user_data); - gtk_tree_model_get(model, a, 0, &as, -1); - gtk_tree_model_get(model, b, 0, &bs, -1); - - r = g_utf8_collate(as,bs); - - g_free(as); - g_free(bs); - - return r; -} - -static GtkWidget *create_window(void) -{ - // Basic window - stwidgets.startwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(stwidgets.startwin), apptitle); // NOTE: use global app title - gtk_window_set_position(GTK_WINDOW(stwidgets.startwin), GTK_WIN_POS_CENTER); - gtk_window_set_resizable(GTK_WINDOW(stwidgets.startwin), FALSE); - gtk_window_set_type_hint(GTK_WINDOW(stwidgets.startwin), GDK_WINDOW_TYPE_HINT_DIALOG); - - // Horizontal layout of banner and controls - stwidgets.hlayout = gtk_hbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(stwidgets.startwin), stwidgets.hlayout); - - // banner - { - GdkPixbuf *pixbuf = load_banner(); - stwidgets.banner = gtk_image_new_from_pixbuf(pixbuf); - g_object_unref((gpointer)pixbuf); - } - gtk_box_pack_start(GTK_BOX(stwidgets.hlayout), stwidgets.banner, FALSE, FALSE, 0); - gtk_misc_set_alignment(GTK_MISC(stwidgets.banner), 0.5, 0); - - // Vertical layout of tab control and start+cancel buttons - stwidgets.vlayout = gtk_vbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(stwidgets.hlayout), stwidgets.vlayout, TRUE, TRUE, 0); - - // Tab control - stwidgets.tabs = gtk_notebook_new(); - gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.tabs, TRUE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(stwidgets.tabs), 4); - - // layout table of config page - stwidgets.configtlayout = gtk_table_new(6, 3, FALSE); - gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.configtlayout); - - // 3D video mode LabelText - stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:"); - gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0); -#ifdef POLYMER - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 0); -#else - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 7); -#endif - - // 3D video mode combo - { - GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); - GtkCellRenderer *cell; - - stwidgets.vmode3dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list)); - g_object_unref(G_OBJECT(list)); - - cell = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL); - } - -#ifdef POLYMER - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0); -#else - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 7); -#endif - - // Fullscreen checkbox - stwidgets.displayvlayout = gtk_vbox_new(TRUE, 0); -#ifdef POLYMER - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 0); -#else - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 7); -#endif - - stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen"); - gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.fullscreencheck, FALSE, FALSE, 0); - -#ifdef POLYMER - // Polymer checkbox - stwidgets.polymercheck = gtk_check_button_new_with_mnemonic("_Polymer"); - gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.polymercheck, FALSE, FALSE, 0); -#endif - - // Input devices LabelText - stwidgets.inputdevlabel = gtk_label_new_with_mnemonic("_Input devices:"); - gtk_misc_set_alignment(GTK_MISC(stwidgets.inputdevlabel), 0.3, 0); - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevlabel, 0,1, 1,2, GTK_FILL, (GtkAttachOptions)0, 4, 0); - - // Input devices combo - { - GtkListStore *list = gtk_list_store_new(1, G_TYPE_STRING); - GtkCellRenderer *cell; - - stwidgets.inputdevcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list)); - g_object_unref(G_OBJECT(list)); - - cell = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, FALSE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, "text", 0, NULL); - } - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0); - - // Custom mod LabelText - stwidgets.custommodlabel = gtk_label_new_with_mnemonic("Custom _game:"); - gtk_misc_set_alignment(GTK_MISC(stwidgets.custommodlabel), 0.3, 0); - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, (GtkAttachOptions)0, 4, 7); - - // Custom mod combo - { - GtkListStore *list = gtk_list_store_new(1, G_TYPE_STRING); - GtkCellRenderer *cell; - - stwidgets.custommodcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list)); - g_object_unref(G_OBJECT(list)); - - cell = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, FALSE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, "text", 0, NULL); - } - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodcombo, 1,2, 2,3, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 7); - - // Empty horizontal layout - stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0); - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,3, 3,4, (GtkAttachOptions)0, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 4, 0); - - // Autoload checkbox - stwidgets.autoloadcheck = gtk_check_button_new_with_mnemonic("_Enable \"autoload\" folder"); - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.autoloadcheck, 0,3, 4,5, GTK_FILL, (GtkAttachOptions)0, 2, 2); - - // Always show config checkbox - stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show this window at startup"); - gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,3, 5,6, GTK_FILL, (GtkAttachOptions)0, 2, 2); - - // Configuration tab - stwidgets.configtab = gtk_label_new("Configuration"); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 0), stwidgets.configtab); - - // Game data layout - stwidgets.gamevlayout = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.gamevlayout); - gtk_container_set_border_width(GTK_CONTAINER(stwidgets.gamevlayout), 4); - - // Game data field LabelText - stwidgets.gamelabel = gtk_label_new_with_mnemonic("_Game:"); - gtk_box_pack_start(GTK_BOX(stwidgets.gamevlayout), stwidgets.gamelabel, FALSE, FALSE, 0); - gtk_misc_set_alignment(GTK_MISC(stwidgets.gamelabel), 0, 0.5); - - // Game data scrollable area - stwidgets.gamescroll = gtk_scrolled_window_new(NULL, NULL); - gtk_box_pack_start(GTK_BOX(stwidgets.gamevlayout), stwidgets.gamescroll, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(stwidgets.gamescroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(stwidgets.gamescroll), GTK_SHADOW_IN); - - // Game data list - { - GtkListStore *list = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); - GtkCellRenderer *cell; - GtkTreeViewColumn *col; - - gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(list), 0, name_sorter, NULL, NULL); - gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(list), 0, GTK_SORT_ASCENDING); - - stwidgets.gamelist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list)); - g_object_unref(G_OBJECT(list)); - - cell = gtk_cell_renderer_text_new(); - col = gtk_tree_view_column_new_with_attributes("Game", cell, "text", 0, NULL); - gtk_tree_view_column_set_expand(col, TRUE); - gtk_tree_view_append_column(GTK_TREE_VIEW(stwidgets.gamelist), col); - col = gtk_tree_view_column_new_with_attributes("GRP file", cell, "text", 1, NULL); - gtk_tree_view_column_set_min_width(col, 64); - gtk_tree_view_append_column(GTK_TREE_VIEW(stwidgets.gamelist), col); - } - gtk_container_add(GTK_CONTAINER(stwidgets.gamescroll), stwidgets.gamelist); - - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(stwidgets.gamelist), FALSE); - gtk_tree_view_set_enable_search(GTK_TREE_VIEW(stwidgets.gamelist), FALSE); - - // Game tab - stwidgets.gametab = gtk_label_new("Game"); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 1), stwidgets.gametab); - - // Messages scrollable area - stwidgets.messagesscroll = gtk_scrolled_window_new(NULL, NULL); - gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.messagesscroll); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(stwidgets.messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - // Messages text area - stwidgets.messagestext = gtk_text_view_new(); - gtk_container_add(GTK_CONTAINER(stwidgets.messagesscroll), stwidgets.messagestext); - gtk_text_view_set_editable(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE); - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(stwidgets.messagestext), GTK_WRAP_WORD); - gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE); - gtk_text_view_set_left_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2); - gtk_text_view_set_right_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2); - - // Messages tab - stwidgets.messagestab = gtk_label_new("Messages"); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 2), stwidgets.messagestab); - - // Dialogue box buttons layout - stwidgets.buttons = gtk_hbutton_box_new(); - gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.buttons, FALSE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(stwidgets.buttons), 3); - gtk_button_box_set_layout(GTK_BUTTON_BOX(stwidgets.buttons), GTK_BUTTONBOX_END); - - // Cancel button - stwidgets.cancelbutton = gtk_button_new(); - gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.cancelbutton); - GTK_WIDGET_SET_FLAGS(stwidgets.cancelbutton, GTK_CAN_DEFAULT); - - stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); - gtk_container_add(GTK_CONTAINER(stwidgets.cancelbutton), stwidgets.cancelbuttonalign); - - stwidgets.cancelbuttonlayout = gtk_hbox_new(FALSE, 2); - gtk_container_add(GTK_CONTAINER(stwidgets.cancelbuttonalign), stwidgets.cancelbuttonlayout); - - stwidgets.cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON); - gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonicon, FALSE, FALSE, 0); - - stwidgets.cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel"); - gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonlabel, FALSE, FALSE, 0); - - // Start button - stwidgets.startbutton = gtk_button_new(); - gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.startbutton); - GTK_WIDGET_SET_FLAGS(stwidgets.startbutton, GTK_CAN_DEFAULT); - - gtk_window_set_default(GTK_WINDOW(stwidgets.startwin), stwidgets.startbutton); - - stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); - gtk_container_add(GTK_CONTAINER(stwidgets.startbutton), stwidgets.startbuttonalign); - - stwidgets.startbuttonlayout = gtk_hbox_new(FALSE, 2); - gtk_container_add(GTK_CONTAINER(stwidgets.startbuttonalign), stwidgets.startbuttonlayout); - - stwidgets.startbuttonicon = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_BUTTON); - gtk_box_pack_start(GTK_BOX(stwidgets.startbuttonlayout), stwidgets.startbuttonicon, FALSE, FALSE, 0); - - stwidgets.startbuttonlabel = gtk_label_new_with_mnemonic("_Start"); - gtk_box_pack_start(GTK_BOX(stwidgets.startbuttonlayout), stwidgets.startbuttonlabel, FALSE, FALSE, 0); - - // Wire up the signals - g_signal_connect((gpointer) stwidgets.startwin, "delete_event", - G_CALLBACK(on_startwin_delete_event), - NULL); - g_signal_connect((gpointer) stwidgets.vmode3dcombo, "changed", - G_CALLBACK(on_vmode3dcombo_changed), - NULL); - g_signal_connect((gpointer) stwidgets.fullscreencheck, "toggled", - G_CALLBACK(on_fullscreencheck_toggled), - NULL); -#ifdef POLYMER - g_signal_connect((gpointer) stwidgets.polymercheck, "toggled", - G_CALLBACK(on_polymercheck_toggled), - NULL); -#endif - g_signal_connect((gpointer) stwidgets.inputdevcombo, "changed", - G_CALLBACK(on_inputdevcombo_changed), - NULL); - g_signal_connect((gpointer) stwidgets.custommodcombo, "changed", - G_CALLBACK(on_custommodcombo_changed), - NULL); - g_signal_connect((gpointer) stwidgets.autoloadcheck, "toggled", - G_CALLBACK(on_autoloadcheck_toggled), - NULL); - g_signal_connect((gpointer) stwidgets.alwaysshowcheck, "toggled", - G_CALLBACK(on_alwaysshowcheck_toggled), - NULL); - g_signal_connect((gpointer) stwidgets.cancelbutton, "clicked", - G_CALLBACK(on_cancelbutton_clicked), - NULL); - g_signal_connect((gpointer) stwidgets.startbutton, "clicked", - G_CALLBACK(on_startbutton_clicked), - NULL); - { - GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(stwidgets.gamelist)); - gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); - g_signal_connect((gpointer) sel, "changed", - G_CALLBACK(on_gamelist_selection_changed), - NULL); - } - - // Associate labels with their controls - gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.vmode3dlabel), stwidgets.vmode3dcombo); - gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.inputdevlabel), stwidgets.inputdevcombo); - gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.custommodlabel), stwidgets.custommodcombo); - gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.gamelabel), stwidgets.gamelist); - - return stwidgets.startwin; -} - - -// -- BUILD ENTRY POINTS ------------------------------------------------------ - -int32_t startwin_open(void) -{ - if (!gtkenabled) return 0; - if (stwidgets.startwin) return 1; - - stwidgets.startwin = create_window(); - if (stwidgets.startwin) - { - SetPage(TAB_MESSAGES); - gtk_widget_show_all(stwidgets.startwin); - gtk_main_iteration_do(FALSE); - return 0; - } - return -1; -} - -int32_t startwin_close(void) -{ - if (!gtkenabled) return 0; - if (!stwidgets.startwin) return 1; - gtk_widget_destroy(stwidgets.startwin); - stwidgets.startwin = NULL; - return 0; -} - -int32_t startwin_puts(const char *str) -{ - GtkWidget *textview; - GtkTextBuffer *textbuffer; - GtkTextIter enditer; - GtkTextMark *mark; - const char *aptr, *bptr; - - if (!gtkenabled || !str) return 0; - if (!stwidgets.startwin) return 1; - if (!(textview = stwidgets.messagestext)) return -1; - textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); - - gtk_text_buffer_get_end_iter(textbuffer, &enditer); - for (aptr = bptr = str; *aptr != 0;) - { - switch (*bptr) - { - case '\b': - if (bptr > aptr) - gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1); -#if GTK_CHECK_VERSION(2,6,0) - gtk_text_buffer_backspace(textbuffer, &enditer, FALSE, TRUE); -#else - { - GtkTextIter iter2 = enditer; - gtk_text_iter_backward_cursor_position(&iter2); - //FIXME: this seems be deleting one too many chars somewhere! - if (!gtk_text_iter_equal(&iter2, &enditer)) - gtk_text_buffer_delete_interactive(textbuffer, &iter2, &enditer, TRUE); - } -#endif - aptr = ++bptr; - break; - case 0: - if (bptr > aptr) - gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)); - aptr = bptr; - break; - case '\r': // FIXME - default: - bptr++; - break; - } - } - - mark = gtk_text_buffer_create_mark(textbuffer, NULL, &enditer, 1); - gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(textview), mark, 0.0, FALSE, 0.0, 1.0); - gtk_text_buffer_delete_mark(textbuffer, mark); - - return 0; -} - -int32_t startwin_settitle(const char *title) -{ - if (!gtkenabled) return 0; - if (!stwidgets.startwin) return 1; - gtk_window_set_title(GTK_WINDOW(stwidgets.startwin), title); - return 0; -} - -int32_t startwin_idle(void *s) -{ - UNREFERENCED_PARAMETER(s); - if (!gtkenabled) return 0; - //if (!stwidgets.startwin) return 1; - gtk_main_iteration_do(FALSE); - return 0; -} - -int32_t startwin_run(void) -{ - if (!gtkenabled) return 1; - if (!stwidgets.startwin) return 1; - - SetPage(TAB_CONFIG); - - settings.shared = gSetup; - settings.gamedir = g_modDir; - settings.grp = g_selectedGrp; -#ifdef POLYMER - settings.polymer = (glrendmode == REND_POLYMER) & (settings.shared.bpp != 8); -#endif - PopulateForm(ALL); - - gtk_main(); - - SetPage(TAB_MESSAGES); - if (retval) // launch the game with these parameters - { - gSetup = settings.shared; -#ifdef POLYMER - glrendmode = (settings.polymer) ? REND_POLYMER : REND_POLYMOST; -#endif - g_selectedGrp = settings.grp; - - Bstrcpy(g_modDir, (g_noSetup == 0 && settings.gamedir != NULL) ? settings.gamedir : "/"); - } - - return retval; -} diff --git a/source/exhumed/src/status.cpp b/source/exhumed/src/status.cpp index c1d63e1bc..24ab8c759 100644 --- a/source/exhumed/src/status.cpp +++ b/source/exhumed/src/status.cpp @@ -15,7 +15,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" #include "engine.h" #include "player.h" #include "anims.h" @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include "typedefs.h" +BEGIN_PS_NS + short nMaskY; static short nAnimsFree = 0; @@ -847,3 +849,5 @@ void DrawStatus() printext(0, 0, "S E R P E N T C A M", kTile159, 255); } } + +END_PS_NS diff --git a/source/exhumed/src/status.h b/source/exhumed/src/status.h index 06705204f..826c88a5e 100644 --- a/source/exhumed/src/status.h +++ b/source/exhumed/src/status.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __status_h__ #define __status_h__ +BEGIN_PS_NS + extern short nMaskY; extern short nCounterBullet; @@ -46,4 +48,6 @@ void SetPrevItem(int nPlayer); void SetCounter(short nVal); void SetCounterImmediate(short nVal); +END_PS_NS + #endif diff --git a/source/exhumed/src/stream.cpp b/source/exhumed/src/stream.cpp index de8af1618..3fe06d262 100644 --- a/source/exhumed/src/stream.cpp +++ b/source/exhumed/src/stream.cpp @@ -15,5 +15,5 @@ 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" #include "stream.h" diff --git a/source/exhumed/src/switch.cpp b/source/exhumed/src/switch.cpp index 35c64e456..f5a2ec809 100644 --- a/source/exhumed/src/switch.cpp +++ b/source/exhumed/src/switch.cpp @@ -15,7 +15,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" #include "switch.h" #include "exhumed.h" #include "runlist.h" @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +BEGIN_PS_NS + short LinkCount = -1; short SwitchCount = -1; @@ -540,3 +542,4 @@ void FuncSwPressWall(int a, int, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/switch.h b/source/exhumed/src/switch.h index add32f80c..7acb3cdfa 100644 --- a/source/exhumed/src/switch.h +++ b/source/exhumed/src/switch.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __switch_h__ #define __switch_h__ +BEGIN_PS_NS + #define kMaxLinks 1024 #define kMaxSwitches 1024 @@ -41,4 +43,6 @@ int BuildSwReady(int nChannel, short nLink); int BuildSwPressWall(short nChannel, short nLink, short nWall); +END_PS_NS + #endif diff --git a/source/exhumed/src/text2.cpp b/source/exhumed/src/text2.cpp index 23a32e659..1d446a433 100644 --- a/source/exhumed/src/text2.cpp +++ b/source/exhumed/src/text2.cpp @@ -15,5 +15,5 @@ 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" #include "text2.h" diff --git a/source/exhumed/src/timer.cpp b/source/exhumed/src/timer.cpp index 9f5059542..33a70e7ed 100644 --- a/source/exhumed/src/timer.cpp +++ b/source/exhumed/src/timer.cpp @@ -15,12 +15,14 @@ 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" #include "compat.h" #include "baselayer.h" #include "timer.h" #include "exhumed.h" +BEGIN_PS_NS + void timerhandler(); void InitTimer() @@ -31,3 +33,4 @@ void InitTimer() timerSetCallback(timerhandler); } +END_PS_NS diff --git a/source/exhumed/src/timer.h b/source/exhumed/src/timer.h index fad0463a6..11b838180 100644 --- a/source/exhumed/src/timer.h +++ b/source/exhumed/src/timer.h @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __timer_h__ #define __timer_h__ +BEGIN_PS_NS + #define kTimerTicks 120 void InitTimer(); @@ -27,4 +29,6 @@ void InitTimer(); void uninittimer(); #endif +END_PS_NS + #endif \ No newline at end of file diff --git a/source/exhumed/src/trigdat.cpp b/source/exhumed/src/trigdat.cpp index 58274e31e..c0cf59531 100644 --- a/source/exhumed/src/trigdat.cpp +++ b/source/exhumed/src/trigdat.cpp @@ -15,7 +15,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" #include "trigdat.h" #ifndef __WATCOMC__ #include @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #endif +BEGIN_PS_NS + short AngTable[] = {0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31,31,32,32,32,32,32,32,33,33,33,33,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,35,36,36,36,36,36,36,37,37,37,37,37,37,38,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,40,41,41,41,41,41,41,41,42,42,42,42,42,42,43,43,43,43,43,43,43,44,44,44,44,44,44,45,45,45,45,45,45,46,46,46,46,46,46,46,47,47,47,47,47,47,48,48,48,48,48,48,48,49,49,49,49,49,49,50,50,50,50,50,50,51,51,51,51,51,51,51,52,52,52,52,52,52,53,53,53,53,53,53,53,54,54,54,54,54,54,55,55,55,55,55,55,55,56,56,56,56,56,56,57,57,57,57,57,57,57,58,58,58,58,58,58,59,59,59,59,59,59,59,60,60,60,60,60,60,61,61,61,61,61,61,61,62,62,62,62,62,62,63,63,63,63,63,63,63,64,64,64,64,64,64,65,65,65,65,65,65,65,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,71,71,71,71,71,71,72,72,72,72,72,72,72,73,73,73,73,73,73,74,74,74,74,74,74,74,75,75,75,75,75,75,75,76,76,76,76,76,76,77,77,77,77,77,77,77,78,78,78,78,78,78,78,79,79,79,79,79,79,80,80,80,80,80,80,80,81,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,83,83,84,84,84,84,84,84,84,85,85,85,85,85,85,86,86,86,86,86,86,86,87,87,87,87,87,87,87,88,88,88,88,88,88,88,89,89,89,89,89,89,90,90,90,90,90,90,90,91,91,91,91,91,91,91,92,92,92,92,92,92,92,93,93,93,93,93,93,93,94,94,94,94,94,94,94,95,95,95,95,95,95,96,96,96,96,96,96,96,97,97,97,97,97,97,97,98,98,98,98,98,98,98,99,99,99,99,99,99,99,100,100,100,100,100,100,100,101,101,101,101,101,101,101,102,102,102,102,102,102,102,103,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,105,106,106,106,106,106,106,106,107,107,107,107,107,107,107,108,108,108,108,108,108,108,109,109,109,109,109,109,109,110,110,110,110,110,110,110,111,111,111,111,111,111,111,112,112,112,112,112,112,112,113,113,113,113,113,113,113,114,114,114,114,114,114,114,115,115,115,115,115,115,115,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,119,119,119,119,119,119,119,120,120,120,120,120,120,120,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,256,256,256,256,256,256}; @@ -166,3 +168,4 @@ int AngleDelta(int a, int b, int c) } return diff; } +END_PS_NS diff --git a/source/exhumed/src/trigdat.h b/source/exhumed/src/trigdat.h index b13393318..72b09a31d 100644 --- a/source/exhumed/src/trigdat.h +++ b/source/exhumed/src/trigdat.h @@ -19,10 +19,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __trigdat_h__ #define __trigdat_h__ +BEGIN_PS_NS + #define kAngleMask 0x7FF int GetMyAngle(int x, int y); int AngleDiff(short a, short b); int AngleDelta(int a, int b, int c); +END_PS_NS + #endif diff --git a/source/exhumed/src/util.h b/source/exhumed/src/util.h index c4c530e27..efafe308e 100644 --- a/source/exhumed/src/util.h +++ b/source/exhumed/src/util.h @@ -19,6 +19,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __util_h__ #define __util_h__ +BEGIN_PS_NS + + inline int Min(int a, int b) { if (a < b) @@ -35,4 +38,6 @@ inline int Max(int a, int b) return a; } +END_PS_NS + #endif diff --git a/source/exhumed/src/version.cpp b/source/exhumed/src/version.cpp index 9fd906037..a9e6ba2f7 100644 --- a/source/exhumed/src/version.cpp +++ b/source/exhumed/src/version.cpp @@ -15,7 +15,11 @@ 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" #include "version.h" +BEGIN_PS_NS + const char *versionstr = "Mar 19 1997 17:31:18"; + +END_PS_NS diff --git a/source/exhumed/src/version.h b/source/exhumed/src/version.h index 0f4be784c..bb6ba6bc2 100644 --- a/source/exhumed/src/version.h +++ b/source/exhumed/src/version.h @@ -19,6 +19,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __version_h__ #define __version_h__ +BEGIN_PS_NS + extern const char *versionstr; +END_PS_NS + #endif diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index 837f9693c..ff5745b7a 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -15,7 +15,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" #include "compat.h" #include "keyboard.h" #include "control.h" @@ -43,6 +43,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "runlist.h" #include +BEGIN_PS_NS + short bSubTitles = kTrue; int zbob; @@ -647,3 +649,4 @@ void Clip() bClip = kTrue; } +END_PS_NS diff --git a/source/exhumed/src/view.h b/source/exhumed/src/view.h index c6375cf12..d59b5063d 100644 --- a/source/exhumed/src/view.h +++ b/source/exhumed/src/view.h @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" +BEGIN_PS_NS + extern short bSubTitles; extern short nViewTop; extern short bClip; @@ -63,4 +65,6 @@ static inline int angle_interpolate16(int a, int b, int smooth) return a + mulscale16(((b+1024-a)&2047)-1024, smooth); } +END_PS_NS + #endif diff --git a/source/exhumed/src/wasp.cpp b/source/exhumed/src/wasp.cpp index 645bc8b52..f7daca650 100644 --- a/source/exhumed/src/wasp.cpp +++ b/source/exhumed/src/wasp.cpp @@ -15,7 +15,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" #include "wasp.h" #include "engine.h" #include "runlist.h" @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trigdat.h" #include +BEGIN_PS_NS + #define kMaxWasps 100 static short nVelShift = 0; @@ -412,3 +414,4 @@ void FuncWasp(int a, int nDamage, int nRun) } } } +END_PS_NS diff --git a/source/exhumed/src/wasp.h b/source/exhumed/src/wasp.h index 0fd019e61..aa2a7be39 100644 --- a/source/exhumed/src/wasp.h +++ b/source/exhumed/src/wasp.h @@ -19,10 +19,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __wasp_h__ #define __wasp_h__ +BEGIN_PS_NS + extern short nWaspCount; void InitWasps(); int BuildWasp(short nSprite, int x, int y, int z, short nSector, short nAngle); void FuncWasp(int eax, int edx, int nRun); +END_PS_NS + #endif