SCI: adding shakeScreen() for gui32 for lsl6

svn-id: r47681
This commit is contained in:
Martin Kiewitz 2010-01-29 21:51:21 +00:00
parent 1bc1ff1705
commit c6e095715c
3 changed files with 20 additions and 1 deletions

View File

@ -1070,7 +1070,10 @@ reg_t kShakeScreen(EngineState *s, int argc, reg_t *argv) {
int16 shakeCount = (argc > 0) ? argv[0].toUint16() : 1;
int16 directions = (argc > 1) ? argv[1].toUint16() : 1;
s->_gui->shakeScreen(shakeCount, directions);
if (s->_gui)
s->_gui->shakeScreen(shakeCount, directions);
else
s->_gui32->shakeScreen(shakeCount, directions);
return s->r_acc;
}

View File

@ -75,6 +75,20 @@ void SciGui32::textSize(const char *text, int16 font, int16 maxWidth, int16 *tex
*textHeight = 0;
}
void SciGui32::shakeScreen(uint16 shakeCount, uint16 directions) {
while (shakeCount--) {
if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
_screen->setVerticalShakePos(10);
// TODO: horizontal shakes
g_system->updateScreen();
g_system->delayMillis(50);
if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
_screen->setVerticalShakePos(0);
g_system->updateScreen();
g_system->delayMillis(50);
}
}
uint16 SciGui32::onControl(byte screenMask, Common::Rect rect) {
Common::Rect adjustedRect = rect;
uint16 result;

View File

@ -46,6 +46,8 @@ public:
void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);
void shakeScreen(uint16 shakeCount, uint16 directions);
uint16 onControl(byte screenMask, Common::Rect rect);
void setNowSeen(reg_t objectReference);
bool canBeHere(reg_t curObject, reg_t listReference);