[Scummvm-cvs-logs] SF.net SVN: scummvm:[46899] scummvm/trunk/engines/teenagent
megath at users.sourceforge.net
megath at users.sourceforge.net
Sat Jan 2 22:21:33 CET 2010
Revision: 46899
http://scummvm.svn.sourceforge.net/scummvm/?rev=46899&view=rev
Author: megath
Date: 2010-01-02 21:21:32 +0000 (Sat, 02 Jan 2010)
Log Message:
-----------
made fadein/out asynchronous, added fade type stub
Modified Paths:
--------------
scummvm/trunk/engines/teenagent/scene.cpp
scummvm/trunk/engines/teenagent/scene.h
Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp 2010-01-02 20:44:47 UTC (rev 46898)
+++ scummvm/trunk/engines/teenagent/scene.cpp 2010-01-02 21:21:32 UTC (rev 46899)
@@ -192,6 +192,9 @@
void Scene::init(TeenAgentEngine *engine, OSystem *system) {
_engine = engine;
_system = system;
+
+ _fade_timer = 0;
+ _fade_type = 0;
memset(palette, 0, sizeof(palette));
@@ -534,6 +537,17 @@
restart = false;
busy = processEventQueue();
+ if (_fade_timer) {
+ debug(0, "fade timer = %d, type = %d", _fade_timer, _fade_type);
+ if (_fade_timer > 0) {
+ --_fade_timer;
+ setPalette(_fade_timer);
+ } else {
+ ++_fade_timer;
+ setPalette(_fade_timer + 4);
+ }
+ }
+
switch(current_event.type) {
case SceneEvent::kCredits: {
system->fillScreen(0);
@@ -546,15 +560,6 @@
current_event.clear();
}
return true;
- case SceneEvent::kFade:
- //debug(0, "fade timer = %d", current_event.timer);
- setPalette(current_event.orientation? 4 - current_event.timer: current_event.timer);
- ++current_event.timer;
- if (current_event.timer > 4) {
- nextEvent();
- continue;
- } else
- busy |= true;
default:
;
}
@@ -999,6 +1004,20 @@
break;
case SceneEvent::kFade:
+ _fade_timer = current_event.orientation != 0? 5: -5;
+ _fade_type = 0;
+ if (_id > 0) {
+ Common::Array<FadeType> &scene_fades = fades[_id - 1];
+ for(uint i = 0; i < scene_fades.size(); ++i) {
+ const FadeType &fade = scene_fades[i];
+ if (fade.rect.in(position)) {
+ debug(0, "found fade type %u", fade.value);
+ _fade_type = fade.value;
+ break;
+ }
+ }
+ }
+ current_event.clear();
break;
case SceneEvent::kCredits:
Modified: scummvm/trunk/engines/teenagent/scene.h
===================================================================
--- scummvm/trunk/engines/teenagent/scene.h 2010-01-02 20:44:47 UTC (rev 46898)
+++ scummvm/trunk/engines/teenagent/scene.h 2010-01-02 21:21:32 UTC (rev 46899)
@@ -217,6 +217,9 @@
bool hide_actor;
uint16 callback, callback_timer;
+
+ int _fade_timer;
+ int _fade_type;
struct Sound {
byte id, delay;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list