Power bar draws on the sidebar correctly.

This commit is contained in:
Justin Marshall
2020-06-03 19:35:45 -07:00
parent f191e78139
commit be480a28a9
+7 -7
View File
@@ -135,7 +135,7 @@ void PowerClass::Init_Clear(void)
void PowerClass::One_Time(void) void PowerClass::One_Time(void)
{ {
RadarClass::One_Time(); RadarClass::One_Time();
PowerButton.X = POWER_X * RESFACTOR; PowerButton.X = ScreenWidth - (640 - (POWER_X * RESFACTOR));
PowerButton.Y = POWER_Y * RESFACTOR; PowerButton.Y = POWER_Y * RESFACTOR;
PowerButton.Width = (POWER_WIDTH * RESFACTOR)-1; PowerButton.Width = (POWER_WIDTH * RESFACTOR)-1;
PowerButton.Height = POWER_HEIGHT * RESFACTOR; 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 0, -1, 0, 1, 0, -1, -2, -1, 0, 1, 2, 1 ,0
}; };
if (complete || IsToRedraw) { {
BStart(BENCH_POWER); BStart(BENCH_POWER);
if (LogicPage->Lock()) { 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); // 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 #ifdef WIN32
/* /*
** Hires power strip is too big to fit into a shape so it is in two parts ** 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 #endif
/* /*
** Determine how much the power production exceeds or falls short ** Determine how much the power production exceeds or falls short
@@ -228,14 +228,14 @@ void PowerClass::Draw_It(bool complete)
#endif #endif
bottom = (175*RESFACTOR)+1; bottom = (175*RESFACTOR)+1;
LogicPage->Fill_Rect(245*RESFACTOR, bottom-power_height, 245*RESFACTOR+1, bottom, color2); LogicPage->Fill_Rect(ScreenWidth - (640 - (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 - (246*RESFACTOR)), bottom-power_height, 246*RESFACTOR+1, bottom, color1);
} }
/* /*
** Draw the power drain threshold marker. ** 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(); LogicPage->Unlock();
} }