diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index d993ef764..578252cf3 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -66,7 +66,6 @@ extern char buffer[]; SWBOOL DrawScreen; extern short f_c; -extern short HelpPage; extern ParentalStruct aVoxelArray[MAXTILES]; int ConnectCopySprite(uspritetype const * tsp); @@ -1327,12 +1326,6 @@ void SpriteSortList2D(int tx, int ty) } } -void DrawCheckKeys(PLAYERp pp) -{ - if (!InputMode) - ResizeView(pp); -} - void DrawCrosshair(PLAYERp pp) { extern SWBOOL CameraTestMode; @@ -1981,7 +1974,7 @@ drawscreen(PLAYERp pp) #endif // certain input is done here - probably shouldn't be - DrawCheckKeys(pp); + ResizeView(pp); restoreinterpolations(); // Stick at end of drawscreen short_restoreinterpolations(); // Stick at end of drawscreen diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 595c0a2b1..ac127634d 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -94,21 +94,12 @@ extern SWBOOL mapcheat; extern int sw_snd_scratch; -char DemoName[15][16]; - int GameVersion = 20; -char DemoText[3][64]; -int DemoTextYstart = 0; - int Follow_posx=0,Follow_posy=0; SWBOOL NoMeters = FALSE; -SWBOOL GraphicsMode = FALSE; -char PlayerNameArg[32] = ""; -SWBOOL CleanExit = FALSE; SWBOOL FinishAnim = 0; -SWBOOL ShortGameMode = FALSE; SWBOOL ReloadPrompt = FALSE; SWBOOL NewGame = TRUE; SWBOOL InMenuLevel = FALSE; @@ -116,31 +107,17 @@ SWBOOL LoadGameOutsideMoveLoop = FALSE; //Miscellaneous variables SWBOOL FinishedLevel = FALSE; SWBOOL PanelUpdateMode = TRUE; -short HelpPage = 0; -SWBOOL InputMode = FALSE; -SWBOOL MessageInput = FALSE; short screenpeek = 0; -SWBOOL NoDemoStartup = FALSE; -SWBOOL FirstTimeIntoGame; SWBOOL PedanticMode; SWBOOL LocationInfo = 0; void drawoverheadmap(int cposx, int cposy, int czoom, short cang); -int DispFrameRate = FALSE; -int DispMono = TRUE; -int Fog = FALSE; -int FogColor; SWBOOL PreCaching = TRUE; int GodMode = FALSE; -SWBOOL BotMode = FALSE; short Skill = 2; -short BetaVersion = 900; short TotalKillable; -SWBOOL HasAutoColor = FALSE; -uint8_t AutoColor; - const GAME_SET gs_defaults = { // Network game settings @@ -269,15 +246,6 @@ Distance(int x1, int y1, int x2, int y2) } -void TerminateGame(void) -{ - if (CleanExit) - { - //SybexScreen(); - } - throw CExitEvent(3); -} - bool LoadLevel(MapRecord *maprec) { int16_t ang; @@ -393,8 +361,6 @@ bool InitGame() videoInit(); - GraphicsMode = TRUE; - InitFX(); // JBF: do it down here so we get a hold of the window handle return true; } @@ -890,7 +856,7 @@ void Control() NewLevel(); } - CleanExit = TRUE; + //SybexScreen(); throw CExitEvent(0); } diff --git a/source/sw/src/game.h b/source/sw/src/game.h index dad8d4abf..bcce0afba 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -49,6 +49,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "raze_sound.h" #include "c_cvars.h" #include "mapinfo.h" +#include "gamecontrol.h" EXTERN_CVAR(Bool, sw_ninjahack) EXTERN_CVAR(Bool, sw_darts) @@ -170,7 +171,6 @@ y++ ////////////////////////////////////////////////////// extern SWBOOL MenuInputMode; -extern SWBOOL InputMode; // // Defines @@ -2232,7 +2232,6 @@ int DoRipper2RipHeart(short SpriteNum); // ripper2.c int BunnyHatch2(short Weapon); // bunny.c int DoSkullBeginDeath(int16_t SpriteNum); // skull.c -void TerminateGame(void); // game.c void TerminateLevel(void); // game.c void drawoverheadmap(int cposx,int cposy,int czoom,short cang); // game.c void DrawMenuLevelScreen(void); // game.c diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index eb5c29f30..91b54e80f 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -217,7 +217,7 @@ getinput(SW_PACKET *loc, SWBOOL tied) MoveScrollMode2D(Player + myconnectindex); // !JIM! Added M_Active() so that you don't move at all while using menus - if (M_Active() || ScrollMode2D || InputMode) + if (M_Active() || ScrollMode2D) return; SET_LOC_KEY(loc->bits, SK_SPACE_BAR, buttonMap.ButtonDown(gamefunc_Open)); diff --git a/source/sw/src/mclip.cpp b/source/sw/src/mclip.cpp index 9d4ba3d93..71d124800 100644 --- a/source/sw/src/mclip.cpp +++ b/source/sw/src/mclip.cpp @@ -38,244 +38,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS -#if 0 -int MultiClipMove(PLAYERp pp, int z, int floor_dist) -{ - int i; - int ox[MAX_CLIPBOX],oy[MAX_CLIPBOX]; - SPRITEp sp = pp->sop->sp_child; - USERp u = User[sp - sprite]; - SECTOR_OBJECTp sop = pp->sop; - short ang; - short min_ndx; - int min_dist = 999999; - int dist; - - int ret_start; - int ret[MAX_CLIPBOX]; - int x[MAX_CLIPBOX],y[MAX_CLIPBOX]; - - for (i = 0; i < sop->clipbox_num; i++) - { - ang = NORM_ANGLE(fix16_to_int(pp->q16ang) + sop->clipbox_ang[i]); - ox[i] = x[i] = pp->posx + (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)] >> 14); - oy[i] = y[i] = pp->posy + (sop->clipbox_vdist[i] * sintable[ang] >> 14); - - // move the box - ret[i] = clipmove_old(&x[i], &y[i], &z, &pp->cursectnum, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - - // save the dist moved - dist = FindDistance2D(x[i] - ox[i], y[i] - oy[i]); - - if (dist < min_dist) - { - min_dist = dist; - min_ndx = i; - } - } - - // put posx and y off from offset - pp->posx -= ox[min_ndx] - x[min_ndx]; - pp->posy -= oy[min_ndx] - y[min_ndx]; - - return ret[min_ndx]; -} -#endif - -#if 0 -int MultiClipMove(PLAYERp pp, int z, int floor_dist) -{ - int i; - int ox[MAX_CLIPBOX],oy[MAX_CLIPBOX]; - SPRITEp sp = pp->sop->sp_child; - USERp u = User[sp - sprite]; - SECTOR_OBJECTp sop = pp->sop; - short ang; - short min_ndx; - int min_dist = 999999; - int dist; - - int ret_start; - int ret[MAX_CLIPBOX]; - int x[MAX_CLIPBOX],y[MAX_CLIPBOX]; - - for (i = 0; i < sop->clipbox_num; i++) - { - ang = NORM_ANGLE(fix16_to_int(pp->q16ang) + sop->clipbox_ang[i]); - ox[i] = x[i] = pp->posx + (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)] >> 14); - oy[i] = y[i] = pp->posy + (sop->clipbox_vdist[i] * sintable[ang] >> 14); - - // move the box - //pushmove_old(&x[i], &y[i], &z, &pp->cursectnum, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - ret[i] = clipmove_old(&x[i], &y[i], &z, &pp->cursectnum, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - //pushmove_old(&x[i], &y[i], &z, &pp->cursectnum, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - - // save the dist moved - dist = FindDistance2D(x[i] - ox[i], y[i] - oy[i]); - - if (dist < min_dist) - { - min_dist = dist; - min_ndx = i; - } - } - - // put posx and y off from offset - pp->posx -= ox[min_ndx] - x[min_ndx]; - pp->posy -= oy[min_ndx] - y[min_ndx]; - - return ret[min_ndx]; -} -#endif - -#if 0 -int MultiClipMove(PLAYERp pp, int z, int floor_dist) -{ - int i; - int ox[MAX_CLIPBOX],oy[MAX_CLIPBOX]; - SPRITEp sp = pp->sop->sp_child; - USERp u = User[sp - sprite]; - SECTOR_OBJECTp sop = pp->sop; - short ang; - short min_ndx; - int min_dist = 999999; - int dist; - - int ret_start; - int ret[MAX_CLIPBOX]; - int x[MAX_CLIPBOX],y[MAX_CLIPBOX]; - - int xvect,yvect; - int xs,ys; - - for (i = 0; i < sop->clipbox_num; i++) - { - // move the box to position instead of using offset- this prevents small rounding errors - // allowing you to move through wall - ang = NORM_ANGLE(fix16_to_int(pp->q16ang) + sop->clipbox_ang[i]); - - xs = pp->posx; - ys = pp->posy; - - xvect = (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)]); - yvect = (sop->clipbox_vdist[i] * sintable[ang]); - ret_start = clipmove_old(&xs, &ys, &z, &pp->cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - - // save off the start position - ox[i] = x[i] = xs; - oy[i] = y[i] = ys; - - // move the box - ret[i] = clipmove_old(&x[i], &y[i], &z, &pp->cursectnum, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - - // save the dist moved - dist = ksqrt(SQ(x[i] - ox[i]) + SQ(y[i] - oy[i])); - //dist = FindDistance2D(x[i] - ox[i], y[i] - oy[i]); - - if (ret[i]) - { - //DSPRINTF(ds,"i %d, ret %d, dist %d",i, ret[i], dist); - //printf("%s\n",ds); - MONO_PRINT(ds); - } - - if (dist < min_dist) - { - min_dist = dist; - min_ndx = i; - } - } - - // put posx and y off from offset - pp->posx -= ox[min_ndx] - x[min_ndx]; - pp->posy -= oy[min_ndx] - y[min_ndx]; - - return ret[min_ndx]; -} -#endif - -#if 0 -int MultiClipMove(PLAYERp pp, int z, int floor_dist) -{ - int i; - int ox[MAX_CLIPBOX],oy[MAX_CLIPBOX]; - SPRITEp sp = pp->sop->sp_child; - USERp u = User[sp - sprite]; - SECTOR_OBJECTp sop = pp->sop; - short ang; - short min_ndx; - int min_dist = 999999; - int dist; - - int ret_start; - int ret[MAX_CLIPBOX]; - int x[MAX_CLIPBOX],y[MAX_CLIPBOX]; - - int xvect,yvect; - int xs,ys; - - for (i = 0; i < sop->clipbox_num; i++) - { - // move the box to position instead of using offset- this prevents small rounding errors - // allowing you to move through wall - ang = NORM_ANGLE(fix16_to_int(pp->q16ang) + sop->clipbox_ang[i]); - - xs = pp->posx; - ys = pp->posy; - - xvect = (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)]); - yvect = (sop->clipbox_vdist[i] * sintable[ang]); - ret_start = clipmove_old(&xs, &ys, &z, &pp->cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - - if (ret_start) - { - // hit something moving into position - min_dist = 0; - min_ndx = i; - // ox is where it should be - ox[i] = x[i] = pp->posx + (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)] >> 14); - oy[i] = y[i] = pp->posy + (sop->clipbox_vdist[i] * sintable[ang] >> 14); - - x[i] = xs; - y[i] = ys; - - dist = ksqrt(SQ(x[i] - ox[i]) + SQ(y[i] - oy[i])); - //ox[i] = x[i] = oy[i] = y[i] = 0; - } - else - { - // save off the start position - ox[i] = x[i] = xs; - oy[i] = y[i] = ys; - - // move the box - ret[i] = clipmove_old(&x[i], &y[i], &z, &pp->cursectnum, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); - - // save the dist moved - dist = ksqrt(SQ(x[i] - ox[i]) + SQ(y[i] - oy[i])); - //dist = FindDistance2D(x[i] - ox[i], y[i] - oy[i]); - - if (ret[i]) - { - //DSPRINTF(ds,"i %d, ret %d, dist %d",i, ret[i], dist); - MONO_PRINT(ds); - } - - if (dist < min_dist) - { - min_dist = dist; - min_ndx = i; - } - } - } - - // put posx and y off from offset - pp->posx -= ox[min_ndx] - x[min_ndx]; - pp->posy -= oy[min_ndx] - y[min_ndx]; - - return ret[min_ndx]; -} -#endif int MultiClipMove(PLAYERp pp, int z, int floor_dist) { @@ -414,9 +176,6 @@ int testquadinsect(int *point_num, vec2_t const * q, short sectnum) { if (!inside(q[i].x, q[i].y, sectnum)) { - ////DSPRINTF(ds,"inside %ld failed",i); - //MONO_PRINT(ds); - *point_num = i; return FALSE; @@ -429,9 +188,6 @@ int testquadinsect(int *point_num, vec2_t const * q, short sectnum) if (!cansee(q[i].x, q[i].y,0x3fffffff, sectnum, q[next_i].x, q[next_i].y,0x3fffffff, sectnum)) { - DSPRINTF(ds,"cansee %ld failed, x1 %d, y1 %d, x2 %d, y2 %d, sectnum %d",i, q[i].x, q[i].y, q[next_i].x, q[next_i].y, sectnum); - MONO_PRINT(ds); - return FALSE; } } diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 32937daa8..75e3851ad 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -7091,10 +7091,6 @@ void UpdatePanel(void) { short pnum; - extern SWBOOL PanelUpdateMode; - - if (!PanelUpdateMode) - return; TRAVERSE_CONNECT(pnum) { @@ -7107,11 +7103,6 @@ void PreUpdatePanel(void) { short pnum; - extern SWBOOL PanelUpdateMode; - - if (!PanelUpdateMode) - return; - DrawBeforeView = TRUE; //if (DrawBeforeView) diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index d2a534d5a..4fa3fa8d4 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -4102,9 +4102,6 @@ SWBOOL PlayerFlyKey(void) if (!GodMode) return FALSE; - if (InputMode) - return FALSE; - #if 0 // Cheat or not, this simply won't do. key = inputState.GetKeyStatus(KEYSC_J); @@ -7924,8 +7921,6 @@ PlayerSpawnPosition(PLAYERp pp) if (spawn_sprite < 0) { spawn_sprite = headspritestat[STAT_MULTI_START + 0]; - //TerminateGame(); - //printf("Map does not contain a spawn position for Player %d.", pp - Player); } ASSERT(spawn_sprite >= 0); diff --git a/source/sw/src/save.cpp b/source/sw/src/save.cpp index 9ac9f3634..499d9e22e 100644 --- a/source/sw/src/save.cpp +++ b/source/sw/src/save.cpp @@ -228,8 +228,6 @@ bool GameInterface::SaveGame(FSaveGameNode *sv) // workaround until the level info here has been transitioned. fil = WriteSavegameChunk("snapshot.sw"); - MWRITE(&GameVersion,sizeof(GameVersion),1,fil); - MWRITE(&Skill,sizeof(Skill),1,fil); MWRITE(&numplayers,sizeof(numplayers),1,fil); @@ -693,13 +691,6 @@ bool GameInterface::LoadGame(FSaveGameNode* sv) if (!filr.isOpen()) return false; fil = &filr; - MREAD(&i,sizeof(i),1,fil); - if (i != GameVersion) - { - MCLOSE_READ(fil); - return false; - } - MREAD(&Skill,sizeof(Skill),1,fil); MREAD(&numplayers, sizeof(numplayers),1,fil); diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index 648044448..71eae13df 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -4941,21 +4941,11 @@ ActorDrop(short SpriteNum, int x, int y, int z, short new_sector, short min_heig FAFgetzrangepoint(x, y, z - DIV2(SPRITEp_SIZE_Z(sp)), new_sector, &hiz, &ceilhit, &loz, &florhit); SET(sp->cstat, save_cstat); -#if 0 - if (florhit < 0 || ceilhit < 0) - { - Printf("ERROR: FAFgetzrange() returned -1 for floor or ceiling check.\n"); - Printf("Most likely a sprite has been placed too close to a white wall.\n"); - Printf("spnum %d, sect %d, x %d, y %d, z %d, florhit %d, pic %d\n", SpriteNum, sp->sectnum, sp->x, sp->y, z - DIV2(SPRITEp_SIZE_Z(sp)), florhit, sp->picnum); - TerminateGame(); - } -#else if (florhit < 0 || ceilhit < 0) { //SetSuicide(SpriteNum); return TRUE; } -#endif // ASSERT(florhit >= 0);