diff options
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 27 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.h | 10 |
2 files changed, 32 insertions, 5 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0b8146a44d..60462dc463 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -683,7 +683,32 @@ void fadedos(Context &context) { } void doshake(Context &context) { - //warning("doshake: STUB"); + uint8 &counter = context.data.byte(kShakecounter); + context._cmp(counter, 48); + if (context.flags.z()) + return; + + context._add(counter, 1); + static const int shakeTable[] = { + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 0, + }; + context.engine->setShakePos(shakeTable[counter]); } void vsync(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index c0bd9d9d63..8cd489cc7e 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -85,16 +85,18 @@ public: void fadeDos(); void blit(const uint8 *src, int pitch, int x, int y, int w, int h); void cls(); - + void getPalette(uint8 *data, uint start, uint count); void setPalette(const uint8 *data, uint start, uint count); - + void openSaveFileForWriting(const Common::String &name); uint writeToSaveFile(const uint8 *data, uint size); bool openSaveFileForReading(const Common::String &name); uint readFromSaveFile(uint8 *data, uint size); + void setShakePos(int pos) { _system->setShakePos(pos); } + private: void keyPressed(uint16 ascii); @@ -103,11 +105,11 @@ private: Common::RandomSource _rnd; Common::Point _mouse; unsigned _mouseState; - + Common::File _file; Common::OutSaveFile *_outSaveFile; Common::InSaveFile *_inSaveFile; - + dreamgen::Context _context; }; |