mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
FREESCAPE: better rendering of EGA colors in castle
This commit is contained in:
1 parent
8473046fc8
commit
46667ccddc
5 files changed
+56
-11
No files matched your search
@@ -80,6 +80,7 @@ public:
|
||||
uint8 _underFireBackgroundColor;
|
||||
uint8 _inkColor;
|
||||
uint8 _paperColor;
|
||||
uint8 _extraColor[4];
|
||||
ColorReMap _colorRemaps;
|
||||
|
||||
private:
|
||||
|
||||
@@ -194,6 +194,28 @@ void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
|
||||
_gfx->_keyColor = 0;
|
||||
} else
|
||||
_gfx->_keyColor = 255;
|
||||
|
||||
_lastPosition = _position;
|
||||
_gameStateVars[0x1f] = 0;
|
||||
|
||||
if (areaID == _startArea && entranceID == _startEntrance) {
|
||||
_yaw = 310;
|
||||
_pitch = 0;
|
||||
}
|
||||
|
||||
debugC(1, kFreescapeDebugMove, "starting player position: %f, %f, %f", _position.x(), _position.y(), _position.z());
|
||||
clearTemporalMessages();
|
||||
playSound(5, false);
|
||||
// Ignore sky/ground fields
|
||||
_gfx->_keyColor = 0;
|
||||
|
||||
_gfx->_colorPair[_currentArea->_underFireBackgroundColor] = _currentArea->_extraColor[0];
|
||||
_gfx->_colorPair[_currentArea->_usualBackgroundColor] = _currentArea->_extraColor[1];
|
||||
_gfx->_colorPair[_currentArea->_paperColor] = _currentArea->_extraColor[2];
|
||||
_gfx->_colorPair[_currentArea->_inkColor] = _currentArea->_extraColor[3];
|
||||
|
||||
swapPalette(areaID);
|
||||
resetInput();
|
||||
}
|
||||
|
||||
void CastleEngine::drawUI() {
|
||||
|
||||
@@ -361,8 +361,7 @@ bool Renderer::getRGBAtCPC(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Renderer::getRGBAtEGA(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &r2, uint8 &g2, uint8 &b2) {
|
||||
// assert(index-1 < _colorMap->size());
|
||||
uint8 Renderer::mapEGAColor(uint8 index) {
|
||||
byte *entry = (*_colorMap)[index - 1];
|
||||
uint8 color = 0;
|
||||
uint8 acc = 1;
|
||||
@@ -376,10 +375,23 @@ bool Renderer::getRGBAtEGA(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &
|
||||
entry++;
|
||||
}
|
||||
assert(color < 16);
|
||||
readFromPalette(color, r1, g1, b1);
|
||||
r2 = r1;
|
||||
g2 = g1;
|
||||
b2 = b1;
|
||||
return color;
|
||||
}
|
||||
|
||||
bool Renderer::getRGBAtEGA(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &r2, uint8 &g2, uint8 &b2) {
|
||||
uint8 color;
|
||||
if (_colorPair[index] > 0) {
|
||||
color = mapEGAColor(_colorPair[index] & 0xf);
|
||||
readFromPalette(color, r1, g1, b1);
|
||||
color = mapEGAColor(_colorPair[index] >> 4);
|
||||
readFromPalette(color, r2, g2, b2);
|
||||
} else {
|
||||
color = mapEGAColor(index);
|
||||
readFromPalette(color, r1, g1, b1);
|
||||
r2 = r1;
|
||||
g2 = g1;
|
||||
b2 = b1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ public:
|
||||
// palette
|
||||
void readFromPalette(uint8 index, uint8 &r, uint8 &g, uint8 &b);
|
||||
uint8 indexFromColor(uint8 r, uint8 g, uint8 b);
|
||||
uint8 mapEGAColor(uint8 index);
|
||||
|
||||
bool getRGBAt(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &r2, uint8 &g2, uint8 &b2, byte *&stipple);
|
||||
bool getRGBAtC64(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &r2, uint8 &g2, uint8 &b2);
|
||||
bool getRGBAtCGA(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &r2, uint8 &g2, uint8 &b2, byte *&stipple);
|
||||
|
||||
@@ -438,10 +438,12 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
|
||||
// debug("Condition Ptr: %x", cPtr);
|
||||
debugC(1, kFreescapeDebugParser, "Pos before first object: %lx", file->pos());
|
||||
|
||||
// Driller specific
|
||||
uint8 gasPocketX = 0;
|
||||
uint8 gasPocketY = 0;
|
||||
uint8 gasPocketRadius = 0;
|
||||
|
||||
// Castle specific
|
||||
uint8 extraColor[4];
|
||||
if (isEclipse()) {
|
||||
byte idx = file->readByte();
|
||||
name = idx < 8 ? eclipseRoomName[idx] : eclipseRoomName[8];
|
||||
@@ -471,10 +473,10 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
|
||||
} else if (isCastle()) {
|
||||
byte idx = file->readByte();
|
||||
name = _messagesList[idx + 41];
|
||||
debug("byte: %d", file->readByte());
|
||||
debug("byte: %d", file->readByte());
|
||||
debug("byte: %d", file->readByte());
|
||||
debug("byte: %d", file->readByte());
|
||||
extraColor[0] = file->readByte();
|
||||
extraColor[1] = file->readByte();
|
||||
extraColor[2] = file->readByte();
|
||||
extraColor[3] = file->readByte();
|
||||
}
|
||||
debugC(1, kFreescapeDebugParser, "Area name: %s", name.c_str());
|
||||
|
||||
@@ -511,11 +513,17 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
|
||||
area->_scale = scale;
|
||||
area->_skyColor = skyColor;
|
||||
area->_groundColor = groundColor;
|
||||
|
||||
area->_inkColor = inkColor;
|
||||
area->_paperColor = paperColor;
|
||||
area->_usualBackgroundColor = usualBackgroundColor;
|
||||
area->_underFireBackgroundColor = underFireBackgroundColor;
|
||||
|
||||
area->_extraColor[0] = extraColor[0];
|
||||
area->_extraColor[1] = extraColor[1];
|
||||
area->_extraColor[2] = extraColor[2];
|
||||
area->_extraColor[3] = extraColor[3];
|
||||
|
||||
// Driller specific
|
||||
area->_gasPocketPosition = Common::Point(32 * gasPocketX, 32 * gasPocketY);
|
||||
area->_gasPocketRadius = 32 * gasPocketRadius;
|
||||
|
||||
Reference in new issue
Block a user