diff --git a/code/REDALERT/CREDITS.CPP b/code/REDALERT/CREDITS.CPP index e81076c..834476e 100644 --- a/code/REDALERT/CREDITS.CPP +++ b/code/REDALERT/CREDITS.CPP @@ -89,14 +89,7 @@ void CreditClass::Graphic_Logic(bool forced) { BStart(BENCH_TABS); - int xx = SeenBuff.Get_Width() - (120 * RESFACTOR); - - /* - ** Adjust the credits display to be above the sidebar for 640x400 - */ -#ifdef WIN32 - xx += 80 * RESFACTOR; -#endif + int xx = SeenBuff.Get_Width() - (120 * RESFACTOR) + ( 80 * RESFACTOR ); /* ** Play a sound effect when the money display changes, but only if a sound @@ -116,7 +109,8 @@ void CreditClass::Graphic_Logic(bool forced) TabClass::Draw_Credits_Tab(); Fancy_Text_Print("%ld", xx, 0, &MetalScheme, TBLACK, TPF_METAL12 | TPF_CENTER | TPF_USE_GRAD_PAL, Current); - if (Scen.MissionTimer.Is_Active()) { + if (Scen.MissionTimer.Is_Active()) + { long secs = Scen.MissionTimer / TICKS_PER_SECOND; long mins = secs / 60; long hours = mins / 60; @@ -141,10 +135,11 @@ void CreditClass::Graphic_Logic(bool forced) Map.FlasherTimer = 7; } + xx = SeenBuff.Get_Width() - (120 * RESFACTOR); if (hours) { - Fancy_Text_Print(TXT_TIME_FORMAT_HOURS, 200 * RESFACTOR, 0, &MetalScheme, TBLACK, TPF_METAL12|TPF_CENTER|TPF_USE_GRAD_PAL, hours, mins, secs); + Fancy_Text_Print(TXT_TIME_FORMAT_HOURS, xx, 0, &MetalScheme, TBLACK, TPF_METAL12|TPF_CENTER|TPF_USE_GRAD_PAL, hours, mins, secs); } else { - Fancy_Text_Print(TXT_TIME_FORMAT_NO_HOURS, 200 * RESFACTOR, 0, &MetalScheme, TBLACK, TPF_METAL12|TPF_CENTER|TPF_USE_GRAD_PAL, mins, secs); + Fancy_Text_Print(TXT_TIME_FORMAT_NO_HOURS, xx, 0, &MetalScheme, TBLACK, TPF_METAL12|TPF_CENTER|TPF_USE_GRAD_PAL, mins, secs); } } diff --git a/code/REDALERT/DISPLAY.CPP b/code/REDALERT/DISPLAY.CPP index 21cd688..4401a5a 100644 --- a/code/REDALERT/DISPLAY.CPP +++ b/code/REDALERT/DISPLAY.CPP @@ -561,33 +561,18 @@ short const * DisplayClass::Text_Overlap_List(char const * text, int x, int y) c *=============================================================================================*/ void DisplayClass::Set_View_Dimensions(int x, int y, int width, int height) { - //if (width == -1) { - // TacLeptonWidth = Pixel_To_Lepton(SeenBuff.Get_Width()-x); - //} else { - // TacLeptonWidth = width * CELL_LEPTON_W; - //} - TacLeptonWidth = Pixel_To_Lepton(SeenBuff.Get_Width() - x); + if (width == -1) width = SeenBuff.Get_Width(); + TacLeptonWidth = Pixel_To_Lepton( width - x); - // ST - 3/1/2019 12:05PM - // Made the below code more consistent with the width calculation. This is needed if we aren't going to draw the tabs at the top of the screen - // - //if (height == -1) { - // TacLeptonHeight = Pixel_To_Lepton(SeenBuff.Get_Height() - y); - // //height = (SeenBuff.Get_Height()-y) / CELL_PIXEL_H; - //} - //else { - // TacLeptonHeight = height * CELL_LEPTON_H; - //} - //TacLeptonHeight = height * CELL_LEPTON_H; - - TacLeptonHeight = Pixel_To_Lepton(SeenBuff.Get_Height() - y); + if (height == -1) height = SeenBuff.Get_Height(); + TacLeptonHeight = Pixel_To_Lepton(height - y); /* ** Adjust the tactical cell if it is now in an invalid position ** because of the changed dimensions. */ - int xx = 0;// Coord_X(TacticalCoord) - (MapCellX * CELL_LEPTON_W); - int yy = 0;// Coord_Y(TacticalCoord) - (MapCellY * CELL_LEPTON_H); + int xx = Coord_X(TacticalCoord) - (MapCellX * CELL_LEPTON_W); + int yy = Coord_Y(TacticalCoord) - (MapCellY * CELL_LEPTON_H); Confine_Rect(&xx, &yy, TacLeptonWidth, TacLeptonHeight, MapCellWidth * CELL_LEPTON_W, MapCellHeight * CELL_LEPTON_H); diff --git a/code/REDALERT/SCENARIO.CPP b/code/REDALERT/SCENARIO.CPP index a523112..0797e76 100644 --- a/code/REDALERT/SCENARIO.CPP +++ b/code/REDALERT/SCENARIO.CPP @@ -571,7 +571,10 @@ bool Read_Scenario(char * name) } #endif Fill_In_Data(); - Map.Set_View_Dimensions(0, 0, Map.MapCellWidth, Map.MapCellHeight); + + // BL 2020-06-15 : not needed !! + //Map.Set_View_Dimensions(0, 0, Map.MapCellWidth, Map.MapCellHeight); + } else { #if (1) @@ -759,7 +762,9 @@ void Fill_In_Data(void) *=============================================================================================*/ void Post_Load_Game(int load_multi) { - Map.Set_View_Dimensions(0, 0, Map.MapCellWidth, Map.MapCellHeight); + // BL 2020-06-15 : not needed !! + //Map.Set_View_Dimensions(0, 0, Map.MapCellWidth, Map.MapCellHeight); + // // Do NOT call Overpass if we're loading a multiplayer game; it calls the // random # generator, which throws the games out of sync if they were diff --git a/code/REDALERT/SIDEBAR.CPP b/code/REDALERT/SIDEBAR.CPP index 916368f..2dc13a1 100644 --- a/code/REDALERT/SIDEBAR.CPP +++ b/code/REDALERT/SIDEBAR.CPP @@ -1030,7 +1030,8 @@ bool SidebarClass::Activate(int control) ** activate it on the left side of the screen. */ if (IsSidebarActive /*&& X*/) { - Set_View_Dimensions(0, 0, (((ScreenWidth/2)-SIDE_WIDTH)/ICON_PIXEL_W) * RESFACTOR); + Set_View_Dimensions( 0, 0, SeenBuff.Get_Width() - ( SIDE_WIDTH * RESFACTOR ) ); + IsToRedraw = true; Help_Text(TXT_NONE); Repair.Zap(); diff --git a/code/REDALERT/TAB.CPP b/code/REDALERT/TAB.CPP index f408886..8527a0e 100644 --- a/code/REDALERT/TAB.CPP +++ b/code/REDALERT/TAB.CPP @@ -139,10 +139,9 @@ void TabClass::Draw_Credits_Tab(void) int width = SeenBuff.Get_Width(); CC_Draw_Shape(TabShape, Map.MoneyFlashTimer > 1 ? 8 : 6, width - (EVA_WIDTH * RESFACTOR), 0, WINDOW_MAIN, SHAPE_NORMAL); - if (Scen.MissionTimer.Is_Active()) { bool light = ((int)Scen.MissionTimer < TICKS_PER_MINUTE * Rule.TimerWarning) || Map.FlasherTimer > 0; - CC_Draw_Shape(TabShape, light ? 4 : 2, 320, 0, WINDOW_MAIN, SHAPE_NORMAL); + CC_Draw_Shape(TabShape, light ? 4 : 2, width - ( ( EVA_WIDTH * 2 ) * RESFACTOR) , 0, WINDOW_MAIN, SHAPE_NORMAL); } } diff --git a/code/REDALERT/WINSTUB.CPP b/code/REDALERT/WINSTUB.CPP index 3755f68..419ea13 100644 --- a/code/REDALERT/WINSTUB.CPP +++ b/code/REDALERT/WINSTUB.CPP @@ -84,7 +84,7 @@ void Show_OldFrameBuffer(bool show) { memset(backbuffer_data, 0, ScreenWidth * ScreenHeight * 4); } -std::vector loaded_images; +std::vector loaded_images; Image_t* Image_LoadImage(const char* name) { // Check to see if the image is already loaded.