SCI: calling wait() directly and removing it from SciGui

svn-id: r49853
This commit is contained in:
Martin Kiewitz 2010-06-15 13:14:23 +00:00
parent a21b9c7b96
commit af5346e7ab
5 changed files with 7 additions and 21 deletions

View file

@ -91,8 +91,4 @@ void SciGui::init(bool usesOldGfxFunctions) {
_paint16->init(_animate, _text16); _paint16->init(_animate, _text16);
} }
void SciGui::wait(int16 ticks) {
_s->wait(ticks);
}
} // End of namespace Sci } // End of namespace Sci

View file

@ -51,8 +51,6 @@ public:
virtual void init(bool usesOldGfxFunctions); virtual void init(bool usesOldGfxFunctions);
virtual void wait(int16 ticks);
protected: protected:
GfxCursor *_cursor; GfxCursor *_cursor;
EngineState *_s; EngineState *_s;

View file

@ -562,22 +562,14 @@ void GfxPaint16::kernelShakeScreen(uint16 shakeCount, uint16 directions) {
if (directions & SCI_SHAKE_DIRECTION_VERTICAL) if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
_screen->setVerticalShakePos(10); _screen->setVerticalShakePos(10);
// TODO: horizontal shakes // TODO: horizontal shakes
g_system->updateScreen();
g_sci->getEngineState()->wait(3);
if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) {
g_system->updateScreen();
g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis();
}
_gui->wait(3);
if (directions & SCI_SHAKE_DIRECTION_VERTICAL) if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
_screen->setVerticalShakePos(0); _screen->setVerticalShakePos(0);
if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { g_system->updateScreen();
g_system->updateScreen(); g_sci->getEngineState()->wait(3);
g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis();
}
_gui->wait(3);
} }
} }

View file

@ -182,7 +182,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
// Wait till syncTime passed, then show specific animation bitmap // Wait till syncTime passed, then show specific animation bitmap
do { do {
_gui->wait(1); g_sci->getEngineState()->wait(1);
curEvent = _event->get(SCI_EVENT_ANY); curEvent = _event->get(SCI_EVENT_ANY);
if (curEvent.type == SCI_EVENT_MOUSE_PRESS || if (curEvent.type == SCI_EVENT_MOUSE_PRESS ||
(curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) || (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) ||

View file

@ -291,7 +291,7 @@ void GfxTransitions::fadeOut() {
workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2] * stepNr / 100; workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2] * stepNr / 100;
} }
g_system->setPalette(workPalette + 4, 1, 254); g_system->setPalette(workPalette + 4, 1, 254);
_gui->wait(2); g_sci->getEngineState()->wait(2);
} }
} }
@ -301,7 +301,7 @@ void GfxTransitions::fadeIn() {
for (stepNr = 0; stepNr <= 100; stepNr += 10) { for (stepNr = 0; stepNr <= 100; stepNr += 10) {
_palette->kernelSetIntensity(1, 255, stepNr, true); _palette->kernelSetIntensity(1, 255, stepNr, true);
_gui->wait(2); g_sci->getEngineState()->wait(2);
} }
} }