Minor code tweaks
This commit is contained in:
@@ -82,20 +82,13 @@ CleanUp::~CleanUp() {
|
||||
|
||||
void CleanUp::Update(double delta) {
|
||||
if (std::chrono::steady_clock::now() - startTick > std::chrono::duration<int>(10)) {
|
||||
QuitEvent();
|
||||
SetNextScene(SceneList::MAINMENU);
|
||||
}
|
||||
|
||||
//BUGFIX: Eat incoming packets
|
||||
while(network.Receive());
|
||||
}
|
||||
|
||||
void CleanUp::RenderFrame() {
|
||||
SDL_FillRect(GetScreen(), 0, 0);
|
||||
Render(GetScreen());
|
||||
SDL_Flip(GetScreen());
|
||||
fps.Calculate();
|
||||
}
|
||||
|
||||
void CleanUp::Render(SDL_Surface* const screen) {
|
||||
backButton.DrawTo(screen);
|
||||
font.DrawStringTo("You have been disconnected.", screen, 50, 30);
|
||||
|
||||
@@ -30,12 +30,8 @@
|
||||
#include "raster_font.hpp"
|
||||
#include "button.hpp"
|
||||
|
||||
//common
|
||||
#include "frame_rate.hpp"
|
||||
|
||||
#include "character.hpp"
|
||||
|
||||
//client
|
||||
#include "character.hpp"
|
||||
#include "base_scene.hpp"
|
||||
|
||||
//std namespace
|
||||
@@ -55,7 +51,6 @@ public:
|
||||
protected:
|
||||
//Frame loop
|
||||
void Update(double delta);
|
||||
void RenderFrame();
|
||||
void Render(SDL_Surface* const);
|
||||
|
||||
//Event handlers
|
||||
@@ -79,7 +74,6 @@ protected:
|
||||
|
||||
//UI
|
||||
Button backButton;
|
||||
FrameRate fps;
|
||||
|
||||
//auto return
|
||||
std::chrono::steady_clock::time_point startTick;
|
||||
|
||||
Reference in New Issue
Block a user