Merged the new frame rate system into dev-char
This commit is contained in:
+8
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -35,6 +35,7 @@
|
||||
#include "udp_network_utility.hpp"
|
||||
#include "button.hpp"
|
||||
#include "raster_font.hpp"
|
||||
#include "frame_rate.hpp"
|
||||
|
||||
//debugging
|
||||
#include "player_character.hpp"
|
||||
@@ -73,7 +74,8 @@ protected:
|
||||
InformationManager* infoMgr = ServiceLocator<InformationManager>::Get();
|
||||
|
||||
//members
|
||||
RasterFont font;
|
||||
PlayerCharacter pc;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user