From be480a28a917874e58472eef9cacbe1b6eee9883 Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Wed, 3 Jun 2020 19:35:45 -0700 Subject: [PATCH] Power bar draws on the sidebar correctly. --- REDALERT/POWER.CPP | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/REDALERT/POWER.CPP b/REDALERT/POWER.CPP index 1efabb0..57ec666 100644 --- a/REDALERT/POWER.CPP +++ b/REDALERT/POWER.CPP @@ -135,7 +135,7 @@ void PowerClass::Init_Clear(void) void PowerClass::One_Time(void) { RadarClass::One_Time(); - PowerButton.X = POWER_X * RESFACTOR; + PowerButton.X = ScreenWidth - (640 - (POWER_X * RESFACTOR)); PowerButton.Y = POWER_Y * RESFACTOR; PowerButton.Width = (POWER_WIDTH * RESFACTOR)-1; PowerButton.Height = POWER_HEIGHT * RESFACTOR; @@ -166,7 +166,7 @@ void PowerClass::Draw_It(bool complete) 0, -1, 0, 1, 0, -1, -2, -1, 0, 1, 2, 1 ,0 }; - if (complete || IsToRedraw) { + { BStart(BENCH_POWER); if (LogicPage->Lock()) { @@ -181,13 +181,13 @@ void PowerClass::Draw_It(bool complete) } // LogicPage->Fill_Rect(POWER_X, POWER_Y, POWER_X+POWER_WIDTH-1, POWER_Y+POWER_HEIGHT-1, LTGREY); - CC_Draw_Shape(PowerBarShape, 0, 240 * RESFACTOR, 88 * RESFACTOR, WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap); + CC_Draw_Shape(PowerBarShape, 0, ScreenWidth - (640 - (240 * RESFACTOR)), 88 * RESFACTOR, WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap); #ifdef WIN32 /* ** Hires power strip is too big to fit into a shape so it is in two parts */ - CC_Draw_Shape(PowerBarShape, 1, 240 * RESFACTOR, (88 * RESFACTOR) + (56*RESFACTOR), WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap); + CC_Draw_Shape(PowerBarShape, 1, ScreenWidth - (640 - (240 * RESFACTOR)), (88 * RESFACTOR) + (56*RESFACTOR), WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap); #endif /* ** Determine how much the power production exceeds or falls short @@ -228,14 +228,14 @@ void PowerClass::Draw_It(bool complete) #endif bottom = (175*RESFACTOR)+1; - LogicPage->Fill_Rect(245*RESFACTOR, bottom-power_height, 245*RESFACTOR+1, bottom, color2); - LogicPage->Fill_Rect(246*RESFACTOR, bottom-power_height, 246*RESFACTOR+1, bottom, color1); + LogicPage->Fill_Rect(ScreenWidth - (640 - (245*RESFACTOR)), bottom-power_height, 245*RESFACTOR+1, bottom, color2); + LogicPage->Fill_Rect(ScreenWidth - (640 - (246*RESFACTOR)), bottom-power_height, 246*RESFACTOR+1, bottom, color1); } /* ** Draw the power drain threshold marker. */ - CC_Draw_Shape(PowerShape, 0, (POWER_X * RESFACTOR)+RESFACTOR, bottom - (drain_height + (2 * RESFACTOR)), WINDOW_MAIN, flags | SHAPE_NORMAL, remap); + CC_Draw_Shape(PowerShape, 0, ScreenWidth - (640 - (((POWER_X * RESFACTOR)) +RESFACTOR)), bottom - (drain_height + (2 * RESFACTOR)), WINDOW_MAIN, flags | SHAPE_NORMAL, remap); } LogicPage->Unlock(); }