* Mission Timer at proper place

* Map view dimensions fixed
This commit is contained in:
Ben Lankamp
2020-06-15 21:20:57 +02:00
parent 47894bc6d4
commit 4d5babd812
6 changed files with 23 additions and 38 deletions
+6 -11
View File
@@ -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);
}
}
+6 -21
View File
@@ -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);
+7 -2
View File
@@ -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
+2 -1
View File
@@ -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();
+1 -2
View File
@@ -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);
}
}
+1 -1
View File
@@ -84,7 +84,7 @@ void Show_OldFrameBuffer(bool show) {
memset(backbuffer_data, 0, ScreenWidth * ScreenHeight * 4);
}
std::vector<Image_t*> loaded_images;
std::vector<Image_t *> loaded_images;
Image_t* Image_LoadImage(const char* name) {
// Check to see if the image is already loaded.