diff options
author | Vladimir Menshakov | 2011-06-12 18:42:51 +0400 |
---|---|---|
committer | Alyssa Milburn | 2011-06-15 17:34:22 +0200 |
commit | 04ee3aefae8ced07e69f42490859b3408d2c8cd8 (patch) | |
tree | 0b80e5075ff061efca9cb748fc815bd2ec438ca9 /engines | |
parent | bd285645944861771f7a9f1b2ddc4778a60c50f7 (diff) | |
download | scummvm-rg350-04ee3aefae8ced07e69f42490859b3408d2c8cd8.tar.gz scummvm-rg350-04ee3aefae8ced07e69f42490859b3408d2c8cd8.tar.bz2 scummvm-rg350-04ee3aefae8ced07e69f42490859b3408d2c8cd8.zip |
DREAMWEB: implemented doshake
Diffstat (limited to 'engines')
-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; }; |