mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
Exclude Loom PCE engine specific code, from non-16bit color build.
svn-id: r46080
This commit is contained in:
parent
6c2cc3e1bb
commit
bb0c765731
@ -620,12 +620,14 @@ void CharsetRendererV3::setColor(byte color) {
|
||||
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 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
|
||||
}
|
||||
}
|
||||
|
||||
#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 @@ void CharsetRendererPCE::drawBits1(const Graphics::Surface &s, byte *dst, const
|
||||
dst += s.pitch - width * bitDepth;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SCUMM_7_8
|
||||
CharsetRendererNut::CharsetRendererNut(ScummEngine *vm)
|
||||
|
@ -164,6 +164,7 @@ public:
|
||||
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 @@ public:
|
||||
|
||||
void setColor(byte color);
|
||||
};
|
||||
#endif
|
||||
|
||||
class CharsetRendererV2 : public CharsetRendererV3 {
|
||||
protected:
|
||||
|
@ -912,6 +912,7 @@ void NESCostumeRenderer::setCostume(int costume, int shadow) {
|
||||
_loaded.loadCostume(costume);
|
||||
}
|
||||
|
||||
#ifdef USE_RGB_COLOR
|
||||
void PCEngineCostumeRenderer::setPalette(uint16 *palette) {
|
||||
const byte* ptr = _loaded._palette;
|
||||
byte rgb[45];
|
||||
@ -922,6 +923,7 @@ void PCEngineCostumeRenderer::setPalette(uint16 *palette) {
|
||||
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;
|
||||
|
@ -130,12 +130,14 @@ protected:
|
||||
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:
|
||||
|
@ -220,6 +220,7 @@ GdiNES::GdiNES(ScummEngine *vm) : Gdi(vm) {
|
||||
memset(&_NES, 0, sizeof(_NES));
|
||||
}
|
||||
|
||||
#ifdef USE_RGB_COLOR
|
||||
GdiPCEngine::GdiPCEngine(ScummEngine *vm) : Gdi(vm) {
|
||||
memset(&_PCE, 0, sizeof(_PCE));
|
||||
}
|
||||
@ -229,6 +230,7 @@ GdiPCEngine::~GdiPCEngine() {
|
||||
free(_PCE.staffTiles);
|
||||
free(_PCE.masks);
|
||||
}
|
||||
#endif
|
||||
|
||||
GdiV1::GdiV1(ScummEngine *vm) : Gdi(vm) {
|
||||
memset(&_C64, 0, sizeof(_C64));
|
||||
@ -242,8 +244,10 @@ GdiV2::~GdiV2() {
|
||||
free(_roomStrips);
|
||||
}
|
||||
|
||||
#ifdef USE_RGB_COLOR
|
||||
Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void Gdi::init() {
|
||||
_numStrips = _vm->_screenWidth / 8;
|
||||
@ -269,16 +273,20 @@ void GdiNES::roomChanged(byte *roomptr) {
|
||||
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 @@ void GdiNES::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
|
||||
}
|
||||
}
|
||||
|
||||
#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 @@ void GdiPCEngine::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
|
||||
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 @@ bool GdiNES::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int wid
|
||||
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 @@ void GdiNES::decodeMask(int x, int y, const int width, const int height,
|
||||
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 @@ void GdiNES::drawStripNESMask(byte *dst, int stripnr, int top, int height) const
|
||||
}
|
||||
}
|
||||
|
||||
#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 @@ void GdiPCEngine::drawStripPCEngineMask(byte *dst, int stripnr, int top, int hei
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void GdiV1::drawStripC64Background(byte *dst, int dstPitch, int stripnr, int height) {
|
||||
int charIdx;
|
||||
@ -3558,9 +3574,11 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons
|
||||
#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)"
|
||||
|
@ -305,6 +305,7 @@ public:
|
||||
virtual void roomChanged(byte *roomptr);
|
||||
};
|
||||
|
||||
#ifdef USE_RGB_COLOR
|
||||
class GdiPCEngine : public Gdi {
|
||||
protected:
|
||||
struct {
|
||||
@ -347,6 +348,7 @@ public:
|
||||
virtual void loadTiles(byte *roomptr);
|
||||
virtual void roomChanged(byte *roomptr);
|
||||
};
|
||||
#endif
|
||||
|
||||
class GdiV1 : public Gdi {
|
||||
protected:
|
||||
@ -409,12 +411,14 @@ public:
|
||||
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
|
||||
|
||||
|
@ -113,10 +113,13 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
|
||||
|
||||
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 @@ void ScummEngine::setupCharsetRenderer() {
|
||||
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 @@ void ScummEngine::setupCostumeRenderer() {
|
||||
} 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user