diff --git a/platform/Windows/nblood.vcxproj b/platform/Windows/nblood.vcxproj index 93b802e91..d920fe589 100644 --- a/platform/Windows/nblood.vcxproj +++ b/platform/Windows/nblood.vcxproj @@ -243,7 +243,6 @@ - diff --git a/platform/Windows/nblood.vcxproj.filters b/platform/Windows/nblood.vcxproj.filters index 1e38b67a6..84354f785 100644 --- a/platform/Windows/nblood.vcxproj.filters +++ b/platform/Windows/nblood.vcxproj.filters @@ -21,9 +21,6 @@ Source Files - - Source Files - Source Files diff --git a/source/blood/src/_functio.h b/source/blood/src/_functio.h index f04ffb143..fe4fcd337 100644 --- a/source/blood/src/_functio.h +++ b/source/blood/src/_functio.h @@ -31,6 +31,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "_control.h" #include "control.h" +BEGIN_BLD_NS + #ifndef function_private_h_ #define function_private_h_ // KEEPINSYNC lunatic/con_lang.lua @@ -368,3 +370,5 @@ static const char * joystickdigitaldefaults[MAXJOYDIGITAL] = #endif #endif + +END_BLD_NS diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 9dffdc8bb..d7f4cd6b0 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -78,6 +78,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "warp.h" #include "weapon.h" +BEGIN_BLD_NS + VECTORDATA gVectorData[] = { // Tine { @@ -7950,3 +7952,4 @@ bool ceilIsTooLow(spritetype* pSprite) { return false; } +END_BLD_NS diff --git a/source/blood/src/actor.h b/source/blood/src/actor.h index 1c10ee06b..92e9a796f 100644 --- a/source/blood/src/actor.h +++ b/source/blood/src/actor.h @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "fx.h" #include "gameutil.h" +BEGIN_BLD_NS + enum DAMAGE_TYPE { DAMAGE_TYPE_0 = 0, DAMAGE_TYPE_1, // Flame @@ -284,4 +286,6 @@ extern short gSightSpritesList[kMaxSuperXSprites]; extern short gPhysSpritesList[kMaxSuperXSprites]; extern short gProxySpritesCount; extern short gSightSpritesCount; -extern short gPhysSpritesCount; \ No newline at end of file +extern short gPhysSpritesCount; + +END_BLD_NS diff --git a/source/blood/src/ai.cpp b/source/blood/src/ai.cpp index 6b4322ef6..992664fb4 100644 --- a/source/blood/src/ai.cpp +++ b/source/blood/src/ai.cpp @@ -66,6 +66,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trig.h" #include "triggers.h" +BEGIN_BLD_NS + int cumulDamage[kMaxXSprites]; int gDudeSlope[kMaxXSprites]; DUDEEXTRA gDudeExtra[kMaxXSprites]; @@ -1808,3 +1810,4 @@ void AILoadSaveConstruct(void) myLoadSave = new AILoadSave(); } +END_BLD_NS diff --git a/source/blood/src/ai.h b/source/blood/src/ai.h index b69e83644..570975213 100644 --- a/source/blood/src/ai.h +++ b/source/blood/src/ai.h @@ -27,6 +27,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "actor.h" #include "db.h" +BEGIN_BLD_NS + + struct AISTATE { int stateType; // By NoOne: current type of state. Basically required for kGDXDudeTargetChanger, but can be used for something else. int at0; // seq @@ -103,3 +106,5 @@ void aiInitSprite(spritetype *pSprite); // By NoOne: this function required for kGDXDudeTargetChanger void aiSetGenIdleState(spritetype* pSprite, XSPRITE* pXSprite); + +END_BLD_NS diff --git a/source/blood/src/aibat.cpp b/source/blood/src/aibat.cpp index 0b5a73e4c..22d015c24 100644 --- a/source/blood/src/aibat.cpp +++ b/source/blood/src/aibat.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "seq.h" #include "trig.h" +BEGIN_BLD_NS + static void BiteSeqCallback(int, int); static void thinkTarget(spritetype *, XSPRITE *); static void thinkSearch(spritetype *, XSPRITE *); @@ -438,3 +440,5 @@ void MoveToCeil(spritetype *pSprite, XSPRITE *pXSprite) else aiSetTarget(pXSprite, x, y, sector[nSector].ceilingz); } + +END_BLD_NS diff --git a/source/blood/src/aibat.h b/source/blood/src/aibat.h index 464644610..4eae831f0 100644 --- a/source/blood/src/aibat.h +++ b/source/blood/src/aibat.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE batIdle; extern AISTATE batFlyIdle; extern AISTATE batChase; @@ -41,3 +43,5 @@ extern AISTATE batDodgeUpLeft; extern AISTATE batDodgeDown; extern AISTATE batDodgeDownRight; extern AISTATE batDodgeDownLeft; + +END_BLD_NS diff --git a/source/blood/src/aibeast.cpp b/source/blood/src/aibeast.cpp index 305364b34..5a394aba0 100644 --- a/source/blood/src/aibeast.cpp +++ b/source/blood/src/aibeast.cpp @@ -41,6 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void SlashSeqCallback(int, int); static void StompSeqCallback(int, int); static void MorphToBeast(spritetype *, XSPRITE *); @@ -582,3 +584,5 @@ static void sub_62D7C(spritetype *pSprite, XSPRITE *pXSprite) yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos); zvel[nSprite] = dz; } + +END_BLD_NS diff --git a/source/blood/src/aibeast.h b/source/blood/src/aibeast.h index 66451dbbb..247ce4aa6 100644 --- a/source/blood/src/aibeast.h +++ b/source/blood/src/aibeast.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE beastIdle; extern AISTATE beastChase; extern AISTATE beastDodge; @@ -44,3 +46,5 @@ extern AISTATE beastMorphFromCultist; extern AISTATE beast138FB4; extern AISTATE beast138FD0; extern AISTATE beast138FEC; + +END_BLD_NS diff --git a/source/blood/src/aiboneel.cpp b/source/blood/src/aiboneel.cpp index 868ea9b62..2c08df11f 100644 --- a/source/blood/src/aiboneel.cpp +++ b/source/blood/src/aiboneel.cpp @@ -40,6 +40,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void BiteSeqCallback(int, int); static void thinkTarget(spritetype *, XSPRITE *); static void thinkSearch(spritetype *, XSPRITE *); @@ -443,3 +445,5 @@ void MoveToCeil(spritetype *pSprite, XSPRITE *pXSprite) else aiSetTarget(pXSprite, x, y, sector[nSector].ceilingz); } + +END_BLD_NS diff --git a/source/blood/src/aiboneel.h b/source/blood/src/aiboneel.h index b73cc1a7c..b49623cb9 100644 --- a/source/blood/src/aiboneel.h +++ b/source/blood/src/aiboneel.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE eelIdle; extern AISTATE eelFlyIdle; extern AISTATE eelChase; @@ -42,3 +44,4 @@ extern AISTATE eelDodgeDown; extern AISTATE eelDodgeDownRight; extern AISTATE eelDodgeDownLeft; +END_BLD_NS diff --git a/source/blood/src/aiburn.cpp b/source/blood/src/aiburn.cpp index 6b6aacf29..1be007fd9 100644 --- a/source/blood/src/aiburn.cpp +++ b/source/blood/src/aiburn.cpp @@ -41,6 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void BurnSeqCallback(int, int); static void thinkSearch(spritetype*, XSPRITE*); static void thinkGoto(spritetype*, XSPRITE*); @@ -268,3 +270,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) } pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aiburn.h b/source/blood/src/aiburn.h index ff4cde645..120ebb078 100644 --- a/source/blood/src/aiburn.h +++ b/source/blood/src/aiburn.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE cultistBurnIdle; extern AISTATE cultistBurnChase; extern AISTATE cultistBurnGoto; @@ -54,3 +56,4 @@ extern AISTATE GDXGenDudeBurnGoto; extern AISTATE GDXGenDudeBurnSearch; extern AISTATE GDXGenDudeBurnAttack; +END_BLD_NS diff --git a/source/blood/src/aicaleb.cpp b/source/blood/src/aicaleb.cpp index 05afb0b73..af2af5499 100644 --- a/source/blood/src/aicaleb.cpp +++ b/source/blood/src/aicaleb.cpp @@ -41,6 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void SeqAttackCallback(int, int); static void thinkSearch(spritetype *, XSPRITE *); static void thinkGoto(spritetype *, XSPRITE *); @@ -424,3 +426,5 @@ static void sub_661E0(spritetype *pSprite, XSPRITE *pXSprite) yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos); zvel[nSprite] = dz; } + +END_BLD_NS diff --git a/source/blood/src/aicaleb.h b/source/blood/src/aicaleb.h index 969070bda..ea4a28714 100644 --- a/source/blood/src/aicaleb.h +++ b/source/blood/src/aicaleb.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE tinycalebIdle; extern AISTATE tinycalebChase; extern AISTATE tinycalebDodge; @@ -41,3 +43,5 @@ extern AISTATE tinycalebSwimRecoil; extern AISTATE tinycaleb139660; extern AISTATE tinycaleb13967C; extern AISTATE tinycaleb139698; + +END_BLD_NS diff --git a/source/blood/src/aicerber.cpp b/source/blood/src/aicerber.cpp index e83f4f023..d96dfd6f1 100644 --- a/source/blood/src/aicerber.cpp +++ b/source/blood/src/aicerber.cpp @@ -41,6 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void BiteSeqCallback(int, int); static void BurnSeqCallback(int, int); static void BurnSeqCallback2(int, int); @@ -490,3 +492,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) } pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aicerber.h b/source/blood/src/aicerber.h index 5c416e31a..6b4f3b416 100644 --- a/source/blood/src/aicerber.h +++ b/source/blood/src/aicerber.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE cerberusIdle; extern AISTATE cerberusSearch; extern AISTATE cerberusChase; @@ -42,3 +44,5 @@ extern AISTATE cerberus2Burn; extern AISTATE cerberus4Burn; extern AISTATE cerberus139890; extern AISTATE cerberus1398AC; + +END_BLD_NS diff --git a/source/blood/src/aicult.cpp b/source/blood/src/aicult.cpp index eca69f7f7..838293a4c 100644 --- a/source/blood/src/aicult.cpp +++ b/source/blood/src/aicult.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void TommySeqCallback(int, int); static void TeslaSeqCallback(int, int); static void ShotSeqCallback(int, int); @@ -660,3 +662,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) } pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aicult.h b/source/blood/src/aicult.h index 0a09c3deb..299a1b8b0 100644 --- a/source/blood/src/aicult.h +++ b/source/blood/src/aicult.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE cultistIdle; extern AISTATE cultistProneIdle; extern AISTATE fanaticProneIdle; @@ -61,3 +63,5 @@ extern AISTATE cultistSSwimFire; extern AISTATE cultistTSwimFire; extern AISTATE cultistTsSwimFire; extern AISTATE cultistSwimRecoil; + +END_BLD_NS diff --git a/source/blood/src/aigarg.cpp b/source/blood/src/aigarg.cpp index be0381044..de76025e9 100644 --- a/source/blood/src/aigarg.cpp +++ b/source/blood/src/aigarg.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void SlashFSeqCallback(int, int); static void ThrowFSeqCallback(int, int); static void BlastSSeqCallback(int, int); @@ -705,3 +707,5 @@ static void MoveFly(spritetype *pSprite, XSPRITE *pXSprite) } klabs(zvel[nSprite]); } + +END_BLD_NS diff --git a/source/blood/src/aigarg.h b/source/blood/src/aigarg.h index 3112cf85e..c76c87bee 100644 --- a/source/blood/src/aigarg.h +++ b/source/blood/src/aigarg.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE gargoyleFIdle; extern AISTATE gargoyleStatueIdle; extern AISTATE gargoyleFChase; @@ -48,3 +50,5 @@ extern AISTATE gargoyleFDodgeDownRight; extern AISTATE gargoyleFDodgeDownLeft; extern AISTATE statueFBreakSEQ; extern AISTATE statueSBreakSEQ; + +END_BLD_NS diff --git a/source/blood/src/aighost.cpp b/source/blood/src/aighost.cpp index b34fefc0e..4e1c8f74e 100644 --- a/source/blood/src/aighost.cpp +++ b/source/blood/src/aighost.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void SlashSeqCallback(int, int); static void ThrowSeqCallback(int, int); static void BlastSeqCallback(int, int); @@ -588,3 +590,5 @@ static void MoveFly(spritetype *pSprite, XSPRITE *pXSprite) break; } } + +END_BLD_NS diff --git a/source/blood/src/aighost.h b/source/blood/src/aighost.h index b45504f9b..831ea11f2 100644 --- a/source/blood/src/aighost.h +++ b/source/blood/src/aighost.h @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + extern AISTATE ghostIdle; extern AISTATE ghostChase; extern AISTATE ghostGoto; @@ -40,3 +42,5 @@ extern AISTATE ghostDodgeUpLeft; extern AISTATE ghostDodgeDown; extern AISTATE ghostDodgeDownRight; extern AISTATE ghostDodgeDownLeft; + +END_BLD_NS diff --git a/source/blood/src/aigilbst.cpp b/source/blood/src/aigilbst.cpp index 089ae5f7b..ecd3e2a80 100644 --- a/source/blood/src/aigilbst.cpp +++ b/source/blood/src/aigilbst.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void GillBiteSeqCallback(int, int); static void thinkSearch(spritetype *, XSPRITE *); static void thinkGoto(spritetype *, XSPRITE *); @@ -416,3 +418,5 @@ static void sub_6D03C(spritetype *pSprite, XSPRITE *pXSprite) yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos); zvel[nSprite] = dz; } + +END_BLD_NS diff --git a/source/blood/src/aigilbst.h b/source/blood/src/aigilbst.h index e20610e04..29b935699 100644 --- a/source/blood/src/aigilbst.h +++ b/source/blood/src/aigilbst.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE gillBeastIdle; extern AISTATE gillBeastChase; extern AISTATE gillBeastDodge; @@ -41,3 +43,4 @@ extern AISTATE gillBeast13A138; extern AISTATE gillBeast13A154; extern AISTATE gillBeast13A170; +END_BLD_NS diff --git a/source/blood/src/aihand.cpp b/source/blood/src/aihand.cpp index eb6c047ac..ec6e84866 100644 --- a/source/blood/src/aihand.cpp +++ b/source/blood/src/aihand.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void HandJumpSeqCallback(int, int); static void thinkSearch(spritetype *, XSPRITE *); static void thinkGoto(spritetype *, XSPRITE *); @@ -139,3 +141,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &handGoto); pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aihand.h b/source/blood/src/aihand.h index 8e4b03ea7..247dc35f3 100644 --- a/source/blood/src/aihand.h +++ b/source/blood/src/aihand.h @@ -23,10 +23,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE handIdle; extern AISTATE hand13A3B4; extern AISTATE handSearch; extern AISTATE handChase; extern AISTATE handRecoil; extern AISTATE handGoto; -extern AISTATE handJump; \ No newline at end of file +extern AISTATE handJump; + +END_BLD_NS diff --git a/source/blood/src/aihound.cpp b/source/blood/src/aihound.cpp index ce6530307..d7298a103 100644 --- a/source/blood/src/aihound.cpp +++ b/source/blood/src/aihound.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void BiteSeqCallback(int, int); static void BurnSeqCallback(int, int); static void thinkSearch(spritetype *, XSPRITE *); @@ -161,3 +163,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &houndGoto); pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aihound.h b/source/blood/src/aihound.h index 156a82cd0..dcb3579c7 100644 --- a/source/blood/src/aihound.h +++ b/source/blood/src/aihound.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE houndIdle; extern AISTATE houndSearch; extern AISTATE houndChase; @@ -31,3 +33,5 @@ extern AISTATE houndTeslaRecoil; extern AISTATE houndGoto; extern AISTATE houndBite; extern AISTATE houndBurn; + +END_BLD_NS diff --git a/source/blood/src/aiinnoc.cpp b/source/blood/src/aiinnoc.cpp index ffda2d354..a35b7f720 100644 --- a/source/blood/src/aiinnoc.cpp +++ b/source/blood/src/aiinnoc.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void thinkSearch(spritetype *, XSPRITE *); static void thinkGoto(spritetype *, XSPRITE *); static void thinkChase(spritetype *, XSPRITE *); @@ -120,3 +122,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aiinnoc.h b/source/blood/src/aiinnoc.h index e121b220c..8bdff897d 100644 --- a/source/blood/src/aiinnoc.h +++ b/source/blood/src/aiinnoc.h @@ -23,9 +23,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE innocentIdle; extern AISTATE innocentSearch; extern AISTATE innocentChase; extern AISTATE innocentRecoil; extern AISTATE innocentTeslaRecoil; -extern AISTATE innocentGoto; \ No newline at end of file +extern AISTATE innocentGoto; + +END_BLD_NS diff --git a/source/blood/src/aipod.cpp b/source/blood/src/aipod.cpp index 3bc90094d..d1fa72582 100644 --- a/source/blood/src/aipod.cpp +++ b/source/blood/src/aipod.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void sub_6FF08(int, int); static void sub_6FF54(int, int); static void sub_6FFA0(int, int); @@ -283,3 +285,5 @@ static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite) } pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aipod.h b/source/blood/src/aipod.h index 5ef41fa66..826e6ad31 100644 --- a/source/blood/src/aipod.h +++ b/source/blood/src/aipod.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE podIdle; extern AISTATE pod13A600; extern AISTATE podSearch; @@ -39,3 +41,5 @@ extern AISTATE tentacleSearch; extern AISTATE tentacle13A750; extern AISTATE tentacleRecoil; extern AISTATE tentacleChase; + +END_BLD_NS diff --git a/source/blood/src/airat.cpp b/source/blood/src/airat.cpp index 439f56e96..dc0e4b0cc 100644 --- a/source/blood/src/airat.cpp +++ b/source/blood/src/airat.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void BiteSeqCallback(int, int); static void thinkSearch(spritetype *, XSPRITE *); static void thinkGoto(spritetype *, XSPRITE *); @@ -136,3 +138,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &ratGoto); pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/airat.h b/source/blood/src/airat.h index 6c469c7a2..4d76678e1 100644 --- a/source/blood/src/airat.h +++ b/source/blood/src/airat.h @@ -23,10 +23,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE ratIdle; extern AISTATE ratSearch; extern AISTATE ratChase; extern AISTATE ratDodge; extern AISTATE ratRecoil; extern AISTATE ratGoto; -extern AISTATE ratBit; \ No newline at end of file +extern AISTATE ratBit; + +END_BLD_NS diff --git a/source/blood/src/aispid.cpp b/source/blood/src/aispid.cpp index 546a4582e..35f560458 100644 --- a/source/blood/src/aispid.cpp +++ b/source/blood/src/aispid.cpp @@ -43,6 +43,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void SpidBiteSeqCallback(int, int); static void SpidJumpSeqCallback(int, int); static void sub_71370(int, int); @@ -291,3 +293,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &spidGoto); pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aispid.h b/source/blood/src/aispid.h index 152d15199..722f581b5 100644 --- a/source/blood/src/aispid.h +++ b/source/blood/src/aispid.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE spidIdle; extern AISTATE spidChase; extern AISTATE spidDodge; @@ -31,3 +33,5 @@ extern AISTATE spidSearch; extern AISTATE spidBite; extern AISTATE spidJump; extern AISTATE spid13A92C; + +END_BLD_NS diff --git a/source/blood/src/aitchern.cpp b/source/blood/src/aitchern.cpp index 91b5f4fd3..dc927a7f0 100644 --- a/source/blood/src/aitchern.cpp +++ b/source/blood/src/aitchern.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void sub_71A90(int, int); static void sub_71BD4(int, int); static void sub_720AC(int, int); @@ -358,3 +360,5 @@ static void sub_72934(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &tcherno13A9B8); pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aitchern.h b/source/blood/src/aitchern.h index 6065e2ccf..6e16bbc67 100644 --- a/source/blood/src/aitchern.h +++ b/source/blood/src/aitchern.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE tchernobogIdle; extern AISTATE tchernobogSearch; extern AISTATE tchernobogChase; @@ -32,3 +34,5 @@ extern AISTATE tcherno13A9D4; extern AISTATE tcherno13A9F0; extern AISTATE tcherno13AA0C; extern AISTATE tcherno13AA28; + +END_BLD_NS diff --git a/source/blood/src/aiunicult.cpp b/source/blood/src/aiunicult.cpp index 0b13c025f..84ce4966a 100644 --- a/source/blood/src/aiunicult.cpp +++ b/source/blood/src/aiunicult.cpp @@ -47,6 +47,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "triggers.h" #include "endgame.h" +BEGIN_BLD_NS + static void GDXCultistAttack1(int, int); static void punchCallback(int, int); static void ThrowCallback1(int, int); @@ -1168,3 +1170,5 @@ int getSeqStartId(XSPRITE* pXSprite) { return seqStartId; } ////////// + +END_BLD_NS diff --git a/source/blood/src/aiunicult.h b/source/blood/src/aiunicult.h index c89602e31..e991cb29e 100644 --- a/source/blood/src/aiunicult.h +++ b/source/blood/src/aiunicult.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ai.h" #include "eventq.h" +BEGIN_BLD_NS + #define kMaxGenDudeSndMode 11 #define kDefaultAnimationBase 11520 @@ -88,4 +90,6 @@ bool canDuck(spritetype* pSprite); bool CDCanMove(spritetype* pSprite); bool inDodge(AISTATE* aiState); bool inIdle(AISTATE* aiState); -int getSeqStartId(XSPRITE* pXSprite); \ No newline at end of file +int getSeqStartId(XSPRITE* pXSprite); + +END_BLD_NS diff --git a/source/blood/src/aizomba.cpp b/source/blood/src/aizomba.cpp index ab9fd0fd8..10dfb8bed 100644 --- a/source/blood/src/aizomba.cpp +++ b/source/blood/src/aizomba.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void HackSeqCallback(int, int); static void StandSeqCallback(int, int); static void thinkSearch(spritetype *, XSPRITE *); @@ -282,3 +284,5 @@ static void entryEStand(spritetype *pSprite, XSPRITE *pXSprite) sfxPlay3DSound(pSprite, 1100, -1, 0); pSprite->ang = getangle(pXSprite->targetX-pSprite->x, pXSprite->targetY-pSprite->y); } + +END_BLD_NS diff --git a/source/blood/src/aizomba.h b/source/blood/src/aizomba.h index 443553a87..fb5fc622a 100644 --- a/source/blood/src/aizomba.h +++ b/source/blood/src/aizomba.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE zombieAIdle; extern AISTATE zombieAChase; extern AISTATE zombieAPonder; @@ -40,3 +42,5 @@ extern AISTATE zombie2Idle; extern AISTATE zombie2Search; extern AISTATE zombieSIdle; extern AISTATE zombie13AC2C; + +END_BLD_NS diff --git a/source/blood/src/aizombf.cpp b/source/blood/src/aizombf.cpp index 5801a28cb..c80949d2f 100644 --- a/source/blood/src/aizombf.cpp +++ b/source/blood/src/aizombf.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + static void HackSeqCallback(int, int); static void PukeSeqCallback(int, int); static void ThrowSeqCallback(int, int); @@ -231,3 +233,5 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &zombieFSearch); pXSprite->target = -1; } + +END_BLD_NS diff --git a/source/blood/src/aizombf.h b/source/blood/src/aizombf.h index ba112cc93..a7a06608f 100644 --- a/source/blood/src/aizombf.h +++ b/source/blood/src/aizombf.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "ai.h" +BEGIN_BLD_NS + extern AISTATE zombieFIdle; extern AISTATE zombieFChase; extern AISTATE zombieFGoto; @@ -33,3 +35,5 @@ extern AISTATE zombieFThrow; extern AISTATE zombieFSearch; extern AISTATE zombieFRecoil; extern AISTATE zombieFTeslaRecoil; + +END_BLD_NS diff --git a/source/blood/src/asound.cpp b/source/blood/src/asound.cpp index 3db4c513a..12a8a9863 100644 --- a/source/blood/src/asound.cpp +++ b/source/blood/src/asound.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "sound.h" +BEGIN_BLD_NS + #define kMaxAmbChannel 64 struct AMB_CHANNEL @@ -159,3 +161,5 @@ void ambInit(void) } } } + +END_BLD_NS diff --git a/source/blood/src/asound.h b/source/blood/src/asound.h index a442dcbda..0357203f9 100644 --- a/source/blood/src/asound.h +++ b/source/blood/src/asound.h @@ -22,6 +22,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + void ambProcess(void); void ambKillAll(void); -void ambInit(void); \ No newline at end of file +void ambInit(void); + +END_BLD_NS diff --git a/source/blood/src/barf.cpp b/source/blood/src/barf.cpp index 73fd848a4..6308efc42 100644 --- a/source/blood/src/barf.cpp +++ b/source/blood/src/barf.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "globals.h" #include "sound.h" +BEGIN_BLD_NS + static Resource gBarfRes; #define kMaxCmdLineDefines 5 @@ -952,3 +954,4 @@ void sub_11DF0(char* pzScriptDir, char *filePath, char flags, int ID) gSysRes.AddExternalResource(zFilename, zType, ID, flags, zFilePath); } +END_BLD_NS diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index c31e40af1..160ef12c3 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -79,6 +79,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # endif #endif /* _WIN32 */ +BEGIN_BLD_NS + + extern const char* G_DefaultDefFile(void); extern const char* G_DefFile(void); @@ -2555,3 +2558,5 @@ GameInterface Interface = { G_DefaultDefFile, G_DefFile }; + +END_BLD_NS diff --git a/source/blood/src/blood.h b/source/blood/src/blood.h index ff922b917..5d033c2e9 100644 --- a/source/blood/src/blood.h +++ b/source/blood/src/blood.h @@ -26,6 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "db.h" +BEGIN_BLD_NS + struct INIDESCRIPTION { const char *pzName; const char *pzFilename; @@ -81,4 +83,6 @@ bool DemoRecordStatus(void); bool VanillaMode(void); bool fileExistsRFF(int id, const char* ext); int sndTryPlaySpecialMusic(int nMusic); -void sndPlaySpecialMusicOrNothing(int nMusic); \ No newline at end of file +void sndPlaySpecialMusicOrNothing(int nMusic); + +END_BLD_NS diff --git a/source/blood/src/callback.cpp b/source/blood/src/callback.cpp index e93c5591f..fee1f2c75 100644 --- a/source/blood/src/callback.cpp +++ b/source/blood/src/callback.cpp @@ -46,6 +46,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "triggers.h" #include "view.h" +BEGIN_BLD_NS + void makeMissileBlocking(int nSprite) // 23 { dassert(nSprite >= 0 && nSprite < kMaxSprites); @@ -792,3 +794,5 @@ void(*gCallback[kCallbackMax])(int) = UniMissileBurst, makeMissileBlocking, }; + +END_BLD_NS diff --git a/source/blood/src/callback.h b/source/blood/src/callback.h index 4f89099c3..e1cb74870 100644 --- a/source/blood/src/callback.h +++ b/source/blood/src/callback.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS enum CALLBACK_ID { CALLBACK_ID_NONE = -1, @@ -52,4 +53,6 @@ enum CALLBACK_ID { kCallbackMax }; -extern void (*gCallback[kCallbackMax])(int); \ No newline at end of file +extern void (*gCallback[kCallbackMax])(int); + +END_BLD_NS diff --git a/source/blood/src/choke.cpp b/source/blood/src/choke.cpp index 60c129bf1..0aec5c0cd 100644 --- a/source/blood/src/choke.cpp +++ b/source/blood/src/choke.cpp @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "qav.h" #include "resource.h" +BEGIN_BLD_NS void CChoke::sub_83F54(char *a1, int _x, int _y, void (*a2)(PLAYER*)) { @@ -136,4 +137,6 @@ void sub_84230(PLAYER *pPlayer) pPlayer->at36a = ClipHigh(pPlayer->at36a+t*4, 128); } -CChoke gChoke; \ No newline at end of file +CChoke gChoke; + +END_BLD_NS diff --git a/source/blood/src/choke.h b/source/blood/src/choke.h index 34f7c5f54..d8e1c183c 100644 --- a/source/blood/src/choke.h +++ b/source/blood/src/choke.h @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "qav.h" #include "resource.h" +BEGIN_BLD_NS + class CChoke { public: @@ -59,3 +61,5 @@ public: void sub_84230(PLAYER*); extern CChoke gChoke; + +END_BLD_NS diff --git a/source/blood/src/common.cpp b/source/blood/src/common.cpp index c6a737ec9..7b221a039 100644 --- a/source/blood/src/common.cpp +++ b/source/blood/src/common.cpp @@ -49,6 +49,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common.h" #include "common_game.h" +BEGIN_BLD_NS + // g_grpNamePtr can ONLY point to a malloc'd block (length BMAX_PATH) char *g_grpNamePtr = NULL; @@ -774,3 +776,4 @@ success: #endif +END_BLD_NS diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index a9f21731a..1ee49a5f3 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "misc.h" #include "network.h" +BEGIN_BLD_NS + extern int g_useCwd; #ifndef APPNAME @@ -511,6 +513,12 @@ inline char TestBitString(char *pArray, int nIndex) return pArray[nIndex>>3] & (1<<(nIndex&7)); } +// This is to override the namepace prioritization without altering the actual calls. +inline int scale(int a, int b, int c) +{ + return ::scale(a, b, c); +} + inline int scale(int a1, int a2, int a3, int a4, int a5) { return a4 + (a5-a4) * (a1-a2) / (a3-a2); @@ -692,3 +700,5 @@ public: void G_AddGroup(const char* buffer); void G_AddPath(const char* buffer); + +END_BLD_NS diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 9529ba598..89929230c 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -51,6 +51,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define __SETUP__ // JBF 20031211 #include "_functio.h" +BEGIN_BLD_NS + + hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL }; int32_t MouseDeadZone, MouseBias; @@ -1017,63 +1020,5 @@ void CONFIG_WriteSetup(uint32_t flags) Bfflush(NULL); } -#if 0 -static const char *CONFIG_GetMapEntryName(char m[], char const * const mapname) -{ - strcpy(m, mapname); - char *p = strrchr(m, '/'); - if (!p) p = strrchr(m, '\\'); - if (p) Bmemmove(m, p, Bstrlen(p)+1); - for (p=m; *p; p++) *p = tolower(*p); - - // cheap hack because SCRIPT_GetNumber doesn't like the slashes - p = m; - while (*p == '/') p++; - - return p; -} - -static void CONFIG_GetMD4EntryName(char m[], uint8_t const * const md4) -{ - sprintf(m, "MD4_%08x%08x%08x%08x", - B_BIG32(B_UNBUF32(&md4[0])), B_BIG32(B_UNBUF32(&md4[4])), - B_BIG32(B_UNBUF32(&md4[8])), B_BIG32(B_UNBUF32(&md4[12]))); -} - -int32_t CONFIG_GetMapBestTime(char const * const mapname, uint8_t const * const mapmd4) -{ - if (!setupread || scripthandle < 0) - return -1; - - char m[37]; - - CONFIG_GetMD4EntryName(m, mapmd4); - - int32_t t = -1; - if (SCRIPT_GetNumber(scripthandle, "MapTimes", m, &t)) - { - // fall back to map filenames - char m2[BMAX_PATH]; - auto p = CONFIG_GetMapEntryName(m2, mapname); - - SCRIPT_GetNumber(scripthandle, "MapTimes", p, &t); - } - - return t; -} - -int CONFIG_SetMapBestTime(uint8_t const * const mapmd4, int32_t tm) -{ - if (scripthandle < 0 && (scripthandle = SCRIPT_Init(SetupFilename)) < 0) - return -1; - - char m[37]; - - CONFIG_GetMD4EntryName(m, mapmd4); - SCRIPT_PutNumber(scripthandle, "MapTimes", m, tm, FALSE, FALSE); - - return 0; -} - -#endif +END_BLD_NS diff --git a/source/blood/src/config.h b/source/blood/src/config.h index 79751b8db..b589be0e3 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "_control.h" #include "hash.h" +BEGIN_BLD_NS + #define MAXRIDECULE 10 #define MAXRIDECULELENGTH 40 #define MAXPLAYERNAME 16 @@ -116,4 +118,6 @@ const char *CONFIG_AnalogNumToName(int32_t func); void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2); +END_BLD_NS + #endif diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index b2de91de9..1876d58c6 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "map2d.h" #include "view.h" +BEGIN_BLD_NS int32_t ctrlCheckAllInput(void) { @@ -487,3 +488,5 @@ void ctrlGetInput(void) gInput.q16turn = turn; gInput.strafe = strafe; } + +END_BLD_NS diff --git a/source/blood/src/controls.h b/source/blood/src/controls.h index 94f008f86..995e51d00 100644 --- a/source/blood/src/controls.h +++ b/source/blood/src/controls.h @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + #pragma pack(push, 1) union BUTTONFLAGS @@ -110,3 +112,4 @@ void ctrlClearAllInput(void); void ctrlInit(); void ctrlGetInput(); +END_BLD_NS diff --git a/source/blood/src/credits.cpp b/source/blood/src/credits.cpp index 481f20ab0..eb490e5eb 100644 --- a/source/blood/src/credits.cpp +++ b/source/blood/src/credits.cpp @@ -38,6 +38,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "view.h" +BEGIN_BLD_NS + char exitCredits = 0; char Wait(int nTicks) @@ -286,3 +288,5 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav) Bfree(pzSMK_); Bfree(pzWAV_); } + +END_BLD_NS diff --git a/source/blood/src/credits.h b/source/blood/src/credits.h index 3e1bbaaa9..03cbb05ae 100644 --- a/source/blood/src/credits.h +++ b/source/blood/src/credits.h @@ -22,6 +22,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + void credLogosDos(void); void credReset(void); -void credPlaySmk(const char *pzSMK, const char *pzWAV, int nWAV); \ No newline at end of file +void credPlaySmk(const char *pzSMK, const char *pzWAV, int nWAV); + +END_BLD_NS diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index 0c25bba9b..e4321f50a 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "db.h" #include "iob.h" +BEGIN_BLD_NS + unsigned short gStatCount[kMaxStatus + 1]; XSPRITE xsprite[kMaxXSprites]; @@ -1633,16 +1635,7 @@ int dbSaveMap(const char *pPath, int nX, int nY, int nZ, short nAngle, short nSe Bclose(nHandle); Bfree(pData); return 0; -#if 0 - char *pExt = strchr(sMapExt, '.'); - if (pExt) - { - *pExt = 0; - } - gSysRes.AddExternalResource(sMapExt, "MAP", nSize); - DICTNODE *hMap = gSysRes.Lookup(sMapExt, "MAP"); - dassert(hMap != NULL); -#endif + } int32_t qloadboard(const char* filename, char flags, vec3_t* dapos, int16_t* daang, int16_t* dacursectnum) @@ -1657,3 +1650,5 @@ int32_t qsaveboard(const char* filename, const vec3_t* dapos, int16_t daang, int byte_1A76C6 = byte_1A76C8 = byte_1A76C7 = 1; return dbSaveMap(filename, dapos->x, dapos->y, dapos->z, daang, dacursectnum); } + +END_BLD_NS diff --git a/source/blood/src/db.h b/source/blood/src/db.h index 4eee7c83e..05088d586 100644 --- a/source/blood/src/db.h +++ b/source/blood/src/db.h @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + #define kMaxXSprites 2048 #define kMaxXWalls 512 #define kMaxXSectors 512 @@ -336,3 +338,5 @@ void dbInit(void); void PropagateMarkerReferences(void); unsigned int dbReadMapCRC(const char *pPath); int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short *pSector, unsigned int *pCRC); + +END_BLD_NS diff --git a/source/blood/src/demo.cpp b/source/blood/src/demo.cpp index a07a072c9..9792781ef 100644 --- a/source/blood/src/demo.cpp +++ b/source/blood/src/demo.cpp @@ -48,6 +48,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "screen.h" #include "view.h" +BEGIN_BLD_NS + int nBuild = 0; void ReadGameOptionsLegacy(GAMEOPTIONS &gameOptions, GAMEOPTIONSLEGACY &gameOptionsLegacy) @@ -627,3 +629,5 @@ void CDemo::ReadInput(int nCount) } } } + +END_BLD_NS diff --git a/source/blood/src/demo.h b/source/blood/src/demo.h index 03f0a6729..dc1a6b0db 100644 --- a/source/blood/src/demo.h +++ b/source/blood/src/demo.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "controls.h" #include "levels.h" +BEGIN_BLD_NS + #define kInputBufferSize 1024 #pragma pack(push, 1) @@ -108,3 +110,5 @@ public: }; extern CDemo gDemo; + +END_BLD_NS diff --git a/source/blood/src/dude.cpp b/source/blood/src/dude.cpp index 01c9a35c7..3102f2c9b 100644 --- a/source/blood/src/dude.cpp +++ b/source/blood/src/dude.cpp @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "blood.h" #include "dude.h" +BEGIN_BLD_NS + DUDEINFO dudeInfo[kDudeMax-kDudeBase] = { { @@ -1728,3 +1730,5 @@ DUDEINFO gPlayerTemplate[4] = 0 }, }; + +END_BLD_NS diff --git a/source/blood/src/dude.h b/source/blood/src/dude.h index 5f317e520..0f2b9ce97 100644 --- a/source/blood/src/dude.h +++ b/source/blood/src/dude.h @@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once #include "blood.h" + +BEGIN_BLD_NS + // By NoOne: renamed dude struct struct DUDEINFO { short seqStartID; // seq @@ -53,4 +56,6 @@ struct DUDEINFO { }; extern DUDEINFO dudeInfo[kDudeMax-kDudeBase]; -extern DUDEINFO gPlayerTemplate[4]; \ No newline at end of file +extern DUDEINFO gPlayerTemplate[4]; + +END_BLD_NS diff --git a/source/blood/src/endgame.cpp b/source/blood/src/endgame.cpp index 766716cfd..735abb2d3 100644 --- a/source/blood/src/endgame.cpp +++ b/source/blood/src/endgame.cpp @@ -40,6 +40,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "view.h" #include "messages.h" +BEGIN_BLD_NS + CEndGameMgr::CEndGameMgr() { at0 = 0; @@ -279,3 +281,5 @@ void EndGameLoadSaveConstruct(void) { myLoadSave = new EndGameLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/endgame.h b/source/blood/src/endgame.h index 8c66fdc53..423fa3c4b 100644 --- a/source/blood/src/endgame.h +++ b/source/blood/src/endgame.h @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "common_game.h" +BEGIN_BLD_NS + class CEndGameMgr { public: char at0; @@ -60,3 +62,5 @@ public: extern CEndGameMgr gEndGameMgr; extern CSecretMgr gSecretMgr; extern CKillMgr gKillMgr; + +END_BLD_NS diff --git a/source/blood/src/eventq.cpp b/source/blood/src/eventq.cpp index a0ea9456b..f55055a54 100644 --- a/source/blood/src/eventq.cpp +++ b/source/blood/src/eventq.cpp @@ -37,6 +37,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "pqueue.h" #include "triggers.h" +BEGIN_BLD_NS + class EventQueue { public: @@ -605,3 +607,5 @@ void EventQLoadSaveConstruct(void) { myLoadSave = new EventQLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/eventq.h b/source/blood/src/eventq.h index 686adcaed..cc8a5940b 100644 --- a/source/blood/src/eventq.h +++ b/source/blood/src/eventq.h @@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once #include "callback.h" + +BEGIN_BLD_NS + #define kMaxChannels 4096 struct RXBUCKET @@ -64,4 +67,6 @@ void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command); void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID a4); void evProcess(unsigned int nTime); void evKill(int a1, int a2); -void evKill(int a1, int a2, CALLBACK_ID a3); \ No newline at end of file +void evKill(int a1, int a2, CALLBACK_ID a3); + +END_BLD_NS diff --git a/source/blood/src/fire.cpp b/source/blood/src/fire.cpp index edabd7a2e..04cb07b8b 100644 --- a/source/blood/src/fire.cpp +++ b/source/blood/src/fire.cpp @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "misc.h" #include "tile.h" +BEGIN_BLD_NS + int fireSize = 128; int gDamping = 6; @@ -125,3 +127,5 @@ void CellularFrame(char *pFrame, int sizeX, int sizeY) pPtr1++; } } + +END_BLD_NS diff --git a/source/blood/src/fire.h b/source/blood/src/fire.h index 0fc76789b..62771b038 100644 --- a/source/blood/src/fire.h +++ b/source/blood/src/fire.h @@ -22,5 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + void FireInit(void); -void FireProcess(void); \ No newline at end of file +void FireProcess(void); + +END_BLD_NS diff --git a/source/blood/src/function.h b/source/blood/src/function.h index 848ca83c8..0a9a4f701 100644 --- a/source/blood/src/function.h +++ b/source/blood/src/function.h @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef function_public_h_ #define function_public_h_ +BEGIN_BLD_NS + #define NUMGAMEFUNCTIONS 55 #define MAXGAMEFUNCLEN 32 @@ -97,4 +99,8 @@ enum GameFunction_t gamefunc_RemoteBombs, gamefunc_Show_Console, }; + +END_BLD_NS + #endif + diff --git a/source/blood/src/fx.cpp b/source/blood/src/fx.cpp index 773eb4736..29282e108 100644 --- a/source/blood/src/fx.cpp +++ b/source/blood/src/fx.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trig.h" #include "view.h" +BEGIN_BLD_NS + CFX gFX; struct FXDATA { @@ -348,3 +350,5 @@ void sub_74A18(spritetype *pSprite, int z, int a3, int a4) zvel[pShell->index] = zvel[pSprite->index]-(0x20000+(Random2(20)<<18)/120); } } + +END_BLD_NS diff --git a/source/blood/src/fx.h b/source/blood/src/fx.h index 5d6c8809e..02566bd9a 100644 --- a/source/blood/src/fx.h +++ b/source/blood/src/fx.h @@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "common_game.h" +BEGIN_BLD_NS + + enum FX_ID { FX_NONE = -1, FX_0 = 0, @@ -100,3 +103,5 @@ void sub_74818(spritetype *pSprite, int z, int a3, int a4); void sub_74A18(spritetype *pSprite, int z, int a3, int a4); extern CFX gFX; + +END_BLD_NS diff --git a/source/blood/src/gamedefs.h b/source/blood/src/gamedefs.h index a2b488eab..aa5105ced 100644 --- a/source/blood/src/gamedefs.h +++ b/source/blood/src/gamedefs.h @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef gamedefs_public_h_ #define gamedefs_public_h_ +BEGIN_BLD_NS + // config file name #define SETUPFILENAME APPBASENAME ".cfg" @@ -62,5 +64,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define DEFAULTJOYSTICKANALOGUESATURATE 9500 #endif +END_BLD_NS + #endif diff --git a/source/blood/src/gamemenu.cpp b/source/blood/src/gamemenu.cpp index 5ff539a20..c9c13100b 100644 --- a/source/blood/src/gamemenu.cpp +++ b/source/blood/src/gamemenu.cpp @@ -38,6 +38,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "view.h" +BEGIN_BLD_NS + CMenuTextMgr gMenuTextMgr; CGameMenuMgr gGameMenuMgr; @@ -3005,4 +3007,6 @@ bool CGameMenuItemPassword::Event(CGameMenuEvent &event) } } return CGameMenuItem::Event(event); -} \ No newline at end of file +} + +END_BLD_NS diff --git a/source/blood/src/gamemenu.h b/source/blood/src/gamemenu.h index f65ca1a61..f1cad59af 100644 --- a/source/blood/src/gamemenu.h +++ b/source/blood/src/gamemenu.h @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "qav.h" +BEGIN_BLD_NS + #define M_MOUSETIMEOUT 210 #define kMaxGameMenuItems 128 @@ -488,3 +490,5 @@ public: extern CMenuTextMgr gMenuTextMgr; extern CGameMenuMgr gGameMenuMgr; + +END_BLD_NS diff --git a/source/blood/src/gameutil.cpp b/source/blood/src/gameutil.cpp index ac8363b0d..f421743f7 100644 --- a/source/blood/src/gameutil.cpp +++ b/source/blood/src/gameutil.cpp @@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "tile.h" #include "trig.h" +BEGIN_BLD_NS + POINT2D baseWall[kMaxWalls]; POINT3D baseSprite[kMaxSprites]; int baseFloor[kMaxSectors]; @@ -905,3 +907,5 @@ int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, short *pSector } return n; } + +END_BLD_NS diff --git a/source/blood/src/gameutil.h b/source/blood/src/gameutil.h index 29d69d092..851fa66e1 100644 --- a/source/blood/src/gameutil.h +++ b/source/blood/src/gameutil.h @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "common_game.h" +BEGIN_BLD_NS + struct HITINFO { short hitsect; short hitwall; @@ -66,3 +68,5 @@ int GetDistToLine(int x1, int y1, int x2, int y2, int x3, int y3); unsigned int ClipMove(int *x, int *y, int *z, int *nSector, int xv, int yv, int wd, int cd, int fd, unsigned int nMask); int GetClosestSectors(int nSector, int x, int y, int nDist, short *pSectors, char *pSectBit); int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, short *pSectors, char *pSectBit, short *a8); + +END_BLD_NS diff --git a/source/blood/src/getopt.cpp b/source/blood/src/getopt.cpp index b472071d0..d422a1fea 100644 --- a/source/blood/src/getopt.cpp +++ b/source/blood/src/getopt.cpp @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "getopt.h" +BEGIN_BLD_NS + int margc; char const * const *margv; @@ -93,3 +95,5 @@ int GetOptions(SWITCH *switches) } return vd; } + +END_BLD_NS diff --git a/source/blood/src/getopt.h b/source/blood/src/getopt.h index d0bb6e7e1..fa8032f93 100644 --- a/source/blood/src/getopt.h +++ b/source/blood/src/getopt.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS extern int margc; extern char const * const *margv; @@ -34,4 +35,6 @@ struct SWITCH { const char *name; int at4, at8; }; -int GetOptions(SWITCH *switches); \ No newline at end of file +int GetOptions(SWITCH *switches); + +END_BLD_NS diff --git a/source/blood/src/gib.cpp b/source/blood/src/gib.cpp index 40a31cc40..ef12fe531 100644 --- a/source/blood/src/gib.cpp +++ b/source/blood/src/gib.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "trig.h" +BEGIN_BLD_NS + struct GIBFX { FX_ID at0; @@ -510,3 +512,5 @@ void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel) GibFX(nWall, pGibFX, ceilZ, wx, wy, wz, pVel); } } + +END_BLD_NS diff --git a/source/blood/src/gib.h b/source/blood/src/gib.h index 70dee7135..957db5fa1 100644 --- a/source/blood/src/gib.h +++ b/source/blood/src/gib.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS enum GIBTYPE { GIBTYPE_0 = 0, @@ -73,3 +74,5 @@ public: void GibSprite(spritetype *pSprite, GIBTYPE nGibType, CGibPosition *pPos, CGibVelocity *pVel); //void GibFX(int nWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVelocity * pVel); void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel); + +END_BLD_NS diff --git a/source/blood/src/globals.cpp b/source/blood/src/globals.cpp index de03e7f1f..738274e25 100644 --- a/source/blood/src/globals.cpp +++ b/source/blood/src/globals.cpp @@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "globals.h" #include "resource.h" +BEGIN_BLD_NS ud_setup_t gSetup; bool bVanilla = false; @@ -93,4 +94,6 @@ const char *GetVersionString(void) sprintf(gVersionString, "%d.%02d", EXEVERSION / 100, EXEVERSION % 100); } return gVersionString; -} \ No newline at end of file +} + +END_BLD_NS diff --git a/source/blood/src/globals.h b/source/blood/src/globals.h index 8aa8cd4b5..1eabd1f03 100644 --- a/source/blood/src/globals.h +++ b/source/blood/src/globals.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "resource.h" +BEGIN_BLD_NS + typedef struct { int32_t usejoystick; int32_t usemouse; @@ -46,4 +48,6 @@ extern int gGamma; extern bool bVanilla; extern Resource gSysRes; -const char *GetVersionString(void); \ No newline at end of file +const char *GetVersionString(void); + +END_BLD_NS diff --git a/source/blood/src/inifile.cpp b/source/blood/src/inifile.cpp index 84ff7e45b..bc7543a12 100644 --- a/source/blood/src/inifile.cpp +++ b/source/blood/src/inifile.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "inifile.h" #include "misc.h" +BEGIN_BLD_NS + IniFile::IniFile(const char *fileName) { @@ -465,3 +467,6 @@ IniFile::~IniFile() free(anotherNode); } } + + +END_BLD_NS diff --git a/source/blood/src/inifile.h b/source/blood/src/inifile.h index 2fe0490eb..7474968dc 100644 --- a/source/blood/src/inifile.h +++ b/source/blood/src/inifile.h @@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- // Note: This module is based on the sirlemonhead's work #pragma once + +BEGIN_BLD_NS + struct FNODE { FNODE *next; @@ -65,4 +68,6 @@ private: void LoadRes(void *); void Load(); -}; \ No newline at end of file +}; + +END_BLD_NS diff --git a/source/blood/src/iob.cpp b/source/blood/src/iob.cpp index f0b377820..932b1a148 100644 --- a/source/blood/src/iob.cpp +++ b/source/blood/src/iob.cpp @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "iob.h" +BEGIN_BLD_NS + IOBuffer::IOBuffer(int _nRemain, char *_pBuffer) { nRemain = _nRemain; @@ -74,3 +76,5 @@ void IOBuffer::Skip(int nSize) ThrowError("Skip overflow"); } } + +END_BLD_NS diff --git a/source/blood/src/iob.h b/source/blood/src/iob.h index b9379866d..27476063d 100644 --- a/source/blood/src/iob.h +++ b/source/blood/src/iob.h @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS + class IOBuffer { public: @@ -31,4 +33,6 @@ public: void Read(void *, int); void Write(void *, int); void Skip(int); -}; \ No newline at end of file +}; + +END_BLD_NS diff --git a/source/blood/src/levels.cpp b/source/blood/src/levels.cpp index 632496828..82a42bd97 100644 --- a/source/blood/src/levels.cpp +++ b/source/blood/src/levels.cpp @@ -43,6 +43,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "view.h" +BEGIN_BLD_NS + GAMEOPTIONS gGameOptions; GAMEOPTIONS gSingleGameOptions = { @@ -443,3 +445,4 @@ void LevelsLoadSaveConstruct(void) myLoadSave = new LevelsLoadSave(); } +END_BLD_NS diff --git a/source/blood/src/levels.h b/source/blood/src/levels.h index 02ace75b8..f331b0d89 100644 --- a/source/blood/src/levels.h +++ b/source/blood/src/levels.h @@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "inifile.h" +BEGIN_BLD_NS + + #define kMaxMessages 32 #define kMaxEpisodes 7 #define kMaxLevels 16 @@ -139,3 +142,5 @@ void levelRestart(void); int levelGetMusicIdx(const char *str); bool levelTryPlayMusic(int nEpisode, int nlevel, bool bSetLevelSong = false); void levelTryPlayMusicOrNothing(int nEpisode, int nLevel); + +END_BLD_NS diff --git a/source/blood/src/loadsave.cpp b/source/blood/src/loadsave.cpp index 239267eb2..165be9c9f 100644 --- a/source/blood/src/loadsave.cpp +++ b/source/blood/src/loadsave.cpp @@ -46,6 +46,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "view.h" +BEGIN_BLD_NS + GAMEOPTIONS gSaveGameOptions[10]; char *gSaveGamePic[10]; unsigned int gSavedOffset = 0; @@ -466,22 +468,22 @@ void UpdateSavedInfo(int nSlot) static MyLoadSave *myLoadSave; +void ActorLoadSaveConstruct(void); +void AILoadSaveConstruct(void); +void EndGameLoadSaveConstruct(void); +void EventQLoadSaveConstruct(void); +void LevelsLoadSaveConstruct(void); +void MessagesLoadSaveConstruct(void); +void MirrorLoadSaveConstruct(void); +void PlayerLoadSaveConstruct(void); +void SeqLoadSaveConstruct(void); +void TriggersLoadSaveConstruct(void); +void ViewLoadSaveConstruct(void); +void WarpLoadSaveConstruct(void); +void WeaponLoadSaveConstruct(void); + void LoadSaveSetup(void) { - void ActorLoadSaveConstruct(void); - void AILoadSaveConstruct(void); - void EndGameLoadSaveConstruct(void); - void EventQLoadSaveConstruct(void); - void LevelsLoadSaveConstruct(void); - void MessagesLoadSaveConstruct(void); - void MirrorLoadSaveConstruct(void); - void PlayerLoadSaveConstruct(void); - void SeqLoadSaveConstruct(void); - void TriggersLoadSaveConstruct(void); - void ViewLoadSaveConstruct(void); - void WarpLoadSaveConstruct(void); - void WeaponLoadSaveConstruct(void); - myLoadSave = new MyLoadSave(); ActorLoadSaveConstruct(); @@ -497,4 +499,6 @@ void LoadSaveSetup(void) ViewLoadSaveConstruct(); WarpLoadSaveConstruct(); WeaponLoadSaveConstruct(); -} \ No newline at end of file +} + +END_BLD_NS diff --git a/source/blood/src/loadsave.h b/source/blood/src/loadsave.h index 03c164d68..03f6ffd87 100644 --- a/source/blood/src/loadsave.h +++ b/source/blood/src/loadsave.h @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include "levels.h" +BEGIN_BLD_NS + class LoadSave { public: static LoadSave head; @@ -57,3 +59,5 @@ extern char *gSaveGamePic[10]; void UpdateSavedInfo(int nSlot); void LoadSavedInfo(void); void LoadSaveSetup(void); + +END_BLD_NS diff --git a/source/blood/src/map2d.cpp b/source/blood/src/map2d.cpp index d5530ede3..87aa0943d 100644 --- a/source/blood/src/map2d.cpp +++ b/source/blood/src/map2d.cpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trig.h" #include "view.h" +BEGIN_BLD_NS + void sub_2541C(int x, int y, int z, short a) { int tmpydim = (xdim * 5) / 8; @@ -253,3 +255,6 @@ void CViewMap::FollowMode(char mode) } CViewMap gViewMap; + + +END_BLD_NS diff --git a/source/blood/src/map2d.h b/source/blood/src/map2d.h index b74c819c8..ce0e64f9d 100644 --- a/source/blood/src/map2d.h +++ b/source/blood/src/map2d.h @@ -23,6 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "common_game.h" #include "db.h" + +BEGIN_BLD_NS + class CViewMap { public: char bActive; @@ -39,3 +42,5 @@ public: }; extern CViewMap gViewMap; + +END_BLD_NS diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index bd5a5ac03..9dc6031a1 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "view.h" +BEGIN_BLD_NS + void SaveGame(CGameMenuItemZEditBitmap *, CGameMenuEvent *); void SaveGameProcess(CGameMenuItemChain *); @@ -2292,3 +2294,5 @@ void drawLoadingScreen(void) sprintf(buffer, "%s", zNetGameTypes[gGameOptions.nGameType-1]); viewLoadingScreen(2049, buffer, levelGetTitle(), NULL); } + +END_BLD_NS diff --git a/source/blood/src/menu.h b/source/blood/src/menu.h index bfa447e88..ba93750a9 100644 --- a/source/blood/src/menu.h +++ b/source/blood/src/menu.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "gamemenu.h" +BEGIN_BLD_NS + extern CGameMenu menuMain; extern CGameMenu menuMainWithSave; extern CGameMenu menuNetMain; @@ -55,4 +57,6 @@ void drawLoadingScreen(void); void SetupMenus(void); void UpdateNetworkMenus(void); void QuickSaveGame(void); -void QuickLoadGame(void); \ No newline at end of file +void QuickLoadGame(void); + +END_BLD_NS diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index 24abae951..7a7812afb 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -42,6 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "player.h" #include "view.h" +BEGIN_BLD_NS + CPlayerMsg gPlayerMsg; CCheatMgr gCheatMgr; @@ -939,3 +941,5 @@ void MessagesLoadSaveConstruct(void) { myLoadSave = new MessagesLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/messages.h b/source/blood/src/messages.h index 03b44ca45..b6bd95342 100644 --- a/source/blood/src/messages.h +++ b/source/blood/src/messages.h @@ -26,6 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "player.h" +BEGIN_BLD_NS + #define kMessageLogSize 32 #define kMaxMessageTextLength 81 @@ -164,3 +166,5 @@ void SetArmor(bool stat); void SetKeys(bool stat); void SetGodMode(bool god); void SetClipMode(bool noclip); + +END_BLD_NS diff --git a/source/blood/src/mirrors.cpp b/source/blood/src/mirrors.cpp index acb5f5ddd..6a7bb7b26 100644 --- a/source/blood/src/mirrors.cpp +++ b/source/blood/src/mirrors.cpp @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "view.h" #include "warp.h" +BEGIN_BLD_NS + int mirrorcnt, mirrorsector, mirrorwall[4]; typedef struct @@ -194,7 +196,6 @@ void TranslateMirrorColors(int nShade, int nPalette) videoBeginDrawing(); nShade = ClipRange(nShade, 0, 63); char *pMap = palookup[nPalette] + (nShade<<8); - extern intptr_t frameplace; char *pFrame = (char*)frameplace; unsigned int nPixels = xdim*ydim; for (unsigned int i = 0; i < nPixels; i++, pFrame++) @@ -536,3 +537,5 @@ void MirrorLoadSaveConstruct(void) { myLoadSave = new MirrorLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/mirrors.h b/source/blood/src/mirrors.h index 657f9fc61..deff6d4f1 100644 --- a/source/blood/src/mirrors.h +++ b/source/blood/src/mirrors.h @@ -22,7 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once #include "fix16.h" + +BEGIN_BLD_NS + void InitMirrors(void); void sub_5571C(char mode); void sub_557C4(int x, int y, int interpolation); void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int viewPlayer); + +END_BLD_NS diff --git a/source/blood/src/misc.cpp b/source/blood/src/misc.cpp index 8338fc106..40a7bfd01 100644 --- a/source/blood/src/misc.cpp +++ b/source/blood/src/misc.cpp @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "misc.h" +BEGIN_BLD_NS + void *ResReadLine(char *buffer, unsigned int nBytes, void **pRes) { unsigned int i; @@ -210,3 +212,4 @@ void ConcatPath(const char *pzPath1, const char *pzPath2, char *pzConcatPath) } +END_BLD_NS diff --git a/source/blood/src/misc.h b/source/blood/src/misc.h index 8e83e82ac..3763d4c7d 100644 --- a/source/blood/src/misc.h +++ b/source/blood/src/misc.h @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #pragma once + +BEGIN_BLD_NS + void *ResReadLine(char *buffer, unsigned int nBytes, void **pRes); bool FileRead(FILE *, void *, unsigned int); bool FileWrite(FILE *, void *, unsigned int); @@ -32,3 +35,5 @@ void wsrand(int); void ChangeExtension(char *pzFile, const char *pzExt); void SplitPath(const char *pzPath, char *pzDirectory, char *pzFile, char *pzType); void ConcatPath(const char* pzPath1, const char* pzPath2, char* pzConcatPath); + +END_BLD_NS diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index ba220a08a..bb8019faf 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "view.h" +BEGIN_BLD_NS + char packet[576]; bool gStartNewGame = 0; PACKETMODE gPacketMode = PACKETMODE_1; @@ -1433,3 +1435,5 @@ void netPlayerQuit(int nPlayer) netResetToSinglePlayer(); } } + +END_BLD_NS diff --git a/source/blood/src/network.h b/source/blood/src/network.h index 6af59b40d..96573ea99 100644 --- a/source/blood/src/network.h +++ b/source/blood/src/network.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "controls.h" +BEGIN_BLD_NS + enum PACKETMODE { PACKETMODE_0 = 0, PACKETMODE_1, @@ -156,3 +158,5 @@ void netPlayerQuit(int nPlayer); void netUpdate(void); void netDeinitialize(void); void netBroadcastNewGame(void); + +END_BLD_NS diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index cd663beb2..2fb6742a5 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "view.h" +BEGIN_BLD_NS static inline int osdcmd_quit(osdcmdptr_t UNUSED(parm)) { @@ -1162,3 +1163,4 @@ void GAME_clearbackground(int numcols, int numrows) COMMON_clearbackground(numcols, numrows); } +END_BLD_NS diff --git a/source/blood/src/osdcmds.h b/source/blood/src/osdcmds.h index 57dacb846..14fe971ab 100644 --- a/source/blood/src/osdcmds.h +++ b/source/blood/src/osdcmds.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS int32_t registerosdcommands(void); void onvideomodechange(int32_t newmode); @@ -34,3 +35,4 @@ extern const char *const ConsoleButtons[]; extern uint32_t cl_cheatmask; +END_BLD_NS diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 1f8d6a574..a34b9ddf2 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -54,6 +54,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "messages.h" +BEGIN_BLD_NS + PROFILE gProfile[kMaxPlayers]; PLAYER gPlayer[kMaxPlayers]; @@ -2426,3 +2428,5 @@ void PlayerLoadSaveConstruct(void) { myLoadSave = new PlayerLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/player.h b/source/blood/src/player.h index 18238130d..253382d63 100644 --- a/source/blood/src/player.h +++ b/source/blood/src/player.h @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "db.h" #include "dude.h" +BEGIN_BLD_NS + enum LifeMode { kModeHuman = 0, kModeBeast, @@ -256,3 +258,5 @@ bool shrinkPlayerSize(PLAYER* pPlayer, int divider); bool growPlayerSize(PLAYER* pPlayer, int multiplier); bool resetPlayerSize(PLAYER* pPlayer); void deactivateSizeShrooms(PLAYER* pPlayer); + +END_BLD_NS diff --git a/source/blood/src/pqueue.h b/source/blood/src/pqueue.h index 01fb9df4f..93abe5be2 100644 --- a/source/blood/src/pqueue.h +++ b/source/blood/src/pqueue.h @@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include "common_game.h" + +BEGIN_BLD_NS + #define kPQueueSize 1024 template struct queueItem @@ -184,3 +187,5 @@ public: } } }; + +END_BLD_NS diff --git a/source/blood/src/qav.cpp b/source/blood/src/qav.cpp index 441356d2c..9455289eb 100644 --- a/source/blood/src/qav.cpp +++ b/source/blood/src/qav.cpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sfx.h" #include "sound.h" +BEGIN_BLD_NS + #define kMaxClients 64 static void (*clientCallback[kMaxClients])(int, void *); static int nClients; @@ -141,4 +143,6 @@ void QAV::Preload(void) tilePreloadTile(frames[i].tiles[j].picnum); } } -} \ No newline at end of file +} + +END_BLD_NS diff --git a/source/blood/src/qav.h b/source/blood/src/qav.h index d9afbc6bd..e52394c74 100644 --- a/source/blood/src/qav.h +++ b/source/blood/src/qav.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "blood.h" +BEGIN_BLD_NS + #define kQavOrientationLeft 4096 #pragma pack(push, 1) @@ -88,3 +90,5 @@ struct QAV #pragma pack(pop) int qavRegisterClient(void(*pClient)(int, void *)); + +END_BLD_NS diff --git a/source/blood/src/replace.cpp b/source/blood/src/replace.cpp index 54f5bc970..c91448826 100644 --- a/source/blood/src/replace.cpp +++ b/source/blood/src/replace.cpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "tile.h" #include "screen.h" +BEGIN_BLD_NS + int qanimateoffs(int a1, int a2) { int offset = 0; @@ -76,15 +78,16 @@ int32_t qgetpalookup(int32_t a1, int32_t a2) return ClipRange((a1 >> 8) + a2, 0, 63); } +void qinitspritelists(); +int32_t qinsertsprite(int16_t nSector, int16_t nStat); +int32_t qdeletesprite(int16_t nSprite); +int32_t qchangespritesect(int16_t nSprite, int16_t nSector); +int32_t qchangespritestat(int16_t nSprite, int16_t nStatus); +int32_t qloadboard(const char* filename, char flags, vec3_t* dapos, int16_t* daang, int16_t* dacursectnum); +int32_t qsaveboard(const char* filename, const vec3_t* dapos, int16_t daang, int16_t dacursectnum); + void HookReplaceFunctions(void) { - void qinitspritelists(); - int32_t qinsertsprite(int16_t nSector, int16_t nStat); - int32_t qdeletesprite(int16_t nSprite); - int32_t qchangespritesect(int16_t nSprite, int16_t nSector); - int32_t qchangespritestat(int16_t nSprite, int16_t nStatus); - int32_t qloadboard(const char* filename, char flags, vec3_t* dapos, int16_t* daang, int16_t* dacursectnum); - int32_t qsaveboard(const char* filename, const vec3_t* dapos, int16_t daang, int16_t dacursectnum); animateoffs_replace = qanimateoffs; paletteLoadFromDisk_replace = qloadpalette; getpalookup_replace = qgetpalookup; @@ -98,3 +101,5 @@ void HookReplaceFunctions(void) saveboard_replace = qsaveboard; bloodhack = true; } + +END_BLD_NS diff --git a/source/blood/src/replace.h b/source/blood/src/replace.h index 529777b6f..bddb8615a 100644 --- a/source/blood/src/replace.h +++ b/source/blood/src/replace.h @@ -23,7 +23,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "compat.h" +BEGIN_BLD_NS + int qanimateoffs(int a1, int a2); void qloadpalette(); int32_t qgetpalookup(int32_t a1, int32_t a2); -void HookReplaceFunctions(); \ No newline at end of file +void HookReplaceFunctions(); + +END_BLD_NS diff --git a/source/blood/src/resource.cpp b/source/blood/src/resource.cpp index c23af3796..e2743223b 100644 --- a/source/blood/src/resource.cpp +++ b/source/blood/src/resource.cpp @@ -44,6 +44,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #endif +BEGIN_BLD_NS + CACHENODE Resource::purgeHead = { NULL, &purgeHead, &purgeHead, 0 }; #ifdef USE_QHEAP @@ -858,3 +860,5 @@ void Resource::RemoveNode(DICTNODE* pNode) } Reindex(); } + +END_BLD_NS diff --git a/source/blood/src/resource.h b/source/blood/src/resource.h index d5d5dcdcc..5d2894aaa 100644 --- a/source/blood/src/resource.h +++ b/source/blood/src/resource.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common.h" #include "qheap.h" +BEGIN_BLD_NS + #pragma pack(push, 1) enum DICTFLAGS { @@ -125,3 +127,5 @@ public: #endif static CACHENODE purgeHead; }; + +END_BLD_NS diff --git a/source/blood/src/screen.cpp b/source/blood/src/screen.cpp index dd1e7423e..eda44f346 100644 --- a/source/blood/src/screen.cpp +++ b/source/blood/src/screen.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "screen.h" +BEGIN_BLD_NS + LOADITEM PLU[15] = { { 0, "NORMAL" }, { 1, "SATURATE" }, @@ -289,3 +291,5 @@ void scrNextPage(void) { videoNextPage(); } + +END_BLD_NS diff --git a/source/blood/src/screen.h b/source/blood/src/screen.h index 6c04da6b2..5832666c7 100644 --- a/source/blood/src/screen.h +++ b/source/blood/src/screen.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS struct LOADITEM { int id; @@ -54,4 +55,6 @@ void scrSetDac(void); void scrInit(void); void scrUnInit(void); void scrSetGameMode(int vidMode, int XRes, int YRes, int nBits); -void scrNextPage(void); \ No newline at end of file +void scrNextPage(void); + +END_BLD_NS diff --git a/source/blood/src/sectorfx.cpp b/source/blood/src/sectorfx.cpp index 6edac91fb..c593e3b06 100644 --- a/source/blood/src/sectorfx.cpp +++ b/source/blood/src/sectorfx.cpp @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "trig.h" #include "sectorfx.h" +BEGIN_BLD_NS + char flicker1[] = { 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, @@ -425,3 +427,5 @@ short * CSectorListMgr::GetSectorList(int nList) { return nSectors+nListStart[nList]; } + +END_BLD_NS diff --git a/source/blood/src/sectorfx.h b/source/blood/src/sectorfx.h index ecdc0e6b9..766e2e8d6 100644 --- a/source/blood/src/sectorfx.h +++ b/source/blood/src/sectorfx.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once +BEGIN_BLD_NS extern int shadeCount; extern short shadeList[kMaxXSectors]; @@ -31,4 +32,6 @@ extern short panList[kMaxXSectors]; void DoSectorLighting(void); void UndoSectorLighting(void); void DoSectorPanning(void); -void InitSectorFX(void); \ No newline at end of file +void InitSectorFX(void); + +END_BLD_NS diff --git a/source/blood/src/seq.cpp b/source/blood/src/seq.cpp index 6fca9efe3..4f83c374e 100644 --- a/source/blood/src/seq.cpp +++ b/source/blood/src/seq.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "actor.h" #include "tile.h" +BEGIN_BLD_NS + #define kMaxClients 256 #define kMaxSequences 1024 @@ -605,3 +607,5 @@ void SeqLoadSaveConstruct(void) { myLoadSave = new SeqLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/seq.h b/source/blood/src/seq.h index d62e6ceaa..988e43fe4 100644 --- a/source/blood/src/seq.h +++ b/source/blood/src/seq.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "resource.h" +BEGIN_BLD_NS + struct SEQFRAME { unsigned int tile : 12; unsigned int at1_4 : 1; // transparent @@ -91,4 +93,6 @@ void seqKill(int a1, int a2); void seqKillAll(void); int seqGetStatus(int a1, int a2); int seqGetID(int a1, int a2); -void seqProcess(int a1); \ No newline at end of file +void seqProcess(int a1); + +END_BLD_NS diff --git a/source/blood/src/sfx.cpp b/source/blood/src/sfx.cpp index 6455f7e9d..a93a37ed6 100644 --- a/source/blood/src/sfx.cpp +++ b/source/blood/src/sfx.cpp @@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "trig.h" +BEGIN_BLD_NS + POINT2D earL, earR, earL0, earR0; // Ear position VECTOR2D earVL, earVR; // Ear velocity ? int lPhase, rPhase, lVol, rVol, lPitch, rPitch; @@ -528,3 +530,5 @@ void sfxSetReverb2(bool toggle) else FX_SetReverb(0); } + +END_BLD_NS diff --git a/source/blood/src/sfx.h b/source/blood/src/sfx.h index 3545118ac..98665faf5 100644 --- a/source/blood/src/sfx.h +++ b/source/blood/src/sfx.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "db.h" +BEGIN_BLD_NS + void sfxInit(void); void sfxTerm(void); void sfxPlay3DSound(int x, int y, int z, int soundId, int nSector); @@ -32,4 +34,6 @@ void sfxKill3DSound(spritetype *pSprite, int a2 = -1, int a3 = -1); void sfxKillAllSounds(void); void sfxUpdate3DSounds(void); void sfxSetReverb(bool toggle); -void sfxSetReverb2(bool toggle); \ No newline at end of file +void sfxSetReverb2(bool toggle); + +END_BLD_NS diff --git a/source/blood/src/sound.cpp b/source/blood/src/sound.cpp index abe6be5ba..ac9b20875 100644 --- a/source/blood/src/sound.cpp +++ b/source/blood/src/sound.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "renderlayer.h" +BEGIN_BLD_NS + int32_t SoundToggle; int32_t MusicToggle; int32_t CDAudioToggle; @@ -501,3 +503,5 @@ void sndInit(void) //atexit(sndTerm); sndActive = true; } + +END_BLD_NS diff --git a/source/blood/src/sound.h b/source/blood/src/sound.h index a98ace6b8..3451074b9 100644 --- a/source/blood/src/sound.h +++ b/source/blood/src/sound.h @@ -23,6 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "resource.h" + +BEGIN_BLD_NS + struct SAMPLE2D { int at0; @@ -70,3 +73,5 @@ void sndTerm(void); void sndInit(void); extern Resource gSoundRes; + +END_BLD_NS diff --git a/source/blood/src/startwin.game.cpp b/source/blood/src/startwin.game.cpp index 62c8630a4..ab84ad944 100644 --- a/source/blood/src/startwin.game.cpp +++ b/source/blood/src/startwin.game.cpp @@ -53,6 +53,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "startwin.game.h" #include "windows_inc.h" +BEGIN_BLD_NS + + #define TAB_CONFIG 0 #define TAB_MESSAGES 1 @@ -719,4 +722,7 @@ int32_t startwin_run(void) return done; } +END_BLD_NS + #endif // STARTUP_SETUP_WINDOW + diff --git a/source/blood/src/tile.cpp b/source/blood/src/tile.cpp index 3744fcb0e..e02917fd4 100644 --- a/source/blood/src/tile.cpp +++ b/source/blood/src/tile.cpp @@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "tile.h" +BEGIN_BLD_NS + void qloadvoxel(int32_t nVoxel) { static int nLastVoxel = 0; @@ -281,3 +283,5 @@ char tileGetSurfType(int hit) } return 0; } + +END_BLD_NS diff --git a/source/blood/src/tile.h b/source/blood/src/tile.h index 43df03677..438953068 100644 --- a/source/blood/src/tile.h +++ b/source/blood/src/tile.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "blood.h" +BEGIN_BLD_NS + enum SurfaceType { kSurfNone = 0, kSurfStone, @@ -64,3 +66,5 @@ char * tileAllocTile(int nTile, int x, int y, int ox, int oy); void tilePreloadTile(int nTile); void tilePrecacheTile(int nTile, int nType = 1); char tileGetSurfType(int hit); + +END_BLD_NS diff --git a/source/blood/src/trig.cpp b/source/blood/src/trig.cpp index 3ece7f234..54913e667 100644 --- a/source/blood/src/trig.cpp +++ b/source/blood/src/trig.cpp @@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" #include "trig.h" +BEGIN_BLD_NS + int costable[2048]; int OctantTable[8] = { 5, 6, 2, 1, 4, 7, 3, 0 }; @@ -78,3 +80,5 @@ void trigInit(Resource &Res) costable[i] = costable[2048 - i]; } } + +END_BLD_NS diff --git a/source/blood/src/trig.h b/source/blood/src/trig.h index 96f882d43..c8371e960 100644 --- a/source/blood/src/trig.h +++ b/source/blood/src/trig.h @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "resource.h" +BEGIN_BLD_NS + extern int costable[2048]; int GetOctant(int x, int y); @@ -39,4 +41,6 @@ inline int Sin(int ang) inline int Cos(int ang) { return costable[ang & 2047]; -} \ No newline at end of file +} + +END_BLD_NS diff --git a/source/blood/src/triggers.cpp b/source/blood/src/triggers.cpp index da3431ec8..b2b9a20de 100644 --- a/source/blood/src/triggers.cpp +++ b/source/blood/src/triggers.cpp @@ -53,6 +53,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sectorfx.h" #include "messages.h" +BEGIN_BLD_NS + int basePath[kMaxSectors]; void FireballTrapSeqCallback(int, int); @@ -4577,3 +4579,5 @@ void TriggersLoadSaveConstruct(void) { myLoadSave = new TriggersLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/triggers.h b/source/blood/src/triggers.h index 1134eb63e..0b26f46a3 100644 --- a/source/blood/src/triggers.h +++ b/source/blood/src/triggers.h @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "eventq.h" #include "dude.h" +BEGIN_BLD_NS + void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int a3); void trMessageSector(unsigned int nSector, EVENT a2); void trTriggerWall(unsigned int nWall, XWALL *pXWall, int a3); @@ -72,4 +74,6 @@ void useSeqSpawnerGen(XSPRITE* pXSource, int objType, int index); void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite); void useTeleportTarget(XSPRITE* pXSource, spritetype* pSprite); void TeleFrag(int nKiller, int nSector); -// ------------------------------------------------------- \ No newline at end of file +// ------------------------------------------------------- + +END_BLD_NS diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 6bfdfd31d..16c72253e 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -60,6 +60,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "warp.h" #include "weapon.h" +BEGIN_BLD_NS + struct VIEW { int at0; int at4; @@ -3957,3 +3959,5 @@ void ViewLoadSaveConstruct(void) { myLoadSave = new ViewLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/view.h b/source/blood/src/view.h index b7bf7d36d..d4eeda282 100644 --- a/source/blood/src/view.h +++ b/source/blood/src/view.h @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "messages.h" #include "player.h" +BEGIN_BLD_NS + enum VIEW_EFFECT { VIEW_EFFECT_0 = 0, VIEW_EFFECT_1, @@ -193,3 +195,5 @@ inline void viewBackupSpriteLoc(int nSprite, spritetype *pSprite) SetBitString(gInterpolateSprite, nSprite); } } + +END_BLD_NS diff --git a/source/blood/src/warp.cpp b/source/blood/src/warp.cpp index 7ff6bea66..63f8c7cb5 100644 --- a/source/blood/src/warp.cpp +++ b/source/blood/src/warp.cpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "view.h" #include "warp.h" +BEGIN_BLD_NS + ZONE gStartZone[8]; ZONE gStartZoneTeam1[8]; ZONE gStartZoneTeam2[8]; @@ -322,3 +324,5 @@ void WarpLoadSaveConstruct(void) { myLoadSave = new WarpLoadSave(); } + +END_BLD_NS diff --git a/source/blood/src/warp.h b/source/blood/src/warp.h index 48d4c0641..9ab794141 100644 --- a/source/blood/src/warp.h +++ b/source/blood/src/warp.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include "common_game.h" +BEGIN_BLD_NS + struct ZONE { int x, y, z; short sectnum, ang; @@ -35,3 +37,5 @@ extern bool gTeamsSpawnUsed; void warpInit(void); int CheckLink(spritetype *pSprite); int CheckLink(int *x, int *y, int *z, int *nSector); + +END_BLD_NS diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 0f40c2fed..702619766 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -50,6 +50,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "triggers.h" #include "view.h" +BEGIN_BLD_NS + void FirePitchfork(int, PLAYER *pPlayer); void FireSpray(int, PLAYER *pPlayer); void ThrowCan(int, PLAYER *pPlayer); @@ -2513,3 +2515,4 @@ void WeaponLoadSaveConstruct(void) myLoadSave = new WeaponLoadSave(); } +END_BLD_NS diff --git a/source/blood/src/weapon.h b/source/blood/src/weapon.h index b2a0ce01b..99057ada3 100644 --- a/source/blood/src/weapon.h +++ b/source/blood/src/weapon.h @@ -26,10 +26,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "db.h" #include "player.h" +BEGIN_BLD_NS + void WeaponInit(void); void WeaponDraw(PLAYER *pPlayer, int a2, int a3, int a4, int a5); void WeaponRaise(PLAYER *pPlayer); void WeaponLower(PLAYER *pPlayer); char WeaponUpgrade(PLAYER *pPlayer, char newWeapon); void WeaponProcess(PLAYER *pPlayer); -void sub_51340(spritetype *pMissile, int a2); \ No newline at end of file +void sub_51340(spritetype *pMissile, int a2); + +END_BLD_NS diff --git a/source/blood/src/winbits.cpp b/source/blood/src/winbits.cpp deleted file mode 100644 index 9d1e32cb2..000000000 --- a/source/blood/src/winbits.cpp +++ /dev/null @@ -1,134 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 Nuke.YKT - -This file is part of NBlood. - -NBlood 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 "ns.h" // Must come before everything else! - -#ifdef _WIN32 - -#include "compat.h" - -#define NEED_SHELLAPI_H -#define NEED_WINSOCK2_H -#define NEED_WS2TCPIP_H -#include "windows_inc.h" - -#include "renderlayer.h" - -int32_t G_GetVersionFromWebsite(char *buffer) -{ - static int32_t wsainitialized = 0; - int32_t i=0, j=0, r=0; - struct sockaddr_in dest_addr; - struct hostent *h; - char const *host = "www.eduke32.com"; - char const *req = "GET http://www.eduke32.com/VERSION HTTP/1.0\r\n\r\n\r\n"; - char *tok; - char tempbuf[2048],otherbuf[16],ver[16]; - SOCKET mysock; - WSADATA ws; - -#ifdef _WIN32 - if (wsainitialized == 0) - { - if (WSAStartup(0x101, &ws) == SOCKET_ERROR) - return 0; - - wsainitialized = 1; - } -#endif - - if ((h = gethostbyname(host)) == NULL) - { - initprintf("Couldn't resolve %s!\n", host); - return 0; - } - - dest_addr.sin_addr.s_addr = ((struct in_addr *)(h->h_addr))->s_addr; - dest_addr.sin_family = AF_INET; - dest_addr.sin_port = htons(80); - - memset(&(dest_addr.sin_zero), '\0', 8); - - mysock = socket(PF_INET, SOCK_STREAM, 0); - - if (mysock == INVALID_SOCKET) - { - WSACleanup(); - return 0; - } - - initprintf("Connecting to http://%s\n",host); - - if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR) - goto done; - - i = send(mysock, req, strlen(req), 0); - - if (i == SOCKET_ERROR) - goto done; - - i = recv(mysock, (char *)&tempbuf, sizeof(tempbuf), 0); - - if (i < 0) - goto done; - - Bmemcpy(&otherbuf, &tempbuf, sizeof(otherbuf)); - - strtok(otherbuf, " "); - - if ((tok = strtok(NULL, " ")) == NULL) - goto done; - - if (Batol(tok) == 200) - { - for (i = 0; (unsigned)i < strlen(tempbuf); i++) // HACK: all of this needs to die a fiery death; we just skip to the content - { - // instead of actually parsing any of the http headers - if (i > 4) - if (tempbuf[i-1] == '\n' && tempbuf[i-2] == '\r' && tempbuf[i-3] == '\n' && tempbuf[i-4] == '\r') - { - while (j < 9) - { - ver[j] = tempbuf[i]; - i++, j++; - } - ver[j] = '\0'; - break; - } - } - - if (j) - { - strcpy(buffer, ver); - r = 1; - goto done; - } - } - -done: - closesocket(mysock); - WSACleanup(); - - return r; -} -#endif diff --git a/source/build/include/winbits.h b/source/build/include/winbits.h index de2b1f0d7..65a6734b5 100644 --- a/source/build/include/winbits.h +++ b/source/build/include/winbits.h @@ -37,5 +37,4 @@ extern LPTSTR GetWindowsErrorMsg(DWORD code); extern int32_t addsearchpath_ProgramFiles(const char *p); -extern int32_t G_GetVersionFromWebsite(char *buffer); extern int32_t win_buildargs(char **argvbuf); \ No newline at end of file diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 693fc68d0..ee890cdd8 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -7862,49 +7862,6 @@ int app_main(int argc, char const * const * argv) #endif CONFIG_ReadSetup(); -//#if defined(_WIN32) -#if 0 - -// initprintf("build %d\n",(uint8_t)Batoi(BUILDDATE)); - - if (ud.config.CheckForUpdates == 1) - { - if (time(NULL) - ud.config.LastUpdateCheck > UPDATEINTERVAL) - { - initprintf("Checking for updates...\n"); - - ud.config.LastUpdateCheck = time(NULL); - - if (G_GetVersionFromWebsite(tempbuf)) - { - initprintf("Current version is %d",Batoi(tempbuf)); - - if (Batoi(tempbuf) > atoi(s_buildDate)) - { - if (wm_ynbox("EDuke32","A new version of EDuke32 is available. " - "Browse to http://www.eduke32.com now?")) - { - SHELLEXECUTEINFOA sinfo; - char const * p = "http://www.eduke32.com"; - - Bmemset(&sinfo, 0, sizeof(sinfo)); - sinfo.cbSize = sizeof(sinfo); - sinfo.fMask = SEE_MASK_CLASSNAME; - sinfo.lpVerb = "open"; - sinfo.lpFile = p; - sinfo.nShow = SW_SHOWNORMAL; - sinfo.lpClass = "http"; - - if (!ShellExecuteExA(&sinfo)) - initprintf("update: error launching browser!\n"); - } - } - else initprintf("... no updates available\n"); - } - else initprintf("update: failed to check for updates\n"); - } - } -#endif if (enginePreInit()) {