music("NightFusion"),
punchSound("RobotPunch")
{
- Mf::Dispatcher::getInstance().addHandler("video.context_recreated",
+ Mf::dispatcher::addHandler("video.context_recreated",
boost::bind(&YoinkApp::contextRecreated, this, _1), this);
setupGL();
state = 0.0;
- heroine = CharacterPtr(new Character("RobotTrooper"));
+ heroine = Character::alloc("RobotTrooper");
heroine->getAnimation().startSequence("Run");
font = new TilemapFont;
delete font;
delete testScene;
- Mf::Dispatcher::getInstance().removeHandler(this);
+ Mf::dispatcher::removeHandler(this);
}
//heroine->draw(alpha);
+ heroine->getAabb().draw();
hud.draw();
}
else if (event.key.keysym.sym == SDLK_t)
{
- Mf::Dispatcher::getInstance().dispatch("video.context_recreated");
+ Mf::dispatcher::dispatch("video.context_recreated");
break;
}
else if (event.key.keysym.sym == SDLK_p)
int status = 0;
-//start:
try
{
YoinkApp app(argc, argv);
status = app.run();
}
- //catch (Mf::Texture::Exception e)
- //{
- //std::cout << "Unhandled exception: " << e.what() << std::endl;
- //status = 1;
- //}
catch (Mf::Exception e)
{
- //std::cout << "Unhandled exception: " << e.what() << std::endl;
Mf::logError("unhandled exception: <<%s>>", e.what());
- Mf::logInfo("it's time to crash now ;-(");
+ Mf::logInfo("it's time to crash now :-(");
status = 1;
-
- //std::cout << "Yoink stopped. Do you want to run it again? [yes/No]"
- //<< std::endl;
-
- //char answer;
- //std::cin >> answer;
-
- //if (answer == 'y' || answer == 'Y') goto start;
}
std::cout << std::endl << "Goodbye..." << std::endl << std::endl;