diff --git a/source/sw/src/border.cpp b/source/sw/src/border.cpp index 046d28bce..db6c682bf 100644 --- a/source/sw/src/border.cpp +++ b/source/sw/src/border.cpp @@ -51,27 +51,7 @@ short DebugBorderShade = 0; #define X_TO_FIXED(val) (x_aspect_mul*(val)) #define Y_TO_FIXED(val) (y_aspect_mul*(val)) -SWBOOL RedrawScreen = FALSE; - -int f_xdim, f_ydim, x_pix_size, y_pix_size, x_aspect_mul, y_aspect_mul; -int CrosshairX, CrosshairY; - extern SWBOOL BorderAdjust; -SWBOOL GlobSpriteBoxUpdateEveryFrame = FALSE; - - -void -SetupAspectRatio(void) -{ - f_xdim = FIXED(xdim, 0); - f_ydim = FIXED(ydim, 0); - - x_pix_size = (f_320 / xdim); - y_pix_size = (f_200 / ydim); - - x_aspect_mul = (f_xdim / 320); - y_aspect_mul = (f_ydim / 200); -} void SetFragBar(PLAYERp pp) @@ -140,11 +120,18 @@ BORDER_INFO BorderInfoValues[] = static void BorderSetView(PLAYERp, int *Xdim, int *Ydim, int *ScreenSize) { int x, x2, y, y2; - BORDER_INFO *b; + const BORDER_INFO *b = &BorderInfoValues[gs.BorderNum]; + int f_xdim, f_ydim, x_pix_size, y_pix_size, x_aspect_mul, y_aspect_mul; - BorderInfo = BorderInfoValues[gs.BorderNum]; + f_xdim = FIXED(xdim, 0); + f_ydim = FIXED(ydim, 0); + + x_pix_size = (f_320 / xdim); + y_pix_size = (f_200 / ydim); + + x_aspect_mul = (f_xdim / 320); + y_aspect_mul = (f_ydim / 200); - b = &BorderInfo; // figure out the viewing window x and y dimensions *Xdim = MSW(f_xdim - X_TO_FIXED(b->Xdim)); @@ -206,24 +193,4 @@ void SetBorder(PLAYERp pp, int value) SetFragBar(pp); } -void -SetRedrawScreen(PLAYERp pp) -{ - - if (pp != Player + myconnectindex) - return; - - if (!BorderAdjust) - return; - - if (gs.BorderNum < BORDER_NONE) - gs.BorderNum = BORDER_NONE; - - // Redraw the BORDER_TILE only if getting smaller - BorderInfo = BorderInfoValues[gs.BorderNum]; - - // test at redrawing the whole screen - RedrawScreen = TRUE; -} - END_SW_NS diff --git a/source/sw/src/d_menu.cpp b/source/sw/src/d_menu.cpp index 44af30c2f..46085abc4 100644 --- a/source/sw/src/d_menu.cpp +++ b/source/sw/src/d_menu.cpp @@ -194,7 +194,6 @@ void GameInterface::MenuClosed() if (!LoadGameOutsideMoveLoop) { ResumeGame(); - SetRedrawScreen(&Player[myconnectindex]); } } diff --git a/source/sw/src/demo.cpp b/source/sw/src/demo.cpp index f0de2f570..455cae427 100644 --- a/source/sw/src/demo.cpp +++ b/source/sw/src/demo.cpp @@ -424,7 +424,6 @@ DemoPlayBack(void) // THIS STUFF DEPENDS ON MYCONNECTINDEX BEING SET RIGHT pp = Player + myconnectindex; - SetRedrawScreen(pp); if (!DemoInitOnce) buf_ndx = 0; diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 83f66e503..e559e51c7 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -70,7 +70,6 @@ extern SWBOOL HelpInputMode; extern short HelpPage; extern short HelpPagePic[]; extern ParentalStruct aVoxelArray[MAXTILES]; -extern SWBOOL RedrawScreen; SWBOOL RedrawCompass=FALSE; extern int Follow_posx,Follow_posy; @@ -1079,7 +1078,6 @@ ResizeView(PLAYERp pp) inputState.ClearKeyStatus(sc_Escape); dimensionmode = 3; ScrollMode2D = FALSE; - SetRedrawScreen(pp); } #endif } @@ -1923,16 +1921,12 @@ drawscreen(PLAYERp pp) } #endif - if (videoGetRenderMode() >= REND_POLYMOST) - RedrawScreen = TRUE; - DrawScreen = TRUE; PreDraw(); // part of new border refresh method - if (RedrawScreen && !ScreenSavePic) + if (!ScreenSavePic) { RedrawCompass = TRUE; - RedrawScreen = FALSE; // get rid of all PERM sprites! renderFlushPerms(); // get rid of all PANF_KILL_AFTER_SHOW sprites! diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 8d7494601..d58a896f4 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -668,7 +668,6 @@ bool InitGame() } GraphicsMode = TRUE; - SetupAspectRatio(); InitFX(); // JBF: do it down here so we get a hold of the window handle return true; @@ -2148,7 +2147,6 @@ void InitRunLevel(void) // contains what is needed from calls below if (snd_ambience) StartAmbientSound(); - SetRedrawScreen(Player + myconnectindex); // crappy little hack to prevent play clock from being overwritten // for load games SavePlayClock = PlayClock; @@ -2210,8 +2208,6 @@ void InitRunLevel(void) // IMPORTANT - MUST be right before game loop AFTER waitforeverybody InitTimingVars(); - SetRedrawScreen(Player + myconnectindex); - if (snd_ambience) StartAmbientSound(); } @@ -2745,7 +2741,6 @@ getinput(SW_PACKET *loc, SWBOOL tied) dimensionmode = 3; SetFragBar(pp); ScrollMode2D = FALSE; - SetRedrawScreen(pp); } } @@ -3594,8 +3589,8 @@ void GameInterface::set_hud_layout(int requested_size) { gs.BorderNum = 9 - requested_size; SetBorder(Player + myconnectindex, gs.BorderNum); - SetRedrawScreen(Player + myconnectindex); } + ::GameInterface* CreateInterface() { return new GameInterface; @@ -3615,7 +3610,7 @@ void GameInterface::FreeGameData() void GameInterface::UpdateScreenSize() { - SetupAspectRatio(); + // Fixme. The underlying code here is too broken and must be refactored first. } diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 653c208db..f12f337db 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -2270,7 +2270,6 @@ extern SWBOOL ReloadPrompt; extern int x_min_bound, y_min_bound, x_max_bound, y_max_bound; //extern unsigned char synctics, lastsynctics; -extern BORDER_INFO BorderInfo; extern short snum; extern int lockspeed,totalsynctics; @@ -2390,10 +2389,6 @@ void DrawMenuLevelScreen(void); // game.c void DebugWriteString(char *string); // game.c void ManualPlayerInsert(PLAYERp pp); // game.c -void SetRedrawScreen(PLAYERp pp); // border.c -void SetupAspectRatio(void); // border.c -void SetCrosshair(void); // border.c - void initsynccrc(void); // sync.c void demosync_record(void); // sync.c void demosync_test(int cnt); // sync.c diff --git a/source/sw/src/inv.cpp b/source/sw/src/inv.cpp index 1d71eea07..2998663d4 100644 --- a/source/sw/src/inv.cpp +++ b/source/sw/src/inv.cpp @@ -51,7 +51,6 @@ short InventoryBarYpos[] = {172, 172, 130, 130, 130, 130, 130, 130, 130, 130, 13 void PlayerUpdateInventory(PLAYERp pp, short InventoryNum); void SpawnInventoryBar(PLAYERp pp); void InventoryBarUpdatePosition(PLAYERp pp); -void InvBorderRefresh(PLAYERp pp); void InventoryUse(PLAYERp pp); void InventoryStop(PLAYERp pp, short InventoryNum); void KillInventoryBar(PLAYERp pp); @@ -628,7 +627,6 @@ void InventoryKeys(PLAYERp pp) PlayerUpdateInventory(pp, pp->InventoryNum - 1); PutStringInfo(pp, InventoryData[pp->InventoryNum].Name); InventoryBarUpdatePosition(pp); - InvBorderRefresh(pp); } } else @@ -646,7 +644,6 @@ void InventoryKeys(PLAYERp pp) PlayerUpdateInventory(pp, pp->InventoryNum + 1); PutStringInfo(pp, InventoryData[pp->InventoryNum].Name); InventoryBarUpdatePosition(pp); - InvBorderRefresh(pp); } } else @@ -721,20 +718,6 @@ void InventoryKeys(PLAYERp pp) } } -void InvBorderRefresh(PLAYERp pp) -{ -// int x,y; - - if (pp != Player + myconnectindex) - return; - -// x = InventoryBarXpos[gs.BorderNum]; -// y = InventoryBarYpos[gs.BorderNum]; - - SetRedrawScreen(pp); - //BorderRefreshClip(pp, x-5, y-5, x + (MAX_INVENTORY * INVENTORY_ICON_WIDTH), y + 24); -} - void InventoryTimer(PLAYERp pp) { // called every time through loop @@ -754,9 +737,6 @@ void InventoryTimer(PLAYERp pp) KillInventoryBar(pp); // don't update bar anymore pp->InventoryBarTics = 0; - - InvBorderRefresh(pp); - //BorderRefresh(pp); } } diff --git a/source/sw/src/jplayer.cpp b/source/sw/src/jplayer.cpp index 665e617fd..373324af8 100644 --- a/source/sw/src/jplayer.cpp +++ b/source/sw/src/jplayer.cpp @@ -213,8 +213,6 @@ void adduserquote(const char *daquote) { int i; - SetRedrawScreen(Player+myconnectindex); - for (i=MAXUSERQUOTES-1; i>0; i--) { strcpy(user_quote[i],user_quote[i-1]); diff --git a/source/sw/src/network.cpp b/source/sw/src/network.cpp index c260abb20..581a4fafb 100644 --- a/source/sw/src/network.cpp +++ b/source/sw/src/network.cpp @@ -467,7 +467,6 @@ SendMulitNameChange(char *new_name) strcpy(pp->PlayerName, new_name); playername = new_name; - SetRedrawScreen(pp); //TRAVERSE_CONNECT(pnum) { @@ -1505,7 +1504,6 @@ getpackets(void) MONO_PRINT(ds); strcpy(pp->PlayerName, p->PlayerName); - SetRedrawScreen(Player+myconnectindex); break; } diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 8c99a2a08..db4aa54d6 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -106,8 +106,6 @@ char UziRecoilYadj = 0; extern SWBOOL QuitFlag; extern short screenpeek; -BORDER_INFO BorderInfo; - ANIMATOR NullAnimator; pANIMATOR pNullAnimator; int InitStar(PLAYERp); diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 2d914ece9..7c98e501b 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -5215,8 +5215,6 @@ DoPlayerStopDiveNoWarp(PLAYERp pp) if (Prediction) return; - if (!NoMeters) SetRedrawScreen(pp); - StopPlayerSound(pp); // stop diving no warp @@ -5245,8 +5243,6 @@ DoPlayerStopDive(PLAYERp pp) if (Prediction) return; - if (!NoMeters) SetRedrawScreen(pp); - StopPlayerSound(pp); // stop diving with warp @@ -5289,7 +5285,6 @@ DoPlayerDiveMeter(PLAYERp pp) if (metertics <= 0 && !TEST(pp->Flags, PF_DIVING|PF_DIVING_IN_LAVA)) { - SetRedrawScreen(pp); return; } @@ -7775,10 +7770,8 @@ void UpdateScrollingMessages(void) if (user_quote_time[i] <= 0) { - SetRedrawScreen(Player + myconnectindex); user_quote_time[i] = 0; } - //if (!user_quote_time[i]) pub = NUMPAGES; } } diff --git a/source/sw/src/save.cpp b/source/sw/src/save.cpp index 3482c769f..d6d87d0ec 100644 --- a/source/sw/src/save.cpp +++ b/source/sw/src/save.cpp @@ -585,7 +585,6 @@ bool GameInterface::SaveGame(FSaveGameNode *sv) MWRITE(&totalclock,sizeof(totalclock),1,fil); MWRITE(&NormalVisibility,sizeof(NormalVisibility),1,fil); - MWRITE(&BorderInfo,sizeof(BorderInfo),1,fil); MWRITE(&MoveSkip2,sizeof(MoveSkip2),1,fil); MWRITE(&MoveSkip4,sizeof(MoveSkip4),1,fil); MWRITE(&MoveSkip8,sizeof(MoveSkip8),1,fil); @@ -972,7 +971,6 @@ bool GameInterface::LoadGame(FSaveGameNode* sv) MREAD(&NormalVisibility,sizeof(NormalVisibility),1,fil); - MREAD(&BorderInfo,sizeof(BorderInfo),1,fil); MREAD(&MoveSkip2,sizeof(MoveSkip2),1,fil); MREAD(&MoveSkip4,sizeof(MoveSkip4),1,fil); MREAD(&MoveSkip8,sizeof(MoveSkip8),1,fil); @@ -1137,9 +1135,6 @@ bool GameInterface::LoadGame(FSaveGameNode* sv) } InitNetVars(); - SetupAspectRatio(); - SetRedrawScreen(Player + myconnectindex); - screenpeek = myconnectindex; PlayingLevel = Level; diff --git a/source/sw/src/sumo.cpp b/source/sw/src/sumo.cpp index 0df1ce1d5..cc998fe75 100644 --- a/source/sw/src/sumo.cpp +++ b/source/sw/src/sumo.cpp @@ -953,7 +953,6 @@ BossHealthMeter(void) if (metertics <= 0) { - SetRedrawScreen(pp); continue; } diff --git a/source/sw/src/text.cpp b/source/sw/src/text.cpp index dcb17c3f0..eccb4d4e6 100644 --- a/source/sw/src/text.cpp +++ b/source/sw/src/text.cpp @@ -95,8 +95,6 @@ PANEL_SPRITEp pClearTextLineID(PLAYERp pp, short id, int y, short pri) if (psp->ID == id && psp->y == y && psp->priority == pri) { - SetRedrawScreen(psp->PlayerP); - //SET(psp->flags, PANF_INVISIBLE); pSetSuicide(psp); } } @@ -117,9 +115,7 @@ PANEL_SPRITEp pMenuClearTextLineID(PLAYERp pp, short id, int y, short pri) if (psp->ID == id && psp->y == y && psp->priority == pri) { - SetRedrawScreen(psp->PlayerP); pKillSprite(psp); - //pSetSuicide(psp); } } @@ -129,7 +125,6 @@ PANEL_SPRITEp pMenuClearTextLineID(PLAYERp pp, short id, int y, short pri) void pClearTextLine(PLAYERp pp, int y) { - SetRedrawScreen(pp); pClearTextLineID(pp, ID_TEXT, y, PRI_FRONT_MAX); } @@ -137,8 +132,6 @@ void StringTimer(PANEL_SPRITEp psp) { if ((psp->kill_tics -= synctics) <= 0) { - SetRedrawScreen(psp->PlayerP); - //pSetSuicide(psp); // did not work here pKillSprite(psp); return; }