- merge fixes in Blood frontend code.

This commit is contained in:
Christoph Oelckers 2019-10-20 17:09:01 +02:00
parent d83b3f34a3
commit 06f4138202
7 changed files with 34 additions and 38 deletions

View file

@ -2469,14 +2469,9 @@ const char *pzCrypticArts[] = {
"CPART07.AR_", "CPART15.AR_" "CPART07.AR_", "CPART15.AR_"
}; };
const char* pzCrypticArts1[] = {
"addons/Cryptic Passage/CPART07.ART", "addons/Cryptic Passage/CPART15.ART"
};
INIDESCRIPTION gINIDescription[] = { INIDESCRIPTION gINIDescription[] = {
{ "BLOOD: One Unit Whole Blood", "BLOOD.INI", NULL, 0 }, { "BLOOD: One Unit Whole Blood", "BLOOD.INI", NULL, 0 },
{ "Cryptic passage", "CRYPTIC.INI", pzCrypticArts, ARRAY_SSIZE(pzCrypticArts) }, { "Cryptic passage", "CRYPTIC.INI", pzCrypticArts, ARRAY_SSIZE(pzCrypticArts) },
{ "Cryptic passage", "addons/Cryptic Passage/CRYPTIC.INI", pzCrypticArts1, ARRAY_SSIZE(pzCrypticArts1) }, // let's hope this works for the
}; };
bool AddINIFile(const char *pzFile, bool bForce = false) bool AddINIFile(const char *pzFile, bool bForce = false)

View file

@ -355,16 +355,16 @@ void CounterCheck(int nSector) // 12
for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite]) { for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite]) {
if (sprite[nSprite].type == nType) nCount++; if (sprite[nSprite].type == nType) nCount++;
} }
if (nCount < nReq) { if (nCount < nReq) {
evPost(nSector, 6, 5, kCallbackCounterCheck); evPost(nSector, 6, 5, kCallbackCounterCheck);
return; return;
} else { } else {
//pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero //pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero
trTriggerSector(nSector, pXSector, kCmdOn); trTriggerSector(nSector, pXSector, kCmdOn);
pXSector->locked = 1; //lock sector, so it can be opened again later pXSector->locked = 1; //lock sector, so it can be opened again later
} }
} }
@ -491,16 +491,16 @@ void returnFlagToBase(int nSprite) // 17
switch (pSprite->type) { switch (pSprite->type) {
case kItemFlagA: case kItemFlagA:
trTriggerSprite(pOwner->index, pXOwner, kCmdOn); trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
sndStartSample(8003, 255, 2, 0); sndStartSample(8003, 255, 2, 0);
gBlueFlagDropped = false; gBlueFlagDropped = false;
viewSetMessage("Blue Flag returned to base."); viewSetMessage("Blue Flag returned to base.");
break; break;
case kItemFlagB: case kItemFlagB:
trTriggerSprite(pOwner->index, pXOwner, kCmdOn); trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
sndStartSample(8002, 255, 2, 0); sndStartSample(8002, 255, 2, 0);
gRedFlagDropped = false; gRedFlagDropped = false;
viewSetMessage("Red Flag returned to base."); viewSetMessage("Red Flag returned to base.");
break; break;
} }
} }
evPost(pSprite->index, 3, 0, kCallbackRemove); evPost(pSprite->index, 3, 0, kCallbackRemove);

View file

@ -540,12 +540,8 @@ static inline void G_HandleAsync(void)
netGetPackets(); netGetPackets();
} }
#if defined HAVE_FLAC || defined HAVE_VORBIS
# define FORMAT_UPGRADE_ELIGIBLE # define FORMAT_UPGRADE_ELIGIBLE
extern int32_t S_OpenAudio(const char *fn, char searchfirst, uint8_t ismusic); extern int32_t S_OpenAudio(const char *fn, char searchfirst, uint8_t ismusic);
#else
# define S_OpenAudio(fn, searchfirst, ismusic) kopen4loadfrommod(fn, searchfirst)
#endif
#pragma pack(push,1) #pragma pack(push,1)

View file

@ -291,5 +291,6 @@ bool shrinkPlayerSize(PLAYER* pPlayer, int divider);
bool growPlayerSize(PLAYER* pPlayer, int multiplier); bool growPlayerSize(PLAYER* pPlayer, int multiplier);
bool resetPlayerSize(PLAYER* pPlayer); bool resetPlayerSize(PLAYER* pPlayer);
void deactivateSizeShrooms(PLAYER* pPlayer); void deactivateSizeShrooms(PLAYER* pPlayer);
PLAYER* getPlayerById(short id);
END_BLD_NS END_BLD_NS

View file

@ -822,15 +822,15 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
PLAYER* pPlayer = NULL; PLAYER* pPlayer = NULL;
if ((pPlayer = getPlayerById(pXSprite->data1)) == NULL) return; if ((pPlayer = getPlayerById(pXSprite->data1)) == NULL) return;
else if (event.cmd < kCmdNumberic) { // play qav as weapon qav else if (event.cmd < kCmdNumberic) { // play qav as weapon qav
switch (event.cmd) { switch (event.cmd) {
case kCmdOff: case kCmdOff:
if (gQavPlayerIndex == nSprite) { if (gQavPlayerIndex == nSprite) {
pXSprite->sysData1 = 0; pXSprite->sysData1 = 0;
pPlayer->atc.newWeapon = pPlayer->atbd = pXSprite->data4; pPlayer->atc.newWeapon = pPlayer->atbd = pXSprite->data4;
gQavPlayerIndex = -1; gQavPlayerIndex = -1;
WeaponRaise(pPlayer); WeaponRaise(pPlayer);
} }
break; break;
case kCmdOn: { case kCmdOn: {
if (gQavPlayerIndex == nSprite && !pXSprite->Interrutable) break; if (gQavPlayerIndex == nSprite && !pXSprite->Interrutable) break;
QAV* pQav = NULL; DICTNODE* hQav = gSysRes.Lookup(pXSprite->data2, "QAV"); QAV* pQav = NULL; DICTNODE* hQav = gSysRes.Lookup(pXSprite->data2, "QAV");
@ -842,7 +842,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
xsprite[sprite[gQavPlayerIndex].extra].data4 = 0; xsprite[sprite[gQavPlayerIndex].extra].data4 = 0;
} }
WeaponLower(pPlayer); WeaponLower(pPlayer);
pQav = (QAV*)gSysRes.Load(hQav); weaponQAV[kFreeQAVEntry] = pQav; pQav = (QAV*)gSysRes.Load(hQav); weaponQAV[kFreeQAVEntry] = pQav;
pXSprite->busyTime = (((pQav->at10) / 12) * 120) / 10; pXSprite->busyTime = (((pQav->at10) / 12) * 120) / 10;
@ -850,14 +850,14 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
pXSprite->sysData1 = pXSprite->waitTime; // how many times animation should be played pXSprite->sysData1 = pXSprite->waitTime; // how many times animation should be played
gQavPlayerIndex = nSprite; gQavPlayerIndex = nSprite;
}
break;
} }
break; default:
}
default:
if (gQavPlayerIndex != nSprite) evPost(nSprite, 3, 0, kCmdOn); if (gQavPlayerIndex != nSprite) evPost(nSprite, 3, 0, kCmdOn);
else evPost(nSprite, 3, 0, kCmdOff); else evPost(nSprite, 3, 0, kCmdOff);
break; break;
} }
} else if (event.cmd < kCmdNumbericMax) { } else if (event.cmd < kCmdNumbericMax) {
switch (event.cmd) { switch (event.cmd) {
case kCmdNumberic: // player life form case kCmdNumberic: // player life form
@ -1415,8 +1415,8 @@ void usePropertiesChanger(XSPRITE* pXSource, short objType, int objIndex) {
// adding physics sprite in list // adding physics sprite in list
if ((flags & kPhysGravity) != 0 || (flags & kPhysMove) != 0) { if ((flags & kPhysGravity) != 0 || (flags & kPhysMove) != 0) {
if (nIndex != -1) pXSprite->physAttr = flags; // just update physics attributes if (nIndex != -1) pXSprite->physAttr = flags; // just update physics attributes
else if ((nIndex = debrisGetFreeIndex()) < 0) else if ((nIndex = debrisGetFreeIndex()) < 0)
viewSetSystemMessage("Max (%d) Physics affected sprites reached!", kMaxSuperXSprites); viewSetSystemMessage("Max (%d) Physics affected sprites reached!", kMaxSuperXSprites);
else { else {
@ -1581,8 +1581,8 @@ void useEffectGen(XSPRITE * pXSource, spritetype * pSprite) {
int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); spritetype * pEffect = NULL; int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); spritetype * pEffect = NULL;
if (fxId > 0 && fxId < 57 && (pEffect = gFX.fxSpawn((FX_ID) fxId, pSprite->sectnum, pSprite->x, pSprite->y, top, 0)) != NULL) { if (fxId > 0 && fxId < 57 && (pEffect = gFX.fxSpawn((FX_ID) fxId, pSprite->sectnum, pSprite->x, pSprite->y, top, 0)) != NULL) {
if ((pEffect->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && (pEffect->cstat & CSTAT_SPRITE_ONE_SIDED)) if ((pEffect->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && (pEffect->cstat & CSTAT_SPRITE_ONE_SIDED))
pEffect->cstat &= ~CSTAT_SPRITE_ONE_SIDED; pEffect->cstat &= ~CSTAT_SPRITE_ONE_SIDED;
if (pSprite->flags & kModernTypeFlag1) { if (pSprite->flags & kModernTypeFlag1) {
if (pEffect->pal <= 0) pEffect->pal = pSprite->pal; if (pEffect->pal <= 0) pEffect->pal = pSprite->pal;
@ -3732,7 +3732,7 @@ void pastePropertiesInObj(int type, int nDest, EVENT event) {
} else if (pSource->type == kModernObjPropertiesChanger) { } else if (pSource->type == kModernObjPropertiesChanger) {
/* - properties changer can change various properties - */ /* - properties changer can change various properties - */
usePropertiesChanger(pXSource, type, nDest); usePropertiesChanger(pXSource, type, nDest);
} }
} }
// By NoOne: the following functions required for kModernDudeTargetChanger // By NoOne: the following functions required for kModernDudeTargetChanger

View file

@ -52,6 +52,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS BEGIN_BLD_NS
#define kQAVEnd 125
void FirePitchfork(int, PLAYER *pPlayer); void FirePitchfork(int, PLAYER *pPlayer);
void FireSpray(int, PLAYER *pPlayer); void FireSpray(int, PLAYER *pPlayer);
void ThrowCan(int, PLAYER *pPlayer); void ThrowCan(int, PLAYER *pPlayer);

View file

@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS BEGIN_BLD_NS
QAV* weaponQAV[];
void WeaponInit(void); void WeaponInit(void);
void WeaponDraw(PLAYER *pPlayer, int a2, int a3, int a4, int a5); void WeaponDraw(PLAYER *pPlayer, int a2, int a3, int a4, int a5);
void WeaponRaise(PLAYER *pPlayer); void WeaponRaise(PLAYER *pPlayer);