aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-13 21:18:47 +0000
committerMartin Kiewitz2009-10-13 21:18:47 +0000
commit724e7a873ae3342fab34f247b7a4647736491563 (patch)
treec21159eaf93a77dd0c1e20ae307a1f65b3495e85 /engines
parent4201515d23d1ac96355778285f5ac8f1c9d663e2 (diff)
downloadscummvm-rg350-724e7a873ae3342fab34f247b7a4647736491563.tar.gz
scummvm-rg350-724e7a873ae3342fab34f247b7a4647736491563.tar.bz2
scummvm-rg350-724e7a873ae3342fab34f247b7a4647736491563.zip
SCI/newgui: class SciGuiTransitions created
svn-id: r45051
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui.cpp10
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui/gui_animate.cpp1
-rw-r--r--engines/sci/gui/gui_animate.h4
-rw-r--r--engines/sci/gui/gui_gfx.cpp8
-rw-r--r--engines/sci/gui/gui_gfx.h2
-rw-r--r--engines/sci/gui/gui_transitions.cpp62
-rw-r--r--engines/sci/gui/gui_transitions.h53
-rw-r--r--engines/sci/module.mk1
9 files changed, 128 insertions, 15 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 0848ba9b81..8473d3fafb 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -37,6 +37,7 @@
#include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_windowmgr.h"
#include "sci/gui/gui_animate.h"
+#include "sci/gui/gui_transitions.h"
#include "sci/gui/gui_view.h"
#include "sci/gfx/operations.h"
@@ -54,6 +55,7 @@ SciGui::SciGui(EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette,
: _s(state), _screen(screen), _palette(palette), _cursor(cursor) {
_gfx = new SciGuiGfx(_s, _screen, _palette);
+ _transitions = new SciGuiTransitions(_screen, _palette);
_animate = new SciGuiAnimate(_s, _gfx, _screen, _palette);
_windowMgr = new SciGuiWindowMgr(_screen, _gfx, _animate);
// _gui32 = new SciGui32(_s, _screen, _palette, _cursor); // for debug purposes
@@ -303,6 +305,7 @@ void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirror
if (_windowMgr->isFrontWindow(_windowMgr->_picWind)) {
_gfx->drawPicture(pictureId, animationNr, mirroredFlag, addToFlag, EGApaletteNo);
+ _transitions->setup(animationNr);
_screen->_picNotValid = 1;
} else {
_windowMgr->BeginUpdate(_windowMgr->_picWind);
@@ -507,7 +510,7 @@ void SciGui::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) {
if (listReference.isNull()) {
_animate->disposeLastCast();
if (_screen->_picNotValid)
- _gfx->ShowPic();
+ _transitions->doit();
return;
}
@@ -532,9 +535,8 @@ void SciGui::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) {
_animate->drawCels();
- if (_screen->_picNotValid) {
- _gfx->ShowPic();
- }
+ if (_screen->_picNotValid)
+ _transitions->doit();
_animate->updateScreen(old_picNotValid);
_animate->restoreAndDelete(argc, argv);
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index bcc0060e8e..f171cfde72 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -47,6 +47,7 @@ class SciGuiCursor;
class SciGuiGfx;
class SciGuiresources;
class SciGuiWindowMgr;
+class SciGuiTransitions;
class SciGuiAnimate;
class SciGui32; // for debug purposes
@@ -138,6 +139,7 @@ private:
SciGuiGfx *_gfx;
SciGuiresources *_resources;
SciGuiWindowMgr *_windowMgr;
+ SciGuiTransitions *_transitions;
SciGuiAnimate *_animate;
// SciGui32 *_gui32; // for debug purposes
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp
index 77d06c0372..a06f652c74 100644
--- a/engines/sci/gui/gui_animate.cpp
+++ b/engines/sci/gui/gui_animate.cpp
@@ -33,6 +33,7 @@
#include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_view.h"
#include "sci/gui/gui_screen.h"
+#include "sci/gui/gui_transitions.h"
#include "sci/gui/gui_animate.h"
namespace Sci {
diff --git a/engines/sci/gui/gui_animate.h b/engines/sci/gui/gui_animate.h
index d46745f4b2..6db19db22a 100644
--- a/engines/sci/gui/gui_animate.h
+++ b/engines/sci/gui/gui_animate.h
@@ -44,8 +44,10 @@ enum {
SCI_ANIMATE_SIGNAL_DISPOSEME = 0x8000
};
+class SciGuiGfx;
class SciGuiScreen;
-class SciGuiView;
+class SciGuiPalette;
+class SciGuiTransitions;
class SciGuiAnimate {
public:
SciGuiAnimate(EngineState *state, SciGuiGfx *gfx, SciGuiScreen *screen, SciGuiPalette *palette);
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 6ada26bc22..6b53481339 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -972,14 +972,6 @@ int16 SciGuiGfx::PriorityToCoordinate(byte priority) {
return _priorityBottom;
}
-void SciGuiGfx::ShowPic() {
- // TODO: Implement animations
- warning("ShowPic animation not implemented");
- _palette->setOnScreen();
- _screen->copyToScreen();
- _screen->_picNotValid = 0;
-}
-
bool SciGuiGfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {
SegManager *segMan = _s->_segMan;
reg_t curAddress = list->first;
diff --git a/engines/sci/gui/gui_gfx.h b/engines/sci/gui/gui_gfx.h
index 432c62f864..1cb4e7a037 100644
--- a/engines/sci/gui/gui_gfx.h
+++ b/engines/sci/gui/gui_gfx.h
@@ -111,8 +111,6 @@ public:
byte CoordinateToPriority(int16 y);
int16 PriorityToCoordinate(byte priority);
- void ShowPic();
-
bool CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list);
void SetNowSeen(reg_t objectReference);
diff --git a/engines/sci/gui/gui_transitions.cpp b/engines/sci/gui/gui_transitions.cpp
new file mode 100644
index 0000000000..ea36bbb71d
--- /dev/null
+++ b/engines/sci/gui/gui_transitions.cpp
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/util.h"
+#include "common/stack.h"
+#include "graphics/primitives.h"
+
+#include "sci/sci.h"
+#include "sci/engine/state.h"
+#include "sci/tools.h"
+#include "sci/gui/gui_screen.h"
+#include "sci/gui/gui_palette.h"
+#include "sci/gui/gui_transitions.h"
+
+namespace Sci {
+
+SciGuiTransitions::SciGuiTransitions(SciGuiScreen *screen, SciGuiPalette *palette)
+ : _screen(screen), _palette(palette) {
+ init();
+}
+
+SciGuiTransitions::~SciGuiTransitions() {
+}
+
+void SciGuiTransitions::init() {
+}
+
+void SciGuiTransitions::setup(int16 number) {
+ _number = number;
+}
+
+void SciGuiTransitions::doit() {
+ // TODO: Implement animations
+ warning("SciGuiTransitions: animation %d not implemented", _number);
+ _palette->setOnScreen();
+ _screen->copyToScreen();
+ _screen->_picNotValid = 0;
+}
+
+} // End of namespace Sci
diff --git a/engines/sci/gui/gui_transitions.h b/engines/sci/gui/gui_transitions.h
new file mode 100644
index 0000000000..f2f1e798ca
--- /dev/null
+++ b/engines/sci/gui/gui_transitions.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_GUI_TRANSITIONS_H
+#define SCI_GUI_TRANSITIONS_H
+
+#include "sci/gui/gui_helpers.h"
+
+namespace Sci {
+
+class SciGuiScreen;
+class SciGuiTransitions {
+public:
+ SciGuiTransitions(SciGuiScreen *screen, SciGuiPalette *palette);
+ ~SciGuiTransitions();
+
+ void setup(int16 number);
+ void doit();
+
+private:
+ void init(void);
+
+ SciGuiScreen *_screen;
+ SciGuiPalette *_palette;
+
+ int16 _number;
+};
+
+} // End of namespace Sci
+
+#endif
diff --git a/engines/sci/module.mk b/engines/sci/module.mk
index 02d38160f8..6cd2cc0db7 100644
--- a/engines/sci/module.mk
+++ b/engines/sci/module.mk
@@ -61,6 +61,7 @@ MODULE_OBJS = \
gui/gui_palette.o \
gui/gui_picture.o \
gui/gui_screen.o \
+ gui/gui_transitions.o \
gui/gui_view.o \
gui/gui_windowmgr.o \
gui32/gui32.o \