Bladeren bron

Move FPS counter to bottom left, set width of black background to suffice for 3 digit FPS

Fixes #3171
Alexander Wilms 1 jaar geleden
bovenliggende
commit
c0c16fed75
1 gewijzigde bestanden met toevoegingen van 9 en 3 verwijderingen
  1. 9 3
      client/gui/CGuiHandler.cpp

+ 9 - 3
client/gui/CGuiHandler.cpp

@@ -183,11 +183,17 @@ Point CGuiHandler::screenDimensions() const
 
 void CGuiHandler::drawFPSCounter()
 {
-	static SDL_Rect overlay = { 0, 0, 24, 24};
+	int x = 7;
+	int y = screen->h-20;
+	int width3digitFPSIncludingPadding = 48;
+	int heightFPSTextIncludingPadding = 11;
+	static SDL_Rect overlay = { x, y, width3digitFPSIncludingPadding, heightFPSTextIncludingPadding};
 	uint32_t black = SDL_MapRGB(screen->format, 10, 10, 10);
 	SDL_FillRect(screen, &overlay, black);
-	std::string fps = std::to_string(framerate().getFramerate());
-	graphics->fonts[FONT_BIG]->renderTextLeft(screen, fps, Colors::YELLOW, Point(4, 2));
+
+	std::string fps = std::to_string(framerate().getFramerate())+" FPS";
+
+	graphics->fonts[FONT_SMALL]->renderTextLeft(screen, fps, Colors::WHITE, Point(8, screen->h-22));
 }
 
 bool CGuiHandler::amIGuiThread()