# Conflicts:
#	platform/Windows/nmapedit.vcxproj
#	platform/Windows/nmapedit.vcxproj.filters
#	source/blood/src/blood.cpp
#	source/blood/src/blood.h
#	source/blood/src/gui.cpp
#	source/blood/src/m32def.cpp
#	source/blood/src/m32def.h
#	source/blood/src/m32exec.cpp
#	source/blood/src/mapedit.cpp
This commit is contained in:
nukeykt 2019-06-27 13:33:22 +09:00 committed by Christoph Oelckers
parent 8fd6e0e183
commit afff9ce61f
22 changed files with 242 additions and 209 deletions

View file

@ -2424,8 +2424,6 @@ void TreeToGibCallback(int, int);
void DudeToGibCallback1(int, int);
void DudeToGibCallback2(int, int);
SPRITEHIT gSpriteHit[kMaxXSprites];
int nFireballClient = seqRegisterClient(FireballSeqCallback);
int dword_2192D8 = seqRegisterClient(sub_38938);
int nNapalmClient = seqRegisterClient(NapalmSeqCallback);

View file

@ -165,10 +165,6 @@ struct VECTORDATA {
int fireSound[2]; // By NoOne: predefined fire sounds. used by kGDXCustomDude, but can be used for something else.
};
struct SPRITEHIT {
int hit, ceilhit, florhit;
};
extern AMMOITEMDATA gAmmoItemData[];
extern WEAPONITEMDATA gWeaponItemData[];
extern ITEMDATA gItemData[];
@ -177,8 +173,6 @@ extern EXPLOSION explodeInfo[];
extern THINGINFO thingInfo[];
extern VECTORDATA gVectorData[];
extern SPRITEHIT gSpriteHit[];
extern int gDudeDrag;
extern short gAffectedSectors[kMaxSectors];
extern short gAffectedXWalls[kMaxXWalls];

View file

@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "db.h"
#include "dude.h"
#include "eventq.h"
#include "globals.h"
#include "levels.h"
#include "player.h"
#include "seq.h"

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "fx_man.h"
#include "common_game.h"
#include "blood.h"
//#include "blood.h"
#include "config.h"
#include "db.h"
#include "player.h"

View file

@ -81,12 +81,9 @@ const char* AppTechnicalName = APPBASENAME;
char qsprite_filler[kMaxSprites], qsector_filler[kMaxSectors];
ud_setup_t gSetup;
char SetupFilename[BMAX_PATH] = SETUPFILENAME;
int32_t gNoSetup = 0, gCommandSetup = 0;
Resource gSysRes, gGuiRes;
INPUT_MODE gInputMode;
unsigned int nMaxAlloc = 0x4000000;
@ -97,8 +94,6 @@ bool bNoDemo = false;
bool bQuickStart = true;
bool bNoAutoLoad = false;
bool bVanilla = false;
int gMusicPrevLoadedEpisode = -1;
int gMusicPrevLoadedLevel = -1;
@ -118,6 +113,13 @@ int gChokeCounter = 0;
double g_gameUpdateTime, g_gameUpdateAndDrawTime;
double g_gameUpdateAvgTime = 0.001;
int gSaveGameNum;
bool gQuitGame;
int gQuitRequest;
bool gPaused;
bool gSaveGameActive;
int gCacheMiss;
enum gametokens
{
T_INCLUDE = 0,

View file

@ -25,166 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "levels.h"
#include "resource.h"
#define TILTBUFFER 4078
#define kExplodeMax 8
#define kDudeBase 200
#define kDudePlayer1 231
#define kDudePlayer8 238
#define kDudeMax 260
#define kMissileBase 300
#define kMissileMax 318
#define kThingBase 400
#define kThingMax 436
#define kMaxPowerUps 51
#define kStatRespawn 8
#define kStatMarker 10
#define kStatGDXDudeTargetChanger 20
#define kStatFree 1024
#define kLensSize 80
#define kViewEffectMax 19
#define kNoTile -1
// defined by NoOne:
// -------------------------------
#define kMaxPAL 5
#define kWeaponItemBase 40
#define kItemMax 151
// marker sprite types
#define kMarkerSPStart 1
#define kMarkerMPStart 2
#define kMarkerOff 3
#define kMarkerOn 4
#define kMarkerAxis 5
#define kMarkerLowLink 6
#define kMarkerUpLink 7
#define kMarkerWarpDest 8
#define kMarkerUpWater 9
#define kMarkerLowWater 10
#define kMarkerUpStack 11
#define kMarkerLowStack 12
#define kMarkerUpGoo 13
#define kMarkerLowGoo 14
#define kMarkerPath 15
// sprite cstat
#define kSprBlock 0x0001
#define kSprTrans 0x0002
#define kSprFlipX 0x0004
#define kSprFlipY 0x0008
#define kSprFace 0x0000
#define kSprWall 0x0010
#define kSprFloor 0x0020
#define kSprSpin 0x0030
#define kSprRMask 0x0030
#define kSprOneSided 0x0040
#define kSprOriginAlign 0x0080
#define kSprHitscan 0x0100
#define kSprTransR 0x0200
#define kSprPushable 0x1000
#define kSprMoveMask 0x6000
#define kSprMoveNone 0x0000
#define kSprMoveForward 0x2000
#define kSprMoveFloor 0x2000
#define kSprMoveReverse 0x4000
#define kSprMoveCeiling 0x4000
#define kSprInvisible 0x8000
// sprite attributes
#define kHitagMovePhys 0x0001 // affected by movement physics
#define kHitagGravityPhys 0x0002 // affected by gravity
#define kHitagFalling 0x0004 // currently in z-motion
#define kHitagAutoAim 0x0008
#define kHitagRespawn 0x0010
#define kHitagFree 0x0020
#define kHitagSmoke 0x0100
#define kHitagExtBit 0x8000 // NoOne's extension bit(Note: it's bit 0 in editor!)
// sector types
#define kSecBase 600
#define kSecZMotion kSectorBase
#define kSecZSprite 602
#define kSecWarp 603
#define kSecTeleport 604
#define kSecPath 612
#define kSecRotateStep 613
#define kSecSlideMarked 614
#define kSecRotateMarked 615
#define kSecSlide 616
#define kSecRotate 617
#define kSecDamage 618
#define kSecCounter 619
#define kSecMax 620
// switch types
#define kSwitchBase 20
#define kSwitchToggle 20
#define kSwitchOneWay 21
#define kSwitchCombo 22
#define kSwitchPadlock 23
#define kSwitchMax 24
// projectile types
#define kProjectileEctoSkull 307
// custom level end
#define kGDXChannelEndLevelCustom 6
// GDX types
#define kGDXTypeBase 24
#define kGDXCustomDudeSpawn 24
#define kGDXRandomTX 25
#define kGDXSequentialTX 26
#define kGDXSeqSpawner 27
#define kGDXObjPropertiesChanger 28
#define kGDXObjPicnumChanger 29
#define kGDXObjSizeChanger 31
#define kGDXDudeTargetChanger 33
#define kGDXSectorFXChanger 34
#define kGDXObjDataChanger 35
#define kGDXSpriteDamager 36
#define kGDXObjDataAccumulator 37
#define kGDXEffectSpawner 38
#define kGDXWindGenerator 39
#define kGDXThingTNTProx 433 // detects only players
#define kGDXThingThrowableRock 434 // does small damage if hits target
#define kGDXThingCustomDudeLifeLeech 435 // the same as normal, except it aims in specified target
#define kGDXDudeUniversalCultist 254
#define kGDXGenDudeBurning 255
#define kGDXItemMapLevel 150 // once picked up, draws whole minimap
// ai state types
#define kAiStateOther -1
#define kAiStateIdle 0
#define kAiStateGenIdle 1
#define kAiStateMove 2
#define kAiStateSearch 3
#define kAiStateChase 4
#define kAiStateRecoil 5
#define kAng5 28
#define kAng15 85
#define kAng30 170
#define kAng45 256
#define kAng60 341
#define kAng90 512
#define kAng120 682
#define kAng180 1024
#define kAng360 2048
// -------------------------------
struct INIDESCRIPTION {
const char *pzName;
const char *pzFilename;
@ -201,17 +41,6 @@ struct INICHAIN {
extern INICHAIN *pINIChain;
extern INICHAIN const*pINISelected;
typedef struct {
int32_t usejoystick;
int32_t usemouse;
int32_t fullscreen;
int32_t xdim;
int32_t ydim;
int32_t bpp;
int32_t forcesetup;
int32_t noautoload;
} ud_setup_t;
enum INPUT_MODE {
INPUT_MODE_0 = 0,
INPUT_MODE_1,
@ -219,9 +48,7 @@ enum INPUT_MODE {
INPUT_MODE_3,
};
extern Resource gSysRes, gGuiRes;
extern INPUT_MODE gInputMode;
extern ud_setup_t gSetup;
extern char SetupFilename[BMAX_PATH];
extern int32_t gNoSetup;
extern short BloodVersion;
@ -231,11 +58,16 @@ extern bool gRestartGame;
extern double g_gameUpdateTime, g_gameUpdateAndDrawTime;
extern double g_gameUpdateAvgTime;
extern int blood_globalflags;
extern bool bVanilla;
extern int gMusicPrevLoadedEpisode;
extern int gMusicPrevLoadedLevel;
extern int gFrameClock;
extern int gSaveGameNum;
extern bool gPaused;
extern bool gSaveGameActive;
extern bool gSavingGame;
extern bool gQuitGame;
extern int gQuitRequest;
extern int gCacheMiss;
void QuitGame(void);
void PreloadCache(void);

View file

@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "eventq.h"
#include "fx.h"
#include "gameutil.h"
#include "globals.h"
#include "levels.h"
#include "player.h"
#include "seq.h"

View file

@ -50,6 +50,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// g_grpNamePtr can ONLY point to a malloc'd block (length BMAX_PATH)
char *g_grpNamePtr = NULL;
void clearGrpNamePtr(void)
{
Bfree(g_grpNamePtr);
// g_grpNamePtr assumed to be assigned to right after
}
const char *G_DefaultGrpFile(void)
{
return "nblood.pk3";
@ -70,6 +76,25 @@ const char *G_DefFile(void)
return (g_defNamePtr == NULL) ? G_DefaultDefFile() : g_defNamePtr;
}
void G_SetupGlobalPsky(void)
{
int skyIdx = 0;
// NOTE: Loop must be running backwards for the same behavior as the game
// (greatest sector index with matching parallaxed sky takes precedence).
for (bssize_t i = numsectors - 1; i >= 0; i--)
{
if (sector[i].ceilingstat & 1)
{
skyIdx = getpskyidx(sector[i].ceilingpicnum);
if (skyIdx > 0)
break;
}
}
g_pskyidx = skyIdx;
}
static char g_rootDir[BMAX_PATH];
int g_useCwd;

View file

@ -69,6 +69,162 @@ void __dassert(const char *pzExpr, const char *pzFile, int nLine);
#define kTicsPerFrame 4
#define kTicsPerSec (kTicRate/kTicsPerFrame)
#define TILTBUFFER 4078
#define kExplodeMax 8
#define kDudeBase 200
#define kDudePlayer1 231
#define kDudePlayer8 238
#define kDudeMax 260
#define kMissileBase 300
#define kMissileMax 318
#define kThingBase 400
#define kThingMax 435
#define kMaxPowerUps 49
#define kStatRespawn 8
#define kStatMarker 10
#define kStatFree 1024
#define kLensSize 80
#define kViewEffectMax 19
#define kNoTile -1
// defined by NoOne:
// -------------------------------
#define kMaxPAL 5
#define kWeaponItemBase 40
#define kItemMax 149
// marker sprite types
#define kMarkerSPStart 1
#define kMarkerMPStart 2
#define kMarkerOff 3
#define kMarkerOn 4
#define kMarkerAxis 5
#define kMarkerLowLink 6
#define kMarkerUpLink 7
#define kMarkerWarpDest 8
#define kMarkerUpWater 9
#define kMarkerLowWater 10
#define kMarkerUpStack 11
#define kMarkerLowStack 12
#define kMarkerUpGoo 13
#define kMarkerLowGoo 14
#define kMarkerPath 15
// sprite cstat
#define kSprBlock 0x0001
#define kSprTrans 0x0002
#define kSprFlipX 0x0004
#define kSprFlipY 0x0008
#define kSprFace 0x0000
#define kSprWall 0x0010
#define kSprFloor 0x0020
#define kSprSpin 0x0030
#define kSprRMask 0x0030
#define kSprOneSided 0x0040
#define kSprOriginAlign 0x0080
#define kSprHitscan 0x0100
#define kSprTransR 0x0200
#define kSprPushable 0x1000
#define kSprMoveMask 0x6000
#define kSprMoveNone 0x0000
#define kSprMoveForward 0x2000
#define kSprMoveFloor 0x2000
#define kSprMoveReverse 0x4000
#define kSprMoveCeiling 0x4000
#define kSprInvisible 0x8000
// sprite attributes
#define kHitagMovePhys 0x0001 // affected by movement physics
#define kHitagGravityPhys 0x0002 // affected by gravity
#define kHitagFalling 0x0004 // currently in z-motion
#define kHitagAutoAim 0x0008
#define kHitagRespawn 0x0010
#define kHitagFree 0x0020
#define kHitagSmoke 0x0100
#define kHitagExtBit 0x8000 // NoOne's extension bit(Note: it's bit 0 in editor!)
// sector types
#define kSecBase 600
#define kSecZMotion kSectorBase
#define kSecZSprite 602
#define kSecWarp 603
#define kSecTeleport 604
#define kSecPath 612
#define kSecRotateStep 613
#define kSecSlideMarked 614
#define kSecRotateMarked 615
#define kSecSlide 616
#define kSecRotate 617
#define kSecDamage 618
#define kSecCounter 619
#define kSecMax 620
// switch types
#define kSwitchBase 20
#define kSwitchToggle 20
#define kSwitchOneWay 21
#define kSwitchCombo 22
#define kSwitchPadlock 23
#define kSwitchMax 24
// projectile types
#define kProjectileEctoSkull 307
// custom level end
#define kGDXChannelEndLevelCustom 6
// GDX types
#define kGDXTypeBase 24
#define kGDXCustomDudeSpawn 24
#define kGDXRandomTX 25
#define kGDXSequentialTX 26
#define kGDXSeqSpawner 27
#define kGDXObjPropertiesChanger 28
#define kGDXObjPicnumChanger 29
#define kGDXObjSizeChanger 31
#define kGDXDudeTargetChanger 33
#define kGDXSectorFXChanger 34
#define kGDXObjDataChanger 35
#define kGDXSpriteDamager 36
// 37 reserved
#define kGDXEffectSpawner 38
#define kGDXWindGenerator 39
#define kGDXThingTNTProx 433 // detects only players
#define kGDXThingThrowableRock 434 // does small damage if hits target
#define kGDXDudeUniversalCultist 254
#define kGDXGenDudeBurning 255
// ai state types
#define kAiStateOther -1
#define kAiStateIdle 0
#define kAiStateGenIdle 1
#define kAiStateMove 2
#define kAiStateSearch 3
#define kAiStateChase 4
#define kAiStateRecoil 5
#define kAng5 28
#define kAng15 85
#define kAng30 170
#define kAng45 256
#define kAng60 341
#define kAng90 512
#define kAng120 682
#define kAng180 1024
#define kAng360 2048
// -------------------------------
// NUKE-TODO:
#define OSDTEXT_DEFAULT "^00"
#define OSDTEXT_DARKRED "^00"
@ -102,6 +258,8 @@ void G_LoadGroupsInDir(const char *dirname);
void G_DoAutoload(const char *dirname);
extern void G_LoadGroups(int32_t autoload);
extern void G_SetupGlobalPsky(void);
#define G_ModDirSnprintf(buf, size, basename, ...) \
(((g_modDir[0] != '/') ? Bsnprintf(buf, size, "%s/" basename, g_modDir, ##__VA_ARGS__) : Bsnprintf(buf, size, basename, ##__VA_ARGS__)) \
>= ((int32_t)size) - 1)

View file

@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "function.h"
#include "blood.h"
#include "gamedefs.h"
#include "globals.h"
#include "config.h"
#include "view.h"

View file

@ -28,8 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "common_game.h"
#include "crc32.h"
#include "actor.h"
#include "blood.h"
//#include "actor.h"
#include "globals.h"
#include "db.h"
#include "iob.h"
@ -39,6 +39,8 @@ XSPRITE xsprite[kMaxXSprites];
XSECTOR xsector[kMaxXSectors];
XWALL xwall[kMaxXWalls];
SPRITEHIT gSpriteHit[kMaxXSprites];
int xvel[kMaxSprites], yvel[kMaxSprites], zvel[kMaxSprites];
int gVisibility;

View file

@ -246,6 +246,10 @@ struct MAPHEADER2 {
char pad[52];
};
struct SPRITEHIT {
int hit, ceilhit, florhit;
};
#pragma pack(pop)
extern unsigned short gStatCount[kMaxStatus + 1];;
@ -257,6 +261,8 @@ extern XSPRITE xsprite[kMaxXSprites];
extern XSECTOR xsector[kMaxXSectors];
extern XWALL xwall[kMaxXWalls];
extern SPRITEHIT gSpriteHit[kMaxXSprites];
extern int xvel[kMaxSprites], yvel[kMaxSprites], zvel[kMaxSprites];
extern int gVisibility;

View file

@ -23,25 +23,25 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <stdlib.h>
#include "compat.h"
#include "blood.h"
#include "common_game.h"
#include "globals.h"
#include "resource.h"
ud_setup_t gSetup;
bool bVanilla = false;
int gFrameClock;
int gFrameTicks;
int gFrame;
int volatile gGameClock;
int gFrameRate;
int gGamma;
int gSaveGameNum;
bool gQuitGame;
int gQuitRequest;
bool gPaused;
bool gSaveGameActive;
int gCacheMiss;
char *gVersionString;
char gVersionStringBuf[16];
Resource gSysRes;
const char *GetVersionString(void)
{
if (!gVersionString)

View file

@ -21,21 +21,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#pragma once
#include "resource.h"
typedef struct {
int32_t usejoystick;
int32_t usemouse;
int32_t fullscreen;
int32_t xdim;
int32_t ydim;
int32_t bpp;
int32_t forcesetup;
int32_t noautoload;
} ud_setup_t;
extern ud_setup_t gSetup;
extern int gFrameClock;
extern int gFrameTicks;
extern int gFrame;
extern int volatile gGameClock;
extern int gFrameRate;
extern int gGamma;
extern int gSaveGameNum;
extern bool gPaused;
extern bool gSaveGameActive;
extern bool gSavingGame;
extern bool gQuitGame;
extern int gQuitRequest;
extern int gCacheMiss;
extern bool bVanilla;
extern Resource gSysRes;
const char *GetVersionString(void);

View file

@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "blood.h"
#include "demo.h"
#include "gamemenu.h"
#include "globals.h"
#include "levels.h"
#include "messages.h"
#include "network.h"

View file

@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "eventq.h"
#include "fx.h"
#include "gib.h"
#include "globals.h"
#include "levels.h"
#include "loadsave.h"
#include "map2d.h"

View file

@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------
#pragma once
#include "common.h"
#include "qheap.h"
#pragma pack(push, 1)

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "colmatch.h"
#include "common_game.h"
#include "blood.h"
#include "globals.h"
#include "config.h"
#include "resource.h"
#include "screen.h"

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "blood.h"
#include "db.h"
#include "eventq.h"
#include "globals.h"
#include "levels.h"
#include "loadsave.h"
#include "sfx.h"

View file

@ -46,6 +46,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//#include "grpscan.h"
//#include "inv.h"
#include "blood.h"
#include "globals.h"
#include "keyboard.h"
#include "startwin.game.h"
#include "windows_inc.h"

View file

@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "blood.h"
#include "config.h"
#include "globals.h"
#include "resource.h"
#include "tile.h"

View file

@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "fx.h"
#include "gameutil.h"
#include "gib.h"
#include "globals.h"
#include "levels.h"
#include "loadsave.h"
#include "player.h"