aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen_eob.cpp
diff options
context:
space:
mode:
authorathrxx2012-02-23 21:36:14 +0100
committerathrxx2012-02-24 18:09:37 +0100
commitecd1a9f9435c5fc5d502d75dd256394b5f3283f3 (patch)
tree273d3539e296960e617380c0648826e5332e77ca /engines/kyra/screen_eob.cpp
parent14e6a5f8f7c7e3ac0d70ca4d59032954353fc823 (diff)
downloadscummvm-rg350-ecd1a9f9435c5fc5d502d75dd256394b5f3283f3.tar.gz
scummvm-rg350-ecd1a9f9435c5fc5d502d75dd256394b5f3283f3.tar.bz2
scummvm-rg350-ecd1a9f9435c5fc5d502d75dd256394b5f3283f3.zip
KYRA: (EOB) - cleanup CGA/EGA code a bit
Diffstat (limited to 'engines/kyra/screen_eob.cpp')
-rw-r--r--engines/kyra/screen_eob.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp
index 38521d757c..dc53e8aca5 100644
--- a/engines/kyra/screen_eob.cpp
+++ b/engines/kyra/screen_eob.cpp
@@ -55,7 +55,7 @@ Screen_EoB::Screen_EoB(EoBCoreEngine *vm, OSystem *system) : Screen(vm, system,
_egaPixelValueTable = 0;
_cgaMappingDefault = 0;
_cgaDitheringTables[0] = _cgaDitheringTables[1] = 0;
- _useHiResEGADithering = false;
+ _useLoResEGA = _useHiResEGADithering = false;
}
Screen_EoB::~Screen_EoB() {
@@ -69,12 +69,8 @@ Screen_EoB::~Screen_EoB() {
}
bool Screen_EoB::init() {
- return init(false);
-}
-
-bool Screen_EoB::init(bool useHiResEGADithering) {
// Define hi-res pages for EGA mode in EOB II
- if (useHiResEGADithering) {
+ if (_vm->gameFlags().useHiRes) {
for (int i = 0; i < 8; i++)
_pageScaleFactor[i] = 2;
}
@@ -99,15 +95,16 @@ bool Screen_EoB::init(bool useHiResEGADithering) {
_dsTempPage = new uint8[12000];
- if (_renderMode == Common::kRenderEGA) {
- _useHiResEGADithering = useHiResEGADithering;
+ if (_vm->gameFlags().useHiRes && _renderMode == Common::kRenderEGA) {
+ _useHiResEGADithering = true;
_egaDitheringTable = new uint8[256];
_egaPixelValueTable = new uint8[256];
for (int i = 0; i < 256; i++) {
_egaDitheringTable[i] = i & 0x0f;
_egaPixelValueTable[i] = i & 0x0f;
}
-
+ } else if (_renderMode == Common::kRenderEGA) {
+ _useLoResEGA = true;
} else if (_renderMode == Common::kRenderCGA) {
_cgaMappingDefault = _vm->staticres()->loadRawData(kEoB1CgaMappingDefault, temp);
_cgaDitheringTables[0] = new uint16[256];
@@ -432,7 +429,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint8 *srcLineStart = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
uint8 *src = srcLineStart;
- if (_renderMode == Common::kRenderEGA && !_useHiResEGADithering)
+ if (_useLoResEGA)
encode8bit = false;
if (_renderMode == Common::kRenderCGA) {
@@ -556,7 +553,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
*dst++ = (w & 0xff);
*dst++ = (h & 0xff);
- if (_renderMode == Common::kRenderEGA && !_useHiResEGADithering) {
+ if (_useLoResEGA) {
for (int i = 0; i < 16; i++)
dst[i] = i;
} else {
@@ -1538,6 +1535,7 @@ OldDOSFont::OldDOSFont(Common::RenderMode mode, bool useHiResEGADithering) : _re
_data = 0;
_width = _height = _numGlyphs = 0;
_bitmapOffsets = 0;
+ _useLoResEGA = (_renderMode == Common::kRenderEGA && !_useHiResEGADithering);
_numRef++;
if (!_cgaDitheringTable && _numRef == 1) {
@@ -1664,7 +1662,7 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
uint16 cgaMask1 = cgaColorMask[color1 & 3];
uint16 cgaMask2 = cgaColorMask[color2 & 3];
- if (_renderMode == Common::kRenderCGA || (_renderMode == Common::kRenderEGA && !_useHiResEGADithering)) {
+ if (_renderMode == Common::kRenderCGA || _useLoResEGA) {
color1 &= 0x0f;
color2 &= 0x0f;
}