diff --git a/source/games/sw/src/_polymost.cpp b/source/games/sw/src/_polymost.cpp index 85d219b20..427fec776 100644 --- a/source/games/sw/src/_polymost.cpp +++ b/source/games/sw/src/_polymost.cpp @@ -1,20 +1,15 @@ BEGIN_SW_NS -bool FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum); -bool FindFloorView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum); +bool FindCeilingView(int match, int* x, int* y, int z, int* sectnum); +bool FindFloorView(int match, int* x, int* y, int z, int* sectnum); -short -ViewSectorInScene(short cursectnum, short level) +int ViewSectorInScene(int cursectnum, int level) { - int i; - SPRITEp sp; - short match; - SWStatIterator it(STAT_FAF); while (auto actor = it.Next()) { - sp = &actor->s(); + auto sp = &actor->s(); if (sp->hitag == level) { @@ -27,7 +22,7 @@ ViewSectorInScene(short cursectnum, short level) // only gets to here is sprite is pointing down // found a potential match - match = sp->lotag; + int match = sp->lotag; if (!testgotpic(FAF_MIRROR_PIC, true)) return -1; @@ -41,15 +36,11 @@ ViewSectorInScene(short cursectnum, short level) -void -DrawOverlapRoom(int tx, int ty, int tz, fixed_t tq16ang, fixed_t tq16horiz, short tsectnum) +void DrawOverlapRoom(int tx, int ty, int tz, fixed_t tq16ang, fixed_t tq16horiz, int tsectnum) { - short i; - short match; - save.zcount = 0; - match = ViewSectorInScene(tsectnum, VIEW_LEVEL1); + int match = ViewSectorInScene(tsectnum, VIEW_LEVEL1); if (match != -1) { FindCeilingView(match, &tx, &ty, tz, &tsectnum); @@ -60,7 +51,7 @@ DrawOverlapRoom(int tx, int ty, int tz, fixed_t tq16ang, fixed_t tq16horiz, shor renderDrawRoomsQ16(tx, ty, tz, tq16ang, tq16horiz, tsectnum, false); // reset Z's - for (i = 0; i < save.zcount; i++) + for (int i = 0; i < save.zcount; i++) { sector[save.sectnum[i]].floorz = save.zval[i]; sector[save.sectnum[i]].floorpicnum = save.pic[i]; @@ -74,7 +65,7 @@ DrawOverlapRoom(int tx, int ty, int tz, fixed_t tq16ang, fixed_t tq16horiz, shor } else { - match = ViewSectorInScene(tsectnum, VIEW_LEVEL2); + int match = ViewSectorInScene(tsectnum, VIEW_LEVEL2); if (match != -1) { FindFloorView(match, &tx, &ty, tz, &tsectnum); @@ -85,7 +76,7 @@ DrawOverlapRoom(int tx, int ty, int tz, fixed_t tq16ang, fixed_t tq16horiz, shor renderDrawRoomsQ16(tx, ty, tz, tq16ang, tq16horiz, tsectnum, false); // reset Z's - for (i = 0; i < save.zcount; i++) + for (int i = 0; i < save.zcount; i++) { sector[save.sectnum[i]].ceilingz = save.zval[i]; sector[save.sectnum[i]].ceilingpicnum = save.pic[i]; @@ -100,7 +91,7 @@ DrawOverlapRoom(int tx, int ty, int tz, fixed_t tq16ang, fixed_t tq16horiz, shor } } -void FAF_DrawRooms(int x, int y, int z, fixed_t q16ang, fixed_t q16horiz, short sectnum) +void FAF_DrawRooms(int x, int y, int z, fixed_t q16ang, fixed_t q16horiz, int sectnum) { SWStatIterator it(STAT_CEILING_FLOOR_PIC_OVERRIDE); while (auto actor = it.Next()) @@ -243,7 +234,7 @@ void JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, fixed_t tpq16ang, fixed { SPRITEp sp=nullptr; int camhoriz; - short w; + int w; int dx, dy, dz, tdx, tdy, tdz, midx, midy; @@ -255,8 +246,8 @@ void JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, fixed_t tpq16ang, fixed w = mirror[cnt].mirrorwall; // Get wall midpoint for offset in mirror view - midx = (wall[w].x + wall[wall[w].point2].x) / 2; - midy = (wall[w].y + wall[wall[w].point2].y) / 2; + midx = (wall[w].x + wall[w].point2Wall()->x) / 2; + midy = (wall[w].y + wall[w].point2Wall()->y) / 2; // Finish finding offsets tdx = abs(midx - tx); diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index ba09aba70..2365256dc 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -992,7 +992,7 @@ int DoActorMoveCloser(DSWActor* actor) */ -short FindTrackToPlayer(DSWActor* actor) +int FindTrackToPlayer(DSWActor* actor) { auto u = actor->u(); SPRITEp sp = &actor->s(); @@ -1031,8 +1031,6 @@ short FindTrackToPlayer(DSWActor* actor) BIT(TT_SCAN) }; - //MONO_PRINT("FindTrackToPlayer\n"); - zdiff = ActorUpper(u->targetActor) - (sp->z - SPRITEp_SIZE_Z(sp) + Z(8)); if (labs(zdiff) <= Z(20)) @@ -1065,9 +1063,6 @@ short FindTrackToPlayer(DSWActor* actor) u->track_dir = track_dir; SET(Track[track].flags, TF_TRACK_OCCUPIED); - ////DSPRINTF(ds, "Found Track To Player\n"); - //MONO_PRINT(ds); - return track; } } @@ -1078,7 +1073,7 @@ short FindTrackToPlayer(DSWActor* actor) -short FindTrackAwayFromPlayer(DSWActor* actor) +int FindTrackAwayFromPlayer(DSWActor* actor) { auto u = actor->u(); int point, track_dir, track; @@ -1098,8 +1093,6 @@ short FindTrackAwayFromPlayer(DSWActor* actor) BIT(TT_SCAN) }; - //MONO_PRINT("FindTrackAwayFromPlayer\n"); - for (i = 0; i < SIZ(RunAwayTracks); i++) { track = ActorFindTrack(actor, -1, RunAwayTracks[i], &point, &track_dir); @@ -1110,12 +1103,8 @@ short FindTrackAwayFromPlayer(DSWActor* actor) u->track_dir = track_dir; SET(Track[track].flags, TF_TRACK_OCCUPIED); - ////DSPRINTF(ds, "Found Run Away Track\n"); - //MONO_PRINT(ds); - return track; } - //MONO_PRINT("Did not find a run away track!\n"); } return -1; @@ -1123,7 +1112,7 @@ short FindTrackAwayFromPlayer(DSWActor* actor) } -short FindWanderTrack(DSWActor* actor) +int FindWanderTrack(DSWActor* actor) { auto u = actor->u(); int point, track_dir, track; @@ -1305,7 +1294,7 @@ int DoActorAttack(DSWActor* actor) { USER* u = actor->u(); SPRITEp sp = &actor->s(); - short rand_num; + int rand_num; int dist,a,b,c; DoActorNoise(ChooseAction(u->Personality->Broadcast),actor); @@ -1415,9 +1404,7 @@ int InitActorDuck(DSWActor* actor) { USER* u = actor->u(); SPRITEp sp = &actor->s(); - short dist; - -// MONO_PRINT(strcpy(ds, "Init Actor Duck")); + int dist; if (!u->ActorActionSet->Duck) { @@ -1482,7 +1469,7 @@ int DoActorMoveJump(DSWActor* actor) } -Collision move_scan(DSWActor* actor, short ang, int dist, int *stopx, int *stopy, int *stopz, short *stopsect) +Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy, int *stopz, int *stopsect) { USERp u = actor->u(); SPRITEp sp = &actor->s(); @@ -1490,7 +1477,7 @@ Collision move_scan(DSWActor* actor, short ang, int dist, int *stopx, int *stopy int nx,ny; uint32_t cliptype = CLIPMASK_ACTOR; - short sang,ss; + int sang,ss; int x, y, z, loz, hiz; DSWActor* highActor; DSWActor* lowActor; @@ -1555,7 +1542,7 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove) USERp u = actor->u(); SPRITEp sp = &actor->s(); - static short toward_angle_delta[4][9] = + static const int16_t toward_angle_delta[4][9] = { { -160, -384, 160, 384, -256, 256, -512, 512, -99}, { -384, -160, 384, 160, -256, 256, -512, 512, -99}, @@ -1563,7 +1550,7 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove) { 384, 160, -384, -160, 256, -256, 512, -512, -99} }; - static short away_angle_delta[4][8] = + static const int16_t away_angle_delta[4][8] = { { -768, 768, -640, 640, -896, 896, 1024, -99}, { 768, -768, 640, -640, -896, 896, 1024, -99}, @@ -1572,14 +1559,14 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove) }; - int16_t* adp = nullptr; + const int16_t* adp = nullptr; - short new_ang, oang; - short save_ang = -1; + int new_ang, oang; + int save_ang = -1; int set; int dist, stopx, stopy, stopz; - short stopsect; + int stopsect; // start out with mininum distance that will be accepted as a move int save_dist = 500; @@ -1691,7 +1678,7 @@ int InitActorReposition(DSWActor* actor) { USER* u = actor->u(); SPRITEp sp = &actor->s(); - short ang; + int ang; int rnum; int dist; diff --git a/source/games/sw/src/ai.h b/source/games/sw/src/ai.h index 54c3d7d8c..456d98b92 100644 --- a/source/games/sw/src/ai.h +++ b/source/games/sw/src/ai.h @@ -32,7 +32,7 @@ BEGIN_SW_NS // Call functions based on a random range value typedef struct { - short range; + int range; ANIMATORp action; } DECISION, *DECISIONp; @@ -61,7 +61,7 @@ typedef enum struct ATTRIBUTEstruct { - short Speed[MAX_SPEED]; + int16_t Speed[MAX_SPEED]; int8_t TicAdjust[MAX_SPEED]; uint8_t MaxWeapons; /*ATTRIB_SNDS*/ int Sounds[MAXATTRIBSNDS]; // JBF: ATTRIB_SNDS? Somehow I don't think this is what was intended... @@ -90,8 +90,8 @@ int InitActorExtra6Noise(DSWActor* actor); int InitActorMoveCloser(DSWActor* actor); int DoActorCantMoveCloser(DSWActor* actor); int DoActorMoveCloser(DSWActor* actor); -short FindTrackToPlayer(DSWActor* actor); -short FindTrackAwayFromPlayer(DSWActor* actor); +int FindTrackToPlayer(DSWActor* actor); +int FindTrackAwayFromPlayer(DSWActor* actor); int InitActorRunAway(DSWActor* actor); int InitActorRunToward(DSWActor* actor); int InitActorAttack(DSWActor* actor); diff --git a/source/games/sw/src/bots.h b/source/games/sw/src/bots.h index d1d662daf..741785d2b 100644 --- a/source/games/sw/src/bots.h +++ b/source/games/sw/src/bots.h @@ -65,12 +65,12 @@ struct NODETREEstruct // Bots main action variables typedef struct BOT_BRAIN { - short tgt_inv; // Inventory item it wants to use - short tgt_weapon; // weapon in wants to activate and use - short tgt_enemy; // Enemy it wants to kill - short tgt_sprite; // Sprite it wants to pickup or operate - short tgt_sector; // Sector it wants to get to - short tgt_wall; // Wall it wants to touch + int16_t tgt_inv; // Inventory item it wants to use + int16_t tgt_weapon; // weapon in wants to activate and use + int16_t tgt_enemy; // Enemy it wants to kill + int16_t tgt_sprite; // Sprite it wants to pickup or operate + int16_t tgt_sector; // Sector it wants to get to + int16_t tgt_wall; // Wall it wants to touch BOT_Actions action; // Bot's current action } BotBrain, *BotBrain_p; diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index c0232aa2c..bdc3746d9 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -39,8 +39,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS -static int SectorOfWall(short theline); -static void DoWallBreakSpriteMatch(short match); +static int SectorOfWall(int theline); +static void DoWallBreakSpriteMatch(int match); BREAK_INFO WallBreakInfo[] = { @@ -441,18 +441,18 @@ static int CompareBreakInfo(void const * a, void const * b) return break_info1->picnum - break_info2->picnum; } -int CompareSearchBreakInfo(short *picnum, BREAK_INFOp break_info) +int CompareSearchBreakInfo(int *picnum, BREAK_INFOp break_info) { // will return a number less than 0 if picnum < break_info->picnum return(*picnum - break_info->picnum); } -BREAK_INFOp FindWallBreakInfo(short picnum) +BREAK_INFOp FindWallBreakInfo(int picnum) { return(BREAK_INFOp)(bsearch(&picnum, &WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo)); } -BREAK_INFOp FindSpriteBreakInfo(short picnum) +BREAK_INFOp FindSpriteBreakInfo(int picnum) { return(BREAK_INFOp)(bsearch(&picnum, &SpriteBreakInfo, SIZ(SpriteBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo)); } @@ -494,7 +494,7 @@ BREAK_INFOp SetupWallForBreak(WALLp wallp) BREAK_INFOp SetupSpriteForBreak(DSWActor* actor) { auto sp = &actor->s(); - short picnum = sp->picnum; + int picnum = sp->picnum; BREAK_INFOp break_info; // ignore as a breakable if true @@ -532,7 +532,7 @@ BREAK_INFOp SetupSpriteForBreak(DSWActor* actor) // ACTIVATE ////////////////////////////////////////////// -DSWActor* FindBreakSpriteMatch(short match) +DSWActor* FindBreakSpriteMatch(int match) { SWStatIterator it(STAT_BREAKABLE); while (auto actor = it.Next()) @@ -551,7 +551,7 @@ DSWActor* FindBreakSpriteMatch(short match) // WALL // -int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, short ang, short type) +int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, int ang, int type) { BREAK_INFOp break_info; WALLp nwp; @@ -641,9 +641,9 @@ int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, short ang, short return true; } -bool UserBreakWall(WALLp wp, short) +bool UserBreakWall(WALLp wp) { - short match = wp->hitag; + int match = wp->hitag; int block_flags = CSTAT_WALL_BLOCK|CSTAT_WALL_BLOCK_HITSCAN; int type_flags = CSTAT_WALL_TRANSLUCENT|CSTAT_WALL_MASKED|CSTAT_WALL_1WAY; int flags = block_flags|type_flags; @@ -730,12 +730,12 @@ bool UserBreakWall(WALLp wp, short) return false; } -int WallBreakPosition(short hit_wall, int *sectnum, int *x, int *y, int *z, short *ang) +int WallBreakPosition(int hit_wall, int *sectnum, int *x, int *y, int *z, int *ang) { - short w,nw; + int w,nw; WALLp wp; int nx,ny; - short wall_ang; + int wall_ang; w = hit_wall; wp = &wall[w]; @@ -752,29 +752,29 @@ int WallBreakPosition(short hit_wall, int *sectnum, int *x, int *y, int *z, shor //getzsofsector(*sectnum, *x, *y, cz, fz); - if (wp->nextwall < 0) + if (!wp->twoSided()) { // white wall *z = DIV2(sector[*sectnum].floorz + sector[*sectnum].ceilingz); } else { - short next_sectnum = wp->nextsector; + auto next_sect = wp->nextSector(); // red wall ASSERT(wp->nextsector >= 0); // floor and ceiling meet - if (sector[next_sectnum].floorz == sector[next_sectnum].ceilingz) - *z = DIV2(sector[*sectnum].floorz + sector[*sectnum].ceilingz); + if (next_sect->floorz == next_sect->ceilingz) + *z = (sector[*sectnum].floorz + sector[*sectnum].ceilingz) >> 1; else // floor is above other sector - if (sector[next_sectnum].floorz < sector[*sectnum].floorz) - *z = DIV2(sector[next_sectnum].floorz + sector[*sectnum].floorz); + if (next_sect->floorz < sector[*sectnum].floorz) + *z = (next_sect->floorz + sector[*sectnum].floorz) >> 1; else // ceiling is below other sector - if (sector[next_sectnum].ceilingz > sector[*sectnum].ceilingz) - *z = DIV2(sector[next_sectnum].ceilingz + sector[*sectnum].ceilingz); + if (next_sect->ceilingz > sector[*sectnum].ceilingz) + *z = (next_sect->ceilingz + sector[*sectnum].ceilingz) >> 1; } *ang = wall_ang; @@ -796,13 +796,13 @@ int WallBreakPosition(short hit_wall, int *sectnum, int *x, int *y, int *z, shor } // If the tough parameter is not set, then it can't break tough walls and sprites -bool HitBreakWall(WALLp wp, int hit_x, int hit_y, int hit_z, short ang, short type) +bool HitBreakWall(WALLp wp, int hit_x, int hit_y, int hit_z, int ang, int type) { - short match = wp->hitag; + int match = wp->hitag; if (match > 0) { - UserBreakWall(wp, ang); + UserBreakWall(wp); return true; } @@ -855,8 +855,8 @@ int UserBreakSprite(DSWActor* breakActor) { SPRITEp sp; SPRITEp bp = &breakActor->s(); - short match = bp->lotag; - short match_extra; + int match = bp->lotag; + int match_extra; auto actor = FindBreakSpriteMatch(match); @@ -924,11 +924,10 @@ int UserBreakSprite(DSWActor* breakActor) return false; } -int AutoBreakSprite(DSWActor* breakActor, short type) +int AutoBreakSprite(DSWActor* breakActor, int type) { SPRITEp bp = &breakActor->s(); BREAK_INFOp break_info; - extern void DoWallBreakMatch(short match); break_info = FindSpriteBreakInfo(bp->picnum); @@ -1011,7 +1010,7 @@ bool NullActor(DSWActor* actor) return false; } -int HitBreakSprite(DSWActor* breakActor, short type) +int HitBreakSprite(DSWActor* breakActor, int type) { SPRITEp bp = &breakActor->s(); USERp bu = breakActor->u(); @@ -1038,48 +1037,32 @@ int HitBreakSprite(DSWActor* breakActor, short type) return AutoBreakSprite(breakActor, type); } -static int SectorOfWall(short theline) +static int SectorOfWall(int theline) { - short i, startwall, endwall, sectnum; - - sectnum = -1; - - for (i=0; i= startwall) && (theline <= endwall)) - { - sectnum = i; - break; - } - } - - return sectnum; + return wall[theline].sector; } -void DoWallBreakMatch(short match) +void DoWallBreakMatch(int match) { int i,sectnum; int x,y,z; WALLp wp; - short wall_ang; + int wall_ang; for (i=0; i<=numwalls; i++) { if (wall[i].hitag == match) { WallBreakPosition(i, §num, &x, &y, &z, &wall_ang); - //short nw = wall[i].point2; - //wall_ang = NORM_ANGLE(getangle(wall[nw].x - wall[i].x, wall[nw].y - wall[i].y)+512); - wp = &wall[i]; + + wp = &wall[i]; wp->hitag = 0; // Reset the hitag AutoBreakWall(wp, x, y, z, wall_ang, 0); } } } -static void DoWallBreakSpriteMatch(short match) +static void DoWallBreakSpriteMatch(int match) { SWStatIterator it(STAT_ENEMY); while (auto actor = it.Next()) diff --git a/source/games/sw/src/break.h b/source/games/sw/src/break.h index 725a9ab4e..19f0066bd 100644 --- a/source/games/sw/src/break.h +++ b/source/games/sw/src/break.h @@ -41,20 +41,20 @@ enum typedef struct BREAK_INFO { - short picnum, breaknum, shrap_type; - short flags, shrap_amt; + int16_t picnum, breaknum, shrap_type; + int16_t flags, shrap_amt; } *BREAK_INFOp; -BREAK_INFOp FindWallBreakInfo(short picnum); -BREAK_INFOp FindSpriteBreakInfo(short picnum); +BREAK_INFOp FindWallBreakInfo(int picnum); +BREAK_INFOp FindSpriteBreakInfo(int picnum); void SortBreakInfo(void); BREAK_INFOp SetupWallForBreak(WALLp wallp); BREAK_INFOp SetupSpriteForBreak(DSWActor* actor); -bool HitBreakWall(WALLp wp, int, int, int, short ang, short type); -int HitBreakSprite(short BreakSprite, short type); -bool CheckBreakToughness(BREAK_INFOp break_info, short ID); -int WallBreakPosition(short hit_wall, int *sectnum, int *x, int *y, int *z, short *ang); +bool HitBreakWall(WALLp wp, int, int, int, int ang, int type); +bool CheckBreakToughness(BREAK_INFOp break_info, int ID); +int WallBreakPosition(int hit_wall, int *sectnum, int *x, int *y, int *z, int *ang); void SortBreakInfo(void); +void DoWallBreakMatch(int match); END_SW_NS diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index f54e714d0..025673b04 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -841,7 +841,7 @@ int DoBunnyBeginJumpAttack(DSWActor* actor) USER* u = actor->u(); SPRITEp sp = &actor->s(); SPRITEp psp = &u->targetActor->s(); - short tang; + int tang; tang = getangle(psp->x - sp->x, psp->y - sp->y); @@ -1149,7 +1149,7 @@ void BunnyHatch(DSWActor* actor) SPRITEp np; USERp nu; const int MAX_BUNNYS = 1; - short rip_ang[MAX_BUNNYS]; + int16_t rip_ang[MAX_BUNNYS]; rip_ang[0] = RANDOM_P2(2048); diff --git a/source/games/sw/src/colormap.cpp b/source/games/sw/src/colormap.cpp index f1826f03a..407fa44ac 100644 --- a/source/games/sw/src/colormap.cpp +++ b/source/games/sw/src/colormap.cpp @@ -32,10 +32,10 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS -short f_c = 3; +int f_c = 3; void -MapColors(short num, COLOR_MAP cm, short create, uint8_t *tempbuf) +MapColors(int num, COLOR_MAP cm, int create, uint8_t *tempbuf) { int i; float inc; @@ -212,7 +212,7 @@ void GameInterface::loadPalette(void) static COLOR_MAP MenuHighlight = {16, 16, RED, FIRE}; unsigned int i; - short play; + int play; uint8_t tempbuf[256]; paletteLoadFromDisk(); diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index cee3ac431..7851e8a0b 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -544,8 +544,6 @@ int SetupCoolg(DSWActor* actor) return 0; } -extern short TotalKillable; - int NewCoolg(DSWActor* actor) { USERp u = actor->u(); diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index 042887664..0bbe2c2a6 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -341,41 +341,6 @@ STATEp sg_CoolieDead[] = s_CoolieDead }; -/* -typedef struct -{ -#define MAX_ACTOR_CLOSE_ATTACK 2 -#define MAX_ACTOR_ATTACK 6 -STATEp *Stand; -STATEp *Run; -STATEp *Jump; -STATEp *Fall; -STATEp *Crawl; -STATEp *Swim; -STATEp *Fly; -STATEp *Rise; -STATEp *Sit; -STATEp *Look; -STATEp *Climb; -STATEp *Pain; -STATEp *Death1; -STATEp *Death2; -STATEp *Dead; -STATEp *DeathJump; -STATEp *DeathFall; - -STATEp *CloseAttack[MAX_ACTOR_CLOSE_ATTACK]; -short CloseAttackPercent[MAX_ACTOR_CLOSE_ATTACK]; - -STATEp *Attack[MAX_ACTOR_ATTACK]; -short AttackPercent[MAX_ACTOR_ATTACK]; - -STATEp *Special[2]; -STATEp *Duck; -STATEp *Dive; -}ACTOR_ACTION_SET,*ACTOR_ACTION_SETp; -*/ - ACTOR_ACTION_SET CoolieActionSet = { sg_CoolieStand, @@ -410,10 +375,9 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp perso USERp u = actor->u(); SPRITEp sp = &actor->s(); unsigned int wpn; - short wpn_cnt; - short depth = 0; - extern short TotalKillable; - + int wpn_cnt; + int depth = 0; + switch (u->ID) { case PACHINKO1: diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index d9a4fccdb..21713b546 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -66,7 +66,7 @@ static int OverlapDraw = false; extern bool QuitFlag, SpriteInfo; extern bool Voxel; bool DrawScreen; -extern short f_c; +extern int f_c; extern ParentalStruct aVoxelArray[MAXTILES]; diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index aa22b1740..82b8888da 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -106,7 +106,7 @@ short screenpeek = 0; int GodMode = false; short Skill = 2; -short TotalKillable; +int TotalKillable; const GAME_SET gs_defaults = { diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 123956982..d1b91b4c0 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2113,7 +2113,7 @@ int32_t registerosdcommands(void); void SW_InitMultiPsky(void); extern short LevelSecrets; -extern short TotalKillable; +extern int TotalKillable; extern int OrigCommPlayers; extern uint8_t PlayerGravity; diff --git a/source/games/sw/src/input.cpp b/source/games/sw/src/input.cpp index 006f205fa..29948a25e 100644 --- a/source/games/sw/src/input.cpp +++ b/source/games/sw/src/input.cpp @@ -86,8 +86,8 @@ static void processWeapon(PLAYERp const pp) if (loc.getNewWeapon() == WeaponSel_Next) { - short next_weapon = u->WeaponNum + 1; - short start_weapon; + int next_weapon = u->WeaponNum + 1; + int start_weapon; start_weapon = u->WeaponNum + 1; @@ -121,8 +121,8 @@ static void processWeapon(PLAYERp const pp) } else if (loc.getNewWeapon() == WeaponSel_Prev) { - short prev_weapon = u->WeaponNum - 1; - short start_weapon; + int prev_weapon = u->WeaponNum - 1; + int start_weapon; start_weapon = u->WeaponNum - 1; @@ -153,7 +153,7 @@ static void processWeapon(PLAYERp const pp) } else if (loc.getNewWeapon() == WeaponSel_Alt) { - short const which_weapon = u->WeaponNum + 1; + int which_weapon = u->WeaponNum + 1; loc.setNewWeapon(which_weapon); } } diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index 5ab9ec96c..554a6276a 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -728,7 +728,7 @@ void GetUpperLowerSector(short match, int x, int y, short *upper, short *lower) } } -bool FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum) +bool FindCeilingView(int match, int* x, int* y, int z, int* sectnum) { int xoff = 0; int yoff = 0; @@ -823,7 +823,7 @@ bool FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* se return true; } -bool FindFloorView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum) +bool FindFloorView(int match, int* x, int* y, int z, int* sectnum) { int xoff = 0; int yoff = 0; @@ -1023,7 +1023,7 @@ void CollectPortals() int tx = actor->s().x; int ty = actor->s().y; int tz = actor->s().z; - int16_t tsectnum = sec; + int tsectnum = sec; int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL1); if (match != -1) @@ -1053,7 +1053,7 @@ void CollectPortals() int tx = actor->s().x; int ty = actor->s().y; int tz = actor->s().z; - int16_t tsectnum = sec; + int tsectnum = sec; int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL2); if (match != -1) diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 8f2c2e64b..c2d93d30f 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -7313,7 +7313,7 @@ void TraverseBreakableWalls(short start_sect, int x, int y, int z, short ang, in short break_count; int sectnum; - short wall_ang; + int wall_ang; int hit_x,hit_y,hit_z; @@ -19515,7 +19515,7 @@ int ShrapKillSprite(DSWActor* actor) return 0; } -bool CheckBreakToughness(BREAK_INFOp break_info, short ID) +bool CheckBreakToughness(BREAK_INFOp break_info, int ID) { ////DSPRINTF(ds,"CheckBreakToughness called with %d",ID); //CON_Message(ds);