aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/palette32.h
diff options
context:
space:
mode:
authorColin Snover2017-07-03 20:12:39 -0500
committerColin Snover2017-07-06 19:12:38 -0500
commit7057f232d75732c320fb470a8632a4c2f055a47f (patch)
treefe9bb0cb48530eee2c6a35fd911240e46efcce21 /engines/sci/graphics/palette32.h
parent8cb35442c073b5ed5a0f3fa7d5e627bdd85af229 (diff)
downloadscummvm-rg350-7057f232d75732c320fb470a8632a4c2f055a47f.tar.gz
scummvm-rg350-7057f232d75732c320fb470a8632a4c2f055a47f.tar.bz2
scummvm-rg350-7057f232d75732c320fb470a8632a4c2f055a47f.zip
SCI32: Improve kPlayVMD rendering
1. Added a new game option for linear interpolation when scaling overlay-mode video in ScummVM builds with USE_RGB_COLOR; 2. Implemented SCI2.1-variant of the VMD player renderer (fixes Trac#9857), which bypasses the engine's normal rendering pipeline; 3. Improved accuracy of the SCI3-variant of the VMD player by writing HunkPalettes into the VMD's CelObjMem instead of submitting palettes directly to GfxPalette32.
Diffstat (limited to 'engines/sci/graphics/palette32.h')
-rw-r--r--engines/sci/graphics/palette32.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/sci/graphics/palette32.h b/engines/sci/graphics/palette32.h
index fb0b226130..b8ba85eb4a 100644
--- a/engines/sci/graphics/palette32.h
+++ b/engines/sci/graphics/palette32.h
@@ -37,6 +37,16 @@ class HunkPalette {
public:
HunkPalette(const SciSpan<const byte> &rawPalette);
+ static void write(SciSpan<byte> &out, const Palette &palette);
+
+ static uint32 calculateHunkPaletteSize(const uint16 numIndexes = 256, const bool sharedUsed = true) {
+ const int numPalettes = 1;
+ return kHunkPaletteHeaderSize +
+ /* slack bytes between hunk header & palette offset table */ 2 +
+ /* palette offset table */ 2 * numPalettes +
+ /* palette data */ (kEntryHeaderSize + numIndexes * (/* RGB */ 3 + !sharedUsed)) * numPalettes;
+ }
+
/**
* Gets the version of the palette. Used to avoid resubmitting a HunkPalette
* which has already been submitted for the next frame.
@@ -237,6 +247,14 @@ public:
*/
inline const Palette &getCurrentPalette() const { return _currentPalette; };
+#ifdef USE_RGB_COLOR
+ /**
+ * Gets the raw hardware palette in RGB format. This should be used instead
+ * of `::PaletteManager::grabPalette` when the OSystem screen is >8bpp.
+ */
+ inline const uint8 *getHardwarePalette() const { return _hardwarePalette; };
+#endif
+
/**
* Loads a palette into GfxPalette32 with the given resource ID.
*/
@@ -288,6 +306,15 @@ private:
*/
bool _needsUpdate;
+#ifdef USE_RGB_COLOR
+ /**
+ * A local copy of the hardware palette. Used when the backend is in a true
+ * color mode and a change to the game's internal framebuffer occurs that
+ * needs to be reconverted from 8bpp to the backend's bit depth.
+ */
+ uint8 _hardwarePalette[256 * 3];
+#endif
+
/**
* The currently displayed palette.
*/