Merged the new frame rate system into dev-char

This commit is contained in:
Kayne Ruse
2013-06-23 15:11:24 +10:00
4 changed files with 34 additions and 27 deletions
+8 -1
View File
@@ -34,6 +34,7 @@ InWorld::InWorld() {
cout << "entering InWorld" << endl;
#endif
cout << "Client Index: " << infoMgr->GetClientIndex() << endl;
font.SetSurface(surfaceMgr->Get("font"));
pc.GetSprite()->SetSurface(surfaceMgr->Get("elliot"), 32, 48);
}
@@ -61,7 +62,13 @@ void InWorld::FrameEnd() {
}
void InWorld::Render(SDL_Surface* const screen) {
ClockFrameRate();
pc.DrawTo(screen);
//since we're using this twice, make a tmp var
string fps = itos(GetFrameRate());
font.DrawStringTo(fps, screen, screen->w - fps.size() * font.GetCharW(), 0);
}
//-------------------------
@@ -198,4 +205,4 @@ void InWorld::HandleDisconnection(::Disconnect& disconnect) {
Disconnect();
SetNextScene(SceneList::MAINMENU);
cout << "You have been disconnected" << endl;
}
}