aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen_lol.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-06-25 15:22:08 +0000
committerJohannes Schickel2009-06-25 15:22:08 +0000
commit0ef8d1ffed66d6677b0dff850e4d35d745e93aee (patch)
treef040e0c1f12f356f3459d8a246737754886bdbaf /engines/kyra/screen_lol.cpp
parent8343bc6cc05dfbc8480306cfb60fe8cde593deb5 (diff)
downloadscummvm-rg350-0ef8d1ffed66d6677b0dff850e4d35d745e93aee.tar.gz
scummvm-rg350-0ef8d1ffed66d6677b0dff850e4d35d745e93aee.tar.bz2
scummvm-rg350-0ef8d1ffed66d6677b0dff850e4d35d745e93aee.zip
Implement proper color index conversion for Lands of Lore PC98. (The intro and menu screen work fine now)
svn-id: r41867
Diffstat (limited to 'engines/kyra/screen_lol.cpp')
-rw-r--r--engines/kyra/screen_lol.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp
index e66c1d4a4a..54d64aa71c 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -971,6 +971,30 @@ uint8 Screen_LoL::getShapePaletteSize(const uint8 *shp) {
return shp[10];
}
+void Screen_LoL::mergeOverlay(int x, int y, int w, int h) {
+ // For now we convert to 16 colors on overlay merging. If that gives
+ // any problems, like Screen functionallity not prepared for the
+ // format PC98 16 color uses, we'll need to think of a better way.
+ //
+ // We must do this before merging the overlay, else the font colors
+ // will be wrong.
+ if (_use16ColorMode)
+ convertPC98Gfx(_sjisOverlayPtrs[0] + y * 640 + x, w, h, 640);
+
+ Screen_v2::mergeOverlay(x, y, w, h);
+}
+
+void Screen_LoL::convertPC98Gfx(uint8 *data, int w, int h, int pitch) {
+ while (h--) {
+ for (int i = 0; i < w; ++i) {
+ *data = _paletteConvTable[*data];
+ ++data;
+ }
+
+ data += pitch - w;
+ }
+}
+
} // end of namespace Kyra
#endif // ENABLE_LOL