aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2012-02-24 15:48:06 +0100
committerathrxx2012-02-24 18:09:39 +0100
commit30fa5e166379b9e0764b437c6925c22d908d7122 (patch)
treef129f4bf8c07e779a60a269e96fedd5ee2cfaac0
parent3b574466fa3cb28c521234f5460164ade91a8d50 (diff)
downloadscummvm-rg350-30fa5e166379b9e0764b437c6925c22d908d7122.tar.gz
scummvm-rg350-30fa5e166379b9e0764b437c6925c22d908d7122.tar.bz2
scummvm-rg350-30fa5e166379b9e0764b437c6925c22d908d7122.zip
KYRA: (EOB) - fix save file thumbnail generation in CGA/EGA mode
-rw-r--r--engines/kyra/gui_eob.cpp9
-rw-r--r--engines/kyra/screen.h2
-rw-r--r--engines/kyra/screen_eob.cpp15
-rw-r--r--engines/kyra/screen_eob.h1
4 files changed, 25 insertions, 2 deletions
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index ec9b674885..e8e69d5b1f 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -2648,7 +2648,14 @@ bool GUI_EoB::transferFileMenu(Common::String &targetName, Common::String &selec
void GUI_EoB::createScreenThumbnail(Graphics::Surface &dst) {
uint8 *screenPal = new uint8[768];
_screen->getRealPalette(0, screenPal);
- ::createThumbnail(&dst, _screen->getCPagePtr(7), Screen::SCREEN_W, Screen::SCREEN_H, screenPal);
+ uint16 width = Screen::SCREEN_W;
+ uint16 height = Screen::SCREEN_H;
+ if (_vm->_useHiResDithering) {
+ width <<= 1;
+ height <<= 1;
+ }
+
+ ::createThumbnail(&dst, _screen->getCPagePtr(7), width, height, screenPal);
delete[] screenPal;
}
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 4f7f6d49ed..a0cf5742c6 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -452,7 +452,7 @@ public:
void enableInterfacePalette(bool e);
void setInterfacePalette(const Palette &pal, uint8 r, uint8 g, uint8 b);
- void getRealPalette(int num, uint8 *dst);
+ virtual void getRealPalette(int num, uint8 *dst);
Palette &getPalette(int num);
void copyPalette(const int dst, const int src);
diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp
index dc53e8aca5..9fae729bc4 100644
--- a/engines/kyra/screen_eob.cpp
+++ b/engines/kyra/screen_eob.cpp
@@ -422,6 +422,21 @@ void Screen_EoB::setScreenPalette(const Palette &pal) {
}
}
+void Screen_EoB::getRealPalette(int num, uint8 *dst) {
+ if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderEGA) {
+ const uint8 *pal = _screenPalette->getData();
+ for (int i = 0; i < 16; ++i) {
+ dst[0] = (pal[0] << 2) | (pal[0] & 3);
+ dst[1] = (pal[1] << 2) | (pal[1] & 3);
+ dst[2] = (pal[2] << 2) | (pal[2] & 3);
+ dst += 3;
+ pal += 3;
+ }
+ } else {
+ Screen::getRealPalette(num, dst);
+ }
+}
+
uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool encode8bit, const uint8 *cgaMapping) {
uint8 *shp = 0;
uint16 shapesize = 0;
diff --git a/engines/kyra/screen_eob.h b/engines/kyra/screen_eob.h
index 92de5c8b38..fc40cfe903 100644
--- a/engines/kyra/screen_eob.h
+++ b/engines/kyra/screen_eob.h
@@ -59,6 +59,7 @@ public:
void setPagePixel(int pageNum, int x, int y, uint8 color);
void setScreenPalette(const Palette &pal);
+ void getRealPalette(int num, uint8 *dst);
uint8 *encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool encode8bit = false, const uint8 *cgaMapping = 0);
void drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd = -1, int flags = 0, ...);