ASYLUM: Implement cursor animation

git-svn-id: http://asylumengine.googlecode.com/svn/trunk@635 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
Julien Templier 2010-12-02 15:18:56 +00:00 committed by Eugene Sandulenko
parent 9b4c9572ea
commit 7877692768
No known key found for this signature in database
GPG key ID: 014D387312D34F08
9 changed files with 191 additions and 154 deletions

View file

@ -167,7 +167,7 @@ void AsylumEngine::startGame(ResourcePackId sceneId, StartGameType type) {
error("[AsylumEngine::startGame] Subsystems not initialized properly!");
// Load the default mouse cursor
_cursor->set(MAKE_RESOURCE(kResourcePackSound, 14));
_cursor->set(MAKE_RESOURCE(kResourcePackSound, 14), 0, kCursorAnimationNone);
_cursor->hide();
// Clear the graphic list
@ -314,6 +314,9 @@ void AsylumEngine::handleEvents() {
}
}
// Animate cursor
_cursor->animate();
// Send update event to our event handler
AsylumEvent updateEvt = AsylumEvent(EVENT_ASYLUM_UPDATE);
_handler->handleEvent(updateEvt);
@ -373,6 +376,14 @@ void AsylumEngine::switchEventHandler(EventHandler *handler) {
_handler->handleEvent(init);
}
void AsylumEngine::notify(AsylumEventType type) {
if (_handler == NULL)
error("[AsylumEngine::notify] Invalid handler parameter (cannot be NULL)!");
AsylumEvent evt(type);
_handler->handleEvent(evt);
}
EventHandler *AsylumEngine::getPuzzle(uint32 index) {
if (index >= ARRAYSIZE(_puzzles))
error("[AsylumEngine::getPuzzleEventHandler] Invalid index (was: %d - max: %d)", index, ARRAYSIZE(_puzzles));