Started working on the room system

This commit is contained in:
Kayne Ruse
2013-08-11 20:39:08 +10:00
commit 0a0b61287e
9 changed files with 217 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#include "threading.hpp"
#include <stdexcept>
#include <iostream>
int roomThread(void* ptr) {
#ifdef DEBUG
std::cout << "Opening room" << std::endl;
#endif
try {
reinterpret_cast<Room*>(ptr)->Init();
reinterpret_cast<Room*>(ptr)->Loop();
reinterpret_cast<Room*>(ptr)->Quit();
}
catch(std::exception& e) {
std::cerr << "Fatal room error: " << e.what() << std::endl;
return 1;
}
#ifdef DEBUG
std::cout << "Closing room" << std::endl;
#endif
return 0;
}