X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FYoinkApp.cc;h=7ec807bdb22de89f4c3a7d461e12b38063afec8d;hp=626fe1aea9ab18e823c49635573a19dad9dfac8c;hb=3cba2347188d70f5ee6e401774b8f86acfd1a3b9;hpb=a5f0d391406a68275b41448fc3f49e8d8396c497 diff --git a/src/YoinkApp.cc b/src/YoinkApp.cc index 626fe1a..7ec807b 100644 --- a/src/YoinkApp.cc +++ b/src/YoinkApp.cc @@ -32,6 +32,8 @@ #include +#include +#include #include #include #include @@ -117,7 +119,7 @@ YoinkApp::YoinkApp(int argc, char* argv[]) : state = 0.0; - heroine = CharacterPtr(new Character("RobotTrooper")); + heroine = Character::alloc("RobotTrooper"); heroine->getAnimation().startSequence("Run"); font = new TilemapFont; @@ -138,7 +140,6 @@ YoinkApp::YoinkApp(int argc, char* argv[]) : YoinkApp::~YoinkApp() { - std::cerr << "yoinkapp destructor" << std::endl; //delete heroine; delete font; delete testScene; @@ -241,6 +242,7 @@ void YoinkApp::draw(Mf::Scalar alpha) //heroine->draw(alpha); + heroine->getAabb().draw(); hud.draw(); @@ -457,26 +459,30 @@ void YoinkApp::handleEvent(const Mf::Event& event) int main(int argc, char* argv[]) { - std::cout << PACKAGE_STRING << std::endl + std::cout << std::endl << PACKAGE_STRING << std::endl << "Compiled " << __TIME__ " " __DATE__ << std::endl << "Send patches and bug reports to <" PACKAGE_BUGREPORT << ">." << std::endl << std::endl; +#if ! NDEBUG + Mf::setLogLevel(Mf::DEBUGGING); +#endif + int status = 0; try { - YoinkApp* app = new YoinkApp(argc, argv); - status = app->run(); - delete app; + YoinkApp app(argc, argv); + status = app.run(); } - catch (Mf::Engine::Exception e) + catch (Mf::Exception e) { - std::cerr << "Unhandled exception: " << e.what() << std::endl; + Mf::logError("unhandled exception: <<%s>>", e.what()); + Mf::logInfo("it's time to crash now :-("); status = 1; } - std::cout << "Goodbye..." << std::endl; + std::cout << std::endl << "Goodbye..." << std::endl << std::endl; return status; }