ASYLUM: Implement parts of Fisherman puzzle

git-svn-id: http://asylumengine.googlecode.com/svn/trunk@723 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
Julien Templier 2010-12-13 02:23:44 +00:00 committed by Eugene Sandulenko
parent 2ec06b5da7
commit ec57d4bca7
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
3 changed files with 96 additions and 2 deletions

View File

@ -25,27 +25,108 @@
#include "asylum/puzzles/fisherman.h"
#include "asylum/resources/worldstats.h"
#include "asylum/system/cursor.h"
#include "asylum/system/screen.h"
#include "asylum/views/scene.h"
#include "asylum/asylum.h"
namespace Asylum {
PuzzleFisherman::PuzzleFisherman(AsylumEngine *engine) : Puzzle(engine) {
memset(&_state, 0, sizeof(_state));
_dword_45AAD4 = false;
_counter = 0;
_dword_45A130 = false;
}
PuzzleFisherman::~PuzzleFisherman() {
}
//////////////////////////////////////////////////////////////////////////
// Reset
//////////////////////////////////////////////////////////////////////////
void PuzzleFisherman::reset() {
memset(&_state, 0, sizeof(_state));
_dword_45AAD4 = false;
// Original setups polygons here
_dword_45A130 = false;
_counter = 0;
// TODO update scene fields
}
//////////////////////////////////////////////////////////////////////////
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool PuzzleFisherman::init() {
error("[PuzzleFisherman::init] Not implemented!");
getCursor()->set(getWorld()->graphicResourceIds[47], -1, kCursorAnimationMirror, 7);
for (uint32 i = 0; i < ARRAYSIZE(_state); i++)
if (_vm->isGameFlagNotSet((GameFlag)(kGameFlag801 + i)))
_state[i] = 0;
if (_counter == 6) {
_vm->clearGameFlag(kGameFlag619);
_counter = 0;
}
_dword_45A130 = false;
getScreen()->setPalette(getWorld()->graphicResourceIds[39]);
getScreen()->setGammaLevel(getWorld()->graphicResourceIds[39], 0);
return mouseDown();
}
bool PuzzleFisherman::update() {
error("[PuzzleFisherman::update] Not implemented!");
}
bool PuzzleFisherman::key(const AsylumEvent &evt) {
switch (evt.kbd.keycode) {
default:
_vm->switchEventHandler(getScene());
break;
case Common::KEYCODE_TAB:
getScreen()->takeScreenshot();
break;
}
return false;
}
bool PuzzleFisherman::mouse(const AsylumEvent &evt) {
error("[PuzzleFisherman::mouse] Not implemented!");
switch (evt.type) {
case Common::EVENT_LBUTTONDOWN:
return mouseDown();
break;
case Common::EVENT_RBUTTONDOWN:
getCursor()->hide();
getSharedData()->setFlag(kFlag1, true);
getScreen()->setupPaletteAndStartFade(0, 0, 0);
_vm->switchEventHandler(getScene());
break;
}
return false;
}
bool PuzzleFisherman::mouseDown() {
if (!_dword_45A130)
return false;
error("[PuzzleFisherman::mouseDown] Not implemented!");
}
} // End of namespace Asylum

View File

@ -37,13 +37,24 @@ public:
PuzzleFisherman(AsylumEngine *engine);
~PuzzleFisherman();
void reset();
private:
uint32 _state[6];
int32 _counter;
bool _dword_45A130;
bool _dword_45AAD4;
//////////////////////////////////////////////////////////////////////////
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init();
bool update();
bool key(const AsylumEvent &evt);
bool mouse(const AsylumEvent &evt);
bool mouseDown();
};
} // End of namespace Asylum

View File

@ -100,10 +100,12 @@ enum GameFlag {
kGameFlag556 = 556,
kGameFlag560 = 560,
kGameFlag570 = 570,
kGameFlag619 = 619,
kGameFlag635 = 635,
kGameFlag636 = 636,
kGameFlag637 = 637,
kGameFlag776 = 776,
kGameFlag801 = 801,
kGameFlag815 = 815,
kGameFlag816 = 816,
kGameFlag817 = 817,