mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
SCI: adding shakeScreen() for gui32 for lsl6
svn-id: r47681
This commit is contained in:
parent
1bc1ff1705
commit
c6e095715c
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user