Hunting a strange networking bug

This commit is contained in:
Kayne Ruse
2015-04-26 02:14:26 +10:00
parent 9d5a668045
commit 7aeabf0d14
5 changed files with 53 additions and 4 deletions
+6 -1
View File
@@ -152,7 +152,7 @@ void World::FrameEnd() {
}
void World::RenderFrame() {
// SDL_FillRect(GetScreen(), 0, 0);
SDL_FillRect(GetScreen(), 0, 0);
Render(GetScreen());
SDL_Flip(GetScreen());
fps.Calculate();
@@ -162,6 +162,11 @@ void World::Render(SDL_Surface* const screen) {
//draw the map
for (std::list<Region>::iterator it = regionPager.GetContainer()->begin(); it != regionPager.GetContainer()->end(); it++) {
tileSheet.DrawRegionTo(screen, &(*it), camera.x, camera.y);
//debugging
std::ostringstream msg;
msg << it->GetX() << ", " << it->GetY();
font.DrawStringTo(msg.str(), screen, it->GetX() * tileSheet.GetImage()->GetClipW() - camera.x, it->GetY() * tileSheet.GetImage()->GetClipH() - camera.y);
}
//draw the entities