mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
added kWait event type
svn-id: r47808
This commit is contained in:
@@ -360,8 +360,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
|
||||
setOns(3, 0x59);
|
||||
//some moving animation is missing here
|
||||
moveTo(scene->getPosition().x, scene->getPosition().y + 1, 3);
|
||||
//wait
|
||||
wait(150);
|
||||
moveTo(scene->getPosition().x, scene->getPosition().y - 1, 2);
|
||||
wait(100);
|
||||
displayMessage(0x551f);
|
||||
enableObject(4);
|
||||
SET_FLAG(0xdbdc, 1);
|
||||
|
||||
@@ -532,7 +532,7 @@ int Scene::lookupZoom(uint y) const {
|
||||
}
|
||||
|
||||
|
||||
bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) {
|
||||
bool Scene::render(bool tick_game, bool tick_mark, uint32 delta) {
|
||||
Resources *res = Resources::instance();
|
||||
bool busy;
|
||||
bool restart;
|
||||
@@ -570,12 +570,12 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) {
|
||||
}
|
||||
|
||||
if (!message.empty() && message_timer != 0) {
|
||||
if (message_timer <= message_delta) {
|
||||
if (message_timer <= delta) {
|
||||
clearMessage();
|
||||
nextEvent();
|
||||
continue;
|
||||
} else
|
||||
message_timer -= message_delta;
|
||||
message_timer -= delta;
|
||||
}
|
||||
|
||||
if (current_event.type == SceneEvent::kCreditsMessage) {
|
||||
@@ -799,6 +799,17 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) {
|
||||
|
||||
_system->unlockScreen();
|
||||
|
||||
if (current_event.type == SceneEvent::kWait) {
|
||||
if (current_event.timer > delta) {
|
||||
busy = true;
|
||||
current_event.timer -= delta;
|
||||
}
|
||||
|
||||
if (current_event.timer <= delta)
|
||||
restart |= nextEvent();
|
||||
|
||||
}
|
||||
|
||||
if (!restart && current_event.type == SceneEvent::kWaitForAnimation && !got_any_animation) {
|
||||
debug(0, "no animations, nextevent");
|
||||
nextEvent();
|
||||
@@ -1048,6 +1059,10 @@ bool Scene::processEventQueue() {
|
||||
current_event.clear();
|
||||
break;
|
||||
|
||||
case SceneEvent::kWait:
|
||||
debug(0, "wait %u", current_event.timer);
|
||||
break;
|
||||
|
||||
case SceneEvent::kCredits:
|
||||
debug(0, "showing credits");
|
||||
break;
|
||||
|
||||
@@ -61,6 +61,7 @@ struct SceneEvent {
|
||||
kTimer,
|
||||
kEffect,
|
||||
kFade,
|
||||
kWait,
|
||||
kQuit
|
||||
} type;
|
||||
|
||||
|
||||
@@ -885,6 +885,12 @@ void TeenAgentEngine::fadeOut() {
|
||||
scene->push(event);
|
||||
}
|
||||
|
||||
void TeenAgentEngine::wait(uint16 frames) {
|
||||
SceneEvent event(SceneEvent::kWait);
|
||||
event.timer = frames * 10;
|
||||
scene->push(event);
|
||||
}
|
||||
|
||||
void TeenAgentEngine::playSoundNow(byte id) {
|
||||
Resources *res = Resources::instance();
|
||||
Common::SeekableReadStream *in = res->sam_sam.getStream(id);
|
||||
@@ -911,7 +917,6 @@ void TeenAgentEngine::setMusic(byte id) {
|
||||
music->start();
|
||||
}
|
||||
|
||||
|
||||
bool TeenAgentEngine::hasFeature(EngineFeature f) const {
|
||||
switch (f) {
|
||||
case kSupportsRTL:
|
||||
|
||||
@@ -112,6 +112,7 @@ public:
|
||||
void displayCredits();
|
||||
void fadeIn();
|
||||
void fadeOut();
|
||||
void wait(uint16 frames);
|
||||
|
||||
Common::RandomSource random;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user