From 51657e10769faa2617d546a06c42e4c62a19bb50 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 30 Jan 2022 17:41:24 +0100 Subject: Removed trailing whitespace all over the place --- Stars45/HUDView.cpp | 92 ++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'Stars45/HUDView.cpp') diff --git a/Stars45/HUDView.cpp b/Stars45/HUDView.cpp index 9f1888d..3e87e01 100644 --- a/Stars45/HUDView.cpp +++ b/Stars45/HUDView.cpp @@ -265,7 +265,7 @@ enum TXT { static HUDText hud_text[TXT_LAST]; -void +void HUDView::DrawHUDText(int index, const char* txt, Rect& rect, int align, int upcase, bool box) { if (index < 0 || index >= TXT_LAST) @@ -303,15 +303,15 @@ HUDView::DrawHUDText(int index, const char* txt, Rect& rect, int align, int upca if (index <= TXT_LAST_ACTIVE) hc = Color::White; - + if (Mouse::LButton() && !mouse_latch) { mouse_latch = 2; mouse_index = index; } } - if (cockpit_hud_texture && - index >= TXT_HUD_MODE && + if (cockpit_hud_texture && + index >= TXT_HUD_MODE && index <= TXT_TARGET_ETA && ht.font != big_font) { @@ -893,8 +893,8 @@ HUDView::MarkerColor(Contact* contact) c = c * 0.5; } } - - return c; + + return c; } // +--------------------------------------------------------------------+ @@ -928,7 +928,7 @@ HUDView::DrawContactMarkers() DrawContact(c, index++); } - Color c = ship->MarkerColor(); + Color c = ship->MarkerColor(); // draw own ship track ladder: if (CameraDirector::GetCameraMode() == CameraDirector::MODE_ORBIT && ship->TrackLength() > 0) { @@ -956,7 +956,7 @@ HUDView::DrawContactMarkers() // clip: if (CameraDirector::GetCameraMode() == CameraDirector::MODE_ORBIT && mark_pt.z > 1.0) { projector->Project(mark_pt); - + int x = (int) mark_pt.x; int y = (int) mark_pt.y; @@ -1253,7 +1253,7 @@ HUDView::DrawTrack(Contact* contact) return; int ctl = contact->TrackLength(); - Color c = MarkerColor(contact); + Color c = MarkerColor(contact); Point t1 = contact->Location(); Point t2 = contact->TrackPoint(0); @@ -1283,13 +1283,13 @@ HUDView::DrawRect(SimObject* targ) c = ((Ship*) targ)->MarkerColor(); else c = ((Shot*) targ)->MarkerColor(); - + if (r.w > 0 && r.h > 0) { if (r.w < 8) { r.x -= (8-r.w)/2; r.w = 8; } - + if (r.h < 8) { r.y -= (8-r.h)/2; r.h = 8; @@ -1303,19 +1303,19 @@ HUDView::DrawRect(SimObject* targ) // clip: if (mark_pt.z < 1.0) return; - + projector->Project(mark_pt); - + int x = (int) mark_pt.x; int y = (int) mark_pt.y; - + if (x < 4 || x > width-4 || y < 4 || y > height-4) return; - + r.x = x-4; r.y = y-4; r.w = 8; - r.h = 8; + r.h = 8; } // horizontal @@ -1374,7 +1374,7 @@ HUDView::DrawBars() if (ship->Velocity() * ship->Heading() < 0) speed = -speed; - + FormatNumber(txt, speed); if (tactical) { @@ -1503,7 +1503,7 @@ HUDView::DrawBars() if (mode == HUD_MODE_NAV) { Instruction* next = ship->GetNextNavPoint(); - + if (next) { double distance = ship->RangeToNavPoint(next); FormatNumber(txt, distance); @@ -1916,8 +1916,8 @@ HUDView::DrawLCOS(SimObject* targ, double dist) projector->Project(tloc); // DRAW THE OFFSCREEN CHASE INDICATOR: - if (behind || - tloc.x <= 0 || tloc.x >= width-1 || + if (behind || + tloc.x <= 0 || tloc.x >= width-1 || tloc.y <= 0 || tloc.y >= height-1) { // Left side: @@ -1929,7 +1929,7 @@ HUDView::DrawLCOS(SimObject* targ, double dist) chase_sprite->SetAnimation(&chase_left); chase_sprite->MoveTo(Point(aw, tloc.y, 1)); } - + // Right side: else if (tloc.x >= width-1 || behind) { if (tloc.y < ah) tloc.y = ah; @@ -1949,7 +1949,7 @@ HUDView::DrawLCOS(SimObject* targ, double dist) chase_sprite->SetAnimation(&chase_top); chase_sprite->MoveTo(Point(tloc.x, ah, 1)); } - + // Bottom edge: else if (tloc.y >= height-1) { chase_sprite->Show(); @@ -2146,7 +2146,7 @@ HUDView::DrawTarget() switch (sys->Status()) { case System::DEGRADED: stat = Color(255,255, 0); break; - case System::CRITICAL: + case System::CRITICAL: case System::DESTROYED: stat = Color(255, 0, 0); break; case System::MAINT: if (blink_delta < 250) @@ -2198,8 +2198,8 @@ HUDView::DrawNavInfo() if (arcade) { if (ship->IsAutoNavEngaged()) { Rect info_rect(width/2-box_width, height/2+bar_height, box_width*2, 12); - - if (big_font) + + if (big_font) hud_text[TXT_NAV_INDEX].font = big_font; DrawHUDText(TXT_NAV_INDEX, Game::GetText("HUDView.Auto-Nav"), info_rect, DT_CENTER); @@ -2225,7 +2225,7 @@ HUDView::DrawNavInfo() double speed = ship->Velocity().length(); int etr = 0; char txt[256]; - + if (speed > 10) etr = (int) (distance/speed); @@ -2680,13 +2680,13 @@ HUDView::DrawWarningPanel() int x = box_left; int y = cockpit_hud_texture ? 410 : height-97; int c = cockpit_hud_texture ? 3 : 4; - + static DWORD blink = Game::RealTime(); for (int index = 0; index < 12; index++) { int stat = -1; Text abrv = Game::GetText("HUDView.UNKNOWN"); - + switch (index) { case 0: stat = GetReactorStatus(ship); abrv = Game::GetText("HUDView.REACTOR"); break; case 1: stat = GetDriveStatus(ship); abrv = Game::GetText("HUDView.DRIVE"); break; @@ -2736,18 +2736,18 @@ HUDView::DrawWarningPanel() } warn_rect.y += 4; - + hud_font->SetColor(tc); - hud_font->DrawText(abrv, -1, - warn_rect, - DT_CENTER | DT_SINGLELINE, + hud_font->DrawText(abrv, -1, + warn_rect, + DT_CENTER | DT_SINGLELINE, cockpit_hud_texture); - + warn_rect.y -= 4; } else { DrawHUDText(TXT_CAUTION_TXT + index, - abrv, + abrv, warn_rect, DT_CENTER); @@ -2768,7 +2768,7 @@ HUDView::DrawWarningPanel() blink = Game::RealTime(); // reset for next time - SetStatusColor(System::NOMINAL); + SetStatusColor(System::NOMINAL); } } @@ -3200,8 +3200,8 @@ HUDView::DrawNavPoint(Instruction& navpt, int index, int next) projector->Project(tloc); // DRAW THE OFFSCREEN CHASE INDICATOR: - if (behind || - tloc.x <= 0 || tloc.x >= width-1 || + if (behind || + tloc.x <= 0 || tloc.x >= width-1 || tloc.y <= 0 || tloc.y >= height-1) { // Left side: @@ -3233,7 +3233,7 @@ HUDView::DrawNavPoint(Instruction& navpt, int index, int next) chase_sprite->SetAnimation(&chase_top); chase_sprite->MoveTo(Point(tloc.x, ah, 1)); } - + // Bottom edge: else if (tloc.y >= height-1) { chase_sprite->Show(); @@ -3566,7 +3566,7 @@ HUDView::Refresh() else SetTacticalMode(!cockpit_hud_texture); - sim->ShowGrid(tactical && + sim->ShowGrid(tactical && !ship->IsAirborne() && CameraDirector::GetCameraMode() != CameraDirector::MODE_VIRTUAL); @@ -3591,7 +3591,7 @@ HUDView::Refresh() DrawNav(); DrawILS(); - + // FOR DEBUG PURPOSES ONLY: // DrawObjective(); @@ -3696,8 +3696,8 @@ HUDView::DrawOrbitalBody(OrbitalBody* body) r = projector->ProjectRadius(p, r); projector->Project(p, false); - window->DrawEllipse((int) (p.x-r), - (int) (p.y-r), + window->DrawEllipse((int) (p.x-r), + (int) (p.y-r), (int) (p.x+r), (int) (p.y+r), Color::Cyan); @@ -4146,7 +4146,7 @@ HUDView::Message(const char* fmt, ...) // +--------------------------------------------------------------------+ -void +void HUDView::ClearMessages() { if (hud_view) { @@ -4159,7 +4159,7 @@ HUDView::ClearMessages() // +--------------------------------------------------------------------+ -void +void HUDView::PrepareBitmap(const char* name, Bitmap& img, BYTE*& shades) { delete [] shades; @@ -4184,7 +4184,7 @@ HUDView::PrepareBitmap(const char* name, Bitmap& img, BYTE*& shades) shades[y*w+x] = (BYTE) (img.GetColor(x,y).Red() * 0.66); } -void +void HUDView::TransferBitmap(const Bitmap& src, Bitmap& img, BYTE*& shades) { delete [] shades; @@ -4206,7 +4206,7 @@ HUDView::TransferBitmap(const Bitmap& src, Bitmap& img, BYTE*& shades) shades[y*w+x] = (BYTE) (img.GetColor(x,y).Red() * 0.5); } -void +void HUDView::ColorizeBitmap(Bitmap& img, BYTE* shades, Color color, bool force_alpha) { if (!shades) return; -- cgit v1.1