[Scummvm-cvs-logs] SF.net SVN: scummvm:[46080] scummvm/trunk/engines/scumm

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Nov 22 12:43:12 CET 2009


Revision: 46080
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46080&view=rev
Author:   Kirben
Date:     2009-11-22 11:43:12 +0000 (Sun, 22 Nov 2009)

Log Message:
-----------
Exclude Loom PCE engine specific code, from non-16bit color build.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/charset.cpp
    scummvm/trunk/engines/scumm/charset.h
    scummvm/trunk/engines/scumm/costume.cpp
    scummvm/trunk/engines/scumm/costume.h
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/scumm/gfx.h
    scummvm/trunk/engines/scumm/scumm.cpp

Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/charset.cpp	2009-11-22 11:43:12 UTC (rev 46080)
@@ -620,12 +620,14 @@
 	translateColor();
 }
 
+#ifdef USE_RGB_COLOR
 void CharsetRendererPCE::setColor(byte color) {
 	_vm->setPCETextPalette(color);
 	_color = 15;
 
 	enableShadow(true);
 }
+#endif
 
 void CharsetRendererCommon::enableShadow(bool enable) {
 	if (enable) {
@@ -1076,6 +1078,7 @@
 	}
 }
 
+#ifdef USE_RGB_COLOR
 void CharsetRendererPCE::drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth) {
 	int y, x;
 	int bitCount = 0;
@@ -1109,6 +1112,7 @@
 		dst += s.pitch - width * bitDepth;
 	}
 }
+#endif
 
 #ifdef ENABLE_SCUMM_7_8
 CharsetRendererNut::CharsetRendererNut(ScummEngine *vm)

Modified: scummvm/trunk/engines/scumm/charset.h
===================================================================
--- scummvm/trunk/engines/scumm/charset.h	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/charset.h	2009-11-22 11:43:12 UTC (rev 46080)
@@ -164,6 +164,7 @@
 	int getCharWidth(byte chr);
 };
 
+#ifdef USE_RGB_COLOR
 class CharsetRendererPCE : public CharsetRendererV3 {
 protected:
 	void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth);
@@ -173,6 +174,7 @@
 
 	void setColor(byte color);
 };
+#endif
 
 class CharsetRendererV2 : public CharsetRendererV3 {
 protected:

Modified: scummvm/trunk/engines/scumm/costume.cpp
===================================================================
--- scummvm/trunk/engines/scumm/costume.cpp	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/costume.cpp	2009-11-22 11:43:12 UTC (rev 46080)
@@ -912,6 +912,7 @@
 	_loaded.loadCostume(costume);
 }
 
+#ifdef USE_RGB_COLOR
 void PCEngineCostumeRenderer::setPalette(uint16 *palette) {
 	const byte* ptr = _loaded._palette;
 	byte rgb[45];
@@ -922,6 +923,7 @@
 	for (int i = 0; i < 15; ++i)
 		_palette[i + 1] = _vm->get16BitColor(rgb[i * 3 + 0], rgb[i * 3 + 1], rgb[i * 3 + 2]);
 }
+#endif
 
 void ClassicCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
 	const byte *r;

Modified: scummvm/trunk/engines/scumm/costume.h
===================================================================
--- scummvm/trunk/engines/scumm/costume.h	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/costume.h	2009-11-22 11:43:12 UTC (rev 46080)
@@ -130,12 +130,14 @@
 	byte drawLimb(const Actor *a, int limb);
 };
 
+#ifdef USE_RGB_COLOR
 class PCEngineCostumeRenderer : public ClassicCostumeRenderer {
 public:
 	PCEngineCostumeRenderer(ScummEngine *vm) : ClassicCostumeRenderer(vm) {}
 
 	void setPalette(uint16 *palette);
 };
+#endif
 
 class C64CostumeRenderer : public BaseCostumeRenderer {
 protected:

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2009-11-22 11:43:12 UTC (rev 46080)
@@ -220,6 +220,7 @@
 	memset(&_NES, 0, sizeof(_NES));
 }
 
+#ifdef USE_RGB_COLOR
 GdiPCEngine::GdiPCEngine(ScummEngine *vm) : Gdi(vm) {
 	memset(&_PCE, 0, sizeof(_PCE));
 }
@@ -229,6 +230,7 @@
 	free(_PCE.staffTiles);
 	free(_PCE.masks);
 }
+#endif
 
 GdiV1::GdiV1(ScummEngine *vm) : Gdi(vm) {
 	memset(&_C64, 0, sizeof(_C64));
@@ -242,8 +244,10 @@
 	free(_roomStrips);
 }
 
+#ifdef USE_RGB_COLOR
 Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) {
 }
+#endif
 
 void Gdi::init() {
 	_numStrips = _vm->_screenWidth / 8;
@@ -269,16 +273,20 @@
 	decodeNESGfx(roomptr);
 }
 
+#ifdef USE_RGB_COLOR
 void GdiPCEngine::roomChanged(byte *roomptr) {
 	decodePCEngineGfx(roomptr);
 }
+#endif
 
 void Gdi::loadTiles(byte *roomptr) {
 }
 
+#ifdef USE_RGB_COLOR
 void GdiPCEngine::loadTiles(byte *roomptr) {
 	decodePCEngineTileData(_vm->findResourceData(MKID_BE('TILE'), roomptr));
 }
+#endif
 
 void GdiV1::roomChanged(byte *roomptr) {
 	for (int i = 0; i < 4; i++){
@@ -1457,6 +1465,7 @@
 	}
 }
 
+#ifdef USE_RGB_COLOR
 void GdiPCEngine::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
 					const int x, const int y, const int width, const int height,
 	                int stripnr, int numstrip) {
@@ -1464,6 +1473,7 @@
 		decodePCEngineObject(ptr, x - stripnr, y, width, height);
 	}
 }
+#endif
 
 void GdiV2::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
 					const int x, const int y, const int width, const int height,
@@ -1808,12 +1818,14 @@
 	return false;
 }
 
+#ifdef USE_RGB_COLOR
 bool GdiPCEngine::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width, const int height,
 					int stripnr, const byte *smap_ptr) {
 	byte *mask_ptr = getMaskBuffer(x, y, 1);
 	drawStripPCEngine(dstPtr, mask_ptr, vs->pitch, stripnr, y, height);
 	return false;
 }
+#endif
 
 bool GdiV1::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width, const int height,
 					int stripnr, const byte *smap_ptr) {
@@ -1914,12 +1926,14 @@
 	drawStripNESMask(mask_ptr, stripnr, y, height);
 }
 
+#ifdef USE_RGB_COLOR
 void GdiPCEngine::decodeMask(int x, int y, const int width, const int height,
 	                int stripnr, int numzbuf, const byte *zplane_list[9],
 	                bool transpStrip, byte flag, const byte *tmsk_ptr) {
 	byte *mask_ptr = getMaskBuffer(x, y, 1);
 	drawStripPCEngineMask(mask_ptr, stripnr, y, height);
 }
+#endif
 
 void GdiV1::decodeMask(int x, int y, const int width, const int height,
 	                int stripnr, int numzbuf, const byte *zplane_list[9],
@@ -2623,6 +2637,7 @@
 	}
 }
 
+#ifdef USE_RGB_COLOR
 void readOffsetTable(const byte *ptr, uint16 **table, int *count) {
 	int pos = 0;
 	*count = READ_LE_UINT16(ptr) / 2 + 1;
@@ -2940,6 +2955,7 @@
 		}
 	}
 }
+#endif
 
 void GdiV1::drawStripC64Background(byte *dst, int dstPitch, int stripnr, int height) {
 	int charIdx;
@@ -3558,9 +3574,11 @@
 #undef NEXT_ROW
 #undef READ_BIT_256
 
+#ifdef USE_RGB_COLOR
 void Gdi16Bit::writeRoomColor(byte *dst, byte color) const {
 	WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
 }
+#endif
 
 void Gdi::writeRoomColor(byte *dst, byte color) const {
 	// As described in bug #1294513 "FOA/Amiga: Palette problem (Regression)"

Modified: scummvm/trunk/engines/scumm/gfx.h
===================================================================
--- scummvm/trunk/engines/scumm/gfx.h	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/gfx.h	2009-11-22 11:43:12 UTC (rev 46080)
@@ -305,6 +305,7 @@
 	virtual void roomChanged(byte *roomptr);
 };
 
+#ifdef USE_RGB_COLOR
 class GdiPCEngine : public Gdi {
 protected:
 	struct {
@@ -347,6 +348,7 @@
 	virtual void loadTiles(byte *roomptr);
 	virtual void roomChanged(byte *roomptr);
 };
+#endif
 
 class GdiV1 : public Gdi {
 protected:
@@ -409,12 +411,14 @@
 	virtual void roomChanged(byte *roomptr);
 };
 
+#ifdef USE_RGB_COLOR
 class Gdi16Bit : public Gdi {
 protected:
 	virtual void writeRoomColor(byte *dst, byte color) const;
 public:
 	Gdi16Bit(ScummEngine *vm);
 };
+#endif
 
 } // End of namespace Scumm
 

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2009-11-22 11:36:30 UTC (rev 46079)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2009-11-22 11:43:12 UTC (rev 46080)
@@ -113,10 +113,13 @@
 
 	if (_game.platform == Common::kPlatformNES) {
 		_gdi = new GdiNES(this);
-	} else if (_game.platform == Common::kPlatformPCEngine) {
-		_gdi = new GdiPCEngine(this);
+#ifdef USE_RGB_COLOR
 	} else if (_game.features & GF_16BIT_COLOR) {
-		_gdi = new Gdi16Bit(this);
+		if (_game.platform == Common::kPlatformPCEngine)
+			_gdi = new GdiPCEngine(this);
+		else
+			_gdi = new Gdi16Bit(this);
+#endif
 	} else if (_game.version <= 1) {
 		_gdi = new GdiV1(this);
 	} else if (_game.version == 2) {
@@ -1270,9 +1273,11 @@
 		else
 			_charset = new CharsetRendererV2(this, _language);
 	} else if (_game.version == 3) {
+#ifdef USE_RGB_COLOR
 		if (_game.platform == Common::kPlatformPCEngine)
 			_charset = new CharsetRendererPCE(this);
 		else
+#endif
 			_charset = new CharsetRendererV3(this);
 #ifdef ENABLE_SCUMM_7_8
 	} else if (_game.version == 8) {
@@ -1293,9 +1298,11 @@
 	} else if (_game.platform == Common::kPlatformNES) {
 		_costumeRenderer = new NESCostumeRenderer(this);
 		_costumeLoader = new NESCostumeLoader(this);
+#ifdef USE_RGB_COLOR
 	} else if (_game.platform == Common::kPlatformPCEngine) {
 		_costumeRenderer = new PCEngineCostumeRenderer(this);
 		_costumeLoader = new ClassicCostumeLoader(this);
+#endif
 	} else {
 		_costumeRenderer = new ClassicCostumeRenderer(this);
 		_costumeLoader = new ClassicCostumeLoader(this);


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