aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.h
diff options
context:
space:
mode:
authorFlorian Kagerer2010-10-01 19:24:52 +0000
committerFlorian Kagerer2010-10-01 19:24:52 +0000
commit0d8f4a22ae51d5943014a4c5f3ba610686039a24 (patch)
tree4f2ba902f2681c10f1f9949efc9424bcc93e14c1 /engines/scumm/gfx.h
parentbe1d196da5dbbabaef0bfa835b51e9c82c407645 (diff)
downloadscummvm-rg350-0d8f4a22ae51d5943014a4c5f3ba610686039a24.tar.gz
scummvm-rg350-0d8f4a22ae51d5943014a4c5f3ba610686039a24.tar.bz2
scummvm-rg350-0d8f4a22ae51d5943014a4c5f3ba610686039a24.zip
SCUMM/FM-TOWNS: fix palette and other graphics issues
This commit should fix at least the following bugs/feature requests: #1032859, #1252088, #1055391, #1315968, #1315938, #1742106, #812891. The FM-Towns version of Scumm games use a mixed graphics mode with 2 layers (one with 32767 colors and one with 16 colors). Among other things I have added a screen output class which emulates this dual layer approach which allows specific hardware effects like enabling and disabling layers (e.g. in the voodoo priestess scene in MI1). Old savegames (saved before this update) will load, but you’ll encounter palette glitches in the verb/inventory screen, since the 16 color palette for layer 2 is not contained in your savegame. This will be true at least for version 5 games. Certain scene change actions (which require the verb/inventory part to be redrawn) might correct this (e.g. try looking at the treasure map in MI1 and closing it). Version 3 games should be okay, since they use a static text palette which is never changed and which will be reset after loading a savegame. This update requires a USE_RGB_COLORS setting for proper operation. 8 bit users will get a warning that they’ll have to expect palette glitches . Apart from that the engine in 8 bit mode should not only still work okay, but also benefit from some of the other (non palette related) improvements (e.g. bug #1032859 should be fixed even in 8 bit mode). Japanese font drawing hasn’t been improved much yet. This will be a separate task. svn-id: r52966
Diffstat (limited to 'engines/scumm/gfx.h')
-rw-r--r--engines/scumm/gfx.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index cdb473a67c..b4b6309f51 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -26,6 +26,9 @@
#ifndef SCUMM_GFX_H
#define SCUMM_GFX_H
+#include "common/system.h"
+#include "common/list.h"
+
#include "graphics/surface.h"
namespace Scumm {
@@ -421,6 +424,64 @@ public:
};
#endif
+// Helper class for FM-Towns output (required for specific hardware effects like
+// switching graphics layers on and off).
+
+class TownsScreen {
+public:
+ TownsScreen(OSystem *system, int width, int height, int bpp);
+ ~TownsScreen();
+
+ void setupLayer(int layer, int width, int height, int numCol, void *srcPal = 0);
+ void clearLayer(int layer);
+ void fillLayerRect(int layer, int x, int y, int w, int h, int col);
+ //void copyRectToLayer(int layer, int x, int y, int w, int h, const uint8 *src);
+
+ uint8 *getLayerPixels(int layer, int x, int y);
+ int getLayerPitch(int layer);
+ int getLayerHeight(int layer);
+ int getLayerBpp(int layer);
+ int getLayerScaleW(int layer);
+ int getLayerScaleH(int layer);
+
+ void addDirtyRect(int x, int y, int w, int h);
+ void toggleLayers(int flag);
+ void update();
+
+private:
+ void updateOutputBuffer();
+ void outputToScreen();
+ uint16 calc16BitColor(const uint8 *palEntry);
+
+ struct TownsScreenLayer {
+ uint8 *pixels;
+ uint8 *palette;
+ int pitch;
+ int height;
+ int bpp;
+ int numCol;
+ uint8 scaleW;
+ uint8 scaleH;
+ bool onBottom;
+ bool enabled;
+ bool ready;
+
+ uint16 *bltInternX;
+ uint8 **bltInternY;
+ } _layers[2];
+
+ uint8 *_outBuffer;
+
+ int _height;
+ int _width;
+ int _pitch;
+ int _bpp;
+
+ int _numDirtyRects;
+ Common::List<Common::Rect> _dirtyRects;
+ OSystem *_system;
+};
+
} // End of namespace Scumm
#endif