[Scummvm-cvs-logs] SF.net SVN: scummvm:[49854] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Tue Jun 15 15:34:40 CEST 2010
Revision: 49854
http://scummvm.svn.sourceforge.net/scummvm/?rev=49854&view=rev
Author: m_kiewitz
Date: 2010-06-15 13:34:40 +0000 (Tue, 15 Jun 2010)
Log Message:
-----------
SCI: putting SciGui::init into SciEngine, removing it from SciGui(32)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/graphics/gui.cpp
scummvm/trunk/engines/sci/graphics/gui.h
scummvm/trunk/engines/sci/graphics/gui32.cpp
scummvm/trunk/engines/sci/graphics/gui32.h
scummvm/trunk/engines/sci/graphics/ports.cpp
scummvm/trunk/engines/sci/graphics/ports.h
scummvm/trunk/engines/sci/sci.cpp
scummvm/trunk/engines/sci/sci.h
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2010-06-15 13:34:40 UTC (rev 49854)
@@ -983,15 +983,7 @@
// Message state:
s->_msgState = new MessageState(s->_segMan);
-#ifdef ENABLE_SCI32
- if (g_sci->_gui32) {
- g_sci->_gui32->init();
- } else {
-#endif
- g_sci->_gui->init(g_sci->_features->usesOldGfxFunctions());
-#ifdef ENABLE_SCI32
- }
-#endif
+ g_sci->initGraphics();
s->abortScriptProcessing = kAbortLoadGame;
s->shrinkStackToBase();
Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp 2010-06-15 13:34:40 UTC (rev 49854)
@@ -86,9 +86,4 @@
delete _coordAdjuster;
}
-void SciGui::init(bool usesOldGfxFunctions) {
- _ports->init(usesOldGfxFunctions, this, _paint16, _text16);
- _paint16->init(_animate, _text16);
-}
-
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/graphics/gui.h 2010-06-15 13:34:40 UTC (rev 49854)
@@ -49,8 +49,6 @@
SciGui(EngineState *s, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor, GfxPorts *ports, AudioPlayer *audio);
virtual ~SciGui();
- virtual void init(bool usesOldGfxFunctions);
-
protected:
GfxCursor *_cursor;
EngineState *_s;
Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp 2010-06-15 13:34:40 UTC (rev 49854)
@@ -66,9 +66,6 @@
delete _coordAdjuster;
}
-void SciGui32::init() {
-}
-
void SciGui32::drawRobot(GuiResourceId robotId) {
Robot *test = new Robot(g_sci->getResMan(), _screen, robotId);
test->draw();
Modified: scummvm/trunk/engines/sci/graphics/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.h 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/graphics/gui32.h 2010-06-15 13:34:40 UTC (rev 49854)
@@ -44,10 +44,6 @@
SciGui32(SegManager *segMan, EventManager *event, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor);
~SciGui32();
- void init();
-
- void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);
-
void drawRobot(GuiResourceId robotId);
protected:
Modified: scummvm/trunk/engines/sci/graphics/ports.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.cpp 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/graphics/ports.cpp 2010-06-15 13:34:40 UTC (rev 49854)
@@ -54,11 +54,10 @@
delete _menuPort;
}
-void GfxPorts::init(bool usesOldGfxFunctions, SciGui *gui, GfxPaint16 *paint16, GfxText16 *text16) {
+void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *text16) {
int16 offTop = 10;
_usesOldGfxFunctions = usesOldGfxFunctions;
- _gui = gui;
_paint16 = paint16;
_text16 = text16;
Modified: scummvm/trunk/engines/sci/graphics/ports.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.h 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/graphics/ports.h 2010-06-15 13:34:40 UTC (rev 49854)
@@ -45,7 +45,7 @@
GfxPorts(SegManager *segMan, GfxScreen *screen);
~GfxPorts();
- void init(bool usesOldGfxFunctions, SciGui *gui, GfxPaint16 *paint16, GfxText16 *text16);
+ void init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *text16);
void kernelSetActive(uint16 portId);
Common::Rect kernelGetPicWindow(int16 &picTop, int16 &picLeft);
@@ -102,7 +102,6 @@
typedef Common::List<Port *> PortList;
SegManager *_segMan;
- SciGui *_gui;
GfxPaint16 *_paint16;
GfxScreen *_screen;
GfxText16 *_text16;
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/sci.cpp 2010-06-15 13:34:40 UTC (rev 49854)
@@ -47,6 +47,7 @@
#include "sci/graphics/gui.h"
#include "sci/graphics/maciconbar.h"
#include "sci/graphics/menu.h"
+#include "sci/graphics/paint16.h"
#include "sci/graphics/ports.h"
#include "sci/graphics/palette.h"
#include "sci/graphics/cursor.h"
@@ -254,14 +255,7 @@
syncSoundSettings();
-#ifdef ENABLE_SCI32
- if (_gui32)
- _gui32->init();
- else
-#endif
- _gui->init(_features->usesOldGfxFunctions());
- // Set default (EGA, amiga or resource 999) palette
- _gfxPalette->setDefault();
+ initGraphics();
debug("Emulating SCI version %s\n", getSciVersionDesc(getSciVersion()));
@@ -353,6 +347,15 @@
return true;
}
+void SciEngine::initGraphics() {
+ if (_gfxPorts) {
+ _gfxPorts->init(_features->usesOldGfxFunctions(), _gfxPaint16, _gfxText16);
+ _gfxPaint16->init(_gfxAnimate, _gfxText16);
+ }
+ // Set default (EGA, amiga or resource 999) palette
+ _gfxPalette->setDefault();
+}
+
#ifdef USE_OLD_MUSIC_FUNCTIONS
void SciEngine::initGameSound(int sound_flags, SciVersion soundVersion) {
Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h 2010-06-15 13:14:23 UTC (rev 49853)
+++ scummvm/trunk/engines/sci/sci.h 2010-06-15 13:34:40 UTC (rev 49854)
@@ -193,6 +193,9 @@
Common::String getSciLanguageString(const char *str, kLanguage lang, kLanguage *lang2 = NULL) const;
+ // Initializes ports and paint16 for non-sci32 games, also sets default palette
+ void initGraphics();
+
public:
GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx
GfxCache *_gfxCache;
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