[Scummvm-cvs-logs] SF.net SVN: scummvm:[47752] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Jan 31 17:21:11 CET 2010


Revision: 47752
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47752&view=rev
Author:   m_kiewitz
Date:     2010-01-31 16:21:11 +0000 (Sun, 31 Jan 2010)

Log Message:
-----------
SCI: renamed SciPalette to GfxPalette, Screen to GfxScreen, GfxPalette is now called directly w/o SciGui

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/animate.h
    scummvm/trunk/engines/sci/graphics/cache.cpp
    scummvm/trunk/engines/sci/graphics/cache.h
    scummvm/trunk/engines/sci/graphics/compare.cpp
    scummvm/trunk/engines/sci/graphics/compare.h
    scummvm/trunk/engines/sci/graphics/cursor.cpp
    scummvm/trunk/engines/sci/graphics/cursor.h
    scummvm/trunk/engines/sci/graphics/font.cpp
    scummvm/trunk/engines/sci/graphics/font.h
    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/menu.cpp
    scummvm/trunk/engines/sci/graphics/menu.h
    scummvm/trunk/engines/sci/graphics/paint16.cpp
    scummvm/trunk/engines/sci/graphics/paint16.h
    scummvm/trunk/engines/sci/graphics/palette.cpp
    scummvm/trunk/engines/sci/graphics/palette.h
    scummvm/trunk/engines/sci/graphics/picture.cpp
    scummvm/trunk/engines/sci/graphics/picture.h
    scummvm/trunk/engines/sci/graphics/portrait.cpp
    scummvm/trunk/engines/sci/graphics/portrait.h
    scummvm/trunk/engines/sci/graphics/ports.cpp
    scummvm/trunk/engines/sci/graphics/ports.h
    scummvm/trunk/engines/sci/graphics/robot.cpp
    scummvm/trunk/engines/sci/graphics/robot.h
    scummvm/trunk/engines/sci/graphics/screen.cpp
    scummvm/trunk/engines/sci/graphics/screen.h
    scummvm/trunk/engines/sci/graphics/text.cpp
    scummvm/trunk/engines/sci/graphics/text.h
    scummvm/trunk/engines/sci/graphics/transitions.cpp
    scummvm/trunk/engines/sci/graphics/transitions.h
    scummvm/trunk/engines/sci/graphics/view.cpp
    scummvm/trunk/engines/sci/graphics/view.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/console.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -46,6 +46,7 @@
 #include "sci/graphics/gui32.h"
 #include "sci/graphics/cursor.h"
 #include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
 
 #include "sci/parser/vocabulary.h"
 
@@ -1059,7 +1060,7 @@
 
 	uint16 resourceId = atoi(argv[1]);
 
-	_vm->_gamestate->_gui->paletteSet(resourceId, true);
+	_vm->_gamestate->_gfxPalette->kernelSetFromResource(resourceId, true);
 	return true;
 }
 
@@ -1074,7 +1075,7 @@
 	uint16 resourceId = atoi(argv[1]);
 
 	_vm->_gamestate->_gui->drawPicture(resourceId, 100, false, false, false, 0);
-	_vm->_gamestate->_screen->copyToScreen();
+	_vm->_gamestate->_gfxScreen->copyToScreen();
 	return true;
 }
 

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -39,6 +39,7 @@
 #include "sci/graphics/ports.h"
 #include "sci/graphics/animate.h"
 #include "sci/graphics/cursor.h"
+#include "sci/graphics/palette.h"
 #include "sci/graphics/screen.h"
 #include "sci/graphics/view.h"
 
@@ -618,7 +619,9 @@
 }
 
 reg_t kPalette(EngineState *s, int argc, reg_t *argv) {
-	if (!s->_gui)
+	// we are called on EGA/amiga games as well, this doesnt make sense.
+	//  doing this would actually break the system EGA/amiga palette
+	if (!s->resMan->isVGA())
 		return s->r_acc;
 
 	switch (argv[0].toUint16()) {
@@ -626,21 +629,21 @@
 		if (argc==3) {
 			GuiResourceId resourceId = argv[1].toUint16();
 			bool force = argv[2].toUint16() == 2 ? true : false;
-			s->_gui->paletteSet(resourceId, force);
+			s->_gfxPalette->kernelSetFromResource(resourceId, force);
 		}
 		break;
 	case 2: { // Set palette-flag(s)
 		uint16 fromColor = CLIP<uint16>(argv[1].toUint16(), 1, 255);
 		uint16 toColor = CLIP<uint16>(argv[2].toUint16(), 1, 255);
 		uint16 flags = argv[3].toUint16();
-		s->_gui->paletteSetFlag(fromColor, toColor, flags);
+		s->_gfxPalette->kernelSetFlag(fromColor, toColor, flags);
 		break;
 	}
 	case 3:	{ // Remove palette-flag(s)
 		uint16 fromColor = CLIP<uint16>(argv[1].toUint16(), 1, 255);
 		uint16 toColor = CLIP<uint16>(argv[2].toUint16(), 1, 255);
 		uint16 flags = argv[3].toUint16();
-		s->_gui->paletteUnsetFlag(fromColor, toColor, flags);
+		s->_gfxPalette->kernelUnsetFlag(fromColor, toColor, flags);
 		break;
 	}
 	case 4:	{ // Set palette intensity
@@ -652,7 +655,7 @@
 			uint16 intensity = argv[3].toUint16();
 			bool setPalette = (argc < 5) ? true : (argv[4].isNull()) ? true : false;
 
-			s->_gui->paletteSetIntensity(fromColor, toColor, intensity, setPalette);
+			s->_gfxPalette->kernelSetIntensity(fromColor, toColor, intensity, setPalette);
 			break;
 		}
 		default:
@@ -665,7 +668,7 @@
 		uint16 g = argv[2].toUint16();
 		uint16 b = argv[3].toUint16();
 
-		return make_reg(0, s->_gui->paletteFind(r, g, b));
+		return make_reg(0, s->_gfxPalette->kernelFind(r, g, b));
 	}
 	case 6: { // Animate
 		int16 argNr;
@@ -674,11 +677,11 @@
 			uint16 fromColor = argv[argNr].toUint16();
 			uint16 toColor = argv[argNr + 1].toUint16();
 			int16 speed = argv[argNr + 2].toSint16();
-			if (s->_gui->paletteAnimate(fromColor, toColor, speed))
+			if (s->_gfxPalette->kernelAnimate(fromColor, toColor, speed))
 				paletteChanged = true;
 		}
 		if (paletteChanged)
-			s->_gui->paletteAnimateSet();
+			s->_gfxPalette->kernelAnimateSet();
 		break;
 	}
 	case 7: { // Save palette to heap

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -28,6 +28,7 @@
 #include "sci/engine/selector.h"
 #include "sci/engine/kernel.h"
 #include "sci/graphics/gui.h"
+#include "sci/graphics/palette.h"
 
 #include "common/list.h"
 
@@ -292,10 +293,10 @@
 	// Red : Barred access
 	// Yellow: Contained access
 	int poly_colors[4] = {
-		s->_gui->paletteFind(0, 255, 0),	// green
-		s->_gui->paletteFind(0, 0, 255),	// blue
-		s->_gui->paletteFind(255, 0, 0),	// red
-		s->_gui->paletteFind(255, 255, 0)	// yellow
+		s->_gfxPalette->kernelFind(0, 255, 0),	// green
+		s->_gfxPalette->kernelFind(0, 0, 255),	// blue
+		s->_gfxPalette->kernelFind(255, 0, 0),	// red
+		s->_gfxPalette->kernelFind(255, 255, 0)	// yellow
 	};
 
 	// Clip
@@ -314,8 +315,8 @@
 	// Green: End point
 	// Blue: Starting point
 	int point_colors[2] = {
-		s->_gui->paletteFind(0, 255, 0),	// green
-		s->_gui->paletteFind(0, 0, 255)		// blue
+		s->_gfxPalette->kernelFind(0, 255, 0),	// green
+		s->_gfxPalette->kernelFind(0, 0, 255)		// blue
 	};
 
 	Common::Rect rect = Common::Rect(p.x - 1, p.y - 1, p.x - 1 + 3, p.y - 1 + 3);

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/engine/state.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -53,7 +53,8 @@
 class Menubar;
 class GfxAnimate;
 class GfxPorts;
-class Screen;
+class GfxScreen;
+class GfxPalette;
 class SciGui;
 class Cursor;
 class MessageState;
@@ -152,7 +153,8 @@
 
 	GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx
 	GfxPorts *_gfxPorts; // Port managment for 16-bit gfx
-	Screen *_screen; // gfx screen
+	GfxScreen *_gfxScreen;
+	GfxPalette *_gfxPalette;
 	SciGui *_gui; /* Currently active Gui */
 
 #ifdef ENABLE_SCI32

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -42,7 +42,7 @@
 
 namespace Sci {
 
-GfxAnimate::GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, Screen *screen, SciPalette *palette, Cursor *cursor, Transitions *transitions)
+GfxAnimate::GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen, GfxPalette *palette, Cursor *cursor, Transitions *transitions)
 	: _s(state), _cache(cache), _ports(ports), _paint16(paint16), _screen(screen), _palette(palette), _cursor(cursor), _transitions(transitions) {
 	init();
 }

Modified: scummvm/trunk/engines/sci/graphics/animate.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/animate.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -64,7 +64,7 @@
 class Transitions;
 class GfxAnimate {
 public:
-	GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, Screen *screen, SciPalette *palette, Cursor *cursor, Transitions *transitions);
+	GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen, GfxPalette *palette, Cursor *cursor, Transitions *transitions);
 	~GfxAnimate();
 
 	// FIXME: Don't store EngineState
@@ -98,8 +98,8 @@
 	GfxCache *_cache;
 	GfxPorts *_ports;
 	GfxPaint16 *_paint16;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 	Cursor *_cursor;
 	Transitions *_transitions;
 

Modified: scummvm/trunk/engines/sci/graphics/cache.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cache.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/cache.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -36,7 +36,7 @@
 
 namespace Sci {
 
-GfxCache::GfxCache(ResourceManager *resMan, Screen *screen, SciPalette *palette)
+GfxCache::GfxCache(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette)
 	: _resMan(resMan), _screen(screen), _palette(palette) {
 }
 

Modified: scummvm/trunk/engines/sci/graphics/cache.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/cache.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/cache.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -39,7 +39,7 @@
 
 class GfxCache {
 public:
-	GfxCache(ResourceManager *resMan, Screen *screen, SciPalette *palette);
+	GfxCache(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette);
 	~GfxCache();
 
 	View *getView(GuiResourceId viewNum);
@@ -48,8 +48,8 @@
 	void purgeCache();
 
 	ResourceManager *_resMan;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 
 	ViewCache _cachedViews;
 };

Modified: scummvm/trunk/engines/sci/graphics/compare.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/compare.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -38,7 +38,7 @@
 
 namespace Sci {
 
-GfxCompare::GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, Screen *screen)
+GfxCompare::GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen)
 	: _segMan(segMan), _kernel(kernel), _cache(cache), _screen(screen) {
 }
 

Modified: scummvm/trunk/engines/sci/graphics/compare.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/compare.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -36,7 +36,7 @@
 
 class GfxCompare {
 public:
-	GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, Screen *screen);
+	GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen);
 	~GfxCompare();
 
 	uint16 onControl(uint16 screenMask, Common::Rect rect);
@@ -47,7 +47,7 @@
 	SegManager *_segMan;
 	Kernel *_kernel;
 	GfxCache *_cache;
-	Screen *_screen;
+	GfxScreen *_screen;
 };
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -36,7 +36,7 @@
 
 namespace Sci {
 
-Cursor::Cursor(ResourceManager *resMan, SciPalette *palette, Screen *screen)
+Cursor::Cursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *screen)
 	: _resMan(resMan), _palette(palette), _screen(screen) {
 
 	_upscaledHires = _screen->getUpscaledHires();

Modified: scummvm/trunk/engines/sci/graphics/cursor.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/cursor.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -42,7 +42,7 @@
 
 class Cursor {
 public:
-	Cursor(ResourceManager *resMan, SciPalette *palette, Screen *screen);
+	Cursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *screen);
 	~Cursor();
 
 	void show();
@@ -65,8 +65,8 @@
 	void purgeCache();
 
 	ResourceManager *_resMan;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 
 	bool _upscaledHires;
 

Modified: scummvm/trunk/engines/sci/graphics/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/font.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/font.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -78,7 +78,7 @@
 	return chr < _numChars ? _resourceData + _chars[chr].offset + 2 : 0;
 }
 
-void Font::draw(Screen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
+void Font::draw(GfxScreen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
 	int charWidth = MIN<int>(getCharWidth(chr), screen->getWidth() - left);
 	int charHeight = MIN<int>(getCharHeight(chr), screen->getHeight() - top);
 	byte b = 0, mask = 0xFF;

Modified: scummvm/trunk/engines/sci/graphics/font.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/font.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/font.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -40,7 +40,7 @@
 	byte getCharWidth(byte chr);
 	byte getCharHeight(byte chr);
 	byte *getCharData(byte chr);
-	void draw(Screen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput);
+	void draw(GfxScreen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput);
 
 private:
 	ResourceManager *_resMan;

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -50,7 +50,7 @@
 
 namespace Sci {
 
-SciGui::SciGui(EngineState *state, Screen *screen, SciPalette *palette, Cursor *cursor, GfxPorts *ports, AudioPlayer *audio)
+SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, Cursor *cursor, GfxPorts *ports, AudioPlayer *audio)
 	: _s(state), _screen(screen), _palette(palette), _cursor(cursor), _ports(ports), _audio(audio) {
 
 	_cache = new GfxCache(_s->resMan, _screen, _palette);
@@ -507,45 +507,6 @@
 }
 
 
-void SciGui::paletteSet(GuiResourceId resourceId, bool force) {
-	// we are also called on EGA games as well, this doesnt make sense. doing this would actually break the system EGA palette
-	if (!_s->resMan->isVGA())
-		return;
-   _palette->setFromResource(resourceId, force);
-}
-
-void SciGui::paletteSetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
-	_palette->setFlag(fromColor, toColor, flag);
-}
-
-void SciGui::paletteUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
-	_palette->unsetFlag(fromColor, toColor, flag);
-}
-
-int16 SciGui::paletteFind(uint16 r, uint16 g, uint16 b) {
-	return _palette->matchColor(&_palette->_sysPalette, r, g, b) & 0xFF;
-}
-
-void SciGui::paletteSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette) {
-	// we are also called on Amiga as well, but for colors above 32, so it doesnt make sense
-	if (!_s->resMan->isVGA())
-		return;
-
-	_palette->setIntensity(fromColor, toColor, intensity, setPalette);
-}
-
-bool SciGui::paletteAnimate(uint16 fromColor, uint16 toColor, int16 speed) {
-	// we are also called on Amiga as well, but for colors above 32, so it doesnt make sense
-	if (!_s->resMan->isVGA())
-		return false;
-
-	return _palette->animate(fromColor, toColor, speed);
-}
-
-void SciGui::paletteAnimateSet() {
-	_palette->setOnScreen();
-}
-
 void SciGui::shakeScreen(uint16 shakeCount, uint16 directions) {
 	while (shakeCount--) {
 		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
@@ -755,7 +716,7 @@
 	_palVaryId = -1;	// invalidate the target palette
 
 	// HACK: just set the target palette
-	_palette->setFromResource(_palVaryId, true);
+	_palette->kernelSetFromResource(_palVaryId, true);
 }
 
 void SciGui::palVaryCallback(void *refCon) {

Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/gui.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -42,7 +42,7 @@
 };
 
 class Screen;
-class SciPalette;
+class GfxPalette;
 class Cursor;
 class GfxCache;
 class GfxCompare;
@@ -57,24 +57,17 @@
 
 class SciGui {
 public:
-	SciGui(EngineState *s, Screen *screen, SciPalette *palette, Cursor *cursor, GfxPorts *ports, AudioPlayer *audio);
+	SciGui(EngineState *s, GfxScreen *screen, GfxPalette *palette, Cursor *cursor, GfxPorts *ports, AudioPlayer *audio);
 	virtual ~SciGui();
 
 	virtual void init(bool usesOldGfxFunctions);
 
 	virtual void wait(int16 ticks);
-	// virtual void setPort(uint16 portPtr);
-	// virtual Common::Rect getPortPic(int16 &picTop, int16 &picLeft);
-	// virtual void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag);
-	// virtual reg_t getPort();
 	virtual void globalToLocal(int16 *x, int16 *y);
 	virtual void localToGlobal(int16 *x, int16 *y);
 	virtual int16 coordinateToPriority(int16 y);
 	virtual int16 priorityToCoordinate(int16 priority);
 
-	// virtual reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
-	// virtual void disposeWindow(uint16 windowPtr, bool reanimate);
-
 	virtual void display(const char *text, int argc, reg_t *argv);
 
 	virtual void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);
@@ -112,14 +105,6 @@
 
 	virtual int16 picNotValid(int16 newPicNotValid);
 
-	virtual void paletteSet(GuiResourceId resourceNo, bool force);
-	virtual void paletteSetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
-	virtual void paletteUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
-	virtual int16 paletteFind(uint16 r, uint16 g, uint16 b);
-	virtual void paletteSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette);
-	virtual bool paletteAnimate(uint16 fromColor, uint16 toColor, int16 speed);
-	virtual void paletteAnimateSet();
-
 	virtual void shakeScreen(uint16 shakeCount, uint16 directions);
 
 	virtual uint16 onControl(byte screenMask, Common::Rect rect);
@@ -164,8 +149,8 @@
 protected:
 	Cursor *_cursor;
 	EngineState *_s;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 	GfxCache *_cache;
 	GfxCompare *_compare;
 	GfxPorts *_ports;

Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -44,7 +44,7 @@
 
 namespace Sci {
 
-SciGui32::SciGui32(EngineState *state, Screen *screen, SciPalette *palette, Cursor *cursor)
+SciGui32::SciGui32(EngineState *state, GfxScreen *screen, GfxPalette *palette, Cursor *cursor)
 	: _s(state), _screen(screen), _palette(palette), _cursor(cursor) {
 
 	_cache = new GfxCache(_s->resMan, _screen, _palette);

Modified: scummvm/trunk/engines/sci/graphics/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/gui32.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -39,7 +39,7 @@
 
 class SciGui32 {
 public:
-	SciGui32(EngineState *s, Screen *screen, SciPalette *palette, Cursor *cursor);
+	SciGui32(EngineState *s, GfxScreen *screen, GfxPalette *palette, Cursor *cursor);
 	~SciGui32();
 
 	void init();
@@ -91,8 +91,8 @@
 protected:
 	Cursor *_cursor;
 	EngineState *_s;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 	GfxCache *_cache;
 	GfxCompare *_compare;
 

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -43,7 +43,7 @@
 
 namespace Sci {
 
-Menu::Menu(SciEvent *event, SegManager *segMan, SciGui *gui, GfxPorts *ports, GfxPaint16 *paint16, Text *text, Screen *screen, Cursor *cursor)
+Menu::Menu(SciEvent *event, SegManager *segMan, SciGui *gui, GfxPorts *ports, GfxPaint16 *paint16, Text *text, GfxScreen *screen, Cursor *cursor)
 	: _event(event), _segMan(segMan), _gui(gui), _ports(ports), _paint16(paint16), _text(text), _screen(screen), _cursor(cursor) {
 
 	_listCount = 0;

Modified: scummvm/trunk/engines/sci/graphics/menu.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/menu.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -78,7 +78,7 @@
 
 class Menu {
 public:
-	Menu(SciEvent *event, SegManager *segMan, SciGui *gui, GfxPorts *ports, GfxPaint16 *paint16, Text *text, Screen *screen, Cursor *cursor);
+	Menu(SciEvent *event, SegManager *segMan, SciGui *gui, GfxPorts *ports, GfxPaint16 *paint16, Text *text, GfxScreen *screen, Cursor *cursor);
 	~Menu();
 
 	void reset();
@@ -108,7 +108,7 @@
 	GfxPorts *_ports;
 	GfxPaint16 *_paint16;
 	Text *_text;
-	Screen *_screen;
+	GfxScreen *_screen;
 	Cursor *_cursor;
 
 	uint16 _listCount;

Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -43,7 +43,7 @@
 
 namespace Sci {
 
-GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, Screen *screen, SciPalette *palette)
+GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette)
 	: _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _ports(ports), _screen(screen), _palette(palette) {
 }
 

Modified: scummvm/trunk/engines/sci/graphics/paint16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/paint16.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -41,7 +41,7 @@
 
 class GfxPaint16 {
 public:
-	GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, Screen *screen, SciPalette *palette);
+	GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette);
 	~GfxPaint16();
 
 	void init(Text *text);
@@ -74,8 +74,8 @@
 	Kernel *_kernel;
 	GfxCache *_cache;
 	GfxPorts *_ports;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 	Text *_text;
 
 	// true means make EGA picture drawing visible

Modified: scummvm/trunk/engines/sci/graphics/palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/palette.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -33,7 +33,7 @@
 
 namespace Sci {
 
-SciPalette::SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPalette)
+GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool autoSetPalette)
 	: _resMan(resMan), _screen(screen) {
 	int16 color;
 
@@ -59,17 +59,17 @@
 		else if (_resMan->isAmiga32color())
 			setAmiga();
 		else
-			setFromResource(999, true);
+			kernelSetFromResource(999, true);
 	}
 }
 
-SciPalette::~SciPalette() {
+GfxPalette::~GfxPalette() {
 }
 
 #define SCI_PAL_FORMAT_CONSTANT 1
 #define SCI_PAL_FORMAT_VARIABLE 0
 
-void SciPalette::createFromData(byte *data, Palette *paletteOut) {
+void GfxPalette::createFromData(byte *data, Palette *paletteOut) {
 	int palFormat = 0;
 	int palOffset = 0;
 	int palColorStart = 0;
@@ -114,7 +114,7 @@
 }
 
 // Will try to set amiga palette by using "spal" file. If not found, we return false
-bool SciPalette::setAmiga() {
+bool GfxPalette::setAmiga() {
 	Common::File file;
 	int curColor, byte1, byte2;
 
@@ -138,7 +138,7 @@
 }
 
 // Called from picture class, some amiga sci1 games set half of the palette
-void SciPalette::modifyAmigaPalette(byte *data) {
+void GfxPalette::modifyAmigaPalette(byte *data) {
 	int16 curColor, curPos = 0;
 	byte byte1, byte2;
 	for (curColor = 0; curColor < 16; curColor++) {
@@ -151,7 +151,7 @@
 	_screen->setPalette(&_sysPalette);
 }
 
-void SciPalette::setEGA() {
+void GfxPalette::setEGA() {
 	int curColor;
 	byte color1, color2;
 
@@ -185,19 +185,7 @@
 	setOnScreen();
 }
 
-bool SciPalette::setFromResource(GuiResourceId resourceId, bool force) {
-	Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), 0);
-	Palette palette;
-
-	if (palResource) {
-		createFromData(palResource->data, &palette);
-		set(&palette, true);
-		return true;
-	}
-	return false;
-}
-
-void SciPalette::set(Palette *sciPal, bool force, bool forceRealMerge) {
+void GfxPalette::set(Palette *sciPal, bool force, bool forceRealMerge) {
 	uint32 systime = _sysPalette.timestamp;
 	if (force || sciPal->timestamp != systime) {
 		merge(sciPal, &_sysPalette, force, forceRealMerge);
@@ -207,7 +195,7 @@
 	}
 }
 
-void SciPalette::merge(Palette *pFrom, Palette *pTo, bool force, bool forceRealMerge) {
+void GfxPalette::merge(Palette *pFrom, Palette *pTo, bool force, bool forceRealMerge) {
 	uint16 res;
 	int i,j;
 
@@ -269,7 +257,7 @@
 	pTo->timestamp = g_system->getMillis() * 60 / 1000;
 }
 
-uint16 SciPalette::matchColor(Palette *pPal, byte r, byte g, byte b) {
+uint16 GfxPalette::matchColor(Palette *pPal, byte r, byte g, byte b) {
 	byte found = 0xFF;
 	int diff = 0x2FFFF, cdiff;
 	int16 dr,dg,db;
@@ -294,12 +282,12 @@
 	return found;
 }
 
-void SciPalette::getSys(Palette *pal) {
+void GfxPalette::getSys(Palette *pal) {
 	if (pal != &_sysPalette)
 		memcpy(pal, &_sysPalette,sizeof(Palette));
 }
 
-void SciPalette::setOnScreen() {
+void GfxPalette::setOnScreen() {
 //	if (pal != &_sysPalette)
 //		memcpy(&_sysPalette,pal,sizeof(Palette));
 	// We dont change palette at all times for amiga
@@ -308,28 +296,44 @@
 	_screen->setPalette(&_sysPalette);
 }
 
-void SciPalette::setFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
+bool GfxPalette::kernelSetFromResource(GuiResourceId resourceId, bool force) {
+	Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), 0);
+	Palette palette;
+
+	if (palResource) {
+		createFromData(palResource->data, &palette);
+		set(&palette, true);
+		return true;
+	}
+	return false;
+}
+
+void GfxPalette::kernelSetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
 	uint16 colorNr;
 	for (colorNr = fromColor; colorNr < toColor; colorNr++) {
 		_sysPalette.colors[colorNr].used |= flag;
 	}
 }
 
-void SciPalette::unsetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
+void GfxPalette::kernelUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
 	uint16 colorNr;
 	for (colorNr = fromColor; colorNr < toColor; colorNr++) {
 		_sysPalette.colors[colorNr].used &= ~flag;
 	}
 }
 
-void SciPalette::setIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette) {
+void GfxPalette::kernelSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette) {
 	memset(&_sysPalette.intensity[0] + fromColor, intensity, toColor - fromColor);
 	if (setPalette)
 		setOnScreen();
 }
 
+int16 GfxPalette::kernelFind(uint16 r, uint16 g, uint16 b) {
+	return matchColor(&_sysPalette, r, g, b) & 0xFF;
+}
+
 // Returns true, if palette got changed
-bool SciPalette::animate(byte fromColor, byte toColor, int speed) {
+bool GfxPalette::kernelAnimate(byte fromColor, byte toColor, int speed) {
 	Color col;
 	//byte colorNr;
 	int16 colorCount;
@@ -383,6 +387,10 @@
 	return false;
 }
 
+void GfxPalette::kernelAnimateSet() {
+	setOnScreen();
+}
+
 // palVary
 //  init - only does, if palVaryOn == false
 //         target, start, new palette allocation

Modified: scummvm/trunk/engines/sci/graphics/palette.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/palette.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -31,16 +31,15 @@
 namespace Sci {
 
 class Screen;
-class SciPalette {
+class GfxPalette {
 public:
-	SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPalette = true);
-	~SciPalette();
+	GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool autoSetPalette = true);
+	~GfxPalette();
 
 	void createFromData(byte *data, Palette *paletteOut);
 	bool setAmiga();
 	void modifyAmigaPalette(byte *data);
 	void setEGA();
-	bool setFromResource(GuiResourceId resourceId, bool force);
 	void set(Palette *sciPal, bool force, bool forceRealMerge = false);
 	void merge(Palette *pFrom, Palette *pTo, bool force, bool forceRealMerge);
 	uint16 matchColor(Palette *pPal, byte r, byte g, byte b);
@@ -48,15 +47,18 @@
 
 	void setOnScreen();
 
-	void setFlag(uint16 fromColor, uint16 toColor, uint16 flag);
-	void unsetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
-	void setIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette);
-	bool animate(byte fromColor, byte toColor, int speed);
+	bool kernelSetFromResource(GuiResourceId resourceId, bool force);
+	void kernelSetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
+	void kernelUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
+	void kernelSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette);
+	int16 GfxPalette::kernelFind(uint16 r, uint16 g, uint16 b);
+	bool kernelAnimate(byte fromColor, byte toColor, int speed);
+	void kernelAnimateSet();
 
 	Palette _sysPalette;
 
 private:
-	Screen *_screen;
+	GfxScreen *_screen;
 	ResourceManager *_resMan;
 
 	Common::Array<PalSchedule> _schedules;

Modified: scummvm/trunk/engines/sci/graphics/picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/picture.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -33,7 +33,7 @@
 
 namespace Sci {
 
-SciGuiPicture::SciGuiPicture(ResourceManager *resMan, GfxPorts *ports, Screen *screen, SciPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize)
+SciGuiPicture::SciGuiPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize)
 	: _resMan(resMan), _ports(ports), _screen(screen), _palette(palette), _resourceId(resourceId), _EGAdrawingVisualize(EGAdrawingVisualize) {
 	assert(resourceId != -1);
 	initData(resourceId);

Modified: scummvm/trunk/engines/sci/graphics/picture.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/picture.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -38,7 +38,7 @@
 
 class SciGuiPicture {
 public:
-	SciGuiPicture(ResourceManager *resMan, GfxPorts *ports, Screen *screen, SciPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false);
+	SciGuiPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false);
 	~SciGuiPicture();
 
 	GuiResourceId getResourceId();
@@ -68,8 +68,8 @@
 
 	ResourceManager *_resMan;
 	GfxPorts *_ports;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 
 	int16 _resourceId;
 	Resource *_resource;

Modified: scummvm/trunk/engines/sci/graphics/portrait.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/portrait.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/portrait.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -38,7 +38,7 @@
 
 namespace Sci {
 
-Portrait::Portrait(ResourceManager *resMan, SciEvent *event, SciGui *gui, Screen *screen, SciPalette *palette, AudioPlayer *audio, Common::String resourceName)
+Portrait::Portrait(ResourceManager *resMan, SciEvent *event, SciGui *gui, GfxScreen *screen, GfxPalette *palette, AudioPlayer *audio, Common::String resourceName)
 	: _resMan(resMan), _event(event), _gui(gui), _screen(screen), _palette(palette), _audio(audio), _resourceName(resourceName) {
 	init();
 }

Modified: scummvm/trunk/engines/sci/graphics/portrait.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/portrait.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/portrait.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -42,7 +42,7 @@
  */
 class Portrait {
 public:
-	Portrait(ResourceManager *resMan, SciEvent *event, SciGui *gui, Screen *screen, SciPalette *palette, AudioPlayer *audio, Common::String resourceName);
+	Portrait(ResourceManager *resMan, SciEvent *event, SciGui *gui, GfxScreen *screen, GfxPalette *palette, AudioPlayer *audio, Common::String resourceName);
 	~Portrait();
 
 	void setupAudio(uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
@@ -58,8 +58,8 @@
 	ResourceManager *_resMan;
 	SciEvent *_event;
 	SciGui *_gui;
-	SciPalette *_palette;
-	Screen *_screen;
+	GfxPalette *_palette;
+	GfxScreen *_screen;
 	AudioPlayer *_audio;
 
 	uint16 _height;

Modified: scummvm/trunk/engines/sci/graphics/ports.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/ports.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -44,7 +44,7 @@
 	SCI_WINDOWMGR_STYLE_USER        = (1 << 7)
 };
 
-GfxPorts::GfxPorts(SegManager *segMan, Screen *screen)
+GfxPorts::GfxPorts(SegManager *segMan, GfxScreen *screen)
 	: _segMan(segMan), _screen(screen) {
 }
 

Modified: scummvm/trunk/engines/sci/graphics/ports.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/ports.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -38,7 +38,7 @@
 
 class GfxPorts {
 public:
-	GfxPorts(SegManager *segMan, Screen *screen);
+	GfxPorts(SegManager *segMan, GfxScreen *screen);
 	~GfxPorts();
 
 	void init(SciGui *gui, GfxPaint16 *paint16, Text *text, Common::String gameId);
@@ -97,7 +97,7 @@
 	SegManager *_segMan;
 	SciGui *_gui;
 	GfxPaint16 *_paint16;
-	Screen *_screen;
+	GfxScreen *_screen;
 	Text *_text;
 
 	/** The list of open 'windows' (and ports), in visual order. */

Modified: scummvm/trunk/engines/sci/graphics/robot.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/robot.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -31,7 +31,7 @@
 namespace Sci {
 
 #ifdef ENABLE_SCI32
-Robot::Robot(ResourceManager *resMan, Screen *screen, GuiResourceId resourceId)
+Robot::Robot(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId)
 	: _resMan(resMan), _screen(screen), _resourceId(resourceId) {
 	assert(resourceId != -1);
 	initData(resourceId);

Modified: scummvm/trunk/engines/sci/graphics/robot.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/robot.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -33,7 +33,7 @@
 #ifdef ENABLE_SCI32
 class Robot {
 public:
-	Robot(ResourceManager *resMan, Screen *screen, GuiResourceId resourceId);
+	Robot(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId);
 	~Robot();
 
 	void draw();
@@ -42,7 +42,7 @@
 	void initData(GuiResourceId resourceId);
 
 	ResourceManager *_resMan;
-	Screen *_screen;
+	GfxScreen *_screen;
 
 	GuiResourceId _resourceId;
 	Resource *_resource;

Modified: scummvm/trunk/engines/sci/graphics/screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/screen.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -33,7 +33,7 @@
 
 namespace Sci {
 
-Screen::Screen(ResourceManager *resMan, int16 width, int16 height, bool upscaledHires) :
+GfxScreen::GfxScreen(ResourceManager *resMan, int16 width, int16 height, bool upscaledHires) :
 	_resMan(resMan), _width(width), _height(height), _upscaledHires(upscaledHires) {
 
 	_pixels = _width * _height;
@@ -75,32 +75,32 @@
 	initGraphics(_displayWidth, _displayHeight, _displayWidth > 320);
 }
 
-Screen::~Screen() {
+GfxScreen::~GfxScreen() {
 	free(_visualScreen);
 	free(_priorityScreen);
 	free(_controlScreen);
 	free(_displayScreen);
 }
 
-void Screen::copyToScreen() {
+void GfxScreen::copyToScreen() {
 	g_system->copyRectToScreen(_activeScreen, _displayWidth, 0, 0, _displayWidth, _displayHeight);
 }
 
-void Screen::copyFromScreen(byte *buffer) {
+void GfxScreen::copyFromScreen(byte *buffer) {
 	Graphics::Surface *screen;
 	screen = g_system->lockScreen();
 	memcpy(buffer, screen->pixels, _displayWidth * _displayHeight);
 	g_system->unlockScreen();
 }
 
-void Screen::syncWithFramebuffer() {
+void GfxScreen::syncWithFramebuffer() {
 	Graphics::Surface *screen = g_system->lockScreen();
 
 	memcpy(_displayScreen, screen->pixels, _displayPixels);
 	g_system->unlockScreen();
 }
 
-void Screen::copyRectToScreen(const Common::Rect &rect) {
+void GfxScreen::copyRectToScreen(const Common::Rect &rect) {
 	if (!_upscaledHires)  {
 		g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, rect.left, rect.top, rect.width(), rect.height());
 	} else {
@@ -109,13 +109,13 @@
 }
 
 // This copies a rect to screen w/o scaling adjustment and is only meant to be used on hires graphics used in upscaled hires mode
-void Screen::copyDisplayRectToScreen(const Common::Rect &rect) {
+void GfxScreen::copyDisplayRectToScreen(const Common::Rect &rect) {
 	if (!_upscaledHires)
 		error("copyDisplayRectToScreen: not in upscaled hires mode");
 	g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, rect.left, rect.top, rect.width(), rect.height());
 }
 
-void Screen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) {
+void GfxScreen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) {
 	if (!_upscaledHires)  {
 		g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, x, y, rect.width(), rect.height());
 	} else {
@@ -123,7 +123,7 @@
 	}
 }
 
-byte Screen::getDrawingMask(byte color, byte prio, byte control) {
+byte GfxScreen::getDrawingMask(byte color, byte prio, byte control) {
 	byte flag = 0;
 	if (color != 255)
 		flag |= SCI_SCREEN_MASK_VISUAL;
@@ -134,7 +134,7 @@
 	return flag;
 }
 
-void Screen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) {
+void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) {
 	int offset = y * _width + x;
 
 	if (drawMask & SCI_SCREEN_MASK_VISUAL) {
@@ -157,14 +157,14 @@
 
 // This will just change a pixel directly on displayscreen. Its supposed to get only used on upscaled-Hires games where
 //  hires content needs to get drawn ONTO the upscaled display screen (like japanese fonts, hires portraits, etc.)
-void Screen::putPixelOnDisplay(int x, int y, byte color) {
+void GfxScreen::putPixelOnDisplay(int x, int y, byte color) {
 	int offset = y * _displayWidth + x;
 	_displayScreen[offset] = color;
 }
 
 // Sierra's Bresenham line drawing
 // WARNING: Do not just blindly replace this with Graphics::drawLine(), as it seems to create issues with flood fill
-void Screen::drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte priority, byte control) {
+void GfxScreen::drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte priority, byte control) {
 	int16 left = startPoint.x;
 	int16 top = startPoint.y;
 	int16 right = endPoint.x;
@@ -226,19 +226,19 @@
 	}
 }
 
-byte Screen::getVisual(int x, int y) {
+byte GfxScreen::getVisual(int x, int y) {
 	return _visualScreen[y * _width + x];
 }
 
-byte Screen::getPriority(int x, int y) {
+byte GfxScreen::getPriority(int x, int y) {
 	return _priorityScreen[y * _width + x];
 }
 
-byte Screen::getControl(int x, int y) {
+byte GfxScreen::getControl(int x, int y) {
 	return _controlScreen[y * _width + x];
 }
 
-byte Screen::isFillMatch(int16 x, int16 y, byte screenMask, byte t_color, byte t_pri, byte t_con) {
+byte GfxScreen::isFillMatch(int16 x, int16 y, byte screenMask, byte t_color, byte t_pri, byte t_con) {
 	int offset = y * _width + x;
 	byte match = 0;
 
@@ -251,7 +251,7 @@
 	return match;
 }
 
-int Screen::bitsGetDataSize(Common::Rect rect, byte mask) {
+int GfxScreen::bitsGetDataSize(Common::Rect rect, byte mask) {
 	int byteCount = sizeof(rect) + sizeof(mask);
 	int pixels = rect.width() * rect.height();
 	if (mask & SCI_SCREEN_MASK_VISUAL) {
@@ -277,7 +277,7 @@
 	return byteCount;
 }
 
-void Screen::bitsSave(Common::Rect rect, byte mask, byte *memoryPtr) {
+void GfxScreen::bitsSave(Common::Rect rect, byte mask, byte *memoryPtr) {
 	memcpy(memoryPtr, (void *)&rect, sizeof(rect)); memoryPtr += sizeof(rect);
 	memcpy(memoryPtr, (void *)&mask, sizeof(mask)); memoryPtr += sizeof(mask);
 
@@ -298,7 +298,7 @@
 	}
 }
 
-void Screen::bitsSaveScreen(Common::Rect rect, byte *screen, uint16 screenWidth, byte *&memoryPtr) {
+void GfxScreen::bitsSaveScreen(Common::Rect rect, byte *screen, uint16 screenWidth, byte *&memoryPtr) {
 	int width = rect.width();
 	int y;
 
@@ -310,7 +310,7 @@
 	}
 }
 
-void Screen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
+void GfxScreen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
 	byte *screen = _displayScreen;
 	int width = rect.width();
 	int y;
@@ -329,11 +329,11 @@
 	}
 }
 
-void Screen::bitsGetRect(byte *memoryPtr, Common::Rect *destRect) {
+void GfxScreen::bitsGetRect(byte *memoryPtr, Common::Rect *destRect) {
 	memcpy((void *)destRect, memoryPtr, sizeof(Common::Rect));
 }
 
-void Screen::bitsRestore(byte *memoryPtr) {
+void GfxScreen::bitsRestore(byte *memoryPtr) {
 	Common::Rect rect;
 	byte mask;
 
@@ -357,7 +357,7 @@
 	}
 }
 
-void Screen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *screen, uint16 screenWidth) {
+void GfxScreen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *screen, uint16 screenWidth) {
 	int width = rect.width();
 	int y;
 
@@ -369,7 +369,7 @@
 	}
 }
 
-void Screen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
+void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
 	byte *screen = _displayScreen;
 	int width = rect.width();
 	int y;
@@ -388,7 +388,7 @@
 	}
 }
 
-void Screen::setPalette(Palette*pal) {
+void GfxScreen::setPalette(Palette*pal) {
 	// just copy palette to system
 	byte bpal[4 * 256];
 	// Get current palette, update it and put back
@@ -404,14 +404,14 @@
 	g_system->setPalette(bpal, 0, 256);
 }
 
-void Screen::setVerticalShakePos(uint16 shakePos) {
+void GfxScreen::setVerticalShakePos(uint16 shakePos) {
 	if (!_upscaledHires)
 		g_system->setShakePos(shakePos);
 	else
 		g_system->setShakePos(shakePos * 2);
 }
 
-void Screen::dither(bool addToFlag) {
+void GfxScreen::dither(bool addToFlag) {
 	int y, x;
 	byte color, ditheredColor;
 	byte *visualPtr = _visualScreen;
@@ -477,18 +477,18 @@
 	}
 }
 
-void Screen::unditherSetState(bool flag) {
+void GfxScreen::unditherSetState(bool flag) {
 	_unditherState = flag;
 }
 
-int16 *Screen::unditherGetMemorial() {
+int16 *GfxScreen::unditherGetMemorial() {
 	if (_unditherState)
 		return (int16 *)&_unditherMemorial;
 	else
 		return NULL;
 }
 
-void Screen::debugShowMap(int mapNo) {
+void GfxScreen::debugShowMap(int mapNo) {
 	// We cannot really support changing maps when in upscaledHires mode
 	if (_upscaledHires)
 		return;
@@ -510,7 +510,7 @@
 	copyToScreen();
 }
 
-void Screen::scale2x(byte *src, byte *dst, int16 srcWidth, int16 srcHeight) {
+void GfxScreen::scale2x(byte *src, byte *dst, int16 srcWidth, int16 srcHeight) {
 	int newWidth = srcWidth * 2;
 	byte *srcPtr = src;
 

Modified: scummvm/trunk/engines/sci/graphics/screen.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/screen.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -41,10 +41,10 @@
 
 #define SCI_SCREEN_UNDITHERMEMORIAL_SIZE 256
 
-class Screen {
+class GfxScreen {
 public:
-	Screen(ResourceManager *resMan, int16 width = 320, int16 height = 200, bool upscaledHires = false);
-	~Screen();
+	GfxScreen(ResourceManager *resMan, int16 width = 320, int16 height = 200, bool upscaledHires = false);
+	~GfxScreen();
 
 	uint16 getWidth() { return _width; };
 	uint16 getHeight() { return _height; };

Modified: scummvm/trunk/engines/sci/graphics/text.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/text.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/text.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -36,7 +36,7 @@
 
 namespace Sci {
 
-Text::Text(ResourceManager *resMan, GfxPorts *ports, GfxPaint16 *paint16, Screen *screen)
+Text::Text(ResourceManager *resMan, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen)
 	: _resMan(resMan), _ports(ports), _paint16(paint16), _screen(screen) {
 	init();
 }

Modified: scummvm/trunk/engines/sci/graphics/text.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/text.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/text.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -38,7 +38,7 @@
 class Font;
 class Text {
 public:
-	Text(ResourceManager *_resMan, GfxPorts *ports, GfxPaint16 *paint16, Screen *screen);
+	Text(ResourceManager *_resMan, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen);
 	~Text();
 
 	GuiResourceId GetFontId();
@@ -72,7 +72,7 @@
 	ResourceManager *_resMan;
 	GfxPorts *_ports;
 	GfxPaint16 *_paint16;
-	Screen *_screen;
+	GfxScreen *_screen;
 
 	int _codeFontsCount;
 	GuiResourceId *_codeFonts;

Modified: scummvm/trunk/engines/sci/graphics/transitions.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/transitions.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/transitions.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -37,7 +37,7 @@
 
 namespace Sci {
 
-Transitions::Transitions(SciGui *gui, Screen *screen, SciPalette *palette, bool isVGA)
+Transitions::Transitions(SciGui *gui, GfxScreen *screen, GfxPalette *palette, bool isVGA)
 	: _gui(gui), _screen(screen), _palette(palette), _isVGA(isVGA) {
 	init();
 }
@@ -292,7 +292,7 @@
 	int16 stepNr;
 
 	for (stepNr = 0; stepNr <= 100; stepNr += 10) {
-		_palette->setIntensity(1, 255, stepNr, true);
+		_palette->kernelSetIntensity(1, 255, stepNr, true);
 		_gui->wait(2);
 	}
 }

Modified: scummvm/trunk/engines/sci/graphics/transitions.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/transitions.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/transitions.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -62,7 +62,7 @@
 class Screen;
 class Transitions {
 public:
-	Transitions(SciGui *gui, Screen *screen, SciPalette *palette, bool isVGA);
+	Transitions(SciGui *gui, GfxScreen *screen, GfxPalette *palette, bool isVGA);
 	~Transitions();
 
 	void setup(int16 number, bool blackoutFlag);
@@ -90,8 +90,8 @@
 	void updateScreenAndWait(int msec);
 
 	SciGui *_gui;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 
 	bool _isVGA;
 	const GuiTransitionTranslateEntry *_translationTable;

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -31,7 +31,7 @@
 
 namespace Sci {
 
-View::View(ResourceManager *resMan, Screen *screen, SciPalette *palette, GuiResourceId resourceId)
+View::View(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId)
 	: _resMan(resMan), _screen(screen), _palette(palette), _resourceId(resourceId) {
 	assert(resourceId != -1);
 	initData(resourceId);

Modified: scummvm/trunk/engines/sci/graphics/view.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.h	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/graphics/view.h	2010-01-31 16:21:11 UTC (rev 47752)
@@ -53,7 +53,7 @@
 
 class View {
 public:
-	View(ResourceManager *resMan, Screen *screen, SciPalette *palette, GuiResourceId resourceId);
+	View(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId);
 	~View();
 
 	GuiResourceId getResourceId();
@@ -76,8 +76,8 @@
 	void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey);
 
 	ResourceManager *_resMan;
-	Screen *_screen;
-	SciPalette *_palette;
+	GfxScreen *_screen;
+	GfxPalette *_palette;
 
 	GuiResourceId _resourceId;
 	Resource *_resource;

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-01-31 15:07:36 UTC (rev 47751)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-01-31 16:21:11 UTC (rev 47752)
@@ -141,15 +141,15 @@
 		upscaledHires = true;
 
 	// Initialize graphics-related parts
-	Screen *screen = 0;
+	GfxScreen *screen = 0;
 
 	// invokes initGraphics()
 	if (_resMan->detectHires())
-		screen = new Screen(_resMan, 640, 480, false);
+		screen = new GfxScreen(_resMan, 640, 480, false);
 	else
-		screen = new Screen(_resMan, 320, 200, upscaledHires);
+		screen = new GfxScreen(_resMan, 320, 200, upscaledHires);
 
-	SciPalette *palette = new SciPalette(_resMan, screen);
+	GfxPalette *palette = new GfxPalette(_resMan, screen);
 	Cursor *cursor = new Cursor(_resMan, palette, screen);
 
 	// Create debugger console. It requires GFX to be initialized
@@ -184,7 +184,8 @@
 	_gamestate->_ports = new GfxPorts(_segMan, _screen);
 	_gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor, _audio);
 #endif
-	_gamestate->_screen = screen;
+	_gamestate->_gfxPalette = palette;
+	_gamestate->_gfxScreen = screen;
 
 	if (game_init(_gamestate)) { /* Initialize */
 		warning("Game initialization failed: Aborting...");


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