Removed the dependencies on utility.*pp

This commit is contained in:
Kayne Ruse
2015-01-17 21:46:12 +11:00
parent de6eb38516
commit 7356e8ae77
7 changed files with 18 additions and 95 deletions
+3 -2
View File
@@ -22,7 +22,6 @@
#include "in_world.hpp"
#include "channels.hpp"
#include "utility.hpp"
#include "terminal_error.hpp"
#include <stdexcept>
@@ -197,7 +196,9 @@ void InWorld::Render(SDL_Surface* const screen) {
//draw UI
disconnectButton.DrawTo(screen);
shutDownButton.DrawTo(screen);
font.DrawStringTo(to_string_custom(fps.GetFrameRate()), screen, 0, 0);
std::ostringstream msg;
msg << fps.GetFrameRate();
font.DrawStringTo(msg.str(), screen, 0, 0);
}
//-------------------------
+9 -4
View File
@@ -22,9 +22,9 @@
#include "lobby_menu.hpp"
#include "channels.hpp"
#include "utility.hpp"
#include <stdexcept>
#include <sstream>
//-------------------------
//Public access members
@@ -123,7 +123,9 @@ void LobbyMenu::Render(SDL_Surface* const screen) {
font.DrawStringTo(serverInfo[i].name, screen, listBox.x, listBox.y + i*listBox.h);
//draw the player count
font.DrawStringTo(to_string_custom(serverInfo[i].playerCount), screen, listBox.x + listBox.w, listBox.y + i*listBox.h);
std::ostringstream msg;
msg << serverInfo[i].playerCount;
font.DrawStringTo(msg.str(), screen, listBox.x + listBox.w, listBox.y + i*listBox.h);
//compatible?
if (!serverInfo[i].compatible) {
@@ -210,8 +212,11 @@ void LobbyMenu::HandlePacket(SerialPacket* const argPacket) {
break;
//handle errors
default:
throw(std::runtime_error(std::string() + "Unknown SerialPacketType encountered in LobbyMenu: " + to_string_custom(static_cast<int>(argPacket->type)) ));
default: {
std::ostringstream msg;
msg << "Unknown SerialPacketType encountered in LobbyMenu: " << static_cast<int>(argPacket->type);
throw(std::runtime_error( msg.str() ));
}
break;
}
}