git repos / blockattack-game

commit 9feb24fa

sago007 · 2018-03-31 17:42
9feb24fa904185499810df4b6681ef6c4bbe0cd8 patch · browse files
parent 1ee3769b4e3ec5914e7c4845cffcdb2bae8d8f66

Replaced fps counter

Changed files

M source/code/main.cpp before
M source/code/replayhandler.cpp before
diff --git a/source/code/main.cpp b/source/code/main.cpp index 20f4dd3..cd61d12 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -644,6 +644,8 @@ void DrawEverything(int xsize, int ysize,BlockGameSdl* theGame, BlockGameSdl* th
DrawBalls();
#if DEBUG
+ static sago::SagoTextField fpsField;
+ sagoTextSetBlueFont(fpsField);
Frames++;
if (SDL_GetTicks() >= Ticks + 1000) {
if (Frames > 999) {
@@ -653,8 +655,8 @@ void DrawEverything(int xsize, int ysize,BlockGameSdl* theGame, BlockGameSdl* th
Frames = 0;
Ticks = SDL_GetTicks();
}
-
- globalData.standard_blue_font.draw(globalData.screen, 800, 4, FPS);
+ fpsField.SetText(FPS);
+ fpsField.Draw(globalData.screen, 800, 4);
#endif
}
diff --git a/source/code/replayhandler.cpp b/source/code/replayhandler.cpp index e213f35..d67e16d 100644 --- a/source/code/replayhandler.cpp +++ b/source/code/replayhandler.cpp
@@ -33,10 +33,9 @@ static std::tm GetLocalTime() {
}
static std::string CreateFileName(const std::tm& t ) {
- std::string ret = "replays/blockattack_game_";
char buffer[200];
snprintf(buffer, sizeof(buffer), "replays/blockattack_game_%i-%02i-%02iT%02i_%02i_%02i_AUTO.replay", t.tm_year+1900, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec);
- ret = buffer;
+ std::string ret = buffer;
return ret;
}