diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index e2795bcc9..1014f711f 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -588,9 +588,9 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor fr.Read(&byte_19AE44, 128); dbCrypt((char*)&byte_19AE44, 128, numwalls); - byte_19AE44.at40 = LittleLong(byte_19AE44.at40); - byte_19AE44.at44 = LittleLong(byte_19AE44.at44); - byte_19AE44.at48 = LittleLong(byte_19AE44.at48); + byte_19AE44.numxsprites = LittleLong(byte_19AE44.numxsprites); + byte_19AE44.numxwalls = LittleLong(byte_19AE44.numxwalls); + byte_19AE44.numxsectors = LittleLong(byte_19AE44.numxsectors); } else { @@ -658,7 +658,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor } else { - nCount = byte_19AE44.at48; + nCount = byte_19AE44.numxsectors; } assert(nCount <= nXSectorSize); fr.Read(pBuffer, nCount); @@ -785,7 +785,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor } else { - nCount = byte_19AE44.at44; + nCount = byte_19AE44.numxwalls; } assert(nCount <= nXWallSize); fr.Read(pBuffer, nCount); @@ -880,7 +880,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor } else { - nCount = byte_19AE44.at40; + nCount = byte_19AE44.numxsprites; } assert(nCount <= nXSpriteSize); fr.Read(pBuffer, nCount); diff --git a/source/blood/src/db.h b/source/blood/src/db.h index c4575d978..7f9593824 100644 --- a/source/blood/src/db.h +++ b/source/blood/src/db.h @@ -283,10 +283,10 @@ struct MAPHEADER { }; struct MAPHEADER2 { - char TotalKills[64]; - int at40; // xsprite size - int at44; // xwall size - int at48; // xsector size + char name[64]; + int numxsprites; // xsprite size + int numxwalls; // xwall size + int numxsectors; // xsector size char pad[52]; }; diff --git a/source/blood/src/gib.cpp b/source/blood/src/gib.cpp index 01fa3b7ed..eba2289bd 100644 --- a/source/blood/src/gib.cpp +++ b/source/blood/src/gib.cpp @@ -53,7 +53,7 @@ struct GIBFX struct GIBTHING { - int TotalKills; + int type; int Kills; int chance; int atc; @@ -362,7 +362,7 @@ void GibFX(spritetype *pSprite, GIBFX *pGFX, CGibPosition *pPos, CGibVelocity *p void GibThing(spritetype *pSprite, GIBTHING *pGThing, CGibPosition *pPos, CGibVelocity *pVel) { if (adult_lockout && gGameOptions.nGameType <= 0) - switch (pGThing->TotalKills) { + switch (pGThing->type) { case kThingBloodBits: case kThingZombieHead: return; @@ -391,7 +391,7 @@ void GibThing(spritetype *pSprite, GIBTHING *pGThing, CGibPosition *pPos, CGibVe getzsofslope(nSector, x, y, &ceilZ, &floorZ); int dz1 = floorZ-z; int dz2 = z-ceilZ; - spritetype *pGib = actSpawnThing(nSector, x, y, z, pGThing->TotalKills); + spritetype *pGib = actSpawnThing(nSector, x, y, z, pGThing->type); assert(pGib != NULL); if (pGThing->Kills > -1) pGib->picnum = pGThing->Kills; diff --git a/source/blood/src/mirrors.cpp b/source/blood/src/mirrors.cpp index 6811022d7..01f47e4e4 100644 --- a/source/blood/src/mirrors.cpp +++ b/source/blood/src/mirrors.cpp @@ -38,12 +38,12 @@ int mirrorcnt, mirrorsector, mirrorwall[4]; typedef struct { - int TotalKills; - int Kills; + int type; + int link; int at8; int atc; int at10; - int at14; + int wallnum; } MIRROR; MIRROR mirror[16]; @@ -70,8 +70,8 @@ void InitMirrors(void) if (wall[i].extra > 0 && GetWallType(i) == kWallStack) { wall[i].overpicnum = nTile; - mirror[mirrorcnt].at14 = i; - mirror[mirrorcnt].TotalKills = 0; + mirror[mirrorcnt].wallnum = i; + mirror[mirrorcnt].type = 0; wall[i].cstat |= 32; int tmp = xwall[wall[i].extra].data; int j; @@ -85,7 +85,7 @@ void InitMirrors(void) continue; wall[i].hitag = j; wall[j].hitag = i; - mirror[mirrorcnt].Kills = j; + mirror[mirrorcnt].link = j; break; } } @@ -97,10 +97,10 @@ void InitMirrors(void) } if (wall[i].picnum == 504) { - mirror[mirrorcnt].Kills = i; - mirror[mirrorcnt].at14 = i; + mirror[mirrorcnt].link = i; + mirror[mirrorcnt].wallnum = i; wall[i].picnum = nTile; - mirror[mirrorcnt].TotalKills = 0; + mirror[mirrorcnt].type = 0; wall[i].cstat |= 32; mirrorcnt++; continue; @@ -120,20 +120,20 @@ void InitMirrors(void) int j = sprite[nLink2].sectnum; if (sector[j].ceilingpicnum != 504) I_Error("Lower link sector %d doesn't have mirror picnum\n", j); - mirror[mirrorcnt].TotalKills = 2; + mirror[mirrorcnt].type = 2; mirror[mirrorcnt].at8 = sprite[nLink2].x-sprite[nLink].x; mirror[mirrorcnt].atc = sprite[nLink2].y-sprite[nLink].y; mirror[mirrorcnt].at10 = sprite[nLink2].z-sprite[nLink].z; - mirror[mirrorcnt].at14 = i; - mirror[mirrorcnt].Kills = j; + mirror[mirrorcnt].wallnum = i; + mirror[mirrorcnt].link = j; sector[i].floorpicnum = 4080+mirrorcnt; mirrorcnt++; - mirror[mirrorcnt].TotalKills = 1; + mirror[mirrorcnt].type = 1; mirror[mirrorcnt].at8 = sprite[nLink].x-sprite[nLink2].x; mirror[mirrorcnt].atc = sprite[nLink].y-sprite[nLink2].y; mirror[mirrorcnt].at10 = sprite[nLink].z-sprite[nLink2].z; - mirror[mirrorcnt].at14 = j; - mirror[mirrorcnt].Kills = i; + mirror[mirrorcnt].wallnum = j; + mirror[mirrorcnt].link = i; sector[j].ceilingpicnum = 4080+mirrorcnt; mirrorcnt++; } @@ -167,19 +167,19 @@ void sub_5571C(char mode) int nTile = 4080+i; if (TestBitString(gotpic, nTile)) { - switch (mirror[i].TotalKills) + switch (mirror[i].type) { case 1: if (mode) - sector[mirror[i].at14].ceilingstat |= 1; + sector[mirror[i].wallnum].ceilingstat |= 1; else - sector[mirror[i].at14].ceilingstat &= ~1; + sector[mirror[i].wallnum].ceilingstat &= ~1; break; case 2: if (mode) - sector[mirror[i].at14].floorstat |= 1; + sector[mirror[i].wallnum].floorstat |= 1; else - sector[mirror[i].at14].floorstat &= ~1; + sector[mirror[i].wallnum].floorstat &= ~1; break; } } @@ -200,10 +200,10 @@ void sub_557C4(int x, int y, int interpolation) int nTile = 4080+i; if (TestBitString(gotpic, nTile)) { - if (mirror[i].TotalKills == 1 || mirror[i].TotalKills == 2) + if (mirror[i].type == 1 || mirror[i].type == 2) { - int nSector = mirror[i].Kills; - int nSector2 = mirror[i].at14; + int nSector = mirror[i].link; + int nSector2 = mirror[i].wallnum; int nSprite; SectIterator it(nSector); while ((nSprite = it.NextIndex()) >= 0) @@ -218,7 +218,7 @@ void sub_557C4(int x, int y, int interpolation) if (pSprite->statnum == kStatDude && (top < zCeil || bottom > zFloor)) { int j = i; - if (mirror[i].TotalKills == 2) + if (mirror[i].type == 2) j++; else j--; @@ -307,11 +307,11 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int if (TestBitString(gotpic, nTile)) { ClearBitString(gotpic, nTile); - switch (mirror[i].TotalKills) + switch (mirror[i].type) { case 0: { - int nWall = mirror[i].Kills; + int nWall = mirror[i].link; int nSector = sectorofwall(nWall); walltype *pWall = &wall[nWall]; int nNextWall = pWall->nextwall; @@ -355,7 +355,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int case 1: { r_rorphase = 1; - int nSector = mirror[i].Kills; + int nSector = mirror[i].link; int bakCstat; if (viewPlayer >= 0) { @@ -387,7 +387,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int case 2: { r_rorphase = 1; - int nSector = mirror[i].Kills; + int nSector = mirror[i].link; int bakCstat; if (viewPlayer >= 0) { diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 82f98a1dc..ed6cfdaf5 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -165,12 +165,12 @@ AMMOINFO gAmmoInfo[] = { }; struct ARMORDATA { - int TotalKills; - int Kills; - int at8; - int atc; - int at10; - int at14; + int armor0; + int armor0max; + int armor1; + int armor1max; + int armor2; + int armor2max; }; ARMORDATA armorData[5] = { { 0x320, 0x640, 0x320, 0x640, 0x320, 0x640 }, @@ -183,7 +183,7 @@ ARMORDATA armorData[5] = { struct VICTORY { - const char *TotalKills; + const char *message; int Kills; }; @@ -216,7 +216,7 @@ VICTORY gVictory[] = { }; struct SUICIDE { - const char *TotalKills; + const char *message; int Kills; }; @@ -229,7 +229,7 @@ SUICIDE gSuicide[] = { }; struct DAMAGEINFO { - int TotalKills; + int armorType; int Kills[3]; int at10[3]; }; @@ -1030,18 +1030,18 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { case kItemArmorSpirit: case kItemArmorSuper: { ARMORDATA *pArmorData = &armorData[pItem->type - kItemArmorBasic]; bool pickedUp = false; - if (pPlayer->armor[1] < pArmorData->atc) { - pPlayer->armor[1] = ClipHigh(pPlayer->armor[1]+pArmorData->at8, pArmorData->atc); + if (pPlayer->armor[1] < pArmorData->armor1max) { + pPlayer->armor[1] = ClipHigh(pPlayer->armor[1]+pArmorData->armor1, pArmorData->armor1max); pickedUp = true; } - if (pPlayer->armor[0] < pArmorData->Kills) { - pPlayer->armor[0] = ClipHigh(pPlayer->armor[0]+pArmorData->TotalKills, pArmorData->Kills); + if (pPlayer->armor[0] < pArmorData->armor0max) { + pPlayer->armor[0] = ClipHigh(pPlayer->armor[0]+pArmorData->armor0, pArmorData->armor0max); pickedUp = true; } - if (pPlayer->armor[2] < pArmorData->at14) { - pPlayer->armor[2] = ClipHigh(pPlayer->armor[2]+pArmorData->at10, pArmorData->at14); + if (pPlayer->armor[2] < pArmorData->armor2max) { + pPlayer->armor[2] = ClipHigh(pPlayer->armor[2]+pArmorData->armor2, pArmorData->armor2max); pickedUp = true; } @@ -1814,7 +1814,7 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim) } else { - sprintf(buffer, gSuicide[nMessage].TotalKills, gProfile[nVictim].name); + sprintf(buffer, gSuicide[nMessage].message, gProfile[nVictim].name); } } else @@ -1836,7 +1836,7 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim) } int nMessage = Random(25); int nSound = gVictory[nMessage].Kills; - const char* pzMessage = gVictory[nMessage].TotalKills; + const char* pzMessage = gVictory[nMessage].message; sprintf(buffer, pzMessage, gProfile[nKiller].name, gProfile[nVictim].name); if (gGameOptions.nGameType > 0 && nSound >= 0 && pKiller == gMe) sndStartSample(nSound, 255, 2, 0); @@ -1875,7 +1875,7 @@ void FragPlayer(PLAYER *pPlayer, int nSprite) int playerDamageArmor(PLAYER *pPlayer, DAMAGE_TYPE nType, int nDamage) { DAMAGEINFO *pDamageInfo = &damageInfo[nType]; - int nArmorType = pDamageInfo->TotalKills; + int nArmorType = pDamageInfo->armorType; if (nArmorType >= 0 && pPlayer->armor[nArmorType]) { #if 0 diff --git a/source/blood/src/prediction.cpp b/source/blood/src/prediction.cpp index 825bbc492..db67e09ce 100644 --- a/source/blood/src/prediction.cpp +++ b/source/blood/src/prediction.cpp @@ -78,7 +78,7 @@ void viewInitializePrediction(void) predict.at4c = gMe->angle.spin; predict.at6e = !!(gMe->input.actions & SB_CENTERVIEW); memcpy(&predict.at75,&gSpriteHit[gMe->pSprite->extra],sizeof(SPRITEHIT)); - predict.TotalKills = gMe->bobPhase; + predict.bobPhase = gMe->bobPhase; predict.Kills = gMe->bobAmp; predict.at8 = gMe->bobHeight; predict.atc = gMe->bobWidth; @@ -313,7 +313,7 @@ void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput) predict.at34 = predict.at40 - predict.at38 - (12<<8); - predict.TotalKills = ClipLow(predict.TotalKills-4, 0); + predict.bobPhase = ClipLow(predict.bobPhase-4, 0); nSpeed >>= FRACBITS; if (predict.at48 == 1) @@ -321,9 +321,9 @@ void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput) predict.Kills = (predict.Kills+17)&2047; predict.at14 = (predict.at14+17)&2047; predict.at8 = mulscale30(10*pPosture->bobV,Sin(predict.Kills*2)); - predict.atc = mulscale30(predict.TotalKills*pPosture->bobH,Sin(predict.Kills-256)); - predict.at18 = mulscale30(predict.TotalKills*pPosture->swayV,Sin(predict.at14*2)); - predict.at1c = mulscale30(predict.TotalKills*pPosture->swayH,Sin(predict.at14-0x155)); + predict.atc = mulscale30(predict.bobPhase*pPosture->bobH,Sin(predict.Kills-256)); + predict.at18 = mulscale30(predict.bobPhase*pPosture->swayV,Sin(predict.at14*2)); + predict.at1c = mulscale30(predict.bobPhase*pPosture->swayH,Sin(predict.at14-0x155)); } else { @@ -333,19 +333,19 @@ void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput) predict.at14 = (predict.at14+(pPosture->pace[predict.at70]*4)/2)&2047; if (predict.at70) { - if (predict.TotalKills < 60) - predict.TotalKills = ClipHigh(predict.TotalKills + nSpeed, 60); + if (predict.bobPhase < 60) + predict.bobPhase = ClipHigh(predict.bobPhase + nSpeed, 60); } else { - if (predict.TotalKills < 30) - predict.TotalKills = ClipHigh(predict.TotalKills + nSpeed, 30); + if (predict.bobPhase < 30) + predict.bobPhase = ClipHigh(predict.bobPhase + nSpeed, 30); } } - predict.at8 = mulscale30(predict.TotalKills*pPosture->bobV,Sin(predict.Kills*2)); - predict.atc = mulscale30(predict.TotalKills*pPosture->bobH,Sin(predict.Kills-256)); - predict.at18 = mulscale30(predict.TotalKills*pPosture->swayV,Sin(predict.at14*2)); - predict.at1c = mulscale30(predict.TotalKills*pPosture->swayH,Sin(predict.at14-0x155)); + predict.at8 = mulscale30(predict.bobPhase*pPosture->bobV,Sin(predict.Kills*2)); + predict.atc = mulscale30(predict.bobPhase*pPosture->bobH,Sin(predict.Kills-256)); + predict.at18 = mulscale30(predict.bobPhase*pPosture->swayV,Sin(predict.at14*2)); + predict.at1c = mulscale30(predict.bobPhase*pPosture->swayH,Sin(predict.at14-0x155)); } if (!pXSprite->health) return; diff --git a/source/blood/src/sound.cpp b/source/blood/src/sound.cpp index eb70241d1..72ce19c21 100644 --- a/source/blood/src/sound.cpp +++ b/source/blood/src/sound.cpp @@ -138,12 +138,6 @@ int sndGetRate(int format) -void SoundCallback(intptr_t val) -{ - SAMPLE2D *pChannel = (SAMPLE2D*)val; - pChannel->TotalKills = 0; -} - bool sndCheckPlaying(unsigned int nSound) { auto snd = soundEngine->FindSoundByResID(nSound); diff --git a/source/blood/src/view.h b/source/blood/src/view.h index f40cd50fc..7e43c4f94 100644 --- a/source/blood/src/view.h +++ b/source/blood/src/view.h @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS struct VIEW { - int TotalKills; + int bobPhase; int Kills; int at8; // bob height int atc; // bob width diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index fa2001eea..b02bd3294 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -31,6 +31,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #include "duke3d.h" #include "gamestate.h" #include "dukeactor.h" +#include "savegamehelp.h" //========================================================================== //