From 8447a3650e7de2fc780c1c354f70bf0d119622b3 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 3 Jun 2009 23:36:23 +0000
Subject: Applying the temporary 16-bit SDL hack.
svn-id: r41152
---
backends/platform/sdl/graphics.cpp | 96 +++++++++++++++++++++++++++++++++++++-
backends/platform/sdl/sdl.cpp | 3 ++
backends/platform/sdl/sdl.h | 3 ++
dists/msvc8/scummvm.vcproj | 10 +++-
4 files changed, 108 insertions(+), 4 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 78b8bd8c63..389a7a0735 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -407,6 +407,20 @@ bool OSystem_SDL::loadGFXMode() {
}
}
+#ifdef ENABLE_16BIT
+ //
+ // Create the surface that contains the 16 bit game data
+ //
+ _screen16 = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
+ 16,
+ 0x7C00,
+ 0x3E0,
+ 0x1F,
+ 0); //555, not 565
+ if (_screen16 == NULL)
+ error("allocating _screen16 failed");
+#endif
+
//
// Create the surface used for the graphics in 16 bit before scaling, and also the overlay
//
@@ -484,10 +498,17 @@ bool OSystem_SDL::loadGFXMode() {
}
void OSystem_SDL::unloadGFXMode() {
+#ifdef ENABLE_16BIT
+ if (_screen16) {
+ SDL_FreeSurface(_screen16);
+ _screen16 = NULL;
+ }
+#else
if (_screen) {
SDL_FreeSurface(_screen);
_screen = NULL;
}
+#endif
if (_hwscreen) {
SDL_FreeSurface(_hwscreen);
@@ -519,14 +540,23 @@ void OSystem_SDL::unloadGFXMode() {
}
bool OSystem_SDL::hotswapGFXMode() {
+#ifdef ENABLE_16BIT
+ if (!_screen16)
+#else
if (!_screen)
+#endif
return false;
// Keep around the old _screen & _overlayscreen so we can restore the screen data
// after the mode switch.
+#ifdef ENABLE_16BIT
+ SDL_Surface *old_screen = _screen16;
+ _screen16 = NULL;
+#else
SDL_Surface *old_screen = _screen;
- SDL_Surface *old_overlayscreen = _overlayscreen;
_screen = NULL;
+#endif
+ SDL_Surface *old_overlayscreen = _overlayscreen;
_overlayscreen = NULL;
// Release the HW screen surface
@@ -544,7 +574,11 @@ bool OSystem_SDL::hotswapGFXMode() {
if (!loadGFXMode()) {
unloadGFXMode();
+#ifdef ENABLE_16BIT
+ _screen16 = old_screen;
+#else
_screen = old_screen;
+#endif
_overlayscreen = old_overlayscreen;
return false;
@@ -554,7 +588,11 @@ bool OSystem_SDL::hotswapGFXMode() {
SDL_SetColors(_screen, _currentPalette, 0, 256);
// Restore old screen content
+#ifdef ENABLE_16BIT
+ SDL_BlitSurface(old_screen, NULL, _screen16, NULL);
+#else
SDL_BlitSurface(old_screen, NULL, _screen, NULL);
+#endif
SDL_BlitSurface(old_overlayscreen, NULL, _overlayscreen, NULL);
// Free the old surfaces
@@ -636,7 +674,11 @@ void OSystem_SDL::internUpdateScreen() {
#endif
if (!_overlayVisible) {
+#ifdef ENABLE_16BIT
+ origSurf = _screen16;
+#else
origSurf = _screen;
+#endif
srcSurf = _tmpscreen;
width = _videoMode.screenWidth;
height = _videoMode.screenHeight;
@@ -781,6 +823,12 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
assert (_transactionMode == kTransactionNone);
assert(src);
+#ifdef ENABLE_16BIT
+ if (_screen16 == NULL) {
+ warning("OSystem_SDL::copyRectToScreen: _screen16 == NULL");
+ return;
+ }
+#endif
if (_screen == NULL) {
warning("OSystem_SDL::copyRectToScreen: _screen == NULL");
return;
@@ -829,11 +877,29 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
}
// Try to lock the screen surface
+#ifdef ENABLE_16BIT
+ if (SDL_LockSurface(_screen16) == -1)
+#else
if (SDL_LockSurface(_screen) == -1)
+#endif
error("SDL_LockSurface failed: %s", SDL_GetError());
- byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth + x;
+#ifdef ENABLE_16BIT
+ byte *dst = (byte *)_screen16->pixels + y * _videoMode.screenWidth * 2 + x * 2;
+ if (_videoMode.screenWidth == w && pitch == w * 2) {
+ memcpy(dst, src, h*w*2);
+ } else {
+ do {
+ memcpy(dst, src, w * 2);
+ src += pitch;
+ dst += _videoMode.screenWidth * 2;
+ } while (--h);
+ }
+ // Unlock the screen surface
+ SDL_UnlockSurface(_screen16);
+#else
+ byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth + x;
if (_videoMode.screenWidth == pitch && pitch == w) {
memcpy(dst, src, h*w);
} else {
@@ -846,6 +912,7 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
// Unlock the screen surface
SDL_UnlockSurface(_screen);
+#endif
}
Graphics::Surface *OSystem_SDL::lockScreen() {
@@ -859,14 +926,26 @@ Graphics::Surface *OSystem_SDL::lockScreen() {
_screenIsLocked = true;
// Try to lock the screen surface
+#ifdef ENABLE_16BIT
+ if (SDL_LockSurface(_screen16) == -1)
+#else
if (SDL_LockSurface(_screen) == -1)
+#endif
error("SDL_LockSurface failed: %s", SDL_GetError());
+#ifdef ENABLE_16BIT
+ _framebuffer.pixels = _screen16->pixels;
+ _framebuffer.w = _screen16->w;
+ _framebuffer.h = _screen16->h;
+ _framebuffer.pitch = _screen16->pitch;
+ _framebuffer.bytesPerPixel = 2;
+#else
_framebuffer.pixels = _screen->pixels;
_framebuffer.w = _screen->w;
_framebuffer.h = _screen->h;
_framebuffer.pitch = _screen->pitch;
_framebuffer.bytesPerPixel = 1;
+#endif
return &_framebuffer;
}
@@ -879,7 +958,11 @@ void OSystem_SDL::unlockScreen() {
_screenIsLocked = false;
// Unlock the screen surface
+#ifdef ENABLE_16BIT
+ SDL_UnlockSurface(_screen16);
+#else
SDL_UnlockSurface(_screen);
+#endif
// Trigger a full screen update
_forceFull = true;
@@ -1054,8 +1137,13 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
// since we don't actually set the palette until the screen is updated.
// But it could indicate a programming error, so let's warn about it.
+#ifdef ENABLE_16BIT
+ if (!_screen16)
+ warning("OSystem_SDL::setPalette: _screen16 == NULL");
+#else
if (!_screen)
warning("OSystem_SDL::setPalette: _screen == NULL");
+#endif
const byte *b = colors;
uint i;
@@ -1179,7 +1267,11 @@ void OSystem_SDL::clearOverlay() {
dst.x = dst.y = 1;
src.w = dst.w = _videoMode.screenWidth;
src.h = dst.h = _videoMode.screenHeight;
+#ifdef ENABLE_16BIT
+ if (SDL_BlitSurface(_screen16, &src, _tmpscreen, &dst) != 0)
+#else
if (SDL_BlitSurface(_screen, &src, _tmpscreen, &dst) != 0)
+#endif
error("SDL_BlitSurface failed: %s", SDL_GetError());
SDL_LockSurface(_tmpscreen);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index c11c97c041..b91d6938a2 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -196,6 +196,9 @@ OSystem_SDL::OSystem_SDL()
_osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0),
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
+#ifdef ENABLE_16BIT
+ _screen16(0),
+#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
_samplesPerSec(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 7498f48b08..f843066749 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -227,6 +227,9 @@ protected:
// unseen game screen
SDL_Surface *_screen;
+#ifdef ENABLE_16BIT
+ SDL_Surface *_screen16;
+#endif
// temporary screen (for scalers)
SDL_Surface *_tmpscreen;
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index f25cfa11ff..a72422cef9 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -1,7 +1,7 @@
+
@@ -191,6 +194,9 @@
+
--
cgit v1.2.3
From 3a64d35dfd9126d7912c4d4496030f7ed120d660 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 4 Jun 2009 01:05:47 +0000
Subject: Add 16bit color support for later HE games.
svn-id: r41153
---
Makefile.common | 4 +
configure | 12 ++
engines/scumm/actor.cpp | 2 +-
engines/scumm/akos.cpp | 81 +++++---
engines/scumm/akos.h | 2 +-
engines/scumm/base-costume.cpp | 2 +-
engines/scumm/charset.cpp | 4 +-
engines/scumm/gfx.cpp | 245 ++++++++++++++---------
engines/scumm/gfx.h | 4 +-
engines/scumm/he/animation_he.cpp | 31 ++-
engines/scumm/he/animation_he.h | 1 +
engines/scumm/he/intern_he.h | 3 +-
engines/scumm/he/palette_he.cpp | 217 +++++++++++++++------
engines/scumm/he/script_v100he.cpp | 43 +++--
engines/scumm/he/script_v60he.cpp | 2 +
engines/scumm/he/script_v80he.cpp | 8 +-
engines/scumm/he/script_v90he.cpp | 44 +++--
engines/scumm/he/wiz_he.cpp | 364 +++++++++++++++++++++--------------
engines/scumm/he/wiz_he.h | 33 ++--
engines/scumm/palette.cpp | 13 --
engines/scumm/saveload.cpp | 2 +-
engines/scumm/scumm.cpp | 20 +-
engines/scumm/scumm.h | 6 +-
graphics/scaler/thumbnail_intern.cpp | 17 +-
24 files changed, 754 insertions(+), 406 deletions(-)
diff --git a/Makefile.common b/Makefile.common
index c081e2beb3..858839a05a 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -37,6 +37,10 @@ ifdef DISABLE_SCALERS
DEFINES += -DDISABLE_SCALERS
endif
+ifdef ENABLE_16BIT
+DEFINES += -DENABLE_16BIT
+endif
+
ifdef DISABLE_HQ_SCALERS
DEFINES += -DDISABLE_HQ_SCALERS
endif
diff --git a/configure b/configure
index 08b2c9d94e..4f2a74efbb 100755
--- a/configure
+++ b/configure
@@ -110,6 +110,7 @@ _alsa=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
+_16bit=no
_mt32emu=yes
# Default option behaviour yes/no
_build_hq_scalers=yes
@@ -626,6 +627,8 @@ DEBFLAGS="-g"
for ac_option in $@; do
case "$ac_option" in
+ --enable-16bit) _16bit=yes ;;
+ --disable-16bit) _16bit=no ;;
--disable-hq-scalers) _build_hq_scalers=no ;;
--disable-scalers) _build_scalers=no ;;
--enable-alsa) _alsa=yes ;;
@@ -1512,6 +1515,11 @@ else
fi
add_to_config_mk_if_yes "$_mt32emu" 'USE_MT32EMU = 1'
+#
+# Check whether 16bit color support is requested
+#
+add_to_config_mk_if_yes "$_16bit" 'ENABLE_16BIT = 1'
+
#
# Check whether to enable the (hq) scalers
#
@@ -1823,6 +1831,10 @@ if test "$_nasm" = yes ; then
echo_n ", assembly routines"
fi
+if test "$_16bit" = yes ; then
+ echo_n ", 16bit color"
+fi
+
if test "$_build_hq_scalers" = yes ; then
echo_n ", HQ scalers"
fi
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index cf90094112..eea1ec070b 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2384,7 +2384,7 @@ void ScummEngine_v71he::postProcessAuxQueue() {
uint8 *dst2 = pvs->getBackPixels(0, pvs->topline);
switch (comp) {
case 1:
- Wiz::copyAuxImage(dst1, dst2, axfd + 10, pvs->w, pvs->h, x, y, w, h);
+ Wiz::copyAuxImage(dst1, dst2, axfd + 10, pvs->pitch, pvs->h, x, y, w, h, _bitDepth);
break;
default:
error("unimplemented compression type %d", comp);
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index ab7db2c4a7..edfbe5730d 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -299,22 +299,23 @@ void AkosRenderer::setPalette(byte *new_palette) {
if (size > 256)
error("akos_setPalette: %d is too many colors", size);
- if (_vm->_game.heversion >= 99 && _paletteNum) {
- for (i = 0; i < size; i++)
- _palette[i] = (byte)_vm->_hePalettes[_paletteNum * 1024 + 768 + akpl[i]];
- } else if ((_vm->_game.features & GF_16BIT_COLOR) && rgbs) {
- for (i = 0; i < size; i++) {
- if (new_palette[i] == 0xFF) {
- uint8 col = akpl[i];
- uint8 r = rgbs[col * 3 + 0];
- uint8 g = rgbs[col * 3 + 1];
- uint8 b = rgbs[col * 3 + 2];
-
- _palette[i] = _vm->remapPaletteColor(r, g, b, -1);
- } else {
- _palette[i] = new_palette[i];
+ if (_vm->_game.features & GF_16BIT_COLOR) {
+ if (_paletteNum) {
+ for (i = 0; i < size; i++)
+ _palette[i] = READ_LE_UINT16(_vm->_hePalettes + _paletteNum * _vm->_hePaletteSlot + 768 + akpl[i] * 2);
+ } else if (rgbs) {
+ for (i = 0; i < size; i++) {
+ if (new_palette[i] == 0xFF) {
+ uint8 col = akpl[i];
+ _palette[i] = _vm->get16BitColor(rgbs[col * 3 + 0], rgbs[col * 3 + 1], rgbs[col * 3 + 2]);
+ } else {
+ _palette[i] = new_palette[i];
+ }
}
}
+ } else if (_vm->_game.heversion >= 99 && _paletteNum) {
+ for (i = 0; i < size; i++)
+ _palette[i] = (byte)_vm->_hePalettes[_paletteNum * _vm->_hePaletteSlot + 768 + akpl[i]];
} else {
for (i = 0; i < size; i++) {
_palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i];
@@ -545,7 +546,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
byte *dst;
byte len, maskbit;
int y;
- uint color, height, pcolor;
+ uint16 color, height, pcolor;
const byte *scaleytab;
bool masked;
bool skip_column = false;
@@ -589,7 +590,11 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
} else if (_shadow_mode == 2) {
error("codec1_spec2"); // TODO
} else if (_shadow_mode == 3) {
- if (_vm->_game.heversion >= 90) {
+ if (_vm->_game.features & GF_16BIT_COLOR) {
+ uint16 srcColor = (pcolor >> 1) & 0x7DEF;
+ uint16 dstColor = (READ_UINT16(dst) >> 1) & 0x7DEF;
+ pcolor = srcColor + dstColor;
+ } else if (_vm->_game.heversion >= 90) {
pcolor = (pcolor << 8) + *dst;
pcolor = xmap[pcolor];
} else if (pcolor < 8) {
@@ -597,7 +602,11 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
pcolor = _shadow_table[pcolor];
}
}
- *dst = pcolor;
+ if (_vm->_bitDepth == 2) {
+ WRITE_UINT16(dst, pcolor);
+ } else {
+ *dst = pcolor;
+ }
}
}
dst += _out.pitch;
@@ -617,7 +626,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
if (v1.x < 0 || v1.x >= v1.boundsRect.right)
return;
maskbit = revBitMask(v1.x & 7);
- v1.destptr += v1.scaleXstep;
+ v1.destptr += v1.scaleXstep * _vm->_bitDepth;
skip_column = false;
} else
skip_column = true;
@@ -987,7 +996,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) {
if (_draw_bottom < rect.bottom)
_draw_bottom = rect.bottom;
- v1.destptr = (byte *)_out.pixels + v1.y * _out.pitch + v1.x;
+ v1.destptr = (byte *)_out.pixels + v1.y * _out.pitch + v1.x * _vm->_bitDepth;
codec1_genericDecode(v1);
@@ -1056,7 +1065,12 @@ byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) {
bdd.shadowMode = _shadow_mode;
bdd.shadowPalette = _vm->_shadowPalette;
- bdd.actorPalette = _useBompPalette ? _palette : 0;
+ bdd.actorPalette = 0;
+ if (_useBompPalette) {
+ for (uint i = 0; i < 256; i++)
+ bdd.actorPalette[i] = _palette[i];
+ }
+
bdd.mirror = !_mirror;
drawBomp(bdd);
@@ -1176,6 +1190,8 @@ void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, in
}
byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) {
+ assert(_vm->_bitDepth == 1);
+
Common::Rect clip;
int32 minx, miny, maxw, maxh;
int32 skip_x, skip_y, cur_x, cur_y;
@@ -1278,13 +1294,15 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) {
int32 numskip_before = skip_x + (skip_y * _width);
int32 numskip_after = _width - cur_x;
- byte *dst = (byte *)_out.pixels + width_unk + height_unk * _out.pitch;
+ byte *dst = (byte *)_out.pixels + height_unk * _out.pitch + width_unk * _vm->_bitDepth;
akos16Decompress(dst, _out.pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, clip.left, clip.top, _zbuf);
return 0;
}
byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
+ return 0;
+
#ifdef ENABLE_HE
Common::Rect src, dst;
@@ -1335,18 +1353,27 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
_draw_bottom = dst.bottom;
const uint8 *palPtr = NULL;
- if (_vm->_game.heversion >= 99) {
- palPtr = _vm->_hePalettes + 1792;
+ if (_vm->_game.features & GF_16BIT_COLOR) {
+ palPtr = _vm->_hePalettes + _vm->_hePaletteSlot + 768;
+ if (_paletteNum) {
+ palPtr = _vm->_hePalettes + _paletteNum * _vm->_hePaletteSlot + 768;
+ } else if (rgbs) {
+ for (uint i = 0; i < 256; i++)
+ _palette[i] = _vm->get16BitColor(rgbs[i * 3 + 0], rgbs[i * 3 + 1], rgbs[i * 3 + 2]);
+ palPtr = (uint8 *)_palette;
+ }
+ } else if (_vm->_game.heversion >= 99) {
+ palPtr = _vm->_hePalettes + _vm->_hePaletteSlot + 768;
}
- byte *dstPtr = (byte *)_out.pixels + dst.left + dst.top * _out.pitch;
+ byte *dstPtr = (byte *)_out.pixels + dst.top * _out.pitch + dst.left * _vm->_bitDepth;
if (_shadow_mode == 3) {
- Wiz::decompressWizImage(dstPtr, _out.pitch, _srcptr, src, 0, palPtr, xmap);
+ Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, xmap, _vm->_bitDepth);
} else {
if (palPtr != NULL) {
- Wiz::decompressWizImage(dstPtr, _out.pitch, _srcptr, src, 0, palPtr);
+ Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, NULL, _vm->_bitDepth);
} else {
- Wiz::decompressWizImage(dstPtr, _out.pitch, _srcptr, src, 0);
+ Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, NULL, NULL, _vm->_bitDepth);
}
}
#endif
diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h
index be532b804d..17576e5869 100644
--- a/engines/scumm/akos.h
+++ b/engines/scumm/akos.h
@@ -60,7 +60,7 @@ protected:
uint16 _codec;
// actor _palette
- byte _palette[256];
+ uint16 _palette[256];
bool _useBompPalette;
// pointer to various parts of the costume resource
diff --git a/engines/scumm/base-costume.cpp b/engines/scumm/base-costume.cpp
index 795abb8685..ef706afaac 100644
--- a/engines/scumm/base-costume.cpp
+++ b/engines/scumm/base-costume.cpp
@@ -40,7 +40,7 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, int numStrips, const
_out.pixels = vs.getPixels(0, 0);
_actorX += _vm->_virtscr[kMainVirtScreen].xstart & 7;
- _out.w = _out.pitch;
+ _out.w = _out.pitch / _vm->_bitDepth;
_out.pixels = (byte *)_out.pixels - (_vm->_virtscr[kMainVirtScreen].xstart & 7);
_numStrips = numStrips;
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 193fc434e4..d6dfa4c5bb 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -819,9 +819,9 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr,
byte imagePalette[256];
memset(imagePalette, 0, sizeof(imagePalette));
memcpy(imagePalette, _vm->_charsetColorMap, 4);
- Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, imagePalette);
+ Wiz::copyWizImage(dstPtr, charPtr, vs->pitch, kDstScreen, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, imagePalette, NULL, _vm->_bitDepth);
} else {
- Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen);
+ Wiz::copyWizImage(dstPtr, charPtr, vs->pitch, kDstScreen, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, NULL, NULL, _vm->_bitDepth);
}
if (_blitAlso && vs->hasTwoBuffers) {
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 62e18561d3..a141d51735 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -43,12 +43,12 @@ extern "C" void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height
namespace Scumm {
-static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h);
-static void fill(byte *dst, int dstPitch, byte color, int w, int h);
+static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h, uint8 bitDepth);
+static void fill(byte *dst, int dstPitch, uint16 color, int w, int h, uint8 bitDepth);
#ifndef USE_ARM_GFX_ASM
-static void copy8Col(byte *dst, int dstPitch, const byte *src, int height);
+static void copy8Col(byte *dst, int dstPitch, const byte *src, int height, uint8 bitDepth);
#endif
-static void clear8Col(byte *dst, int dstPitch, int height);
+static void clear8Col(byte *dst, int dstPitch, int height, uint8 bitDepth);
static void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *width, int *height);
static void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h);
@@ -341,8 +341,8 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
vs->hasTwoBuffers = twobufs;
vs->xstart = 0;
vs->backBuf = NULL;
- vs->bytesPerPixel = 1;
- vs->pitch = width;
+ vs->bytesPerPixel = (_game.features & GF_16BIT_COLOR) ? 2 : 1;
+ vs->pitch = width * vs->bytesPerPixel;
if (_game.version >= 7) {
// Increase the pitch by one; needed to accomodate the extra screen
@@ -586,7 +586,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
vsPitch = _screenWidth * m - width * m;
} else {
- vsPitch = vs->pitch - width;
+ vsPitch = vs->pitch - width * vs->bytesPerPixel;
}
@@ -612,36 +612,49 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
#else
// We blit four pixels at a time, for improved performance.
const uint32 *src32 = (const uint32 *)src;
- const uint32 *text32 = (const uint32 *)text;
uint32 *dst32 = (uint32 *)_compositeBuf;
vsPitch >>= 2;
- const int textPitch = (_textSurface.pitch - width * m) >> 2;
- for (int h = height * m; h > 0; --h) {
- for (int w = width*m; w > 0; w-=4) {
- uint32 temp = *text32++;
-
- // Generate a byte mask for those text pixels (bytes) with
- // value CHARSET_MASK_TRANSPARENCY. In the end, each byte
- // in mask will be either equal to 0x00 or 0xFF.
- // Doing it this way avoids branches and bytewise operations,
- // at the cost of readability ;).
- uint32 mask = temp ^ CHARSET_MASK_TRANSPARENCY_32;
- mask = (((mask & 0x7f7f7f7f) + 0x7f7f7f7f) | mask) & 0x80808080;
- mask = ((mask >> 7) + 0x7f7f7f7f) ^ 0x80808080;
-
- // The following line is equivalent to this code:
- // *dst32++ = (*src32++ & mask) | (temp & ~mask);
- // However, some compilers can generate somewhat better
- // machine code for this equivalent statement:
- *dst32++ = ((temp ^ *src32++) & mask) ^ temp;
+
+ if (_bitDepth == 2) {
+ // Sprites always seem to be used for subtitles in 16Bit color HE games, and not
+ // the charset renderer, so charset masking isn't required.
+ for (int h = height * m; h > 0; --h) {
+ for (int w = width * m; w > 0; w -= 4) {
+ *dst32++ = *src32++;
+ *dst32++ = *src32++;
+ }
+ src32 += vsPitch;
+ }
+ } else {
+ const uint32 *text32 = (const uint32 *)text;
+ const int textPitch = (_textSurface.pitch - width * m) >> 2;
+ for (int h = height * m; h > 0; --h) {
+ for (int w = width * m; w > 0; w -= 4) {
+ uint32 temp = *text32++;
+
+ // Generate a byte mask for those text pixels (bytes) with
+ // value CHARSET_MASK_TRANSPARENCY. In the end, each byte
+ // in mask will be either equal to 0x00 or 0xFF.
+ // Doing it this way avoids branches and bytewise operations,
+ // at the cost of readability ;).
+ uint32 mask = temp ^ CHARSET_MASK_TRANSPARENCY_32;
+ mask = (((mask & 0x7f7f7f7f) + 0x7f7f7f7f) | mask) & 0x80808080;
+ mask = ((mask >> 7) + 0x7f7f7f7f) ^ 0x80808080;
+
+ // The following line is equivalent to this code:
+ // *dst32++ = (*src32++ & mask) | (temp & ~mask);
+ // However, some compilers can generate somewhat better
+ // machine code for this equivalent statement:
+ *dst32++ = ((temp ^ *src32++) & mask) ^ temp;
+ }
+ src32 += vsPitch;
+ text32 += textPitch;
}
- src32 += vsPitch;
- text32 += textPitch;
}
#endif
src = _compositeBuf;
- pitch = width;
+ pitch = width * vs->bytesPerPixel;
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height);
@@ -976,13 +989,13 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
return;
if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
- blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height);
+ blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height, vs->bytesPerPixel);
if (vs->number == kMainVirtScreen && _charset->_hasMask) {
byte *mask = (byte *)_textSurface.getBasePtr(rect.left, rect.top - _screenTop);
- fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
+ fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height, _textSurface.bytesPerPixel);
}
} else {
- fill(screenBuf, vs->pitch, backColor, width, height);
+ fill(screenBuf, vs->pitch, backColor, width, height, vs->bytesPerPixel);
}
}
@@ -1011,7 +1024,7 @@ void ScummEngine::restoreCharsetBg() {
if (vs->number != kMainVirtScreen) {
// Restore from back buffer
const byte *backBuf = vs->getBackPixels(0, 0);
- blit(screenBuf, vs->pitch, backBuf, vs->pitch, vs->w, vs->h);
+ blit(screenBuf, vs->pitch, backBuf, vs->pitch, vs->w, vs->h, vs->bytesPerPixel);
}
} else {
// Clear area
@@ -1047,34 +1060,42 @@ byte *Gdi::getMaskBuffer(int x, int y, int z) {
#pragma mark --- Misc ---
#pragma mark -
-static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) {
+static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h, uint8 bitDepth) {
assert(w > 0);
assert(h > 0);
assert(src != NULL);
assert(dst != NULL);
- if (w == srcPitch && w == dstPitch) {
- memcpy(dst, src, w*h);
+ if ((w * bitDepth == srcPitch) && (w * bitDepth == dstPitch)) {
+ memcpy(dst, src, w * h * bitDepth);
} else {
do {
- memcpy(dst, src, w);
+ memcpy(dst, src, w * bitDepth);
dst += dstPitch;
src += srcPitch;
} while (--h);
}
}
-static void fill(byte *dst, int dstPitch, byte color, int w, int h) {
+static void fill(byte *dst, int dstPitch, uint16 color, int w, int h, uint8 bitDepth) {
assert(h > 0);
assert(dst != NULL);
- if (w == dstPitch) {
- memset(dst, color, w*h);
- } else {
+ if (bitDepth == 2) {
do {
- memset(dst, color, w);
+ for (int i = 0; i < w; i++)
+ WRITE_UINT16(dst + i * 2, color);
dst += dstPitch;
} while (--h);
+ } else {
+ if (w == dstPitch) {
+ memset(dst, color, w * h);
+ } else {
+ do {
+ memset(dst, color, w);
+ dst += dstPitch;
+ } while (--h);
+ }
}
}
@@ -1084,14 +1105,18 @@ static void fill(byte *dst, int dstPitch, byte color, int w, int h) {
#else
-static void copy8Col(byte *dst, int dstPitch, const byte *src, int height) {
+static void copy8Col(byte *dst, int dstPitch, const byte *src, int height, uint8 bitDepth) {
do {
#if defined(SCUMM_NEED_ALIGNMENT)
- memcpy(dst, src, 8);
+ memcpy(dst, src, 8 * bitDepth);
#else
((uint32 *)dst)[0] = ((const uint32 *)src)[0];
((uint32 *)dst)[1] = ((const uint32 *)src)[1];
+ if (bitDepth == 2) {
+ ((uint32 *)dst)[2] = ((const uint32 *)src)[2];
+ ((uint32 *)dst)[3] = ((const uint32 *)src)[3];
+ }
#endif
dst += dstPitch;
src += dstPitch;
@@ -1100,13 +1125,17 @@ static void copy8Col(byte *dst, int dstPitch, const byte *src, int height) {
#endif /* USE_ARM_GFX_ASM */
-static void clear8Col(byte *dst, int dstPitch, int height) {
+static void clear8Col(byte *dst, int dstPitch, int height, uint8 bitDepth) {
do {
#if defined(SCUMM_NEED_ALIGNMENT)
- memset(dst, 0, 8);
+ memset(dst, 0, 8 * bitDepth);
#else
((uint32 *)dst)[0] = 0;
((uint32 *)dst)[1] = 0;
+ if (bitDepth == 2) {
+ ((uint32 *)dst)[2] = 0;
+ ((uint32 *)dst)[3] = 0;
+ }
#endif
dst += dstPitch;
} while (--height);
@@ -1171,41 +1200,41 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
if (color == -1) {
if (vs->number != kMainVirtScreen)
error("can only copy bg to main window");
- blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height);
+ blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel);
if (_charset->_hasMask) {
byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop) * _textSurfaceMultiplier);
- fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier);
+ fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel);
}
} else if (_game.heversion >= 72) {
// Flags are used for different methods in HE games
uint32 flags = color;
if ((flags & 0x2000) || (flags & 0x4000000)) {
- blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height);
+ blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel);
} else if ((flags & 0x4000) || (flags & 0x2000000)) {
- blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height);
+ blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->bytesPerPixel);
} else if ((flags & 0x8000) || (flags & 0x1000000)) {
flags &= (flags & 0x1000000) ? 0xFFFFFF : 0x7FFF;
- fill(backbuff, vs->pitch, flags, width, height);
- fill(bgbuff, vs->pitch, flags, width, height);
+ fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
+ fill(bgbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
} else {
- fill(backbuff, vs->pitch, flags, width, height);
+ fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
}
} else if (_game.heversion >= 60) {
// Flags are used for different methods in HE games
uint16 flags = color;
if (flags & 0x2000) {
- blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height);
+ blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel);
} else if (flags & 0x4000) {
- blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height);
+ blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->bytesPerPixel);
} else if (flags & 0x8000) {
flags &= 0x7FFF;
- fill(backbuff, vs->pitch, flags, width, height);
- fill(bgbuff, vs->pitch, flags, width, height);
+ fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
+ fill(bgbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
} else {
- fill(backbuff, vs->pitch, flags, width, height);
+ fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
}
} else {
- fill(backbuff, vs->pitch, color, width, height);
+ fill(backbuff, vs->pitch, color, width, height, vs->bytesPerPixel);
}
}
@@ -1243,7 +1272,7 @@ void ScummEngine_v5::drawFlashlight() {
_flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY);
if (_flashlight.buffer) {
- fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h);
+ fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h, vs->bytesPerPixel);
}
_flashlight.isDrawn = false;
}
@@ -1290,7 +1319,7 @@ void ScummEngine_v5::drawFlashlight() {
_flashlight.buffer = vs->getPixels(_flashlight.x, _flashlight.y);
bgbak = vs->getBackPixels(_flashlight.x, _flashlight.y);
- blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h);
+ blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->bytesPerPixel);
// Round the corners. To do so, we simply hard-code a set of nicely
// rounded corners.
@@ -1599,7 +1628,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", y + height, vs->h);
}
- _vertStripNextInc = height * vs->pitch - 1;
+ _vertStripNextInc = height * vs->pitch - 1 * vs->bytesPerPixel;
_objectMode = (flag & dbObjectMode) == dbObjectMode;
prepareDrawBitmap(ptr, vs, x, y, width, height, stripnr, numstrip);
@@ -1632,9 +1661,9 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
// In the case of a double buffered virtual screen, we draw to
// the backbuffer, otherwise to the primary surface memory.
if (vs->hasTwoBuffers)
- dstPtr = vs->backBuf + y * vs->pitch + x * 8;
+ dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->bytesPerPixel);
else
- dstPtr = (byte *)vs->pixels + y * vs->pitch + x * 8;
+ dstPtr = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->bytesPerPixel);
transpStrip = drawStrip(dstPtr, vs, x, y, width, height, stripnr, smap_ptr);
@@ -1643,11 +1672,11 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
transpStrip = true;
if (vs->hasTwoBuffers) {
- byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + x * 8;
+ byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->bytesPerPixel);
if (lightsOn)
- copy8Col(frontBuf, vs->pitch, dstPtr, height);
+ copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->bytesPerPixel);
else
- clear8Col(frontBuf, vs->pitch, height);
+ clear8Col(frontBuf, vs->pitch, height, vs->bytesPerPixel);
}
decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag, tmsk_ptr);
@@ -1875,7 +1904,7 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, true);
break;
case 150:
- fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h);
+ fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h, vs->bytesPerPixel);
break;
default:
// Alternative russian freddi3 uses badly formatted bitmaps
@@ -1927,6 +1956,8 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
}
void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h) {
+ assert(_vm->_bitDepth == 1);
+
const byte *bmap_ptr = _vm->findResourceData(MKID_BE('BMAP'), ptr);
assert(bmap_ptr);
@@ -1936,7 +1967,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y,
if (code == 8 || code == 9) {
Common::Rect rScreen(0, 0, vs->w, vs->h);
byte *dst = (byte *)_vm->_virtscr[kMainVirtScreen].backBuf + scrX;
- Wiz::copyWizImage(dst, bmap_ptr, vs->w, vs->h, x - scrX, y, w, h, &rScreen);
+ Wiz::copyWizImage(dst, bmap_ptr, vs->pitch, kDstScreen, vs->w, vs->h, x - scrX, y, w, h, &rScreen, 0, 0, 0, _vm->_bitDepth);
}
Common::Rect rect1(x, y, x + w, y + h);
@@ -1986,7 +2017,7 @@ void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) {
assert(rw <= _screenWidth && rw > 0);
assert(rh <= _screenHeight && rh > 0);
- blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh);
+ blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh, vs->bytesPerPixel);
markRectAsDirty(kMainVirtScreen, rect, dirtybit);
}
#endif
@@ -2016,15 +2047,15 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
if (bottom > vs->bdirty[strip])
vs->bdirty[strip] = bottom;
- bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8;
- backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8;
+ bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->bytesPerPixel;
+ backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->bytesPerPixel;
numLinesToProcess = bottom - top;
if (numLinesToProcess) {
if (_vm->isLightOn()) {
- copy8Col(backbuff_ptr, vs->pitch, bgbak_ptr, numLinesToProcess);
+ copy8Col(backbuff_ptr, vs->pitch, bgbak_ptr, numLinesToProcess, vs->bytesPerPixel);
} else {
- clear8Col(backbuff_ptr, vs->pitch, numLinesToProcess);
+ clear8Col(backbuff_ptr, vs->pitch, numLinesToProcess, vs->bytesPerPixel);
}
}
}
@@ -2774,13 +2805,17 @@ void Gdi::drawStripHE(byte *dst, int dstPitch, const byte *src, int width, int h
int x = width;
while (1) {
- if (!transpCheck || color != _transparentColor)
- *dst = _roomPalette[color];
- dst++;
+ if (!transpCheck || color != _transparentColor) {
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+ else
+ *dst = _roomPalette[color];
+ }
+ dst += _vm->_bitDepth;
--x;
if (x == 0) {
x = width;
- dst += dstPitch - width;
+ dst += dstPitch - width * _vm->_bitDepth;
--height;
if (height == 0)
return;
@@ -2863,9 +2898,13 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height,
int x = 8;
do {
FILL_BITS;
- if (!transpCheck || color != _transparentColor)
- *dst = _roomPalette[color] + _paletteMod;
- dst++;
+ if (!transpCheck || color != _transparentColor) {
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+ else
+ *dst = _roomPalette[color] + _paletteMod;
+ }
+ dst += _vm->_bitDepth;
againPos:
if (!READ_BIT) {
@@ -2886,13 +2925,17 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height,
do {
if (!--x) {
x = 8;
- dst += dstPitch - 8;
+ dst += dstPitch - 8 * _vm->_bitDepth;
if (!--height)
return;
}
- if (!transpCheck || color != _transparentColor)
- *dst = _roomPalette[color] + _paletteMod;
- dst++;
+ if (!transpCheck || color != _transparentColor) {
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+ else
+ *dst = _roomPalette[color] + _paletteMod;
+ }
+ dst += _vm->_bitDepth;
} while (--reps);
bits >>= 8;
bits |= (*src++) << (cl - 8);
@@ -2900,7 +2943,7 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height,
}
}
} while (--x);
- dst += dstPitch - 8;
+ dst += dstPitch - 8 * _vm->_bitDepth;
} while (--height);
}
@@ -2915,9 +2958,13 @@ void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height,
int x = 8;
do {
FILL_BITS;
- if (!transpCheck || color != _transparentColor)
- *dst = _roomPalette[color] + _paletteMod;
- dst++;
+ if (!transpCheck || color != _transparentColor) {
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+ else
+ *dst = _roomPalette[color] + _paletteMod;
+ }
+ dst += _vm->_bitDepth;
if (!READ_BIT) {
} else if (!READ_BIT) {
FILL_BITS;
@@ -2932,7 +2979,7 @@ void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height,
color += inc;
}
} while (--x);
- dst += dstPitch - 8;
+ dst += dstPitch - 8 * _vm->_bitDepth;
} while (--height);
}
@@ -2948,8 +2995,12 @@ void Gdi::drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height,
int h = height;
do {
FILL_BITS;
- if (!transpCheck || color != _transparentColor)
- *dst = _roomPalette[color] + _paletteMod;
+ if (!transpCheck || color != _transparentColor) {
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+ else
+ *dst = _roomPalette[color] + _paletteMod;
+ }
dst += dstPitch;
if (!READ_BIT) {
} else if (!READ_BIT) {
@@ -3016,8 +3067,12 @@ void Gdi::drawStripRaw(byte *dst, int dstPitch, const byte *src, int height, con
do {
for (x = 0; x < 8; x ++) {
byte color = *src++;
- if (!transpCheck || color != _transparentColor)
- dst[x] = _roomPalette[color] + _paletteMod;
+ if (!transpCheck || color != _transparentColor) {
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ WRITE_UINT16(dst + x * 2, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+ else
+ dst[x] = _roomPalette[color] + _paletteMod;
+ }
}
dst += dstPitch;
} while (--height);
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index e4c1054450..88852c8388 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -155,11 +155,11 @@ struct VirtScreen : Graphics::Surface {
}
byte *getPixels(int x, int y) const {
- return (byte *)pixels + xstart + y * pitch + x;
+ return (byte *)pixels + y * pitch + (xstart * 2 + x) * bytesPerPixel;
}
byte *getBackPixels(int x, int y) const {
- return (byte *)backBuf + xstart + y * pitch + x;
+ return (byte *)backBuf + y * pitch + (xstart * 2 + x) * bytesPerPixel;
}
};
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 0cc4419778..5983df2308 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -66,6 +66,31 @@ int MoviePlayer::load(const char *filename, int flags, int image) {
return 0;
}
+void MoviePlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
+ uint h = getHeight();
+ uint w = getWidth();
+
+ byte *src = _videoFrameBuffer;
+
+ if (_vm->_game.features & GF_16BIT_COLOR) {
+ dst += y * pitch + x * 2;
+ do {
+ for (uint i = 0; i < w; i++)
+ WRITE_UINT16(dst + i * 2, src[i]);
+
+ dst += pitch;
+ src += w;
+ } while (--h);
+ } else {
+ dst += y * pitch + x;
+ do {
+ memcpy(dst, src, w);
+ dst += pitch;
+ src += w;
+ } while (--h);
+ }
+}
+
void MoviePlayer::handleNextFrame() {
if (!isVideoLoaded()) {
return;
@@ -80,14 +105,14 @@ void MoviePlayer::handleNextFrame() {
assert(dstPtr);
uint8 *dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
assert(dst);
- copyFrameToBuffer(dst, 0, 0, _vm->_screenWidth);
+ copyFrameToBuffer(dst, 0, 0, _vm->_screenWidth * _vm->_bitDepth);
} else if (_flags & 1) {
- copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, _vm->_screenWidth);
+ copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, pvs->pitch);
Common::Rect imageRect(getWidth(), getHeight());
_vm->restoreBackgroundHE(imageRect);
} else {
- copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, _vm->_screenWidth);
+ copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, pvs->pitch);
Common::Rect imageRect(getWidth(), getHeight());
_vm->markRectAsDirty(kMainVirtScreen, imageRect);
diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h
index 39f03960c4..e2fc1d04b7 100644
--- a/engines/scumm/he/animation_he.h
+++ b/engines/scumm/he/animation_he.h
@@ -54,6 +54,7 @@ public:
int getImageNum();
int load(const char *filename, int flags, int image = 0);
+ void copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch);
void handleNextFrame();
protected:
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index c2079fa5fe..949113aeeb 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -455,6 +455,7 @@ protected:
uint8 *getHEPaletteIndex(int palSlot);
int getHEPaletteColor(int palSlot, int color);
int getHEPaletteSimilarColor(int palSlot, int red, int green, int start, int end);
+ int getHEPalette16BitColorComponent(int component, int type);
int getHEPaletteColorComponent(int palSlot, int color, int component);
void setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b);
void setHEPaletteFromPtr(int palSlot, const uint8 *palData);
@@ -463,7 +464,7 @@ protected:
void setHEPaletteFromRoom(int palSlot, int resId, int state);
void restoreHEPalette(int palSlot);
void copyHEPalette(int dstPalSlot, int srcPalSlot);
- void copyHEPaletteColor(int palSlot, uint8 dstColor, uint8 srcColor);
+ void copyHEPaletteColor(int palSlot, uint8 dstColor, uint16 srcColor);
protected:
/* HE version 90 script opcodes */
diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp
index d055b77ee2..812c39d173 100644
--- a/engines/scumm/he/palette_he.cpp
+++ b/engines/scumm/he/palette_he.cpp
@@ -31,6 +31,27 @@
namespace Scumm {
+uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) {
+ assertRange(0, palSlot, _numPalettes, "palette");
+
+ if (_game.heversion >= 99) {
+ if (palSlot)
+ return _hePalettes + palSlot * _hePaletteSlot + 768;
+ else
+ return _hePalettes + _hePaletteSlot + 768;
+ }
+
+ return NULL;
+}
+
+uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) {
+ uint16 ar = (r >> 3) << 10;
+ uint16 ag = (g >> 3) << 5;
+ uint16 ab = (b >> 3) << 0;
+ uint16 col = ar | ag | ab;
+ return col;
+}
+
void ScummEngine_v71he::remapHEPalette(const uint8 *src, uint8 *dst) {
int r, g, b, sum, bestitem, bestsum;
int ar, ag, ab;
@@ -38,7 +59,7 @@ void ScummEngine_v71he::remapHEPalette(const uint8 *src, uint8 *dst) {
src += 30;
if (_game.heversion >= 99) {
- palPtr = _hePalettes + 1024 + 30;
+ palPtr = _hePalettes + _hePaletteSlot + 30;
} else {
palPtr = _currentPalette + 30;
}
@@ -73,9 +94,9 @@ void ScummEngine_v71he::remapHEPalette(const uint8 *src, uint8 *dst) {
uint8 *ScummEngine_v90he::getHEPaletteIndex(int palSlot) {
if (palSlot) {
assert(palSlot >= 1 && palSlot <= _numPalettes);
- return _hePalettes + palSlot * 1024;
+ return _hePalettes + palSlot * _hePaletteSlot;
} else {
- return _hePalettes + 1024;
+ return _hePalettes + _hePaletteSlot;
}
}
@@ -84,7 +105,7 @@ int ScummEngine_v90he::getHEPaletteSimilarColor(int palSlot, int red, int green,
assertRange(0, start, 255, "start palette slot");
assertRange(0, end, 255, "pend alette slot");
- uint8 *pal = _hePalettes + palSlot * 1024 + start * 3;
+ uint8 *pal = _hePalettes + palSlot * _hePaletteSlot + start * 3;
int bestsum = 0x7FFFFFFF;
int bestitem = start;
@@ -105,39 +126,83 @@ int ScummEngine_v90he::getHEPaletteSimilarColor(int palSlot, int red, int green,
return bestitem;
}
+int ScummEngine_v90he::getHEPalette16BitColorComponent(int component, int type) {
+ uint16 col;
+ if (type == 2) {
+ col = (((component & 0xFFFF) >> 0) & 0x1F) << 3;;
+ } else if (type == 1) {
+ col = (((component & 0xFFFF) >> 5) & 0x1F) << 3;
+ } else {
+ col = (((component & 0xFFFF) >> 10) & 0x1F) << 3;
+ }
+ return col;
+}
+
int ScummEngine_v90he::getHEPaletteColorComponent(int palSlot, int color, int component) {
assertRange(1, palSlot, _numPalettes, "palette");
assertRange(0, color, 255, "palette slot");
- return _hePalettes[palSlot * 1024 + color * 3 + component % 3];
+ return _hePalettes[palSlot * _hePaletteSlot + color * 3 + component % 3];
}
int ScummEngine_v90he::getHEPaletteColor(int palSlot, int color) {
assertRange(1, palSlot, _numPalettes, "palette");
assertRange(0, color, 255, "palette slot");
- return _hePalettes[palSlot * 1024 + 768 + color];
+ if (_game.features & GF_16BIT_COLOR)
+ return READ_LE_UINT16(_hePalettes + palSlot * _hePaletteSlot + 768 + color * 2);
+ else
+ return _hePalettes[palSlot * _hePaletteSlot + 768 + color];
}
void ScummEngine_v90he::setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b) {
debug(7, "setHEPaletteColor(%d, %d, %d, %d, %d)", palSlot, color, r, g, b);
assertRange(1, palSlot, _numPalettes, "palette");
- uint8 *p = _hePalettes + palSlot * 1024 + color * 3;
+
+ uint8 *p = _hePalettes + palSlot * _hePaletteSlot + color * 3;
*(p + 0) = r;
*(p + 1) = g;
*(p + 2) = b;
- _hePalettes[palSlot * 1024 + 768 + color] = color;
+ if (_game.features & GF_16BIT_COLOR) {
+ WRITE_LE_UINT16(_hePalettes + palSlot * _hePaletteSlot + 768 + color * 2, get16BitColor(r, g, b));
+ } else {
+ _hePalettes[palSlot * _hePaletteSlot + 768 + color] = color;
+ }
}
void ScummEngine_v90he::setHEPaletteFromPtr(int palSlot, const uint8 *palData) {
assertRange(1, palSlot, _numPalettes, "palette");
- uint8 *pc = _hePalettes + palSlot * 1024;
+
+ uint8 *pc = _hePalettes + palSlot * _hePaletteSlot;
uint8 *pi = pc + 768;
- for (int i = 0; i < 256; ++i) {
- *pc++ = *palData++;
- *pc++ = *palData++;
- *pc++ = *palData++;
- *pi++ = i;
+ if (_game.features & GF_16BIT_COLOR) {
+ for (int i = 0; i < 256; ++i) {
+ uint8 r = *pc++ = *palData++;
+ uint8 g = *pc++ = *palData++;
+ uint8 b = *pc++ = *palData++;
+ WRITE_LE_UINT16(pi, get16BitColor(r, g, b)); pi += 2;
+ }
+ } else {
+ for (int i = 0; i < 256; ++i) {
+ *pc++ = *palData++;
+ *pc++ = *palData++;
+ *pc++ = *palData++;
+ *pi++ = i;
+ }
+ }
+
+ int i;
+ uint8 *palPtr = _hePalettes + palSlot * _hePaletteSlot + 768;
+ if (_game.features & GF_16BIT_COLOR) {
+ for (i = 0; i < 10; ++i)
+ WRITE_LE_UINT16(palPtr + i * 2, i);
+ for (i = 246; i < 256; ++i)
+ WRITE_LE_UINT16(palPtr + i * 2, i);
+ } else {
+ for (i = 0; i < 10; ++i)
+ *(palPtr + i) = i;
+ for (i = 246; i < 256; ++i)
+ *(palPtr + i) = i;
}
}
@@ -176,8 +241,9 @@ void ScummEngine_v90he::setHEPaletteFromRoom(int palSlot, int resId, int state)
void ScummEngine_v90he::restoreHEPalette(int palSlot) {
debug(7, "restoreHEPalette(%d)", palSlot);
assertRange(1, palSlot, _numPalettes, "palette");
+
if (palSlot != 1) {
- memcpy(_hePalettes + palSlot * 1024, _hePalettes + 1024, 1024);
+ memcpy(_hePalettes + palSlot * _hePaletteSlot, _hePalettes + _hePaletteSlot, _hePaletteSlot);
}
}
@@ -185,18 +251,27 @@ void ScummEngine_v90he::copyHEPalette(int dstPalSlot, int srcPalSlot) {
debug(7, "copyHEPalette(%d, %d)", dstPalSlot, srcPalSlot);
assert(dstPalSlot >= 1 && dstPalSlot <= _numPalettes);
assert(srcPalSlot >= 1 && srcPalSlot <= _numPalettes);
+
if (dstPalSlot != srcPalSlot) {
- memcpy(_hePalettes + dstPalSlot * 1024, _hePalettes + srcPalSlot * 1024, 1024);
+ memcpy(_hePalettes + dstPalSlot * _hePaletteSlot, _hePalettes + srcPalSlot * _hePaletteSlot, _hePaletteSlot);
}
}
-void ScummEngine_v90he::copyHEPaletteColor(int palSlot, uint8 dstColor, uint8 srcColor) {
+void ScummEngine_v90he::copyHEPaletteColor(int palSlot, uint8 dstColor, uint16 srcColor) {
debug(7, "copyHEPaletteColor(%d, %d, %d)", palSlot, dstColor, srcColor);
assertRange(1, palSlot, _numPalettes, "palette");
- uint8 *dstPal = _hePalettes + palSlot * 1024 + dstColor * 3;
- uint8 *srcPal = _hePalettes + 1024 + srcColor * 3;
- memcpy(dstPal, srcPal, 3);
- _hePalettes[palSlot * 1024 + 768 + dstColor] = srcColor;
+
+ uint8 *dstPal = _hePalettes + palSlot * _hePaletteSlot + dstColor * 3;
+ uint8 *srcPal = _hePalettes + _hePaletteSlot + srcColor * 3;
+ if (_game.features & GF_16BIT_COLOR) {
+ dstPal[0] = (srcColor >> 10) << 3;
+ dstPal[1] = (srcColor >> 5) << 3;
+ dstPal[2] = (srcColor >> 0) << 3;
+ WRITE_LE_UINT16(_hePalettes + palSlot * _hePaletteSlot + 768 + dstColor * 2, srcColor);
+ } else {
+ memcpy(dstPal, srcPal, 3);
+ _hePalettes[palSlot * _hePaletteSlot + 768 + dstColor] = srcColor;
+ }
}
void ScummEngine_v99he::setPaletteFromPtr(const byte *ptr, int numcolor) {
@@ -209,7 +284,7 @@ void ScummEngine_v99he::setPaletteFromPtr(const byte *ptr, int numcolor) {
assertRange(0, numcolor, 256, "setPaletteFromPtr: numcolor");
- dest = _hePalettes + 1024;
+ dest = _hePalettes + _hePaletteSlot;
for (i = 0; i < numcolor; i++) {
r = *ptr++;
@@ -220,48 +295,63 @@ void ScummEngine_v99he::setPaletteFromPtr(const byte *ptr, int numcolor) {
*dest++ = r;
*dest++ = g;
*dest++ = b;
- _hePalettes[1792 + i] = i;
+
+ if (_game.features & GF_16BIT_COLOR) {
+ WRITE_LE_UINT16(_hePalettes + 2048 + i * 2, get16BitColor(r, g, b));
+ } else {
+ _hePalettes[1792 + i] = i;
+ }
} else {
dest += 3;
}
}
- memcpy(_hePalettes, _hePalettes + 1024, 768);
-
- for (i = 0; i < 10; ++i)
- _hePalettes[1792 + i] = i;
- for (i = 246; i < 256; ++i)
- _hePalettes[1792 + i] = i;
+ memcpy(_hePalettes, _hePalettes + _hePaletteSlot, 768);
+ if (_game.features & GF_16BIT_COLOR) {
+ for (i = 0; i < 10; ++i)
+ WRITE_LE_UINT16(_hePalettes + 2048 + i * 2, i);
+ for (i = 246; i < 256; ++i)
+ WRITE_LE_UINT16(_hePalettes + 2048 + i * 2, i);
+ } else {
+ for (i = 0; i < 10; ++i)
+ _hePalettes[1792 + i] = i;
+ for (i = 246; i < 256; ++i)
+ _hePalettes[1792 + i] = i;
+ }
setDirtyColors(0, numcolor - 1);
}
void ScummEngine_v99he::darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) {
uint8 *src, *dst;
- int color, j;
+ int j, r, g, b;
src = _hePalettes + startColor * 3;
- dst = _hePalettes + 1024 + startColor * 3;
+ dst = _hePalettes + _hePaletteSlot + startColor * 3;
for (j = startColor; j <= endColor; j++) {
- color = *src++;
- color = color * redScale / 0xFF;
- if (color > 255)
- color = 255;
- *dst++ = color;
-
- color = *src++;
- color = color * greenScale / 0xFF;
- if (color > 255)
- color = 255;
- *dst++ = color;
-
- color = *src++;
- color = color * blueScale / 0xFF;
- if (color > 255)
- color = 255;
- *dst++ = color;
-
- _hePalettes[1792 + j] = j;
+ r = *src++;
+ r = r * redScale / 0xFF;
+ if (r > 255)
+ r = 255;
+ *dst++ = r;
+
+ g = *src++;
+ g = g * greenScale / 0xFF;
+ if (g > 255)
+ g = 255;
+ *dst++ = g;
+
+ b = *src++;
+ b = b * blueScale / 0xFF;
+ if (b > 255)
+ b = 255;
+ *dst++ = b;
+
+ if (_game.features & GF_16BIT_COLOR) {
+ WRITE_LE_UINT16(_hePalettes + 2048 + j * 2, get16BitColor(r, g, b));
+ } else {
+ _hePalettes[1792 + j] = j;
+ }
setDirtyColors(j, endColor);
}
}
@@ -272,26 +362,39 @@ void ScummEngine_v99he::copyPalColor(int dst, int src) {
if ((uint) dst >= 256 || (uint) src >= 256)
error("copyPalColor: invalid values, %d, %d", dst, src);
- dp = &_hePalettes[1024 + dst * 3];
- sp = &_hePalettes[1024 + src * 3];
+ dp = &_hePalettes[_hePaletteSlot + dst * 3];
+ sp = &_hePalettes[_hePaletteSlot + src * 3];
dp[0] = sp[0];
dp[1] = sp[1];
dp[2] = sp[2];
- _hePalettes[1792 + dst] = dst;
+
+ if (_game.features & GF_16BIT_COLOR) {
+ WRITE_LE_UINT16(_hePalettes + 2048 + dst * 2, get16BitColor(sp[0], sp[1], sp[2]));
+ } else {
+ _hePalettes[1792 + dst] = dst;
+ }
setDirtyColors(dst, dst);
}
void ScummEngine_v99he::setPalColor(int idx, int r, int g, int b) {
- _hePalettes[1024 + idx * 3 + 0] = r;
- _hePalettes[1024 + idx * 3 + 1] = g;
- _hePalettes[1024 + idx * 3 + 2] = b;
- _hePalettes[1792 + idx] = idx;
+ _hePalettes[_hePaletteSlot + idx * 3 + 0] = r;
+ _hePalettes[_hePaletteSlot + idx * 3 + 1] = g;
+ _hePalettes[_hePaletteSlot + idx * 3 + 2] = b;
+
+ if (_game.features & GF_16BIT_COLOR) {
+ WRITE_LE_UINT16(_hePalettes + 2048 + idx * 2, get16BitColor(r, g, b));
+ } else {
+ _hePalettes[1792 + idx] = idx;
+ }
setDirtyColors(idx, idx);
}
void ScummEngine_v99he::updatePalette() {
+ if (_game.features & GF_16BIT_COLOR)
+ return;
+
if (_palDirtyMax == -1)
return;
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 5912e3d528..d588c26a77 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2152,8 +2152,9 @@ void ScummEngine_v100he::o100_systemOps() {
}
void ScummEngine_v100he::o100_cursorCommand() {
- int a, i;
+ int a, b, i;
int args[16];
+
byte subOp = fetchScriptByte();
switch (subOp) {
@@ -2168,12 +2169,12 @@ void ScummEngine_v100he::o100_cursorCommand() {
case 0x80:
case 0x81:
a = pop();
- _wiz->loadWizCursor(a);
+ _wiz->loadWizCursor(a, 0);
break;
case 0x82:
- pop();
+ b = pop();
a = pop();
- _wiz->loadWizCursor(a);
+ _wiz->loadWizCursor(a, b);
break;
case 0x86: // SO_CURSOR_ON Turn cursor on
_cursor.state = 1;
@@ -2576,7 +2577,8 @@ void ScummEngine_v100he::o100_getWizData() {
}
void ScummEngine_v100he::o100_getPaletteData() {
- int b, c, d, e;
+ int c, d, e;
+ int r, g, b;
int palSlot, color;
byte subOp = fetchScriptByte();
@@ -2585,7 +2587,10 @@ void ScummEngine_v100he::o100_getPaletteData() {
case 13:
c = pop();
b = pop();
- push(getHEPaletteColorComponent(1, b, c));
+ if (_game.features & GF_16BIT_COLOR)
+ push(getHEPalette16BitColorComponent(b, c));
+ else
+ push(getHEPaletteColorComponent(1, b, c));
break;
case 20:
color = pop();
@@ -2596,20 +2601,30 @@ void ScummEngine_v100he::o100_getPaletteData() {
e = pop();
d = pop();
palSlot = pop();
- pop();
- c = pop();
b = pop();
- push(getHEPaletteSimilarColor(palSlot, b, c, d, e));
+ g = pop();
+ r = pop();
+ push(getHEPaletteSimilarColor(palSlot, r, g, d, e));
break;
case 53:
- pop();
- c = pop();
- c = MAX(0, c);
- c = MIN(c, 255);
b = pop();
b = MAX(0, b);
b = MIN(b, 255);
- push(getHEPaletteSimilarColor(1, b, c, 10, 245));
+ g = pop();
+ g = MAX(0, g);
+ g = MIN(g, 255);
+ r = pop();
+ r = MAX(0, r);
+ r = MIN(r, 255);
+ if (_game.features & GF_16BIT_COLOR) {
+ uint32 ar = ((r >> 3) << 10) & 0xFFFF;
+ uint32 ag = ((g >> 3) << 5) & 0xFFFF;
+ uint32 ab = ((b >> 3) << 0) & 0xFFFF;
+ uint32 col = ar | ag | ab;
+ push(col);
+ } else {
+ push(getHEPaletteSimilarColor(1, r, g, 10, 245));
+ }
break;
case 73:
c = pop();
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 5ad447b1c7..b416a0e75d 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -115,6 +115,8 @@ int ScummEngine_v60he::convertFilePath(byte *dst) {
int r = 0;
if (dst[0] == '.' && dst[1] == '/') { // Game Data Path
r = 2;
+ } else if (dst[2] == 'b' && dst[5] == 'k') { // Backyard Basketball INI
+ r = 13;
} else if (dst[0] == '*' && dst[1] == '/') { // Save Game Path (HE72 - HE100)
r = 2;
} else if (dst[0] == 'c' && dst[1] == ':') { // Save Game Path (HE60 - HE71)
diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp
index b71a0f9e10..4b759dec53 100644
--- a/engines/scumm/he/script_v80he.cpp
+++ b/engines/scumm/he/script_v80he.cpp
@@ -241,7 +241,7 @@ void ScummEngine_v80he::o80_writeConfigFile() {
}
void ScummEngine_v80he::o80_cursorCommand() {
- int a, i;
+ int a, b, i;
int args[16];
byte subOp = fetchScriptByte();
@@ -250,12 +250,12 @@ void ScummEngine_v80he::o80_cursorCommand() {
case 0x13:
case 0x14:
a = pop();
- _wiz->loadWizCursor(a);
+ _wiz->loadWizCursor(a, 0);
break;
case 0x3C:
- pop();
+ b = pop();
a = pop();
- _wiz->loadWizCursor(a);
+ _wiz->loadWizCursor(a, b);
break;
case 0x90: // SO_CURSOR_ON Turn cursor on
_cursor.state = 1;
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index cdfef1a5e5..212ba69bdc 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -1253,7 +1253,7 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() {
void ScummEngine_v90he::o90_getWizData() {
byte filename[4096];
- int state, resId;
+ int resId, state, type;
int32 w, h;
int32 x, y;
@@ -1317,9 +1317,10 @@ void ScummEngine_v90he::o90_getWizData() {
push(computeWizHistogram(resId, state, x, y, w, h));
break;
case 139:
- pop();
- pop();
- push(0);
+ type = pop();
+ state = pop();
+ resId = pop();
+ push(_wiz->getWizImageData(resId, state, type));
break;
case 141:
pop();
@@ -2099,7 +2100,8 @@ void ScummEngine_v90he::o90_getObjectData() {
}
void ScummEngine_v90he::o90_getPaletteData() {
- int b, c, d, e;
+ int c, d, e;
+ int r, g, b;
int palSlot, color;
byte subOp = fetchScriptByte();
@@ -2109,10 +2111,10 @@ void ScummEngine_v90he::o90_getPaletteData() {
e = pop();
d = pop();
palSlot = pop();
- pop();
- c = pop();
b = pop();
- push(getHEPaletteSimilarColor(palSlot, b, c, d, e));
+ g = pop();
+ r = pop();
+ push(getHEPaletteSimilarColor(palSlot, r, g, d, e));
break;
case 52:
c = pop();
@@ -2128,17 +2130,31 @@ void ScummEngine_v90he::o90_getPaletteData() {
case 132:
c = pop();
b = pop();
- push(getHEPaletteColorComponent(1, b, c));
+ if (_game.features & GF_16BIT_COLOR)
+ push(getHEPalette16BitColorComponent(b, c));
+ else
+ push(getHEPaletteColorComponent(1, b, c));
break;
case 217:
- pop();
- c = pop();
- c = MAX(0, c);
- c = MIN(c, 255);
b = pop();
b = MAX(0, b);
b = MIN(b, 255);
- push(getHEPaletteSimilarColor(1, b, c, 10, 245));
+ g = pop();
+ g = MAX(0, g);
+ g = MIN(g, 255);
+ r = pop();
+ r = MAX(0, r);
+ r = MIN(r, 255);
+
+ if (_game.features & GF_16BIT_COLOR) {
+ uint32 ar = ((r >> 3) << 10) & 0xFFFF;
+ uint32 ag = ((g >> 3) << 5) & 0xFFFF;
+ uint32 ab = ((b >> 3) << 0) & 0xFFFF;
+ uint32 col = ar | ag | ab;
+ push(col);
+ } else {
+ push(getHEPaletteSimilarColor(1, r, g, 10, 245));
+ }
break;
default:
error("o90_getPaletteData: Unknown case %d", subOp);
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 6038433847..1c3867b980 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -254,7 +254,9 @@ bool Wiz::polygonContains(const WizPolygon &pol, int x, int y) {
return r;
}
-void Wiz::copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch) {
+void Wiz::copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, uint8 bitDepth) {
+ assert(bitDepth == 1);
+
Common::Rect dstRect(srcx, srcy, srcx + srcw, srcy + srch);
dstRect.clip(dstw, dsth);
@@ -263,8 +265,8 @@ void Wiz::copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int
if (rh <= 0 || rw <= 0)
return;
- uint8 *dst1Ptr = dst1 + dstRect.left + dstRect.top * dstw;
- uint8 *dst2Ptr = dst2 + dstRect.left + dstRect.top * dstw;
+ uint8 *dst1Ptr = dst1 + dstRect.top * dstw + dstRect.left;
+ uint8 *dst2Ptr = dst2 + dstRect.top * dstw + dstRect.left;
const uint8 *dataPtr = src;
while (rh--) {
@@ -353,12 +355,24 @@ static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w,
return srcRect.isValidRect() && dstRect.isValidRect();
}
-void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
- // TODO: Compressed 16 bits in 555 format
+void Wiz::writeColor(uint8 *dstPtr, int dstType, uint16 color) {
+ switch (dstType) {
+ case kDstScreen:
+ WRITE_UINT16(dstPtr, color);
+ break;
+ case kDstMemory:
+ case kDstResource:
+ WRITE_LE_UINT16(dstPtr, color);
+ break;
+ default:
+ error("writeColor: Unknown dstType %d", dstType);
+ }
+}
+void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
- dst += r2.top * dstw + r2.left;
+ dst += r2.top * dstPitch + r2.left * 2;
if (flags & kWIFFlipY) {
const int dy = (srcy < 0) ? srcy : (srch - r1.height());
r1.translate(0, dy);
@@ -368,17 +382,17 @@ void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, in
r1.translate(dx, 0);
}
if (xmapPtr) {
- decompress16BitWizImage(dst, dstw, src, r1, flags, palPtr, xmapPtr);
+ decompress16BitWizImage(dst, dstPitch, dstType, src, r1, flags, palPtr, xmapPtr);
} else {
- decompress16BitWizImage(dst, dstw, src, r1, flags);
+ decompress16BitWizImage(dst, dstPitch, dstType, src, r1, flags);
}
}
}
-void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
- dst += r2.left + r2.top * dstw;
+ dst += r2.top * dstPitch + r2.left * bitDepth;
if (flags & kWIFFlipY) {
const int dy = (srcy < 0) ? srcy : (srch - r1.height());
r1.translate(0, dy);
@@ -388,11 +402,11 @@ void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int src
r1.translate(dx, 0);
}
if (xmapPtr) {
- decompressWizImage(dst, dstw, src, r1, flags, palPtr, xmapPtr);
+ decompressWizImage(dst, dstPitch, dstType, src, r1, flags, palPtr, xmapPtr, bitDepth);
} else if (palPtr) {
- decompressWizImage(dst, dstw, src, r1, flags, palPtr);
+ decompressWizImage(dst, dstPitch, dstType, src, r1, flags, palPtr, NULL, bitDepth);
} else {
- decompressWizImage(dst, dstw, src, r1, flags);
+ decompressWizImage(dst, dstPitch, dstType, src, r1, flags, NULL, NULL, bitDepth);
}
}
}
@@ -431,13 +445,13 @@ static void decodeWizMask(uint8 *&dst, uint8 &mask, int w, int maskType) {
}
}
-void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP) {
+void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP) {
Common::Rect srcRect, dstRect;
if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
return;
}
dstw = dstw / 8;
- dst += dstRect.top * dstw + dstRect.left / 8;
+ dst += dstRect.top * dstPitch + dstRect.left / 8;
const uint8 *dataPtr, *dataPtrNext;
uint8 code, mask, *dstPtr, *dstPtrNext;
@@ -462,7 +476,7 @@ void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstw, int dsth,
w = srcRect.width();
mask = revBitMask(dstRect.left & 7);
off = READ_LE_UINT16(dataPtr); dataPtr += 2;
- dstPtrNext = dstPtr + dstw;
+ dstPtrNext = dstPtr + dstPitch;
dataPtrNext = dataPtr + off;
if (off != 0) {
while (w > 0) {
@@ -520,7 +534,7 @@ void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstw, int dsth,
}
}
-void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor) {
+void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitDepth) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
if (flags & kWIFFlipX) {
@@ -537,19 +551,17 @@ void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int
}
int h = r1.height();
int w = r1.width();
- src += r1.left + r1.top * srcw;
- dst += r2.left + r2.top * dstw;
+ src += r1.top * srcw + r1.left;
+ dst += r2.top * dstPitch + r2.left * bitDepth;
if (palPtr) {
- decompressRawWizImage(dst, dstw, src, srcw, w, h, transColor, palPtr);
+ decompressRawWizImage(dst, dstPitch, dstType, src, srcw, w, h, transColor, palPtr, bitDepth);
} else {
- decompressRawWizImage(dst, dstw, src, srcw, w, h, transColor);
+ decompressRawWizImage(dst, dstPitch, dstType, src, srcw, w, h, transColor, NULL, bitDepth);
}
}
}
-void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor) {
- // TODO: RAW 16 bits in 555 format
-
+void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
if (flags & kWIFFlipX) {
@@ -567,29 +579,39 @@ void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth,
int h = r1.height();
int w = r1.width();
src += (r1.top * srcw + r1.left) * 2;
- dst += r2.top * dstw + r2.left;
+ dst += r2.top * dstPitch + r2.left * 2;
while (h--) {
- for (int i = 0; i < w; ++i) {
+ for (int i = 0; i < w; ++ i) {
uint16 col = READ_LE_UINT16(src + 2 * i);
- uint8 r = ((col >> 10) & 0x1F) << 3;
- uint8 g = ((col >> 5) & 0x1F) << 3;
- uint8 b = ((col >> 0) & 0x1F) << 3;
- uint8 color = _vm->convert16BitColor(col, r, g, b);
-
if (transColor == -1 || transColor != col) {
- dst[i] = color;
+ writeColor(dst + i * 2, dstType, col);
}
}
src += srcw * 2;
- dst += dstw;
+ dst += dstPitch;
}
}
}
template
-void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::write16BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, const uint8 *xmapPtr) {
+ uint16 col = READ_LE_UINT16(dataPtr);
+ if (type == kWizXMap) {
+ uint16 srcColor = (col >> 1) & 0x7DEF;
+ uint16 dstColor = (READ_UINT16(dstPtr) >> 1) & 0x7DEF;
+ uint16 newColor = srcColor + dstColor;
+ writeColor(dstPtr, dstType, newColor);
+ }
+ if (type == kWizCopy) {
+ writeColor(dstPtr, dstType, col);
+ }
+}
+
+template
+void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
const uint8 *dataPtr, *dataPtrNext;
- uint8 code, *dstPtr, *dstPtrNext;
+ uint8 code;
+ uint8 *dstPtr, *dstPtrNext;
int h, w, xoff, dstInc;
if (type == kWizXMap) {
@@ -616,10 +638,10 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
dstPtr += (h - 1) * dstPitch;
dstPitch = -dstPitch;
}
- dstInc = 1;
+ dstInc = 2;
if (flags & kWIFFlipX) {
- dstPtr += w - 1;
- dstInc = -1;
+ dstPtr += (w - 1) * 2;
+ dstInc = -2;
}
while (h--) {
@@ -640,7 +662,7 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
code = -xoff;
}
- dstPtr += dstInc * code;
+ dstPtr += dstInc;
w -= code;
} else if (code & 2) {
code = (code >> 2) + 1;
@@ -658,18 +680,7 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
code += w;
}
while (code--) {
- uint16 col = READ_LE_UINT16(dataPtr);
- uint8 r = ((col >> 10) & 0x1F) << 3;
- uint8 g = ((col >> 5) & 0x1F) << 3;
- uint8 b = ((col >> 0) & 0x1F) << 3;
- col = _vm->convert16BitColor(col, r, g, b);
-
- if (type == kWizXMap) {
- *dstPtr = xmapPtr[col * 256 + *dstPtr];
- }
- if (type == kWizCopy) {
- *dstPtr = col;
- }
+ write16BitColor(dstPtr, dataPtr, dstType, xmapPtr);
dstPtr += dstInc;
}
dataPtr+= 2;
@@ -689,18 +700,7 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
code += w;
}
while (code--) {
- uint16 col = READ_LE_UINT16(dataPtr);
- uint8 r = ((col >> 10) & 0x1F) << 3;
- uint8 g = ((col >> 5) & 0x1F) << 3;
- uint8 b = ((col >> 0) & 0x1F) << 3;
- col = _vm->convert16BitColor(col, r, g, b);
-
- if (type == kWizXMap) {
- *dstPtr = xmapPtr[col * 256 + *dstPtr];
- }
- if (type == kWizCopy) {
- *dstPtr = col;
- }
+ write16BitColor(dstPtr, dataPtr, dstType, xmapPtr);
dataPtr += 2;
dstPtr += dstInc;
}
@@ -713,7 +713,36 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
}
template
-void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::write8BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
+ if (bitDepth == 2) {
+ if (type == kWizXMap) {
+ uint16 color = READ_LE_UINT16(palPtr + *dataPtr * 2);
+ uint16 srcColor = (color >> 1) & 0x7DEF;
+ uint16 dstColor = (READ_UINT16(dstPtr) >> 1) & 0x7DEF;
+ uint16 newColor = srcColor + dstColor;
+ writeColor(dstPtr, dstType, newColor);
+ }
+ if (type == kWizRMap) {
+ writeColor(dstPtr, dstType, READ_LE_UINT16(palPtr + *dataPtr * 2));
+ }
+ if (type == kWizCopy) {
+ writeColor(dstPtr, dstType, *dataPtr);
+ }
+ } else {
+ if (type == kWizXMap) {
+ *dstPtr = xmapPtr[*dataPtr * 256 + *dstPtr];
+ }
+ if (type == kWizRMap) {
+ *dstPtr = palPtr[*dataPtr];
+ }
+ if (type == kWizCopy) {
+ *dstPtr = *dataPtr;
+ }
+ }
+}
+
+template
+void Wiz::decompressWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
const uint8 *dataPtr, *dataPtrNext;
uint8 code, *dstPtr, *dstPtrNext;
int h, w, xoff, dstInc;
@@ -742,9 +771,9 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const C
dstPtr += (h - 1) * dstPitch;
dstPitch = -dstPitch;
}
- dstInc = 1;
+ dstInc = bitDepth;
if (flags & kWIFFlipX) {
- dstPtr += w - 1;
+ dstPtr += (w - 1) * bitDepth;
dstInc = -1;
}
@@ -784,15 +813,7 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const C
code += w;
}
while (code--) {
- if (type == kWizXMap) {
- *dstPtr = xmapPtr[*dataPtr * 256 + *dstPtr];
- }
- if (type == kWizRMap) {
- *dstPtr = palPtr[*dataPtr];
- }
- if (type == kWizCopy) {
- *dstPtr = *dataPtr;
- }
+ write8BitColor(dstPtr, dataPtr, dstType, palPtr, xmapPtr, bitDepth);
dstPtr += dstInc;
}
dataPtr++;
@@ -812,15 +833,8 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const C
code += w;
}
while (code--) {
- if (type == kWizXMap) {
- *dstPtr = xmapPtr[*dataPtr++ * 256 + *dstPtr];
- }
- if (type == kWizRMap) {
- *dstPtr = palPtr[*dataPtr++];
- }
- if (type == kWizCopy) {
- *dstPtr = *dataPtr++;
- }
+ write8BitColor(dstPtr, dataPtr, dstType, palPtr, xmapPtr, bitDepth);
+ dataPtr++;
dstPtr += dstInc;
}
}
@@ -832,7 +846,7 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const C
}
template
-void Wiz::decompressRawWizImage(uint8 *dst, int dstPitch, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr) {
+void Wiz::decompressRawWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr, uint8 bitDepth) {
if (type == kWizRMap) {
assert(palPtr != 0);
}
@@ -845,10 +859,18 @@ void Wiz::decompressRawWizImage(uint8 *dst, int dstPitch, const uint8 *src, int
uint8 col = src[i];
if (transColor == -1 || transColor != col) {
if (type == kWizRMap) {
- dst[i] = palPtr[col];
+ if (bitDepth == 2) {
+ writeColor(dst + i * 2, dstType, READ_LE_UINT16(palPtr + col * 2));
+ } else {
+ dst[i] = palPtr[col];
+ }
}
if (type == kWizCopy) {
- dst[i] = col;
+ if (bitDepth == 2) {
+ writeColor(dst + i * 2, dstType, col);
+ } else {
+ dst[i] = col;
+ }
}
}
}
@@ -938,7 +960,7 @@ uint16 Wiz::getWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint
}
if (bitDepth == 2)
- return (READ_LE_UINT16(data) & 1) ? color : READ_LE_UINT16(data + 1);
+ return (READ_LE_UINT16(data) & 1) ? color : READ_LE_UINT16(data + 2);
else
return (data[0] & 1) ? color : data[1];
@@ -949,7 +971,7 @@ uint16 Wiz::getRawWizPixelColor(const uint8 *data, int x, int y, int w, int h, u
return color;
}
if (bitDepth == 2)
- return READ_LE_UINT16(data + y * w + x * 2);
+ return READ_LE_UINT16(data + (y * w + x) * 2);
else
return data[y * w + x];
}
@@ -1038,6 +1060,22 @@ void Wiz::computeRawWizHistogram(uint32 *histogram, const uint8 *data, int srcPi
}
}
+static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common::Rect& rCapt) {
+ debug(9, "wizPackType2([%d,%d,%d,%d])", rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
+ int w = rCapt.width();
+ int h = rCapt.height();
+ int size = w * h * 2;
+ if (dst) {
+ src += rCapt.top * srcPitch + rCapt.left * 2;
+ while (h--) {
+ memcpy(dst, src, w * 2);
+ dst += w * 2;
+ src += srcPitch;
+ }
+ }
+ return size;
+}
+
static int wizPackType1(uint8 *dst, const uint8 *src, int srcPitch, const Common::Rect& rCapt, uint8 transColor) {
debug(9, "wizPackType1(%d, [%d,%d,%d,%d])", transColor, rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
src += rCapt.top * srcPitch + rCapt.left;
@@ -1174,7 +1212,7 @@ static int wizPackType0(uint8 *dst, const uint8 *src, int srcPitch, const Common
}
void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, int compType) {
- debug(5, "ScummEngine_v72he::captureWizImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom);
+ debug(0, "captureWizImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom);
uint8 *src = NULL;
VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
if (backBuffer) {
@@ -1187,7 +1225,7 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
rCapt.clip(r);
const uint8 *palPtr;
if (_vm->_game.heversion >= 99) {
- palPtr = _vm->_hePalettes + 1024;
+ palPtr = _vm->_hePalettes + _vm->_hePaletteSlot;
} else {
palPtr = _vm->_currentPalette;
}
@@ -1196,6 +1234,9 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
int h = rCapt.height();
int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
+ if (_vm->_game.features & GF_16BIT_COLOR)
+ compType = 2;
+
// compute compressed size
int dataSize = 0;
int headerSize = palPtr ? 1080 : 36;
@@ -1206,6 +1247,9 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
case 1:
dataSize = wizPackType1(0, src, pvs->pitch, rCapt, transColor);
break;
+ case 2:
+ dataSize = wizPackType2(0, src, pvs->pitch, rCapt);
+ break;
default:
error("unhandled compression type %d", compType);
break;
@@ -1249,6 +1293,9 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
case 1:
wizPackType1(wizImg + headerSize, src, pvs->pitch, rCapt, transColor);
break;
+ case 2:
+ wizPackType2(wizImg + headerSize, src, pvs->pitch, rCapt);
+ break;
default:
break;
}
@@ -1274,24 +1321,15 @@ void Wiz::displayWizImage(WizImage *pwi) {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, 0, 0, 0);
} else {
const Common::Rect *r = NULL;
- drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, 0, 0, 0, r, pwi->flags, 0, 0);
+ drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, 0, 0, 0, r, pwi->flags, 0, _vm->getHEPaletteSlot(0));
}
}
-uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int palette) {
- debug(3, "drawWizImage(resNum %d, x1 %d y1 %d flags 0x%X zorder %d shadow %d field_390 %d dstResNum %d palette %d)", resNum, x1, y1, flags, zorder, shadow, field_390, dstResNum, palette);
+uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, const uint8 *palPtr) {
+ debug(3, "drawWizImage(resNum %d, x1 %d y1 %d flags 0x%X zorder %d shadow %d field_390 %d dstResNum %d)", resNum, x1, y1, flags, zorder, shadow, field_390, dstResNum);
uint8 *dataPtr;
uint8 *dst = NULL;
- const uint8 *palPtr = NULL;
- if (_vm->_game.heversion >= 99) {
- if (palette) {
- palPtr = _vm->_hePalettes + palette * 1024 + 768;
- } else {
- palPtr = _vm->_hePalettes + 1792;
- }
- }
-
const uint8 *xmapPtr = NULL;
if (shadow) {
dataPtr = _vm->getResourceAddress(rtImage, shadow);
@@ -1334,13 +1372,25 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
error("WizImage printing is unimplemented");
}
- int32 cw, ch;
+ int32 dstPitch, dstType, cw, ch;
if (flags & kWIFBlitToMemBuffer) {
- dst = (uint8 *)malloc(width * height);
+ dst = (uint8 *)malloc(width * height * _vm->_bitDepth);
int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? (_vm->VAR(_vm->VAR_WIZ_TCOLOR)) : 5;
- memset(dst, transColor, width * height);
+
+ if (_vm->_bitDepth == 2) {
+ uint8 *tmpPtr = dst;
+ for (uint i = 0; i < height; i++) {
+ for (uint j = 0; j < width; j++)
+ WRITE_LE_UINT16(tmpPtr + j * 2, transColor);
+ tmpPtr += width * 2;
+ }
+ } else {
+ memset(dst, transColor, width * height);
+ }
cw = width;
ch = height;
+ dstPitch = cw * _vm->_bitDepth;
+ dstType = kDstMemory;
} else {
if (dstResNum) {
uint8 *dstPtr = _vm->getResourceAddress(rtImage, dstResNum);
@@ -1348,6 +1398,8 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
assert(dst);
getWizImageDim(dstResNum, 0, cw, ch);
+ dstPitch = cw * _vm->_bitDepth;
+ dstType = kDstResource;
} else {
VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
if (flags & kWIFMarkBufferDirty) {
@@ -1357,6 +1409,8 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
}
cw = pvs->w;
ch = pvs->h;
+ dstPitch = pvs->pitch;
+ dstType = kDstScreen;
}
}
@@ -1376,7 +1430,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
}
}
- if (flags & kWIFRemapPalette) {
+ if (flags & kWIFRemapPalette && _vm->_bitDepth == 1) {
palPtr = rmap + 4;
}
@@ -1388,28 +1442,27 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
switch (comp) {
case 0:
- copyRawWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, transColor);
+ copyRawWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, transColor, _vm->_bitDepth);
break;
case 1:
if (flags & 0x80) {
dst = _vm->getMaskBuffer(0, 0, 1);
- copyWizImageWithMask(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
+ copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
} else if (flags & 0x100) {
dst = _vm->getMaskBuffer(0, 0, 1);
- copyWizImageWithMask(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, 0, 1);
+ copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 1);
} else {
- copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr);
+ copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bitDepth);
}
break;
case 2:
- copyRaw16BitWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, transColor);
+ copyRaw16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, transColor);
break;
case 4:
// TODO: Unknown image type
break;
case 5:
- // TODO: 16bit color compressed image
- copy16BitWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr);
+ copy16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr);
break;
default:
error("drawWizImage: Unhandled wiz compression type %d", comp);
@@ -1539,7 +1592,7 @@ void Wiz::drawWizPolygon(int resNum, int state, int id, int flags, int shadow, i
}
void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int flags, int shadow, int dstResNum, int palette) {
- debug(3, "drawWizPolygonTransform(resNum %d, flags 0x%X, shadow %d dstResNum %d palette %d)", resNum, flags, shadow, dstResNum, palette);
+ debug(0, "drawWizPolygonTransform(resNum %d, flags 0x%X, shadow %d dstResNum %d palette %d)", resNum, flags, shadow, dstResNum, palette);
const Common::Rect *r = NULL;
uint8 *srcWizBuf = NULL;
bool freeBuffer = true;
@@ -1552,8 +1605,10 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
if (flags & 0x800000) {
debug(0, "drawWizPolygonTransform() unhandled flag 0x800000");
}
- srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, flags, 0, palette);
+
+ srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, flags, 0, _vm->getHEPaletteSlot(palette));
} else {
+ assert(_vm->_bitDepth == 1);
uint8 *dataPtr = _vm->getResourceAddress(rtImage, resNum);
assert(dataPtr);
srcWizBuf = _vm->findWrappedBlock(MKID_BE('WIZD'), dataPtr, state, 0);
@@ -1562,7 +1617,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
}
} else {
if (getWizImageData(resNum, state, 0) != 0) {
- srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, kWIFBlitToMemBuffer, 0, palette);
+ srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
} else {
uint8 *dataPtr = _vm->getResourceAddress(rtImage, resNum);
assert(dataPtr);
@@ -1584,7 +1639,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
assert(dst);
getWizImageDim(dstResNum, 0, dstw, dsth);
- dstpitch = dstw;
+ dstpitch = dstw * _vm->_bitDepth;
} else {
if (flags & kWIFMarkBufferDirty) {
dst = pvs->getPixels(0, 0);
@@ -1666,7 +1721,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
int16 width = ppa->xmax - ppa->xmin + 1;
pra->x_step = ((ppa->x2 - ppa->x1) << 16) / width;
pra->y_step = ((ppa->y2 - ppa->y1) << 16) / width;
- pra->dst_offs = yoff + x1;
+ pra->dst_offs = yoff + x1 * _vm->_bitDepth;
pra->w = w;
pra->x_s = ppa->x1 << 16;
pra->y_s = ppa->y1 << 16;
@@ -1695,10 +1750,14 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
assert(src_offs < wizW * wizH);
x_acc += pra->x_step;
y_acc += pra->y_step;
- if (transColor == -1 || transColor != srcWizBuf[src_offs]) {
- *dstPtr = srcWizBuf[src_offs];
+ if (_vm->_bitDepth == 2) {
+ if (transColor == -1 || transColor != READ_LE_UINT16(srcWizBuf + src_offs * 2))
+ WRITE_LE_UINT16(dstPtr, READ_LE_UINT16(srcWizBuf + src_offs * 2));
+ } else {
+ if (transColor == -1 || transColor != srcWizBuf[src_offs])
+ *dstPtr = srcWizBuf[src_offs];
}
- dstPtr++;
+ dstPtr += _vm->_bitDepth;
}
}
@@ -1721,13 +1780,13 @@ void Wiz::flushWizBuffer() {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->shadow, 0, pwi->palette);
} else {
const Common::Rect *r = NULL;
- drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->shadow, pwi->field_390, r, pwi->flags, 0, pwi->palette);
+ drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->shadow, pwi->field_390, r, pwi->flags, 0, _vm->getHEPaletteSlot(pwi->palette));
}
}
_imagesNum = 0;
}
-void Wiz::loadWizCursor(int resId) {
+void Wiz::loadWizCursor(int resId, int palette) {
int32 x, y;
getWizImageSpot(resId, 0, x, y);
if (x < 0) {
@@ -1742,7 +1801,10 @@ void Wiz::loadWizCursor(int resId) {
}
const Common::Rect *r = NULL;
- uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
+ _vm->_bitDepth = 1;
+ uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
+ _vm->_bitDepth = (_vm->_game.features & GF_16BIT_COLOR) ? 2 : 1;
+
int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
_vm->setCursorHotspot(x, y);
@@ -1758,7 +1820,8 @@ void Wiz::displayWizComplexImage(const WizParameters *params) {
int sourceImage = 0;
if (params->processFlags & kWPFMaskImg) {
sourceImage = params->sourceImage;
- debug(0, "displayWizComplexImage() unhandled flag kWPFMaskImg");
+ debug(3, "displayWizComplexImage() unhandled flag kWPFMaskImg");
+ return;
}
int palette = 0;
if (params->processFlags & kWPFPaletteNum) {
@@ -1827,14 +1890,14 @@ void Wiz::displayWizComplexImage(const WizParameters *params) {
} else {
if (sourceImage != 0) {
// TODO: Add support for kWPFMaskImg
- drawWizImage(params->sourceImage, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, palette);
+ drawWizImage(params->sourceImage, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));
} else if (params->processFlags & (kWPFScaled | kWPFRotate)) {
drawWizComplexPolygon(params->img.resNum, state, po_x, po_y, shadow, rotationAngle, scale, r, flags, dstResNum, palette);
} else {
if (flags & kWIFIsPolygon) {
drawWizPolygon(params->img.resNum, state, po_x, flags, shadow, dstResNum, palette);
} else {
- drawWizImage(params->img.resNum, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, palette);
+ drawWizImage(params->img.resNum, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));
}
}
}
@@ -1842,6 +1905,8 @@ void Wiz::displayWizComplexImage(const WizParameters *params) {
void Wiz::createWizEmptyImage(int resNum, int img_x, int img_y, int img_w, int img_h) {
const uint16 flags = 0xB;
+ const uint8 compType = (_vm->_game.features & GF_16BIT_COLOR) ? 2 : 0;
+ const uint8 bitDepth = (_vm->_game.features & GF_16BIT_COLOR) ? 2 : 1;
int res_size = 0x1C;
if (flags & 1) {
res_size += 0x308;
@@ -1852,11 +1917,11 @@ void Wiz::createWizEmptyImage(int resNum, int img_x, int img_y, int img_w, int i
if (flags & 8) {
res_size += 0x10C;
}
- res_size += 8 + img_w * img_h;
+ res_size += 8 + img_w * img_h * bitDepth;
const uint8 *palPtr;
if (_vm->_game.heversion >= 99) {
- palPtr = _vm->_hePalettes + 1024;
+ palPtr = _vm->_hePalettes + _vm->_hePaletteSlot;
} else {
palPtr = _vm->_currentPalette;
}
@@ -1869,7 +1934,7 @@ void Wiz::createWizEmptyImage(int resNum, int img_x, int img_y, int img_w, int i
WRITE_BE_UINT32(res_data, res_size); res_data += 4;
WRITE_BE_UINT32(res_data, 'WIZH'); res_data += 4;
WRITE_BE_UINT32(res_data, 0x14); res_data += 4;
- WRITE_LE_UINT32(res_data, 0); res_data += 4;
+ WRITE_LE_UINT32(res_data, compType); res_data += 4;
WRITE_LE_UINT32(res_data, img_w); res_data += 4;
WRITE_LE_UINT32(res_data, img_h); res_data += 4;
if (flags & 1) {
@@ -1892,7 +1957,7 @@ void Wiz::createWizEmptyImage(int resNum, int img_x, int img_y, int img_w, int i
}
}
WRITE_BE_UINT32(res_data, 'WIZD'); res_data += 4;
- WRITE_BE_UINT32(res_data, 8 + img_w * img_h); res_data += 4;
+ WRITE_BE_UINT32(res_data, 8 + img_w * img_h * bitDepth); res_data += 4;
}
_vm->_res->setModified(rtImage, resNum);
}
@@ -1909,7 +1974,8 @@ void Wiz::fillWizRect(const WizParameters *params) {
int c = READ_LE_UINT32(wizh + 0x0);
int w = READ_LE_UINT32(wizh + 0x4);
int h = READ_LE_UINT32(wizh + 0x8);
- assert(c == 0);
+ assert(c == 0 || c == 2);
+ uint8 bitDepth = (c == 2) ? 2 : 1;
Common::Rect areaRect, imageRect(w, h);
if (params->processFlags & kWPFClipBox) {
if (!imageRect.intersects(params->box)) {
@@ -1932,10 +1998,15 @@ void Wiz::fillWizRect(const WizParameters *params) {
assert(wizd);
int dx = areaRect.width();
int dy = areaRect.height();
- wizd += areaRect.top * w + areaRect.left;
+ wizd += (areaRect.top * w + areaRect.left) * bitDepth;
while (dy--) {
- memset(wizd, color, dx);
- wizd += w;
+ if (bitDepth == 2) {
+ for (int i = 0; i < dx; i++)
+ WRITE_LE_UINT16(wizd + i * 2, color);
+ } else {
+ memset(wizd, color, dx);
+ }
+ wizd += w * bitDepth;
}
}
}
@@ -1945,14 +2016,19 @@ void Wiz::fillWizRect(const WizParameters *params) {
struct drawProcP {
Common::Rect *imageRect;
uint8 *wizd;
- int width;
+ int pitch;
+ int depth;
};
static void drawProc(int x, int y, int c, void *data) {
drawProcP *param = (drawProcP *)data;
if (param->imageRect->contains(x, y)) {
- *(param->wizd + y * param->width + x) = c;
+ uint32 offs = y * param->pitch + x * param->depth;
+ if (param->depth == 2)
+ WRITE_LE_UINT16(param->wizd + offs, c);
+ else
+ *(param->wizd + offs) = c;
}
}
@@ -1969,7 +2045,8 @@ void Wiz::fillWizLine(const WizParameters *params) {
int c = READ_LE_UINT32(wizh + 0x0);
int w = READ_LE_UINT32(wizh + 0x4);
int h = READ_LE_UINT32(wizh + 0x8);
- assert(c == 0);
+ assert(c == 0 || c == 2);
+ uint8 bitDepth = (c == 2) ? 2 : 1;
Common::Rect imageRect(w, h);
if (params->processFlags & kWPFClipBox) {
if (!imageRect.intersects(params->box)) {
@@ -1992,13 +2069,13 @@ void Wiz::fillWizLine(const WizParameters *params) {
lineP.imageRect = &imageRect;
lineP.wizd = wizd;
- lineP.width = w;
+ lineP.pitch = w * bitDepth;
+ lineP.depth = bitDepth;
if (params->processFlags & kWPFParams) {
assert (params->params2 == 1); // Catch untested usage
Graphics::drawThickLine(x1, y1, x2, y2, params->params1, color, drawProc, &lineP);
} else {
-
Graphics::drawLine(x1, y1, x2, y2, color, drawProc, &lineP);
}
}
@@ -2167,6 +2244,9 @@ void Wiz::processWizImage(const WizParameters *params) {
img_x = params->img.x1;
img_y = params->img.y1;
}
+ if (params->processFlags & kWPFParams) {
+ debug(0, "Compression %d Color Depth %d", params->params1, params->params2);
+ }
createWizEmptyImage(params->img.resNum, img_x, img_y, img_w, img_h);
}
break;
@@ -2304,7 +2384,7 @@ int Wiz::isWizPixelNonTransparent(int resNum, int state, int x, int y, int flags
ret = isWizPixelNonTransparent(wizd, x, y, w, h, 1);
break;
case 2:
- ret = getRawWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR)) != _vm->VAR(_vm->VAR_WIZ_TCOLOR) ? 1 : 0;
+ ret = getRawWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR)) != _vm->VAR(_vm->VAR_WIZ_TCOLOR) ? 1 : 0;
break;
case 4:
// TODO: Unknown image type
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index e6ea0fe57e..edc42e8788 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -142,6 +142,12 @@ enum {
kWizCopy
};
+enum DstSurface {
+ kDstScreen = 0,
+ kDstMemory = 1,
+ kDstResource = 2
+};
+
class ScummEngine_v71he;
class Wiz {
@@ -188,27 +194,32 @@ public:
void flushWizBuffer();
void getWizImageSpot(int resId, int state, int32 &x, int32 &y);
- void loadWizCursor(int resId);
+ void loadWizCursor(int resId, int palette);
void captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType);
void displayWizComplexImage(const WizParameters *params);
void displayWizImage(WizImage *pwi);
void processWizImage(const WizParameters *params);
- uint8 *drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int palette);
+ uint8 *drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, const uint8 *palPtr);
void drawWizPolygon(int resNum, int state, int id, int flags, int shadow, int dstResNum, int palette);
void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int palette);
void drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int flags, int shadow, int dstResNum, int palette);
- static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch);
- static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
- static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP);
- void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
- static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
- void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
- template static void decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
- template void decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
- template static void decompressRawWizImage(uint8 *dst, int dstPitch, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr = NULL);
+ static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, uint8 bitdepth);
+ static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP);
+ static void copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
+ static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitdepth);
+ static void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr);
+ static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor);
+ template static void decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
+ template static void decompressWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
+ template static void decompressRawWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr, uint8 bitdepth);
+
+ template static void write16BitColor(uint8 *dst, const uint8 *src, int dstType, const uint8 *xmapPtr);
+ template static void write8BitColor(uint8 *dst, const uint8 *src, int dstType, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth);
+ static void writeColor(uint8 *dstPtr, int dstType, uint16 color);
+
int isWizPixelNonTransparent(const uint8 *data, int x, int y, int w, int h, uint8 bitdepth);
uint16 getWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 bitDepth, uint16 color);
uint16 getRawWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 bitDepth, uint16 color);
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index a2cd4a0d4d..c6ec85cd88 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -310,9 +310,6 @@ void ScummEngine::setDirtyColors(int min, int max) {
_palDirtyMin = min;
if (_palDirtyMax < max)
_palDirtyMax = max;
-
- if (_hePaletteCache)
- memset(_hePaletteCache, -1, 65536);
}
void ScummEngine::initCycl(const byte *ptr) {
@@ -813,16 +810,6 @@ void ScummEngine_v8::desaturatePalette(int hueScale, int satScale, int lightScal
#endif
-int ScummEngine::convert16BitColor(uint16 color, uint8 r, uint8 g, uint8 b) {
- // HACK: Find the closest matching color, and store in
- // cache for faster access.
- if (_hePaletteCache[color] == -1) {
- _hePaletteCache[color] = remapPaletteColor(r, g, b, -1);
- }
-
- return _hePaletteCache[color];
-}
-
int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
byte *pal;
int ar, ag, ab, i;
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index cef13341b5..051873e147 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1505,7 +1505,7 @@ void ScummEngine_v90he::saveOrLoad(Serializer *s) {
void ScummEngine_v99he::saveOrLoad(Serializer *s) {
ScummEngine_v90he::saveOrLoad(s);
- s->saveLoadArrayOf(_hePalettes, (_numPalettes + 1) * 1024, sizeof(_hePalettes[0]), sleUint8);
+ s->saveLoadArrayOf(_hePalettes, (_numPalettes + 1) * _hePaletteSlot, sizeof(_hePalettes[0]), sleUint8);
}
void ScummEngine_v100he::saveOrLoad(Serializer *s) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index cbfa720e79..17ffc6e5b0 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -248,6 +248,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_switchRoomEffect2 = 0;
_switchRoomEffect = 0;
+ _bitDepth = 0;
_doEffect = false;
_snapScroll = false;
_currentLights = 0;
@@ -264,8 +265,8 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_palManipPalette = NULL;
_palManipIntermediatePal = NULL;
memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
- _hePaletteCache = NULL;
_hePalettes = NULL;
+ _hePaletteSlot = 0;
_shadowPalette = NULL;
_shadowPaletteSize = 0;
memset(_currentPalette, 0, sizeof(_currentPalette));
@@ -521,9 +522,11 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_screenHeight = 200;
}
+ _bitDepth = (_game.features & GF_16BIT_COLOR) ? 2 : 1;
+
// Allocate gfx compositing buffer (not needed for V7/V8 games).
if (_game.version < 7)
- _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight);
+ _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight * _bitDepth);
else
_compositeBuf = 0;
@@ -814,7 +817,6 @@ ScummEngine_v90he::~ScummEngine_v90he() {
delete _logicHE;
}
if (_game.heversion >= 99) {
- free(_hePaletteCache);
free(_hePalettes);
}
}
@@ -1182,7 +1184,7 @@ void ScummEngine::setupScumm() {
int maxHeapThreshold = -1;
if (_game.features & GF_16BIT_COLOR) {
- // 16Bit color games require double the memory, due to increased resource sizes.
+ // 16bit color games require double the memory, due to increased resource sizes.
maxHeapThreshold = 12 * 1024 * 1024;
} else if (_game.features & GF_NEW_COSTUMES) {
// Since the new costumes are very big, we increase the heap limit, to avoid having
@@ -1204,7 +1206,7 @@ void ScummEngine::setupScumm() {
}
free(_compositeBuf);
- _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier);
+ _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier * _bitDepth);
}
#ifdef ENABLE_SCUMM_7_8
@@ -1542,11 +1544,9 @@ void ScummEngine_v99he::resetScumm() {
ScummEngine_v90he::resetScumm();
- _hePaletteCache = (int16 *)malloc(65536);
- memset(_hePaletteCache, -1, 65536);
-
- _hePalettes = (uint8 *)malloc((_numPalettes + 1) * 1024);
- memset(_hePalettes, 0, (_numPalettes + 1) * 1024);
+ _hePaletteSlot = (_game.features & GF_16BIT_COLOR) ? 1280 : 1024;
+ _hePalettes = (uint8 *)malloc((_numPalettes + 1) * _hePaletteSlot);
+ memset(_hePalettes, 0, (_numPalettes + 1) * _hePaletteSlot);
// Array 129 is set to base name
len = strlen(_filenamePattern.pattern);
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index ff3852ee83..c4b2ab9e56 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -954,6 +954,7 @@ public:
int _screenTop;
Common::RenderMode _renderMode;
+ uint8 _bitDepth;
protected:
ColorCycle _colorCycle[16]; // Palette cycles
@@ -1039,7 +1040,8 @@ protected:
virtual void palManipulateInit(int resID, int start, int end, int time);
void palManipulate();
public:
- int convert16BitColor(uint16 color, uint8 r, uint8 g, uint8 b);
+ uint8 *getHEPaletteSlot(uint16 palSlot);
+ uint16 get16BitColor(uint8 r, uint8 g, uint8 b);
int remapPaletteColor(int r, int g, int b, int threshold); // Used by Actor::remapActorPalette
protected:
void moveMemInPalRes(int start, int end, byte direction);
@@ -1115,7 +1117,7 @@ public:
// HE specific
byte _HEV7ActorPalette[256];
uint8 *_hePalettes;
- int16 *_hePaletteCache;
+ uint16 _hePaletteSlot;
protected:
int _shadowPaletteSize;
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index fabe07b031..57dd468bbf 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/endian.h"
#include "common/scummsys.h"
#include "common/system.h"
@@ -107,11 +108,17 @@ static bool grabScreen565(Graphics::Surface *surf) {
for (uint y = 0; y < screen->h; ++y) {
for (uint x = 0; x < screen->w; ++x) {
- byte r, g, b;
- r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4];
- g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1];
- b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2];
-
+ byte r, g, b;
+ if (screen->bytesPerPixel == 2) {
+ uint16 col = READ_UINT16(screen->getBasePtr(x, y));
+ r = ((col >> 10) & 0x1F) << 3;
+ g = ((col >> 5) & 0x1F) << 3;
+ b = ((col >> 0) & 0x1F) << 3;
+ } else {
+ r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4];
+ g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1];
+ b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2];
+ }
((uint16*)surf->pixels)[y * surf->w + x] = Graphics::RGBToColor >(r, g, b);
}
}
--
cgit v1.2.3
From bf212d7b2f4f3b8851a6cd44c4c922cf0f46f94b Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 4 Jun 2009 09:30:12 +0000
Subject: Fix regression in copyWizImageWithMask, which caused corruption in
readtime.
svn-id: r41157
---
engines/scumm/he/wiz_he.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 1c3867b980..ff58623479 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -450,7 +450,7 @@ void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int d
if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
return;
}
- dstw = dstw / 8;
+ dstPitch /= 8;
dst += dstRect.top * dstPitch + dstRect.left / 8;
const uint8 *dataPtr, *dataPtrNext;
@@ -1447,9 +1447,11 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
case 1:
if (flags & 0x80) {
dst = _vm->getMaskBuffer(0, 0, 1);
+ dstPitch = _vm->_bitDepth;
copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
} else if (flags & 0x100) {
dst = _vm->getMaskBuffer(0, 0, 1);
+ dstPitch /= _vm->_bitDepth;
copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 1);
} else {
copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bitDepth);
--
cgit v1.2.3
From d1210392ef1c755fc0c513d81e4981141e6963ee Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 4 Jun 2009 09:32:36 +0000
Subject: Ooops, correct typo in last commit.
svn-id: r41158
---
engines/scumm/he/wiz_he.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index ff58623479..f9e76e682e 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1447,7 +1447,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
case 1:
if (flags & 0x80) {
dst = _vm->getMaskBuffer(0, 0, 1);
- dstPitch = _vm->_bitDepth;
+ dstPitch /= _vm->_bitDepth;
copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
} else if (flags & 0x100) {
dst = _vm->getMaskBuffer(0, 0, 1);
--
cgit v1.2.3
From d08c592bfd4c1b74e91227847c04afe2b7ca7ff4 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 4 Jun 2009 09:36:13 +0000
Subject: Update drawBMAPObject for 16bit color.
svn-id: r41159
---
engines/scumm/gfx.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index a141d51735..0427e32326 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1956,13 +1956,11 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
}
void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h) {
- assert(_vm->_bitDepth == 1);
-
const byte *bmap_ptr = _vm->findResourceData(MKID_BE('BMAP'), ptr);
assert(bmap_ptr);
byte code = *bmap_ptr++;
- int scrX = _vm->_screenStartStrip * 8;
+ int scrX = _vm->_screenStartStrip * 8 * _vm->_bitDepth;
if (code == 8 || code == 9) {
Common::Rect rScreen(0, 0, vs->w, vs->h);
--
cgit v1.2.3
From a45b902716aa3a86e56efaefeee1d6ae3113fbd1 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 4 Jun 2009 09:49:06 +0000
Subject: Ooops, re-enable codec32 code.
svn-id: r41161
---
engines/scumm/akos.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index edfbe5730d..347b5a03fc 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -1301,8 +1301,6 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) {
}
byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
- return 0;
-
#ifdef ENABLE_HE
Common::Rect src, dst;
--
cgit v1.2.3
From fdbc49ab5f4b9320e4cdac8edd427304910d8235 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 4 Jun 2009 11:03:45 +0000
Subject: Fix the color of Poodles Galore's finger nails in Spy Fox 3.
svn-id: r41162
---
engines/scumm/actor.cpp | 5 +++--
engines/scumm/actor.h | 2 +-
engines/scumm/akos.cpp | 2 +-
engines/scumm/akos.h | 2 +-
engines/scumm/base-costume.h | 2 +-
engines/scumm/costume.cpp | 13 ++++++++-----
engines/scumm/costume.h | 6 +++---
engines/scumm/he/script_v100he.cpp | 6 +-----
engines/scumm/he/script_v90he.cpp | 6 +-----
engines/scumm/saveload.h | 2 +-
10 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index eea1ec070b..f3c8e2ff6b 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2484,9 +2484,10 @@ void Actor::saveLoadWithSerializer(Serializer *ser) {
MKLINE(Actor, _flip, sleByte, VER(32)),
MKLINE(Actor, _heSkipLimbs, sleByte, VER(32)),
- // Actor palette grew from 64 to 256 bytes
+ // Actor palette grew from 64 to 256 bytes and switched to uint16 in HE games
MKARRAY_OLD(Actor, _palette[0], sleByte, 64, VER(8), VER(9)),
- MKARRAY(Actor, _palette[0], sleByte, 256, VER(10)),
+ MKARRAY_OLD(Actor, _palette[0], sleByte, 256, VER(10), VER(77)),
+ MKARRAY(Actor, _palette[0], sleUint16, 256, VER(78)),
MK_OBSOLETE(Actor, _mask, sleByte, VER(8), VER(9)),
MKLINE(Actor, _shadowMode, sleByte, VER(8)),
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index 3e8fe6626b..d32f268b11 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -157,7 +157,7 @@ protected:
};
- byte _palette[256];
+ uint16 _palette[256];
int _elevation;
uint16 _facing;
uint16 _targetFacing;
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index 347b5a03fc..b7e36b7cea 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -289,7 +289,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
} while ((uint16)mask);
}
-void AkosRenderer::setPalette(byte *new_palette) {
+void AkosRenderer::setPalette(uint16 *new_palette) {
uint size, i;
size = _vm->getResourceDataSize(akpl);
diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h
index 17576e5869..9f4f09d4dc 100644
--- a/engines/scumm/akos.h
+++ b/engines/scumm/akos.h
@@ -107,7 +107,7 @@ public:
int16 _actorHitX, _actorHitY;
bool _actorHitResult;
- void setPalette(byte *_palette);
+ void setPalette(uint16 *_palette);
void setFacing(const Actor *a);
void setCostume(int costume, int shadow);
diff --git a/engines/scumm/base-costume.h b/engines/scumm/base-costume.h
index 59ca3ded1f..d41d795e34 100644
--- a/engines/scumm/base-costume.h
+++ b/engines/scumm/base-costume.h
@@ -145,7 +145,7 @@ public:
}
virtual ~BaseCostumeRenderer() {}
- virtual void setPalette(byte *palette) = 0;
+ virtual void setPalette(uint16 *palette) = 0;
virtual void setFacing(const Actor *a) = 0;
virtual void setCostume(int costume, int shadow) = 0;
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 82497de87a..4358e03a2a 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -791,7 +791,7 @@ byte ClassicCostumeRenderer::drawLimb(const Actor *a, int limb) {
}
-void NESCostumeRenderer::setPalette(byte *palette) {
+void NESCostumeRenderer::setPalette(uint16 *palette) {
// TODO
}
@@ -874,17 +874,20 @@ void ClassicCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask)
} while (mask&0xFFFF);
}
-void ClassicCostumeRenderer::setPalette(byte *palette) {
+void ClassicCostumeRenderer::setPalette(uint16 *palette) {
int i;
byte color;
if (_loaded._format == 0x57) {
- memcpy(_palette, palette, 13);
+ for (i = 0; i < 13; i++)
+ _palette[i] = color;
} else if (_vm->_game.features & GF_OLD_BUNDLE) {
if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) {
- memcpy(_palette, palette, 16);
+ for (i = 0; i < 16; i++)
+ _palette[i] = color;
} else {
- memset(_palette, 8, 16);
+ for (i = 0; i < 16; i++)
+ _palette[i] = 8;
_palette[12] = 0;
}
_palette[_loaded._palette[0]] = _palette[0];
diff --git a/engines/scumm/costume.h b/engines/scumm/costume.h
index 003bd6ce2b..ecb12986cf 100644
--- a/engines/scumm/costume.h
+++ b/engines/scumm/costume.h
@@ -94,7 +94,7 @@ protected:
public:
ClassicCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
- void setPalette(byte *palette);
+ void setPalette(uint16 *palette);
void setFacing(const Actor *a);
void setCostume(int costume, int shadow);
@@ -116,7 +116,7 @@ protected:
public:
NESCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
- void setPalette(byte *palette);
+ void setPalette(uint16 *palette);
void setFacing(const Actor *a);
void setCostume(int costume, int shadow);
@@ -131,7 +131,7 @@ protected:
public:
C64CostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
- void setPalette(byte *palette) {}
+ void setPalette(uint16 *palette) {}
void setFacing(const Actor *a) {}
void setCostume(int costume, int shadow);
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index d588c26a77..90f2764b3d 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2617,11 +2617,7 @@ void ScummEngine_v100he::o100_getPaletteData() {
r = MAX(0, r);
r = MIN(r, 255);
if (_game.features & GF_16BIT_COLOR) {
- uint32 ar = ((r >> 3) << 10) & 0xFFFF;
- uint32 ag = ((g >> 3) << 5) & 0xFFFF;
- uint32 ab = ((b >> 3) << 0) & 0xFFFF;
- uint32 col = ar | ag | ab;
- push(col);
+ push(get16BitColor(r, g, b));
} else {
push(getHEPaletteSimilarColor(1, r, g, 10, 245));
}
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 212ba69bdc..c6b919f554 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -2147,11 +2147,7 @@ void ScummEngine_v90he::o90_getPaletteData() {
r = MIN(r, 255);
if (_game.features & GF_16BIT_COLOR) {
- uint32 ar = ((r >> 3) << 10) & 0xFFFF;
- uint32 ag = ((g >> 3) << 5) & 0xFFFF;
- uint32 ab = ((b >> 3) << 0) & 0xFFFF;
- uint32 col = ar | ag | ab;
- push(col);
+ push(get16BitColor(r, g, b));
} else {
push(getHEPaletteSimilarColor(1, r, g, 10, 245));
}
diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h
index 29184ad023..49bfe39b21 100644
--- a/engines/scumm/saveload.h
+++ b/engines/scumm/saveload.h
@@ -50,7 +50,7 @@ namespace Scumm {
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
-#define CURRENT_VER 77
+#define CURRENT_VER 78
/**
* An auxillary macro, used to specify savegame versions. We use this instead
--
cgit v1.2.3
From be36b352fca2c3e6ec0ae3b0c33d0028927d5343 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 00:21:10 +0000
Subject: Sound resource 1 is used for queued speech in HE60+ games, and should
never be nuked, when expiring resources.
svn-id: r41182
---
engines/scumm/resource.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 874b787615..a3b1a5be77 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -922,7 +922,11 @@ bool ScummEngine::isResourceInUse(int type, int i) const {
case rtCostume:
return isCostumeInUse(i);
case rtSound:
- return _sound->isSoundInUse(i);
+ // Sound resource 1 is used for queued speech
+ if (_game.heversion >= 60 && i == 1)
+ return true;
+ else
+ return _sound->isSoundInUse(i);
case rtCharset:
return _charset->getCurID() == i;
case rtImage:
--
cgit v1.2.3
From fa2b1add9d2febe7dd2e5691eaa85f8e7725163c Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 00:28:07 +0000
Subject: Ooops, update asserts in grabScreen565() too.
svn-id: r41183
---
graphics/scaler/thumbnail_intern.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index 57dd468bbf..a542fe2268 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -99,7 +99,8 @@ static bool grabScreen565(Graphics::Surface *surf) {
if (!screen)
return false;
- assert(screen->bytesPerPixel == 1 && screen->pixels != 0);
+ assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2);
+ assert(screen->pixels != 0);
byte palette[256 * 4];
g_system->grabPalette(&palette[0], 0, 256);
--
cgit v1.2.3
From 9911c1bf59048d9661b720f3de6f33176b5ef1e2 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 00:33:25 +0000
Subject: Fix endian issue, the palette must be in little endian.
svn-id: r41184
---
engines/scumm/akos.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index b7e36b7cea..f4bb8a2c8b 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -1357,7 +1357,7 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
palPtr = _vm->_hePalettes + _paletteNum * _vm->_hePaletteSlot + 768;
} else if (rgbs) {
for (uint i = 0; i < 256; i++)
- _palette[i] = _vm->get16BitColor(rgbs[i * 3 + 0], rgbs[i * 3 + 1], rgbs[i * 3 + 2]);
+ WRITE_LE_UINT16(_palette + i, _vm->get16BitColor(rgbs[i * 3 + 0], rgbs[i * 3 + 1], rgbs[i * 3 + 2]));
palPtr = (uint8 *)_palette;
}
} else if (_vm->_game.heversion >= 99) {
--
cgit v1.2.3
From e90364c890dcea2ca824941495365ed915146d41 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 01:20:39 +0000
Subject: Update o72_getPixel() for 16bit color, and cleanup.
svn-id: r41187
---
engines/scumm/he/script_v72he.cpp | 12 +++++++++---
engines/scumm/he/wiz_he.cpp | 13 +++++--------
engines/scumm/he/wiz_he.h | 4 ++--
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index bb209e78d1..049fb13cd2 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1572,7 +1572,7 @@ void ScummEngine_v72he::o72_rename() {
}
void ScummEngine_v72he::o72_getPixel() {
- byte area;
+ uint16 area;
int y = pop();
int x = pop();
@@ -1587,11 +1587,17 @@ void ScummEngine_v72he::o72_getPixel() {
switch (subOp) {
case 9: // HE 100
case 218:
- area = *vs->getBackPixels(x, y - vs->topline);
+ if (_game.features & GF_16BIT_COLOR)
+ area = READ_UINT16(vs->getBackPixels(x, y - vs->topline));
+ else
+ area = *vs->getBackPixels(x, y - vs->topline);
break;
case 8: // HE 100
case 219:
- area = *vs->getPixels(x, y - vs->topline);
+ if (_game.features & GF_16BIT_COLOR)
+ area = READ_UINT16(vs->getPixels(x, y - vs->topline));
+ else
+ area = *vs->getPixels(x, y - vs->topline);
break;
default:
error("o72_getPixel: default case %d", subOp);
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index f9e76e682e..20ff7fa309 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -369,7 +369,7 @@ void Wiz::writeColor(uint8 *dstPtr, int dstType, uint16 color) {
}
}
-void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *xmapPtr) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
dst += r2.top * dstPitch + r2.left * 2;
@@ -382,7 +382,7 @@ void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstT
r1.translate(dx, 0);
}
if (xmapPtr) {
- decompress16BitWizImage(dst, dstPitch, dstType, src, r1, flags, palPtr, xmapPtr);
+ decompress16BitWizImage(dst, dstPitch, dstType, src, r1, flags, xmapPtr);
} else {
decompress16BitWizImage(dst, dstPitch, dstType, src, r1, flags);
}
@@ -608,7 +608,7 @@ void Wiz::write16BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, cons
}
template
-void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *xmapPtr) {
const uint8 *dataPtr, *dataPtrNext;
uint8 code;
uint8 *dstPtr, *dstPtrNext;
@@ -617,9 +617,6 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const u
if (type == kWizXMap) {
assert(xmapPtr != 0);
}
- if (type == kWizRMap) {
- assert(palPtr != 0);
- }
dstPtr = dst;
dataPtr = src;
@@ -683,7 +680,7 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const u
write16BitColor(dstPtr, dataPtr, dstType, xmapPtr);
dstPtr += dstInc;
}
- dataPtr+= 2;
+ dataPtr += 2;
} else {
code = (code >> 2) + 1;
if (xoff > 0) {
@@ -1464,7 +1461,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
// TODO: Unknown image type
break;
case 5:
- copy16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr);
+ copy16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, xmapPtr);
break;
default:
error("drawWizImage: Unhandled wiz compression type %d", comp);
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index edc42e8788..0a320e2426 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -210,9 +210,9 @@ public:
static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP);
static void copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitdepth);
- static void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr);
+ static void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *xmapPtr);
static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor);
- template static void decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
+ template static void decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *xmapPtr = NULL);
template static void decompressWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
template static void decompressRawWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr, uint8 bitdepth);
--
cgit v1.2.3
From 1f43d9b860b9c1a6d5e62cc261ff5da94b42d50e Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 04:28:07 +0000
Subject: Correct error in decompress16BitWizImage().
svn-id: r41190
---
engines/scumm/he/wiz_he.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 20ff7fa309..8fe2639fbb 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -659,7 +659,7 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const u
code = -xoff;
}
- dstPtr += dstInc;
+ dstPtr += dstInc * code;
w -= code;
} else if (code & 2) {
code = (code >> 2) + 1;
--
cgit v1.2.3
From f8361b5c53b96faddb56024bb932ce46b7005dbf Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 5 Jun 2009 06:41:04 +0000
Subject: Converted cursor code to use 16-bit.
svn-id: r41191
---
backends/platform/sdl/graphics.cpp | 17 +++++++++++++++++
engines/scumm/costume.cpp | 2 +-
engines/scumm/cursor.cpp | 14 ++++++++++----
engines/scumm/he/wiz_he.cpp | 4 +---
engines/scumm/scumm.h | 5 ++++-
graphics/cursorman.cpp | 4 ++++
6 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 389a7a0735..1a80b9be19 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1438,8 +1438,13 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
free(_mouseData);
+#ifdef ENABLE_16BIT
+ _mouseData = (byte *)malloc(w * h * 2);
+ memcpy(_mouseData, buf, w * h * 2);
+#else
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
+#endif
blitCursor();
}
@@ -1481,12 +1486,24 @@ void OSystem_SDL::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
color = *srcPtr;
+#ifdef ENABLE_16BIT
+ if (color != _mouseKeyColor) { // transparent, don't draw
+ int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3;
+ int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3;
+ int8 b = (*(uint16 *)srcPtr & 0x1F) << 3;
+ *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
+ r, g, b);
+ }
+ dstPtr += 2;
+ srcPtr += 2;
+#else
if (color != _mouseKeyColor) { // transparent, don't draw
*(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
palette[color].r, palette[color].g, palette[color].b);
}
dstPtr += 2;
srcPtr++;
+#endif
}
dstPtr += _mouseOrigSurface->pitch - w * 2;
}
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 4358e03a2a..089e7a2fbe 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -876,7 +876,7 @@ void ClassicCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask)
void ClassicCostumeRenderer::setPalette(uint16 *palette) {
int i;
- byte color;
+ byte color = 0;
if (_loaded._format == 0x57) {
for (i = 0; i < 13; i++)
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 64829114ca..66dd3807db 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -111,7 +111,13 @@ void ScummEngine_v6::setCursorTransparency(int a) {
}
void ScummEngine::updateCursor() {
- const int transColor = (_game.heversion >= 80) ? 5 : 255;
+ //HACK Put the 16-bit mapped color, and
+ //hope no other palette entry shares it
+ int transColor = (_game.heversion >= 80) ? 5 : 255;
+ if (_game.features & GF_16BIT_COLOR && _hePalettes)
+ transColor = READ_LE_UINT16(_hePalettes + 2048 + transColor * 2);
+ else
+ transColor = 0;
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
@@ -138,7 +144,7 @@ void ScummEngine::setCursorFromBuffer(const byte *ptr, int width, int height, in
uint size;
byte *dst;
- size = width * height;
+ size = width * height * _bitDepth;
if (size > sizeof(_grabbedCursor))
error("grabCursor: grabbed cursor too big");
@@ -148,8 +154,8 @@ void ScummEngine::setCursorFromBuffer(const byte *ptr, int width, int height, in
dst = _grabbedCursor;
for (; height; height--) {
- memcpy(dst, ptr, width);
- dst += width;
+ memcpy(dst, ptr, width * _bitDepth);
+ dst += width * _bitDepth;
ptr += pitch;
}
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 8fe2639fbb..e91eb48cd4 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1800,14 +1800,12 @@ void Wiz::loadWizCursor(int resId, int palette) {
}
const Common::Rect *r = NULL;
- _vm->_bitDepth = 1;
uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
- _vm->_bitDepth = (_vm->_game.features & GF_16BIT_COLOR) ? 2 : 1;
int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
_vm->setCursorHotspot(x, y);
- _vm->setCursorFromBuffer(cursor, cw, ch, cw);
+ _vm->setCursorFromBuffer(cursor, cw, ch, cw * _vm->_bitDepth);
// Since we set up cursor palette for default cursor, disable it now
CursorMan.disableCursorPalette(true);
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index c4b2ab9e56..5580c4c73d 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -974,7 +974,10 @@ protected:
byte animate, animateIndex;
int8 state;
} _cursor;
- byte _grabbedCursor[8192];
+
+ // HACK Double the array size to handle 16-bit images.
+ // this should be dynamically allocated based on game depth instead.
+ byte _grabbedCursor[16384];
byte _currentCursor;
byte _newEffect, _switchRoomEffect2, _switchRoomEffect;
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index fe5f653b94..f303749572 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -108,7 +108,11 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
}
Cursor *cur = _cursorStack.top();
+#ifdef ENABLE_16BIT
+ uint size = w * h * 2;
+#else
uint size = w * h;
+#endif
if (cur->_size < size) {
delete[] cur->_data;
--
cgit v1.2.3
From 7edfab28d82f4c15bf95ad63d0ce480676f85c62 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 06:47:49 +0000
Subject: Ooops, correct mistakes in commit 41162.
svn-id: r41192
---
engines/scumm/costume.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 089e7a2fbe..39c2f73e88 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -876,15 +876,15 @@ void ClassicCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask)
void ClassicCostumeRenderer::setPalette(uint16 *palette) {
int i;
- byte color = 0;
+ byte color;
if (_loaded._format == 0x57) {
for (i = 0; i < 13; i++)
- _palette[i] = color;
+ _palette[i] = palette[i];
} else if (_vm->_game.features & GF_OLD_BUNDLE) {
if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) {
for (i = 0; i < 16; i++)
- _palette[i] = color;
+ _palette[i] = palette[i];
} else {
for (i = 0; i < 16; i++)
_palette[i] = 8;
--
cgit v1.2.3
From 662a305752214564a9db0ac2d61594367067efa1 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 07:07:56 +0000
Subject: HACK not required at this point, since transparency color of 5 is
still used for 16bit color HE games.
svn-id: r41193
---
engines/scumm/cursor.cpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 66dd3807db..957370b8fe 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -111,13 +111,7 @@ void ScummEngine_v6::setCursorTransparency(int a) {
}
void ScummEngine::updateCursor() {
- //HACK Put the 16-bit mapped color, and
- //hope no other palette entry shares it
int transColor = (_game.heversion >= 80) ? 5 : 255;
- if (_game.features & GF_16BIT_COLOR && _hePalettes)
- transColor = READ_LE_UINT16(_hePalettes + 2048 + transColor * 2);
- else
- transColor = 0;
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
--
cgit v1.2.3
From 9789ba7f28d2c0a093adda01435306f28e91fede Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 5 Jun 2009 08:09:37 +0000
Subject: Corrected backend to be able to accept a 16-bit mouseKeyColor without
overflow
svn-id: r41194
---
backends/platform/sdl/graphics.cpp | 47 ++++++++++++++++++++++++++++++++++----
backends/platform/sdl/sdl.h | 4 ++++
common/system.h | 5 ++++
dists/msvc8/scumm.vcproj | 4 ++--
engines/scumm/cursor.cpp | 18 +++++++++++----
graphics/cursorman.cpp | 36 +++++++++++++++++++++++++----
graphics/cursorman.h | 4 ++++
7 files changed, 104 insertions(+), 14 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 1a80b9be19..fadd7a376c 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1403,7 +1403,8 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
}
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
+#ifdef ENABLE_16BIT
+void OSystem_SDL::setMouseCursor16(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint16 keycolor, int cursorTargetScale) {
if (w == 0 || h == 0)
return;
@@ -1438,13 +1439,51 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
free(_mouseData);
-#ifdef ENABLE_16BIT
_mouseData = (byte *)malloc(w * h * 2);
memcpy(_mouseData, buf, w * h * 2);
-#else
+
+ blitCursor();
+}
+#endif
+
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
+ if (w == 0 || h == 0)
+ return;
+
+ _mouseCurState.hotX = hotspot_x;
+ _mouseCurState.hotY = hotspot_y;
+
+ _mouseKeyColor = keycolor;
+
+ _cursorTargetScale = cursorTargetScale;
+
+ if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) {
+ _mouseCurState.w = w;
+ _mouseCurState.h = h;
+
+ if (_mouseOrigSurface)
+ SDL_FreeSurface(_mouseOrigSurface);
+
+ // Allocate bigger surface because AdvMame2x adds black pixel at [0,0]
+ _mouseOrigSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA,
+ _mouseCurState.w + 2,
+ _mouseCurState.h + 2,
+ 16,
+ _hwscreen->format->Rmask,
+ _hwscreen->format->Gmask,
+ _hwscreen->format->Bmask,
+ _hwscreen->format->Amask);
+
+ if (_mouseOrigSurface == NULL)
+ error("allocating _mouseOrigSurface failed");
+ SDL_SetColorKey(_mouseOrigSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kMouseColorKey);
+ }
+
+ free(_mouseData);
+
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
-#endif
+
blitCursor();
}
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index f843066749..3e0bf19f8f 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -112,6 +112,10 @@ public:
virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)
// Set the bitmap that's used when drawing the cursor.
+#ifdef ENABLE_16BIT
+ //HACK Made a second method as a quick and dirty workaround to avoid linker errors with engine libs
+ virtual void setMouseCursor16(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint16 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
+#endif
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
// Set colors of cursor palette
diff --git a/common/system.h b/common/system.h
index 5b72dab7c1..eb01093049 100644
--- a/common/system.h
+++ b/common/system.h
@@ -687,8 +687,13 @@ public:
* @param keycolor transparency color index
* @param cursorTargetScale scale factor which cursor is designed for
*/
+#ifdef ENABLE_16BIT
+ //HACK made a second method as a quick and dirty workaround to avoid linker errors with engine libs
+ virtual void setMouseCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int cursorTargetScale = 1) = 0;
+#endif
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1) = 0;
+
/**
* Replace the specified range of cursor the palette with new colors.
* The palette entries from 'start' till (start+num-1) will be replaced - so
diff --git a/dists/msvc8/scumm.vcproj b/dists/msvc8/scumm.vcproj
index 7b7588b0fd..03e1f9cc39 100644
--- a/dists/msvc8/scumm.vcproj
+++ b/dists/msvc8/scumm.vcproj
@@ -1,7 +1,7 @@
= 80) ? 5 : 255;
- CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
- _cursor.hotspotX, _cursor.hotspotY,
- (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1));
+ if (_game.features & GF_16BIT_COLOR && _hePalettes) {
+ //HACK Had to make a second method to avoid many, many linker errors from other engines
+ //this requires ENABLE_16BIT to be defined in the Scumm project, again, because I #ifdef'ed
+ //the method's definition and declaration in cursorman.h
+ CursorMan.replaceCursor16(_grabbedCursor, _cursor.width, _cursor.height,
+ _cursor.hotspotX, _cursor.hotspotY,
+ (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+ (_game.heversion == 70 ? 2 : 1));
+ } else {
+ CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
+ _cursor.hotspotX, _cursor.hotspotY,
+ (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+ (_game.heversion == 70 ? 2 : 1));
+ }
}
void ScummEngine_v6::grabCursor(int x, int y, int w, int h) {
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index f303749572..84578a3911 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -100,6 +100,37 @@ void CursorManager::popAllCursors() {
g_system->showMouse(isVisible());
}
+#ifdef ENABLE_16BIT
+//HACK Made a separate method to avoid massive linker errors on every engine
+void CursorManager::replaceCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
+ if (_cursorStack.empty()) {
+ pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ return;
+ }
+
+ Cursor *cur = _cursorStack.top();
+
+ uint size = w * h * 2;
+
+ if (cur->_size < size) {
+ delete[] cur->_data;
+ cur->_data = new byte[size];
+ cur->_size = size;
+ }
+
+ if (buf && cur->_data)
+ memcpy(cur->_data, buf, size);
+
+ cur->_width = w;
+ cur->_height = h;
+ cur->_hotspotX = hotspotX;
+ cur->_hotspotY = hotspotY;
+ cur->_keycolor = keycolor;
+ cur->_targetScale = targetScale;
+
+ g_system->setMouseCursor16(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+}
+#endif
void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
if (_cursorStack.empty()) {
@@ -108,11 +139,8 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
}
Cursor *cur = _cursorStack.top();
-#ifdef ENABLE_16BIT
- uint size = w * h * 2;
-#else
+
uint size = w * h;
-#endif
if (cur->_size < size) {
delete[] cur->_data;
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index bc38466eda..8ad42fe0d4 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -77,6 +77,10 @@ public:
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
*/
+#ifdef ENABLE_16BIT
+ //HACK made a separate method to avoid massive linker errors on every engine.
+ void replaceCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1);
+#endif
void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
/**
--
cgit v1.2.3
From ccee18a489ece14c499c4e0c43aeb7fc216451fb Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 5 Jun 2009 10:13:19 +0000
Subject: Cleanup.
svn-id: r41195
---
engines/scumm/gfx.cpp | 59 +++++++++++++++++++------------------------------
engines/scumm/gfx.h | 8 +++++++
engines/scumm/scumm.cpp | 4 +++-
3 files changed, 34 insertions(+), 37 deletions(-)
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 0427e32326..d47301c974 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -231,6 +231,9 @@ GdiV2::~GdiV2() {
free(_roomStrips);
}
+Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) {
+}
+
void Gdi::init() {
_numStrips = _vm->_screenWidth / 8;
@@ -2803,12 +2806,8 @@ void Gdi::drawStripHE(byte *dst, int dstPitch, const byte *src, int width, int h
int x = width;
while (1) {
- if (!transpCheck || color != _transparentColor) {
- if (_vm->_game.features & GF_16BIT_COLOR)
- WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
- else
- *dst = _roomPalette[color];
- }
+ if (!transpCheck || color != _transparentColor)
+ writeRoomColor(dst, color);
dst += _vm->_bitDepth;
--x;
if (x == 0) {
@@ -2896,12 +2895,8 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height,
int x = 8;
do {
FILL_BITS;
- if (!transpCheck || color != _transparentColor) {
- if (_vm->_game.features & GF_16BIT_COLOR)
- WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
- else
- *dst = _roomPalette[color] + _paletteMod;
- }
+ if (!transpCheck || color != _transparentColor)
+ writeRoomColor(dst, color);
dst += _vm->_bitDepth;
againPos:
@@ -2927,12 +2922,8 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height,
if (!--height)
return;
}
- if (!transpCheck || color != _transparentColor) {
- if (_vm->_game.features & GF_16BIT_COLOR)
- WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
- else
- *dst = _roomPalette[color] + _paletteMod;
- }
+ if (!transpCheck || color != _transparentColor)
+ writeRoomColor(dst, color);
dst += _vm->_bitDepth;
} while (--reps);
bits >>= 8;
@@ -2956,12 +2947,8 @@ void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height,
int x = 8;
do {
FILL_BITS;
- if (!transpCheck || color != _transparentColor) {
- if (_vm->_game.features & GF_16BIT_COLOR)
- WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
- else
- *dst = _roomPalette[color] + _paletteMod;
- }
+ if (!transpCheck || color != _transparentColor)
+ writeRoomColor(dst, color);
dst += _vm->_bitDepth;
if (!READ_BIT) {
} else if (!READ_BIT) {
@@ -2993,12 +2980,8 @@ void Gdi::drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height,
int h = height;
do {
FILL_BITS;
- if (!transpCheck || color != _transparentColor) {
- if (_vm->_game.features & GF_16BIT_COLOR)
- WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
- else
- *dst = _roomPalette[color] + _paletteMod;
- }
+ if (!transpCheck || color != _transparentColor)
+ writeRoomColor(dst, color);
dst += dstPitch;
if (!READ_BIT) {
} else if (!READ_BIT) {
@@ -3065,12 +3048,8 @@ void Gdi::drawStripRaw(byte *dst, int dstPitch, const byte *src, int height, con
do {
for (x = 0; x < 8; x ++) {
byte color = *src++;
- if (!transpCheck || color != _transparentColor) {
- if (_vm->_game.features & GF_16BIT_COLOR)
- WRITE_UINT16(dst + x * 2, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
- else
- dst[x] = _roomPalette[color] + _paletteMod;
- }
+ if (!transpCheck || color != _transparentColor)
+ writeRoomColor(dst + x * _vm->_bitDepth, color);
}
dst += dstPitch;
} while (--height);
@@ -3193,6 +3172,14 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons
#undef NEXT_ROW
#undef READ_BIT_256
+void Gdi16Bit::writeRoomColor(byte *dst, byte color) const {
+ WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
+}
+
+void Gdi::writeRoomColor(byte *dst, byte color) const {
+ *dst = _roomPalette[color] + _paletteMod;
+}
+
#pragma mark -
#pragma mark --- Transition effects ---
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index 88852c8388..c0f2c2c083 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -215,6 +215,7 @@ protected:
void drawStrip3DO(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
void drawStripHE(byte *dst, int dstPitch, const byte *src, int width, int height, const bool transpCheck) const;
+ virtual void writeRoomColor(byte *dst, byte color) const;
/* Mask decompressors */
void decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const;
@@ -361,6 +362,13 @@ public:
virtual void roomChanged(byte *roomptr);
};
+class Gdi16Bit : public Gdi {
+protected:
+ virtual void writeRoomColor(byte *dst, byte color) const;
+public:
+ Gdi16Bit(ScummEngine *vm);
+};
+
} // End of namespace Scumm
#endif
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 17ffc6e5b0..022eba1e5b 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -109,7 +109,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_currentScript(0xFF), // Let debug() work on init stage
_messageDialog(0), _pauseDialog(0), _scummMenuDialog(0), _versionDialog(0) {
- if (_game.platform == Common::kPlatformNES) {
+ if (_game.features & GF_16BIT_COLOR) {
+ _gdi = new Gdi16Bit(this);
+ } else if (_game.platform == Common::kPlatformNES) {
_gdi = new GdiNES(this);
} else if (_game.version <= 1) {
_gdi = new GdiV1(this);
--
cgit v1.2.3
From d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 5 Jun 2009 23:59:40 +0000
Subject: Fixes ScummEngine_v70he::setDefaultCursor to work in 16-bit, using a
temporary hack.
svn-id: r41204
---
engines/scumm/cursor.cpp | 29 +++++++++++++++++++++--------
graphics/cursorman.cpp | 29 ++++++++++++++++++++++++++++-
graphics/cursorman.h | 40 ++++++++++++++++++++++++++++++++++++++++
gui/GuiManager.cpp | 8 ++++++++
gui/ThemeEngine.cpp | 4 ++++
5 files changed, 101 insertions(+), 9 deletions(-)
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 3710956b74..5ec9e63e32 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,7 +112,7 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
- if (_game.features & GF_16BIT_COLOR && _hePalettes) {
+ if (_game.features & GF_16BIT_COLOR) {
//HACK Had to make a second method to avoid many, many linker errors from other engines
//this requires ENABLE_16BIT to be defined in the Scumm project, again, because I #ifdef'ed
//the method's definition and declaration in cursorman.h
@@ -176,8 +176,13 @@ void ScummEngine_v70he::setDefaultCursor() {
static const byte palette[] = {0, 0, 0, 0,
0xff, 0xff, 0xff, 0,
0, 0, 0, 0};
-
- memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
+
+ if (_bitDepth == 2) {
+ for (i = 0; i < 1024; i++)
+ WRITE_UINT16(_grabbedCursor + i * 2, 5);
+ } else {
+ memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
+ }
_cursor.hotspotX = _cursor.hotspotY = 2;
src = default_he_cursor;
@@ -190,10 +195,16 @@ void ScummEngine_v70he::setDefaultCursor() {
for (j = 0; j < 32; j++) {
switch ((p & (0x3 << 14)) >> 14) {
case 1:
- _grabbedCursor[32 * i + j] = 0xfe;
+ if (_bitDepth == 2)
+ WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[4], palette[5], palette[6]));
+ else
+ _grabbedCursor[32 * i + j] = 0xfe;
break;
case 2:
- _grabbedCursor[32 * i + j] = 0xfd;
+ if (_bitDepth == 2)
+ WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[0], palette[1], palette[2]));
+ else
+ _grabbedCursor[32 * i + j] = 0xfd;
break;
default:
break;
@@ -205,9 +216,11 @@ void ScummEngine_v70he::setDefaultCursor() {
}
}
- // Since white color position is not guaranteed
- // we setup our own palette if supported by backend
- CursorMan.replaceCursorPalette(palette, 0xfd, 3);
+ if (_bitDepth == 1) {
+ // Since white color position is not guaranteed
+ // we setup our own palette if supported by backend
+ CursorMan.replaceCursorPalette(palette, 0xfd, 3);
+ }
updateCursor();
}
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 84578a3911..5fe58314b3 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -56,6 +56,33 @@ bool CursorManager::showMouse(bool visible) {
// Should work, even if there's just a dummy cursor on the stack.
return g_system->showMouse(visible);
}
+#ifdef ENABLE_16BIT
+void CursorManager::pushCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
+ Cursor16 *cur = new Cursor16(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+
+ cur->_visible = isVisible();
+ _cursor16Stack.push(cur);
+
+ if (buf) {
+ g_system->setMouseCursor16(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ }
+}
+
+void CursorManager::popCursor16() {
+ if (_cursor16Stack.empty())
+ return;
+
+ Cursor16 *cur = _cursor16Stack.pop();
+ delete cur;
+
+ if (!_cursorStack.empty()) {
+ cur = _cursor16Stack.top();
+ g_system->setMouseCursor16(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale);
+ }
+
+ g_system->showMouse(isVisible());
+}
+#endif
void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
@@ -104,7 +131,7 @@ void CursorManager::popAllCursors() {
//HACK Made a separate method to avoid massive linker errors on every engine
void CursorManager::replaceCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
if (_cursorStack.empty()) {
- pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ pushCursor16(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
return;
}
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 8ad42fe0d4..b54ef31439 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -64,6 +64,13 @@ public:
*/
void popCursor();
+#ifdef ENABLE_16BIT
+ //HACK This is such a incredible hack
+ //I really need to make the one method
+ //work under multiple bitdepths
+ void pushCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1);
+ void popCursor16();
+#endif
/**
* Replace the current cursor on the stack. If the stack is empty, the
* cursor is pushed instead. It's a slightly more optimized way of
@@ -137,7 +144,37 @@ public:
private:
friend class Common::Singleton;
CursorManager();
+#ifdef ENABLE_16BIT
+ struct Cursor16 {
+ byte *_data;
+ bool _visible;
+ uint _width;
+ uint _height;
+ int _hotspotX;
+ int _hotspotY;
+ uint16 _keycolor;
+ byte _targetScale;
+
+ uint _size;
+ Cursor16(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1) {
+ _size = w * h * 2;
+ _data = new byte[_size];
+ if (data && _data)
+ memcpy(_data, data, _size);
+ _width = w;
+ _height = h;
+ _hotspotX = hotspotX;
+ _hotspotY = hotspotY;
+ _keycolor = keycolor;
+ _targetScale = targetScale;
+ }
+
+ ~Cursor16() {
+ delete[] _data;
+ }
+ };
+#endif
struct Cursor {
byte *_data;
bool _visible;
@@ -197,6 +234,9 @@ private:
};
Common::Stack _cursorStack;
+#ifdef ENABLE_16BIT
+ Common::Stack _cursor16Stack;
+#endif
Common::Stack _cursorPaletteStack;
};
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index cf8b7b2d9d..bb988edc78 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -135,8 +135,12 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
delete _theme;
if (_useStdCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursor16();
+#else
CursorMan.popCursorPalette();
CursorMan.popCursor();
+#endif
}
//
@@ -382,8 +386,12 @@ void GuiManager::saveState() {
void GuiManager::restoreState() {
if (_useStdCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursor16();
+#else
CursorMan.popCursor();
CursorMan.popCursorPalette();
+#endif
}
_system->updateScreen();
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index fe93a1f7d6..c8d960f014 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -462,8 +462,12 @@ void ThemeEngine::disable() {
_system->hideOverlay();
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursor16();
+#else
CursorMan.popCursorPalette();
CursorMan.popCursor();
+#endif
}
_enabled = false;
--
cgit v1.2.3
From 56e5920bba753820c457c078237a8c06241302ed Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 6 Jun 2009 01:16:04 +0000
Subject: Corrected cursor display errors introduced by revision 41204,
reimplemented 16-bit cursor support in a less hacky, but still temporary way.
svn-id: r41209
---
backends/platform/sdl/graphics.cpp | 92 +++++++++++++++---------------------
backends/platform/sdl/sdl.h | 10 ++--
common/system.h | 6 +--
engines/scumm/cursor.cpp | 5 +-
graphics/cursorman.cpp | 96 +++++++++++++++++---------------------
graphics/cursorman.h | 68 ++++++++++-----------------
gui/GuiManager.cpp | 8 ----
gui/ThemeEngine.cpp | 4 --
8 files changed, 119 insertions(+), 170 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index fadd7a376c..8ecf4ecda1 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1404,49 +1404,19 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
#ifdef ENABLE_16BIT
-void OSystem_SDL::setMouseCursor16(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint16 keycolor, int cursorTargetScale) {
- if (w == 0 || h == 0)
- return;
-
- _mouseCurState.hotX = hotspot_x;
- _mouseCurState.hotY = hotspot_y;
-
- _mouseKeyColor = keycolor;
-
- _cursorTargetScale = cursorTargetScale;
-
- if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) {
- _mouseCurState.w = w;
- _mouseCurState.h = h;
-
- if (_mouseOrigSurface)
- SDL_FreeSurface(_mouseOrigSurface);
-
- // Allocate bigger surface because AdvMame2x adds black pixel at [0,0]
- _mouseOrigSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA,
- _mouseCurState.w + 2,
- _mouseCurState.h + 2,
- 16,
- _hwscreen->format->Rmask,
- _hwscreen->format->Gmask,
- _hwscreen->format->Bmask,
- _hwscreen->format->Amask);
-
- if (_mouseOrigSurface == NULL)
- error("allocating _mouseOrigSurface failed");
- SDL_SetColorKey(_mouseOrigSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kMouseColorKey);
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, uint8 bitDepth) {
+ uint32 colmask = 0xFF;
+ uint8 byteDepth = bitDepth >> 3;
+ for (int i = byteDepth; i > 1; i--) {
+ colmask <<= 8;
+ colmask |= 0xFF;
}
+ keycolor &= colmask;
- free(_mouseData);
-
- _mouseData = (byte *)malloc(w * h * 2);
- memcpy(_mouseData, buf, w * h * 2);
-
- blitCursor();
-}
+#else
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
#endif
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
if (w == 0 || h == 0)
return;
@@ -1480,14 +1450,24 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
}
free(_mouseData);
+#ifdef ENABLE_16BIT
+ _mouseData = (byte *)malloc(w * h * byteDepth);
+ memcpy(_mouseData, buf, w * h * byteDepth);
+ blitCursor(bitDepth);
+#else
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
blitCursor();
+#endif
}
+#ifdef ENABLE_16BIT
+void OSystem_SDL::blitCursor(uint8 bitDepth) {
+#else
void OSystem_SDL::blitCursor() {
+#endif
byte *dstPtr;
const byte *srcPtr = _mouseData;
byte color;
@@ -1526,22 +1506,26 @@ void OSystem_SDL::blitCursor() {
for (j = 0; j < w; j++) {
color = *srcPtr;
#ifdef ENABLE_16BIT
- if (color != _mouseKeyColor) { // transparent, don't draw
- int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3;
- int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3;
- int8 b = (*(uint16 *)srcPtr & 0x1F) << 3;
- *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
- r, g, b);
- }
- dstPtr += 2;
- srcPtr += 2;
-#else
- if (color != _mouseKeyColor) { // transparent, don't draw
- *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
- palette[color].r, palette[color].g, palette[color].b);
+ if (bitDepth == 16) {
+ if (color != _mouseKeyColor) { // transparent, don't draw
+ int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3;
+ int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3;
+ int8 b = (*(uint16 *)srcPtr & 0x1F) << 3;
+ *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
+ r, g, b);
+ }
+ dstPtr += 2;
+ srcPtr += 2;
+ } else {
+#endif
+ if (color != _mouseKeyColor) { // transparent, don't draw
+ *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
+ palette[color].r, palette[color].g, palette[color].b);
+ }
+ dstPtr += 2;
+ srcPtr++;
+#ifdef ENABLE_16BIT
}
- dstPtr += 2;
- srcPtr++;
#endif
}
dstPtr += _mouseOrigSurface->pitch - w * 2;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 3e0bf19f8f..7d71ecb6ab 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -113,10 +113,10 @@ public:
// Set the bitmap that's used when drawing the cursor.
#ifdef ENABLE_16BIT
- //HACK Made a second method as a quick and dirty workaround to avoid linker errors with engine libs
- virtual void setMouseCursor16(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint16 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
-#endif
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, uint8 bitDepth = 8); // overloaded by CE backend (FIXME)
+#else
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
+#endif
// Set colors of cursor palette
void setCursorPalette(const byte *colors, uint start, uint num);
@@ -413,7 +413,11 @@ protected:
virtual void drawMouse(); // overloaded by CE backend
virtual void undrawMouse(); // overloaded by CE backend (FIXME)
+#ifdef ENABLE_16BIT
+ virtual void blitCursor(uint8 bitDepth = 8); // overloaded by CE backend (FIXME)
+#else
virtual void blitCursor(); // overloaded by CE backend (FIXME)
+#endif
/** Set the position of the virtual mouse cursor. */
void setMousePos(int x, int y);
diff --git a/common/system.h b/common/system.h
index eb01093049..ddbcdcc546 100644
--- a/common/system.h
+++ b/common/system.h
@@ -688,10 +688,10 @@ public:
* @param cursorTargetScale scale factor which cursor is designed for
*/
#ifdef ENABLE_16BIT
- //HACK made a second method as a quick and dirty workaround to avoid linker errors with engine libs
- virtual void setMouseCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int cursorTargetScale = 1) = 0;
-#endif
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, uint8 bitDepth = 8) = 0;
+#else
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1) = 0;
+#endif
/**
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 5ec9e63e32..bc4a2e0d33 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -116,10 +116,11 @@ void ScummEngine::updateCursor() {
//HACK Had to make a second method to avoid many, many linker errors from other engines
//this requires ENABLE_16BIT to be defined in the Scumm project, again, because I #ifdef'ed
//the method's definition and declaration in cursorman.h
- CursorMan.replaceCursor16(_grabbedCursor, _cursor.width, _cursor.height,
+ CursorMan.replaceCursorReal(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1));
+ (_game.heversion == 70 ? 2 : 1),
+ 16);
} else {
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 5fe58314b3..00932e55b0 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -56,42 +56,34 @@ bool CursorManager::showMouse(bool visible) {
// Should work, even if there's just a dummy cursor on the stack.
return g_system->showMouse(visible);
}
-#ifdef ENABLE_16BIT
-void CursorManager::pushCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
- Cursor16 *cur = new Cursor16(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
-
- cur->_visible = isVisible();
- _cursor16Stack.push(cur);
- if (buf) {
- g_system->setMouseCursor16(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
- }
+void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
+#ifdef ENABLE_16BIT
+ pushCursorReal(buf,w,h,hotspotX,hotspotY,keycolor,targetScale,8);
}
-
-void CursorManager::popCursor16() {
- if (_cursor16Stack.empty())
- return;
-
- Cursor16 *cur = _cursor16Stack.pop();
- delete cur;
-
- if (!_cursorStack.empty()) {
- cur = _cursor16Stack.top();
- g_system->setMouseCursor16(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale);
+void CursorManager::pushCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, uint8 bitDepth) {
+ uint32 colmask = 0xFF;
+ uint8 byteDepth = bitDepth >> 3;
+ for (int i = byteDepth; i > 1; i--) {
+ colmask <<= 8;
+ colmask |= 0xFF;
}
+ keycolor &= colmask;
- g_system->showMouse(isVisible());
-}
-#endif
-
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
+ Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
+#else
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+#endif
cur->_visible = isVisible();
_cursorStack.push(cur);
if (buf) {
+#ifdef ENABLE_16BIT
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
+#else
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+#endif
}
}
@@ -104,7 +96,11 @@ void CursorManager::popCursor() {
if (!_cursorStack.empty()) {
cur = _cursorStack.top();
+#ifdef ENABLE_16BIT
+ g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_bitDepth);
+#else
g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale);
+#endif
}
g_system->showMouse(isVisible());
@@ -127,47 +123,37 @@ void CursorManager::popAllCursors() {
g_system->showMouse(isVisible());
}
+void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
#ifdef ENABLE_16BIT
-//HACK Made a separate method to avoid massive linker errors on every engine
-void CursorManager::replaceCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
- if (_cursorStack.empty()) {
- pushCursor16(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
- return;
- }
-
- Cursor *cur = _cursorStack.top();
-
- uint size = w * h * 2;
+ replaceCursorReal(buf,w,h,hotspotX,hotspotY,keycolor,targetScale);
+}
- if (cur->_size < size) {
- delete[] cur->_data;
- cur->_data = new byte[size];
- cur->_size = size;
+void CursorManager::replaceCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, uint8 bitDepth) {
+ uint32 colmask = 0xFF;
+ uint8 byteDepth = bitDepth >> 3;
+ for (int i = byteDepth; i > 1; i--) {
+ colmask <<= 8;
+ colmask |= 0xFF;
}
+ keycolor &= colmask;
- if (buf && cur->_data)
- memcpy(cur->_data, buf, size);
-
- cur->_width = w;
- cur->_height = h;
- cur->_hotspotX = hotspotX;
- cur->_hotspotY = hotspotY;
- cur->_keycolor = keycolor;
- cur->_targetScale = targetScale;
-
- g_system->setMouseCursor16(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
-}
#endif
-
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
if (_cursorStack.empty()) {
+#ifdef ENABLE_16BIT
+ pushCursorReal(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
+#else
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+#endif
return;
}
Cursor *cur = _cursorStack.top();
+#ifdef ENABLE_16BIT
+ uint size = w * h * (bitDepth >> 3);
+#else
uint size = w * h;
+#endif
if (cur->_size < size) {
delete[] cur->_data;
@@ -185,7 +171,11 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
+#ifdef ENABLE_16BIT
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
+#else
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+#endif
}
void CursorManager::disableCursorPalette(bool disable) {
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index b54ef31439..481567bb09 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -57,6 +57,9 @@ public:
* cursor will be added to the stack, but not to the backend.
*/
void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
+#ifdef ENABLE_16BIT
+ void pushCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8);
+#endif
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -64,13 +67,6 @@ public:
*/
void popCursor();
-#ifdef ENABLE_16BIT
- //HACK This is such a incredible hack
- //I really need to make the one method
- //work under multiple bitdepths
- void pushCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1);
- void popCursor16();
-#endif
/**
* Replace the current cursor on the stack. If the stack is empty, the
* cursor is pushed instead. It's a slightly more optimized way of
@@ -84,11 +80,11 @@ public:
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
*/
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
#ifdef ENABLE_16BIT
//HACK made a separate method to avoid massive linker errors on every engine.
- void replaceCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1);
+ void replaceCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8);
#endif
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -144,37 +140,7 @@ public:
private:
friend class Common::Singleton;
CursorManager();
-#ifdef ENABLE_16BIT
- struct Cursor16 {
- byte *_data;
- bool _visible;
- uint _width;
- uint _height;
- int _hotspotX;
- int _hotspotY;
- uint16 _keycolor;
- byte _targetScale;
-
- uint _size;
- Cursor16(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1) {
- _size = w * h * 2;
- _data = new byte[_size];
- if (data && _data)
- memcpy(_data, data, _size);
- _width = w;
- _height = h;
- _hotspotX = hotspotX;
- _hotspotY = hotspotY;
- _keycolor = keycolor;
- _targetScale = targetScale;
- }
-
- ~Cursor16() {
- delete[] _data;
- }
- };
-#endif
struct Cursor {
byte *_data;
bool _visible;
@@ -182,13 +148,33 @@ private:
uint _height;
int _hotspotX;
int _hotspotY;
+#ifdef ENABLE_16BIT
+ uint32 _keycolor;
+ uint8 _bitDepth;
+#else
byte _keycolor;
+#endif
byte _targetScale;
+
uint _size;
+#ifdef ENABLE_16BIT
+ Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8) {
+ uint32 colmask = 0xFF;
+ uint8 byteDepth = bitDepth >> 3;
+ _size = w * h * byteDepth;
+ _bitDepth = bitDepth;
+ for (int i = byteDepth; i > 1; i--) {
+ colmask <<= 8;
+ colmask |= 0xFF;
+ }
+ _keycolor = keycolor & colmask;
+#else
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1) {
_size = w * h;
+ _keycolor = keycolor;
+#endif
_data = new byte[_size];
if (data && _data)
memcpy(_data, data, _size);
@@ -196,7 +182,6 @@ private:
_height = h;
_hotspotX = hotspotX;
_hotspotY = hotspotY;
- _keycolor = keycolor;
_targetScale = targetScale;
}
@@ -234,9 +219,6 @@ private:
};
Common::Stack _cursorStack;
-#ifdef ENABLE_16BIT
- Common::Stack _cursor16Stack;
-#endif
Common::Stack _cursorPaletteStack;
};
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index bb988edc78..cf8b7b2d9d 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -135,12 +135,8 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
delete _theme;
if (_useStdCursor) {
-#ifdef ENABLE_16BIT
- CursorMan.popCursor16();
-#else
CursorMan.popCursorPalette();
CursorMan.popCursor();
-#endif
}
//
@@ -386,12 +382,8 @@ void GuiManager::saveState() {
void GuiManager::restoreState() {
if (_useStdCursor) {
-#ifdef ENABLE_16BIT
- CursorMan.popCursor16();
-#else
CursorMan.popCursor();
CursorMan.popCursorPalette();
-#endif
}
_system->updateScreen();
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index c8d960f014..fe93a1f7d6 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -462,12 +462,8 @@ void ThemeEngine::disable() {
_system->hideOverlay();
if (_useCursor) {
-#ifdef ENABLE_16BIT
- CursorMan.popCursor16();
-#else
CursorMan.popCursorPalette();
CursorMan.popCursor();
-#endif
}
_enabled = false;
--
cgit v1.2.3
From f379d7fe1a2b261dbdfbd4c152fb2ff8d7f18277 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 6 Jun 2009 07:22:19 +0000
Subject: Add initial support for copyMaskWizImage, to fix videos in later
Blue's Clues games.
svn-id: r41211
---
engines/scumm/he/animation_he.cpp | 7 +-
engines/scumm/he/wiz_he.cpp | 130 ++++++++++++++++++++++++++++++++++----
engines/scumm/he/wiz_he.h | 4 +-
3 files changed, 124 insertions(+), 17 deletions(-)
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 5983df2308..92b72bd9be 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -75,9 +75,10 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
if (_vm->_game.features & GF_16BIT_COLOR) {
dst += y * pitch + x * 2;
do {
- for (uint i = 0; i < w; i++)
- WRITE_UINT16(dst + i * 2, src[i]);
-
+ for (uint i = 0; i < w; i++) {
+ uint16 col = READ_LE_UINT16(_vm->_hePalettes + _vm->_hePaletteSlot + 768 + src[i] * 2);
+ WRITE_UINT16(dst + i * 2, col);
+ }
dst += pitch;
src += w;
} while (--h);
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 8bc196ee08..9aa2bf741a 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -445,6 +445,93 @@ static void decodeWizMask(uint8 *&dst, uint8 &mask, int w, int maskType) {
}
}
+void Wiz::copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr) {
+ Common::Rect srcRect, dstRect;
+ if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
+ return;
+ }
+ dst += dstRect.top * dstPitch + dstRect.left * 2;
+ if (flags & kWIFFlipY) {
+ const int dy = (srcy < 0) ? srcy : (srch - srcRect.height());
+ srcRect.translate(0, dy);
+ }
+ if (flags & kWIFFlipX) {
+ const int dx = (srcx < 0) ? srcx : (srcw - srcRect.width());
+ srcRect.translate(dx, 0);
+ }
+
+ const uint8 *dataPtr, *dataPtrNext;
+ const uint8 *maskPtr, *maskPtrNext;
+ uint8 code, *dstPtr, *dstPtrNext;
+ int h, w, dstInc;
+
+ dataPtr = src;
+ dstPtr = dst;
+ maskPtr = mask;
+
+ // Skip over the first 'srcRect->top' lines in the data
+ dataPtr += dstRect.top * dstPitch + dstRect.left * 2;
+
+ h = dstRect.height();
+ w = dstRect.width();
+ if (h <= 0 || w <= 0)
+ return;
+
+ dstInc = 2;
+ if (flags & kWIFFlipX) {
+ dstPtr += (w - 1) * 2;
+ dstInc = -2;
+ }
+
+ while (h--) {
+ w = dstRect.width();
+ uint16 lineSize = READ_LE_UINT16(maskPtr); maskPtr += 2;
+ dataPtrNext = dataPtr + dstPitch;
+ dstPtrNext = dstPtr + dstPitch;
+ maskPtrNext = maskPtr + lineSize;
+ if (lineSize != 0) {
+ while (w > 0) {
+ code = *maskPtr++;
+ if (code & 1) {
+ code >>= 1;
+ dataPtr += dstInc * code;
+ dstPtr += dstInc * code;
+ w -= code;
+ } else if (code & 2) {
+ code = (code >> 2) + 1;
+ w -= code;
+ if (w < 0) {
+ code += w;
+ }
+ while (code--) {
+ if (*maskPtr != 5)
+ write16BitColor(dstPtr, dataPtr, dstType, palPtr);
+ dataPtr += 2;
+ dstPtr += dstInc;
+ }
+ maskPtr++;
+ } else {
+ code = (code >> 2) + 1;
+ w -= code;
+ if (w < 0) {
+ code += w;
+ }
+ while (code--) {
+ if (*maskPtr != 5)
+ write16BitColor(dstPtr, dataPtr, dstType, palPtr);
+ dataPtr += 2;
+ dstPtr += dstInc;
+ maskPtr++;
+ }
+ }
+ }
+ }
+ dataPtr = dataPtrNext;
+ dstPtr = dstPtrNext;
+ maskPtr = maskPtrNext;
+ }
+}
+
void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP) {
Common::Rect srcRect, dstRect;
if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
@@ -1318,12 +1405,12 @@ void Wiz::displayWizImage(WizImage *pwi) {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, 0, 0, 0);
} else {
const Common::Rect *r = NULL;
- drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, 0, 0, 0, r, pwi->flags, 0, _vm->getHEPaletteSlot(0));
+ drawWizImage(pwi->resNum, pwi->state, 0, 0, pwi->x1, pwi->y1, 0, 0, 0, r, pwi->flags, 0, _vm->getHEPaletteSlot(0));
}
}
-uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, const uint8 *palPtr) {
- debug(3, "drawWizImage(resNum %d, x1 %d y1 %d flags 0x%X zorder %d shadow %d field_390 %d dstResNum %d)", resNum, x1, y1, flags, zorder, shadow, field_390, dstResNum);
+uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, const uint8 *palPtr) {
+ debug(3, "drawWizImage(resNum %d, state %d maskNum %d maskState %d x1 %d y1 %d flags 0x%X zorder %d shadow %d field_390 %d dstResNum %d)", resNum, state, maskNum, maskState, x1, y1, flags, zorder, shadow, field_390, dstResNum);
uint8 *dataPtr;
uint8 *dst = NULL;
@@ -1348,6 +1435,21 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
uint8 *wizd = _vm->findWrappedBlock(MKID_BE('WIZD'), dataPtr, state, 0);
assert(wizd);
+ uint8 *mask = NULL;
+ if (maskNum) {
+ uint8 *maskPtr = _vm->getResourceAddress(rtImage, maskNum);
+ assert(maskPtr);
+
+ wizh = _vm->findWrappedBlock(MKID_BE('WIZH'), maskPtr, maskState, 0);
+ assert(wizh);
+ assert(comp == 2 && READ_LE_UINT32(wizh + 0x0) == 1);
+ width = READ_LE_UINT32(wizh + 0x4);
+ height = READ_LE_UINT32(wizh + 0x8);
+
+ mask = _vm->findWrappedBlock(MKID_BE('WIZD'), maskPtr, maskState, 0);
+ assert(mask);
+ }
+
if (flags & kWIFHasPalette) {
uint8 *pal = _vm->findWrappedBlock(MKID_BE('RGBS'), dataPtr, state, 0);
assert(pal);
@@ -1455,7 +1557,11 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
}
break;
case 2:
- copyRaw16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, transColor);
+ if (maskNum) {
+ copyMaskWizImage(dst, wizd, mask, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr);
+ } else {
+ copyRaw16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, transColor);
+ }
break;
case 4:
// TODO: Unknown image type
@@ -1605,7 +1711,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
debug(0, "drawWizPolygonTransform() unhandled flag 0x800000");
}
- srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, flags, 0, _vm->getHEPaletteSlot(palette));
+ srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, 0, 0, shadow, 0, r, flags, 0, _vm->getHEPaletteSlot(palette));
} else {
assert(_vm->_bitDepth == 1);
uint8 *dataPtr = _vm->getResourceAddress(rtImage, resNum);
@@ -1616,7 +1722,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
}
} else {
if (getWizImageData(resNum, state, 0) != 0) {
- srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
+ srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, 0, 0, shadow, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
} else {
uint8 *dataPtr = _vm->getResourceAddress(rtImage, resNum);
assert(dataPtr);
@@ -1779,7 +1885,7 @@ void Wiz::flushWizBuffer() {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->shadow, 0, pwi->palette);
} else {
const Common::Rect *r = NULL;
- drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->shadow, pwi->field_390, r, pwi->flags, 0, _vm->getHEPaletteSlot(pwi->palette));
+ drawWizImage(pwi->resNum, pwi->state, 0, 0, pwi->x1, pwi->y1, pwi->zorder, pwi->shadow, pwi->field_390, r, pwi->flags, 0, _vm->getHEPaletteSlot(pwi->palette));
}
}
_imagesNum = 0;
@@ -1800,7 +1906,7 @@ void Wiz::loadWizCursor(int resId, int palette) {
}
const Common::Rect *r = NULL;
- uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
+ uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
@@ -1817,8 +1923,7 @@ void Wiz::displayWizComplexImage(const WizParameters *params) {
int sourceImage = 0;
if (params->processFlags & kWPFMaskImg) {
sourceImage = params->sourceImage;
- debug(3, "displayWizComplexImage() unhandled flag kWPFMaskImg");
- return;
+ debug(0, "displayWizComplexImage() flag kWPFMaskImg");
}
int palette = 0;
if (params->processFlags & kWPFPaletteNum) {
@@ -1886,15 +1991,14 @@ void Wiz::displayWizComplexImage(const WizParameters *params) {
++_imagesNum;
} else {
if (sourceImage != 0) {
- // TODO: Add support for kWPFMaskImg
- drawWizImage(params->sourceImage, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));
+ drawWizImage(params->sourceImage, 0, params->img.resNum, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));
} else if (params->processFlags & (kWPFScaled | kWPFRotate)) {
drawWizComplexPolygon(params->img.resNum, state, po_x, po_y, shadow, rotationAngle, scale, r, flags, dstResNum, palette);
} else {
if (flags & kWIFIsPolygon) {
drawWizPolygon(params->img.resNum, state, po_x, flags, shadow, dstResNum, palette);
} else {
- drawWizImage(params->img.resNum, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));
+ drawWizImage(params->img.resNum, state, 0, 0, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));
}
}
}
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index 4a5dd74e38..5c5daa5974 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -201,11 +201,13 @@ public:
void displayWizImage(WizImage *pwi);
void processWizImage(const WizParameters *params);
- uint8 *drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, const uint8 *palPtr);
+ uint8 *drawWizImage(int resNum, int state, int maskNum, int maskState, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, const uint8 *palPtr);
void drawWizPolygon(int resNum, int state, int id, int flags, int shadow, int dstResNum, int palette);
void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int palette);
void drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int flags, int shadow, int dstResNum, int palette);
+ static void copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr);
+
static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, uint8 bitdepth);
static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP);
static void copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
--
cgit v1.2.3
From 4087a3e6e8ebc0b519fc4c178a29696bd64fdd6f Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 6 Jun 2009 08:02:45 +0000
Subject: Corrected 16-bit cursor blit errors on GFX mode change.
svn-id: r41212
---
backends/platform/sdl/graphics.cpp | 18 +++++++++++++++++-
backends/platform/sdl/sdl.cpp | 2 +-
backends/platform/sdl/sdl.h | 7 +++++++
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 8ecf4ecda1..81e137e19c 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -332,7 +332,11 @@ void OSystem_SDL::setGraphicsModeIntern() {
// Even if the old and new scale factors are the same, we may have a
// different scaler for the cursor now.
+#ifdef ENABLE_16BIT
+ blitCursor(_cursorBitDepth);
+#else
blitCursor();
+#endif
}
int OSystem_SDL::getGraphicsMode() const {
@@ -600,7 +604,11 @@ bool OSystem_SDL::hotswapGFXMode() {
SDL_FreeSurface(old_overlayscreen);
// Update cursor to new scale
+#ifdef ENABLE_16BIT
+ blitCursor(_cursorBitDepth);
+#else
blitCursor();
+#endif
// Blit everything to the screen
internUpdateScreen();
@@ -1163,7 +1171,11 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
// Some games blink cursors with palette
if (_cursorPaletteDisabled)
+#ifdef ENABLE_16BIT
+ blitCursor(_cursorBitDepth);
+#else
blitCursor();
+#endif
}
void OSystem_SDL::grabPalette(byte *colors, uint start, uint num) {
@@ -1192,7 +1204,11 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
_cursorPaletteDisabled = false;
+#ifdef ENABLE_16BIT
+ blitCursor(_cursorBitDepth);
+#else
blitCursor();
+#endif
}
void OSystem_SDL::setShakePos(int shake_pos) {
@@ -1412,7 +1428,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
colmask |= 0xFF;
}
keycolor &= colmask;
-
+ _cursorBitDepth = bitDepth;
#else
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
#endif
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index b91d6938a2..3e8cefc86a 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,7 +197,7 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_16BIT
- _screen16(0),
+ _screen16(0), _cursorBitDepth(8),
#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 7d71ecb6ab..b6b7a8b284 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -124,7 +124,11 @@ public:
// Disables or enables cursor palette
void disableCursorPalette(bool disable) {
_cursorPaletteDisabled = disable;
+#ifdef ENABLE_16BIT
+ blitCursor(_cursorBitDepth);
+#else
blitCursor();
+#endif
}
// Shaking is used in SCUMM. Set current shake position.
@@ -354,6 +358,9 @@ protected:
MousePos _mouseCurState;
byte _mouseKeyColor;
int _cursorTargetScale;
+#ifdef ENABLE_16BIT
+ uint8 _cursorBitDepth;
+#endif
bool _cursorPaletteDisabled;
SDL_Surface *_mouseOrigSurface;
SDL_Surface *_mouseSurface;
--
cgit v1.2.3
From 0323638ce933e1dea7dd81b35a6646a9773a01ea Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 6 Jun 2009 08:41:03 +0000
Subject: Streamlined the cursor blitting changes introduced in revision 41412
svn-id: r41213
---
backends/platform/sdl/graphics.cpp | 26 ++------------------------
backends/platform/sdl/sdl.h | 8 --------
2 files changed, 2 insertions(+), 32 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 81e137e19c..2872c71f44 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -332,11 +332,7 @@ void OSystem_SDL::setGraphicsModeIntern() {
// Even if the old and new scale factors are the same, we may have a
// different scaler for the cursor now.
-#ifdef ENABLE_16BIT
- blitCursor(_cursorBitDepth);
-#else
blitCursor();
-#endif
}
int OSystem_SDL::getGraphicsMode() const {
@@ -604,11 +600,7 @@ bool OSystem_SDL::hotswapGFXMode() {
SDL_FreeSurface(old_overlayscreen);
// Update cursor to new scale
-#ifdef ENABLE_16BIT
- blitCursor(_cursorBitDepth);
-#else
blitCursor();
-#endif
// Blit everything to the screen
internUpdateScreen();
@@ -1171,11 +1163,7 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
// Some games blink cursors with palette
if (_cursorPaletteDisabled)
-#ifdef ENABLE_16BIT
- blitCursor(_cursorBitDepth);
-#else
blitCursor();
-#endif
}
void OSystem_SDL::grabPalette(byte *colors, uint start, uint num) {
@@ -1204,11 +1192,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
_cursorPaletteDisabled = false;
-#ifdef ENABLE_16BIT
- blitCursor(_cursorBitDepth);
-#else
blitCursor();
-#endif
}
void OSystem_SDL::setShakePos(int shake_pos) {
@@ -1469,21 +1453,15 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
#ifdef ENABLE_16BIT
_mouseData = (byte *)malloc(w * h * byteDepth);
memcpy(_mouseData, buf, w * h * byteDepth);
-
- blitCursor(bitDepth);
#else
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
+#endif
blitCursor();
-#endif
}
-#ifdef ENABLE_16BIT
-void OSystem_SDL::blitCursor(uint8 bitDepth) {
-#else
void OSystem_SDL::blitCursor() {
-#endif
byte *dstPtr;
const byte *srcPtr = _mouseData;
byte color;
@@ -1522,7 +1500,7 @@ void OSystem_SDL::blitCursor() {
for (j = 0; j < w; j++) {
color = *srcPtr;
#ifdef ENABLE_16BIT
- if (bitDepth == 16) {
+ if (_cursorBitDepth == 16) {
if (color != _mouseKeyColor) { // transparent, don't draw
int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3;
int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index b6b7a8b284..6fe871fa83 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -124,11 +124,7 @@ public:
// Disables or enables cursor palette
void disableCursorPalette(bool disable) {
_cursorPaletteDisabled = disable;
-#ifdef ENABLE_16BIT
- blitCursor(_cursorBitDepth);
-#else
blitCursor();
-#endif
}
// Shaking is used in SCUMM. Set current shake position.
@@ -420,11 +416,7 @@ protected:
virtual void drawMouse(); // overloaded by CE backend
virtual void undrawMouse(); // overloaded by CE backend (FIXME)
-#ifdef ENABLE_16BIT
- virtual void blitCursor(uint8 bitDepth = 8); // overloaded by CE backend (FIXME)
-#else
virtual void blitCursor(); // overloaded by CE backend (FIXME)
-#endif
/** Set the position of the virtual mouse cursor. */
void setMousePos(int x, int y);
--
cgit v1.2.3
From d3ede78c9a51b46fdfebf907988d13cc410af7ee Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sun, 7 Jun 2009 12:01:21 +0000
Subject: Since we're in 16bit branch, enable 16bit by default
svn-id: r41330
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index bc2123be41..fb7c646f3a 100755
--- a/configure
+++ b/configure
@@ -110,7 +110,7 @@ _alsa=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
-_16bit=no
+_16bit=yes
_mt32emu=yes
# Default option behaviour yes/no
_build_hq_scalers=yes
--
cgit v1.2.3
From c426dd99a4c4149418fa16996e38f0995ddcaea5 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 9 Jun 2009 07:55:43 +0000
Subject: Laying the foundation for preliminary bitdepth negotiation. (No
functionality changes yet)
svn-id: r41396
---
backends/platform/sdl/sdl.h | 13 +++++++++-
common/system.h | 11 +++++++++
graphics/pixelformat.h | 60 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 83 insertions(+), 1 deletion(-)
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 6fe871fa83..22d3d41b00 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -178,6 +178,12 @@ public:
// Overlay
virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; }
+
+#ifdef ENABLE_16BIT
+ // Game screen
+ virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
+#endif
+
virtual void showOverlay();
virtual void hideOverlay();
virtual void clearOverlay();
@@ -232,7 +238,12 @@ protected:
// unseen game screen
SDL_Surface *_screen;
#ifdef ENABLE_16BIT
- SDL_Surface *_screen16;
+ Graphics::PixelFormat _screenFormat;
+
+ //HACK This is a temporary hack to get 16-bit graphics
+ //displaying quickly, which will be removed in favor of
+ //configuring the format of _screen on a per-game basis
+ SDL_Surface *_screen16;
#endif
// temporary screen (for scalers)
diff --git a/common/system.h b/common/system.h
index ddbcdcc546..50d00bb8e2 100644
--- a/common/system.h
+++ b/common/system.h
@@ -407,6 +407,9 @@ public:
kTransactionAspectRatioFailed = (1 << 0), /**< Failed switchting aspect ratio correction mode */
kTransactionFullscreenFailed = (1 << 1), /**< Failed switchting fullscreen mode */
kTransactionModeSwitchFailed = (1 << 2), /**< Failed switchting the GFX graphics mode (setGraphicsMode) */
+#ifdef ENABLE_16BIT
+ kTransactionPixelFormatNotSupported = (1 << 4), /**< Failed setting the color format (function not yet implemented) */
+#endif
kTransactionSizeChangeFailed = (1 << 3) /**< Failed switchting the screen dimensions (initSize) */
};
@@ -605,6 +608,14 @@ public:
*/
virtual Graphics::PixelFormat getOverlayFormat() const = 0;
+#ifdef ENABLE_16BIT
+ /**
+ * Returns the pixel format description of the game screen.
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getScreenFormat() const = 0;
+#endif
+
/**
* Reset the overlay.
*
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index f59650e5cc..2e8c065414 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -30,6 +30,66 @@
namespace Graphics {
+#ifdef ENABLE_16BIT
+/**
+ * A condensed bit format description.
+ *
+ * It includes the necessary information to create a PixelFormat and/or
+ * ColorMask which fully describe the given color format.
+ *
+ * It contains two components, the format (8Bit paletted, RGB555, etc)
+ * and the order (palette, ARGB, ABGR, etc)
+ *
+ * Use (format & kFormatTypeMask) to get the type, and (format & kFormatOrderMask)
+ * to get the applicable color order.
+ */
+enum ColorFormat {
+ kFormat8Bit = 0,
+ kFormatRGB555 = 1,
+ kFormatARGB1555 = 2, // Rare, but I know a guy who knows a guy who's heard of it being used
+ kFormatRGB556 = 3, // 6 bits for blue, in case this ever happens
+ kFormatRGB565 = 4,
+ kFormatRGB655 = 5, // 6 bits for red, in case this ever happens
+ kFormatARGB4444 = 6,
+ kFormatRGB888 = 7,
+ kFormatARGB6666 = 8, // I've never heard of this, but it's theoretically possible
+ kFormatARGB8888 = 9,
+ kFormatTypeMask = 0xFF, // & by this to get the overall bit format
+ kFormatPalette = 0 << 8,
+ kFormatRGB = 1 << 8,
+ kFormatRBG = 2 << 8,
+ kFormatGRB = 3 << 8,
+ kFormatGBR = 4 << 8,
+ kFormatBRG = 5 << 8,
+ kFormatBGR = 6 << 8,
+ kFormatARGB = 7 << 8,
+ kFormatARBG = 8 << 8,
+ kFormatAGRB = 9 << 8,
+ kFormatAGBR = 10 << 8,
+ kFormatABRG = 11 << 8,
+ kFormatABGR = 12 << 8,
+ kFormatRAGB = 13 << 8,
+ kFormatRABG = 14 << 8,
+ kFormatGARB = 15 << 8,
+ kFormatGABR = 16 << 8,
+ kFormatBARG = 17 << 8,
+ kFormatBAGR = 18 << 8,
+ kFormatRGAB = 19 << 8,
+ kFormatRBAG = 20 << 8,
+ kFormatGRAB = 21 << 8,
+ kFormatGBAR = 22 << 8,
+ kFormatBRAG = 23 << 8,
+ kFormatBGAR = 24 << 8,
+ kFormatRGBA = 25 << 8,
+ kFormatRBGA = 26 << 8,
+ kFormatGRBA = 27 << 8,
+ kFormatGBRA = 28 << 8,
+ kFormatBRGA = 29 << 8,
+ kFormatBGRA = 30 << 8,
+ kFormatOrderMask = 0xFF << 8 // & by this to get the order
+};
+#endif
+
/**
* A pixel format description.
*
--
cgit v1.2.3
From 0a793f08a4d198f3f766214ed4ce85ac51ccea5e Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 10 Jun 2009 05:35:18 +0000
Subject: SDL backend now dynamically generates 8 or 16-bit color surface
depending on engine request (using ad-hoc format).
svn-id: r41416
---
backends/platform/sdl/graphics.cpp | 244 ++++++++++++++++++++++++-------------
backends/platform/sdl/sdl.cpp | 3 +-
backends/platform/sdl/sdl.h | 32 +++--
base/main.cpp | 3 +
common/system.h | 55 +++++++--
5 files changed, 232 insertions(+), 105 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 2872c71f44..142fa94dba 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -97,6 +97,9 @@ void OSystem_SDL::beginGFXTransaction(void) {
_transactionDetails.needUpdatescreen = false;
_transactionDetails.normal1xScaler = false;
+#ifdef ENABLE_16BIT
+ _transactionDetails.formatChanged = false;
+#endif
_oldVideoMode = _videoMode;
}
@@ -127,6 +130,12 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
_videoMode.screenHeight = _oldVideoMode.screenHeight;
_videoMode.overlayWidth = _oldVideoMode.overlayWidth;
_videoMode.overlayHeight = _oldVideoMode.overlayHeight;
+#ifdef ENABLE_16BIT
+ } else if (_videoMode.format != _oldVideoMode.format) {
+ errors |= kTransactionPixelFormatNotSupported;
+
+ _videoMode.format = _oldVideoMode.format;
+#endif
}
if (_videoMode.fullscreen == _oldVideoMode.fullscreen &&
@@ -143,6 +152,32 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
}
}
+#ifdef ENABLE_16BIT
+ if (_transactionDetails.formatChanged) {
+ _screenFormat = getPixelFormat(_videoMode.format);
+ if (!_transactionDetails.sizeChanged) {
+ unloadGFXMode();
+ if (!loadGFXMode()) {
+ if (_oldVideoMode.setup) {
+ _transactionMode = kTransactionRollback;
+ errors |= endGFXTransaction();
+ }
+ } else {
+ setGraphicsModeIntern();
+ clearOverlay();
+
+ _videoMode.setup = true;
+ _modeChanged = true;
+ // OSystem_SDL::pollEvent used to update the screen change count,
+ // but actually it gives problems when a video mode was changed
+ // but OSystem_SDL::pollEvent was not called. This for example
+ // caused a crash under certain circumstances when doing an RTL.
+ // To fix this issue we update the screen change count right here.
+ _screenChangeCount++;
+ }
+ }
+ }
+#endif
if (_transactionDetails.sizeChanged) {
unloadGFXMode();
if (!loadGFXMode()) {
@@ -186,7 +221,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
} else if (_transactionDetails.needUpdatescreen) {
setGraphicsModeIntern();
internUpdateScreen();
- }
+ }
_transactionMode = kTransactionNone;
return (TransactionError)errors;
@@ -339,6 +374,102 @@ int OSystem_SDL::getGraphicsMode() const {
assert (_transactionMode == kTransactionNone);
return _videoMode.mode;
}
+#ifdef ENABLE_16BIT
+Graphics::ColorFormat OSystem_SDL::findCompatibleFormat(Common::List formatList)
+{
+ bool typeAccepted = false;
+ Graphics::ColorFormat format;
+
+ while (!formatList.empty() && !typeAccepted)
+ {
+ typeAccepted = false;
+ format = formatList.front();
+
+ //no need to keep searching if the screen
+ //is already in one of the desired formats
+ if (format == _videoMode.format)
+ return format;
+
+ formatList.pop_front();
+ switch (format & Graphics::kFormatTypeMask)
+ {
+ case Graphics::kFormat8Bit:
+ if (format == Graphics::kFormat8Bit)
+ return format;
+ break;
+ case Graphics::kFormatRGB555:
+ case Graphics::kFormatARGB1555:
+ case Graphics::kFormatRGB565:
+ typeAccepted = true;
+ break;
+ }
+
+ if (!typeAccepted)
+ continue;
+
+ switch (format & Graphics::kFormatOrderMask) {
+ case Graphics::kFormatRGB:
+ case Graphics::kFormatRGBA:
+ return format;
+ default:
+ break;
+ }
+ }
+ return Graphics::kFormat8Bit;
+}
+
+void OSystem_SDL::initFormat(Graphics::ColorFormat format) {
+ assert(_transactionMode == kTransactionActive);
+
+ //avoid redundant format changes
+ if (format == _videoMode.format)
+ return;
+
+ _videoMode.format = format;
+ _transactionDetails.formatChanged = true;
+
+}
+
+//This should only ever be called with a format that is known supported.
+Graphics::PixelFormat OSystem_SDL::getPixelFormat(Graphics::ColorFormat format) {
+ Graphics::PixelFormat result;
+ switch (format & Graphics::kFormatTypeMask) {
+ case Graphics::kFormatARGB1555:
+ result.aLoss = 7;
+ result.bytesPerPixel = 2;
+ result.rLoss = result.gLoss = result.bLoss = 3;
+ case Graphics::kFormatRGB555:
+ result.aLoss = 8;
+ result.bytesPerPixel = 2;
+ result.rLoss = result.gLoss = result.bLoss = 3;
+ break;
+ case Graphics::kFormatRGB565:
+ result.bytesPerPixel = 2;
+ result.aLoss = 8;
+ result.gLoss = 2;
+ result.rLoss = result.bLoss = 3;
+ break;
+ case Graphics::kFormat8Bit:
+ default:
+ result.bytesPerPixel = 1;
+ result.rShift = result.gShift = result.bShift = result.aShift = 0;
+ result.rLoss = result.gLoss = result.bLoss = result.aLoss = 8;
+ return result;
+ }
+ switch (format & Graphics::kFormatOrderMask)
+ {
+ default:
+ case Graphics::kFormatRGBA:
+ result.aShift = 0;
+ case Graphics::kFormatRGB:
+ result.bShift = result.aBits();
+ result.gShift = result.bShift + result.bBits();
+ result.rShift = result.gShift + result.gBits();
+ break;
+ }
+ return result;
+}
+#endif
void OSystem_SDL::initSize(uint w, uint h) {
assert(_transactionMode == kTransactionActive);
@@ -384,9 +515,21 @@ bool OSystem_SDL::loadGFXMode() {
//
// Create the surface that contains the 8 bit game data
//
+#ifdef ENABLE_16BIT
+ _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
+ _screenFormat.bytesPerPixel << 3,
+ ((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift ,
+ ((1 << _screenFormat.gBits()) - 1) << _screenFormat.gShift ,
+ ((1 << _screenFormat.bBits()) - 1) << _screenFormat.bShift ,
+ ((1 << _screenFormat.aBits()) - 1) << _screenFormat.aShift );
+ if (_screen == NULL)
+ error("allocating _screen failed");
+
+#else
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, 8, 0, 0, 0, 0);
if (_screen == NULL)
error("allocating _screen failed");
+#endif
//
// Create the surface that contains the scaled graphics in 16 bit mode
@@ -407,20 +550,6 @@ bool OSystem_SDL::loadGFXMode() {
}
}
-#ifdef ENABLE_16BIT
- //
- // Create the surface that contains the 16 bit game data
- //
- _screen16 = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
- 16,
- 0x7C00,
- 0x3E0,
- 0x1F,
- 0); //555, not 565
- if (_screen16 == NULL)
- error("allocating _screen16 failed");
-#endif
-
//
// Create the surface used for the graphics in 16 bit before scaling, and also the overlay
//
@@ -498,17 +627,10 @@ bool OSystem_SDL::loadGFXMode() {
}
void OSystem_SDL::unloadGFXMode() {
-#ifdef ENABLE_16BIT
- if (_screen16) {
- SDL_FreeSurface(_screen16);
- _screen16 = NULL;
- }
-#else
if (_screen) {
SDL_FreeSurface(_screen);
_screen = NULL;
}
-#endif
if (_hwscreen) {
SDL_FreeSurface(_hwscreen);
@@ -540,22 +662,13 @@ void OSystem_SDL::unloadGFXMode() {
}
bool OSystem_SDL::hotswapGFXMode() {
-#ifdef ENABLE_16BIT
- if (!_screen16)
-#else
if (!_screen)
-#endif
return false;
// Keep around the old _screen & _overlayscreen so we can restore the screen data
// after the mode switch.
-#ifdef ENABLE_16BIT
- SDL_Surface *old_screen = _screen16;
- _screen16 = NULL;
-#else
SDL_Surface *old_screen = _screen;
_screen = NULL;
-#endif
SDL_Surface *old_overlayscreen = _overlayscreen;
_overlayscreen = NULL;
@@ -574,11 +687,7 @@ bool OSystem_SDL::hotswapGFXMode() {
if (!loadGFXMode()) {
unloadGFXMode();
-#ifdef ENABLE_16BIT
- _screen16 = old_screen;
-#else
_screen = old_screen;
-#endif
_overlayscreen = old_overlayscreen;
return false;
@@ -588,11 +697,7 @@ bool OSystem_SDL::hotswapGFXMode() {
SDL_SetColors(_screen, _currentPalette, 0, 256);
// Restore old screen content
-#ifdef ENABLE_16BIT
- SDL_BlitSurface(old_screen, NULL, _screen16, NULL);
-#else
SDL_BlitSurface(old_screen, NULL, _screen, NULL);
-#endif
SDL_BlitSurface(old_overlayscreen, NULL, _overlayscreen, NULL);
// Free the old surfaces
@@ -674,11 +779,7 @@ void OSystem_SDL::internUpdateScreen() {
#endif
if (!_overlayVisible) {
-#ifdef ENABLE_16BIT
- origSurf = _screen16;
-#else
origSurf = _screen;
-#endif
srcSurf = _tmpscreen;
width = _videoMode.screenWidth;
height = _videoMode.screenHeight;
@@ -823,12 +924,6 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
assert (_transactionMode == kTransactionNone);
assert(src);
-#ifdef ENABLE_16BIT
- if (_screen16 == NULL) {
- warning("OSystem_SDL::copyRectToScreen: _screen16 == NULL");
- return;
- }
-#endif
if (_screen == NULL) {
warning("OSystem_SDL::copyRectToScreen: _screen == NULL");
return;
@@ -877,27 +972,20 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
}
// Try to lock the screen surface
-#ifdef ENABLE_16BIT
- if (SDL_LockSurface(_screen16) == -1)
-#else
if (SDL_LockSurface(_screen) == -1)
-#endif
error("SDL_LockSurface failed: %s", SDL_GetError());
#ifdef ENABLE_16BIT
- byte *dst = (byte *)_screen16->pixels + y * _videoMode.screenWidth * 2 + x * 2;
- if (_videoMode.screenWidth == w && pitch == w * 2) {
- memcpy(dst, src, h*w*2);
+ byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth * _screenFormat.bytesPerPixel + x * _screenFormat.bytesPerPixel;
+ if (_videoMode.screenWidth == w && pitch == w * _screenFormat.bytesPerPixel) {
+ memcpy(dst, src, h*w*_screenFormat.bytesPerPixel);
} else {
do {
- memcpy(dst, src, w * 2);
+ memcpy(dst, src, w * _screenFormat.bytesPerPixel);
src += pitch;
- dst += _videoMode.screenWidth * 2;
+ dst += _videoMode.screenWidth * _screenFormat.bytesPerPixel;
} while (--h);
}
-
- // Unlock the screen surface
- SDL_UnlockSurface(_screen16);
#else
byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth + x;
if (_videoMode.screenWidth == pitch && pitch == w) {
@@ -909,10 +997,10 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
dst += _videoMode.screenWidth;
} while (--h);
}
+#endif
// Unlock the screen surface
SDL_UnlockSurface(_screen);
-#endif
}
Graphics::Surface *OSystem_SDL::lockScreen() {
@@ -926,24 +1014,16 @@ Graphics::Surface *OSystem_SDL::lockScreen() {
_screenIsLocked = true;
// Try to lock the screen surface
-#ifdef ENABLE_16BIT
- if (SDL_LockSurface(_screen16) == -1)
-#else
if (SDL_LockSurface(_screen) == -1)
-#endif
error("SDL_LockSurface failed: %s", SDL_GetError());
-#ifdef ENABLE_16BIT
- _framebuffer.pixels = _screen16->pixels;
- _framebuffer.w = _screen16->w;
- _framebuffer.h = _screen16->h;
- _framebuffer.pitch = _screen16->pitch;
- _framebuffer.bytesPerPixel = 2;
-#else
_framebuffer.pixels = _screen->pixels;
_framebuffer.w = _screen->w;
_framebuffer.h = _screen->h;
_framebuffer.pitch = _screen->pitch;
+#ifdef ENABLE_16BIT
+ _framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel;
+#else
_framebuffer.bytesPerPixel = 1;
#endif
@@ -958,11 +1038,7 @@ void OSystem_SDL::unlockScreen() {
_screenIsLocked = false;
// Unlock the screen surface
-#ifdef ENABLE_16BIT
- SDL_UnlockSurface(_screen16);
-#else
SDL_UnlockSurface(_screen);
-#endif
// Trigger a full screen update
_forceFull = true;
@@ -1133,17 +1209,17 @@ int16 OSystem_SDL::getWidth() {
void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
assert(colors);
+#ifdef ENABLE_16BIT
+ if (_screenFormat.bytesPerPixel > 1)
+ return; //not using a paletted pixel format
+#endif
+
// Setting the palette before _screen is created is allowed - for now -
// since we don't actually set the palette until the screen is updated.
// But it could indicate a programming error, so let's warn about it.
-#ifdef ENABLE_16BIT
- if (!_screen16)
- warning("OSystem_SDL::setPalette: _screen16 == NULL");
-#else
if (!_screen)
warning("OSystem_SDL::setPalette: _screen == NULL");
-#endif
const byte *b = colors;
uint i;
@@ -1267,11 +1343,7 @@ void OSystem_SDL::clearOverlay() {
dst.x = dst.y = 1;
src.w = dst.w = _videoMode.screenWidth;
src.h = dst.h = _videoMode.screenHeight;
-#ifdef ENABLE_16BIT
- if (SDL_BlitSurface(_screen16, &src, _tmpscreen, &dst) != 0)
-#else
if (SDL_BlitSurface(_screen, &src, _tmpscreen, &dst) != 0)
-#endif
error("SDL_BlitSurface failed: %s", SDL_GetError());
SDL_LockSurface(_tmpscreen);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 3e8cefc86a..3ec4da1196 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,7 +197,8 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_16BIT
- _screen16(0), _cursorBitDepth(8),
+ _screenFormat(getPixelFormat(Graphics::kFormat8Bit)),
+ _cursorBitDepth(8),
#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 22d3d41b00..513ad73934 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -81,6 +81,22 @@ public:
void beginGFXTransaction(void);
TransactionError endGFXTransaction(void);
+#ifdef ENABLE_16BIT
+ // Find a compatible format from the list of formats supported by the engine
+ // Fallback to CLUT8 if none found
+ virtual Graphics::ColorFormat findCompatibleFormat(Common::List formatList);
+
+ // Set the depth and format of the video bitmap
+ // Typically, CLUT8
+ virtual void initFormat(Graphics::ColorFormat format);
+
+ // Game screen
+ virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
+
+ //Create a Graphics::PixelFormat to describe the requested color mode
+ virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format);
+#endif
+
// Set the size of the video bitmap.
// Typically, 320x200
virtual void initSize(uint w, uint h); // overloaded by CE backend
@@ -179,11 +195,6 @@ public:
// Overlay
virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; }
-#ifdef ENABLE_16BIT
- // Game screen
- virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
-#endif
-
virtual void showOverlay();
virtual void hideOverlay();
virtual void clearOverlay();
@@ -239,11 +250,6 @@ protected:
SDL_Surface *_screen;
#ifdef ENABLE_16BIT
Graphics::PixelFormat _screenFormat;
-
- //HACK This is a temporary hack to get 16-bit graphics
- //displaying quickly, which will be removed in favor of
- //configuring the format of _screen on a per-game basis
- SDL_Surface *_screen16;
#endif
// temporary screen (for scalers)
@@ -278,6 +284,9 @@ protected:
bool needHotswap;
bool needUpdatescreen;
bool normal1xScaler;
+#ifdef ENABLE_16BIT
+ bool formatChanged;
+#endif
};
TransactionDetails _transactionDetails;
@@ -292,6 +301,9 @@ protected:
int screenWidth, screenHeight;
int overlayWidth, overlayHeight;
+#ifdef ENABLE_16BIT
+ Graphics::ColorFormat format;
+#endif
};
VideoState _videoMode, _oldVideoMode;
diff --git a/base/main.cpp b/base/main.cpp
index dba4aeccaa..d76d8828a1 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -226,6 +226,9 @@ static void setupGraphics(OSystem &system) {
// Set the user specified graphics mode (if any).
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
+#ifdef ENABLE_16BIT
+ system.initFormat(Graphics::kFormat8Bit);
+#endif
system.initSize(320, 200);
if (ConfMan.hasKey("aspect_ratio"))
diff --git a/common/system.h b/common/system.h
index 50d00bb8e2..59da28c990 100644
--- a/common/system.h
+++ b/common/system.h
@@ -343,6 +343,53 @@ public:
*/
virtual int getGraphicsMode() const = 0;
+#ifdef ENABLE_16BIT
+ /**
+ * Find a supported color format from a list of requested formats. Typical formats include:
+ * CLUT8 (e.g. 256 color, for most games), all backends must provide support for this format
+ * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
+ * RGB565 (e.g. 16-bit color, for Urban Runner)
+ *
+ * These are the pixel formats for which the client code can generates data;
+ * they are not necessarily equal to the hardware pixel format. For example,
+ * a backend may perform color lookup of 8-bit graphics before pushing the
+ * screen buffer to hardware, or perform transformations of the ARGB color order.
+ *
+ * @param formatList A list of requested pixel formats, ordered by priority
+ *
+ * @return a supported ColorFormat from the list, or kFormat8Bit if no supported format was found
+ */
+ virtual Graphics::ColorFormat findCompatibleFormat(Common::List formatList) = 0;
+
+ /**
+ * Set the color format of the virtual screen. Typical formats include:
+ * CLUT8 (e.g. 256 color, for most games)
+ * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
+ * RGB565 (e.g. 16-bit color, for Urban Runner)
+ *
+ * This is the pixel format for which the client code generates data;
+ * this is not necessarily equal to the hardware pixel format. For example,
+ * a backend may perform color lookup of 8-bit graphics before pushing
+ * a screen to hardware, or correct the ARGB color order.
+ *
+ * @param format A pixel format that the backend screen will use
+ */
+ virtual void initFormat(Graphics::ColorFormat format) = 0;
+
+ /**
+ * Returns the pixel format description of the screen.
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getScreenFormat() const = 0;
+
+ /**
+ * Returns the pixel format description of the requested color mode
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format) = 0;
+
+#endif
+
/**
* Set the size of the virtual screen. Typical sizes include:
* - 320x200 (e.g. for most SCUMM games, and Simon)
@@ -608,14 +655,6 @@ public:
*/
virtual Graphics::PixelFormat getOverlayFormat() const = 0;
-#ifdef ENABLE_16BIT
- /**
- * Returns the pixel format description of the game screen.
- * @see Graphics::PixelFormat
- */
- virtual Graphics::PixelFormat getScreenFormat() const = 0;
-#endif
-
/**
* Reset the overlay.
*
--
cgit v1.2.3
From 58a348fd18727aab57c0f4f8ab4cc5ad893ee795 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 10 Jun 2009 05:35:54 +0000
Subject: Scumm engine now dynamically requests 16-bit color based on game
features, (using ad-hoc request format)
svn-id: r41417
---
engines/engine.cpp | 14 +++++++++++++-
engines/engine.h | 6 ++++++
engines/scumm/scumm.cpp | 6 ++++++
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 269bb0bc28..4be4fe90be 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -124,11 +124,23 @@ void initCommonGFX(bool defaultTo1XScaler) {
if (gameDomain && gameDomain->contains("fullscreen"))
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
-
void initGraphics(int width, int height, bool defaultTo1xScaler) {
+#ifdef ENABLE_16BIT
+ Common::List formatList;
+ formatList.push_back(Graphics::kFormat8Bit);
+ initGraphics(width,height,defaultTo1xScaler, formatList);
+}
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList) {
+#endif
+
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
+#ifdef ENABLE_16BIT
+ Graphics::ColorFormat format = g_system->findCompatibleFormat(formatList);
+ debug("%X",format); //TODO: set up the pixelFormat here
+ g_system->initFormat(format);
+#endif
g_system->initSize(width, height);
OSystem::TransactionError gfxError = g_system->endGFXTransaction();
diff --git a/engines/engine.h b/engines/engine.h
index 45477f408d..8538cc779f 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -29,6 +29,9 @@
#include "common/error.h"
#include "common/fs.h"
#include "common/str.h"
+#ifdef ENABLE_16BIT
+#include "graphics/pixelformat.h"
+#endif
class OSystem;
@@ -59,6 +62,9 @@ void initCommonGFX(bool defaultTo1XScaler);
* Errors out when backend is not able to switch to the specified
* mode.
*/
+#ifdef ENABLE_16BIT
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList);
+#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
/**
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0599139778..3d0a2d0bc2 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1083,6 +1083,12 @@ Common::Error ScummEngine::init() {
// CJK FT and DIG use usual NUT fonts, not FM-TOWNS ROM, so
// there is no text surface for them. This takes that into account
(_screenWidth * _textSurfaceMultiplier > 320));
+ } else if (_game.features & GF_16BIT_COLOR) {
+ int format = Graphics::kFormatRGB555 | Graphics::kFormatRGB;
+ Common::List formatList;
+ formatList.push_back((Graphics::ColorFormat) format);
+ formatList.push_back(Graphics::kFormat8Bit);
+ initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList);
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
}
--
cgit v1.2.3
From 8a8366aab5ee33857a0574aac6675f27912388c3 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Wed, 10 Jun 2009 06:05:11 +0000
Subject: Correct horizontal flipping in decompressWizImage(), when using 16bit
color.
svn-id: r41418
---
engines/scumm/he/wiz_he.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 9aa2bf741a..4661bb649c 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -858,7 +858,7 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, int dstType, const uint8
dstInc = bitDepth;
if (flags & kWIFFlipX) {
dstPtr += (w - 1) * bitDepth;
- dstInc = -1;
+ dstInc = -bitDepth;
}
while (h--) {
--
cgit v1.2.3
From b4c44a018b636a9805c725f9a286e58be554afc2 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Wed, 10 Jun 2009 08:41:33 +0000
Subject: Code formatting
svn-id: r41420
---
backends/platform/sdl/graphics.cpp | 99 ++++++++++++++++++--------------------
1 file changed, 48 insertions(+), 51 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 142fa94dba..4035bdb661 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -375,13 +375,11 @@ int OSystem_SDL::getGraphicsMode() const {
return _videoMode.mode;
}
#ifdef ENABLE_16BIT
-Graphics::ColorFormat OSystem_SDL::findCompatibleFormat(Common::List formatList)
-{
+Graphics::ColorFormat OSystem_SDL::findCompatibleFormat(Common::List formatList) {
bool typeAccepted = false;
Graphics::ColorFormat format;
- while (!formatList.empty() && !typeAccepted)
- {
+ while (!formatList.empty() && !typeAccepted) {
typeAccepted = false;
format = formatList.front();
@@ -391,28 +389,27 @@ Graphics::ColorFormat OSystem_SDL::findCompatibleFormat(Common::List formatList) {
+Graphics::ColorMode OSystem_SDL::findCompatibleFormat(Common::List formatList) {
bool typeAccepted = false;
- Graphics::ColorFormat format;
+ Graphics::ColorMode format;
- while (!formatList.empty() && !typeAccepted) {
+ while (!formatList.empty()) {
typeAccepted = false;
format = formatList.front();
@@ -389,33 +366,21 @@ Graphics::ColorFormat OSystem_SDL::findCompatibleFormat(Common::List> 3;
- for (int i = byteDepth; i > 1; i--) {
- colmask <<= 8;
- colmask |= 0xFF;
- }
- keycolor &= colmask;
- _cursorBitDepth = bitDepth;
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
+ keycolor &= (1 << (_screenFormat.bytesPerPixel << 3)) - 1;
#else
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
#endif
@@ -1520,8 +1467,8 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
free(_mouseData);
#ifdef ENABLE_16BIT
- _mouseData = (byte *)malloc(w * h * byteDepth);
- memcpy(_mouseData, buf, w * h * byteDepth);
+ _mouseData = (byte *)malloc(w * h * _screenFormat.bytesPerPixel);
+ memcpy(_mouseData, buf, w * h * _screenFormat.bytesPerPixel);
#else
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
@@ -1533,7 +1480,12 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
void OSystem_SDL::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
+#ifdef ENABLE_16BIT
+ uint32 color;
+ uint32 colormask = (1 << (_screenFormat.bytesPerPixel << 3)) - 1;
+#else
byte color;
+#endif
int w, h, i, j;
if (!_mouseOrigSurface || !_mouseData)
@@ -1567,20 +1519,20 @@ void OSystem_SDL::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
- color = *srcPtr;
#ifdef ENABLE_16BIT
- if (_cursorBitDepth == 16) {
+ if (_screenFormat.bytesPerPixel > 1) {
+ color = (*(uint32 *) srcPtr) & colormask;
if (color != _mouseKeyColor) { // transparent, don't draw
- int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3;
- int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3;
- int8 b = (*(uint16 *)srcPtr & 0x1F) << 3;
+ uint8 r,g,b;
+ _screenFormat.colorToRGB(color,r,g,b);
*(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
r, g, b);
}
dstPtr += 2;
- srcPtr += 2;
+ srcPtr += _screenFormat.bytesPerPixel;
} else {
#endif
+ color = *srcPtr;
if (color != _mouseKeyColor) { // transparent, don't draw
*(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
palette[color].r, palette[color].g, palette[color].b);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 3ec4da1196..5bcd91d566 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,7 +197,7 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_16BIT
- _screenFormat(getPixelFormat(Graphics::kFormat8Bit)),
+ _screenFormat(getPixelFormat(Graphics::kFormatCLUT8)),
_cursorBitDepth(8),
#endif
_overlayVisible(false),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 513ad73934..4d5ea3f548 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -84,17 +84,17 @@ public:
#ifdef ENABLE_16BIT
// Find a compatible format from the list of formats supported by the engine
// Fallback to CLUT8 if none found
- virtual Graphics::ColorFormat findCompatibleFormat(Common::List formatList);
+ virtual Graphics::ColorMode findCompatibleFormat(Common::List formatList);
// Set the depth and format of the video bitmap
// Typically, CLUT8
- virtual void initFormat(Graphics::ColorFormat format);
+ virtual void initFormat(Graphics::ColorMode format);
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
//Create a Graphics::PixelFormat to describe the requested color mode
- virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format);
+ virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorMode format);
#endif
// Set the size of the video bitmap.
@@ -129,7 +129,7 @@ public:
// Set the bitmap that's used when drawing the cursor.
#ifdef ENABLE_16BIT
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, uint8 bitDepth = 8); // overloaded by CE backend (FIXME)
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
#else
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
#endif
@@ -302,7 +302,7 @@ protected:
int screenWidth, screenHeight;
int overlayWidth, overlayHeight;
#ifdef ENABLE_16BIT
- Graphics::ColorFormat format;
+ Graphics::ColorMode format;
#endif
};
VideoState _videoMode, _oldVideoMode;
diff --git a/base/main.cpp b/base/main.cpp
index d76d8828a1..5c1ca7dc20 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -227,7 +227,7 @@ static void setupGraphics(OSystem &system) {
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
#ifdef ENABLE_16BIT
- system.initFormat(Graphics::kFormat8Bit);
+ system.initFormat(Graphics::kFormatCLUT8);
#endif
system.initSize(320, 200);
diff --git a/common/system.h b/common/system.h
index 59da28c990..82a89f4ad3 100644
--- a/common/system.h
+++ b/common/system.h
@@ -357,9 +357,9 @@ public:
*
* @param formatList A list of requested pixel formats, ordered by priority
*
- * @return a supported ColorFormat from the list, or kFormat8Bit if no supported format was found
+ * @return a supported ColorMode from the list, or kFormatCLUT8 if no supported format was found
*/
- virtual Graphics::ColorFormat findCompatibleFormat(Common::List formatList) = 0;
+ virtual Graphics::ColorMode findCompatibleFormat(Common::List formatList) = 0;
/**
* Set the color format of the virtual screen. Typical formats include:
@@ -374,7 +374,7 @@ public:
*
* @param format A pixel format that the backend screen will use
*/
- virtual void initFormat(Graphics::ColorFormat format) = 0;
+ virtual void initFormat(Graphics::ColorMode format) = 0;
/**
* Returns the pixel format description of the screen.
@@ -386,7 +386,7 @@ public:
* Returns the pixel format description of the requested color mode
* @see Graphics::PixelFormat
*/
- virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format) = 0;
+ virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorMode format) = 0;
#endif
@@ -738,7 +738,7 @@ public:
* @param cursorTargetScale scale factor which cursor is designed for
*/
#ifdef ENABLE_16BIT
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, uint8 bitDepth = 8) = 0;
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1) = 0;
#else
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1) = 0;
#endif
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 4be4fe90be..31ead2df1a 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -126,18 +126,18 @@ void initCommonGFX(bool defaultTo1XScaler) {
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
#ifdef ENABLE_16BIT
- Common::List formatList;
- formatList.push_back(Graphics::kFormat8Bit);
+ Common::List formatList;
+ formatList.push_back(Graphics::kFormatCLUT8);
initGraphics(width,height,defaultTo1xScaler, formatList);
}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList) {
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList) {
#endif
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
#ifdef ENABLE_16BIT
- Graphics::ColorFormat format = g_system->findCompatibleFormat(formatList);
+ Graphics::ColorMode format = g_system->findCompatibleFormat(formatList);
debug("%X",format); //TODO: set up the pixelFormat here
g_system->initFormat(format);
#endif
@@ -161,6 +161,15 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList);
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList);
#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index bc4a2e0d33..fcde07cbdf 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,21 +112,10 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
- if (_game.features & GF_16BIT_COLOR) {
- //HACK Had to make a second method to avoid many, many linker errors from other engines
- //this requires ENABLE_16BIT to be defined in the Scumm project, again, because I #ifdef'ed
- //the method's definition and declaration in cursorman.h
- CursorMan.replaceCursorReal(_grabbedCursor, _cursor.width, _cursor.height,
- _cursor.hotspotX, _cursor.hotspotY,
- (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1),
- 16);
- } else {
- CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
- _cursor.hotspotX, _cursor.hotspotY,
- (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1));
- }
+ CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
+ _cursor.hotspotX, _cursor.hotspotY,
+ (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+ (_game.heversion == 70 ? 2 : 1));
}
void ScummEngine_v6::grabCursor(int x, int y, int w, int h) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 3d0a2d0bc2..0ebf832a37 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1083,12 +1083,14 @@ Common::Error ScummEngine::init() {
// CJK FT and DIG use usual NUT fonts, not FM-TOWNS ROM, so
// there is no text surface for them. This takes that into account
(_screenWidth * _textSurfaceMultiplier > 320));
+#ifdef ENABLE_16BIT
} else if (_game.features & GF_16BIT_COLOR) {
- int format = Graphics::kFormatRGB555 | Graphics::kFormatRGB;
- Common::List formatList;
- formatList.push_back((Graphics::ColorFormat) format);
- formatList.push_back(Graphics::kFormat8Bit);
+ int format = Graphics::kFormatRGB555;
+ Common::List formatList;
+ formatList.push_back((Graphics::ColorMode) format);
+ formatList.push_back(Graphics::kFormatCLUT8);
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList);
+#endif
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
}
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 00932e55b0..850b0044dc 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -57,33 +57,18 @@ bool CursorManager::showMouse(bool visible) {
return g_system->showMouse(visible);
}
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
#ifdef ENABLE_16BIT
- pushCursorReal(buf,w,h,hotspotX,hotspotY,keycolor,targetScale,8);
-}
-void CursorManager::pushCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, uint8 bitDepth) {
- uint32 colmask = 0xFF;
- uint8 byteDepth = bitDepth >> 3;
- for (int i = byteDepth; i > 1; i--) {
- colmask <<= 8;
- colmask |= 0xFF;
- }
- keycolor &= colmask;
-
- Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
+void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
#else
- Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
#endif
+ Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
cur->_visible = isVisible();
_cursorStack.push(cur);
if (buf) {
-#ifdef ENABLE_16BIT
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
-#else
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
-#endif
}
}
@@ -96,11 +81,7 @@ void CursorManager::popCursor() {
if (!_cursorStack.empty()) {
cur = _cursorStack.top();
-#ifdef ENABLE_16BIT
- g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_bitDepth);
-#else
g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale);
-#endif
}
g_system->showMouse(isVisible());
@@ -123,34 +104,25 @@ void CursorManager::popAllCursors() {
g_system->showMouse(isVisible());
}
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
#ifdef ENABLE_16BIT
- replaceCursorReal(buf,w,h,hotspotX,hotspotY,keycolor,targetScale);
-}
-
-void CursorManager::replaceCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, uint8 bitDepth) {
- uint32 colmask = 0xFF;
- uint8 byteDepth = bitDepth >> 3;
- for (int i = byteDepth; i > 1; i--) {
- colmask <<= 8;
- colmask |= 0xFF;
- }
- keycolor &= colmask;
-
+void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
+#else
+void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
#endif
+
if (_cursorStack.empty()) {
-#ifdef ENABLE_16BIT
- pushCursorReal(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
-#else
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
-#endif
return;
}
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_16BIT
- uint size = w * h * (bitDepth >> 3);
+ uint size;
+ { //limit the lifespan of the format variable to minimize memory impact
+ Graphics::PixelFormat f = g_system->getScreenFormat();
+ size = w * h * (f.bytesPerPixel);
+ }
#else
uint size = w * h;
#endif
@@ -171,11 +143,7 @@ void CursorManager::replaceCursorReal(const byte *buf, uint w, uint h, int hotsp
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
-#ifdef ENABLE_16BIT
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, bitDepth);
-#else
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
-#endif
}
void CursorManager::disableCursorPalette(bool disable) {
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 481567bb09..0c02292818 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -28,6 +28,10 @@
#include "common/scummsys.h"
#include "common/stack.h"
#include "common/singleton.h"
+#ifdef ENABLE_16BIT
+#include "graphics/pixelformat.h"
+#include "common/system.h"
+#endif
namespace Graphics {
@@ -56,10 +60,11 @@ public:
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-#ifdef ENABLE_16BIT
- void pushCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8);
-#endif
+//#ifdef ENABLE_16BIT
+ void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
+//#else
+// void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
+//#endif
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -80,11 +85,11 @@ public:
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
*/
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-#ifdef ENABLE_16BIT
- //HACK made a separate method to avoid massive linker errors on every engine.
- void replaceCursorReal(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8);
-#endif
+//#ifdef ENABLE_16BIT
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
+//#else
+// void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
+//#endif
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -148,28 +153,22 @@ private:
uint _height;
int _hotspotX;
int _hotspotY;
-#ifdef ENABLE_16BIT
+//#ifdef ENABLE_16BIT
uint32 _keycolor;
- uint8 _bitDepth;
-#else
- byte _keycolor;
-#endif
+//#else
+// byte _keycolor;
+//#endif
byte _targetScale;
uint _size;
#ifdef ENABLE_16BIT
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8) {
- uint32 colmask = 0xFF;
- uint8 byteDepth = bitDepth >> 3;
- _size = w * h * byteDepth;
- _bitDepth = bitDepth;
- for (int i = byteDepth; i > 1; i--) {
- colmask <<= 8;
- colmask |= 0xFF;
+ { //limit the lifespan of the format value to minimize impact on memory usage
+ Graphics::PixelFormat f = g_system->getScreenFormat();
+ _size = w * h * f.bytesPerPixel;
+ _keycolor = keycolor & ((1 << (f.bytesPerPixel << 3)) - 1);
}
- _keycolor = keycolor & colmask;
-
#else
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1) {
_size = w * h;
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 2e8c065414..d37a7794f4 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -43,50 +43,16 @@ namespace Graphics {
* Use (format & kFormatTypeMask) to get the type, and (format & kFormatOrderMask)
* to get the applicable color order.
*/
-enum ColorFormat {
- kFormat8Bit = 0,
+enum ColorMode {
+ kFormatCLUT8 = 0,
kFormatRGB555 = 1,
- kFormatARGB1555 = 2, // Rare, but I know a guy who knows a guy who's heard of it being used
- kFormatRGB556 = 3, // 6 bits for blue, in case this ever happens
- kFormatRGB565 = 4,
- kFormatRGB655 = 5, // 6 bits for red, in case this ever happens
- kFormatARGB4444 = 6,
- kFormatRGB888 = 7,
- kFormatARGB6666 = 8, // I've never heard of this, but it's theoretically possible
- kFormatARGB8888 = 9,
- kFormatTypeMask = 0xFF, // & by this to get the overall bit format
- kFormatPalette = 0 << 8,
- kFormatRGB = 1 << 8,
- kFormatRBG = 2 << 8,
- kFormatGRB = 3 << 8,
- kFormatGBR = 4 << 8,
- kFormatBRG = 5 << 8,
- kFormatBGR = 6 << 8,
- kFormatARGB = 7 << 8,
- kFormatARBG = 8 << 8,
- kFormatAGRB = 9 << 8,
- kFormatAGBR = 10 << 8,
- kFormatABRG = 11 << 8,
- kFormatABGR = 12 << 8,
- kFormatRAGB = 13 << 8,
- kFormatRABG = 14 << 8,
- kFormatGARB = 15 << 8,
- kFormatGABR = 16 << 8,
- kFormatBARG = 17 << 8,
- kFormatBAGR = 18 << 8,
- kFormatRGAB = 19 << 8,
- kFormatRBAG = 20 << 8,
- kFormatGRAB = 21 << 8,
- kFormatGBAR = 22 << 8,
- kFormatBRAG = 23 << 8,
- kFormatBGAR = 24 << 8,
- kFormatRGBA = 25 << 8,
- kFormatRBGA = 26 << 8,
- kFormatGRBA = 27 << 8,
- kFormatGBRA = 28 << 8,
- kFormatBRGA = 29 << 8,
- kFormatBGRA = 30 << 8,
- kFormatOrderMask = 0xFF << 8 // & by this to get the order
+ kFormatRGB556 = 2, // 6 bits for blue, in case this ever happens
+ kFormatRGB565 = 3,
+ kFormatRGB655 = 4, // 6 bits for red, in case this ever happens
+ kFormatRGBA4444 = 5,
+ kFormatRGB888 = 6,
+ kFormatRGBA6666 = 7, // I've never heard of this, but it's theoretically possible
+ kFormatRGBA8888 = 8
};
#endif
--
cgit v1.2.3
From 2ee51a8fa189fc7817fd6d78533664ec870fca48 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 12 Jun 2009 08:49:45 +0000
Subject: Unfinished proof of concept regarding my compromise with LordHoto in
IRC.
svn-id: r41464
---
backends/platform/sdl/graphics.cpp | 41 +++++++++++++++++++++++++++++++++-----
backends/platform/sdl/sdl.h | 4 ++--
base/main.cpp | 2 +-
common/system.h | 2 +-
engines/engine.cpp | 2 +-
graphics/pixelformat.h | 14 ++++++-------
6 files changed, 48 insertions(+), 17 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 51f63a364a..e5d8ba4fbc 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -128,7 +128,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
errors |= kTransactionPixelFormatNotSupported;
_videoMode.format = _oldVideoMode.format;
- _screenFormat = getPixelFormat(_videoMode.format);
+ _screenFormat = _videoMode.format;
#endif
} else if (_videoMode.screenWidth != _oldVideoMode.screenWidth || _videoMode.screenHeight != _oldVideoMode.screenHeight) {
errors |= kTransactionSizeChangeFailed;
@@ -362,7 +362,7 @@ Graphics::ColorMode OSystem_SDL::findCompatibleFormat(Common::ListfindCompatibleFormat(formatList);
debug("%X",format); //TODO: set up the pixelFormat here
- g_system->initFormat(format);
+ g_system->initFormat(g_system->getPixelFormat(format));
#endif
g_system->initSize(width, height);
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index d37a7794f4..fa5925b1f9 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -44,15 +44,15 @@ namespace Graphics {
* to get the applicable color order.
*/
enum ColorMode {
- kFormatCLUT8 = 0,
+ kFormatCLUT8 = 0, //256 color palette.
kFormatRGB555 = 1,
- kFormatRGB556 = 2, // 6 bits for blue, in case this ever happens
+ kFormatXRGB1555 = 2, // Special case, high bit has special purpose, which may be alpha.
+ // Engines should probably handle this bit internally and pass RGB only, though
kFormatRGB565 = 3,
- kFormatRGB655 = 4, // 6 bits for red, in case this ever happens
- kFormatRGBA4444 = 5,
- kFormatRGB888 = 6,
- kFormatRGBA6666 = 7, // I've never heard of this, but it's theoretically possible
- kFormatRGBA8888 = 8
+ kFormatRGBA4444 = 4, // since this mode is commonly supported in game hardware, some unimplemented engines may use it?
+ kFormatRGB888 = 5,
+ kFormatRGBA6666 = 6, // I've never heard of this, but it's vaguely plausible
+ kFormatRGBA8888 = 7
};
#endif
--
cgit v1.2.3
From 350dc4290fd5dd8f28af9e63713b48ef2c131f09 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 13 Jun 2009 10:24:52 +0000
Subject: Fixed cursor code to keep track of cursor formats so that ThemeEngine
and/or GuiManager cursors will render properly over the game (on spacebar
hit, for instance)
svn-id: r41491
---
backends/platform/sdl/graphics.cpp | 24 +++++++++++------
backends/platform/sdl/sdl.h | 2 ++
common/system.h | 1 +
engines/scumm/cursor.cpp | 3 +++
graphics/cursorman.cpp | 55 ++++++++++++++++++++++++++++++++++++--
graphics/cursorman.h | 29 +++++++++++++++++++-
gui/GuiManager.cpp | 14 ++++++++++
gui/ThemeEngine.cpp | 15 +++++++++++
gui/ThemeEngine.h | 3 +++
9 files changed, 135 insertions(+), 11 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index e5d8ba4fbc..0d1b3fb8aa 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1249,10 +1249,18 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
}
_cursorPaletteDisabled = false;
+#ifdef ENABLE_16BIT
+}
- blitCursor();
+void OSystem_SDL::setCursorFormat(Graphics::PixelFormat format) {
+ assert(format.bytesPerPixel);
+ _cursorFormat = format;
+
+#endif
+// blitCursor();
}
+
void OSystem_SDL::setShakePos(int shake_pos) {
assert (_transactionMode == kTransactionNone);
@@ -1459,7 +1467,7 @@ void OSystem_SDL::warpMouse(int x, int y) {
#ifdef ENABLE_16BIT
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
- keycolor &= (1 << (_screenFormat.bytesPerPixel << 3)) - 1;
+ keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
#endif
@@ -1498,8 +1506,8 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
free(_mouseData);
#ifdef ENABLE_16BIT
- _mouseData = (byte *)malloc(w * h * _screenFormat.bytesPerPixel);
- memcpy(_mouseData, buf, w * h * _screenFormat.bytesPerPixel);
+ _mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel);
+ memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel);
#else
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
@@ -1513,7 +1521,7 @@ void OSystem_SDL::blitCursor() {
const byte *srcPtr = _mouseData;
#ifdef ENABLE_16BIT
uint32 color;
- uint32 colormask = (1 << (_screenFormat.bytesPerPixel << 3)) - 1;
+ uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
byte color;
#endif
@@ -1551,16 +1559,16 @@ void OSystem_SDL::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
#ifdef ENABLE_16BIT
- if (_screenFormat.bytesPerPixel > 1) {
+ if (_cursorFormat.bytesPerPixel > 1) {
color = (*(uint32 *) srcPtr) & colormask;
if (color != _mouseKeyColor) { // transparent, don't draw
uint8 r,g,b;
- _screenFormat.colorToRGB(color,r,g,b);
+ _cursorFormat.colorToRGB(color,r,g,b);
*(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
r, g, b);
}
dstPtr += 2;
- srcPtr += _screenFormat.bytesPerPixel;
+ srcPtr += _cursorFormat.bytesPerPixel;
} else {
#endif
color = *srcPtr;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 69b85c7959..a25f697c80 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -130,6 +130,7 @@ public:
// Set the bitmap that's used when drawing the cursor.
#ifdef ENABLE_16BIT
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
+ virtual void setCursorFormat(Graphics::PixelFormat format);
#else
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
#endif
@@ -250,6 +251,7 @@ protected:
SDL_Surface *_screen;
#ifdef ENABLE_16BIT
Graphics::PixelFormat _screenFormat;
+ Graphics::PixelFormat _cursorFormat;
#endif
// temporary screen (for scalers)
diff --git a/common/system.h b/common/system.h
index f16b560e34..4e282d1f31 100644
--- a/common/system.h
+++ b/common/system.h
@@ -739,6 +739,7 @@ public:
*/
#ifdef ENABLE_16BIT
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1) = 0;
+ virtual void setCursorFormat(Graphics::PixelFormat format) = 0;
#else
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1) = 0;
#endif
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index fcde07cbdf..30483a638c 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,6 +112,9 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
+#ifdef ENABLE_16BIT
+ CursorMan.replaceCursorFormat(_system->getScreenFormat());
+#endif
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 850b0044dc..e5a86b6bd8 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -101,6 +101,13 @@ void CursorManager::popAllCursors() {
}
}
+#ifdef ENABLE_16BIT
+ while (!_cursorFormatStack.empty()) {
+ PixelFormat *form = _cursorFormatStack.pop();
+ delete form;
+ }
+#endif
+
g_system->showMouse(isVisible());
}
@@ -118,8 +125,8 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_16BIT
- uint size;
- { //limit the lifespan of the format variable to minimize memory impact
+ uint size;
+ { //limit the lifespan of the format variable to minimize memory impact
Graphics::PixelFormat f = g_system->getScreenFormat();
size = w * h * (f.bytesPerPixel);
}
@@ -225,4 +232,48 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu
}
}
+#ifdef ENABLE_16BIT
+void CursorManager::pushCursorFormat(PixelFormat format) {
+// if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+// return;
+ PixelFormat *form = new PixelFormat(format);
+
+ _cursorFormatStack.push(form);
+ g_system->setCursorFormat(format);
+}
+
+void CursorManager::popCursorFormat() {
+
+ if (_cursorFormatStack.empty())
+ return;
+
+ PixelFormat *form = _cursorFormatStack.pop();
+ delete form;
+
+ if (_cursorFormatStack.empty()) {
+ g_system->setCursorFormat(g_system->getScreenFormat());
+ return;
+ }
+
+ form = _cursorFormatStack.top();
+ disableCursorPalette(form->bytesPerPixel != 1);
+
+ g_system->setCursorFormat(*form);
+}
+
+void CursorManager::replaceCursorFormat(PixelFormat format) {
+// if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+// return;
+
+ if (_cursorFormatStack.empty()) {
+ pushCursorFormat(format);
+ return;
+ }
+
+ PixelFormat *form = _cursorFormatStack.top();
+
+ g_system->setCursorFormat(*form);
+}
+#endif
+
} // End of namespace Graphics
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 0c02292818..834d0d2b02 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -142,6 +142,31 @@ public:
*/
void replaceCursorPalette(const byte *colors, uint start, uint num);
+#ifdef ENABLE_16BIT
+ /**
+ * Push a new cursor pixel format onto the stack, and set it in the backend.
+ *
+ * @param format the new format data, in a Graphics::PixelFormat
+ */
+ void pushCursorFormat(PixelFormat format);
+
+ /**
+ * Pop a cursor pixel format from the stack, and restore the previous one to
+ * the backend. If there is no previous format, the screen format is
+ * used instead.
+ */
+ void popCursorFormat();
+
+ /**
+ * Replace the current cursor pixel format on the stack. If the stack is
+ * empty, the format is pushed instead. It's a slightly more optimized
+ * way of popping the old format before pushing the new one.
+ *
+ * @param format the new format data, in a Graphics::PixelFormat
+ */
+ void replaceCursorFormat(PixelFormat format);
+#endif
+
private:
friend class Common::Singleton;
CursorManager();
@@ -216,9 +241,11 @@ private:
delete[] _data;
}
};
-
Common::Stack _cursorStack;
Common::Stack _cursorPaletteStack;
+#ifdef ENABLE_16BIT
+ Common::Stack _cursorFormatStack;
+#endif
};
} // End of namespace Graphics
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index cf8b7b2d9d..fcfc02967e 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -135,6 +135,9 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
delete _theme;
if (_useStdCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursorFormat();
+#endif
CursorMan.popCursorPalette();
CursorMan.popCursor();
}
@@ -382,6 +385,9 @@ void GuiManager::saveState() {
void GuiManager::restoreState() {
if (_useStdCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursorFormat();
+#endif
CursorMan.popCursor();
CursorMan.popCursorPalette();
}
@@ -424,6 +430,14 @@ void GuiManager::setupCursor() {
87, 87, 87, 0
};
+#ifdef ENABLE_16BIT
+ Graphics::PixelFormat format;
+ format.bytesPerPixel = 1;
+ format.rLoss = format.gLoss = format.bLoss = format.aLoss = 8;
+ format.rShift = format.gShift = format.bShift = format.aShift = 0;
+
+ CursorMan.pushCursorFormat(format);
+#endif
CursorMan.pushCursorPalette(palette, 0, 4);
CursorMan.pushCursor(NULL, 0, 0, 0, 0);
CursorMan.showMouse(true);
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index fe93a1f7d6..5ce7c3dc60 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -434,6 +434,9 @@ void ThemeEngine::refresh() {
_system->showOverlay();
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.replaceCursorFormat(_cursorFormat);
+#endif
CursorMan.replaceCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
}
@@ -445,6 +448,9 @@ void ThemeEngine::enable() {
return;
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.pushCursorFormat(_system->getScreenFormat());
+#endif
CursorMan.pushCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.pushCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
CursorMan.showMouse(true);
@@ -462,6 +468,9 @@ void ThemeEngine::disable() {
_system->hideOverlay();
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursorFormat();
+#endif
CursorMan.popCursorPalette();
CursorMan.popCursor();
}
@@ -1165,6 +1174,12 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
if (!cursor)
return false;
+#ifdef ENABLE_16BIT
+ _cursorFormat.bytesPerPixel = 1;
+ _cursorFormat.rLoss = _cursorFormat.gLoss = _cursorFormat.bLoss = _cursorFormat.aLoss = 8;
+ _cursorFormat.rShift = _cursorFormat.gShift = _cursorFormat.bShift = _cursorFormat.aShift = 0;
+#endif
+
// Set up the cursor parameters
_cursorHotspotX = hotspotX;
_cursorHotspotY = hotspotY;
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index a7bec4d9a3..2a7bbcc6ce 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -579,6 +579,9 @@ protected:
ImagesMap _bitmaps;
Graphics::PixelFormat _overlayFormat;
+#ifdef ENABLE_16BIT
+ Graphics::PixelFormat _cursorFormat;
+#endif
/** List of all the dirty screens that must be blitted to the overlay. */
Common::List _dirtyScreen;
--
cgit v1.2.3
From e6f874ee9508a6631635504808680e50a4f55c7f Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 13 Jun 2009 13:59:41 +0000
Subject: Fix possible endian issues.
svn-id: r41494
---
engines/scumm/he/wiz_he.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 4661bb649c..deaf7aaf72 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1152,7 +1152,10 @@ static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common
if (dst) {
src += rCapt.top * srcPitch + rCapt.left * 2;
while (h--) {
- memcpy(dst, src, w * 2);
+ for (int i = 0; i < w; i++) {
+ uint16 col = READ_UINT16(src + w * 2);
+ WRITE_LE_UINT16(dst + w * 2, col);
+ }
dst += w * 2;
src += srcPitch;
}
@@ -1734,7 +1737,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
if (srcWizBuf) {
uint8 *dst;
- int32 dstw, dsth, dstpitch, wizW, wizH;
+ int32 dstw, dsth, dstpitch, dstType, wizW, wizH;
VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
@@ -1745,6 +1748,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
assert(dst);
getWizImageDim(dstResNum, 0, dstw, dsth);
dstpitch = dstw * _vm->_bitDepth;
+ dstType = kDstResource;
} else {
if (flags & kWIFMarkBufferDirty) {
dst = pvs->getPixels(0, 0);
@@ -1754,6 +1758,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
dstw = pvs->w;
dsth = pvs->h;
dstpitch = pvs->pitch;
+ dstType = kDstScreen;
}
getWizImageDim(resNum, state, wizW, wizH);
@@ -1857,7 +1862,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
y_acc += pra->y_step;
if (_vm->_bitDepth == 2) {
if (transColor == -1 || transColor != READ_LE_UINT16(srcWizBuf + src_offs * 2))
- WRITE_LE_UINT16(dstPtr, READ_LE_UINT16(srcWizBuf + src_offs * 2));
+ writeColor(dstPtr, dstType, READ_LE_UINT16(srcWizBuf + src_offs * 2));
} else {
if (transColor == -1 || transColor != srcWizBuf[src_offs])
*dstPtr = srcWizBuf[src_offs];
--
cgit v1.2.3
From 8d306ebccfa7e88b2e4f4635bff3987e550f98d3 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Mon, 15 Jun 2009 09:45:19 +0000
Subject: Added kUnsupportedColorMode error code brought Scumm engine and SDL
backend into compliance with API outlined in
http://scummvmupthorn09.wordpress.com/2009/06/14/how-this-is-going-to-work/
Provided convenient Graphics::PixelFormat constructors for ColorMode enums,
and bitformat integers. Removed last vestiges (I think) of initial cursor
hack.
svn-id: r41539
---
backends/platform/sdl/graphics.cpp | 88 -----------------------------
backends/platform/sdl/sdl.cpp | 4 +-
backends/platform/sdl/sdl.h | 10 ----
base/main.cpp | 2 +-
common/error.h | 3 +
common/system.h | 24 --------
engines/engine.cpp | 17 +++---
engines/engine.h | 2 +-
engines/scumm/scumm.cpp | 9 ++-
graphics/pixelformat.h | 110 +++++++++++++++++++++++++++++++++++++
graphics/scaler.cpp | 14 +++++
11 files changed, 142 insertions(+), 141 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 0d1b3fb8aa..f550621a28 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -352,34 +352,6 @@ int OSystem_SDL::getGraphicsMode() const {
return _videoMode.mode;
}
#ifdef ENABLE_16BIT
-Graphics::ColorMode OSystem_SDL::findCompatibleFormat(Common::List formatList) {
- bool typeAccepted = false;
- Graphics::ColorMode format;
-
- while (!formatList.empty()) {
- typeAccepted = false;
- format = formatList.front();
-
- //no need to keep searching if the screen
- //is already in one of the desired formats
- if (getPixelFormat(format) == _videoMode.format)
- return format;
-
- formatList.pop_front();
- switch (format) {
- case Graphics::kFormatCLUT8:
- if (format == Graphics::kFormatCLUT8)
- return format;
- break;
- case Graphics::kFormatRGB555:
- case Graphics::kFormatRGB565:
- return format;
- break;
- }
- }
- return Graphics::kFormatCLUT8;
-}
-
void OSystem_SDL::initFormat(Graphics::PixelFormat format) {
assert(_transactionMode == kTransactionActive);
@@ -391,66 +363,6 @@ void OSystem_SDL::initFormat(Graphics::PixelFormat format) {
_transactionDetails.formatChanged = true;
_screenFormat = format;
}
-
-//TODO: Move this out of OSystem and into Graphics, where engine can access it.
-//TODO: ABGR support
-Graphics::PixelFormat OSystem_SDL::getPixelFormat(Graphics::ColorMode format) {
- Graphics::PixelFormat result;
- switch (format) {
- case Graphics::kFormatRGB555:
- result.aLoss = 8;
- result.bytesPerPixel = 2;
- result.rLoss = result.gLoss = result.bLoss = 3;
- break;
- case Graphics::kFormatRGB565:
- result.bytesPerPixel = 2;
- result.aLoss = 8;
- result.gLoss = 2;
- result.rLoss = result.bLoss = 3;
- break;
- case Graphics::kFormatXRGB1555:
- //Special case, alpha bit is always high in this mode.
- result.aLoss = 7;
- result.bytesPerPixel = 2;
- result.rLoss = result.gLoss = result.bLoss = 3;
- result.bShift = 0;
- result.gShift = result.bShift + result.bBits();
- result.rShift = result.gShift + result.gBits();
- result.aShift = result.rShift + result.rBits();
- //HACK: there should be a clean way to handle setting
- //up the color order without prematurely returning
- return result;
- case Graphics::kFormatRGBA4444:
- result.bytesPerPixel = 2;
- result.aLoss = result.gLoss = result.rLoss = result.bLoss = 4;
- break;
- case Graphics::kFormatRGB888:
- result.bytesPerPixel = 3;
- result.aLoss = 8;
- result.gLoss = result.rLoss = result.bLoss = 0;
- break;
- case Graphics::kFormatRGBA6666:
- result.bytesPerPixel = 3;
- result.aLoss = result.gLoss = result.rLoss = result.bLoss = 2;
- break;
- case Graphics::kFormatRGBA8888:
- result.bytesPerPixel = 4;
- result.aLoss = result.gLoss = result.rLoss = result.bLoss = 0;
- break;
- case Graphics::kFormatCLUT8:
- default:
- result.bytesPerPixel = 1;
- result.rShift = result.gShift = result.bShift = result.aShift = 0;
- result.rLoss = result.gLoss = result.bLoss = result.aLoss = 8;
- return result;
- }
-
- result.aShift = 0;
- result.bShift = result.aBits();
- result.gShift = result.bShift + result.bBits();
- result.rShift = result.gShift + result.gBits();
- return result;
-}
#endif
void OSystem_SDL::initSize(uint w, uint h) {
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 5bcd91d566..81b5fcc3eb 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,8 +197,8 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_16BIT
- _screenFormat(getPixelFormat(Graphics::kFormatCLUT8)),
- _cursorBitDepth(8),
+ _screenFormat(Graphics::kFormatCLUT8),
+ _cursorFormat(Graphics::kFormatCLUT8),
#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index a25f697c80..b36139f24b 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -82,19 +82,12 @@ public:
TransactionError endGFXTransaction(void);
#ifdef ENABLE_16BIT
- // Find a compatible format from the list of formats supported by the engine
- // Fallback to CLUT8 if none found
- virtual Graphics::ColorMode findCompatibleFormat(Common::List formatList);
-
// Set the depth and format of the video bitmap
// Typically, CLUT8
virtual void initFormat(Graphics::PixelFormat format);
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
-
- //Create a Graphics::PixelFormat to describe the requested color mode
- virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorMode format);
#endif
// Set the size of the video bitmap.
@@ -379,9 +372,6 @@ protected:
MousePos _mouseCurState;
byte _mouseKeyColor;
int _cursorTargetScale;
-#ifdef ENABLE_16BIT
- uint8 _cursorBitDepth;
-#endif
bool _cursorPaletteDisabled;
SDL_Surface *_mouseOrigSurface;
SDL_Surface *_mouseSurface;
diff --git a/base/main.cpp b/base/main.cpp
index ab97af10be..5c1ca7dc20 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -227,7 +227,7 @@ static void setupGraphics(OSystem &system) {
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
#ifdef ENABLE_16BIT
- system.initFormat(system.getPixelFormat(Graphics::kFormatCLUT8));
+ system.initFormat(Graphics::kFormatCLUT8);
#endif
system.initSize(320, 200);
diff --git a/common/error.h b/common/error.h
index 23305a5c2e..8959a6ae23 100644
--- a/common/error.h
+++ b/common/error.h
@@ -48,6 +48,9 @@ enum Error {
kInvalidPathError, //!< Engine initialization: Invalid game path was passed
kNoGameDataFoundError, //!< Engine initialization: No game data was found in the specified location
kUnsupportedGameidError, //!< Engine initialization: Gameid not supported by this (Meta)Engine
+#ifdef ENABLE_16BIT
+ kUnsupportedColorMode, //!< Engine initialization: Engine does not support backend's color mode
+#endif
kReadPermissionDenied, //!< Unable to read data due to missing read permission
diff --git a/common/system.h b/common/system.h
index 4e282d1f31..81b86820df 100644
--- a/common/system.h
+++ b/common/system.h
@@ -344,23 +344,6 @@ public:
virtual int getGraphicsMode() const = 0;
#ifdef ENABLE_16BIT
- /**
- * Find a supported color format from a list of requested formats. Typical formats include:
- * CLUT8 (e.g. 256 color, for most games), all backends must provide support for this format
- * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
- * RGB565 (e.g. 16-bit color, for Urban Runner)
- *
- * These are the pixel formats for which the client code can generates data;
- * they are not necessarily equal to the hardware pixel format. For example,
- * a backend may perform color lookup of 8-bit graphics before pushing the
- * screen buffer to hardware, or perform transformations of the ARGB color order.
- *
- * @param formatList A list of requested pixel formats, ordered by priority
- *
- * @return a supported ColorMode from the list, or kFormatCLUT8 if no supported format was found
- */
- virtual Graphics::ColorMode findCompatibleFormat(Common::List formatList) = 0;
-
/**
* Set the color format of the virtual screen. Typical formats include:
* CLUT8 (e.g. 256 color, for most games)
@@ -381,13 +364,6 @@ public:
* @see Graphics::PixelFormat
*/
virtual Graphics::PixelFormat getScreenFormat() const = 0;
-
- /**
- * Returns the pixel format description of the requested color mode
- * @see Graphics::PixelFormat
- */
- virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorMode format) = 0;
-
#endif
/**
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 7ddc286b0f..213f69e7b1 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -126,20 +126,17 @@ void initCommonGFX(bool defaultTo1XScaler) {
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
#ifdef ENABLE_16BIT
- Common::List formatList;
- formatList.push_back(Graphics::kFormatCLUT8);
- initGraphics(width,height,defaultTo1xScaler, formatList);
+ Graphics::PixelFormat format = Graphics::kFormatCLUT8;
+ initGraphics(width,height,defaultTo1xScaler, format);
}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList) {
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
#endif
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
#ifdef ENABLE_16BIT
- Graphics::ColorMode format = g_system->findCompatibleFormat(formatList);
- debug("%X",format); //TODO: set up the pixelFormat here
- g_system->initFormat(g_system->getPixelFormat(format));
+ g_system->initFormat(format);
#endif
g_system->initSize(width, height);
@@ -161,16 +158,16 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList);
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format);
#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0ebf832a37..5fec6ec835 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,11 +1085,10 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
#ifdef ENABLE_16BIT
} else if (_game.features & GF_16BIT_COLOR) {
- int format = Graphics::kFormatRGB555;
- Common::List formatList;
- formatList.push_back((Graphics::ColorMode) format);
- formatList.push_back(Graphics::kFormatCLUT8);
- initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList);
+ Graphics::PixelFormat format = Graphics::kFormatRGB555;
+ initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
+ if (format != _system->getScreenFormat())
+ return Common::kUnsupportedColorMode;
#endif
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index fa5925b1f9..ef856e8735 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -76,6 +76,116 @@ struct PixelFormat {
byte rLoss, gLoss, bLoss, aLoss; /**< Precision loss of each color component. */
byte rShift, gShift, bShift, aShift; /**< Binary left shift of each color component in the pixel value. */
+#ifdef ENABLE_16BIT
+ inline PixelFormat() {
+ bytesPerPixel =
+ rLoss = gLoss = bLoss = aLoss =
+ rShift = gShift = bShift = aShift = 0;
+ }
+
+ inline PixelFormat(int BytesPerPixel,
+ int RLoss, int GLoss, int BLoss, int ALoss,
+ int RShift, int GShift, int BShift, int AShift) {
+ bytesPerPixel = BytesPerPixel;
+ rLoss = RLoss, gLoss = GLoss, bLoss = BLoss, aLoss = ALoss;
+ rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
+ }
+
+ //Copy constructor
+ //Is this necessary?
+ inline PixelFormat(const PixelFormat &format) {
+ bytesPerPixel = format.bytesPerPixel;
+
+ rLoss = format.rLoss;
+ gLoss = format.gLoss;
+ bLoss = format.bLoss;
+ aLoss = format.aLoss;
+
+ rShift = format.rShift;
+ gShift = format.gShift;
+ bShift = format.bShift;
+ aShift = format.aShift;
+ }
+
+ //Convenience constructor from bitformat number
+ //TODO: BGR support
+ //TODO: Specify alpha position
+/* PixelFormat(int bitFormat) {
+ bytesPerPixel = ColorMasks::kBytesPerPixel;
+
+ rLoss = 8 - ColorMasks::kRedBits;
+ gLoss = 8 - ColorMasks::kGreenBits;
+ bLoss = 8 - ColorMasks::kBlueBits;
+ aLoss = 8 - ColorMasks::kAlphaBits;
+
+ rShift = ColorMasks::kRedShift;
+ gShift = ColorMasks::kGreenShift;
+ bShift = ColorMasks::kBlueShift;
+ aShift = ColorMasks::kAlphaShift;
+ };*/
+
+ //Convenience constructor from enum type
+ //TODO: BGR support
+ //TODO: Specify alpha position
+ inline PixelFormat(ColorMode mode) {
+ switch (mode) {
+ case kFormatRGB555:
+ aLoss = 8;
+ bytesPerPixel = 2;
+ rLoss = gLoss = bLoss = 3;
+ break;
+ case kFormatXRGB1555:
+ //Special case, alpha bit is always high in this mode.
+ aLoss = 7;
+ bytesPerPixel = 2;
+ rLoss = gLoss = bLoss = 3;
+ bShift = 0;
+ gShift = bShift + bBits();
+ rShift = gShift + gBits();
+ aShift = rShift + rBits();
+ //FIXME: there should be a clean way to handle setting
+ //up the color order without prematurely returning.
+ //This will probably be handled when alpha position specification is possible
+ return;
+ case kFormatRGB565:
+ bytesPerPixel = 2;
+ aLoss = 8;
+ gLoss = 2;
+ rLoss = bLoss = 3;
+ break;
+ case kFormatRGBA4444:
+ bytesPerPixel = 2;
+ aLoss = gLoss = rLoss = bLoss = 4;
+ break;
+ case kFormatRGB888:
+ bytesPerPixel = 3;
+ aLoss = 8;
+ gLoss = rLoss = bLoss = 0;
+ break;
+ case kFormatRGBA6666:
+ bytesPerPixel = 3;
+ aLoss = gLoss = rLoss = bLoss = 2;
+ break;
+ case kFormatRGBA8888:
+ bytesPerPixel = 4;
+ aLoss = gLoss = rLoss = bLoss = 0;
+ break;
+ case kFormatCLUT8:
+ default:
+ bytesPerPixel = 1;
+ rShift = gShift = bShift = aShift = 0;
+ rLoss = gLoss = bLoss = aLoss = 8;
+ return;
+ }
+
+ aShift = 0;
+ bShift = aBits();
+ gShift = bShift + bBits();
+ rShift = gShift + gBits();
+ return;
+ }
+#endif
+
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
return 0 == memcmp(this, &fmt, sizeof(PixelFormat));
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index 11767848ed..3a2643ff91 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -30,17 +30,31 @@
int gBitFormat = 565;
+#ifdef ENABLE_16BIT
+static const Graphics::PixelFormat gPixelFormat555(
+#else
static const Graphics::PixelFormat gPixelFormat555 = {
+#endif
2,
3, 3, 3, 8,
10, 5, 0, 0
+#ifdef ENABLE_16BIT
+ );
+
+static const Graphics::PixelFormat gPixelFormat565(
+#else
};
static const Graphics::PixelFormat gPixelFormat565 = {
+#endif
2,
3, 2, 3, 8,
11, 5, 0, 0
+#ifdef ENABLE_16BIT
+ );
+#else
};
+#endif
--
cgit v1.2.3
From c97bfd16f94873a437cb92a30ebd11879f114e0c Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Mon, 15 Jun 2009 10:10:22 +0000
Subject: made Graphics::PixelFormat(ColorMode) constructor explicit, removed
Graphics::PixelFormat(int bitFormat) constructor that was never really
implemented anyway
svn-id: r41540
---
base/main.cpp | 2 +-
engines/engine.cpp | 2 +-
engines/scumm/scumm.cpp | 2 +-
graphics/pixelformat.h | 35 +----------------------------------
4 files changed, 4 insertions(+), 37 deletions(-)
diff --git a/base/main.cpp b/base/main.cpp
index 5c1ca7dc20..6f3bacebb7 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -227,7 +227,7 @@ static void setupGraphics(OSystem &system) {
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
#ifdef ENABLE_16BIT
- system.initFormat(Graphics::kFormatCLUT8);
+ system.initFormat(Graphics::PixelFormat(Graphics::kFormatCLUT8));
#endif
system.initSize(320, 200);
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 213f69e7b1..77ce7c44ad 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -126,7 +126,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
#ifdef ENABLE_16BIT
- Graphics::PixelFormat format = Graphics::kFormatCLUT8;
+ Graphics::PixelFormat format(Graphics::kFormatCLUT8);
initGraphics(width,height,defaultTo1xScaler, format);
}
void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 5fec6ec835..9469a15e54 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,7 +1085,7 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
#ifdef ENABLE_16BIT
} else if (_game.features & GF_16BIT_COLOR) {
- Graphics::PixelFormat format = Graphics::kFormatRGB555;
+ Graphics::PixelFormat format(Graphics::kFormatRGB555);
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index ef856e8735..b08321efd7 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -91,43 +91,10 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
- //Copy constructor
- //Is this necessary?
- inline PixelFormat(const PixelFormat &format) {
- bytesPerPixel = format.bytesPerPixel;
-
- rLoss = format.rLoss;
- gLoss = format.gLoss;
- bLoss = format.bLoss;
- aLoss = format.aLoss;
-
- rShift = format.rShift;
- gShift = format.gShift;
- bShift = format.bShift;
- aShift = format.aShift;
- }
-
- //Convenience constructor from bitformat number
- //TODO: BGR support
- //TODO: Specify alpha position
-/* PixelFormat(int bitFormat) {
- bytesPerPixel = ColorMasks::kBytesPerPixel;
-
- rLoss = 8 - ColorMasks::kRedBits;
- gLoss = 8 - ColorMasks::kGreenBits;
- bLoss = 8 - ColorMasks::kBlueBits;
- aLoss = 8 - ColorMasks::kAlphaBits;
-
- rShift = ColorMasks::kRedShift;
- gShift = ColorMasks::kGreenShift;
- bShift = ColorMasks::kBlueShift;
- aShift = ColorMasks::kAlphaShift;
- };*/
-
//Convenience constructor from enum type
//TODO: BGR support
//TODO: Specify alpha position
- inline PixelFormat(ColorMode mode) {
+ explicit inline PixelFormat(ColorMode mode) {
switch (mode) {
case kFormatRGB555:
aLoss = 8;
--
cgit v1.2.3
From 5d61784dae5dace556d15e1603d86d565d66cb31 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Mon, 15 Jun 2009 11:35:51 +0000
Subject: Remove uglyness with PixelFormat initialization.
svn-id: r41541
---
graphics/pixelformat.h | 2 +-
graphics/scaler.cpp | 15 ---------------
2 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index b08321efd7..400385c93a 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -76,7 +76,6 @@ struct PixelFormat {
byte rLoss, gLoss, bLoss, aLoss; /**< Precision loss of each color component. */
byte rShift, gShift, bShift, aShift; /**< Binary left shift of each color component in the pixel value. */
-#ifdef ENABLE_16BIT
inline PixelFormat() {
bytesPerPixel =
rLoss = gLoss = bLoss = aLoss =
@@ -91,6 +90,7 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
+#ifdef ENABLE_16BIT
//Convenience constructor from enum type
//TODO: BGR support
//TODO: Specify alpha position
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index 3a2643ff91..082258bfc0 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -30,32 +30,17 @@
int gBitFormat = 565;
-#ifdef ENABLE_16BIT
static const Graphics::PixelFormat gPixelFormat555(
-#else
-static const Graphics::PixelFormat gPixelFormat555 = {
-#endif
2,
3, 3, 3, 8,
10, 5, 0, 0
-#ifdef ENABLE_16BIT
);
static const Graphics::PixelFormat gPixelFormat565(
-#else
- };
-
-static const Graphics::PixelFormat gPixelFormat565 = {
-#endif
2,
3, 2, 3, 8,
11, 5, 0, 0
-#ifdef ENABLE_16BIT
);
-#else
- };
-#endif
-
#ifndef DISABLE_HQ_SCALERS
--
cgit v1.2.3
From dcc5e26cab7ea7f24cfe3ac972355e2789aa67d9 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Mon, 15 Jun 2009 11:37:07 +0000
Subject: Fix compilation
svn-id: r41542
---
engines/cine/pal.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index f59dee53df..fd0ea8587b 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -36,7 +36,8 @@ namespace Cine {
#define kLowPalNumBytes ((kLowPalNumColors) * (kLowPalBytesPerColor))
/*! \brief Low resolution (9-bit) color format used in Cine's 16-color modes. */
-static const Graphics::PixelFormat kLowPalFormat = {kLowPalBytesPerColor, 5, 5, 5, 8, 8, 4, 0, 0};
+ static const Graphics::PixelFormat kLowPalFormat(kLowPalBytesPerColor, 5, 5, 5, 8, 8, 4, 0, 0);
+
// Constants related to kHighPalFormat
#define kHighPalBytesPerColor 3
@@ -44,10 +45,10 @@ static const Graphics::PixelFormat kLowPalFormat = {kLowPalBytesPerColor, 5, 5,
#define kHighPalNumBytes ((kHighPalNumColors) * (kHighPalBytesPerColor))
/*! \brief High resolution (24-bit) color format used in Cine's 256-color modes. */
-static const Graphics::PixelFormat kHighPalFormat = {kHighPalBytesPerColor, 0, 0, 0, 8, 0, 8, 16, 0};
+static const Graphics::PixelFormat kHighPalFormat(kHighPalBytesPerColor, 0, 0, 0, 8, 0, 8, 16, 0);
/*! \brief The color format used by OSystem's setPalette-function. */
-static const Graphics::PixelFormat kSystemPalFormat = {4, 0, 0, 0, 8, 0, 8, 16, 0};
+static const Graphics::PixelFormat kSystemPalFormat(4, 0, 0, 0, 8, 0, 8, 16, 0);
/*! \brief Endian types. Used at least by Palette class's load and save functions.
* TODO: Move somewhere more general as this is definitely not Cine-engine specific
--
cgit v1.2.3
From 0ca17a7f8c79940873a4dc82537310584f03e439 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Mon, 15 Jun 2009 11:46:28 +0000
Subject: Fix compilation when 16BIT code is disabled.
svn-id: r41543
---
backends/platform/sdl/graphics.cpp | 2 ++
graphics/cursorman.h | 16 ++++++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index f550621a28..2cee0ea83d 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -155,6 +155,8 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
#ifdef ENABLE_16BIT
if (_transactionDetails.sizeChanged || _transactionDetails.formatChanged) {
+#else
+ if (_transactionDetails.sizeChanged) {
#endif
unloadGFXMode();
if (!loadGFXMode()) {
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 834d0d2b02..08da3ac802 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -60,11 +60,11 @@ public:
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
-//#ifdef ENABLE_16BIT
+#ifdef ENABLE_16BIT
void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
-//#else
-// void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-//#endif
+#else
+ void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
+#endif
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -85,11 +85,11 @@ public:
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
*/
-//#ifdef ENABLE_16BIT
+#ifdef ENABLE_16BIT
void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
-//#else
-// void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-//#endif
+#else
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
+#endif
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
--
cgit v1.2.3
From e74ba9af6b95c70cdcdbcf700e0964bf0be0fca1 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Mon, 15 Jun 2009 13:23:26 +0000
Subject: Add error if user attempt to play HE games using 16bit color, when
16bit support is disabled.
svn-id: r41544
---
engines/scumm/scumm.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9469a15e54..98da55d428 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1083,12 +1083,14 @@ Common::Error ScummEngine::init() {
// CJK FT and DIG use usual NUT fonts, not FM-TOWNS ROM, so
// there is no text surface for them. This takes that into account
(_screenWidth * _textSurfaceMultiplier > 320));
-#ifdef ENABLE_16BIT
} else if (_game.features & GF_16BIT_COLOR) {
+#ifdef ENABLE_16BIT
Graphics::PixelFormat format(Graphics::kFormatRGB555);
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
+#else
+ error("16bit color support is required for this game");
#endif
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
--
cgit v1.2.3
From 3d9d542908323c3d0ce545589e5532175eda9063 Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Mon, 15 Jun 2009 13:50:41 +0000
Subject: Fix compilation of SCI engine
svn-id: r41546
---
engines/sci/gfx/gfx_driver.cpp | 2 +-
engines/sci/gfx/res_pic.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index 961eecc6fd..42be711499 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -36,7 +36,7 @@ namespace Sci {
GfxDriver::GfxDriver(int xfact, int yfact, int bytespp) {
int i;
- Graphics::PixelFormat format = { bytespp, 0, 0, 0, 0, 0, 0, 0, 0 };
+ Graphics::PixelFormat format(bytespp, 0, 0, 0, 0, 0, 0, 0, 0);
_mode = gfx_new_mode(xfact, yfact, format, new Palette(256), 0);
_mode->xsize = xfact * 320;
_mode->ysize = yfact * 200;
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index 9279de20f4..bb9e8a75a7 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -1548,7 +1548,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
view->index_height = CLIP(view->index_height, 0, portBounds.height());
// Set up mode structure for resizing the view
- Graphics::PixelFormat format = { 1, 0, 0, 0, 0, 0, 0, 0, 0 }; // 1byte/p, which handles masks and the rest for us
+ Graphics::PixelFormat format(1, 0, 0, 0, 0, 0, 0, 0, 0); // 1byte/p, which handles masks and the rest for us
gfx_mode_t *mode = gfx_new_mode(pic->visual_map->index_width / 320,
pic->visual_map->index_height / 200, format, view->palette, 0);
@@ -1654,7 +1654,7 @@ void gfxr_draw_pic11(gfxr_pic_t *pic, int flags, int default_palette, int size,
view->palette = pic->visual_map->palette->getref();
// Set up mode structure for resizing the view
- Graphics::PixelFormat format = { 1, 0, 0, 0, 0, 0, 0, 0, 0 }; // 1 byte/p, which handles masks and the rest for us
+ Graphics::PixelFormat format(1, 0, 0, 0, 0, 0, 0, 0, 0); // 1 byte/p, which handles masks and the rest for us
gfx_mode_t *mode = gfx_new_mode(pic->visual_map->index_width / 320, pic->visual_map->index_height / 200, format, view->palette, 0);
gfx_xlate_pixmap(view, mode, GFX_XLATE_FILTER_NONE);
--
cgit v1.2.3
From fb96e826f27b071d6696731f43cb5fa0d8760205 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 16 Jun 2009 05:33:11 +0000
Subject: Simplified cursor related 16-bit code.
svn-id: r41577
---
backends/platform/sdl/graphics.cpp | 4 ++--
graphics/cursorman.cpp | 14 +-------------
graphics/cursorman.h | 18 +++---------------
3 files changed, 6 insertions(+), 30 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 2cee0ea83d..f4269b55b2 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1379,11 +1379,11 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
}
-#ifdef ENABLE_16BIT
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
+#ifdef ENABLE_16BIT
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
+ keycolor &= 0xFF;
#endif
if (w == 0 || h == 0)
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index e5a86b6bd8..6446216867 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -57,11 +57,7 @@ bool CursorManager::showMouse(bool visible) {
return g_system->showMouse(visible);
}
-#ifdef ENABLE_16BIT
void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
-#else
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
-#endif
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
cur->_visible = isVisible();
@@ -111,11 +107,7 @@ void CursorManager::popAllCursors() {
g_system->showMouse(isVisible());
}
-#ifdef ENABLE_16BIT
void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
-#else
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
-#endif
if (_cursorStack.empty()) {
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
@@ -125,11 +117,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_16BIT
- uint size;
- { //limit the lifespan of the format variable to minimize memory impact
- Graphics::PixelFormat f = g_system->getScreenFormat();
- size = w * h * (f.bytesPerPixel);
- }
+ uint size = w * h * g_system->getScreenFormat().bytesPerPixel;
#else
uint size = w * h;
#endif
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 08da3ac802..32f1b90f3e 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -60,11 +60,7 @@ public:
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
-#ifdef ENABLE_16BIT
void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
-#else
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-#endif
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -85,11 +81,7 @@ public:
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
*/
-#ifdef ENABLE_16BIT
void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
-#else
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-#endif
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -178,26 +170,22 @@ private:
uint _height;
int _hotspotX;
int _hotspotY;
-//#ifdef ENABLE_16BIT
uint32 _keycolor;
-//#else
-// byte _keycolor;
-//#endif
+
byte _targetScale;
uint _size;
-#ifdef ENABLE_16BIT
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8) {
+#ifdef ENABLE_16BIT
{ //limit the lifespan of the format value to minimize impact on memory usage
Graphics::PixelFormat f = g_system->getScreenFormat();
_size = w * h * f.bytesPerPixel;
_keycolor = keycolor & ((1 << (f.bytesPerPixel << 3)) - 1);
}
#else
- Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1) {
_size = w * h;
- _keycolor = keycolor;
+ _keycolor = keycolor & 0xFF;
#endif
_data = new byte[_size];
if (data && _data)
--
cgit v1.2.3
From d3283f86fcd6c1a636bf769a3deb5d3afa561b01 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 16 Jun 2009 05:34:12 +0000
Subject: Simplified colormode enum
svn-id: r41578
---
graphics/pixelformat.h | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 400385c93a..cc769be46a 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -45,14 +45,17 @@ namespace Graphics {
*/
enum ColorMode {
kFormatCLUT8 = 0, //256 color palette.
+#ifdef ENABLE_16BIT
kFormatRGB555 = 1,
kFormatXRGB1555 = 2, // Special case, high bit has special purpose, which may be alpha.
// Engines should probably handle this bit internally and pass RGB only, though
kFormatRGB565 = 3,
kFormatRGBA4444 = 4, // since this mode is commonly supported in game hardware, some unimplemented engines may use it?
+#endif
+#ifdef ENABLE_32BIT
kFormatRGB888 = 5,
- kFormatRGBA6666 = 6, // I've never heard of this, but it's vaguely plausible
- kFormatRGBA8888 = 7
+ kFormatRGBA8888 = 6
+#endif
};
#endif
@@ -96,6 +99,7 @@ struct PixelFormat {
//TODO: Specify alpha position
explicit inline PixelFormat(ColorMode mode) {
switch (mode) {
+#ifdef ENABLE_16BIT
case kFormatRGB555:
aLoss = 8;
bytesPerPixel = 2;
@@ -124,19 +128,18 @@ struct PixelFormat {
bytesPerPixel = 2;
aLoss = gLoss = rLoss = bLoss = 4;
break;
+#endif
+#ifdef ENABLE_32BIT
case kFormatRGB888:
bytesPerPixel = 3;
aLoss = 8;
gLoss = rLoss = bLoss = 0;
break;
- case kFormatRGBA6666:
- bytesPerPixel = 3;
- aLoss = gLoss = rLoss = bLoss = 2;
- break;
case kFormatRGBA8888:
bytesPerPixel = 4;
aLoss = gLoss = rLoss = bLoss = 0;
break;
+#endif
case kFormatCLUT8:
default:
bytesPerPixel = 1;
--
cgit v1.2.3
From cb56169a2770c25ce27256db339353011158998f Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 16 Jun 2009 09:04:37 +0000
Subject: Declared getBestFormat in OSystem base class, and implemented in SDL
backend.
svn-id: r41580
---
backends/platform/sdl/sdl.h | 12 ++++++++++++
common/system.h | 8 +++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index b36139f24b..b788022d57 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -88,6 +88,18 @@ public:
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
+
+ // Highest supported
+ virtual Graphics::PixelFormat getBestFormat() const {
+ //TODO scale down 16/32 bit based on hardware support
+#ifdef ENABLE_32BIT
+ return Graphics::PixelFormat(Graphics::kFormatRGBA8888);
+#elif defined ENABLE_16BIT
+ return Graphics::PixelFormat(Graphics::kFormatRGB565);
+#else
+ return Graphics::PixelFormat(Graphics::kFormatCLUT8);
+#endif
+ }
#endif
// Set the size of the video bitmap.
diff --git a/common/system.h b/common/system.h
index 81b86820df..b6e78474ca 100644
--- a/common/system.h
+++ b/common/system.h
@@ -360,10 +360,16 @@ public:
virtual void initFormat(Graphics::PixelFormat format) = 0;
/**
- * Returns the pixel format description of the screen.
+ * Returns the pixel format of the screen.
* @see Graphics::PixelFormat
*/
virtual Graphics::PixelFormat getScreenFormat() const = 0;
+
+ /**
+ * Returns the highest color pixel format supported by the backend
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getBestFormat() const = 0;
#endif
/**
--
cgit v1.2.3
From db9cfc6f962790a270b357c3d47a5dc0e15a37b0 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 16 Jun 2009 09:15:06 +0000
Subject: Corrected oversight in earlier ifdef simplification which leads to
compilation failure if ENABLE_16BIT is not defined.
svn-id: r41581
---
backends/platform/sdl/sdl.h | 4 +---
common/system.h | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index b788022d57..074a55069d 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -133,11 +133,9 @@ public:
virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)
// Set the bitmap that's used when drawing the cursor.
-#ifdef ENABLE_16BIT
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
+#ifdef ENABLE_16BIT
virtual void setCursorFormat(Graphics::PixelFormat format);
-#else
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
#endif
// Set colors of cursor palette
diff --git a/common/system.h b/common/system.h
index b6e78474ca..7df4a124e3 100644
--- a/common/system.h
+++ b/common/system.h
@@ -719,11 +719,9 @@ public:
* @param keycolor transparency color index
* @param cursorTargetScale scale factor which cursor is designed for
*/
-#ifdef ENABLE_16BIT
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1) = 0;
+#ifdef ENABLE_16BIT
virtual void setCursorFormat(Graphics::PixelFormat format) = 0;
-#else
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1) = 0;
#endif
--
cgit v1.2.3
From 78eed8b7c4c155c709ec17a73043c4d5ce597bc3 Mon Sep 17 00:00:00 2001
From: Torbjörn Andersson
Date: Tue, 16 Jun 2009 17:52:32 +0000
Subject: Fixed warning. (GCC doesn't like commas at the end of an enum list.)
svn-id: r41586
---
graphics/pixelformat.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index cc769be46a..37fca07b48 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -44,7 +44,6 @@ namespace Graphics {
* to get the applicable color order.
*/
enum ColorMode {
- kFormatCLUT8 = 0, //256 color palette.
#ifdef ENABLE_16BIT
kFormatRGB555 = 1,
kFormatXRGB1555 = 2, // Special case, high bit has special purpose, which may be alpha.
@@ -54,8 +53,9 @@ enum ColorMode {
#endif
#ifdef ENABLE_32BIT
kFormatRGB888 = 5,
- kFormatRGBA8888 = 6
+ kFormatRGBA8888 = 6,
#endif
+ kFormatCLUT8 = 0 //256 color palette.
};
#endif
--
cgit v1.2.3
From f55419ee451070dbe07014bc7d747507e431edf6 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 17 Jun 2009 10:03:59 +0000
Subject: OSystem_SDL::GetBestFormat will no longer return modes greater than
that which hardware supports.
svn-id: r41606
---
backends/platform/sdl/sdl.h | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 074a55069d..598b943e4b 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -92,13 +92,26 @@ public:
// Highest supported
virtual Graphics::PixelFormat getBestFormat() const {
//TODO scale down 16/32 bit based on hardware support
-#ifdef ENABLE_32BIT
- return Graphics::PixelFormat(Graphics::kFormatRGBA8888);
-#elif defined ENABLE_16BIT
- return Graphics::PixelFormat(Graphics::kFormatRGB565);
-#else
+#if (defined ENABLE_32BIT) || (defined ENABLE_16BIT)
+ {
+ SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt;
+#ifdef ENABLE_32BIT
+ if (HWFormat->BitsPerPixel > 32)
+ return Graphics::PixelFormat(Graphics::kFormatRGBA8888);
+ return Graphics::PixelFormat(HWFormat->BytesPerPixel,
+ HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss,
+ HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift);
+#else //16
+ if (HWFormat->BitsPerPixel > 16)
+ return Graphics::PixelFormat(Graphics::kFormatRGB565);
+ return Graphics::PixelFormat(HWFormat->BytesPerPixel,
+ HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss,
+ HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift);
+ }
+#endif //ENABLE_32BIT
+#else //8BIT only
return Graphics::PixelFormat(Graphics::kFormatCLUT8);
-#endif
+#endif //ENABLE_32BIT or ENABLE_16BIT
}
#endif
--
cgit v1.2.3
From a9755e25475f55c8831c901396ffa78b6f86d971 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 17 Jun 2009 10:11:47 +0000
Subject: Added ENABLE_16BIT to preprocessor defines in gob's msvc8 vcproj.
Fixed preprocessor define list formating in msvc8 scumm.vcproj and
scummvm.vcproj (mainly so that my tortoiseSVN will no longer mark them as
modified)
svn-id: r41607
---
dists/msvc8/gob.vcproj | 36 ++++++++++++++++++------------------
dists/msvc8/scumm.vcproj | 2 +-
dists/msvc8/scummvm.vcproj | 2 +-
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/dists/msvc8/gob.vcproj b/dists/msvc8/gob.vcproj
index 189527b87c..9016140453 100644
--- a/dists/msvc8/gob.vcproj
+++ b/dists/msvc8/gob.vcproj
@@ -1,7 +1,7 @@
version) {
+ case kGroovieV2:
+#ifdef ENABLE_16BIT
+ _pixelFormat = _system->getBestFormat();
+ initGraphics(640, 480, true, _pixelFormat);
+ break;
+#endif
+ case kGroovieT7G:
+ initGraphics(640, 480, true);
+ break;
+ }
// Create debugger. It requires GFX to be initialized
_debugger = new Debugger(this);
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index a137193adf..adc6986a87 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -85,6 +85,9 @@ protected:
public:
void waitForInput();
+#ifdef ENABLE_16BIT
+ Graphics::PixelFormat _pixelFormat;
+#endif
Script _script;
ResMan *_resMan;
GrvCursorMan *_grvCursorMan;
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 28d0d23fc1..95acb64f6a 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -29,6 +29,10 @@
#include "groovie/groovie.h"
#include "groovie/roq.h"
+#ifdef ENABLE_16BIT
+// Required for the YUV to RGB conversion
+#include "graphics/dither.h"
+#endif
#include "sound/mixer.h"
namespace Groovie {
@@ -43,6 +47,7 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
_currBuf = new Graphics::Surface();
_prevBuf = new Graphics::Surface();
+#ifndef ENABLE_16BIT
byte pal[256 * 4];
#ifdef DITHER
byte pal3[256 * 3];
@@ -77,16 +82,17 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
pal[(i * 4) + 1] = pal3[(i * 3) + 1];
pal[(i * 4) + 2] = pal3[(i * 3) + 2];
}
-#else
+#else // !DITHER
// Set a grayscale palette
for (int i = 0; i < 256; i++) {
pal[(i * 4) + 0] = i;
pal[(i * 4) + 1] = i;
pal[(i * 4) + 2] = i;
}
-#endif
+#endif // DITHER
_syst->setPalette(pal, 0, 256);
+#endif // !ENABLE_16BIT
}
ROQPlayer::~ROQPlayer() {
@@ -154,13 +160,26 @@ void ROQPlayer::buildShowBuf() {
byte *out = (byte *)_showBuf.getBasePtr(0, line);
byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _showBuf.w; x++) {
+#ifdef ENABLE_16BIT
+ // Do the format conversion (YUV -> RGB -> Screen format)
+ byte r, g, b;
+ Graphics::PaletteLUT::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
+ // FIXME: this is fixed to 16bit
+ *(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
+
+ // Skip to the next pixel
+ out += _vm->_pixelFormat.bytesPerPixel;
+#else // !ENABLE_16BIT
#ifdef DITHER
*out = _dither->dither(*in, *(in + 1), *(in + 2), x);
#else
// Just use the luminancy component
*out = *in;
-#endif
+#endif // DITHER
+ // Skip to the next pixel
out++;
+#endif // ENABLE_16BIT
+
if (!(x % _scaleX))
in += _prevBuf->bytesPerPixel;
}
@@ -189,7 +208,7 @@ bool ROQPlayer::playFrameInternal() {
if (_dirty) {
// Update the screen
- _syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.w, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.pitch, _showBuf.h);
+ _syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.pitch, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.w, _showBuf.h);
_syst->updateScreen();
// Clear the dirty flag
@@ -316,7 +335,23 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
// Allocate new buffers
_currBuf->create(width, height, 3);
_prevBuf->create(width, height, 3);
+#ifdef ENABLE_16BIT
+ _showBuf.create(width * _scaleX, height * _scaleY, _vm->_pixelFormat.bytesPerPixel);
+#else
_showBuf.create(width * _scaleX, height * _scaleY, 1);
+#endif
+
+ // Clear the buffers with black YUV values
+ byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0);
+ byte *ptr2 = (byte *)_prevBuf->getBasePtr(0, 0);
+ for (int i = 0; i < width * height; i++) {
+ *ptr1++ = 0;
+ *ptr1++ = 128;
+ *ptr1++ = 128;
+ *ptr2++ = 0;
+ *ptr2++ = 128;
+ *ptr2++ = 128;
+ }
#ifdef DITHER
// Reset the dithering algorithm with the new width
@@ -456,7 +491,15 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block");
warning("Groovie::ROQ: JPEG frame (unimplemented)");
- memset(_prevBuf->getBasePtr(0, 0), 0, _prevBuf->w * _prevBuf->h * _prevBuf->bytesPerPixel);
+
+ // HACK: Initialize to a black frame
+ //memset(_prevBuf->getBasePtr(0, 0), 0, _prevBuf->w * _prevBuf->h * _prevBuf->bytesPerPixel);
+ byte *ptr = (byte *)_prevBuf->getBasePtr(0, 0);
+ for (int i = 0; i < _prevBuf->w * _prevBuf->h; i++) {
+ *ptr++ = 0;
+ *ptr++ = 128;
+ *ptr++ = 128;
+ }
_file->skip(blockHeader.size);
return true;
--
cgit v1.2.3
From 68cb22d4a95060bcba9b5a44508bc4ab57cb47ed Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 18 Jun 2009 01:13:42 +0000
Subject: Fix regression, caused by typo in my last commit.
svn-id: r41621
---
engines/scumm/he/wiz_he.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index deaf7aaf72..b2e367719e 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1152,10 +1152,8 @@ static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common
if (dst) {
src += rCapt.top * srcPitch + rCapt.left * 2;
while (h--) {
- for (int i = 0; i < w; i++) {
- uint16 col = READ_UINT16(src + w * 2);
- WRITE_LE_UINT16(dst + w * 2, col);
- }
+ for (int i = 0; i < w; i++)
+ WRITE_LE_UINT16(dst + i * 2, READ_UINT16(src + i * 2));
dst += w * 2;
src += srcPitch;
}
--
cgit v1.2.3
From b8a9823f4e868a98ae85862eb457b6d4e7cffe1c Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 18 Jun 2009 06:10:13 +0000
Subject: Fix regression in scrolling rooms.
svn-id: r41624
---
engines/scumm/gfx.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index c0f2c2c083..0910d9bc59 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -155,11 +155,11 @@ struct VirtScreen : Graphics::Surface {
}
byte *getPixels(int x, int y) const {
- return (byte *)pixels + y * pitch + (xstart * 2 + x) * bytesPerPixel;
+ return (byte *)pixels + y * pitch + (xstart + x) * bytesPerPixel;
}
byte *getBackPixels(int x, int y) const {
- return (byte *)backBuf + y * pitch + (xstart * 2 + x) * bytesPerPixel;
+ return (byte *)backBuf + y * pitch + (xstart + x) * bytesPerPixel;
}
};
--
cgit v1.2.3
From 7123fbdd7095257c9c23102f7d86d2c8cf21cfd0 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Thu, 18 Jun 2009 07:12:53 +0000
Subject: Merged revisions 41625 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r41625 | Kirben | 2009-06-18 16:18:31 +1000 (Thu, 18 Jun 2009) | 1 line
Correct actor layering method in HE90+ games.
........
svn-id: r41626
---
engines/scumm/actor.cpp | 16 ++++++++++++++++
engines/scumm/he/script_v100he.cpp | 3 +--
engines/scumm/he/script_v72he.cpp | 3 +--
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index f3c8e2ff6b..52866279b8 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1348,6 +1348,22 @@ void ScummEngine::processActors() {
}
}
}
+ } else if (_game.heversion >= 90) {
+ for (int j = 0; j < numactors; ++j) {
+ for (int i = 0; i < numactors; ++i) {
+ int sc_actor1 = _sortedActors[j]->_layer;
+ int sc_actor2 = _sortedActors[i]->_layer;
+ if (sc_actor1 < sc_actor2) {
+ SWAP(_sortedActors[i], _sortedActors[j]);
+ } else if (sc_actor1 == sc_actor2) {
+ sc_actor1 = _sortedActors[j]->getPos().y;
+ sc_actor2 = _sortedActors[i]->getPos().y;
+ if (sc_actor1 < sc_actor2) {
+ SWAP(_sortedActors[i], _sortedActors[j]);
+ }
+ }
+ }
+ }
} else {
for (int j = 0; j < numactors; ++j) {
for (int i = 0; i < numactors; ++i) {
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index fc27c338b2..60db9adefb 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -420,8 +420,7 @@ void ScummEngine_v100he::o100_actorOps() {
a->_needRedraw = true;
break;
case 59:
- // HE games use reverse order of layering, so we adjust
- a->_layer = -pop();
+ a->_layer = pop();
a->_needRedraw = true;
break;
case 63:
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 049fb13cd2..3c55818ece 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -770,8 +770,7 @@ void ScummEngine_v72he::o72_actorOps() {
a->setTalkCondition(k);
break;
case 43: // HE 90+
- // HE games use reverse order of layering, so we adjust
- a->_layer = -pop();
+ a->_layer = pop();
a->_needRedraw = true;
break;
case 64:
--
cgit v1.2.3
From 6f2b46964bd3bee3ee12f2c3cd19b62bbb8aa9b6 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Thu, 18 Jun 2009 07:31:09 +0000
Subject: Fixed error with non-animated 8-bit GUI cursors being drawn
incorrectly in debug console of 16-bit games.
svn-id: r41627
---
gui/ThemeEngine.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 5ce7c3dc60..d8e368581c 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -449,7 +449,7 @@ void ThemeEngine::enable() {
if (_useCursor) {
#ifdef ENABLE_16BIT
- CursorMan.pushCursorFormat(_system->getScreenFormat());
+ CursorMan.pushCursorFormat(_cursorFormat);
#endif
CursorMan.pushCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.pushCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
--
cgit v1.2.3
From 704386d3b09b68f96b6d4160a1a261e3e754f461 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 19 Jun 2009 09:28:55 +0000
Subject: Removed replaced Graphics::ColorMode enum type with factory methods
for Graphics::PixelFormat.
svn-id: r41662
---
backends/platform/sdl/sdl.cpp | 4 +-
backends/platform/sdl/sdl.h | 23 ++++-----
base/main.cpp | 2 +-
engines/engine.cpp | 3 +-
engines/scumm/scumm.cpp | 2 +-
graphics/pixelformat.h | 114 ++++++++++--------------------------------
6 files changed, 41 insertions(+), 107 deletions(-)
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 81b5fcc3eb..17ee5941a4 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,8 +197,8 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_16BIT
- _screenFormat(Graphics::kFormatCLUT8),
- _cursorFormat(Graphics::kFormatCLUT8),
+ _screenFormat(Graphics::PixelFormat::createFormatCLUT8()),
+ _cursorFormat(Graphics::PixelFormat::createFormatCLUT8()),
#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 598b943e4b..2cb9451a0d 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -96,22 +96,17 @@ public:
{
SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt;
#ifdef ENABLE_32BIT
- if (HWFormat->BitsPerPixel > 32)
- return Graphics::PixelFormat(Graphics::kFormatRGBA8888);
- return Graphics::PixelFormat(HWFormat->BytesPerPixel,
- HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss,
- HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift);
-#else //16
- if (HWFormat->BitsPerPixel > 16)
- return Graphics::PixelFormat(Graphics::kFormatRGB565);
- return Graphics::PixelFormat(HWFormat->BytesPerPixel,
- HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss,
- HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift);
+ if (HWFormat->BitsPerPixel >= 32)
+ return Graphics::PixelFormat::createFormatRGBA8888();
+ if (HWFormat->BitsPerPixel >= 24)
+ return Graphics::
+ FormatRGB888();
+#endif //ENABLE_32BIT
+ if (HWFormat->BitsPerPixel >= 16)
+ return Graphics::PixelFormat::createFormatRGB565();
}
-#endif //ENABLE_32BIT
-#else //8BIT only
- return Graphics::PixelFormat(Graphics::kFormatCLUT8);
#endif //ENABLE_32BIT or ENABLE_16BIT
+ return Graphics::PixelFormat::createFormatCLUT8();
}
#endif
diff --git a/base/main.cpp b/base/main.cpp
index 6f3bacebb7..56db1a4276 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -227,7 +227,7 @@ static void setupGraphics(OSystem &system) {
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
#ifdef ENABLE_16BIT
- system.initFormat(Graphics::PixelFormat(Graphics::kFormatCLUT8));
+ system.initFormat(Graphics::PixelFormat::createFormatCLUT8());
#endif
system.initSize(320, 200);
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 77ce7c44ad..fdf0186a89 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -126,8 +126,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
#ifdef ENABLE_16BIT
- Graphics::PixelFormat format(Graphics::kFormatCLUT8);
- initGraphics(width,height,defaultTo1xScaler, format);
+ initGraphics(width,height,defaultTo1xScaler, Graphics::PixelFormat::createFormatCLUT8());
}
void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
#endif
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 98da55d428..75a03aae0f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,7 +1085,7 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
} else if (_game.features & GF_16BIT_COLOR) {
#ifdef ENABLE_16BIT
- Graphics::PixelFormat format(Graphics::kFormatRGB555);
+ Graphics::PixelFormat format = Graphics::PixelFormat::createFormatRGB555();
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 37fca07b48..899ef3bdd7 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -30,35 +30,6 @@
namespace Graphics {
-#ifdef ENABLE_16BIT
-/**
- * A condensed bit format description.
- *
- * It includes the necessary information to create a PixelFormat and/or
- * ColorMask which fully describe the given color format.
- *
- * It contains two components, the format (8Bit paletted, RGB555, etc)
- * and the order (palette, ARGB, ABGR, etc)
- *
- * Use (format & kFormatTypeMask) to get the type, and (format & kFormatOrderMask)
- * to get the applicable color order.
- */
-enum ColorMode {
-#ifdef ENABLE_16BIT
- kFormatRGB555 = 1,
- kFormatXRGB1555 = 2, // Special case, high bit has special purpose, which may be alpha.
- // Engines should probably handle this bit internally and pass RGB only, though
- kFormatRGB565 = 3,
- kFormatRGBA4444 = 4, // since this mode is commonly supported in game hardware, some unimplemented engines may use it?
-#endif
-#ifdef ENABLE_32BIT
- kFormatRGB888 = 5,
- kFormatRGBA8888 = 6,
-#endif
- kFormatCLUT8 = 0 //256 color palette.
-};
-#endif
-
/**
* A pixel format description.
*
@@ -93,68 +64,37 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
-#ifdef ENABLE_16BIT
- //Convenience constructor from enum type
+ //"Factory" methods for convenience
//TODO: BGR support
//TODO: Specify alpha position
- explicit inline PixelFormat(ColorMode mode) {
- switch (mode) {
-#ifdef ENABLE_16BIT
- case kFormatRGB555:
- aLoss = 8;
- bytesPerPixel = 2;
- rLoss = gLoss = bLoss = 3;
- break;
- case kFormatXRGB1555:
- //Special case, alpha bit is always high in this mode.
- aLoss = 7;
- bytesPerPixel = 2;
- rLoss = gLoss = bLoss = 3;
- bShift = 0;
- gShift = bShift + bBits();
- rShift = gShift + gBits();
- aShift = rShift + rBits();
- //FIXME: there should be a clean way to handle setting
- //up the color order without prematurely returning.
- //This will probably be handled when alpha position specification is possible
- return;
- case kFormatRGB565:
- bytesPerPixel = 2;
- aLoss = 8;
- gLoss = 2;
- rLoss = bLoss = 3;
- break;
- case kFormatRGBA4444:
- bytesPerPixel = 2;
- aLoss = gLoss = rLoss = bLoss = 4;
- break;
-#endif
+ static inline PixelFormat PixelFormat::createFormatCLUT8() {
+ return PixelFormat(1,8,8,8,8,0,0,0,0);
+ }
+#if (defined ENABLE_16BIT) || (defined ENABLE_32BIT) //TODO: more generic define instead of ENABLE_16BIT
+ //2 Bytes-per-pixel modes
+ static inline PixelFormat PixelFormat::createFormatRGB555() {
+ return PixelFormat(2,3,3,3,8,10,5,0,0);
+ }
+ static inline PixelFormat PixelFormat::createFormatXRGB1555() {
+ //Special case, alpha bit is always high in this mode.
+ return PixelFormat(2,3,3,3,7,10,5,0,15);
+ }
+ static inline PixelFormat PixelFormat::createFormatRGB565() {
+ return PixelFormat(2,3,2,3,8,11,5,0,0);
+ }
+ static inline PixelFormat PixelFormat::createFormatRGBA4444() {
+ return PixelFormat(2,4,4,4,4,12,8,4,0);
+ }
#ifdef ENABLE_32BIT
- case kFormatRGB888:
- bytesPerPixel = 3;
- aLoss = 8;
- gLoss = rLoss = bLoss = 0;
- break;
- case kFormatRGBA8888:
- bytesPerPixel = 4;
- aLoss = gLoss = rLoss = bLoss = 0;
- break;
-#endif
- case kFormatCLUT8:
- default:
- bytesPerPixel = 1;
- rShift = gShift = bShift = aShift = 0;
- rLoss = gLoss = bLoss = aLoss = 8;
- return;
- }
-
- aShift = 0;
- bShift = aBits();
- gShift = bShift + bBits();
- rShift = gShift + gBits();
- return;
+ //3 to 4 byte per pixel modes
+ static inline PixelFormat PixelFormat::createFormatRGB888() {
+ return PixelFormat(3,0,0,0,8,16,8,0,0);
}
-#endif
+ static inline PixelFormat PixelFormat::createFormatRGBA8888() {
+ return PixelFormat(4,0,0,0,0,24,16,8,0);
+ }
+#endif //ENABLE_32BIT
+#endif //ENABLE_16BIT or ENABLE_32BIT
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
--
cgit v1.2.3
From 8b6ed92376024f43876af93fdfccd72d6fc33ac0 Mon Sep 17 00:00:00 2001
From: Torbjörn Andersson
Date: Sat, 20 Jun 2009 05:08:07 +0000
Subject: Fixed compilation.
svn-id: r41695
---
graphics/pixelformat.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 899ef3bdd7..4ad1f8b400 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -67,30 +67,30 @@ struct PixelFormat {
//"Factory" methods for convenience
//TODO: BGR support
//TODO: Specify alpha position
- static inline PixelFormat PixelFormat::createFormatCLUT8() {
+ static inline PixelFormat createFormatCLUT8() {
return PixelFormat(1,8,8,8,8,0,0,0,0);
}
#if (defined ENABLE_16BIT) || (defined ENABLE_32BIT) //TODO: more generic define instead of ENABLE_16BIT
//2 Bytes-per-pixel modes
- static inline PixelFormat PixelFormat::createFormatRGB555() {
+ static inline PixelFormat createFormatRGB555() {
return PixelFormat(2,3,3,3,8,10,5,0,0);
}
- static inline PixelFormat PixelFormat::createFormatXRGB1555() {
+ static inline PixelFormat createFormatXRGB1555() {
//Special case, alpha bit is always high in this mode.
return PixelFormat(2,3,3,3,7,10,5,0,15);
}
- static inline PixelFormat PixelFormat::createFormatRGB565() {
+ static inline PixelFormat createFormatRGB565() {
return PixelFormat(2,3,2,3,8,11,5,0,0);
}
- static inline PixelFormat PixelFormat::createFormatRGBA4444() {
+ static inline PixelFormat createFormatRGBA4444() {
return PixelFormat(2,4,4,4,4,12,8,4,0);
}
#ifdef ENABLE_32BIT
//3 to 4 byte per pixel modes
- static inline PixelFormat PixelFormat::createFormatRGB888() {
+ static inline PixelFormat createFormatRGB888() {
return PixelFormat(3,0,0,0,8,16,8,0,0);
}
- static inline PixelFormat PixelFormat::createFormatRGBA8888() {
+ static inline PixelFormat createFormatRGBA8888() {
return PixelFormat(4,0,0,0,0,24,16,8,0);
}
#endif //ENABLE_32BIT
--
cgit v1.2.3
From f7dd1c15ed38418a0371032966144eb6c2e004cb Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 20 Jun 2009 05:23:09 +0000
Subject: renamed ENABLE_16BIT define to more accurate ENABLE_RGB_COLOR
svn-id: r41696
---
backends/platform/sdl/graphics.cpp | 28 ++++++++++++++--------------
backends/platform/sdl/sdl.cpp | 2 +-
backends/platform/sdl/sdl.h | 12 +++++-------
base/main.cpp | 2 +-
common/error.h | 2 +-
common/system.h | 6 +++---
dists/msvc8/gob.vcproj | 2 +-
dists/msvc8/scumm.vcproj | 2 +-
dists/msvc8/scummvm.vcproj | 2 +-
engines/engine.cpp | 6 +++---
engines/engine.h | 4 ++--
engines/scumm/cursor.cpp | 2 +-
engines/scumm/scumm.cpp | 2 +-
graphics/cursorman.cpp | 6 +++---
graphics/cursorman.h | 8 ++++----
graphics/pixelformat.h | 4 ++--
gui/GuiManager.cpp | 6 +++---
gui/ThemeEngine.cpp | 8 ++++----
gui/ThemeEngine.h | 2 +-
19 files changed, 52 insertions(+), 54 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index f4269b55b2..a08239d472 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -97,7 +97,7 @@ void OSystem_SDL::beginGFXTransaction(void) {
_transactionDetails.needUpdatescreen = false;
_transactionDetails.normal1xScaler = false;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_transactionDetails.formatChanged = false;
#endif
@@ -123,7 +123,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
_videoMode.mode = _oldVideoMode.mode;
_videoMode.scaleFactor = _oldVideoMode.scaleFactor;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
} else if (_videoMode.format != _oldVideoMode.format) {
errors |= kTransactionPixelFormatNotSupported;
@@ -153,7 +153,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
}
}
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
if (_transactionDetails.sizeChanged || _transactionDetails.formatChanged) {
#else
if (_transactionDetails.sizeChanged) {
@@ -353,7 +353,7 @@ int OSystem_SDL::getGraphicsMode() const {
assert (_transactionMode == kTransactionNone);
return _videoMode.mode;
}
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
void OSystem_SDL::initFormat(Graphics::PixelFormat format) {
assert(_transactionMode == kTransactionActive);
@@ -411,7 +411,7 @@ bool OSystem_SDL::loadGFXMode() {
//
// Create the surface that contains the 8 bit game data
//
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
_screenFormat.bytesPerPixel << 3,
((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift ,
@@ -871,7 +871,7 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
if (SDL_LockSurface(_screen) == -1)
error("SDL_LockSurface failed: %s", SDL_GetError());
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth * _screenFormat.bytesPerPixel + x * _screenFormat.bytesPerPixel;
if (_videoMode.screenWidth == w && pitch == w * _screenFormat.bytesPerPixel) {
memcpy(dst, src, h*w*_screenFormat.bytesPerPixel);
@@ -917,7 +917,7 @@ Graphics::Surface *OSystem_SDL::lockScreen() {
_framebuffer.w = _screen->w;
_framebuffer.h = _screen->h;
_framebuffer.pitch = _screen->pitch;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel;
#else
_framebuffer.bytesPerPixel = 1;
@@ -1105,7 +1105,7 @@ int16 OSystem_SDL::getWidth() {
void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
assert(colors);
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
if (_screenFormat.bytesPerPixel > 1)
return; //not using a paletted pixel format
#endif
@@ -1163,7 +1163,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
}
_cursorPaletteDisabled = false;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
}
void OSystem_SDL::setCursorFormat(Graphics::PixelFormat format) {
@@ -1380,7 +1380,7 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
keycolor &= 0xFF;
@@ -1419,7 +1419,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
}
free(_mouseData);
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel);
memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel);
#else
@@ -1433,7 +1433,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
void OSystem_SDL::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
uint32 color;
uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
@@ -1472,7 +1472,7 @@ void OSystem_SDL::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
if (_cursorFormat.bytesPerPixel > 1) {
color = (*(uint32 *) srcPtr) & colormask;
if (color != _mouseKeyColor) { // transparent, don't draw
@@ -1492,7 +1492,7 @@ void OSystem_SDL::blitCursor() {
}
dstPtr += 2;
srcPtr++;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
}
#endif
}
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 17ee5941a4..3f9b81a912 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -196,7 +196,7 @@ OSystem_SDL::OSystem_SDL()
_osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0),
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_screenFormat(Graphics::PixelFormat::createFormatCLUT8()),
_cursorFormat(Graphics::PixelFormat::createFormatCLUT8()),
#endif
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 2cb9451a0d..aee15fcbd0 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -81,7 +81,7 @@ public:
void beginGFXTransaction(void);
TransactionError endGFXTransaction(void);
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
// Set the depth and format of the video bitmap
// Typically, CLUT8
virtual void initFormat(Graphics::PixelFormat format);
@@ -92,7 +92,6 @@ public:
// Highest supported
virtual Graphics::PixelFormat getBestFormat() const {
//TODO scale down 16/32 bit based on hardware support
-#if (defined ENABLE_32BIT) || (defined ENABLE_16BIT)
{
SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt;
#ifdef ENABLE_32BIT
@@ -105,7 +104,6 @@ public:
if (HWFormat->BitsPerPixel >= 16)
return Graphics::PixelFormat::createFormatRGB565();
}
-#endif //ENABLE_32BIT or ENABLE_16BIT
return Graphics::PixelFormat::createFormatCLUT8();
}
#endif
@@ -142,7 +140,7 @@ public:
// Set the bitmap that's used when drawing the cursor.
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
virtual void setCursorFormat(Graphics::PixelFormat format);
#endif
@@ -260,7 +258,7 @@ protected:
// unseen game screen
SDL_Surface *_screen;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat _screenFormat;
Graphics::PixelFormat _cursorFormat;
#endif
@@ -297,7 +295,7 @@ protected:
bool needHotswap;
bool needUpdatescreen;
bool normal1xScaler;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
bool formatChanged;
#endif
};
@@ -314,7 +312,7 @@ protected:
int screenWidth, screenHeight;
int overlayWidth, overlayHeight;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat format;
#endif
};
diff --git a/base/main.cpp b/base/main.cpp
index 56db1a4276..3bbe6ddd9c 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -226,7 +226,7 @@ static void setupGraphics(OSystem &system) {
// Set the user specified graphics mode (if any).
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
system.initFormat(Graphics::PixelFormat::createFormatCLUT8());
#endif
system.initSize(320, 200);
diff --git a/common/error.h b/common/error.h
index 8959a6ae23..6522fbf4af 100644
--- a/common/error.h
+++ b/common/error.h
@@ -48,7 +48,7 @@ enum Error {
kInvalidPathError, //!< Engine initialization: Invalid game path was passed
kNoGameDataFoundError, //!< Engine initialization: No game data was found in the specified location
kUnsupportedGameidError, //!< Engine initialization: Gameid not supported by this (Meta)Engine
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
kUnsupportedColorMode, //!< Engine initialization: Engine does not support backend's color mode
#endif
diff --git a/common/system.h b/common/system.h
index 7df4a124e3..6846b7b9dd 100644
--- a/common/system.h
+++ b/common/system.h
@@ -343,7 +343,7 @@ public:
*/
virtual int getGraphicsMode() const = 0;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
/**
* Set the color format of the virtual screen. Typical formats include:
* CLUT8 (e.g. 256 color, for most games)
@@ -436,7 +436,7 @@ public:
kTransactionAspectRatioFailed = (1 << 0), /**< Failed switchting aspect ratio correction mode */
kTransactionFullscreenFailed = (1 << 1), /**< Failed switchting fullscreen mode */
kTransactionModeSwitchFailed = (1 << 2), /**< Failed switchting the GFX graphics mode (setGraphicsMode) */
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
kTransactionPixelFormatNotSupported = (1 << 4), /**< Failed setting the color format (function not yet implemented) */
#endif
kTransactionSizeChangeFailed = (1 << 3) /**< Failed switchting the screen dimensions (initSize) */
@@ -720,7 +720,7 @@ public:
* @param cursorTargetScale scale factor which cursor is designed for
*/
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1) = 0;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
virtual void setCursorFormat(Graphics::PixelFormat format) = 0;
#endif
diff --git a/dists/msvc8/gob.vcproj b/dists/msvc8/gob.vcproj
index 9016140453..2b2fca62fc 100644
--- a/dists/msvc8/gob.vcproj
+++ b/dists/msvc8/gob.vcproj
@@ -43,7 +43,7 @@
Optimization="0"
InlineFunctionExpansion="0"
AdditionalIncludeDirectories="../../;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;USE_ZLIB;USE_MAD;USE_VORBIS;ENABLE_16BIT"
+ PreprocessorDefinitions="WIN32;_DEBUG;USE_ZLIB;USE_MAD;USE_VORBIS;ENABLE_RGB_COLOR"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
diff --git a/dists/msvc8/scumm.vcproj b/dists/msvc8/scumm.vcproj
index 006c1e3078..63d7e5ddf3 100644
--- a/dists/msvc8/scumm.vcproj
+++ b/dists/msvc8/scumm.vcproj
@@ -43,7 +43,7 @@
Optimization="0"
InlineFunctionExpansion="0"
AdditionalIncludeDirectories="../../;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS;ENABLE_16BIT"
+ PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS;ENABLE_RGB_COLOR"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index 8c345596ae..5eca2b2009 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -43,7 +43,7 @@
Optimization="0"
InlineFunctionExpansion="0"
AdditionalIncludeDirectories="../../;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_16BIT"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
diff --git a/engines/engine.cpp b/engines/engine.cpp
index fdf0186a89..15c6820f22 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -125,7 +125,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
initGraphics(width,height,defaultTo1xScaler, Graphics::PixelFormat::createFormatCLUT8());
}
void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
@@ -134,7 +134,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::Pixel
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
g_system->initFormat(format);
#endif
g_system->initSize(width, height);
@@ -158,7 +158,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::Pixel
}
// Just show warnings then these occur:
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
if (gfxError & OSystem::kTransactionPixelFormatNotSupported) {
Common::String message = "Could not initialize color format.";
diff --git a/engines/engine.h b/engines/engine.h
index 1ea1b70b5d..864450d6e1 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -29,7 +29,7 @@
#include "common/error.h"
#include "common/fs.h"
#include "common/str.h"
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
#include "graphics/pixelformat.h"
#endif
@@ -62,7 +62,7 @@ void initCommonGFX(bool defaultTo1XScaler);
* Errors out when backend is not able to switch to the specified
* mode.
*/
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format);
#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 30483a638c..5c695e58a5 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,7 +112,7 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
CursorMan.replaceCursorFormat(_system->getScreenFormat());
#endif
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 75a03aae0f..cab8db2d45 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1084,7 +1084,7 @@ Common::Error ScummEngine::init() {
// there is no text surface for them. This takes that into account
(_screenWidth * _textSurfaceMultiplier > 320));
} else if (_game.features & GF_16BIT_COLOR) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatRGB555();
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
if (format != _system->getScreenFormat())
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 6446216867..865c7515f0 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -97,7 +97,7 @@ void CursorManager::popAllCursors() {
}
}
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
while (!_cursorFormatStack.empty()) {
PixelFormat *form = _cursorFormatStack.pop();
delete form;
@@ -116,7 +116,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
Cursor *cur = _cursorStack.top();
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
uint size = w * h * g_system->getScreenFormat().bytesPerPixel;
#else
uint size = w * h;
@@ -220,7 +220,7 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu
}
}
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
void CursorManager::pushCursorFormat(PixelFormat format) {
// if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
// return;
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 32f1b90f3e..b28145d932 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -28,7 +28,7 @@
#include "common/scummsys.h"
#include "common/stack.h"
#include "common/singleton.h"
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
#include "graphics/pixelformat.h"
#include "common/system.h"
#endif
@@ -134,7 +134,7 @@ public:
*/
void replaceCursorPalette(const byte *colors, uint start, uint num);
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
/**
* Push a new cursor pixel format onto the stack, and set it in the backend.
*
@@ -177,7 +177,7 @@ private:
uint _size;
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
{ //limit the lifespan of the format value to minimize impact on memory usage
Graphics::PixelFormat f = g_system->getScreenFormat();
_size = w * h * f.bytesPerPixel;
@@ -231,7 +231,7 @@ private:
};
Common::Stack _cursorStack;
Common::Stack _cursorPaletteStack;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Common::Stack _cursorFormatStack;
#endif
};
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 4ad1f8b400..7f7f2412cb 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -70,7 +70,7 @@ struct PixelFormat {
static inline PixelFormat createFormatCLUT8() {
return PixelFormat(1,8,8,8,8,0,0,0,0);
}
-#if (defined ENABLE_16BIT) || (defined ENABLE_32BIT) //TODO: more generic define instead of ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
//2 Bytes-per-pixel modes
static inline PixelFormat createFormatRGB555() {
return PixelFormat(2,3,3,3,8,10,5,0,0);
@@ -94,7 +94,7 @@ struct PixelFormat {
return PixelFormat(4,0,0,0,0,24,16,8,0);
}
#endif //ENABLE_32BIT
-#endif //ENABLE_16BIT or ENABLE_32BIT
+#endif //ENABLE_RGB_COLOR
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index fcfc02967e..8e161f3e60 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -135,7 +135,7 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
delete _theme;
if (_useStdCursor) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
CursorMan.popCursorFormat();
#endif
CursorMan.popCursorPalette();
@@ -385,7 +385,7 @@ void GuiManager::saveState() {
void GuiManager::restoreState() {
if (_useStdCursor) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
CursorMan.popCursorFormat();
#endif
CursorMan.popCursor();
@@ -430,7 +430,7 @@ void GuiManager::setupCursor() {
87, 87, 87, 0
};
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat format;
format.bytesPerPixel = 1;
format.rLoss = format.gLoss = format.bLoss = format.aLoss = 8;
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index d8e368581c..70b295b989 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -434,7 +434,7 @@ void ThemeEngine::refresh() {
_system->showOverlay();
if (_useCursor) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
CursorMan.replaceCursorFormat(_cursorFormat);
#endif
CursorMan.replaceCursorPalette(_cursorPal, 0, _cursorPalSize);
@@ -448,7 +448,7 @@ void ThemeEngine::enable() {
return;
if (_useCursor) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
CursorMan.pushCursorFormat(_cursorFormat);
#endif
CursorMan.pushCursorPalette(_cursorPal, 0, _cursorPalSize);
@@ -468,7 +468,7 @@ void ThemeEngine::disable() {
_system->hideOverlay();
if (_useCursor) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
CursorMan.popCursorFormat();
#endif
CursorMan.popCursorPalette();
@@ -1174,7 +1174,7 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
if (!cursor)
return false;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_cursorFormat.bytesPerPixel = 1;
_cursorFormat.rLoss = _cursorFormat.gLoss = _cursorFormat.bLoss = _cursorFormat.aLoss = 8;
_cursorFormat.rShift = _cursorFormat.gShift = _cursorFormat.bShift = _cursorFormat.aShift = 0;
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 2a7bbcc6ce..74af16f09f 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -579,7 +579,7 @@ protected:
ImagesMap _bitmaps;
Graphics::PixelFormat _overlayFormat;
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat _cursorFormat;
#endif
--
cgit v1.2.3
From c0c0aed4880763bd5a1fc15a7138a5e2c4f1d904 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 20 Jun 2009 05:31:23 +0000
Subject: Factory constructors for ARGB BGR ABGR and BGRA pixel formats.
svn-id: r41697
---
graphics/pixelformat.h | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 7f7f2412cb..a773a42d76 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -65,8 +65,6 @@ struct PixelFormat {
}
//"Factory" methods for convenience
- //TODO: BGR support
- //TODO: Specify alpha position
static inline PixelFormat createFormatCLUT8() {
return PixelFormat(1,8,8,8,8,0,0,0,0);
}
@@ -75,24 +73,55 @@ struct PixelFormat {
static inline PixelFormat createFormatRGB555() {
return PixelFormat(2,3,3,3,8,10,5,0,0);
}
+ static inline PixelFormat createFormatBGR555() {
+ return PixelFormat(2,3,3,3,8,0,5,10,0);
+ }
static inline PixelFormat createFormatXRGB1555() {
//Special case, alpha bit is always high in this mode.
return PixelFormat(2,3,3,3,7,10,5,0,15);
}
+ static inline PixelFormat createFormatXBGR1555() {
+ //Special case, alpha bit is always high in this mode.
+ return PixelFormat(2,3,3,3,7,0,5,10,15);
+ }
static inline PixelFormat createFormatRGB565() {
return PixelFormat(2,3,2,3,8,11,5,0,0);
}
+ static inline PixelFormat createFormatBGR565() {
+ return PixelFormat(2,3,2,3,8,0,5,11,0);
+ }
static inline PixelFormat createFormatRGBA4444() {
return PixelFormat(2,4,4,4,4,12,8,4,0);
}
+ static inline PixelFormat createFormatARGB4444() {
+ return PixelFormat(2,4,4,4,4,8,4,0,12);
+ }
+ static inline PixelFormat createFormatABGR4444() {
+ return PixelFormat(2,4,4,4,4,0,4,8,12);
+ }
+ static inline PixelFormat createFormatBGRA4444() {
+ return PixelFormat(2,4,4,4,4,4,8,12,0);
+ }
#ifdef ENABLE_32BIT
//3 to 4 byte per pixel modes
static inline PixelFormat createFormatRGB888() {
return PixelFormat(3,0,0,0,8,16,8,0,0);
}
+ static inline PixelFormat createFormatBGR888() {
+ return PixelFormat(3,0,0,0,8,0,8,16,0);
+ }
static inline PixelFormat createFormatRGBA8888() {
return PixelFormat(4,0,0,0,0,24,16,8,0);
}
+ static inline PixelFormat createFormatARGB8888() {
+ return PixelFormat(4,0,0,0,0,16,8,0,24);
+ }
+ static inline PixelFormat createFormatABGR8888() {
+ return PixelFormat(4,0,0,0,0,0,8,16,24);
+ }
+ static inline PixelFormat createFormatBGRA8888() {
+ return PixelFormat(4,0,0,0,0,8,16,24,0);
+ }
#endif //ENABLE_32BIT
#endif //ENABLE_RGB_COLOR
--
cgit v1.2.3
From 114f67284e75c6351252e0596e98c2616b927c29 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 20 Jun 2009 05:39:30 +0000
Subject: Update.
svn-id: r41698
---
Makefile.common | 4 ++--
configure | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile.common b/Makefile.common
index 858839a05a..522fa7c809 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -37,8 +37,8 @@ ifdef DISABLE_SCALERS
DEFINES += -DDISABLE_SCALERS
endif
-ifdef ENABLE_16BIT
-DEFINES += -DENABLE_16BIT
+ifdef ENABLE_RGB_COLOR
+DEFINES += -DENABLE_RGB_COLOR
endif
ifdef DISABLE_HQ_SCALERS
diff --git a/configure b/configure
index fb7c646f3a..163d582b3d 100755
--- a/configure
+++ b/configure
@@ -1562,7 +1562,7 @@ add_to_config_mk_if_yes "$_mt32emu" 'USE_MT32EMU = 1'
#
# Check whether 16bit color support is requested
#
-add_to_config_mk_if_yes "$_16bit" 'ENABLE_16BIT = 1'
+add_to_config_mk_if_yes "$_16bit" 'ENABLE_RGB_COLOR = 1'
#
# Check whether to enable the (hq) scalers
--
cgit v1.2.3
From f1b05956310621c43c386fc1097f0651b985cfc8 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sun, 21 Jun 2009 14:43:06 +0000
Subject: Add initial support for captureWizPolygon.
svn-id: r41728
---
engines/scumm/he/wiz_he.cpp | 380 +++++++++++++++++++++++++++-----------------
engines/scumm/he/wiz_he.h | 3 +
2 files changed, 236 insertions(+), 147 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index b2e367719e..5fbc12626e 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1305,7 +1305,11 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
} else {
src = pvs->getPixels(0, 0);
}
- Common::Rect rCapt(pvs->w, pvs->h);
+ captureImage(src, pvs->pitch, pvs->w, pvs->h, resNum, r, compType);
+}
+
+void Wiz::captureImage(uint8 *src, int srcPitch, int srcw, int srch, int resNum, const Common::Rect& r, int compType) {
+ Common::Rect rCapt(srcw, srch);
if (rCapt.intersects(r)) {
rCapt.clip(r);
const uint8 *palPtr;
@@ -1327,13 +1331,13 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
int headerSize = palPtr ? 1080 : 36;
switch (compType) {
case 0:
- dataSize = wizPackType0(0, src, pvs->pitch, rCapt);
+ dataSize = wizPackType0(0, src, srcPitch, rCapt);
break;
case 1:
- dataSize = wizPackType1(0, src, pvs->pitch, rCapt, transColor);
+ dataSize = wizPackType1(0, src, srcPitch, rCapt, transColor);
break;
case 2:
- dataSize = wizPackType2(0, src, pvs->pitch, rCapt);
+ dataSize = wizPackType2(0, src, srcPitch, rCapt);
break;
default:
error("unhandled compression type %d", compType);
@@ -1373,13 +1377,13 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
// write compressed data
switch (compType) {
case 0:
- wizPackType0(wizImg + headerSize, src, pvs->pitch, rCapt);
+ wizPackType0(wizImg + headerSize, src, srcPitch, rCapt);
break;
case 1:
- wizPackType1(wizImg + headerSize, src, pvs->pitch, rCapt, transColor);
+ wizPackType1(wizImg + headerSize, src, srcPitch, rCapt, transColor);
break;
case 2:
- wizPackType2(wizImg + headerSize, src, pvs->pitch, rCapt);
+ wizPackType2(wizImg + headerSize, src, srcPitch, rCapt);
break;
default:
break;
@@ -1671,6 +1675,80 @@ struct PolygonDrawData {
}
};
+void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int id2) {
+ debug(0, "captureWizPolygon: resNum %d, maskNum %d maskState %d, id1 %d id2 %d\n", resNum, maskNum, maskState, id1, id2);
+
+ int i, j;
+ VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
+ WizPolygon *wp1, *wp2;
+ const uint16 transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
+
+ wp1 = NULL;
+ for (i = 0; i < ARRAYSIZE(_polygons); ++i) {
+ if (_polygons[i].id == id1) {
+ wp1 = &_polygons[i];
+ break;
+ }
+ }
+ if (!wp1) {
+ error("Polygon %d is not defined", id1);
+ }
+ if (wp1->numVerts != 5) {
+ error("Invalid point count %d for Polygon %d", wp1->numVerts, id1);
+ }
+
+ wp2 = NULL;
+ for (i = 0; i < ARRAYSIZE(_polygons); ++i) {
+ if (_polygons[i].id == id2) {
+ wp2 = &_polygons[i];
+ break;
+ }
+ }
+ if (!wp2) {
+ error("Polygon %d is not defined", id2);
+ }
+ if (wp2->numVerts != 5) {
+ error("Invalid point count %d for Polygon %d", wp2->numVerts, id2);
+ }
+
+ int32 dstw, dsth, dstpitch;
+ int32 srcw, srch;
+ uint8 *imageBuffer;
+ const uint8 *src = pvs->getPixels(0, 0);
+
+ if (maskNum) {
+ const Common::Rect *r = NULL;
+ src = drawWizImage(maskNum, maskState, 0, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
+ getWizImageDim(maskNum, maskState, srcw, srch);
+ } else {
+ srcw = pvs->w;
+ srch = pvs->h;
+ }
+
+ dstw = wp2->bound.width();
+ dsth = wp2->bound.height();
+ dstpitch = wp2->bound.width() * _vm->_bitDepth;
+ imageBuffer = (uint8 *)malloc(wp2->bound.width() * wp2->bound.height() * _vm->_bitDepth);
+ assert(imageBuffer);
+
+ if (_vm->_bitDepth == 2) {
+ uint8 *tmpPtr = imageBuffer;
+ for (i = 0; i < dsth; i++) {
+ for (j = 0; j < dstw; j++)
+ WRITE_LE_UINT16(tmpPtr + j * 2, transColor);
+ tmpPtr += dstpitch;
+ }
+ } else {
+ memset(imageBuffer, transColor, dstw * dsth);
+ }
+
+ Common::Rect bound;
+ drawWizPolygonImage(imageBuffer, src, NULL, dstpitch, kDstMemory, dstw, dsth, srcw, srch, bound, wp2->vert, _vm->_bitDepth);
+
+ captureImage(imageBuffer, dstpitch, dstw, dsth, resNum, wp2->bound, (_vm->_bitDepth == 2) ? 2 : 0);
+ free(imageBuffer);
+}
+
void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int scale, const Common::Rect *r, int flags, int dstResNum, int palette) {
Common::Point pts[4];
@@ -1702,7 +1780,6 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
const Common::Rect *r = NULL;
uint8 *srcWizBuf = NULL;
bool freeBuffer = true;
- int i;
if (_vm->_game.heversion >= 99) {
if (getWizImageData(resNum, state, 0) != 0 || (flags & (kWIFRemapPalette | kWIFFlipX | kWIFFlipY)) || palette != 0) {
@@ -1733,152 +1810,163 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
}
}
- if (srcWizBuf) {
- uint8 *dst;
- int32 dstw, dsth, dstpitch, dstType, wizW, wizH;
- VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
- int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
+ assert(srcWizBuf);
- if (dstResNum) {
- uint8 *dstPtr = _vm->getResourceAddress(rtImage, dstResNum);
- assert(dstPtr);
- dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
- assert(dst);
- getWizImageDim(dstResNum, 0, dstw, dsth);
- dstpitch = dstw * _vm->_bitDepth;
- dstType = kDstResource;
+ uint8 *dst;
+ int32 dstw, dsth, dstpitch, dstType, wizW, wizH;
+ VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
+
+ if (dstResNum) {
+ uint8 *dstPtr = _vm->getResourceAddress(rtImage, dstResNum);
+ assert(dstPtr);
+ dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
+ assert(dst);
+ getWizImageDim(dstResNum, 0, dstw, dsth);
+ dstpitch = dstw * _vm->_bitDepth;
+ dstType = kDstResource;
+ } else {
+ if (flags & kWIFMarkBufferDirty) {
+ dst = pvs->getPixels(0, 0);
} else {
- if (flags & kWIFMarkBufferDirty) {
- dst = pvs->getPixels(0, 0);
- } else {
- dst = pvs->getBackPixels(0, 0);
- }
- dstw = pvs->w;
- dsth = pvs->h;
- dstpitch = pvs->pitch;
- dstType = kDstScreen;
+ dst = pvs->getBackPixels(0, 0);
}
+ dstw = pvs->w;
+ dsth = pvs->h;
+ dstpitch = pvs->pitch;
+ dstType = kDstScreen;
+ }
- getWizImageDim(resNum, state, wizW, wizH);
-
- Common::Point bbox[4];
- bbox[0].x = 0;
- bbox[0].y = 0;
- bbox[1].x = wizW - 1;
- bbox[1].y = 0;
- bbox[2].x = wizW - 1;
- bbox[2].y = wizH - 1;
- bbox[3].x = 0;
- bbox[3].y = wizH - 1;
-
- int16 xmin_p, xmax_p, ymin_p, ymax_p;
- xmin_p = ymin_p = (int16)0x7FFF;
- xmax_p = ymax_p = (int16)0x8000;
-
- for (i = 0; i < 4; ++i) {
- xmin_p = MIN(wp[i].x, xmin_p);
- xmax_p = MAX(wp[i].x, xmax_p);
- ymin_p = MIN(wp[i].y, ymin_p);
- ymax_p = MAX(wp[i].y, ymax_p);
- }
-
- int16 xmin_b, xmax_b, ymin_b, ymax_b;
- xmin_b = ymin_b = (int16)0x7FFF;
- xmax_b = ymax_b = (int16)0x8000;
-
- for (i = 0; i < 4; ++i) {
- xmin_b = MIN(bbox[i].x, xmin_b);
- xmax_b = MAX(bbox[i].x, xmax_b);
- ymin_b = MIN(bbox[i].y, ymin_b);
- ymax_b = MAX(bbox[i].y, ymax_b);
- }
-
- PolygonDrawData pdd(ymax_p - ymin_p + 1);
- pdd.mat[0].x = xmin_p;
- pdd.mat[0].y = ymin_p;
- pdd.mat[1].x = xmax_p;
- pdd.mat[1].y = ymax_p;
- pdd.mat[2].x = xmin_b;
- pdd.mat[2].y = ymin_b;
- pdd.mat[3].x = xmax_b;
- pdd.mat[3].y = ymax_b;
-
- // precompute the transformation which remaps 'bbox' pixels to 'wp'
- for (i = 0; i < 3; ++i) {
- pdd.transform(&wp[i], &wp[i + 1], &bbox[i], &bbox[i + 1]);
- }
- pdd.transform(&wp[3], &wp[0], &bbox[3], &bbox[0]);
-
- pdd.rAreasNum = 0;
- PolygonDrawData::ResultArea *pra = &pdd.ra[0];
- int32 yoff = pdd.mat[0].y * dstpitch;
- int16 y_start = pdd.mat[0].y;
- for (i = 0; i < pdd.pAreasNum; ++i) {
- PolygonDrawData::PolygonArea *ppa = &pdd.pa[i];
- if (y_start >= 0 && y_start < dsth) {
- int16 x1 = ppa->xmin;
- if (x1 < 0) {
- x1 = 0;
- }
- int16 x2 = ppa->xmax;
- if (x2 >= dstw) {
- x2 = dstw - 1;
- }
- int16 w = x2 - x1 + 1;
- if (w > 0) {
- int16 width = ppa->xmax - ppa->xmin + 1;
- pra->x_step = ((ppa->x2 - ppa->x1) << 16) / width;
- pra->y_step = ((ppa->y2 - ppa->y1) << 16) / width;
- pra->dst_offs = yoff + x1 * _vm->_bitDepth;
- pra->w = w;
- pra->x_s = ppa->x1 << 16;
- pra->y_s = ppa->y1 << 16;
- int16 tmp = x1 - ppa->xmin;
- if (tmp != 0) {
- pra->x_s += pra->x_step * tmp;
- pra->y_s += pra->y_step * tmp;
- }
- ++pra;
- ++pdd.rAreasNum;
- }
+ Common::Rect bound;
+ getWizImageDim(resNum, state, wizW, wizH);
+ drawWizPolygonImage(dst, srcWizBuf, 0, dstpitch, dstType, dstw, dsth, wizW, wizH, bound, wp, _vm->_bitDepth);
+
+ if (flags & kWIFMarkBufferDirty) {
+ _vm->markRectAsDirty(kMainVirtScreen, bound);
+ } else {
+ _vm->restoreBackgroundHE(bound);
+ }
+
+ if (freeBuffer)
+ free(srcWizBuf);
+}
+
+void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstpitch, int dstType, int dstw, int dsth, int wizW, int wizH, Common::Rect &bound, Common::Point *wp, uint8 bitDepth) {
+ int i, transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
+
+ Common::Point bbox[4];
+ bbox[0].x = 0;
+ bbox[0].y = 0;
+ bbox[1].x = wizW - 1;
+ bbox[1].y = 0;
+ bbox[2].x = wizW - 1;
+ bbox[2].y = wizH - 1;
+ bbox[3].x = 0;
+ bbox[3].y = wizH - 1;
+
+ int16 xmin_p, xmax_p, ymin_p, ymax_p;
+ xmin_p = ymin_p = (int16)0x7FFF;
+ xmax_p = ymax_p = (int16)0x8000;
+
+ for (i = 0; i < 4; ++i) {
+ xmin_p = MIN(wp[i].x, xmin_p);
+ xmax_p = MAX(wp[i].x, xmax_p);
+ ymin_p = MIN(wp[i].y, ymin_p);
+ ymax_p = MAX(wp[i].y, ymax_p);
+ }
+
+ int16 xmin_b, xmax_b, ymin_b, ymax_b;
+ xmin_b = ymin_b = (int16)0x7FFF;
+ xmax_b = ymax_b = (int16)0x8000;
+
+ for (i = 0; i < 4; ++i) {
+ xmin_b = MIN(bbox[i].x, xmin_b);
+ xmax_b = MAX(bbox[i].x, xmax_b);
+ ymin_b = MIN(bbox[i].y, ymin_b);
+ ymax_b = MAX(bbox[i].y, ymax_b);
+ }
+
+ PolygonDrawData pdd(ymax_p - ymin_p + 1);
+ pdd.mat[0].x = xmin_p;
+ pdd.mat[0].y = ymin_p;
+ pdd.mat[1].x = xmax_p;
+ pdd.mat[1].y = ymax_p;
+ pdd.mat[2].x = xmin_b;
+ pdd.mat[2].y = ymin_b;
+ pdd.mat[3].x = xmax_b;
+ pdd.mat[3].y = ymax_b;
+
+ // precompute the transformation which remaps 'bbox' pixels to 'wp'
+ for (i = 0; i < 3; ++i) {
+ pdd.transform(&wp[i], &wp[i + 1], &bbox[i], &bbox[i + 1]);
+ }
+ pdd.transform(&wp[3], &wp[0], &bbox[3], &bbox[0]);
+
+ pdd.rAreasNum = 0;
+ PolygonDrawData::ResultArea *pra = &pdd.ra[0];
+ int32 yoff = pdd.mat[0].y * dstpitch;
+ int16 y_start = pdd.mat[0].y;
+ for (i = 0; i < pdd.pAreasNum; ++i) {
+ PolygonDrawData::PolygonArea *ppa = &pdd.pa[i];
+ if (y_start >= 0 && y_start < dsth) {
+ int16 x1 = ppa->xmin;
+ if (x1 < 0) {
+ x1 = 0;
}
- ++ppa;
- yoff += dstpitch;
- ++y_start;
- }
-
- pra = &pdd.ra[0];
- for (i = 0; i < pdd.rAreasNum; ++i, ++pra) {
- uint8 *dstPtr = dst + pra->dst_offs;
- int32 w = pra->w;
- int32 x_acc = pra->x_s;
- int32 y_acc = pra->y_s;
- while (--w) {
- int32 src_offs = (y_acc >> 16) * wizW + (x_acc >> 16);
- assert(src_offs < wizW * wizH);
- x_acc += pra->x_step;
- y_acc += pra->y_step;
- if (_vm->_bitDepth == 2) {
- if (transColor == -1 || transColor != READ_LE_UINT16(srcWizBuf + src_offs * 2))
- writeColor(dstPtr, dstType, READ_LE_UINT16(srcWizBuf + src_offs * 2));
- } else {
- if (transColor == -1 || transColor != srcWizBuf[src_offs])
- *dstPtr = srcWizBuf[src_offs];
+ int16 x2 = ppa->xmax;
+ if (x2 >= dstw) {
+ x2 = dstw - 1;
+ }
+ int16 w = x2 - x1 + 1;
+ if (w > 0) {
+ int16 width = ppa->xmax - ppa->xmin + 1;
+ pra->x_step = ((ppa->x2 - ppa->x1) << 16) / width;
+ pra->y_step = ((ppa->y2 - ppa->y1) << 16) / width;
+ pra->dst_offs = yoff + x1 * _vm->_bitDepth;
+ pra->w = w;
+ pra->x_s = ppa->x1 << 16;
+ pra->y_s = ppa->y1 << 16;
+ int16 tmp = x1 - ppa->xmin;
+ if (tmp != 0) {
+ pra->x_s += pra->x_step * tmp;
+ pra->y_s += pra->y_step * tmp;
}
- dstPtr += _vm->_bitDepth;
+ ++pra;
+ ++pdd.rAreasNum;
}
}
-
- Common::Rect bound(xmin_p, ymin_p, xmax_p + 1, ymax_p + 1);
- if (flags & kWIFMarkBufferDirty) {
- _vm->markRectAsDirty(kMainVirtScreen, bound);
- } else {
- _vm->restoreBackgroundHE(bound);
+ ++ppa;
+ yoff += dstpitch;
+ ++y_start;
+ }
+
+ pra = &pdd.ra[0];
+ for (i = 0; i < pdd.rAreasNum; ++i, ++pra) {
+ uint8 *dstPtr = dst + pra->dst_offs;
+ int32 w = pra->w;
+ int32 x_acc = pra->x_s;
+ int32 y_acc = pra->y_s;
+ while (--w) {
+ int32 src_offs = (y_acc >> 16) * wizW + (x_acc >> 16);
+ assert(src_offs < wizW * wizH);
+ x_acc += pra->x_step;
+ y_acc += pra->y_step;
+ if (bitDepth == 2) {
+ if (transColor == -1 || transColor != READ_LE_UINT16(src + src_offs * 2)) {
+ //if (transColor == -1 || READ_LE_UINT16(dstPtr) != transColor)
+ writeColor(dstPtr, dstType, READ_LE_UINT16(src + src_offs * 2));
+ }
+ } else {
+ if (transColor == -1 || transColor != src[src_offs])
+ *dstPtr = src[src_offs];
+ }
+ dstPtr += bitDepth;
}
-
- if (freeBuffer)
- free(srcWizBuf);
}
+
+ bound.left = xmin_p;
+ bound.top = ymin_p;
+ bound.right = xmax_p + 1;
+ bound.bottom = ymax_p + 1;
}
void Wiz::flushWizBuffer() {
@@ -2329,9 +2417,7 @@ void Wiz::processWizImage(const WizParameters *params) {
break;
// HE 99+
case 7:
- // Used in PuttsFunShop/SamsFunShop/soccer2004
- // TODO: Capture polygon
- _vm->_res->setModified(rtImage, params->img.resNum);
+ captureWizPolygon(params->img.resNum, params->sourceImage, params->img.state, params->polygonId1, params->polygonId2);
break;
case 8: {
int img_w = 640;
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index 5c5daa5974..6955355ed4 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -197,6 +197,8 @@ public:
void loadWizCursor(int resId, int palette);
void captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType);
+ void captureImage(uint8 *src, int srcPitch, int srcw, int srch, int resNum, const Common::Rect& r, int compType);
+ void captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int id2);
void displayWizComplexImage(const WizParameters *params);
void displayWizImage(WizImage *pwi);
void processWizImage(const WizParameters *params);
@@ -205,6 +207,7 @@ public:
void drawWizPolygon(int resNum, int state, int id, int flags, int shadow, int dstResNum, int palette);
void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int palette);
void drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int flags, int shadow, int dstResNum, int palette);
+ void drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstpitch, int dstType, int dstw, int dsth, int wizW, int wizH, Common::Rect &bound, Common::Point *wp, uint8 bitDepth);
static void copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr);
--
cgit v1.2.3
From 2a1a1576f225e5d20d3b9049160d209ffb1828be Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Mon, 22 Jun 2009 00:35:08 +0000
Subject: Cleanup.
svn-id: r41737
---
engines/scumm/he/wiz_he.cpp | 62 ++++++++++++++++++++-------------------------
engines/scumm/he/wiz_he.h | 2 +-
2 files changed, 29 insertions(+), 35 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 5fbc12626e..b6bce15496 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1297,7 +1297,6 @@ static int wizPackType0(uint8 *dst, const uint8 *src, int srcPitch, const Common
}
void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, int compType) {
- debug(0, "captureWizImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom);
uint8 *src = NULL;
VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
if (backBuffer) {
@@ -1309,6 +1308,7 @@ void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, in
}
void Wiz::captureImage(uint8 *src, int srcPitch, int srcw, int srch, int resNum, const Common::Rect& r, int compType) {
+ debug(0, "captureImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom);
Common::Rect rCapt(srcw, srch);
if (rCapt.intersects(r)) {
rCapt.clip(r);
@@ -1675,62 +1675,56 @@ struct PolygonDrawData {
}
};
-void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int id2) {
- debug(0, "captureWizPolygon: resNum %d, maskNum %d maskState %d, id1 %d id2 %d\n", resNum, maskNum, maskState, id1, id2);
+void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int id2, int compType) {
+ debug(0, "captureWizPolygon: resNum %d, maskNum %d maskState %d, id1 %d id2 %d compType %d", resNum, maskNum, maskState, id1, id2, compType);
int i, j;
- VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
- WizPolygon *wp1, *wp2;
- const uint16 transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
+ WizPolygon *wp;
- wp1 = NULL;
+ wp = NULL;
for (i = 0; i < ARRAYSIZE(_polygons); ++i) {
if (_polygons[i].id == id1) {
- wp1 = &_polygons[i];
+ wp = &_polygons[i];
break;
}
}
- if (!wp1) {
- error("Polygon %d is not defined", id1);
+ if (!wp) {
+ error("Polygon1 %d is not defined", id1);
}
- if (wp1->numVerts != 5) {
- error("Invalid point count %d for Polygon %d", wp1->numVerts, id1);
+ if (wp->numVerts != 5) {
+ error("Invalid point count %d for Polygon1 %d", wp->numVerts, id1);
}
- wp2 = NULL;
+ wp = NULL;
for (i = 0; i < ARRAYSIZE(_polygons); ++i) {
if (_polygons[i].id == id2) {
- wp2 = &_polygons[i];
+ wp = &_polygons[i];
break;
}
}
- if (!wp2) {
- error("Polygon %d is not defined", id2);
+ if (!wp) {
+ error("Polygon2 %d is not defined", id2);
}
- if (wp2->numVerts != 5) {
- error("Invalid point count %d for Polygon %d", wp2->numVerts, id2);
+ if (wp->numVerts != 5) {
+ error("Invalid point count %d for Polygon2 %d", wp->numVerts, id2);
}
int32 dstw, dsth, dstpitch;
int32 srcw, srch;
uint8 *imageBuffer;
- const uint8 *src = pvs->getPixels(0, 0);
- if (maskNum) {
- const Common::Rect *r = NULL;
- src = drawWizImage(maskNum, maskState, 0, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
- getWizImageDim(maskNum, maskState, srcw, srch);
- } else {
- srcw = pvs->w;
- srch = pvs->h;
- }
+ assert(maskNum);
+ const Common::Rect *r = NULL;
+ const uint8 *src = drawWizImage(maskNum, maskState, 0, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
+ getWizImageDim(maskNum, maskState, srcw, srch);
- dstw = wp2->bound.width();
- dsth = wp2->bound.height();
- dstpitch = wp2->bound.width() * _vm->_bitDepth;
- imageBuffer = (uint8 *)malloc(wp2->bound.width() * wp2->bound.height() * _vm->_bitDepth);
+ dstw = wp->bound.width();
+ dsth = wp->bound.height();
+ dstpitch = dstw * _vm->_bitDepth;
+ imageBuffer = (uint8 *)malloc(dstw * dsth * _vm->_bitDepth);
assert(imageBuffer);
+ const uint16 transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
if (_vm->_bitDepth == 2) {
uint8 *tmpPtr = imageBuffer;
for (i = 0; i < dsth; i++) {
@@ -1743,9 +1737,9 @@ void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int
}
Common::Rect bound;
- drawWizPolygonImage(imageBuffer, src, NULL, dstpitch, kDstMemory, dstw, dsth, srcw, srch, bound, wp2->vert, _vm->_bitDepth);
+ drawWizPolygonImage(imageBuffer, src, NULL, dstpitch, kDstMemory, dstw, dsth, srcw, srch, bound, wp->vert, _vm->_bitDepth);
- captureImage(imageBuffer, dstpitch, dstw, dsth, resNum, wp2->bound, (_vm->_bitDepth == 2) ? 2 : 0);
+ captureImage(imageBuffer, dstpitch, dstw, dsth, resNum, wp->bound, compType);
free(imageBuffer);
}
@@ -2417,7 +2411,7 @@ void Wiz::processWizImage(const WizParameters *params) {
break;
// HE 99+
case 7:
- captureWizPolygon(params->img.resNum, params->sourceImage, params->img.state, params->polygonId1, params->polygonId2);
+ captureWizPolygon(params->img.resNum, params->sourceImage, params->img.state, params->polygonId1, params->polygonId2, params->compType);
break;
case 8: {
int img_w = 640;
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index 6955355ed4..d8f984f710 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -198,7 +198,7 @@ public:
void captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType);
void captureImage(uint8 *src, int srcPitch, int srcw, int srch, int resNum, const Common::Rect& r, int compType);
- void captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int id2);
+ void captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int id2, int compType);
void displayWizComplexImage(const WizParameters *params);
void displayWizImage(WizImage *pwi);
void processWizImage(const WizParameters *params);
--
cgit v1.2.3
From a937dfde96b35738b916e4299cc4e917fc6d2d9e Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Mon, 22 Jun 2009 11:00:53 +0000
Subject: Fix loading/saving in funshop titles.
svn-id: r41764
---
engines/scumm/he/script_v72he.cpp | 5 ++--
engines/scumm/he/wiz_he.cpp | 48 +++++++++++++++++++++++----------------
2 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 3c55818ece..9d5bd0b23d 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1482,6 +1482,7 @@ void ScummEngine_v72he::o72_readFile() {
fetchScriptByte();
size = pop();
slot = pop();
+ assert(_hInFileTable[slot]);
val = readFileToArray(slot, size);
push(val);
break;
@@ -1809,9 +1810,7 @@ void ScummEngine_v72he::o72_readINI() {
switch (subOp) {
case 43: // HE 100
case 6: // number
- if (!strcmp((char *)option, "NoFontsInstalled")) {
- push(1);
- } else if (!strcmp((char *)option, "NoPrinting")) {
+ if (!strcmp((char *)option, "NoPrinting")) {
push(1);
} else if (!strcmp((char *)option, "TextOn")) {
push(ConfMan.getBool("subtitles"));
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index b6bce15496..2e414f2a1e 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -2323,7 +2323,7 @@ void Wiz::remapWizImagePal(const WizParameters *params) {
}
void Wiz::processWizImage(const WizParameters *params) {
- byte filename[260];
+ byte buffer[260];
debug(3, "processWizImage: processMode %d", params->processMode);
switch (params->processMode) {
@@ -2338,18 +2338,28 @@ void Wiz::processWizImage(const WizParameters *params) {
break;
case 3:
if (params->processFlags & kWPFUseFile) {
- Common::File f;
+ Common::SeekableReadStream *f = NULL;
+ memcpy(buffer, params->filename, 260);
+ const char *filename = (char *)buffer + _vm->convertFilePath(buffer);
- memcpy(filename, params->filename, 260);
- _vm->convertFilePath(filename);
+ if (!_vm->_saveFileMan->listSavefiles(filename).empty()) {
+ f = _vm->_saveFileMan->openForLoading(filename);
+ } else {
+ Common::File *nf = new Common::File();
+ nf->open(filename);
+ if (!nf->isOpen())
+ delete nf;
+ else
+ f = nf;
+ }
- if (f.open((const char *)filename)) {
- uint32 id = f.readUint32BE();
+ if (f) {
+ uint32 id = f->readUint32BE();
if (id == MKID_BE('AWIZ') || id == MKID_BE('MULT')) {
- uint32 size = f.readUint32BE();
- f.seek(0, SEEK_SET);
+ uint32 size = f->readUint32BE();
+ f->seek(0, SEEK_SET);
byte *p = _vm->_res->createResource(rtImage, params->img.resNum, size);
- if (f.read(p, size) != size) {
+ if (f->read(p, size) != size) {
_vm->_res->nukeResource(rtImage, params->img.resNum);
error("i/o error when reading '%s'", filename);
_vm->VAR(_vm->VAR_GAME_LOADED) = -2;
@@ -2363,7 +2373,7 @@ void Wiz::processWizImage(const WizParameters *params) {
_vm->VAR(_vm->VAR_GAME_LOADED) = -1;
_vm->VAR(119) = -1;
}
- f.close();
+ delete f;
} else {
_vm->VAR(_vm->VAR_GAME_LOADED) = -3;
_vm->VAR(119) = -3;
@@ -2373,7 +2383,9 @@ void Wiz::processWizImage(const WizParameters *params) {
break;
case 4:
if (params->processFlags & kWPFUseFile) {
- Common::DumpFile f;
+ Common::OutSaveFile *f;
+ memcpy(buffer, params->filename, 260);
+ const char *filename = (char *)buffer + _vm->convertFilePath(buffer);
switch (params->fileWriteMode) {
case 2:
@@ -2383,22 +2395,20 @@ void Wiz::processWizImage(const WizParameters *params) {
// TODO Write image to file
break;
case 0:
- memcpy(filename, params->filename, 260);
- _vm->convertFilePath(filename);
-
- if (!f.open((const char *)filename)) {
+ if (!(f = _vm->_saveFileMan->openForSaving(filename))) {
debug(0, "Unable to open for write '%s'", filename);
_vm->VAR(119) = -3;
} else {
byte *p = _vm->getResourceAddress(rtImage, params->img.resNum);
uint32 size = READ_BE_UINT32(p + 4);
- if (f.write(p, size) != size) {
- error("i/o error when writing '%s'", params->filename);
+ if (f->write(p, size) != size) {
+ error("i/o error when writing '%s'", filename);
_vm->VAR(119) = -2;
} else {
_vm->VAR(119) = 0;
}
- f.close();
+ f->finalize();
+ delete f;
}
break;
default:
@@ -2411,7 +2421,7 @@ void Wiz::processWizImage(const WizParameters *params) {
break;
// HE 99+
case 7:
- captureWizPolygon(params->img.resNum, params->sourceImage, params->img.state, params->polygonId1, params->polygonId2, params->compType);
+ captureWizPolygon(params->img.resNum, params->sourceImage, (params->processFlags & kWPFNewState) ? params->img.state : 0, params->polygonId1, params->polygonId2, params->compType);
break;
case 8: {
int img_w = 640;
--
cgit v1.2.3
From 7c622423157e29b7206ba0c39a7756443ed1e70d Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 23 Jun 2009 02:02:51 +0000
Subject: Merged format initialization into InitSize to allow for backends not
supporting gfx transactions.
svn-id: r41801
---
backends/platform/sdl/graphics.cpp | 21 ++++++++++-----------
backends/platform/sdl/sdl.h | 10 +++-------
base/main.cpp | 3 ---
common/system.h | 30 +++++++++++++-----------------
engines/engine.cpp | 5 +++--
5 files changed, 29 insertions(+), 40 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index a08239d472..b5ec9b9db8 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -353,23 +353,22 @@ int OSystem_SDL::getGraphicsMode() const {
assert (_transactionMode == kTransactionNone);
return _videoMode.mode;
}
-#ifdef ENABLE_RGB_COLOR
-void OSystem_SDL::initFormat(Graphics::PixelFormat format) {
+
+void OSystem_SDL::initSize(uint w, uint h, Graphics::PixelFormat format) {
assert(_transactionMode == kTransactionActive);
+#ifdef ENABLE_RGB_COLOR
//avoid redundant format changes
- if (format == _videoMode.format)
- return;
+ assert(format.bytesPerPixel > 0);
- _videoMode.format = format;
- _transactionDetails.formatChanged = true;
- _screenFormat = format;
-}
+ if (format != _videoMode.format)
+ {
+ _videoMode.format = format;
+ _transactionDetails.formatChanged = true;
+ _screenFormat = format;
+ }
#endif
-void OSystem_SDL::initSize(uint w, uint h) {
- assert(_transactionMode == kTransactionActive);
-
// Avoid redundant res changes
if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
return;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index aee15fcbd0..db855094cb 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -82,10 +82,6 @@ public:
TransactionError endGFXTransaction(void);
#ifdef ENABLE_RGB_COLOR
- // Set the depth and format of the video bitmap
- // Typically, CLUT8
- virtual void initFormat(Graphics::PixelFormat format);
-
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
@@ -108,9 +104,9 @@ public:
}
#endif
- // Set the size of the video bitmap.
- // Typically, 320x200
- virtual void initSize(uint w, uint h); // overloaded by CE backend
+ // Set the size and format of the video bitmap.
+ // Typically, 320x200 CLUT8
+ virtual void initSize(uint w, uint h, Graphics::PixelFormat format); // overloaded by CE backend
virtual int getScreenChangeID() const { return _screenChangeCount; }
diff --git a/base/main.cpp b/base/main.cpp
index 3bbe6ddd9c..dba4aeccaa 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -226,9 +226,6 @@ static void setupGraphics(OSystem &system) {
// Set the user specified graphics mode (if any).
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
-#ifdef ENABLE_RGB_COLOR
- system.initFormat(Graphics::PixelFormat::createFormatCLUT8());
-#endif
system.initSize(320, 200);
if (ConfMan.hasKey("aspect_ratio"))
diff --git a/common/system.h b/common/system.h
index 6846b7b9dd..1f91fc900d 100644
--- a/common/system.h
+++ b/common/system.h
@@ -344,21 +344,6 @@ public:
virtual int getGraphicsMode() const = 0;
#ifdef ENABLE_RGB_COLOR
- /**
- * Set the color format of the virtual screen. Typical formats include:
- * CLUT8 (e.g. 256 color, for most games)
- * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
- * RGB565 (e.g. 16-bit color, for Urban Runner)
- *
- * This is the pixel format for which the client code generates data;
- * this is not necessarily equal to the hardware pixel format. For example,
- * a backend may perform color lookup of 8-bit graphics before pushing
- * a screen to hardware, or correct the ARGB color order.
- *
- * @param format A pixel format that the backend screen will use
- */
- virtual void initFormat(Graphics::PixelFormat format) = 0;
-
/**
* Returns the pixel format of the screen.
* @see Graphics::PixelFormat
@@ -373,7 +358,7 @@ public:
#endif
/**
- * Set the size of the virtual screen. Typical sizes include:
+ * Set the size and color format of the virtual screen. Typical sizes include:
* - 320x200 (e.g. for most SCUMM games, and Simon)
* - 320x240 (e.g. for FM-TOWN SCUMM games)
* - 640x480 (e.g. for Curse of Monkey Island)
@@ -384,10 +369,21 @@ public:
* GraphicsMode); stretch the data to perform aspect ratio correction;
* or shrink it to fit on small screens (in cell phones).
*
+ * Typical formats include:
+ * CLUT8 (e.g. 256 color, for most games)
+ * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
+ * RGB565 (e.g. 16-bit color, for Urban Runner)
+ *
+ * This is the pixel format for which the client code generates data;
+ * this is not necessarily equal to the hardware pixel format. For example,
+ * a backend may perform color lookup of 8-bit graphics before pushing
+ * a screen to hardware, or correct the ARGB color order.
+ *
* @param width the new virtual screen width
* @param height the new virtual screen height
+ * @param format the new virtual screen pixel format
*/
- virtual void initSize(uint width, uint height) = 0;
+ virtual void initSize(uint width, uint height, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0;
/**
* Return an int value which is changed whenever any screen
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 15c6820f22..7a76de36dc 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -135,9 +135,10 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::Pixel
initCommonGFX(defaultTo1xScaler);
#ifdef ENABLE_RGB_COLOR
- g_system->initFormat(format);
-#endif
+ g_system->initSize(width, height, format);
+#else
g_system->initSize(width, height);
+#endif
OSystem::TransactionError gfxError = g_system->endGFXTransaction();
--
cgit v1.2.3
From a44859e01bead5a30d8446a5bc75857d000199d9 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Tue, 23 Jun 2009 14:06:57 +0000
Subject: Fix error in Backyard Soccer 2004, when using Season Play.
svn-id: r41808
---
engines/scumm/he/script_v100he.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 60db9adefb..58a858ede4 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -1574,7 +1574,10 @@ void ScummEngine_v100he::o100_roomOps() {
case 130:
a = pop();
b = pop();
- copyPalColor(a, b);
+ if (_game.features & GF_16BIT_COLOR)
+ copyHEPaletteColor(1, a, b);
+ else
+ copyPalColor(a, b);
break;
case 131: // SO_ROOM_FADE
--
cgit v1.2.3
From 4a380dc0d8b1a75fa31e0b4511e03b0782b43f89 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Tue, 23 Jun 2009 20:46:38 +0000
Subject: ENABLE_16BIT has been renamed to ENABLE_RGB_COLOR as of r41696, so
make sure the Groovie engine uses that too
svn-id: r41817
---
engines/groovie/groovie.cpp | 2 +-
engines/groovie/groovie.h | 2 +-
engines/groovie/roq.cpp | 14 +++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 5d89799648..c1826e12ce 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -72,7 +72,7 @@ Common::Error GroovieEngine::run() {
// Initialize the graphics
switch (_gameDescription->version) {
case kGroovieV2:
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_pixelFormat = _system->getBestFormat();
initGraphics(640, 480, true, _pixelFormat);
break;
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index adc6986a87..3f7f7cb0ed 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -85,7 +85,7 @@ protected:
public:
void waitForInput();
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat _pixelFormat;
#endif
Script _script;
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 95acb64f6a..56237655e9 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -29,7 +29,7 @@
#include "groovie/groovie.h"
#include "groovie/roq.h"
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
// Required for the YUV to RGB conversion
#include "graphics/dither.h"
#endif
@@ -47,7 +47,7 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
_currBuf = new Graphics::Surface();
_prevBuf = new Graphics::Surface();
-#ifndef ENABLE_16BIT
+#ifndef ENABLE_RGB_COLOR
byte pal[256 * 4];
#ifdef DITHER
byte pal3[256 * 3];
@@ -92,7 +92,7 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
#endif // DITHER
_syst->setPalette(pal, 0, 256);
-#endif // !ENABLE_16BIT
+#endif // !ENABLE_RGB_COLOR
}
ROQPlayer::~ROQPlayer() {
@@ -160,7 +160,7 @@ void ROQPlayer::buildShowBuf() {
byte *out = (byte *)_showBuf.getBasePtr(0, line);
byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _showBuf.w; x++) {
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
// Do the format conversion (YUV -> RGB -> Screen format)
byte r, g, b;
Graphics::PaletteLUT::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
@@ -169,7 +169,7 @@ void ROQPlayer::buildShowBuf() {
// Skip to the next pixel
out += _vm->_pixelFormat.bytesPerPixel;
-#else // !ENABLE_16BIT
+#else // !ENABLE_RGB_COLOR
#ifdef DITHER
*out = _dither->dither(*in, *(in + 1), *(in + 2), x);
#else
@@ -178,7 +178,7 @@ void ROQPlayer::buildShowBuf() {
#endif // DITHER
// Skip to the next pixel
out++;
-#endif // ENABLE_16BIT
+#endif // ENABLE_RGB_COLOR
if (!(x % _scaleX))
in += _prevBuf->bytesPerPixel;
@@ -335,7 +335,7 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
// Allocate new buffers
_currBuf->create(width, height, 3);
_prevBuf->create(width, height, 3);
-#ifdef ENABLE_16BIT
+#ifdef ENABLE_RGB_COLOR
_showBuf.create(width * _scaleX, height * _scaleY, _vm->_pixelFormat.bytesPerPixel);
#else
_showBuf.create(width * _scaleX, height * _scaleY, 1);
--
cgit v1.2.3
From 865129a5630017f05d08e778ba1ef430c23cd55a Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 24 Jun 2009 06:44:30 +0000
Subject: made the cursor's pixel format a member of the cursor object, merged
____CursorFormat functions into equivalent ____Cursor functions.
svn-id: r41825
---
backends/platform/sdl/graphics.cpp | 4 ++-
backends/platform/sdl/sdl.h | 2 +-
common/system.h | 3 +-
engines/scumm/cursor.cpp | 9 +++--
graphics/cursorman.cpp | 70 ++++++--------------------------------
graphics/cursorman.h | 51 +++++++--------------------
gui/GuiManager.cpp | 14 --------
gui/ThemeEngine.cpp | 9 -----
8 files changed, 36 insertions(+), 126 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index b5ec9b9db8..d7cabd00cc 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1378,8 +1378,10 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
}
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format) {
#ifdef ENABLE_RGB_COLOR
+ if (format.bytesPerPixel <= _screenFormat.bytesPerPixel)
+ _cursorFormat = format;
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
keycolor &= 0xFF;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index db855094cb..7aeebf9264 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -135,7 +135,7 @@ public:
virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)
// Set the bitmap that's used when drawing the cursor.
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME)
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format); // overloaded by CE backend (FIXME)
#ifdef ENABLE_RGB_COLOR
virtual void setCursorFormat(Graphics::PixelFormat format);
#endif
diff --git a/common/system.h b/common/system.h
index 1f91fc900d..fad9cf378a 100644
--- a/common/system.h
+++ b/common/system.h
@@ -714,8 +714,9 @@ public:
* @param hotspotY vertical offset from the top side to the hotspot
* @param keycolor transparency color index
* @param cursorTargetScale scale factor which cursor is designed for
+ * @param format pixel format which cursor graphic uses
*/
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1) = 0;
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0;
#ifdef ENABLE_RGB_COLOR
virtual void setCursorFormat(Graphics::PixelFormat format) = 0;
#endif
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 5c695e58a5..190c337c63 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -113,12 +113,17 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
#ifdef ENABLE_RGB_COLOR
- CursorMan.replaceCursorFormat(_system->getScreenFormat());
-#endif
+ CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
+ _cursor.hotspotX, _cursor.hotspotY,
+ (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+ (_game.heversion == 70 ? 2 : 1),
+ _system->getScreenFormat());
+#else
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
(_game.heversion == 70 ? 2 : 1));
+#endif
}
void ScummEngine_v6::grabCursor(int x, int y, int w, int h) {
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 865c7515f0..76ebb9b455 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -57,14 +57,14 @@ bool CursorManager::showMouse(bool visible) {
return g_system->showMouse(visible);
}
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
- Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat format) {
+ Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
cur->_visible = isVisible();
_cursorStack.push(cur);
if (buf) {
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
}
}
@@ -77,7 +77,7 @@ void CursorManager::popCursor() {
if (!_cursorStack.empty()) {
cur = _cursorStack.top();
- g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale);
+ g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_format);
}
g_system->showMouse(isVisible());
@@ -97,27 +97,20 @@ void CursorManager::popAllCursors() {
}
}
-#ifdef ENABLE_RGB_COLOR
- while (!_cursorFormatStack.empty()) {
- PixelFormat *form = _cursorFormatStack.pop();
- delete form;
- }
-#endif
-
g_system->showMouse(isVisible());
}
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
+void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat format) {
if (_cursorStack.empty()) {
- pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
return;
}
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_RGB_COLOR
- uint size = w * h * g_system->getScreenFormat().bytesPerPixel;
+ uint size = w * h * format.bytesPerPixel;
#else
uint size = w * h;
#endif
@@ -137,8 +130,11 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_hotspotY = hotspotY;
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
+#ifdef ENABLE_RGB_COLOR
+ cur->_format = format;
+#endif
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
}
void CursorManager::disableCursorPalette(bool disable) {
@@ -220,48 +216,4 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu
}
}
-#ifdef ENABLE_RGB_COLOR
-void CursorManager::pushCursorFormat(PixelFormat format) {
-// if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
-// return;
- PixelFormat *form = new PixelFormat(format);
-
- _cursorFormatStack.push(form);
- g_system->setCursorFormat(format);
-}
-
-void CursorManager::popCursorFormat() {
-
- if (_cursorFormatStack.empty())
- return;
-
- PixelFormat *form = _cursorFormatStack.pop();
- delete form;
-
- if (_cursorFormatStack.empty()) {
- g_system->setCursorFormat(g_system->getScreenFormat());
- return;
- }
-
- form = _cursorFormatStack.top();
- disableCursorPalette(form->bytesPerPixel != 1);
-
- g_system->setCursorFormat(*form);
-}
-
-void CursorManager::replaceCursorFormat(PixelFormat format) {
-// if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
-// return;
-
- if (_cursorFormatStack.empty()) {
- pushCursorFormat(format);
- return;
- }
-
- PixelFormat *form = _cursorFormatStack.top();
-
- g_system->setCursorFormat(*form);
-}
-#endif
-
} // End of namespace Graphics
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index b28145d932..1ac711caec 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -28,8 +28,8 @@
#include "common/scummsys.h"
#include "common/stack.h"
#include "common/singleton.h"
-#ifdef ENABLE_RGB_COLOR
#include "graphics/pixelformat.h"
+#ifdef ENABLE_RGB_COLOR
#include "common/system.h"
#endif
@@ -55,12 +55,13 @@ public:
* @param hotspotY the hotspot Y coordinate
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
+ * @param format the pixel format which the cursor graphic uses
*
* @note It is ok for the buffer to be a NULL pointer. It is sometimes
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
+ void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8());
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -80,8 +81,9 @@ public:
* @param hotspotY the hotspot Y coordinate
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
+ * @param format the pixel format which the cursor graphic uses
*/
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8());
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -134,31 +136,6 @@ public:
*/
void replaceCursorPalette(const byte *colors, uint start, uint num);
-#ifdef ENABLE_RGB_COLOR
- /**
- * Push a new cursor pixel format onto the stack, and set it in the backend.
- *
- * @param format the new format data, in a Graphics::PixelFormat
- */
- void pushCursorFormat(PixelFormat format);
-
- /**
- * Pop a cursor pixel format from the stack, and restore the previous one to
- * the backend. If there is no previous format, the screen format is
- * used instead.
- */
- void popCursorFormat();
-
- /**
- * Replace the current cursor pixel format on the stack. If the stack is
- * empty, the format is pushed instead. It's a slightly more optimized
- * way of popping the old format before pushing the new one.
- *
- * @param format the new format data, in a Graphics::PixelFormat
- */
- void replaceCursorFormat(PixelFormat format);
-#endif
-
private:
friend class Common::Singleton;
CursorManager();
@@ -171,18 +148,17 @@ private:
int _hotspotX;
int _hotspotY;
uint32 _keycolor;
-
+#ifdef ENABLE_RGB_COLOR
+ Graphics::PixelFormat _format;
+#endif
byte _targetScale;
-
uint _size;
- Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8) {
+ Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) {
#ifdef ENABLE_RGB_COLOR
- { //limit the lifespan of the format value to minimize impact on memory usage
- Graphics::PixelFormat f = g_system->getScreenFormat();
- _size = w * h * f.bytesPerPixel;
- _keycolor = keycolor & ((1 << (f.bytesPerPixel << 3)) - 1);
- }
+ _size = w * h * format.bytesPerPixel;
+ _keycolor = keycolor & ((1 << (format.bytesPerPixel << 3)) - 1);
+ _format = format;
#else
_size = w * h;
_keycolor = keycolor & 0xFF;
@@ -231,9 +207,6 @@ private:
};
Common::Stack _cursorStack;
Common::Stack _cursorPaletteStack;
-#ifdef ENABLE_RGB_COLOR
- Common::Stack _cursorFormatStack;
-#endif
};
} // End of namespace Graphics
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index 8e161f3e60..cf8b7b2d9d 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -135,9 +135,6 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
delete _theme;
if (_useStdCursor) {
-#ifdef ENABLE_RGB_COLOR
- CursorMan.popCursorFormat();
-#endif
CursorMan.popCursorPalette();
CursorMan.popCursor();
}
@@ -385,9 +382,6 @@ void GuiManager::saveState() {
void GuiManager::restoreState() {
if (_useStdCursor) {
-#ifdef ENABLE_RGB_COLOR
- CursorMan.popCursorFormat();
-#endif
CursorMan.popCursor();
CursorMan.popCursorPalette();
}
@@ -430,14 +424,6 @@ void GuiManager::setupCursor() {
87, 87, 87, 0
};
-#ifdef ENABLE_RGB_COLOR
- Graphics::PixelFormat format;
- format.bytesPerPixel = 1;
- format.rLoss = format.gLoss = format.bLoss = format.aLoss = 8;
- format.rShift = format.gShift = format.bShift = format.aShift = 0;
-
- CursorMan.pushCursorFormat(format);
-#endif
CursorMan.pushCursorPalette(palette, 0, 4);
CursorMan.pushCursor(NULL, 0, 0, 0, 0);
CursorMan.showMouse(true);
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 70b295b989..6041fb8858 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -434,9 +434,6 @@ void ThemeEngine::refresh() {
_system->showOverlay();
if (_useCursor) {
-#ifdef ENABLE_RGB_COLOR
- CursorMan.replaceCursorFormat(_cursorFormat);
-#endif
CursorMan.replaceCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
}
@@ -448,9 +445,6 @@ void ThemeEngine::enable() {
return;
if (_useCursor) {
-#ifdef ENABLE_RGB_COLOR
- CursorMan.pushCursorFormat(_cursorFormat);
-#endif
CursorMan.pushCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.pushCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
CursorMan.showMouse(true);
@@ -468,9 +462,6 @@ void ThemeEngine::disable() {
_system->hideOverlay();
if (_useCursor) {
-#ifdef ENABLE_RGB_COLOR
- CursorMan.popCursorFormat();
-#endif
CursorMan.popCursorPalette();
CursorMan.popCursor();
}
--
cgit v1.2.3
From 53eb83dc95b825b2bf4f5f3943e8f10d9add3aa6 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Thu, 25 Jun 2009 08:55:16 +0000
Subject: API modification -- replaced "Graphics::PixelFormat getBestFormat()"
with "Common::List getSupportedFormats()"
svn-id: r41854
---
backends/platform/sdl/sdl.h | 41 +++++++++++++++++++++++++++++------------
common/system.h | 24 +++++++++++++++++++++---
engines/groovie/groovie.cpp | 2 +-
3 files changed, 51 insertions(+), 16 deletions(-)
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 7aeebf9264..efe1984446 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -86,21 +86,38 @@ public:
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
// Highest supported
- virtual Graphics::PixelFormat getBestFormat() const {
- //TODO scale down 16/32 bit based on hardware support
- {
- SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt;
+ virtual Common::List getSupportedFormats() const {
+ //TODO determine hardware color component order
+ Common::List list;
+ SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt;
#ifdef ENABLE_32BIT
- if (HWFormat->BitsPerPixel >= 32)
- return Graphics::PixelFormat::createFormatRGBA8888();
- if (HWFormat->BitsPerPixel >= 24)
- return Graphics::
- FormatRGB888();
+ if (HWFormat->BitsPerPixel >= 32)
+ {
+ list.push_back(Graphics::PixelFormat::createFormatRGBA8888());
+ list.push_back(Graphics::PixelFormat::createFormatARGB8888());
+ list.push_back(Graphics::PixelFormat::createFormatABGR8888());
+ list.push_back(Graphics::PixelFormat::createFormatBGRA8888()); }
+ if (HWFormat->BitsPerPixel >= 24)
+ {
+ list.push_back(Graphics::PixelFormat::createFormatRGB888());
+ list.push_back(Graphics::PixelFormat::createFormatBGR888());
+ }
#endif //ENABLE_32BIT
- if (HWFormat->BitsPerPixel >= 16)
- return Graphics::PixelFormat::createFormatRGB565();
+ if (HWFormat->BitsPerPixel >= 16)
+ {
+ list.push_back(Graphics::PixelFormat::createFormatRGB565());
+ list.push_back(Graphics::PixelFormat::createFormatXRGB1555());
+ list.push_back(Graphics::PixelFormat::createFormatRGB555());
+ list.push_back(Graphics::PixelFormat::createFormatRGBA4444());
+ list.push_back(Graphics::PixelFormat::createFormatARGB4444());
+ list.push_back(Graphics::PixelFormat::createFormatBGR565());
+ list.push_back(Graphics::PixelFormat::createFormatXBGR1555());
+ list.push_back(Graphics::PixelFormat::createFormatBGR555());
+ list.push_back(Graphics::PixelFormat::createFormatABGR4444());
+ list.push_back(Graphics::PixelFormat::createFormatBGRA4444());
}
- return Graphics::PixelFormat::createFormatCLUT8();
+ list.push_back(Graphics::PixelFormat::createFormatCLUT8());
+ return list;
}
#endif
diff --git a/common/system.h b/common/system.h
index fad9cf378a..af672a505e 100644
--- a/common/system.h
+++ b/common/system.h
@@ -345,16 +345,34 @@ public:
#ifdef ENABLE_RGB_COLOR
/**
- * Returns the pixel format of the screen.
+ * Determine the pixel format currently in use for screen rendering.
+ * @return the active screen pixel format.
* @see Graphics::PixelFormat
*/
virtual Graphics::PixelFormat getScreenFormat() const = 0;
/**
- * Returns the highest color pixel format supported by the backend
+ * Returns a list of all pixel formats supported by the backend.
+ * The first item in the list must be directly supported by hardware,
+ * and provide the largest color space of those formats with direct
+ * hardware support. It is also strongly recommended that remaining
+ * formats should be placed in order of descending preference for the
+ * backend to use.
+ *
+ * EG: a backend that supports 32-bit ABGR and 16-bit 555 BGR in hardware
+ * and provides conversion from equivalent RGB(A) modes should order its list
+ * 1) Graphics::PixelFormat::createFormatABGR8888()
+ * 2) Graphics::PixelFormat::createFormatBGR555()
+ * 3) Graphics::PixelFormat::createFormatRGBA8888()
+ * 4) Graphics::PixelFormat::createFormatRGB555()
+ * 5) Graphics::PixelFormat::createFormatCLUT8()
+ *
* @see Graphics::PixelFormat
+ *
+ * @note All backends supporting RGB color must be able to accept game data
+ * in RGB color order, even if hardware uses BGR or some other color order.
*/
- virtual Graphics::PixelFormat getBestFormat() const = 0;
+ virtual Common::List getSupportedFormats() const = 0;
#endif
/**
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index c1826e12ce..5b1a139dbe 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -73,7 +73,7 @@ Common::Error GroovieEngine::run() {
switch (_gameDescription->version) {
case kGroovieV2:
#ifdef ENABLE_RGB_COLOR
- _pixelFormat = _system->getBestFormat();
+ _pixelFormat = _system->getSupportedFormats().front();
initGraphics(640, 480, true, _pixelFormat);
break;
#endif
--
cgit v1.2.3
From dc873f5e89f2622a8e4d3857a28971f30db932e0 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Thu, 25 Jun 2009 08:56:00 +0000
Subject: added preprocessor defines for ENABLE_RGB_COLOR and
GROOVIE_EXPERIMENTAL to groovie msvc8 project
svn-id: r41855
---
dists/msvc8/groovie.vcproj | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dists/msvc8/groovie.vcproj b/dists/msvc8/groovie.vcproj
index 14ab5726fc..e6e7e792ba 100644
--- a/dists/msvc8/groovie.vcproj
+++ b/dists/msvc8/groovie.vcproj
@@ -1,7 +1,7 @@
-
+
--
cgit v1.2.3
From 2859c9130462e66df705d534f9a70d1430628be7 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 26 Jun 2009 08:50:11 +0000
Subject: Changed cursor manager functions to take *Graphics::PixelFormat with
default parameter of NULL (and initialize NULL pointers with CLUT8), rather
than taking a Graphics::PixelFormat with default parameter of
Graphics::PixelFormat::createFormatCLUT8()
svn-id: r41900
---
engines/scumm/cursor.cpp | 3 ++-
graphics/cursorman.cpp | 15 +++++++++------
graphics/cursorman.h | 14 ++++++++------
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 190c337c63..66ac68bd95 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -113,11 +113,12 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
#ifdef ENABLE_RGB_COLOR
+ Graphics::PixelFormat format = _system->getScreenFormat();
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
(_game.heversion == 70 ? 2 : 1),
- _system->getScreenFormat());
+ &format);
#else
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 76ebb9b455..574950a09b 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -57,14 +57,14 @@ bool CursorManager::showMouse(bool visible) {
return g_system->showMouse(visible);
}
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat format) {
+void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat *format) {
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
cur->_visible = isVisible();
_cursorStack.push(cur);
if (buf) {
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format);
}
}
@@ -100,7 +100,7 @@ void CursorManager::popAllCursors() {
g_system->showMouse(isVisible());
}
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat format) {
+void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat *format) {
if (_cursorStack.empty()) {
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
@@ -110,7 +110,10 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_RGB_COLOR
- uint size = w * h * format.bytesPerPixel;
+ if (!format)
+ format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+
+ uint size = w * h * format->bytesPerPixel;
#else
uint size = w * h;
#endif
@@ -131,10 +134,10 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
#ifdef ENABLE_RGB_COLOR
- cur->_format = format;
+ cur->_format = *format;
#endif
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format);
}
void CursorManager::disableCursorPalette(bool disable) {
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 1ac711caec..2b2f34f952 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -61,7 +61,7 @@ public:
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8());
+ void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL);
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -83,7 +83,7 @@ public:
* @param targetScale the scale for which the cursor is designed
* @param format the pixel format which the cursor graphic uses
*/
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8());
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL);
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -154,11 +154,13 @@ private:
byte _targetScale;
uint _size;
- Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) {
+ Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
- _size = w * h * format.bytesPerPixel;
- _keycolor = keycolor & ((1 << (format.bytesPerPixel << 3)) - 1);
- _format = format;
+ if (!format)
+ format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+ _size = w * h * format->bytesPerPixel;
+ _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
+ _format = *format;
#else
_size = w * h;
_keycolor = keycolor & 0xFF;
--
cgit v1.2.3
From 27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 26 Jun 2009 10:37:00 +0000
Subject: Converted OSystem::SetMouseCursor to take pointer to PixelFormat,
instead of full PixelFormat. Removed OSystem::setCursorFormat (since I forgot
to do so several commits ago)
svn-id: r41901
---
backends/platform/sdl/graphics.cpp | 18 ++++++------------
backends/platform/sdl/sdl.h | 5 +----
common/system.h | 8 ++------
graphics/cursorman.cpp | 6 +++---
4 files changed, 12 insertions(+), 25 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index d7cabd00cc..f6b4d76418 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1162,15 +1162,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
}
_cursorPaletteDisabled = false;
-#ifdef ENABLE_RGB_COLOR
-}
-
-void OSystem_SDL::setCursorFormat(Graphics::PixelFormat format) {
- assert(format.bytesPerPixel);
- _cursorFormat = format;
-
-#endif
-// blitCursor();
+ blitCursor();
}
@@ -1378,10 +1370,12 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
}
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format) {
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format) {
#ifdef ENABLE_RGB_COLOR
- if (format.bytesPerPixel <= _screenFormat.bytesPerPixel)
- _cursorFormat = format;
+ if (!format)
+ format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+ if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
+ _cursorFormat = *format;
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
keycolor &= 0xFF;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index efe1984446..2048b7f536 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -152,10 +152,7 @@ public:
virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)
// Set the bitmap that's used when drawing the cursor.
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format); // overloaded by CE backend (FIXME)
-#ifdef ENABLE_RGB_COLOR
- virtual void setCursorFormat(Graphics::PixelFormat format);
-#endif
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format); // overloaded by CE backend (FIXME)
// Set colors of cursor palette
void setCursorPalette(const byte *colors, uint start, uint num);
diff --git a/common/system.h b/common/system.h
index af672a505e..28947d00c5 100644
--- a/common/system.h
+++ b/common/system.h
@@ -732,13 +732,9 @@ public:
* @param hotspotY vertical offset from the top side to the hotspot
* @param keycolor transparency color index
* @param cursorTargetScale scale factor which cursor is designed for
- * @param format pixel format which cursor graphic uses
+ * @param format pointer to the pixel format which cursor graphic uses
*/
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0;
-#ifdef ENABLE_RGB_COLOR
- virtual void setCursorFormat(Graphics::PixelFormat format) = 0;
-#endif
-
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat *format = NULL) = 0;
/**
* Replace the specified range of cursor the palette with new colors.
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 574950a09b..bf6de44fbf 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -64,7 +64,7 @@ void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, in
_cursorStack.push(cur);
if (buf) {
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format);
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
}
}
@@ -77,7 +77,7 @@ void CursorManager::popCursor() {
if (!_cursorStack.empty()) {
cur = _cursorStack.top();
- g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_format);
+ g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, &(cur->_format));
}
g_system->showMouse(isVisible());
@@ -137,7 +137,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_format = *format;
#endif
- g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format);
+ g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
}
void CursorManager::disableCursorPalette(bool disable) {
--
cgit v1.2.3
From 70c9731810b28e910270429b2e5d16e2fe92f604 Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Fri, 26 Jun 2009 22:30:52 +0000
Subject: SCI: starting to restore RGB color functionality
svn-id: r41904
---
engines/sci/gfx/gfx_driver.cpp | 66 ++++++++++++++++++++++++++----------
engines/sci/gfx/gfx_driver.h | 7 ++--
engines/sci/gfx/gfx_pixmap_scale.cpp | 5 +--
engines/sci/gfx/gfx_resmgr.cpp | 3 +-
engines/sci/gfx/gfx_system.h | 3 ++
engines/sci/gfx/gfx_tools.cpp | 9 ++---
engines/sci/gfx/operations.cpp | 15 ++++----
engines/sci/gfx/operations.h | 8 ++---
engines/sci/sci.cpp | 10 +++++-
9 files changed, 86 insertions(+), 40 deletions(-)
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index 42be711499..f905244011 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -26,18 +26,19 @@
#include "common/scummsys.h"
#include "common/system.h"
#include "graphics/primitives.h"
+#include "graphics/surface.h"
#include "sci/sci.h"
#include "sci/gfx/gfx_driver.h"
#include "sci/gfx/gfx_tools.h"
+
namespace Sci {
-GfxDriver::GfxDriver(int xfact, int yfact, int bytespp) {
+GfxDriver::GfxDriver(int xfact, int yfact, Graphics::PixelFormat format) {
int i;
- Graphics::PixelFormat format(bytespp, 0, 0, 0, 0, 0, 0, 0, 0);
- _mode = gfx_new_mode(xfact, yfact, format, new Palette(256), 0);
+ _mode = gfx_new_mode(xfact, yfact, format, format.bytesPerPixel == 1 ? new Palette(256) : 0, 0);
_mode->xsize = xfact * 320;
_mode->ysize = yfact * 200;
@@ -50,14 +51,15 @@ GfxDriver::GfxDriver(int xfact, int yfact, int bytespp) {
// create the visual buffers
for (i = 0; i < 2; i++) {
_visual[i] = NULL;
- _visual[i] = new byte[_mode->xsize * _mode->ysize];
+ _visual[i] = new byte[_mode->xsize * _mode->ysize * _mode->bytespp];
if (!_visual[i]) {
error("Out of memory: Could not allocate visual buffers! (%dx%d)\n", _mode->xsize, _mode->ysize);
}
- memset(_visual[i], 0, _mode->xsize * _mode->ysize);
+ memset(_visual[i], 0, _mode->xsize * _mode->ysize * _mode->bytespp);
}
- _mode->palette->name = "global";
+ if (_mode->palette)
+ _mode->palette->name = "global";
}
GfxDriver::~GfxDriver() {
@@ -76,10 +78,12 @@ GfxDriver::~GfxDriver() {
// Drawing operations
+template
static void drawProc(int x, int y, int c, void *data) {
GfxDriver *drv = (GfxDriver *)data;
byte *p = drv->getVisual0();
- p[y * 320* drv->getMode()->xfact + x] = c;
+ SIZETYPE col = c << (EXTRA_BYTE_OFFSET * 8);
+ memcpy(p + (y * 320* drv->getMode()->xfact + x) * COPY_BYTES, &col, COPY_BYTES);
}
int GfxDriver::drawLine(Common::Point start, Common::Point end, gfx_color_t color,
@@ -90,6 +94,28 @@ int GfxDriver::drawLine(Common::Point start, Common::Point end, gfx_color_t colo
int xsize = _mode->xsize;
int ysize = _mode->ysize;
+ void (*modeDrawProc)(int,int,int,void*);
+ switch (_mode->bytespp) {
+ case 1:
+ modeDrawProc = drawProc<1, uint8, 0>;
+ break;
+ case 2:
+ modeDrawProc = drawProc<2, uint16, 0>;
+ break;
+ case 3:
+#ifdef SCUMM_BIG_ENDIAN
+ modeDrawProc = drawProc<3, uint32, 1>;
+#else
+ modeDrawProc = drawProc<3, uint32, 0>;
+#endif
+ break;
+ case 4:
+ modeDrawProc = drawProc<4, uint32, 0>;
+ break;
+ default:
+ GFXERROR("Invalid mode->bytespp=%d\n", _mode->bytespp);
+ }
+
if (color.mask & GFX_MASK_VISUAL) {
Common::Point nstart, nend;
@@ -101,7 +127,7 @@ int GfxDriver::drawLine(Common::Point start, Common::Point end, gfx_color_t colo
nend.x = CLIP(end.x + xc, 0, xsize - 1);
nend.y = CLIP(end.y + yc, 0, ysize - 1);
- Graphics::drawLine(nstart.x, nstart.y, nend.x, nend.y, scolor, drawProc, this);
+ Graphics::drawLine(nstart.x, nstart.y, nend.x, nend.y, scolor, modeDrawProc, this);
if (color.mask & GFX_MASK_PRIORITY) {
gfx_draw_line_pixmap_i(_priority[0], nstart, nend, color.priority);
@@ -117,7 +143,8 @@ int GfxDriver::drawFilledRect(rect_t rect, gfx_color_t color1, gfx_color_t color
gfx_rectangle_fill_t shade_mode) {
if (color1.mask & GFX_MASK_VISUAL) {
for (int i = rect.y; i < rect.y + rect.height; i++) {
- memset(_visual[0] + i * _mode->xsize + rect.x, color1.visual.parent_index, rect.width);
+ memset(_visual[0] + (i * _mode->xsize + rect.x) * _mode->bytespp,
+ color1.visual.parent_index, rect.width * _mode->bytespp);
}
}
@@ -137,8 +164,10 @@ int GfxDriver::drawPixmap(gfx_pixmap_t *pxm, int priority, rect_t src, rect_t de
return GFX_ERROR;
}
- gfx_crossblit_pixmap(_mode, pxm, priority, src, dest, _visual[bufnr], _mode->xsize,
- _priority[bufnr]->index_data, _priority[bufnr]->index_width, 1, 0);
+ gfx_crossblit_pixmap(_mode, pxm, priority, src, dest, _visual[bufnr],
+ _mode->xsize * _mode->bytespp,
+ _priority[bufnr]->index_data,
+ _priority[bufnr]->index_width, 1, 0);
return GFX_OK;
}
@@ -160,7 +189,9 @@ int GfxDriver::grabPixmap(rect_t src, gfx_pixmap_t *pxm, gfx_map_mask_t map) {
pxm->width = src.width;
pxm->height = src.height;
for (int i = 0; i < src.height; i++) {
- memcpy(pxm->data + i * src.width, _visual[0] + (i + src.y) * _mode->xsize + src.x, src.width);
+ memcpy(pxm->data + i * src.width * _mode->bytespp,
+ _visual[0] + _mode->bytespp * ((i + src.y) * _mode->xsize + src.x),
+ src.width * _mode->bytespp);
}
break;
@@ -192,17 +223,18 @@ int GfxDriver::update(rect_t src, Common::Point dest, gfx_buffer_t buffer) {
switch (buffer) {
case GFX_BUFFER_BACK:
for (int i = 0; i < src.height; i++) {
- memcpy(_visual[0] + (dest.y + i) * _mode->xsize + dest.x,
- _visual[1] + (src.y + i) * _mode->xsize + src.x, src.width);
+ memcpy(_visual[0] + _mode->bytespp * ( (dest.y + i) * _mode->xsize + dest.x),
+ _visual[1] + _mode->bytespp * ( (src.y + i) * _mode->xsize + src.x), src.width * _mode->bytespp );
}
if ((src.x == dest.x) && (src.y == dest.y))
gfx_copy_pixmap_box_i(_priority[0], _priority[1], src);
break;
- case GFX_BUFFER_FRONT:
- g_system->copyRectToScreen(_visual[0] + src.x + src.y * _mode->xsize, _mode->xsize, dest.x, dest.y, src.width, src.height);
+ case GFX_BUFFER_FRONT: {
+ g_system->copyRectToScreen(_visual[0] + _mode->bytespp * (src.x + src.y * _mode->xsize), _mode->xsize * _mode->bytespp, dest.x, dest.y, src.width, src.height);
g_system->updateScreen();
break;
+ }
default:
GFXERROR("Invalid buffer %d in update!\n", buffer);
return GFX_ERROR;
@@ -212,7 +244,7 @@ int GfxDriver::update(rect_t src, Common::Point dest, gfx_buffer_t buffer) {
}
int GfxDriver::setStaticBuffer(gfx_pixmap_t *pic, gfx_pixmap_t *priority) {
- memcpy(_visual[1], pic->data, _mode->xsize * _mode->ysize);
+ memcpy(_visual[1], pic->data, _mode->xsize * _mode->ysize * _mode->bytespp);
gfx_copy_pixmap_box_i(_priority[1], priority, gfx_rect(0, 0, _mode->xsize, _mode->ysize));
return GFX_OK;
diff --git a/engines/sci/gfx/gfx_driver.h b/engines/sci/gfx/gfx_driver.h
index b74511de77..4017dc3918 100644
--- a/engines/sci/gfx/gfx_driver.h
+++ b/engines/sci/gfx/gfx_driver.h
@@ -29,6 +29,8 @@
#include "sci/gfx/gfx_system.h"
#include "sci/uinput.h"
+#include "graphics/pixelformat.h"
+
namespace Sci {
enum gfx_buffer_t {
@@ -66,12 +68,11 @@ class GfxDriver {
public:
/*** Initialization ***/
- GfxDriver(int xfact, int yfact, int bytespp);
+ GfxDriver(int xfact, int yfact, Graphics::PixelFormat mode);
/* Attempts to initialize a specific graphics mode
** Parameters: (int x int) xres, yres: Horizontal and vertical scaling
** factors
- ** (int) bytespp: Any of GFX_COLOR_MODE_*. GFX_COLOR_MODE_INDEX
- ** implies color index mode.
+ ** (PixelFormat) mode: The mode to use
** Returns : (int) GFX_OK on success, GFX_ERROR if the mode could not be
** set, or GFX_FATAL if the graphics target is unuseable.
** The scaling factors apply to the standard SCI resolution of 320x200 pixels
diff --git a/engines/sci/gfx/gfx_pixmap_scale.cpp b/engines/sci/gfx/gfx_pixmap_scale.cpp
index 52c7b12396..37843743b9 100644
--- a/engines/sci/gfx/gfx_pixmap_scale.cpp
+++ b/engines/sci/gfx/gfx_pixmap_scale.cpp
@@ -70,14 +70,11 @@ void _gfx_xlate_pixmap_unfiltered(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale
// Calculate all colors
for (i = 0; i < pxm->colors_nr(); i++) {
int col;
-
const PaletteEntry& color = pxm->palette->getColor(i);
if (mode->palette)
col = color.parent_index;
else {
- col = mode->red_mask & ((EXTEND_COLOR(color.r)) >> mode->red_shift);
- col |= mode->green_mask & ((EXTEND_COLOR(color.g)) >> mode->green_shift);
- col |= mode->blue_mask & ((EXTEND_COLOR(color.b)) >> mode->blue_shift);
+ col = mode->format.ARGBToColor(0, color.r, color.g, color.b);
col |= alpha_ormask;
}
result_colors[i] = col;
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index c5269bc544..229470a658 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -268,7 +268,8 @@ void GfxResManager::setStaticPalette(Palette *newPalette)
_staticPalette = newPalette;
_staticPalette->name = "static palette";
- _staticPalette->mergeInto(_driver->getMode()->palette);
+ if (_driver->getMode()->palette)
+ _staticPalette->mergeInto(_driver->getMode()->palette);
}
#if 0
diff --git a/engines/sci/gfx/gfx_system.h b/engines/sci/gfx/gfx_system.h
index bc25364b92..e1d56ee26d 100644
--- a/engines/sci/gfx/gfx_system.h
+++ b/engines/sci/gfx/gfx_system.h
@@ -30,6 +30,7 @@
#include "common/rect.h"
#include "sci/tools.h"
#include "sci/gfx/palette.h"
+#include "graphics/pixelformat.h"
namespace Sci {
@@ -70,8 +71,10 @@ struct gfx_mode_t {
// Palette mode is only supported for bytespp = 1
/* Color masks */
+ // TODO: remove those
uint32 red_mask, green_mask, blue_mask, alpha_mask;
short red_shift, green_shift, blue_shift, alpha_shift;
+ Graphics::PixelFormat format;
/* Each of the mask/shift pairs describe where the corresponding color
** values are stored for the described mode. Internally, color
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp
index e1378e14d0..4e570f5931 100644
--- a/engines/sci/gfx/gfx_tools.cpp
+++ b/engines/sci/gfx/gfx_tools.cpp
@@ -49,6 +49,7 @@ gfx_mode_t *gfx_new_mode(int xfact, int yfact, const Graphics::PixelFormat &form
mode->xfact = xfact;
mode->yfact = yfact;
mode->bytespp = format.bytesPerPixel;
+ mode->format = format;
// FIXME: I am not sure whether the following assignments are quite right.
// The only code using these are the built-in scalers of the SCI engine.
@@ -60,10 +61,10 @@ gfx_mode_t *gfx_new_mode(int xfact, int yfact, const Graphics::PixelFormat &form
mode->green_mask = format.ARGBToColor(0, 0, 0xFF, 0);
mode->blue_mask = format.ARGBToColor(0, 0, 0, 0xFF);
mode->alpha_mask = format.ARGBToColor(0xFF, 0, 0, 0);
- mode->red_shift = format.rLoss;
- mode->green_shift = format.gLoss;
- mode->blue_shift = format.bLoss;
- mode->alpha_shift = format.aLoss;
+ mode->red_shift = format.rShift;
+ mode->green_shift = format.gShift;
+ mode->blue_shift = format.bShift;
+ mode->alpha_shift = format.aShift;
} else {
mode->red_mask = mode->green_mask = mode->blue_mask = 0;
mode->alpha_mask = 0;
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index cb73771528..56a8b8336b 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -411,9 +411,9 @@ static void init_aux_pixmap(gfx_pixmap_t **pixmap) {
(*pixmap)->palette = new Palette(default_colors, DEFAULT_COLORS_NR);
}
-int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, ResourceManager *resManager,
- int xfact, int yfact, gfx_color_mode_t bpp) {
- int color_depth = bpp ? bpp : 1;
+int gfxop_init(int version, bool isVGA, GfxState *state,
+ gfx_options_t *options, ResourceManager *resManager,
+ Graphics::PixelFormat mode, int xfact, int yfact) {
int initialized = 0;
BASIC_CHECKS(GFX_FATAL);
@@ -430,7 +430,7 @@ int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options,
state->pic_port_bounds = gfx_rect(0, 10, 320, 190);
state->_dirtyRects.clear();
- state->driver = new GfxDriver(xfact, yfact, bpp);
+ state->driver = new GfxDriver(xfact, yfact, mode);
state->gfxResMan = new GfxResManager(version, isVGA, state->options, state->driver, resManager);
@@ -1165,8 +1165,10 @@ static int _gfxop_set_pointer(GfxState *state, gfx_pixmap_t *pxm, Common::Point
// may change when a new PIC is loaded. The cursor has to be regenerated
// from this pxm at that point. (An alternative might be to ensure the
// cursor only uses colours in the static part of the palette?)
- if (pxm && pxm->palette)
+ if (pxm && state->driver->getMode()->palette) {
+ assert(pxm->palette);
pxm->palette->mergeInto(state->driver->getMode()->palette);
+ }
state->driver->setPointer(pxm, hotspot);
return GFX_OK;
@@ -1761,7 +1763,8 @@ static int _gfxop_set_pic(GfxState *state) {
// FIXME: The _gfxop_install_pixmap call below updates the OSystem palette.
// This is too soon, since it causes brief palette corruption until the
// screen is updated too. (Possibly related: EngineState::pic_not_valid .)
- state->pic->visual_map->palette->forceInto(state->driver->getMode()->palette);
+ if (state->driver->getMode()->palette)
+ state->pic->visual_map->palette->forceInto(state->driver->getMode()->palette);
_gfxop_install_pixmap(state->driver, state->pic->visual_map);
#ifdef CUSTOM_GRAPHICS_OPTIONS
diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h
index d559d3b6d2..ed71c32b65 100644
--- a/engines/sci/gfx/operations.h
+++ b/engines/sci/gfx/operations.h
@@ -136,14 +136,14 @@ struct GfxState {
/* Fundamental operations */
/**************************/
-int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, ResourceManager *resManager,
- int xfact = 1, int yfact = 1, gfx_color_mode_t bpp = GFX_COLOR_MODE_INDEX);
+int gfxop_init(int version, bool isVGA, GfxState *state,
+ gfx_options_t *options, ResourceManager *resManager,
+ Graphics::PixelFormat mode, int xfact = 1, int yfact = 1);
/* Initializes a graphics mode
** Parameters: (int) version: The interpreter version
** (GfxState *) state: The state to initialize
** (int x int) xfact, yfact: Horizontal and vertical scale factors
-** (gfx_color_mode_t) bpp: Bytes per pixel to initialize with, or
-** 0 (GFX_COLOR_MODE_AUTO) to auto-detect
+** (PixelFormat) mode: Graphics mode to use
** (gfx_options_t *) options: Rendering options
** (void *) misc_info: Additional information for the interpreter
** part of the resource loader
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index f58d729bf6..44ad13b93e 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -102,7 +102,15 @@ SciEngine::~SciEngine() {
}
Common::Error SciEngine::run() {
+ Graphics::PixelFormat gfxmode;
+#ifdef ENABLE_RGB_COLOR
+ gfxmode = _system->getSupportedFormats().front();
+ initGraphics(320, 200, false, gfxmode);
+ // TODO: check if this succeeded? (How?)
+#else
+ gfxmode = Graphics::PixelFormat::createFormatCLUT8();
initGraphics(320, 200, false);
+#endif
// Create debugger console. It requires GFX to be initialized
_console = new Console(this);
@@ -222,7 +230,7 @@ Common::Error SciEngine::run() {
#endif
bool isVGA = _resmgr->_sciVersion >= SCI_VERSION_01_VGA && !(getFlags() & GF_SCI1_EGA);
- if (gfxop_init(_resmgr->_sciVersion, isVGA, &gfx_state, &gfx_options, _resmgr)) {
+ if (gfxop_init(_resmgr->_sciVersion, isVGA, &gfx_state, &gfx_options, _resmgr, gfxmode, 1, 1)) {
warning("Graphics initialization failed. Aborting...");
return Common::kUnknownError;
}
--
cgit v1.2.3
From fe65f6163c88b77a5997d47eff842b78812085be Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Fri, 26 Jun 2009 23:04:46 +0000
Subject: SCI: Fix typo breaking in-engine scaling
svn-id: r41905
---
engines/sci/gfx/operations.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 56a8b8336b..a730717ef8 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -1789,7 +1789,7 @@ int gfxop_new_pic(GfxState *state, int nr, int flags, int default_palette) {
if (state->driver->getMode()->xfact == 1 && state->driver->getMode()->yfact == 1) {
state->pic_unscaled = state->pic;
} else {
- state->pic = state->gfxResMan->getPic(nr, GFX_MASK_VISUAL, flags, default_palette, false);
+ state->pic_unscaled = state->gfxResMan->getPic(nr, GFX_MASK_VISUAL, flags, default_palette, false);
}
if (!state->pic || !state->pic_unscaled) {
--
cgit v1.2.3
From 853aec05ba4485f0bfc90e7515322dfd56a8d4af Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 27 Jun 2009 05:58:44 +0000
Subject: changed initGraphics, and OSystem::initSize to take
Graphics::PixelFormat * parameters instead of Graphics::PixelFormat
parameters, to save unnecessary pixelformat initialization if
ENABLE_RGB_COLOR is not set.
svn-id: r41909
---
backends/platform/sdl/graphics.cpp | 13 ++++++++-----
backends/platform/sdl/sdl.h | 2 +-
common/system.h | 2 +-
engines/engine.cpp | 7 +------
engines/engine.h | 7 +------
engines/groovie/groovie.cpp | 2 +-
engines/scumm/scumm.cpp | 2 +-
7 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index f6b4d76418..a45f31108b 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -354,18 +354,21 @@ int OSystem_SDL::getGraphicsMode() const {
return _videoMode.mode;
}
-void OSystem_SDL::initSize(uint w, uint h, Graphics::PixelFormat format) {
+void OSystem_SDL::initSize(uint w, uint h, Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
#ifdef ENABLE_RGB_COLOR
//avoid redundant format changes
- assert(format.bytesPerPixel > 0);
+ if (!format)
+ format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+
+ assert(format->bytesPerPixel > 0);
- if (format != _videoMode.format)
+ if (*format != _videoMode.format)
{
- _videoMode.format = format;
+ _videoMode.format = *format;
_transactionDetails.formatChanged = true;
- _screenFormat = format;
+ _screenFormat = *format;
}
#endif
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 2048b7f536..befb82cc89 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -123,7 +123,7 @@ public:
// Set the size and format of the video bitmap.
// Typically, 320x200 CLUT8
- virtual void initSize(uint w, uint h, Graphics::PixelFormat format); // overloaded by CE backend
+ virtual void initSize(uint w, uint h, Graphics::PixelFormat *format); // overloaded by CE backend
virtual int getScreenChangeID() const { return _screenChangeCount; }
diff --git a/common/system.h b/common/system.h
index 28947d00c5..4e8be5024c 100644
--- a/common/system.h
+++ b/common/system.h
@@ -401,7 +401,7 @@ public:
* @param height the new virtual screen height
* @param format the new virtual screen pixel format
*/
- virtual void initSize(uint width, uint height, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0;
+ virtual void initSize(uint width, uint height, Graphics::PixelFormat *format = NULL) = 0;
/**
* Return an int value which is changed whenever any screen
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 7a76de36dc..198bfceaed 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -124,12 +124,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
if (gameDomain && gameDomain->contains("fullscreen"))
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
-void initGraphics(int width, int height, bool defaultTo1xScaler) {
-#ifdef ENABLE_RGB_COLOR
- initGraphics(width,height,defaultTo1xScaler, Graphics::PixelFormat::createFormatCLUT8());
-}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
-#endif
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat *format) {
g_system->beginGFXTransaction();
diff --git a/engines/engine.h b/engines/engine.h
index 864450d6e1..67454629e7 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -29,9 +29,7 @@
#include "common/error.h"
#include "common/fs.h"
#include "common/str.h"
-#ifdef ENABLE_RGB_COLOR
#include "graphics/pixelformat.h"
-#endif
class OSystem;
@@ -62,10 +60,7 @@ void initCommonGFX(bool defaultTo1XScaler);
* Errors out when backend is not able to switch to the specified
* mode.
*/
-#ifdef ENABLE_RGB_COLOR
-void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format);
-#endif
-void initGraphics(int width, int height, bool defaultTo1xScaler);
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat *format = NULL);
/**
* Initializes graphics and shows error message.
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 5b1a139dbe..9a22a18a21 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -74,7 +74,7 @@ Common::Error GroovieEngine::run() {
case kGroovieV2:
#ifdef ENABLE_RGB_COLOR
_pixelFormat = _system->getSupportedFormats().front();
- initGraphics(640, 480, true, _pixelFormat);
+ initGraphics(640, 480, true, &_pixelFormat);
break;
#endif
case kGroovieT7G:
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index cab8db2d45..fe38bbf82f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1086,7 +1086,7 @@ Common::Error ScummEngine::init() {
} else if (_game.features & GF_16BIT_COLOR) {
#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatRGB555();
- initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
+ initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
#else
--
cgit v1.2.3
From 39e957d31320b2bc69a2a2ffcdb06e88c0302065 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 27 Jun 2009 08:16:21 +0000
Subject: Enabled RGB color support in SCI engine, corrected SCI engine's
initGraphics call for modified API
svn-id: r41911
---
dists/msvc8/sci.vcproj | 4 ++--
engines/sci/sci.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dists/msvc8/sci.vcproj b/dists/msvc8/sci.vcproj
index b85419c515..8575096239 100644
--- a/dists/msvc8/sci.vcproj
+++ b/dists/msvc8/sci.vcproj
@@ -1,7 +1,7 @@
getSupportedFormats().front();
- initGraphics(320, 200, false, gfxmode);
+ initGraphics(320, 200, false, &gfxmode);
// TODO: check if this succeeded? (How?)
#else
gfxmode = Graphics::PixelFormat::createFormatCLUT8();
--
cgit v1.2.3
From 6f644324863437dedecb254bf088b33c914c7241 Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Sat, 27 Jun 2009 10:53:21 +0000
Subject: SCI: Use obtained instead of requested PixelFormat
svn-id: r41912
---
engines/sci/sci.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 6a14c3032c..adcf302f51 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -106,11 +106,10 @@ Common::Error SciEngine::run() {
#ifdef ENABLE_RGB_COLOR
gfxmode = _system->getSupportedFormats().front();
initGraphics(320, 200, false, &gfxmode);
- // TODO: check if this succeeded? (How?)
#else
- gfxmode = Graphics::PixelFormat::createFormatCLUT8();
initGraphics(320, 200, false);
#endif
+ gfxmode = _system->getScreenFormat();
// Create debugger console. It requires GFX to be initialized
_console = new Console(this);
--
cgit v1.2.3
From 9e1916bcad3cc33a870bdbff5bd01b39e523492d Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 30 Jun 2009 07:30:57 +0000
Subject: renamed kTransactionPixelFormatNotSupported to
kTransactionFormatNotSupported, retyped all Graphics::PixelFormat *
parameters to const Graphics::PixelFormat *, (hopefully) repaired all memory
leaks on screen and cursor format changes, provided OSystem::getScreenFormat
and OSystem::getSupportedFormats methods for when ENABLE_RGB_COLOR is not
set, completely forgot the "commit early, commit often" mantra.
svn-id: r41972
---
backends/platform/sdl/graphics.cpp | 23 +++++++++++++----------
backends/platform/sdl/sdl.h | 4 ++--
common/system.h | 16 +++++++++++++---
engines/engine.cpp | 4 ++--
engines/engine.h | 2 +-
graphics/cursorman.cpp | 14 +++++++-------
graphics/cursorman.h | 27 ++++++++++++++++-----------
7 files changed, 54 insertions(+), 36 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index a45f31108b..27f32ee8d2 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -125,7 +125,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
_videoMode.scaleFactor = _oldVideoMode.scaleFactor;
#ifdef ENABLE_RGB_COLOR
} else if (_videoMode.format != _oldVideoMode.format) {
- errors |= kTransactionPixelFormatNotSupported;
+ errors |= kTransactionFormatNotSupported;
_videoMode.format = _oldVideoMode.format;
_screenFormat = _videoMode.format;
@@ -354,21 +354,24 @@ int OSystem_SDL::getGraphicsMode() const {
return _videoMode.mode;
}
-void OSystem_SDL::initSize(uint w, uint h, Graphics::PixelFormat *format) {
+void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
#ifdef ENABLE_RGB_COLOR
//avoid redundant format changes
+ Graphics::PixelFormat newFormat;
if (!format)
- format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+ newFormat = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ newFormat = *format;
- assert(format->bytesPerPixel > 0);
+ assert(newFormat.bytesPerPixel > 0);
- if (*format != _videoMode.format)
+ if (newFormat != _videoMode.format)
{
- _videoMode.format = *format;
+ _videoMode.format = newFormat;
_transactionDetails.formatChanged = true;
- _screenFormat = *format;
+ _screenFormat = newFormat;
}
#endif
@@ -1373,11 +1376,11 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
}
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format) {
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
- if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
+ _cursorFormat = Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+ else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
_cursorFormat = *format;
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index befb82cc89..68dfe64d53 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -123,7 +123,7 @@ public:
// Set the size and format of the video bitmap.
// Typically, 320x200 CLUT8
- virtual void initSize(uint w, uint h, Graphics::PixelFormat *format); // overloaded by CE backend
+ virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format); // overloaded by CE backend
virtual int getScreenChangeID() const { return _screenChangeCount; }
@@ -152,7 +152,7 @@ public:
virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)
// Set the bitmap that's used when drawing the cursor.
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format); // overloaded by CE backend (FIXME)
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); // overloaded by CE backend (FIXME)
// Set colors of cursor palette
void setCursorPalette(const byte *colors, uint start, uint num);
diff --git a/common/system.h b/common/system.h
index 4e8be5024c..4695ece4a4 100644
--- a/common/system.h
+++ b/common/system.h
@@ -373,6 +373,16 @@ public:
* in RGB color order, even if hardware uses BGR or some other color order.
*/
virtual Common::List getSupportedFormats() const = 0;
+#else
+ inline Graphics::PixelFormat getScreenFormat() const {
+ return Graphics::PixelFormat::createFormatCLUT8();
+ };
+
+ inline Common::List getSupportedFormats() const {
+ Common::List list;
+ list.push_back(Graphics::PixelFormat::createFormatCLUT8());
+ return list;
+ };
#endif
/**
@@ -401,7 +411,7 @@ public:
* @param height the new virtual screen height
* @param format the new virtual screen pixel format
*/
- virtual void initSize(uint width, uint height, Graphics::PixelFormat *format = NULL) = 0;
+ virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0;
/**
* Return an int value which is changed whenever any screen
@@ -451,7 +461,7 @@ public:
kTransactionFullscreenFailed = (1 << 1), /**< Failed switchting fullscreen mode */
kTransactionModeSwitchFailed = (1 << 2), /**< Failed switchting the GFX graphics mode (setGraphicsMode) */
#ifdef ENABLE_RGB_COLOR
- kTransactionPixelFormatNotSupported = (1 << 4), /**< Failed setting the color format (function not yet implemented) */
+ kTransactionFormatNotSupported = (1 << 4), /**< Failed setting the color format (function not yet implemented) */
#endif
kTransactionSizeChangeFailed = (1 << 3) /**< Failed switchting the screen dimensions (initSize) */
};
@@ -734,7 +744,7 @@ public:
* @param cursorTargetScale scale factor which cursor is designed for
* @param format pointer to the pixel format which cursor graphic uses
*/
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat *format = NULL) = 0;
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
/**
* Replace the specified range of cursor the palette with new colors.
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 198bfceaed..8769219c2b 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -124,7 +124,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
if (gameDomain && gameDomain->contains("fullscreen"))
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat *format) {
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format) {
g_system->beginGFXTransaction();
@@ -155,7 +155,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::Pixel
// Just show warnings then these occur:
#ifdef ENABLE_RGB_COLOR
- if (gfxError & OSystem::kTransactionPixelFormatNotSupported) {
+ if (gfxError & OSystem::kTransactionFormatNotSupported) {
Common::String message = "Could not initialize color format.";
GUI::MessageDialog dialog(message);
diff --git a/engines/engine.h b/engines/engine.h
index 67454629e7..d59e8ed9bd 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -60,7 +60,7 @@ void initCommonGFX(bool defaultTo1XScaler);
* Errors out when backend is not able to switch to the specified
* mode.
*/
-void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat *format = NULL);
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format = NULL);
/**
* Initializes graphics and shows error message.
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index bf6de44fbf..b35bbe73ae 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -57,7 +57,7 @@ bool CursorManager::showMouse(bool visible) {
return g_system->showMouse(visible);
}
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat *format) {
+void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, const Graphics::PixelFormat *format) {
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
cur->_visible = isVisible();
@@ -77,7 +77,7 @@ void CursorManager::popCursor() {
if (!_cursorStack.empty()) {
cur = _cursorStack.top();
- g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, &(cur->_format));
+ g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_format);
}
g_system->showMouse(isVisible());
@@ -100,7 +100,7 @@ void CursorManager::popAllCursors() {
g_system->showMouse(isVisible());
}
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, Graphics::PixelFormat *format) {
+void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, const Graphics::PixelFormat *format) {
if (_cursorStack.empty()) {
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
@@ -110,10 +110,10 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_RGB_COLOR
+ uint size;
if (!format)
- format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
-
- uint size = w * h * format->bytesPerPixel;
+ size = w * h;
+ else size = w * h * format->bytesPerPixel;
#else
uint size = w * h;
#endif
@@ -134,7 +134,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
#ifdef ENABLE_RGB_COLOR
- cur->_format = *format;
+ cur->_format = format;
#endif
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 2b2f34f952..044a787e71 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -61,7 +61,7 @@ public:
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL);
+ void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -83,7 +83,7 @@ public:
* @param targetScale the scale for which the cursor is designed
* @param format the pixel format which the cursor graphic uses
*/
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL);
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -148,22 +148,27 @@ private:
int _hotspotX;
int _hotspotY;
uint32 _keycolor;
-#ifdef ENABLE_RGB_COLOR
- Graphics::PixelFormat _format;
-#endif
+ const Graphics::PixelFormat *_format;
byte _targetScale;
uint _size;
- Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL) {
+ Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
- _size = w * h * format->bytesPerPixel;
- _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
- _format = *format;
+ {
+ _size = w * h;
+ _keycolor &= 0xFF;
+ }
+ else
+ {
+ _size = w * h * format->bytesPerPixel;
+ _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
+ }
+ _format = format;
#else
+ _format = NULL;
_size = w * h;
- _keycolor = keycolor & 0xFF;
+ _keycolor &= 0xFF;
#endif
_data = new byte[_size];
if (data && _data)
--
cgit v1.2.3
From 5e9285e8fa8eb2f0b01abc6caf93dc926f41d795 Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Tue, 30 Jun 2009 08:25:08 +0000
Subject: Fixed a few formatting bits
svn-id: r41973
---
engines/engine.cpp | 1 +
graphics/cursorman.cpp | 3 ++-
graphics/cursorman.h | 7 ++-----
graphics/pixelformat.h | 48 ++++++++++++++++++++++++------------------------
4 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 8769219c2b..33eb424b76 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -124,6 +124,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
if (gameDomain && gameDomain->contains("fullscreen"))
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
+
void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format) {
g_system->beginGFXTransaction();
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index b35bbe73ae..08a0b3bb88 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -113,7 +113,8 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
uint size;
if (!format)
size = w * h;
- else size = w * h * format->bytesPerPixel;
+ else
+ size = w * h * format->bytesPerPixel;
#else
uint size = w * h;
#endif
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 044a787e71..b744109b61 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -154,13 +154,10 @@ private:
uint _size;
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
- if (!format)
- {
+ if (!format) {
_size = w * h;
_keycolor &= 0xFF;
- }
- else
- {
+ } else {
_size = w * h * format->bytesPerPixel;
_keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
}
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index a773a42d76..30c8aaa447 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -64,66 +64,66 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
- //"Factory" methods for convenience
+ // "Factory" methods for convenience
static inline PixelFormat createFormatCLUT8() {
- return PixelFormat(1,8,8,8,8,0,0,0,0);
+ return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
}
#ifdef ENABLE_RGB_COLOR
- //2 Bytes-per-pixel modes
+ // 2 Bytes-per-pixel modes
static inline PixelFormat createFormatRGB555() {
- return PixelFormat(2,3,3,3,8,10,5,0,0);
+ return PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0);
}
static inline PixelFormat createFormatBGR555() {
- return PixelFormat(2,3,3,3,8,0,5,10,0);
+ return PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0);
}
static inline PixelFormat createFormatXRGB1555() {
- //Special case, alpha bit is always high in this mode.
- return PixelFormat(2,3,3,3,7,10,5,0,15);
+ // Special case, alpha bit is always high in this mode.
+ return PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15);
}
static inline PixelFormat createFormatXBGR1555() {
- //Special case, alpha bit is always high in this mode.
- return PixelFormat(2,3,3,3,7,0,5,10,15);
+ // Special case, alpha bit is always high in this mode.
+ return PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15);
}
static inline PixelFormat createFormatRGB565() {
- return PixelFormat(2,3,2,3,8,11,5,0,0);
+ return PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0);
}
static inline PixelFormat createFormatBGR565() {
- return PixelFormat(2,3,2,3,8,0,5,11,0);
+ return PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0);
}
static inline PixelFormat createFormatRGBA4444() {
- return PixelFormat(2,4,4,4,4,12,8,4,0);
+ return PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0);
}
static inline PixelFormat createFormatARGB4444() {
- return PixelFormat(2,4,4,4,4,8,4,0,12);
+ return PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12);
}
static inline PixelFormat createFormatABGR4444() {
- return PixelFormat(2,4,4,4,4,0,4,8,12);
+ return PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12);
}
static inline PixelFormat createFormatBGRA4444() {
- return PixelFormat(2,4,4,4,4,4,8,12,0);
+ return PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0);
}
#ifdef ENABLE_32BIT
- //3 to 4 byte per pixel modes
+ // 3 to 4 byte per pixel modes
static inline PixelFormat createFormatRGB888() {
- return PixelFormat(3,0,0,0,8,16,8,0,0);
+ return PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0);
}
static inline PixelFormat createFormatBGR888() {
- return PixelFormat(3,0,0,0,8,0,8,16,0);
+ return PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0);
}
static inline PixelFormat createFormatRGBA8888() {
- return PixelFormat(4,0,0,0,0,24,16,8,0);
+ return PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0);
}
static inline PixelFormat createFormatARGB8888() {
- return PixelFormat(4,0,0,0,0,16,8,0,24);
+ return PixelFormat(4, 0, 0, 0, 0, 16 ,8, 0, 24);
}
static inline PixelFormat createFormatABGR8888() {
- return PixelFormat(4,0,0,0,0,0,8,16,24);
+ return PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24);
}
static inline PixelFormat createFormatBGRA8888() {
- return PixelFormat(4,0,0,0,0,8,16,24,0);
+ return PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0);
}
-#endif //ENABLE_32BIT
-#endif //ENABLE_RGB_COLOR
+#endif // ENABLE_32BIT
+#endif // ENABLE_RGB_COLOR
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
--
cgit v1.2.3
From 03b501ee2442c8118deacb396af479e32a910dd4 Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Tue, 30 Jun 2009 10:25:44 +0000
Subject: Groovie: Converted compile time checks for RGB modes support to
runtime checks in order to fallback if the requested PixelFormat isn't
available.
svn-id: r41974
---
engines/groovie/groovie.cpp | 7 ++-
engines/groovie/groovie.h | 3 +-
engines/groovie/roq.cpp | 109 +++++++++++++++++++++-----------------------
3 files changed, 58 insertions(+), 61 deletions(-)
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 9a22a18a21..4315644ab7 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -72,11 +72,14 @@ Common::Error GroovieEngine::run() {
// Initialize the graphics
switch (_gameDescription->version) {
case kGroovieV2:
-#ifdef ENABLE_RGB_COLOR
+ // Request the mode with the highest precision available
_pixelFormat = _system->getSupportedFormats().front();
initGraphics(640, 480, true, &_pixelFormat);
+
+ // Save the enabled mode as it can be both an RGB mode or CLUT8
+ _pixelFormat = _system->getScreenFormat();
+ _mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8());
break;
-#endif
case kGroovieT7G:
initGraphics(640, 480, true);
break;
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index 3f7f7cb0ed..bf57ae77de 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -85,9 +85,8 @@ protected:
public:
void waitForInput();
-#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat _pixelFormat;
-#endif
+ bool _mode8bit;
Script _script;
ResMan *_resMan;
GrvCursorMan *_grvCursorMan;
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 56237655e9..cacc243c2c 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -47,52 +47,52 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
_currBuf = new Graphics::Surface();
_prevBuf = new Graphics::Surface();
-#ifndef ENABLE_RGB_COLOR
- byte pal[256 * 4];
+ if (_vm->_mode8bit) {
+ byte pal[256 * 4];
#ifdef DITHER
- byte pal3[256 * 3];
- // Initialize to a black palette
- for (int i = 0; i < 256 * 3; i++) {
- pal3[i] = 0;
- }
-
- // Build a basic color palette
- for (int r = 0; r < 4; r++) {
- for (int g = 0; g < 4; g++) {
- for (int b = 0; b < 4; b++) {
- byte col = (r << 4) | (g << 2) | (b << 0);
- pal3[3 * col + 0] = r << 6;
- pal3[3 * col + 1] = g << 6;
- pal3[3 * col + 2] = b << 6;
+ byte pal3[256 * 3];
+ // Initialize to a black palette
+ for (int i = 0; i < 256 * 3; i++) {
+ pal3[i] = 0;
+ }
+
+ // Build a basic color palette
+ for (int r = 0; r < 4; r++) {
+ for (int g = 0; g < 4; g++) {
+ for (int b = 0; b < 4; b++) {
+ byte col = (r << 4) | (g << 2) | (b << 0);
+ pal3[3 * col + 0] = r << 6;
+ pal3[3 * col + 1] = g << 6;
+ pal3[3 * col + 2] = b << 6;
+ }
}
}
- }
- // Initialize the dithering algorithm
- _paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
- _paletteLookup->setPalette(pal3, Graphics::PaletteLUT::kPaletteRGB, 8);
- for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
- debug("Groovie::ROQ: Building palette table: %02d/63", i);
- _paletteLookup->buildNext();
- }
+ // Initialize the dithering algorithm
+ _paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
+ _paletteLookup->setPalette(pal3, Graphics::PaletteLUT::kPaletteRGB, 8);
+ for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
+ debug("Groovie::ROQ: Building palette table: %02d/63", i);
+ _paletteLookup->buildNext();
+ }
- // Prepare the palette to show
- for (int i = 0; i < 256; i++) {
- pal[(i * 4) + 0] = pal3[(i * 3) + 0];
- pal[(i * 4) + 1] = pal3[(i * 3) + 1];
- pal[(i * 4) + 2] = pal3[(i * 3) + 2];
- }
+ // Prepare the palette to show
+ for (int i = 0; i < 256; i++) {
+ pal[(i * 4) + 0] = pal3[(i * 3) + 0];
+ pal[(i * 4) + 1] = pal3[(i * 3) + 1];
+ pal[(i * 4) + 2] = pal3[(i * 3) + 2];
+ }
#else // !DITHER
- // Set a grayscale palette
- for (int i = 0; i < 256; i++) {
- pal[(i * 4) + 0] = i;
- pal[(i * 4) + 1] = i;
- pal[(i * 4) + 2] = i;
- }
+ // Set a grayscale palette
+ for (int i = 0; i < 256; i++) {
+ pal[(i * 4) + 0] = i;
+ pal[(i * 4) + 1] = i;
+ pal[(i * 4) + 2] = i;
+ }
#endif // DITHER
- _syst->setPalette(pal, 0, 256);
-#endif // !ENABLE_RGB_COLOR
+ _syst->setPalette(pal, 0, 256);
+ }
}
ROQPlayer::~ROQPlayer() {
@@ -160,26 +160,25 @@ void ROQPlayer::buildShowBuf() {
byte *out = (byte *)_showBuf.getBasePtr(0, line);
byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _showBuf.w; x++) {
-#ifdef ENABLE_RGB_COLOR
- // Do the format conversion (YUV -> RGB -> Screen format)
- byte r, g, b;
- Graphics::PaletteLUT::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
- // FIXME: this is fixed to 16bit
- *(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
-
- // Skip to the next pixel
- out += _vm->_pixelFormat.bytesPerPixel;
-#else // !ENABLE_RGB_COLOR
+ if (_vm->_mode8bit) {
#ifdef DITHER
- *out = _dither->dither(*in, *(in + 1), *(in + 2), x);
+ *out = _dither->dither(*in, *(in + 1), *(in + 2), x);
#else
- // Just use the luminancy component
- *out = *in;
+ // Just use the luminancy component
+ *out = *in;
#endif // DITHER
- // Skip to the next pixel
- out++;
+#ifdef ENABLE_RGB_COLOR
+ } else {
+ // Do the format conversion (YUV -> RGB -> Screen format)
+ byte r, g, b;
+ Graphics::PaletteLUT::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
+ // FIXME: this is fixed to 16bit
+ *(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
#endif // ENABLE_RGB_COLOR
+ }
+ // Skip to the next pixel
+ out += _vm->_pixelFormat.bytesPerPixel;
if (!(x % _scaleX))
in += _prevBuf->bytesPerPixel;
}
@@ -335,11 +334,7 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
// Allocate new buffers
_currBuf->create(width, height, 3);
_prevBuf->create(width, height, 3);
-#ifdef ENABLE_RGB_COLOR
_showBuf.create(width * _scaleX, height * _scaleY, _vm->_pixelFormat.bytesPerPixel);
-#else
- _showBuf.create(width * _scaleX, height * _scaleY, 1);
-#endif
// Clear the buffers with black YUV values
byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0);
--
cgit v1.2.3
From f10946545ad62c0157d1b0bcfcf12dcb614aaedb Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 1 Jul 2009 04:06:13 +0000
Subject: Allowed for 16, 24, and 32 bit pixel format factory constructors to
be used without backend RGB color support
svn-id: r41985
---
graphics/pixelformat.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 30c8aaa447..063c989371 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -68,7 +68,6 @@ struct PixelFormat {
static inline PixelFormat createFormatCLUT8() {
return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
}
-#ifdef ENABLE_RGB_COLOR
// 2 Bytes-per-pixel modes
static inline PixelFormat createFormatRGB555() {
return PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0);
@@ -102,7 +101,6 @@ struct PixelFormat {
static inline PixelFormat createFormatBGRA4444() {
return PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0);
}
-#ifdef ENABLE_32BIT
// 3 to 4 byte per pixel modes
static inline PixelFormat createFormatRGB888() {
return PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0);
@@ -122,8 +120,6 @@ struct PixelFormat {
static inline PixelFormat createFormatBGRA8888() {
return PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0);
}
-#endif // ENABLE_32BIT
-#endif // ENABLE_RGB_COLOR
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
--
cgit v1.2.3
From 75507138cc6b2ae37ea848d77586128ac1023f69 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 1 Jul 2009 06:33:50 +0000
Subject: Implemented Graphics::PixelFormat
Graphics::findCompatibleFormat(Common::List backend,
Common::List frontend)
svn-id: r41986
---
graphics/pixelformat.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 063c989371..7c0d008b60 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -27,6 +27,7 @@
#define GRAPHICS_PIXELFORMAT_H
#include "common/scummsys.h"
+#include "common/list.h"
namespace Graphics {
@@ -199,6 +200,17 @@ struct PixelFormat {
return (1 << aBits()) - 1;
}
};
+inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) {
+#ifdef ENABLE_RGB_COLOR
+ for (Common::List::iterator i = backend.begin(); i != backend.end(); ++i) {
+ for (Common::List::iterator j = frontend.begin(); j != frontend.end(); ++j) {
+ if (*i == *j)
+ return *i;
+ }
+ }
+#endif
+ return PixelFormat::createFormatCLUT8();
+};
} // end of namespace Graphics
--
cgit v1.2.3
From f67f820010665e83e753da097a4ce20559afd36a Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Wed, 1 Jul 2009 15:06:38 +0000
Subject: Add JPEG support to 16bpp branch (if it breaks or is wrong, clone2727
made me)
svn-id: r41990
---
graphics/jpeg.cpp | 622 +++++++++++++++++++++++++++++++++++++++++++++++++++++
graphics/jpeg.h | 120 +++++++++++
graphics/module.mk | 1 +
3 files changed, 743 insertions(+)
create mode 100644 graphics/jpeg.cpp
create mode 100644 graphics/jpeg.h
diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp
new file mode 100644
index 0000000000..ce0568816c
--- /dev/null
+++ b/graphics/jpeg.cpp
@@ -0,0 +1,622 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "graphics/jpeg.h"
+
+#include "common/endian.h"
+#include "common/util.h"
+
+namespace Graphics {
+
+// Order used to traverse the quantization tables
+uint8 JPEG::_zigZagOrder[64] = {
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63
+};
+
+JPEG::JPEG() :
+ _str(NULL), _w(0), _h(0), _numComp(0), _components(NULL), _numScanComp(0),
+ _scanComp(NULL), _currentComp(NULL) {
+
+ // Initialize the quantization tables
+ for (int i = 0; i < JPEG_MAX_QUANT_TABLES; i++)
+ _quant[i] = NULL;
+
+ // Initialize the Huffman tables
+ for (int i = 0; i < 2 * JPEG_MAX_HUFF_TABLES; i++) {
+ _huff[i].count = 0;
+ _huff[i].values = NULL;
+ _huff[i].sizes = NULL;
+ _huff[i].codes = NULL;
+ }
+}
+
+JPEG::~JPEG() {
+ reset();
+}
+
+void JPEG::reset() {
+ // Reset member variables
+ _str = NULL;
+ _w = _h = 0;
+
+ // Free the components
+ for (int c = 0; c < _numComp; c++)
+ _components[c].surface.free();
+ delete[] _components; _components = NULL;
+ _numComp = 0;
+
+ // Free the scan components
+ delete[] _scanComp; _scanComp = NULL;
+ _numScanComp = 0;
+ _currentComp = NULL;
+
+ // Free the quantization tables
+ for (int i = 0; i < JPEG_MAX_QUANT_TABLES; i++) {
+ delete[] _quant[i];
+ _quant[i] = NULL;
+ }
+
+ // Free the Huffman tables
+ for (int i = 0; i < 2 * JPEG_MAX_HUFF_TABLES; i++) {
+ _huff[i].count = 0;
+ delete[] _huff[i].values; _huff[i].values = NULL;
+ delete[] _huff[i].sizes; _huff[i].sizes = NULL;
+ delete[] _huff[i].codes; _huff[i].codes = NULL;
+ }
+}
+
+bool JPEG::read(Common::SeekableReadStream *str) {
+ // Reset member variables and tables from previous reads
+ reset();
+
+ // Save the input stream
+ _str = str;
+
+ bool ok = true;
+ bool done = false;
+ while (!_str->eos() && ok && !done) {
+ // Read the marker
+ uint16 marker = _str->readByte();
+ if (marker != 0xFF) {
+ error("JPEG: Invalid marker[0]: 0x%02X", marker);
+ ok = false;
+ break;
+ }
+
+ while (marker == 0xFF)
+ marker = _str->readByte();
+
+ // Process the marker data
+ switch (marker) {
+ case 0xC0: // Start Of Frame
+ ok = readSOF0();
+ break;
+ case 0xC4: // Define Huffman Tables
+ ok = readDHT();
+ break;
+ case 0xD8: // Start Of Image
+ break;
+ case 0xD9: // End Of Image
+ done = true;
+ break;
+ case 0xDA: // Start Of Scan
+ ok = readSOS();
+ break;
+ case 0xDB: // Define Quantization Tables
+ ok = readDQT();
+ break;
+ case 0xE0: // JFIF/JFXX segment
+ ok = readJFIF();
+ break;
+ case 0xFE: // Comment
+ _str->seek(_str->readUint16BE() - 2, SEEK_CUR);
+ break;
+ default: { // Unknown marker
+ uint16 size = _str->readUint16BE();
+ warning("JPEG: Unknown marker %02X, skipping %d bytes", marker, size - 2);
+ _str->seek(size - 2, SEEK_CUR);
+ }
+ }
+ }
+ return ok;
+}
+
+bool JPEG::readJFIF() {
+ /* uint16 length = */ _str->readUint16BE();
+ uint32 tag = _str->readUint32BE();
+ if (tag != MKID_BE('JFIF'))
+ return false;
+ _str->readByte(); // NULL
+ /* byte majorVersion = */ _str->readByte();
+ /* byte minorVersion = */ _str->readByte();
+ /* byte densityUnits = */ _str->readByte();
+ /* uint16 xDensity = */ _str->readUint16BE();
+ /* uint16 yDensity = */ _str->readUint16BE();
+ byte thumbW = _str->readByte();
+ byte thumbH = _str->readByte();
+ _str->seek(thumbW * thumbH * 3, SEEK_CUR); // Ignore thumbnail
+ return true;
+}
+
+// Marker 0xC0 (Start Of Frame, Baseline DCT)
+bool JPEG::readSOF0() {
+ debug(5, "JPEG: readSOF0");
+ uint16 size = _str->readUint16BE();
+
+ // Read the sample precision
+ uint8 precision = _str->readByte();
+ if (precision != 8) {
+ warning("JPEG: Just 8 bit precision supported at the moment");
+ return false;
+ }
+
+ // Image size
+ _h = _str->readUint16BE();
+ _w = _str->readUint16BE();
+
+ // Number of components
+ _numComp = _str->readByte();
+ if (size != 8 + 3 * _numComp) {
+ warning("JPEG: Invalid number of components");
+ return false;
+ }
+
+ // Allocate the new components
+ delete[] _components;
+ _components = new Component[_numComp];
+
+ // Read the components details
+ for (int c = 0; c < _numComp; c++) {
+ _components[c].id = _str->readByte();
+ _components[c].factorH = _str->readByte();
+ _components[c].factorV = _components[c].factorH & 0xF;
+ _components[c].factorH >>= 4;
+ _components[c].quantTableSelector = _str->readByte();
+ }
+
+ return true;
+}
+
+// Marker 0xC4 (Define Huffman Tables)
+bool JPEG::readDHT() {
+ debug(5, "JPEG: readDHT");
+ uint16 size = _str->readUint16BE() - 2;
+ uint32 pos = _str->pos();
+
+ while ((uint32)_str->pos() < (size + pos)) {
+ // Read the table type and id
+ uint8 tableId = _str->readByte();
+ uint8 tableType = tableId >> 4; // type 0: DC, 1: AC
+ tableId &= 0xF;
+ uint8 tableNum = (tableId << 1) + tableType;
+
+ // Free the Huffman table
+ delete[] _huff[tableNum].values; _huff[tableNum].values = NULL;
+ delete[] _huff[tableNum].sizes; _huff[tableNum].sizes = NULL;
+ delete[] _huff[tableNum].codes; _huff[tableNum].codes = NULL;
+
+ // Read the number of values for each length
+ uint8 numValues[16];
+ _huff[tableNum].count = 0;
+ for (int len = 0; len < 16; len++) {
+ numValues[len] = _str->readByte();
+ _huff[tableNum].count += numValues[len];
+ }
+
+ // Allocate memory for the current table
+ _huff[tableNum].values = new uint8[_huff[tableNum].count];
+ _huff[tableNum].sizes = new uint8[_huff[tableNum].count];
+ _huff[tableNum].codes = new uint16[_huff[tableNum].count];
+
+ // Read the table contents
+ int cur = 0;
+ for (int len = 0; len < 16; len++) {
+ for (int i = 0; i < numValues[len]; i++) {
+ _huff[tableNum].values[cur] = _str->readByte();
+ _huff[tableNum].sizes[cur] = len + 1;
+ cur++;
+ }
+ }
+
+ // Fill the table of Huffman codes
+ cur = 0;
+ uint16 curCode = 0;
+ uint8 curCodeSize = _huff[tableNum].sizes[0];
+ while (cur < _huff[tableNum].count) {
+ // Increase the code size to fit the request
+ while (_huff[tableNum].sizes[cur] != curCodeSize) {
+ curCode <<= 1;
+ curCodeSize++;
+ }
+
+ // Assign the current code
+ _huff[tableNum].codes[cur] = curCode;
+ curCode++;
+ cur++;
+ }
+ }
+
+ return true;
+}
+
+// Marker 0xDA (Start Of Scan)
+bool JPEG::readSOS() {
+ debug(5, "JPEG: readSOS");
+ uint16 size = _str->readUint16BE();
+
+ // Number of scan components
+ _numScanComp = _str->readByte();
+ if (size != 6 + 2 * _numScanComp) {
+ warning("JPEG: Invalid number of components");
+ return false;
+ }
+
+ // Allocate the new scan components
+ delete[] _scanComp;
+ _scanComp = new Component *[_numScanComp];
+
+ // Reset the maximum sampling factors
+ _maxFactorV = 0;
+ _maxFactorH = 0;
+
+ // Component-specification parameters
+ for (int c = 0; c < _numScanComp; c++) {
+ // Read the desired component id
+ uint8 id = _str->readByte();
+
+ // Search the component with the specified id
+ bool found = false;
+ for (int i = 0; !found && i < _numComp; i++) {
+ if (_components[i].id == id) {
+ // We found the desired component
+ found = true;
+
+ // Assign the found component to the c'th scan component
+ _scanComp[c] = &_components[i];
+ }
+ }
+
+ if (!found) {
+ warning("JPEG: Invalid component");
+ return false;
+ }
+
+ // Read the entropy table selectors
+ _scanComp[c]->DCentropyTableSelector = _str->readByte();
+ _scanComp[c]->ACentropyTableSelector = _scanComp[c]->DCentropyTableSelector & 0xF;
+ _scanComp[c]->DCentropyTableSelector >>= 4;
+
+ // Calculate the maximum sampling factors
+ if (_scanComp[c]->factorV > _maxFactorV)
+ _maxFactorV = _scanComp[c]->factorV;
+
+ if (_scanComp[c]->factorH > _maxFactorH)
+ _maxFactorH = _scanComp[c]->factorH;
+
+ // Initialize the DC predictor
+ _scanComp[c]->DCpredictor = 0;
+ }
+
+ // Initialize the scan surfaces
+ for (int c = 0; c < _numScanComp; c++)
+ _scanComp[c]->surface.create(_w, _h, 1);
+
+ // Start of spectral selection
+ if (_str->readByte() != 0) {
+ warning("JPEG: Progressive scanning not supported");
+ return false;
+ }
+
+ // End of spectral selection
+ if (_str->readByte() != 63) {
+ warning("JPEG: Progressive scanning not supported");
+ return false;
+ }
+
+ // Successive approximation parameters
+ if (_str->readByte() != 0) {
+ warning("JPEG: Progressive scanning not supported");
+ return false;
+ }
+
+ // Entropy coded sequence starts, initialize Huffman decoder
+ _bitsNumber = 0;
+
+ // Read all the scan MCUs
+ uint16 xMCU = _w / (_maxFactorH * 8);
+ uint16 yMCU = _h / (_maxFactorV * 8);
+ bool ok = true;
+ for (int y = 0; ok && (y < yMCU); y++)
+ for (int x = 0; ok && (x < xMCU); x++)
+ ok = readMCU(x, y);
+
+ return ok;
+}
+
+// Marker 0xDB (Define Quantization Tables)
+bool JPEG::readDQT() {
+ debug(5, "JPEG: readDQT");
+ uint16 size = _str->readUint16BE() - 2;
+ uint32 pos = _str->pos();
+
+ while ((uint32)_str->pos() < (pos + size)) {
+ // Read the table precision and id
+ uint8 tableId = _str->readByte();
+ bool highPrecision = (tableId & 0xF0) != 0;
+
+ // Validate the table id
+ tableId &= 0xF;
+ if (tableId > JPEG_MAX_QUANT_TABLES) {
+ warning("JPEG: Invalid number of components");
+ return false;
+ }
+
+ // Create the new table if necessary
+ if (!_quant[tableId])
+ _quant[tableId] = new uint16[64];
+
+ // Read the table (stored in Zig-Zag order)
+ for (int i = 0; i < 64; i++)
+ _quant[tableId][i] = highPrecision ? _str->readUint16BE() : _str->readByte();
+ }
+
+ return true;
+}
+
+bool JPEG::readMCU(uint16 xMCU, uint16 yMCU) {
+ bool ok = true;
+ for (int c = 0; ok && (c < _numComp); c++) {
+ // Set the current component
+ _currentComp = _scanComp[c];
+
+ // Read the data units of the current component
+ for (int y = 0; ok && (y < _scanComp[c]->factorV); y++)
+ for (int x = 0; ok && (x < _scanComp[c]->factorH); x++)
+ ok = readDataUnit(xMCU * _scanComp[c]->factorH + x, yMCU * _scanComp[c]->factorV + y);
+ }
+
+ return ok;
+}
+
+float JPEG::idct(int x, int y, int weight, int fx, int fy) {
+ float vx = cos((2 * x + 1) * fx * M_PI / 16);
+ float vy = cos((2 * y + 1) * fy * M_PI / 16);
+ float ret = (float)weight * vx * vy;
+
+ if (fx == 0)
+ ret /= sqrt(2.0f);
+
+ if (fy == 0)
+ ret /= sqrt(2.0f);
+
+ return ret;
+}
+
+bool JPEG::readDataUnit(uint16 x, uint16 y) {
+ // Prepare an empty data array
+ int16 readData[64];
+ for (int i = 1; i < 64; i++)
+ readData[i] = 0;
+
+ // Read the DC component
+ readData[0] = _currentComp->DCpredictor + readDC();
+ _currentComp->DCpredictor = readData[0];
+
+ // Read the AC components (stored in Zig-Zag)
+ readAC(readData);
+
+ // Calculate the DCT coefficients from the input sequence
+ int16 DCT[64];
+ for (int i = 0; i < 64; i++) {
+ // Dequantize
+ int16 val = readData[i];
+ int16 quant = _quant[_currentComp->quantTableSelector][i];
+ val *= quant;
+
+ // Store the normalized coefficients, undoing the Zig-Zag
+ DCT[_zigZagOrder[i]] = val;
+ }
+
+ // Shortcut the IDCT for DC component
+ float result[64];
+ for (int i = 0; i < 64; i++)
+ result[i] = DCT[0] / 2;
+
+ // Apply the IDCT (PAG31)
+ for (int i = 1; i < 64; i++) {
+ if (DCT[i])
+ for (int _y = 0; _y < 8; _y++)
+ for (int _x = 0; _x < 8; _x++)
+ result[_y * 8 + _x] += idct(_x, _y, DCT[i], i % 8, i / 8);
+ }
+
+ // Level shift to make the values unsigned
+ // Divide by 4 is final part of IDCT
+ for (int i = 0; i < 64; i++) {
+ result[i] = result[i] / 4 + 128;
+
+ if (result[i] < 0)
+ result[i] = 0;
+
+ if (result[i] > 255)
+ result[i] = 255;
+ }
+
+ // Paint the component surface
+ uint8 scalingV = _maxFactorV / _currentComp->factorV;
+ uint8 scalingH = _maxFactorH / _currentComp->factorH;
+
+ // Convert coordinates from MCU blocks to pixels
+ x <<= 3;
+ y <<= 3;
+ for (int j = 0; j < 8; j++) {
+ for (int sV = 0; sV < scalingV; sV++) {
+ // Get the beginning of the block line
+ byte *ptr = (byte *)_currentComp->surface.getBasePtr(x * scalingH, (y + j) * scalingV + sV);
+
+ for (int i = 0; i < 8; i++) {
+ for (uint8 sH = 0; sH < scalingH; sH++) {
+ *ptr = (byte)(result[j * 8 + i]);
+ ptr++;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+int16 JPEG::readDC() {
+ // DC is type 0
+ uint8 tableNum = _currentComp->DCentropyTableSelector << 1;
+
+ // Get the number of bits to read
+ uint8 numBits = readHuff(tableNum);
+
+ // Read the requested bits
+ return readSignedBits(numBits);
+}
+
+void JPEG::readAC(int16 *out) {
+ // AC is type 1
+ uint8 tableNum = (_currentComp->ACentropyTableSelector << 1) + 1;
+
+ // Start reading AC element 1
+ uint8 cur = 1;
+ while (cur < 64) {
+ uint8 s = readHuff(tableNum);
+ uint8 r = s >> 4;
+ s &= 0xF;
+
+ if (s == 0) {
+ if (r == 15) {
+ // Skip 16 values
+ cur += 16;
+ } else {
+ // EOB: end of block
+ cur = 64;
+ }
+ } else {
+ // Skip r values
+ cur += r;
+
+ // Read the next value
+ out[cur] = readSignedBits(s);
+ cur++;
+ }
+ }
+}
+
+int16 JPEG::readSignedBits(uint8 numBits) {
+ uint16 ret = 0;
+ if (numBits > 16) error("requested %d bits", numBits); //XXX
+
+ // MSB=0 for negatives, 1 for positives
+ for (int i = 0; i < numBits; i++)
+ ret = (ret << 1) + readBit();
+
+ // Extend sign bits (PAG109)
+ if (!(ret >> (numBits - 1)))
+ {
+ uint16 tmp = ((uint16)-1 << numBits) + 1;
+ ret = ret + tmp;
+ }
+ return ret;
+}
+
+// TODO: optimize?
+uint8 JPEG::readHuff(uint8 table) {
+ bool foundCode = false;
+ uint8 val = 0;
+
+ uint8 cur = 0;
+ uint8 codeSize = 1;
+ uint16 code = readBit();
+ while (!foundCode) {
+ // Prepare a code of the current size
+ while (codeSize < _huff[table].sizes[cur]) {
+ code = (code << 1) + readBit();
+ codeSize++;
+ }
+
+ // Compare the codes of the current size
+ while (!foundCode && (codeSize == _huff[table].sizes[cur])) {
+ if (code == _huff[table].codes[cur]) {
+ // Found the code
+ val = _huff[table].values[cur];
+ foundCode = true;
+ } else {
+ // Continue reading
+ cur++;
+ }
+ }
+ }
+
+ return val;
+}
+
+uint8 JPEG::readBit() {
+ // Read a whole byte if necessary
+ if (_bitsNumber == 0) {
+ _bitsData = _str->readByte();
+ _bitsNumber = 8;
+
+ // Detect markers
+ if (_bitsData == 0xFF) {
+ uint8 byte2 = _str->readByte();
+
+ // A stuffed 0 validates the previous byte
+ if (byte2 != 0) {
+ if (byte2 == 0xDC) {
+ // DNL marker: Define Number of Lines
+ // TODO: terminate scan
+ printf("DNL marker detected: terminate scan\n");
+ } else {
+ printf("Error: marker 0x%02X read in entropy data\n", byte2);
+ }
+ }
+ }
+ }
+ _bitsNumber--;
+
+ return (_bitsData & (1 << _bitsNumber)) ? 1 : 0;
+}
+
+Surface *JPEG::getComponent(uint c) {
+ for (int i = 0; i < _numComp; i++)
+ if (_components[i].id == c) // We found the desired component
+ return &_components[i].surface;
+
+ return NULL;
+}
+
+} // End of Graphics namespace
diff --git a/graphics/jpeg.h b/graphics/jpeg.h
new file mode 100644
index 0000000000..d9097055e1
--- /dev/null
+++ b/graphics/jpeg.h
@@ -0,0 +1,120 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GRAPHICS_JPEG_H
+#define GRAPHICS_JPEG_H
+
+#define M_PI 3.141592f
+
+#include "common/stream.h"
+#include "graphics/surface.h"
+
+namespace Graphics {
+
+#define JPEG_MAX_QUANT_TABLES 4
+#define JPEG_MAX_HUFF_TABLES 2
+
+class JPEG {
+public:
+ JPEG();
+ ~JPEG();
+
+ bool read(Common::SeekableReadStream *str);
+ Surface *getComponent(uint c);
+
+private:
+ void reset();
+
+ Common::SeekableReadStream *_str;
+ uint16 _w, _h;
+
+ // Image components
+ uint8 _numComp;
+ struct Component {
+ // Global values
+ uint8 id;
+ uint8 factorH;
+ uint8 factorV;
+ uint8 quantTableSelector;
+
+ // Scan specific values
+ uint8 DCentropyTableSelector;
+ uint8 ACentropyTableSelector;
+ int16 DCpredictor;
+
+ // Result image for this component
+ Surface surface;
+ } *_components;
+
+ // Scan components
+ uint8 _numScanComp;
+ Component **_scanComp;
+ Component *_currentComp;
+
+ // Maximum sampling factors, used to calculate the interleaving of the MCU
+ uint8 _maxFactorV;
+ uint8 _maxFactorH;
+
+ // Zig-Zag order
+ static uint8 _zigZagOrder[64];
+
+ // Quantization tables
+ uint16 *_quant[JPEG_MAX_QUANT_TABLES];
+
+ // Huffman tables
+ struct HuffmanTable {
+ uint8 count;
+ uint8 *values;
+ uint8 *sizes;
+ uint16 *codes;
+ } _huff[2 * JPEG_MAX_HUFF_TABLES];
+
+ // Marker read functions
+ bool readJFIF();
+ bool readSOF0();
+ bool readDHT();
+ bool readSOS();
+ bool readDQT();
+
+ // Helper functions
+ bool readMCU(uint16 xMCU, uint16 yMCU);
+ bool readDataUnit(uint16 x, uint16 y);
+ int16 readDC();
+ void readAC(int16 *out);
+ int16 readSignedBits(uint8 numBits);
+
+ // Huffman decoding
+ uint8 readHuff(uint8 table);
+ uint8 readBit();
+ uint8 _bitsData;
+ uint8 _bitsNumber;
+
+ // Discrete Cosine Transformation
+ float idct(int x, int y, int weight, int fx, int fy);
+};
+
+} // End of Graphics namespace
+
+#endif // GRAPHICS_JPEG_H
diff --git a/graphics/module.mk b/graphics/module.mk
index bf93822bee..37a7661f2e 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -11,6 +11,7 @@ MODULE_OBJS := \
fonts/scummfont.o \
iff.o \
imagedec.o \
+ jpeg.o \
primitives.o \
scaler.o \
scaler/thumbnail_intern.o \
--
cgit v1.2.3
From bf18c79ba602172fb5b01293b9dc2e98b75e2e09 Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Wed, 1 Jul 2009 15:08:11 +0000
Subject: Add JPEG support to 11H for ROQ playback
svn-id: r41991
---
engines/groovie/roq.cpp | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index cacc243c2c..3868443e96 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -29,6 +29,8 @@
#include "groovie/groovie.h"
#include "groovie/roq.h"
+#include "graphics/jpeg.h"
+
#ifdef ENABLE_RGB_COLOR
// Required for the YUV to RGB conversion
#include "graphics/dither.h"
@@ -485,18 +487,21 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in
bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block");
- warning("Groovie::ROQ: JPEG frame (unimplemented)");
+ warning("Groovie::ROQ: JPEG frame (unfinshed)");
+
+ Graphics::JPEG *jpg = new Graphics::JPEG();
+ jpg->read(_file);
+ byte *y = (byte *)jpg->getComponent(1)->getBasePtr(0, 0);
+ byte *u = (byte *)jpg->getComponent(2)->getBasePtr(0, 0);
+ byte *v = (byte *)jpg->getComponent(3)->getBasePtr(0, 0);
- // HACK: Initialize to a black frame
- //memset(_prevBuf->getBasePtr(0, 0), 0, _prevBuf->w * _prevBuf->h * _prevBuf->bytesPerPixel);
byte *ptr = (byte *)_prevBuf->getBasePtr(0, 0);
for (int i = 0; i < _prevBuf->w * _prevBuf->h; i++) {
- *ptr++ = 0;
- *ptr++ = 128;
- *ptr++ = 128;
+ *ptr++ = *y++;
+ *ptr++ = *u++;
+ *ptr++ = *v++;
}
- _file->skip(blockHeader.size);
return true;
}
--
cgit v1.2.3
From da1f41005cc4eb234cfab9e4a56cc5e4a15500cb Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Wed, 1 Jul 2009 15:10:30 +0000
Subject: Sync MSVC project files for JPEG addition
svn-id: r41992
---
dists/msvc7/scummvm.vcproj | 6 ++++++
dists/msvc71/scummvm.vcproj | 6 ++++++
dists/msvc8/scummvm.vcproj | 8 ++++++++
dists/msvc9/scummvm.vcproj | 8 ++++++++
4 files changed, 28 insertions(+)
diff --git a/dists/msvc7/scummvm.vcproj b/dists/msvc7/scummvm.vcproj
index 90a1f5655d..df54f5bffe 100644
--- a/dists/msvc7/scummvm.vcproj
+++ b/dists/msvc7/scummvm.vcproj
@@ -1081,6 +1081,12 @@
+
+
+
+
diff --git a/dists/msvc71/scummvm.vcproj b/dists/msvc71/scummvm.vcproj
index 5bfd240fc6..12fa4f164b 100644
--- a/dists/msvc71/scummvm.vcproj
+++ b/dists/msvc71/scummvm.vcproj
@@ -1095,6 +1095,12 @@
+
+
+
+
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index 5eca2b2009..78c6755ebd 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -1478,6 +1478,14 @@
RelativePath="..\..\graphics\imagedec.h"
>
+
+
+
+
diff --git a/dists/msvc9/scummvm.vcproj b/dists/msvc9/scummvm.vcproj
index a2ff0d45a9..7dda3aeaaa 100644
--- a/dists/msvc9/scummvm.vcproj
+++ b/dists/msvc9/scummvm.vcproj
@@ -1477,6 +1477,14 @@
RelativePath="..\..\graphics\imagedec.h"
>
+
+
+
+
--
cgit v1.2.3
From c753e68024d23f1128934c4730fbd4d7bdee8e61 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Wed, 1 Jul 2009 15:11:52 +0000
Subject: fix compile
svn-id: r41993
---
graphics/pixelformat.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 7c0d008b60..a1883291b9 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -200,6 +200,7 @@ struct PixelFormat {
return (1 << aBits()) - 1;
}
};
+
inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) {
#ifdef ENABLE_RGB_COLOR
for (Common::List::iterator i = backend.begin(); i != backend.end(); ++i) {
@@ -210,7 +211,7 @@ inline PixelFormat findCompatibleFormat(Common::List backend, Commo
}
#endif
return PixelFormat::createFormatCLUT8();
-};
+}
} // end of namespace Graphics
--
cgit v1.2.3
From c28af8ce941ea92fcf32b726ad03f2f854de342d Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 3 Jul 2009 09:33:58 +0000
Subject: Provided a virtual method for converting graphics rectangles from
screen format to hardware format, for backend developers wanting to provide
support for color component orders not directly supported in hardware. (This
could probably use a fair bit of looking over, it's ugly and has some fairly
arbitrary limitations)
svn-id: r42051
---
common/system.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/common/system.h b/common/system.h
index 4695ece4a4..be795f971a 100644
--- a/common/system.h
+++ b/common/system.h
@@ -997,6 +997,80 @@ public:
*/
virtual Common::WriteStream *createConfigWriteStream() = 0;
+#ifdef ENABLE_RGB_COLOR
+private:
+ /**
+ * Convert a rectangle from the screenformat to the hardwareformat.
+ *
+ * @param buf the buffer containing the graphics data source
+ * @param w the width of the destination rectangle
+ * @param h the height of the destination rectangle
+ * @param dest the pixel format currently set in hardware
+ * @return true if conversion completes successfully,
+ * false if there is an error.
+ *
+ * @note This implementation is slow. Please override this if
+ * your backend hardware has a better way to deal with this.
+ * @note This implementation requires the screen pixel format and
+ * the hardware pixel format to have a matching bytedepth
+ */
+ virtual bool convertRect(byte *buf, int w, int h,
+ Graphics::PixelFormat dest) {
+ Graphics::PixelFormat orig = getScreenFormat();
+
+ // Error out if conversion is impossible
+ if ((orig.bytesPerPixel != dest.bytesPerPixel) ||
+ (dest.bytesPerPixel == 1) || (!dest.bytesPerPixel))
+ return false;
+
+ // Don't perform unnecessary conversion
+ if (orig == dest)
+ return true;
+
+ byte *tmp = buf;
+ byte bytesPerPixel = dest.bytesPerPixel;
+ // Faster, but larger, to provide optimized handling for each case.
+ uint32 numpix = w * h;
+ if (bytesPerPixel == 2)
+ {
+ for (uint32 i = 0; i < numpix; i++) {
+ uint8 r,g,b,a;
+ uint16 color = *(uint16 *) tmp;
+ orig.colorToARGB(color, a, r, g, b);
+ color = dest.ARGBToColor(a, r, g, b);
+ memcpy(tmp,&color,bytesPerPixel);
+ tmp += 2;
+ }
+ } else if (bytesPerPixel == 3) {
+ for (uint32 i = 0; i < numpix; i++) {
+ uint8 r,g,b,a;
+ uint32 color;
+ uint8 *col = (uint8 *)&color;
+#ifdef SCUMM_BIG_ENDIAN
+ col++;
+#endif
+ memcpy(col,tmp,bytesPerPixel);
+ orig.colorToARGB(color, a, r, g, b);
+ color = dest.ARGBToColor(a, r, g, b);
+ memcpy(tmp,col,bytesPerPixel);
+ tmp += 3;
+ }
+ } else if (bytesPerPixel == 4) {
+ for (uint32 i = 0; i < numpix; i++) {
+ uint8 r,g,b,a;
+ uint32 color;
+ memcpy(&color,tmp,bytesPerPixel);
+ orig.colorToARGB(color, a, r, g, b);
+ color = dest.ARGBToColor(a, r, g, b);
+ memcpy(tmp,&color,bytesPerPixel);
+ tmp += 4;
+ }
+ } else {
+ return false;
+ }
+ return true;
+ };
+#endif // ENABLE_RGB_COLOR
//@}
};
--
cgit v1.2.3
From c37f1d9d5e5ee2e2745c75f99189fb197c605c63 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 3 Jul 2009 11:46:09 +0000
Subject: Cleaned up system.h, renamed OSystem::convertRect to
OSystem::convertScreenRect (still not very descriptive). Added
graphics/conversion.h and graphics/conversion.cpp with Graphics::crossBlit
function created from extending original contents of OSystem::convertRect
svn-id: r42057
---
common/system.h | 74 +++++-------------------
dists/msvc8/scummvm.vcproj | 8 +++
graphics/conversion.cpp | 138 +++++++++++++++++++++++++++++++++++++++++++++
graphics/conversion.h | 56 ++++++++++++++++++
4 files changed, 216 insertions(+), 60 deletions(-)
create mode 100644 graphics/conversion.cpp
create mode 100644 graphics/conversion.h
diff --git a/common/system.h b/common/system.h
index be795f971a..46e14589ab 100644
--- a/common/system.h
+++ b/common/system.h
@@ -31,6 +31,9 @@
#include "common/rect.h"
#include "graphics/pixelformat.h"
+#ifdef ENABLE_RGB_COLOR
+#include "graphics/conversion.h"
+#endif
namespace Audio {
class Mixer;
@@ -1000,12 +1003,15 @@ public:
#ifdef ENABLE_RGB_COLOR
private:
/**
- * Convert a rectangle from the screenformat to the hardwareformat.
+ * Convert a rectangle from the screen format to the hardware format.
*
- * @param buf the buffer containing the graphics data source
- * @param w the width of the destination rectangle
- * @param h the height of the destination rectangle
- * @param dest the pixel format currently set in hardware
+ * @param dstbuf the buffer which will recieve the converted graphics data
+ * @param srcbuf the buffer containing the original graphics data
+ * @param dstpitch width in bytes of one full line of the dest buffer
+ * @param srcpitch width in bytes of one full line of the source buffer
+ * @param w the width of the graphics data
+ * @param h the height of the graphics data
+ * @param hwFmt the pixel format currently set in hardware
* @return true if conversion completes successfully,
* false if there is an error.
*
@@ -1014,61 +1020,9 @@ private:
* @note This implementation requires the screen pixel format and
* the hardware pixel format to have a matching bytedepth
*/
- virtual bool convertRect(byte *buf, int w, int h,
- Graphics::PixelFormat dest) {
- Graphics::PixelFormat orig = getScreenFormat();
-
- // Error out if conversion is impossible
- if ((orig.bytesPerPixel != dest.bytesPerPixel) ||
- (dest.bytesPerPixel == 1) || (!dest.bytesPerPixel))
- return false;
-
- // Don't perform unnecessary conversion
- if (orig == dest)
- return true;
-
- byte *tmp = buf;
- byte bytesPerPixel = dest.bytesPerPixel;
- // Faster, but larger, to provide optimized handling for each case.
- uint32 numpix = w * h;
- if (bytesPerPixel == 2)
- {
- for (uint32 i = 0; i < numpix; i++) {
- uint8 r,g,b,a;
- uint16 color = *(uint16 *) tmp;
- orig.colorToARGB(color, a, r, g, b);
- color = dest.ARGBToColor(a, r, g, b);
- memcpy(tmp,&color,bytesPerPixel);
- tmp += 2;
- }
- } else if (bytesPerPixel == 3) {
- for (uint32 i = 0; i < numpix; i++) {
- uint8 r,g,b,a;
- uint32 color;
- uint8 *col = (uint8 *)&color;
-#ifdef SCUMM_BIG_ENDIAN
- col++;
-#endif
- memcpy(col,tmp,bytesPerPixel);
- orig.colorToARGB(color, a, r, g, b);
- color = dest.ARGBToColor(a, r, g, b);
- memcpy(tmp,col,bytesPerPixel);
- tmp += 3;
- }
- } else if (bytesPerPixel == 4) {
- for (uint32 i = 0; i < numpix; i++) {
- uint8 r,g,b,a;
- uint32 color;
- memcpy(&color,tmp,bytesPerPixel);
- orig.colorToARGB(color, a, r, g, b);
- color = dest.ARGBToColor(a, r, g, b);
- memcpy(tmp,&color,bytesPerPixel);
- tmp += 4;
- }
- } else {
- return false;
- }
- return true;
+ virtual bool convertScreenRect(byte *dstbuf, const byte *srcbuf, int dstpitch, int srcpitch,
+ int w, int h, Graphics::PixelFormat hwFmt) {
+ return Graphics::crossBlit(dstbuf,srcbuf,dstpitch,srcpitch,w,h,hwFmt,getScreenFormat());
};
#endif // ENABLE_RGB_COLOR
//@}
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index 78c6755ebd..5b75747cbf 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -1430,6 +1430,14 @@
RelativePath="..\..\graphics\colormasks.h"
>
+
+
+
+
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
new file mode 100644
index 0000000000..3db0bee33c
--- /dev/null
+++ b/graphics/conversion.cpp
@@ -0,0 +1,138 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "graphics/conversion.h"
+#include "common/scummsys.h"
+namespace Graphics {
+// TODO: YUV to RGB conversion function
+
+// Function to blit a rect from one color format to another
+bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
+ int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt) {
+ // Error out if conversion is impossible
+ if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1)
+ || (!srcFmt.bytesPerPixel) || (!dstFmt.bytesPerPixel)
+ || (srcFmt.bytesPerPixel > dstFmt.bytesPerPixel))
+ return false;
+
+ // Don't perform unnecessary conversion
+ if (srcFmt == dstFmt)
+ return true;
+
+ // Faster, but larger, to provide optimized handling for each case.
+ int srcDelta,dstDelta;
+ srcDelta = (srcpitch - w * srcFmt.bytesPerPixel);
+ dstDelta = (dstpitch - w * dstFmt.bytesPerPixel);
+
+ // TODO: optimized cases for dstDelta of 0
+ uint8 r,g,b,a;
+ if (dstFmt.bytesPerPixel == 2)
+ {
+ uint16 color;
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 2) {
+ color = *(uint16 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint16 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else if (dstFmt.bytesPerPixel == 3) {
+ uint32 color;
+ uint8 *col = (uint8 *) &color;
+#ifdef SCUMM_BIG_ENDIAN
+ col++;
+#endif
+ if (srcFmt.bytesPerPixel == 2) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 3) {
+ color = *(uint16 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ memcpy(dst,col,3);
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 3, dst += 3) {
+ uint8 r,g,b,a;
+ memcpy(col,src,3);
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ memcpy(dst,col,3);
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ }
+ } else if (dstFmt.bytesPerPixel == 4) {
+ uint32 color;
+ if (srcFmt.bytesPerPixel == 2) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 4) {
+ color = *(uint16 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint32 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else if (srcFmt.bytesPerPixel == 3) {
+ uint8 *col = (uint8 *)&color;
+#ifdef SCUMM_BIG_ENDIAN
+ col++;
+#endif
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 4) {
+ memcpy(col,src,3);
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint32 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 4, dst += 4) {
+ color = *(uint32 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint32 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ }
+ } else {
+ return false;
+ }
+ return true;
+}
+} // end of namespace Graphics
\ No newline at end of file
diff --git a/graphics/conversion.h b/graphics/conversion.h
new file mode 100644
index 0000000000..12015c498e
--- /dev/null
+++ b/graphics/conversion.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+#ifndef GRAPHICS_CONVERSION_H
+#define GRAPHICS_CONVERSION_H
+
+#include "common/scummsys.h"
+#include "graphics/pixelformat.h"
+namespace Graphics {
+
+// TODO: generic YUV to RGB pixel conversion
+// TODO: generic YUV to RGB blit
+
+/**
+ * Convert a rectangle from the one format to another, and blits it.
+ *
+ * @param dstbuf the buffer which will recieve the converted graphics data
+ * @param srcbuf the buffer containing the original graphics data
+ * @param dstpitch width in bytes of one full line of the dest buffer
+ * @param srcpitch width in bytes of one full line of the source buffer
+ * @param w the width of the graphics data
+ * @param h the height of the graphics data
+ * @param dstFmt the desired pixel format
+ * @param srcFmt the original pixel format
+ * @return true if conversion completes successfully,
+ * false if there is an error.
+ *
+ * @note This implementation currently requires the destination's
+ * format have at least as high a bitdepth as the source's.
+ *
+ */
+bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
+ int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt);
+} // end of namespace Graphics
+#endif //GRAPHICS_CONVERSION_H
\ No newline at end of file
--
cgit v1.2.3
From 8f44661611068df6dd40ed7f277bf854c4f97547 Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Fri, 3 Jul 2009 11:54:52 +0000
Subject: Add conversion.o to module.mk. Add missing endline.
svn-id: r42058
---
graphics/conversion.h | 2 +-
graphics/module.mk | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/graphics/conversion.h b/graphics/conversion.h
index 12015c498e..b04c9cb9d9 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -53,4 +53,4 @@ namespace Graphics {
bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt);
} // end of namespace Graphics
-#endif //GRAPHICS_CONVERSION_H
\ No newline at end of file
+#endif //GRAPHICS_CONVERSION_H
diff --git a/graphics/module.mk b/graphics/module.mk
index 37a7661f2e..8d7f2031c0 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -1,6 +1,7 @@
MODULE := graphics
MODULE_OBJS := \
+ conversion.o \
cursorman.o \
dither.o \
font.o \
--
cgit v1.2.3
From 255e51906298e8d06939cd1aa888e233b0eefa2a Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Fri, 3 Jul 2009 13:46:47 +0000
Subject: Fix some formatting bits
svn-id: r42059
---
graphics/conversion.cpp | 27 ++++++++++++++-------------
graphics/conversion.h | 12 ++++++++----
2 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
index 3db0bee33c..aa544ac718 100644
--- a/graphics/conversion.cpp
+++ b/graphics/conversion.cpp
@@ -23,15 +23,16 @@
*/
#include "graphics/conversion.h"
-#include "common/scummsys.h"
+
namespace Graphics {
+
// TODO: YUV to RGB conversion function
// Function to blit a rect from one color format to another
-bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
+bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt) {
// Error out if conversion is impossible
- if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1)
+ if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1)
|| (!srcFmt.bytesPerPixel) || (!dstFmt.bytesPerPixel)
|| (srcFmt.bytesPerPixel > dstFmt.bytesPerPixel))
return false;
@@ -41,14 +42,13 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
return true;
// Faster, but larger, to provide optimized handling for each case.
- int srcDelta,dstDelta;
+ int srcDelta, dstDelta;
srcDelta = (srcpitch - w * srcFmt.bytesPerPixel);
dstDelta = (dstpitch - w * dstFmt.bytesPerPixel);
// TODO: optimized cases for dstDelta of 0
- uint8 r,g,b,a;
- if (dstFmt.bytesPerPixel == 2)
- {
+ uint8 r, g, b, a;
+ if (dstFmt.bytesPerPixel == 2) {
uint16 color;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++, src += 2, dst += 2) {
@@ -72,7 +72,7 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
color = *(uint16 *) src;
srcFmt.colorToARGB(color, a, r, g, b);
color = dstFmt.ARGBToColor(a, r, g, b);
- memcpy(dst,col,3);
+ memcpy(dst, col, 3);
}
src += srcDelta;
dst += dstDelta;
@@ -80,11 +80,11 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
} else {
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++, src += 3, dst += 3) {
- uint8 r,g,b,a;
- memcpy(col,src,3);
+ uint8 r, g, b, a;
+ memcpy(col, src, 3);
srcFmt.colorToARGB(color, a, r, g, b);
color = dstFmt.ARGBToColor(a, r, g, b);
- memcpy(dst,col,3);
+ memcpy(dst, col, 3);
}
src += srcDelta;
dst += dstDelta;
@@ -110,7 +110,7 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
#endif
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++, src += 2, dst += 4) {
- memcpy(col,src,3);
+ memcpy(col, src, 3);
srcFmt.colorToARGB(color, a, r, g, b);
color = dstFmt.ARGBToColor(a, r, g, b);
*(uint32 *) dst = color;
@@ -135,4 +135,5 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
}
return true;
}
-} // end of namespace Graphics
\ No newline at end of file
+
+} // end of namespace Graphics
diff --git a/graphics/conversion.h b/graphics/conversion.h
index b04c9cb9d9..aa7cade982 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -22,11 +22,13 @@
* $Id$
*
*/
+
#ifndef GRAPHICS_CONVERSION_H
#define GRAPHICS_CONVERSION_H
#include "common/scummsys.h"
#include "graphics/pixelformat.h"
+
namespace Graphics {
// TODO: generic YUV to RGB pixel conversion
@@ -43,14 +45,16 @@ namespace Graphics {
* @param h the height of the graphics data
* @param dstFmt the desired pixel format
* @param srcFmt the original pixel format
- * @return true if conversion completes successfully,
+ * @return true if conversion completes successfully,
* false if there is an error.
*
- * @note This implementation currently requires the destination's
+ * @note This implementation currently requires the destination's
* format have at least as high a bitdepth as the source's.
*
*/
-bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
+bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt);
+
} // end of namespace Graphics
-#endif //GRAPHICS_CONVERSION_H
+
+#endif // GRAPHICS_CONVERSION_H
--
cgit v1.2.3
From d42f054f0b9c20764ac7eed31cd1ad11e69dc426 Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Fri, 3 Jul 2009 23:02:37 +0000
Subject: Moved the YUV<->RGB routines to graphics/conversion.h
svn-id: r42080
---
engines/gob/video_v6.cpp | 5 +++--
engines/groovie/roq.cpp | 4 ++--
graphics/conversion.h | 17 +++++++++++++++--
graphics/dither.cpp | 1 +
graphics/dither.h | 13 -------------
graphics/video/coktelvideo/coktelvideo.cpp | 5 +++--
6 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp
index c4efadde90..f0d554bd01 100644
--- a/engines/gob/video_v6.cpp
+++ b/engines/gob/video_v6.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
#include "common/savefile.h"
+#include "graphics/conversion.h"
#include "graphics/dither.h"
#include "gob/gob.h"
@@ -45,8 +46,8 @@ void Video_v6::setPrePalette() {
for (int i = 0; i < 256; i++) {
byte r, g, b;
- Graphics::PaletteLUT::YUV2RGB(fpal[i * 3 + 0], fpal[i * 3 + 1], fpal[i * 3 + 2],
- r, g, b);
+ Graphics::YUV2RGB(fpal[i * 3 + 0], fpal[i * 3 + 1], fpal[i * 3 + 2],
+ r, g, b);
tpal[i * 3 + 0] = r >> 2;
tpal[i * 3 + 1] = g >> 2;
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 3868443e96..4c8bbe55ac 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -33,7 +33,7 @@
#ifdef ENABLE_RGB_COLOR
// Required for the YUV to RGB conversion
-#include "graphics/dither.h"
+#include "graphics/conversion.h"
#endif
#include "sound/mixer.h"
@@ -173,7 +173,7 @@ void ROQPlayer::buildShowBuf() {
} else {
// Do the format conversion (YUV -> RGB -> Screen format)
byte r, g, b;
- Graphics::PaletteLUT::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
+ Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
// FIXME: this is fixed to 16bit
*(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
#endif // ENABLE_RGB_COLOR
diff --git a/graphics/conversion.h b/graphics/conversion.h
index aa7cade982..3226c38817 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -26,12 +26,25 @@
#ifndef GRAPHICS_CONVERSION_H
#define GRAPHICS_CONVERSION_H
-#include "common/scummsys.h"
+#include "common/util.h"
#include "graphics/pixelformat.h"
namespace Graphics {
-// TODO: generic YUV to RGB pixel conversion
+/** Converting a color from YUV to RGB colorspace. */
+inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
+ r = CLIP(y + ((1357 * (v - 128)) >> 10), 0, 255);
+ g = CLIP(y - (( 691 * (v - 128)) >> 10) - ((333 * (u - 128)) >> 10), 0, 255);
+ b = CLIP(y + ((1715 * (u - 128)) >> 10), 0, 255);
+}
+
+/** Converting a color from RGB to YUV colorspace. */
+inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
+ y = CLIP( ((r * 306) >> 10) + ((g * 601) >> 10) + ((b * 117) >> 10) , 0, 255);
+ u = CLIP(-((r * 172) >> 10) - ((g * 340) >> 10) + ((b * 512) >> 10) + 128, 0, 255);
+ v = CLIP( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
+}
+
// TODO: generic YUV to RGB blit
/**
diff --git a/graphics/dither.cpp b/graphics/dither.cpp
index 7a92441571..e671de265e 100644
--- a/graphics/dither.cpp
+++ b/graphics/dither.cpp
@@ -23,6 +23,7 @@
*/
#include "common/endian.h"
+#include "graphics/conversion.h"
#include "graphics/dither.h"
namespace Graphics {
diff --git a/graphics/dither.h b/graphics/dither.h
index e6d606cdd4..18f98ce4e0 100644
--- a/graphics/dither.h
+++ b/graphics/dither.h
@@ -43,19 +43,6 @@ public:
kPaletteYUV //!< Palette in YUV colorspace
};
- /** Converting a color from YUV to RGB colorspace. */
- inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
- r = CLIP(y + ((1357 * (v - 128)) >> 10), 0, 255);
- g = CLIP(y - (( 691 * (v - 128)) >> 10) - ((333 * (u - 128)) >> 10), 0, 255);
- b = CLIP(y + ((1715 * (u - 128)) >> 10), 0, 255);
- }
- /** Converting a color from RGB to YUV colorspace. */
- inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
- y = CLIP( ((r * 306) >> 10) + ((g * 601) >> 10) + ((b * 117) >> 10) , 0, 255);
- u = CLIP(-((r * 172) >> 10) - ((g * 340) >> 10) + ((b * 512) >> 10) + 128, 0, 255);
- v = CLIP( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
- }
-
/** Create a lookup table of a given depth and palette format.
*
* @param depth How many bits of each color component to consider.
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp
index 8603e125a6..9e0391ecc5 100644
--- a/graphics/video/coktelvideo/coktelvideo.cpp
+++ b/graphics/video/coktelvideo/coktelvideo.cpp
@@ -26,6 +26,7 @@
#include "common/endian.h"
#include "common/system.h"
+#include "graphics/conversion.h"
#include "graphics/dither.h"
#include "graphics/video/coktelvideo/coktelvideo.h"
#include "graphics/video/coktelvideo/indeo3.h"
@@ -1624,7 +1625,7 @@ void Vmd::blit16(byte *dest, byte *src, int16 srcPitch, int16 width, int16 heigh
byte b = ((data & 0x001F) >> 0);
byte dY, dU, dV;
- Graphics::PaletteLUT::RGB2YUV(r << 3, g << 3, b << 3, dY, dU, dV);
+ Graphics::RGB2YUV(r << 3, g << 3, b << 3, dY, dU, dV);
byte p = dither->dither(dY, dU, dV, j);
@@ -1658,7 +1659,7 @@ void Vmd::blit24(byte *dest, byte *src, int16 srcPitch, int16 width, int16 heigh
byte b = s[0];
byte dY, dU, dV;
- Graphics::PaletteLUT::RGB2YUV(r, g, b, dY, dU, dV);
+ Graphics::RGB2YUV(r, g, b, dY, dU, dV);
byte p = dither->dither(dY, dU, dV, j);
--
cgit v1.2.3
From 855a9587b94343a563f254998009fd3855ee8227 Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Sat, 4 Jul 2009 01:48:08 +0000
Subject: Sync MSVC project files for r42057
svn-id: r42083
---
dists/msvc7/scummvm.vcproj | 6 ++++++
dists/msvc71/scummvm.vcproj | 6 ++++++
dists/msvc9/scummvm.vcproj | 8 ++++++++
3 files changed, 20 insertions(+)
diff --git a/dists/msvc7/scummvm.vcproj b/dists/msvc7/scummvm.vcproj
index df54f5bffe..6a5c03f884 100644
--- a/dists/msvc7/scummvm.vcproj
+++ b/dists/msvc7/scummvm.vcproj
@@ -1045,6 +1045,12 @@
+
+
+
+
diff --git a/dists/msvc71/scummvm.vcproj b/dists/msvc71/scummvm.vcproj
index 12fa4f164b..b448d3579e 100644
--- a/dists/msvc71/scummvm.vcproj
+++ b/dists/msvc71/scummvm.vcproj
@@ -1059,6 +1059,12 @@
+
+
+
+
diff --git a/dists/msvc9/scummvm.vcproj b/dists/msvc9/scummvm.vcproj
index 7dda3aeaaa..47e9e842a5 100644
--- a/dists/msvc9/scummvm.vcproj
+++ b/dists/msvc9/scummvm.vcproj
@@ -1429,6 +1429,14 @@
RelativePath="..\..\graphics\colormasks.h"
>
+
+
+
+
--
cgit v1.2.3
From 6ef485f44896ad778d355bc1201f2f143cc9e770 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 4 Jul 2009 04:13:10 +0000
Subject: Fixed cursor corruption in non-8bit graphics games when switching
back from overlay.
svn-id: r42084
---
graphics/cursorman.cpp | 7 +++++--
graphics/cursorman.h | 18 ++++++++----------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 08a0b3bb88..9559b59d4a 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -77,7 +77,7 @@ void CursorManager::popCursor() {
if (!_cursorStack.empty()) {
cur = _cursorStack.top();
- g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_format);
+ g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, &cur->_format);
}
g_system->showMouse(isVisible());
@@ -135,7 +135,10 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
#ifdef ENABLE_RGB_COLOR
- cur->_format = format;
+ if (format)
+ cur->_format = *format;
+ else
+ cur->_format = Graphics::PixelFormat::createFormatCLUT8();
#endif
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index b744109b61..ab87c9b095 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -148,22 +148,20 @@ private:
int _hotspotX;
int _hotspotY;
uint32 _keycolor;
- const Graphics::PixelFormat *_format;
+ Graphics::PixelFormat _format;
byte _targetScale;
uint _size;
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
- if (!format) {
- _size = w * h;
- _keycolor &= 0xFF;
- } else {
- _size = w * h * format->bytesPerPixel;
- _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
- }
- _format = format;
+ if (!format)
+ _format = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ _format = *format;
+ _size = w * h * _format.bytesPerPixel;
+ _keycolor &= ((1 << (_format.bytesPerPixel << 3)) - 1);
#else
- _format = NULL;
+ _format = Graphics::PixelFormat::createFormatCLUT8();
_size = w * h;
_keycolor &= 0xFF;
#endif
--
cgit v1.2.3
From 4b1c6b526dbfa8d084fbd2475b4d4caa173e442c Mon Sep 17 00:00:00 2001
From: Henry Bush
Date: Sun, 5 Jul 2009 22:57:58 +0000
Subject: Groovie: get hotspots working correctly in 11H RGB
svn-id: r42158
---
engines/groovie/graphics.cpp | 4 ++--
engines/groovie/groovie.cpp | 1 +
engines/groovie/script.cpp | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index 647eaa913b..1e54f0e79b 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -31,8 +31,8 @@ namespace Groovie {
GraphicsMan::GraphicsMan(GroovieEngine *vm) :
_vm(vm), _changed(false), _fading(0) {
// Create the game surfaces
- _foreground.create(640, 320, 1);
- _background.create(640, 320, 1);
+ _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
+ _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
}
GraphicsMan::~GraphicsMan() {
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index f5db99dd4a..24f47351a3 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -82,6 +82,7 @@ Common::Error GroovieEngine::run() {
break;
case kGroovieT7G:
initGraphics(640, 480, true);
+ _pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
break;
}
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index eb53842b91..934400fb15 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -354,7 +354,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) {
Common::isDebugChannelEnabled(kGroovieDebugAll)) {
rect.translate(0, -80);
_vm->_graphicsMan->_foreground.frameRect(rect, 250);
- _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), 640, 0, 80, 640, 320);
+ _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320);
_vm->_system->updateScreen();
}
--
cgit v1.2.3
From 22e09bedaaf125365c6905187db80e939a86df53 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Mon, 6 Jul 2009 07:40:28 +0000
Subject: Updated doxygen comments on API functions
svn-id: r42166
---
common/system.h | 14 ++++++++++----
engines/engine.h | 2 ++
graphics/conversion.h | 9 ++++++---
graphics/cursorman.h | 11 ++++++-----
graphics/pixelformat.h | 14 +++++++++++++-
5 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/common/system.h b/common/system.h
index 6f3dc6b6c8..b37797811a 100644
--- a/common/system.h
+++ b/common/system.h
@@ -376,8 +376,10 @@ public:
*
* @see Graphics::PixelFormat
*
- * @note All backends supporting RGB color must be able to accept game data
- * in RGB color order, even if hardware uses BGR or some other color order.
+ * @note Backends supporting RGB color should accept game data in RGB color
+ * order, even if hardware uses BGR or some other color order.
+ *
+ * @see convertScreenRect
*/
virtual Common::List getSupportedFormats() const = 0;
#else
@@ -412,7 +414,7 @@ public:
* This is the pixel format for which the client code generates data;
* this is not necessarily equal to the hardware pixel format. For example,
* a backend may perform color lookup of 8-bit graphics before pushing
- * a screen to hardware, or correct the ARGB color order.
+ * a screen to hardware, or correct the ARGB color order via convertScreenRect.
*
* @param width the new virtual screen width
* @param height the new virtual screen height
@@ -1026,6 +1028,8 @@ public:
private:
/**
* Convert a rectangle from the screen format to the hardware format.
+ * Expected usage is for this to be called in copyRectToScreen when
+ * conversion is necessary.
*
* @param dstbuf the buffer which will recieve the converted graphics data
* @param srcbuf the buffer containing the original graphics data
@@ -1040,7 +1044,9 @@ private:
* @note This implementation is slow. Please override this if
* your backend hardware has a better way to deal with this.
* @note This implementation requires the screen pixel format and
- * the hardware pixel format to have a matching bytedepth
+ * the hardware pixel format to have a matching bytedepth.
+ * @note This is meant for RGB modes only, do not attempt
+ * to use it when running in 256 color mode.
*/
virtual bool convertScreenRect(byte *dstbuf, const byte *srcbuf, int dstpitch, int srcpitch,
int w, int h, Graphics::PixelFormat hwFmt) {
diff --git a/engines/engine.h b/engines/engine.h
index c643d5895f..d570f18073 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -59,6 +59,8 @@ void initCommonGFX(bool defaultTo1XScaler);
*
* Errors out when backend is not able to switch to the specified
* mode.
+ *
+ * Defaults to 256 color paletted mode if no graphics format is provided.
*/
void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format = NULL);
diff --git a/graphics/conversion.h b/graphics/conversion.h
index 3226c38817..b0314046b9 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -48,7 +48,7 @@ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
// TODO: generic YUV to RGB blit
/**
- * Convert a rectangle from the one format to another, and blits it.
+ * Blits a rectangle from one graphical format to another.
*
* @param dstbuf the buffer which will recieve the converted graphics data
* @param srcbuf the buffer containing the original graphics data
@@ -61,8 +61,11 @@ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
* @return true if conversion completes successfully,
* false if there is an error.
*
- * @note This implementation currently requires the destination's
- * format have at least as high a bitdepth as the source's.
+ * @note This implementation currently arbitrarily requires that the
+ * destination's format have at least as high a bytedepth as
+ * the source's.
+ * @note This can convert a rectangle in place, if the source and
+ * destination format have the same bytedepth.
*
*/
bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index ba11c9ef96..ae7008f54c 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -63,14 +63,14 @@ public:
* safely freed afterwards.
*
* @param buf the new cursor data
- * @param w the width
- * @param h the height
+ * @param w the width
+ * @param h the height
* @param hotspotX the hotspot X coordinate
* @param hotspotY the hotspot Y coordinate
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
- * @param format the pixel format which the cursor graphic uses
- *
+ * @param format a pointer to the pixel format which the cursor graphic uses,
+ * CLUT8 will be used if this is NULL or not specified.
* @note It is ok for the buffer to be a NULL pointer. It is sometimes
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
@@ -95,7 +95,8 @@ public:
* @param hotspotY the hotspot Y coordinate
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
- * @param format the pixel format which the cursor graphic uses
+ * @param format a pointer to the pixel format which the cursor graphic uses,
+ * CLUT8 will be used if this is NULL or not specified.
*/
void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index a1883291b9..bf18197f25 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -65,7 +65,11 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
- // "Factory" methods for convenience
+ /////////////////////////////////////////////////////////
+ // Convenience functions for creating standard formats //
+ /////////////////////////////////////////////////////////
+
+ // 256 color palette.
static inline PixelFormat createFormatCLUT8() {
return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
}
@@ -201,6 +205,14 @@ struct PixelFormat {
}
};
+/**
+ * Determines the first matching format between two lists.
+ *
+ * @param backend The higher priority list, meant to be a list of formats supported by the backend
+ * @param frontend The lower priority list, meant to be a list of formats supported by the engine
+ * @return The first item on the backend list that also occurs on the frontend list
+ * or PixelFormat::createFormatCLUT8() if no matching formats were found.
+ */
inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) {
#ifdef ENABLE_RGB_COLOR
for (Common::List::iterator i = backend.begin(); i != backend.end(); ++i) {
--
cgit v1.2.3
From c233459359ba43aeb6421469b32086036901a394 Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Mon, 6 Jul 2009 17:19:50 +0000
Subject: Groovie: Fix most ROQ glitches
svn-id: r42182
---
engines/groovie/roq.cpp | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 4c8bbe55ac..7389bda112 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -160,7 +160,7 @@ void ROQPlayer::buildShowBuf() {
for (int line = 0; line < _showBuf.h; line++) {
byte *out = (byte *)_showBuf.getBasePtr(0, line);
- byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
+ byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _showBuf.w; x++) {
if (_vm->_mode8bit) {
#ifdef DITHER
@@ -182,12 +182,17 @@ void ROQPlayer::buildShowBuf() {
// Skip to the next pixel
out += _vm->_pixelFormat.bytesPerPixel;
if (!(x % _scaleX))
- in += _prevBuf->bytesPerPixel;
+ in += _currBuf->bytesPerPixel;
}
#ifdef DITHER
_dither->nextLine();
#endif
}
+
+ // Swap buffers
+ Graphics::Surface *tmp = _prevBuf;
+ _prevBuf = _currBuf;
+ _currBuf = tmp;
}
bool ROQPlayer::playFrameInternal() {
@@ -200,7 +205,7 @@ bool ROQPlayer::playFrameInternal() {
}
if (_dirty) {
- // Build the show buffer from the previous (back) buffer
+ // Build the show buffer from the current buffer
buildShowBuf();
}
@@ -260,19 +265,15 @@ bool ROQPlayer::processBlock() {
case 0x1002: // Quad codebook definition
ok = processBlockQuadCodebook(blockHeader);
break;
- case 0x1011: { // Quad vector quantised video frame
+ case 0x1011: // Quad vector quantised video frame
ok = processBlockQuadVector(blockHeader);
_dirty = true;
endframe = true;
-
- // Swap buffers
- Graphics::Surface *tmp = _prevBuf;
- _prevBuf = _currBuf;
- _currBuf = tmp;
break;
- }
case 0x1012: // Still image (JPEG)
ok = processBlockStill(blockHeader);
+ _dirty = true;
+ endframe = true;
break;
case 0x1013: // Hang
assert(blockHeader.size == 0 && blockHeader.param == 0);
@@ -495,12 +496,13 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
byte *u = (byte *)jpg->getComponent(2)->getBasePtr(0, 0);
byte *v = (byte *)jpg->getComponent(3)->getBasePtr(0, 0);
- byte *ptr = (byte *)_prevBuf->getBasePtr(0, 0);
- for (int i = 0; i < _prevBuf->w * _prevBuf->h; i++) {
+ byte *ptr = (byte *)_currBuf->getBasePtr(0, 0);
+ for (int i = 0; i < _currBuf->w * _currBuf->h; i++) {
*ptr++ = *y++;
*ptr++ = *u++;
*ptr++ = *v++;
}
+ memcpy(_prevBuf->getBasePtr(0, 0), _currBuf->getBasePtr(0, 0), _prevBuf->w * _prevBuf->h * 3);
return true;
}
--
cgit v1.2.3
From 2c5d11b67b35f93b2292c1ca56d0c9fc89608921 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 7 Jul 2009 07:50:40 +0000
Subject: Removed PixelFormat convenience constructors at behest of Max and
Eugene.
svn-id: r42207
---
backends/platform/sdl/graphics.cpp | 2 +-
backends/platform/sdl/sdl.cpp | 4 +--
backends/platform/sdl/sdl.h | 47 +++++++++++++++++----------
common/system.h | 17 ++++++----
engines/groovie/groovie.cpp | 4 +--
engines/scumm/scumm.cpp | 3 +-
graphics/cursorman.cpp | 2 +-
graphics/cursorman.h | 4 +--
graphics/pixelformat.h | 65 ++------------------------------------
9 files changed, 53 insertions(+), 95 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 27f32ee8d2..95a3276fa5 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -361,7 +361,7 @@ void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format)
//avoid redundant format changes
Graphics::PixelFormat newFormat;
if (!format)
- newFormat = Graphics::PixelFormat::createFormatCLUT8();
+ newFormat = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
else
newFormat = *format;
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 105206ec07..f7bd71361f 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,8 +197,8 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_RGB_COLOR
- _screenFormat(Graphics::PixelFormat::createFormatCLUT8()),
- _cursorFormat(Graphics::PixelFormat::createFormatCLUT8()),
+ _screenFormat(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)),
+ _cursorFormat(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)),
#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 68dfe64d53..b8ab2f6d97 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -94,29 +94,44 @@ public:
if (HWFormat->BitsPerPixel >= 32)
{
list.push_back(Graphics::PixelFormat::createFormatRGBA8888());
- list.push_back(Graphics::PixelFormat::createFormatARGB8888());
- list.push_back(Graphics::PixelFormat::createFormatABGR8888());
- list.push_back(Graphics::PixelFormat::createFormatBGRA8888()); }
+ list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24)
+);
+ list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)
+);
+ list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0)
+); }
if (HWFormat->BitsPerPixel >= 24)
{
- list.push_back(Graphics::PixelFormat::createFormatRGB888());
- list.push_back(Graphics::PixelFormat::createFormatBGR888());
+ list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0)
+);
+ list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0)
+);
}
#endif //ENABLE_32BIT
if (HWFormat->BitsPerPixel >= 16)
{
- list.push_back(Graphics::PixelFormat::createFormatRGB565());
- list.push_back(Graphics::PixelFormat::createFormatXRGB1555());
- list.push_back(Graphics::PixelFormat::createFormatRGB555());
- list.push_back(Graphics::PixelFormat::createFormatRGBA4444());
- list.push_back(Graphics::PixelFormat::createFormatARGB4444());
- list.push_back(Graphics::PixelFormat::createFormatBGR565());
- list.push_back(Graphics::PixelFormat::createFormatXBGR1555());
- list.push_back(Graphics::PixelFormat::createFormatBGR555());
- list.push_back(Graphics::PixelFormat::createFormatABGR4444());
- list.push_back(Graphics::PixelFormat::createFormatBGRA4444());
+ list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0)
+);
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15)
+);
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
+);
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)
+);
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)
+);
+ list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0)
+);
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15)
+);
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)
+);
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12)
+);
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)
+);
}
- list.push_back(Graphics::PixelFormat::createFormatCLUT8());
+ list.push_back(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0));
return list;
}
#endif
diff --git a/common/system.h b/common/system.h
index b37797811a..63825f8401 100644
--- a/common/system.h
+++ b/common/system.h
@@ -368,11 +368,14 @@ public:
*
* EG: a backend that supports 32-bit ABGR and 16-bit 555 BGR in hardware
* and provides conversion from equivalent RGB(A) modes should order its list
- * 1) Graphics::PixelFormat::createFormatABGR8888()
- * 2) Graphics::PixelFormat::createFormatBGR555()
- * 3) Graphics::PixelFormat::createFormatRGBA8888()
- * 4) Graphics::PixelFormat::createFormatRGB555()
- * 5) Graphics::PixelFormat::createFormatCLUT8()
+ * 1) Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)
+
+ * 2) Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)
+
+ * 3) Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0)
+ * 4) Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
+
+ * 5) Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)
*
* @see Graphics::PixelFormat
*
@@ -384,12 +387,12 @@ public:
virtual Common::List getSupportedFormats() const = 0;
#else
inline Graphics::PixelFormat getScreenFormat() const {
- return Graphics::PixelFormat::createFormatCLUT8();
+ return Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
};
inline Common::List getSupportedFormats() const {
Common::List list;
- list.push_back(Graphics::PixelFormat::createFormatCLUT8());
+ list.push_back(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0));
return list;
};
#endif
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index cdf05e803b..c2f13e4f74 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -78,11 +78,11 @@ Common::Error GroovieEngine::run() {
// Save the enabled mode as it can be both an RGB mode or CLUT8
_pixelFormat = _system->getScreenFormat();
- _mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8());
+ _mode8bit = (_pixelFormat == Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0));
break;
case kGroovieT7G:
initGraphics(640, 480, true);
- _pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
+ _pixelFormat = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
break;
}
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c6ed7b71cc..347abee190 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,7 +1085,8 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
} else if (_game.features & GF_16BIT_COLOR) {
#ifdef ENABLE_RGB_COLOR
- Graphics::PixelFormat format = Graphics::PixelFormat::createFormatRGB555();
+ Graphics::PixelFormat format = Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
+;
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index b77aac37cf..3dd7c1d023 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -138,7 +138,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
if (format)
cur->_format = *format;
else
- cur->_format = Graphics::PixelFormat::createFormatCLUT8();
+ cur->_format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
#endif
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index ae7008f54c..b67241ab7b 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -181,13 +181,13 @@ private:
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- _format = Graphics::PixelFormat::createFormatCLUT8();
+ _format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
else
_format = *format;
_size = w * h * _format.bytesPerPixel;
_keycolor &= ((1 << (_format.bytesPerPixel << 3)) - 1);
#else
- _format = Graphics::PixelFormat::createFormatCLUT8();
+ _format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
_size = w * h;
_keycolor &= 0xFF;
#endif
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index bf18197f25..d7f5e851ad 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -65,67 +65,6 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
- /////////////////////////////////////////////////////////
- // Convenience functions for creating standard formats //
- /////////////////////////////////////////////////////////
-
- // 256 color palette.
- static inline PixelFormat createFormatCLUT8() {
- return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
- }
- // 2 Bytes-per-pixel modes
- static inline PixelFormat createFormatRGB555() {
- return PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0);
- }
- static inline PixelFormat createFormatBGR555() {
- return PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0);
- }
- static inline PixelFormat createFormatXRGB1555() {
- // Special case, alpha bit is always high in this mode.
- return PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15);
- }
- static inline PixelFormat createFormatXBGR1555() {
- // Special case, alpha bit is always high in this mode.
- return PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15);
- }
- static inline PixelFormat createFormatRGB565() {
- return PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0);
- }
- static inline PixelFormat createFormatBGR565() {
- return PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0);
- }
- static inline PixelFormat createFormatRGBA4444() {
- return PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0);
- }
- static inline PixelFormat createFormatARGB4444() {
- return PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12);
- }
- static inline PixelFormat createFormatABGR4444() {
- return PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12);
- }
- static inline PixelFormat createFormatBGRA4444() {
- return PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0);
- }
- // 3 to 4 byte per pixel modes
- static inline PixelFormat createFormatRGB888() {
- return PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0);
- }
- static inline PixelFormat createFormatBGR888() {
- return PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0);
- }
- static inline PixelFormat createFormatRGBA8888() {
- return PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0);
- }
- static inline PixelFormat createFormatARGB8888() {
- return PixelFormat(4, 0, 0, 0, 0, 16 ,8, 0, 24);
- }
- static inline PixelFormat createFormatABGR8888() {
- return PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24);
- }
- static inline PixelFormat createFormatBGRA8888() {
- return PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0);
- }
-
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
return 0 == memcmp(this, &fmt, sizeof(PixelFormat));
@@ -211,7 +150,7 @@ struct PixelFormat {
* @param backend The higher priority list, meant to be a list of formats supported by the backend
* @param frontend The lower priority list, meant to be a list of formats supported by the engine
* @return The first item on the backend list that also occurs on the frontend list
- * or PixelFormat::createFormatCLUT8() if no matching formats were found.
+ * or PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0) if no matching formats were found.
*/
inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) {
#ifdef ENABLE_RGB_COLOR
@@ -222,7 +161,7 @@ inline PixelFormat findCompatibleFormat(Common::List backend, Commo
}
}
#endif
- return PixelFormat::createFormatCLUT8();
+ return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
}
} // end of namespace Graphics
--
cgit v1.2.3
From 566c3bb781b8d4fbd86f8a3b24cea3438cd63a75 Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Tue, 7 Jul 2009 09:38:08 +0000
Subject: Groovie: Fix a memory leak in still frames
svn-id: r42210
---
engines/groovie/roq.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 856befe63f..538b1b7111 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -505,6 +505,7 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
}
memcpy(_prevBuf->getBasePtr(0, 0), _currBuf->getBasePtr(0, 0), _prevBuf->w * _prevBuf->h * 3);
+ delete jpg;
return true;
}
--
cgit v1.2.3
From 1f9c1e4c441ffa0c18f6087fd4240a44e05a2fbf Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Tue, 7 Jul 2009 11:18:40 +0000
Subject: Groovie: Added video skipping functionality in 11h, verified some
opcode usage in v2 and some bits of formatting
svn-id: r42213
---
engines/groovie/groovie.cpp | 7 +++-
engines/groovie/script.cpp | 98 ++++++++++++++++++++++++++++-----------------
engines/groovie/script.h | 7 +++-
3 files changed, 72 insertions(+), 40 deletions(-)
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index c2f13e4f74..039efd2c49 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -218,13 +218,18 @@ Common::Error GroovieEngine::run() {
case Common::EVENT_LBUTTONDOWN:
// Send the event to the scripts
- _script.setMouseClick();
+ _script.setMouseClick(1);
// Continue the script execution to handle
// the click
_waitingForInput = false;
break;
+ case Common::EVENT_RBUTTONDOWN:
+ // Send the event to the scripts (to skip the video)
+ _script.setMouseClick(2);
+ break;
+
case Common::EVENT_QUIT:
quitGame();
break;
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 934400fb15..6dd1124fce 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -101,6 +101,7 @@ Script::Script(GroovieEngine *vm, EngineVersion version) :
_hotspotSlot = (uint16)-1;
_oldInstruction = (uint16)-1;
+ _videoSkipAddress = 0;
}
Script::~Script() {
@@ -230,8 +231,8 @@ void Script::step() {
(this->*op)();
}
-void Script::setMouseClick() {
- _eventMouseClicked = true;
+void Script::setMouseClick(uint8 button) {
+ _eventMouseClicked = button;
}
void Script::setKbdChar(uint8 c) {
@@ -525,7 +526,6 @@ void Script::o_videofromref() { // 0x09
bool Script::playvideofromref(uint32 fileref) {
// It isn't the current video, open it
if (fileref != _videoRef) {
-
// Debug bitflags
debugScript(1, false, "Play video 0x%04X (bitflags:", fileref);
for (int i = 15; i >= 0; i--) {
@@ -554,6 +554,21 @@ bool Script::playvideofromref(uint32 fileref) {
}
_bitflags = 0;
+
+ // Reset the clicked mouse events
+ _eventMouseClicked = 0;
+ }
+
+ // Check if the user wants to skip the video
+ if ((_eventMouseClicked == 2) && (_videoSkipAddress != 0)) {
+ // Jump to the given address
+ _currentInstruction = _videoSkipAddress;
+
+ // Reset the skip address
+ _videoSkipAddress = 0;
+
+ // End the playback
+ return true;
}
// Video available, play one frame
@@ -567,7 +582,7 @@ bool Script::playvideofromref(uint32 fileref) {
_videoRef = 0;
// Clear the input events while playing the video
- _eventMouseClicked = false;
+ _eventMouseClicked = 0;
_eventKbdChar = 0;
// Newline
@@ -598,8 +613,8 @@ void Script::o_inputloopstart() { //0x0B
_inputLoopAddress = _currentInstruction - 1;
// Save the current mouse state for the whole loop
- _mouseClicked = _eventMouseClicked;
- _eventMouseClicked = false;
+ _mouseClicked = (_eventMouseClicked == 1);
+ _eventMouseClicked = 0;
// Save the current pressed character for the whole loop
_kbdChar = _eventKbdChar;
@@ -1378,7 +1393,7 @@ void Script::o_sub() {
void Script::o_cellmove() {
uint16 arg = readScript8bits();
byte *scriptBoard = &_variables[0x19];
- byte *board = (byte*) malloc (BOARDSIZE * BOARDSIZE * sizeof(byte));
+ byte *board = (byte *) malloc (BOARDSIZE * BOARDSIZE * sizeof(byte));
byte startX, startY, endX, endY;
debugScript(1, true, "CELL MOVE var[0x%02X]", arg);
@@ -1396,14 +1411,13 @@ void Script::o_cellmove() {
debugScript(1, false, "\n");
}
- CellGame staufsMove((byte*) board);
- staufsMove.calcMove((byte*) board, CELL_GREEN, 2);
+ CellGame staufsMove((byte *) board);
+ staufsMove.calcMove((byte *) board, CELL_GREEN, 2);
startX = staufsMove.getStartX();
startY = staufsMove.getStartY();
endX = staufsMove.getEndX();
endY = staufsMove.getEndY();
-
// Set the movement origin
setVariable(0, startY); // y
setVariable(1, startX); // x
@@ -1411,7 +1425,7 @@ void Script::o_cellmove() {
setVariable(2, endY);
setVariable(3, endX);
- free (board);
+ free(board);
}
void Script::o_returnscript() {
@@ -1535,20 +1549,19 @@ void Script::o_stub59() {
debugScript(1, true, "STUB59: 0x%04X 0x%02X", val1, val2);
}
-void Script::o2_playsong(){
+void Script::o2_playsong() {
uint32 fileref = readScript32bits();
debugScript(1, true, "PlaySong(0x%08X): Play xmidi file", fileref);
_vm->_musicPlayer->playSong(fileref);
-
}
-void Script::o2_setbackgroundsong(){
+void Script::o2_setbackgroundsong() {
uint32 fileref = readScript32bits();
debugScript(1, true, "SetBackgroundSong(0x%08X)", fileref);
_vm->_musicPlayer->setBackgroundSong(fileref);
}
-void Script::o2_videofromref(){
+void Script::o2_videofromref() {
uint32 fileref = readScript32bits();
// Show the debug information just when starting the playback
@@ -1556,6 +1569,7 @@ void Script::o2_videofromref(){
debugScript(1, true, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref);
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X via 0x09", fileref);
}
+
// Play the video
if (!playvideofromref(fileref)) {
// Move _currentInstruction back
@@ -1563,7 +1577,7 @@ void Script::o2_videofromref(){
}
}
-void Script::o2_vdxtransition(){
+void Script::o2_vdxtransition() {
uint32 fileref = readScript32bits();
// Show the debug information just when starting the playback
@@ -1587,11 +1601,21 @@ void Script::o2_vdxtransition(){
}
}
-void Script::o2_stub52(){
+void Script::o2_setvideoskip() {
+ _videoSkipAddress = readScript16bits();
+ debugScript(1, true, "SetVideoSkip (0x%04X)", _videoSkipAddress);
+}
+
+void Script::o2_stub52() {
uint8 arg = readScript8bits();
debugScript(1, true, "STUB52 (0x%02X)", arg);
}
+void Script::o2_setscriptend() {
+ uint16 arg = readScript16bits();
+ debugScript(1, true, "SetScriptEnd (0x%04X)", arg);
+}
+
Script::OpcodeFunc Script::_opcodesT7G[NUM_OPCODES] = {
&Script::o_nop, // 0x00
&Script::o_nop,
@@ -1692,11 +1716,11 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_invalid, // 0x00
&Script::o_nop,
&Script::o2_playsong,
- &Script::o_bf9on,
- &Script::o_palfadeout, // 0x04
- &Script::o_bf8on,
- &Script::o_bf6on,
- &Script::o_bf7on,
+ &Script::o_nop,
+ &Script::o_nop, // 0x04
+ &Script::o_nop,
+ &Script::o_nop,
+ &Script::o_nop,
&Script::o2_setbackgroundsong, // 0x08
&Script::o2_videofromref,
&Script::o_bf5on,
@@ -1719,7 +1743,7 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_xor_obfuscate,
&Script::o2_vdxtransition, // 0x1C
&Script::o_swap,
- &Script::o_nop8,
+ &Script::o_invalid,
&Script::o_inc,
&Script::o_dec, // 0x20
&Script::o_strcmpnejmp_var,
@@ -1729,10 +1753,10 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_add,
&Script::o_videofromstring1,
&Script::o_videofromstring2,
- &Script::o_nop16, // 0x28
- &Script::o_stopmidi,
- &Script::o_endscript,
+ &Script::o_invalid, // 0x28
&Script::o_nop,
+ &Script::o_endscript,
+ &Script::o_invalid,
&Script::o_sethotspottop, // 0x2C
&Script::o_sethotspotbottom,
&Script::o_loadgame,
@@ -1759,22 +1783,22 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_returnscript,
&Script::o_sethotspotright, // 0x44
&Script::o_sethotspotleft,
- &Script::o_nop,
- &Script::o_nop,
- &Script::o_nop8, // 0x48
- &Script::o_nop,
- &Script::o_nop16,
- &Script::o_nop8,
- &Script::o_getcd, // 0x4C
- &Script::o_playcd,
+ &Script::o_invalid,
+ &Script::o_invalid,
+ &Script::o_invalid, // 0x48
+ &Script::o_invalid,
&Script::o_nop16,
+ &Script::o_invalid,
+ &Script::o_invalid, // 0x4C
+ &Script::o_invalid,
+ &Script::o_invalid,
&Script::o_nop16,
&Script::o_nop16, // 0x50
- &Script::o_nop16,
+ &Script::o2_setvideoskip,
&Script::o2_stub52,
&Script::o_hotspot_outrect,
- &Script::o_nop, // 0x54
- &Script::o_nop16,
+ &Script::o_invalid, // 0x54
+ &Script::o2_setscriptend,
&Script::o_stub56,
&Script::o_invalid,
&Script::o_invalid, // 0x58
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index 664cac82d8..8a95f093ce 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -57,7 +57,7 @@ public:
void directGameLoad(int slot);
void step();
- void setMouseClick();
+ void setMouseClick(uint8 button);
void setKbdChar(uint8 c);
Common::String &getContext();
@@ -95,7 +95,7 @@ private:
// Input
bool _mouseClicked;
- bool _eventMouseClicked;
+ uint8 _eventMouseClicked;
uint8 _kbdChar;
uint8 _eventKbdChar;
uint16 _inputLoopAddress;
@@ -114,6 +114,7 @@ private:
Common::SeekableReadStream *_videoFile;
uint32 _videoRef;
uint16 _bitflags;
+ uint16 _videoSkipAddress;
// Debugging
Debugger *_debugger;
@@ -224,7 +225,9 @@ private:
void o2_setbackgroundsong();
void o2_videofromref();
void o2_vdxtransition();
+ void o2_setvideoskip();
void o2_stub52();
+ void o2_setscriptend();
};
} // End of Groovie namespace
--
cgit v1.2.3
From 131aaefa0c52393ecbfbb756eb9acad0505a2924 Mon Sep 17 00:00:00 2001
From: Max Horn
Date: Tue, 7 Jul 2009 13:16:23 +0000
Subject: Don't #define M_PI in graphics/jpeg.h (it clashes with math.h, and
it's bad style to #define constants in a header that you only use locally ;);
instead use PI from common/scummsys.h
svn-id: r42218
---
graphics/jpeg.cpp | 4 ++--
graphics/jpeg.h | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp
index ce0568816c..ce31eb0175 100644
--- a/graphics/jpeg.cpp
+++ b/graphics/jpeg.cpp
@@ -408,8 +408,8 @@ bool JPEG::readMCU(uint16 xMCU, uint16 yMCU) {
}
float JPEG::idct(int x, int y, int weight, int fx, int fy) {
- float vx = cos((2 * x + 1) * fx * M_PI / 16);
- float vy = cos((2 * y + 1) * fy * M_PI / 16);
+ float vx = cos((2 * x + 1) * fx * PI / 16);
+ float vy = cos((2 * y + 1) * fy * PI / 16);
float ret = (float)weight * vx * vy;
if (fx == 0)
diff --git a/graphics/jpeg.h b/graphics/jpeg.h
index d9097055e1..f4743a5e83 100644
--- a/graphics/jpeg.h
+++ b/graphics/jpeg.h
@@ -26,8 +26,6 @@
#ifndef GRAPHICS_JPEG_H
#define GRAPHICS_JPEG_H
-#define M_PI 3.141592f
-
#include "common/stream.h"
#include "graphics/surface.h"
--
cgit v1.2.3
From bd87b653aca29c593cadcdedfc2208cec51456aa Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Tue, 7 Jul 2009 14:04:18 +0000
Subject: Properly handle odd-sized JPEG files (ie, those not a multiple of 8
pixels)
svn-id: r42220
---
graphics/jpeg.cpp | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp
index ce31eb0175..0ad2cf7699 100644
--- a/graphics/jpeg.cpp
+++ b/graphics/jpeg.cpp
@@ -354,6 +354,13 @@ bool JPEG::readSOS() {
// Read all the scan MCUs
uint16 xMCU = _w / (_maxFactorH * 8);
uint16 yMCU = _h / (_maxFactorV * 8);
+
+ // Check for non- multiple-of-8 dimensions
+ if (_w % 8 != 0)
+ xMCU++;
+ if (_h % 8 != 0)
+ yMCU++;
+
bool ok = true;
for (int y = 0; ok && (y < yMCU); y++)
for (int x = 0; ok && (x < xMCU); x++)
@@ -478,12 +485,21 @@ bool JPEG::readDataUnit(uint16 x, uint16 y) {
// Convert coordinates from MCU blocks to pixels
x <<= 3;
y <<= 3;
- for (int j = 0; j < 8; j++) {
+
+ // Handle non- multiple-of-8 dimensions
+ byte xLim = 8;
+ byte yLim = 8;
+ if (x*scalingH + 8 > _w)
+ xLim -= (x*scalingH + 8 - _w);
+ if (y*scalingV + 8 > _h)
+ yLim -= (y*scalingV + 8 - _h);
+
+ for (int j = 0; j < yLim; j++) {
for (int sV = 0; sV < scalingV; sV++) {
// Get the beginning of the block line
byte *ptr = (byte *)_currentComp->surface.getBasePtr(x * scalingH, (y + j) * scalingV + sV);
- for (int i = 0; i < 8; i++) {
+ for (int i = 0; i < xLim; i++) {
for (uint8 sH = 0; sH < scalingH; sH++) {
*ptr = (byte)(result[j * 8 + i]);
ptr++;
--
cgit v1.2.3
From 828ed66555b99363fed62b4cbb83c36de68c3024 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 8 Jul 2009 16:07:58 +0000
Subject: Reinstated static inline Graphics::PixelFormat::createFormatCLUT8(),
which I am told was not supposed to be removed with the others.
svn-id: r42268
---
backends/platform/sdl/graphics.cpp | 2 +-
backends/platform/sdl/sdl.cpp | 4 +--
backends/platform/sdl/sdl.h | 51 ++++++++++++++------------------------
common/system.h | 6 ++---
engines/groovie/groovie.cpp | 4 +--
graphics/cursorman.cpp | 2 +-
graphics/cursorman.h | 4 +--
graphics/pixelformat.h | 8 ++++--
8 files changed, 35 insertions(+), 46 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 95a3276fa5..27f32ee8d2 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -361,7 +361,7 @@ void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format)
//avoid redundant format changes
Graphics::PixelFormat newFormat;
if (!format)
- newFormat = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ newFormat = Graphics::PixelFormat::createFormatCLUT8();
else
newFormat = *format;
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index f7bd71361f..105206ec07 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -197,8 +197,8 @@ OSystem_SDL::OSystem_SDL()
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
#ifdef ENABLE_RGB_COLOR
- _screenFormat(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)),
- _cursorFormat(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)),
+ _screenFormat(Graphics::PixelFormat::createFormatCLUT8()),
+ _cursorFormat(Graphics::PixelFormat::createFormatCLUT8()),
#endif
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index b8ab2f6d97..c2648e8ed7 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -94,44 +94,29 @@ public:
if (HWFormat->BitsPerPixel >= 32)
{
list.push_back(Graphics::PixelFormat::createFormatRGBA8888());
- list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24)
-);
- list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)
-);
- list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0)
-); }
+ list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24));
+ list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24));
+ list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0));
+ }
if (HWFormat->BitsPerPixel >= 24)
{
- list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0)
-);
- list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0)
-);
+ list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0));
+ list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0));
}
#endif //ENABLE_32BIT
- if (HWFormat->BitsPerPixel >= 16)
- {
- list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0)
-);
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15)
-);
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
-);
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)
-);
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)
-);
- list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0)
-);
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15)
-);
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)
-);
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12)
-);
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)
-);
+ if (HWFormat->BitsPerPixel >= 16) {
+ list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0));
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15));
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0));
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0));
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12));
+ list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0));
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15));
+ list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0));
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12));
+ list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0));
}
- list.push_back(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0));
+ list.push_back(Graphics::PixelFormat::createFormatCLUT8());
return list;
}
#endif
diff --git a/common/system.h b/common/system.h
index 63825f8401..6bcf746292 100644
--- a/common/system.h
+++ b/common/system.h
@@ -375,7 +375,7 @@ public:
* 3) Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0)
* 4) Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
- * 5) Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)
+ * 5) Graphics::PixelFormat::createFormatCLUT8()
*
* @see Graphics::PixelFormat
*
@@ -387,12 +387,12 @@ public:
virtual Common::List getSupportedFormats() const = 0;
#else
inline Graphics::PixelFormat getScreenFormat() const {
- return Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ return Graphics::PixelFormat::createFormatCLUT8();
};
inline Common::List getSupportedFormats() const {
Common::List list;
- list.push_back(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0));
+ list.push_back(Graphics::PixelFormat::createFormatCLUT8());
return list;
};
#endif
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 039efd2c49..6f985ddad5 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -78,11 +78,11 @@ Common::Error GroovieEngine::run() {
// Save the enabled mode as it can be both an RGB mode or CLUT8
_pixelFormat = _system->getScreenFormat();
- _mode8bit = (_pixelFormat == Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0));
+ _mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8());
break;
case kGroovieT7G:
initGraphics(640, 480, true);
- _pixelFormat = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ _pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
break;
}
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 3dd7c1d023..b77aac37cf 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -138,7 +138,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
if (format)
cur->_format = *format;
else
- cur->_format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ cur->_format = Graphics::PixelFormat::createFormatCLUT8();
#endif
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index b67241ab7b..ae7008f54c 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -181,13 +181,13 @@ private:
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- _format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ _format = Graphics::PixelFormat::createFormatCLUT8();
else
_format = *format;
_size = w * h * _format.bytesPerPixel;
_keycolor &= ((1 << (_format.bytesPerPixel << 3)) - 1);
#else
- _format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ _format = Graphics::PixelFormat::createFormatCLUT8();
_size = w * h;
_keycolor &= 0xFF;
#endif
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index d7f5e851ad..380df985d9 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -65,6 +65,10 @@ struct PixelFormat {
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
+ static inline PixelFormat createFormatCLUT8() {
+ return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ }
+
inline bool operator==(const PixelFormat &fmt) const {
// TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored.
return 0 == memcmp(this, &fmt, sizeof(PixelFormat));
@@ -150,7 +154,7 @@ struct PixelFormat {
* @param backend The higher priority list, meant to be a list of formats supported by the backend
* @param frontend The lower priority list, meant to be a list of formats supported by the engine
* @return The first item on the backend list that also occurs on the frontend list
- * or PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0) if no matching formats were found.
+ * or PixelFormat::createFormatCLUT8() if no matching formats were found.
*/
inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) {
#ifdef ENABLE_RGB_COLOR
@@ -161,7 +165,7 @@ inline PixelFormat findCompatibleFormat(Common::List backend, Commo
}
}
#endif
- return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ return PixelFormat::createFormatCLUT8();
}
} // end of namespace Graphics
--
cgit v1.2.3
From 1d38ead4e78fafa0d2f97dccf889ea392059eb0f Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Thu, 9 Jul 2009 09:06:31 +0000
Subject: Removed #ifdef blocks around new error values in Common::Error and
OSystem::TransactionError.
svn-id: r42280
---
common/error.h | 2 --
common/system.h | 6 ++----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/common/error.h b/common/error.h
index 6522fbf4af..d91ce2971a 100644
--- a/common/error.h
+++ b/common/error.h
@@ -48,9 +48,7 @@ enum Error {
kInvalidPathError, //!< Engine initialization: Invalid game path was passed
kNoGameDataFoundError, //!< Engine initialization: No game data was found in the specified location
kUnsupportedGameidError, //!< Engine initialization: Gameid not supported by this (Meta)Engine
-#ifdef ENABLE_RGB_COLOR
kUnsupportedColorMode, //!< Engine initialization: Engine does not support backend's color mode
-#endif
kReadPermissionDenied, //!< Unable to read data due to missing read permission
diff --git a/common/system.h b/common/system.h
index 6bcf746292..097348be19 100644
--- a/common/system.h
+++ b/common/system.h
@@ -472,10 +472,8 @@ public:
kTransactionAspectRatioFailed = (1 << 0), /**< Failed switchting aspect ratio correction mode */
kTransactionFullscreenFailed = (1 << 1), /**< Failed switchting fullscreen mode */
kTransactionModeSwitchFailed = (1 << 2), /**< Failed switchting the GFX graphics mode (setGraphicsMode) */
-#ifdef ENABLE_RGB_COLOR
- kTransactionFormatNotSupported = (1 << 4), /**< Failed setting the color format (function not yet implemented) */
-#endif
- kTransactionSizeChangeFailed = (1 << 3) /**< Failed switchting the screen dimensions (initSize) */
+ kTransactionSizeChangeFailed = (1 << 3), /**< Failed switchting the screen dimensions (initSize) */
+ kTransactionFormatNotSupported = (1 << 4) /**< Failed setting the color format */
};
/**
--
cgit v1.2.3
From cdad3763dfbacf45599034358a32fc68032e1a30 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Thu, 9 Jul 2009 09:09:05 +0000
Subject: Corrected lingering formatting errors that were introduced by the
find-and-replace assisted removal of Graphics::PixelFormat::createFormat
functions.
svn-id: r42281
---
common/system.h | 3 ---
engines/scumm/scumm.cpp | 3 +--
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/common/system.h b/common/system.h
index 097348be19..c13887e0a9 100644
--- a/common/system.h
+++ b/common/system.h
@@ -369,12 +369,9 @@ public:
* EG: a backend that supports 32-bit ABGR and 16-bit 555 BGR in hardware
* and provides conversion from equivalent RGB(A) modes should order its list
* 1) Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)
-
* 2) Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)
-
* 3) Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0)
* 4) Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
-
* 5) Graphics::PixelFormat::createFormatCLUT8()
*
* @see Graphics::PixelFormat
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 347abee190..57283c1fbe 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,8 +1085,7 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
} else if (_game.features & GF_16BIT_COLOR) {
#ifdef ENABLE_RGB_COLOR
- Graphics::PixelFormat format = Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
-;
+ Graphics::PixelFormat format = Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0);
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
--
cgit v1.2.3
From a4f3a8390068fc372a96d4473b91eb09158353ef Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Thu, 9 Jul 2009 09:10:05 +0000
Subject: corrected creation of one Graphics::PixelFormat to reflect the
resurrection of Graphics::PixelFormat::createFormatCLUT8
svn-id: r42282
---
backends/platform/sdl/graphics.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 27f32ee8d2..3029f43d87 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1379,7 +1379,7 @@ void OSystem_SDL::warpMouse(int x, int y) {
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- _cursorFormat = Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+ _cursorFormat = Graphics::PixelFormat::createFormatCLUT8;
else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
_cursorFormat = *format;
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
--
cgit v1.2.3
From ff208c5387a8566546a384afa9ab48c0a1f356a0 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Thu, 9 Jul 2009 17:25:06 +0000
Subject: fix compile
svn-id: r42308
---
backends/platform/sdl/graphics.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 3029f43d87..fa162a6348 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1379,7 +1379,7 @@ void OSystem_SDL::warpMouse(int x, int y) {
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- _cursorFormat = Graphics::PixelFormat::createFormatCLUT8;
+ _cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
_cursorFormat = *format;
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
--
cgit v1.2.3
From a5d374bded6204c9250155d572d23b0caef636a5 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 06:46:50 +0000
Subject: Moved OSystem_SDL::getSupportedFormats function body from
platforms/sdl/sdl.h to platforms/sdl/graphics.cpp, Improved and simplified
list-generation method for OSystem_SDL::getSupportedFormats.
svn-id: r42325
---
backends/platform/sdl/graphics.cpp | 70 ++++++++++++++++++++++++++++++++++++++
backends/platform/sdl/sdl.h | 34 +-----------------
common/system.h | 2 +-
3 files changed, 72 insertions(+), 34 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index fa162a6348..61f33569af 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -26,6 +26,9 @@
#include "backends/platform/sdl/sdl.h"
#include "common/mutex.h"
#include "common/util.h"
+#ifdef ENABLE_RGB_COLOR
+#include "common/list.h"
+#endif
#include "graphics/font.h"
#include "graphics/fontman.h"
#include "graphics/scaler.h"
@@ -206,6 +209,73 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
return (TransactionError)errors;
}
+#ifdef ENABLE_RGB_COLOR
+const Graphics::PixelFormat RGBList[] = {
+#ifdef ENABLE_32BIT
+ // RGBA8888, ARGB8888, RGB888
+ Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0),
+ Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24),
+ Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0),
+#endif
+ // RGB565, XRGB1555, RGB555, RGBA4444, ARGB4444
+ Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0),
+ Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15),
+ Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0),
+ Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0),
+ Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)
+};
+const Graphics::PixelFormat BGRList[] = {
+#ifdef ENABLE_32BIT
+ // ABGR8888, BGRA8888, BGR888
+ Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24),
+ Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0),
+ Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0),
+#endif
+ // BGR565, XBGR1555, BGR555, ABGR4444, BGRA4444
+ Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0),
+ Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15),
+ Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0),
+ Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12),
+ Graphics::PixelFormat(2, 3, 3, 3, 8, 4, 8, 12, 0)
+};
+
+// TODO: prioritize matching alpha masks
+Common::List OSystem_SDL::getSupportedFormats() {
+ static Common::List list;
+ if (!list.empty())
+ return list;
+ bool BGR = false;
+ int listLength = ARRAYSIZE(RGBList);
+
+ // Get our currently set format
+ Graphics::PixelFormat format(_hwscreen->format->BytesPerPixel,
+ _hwscreen->format->Rloss, _hwscreen->format->Gloss,
+ _hwscreen->format->Bloss, _hwscreen->format->Aloss,
+ _hwscreen->format->Rshift, _hwscreen->format->Gshift,
+ _hwscreen->format->Bshift, _hwscreen->format->Ashift);
+
+ // Push it first, as the prefered format.
+ list.push_back(format);
+ if (format.bShift > format.rShift)
+ BGR = true;
+ for (int i = 0; i < listLength; i++) {
+ if (RGBList[i].bytesPerPixel > format.bytesPerPixel)
+ continue;
+ if (BGR) {
+ if (BGRList[i] != format)
+ list.push_back(BGRList[i]);
+ list.push_back(RGBList[i]);
+ } else {
+ if (RGBList[i] != format)
+ list.push_back(RGBList[i]);
+ list.push_back(BGRList[i]);
+ }
+ }
+ list.push_back(Graphics::PixelFormat::createFormatCLUT8());
+ return list;
+}
+#endif
+
bool OSystem_SDL::setGraphicsMode(int mode) {
Common::StackLock lock(_graphicsMutex);
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index c2648e8ed7..3e074a884a 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -86,39 +86,7 @@ public:
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
// Highest supported
- virtual Common::List getSupportedFormats() const {
- //TODO determine hardware color component order
- Common::List list;
- SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt;
-#ifdef ENABLE_32BIT
- if (HWFormat->BitsPerPixel >= 32)
- {
- list.push_back(Graphics::PixelFormat::createFormatRGBA8888());
- list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24));
- list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24));
- list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0));
- }
- if (HWFormat->BitsPerPixel >= 24)
- {
- list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0));
- list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0));
- }
-#endif //ENABLE_32BIT
- if (HWFormat->BitsPerPixel >= 16) {
- list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0));
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15));
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0));
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0));
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12));
- list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0));
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15));
- list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0));
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12));
- list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0));
- }
- list.push_back(Graphics::PixelFormat::createFormatCLUT8());
- return list;
- }
+ virtual Common::List getSupportedFormats();
#endif
// Set the size and format of the video bitmap.
diff --git a/common/system.h b/common/system.h
index c13887e0a9..d09b32c8c6 100644
--- a/common/system.h
+++ b/common/system.h
@@ -381,7 +381,7 @@ public:
*
* @see convertScreenRect
*/
- virtual Common::List getSupportedFormats() const = 0;
+ virtual Common::List getSupportedFormats() = 0;
#else
inline Graphics::PixelFormat getScreenFormat() const {
return Graphics::PixelFormat::createFormatCLUT8();
--
cgit v1.2.3
From 689ad3d07c9d0b1c88d4679578ed70190de80b6b Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 07:08:54 +0000
Subject: removed OSystem::convertScreenRect as unnecessary and bloatful.
svn-id: r42326
---
common/system.h | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/common/system.h b/common/system.h
index d09b32c8c6..2dd4293690 100644
--- a/common/system.h
+++ b/common/system.h
@@ -1022,35 +1022,6 @@ public:
*/
virtual Common::WriteStream *createConfigWriteStream() = 0;
-#ifdef ENABLE_RGB_COLOR
-private:
- /**
- * Convert a rectangle from the screen format to the hardware format.
- * Expected usage is for this to be called in copyRectToScreen when
- * conversion is necessary.
- *
- * @param dstbuf the buffer which will recieve the converted graphics data
- * @param srcbuf the buffer containing the original graphics data
- * @param dstpitch width in bytes of one full line of the dest buffer
- * @param srcpitch width in bytes of one full line of the source buffer
- * @param w the width of the graphics data
- * @param h the height of the graphics data
- * @param hwFmt the pixel format currently set in hardware
- * @return true if conversion completes successfully,
- * false if there is an error.
- *
- * @note This implementation is slow. Please override this if
- * your backend hardware has a better way to deal with this.
- * @note This implementation requires the screen pixel format and
- * the hardware pixel format to have a matching bytedepth.
- * @note This is meant for RGB modes only, do not attempt
- * to use it when running in 256 color mode.
- */
- virtual bool convertScreenRect(byte *dstbuf, const byte *srcbuf, int dstpitch, int srcpitch,
- int w, int h, Graphics::PixelFormat hwFmt) {
- return Graphics::crossBlit(dstbuf,srcbuf,dstpitch,srcpitch,w,h,hwFmt,getScreenFormat());
- };
-#endif // ENABLE_RGB_COLOR
//@}
};
--
cgit v1.2.3
From cf6d4c0b209e7bdce7a948e2a01882f3f2d53d31 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 09:45:26 +0000
Subject: Fixed some branch-specific vsprops configuration, that was lost in
the merge to using .vsprops files
svn-id: r42329
---
dists/msvc8/ScummVM_Global.vsprops | 2 +-
dists/msvc8/groovie.vcproj | 260 ++++++++++++++++++++++++++++++++-----
2 files changed, 229 insertions(+), 33 deletions(-)
diff --git a/dists/msvc8/ScummVM_Global.vsprops b/dists/msvc8/ScummVM_Global.vsprops
index 7ba00aac7b..7b3192aa51 100644
--- a/dists/msvc8/ScummVM_Global.vsprops
+++ b/dists/msvc8/ScummVM_Global.vsprops
@@ -10,7 +10,7 @@
Name="VCCLCompilerTool"
DisableSpecificWarnings="4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE"
+ PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR"
ExceptionHandling="0"
RuntimeTypeInfo="false"
WarningLevel="4"
diff --git a/dists/msvc8/groovie.vcproj b/dists/msvc8/groovie.vcproj
index f62cef0f94..cc8f060b06 100644
--- a/dists/msvc8/groovie.vcproj
+++ b/dists/msvc8/groovie.vcproj
@@ -8,41 +8,237 @@
Keyword="Win32Proj"
>
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.2.3
From 2f370ef8ab65db8443c496c47de98740b31c4220 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 10:43:48 +0000
Subject: Overloaded initGraphics to provide for simpler procedures for engines
supporting more than one format.
svn-id: r42330
---
engines/engine.cpp | 16 +++++++++++++++-
engines/engine.h | 4 +++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 1fd77eb310..399f188962 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -131,7 +131,13 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
initCommonGFX(defaultTo1xScaler);
#ifdef ENABLE_RGB_COLOR
- g_system->initSize(width, height, format);
+ if (format)
+ g_system->initSize(width, height, format);
+ else {
+ Graphics::PixelFormat Format = g_system->getSupportedFormats().front();
+ debug("%d,%X,%X,%X",Format.bytesPerPixel << 3, Format.rBits(), Format.gBits(), Format.bBits());
+ g_system->initSize(width, height, &Format);
+ }
#else
g_system->initSize(width, height);
#endif
@@ -183,6 +189,14 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
dialog.runModal();
}
}
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List &formatList) {
+ Graphics::PixelFormat format = Graphics::findCompatibleFormat(g_system->getSupportedFormats(),formatList);
+ initGraphics(width,height,defaultTo1xScaler,&format);
+}
+void initGraphics(int width, int height, bool defaultTo1xScaler) {
+ Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
+ initGraphics(width,height,defaultTo1xScaler,&format);
+}
void GUIErrorMessage(const Common::String msg) {
g_system->setWindowCaption("Error");
diff --git a/engines/engine.h b/engines/engine.h
index d570f18073..0f5585378b 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -62,7 +62,9 @@ void initCommonGFX(bool defaultTo1XScaler);
*
* Defaults to 256 color paletted mode if no graphics format is provided.
*/
-void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format = NULL);
+void initGraphics(int width, int height, bool defaultTo1xScaler);
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format);
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List &formatList);
/**
* Initializes graphics and shows error message.
--
cgit v1.2.3
From bb1da36710b8ddc5dd3d4bbf7414dd20b7a646b3 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 10:45:15 +0000
Subject: Simplified SCI and groovie's initial graphics setup making use of the
overloaded functions.
svn-id: r42331
---
engines/groovie/groovie.cpp | 3 +--
engines/sci/sci.cpp | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 6f985ddad5..bb4e142196 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -73,8 +73,7 @@ Common::Error GroovieEngine::run() {
switch (_gameDescription->version) {
case kGroovieV2:
// Request the mode with the highest precision available
- _pixelFormat = _system->getSupportedFormats().front();
- initGraphics(640, 480, true, &_pixelFormat);
+ initGraphics(640, 480, true, NULL);
// Save the enabled mode as it can be both an RGB mode or CLUT8
_pixelFormat = _system->getScreenFormat();
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index dbb8d4784a..cf08c69738 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -106,8 +106,7 @@ SciEngine::~SciEngine() {
Common::Error SciEngine::run() {
Graphics::PixelFormat gfxmode;
#ifdef ENABLE_RGB_COLOR
- gfxmode = _system->getSupportedFormats().front();
- initGraphics(320, 200, false, &gfxmode);
+ initGraphics(320, 200, false, NULL);
#else
initGraphics(320, 200, false);
#endif
--
cgit v1.2.3
From ddcab8169f45055c8272648279c3dd96432ba956 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 10:47:25 +0000
Subject: updated comment on initGraphics as I should have done before
commiting r42330.
svn-id: r42332
---
engines/engine.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/engines/engine.h b/engines/engine.h
index 0f5585378b..cd39c0065d 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -61,6 +61,8 @@ void initCommonGFX(bool defaultTo1XScaler);
* mode.
*
* Defaults to 256 color paletted mode if no graphics format is provided.
+ * Uses the backend's preferred format if graphics format pointer is NULL.
+ * Finds the best compatible format if a list of graphics formats is provided.
*/
void initGraphics(int width, int height, bool defaultTo1xScaler);
void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format);
--
cgit v1.2.3
From 02e639ea0ceaa4b6a530847dbb043a5c2352e4a2 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 19:55:06 +0000
Subject: Fixed a couple of errors in the new getSupportedFormats
implementation.
svn-id: r42350
---
backends/platform/sdl/graphics.cpp | 39 ++++++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 61f33569af..ea9c285a44 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -242,22 +242,37 @@ const Graphics::PixelFormat BGRList[] = {
// TODO: prioritize matching alpha masks
Common::List OSystem_SDL::getSupportedFormats() {
static Common::List list;
- if (!list.empty())
+ static bool inited = false;
+
+ if (inited)
return list;
+
bool BGR = false;
int listLength = ARRAYSIZE(RGBList);
- // Get our currently set format
- Graphics::PixelFormat format(_hwscreen->format->BytesPerPixel,
- _hwscreen->format->Rloss, _hwscreen->format->Gloss,
- _hwscreen->format->Bloss, _hwscreen->format->Aloss,
- _hwscreen->format->Rshift, _hwscreen->format->Gshift,
- _hwscreen->format->Bshift, _hwscreen->format->Ashift);
-
- // Push it first, as the prefered format.
- list.push_back(format);
- if (format.bShift > format.rShift)
- BGR = true;
+ Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
+ if (_hwscreen) {
+ // Get our currently set hardware format
+ format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel,
+ _hwscreen->format->Rloss, _hwscreen->format->Gloss,
+ _hwscreen->format->Bloss, _hwscreen->format->Aloss,
+ _hwscreen->format->Rshift, _hwscreen->format->Gshift,
+ _hwscreen->format->Bshift, _hwscreen->format->Ashift);
+
+ // Workaround to MacOSX SDL not providing an accurate Aloss value.
+ if (_hwscreen->format->Amask == 0)
+ format.aLoss = 8;
+
+ // Push it first, as the prefered format.
+ list.push_back(format);
+
+ if (format.bShift > format.rShift)
+ BGR = true;
+
+ // Mark that we don't need to do this any more.
+ inited = true;
+ }
+
for (int i = 0; i < listLength; i++) {
if (RGBList[i].bytesPerPixel > format.bytesPerPixel)
continue;
--
cgit v1.2.3
From 70c138651dc71f886a4314943c4e9a753dc44607 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 10 Jul 2009 19:56:40 +0000
Subject: Whoops, and one more.
svn-id: r42351
---
backends/platform/sdl/graphics.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index ea9c285a44..a090db01b6 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -274,7 +274,7 @@ Common::List OSystem_SDL::getSupportedFormats() {
}
for (int i = 0; i < listLength; i++) {
- if (RGBList[i].bytesPerPixel > format.bytesPerPixel)
+ if (inited && (RGBList[i].bytesPerPixel > format.bytesPerPixel))
continue;
if (BGR) {
if (BGRList[i] != format)
--
cgit v1.2.3
From 79e03a92a5782797dd5beacef3a63ed3dbdee68d Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Mon, 13 Jul 2009 19:24:41 +0000
Subject: Removed an unneeded debug console output from initGraphics
svn-id: r42450
---
engines/engine.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 399f188962..eb46add82f 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -135,7 +135,6 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
g_system->initSize(width, height, format);
else {
Graphics::PixelFormat Format = g_system->getSupportedFormats().front();
- debug("%d,%X,%X,%X",Format.bytesPerPixel << 3, Format.rBits(), Format.gBits(), Format.bBits());
g_system->initSize(width, height, &Format);
}
#else
--
cgit v1.2.3
From f7a2a9170ff9cbb3b71025c51b4fd870294b5a13 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Mon, 13 Jul 2009 19:45:25 +0000
Subject: Fixed logic error in Graphics::crossBlit which would result in no
blit occuring if src and dst have the same format. Converted
Graphics::crossBlit to take PixelFormats by reference, instead of copying
them for each call.
svn-id: r42451
---
graphics/conversion.cpp | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
index aa544ac718..1863814c1d 100644
--- a/graphics/conversion.cpp
+++ b/graphics/conversion.cpp
@@ -30,7 +30,7 @@ namespace Graphics {
// Function to blit a rect from one color format to another
bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
- int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt) {
+ int w, int h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt) {
// Error out if conversion is impossible
if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1)
|| (!srcFmt.bytesPerPixel) || (!dstFmt.bytesPerPixel)
@@ -38,8 +38,21 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
return false;
// Don't perform unnecessary conversion
- if (srcFmt == dstFmt)
- return true;
+ if (srcFmt == dstFmt) {
+ if (dst == src)
+ return true;
+ if (dstpitch == srcpitch && ((w * dstFmt.bytesPerPixel) == dstpitch)) {
+ memcpy(dst,src,dstpitch * h);
+ return true;
+ } else {
+ for (int i = 0; i < h; i++) {
+ memcpy(dst,src,w * dstFmt.bytesPerPixel);
+ dst += dstpitch;
+ src += srcpitch;
+ }
+ return true;
+ }
+ }
// Faster, but larger, to provide optimized handling for each case.
int srcDelta, dstDelta;
--
cgit v1.2.3
From cdf751accda346f5d96e3fdfa2fd4a1b92ed4d19 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 14 Jul 2009 08:27:36 +0000
Subject: changed generic Graphics::PixelFormat constructor to take xBits
instead of xLoss. Modified OSystem_SDL::getSupportedFormats and
ScummEngine::init to account for this change.
svn-id: r42467
---
backends/platform/sdl/graphics.cpp | 26 +++++++++++++-------------
engines/scumm/scumm.cpp | 2 +-
graphics/pixelformat.h | 10 +++++-----
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index a090db01b6..4e47db0827 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -213,30 +213,30 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
const Graphics::PixelFormat RGBList[] = {
#ifdef ENABLE_32BIT
// RGBA8888, ARGB8888, RGB888
- Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0),
- Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24),
- Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0),
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0),
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24),
+ Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0),
#endif
// RGB565, XRGB1555, RGB555, RGBA4444, ARGB4444
- Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0),
- Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15),
- Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0),
+ Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),
+ Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15),
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0),
Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0),
Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)
};
const Graphics::PixelFormat BGRList[] = {
#ifdef ENABLE_32BIT
// ABGR8888, BGRA8888, BGR888
- Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24),
- Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0),
- Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0),
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24),
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0),
+ Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0),
#endif
// BGR565, XBGR1555, BGR555, ABGR4444, BGRA4444
- Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0),
- Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15),
- Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0),
+ Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0),
+ Graphics::PixelFormat(2, 5, 5, 5, 1, 0, 5, 10, 15),
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0),
Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12),
- Graphics::PixelFormat(2, 3, 3, 3, 8, 4, 8, 12, 0)
+ Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)
};
// TODO: prioritize matching alpha masks
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 8d078f12d4..a00ace1f49 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,7 +1085,7 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
} else if (_game.features & GF_16BIT_COLOR) {
#ifdef ENABLE_RGB_COLOR
- Graphics::PixelFormat format = Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0);
+ Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 380df985d9..d16de51ea7 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -57,16 +57,16 @@ struct PixelFormat {
rShift = gShift = bShift = aShift = 0;
}
- inline PixelFormat(int BytesPerPixel,
- int RLoss, int GLoss, int BLoss, int ALoss,
- int RShift, int GShift, int BShift, int AShift) {
+ inline PixelFormat(byte BytesPerPixel,
+ byte RBits, byte GBits, byte BBits, byte ABits,
+ byte RShift, byte GShift, byte BShift, byte AShift) {
bytesPerPixel = BytesPerPixel;
- rLoss = RLoss, gLoss = GLoss, bLoss = BLoss, aLoss = ALoss;
+ rLoss = 8 - RBits, gLoss = 8 - GBits, bLoss = 8 - BBits, aLoss = 8 - ABits;
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
}
static inline PixelFormat createFormatCLUT8() {
- return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+ return PixelFormat(1, 0, 0, 0, 0, 0, 0, 0, 0);
}
inline bool operator==(const PixelFormat &fmt) const {
--
cgit v1.2.3
From 52a160657f4db676e30b6d52abbf513154aad662 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Sun, 19 Jul 2009 15:00:39 +0000
Subject: Fix 16bit color when using the hardware screen's pixel format. The
call was never updated after r42467.
svn-id: r42617
---
backends/platform/sdl/graphics.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 4e47db0827..6d9f3fc6eb 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -254,8 +254,8 @@ Common::List OSystem_SDL::getSupportedFormats() {
if (_hwscreen) {
// Get our currently set hardware format
format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel,
- _hwscreen->format->Rloss, _hwscreen->format->Gloss,
- _hwscreen->format->Bloss, _hwscreen->format->Aloss,
+ 8 - _hwscreen->format->Rloss, 8 - _hwscreen->format->Gloss,
+ 8 - _hwscreen->format->Bloss, 8 - _hwscreen->format->Aloss,
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
_hwscreen->format->Bshift, _hwscreen->format->Ashift);
--
cgit v1.2.3
From a565441f0cce65b6a3bee713c1e88f2ad7c67c76 Mon Sep 17 00:00:00 2001
From: Max Horn
Date: Tue, 28 Jul 2009 22:33:20 +0000
Subject: Added missing initializer for member ‘Sci::gfx_mode_t::format'
svn-id: r42867
---
engines/sci/gfx/gfx_resmgr.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index cd5b1be431..ca61b534ed 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -326,7 +326,8 @@ gfx_mode_t mode_1x1_color_index = { /* Fake 1x1 mode */
/* palette */ NULL,
/* color masks */ 0, 0, 0, 0,
- /* color shifts */ 0, 0, 0, 0
+ /* color shifts */ 0, 0, 0, 0,
+ Graphics::PixelFormat()
};
gfxr_pic_t *GfxResManager::getPic(int num, int maps, int flags, int default_palette, bool scaled) {
--
cgit v1.2.3
From aec91dfec48c5f4b2d88de2b4217893ebbc56129 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 5 Aug 2009 02:37:19 +0000
Subject: Enable keymapper in global config defines, no actual code changes
yet.
svn-id: r43064
---
dists/msvc8/ScummVM_Global.vsprops | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dists/msvc8/ScummVM_Global.vsprops b/dists/msvc8/ScummVM_Global.vsprops
index 7b3192aa51..be8e9df17f 100644
--- a/dists/msvc8/ScummVM_Global.vsprops
+++ b/dists/msvc8/ScummVM_Global.vsprops
@@ -10,7 +10,7 @@
Name="VCCLCompilerTool"
DisableSpecificWarnings="4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR"
+ PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR;ENABLE_KEYMAPPER"
ExceptionHandling="0"
RuntimeTypeInfo="false"
WarningLevel="4"
--
cgit v1.2.3
From 19609e1bdeafe5d76f059ade3a80b64cc6f53200 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 5 Aug 2009 16:27:29 +0000
Subject: Added common\EventRecorder.cpp, common\EventRecorder.h and
common\EventDispatcher.cpp to the msvc8 project so that it compiles.
svn-id: r43070
---
dists/msvc8/scummvm.vcproj | 1912 +++++++++++++++++++++++++++++++++++---------
1 file changed, 1548 insertions(+), 364 deletions(-)
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index ab89c8d91f..fbea20d7fc 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -8,209 +8,867 @@
Keyword="Win32Proj"
>
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -233,156 +891,558 @@
/>
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -405,8 +1465,14 @@
/>
-
-
+
+
+
+
@@ -429,51 +1495,169 @@
/>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.2.3
From 8062d37283bcf8390d8fb66cce99c2bfd65668d8 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 5 Aug 2009 21:32:42 +0000
Subject: Some groundwork for a better implementation of modifier keys.
(incomplete, and breaks previous implementation)
svn-id: r43078
---
backends/keymapper/hardware-key.h | 40 +++++
backends/keymapper/types.h | 1 +
backends/platform/sdl/hardwarekeys.cpp | 302 +++++++++++++++++----------------
gui/GuiManager.cpp | 26 +--
4 files changed, 207 insertions(+), 162 deletions(-)
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 8ddeada51e..c8c1d3c145 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -64,6 +64,29 @@ struct HardwareKey {
}
};
+/**
+* Describes an available hardware modifier
+*/
+struct HardwareMod {
+ /** unique id used for saving/loading to config */
+ char hwModId[HWKEY_ID_SIZE];
+
+ /** Human readable description */
+ String description;
+
+ /**
+ * The modifier flags that are generated by the
+ * back-end when this modifier key is pressed.
+ */
+ byte modFlags;
+
+ HardwareMod(const char *i, byte mf, String desc = "")
+ : modFlags(mf), description(desc) {
+ assert(i);
+ strncpy(hwModId, i, HWKEY_ID_SIZE);
+ }
+};
+
/**
* Simple class to encapsulate a device's set of HardwareKeys.
@@ -80,6 +103,11 @@ public:
delete *it;
}
+ void addHardwareMod(HardwareMod *mod) {
+ checkForMod(mod);
+ _mods.push_back(mod);
+ }
+
void addHardwareKey(HardwareKey *key) {
checkForKey(key);
_keys.push_back(key);
@@ -127,7 +155,19 @@ private:
}
}
+ void checkForMod(HardwareMod *mod) {
+ List::iterator it;
+
+ for (it = _mods.begin(); it != _mods.end(); it++) {
+ if (strncmp((*it)->hwModId, mod->hwModId, HWKEY_ID_SIZE) == 0)
+ error("Error adding HardwareMod '%s' - id of %s already in use!", mod->description.c_str(), mod->hwModId);
+ else if ((*it)->modFlags == mod->modFlags)
+ error("Error adding HardwareMod '%s' - modFlags already in use!", mod->description.c_str());
+ }
+ }
+
List _keys;
+ List _mods;
};
diff --git a/backends/keymapper/types.h b/backends/keymapper/types.h
index 7ad4c0e538..004a90bfcd 100644
--- a/backends/keymapper/types.h
+++ b/backends/keymapper/types.h
@@ -43,6 +43,7 @@ enum KeyType {
kTriggerRightKeyType,
kStartKeyType,
kSelectKeyType,
+// kModiferKeyType,
/* ... */
kKeyTypeMax
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index 1a8124bbf3..bba48286f0 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -37,161 +37,170 @@ struct Key {
uint16 ascii;
const char *desc;
KeyType preferredAction;
- bool shiftable;
+ int32 modableMask;
};
static const Key keys[] = {
- {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, false},
- {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, false},
- {"CLEAR", KEYCODE_CLEAR, 0, "Clear", kActionKeyType, false},
- {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", kActionKeyType, false},
- {"PAUSE", KEYCODE_PAUSE, 0, "Pause", kActionKeyType, false},
- {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", kStartKeyType, false},
- {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", kActionKeyType, false},
- {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", kActionKeyType, false},
- {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", kActionKeyType, false},
- {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, false},
- {"DOLLAR", KEYCODE_DOLLAR, '$', "$", kActionKeyType, false},
- {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", kActionKeyType, false},
- {"QUOTE", KEYCODE_QUOTE, '\'', "'", kActionKeyType, false},
- {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", kActionKeyType, false},
- {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", kActionKeyType, false},
- {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, false},
- {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false},
- {"COMMA", KEYCODE_COMMA, ',', ",", kActionKeyType, false},
- {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false},
- {"PERIOD", KEYCODE_PERIOD, '.', ".", kActionKeyType, false},
- {"SLASH", KEYCODE_SLASH, '/', "/", kActionKeyType, false},
- {"0", KEYCODE_0, '0', "0", kActionKeyType, false},
- {"1", KEYCODE_1, '1', "1", kActionKeyType, false},
- {"2", KEYCODE_2, '2', "2", kActionKeyType, false},
- {"3", KEYCODE_3, '3', "3", kActionKeyType, false},
- {"4", KEYCODE_4, '4', "4", kActionKeyType, false},
- {"5", KEYCODE_5, '5', "5", kActionKeyType, false},
- {"6", KEYCODE_6, '6', "6", kActionKeyType, false},
- {"7", KEYCODE_7, '7', "7", kActionKeyType, false},
- {"8", KEYCODE_8, '8', "8", kActionKeyType, false},
- {"9", KEYCODE_9, '9', "9", kActionKeyType, false},
- {"COLON", KEYCODE_COLON, ':', ":", kActionKeyType, false},
- {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", kActionKeyType, false},
- {"LESS", KEYCODE_LESS, '<', "<", kActionKeyType, false},
- {"EQUALS", KEYCODE_EQUALS, '=', "=", kActionKeyType, false},
- {"GREATER", KEYCODE_GREATER, '>', ">", kActionKeyType, false},
- {"QUESTION", KEYCODE_QUESTION, '?', "?", kActionKeyType, false},
- {"AT", KEYCODE_AT, '@', "@", kActionKeyType, false},
-
- {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", kActionKeyType, false},
- {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", kActionKeyType, false},
- {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", kActionKeyType, false},
- {"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, false},
- {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, false},
- {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, false},
- {"a", KEYCODE_a, 'a', "a", kActionKeyType, true},
- {"b", KEYCODE_b, 'b', "b", kActionKeyType, true},
- {"c", KEYCODE_c, 'c', "c", kActionKeyType, true},
- {"d", KEYCODE_d, 'd', "d", kActionKeyType, true},
- {"e", KEYCODE_e, 'e', "e", kActionKeyType, true},
- {"f", KEYCODE_f, 'f', "f", kActionKeyType, true},
- {"g", KEYCODE_g, 'g', "g", kActionKeyType, true},
- {"h", KEYCODE_h, 'h', "h", kActionKeyType, true},
- {"i", KEYCODE_i, 'i', "i", kActionKeyType, true},
- {"j", KEYCODE_j, 'j', "j", kActionKeyType, true},
- {"k", KEYCODE_k, 'k', "k", kActionKeyType, true},
- {"l", KEYCODE_l, 'l', "l", kActionKeyType, true},
- {"m", KEYCODE_m, 'm', "m", kActionKeyType, true},
- {"n", KEYCODE_n, 'n', "n", kActionKeyType, true},
- {"o", KEYCODE_o, 'o', "o", kActionKeyType, true},
- {"p", KEYCODE_p, 'p', "p", kActionKeyType, true},
- {"q", KEYCODE_q, 'q', "q", kActionKeyType, true},
- {"r", KEYCODE_r, 'r', "r", kActionKeyType, true},
- {"s", KEYCODE_s, 's', "s", kActionKeyType, true},
- {"t", KEYCODE_t, 't', "t", kActionKeyType, true},
- {"u", KEYCODE_u, 'u', "u", kActionKeyType, true},
- {"v", KEYCODE_v, 'v', "v", kActionKeyType, true},
- {"w", KEYCODE_w, 'w', "w", kActionKeyType, true},
- {"x", KEYCODE_x, 'x', "x", kActionKeyType, true},
- {"y", KEYCODE_y, 'y', "y", kActionKeyType, true},
- {"z", KEYCODE_z, 'z', "z", kActionKeyType, true},
- {"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, false},
+ {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, ~0},
+ {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, ~0},
+ {"CLEAR", KEYCODE_CLEAR, 0, "Clear", kActionKeyType, ~0},
+ {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", kActionKeyType, ~0},
+ {"PAUSE", KEYCODE_PAUSE, 0, "Pause", kActionKeyType, ~0},
+ {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", kStartKeyType, ~0},
+ {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", kActionKeyType, ~0},
+ {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", kActionKeyType, ~0},
+ {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", kActionKeyType, ~0},
+ {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, ~0},
+ {"DOLLAR", KEYCODE_DOLLAR, '$', "$", kActionKeyType, ~0},
+ {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", kActionKeyType, ~0},
+ {"QUOTE", KEYCODE_QUOTE, '\'', "'", kActionKeyType, ~0},
+ {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", kActionKeyType, ~0},
+ {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", kActionKeyType, ~0},
+ {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, ~0},
+ {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, ~0},
+ {"COMMA", KEYCODE_COMMA, ',', ",", kActionKeyType, ~0},
+ {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, ~0},
+ {"PERIOD", KEYCODE_PERIOD, '.', ".", kActionKeyType, ~0},
+ {"SLASH", KEYCODE_SLASH, '/', "/", kActionKeyType, ~0},
+ {"0", KEYCODE_0, '0', "0", kActionKeyType, ~0},
+ {"1", KEYCODE_1, '1', "1", kActionKeyType, ~0},
+ {"2", KEYCODE_2, '2', "2", kActionKeyType, ~0},
+ {"3", KEYCODE_3, '3', "3", kActionKeyType, ~0},
+ {"4", KEYCODE_4, '4', "4", kActionKeyType, ~0},
+ {"5", KEYCODE_5, '5', "5", kActionKeyType, ~0},
+ {"6", KEYCODE_6, '6', "6", kActionKeyType, ~0},
+ {"7", KEYCODE_7, '7', "7", kActionKeyType, ~0},
+ {"8", KEYCODE_8, '8', "8", kActionKeyType, ~0},
+ {"9", KEYCODE_9, '9', "9", kActionKeyType, ~0},
+ {"COLON", KEYCODE_COLON, ':', ":", kActionKeyType, ~0},
+ {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", kActionKeyType, ~0},
+ {"LESS", KEYCODE_LESS, '<', "<", kActionKeyType, ~0},
+ {"EQUALS", KEYCODE_EQUALS, '=', "=", kActionKeyType, ~0},
+ {"GREATER", KEYCODE_GREATER, '>', ">", kActionKeyType, ~0},
+ {"QUESTION", KEYCODE_QUESTION, '?', "?", kActionKeyType, ~0},
+ {"AT", KEYCODE_AT, '@', "@", kActionKeyType, ~0},
+
+ {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", kActionKeyType, ~0},
+ {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", kActionKeyType, ~0},
+ {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", kActionKeyType, ~0},
+ {"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, ~0},
+ {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, ~0},
+ {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, ~0},
+ {"a", KEYCODE_a, 'A', "A", kActionKeyType, ~0},
+ {"b", KEYCODE_b, 'B', "B", kActionKeyType, ~0},
+ {"c", KEYCODE_c, 'C', "C", kActionKeyType, ~0},
+ {"d", KEYCODE_d, 'D', "D", kActionKeyType, ~0},
+ {"e", KEYCODE_e, 'E', "E", kActionKeyType, ~0},
+ {"f", KEYCODE_f, 'F', "F", kActionKeyType, ~0},
+ {"g", KEYCODE_g, 'G', "G", kActionKeyType, ~0},
+ {"h", KEYCODE_h, 'H', "H", kActionKeyType, ~0},
+ {"i", KEYCODE_i, 'I', "I", kActionKeyType, ~0},
+ {"j", KEYCODE_j, 'J', "J", kActionKeyType, ~0},
+ {"k", KEYCODE_k, 'K', "K", kActionKeyType, ~0},
+ {"l", KEYCODE_l, 'L', "L", kActionKeyType, ~0},
+ {"m", KEYCODE_m, 'M', "M", kActionKeyType, ~0},
+ {"n", KEYCODE_n, 'N', "N", kActionKeyType, ~0},
+ {"o", KEYCODE_o, 'O', "O", kActionKeyType, ~0},
+ {"p", KEYCODE_p, 'P', "P", kActionKeyType, ~0},
+ {"q", KEYCODE_q, 'Q', "Q", kActionKeyType, ~0},
+ {"r", KEYCODE_r, 'R', "R", kActionKeyType, ~0},
+ {"s", KEYCODE_s, 'S', "S", kActionKeyType, ~0},
+ {"t", KEYCODE_t, 'T', "T", kActionKeyType, ~0},
+ {"u", KEYCODE_u, 'U', "U", kActionKeyType, ~0},
+ {"v", KEYCODE_v, 'V', "V", kActionKeyType, ~0},
+ {"w", KEYCODE_w, 'W', "W", kActionKeyType, ~0},
+ {"x", KEYCODE_x, 'X', "X", kActionKeyType, ~0},
+ {"y", KEYCODE_y, 'Y', "Y", kActionKeyType, ~0},
+ {"z", KEYCODE_z, 'Z', "Z", kActionKeyType, ~0},
+ {"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, ~0},
// Numeric keypad
- {"KP0", KEYCODE_KP0, 0, "KP0", kActionKeyType, false},
- {"KP1", KEYCODE_KP1, 0, "KP1", kActionKeyType, false},
- {"KP2", KEYCODE_KP2, 0, "KP2", kActionKeyType, false},
- {"KP3", KEYCODE_KP3, 0, "KP3", kActionKeyType, false},
- {"KP4", KEYCODE_KP4, 0, "KP4", kActionKeyType, false},
- {"KP5", KEYCODE_KP5, 0, "KP5", kActionKeyType, false},
- {"KP6", KEYCODE_KP6, 0, "KP6", kActionKeyType, false},
- {"KP7", KEYCODE_KP7, 0, "KP7", kActionKeyType, false},
- {"KP8", KEYCODE_KP8, 0, "KP8", kActionKeyType, false},
- {"KP9", KEYCODE_KP9, 0, "KP9", kActionKeyType, false},
- {"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", kActionKeyType, false},
- {"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", kActionKeyType, false},
- {"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", kActionKeyType, false},
- {"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", kActionKeyType, false},
- {"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", kActionKeyType, false},
- {"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", kActionKeyType, false},
- {"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", kActionKeyType, false},
+ {"KP0", KEYCODE_KP0, 0, "KP0", kActionKeyType, ~0},
+ {"KP1", KEYCODE_KP1, 0, "KP1", kActionKeyType, ~0},
+ {"KP2", KEYCODE_KP2, 0, "KP2", kActionKeyType, ~0},
+ {"KP3", KEYCODE_KP3, 0, "KP3", kActionKeyType, ~0},
+ {"KP4", KEYCODE_KP4, 0, "KP4", kActionKeyType, ~0},
+ {"KP5", KEYCODE_KP5, 0, "KP5", kActionKeyType, ~0},
+ {"KP6", KEYCODE_KP6, 0, "KP6", kActionKeyType, ~0},
+ {"KP7", KEYCODE_KP7, 0, "KP7", kActionKeyType, ~0},
+ {"KP8", KEYCODE_KP8, 0, "KP8", kActionKeyType, ~0},
+ {"KP9", KEYCODE_KP9, 0, "KP9", kActionKeyType, ~0},
+ {"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", kActionKeyType, ~0},
+ {"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", kActionKeyType, ~0},
+ {"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", kActionKeyType, ~0},
+ {"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", kActionKeyType, ~0},
+ {"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", kActionKeyType, ~0},
+ {"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", kActionKeyType, ~0},
+ {"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", kActionKeyType, ~0},
// Arrows + Home/End pad
- {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false},
- {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false},
- {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false},
- {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false},
- {"INSERT", KEYCODE_INSERT, 0, "Insert", kActionKeyType, false},
- {"HOME", KEYCODE_HOME, 0, "Home", kActionKeyType, false},
- {"END", KEYCODE_END, 0, "End", kActionKeyType, false},
- {"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", kActionKeyType, false},
- {"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", kActionKeyType, false},
+ {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, ~0},
+ {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, ~0},
+ {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, ~0},
+ {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, ~0},
+ {"INSERT", KEYCODE_INSERT, 0, "Insert", kActionKeyType, ~0},
+ {"HOME", KEYCODE_HOME, 0, "Home", kActionKeyType, ~0},
+ {"END", KEYCODE_END, 0, "End", kActionKeyType, ~0},
+ {"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", kActionKeyType, ~0},
+ {"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", kActionKeyType, ~0},
// Function keys
- {"F1", KEYCODE_F1, ASCII_F1, "F1", kActionKeyType, false},
- {"F2", KEYCODE_F2, ASCII_F2, "F2", kActionKeyType, false},
- {"F3", KEYCODE_F3, ASCII_F3, "F3", kActionKeyType, false},
- {"F4", KEYCODE_F4, ASCII_F4, "F4", kActionKeyType, false},
- {"F5", KEYCODE_F5, ASCII_F5, "F5", kActionKeyType, false},
- {"F6", KEYCODE_F6, ASCII_F6, "F6", kActionKeyType, false},
- {"F7", KEYCODE_F7, ASCII_F7, "F7", kActionKeyType, false},
- {"F8", KEYCODE_F8, ASCII_F8, "F8", kActionKeyType, false},
- {"F9", KEYCODE_F9, ASCII_F9, "F9", kActionKeyType, false},
- {"F10", KEYCODE_F10, ASCII_F10, "F10", kActionKeyType, false},
- {"F11", KEYCODE_F11, ASCII_F11, "F11", kActionKeyType, false},
- {"F12", KEYCODE_F12, ASCII_F12, "F12", kActionKeyType, false},
- {"F13", KEYCODE_F13, 0, "F13", kActionKeyType, false},
- {"F14", KEYCODE_F14, 0, "F14", kActionKeyType, false},
- {"F15", KEYCODE_F15, 0, "F15", kActionKeyType, false},
+ {"F1", KEYCODE_F1, ASCII_F1, "F1", kActionKeyType, ~0},
+ {"F2", KEYCODE_F2, ASCII_F2, "F2", kActionKeyType, ~0},
+ {"F3", KEYCODE_F3, ASCII_F3, "F3", kActionKeyType, ~0},
+ {"F4", KEYCODE_F4, ASCII_F4, "F4", kActionKeyType, ~0},
+ {"F5", KEYCODE_F5, ASCII_F5, "F5", kActionKeyType, ~0},
+ {"F6", KEYCODE_F6, ASCII_F6, "F6", kActionKeyType, ~0},
+ {"F7", KEYCODE_F7, ASCII_F7, "F7", kActionKeyType, ~0},
+ {"F8", KEYCODE_F8, ASCII_F8, "F8", kActionKeyType, ~0},
+ {"F9", KEYCODE_F9, ASCII_F9, "F9", kActionKeyType, ~0},
+ {"F10", KEYCODE_F10, ASCII_F10, "F10", kActionKeyType, ~0},
+ {"F11", KEYCODE_F11, ASCII_F11, "F11", kActionKeyType, ~0},
+ {"F12", KEYCODE_F12, ASCII_F12, "F12", kActionKeyType, ~0},
+ {"F13", KEYCODE_F13, 0, "F13", kActionKeyType, ~0},
+ {"F14", KEYCODE_F14, 0, "F14", kActionKeyType, ~0},
+ {"F15", KEYCODE_F15, 0, "F15", kActionKeyType, ~0},
+
+
+// // Modifier keys pressed alone
+// {"RSHIFT", KEYCODE_RSHIFT, 0, "Right Shift", kModiferKeyType, ~KBD_SHIFT},
+// {"LSHIFT", KEYCODE_LSHIFT, 0, "Left Shift", kModiferKeyType, ~KBD_SHIFT},
+// {"RCTRL", KEYCODE_RCTRL, 0, "Right Ctrl", kModiferKeyType, ~KBD_CTRL},
+// {"LCTRL", KEYCODE_LCTRL, 0, "Left Ctrl", kModiferKeyType, ~KBD_CTRL},
+// {"RALT", KEYCODE_RALT, 0, "Right Alt", kModiferKeyType, ~KBD_ALT},
+// {"LALT", KEYCODE_LALT, 0, "Left Alt", kModiferKeyType, ~KBD_ALT},
+
// Miscellaneous function keys
- {"HELP", KEYCODE_HELP, 0, "Help", kActionKeyType, false},
- {"PRINT", KEYCODE_PRINT, 0, "Print", kActionKeyType, false},
- {"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", kActionKeyType, false},
- {"BREAK", KEYCODE_BREAK, 0, "Break", kActionKeyType, false},
- {"MENU", KEYCODE_MENU, 0, "Menu", kActionKeyType, false},
+ {"HELP", KEYCODE_HELP, 0, "Help", kActionKeyType, ~0},
+ {"PRINT", KEYCODE_PRINT, 0, "Print", kActionKeyType, ~0},
+ {"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", kActionKeyType, ~0},
+ {"BREAK", KEYCODE_BREAK, 0, "Break", kActionKeyType, ~0},
+ {"MENU", KEYCODE_MENU, 0, "Menu", kActionKeyType, ~0},
// Power Macintosh power key
- {"POWER", KEYCODE_POWER, 0, "Power", kActionKeyType, false},
+ {"POWER", KEYCODE_POWER, 0, "Power", kActionKeyType, ~0},
// Some european keyboards
- {"EURO", KEYCODE_EURO, 0, "Euro", kActionKeyType, false},
+ {"EURO", KEYCODE_EURO, 0, "Euro", kActionKeyType, ~0},
// Atari keyboard has Undo
- {"UNDO", KEYCODE_UNDO, 0, "Undo", kActionKeyType, false},
- {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false}
+ {"UNDO", KEYCODE_UNDO, 0, "Undo", kActionKeyType, ~0},
+ {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, ~0}
};
struct Mod {
byte flag;
const char *id;
const char *desc;
- bool shiftable;
};
static const Mod modifiers[] = {
- { 0, "", "", false },
- { KBD_CTRL, "C+", "Ctrl+", false },
- { KBD_ALT, "A+", "Alt+", false },
- { KBD_SHIFT, "", "", true },
- { KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", false },
- { KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+", true },
- { KBD_SHIFT | KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", true },
- { 0, 0, 0, false }
+ { 0, "", "" },
+ { KBD_CTRL, "C+", "Ctrl+" },
+ { KBD_ALT, "A+", "Alt+" },
+ { KBD_SHIFT, "S+", "Shift+" },
+ { KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+" },
+ { KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+" },
+ { KBD_SHIFT | KBD_CTRL | KBD_ALT, "S+C+A+", "Shift+Ctrl+Alt+" },
+ { 0, 0, 0 }
};
#endif
@@ -206,23 +215,18 @@ Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
uint16 ascii;
for (mod = modifiers; mod->id; mod++) {
- for (key = keys; key->hwId; key++) {
- ascii = key->ascii;
-
- if (mod->shiftable && key->shiftable) {
- snprintf(fullKeyId, 50, "%s%c", mod->id, toupper(key->hwId[0]));
- snprintf(fullKeyDesc, 100, "%s%c", mod->desc, toupper(key->desc[0]));
- ascii = toupper(key->ascii);
- } else if (mod->shiftable) {
- snprintf(fullKeyId, 50, "S+%s%s", mod->id, key->hwId);
- snprintf(fullKeyDesc, 100, "Shift+%s%s", mod->desc, key->desc);
- } else {
- snprintf(fullKeyId, 50, "%s%s", mod->id, key->hwId);
- snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc);
- }
-
- keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc, key->preferredAction ));
- }
+ snprintf(fullKeyId, 50, "S+%s", mod->id);
+ snprintf(fullKeyDesc, 100, "Shift+%s", mod->desc);
+
+ keySet->addHardwareMod(new HardwareMod(fullKeyId, mod->flag, fullKeyDesc));
+ }
+ for (key = keys; key->hwId; key++) {
+ ascii = key->ascii;
+
+ snprintf(fullKeyId, 50, "%s", key->hwId);
+ snprintf(fullKeyDesc, 100, "%s", key->desc);
+
+ keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, 0), fullKeyDesc, key->preferredAction));
}
return keySet;
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index b97a62109b..ca1fdef41c 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -273,8 +273,8 @@ void GuiManager::runLoop() {
lastRedraw = _system->getMillis();
}
- Common::Event event;
- while (eventMan->pollEvent(event)) {
+ Common::Event Event;
+ while (eventMan->pollEvent(Event)) {
// The top dialog can change during the event loop. In that case, flush all the
// dialog-related events since they were probably generated while the old dialog
@@ -282,10 +282,10 @@ void GuiManager::runLoop() {
//
// This hopefully fixes strange behaviour/crashes with pop-up widgets. (Most easily
// triggered in 3x mode or when running ScummVM under Valgrind.)
- if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED)
+ if (activeDialog != getTopDialog() && Event.type != Common::EVENT_SCREEN_CHANGED)
continue;
- Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);
+ Common::Point mouse(Event.mouse.x - activeDialog->_x, Event.mouse.y - activeDialog->_y);
if (lastRedraw + waitTime < _system->getMillis()) {
_theme->updateScreen();
@@ -293,12 +293,12 @@ void GuiManager::runLoop() {
lastRedraw = _system->getMillis();
}
- switch (event.type) {
+ switch (Event.type) {
case Common::EVENT_KEYDOWN:
- activeDialog->handleKeyDown(event.kbd);
+ activeDialog->handleKeyDown(Event.kbd);
break;
case Common::EVENT_KEYUP:
- activeDialog->handleKeyUp(event.kbd);
+ activeDialog->handleKeyUp(Event.kbd);
break;
case Common::EVENT_MOUSEMOVE:
activeDialog->handleMouseMoved(mouse.x, mouse.y, 0);
@@ -306,15 +306,15 @@ void GuiManager::runLoop() {
// We don't distinguish between mousebuttons (for now at least)
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_RBUTTONDOWN:
- button = (event.type == Common::EVENT_LBUTTONDOWN ? 1 : 2);
+ button = (Event.type == Common::EVENT_LBUTTONDOWN ? 1 : 2);
time = _system->getMillis();
if (_lastClick.count && (time < _lastClick.time + kDoubleClickDelay)
- && ABS(_lastClick.x - event.mouse.x) < 3
- && ABS(_lastClick.y - event.mouse.y) < 3) {
+ && ABS(_lastClick.x - Event.mouse.x) < 3
+ && ABS(_lastClick.y - Event.mouse.y) < 3) {
_lastClick.count++;
} else {
- _lastClick.x = event.mouse.x;
- _lastClick.y = event.mouse.y;
+ _lastClick.x = Event.mouse.x;
+ _lastClick.y = Event.mouse.y;
_lastClick.count = 1;
}
_lastClick.time = time;
@@ -322,7 +322,7 @@ void GuiManager::runLoop() {
break;
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
- button = (event.type == Common::EVENT_LBUTTONUP ? 1 : 2);
+ button = (Event.type == Common::EVENT_LBUTTONUP ? 1 : 2);
activeDialog->handleMouseUp(mouse.x, mouse.y, button, _lastClick.count);
break;
case Common::EVENT_WHEELUP:
--
cgit v1.2.3
From e0e09e43b84cf9637fb289bd466235116674c1f2 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 7 Aug 2009 01:17:57 +0000
Subject: key remap dialog correctly reads keystrokes again, and can tell
modified keys from unmodified keys (but does not yet print modifier prefixes,
and actions mapped to modified keys still do not trigger)
svn-id: r43091
---
backends/keymapper/hardware-key.h | 22 +++++++++++++-
backends/keymapper/keymapper.cpp | 4 +++
backends/keymapper/keymapper.h | 5 ++++
backends/keymapper/remap-dialog.cpp | 6 +++-
backends/platform/sdl/hardwarekeys.cpp | 52 +++++++++++++++++-----------------
5 files changed, 61 insertions(+), 28 deletions(-)
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index c8c1d3c145..34631a9484 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -127,7 +127,27 @@ public:
List::const_iterator it;
for (it = _keys.begin(); it != _keys.end(); it++) {
- if ((*it)->key == keystate)
+ if ((*it)->key.keycode == keystate.keycode)
+ return (*it);
+ }
+ return 0;
+ }
+
+ const HardwareMod *findHardwareMod(const char *id) const {
+ List::const_iterator it;
+
+ for (it = _mods.begin(); it != _mods.end(); it++) {
+ if (strncmp((*it)->hwModId, id, HWKEY_ID_SIZE) == 0)
+ return (*it);
+ }
+ return 0;
+ }
+
+ const HardwareMod *findHardwareMod(const KeyState& keystate) const {
+ List::const_iterator it;
+
+ for (it = _mods.begin(); it != _mods.end(); it++) {
+ if ((*it)->modFlags == keystate.flags)
return (*it);
}
return 0;
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index c0c454168c..a121ebafee 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -272,6 +272,10 @@ const HardwareKey *Keymapper::findHardwareKey(const KeyState& key) {
return (_hardwareKeys) ? _hardwareKeys->findHardwareKey(key) : 0;
}
+const HardwareMod *Keymapper::findHardwareMod(const KeyState& key) {
+ return (_hardwareKeys) ? _hardwareKeys->findHardwareMod(key) : 0;
+}
+
} // end of namespace Common
#endif // #ifdef ENABLE_KEYMAPPER
diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h
index f492882ca2..af3314f8f5 100644
--- a/backends/keymapper/keymapper.h
+++ b/backends/keymapper/keymapper.h
@@ -170,6 +170,11 @@ public:
*/
const HardwareKey *findHardwareKey(const KeyState& key);
+ /**
+ * Return a HardwareMod pointer for the given key state
+ */
+ const HardwareMod *findHardwareMod(const KeyState& key);
+
Domain& getGlobalDomain() { return _globalDomain; }
Domain& getGameDomain() { return _gameDomain; }
const Stack& getActiveStack() const { return _activeMaps; }
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 0440acdd0a..9341c82747 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -239,11 +239,15 @@ void RemapDialog::handleKeyDown(Common::KeyState state) {
void RemapDialog::handleKeyUp(Common::KeyState state) {
if (_activeRemapAction) {
const HardwareKey *hwkey = _keymapper->findHardwareKey(state);
+ const HardwareMod *hwmod = _keymapper->findHardwareMod(state);
debug(0, "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
if (hwkey) {
- _activeRemapAction->mapKey(hwkey);
+ HardwareKey *temphwkey = new HardwareKey(*hwkey);
+ temphwkey->description = hwkey->description;
+ temphwkey->key.flags = hwmod->modFlags;
+ _activeRemapAction->mapKey(temphwkey);
_activeRemapAction->getParent()->saveMappings();
_changes = true;
stopRemapping();
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index bba48286f0..c063ea5bff 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -86,32 +86,32 @@ static const Key keys[] = {
{"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, ~0},
{"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, ~0},
{"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, ~0},
- {"a", KEYCODE_a, 'A', "A", kActionKeyType, ~0},
- {"b", KEYCODE_b, 'B', "B", kActionKeyType, ~0},
- {"c", KEYCODE_c, 'C', "C", kActionKeyType, ~0},
- {"d", KEYCODE_d, 'D', "D", kActionKeyType, ~0},
- {"e", KEYCODE_e, 'E', "E", kActionKeyType, ~0},
- {"f", KEYCODE_f, 'F', "F", kActionKeyType, ~0},
- {"g", KEYCODE_g, 'G', "G", kActionKeyType, ~0},
- {"h", KEYCODE_h, 'H', "H", kActionKeyType, ~0},
- {"i", KEYCODE_i, 'I', "I", kActionKeyType, ~0},
- {"j", KEYCODE_j, 'J', "J", kActionKeyType, ~0},
- {"k", KEYCODE_k, 'K', "K", kActionKeyType, ~0},
- {"l", KEYCODE_l, 'L', "L", kActionKeyType, ~0},
- {"m", KEYCODE_m, 'M', "M", kActionKeyType, ~0},
- {"n", KEYCODE_n, 'N', "N", kActionKeyType, ~0},
- {"o", KEYCODE_o, 'O', "O", kActionKeyType, ~0},
- {"p", KEYCODE_p, 'P', "P", kActionKeyType, ~0},
- {"q", KEYCODE_q, 'Q', "Q", kActionKeyType, ~0},
- {"r", KEYCODE_r, 'R', "R", kActionKeyType, ~0},
- {"s", KEYCODE_s, 'S', "S", kActionKeyType, ~0},
- {"t", KEYCODE_t, 'T', "T", kActionKeyType, ~0},
- {"u", KEYCODE_u, 'U', "U", kActionKeyType, ~0},
- {"v", KEYCODE_v, 'V', "V", kActionKeyType, ~0},
- {"w", KEYCODE_w, 'W', "W", kActionKeyType, ~0},
- {"x", KEYCODE_x, 'X', "X", kActionKeyType, ~0},
- {"y", KEYCODE_y, 'Y', "Y", kActionKeyType, ~0},
- {"z", KEYCODE_z, 'Z', "Z", kActionKeyType, ~0},
+ {"a", KEYCODE_a, 'a', "A", kActionKeyType, ~0},
+ {"b", KEYCODE_b, 'b', "B", kActionKeyType, ~0},
+ {"c", KEYCODE_c, 'c', "C", kActionKeyType, ~0},
+ {"d", KEYCODE_d, 'd', "D", kActionKeyType, ~0},
+ {"e", KEYCODE_e, 'e', "E", kActionKeyType, ~0},
+ {"f", KEYCODE_f, 'f', "F", kActionKeyType, ~0},
+ {"g", KEYCODE_g, 'g', "G", kActionKeyType, ~0},
+ {"h", KEYCODE_h, 'h', "H", kActionKeyType, ~0},
+ {"i", KEYCODE_i, 'i', "I", kActionKeyType, ~0},
+ {"j", KEYCODE_j, 'j', "J", kActionKeyType, ~0},
+ {"k", KEYCODE_k, 'k', "K", kActionKeyType, ~0},
+ {"l", KEYCODE_l, 'l', "L", kActionKeyType, ~0},
+ {"m", KEYCODE_m, 'm', "M", kActionKeyType, ~0},
+ {"n", KEYCODE_n, 'n', "N", kActionKeyType, ~0},
+ {"o", KEYCODE_o, 'o', "O", kActionKeyType, ~0},
+ {"p", KEYCODE_p, 'p', "P", kActionKeyType, ~0},
+ {"q", KEYCODE_q, 'q', "Q", kActionKeyType, ~0},
+ {"r", KEYCODE_r, 'r', "R", kActionKeyType, ~0},
+ {"s", KEYCODE_s, 's', "S", kActionKeyType, ~0},
+ {"t", KEYCODE_t, 't', "T", kActionKeyType, ~0},
+ {"u", KEYCODE_u, 'u', "U", kActionKeyType, ~0},
+ {"v", KEYCODE_v, 'v', "V", kActionKeyType, ~0},
+ {"w", KEYCODE_w, 'w', "W", kActionKeyType, ~0},
+ {"x", KEYCODE_x, 'x', "X", kActionKeyType, ~0},
+ {"y", KEYCODE_y, 'y', "Y", kActionKeyType, ~0},
+ {"z", KEYCODE_z, 'z', "Z", kActionKeyType, ~0},
{"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, ~0},
// Numeric keypad
--
cgit v1.2.3
From 773c1a270b682ddc845907a605085f2f7d505d1f Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Mon, 10 Aug 2009 06:45:32 +0000
Subject: hackishly fixed modified keys not triggering their mapped actions.
svn-id: r43201
---
common/keyboard.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/keyboard.h b/common/keyboard.h
index cf595d4dd8..6cd4939a6e 100644
--- a/common/keyboard.h
+++ b/common/keyboard.h
@@ -267,7 +267,7 @@ struct KeyState {
}
bool operator ==(const KeyState &x) const {
- return keycode == x.keycode && ascii == x.ascii && flags == x.flags;
+ return keycode == x.keycode && /*ascii == x.ascii && */flags == x.flags;
}
};
--
cgit v1.2.3
From 77594f46b1db7ed6bde4413f74d12a48e720cbfa Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Wed, 12 Aug 2009 09:26:00 +0000
Subject: Laying some groundwork for hopefully getting modifiers working in a
less hacked-on manner
svn-id: r43316
---
backends/keymapper/hardware-key.h | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 34631a9484..8c286288ae 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -37,6 +37,22 @@ namespace Common {
#define HWKEY_ID_SIZE (30)
+
+// Structure for describing specific key+modifier combos mapped to actions,
+// to allow for modifiers to work properly without having to define the whole
+// hardware key set an additional time for each possible modifier combination
+struct ActionKey {
+ KeyCode keycode;
+ byte flags;
+ /** unique id used for saving/loading to config */
+ char actKeyId[HWKEY_ID_SIZE];
+
+ /** Human readable description */
+ String description;
+
+};
+
+
/**
* Describes an available hardware key
*/
@@ -56,9 +72,12 @@ struct HardwareKey {
KeyType type;
ActionType preferredAction;
+ // Mask of modifiers that can possibly apply to this key.
+ uint32 modMask;
+
HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
- KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
- : key(ky), description(desc), type(typ), preferredAction(prefAct) {
+ KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType, uint32 mods = ~0)
+ : key(ky), description(desc), type(typ), preferredAction(prefAct), modMask(mods) {
assert(i);
strncpy(hwKeyId, i, HWKEY_ID_SIZE);
}
--
cgit v1.2.3
From 44e79803648ba7704e97031752506ad42176990d Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 14 Aug 2009 08:11:18 +0000
Subject: Added proper saving/loading of mapped key modifiers. Fixed modifier
recognition in a much less hackish manner, (but still using a minor hack as a
stopgap until KeyState can be replaced as the primary lookup type for the
keymapper).
svn-id: r43363
---
backends/keymapper/keymap.cpp | 22 +++++++++++++++++-----
backends/keymapper/keymapper.cpp | 14 ++++++++++++--
backends/keymapper/remap-dialog.cpp | 28 ++++++++++++++++++++--------
common/keyboard.h | 2 +-
4 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp
index 95b64f88e7..fe6f133254 100644
--- a/backends/keymapper/keymap.cpp
+++ b/backends/keymapper/keymap.cpp
@@ -127,6 +127,10 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
ConfigManager::Domain::iterator it;
String prefix = KEYMAP_KEY_PREFIX + _name + "_";
+ uint32 modId = 0;
+ char hwId[HWKEY_ID_SIZE+1];
+ memset(hwId,0,HWKEY_ID_SIZE+1);
+
for (it = _configDomain->begin(); it != _configDomain->end(); it++) {
const String& key = it->_key;
@@ -145,15 +149,17 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
continue;
}
- const HardwareKey *hwKey = hwKeys->findHardwareKey(it->_value.c_str());
+ sscanf(it->_value.c_str(),"%d,%s",&modId,hwId);
+ const HardwareKey *hwKey = hwKeys->findHardwareKey(hwId);
if (!hwKey) {
warning("HardwareKey with ID %s not known", it->_value.c_str());
_configDomain->erase(key);
continue;
}
-
- ua->mapKey(hwKey);
+ HardwareKey *mappedKey = new HardwareKey(*hwKey);
+ mappedKey->key.flags = modId;
+ ua->mapKey(mappedKey);
}
}
@@ -171,13 +177,19 @@ void Keymap::saveMappings() {
String actId((*it)->id, (*it)->id + actIdLen);
char hwId[HWKEY_ID_SIZE+1];
-
memset(hwId, 0, HWKEY_ID_SIZE+1);
+ char modId[4];
+ memset(modId, 0, 4);
+
if ((*it)->getMappedKey()) {
memcpy(hwId, (*it)->getMappedKey()->hwKeyId, HWKEY_ID_SIZE);
+ sprintf(modId,"%d",(*it)->getMappedKey()->key.flags);
}
- _configDomain->setVal(prefix + actId, hwId);
+ String val = modId;
+ val += ',';
+ val += hwId;
+ _configDomain->setVal(prefix + actId, val);
}
}
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index a121ebafee..24b4d7e5f8 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -192,18 +192,28 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
Action *action = 0;
if (keyDown) {
+ // HACK: Temporary fix for modifier recognition, get the hwkey's keystate
+ // to correct for keydown and keyup generating different ascii codes in SDL
+ // to be solved more permanently by using a structure other than KeyState
+ const HardwareKey *hwkey = findHardwareKey(key);
+ if (!hwkey)
+ return false;
+
+ KeyState k = hwkey->key;
+ k.flags = key.flags;
+
// Search for key in active keymap stack
for (int i = _activeMaps.size() - 1; i >= 0; --i) {
MapRecord mr = _activeMaps[i];
- action = mr.keymap->getMappedAction(key);
+ action = mr.keymap->getMappedAction(k);
if (action || mr.inherit == false)
break;
}
if (action)
- _keysDown[key] = action;
+ _keysDown[k] = action;
} else {
HashMap::iterator it = _keysDown.find(key);
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 9341c82747..aca2630d6d 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -239,15 +239,14 @@ void RemapDialog::handleKeyDown(Common::KeyState state) {
void RemapDialog::handleKeyUp(Common::KeyState state) {
if (_activeRemapAction) {
const HardwareKey *hwkey = _keymapper->findHardwareKey(state);
- const HardwareMod *hwmod = _keymapper->findHardwareMod(state);
- debug(0, "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
+ debug( "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
if (hwkey) {
- HardwareKey *temphwkey = new HardwareKey(*hwkey);
- temphwkey->description = hwkey->description;
- temphwkey->key.flags = hwmod->modFlags;
- _activeRemapAction->mapKey(temphwkey);
+ HardwareKey *mappedkey = new HardwareKey(*hwkey);
+ mappedkey->description = hwkey->description;
+ mappedkey->key.flags = (state.flags & hwkey->modMask);
+ _activeRemapAction->mapKey(mappedkey);
_activeRemapAction->getParent()->saveMappings();
_changes = true;
stopRemapping();
@@ -363,8 +362,21 @@ void RemapDialog::refreshKeymap() {
const HardwareKey *mappedKey = info.action->getMappedKey();
if (mappedKey)
- widg.keyButton->setLabel(mappedKey->description);
- else
+ {
+ Common::String description = "";
+ if (mappedKey->key.flags)
+ {
+ byte flags = mappedKey->key.flags;
+ if (flags & KBD_CTRL)
+ description += "Ctrl+";
+ if (flags & KBD_SHIFT)
+ description += "Shift+";
+ if (flags & KBD_ALT)
+ description += "Alt+";
+ }
+ description += mappedKey->description;
+ widg.keyButton->setLabel(description);
+ } else
widg.keyButton->setLabel("-");
widg.actionText->setVisible(true);
diff --git a/common/keyboard.h b/common/keyboard.h
index 6cd4939a6e..cf595d4dd8 100644
--- a/common/keyboard.h
+++ b/common/keyboard.h
@@ -267,7 +267,7 @@ struct KeyState {
}
bool operator ==(const KeyState &x) const {
- return keycode == x.keycode && /*ascii == x.ascii && */flags == x.flags;
+ return keycode == x.keycode && ascii == x.ascii && flags == x.flags;
}
};
--
cgit v1.2.3
From 7ea0646a49a848d2cfa1f18162dba66fc6ddef0b Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 15 Aug 2009 08:48:13 +0000
Subject: Removed excessive modifier definitions, prevented excessive memory
consumption if getHardwareKeyset is called multiple times.
svn-id: r43395
---
backends/platform/sdl/hardwarekeys.cpp | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index c063ea5bff..623e8b50cf 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -162,7 +162,7 @@ static const Key keys[] = {
{"F15", KEYCODE_F15, 0, "F15", kActionKeyType, ~0},
-// // Modifier keys pressed alone
+ // Modifier keys pressed alone
// {"RSHIFT", KEYCODE_RSHIFT, 0, "Right Shift", kModiferKeyType, ~KBD_SHIFT},
// {"LSHIFT", KEYCODE_LSHIFT, 0, "Left Shift", kModiferKeyType, ~KBD_SHIFT},
// {"RCTRL", KEYCODE_RCTRL, 0, "Right Ctrl", kModiferKeyType, ~KBD_CTRL},
@@ -197,9 +197,6 @@ static const Mod modifiers[] = {
{ KBD_CTRL, "C+", "Ctrl+" },
{ KBD_ALT, "A+", "Alt+" },
{ KBD_SHIFT, "S+", "Shift+" },
- { KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+" },
- { KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+" },
- { KBD_SHIFT | KBD_CTRL | KBD_ALT, "S+C+A+", "Shift+Ctrl+Alt+" },
{ 0, 0, 0 }
};
#endif
@@ -207,7 +204,11 @@ static const Mod modifiers[] = {
Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
#ifdef ENABLE_KEYMAPPER
- HardwareKeySet *keySet = new HardwareKeySet();
+ static HardwareKeySet *keySet = new HardwareKeySet();
+ static bool keySetInited = false;
+ if (keySet && keySetInited)
+ return keySet;
+
const Key *key;
const Mod *mod;
char fullKeyId[50];
@@ -226,9 +227,11 @@ Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
snprintf(fullKeyId, 50, "%s", key->hwId);
snprintf(fullKeyDesc, 100, "%s", key->desc);
- keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, 0), fullKeyDesc, key->preferredAction));
+ keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, 0), fullKeyDesc, key->modableMask, key->preferredAction));
}
+ keySetInited = true;
+
return keySet;
#else
--
cgit v1.2.3
From 0af775717e30af665c973283c7df69209525a69a Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 15 Aug 2009 08:52:40 +0000
Subject: Added mandatory includes into hardware-key.h (so it can be included
without compile error, without having to separately include several other
header files), reworked ActionKey structure, changed HardwareKey::modMask
from uint32 into byte.
svn-id: r43396
---
backends/keymapper/hardware-key.h | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 8c286288ae..94e6589a17 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -31,6 +31,10 @@
#ifdef ENABLE_KEYMAPPER
#include "backends/keymapper/types.h"
+#include "common/str.h"
+#include "common/keyboard.h"
+#include "common/list.h"
+#include "common/util.h"
namespace Common {
@@ -44,11 +48,15 @@ namespace Common {
struct ActionKey {
KeyCode keycode;
byte flags;
- /** unique id used for saving/loading to config */
- char actKeyId[HWKEY_ID_SIZE];
- /** Human readable description */
- String description;
+ ActionKey (KeyCode ky, byte f) {
+ keycode = ky;
+ flags = f;
+ }
+
+ bool operator ==(const ActionKey &x) const {
+ return keycode == x.keycode && flags == x.flags;
+ }
};
@@ -73,10 +81,10 @@ struct HardwareKey {
ActionType preferredAction;
// Mask of modifiers that can possibly apply to this key.
- uint32 modMask;
+ byte modMask;
- HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
- KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType, uint32 mods = ~0)
+ HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "", byte mods = ~0,
+ KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
: key(ky), description(desc), type(typ), preferredAction(prefAct), modMask(mods) {
assert(i);
strncpy(hwKeyId, i, HWKEY_ID_SIZE);
--
cgit v1.2.3
From 6ede8310932ab8a79310ebd6b0a14eaf687c1708 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 15 Aug 2009 08:55:22 +0000
Subject: Added hash function for ActionKey in preparation for replacing
KeyStates in the main keymapper hashtable with ActionKeys, removed a
duplicated comment line.
svn-id: r43397
---
backends/keymapper/keymap.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h
index 615fd9097d..5bb277c924 100644
--- a/backends/keymapper/keymap.h
+++ b/backends/keymapper/keymap.h
@@ -36,6 +36,7 @@
#include "common/keyboard.h"
#include "common/list.h"
#include "backends/keymapper/action.h"
+#include "backends/keymapper/hardware-key.h"
namespace Common {
@@ -53,6 +54,17 @@ template<> struct Hash
}
};
+/**
+ * Hash function for ActionKey
+ */
+template<> struct Hash
+ : public UnaryFunction {
+
+ uint operator()(const ActionKey &val) const {
+ return (uint)val.keycode | ((uint)val.flags << 24);
+ }
+};
+
class Keymap {
public:
Keymap(const String& name, Keymap *parent = 0) : _name(name), _parent(parent) {}
@@ -90,7 +102,6 @@ public:
/**
* Save this keymap's mappings to the config manager
* @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
- * @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
*/
void saveMappings();
--
cgit v1.2.3
From 8d051e24feeb2e7410d7676328ad66fbf04a95c8 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 15 Aug 2009 09:12:36 +0000
Subject: Added support for mapping keys to ctrl, alt, shift, or combinations
thereof (though ctrl+alt will never trigger for some reason)
svn-id: r43398
---
backends/keymapper/keymapper.cpp | 3 ++-
backends/keymapper/types.h | 2 +-
backends/platform/sdl/hardwarekeys.cpp | 12 ++++++------
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index 24b4d7e5f8..d101e8e0d2 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -195,12 +195,13 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
// HACK: Temporary fix for modifier recognition, get the hwkey's keystate
// to correct for keydown and keyup generating different ascii codes in SDL
// to be solved more permanently by using a structure other than KeyState
+
const HardwareKey *hwkey = findHardwareKey(key);
if (!hwkey)
return false;
KeyState k = hwkey->key;
- k.flags = key.flags;
+ k.flags = key.flags & hwkey->modMask;
// Search for key in active keymap stack
for (int i = _activeMaps.size() - 1; i >= 0; --i) {
diff --git a/backends/keymapper/types.h b/backends/keymapper/types.h
index 004a90bfcd..3cce79ee9a 100644
--- a/backends/keymapper/types.h
+++ b/backends/keymapper/types.h
@@ -43,7 +43,7 @@ enum KeyType {
kTriggerRightKeyType,
kStartKeyType,
kSelectKeyType,
-// kModiferKeyType,
+ kModiferKeyType,
/* ... */
kKeyTypeMax
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index 623e8b50cf..506e71d092 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -163,12 +163,12 @@ static const Key keys[] = {
// Modifier keys pressed alone
-// {"RSHIFT", KEYCODE_RSHIFT, 0, "Right Shift", kModiferKeyType, ~KBD_SHIFT},
-// {"LSHIFT", KEYCODE_LSHIFT, 0, "Left Shift", kModiferKeyType, ~KBD_SHIFT},
-// {"RCTRL", KEYCODE_RCTRL, 0, "Right Ctrl", kModiferKeyType, ~KBD_CTRL},
-// {"LCTRL", KEYCODE_LCTRL, 0, "Left Ctrl", kModiferKeyType, ~KBD_CTRL},
-// {"RALT", KEYCODE_RALT, 0, "Right Alt", kModiferKeyType, ~KBD_ALT},
-// {"LALT", KEYCODE_LALT, 0, "Left Alt", kModiferKeyType, ~KBD_ALT},
+ {"RSHIFT", KEYCODE_RSHIFT, 0, "Right Shift", kModiferKeyType, ~KBD_SHIFT},
+ {"LSHIFT", KEYCODE_LSHIFT, 0, "Left Shift", kModiferKeyType, ~KBD_SHIFT},
+ {"RCTRL", KEYCODE_RCTRL, 0, "Right Ctrl", kModiferKeyType, ~KBD_CTRL},
+ {"LCTRL", KEYCODE_LCTRL, 0, "Left Ctrl", kModiferKeyType, ~KBD_CTRL},
+ {"RALT", KEYCODE_RALT, 0, "Right Alt", kModiferKeyType, ~KBD_ALT},
+ {"LALT", KEYCODE_LALT, 0, "Left Alt", kModiferKeyType, ~KBD_ALT},
// Miscellaneous function keys
--
cgit v1.2.3
From 7ff9bb3a6b543777891d90a645c669b975e64445 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sat, 15 Aug 2009 09:15:09 +0000
Subject: Commented a memory leak whose fix requires a fundamental modification
to the Action structure (replacing KeyState with ActionKey should do it)
svn-id: r43399
---
backends/keymapper/remap-dialog.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index aca2630d6d..323790a700 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -243,9 +243,12 @@ void RemapDialog::handleKeyUp(Common::KeyState state) {
debug( "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
if (hwkey) {
+ //FIXME: this leaks memory and there's no good way to get this pointer again as
+ //a non-const. this should be done differently when we switch to actionKeys.
HardwareKey *mappedkey = new HardwareKey(*hwkey);
mappedkey->description = hwkey->description;
mappedkey->key.flags = (state.flags & hwkey->modMask);
+
_activeRemapAction->mapKey(mappedkey);
_activeRemapAction->getParent()->saveMappings();
_changes = true;
--
cgit v1.2.3
From 8e417b0884e676ff5fe297d1642c9d8499ad9b90 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Sat, 15 Aug 2009 14:50:21 +0000
Subject: Fix compile when compiling with --disable-he
svn-id: r43410
---
engines/scumm/akos.cpp | 4 ++++
engines/scumm/cursor.cpp | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index f4bb8a2c8b..c7f53b9763 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -299,6 +299,7 @@ void AkosRenderer::setPalette(uint16 *new_palette) {
if (size > 256)
error("akos_setPalette: %d is too many colors", size);
+#ifdef ENABLE_HE
if (_vm->_game.features & GF_16BIT_COLOR) {
if (_paletteNum) {
for (i = 0; i < size; i++)
@@ -317,10 +318,13 @@ void AkosRenderer::setPalette(uint16 *new_palette) {
for (i = 0; i < size; i++)
_palette[i] = (byte)_vm->_hePalettes[_paletteNum * _vm->_hePaletteSlot + 768 + akpl[i]];
} else {
+#endif
for (i = 0; i < size; i++) {
_palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i];
}
+#ifdef ENABLE_HE
}
+#endif
if (_vm->_game.heversion == 70) {
for (i = 0; i < size; i++)
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 66ac68bd95..5af25e95ef 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -194,15 +194,19 @@ void ScummEngine_v70he::setDefaultCursor() {
for (j = 0; j < 32; j++) {
switch ((p & (0x3 << 14)) >> 14) {
case 1:
+#ifdef ENABLE_HE
if (_bitDepth == 2)
WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[4], palette[5], palette[6]));
else
+#endif
_grabbedCursor[32 * i + j] = 0xfe;
break;
case 2:
+#ifdef ENABLE_HE
if (_bitDepth == 2)
WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[0], palette[1], palette[2]));
else
+#endif
_grabbedCursor[32 * i + j] = 0xfd;
break;
default:
--
cgit v1.2.3
From 09845556e0383fb187f548c7cfc1a68b22329f7e Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sun, 16 Aug 2009 00:20:23 +0000
Subject: Revert revision 43410, and add alternative fix.
svn-id: r43416
---
engines/scumm/akos.cpp | 4 ----
engines/scumm/cursor.cpp | 4 ----
engines/scumm/he/palette_he.cpp | 21 ---------------------
engines/scumm/palette.cpp | 21 +++++++++++++++++++++
4 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index c7f53b9763..f4bb8a2c8b 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -299,7 +299,6 @@ void AkosRenderer::setPalette(uint16 *new_palette) {
if (size > 256)
error("akos_setPalette: %d is too many colors", size);
-#ifdef ENABLE_HE
if (_vm->_game.features & GF_16BIT_COLOR) {
if (_paletteNum) {
for (i = 0; i < size; i++)
@@ -318,13 +317,10 @@ void AkosRenderer::setPalette(uint16 *new_palette) {
for (i = 0; i < size; i++)
_palette[i] = (byte)_vm->_hePalettes[_paletteNum * _vm->_hePaletteSlot + 768 + akpl[i]];
} else {
-#endif
for (i = 0; i < size; i++) {
_palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i];
}
-#ifdef ENABLE_HE
}
-#endif
if (_vm->_game.heversion == 70) {
for (i = 0; i < size; i++)
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 5af25e95ef..66ac68bd95 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -194,19 +194,15 @@ void ScummEngine_v70he::setDefaultCursor() {
for (j = 0; j < 32; j++) {
switch ((p & (0x3 << 14)) >> 14) {
case 1:
-#ifdef ENABLE_HE
if (_bitDepth == 2)
WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[4], palette[5], palette[6]));
else
-#endif
_grabbedCursor[32 * i + j] = 0xfe;
break;
case 2:
-#ifdef ENABLE_HE
if (_bitDepth == 2)
WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[0], palette[1], palette[2]));
else
-#endif
_grabbedCursor[32 * i + j] = 0xfd;
break;
default:
diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp
index 02f3f3fc5c..ff29f9ecd0 100644
--- a/engines/scumm/he/palette_he.cpp
+++ b/engines/scumm/he/palette_he.cpp
@@ -33,27 +33,6 @@
namespace Scumm {
-uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) {
- assertRange(0, palSlot, _numPalettes, "palette");
-
- if (_game.heversion >= 99) {
- if (palSlot)
- return _hePalettes + palSlot * _hePaletteSlot + 768;
- else
- return _hePalettes + _hePaletteSlot + 768;
- }
-
- return NULL;
-}
-
-uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) {
- uint16 ar = (r >> 3) << 10;
- uint16 ag = (g >> 3) << 5;
- uint16 ab = (b >> 3) << 0;
- uint16 col = ar | ag | ab;
- return col;
-}
-
void ScummEngine_v71he::remapHEPalette(const uint8 *src, uint8 *dst) {
int r, g, b, sum, bestitem, bestsum;
int ar, ag, ab;
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index f59b59b40f..a596cc5b1a 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -33,6 +33,27 @@
namespace Scumm {
+uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) {
+ assertRange(0, palSlot, _numPalettes, "palette");
+
+ if (_game.heversion >= 99) {
+ if (palSlot)
+ return _hePalettes + palSlot * _hePaletteSlot + 768;
+ else
+ return _hePalettes + _hePaletteSlot + 768;
+ }
+
+ return NULL;
+}
+
+uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) {
+ uint16 ar = (r >> 3) << 10;
+ uint16 ag = (g >> 3) << 5;
+ uint16 ab = (b >> 3) << 0;
+ uint16 col = ar | ag | ab;
+ return col;
+}
+
void ScummEngine::resetPalette() {
if (_game.version <= 1) {
if (_game.platform == Common::kPlatformApple2GS) {
--
cgit v1.2.3
From 43d57fd333afa54f4e85f30e2ef8231444988066 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sun, 16 Aug 2009 01:46:47 +0000
Subject: Update branch specific save game changes, to prevent conflicts.
svn-id: r43421
---
engines/scumm/actor.cpp | 4 ++--
engines/scumm/saveload.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 227ae1d316..9dab776b67 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2553,8 +2553,8 @@ void Actor::saveLoadWithSerializer(Serializer *ser) {
// Actor palette grew from 64 to 256 bytes and switched to uint16 in HE games
MKARRAY_OLD(Actor, _palette[0], sleByte, 64, VER(8), VER(9)),
- MKARRAY_OLD(Actor, _palette[0], sleByte, 256, VER(10), VER(77)),
- MKARRAY(Actor, _palette[0], sleUint16, 256, VER(78)),
+ MKARRAY_OLD(Actor, _palette[0], sleByte, 256, VER(10), VER(79)),
+ MKARRAY(Actor, _palette[0], sleUint16, 256, VER(80)),
MK_OBSOLETE(Actor, _mask, sleByte, VER(8), VER(9)),
MKLINE(Actor, _shadowMode, sleByte, VER(8)),
diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h
index 4f6adc5570..fafb6b383f 100644
--- a/engines/scumm/saveload.h
+++ b/engines/scumm/saveload.h
@@ -50,7 +50,7 @@ namespace Scumm {
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
-#define CURRENT_VER 79
+#define CURRENT_VER 80
/**
* An auxillary macro, used to specify savegame versions. We use this instead
--
cgit v1.2.3
From cbffcb609f752edcc3f086521c9e0c75b5ee4cc4 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Sun, 16 Aug 2009 07:40:13 +0000
Subject: Replaced KeyStates with ActionKeys in the keymapper, removed SDL
ASCII code mismatch workaround hacks, fixed the memory leaks I had previously
created.
svn-id: r43430
---
backends/keymapper/action.cpp | 17 ++++++++++++-----
backends/keymapper/action.h | 4 ++--
backends/keymapper/hardware-key.h | 19 +++++++++++++++----
backends/keymapper/keymap.cpp | 12 +++++-------
backends/keymapper/keymap.h | 6 +++---
backends/keymapper/keymapper.cpp | 22 +++++-----------------
backends/keymapper/keymapper.h | 6 +++---
backends/keymapper/remap-dialog.cpp | 9 ++-------
backends/platform/sdl/hardwarekeys.cpp | 2 +-
9 files changed, 48 insertions(+), 49 deletions(-)
diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp
index 3feb593f19..1f4efbf457 100644
--- a/backends/keymapper/action.cpp
+++ b/backends/keymapper/action.cpp
@@ -43,14 +43,21 @@ Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
_boss->addAction(this);
}
-void Action::mapKey(const HardwareKey *key) {
+void Action::mapKey(const HardwareKey *key, byte flags) {
if (_hwKey)
+ {
_boss->unregisterMapping(this);
+ delete _hwKey;
+ }
- _hwKey = key;
-
- if (_hwKey)
- _boss->registerMapping(this, _hwKey);
+ if (key) {
+ _hwKey = new HardwareKey(*key);
+ if (flags)
+ _hwKey->key.flags = flags & _hwKey->modMask;
+ if (_hwKey)
+ _boss->registerMapping(this, _hwKey);
+ } else
+ _hwKey = NULL;
}
const HardwareKey *Action::getMappedKey() const {
diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h
index 31576e2960..c49518b605 100644
--- a/backends/keymapper/action.h
+++ b/backends/keymapper/action.h
@@ -59,7 +59,7 @@ struct Action {
private:
/** Hardware key that is mapped to this Action */
- const HardwareKey *_hwKey;
+ HardwareKey *_hwKey;
Keymap *_boss;
public:
@@ -105,7 +105,7 @@ public:
return _boss;
}
- void mapKey(const HardwareKey *key);
+ void mapKey(const HardwareKey *key, byte flags = 0);
const HardwareKey *getMappedKey() const;
};
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 94e6589a17..70168def2d 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -49,6 +49,17 @@ struct ActionKey {
KeyCode keycode;
byte flags;
+ ActionKey () {
+ keycode = KEYCODE_INVALID;
+ flags = 0;
+ }
+
+ ActionKey (const KeyState &key) {
+ keycode = key.keycode;
+ flags = key.flags;
+ }
+
+
ActionKey (KeyCode ky, byte f) {
keycode = ky;
flags = f;
@@ -75,7 +86,7 @@ struct HardwareKey {
* The KeyState that is generated by the back-end
* when this hardware key is pressed.
*/
- KeyState key;
+ ActionKey key;
KeyType type;
ActionType preferredAction;
@@ -83,7 +94,7 @@ struct HardwareKey {
// Mask of modifiers that can possibly apply to this key.
byte modMask;
- HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "", byte mods = ~0,
+ HardwareKey(const char *i, ActionKey ky = ActionKey(), String desc = "", byte mods = ~0,
KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
: key(ky), description(desc), type(typ), preferredAction(prefAct), modMask(mods) {
assert(i);
@@ -150,7 +161,7 @@ public:
return 0;
}
- const HardwareKey *findHardwareKey(const KeyState& keystate) const {
+ const HardwareKey *findHardwareKey(const ActionKey& keystate) const {
List::const_iterator it;
for (it = _keys.begin(); it != _keys.end(); it++) {
@@ -170,7 +181,7 @@ public:
return 0;
}
- const HardwareMod *findHardwareMod(const KeyState& keystate) const {
+ const HardwareMod *findHardwareMod(const ActionKey& keystate) const {
List::const_iterator it;
for (it = _mods.begin(); it != _mods.end(); it++) {
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp
index fe6f133254..9d8b6046cd 100644
--- a/backends/keymapper/keymap.cpp
+++ b/backends/keymapper/keymap.cpp
@@ -60,7 +60,7 @@ void Keymap::addAction(Action *action) {
}
void Keymap::registerMapping(Action *action, const HardwareKey *hwKey) {
- HashMap::iterator it;
+ HashMap::iterator it;
it = _keymap.find(hwKey->key);
@@ -105,8 +105,8 @@ const Action *Keymap::findAction(const char *id) const {
return 0;
}
-Action *Keymap::getMappedAction(const KeyState& ks) const {
- HashMap::iterator it;
+Action *Keymap::getMappedAction(const ActionKey& ks) const {
+ HashMap::iterator it;
it = _keymap.find(ks);
@@ -157,9 +157,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
_configDomain->erase(key);
continue;
}
- HardwareKey *mappedKey = new HardwareKey(*hwKey);
- mappedKey->key.flags = modId;
- ua->mapKey(mappedKey);
+ ua->mapKey(hwKey,modId);
}
}
@@ -335,7 +333,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
}
}
-Action *Keymap::getParentMappedAction(KeyState key) {
+Action *Keymap::getParentMappedAction(const ActionKey &key) {
if (_parent) {
Action *act = _parent->getMappedAction(key);
diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h
index 5bb277c924..f4ad8d110d 100644
--- a/backends/keymapper/keymap.h
+++ b/backends/keymapper/keymap.h
@@ -89,7 +89,7 @@ public:
* @param key the key that is mapped to the required Action
* @return a pointer to the Action or 0 if no
*/
- Action *getMappedAction(const KeyState& ks) const;
+ Action *getMappedAction(const ActionKey& ks) const;
void setConfigDomain(ConfigManager::Domain *dom);
@@ -147,12 +147,12 @@ private:
void internalMapKey(Action *action, HardwareKey *hwKey);
- Action *getParentMappedAction(KeyState key);
+ Action *getParentMappedAction(const ActionKey &key);
String _name;
Keymap *_parent;
List _actions;
- HashMap _keymap;
+ HashMap _keymap;
ConfigManager::Domain *_configDomain;
};
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index d101e8e0d2..704affb3fe 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -190,33 +190,21 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
return false;
Action *action = 0;
-
if (keyDown) {
- // HACK: Temporary fix for modifier recognition, get the hwkey's keystate
- // to correct for keydown and keyup generating different ascii codes in SDL
- // to be solved more permanently by using a structure other than KeyState
-
- const HardwareKey *hwkey = findHardwareKey(key);
- if (!hwkey)
- return false;
-
- KeyState k = hwkey->key;
- k.flags = key.flags & hwkey->modMask;
-
// Search for key in active keymap stack
for (int i = _activeMaps.size() - 1; i >= 0; --i) {
MapRecord mr = _activeMaps[i];
- action = mr.keymap->getMappedAction(k);
+ action = mr.keymap->getMappedAction(key);
if (action || mr.inherit == false)
break;
}
if (action)
- _keysDown[k] = action;
+ _keysDown[key] = action;
} else {
- HashMap::iterator it = _keysDown.find(key);
+ HashMap::iterator it = _keysDown.find(key);
if (it != _keysDown.end()) {
action = it->_value;
@@ -279,11 +267,11 @@ void Keymapper::executeAction(const Action *action, bool keyDown) {
}
}
-const HardwareKey *Keymapper::findHardwareKey(const KeyState& key) {
+const HardwareKey *Keymapper::findHardwareKey(const ActionKey& key) {
return (_hardwareKeys) ? _hardwareKeys->findHardwareKey(key) : 0;
}
-const HardwareMod *Keymapper::findHardwareMod(const KeyState& key) {
+const HardwareMod *Keymapper::findHardwareMod(const ActionKey& key) {
return (_hardwareKeys) ? _hardwareKeys->findHardwareMod(key) : 0;
}
diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h
index af3314f8f5..24c76fb09f 100644
--- a/backends/keymapper/keymapper.h
+++ b/backends/keymapper/keymapper.h
@@ -168,12 +168,12 @@ public:
/**
* Return a HardwareKey pointer for the given key state
*/
- const HardwareKey *findHardwareKey(const KeyState& key);
+ const HardwareKey *findHardwareKey(const ActionKey& key);
/**
* Return a HardwareMod pointer for the given key state
*/
- const HardwareMod *findHardwareMod(const KeyState& key);
+ const HardwareMod *findHardwareMod(const ActionKey& key);
Domain& getGlobalDomain() { return _globalDomain; }
Domain& getGameDomain() { return _gameDomain; }
@@ -198,7 +198,7 @@ private:
bool _enabled;
Stack _activeMaps;
- HashMap _keysDown;
+ HashMap _keysDown;
};
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 323790a700..0a93785c08 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -243,14 +243,9 @@ void RemapDialog::handleKeyUp(Common::KeyState state) {
debug( "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
if (hwkey) {
- //FIXME: this leaks memory and there's no good way to get this pointer again as
- //a non-const. this should be done differently when we switch to actionKeys.
- HardwareKey *mappedkey = new HardwareKey(*hwkey);
- mappedkey->description = hwkey->description;
- mappedkey->key.flags = (state.flags & hwkey->modMask);
-
- _activeRemapAction->mapKey(mappedkey);
+ _activeRemapAction->mapKey(hwkey,state.flags);
_activeRemapAction->getParent()->saveMappings();
+
_changes = true;
stopRemapping();
}
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index 506e71d092..af9b0ba319 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -227,7 +227,7 @@ Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
snprintf(fullKeyId, 50, "%s", key->hwId);
snprintf(fullKeyDesc, 100, "%s", key->desc);
- keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, 0), fullKeyDesc, key->modableMask, key->preferredAction));
+ keySet->addHardwareKey(new HardwareKey(fullKeyId, ActionKey(key->keycode, 0), fullKeyDesc, key->modableMask, key->preferredAction));
}
keySetInited = true;
--
cgit v1.2.3
From 62bcb2e51b45e744d0b27b124179cb6ec435188d Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Mon, 17 Aug 2009 12:57:37 +0000
Subject: Commit (slightly) modified version of patch #2831248: Allow
suspend/resume for PSP
svn-id: r43477
---
AUTHORS | 1 +
COPYRIGHT | 1 +
NEWS | 3 +
backends/fs/psp/psp-fs-factory.cpp | 8 +-
backends/fs/psp/psp-fs.cpp | 62 ++++++--
backends/fs/psp/psp-stream.cpp | 230 ++++++++++++++++++++++++++++
backends/fs/psp/psp-stream.h | 70 +++++++++
backends/module.mk | 1 +
backends/platform/psp/Makefile | 5 +-
backends/platform/psp/module.mk | 1 +
backends/platform/psp/osys_psp.cpp | 1 +
backends/platform/psp/osys_psp.h | 5 +
backends/platform/psp/powerman.cpp | 297 +++++++++++++++++++++++++++++++++++++
backends/platform/psp/powerman.h | 87 +++++++++++
backends/platform/psp/psp.spec | 2 +-
backends/platform/psp/psp_main.cpp | 29 +++-
gui/credits.h | 2 +
tools/credits.pl | 1 +
18 files changed, 792 insertions(+), 14 deletions(-)
create mode 100644 backends/fs/psp/psp-stream.cpp
create mode 100644 backends/fs/psp/psp-stream.h
create mode 100644 backends/platform/psp/powerman.cpp
create mode 100644 backends/platform/psp/powerman.h
diff --git a/AUTHORS b/AUTHORS
index bc52898b18..f6032b1344 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -314,6 +314,7 @@ Other contributions
Andreas Karlsson - Initial port for SymbianOS
Claudio Matsuoka - Daily Linux builds
Thomas Mayer - PSP port contributions
+ Yotam Barnoy - PSP port suspend/resume support
Sean Murray - ScummVM tools GUI application (GSoC 2007 task)
n0p - Windows CE port aspect ratio correction scaler
and right click input method
diff --git a/COPYRIGHT b/COPYRIGHT
index cc104a6652..f707741e2c 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -205,3 +205,4 @@ Robert Wohlrab "moshroum"
Xanathar "xanathar"
Grant Yeager "glo_kidd"
Benjamin W. Zale "junior_aepi"
+Yotam Barnoy "bluddy"
diff --git a/NEWS b/NEWS
index 50336fe524..40cec7ea62 100644
--- a/NEWS
+++ b/NEWS
@@ -59,6 +59,9 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
- Added support for PC Speaker based music and sound effects.
- Added support for 16 color dithering in Kyrandia PC-9801.
+ PSP port:
+ - Added support for sleep mode (suspend/resume).
+
WinCE port:
- Speed optimized versions of low-res Smartphone and 2x scalers.
- New aspect correction scaler for VGA (or higher) devices.
diff --git a/backends/fs/psp/psp-fs-factory.cpp b/backends/fs/psp/psp-fs-factory.cpp
index 27bee4de86..7ed84de034 100644
--- a/backends/fs/psp/psp-fs-factory.cpp
+++ b/backends/fs/psp/psp-fs-factory.cpp
@@ -34,7 +34,13 @@ AbstractFSNode *PSPFilesystemFactory::makeRootFileNode() const {
AbstractFSNode *PSPFilesystemFactory::makeCurrentDirectoryFileNode() const {
char buf[MAXPATHLEN];
- return getcwd(buf, MAXPATHLEN) ? new PSPFilesystemNode(buf) : NULL;
+ char * ret = 0;
+
+ PowerMan.beginCriticalSection();
+ ret = getcwd(buf, MAXPATHLEN);
+ PowerMan.endCriticalSection();
+
+ return (ret ? new PSPFilesystemNode(buf) : NULL);
}
AbstractFSNode *PSPFilesystemFactory::makeFileNodePath(const Common::String &path) const {
diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp
index f5ff65c9fa..03247e86ad 100644
--- a/backends/fs/psp/psp-fs.cpp
+++ b/backends/fs/psp/psp-fs.cpp
@@ -26,7 +26,8 @@
#include "engines/engine.h"
#include "backends/fs/abstract-fs.h"
-#include "backends/fs/stdiostream.h"
+#include "backends/fs/psp/psp-stream.h"
+#include "backends/platform/psp/powerman.h"
#include
#include
@@ -35,6 +36,9 @@
#define ROOT_PATH "ms0:/"
+#include "backends/platform/psp/trace.h"
+
+
/**
* Implementation of the ScummVM file system API based on PSPSDK API.
*
@@ -61,13 +65,13 @@ public:
*/
PSPFilesystemNode(const Common::String &p, bool verify = true);
- virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; }
+ virtual bool exists() const;
virtual Common::String getDisplayName() const { return _displayName; }
virtual Common::String getName() const { return _displayName; }
virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
- virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; }
- virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; }
+ virtual bool isReadable() const;
+ virtual bool isWritable() const;
virtual AbstractFSNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
@@ -94,11 +98,44 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p, bool verify) {
if (verify) {
struct stat st;
+ PowerMan.beginCriticalSection();
_isValid = (0 == stat(_path.c_str(), &st));
+ PowerMan.endCriticalSection();
_isDirectory = S_ISDIR(st.st_mode);
}
}
+bool PSPFilesystemNode::exists() const {
+ int ret = 0;
+
+ PowerMan.beginCriticalSection(); // Make sure to block in case of suspend
+ ret = access(_path.c_str(), F_OK);
+ PowerMan.endCriticalSection();
+
+ return ret == 0;
+}
+
+bool PSPFilesystemNode::isReadable() const {
+ int ret = 0;
+
+ PowerMan.beginCriticalSection(); // Make sure to block in case of suspend
+ ret = access(_path.c_str(), R_OK);
+ PowerMan.endCriticalSection();
+
+ return ret == 0;
+}
+
+bool PSPFilesystemNode::isWritable() const {
+ int ret = 0;
+
+ PowerMan.beginCriticalSection(); // Make sure to block in case of suspend
+ ret = access(_path.c_str(), W_OK);
+ PowerMan.endCriticalSection();
+
+ return ret == 0;
+}
+
+
AbstractFSNode *PSPFilesystemNode::getChild(const Common::String &n) const {
// FIXME: Pretty lame implementation! We do no error checking to speak
// of, do not check if this is a special node, etc.
@@ -117,6 +154,10 @@ bool PSPFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
//TODO: honor the hidden flag
+ bool ret = true;
+
+ PowerMan.beginCriticalSection(); // Make sure to block in case of suspend
+
int dfd = sceIoDopen(_path.c_str());
if (dfd > 0) {
SceIoDirent dir;
@@ -149,10 +190,13 @@ bool PSPFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
}
sceIoDclose(dfd);
- return true;
- } else {
- return false;
+ ret = true;
+ } else { // dfd <= 0
+ ret = false;
}
+
+ PowerMan.endCriticalSection();
+ return ret;
}
AbstractFSNode *PSPFilesystemNode::getParent() const {
@@ -166,11 +210,11 @@ AbstractFSNode *PSPFilesystemNode::getParent() const {
}
Common::SeekableReadStream *PSPFilesystemNode::createReadStream() {
- return StdioStream::makeFromPath(getPath().c_str(), false);
+ return PSPIoStream::makeFromPath(getPath(), false);
}
Common::WriteStream *PSPFilesystemNode::createWriteStream() {
- return StdioStream::makeFromPath(getPath().c_str(), true);
+ return PSPIoStream::makeFromPath(getPath(), true);
}
#endif //#ifdef __PSP__
diff --git a/backends/fs/psp/psp-stream.cpp b/backends/fs/psp/psp-stream.cpp
new file mode 100644
index 0000000000..fac4067f46
--- /dev/null
+++ b/backends/fs/psp/psp-stream.cpp
@@ -0,0 +1,230 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+#ifdef __PSP__
+
+#include "backends/fs/psp/psp-stream.h"
+#include "backends/platform/psp/trace.h"
+#include
+
+PSPIoStream::PSPIoStream(const Common::String &path, bool writeMode)
+: StdioStream((void *)1), _path(path), _writeMode(writeMode) {
+
+ assert(!path.empty());
+
+ _handle = (void *)0; // Need to do this since base class asserts not 0.
+
+ PowerMan.registerSuspend(this); // Register with the powermanager to be suspended
+
+}
+
+PSPIoStream::~PSPIoStream() {
+ PowerMan.unregisterSuspend(this); // Unregister with powermanager to be suspended
+ // Must do this before fclose() or resume() will reopen.
+
+ fclose((FILE *)_handle);
+}
+
+// Function to open the file pointed to by the path.
+//
+//
+void * PSPIoStream::open() {
+ if (PowerMan.beginCriticalSection()==PowerManager::Blocked) {
+ // No need to open. Just return the _handle resume() already opened.
+ PSPDebugTrace("Suspended in PSPIoStream::open\n");
+ } else {
+ _handle = fopen(_path.c_str(), _writeMode ? "wb" : "rb"); // open
+ }
+
+ PowerMan.endCriticalSection();
+
+ return _handle;
+}
+
+bool PSPIoStream::err() const {
+ bool ret;
+
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::err()\n");
+
+ ret = ferror((FILE *)_handle) != 0;
+
+ PowerMan.endCriticalSection();
+
+ return ret;
+}
+
+void PSPIoStream::clearErr() {
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::clearErr()\n");
+
+ clearerr((FILE *)_handle);
+
+ PowerMan.endCriticalSection();
+}
+
+bool PSPIoStream::eos() const {
+ bool ret;
+
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::eos()\n");
+
+ ret = feof((FILE *)_handle) != 0;
+
+ PowerMan.endCriticalSection();
+
+ return ret;
+}
+
+int32 PSPIoStream::pos() const {
+ int32 ret;
+
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::pos()\n");
+
+ ret = ftell((FILE *)_handle);
+
+ PowerMan.endCriticalSection();
+
+ return ret;
+}
+
+
+int32 PSPIoStream::size() const {
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::size()\n");
+
+ int32 oldPos = ftell((FILE *)_handle);
+ fseek((FILE *)_handle, 0, SEEK_END);
+ int32 length = ftell((FILE *)_handle);
+ fseek((FILE *)_handle, oldPos, SEEK_SET);
+
+ PowerMan.endCriticalSection();
+
+ return length;
+}
+
+bool PSPIoStream::seek(int32 offs, int whence) {
+ int ret = 0;
+
+ // Check if we can access the file
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::seek()\n");
+
+ ret = fseek((FILE *)_handle, offs, whence);
+
+ PowerMan.endCriticalSection();
+
+ return ret == 0;
+}
+
+uint32 PSPIoStream::read(void *ptr, uint32 len) {
+ int ret = 0;
+
+ // Check if we can access the file
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::read()\n");
+
+ ret = fread((byte *)ptr, 1, len, (FILE *)_handle);
+
+ PowerMan.endCriticalSection();
+
+ return ret;
+}
+
+uint32 PSPIoStream::write(const void *ptr, uint32 len) {
+ int ret = 0;
+
+ // Check if we can access the file
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::read()\n");
+
+ ret = fwrite(ptr, 1, len, (FILE *)_handle);
+
+ PowerMan.endCriticalSection();
+
+ return ret;
+}
+
+bool PSPIoStream::flush() {
+ int ret = 0;
+
+ // Check if we can access the file
+ if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
+ PSPDebugTrace("Suspended in PSPIoStream::read()\n");
+
+ ret = fflush((FILE *)_handle);
+
+ PowerMan.endCriticalSection();
+
+ return ret == 0;
+}
+
+// For the PSP, since we're building in suspend support, we moved opening
+// the actual file to an open function since we need an actual PSPIoStream object to suspend.
+//
+PSPIoStream *PSPIoStream::makeFromPath(const Common::String &path, bool writeMode) {
+ PSPIoStream *stream = new PSPIoStream(path, writeMode);
+
+ if (stream->open() > 0) {
+ return stream;
+ } else {
+ delete stream;
+ return 0;
+ }
+}
+
+/*
+ * Function to suspend the IO stream (called by PowerManager)
+ */
+int PSPIoStream::suspend() {
+ if (_handle > 0) {
+ _pos = ftell((FILE *)_handle); // Save our position
+ fclose((FILE *)_handle); // close our file descriptor
+ _handle = 0; // Set handle to null
+ }
+
+ return 0;
+}
+
+/*
+ * Function to resume the IO stream (called by Power Manager)
+ */
+int PSPIoStream::resume() {
+ int ret = 0;
+
+ // We reopen our file descriptor
+ _handle = fopen(_path.c_str(), _writeMode ? "wb" : "rb");
+ if (_handle <= 0) {
+ PSPDebugTrace("PSPIoStream::resume(): Couldn't reopen file %s\n", _path.c_str());
+ ret = -1;;
+ }
+
+ // Resume our previous position
+ if(_handle > 0) fseek((FILE *)_handle, _pos, SEEK_SET);
+
+ return ret;
+}
+
+#endif /* __PSP__ */
diff --git a/backends/fs/psp/psp-stream.h b/backends/fs/psp/psp-stream.h
new file mode 100644
index 0000000000..0363c92416
--- /dev/null
+++ b/backends/fs/psp/psp-stream.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef PSPSTREAM_H_
+#define PSPSTREAM_H_
+
+#include "backends/fs/stdiostream.h"
+#include "backends/platform/psp/powerman.h"
+#include "common/list.h"
+
+/*
+ * Class to handle special suspend/resume needs of PSP IO Streams
+ */
+class PSPIoStream : public StdioStream, public Suspendable {
+protected:
+ Common::String _path; /* Need to maintain for reopening after suspend */
+ bool _writeMode; /* "" */
+ unsigned int _pos; /* "" */
+
+public:
+ /**
+ * Given a path, invoke fopen on that path and wrap the result in a
+ * PSPIoStream instance.
+ */
+ static PSPIoStream *makeFromPath(const Common::String &path, bool writeMode);
+
+ PSPIoStream(const Common::String &path, bool writeMode);
+ virtual ~PSPIoStream();
+
+ void * open(); // open the file pointed to by the file path
+
+ bool err() const;
+ void clearErr();
+ bool eos() const;
+
+ virtual uint32 write(const void *dataPtr, uint32 dataSize);
+ virtual bool flush();
+
+ virtual int32 pos() const;
+ virtual int32 size() const;
+ virtual bool seek(int32 offs, int whence = SEEK_SET);
+ virtual uint32 read(void *dataPtr, uint32 dataSize);
+
+ int suspend(); /* Suspendable interface (power manager) */
+ int resume(); /* " " */
+};
+
+#endif /* PSPSTREAM_H_ */
diff --git a/backends/module.mk b/backends/module.mk
index f3294c5dc6..42fbeb07eb 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -11,6 +11,7 @@ MODULE_OBJS := \
fs/posix/posix-fs-factory.o \
fs/ps2/ps2-fs-factory.o \
fs/psp/psp-fs-factory.o \
+ fs/psp/psp-stream.o \
fs/symbian/symbian-fs-factory.o \
fs/windows/windows-fs-factory.o \
fs/wii/wii-fs-factory.o \
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index 91a0c60bd6..ad22a853e1 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -75,12 +75,13 @@ LIBS += -lmad
CXXFLAGS+= -DUSE_VORBIS -DUSE_TREMOR
LIBS += -lvorbisidec
-LIBS += `$(PSPBIN)/sdl-config --libs` -lz -lstdc++ -lc -lpspdisplay -lpspgu -lpspctrl -lpspsdk -lpspnet -lpspnet_inet -lpsputility -lpspsdk -lpspuser
+LIBS += `$(PSPBIN)/sdl-config --libs` -lz -lstdc++ -lc -lpspdisplay -lpspgu -lpspctrl -lpspsdk -lpspnet -lpspnet_inet -lpsputility -lpspuser -lpsppower
CXXFLAGS := $(CXXFLAGS) -fno-exceptions -fno-rtti
TARGET = scummvm-psp
-OBJS := psp_main.o \
+OBJS := powerman.o \
+ psp_main.o \
osys_psp.o \
osys_psp_gu.o \
kbd_ss_c.o \
diff --git a/backends/platform/psp/module.mk b/backends/platform/psp/module.mk
index afe9a23f58..8f083c5dfa 100644
--- a/backends/platform/psp/module.mk
+++ b/backends/platform/psp/module.mk
@@ -1,6 +1,7 @@
MODULE := backends/platform/psp
MODULE_OBJS := \
+ powerman.o \
psp_main.o \
osys_psp.o \
osys_psp_gu.o \
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 45be0a0cd3..8a7a0af0ed 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -430,6 +430,7 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
} else if (buttonsChanged & PSP_CTRL_START) {
event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
+ event.kbd.flags = Common::KBD_CTRL; // Main menu to allow RTL
/* } else if (buttonsChanged & PSP_CTRL_SELECT) {
event.kbd.keycode = Common::KEYCODE_0;
event.kbd.ascii = '0';
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 34957b293c..46607dac34 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -23,6 +23,9 @@
*
*/
+#ifndef OSYS_PSP_H
+#define OSYS_PSP_H
+
#include "common/scummsys.h"
#include "graphics/surface.h"
#include "graphics/colormasks.h"
@@ -144,3 +147,5 @@ public:
virtual Common::WriteStream *createConfigWriteStream();
};
+
+#endif /* OSYS_PSP_H */
diff --git a/backends/platform/psp/powerman.cpp b/backends/platform/psp/powerman.cpp
new file mode 100644
index 0000000000..c553669fc3
--- /dev/null
+++ b/backends/platform/psp/powerman.cpp
@@ -0,0 +1,297 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "./powerman.h"
+#include "./trace.h"
+
+DECLARE_SINGLETON(PowerManager);
+
+ /*******************************************
+*
+* Constructor
+*
+********************************************/
+PowerManager::PowerManager() {
+ _flagMutex = NULL; /* Init mutex handle */
+ _listMutex = NULL; /* Init mutex handle */
+ _condSuspendable = NULL; /* Init condition variable */
+ _condPM = NULL;
+
+ _condSuspendable = SDL_CreateCond();
+ if (_condSuspendable <= 0) {
+ PSPDebugTrace("PowerManager::PowerManager(): Couldn't create condSuspendable\n");
+ }
+
+ _condPM = SDL_CreateCond();
+ if (_condPM <= 0) {
+ PSPDebugTrace("PowerManager::PowerManager(): Couldn't create condPM\n");
+ }
+
+ _flagMutex = SDL_CreateMutex();
+ if (_flagMutex <= 0) {
+ PSPDebugTrace("PowerManager::PowerManager(): Couldn't create flagMutex\n");
+ }
+
+ _listMutex = SDL_CreateMutex();
+ if (_listMutex <= 0) {
+ PSPDebugTrace("PowerManager::PowerManager(): Couldn't create listMutex\n");
+ }
+
+ _suspendFlag = false;
+ _criticalCounter = 0;
+ }
+
+/*******************************************
+*
+* Function to register to be notified when suspend/resume time comes
+*
+********************************************/
+int PowerManager::registerSuspend(Suspendable *item) {
+ // Register in list
+ PSPDebugTrace("In registerSuspend\n");
+
+ if (SDL_mutexP(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::registerSuspend(): Couldn't lock _listMutex %d\n", _listMutex);
+ }
+
+ _suspendList.push_front(item);
+
+ if (SDL_mutexV(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::registerSuspend(): Couldn't unlock _listMutex %d\n", _listMutex);
+ }
+
+ PSPDebugTrace("Out of registerSuspend\n");
+
+ return 0;
+}
+
+/*******************************************
+*
+* Function to unregister to be notified when suspend/resume time comes
+*
+********************************************/
+int PowerManager::unregisterSuspend(Suspendable *item) {
+
+ PSPDebugTrace("In unregisterSuspend\n");
+
+ // Unregister from stream list
+ if (SDL_mutexP(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::unregisterSuspend(): Couldn't unlock _listMutex %d\n", _listMutex);
+ }
+
+ _suspendList.remove(item);
+
+ if (SDL_mutexV(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::unregisterSuspend(): Couldn't unlock _listMutex %d\n", _listMutex);
+ }
+
+ PSPDebugTrace("Out of unregisterSuspend\n");
+
+ return 0;
+ }
+
+ /*******************************************
+*
+* Destructor
+*
+********************************************/
+ PowerManager::~PowerManager() {
+ SDL_DestroyCond(_condSuspendable);
+ _condSuspendable = 0;
+
+ SDL_DestroyCond(_condPM);
+ _condPM = 0;
+
+ SDL_DestroyMutex(_flagMutex);
+ _flagMutex = 0;
+
+ SDL_DestroyMutex(_listMutex);
+ _listMutex = 0;
+ }
+
+
+ /*******************************************
+*
+* Function to be called by threads wanting to block on the PSP entering suspend
+*
+********************************************/
+ int PowerManager::blockOnSuspend() {
+ return beginCriticalSection(true);
+}
+
+ /*
+ * Function to block on a suspend, then start a non-suspendable critical section
+ */
+int PowerManager::beginCriticalSection(bool justBlock) {
+ int ret = PowerManager::NotBlocked;
+
+ if (SDL_mutexP(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::blockOnSuspend(): Couldn't lock flagMutex %d\n", _flagMutex);
+ ret = PowerManager::Error;
+ }
+
+ // Check the access flag
+ if (_suspendFlag == true) {
+ PSPDebugTrace("Blocking!!\n");
+ ret = PowerManager::Blocked;
+
+ // If it's true, we wait for a signal to continue
+ if( SDL_CondWait(_condSuspendable, _flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::blockOnSuspend(): Couldn't wait on cond %d\n", _condSuspendable);
+ }
+
+ PSPDebugTrace("We got blocked!!\n");
+ }
+
+ // Now put the pm to sleep
+ if (justBlock == false)
+ _criticalCounter++;
+
+ if (SDL_mutexV(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::blockOnSuspend(): Couldn't unlock flagMutex %d\n", _flagMutex);
+ ret = PowerManager::Error;
+ }
+
+ return ret;
+}
+
+int PowerManager::endCriticalSection() {
+ int ret = 0;
+
+ if (SDL_mutexP(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::endCriticalSection(): Couldn't lock flagMutex %d\n", _flagMutex);
+ ret = PowerManager::Error;
+ }
+
+ // We're done with our critical section
+ _criticalCounter--;
+
+ if (_criticalCounter <= 0) {
+ if(_suspendFlag == true) PSPDebugTrace("Waking up the PM and suspendFlag is true\n");
+
+ SDL_CondBroadcast(_condPM);
+
+ if (_criticalCounter < 0) {
+ PSPDebugTrace("PowerManager::endCriticalSection(): Error! Critical counter is %d\n", _criticalCounter);
+ }
+ }
+
+ if (SDL_mutexV(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::endCriticalSection(): Couldn't unlock flagMutex %d\n", _flagMutex);
+ ret = PowerManager::Error;
+ }
+
+ return ret;
+}
+
+ /*******************************************
+*
+* Callback function to be called to put every Suspendable to suspend
+*
+********************************************/
+int PowerManager::suspend() {
+ int ret = 0;
+
+ // First we set the suspend flag to true
+ if (SDL_mutexP(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::suspend(): Couldn't lock flagMutex %d\n", _flagMutex);
+ ret = -1;
+ }
+
+ _suspendFlag = true;
+
+ if (_criticalCounter > 0)
+ SDL_CondWait(_condPM, _flagMutex);
+
+ if (SDL_mutexV(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::suspend(): Couldn't unlock flagMutex %d\n", _flagMutex);
+ ret = -1;
+ }
+
+ // Loop over list, calling suspend()
+ if (SDL_mutexP(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::suspend(): Couldn't lock listMutex %d\n", _listMutex);
+ ret = -1;
+ }
+
+ Common::List::iterator i = _suspendList.begin();
+
+ for (; i != _suspendList.end(); i++) {
+ (*i)->suspend();
+ }
+
+ if (SDL_mutexV(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::suspend(): Couldn't unlock listMutex %d\n", _listMutex);
+ ret = -1;
+ }
+
+ return ret;
+}
+
+/*******************************************
+*
+* Callback function to resume every Suspendable
+*
+********************************************/
+int PowerManager::resume() {
+ int ret = 0;
+
+ // First we notify our Suspendables. Loop over list, calling resume()
+ if (SDL_mutexP(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::resume(): Couldn't lock listMutex %d\n", _listMutex);
+ ret = -1;
+ }
+
+ Common::List::iterator i = _suspendList.begin();
+
+ for (; i != _suspendList.end(); i++) {
+ (*i)->resume();
+ }
+
+ if (SDL_mutexV(_listMutex) != 0) {
+ PSPDebugTrace("PowerManager::resume(): Couldn't unlock listMutex %d\n", _listMutex);
+ ret = -1;
+ }
+
+ // Now we set the suspend flag to false
+ if (SDL_mutexP(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::resume(): Couldn't lock flagMutex %d\n", _flagMutex);
+ ret = -1;
+ }
+ _suspendFlag = false;
+
+ // Signal the other threads to wake up
+ if (SDL_CondBroadcast(_condSuspendable) != 0) {
+ PSPDebugTrace("PowerManager::resume(): Couldn't broadcast condition %d\n", _condSuspendable);
+ ret = -1;
+ }
+
+ if (SDL_mutexV(_flagMutex) != 0) {
+ PSPDebugTrace("PowerManager::resume(): Couldn't unlock flagMutex %d\n", _flagMutex);
+ ret = -1;
+ }
+
+ return ret;
+}
diff --git a/backends/platform/psp/powerman.h b/backends/platform/psp/powerman.h
new file mode 100644
index 0000000000..0a5f7a2361
--- /dev/null
+++ b/backends/platform/psp/powerman.h
@@ -0,0 +1,87 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef POWERMAN_H
+#define POWERMAN_H
+
+#include
+#include
+#include "common/singleton.h"
+#include "common/list.h"
+
+ /*
+ * Implement this class (interface) if you want to use PowerManager's suspend callback functionality
+ *
+ */
+ class Suspendable {
+ public:
+ virtual ~Suspendable() {}
+ virtual int suspend() = 0;
+ virtual int resume() = 0;
+ };
+
+ /******************************************************************************************************
+ *
+ * This class will call a Suspendable when the PSP goes to suspend/resumes. It also provides the ability to block
+ * a thread when the PSP is going to suspend/suspending, and to wake it up when the PSP is resumed.
+ * This ability is very useful for managing the PSPIoStream class, but may be found useful by other classes as well.
+ *
+ *******************************************************************************************************/
+ class PowerManager: public Common::Singleton {
+private:
+ friend class Common::Singleton;
+ PowerManager();
+ ~PowerManager();
+
+ Common::List _suspendList; /* list to register in */
+
+ bool _suspendFlag; /* protected variable */
+ SDL_mutex *_flagMutex; /* mutex to access access flag */
+ SDL_mutex *_listMutex; /* mutex to access Suspendable list */
+ SDL_cond *_condSuspendable; /* signal to synchronize accessing threads */
+ SDL_cond *_condPM; /* signal to wake up the PM from a critical section */
+ int _criticalCounter; /* Counter of how many threads are in a critical section */
+
+public:
+ int blockOnSuspend(); /* block if suspending */
+ int beginCriticalSection(bool justBlock = false); /* Use a critical section to block (if suspend was already pressed) */
+ int endCriticalSection(); /* and to prevent the PSP from suspending in a particular section */
+ int registerSuspend(Suspendable *item); /* register to be called to suspend/resume */
+ int unregisterSuspend(Suspendable *item); /* remove from suspend/resume list */
+ int suspend(); /* callback to have all items in list suspend */
+ int resume(); /* callback to have all items in list resume */
+
+ enum {
+ Error = -1,
+ NotBlocked = 0,
+ Blocked = 1
+ };
+
+ };
+
+ // For easy access
+#define PowerMan PowerManager::instance()
+
+ #endif /* POWERMAN_H */
diff --git a/backends/platform/psp/psp.spec b/backends/platform/psp/psp.spec
index 807b8f93b7..e319b022f7 100644
--- a/backends/platform/psp/psp.spec
+++ b/backends/platform/psp/psp.spec
@@ -1,3 +1,3 @@
%rename lib old_lib
*lib:
-%(old_lib) -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lz -lstdc++ -lc -lpspdisplay -lpspgu -lpspctrl -lpspsdk -lpspnet -lpspnet_inet -lpsputility -lpspsdk -lpspuser
+%(old_lib) -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lz -lstdc++ -lc -lpspdisplay -lpspgu -lpspctrl -lpspsdk -lpspnet -lpspnet_inet -lpsputility -lpspuser -lpsppower
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp
index 0af7ebf269..37080c7bf9 100644
--- a/backends/platform/psp/psp_main.cpp
+++ b/backends/platform/psp/psp_main.cpp
@@ -31,10 +31,14 @@
#include
#endif
+#include
+
#include
#include
#include
#include
+#include "backends/platform/psp/powerman.h"
+
#include "osys_psp_gu.h"
#include "./trace.h"
@@ -91,17 +95,36 @@ void loaderInit() {
#endif
/* Exit callback */
-SceKernelCallbackFunction exit_callback(int /*arg1*/, int /*arg2*/, void * /*common*/) {
+int exit_callback(void) {
sceKernelExitGame();
return 0;
}
+/* Function for handling suspend/resume */
+void power_callback(int , int powerinfo) {
+ if (powerinfo & PSP_POWER_CB_POWER_SWITCH || powerinfo & PSP_POWER_CB_SUSPENDING) {
+ PowerMan.suspend();
+ } else if (powerinfo & PSP_POWER_CB_RESUME_COMPLETE) {
+ PowerMan.resume();
+ }
+}
+
/* Callback thread */
int CallbackThread(SceSize /*size*/, void *arg) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", (SceKernelCallbackFunction)exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
+ /* Set up callbacks for PSPIoStream */
+
+ cbid = sceKernelCreateCallback("Power Callback", (SceKernelCallbackFunction)power_callback, 0);
+ if (cbid >= 0) {
+ if(scePowerRegisterCallback(-1, cbid) < 0) {
+ PSPDebugTrace("SetupCallbacks(): Couldn't register callback for power_callback\n");
+ }
+ } else {
+ PSPDebugTrace("SetupCallbacks(): Couldn't create a callback for power_callback\n");
+ }
sceKernelSleepThreadCB();
return 0;
@@ -119,6 +142,8 @@ int SetupCallbacks(void) {
#undef main
int main(void) {
+ PowerManager::instance(); // Setup power manager
+
SetupCallbacks();
static const char *argv[] = { "scummvm", NULL };
@@ -131,6 +156,8 @@ int main(void) {
g_system->quit(); // TODO: Consider removing / replacing this!
+ PowerManager::destroy(); // get rid of PowerManager
+
sceKernelSleepThread();
return res;
diff --git a/gui/credits.h b/gui/credits.h
index 5ddae4ea37..21f69d4465 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -366,6 +366,8 @@ static const char *credits[] = {
"C2""Daily Linux builds",
"C0""Thomas Mayer",
"C2""PSP port contributions",
+"C0""Yotam Barnoy",
+"C2""PSP port suspend/resume support",
"C0""Sean Murray",
"C2""ScummVM tools GUI application (GSoC 2007 task)",
"C0""n0p",
diff --git a/tools/credits.pl b/tools/credits.pl
index 2b1b93e87b..ad006b2aee 100755
--- a/tools/credits.pl
+++ b/tools/credits.pl
@@ -832,6 +832,7 @@ begin_credits("Credits");
add_person("Andreas Karlsson", "Sprawl", "Initial port for SymbianOS");
add_person("Claudio Matsuoka", "", "Daily Linux builds");
add_person("Thomas Mayer", "", "PSP port contributions");
+ add_person("Yotam Barnoy", "bluddy", "PSP port suspend/resume support");
add_person("Sean Murray", "lightcast", "ScummVM tools GUI application (GSoC 2007 task)");
add_person("", "n0p", "Windows CE port aspect ratio correction scaler and right click input method");
add_person("Mikesch Nepomuk", "mnepomuk", "MI1 VGA floppy patches");
--
cgit v1.2.3
From 76a339ecd031369c1f4681b5af02a2d0e3b7e37f Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 17 Aug 2009 13:16:40 +0000
Subject: Added looping support to LinearDiskStream, needed by SAGA and perhaps
other engines. Note that the loop end parameter is still not implemented
svn-id: r43479
---
sound/audiostream.cpp | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 57d2e097bf..ce4022bab6 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -211,14 +211,14 @@ protected:
int _audioBlockCount; ///< Number of blocks in _audioBlock
int _currentBlock; ///< Current audio block number
- int _beginLoop; ///< Loop parameter, currently not implemented
- int _endLoop; ///< Loop parameter, currently not implemented
-
+ int _beginLoop; ///< Loop start parameter
+ int _endLoop; ///< Loop end parameter, currently not implemented
+ bool _loop; ///< Determines if the stream should be looped when it finishes
public:
- LinearDiskStream(int rate, uint beginLoop, uint endLoop, bool disposeStream, Common::SeekableReadStream *stream, LinearDiskStreamAudioBlock *block, uint numBlocks)
+ LinearDiskStream(int rate, uint beginLoop, uint endLoop, bool disposeStream, Common::SeekableReadStream *stream, LinearDiskStreamAudioBlock *block, uint numBlocks, bool loop)
: _rate(rate), _stream(stream), _beginLoop(beginLoop), _endLoop(endLoop), _disposeAfterUse(disposeStream),
- _audioBlockCount(numBlocks) {
+ _audioBlockCount(numBlocks), _loop(loop) {
// Allocate streaming buffer
if (is16Bit) {
@@ -296,7 +296,6 @@ int LinearDiskStream::readBuffer(int16 *buffe
_diskLeft = _audioBlock[_currentBlock].len;
}
-
// Now read more data from disk if there is more to be read
if ((_bufferLeft == 0) && (_diskLeft > 0)) {
int32 readAmount = MIN(_diskLeft, BUFFER_SIZE);
@@ -315,6 +314,14 @@ int LinearDiskStream::readBuffer(int16 *buffe
// original position.
restoreFilePosition = true;
}
+
+ // Looping
+ if (_diskLeft == 0 && _loop) {
+ // Reset the stream
+ _currentBlock = 0;
+ _filePos = _audioBlock[_currentBlock].pos + _beginLoop;
+ _diskLeft = _audioBlock[_currentBlock].len;
+ }
}
// In case calling code relies on the position of this stream staying
@@ -399,11 +406,11 @@ AudioStream *makeLinearInputStream(const byte *ptr, uint32 len, int rate, byte f
#define MAKE_LINEAR_DISK(STEREO, UNSIGNED) \
if (is16Bit) { \
if (isLE) \
- return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks); \
+ return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks, loop); \
else \
- return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks); \
+ return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks, loop); \
} else \
- return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks)
+ return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks, loop)
AudioStream *makeLinearDiskStream(Common::SeekableReadStream& stream, LinearDiskStreamAudioBlock* block, int numBlocks, int rate, byte flags, bool takeOwnership, uint loopStart, uint loopEnd) {
@@ -411,7 +418,7 @@ AudioStream *makeLinearDiskStream(Common::SeekableReadStream& stream, LinearDisk
const bool is16Bit = (flags & Audio::Mixer::FLAG_16BITS) != 0;
const bool isUnsigned = (flags & Audio::Mixer::FLAG_UNSIGNED) != 0;
const bool isLE = (flags & Audio::Mixer::FLAG_LITTLE_ENDIAN) != 0;
-
+ const bool loop = (flags & Audio::Mixer::FLAG_LOOP) != 0;
if (isStereo) {
if (isUnsigned) {
--
cgit v1.2.3
From 77689a05a2e13c5bfaeb286db195cf36b2ce2333 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 17 Aug 2009 13:25:44 +0000
Subject: - Removed the custom DigitalMusicInputStream used in SAGA for the
digital music in ITE CD and replaced it with the common LinearDiskStream
class - Removed leftover code which plays standalone tracks (it's not used
anywhere)
svn-id: r43480
---
engines/saga/music.cpp | 243 ++++++++-----------------------------------------
1 file changed, 38 insertions(+), 205 deletions(-)
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 27566de2c3..9325b1adec 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -41,190 +41,6 @@ namespace Saga {
#define BUFFER_SIZE 4096
#define MUSIC_SUNSPOT 26
-class DigitalMusicInputStream : public Audio::AudioStream {
-private:
- Audio::AudioStream *_compressedStream;
- ResourceContext *_context;
- ResourceData * resourceData;
- GameSoundTypes soundType;
- Common::File *_file;
- uint32 _filePos;
- uint32 _startPos;
- uint32 _endPos;
- bool _finished;
- bool _looping;
- int16 _buf[BUFFER_SIZE];
- const int16 *_bufferEnd;
- const int16 *_pos;
- MemoryReadStream *_memoryStream;
- SagaEngine *_vm;
-
- void refill();
- bool eosIntern() const {
- return _pos >= _bufferEnd;
- }
-
-public:
- DigitalMusicInputStream(SagaEngine *vm, ResourceContext *context, uint32 resourceId, bool looping, uint32 loopStart);
- ~DigitalMusicInputStream();
-
- void createCompressedStream();
-
- int readBuffer(int16 *buffer, const int numSamples);
-
- bool endOfData() const { return eosIntern(); }
- bool isStereo() const {
- // The digital music in the ITE Mac demo version is not stereo
- return _vm->getFeatures() & GF_MONO_MUSIC ? false : true;
- }
- int getRate() const { return 11025; }
-};
-
-DigitalMusicInputStream::DigitalMusicInputStream(SagaEngine *vm, ResourceContext *context, uint32 resourceId, bool looping, uint32 loopStart)
- : _vm(vm), _context(context), _finished(false), _looping(looping), _bufferEnd(_buf + BUFFER_SIZE) {
-
- byte compressedHeader[10];
-
- resourceData = context->getResourceData(resourceId);
- _file = context->getFile(resourceData);
-
- _compressedStream = NULL;
-
- if (context->isCompressed) {
- // Read compressed header to determine compression type
- _file->seek((long)resourceData->offset, SEEK_SET);
- _file->read(compressedHeader, 9);
-
- if (compressedHeader[0] == char(0)) {
- soundType = kSoundMP3;
- } else if (compressedHeader[0] == char(1)) {
- soundType = kSoundOGG;
- } else if (compressedHeader[0] == char(2)) {
- soundType = kSoundFLAC;
- }
-
- createCompressedStream();
- }
-
- // Determine the end position
- _filePos = resourceData->offset;
- _endPos = _filePos + resourceData->size;
-
- if (_compressedStream != NULL) {
- _filePos += 9; // skip compressed header
- _endPos -= 9; // decrease size by the size of the compressed header
- }
-
- _startPos = _filePos + loopStart;
- if (_startPos >= _endPos)
- _startPos = _filePos;
-
- // Read in initial data
- refill();
-}
-
-DigitalMusicInputStream::~DigitalMusicInputStream() {
- delete _compressedStream;
-}
-
-void DigitalMusicInputStream::createCompressedStream() {
-#if defined(USE_MAD) || defined(USE_VORBIS) || defined(USE_FLAC)
- uint numLoops = _looping ? 0 : 1;
-#endif
- _memoryStream = _file->readStream(resourceData->size - 9);
-
- switch (soundType) {
-#ifdef USE_MAD
- case kSoundMP3:
- debug(1, "Playing MP3 compressed digital music");
- _compressedStream = Audio::makeMP3Stream(_memoryStream, true, 0, 0, numLoops);
- break;
-#endif
-#ifdef USE_VORBIS
- case kSoundOGG:
- debug(1, "Playing OGG compressed digital music");
- _compressedStream = Audio::makeVorbisStream(_memoryStream, true, 0, 0, numLoops);
- break;
-#endif
-#ifdef USE_FLAC
- case kSoundFLAC:
- debug(1, "Playing FLAC compressed digital music");
- _compressedStream = Audio::makeFlacStream(_memoryStream, true, 0, 0, numLoops);
- break;
-#endif
- default:
- // Unknown compression
- error("Trying to play compressed digital music, but the compression is not known");
- break;
- }
-}
-
-int DigitalMusicInputStream::readBuffer(int16 *buffer, const int numSamples) {
- if (_compressedStream != NULL)
- return _compressedStream->readBuffer(buffer, numSamples);
-
- int samples = 0;
- int len = 0;
-
- while (samples < numSamples && !eosIntern()) {
- len = MIN(numSamples - samples, (int) (_bufferEnd - _pos));
- memcpy(buffer, _pos, len * 2);
- buffer += len;
- _pos += len;
- samples += len;
- if (_pos >= _bufferEnd)
- refill();
- }
- return samples;
-}
-
-void DigitalMusicInputStream::refill() {
- if (_finished)
- return;
-
- uint32 lengthLeft;
- byte *ptr = (byte *) _buf;
-
- _file->seek(_filePos, SEEK_SET);
-
- if (_looping)
- lengthLeft = 2 * BUFFER_SIZE;
- else
- lengthLeft = MIN((uint32) (2 * BUFFER_SIZE), _endPos - _filePos);
-
- while (lengthLeft > 0) {
- uint32 len = _file->read(ptr, MIN(lengthLeft, _endPos - _file->pos()));
-
- if (len & 1)
- len--;
-
-#ifdef SCUMM_BIG_ENDIAN
- if (!_context->isBigEndian) {
-#else
- if (_context->isBigEndian) {
-#endif
- uint16 *ptr16 = (uint16 *)ptr;
- for (uint32 i = 0; i < (len / 2); i++)
- ptr16[i] = SWAP_BYTES_16(ptr16[i]);
- }
-
- lengthLeft -= len;
- ptr += len;
-
- if (lengthLeft > 0)
- _file->seek(_startPos);
- }
-
- _filePos = _file->pos();
- _pos = _buf;
- _bufferEnd = (int16 *)ptr;
-
- if (!_looping && _filePos >= _endPos) {
- _finished = true;
- }
-}
-
-
MusicPlayer::MusicPlayer(MidiDriver *driver) : _parser(0), _driver(driver), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false) {
memset(_channel, 0, sizeof(_channel));
_masterVolume = 0;
@@ -455,34 +271,51 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
realTrackNumber = resourceId + 1;
}
- // Try to open standalone digital track
- char trackName[2][16];
- sprintf(trackName[0], "track%d", realTrackNumber);
- sprintf(trackName[1], "track%02d", realTrackNumber);
- Audio::AudioStream *stream = 0;
- for (int i = 0; i < 2; ++i) {
- // We multiply by 40 / 3 = 1000 / 75 to convert frames to milliseconds
- // FIXME: Do we really want a duration of 10000 frames = 133 seconds, or is that just a random value?
- stream = Audio::AudioStream::openStreamFile(trackName[i], 0, 10000 * 40 / 3, (flags == MUSIC_LOOP) ? 0 : 1);
- if (stream) {
- _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, stream);
- _digitalMusic = true;
- return;
- }
- }
-
if (_vm->getGameId() == GID_ITE) {
if (resourceId >= 9 && resourceId <= 34) {
if (_digitalMusicContext != NULL) {
- //TODO: check resource size
loopStart = 0;
// fix ITE sunstatm/sunspot score
- if ((_vm->getGameId() == GID_ITE) && (resourceId == MUSIC_SUNSPOT)) {
+ if (resourceId == MUSIC_SUNSPOT)
loopStart = 4 * 18727;
- }
- // digital music
- audioStream = new DigitalMusicInputStream(_vm, _digitalMusicContext, resourceId - 9, flags == MUSIC_LOOP, loopStart);
+ // Digital music
+ ResourceData *resData = _digitalMusicContext->getResourceData(resourceId - 9);
+ Common::File *musicFile = _digitalMusicContext->getFile(resData);
+ int offs = (_digitalMusicContext->isCompressed) ? 9 : 0;
+
+ Common::SeekableSubReadStream *musicStream = new Common::SeekableSubReadStream(musicFile,
+ (uint32)resData->offset + offs, (uint32)resData->offset + resData->size - offs);
+
+ if (!_digitalMusicContext->isCompressed) {
+ byte musicFlags = Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_STEREO |
+ Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN;
+ if (flags == MUSIC_LOOP)
+ musicFlags |= Audio::Mixer::FLAG_LOOP;
+
+ Audio::LinearDiskStreamAudioBlock audioBlocks[1];
+ audioBlocks[0].pos = 0;
+ audioBlocks[0].len = resData->size / 2; // 16-bit sound
+ audioStream = Audio::makeLinearDiskStream(*musicStream, audioBlocks, 1, 11025, musicFlags, false, loopStart, 0);
+ } else {
+ // Read compressed header to determine compression type
+ musicFile->seek((uint32)resData->offset, SEEK_SET);
+ byte identifier = musicFile->readByte();
+
+ if (identifier == 0) { // MP3
+#ifdef USE_MAD
+ audioStream = Audio::makeMP3Stream(musicStream, false, 0, 0, (flags == MUSIC_LOOP ? 0 : 1));
+#endif
+ } else if (identifier == 1) { // OGG
+#ifdef USE_VORBIS
+ audioStream = Audio::makeVorbisStream(musicStream, false, 0, 0, (flags == MUSIC_LOOP ? 0 : 1));
+#endif
+ } else if (identifier == 2) { // FLAC
+#ifdef USE_FLAC
+ audioStream = Audio::makeFlacStream(musicStream, false, 0, 0, (flags == MUSIC_LOOP ? 0 : 1));
+#endif
+ }
+ }
}
}
}
--
cgit v1.2.3
From 516dd5c9a4157ab63b20c6e04b698a63dcf8cd65 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 17 Aug 2009 13:49:56 +0000
Subject: Slight cleanup to makeLinearDiskStream interface.
svn-id: r43481
---
engines/saga/music.cpp | 2 +-
sound/audiostream.cpp | 8 ++++----
sound/audiostream.h | 2 +-
sound/voc.cpp | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 9325b1adec..1e2a404a62 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -296,7 +296,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
Audio::LinearDiskStreamAudioBlock audioBlocks[1];
audioBlocks[0].pos = 0;
audioBlocks[0].len = resData->size / 2; // 16-bit sound
- audioStream = Audio::makeLinearDiskStream(*musicStream, audioBlocks, 1, 11025, musicFlags, false, loopStart, 0);
+ audioStream = Audio::makeLinearDiskStream(musicStream, audioBlocks, 1, 11025, musicFlags, false, loopStart, 0);
} else {
// Read compressed header to determine compression type
musicFile->seek((uint32)resData->offset, SEEK_SET);
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index ce4022bab6..783a5733b3 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -406,14 +406,14 @@ AudioStream *makeLinearInputStream(const byte *ptr, uint32 len, int rate, byte f
#define MAKE_LINEAR_DISK(STEREO, UNSIGNED) \
if (is16Bit) { \
if (isLE) \
- return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks, loop); \
+ return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, stream, block, numBlocks, loop); \
else \
- return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks, loop); \
+ return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, stream, block, numBlocks, loop); \
} else \
- return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, &stream, block, numBlocks, loop)
+ return new LinearDiskStream(rate, loopStart, loopEnd, takeOwnership, stream, block, numBlocks, loop)
-AudioStream *makeLinearDiskStream(Common::SeekableReadStream& stream, LinearDiskStreamAudioBlock* block, int numBlocks, int rate, byte flags, bool takeOwnership, uint loopStart, uint loopEnd) {
+AudioStream *makeLinearDiskStream(Common::SeekableReadStream *stream, LinearDiskStreamAudioBlock *block, int numBlocks, int rate, byte flags, bool takeOwnership, uint loopStart, uint loopEnd) {
const bool isStereo = (flags & Audio::Mixer::FLAG_STEREO) != 0;
const bool is16Bit = (flags & Audio::Mixer::FLAG_16BITS) != 0;
const bool isUnsigned = (flags & Audio::Mixer::FLAG_UNSIGNED) != 0;
diff --git a/sound/audiostream.h b/sound/audiostream.h
index 99e140608d..09b97374d5 100644
--- a/sound/audiostream.h
+++ b/sound/audiostream.h
@@ -133,7 +133,7 @@ struct LinearDiskStreamAudioBlock {
* start position and length of each block of uncompressed audio in the stream.
*/
-AudioStream *makeLinearDiskStream(Common::SeekableReadStream& stream, LinearDiskStreamAudioBlock* block, int
+AudioStream *makeLinearDiskStream(Common::SeekableReadStream *stream, LinearDiskStreamAudioBlock *block, int
numBlocks, int rate, byte flags, bool disposeStream, uint loopStart, uint loopEnd);
/**
diff --git a/sound/voc.cpp b/sound/voc.cpp
index a332477f3c..a5bab0af29 100644
--- a/sound/voc.cpp
+++ b/sound/voc.cpp
@@ -292,7 +292,7 @@ AudioStream *makeVOCDiskStream(Common::SeekableReadStream &stream, byte flags, b
int numBlocks = parseVOCFormat(stream, block, rate, loops, begin_loop, end_loop);
- AudioStream* audioStream = makeLinearDiskStream(stream, block, numBlocks, rate, flags, takeOwnership, begin_loop, end_loop);
+ AudioStream *audioStream = makeLinearDiskStream(&stream, block, numBlocks, rate, flags, takeOwnership, begin_loop, end_loop);
delete[] block;
--
cgit v1.2.3
From 260a2019b6c57646ef32274c2fb197658f542803 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Mon, 17 Aug 2009 15:49:22 +0000
Subject: SCI: Add autodetection for DoSound. Cleanup.
svn-id: r43482
---
engines/sci/engine/kernel.cpp | 87 ++++++++++++-----------------------------
engines/sci/engine/kernel.h | 14 +------
engines/sci/engine/ksound.cpp | 23 ++++++-----
engines/sci/engine/savegame.cpp | 3 +-
engines/sci/engine/state.cpp | 75 +++++++++++++++++++++++++++++++++++
engines/sci/engine/state.h | 15 +++++++
engines/sci/resource.cpp | 2 +-
engines/sci/resource.h | 3 +-
engines/sci/sci.cpp | 3 +-
9 files changed, 136 insertions(+), 89 deletions(-)
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 6d027d5788..e5a4377d2d 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -370,8 +370,8 @@ static const char *argtype_description[] = {
Kernel::Kernel(ResourceManager *resmgr) : _resmgr(resmgr) {
memset(&_selectorMap, 0, sizeof(_selectorMap)); // FIXME: Remove this once/if we C++ify selector_map_t
- detectSciFeatures(); // must be called before loadSelectorNames()
loadSelectorNames();
+ detectSciFeatures();
mapSelectors(); // Map a few special selectors for later use
loadOpcodes();
loadKernelNames();
@@ -382,61 +382,30 @@ Kernel::~Kernel() {
}
void Kernel::detectSciFeatures() {
- // FIXME Much of this is unreliable
+ SciVersion version = _resmgr->sciVersion();
- Resource *r = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SNAMES), 0);
-
- Common::StringList staticSelectorTable;
-
- if (!r) { // No such resource?
- staticSelectorTable = checkStaticSelectorNames();
- if (staticSelectorTable.empty())
- error("Kernel: Could not retrieve selector names");
- }
-
- int count = staticSelectorTable.empty() ? READ_LE_UINT16(r->data) + 1 : staticSelectorTable.size(); // Counter is slightly off
features = 0;
// Initialize features based on SCI version
- switch (_resmgr->sciVersion()) {
- case SCI_VERSION_0_EARLY:
- features |= kFeatureOldScriptHeader;
- /* Fallthrough */
- case SCI_VERSION_0_LATE:
- features |= kFeatureOldGfxFunctions;
- break;
- default:
- break;
- }
- for (int i = 0; i < count; i++) {
- Common::String tmp;
-
- if (staticSelectorTable.empty()) {
- int offset = READ_LE_UINT16(r->data + 2 + i * 2);
- int len = READ_LE_UINT16(r->data + offset);
-
- tmp = Common::String((const char *)r->data + offset + 2, len);
- } else {
- tmp = staticSelectorTable[i];
- }
-
- if (tmp == "motionCue")
- features &= ~kFeatureOldGfxFunctions;
+ // Script header and graphics functions
+ if (version == SCI_VERSION_0_EARLY) {
+ features |= kFeatureOldScriptHeader | kFeatureOldGfxFunctions;
+ } else if (version == SCI_VERSION_0_LATE) {
+ if (findSelector("motionCue") == -1)
+ features |= kFeatureOldGfxFunctions;
+ }
- if (tmp == "egoMoveSpeed" && _resmgr->sciVersion() < SCI_VERSION_1_1)
+ // Lofs absolute/relative
+ if (version >= SCI_VERSION_1_MIDDLE && version < SCI_VERSION_1_1) {
+ // Assume all games use absolute lofs
+ features |= kFeatureLofsAbsolute;
+ } else if (version == SCI_VERSION_1_EARLY) {
+ // Use heuristic
+ if (findSelector("egoMoveSpeed") != -1)
features |= kFeatureLofsAbsolute;
-
- if (tmp == "setVol")
- features |= kFeatureSci1Sound;
-
- if (tmp == "nodePtr")
- features |= kFeatureSci01Sound;
}
- if (features & kFeatureSci1Sound)
- features &= ~kFeatureSci01Sound;
-
printf("Kernel auto-detected features:\n");
printf("Graphics functions: ");
@@ -445,19 +414,13 @@ void Kernel::detectSciFeatures() {
else
printf("new\n");
- printf("lofs parameters: ");
- if (features & kFeatureLofsAbsolute)
- printf("absolute\n");
- else
- printf("relative\n");
-
- printf("Sound functions: ");
- if (features & kFeatureSci1Sound)
- printf("SCI1\n");
- else if (features & kFeatureSci01Sound)
- printf("SCI01\n");
- else
- printf("SCI0\n");
+ if (version < SCI_VERSION_1_1) {
+ printf("lofs parameters: ");
+ if (features & kFeatureLofsAbsolute)
+ printf("absolute\n");
+ else
+ printf("relative\n");
+ }
}
void Kernel::loadSelectorNames() {
@@ -473,7 +436,7 @@ void Kernel::loadSelectorNames() {
for (uint32 i = 0; i < staticSelectorTable.size(); i++) {
_selectorNames.push_back(staticSelectorTable[i]);
- if (features & kFeatureOldScriptHeader)
+ if (_resmgr->sciVersion() == SCI_VERSION_0_EARLY)
_selectorNames.push_back(staticSelectorTable[i]);
}
@@ -492,7 +455,7 @@ void Kernel::loadSelectorNames() {
// Early SCI versions used the LSB in the selector ID as a read/write
// toggle. To compensate for that, we add every selector name twice.
- if (features & kFeatureOldScriptHeader)
+ if (_resmgr->sciVersion() == SCI_VERSION_0_EARLY)
_selectorNames.push_back(tmp);
}
}
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index bb5563a876..8be51549f6 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -60,9 +60,7 @@ struct KernelFuncWithSignature {
enum AutoDetectedFeatures {
kFeatureOldScriptHeader = 1 << 0,
kFeatureOldGfxFunctions = 1 << 1,
- kFeatureLofsAbsolute = 1 << 2,
- kFeatureSci01Sound = 1 << 3,
- kFeatureSci1Sound = 1 << 4
+ kFeatureLofsAbsolute = 1 << 2
};
class Kernel {
@@ -119,16 +117,6 @@ public:
*/
bool hasLofsAbsolute() const { return (features & kFeatureLofsAbsolute); }
- /**
- * Determines if the game is using SCI01 sound functions
- */
- bool usesSci01SoundFunctions() const { return (features & kFeatureSci01Sound); }
-
- /**
- * Determines if the game is using SCI1 sound functions
- */
- bool usesSci1SoundFunctions() const { return (features & kFeatureSci1Sound); }
-
// Script dissection/dumping functions
void dissectScript(int scriptNumber, Vocabulary *vocab);
void dumpScriptObject(char *data, int seeker, int objsize);
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 38baeafad8..44b2404e41 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -204,7 +204,7 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
}
-reg_t kDoSound_SCI0(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kDoSoundSci0(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t obj = (argc > 1) ? argv[1] : NULL_REG;
uint16 command = argv[0].toUint16();
SongHandle handle = FROBNICATE_HANDLE(obj);
@@ -383,7 +383,7 @@ reg_t kDoSound_SCI0(EngineState *s, int funct_nr, int argc, reg_t *argv) {
}
-reg_t kDoSound_SCI01(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kDoSoundSci1Early(EngineState *s, int funct_nr, int argc, reg_t *argv) {
uint16 command = argv[0].toUint16();
reg_t obj = (argc > 1) ? argv[1] : NULL_REG;
SongHandle handle = FROBNICATE_HANDLE(obj);
@@ -673,7 +673,7 @@ reg_t kDoSound_SCI01(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
-reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kDoSoundSci1Late(EngineState *s, int funct_nr, int argc, reg_t *argv) {
uint16 command = argv[0].toUint16();
reg_t obj = (argc > 1) ? argv[1] : NULL_REG;
SongHandle handle = FROBNICATE_HANDLE(obj);
@@ -988,12 +988,17 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
* Used for synthesized music playback
*/
reg_t kDoSound(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- if (((SciEngine*)g_engine)->getKernel()->usesSci1SoundFunctions())
- return kDoSound_SCI1(s, funct_nr, argc, argv);
- else if (((SciEngine*)g_engine)->getKernel()->usesSci01SoundFunctions())
- return kDoSound_SCI01(s, funct_nr, argc, argv);
- else
- return kDoSound_SCI0(s, funct_nr, argc, argv);
+ switch(s->detectDoSoundType()) {
+ case EngineState::kDoSoundTypeSci0:
+ return kDoSoundSci0(s, funct_nr, argc, argv);
+ case EngineState::kDoSoundTypeSci1Early:
+ return kDoSoundSci1Early(s, funct_nr, argc, argv);
+ case EngineState::kDoSoundTypeSci1Late:
+ return kDoSoundSci1Late(s, funct_nr, argc, argv);
+ default:
+ warning("Unknown DoSound type");
+ return NULL_REG;
+ }
}
/**
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 1768695244..b53e9d522c 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -701,8 +701,7 @@ static void reconstruct_sounds(EngineState *s) {
Song *seeker;
SongIteratorType it_type;
- if (((SciEngine *)g_engine)->getKernel()->usesSci01SoundFunctions()
- || ((SciEngine *)g_engine)->getKernel()->usesSci1SoundFunctions())
+ if (s->_version > SCI_VERSION_01)
it_type = SCI_SONG_ITERATOR_TYPE_SCI1;
else
it_type = SCI_SONG_ITERATOR_TYPE_SCI0;
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index fd45ef5834..c45868ca56 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -24,6 +24,8 @@
*/
#include "sci/engine/state.h"
+#include "sci/engine/vm.h"
+#include "sci/console.h" // For parse_reg_t
namespace Sci {
@@ -116,6 +118,8 @@ EngineState::EngineState(ResourceManager *res, SciVersion version, uint32 flags)
successor = 0;
speedThrottler = new SpeedThrottler(version);
+
+ _doSoundType = kDoSoundTypeUnknown;
}
EngineState::~EngineState() {
@@ -242,4 +246,75 @@ Common::String EngineState::strSplit(const char *str, const char *sep) {
return retval;
}
+EngineState::DoSoundType EngineState::detectDoSoundType() {
+ if (_doSoundType == kDoSoundTypeUnknown) {
+ reg_t soundClass;
+ const uint checkBytes = 6; // Number of bytes to check
+
+ if (!parse_reg_t(this, "?Sound", &soundClass)) {
+ reg_t fptr;
+
+ Object *obj = obj_get(this, soundClass);
+ SelectorType sel = lookup_selector(this, soundClass, ((SciEngine*)g_engine)->getKernel()->_selectorMap.play, NULL, &fptr);
+
+ if (obj && (sel == kSelectorMethod)) {
+ Script *script = seg_manager->getScript(fptr.segment);
+
+ if (fptr.offset > checkBytes) {
+ // Go to the last portion of Sound::init, should be right before the play function
+ fptr.offset -= checkBytes;
+ byte *buf = script->buf + fptr.offset;
+
+ // Check the call to DoSound's INIT_HANDLE function.
+ // It's either subfunction 0, 5 or 6, depending on the version of DoSound.
+ uint sum = 0;
+ for (uint i = 0; i < checkBytes; i++)
+ sum += buf[i];
+
+ switch(sum) {
+ case 0x1B2: // SCI0
+ case 0x1AE: // SCI01
+ _doSoundType = kDoSoundTypeSci0;
+ break;
+ case 0x13D:
+ _doSoundType = kDoSoundTypeSci1Early;
+ break;
+ case 0x13E:
+ _doSoundType = kDoSoundTypeSci1Late;
+ }
+ }
+ }
+ }
+
+ if (_doSoundType == kDoSoundTypeUnknown) {
+ warning("DoSound detection failed, taking an educated guess");
+
+ if (_version >= SCI_VERSION_1_MIDDLE)
+ _doSoundType = kDoSoundTypeSci1Late;
+ else if (_version > SCI_VERSION_01)
+ _doSoundType = kDoSoundTypeSci1Early;
+ else
+ _doSoundType = kDoSoundTypeSci0;
+ }
+
+ debugCN(1, kDebugLevelSound, "Detected DoSound type: ");
+
+ switch(_doSoundType) {
+ case kDoSoundTypeSci0:
+ debugC(1, kDebugLevelSound, "SCI0");
+ break;
+ case kDoSoundTypeSci1Early:
+ debugC(1, kDebugLevelSound, "SCI1 Early");
+ break;
+ case kDoSoundTypeSci1Late:
+ debugC(1, kDebugLevelSound, "SCI1 Late");
+ break;
+ default:
+ break;
+ }
+ }
+
+ return _doSoundType;
+}
+
} // End of namespace Sci
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index c8e9139f27..a3983f6ae4 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -163,6 +163,14 @@ struct EngineState : public Common::Serializable {
public:
EngineState(ResourceManager *res, SciVersion version, uint32 flags);
virtual ~EngineState();
+
+ enum DoSoundType {
+ kDoSoundTypeUnknown,
+ kDoSoundTypeSci0,
+ kDoSoundTypeSci1Early,
+ kDoSoundTypeSci1Late
+ };
+
virtual void saveLoadWithSerializer(Common::Serializer &ser);
kLanguage getLanguage();
@@ -272,6 +280,12 @@ public:
*/
Common::String strSplit(const char *str, const char *sep = "\r----------\r");
+ /**
+ * Autodetects the DoSound type
+ * @return DoSound type
+ */
+ DoSoundType detectDoSoundType();
+
/* Debugger data: */
Breakpoint *bp_list; /**< List of breakpoints */
int have_bp; /**< Bit mask specifying which types of breakpoints are used in bp_list */
@@ -301,6 +315,7 @@ public:
EngineState *successor; /**< Successor of this state: Used for restoring */
private:
+ DoSoundType _doSoundType;
kLanguage charToLanguage(const char c) const;
Common::String getLanguageString(const char *str, kLanguage lang) const;
};
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index ef31fcdd7d..7b201d0506 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1480,7 +1480,7 @@ SciVersion ResourceManager::detectSciVersion() {
// If this turns out to be unreliable, we could do some pic resource checks instead.
return SCI_VERSION_1_EARLY;
case kResVersionSci1Middle:
- return SCI_VERSION_1_LATE;
+ return SCI_VERSION_1_MIDDLE;
case kResVersionSci1Late:
if (_viewType == kViewVga11) {
// SCI1.1 resources, assume SCI1.1
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index d38cff87df..0a5336fd3f 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -52,7 +52,8 @@ enum SciVersion {
SCI_VERSION_01, // KQ1 and multilingual games (S.old.*)
SCI_VERSION_1_EGA, // EGA with parser, QFG2
SCI_VERSION_1_EARLY, // KQ5. (EGA/VGA)
- SCI_VERSION_1_LATE, // ECO1, LSL1, LSL5. (EGA/VGA)
+ SCI_VERSION_1_MIDDLE, // LSL1, JONESCD. (EGA?/VGA)
+ SCI_VERSION_1_LATE, // ECO1, LSL5. (EGA/VGA)
SCI_VERSION_1_1, // KQ6, ECO2
SCI_VERSION_32 // GK
};
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index b799af9e83..64e89a638e 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -44,13 +44,14 @@ namespace Sci {
class GfxDriver;
// FIXME: error-prone
-const char *versionNames[9] = {
+const char *versionNames[10] = {
"Autodetect",
"SCI0 Early",
"SCI0 Late",
"SCI01",
"SCI1 EGA",
"SCI1 Early",
+ "SCI1 Middle",
"SCI1 Late",
"SCI1.1",
"SCI32"
--
cgit v1.2.3
From 4b9bfe2013b3b6da5e34326e3bbdb3795539f94b Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Mon, 17 Aug 2009 16:07:47 +0000
Subject: SCI: Build fix.
svn-id: r43483
---
engines/sci/engine/state.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index c45868ca56..baa51bcb58 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -254,7 +254,7 @@ EngineState::DoSoundType EngineState::detectDoSoundType() {
if (!parse_reg_t(this, "?Sound", &soundClass)) {
reg_t fptr;
- Object *obj = obj_get(this, soundClass);
+ Object *obj = obj_get(seg_manager, _version, soundClass);
SelectorType sel = lookup_selector(this, soundClass, ((SciEngine*)g_engine)->getKernel()->_selectorMap.play, NULL, &fptr);
if (obj && (sel == kSelectorMethod)) {
--
cgit v1.2.3
From 4a4ae3382501da9fbd9dc25f502336d55308ca5f Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 17 Aug 2009 18:25:51 +0000
Subject: Put back the code for playing external digital music, used by the
MIDI enhancement project, which was removed in rev. #43480
svn-id: r43485
---
engines/saga/music.cpp | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 1e2a404a62..8ca946a127 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -271,11 +271,25 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
realTrackNumber = resourceId + 1;
}
+ // Try to open standalone digital track
+ char trackName[2][16];
+ sprintf(trackName[0], "track%d", realTrackNumber);
+ sprintf(trackName[1], "track%02d", realTrackNumber);
+ Audio::AudioStream *stream = 0;
+ for (int i = 0; i < 2; ++i) {
+ stream = Audio::AudioStream::openStreamFile(trackName[i], 0, 0, (flags == MUSIC_LOOP) ? 0 : 1);
+ if (stream) {
+ _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, stream);
+ _digitalMusic = true;
+ return;
+ }
+ }
+
if (_vm->getGameId() == GID_ITE) {
if (resourceId >= 9 && resourceId <= 34) {
if (_digitalMusicContext != NULL) {
loopStart = 0;
- // fix ITE sunstatm/sunspot score
+ // Fix ITE sunstatm/sunspot score
if (resourceId == MUSIC_SUNSPOT)
loopStart = 4 * 18727;
--
cgit v1.2.3
From 2fc7660e43f581b811fdc979c25e8c87a17d1456 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Mon, 17 Aug 2009 23:11:25 +0000
Subject: SCI: Fix kernel table for multilingual SCI01 games. Cleanup.
svn-id: r43497
---
engines/sci/engine/kernel.cpp | 56 +++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 26 deletions(-)
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index e5a4377d2d..09d342b7fe 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -33,11 +33,7 @@
namespace Sci {
-/** The string used to identify the "unknown" SCI0 function for each game */
-#define SCRIPT_UNKNOWN_FUNCTION_STRING "[Unknown]"
-
// Default kernel name table
-#define SCI0_KNAMES_WELL_DEFINED 0x6e
#define SCI_KNAMES_DEFAULT_ENTRIES_NR 0x89
static const char *sci_default_knames[SCI_KNAMES_DEFAULT_ENTRIES_NR] = {
@@ -782,32 +778,40 @@ reg_t *kernel_dereference_reg_pointer(EngineState *s, reg_t pointer, int entries
}
void Kernel::setDefaultKernelNames() {
- bool isSci0 = (_resmgr->sciVersion() <= SCI_VERSION_0_LATE);
- int offset = 0;
-
- _kernelNames.resize(SCI_KNAMES_DEFAULT_ENTRIES_NR + (isSci0 ? 4 : 0));
- for (int i = 0; i < SCI_KNAMES_DEFAULT_ENTRIES_NR; i++) {
- // In SCI0, Platform was DoAvoider
- if (!strcmp(sci_default_knames[i], "Platform") && isSci0) {
- _kernelNames[i + offset] = "DoAvoider";
- continue;
- }
+ _kernelNames = Common::StringList(sci_default_knames, SCI_KNAMES_DEFAULT_ENTRIES_NR);
+
+ switch (_resmgr->sciVersion()) {
+ case SCI_VERSION_0_EARLY:
+ case SCI_VERSION_0_LATE:
+ // Insert SCI0 file functions after SetCursor (0x28)
+ _kernelNames.insert_at(0x29, "FOpen");
+ _kernelNames.insert_at(0x2A, "FPuts");
+ _kernelNames.insert_at(0x2B, "FGets");
+ _kernelNames.insert_at(0x2C, "FClose");
+
+ // Function 0x55 is DoAvoider
+ _kernelNames[0x55] = "DoAvoider";
+
+ // Cut off unused functions
+ _kernelNames.resize(0x72);
+ break;
- _kernelNames[i + offset] = sci_default_knames[i];
+ case SCI_VERSION_01:
+ // Multilingual SCI01 games have StrSplit as function 0x78
+ _kernelNames[0x78] = "StrSplit";
- // SCI0 has 4 extra functions between SetCursor (0x28) and Savegame
- if (!strcmp(sci_default_knames[i], "SetCursor") && isSci0) {
- _kernelNames[i + 1] = "FOpen";
- _kernelNames[i + 2] = "FPuts";
- _kernelNames[i + 3] = "FGets";
- _kernelNames[i + 4] = "FClose";
- offset = 4;
- }
- }
+ // Cut off unused functions
+ _kernelNames.resize(0x79);
+ break;
- if (_resmgr->sciVersion() == SCI_VERSION_1_1) {
- // HACK: KQ6CD calls unimplemented function 0x26
+ case SCI_VERSION_1_1:
+ // KQ6CD calls unimplemented function 0x26
_kernelNames[0x26] = "Dummy";
+ break;
+
+ default:
+ // Use default table for the other versions
+ break;
}
}
--
cgit v1.2.3
From eb11cca7888c01256550d4aac429cc73eb0330e2 Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Mon, 17 Aug 2009 23:54:40 +0000
Subject: PSP: increase optimization level and change clock rate to 333mhz
svn-id: r43498
---
backends/platform/psp/Makefile | 2 +-
backends/platform/psp/psp_main.cpp | 3 +++
configure | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index ad22a853e1..0190cdf8c9 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -62,7 +62,7 @@ endif
INCDIR := $(srcdir) . $(srcdir)/engines/ . $(PSPSDK)/include
LIBDIR := $(LIBDIR) . $(PSPSDK)/lib
-CXXFLAGS = -O2 -Wall -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB -Wno-multichar `$(PSPBIN)/sdl-config --cflags`
+CXXFLAGS = -O3 -Wall -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB -Wno-multichar `$(PSPBIN)/sdl-config --cflags`
CXXFLAGS:= $(addprefix -I,$(INCDIR)) $(CXXFLAGS)
LDFLAGS := $(addprefix -L,$(LIBDIR)) $(LDFLAGS)
LIBS =
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp
index 37080c7bf9..3ea6c55368 100644
--- a/backends/platform/psp/psp_main.cpp
+++ b/backends/platform/psp/psp_main.cpp
@@ -146,6 +146,9 @@ int main(void) {
SetupCallbacks();
+ //change clock rate to 333mhz
+ scePowerSetClockFrequency(333, 333, 166);
+
static const char *argv[] = { "scummvm", NULL };
static int argc = sizeof(argv)/sizeof(char *)-1;
diff --git a/configure b/configure
index a0973f14ab..ef1cb5f7a2 100755
--- a/configure
+++ b/configure
@@ -1178,7 +1178,7 @@ case $_host_os in
# TODO nds
;;
psp)
- CXXFLAGS="$CXXFLAGS -O2 -G0 -I$PSPDEV/psp/sdk/include -D_PSP_FW_VERSION=150"
+ CXXFLAGS="$CXXFLAGS -O3 -G0 -I$PSPDEV/psp/sdk/include -D_PSP_FW_VERSION=150"
;;
wince)
CXXFLAGS="$CXXFLAGS -O3 -march=armv4 -mtune=xscale -D_WIN32_WCE=300 -D__ARM__ -D_ARM_ -DUNICODE -DFPM_DEFAULT -DNONSTANDARD_PORT"
--
cgit v1.2.3
From c9402c5559dee28ccc99fb7abca5dc83ec46a330 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Tue, 18 Aug 2009 06:43:06 +0000
Subject: Applied agent-q's patch to the SAGA pathfinding code for all
platforms - x and y should not ever be greater than 640 and 480 respectively,
so it looks safe enough to be applied
svn-id: r43500
---
engines/saga/actor.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/engines/saga/actor.h b/engines/saga/actor.h
index d998c65240..57d06e9e3a 100644
--- a/engines/saga/actor.h
+++ b/engines/saga/actor.h
@@ -183,8 +183,8 @@ enum DragonMoveTypes {
struct PathDirectionData {
int8 direction;
- int x;
- int y;
+ int16 x;
+ int16 y;
};
struct ActorFrameRange {
--
cgit v1.2.3
From dfaa5acbee5766e59b35697ea1b03122aa4ea2aa Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Tue, 18 Aug 2009 08:00:24 +0000
Subject: Starting to simplify the Action structure, and rework it to
facilitate making the automatic mapper smarter, at least when there is a
keyboard present. Fixed a minor whitespace issue in a comment.
svn-id: r43502
---
backends/keymapper/action.cpp | 4 ++--
backends/keymapper/action.h | 4 +---
backends/keymapper/keymap.cpp | 2 +-
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp
index 1f4efbf457..4633f20df3 100644
--- a/backends/keymapper/action.cpp
+++ b/backends/keymapper/action.cpp
@@ -32,9 +32,9 @@
namespace Common {
Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
- KeyType prefKey, int pri, int flg)
+ KeyType prefKey, int pri)
: _boss(boss), description(des), type(typ), preferredKey(prefKey),
- priority(pri), flags(flg), _hwKey(0) {
+ priority(pri), _hwKey(0) {
assert(i);
assert(_boss);
diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h
index c49518b605..c78a526414 100644
--- a/backends/keymapper/action.h
+++ b/backends/keymapper/action.h
@@ -54,8 +54,6 @@ struct Action {
ActionType type;
KeyType preferredKey;
int priority;
- int group;
- int flags;
private:
/** Hardware key that is mapped to this Action */
@@ -66,7 +64,7 @@ public:
Action(Keymap *boss, const char *id, String des = "",
ActionType typ = kGenericActionType,
KeyType prefKey = kGenericKeyType,
- int pri = 0, int flg = 0 );
+ int pri = 0);
void addEvent(const Event &evt) {
events.push_back(evt);
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp
index 9d8b6046cd..f082640f2c 100644
--- a/backends/keymapper/keymap.cpp
+++ b/backends/keymapper/keymap.cpp
@@ -240,7 +240,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
// First mapping pass:
// - Match if a key's preferred action type is the same as the action's
- // type, or vice versa.
+ // type, or vice versa.
// - Priority is given to:
// - keys that match action types over key types.
// - keys that have not been used by parent maps.
--
cgit v1.2.3
From 65ac355efa2cb792278e34de5c397ab11c8a46e3 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Tue, 18 Aug 2009 09:12:41 +0000
Subject: Removed the maxMemory parameter of the resource manager and replaced
it with a define
svn-id: r43503
---
engines/sci/detection.cpp | 2 +-
engines/sci/resource.cpp | 6 +++---
engines/sci/resource.h | 16 +++++++---------
engines/sci/sci.cpp | 2 +-
4 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 88bd0d63c3..d46dd2cbd8 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -3090,7 +3090,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
#if 0
// Determine the game id
// TODO
- ResourceManager *resMgr = new ResourceManager(256 * 1024);
+ ResourceManager *resMgr = new ResourceManager();
SciVersion version = resMgr->sciVersion();
SegManager *segManager = new SegManager(resMgr, version);
reg_t game_obj = script_lookup_export(segManager, 0, 0);
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 7b201d0506..2ca198954a 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -396,8 +396,7 @@ void ResourceManager::freeResourceSources() {
_sources.clear();
}
-ResourceManager::ResourceManager(int maxMemory) {
- _maxMemory = maxMemory;
+ResourceManager::ResourceManager() {
_memoryLocked = 0;
_memoryLRU = 0;
_LRU.clear();
@@ -506,7 +505,7 @@ void ResourceManager::printLRU() {
}
void ResourceManager::freeOldResources() {
- while (_maxMemory < _memoryLRU) {
+ while (MAX_MEMORY < _memoryLRU) {
assert(!_LRU.empty());
Resource *goner = *_LRU.reverse_begin();
removeFromLRU(goner);
@@ -614,6 +613,7 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
break;
}
}
+
if (file.isOpen() == false) {
error("Failed to open resource map file");
return kResVersionUnknown;
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 0a5336fd3f..8ab740f463 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -245,15 +245,8 @@ public:
/**
* Creates a new SCI resource manager.
- * @param version The SCI version to look for; use SCI_VERSION_AUTODETECT
- * in the default case.
- * @param maxMemory Maximum number of bytes to allow allocated for resources
- *
- * @note maxMemory will not be interpreted as a hard limit, only as a restriction
- * for resources which are not explicitly locked. However, a warning will be
- * issued whenever this limit is exceeded.
*/
- ResourceManager(int maxMemory);
+ ResourceManager();
~ResourceManager();
/**
@@ -294,8 +287,13 @@ public:
void setAudioLanguage(int language);
protected:
+ // Maximum number of bytes to allow being allocated for resources
+ // Note: maxMemory will not be interpreted as a hard limit, only as a restriction
+ // for resources which are not explicitly locked. However, a warning will be
+ // issued whenever this limit is exceeded.
+ #define MAX_MEMORY 256 * 1024 // 256KB
+
ViewType _viewType; // Used to determine if the game has EGA or VGA graphics
- int _maxMemory; //!< Config option: Maximum total byte number allocated
Common::List _sources;
int _memoryLocked; //!< Amount of resource bytes in locked memory
int _memoryLRU; //!< Amount of resource bytes under LRU control
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 64e89a638e..53e3e7ab9c 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -135,7 +135,7 @@ Common::Error SciEngine::run() {
const uint32 flags = getFlags();
- _resmgr = new ResourceManager(256 * 1024);
+ _resmgr = new ResourceManager();
_version = _resmgr->sciVersion();
if (!_resmgr) {
--
cgit v1.2.3
From ca9bbce9b3e8771f346eca037bd0c39a7e0360de Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Tue, 18 Aug 2009 10:01:18 +0000
Subject: - Added game ID detection to the fallback detector. We still need to
map some of Sierra's internal IDs to our own ones - The class table is now
created in the segment manager constructor
svn-id: r43504
---
engines/sci/detection.cpp | 23 ++++--
engines/sci/engine/game.cpp | 151 +------------------------------------
engines/sci/engine/savegame.cpp | 2 +-
engines/sci/engine/seg_manager.cpp | 150 +++++++++++++++++++++++++++++++++++-
engines/sci/engine/seg_manager.h | 5 +-
engines/sci/engine/vm.cpp | 10 +--
engines/sci/engine/vm.h | 2 +-
7 files changed, 177 insertions(+), 166 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index d46dd2cbd8..c025523ca0 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -27,6 +27,7 @@
#include "base/plugins.h"
#include "sci/sci.h"
+#include "sci/engine/kernel.h"
#include "sci/exereader.h"
#include "sci/engine/seg_manager.h"
@@ -3047,8 +3048,12 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
Common::String filename = file->getName();
filename.toLowercase();
- if (filename.contains("resource.map") || filename.contains("resmap.000"))
+ if (filename.contains("resource.map") || filename.contains("resmap.000")) {
+ // resource.map is located in the same directory as the other resource files,
+ // therefore add the directory here, so that the game files can be opened later on
+ Common::File::addDefaultDirectory(file->getParent().getPath());
foundResMap = true;
+ }
if (filename.contains("resource.000") || filename.contains("resource.001")
|| filename.contains("ressci.000") || filename.contains("ressci.001"))
@@ -3081,24 +3086,30 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
return 0;
// Set some defaults
- s_fallbackDesc.desc.gameid = "sci";
s_fallbackDesc.desc.extra = "";
s_fallbackDesc.desc.language = Common::UNK_LANG;
s_fallbackDesc.desc.platform = exePlatform;
s_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
-#if 0
// Determine the game id
- // TODO
ResourceManager *resMgr = new ResourceManager();
SciVersion version = resMgr->sciVersion();
- SegManager *segManager = new SegManager(resMgr, version);
+ Kernel *kernel = new Kernel(resMgr);
+ SegManager *segManager = new SegManager(resMgr, version, kernel->hasOldScriptHeader());
+ if (!script_instantiate(resMgr, segManager, version, kernel->hasOldScriptHeader(), 0)) {
+ warning("fallbackDetect(): Could not instantiate script 0");
+ return 0;
+ }
reg_t game_obj = script_lookup_export(segManager, 0, 0);
Common::String gameName = obj_get_name(segManager,version, game_obj);
debug(2, " \"%s\" at %04x:%04x", gameName.c_str(), PRINT_REG(game_obj));
+ gameName.toLowercase();
+ // TODO: Sierra's game IDs are not always the same as our own ones, we need to map them
+ // accordingly here
+ s_fallbackDesc.desc.gameid = strdup(gameName.c_str());
+ delete kernel;
delete segManager;
delete resMgr;
-#endif
printf("If this is *NOT* a fan-modified version (in particular, not a fan-made\n");
printf("translation), please, report the data above, including the following\n");
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 6872039c89..c34ac1cf00 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -188,157 +188,10 @@ int game_init_sound(EngineState *s, int sound_flags) {
return 0;
}
-int create_class_table_sci11(EngineState *s) {
- int scriptnr;
- unsigned int seeker_offset;
- char *seeker_ptr;
- int classnr;
-
- Resource *vocab996 = s->resmgr->findResource(ResourceId(kResourceTypeVocab, 996), 1);
-
- if (!vocab996)
- s->seg_manager->_classtable.resize(20);
- else
- s->seg_manager->_classtable.resize(vocab996->size >> 2);
-
- for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
- Resource *heap = s->resmgr->findResource(ResourceId(kResourceTypeHeap, scriptnr), 0);
-
- if (heap) {
- int global_vars = READ_LE_UINT16(heap->data + 2);
-
- seeker_ptr = (char*)heap->data + 4 + global_vars * 2;
- seeker_offset = 4 + global_vars * 2;
-
- while (READ_LE_UINT16((byte*)seeker_ptr) == SCRIPT_OBJECT_MAGIC_NUMBER) {
- if (READ_LE_UINT16((byte*)seeker_ptr + 14) & SCRIPT_INFO_CLASS) {
- classnr = READ_LE_UINT16((byte*)seeker_ptr + 10);
- if (classnr >= (int)s->seg_manager->_classtable.size()) {
- if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
- warning("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
- classnr, scriptnr, scriptnr, seeker_offset);
- return 1;
- }
-
- s->seg_manager->_classtable.resize(classnr + 1); // Adjust maximum number of entries
- }
-
- s->seg_manager->_classtable[classnr].reg.offset = seeker_offset;
- s->seg_manager->_classtable[classnr].reg.segment = 0;
- s->seg_manager->_classtable[classnr].script = scriptnr;
- }
-
- seeker_ptr += READ_LE_UINT16((byte*)seeker_ptr + 2) * 2;
- seeker_offset += READ_LE_UINT16((byte*)seeker_ptr + 2) * 2;
- }
- }
- }
-
- s->resmgr->unlockResource(vocab996);
- vocab996 = NULL;
- return 0;
-}
-
-static int create_class_table_sci0(EngineState *s) {
- int scriptnr;
- unsigned int seeker;
- int classnr;
- int magic_offset; // For strange scripts in older SCI versions
-
- Resource *vocab996 = s->resmgr->findResource(ResourceId(kResourceTypeVocab, 996), 1);
- SciVersion version = s->_version; // for the offset defines
-
- if (!vocab996)
- s->seg_manager->_classtable.resize(20);
- else
- s->seg_manager->_classtable.resize(vocab996->size >> 2);
-
- for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
- int objtype = 0;
- Resource *script = s->resmgr->findResource(ResourceId(kResourceTypeScript, scriptnr), 0);
-
- if (script) {
- if (((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader())
- magic_offset = seeker = 2;
- else
- magic_offset = seeker = 0;
-
- do {
- while (seeker < script->size) {
- unsigned int lastseeker = seeker;
- objtype = (int16)READ_LE_UINT16(script->data + seeker);
- if (objtype == SCI_OBJ_CLASS || objtype == SCI_OBJ_TERMINATOR)
- break;
- seeker += (int16)READ_LE_UINT16(script->data + seeker + 2);
- if (seeker <= lastseeker) {
- s->seg_manager->_classtable.clear();
- error("Script version is invalid");
- }
- }
-
- if (objtype == SCI_OBJ_CLASS) {
- int sugg_script;
-
- seeker -= SCRIPT_OBJECT_MAGIC_OFFSET; // Adjust position; script home is base +8 bytes
-
- classnr = (int16)READ_LE_UINT16(script->data + seeker + 4 + SCRIPT_SPECIES_OFFSET);
- if (classnr >= (int)s->seg_manager->_classtable.size()) {
-
- if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
- warning("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
- classnr, scriptnr, scriptnr, seeker);
- return 1;
- }
-
- s->seg_manager->_classtable.resize(classnr + 1); // Adjust maximum number of entries
- }
-
- // Map the class ID to the script the corresponding class is contained in
- // The script number is found in vocab.996, if it exists
- if (!vocab996 || (uint32)classnr >= vocab996->size >> 2)
- sugg_script = -1;
- else
- sugg_script = (int16)READ_LE_UINT16(vocab996->data + 2 + (classnr << 2));
-
- // First, test whether the script hasn't been claimed, or if it's been claimed by the wrong script
-
- if (sugg_script == -1 || scriptnr == sugg_script /*|| !s->_classtable[classnr].reg.segment*/) {
- // Now set the home script of the class
- s->seg_manager->_classtable[classnr].reg.offset = seeker + 4 - magic_offset;
- s->seg_manager->_classtable[classnr].reg.segment = 0;
- s->seg_manager->_classtable[classnr].script = scriptnr;
- }
-
- seeker += SCRIPT_OBJECT_MAGIC_OFFSET; // Re-adjust position
- seeker += (int16)READ_LE_UINT16(script->data + seeker + 2); // Move to next
- }
-
- } while (objtype != SCI_OBJ_TERMINATOR && seeker <= script->size);
-
- }
- }
- s->resmgr->unlockResource(vocab996);
- vocab996 = NULL;
- return 0;
-}
-
// Architectural stuff: Init/Unintialize engine
int script_init_engine(EngineState *s) {
- int result;
-
s->kernel_opt_flags = 0;
- s->seg_manager = new SegManager(s->resmgr, s->_version);
-
- if (s->_version >= SCI_VERSION_1_1)
- result = create_class_table_sci11(s);
- else
- result = create_class_table_sci0(s);
-
- if (result) {
- debug(2, "Failed to initialize class table");
- return 1;
- }
-
+ s->seg_manager = new SegManager(s->resmgr, s->_version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader());
s->gc_countdown = GC_INTERVAL - 1;
SegmentId script_000_segment = s->seg_manager->getSegment(0, SCRIPT_GET_LOCK);
@@ -441,7 +294,7 @@ int game_init(EngineState *s) {
s->stack_base = stack->entries;
s->stack_top = s->stack_base + VM_STACK_SIZE;
- if (!script_instantiate(s->resmgr, s->seg_manager, s->_version, 0)) {
+ if (!script_instantiate(s->resmgr, s->seg_manager, s->_version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader(), 0)) {
warning("game_init(): Could not instantiate script 0");
return 1;
}
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index b53e9d522c..0ddb5187ac 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -219,7 +219,7 @@ static void sync_SegManagerPtr(Common::Serializer &s, SegManager *&obj) {
if (s.isLoading()) {
// FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch.
delete obj;
- obj = new SegManager(resMgr, version);
+ obj = new SegManager(resMgr, version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader());
}
obj->saveLoadWithSerializer(s);
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index f47a874528..a6f54c5bf7 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -52,7 +52,7 @@ namespace Sci {
#define INVALID_SCRIPT_ID -1
-SegManager::SegManager(ResourceManager *resMgr, SciVersion version) {
+SegManager::SegManager(ResourceManager *resMgr, SciVersion version, bool oldScriptHeader) {
id_seg_map = new IntMapper();
reserved_id = INVALID_SCRIPT_ID;
id_seg_map->checkKey(reserved_id, true); // reserve entry 0 for INVALID_SCRIPT_ID
@@ -68,6 +68,17 @@ SegManager::SegManager(ResourceManager *resMgr, SciVersion version) {
exports_wide = 0;
_version = version;
_resMgr = resMgr;
+ _oldScriptHeader = oldScriptHeader;
+
+ int result = 0;
+
+ if (version >= SCI_VERSION_1_1)
+ result = createSci11ClassTable();
+ else
+ result = createSci0ClassTable();
+
+ if (result)
+ error("SegManager: Failed to initialize class table");
}
// Destroy the object, free the memorys if allocated before
@@ -139,7 +150,7 @@ void SegManager::setScriptSize(Script &scr, int script_nr) {
if (!script || (_version >= SCI_VERSION_1_1 && !heap)) {
error("SegManager::setScriptSize: failed to load %s", !script ? "script" : "heap");
}
- if (((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader()) {
+ if (_oldScriptHeader) {
scr.buf_size = script->size + READ_LE_UINT16(script->data) * 2;
//locals_size = READ_LE_UINT16(script->data) * 2;
} else if (_version < SCI_VERSION_1_1) {
@@ -434,7 +445,7 @@ SegmentId SegManager::getSegment(int script_nr, SCRIPT_GET load) {
SegmentId segment;
if ((load & SCRIPT_GET_LOAD) == SCRIPT_GET_LOAD)
- script_instantiate(_resMgr, this, _version, script_nr);
+ script_instantiate(_resMgr, this, _version, _oldScriptHeader, script_nr);
segment = segGet(script_nr);
@@ -906,5 +917,138 @@ int SegManager::freeDynmem(reg_t addr) {
return 0; // OK
}
+int SegManager::createSci11ClassTable() {
+ int scriptnr;
+ unsigned int seeker_offset;
+ char *seeker_ptr;
+ int classnr;
+
+ Resource *vocab996 = _resMgr->findResource(ResourceId(kResourceTypeVocab, 996), 1);
+
+ if (!vocab996)
+ _classtable.resize(20);
+ else
+ _classtable.resize(vocab996->size >> 2);
+
+ for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
+ Resource *heap = _resMgr->findResource(ResourceId(kResourceTypeHeap, scriptnr), 0);
+
+ if (heap) {
+ int global_vars = READ_LE_UINT16(heap->data + 2);
+
+ seeker_ptr = (char*)heap->data + 4 + global_vars * 2;
+ seeker_offset = 4 + global_vars * 2;
+
+ while (READ_LE_UINT16((byte*)seeker_ptr) == SCRIPT_OBJECT_MAGIC_NUMBER) {
+ if (READ_LE_UINT16((byte*)seeker_ptr + 14) & SCRIPT_INFO_CLASS) {
+ classnr = READ_LE_UINT16((byte*)seeker_ptr + 10);
+ if (classnr >= (int)_classtable.size()) {
+ if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
+ warning("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
+ classnr, scriptnr, scriptnr, seeker_offset);
+ return 1;
+ }
+
+ _classtable.resize(classnr + 1); // Adjust maximum number of entries
+ }
+
+ _classtable[classnr].reg.offset = seeker_offset;
+ _classtable[classnr].reg.segment = 0;
+ _classtable[classnr].script = scriptnr;
+ }
+
+ seeker_ptr += READ_LE_UINT16((byte*)seeker_ptr + 2) * 2;
+ seeker_offset += READ_LE_UINT16((byte*)seeker_ptr + 2) * 2;
+ }
+ }
+ }
+
+ _resMgr->unlockResource(vocab996);
+ vocab996 = NULL;
+ return 0;
+}
+
+int SegManager::createSci0ClassTable() {
+ int scriptnr;
+ unsigned int seeker;
+ int classnr;
+ int magic_offset; // For strange scripts in older SCI versions
+
+ Resource *vocab996 = _resMgr->findResource(ResourceId(kResourceTypeVocab, 996), 1);
+ SciVersion version = _version; // for the offset defines
+
+ if (!vocab996)
+ _classtable.resize(20);
+ else
+ _classtable.resize(vocab996->size >> 2);
+
+ for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
+ int objtype = 0;
+ Resource *script = _resMgr->findResource(ResourceId(kResourceTypeScript, scriptnr), 0);
+
+ if (script) {
+ if (_oldScriptHeader)
+ magic_offset = seeker = 2;
+ else
+ magic_offset = seeker = 0;
+
+ do {
+ while (seeker < script->size) {
+ unsigned int lastseeker = seeker;
+ objtype = (int16)READ_LE_UINT16(script->data + seeker);
+ if (objtype == SCI_OBJ_CLASS || objtype == SCI_OBJ_TERMINATOR)
+ break;
+ seeker += (int16)READ_LE_UINT16(script->data + seeker + 2);
+ if (seeker <= lastseeker) {
+ _classtable.clear();
+ error("Script version is invalid");
+ }
+ }
+
+ if (objtype == SCI_OBJ_CLASS) {
+ int sugg_script;
+
+ seeker -= SCRIPT_OBJECT_MAGIC_OFFSET; // Adjust position; script home is base +8 bytes
+
+ classnr = (int16)READ_LE_UINT16(script->data + seeker + 4 + SCRIPT_SPECIES_OFFSET);
+ if (classnr >= (int)_classtable.size()) {
+
+ if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
+ warning("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
+ classnr, scriptnr, scriptnr, seeker);
+ return 1;
+ }
+
+ _classtable.resize(classnr + 1); // Adjust maximum number of entries
+ }
+
+ // Map the class ID to the script the corresponding class is contained in
+ // The script number is found in vocab.996, if it exists
+ if (!vocab996 || (uint32)classnr >= vocab996->size >> 2)
+ sugg_script = -1;
+ else
+ sugg_script = (int16)READ_LE_UINT16(vocab996->data + 2 + (classnr << 2));
+
+ // First, test whether the script hasn't been claimed, or if it's been claimed by the wrong script
+
+ if (sugg_script == -1 || scriptnr == sugg_script /*|| !s->_classtable[classnr].reg.segment*/) {
+ // Now set the home script of the class
+ _classtable[classnr].reg.offset = seeker + 4 - magic_offset;
+ _classtable[classnr].reg.segment = 0;
+ _classtable[classnr].script = scriptnr;
+ }
+
+ seeker += SCRIPT_OBJECT_MAGIC_OFFSET; // Re-adjust position
+ seeker += (int16)READ_LE_UINT16(script->data + seeker + 2); // Move to next
+ }
+
+ } while (objtype != SCI_OBJ_TERMINATOR && seeker <= script->size);
+
+ }
+ }
+ _resMgr->unlockResource(vocab996);
+ vocab996 = NULL;
+ return 0;
+}
} // End of namespace Sci
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index f73c788b37..fcf2659df3 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -58,7 +58,7 @@ public:
/**
* Initialize the segment manager
*/
- SegManager(ResourceManager *resMgr, SciVersion version);
+ SegManager(ResourceManager *resMgr, SciVersion version, bool oldScriptHeader);
/**
* Deallocate all memory associated with the segment manager
@@ -342,6 +342,7 @@ public:
private:
IntMapper *id_seg_map; ///< id - script id; seg - index of heap
+ bool _oldScriptHeader;
public: // TODO: make private
Common::Array _heap;
int reserved_id;
@@ -360,6 +361,8 @@ private:
LocalVariables *allocLocalsSegment(Script *scr, int count);
MemObject *memObjAllocate(SegmentId segid, int hash_id, MemObjectType type);
int deallocate(SegmentId seg, bool recursive);
+ int createSci0ClassTable();
+ int createSci11ClassTable();
Hunk *alloc_Hunk(reg_t *);
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index fbd3bc3baf..64ee7243fb 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -208,7 +208,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
Script *scr = s->seg_manager->getScriptIfLoaded(seg);
if (!scr) // Script not present yet?
- seg = script_instantiate(s->resmgr, s->seg_manager, s->_version, script);
+ seg = script_instantiate(s->resmgr, s->seg_manager, s->_version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader(), script);
else
scr->unmarkDeleted();
@@ -1573,7 +1573,7 @@ int script_instantiate_common(ResourceManager *resMgr, SegManager *segManager, S
return seg_id;
}
-int script_instantiate_sci0(ResourceManager *resMgr, SegManager *segManager, SciVersion version, int script_nr) {
+int script_instantiate_sci0(ResourceManager *resMgr, SegManager *segManager, SciVersion version, bool oldScriptHeader, int script_nr) {
int objtype;
unsigned int objlength;
reg_t reg;
@@ -1593,7 +1593,7 @@ int script_instantiate_sci0(ResourceManager *resMgr, SegManager *segManager, Sci
Script *scr = segManager->getScript(seg_id);
- if (((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader()) {
+ if (oldScriptHeader) {
//
int locals_nr = READ_LE_UINT16(script->data);
@@ -1761,11 +1761,11 @@ int script_instantiate_sci11(ResourceManager *resMgr, SegManager *segManager, Sc
return seg_id;
}
-int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, int script_nr) {
+int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, bool oldScriptHeader, int script_nr) {
if (version >= SCI_VERSION_1_1)
return script_instantiate_sci11(resMgr, segManager, version, script_nr);
else
- return script_instantiate_sci0(resMgr, segManager, version, script_nr);
+ return script_instantiate_sci0(resMgr, segManager, version, oldScriptHeader, script_nr);
}
void script_uninstantiate_sci0(SegManager *segManager, SciVersion version, int script_nr, SegmentId seg) {
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index c8f94d5446..867f732e2a 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -489,7 +489,7 @@ reg_t script_lookup_export(SegManager *segManager, int script_nr, int export_ind
* @param[in] script_nr The script number to load
* @return The script's segment ID or 0 if out of heap
*/
-int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, int script_nr);
+int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, bool oldScriptHeader, int script_nr);
/**
* Decreases the numer of lockers of a script and unloads it if that number
--
cgit v1.2.3
From 2b945eabf1acc24d289cc8489216fc007899275c Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Tue, 18 Aug 2009 12:25:04 +0000
Subject: Bugfix for Castle Skorl problem reported on the list
svn-id: r43507
---
engines/lure/res.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index 7eb76cad32..e921b93384 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -550,6 +550,7 @@ void Resources::setTalkingCharacter(uint16 id) {
uint16 englishLoadOffsets[] = {0x3afe, 0x41BD, 0x7167, 0x7172, 0x8617, 0x88ac, 0};
Hotspot *Resources::activateHotspot(uint16 hotspotId) {
+ Resources &resources = Resources::getReference();
HotspotData *res = getHotspot(hotspotId);
if (!res) return NULL;
res->roomNumber &= 0x7fff; // clear any suppression bit in room #
@@ -561,7 +562,6 @@ Hotspot *Resources::activateHotspot(uint16 hotspotId) {
// If it's NPC with a schedule, then activate the schedule
if ((res->npcScheduleId != 0) && (res->npcSchedule.isEmpty())) {
- Resources &resources = Resources::getReference();
CharacterScheduleEntry *entry = resources.charSchedules().getEntry(res->npcScheduleId);
res->npcSchedule.addFront(DISPATCH_ACTION, entry, res->roomNumber);
}
@@ -621,9 +621,12 @@ Hotspot *Resources::activateHotspot(uint16 hotspotId) {
// Special post-load handling
if (res->loadOffset == 3) hotspot->setPersistant(true);
if (res->loadOffset == 5) hotspot->handleTalkDialog();
- if (hotspotId == CASTLE_SKORL_ID)
+ if (hotspotId == CASTLE_SKORL_ID) {
// The Castle skorl has a default room #99, so it needs to be adjusted dynamically
- res->npcSchedule.top().setRoomNumber(res->roomNumber);
+ res->npcSchedule.clear();
+ CharacterScheduleEntry *entry = resources.charSchedules().getEntry(res->npcScheduleId);
+ res->npcSchedule.addFront(DISPATCH_ACTION, entry, res->roomNumber);
+ }
// TODO: Figure out why there's a room set in the animation decode for a range of characters,
// particularly since it doesn't seem to match what happens in-game
--
cgit v1.2.3
From 766cdac9f392ceed879a4fe073e93b66e6764092 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Tue, 18 Aug 2009 12:49:34 +0000
Subject: Mapped some Sierra internal IDs to our own ones, and added a note
about a hack currently used in the fallback detector
svn-id: r43509
---
engines/sci/detection.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 77 insertions(+), 4 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index c025523ca0..959f18739b 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -3033,6 +3033,76 @@ public:
const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const;
};
+Common::String convertSierraGameId(Common::String sierraId) {
+ // TODO: SCI32 IDs
+
+ // TODO: astrochicken
+ // TODO: The internal id of christmas1998 is "demo"
+ if (sierraId == "card")
+ return "christmas1990";
+ // TODO: christmas1992
+ if (sierraId == "arthur")
+ return "camelot";
+ if (sierraId == "brain")
+ return "castlebrain";
+ // iceman is the same
+ // longbow is the same
+ if (sierraId == "eco")
+ return "ecoquest";
+ if (sierraId == "rain")
+ return "ecoquest2";
+ if (sierraId == "fp")
+ return "freddypharkas";
+ if (sierraId == "emc")
+ return "funseeker";
+ if (sierraId == "cardgames")
+ return "hoyle1";
+ if (sierraId == "solitare")
+ return "hoyle2";
+ // TODO: hoyle3
+ // TODO: hoyle4
+ if (sierraId == "kq1")
+ return "kq1sci";
+ if (sierraId == "kq4")
+ return "kq4sci";
+ if (sierraId == "lsl1")
+ return "lsl1sci";
+ // lsl2 is the same
+ // lsl3 is the same
+ // lsl5 is the same
+ // lsl6 is the same
+ // TODO: lslcasino
+ // TODO: fairytales
+ // TODO: mothergoose
+ // TODO: msastrochicken
+ if (sierraId == "cb1")
+ return "laurabow";
+ if (sierraId == "lb2")
+ return "laurabow2";
+ // TODO: lb2 floppy (its resources can't be read)
+ if (sierraId == "twisty")
+ return "pepper";
+ // TODO: pq1sci (its resources can't be read)
+ if (sierraId == "pq")
+ return "pq2";
+ // pq3 is the same
+ if (sierraId == "glory")
+ return "qfg1";
+ // TODO: qfg1 VGA (its resources can't be read)
+ if (sierraId == "trial")
+ return "qfg2";
+ if (sierraId == "qfg1")
+ return "qfg3";
+ // TODO: slater
+ if (sierraId == "sq1")
+ return "sq1sci";
+ // sq3 is the same
+ // sq4 is the same
+ // sq5 is the same
+ // TODO: islandbrain
+
+ return sierraId;
+}
const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fslist) const {
bool foundResMap = false;
@@ -3049,8 +3119,13 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
filename.toLowercase();
if (filename.contains("resource.map") || filename.contains("resmap.000")) {
- // resource.map is located in the same directory as the other resource files,
+ // HACK: resource.map is located in the same directory as the other resource files,
// therefore add the directory here, so that the game files can be opened later on
+ // TODO/FIXME: This should be removed, as it will cause problems with game detection:
+ // if we got a game A, and then try to detect another game B, adding a default
+ // directory here means that game A's files will be opened first. We either need to
+ // remove the directory added here, or rewrite all the functions which access game
+ // files
Common::File::addDefaultDirectory(file->getParent().getPath());
foundResMap = true;
}
@@ -3104,9 +3179,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
Common::String gameName = obj_get_name(segManager,version, game_obj);
debug(2, " \"%s\" at %04x:%04x", gameName.c_str(), PRINT_REG(game_obj));
gameName.toLowercase();
- // TODO: Sierra's game IDs are not always the same as our own ones, we need to map them
- // accordingly here
- s_fallbackDesc.desc.gameid = strdup(gameName.c_str());
+ s_fallbackDesc.desc.gameid = strdup(convertSierraGameId(gameName).c_str());
delete kernel;
delete segManager;
delete resMgr;
--
cgit v1.2.3
From db0cd620f6f5766b6287bb0f0aa1ac9c866c4cba Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Tue, 18 Aug 2009 14:10:31 +0000
Subject: Started rewriting the SCI engine to use FSNode instead of file names.
This is the proper solution for removing the hack in the fallback detector,
but it still needs work. Also, reduced the things needed to be initialized a
bit, so that the detection is a bit faster
svn-id: r43510
---
engines/sci/detection.cpp | 21 ++---
engines/sci/engine/kernel.cpp | 6 +-
engines/sci/engine/kernel.h | 7 +-
engines/sci/resource.cpp | 173 ++++++++++++++++++++++++++++++++++--------
engines/sci/resource.h | 16 ++++
5 files changed, 178 insertions(+), 45 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 959f18739b..ee9fd5fb18 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -3123,9 +3123,8 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
// therefore add the directory here, so that the game files can be opened later on
// TODO/FIXME: This should be removed, as it will cause problems with game detection:
// if we got a game A, and then try to detect another game B, adding a default
- // directory here means that game A's files will be opened first. We either need to
- // remove the directory added here, or rewrite all the functions which access game
- // files
+ // directory here means that game A's files will be opened first. We need to rewrite
+ // all the functions that access game files to use FSNodes instead
Common::File::addDefaultDirectory(file->getParent().getPath());
foundResMap = true;
}
@@ -3167,20 +3166,22 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
s_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
// Determine the game id
- ResourceManager *resMgr = new ResourceManager();
+ ResourceManager *resMgr = new ResourceManager(fslist);
SciVersion version = resMgr->sciVersion();
- Kernel *kernel = new Kernel(resMgr);
- SegManager *segManager = new SegManager(resMgr, version, kernel->hasOldScriptHeader());
- if (!script_instantiate(resMgr, segManager, version, kernel->hasOldScriptHeader(), 0)) {
+ Kernel *kernel = new Kernel(resMgr, true);
+ bool hasOldScriptHeader = kernel->hasOldScriptHeader();
+ delete kernel;
+
+ SegManager *segManager = new SegManager(resMgr, version, hasOldScriptHeader);
+ if (!script_instantiate(resMgr, segManager, version, hasOldScriptHeader, 0)) {
warning("fallbackDetect(): Could not instantiate script 0");
return 0;
}
reg_t game_obj = script_lookup_export(segManager, 0, 0);
- Common::String gameName = obj_get_name(segManager,version, game_obj);
- debug(2, " \"%s\" at %04x:%04x", gameName.c_str(), PRINT_REG(game_obj));
+ Common::String gameName = obj_get_name(segManager, version, game_obj);
+ debug(2, "Detected ID: \"%s\" at %04x:%04x", gameName.c_str(), PRINT_REG(game_obj));
gameName.toLowercase();
s_fallbackDesc.desc.gameid = strdup(convertSierraGameId(gameName).c_str());
- delete kernel;
delete segManager;
delete resMgr;
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 09d342b7fe..223e7fc1e9 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -363,11 +363,15 @@ static const char *argtype_description[] = {
"Arithmetic"
};
-Kernel::Kernel(ResourceManager *resmgr) : _resmgr(resmgr) {
+Kernel::Kernel(ResourceManager *resmgr, bool minimalLoad) : _resmgr(resmgr) {
memset(&_selectorMap, 0, sizeof(_selectorMap)); // FIXME: Remove this once/if we C++ify selector_map_t
loadSelectorNames();
detectSciFeatures();
+
+ if (minimalLoad) // If we're only asked to detect game features, stop here
+ return;
+
mapSelectors(); // Map a few special selectors for later use
loadOpcodes();
loadKernelNames();
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 8be51549f6..997cdaea77 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -65,7 +65,12 @@ enum AutoDetectedFeatures {
class Kernel {
public:
- Kernel(ResourceManager *resmgr);
+ /**
+ * Initializes the SCI kernel
+ * @param minimalLoad If true, only the selector names are loaded, to detect game features.
+ * It's set to true by the advanced game detector to speed it up
+ */
+ Kernel(ResourceManager *resmgr, bool minimalLoad = false);
~Kernel();
uint getOpcodesSize() const { return _opcodes.size(); }
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 2ca198954a..9b9c9ee26c 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -112,6 +112,20 @@ ResourceSource *ResourceManager::addExternalMap(const char *file_name) {
newsrc->source_type = kSourceExtMap;
newsrc->location_name = file_name;
+ newsrc->resourceFile = 0;
+ newsrc->scanned = false;
+ newsrc->associated_map = NULL;
+
+ _sources.push_back(newsrc);
+ return newsrc;
+}
+
+ResourceSource *ResourceManager::addExternalMap(const Common::FSNode *mapFile) {
+ ResourceSource *newsrc = new ResourceSource();
+
+ newsrc->source_type = kSourceExtMap;
+ newsrc->location_name = mapFile->getName();
+ newsrc->resourceFile = mapFile;
newsrc->scanned = false;
newsrc->associated_map = NULL;
@@ -125,6 +139,21 @@ ResourceSource *ResourceManager::addSource(ResourceSource *map, ResSourceType ty
newsrc->source_type = type;
newsrc->scanned = false;
newsrc->location_name = filename;
+ newsrc->resourceFile = 0;
+ newsrc->volume_number = number;
+ newsrc->associated_map = map;
+
+ _sources.push_back(newsrc);
+ return newsrc;
+}
+
+ResourceSource *ResourceManager::addSource(ResourceSource *map, ResSourceType type, const Common::FSNode *resFile, int number) {
+ ResourceSource *newsrc = new ResourceSource();
+
+ newsrc->source_type = type;
+ newsrc->scanned = false;
+ newsrc->location_name = resFile->getName();
+ newsrc->resourceFile = resFile;
newsrc->volume_number = number;
newsrc->associated_map = map;
@@ -342,6 +371,48 @@ int ResourceManager::addAppropriateSources() {
return 1;
}
+int ResourceManager::addAppropriateSources(const Common::FSList &fslist) {
+ ResourceSource *map = 0;
+
+ // First, find resource.map
+ for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+ if (file->isDirectory())
+ continue;
+
+ Common::String filename = file->getName();
+ filename.toLowercase();
+
+ if (filename.contains("resource.map") || filename.contains("resmap.000")) {
+ map = addExternalMap(file);
+ break;
+ }
+ }
+
+ if (!map)
+ return 0;
+
+ // Now find all the resource.0?? files
+ for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+ if (file->isDirectory())
+ continue;
+
+ Common::String filename = file->getName();
+ filename.toLowercase();
+
+ if (filename.contains("resource.0") || filename.contains("ressci.0")) {
+ const char *dot = strrchr(filename.c_str(), '.');
+ int number = atoi(dot + 1);
+
+ addSource(map, kSourceVolume, file, number);
+ }
+ }
+
+ // This function is only called by the advanced detector, and we don't really need
+ // to add a patch directory or message.map here
+
+ return 1;
+}
+
int ResourceManager::addInternalSources() {
Common::List *resources = listResources(kResourceTypeMap);
Common::List::iterator itr = resources->begin();
@@ -397,14 +468,22 @@ void ResourceManager::freeResourceSources() {
}
ResourceManager::ResourceManager() {
+ addAppropriateSources();
+ init();
+}
+
+ResourceManager::ResourceManager(const Common::FSList &fslist) {
+ addAppropriateSources(fslist);
+ init();
+}
+
+void ResourceManager::init() {
_memoryLocked = 0;
_memoryLRU = 0;
_LRU.clear();
_resMap.clear();
_audioMapSCI1 = NULL;
- addAppropriateSources();
-
// FIXME: put this in an Init() function, so that we can error out if detection fails completely
_mapVersion = detectMapVersion();
@@ -601,7 +680,8 @@ const char *ResourceManager::versionDescription(ResVersion version) const {
}
ResourceManager::ResVersion ResourceManager::detectMapVersion() {
- Common::File file;
+ Common::SeekableReadStream *fileStream = 0;
+ Common::File *file = 0;
byte buff[6];
ResourceSource *rsrc= 0;
@@ -609,23 +689,30 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
rsrc = *it;
if (rsrc->source_type == kSourceExtMap) {
- file.open(rsrc->location_name);
+ if (rsrc->resourceFile) {
+ fileStream = rsrc->resourceFile->createReadStream();
+ } else {
+ file = new Common::File();
+ file->open(rsrc->location_name);
+ if (file->isOpen())
+ fileStream = file;
+ }
break;
}
}
- if (file.isOpen() == false) {
+ if (!fileStream) {
error("Failed to open resource map file");
return kResVersionUnknown;
}
// detection
// SCI0 and SCI01 maps have last 6 bytes set to FF
- file.seek(-4, SEEK_END);
- uint32 uEnd = file.readUint32LE();
+ fileStream->seek(-4, SEEK_END);
+ uint32 uEnd = fileStream->readUint32LE();
if (uEnd == 0xFFFFFFFF) {
// check if 0 or 01 - try to read resources in SCI0 format and see if exists
- file.seek(0, SEEK_SET);
- while (file.read(buff, 6) == 6 && !(buff[0] == 0xFF && buff[1] == 0xFF && buff[2] == 0xFF)) {
+ fileStream->seek(0, SEEK_SET);
+ while (fileStream->read(buff, 6) == 6 && !(buff[0] == 0xFF && buff[1] == 0xFF && buff[2] == 0xFF)) {
if (getVolume(rsrc, (buff[5] & 0xFC) >> 2) == NULL)
return kResVersionSci1Middle;
}
@@ -639,14 +726,15 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
uint16 lastDirectoryOffset = 0;
uint16 directorySize = 0;
ResVersion mapDetected = kResVersionUnknown;
- file.seek(0, SEEK_SET);
- while (!file.eos()) {
- directoryType = file.readByte();
- directoryOffset = file.readUint16LE();
+ fileStream->seek(0, SEEK_SET);
+
+ while (!fileStream->eos()) {
+ directoryType = fileStream->readByte();
+ directoryOffset = fileStream->readUint16LE();
if ((directoryType < 0x80) || ((directoryType > 0xA0) && (directoryType != 0xFF)))
break;
// Offset is above file size? -> definitely not SCI1/SCI1.1
- if (directoryOffset > file.size())
+ if (directoryOffset > fileStream->size())
break;
if (lastDirectoryOffset) {
directorySize = directoryOffset - lastDirectoryOffset;
@@ -655,11 +743,14 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
if ((directorySize % 5 == 0) && (directorySize % 6))
mapDetected = kResVersionSci11;
}
- if (directoryType==0xFF) {
+ if (directoryType == 0xFF) {
// FFh entry needs to point to EOF
- if (directoryOffset != file.size())
+ if (directoryOffset != fileStream->size())
break;
- if (mapDetected)
+
+ delete fileStream;
+
+ if (mapDetected)
return mapDetected;
return kResVersionSci1Late;
}
@@ -675,29 +766,41 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
// "lastDirectoryOffset". This is probably not the correct fix, since before r43000
// the loop above could not prematurely terminate and thus this would always check the
// last directory entry instead of the last checked directory entry.
- file.seek(lastDirectoryOffset - 7, SEEK_SET);
- if (file.readByte() == 0xFF && file.readUint16LE() == file.size())
+ fileStream->seek(lastDirectoryOffset - 7, SEEK_SET);
+ if (fileStream->readByte() == 0xFF && fileStream->readUint16LE() == fileStream->size())
return kResVersionSci32; // TODO : check if there is a difference between these maps
#endif
+ delete fileStream;
+
return kResVersionUnknown;
}
ResourceManager::ResVersion ResourceManager::detectVolVersion() {
- Common::File file;
+ Common::SeekableReadStream *fileStream = 0;
+ Common::File *file = 0;
ResourceSource *rsrc;
+
for (Common::List::iterator it = _sources.begin(); it != _sources.end(); ++it) {
rsrc = *it;
if (rsrc->source_type == kSourceVolume) {
- file.open(rsrc->location_name);
+ if (rsrc->resourceFile) {
+ fileStream = rsrc->resourceFile->createReadStream();
+ } else {
+ file = new Common::File();
+ file->open(rsrc->location_name);
+ if (file->isOpen())
+ fileStream = file;
+ }
break;
}
}
- if (file.isOpen() == false) {
+ if (!fileStream) {
error("Failed to open volume file");
return kResVersionUnknown;
}
+
// SCI0 volume format: {wResId wPacked+4 wUnpacked wCompression} = 8 bytes
// SCI1 volume format: {bResType wResNumber wPacked+4 wUnpacked wCompression} = 9 bytes
// SCI1.1 volume format: {bResType wResNumber wPacked wUnpacked wCompression} = 9 bytes
@@ -710,15 +813,17 @@ ResourceManager::ResVersion ResourceManager::detectVolVersion() {
bool failed = false;
// Check for SCI0, SCI1, SCI1.1 and SCI32 v2 (Gabriel Knight 1 CD) formats
- while (!file.eos() && file.pos() < 0x100000) {
+ while (!fileStream->eos() && fileStream->pos() < 0x100000) {
if (curVersion > kResVersionSci0Sci1Early)
- file.readByte();
- resId = file.readUint16LE();
- dwPacked = (curVersion < kResVersionSci32) ? file.readUint16LE() : file.readUint32LE();
- dwUnpacked = (curVersion < kResVersionSci32) ? file.readUint16LE() : file.readUint32LE();
- wCompression = (curVersion < kResVersionSci32) ? file.readUint16LE() : file.readUint32LE();
- if (file.eos())
+ fileStream->readByte();
+ resId = fileStream->readUint16LE();
+ dwPacked = (curVersion < kResVersionSci32) ? fileStream->readUint16LE() : fileStream->readUint32LE();
+ dwUnpacked = (curVersion < kResVersionSci32) ? fileStream->readUint16LE() : fileStream->readUint32LE();
+ wCompression = (curVersion < kResVersionSci32) ? fileStream->readUint16LE() : fileStream->readUint32LE();
+ if (fileStream->eos()) {
+ delete fileStream;
return curVersion;
+ }
int chk = (curVersion == kResVersionSci0Sci1Early) ? 4 : 20;
int offs = curVersion < kResVersionSci11 ? 4 : 0;
@@ -740,18 +845,20 @@ ResourceManager::ResVersion ResourceManager::detectVolVersion() {
break;
}
- file.seek(0, SEEK_SET);
+ fileStream->seek(0, SEEK_SET);
continue;
}
if (curVersion < kResVersionSci11)
- file.seek(dwPacked - 4, SEEK_CUR);
+ fileStream->seek(dwPacked - 4, SEEK_CUR);
else if (curVersion == kResVersionSci11)
- file.seek((9 + dwPacked) % 2 ? dwPacked + 1 : dwPacked, SEEK_CUR);
+ fileStream->seek((9 + dwPacked) % 2 ? dwPacked + 1 : dwPacked, SEEK_CUR);
else if (curVersion == kResVersionSci32)
- file.seek(dwPacked, SEEK_CUR);//(9 + wPacked) % 2 ? wPacked + 1 : wPacked, SEEK_CUR);
+ fileStream->seek(dwPacked, SEEK_CUR);//(9 + wPacked) % 2 ? wPacked + 1 : wPacked, SEEK_CUR);
}
+ delete fileStream;
+
if (!failed)
return curVersion;
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 8ab740f463..4250225ffe 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -28,6 +28,7 @@
#include "common/str.h"
#include "common/file.h"
+#include "common/fs.h"
#include "common/archive.h"
#include "sound/audiostream.h"
@@ -136,6 +137,7 @@ struct ResourceSource {
ResSourceType source_type;
bool scanned;
Common::String location_name; // FIXME: Replace by FSNode ?
+ const Common::FSNode *resourceFile;
int volume_number;
ResourceSource *associated_map;
};
@@ -247,6 +249,7 @@ public:
* Creates a new SCI resource manager.
*/
ResourceManager();
+ ResourceManager(const Common::FSList &fslist);
~ResourceManager();
/**
@@ -305,6 +308,11 @@ protected:
ResVersion _mapVersion; //!< RESOURCE.MAP version
SciVersion _sciVersion; //!< Detected SCI version */
+ /**
+ * Initializes the resource manager
+ */
+ void init();
+
/**
* Add a path to the resource manager's list of sources.
* @return a pointer to the added source structure, or NULL if an error occurred.
@@ -322,12 +330,19 @@ protected:
*/
ResourceSource *addSource(ResourceSource *map, ResSourceType type, const char *filename,
int number);
+
+ ResourceSource *addSource(ResourceSource *map, ResSourceType type,
+ const Common::FSNode *resFile, int number);
+
/**
* Add an external (i.e., separate file) map resource to the resource manager's list of sources.
* @param file_name The name of the volume to add
* @return A pointer to the added source structure, or NULL if an error occurred.
*/
ResourceSource *addExternalMap(const char *file_name);
+
+ ResourceSource *addExternalMap(const Common::FSNode *mapFile);
+
/**
* Add an internal (i.e., resource) map to the resource manager's list of sources.
* @param name The name of the resource to add
@@ -344,6 +359,7 @@ protected:
*/
void scanNewSources();
int addAppropriateSources();
+ int addAppropriateSources(const Common::FSList &fslist);
int addInternalSources();
void freeResourceSources();
--
cgit v1.2.3
From b33b90ecd0468c58b93e13ff80bf6939e97ed7a6 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Tue, 18 Aug 2009 15:31:26 +0000
Subject: Made AGOS, DRASCULA, GOB, GROOVIE, MADE, SCUMM and TINSEL properly
stop CD audio playback on engine quit. (This only problem affected playback
from CD, not from ripped audio files)
svn-id: r43512
---
engines/agos/agos.cpp | 2 +-
engines/drascula/drascula.cpp | 1 +
engines/gob/sound/cdrom.cpp | 1 +
engines/groovie/music.cpp | 4 ++++
engines/groovie/music.h | 2 +-
engines/made/made.cpp | 2 ++
engines/scumm/sound.cpp | 2 +-
engines/tinsel/tinsel.cpp | 1 +
8 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 07b5c12247..ee2ef98c42 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -899,7 +899,7 @@ AGOSEngine::~AGOSEngine() {
if (_driver)
delete _driver;
- AudioCD.destroy();
+ AudioCD.stop();
for (uint i = 0; i < _itemHeap.size(); i++) {
delete[] _itemHeap[i];
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 2e3db3478e..3920f8a56c 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -106,6 +106,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
DrasculaEngine::~DrasculaEngine() {
delete _rnd;
+ stopSound();
free(_charMap);
free(_itemLocations);
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index 4d6a7ec966..68cbb1b9e2 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -46,6 +46,7 @@ CDROM::CDROM() {
}
CDROM::~CDROM() {
+ stop();
}
void CDROM::readLIC(DataStream &stream) {
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 797290a6f3..a92beee17e 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -38,6 +38,10 @@ MusicPlayer::MusicPlayer(GroovieEngine *vm) :
_prevCDtrack(0), _backgroundDelay(0) {
}
+MusicPlayer::~MusicPlayer() {
+ AudioCD.stop();
+}
+
void MusicPlayer::playSong(uint32 fileref) {
Common::StackLock lock(_mutex);
diff --git a/engines/groovie/music.h b/engines/groovie/music.h
index 9909c8a185..fb1ddfe9c3 100644
--- a/engines/groovie/music.h
+++ b/engines/groovie/music.h
@@ -37,7 +37,7 @@ namespace Groovie {
class MusicPlayer {
public:
MusicPlayer(GroovieEngine *vm);
- virtual ~MusicPlayer() {}
+ virtual ~MusicPlayer();
void playSong(uint32 fileref);
void setBackgroundSong(uint32 fileref);
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index c83f7aaf02..e826e3788a 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -127,6 +127,8 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
}
MadeEngine::~MadeEngine() {
+ AudioCD.stop();
+
delete _rnd;
delete _pmvPlayer;
delete _res;
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 528cceb0cc..524dbf70ea 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -86,7 +86,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
Sound::~Sound() {
stopCDTimer();
- AudioCD.destroy();
+ AudioCD.stop();
delete _sfxFile;
}
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 5f056351b6..7586c5e749 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -888,6 +888,7 @@ TinselEngine::~TinselEngine() {
if (MoviePlaying())
FinishBMV();
+ AudioCD.stop();
delete _sound;
delete _midiMusic;
delete _pcmMusic;
--
cgit v1.2.3
From 5c11ec51bc0e246615874876c913371672a725a3 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Tue, 18 Aug 2009 15:32:26 +0000
Subject: - Destory AudioCDManager singleton after user quits a game, this
saves a few bytes memory - Added FIXME to audiocd.h, concering why destroying
the AudioCDManager can not quit CD playback right now
svn-id: r43513
---
base/main.cpp | 12 ++++++++++++
sound/audiocd.h | 8 ++++++++
2 files changed, 20 insertions(+)
diff --git a/base/main.cpp b/base/main.cpp
index d108512416..f9ebe7ae56 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -45,9 +45,12 @@
#include "common/file.h"
#include "common/fs.h"
#include "common/system.h"
+
#include "gui/GuiManager.h"
#include "gui/message.h"
+#include "sound/audiocd.h"
+
#include "backends/keymapper/keymapper.h"
#if defined(_WIN32_WCE)
@@ -416,6 +419,15 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
warning("Could not find any engine capable of running the selected game");
}
+ // We will destory the AudioCDManager singleton here to save some memory.
+ // This will not make the CD audio stop, one would have to enable this:
+ //AudioCD.stop();
+ // but the engine is responsible for stopping CD playback anyway and
+ // this way we catch engines not doing it properly. For some more
+ // information about why AudioCDManager::destroy does not stop the CD
+ // playback read the FIXME in sound/audiocd.h
+ Audio::AudioCDManager::destroy();
+
// reset the graphics to default
setupGraphics(system);
launcherDialog();
diff --git a/sound/audiocd.h b/sound/audiocd.h
index 4c4ff26147..2dc379ca27 100644
--- a/sound/audiocd.h
+++ b/sound/audiocd.h
@@ -67,6 +67,14 @@ private:
friend class Common::Singleton;
AudioCDManager();
+ // FIXME: It might make sense to stop CD playback, when the AudioCDManager singleton
+ // is destroyed. Currently we can not do this, since in worst case the OSystem and
+ // along wiht it the Mixer will be destroyed before the AudioCDManager, thus
+ // leading to invalid memory access. If we can fix up the code to destroy the
+ // AudioCDManager before OSystem in *all* cases, that is including calling
+ // OSystem::quit, we might be able to implement it via a simple "stop()"
+ // call in a custom destructor of AudioCDManager.
+
/* used for emulated CD music */
SoundHandle _handle;
bool _emulating;
--
cgit v1.2.3
From 426dd7d24149d7d60e9e20d0babe38d08e114b4a Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Tue, 18 Aug 2009 15:39:47 +0000
Subject: PSP: disable dosbox OPL
svn-id: r43514
---
backends/platform/psp/Makefile | 2 +-
configure | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index 0190cdf8c9..d18e6ac82c 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -62,7 +62,7 @@ endif
INCDIR := $(srcdir) . $(srcdir)/engines/ . $(PSPSDK)/include
LIBDIR := $(LIBDIR) . $(PSPSDK)/lib
-CXXFLAGS = -O3 -Wall -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB -Wno-multichar `$(PSPBIN)/sdl-config --cflags`
+CXXFLAGS = -O3 -Wall -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB -DDISABLE_DOSBOX_OPL -Wno-multichar `$(PSPBIN)/sdl-config --cflags`
CXXFLAGS:= $(addprefix -I,$(INCDIR)) $(CXXFLAGS)
LDFLAGS := $(addprefix -L,$(LIBDIR)) $(LDFLAGS)
LIBS =
diff --git a/configure b/configure
index ef1cb5f7a2..b939838505 100755
--- a/configure
+++ b/configure
@@ -2073,7 +2073,7 @@ case $_backend in
# TODO nds
;;
psp)
- DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE"
+ DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL"
INCLUDES="$INCLUDES -I$PSPDEV/psp/include/SDL"
LIBS="$LIBS -lSDL"
;;
--
cgit v1.2.3
From 3ade77dfb06ba0d41f123306fcf529c7007351b9 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Tue, 18 Aug 2009 15:41:00 +0000
Subject: Typos.
svn-id: r43515
---
base/main.cpp | 2 +-
sound/audiocd.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/base/main.cpp b/base/main.cpp
index f9ebe7ae56..03db00a1d9 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -419,7 +419,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
warning("Could not find any engine capable of running the selected game");
}
- // We will destory the AudioCDManager singleton here to save some memory.
+ // We will destroy the AudioCDManager singleton here to save some memory.
// This will not make the CD audio stop, one would have to enable this:
//AudioCD.stop();
// but the engine is responsible for stopping CD playback anyway and
diff --git a/sound/audiocd.h b/sound/audiocd.h
index 2dc379ca27..3ef4a1ac09 100644
--- a/sound/audiocd.h
+++ b/sound/audiocd.h
@@ -69,7 +69,7 @@ private:
// FIXME: It might make sense to stop CD playback, when the AudioCDManager singleton
// is destroyed. Currently we can not do this, since in worst case the OSystem and
- // along wiht it the Mixer will be destroyed before the AudioCDManager, thus
+ // along with it the Mixer will be destroyed before the AudioCDManager, thus
// leading to invalid memory access. If we can fix up the code to destroy the
// AudioCDManager before OSystem in *all* cases, that is including calling
// OSystem::quit, we might be able to implement it via a simple "stop()"
--
cgit v1.2.3
From ed2a733b2a9841f00e8ea2559193044cc4fca8b0 Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Tue, 18 Aug 2009 17:12:01 +0000
Subject: PSP: Make R-trigger act as a context sensitive modifier key, remap
ENTER to triangle
svn-id: r43517
---
backends/platform/psp/README.PSP.in | 9 ++++-----
backends/platform/psp/osys_psp.cpp | 17 +++++++++++------
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/backends/platform/psp/README.PSP.in b/backends/platform/psp/README.PSP.in
index 2a2b53e721..7eeba7d391 100644
--- a/backends/platform/psp/README.PSP.in
+++ b/backends/platform/psp/README.PSP.in
@@ -13,15 +13,17 @@ Controls
========
Left trigger - ESC
-Right trigger - Enter
+Right trigger - Modifier key (see below for uses)
Analog - Mouse movement
+Right trigger + Analog - Fine control mouse
Directionals - Mouse movement
-Analog + triangle - Fine control mouse
+Triangle - Enter
Cross - Mouse button 1
Circle - Mouse button 2
Square - '.' (skip dialogue in some games)
Select - Show/Hide Virtual Keyboard
Start - F5
+Right trigger + Start - Return-To-Launcher menu
Notes
=====
@@ -32,9 +34,6 @@ Notes
As such, it is recommended to play games in their original, uncompressed,
form whenever possible.
-- Sleep/Suspend mode currently isn't supported, so don't use it when
- running ScummVM.
-
- This README may be outdated, for more up-to-date instructions and notes see
the PSP Port Wiki: http://wiki.scummvm.org/index.php/PlayStation_Portable
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 8a7a0af0ed..d1886c253f 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -411,7 +411,7 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
*/
uint32 buttonsChanged = pad.Buttons ^ _prevButtons;
- if (buttonsChanged & (PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_LTRIGGER | PSP_CTRL_RTRIGGER | PSP_CTRL_START | PSP_CTRL_SELECT | PSP_CTRL_SQUARE)) {
+ if (buttonsChanged & (PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_LTRIGGER | PSP_CTRL_RTRIGGER | PSP_CTRL_START | PSP_CTRL_SELECT | PSP_CTRL_SQUARE | PSP_CTRL_TRIANGLE)) {
if (buttonsChanged & PSP_CTRL_CROSS) {
event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_LBUTTONDOWN : Common::EVENT_LBUTTONUP;
} else if (buttonsChanged & PSP_CTRL_CIRCLE) {
@@ -419,24 +419,29 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
} else {
//any of the other buttons.
event.type = buttonsChanged & pad.Buttons ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
+ event.kbd.ascii = 0;
event.kbd.flags = 0;
if (buttonsChanged & PSP_CTRL_LTRIGGER) {
event.kbd.keycode = Common::KEYCODE_ESCAPE;
event.kbd.ascii = 27;
- } else if (buttonsChanged & PSP_CTRL_RTRIGGER) {
- event.kbd.keycode = Common::KEYCODE_RETURN;
- event.kbd.ascii = 13;
} else if (buttonsChanged & PSP_CTRL_START) {
event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
- event.kbd.flags = Common::KBD_CTRL; // Main menu to allow RTL
+ if (pad.Buttons & PSP_CTRL_RTRIGGER) {
+ event.kbd.flags = Common::KBD_CTRL; // Main menu to allow RTL
+ }
/* } else if (buttonsChanged & PSP_CTRL_SELECT) {
event.kbd.keycode = Common::KEYCODE_0;
event.kbd.ascii = '0';
*/ } else if (buttonsChanged & PSP_CTRL_SQUARE) {
event.kbd.keycode = Common::KEYCODE_PERIOD;
event.kbd.ascii = '.';
+ } else if (buttonsChanged & PSP_CTRL_TRIANGLE) {
+ event.kbd.keycode = Common::KEYCODE_RETURN;
+ event.kbd.ascii = 13;
+ } else if (pad.Buttons & PSP_CTRL_RTRIGGER) {
+ event.kbd.flags |= Common::KBD_SHIFT;
}
}
@@ -485,7 +490,7 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
newY += _padAccel >> 2;
// If no movement then this has no effect
- if (pad.Buttons & PSP_CTRL_TRIANGLE) {
+ if (pad.Buttons & PSP_CTRL_RTRIGGER) {
// Fine control mode for analog
if (analogStepAmountX != 0) {
if (analogStepAmountX > 0)
--
cgit v1.2.3
From a35056b55531edcd384c3fa0dafc9a4ee6bfb6ee Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Tue, 18 Aug 2009 18:06:50 +0000
Subject: Implement setCursorPalette(), correct hasFeature() <->
getFeatureState() mixup.
svn-id: r43519
---
backends/platform/psp/osys_psp.cpp | 6 ++++--
backends/platform/psp/osys_psp.h | 1 +
backends/platform/psp/osys_psp_gu.cpp | 21 ++++++++++++++++++++-
backends/platform/psp/osys_psp_gu.h | 2 ++
4 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index d1886c253f..566db3014b 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -79,6 +79,8 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0)
memset(_palette, 0, sizeof(_palette));
+ _cursorPaletteDisabled = true;
+
_samplesPerSec = 0;
//init SDL
@@ -110,14 +112,14 @@ void OSystem_PSP::initBackend() {
bool OSystem_PSP::hasFeature(Feature f) {
- return false;
+ return (f == kFeatureOverlaySupportsAlpha || f == kFeatureCursorHasPalette);
}
void OSystem_PSP::setFeatureState(Feature f, bool enable) {
}
bool OSystem_PSP::getFeatureState(Feature f) {
- return (f == kFeatureOverlaySupportsAlpha);
+ return false;
}
const OSystem::GraphicsMode* OSystem_PSP::getSupportedGraphicsModes() const {
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 46607dac34..310efdc7d4 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -68,6 +68,7 @@ protected:
int _mouseHotspotX, _mouseHotspotY;
byte _mouseKeyColour;
byte *_mouseBuf;
+ bool _cursorPaletteDisabled;
uint32 _prevButtons;
uint32 _lastPadCheck;
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
index 76f6b42e37..0fb1b4aded 100644
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ b/backends/platform/psp/osys_psp_gu.cpp
@@ -41,6 +41,7 @@
unsigned int __attribute__((aligned(16))) list[262144];
unsigned short __attribute__((aligned(16))) clut256[256];
unsigned short __attribute__((aligned(16))) mouseClut[256];
+unsigned short __attribute__((aligned(16))) cursorPalette[256];
unsigned short __attribute__((aligned(16))) kbClut[256];
//unsigned int __attribute__((aligned(16))) offscreen256[640*480];
//unsigned int __attribute__((aligned(16))) overlayBuffer256[640*480*2];
@@ -225,6 +226,24 @@ void OSystem_PSP_GU::setPalette(const byte *colors, uint start, uint num) {
sceKernelDcacheWritebackAll();
}
+void OSystem_PSP_GU::setCursorPalette(const byte *colors, uint start, uint num) {
+ const byte *b = colors;
+
+ for (uint i = 0; i < num; ++i) {
+ cursorPalette[start + i] = RGBToColour(b[0], b[1], b[2]);
+ b += 4;
+ }
+
+ cursorPalette[0] = 0;
+
+ _cursorPaletteDisabled = false;
+
+ sceKernelDcacheWritebackAll();
+}
+
+void OSystem_PSP_GU::disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
+}
void OSystem_PSP_GU::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
//Clip the coordinates
@@ -364,7 +383,7 @@ void OSystem_PSP_GU::updateScreen() {
if (_mouseVisible) {
sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
sceGuClutMode(GU_PSM_5551, 0, 0xff, 0);
- sceGuClutLoad(32, mouseClut); // upload 32*8 entries (256)
+ sceGuClutLoad(32, _cursorPaletteDisabled ? mouseClut : cursorPalette); // upload 32*8 entries (256)
sceGuAlphaFunc(GU_GREATER,0,0xff);
sceGuEnable(GU_ALPHA_TEST);
sceGuTexImage(0, MOUSE_SIZE, MOUSE_SIZE, MOUSE_SIZE, _mouseBuf);
diff --git a/backends/platform/psp/osys_psp_gu.h b/backends/platform/psp/osys_psp_gu.h
index e828a36b7d..c221971fc8 100644
--- a/backends/platform/psp/osys_psp_gu.h
+++ b/backends/platform/psp/osys_psp_gu.h
@@ -47,6 +47,8 @@ public:
void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale);
void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) ;
void setPalette(const byte *colors, uint start, uint num);
+ void setCursorPalette(const byte *colors, uint start, uint num);
+ void disableCursorPalette(bool disable);
bool pollEvent(Common::Event &event);
int _graphicMode;
struct Vertex *_vertices;
--
cgit v1.2.3
From 0762bb7cf6d81632a0fd9621104546fa9ae3da18 Mon Sep 17 00:00:00 2001
From: Benjamin Haisch
Date: Tue, 18 Aug 2009 19:42:13 +0000
Subject: - PMV player: Use frame count from PVM file and fix incorrect
"invalid chunk type" warning - Fix sprite drawing glitch with vertically
flipped sprites (bug #2825925)
svn-id: r43521
---
engines/made/pmvplayer.cpp | 19 ++++++-------------
engines/made/screen.cpp | 3 ++-
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp
index 9796b01dfc..a6ee649eda 100644
--- a/engines/made/pmvplayer.cpp
+++ b/engines/made/pmvplayer.cpp
@@ -62,12 +62,8 @@ bool PmvPlayer::play(const char *filename) {
}
uint frameDelay = _fd->readUint16LE();
- int unk;
_fd->skip(4); // always 0?
- unk = _fd->readByte();
- debug(2, "%i", unk);
- unk = _fd->readByte();
- debug(2, "%i", unk);
+ uint frameCount = _fd->readUint16LE();
_fd->skip(4); // always 0?
uint soundFreq = _fd->readUint16LE();
@@ -80,7 +76,7 @@ bool PmvPlayer::play(const char *filename) {
if (soundFreq == 22254) soundFreq = 22050;
for (int i = 0; i < 22; i++) {
- unk = _fd->readUint16LE();
+ int unk = _fd->readUint16LE();
debug(2, "%i ", unk);
}
@@ -90,7 +86,7 @@ bool PmvPlayer::play(const char *filename) {
_fd->read(_paletteRGB, 768);
_vm->_screen->setRGBPalette(_paletteRGB);
- uint32 frameCount = 0;
+ uint32 frameNumber = 0;
uint16 chunkCount = 0;
uint32 soundSize = 0;
uint32 soundChunkOfs = 0, palChunkOfs = 0;
@@ -108,7 +104,7 @@ bool PmvPlayer::play(const char *filename) {
// get it to work well?
_audioStream = Audio::makeAppendableAudioStream(soundFreq, Audio::Mixer::FLAG_UNSIGNED);
- while (!_vm->shouldQuit() && !_aborted && !_fd->eos()) {
+ while (!_vm->shouldQuit() && !_aborted && !_fd->eos() && frameNumber < frameCount) {
int32 frameTime = _vm->_system->getMillis();
@@ -117,9 +113,6 @@ bool PmvPlayer::play(const char *filename) {
warning("Unknown chunk type");
}
- if (_fd->eos())
- break;
-
// Only reallocate the frame data buffer if its size has changed
if (prevChunkSize != chunkSize || !frameData) {
if (frameData)
@@ -192,7 +185,7 @@ bool PmvPlayer::play(const char *filename) {
updateScreen();
if (skipFrames == 0) {
- int32 waitTime = (frameCount * frameDelay) -
+ int32 waitTime = (frameNumber * frameDelay) -
(g_system->getMillis() - soundStartTime) - (_vm->_system->getMillis() - frameTime);
if (waitTime < 0) {
@@ -204,7 +197,7 @@ bool PmvPlayer::play(const char *filename) {
} else
skipFrames--;
- frameCount++;
+ frameNumber++;
}
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index d55b663296..7471743ba4 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -188,7 +188,7 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f
if (flipX) {
linePtrAdd = -1;
- sourceAdd = sourceSurface->w;
+ sourceAdd = sourceSurface->w - 1;
} else {
linePtrAdd = 1;
sourceAdd = 0;
@@ -210,6 +210,7 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f
}
linePtr += linePtrAdd;
}
+
source += sourcePitch;
dest += clipInfo.destSurface->pitch;
if (_vm->getGameID() != GID_RTZ)
--
cgit v1.2.3
From 2bd1f51d92492fa88ba61dc65f783fc9bbfd852c Mon Sep 17 00:00:00 2001
From: Kari Salminen
Date: Tue, 18 Aug 2009 21:37:31 +0000
Subject: Possible fix for #2828330 (AGI: KQ1: Fast text box). If doesn't break
anything else then should go to the branch-1-0-0 too, but haven't had the
time to do much testing yet - thus committing to the trunk first.
svn-id: r43523
---
engines/agi/cycle.cpp | 4 ++--
engines/agi/menu.cpp | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index d212f8c2e0..2b4ef7f60a 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -266,8 +266,8 @@ process_key:
}
// commented out to close Sarien bug #438872
- if (key)
- _game.keypress = key;
+ //if (key)
+ // _game.keypress = key;
}
break;
case INPUT_GETSTRING:
diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp
index 5d30eda81d..e1db04ff49 100644
--- a/engines/agi/menu.cpp
+++ b/engines/agi/menu.cpp
@@ -408,6 +408,7 @@ bool Menu::keyhandler(int key) {
if (d->enabled) {
debugC(6, kDebugLevelMenu | kDebugLevelInput, "event %d registered", d->event);
_vm->_game.controllerOccured[d->event] = true;
+ _vm->_menuSelected = true;
goto exit_menu;
}
break;
--
cgit v1.2.3
From 2ea0df7b2e14264b828b5d7fe7e55565a6c0bfa8 Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Wed, 19 Aug 2009 01:40:22 +0000
Subject: Take advantage of extra memory on newer PSP models
svn-id: r43525
---
backends/platform/psp/Makefile | 2 +-
backends/platform/psp/psp.mk | 2 +-
backends/platform/psp/psp_main.cpp | 9 ++++-----
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index d18e6ac82c..64ce8a0161 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -49,7 +49,7 @@ STRIP = psp-strip
MKDIR = mkdir -p
RM = rm -f
RM_REC = rm -rf
-MKSFO = mksfo
+MKSFO = mksfoex -d MEMSIZE=1
PACK_PBP = pack-pbp
FIXUP = psp-fixup-imports
diff --git a/backends/platform/psp/psp.mk b/backends/platform/psp/psp.mk
index 10e272a593..998a420ffc 100644
--- a/backends/platform/psp/psp.mk
+++ b/backends/platform/psp/psp.mk
@@ -9,7 +9,7 @@ PSP_EBOOT_SFO = param.sfo
PSP_EBOOT_TITLE = ScummVM-PSP
DATE = $(shell date +%Y%m%d)
-MKSFO = mksfo
+MKSFO = mksfoex -d MEMSIZE=1
PACK_PBP = pack-pbp
$(PSP_EXE_STRIPPED): $(PSP_EXE)
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp
index 3ea6c55368..357c502dbc 100644
--- a/backends/platform/psp/psp_main.cpp
+++ b/backends/platform/psp/psp_main.cpp
@@ -62,9 +62,8 @@ PSP_MODULE_INFO("SCUMMVM-PSP", 0, 1, 1);
* code (crt0.c) starts this program in to be in usermode
* even though the module was started in kernelmode
*/
-#ifndef USERSPACE_ONLY
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
-#endif
+PSP_HEAP_SIZE_KB(-128); //Leave 128kb for thread stacks, etc.
#ifndef USERSPACE_ONLY
@@ -142,13 +141,13 @@ int SetupCallbacks(void) {
#undef main
int main(void) {
+ //change clock rate to 333mhz
+ scePowerSetClockFrequency(333, 333, 166);
+
PowerManager::instance(); // Setup power manager
SetupCallbacks();
- //change clock rate to 333mhz
- scePowerSetClockFrequency(333, 333, 166);
-
static const char *argv[] = { "scummvm", NULL };
static int argc = sizeof(argv)/sizeof(char *)-1;
--
cgit v1.2.3
From 5e92db60010d2545daf9673d2aeb97e11782fe01 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 07:12:33 +0000
Subject: Skip the whole Lore of the Lands special when the user does any
input, like the original did.
svn-id: r43527
---
engines/kyra/sequences_lol.cpp | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index c1ceba34e9..54a882d9e2 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -875,20 +875,15 @@ void HistoryPlayer::play() {
while (sound->voiceIsPlaying() && !_vm->shouldQuit() && !_vm->skipFlag())
_vm->delay(10);
- if (_vm->skipFlag()) {
+ if (_vm->skipFlag())
sound->voiceStop();
- _vm->resetSkipFlag();
- }
++voiceFilename[4];
}
-
- if (_vm->skipFlag())
- _vm->resetSkipFlag();
}
if (_vm->skipFlag())
- _vm->resetSkipFlag();
+ _vm->_eventList.clear();
pal.fill(0, 256, 63);
if (_fireWsa->opened())
@@ -899,6 +894,9 @@ void HistoryPlayer::play() {
_screen->clearPage(0);
pal.fill(0, 256, 0);
_screen->fadePalette(pal, 0x3C);
+
+ if (_vm->skipFlag())
+ _vm->_eventList.clear();
}
void HistoryPlayer::loadWsa(const char *filename) {
--
cgit v1.2.3
From 2f162c72c9309037eb0c71ae520319cceb7756e1 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 07:13:29 +0000
Subject: Comment out unused function (which was also currently only enabled
when SCI32 is enabled).
svn-id: r43528
---
engines/sci/engine/kernel.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 223e7fc1e9..a871df936f 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -820,7 +820,7 @@ void Kernel::setDefaultKernelNames() {
}
#ifdef ENABLE_SCI32
-static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &names) {
+//static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &names) {
/*
999.voc format for SCI1.1 games:
[b] # of kernel functions
@@ -830,7 +830,7 @@ static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &name
{[w name-len][function name]}
...
*/
- //unsigned int size = 64, pos = 3;
+/* //unsigned int size = 64, pos = 3;
int len;
Resource *r = resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_KNAMES), 0);
if(r == NULL) // failed to open vocab.999 (happens with SCI1 demos)
@@ -843,7 +843,7 @@ static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &name
len = READ_LE_UINT16(r->data + off);
names[i] = Common::String((char *)r->data + off + 2, len);
}
-}
+}*/
#endif
bool Kernel::loadKernelNames() {
--
cgit v1.2.3
From 416fb4f309df5bd3657ec131743cd6605d52036b Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Wed, 19 Aug 2009 08:24:40 +0000
Subject: Corrected comments in the bug workaround list
svn-id: r43529
---
engines/tinsel/pcode.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index 8646ad3267..a2661237b7 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -145,8 +145,8 @@ const WorkaroundEntry workaroundList[] = {
// Present Outside Inn
{TINSEL_V1, false, 352600876, 0, fragment2_size, fragment2},
- // DW1-GRA: Talking to palace guards in Act 2 gives !!!HIGH STRING||| - this happens if you initiate dialog
- // with one of the guards, but not the other. So this fix routes the talk parameters of the broken one
+ // DW1-GRA: Talking to palace guards in Act 2 gives !!!HIGH STRING||| - this happens if you initiate dialog with
+ // one of the guards, but not the other. So these fragments provide the correct talk parameters where needed
{TINSEL_V1, false, 310506872, 463, fragment4_size, fragment4},
{TINSEL_V1, false, 310506872, 485, fragment5_size, fragment5},
{TINSEL_V1, false, 310506872, 513, fragment6_size, fragment6},
@@ -164,7 +164,7 @@ const WorkaroundEntry workaroundList[] = {
{TINSEL_V0, false, 0, 0, 0, NULL}
};
-//310505453, x
+
//----------------- LOCAL GLOBAL DATA --------------------
/**
--
cgit v1.2.3
From 0c2ab20663c12464e923608a73d851c019006238 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 08:30:15 +0000
Subject: Implemented proper character selection of Lands of Lore PC98.
svn-id: r43531
---
engines/kyra/lol.h | 4 ++
engines/kyra/screen.cpp | 19 +++++++
engines/kyra/sequences_lol.cpp | 109 ++++++++++++++++++++++++++++++-----------
engines/kyra/staticres.cpp | 11 +++++
4 files changed, 115 insertions(+), 28 deletions(-)
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 1c89a7a1eb..7a112cfd8f 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -366,6 +366,10 @@ private:
static const CharacterPrev _charPreviews[];
+ // PC98 specific data
+ static const uint16 _charPosXPC98[];
+ static const uint8 _charNamesPC98[][11];
+
WSAMovie_v2 *_chargenWSA;
static const uint8 _chargenFrameTableTalkie[];
static const uint8 _chargenFrameTableFloppy[];
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index f5570acd72..b50bc7a1e6 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -562,6 +562,12 @@ void Screen::setPagePixel(int pageNum, int x, int y, uint8 color) {
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
if (pageNum == 0 || pageNum == 1)
addDirtyRect(x, y, 1, 1);
+
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
_pagePtrs[pageNum][y * SCREEN_W + x] = color;
}
@@ -954,6 +960,11 @@ void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum,
clearOverlayRect(pageNum, x1, y1, x2-x1+1, y2-y1+1);
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
if (xored) {
for (; y1 <= y2; ++y1) {
for (int x = x1; x <= x2; ++x)
@@ -1035,6 +1046,11 @@ void Screen::drawClippedLine(int x1, int y1, int x2, int y2, int color) {
void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
uint8 *ptr = getPagePtr(_curPage) + y * SCREEN_W + x;
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
if (vertical) {
assert((y + length) <= SCREEN_H);
int currLine = 0;
@@ -2974,6 +2990,9 @@ byte *Screen::getOverlayPtr(int page) {
if (_vm->gameFlags().gameID == GI_KYRA2) {
if (page == 12 || page == 13)
return _sjisOverlayPtrs[3];
+ } else if (_vm->gameFlags().gameID == GI_LOL) {
+ if (page == 4 || page == 5)
+ return _sjisOverlayPtrs[3];
}
return 0;
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index 54a882d9e2..3b061e5062 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -289,18 +289,56 @@ int LoLEngine::chooseCharacter() {
_screen->setFont(Screen::FID_9_FNT);
_screen->_curPage = 2;
- for (int i = 0; i < 4; ++i)
- _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name);
+ if (_flags.platform == Common::kPlatformPC98) {
+ _screen->fillRect(17, 29, 94, 97, 17);
+ _screen->fillRect(68, 167, 310, 199, 17);
+ _screen->drawClippedLine(68, 166, 311, 166, 238);
+ _screen->drawClippedLine(68, 166, 68, 199, 238);
+ _screen->drawClippedLine(311, 166, 311, 199, 238);
- for (int i = 0; i < 4; ++i) {
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]);
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]);
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]);
- }
+ _screen->_curPage = 4;
+ _screen->fillRect(17, 29, 94, 97, 17);
+ _screen->_curPage = 2;
+
+ for (int i = 0; i < 4; ++i) {
+ _screen->printText((const char *)_charNamesPC98[i], _charPosXPC98[i], 168, 0xC1, 0x00);
+
+ // Since our SJIS font does not support ASCII digits currently, we have to use the
+ // digits from the SJIS range, which looks different to the original.
+ for (int j = 0; j < 3; ++j) {
+ uint8 buffer[5];
+ snprintf((char *)buffer, 5, "%2d", _charPreviews[i].attrib[j]);
+
+ buffer[3] = buffer[1] - '0' + 0x4F;
+ buffer[2] = 0x82;
+ if (buffer[0] != ' ') {
+ buffer[1] = buffer[0] - '0' + 0x4F;
+ buffer[0] = 0x82;
+ } else {
+ buffer[1] = 0x40;
+ buffer[0] = 0x81;
+ }
+ buffer[4] = 0x00;
+
+ _screen->printText((const char *)buffer, _charPosXPC98[i] + 16, 176 + j * 8, 0x81, 0x00);
+ }
+ }
+
+ _screen->printText(_tim->getCTableEntry(51), 72, 176, 0x81, 0x00);
+ _screen->printText(_tim->getCTableEntry(53), 72, 184, 0x81, 0x00);
+ _screen->printText(_tim->getCTableEntry(55), 72, 192, 0x81, 0x00);
+ } else {
+ for (int i = 0; i < 4; ++i) {
+ _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]);
+ }
- _screen->fprintStringIntro("%s", 36, 173, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(51));
- _screen->fprintStringIntro("%s", 36, 181, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(53));
- _screen->fprintStringIntro("%s", 36, 189, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(55));
+ _screen->fprintStringIntro("%s", 36, 173, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(51));
+ _screen->fprintStringIntro("%s", 36, 181, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(53));
+ _screen->fprintStringIntro("%s", 36, 189, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(55));
+ }
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
_screen->_curPage = 0;
@@ -337,6 +375,8 @@ int LoLEngine::chooseCharacter() {
} else {
break;
}
+
+ delay(10);
}
if (shouldQuit())
@@ -363,11 +403,13 @@ void LoLEngine::kingSelectionIntro() {
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
int y = 38;
- _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(57));
- _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(58));
- _screen->fprintStringIntro("%s", 8, y + 20, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(59));
- _screen->fprintStringIntro("%s", 8, y + 30, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(60));
- _screen->fprintStringIntro("%s", 8, y + 40, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(61));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(57 + i), 16, 32 + i * 8, 0xC1, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 8, y + i * 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(57 + i));
+ }
_sound->voicePlay("KING01", &_speechHandle);
@@ -405,8 +447,13 @@ void LoLEngine::kingSelectionReminder() {
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
int y = 48;
- _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(62));
- _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(63));
+ if (_flags.platform == Common::kPlatformPC98) {
+ _screen->printText(_tim->getCTableEntry(62), 16, 32, 0xC1, 0x00);
+ _screen->printText(_tim->getCTableEntry(63), 16, 40, 0xC1, 0x00);
+ } else {
+ _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(62));
+ _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(63));
+ }
_sound->voicePlay("KING02", &_speechHandle);
@@ -540,13 +587,17 @@ int LoLEngine::selectionCharInfo(int character) {
static const uint8 charSelectInfoIdx[] = { 0x1D, 0x22, 0x27, 0x2C };
const int idx = charSelectInfoIdx[character];
- _screen->fprintStringIntro("%s", 50, 127, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+0));
- _screen->fprintStringIntro("%s", 50, 137, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+1));
- _screen->fprintStringIntro("%s", 50, 147, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+2));
- _screen->fprintStringIntro("%s", 50, 157, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+3));
- _screen->fprintStringIntro("%s", 50, 167, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+4));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(idx+i), 60, 128 + i * 8, 0x41, 0x00);
+
+ _screen->printText(_tim->getCTableEntry(69), 112, 168, 0x01, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 50, 127 + i * 10, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+i));
- _screen->fprintStringIntro("%s", 100, 168, 0x32, 0x00, 0xCF, 0x20, _tim->getCTableEntry(69));
+ _screen->fprintStringIntro("%s", 100, 168, 0x32, 0x00, 0xCF, 0x20, _tim->getCTableEntry(69));
+ }
selectionCharInfoIntro(vocFilename);
if (_charSelectionInfoResult == -1) {
@@ -568,11 +619,13 @@ int LoLEngine::selectionCharInfo(int character) {
_screen->copyRegion(48, 127, 48, 160, 272, 35, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
- _screen->fprintStringIntro("%s", 3, 28, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(64));
- _screen->fprintStringIntro("%s", 3, 38, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(65));
- _screen->fprintStringIntro("%s", 3, 48, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(66));
- _screen->fprintStringIntro("%s", 3, 58, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(67));
- _screen->fprintStringIntro("%s", 3, 68, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(68));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(64+i), 16, 32 + i * 8, 0xC1, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 3, 28 + i * 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(64+i));
+ }
resetSkipFlag();
kingSelectionOutro();
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 51288f31df..4f3824479d 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -3196,6 +3196,17 @@ const LoLEngine::CharacterPrev LoLEngine::_charPreviews[] = {
{ "Conrad", 0x10F, 0x7F, { 0x0A, 0x0C, 0x0A } }
};
+const uint16 LoLEngine::_charPosXPC98[] = {
+ 92, 152, 212, 268
+};
+
+const uint8 LoLEngine::_charNamesPC98[][11] = {
+ { 0x83, 0x41, 0x83, 0x4E, 0x83, 0x56, 0x83, 0x46, 0x83, 0x8B, 0x00 },
+ { 0x83, 0x7D, 0x83, 0x43, 0x83, 0x50, 0x83, 0x8B, 0x00, 0x00, 0x00 },
+ { 0x83, 0x4C, 0x81, 0x5B, 0x83, 0x89, 0x83, 0x93, 0x00, 0x00, 0x00 },
+ { 0x83, 0x52, 0x83, 0x93, 0x83, 0x89, 0x83, 0x62, 0x83, 0x68, 0x00 }
+};
+
const uint8 LoLEngine::_chargenFrameTableTalkie[] = {
0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x04, 0x03, 0x02, 0x01,
--
cgit v1.2.3
From 2597814af37711dce00594e71c6f2e5aaecdb96a Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 08:37:20 +0000
Subject: Add another range check in our SJIS font code to avoid out of bounds
access.
svn-id: r43532
---
graphics/sjis.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index 405d8622c2..9f5def8f10 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -280,6 +280,11 @@ const uint16 *FontSjisSVM::getCharData(uint16 c) const {
if (index >= 0x3F)
--index;
+ // Another check if the passed character was an
+ // correctly encoded SJIS character.
+ if (index < 0 || index >= 0xBC || base < 0)
+ return 0;
+
return _fontData + (base * 0xBC + index) * 16;
}
--
cgit v1.2.3
From a37c9164ee09cb7b29b312bd7810790b08dc2355 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 08:46:59 +0000
Subject: Cleanup.
svn-id: r43533
---
engines/kyra/script_lok.cpp | 92 ++++++++-------------------------------------
1 file changed, 16 insertions(+), 76 deletions(-)
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index a778a2066b..5d323b7c17 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -429,22 +429,14 @@ int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
int wsaFrame = 0;
while (running) {
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+
_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
if (wsaFrame >= _movieObjects[wsaIndex]->frames())
running = false;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- if (worldUpdate) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- } else {
- _screen->updateScreen();
- }
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, worldUpdate != 0);
}
_screen->showMouse();
@@ -460,18 +452,10 @@ int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
int waitTime = stackPos(3);
int wsaIndex = stackPos(4);
_screen->hideMouse();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
}
@@ -501,15 +485,10 @@ int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
int wsaIndex = stackPos(5);
_screen->hideMouse();
for (; startFrame <= endFrame; ++startFrame) {
- uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
+ const uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
- while (_system->getMillis() < nextRun) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextRun - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(nextRun, false, true);
}
_screen->showMouse();
return 0;
@@ -693,18 +672,10 @@ int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
int wsaIndex = stackPos(4);
_screen->hideMouse();
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
@@ -776,37 +747,21 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
if (endFrame >= startFrame) {
int frame = startFrame;
while (endFrame >= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
if (waitTime)
_animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
++frame;
}
} else {
int frame = startFrame;
while (endFrame <= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
if (waitTime)
_animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
--frame;
}
}
@@ -1060,16 +1015,7 @@ int KyraEngine_LoK::o1_walkCharacterToPoint(EMCState *script) {
setCharacterPosition(character, 0);
++curPos;
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- while (_system->getMillis() < nextFrame) {
- _sprites->updateSceneAnims();
- updateMousePointer();
- _timer->update();
- _animator->updateAllObjectShapes();
- updateTextFade();
- if ((nextFrame - _system->getMillis()) >= 10)
- delay(10);
- }
+ delayUntil(nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis(), true, true);
}
return 0;
}
@@ -1318,9 +1264,8 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
assert(_amuleteAnim);
_screen->hideMouse();
snd_playSoundEffect(0x70);
- uint32 nextTime = 0;
for (int i = 0; _amuleteAnim[i] != 0xFF; ++i) {
- nextTime = _system->getMillis() + 5 * _tickLength;
+ const uint32 nextTime = _system->getMillis() + 5 * _tickLength;
uint8 code = _amuleteAnim[i];
if (code == 3 || code == 7)
@@ -1335,12 +1280,7 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
amulet->displayFrame(code, 0, 224, 152, 0, 0, 0);
_animator->_updateScreen = true;
- while (_system->getMillis() < nextTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(nextTime, false, true);
}
_screen->showMouse();
}
--
cgit v1.2.3
From 6145ed384b3cb8b143efaafd7402b0bcdc572706 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 08:54:41 +0000
Subject: Cleanup.
svn-id: r43534
---
engines/kyra/script_hof.cpp | 34 ++++++++--------------------------
1 file changed, 8 insertions(+), 26 deletions(-)
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index 1b8c1d32b3..a811952801 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -186,20 +186,14 @@ int KyraEngine_HoF::o2_displayWsaFrame(EMCState *script) {
int backUp = stackPos(8);
_screen->hideMouse();
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(frame, dstPage, x, y, copyParam | 0xC000, 0, 0);
_screen->updateScreen();
if (backUp)
memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
- while (_system->getMillis() < endTime) {
- if (doUpdate)
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(endTime, false, doUpdate != 0);
_screen->showMouse();
return 0;
}
@@ -224,34 +218,22 @@ int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
while (curTime < maxTimes) {
if (startFrame < endFrame) {
for (int i = startFrame; i <= endFrame; ++i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- } while (_system->getMillis() < endTime);
+ delayUntil(endTime, false, true);
}
}
} else {
for (int i = startFrame; i >= endFrame; --i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10 && !skipFlag())
- delay(10);
- } while (_system->getMillis() < endTime && !skipFlag());
+ delayUntil(endTime, false, true);
}
}
}
@@ -282,7 +264,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) {
_screen->hideMouse();
while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
+ const uint32 endTime = _system->getMillis() + frameDelay;
_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
@@ -310,7 +292,7 @@ int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) {
const int lastFrame = _wsaSlots[index]->frames();
while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
+ const uint32 endTime = _system->getMillis() + frameDelay;
_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
if (!skipFlag()) {
if (doUpdate)
--
cgit v1.2.3
From ca6fa52b1a62e7635e7f3cdb022ac0a25b22abd2 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 08:55:04 +0000
Subject: Cleanup.
svn-id: r43535
---
engines/kyra/script_mr.cpp | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index 819bf838ca..9943fe419d 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -266,7 +266,7 @@ int KyraEngine_MR::o3_wipeDownMouseItem(EMCState *script) {
for (int curY = y, height = 20; height > 0; height -= 2, curY += 2) {
restoreGfxRect32x32(x, y);
_screen->setNewShapeHeight(shape, height);
- uint32 waitTime = _system->getMillis() + _tickLength;
+ const uint32 waitTime = _system->getMillis() + _tickLength;
_screen->drawShape(0, shape, x, curY, 0, 0);
_screen->updateScreen();
delayUntil(waitTime);
@@ -1131,15 +1131,7 @@ int KyraEngine_MR::o3d_updateAnim(EMCState *script) {
int KyraEngine_MR::o3d_delay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_delay(%p) (%d)", (const void *)script, stackPos(0));
- const uint32 endTime = _system->getMillis() + stackPos(0) * _tickLength;
- while (_system->getMillis() < endTime) {
- if (_chatText)
- updateWithText();
- else
- update();
-
- _system->delayMillis(10);
- }
+ delayUntil(_system->getMillis() + stackPos(0) * _tickLength, false, true);
return 0;
}
--
cgit v1.2.3
From dd67cb7c9442071448432f107432249eb7ef1d95 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 09:01:04 +0000
Subject: Add missing "break" in switch statement.
svn-id: r43536
---
engines/kyra/lol.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 816e244531..eb313821af 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -65,6 +65,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy
case Common::JA_JPN:
_lang = 0;
+ break;
default:
warning("unsupported language, switching back to English");
--
cgit v1.2.3
From 34e30a29b5d4902514e696369f8714b171a778bb Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 16:19:55 +0000
Subject: Make KYRA only call OSystem::updateScreen from inside
Screen::updateScreen, when the screen really changed OR the palette changed.
svn-id: r43537
---
engines/kyra/animator_lok.cpp | 7 +------
engines/kyra/animator_lok.h | 1 -
engines/kyra/gui_lok.cpp | 1 -
engines/kyra/kyra_v1.cpp | 5 +----
engines/kyra/screen.cpp | 11 ++++++++++-
engines/kyra/screen.h | 2 +-
engines/kyra/script_lok.cpp | 12 ------------
engines/kyra/sequences_lok.cpp | 1 -
engines/kyra/text_lok.cpp | 1 -
9 files changed, 13 insertions(+), 28 deletions(-)
diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp
index a05eabe3e1..04c31a1422 100644
--- a/engines/kyra/animator_lok.cpp
+++ b/engines/kyra/animator_lok.cpp
@@ -37,7 +37,6 @@ Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_screen = vm->screen();
_initOk = false;
- _updateScreen = false;
_system = system;
_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
_noDrawShapesFlag = 0;
@@ -382,15 +381,11 @@ void Animator_LoK::copyChangedObjectsForward(int refreshFlag) {
_screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0);
curObject->refreshFlag = 0;
- _updateScreen = true;
}
}
}
- if (_updateScreen) {
- _screen->updateScreen();
- _updateScreen = false;
- }
+ _screen->updateScreen();
}
void Animator_LoK::updateAllObjectShapes() {
diff --git a/engines/kyra/animator_lok.h b/engines/kyra/animator_lok.h
index ba5882c710..618a210082 100644
--- a/engines/kyra/animator_lok.h
+++ b/engines/kyra/animator_lok.h
@@ -95,7 +95,6 @@ public:
int16 fetchAnimHeight(const uint8 *shape, int16 mult);
int _noDrawShapesFlag;
- bool _updateScreen;
uint16 _brandonDrawFrame;
int _brandonScaleX;
int _brandonScaleY;
diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp
index e9c71f511d..3c5fbe4f1c 100644
--- a/engines/kyra/gui_lok.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -522,7 +522,6 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {
if (_menuRestoreScreen) {
restorePalette();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
- _vm->_animator->_updateScreen = true;
} else {
_screen->deletePageFromDisk(0);
}
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index d79d9a8f32..d8e91b138d 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -434,11 +434,8 @@ void KyraEngine_v1::updateInput() {
}
}
- // TODO: Check whether we should really call Screen::updateScreen here.
- // We might simply want to call OSystem::updateScreen instead, since Screen::updateScreen
- // copies changed screen parts to the screen buffer, which might not be desired.
if (updateScreen)
- screen()->updateScreen();
+ _system->updateScreen();
}
void KyraEngine_v1::removeInputTop() {
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index b50bc7a1e6..bf9a9f4246 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -51,6 +51,7 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system)
memset(_fonts, 0, sizeof(_fonts));
_currentFont = FID_8_FNT;
+ _paletteChanged = true;
}
Screen::~Screen() {
@@ -206,6 +207,9 @@ void Screen::setResolution() {
}
void Screen::updateScreen() {
+ bool needRealUpdate = _forceFullUpdate || _dirtyRects.size() || _paletteChanged;
+ _paletteChanged = false;
+
if (_useOverlays)
updateDirtyRectsOvl();
else if (_isAmiga && _interfacePaletteEnabled)
@@ -214,13 +218,16 @@ void Screen::updateScreen() {
updateDirtyRects();
if (_debugEnabled) {
+ needRealUpdate = true;
+
if (!_useOverlays)
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
else
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 640, 0, SCREEN_W, SCREEN_H);
}
- _system->updateScreen();
+ if (needRealUpdate)
+ _system->updateScreen();
}
void Screen::updateDirtyRects() {
@@ -709,6 +716,7 @@ void Screen::setScreenPalette(const Palette &pal) {
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 0, pal.getNumColors());
}
@@ -744,6 +752,7 @@ void Screen::setInterfacePalette(const Palette &pal, uint8 r, uint8 g, uint8 b)
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 32, pal.getNumColors());
}
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 73a29ee2c7..7553a0132b 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -308,7 +308,6 @@ public:
virtual bool init();
virtual void setResolution();
-
void updateScreen();
// debug functions
@@ -508,6 +507,7 @@ protected:
};
bool _forceFullUpdate;
+ bool _paletteChanged;
Common::List _dirtyRects;
void addDirtyRect(int x, int y, int w, int h);
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index 5d323b7c17..0a96db8277 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -432,7 +432,6 @@ int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
if (wsaFrame >= _movieObjects[wsaIndex]->frames())
running = false;
@@ -454,7 +453,6 @@ int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
_screen->hideMouse();
const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
@@ -487,7 +485,6 @@ int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
for (; startFrame <= endFrame; ++startFrame) {
const uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
delayUntil(nextRun, false, true);
}
_screen->showMouse();
@@ -576,7 +573,6 @@ int KyraEngine_LoK::o1_setCustomPaletteRange(EMCState *script) {
int KyraEngine_LoK::o1_loadPageFromDisk(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
_screen->loadPageFromDisk(stackPosString(0), stackPos(1));
- _animator->_updateScreen = true;
return 0;
}
@@ -644,7 +640,6 @@ int KyraEngine_LoK::o1_copyWSARegion(EMCState *script) {
int srcPage = stackPos(4);
int dstPage = stackPos(5);
_screen->copyRegion(xpos, ypos, xpos, ypos, width, height, srcPage, dstPage);
- _animator->_updateScreen = true;
return 0;
}
@@ -674,7 +669,6 @@ int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
_screen->hideMouse();
const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
delayUntil(continueTime, false, true);
_screen->showMouse();
@@ -749,8 +743,6 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
while (endFrame >= frame) {
const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
delayUntil(continueTime, false, true);
++frame;
}
@@ -759,8 +751,6 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
while (endFrame <= frame) {
const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
delayUntil(continueTime, false, true);
--frame;
}
@@ -1278,8 +1268,6 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
snd_playSoundEffect(0x73);
amulet->displayFrame(code, 0, 224, 152, 0, 0, 0);
- _animator->_updateScreen = true;
-
delayUntil(nextTime, false, true);
}
_screen->showMouse();
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index d2ef351767..d13dc2d291 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -1944,7 +1944,6 @@ void KyraEngine_LoK::updateKyragemFading() {
}
_screen->setScreenPalette(_screen->getPalette(0));
- _animator->_updateScreen = true;
switch (_kyragemFadingState.nextOperation) {
case 0:
diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp
index d2128b7037..178966196c 100644
--- a/engines/kyra/text_lok.cpp
+++ b/engines/kyra/text_lok.cpp
@@ -97,7 +97,6 @@ void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const
currPage = _screen->_curPage;
_screen->_curPage = 2;
_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
- _animator->_updateScreen = true;
_screen->_curPage = currPage;
}
--
cgit v1.2.3
From 88ac4190529f220c2d8ac0879815fba3e0d72d1f Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 16:23:26 +0000
Subject: Use Common::List::empty instead of Common::List::size, which is
faster for checking whether the list is empty and easier to read.
svn-id: r43538
---
engines/kyra/screen.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index bf9a9f4246..6542b15183 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -207,7 +207,7 @@ void Screen::setResolution() {
}
void Screen::updateScreen() {
- bool needRealUpdate = _forceFullUpdate || _dirtyRects.size() || _paletteChanged;
+ bool needRealUpdate = _forceFullUpdate || !_dirtyRects.empty() || _paletteChanged;
_paletteChanged = false;
if (_useOverlays)
@@ -337,6 +337,7 @@ void Screen::updateDirtyRectsOvl() {
_system->copyRectToScreen(dst, 640, it->left<<1, it->top<<1, it->width()<<1, it->height()<<1);
}
}
+
_forceFullUpdate = false;
_dirtyRects.clear();
}
--
cgit v1.2.3
From bbac75bc1c4e45bcdcb6fecd9f0f99d916ca80ef Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Wed, 19 Aug 2009 16:23:44 +0000
Subject: PSP: throttle the number of updateScreen() calls
svn-id: r43539
---
backends/platform/psp/osys_psp.cpp | 2 +-
backends/platform/psp/osys_psp.h | 1 +
backends/platform/psp/osys_psp_gu.cpp | 9 +++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 566db3014b..5e461f45e0 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -75,7 +75,7 @@ const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = {
};
-OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
+OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _lastScreenUpdate(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
memset(_palette, 0, sizeof(_palette));
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 310efdc7d4..94488a92ce 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -59,6 +59,7 @@ protected:
uint16 _palette[256];
bool _overlayVisible;
uint32 _shakePos;
+ uint32 _lastScreenUpdate;
Graphics::Surface _framebuffer;
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
index 0fb1b4aded..1c83aa4abf 100644
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ b/backends/platform/psp/osys_psp_gu.cpp
@@ -38,6 +38,8 @@
#define MOUSE_SIZE 128
#define KBD_DATA_SIZE 130560
+#define MAX_FPS 30
+
unsigned int __attribute__((aligned(16))) list[262144];
unsigned short __attribute__((aligned(16))) clut256[256];
unsigned short __attribute__((aligned(16))) mouseClut[256];
@@ -295,6 +297,13 @@ void OSystem_PSP_GU::copyRectToScreen(const byte *buf, int pitch, int x, int y,
}
void OSystem_PSP_GU::updateScreen() {
+ u32 now = getMillis();
+ if (now - _lastScreenUpdate < 1000 / MAX_FPS)
+ return;
+
+ _lastScreenUpdate = now;
+
+
sceGuStart(0,list);
sceGuClearColor(0xff000000);
--
cgit v1.2.3
From 4673e94c6fb93441ab5ebe9c3cb7d567cc9f7738 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 16:48:55 +0000
Subject: - Fix sluggish mouse movement in Kyra2/Kyra3/LoL main menu. - Fix
sluggish mouse movement in the text input dialog of the GUI.
svn-id: r43541
---
engines/kyra/gui.cpp | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index cc1add9ce7..e49085103a 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -232,10 +232,11 @@ void GUI::processHighlights(Menu &menu) {
menu.highlightedItem = i;
redrawHighlight(menu);
- _screen->updateScreen();
}
}
}
+
+ _screen->updateScreen();
}
void GUI::redrawText(const Menu &menu) {
@@ -424,7 +425,8 @@ void GUI::checkTextfieldInput() {
Common::Point pos = _vm->getMousePos();
_vm->_mouseX = pos.x;
_vm->_mouseY = pos.y;
- _screen->updateScreen();
+
+ _vm->_system->updateScreen();
_lastScreenUpdate = now;
} break;
@@ -490,14 +492,24 @@ bool MainMenu::getInput() {
Common::Event event;
Common::EventManager *eventMan = _vm->getEventManager();
+ bool updateScreen = false;
+
while (eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONUP:
return true;
+
+ case Common::EVENT_MOUSEMOVE:
+ updateScreen = true;
+ break;
+
default:
break;
}
}
+
+ if (updateScreen)
+ _system->updateScreen();
return false;
}
--
cgit v1.2.3
From a491107ee40347f6acb8db319105a2fa85663e50 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 19 Aug 2009 20:12:04 +0000
Subject: Initialize EventRecorder to passthrough mode in the constructor.
svn-id: r43545
---
common/EventRecorder.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/EventRecorder.cpp b/common/EventRecorder.cpp
index 3d5eee3e52..57ab475f4a 100644
--- a/common/EventRecorder.cpp
+++ b/common/EventRecorder.cpp
@@ -100,6 +100,7 @@ EventRecorder::EventRecorder() {
_lastEventCount = 0;
_lastMillis = 0;
+ _recordMode = kPassthrough;
}
EventRecorder::~EventRecorder() {
--
cgit v1.2.3
From 8bd4cee2d296f8cf6df3b4a936d3d1d94ec72d46 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Wed, 19 Aug 2009 21:08:17 +0000
Subject: SCI: Add autodetection of Amiga views.
svn-id: r43547
---
engines/sci/gfx/gfx_resource.h | 9 ++++++
engines/sci/resource.cpp | 62 +++++++++++++++++++++++++++++++++++++-----
engines/sci/resource.h | 11 +++-----
3 files changed, 68 insertions(+), 14 deletions(-)
diff --git a/engines/sci/gfx/gfx_resource.h b/engines/sci/gfx/gfx_resource.h
index 9c83cf07cd..1e188118ad 100644
--- a/engines/sci/gfx/gfx_resource.h
+++ b/engines/sci/gfx/gfx_resource.h
@@ -77,6 +77,15 @@ extern gfx_pixmap_color_t gfx_sci0_image_colors[][16];
*/
extern Palette* gfx_sci0_pic_colors;
+
+enum ViewType {
+ kViewUnknown,
+ kViewEga,
+ kViewVga,
+ kViewVga11,
+ kViewAmiga
+};
+
struct gfxr_pic0_params_t {
gfx_line_mode_t line_mode; /* one of GFX_LINE_MODE_* */
gfx_brush_mode_t brush_mode;
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 9b9c9ee26c..2479504820 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -510,7 +510,7 @@ void ResourceManager::init() {
if (_sciVersion != SCI_VERSION_AUTODETECT)
debug("Resmgr: Detected %s", versionNames[_sciVersion]);
else
- debug("Resmgr: Couldn't determine SCI version");
+ warning("Resmgr: Couldn't determine SCI version");
switch (_viewType) {
case kViewEga:
@@ -521,6 +521,12 @@ void ResourceManager::init() {
break;
case kViewVga11:
debug("Resmgr: Detected SCI1.1 VGA graphic resources");
+ break;
+ case kViewAmiga:
+ debug("Resmgr: Detected Amiga graphic resources");
+ break;
+ default:
+ warning("Resmgr: Couldn't determine view type");
}
}
@@ -1500,22 +1506,64 @@ ResourceCompression ResourceManager::getViewCompression() {
return kCompNone;
}
-ResourceManager::ViewType ResourceManager::detectViewType() {
+ViewType ResourceManager::detectViewType() {
for (int i = 0; i < 1000; i++) {
Resource *res = findResource(ResourceId(kResourceTypeView, i), 0);
+
if (res) {
- //FIXME: Amiga
switch(res->data[1]) {
- case 0:
- return kViewEga;
- default:
+ case 128:
+ // If the 2nd byte is 128, it's a VGA game
return kViewVga;
+ case 0:
+ // EGA or Amiga, try to read as Amiga view
+
+ if (res->size < 10)
+ return kViewUnknown;
+
+ // Read offset of first loop
+ uint16 offset = READ_LE_UINT16(res->data + 8);
+
+ if (offset + 6U >= res->size)
+ return kViewUnknown;
+
+ // Read offset of first cel
+ offset = READ_LE_UINT16(res->data + offset + 4);
+
+ if (offset + 4U >= res->size)
+ return kViewUnknown;
+
+ // Check palette offset, amiga views have no palette
+ if (READ_LE_UINT16(res->data + 6) != 0)
+ return kViewEga;
+
+ uint16 width = READ_LE_UINT16(res->data + offset);
+ offset += 2;
+ uint16 height = READ_LE_UINT16(res->data + offset);
+ offset += 6;
+
+ // Check that the RLE data stays within bounds
+ int y;
+ for (y = 0; y < height; y++) {
+ int x = 0;
+
+ while ((x < width) && (offset < res->size)) {
+ byte op = res->data[offset++];
+ x += (op & 0x07) ? op & 0x07 : op >> 3;
+ }
+
+ // Make sure we got exactly the right number of pixels for this row
+ if (x != width)
+ return kViewEga;
+ }
+
+ return kViewAmiga;
}
}
}
warning("Resmgr: Couldn't find any views");
- return kViewVga;
+ return kViewUnknown;
}
SciVersion ResourceManager::detectSciVersion() {
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 4250225ffe..5ba2d03beb 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -34,6 +34,8 @@
#include "sound/audiostream.h"
#include "sound/mixer.h" // for SoundHandle
+#include "gfx/gfx_resource.h" // for ViewType
+
#include "sci/decompressor.h"
namespace Common {
@@ -230,15 +232,10 @@ public:
kResVersionSci32
};
- // TODO: Amiga
- enum ViewType {
- kViewEga,
- kViewVga,
- kViewVga11
- };
-
bool isVGA() const { return (_viewType == kViewVga) || (_viewType == kViewVga11); }
+ ViewType getViewType() const { return _viewType; }
+
/**
* Returns the SCI version as detected by the resource manager
* @return SCI version
--
cgit v1.2.3
From 9dbc76c459f188bb29b6045bf940f5efe9143511 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Wed, 19 Aug 2009 21:09:10 +0000
Subject: SCI: Cleanup.
svn-id: r43548
---
engines/sci/gfx/gfx_resmgr.cpp | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 5619a896cf..14c094a409 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -530,28 +530,25 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
return NULL;
int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr);
-
- if (!_resManager->isVGA()) {
+ ViewType viewType = _resManager->getViewType();
+
+ if (viewType == kViewEga) {
int pal = (_version <= SCI_VERSION_01) ? -1 : palette;
view = getEGAView(resid, viewRes->data, viewRes->size, pal);
} else {
- if (_version < SCI_VERSION_1_1)
- view = getVGAView(resid, viewRes->data, viewRes->size, _staticPalette, false);
- else
- view = getVGAView(resid, viewRes->data, viewRes->size, 0, true);
-
- if (!view->palette) {
- view->palette = new Palette(_staticPalette->size());
- view->palette->name = "interpreter_get_view";
- }
-
- // Palettize view
- for (unsigned i = 0; i < MIN(view->palette->size(), _staticPalette->size()); i++) {
- const PaletteEntry& vc = view->palette->getColor(i);
- if (vc.r == 0 && vc.g == 0 && vc.b == 0) {
- const PaletteEntry& sc = _staticPalette->getColor(i);
- view->palette->setColor(i, sc.r, sc.g, sc.b);
+ view = getVGAView(resid, viewRes->data, viewRes->size, _staticPalette, viewType == kViewVga11);
+
+ if (view->palette) {
+ // Palettize view
+ for (unsigned i = 0; i < MIN(view->palette->size(), _staticPalette->size()); i++) {
+ const PaletteEntry& vc = view->palette->getColor(i);
+ if (vc.r == 0 && vc.g == 0 && vc.b == 0) {
+ const PaletteEntry& sc = _staticPalette->getColor(i);
+ view->palette->setColor(i, sc.r, sc.g, sc.b);
+ }
}
+ } else {
+ view->palette = _staticPalette->getref();
}
}
--
cgit v1.2.3
From c3462a8c76bdae8f6cd5c994441f658fe413d2d6 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Wed, 19 Aug 2009 21:10:24 +0000
Subject: SCI: Add partial support for Amiga SCI1 games.
svn-id: r43549
---
engines/sci/engine/game.cpp | 2 +-
engines/sci/gfx/gfx_resmgr.cpp | 6 +++---
engines/sci/gfx/gfx_resource.h | 8 ++++----
engines/sci/gfx/res_pic.cpp | 38 +++++++++++++++++++----------------
engines/sci/gfx/res_view.cpp | 45 +++++++++++++++++++-----------------------
5 files changed, 49 insertions(+), 50 deletions(-)
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index c34ac1cf00..f649d97412 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -43,7 +43,7 @@ int _reset_graphics_input(EngineState *s) {
gfx_color_t transparent = { PaletteEntry(), 0, -1, -1, 0 };
debug(2, "Initializing graphics");
- if (!s->resmgr->isVGA()) {
+ if (s->resmgr->getViewType() == kViewEga) {
for (int i = 0; i < 16; i++) {
if (gfxop_set_color(s->gfx_state, &(s->ega_colors[i]), gfx_sci0_image_colors[sci0_palette][i].r,
gfx_sci0_image_colors[sci0_palette][i].g, gfx_sci0_image_colors[sci0_palette][i].b, 0, -1, -1)) {
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 14c094a409..2fc50dcabc 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -100,7 +100,7 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
if (_version == SCI_VERSION_1_1)
gfxr_draw_pic11(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _staticPalette, _portBounds);
else
- gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resManager->isVGA(), _staticPalette, _portBounds);
+ gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resManager->getViewType(), _staticPalette, _portBounds);
}
if (scaled_pic && scaled_pic->undithered_buffer)
@@ -109,7 +109,7 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
if (_version == SCI_VERSION_1_1)
gfxr_draw_pic11(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _staticPalette, _portBounds);
else
- gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resManager->isVGA(), _staticPalette, _portBounds);
+ gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resManager->getViewType(), _staticPalette, _portBounds);
if (!_resManager->isVGA()) {
if (need_unscaled)
@@ -536,7 +536,7 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
int pal = (_version <= SCI_VERSION_01) ? -1 : palette;
view = getEGAView(resid, viewRes->data, viewRes->size, pal);
} else {
- view = getVGAView(resid, viewRes->data, viewRes->size, _staticPalette, viewType == kViewVga11);
+ view = getVGAView(resid, viewRes->data, viewRes->size, viewType);
if (view->palette) {
// Palettize view
diff --git a/engines/sci/gfx/gfx_resource.h b/engines/sci/gfx/gfx_resource.h
index 1e188118ad..35d7ef58d6 100644
--- a/engines/sci/gfx/gfx_resource.h
+++ b/engines/sci/gfx/gfx_resource.h
@@ -199,13 +199,13 @@ void gfxr_clear_pic0(gfxr_pic_t *pic, int titlebar_size);
* @param[in] resource Pointer to the resource data
* @param[in] style The drawing style
* @param[in] resid The resource ID
- * @param[in] sci1 true if SCI1, false otherwise
+ * @param[in] viewType The view type for embedded views
* @param[in] static_pal The static palette
* @param[in] portBounds The bounds of the port being drawn to
*/
void gfxr_draw_pic01(gfxr_pic_t *pic, int fill_normally,
int default_palette, int size, byte *resource,
- gfxr_pic0_params_t *style, int resid, int sci1,
+ gfxr_pic0_params_t *style, int resid, ViewType viewType,
Palette *static_pal, Common::Rect portBounds);
/**
@@ -321,9 +321,9 @@ Palette *gfxr_read_pal11(int id, byte *resource, int size);
* @param[in] isSci11 true if SCI1.1, false otherwise
* @return The resulting view
*/
-gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, bool isSci11);
+gfxr_view_t *getVGAView(int id, byte *resource, int size, ViewType viewType);
-gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, bool isAmiga, bool isSci11);
+gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, ViewType viewType);
/** @} */
} // End of namespace Sci
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index e7b34976b0..2534c7faf9 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -1135,7 +1135,7 @@ extern gfx_pixmap_t *gfxr_draw_cel0(int id, int loop, int cel, byte *resource, i
extern void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl, int bpp);
void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, byte *resource,
- gfxr_pic0_params_t *style, int resid, int sci1, Palette *static_pal, Common::Rect portBounds) {
+ gfxr_pic0_params_t *style, int resid, ViewType viewType, Palette *static_pal, Common::Rect portBounds) {
const int default_palette_table[GFXR_PIC0_PALETTE_SIZE] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x88,
@@ -1189,7 +1189,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
case PIC_OP_SET_COLOR:
p0printf("Set color @%d\n", pos);
- if (!sci1) {
+ if (viewType == kViewEga) {
pal = *(resource + pos++);
index = pal % GFXR_PIC0_PALETTE_SIZE;
pal /= GFXR_PIC0_PALETTE_SIZE;
@@ -1216,7 +1216,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
case PIC_OP_SET_PRIORITY:
p0printf("Set priority @%d\n", pos);
- if (!sci1) {
+ if (viewType == kViewEga) {
pal = *(resource + pos++);
index = pal % GFXR_PIC0_PALETTE_SIZE;
pal /= GFXR_PIC0_PALETTE_SIZE; // Ignore pal
@@ -1425,7 +1425,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
opx = *(resource + pos++);
p0printf("OPX: ");
- if (sci1)
+ if (viewType != kViewEga)
opx += SCI1_OP_OFFSET; // See comment at the definition of SCI1_OP_OFFSET.
switch (opx) {
@@ -1509,11 +1509,13 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
bytesize = (*(resource + pos)) + (*(resource + pos + 1) << 8);
p0printf("(%d, %d)\n", posx, posy);
pos += 2;
- if (!sci1 && !nodraw)
- view = gfxr_draw_cel0(-1, -1, -1, resource + pos, bytesize, NULL, flags & DRAWPIC1_FLAG_MIRRORED);
- else
- view = gfxr_draw_cel1(-1, -1, -1, flags & DRAWPIC1_FLAG_MIRRORED, resource + pos, resource + pos,
- bytesize, NULL, (static_pal && static_pal->size() == GFX_SCI1_AMIGA_COLORS_NR), false);
+ if (!nodraw) {
+ if (viewType == kViewEga)
+ view = gfxr_draw_cel0(-1, -1, -1, resource + pos, bytesize, NULL, flags & DRAWPIC1_FLAG_MIRRORED);
+ else
+ view = gfxr_draw_cel1(-1, -1, -1, flags & DRAWPIC1_FLAG_MIRRORED, resource + pos, resource + pos,
+ bytesize, NULL, viewType);
+ }
pos += bytesize;
if (nodraw)
continue;
@@ -1526,20 +1528,22 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
// we can only safely replace the palette if it's static
// *if it's not for some reason, we should die
- if (view->palette && view->palette->isShared() && !sci1) {
+ if (view->palette && view->palette->isShared() && (viewType == kViewEga)) {
warning("gfx_draw_pic0(): can't set a non-static palette for an embedded view");
}
// For SCI0, use special color mapping to copy the low
// nibble of the color index to the high nibble.
- if (sci1) {
- if (static_pal && static_pal->size() == GFX_SCI1_AMIGA_COLORS_NR) {
- // Assume Amiga game
+ if (viewType != kViewEga) {
+ if (view->palette)
+ view->palette->free();
+
+ if (viewType == kViewAmiga) {
pic->visual_map->palette = static_pal->getref();
+ } else {
+ view->palette = pic->visual_map->palette->copy();
}
- if (view->palette) view->palette->free();
- view->palette = pic->visual_map->palette->copy();
} else
view->palette = embedded_view_pal->getref();
@@ -1648,7 +1652,7 @@ void gfxr_draw_pic11(gfxr_pic_t *pic, int flags, int default_palette, int size,
pic->visual_map->palette = gfxr_read_pal11(-1, resource + palette_data_ptr, 1284);
if (has_bitmap)
- view = gfxr_draw_cel1(-1, 0, 0, flags & DRAWPIC1_FLAG_MIRRORED, resource, resource + bitmap_data_ptr, size - bitmap_data_ptr, NULL, 0, true);
+ view = gfxr_draw_cel1(-1, 0, 0, flags & DRAWPIC1_FLAG_MIRRORED, resource, resource + bitmap_data_ptr, size - bitmap_data_ptr, NULL, kViewVga11);
if (view) {
view->palette = pic->visual_map->palette->getref();
@@ -1677,7 +1681,7 @@ void gfxr_draw_pic11(gfxr_pic_t *pic, int flags, int default_palette, int size,
warning("[GFX] No view was contained in SCI1.1 pic resource");
}
- gfxr_draw_pic01(pic, flags, default_palette, size - vector_data_ptr, resource + vector_data_ptr, style, resid, 1, static_pal, portBounds);
+ gfxr_draw_pic01(pic, flags, default_palette, size - vector_data_ptr, resource + vector_data_ptr, style, resid, kViewVga11, static_pal, portBounds);
}
void gfxr_dither_pic0(gfxr_pic_t *pic, int dmode, int pattern) {
diff --git a/engines/sci/gfx/res_view.cpp b/engines/sci/gfx/res_view.cpp
index d484136f8e..95f6919b0c 100644
--- a/engines/sci/gfx/res_view.cpp
+++ b/engines/sci/gfx/res_view.cpp
@@ -326,19 +326,19 @@ static int decompress_sci_view_amiga(int id, int loop, int cel, byte *resource,
return 0;
}
-gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, bool isAmiga, bool isSci11) {
+gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, ViewType viewType) {
int xl = READ_LE_UINT16(cel_base);
int yl = READ_LE_UINT16(cel_base + 2);
int pixmap_size = xl * yl;
- int xdisplace = isSci11 ? READ_LE_UINT16(cel_base + 4) : (int8) cel_base[4];
- int ydisplace = isSci11 ? READ_LE_UINT16(cel_base + 6) : cel_base[5];
- int runlength_offset = isSci11 ? READ_LE_UINT16(cel_base + 24) : 8;
- int literal_offset = isSci11 ? READ_LE_UINT16(cel_base + 28) : 8;
+ int xdisplace = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 4) : (int8) cel_base[4];
+ int ydisplace = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 6) : cel_base[5];
+ int runlength_offset = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 24) : 8;
+ int literal_offset = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 28) : 8;
gfx_pixmap_t *retval = gfx_pixmap_alloc_index_data(gfx_new_pixmap(xl, yl, id, loop, cel));
byte *dest = retval->index_data;
int decompress_failed;
- retval->color_key = cel_base[isSci11 ? 8 : 6];
+ retval->color_key = cel_base[(viewType == kViewVga11) ? 8 : 6];
retval->xoffset = mirrored ? xdisplace : -xdisplace;
retval->yoffset = -ydisplace;
// FIXME: In LSL5, it seems that the inventory has views without palettes (or we don't load palettes properly)
@@ -350,12 +350,12 @@ gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *reso
return NULL;
}
- if (!isAmiga)
- decompress_failed = decompress_sci_view(id, loop, cel, resource, dest, mirrored, pixmap_size, size, runlength_offset,
- literal_offset, xl, yl, retval->color_key);
- else
+ if (viewType == kViewAmiga)
decompress_failed = decompress_sci_view_amiga(id, loop, cel, resource, dest, mirrored, pixmap_size, size, runlength_offset,
xl, yl, retval->color_key);
+ else
+ decompress_failed = decompress_sci_view(id, loop, cel, resource, dest, mirrored, pixmap_size, size, runlength_offset,
+ literal_offset, xl, yl, retval->color_key);
if (decompress_failed) {
gfx_free_pixmap(retval);
@@ -365,27 +365,22 @@ gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *reso
return retval;
}
-gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, bool isSci11) {
- uint16 palOffset = READ_LE_UINT16(resource + V1_PALETTE_OFFSET + (isSci11 ? 2 : 0));
- uint16 headerSize = isSci11 ? READ_LE_UINT16(resource + V2_HEADER_SIZE) : 0;
+gfxr_view_t *getVGAView(int id, byte *resource, int size, ViewType viewType) {
+ uint16 palOffset = READ_LE_UINT16(resource + V1_PALETTE_OFFSET + ((viewType == kViewVga11) ? 2 : 0));
+ uint16 headerSize = (viewType == kViewVga11) ? READ_LE_UINT16(resource + V2_HEADER_SIZE) : 0;
byte* seeker = resource + headerSize;
uint16 loopOffset = 0;
- int amiga_game = 0;
gfxr_view_t *view = (gfxr_view_t *)malloc(sizeof(gfxr_view_t));
view->ID = id;
view->flags = 0;
- view->loops_nr = READ_LE_UINT16(resource + V1_LOOPS_NR_OFFSET + (isSci11 ? 2 : 0)) & 0xFF;
+ view->loops_nr = READ_LE_UINT16(resource + V1_LOOPS_NR_OFFSET + ((viewType == kViewVga11) ? 2 : 0)) & 0xFF;
if (palOffset > 0) {
- if (!isSci11)
- view->palette = gfxr_read_pal1(id, resource + palOffset, size - palOffset);
- else
+ if (viewType == kViewVga11)
view->palette = gfxr_read_pal11(id, resource + palOffset, size - palOffset);
- } else if (static_pal && static_pal->size() == GFX_SCI1_AMIGA_COLORS_NR) {
- // Assume we're running an amiga game.
- amiga_game = 1;
- view->palette = static_pal->getref();
+ else
+ view->palette = gfxr_read_pal1(id, resource + palOffset, size - palOffset);
} else {
view->palette = NULL;
}
@@ -393,7 +388,7 @@ gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, b
view->loops = (gfxr_loop_t *)calloc(view->loops_nr, sizeof(gfxr_loop_t));
for (int i = 0; i < view->loops_nr; i++) {
- if (!isSci11) {
+ if (viewType != kViewVga11) {
bool mirrored = READ_LE_UINT16(resource + V1_MIRROR_MASK) & (1 << i);
loopOffset = READ_LE_UINT16(resource + V1_FIRST_LOOP_OFFSET + (i << 1));
view->loops[i].cels_nr = READ_LE_UINT16(resource + loopOffset);
@@ -405,7 +400,7 @@ gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, b
resource + cel_offset,
resource + cel_offset,
size - cel_offset,
- view, amiga_game, false);
+ view, viewType);
}
} else {
byte copy_entry = seeker[V2_COPY_OF_LOOP];
@@ -417,7 +412,7 @@ gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, b
byte* cellSeeker = resource + loopOffset;
for (int j = 0; j < view->loops[i].cels_nr; j++) {
- view->loops[i].cels[j] = gfxr_draw_cel1(id, i, j, mirrored, resource, cellSeeker, size, view, 0, true);
+ view->loops[i].cels[j] = gfxr_draw_cel1(id, i, j, mirrored, resource, cellSeeker, size, view, viewType);
cellSeeker += resource[V2_BYTES_PER_CEL];
}
--
cgit v1.2.3
From a2a6967a638dab875dc1596cfc92ec75f8d73e5e Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Wed, 19 Aug 2009 21:11:15 +0000
Subject: SCI: Don't dither in SCI.
svn-id: r43550
---
engines/sci/gfx/gfx_resmgr.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 2fc50dcabc..326cd2dfcf 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -111,7 +111,7 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
else
gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resManager->getViewType(), _staticPalette, _portBounds);
- if (!_resManager->isVGA()) {
+ if (_version <= SCI_VERSION_1_EGA) {
if (need_unscaled)
gfxr_remove_artifacts_pic0(scaled_pic, unscaled_pic);
--
cgit v1.2.3
From a8bffbe6a7137060bc6bf54da2cfd018bb777d74 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 20 Aug 2009 09:19:37 +0000
Subject: Partial implementation of feature request #2834637 "GUI: Allow
greying out dummy ListWidget entries", based on a slighly modified version of
my latest patch included there.
svn-id: r43551
---
gui/ListWidget.cpp | 39 +-
gui/ListWidget.h | 8 +-
gui/saveload.cpp | 11 +-
gui/themes/default.inc | 664 ++++++++++++++---------------
gui/themes/scummclassic.zip | Bin 53568 -> 53586 bytes
gui/themes/scummclassic/classic_gfx.stx | 8 +-
gui/themes/scummmodern.zip | Bin 158294 -> 158304 bytes
gui/themes/scummmodern/scummmodern_gfx.stx | 6 +-
8 files changed, 387 insertions(+), 349 deletions(-)
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 7551acac48..6f4fd25ee4 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -141,7 +141,7 @@ void ListWidget::setSelected(int item) {
}
}
-void ListWidget::setList(const StringList &list) {
+void ListWidget::setList(const StringList &list, const ColorList *colors) {
if (_editMode && _caretVisible)
drawCaret(true);
@@ -150,6 +150,12 @@ void ListWidget::setList(const StringList &list) {
_list = list;
_filter.clear();
_listIndex.clear();
+ _listColors.clear();
+
+ if (colors) {
+ _listColors = *colors;
+ assert(_listColors.size() == _dataList.size());
+ }
int size = list.size();
if (_currentPos >= size)
@@ -162,7 +168,19 @@ void ListWidget::setList(const StringList &list) {
scrollBarRecalc();
}
-void ListWidget::append(const String &s) {
+void ListWidget::append(const String &s, ThemeEngine::FontColor color) {
+ if (_dataList.size() == _listColors.size()) {
+ // If the color list has the size of the data list, we append the color.
+ _listColors.push_back(color);
+ } else if (!_listColors.size() && color != ThemeEngine::kFontColorNormal) {
+ // If it's the first entry to use a non default color, we will fill
+ // up all other entries of the color list with the default color and
+ // add the requested color for the new entry.
+ for (uint i = 0; i < _dataList.size(); ++i)
+ _listColors.push_back(ThemeEngine::kFontColorNormal);
+ _listColors.push_back(color);
+ }
+
_dataList.push_back(s);
_list.push_back(s);
@@ -431,17 +449,26 @@ void ListWidget::drawWidget() {
int width;
+ ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal;
+
+ if (!_listColors.empty()) {
+ if (_filter.empty() || _selectedItem == -1)
+ color = _listColors[pos];
+ else
+ color = _listColors[_listIndex[pos]];
+ }
+
if (_selectedItem == pos && _editMode) {
buffer = _editString;
adjustOffset();
width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
- g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2),
- buffer, _state, Graphics::kTextAlignLeft, inverted, pad, true);
+ g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
+ Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
} else {
buffer = _list[pos];
width = _w - r.left - scrollbarW;
- g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2),
- buffer, _state, Graphics::kTextAlignLeft, inverted, pad, true);
+ g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
+ Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
}
_textWidth[i] = width;
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index 203cd88fb6..1ee6a94e8a 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -28,6 +28,8 @@
#include "gui/editable.h"
#include "common/str.h"
+#include "gui/ThemeEngine.h"
+
namespace GUI {
class ScrollBarWidget;
@@ -51,9 +53,11 @@ class ListWidget : public EditableWidget {
public:
typedef Common::String String;
typedef Common::StringList StringList;
+ typedef Common::Array ColorList;
protected:
StringList _list;
StringList _dataList;
+ ColorList _listColors;
Common::Array _listIndex;
bool _editable;
bool _editMode;
@@ -87,8 +91,8 @@ public:
virtual Widget *findWidget(int x, int y);
- void setList(const StringList &list);
- void append(const String &s);
+ void setList(const StringList &list, const ColorList *colors = 0);
+ void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
const StringList &getList() const { return _dataList; }
int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
void setSelected(int item);
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index ce700c181e..dc1b1b4b45 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -316,6 +316,7 @@ void SaveLoadChooser::updateSaveList() {
int curSlot = 0;
int saveSlot = 0;
StringList saveNames;
+ ListWidget::ColorList colors;
for (SaveStateList::const_iterator x = _saveList.begin(); x != _saveList.end(); ++x) {
// Handle gaps in the list of save games
saveSlot = atoi(x->save_slot().c_str());
@@ -324,6 +325,7 @@ void SaveLoadChooser::updateSaveList() {
SaveStateDescriptor dummySave(curSlot, "");
_saveList.insert_at(curSlot, dummySave);
saveNames.push_back(dummySave.description());
+ colors.push_back(ThemeEngine::kFontColorNormal);
curSlot++;
}
@@ -338,8 +340,12 @@ void SaveLoadChooser::updateSaveList() {
Common::String description = x->description();
Common::String trimmedDescription = description;
trimmedDescription.trim();
- if (trimmedDescription.empty())
+ if (trimmedDescription.empty()) {
description = "Untitled savestate";
+ colors.push_back(ThemeEngine::kFontColorAlternate);
+ } else {
+ colors.push_back(ThemeEngine::kFontColorNormal);
+ }
saveNames.push_back(description);
curSlot++;
@@ -351,9 +357,10 @@ void SaveLoadChooser::updateSaveList() {
saveNames.push_back(emptyDesc);
SaveStateDescriptor dummySave(i, "");
_saveList.push_back(dummySave);
+ colors.push_back(ThemeEngine::kFontColorNormal);
}
- _list->setList(saveNames);
+ _list->setList(saveNames, &colors);
}
} // End of namespace GUI
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 88ef801af5..ed173e9395 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1,38 +1,41 @@
""
-" "
+" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
" "
" "
+" "
+" "
+" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
-" "
-" "
+" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
" "
" "
-" "
-" "
-" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
-" "
+" "
" "
" "
" "
@@ -839,37 +832,36 @@
" "
" "
" "
" "
" "
" "
" "
-" "
" "
" "
" "
" "
" "
" "
" "
" "
-" "
-" "
+" "
+" "
" "
@@ -877,7 +869,7 @@
"height='Globals.Line.Height' "
"/> "
" "
-" "
+" "
" "
@@ -891,10 +883,10 @@
" "
" "
" "
-" "
+" "
" "
" "
-" "
+" "
" "
" "
" "
" "
-" "
+" "
" "
@@ -915,7 +907,7 @@
"type='PopUp' "
"/> "
" "
-" "
+" "
" "
@@ -933,7 +925,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -941,7 +933,7 @@
"type='PopUp' "
"/> "
" "
-" "
+" "
" "
@@ -949,7 +941,7 @@
"type='PopUp' "
"/> "
" "
-" "
+" "
" "
@@ -957,16 +949,16 @@
"type='PopUp' "
"/> "
" "
-" "
+" "
" "
" "
" "
-" "
+" "
" "
@@ -980,9 +972,8 @@
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
" "
@@ -993,7 +984,7 @@
"type='SmallLabel' "
"/> "
" "
-" "
+" "
" "
@@ -1004,7 +995,7 @@
"type='SmallLabel' "
"/> "
" "
-" "
+" "
" "
@@ -1015,8 +1006,8 @@
"type='SmallLabel' "
"/> "
" "
-" "
-" "
+" "
+" "
" "
@@ -1025,7 +1016,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -1046,7 +1037,7 @@
" "
-" "
+" "
" "
@@ -1062,7 +1053,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -1070,7 +1061,7 @@
"height='Globals.Line.Height' "
"/> "
" "
-" "
+" "
" "
@@ -1078,7 +1069,7 @@
"height='Globals.Line.Height' "
"/> "
" "
-" "
+" "
" "
@@ -1098,7 +1089,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -1106,17 +1097,21 @@
"height='Globals.Line.Height' "
"/> "
" "
-" "
+" "
" "
" "
" "
-" "
+" "
" "
" "
" "
" "
-" "
+" "
" "
" "
-" "
+" "
" "
" "
" "
" "
-" "
+" "
" "
@@ -1174,7 +1169,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -1182,7 +1177,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -1190,7 +1185,7 @@
" "
" "
" "
-" "
+" "
" "
@@ -1198,34 +1193,43 @@
" "
" "
" "
-" "
-" "
+" "
+" "
" "
" "
" "
-" "
+" "
" "
" "
" "
-" "
+" "
+" "
" "
" "
" "
-" "
+" "
" "
" "
" "
" "
-" "
-" "
+" "
+" "
" "
@@ -1243,7 +1247,7 @@
"height='Globals.Line.Height' "
"/> "
" "
-" "
+" "
" "
@@ -1251,7 +1255,7 @@
"height='Globals.Line.Height' "
"/> "
" "
-" "
+" "
" "
@@ -1262,81 +1266,86 @@
" "
" "
" "
-" "
+" "
" "
" "
-" "
-" "
+" "
" "
" "
-" "
+" "
" "
" "
+" "
+" "
-" "
" "
" "
" "
" "
" "
" "
" "
-" "
+" "
" "
" "
-" "
+" "
" "
" "
" "
-" "
+" "
" "
" "
" "
" "
" "
-" "
-" "
-" "
+" "
" "
@@ -1347,7 +1356,7 @@
"type='SmallLabel' "
"/> "
" "
-" "
+" "
" "
@@ -1358,7 +1367,7 @@
"type='SmallLabel' "
"/> "
" "
-" "
+" "
" "
@@ -1369,25 +1378,24 @@
"type='SmallLabel' "
"/> "
" "
-" "
-" "
+" "
+" "
" "
" "
-" "
-" "
-" "
+" "
+" "
" "
" "
" "
-" "
+" "
" "
@@ -1398,8 +1406,8 @@
"type='SmallLabel' "
"/> "
" "
-" "
-" "
+" "
+" "
" "
@@ -1414,23 +1422,15 @@
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
" "
-" "
-" "
-" "
+" "
" "
" "
-" "
+" "
" "
@@ -1440,16 +1440,16 @@
" "
" "
" "
-" "
-" "
+" "
+" "
" "
" "
-" "
+" "
" "
@@ -1464,20 +1464,20 @@
" "
" "
" "
-" "
+" "
" "
" "
" "
-" "
+" "
" "
@@ -1488,20 +1488,20 @@
" "
" "
" "
-" "
+" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
"
setEditable(saveMode);
- _list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero);
-
-// Tanoku: SVNMerge removed this. Unconvinient. ///////////////
-// _container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
-///////////////////////////////////////////////////////////////
-
- _gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
-
- _date = new StaticTextWidget(this, 0, 0, 10, 10, "No date saved", kTextAlignCenter);
- _time = new StaticTextWidget(this, 0, 0, 10, 10, "No time saved", kTextAlignCenter);
- _playtime = new StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", kTextAlignCenter);
-
- // Buttons
- new GUI::ButtonWidget(this, "ScummSaveLoad.Cancel", "Cancel", kCloseCmd, 0);
- _chooseButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Choose", buttonLabel, kChooseCmd, 0);
- _chooseButton->setEnabled(false);
-
- _container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
-// _container->setHints(GUI::THEME_HINT_USE_SHADOW);
-}
-
-SaveLoadChooser::~SaveLoadChooser() {
-}
-
-const Common::String &SaveLoadChooser::getResultString() const {
- return _list->getSelectedString();
-}
-
-void SaveLoadChooser::setList(const StringList& list) {
- _list->setList(list);
-}
-
-int SaveLoadChooser::runModal() {
- if (_gfxWidget)
- _gfxWidget->setGfx(0);
- int ret = Dialog::runModal();
- return ret;
-}
-
-void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
- int selItem = _list->getSelected();
- switch (cmd) {
- case GUI::kListItemActivatedCmd:
- case GUI::kListItemDoubleClickedCmd:
- if (selItem >= 0) {
- if (_saveMode || !getResultString().empty()) {
- _list->endEditMode();
- setResult(selItem);
- close();
- }
- }
- break;
- case kChooseCmd:
- _list->endEditMode();
- setResult(selItem);
- close();
- break;
- case GUI::kListSelectionChangedCmd: {
- if (_gfxWidget) {
- updateInfos(true);
- }
-
- if (_saveMode) {
- _list->startEditMode();
- }
- // Disable button if nothing is selected, or (in load mode) if an empty
- // list item is selected. We allow choosing an empty item in save mode
- // because we then just assign a default name.
- _chooseButton->setEnabled(selItem >= 0 && (_saveMode || !getResultString().empty()));
- _chooseButton->draw();
- } break;
- case kCloseCmd:
- setResult(-1);
- default:
- Dialog::handleCommand(sender, cmd, data);
- }
-}
-
-void SaveLoadChooser::reflowLayout() {
- if (g_gui.xmlEval()->getVar("Globals.ScummSaveLoad.ExtInfo.Visible") == 1) {
- int16 x, y;
- uint16 w, h;
-
- if (!g_gui.xmlEval()->getWidgetData("ScummSaveLoad.Thumbnail", x, y, w, h))
- error("Error when loading position data for Save/Load Thumbnails.");
-
- int thumbW = kThumbnailWidth;
- int thumbH = ((g_system->getHeight() % 200 && g_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1);
- int thumbX = x + (w >> 1) - (thumbW >> 1);
- int thumbY = y + kLineHeight;
-
- _container->resize(x, y, w, h);
- _gfxWidget->resize(thumbX, thumbY, thumbW, thumbH);
-
- int height = thumbY + thumbH + kLineHeight;
-
- _date->resize(thumbX, height, kThumbnailWidth, kLineHeight);
-
- height += kLineHeight;
-
- _time->resize(thumbX, height, kThumbnailWidth, kLineHeight);
-
- height += kLineHeight;
-
- _playtime->resize(thumbX, height, kThumbnailWidth, kLineHeight);
-
- _container->setVisible(true);
- _gfxWidget->setVisible(true);
- _date->setVisible(true);
- _time->setVisible(true);
- _playtime->setVisible(true);
-
- _fillR = 0; //g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillR");
- _fillG = 0; //g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillG");
- _fillB = 0; //g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillB");
- } else {
- _container->setVisible(false);
- _gfxWidget->setVisible(false);
- _date->setVisible(false);
- _time->setVisible(false);
- _playtime->setVisible(false);
- }
-
- Dialog::reflowLayout();
-
- if (_container->isVisible())
- updateInfos(false);
-}
-
-void SaveLoadChooser::updateInfos(bool redraw) {
- int selItem = _list->getSelected();
- Graphics::Surface *thumb = 0;
- if (selItem >= 0 && !_list->getSelectedString().empty())
- thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem);
-
- if (thumb) {
- _gfxWidget->setGfx(thumb);
- _gfxWidget->useAlpha(256);
- thumb->free();
- delete thumb;
- } else {
- _gfxWidget->setGfx(-1, -1, _fillR, _fillG, _fillB);
- }
-
- InfoStuff infos;
- memset(&infos, 0, sizeof(InfoStuff));
- if (selItem >= 0 && !_list->getSelectedString().empty()
- && _vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) {
- char buffer[32];
- snprintf(buffer, 32, "Date: %.2d.%.2d.%.4d",
- (infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF,
- infos.date & 0xFFFF);
- _date->setLabel(buffer);
-
- snprintf(buffer, 32, "Time: %.2d:%.2d",
- (infos.time >> 8) & 0xFF, infos.time & 0xFF);
- _time->setLabel(buffer);
-
- int minutes = infos.playtime / 60;
- int hours = minutes / 60;
- minutes %= 60;
-
- snprintf(buffer, 32, "Playtime: %.2d:%.2d", hours, minutes);
- _playtime->setLabel(buffer);
- } else {
- _date->setLabel("No date saved");
- _time->setLabel("No time saved");
- _playtime->setLabel("No playtime saved");
- }
-
- if (redraw) {
- _gfxWidget->draw();
- _date->draw();
- _time->draw();
- _playtime->draw();
- }
-}
-
-#pragma mark -
-
-Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
- // Get savegame descriptions
- Common::StringList descriptions;
- uint i = saveMode ? 1 : 0; //the autosave is on slot #0
- bool avail_saves[81];
-
- scumm->listSavegames(avail_saves, ARRAYSIZE(avail_saves));
- for (; i < ARRAYSIZE(avail_saves); i++) {
- Common::String name;
- if (avail_saves[i])
- scumm->getSavegameName(i, name);
- descriptions.push_back(name);
- }
-
- return descriptions;
-}
-
ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm)
: ScummDialog("ScummMain"), _vm(scumm) {
@@ -457,8 +248,10 @@ ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm)
#ifndef DISABLE_HELP
_helpDialog = new HelpDialog(scumm->_game);
#endif
- _saveDialog = new SaveLoadChooser("Save game:", "Save", true, scumm);
- _loadDialog = new SaveLoadChooser("Load game:", "Load", false, scumm);
+ _saveDialog = new GUI::SaveLoadChooser("Save game:", "Save");
+ _saveDialog->setSaveMode(true);
+ _loadDialog = new GUI::SaveLoadChooser("Load game:", "Load");
+ _loadDialog->setSaveMode(false);
}
ScummMenuDialog::~ScummMenuDialog() {
@@ -513,28 +306,34 @@ void ScummMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
}
void ScummMenuDialog::save() {
- int idx;
- _saveDialog->setList(generateSavegameList(_vm, true));
- idx = _saveDialog->runModal();
+ Common::String gameId = ConfMan.get("gameid");
+
+ const EnginePlugin *plugin = 0;
+ EngineMan.findGame(gameId, &plugin);
+
+ int idx = _saveDialog->runModal(plugin, ConfMan.getActiveDomainName());
if (idx >= 0) {
String result(_saveDialog->getResultString());
char buffer[20];
const char *str;
if (result.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
- sprintf(buffer, "Save %d", idx + 1);
+ sprintf(buffer, "Save %d", idx);
str = buffer;
} else
str = result.c_str();
- _vm->requestSave(idx + 1, str);
+ _vm->requestSave(idx, str);
close();
}
}
void ScummMenuDialog::load() {
- int idx;
- _loadDialog->setList(generateSavegameList(_vm, false));
- idx = _loadDialog->runModal();
+ Common::String gameId = ConfMan.get("gameid");
+
+ const EnginePlugin *plugin = 0;
+ EngineMan.findGame(gameId, &plugin);
+
+ int idx = _loadDialog->runModal(plugin, ConfMan.getActiveDomainName());
if (idx >= 0) {
_vm->requestLoad(idx);
close();
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index 85b562ed67..644c028c5e 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -29,6 +29,7 @@
#include "gui/dialog.h"
#include "gui/options.h"
#include "gui/widget.h"
+#include "gui/saveload.h"
#include "scumm/detection.h"
#ifndef DISABLE_HELP
@@ -53,35 +54,6 @@ protected:
typedef Common::String String;
};
-class SaveLoadChooser : public GUI::Dialog {
- typedef Common::String String;
- typedef Common::StringList StringList;
-protected:
- bool _saveMode;
- GUI::ListWidget *_list;
- GUI::ButtonWidget *_chooseButton;
- GUI::GraphicsWidget *_gfxWidget;
- GUI::StaticTextWidget *_date;
- GUI::StaticTextWidget *_time;
- GUI::StaticTextWidget *_playtime;
- GUI::ContainerWidget *_container;
- ScummEngine *_vm;
-
- uint8 _fillR, _fillG, _fillB;
-
- void updateInfos(bool redraw);
-public:
- SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine);
- ~SaveLoadChooser();
-
- virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
- const String &getResultString() const;
- void setList(const StringList& list);
- int runModal();
-
- virtual void reflowLayout();
-};
-
class ScummMenuDialog : public ScummDialog {
public:
ScummMenuDialog(ScummEngine *scumm);
@@ -99,8 +71,8 @@ protected:
#ifndef DISABLE_HELP
GUI::Dialog *_helpDialog;
#endif
- SaveLoadChooser *_saveDialog;
- SaveLoadChooser *_loadDialog;
+ GUI::SaveLoadChooser *_saveDialog;
+ GUI::SaveLoadChooser *_loadDialog;
GUI::ButtonWidget *_saveButton;
--
cgit v1.2.3
From 7c77e2b03a29f8d11ff0a48e4da02ab697334f1e Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 20 Aug 2009 09:23:31 +0000
Subject: Renamed ScummSaveLoad GUI dialog config entry to SaveLoadChooser.
(Also bumped theme version along with it)
svn-id: r43553
---
gui/ThemeEngine.h | 2 +-
gui/saveload.cpp | 16 +-
gui/themes/default.inc | 2626 ++++++++++----------
gui/themes/scummclassic.zip | Bin 53586 -> 53594 bytes
gui/themes/scummclassic/THEMERC | 2 +-
gui/themes/scummclassic/classic_layout.stx | 4 +-
gui/themes/scummclassic/classic_layout_lowres.stx | 4 +-
gui/themes/scummmodern.zip | Bin 158304 -> 158312 bytes
gui/themes/scummmodern/THEMERC | 2 +-
gui/themes/scummmodern/scummmodern_layout.stx | 4 +-
.../scummmodern/scummmodern_layout_lowres.stx | 4 +-
11 files changed, 1332 insertions(+), 1332 deletions(-)
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index cab5f9fd41..dfa27c2c88 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -32,7 +32,7 @@
#include "graphics/surface.h"
#include "graphics/fontman.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.7"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8"
namespace Graphics {
struct DrawStep;
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index dc1b1b4b45..381abcdc83 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -42,15 +42,15 @@ enum {
};
SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
- : Dialog("ScummSaveLoad"), _delSupport(0), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
+ : Dialog("SaveLoadChooser"), _delSupport(0), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
_delSupport = _metaInfoSupport = _thumbnailSupport = _saveDateSupport = _playTimeSupport = false;
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
- new StaticTextWidget(this, "ScummSaveLoad.Title", title);
+ new StaticTextWidget(this, "SaveLoadChooser.Title", title);
// Add choice list
- _list = new GUI::ListWidget(this, "ScummSaveLoad.List");
+ _list = new GUI::ListWidget(this, "SaveLoadChooser.List");
_list->setNumberingMode(GUI::kListNumberingZero);
setSaveMode(false);
@@ -61,11 +61,11 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
_playtime = new StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", Graphics::kTextAlignCenter);
// Buttons
- new GUI::ButtonWidget(this, "ScummSaveLoad.Cancel", "Cancel", kCloseCmd, 0);
- _chooseButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Choose", buttonLabel, kChooseCmd, 0);
+ new GUI::ButtonWidget(this, "SaveLoadChooser.Cancel", "Cancel", kCloseCmd, 0);
+ _chooseButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Choose", buttonLabel, kChooseCmd, 0);
_chooseButton->setEnabled(false);
- _deleteButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Delete", "Delete", kDelCmd, 0);
+ _deleteButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Delete", "Delete", kDelCmd, 0);
_deleteButton->setEnabled(false);
_delSupport = _metaInfoSupport = _thumbnailSupport = false;
@@ -172,11 +172,11 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
}
void SaveLoadChooser::reflowLayout() {
- if (g_gui.xmlEval()->getVar("Globals.ScummSaveLoad.ExtInfo.Visible") == 1 && _thumbnailSupport) {
+ if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 1 && _thumbnailSupport) {
int16 x, y;
uint16 w, h;
- if (!g_gui.xmlEval()->getWidgetData("ScummSaveLoad.Thumbnail", x, y, w, h))
+ if (!g_gui.xmlEval()->getWidgetData("SaveLoadChooser.Thumbnail", x, y, w, h))
error("Error when loading position data for Save/Load Thumbnails.");
int thumbW = kThumbnailWidth;
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index ed173e9395..d088f4181d 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1,403 +1,495 @@
""
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
+" "
+" "
" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
" "
-" "
+" "
+" "
+" "
+" "
" "
+" "
" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
" "
" "
-" "
" "
" "
" "
-" "
-" "
+" "
+" "
" "
-" "
+" "
" "
" "
" "
" "
-" "
+" "
" "
-" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
" "
-" "
-" "
+" "
-" "
" "
-" "
-" "
+" "
-" "
" "
-" "
-" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
" "
" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
" "
@@ -590,7 +587,7 @@
"type='SmallLabel' "
"/> "
" "
-" "
+" "
" "
@@ -601,7 +598,7 @@
"type='SmallLabel' "
"/> "
" "
-" "
+" "
" "
@@ -612,373 +609,351 @@
"type='SmallLabel' "
"/> "
" "
-" "
-" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
+" "
" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
+" "
" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
+" "
" "
-" "
" "
-" "
+" "
" "
-" "
-" "
+" "
-" "
-" "
+" "
+" "
-" "
+" "
-" "
-" "
" "
" "
" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
" "
-" "
+" "
-" "
" "
" "
" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
" "
-" "
-" "
+" "
+" "
+" "
+" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
" "
-" "
" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
" "
-" "
" "
-" "
-" "
+" "
+" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
+" "
" "
+" "
" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
" "
-" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
+" "
-" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
" "
+" "
" "
-" "
+" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
" "
+" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
" "
-" "
-" "
+" "
-" "
-" "
+" "
+" "
" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
" "
-" "
-" "
-" "
+" "
+" "
" "
-" "
-" "
+" "
" "
" "
" "
-" "
+" "
" "
@@ -1406,462 +1333,535 @@
"type='SmallLabel' "
"/> "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
" "
+" "
+" "
+" "
+" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
" "
-" "
-" "
-" "
-" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
+" "
+" "
" "
-" "
+" "
+" "
+" "
+" "
-" "
" "
-" "
+" "
-" "
+" "
+" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
-" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index e9b0ee05a2..7009b217af 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 524141faf2..c913ff6078 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.7:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 029c7479ac..40074640c8 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -35,7 +35,7 @@
-
+
@@ -710,7 +710,7 @@
-
+
-
+
@@ -723,7 +723,7 @@
-
+
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index cc860cb599..b24e888316 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 784f4fae50..34495f71fa 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.7:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 6582022fe1..33e0537a3c 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -42,7 +42,7 @@
-
+
@@ -723,7 +723,7 @@
-
+
-
+
-
+
--
cgit v1.2.3
From 8b0a10ad75e585ca7b5cae79467c6faf0bcc1917 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 20 Aug 2009 09:24:22 +0000
Subject: Cleanup.
svn-id: r43554
---
engines/scumm/scumm.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index bfb188f1c7..f2eb331a14 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -667,9 +667,6 @@ public:
}
static Graphics::Surface *loadThumbnailFromSlot(const char *target, int slot);
- bool loadInfosFromSlot(int slot, InfoStuff *stuff) {
- return loadInfosFromSlot(_targetName.c_str(), slot, stuff);
- }
static bool loadInfosFromSlot(const char *target, int slot, InfoStuff *stuff);
protected:
--
cgit v1.2.3
From f898cd12e664af159e2d337fb8c8a0f9f976e1d9 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 20 Aug 2009 10:04:21 +0000
Subject: Implement automatic clearing of "Untitled Savestate" in edit mode of
the SaveLoadChooser as requested in feature request #2834637 "GUI: Allow
greying out dummy ListWidget entries".
svn-id: r43555
---
gui/ListWidget.cpp | 20 ++++++++++++++++++++
gui/ListWidget.h | 7 ++++++-
gui/saveload.cpp | 9 ++++++++-
3 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 6f4fd25ee4..195256b66f 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -64,6 +64,7 @@ ListWidget::ListWidget(GuiObject *boss, const String &name, uint32 cmd)
_editable = true;
_quickSelect = true;
+ _editColor = ThemeEngine::kFontColorNormal;
}
ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd)
@@ -141,6 +142,16 @@ void ListWidget::setSelected(int item) {
}
}
+ThemeEngine::FontColor ListWidget::getSelectionColor() const {
+ if (_listColors.empty())
+ return ThemeEngine::kFontColorNormal;
+
+ if (_filter.empty())
+ return _listColors[_selectedItem];
+ else
+ return _listColors[_listIndex[_selectedItem]];
+}
+
void ListWidget::setList(const StringList &list, const ColorList *colors) {
if (_editMode && _caretVisible)
drawCaret(true);
@@ -460,6 +471,7 @@ void ListWidget::drawWidget() {
if (_selectedItem == pos && _editMode) {
buffer = _editString;
+ color = _editColor;
adjustOffset();
width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
@@ -526,6 +538,14 @@ void ListWidget::startEditMode() {
if (_editable && !_editMode && _selectedItem >= 0) {
_editMode = true;
setEditString(_list[_selectedItem]);
+ if (_listColors.empty()) {
+ _editColor = ThemeEngine::kFontColorNormal;
+ } else {
+ if (_filter.empty())
+ _editColor = _listColors[_selectedItem];
+ else
+ _editColor = _listColors[_listIndex[_selectedItem]];
+ }
draw();
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
}
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index 1ee6a94e8a..c4fab9bd17 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -84,6 +84,8 @@ protected:
uint32 _cmd;
+ ThemeEngine::FontColor _editColor;
+
public:
ListWidget(GuiObject *boss, const String &name, uint32 cmd = 0);
ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd = 0);
@@ -97,6 +99,7 @@ public:
int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
void setSelected(int item);
const String &getSelectedString() const { return _list[_selectedItem]; }
+ ThemeEngine::FontColor getSelectionColor() const;
void setNumberingMode(NumberingMode numberingMode) { _numberingMode = numberingMode; }
bool isEditable() const { return _editable; }
void setEditable(bool editable) { _editable = editable; }
@@ -105,6 +108,8 @@ public:
void enableQuickSelect(bool enable) { _quickSelect = enable; }
String getQuickSelectString() const { return _quickSelectStr; }
+ void setEditColor(ThemeEngine::FontColor color) { _editColor = color; }
+
void setFilter(const String &filter, bool redraw = true);
virtual void handleTickle();
@@ -119,7 +124,7 @@ public:
virtual bool wantsFocus() { return true; }
- // Made startEditMode for SCUMM's SaveLoadChooser
+ // Made startEditMode for SaveLoadChooser
void startEditMode();
void endEditMode();
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index 381abcdc83..058911d43f 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -278,8 +278,15 @@ void SaveLoadChooser::updateSelection(bool redraw) {
// game is write protected
_chooseButton->setEnabled(selItem >= 0 && !isWriteProtected);
- if (startEditMode)
+ if (startEditMode) {
_list->startEditMode();
+
+ if (_chooseButton->isEnabled() && _list->getSelectedString() == "Untitled savestate" &&
+ _list->getSelectionColor() == ThemeEngine::kFontColorAlternate) {
+ _list->setEditString("");
+ _list->setEditColor(ThemeEngine::kFontColorNormal);
+ }
+ }
} else {
// Disable the load button if nothing is selected, or if an empty
// list item is selected.
--
cgit v1.2.3
From b22ec9b4b60e1bd21df5a0283a15a5ae7f322244 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 20 Aug 2009 10:05:00 +0000
Subject: Cleanup.
svn-id: r43556
---
gui/ListWidget.h | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index c4fab9bd17..23c12a38fc 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -94,22 +94,32 @@ public:
virtual Widget *findWidget(int x, int y);
void setList(const StringList &list, const ColorList *colors = 0);
- void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
const StringList &getList() const { return _dataList; }
- int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
+
+ void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
+
void setSelected(int item);
+ int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
+
const String &getSelectedString() const { return _list[_selectedItem]; }
ThemeEngine::FontColor getSelectionColor() const;
+
void setNumberingMode(NumberingMode numberingMode) { _numberingMode = numberingMode; }
- bool isEditable() const { return _editable; }
- void setEditable(bool editable) { _editable = editable; }
+
void scrollTo(int item);
void scrollToEnd();
+
void enableQuickSelect(bool enable) { _quickSelect = enable; }
String getQuickSelectString() const { return _quickSelectStr; }
+ bool isEditable() const { return _editable; }
+ void setEditable(bool editable) { _editable = editable; }
void setEditColor(ThemeEngine::FontColor color) { _editColor = color; }
+ // Made startEditMode/endEditMode for SaveLoadChooser
+ void startEditMode();
+ void endEditMode();
+
void setFilter(const String &filter, bool redraw = true);
virtual void handleTickle();
@@ -124,10 +134,6 @@ public:
virtual bool wantsFocus() { return true; }
- // Made startEditMode for SaveLoadChooser
- void startEditMode();
- void endEditMode();
-
protected:
void drawWidget();
--
cgit v1.2.3
From 644ba1ceab478d27df933e65a38fab82fed7abbb Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Thu, 20 Aug 2009 12:04:31 +0000
Subject: Bugfix for assert in the DW2 Cartwheel scene
svn-id: r43558
---
engines/tinsel/polygons.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index bb2daea206..825abc9a6b 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -1996,8 +1996,14 @@ void GetPolyNode(HPOLYGON hp, int *pNodeX, int *pNodeY) {
Poly pp(LockMem(pHandle), Polys[hp]->pIndex);
- *pNodeX = FROM_LE_32(pp.nodex);
- *pNodeY = FROM_LE_32(pp.nodey);
+ // WORKAROUND: Invalid node adjustment for DW2 Cartwheel scene refer polygon
+ if (TinselV2 && (pHandle == 0x74191900) && (hp == 8)) {
+ *pNodeX = 480;
+ *pNodeY = 408;
+ } else {
+ *pNodeX = FROM_LE_32(pp.nodex);
+ *pNodeY = FROM_LE_32(pp.nodey);
+ }
if (TinselV2) {
*pNodeX += volatileStuff[hp].xoff;
--
cgit v1.2.3
From 50d515c3dfc7bd9615737795357022e5509dd890 Mon Sep 17 00:00:00 2001
From: Arnaud Boutonné
Date: Thu, 20 Aug 2009 12:30:37 +0000
Subject: modify props size to avoid later error (Size is still temporary) and
prepare the magic number => constant modification
svn-id: r43560
---
engines/gob/save/saveload_playtoons.cpp | 42 ++++++++++-----------------------
1 file changed, 12 insertions(+), 30 deletions(-)
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
index 392c9a94ac..6b1f291c78 100644
--- a/engines/gob/save/saveload_playtoons.cpp
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -31,26 +31,8 @@ namespace Gob {
SaveLoad_Playtoons::SaveFile SaveLoad_Playtoons::_saveFiles[] = {
{ "did.inf", kSaveModeSave, 0, 0}, //
- { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK initial detection file
- { "disk.001", kSaveModeExists, 0, 0}, // Playtoons 1 identification file
- { "disk.002", kSaveModeExists, 0, 0}, // Playtoons 2 identification file
- { "disk.003", kSaveModeExists, 0, 0}, // Playtoons 3 identification file
- { "disk.004", kSaveModeExists, 0, 0}, // Playtoons 4 identification file
- { "disk.005", kSaveModeExists, 0, 0}, // Playtoons 5 identification file
- { "disk.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 identification file
- { "disk.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 identification file
- { "disk.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 identification file
-/*
- { "titre.001", kSaveModeExists, 0, 0}, // Playtoons 1 titles
- { "titre.002", kSaveModeExists, 0, 0}, // Playtoons 2 titles
- { "titre.003", kSaveModeExists, 0, 0}, // Playtoons 3 titles
- { "titre.004", kSaveModeExists, 0, 0}, // Playtoons 4 titles
- { "titre.005", kSaveModeExists, 0, 0}, // Playtoons 5 titles
- { "titre.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 empty title (???)
- { "titre.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 empty title (???)
- { "titre.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 empty title (???)
- { "mdo.def", kSaveModeExists, 0, 0}, //
-*/
+ { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK detection file
+
};
SaveLoad_Playtoons::GameHandler::File::File(GobEngine *vm, const char *base) :
@@ -66,7 +48,7 @@ int SaveLoad_Playtoons::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 2900) / varSize);
+ return ((offset - (1642 + 2400)) / varSize);
}
int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -75,12 +57,12 @@ int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const
if (varSize == 0)
return -1;
- return ((offset - 2900) % varSize);
+ return ((offset - (1642 + 2400)) % varSize);
}
SaveLoad_Playtoons::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_props, 0, 500);
+ memset(_props, 0, 1642);
memset(_index, 0, 2400);
_slotFile = new File(vm, target);
@@ -96,7 +78,7 @@ int32 SaveLoad_Playtoons::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 2900);
+ return _slotFile->tallyUpFiles(varSize, 1642 + 2400);
}
bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -111,17 +93,17 @@ bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < 500) {
+ if (offset < 1642) {
// Properties
- if ((offset + size) > 500) {
+ if ((offset + size) > 1642) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (offset < 1642 + 2400) {
// Save index
if (size != 2400) {
@@ -198,17 +180,17 @@ bool SaveLoad_Playtoons::GameHandler::save(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < 500) {
+ if (offset < 1642) {
// Properties
- if ((offset + size) > 500) {
+ if ((offset + size) > 1642) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (offset < 1642 + 2400) {
// Save index
if (size != 2400) {
--
cgit v1.2.3
From afabd2706b98253732f21227a99fdf42576ec289 Mon Sep 17 00:00:00 2001
From: Arnaud Boutonné
Date: Thu, 20 Aug 2009 12:32:59 +0000
Subject: Add oPlaytoons_F_1B skeletton, and oPlaytoons_readData to avoid
adding a playtoons workaround in inter_v2.
svn-id: r43561
---
engines/gob/inter.h | 2 +
engines/gob/inter_playtoons.cpp | 118 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 117 insertions(+), 3 deletions(-)
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 057f52b360..43a4941402 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -557,7 +557,9 @@ protected:
virtual void setupOpcodesFunc();
virtual void setupOpcodesGob();
+ bool oPlaytoons_F_1B(OpFuncParams ¶ms);
bool oPlaytoons_checkData(OpFuncParams ¶ms);
+ bool oPlaytoons_readData(OpFuncParams ¶ms);
void oPlaytoons_CD_20_23();
void oPlaytoons_CD_25();
void oPlaytoons_openItk();
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index e224f29734..d7cb6b79c2 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -25,6 +25,8 @@
#include "common/endian.h"
+#include "gui/message.h"
+
#include "gob/gob.h"
#include "gob/inter.h"
#include "gob/helper.h"
@@ -77,12 +79,33 @@ void Inter_Playtoons::setupOpcodesDraw() {
void Inter_Playtoons::setupOpcodesFunc() {
Inter_v6::setupOpcodesFunc();
+ OPCODEFUNC(0x1B, oPlaytoons_F_1B);
OPCODEFUNC(0x3F, oPlaytoons_checkData);
+ OPCODEFUNC(0x4D, oPlaytoons_readData);
}
void Inter_Playtoons::setupOpcodesGob() {
}
+bool Inter_Playtoons::oPlaytoons_F_1B(OpFuncParams ¶ms) {
+ int16 var1;
+ int16 var2;
+ int16 var3;
+ int16 var4;
+
+ var1 = _vm->_game->_script->readValExpr();
+ var2 = _vm->_game->_script->readValExpr();
+
+ _vm->_game->_script->evalExpr(0);
+
+ var3 = _vm->_game->_script->readValExpr();
+ var4 = _vm->_game->_script->readValExpr();
+
+ warning("oPlaytoons_F_1B not handled");
+
+ return false;
+}
+
bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) {
int16 handle;
int16 varOff;
@@ -101,18 +124,16 @@ bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) {
// In this case, "@:\" is replaced by the CD drive letter.
// As the files are copied on the HDD, those characters are skipped.
if (strncmp(file, "@:\\", 3) == 0) {
- debugC(2, kDebugFileIO, "File check: \"%s\" instead of \"%s\"", file + 3, file);
+ debugC(2, kDebugFileIO, "oPlaytoons_checkData: \"%s\" instead of \"%s\"", file + 3, file);
file += 3;
}
mode = _vm->_saveLoad->getSaveMode(file);
if (mode == SaveLoad::kSaveModeNone) {
-
if (_vm->_dataIO->existData(file))
size = _vm->_dataIO->getDataSize(file);
else
warning("File \"%s\" not found", file);
-
} else if (mode == SaveLoad::kSaveModeSave)
size = _vm->_saveLoad->getSize(file);
else if (mode == SaveLoad::kSaveModeExists)
@@ -130,6 +151,97 @@ bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) {
return false;
}
+bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) {
+ int32 retSize;
+ int32 size;
+ int32 offset;
+ int16 dataVar;
+ int16 handle;
+ byte *buf;
+ SaveLoad::SaveMode mode;
+
+ _vm->_game->_script->evalExpr(0);
+ dataVar = _vm->_game->_script->readVarIndex();
+ size = _vm->_game->_script->readValExpr();
+ _vm->_game->_script->evalExpr(0);
+ offset = _vm->_game->_script->getResultInt();
+ retSize = 0;
+
+ char *file = _vm->_game->_script->getResultStr();
+
+ // WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
+ // In this case, "@:\" is replaced by the CD drive letter.
+ // As the files are copied on the HDD, those characters are skipped.
+ if (strncmp(file, "@:\\", 3) == 0) {
+ debugC(2, kDebugFileIO, "oPlaytoons_readData: \"%s\" instead of \"%s\"", file + 3, file);
+ file += 3;
+ }
+
+ debugC(2, kDebugFileIO, "Read from file \"%s\" (%d, %d bytes at %d)",
+ file, dataVar, size, offset);
+
+ mode = _vm->_saveLoad->getSaveMode(file);
+ if (mode == SaveLoad::kSaveModeSave) {
+
+ WRITE_VAR(1, 1);
+
+ if (!_vm->_saveLoad->load(file, dataVar, size, offset)) {
+ GUI::MessageDialog dialog("Failed to load game state from file.");
+ dialog.runModal();
+ } else
+ WRITE_VAR(1, 0);
+
+ return false;
+
+ } else if (mode == SaveLoad::kSaveModeIgnore)
+ return false;
+
+ if (size < 0) {
+ warning("Attempted to read a raw sprite from file \"%s\"",
+ file);
+ return false ;
+ } else if (size == 0) {
+ dataVar = 0;
+ size = _vm->_game->_script->getVariablesCount() * 4;
+ }
+
+ buf = _variables->getAddressOff8(dataVar);
+
+ if (file[0] == 0) {
+ WRITE_VAR(1, size);
+ return false;
+ }
+
+ WRITE_VAR(1, 1);
+ handle = _vm->_dataIO->openData(file);
+
+ if (handle < 0)
+ return false;
+
+ DataStream *stream = _vm->_dataIO->openAsStream(handle, true);
+
+ _vm->_draw->animateCursor(4);
+ if (offset < 0)
+ stream->seek(offset + 1, SEEK_END);
+ else
+ stream->seek(offset);
+
+ if (((dataVar >> 2) == 59) && (size == 4)) {
+ WRITE_VAR(59, stream->readUint32LE());
+ // The scripts in some versions divide through 256^3 then,
+ // effectively doing a LE->BE conversion
+ if ((_vm->getPlatform() != Common::kPlatformPC) && (VAR(59) < 256))
+ WRITE_VAR(59, SWAP_BYTES_32(VAR(59)));
+ } else
+ retSize = stream->read(buf, size);
+
+ if (retSize == size)
+ WRITE_VAR(1, 0);
+
+ delete stream;
+ return false;
+}
+
void Inter_Playtoons::oPlaytoons_CD_20_23() {
_vm->_game->_script->evalExpr(0);
}
--
cgit v1.2.3
From e350e0b0204860db31f5c5586f443eff3e52b160 Mon Sep 17 00:00:00 2001
From: Arnaud Boutonné
Date: Thu, 20 Aug 2009 13:36:18 +0000
Subject: Replace magic numbers by constants : kPropsSize and kIndexSize
svn-id: r43562
---
engines/gob/save/saveload.h | 42 ++++++++++++++++++++++-----------
engines/gob/save/saveload_playtoons.cpp | 28 +++++++++++-----------
engines/gob/save/saveload_v2.cpp | 14 +++++------
engines/gob/save/saveload_v3.cpp | 28 +++++++++++-----------
engines/gob/save/saveload_v4.cpp | 28 +++++++++++-----------
engines/gob/save/saveload_v6.cpp | 28 +++++++++++-----------
6 files changed, 91 insertions(+), 77 deletions(-)
diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h
index 4779de703c..8a7d493aed 100644
--- a/engines/gob/save/saveload.h
+++ b/engines/gob/save/saveload.h
@@ -77,6 +77,9 @@ public:
static const uint32 kSlotCount = 15;
static const uint32 kSlotNameLength = 40;
+ /** The index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_v2(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v2();
@@ -111,8 +114,7 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- /** The index. kSlotCount * kSlotNameLength bytes. */
- byte _index[600];
+ byte _index[kIndexSize];
bool _hasIndex;
File *_slotFile;
@@ -139,6 +141,10 @@ public:
static const uint32 kSlotCount = 30;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
enum ScreenshotType {
kScreenshotTypeGob3, //!< Goblins 3 type screenshot
kScreenshotTypeLost //!< Lost in Time type screenshot
@@ -193,9 +199,8 @@ protected:
bool _firstSize;
/** Global properties. */
- byte _props[500];
- /** Index. kSlotCount * kSlotNameLength bytes. */
- byte _index[1200];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
bool _hasIndex;
SaveReader *_reader;
@@ -266,6 +271,10 @@ public:
static const uint32 kSlotCount = 10;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes + 800 bytes 0. */
+ static const uint32 kIndexSize = (kSlotCount * kSlotNameLength) + 800;
+
SaveLoad_v4(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v4();
@@ -311,9 +320,8 @@ protected:
private:
bool _firstSize;
- byte _props[500];
- /** The index. kSlotCount * kSlotNameLength bytes + 800 bytes 0. */
- byte _index[1200];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
bool _hasIndex;
File *_slotFile;
@@ -392,6 +400,10 @@ public:
static const uint32 kSlotCount = 60;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_v6(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v6();
@@ -426,9 +438,8 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- byte _props[500];
- /** The index. 500 bytes properties + kSlotCount * kSlotNameLength bytes. */
- byte _index[2400];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
File *_slotFile;
@@ -454,6 +465,10 @@ public:
static const uint32 kSlotCount = 60;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 1642;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_Playtoons(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_Playtoons();
@@ -488,9 +503,8 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- byte _props[500];
- /** The index. 500 bytes properties + kSlotCount * kSlotNameLength bytes. */
- byte _index[2400];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
File *_slotFile;
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
index 6b1f291c78..f1140887de 100644
--- a/engines/gob/save/saveload_playtoons.cpp
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -48,7 +48,7 @@ int SaveLoad_Playtoons::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - (1642 + 2400)) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -57,13 +57,13 @@ int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const
if (varSize == 0)
return -1;
- return ((offset - (1642 + 2400)) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
SaveLoad_Playtoons::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_props, 0, 1642);
- memset(_index, 0, 2400);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_slotFile = new File(vm, target);
}
@@ -78,7 +78,7 @@ int32 SaveLoad_Playtoons::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 1642 + 2400);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -93,20 +93,20 @@ bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < 1642) {
+ if (offset < kPropsSize) {
// Properties
- if ((offset + size) > 1642) {
+ if ((offset + size) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < 1642 + 2400) {
+ } else if (offset < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (size != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -180,26 +180,26 @@ bool SaveLoad_Playtoons::GameHandler::save(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < 1642) {
+ if (offset < kPropsSize) {
// Properties
- if ((offset + size) > 1642) {
+ if ((offset + size) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset < 1642 + 2400) {
+ } else if (offset < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (size != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 2400);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
} else {
// Save slot, whole variable block
diff --git a/engines/gob/save/saveload_v2.cpp b/engines/gob/save/saveload_v2.cpp
index da1135df21..8449345336 100644
--- a/engines/gob/save/saveload_v2.cpp
+++ b/engines/gob/save/saveload_v2.cpp
@@ -51,7 +51,7 @@ int SaveLoad_v2::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 600) / varSize);
+ return ((offset - kIndexSize) / varSize);
}
int SaveLoad_v2::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -60,12 +60,12 @@ int SaveLoad_v2::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 600) % varSize);
+ return ((offset - kIndexSize) % varSize);
}
SaveLoad_v2::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_index, 0, 600);
+ memset(_index, 0, kIndexSize);
_hasIndex = false;
_slotFile = new File(vm, target);
@@ -81,7 +81,7 @@ int32 SaveLoad_v2::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 600);
+ return _slotFile->tallyUpFiles(varSize, kIndexSize);
}
bool SaveLoad_v2::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -99,7 +99,7 @@ bool SaveLoad_v2::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
if (offset == 0) {
// Save index
- if (size != 600) {
+ if (size != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -184,13 +184,13 @@ bool SaveLoad_v2::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
if (offset == 0) {
// Save index
- if (size != 600) {
+ if (size != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 600);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
_hasIndex = true;
} else {
diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp
index c24b13d27b..510ca622b8 100644
--- a/engines/gob/save/saveload_v3.cpp
+++ b/engines/gob/save/saveload_v3.cpp
@@ -57,7 +57,7 @@ int SaveLoad_v3::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_v3::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -66,7 +66,7 @@ int SaveLoad_v3::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
@@ -78,8 +78,8 @@ SaveLoad_v3::GameHandler::GameHandler(GobEngine *vm, const char *target,
_usesScreenshots = usesScreenshots;
_firstSize = true;
- memset(_props, 0, 500);
- memset(_index, 0, 1200);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_hasIndex = false;
_writer = 0;
@@ -104,7 +104,7 @@ int32 SaveLoad_v3::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 1700);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_v3::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -119,22 +119,22 @@ bool SaveLoad_v3::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (offset < kPropsSize) {
// Global properties, like joker usage
debugC(3, kDebugSaveLoad, "Loading global properties");
- if ((size + offset) > 500) {
+ if ((size + offset) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (offset == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (size != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -193,28 +193,28 @@ bool SaveLoad_v3::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (offset < kPropsSize) {
// Global properties, like joker usage
debugC(3, kDebugSaveLoad, "Saving global properties");
- if ((size + offset) > 500) {
+ if ((size + offset) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (offset == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (size != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 1200);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
_hasIndex = true;
} else {
diff --git a/engines/gob/save/saveload_v4.cpp b/engines/gob/save/saveload_v4.cpp
index 16c87b9a64..66270161d3 100644
--- a/engines/gob/save/saveload_v4.cpp
+++ b/engines/gob/save/saveload_v4.cpp
@@ -63,7 +63,7 @@ int SaveLoad_v4::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_v4::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -72,14 +72,14 @@ int SaveLoad_v4::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
SaveLoad_v4::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
_firstSize = true;
- memset(_props, 0, 500);
- memset(_index, 0, 1200);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_hasIndex = false;
_slotFile = new File(vm, target);
@@ -112,7 +112,7 @@ int32 SaveLoad_v4::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 1700);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_v4::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -127,22 +127,22 @@ bool SaveLoad_v4::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (offset < kPropsSize) {
// Global properties
debugC(3, kDebugSaveLoad, "Loading global properties");
- if ((size + offset) > 500) {
+ if ((size + offset) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (offset == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (size != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -202,28 +202,28 @@ bool SaveLoad_v4::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (offset < kPropsSize) {
// Global properties
debugC(3, kDebugSaveLoad, "Saving global properties");
- if ((size + offset) > 500) {
+ if ((size + offset) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (offset == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (size != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 1200);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
_hasIndex = true;
} else {
diff --git a/engines/gob/save/saveload_v6.cpp b/engines/gob/save/saveload_v6.cpp
index 45622bee73..297f23122c 100644
--- a/engines/gob/save/saveload_v6.cpp
+++ b/engines/gob/save/saveload_v6.cpp
@@ -50,7 +50,7 @@ int SaveLoad_v6::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 2900) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_v6::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -59,13 +59,13 @@ int SaveLoad_v6::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 2900) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
SaveLoad_v6::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_props, 0, 500);
- memset(_index, 0, 2400);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_slotFile = new File(vm, target);
}
@@ -80,7 +80,7 @@ int32 SaveLoad_v6::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 2900);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_v6::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -95,22 +95,22 @@ bool SaveLoad_v6::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (offset < kPropsSize) {
// Properties
refreshProps();
- if ((offset + size) > 500) {
+ if ((offset + size) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (offset < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (size != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -191,10 +191,10 @@ bool SaveLoad_v6::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (offset < kPropsSize) {
// Properties
- if ((offset + size) > 500) {
+ if ((offset + size) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -203,16 +203,16 @@ bool SaveLoad_v6::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
refreshProps();
- } else if (offset < 2900) {
+ } else if (offset < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (size != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 2400);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
} else {
// Save slot, whole variable block
--
cgit v1.2.3
From 0a6161233b15fb6cf30d87ebc20d5d3c78fbbc60 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Thu, 20 Aug 2009 17:12:46 +0000
Subject: Remove useless include guard
svn-id: r43564
---
engines/sci/engine/static_selectors.cpp | 5 -----
1 file changed, 5 deletions(-)
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index c1d0ad9bac..db72ce370d 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -26,9 +26,6 @@
// We place selector vocab name tables here for any game that doesn't have
// them. This includes the King's Quest IV Demo and LSL3 Demo.
-#ifndef SCI_STATIC_SELECTORS_H
-#define SCI_STATIC_SELECTORS_H
-
#include "sci/engine/kernel.h"
namespace Sci {
@@ -425,5 +422,3 @@ Common::StringList Kernel::checkStaticSelectorNames() {
}
} // End of namespace Sci
-
-#endif // SCI_STATIC_SELECTORS_H
--
cgit v1.2.3
From c32f11c1064c99da38664bdb7bdbadd6a4ae3d15 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Thu, 20 Aug 2009 18:10:02 +0000
Subject: Add detection for the QFG2 demo.
svn-id: r43565
---
engines/sci/detection.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index ee9fd5fb18..4b373a76f6 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -2308,6 +2308,15 @@ static const struct SciGameDescription SciGameDescriptions[] = {
0
},
+ // Quest for Glory 2 - English DOS Non-Interactive Demo
+ // Executable scanning reports "1.000.046"
+ {{"qfg2", "Demo", {
+ {"resource.map", 0, "e75eb86bdd517b3ef709058249986a87", 906},
+ {"resource.001", 0, "9b098f9e1008abe30e56c93b896494e6", 362123},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
// Quest for Glory 3 - English DOS Non-Interactive Demo (from FRG)
// Executable scanning reports "1.001.021", VERSION file reports "1.000, 0.001.059, 6.12.92"
{{"qfg3", "Demo", {
--
cgit v1.2.3
From 83835ce93ce5168dedd72ecbb69a3733ea55dd7c Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Thu, 20 Aug 2009 18:25:55 +0000
Subject: Add a static selector table for use with the lsl5 demo.
svn-id: r43566
---
engines/sci/engine/static_selectors.cpp | 96 +++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index db72ce370d..9c2abbfbc9 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -394,6 +394,100 @@ static const SelectorRemap iceman_demo_selectors[] = {
{ "setTarget", 171 }
};
+// Taken from Space Quest 1 VGA (Demo)
+static const SelectorRemap lsl5_demo_selectors[] = {
+ { "init", 103 },
+ { "play", 42 },
+ { "replay", 65 },
+ { "x", 4 },
+ { "y", 3 },
+ { "z", 85 },
+ { "priority", 63 },
+ { "view", 5 },
+ { "loop", 6 },
+ { "cel", 7 },
+ { "brLeft", 20 },
+ { "brRight", 22 },
+ { "brTop", 19 },
+ { "brBottom", 21 },
+ { "xStep", 54 },
+ { "yStep", 55 },
+ { "nsBottom", 11 },
+ { "nsTop", 9 },
+ { "nsLeft", 10 },
+ { "nsRight", 12 },
+ { "font", 33 },
+ { "text", 26 },
+ { "type", 34 },
+ { "state", 32 },
+ { "doit", 60 },
+ { "delete", 84 },
+ { "signal", 17 },
+ { "underBits", 8 },
+ { "canBeHere", 57 },
+ { "client", 45 },
+ { "dx", 46 },
+ { "dy", 47 },
+ { "xStep", 54 },
+ { "yStep", 55 },
+ { "b-moveCnt", 48 },
+ { "b-i1", 49 },
+ { "b-i2", 50 },
+ { "b-di", 51 },
+ { "b-xAxis", 52 },
+ { "b-incr", 53 },
+ { "completed", 207 },
+ { "illegalBits", 18 },
+ { "dispose", 104 },
+ { "prevSignal", 148 },
+ { "message", 40 },
+ { "modifiers", 64 },
+ { "cue", 135 },
+ { "owner", 149 },
+ { "handle", 93 },
+ { "number", 43 },
+ { "max", 37 },
+ { "cursor", 36 },
+ { "claimed", 76 },
+ { "edgeHit", 308 },
+ { "wordFail", 71 },
+ { "syntaxFail", 72 },
+ { "semanticFail", 73 },
+ { "cycler", 212 },
+ { "elements", 27 },
+ { "lsTop", 13 },
+ { "lsBottom", 15 },
+ { "lsLeft", 14 },
+ { "lsRight", 16 },
+ { "baseSetter", 277 },
+ { "who", 39 },
+ { "distance", 221 },
+ { "mover", 59 },
+ { "looper", 62 },
+ { "isBlocked", 61 },
+ { "heading", 58 },
+ { "mode", 30 },
+ { "caller", 133 },
+ { "moveDone", 100 },
+ { "vol", 97 },
+ { "pri", 98 },
+ { "min", 94 },
+ { "sec", 95 },
+ { "frame", 96 },
+ { "dataInc", 92 },
+ { "size", 89 },
+ { "palette", 91 },
+ { "moveSpeed", 56 },
+ { "nodePtr", 44 },
+ { "flags", 150 },
+ { "points", 90 },
+ { "printLang", 87 },
+ { "subtitleLang", 88 },
+ { "parseLang", 86 },
+ { "motionCue", 210 },
+ { "egoMoveSpeed", 357 }
+};
+
// A macro for loading one of the above tables in the function below
#define USE_SELECTOR_TABLE(x) \
do { \
@@ -417,6 +511,8 @@ Common::StringList Kernel::checkStaticSelectorNames() {
USE_SELECTOR_TABLE(christmas1992_selectors);
else if (gameID == "lsl1sci")
USE_SELECTOR_TABLE(lsl1_demo_selectors);
+ else if (gameID == "lsl5")
+ USE_SELECTOR_TABLE(lsl5_demo_selectors);
return names;
}
--
cgit v1.2.3
From 8f587ed5e43d31d4cf2139b4d170ed9d726f2acc Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Thu, 20 Aug 2009 19:49:52 +0000
Subject: remove \n's from warning() calls
svn-id: r43567
---
engines/sci/resource.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 2479504820..9e3bcb067e 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -910,7 +910,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType restype,
patch_data_offset = 2;
break;
default:
- warning("Resource patch unsupported special case %X\n", patch_data_offset);
+ warning("Resource patch unsupported special case %X", patch_data_offset);
}
}
@@ -1022,7 +1022,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
res->id = resId;
res->source = getVolume(map, offset >> bShift);
if (!res->source) {
- warning("Could not get volume for resource %d, VolumeID %d\n", id, offset >> bShift);
+ warning("Could not get volume for resource %d, VolumeID %d", id, offset >> bShift);
}
_resMap.setVal(resId, res);
}
--
cgit v1.2.3
From b4c7cd0484be154b2e47ece3bd5b0e0e6911d041 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Thu, 20 Aug 2009 20:41:12 +0000
Subject: Fix 16-bit SOL audio on little endian systems. Fixes the white noise
in the Gabriel Knight demo.
svn-id: r43569
---
engines/sci/sfx/core.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index 95d79b3666..a1e2a0b0f8 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -1060,7 +1060,7 @@ static void deDPCM16(byte *soundBuf, Common::SeekableReadStream &audioStream, ui
s += tableDPCM16[b];
s = CLIP(s, -32768, 32767);
- *out++ = TO_BE_16(s);
+ *out++ = s;
}
}
@@ -1105,8 +1105,13 @@ static byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size,
// Convert the SOL stream flags to our own format
flags = 0;
- if (audioFlags & kSolFlag16Bit)
+ if (audioFlags & kSolFlag16Bit) {
flags |= Audio::Mixer::FLAG_16BITS;
+#ifdef SCUMM_LITTLE_ENDIAN
+ flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN;
+#endif
+ }
+
if (!(audioFlags & kSolFlagIsSigned))
flags |= Audio::Mixer::FLAG_UNSIGNED;
--
cgit v1.2.3
From 79c2dc798082c7fb9de3a90eff90cda0101acfe7 Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Thu, 20 Aug 2009 20:59:22 +0000
Subject: Fixing some signed/unsigned comparison warnings
svn-id: r43570
---
engines/gob/save/saveload_playtoons.cpp | 16 ++++++++--------
engines/gob/save/saveload_v2.cpp | 4 ++--
engines/gob/save/saveload_v3.cpp | 16 ++++++++--------
engines/gob/save/saveload_v4.cpp | 16 ++++++++--------
engines/gob/save/saveload_v6.cpp | 16 ++++++++--------
5 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
index f1140887de..a8fef3cb11 100644
--- a/engines/gob/save/saveload_playtoons.cpp
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -93,20 +93,20 @@ bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
- if ((offset + size) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < kPropsSize + kIndexSize) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -180,20 +180,20 @@ bool SaveLoad_Playtoons::GameHandler::save(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
- if ((offset + size) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset < kPropsSize + kIndexSize) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
diff --git a/engines/gob/save/saveload_v2.cpp b/engines/gob/save/saveload_v2.cpp
index 8449345336..ea639b861a 100644
--- a/engines/gob/save/saveload_v2.cpp
+++ b/engines/gob/save/saveload_v2.cpp
@@ -99,7 +99,7 @@ bool SaveLoad_v2::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
if (offset == 0) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -184,7 +184,7 @@ bool SaveLoad_v2::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
if (offset == 0) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp
index 510ca622b8..064d472323 100644
--- a/engines/gob/save/saveload_v3.cpp
+++ b/engines/gob/save/saveload_v3.cpp
@@ -119,22 +119,22 @@ bool SaveLoad_v3::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties, like joker usage
debugC(3, kDebugSaveLoad, "Loading global properties");
- if ((size + offset) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset == kPropsSize) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -193,22 +193,22 @@ bool SaveLoad_v3::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties, like joker usage
debugC(3, kDebugSaveLoad, "Saving global properties");
- if ((size + offset) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset == kPropsSize) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
diff --git a/engines/gob/save/saveload_v4.cpp b/engines/gob/save/saveload_v4.cpp
index 66270161d3..e6973efd64 100644
--- a/engines/gob/save/saveload_v4.cpp
+++ b/engines/gob/save/saveload_v4.cpp
@@ -127,22 +127,22 @@ bool SaveLoad_v4::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties
debugC(3, kDebugSaveLoad, "Loading global properties");
- if ((size + offset) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset == kPropsSize) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -202,22 +202,22 @@ bool SaveLoad_v4::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties
debugC(3, kDebugSaveLoad, "Saving global properties");
- if ((size + offset) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset == kPropsSize) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
diff --git a/engines/gob/save/saveload_v6.cpp b/engines/gob/save/saveload_v6.cpp
index 297f23122c..e31c8b4809 100644
--- a/engines/gob/save/saveload_v6.cpp
+++ b/engines/gob/save/saveload_v6.cpp
@@ -95,22 +95,22 @@ bool SaveLoad_v6::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
refreshProps();
- if ((offset + size) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < kPropsSize + kIndexSize) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -191,10 +191,10 @@ bool SaveLoad_v6::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < kPropsSize) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
- if ((offset + size) > kPropsSize) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -203,10 +203,10 @@ bool SaveLoad_v6::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
refreshProps();
- } else if (offset < kPropsSize + kIndexSize) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != kIndexSize) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
--
cgit v1.2.3
From 6a3c595b01cbfbf0858e7461f696ec971a46de7d Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Thu, 20 Aug 2009 21:03:03 +0000
Subject: remove \n's from error() calls
svn-id: r43571
---
engines/sci/engine/klists.cpp | 8 ++++----
engines/sci/engine/kpathing.cpp | 2 +-
engines/sci/engine/kscripts.cpp | 2 +-
engines/sci/engine/seg_manager.cpp | 4 ++--
engines/sci/engine/vm.cpp | 22 +++++++++++-----------
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 43d1f25e01..a9ae77972f 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -36,7 +36,7 @@ Node *lookup_node(EngineState *s, reg_t addr) {
if (!mobj) {
// FIXME: This occurs right at the beginning of SQ4, when walking north from the first screen. It doesn't
// seem to have any apparent ill-effects, though, so it's been changed to non-fatal, for now
- //error("%s, L%d: Attempt to use non-node %04x:%04x as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
+ //error("%s, L%d: Attempt to use non-node %04x:%04x as list node", __FILE__, __LINE__, PRINT_REG(addr));
warning("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr));
return NULL;
}
@@ -44,7 +44,7 @@ Node *lookup_node(EngineState *s, reg_t addr) {
NodeTable *nt = (NodeTable *)mobj;
if (!nt->isValidEntry(addr.offset)) {
- error("Attempt to use non-node %04x:%04x as list node\n", PRINT_REG(addr));
+ error("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr));
return NULL;
}
@@ -55,14 +55,14 @@ List *lookup_list(EngineState *s, reg_t addr) {
MemObject *mobj = GET_SEGMENT(*s->seg_manager, addr.segment, MEM_OBJ_LISTS);
if (!mobj) {
- error("Attempt to use non-list %04x:%04x as list\n", PRINT_REG(addr));
+ error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
return NULL;
}
ListTable *lt = (ListTable *)mobj;
if (!lt->isValidEntry(addr.offset)) {
- error("Attempt to use non-list %04x:%04x as list\n", PRINT_REG(addr));
+ error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
return NULL;
}
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index da24a388fa..ad14202257 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -1406,7 +1406,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
err = nearest_intersection(pf_s, start, end, &intersection);
if (err == PF_FATAL) {
- warning("AvoidPath: fatal error finding nearest intersecton");
+ warning("AvoidPath: fatal error finding nearest intersection");
delete pf_s;
return NULL;
}
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 4d90dd68ac..41eb9f624d 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -74,7 +74,7 @@ int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvoc
warning("Selector '%s' of object at %04x:%04x could not be invoked (%s L%d)",
((SciEngine*)g_engine)->getKernel()->getSelectorName(selector_id).c_str(), PRINT_REG(object), fname, line);
if (noinvalid == kStopOnInvalidSelector)
- error("[Kernel] Not recoverable: VM was halted\n");
+ error("[Kernel] Not recoverable: VM was halted");
return 1;
}
if (slc_type == kSelectorVariable) // Swallow silently
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index a6f54c5bf7..ddcd639f3c 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -166,7 +166,7 @@ void SegManager::setScriptSize(Script &scr, int script_nr) {
}
if (scr.buf_size > 65535) {
- error("Script and heap sizes combined exceed 64K.\n"
+ error("Script and heap sizes combined exceed 64K."
"This means a fundamental design bug was made in SCI\n"
"regarding SCI1.1 games.\nPlease report this so it can be"
"fixed in the next major version");
@@ -688,7 +688,7 @@ void SegManager::scriptInitialiseObjectsSci11(SegmentId seg) {
int species = READ_LE_UINT16(seeker + 10);
if (species < 0 || species >= (int)_classtable.size()) {
- error("Invalid species %d(0x%x) not in interval [0,%d) while instantiating script %d\n",
+ error("Invalid species %d(0x%x) not in interval [0,%d) while instantiating script %d",
species, species, _classtable.size(), scr->nr);
return;
}
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 64ee7243fb..943a8e0354 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -79,7 +79,7 @@ static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) {
if (sp >= s->stack_base && sp < s->stack_top)
return sp;
- error("[VM] Stack index %d out of valid range [%d..%d]\n",
+ error("[VM] Stack index %d out of valid range [%d..%d]",
(int)(sp - s->stack_base), 0, (int)(s->stack_top - s->stack_base - 1));
return 0;
}
@@ -87,9 +87,9 @@ static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) {
static int validate_arithmetic(reg_t reg) {
if (reg.segment) {
if (g_debug_weak_validations)
- warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
else
- error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
return 0;
}
@@ -99,9 +99,9 @@ static int validate_arithmetic(reg_t reg) {
static int signed_validate_arithmetic(reg_t reg) {
if (reg.segment) {
if (g_debug_weak_validations)
- warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
else
- error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
return 0;
}
@@ -214,7 +214,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
int temp = s->seg_manager->validateExportFunc(pubfunct, seg);
if (!temp) {
- error("Request for invalid exported function 0x%x of script 0x%x\n", pubfunct, script);
+ error("Request for invalid exported function 0x%x of script 0x%x", pubfunct, script);
return NULL;
}
@@ -319,7 +319,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
break;
}
- error("Send to invalid selector 0x%x of object at %04x:%04x\n", 0xffff & selector, PRINT_REG(send_obj));
+ error("Send to invalid selector 0x%x of object at %04x:%04x", 0xffff & selector, PRINT_REG(send_obj));
break;
@@ -930,7 +930,7 @@ void run_vm(EngineState *s, int restoring) {
}
if (opparams[0] >= (int)((SciEngine*)g_engine)->getKernel()->_kernelFuncs.size()) {
- error("Invalid kernel function 0x%x requested\n", opparams[0]);
+ error("Invalid kernel function 0x%x requested", opparams[0]);
} else {
int argc = ASSERT_ARITHMETIC(scriptState.xs->sp[0]);
@@ -941,7 +941,7 @@ void run_vm(EngineState *s, int restoring) {
&& !kernel_matches_signature(s,
((SciEngine*)g_engine)->getKernel()->_kernelFuncs[opparams[0]].signature, argc,
scriptState.xs->sp + 1)) {
- error("[VM] Invalid arguments to kernel call %x\n", opparams[0]);
+ error("[VM] Invalid arguments to kernel call %x", opparams[0]);
} else {
s->r_acc = ((SciEngine*)g_engine)->getKernel()->_kernelFuncs[opparams[0]].fun(s, opparams[0],
argc, scriptState.xs->sp + 1);
@@ -1195,7 +1195,7 @@ void run_vm(EngineState *s, int restoring) {
#ifndef DISABLE_VALIDATIONS
if (r_temp.offset >= code_buf_size) {
error("VM: lofss operation overflowed: %04x:%04x beyond end"
- " of script (at %04x)\n", PRINT_REG(r_temp), code_buf_size);
+ " of script (at %04x)", PRINT_REG(r_temp), code_buf_size);
}
#endif
PUSH32(r_temp);
@@ -1492,7 +1492,7 @@ SelectorType lookup_selector(EngineState *s, reg_t obj_location, Selector select
if (!obj) {
- error("lookup_selector(): Error while looking up Species class.\nOriginal address was %04x:%04x. Species address was %04x:%04x\n",
+ error("lookup_selector(): Error while looking up Species class.\nOriginal address was %04x:%04x. Species address was %04x:%04x",
PRINT_REG(obj_location), PRINT_REG(obj->_variables[SCRIPT_SPECIES_SELECTOR]));
return kSelectorNone;
}
--
cgit v1.2.3
From a7ab084ecfec7897775cba06feb477bcf689cb42 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Thu, 20 Aug 2009 21:18:52 +0000
Subject: SCI: Fix for the "Memory fragmented" dialogs popping up in some
games.
svn-id: r43572
---
engines/sci/engine/kmisc.cpp | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 2f0072ec67..90ae88b73f 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -63,14 +63,27 @@ reg_t kHaveMouse(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return make_reg(0, -1);
}
+enum kMemoryInfoFunc {
+ K_MEMORYINFO_LARGEST_HEAP_BLOCK = 0, // Largest heap block available
+ K_MEMORYINFO_FREE_HEAP = 1, // Total free heap memory
+ K_MEMORYINFO_LARGEST_HUNK_BLOCK = 2, // Largest available hunk memory block
+ K_MEMORYINFO_FREE_HUNK = 3, // Amount of free DOS paragraphs
+ K_MEMORYINFO_TOTAL_HUNK = 4 // Total amount of hunk memory (SCI01)
+};
+
reg_t kMemoryInfo(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+ uint16 size = 0x7fff; // Must not be 0xffff, or some memory calculations will overflow
+
switch (argv[0].offset) {
- case 0: // Total free heap memory
- case 1: // Largest heap block available
- case 2: // Largest available hunk memory block
- case 3: // Total amount of hunk memory
- case 4: // Amount of free DOS paragraphs- SCI01
- return make_reg(0, 0x7fff); // Must not be 0xffff, or some memory calculations will overflow
+ case K_MEMORYINFO_LARGEST_HEAP_BLOCK:
+ // In order to prevent "Memory fragmented" dialogs from
+ // popping up in some games, we must return FREE_HEAP - 2 here.
+ return make_reg(0, size - 2);
+ case K_MEMORYINFO_FREE_HEAP:
+ case K_MEMORYINFO_LARGEST_HUNK_BLOCK:
+ case K_MEMORYINFO_FREE_HUNK:
+ case K_MEMORYINFO_TOTAL_HUNK:
+ return make_reg(0, size);
default:
warning("Unknown MemoryInfo operation: %04x", argv[0].offset);
--
cgit v1.2.3
From cba2897cc8f7b70d27fc75ca8b8d55cde4738e4a Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Fri, 21 Aug 2009 03:31:34 +0000
Subject: Truly fix endianness in the SOL decoder. Raw sounds are always in
little endian order and now compressed are outputted to little endian too
(and therefore the little endian mixer flag is always set).
svn-id: r43576
---
engines/sci/sfx/core.cpp | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index a1e2a0b0f8..c8cf773eae 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -1070,7 +1070,7 @@ static void deDPCM8Nibble(byte *soundBuf, int32 &s, byte b) {
else
s += tableDPCM8[b & 7];
s = CLIP(s, 0, 255);
- *soundBuf = s;
+ *soundBuf = TO_LE_16(s);
}
static void deDPCM8(byte *soundBuf, Common::SeekableReadStream &audioStream, uint32 n) {
@@ -1105,13 +1105,9 @@ static byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size,
// Convert the SOL stream flags to our own format
flags = 0;
- if (audioFlags & kSolFlag16Bit) {
- flags |= Audio::Mixer::FLAG_16BITS;
-#ifdef SCUMM_LITTLE_ENDIAN
- flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN;
-#endif
- }
-
+ if (audioFlags & kSolFlag16Bit)
+ flags |= Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN;
+
if (!(audioFlags & kSolFlagIsSigned))
flags |= Audio::Mixer::FLAG_UNSIGNED;
--
cgit v1.2.3
From 021264aad17d6aa7145a1f5208d237a024ac51f0 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 21 Aug 2009 09:43:30 +0000
Subject: fixed configure script from botched conflict resolution in r43577
svn-id: r43578
---
configure | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 9ef794eed2..783c397402 100755
--- a/configure
+++ b/configure
@@ -110,7 +110,8 @@ _alsa=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
-_16bit=yes_readline=auto
+_16bit=yes
+_readline=auto
# Default option behaviour yes/no
_text_console=no
_mt32emu=yes
@@ -637,6 +638,8 @@ DEBFLAGS="-g"
for ac_option in $@; do
case "$ac_option" in
+ --enable-16bit) _16bit=yes ;;
+ --disable-16bit) _16bit=no ;;
--disable-hq-scalers) _build_hq_scalers=no ;;
--disable-scalers) _build_scalers=no ;;
--enable-alsa) _alsa=yes ;;
@@ -1646,6 +1649,11 @@ else
fi
add_to_config_mk_if_yes "$_mt32emu" 'USE_MT32EMU = 1'
+#
+# Check whether 16bit color support is requested
+#
+add_to_config_mk_if_yes "$_16bit" 'ENABLE_RGB_COLOR = 1'
+
#
# Check whether to enable the (hq) scalers
#
@@ -1996,6 +2004,10 @@ if test "$_nasm" = yes ; then
echo_n ", assembly routines"
fi
+if test "$_16bit" = yes ; then
+ echo_n ", 16bit color"
+fi
+
if test "$_build_hq_scalers" = yes ; then
echo_n ", HQ scalers"
fi
--
cgit v1.2.3
From 39b4ba6549d6590198bd43c252489c25abb47c56 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 21 Aug 2009 10:00:51 +0000
Subject: Fix 16bit option of configure.
svn-id: r43579
---
Makefile.common | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile.common b/Makefile.common
index caf5ba22fa..824139b0bd 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -37,6 +37,10 @@ ifdef DISABLE_SCALERS
DEFINES += -DDISABLE_SCALERS
endif
+ifdef ENABLE_RGB_COLOR
+DEFINES += -DENABLE_RGB_COLOR
+endif
+
ifdef DISABLE_HQ_SCALERS
DEFINES += -DDISABLE_HQ_SCALERS
endif
--
cgit v1.2.3
From 7561704414025392a4c9bba6e487ce0f06040d15 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 21 Aug 2009 10:01:16 +0000
Subject: fixed GP2X (I hope)
svn-id: r43580
---
backends/platform/gp2x/graphics.cpp | 72 ++++++++++++++++++++++++++++++++-----
1 file changed, 63 insertions(+), 9 deletions(-)
diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp
index 229f840d11..402aea4c14 100644
--- a/backends/platform/gp2x/graphics.cpp
+++ b/backends/platform/gp2x/graphics.cpp
@@ -240,9 +240,27 @@ int OSystem_GP2X::getGraphicsMode() const {
return _videoMode.mode;
}
-void OSystem_GP2X::initSize(uint w, uint h){
+void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
+#ifdef ENABLE_RGB_COLOR
+ //avoid redundant format changes
+ Graphics::PixelFormat newFormat;
+ if (!format)
+ newFormat = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ newFormat = *format;
+
+ assert(newFormat.bytesPerPixel > 0);
+
+ if (newFormat != _videoMode.format)
+ {
+ _videoMode.format = newFormat;
+ _transactionDetails.formatChanged = true;
+ _screenFormat = newFormat;
+ }
+#endif
+
// Avoid redundant res changes
if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
return;
@@ -1212,7 +1230,17 @@ void OSystem_GP2X::warpMouse(int x, int y) {
}
}
-void OSystem_GP2X::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+#ifdef ENABLE_RGB_COLOR
+ if (!format)
+ _cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
+ else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
+ _cursorFormat = *format;
+ keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
+#else
+ keycolor &= 0xFF;
+#endif
+
if (w == 0 || h == 0)
return;
@@ -1246,16 +1274,26 @@ void OSystem_GP2X::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x
}
free(_mouseData);
-
+#ifdef ENABLE_RGB_COLOR
+ _mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel);
+ memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel);
+#else
_mouseData = (byte *)malloc(w * h);
memcpy(_mouseData, buf, w * h);
+#endif
+
blitCursor();
}
void OSystem_GP2X::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
+#ifdef ENABLE_RGB_COLOR
+ uint32 color;
+ uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
+#else
byte color;
+#endif
int w, h, i, j;
if (!_mouseOrigSurface || !_mouseData)
@@ -1289,13 +1327,29 @@ void OSystem_GP2X::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
- color = *srcPtr;
- if (color != _mouseKeyColor) { // transparent, don't draw
- *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
- palette[color].r, palette[color].g, palette[color].b);
+#ifdef ENABLE_RGB_COLOR
+ if (_cursorFormat.bytesPerPixel > 1) {
+ color = (*(uint32 *) srcPtr) & colormask;
+ if (color != _mouseKeyColor) { // transparent, don't draw
+ uint8 r,g,b;
+ _cursorFormat.colorToRGB(color,r,g,b);
+ *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
+ r, g, b);
+ }
+ dstPtr += 2;
+ srcPtr += _cursorFormat.bytesPerPixel;
+ } else {
+#endif
+ color = *srcPtr;
+ if (color != _mouseKeyColor) { // transparent, don't draw
+ *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
+ palette[color].r, palette[color].g, palette[color].b);
+ }
+ dstPtr += 2;
+ srcPtr++;
+#ifdef ENABLE_RGB_COLOR
}
- dstPtr += 2;
- srcPtr++;
+#endif
}
dstPtr += _mouseOrigSurface->pitch - w * 2;
}
--
cgit v1.2.3
From 5ac20829b0db110e9a0a418ed9dc733484e75c67 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 21 Aug 2009 10:10:14 +0000
Subject: correct idiotic error in first gp2x fix attempt.
svn-id: r43581
---
backends/platform/gp2x/graphics.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp
index 402aea4c14..d948cb82d3 100644
--- a/backends/platform/gp2x/graphics.cpp
+++ b/backends/platform/gp2x/graphics.cpp
@@ -240,7 +240,7 @@ int OSystem_GP2X::getGraphicsMode() const {
return _videoMode.mode;
}
-void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
+void OSystem_GP2X::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
#ifdef ENABLE_RGB_COLOR
@@ -1230,7 +1230,7 @@ void OSystem_GP2X::warpMouse(int x, int y) {
}
}
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void OSystem_GP2X::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
#ifdef ENABLE_RGB_COLOR
if (!format)
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
--
cgit v1.2.3
From 1a5f0d806ecd1af5e5873c62598dadd63c672856 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 21 Aug 2009 10:22:28 +0000
Subject: add conversion.h and conversion.cpp into trunk (were present in
working copy, but not added to svn control)
svn-id: r43582
---
graphics/conversion.cpp | 152 ++++++++++++++++++++++++++++++++++++++++++++++++
graphics/conversion.h | 76 ++++++++++++++++++++++++
graphics/module.mk | 1 +
3 files changed, 229 insertions(+)
create mode 100644 graphics/conversion.cpp
create mode 100644 graphics/conversion.h
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
new file mode 100644
index 0000000000..1863814c1d
--- /dev/null
+++ b/graphics/conversion.cpp
@@ -0,0 +1,152 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "graphics/conversion.h"
+
+namespace Graphics {
+
+// TODO: YUV to RGB conversion function
+
+// Function to blit a rect from one color format to another
+bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
+ int w, int h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt) {
+ // Error out if conversion is impossible
+ if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1)
+ || (!srcFmt.bytesPerPixel) || (!dstFmt.bytesPerPixel)
+ || (srcFmt.bytesPerPixel > dstFmt.bytesPerPixel))
+ return false;
+
+ // Don't perform unnecessary conversion
+ if (srcFmt == dstFmt) {
+ if (dst == src)
+ return true;
+ if (dstpitch == srcpitch && ((w * dstFmt.bytesPerPixel) == dstpitch)) {
+ memcpy(dst,src,dstpitch * h);
+ return true;
+ } else {
+ for (int i = 0; i < h; i++) {
+ memcpy(dst,src,w * dstFmt.bytesPerPixel);
+ dst += dstpitch;
+ src += srcpitch;
+ }
+ return true;
+ }
+ }
+
+ // Faster, but larger, to provide optimized handling for each case.
+ int srcDelta, dstDelta;
+ srcDelta = (srcpitch - w * srcFmt.bytesPerPixel);
+ dstDelta = (dstpitch - w * dstFmt.bytesPerPixel);
+
+ // TODO: optimized cases for dstDelta of 0
+ uint8 r, g, b, a;
+ if (dstFmt.bytesPerPixel == 2) {
+ uint16 color;
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 2) {
+ color = *(uint16 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint16 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else if (dstFmt.bytesPerPixel == 3) {
+ uint32 color;
+ uint8 *col = (uint8 *) &color;
+#ifdef SCUMM_BIG_ENDIAN
+ col++;
+#endif
+ if (srcFmt.bytesPerPixel == 2) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 3) {
+ color = *(uint16 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ memcpy(dst, col, 3);
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 3, dst += 3) {
+ uint8 r, g, b, a;
+ memcpy(col, src, 3);
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ memcpy(dst, col, 3);
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ }
+ } else if (dstFmt.bytesPerPixel == 4) {
+ uint32 color;
+ if (srcFmt.bytesPerPixel == 2) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 4) {
+ color = *(uint16 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint32 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else if (srcFmt.bytesPerPixel == 3) {
+ uint8 *col = (uint8 *)&color;
+#ifdef SCUMM_BIG_ENDIAN
+ col++;
+#endif
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 2, dst += 4) {
+ memcpy(col, src, 3);
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint32 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ } else {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++, src += 4, dst += 4) {
+ color = *(uint32 *) src;
+ srcFmt.colorToARGB(color, a, r, g, b);
+ color = dstFmt.ARGBToColor(a, r, g, b);
+ *(uint32 *) dst = color;
+ }
+ src += srcDelta;
+ dst += dstDelta;
+ }
+ }
+ } else {
+ return false;
+ }
+ return true;
+}
+
+} // end of namespace Graphics
diff --git a/graphics/conversion.h b/graphics/conversion.h
new file mode 100644
index 0000000000..b0314046b9
--- /dev/null
+++ b/graphics/conversion.h
@@ -0,0 +1,76 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GRAPHICS_CONVERSION_H
+#define GRAPHICS_CONVERSION_H
+
+#include "common/util.h"
+#include "graphics/pixelformat.h"
+
+namespace Graphics {
+
+/** Converting a color from YUV to RGB colorspace. */
+inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
+ r = CLIP(y + ((1357 * (v - 128)) >> 10), 0, 255);
+ g = CLIP(y - (( 691 * (v - 128)) >> 10) - ((333 * (u - 128)) >> 10), 0, 255);
+ b = CLIP(y + ((1715 * (u - 128)) >> 10), 0, 255);
+}
+
+/** Converting a color from RGB to YUV colorspace. */
+inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
+ y = CLIP( ((r * 306) >> 10) + ((g * 601) >> 10) + ((b * 117) >> 10) , 0, 255);
+ u = CLIP(-((r * 172) >> 10) - ((g * 340) >> 10) + ((b * 512) >> 10) + 128, 0, 255);
+ v = CLIP( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
+}
+
+// TODO: generic YUV to RGB blit
+
+/**
+ * Blits a rectangle from one graphical format to another.
+ *
+ * @param dstbuf the buffer which will recieve the converted graphics data
+ * @param srcbuf the buffer containing the original graphics data
+ * @param dstpitch width in bytes of one full line of the dest buffer
+ * @param srcpitch width in bytes of one full line of the source buffer
+ * @param w the width of the graphics data
+ * @param h the height of the graphics data
+ * @param dstFmt the desired pixel format
+ * @param srcFmt the original pixel format
+ * @return true if conversion completes successfully,
+ * false if there is an error.
+ *
+ * @note This implementation currently arbitrarily requires that the
+ * destination's format have at least as high a bytedepth as
+ * the source's.
+ * @note This can convert a rectangle in place, if the source and
+ * destination format have the same bytedepth.
+ *
+ */
+bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
+ int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt);
+
+} // end of namespace Graphics
+
+#endif // GRAPHICS_CONVERSION_H
diff --git a/graphics/module.mk b/graphics/module.mk
index 46ed564e1e..04a98dd8e2 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -1,6 +1,7 @@
MODULE := graphics
MODULE_OBJS := \
+ conversion.o \
cursorman.o \
dither.o \
font.o \
--
cgit v1.2.3
From a527a1ec9b801fafe069d2ea2c6626f0101d4f2b Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 21 Aug 2009 10:31:59 +0000
Subject: Several 16bit color HE games are supported now.
svn-id: r43583
---
NEWS | 6 ++++++
README | 11 ++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index 40cec7ea62..d3caa18e3c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
http://scummvm.svn.sourceforge.net/viewvc/scummvm/?view=log
1.1.0 (????-??-??)
+ New Games:
+ - Added support for Blue's Art Time Activities.
+ - Added support for Blue's Reading Time Activities.
+ - Added support for Freddi Fish 5: The Case of the Creature of Coral Cave.
+ - Added support for Pajama Sam: Games to Play On Any Day.
+
General:
- Added support for a custom SJIS font for FM-TOWNS and PC98 games.
diff --git a/README b/README
index 379eb44a4d..a085f37a2a 100644
--- a/README
+++ b/README
@@ -260,6 +260,8 @@ SCUMM Games by Humongous Entertainment:
Big Thinkers Kindergarten [thinkerk]
Blue's 123 Time Activities [Blues123Time]
Blue's ABC Time Activities [BluesABCTime]
+ Blue's Art Time Activities [arttime]
+ Blue's Reading Time Activities [readtime]
Fatty Bear's Birthday Surprise [fbear]
Fatty Bear's Fun Pack [fbpack]
Freddi Fish 1: The Case of the Missing
@@ -270,6 +272,8 @@ SCUMM Games by Humongous Entertainment:
Conch Shell [freddi3]
Freddi Fish 4: The Case of the Hogfish
Rustlers of Briny Gulch [freddi4]
+ Freddi Fish 5: The Case of the Creature
+ of Coral Cave [freddicove]
Freddi Fish and Luther's Maze Madness [maze]
Freddi Fish and Luther's Water Worries [water]
Let's Explore the Airport with Buzzy [airport]
@@ -295,6 +299,7 @@ SCUMM Games by Humongous Entertainment:
Putt-Putt's Fun Pack [funpack]
SPY Fox 1: Dry Cereal [spyfox]
SPY Fox 2: Some Assembly Required [spyfox2]
+ SPY Fox 3: Operation Ozone [spyozon]
SPY Fox in Cheese Chase [chase]
SPY Fox in Hold the Mustard [mustard]
@@ -304,10 +309,14 @@ If you want the latest updates on game compatibility, visit our web site
and view the compatibility chart.
Backyard Baseball [baseball]
+ Backyard Baseball 2001 [baseball2001]
+ Backyard Baseball 2003 [baseball2003]
+ Backyard Football 2002 [football2002]
Backyard Soccer [soccer]
+ Backyard Soccer 2004 [soccer2004]
Blue's Birthday Adventure [BluesBirthday]
Blue's Treasure Hunt [BluesTreasureHunt]
- SPY Fox 3: Operation Ozone [spyozon]
+ Pajama Sam: Games to Play On Any Day [pjgames]
The following games are based on the SCUMM engine, but NOT supported
by ScummVM (yet):
--
cgit v1.2.3
From ba7a574ca1026f65721463199e7afb41bb998197 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 21 Aug 2009 10:34:13 +0000
Subject: Only enable 16bit color HE games, if 16bit color support is enabled.
svn-id: r43584
---
engines/scumm/detection_tables.h | 126 ++++++++++++++++++++-------------------
1 file changed, 65 insertions(+), 61 deletions(-)
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 99a28153c4..01bd0446ff 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -80,13 +80,21 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "puttputt", "Putt-Putt Joins the Parade" },
#ifdef ENABLE_HE
- { "airport", "Let's Explore the Airport with Buzzy" },
+#ifdef ENABLE_RGB_COLOR
{ "arttime", "Blue's Art Time Activities" },
- { "balloon", "Putt-Putt and Pep's Balloon-O-Rama" },
- { "baseball", "Backyard Baseball" },
{ "baseball2001", "Backyard Baseball 2001" },
{ "Baseball2003", "Backyard Baseball 2003" },
{ "basketball", "Backyard Basketball" },
+ { "football2002", "Backyard Football 2002" },
+ { "freddicove", "Freddi Fish 5: The Case of the Creature of Coral Cave" },
+ { "moonbase", "Moonbase Commander" },
+ { "pjgames", "Pajama Sam: Games to Play On Any Day" },
+ { "readtime", "Blue's Reading Time Activities" },
+ { "Soccer2004", "Backyard Soccer 2004" },
+#endif
+ { "airport", "Let's Explore the Airport with Buzzy" },
+ { "balloon", "Putt-Putt and Pep's Balloon-O-Rama" },
+ { "baseball", "Backyard Baseball" },
{ "Blues123Time", "Blue's 123 Time Activities" },
{ "BluesABCTime", "Blue's ABC Time Activities" },
{ "BluesBirthday", "Blue's Birthday Adventure" },
@@ -96,31 +104,25 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "dog", "Putt-Putt and Pep's Dog on a Stick" },
{ "farm", "Let's Explore the Farm with Buzzy" },
{ "football", "Backyard Football" },
- { "football2002", "Backyard Football 2002" },
{ "freddi", "Freddi Fish 1: The Case of the Missing Kelp Seeds" },
{ "freddi2", "Freddi Fish 2: The Case of the Haunted Schoolhouse" },
{ "freddi3", "Freddi Fish 3: The Case of the Stolen Conch Shell" },
{ "freddi4", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch" },
- { "freddicove", "Freddi Fish 5: The Case of the Creature of Coral Cave" },
{ "FreddisFunShop", "Freddi Fish's One-Stop Fun Shop" },
{ "jungle", "Let's Explore the Jungle with Buzzy" },
{ "lost", "Pajama Sam's Lost & Found" },
{ "maze", "Freddi Fish and Luther's Maze Madness" },
- { "moonbase", "Moonbase Commander" },
{ "mustard", "SPY Fox in Hold the Mustard" },
{ "pajama", "Pajama Sam 1: No Need to Hide When It's Dark Outside" },
{ "pajama2", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening" },
{ "pajama3", "Pajama Sam 3: You Are What You Eat From Your Head to Your Feet" },
- { "pjgames", "Pajama Sam: Games to Play On Any Day" },
{ "puttcircus", "Putt-Putt Joins the Circus" },
{ "puttrace", "Putt-Putt Enters the Race" },
{ "PuttsFunShop", "Putt-Putt's One-Stop Fun Shop" },
{ "putttime", "Putt-Putt Travels Through Time" },
{ "puttzoo", "Putt-Putt Saves the Zoo" },
- { "readtime", "Blue's Reading Time Activities" },
{ "SamsFunShop", "Pajama Sam's One-Stop Fun Shop" },
{ "soccer", "Backyard Soccer" },
- { "Soccer2004", "Backyard Soccer 2004" },
{ "SoccerMLS", "Backyard Soccer MLS Edition" },
{ "socks", "Pajama Sam's Sock Works" },
{ "spyfox", "SPY Fox 1: Dry Cereal" },
@@ -500,23 +502,12 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "puttputt", "Putt-Putt", kGenHEMacNoParens, UNK_LANG, Common::kPlatformMacintosh, 0 },
#ifdef ENABLE_HE
- { "airport", "airport", kGenHEPC, UNK_LANG, UNK, 0 },
- { "airport", "airdemo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "airport", "Airport Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "airport", "The AirPort", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
+#ifdef ENABLE_RGB_COLOR
{ "arttime", "arttime", kGenHEPC, UNK_LANG, UNK, 0 },
{ "arttime", "Blues-ArtTime", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "arttime", "artdemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "arttime", "Blues-ArtTime Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "balloon", "balloon", kGenHEPC, UNK_LANG, UNK, 0 },
- { "balloon", "Balloon-O-Rama", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
- { "baseball", "baseball", kGenHEPC, UNK_LANG, UNK, 0 },
- { "baseball", "BaseBall", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "baseball", "basedemo.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
-
{ "baseball2001", "baseball2001", kGenHEPC, UNK_LANG, UNK, 0 },
{ "baseball2001", "bb2demo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "baseball2001", "Baseball 2001 Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -529,6 +520,59 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "basketball", "basketball", kGenHEPC, UNK_LANG, UNK, 0 },
{ "basketball", "Basketball", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "football2002", "FootBall2002", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "football2002", "Football 2002", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
+ { "freddicove", "freddicove", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "freddicove", "FreddiCCC", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "freddicove", "FreddiCove", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "freddicove", "FreddiDZZ", kGenHEPC, Common::NL_NLD, UNK, 0 },
+ { "freddicove", "FreddiDZZ", kGenHEMac, Common::NL_NLD, Common::kPlatformMacintosh, 0 },
+ { "freddicove", "FreddiMML", kGenHEPC, Common::FR_FRA, UNK, 0 },
+ { "freddicove", "FreddiMML", kGenHEMac, Common::FR_FRA, Common::kPlatformMacintosh, 0 },
+ { "freddicove", "FFCoveDemo", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "freddicove", "FreddiCoveDemo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "freddicove", "ff5demo", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "freddicove", "FF5Demo", kGenHEMac, Common::NL_NLD, Common::kPlatformMacintosh, 0 },
+
+ { "moonbase", "moonbase", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "moonbase", "moondemo", kGenHEPC, UNK_LANG, UNK, 0 },
+
+ { "pjgames", "pjgames", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "pjgames", "PJGames", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
+ { "readtime", "Blue's Reading Time", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "readtime", "Blues-ReadingTime", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "readtime", "readDemo", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "readtime", "Blues-ReadingTime Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
+ { "Soccer2004", "Soccer2004", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "Soccer2004", "Soccer 2004", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
+ { "spyozon", "spyozon", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "spyozon", "sf3-demo", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "spyozon", "SF3Demo", kGenHEPC, Common::FR_FRA, UNK, 0 },
+ { "spyozon", "Spy Ozone Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "spyozon", "SPYFoxAIW", kGenHEPC, Common::DE_DEU, UNK, 0 },
+ { "spyozon", "SPYFoxOZU", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "spyozon", "SPYFoxSOS", kGenHEPC, Common::FR_FRA, UNK, 0 },
+ { "spyozon", "SPYFoxSOS", kGenHEMac, Common::FR_FRA, Common::kPlatformMacintosh, 0 },
+ { "spyozon", "SpyOzon", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "spyozon", "ozonepre.cup", kGenUnchanged, UNK_LANG, UNK, "HE CUP" },
+#endif
+
+ { "airport", "airport", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "airport", "airdemo", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "airport", "Airport Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "airport", "The AirPort", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
+ { "balloon", "balloon", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "balloon", "Balloon-O-Rama", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
+ { "baseball", "baseball", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "baseball", "BaseBall", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "baseball", "basedemo.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
+
{ "blues123time", "Blues123time", kGenHEPC, UNK_LANG, UNK, 0 },
{ "blues123time", "Blue's 123 Time", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -571,9 +615,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "football", "FootBall Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "football", "footdemo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "football2002", "FootBall2002", kGenHEPC, UNK_LANG, UNK, 0 },
- { "football2002", "Football 2002", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
{ "freddi", "freddi", kGenHEPC, UNK_LANG, UNK, 0 },
{ "freddi", "Freddi", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "freddi", "Freddi1", kGenHEPC, UNK_LANG, UNK, 0 },
@@ -632,18 +673,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "freddi4", "MaliceMRC", kGenHEPC, Common::FR_FRA, UNK, 0 },
{ "freddi4", "Mm4demo", kGenHEPC, Common::FR_FRA, UNK, 0 },
- { "freddicove", "freddicove", kGenHEPC, UNK_LANG, UNK, 0 },
- { "freddicove", "FreddiCCC", kGenHEPC, UNK_LANG, UNK, 0 },
- { "freddicove", "FreddiCove", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "freddicove", "FreddiDZZ", kGenHEPC, Common::NL_NLD, UNK, 0 },
- { "freddicove", "FreddiDZZ", kGenHEMac, Common::NL_NLD, Common::kPlatformMacintosh, 0 },
- { "freddicove", "FreddiMML", kGenHEPC, Common::FR_FRA, UNK, 0 },
- { "freddicove", "FreddiMML", kGenHEMac, Common::FR_FRA, Common::kPlatformMacintosh, 0 },
- { "freddicove", "FFCoveDemo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "freddicove", "FreddiCoveDemo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "freddicove", "ff5demo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "freddicove", "FF5Demo", kGenHEMac, Common::NL_NLD, Common::kPlatformMacintosh, 0 },
-
{ "FreddisFunShop", "FreddisFunShop", kGenHEPC, UNK_LANG, UNK, 0 },
{ "FreddisFunShop", "Freddi's FunShop", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -661,9 +690,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "maze", "Doolhof", kGenHEMac, Common::NL_NLD, Common::kPlatformMacintosh, 0 },
{ "maze", "Maze Madness", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "moonbase", "moonbase", kGenHEPC, UNK_LANG, UNK, 0 },
- { "moonbase", "moondemo", kGenHEPC, UNK_LANG, UNK, 0 },
-
{ "mustard", "mustard", kGenHEPC, UNK_LANG, UNK, 0 },
{ "mustard", "Mustard", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -716,9 +742,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "pajama3", "PyjamaSKS", kGenHEMac, Common::DE_DEU, Common::kPlatformMacintosh, 0 },
{ "pajama3", "UKPajamaEAT", kGenHEPC, Common::RU_RUS, UNK, 0 },
- { "pjgames", "pjgames", kGenHEPC, UNK_LANG, UNK, 0 },
- { "pjgames", "PJGames", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
{ "puttcircus", "puttcircus", kGenHEPC, UNK_LANG, UNK, 0 },
{ "puttcircus", "circdemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "puttcircus", "CircusDemo", kGenHEPC, Common::FR_FRA, UNK, 0 },
@@ -788,11 +811,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "puttzoo", "Zoo Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "puttzoo", "Putt-Putt Saves the Zoo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "readtime", "Blue's Reading Time", kGenHEPC, UNK_LANG, UNK, 0 },
- { "readtime", "Blues-ReadingTime", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "readtime", "readDemo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "readtime", "Blues-ReadingTime Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
{ "SamsFunShop", "SamsFunShop", kGenHEPC, UNK_LANG, UNK, 0 },
{ "SamsFunShop", "Sam's FunShop", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -802,9 +820,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "SoccerMLS", "SoccerMLS", kGenHEPC, UNK_LANG, UNK, 0 },
{ "SoccerMLS", "Backyard Soccer MLS", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "Soccer2004", "Soccer2004", kGenHEPC, UNK_LANG, UNK, 0 },
- { "Soccer2004", "Soccer 2004", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
{ "socks", "socks", kGenHEPC, UNK_LANG, UNK, 0 },
{ "socks", "SockWorks", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "socks", "SokkenSoep", kGenHEPC, Common::NL_NLD, UNK, 0 },
@@ -846,17 +861,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "spyfox2", "SPYMini", kGenHEPC, UNK_LANG, UNK, 0 },
{ "spyfox2", "spy2preview.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
- { "spyozon", "spyozon", kGenHEPC, UNK_LANG, UNK, 0 },
- { "spyozon", "sf3-demo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "spyozon", "SF3Demo", kGenHEPC, Common::FR_FRA, UNK, 0 },
- { "spyozon", "Spy Ozone Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "spyozon", "SPYFoxAIW", kGenHEPC, Common::DE_DEU, UNK, 0 },
- { "spyozon", "SPYFoxOZU", kGenHEPC, UNK_LANG, UNK, 0 },
- { "spyozon", "SPYFoxSOS", kGenHEPC, Common::FR_FRA, UNK, 0 },
- { "spyozon", "SPYFoxSOS", kGenHEMac, Common::FR_FRA, Common::kPlatformMacintosh, 0 },
- { "spyozon", "SpyOzon", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "spyozon", "ozonepre.cup", kGenUnchanged, UNK_LANG, UNK, "HE CUP" },
-
{ "thinker1", "1grademo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "thinker1", "thinker1", kGenHEPC, UNK_LANG, UNK, 0 },
{ "thinker1", "Thinker1", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
--
cgit v1.2.3
From 7f251948f121f074542521e588bb85098ad4fc27 Mon Sep 17 00:00:00 2001
From: Torbjörn Andersson
Date: Fri, 21 Aug 2009 10:37:55 +0000
Subject: Fixed warning.
svn-id: r43585
---
graphics/conversion.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
index 1863814c1d..df9d7c4d6d 100644
--- a/graphics/conversion.cpp
+++ b/graphics/conversion.cpp
@@ -93,7 +93,6 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
} else {
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++, src += 3, dst += 3) {
- uint8 r, g, b, a;
memcpy(col, src, 3);
srcFmt.colorToARGB(color, a, r, g, b);
color = dstFmt.ARGBToColor(a, r, g, b);
--
cgit v1.2.3
From 14a8417548a43da4a463c7e845e5a6985404ba58 Mon Sep 17 00:00:00 2001
From: Torbjörn Andersson
Date: Fri, 21 Aug 2009 10:39:02 +0000
Subject: Added --disable-16bit to the list shown by --help.
svn-id: r43586
---
configure | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure b/configure
index 783c397402..bd4933c0dd 100755
--- a/configure
+++ b/configure
@@ -583,6 +583,7 @@ $engines_help
--enable-plugins enable the support for dynamic plugins
--default-dynamic make plugins dynamic by default
--disable-mt32emu don't enable the integrated MT-32 emulator
+ --disable-16bit don't enable 16bit color support
--disable-hq-scalers exclude HQ2x and HQ3x scalers
--disable-scalers exclude scalers
--enable-text-console use text console instead of graphical console
--
cgit v1.2.3
From 77c0905f39f6b3108ff0af1fe235b96b23a52680 Mon Sep 17 00:00:00 2001
From: Jody Northup
Date: Fri, 21 Aug 2009 10:43:52 +0000
Subject: Removed jpeg.cpp and jpeg.h files from the project, as they no longer
exist in trunk.
svn-id: r43588
---
dists/msvc8/scummvm.vcproj | 2 --
1 file changed, 2 deletions(-)
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index fd02ba0023..d1e42b69d6 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -362,8 +362,6 @@
-
-
--
cgit v1.2.3
From 5949bca7cca2a5b98d2533cd25ed96621bfb8dcc Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Fri, 21 Aug 2009 11:22:38 +0000
Subject: Sync MSVC9 files
svn-id: r43590
---
dists/msvc9/ScummVM_Global.vsprops | 2 +-
dists/msvc9/scummvm.vcproj | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dists/msvc9/ScummVM_Global.vsprops b/dists/msvc9/ScummVM_Global.vsprops
index afcfab102b..039722e157 100644
--- a/dists/msvc9/ScummVM_Global.vsprops
+++ b/dists/msvc9/ScummVM_Global.vsprops
@@ -10,7 +10,7 @@
Name="VCCLCompilerTool"
DisableSpecificWarnings="4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE"
+ PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR"
ExceptionHandling="0"
RuntimeTypeInfo="false"
WarningLevel="4"
diff --git a/dists/msvc9/scummvm.vcproj b/dists/msvc9/scummvm.vcproj
index 51c532a195..912778bcb4 100644
--- a/dists/msvc9/scummvm.vcproj
+++ b/dists/msvc9/scummvm.vcproj
@@ -1295,6 +1295,14 @@
RelativePath="..\..\graphics\colormasks.h"
>
+
+
+
+
--
cgit v1.2.3
From 1618e4652bbdf96c3d33e16e4a6146ac7bbedba0 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Fri, 21 Aug 2009 11:30:56 +0000
Subject: List RGB status in About dialog.
svn-id: r43591
---
base/version.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/base/version.cpp b/base/version.cpp
index eabafecc30..3d1ab783d0 100644
--- a/base/version.cpp
+++ b/base/version.cpp
@@ -86,6 +86,10 @@ const char *gScummVMFeatures = ""
"ALSA "
#endif
+#ifdef ENABLE_RGB_COLOR
+ "RGB "
+#endif
+
#ifdef USE_ZLIB
"zLib "
#endif
--
cgit v1.2.3
From 8acb89645f87ac27f46b224f0a983e9eeca08c57 Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Fri, 21 Aug 2009 13:52:43 +0000
Subject: Add JPEG decoder from 16bpp branch
svn-id: r43596
---
graphics/jpeg.cpp | 638 +++++++++++++++++++++++++++++++++++++++++++++++++++++
graphics/jpeg.h | 118 ++++++++++
graphics/module.mk | 1 +
3 files changed, 757 insertions(+)
create mode 100644 graphics/jpeg.cpp
create mode 100644 graphics/jpeg.h
diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp
new file mode 100644
index 0000000000..0ad2cf7699
--- /dev/null
+++ b/graphics/jpeg.cpp
@@ -0,0 +1,638 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "graphics/jpeg.h"
+
+#include "common/endian.h"
+#include "common/util.h"
+
+namespace Graphics {
+
+// Order used to traverse the quantization tables
+uint8 JPEG::_zigZagOrder[64] = {
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63
+};
+
+JPEG::JPEG() :
+ _str(NULL), _w(0), _h(0), _numComp(0), _components(NULL), _numScanComp(0),
+ _scanComp(NULL), _currentComp(NULL) {
+
+ // Initialize the quantization tables
+ for (int i = 0; i < JPEG_MAX_QUANT_TABLES; i++)
+ _quant[i] = NULL;
+
+ // Initialize the Huffman tables
+ for (int i = 0; i < 2 * JPEG_MAX_HUFF_TABLES; i++) {
+ _huff[i].count = 0;
+ _huff[i].values = NULL;
+ _huff[i].sizes = NULL;
+ _huff[i].codes = NULL;
+ }
+}
+
+JPEG::~JPEG() {
+ reset();
+}
+
+void JPEG::reset() {
+ // Reset member variables
+ _str = NULL;
+ _w = _h = 0;
+
+ // Free the components
+ for (int c = 0; c < _numComp; c++)
+ _components[c].surface.free();
+ delete[] _components; _components = NULL;
+ _numComp = 0;
+
+ // Free the scan components
+ delete[] _scanComp; _scanComp = NULL;
+ _numScanComp = 0;
+ _currentComp = NULL;
+
+ // Free the quantization tables
+ for (int i = 0; i < JPEG_MAX_QUANT_TABLES; i++) {
+ delete[] _quant[i];
+ _quant[i] = NULL;
+ }
+
+ // Free the Huffman tables
+ for (int i = 0; i < 2 * JPEG_MAX_HUFF_TABLES; i++) {
+ _huff[i].count = 0;
+ delete[] _huff[i].values; _huff[i].values = NULL;
+ delete[] _huff[i].sizes; _huff[i].sizes = NULL;
+ delete[] _huff[i].codes; _huff[i].codes = NULL;
+ }
+}
+
+bool JPEG::read(Common::SeekableReadStream *str) {
+ // Reset member variables and tables from previous reads
+ reset();
+
+ // Save the input stream
+ _str = str;
+
+ bool ok = true;
+ bool done = false;
+ while (!_str->eos() && ok && !done) {
+ // Read the marker
+ uint16 marker = _str->readByte();
+ if (marker != 0xFF) {
+ error("JPEG: Invalid marker[0]: 0x%02X", marker);
+ ok = false;
+ break;
+ }
+
+ while (marker == 0xFF)
+ marker = _str->readByte();
+
+ // Process the marker data
+ switch (marker) {
+ case 0xC0: // Start Of Frame
+ ok = readSOF0();
+ break;
+ case 0xC4: // Define Huffman Tables
+ ok = readDHT();
+ break;
+ case 0xD8: // Start Of Image
+ break;
+ case 0xD9: // End Of Image
+ done = true;
+ break;
+ case 0xDA: // Start Of Scan
+ ok = readSOS();
+ break;
+ case 0xDB: // Define Quantization Tables
+ ok = readDQT();
+ break;
+ case 0xE0: // JFIF/JFXX segment
+ ok = readJFIF();
+ break;
+ case 0xFE: // Comment
+ _str->seek(_str->readUint16BE() - 2, SEEK_CUR);
+ break;
+ default: { // Unknown marker
+ uint16 size = _str->readUint16BE();
+ warning("JPEG: Unknown marker %02X, skipping %d bytes", marker, size - 2);
+ _str->seek(size - 2, SEEK_CUR);
+ }
+ }
+ }
+ return ok;
+}
+
+bool JPEG::readJFIF() {
+ /* uint16 length = */ _str->readUint16BE();
+ uint32 tag = _str->readUint32BE();
+ if (tag != MKID_BE('JFIF'))
+ return false;
+ _str->readByte(); // NULL
+ /* byte majorVersion = */ _str->readByte();
+ /* byte minorVersion = */ _str->readByte();
+ /* byte densityUnits = */ _str->readByte();
+ /* uint16 xDensity = */ _str->readUint16BE();
+ /* uint16 yDensity = */ _str->readUint16BE();
+ byte thumbW = _str->readByte();
+ byte thumbH = _str->readByte();
+ _str->seek(thumbW * thumbH * 3, SEEK_CUR); // Ignore thumbnail
+ return true;
+}
+
+// Marker 0xC0 (Start Of Frame, Baseline DCT)
+bool JPEG::readSOF0() {
+ debug(5, "JPEG: readSOF0");
+ uint16 size = _str->readUint16BE();
+
+ // Read the sample precision
+ uint8 precision = _str->readByte();
+ if (precision != 8) {
+ warning("JPEG: Just 8 bit precision supported at the moment");
+ return false;
+ }
+
+ // Image size
+ _h = _str->readUint16BE();
+ _w = _str->readUint16BE();
+
+ // Number of components
+ _numComp = _str->readByte();
+ if (size != 8 + 3 * _numComp) {
+ warning("JPEG: Invalid number of components");
+ return false;
+ }
+
+ // Allocate the new components
+ delete[] _components;
+ _components = new Component[_numComp];
+
+ // Read the components details
+ for (int c = 0; c < _numComp; c++) {
+ _components[c].id = _str->readByte();
+ _components[c].factorH = _str->readByte();
+ _components[c].factorV = _components[c].factorH & 0xF;
+ _components[c].factorH >>= 4;
+ _components[c].quantTableSelector = _str->readByte();
+ }
+
+ return true;
+}
+
+// Marker 0xC4 (Define Huffman Tables)
+bool JPEG::readDHT() {
+ debug(5, "JPEG: readDHT");
+ uint16 size = _str->readUint16BE() - 2;
+ uint32 pos = _str->pos();
+
+ while ((uint32)_str->pos() < (size + pos)) {
+ // Read the table type and id
+ uint8 tableId = _str->readByte();
+ uint8 tableType = tableId >> 4; // type 0: DC, 1: AC
+ tableId &= 0xF;
+ uint8 tableNum = (tableId << 1) + tableType;
+
+ // Free the Huffman table
+ delete[] _huff[tableNum].values; _huff[tableNum].values = NULL;
+ delete[] _huff[tableNum].sizes; _huff[tableNum].sizes = NULL;
+ delete[] _huff[tableNum].codes; _huff[tableNum].codes = NULL;
+
+ // Read the number of values for each length
+ uint8 numValues[16];
+ _huff[tableNum].count = 0;
+ for (int len = 0; len < 16; len++) {
+ numValues[len] = _str->readByte();
+ _huff[tableNum].count += numValues[len];
+ }
+
+ // Allocate memory for the current table
+ _huff[tableNum].values = new uint8[_huff[tableNum].count];
+ _huff[tableNum].sizes = new uint8[_huff[tableNum].count];
+ _huff[tableNum].codes = new uint16[_huff[tableNum].count];
+
+ // Read the table contents
+ int cur = 0;
+ for (int len = 0; len < 16; len++) {
+ for (int i = 0; i < numValues[len]; i++) {
+ _huff[tableNum].values[cur] = _str->readByte();
+ _huff[tableNum].sizes[cur] = len + 1;
+ cur++;
+ }
+ }
+
+ // Fill the table of Huffman codes
+ cur = 0;
+ uint16 curCode = 0;
+ uint8 curCodeSize = _huff[tableNum].sizes[0];
+ while (cur < _huff[tableNum].count) {
+ // Increase the code size to fit the request
+ while (_huff[tableNum].sizes[cur] != curCodeSize) {
+ curCode <<= 1;
+ curCodeSize++;
+ }
+
+ // Assign the current code
+ _huff[tableNum].codes[cur] = curCode;
+ curCode++;
+ cur++;
+ }
+ }
+
+ return true;
+}
+
+// Marker 0xDA (Start Of Scan)
+bool JPEG::readSOS() {
+ debug(5, "JPEG: readSOS");
+ uint16 size = _str->readUint16BE();
+
+ // Number of scan components
+ _numScanComp = _str->readByte();
+ if (size != 6 + 2 * _numScanComp) {
+ warning("JPEG: Invalid number of components");
+ return false;
+ }
+
+ // Allocate the new scan components
+ delete[] _scanComp;
+ _scanComp = new Component *[_numScanComp];
+
+ // Reset the maximum sampling factors
+ _maxFactorV = 0;
+ _maxFactorH = 0;
+
+ // Component-specification parameters
+ for (int c = 0; c < _numScanComp; c++) {
+ // Read the desired component id
+ uint8 id = _str->readByte();
+
+ // Search the component with the specified id
+ bool found = false;
+ for (int i = 0; !found && i < _numComp; i++) {
+ if (_components[i].id == id) {
+ // We found the desired component
+ found = true;
+
+ // Assign the found component to the c'th scan component
+ _scanComp[c] = &_components[i];
+ }
+ }
+
+ if (!found) {
+ warning("JPEG: Invalid component");
+ return false;
+ }
+
+ // Read the entropy table selectors
+ _scanComp[c]->DCentropyTableSelector = _str->readByte();
+ _scanComp[c]->ACentropyTableSelector = _scanComp[c]->DCentropyTableSelector & 0xF;
+ _scanComp[c]->DCentropyTableSelector >>= 4;
+
+ // Calculate the maximum sampling factors
+ if (_scanComp[c]->factorV > _maxFactorV)
+ _maxFactorV = _scanComp[c]->factorV;
+
+ if (_scanComp[c]->factorH > _maxFactorH)
+ _maxFactorH = _scanComp[c]->factorH;
+
+ // Initialize the DC predictor
+ _scanComp[c]->DCpredictor = 0;
+ }
+
+ // Initialize the scan surfaces
+ for (int c = 0; c < _numScanComp; c++)
+ _scanComp[c]->surface.create(_w, _h, 1);
+
+ // Start of spectral selection
+ if (_str->readByte() != 0) {
+ warning("JPEG: Progressive scanning not supported");
+ return false;
+ }
+
+ // End of spectral selection
+ if (_str->readByte() != 63) {
+ warning("JPEG: Progressive scanning not supported");
+ return false;
+ }
+
+ // Successive approximation parameters
+ if (_str->readByte() != 0) {
+ warning("JPEG: Progressive scanning not supported");
+ return false;
+ }
+
+ // Entropy coded sequence starts, initialize Huffman decoder
+ _bitsNumber = 0;
+
+ // Read all the scan MCUs
+ uint16 xMCU = _w / (_maxFactorH * 8);
+ uint16 yMCU = _h / (_maxFactorV * 8);
+
+ // Check for non- multiple-of-8 dimensions
+ if (_w % 8 != 0)
+ xMCU++;
+ if (_h % 8 != 0)
+ yMCU++;
+
+ bool ok = true;
+ for (int y = 0; ok && (y < yMCU); y++)
+ for (int x = 0; ok && (x < xMCU); x++)
+ ok = readMCU(x, y);
+
+ return ok;
+}
+
+// Marker 0xDB (Define Quantization Tables)
+bool JPEG::readDQT() {
+ debug(5, "JPEG: readDQT");
+ uint16 size = _str->readUint16BE() - 2;
+ uint32 pos = _str->pos();
+
+ while ((uint32)_str->pos() < (pos + size)) {
+ // Read the table precision and id
+ uint8 tableId = _str->readByte();
+ bool highPrecision = (tableId & 0xF0) != 0;
+
+ // Validate the table id
+ tableId &= 0xF;
+ if (tableId > JPEG_MAX_QUANT_TABLES) {
+ warning("JPEG: Invalid number of components");
+ return false;
+ }
+
+ // Create the new table if necessary
+ if (!_quant[tableId])
+ _quant[tableId] = new uint16[64];
+
+ // Read the table (stored in Zig-Zag order)
+ for (int i = 0; i < 64; i++)
+ _quant[tableId][i] = highPrecision ? _str->readUint16BE() : _str->readByte();
+ }
+
+ return true;
+}
+
+bool JPEG::readMCU(uint16 xMCU, uint16 yMCU) {
+ bool ok = true;
+ for (int c = 0; ok && (c < _numComp); c++) {
+ // Set the current component
+ _currentComp = _scanComp[c];
+
+ // Read the data units of the current component
+ for (int y = 0; ok && (y < _scanComp[c]->factorV); y++)
+ for (int x = 0; ok && (x < _scanComp[c]->factorH); x++)
+ ok = readDataUnit(xMCU * _scanComp[c]->factorH + x, yMCU * _scanComp[c]->factorV + y);
+ }
+
+ return ok;
+}
+
+float JPEG::idct(int x, int y, int weight, int fx, int fy) {
+ float vx = cos((2 * x + 1) * fx * PI / 16);
+ float vy = cos((2 * y + 1) * fy * PI / 16);
+ float ret = (float)weight * vx * vy;
+
+ if (fx == 0)
+ ret /= sqrt(2.0f);
+
+ if (fy == 0)
+ ret /= sqrt(2.0f);
+
+ return ret;
+}
+
+bool JPEG::readDataUnit(uint16 x, uint16 y) {
+ // Prepare an empty data array
+ int16 readData[64];
+ for (int i = 1; i < 64; i++)
+ readData[i] = 0;
+
+ // Read the DC component
+ readData[0] = _currentComp->DCpredictor + readDC();
+ _currentComp->DCpredictor = readData[0];
+
+ // Read the AC components (stored in Zig-Zag)
+ readAC(readData);
+
+ // Calculate the DCT coefficients from the input sequence
+ int16 DCT[64];
+ for (int i = 0; i < 64; i++) {
+ // Dequantize
+ int16 val = readData[i];
+ int16 quant = _quant[_currentComp->quantTableSelector][i];
+ val *= quant;
+
+ // Store the normalized coefficients, undoing the Zig-Zag
+ DCT[_zigZagOrder[i]] = val;
+ }
+
+ // Shortcut the IDCT for DC component
+ float result[64];
+ for (int i = 0; i < 64; i++)
+ result[i] = DCT[0] / 2;
+
+ // Apply the IDCT (PAG31)
+ for (int i = 1; i < 64; i++) {
+ if (DCT[i])
+ for (int _y = 0; _y < 8; _y++)
+ for (int _x = 0; _x < 8; _x++)
+ result[_y * 8 + _x] += idct(_x, _y, DCT[i], i % 8, i / 8);
+ }
+
+ // Level shift to make the values unsigned
+ // Divide by 4 is final part of IDCT
+ for (int i = 0; i < 64; i++) {
+ result[i] = result[i] / 4 + 128;
+
+ if (result[i] < 0)
+ result[i] = 0;
+
+ if (result[i] > 255)
+ result[i] = 255;
+ }
+
+ // Paint the component surface
+ uint8 scalingV = _maxFactorV / _currentComp->factorV;
+ uint8 scalingH = _maxFactorH / _currentComp->factorH;
+
+ // Convert coordinates from MCU blocks to pixels
+ x <<= 3;
+ y <<= 3;
+
+ // Handle non- multiple-of-8 dimensions
+ byte xLim = 8;
+ byte yLim = 8;
+ if (x*scalingH + 8 > _w)
+ xLim -= (x*scalingH + 8 - _w);
+ if (y*scalingV + 8 > _h)
+ yLim -= (y*scalingV + 8 - _h);
+
+ for (int j = 0; j < yLim; j++) {
+ for (int sV = 0; sV < scalingV; sV++) {
+ // Get the beginning of the block line
+ byte *ptr = (byte *)_currentComp->surface.getBasePtr(x * scalingH, (y + j) * scalingV + sV);
+
+ for (int i = 0; i < xLim; i++) {
+ for (uint8 sH = 0; sH < scalingH; sH++) {
+ *ptr = (byte)(result[j * 8 + i]);
+ ptr++;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+int16 JPEG::readDC() {
+ // DC is type 0
+ uint8 tableNum = _currentComp->DCentropyTableSelector << 1;
+
+ // Get the number of bits to read
+ uint8 numBits = readHuff(tableNum);
+
+ // Read the requested bits
+ return readSignedBits(numBits);
+}
+
+void JPEG::readAC(int16 *out) {
+ // AC is type 1
+ uint8 tableNum = (_currentComp->ACentropyTableSelector << 1) + 1;
+
+ // Start reading AC element 1
+ uint8 cur = 1;
+ while (cur < 64) {
+ uint8 s = readHuff(tableNum);
+ uint8 r = s >> 4;
+ s &= 0xF;
+
+ if (s == 0) {
+ if (r == 15) {
+ // Skip 16 values
+ cur += 16;
+ } else {
+ // EOB: end of block
+ cur = 64;
+ }
+ } else {
+ // Skip r values
+ cur += r;
+
+ // Read the next value
+ out[cur] = readSignedBits(s);
+ cur++;
+ }
+ }
+}
+
+int16 JPEG::readSignedBits(uint8 numBits) {
+ uint16 ret = 0;
+ if (numBits > 16) error("requested %d bits", numBits); //XXX
+
+ // MSB=0 for negatives, 1 for positives
+ for (int i = 0; i < numBits; i++)
+ ret = (ret << 1) + readBit();
+
+ // Extend sign bits (PAG109)
+ if (!(ret >> (numBits - 1)))
+ {
+ uint16 tmp = ((uint16)-1 << numBits) + 1;
+ ret = ret + tmp;
+ }
+ return ret;
+}
+
+// TODO: optimize?
+uint8 JPEG::readHuff(uint8 table) {
+ bool foundCode = false;
+ uint8 val = 0;
+
+ uint8 cur = 0;
+ uint8 codeSize = 1;
+ uint16 code = readBit();
+ while (!foundCode) {
+ // Prepare a code of the current size
+ while (codeSize < _huff[table].sizes[cur]) {
+ code = (code << 1) + readBit();
+ codeSize++;
+ }
+
+ // Compare the codes of the current size
+ while (!foundCode && (codeSize == _huff[table].sizes[cur])) {
+ if (code == _huff[table].codes[cur]) {
+ // Found the code
+ val = _huff[table].values[cur];
+ foundCode = true;
+ } else {
+ // Continue reading
+ cur++;
+ }
+ }
+ }
+
+ return val;
+}
+
+uint8 JPEG::readBit() {
+ // Read a whole byte if necessary
+ if (_bitsNumber == 0) {
+ _bitsData = _str->readByte();
+ _bitsNumber = 8;
+
+ // Detect markers
+ if (_bitsData == 0xFF) {
+ uint8 byte2 = _str->readByte();
+
+ // A stuffed 0 validates the previous byte
+ if (byte2 != 0) {
+ if (byte2 == 0xDC) {
+ // DNL marker: Define Number of Lines
+ // TODO: terminate scan
+ printf("DNL marker detected: terminate scan\n");
+ } else {
+ printf("Error: marker 0x%02X read in entropy data\n", byte2);
+ }
+ }
+ }
+ }
+ _bitsNumber--;
+
+ return (_bitsData & (1 << _bitsNumber)) ? 1 : 0;
+}
+
+Surface *JPEG::getComponent(uint c) {
+ for (int i = 0; i < _numComp; i++)
+ if (_components[i].id == c) // We found the desired component
+ return &_components[i].surface;
+
+ return NULL;
+}
+
+} // End of Graphics namespace
diff --git a/graphics/jpeg.h b/graphics/jpeg.h
new file mode 100644
index 0000000000..f4743a5e83
--- /dev/null
+++ b/graphics/jpeg.h
@@ -0,0 +1,118 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GRAPHICS_JPEG_H
+#define GRAPHICS_JPEG_H
+
+#include "common/stream.h"
+#include "graphics/surface.h"
+
+namespace Graphics {
+
+#define JPEG_MAX_QUANT_TABLES 4
+#define JPEG_MAX_HUFF_TABLES 2
+
+class JPEG {
+public:
+ JPEG();
+ ~JPEG();
+
+ bool read(Common::SeekableReadStream *str);
+ Surface *getComponent(uint c);
+
+private:
+ void reset();
+
+ Common::SeekableReadStream *_str;
+ uint16 _w, _h;
+
+ // Image components
+ uint8 _numComp;
+ struct Component {
+ // Global values
+ uint8 id;
+ uint8 factorH;
+ uint8 factorV;
+ uint8 quantTableSelector;
+
+ // Scan specific values
+ uint8 DCentropyTableSelector;
+ uint8 ACentropyTableSelector;
+ int16 DCpredictor;
+
+ // Result image for this component
+ Surface surface;
+ } *_components;
+
+ // Scan components
+ uint8 _numScanComp;
+ Component **_scanComp;
+ Component *_currentComp;
+
+ // Maximum sampling factors, used to calculate the interleaving of the MCU
+ uint8 _maxFactorV;
+ uint8 _maxFactorH;
+
+ // Zig-Zag order
+ static uint8 _zigZagOrder[64];
+
+ // Quantization tables
+ uint16 *_quant[JPEG_MAX_QUANT_TABLES];
+
+ // Huffman tables
+ struct HuffmanTable {
+ uint8 count;
+ uint8 *values;
+ uint8 *sizes;
+ uint16 *codes;
+ } _huff[2 * JPEG_MAX_HUFF_TABLES];
+
+ // Marker read functions
+ bool readJFIF();
+ bool readSOF0();
+ bool readDHT();
+ bool readSOS();
+ bool readDQT();
+
+ // Helper functions
+ bool readMCU(uint16 xMCU, uint16 yMCU);
+ bool readDataUnit(uint16 x, uint16 y);
+ int16 readDC();
+ void readAC(int16 *out);
+ int16 readSignedBits(uint8 numBits);
+
+ // Huffman decoding
+ uint8 readHuff(uint8 table);
+ uint8 readBit();
+ uint8 _bitsData;
+ uint8 _bitsNumber;
+
+ // Discrete Cosine Transformation
+ float idct(int x, int y, int weight, int fx, int fy);
+};
+
+} // End of Graphics namespace
+
+#endif // GRAPHICS_JPEG_H
diff --git a/graphics/module.mk b/graphics/module.mk
index 04a98dd8e2..ed14051243 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS := \
fonts/scummfont.o \
iff.o \
imagedec.o \
+ jpeg.o \
primitives.o \
scaler.o \
scaler/thumbnail_intern.o \
--
cgit v1.2.3
From aad7d1536f867b1335ea1aa389ccc29d4d073f64 Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Fri, 21 Aug 2009 13:53:48 +0000
Subject: Sync MSVC project files for JPEG
svn-id: r43597
---
dists/msvc8/scummvm.vcproj | 2 ++
dists/msvc9/scummvm.vcproj | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index d1e42b69d6..47555e36ff 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -364,6 +364,8 @@
+
+
diff --git a/dists/msvc9/scummvm.vcproj b/dists/msvc9/scummvm.vcproj
index 912778bcb4..9dcc1e9c51 100644
--- a/dists/msvc9/scummvm.vcproj
+++ b/dists/msvc9/scummvm.vcproj
@@ -1351,6 +1351,14 @@
RelativePath="..\..\graphics\imagedec.h"
>
+
+
+
+
--
cgit v1.2.3
From 58f8ec5d5789375b6f7f1b2b84748fc6256e8e54 Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Fri, 21 Aug 2009 13:57:03 +0000
Subject: Groovie: Sync changes from 16bpp branch. Hopefully no regressions
sneak in here
svn-id: r43598
---
engines/groovie/graphics.cpp | 4 +-
engines/groovie/groovie.cpp | 22 +++++-
engines/groovie/groovie.h | 2 +
engines/groovie/roq.cpp | 162 +++++++++++++++++++++++++++----------------
engines/groovie/script.cpp | 90 +++++++++++++++---------
engines/groovie/script.h | 7 +-
6 files changed, 191 insertions(+), 96 deletions(-)
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index 647eaa913b..1e54f0e79b 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -31,8 +31,8 @@ namespace Groovie {
GraphicsMan::GraphicsMan(GroovieEngine *vm) :
_vm(vm), _changed(false), _fading(0) {
// Create the game surfaces
- _foreground.create(640, 320, 1);
- _background.create(640, 320, 1);
+ _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
+ _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
}
GraphicsMan::~GraphicsMan() {
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 9381b5b47c..bb4e142196 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -70,7 +70,20 @@ GroovieEngine::~GroovieEngine() {
Common::Error GroovieEngine::run() {
// Initialize the graphics
- initGraphics(640, 480, true);
+ switch (_gameDescription->version) {
+ case kGroovieV2:
+ // Request the mode with the highest precision available
+ initGraphics(640, 480, true, NULL);
+
+ // Save the enabled mode as it can be both an RGB mode or CLUT8
+ _pixelFormat = _system->getScreenFormat();
+ _mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8());
+ break;
+ case kGroovieT7G:
+ initGraphics(640, 480, true);
+ _pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
+ break;
+ }
// Create debugger. It requires GFX to be initialized
_debugger = new Debugger(this);
@@ -204,13 +217,18 @@ Common::Error GroovieEngine::run() {
case Common::EVENT_LBUTTONDOWN:
// Send the event to the scripts
- _script.setMouseClick();
+ _script.setMouseClick(1);
// Continue the script execution to handle
// the click
_waitingForInput = false;
break;
+ case Common::EVENT_RBUTTONDOWN:
+ // Send the event to the scripts (to skip the video)
+ _script.setMouseClick(2);
+ break;
+
case Common::EVENT_QUIT:
quitGame();
break;
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index a137193adf..bf57ae77de 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -85,6 +85,8 @@ protected:
public:
void waitForInput();
+ Graphics::PixelFormat _pixelFormat;
+ bool _mode8bit;
Script _script;
ResMan *_resMan;
GrvCursorMan *_grvCursorMan;
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index dcb8eafcb8..538b1b7111 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -29,6 +29,12 @@
#include "groovie/groovie.h"
#include "groovie/roq.h"
+#include "graphics/jpeg.h"
+
+#ifdef ENABLE_RGB_COLOR
+// Required for the YUV to RGB conversion
+#include "graphics/conversion.h"
+#endif
#include "sound/mixer.h"
namespace Groovie {
@@ -43,50 +49,52 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
_currBuf = new Graphics::Surface();
_prevBuf = new Graphics::Surface();
- byte pal[256 * 4];
+ if (_vm->_mode8bit) {
+ byte pal[256 * 4];
#ifdef DITHER
- byte pal3[256 * 3];
- // Initialize to a black palette
- for (int i = 0; i < 256 * 3; i++) {
- pal3[i] = 0;
- }
-
- // Build a basic color palette
- for (int r = 0; r < 4; r++) {
- for (int g = 0; g < 4; g++) {
- for (int b = 0; b < 4; b++) {
- byte col = (r << 4) | (g << 2) | (b << 0);
- pal3[3 * col + 0] = r << 6;
- pal3[3 * col + 1] = g << 6;
- pal3[3 * col + 2] = b << 6;
+ byte pal3[256 * 3];
+ // Initialize to a black palette
+ for (int i = 0; i < 256 * 3; i++) {
+ pal3[i] = 0;
+ }
+
+ // Build a basic color palette
+ for (int r = 0; r < 4; r++) {
+ for (int g = 0; g < 4; g++) {
+ for (int b = 0; b < 4; b++) {
+ byte col = (r << 4) | (g << 2) | (b << 0);
+ pal3[3 * col + 0] = r << 6;
+ pal3[3 * col + 1] = g << 6;
+ pal3[3 * col + 2] = b << 6;
+ }
}
}
- }
- // Initialize the dithering algorithm
- _paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
- _paletteLookup->setPalette(pal3, Graphics::PaletteLUT::kPaletteRGB, 8);
- for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
- debug("Groovie::ROQ: Building palette table: %02d/63", i);
- _paletteLookup->buildNext();
- }
+ // Initialize the dithering algorithm
+ _paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
+ _paletteLookup->setPalette(pal3, Graphics::PaletteLUT::kPaletteRGB, 8);
+ for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
+ debug("Groovie::ROQ: Building palette table: %02d/63", i);
+ _paletteLookup->buildNext();
+ }
- // Prepare the palette to show
- for (int i = 0; i < 256; i++) {
- pal[(i * 4) + 0] = pal3[(i * 3) + 0];
- pal[(i * 4) + 1] = pal3[(i * 3) + 1];
- pal[(i * 4) + 2] = pal3[(i * 3) + 2];
- }
-#else
- // Set a grayscale palette
- for (int i = 0; i < 256; i++) {
- pal[(i * 4) + 0] = i;
- pal[(i * 4) + 1] = i;
- pal[(i * 4) + 2] = i;
- }
-#endif
+ // Prepare the palette to show
+ for (int i = 0; i < 256; i++) {
+ pal[(i * 4) + 0] = pal3[(i * 3) + 0];
+ pal[(i * 4) + 1] = pal3[(i * 3) + 1];
+ pal[(i * 4) + 2] = pal3[(i * 3) + 2];
+ }
+#else // !DITHER
+ // Set a grayscale palette
+ for (int i = 0; i < 256; i++) {
+ pal[(i * 4) + 0] = i;
+ pal[(i * 4) + 1] = i;
+ pal[(i * 4) + 2] = i;
+ }
+#endif // DITHER
- _syst->setPalette(pal, 0, 256);
+ _syst->setPalette(pal, 0, 256);
+ }
}
ROQPlayer::~ROQPlayer() {
@@ -152,22 +160,39 @@ void ROQPlayer::buildShowBuf() {
for (int line = 0; line < _showBuf.h; line++) {
byte *out = (byte *)_showBuf.getBasePtr(0, line);
- byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
+ byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _showBuf.w; x++) {
+ if (_vm->_mode8bit) {
#ifdef DITHER
- *out = _dither->dither(*in, *(in + 1), *(in + 2), x);
+ *out = _dither->dither(*in, *(in + 1), *(in + 2), x);
#else
- // Just use the luminancy component
- *out = *in;
-#endif
- out++;
+ // Just use the luminancy component
+ *out = *in;
+#endif // DITHER
+#ifdef ENABLE_RGB_COLOR
+ } else {
+ // Do the format conversion (YUV -> RGB -> Screen format)
+ byte r, g, b;
+ Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
+ // FIXME: this is fixed to 16bit
+ *(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
+#endif // ENABLE_RGB_COLOR
+ }
+
+ // Skip to the next pixel
+ out += _vm->_pixelFormat.bytesPerPixel;
if (!(x % _scaleX))
- in += _prevBuf->bytesPerPixel;
+ in += _currBuf->bytesPerPixel;
}
#ifdef DITHER
_dither->nextLine();
#endif
}
+
+ // Swap buffers
+ Graphics::Surface *tmp = _prevBuf;
+ _prevBuf = _currBuf;
+ _currBuf = tmp;
}
bool ROQPlayer::playFrameInternal() {
@@ -180,7 +205,7 @@ bool ROQPlayer::playFrameInternal() {
}
if (_dirty) {
- // Build the show buffer from the previous (back) buffer
+ // Build the show buffer from the current buffer
buildShowBuf();
}
@@ -189,7 +214,7 @@ bool ROQPlayer::playFrameInternal() {
if (_dirty) {
// Update the screen
- _syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.w, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.pitch, _showBuf.h);
+ _syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.pitch, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.w, _showBuf.h);
_syst->updateScreen();
// Clear the dirty flag
@@ -240,19 +265,15 @@ bool ROQPlayer::processBlock() {
case 0x1002: // Quad codebook definition
ok = processBlockQuadCodebook(blockHeader);
break;
- case 0x1011: { // Quad vector quantised video frame
+ case 0x1011: // Quad vector quantised video frame
ok = processBlockQuadVector(blockHeader);
_dirty = true;
endframe = true;
-
- // Swap buffers
- Graphics::Surface *tmp = _prevBuf;
- _prevBuf = _currBuf;
- _currBuf = tmp;
break;
- }
case 0x1012: // Still image (JPEG)
ok = processBlockStill(blockHeader);
+ _dirty = true;
+ endframe = true;
break;
case 0x1013: // Hang
assert(blockHeader.size == 0 && blockHeader.param == 0);
@@ -317,7 +338,19 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
// Allocate new buffers
_currBuf->create(width, height, 3);
_prevBuf->create(width, height, 3);
- _showBuf.create(width * _scaleX, height * _scaleY, 1);
+ _showBuf.create(width * _scaleX, height * _scaleY, _vm->_pixelFormat.bytesPerPixel);
+
+ // Clear the buffers with black YUV values
+ byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0);
+ byte *ptr2 = (byte *)_prevBuf->getBasePtr(0, 0);
+ for (int i = 0; i < width * height; i++) {
+ *ptr1++ = 0;
+ *ptr1++ = 128;
+ *ptr1++ = 128;
+ *ptr2++ = 0;
+ *ptr2++ = 128;
+ *ptr2++ = 128;
+ }
#ifdef DITHER
// Reset the dithering algorithm with the new width
@@ -456,10 +489,23 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in
bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block");
- warning("Groovie::ROQ: JPEG frame (unimplemented)");
- memset(_prevBuf->getBasePtr(0, 0), 0, _prevBuf->w * _prevBuf->h * _prevBuf->bytesPerPixel);
+ warning("Groovie::ROQ: JPEG frame (unfinshed)");
+
+ Graphics::JPEG *jpg = new Graphics::JPEG();
+ jpg->read(_file);
+ byte *y = (byte *)jpg->getComponent(1)->getBasePtr(0, 0);
+ byte *u = (byte *)jpg->getComponent(2)->getBasePtr(0, 0);
+ byte *v = (byte *)jpg->getComponent(3)->getBasePtr(0, 0);
+
+ byte *ptr = (byte *)_currBuf->getBasePtr(0, 0);
+ for (int i = 0; i < _currBuf->w * _currBuf->h; i++) {
+ *ptr++ = *y++;
+ *ptr++ = *u++;
+ *ptr++ = *v++;
+ }
+ memcpy(_prevBuf->getBasePtr(0, 0), _currBuf->getBasePtr(0, 0), _prevBuf->w * _prevBuf->h * 3);
- _file->skip(blockHeader.size);
+ delete jpg;
return true;
}
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 5ee58184f2..2ef3df56a1 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -102,6 +102,7 @@ Script::Script(GroovieEngine *vm, EngineVersion version) :
_hotspotSlot = (uint16)-1;
_oldInstruction = (uint16)-1;
+ _videoSkipAddress = 0;
}
Script::~Script() {
@@ -235,8 +236,8 @@ void Script::step() {
(this->*op)();
}
-void Script::setMouseClick() {
- _eventMouseClicked = true;
+void Script::setMouseClick(uint8 button) {
+ _eventMouseClicked = button;
}
void Script::setKbdChar(uint8 c) {
@@ -359,7 +360,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) {
Common::isDebugChannelEnabled(kGroovieDebugAll)) {
rect.translate(0, -80);
_vm->_graphicsMan->_foreground.frameRect(rect, 250);
- _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), 640, 0, 80, 640, 320);
+ _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320);
_vm->_system->updateScreen();
}
@@ -559,6 +560,21 @@ bool Script::playvideofromref(uint32 fileref) {
}
_bitflags = 0;
+
+ // Reset the clicked mouse events
+ _eventMouseClicked = 0;
+ }
+
+ // Check if the user wants to skip the video
+ if ((_eventMouseClicked == 2) && (_videoSkipAddress != 0)) {
+ // Jump to the given address
+ _currentInstruction = _videoSkipAddress;
+
+ // Reset the skip address
+ _videoSkipAddress = 0;
+
+ // End the playback
+ return true;
}
// Video available, play one frame
@@ -573,7 +589,7 @@ bool Script::playvideofromref(uint32 fileref) {
_videoRef = 0;
// Clear the input events while playing the video
- _eventMouseClicked = false;
+ _eventMouseClicked = 0;
_eventKbdChar = 0;
// Newline
@@ -604,8 +620,8 @@ void Script::o_inputloopstart() { //0x0B
_inputLoopAddress = _currentInstruction - 1;
// Save the current mouse state for the whole loop
- _mouseClicked = _eventMouseClicked;
- _eventMouseClicked = false;
+ _mouseClicked = (_eventMouseClicked == 1);
+ _eventMouseClicked = 0;
// Save the current pressed character for the whole loop
_kbdChar = _eventKbdChar;
@@ -1535,20 +1551,19 @@ void Script::o_stub59() {
debugScript(1, true, "STUB59: 0x%04X 0x%02X", val1, val2);
}
-void Script::o2_playsong(){
+void Script::o2_playsong() {
uint32 fileref = readScript32bits();
debugScript(1, true, "PlaySong(0x%08X): Play xmidi file", fileref);
_vm->_musicPlayer->playSong(fileref);
-
}
-void Script::o2_setbackgroundsong(){
+void Script::o2_setbackgroundsong() {
uint32 fileref = readScript32bits();
debugScript(1, true, "SetBackgroundSong(0x%08X)", fileref);
_vm->_musicPlayer->setBackgroundSong(fileref);
}
-void Script::o2_videofromref(){
+void Script::o2_videofromref() {
uint32 fileref = readScript32bits();
// Show the debug information just when starting the playback
@@ -1556,6 +1571,7 @@ void Script::o2_videofromref(){
debugScript(1, true, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref);
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X via 0x09", fileref);
}
+
// Play the video
if (!playvideofromref(fileref)) {
// Move _currentInstruction back
@@ -1563,7 +1579,7 @@ void Script::o2_videofromref(){
}
}
-void Script::o2_vdxtransition(){
+void Script::o2_vdxtransition() {
uint32 fileref = readScript32bits();
// Show the debug information just when starting the playback
@@ -1587,11 +1603,21 @@ void Script::o2_vdxtransition(){
}
}
-void Script::o2_stub52(){
+void Script::o2_setvideoskip() {
+ _videoSkipAddress = readScript16bits();
+ debugScript(1, true, "SetVideoSkip (0x%04X)", _videoSkipAddress);
+}
+
+void Script::o2_stub52() {
uint8 arg = readScript8bits();
debugScript(1, true, "STUB52 (0x%02X)", arg);
}
+void Script::o2_setscriptend() {
+ uint16 arg = readScript16bits();
+ debugScript(1, true, "SetScriptEnd (0x%04X)", arg);
+}
+
Script::OpcodeFunc Script::_opcodesT7G[NUM_OPCODES] = {
&Script::o_nop, // 0x00
&Script::o_nop,
@@ -1692,11 +1718,11 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_invalid, // 0x00
&Script::o_nop,
&Script::o2_playsong,
- &Script::o_bf9on,
- &Script::o_palfadeout, // 0x04
- &Script::o_bf8on,
- &Script::o_bf6on,
- &Script::o_bf7on,
+ &Script::o_nop,
+ &Script::o_nop, // 0x04
+ &Script::o_nop,
+ &Script::o_nop,
+ &Script::o_nop,
&Script::o2_setbackgroundsong, // 0x08
&Script::o2_videofromref,
&Script::o_bf5on,
@@ -1719,7 +1745,7 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_xor_obfuscate,
&Script::o2_vdxtransition, // 0x1C
&Script::o_swap,
- &Script::o_nop8,
+ &Script::o_invalid,
&Script::o_inc,
&Script::o_dec, // 0x20
&Script::o_strcmpnejmp_var,
@@ -1729,10 +1755,10 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_add,
&Script::o_videofromstring1,
&Script::o_videofromstring2,
- &Script::o_nop16, // 0x28
- &Script::o_stopmidi,
- &Script::o_endscript,
+ &Script::o_invalid, // 0x28
&Script::o_nop,
+ &Script::o_endscript,
+ &Script::o_invalid,
&Script::o_sethotspottop, // 0x2C
&Script::o_sethotspotbottom,
&Script::o_loadgame,
@@ -1759,22 +1785,22 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_returnscript,
&Script::o_sethotspotright, // 0x44
&Script::o_sethotspotleft,
- &Script::o_nop,
- &Script::o_nop,
- &Script::o_nop8, // 0x48
- &Script::o_nop,
- &Script::o_nop16,
- &Script::o_nop8,
- &Script::o_getcd, // 0x4C
- &Script::o_playcd,
+ &Script::o_invalid,
+ &Script::o_invalid,
+ &Script::o_invalid, // 0x48
+ &Script::o_invalid,
&Script::o_nop16,
+ &Script::o_invalid,
+ &Script::o_invalid, // 0x4C
+ &Script::o_invalid,
+ &Script::o_invalid,
&Script::o_nop16,
&Script::o_nop16, // 0x50
- &Script::o_nop16,
+ &Script::o2_setvideoskip,
&Script::o2_stub52,
&Script::o_hotspot_outrect,
- &Script::o_nop, // 0x54
- &Script::o_nop16,
+ &Script::o_invalid, // 0x54
+ &Script::o2_setscriptend,
&Script::o_stub56,
&Script::o_invalid,
&Script::o_invalid, // 0x58
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index e9e0be69ec..9e35d6fcde 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -58,7 +58,7 @@ public:
void directGameLoad(int slot);
void step();
- void setMouseClick();
+ void setMouseClick(uint8 button);
void setKbdChar(uint8 c);
Common::String &getContext();
@@ -96,7 +96,7 @@ private:
// Input
bool _mouseClicked;
- bool _eventMouseClicked;
+ uint8 _eventMouseClicked;
uint8 _kbdChar;
uint8 _eventKbdChar;
uint16 _inputLoopAddress;
@@ -115,6 +115,7 @@ private:
Common::SeekableReadStream *_videoFile;
uint32 _videoRef;
uint16 _bitflags;
+ uint16 _videoSkipAddress;
// Debugging
Debugger *_debugger;
@@ -228,7 +229,9 @@ private:
void o2_setbackgroundsong();
void o2_videofromref();
void o2_vdxtransition();
+ void o2_setvideoskip();
void o2_stub52();
+ void o2_setscriptend();
};
} // End of Groovie namespace
--
cgit v1.2.3
From 180b56dba4d6b1db9ca72e2cf37cabbf3b3aaeb4 Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Fri, 21 Aug 2009 16:03:45 +0000
Subject: SCI: disable RGB mode, as it's not ready to be used yet
svn-id: r43600
---
engines/sci/sci.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 596895d1cb..0db80726be 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -112,7 +112,7 @@ SciEngine::~SciEngine() {
Common::Error SciEngine::run() {
Graphics::PixelFormat gfxmode;
-#ifdef ENABLE_RGB_COLOR
+#if 0 && defined(ENABLE_RGB_COLOR)
initGraphics(320, 200, false, NULL);
#else
initGraphics(320, 200, false);
--
cgit v1.2.3
From f9a3ca7db1de02c93be3a7548eb32138c49c7b6b Mon Sep 17 00:00:00 2001
From: Arnaud Boutonné
Date: Fri, 21 Aug 2009 16:50:30 +0000
Subject: Add 31 title files to ignore (they are never present !)
svn-id: r43601
---
engines/gob/save/saveload_playtoons.cpp | 36 ++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
index a8fef3cb11..48adcdc59e 100644
--- a/engines/gob/save/saveload_playtoons.cpp
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -30,9 +30,39 @@
namespace Gob {
SaveLoad_Playtoons::SaveFile SaveLoad_Playtoons::_saveFiles[] = {
- { "did.inf", kSaveModeSave, 0, 0}, //
- { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK detection file
-
+ { "did.inf", kSaveModeSave, 0, 0}, // Purpose ignored at the moment, intensively used to save things.
+ { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK detection file
+ { "titre.009", kSaveModeIgnore, 0, 0}, // Playtoons theoritical title files that are checked for nothing
+ { "titre.010", kSaveModeIgnore, 0, 0},
+ { "titre.011", kSaveModeIgnore, 0, 0},
+ { "titre.012", kSaveModeIgnore, 0, 0},
+ { "titre.013", kSaveModeIgnore, 0, 0},
+ { "titre.014", kSaveModeIgnore, 0, 0},
+ { "titre.015", kSaveModeIgnore, 0, 0},
+ { "titre.016", kSaveModeIgnore, 0, 0},
+ { "titre.017", kSaveModeIgnore, 0, 0},
+ { "titre.018", kSaveModeIgnore, 0, 0},
+ { "titre.019", kSaveModeIgnore, 0, 0},
+ { "titre.020", kSaveModeIgnore, 0, 0},
+ { "titre.021", kSaveModeIgnore, 0, 0},
+ { "titre.022", kSaveModeIgnore, 0, 0},
+ { "titre.023", kSaveModeIgnore, 0, 0},
+ { "titre.024", kSaveModeIgnore, 0, 0},
+ { "titre.025", kSaveModeIgnore, 0, 0},
+ { "titre.026", kSaveModeIgnore, 0, 0},
+ { "titre.027", kSaveModeIgnore, 0, 0},
+ { "titre.028", kSaveModeIgnore, 0, 0},
+ { "titre.029", kSaveModeIgnore, 0, 0},
+ { "titre.030", kSaveModeIgnore, 0, 0},
+ { "titre.031", kSaveModeIgnore, 0, 0},
+ { "titre.032", kSaveModeIgnore, 0, 0},
+ { "titre.033", kSaveModeIgnore, 0, 0},
+ { "titre.034", kSaveModeIgnore, 0, 0},
+ { "titre.035", kSaveModeIgnore, 0, 0},
+ { "titre.036", kSaveModeIgnore, 0, 0},
+ { "titre.037", kSaveModeIgnore, 0, 0},
+ { "titre.038", kSaveModeIgnore, 0, 0},
+ { "titre.039", kSaveModeIgnore, 0, 0},
};
SaveLoad_Playtoons::GameHandler::File::File(GobEngine *vm, const char *base) :
--
cgit v1.2.3
From d4d9c78fdd2c9dcbf1a7ba2345ec08ac181d1e1c Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Fri, 21 Aug 2009 17:19:06 +0000
Subject: Enable 16bit support only for backends which support it
svn-id: r43602
---
configure | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index bd4933c0dd..061089361b 100755
--- a/configure
+++ b/configure
@@ -110,7 +110,7 @@ _alsa=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
-_16bit=yes
+_16bit=auto
_readline=auto
# Default option behaviour yes/no
_text_console=no
@@ -639,7 +639,6 @@ DEBFLAGS="-g"
for ac_option in $@; do
case "$ac_option" in
- --enable-16bit) _16bit=yes ;;
--disable-16bit) _16bit=no ;;
--disable-hq-scalers) _build_hq_scalers=no ;;
--disable-scalers) _build_scalers=no ;;
@@ -1495,6 +1494,23 @@ EOF
echo "$_need_memalign"
fi
+#
+# Enable 16bit support only for backends which support it
+#
+case $_backend in
+ sdl)
+ if test "$_16bit" = auto ; then
+ _16bit=yes
+ else
+ _16bit=no
+ fi
+ ;;
+ *)
+ _16bit=no
+ ;;
+esac
+
+
#
# Add the results of the above checks to config.h
#
--
cgit v1.2.3
From c0d954334547c166b52b37199ad877bc7e5ac2b0 Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Fri, 21 Aug 2009 18:12:13 +0000
Subject: Fix detection of SCI32 resource maps and volumes
svn-id: r43603
---
engines/sci/resource.cpp | 50 +++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 22 deletions(-)
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 9e3bcb067e..049abe8202 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -351,12 +351,22 @@ int sci0_get_compression_method(Common::ReadStream &stream) {
int ResourceManager::addAppropriateSources() {
ResourceSource *map;
- if (!Common::File::exists("RESOURCE.MAP"))
+ if (Common::File::exists("RESOURCE.MAP"))
+ map = addExternalMap("RESOURCE.MAP");
+#ifdef ENABLE_SCI32
+ else if (Common::File::exists("RESMAP.000"))
+ map = addExternalMap("RESMAP.000");
+#endif
+ else
return 0;
- map = addExternalMap("RESOURCE.MAP");
+
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, "RESOURCE.0??");
+
+#ifdef ENABLE_SCI32
+ SearchMan.listMatchingMembers(files, "RESSCI.0??");
+#endif
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
const Common::String name = (*x)->getName();
@@ -707,10 +717,9 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
}
}
- if (!fileStream) {
+ if (!fileStream)
error("Failed to open resource map file");
- return kResVersionUnknown;
- }
+
// detection
// SCI0 and SCI01 maps have last 6 bytes set to FF
fileStream->seek(-4, SEEK_END);
@@ -737,11 +746,20 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
while (!fileStream->eos()) {
directoryType = fileStream->readByte();
directoryOffset = fileStream->readUint16LE();
- if ((directoryType < 0x80) || ((directoryType > 0xA0) && (directoryType != 0xFF)))
+
+ // Only SCI32 has directory type < 0x80
+ if (directoryType < 0x80 && mapDetected != kResVersionUnknown && mapDetected != kResVersionSci32)
+ mapDetected = kResVersionSci32;
+ else
break;
+
+ if (directoryType > 0xA0 && directoryType != 0xFF)
+ break;
+
// Offset is above file size? -> definitely not SCI1/SCI1.1
if (directoryOffset > fileStream->size())
break;
+
if (lastDirectoryOffset) {
directorySize = directoryOffset - lastDirectoryOffset;
if ((directorySize % 5) && (directorySize % 6 == 0))
@@ -749,6 +767,7 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
if ((directorySize % 5 == 0) && (directorySize % 6))
mapDetected = kResVersionSci11;
}
+
if (directoryType == 0xFF) {
// FFh entry needs to point to EOF
if (directoryOffset != fileStream->size())
@@ -760,23 +779,10 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
return mapDetected;
return kResVersionSci1Late;
}
+
lastDirectoryOffset = directoryOffset;
}
-#ifdef ENABLE_SCI32
- // late SCI1.1 and SCI32 maps have last directory entry set to 0xFF
- // offset set to filesize and 4 more bytes
-
- // TODO/FIXME: This code was not updated in r42300, which changed the behavior of this
- // function a lot. To make it compile again "off" was changed to the newly introduced
- // "lastDirectoryOffset". This is probably not the correct fix, since before r43000
- // the loop above could not prematurely terminate and thus this would always check the
- // last directory entry instead of the last checked directory entry.
- fileStream->seek(lastDirectoryOffset - 7, SEEK_SET);
- if (fileStream->readByte() == 0xFF && fileStream->readUint16LE() == fileStream->size())
- return kResVersionSci32; // TODO : check if there is a difference between these maps
-#endif
-
delete fileStream;
return kResVersionUnknown;
@@ -851,7 +857,7 @@ ResourceManager::ResVersion ResourceManager::detectVolVersion() {
break;
}
- fileStream->seek(0, SEEK_SET);
+ fileStream->seek(0);
continue;
}
@@ -860,7 +866,7 @@ ResourceManager::ResVersion ResourceManager::detectVolVersion() {
else if (curVersion == kResVersionSci11)
fileStream->seek((9 + dwPacked) % 2 ? dwPacked + 1 : dwPacked, SEEK_CUR);
else if (curVersion == kResVersionSci32)
- fileStream->seek(dwPacked, SEEK_CUR);//(9 + wPacked) % 2 ? wPacked + 1 : wPacked, SEEK_CUR);
+ fileStream->seek(dwPacked - 2, SEEK_CUR);
}
delete fileStream;
--
cgit v1.2.3
From 007f68366fd55a519753bf533c7c3a80db3754f0 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Fri, 21 Aug 2009 18:16:37 +0000
Subject: Renamed ENABLE_RGB_COLOR to USE_RGB_COLOR, and added it to config.h
to guarantee a consistent build.
svn-id: r43604
---
Makefile.common | 4 ----
backends/platform/gp2x/graphics.cpp | 12 ++++++------
backends/platform/sdl/graphics.cpp | 30 +++++++++++++++---------------
backends/platform/sdl/sdl.cpp | 2 +-
backends/platform/sdl/sdl.h | 8 ++++----
base/version.cpp | 2 +-
common/system.h | 4 ++--
configure | 8 +++++++-
dists/msvc8/ScummVM_Global.vsprops | 2 +-
dists/msvc9/ScummVM_Global.vsprops | 2 +-
engines/engine.cpp | 4 ++--
engines/groovie/roq.cpp | 6 +++---
engines/sci/sci.cpp | 2 +-
engines/scumm/cursor.cpp | 2 +-
engines/scumm/detection_tables.h | 4 ++--
engines/scumm/scumm.cpp | 2 +-
graphics/cursorman.cpp | 4 ++--
graphics/cursorman.h | 4 ++--
graphics/pixelformat.h | 2 +-
gui/ThemeEngine.cpp | 2 +-
gui/ThemeEngine.h | 2 +-
21 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/Makefile.common b/Makefile.common
index 824139b0bd..caf5ba22fa 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -37,10 +37,6 @@ ifdef DISABLE_SCALERS
DEFINES += -DDISABLE_SCALERS
endif
-ifdef ENABLE_RGB_COLOR
-DEFINES += -DENABLE_RGB_COLOR
-endif
-
ifdef DISABLE_HQ_SCALERS
DEFINES += -DDISABLE_HQ_SCALERS
endif
diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp
index d948cb82d3..cf874323e0 100644
--- a/backends/platform/gp2x/graphics.cpp
+++ b/backends/platform/gp2x/graphics.cpp
@@ -243,7 +243,7 @@ int OSystem_GP2X::getGraphicsMode() const {
void OSystem_GP2X::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
//avoid redundant format changes
Graphics::PixelFormat newFormat;
if (!format)
@@ -1231,7 +1231,7 @@ void OSystem_GP2X::warpMouse(int x, int y) {
}
void OSystem_GP2X::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (!format)
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
@@ -1274,7 +1274,7 @@ void OSystem_GP2X::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x
}
free(_mouseData);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel);
memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel);
#else
@@ -1288,7 +1288,7 @@ void OSystem_GP2X::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x
void OSystem_GP2X::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
uint32 color;
uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
@@ -1327,7 +1327,7 @@ void OSystem_GP2X::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (_cursorFormat.bytesPerPixel > 1) {
color = (*(uint32 *) srcPtr) & colormask;
if (color != _mouseKeyColor) { // transparent, don't draw
@@ -1347,7 +1347,7 @@ void OSystem_GP2X::blitCursor() {
}
dstPtr += 2;
srcPtr++;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
}
#endif
}
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 3bfe8f5c98..d3a37f4de7 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -26,7 +26,7 @@
#include "backends/platform/sdl/sdl.h"
#include "common/mutex.h"
#include "common/util.h"
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
#include "common/list.h"
#endif
#include "graphics/font.h"
@@ -100,7 +100,7 @@ void OSystem_SDL::beginGFXTransaction(void) {
_transactionDetails.needUpdatescreen = false;
_transactionDetails.normal1xScaler = false;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_transactionDetails.formatChanged = false;
#endif
@@ -126,7 +126,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
_videoMode.mode = _oldVideoMode.mode;
_videoMode.scaleFactor = _oldVideoMode.scaleFactor;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
} else if (_videoMode.format != _oldVideoMode.format) {
errors |= kTransactionFormatNotSupported;
@@ -156,7 +156,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
}
}
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (_transactionDetails.sizeChanged || _transactionDetails.formatChanged) {
#else
if (_transactionDetails.sizeChanged) {
@@ -209,7 +209,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
return (TransactionError)errors;
}
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
const Graphics::PixelFormat RGBList[] = {
#ifdef ENABLE_32BIT
// RGBA8888, ARGB8888, RGB888
@@ -442,7 +442,7 @@ int OSystem_SDL::getGraphicsMode() const {
void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
//avoid redundant format changes
Graphics::PixelFormat newFormat;
if (!format)
@@ -543,7 +543,7 @@ bool OSystem_SDL::loadGFXMode() {
//
// Create the surface that contains the 8 bit game data
//
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
_screenFormat.bytesPerPixel << 3,
((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift ,
@@ -1007,7 +1007,7 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
if (SDL_LockSurface(_screen) == -1)
error("SDL_LockSurface failed: %s", SDL_GetError());
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth * _screenFormat.bytesPerPixel + x * _screenFormat.bytesPerPixel;
if (_videoMode.screenWidth == w && pitch == w * _screenFormat.bytesPerPixel) {
memcpy(dst, src, h*w*_screenFormat.bytesPerPixel);
@@ -1053,7 +1053,7 @@ Graphics::Surface *OSystem_SDL::lockScreen() {
_framebuffer.w = _screen->w;
_framebuffer.h = _screen->h;
_framebuffer.pitch = _screen->pitch;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel;
#else
_framebuffer.bytesPerPixel = 1;
@@ -1241,7 +1241,7 @@ int16 OSystem_SDL::getWidth() {
void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
assert(colors);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (_screenFormat.bytesPerPixel > 1)
return; //not using a paletted pixel format
#endif
@@ -1508,7 +1508,7 @@ void OSystem_SDL::warpMouse(int x, int y) {
}
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (!format)
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
@@ -1551,7 +1551,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
}
free(_mouseData);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel);
memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel);
#else
@@ -1565,7 +1565,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
void OSystem_SDL::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
uint32 color;
uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
@@ -1604,7 +1604,7 @@ void OSystem_SDL::blitCursor() {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (_cursorFormat.bytesPerPixel > 1) {
color = (*(uint32 *) srcPtr) & colormask;
if (color != _mouseKeyColor) { // transparent, don't draw
@@ -1624,7 +1624,7 @@ void OSystem_SDL::blitCursor() {
}
dstPtr += 2;
srcPtr++;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
}
#endif
}
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index b6b46af9d7..7c1107582b 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -222,7 +222,7 @@ OSystem_SDL::OSystem_SDL()
_osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0),
#endif
_hwscreen(0), _screen(0), _tmpscreen(0),
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_screenFormat(Graphics::PixelFormat::createFormatCLUT8()),
_cursorFormat(Graphics::PixelFormat::createFormatCLUT8()),
#endif
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 09213ad417..3da9a433b7 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -93,7 +93,7 @@ public:
void beginGFXTransaction(void);
TransactionError endGFXTransaction(void);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
@@ -248,7 +248,7 @@ protected:
// unseen game screen
SDL_Surface *_screen;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
Graphics::PixelFormat _screenFormat;
Graphics::PixelFormat _cursorFormat;
#endif
@@ -285,7 +285,7 @@ protected:
bool needHotswap;
bool needUpdatescreen;
bool normal1xScaler;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
bool formatChanged;
#endif
};
@@ -304,7 +304,7 @@ protected:
int screenWidth, screenHeight;
int overlayWidth, overlayHeight;
int hardwareWidth, hardwareHeight;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
Graphics::PixelFormat format;
#endif
};
diff --git a/base/version.cpp b/base/version.cpp
index 3d1ab783d0..ad74c64265 100644
--- a/base/version.cpp
+++ b/base/version.cpp
@@ -86,7 +86,7 @@ const char *gScummVMFeatures = ""
"ALSA "
#endif
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
"RGB "
#endif
diff --git a/common/system.h b/common/system.h
index 0f265ea2be..f4704f5e0e 100644
--- a/common/system.h
+++ b/common/system.h
@@ -31,7 +31,7 @@
#include "common/rect.h"
#include "graphics/pixelformat.h"
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
#include "graphics/conversion.h"
#endif
@@ -350,7 +350,7 @@ public:
*/
virtual int getGraphicsMode() const = 0;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
/**
* Determine the pixel format currently in use for screen rendering.
* @return the active screen pixel format.
diff --git a/configure b/configure
index 061089361b..5b5c62bfb9 100755
--- a/configure
+++ b/configure
@@ -1669,7 +1669,12 @@ add_to_config_mk_if_yes "$_mt32emu" 'USE_MT32EMU = 1'
#
# Check whether 16bit color support is requested
#
-add_to_config_mk_if_yes "$_16bit" 'ENABLE_RGB_COLOR = 1'
+if test "$_16bit" = no ; then
+ _def_16bit='#undef USE_RGB_COLOR'
+else
+ _def_16bit='#define USE_RGB_COLOR'
+fi
+add_to_config_mk_if_yes "$_16bit" 'USE_RGB_COLOR = 1'
#
# Check whether to enable the (hq) scalers
@@ -2260,6 +2265,7 @@ $_def_readline
/* Options */
$_def_text_console
$_def_mt32emu
+$_def_16bit
/* Plugin settings */
$_def_plugin
diff --git a/dists/msvc8/ScummVM_Global.vsprops b/dists/msvc8/ScummVM_Global.vsprops
index 4da6748645..1fafddbb46 100644
--- a/dists/msvc8/ScummVM_Global.vsprops
+++ b/dists/msvc8/ScummVM_Global.vsprops
@@ -10,7 +10,7 @@
Name="VCCLCompilerTool"
DisableSpecificWarnings="4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;;ENABLE_RGB_COLOR"
+ PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;USE_RGB_COLOR;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE"
ExceptionHandling="0"
RuntimeTypeInfo="false"
WarningLevel="4"
diff --git a/dists/msvc9/ScummVM_Global.vsprops b/dists/msvc9/ScummVM_Global.vsprops
index 039722e157..1fafddbb46 100644
--- a/dists/msvc9/ScummVM_Global.vsprops
+++ b/dists/msvc9/ScummVM_Global.vsprops
@@ -10,7 +10,7 @@
Name="VCCLCompilerTool"
DisableSpecificWarnings="4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR"
+ PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;USE_RGB_COLOR;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE"
ExceptionHandling="0"
RuntimeTypeInfo="false"
WarningLevel="4"
diff --git a/engines/engine.cpp b/engines/engine.cpp
index eb46add82f..a64a2fd1f3 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -130,7 +130,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (format)
g_system->initSize(width, height, format);
else {
@@ -160,7 +160,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
}
// Just show warnings then these occur:
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (gfxError & OSystem::kTransactionFormatNotSupported) {
Common::String message = "Could not initialize color format.";
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 538b1b7111..3ff852934d 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -31,7 +31,7 @@
#include "graphics/jpeg.h"
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
// Required for the YUV to RGB conversion
#include "graphics/conversion.h"
#endif
@@ -169,14 +169,14 @@ void ROQPlayer::buildShowBuf() {
// Just use the luminancy component
*out = *in;
#endif // DITHER
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
} else {
// Do the format conversion (YUV -> RGB -> Screen format)
byte r, g, b;
Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
// FIXME: this is fixed to 16bit
*(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
-#endif // ENABLE_RGB_COLOR
+#endif // USE_RGB_COLOR
}
// Skip to the next pixel
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 0db80726be..3f148f54e7 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -112,7 +112,7 @@ SciEngine::~SciEngine() {
Common::Error SciEngine::run() {
Graphics::PixelFormat gfxmode;
-#if 0 && defined(ENABLE_RGB_COLOR)
+#if 0 && defined(USE_RGB_COLOR)
initGraphics(320, 200, false, NULL);
#else
initGraphics(320, 200, false);
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 66ac68bd95..7818d6a98e 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,7 +112,7 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
Graphics::PixelFormat format = _system->getScreenFormat();
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 01bd0446ff..c9af022af5 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -80,7 +80,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "puttputt", "Putt-Putt Joins the Parade" },
#ifdef ENABLE_HE
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
{ "arttime", "Blue's Art Time Activities" },
{ "baseball2001", "Backyard Baseball 2001" },
{ "Baseball2003", "Backyard Baseball 2003" },
@@ -502,7 +502,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "puttputt", "Putt-Putt", kGenHEMacNoParens, UNK_LANG, Common::kPlatformMacintosh, 0 },
#ifdef ENABLE_HE
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
{ "arttime", "arttime", kGenHEPC, UNK_LANG, UNK, 0 },
{ "arttime", "Blues-ArtTime", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "arttime", "artdemo", kGenHEPC, UNK_LANG, UNK, 0 },
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 1beda85456..9f3ebb8053 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1100,7 +1100,7 @@ Common::Error ScummEngine::init() {
// there is no text surface for them. This takes that into account
(_screenWidth * _textSurfaceMultiplier > 320));
} else if (_game.features & GF_16BIT_COLOR) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
if (format != _system->getScreenFormat())
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index b77aac37cf..0834760861 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -109,7 +109,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
Cursor *cur = _cursorStack.top();
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
uint size;
if (!format)
size = w * h;
@@ -134,7 +134,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
cur->_hotspotY = hotspotY;
cur->_keycolor = keycolor;
cur->_targetScale = targetScale;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (format)
cur->_format = *format;
else
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index ae7008f54c..f5b60d76b9 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -29,7 +29,7 @@
#include "common/stack.h"
#include "common/singleton.h"
#include "graphics/pixelformat.h"
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
#include "common/system.h"
#endif
@@ -179,7 +179,7 @@ private:
uint _size;
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
if (!format)
_format = Graphics::PixelFormat::createFormatCLUT8();
else
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index d16de51ea7..b94ef41412 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -157,7 +157,7 @@ struct PixelFormat {
* or PixelFormat::createFormatCLUT8() if no matching formats were found.
*/
inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) {
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
for (Common::List::iterator i = backend.begin(); i != backend.end(); ++i) {
for (Common::List::iterator j = frontend.begin(); j != frontend.end(); ++j) {
if (*i == *j)
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 417a1f714c..41447d2a88 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1234,7 +1234,7 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
if (!cursor)
return false;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
_cursorFormat.bytesPerPixel = 1;
_cursorFormat.rLoss = _cursorFormat.gLoss = _cursorFormat.bLoss = _cursorFormat.aLoss = 8;
_cursorFormat.rShift = _cursorFormat.gShift = _cursorFormat.bShift = _cursorFormat.aShift = 0;
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 43e227d5fb..9e4bff5075 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -612,7 +612,7 @@ protected:
ImagesMap _bitmaps;
Graphics::PixelFormat _overlayFormat;
-#ifdef ENABLE_RGB_COLOR
+#ifdef USE_RGB_COLOR
Graphics::PixelFormat _cursorFormat;
#endif
--
cgit v1.2.3
From d6f3e28c2db6dd31e17cf304586de2f91d489791 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Fri, 21 Aug 2009 18:53:28 +0000
Subject: Fixed OSystem_Wii for the 16bit API changes
svn-id: r43605
---
backends/platform/wii/osystem.h | 10 ++++++----
backends/platform/wii/osystem_gfx.cpp | 14 ++++++++++----
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index e4176e8415..2eb53f26a3 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -120,7 +120,8 @@ public:
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
virtual int getGraphicsMode() const;
- virtual void initSize(uint width, uint height);
+ virtual void initSize(uint width, uint height,
+ const Graphics::PixelFormat *format);
virtual int16 getWidth();
virtual int16 getHeight();
virtual void setPalette(const byte *colors, uint start, uint num);
@@ -142,14 +143,15 @@ public:
int x, int y, int w, int h);
virtual int16 getOverlayWidth();
virtual int16 getOverlayHeight();
- virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<565>(); }
+ virtual Graphics::PixelFormat getOverlayFormat() const;
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
- int hotspotY, byte keycolor = 255,
- int cursorTargetScale = 1);
+ int hotspotY, uint32 keycolor,
+ int cursorTargetScale,
+ const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis();
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 4454acb318..9c875eaa85 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -143,7 +143,8 @@ int OSystem_Wii::getGraphicsMode() const {
return _activeGraphicsMode;
}
-void OSystem_Wii::initSize(uint width, uint height) {
+void OSystem_Wii::initSize(uint width, uint height,
+ const Graphics::PixelFormat *format) {
if (_gameWidth != width || _gameHeight != height) {
printf("initSize %u %u\n", width, height);
@@ -429,6 +430,10 @@ int16 OSystem_Wii::getOverlayHeight() {
return _overlayHeight;
}
+Graphics::PixelFormat OSystem_Wii::getOverlayFormat() const {
+ return Graphics::createPixelFormat<565>();
+}
+
bool OSystem_Wii::showMouse(bool visible) {
bool last = _mouseVisible;
_mouseVisible = visible;
@@ -442,15 +447,16 @@ void OSystem_Wii::warpMouse(int x, int y) {
}
void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
- int hotspotY, byte keycolor,
- int cursorTargetScale) {
+ int hotspotY, uint32 keycolor,
+ int cursorTargetScale,
+ const Graphics::PixelFormat *format) {
(void) cursorTargetScale; // TODO
_mouseWidth = w;
_mouseHeight = h;
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _mouseKeyColor = keycolor;
+ _mouseKeyColor = keycolor & 0xff;
if (_mouseCursor)
free(_mouseCursor);
--
cgit v1.2.3
From 7d350b215c62f6d08c9bc33da9648fd72ee5599e Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Fri, 21 Aug 2009 19:11:02 +0000
Subject: fix compilation after RGB API changes
svn-id: r43606
---
backends/platform/psp/osys_psp.cpp | 6 +++---
backends/platform/psp/osys_psp.h | 4 ++--
backends/platform/psp/osys_psp_gu.cpp | 6 +++---
backends/platform/psp/osys_psp_gu.h | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 5e461f45e0..d4b1c61537 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -143,7 +143,7 @@ int OSystem_PSP::getGraphicsMode() const {
return -1;
}
-void OSystem_PSP::initSize(uint width, uint height) {
+void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
_overlayWidth = _screenWidth = width;
_overlayHeight = _screenHeight = height;
@@ -382,7 +382,7 @@ void OSystem_PSP::warpMouse(int x, int y) {
_mouseY = y;
}
-void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale) {
+void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
//TODO: handle cursorTargetScale
_mouseWidth = w;
_mouseHeight = h;
@@ -390,7 +390,7 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _mouseKeyColour = keycolor;
+ _mouseKeyColour = keycolor & 0xFF;
free(_mouseBuf);
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 94488a92ce..68e1a7da22 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -97,7 +97,7 @@ public:
virtual bool setGraphicsMode(int mode);
bool setGraphicsMode(const char *name);
virtual int getGraphicsMode() const;
- virtual void initSize(uint width, uint height);
+ virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
virtual int16 getWidth();
virtual int16 getHeight();
virtual void setPalette(const byte *colors, uint start, uint num);
@@ -120,7 +120,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis();
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
index 1c83aa4abf..c13c5bc21f 100644
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ b/backends/platform/psp/osys_psp_gu.cpp
@@ -141,7 +141,7 @@ OSystem_PSP_GU::~OSystem_PSP_GU() {
sceGuTerm();
}
-void OSystem_PSP_GU::initSize(uint width, uint height) {
+void OSystem_PSP_GU::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
PSPDebugTrace("initSize\n");
_screenWidth = width;
_screenHeight = height;
@@ -192,7 +192,7 @@ int OSystem_PSP_GU::getGraphicsMode() const {
return _graphicMode;
}
-void OSystem_PSP_GU::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale) {
+void OSystem_PSP_GU::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
//TODO: handle cursorTargetScale
_mouseWidth = w;
_mouseHeight = h;
@@ -200,7 +200,7 @@ void OSystem_PSP_GU::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _mouseKeyColour = keycolor;
+ _mouseKeyColour = keycolor & 0xFF;
memcpy(mouseClut, _palette, 256*sizeof(unsigned short));
mouseClut[_mouseKeyColour] = 0;
diff --git a/backends/platform/psp/osys_psp_gu.h b/backends/platform/psp/osys_psp_gu.h
index c221971fc8..106b73b308 100644
--- a/backends/platform/psp/osys_psp_gu.h
+++ b/backends/platform/psp/osys_psp_gu.h
@@ -39,12 +39,12 @@ public:
OSystem_PSP_GU();
~OSystem_PSP_GU();
void updateScreen();
- void initSize(uint width, uint height);
+ void initSize(uint width, uint height, const Graphics::PixelFormat *format);
int getDefaultGraphicsMode() const;
bool setGraphicsMode(int mode);
bool setGraphicsMode(const char *name);
int getGraphicsMode() const;
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale);
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) ;
void setPalette(const byte *colors, uint start, uint num);
void setCursorPalette(const byte *colors, uint start, uint num);
--
cgit v1.2.3
From 4155e8eebf6aeb4ba90ff4901328a2bb9414eaa9 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Fri, 21 Aug 2009 19:45:49 +0000
Subject: This hopefully fixes the GP2x build (and kicks off buildbot)
svn-id: r43607
---
backends/platform/gp2x/gp2x-common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h
index 4e6421f353..c8bbd93de0 100644
--- a/backends/platform/gp2x/gp2x-common.h
+++ b/backends/platform/gp2x/gp2x-common.h
@@ -58,7 +58,7 @@ public:
// Set the size of the video bitmap.
// Typically, 320x200
- void initSize(uint w, uint h);
+ void initSize(uint w, uint h, const Graphics::PixelFormat *format);
int getScreenChangeID() const { return _screenChangeCount; }
@@ -87,7 +87,7 @@ public:
void warpMouse(int x, int y);
// Set the bitmap that's used when drawing the cursor.
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale);
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
// Set colors of cursor palette
void setCursorPalette(const byte *colors, uint start, uint num);
--
cgit v1.2.3
From 6b21f1c9327170c86d839ee5160a9eaeec7d82ef Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Fri, 21 Aug 2009 19:48:48 +0000
Subject: Fix detection of some later SCI32 games (RESMAP.001) and some
cleanup.
svn-id: r43608
---
engines/sci/resource.cpp | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 049abe8202..e07b904324 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -356,6 +356,8 @@ int ResourceManager::addAppropriateSources() {
#ifdef ENABLE_SCI32
else if (Common::File::exists("RESMAP.000"))
map = addExternalMap("RESMAP.000");
+ else if (Common::File::exists("RESMAP.001"))
+ map = addExternalMap("RESMAP.001");
#endif
else
return 0;
@@ -746,14 +748,11 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() {
while (!fileStream->eos()) {
directoryType = fileStream->readByte();
directoryOffset = fileStream->readUint16LE();
-
+
// Only SCI32 has directory type < 0x80
- if (directoryType < 0x80 && mapDetected != kResVersionUnknown && mapDetected != kResVersionSci32)
+ if (directoryType < 0x80 && (mapDetected == kResVersionUnknown || mapDetected == kResVersionSci32))
mapDetected = kResVersionSci32;
- else
- break;
-
- if (directoryType > 0xA0 && directoryType != 0xFF)
+ else if ((directoryType < 0x80) || (directoryType > 0xA0 && directoryType != 0xFF))
break;
// Offset is above file size? -> definitely not SCI1/SCI1.1
--
cgit v1.2.3
From 4a5740cbe29ba421a79784f65eb26f42a36ac521 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Fri, 21 Aug 2009 20:39:46 +0000
Subject: Set date for 1.0.0rc1 release
svn-id: r43610
---
NEWS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index d3caa18e3c..deb06dbfaf 100644
--- a/NEWS
+++ b/NEWS
@@ -15,7 +15,7 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
- Added support for the Amiga version of The Legend of Kyrandia.
- Adapted KYRA to support the custom SJIS font.
-1.0.0 (2009-??-??)
+1.0.0rc1 (2009-08-31)
New Games:
- Added support for Discworld.
- Added support for Discworld 2 - Missing Presumed ...!?.
--
cgit v1.2.3
From edc8ffdaba5756c37aa84be5b933bc238c759ec2 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Fri, 21 Aug 2009 22:25:55 +0000
Subject: Fix use of default directories in SCI detection code. So far all our
detection code was based on FSNode, but since SCI seems to call engine
internal code for detection which operates via File, there was the need to
use File::addDefaultDirectory to have it working. The problem here is that
the default directories are not reset after game detection, since the caller
code assumes it's all done via FSNode. A simple change to use SearchMan,
which is used internally by File, to add the default directory and removing
it later on in the SCI detection code fixed the issue. Of course that is
still slightly of a HACK, but it is much nicer than to rewrite engine
internal code to use FSNode, just to be usable for game detection. I added a
possible solution to remove the HACK as sourcecode comment.
svn-id: r43613
---
engines/sci/detection.cpp | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 4b373a76f6..d41e1fa0b3 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -3130,11 +3130,17 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
if (filename.contains("resource.map") || filename.contains("resmap.000")) {
// HACK: resource.map is located in the same directory as the other resource files,
// therefore add the directory here, so that the game files can be opened later on
- // TODO/FIXME: This should be removed, as it will cause problems with game detection:
- // if we got a game A, and then try to detect another game B, adding a default
- // directory here means that game A's files will be opened first. We need to rewrite
- // all the functions that access game files to use FSNodes instead
- Common::File::addDefaultDirectory(file->getParent().getPath());
+ // We now add the parent directory temporary to our SearchMan so the engine code
+ // used in the detection can access all files via Common::File without any problems.
+ // In all branches returning from this function, we need to have a call to
+ // SearchMan.remove to remove it from the default directory pool again.
+ //
+ // A proper solution to remove this hack would be to have the code, which is needed
+ // for detection, to operate on Stream objects, so they can be easily called from
+ // the detection code. This might be easily to achieve through refactoring the
+ // code needed for detection.
+ assert(!SearchMan.hasArchive("SCI_detection"));
+ SearchMan.addDirectory("SCI_detection", file->getParent());
foundResMap = true;
}
@@ -3165,8 +3171,10 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
}
// If these files aren't found, it can't be SCI
- if (!foundResMap && !foundRes000)
+ if (!foundResMap && !foundRes000) {
+ SearchMan.remove("SCI_detection");
return 0;
+ }
// Set some defaults
s_fallbackDesc.desc.extra = "";
@@ -3184,6 +3192,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
SegManager *segManager = new SegManager(resMgr, version, hasOldScriptHeader);
if (!script_instantiate(resMgr, segManager, version, hasOldScriptHeader, 0)) {
warning("fallbackDetect(): Could not instantiate script 0");
+ SearchMan.remove("SCI_detection");
return 0;
}
reg_t game_obj = script_lookup_export(segManager, 0, 0);
@@ -3199,6 +3208,8 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
printf("version number, from the game's executable:\n");
printf("Version: %s\n\n", exeVersionString.empty() ? "not found" : exeVersionString.c_str());
+ SearchMan.remove("SCI_detection");
+
return (const ADGameDescription *)&s_fallbackDesc;
}
--
cgit v1.2.3
From 894635e91d7bdaa4517618a957441db016b2798b Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Fri, 21 Aug 2009 22:29:28 +0000
Subject: Attempt to fix builds that use the ARM screen column clear code; add
new bitdepth argument that was missing in ARM builds previously.
Also fix a few warnings.
Also fix the WinCE build which fails in the SDL init call with a missing
bitdepth field.
Untested at this point (build certainly gets further than before). Committing
this seems reasonable, as it can't make it any worse :)
svn-id: r43614
---
backends/platform/wince/wince-sdl.cpp | 4 ++--
backends/platform/wince/wince-sdl.h | 2 +-
engines/scumm/gfx.cpp | 8 +++----
engines/scumm/gfxARM.s | 39 ++++++++++++++++++++++++++++++++---
engines/scumm/he/sound_he.cpp | 2 +-
5 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 65082014da..ab7860dd85 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -1084,7 +1084,7 @@ void OSystem_WINCE3::update_game_settings() {
_noDoubleTapRMB = ConfMan.getBool("no_doubletap_rightclick");
}
-void OSystem_WINCE3::initSize(uint w, uint h) {
+void OSystem_WINCE3::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
if (_hasSmartphoneResolution && h == 240)
h = 200; // mainly for the launcher
@@ -1120,7 +1120,7 @@ void OSystem_WINCE3::initSize(uint w, uint h) {
_videoMode.overlayWidth = w;
_videoMode.overlayHeight = h;
- OSystem_SDL::initSize(w, h);
+ OSystem_SDL::initSize(w, h, format);
if (_scalersChanged) {
unloadGFXMode();
diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h
index deafde6d80..7b4d0f2b25 100644
--- a/backends/platform/wince/wince-sdl.h
+++ b/backends/platform/wince/wince-sdl.h
@@ -66,7 +66,7 @@ public:
void internUpdateScreen();
void setGraphicsModeIntern();
- void initSize(uint w, uint h);
+ void initSize(uint w, uint h, const Graphics::PixelFormat *format);
void initBackend();
// Overloaded from SDL backend (toolbar handling)
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 1802d0d39c..c6e2cd3312 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -38,7 +38,7 @@
#ifdef USE_ARM_GFX_ASM
extern "C" void asmDrawStripToScreen(int height, int width, void const* text, void const* src, byte* dst,
int vsPitch, int vmScreenWidth, int textSurfacePitch);
-extern "C" void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height);
+extern "C" void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height, uint8_t bitDepth);
#endif /* USE_ARM_GFX_ASM */
namespace Scumm {
@@ -784,8 +784,8 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid
}
void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) {
- uint16 *dstL1 = (uint16 *)dst;
- uint16 *dstL2 = (uint16 *)(dst + dstPitch);
+ uint16 *dstL1 = (uint16 *)(void *)dst;
+ uint16 *dstL2 = (uint16 *)(void *)(dst + dstPitch);
const int dstAdd = dstPitch - w;
const int srcAdd = srcPitch - w;
@@ -1114,7 +1114,7 @@ static void fill(byte *dst, int dstPitch, uint16 color, int w, int h, uint8 bitD
#ifdef USE_ARM_GFX_ASM
-#define copy8Col(A,B,C,D) asmCopy8Col(A,B,C,D)
+#define copy8Col(A,B,C,D,E) asmCopy8Col(A,B,C,D,E)
#else
diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s
index f3a1f20303..adcd4bfac5 100644
--- a/engines/scumm/gfxARM.s
+++ b/engines/scumm/gfxARM.s
@@ -126,9 +126,13 @@ asmCopy8Col:
@ r1 = dstPitch
@ r2 = src
@ r3 = height
- STMFD r13!,{r14}
- SUB r1,r1,#4
+ @ <> = bitdepth
+ LDR r12,[r13]
+ STR r14,[r13,#-4]!
+ CMP r12,#8
+ BNE copy8Col16
+ SUB r1,r1,#4
TST r3,#1
ADDNE r3,r3,#1
BNE roll2
@@ -145,4 +149,33 @@ roll2:
STR r14,[r0],r1
BNE yLoop2
- LDMFD r13!,{PC}
+ LDR PC,[r13],#4
+
+copy8Col16:
+ STMFD r13!,{r4-r5}
+ SUB r1,r1,#12
+ TST r3,#1
+ ADDNE r3,r3,#1
+ BNE roll3
+yLoop3:
+ LDR r4, [r2],#4
+ LDR r5, [r2],#4
+ LDR r12,[r2],#4
+ LDR r14,[r2],r1
+ STR r4, [r0],#4
+ STR r5, [r0],#4
+ STR r12,[r0],#4
+ STR r14,[r0],r1
+roll3:
+ LDR r4, [r2],#4
+ LDR r5, [r2],#4
+ LDR r12,[r2],#4
+ LDR r14,[r2],r1
+ SUBS r3,r3,#2
+ STR r4, [r0],#4
+ STR r5, [r0],#4
+ STR r12,[r0],#4
+ STR r14,[r0],r1
+ BNE yLoop3
+
+ LDMFD r13!,{r4,r5,PC}
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index 01f29d5db9..feaf273b4e 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -645,7 +645,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
Audio::AudioStream *voxStream = Audio::makeADPCMStream(&stream, false, size, Audio::kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
sound = (char *)malloc(size * 4);
- size = voxStream->readBuffer((int16*)sound, size * 2);
+ size = voxStream->readBuffer((int16*)(void *)sound, size * 2);
size *= 2; // 16bits.
delete voxStream;
--
cgit v1.2.3
From 9a3218e67302e825b3df4e2f26df5601fb48f0db Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Fri, 21 Aug 2009 22:30:35 +0000
Subject: unify OSystem_PSP_GU and OSystem_PSP (which was hopelessly outdated
and mostly useless)
svn-id: r43615
---
backends/platform/psp/Makefile | 1 -
backends/platform/psp/module.mk | 1 -
backends/platform/psp/osys_psp.cpp | 564 ++++++++++++++++++++++++++----
backends/platform/psp/osys_psp.h | 16 +
backends/platform/psp/osys_psp_gu.cpp | 629 ----------------------------------
backends/platform/psp/osys_psp_gu.h | 61 ----
backends/platform/psp/psp_main.cpp | 4 +-
7 files changed, 520 insertions(+), 756 deletions(-)
delete mode 100644 backends/platform/psp/osys_psp_gu.cpp
delete mode 100644 backends/platform/psp/osys_psp_gu.h
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index 64ce8a0161..8be3937ff2 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -83,7 +83,6 @@ TARGET = scummvm-psp
OBJS := powerman.o \
psp_main.o \
osys_psp.o \
- osys_psp_gu.o \
kbd_ss_c.o \
kbd_s_c.o \
kbd_ls_c.o \
diff --git a/backends/platform/psp/module.mk b/backends/platform/psp/module.mk
index 8f083c5dfa..a5c17ffa57 100644
--- a/backends/platform/psp/module.mk
+++ b/backends/platform/psp/module.mk
@@ -4,7 +4,6 @@ MODULE_OBJS := \
powerman.o \
psp_main.o \
osys_psp.o \
- osys_psp_gu.o \
kbd_ss_c.o \
kbd_s_c.o \
kbd_ls_c.o \
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index d4b1c61537..a9e9aeb7d8 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -23,12 +23,19 @@
*
*/
+#include
+#include
+
+#include
+#include
+
#include "common/config-manager.h"
#include "common/events.h"
#include "common/rect.h"
#include "common/scummsys.h"
#include "osys_psp.h"
+#include "trace.h"
#include "backends/saves/psp/psp-saves.h"
#include "backends/timer/default/default-timer.h"
@@ -36,30 +43,62 @@
#include "graphics/scaler.h"
#include "sound/mixer_intern.h"
-#include
-#include
-
-#include
-
-#include "./trace.h"
#define SAMPLES_PER_SEC 44100
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
+#define PIXEL_SIZE (4)
+#define BUF_WIDTH (512)
+#define PSP_SCREEN_WIDTH 480
+#define PSP_SCREEN_HEIGHT 272
+#define PSP_FRAME_SIZE (BUF_WIDTH * PSP_SCREEN_HEIGHT * PIXEL_SIZE)
+#define MOUSE_SIZE 128
+#define KBD_DATA_SIZE 130560
+
+#define MAX_FPS 30
+
+unsigned int __attribute__((aligned(16))) displayList[262144];
+unsigned short __attribute__((aligned(16))) clut256[256];
+unsigned short __attribute__((aligned(16))) mouseClut[256];
+unsigned short __attribute__((aligned(16))) cursorPalette[256];
+unsigned short __attribute__((aligned(16))) kbClut[256];
+//unsigned int __attribute__((aligned(16))) offscreen256[640*480];
+//unsigned int __attribute__((aligned(16))) overlayBuffer256[640*480*2];
+unsigned int __attribute__((aligned(16))) mouseBuf256[MOUSE_SIZE*MOUSE_SIZE];
+
+extern unsigned long RGBToColour(unsigned long r, unsigned long g, unsigned long b);
+
+extern unsigned int size_keyboard_symbols_compressed;
+extern unsigned char keyboard_symbols_compressed[];
+extern unsigned int size_keyboard_symbols_shift_compressed;
+extern unsigned char keyboard_symbols_shift_compressed[];
+extern unsigned int size_keyboard_letters_compressed;
+extern unsigned char keyboard_letters_compressed[];
+extern unsigned int size_keyboard_letters_shift_compressed;
+extern unsigned char keyboard_letters_shift_compressed[];
+unsigned char *keyboard_symbols;
+unsigned char *keyboard_symbols_shift;
+unsigned char *keyboard_letters;
+unsigned char *keyboard_letters_shift;
+
+unsigned char kbd_ascii[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '[', ']', '\\', ';', '\'', ',', '.', '/', '`'};
+Common::KeyCode kbd_code[] = {Common::KEYCODE_1, Common::KEYCODE_2, Common::KEYCODE_3, Common::KEYCODE_4, Common::KEYCODE_5, Common::KEYCODE_6, Common::KEYCODE_7, Common::KEYCODE_8, Common::KEYCODE_9, Common::KEYCODE_0, Common::KEYCODE_MINUS, Common::KEYCODE_EQUALS, Common::KEYCODE_LEFTBRACKET, Common::KEYCODE_RIGHTBRACKET,
+ Common::KEYCODE_BACKSLASH, Common::KEYCODE_SEMICOLON, Common::KEYCODE_QUOTE, Common::KEYCODE_COMMA, Common::KEYCODE_PERIOD, Common::KEYCODE_SLASH, Common::KEYCODE_BACKQUOTE};
+unsigned char kbd_ascii_cl[] = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '{', '}', '|', ':', '"', '<', '>', '?', '~'};
+Common::KeyCode kbd_code_cl[] = {Common::KEYCODE_EXCLAIM, Common::KEYCODE_AT, Common::KEYCODE_HASH, Common::KEYCODE_DOLLAR, (Common::KeyCode)37, Common::KEYCODE_CARET, Common::KEYCODE_AMPERSAND, Common::KEYCODE_ASTERISK, Common::KEYCODE_LEFTPAREN, Common::KEYCODE_RIGHTPAREN, Common::KEYCODE_UNDERSCORE,
+ Common::KEYCODE_PLUS, (Common::KeyCode)123, (Common::KeyCode)125, (Common::KeyCode)124, Common::KEYCODE_COLON, Common::KEYCODE_QUOTEDBL, Common::KEYCODE_LESS, Common::KEYCODE_GREATER, Common::KEYCODE_QUESTION, (Common::KeyCode)126};
+#define CAPS_LOCK (1 << 0)
+#define SYMBOLS (1 << 1)
+
+
-unsigned short *DrawBuffer = (unsigned short *)0x44044000;
-unsigned short *DisplayBuffer = (unsigned short *)0x44000000;
unsigned long RGBToColour(unsigned long r, unsigned long g, unsigned long b) {
return (((b >> 3) << 10) | ((g >> 3) << 5) | ((r >> 3) << 0)) | 0x8000;
}
-void putPixel(uint16 x, uint16 y, unsigned long colour) {
- *(unsigned short *)(DrawBuffer + (y << 9) + x ) = colour;
-}
-
static int timer_handler(int t) {
DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager();
tm->handler();
@@ -76,7 +115,6 @@ const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = {
OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _lastScreenUpdate(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
-
memset(_palette, 0, sizeof(_palette));
_cursorPaletteDisabled = true;
@@ -87,15 +125,75 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0)
uint32 sdlFlags = SDL_INIT_AUDIO | SDL_INIT_TIMER;
SDL_Init(sdlFlags);
- sceDisplaySetMode(0, SCREEN_WIDTH, SCREEN_HEIGHT);
- sceDisplaySetFrameBuf((char *)DisplayBuffer, 512, 1, 1);
+
+ //sceKernelDcacheWritebackAll();
+
+ // setup
+ sceGuInit();
+ sceGuStart(0, displayList);
+ sceGuDrawBuffer(GU_PSM_8888, (void *)0, BUF_WIDTH);
+ sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)PSP_FRAME_SIZE, BUF_WIDTH);
+ sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * 2), BUF_WIDTH);
+ sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
+ sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
+ sceGuDepthRange(0xC350, 0x2710);
+ sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
+ sceGuEnable(GU_SCISSOR_TEST);
+ sceGuFrontFace(GU_CW);
+ sceGuEnable(GU_TEXTURE_2D);
+ sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
+ sceGuFinish();
+ sceGuSync(0,0);
+
sceDisplayWaitVblankStart();
+ sceGuDisplay(1);
+
+ //decompress keyboard data
+ uLongf kbdSize = KBD_DATA_SIZE;
+ keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE);
+ if (Z_OK != uncompress((Bytef *)keyboard_letters, &kbdSize, (const Bytef *)keyboard_letters_compressed, size_keyboard_letters_compressed))
+ error("OSystem_PSP: uncompressing keyboard_letters failed");
+
+ kbdSize = KBD_DATA_SIZE;
+ keyboard_letters_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
+ if (Z_OK != uncompress((Bytef *)keyboard_letters_shift, &kbdSize, (const Bytef *)keyboard_letters_shift_compressed, size_keyboard_letters_shift_compressed))
+ error("OSystem_PSP: uncompressing keyboard_letters_shift failed");
+
+ kbdSize = KBD_DATA_SIZE;
+ keyboard_symbols = (unsigned char *)memalign(16, KBD_DATA_SIZE);
+ if (Z_OK != uncompress((Bytef *)keyboard_symbols, &kbdSize, (const Bytef *)keyboard_symbols_compressed, size_keyboard_symbols_compressed))
+ error("OSystem_PSP: uncompressing keyboard_symbols failed");
+
+ kbdSize = KBD_DATA_SIZE;
+ keyboard_symbols_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
+ if (Z_OK != uncompress((Bytef *)keyboard_symbols_shift, &kbdSize, (const Bytef *)keyboard_symbols_shift_compressed, size_keyboard_symbols_shift_compressed))
+ error("OSystem_PSP: uncompressing keyboard_symbols_shift failed");
+
+ _keyboardVisible = false;
+ _clut = (unsigned short *)(((unsigned int)clut256) | 0x40000000);
+ _kbdClut = (unsigned short *)(((unsigned int)kbClut) | 0x40000000);
+ _mouseBuf = (byte *)mouseBuf256;
+ _graphicMode = STRETCHED_480X272;
+ _keySelected = 1;
+ _keyboardMode = 0;
+ _mouseX = PSP_SCREEN_WIDTH >> 1;
+ _mouseY = PSP_SCREEN_HEIGHT >> 1;
}
OSystem_PSP::~OSystem_PSP() {
+ free(keyboard_symbols_shift);
+ free(keyboard_symbols);
+ free(keyboard_letters_shift);
+ free(keyboard_letters);
+
free(_offscreen);
free(_overlayBuffer);
free(_mouseBuf);
+
+ _offscreen = 0;
+ _overlayBuffer = 0;
+ _mouseBuf = 0;
+ sceGuTerm();
}
@@ -128,36 +226,54 @@ const OSystem::GraphicsMode* OSystem_PSP::getSupportedGraphicsModes() const {
int OSystem_PSP::getDefaultGraphicsMode() const {
- return -1;
+ return STRETCHED_480X272;
}
bool OSystem_PSP::setGraphicsMode(int mode) {
+ _graphicMode = mode;
return true;
}
bool OSystem_PSP::setGraphicsMode(const char *name) {
- return true;
+ int i = 0;
+
+ while (s_supportedGraphicsModes[i].name) {
+ if (!strcmpi(s_supportedGraphicsModes[i].name, name)) {
+ _graphicMode = s_supportedGraphicsModes[i].id;
+ return true;
+ }
+ i++;
+ }
+
+ return false;
}
int OSystem_PSP::getGraphicsMode() const {
- return -1;
+ return _graphicMode;
}
void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
- _overlayWidth = _screenWidth = width;
- _overlayHeight = _screenHeight = height;
-
- free(_offscreen);
+ PSPDebugTrace("initSize\n");
+ _screenWidth = width;
+ _screenHeight = height;
- _offscreen = (byte *)malloc(width * height);
+ _overlayWidth = PSP_SCREEN_WIDTH; //width;
+ _overlayHeight = PSP_SCREEN_HEIGHT; //height;
- free(_overlayBuffer);
+// _offscreen = (byte *)offscreen256;
+ _overlayBuffer = (OverlayColor *)0x44000000 + PSP_FRAME_SIZE;
- _overlayBuffer = (OverlayColor *)malloc(_overlayWidth * _overlayHeight * sizeof(OverlayColor));
+ _offscreen = (byte *)_overlayBuffer + _overlayWidth * _overlayHeight * sizeof(OverlayColor);
bzero(_offscreen, width * height);
clearOverlay();
-
+ memset(_palette, 0xFFFF, 256 * sizeof(unsigned short));
+ _kbdClut[0] = 0xFFFF;
+ _kbdClut[246] = 0x4CCC;
+ _kbdClut[247] = 0x0000;
+ for (int i = 1; i < 31; i++)
+ _kbdClut[i] = 0xF888;
_mouseVisible = false;
+ sceKernelDcacheWritebackAll();
}
int16 OSystem_PSP::getWidth() {
@@ -175,6 +291,34 @@ void OSystem_PSP::setPalette(const byte *colors, uint start, uint num) {
_palette[start + i] = RGBToColour(b[0], b[1], b[2]);
b += 4;
}
+
+ //copy to CLUT
+ memcpy(_clut, _palette, 256*sizeof(unsigned short));
+
+ //force update of mouse CLUT as well, as it may have been set up before this palette was set
+ memcpy(mouseClut, _palette, 256*sizeof(unsigned short));
+ mouseClut[_mouseKeyColour] = 0;
+
+ sceKernelDcacheWritebackAll();
+}
+
+void OSystem_PSP::setCursorPalette(const byte *colors, uint start, uint num) {
+ const byte *b = colors;
+
+ for (uint i = 0; i < num; ++i) {
+ cursorPalette[start + i] = RGBToColour(b[0], b[1], b[2]);
+ b += 4;
+ }
+
+ cursorPalette[0] = 0;
+
+ _cursorPaletteDisabled = false;
+
+ sceKernelDcacheWritebackAll();
+}
+
+void OSystem_PSP::disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
}
void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
@@ -204,10 +348,21 @@ void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
byte *dst = _offscreen + y * _screenWidth + x;
- if (_screenWidth == pitch && pitch == w) {
+
+ if (_screenWidth == pitch && pitch == w)
+ {
memcpy(dst, buf, h * w);
- } else {
- do {
+/*
+ sceGuStart(0, displayList);
+ sceGuCopyImage( 3, 0, 0, w/2, h, w/2, (void *)buf, x/2, y, _screenWidth /2, _offscreen);
+ sceGuFinish();
+ sceGuSync(0,0);
+*/
+ }
+ else
+ {
+ do
+ {
memcpy(dst, buf, w);
buf += pitch;
dst += _screenWidth;
@@ -230,52 +385,205 @@ void OSystem_PSP::unlockScreen() {
}
void OSystem_PSP::updateScreen() {
- unsigned short *temp;
+ u32 now = getMillis();
+ if (now - _lastScreenUpdate < 1000 / MAX_FPS)
+ return;
- uint xStart = (SCREEN_WIDTH >> 1) - (_screenWidth >> 1);
- uint yStart = (SCREEN_HEIGHT >> 1) - (_screenHeight >> 1);
+ _lastScreenUpdate = now;
- for (int i = 0; i < _screenHeight; ++i) {
- for (int j = 0; j < _screenWidth; ++j) {
- putPixel(xStart + j, yStart + i, _palette[_offscreen[i * _screenWidth +j]]);
- }
+
+ sceGuStart(0, displayList);
+
+ sceGuClearColor(0xFF000000);
+ sceGuClear(GU_COLOR_BUFFER_BIT);
+
+ sceGuClutMode(GU_PSM_5551, 0, 0xFF, 0);
+ sceGuClutLoad(32, clut256); // upload 32*8 entries (256)
+ sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
+ if (_screenWidth == 320)
+ sceGuTexImage(0, 512, 256, _screenWidth, _offscreen);
+ else
+ sceGuTexImage(0, 512, 512, _screenWidth, _offscreen);
+ sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
+ sceGuTexFilter(GU_LINEAR, GU_LINEAR);
+ sceGuTexOffset(0,0);
+ sceGuAmbientColor(0xFFFFFFFF);
+ sceGuColor(0xFFFFFFFF);
+
+ struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(2 * sizeof(struct Vertex));
+ vertices[0].u = 0.5; vertices[0].v = 0.5;
+ vertices[1].u = _screenWidth - 0.5; vertices[1].v = _screenHeight - 0.5;
+ switch(_graphicMode) {
+ case CENTERED_320X200:
+ vertices[0].x = (PSP_SCREEN_WIDTH - 320) / 2; vertices[0].y = (PSP_SCREEN_HEIGHT - 200) / 2; vertices[0].z = 0;
+ vertices[1].x = PSP_SCREEN_WIDTH - (PSP_SCREEN_WIDTH - 320) / 2; vertices[1].y = PSP_SCREEN_HEIGHT - (PSP_SCREEN_HEIGHT - 200) / 2; vertices[1].z = 0;
+ break;
+ case CENTERED_435X272:
+ vertices[0].x = (PSP_SCREEN_WIDTH - 435) / 2; vertices[0].y = 0; vertices[0].z = 0;
+ vertices[1].x = PSP_SCREEN_WIDTH - (PSP_SCREEN_WIDTH - 435) / 2; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
+ break;
+ case STRETCHED_480X272:
+ vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
+ vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
+ break;
+ case CENTERED_362X272:
+ vertices[0].x = (PSP_SCREEN_WIDTH - 362) / 2; vertices[0].y = 0; vertices[0].z = 0;
+ vertices[1].x = PSP_SCREEN_WIDTH - (PSP_SCREEN_WIDTH - 362) / 2; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
+ break;
}
- if (_overlayVisible) {
- for (int i = 0; i < _screenHeight; ++i) {
- for (int j = 0; j < _screenWidth; ++j) {
+ if (_shakePos) {
+ vertices[0].y += _shakePos;
+ vertices[1].y += _shakePos;
+ }
- OverlayColor pixel = _overlayBuffer[(i * _overlayWidth +j)];
+ sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
+ if (_screenWidth == 640) {
+ sceGuTexImage(0, 512, 512, _screenWidth, _offscreen+512);
+ vertices[0].u = 512 + 0.5; vertices[1].v = _screenHeight - 0.5;
+ vertices[0].x += (vertices[1].x - vertices[0].x) * 511 / 640; vertices[0].y = 0; vertices[0].z = 0;
+ sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
+ }
- if (pixel & 0x8000)
- putPixel(xStart + j, yStart + i, pixel);
- }
+
+ // draw overlay
+ if (_overlayVisible) {
+ vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
+ vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
+ vertices[0].u = 0.5; vertices[0].v = 0.5;
+ vertices[1].u = _overlayWidth - 0.5; vertices[1].v = _overlayHeight - 0.5;
+ sceGuTexMode(GU_PSM_4444, 0, 0, 0); // 16-bit image
+ sceGuDisable(GU_ALPHA_TEST);
+ sceGuEnable(GU_BLEND);
+
+ //sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
+ sceGuBlendFunc(GU_ADD, GU_FIX, GU_ONE_MINUS_SRC_ALPHA, 0xFFFFFFFF, 0);
+
+ if (_overlayWidth > 320)
+ sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer);
+ else
+ sceGuTexImage(0, 512, 256, _overlayWidth, _overlayBuffer);
+
+ sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
+ sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
+ // need to render twice for textures > 512
+ if ( _overlayWidth > 512) {
+ sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer + 512);
+ vertices[0].u = 512 + 0.5; vertices[1].v = _overlayHeight - 0.5;
+ vertices[0].x = PSP_SCREEN_WIDTH * 512 / 640; vertices[0].y = 0; vertices[0].z = 0;
+ sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
}
+ sceGuDisable(GU_BLEND);
}
- //draw mouse on top
+ // draw mouse
if (_mouseVisible) {
- for (int y = 0; y < _mouseHeight; ++y) {
- for (int x = 0; x < _mouseWidth; ++x) {
- if (_mouseBuf[y * _mouseHeight + x] != _mouseKeyColour) {
- int my = _mouseY + y; // + _mouseHotspotY;
- int mx = _mouseX + x; // + _mouseHotspotX;
-
- if (mx >= 0 && mx < _screenWidth && my >= 0 && my < _screenHeight)
- putPixel(xStart + mx, yStart + my, _palette[_mouseBuf[y * _mouseHeight + x]]);
- }
+ sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
+ sceGuClutMode(GU_PSM_5551, 0, 0xFF, 0);
+ sceGuClutLoad(32, _cursorPaletteDisabled ? mouseClut : cursorPalette); // upload 32*8 entries (256)
+ sceGuAlphaFunc(GU_GREATER, 0, 0xFF);
+ sceGuEnable(GU_ALPHA_TEST);
+ sceGuTexImage(0, MOUSE_SIZE, MOUSE_SIZE, MOUSE_SIZE, _mouseBuf);
+ sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
+
+ vertices[0].u = 0.5; vertices[0].v = 0.5;
+ vertices[1].u = _mouseWidth - 0.5; vertices[1].v = _mouseHeight - 0.5;
+
+ //adjust cursor position
+ int mX = _mouseX - _mouseHotspotX;
+ int mY = _mouseY - _mouseHotspotY;
+
+ if (_overlayVisible) {
+ float scalex, scaley;
+
+ scalex = (float)PSP_SCREEN_WIDTH /_overlayWidth;
+ scaley = (float)PSP_SCREEN_HEIGHT /_overlayHeight;
+
+ vertices[0].x = mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
+ vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
+ } else
+ switch(_graphicMode) {
+ case CENTERED_320X200:
+ vertices[0].x = (PSP_SCREEN_WIDTH - 320) / 2 + mX; vertices[0].y = (PSP_SCREEN_HEIGHT - 200) / 2 + mY; vertices[0].z = 0;
+ vertices[1].x = vertices[0].x+_mouseWidth; vertices[1].y = vertices[0].y + _mouseHeight; vertices[1].z = 0;
+ break;
+ case CENTERED_435X272:
+ {
+ float scalex, scaley;
+
+ scalex = 435.0f / _screenWidth;
+ scaley = 272.0f / _screenHeight;
+
+ vertices[0].x = (PSP_SCREEN_WIDTH - 435) / 2 + mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
+ vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
+
+ }
+ break;
+ case CENTERED_362X272:
+ {
+ float scalex, scaley;
+
+ scalex = 362.0f / _screenWidth;
+ scaley = 272.0f / _screenHeight;
+
+ vertices[0].x = (PSP_SCREEN_WIDTH - 362) / 2 + mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
+ vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
+ }
+ break;
+ case STRETCHED_480X272:
+ {
+ float scalex, scaley;
+
+ scalex = (float)PSP_SCREEN_WIDTH / _screenWidth;
+ scaley = (float)PSP_SCREEN_HEIGHT / _screenHeight;
+
+ vertices[0].x = mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
+ vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
}
+ break;
}
+ sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
}
+ if (_keyboardVisible) {
+ sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
+ sceGuClutMode(GU_PSM_4444, 0, 0xFF, 0);
+ sceGuClutLoad(32, kbClut); // upload 32*8 entries (256)
+ sceGuDisable(GU_ALPHA_TEST);
+ sceGuEnable(GU_BLEND);
+ sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
+ switch(_keyboardMode) {
+ case 0:
+ sceGuTexImage(0, 512, 512, 480, keyboard_letters);
+ break;
+ case CAPS_LOCK:
+ sceGuTexImage(0, 512, 512, 480, keyboard_letters_shift);
+ break;
+ case SYMBOLS:
+ sceGuTexImage(0, 512, 512, 480, keyboard_symbols);
+ break;
+ case (CAPS_LOCK | SYMBOLS):
+ sceGuTexImage(0, 512, 512, 480, keyboard_symbols_shift);
+ break;
+ }
+ sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
+
+ vertices[0].u = 0.5; vertices[0].v = 0.5;
+ vertices[1].u = PSP_SCREEN_WIDTH-0.5; vertices[1].v = PSP_SCREEN_HEIGHT-0.5;
+ vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
+ vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[0].z = 0;
+ sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
+ sceGuDisable(GU_BLEND);
+ }
+ sceKernelDcacheWritebackAll();
+
+ sceGuFinish();
+ sceGuSync(0,0);
- // switch buffers
- temp = DrawBuffer;
- DrawBuffer = DisplayBuffer;
- DisplayBuffer = temp;
sceDisplayWaitVblankStart();
- sceDisplaySetFrameBuf((char *)DisplayBuffer, 512, 1, 1);
+ sceGuSwapBuffers();
+ //sceKernelDcacheWritebackAll();
}
void OSystem_PSP::setShakePos(int shakeOffset) {
@@ -392,16 +700,18 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
_mouseKeyColour = keycolor & 0xFF;
- free(_mouseBuf);
+ memcpy(mouseClut, _palette, 256 * sizeof(unsigned short));
+ mouseClut[_mouseKeyColour] = 0;
+ sceKernelDcacheWritebackAll();
- _mouseBuf = (byte *)malloc(w * h);
- memcpy(_mouseBuf, buf, w * h);
+ for (unsigned int i = 0; i < h; i++)
+ memcpy(_mouseBuf + i * MOUSE_SIZE, buf + i * w, w);
}
#define PAD_CHECK_TIME 40
#define PAD_DIR_MASK (PSP_CTRL_UP | PSP_CTRL_DOWN | PSP_CTRL_LEFT | PSP_CTRL_RIGHT)
-bool OSystem_PSP::pollEvent(Common::Event &event) {
+bool OSystem_PSP::processInput(Common::Event &event) {
s8 analogStepAmountX = 0;
s8 analogStepAmountY = 0;
/*
@@ -543,6 +853,136 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
return false;
}
+bool OSystem_PSP::pollEvent(Common::Event &event) {
+ float nub_angle = -1;
+ int x, y;
+
+ sceCtrlSetSamplingCycle(0);
+ sceCtrlSetSamplingMode(1);
+ sceCtrlReadBufferPositive(&pad, 1);
+
+ uint32 buttonsChanged = pad.Buttons ^ _prevButtons;
+
+ if ((buttonsChanged & PSP_CTRL_SELECT) || (pad.Buttons & PSP_CTRL_SELECT)) {
+ if ( !(pad.Buttons & PSP_CTRL_SELECT) )
+ _keyboardVisible = !_keyboardVisible;
+ _prevButtons = pad.Buttons;
+ return false;
+ }
+
+ if (!_keyboardVisible)
+ return processInput(event);
+
+ if ( (buttonsChanged & PSP_CTRL_RTRIGGER) && !(pad.Buttons & PSP_CTRL_RTRIGGER))
+ _keyboardMode ^= CAPS_LOCK;
+
+ if ( (buttonsChanged & PSP_CTRL_LTRIGGER) && !(pad.Buttons & PSP_CTRL_LTRIGGER))
+ _keyboardMode ^= SYMBOLS;
+
+ if ( (buttonsChanged & PSP_CTRL_LEFT) && !(pad.Buttons & PSP_CTRL_LEFT)) {
+ event.kbd.flags = 0;
+ event.kbd.ascii = 0;
+ event.kbd.keycode = Common::KEYCODE_LEFT;
+ _prevButtons = pad.Buttons;
+ return true;
+ }
+
+ if ( (buttonsChanged & PSP_CTRL_RIGHT) && !(pad.Buttons & PSP_CTRL_RIGHT)) {
+ event.kbd.flags = 0;
+ event.kbd.ascii = 0;
+ event.kbd.keycode = Common::KEYCODE_RIGHT;
+ _prevButtons = pad.Buttons;
+ return true;
+ }
+
+ if ( (buttonsChanged & PSP_CTRL_UP) && !(pad.Buttons & PSP_CTRL_UP)) {
+ event.kbd.flags = 0;
+ event.kbd.ascii = 0;
+ event.kbd.keycode = Common::KEYCODE_UP;
+ _prevButtons = pad.Buttons;
+ return true;
+ }
+
+ if ( (buttonsChanged & PSP_CTRL_DOWN) && !(pad.Buttons & PSP_CTRL_DOWN)) {
+ event.kbd.flags = 0;
+ event.kbd.ascii = 0;
+ event.kbd.keycode = Common::KEYCODE_DOWN;
+ _prevButtons = pad.Buttons;
+ return true;
+ }
+
+ // compute nub direction
+ x = pad.Lx-128;
+ y = pad.Ly-128;
+ _kbdClut[_keySelected] = 0xf888;
+ if (x*x + y*y > 10000) {
+ nub_angle = atan2(y, x);
+ _keySelected = (int)(1 + (M_PI + nub_angle) * 30 / (2 * M_PI));
+ _keySelected -= 2;
+ if (_keySelected < 1)
+ _keySelected += 30;
+ _kbdClut[_keySelected] = 0xFFFF;
+
+ if (buttonsChanged & PSP_CTRL_CROSS) {
+ event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
+ if (_keySelected > 26) {
+ event.kbd.flags = 0;
+ switch(_keySelected) {
+ case 27:
+ event.kbd.ascii = ' ';
+ event.kbd.keycode = Common::KEYCODE_SPACE;
+ break;
+ case 28:
+ event.kbd.ascii = 127;
+ event.kbd.keycode = Common::KEYCODE_DELETE;
+ break;
+ case 29:
+ event.kbd.ascii = 8;
+ event.kbd.keycode = Common::KEYCODE_BACKSPACE;
+ break;
+ case 30:
+ event.kbd.ascii = 13;
+ event.kbd.keycode = Common::KEYCODE_RETURN;
+ break;
+ }
+ } else {
+ switch( _keyboardMode) {
+ case 0:
+ event.kbd.flags = 0;
+ event.kbd.ascii = 'a'+_keySelected-1;
+ event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1);
+ break;
+ case CAPS_LOCK:
+ event.kbd.ascii = 'A'+_keySelected-1;
+ event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1);
+ event.kbd.flags = Common::KBD_SHIFT;
+ break;
+ case SYMBOLS:
+ if (_keySelected < 21) {
+ event.kbd.flags = 0;
+ event.kbd.ascii = kbd_ascii[_keySelected-1];
+ event.kbd.keycode = kbd_code[ _keySelected-1];
+ }
+ break;
+ case (SYMBOLS|CAPS_LOCK):
+ if (_keySelected < 21) {
+ event.kbd.flags = 0;
+ event.kbd.ascii = kbd_ascii_cl[_keySelected-1];
+ event.kbd.keycode = kbd_code_cl[ _keySelected-1];
+ }
+ break;
+ }
+ }
+ _prevButtons = pad.Buttons;
+ return true;
+ }
+ }
+
+ _prevButtons = pad.Buttons;
+ return false;
+}
+
+
uint32 OSystem_PSP::getMillis() {
return SDL_GetTicks();
}
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 68e1a7da22..353561cced 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -50,6 +50,11 @@ public:
static OSystem *instance();
protected:
+ struct Vertex {
+ float u,v;
+ float x,y,z;
+ };
+
uint16 _screenWidth;
uint16 _screenHeight;
uint16 _overlayWidth;
@@ -71,6 +76,14 @@ protected:
byte *_mouseBuf;
bool _cursorPaletteDisabled;
+ int _graphicMode;
+ Vertex *_vertices;
+ unsigned short* _clut;
+ unsigned short* _kbdClut;
+ bool _keyboardVisible;
+ int _keySelected;
+ int _keyboardMode;
+
uint32 _prevButtons;
uint32 _lastPadCheck;
uint32 _padAccel;
@@ -101,6 +114,8 @@ public:
virtual int16 getWidth();
virtual int16 getHeight();
virtual void setPalette(const byte *colors, uint start, uint num);
+ virtual void setCursorPalette(const byte *colors, uint start, uint num);
+ virtual void disableCursorPalette(bool disable);
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
virtual Graphics::Surface *lockScreen();
virtual void unlockScreen();
@@ -123,6 +138,7 @@ public:
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
+ virtual bool processInput(Common::Event &event);
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
deleted file mode 100644
index c13c5bc21f..0000000000
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ /dev/null
@@ -1,629 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- */
-
-#include "osys_psp_gu.h"
-#include "trace.h"
-#include "common/events.h"
-
-#include
-
-#include
-
-#define PIXEL_SIZE (4)
-#define BUF_WIDTH (512)
-#define PSP_SCREEN_WIDTH 480
-#define PSP_SCREEN_HEIGHT 272
-#define PSP_FRAME_SIZE (BUF_WIDTH * PSP_SCREEN_HEIGHT * PIXEL_SIZE)
-#define MOUSE_SIZE 128
-#define KBD_DATA_SIZE 130560
-
-#define MAX_FPS 30
-
-unsigned int __attribute__((aligned(16))) list[262144];
-unsigned short __attribute__((aligned(16))) clut256[256];
-unsigned short __attribute__((aligned(16))) mouseClut[256];
-unsigned short __attribute__((aligned(16))) cursorPalette[256];
-unsigned short __attribute__((aligned(16))) kbClut[256];
-//unsigned int __attribute__((aligned(16))) offscreen256[640*480];
-//unsigned int __attribute__((aligned(16))) overlayBuffer256[640*480*2];
-unsigned int __attribute__((aligned(16))) mouseBuf256[MOUSE_SIZE*MOUSE_SIZE];
-
-extern unsigned long RGBToColour(unsigned long r, unsigned long g, unsigned long b);
-
-extern unsigned int size_keyboard_symbols_compressed;
-extern unsigned char keyboard_symbols_compressed[];
-extern unsigned int size_keyboard_symbols_shift_compressed;
-extern unsigned char keyboard_symbols_shift_compressed[];
-extern unsigned int size_keyboard_letters_compressed;
-extern unsigned char keyboard_letters_compressed[];
-extern unsigned int size_keyboard_letters_shift_compressed;
-extern unsigned char keyboard_letters_shift_compressed[];
-unsigned char *keyboard_symbols;
-unsigned char *keyboard_symbols_shift;
-unsigned char *keyboard_letters;
-unsigned char *keyboard_letters_shift;
-
-unsigned char kbd_ascii[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '[', ']', '\\', ';', '\'', ',', '.', '/', '`'};
-Common::KeyCode kbd_code[] = {Common::KEYCODE_1, Common::KEYCODE_2, Common::KEYCODE_3, Common::KEYCODE_4, Common::KEYCODE_5, Common::KEYCODE_6, Common::KEYCODE_7, Common::KEYCODE_8, Common::KEYCODE_9, Common::KEYCODE_0, Common::KEYCODE_MINUS, Common::KEYCODE_EQUALS, Common::KEYCODE_LEFTBRACKET, Common::KEYCODE_RIGHTBRACKET,
- Common::KEYCODE_BACKSLASH, Common::KEYCODE_SEMICOLON, Common::KEYCODE_QUOTE, Common::KEYCODE_COMMA, Common::KEYCODE_PERIOD, Common::KEYCODE_SLASH, Common::KEYCODE_BACKQUOTE};
-unsigned char kbd_ascii_cl[] = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '{', '}', '|', ':', '"', '<', '>', '?', '~'};
-Common::KeyCode kbd_code_cl[] = {Common::KEYCODE_EXCLAIM, Common::KEYCODE_AT, Common::KEYCODE_HASH, Common::KEYCODE_DOLLAR, (Common::KeyCode)37, Common::KEYCODE_CARET, Common::KEYCODE_AMPERSAND, Common::KEYCODE_ASTERISK, Common::KEYCODE_LEFTPAREN, Common::KEYCODE_RIGHTPAREN, Common::KEYCODE_UNDERSCORE,
- Common::KEYCODE_PLUS, (Common::KeyCode)123, (Common::KeyCode)125, (Common::KeyCode)124, Common::KEYCODE_COLON, Common::KEYCODE_QUOTEDBL, Common::KEYCODE_LESS, Common::KEYCODE_GREATER, Common::KEYCODE_QUESTION, (Common::KeyCode)126};
-#define CAPS_LOCK (1 << 0)
-#define SYMBOLS (1 << 1)
-
-
-OSystem_PSP_GU::OSystem_PSP_GU() {
- //sceKernelDcacheWritebackAll();
-
- // setup
- sceGuInit();
- sceGuStart(0, list);
- sceGuDrawBuffer(GU_PSM_8888, (void *)0, BUF_WIDTH);
- sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)PSP_FRAME_SIZE, BUF_WIDTH);
- sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * 2), BUF_WIDTH);
- sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
- sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
- sceGuDepthRange(0xc350, 0x2710);
- sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
- sceGuEnable(GU_SCISSOR_TEST);
- sceGuFrontFace(GU_CW);
- sceGuEnable(GU_TEXTURE_2D);
- sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
- sceGuFinish();
- sceGuSync(0,0);
-
- sceDisplayWaitVblankStart();
- sceGuDisplay(1);
-
- //decompress keyboard data
- uLongf kbdSize = KBD_DATA_SIZE;
- keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE);
- if (Z_OK != uncompress((Bytef *)keyboard_letters, &kbdSize, (const Bytef *)keyboard_letters_compressed, size_keyboard_letters_compressed))
- error("OSystem_PSP_GU: uncompressing keyboard_letters failed");
-
- kbdSize = KBD_DATA_SIZE;
- keyboard_letters_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
- if (Z_OK != uncompress((Bytef *)keyboard_letters_shift, &kbdSize, (const Bytef *)keyboard_letters_shift_compressed, size_keyboard_letters_shift_compressed))
- error("OSystem_PSP_GU: uncompressing keyboard_letters_shift failed");
-
- kbdSize = KBD_DATA_SIZE;
- keyboard_symbols = (unsigned char *)memalign(16, KBD_DATA_SIZE);
- if (Z_OK != uncompress((Bytef *)keyboard_symbols, &kbdSize, (const Bytef *)keyboard_symbols_compressed, size_keyboard_symbols_compressed))
- error("OSystem_PSP_GU: uncompressing keyboard_symbols failed");
-
- kbdSize = KBD_DATA_SIZE;
- keyboard_symbols_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
- if (Z_OK != uncompress((Bytef *)keyboard_symbols_shift, &kbdSize, (const Bytef *)keyboard_symbols_shift_compressed, size_keyboard_symbols_shift_compressed))
- error("OSystem_PSP_GU: uncompressing keyboard_symbols_shift failed");
-
- _keyboardVisible = false;
- _clut = (unsigned short*)(((unsigned int)clut256)|0x40000000);
- _kbdClut = (unsigned short*)(((unsigned int)kbClut)|0x40000000);
- _mouseBuf = (byte *)mouseBuf256;
- _graphicMode = STRETCHED_480X272;
- _keySelected = 1;
- _keyboardMode = 0;
- _mouseX = PSP_SCREEN_WIDTH >> 1;
- _mouseY = PSP_SCREEN_HEIGHT >> 1;
-}
-
-OSystem_PSP_GU::~OSystem_PSP_GU() {
- free(keyboard_symbols_shift);
- free(keyboard_symbols);
- free(keyboard_letters_shift);
- free(keyboard_letters);
-
- _offscreen = 0;
- _overlayBuffer = 0;
- _mouseBuf = 0;
- sceGuTerm();
-}
-
-void OSystem_PSP_GU::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
- PSPDebugTrace("initSize\n");
- _screenWidth = width;
- _screenHeight = height;
-
- _overlayWidth = PSP_SCREEN_WIDTH; //width;
- _overlayHeight = PSP_SCREEN_HEIGHT; //height;
-
-// _offscreen = (byte *)offscreen256;
- _overlayBuffer = (OverlayColor *)0x44000000 + PSP_FRAME_SIZE;
-
- _offscreen = (byte *)_overlayBuffer + _overlayWidth * _overlayHeight * sizeof(OverlayColor);
- bzero(_offscreen, width * height);
- clearOverlay();
- memset(_palette, 0xffff, 256 * sizeof(unsigned short));
- _kbdClut[0] = 0xffff;
- _kbdClut[246] = 0x4ccc;
- _kbdClut[247] = 0x0000;
- for (int i=1;i<31;i++)
- _kbdClut[i] = 0xf888;
- _mouseVisible = false;
- sceKernelDcacheWritebackAll();
-}
-
-int OSystem_PSP_GU::getDefaultGraphicsMode() const {
- return STRETCHED_480X272;
-}
-
-bool OSystem_PSP_GU::setGraphicsMode(int mode) {
- _graphicMode = mode;
- return true;
-}
-
-bool OSystem_PSP_GU::setGraphicsMode(const char *name) {
- int i = 0;
-
- while (s_supportedGraphicsModes[i].name) {
- if (!strcmpi(s_supportedGraphicsModes[i].name, name)) {
- _graphicMode = s_supportedGraphicsModes[i].id;
- return true;
- }
- i++;
- }
-
- return false;
-}
-
-int OSystem_PSP_GU::getGraphicsMode() const {
- return _graphicMode;
-}
-
-void OSystem_PSP_GU::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
- //TODO: handle cursorTargetScale
- _mouseWidth = w;
- _mouseHeight = h;
-
- _mouseHotspotX = hotspotX;
- _mouseHotspotY = hotspotY;
-
- _mouseKeyColour = keycolor & 0xFF;
-
- memcpy(mouseClut, _palette, 256*sizeof(unsigned short));
- mouseClut[_mouseKeyColour] = 0;
- sceKernelDcacheWritebackAll();
-
- for (unsigned int i=0;i _screenWidth - x) {
- w = _screenWidth - x;
- }
-
- if (h > _screenHeight - y) {
- h = _screenHeight - y;
- }
-
- if (w <= 0 || h <= 0)
- return;
-
-
- byte *dst = _offscreen + y * _screenWidth + x;
-
- if (_screenWidth == pitch && pitch == w)
- {
- memcpy(dst, buf, h * w);
-/*
- sceGuStart(0,list);
- sceGuCopyImage( 3, 0, 0, w/2, h, w/2, (void *)buf, x/2, y, _screenWidth /2, _offscreen);
- sceGuFinish();
- sceGuSync(0,0);
-*/
- }
- else
- {
- do
- {
- memcpy(dst, buf, w);
- buf += pitch;
- dst += _screenWidth;
- } while (--h);
- }
-}
-
-void OSystem_PSP_GU::updateScreen() {
- u32 now = getMillis();
- if (now - _lastScreenUpdate < 1000 / MAX_FPS)
- return;
-
- _lastScreenUpdate = now;
-
-
- sceGuStart(0,list);
-
- sceGuClearColor(0xff000000);
- sceGuClear(GU_COLOR_BUFFER_BIT);
-
- sceGuClutMode(GU_PSM_5551, 0, 0xff, 0);
- sceGuClutLoad(32, clut256); // upload 32*8 entries (256)
- sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
- if (_screenWidth == 320)
- sceGuTexImage(0, 512, 256, _screenWidth, _offscreen);
- else
- sceGuTexImage(0, 512, 512, _screenWidth, _offscreen);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
- sceGuTexFilter(GU_LINEAR, GU_LINEAR);
- sceGuTexOffset(0,0);
- sceGuAmbientColor(0xffffffff);
- sceGuColor(0xffffffff);
-
- struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(2 * sizeof(struct Vertex));
- vertices[0].u = 0.5; vertices[0].v = 0.5;
- vertices[1].u = _screenWidth - 0.5; vertices[1].v = _screenHeight - 0.5;
- switch(_graphicMode) {
- case CENTERED_320X200:
- vertices[0].x = (PSP_SCREEN_WIDTH - 320) / 2; vertices[0].y = (PSP_SCREEN_HEIGHT - 200) / 2; vertices[0].z = 0;
- vertices[1].x = PSP_SCREEN_WIDTH - (PSP_SCREEN_WIDTH - 320) / 2; vertices[1].y = PSP_SCREEN_HEIGHT - (PSP_SCREEN_HEIGHT - 200) / 2; vertices[1].z = 0;
- break;
- case CENTERED_435X272:
- vertices[0].x = (PSP_SCREEN_WIDTH - 435) / 2; vertices[0].y = 0; vertices[0].z = 0;
- vertices[1].x = PSP_SCREEN_WIDTH - (PSP_SCREEN_WIDTH - 435) / 2; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
- break;
- case STRETCHED_480X272:
- vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
- vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
- break;
- case CENTERED_362X272:
- vertices[0].x = (PSP_SCREEN_WIDTH - 362) / 2; vertices[0].y = 0; vertices[0].z = 0;
- vertices[1].x = PSP_SCREEN_WIDTH - (PSP_SCREEN_WIDTH - 362) / 2; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
- break;
- }
-
- if (_shakePos) {
- vertices[0].y += _shakePos;
- vertices[1].y += _shakePos;
- }
-
- sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
- if (_screenWidth == 640) {
- sceGuTexImage(0, 512, 512, _screenWidth, _offscreen+512);
- vertices[0].u = 512 + 0.5; vertices[1].v = _screenHeight - 0.5;
- vertices[0].x += (vertices[1].x - vertices[0].x) * 511 / 640; vertices[0].y = 0; vertices[0].z = 0;
- sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
- }
-
-
- // draw overlay
- if (_overlayVisible) {
- vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
- vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
- vertices[0].u = 0.5; vertices[0].v = 0.5;
- vertices[1].u = _overlayWidth - 0.5; vertices[1].v = _overlayHeight - 0.5;
- sceGuTexMode(GU_PSM_4444, 0, 0, 0); // 16-bit image
- sceGuDisable(GU_ALPHA_TEST);
- sceGuEnable(GU_BLEND);
-
- //sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
- sceGuBlendFunc(GU_ADD, GU_FIX, GU_ONE_MINUS_SRC_ALPHA, 0xFFFFFFFF, 0);
-
- if (_overlayWidth > 320)
- sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer);
- else
- sceGuTexImage(0, 512, 256, _overlayWidth, _overlayBuffer);
-
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
- // need to render twice for textures > 512
- if ( _overlayWidth > 512) {
- sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer + 512);
- vertices[0].u = 512 + 0.5; vertices[1].v = _overlayHeight - 0.5;
- vertices[0].x = PSP_SCREEN_WIDTH * 512 / 640; vertices[0].y = 0; vertices[0].z = 0;
- sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
- }
- sceGuDisable(GU_BLEND);
- }
-
- // draw mouse
- if (_mouseVisible) {
- sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
- sceGuClutMode(GU_PSM_5551, 0, 0xff, 0);
- sceGuClutLoad(32, _cursorPaletteDisabled ? mouseClut : cursorPalette); // upload 32*8 entries (256)
- sceGuAlphaFunc(GU_GREATER,0,0xff);
- sceGuEnable(GU_ALPHA_TEST);
- sceGuTexImage(0, MOUSE_SIZE, MOUSE_SIZE, MOUSE_SIZE, _mouseBuf);
- sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
-
- vertices[0].u = 0.5; vertices[0].v = 0.5;
- vertices[1].u = _mouseWidth - 0.5; vertices[1].v = _mouseHeight - 0.5;
-
- //adjust cursor position
- int mX = _mouseX - _mouseHotspotX;
- int mY = _mouseY - _mouseHotspotY;
-
- if (_overlayVisible) {
- float scalex, scaley;
-
- scalex = (float)PSP_SCREEN_WIDTH /_overlayWidth;
- scaley = (float)PSP_SCREEN_HEIGHT /_overlayHeight;
-
- vertices[0].x = mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
- vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
- } else
- switch(_graphicMode) {
- case CENTERED_320X200:
- vertices[0].x = (PSP_SCREEN_WIDTH - 320) / 2 + mX; vertices[0].y = (PSP_SCREEN_HEIGHT - 200) / 2 + mY; vertices[0].z = 0;
- vertices[1].x = vertices[0].x+_mouseWidth; vertices[1].y = vertices[0].y + _mouseHeight; vertices[1].z = 0;
- break;
- case CENTERED_435X272:
- {
- float scalex, scaley;
-
- scalex = 435.0f / _screenWidth;
- scaley = 272.0f / _screenHeight;
-
- vertices[0].x = (PSP_SCREEN_WIDTH - 435) / 2 + mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
- vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
-
- }
- break;
- case CENTERED_362X272:
- {
- float scalex, scaley;
-
- scalex = 362.0f / _screenWidth;
- scaley = 272.0f / _screenHeight;
-
- vertices[0].x = (PSP_SCREEN_WIDTH - 362) / 2 + mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
- vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
- }
- break;
- case STRETCHED_480X272:
- {
- float scalex, scaley;
-
- scalex = (float)PSP_SCREEN_WIDTH / _screenWidth;
- scaley = (float)PSP_SCREEN_HEIGHT / _screenHeight;
-
- vertices[0].x = mX * scalex; vertices[0].y = mY * scaley; vertices[0].z = 0;
- vertices[1].x = vertices[0].x + _mouseWidth * scalex; vertices[1].y = vertices[0].y + _mouseHeight * scaley; vertices[0].z = 0;
- }
- break;
- }
- sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
- }
-
- if (_keyboardVisible) {
- sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
- sceGuClutMode(GU_PSM_4444, 0, 0xff, 0);
- sceGuClutLoad(32, kbClut); // upload 32*8 entries (256)
- sceGuDisable(GU_ALPHA_TEST);
- sceGuEnable(GU_BLEND);
- sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
- switch(_keyboardMode) {
- case 0:
- sceGuTexImage(0, 512, 512, 480, keyboard_letters);
- break;
- case CAPS_LOCK:
- sceGuTexImage(0, 512, 512, 480, keyboard_letters_shift);
- break;
- case SYMBOLS:
- sceGuTexImage(0, 512, 512, 480, keyboard_symbols);
- break;
- case (CAPS_LOCK | SYMBOLS):
- sceGuTexImage(0, 512, 512, 480, keyboard_symbols_shift);
- break;
- }
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-
- vertices[0].u = 0.5; vertices[0].v = 0.5;
- vertices[1].u = PSP_SCREEN_WIDTH-0.5; vertices[1].v = PSP_SCREEN_HEIGHT-0.5;
- vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
- vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[0].z = 0;
- sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
- sceGuDisable(GU_BLEND);
- }
- sceKernelDcacheWritebackAll();
-
- sceGuFinish();
- sceGuSync(0,0);
-
- sceDisplayWaitVblankStart();
- sceGuSwapBuffers();
-
- //sceKernelDcacheWritebackAll();
-}
-
-bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
- float nub_angle = -1;
- int x, y;
-
- sceCtrlSetSamplingCycle(0);
- sceCtrlSetSamplingMode(1);
- sceCtrlReadBufferPositive(&pad, 1);
-
- uint32 buttonsChanged = pad.Buttons ^ _prevButtons;
-
- if ((buttonsChanged & PSP_CTRL_SELECT) || (pad.Buttons & PSP_CTRL_SELECT)) {
- if ( !(pad.Buttons & PSP_CTRL_SELECT) )
- _keyboardVisible = !_keyboardVisible;
- _prevButtons = pad.Buttons;
- return false;
- }
-
- if (!_keyboardVisible)
- return OSystem_PSP::pollEvent(event);
-
- if ( (buttonsChanged & PSP_CTRL_RTRIGGER) && !(pad.Buttons & PSP_CTRL_RTRIGGER))
- _keyboardMode ^= CAPS_LOCK;
-
- if ( (buttonsChanged & PSP_CTRL_LTRIGGER) && !(pad.Buttons & PSP_CTRL_LTRIGGER))
- _keyboardMode ^= SYMBOLS;
-
- if ( (buttonsChanged & PSP_CTRL_LEFT) && !(pad.Buttons & PSP_CTRL_LEFT)) {
- event.kbd.flags = 0;
- event.kbd.ascii = 0;
- event.kbd.keycode = Common::KEYCODE_LEFT;
- _prevButtons = pad.Buttons;
- return true;
- }
-
- if ( (buttonsChanged & PSP_CTRL_RIGHT) && !(pad.Buttons & PSP_CTRL_RIGHT)) {
- event.kbd.flags = 0;
- event.kbd.ascii = 0;
- event.kbd.keycode = Common::KEYCODE_RIGHT;
- _prevButtons = pad.Buttons;
- return true;
- }
-
- if ( (buttonsChanged & PSP_CTRL_UP) && !(pad.Buttons & PSP_CTRL_UP)) {
- event.kbd.flags = 0;
- event.kbd.ascii = 0;
- event.kbd.keycode = Common::KEYCODE_UP;
- _prevButtons = pad.Buttons;
- return true;
- }
-
- if ( (buttonsChanged & PSP_CTRL_DOWN) && !(pad.Buttons & PSP_CTRL_DOWN)) {
- event.kbd.flags = 0;
- event.kbd.ascii = 0;
- event.kbd.keycode = Common::KEYCODE_DOWN;
- _prevButtons = pad.Buttons;
- return true;
- }
-
- // compute nub direction
- x = pad.Lx-128;
- y = pad.Ly-128;
- _kbdClut[_keySelected] = 0xf888;
- if (x*x + y*y > 10000) {
- nub_angle = atan2(y, x);
- _keySelected = (int)(1 + (M_PI + nub_angle) * 30 / (2 * M_PI));
- _keySelected -= 2;
- if (_keySelected < 1)
- _keySelected += 30;
- _kbdClut[_keySelected] = 0xffff;
-
- if (buttonsChanged & PSP_CTRL_CROSS) {
- event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
- if (_keySelected > 26) {
- event.kbd.flags = 0;
- switch(_keySelected) {
- case 27:
- event.kbd.ascii = ' ';
- event.kbd.keycode = Common::KEYCODE_SPACE;
- break;
- case 28:
- event.kbd.ascii = 127;
- event.kbd.keycode = Common::KEYCODE_DELETE;
- break;
- case 29:
- event.kbd.ascii = 8;
- event.kbd.keycode = Common::KEYCODE_BACKSPACE;
- break;
- case 30:
- event.kbd.ascii = 13;
- event.kbd.keycode = Common::KEYCODE_RETURN;
- break;
- }
- } else {
- switch( _keyboardMode) {
- case 0:
- event.kbd.flags = 0;
- event.kbd.ascii = 'a'+_keySelected-1;
- event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1);
- break;
- case CAPS_LOCK:
- event.kbd.ascii = 'A'+_keySelected-1;
- event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1);
- event.kbd.flags = Common::KBD_SHIFT;
- break;
- case SYMBOLS:
- if (_keySelected < 21) {
- event.kbd.flags = 0;
- event.kbd.ascii = kbd_ascii[_keySelected-1];
- event.kbd.keycode = kbd_code[ _keySelected-1];
- }
- break;
- case (SYMBOLS|CAPS_LOCK):
- if (_keySelected < 21) {
- event.kbd.flags = 0;
- event.kbd.ascii = kbd_ascii_cl[_keySelected-1];
- event.kbd.keycode = kbd_code_cl[ _keySelected-1];
- }
- break;
- }
- }
- _prevButtons = pad.Buttons;
- return true;
- }
- }
-
- _prevButtons = pad.Buttons;
- return false;
-}
-
diff --git a/backends/platform/psp/osys_psp_gu.h b/backends/platform/psp/osys_psp_gu.h
deleted file mode 100644
index 106b73b308..0000000000
--- a/backends/platform/psp/osys_psp_gu.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- *
- */
-
-#include
-#include "common/scummsys.h"
-
-#include "common/rect.h"
-#include "osys_psp.h"
-
-class OSystem_PSP_GU : public OSystem_PSP
-{
-public:
- struct Vertex
- {
- float u,v;
- float x,y,z;
- };
-
- OSystem_PSP_GU();
- ~OSystem_PSP_GU();
- void updateScreen();
- void initSize(uint width, uint height, const Graphics::PixelFormat *format);
- int getDefaultGraphicsMode() const;
- bool setGraphicsMode(int mode);
- bool setGraphicsMode(const char *name);
- int getGraphicsMode() const;
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
- void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) ;
- void setPalette(const byte *colors, uint start, uint num);
- void setCursorPalette(const byte *colors, uint start, uint num);
- void disableCursorPalette(bool disable);
- bool pollEvent(Common::Event &event);
- int _graphicMode;
- struct Vertex *_vertices;
- unsigned short* _clut;
- unsigned short* _kbdClut;
- bool _keyboardVisible;
- int _keySelected;
- int _keyboardMode;
-};
-
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp
index 357c502dbc..74363e4ac9 100644
--- a/backends/platform/psp/psp_main.cpp
+++ b/backends/platform/psp/psp_main.cpp
@@ -40,7 +40,7 @@
#include "backends/platform/psp/powerman.h"
-#include "osys_psp_gu.h"
+#include "osys_psp.h"
#include "./trace.h"
@@ -151,7 +151,7 @@ int main(void) {
static const char *argv[] = { "scummvm", NULL };
static int argc = sizeof(argv)/sizeof(char *)-1;
- g_system = new OSystem_PSP_GU();
+ g_system = new OSystem_PSP();
assert(g_system);
int res = scummvm_main(argc, argv);
--
cgit v1.2.3
From 71b9b5f497342000b5094f32905a8bb9b5c52bfd Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Fri, 21 Aug 2009 22:31:50 +0000
Subject: Oops. Bitdepth is 1 or 2, not 8 or 16. Could be better named perhaps?
(bytedepth maybe?)
svn-id: r43616
---
engines/scumm/gfxARM.s | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s
index adcd4bfac5..caefa7175a 100644
--- a/engines/scumm/gfxARM.s
+++ b/engines/scumm/gfxARM.s
@@ -129,7 +129,7 @@ asmCopy8Col:
@ <> = bitdepth
LDR r12,[r13]
STR r14,[r13,#-4]!
- CMP r12,#8
+ CMP r12,#1
BNE copy8Col16
SUB r1,r1,#4
--
cgit v1.2.3
From 6166c85b062f5eb365b35780c38fe6bcc91020ff Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Fri, 21 Aug 2009 22:42:51 +0000
Subject: Improved comments.
svn-id: r43617
---
engines/scumm/gfxARM.s | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s
index caefa7175a..24f627647a 100644
--- a/engines/scumm/gfxARM.s
+++ b/engines/scumm/gfxARM.s
@@ -116,7 +116,8 @@ end:
@ extern "C" void asmCopy8Col(byte *dst,
@ int dstPitch,
@ const byte *src,
- @ int height);
+ @ int height,
+ @ int bitdepth);
@
@ In addition, we assume that src and dst are both word (4 byte)
@ aligned. This is the same assumption that the old 'inline' version
@@ -126,7 +127,7 @@ asmCopy8Col:
@ r1 = dstPitch
@ r2 = src
@ r3 = height
- @ <> = bitdepth
+ @ <> = bitdepth (badly named, should be bytedepth, 1 or 2)
LDR r12,[r13]
STR r14,[r13,#-4]!
CMP r12,#1
--
cgit v1.2.3
From 978d9dfd10c8290a6123bd96dba84a5563c0f9c2 Mon Sep 17 00:00:00 2001
From: Joost Peters
Date: Fri, 21 Aug 2009 22:44:49 +0000
Subject: some cleanup
svn-id: r43618
---
backends/platform/psp/osys_psp.cpp | 58 ++++++++++++++++++--------------------
backends/platform/psp/osys_psp.h | 8 ++++--
2 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index a9e9aeb7d8..023ec0cc82 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -31,7 +31,6 @@
#include "common/config-manager.h"
#include "common/events.h"
-#include "common/rect.h"
#include "common/scummsys.h"
#include "osys_psp.h"
@@ -40,14 +39,11 @@
#include "backends/saves/psp/psp-saves.h"
#include "backends/timer/default/default-timer.h"
#include "graphics/surface.h"
-#include "graphics/scaler.h"
#include "sound/mixer_intern.h"
#define SAMPLES_PER_SEC 44100
-#define SCREEN_WIDTH 480
-#define SCREEN_HEIGHT 272
#define PIXEL_SIZE (4)
#define BUF_WIDTH (512)
@@ -68,8 +64,6 @@ unsigned short __attribute__((aligned(16))) kbClut[256];
//unsigned int __attribute__((aligned(16))) overlayBuffer256[640*480*2];
unsigned int __attribute__((aligned(16))) mouseBuf256[MOUSE_SIZE*MOUSE_SIZE];
-extern unsigned long RGBToColour(unsigned long r, unsigned long g, unsigned long b);
-
extern unsigned int size_keyboard_symbols_compressed;
extern unsigned char keyboard_symbols_compressed[];
extern unsigned int size_keyboard_symbols_shift_compressed;
@@ -126,28 +120,6 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0)
SDL_Init(sdlFlags);
- //sceKernelDcacheWritebackAll();
-
- // setup
- sceGuInit();
- sceGuStart(0, displayList);
- sceGuDrawBuffer(GU_PSM_8888, (void *)0, BUF_WIDTH);
- sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)PSP_FRAME_SIZE, BUF_WIDTH);
- sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * 2), BUF_WIDTH);
- sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
- sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
- sceGuDepthRange(0xC350, 0x2710);
- sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
- sceGuEnable(GU_SCISSOR_TEST);
- sceGuFrontFace(GU_CW);
- sceGuEnable(GU_TEXTURE_2D);
- sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
- sceGuFinish();
- sceGuSync(0,0);
-
- sceDisplayWaitVblankStart();
- sceGuDisplay(1);
-
//decompress keyboard data
uLongf kbdSize = KBD_DATA_SIZE;
keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE);
@@ -178,6 +150,30 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0)
_keyboardMode = 0;
_mouseX = PSP_SCREEN_WIDTH >> 1;
_mouseY = PSP_SCREEN_HEIGHT >> 1;
+
+
+ //sceKernelDcacheWritebackAll();
+
+ // setup
+ sceGuInit();
+ sceGuStart(0, displayList);
+ sceGuDrawBuffer(GU_PSM_8888, (void *)0, BUF_WIDTH);
+ sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)PSP_FRAME_SIZE, BUF_WIDTH);
+ sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * 2), BUF_WIDTH);
+ sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
+ sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
+ sceGuDepthRange(0xC350, 0x2710);
+ sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
+ sceGuEnable(GU_SCISSOR_TEST);
+ sceGuFrontFace(GU_CW);
+ sceGuEnable(GU_TEXTURE_2D);
+ sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
+ sceGuFinish();
+ sceGuSync(0,0);
+
+ sceDisplayWaitVblankStart();
+ sceGuDisplay(1);
+
}
OSystem_PSP::~OSystem_PSP() {
@@ -270,8 +266,10 @@ void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat
_kbdClut[0] = 0xFFFF;
_kbdClut[246] = 0x4CCC;
_kbdClut[247] = 0x0000;
+
for (int i = 1; i < 31; i++)
_kbdClut[i] = 0xF888;
+
_mouseVisible = false;
sceKernelDcacheWritebackAll();
}
@@ -293,10 +291,10 @@ void OSystem_PSP::setPalette(const byte *colors, uint start, uint num) {
}
//copy to CLUT
- memcpy(_clut, _palette, 256*sizeof(unsigned short));
+ memcpy(_clut, _palette, 256 * sizeof(unsigned short));
//force update of mouse CLUT as well, as it may have been set up before this palette was set
- memcpy(mouseClut, _palette, 256*sizeof(unsigned short));
+ memcpy(mouseClut, _palette, 256 * sizeof(unsigned short));
mouseClut[_mouseKeyColour] = 0;
sceKernelDcacheWritebackAll();
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 353561cced..047fbff97e 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -96,7 +96,6 @@ protected:
Common::TimerManager *_timer;
public:
-
OSystem_PSP();
virtual ~OSystem_PSP();
@@ -105,15 +104,19 @@ public:
virtual bool hasFeature(Feature f);
virtual void setFeatureState(Feature f, bool enable);
virtual bool getFeatureState(Feature f);
+
virtual const GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
bool setGraphicsMode(const char *name);
virtual int getGraphicsMode() const;
+
virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
virtual int16 getWidth();
virtual int16 getHeight();
+
virtual void setPalette(const byte *colors, uint start, uint num);
+ virtual void grabPalette(byte *colors, uint start, uint num);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void disableCursorPalette(bool disable);
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
@@ -129,16 +132,15 @@ public:
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
virtual int16 getOverlayHeight();
virtual int16 getOverlayWidth();
- virtual void grabPalette(byte *colors, uint start, uint num);
virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<4444>(); }
virtual bool showMouse(bool visible);
-
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
virtual bool processInput(Common::Event &event);
+
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
--
cgit v1.2.3
From f9fe1cbbcc58b74ce34bf487648acb71b8fd34ab Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Fri, 21 Aug 2009 22:48:54 +0000
Subject: Improved comments.
svn-id: r43619
---
engines/scumm/he/sound_he.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index feaf273b4e..477f3cf0ad 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -645,6 +645,10 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
Audio::AudioStream *voxStream = Audio::makeADPCMStream(&stream, false, size, Audio::kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
sound = (char *)malloc(size * 4);
+ /* On systems where it matters, malloc will return
+ * even addresses, so the use of (void *) in the
+ * following cast shuts the compiler from warning
+ * unnecessarily. */
size = voxStream->readBuffer((int16*)(void *)sound, size * 2);
size *= 2; // 16bits.
delete voxStream;
--
cgit v1.2.3
From a790e4953cb4f6e2a4ec95311eb292e7aaec62b4 Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Fri, 21 Aug 2009 22:55:19 +0000
Subject: Updated comments.
svn-id: r43620
---
engines/scumm/gfx.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index c6e2cd3312..ba49131ac5 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -784,6 +784,8 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid
}
void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) {
+ /* dst and dstPitch should both be even. So the use of (void *) in
+ * the following casts to avoid the unnecessary warning is valid. */
uint16 *dstL1 = (uint16 *)(void *)dst;
uint16 *dstL2 = (uint16 *)(void *)(dst + dstPitch);
--
cgit v1.2.3
From 68fed4c62aae3becba7e723a28850004d8704094 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Fri, 21 Aug 2009 22:56:09 +0000
Subject: type fix
svn-id: r43621
---
engines/scumm/gfx.cpp | 2 +-
engines/scumm/gfxARM.s | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index ba49131ac5..fd298c2980 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -38,7 +38,7 @@
#ifdef USE_ARM_GFX_ASM
extern "C" void asmDrawStripToScreen(int height, int width, void const* text, void const* src, byte* dst,
int vsPitch, int vmScreenWidth, int textSurfacePitch);
-extern "C" void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height, uint8_t bitDepth);
+extern "C" void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height, uint8 bitDepth);
#endif /* USE_ARM_GFX_ASM */
namespace Scumm {
diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s
index 24f627647a..e78487d777 100644
--- a/engines/scumm/gfxARM.s
+++ b/engines/scumm/gfxARM.s
@@ -117,7 +117,7 @@ end:
@ int dstPitch,
@ const byte *src,
@ int height,
- @ int bitdepth);
+ @ uint8 bitdepth);
@
@ In addition, we assume that src and dst are both word (4 byte)
@ aligned. This is the same assumption that the old 'inline' version
--
cgit v1.2.3
From 70ccc47accf0563ca793f9d0d03fa6908afbfd99 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Fri, 21 Aug 2009 23:04:06 +0000
Subject: Removed redundant checks, the asserts() earlier do exactly the same.
svn-id: r43622
---
backends/platform/sdl/graphics.cpp | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index d3a37f4de7..a67e35cf73 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -975,30 +975,6 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
* and just updates those, on the actual display. */
addDirtyRgnAuto(src);
} else {
- /* Clip the coordinates */
- if (x < 0) {
- w += x;
- src -= x;
- x = 0;
- }
-
- if (y < 0) {
- h += y;
- src -= y * pitch;
- y = 0;
- }
-
- if (w > _videoMode.screenWidth - x) {
- w = _videoMode.screenWidth - x;
- }
-
- if (h > _videoMode.screenHeight - y) {
- h = _videoMode.screenHeight - y;
- }
-
- if (w <= 0 || h <= 0)
- return;
-
_cksumValid = false;
addDirtyRect(x, y, w, h);
}
--
cgit v1.2.3
From fd88dbacd7d5456a242accd2a31e46d9d8af0dc3 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Sat, 22 Aug 2009 00:18:22 +0000
Subject: Properly uninitialize timer used in AgiEngine.
svn-id: r43623
---
engines/agi/agi.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 69b27e10f9..746636d031 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -652,6 +652,8 @@ void AgiEngine::initialize() {
}
AgiEngine::~AgiEngine() {
+ _timer->removeTimerProc(agiTimerFunctionLow);
+
// If the engine hasn't been initialized yet via AgiEngine::initialize(), don't attempt to free any resources,
// as they haven't been allocated. Fixes bug #1742432 - AGI: Engine crashes if no game is detected
if (_game.state == STATE_INIT) {
--
cgit v1.2.3
From 7cb03ffa3e8cbf47631afe42e01a1a577afc22ef Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 00:27:01 +0000
Subject: Exclude 16bit specific code, when 16bit support is disabled.
svn-id: r43625
---
engines/scumm/he/wiz_he.cpp | 58 ++++++++++++++++++++++++++++++---------------
engines/scumm/he/wiz_he.h | 6 +++++
2 files changed, 45 insertions(+), 19 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index b00294cb96..91ce9182cd 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -369,6 +369,7 @@ void Wiz::writeColor(uint8 *dstPtr, int dstType, uint16 color) {
}
}
+#ifdef USE_RGB_COLOR
void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *xmapPtr) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
@@ -388,6 +389,7 @@ void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstT
}
}
}
+#endif
void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
Common::Rect r1, r2;
@@ -445,6 +447,7 @@ static void decodeWizMask(uint8 *&dst, uint8 &mask, int w, int maskType) {
}
}
+#ifdef USE_RGB_COLOR
void Wiz::copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr) {
Common::Rect srcRect, dstRect;
if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
@@ -531,6 +534,7 @@ void Wiz::copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int
maskPtr = maskPtrNext;
}
}
+#endif
void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP) {
Common::Rect srcRect, dstRect;
@@ -621,7 +625,8 @@ void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int d
}
}
-void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitDepth) {
+#ifdef USE_RGB_COLOR
+void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
if (flags & kWIFFlipX) {
@@ -638,17 +643,23 @@ void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstTyp
}
int h = r1.height();
int w = r1.width();
- src += r1.top * srcw + r1.left;
- dst += r2.top * dstPitch + r2.left * bitDepth;
- if (palPtr) {
- decompressRawWizImage(dst, dstPitch, dstType, src, srcw, w, h, transColor, palPtr, bitDepth);
- } else {
- decompressRawWizImage(dst, dstPitch, dstType, src, srcw, w, h, transColor, NULL, bitDepth);
+ src += (r1.top * srcw + r1.left) * 2;
+ dst += r2.top * dstPitch + r2.left * 2;
+ while (h--) {
+ for (int i = 0; i < w; ++ i) {
+ uint16 col = READ_LE_UINT16(src + 2 * i);
+ if (transColor == -1 || transColor != col) {
+ writeColor(dst + i * 2, dstType, col);
+ }
+ }
+ src += srcw * 2;
+ dst += dstPitch;
}
}
}
+#endif
-void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor) {
+void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitDepth) {
Common::Rect r1, r2;
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
if (flags & kWIFFlipX) {
@@ -665,21 +676,17 @@ void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int d
}
int h = r1.height();
int w = r1.width();
- src += (r1.top * srcw + r1.left) * 2;
- dst += r2.top * dstPitch + r2.left * 2;
- while (h--) {
- for (int i = 0; i < w; ++ i) {
- uint16 col = READ_LE_UINT16(src + 2 * i);
- if (transColor == -1 || transColor != col) {
- writeColor(dst + i * 2, dstType, col);
- }
- }
- src += srcw * 2;
- dst += dstPitch;
+ src += r1.top * srcw + r1.left;
+ dst += r2.top * dstPitch + r2.left * bitDepth;
+ if (palPtr) {
+ decompressRawWizImage(dst, dstPitch, dstType, src, srcw, w, h, transColor, palPtr, bitDepth);
+ } else {
+ decompressRawWizImage(dst, dstPitch, dstType, src, srcw, w, h, transColor, NULL, bitDepth);
}
}
}
+#ifdef USE_RGB_COLOR
template
void Wiz::write16BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, const uint8 *xmapPtr) {
uint16 col = READ_LE_UINT16(dataPtr);
@@ -795,6 +802,7 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const u
dstPtr = dstPtrNext;
}
}
+#endif
template
void Wiz::write8BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
@@ -1149,6 +1157,7 @@ void Wiz::computeRawWizHistogram(uint32 *histogram, const uint8 *data, int srcPi
}
}
+#ifdef USE_RGB_COLOR
static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common::Rect& rCapt) {
debug(9, "wizPackType2([%d,%d,%d,%d])", rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
int w = rCapt.width();
@@ -1165,6 +1174,7 @@ static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common
}
return size;
}
+#endif
static int wizPackType1(uint8 *dst, const uint8 *src, int srcPitch, const Common::Rect& rCapt, uint8 transColor) {
debug(9, "wizPackType1(%d, [%d,%d,%d,%d])", transColor, rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
@@ -1341,9 +1351,11 @@ void Wiz::captureImage(uint8 *src, int srcPitch, int srcw, int srch, int resNum,
case 1:
dataSize = wizPackType1(0, src, srcPitch, rCapt, transColor);
break;
+#ifdef USE_RGB_COLOR
case 2:
dataSize = wizPackType2(0, src, srcPitch, rCapt);
break;
+#endif
default:
error("unhandled compression type %d", compType);
break;
@@ -1387,9 +1399,11 @@ void Wiz::captureImage(uint8 *src, int srcPitch, int srcw, int srch, int resNum,
case 1:
wizPackType1(wizImg + headerSize, src, srcPitch, rCapt, transColor);
break;
+#ifdef USE_RGB_COLOR
case 2:
wizPackType2(wizImg + headerSize, src, srcPitch, rCapt);
break;
+#endif
default:
break;
}
@@ -1566,6 +1580,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int
copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bitDepth);
}
break;
+#ifdef USE_RGB_COLOR
case 2:
if (maskNum) {
copyMaskWizImage(dst, wizd, mask, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr);
@@ -1579,6 +1594,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int
case 5:
copy16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, xmapPtr);
break;
+#endif
default:
error("drawWizImage: Unhandled wiz compression type %d", comp);
}
@@ -2582,6 +2598,7 @@ int Wiz::isWizPixelNonTransparent(int resNum, int state, int x, int y, int flags
case 1:
ret = isWizPixelNonTransparent(wizd, x, y, w, h, 1);
break;
+#ifdef USE_RGB_COLOR
case 2:
ret = getRawWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR)) != _vm->VAR(_vm->VAR_WIZ_TCOLOR) ? 1 : 0;
break;
@@ -2593,6 +2610,7 @@ int Wiz::isWizPixelNonTransparent(int resNum, int state, int x, int y, int flags
case 5:
ret = isWizPixelNonTransparent(wizd, x, y, w, h, 2);
break;
+#endif
default:
error("isWizPixelNonTransparent: Unhandled wiz compression type %d", c);
break;
@@ -2623,6 +2641,7 @@ uint16 Wiz::getWizPixelColor(int resNum, int state, int x, int y) {
case 1:
color = getWizPixelColor(wizd, x, y, w, h, 1, _vm->VAR(_vm->VAR_WIZ_TCOLOR));
break;
+#ifdef USE_RGB_COLOR
case 2:
color = getRawWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR));
break;
@@ -2633,6 +2652,7 @@ uint16 Wiz::getWizPixelColor(int resNum, int state, int x, int y) {
case 5:
color = getWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR));
break;
+#endif
default:
error("getWizPixelColor: Unhandled wiz compression type %d", c);
break;
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index d8f984f710..a212ac4d29 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -209,19 +209,25 @@ public:
void drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int flags, int shadow, int dstResNum, int palette);
void drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstpitch, int dstType, int dstw, int dsth, int wizW, int wizH, Common::Rect &bound, Common::Point *wp, uint8 bitDepth);
+#ifdef USE_RGB_COLOR
static void copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr);
+#endif
static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, uint8 bitdepth);
static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP);
static void copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitdepth);
+#ifdef USE_RGB_COLOR
static void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *xmapPtr);
static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor);
template static void decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *xmapPtr = NULL);
+#endif
template static void decompressWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
template static void decompressRawWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr, uint8 bitdepth);
+#ifdef USE_RGB_COLOR
template static void write16BitColor(uint8 *dst, const uint8 *src, int dstType, const uint8 *xmapPtr);
+#endif
template static void write8BitColor(uint8 *dst, const uint8 *src, int dstType, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth);
static void writeColor(uint8 *dstPtr, int dstType, uint16 color);
--
cgit v1.2.3
From 34223f8a9f6594b3268303637d937f2a64c0bda5 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sat, 22 Aug 2009 00:27:13 +0000
Subject: Fixed crossBlit prototype
svn-id: r43626
---
graphics/conversion.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/graphics/conversion.h b/graphics/conversion.h
index b0314046b9..77763eb3d4 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -69,7 +69,7 @@ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
*
*/
bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
- int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt);
+ int w, int h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt);
} // end of namespace Graphics
--
cgit v1.2.3
From cb56c27b9a2f3a4b3f0fb487cbc62205855062ea Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Sat, 22 Aug 2009 00:41:22 +0000
Subject: Add FIXME about DefaultTimerManager implementation.
svn-id: r43627
---
backends/timer/default/default-timer.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp
index bd2222bbbc..dd468bbe09 100644
--- a/backends/timer/default/default-timer.cpp
+++ b/backends/timer/default/default-timer.cpp
@@ -124,6 +124,12 @@ bool DefaultTimerManager::installTimerProc(TimerProc callback, int32 interval, v
slot->nextFireTimeMicro = interval % 1000;
slot->next = 0;
+ // FIXME: It seems we do allow the client to add one callback multiple times over here,
+ // but "removeTimerProc" will remove *all* added instances. We should either prevent
+ // multiple additions of a timer proc OR we should change removeTimerProc to only remove
+ // a specific timer proc entry.
+ // Probably we can safely just allow a single addition of a specific function once
+ // and just update our Timer documentation accordingly.
insertPrioQueue(_head, slot);
return true;
--
cgit v1.2.3
From 3c9d22aa95d71ac88bb2a71dc87887d422f55277 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 01:53:25 +0000
Subject: Correct errors in load/save code for PC version of Waxworks.
svn-id: r43628
---
engines/agos/saveload.cpp | 46 ++++++++++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 16 deletions(-)
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index 8a54151f91..8470203640 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -1252,23 +1252,38 @@ bool AGOSEngine_Elvira2::loadGame(const char *filename, bool restartMode) {
if (_roomsListPtr) {
byte *p = _roomsListPtr;
- for (;;) {
- uint16 minNum = READ_BE_UINT16(p); p += 2;
- if (minNum == 0)
- break;
-
- uint16 maxNum = READ_BE_UINT16(p); p += 2;
+ if (room == _currentRoom) {
+ for (;;) {
+ uint16 minNum = READ_BE_UINT16(p); p += 2;
+ if (minNum == 0)
+ break;
+
+ uint16 maxNum = READ_BE_UINT16(p); p += 2;
+
+ for (uint16 z = minNum; z <= maxNum; z++) {
+ uint16 itemNum = z + 2;
+ Item *item = derefItem(itemNum);
+
+ num = (itemNum - _itemArrayInited);
+ _roomStates[num].state = item->state;
+ _roomStates[num].classFlags = item->classFlags;
+ SubRoom *subRoom = (SubRoom *)findChildOfType(item, kRoomType);
+ _roomStates[num].roomExitStates = subRoom->roomExitStates;
+ }
+ }
+ } else {
+ for (;;) {
+ uint16 minNum = READ_BE_UINT16(p); p += 2;
+ if (minNum == 0)
+ break;
- for (uint16 z = minNum; z <= maxNum; z++) {
- uint16 itemNum = z + 2;
- Item *item = derefItem(itemNum);
- item->parent = 0;
+ uint16 maxNum = READ_BE_UINT16(p); p += 2;
- num = (itemNum - _itemArrayInited);
- item->state = _roomStates[num].state;
- item->classFlags = _roomStates[num].classFlags;
- SubRoom *subRoom = (SubRoom *)findChildOfType(item, kRoomType);
- subRoom->roomExitStates = _roomStates[num].roomExitStates;
+ for (uint16 z = minNum; z <= maxNum; z++) {
+ uint16 itemNum = z + 2;
+ Item *item = derefItem(itemNum);
+ item->parent = 0;
+ }
}
}
}
@@ -1439,7 +1454,6 @@ bool AGOSEngine_Elvira2::saveGame(uint slot, const char *caption) {
for (uint16 z = minNum; z <= maxNum; z++) {
uint16 itemNum = z + 2;
Item *item = derefItem(itemNum);
- item->parent = 0;
uint16 num = (itemNum - _itemArrayInited);
_roomStates[num].state = item->state;
--
cgit v1.2.3
From 66d8adef9f875be8fc82e2fd305cbadc22ed02a6 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 07:18:15 +0000
Subject: Backyard Soccer MLS requires 16bit color support too.
svn-id: r43630
---
engines/scumm/detection_tables.h | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index c9af022af5..e81779bdd3 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -91,6 +91,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "pjgames", "Pajama Sam: Games to Play On Any Day" },
{ "readtime", "Blue's Reading Time Activities" },
{ "Soccer2004", "Backyard Soccer 2004" },
+ { "SoccerMLS", "Backyard Soccer MLS Edition" },
#endif
{ "airport", "Let's Explore the Airport with Buzzy" },
{ "balloon", "Putt-Putt and Pep's Balloon-O-Rama" },
@@ -123,7 +124,6 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "puttzoo", "Putt-Putt Saves the Zoo" },
{ "SamsFunShop", "Pajama Sam's One-Stop Fun Shop" },
{ "soccer", "Backyard Soccer" },
- { "SoccerMLS", "Backyard Soccer MLS Edition" },
{ "socks", "Pajama Sam's Sock Works" },
{ "spyfox", "SPY Fox 1: Dry Cereal" },
{ "spyfox2", "SPY Fox 2: Some Assembly Required" },
@@ -345,8 +345,14 @@ static const GameSettings gameVariantsTable[] = {
{"SamsFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI},
{"PuttsFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI},
+ // Added the use of smacker videos
+ {"BluesTreasureHunt", 0, 0, GID_TREASUREHUNT, 6, 99, MDT_NONE, GF_HE_LOCALIZED | GF_USE_KEY, UNK, GUIO_NOMIDI},
+
+#ifdef USE_RGB_COLOR
// Added 16bit color
+ {"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
{"baseball2001", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
+ {"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
{"SoccerMLS", 0, 0, GID_SOCCER, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
{"spyozon", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
@@ -357,12 +363,7 @@ static const GameSettings gameVariantsTable[] = {
// Restructured the Scumm engine
{"pjgames", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
- // Uses smacker in external files, for testing only
- {"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
- {"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
- {"BluesTreasureHunt", 0, 0, GID_TREASUREHUNT, 6, 99, MDT_NONE, GF_HE_LOCALIZED | GF_USE_KEY, UNK, GUIO_NOMIDI},
-
- // Uses bink in external files for logos
+ // Added the use of bink videos
{"Baseball2003", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
{"basketball", 0, 0, GID_BASKETBALL, 6, 100, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
{"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
@@ -371,6 +372,7 @@ static const GameSettings gameVariantsTable[] = {
// U32 code required, for testing only
{"moonbase", 0, 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI},
{"moonbase", "Demo", 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR | GF_DEMO, UNK, GUIO_NOMIDI},
+#endif
// The following are meant to be generic HE game variants and as such do
// not specify a game ID. Make sure that these are last in the table, else
@@ -549,6 +551,9 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "Soccer2004", "Soccer2004", kGenHEPC, UNK_LANG, UNK, 0 },
{ "Soccer2004", "Soccer 2004", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "SoccerMLS", "SoccerMLS", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "SoccerMLS", "Backyard Soccer MLS", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
{ "spyozon", "spyozon", kGenHEPC, UNK_LANG, UNK, 0 },
{ "spyozon", "sf3-demo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "spyozon", "SF3Demo", kGenHEPC, Common::FR_FRA, UNK, 0 },
@@ -817,9 +822,6 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "soccer", "soccer", kGenHEPC, UNK_LANG, UNK, 0 },
{ "soccer", "Soccer", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "SoccerMLS", "SoccerMLS", kGenHEPC, UNK_LANG, UNK, 0 },
- { "SoccerMLS", "Backyard Soccer MLS", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
-
{ "socks", "socks", kGenHEPC, UNK_LANG, UNK, 0 },
{ "socks", "SockWorks", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "socks", "SokkenSoep", kGenHEPC, Common::NL_NLD, UNK, 0 },
--
cgit v1.2.3
From 5b2a1a766212d44ef4bc7329bd2e59f9f7f0b5ce Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sat, 22 Aug 2009 08:49:23 +0000
Subject: 16bit support for the Wii port
svn-id: r43631
---
backends/platform/wii/osystem.cpp | 5 +
backends/platform/wii/osystem.h | 11 +-
backends/platform/wii/osystem_gfx.cpp | 211 ++++++++++++++++++++++++++--------
configure | 2 +-
4 files changed, 178 insertions(+), 51 deletions(-)
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index ae1eb11f4f..3f53605e85 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -52,6 +52,11 @@ OSystem_Wii::OSystem_Wii() :
_currentHeight(0),
_activeGraphicsMode(0),
+#ifdef USE_RGB_COLOR
+ _texturePF(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)),
+ _screenPF(Graphics::PixelFormat::createFormatCLUT8()),
+ _cursorPF(Graphics::PixelFormat::createFormatCLUT8()),
+#endif
_fullscreen(false),
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 2eb53f26a3..72263af5a8 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -75,6 +75,11 @@ private:
u16 _currentWidth, _currentHeight;
s32 _activeGraphicsMode;
+#ifdef USE_RGB_COLOR
+ const Graphics::PixelFormat _texturePF;
+ Graphics::PixelFormat _screenPF;
+ Graphics::PixelFormat _cursorPF;
+#endif
bool _fullscreen;
@@ -82,7 +87,7 @@ private:
s32 _mouseX, _mouseY;
u32 _mouseWidth, _mouseHeight;
s32 _mouseHotspotX, _mouseHotspotY;
- u8 _mouseKeyColor;
+ u16 _mouseKeyColor;
u8 *_mouseCursor;
bool _kbd_active;
@@ -119,6 +124,10 @@ public:
virtual const GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
+#ifdef USE_RGB_COLOR
+ virtual Graphics::PixelFormat getScreenFormat() const;
+ virtual Common::List getSupportedFormats();
+#endif
virtual int getGraphicsMode() const;
virtual void initSize(uint width, uint height,
const Graphics::PixelFormat *format);
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 9c875eaa85..ed10a407dd 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -21,6 +21,8 @@
#include
+#include "graphics/conversion.h"
+
#include "osystem.h"
#include "gx_supp.h"
@@ -143,22 +145,72 @@ int OSystem_Wii::getGraphicsMode() const {
return _activeGraphicsMode;
}
+#ifdef USE_RGB_COLOR
+Graphics::PixelFormat OSystem_Wii::getScreenFormat() const {
+ return _screenPF;
+}
+
+Common::List OSystem_Wii::getSupportedFormats() {
+ Common::List res;
+ res.push_back(_texturePF);
+ res.push_back(Graphics::PixelFormat::createFormatCLUT8());
+
+ return res;
+}
+#endif
+
void OSystem_Wii::initSize(uint width, uint height,
const Graphics::PixelFormat *format) {
- if (_gameWidth != width || _gameHeight != height) {
- printf("initSize %u %u\n", width, height);
+ bool update = false;
+
+#ifdef USE_RGB_COLOR
+ Graphics::PixelFormat newFormat;
+ if (format)
+ newFormat = *format;
+ else
+ newFormat = Graphics::PixelFormat::createFormatCLUT8();
+ if (newFormat.bytesPerPixel > 2)
+ newFormat = Graphics::PixelFormat::createFormatCLUT8();
+
+ if (_screenPF != newFormat) {
+ _screenPF = newFormat;
+ update = true;
+ }
+#endif
+
+ if (_gameWidth != width || _gameHeight != height) {
assert((width <= 640) && (height <= 480));
_gameWidth = width;
_gameHeight = height;
+ update = true;
+ }
+
+ if (update) {
+#ifdef USE_RGB_COLOR
+ printf("initSize %u*%u*%u (%u,%u,%u)\n",
+ _gameWidth, _gameHeight,
+ _screenPF.bytesPerPixel * 8,
+ _screenPF.rShift, _screenPF.gShift, _screenPF.bShift);
+#else
+ printf("initSize %u*%u\n", _gameWidth, _gameHeight);
+#endif
if(_gamePixels)
free(_gamePixels);
+ size_t bufsize;
+
+#ifdef USE_RGB_COLOR
+ _gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight *
+ _screenPF.bytesPerPixel);
+ memset(_gamePixels, 0, _gameWidth * _gameHeight *
+ _screenPF.bytesPerPixel);
+#else
_gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight);
memset(_gamePixels, 0, _gameWidth * _gameHeight);
-
+#endif
if (!_overlayVisible) {
_currentWidth = _gameWidth;
_currentHeight = _gameHeight;
@@ -178,6 +230,10 @@ int16 OSystem_Wii::getHeight() {
}
void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
+#ifdef USE_RGB_COLOR
+ assert(_screenPF.bytesPerPixel == 1);
+#endif
+
const byte *p = colors;
for (uint i = 0; i < num; ++i) {
_palette[start + i] = Graphics::RGBToColor >(p[0], p[1], p[2]);
@@ -214,37 +270,36 @@ void OSystem_Wii::disableCursorPalette(bool disable) {
void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
int w, int h) {
- if (x < 0) {
- w += x;
- buf -= x;
- x = 0;
- }
-
- if (y < 0) {
- h += y;
- buf -= y * pitch;
- y = 0;
- }
-
- if (w > _gameWidth - x)
- w = _gameWidth - x;
-
- if (h > _gameHeight - y)
- h = _gameHeight - y;
-
- if (w <= 0 || h <= 0)
- return;
-
- byte *dst = _gamePixels + y * _gameWidth + x;
- if (_gameWidth == pitch && pitch == w) {
- memcpy(dst, buf, h * w);
+ assert(x >= 0 && x < _gameWidth);
+ assert(y >= 0 && y < _gameHeight);
+ assert(w > 0 && x + w <= _gameWidth);
+ assert(h > 0 && y + h <= _gameHeight);
+
+#ifdef USE_RGB_COLOR
+ if (_screenPF.bytesPerPixel > 1) {
+ if (!Graphics::crossBlit(_gamePixels +
+ y * _gameWidth * _screenPF.bytesPerPixel +
+ x * _screenPF.bytesPerPixel,
+ buf, _gameWidth * _screenPF.bytesPerPixel,
+ pitch, w, h, _texturePF, _screenPF)) {
+ printf("crossBlit failed\n");
+ ::abort();
+ }
} else {
- do {
- memcpy(dst, buf, w);
- buf += pitch;
- dst += _gameWidth;
- } while (--h);
+#endif
+ byte *dst = _gamePixels + y * _gameWidth + x;
+ if (_gameWidth == pitch && pitch == w) {
+ memcpy(dst, buf, h * w);
+ } else {
+ do {
+ memcpy(dst, buf, w);
+ buf += pitch;
+ dst += _gameWidth;
+ } while (--h);
+ }
+#ifdef USE_RGB_COLOR
}
+#endif
}
void OSystem_Wii::updateScreen() {
@@ -252,6 +307,9 @@ void OSystem_Wii::updateScreen() {
static s16 msx, msy, mox, moy, mskip;
static u16 mpx, mpy;
static u8 *s;
+#ifdef USE_RGB_COLOR
+ static u16 *s2;
+#endif
static u16 *d, *p;
u32 now = getMillis();
@@ -268,12 +326,21 @@ void OSystem_Wii::updateScreen() {
if (_overlayVisible) {
memcpy(_texture, _overlayPixels, _overlaySize);
} else {
- for (y = 0; y < _gameHeight; ++y) {
- for (x = 0; x < _gameWidth; ++x)
- _texture[h + x] = _palette[_gamePixels[h + x]];
+#ifdef USE_RGB_COLOR
+ if (_screenPF.bytesPerPixel > 1) {
+ memcpy(_texture, _gamePixels,
+ _gameWidth * _gameHeight * _screenPF.bytesPerPixel);
+ } else {
+#endif
+ for (y = 0; y < _gameHeight; ++y) {
+ for (x = 0; x < _gameWidth; ++x)
+ _texture[h + x] = _palette[_gamePixels[h + x]];
- h += _gameWidth;
+ h += _gameWidth;
+ }
+#ifdef USE_RGB_COLOR
}
+#endif
}
if (_mouseVisible) {
@@ -309,25 +376,51 @@ void OSystem_Wii::updateScreen() {
skip = _currentWidth - mpx;
mskip = _mouseWidth - mpx;
- s = _mouseCursor + moy * _mouseWidth + mox;
- d = _texture + (msy * _currentWidth + msx);
+#ifdef USE_RGB_COLOR
+ if (_cursorPF.bytesPerPixel > 1) {
+ s2 = (u16 *) _mouseCursor + moy * _mouseWidth + mox;
+ d = _texture + (msy * _currentWidth + msx);
- for (y = 0; y < mpy; ++y) {
- for (x = 0; x < mpx; ++x) {
- if (*s == _mouseKeyColor) {
- s++;
- d++;
+ for (y = 0; y < mpy; ++y) {
+ for (x = 0; x < mpx; ++x) {
+ if (*s2 == _mouseKeyColor) {
+ s2++;
+ d++;
- continue;
+ continue;
+ }
+
+ *d++ = *s2;
+ s2++;
}
- *d++ = p[*s];
- s++;
+ d += skip;
+ s2 += mskip;
}
+ } else {
+#endif
+ s = _mouseCursor + moy * _mouseWidth + mox;
+ d = _texture + (msy * _currentWidth + msx);
+
+ for (y = 0; y < mpy; ++y) {
+ for (x = 0; x < mpx; ++x) {
+ if (*s == _mouseKeyColor) {
+ s++;
+ d++;
+
+ continue;
+ }
+
+ *d++ = p[*s];
+ s++;
+ }
- d += skip;
- s += mskip;
+ d += skip;
+ s += mskip;
+ }
+#ifdef USE_RGB_COLOR
}
+#endif
}
GX_Render(_currentWidth, _currentHeight, (u8 *) _texture,
@@ -339,7 +432,11 @@ Graphics::Surface *OSystem_Wii::lockScreen() {
_surface.w = _gameWidth;
_surface.h = _gameHeight;
_surface.pitch = _gameWidth;
+#ifdef USE_RGB_COLOR
+ _surface.bytesPerPixel = _screenPF.bytesPerPixel;
+#else
_surface.bytesPerPixel = 1;
+#endif
return &_surface;
}
@@ -452,16 +549,32 @@ void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
const Graphics::PixelFormat *format) {
(void) cursorTargetScale; // TODO
+#ifdef USE_RGB_COLOR
+ if (!format)
+ _cursorPF = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ _cursorPF = *format;
+
+ if (_cursorPF.bytesPerPixel > 1)
+ _mouseKeyColor = keycolor & 0xffff;
+ else
+#endif
+ _mouseKeyColor = keycolor & 0xff;
+
_mouseWidth = w;
_mouseHeight = h;
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _mouseKeyColor = keycolor & 0xff;
if (_mouseCursor)
free(_mouseCursor);
+#ifdef USE_RGB_COLOR
+ _mouseCursor = (u8 *) memalign(32, w * h * _cursorPF.bytesPerPixel);
+ memcpy(_mouseCursor, buf, w * h * _cursorPF.bytesPerPixel);
+#else
_mouseCursor = (u8 *) memalign(32, w * h);
memcpy(_mouseCursor, buf, w * h);
+#endif
}
diff --git a/configure b/configure
index 5b5c62bfb9..09a214ca59 100755
--- a/configure
+++ b/configure
@@ -1498,7 +1498,7 @@ fi
# Enable 16bit support only for backends which support it
#
case $_backend in
- sdl)
+ sdl | wii)
if test "$_16bit" = auto ; then
_16bit=yes
else
--
cgit v1.2.3
From 6c6ae69f3dab59fc8be948463367c615f9acd7e2 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sat, 22 Aug 2009 09:22:23 +0000
Subject: Fixed cursor transparency for 16bit HE games on big endian
architectures
svn-id: r43632
---
engines/scumm/he/wiz_he.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 91ce9182cd..5280dc097f 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1504,7 +1504,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int
uint8 *tmpPtr = dst;
for (uint i = 0; i < height; i++) {
for (uint j = 0; j < width; j++)
- WRITE_LE_UINT16(tmpPtr + j * 2, transColor);
+ WRITE_UINT16(tmpPtr + j * 2, transColor);
tmpPtr += width * 2;
}
} else {
@@ -1750,7 +1750,7 @@ void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int
uint8 *tmpPtr = imageBuffer;
for (i = 0; i < dsth; i++) {
for (j = 0; j < dstw; j++)
- WRITE_LE_UINT16(tmpPtr + j * 2, transColor);
+ WRITE_UINT16(tmpPtr + j * 2, transColor);
tmpPtr += dstpitch;
}
} else {
@@ -1967,7 +1967,7 @@ void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, i
y_acc += pra->y_step;
if (bitDepth == 2) {
if (transColor == -1 || transColor != READ_LE_UINT16(src + src_offs * 2)) {
- //if (transColor == -1 || READ_LE_UINT16(dstPtr) != transColor)
+ //if (transColor == -1 || READ_UINT16(dstPtr) != transColor)
writeColor(dstPtr, dstType, READ_LE_UINT16(src + src_offs * 2));
}
} else {
--
cgit v1.2.3
From bed502a7c70c122a097d8f9ad7ca2330e69bdccb Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 09:39:55 +0000
Subject: Fix endian issue in copyFrameToBuffer().
svn-id: r43633
---
engines/scumm/he/animation_he.cpp | 21 +++++++++++++++------
engines/scumm/he/animation_he.h | 2 +-
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 47b25c57d1..cf071fc4aa 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -66,7 +66,7 @@ int MoviePlayer::load(const char *filename, int flags, int image) {
return 0;
}
-void MoviePlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
+void MoviePlayer::copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint pitch) {
uint h = getHeight();
uint w = getWidth();
@@ -76,8 +76,17 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
dst += y * pitch + x * 2;
do {
for (uint i = 0; i < w; i++) {
- uint16 col = READ_LE_UINT16(_vm->_hePalettes + _vm->_hePaletteSlot + 768 + src[i] * 2);
- WRITE_UINT16(dst + i * 2, col);
+ uint16 color = READ_LE_UINT16(_vm->_hePalettes + _vm->_hePaletteSlot + 768 + src[i] * 2);
+ switch (dstType) {
+ case kDstScreen:
+ WRITE_UINT16(dst + i * 2, color);
+ break;
+ case kDstResource:
+ WRITE_LE_UINT16(dst + i * 2, color);
+ break;
+ default:
+ error("copyFrameToBuffer: Unknown dstType %d", dstType);
+ }
}
dst += pitch;
src += w;
@@ -106,14 +115,14 @@ void MoviePlayer::handleNextFrame() {
assert(dstPtr);
uint8 *dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
assert(dst);
- copyFrameToBuffer(dst, 0, 0, _vm->_screenWidth * _vm->_bitDepth);
+ copyFrameToBuffer(dst, kDstResource, 0, 0, _vm->_screenWidth * _vm->_bitDepth);
} else if (_flags & 1) {
- copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, pvs->pitch);
+ copyFrameToBuffer(pvs->getBackPixels(0, 0), kDstScreen, 0, 0, pvs->pitch);
Common::Rect imageRect(getWidth(), getHeight());
_vm->restoreBackgroundHE(imageRect);
} else {
- copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, pvs->pitch);
+ copyFrameToBuffer(pvs->getPixels(0, 0), kDstScreen, 0, 0, pvs->pitch);
Common::Rect imageRect(getWidth(), getHeight());
_vm->markRectAsDirty(kMainVirtScreen, imageRect);
diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h
index 0adba35d53..86ded31940 100644
--- a/engines/scumm/he/animation_he.h
+++ b/engines/scumm/he/animation_he.h
@@ -54,7 +54,7 @@ public:
int getImageNum();
int load(const char *filename, int flags, int image = 0);
- void copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch);
+ void copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint pitch);
void handleNextFrame();
protected:
--
cgit v1.2.3
From ea87405ae412c7c4275cc1966750b817e44e255a Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 11:03:00 +0000
Subject: Patch #2840212: "Quiet make process"
svn-id: r43635
---
Makefile.common | 37 ++++++++++++++++++++++++++-----------
configure | 8 ++++++++
rules.mk | 12 ++++++------
test/module.mk | 2 +-
tools/module.mk | 12 ++++++------
tools/skycpt/Makefile | 6 +++---
6 files changed, 50 insertions(+), 27 deletions(-)
diff --git a/Makefile.common b/Makefile.common
index caf5ba22fa..2b00605318 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -62,9 +62,24 @@ DEPFILES =
# the build date in gScummVMBuildDate is correct.
base/version.o: $(filter-out base/libbase.a,$(OBJS))
+# Replace regular output with quiet messages
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifneq ($(VERBOSE_BUILD),1)
+ifneq ($(VERBOSE_BUILD),yes)
+QUIET_CXX = @echo ' ' C++ ' ' $@;
+QUIET_NASM = @echo ' ' NASM ' ' $@;
+QUIET_AR = @echo ' ' AR ' ' $@;
+QUIET_RANLIB = @echo ' ' RANLIB ' ' $@;
+QUIET_PLUGIN = @echo ' ' PLUGIN ' ' $@;
+QUIET_LINK = @echo ' ' LINK ' ' $@;
+QUIET = @
+endif
+endif
+endif
+
# The build rule for the ScummVM executable
$(EXECUTABLE): $(OBJS)
- $(CXX) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
+ $(QUIET_LINK)$(CXX) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
distclean: clean
$(RM) config.h config.mk config.log
@@ -83,27 +98,27 @@ ifndef HAVE_GCC3
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
%.o: %.cpp
- $(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
- $(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
- $(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
- $(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+ $(QUIET)$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
+ $(QUIET)$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
+ $(QUIET)$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
else
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
# Also, with this GCC inserts additional dummy rules for the involved headers,
# which ensures a smooth compilation even if said headers become obsolete.
%.o: %.cpp
- $(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
%.o: %.m
- $(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
endif
ifdef HAVE_NASM
%.o: %.asm
- $(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
+ $(QUIET_NASM)$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
endif
# Include the dependency tracking files.
diff --git a/configure b/configure
index 09a214ca59..d7b43f05cc 100755
--- a/configure
+++ b/configure
@@ -125,6 +125,7 @@ _backend=sdl
_endian=unknown
_need_memalign=no
_have_x86=no
+_verbose_build=no
_dynamic_modules=no
_plugins_default=static
_nasm=auto
@@ -660,6 +661,7 @@ for ac_option in $@; do
--disable-fluidsynth) _fluidsynth=no ;;
--enable-readline) _readline=yes ;;
--disable-readline) _readline=no ;;
+ --enable-verbose-build) _verbose_build=yes ;;
--enable-plugins) _dynamic_modules=yes ;;
--default-dynamic) _plugins_default=dynamic ;;
--enable-mt32emu) _mt32emu=yes ;;
@@ -1532,6 +1534,12 @@ add_to_config_h_if_yes $_have_x86 '#define HAVE_X86'
add_to_config_h_if_yes $_need_memalign '#define SCUMM_NEED_ALIGNMENT'
+#
+# Check whether to enable a verbose build
+#
+echo_n "Checking whether to have a verbose build... "
+echo "$_verbose_build"
+add_to_config_mk_if_yes "$_verbose_build" 'VERBOSE_BUILD = 1'
#
# Check whether plugin support is requested and possible
diff --git a/rules.mk b/rules.mk
index f2365f8928..0687644e02 100644
--- a/rules.mk
+++ b/rules.mk
@@ -23,7 +23,7 @@ ifdef TOOL_EXECUTABLE
################################################
TOOL-$(MODULE) := $(MODULE)/$(TOOL_EXECUTABLE)$(EXEEXT)
$(TOOL-$(MODULE)): $(MODULE_OBJS-$(MODULE))
- $(CXX) $(LDFLAGS) $+ -o $@
+ $(QUIET_CXX)$(CXX) $(LDFLAGS) $+ -o $@
# Reset TOOL_EXECUTABLE var
TOOL_EXECUTABLE:=
@@ -42,8 +42,8 @@ ifdef PLUGIN
################################################
PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX)
$(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS)
- $(MKDIR) plugins
- $(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@
+ $(QUIET)$(MKDIR) plugins
+ $(QUIET_PLUGIN)$(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@
# Reset PLUGIN var
PLUGIN:=
@@ -69,9 +69,9 @@ OBJS += $(MODULE_LIB-$(MODULE))
# Convenience library target
$(MODULE_LIB-$(MODULE)): $(MODULE_OBJS-$(MODULE))
- -$(RM) $@
- $(AR) $@ $+
- $(RANLIB) $@
+ $(QUIET)-$(RM) $@
+ $(QUIET_AR)$(AR) $@ $+
+ $(QUIET_RANLIB)$(RANLIB) $@
# Pseudo target for comfort, allows for "make common", "make gui" etc.
$(MODULE): $(MODULE_LIB-$(MODULE))
diff --git a/test/module.mk b/test/module.mk
index 64cb34c7ac..79a1a12023 100644
--- a/test/module.mk
+++ b/test/module.mk
@@ -22,7 +22,7 @@ TEST_LDFLAGS :=
test: test/runner
./test/runner
test/runner: test/runner.cpp $(TEST_LIBS)
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TEST_LDFLAGS) $(TEST_CFLAGS) -o $@ $+
+ $(QUIET_LINK)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TEST_LDFLAGS) $(TEST_CFLAGS) -o $@ $+
test/runner.cpp: $(TESTS)
@mkdir -p test
$(srcdir)/test/cxxtest/cxxtestgen.py $(TEST_FLAGS) -o $@ $+
diff --git a/tools/module.mk b/tools/module.mk
index 9ad972f477..4c1ea57da6 100644
--- a/tools/module.mk
+++ b/tools/module.mk
@@ -33,16 +33,16 @@ clean-tools:
#
tools/convbdf$(EXEEXT): $(srcdir)/tools/convbdf.c
- $(MKDIR) tools/$(DEPDIR)
- $(CC) $(CFLAGS) -Wall -o $@ $<
+ $(QUIET)$(MKDIR) tools/$(DEPDIR)
+ $(QUIET_LINK)$(CC) $(CFLAGS) -Wall -o $@ $<
tools/md5table$(EXEEXT): $(srcdir)/tools/md5table.c
- $(MKDIR) tools/$(DEPDIR)
- $(CC) $(CFLAGS) -Wall -o $@ $<
+ $(QUIET)$(MKDIR) tools/$(DEPDIR)
+ $(QUIET_LINK)$(CC) $(CFLAGS) -Wall -o $@ $<
tools/make-scumm-fontdata$(EXEEXT): $(srcdir)/tools/make-scumm-fontdata.c
- $(MKDIR) tools/$(DEPDIR)
- $(CC) $(CFLAGS) -Wall -o $@ $<
+ $(QUIET)$(MKDIR) tools/$(DEPDIR)
+ $(QUIET_LINK)$(CC) $(CFLAGS) -Wall -o $@ $<
#
# Rules to explicitly rebuild the credits / MD5 tables.
diff --git a/tools/skycpt/Makefile b/tools/skycpt/Makefile
index bfa9937519..b907e6782d 100644
--- a/tools/skycpt/Makefile
+++ b/tools/skycpt/Makefile
@@ -9,10 +9,10 @@ OBJS=AsciiCptCompile.o cptcompiler.o cpthelp.o idFinder.o KmpSearch.o stdafx.o T
all: $(TARGET)
clean:
- rm -f $(TARGET) $(OBJS)
+ $(QUIET)$(RM) $(TARGET) $(OBJS)
$(TARGET): $(OBJS)
- $(CC) $(OBJS) $(LDFLAGS) -o $(TARGET)
+ $(QUIET_CXX)$(CXX) $(OBJS) $(LDFLAGS) -o $(TARGET)
%.o: %.cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
\ No newline at end of file
+ $(QUIET_CXX)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
--
cgit v1.2.3
From 70b7ebb33901d3dff5426c1c2fa12bc5087b721a Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 12:35:49 +0000
Subject: Patch #2826508: "Motorola A1200/E6/A1600 (motoezx) patch"
svn-id: r43636
---
AUTHORS | 3 +
backends/platform/linuxmoto/hardwarekeys.cpp | 100 ++++++++++++
backends/platform/linuxmoto/linuxmoto-events.cpp | 190 +++++++++++++++++++++++
backends/platform/linuxmoto/linuxmoto-sdl.cpp | 69 ++++++++
backends/platform/linuxmoto/linuxmoto-sdl.h | 46 ++++++
backends/platform/linuxmoto/main.cpp | 45 ++++++
backends/platform/linuxmoto/module.mk | 29 ++++
backends/platform/sdl/events.cpp | 2 +
backends/platform/sdl/main.cpp | 2 +-
backends/platform/sdl/sdl.cpp | 5 +-
backends/platform/sdl/sdl.h | 2 +
configure | 53 ++++++-
dists/motoezx/scummvm-sm.png | Bin 0 -> 1435 bytes
dists/motoezx/scummvm.desktop | 9 ++
dists/motoezx/scummvm.lin | 10 ++
dists/motoezx/scummvm.png | Bin 0 -> 1681 bytes
gui/credits.h | 3 +
ports.mk | 16 +-
tools/credits.pl | 4 +
19 files changed, 582 insertions(+), 6 deletions(-)
create mode 100644 backends/platform/linuxmoto/hardwarekeys.cpp
create mode 100644 backends/platform/linuxmoto/linuxmoto-events.cpp
create mode 100644 backends/platform/linuxmoto/linuxmoto-sdl.cpp
create mode 100644 backends/platform/linuxmoto/linuxmoto-sdl.h
create mode 100644 backends/platform/linuxmoto/main.cpp
create mode 100644 backends/platform/linuxmoto/module.mk
create mode 100644 dists/motoezx/scummvm-sm.png
create mode 100644 dists/motoezx/scummvm.desktop
create mode 100644 dists/motoezx/scummvm.lin
create mode 100644 dists/motoezx/scummvm.png
diff --git a/AUTHORS b/AUTHORS
index f6032b1344..c7cc26627b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -159,6 +159,9 @@ ScummVM Team
iPhone:
Oystein Eftevaag
+ LinuxMoto:
+ Lubomyr Lisen
+
Maemo:
Frantisek Dufka
diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp
new file mode 100644
index 0000000000..2f64e7dbae
--- /dev/null
+++ b/backends/platform/linuxmoto/hardwarekeys.cpp
@@ -0,0 +1,100 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+
+#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
+#include "backends/keymapper/keymapper.h"
+#include "common/keyboard.h"
+
+#ifdef ENABLE_KEYMAPPER
+
+using namespace Common;
+
+struct Key {
+ const char *hwId;
+ KeyCode keycode;
+ uint16 ascii;
+ const char *desc;
+ KeyType preferredAction;
+ bool shiftable;
+};
+
+static const Key keys[] = {
+ {"FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", kActionKeyType, false},
+ {"CAMERA", KEYCODE_PAUSE, 0, "Camera", kActionKeyType, false},
+ {"HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", kStartKeyType, false},
+ {"CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", kActionKeyType, false},
+ {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false},
+ {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false},
+
+ {"a", KEYCODE_a, 'a', "a", kActionKeyType, true},
+ {"b", KEYCODE_b, 'b', "b", kActionKeyType, true},
+ {"c", KEYCODE_c, 'c', "c", kActionKeyType, true},
+ {"d", KEYCODE_d, 'd', "d", kActionKeyType, true},
+ {"e", KEYCODE_e, 'e', "e", kActionKeyType, true},
+ {"f", KEYCODE_f, 'f', "f", kActionKeyType, true},
+ {"g", KEYCODE_g, 'g', "g", kActionKeyType, true},
+ {"h", KEYCODE_h, 'h', "h", kActionKeyType, true},
+ {"i", KEYCODE_i, 'i', "i", kActionKeyType, true},
+ {"j", KEYCODE_j, 'j', "j", kActionKeyType, true},
+
+ // Numeric keypad
+
+ // Arrows + Home/End pad
+ {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false},
+ {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false},
+ {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false},
+ {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false},
+
+ // Function keys
+
+ // Miscellaneous function keys
+
+ {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false}
+};
+
+struct Mod {
+ byte flag;
+ const char *id;
+ const char *desc;
+ bool shiftable;
+};
+
+static const Mod modifiers[] = {
+ { 0, "", "", false },
+ { KBD_CTRL, "C+", "Ctrl+", false },
+ { KBD_ALT, "A+", "Alt+", false },
+ { KBD_SHIFT, "", "", true },
+ { KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", false },
+ { KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+", true },
+ { KBD_SHIFT | KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", true },
+ { 0, 0, 0, false }
+};
+#endif
+
+
+Common::HardwareKeySet *OSystem_LINUXMOTO::getHardwareKeySet() {
+ OSystem_SDL::getHardwareKeySet();
+}
diff --git a/backends/platform/linuxmoto/linuxmoto-events.cpp b/backends/platform/linuxmoto/linuxmoto-events.cpp
new file mode 100644
index 0000000000..2a40d734b0
--- /dev/null
+++ b/backends/platform/linuxmoto/linuxmoto-events.cpp
@@ -0,0 +1,190 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+
+#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
+#include "backends/platform/sdl/sdl.h"
+
+static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) {
+ if (key >= SDLK_F1 && key <= SDLK_F9) {
+ return key - SDLK_F1 + Common::ASCII_F1;
+ } else if (key >= SDLK_KP0 && key <= SDLK_KP9) {
+ return key - SDLK_KP0 + '0';
+ } else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) {
+ return key;
+ } else if (unicode) {
+ return unicode;
+ } else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) {
+ return key & ~0x20;
+ } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) {
+ return 0;
+ }
+ return key;
+}
+
+bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
+ // Motorol A1200/E6/A1600 remapkey by Lubomyr
+#ifdef MOTOEZX
+ // Quit on MOD+Camera Key on A1200
+ if (ev.key.keysym.sym == SDLK_e) {
+ event.type = Common::EVENT_QUIT;
+ return true;
+ }
+ // '1' Bypass security protection - MOD+Call key
+ if (ev.key.keysym.sym == SDLK_f) {
+ ev.key.keysym.sym=SDLK_1;
+ }
+ // F5 Game Menu - Call key
+ else if (ev.key.keysym.sym == SDLK_SPACE) {
+ ev.key.keysym.sym=SDLK_F5;
+ }
+ // Camera to VirtualKeyboard
+ else if (ev.key.keysym.sym == SDLK_PAUSE) {
+ ev.key.keysym.sym=SDLK_F7;
+ }
+ // mod+fire to enter
+ else if (ev.key.keysym.sym == SDLK_b) {
+ ev.key.keysym.sym=SDLK_RETURN;
+ }
+#endif
+ // Motorola Z6/V8 remapkey by Ant-On
+#ifdef MOTOMAGX
+ // Quit on cancel
+ if (ev.key.keysym.sym == SDLK_ESCAPE) {
+ event.type = Common::EVENT_QUIT;
+ return true;
+ } else
+ // F5 Game Menu - Call key
+ if (ev.key.keysym.sym == SDLK_SPACE) {
+ ev.key.keysym.sym=SDLK_F5;
+ }
+ // 'y' - Mod+Right key
+ // 'y' - Left soft
+ else if (ev.key.keysym.sym == SDLK_F9) {
+ ev.key.keysym.sym=SDLK_y;
+ }
+ // 'n' - Mod+Left key
+ // 'n' - rigth soft
+ else if (ev.key.keysym.sym == SDLK_F11) {
+ ev.key.keysym.sym=SDLK_n;
+ }
+#endif
+
+// Joystick to Mouse
+ else if (ev.key.keysym.sym == SDLK_LEFT) {
+ if (ev.type == SDL_KEYDOWN) {
+ _km.x_vel = -1;
+ _km.x_down_count = 1;
+ } else {
+ _km.x_vel = 0;
+ _km.x_down_count = 0;
+ }
+
+ event.type = Common::EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ } else if (ev.key.keysym.sym == SDLK_RIGHT) {
+ if (ev.type == SDL_KEYDOWN) {
+ _km.x_vel = 1;
+ _km.x_down_count = 1;
+ } else {
+ _km.x_vel = 0;
+ _km.x_down_count = 0;
+ }
+
+ event.type = Common::EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ } else if (ev.key.keysym.sym == SDLK_DOWN) {
+ if (ev.type == SDL_KEYDOWN) {
+ _km.y_vel = 1;
+ _km.y_down_count = 1;
+ } else {
+ _km.y_vel = 0;
+ _km.y_down_count = 0;
+ }
+
+ event.type = Common::EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ } else if (ev.key.keysym.sym == SDLK_UP) {
+ if (ev.type == SDL_KEYDOWN) {
+ _km.y_vel = -1;
+ _km.y_down_count = 1;
+ } else {
+ _km.y_vel = 0;
+ _km.y_down_count = 0;
+ }
+
+ event.type = Common::EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ }
+ // Joystick center to pressing Left Mouse
+ else if (ev.key.keysym.sym == SDLK_RETURN) {
+ // _km.y_vel = 0;
+ // _km.y_down_count = 0;
+ if (ev.key.type == SDL_KEYDOWN) {
+ event.type = Common::EVENT_LBUTTONDOWN;
+ } else {
+ event.type = Common::EVENT_LBUTTONUP;
+ }
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ }
+ // Volume Up to pressing Right Mouse
+ else if (ev.key.keysym.sym == SDLK_PLUS) {
+ // _km.y_vel = 0;
+ // _km.y_down_count = 0;
+ if (ev.key.type == SDL_KEYDOWN ) {
+ event.type = Common::EVENT_RBUTTONDOWN;
+ } else {
+ event.type = Common::EVENT_RBUTTONUP;
+ }
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ }
+ // Volume Down to pressing Left Mouse
+ else if (ev.key.keysym.sym == SDLK_MINUS) {
+ //_km.y_vel = 0;
+ //_km.y_down_count = 0;
+ if (ev.key.type == SDL_KEYDOWN) {
+ event.type = Common::EVENT_LBUTTONDOWN;
+ } else {
+ event.type = Common::EVENT_LBUTTONUP;
+ }
+ fillMouseEvent(event, _km.x, _km.y);
+ return true;
+ } else {
+ // Let the events fall through if we didn't change them, this may not be the best way to
+ // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
+ // and yes i have an huge terminal size so i dont wrap soon enough.
+ event.type = Common::EVENT_KEYDOWN;
+ event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+ event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+ }
+
+ return false;
+}
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.cpp b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
new file mode 100644
index 0000000000..bc163c807c
--- /dev/null
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+
+#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
+
+void OSystem_LINUXMOTO::preprocessEvents(SDL_Event *event) {
+ if (event->type == SDL_ACTIVEEVENT) {
+ if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {
+ suspendAudio();
+ for (;;) {
+ if (!SDL_WaitEvent(event)) {
+ SDL_Delay(10);
+ continue;
+ }
+ if (event->type == SDL_QUIT)
+ return;
+ if (event->type != SDL_ACTIVEEVENT)
+ continue;
+ if (event->active.state == SDL_APPINPUTFOCUS && event->active.gain) {
+ resumeAudio();
+ return;
+ }
+ }
+ }
+ }
+}
+
+void OSystem_LINUXMOTO::suspendAudio() {
+ SDL_CloseAudio();
+ _audioSuspended = true;
+}
+
+int OSystem_LINUXMOTO::resumeAudio() {
+ if (!_audioSuspended)
+ return -2;
+ if (SDL_OpenAudio(&_obtained, NULL) < 0){
+ return -1;
+ }
+ SDL_PauseAudio(0);
+ _audioSuspended = false;
+ return 0;
+}
+
+void OSystem_LINUXMOTO::setupMixer() {
+ OSystem_SDL::setupMixer();
+}
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.h b/backends/platform/linuxmoto/linuxmoto-sdl.h
new file mode 100644
index 0000000000..27c423b071
--- /dev/null
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.h
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+
+#ifndef LINUXMOTO_SDL
+#define LINUXMOTO_SDL
+
+#include "backends/platform/sdl/sdl.h"
+
+#include
+
+class OSystem_LINUXMOTO : public OSystem_SDL {
+private:
+ bool _audioSuspended;
+public:
+ virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+ virtual void preprocessEvents(SDL_Event *event);
+ virtual void setupMixer();
+ virtual Common::HardwareKeySet *getHardwareKeySet();
+ void suspendAudio();
+ int resumeAudio();
+};
+
+#endif
diff --git a/backends/platform/linuxmoto/main.cpp b/backends/platform/linuxmoto/main.cpp
new file mode 100644
index 0000000000..1e37fe617a
--- /dev/null
+++ b/backends/platform/linuxmoto/main.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include
+#include
+
+#include
+#include
+
+#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
+#include "base/main.h"
+#include "base/internal_version.h"
+
+int main(int argc, char *argv[]) {
+
+ g_system = new OSystem_LINUXMOTO();
+ assert(g_system);
+ // Invoke the actual ScummVM main entry point:
+ int res = scummvm_main(argc, argv);
+ g_system->quit(); // TODO: Consider removing / replacing this!
+
+ return res;
+}
diff --git a/backends/platform/linuxmoto/module.mk b/backends/platform/linuxmoto/module.mk
new file mode 100644
index 0000000000..4d816eb227
--- /dev/null
+++ b/backends/platform/linuxmoto/module.mk
@@ -0,0 +1,29 @@
+MODULE := backends/platform/linuxmoto
+
+MODULE_OBJS := \
+ main.o \
+ hardwarekeys.o \
+ linuxmoto-events.o \
+ linuxmoto-sdl.o
+
+MODULE_DIRS += \
+ backends/platform/linuxmoto/
+
+# We don't use the rules.mk here on purpose
+OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS)
+
+MODULE := backends/platform/sdl
+
+MODULE_OBJS := \
+ events.o \
+ graphics.o \
+ hardwarekeys.o \
+ main.o \
+ sdl.o
+
+MODULE_DIRS += \
+ backends/platform/sdl/
+
+# We don't use the rules.mk here on purpose
+OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS)
+
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index feb2c9a9c5..e6c8d716e3 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -186,6 +186,8 @@ bool OSystem_SDL::pollEvent(Common::Event &event) {
}
while (SDL_PollEvent(&ev)) {
+ preprocessEvents(&ev);
+
switch (ev.type) {
case SDL_KEYDOWN:{
b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());
diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp
index 021bda155c..fa8f6ededb 100644
--- a/backends/platform/sdl/main.cpp
+++ b/backends/platform/sdl/main.cpp
@@ -37,7 +37,7 @@
#include "SymbianOs.h"
#endif
-#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)
+#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)&& !defined(LINUXMOTO)
#if defined (WIN32)
int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) {
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 7c1107582b..a4f4114d10 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -695,7 +695,6 @@ void OSystem_SDL::mixCallback(void *sys, byte *samples, int len) {
void OSystem_SDL::setupMixer() {
SDL_AudioSpec desired;
- SDL_AudioSpec obtained;
// Determine the desired output sampling frequency.
_samplesPerSec = 0;
@@ -725,7 +724,7 @@ void OSystem_SDL::setupMixer() {
_mixer = new Audio::MixerImpl(this);
assert(_mixer);
- if (SDL_OpenAudio(&desired, &obtained) != 0) {
+ if (SDL_OpenAudio(&desired, &_obtained) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
_samplesPerSec = 0;
_mixer->setReady(false);
@@ -733,7 +732,7 @@ void OSystem_SDL::setupMixer() {
// Note: This should be the obtained output rate, but it seems that at
// least on some platforms SDL will lie and claim it did get the rate
// even if it didn't. Probably only happens for "weird" rates, though.
- _samplesPerSec = obtained.freq;
+ _samplesPerSec = _obtained.freq;
debug(1, "Output sample rate: %d Hz", _samplesPerSec);
// Tell the mixer that we are ready and start the sound processing
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 3da9a433b7..e5c41e6611 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -216,6 +216,7 @@ public:
virtual bool hasFeature(Feature f);
virtual void setFeatureState(Feature f, bool enable);
virtual bool getFeatureState(Feature f);
+ virtual void preprocessEvents(SDL_Event *event) {};
#ifdef USE_OSD
void displayMessageOnOSD(const char *msg);
@@ -230,6 +231,7 @@ public:
protected:
bool _inited;
+ SDL_AudioSpec _obtained;
#ifdef USE_OSD
SDL_Surface *_osdSurface;
diff --git a/configure b/configure
index d7b43f05cc..d6060a4a4b 100755
--- a/configure
+++ b/configure
@@ -555,7 +555,7 @@ Usage: $0 [OPTIONS]...
Configuration:
-h, --help display this help and exit
- --backend=BACKEND backend to build (sdl, dc, gp2x, gp2xwiz, iphone, morphos, nds, psp, wii, wince, null) [sdl]
+ --backend=BACKEND backend to build (sdl, dc, gp2x, gp2xwiz, iphone, morphos, nds, psp, wii, wince, linuxmoto, null) [sdl]
Installation directories:
--prefix=DIR use this prefix for installing ScummVM [/usr/local]
@@ -799,6 +799,16 @@ linupy)
_host_os=linux
_host_cpu=arm
;;
+motoezx)
+ _host_os=linux
+ _host_cpu=arm
+ _host_alias=arm-linux-gnu
+ ;;
+motomagx)
+ _host_os=linux
+ _host_cpu=arm
+ _host_alias=arm-linux-gnueabi
+ ;;
arm-riscos)
_host_os=riscos
_host_cpu=arm
@@ -1221,6 +1231,40 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
;;
+ motoezx)
+ echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+ DEFINES="$DEFINES -DUNIX -DMOTOEZX -DUSE_ARM_SMUSH_ASM"
+ #not true for all ARM systems, but the interesting ones are all LE. Most (if not all) BE arm devices don't have a screen
+ _endian=little
+ _need_memalign=yes
+ type_1_byte='char'
+ type_2_byte='short'
+ type_4_byte='int'
+ add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
+ add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
+ _ar="$_host_alias-ar cru"
+ _as="$_host_alias-as -mfpu=vfp"
+ _ranlib=$_host_alias-ranlib
+ _strip=$_host_alias-strip
+ _backend="linuxmoto"
+ ;;
+ motomagx)
+ echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+ DEFINES="$DEFINES -DUNIX -DMOTOMAGX -DUSE_ARM_SMUSH_ASM"
+ #not true for all ARM systems, but the interesting ones are all LE. Most (if not all) BE arm devices don't have a screen
+ _endian=little
+ _need_memalign=yes
+ type_1_byte='char'
+ type_2_byte='short'
+ type_4_byte='int'
+ add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
+ add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
+ _ar="$_host_alias-ar cru"
+ _as="$_host_alias-as -mfpu=vfp"
+ _ranlib=$_host_alias-ranlib
+ _strip=$_host_alias-strip
+ _backend="linuxmoto"
+ ;;
bfin*)
_need_memalign=yes
;;
@@ -2073,6 +2117,12 @@ case $_backend in
LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
DEFINES="$DEFINES -DSDL_BACKEND"
;;
+ linuxmoto)
+ find_sdlconfig
+ INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`"
+ LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
+ DEFINES="$DEFINES -DSDL_BACKEND -DLINUXMOTO"
+ ;;
gp2x)
find_sdlconfig
INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`"
@@ -2291,6 +2341,7 @@ LIBS += $LIBS
RANLIB := $_ranlib
STRIP := $_strip
AR := $_ar
+AS := $_as
WINDRES := $_windres
WIN32PATH=$_win32path
AOS4PATH=$_aos4path
diff --git a/dists/motoezx/scummvm-sm.png b/dists/motoezx/scummvm-sm.png
new file mode 100644
index 0000000000..e6341243c4
Binary files /dev/null and b/dists/motoezx/scummvm-sm.png differ
diff --git a/dists/motoezx/scummvm.desktop b/dists/motoezx/scummvm.desktop
new file mode 100644
index 0000000000..ddd8ad7f57
--- /dev/null
+++ b/dists/motoezx/scummvm.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+BigIcon=scummvm.png
+Comment=ScummVM
+Exec=scummvm.lin
+Icon=scummvm-sm.png
+Name=ScummVM
+OsVersion=0.1
+Shared=0
+Type=Application
diff --git a/dists/motoezx/scummvm.lin b/dists/motoezx/scummvm.lin
new file mode 100644
index 0000000000..a3c6f3831b
--- /dev/null
+++ b/dists/motoezx/scummvm.lin
@@ -0,0 +1,10 @@
+#!/bin/sh
+. /home/native/.profile
+myfile=`basename $0`
+mypath=`echo $0 | sed -e 's/'$myfile'//g'`
+export LD_LIBRARY_PATH=/mmc/mmca1/games/lib:$LD_LIBRARY_PATH
+#export SDL_QT_INVERT_ROTATION=1
+export SDL_QT_MODIFICATOR=1
+export HOME=/mmc/mmca1/games
+cd $mypath
+exec $mypath/scummvm --path=/mmc/mmca1/games/data --gfx-mode=1x > /mmc/mmca1/games/logs/scummvm.log 2>&1
diff --git a/dists/motoezx/scummvm.png b/dists/motoezx/scummvm.png
new file mode 100644
index 0000000000..4a0c65b544
Binary files /dev/null and b/dists/motoezx/scummvm.png differ
diff --git a/gui/credits.h b/gui/credits.h
index 21f69d4465..9a9bd4deb5 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -180,6 +180,9 @@ static const char *credits[] = {
"C1""iPhone",
"C0""Oystein Eftevaag",
"",
+"C1""LinuxMoto",
+"C0""Lubomyr Lisen",
+"",
"C1""Maemo",
"C0""Frantisek Dufka",
"",
diff --git a/ports.mk b/ports.mk
index 6fc2796cc8..84c9845ee0 100644
--- a/ports.mk
+++ b/ports.mk
@@ -204,7 +204,21 @@ ifneq ($(DIST_FILES_ENGINEDATA),)
endif
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip wiidist/scummvm/
-.PHONY: deb bundle osxsnap win32dist wiidist install uninstall
+#
+# Linuxmoto/motoezx specific
+#
+
+# Special target to create a motoezx snapshot
+motoezx: $(EXECUTABLE)
+ $(MKDIR) motoezx/scummvm
+ $(CP) $(EXECUTABLE) motoezx/scummvm/
+ $(STRIP) motoezx/scummvm/$(EXECUTABLE)
+ $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) motoezx/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip motoezx/scummvm/
+ $(CP) $(srcdir)/dists/motoezx/* motoezx/scummvm/
+ tar -C motoezx -cvzf motoezx/ScummVM.pkg scummvm
+
+.PHONY: deb bundle osxsnap win32dist wiidist motoezx install uninstall
#
# ARM specific
diff --git a/tools/credits.pl b/tools/credits.pl
index ad006b2aee..dbe098a652 100755
--- a/tools/credits.pl
+++ b/tools/credits.pl
@@ -646,6 +646,10 @@ begin_credits("Credits");
add_person("Oystein Eftevaag", "vinterstum", "");
end_section();
+ begin_section("LinuxMoto");
+ add_person("Lubomyr Lisen", "", "");
+ end_section();
+
begin_section("Maemo");
add_person("Frantisek Dufka", "fanoush", "");
end_section();
--
cgit v1.2.3
From 529dc3e3f89b9a73307659f53a9322a957bbbb12 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sat, 22 Aug 2009 12:53:37 +0000
Subject: Fix OSX builds
svn-id: r43637
---
backends/platform/sdl/sdl.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index a4f4114d10..7bfab26a86 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -740,7 +740,7 @@ void OSystem_SDL::setupMixer() {
_mixer->setReady(true);
#ifdef MIXER_DOUBLE_BUFFERING
- initThreadedMixer(_mixer, obtained.samples * 4);
+ initThreadedMixer(_mixer, _obtained.samples * 4);
#endif
// start the sound system
--
cgit v1.2.3
From 401e54825f986b8287acd3f9b2d8002327ccef27 Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Sat, 22 Aug 2009 13:11:30 +0000
Subject: Hooking up the v2 spriteUncompressor into the v6 one
svn-id: r43642
---
engines/gob/video_v2.cpp | 49 +++++++++++++++++++++++++++++-------------------
engines/gob/video_v6.cpp | 19 +++++++++++++++++--
2 files changed, 47 insertions(+), 21 deletions(-)
diff --git a/engines/gob/video_v2.cpp b/engines/gob/video_v2.cpp
index b526b63a37..98cf4a5d4f 100644
--- a/engines/gob/video_v2.cpp
+++ b/engines/gob/video_v2.cpp
@@ -64,12 +64,15 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
memBuffer = new byte[4370];
assert(memBuffer);
+ memset(memBuffer, 0, 4370);
+
srcPtr = sprBuf + 3;
+
sourceLeft = READ_LE_UINT32(srcPtr);
destPtr = destDesc.getVidMem() + destDesc.getWidth() * y + x;
- curWidth = 0;
+ curWidth = 0;
curHeight = 0;
linePtr = destPtr;
@@ -89,58 +92,64 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
cmdVar = 0;
while (1) {
cmdVar >>= 1;
- if ((cmdVar & 0x100) == 0) {
- cmdVar = *srcPtr | 0xFF00;
- srcPtr++;
- }
+ if ((cmdVar & 0x100) == 0)
+ cmdVar = *srcPtr++ | 0xFF00;
+
if ((cmdVar & 1) != 0) {
temp = *srcPtr++;
+
if ((temp != 0) || (transp == 0))
*destPtr = temp;
+
destPtr++;
curWidth++;
+
if (curWidth >= srcWidth) {
curWidth = 0;
linePtr += destDesc.getWidth();
destPtr = linePtr;
- curHeight++;
- if (curHeight >= srcHeight)
+ if (++curHeight >= srcHeight)
break;
}
- sourceLeft--;
+
memBuffer[bufPos] = temp;
- bufPos++;
- bufPos %= 4096;
- if (sourceLeft == 0)
+
+ bufPos = (bufPos + 1) % 4096;
+
+ if (--sourceLeft == 0)
break;
+
} else {
offset = *srcPtr++;
- offset |= (*srcPtr & 0xF0) << 4;
- strLen = (*srcPtr & 0x0F) + 3;
- *srcPtr++;
+ temp = *srcPtr++;
+
+ offset |= (temp & 0xF0) << 4;
+ strLen = (temp & 0x0F) + 3;
+
if (strLen == lenCmd)
strLen = *srcPtr++ + 18;
for (counter2 = 0; counter2 < strLen; counter2++) {
temp = memBuffer[(offset + counter2) % 4096];
+
if ((temp != 0) || (transp == 0))
*destPtr = temp;
- destPtr++;
+ destPtr++;
curWidth++;
+
if (curWidth >= srcWidth) {
curWidth = 0;
linePtr += destDesc.getWidth();
destPtr = linePtr;
- curHeight++;
- if (curHeight >= srcHeight) {
+ if (++curHeight >= srcHeight) {
delete[] memBuffer;
return 1;
}
}
+
memBuffer[bufPos] = temp;
- bufPos++;
- bufPos %= 4096;
+ bufPos = (bufPos + 1) % 4096;
}
if (strLen >= ((int32) sourceLeft)) {
@@ -148,7 +157,9 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
return 1;
} else
sourceLeft--;
+
}
+
}
} else
return 0;
diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp
index c51b027bad..6f39edb588 100644
--- a/engines/gob/video_v6.cpp
+++ b/engines/gob/video_v6.cpp
@@ -84,8 +84,23 @@ char Video_v6::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
return 1;
}
- warning("Urban Stub: spriteUncompressor(), sprBuf[0,1] = %d,%d",
- sprBuf[0], sprBuf[1]);
+ if (srcWidth & 0xC000) {
+ warning("Playtoons Stub: srcWidth & 0xC000 == %04X", srcWidth & 0xC000);
+ srcWidth &= 0x3FFF;
+ }
+
+ if ((sprBuf[0] == 1) && (sprBuf[1] == 2)) {
+ if (Video_v2::spriteUncompressor(sprBuf, srcWidth, srcHeight, x, y, transp, destDesc))
+ return 1;
+
+ _vm->validateVideoMode(destDesc._vidMode);
+
+ _videoDriver->drawPackedSprite(sprBuf, srcWidth, srcHeight, x, y, transp, destDesc);
+ return 1;
+ }
+
+ warning("Urban Stub: spriteUncompressor(), sprBuf[0,1,2] = %d,%d,%d",
+ sprBuf[0], sprBuf[1], sprBuf[2]);
return 1;
}
--
cgit v1.2.3
From e673bd5b95a9e51af2ad94ca0dc607651f53fa9d Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Sat, 22 Aug 2009 13:11:55 +0000
Subject: Fixing some problems when calling the player with muted output
svn-id: r43643
---
graphics/video/coktelvideo/coktelvideo.cpp | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp
index 39aeca07bd..b69315cbae 100644
--- a/graphics/video/coktelvideo/coktelvideo.cpp
+++ b/graphics/video/coktelvideo/coktelvideo.cpp
@@ -362,6 +362,10 @@ void Imd::setDoubleMode(bool doubleMode) {
}
void Imd::enableSound(Audio::Mixer &mixer) {
+ // Sanity check
+ if (mixer.getOutputRate() == 0)
+ return;
+
// Only possible on the first frame
if (_curFrame > 0)
return;
@@ -387,7 +391,7 @@ void Imd::disableSound() {
}
bool Imd::isSoundPlaying() const {
- if (_audioStream && _mixer->isSoundHandleActive(_audioHandle))
+ if (_audioStream && _mixer && _mixer->isSoundHandleActive(_audioHandle))
return true;
return false;
@@ -1706,9 +1710,12 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
}
if (startSound && _soundEnabled) {
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream);
- _skipFrames = 0;
- _soundStage = 2;
+ if (_hasSound && _audioStream) {
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream);
+ _skipFrames = 0;
+ _soundStage = 2;
+ } else
+ _soundStage = 0;
}
if ((_curFrame == (_framesCount - 1)) && (_soundStage == 2)) {
--
cgit v1.2.3
From 811cea60e76f39434e00c07d5b02ed920c16c191 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 13:14:46 +0000
Subject: Correct game title.
svn-id: r43645
---
engines/scumm/detection_tables.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index e81779bdd3..57fe251e05 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -88,7 +88,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "football2002", "Backyard Football 2002" },
{ "freddicove", "Freddi Fish 5: The Case of the Creature of Coral Cave" },
{ "moonbase", "Moonbase Commander" },
- { "pjgames", "Pajama Sam: Games to Play On Any Day" },
+ { "pjgames", "Pajama Sam: Games to Play on Any Day" },
{ "readtime", "Blue's Reading Time Activities" },
{ "Soccer2004", "Backyard Soccer 2004" },
{ "SoccerMLS", "Backyard Soccer MLS Edition" },
--
cgit v1.2.3
From 1cedb6577111bca746628b0d3f4b0e8b232338c5 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 13:18:26 +0000
Subject: Give meaningful name to variable
svn-id: r43647
---
backends/platform/linuxmoto/linuxmoto-sdl.cpp | 2 +-
backends/platform/sdl/sdl.cpp | 6 +++---
backends/platform/sdl/sdl.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.cpp b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
index bc163c807c..82c69bc7d7 100644
--- a/backends/platform/linuxmoto/linuxmoto-sdl.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
@@ -56,7 +56,7 @@ void OSystem_LINUXMOTO::suspendAudio() {
int OSystem_LINUXMOTO::resumeAudio() {
if (!_audioSuspended)
return -2;
- if (SDL_OpenAudio(&_obtained, NULL) < 0){
+ if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){
return -1;
}
SDL_PauseAudio(0);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 7bfab26a86..547720d435 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -724,7 +724,7 @@ void OSystem_SDL::setupMixer() {
_mixer = new Audio::MixerImpl(this);
assert(_mixer);
- if (SDL_OpenAudio(&desired, &_obtained) != 0) {
+ if (SDL_OpenAudio(&desired, &_obtainedRate) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
_samplesPerSec = 0;
_mixer->setReady(false);
@@ -732,7 +732,7 @@ void OSystem_SDL::setupMixer() {
// Note: This should be the obtained output rate, but it seems that at
// least on some platforms SDL will lie and claim it did get the rate
// even if it didn't. Probably only happens for "weird" rates, though.
- _samplesPerSec = _obtained.freq;
+ _samplesPerSec = _obtainedRate.freq;
debug(1, "Output sample rate: %d Hz", _samplesPerSec);
// Tell the mixer that we are ready and start the sound processing
@@ -740,7 +740,7 @@ void OSystem_SDL::setupMixer() {
_mixer->setReady(true);
#ifdef MIXER_DOUBLE_BUFFERING
- initThreadedMixer(_mixer, _obtained.samples * 4);
+ initThreadedMixer(_mixer, _obtainedRate.samples * 4);
#endif
// start the sound system
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index e5c41e6611..82c1e7bf1b 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -231,7 +231,7 @@ public:
protected:
bool _inited;
- SDL_AudioSpec _obtained;
+ SDL_AudioSpec _obtainedRate;
#ifdef USE_OSD
SDL_Surface *_osdSurface;
--
cgit v1.2.3
From 57ea8cc3192072ffdb1908d8e1fd521fbfe47373 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 13:24:17 +0000
Subject: Correct game title.
svn-id: r43648
---
NEWS | 2 +-
README | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index deb06dbfaf..a80d1d4495 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
- Added support for Blue's Art Time Activities.
- Added support for Blue's Reading Time Activities.
- Added support for Freddi Fish 5: The Case of the Creature of Coral Cave.
- - Added support for Pajama Sam: Games to Play On Any Day.
+ - Added support for Pajama Sam: Games to Play on Any Day.
General:
- Added support for a custom SJIS font for FM-TOWNS and PC98 games.
diff --git a/README b/README
index a085f37a2a..3b2e827cd3 100644
--- a/README
+++ b/README
@@ -313,10 +313,11 @@ and view the compatibility chart.
Backyard Baseball 2003 [baseball2003]
Backyard Football 2002 [football2002]
Backyard Soccer [soccer]
+ Backyard Soccer MLS [soccermls]
Backyard Soccer 2004 [soccer2004]
Blue's Birthday Adventure [BluesBirthday]
Blue's Treasure Hunt [BluesTreasureHunt]
- Pajama Sam: Games to Play On Any Day [pjgames]
+ Pajama Sam: Games to Play on Any Day [pjgames]
The following games are based on the SCUMM engine, but NOT supported
by ScummVM (yet):
--
cgit v1.2.3
From ee0e1bfceac7eb626737f321e851ef0cdcea08d3 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sat, 22 Aug 2009 13:32:56 +0000
Subject: Fix endian regression, when clearing the buffer of non-cursor images.
svn-id: r43649
---
engines/scumm/he/wiz_he.cpp | 15 +++++++++++----
engines/scumm/he/wiz_he.h | 1 +
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 5280dc097f..9ddc1ea22f 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -40,6 +40,7 @@ Wiz::Wiz(ScummEngine_v71he *vm) : _vm(vm) {
_imagesNum = 0;
memset(&_images, 0, sizeof(_images));
memset(&_polygons, 0, sizeof(_polygons));
+ _cursorImage = false;
_rectOverrideEnabled = false;
}
@@ -1503,8 +1504,13 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int
if (_vm->_bitDepth == 2) {
uint8 *tmpPtr = dst;
for (uint i = 0; i < height; i++) {
- for (uint j = 0; j < width; j++)
- WRITE_UINT16(tmpPtr + j * 2, transColor);
+ for (uint j = 0; j < width; j++) {
+ if (_cursorImage) {
+ WRITE_UINT16(tmpPtr + j * 2, transColor);
+ } else {
+ WRITE_LE_UINT16(tmpPtr + j * 2, transColor);
+ }
+ }
tmpPtr += width * 2;
}
} else {
@@ -1967,8 +1973,7 @@ void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, i
y_acc += pra->y_step;
if (bitDepth == 2) {
if (transColor == -1 || transColor != READ_LE_UINT16(src + src_offs * 2)) {
- //if (transColor == -1 || READ_UINT16(dstPtr) != transColor)
- writeColor(dstPtr, dstType, READ_LE_UINT16(src + src_offs * 2));
+ writeColor(dstPtr, dstType, READ_LE_UINT16(src + src_offs * 2));
}
} else {
if (transColor == -1 || transColor != src[src_offs])
@@ -2012,7 +2017,9 @@ void Wiz::loadWizCursor(int resId, int palette) {
}
const Common::Rect *r = NULL;
+ _cursorImage = true;
uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
+ _cursorImage = false;
int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index a212ac4d29..1fa9564486 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -165,6 +165,7 @@ public:
void clearWizBuffer();
Common::Rect _rectOverride;
+ bool _cursorImage;
bool _rectOverrideEnabled;
void polygonClear();
--
cgit v1.2.3
From ad507d3387bc54206a4df5137012c90c6a93aba6 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 13:34:38 +0000
Subject: Attempt to fix DC and iPhone backends compilation
svn-id: r43650
---
backends/platform/dc/dc.h | 4 ++--
backends/platform/dc/display.cpp | 4 ++--
backends/platform/iphone/osys_main.h | 4 ++--
backends/platform/iphone/osys_video.cpp | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index b67bbb51a1..f1d3c7af28 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -84,7 +84,7 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
// Set the size of the video bitmap.
// Typically, 320x200
- void initSize(uint w, uint h);
+ void initSize(uint w, uint h, const Graphics::PixelFormat *format);
int16 getHeight() { return _screen_h; }
int16 getWidth() { return _screen_w; }
@@ -105,7 +105,7 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
void warpMouse(int x, int y);
// Set the bitmap that's used when drawing the cursor.
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale);
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
// Replace the specified range of cursor the palette with new colors.
void setCursorPalette(const byte *colors, uint start, uint num);
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index d1e95c6a91..9a2510f8fc 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -193,7 +193,7 @@ void OSystem_Dreamcast::setScaling()
}
}
-void OSystem_Dreamcast::initSize(uint w, uint h)
+void OSystem_Dreamcast::initSize(uint w, uint h, const Graphics::PixelFormat *format)
{
assert(w <= SCREEN_W && h <= SCREEN_H);
@@ -263,7 +263,7 @@ void OSystem_Dreamcast::warpMouse(int x, int y)
void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
int hotspot_x, int hotspot_y,
- byte keycolor, int cursorTargetScale)
+ byte keycolor, int cursorTargetScale, const Graphics::PixelFormat *format)
{
_ms_cur_w = w;
_ms_cur_h = h;
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 705f89319a..25cfbcd276 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -126,7 +126,7 @@ public:
bool setGraphicsMode(const char *name);
virtual bool setGraphicsMode(int mode);
virtual int getGraphicsMode() const;
- virtual void initSize(uint width, uint height);
+ virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
virtual int16 getHeight();
virtual int16 getWidth();
virtual void setPalette(const byte *colors, uint start, uint num);
@@ -149,7 +149,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis();
diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp
index 641c341f50..3926299223 100644
--- a/backends/platform/iphone/osys_video.cpp
+++ b/backends/platform/iphone/osys_video.cpp
@@ -46,7 +46,7 @@ int OSystem_IPHONE::getGraphicsMode() const {
return -1;
}
-void OSystem_IPHONE::initSize(uint width, uint height) {
+void OSystem_IPHONE::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
//printf("initSize(%i, %i)\n", width, height);
_screenWidth = width;
@@ -438,7 +438,7 @@ void OSystem_IPHONE::dirtyFullOverlayScreen() {
}
}
-void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale) {
+void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
//printf("setMouseCursor(%i, %i)\n", hotspotX, hotspotY);
if (_mouseBuf != NULL && (_mouseWidth != w || _mouseHeight != h)) {
--
cgit v1.2.3
From 95c5d240447879397b74a65490644a3ac7e3d461 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 14:52:26 +0000
Subject: Second attempt to fix DC and iPhone backends compilation
svn-id: r43651
---
backends/platform/dc/dc.h | 2 +-
backends/platform/dc/display.cpp | 4 ++--
backends/platform/iphone/osys_main.h | 2 +-
backends/platform/iphone/osys_video.cpp | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index f1d3c7af28..f5d200968e 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -105,7 +105,7 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
void warpMouse(int x, int y);
// Set the bitmap that's used when drawing the cursor.
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
// Replace the specified range of cursor the palette with new colors.
void setCursorPalette(const byte *colors, uint start, uint num);
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index 9a2510f8fc..c6be514e36 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -263,7 +263,7 @@ void OSystem_Dreamcast::warpMouse(int x, int y)
void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
int hotspot_x, int hotspot_y,
- byte keycolor, int cursorTargetScale, const Graphics::PixelFormat *format)
+ uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format)
{
_ms_cur_w = w;
_ms_cur_h = h;
@@ -271,7 +271,7 @@ void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
_ms_hotspot_x = hotspot_x;
_ms_hotspot_y = hotspot_y;
- _ms_keycolor = keycolor;
+ _ms_keycolor = (byte)keycolor;
if (_ms_buf)
free(_ms_buf);
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 25cfbcd276..c4c1a8b080 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -149,7 +149,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 255, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis();
diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp
index 3926299223..6cb5e18d95 100644
--- a/backends/platform/iphone/osys_video.cpp
+++ b/backends/platform/iphone/osys_video.cpp
@@ -438,7 +438,7 @@ void OSystem_IPHONE::dirtyFullOverlayScreen() {
}
}
-void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
//printf("setMouseCursor(%i, %i)\n", hotspotX, hotspotY);
if (_mouseBuf != NULL && (_mouseWidth != w || _mouseHeight != h)) {
@@ -455,7 +455,7 @@ void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _mouseKeyColour = keycolor;
+ _mouseKeyColour = (byte)keycolor;
memcpy(_mouseBuf, buf, w * h);
--
cgit v1.2.3
From 9cd264ff8532b26ed0d3276ed9f23522ad458097 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 15:01:46 +0000
Subject: Document --enable-verbose-build configure option
svn-id: r43652
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index d6060a4a4b..2600c66a45 100755
--- a/configure
+++ b/configure
@@ -621,7 +621,7 @@ Optional Libraries:
--disable-nasm disable assembly language optimizations [autodetect]
--with-readline-prefix=DIR Prefix where readline is installed (optional)
- --disable-readline disable readline support in text console [autodetect]
+ --disable-readline disable readline support in text console [autodetect] --enable-verbose-build enable regular echoing of commands during build process
Some influential environment variables:
LDFLAGS linker flags, e.g. -L if you have libraries in a
--
cgit v1.2.3
From bed3980ab13e45c9c08e46668769283ec371c171 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 22 Aug 2009 15:11:50 +0000
Subject: Move new configure key to more appropriate place
svn-id: r43653
---
configure | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 2600c66a45..ad9df2d995 100755
--- a/configure
+++ b/configure
@@ -588,6 +588,7 @@ $engines_help
--disable-hq-scalers exclude HQ2x and HQ3x scalers
--disable-scalers exclude scalers
--enable-text-console use text console instead of graphical console
+ --enable-verbose-build enable regular echoing of commands during build process
Optional Libraries:
--with-alsa-prefix=DIR Prefix where alsa is installed (optional)
@@ -621,7 +622,7 @@ Optional Libraries:
--disable-nasm disable assembly language optimizations [autodetect]
--with-readline-prefix=DIR Prefix where readline is installed (optional)
- --disable-readline disable readline support in text console [autodetect] --enable-verbose-build enable regular echoing of commands during build process
+ --disable-readline disable readline support in text console [autodetect]
Some influential environment variables:
LDFLAGS linker flags, e.g. -L if you have libraries in a
--
cgit v1.2.3
From c70a8745068095227cac1db6054d55db0a0405ad Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Sat, 22 Aug 2009 15:46:43 +0000
Subject: Properly fixing the Lost in Time temp sprite issue
svn-id: r43654
---
engines/gob/save/savehandler.cpp | 12 ++++++++++++
engines/gob/save/savehandler.h | 2 ++
engines/gob/save/saveload.h | 1 +
engines/gob/save/saveload_v3.cpp | 7 +++++--
4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/engines/gob/save/savehandler.cpp b/engines/gob/save/savehandler.cpp
index 4e2c09bdca..5f24115a6c 100644
--- a/engines/gob/save/savehandler.cpp
+++ b/engines/gob/save/savehandler.cpp
@@ -229,6 +229,9 @@ int32 TempSpriteHandler::getSize() {
}
bool TempSpriteHandler::load(int16 dataVar, int32 size, int32 offset) {
+ if (isDummy(size))
+ return true;
+
// Sprite available?
if (!_sprite)
return false;
@@ -274,6 +277,9 @@ bool TempSpriteHandler::load(int16 dataVar, int32 size, int32 offset) {
bool TempSpriteHandler::save(int16 dataVar, int32 size, int32 offset) {
SurfaceDescPtr sprite;
+ if (isDummy(size))
+ return true;
+
if (!createSprite(dataVar, size, offset, &sprite))
return false;
@@ -320,6 +326,12 @@ bool TempSpriteHandler::createSprite(int16 dataVar, int32 size,
return true;
}
+// A size of 0 means no proper sprite should be saved/loaded,
+// but no error should be thrown either.
+bool TempSpriteHandler::isDummy(int32 size) {
+ return (size == 0);
+}
+
// A negative size is the flag for using a sprite
bool TempSpriteHandler::isSprite(int32 size) {
return (size < 0);
diff --git a/engines/gob/save/savehandler.h b/engines/gob/save/savehandler.h
index 55505d1b9a..6a7e563a8f 100644
--- a/engines/gob/save/savehandler.h
+++ b/engines/gob/save/savehandler.h
@@ -144,6 +144,8 @@ public:
protected:
SavePartSprite *_sprite;
+ /** Determine whether it's a dummy sprite save/load. */
+ static bool isDummy(int32 size);
/** Determine whether using a sprite was requested. */
static bool isSprite(int32 size);
/** Determine which sprite is meant. */
diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h
index 8a7d493aed..8e1240daf1 100644
--- a/engines/gob/save/saveload.h
+++ b/engines/gob/save/saveload.h
@@ -256,6 +256,7 @@ protected:
GameHandler *_gameHandler;
NotesHandler *_notesHandler;
+ TempSpriteHandler *_tempSpriteHandler;
ScreenshotHandler *_screenshotHandler;
SaveHandler *getHandler(const char *fileName) const;
diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp
index 064d472323..bb60f94725 100644
--- a/engines/gob/save/saveload_v3.cpp
+++ b/engines/gob/save/saveload_v3.cpp
@@ -33,8 +33,8 @@ namespace Gob {
SaveLoad_v3::SaveFile SaveLoad_v3::_saveFiles[] = {
{ "cat.inf", kSaveModeSave , 0, "savegame"},
{ "ima.inf", kSaveModeSave , 0, "screenshot"},
+ { "intro.$$$", kSaveModeSave , 0, "temporary sprite"},
{ "bloc.inf", kSaveModeSave , 0, "notes"},
- { "intro.$$$", kSaveModeIgnore, 0, "temporary sprite"},
{ "prot", kSaveModeIgnore, 0, 0},
{ "config", kSaveModeIgnore, 0, 0}
};
@@ -496,17 +496,20 @@ SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName, ScreenshotType s
_screenshotHandler = new ScreenshotHandler(vm, _gameHandler, sShotType);
}
+ _tempSpriteHandler = new TempSpriteHandler(vm);
_notesHandler = new NotesHandler(2560, vm, targetName);
_saveFiles[0].handler = _gameHandler;
_saveFiles[1].handler = _screenshotHandler;
- _saveFiles[2].handler = _notesHandler;
+ _saveFiles[2].handler = _tempSpriteHandler;
+ _saveFiles[3].handler = _notesHandler;
}
SaveLoad_v3::~SaveLoad_v3() {
delete _screenshotHandler;
delete _gameHandler;
delete _notesHandler;
+ delete _tempSpriteHandler;
}
const SaveLoad_v3::SaveFile *SaveLoad_v3::getSaveFile(const char *fileName) const {
--
cgit v1.2.3
From 523890784502b880b2b06b133135eff96c32fb76 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sat, 22 Aug 2009 16:30:20 +0000
Subject: configure support for AS and ASFLAGS, and .s files in Makefile. If a
port has set _host_alias, default to the default GNU tools ranlib, strip, ar,
as and windres
svn-id: r43657
---
Makefile | 2 +-
Makefile.common | 4 ++++
configure | 48 ++++++++++++++++++------------------------------
3 files changed, 23 insertions(+), 31 deletions(-)
diff --git a/Makefile b/Makefile
index 5771e692dc..b9a37accbe 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ config.h config.mk: $(srcdir)/configure
ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
@echo "Running $(srcdir)/configure with the last specified parameters"
@sleep 2
- LDFLAGS="$(SAVED_LDFLAGS)" CXX="$(SAVED_CXX)" CXXFLAGS="$(SAVED_CXXFLAGS)" CPPFLAGS="$(SAVED_CPPFLAGS)" \
+ LDFLAGS="$(SAVED_LDFLAGS)" CXX="$(SAVED_CXX)" CXXFLAGS="$(SAVED_CXXFLAGS)" CPPFLAGS="$(SAVED_CPPFLAGS)" ASFLAGS="$(SAVED_ASFLAGS)" \
$(srcdir)/configure $(SAVED_CONFIGFLAGS)
else
$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
diff --git a/Makefile.common b/Makefile.common
index 2b00605318..81593edf9d 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -67,6 +67,7 @@ ifneq ($(findstring $(MAKEFLAGS),s),s)
ifneq ($(VERBOSE_BUILD),1)
ifneq ($(VERBOSE_BUILD),yes)
QUIET_CXX = @echo ' ' C++ ' ' $@;
+QUIET_AS = @echo ' ' AS ' ' $@;
QUIET_NASM = @echo ' ' NASM ' ' $@;
QUIET_AR = @echo ' ' AR ' ' $@;
QUIET_RANLIB = @echo ' ' RANLIB ' ' $@;
@@ -116,6 +117,9 @@ else
$(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
endif
+%.o: %.s
+ $(QUIET_AS)$(AS) $(ASFLAGS) $(<) -o $*.o
+
ifdef HAVE_NASM
%.o: %.asm
$(QUIET_NASM)$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
diff --git a/configure b/configure
index ad9df2d995..bd5b8b159b 100755
--- a/configure
+++ b/configure
@@ -29,6 +29,7 @@ SAVED_LDFLAGS=$LDFLAGS
SAVED_CXX=$CXX
SAVED_CXXFLAGS=$CXXFLAGS
SAVED_CPPFLAGS=$CPPFLAGS
+SAVED_ASFLAGS=$ASFLAGS
# Use environment vars if set
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
@@ -133,6 +134,7 @@ _nasm=auto
_ranlib=ranlib
_strip=strip
_ar="ar cru"
+_as="as"
_windres=windres
_win32path="C:/scummvm"
_aos4path="Games:ScummVM"
@@ -631,6 +633,7 @@ Some influential environment variables:
CXXFLAGS C++ compiler flags
CPPFLAGS C++ preprocessor flags, e.g. -I if you have
headers in a nonstandard directory
+ ASFLAGS assembler flags
EOF
exit 0
@@ -638,6 +641,7 @@ EOF
done # for parm in ...
DEBFLAGS="-g"
+DEBFLAGS_AS="-g"
for ac_option in $@; do
case "$ac_option" in
@@ -731,6 +735,7 @@ for ac_option in $@; do
;;
--disable-debug)
DEBFLAGS=""
+ DEBFLAGS_AS=""
;;
--enable-Werror)
CXXFLAGS="$CXXFLAGS -Werror"
@@ -790,6 +795,7 @@ for ac_option in $@; do
done;
CXXFLAGS="$CXXFLAGS $DEBFLAGS"
+ASFLAGS="$ASFLAGS $DEBFLAGS_AS"
guessed_host=`$_srcdir/config.guess`
get_system_exe_extension $guessed_host
@@ -886,6 +892,13 @@ esac
if test -z "$_host_alias"; then
_host_alias="$_host_cpu-$_host_os"
+else
+ # if _host_alias was set, default to the standard GNU tools
+ _ranlib=$_host_alias-ranlib
+ _strip=$_host_alias-strip
+ _ar="$_host_alias-ar cru"
+ _as="$_host_alias-as"
+ _windres=$_host_alias-windres
fi
#
@@ -1236,6 +1249,7 @@ if test -n "$_host"; then
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
DEFINES="$DEFINES -DUNIX -DMOTOEZX -DUSE_ARM_SMUSH_ASM"
#not true for all ARM systems, but the interesting ones are all LE. Most (if not all) BE arm devices don't have a screen
+ ASFLAGS="$ASFLAGS -mfpu=vfp"
_endian=little
_need_memalign=yes
type_1_byte='char'
@@ -1243,16 +1257,13 @@ if test -n "$_host"; then
type_4_byte='int'
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
- _ar="$_host_alias-ar cru"
- _as="$_host_alias-as -mfpu=vfp"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
_backend="linuxmoto"
;;
motomagx)
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
DEFINES="$DEFINES -DUNIX -DMOTOMAGX -DUSE_ARM_SMUSH_ASM"
#not true for all ARM systems, but the interesting ones are all LE. Most (if not all) BE arm devices don't have a screen
+ ASFLAGS="$ASFLAGS -mfpu=vfp"
_endian=little
_need_memalign=yes
type_1_byte='char'
@@ -1260,10 +1271,6 @@ if test -n "$_host"; then
type_4_byte='int'
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
- _ar="$_host_alias-ar cru"
- _as="$_host_alias-as -mfpu=vfp"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
_backend="linuxmoto"
;;
bfin*)
@@ -1283,8 +1290,6 @@ if test -n "$_host"; then
type_1_byte='char'
type_2_byte='short'
type_4_byte='int'
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
add_line_to_config_mk 'USE_ARM_GFX_ASM = 1'
@@ -1298,14 +1303,13 @@ if test -n "$_host"; then
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
DEFINES="$DEFINES -DUNIX -DGP2X -DNDEBUG -DUSE_ARM_SMUSH_ASM -DUSE_ARM_GFX_ASM -DUSE_ARM_SCALER_ASM -DUSE_ARM_COSTUME_ASM"
CXXFLAGS="$CXXFLAGS -march=armv4t"
+ ASFLAGS="$ASFLAGS -mfloat-abi=soft"
LDFLAGS="$LDFLAGS -static"
_endian=little
_need_memalign=yes
type_1_byte='char'
type_2_byte='short'
type_4_byte='int'
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
add_line_to_config_mk 'USE_ARM_GFX_ASM = 1'
@@ -1370,9 +1374,6 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
_backend="iphone"
_build_hq_scalers="no"
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
;;
wince)
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
@@ -1389,10 +1390,6 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_COSTUME_ASM = 1'
add_line_to_config_mk 'USE_ARM_SCALER_ASM = 1'
_backend="wince"
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
- _windres=$_host_alias-windres
_mt32emu="no"
add_line_to_config_mk 'include $(srcdir)/backends/platform/wince/wince.mk'
;;
@@ -1410,8 +1407,6 @@ if test -n "$_host"; then
_build_hq_scalers="no"
_mad="yes"
_zlib="yes"
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
add_line_to_config_mk 'include $(srcdir)/backends/platform/dc/dreamcast.mk'
;;
wii)
@@ -1421,9 +1416,6 @@ if test -n "$_host"; then
type_1_byte='char'
type_2_byte='short'
type_4_byte='int'
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
_backend="wii"
_build_hq_scalers="no"
add_line_to_config_mk 'GAMECUBE = 0'
@@ -1441,9 +1433,6 @@ if test -n "$_host"; then
type_1_byte='char'
type_2_byte='short'
type_4_byte='int'
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
_backend="wii"
_build_hq_scalers="no"
_mt32emu="no"
@@ -1479,9 +1468,6 @@ if test -n "$_host"; then
type_1_byte='char'
type_2_byte='short'
type_4_byte='int'
- _ar="$_host_alias-ar cru"
- _ranlib=$_host_alias-ranlib
- _strip=$_host_alias-strip
_backend="psp"
_build_scalers="no"
_build_hq_scalers="no"
@@ -2343,6 +2329,7 @@ RANLIB := $_ranlib
STRIP := $_strip
AR := $_ar
AS := $_as
+ASFLAGS := $ASFLAGS
WINDRES := $_windres
WIN32PATH=$_win32path
AOS4PATH=$_aos4path
@@ -2375,6 +2362,7 @@ SAVED_LDFLAGS := $SAVED_LDFLAGS
SAVED_CXX := $SAVED_CXX
SAVED_CXXFLAGS := $SAVED_CXXFLAGS
SAVED_CPPFLAGS := $SAVED_CPPFLAGS
+SAVED_ASFLAGS := $SAVED_ASFLAGS
EOF
#
--
cgit v1.2.3
From 5f0e495a4a6df9a5f299a2c156ed84eba7f3c814 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sat, 22 Aug 2009 17:20:55 +0000
Subject: Removed unused var
svn-id: r43659
---
backends/platform/wii/osystem_gfx.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index ed10a407dd..b0e3f112c1 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -200,8 +200,6 @@ void OSystem_Wii::initSize(uint width, uint height,
if(_gamePixels)
free(_gamePixels);
- size_t bufsize;
-
#ifdef USE_RGB_COLOR
_gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight *
_screenPF.bytesPerPixel);
--
cgit v1.2.3
From 0ef33c86d557857cd80d376befdc9cf517012eff Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Sat, 22 Aug 2009 22:41:31 +0000
Subject: Attempt to remove some warnings in the wince build that occur on the
buildbot's version of gcc (5.1) but don't occur on my local copy (4.1.0).
svn-id: r43661
---
backends/platform/wince/CEScaler.cpp | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp
index d26db3190f..a7910cbdcc 100644
--- a/backends/platform/wince/CEScaler.cpp
+++ b/backends/platform/wince/CEScaler.cpp
@@ -28,18 +28,17 @@
template
void PocketPCPortraitTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *work;
- int i;
while (height--) {
- i = 0;
work = dstPtr;
for (int i=0; i(color1, color2);
*(((uint16 *)work) + 1) = interpolate32_1_1(color2, color3);
@@ -65,7 +64,8 @@ void PocketPCLandscapeAspect(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr
int i,j;
unsigned int p1, p2;
- uint8 *inbuf, *outbuf, *instart, *outstart;
+ const uint8 *inbuf, *instart;
+ uint8 *outbuf, *outstart;
#define RB(x) ((x & RBM)<<8)
#define G(x) ((x & GM)<<3)
@@ -77,7 +77,7 @@ void PocketPCLandscapeAspect(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr
#define MAKEPIXEL(rb,g) ((((rb)>>8) & RBM | ((g)>>3) & GM))
- inbuf = (uint8 *)srcPtr;
+ inbuf = (const uint8 *)srcPtr;
outbuf = (uint8 *)dstPtr;
height /= 5;
@@ -86,22 +86,22 @@ void PocketPCLandscapeAspect(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr
outstart = outbuf;
for (j=0; j < width; j++) {
- p1 = *(uint16*)inbuf; inbuf += srcPitch;
+ p1 = *(const uint16*)inbuf; inbuf += srcPitch;
*(uint16*)outbuf = p1; outbuf += dstPitch;
- p2 = *(uint16*)inbuf; inbuf += srcPitch;
+ p2 = *(const uint16*)inbuf; inbuf += srcPitch;
*(uint16*)outbuf = MAKEPIXEL(P20(RB(p1))+P80(RB(p2)),P20(G(p1))+P80(G(p2))); outbuf += dstPitch;
p1 = p2;
- p2 = *(uint16*)inbuf; inbuf += srcPitch;
+ p2 = *(const uint16*)inbuf; inbuf += srcPitch;
*(uint16*)outbuf = MAKEPIXEL(P40(RB(p1))+P60(RB(p2)),P40(G(p1))+P60(G(p2))); outbuf += dstPitch;
p1 = p2;
- p2 = *(uint16*)inbuf; inbuf += srcPitch;
+ p2 = *(const uint16*)inbuf; inbuf += srcPitch;
*(uint16*)outbuf = MAKEPIXEL(P60(RB(p1))+P40(RB(p2)),P60(G(p1))+P40(G(p2))); outbuf += dstPitch;
p1 = p2;
- p2 = *(uint16*)inbuf;
+ p2 = *(const uint16*)inbuf;
*(uint16*)outbuf = MAKEPIXEL(P80(RB(p1))+P20(RB(p2)),P80(G(p1))+P20(G(p2))); outbuf += dstPitch;
*(uint16*)outbuf = p2;
@@ -127,11 +127,9 @@ extern "C" {
template
void PocketPCHalfTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *work;
- int i;
uint16 srcPitch16 = (uint16)(srcPitch / sizeof(uint16));
while ((height -= 2) >= 0) {
- i = 0;
work = dstPtr;
for (int i=0; i
void PocketPCHalfZoomTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *work;
- int i;
- uint16 srcPitch16 = (uint16)(srcPitch / sizeof(uint16));
if (!height)
return;
while (height--) {
- i = 0;
work = dstPtr;
for (int i = 0; i < width; i += 2) {
@@ -190,11 +185,9 @@ MAKE_WRAPPER(PocketPCHalfZoom)
template
void SmartphoneLandscapeTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *work;
- int i;
int line = 0;
while (height--) {
- i = 0;
work = dstPtr;
for (int i = 0; i < width; i += 3) {
--
cgit v1.2.3
From 4a33ef34a347568008d0d0da01e1fc4af360460f Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Sat, 22 Aug 2009 23:00:08 +0000
Subject: Eliminate more warnings for buildbot.
svn-id: r43662
---
backends/platform/wince/CEScaler.cpp | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp
index a7910cbdcc..517c86e3b9 100644
--- a/backends/platform/wince/CEScaler.cpp
+++ b/backends/platform/wince/CEScaler.cpp
@@ -27,24 +27,25 @@
template
void PocketPCPortraitTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
- uint8 *work;
+ uint16 *work;
+ // Various casts below go via (void *) to avoid warning. This is
+ // safe as these are all even addresses.
while (height--) {
- work = dstPtr;
+ work = (uint16 *)(void *)dstPtr;
for (int i=0; i(color1, color2);
- *(((uint16 *)work) + 1) = interpolate32_1_1(color2, color3);
- *(((uint16 *)work) + 2) = interpolate32_3_1(color4, color3);
+ work[0] = interpolate32_3_1(color1, color2);
+ work[1] = interpolate32_1_1(color2, color3);
+ work[2] = interpolate32_3_1(color4, color3);
- work += 3 * sizeof(uint16);
+ work += 3;
}
srcPtr += srcPitch;
dstPtr += dstPitch;
@@ -161,20 +162,20 @@ void PocketPCHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 ds
template
void PocketPCHalfZoomTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
- uint8 *work;
+ uint16 *work;
if (!height)
return;
+ // Various casts below go via (void *) to avoid warning. This is
+ // safe as these are all even addresses.
while (height--) {
- work = dstPtr;
+ work = (uint16 *)(void *)dstPtr;
for (int i = 0; i < width; i += 2) {
- uint16 color1 = *(((const uint16 *)srcPtr) + i);
- uint16 color2 = *(((const uint16 *)srcPtr) + (i + 1));
- *(((uint16 *)work) + 0) = interpolate32_1_1(color1, color2);
-
- work += sizeof(uint16);
+ uint16 color1 = *(((const uint16 *)(const void *)srcPtr) + i);
+ uint16 color2 = *(((const uint16 *)(const void *)srcPtr) + (i + 1));
+ *work++ = interpolate32_1_1(color1, color2);
}
srcPtr += srcPitch;
dstPtr += dstPitch;
--
cgit v1.2.3
From cef52305951b99d49f71c6f8d410d09db73e726d Mon Sep 17 00:00:00 2001
From: Robin Watts
Date: Sat, 22 Aug 2009 23:09:43 +0000
Subject: Remove more warnings from wince build.
svn-id: r43663
---
backends/platform/wince/CEScaler.cpp | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp
index 517c86e3b9..0a71fda167 100644
--- a/backends/platform/wince/CEScaler.cpp
+++ b/backends/platform/wince/CEScaler.cpp
@@ -82,30 +82,32 @@ void PocketPCLandscapeAspect(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr
outbuf = (uint8 *)dstPtr;
height /= 5;
+ // Various casts below go via (void *) to avoid warning. This is
+ // safe as these are all even addresses.
for (i = 0; i < height; i++) {
instart = inbuf;
outstart = outbuf;
for (j=0; j < width; j++) {
- p1 = *(const uint16*)inbuf; inbuf += srcPitch;
- *(uint16*)outbuf = p1; outbuf += dstPitch;
+ p1 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+ *(uint16*)(void *)outbuf = p1; outbuf += dstPitch;
- p2 = *(const uint16*)inbuf; inbuf += srcPitch;
- *(uint16*)outbuf = MAKEPIXEL(P20(RB(p1))+P80(RB(p2)),P20(G(p1))+P80(G(p2))); outbuf += dstPitch;
+ p2 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+ *(uint16*)(void *)outbuf = MAKEPIXEL(P20(RB(p1))+P80(RB(p2)),P20(G(p1))+P80(G(p2))); outbuf += dstPitch;
p1 = p2;
- p2 = *(const uint16*)inbuf; inbuf += srcPitch;
- *(uint16*)outbuf = MAKEPIXEL(P40(RB(p1))+P60(RB(p2)),P40(G(p1))+P60(G(p2))); outbuf += dstPitch;
+ p2 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+ *(uint16*)(void *)outbuf = MAKEPIXEL(P40(RB(p1))+P60(RB(p2)),P40(G(p1))+P60(G(p2))); outbuf += dstPitch;
p1 = p2;
- p2 = *(const uint16*)inbuf; inbuf += srcPitch;
- *(uint16*)outbuf = MAKEPIXEL(P60(RB(p1))+P40(RB(p2)),P60(G(p1))+P40(G(p2))); outbuf += dstPitch;
+ p2 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+ *(uint16*)(void *)outbuf = MAKEPIXEL(P60(RB(p1))+P40(RB(p2)),P60(G(p1))+P40(G(p2))); outbuf += dstPitch;
p1 = p2;
- p2 = *(const uint16*)inbuf;
- *(uint16*)outbuf = MAKEPIXEL(P80(RB(p1))+P20(RB(p2)),P80(G(p1))+P20(G(p2))); outbuf += dstPitch;
+ p2 = *(const uint16*)(const void *)inbuf;
+ *(uint16*)(void *)outbuf = MAKEPIXEL(P80(RB(p1))+P20(RB(p2)),P80(G(p1))+P20(G(p2))); outbuf += dstPitch;
- *(uint16*)outbuf = p2;
+ *(uint16*)(void *)outbuf = p2;
inbuf = inbuf - srcPitch*4 + sizeof(uint16);
outbuf = outbuf - dstPitch*5 + sizeof(uint16);
--
cgit v1.2.3
From 40f1deae3ae607dcb8c0bdc63dbec180e60a2b05 Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Sun, 23 Aug 2009 09:57:47 +0000
Subject: Properly initialize _autoDouble, fixing demos that don't set a video
mode on their own (like the Inca II (bat)demo)
svn-id: r43665
---
engines/gob/demos/demoplayer.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp
index 13b7aa5327..bb56633525 100644
--- a/engines/gob/demos/demoplayer.cpp
+++ b/engines/gob/demos/demoplayer.cpp
@@ -56,6 +56,7 @@ DemoPlayer::Script DemoPlayer::_scripts[] = {
};
DemoPlayer::DemoPlayer(GobEngine *vm) : _vm(vm) {
+ _autoDouble = false;
_doubleMode = false;
_rebase0 = false;
}
--
cgit v1.2.3
From 4ff0c2619b87658c762eac19afe85ac01530c5c1 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Sun, 23 Aug 2009 14:51:04 +0000
Subject: Fix Moonbase Commander startup.
svn-id: r43670
---
engines/scumm/he/script_v100he.cpp | 1 +
engines/scumm/he/script_v72he.cpp | 12 ++++++------
engines/scumm/vars.cpp | 1 +
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 49e490a8ec..29f611a58f 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -629,6 +629,7 @@ void ScummEngine_v100he::o100_arrayOps() {
}
break;
case 132:
+ debug(0, "o100_arrayOps: case 132");
// TODO: Used by Moonbase Commander
fetchScriptWord();
fetchScriptWord();
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 0c2c01d419..3dd70a09c9 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1398,11 +1398,6 @@ void ScummEngine_v72he::o72_openFile() {
copyScriptString(buffer, sizeof(buffer));
debug(1, "Original filename %s", buffer);
- // HACK: INI filename seems to get reset, corruption elsewhere?
- if (_game.id == GID_MOONBASE && buffer[0] == 0) {
- strcpy((char *)buffer, "moonbase.ini");
- }
-
const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
debug(1, "Final filename to %s", filename);
@@ -1823,7 +1818,12 @@ void ScummEngine_v72he::o72_readINI() {
case 77: // HE 100
case 7: // string
writeVar(0, 0);
- if (!strcmp((char *)option, "SaveGamePath")) {
+ if (!strcmp((char *)option, "HE3File")) {
+ Common::String fileName = generateFilename(-3);
+ int len = resStrLen((const byte *)fileName.c_str());
+ data = defineArray(0, kStringArray, 0, 0, 0, len);
+ memcpy(data, fileName.c_str(), len);
+ } else if (!strcmp((char *)option, "SaveGamePath")) {
// We set SaveGamePath in order to detect where it used
// in convertFilePath and to avoid warning about invalid
// path in Macintosh verisons.
diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp
index 98e088365e..69da7f3e09 100644
--- a/engines/scumm/vars.cpp
+++ b/engines/scumm/vars.cpp
@@ -312,6 +312,7 @@ void ScummEngine_v80he::setupScummVars() {
void ScummEngine_v90he::setupScummVars() {
ScummEngine_v80he::setupScummVars();
+ VAR_TIMER = 97;
VAR_SCRIPT_CYCLE = 103;
VAR_NUM_SCRIPT_CYCLES = 104;
--
cgit v1.2.3
From 24a9dc848098dae2124456de239e9ec63a31471e Mon Sep 17 00:00:00 2001
From: Scott Thomas
Date: Sun, 23 Aug 2009 14:54:56 +0000
Subject: T7G: Load VDX frame chunks into a MemoryStream rather than streaming
straight from disk (Fix #2839528)
svn-id: r43671
---
engines/groovie/vdx.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp
index bee84b4adb..0bc6acb1c0 100644
--- a/engines/groovie/vdx.cpp
+++ b/engines/groovie/vdx.cpp
@@ -118,6 +118,7 @@ uint16 VDXPlayer::loadInternal() {
bool VDXPlayer::playFrameInternal() {
byte currRes = 0x80;
+ Common::ReadStream *vdxData = 0;
while (!_file->eos() && currRes == 0x80) {
currRes = _file->readByte();
@@ -130,7 +131,9 @@ bool VDXPlayer::playFrameInternal() {
uint8 lengthbits = _file->readByte();
// Read the chunk data and decompress if needed
- Common::ReadStream *vdxData = new Common::SubReadStream(_file, compSize);
+ if (compSize)
+ vdxData = _file->readStream(compSize);
+
if (lengthmask && lengthbits) {
Common::ReadStream *decompData = new LzssReadStream(vdxData, lengthmask, lengthbits);
delete vdxData;
@@ -157,7 +160,9 @@ bool VDXPlayer::playFrameInternal() {
default:
error("Groovie::VDX: Invalid resource type: %d", currRes);
}
- delete vdxData;
+ if (vdxData)
+ delete vdxData;
+ vdxData = 0;
}
// Wait until the current frame can be shown
--
cgit v1.2.3
From cf7116710bd2703e91ebc517274f7038c68fce5b Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sun, 23 Aug 2009 20:27:44 +0000
Subject: Removed -g from the default ASFLAGS, since older GNU as versions do
not support it.
svn-id: r43674
---
configure | 3 ---
1 file changed, 3 deletions(-)
diff --git a/configure b/configure
index bd5b8b159b..67bb417fbd 100755
--- a/configure
+++ b/configure
@@ -641,7 +641,6 @@ EOF
done # for parm in ...
DEBFLAGS="-g"
-DEBFLAGS_AS="-g"
for ac_option in $@; do
case "$ac_option" in
@@ -735,7 +734,6 @@ for ac_option in $@; do
;;
--disable-debug)
DEBFLAGS=""
- DEBFLAGS_AS=""
;;
--enable-Werror)
CXXFLAGS="$CXXFLAGS -Werror"
@@ -795,7 +793,6 @@ for ac_option in $@; do
done;
CXXFLAGS="$CXXFLAGS $DEBFLAGS"
-ASFLAGS="$ASFLAGS $DEBFLAGS_AS"
guessed_host=`$_srcdir/config.guess`
get_system_exe_extension $guessed_host
--
cgit v1.2.3
From 080eaef76cb4051802a41c58155f7bb004ab9d1a Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sun, 23 Aug 2009 20:40:09 +0000
Subject: Formatting
svn-id: r43675
---
backends/platform/linuxmoto/hardwarekeys.cpp | 34 ++++++++---------
backends/platform/linuxmoto/linuxmoto-events.cpp | 48 ++++++++++++------------
2 files changed, 42 insertions(+), 40 deletions(-)
diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp
index 2f64e7dbae..e65d2bec2b 100644
--- a/backends/platform/linuxmoto/hardwarekeys.cpp
+++ b/backends/platform/linuxmoto/hardwarekeys.cpp
@@ -42,23 +42,23 @@ struct Key {
};
static const Key keys[] = {
- {"FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", kActionKeyType, false},
- {"CAMERA", KEYCODE_PAUSE, 0, "Camera", kActionKeyType, false},
- {"HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", kStartKeyType, false},
- {"CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", kActionKeyType, false},
- {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false},
- {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false},
-
- {"a", KEYCODE_a, 'a', "a", kActionKeyType, true},
- {"b", KEYCODE_b, 'b', "b", kActionKeyType, true},
- {"c", KEYCODE_c, 'c', "c", kActionKeyType, true},
- {"d", KEYCODE_d, 'd', "d", kActionKeyType, true},
- {"e", KEYCODE_e, 'e', "e", kActionKeyType, true},
- {"f", KEYCODE_f, 'f', "f", kActionKeyType, true},
- {"g", KEYCODE_g, 'g', "g", kActionKeyType, true},
- {"h", KEYCODE_h, 'h', "h", kActionKeyType, true},
- {"i", KEYCODE_i, 'i', "i", kActionKeyType, true},
- {"j", KEYCODE_j, 'j', "j", kActionKeyType, true},
+ { "FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", kActionKeyType, false },
+ { "CAMERA", KEYCODE_PAUSE, 0, "Camera", kActionKeyType, false },
+ { "HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", kStartKeyType, false },
+ { "CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", kActionKeyType, false },
+ { "PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false },
+ { "MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false },
+
+ { "a", KEYCODE_a, 'a', "a", kActionKeyType, true },
+ { "b", KEYCODE_b, 'b', "b", kActionKeyType, true },
+ { "c", KEYCODE_c, 'c', "c", kActionKeyType, true },
+ { "d", KEYCODE_d, 'd', "d", kActionKeyType, true },
+ { "e", KEYCODE_e, 'e', "e", kActionKeyType, true },
+ { "f", KEYCODE_f, 'f', "f", kActionKeyType, true },
+ { "g", KEYCODE_g, 'g', "g", kActionKeyType, true },
+ { "h", KEYCODE_h, 'h', "h", kActionKeyType, true },
+ { "i", KEYCODE_i, 'i', "i", kActionKeyType, true },
+ { "j", KEYCODE_j, 'j', "j", kActionKeyType, true },
// Numeric keypad
diff --git a/backends/platform/linuxmoto/linuxmoto-events.cpp b/backends/platform/linuxmoto/linuxmoto-events.cpp
index 2a40d734b0..be5eec5c7e 100644
--- a/backends/platform/linuxmoto/linuxmoto-events.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-events.cpp
@@ -53,20 +53,20 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
}
// '1' Bypass security protection - MOD+Call key
- if (ev.key.keysym.sym == SDLK_f) {
- ev.key.keysym.sym=SDLK_1;
+ if (ev.key.keysym.sym == SDLK_f) {
+ ev.key.keysym.sym = SDLK_1;
}
// F5 Game Menu - Call key
else if (ev.key.keysym.sym == SDLK_SPACE) {
- ev.key.keysym.sym=SDLK_F5;
+ ev.key.keysym.sym = SDLK_F5;
}
// Camera to VirtualKeyboard
else if (ev.key.keysym.sym == SDLK_PAUSE) {
- ev.key.keysym.sym=SDLK_F7;
+ ev.key.keysym.sym = SDLK_F7;
}
// mod+fire to enter
else if (ev.key.keysym.sym == SDLK_b) {
- ev.key.keysym.sym=SDLK_RETURN;
+ ev.key.keysym.sym = SDLK_RETURN;
}
#endif
// Motorola Z6/V8 remapkey by Ant-On
@@ -78,17 +78,17 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
} else
// F5 Game Menu - Call key
if (ev.key.keysym.sym == SDLK_SPACE) {
- ev.key.keysym.sym=SDLK_F5;
+ ev.key.keysym.sym = SDLK_F5;
}
// 'y' - Mod+Right key
// 'y' - Left soft
else if (ev.key.keysym.sym == SDLK_F9) {
- ev.key.keysym.sym=SDLK_y;
+ ev.key.keysym.sym = SDLK_y;
}
// 'n' - Mod+Left key
// 'n' - rigth soft
else if (ev.key.keysym.sym == SDLK_F11) {
- ev.key.keysym.sym=SDLK_n;
+ ev.key.keysym.sym = SDLK_n;
}
#endif
@@ -116,6 +116,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
+
return true;
} else if (ev.key.keysym.sym == SDLK_DOWN) {
if (ev.type == SDL_KEYDOWN) {
@@ -128,6 +129,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
+
return true;
} else if (ev.key.keysym.sym == SDLK_UP) {
if (ev.type == SDL_KEYDOWN) {
@@ -140,47 +142,47 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
+
return true;
- }
- // Joystick center to pressing Left Mouse
- else if (ev.key.keysym.sym == SDLK_RETURN) {
+ } else if (ev.key.keysym.sym == SDLK_RETURN) { // Joystick center to pressing Left Mouse
// _km.y_vel = 0;
// _km.y_down_count = 0;
if (ev.key.type == SDL_KEYDOWN) {
event.type = Common::EVENT_LBUTTONDOWN;
} else {
- event.type = Common::EVENT_LBUTTONUP;
+ event.type = Common::EVENT_LBUTTONUP;
}
+
fillMouseEvent(event, _km.x, _km.y);
+
return true;
- }
- // Volume Up to pressing Right Mouse
- else if (ev.key.keysym.sym == SDLK_PLUS) {
+ } else if (ev.key.keysym.sym == SDLK_PLUS) { // Volume Up to pressing Right Mouse
// _km.y_vel = 0;
// _km.y_down_count = 0;
if (ev.key.type == SDL_KEYDOWN ) {
event.type = Common::EVENT_RBUTTONDOWN;
} else {
- event.type = Common::EVENT_RBUTTONUP;
+ event.type = Common::EVENT_RBUTTONUP;
}
fillMouseEvent(event, _km.x, _km.y);
+
return true;
- }
- // Volume Down to pressing Left Mouse
- else if (ev.key.keysym.sym == SDLK_MINUS) {
+ } else if (ev.key.keysym.sym == SDLK_MINUS) { // Volume Down to pressing Left Mouse
//_km.y_vel = 0;
//_km.y_down_count = 0;
if (ev.key.type == SDL_KEYDOWN) {
event.type = Common::EVENT_LBUTTONDOWN;
} else {
- event.type = Common::EVENT_LBUTTONUP;
+ event.type = Common::EVENT_LBUTTONUP;
}
+
fillMouseEvent(event, _km.x, _km.y);
+
return true;
} else {
- // Let the events fall through if we didn't change them, this may not be the best way to
- // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
- // and yes i have an huge terminal size so i dont wrap soon enough.
+ // Let the events fall through if we didn't change them, this may not be the best way to
+ // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
+ // and yes i have an huge terminal size so i dont wrap soon enough.
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
--
cgit v1.2.3
From e858994060118b0d21bbb18d3cfe59fb10f4399d Mon Sep 17 00:00:00 2001
From: Matthew Hoops
Date: Sun, 23 Aug 2009 21:15:47 +0000
Subject: Fix bug #2843050 (RTZ: Crash to desktop with demo). Don't assert out
when a resource slot can't be found.
svn-id: r43676
---
engines/made/resource.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index c7d15dae73..72aa006c68 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -525,7 +525,10 @@ bool ResourceReader::loadResource(ResourceSlot *slot, byte *&buffer, uint32 &siz
ResourceSlot *ResourceReader::getResourceSlot(uint32 resType, uint index) {
ResourceSlots *slots = _resSlots[resType];
- assert(slots);
+
+ if (!slots)
+ return NULL;
+
if (index >= 1 && index < slots->size()) {
return &(*slots)[index];
} else {
--
cgit v1.2.3
From 60af2db2fdd8c0ca0d597033798bdf4b4efa4938 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Sun, 23 Aug 2009 21:57:30 +0000
Subject: - Added more mappings from Sierra's internal IDs to our own ones.
Hopefully, all SCI0-SCI11 games can now be detected correctly from the
fallback detector - Simplified some checks for old script types
svn-id: r43678
---
engines/sci/detection.cpp | 69 +++++++++++++++++++++++----------
engines/sci/engine/game.cpp | 4 +-
engines/sci/engine/kernel.cpp | 5 +--
engines/sci/engine/kernel.h | 4 +-
engines/sci/engine/savegame.cpp | 2 +-
engines/sci/engine/seg_manager.cpp | 9 ++---
engines/sci/engine/seg_manager.h | 3 +-
engines/sci/engine/static_selectors.cpp | 8 ++--
engines/sci/engine/vm.cpp | 6 +--
engines/sci/engine/vm.h | 2 +-
10 files changed, 67 insertions(+), 45 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index d41e1fa0b3..f60e42ddde 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -2412,7 +2412,18 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
0
},
+#endif
+
+ // Slater & Charlie go camping
+ {{"slater", "", {
+ {"resource.000", 0, "1846b57fe84774be72f7c50ab3c90df0", 2256126},
+ {"resource.map", 0, "21f85414124dc23e54544a5536dc35cd", 4044},
+ {"resource.msg", 0, "c44f51fb955eae266fecf360ebcd5ad2", 1132},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+#ifdef ENABLE_SCI32
// RAMA - English DOS/Windows Demo
// Executable scanning reports "2.100.002", VERSION file reports "000.000.008"
{{"rama", "Demo", {
@@ -3045,15 +3056,20 @@ public:
Common::String convertSierraGameId(Common::String sierraId) {
// TODO: SCI32 IDs
- // TODO: astrochicken
- // TODO: The internal id of christmas1998 is "demo"
- if (sierraId == "card")
- return "christmas1990";
- // TODO: christmas1992
+ // TODO: The internal id of christmas1988 is "demo"
+ if (sierraId == "card") {
+ // This could either be christmas1990 or christmas1992
+ // christmas1990 has a "resource.001" file, whereas
+ // christmas1992 has a "resource.000" file
+ return (Common::File::exists("resource.001")) ? "christmas1990" : "christmas1992";
+ }
if (sierraId == "arthur")
return "camelot";
- if (sierraId == "brain")
- return "castlebrain";
+ if (sierraId == "brain") {
+ // This could either be The Castle of Dr. Brain, or The Island of Dr. Brain
+ // castlebrain has resource.001, whereas islandbrain doesn't
+ return (Common::File::exists("resource.001")) ? "castlebrain" : "islandbrain";
+ }
// iceman is the same
// longbow is the same
if (sierraId == "eco")
@@ -3068,8 +3084,8 @@ Common::String convertSierraGameId(Common::String sierraId) {
return "hoyle1";
if (sierraId == "solitare")
return "hoyle2";
- // TODO: hoyle3
- // TODO: hoyle4
+ // hoyle3 is the same
+ // hoyle4 is the same
if (sierraId == "kq1")
return "kq1sci";
if (sierraId == "kq4")
@@ -3081,9 +3097,10 @@ Common::String convertSierraGameId(Common::String sierraId) {
// lsl5 is the same
// lsl6 is the same
// TODO: lslcasino
- // TODO: fairytales
- // TODO: mothergoose
- // TODO: msastrochicken
+ if (sierraId == "tales")
+ return "fairytales";
+ if (sierraId == "mg")
+ return "mothergoose";
if (sierraId == "cb1")
return "laurabow";
if (sierraId == "lb2")
@@ -3102,13 +3119,27 @@ Common::String convertSierraGameId(Common::String sierraId) {
return "qfg2";
if (sierraId == "qfg1")
return "qfg3";
- // TODO: slater
+ if (sierraId == "thegame")
+ return "slater";
if (sierraId == "sq1")
return "sq1sci";
- // sq3 is the same
+ if (sierraId == "sq3") {
+ // Both SQ3 and the separately released subgame, Astro Chicken,
+ // have internal ID "sq3", but Astro Chicken only has "resource.map"
+ // and "resource.001". Detect if it's SQ3 by the existence of
+ // "resource.002"
+ return (Common::File::exists("resource.002")) ? "sq3" : "astrochicken";
+ }
+ if (sierraId == "sq4") {
+ // Both SQ4 and the separately released subgame, Ms. Astro Chicken,
+ // have internal ID "sq4", but Astro Chicken only has "resource.map"
+ // and "resource.001". Detect if it's SQ4 by the existence of
+ // "resource.000" (which exists in both SQ4 floppy and CD, but not in
+ // the subgame)
+ return (Common::File::exists("resource.000")) ? "sq4" : "msastrochicken";
+ }
// sq4 is the same
// sq5 is the same
- // TODO: islandbrain
return sierraId;
}
@@ -3185,12 +3216,8 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
// Determine the game id
ResourceManager *resMgr = new ResourceManager(fslist);
SciVersion version = resMgr->sciVersion();
- Kernel *kernel = new Kernel(resMgr, true);
- bool hasOldScriptHeader = kernel->hasOldScriptHeader();
- delete kernel;
-
- SegManager *segManager = new SegManager(resMgr, version, hasOldScriptHeader);
- if (!script_instantiate(resMgr, segManager, version, hasOldScriptHeader, 0)) {
+ SegManager *segManager = new SegManager(resMgr, version);
+ if (!script_instantiate(resMgr, segManager, version, 0)) {
warning("fallbackDetect(): Could not instantiate script 0");
SearchMan.remove("SCI_detection");
return 0;
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index f649d97412..994054f6a7 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -191,7 +191,7 @@ int game_init_sound(EngineState *s, int sound_flags) {
// Architectural stuff: Init/Unintialize engine
int script_init_engine(EngineState *s) {
s->kernel_opt_flags = 0;
- s->seg_manager = new SegManager(s->resmgr, s->_version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader());
+ s->seg_manager = new SegManager(s->resmgr, s->_version);
s->gc_countdown = GC_INTERVAL - 1;
SegmentId script_000_segment = s->seg_manager->getSegment(0, SCRIPT_GET_LOCK);
@@ -294,7 +294,7 @@ int game_init(EngineState *s) {
s->stack_base = stack->entries;
s->stack_top = s->stack_base + VM_STACK_SIZE;
- if (!script_instantiate(s->resmgr, s->seg_manager, s->_version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader(), 0)) {
+ if (!script_instantiate(s->resmgr, s->seg_manager, s->_version, 0)) {
warning("game_init(): Could not instantiate script 0");
return 1;
}
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index a871df936f..687e621405 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -363,15 +363,12 @@ static const char *argtype_description[] = {
"Arithmetic"
};
-Kernel::Kernel(ResourceManager *resmgr, bool minimalLoad) : _resmgr(resmgr) {
+Kernel::Kernel(ResourceManager *resmgr) : _resmgr(resmgr) {
memset(&_selectorMap, 0, sizeof(_selectorMap)); // FIXME: Remove this once/if we C++ify selector_map_t
loadSelectorNames();
detectSciFeatures();
- if (minimalLoad) // If we're only asked to detect game features, stop here
- return;
-
mapSelectors(); // Map a few special selectors for later use
loadOpcodes();
loadKernelNames();
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 997cdaea77..a85025f514 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -67,10 +67,8 @@ class Kernel {
public:
/**
* Initializes the SCI kernel
- * @param minimalLoad If true, only the selector names are loaded, to detect game features.
- * It's set to true by the advanced game detector to speed it up
*/
- Kernel(ResourceManager *resmgr, bool minimalLoad = false);
+ Kernel(ResourceManager *resmgr);
~Kernel();
uint getOpcodesSize() const { return _opcodes.size(); }
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 0ddb5187ac..b53e9d522c 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -219,7 +219,7 @@ static void sync_SegManagerPtr(Common::Serializer &s, SegManager *&obj) {
if (s.isLoading()) {
// FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch.
delete obj;
- obj = new SegManager(resMgr, version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader());
+ obj = new SegManager(resMgr, version);
}
obj->saveLoadWithSerializer(s);
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index ddcd639f3c..0c731d449c 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -52,7 +52,7 @@ namespace Sci {
#define INVALID_SCRIPT_ID -1
-SegManager::SegManager(ResourceManager *resMgr, SciVersion version, bool oldScriptHeader) {
+SegManager::SegManager(ResourceManager *resMgr, SciVersion version) {
id_seg_map = new IntMapper();
reserved_id = INVALID_SCRIPT_ID;
id_seg_map->checkKey(reserved_id, true); // reserve entry 0 for INVALID_SCRIPT_ID
@@ -68,7 +68,6 @@ SegManager::SegManager(ResourceManager *resMgr, SciVersion version, bool oldScri
exports_wide = 0;
_version = version;
_resMgr = resMgr;
- _oldScriptHeader = oldScriptHeader;
int result = 0;
@@ -150,7 +149,7 @@ void SegManager::setScriptSize(Script &scr, int script_nr) {
if (!script || (_version >= SCI_VERSION_1_1 && !heap)) {
error("SegManager::setScriptSize: failed to load %s", !script ? "script" : "heap");
}
- if (_oldScriptHeader) {
+ if (_version == SCI_VERSION_0_EARLY) { // check if we got an old script header
scr.buf_size = script->size + READ_LE_UINT16(script->data) * 2;
//locals_size = READ_LE_UINT16(script->data) * 2;
} else if (_version < SCI_VERSION_1_1) {
@@ -445,7 +444,7 @@ SegmentId SegManager::getSegment(int script_nr, SCRIPT_GET load) {
SegmentId segment;
if ((load & SCRIPT_GET_LOAD) == SCRIPT_GET_LOAD)
- script_instantiate(_resMgr, this, _version, _oldScriptHeader, script_nr);
+ script_instantiate(_resMgr, this, _version, script_nr);
segment = segGet(script_nr);
@@ -987,7 +986,7 @@ int SegManager::createSci0ClassTable() {
Resource *script = _resMgr->findResource(ResourceId(kResourceTypeScript, scriptnr), 0);
if (script) {
- if (_oldScriptHeader)
+ if (version == SCI_VERSION_0_EARLY) // check if we got an old script header
magic_offset = seeker = 2;
else
magic_offset = seeker = 0;
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index fcf2659df3..5676990343 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -58,7 +58,7 @@ public:
/**
* Initialize the segment manager
*/
- SegManager(ResourceManager *resMgr, SciVersion version, bool oldScriptHeader);
+ SegManager(ResourceManager *resMgr, SciVersion version);
/**
* Deallocate all memory associated with the segment manager
@@ -342,7 +342,6 @@ public:
private:
IntMapper *id_seg_map; ///< id - script id; seg - index of heap
- bool _oldScriptHeader;
public: // TODO: make private
Common::Array _heap;
int reserved_id;
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index 9c2abbfbc9..1897748c6d 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -499,10 +499,12 @@ static const SelectorRemap lsl5_demo_selectors[] = {
} while (0)
Common::StringList Kernel::checkStaticSelectorNames() {
- Common::String gameID = ((SciEngine*)g_engine)->getGameID();
-
Common::StringList names;
-
+ if (!g_engine)
+ return names;
+
+ Common::String gameID = ((SciEngine*)g_engine)->getGameID();
+
if (gameID == "kq4sci")
USE_SELECTOR_TABLE(kq4_demo_selectors);
else if (gameID == "lsl3" || gameID == "iceman") // identical, except iceman has "flags"
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 943a8e0354..613de69f05 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -208,7 +208,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
Script *scr = s->seg_manager->getScriptIfLoaded(seg);
if (!scr) // Script not present yet?
- seg = script_instantiate(s->resmgr, s->seg_manager, s->_version, ((SciEngine*)g_engine)->getKernel()->hasOldScriptHeader(), script);
+ seg = script_instantiate(s->resmgr, s->seg_manager, s->_version, script);
else
scr->unmarkDeleted();
@@ -1761,11 +1761,11 @@ int script_instantiate_sci11(ResourceManager *resMgr, SegManager *segManager, Sc
return seg_id;
}
-int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, bool oldScriptHeader, int script_nr) {
+int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, int script_nr) {
if (version >= SCI_VERSION_1_1)
return script_instantiate_sci11(resMgr, segManager, version, script_nr);
else
- return script_instantiate_sci0(resMgr, segManager, version, oldScriptHeader, script_nr);
+ return script_instantiate_sci0(resMgr, segManager, version, (version == SCI_VERSION_0_EARLY), script_nr);
}
void script_uninstantiate_sci0(SegManager *segManager, SciVersion version, int script_nr, SegmentId seg) {
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 867f732e2a..c8f94d5446 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -489,7 +489,7 @@ reg_t script_lookup_export(SegManager *segManager, int script_nr, int export_ind
* @param[in] script_nr The script number to load
* @return The script's segment ID or 0 if out of heap
*/
-int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, bool oldScriptHeader, int script_nr);
+int script_instantiate(ResourceManager *resMgr, SegManager *segManager, SciVersion version, int script_nr);
/**
* Decreases the numer of lockers of a script and unloads it if that number
--
cgit v1.2.3
From a041ba4f48ae6a58cc795467c37fabb11bfd4163 Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Sun, 23 Aug 2009 22:51:57 +0000
Subject: Whitespace fix for buildbot
svn-id: r43679
---
backends/platform/linuxmoto/main.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/backends/platform/linuxmoto/main.cpp b/backends/platform/linuxmoto/main.cpp
index 1e37fe617a..7f015faff4 100644
--- a/backends/platform/linuxmoto/main.cpp
+++ b/backends/platform/linuxmoto/main.cpp
@@ -34,7 +34,6 @@
#include "base/internal_version.h"
int main(int argc, char *argv[]) {
-
g_system = new OSystem_LINUXMOTO();
assert(g_system);
// Invoke the actual ScummVM main entry point:
--
cgit v1.2.3
From 7359c8f9682fe42f430b00d729257e78b6e76b1d Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Mon, 24 Aug 2009 01:59:58 +0000
Subject: SCI: Read class table from vocab resource instead of scanning. This
fixes several "invalid selector" VM crashes caused by duplicate classes.
svn-id: r43680
---
engines/sci/engine/seg_manager.cpp | 135 +++----------------------------------
engines/sci/engine/seg_manager.h | 3 +-
engines/sci/engine/vm.cpp | 8 ---
3 files changed, 10 insertions(+), 136 deletions(-)
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 0c731d449c..0c88481125 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -71,10 +71,7 @@ SegManager::SegManager(ResourceManager *resMgr, SciVersion version) {
int result = 0;
- if (version >= SCI_VERSION_1_1)
- result = createSci11ClassTable();
- else
- result = createSci0ClassTable();
+ result = createClassTable();
if (result)
error("SegManager: Failed to initialize class table");
@@ -692,7 +689,6 @@ void SegManager::scriptInitialiseObjectsSci11(SegmentId seg) {
return;
}
- _classtable[species].script = scr->nr;
_classtable[species].reg.segment = seg;
_classtable[species].reg.offset = classpos;
}
@@ -916,137 +912,24 @@ int SegManager::freeDynmem(reg_t addr) {
return 0; // OK
}
-int SegManager::createSci11ClassTable() {
- int scriptnr;
- unsigned int seeker_offset;
- char *seeker_ptr;
- int classnr;
-
+int SegManager::createClassTable() {
Resource *vocab996 = _resMgr->findResource(ResourceId(kResourceTypeVocab, 996), 1);
if (!vocab996)
- _classtable.resize(20);
- else
- _classtable.resize(vocab996->size >> 2);
-
- for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
- Resource *heap = _resMgr->findResource(ResourceId(kResourceTypeHeap, scriptnr), 0);
-
- if (heap) {
- int global_vars = READ_LE_UINT16(heap->data + 2);
-
- seeker_ptr = (char*)heap->data + 4 + global_vars * 2;
- seeker_offset = 4 + global_vars * 2;
+ error("SegManager: failed to open vocab 996");
- while (READ_LE_UINT16((byte*)seeker_ptr) == SCRIPT_OBJECT_MAGIC_NUMBER) {
- if (READ_LE_UINT16((byte*)seeker_ptr + 14) & SCRIPT_INFO_CLASS) {
- classnr = READ_LE_UINT16((byte*)seeker_ptr + 10);
- if (classnr >= (int)_classtable.size()) {
- if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
- warning("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
- classnr, scriptnr, scriptnr, seeker_offset);
- return 1;
- }
+ int totalClasses = vocab996->size >> 2;
+ _classtable.resize(totalClasses);
- _classtable.resize(classnr + 1); // Adjust maximum number of entries
- }
+ for (uint16 classNr = 0; classNr < totalClasses; classNr++) {
+ uint16 scriptNr = READ_LE_UINT16(vocab996->data + classNr * 4 + 2);
- _classtable[classnr].reg.offset = seeker_offset;
- _classtable[classnr].reg.segment = 0;
- _classtable[classnr].script = scriptnr;
- }
-
- seeker_ptr += READ_LE_UINT16((byte*)seeker_ptr + 2) * 2;
- seeker_offset += READ_LE_UINT16((byte*)seeker_ptr + 2) * 2;
- }
- }
+ _classtable[classNr].reg = NULL_REG;
+ _classtable[classNr].script = scriptNr;
}
_resMgr->unlockResource(vocab996);
- vocab996 = NULL;
- return 0;
-}
-int SegManager::createSci0ClassTable() {
- int scriptnr;
- unsigned int seeker;
- int classnr;
- int magic_offset; // For strange scripts in older SCI versions
-
- Resource *vocab996 = _resMgr->findResource(ResourceId(kResourceTypeVocab, 996), 1);
- SciVersion version = _version; // for the offset defines
-
- if (!vocab996)
- _classtable.resize(20);
- else
- _classtable.resize(vocab996->size >> 2);
-
- for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
- int objtype = 0;
- Resource *script = _resMgr->findResource(ResourceId(kResourceTypeScript, scriptnr), 0);
-
- if (script) {
- if (version == SCI_VERSION_0_EARLY) // check if we got an old script header
- magic_offset = seeker = 2;
- else
- magic_offset = seeker = 0;
-
- do {
- while (seeker < script->size) {
- unsigned int lastseeker = seeker;
- objtype = (int16)READ_LE_UINT16(script->data + seeker);
- if (objtype == SCI_OBJ_CLASS || objtype == SCI_OBJ_TERMINATOR)
- break;
- seeker += (int16)READ_LE_UINT16(script->data + seeker + 2);
- if (seeker <= lastseeker) {
- _classtable.clear();
- error("Script version is invalid");
- }
- }
-
- if (objtype == SCI_OBJ_CLASS) {
- int sugg_script;
-
- seeker -= SCRIPT_OBJECT_MAGIC_OFFSET; // Adjust position; script home is base +8 bytes
-
- classnr = (int16)READ_LE_UINT16(script->data + seeker + 4 + SCRIPT_SPECIES_OFFSET);
- if (classnr >= (int)_classtable.size()) {
-
- if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
- warning("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
- classnr, scriptnr, scriptnr, seeker);
- return 1;
- }
-
- _classtable.resize(classnr + 1); // Adjust maximum number of entries
- }
-
- // Map the class ID to the script the corresponding class is contained in
- // The script number is found in vocab.996, if it exists
- if (!vocab996 || (uint32)classnr >= vocab996->size >> 2)
- sugg_script = -1;
- else
- sugg_script = (int16)READ_LE_UINT16(vocab996->data + 2 + (classnr << 2));
-
- // First, test whether the script hasn't been claimed, or if it's been claimed by the wrong script
-
- if (sugg_script == -1 || scriptnr == sugg_script /*|| !s->_classtable[classnr].reg.segment*/) {
- // Now set the home script of the class
- _classtable[classnr].reg.offset = seeker + 4 - magic_offset;
- _classtable[classnr].reg.segment = 0;
- _classtable[classnr].script = scriptnr;
- }
-
- seeker += SCRIPT_OBJECT_MAGIC_OFFSET; // Re-adjust position
- seeker += (int16)READ_LE_UINT16(script->data + seeker + 2); // Move to next
- }
-
- } while (objtype != SCI_OBJ_TERMINATOR && seeker <= script->size);
-
- }
- }
- _resMgr->unlockResource(vocab996);
- vocab996 = NULL;
return 0;
}
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 5676990343..27c8ad446a 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -360,8 +360,7 @@ private:
LocalVariables *allocLocalsSegment(Script *scr, int count);
MemObject *memObjAllocate(SegmentId segid, int hash_id, MemObjectType type);
int deallocate(SegmentId seg, bool recursive);
- int createSci0ClassTable();
- int createSci11ClassTable();
+ int createClassTable();
Hunk *alloc_Hunk(reg_t *);
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 613de69f05..fbdb3d1c85 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -312,13 +312,6 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
ObjVarRef varp;
switch (lookup_selector(s, send_obj, selector, &varp, &funcp)) {
case kSelectorNone:
- // WORKAROUND: LSL6 tries to access the invalid 'keep' selector of the game object.
- // FIXME: Find out if this is a game bug.
- if ((s->_gameName == "LSL6") && (selector == 0x18c)) {
- debug("LSL6 detected, continuing...");
- break;
- }
-
error("Send to invalid selector 0x%x of object at %04x:%04x", 0xffff & selector, PRINT_REG(send_obj));
break;
@@ -1660,7 +1653,6 @@ int script_instantiate_sci0(ResourceManager *resMgr, SegManager *segManager, Sci
return 1;
}
- segManager->_classtable[species].script = script_nr;
segManager->_classtable[species].reg = addr;
segManager->_classtable[species].reg.offset = classpos;
// Set technical class position-- into the block allocated for it
--
cgit v1.2.3
From 030665f90b5f172b7bafe730abcbc6f2a818ad6d Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Mon, 24 Aug 2009 07:57:04 +0000
Subject: Move detection tables to separate file.
svn-id: r43682
---
engines/sci/detection.cpp | 2894 +--------------------------------------
engines/sci/detection_tables.h | 2918 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 2921 insertions(+), 2891 deletions(-)
create mode 100644 engines/sci/detection_tables.h
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index f60e42ddde..177fc2fbd1 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -104,2895 +104,7 @@ static const PlainGameDescriptor SciGameTitles[] = {
{0, 0}
};
-#define FANMADE_L(name, resMapMd5, resMapSize, resMd5, resSize, lang) \
- {{"sci-fanmade", name, { \
- {"resource.map", 0, resMapMd5, resMapSize}, \
- {"resource.001", 0, resMd5, resSize}, \
- {NULL, 0, NULL, 0}}, lang, Common::kPlatformPC, 0, GUIO_NOSPEECH}, \
- 0 \
- }
-
-#define FANMADE(name, resMapMd5, resMapSize, resMd5, resSize) FANMADE_L(name, resMapMd5, resMapSize, resMd5, resSize, Common::EN_ANY)
-
-using Common::GUIO_NONE;
-using Common::GUIO_NOSPEECH;
-
-// Game descriptions
-static const struct SciGameDescription SciGameDescriptions[] = {
- // Astro Chicken - English DOS
- // SCI interpreter version 0.000.453
- {{"astrochicken", "", {
- {"resource.map", 0, "f3d1be7752d30ba60614533d531e2e98", 474},
- {"resource.001", 0, "6fd05926c2199af0af6f72f90d0d7260", 126895},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Castle of Dr. Brain - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.005.000"
- // SCI interpreter version 1.000.510
- {{"castlebrain", "", {
- {"resource.map", 0, "9f9fb826aa7e944b95eadbf568244a68", 2766},
- {"resource.000", 0, "0efa8409c43d42b32642f96652d3230d", 314773},
- {"resource.001", 0, "3fb02ce493f6eacdcc3713851024f80e", 559540},
- {"resource.002", 0, "d226d7d3b4f77c4a566913fc310487fc", 792380},
- {"resource.003", 0, "d226d7d3b4f77c4a566913fc310487fc", 464348},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Castle of Dr. Brain - German Amiga (from www.back2roots.org)
- // Executable scanning reports "1.005.001"
- // SCI interpreter version 1.000.510
- {{"castlebrain", "", {
- {"resource.map", 0, "8e60424682db52a982bcc3535a7e86f3", 2796},
- {"resource.000", 0, "0efa8409c43d42b32642f96652d3230d", 332468},
- {"resource.001", 0, "4e0836fadc324316c1a418125709ba45", 569057},
- {"resource.002", 0, "85e51acb5f9c539d66e3c8fe40e17da5", 826309},
- {"resource.003", 0, "85e51acb5f9c539d66e3c8fe40e17da5", 493638},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Castle of Dr. Brain - English DOS Non-Interactive Demo
- // SCI interpreter version 1.000.005
- {{"castlebrain", "Demo", {
- {"resource.map", 0, "467bb5e3224bb54640c3280032aebff5", 633},
- {"resource.000", 0, "9780f040d58182994e22d2e34fab85b0", 67367},
- {"resource.001", 0, "2af49dbd8f2e1db4ab09f9310dc91259", 570553},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Castle of Dr. Brain - English DOS Floppy (from jvprat)
- // Executable scanning reports "1.000.044", Floppy label reports "1.0, 10.30.91", VERSION file reports "1.000"
- // SCI interpreter version 1.000.510
- {{"castlebrain", "", {
- {"resource.map", 0, "1302ceb141d44b05a42723791b2d84c6", 2739},
- {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 346731},
- {"resource.001", 0, "d2f5a1be74ed963fa849a76892be5290", 794832},
- {"resource.002", 0, "c0c29c51af66d65cb53f49e785a2d978", 1280907},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Castle of Dr. Brain - English DOS Floppy 1.1
- {{"castlebrain", "", {
- {"resource.map", 0, "f77728304c70017c54793eb6ca648174", 2745},
- {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 347071},
- {"resource.001", 0, "13e81e1839cd7b216d2bb5615c1ca160", 796776},
- {"resource.002", 0, "930e416bec196b9703a331d81b3d66f2", 1283812},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Castle of Dr. Brain - Spanish DOS
- // SCI interpreter version 1.000.510
- {{"castlebrain", "", {
- {"resource.map", 0, "5738c163e014bbe046474de009020b82", 2727},
- {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 1197694},
- {"resource.001", 0, "735be4e58957180cfc807d5e18fdffcd", 1433302},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Christmas Card 1988 - English DOS
- // SCI interpreter version 0.000.294
- {{"christmas1988", "", {
- {"resource.map", 0, "39485580d34a72997f3d5b3aba4d24f1", 426},
- {"resource.001", 0, "11391434f41c834090d7a1e9488ce936", 129739},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Christmas Card 1990: The Seasoned Professional - English DOS (16 Colors)
- // SCI interpreter version 1.000.172
- {{"christmas1990", "16 Colors", {
- {"resource.map", 0, "8f656714a05b94423ac6eb10ee8797d0", 600},
- {"resource.001", 0, "acde93e58fca4f7a2a5a220558a94aa8", 272629},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Christmas Card 1990: The Seasoned Professional - English DOS (256 Colors)
- // SCI interpreter version 1.000.174
- {{"christmas1990", "256 Colors", {
- {"resource.map", 0, "44b8f45b841b9b5e17e939a35e443988", 600},
- {"resource.001", 0, "acde93e58fca4f7a2a5a220558a94aa8", 335362},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Christmas Card 1992 - English DOS
- // SCI interpreter version 1.001.055
- {{"christmas1992", "", {
- {"resource.map", 0, "f1f8c8a8443f523422af70b4ec85b71c", 318},
- {"resource.000", 0, "62fb9256f8e7e6e65a6875efdb7939ac", 203396},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Codename: Iceman - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.002.031"
- // SCI interpreter version 0.000.685
- {{"iceman", "", {
- {"resource.map", 0, "035829b391709a4e542d7c7b224625f6", 6000},
- {"resource.000", 0, "b1bccd827453d4cb834bfd5b45bef63c", 73682},
- {"resource.001", 0, "ede5a0e1e2a80fb629dae72c72f33d37", 293145},
- {"resource.002", 0, "36670a917550757d57df84c96cf9e6d9", 469387},
- {"resource.003", 0, "d97a96f1ab91b41cf46a02cc89b0a04e", 619219},
- {"resource.004", 0, "8613c45fc771d658e5a505b9a4a54f31", 713382},
- {"resource.005", 0, "605b67a9ef199a9bb015745e7c004cf4", 478384},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Codename: Iceman - English DOS Non-Interactive Demo
- // Executable scanning reports "0.000.685"
- {{"iceman", "Demo", {
- {"resource.map", 0, "782974f29d8a824782d2d4aea39964e3", 1056},
- {"resource.001", 0, "d4b75e280d1c3a97cfef1b0bebff387c", 573647},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Codename: Iceman - English DOS (from jvprat)
- // Executable scanning reports "0.000.685", Floppy label reports "1.033, 6.8.90", VERSION file reports "1.033"
- // SCI interpreter version 0.000.685
- {{"iceman", "", {
- {"resource.map", 0, "a18f3cef4481a81d3415fb87a754343e", 5700},
- {"resource.000", 0, "b1bccd827453d4cb834bfd5b45bef63c", 26989},
- {"resource.001", 0, "32b351072fccf76fc82234d73d28c08b", 438872},
- {"resource.002", 0, "36670a917550757d57df84c96cf9e6d9", 566549},
- {"resource.003", 0, "d97a96f1ab91b41cf46a02cc89b0a04e", 624303},
- {"resource.004", 0, "8613c45fc771d658e5a505b9a4a54f31", 670883},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Codename: Iceman - English DOS (from FRG)
- // SCI interpreter version 0.000.668
- {{"iceman", "", {
- {"resource.map", 0, "554b44b79b0e9a7fc59f66dda0daac02", 5670},
- {"resource.000", 0, "b1bccd827453d4cb834bfd5b45bef63c", 26974},
- {"resource.001", 0, "005bd332d4b0f9d8e99d3b905223a332", 438501},
- {"resource.002", 0, "250b859381ebf2bf8922bd99683b0cc1", 566464},
- {"resource.003", 0, "dc7c5280e7acfaffe6ef2a6c963c5f94", 622118},
- {"resource.004", 0, "64f342463f6f35ba71b3509ef696ae3f", 669188},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of Camelot - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.002.030"
- // SCI interpreter version 0.000.685
- {{"camelot", "", {
- {"resource.map", 0, "51aba42f8e63b219755d4372ea424509", 6654},
- {"resource.000", 0, "dfadf0b4c9fb44ce55570149856c302d", 128100},
- {"resource.001", 0, "67391de361b9347f123ac0899b4b91f7", 300376},
- {"resource.002", 0, "8c7f12b2c38d225d4c7121b30ea1b4d2", 605334},
- {"resource.003", 0, "82a73e7572e7ee627429bb5111ff82ca", 672392},
- {"resource.004", 0, "6821dc97cf643ba521a4e840dda3c58b", 647410},
- {"resource.005", 0, "c6e551bdc24f0acc193159038d4ca767", 605882},
- {"resource.006", 0, "8f880a536908ab496bbc552f7f5c3738", 585255},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of Camelot - English DOS Non-Interactive Demo
- // SCI interpreter version 0.000.668
- {{"camelot", "Demo", {
- {"resource.map", 0, "f4cd75c15be75e04cdca3acda2c0b0ea", 468},
- {"resource.001", 0, "4930708722f34bfbaa4945fb08f55f61", 232523},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of Camelot - English DOS (from jvprat)
- // Executable scanning reports "0.000.685", Floppy label reports "1.001, 0.000.685", VERSION file reports "1.001.000"
- // SCI interpreter version 0.000.685
- {{"camelot", "", {
- {"resource.map", 0, "95eca3991906dfd7ed26d193df07596f", 7278},
- {"resource.001", 0, "8e1a3a8c588007404b532b8dfacc1460", 596774},
- {"resource.002", 0, "8e1a3a8c588007404b532b8dfacc1460", 722250},
- {"resource.003", 0, "8e1a3a8c588007404b532b8dfacc1460", 723712},
- {"resource.004", 0, "8e1a3a8c588007404b532b8dfacc1460", 729143},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of Camelot - English DOS
- // SCI interpreter version 0.000.685
- {{"camelot", "", {
- {"resource.map", 0, "86bffb2a393b7a5d8de45e735091f037", 9504},
- {"resource.001", 0, "8e1a3a8c588007404b532b8dfacc1460", 212461},
- {"resource.002", 0, "8e1a3a8c588007404b532b8dfacc1460", 317865},
- {"resource.003", 0, "8e1a3a8c588007404b532b8dfacc1460", 359145},
- {"resource.004", 0, "8e1a3a8c588007404b532b8dfacc1460", 345180},
- {"resource.005", 0, "8e1a3a8c588007404b532b8dfacc1460", 345734},
- {"resource.006", 0, "8e1a3a8c588007404b532b8dfacc1460", 332446},
- {"resource.007", 0, "8e1a3a8c588007404b532b8dfacc1460", 358182},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of the Longbow - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.005.001"
- // SCI interpreter version 1.000.510
- {{"longbow", "", {
- {"resource.map", 0, "6204f3d00c0f6c0f5f95a29a4190f2f9", 6048},
- {"resource.000", 0, "8d11c744b4a51e7a8ceac687a46f08ca", 830333},
- {"resource.001", 0, "76caf8593e065a98c8ab4a6e2c7dbafc", 839008},
- {"resource.002", 0, "eb312373045906b54a3181bebaf6651a", 733145},
- {"resource.003", 0, "7fe3b3372d7fdda60045807e9c8e4867", 824554},
- {"resource.004", 0, "d1038c75d85a6650d48e07d174a6a913", 838175},
- {"resource.005", 0, "1c3804e56b114028c5873a35c2f06d13", 653002},
- {"resource.006", 0, "f9487732289a4f4966b4e34eea413325", 842817},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of the Longbow - English DOS
- // SCI interpreter version 1.000.510
- {{"longbow", "", {
- {"resource.map", 0, "36d3b81ff75b67dd4d27b7f5d3166503", 6261},
- {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 1096767},
- {"resource.001", 0, "d4c299213f8d799da1492680d12d0fb3", 1133226},
- {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1128555},
- {"resource.003", 0, "21ebe6b39b57a73fc449f67f013765aa", 972635},
- {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1064637},
- {"resource.005", 0, "d036df0872f2db19bca34601276be2d7", 1154950},
- {"resource.006", 0, "b367a6a59f29ee30dde1d88a5a41152d", 1042966},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of the Longbow - English DOS Floppy (from jvprat)
- // Executable scanning reports "1.000.168", Floppy label reports "1.1, 1.13.92", VERSION file reports "1.1"
- // SCI interpreter version 1.000.510
- {{"longbow", "", {
- {"resource.map", 0, "247f955865572569342751de47e861ab", 6027},
- {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 1297120},
- {"resource.001", 0, "1e6084a19f7a6c50af88d3a9b32c411e", 1366155},
- {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1234743},
- {"resource.003", 0, "1867136d01ece57b531032d466910522", 823686},
- {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1261462},
- {"resource.005", 0, "21ebe6b39b57a73fc449f67f013765aa", 1284720},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of the Longbow - English DOS
- // SCI interpreter version 1.000.510
- {{"longbow", "", {
- {"resource.map", 0, "737c6f83a1ee601727ff026898f19fa1", 6045},
- {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 1296607},
- {"resource.001", 0, "1e6084a19f7a6c50af88d3a9b32c411e", 1379267},
- {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1234140},
- {"resource.003", 0, "1867136d01ece57b531032d466910522", 823610},
- {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1260237},
- {"resource.005", 0, "21ebe6b39b57a73fc449f67f013765aa", 1284609},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of the Longbow EGA - English DOS
- // SCI interpreter version 1.000.510
- {{"longbow", "EGA", {
- {"resource.map", 0, "7676ec9f08967d7a9a7724f5170456e0", 6261},
- {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 718161},
- {"resource.001", 0, "3c3735caa34fa3f261a9552831bb43ed", 705680},
- {"resource.002", 0, "7025b87e735b1df3f0e9488a621f4333", 700633},
- {"resource.003", 0, "eaca7933e8e56bea22b42f7fd5d7a8a7", 686510},
- {"resource.004", 0, "b7bb35c027bb424ecefcd122768e5e60", 705631},
- {"resource.005", 0, "58942b1aa6d6ffeb66e9f8897fd4435f", 469243},
- {"resource.006", 0, "8c767b3939add63d11274065e46aad04", 713158},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0,
- },
-
- // Conquests of the Longbow - English DOS Non-Interactive Demo
- // SCI interpreter version 1.000.510
- {{"longbow", "Demo", {
- {"resource.map", 0, "cbc5cb73341de1bff1b1e20a640af220", 588},
- {"resource.001", 0, "f05a20cc07eee85da8e999d0ac0f596b", 869916},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Conquests of the Longbow - German DOS (suplied by markcoolio in bug report #2727681)
- // SCI interpreter version 1.000.510
- {{"longbow", "", {
- {"resource.map", 0, "7376b7a07f8bd3a8ab8d67595d3f5b51", 6285},
- {"resource.000", 0, "ee39f92e006142424cf9209329e727c6", 977281},
- {"resource.001", 0, "d4c299213f8d799da1492680d12d0fb3", 1167657},
- {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1172521},
- {"resource.003", 0, "a204de2a083a7770ff455a838210a678", 1165249},
- {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1101869},
- {"resource.005", 0, "d036df0872f2db19bca34601276be2d7", 1176914},
- {"resource.006", 0, "b367a6a59f29ee30dde1d88a5a41152d", 1123585},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest - English DOS Non-Interactive Demo (from FRG)
- // Executable scanning reports "x.yyy.zzz"
- // SCI interpreter version 1.001.069 (just a guess)
- {{"ecoquest", "Demo", {
- {"resource.map", 0, "c819e171359b7c95f4c13b846d5c034e", 873},
- {"resource.001", 0, "baf9393a9bfa73098adb501e5bc5487b", 657518},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest - English DOS CD 1.1
- // SCI interpreter version 1.001.064
- {{"ecoquest", "CD", {
- {"resource.map", 0, "a4b73d5d2b55bdb6e44345e99c8fbdd0", 4804},
- {"resource.000", 0, "d908dbef56816ac6c60dd145fdeafb2b", 3536046},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Eco Quest - English DOS Floppy
- // SCI interpreter version 1.000.510
- {{"ecoquest", "Floppy", {
- {"resource.map", 0, "704367225929a88aad281ac72844ddac", 4053},
- {"resource.000", 0, "241b98d3903f6a5b872baa19b80aef3b", 1099239},
- {"resource.001", 0, "96d4435d24c01f1c1675e46457604c5f", 1413719},
- {"resource.002", 0, "28fe9b4f0567e71feb198bc9f3a2c605", 1241816},
- {"resource.003", 0, "f3146df0ad4297f5ce35aa8c4753bf6c", 586832},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest - English DOS Floppy
- // SCI interpreter version 1.000.510
- {{"ecoquest", "Floppy", {
- {"resource.map", 0, "f77baec05fae76707205f5be6534a7f3", 4059},
- {"resource.000", 0, "241b98d3903f6a5b872baa19b80aef3b", 858490},
- {"resource.001", 0, "2fed7451bca81b0c891eed1a956f2263", 1212161},
- {"resource.002", 0, "323b3b12f43d53f27d259beb225f0aa7", 1129316},
- {"resource.003", 0, "83ac03e4bddb2c1ac2d36d2a587d0536", 1145616},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest - German DOS Floppy (supplied by markcoolio in bug report #2723744)
- // SCI interpreter version 1.000.510
- {{"ecoquest", "Floppy", {
- {"resource.map", 0, "7a9b43bf27dc000ac8559ecbe824b659", 4395},
- {"resource.000", 0, "99b73d40403a51c7e60d01df0d6cd34a", 998227},
- {"resource.001", 0, "2fed7451bca81b0c891eed1a956f2263", 1212060},
- {"resource.002", 0, "02d7d0411f7903aacb3bc8b0f8ca8a9a", 1202581},
- {"resource.003", 0, "84dd11b6825255671c703aee5ceff620", 1175835},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest - Spanish DOS Floppy (from jvprat)
- // Executable scanning reports "1.ECO.013", VERSION file reports "1.000, 11.12.92"
- // SCI interpreter version 1.000.510
- {{"ecoquest", "Floppy", {
- {"resource.map", 0, "82e6b1e3bdb2f064b18380009df7b345", 4395},
- {"resource.000", 0, "0b12a91c935e385308af8d17811deded", 1004085},
- {"resource.001", 0, "2fed7451bca81b0c891eed1a956f2263", 1212060},
- {"resource.002", 0, "2d21a1d2dcbffa551552e3e0725d2284", 1186033},
- {"resource.003", 0, "84dd11b6825255671c703aee5ceff620", 1174993},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest - French DOS Floppy (from Strangerke)
- // SCI interpreter version 1.ECO.013
- {{"ecoquest", "Floppy", {
- {"resource.map", 0, "67742945cd59b896d9f22a549f605217", 4407},
- {"resource.000", 0, "0b12a91c935e385308af8d17811deded", 973723},
- {"resource.001", 0, "fc7fba54b6bb88fd7e9c229636599aa9", 1205841},
- {"resource.002", 0, "b836c6ee9de67d814ac5d1b05f5b9858", 1173872},
- {"resource.003", 0, "f8f767f9d6351432621c6e54c1b2ba8c", 1141520},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest 2 - English DOS Non-Interactive Demo
- // SCI interpreter version 1.001.055
- {{"ecoquest2", "Demo", {
- {"resource.map", 0, "607cfa0d8a03b7d348c06ee727e3d939", 1321},
- {"resource.000", 0, "dd6f614c43c029f063e93cd243af90a4", 525992},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest 2 - English DOS Floppy (supplied by markcoolio in bug report #2723761)
- // SCI interpreter version 1.001.065
- {{"ecoquest2", "Floppy", {
- {"resource.map", 0, "28fb7b6abb9fc1cb8882d7c2e701b63f", 5658},
- {"resource.000", 0, "cc1d17e5637528dbe4a812699e1cbfc6", 4208192},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Eco Quest 2 - French DOS Floppy (from Strangerke)
- // SCI interpreter version 1.001.081
- {{"ecoquest2", "Floppy", {
- {"resource.map", 0, "c22ab8b33c339c138b6b1697b77b9e79", 5588},
- {"resource.000", 0, "1c4093f7248240329121fdf8c0d59152", 4231946},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Freddy Pharkas - English DOS demo (from FRG)
- // SCI interpreter version 1.001.069
- {{"freddypharkas", "Demo", {
- {"resource.map", 0, "97aa9fcfe84c9993a64debd28c32393a", 1909},
- {"resource.000", 0, "5ea8e7a3ea10cce6efd5c106dc62fd8c", 867724},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Freddy Pharkas - English CD (from FRG)
- // SCI interpreter version 1.001.132
- {{"freddypharkas", "CD", {
- {"resource.map", 0, "d46b282f228a67ba13bd4b4009e95f8f", 6058},
- {"resource.000", 0, "ee3c64ffff0ba9fb08bea2624631c598", 5490246},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Freddy Pharkas - English DOS Floppy (updated information from markcoolio in bug reports #2723773 and #2724720)
- // Executable scanning reports "1.cfs.081"
- // SCI interpreter version 1.001.132 (just a guess)
- {{"freddypharkas", "Floppy", {
- {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
- {"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
- {"resource.msg", 0, "554f65315d851184f6e38211489fdd8f", -1},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Freddy Pharkas - German DOS Floppy (from Tobis87, updated information from markcoolio in bug reports #2723772 and #2724720)
- // Executable scanning reports "1.cfs.081"
- // SCI interpreter version 1.001.132 (just a guess)
- {{"freddypharkas", "", {
- {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
- {"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
- {"resource.msg", 0, "304b5a5781800affd2235152a5794fa8", -1},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Freddy Pharkas - Spanish DOS (from jvprat)
- // Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
- // SCI interpreter version 1.001.132 (just a guess)
- {{"freddypharkas", "CD", {
- {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
- {"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 1456640},
- {"resource.001", 0, "15298fac241b5360763bfb68add1db07", 1456640},
- {"resource.002", 0, "419dbd5366f702b4123dedbbb0cffaae", 1456640},
- {"resource.003", 0, "05acdc256c742e79c50b9fe7ec2cc898", 863310},
- {"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Freddy Pharkas - Spanish DOS (from jvprat)
- // Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
- // SCI interpreter version 1.001.132 (just a guess)
- {{"freddypharkas", "Floppy", {
- {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
- {"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
- {"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Freddy Pharkas - English DOS CD Demo
- // SCI interpreter version 1.001.095
- {{"freddypharkas", "CD Demo", {
- {"resource.map", 0, "a62a7eae85dd1e6b07f39662b278437e", 1918},
- {"resource.000", 0, "4962a3c4dd44e36e78ea4a7a374c2220", 957382},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE},
- 0
- },
-
- // Fun Seeker's Guide - English DOS
- // SCI interpreter version 0.000.506
- {{"funseeker", "", {
- {"resource.map", 0, "7ee6859ef74314f6d91938c3595348a9", 282},
- {"resource.001", 0, "f1e680095424e31f7fae1255d36bacba", 40692},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Gabriel Knight - English DOS CD Demo
- // SCI interpreter version 1.001.092
- {{"gk1", "CD Demo", {
- {"resource.map", 0, "39645952ae0ed8072c7e838f31b75464", 2490},
- {"resource.000", 0, "eb3ed7477ca4110813fe1fcf35928561", 1718450},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Gabriel Knight - English DOS Floppy
- // SCI interpreter version 2.000.000
- {{"gk1", "", {
- {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10783},
- {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Gabriel Knight - English DOS Floppy (supplied my markcoolio in bug report #2723777)
- // SCI interpreter version 2.000.000
- {{"gk1", "", {
- {"resource.map", 0, "65e8c14092e4c9b3b3538b7602c8c5ec", 10783},
- {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Gabriel Knight - German DOS Floppy (supplied my markcoolio in bug report #2723775)
- // SCI interpreter version 2.000.000
- {{"gk1", "", {
- {"resource.map", 0, "ad6508b0296b25c07b1f58828dc33696", 10789},
- {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13077029},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Gabriel Knight - English DOS CD (from jvprat)
- // Executable scanning reports "2.000.000", VERSION file reports "01.100.000"
- {{"gk1", "CD", {
- {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996},
- {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Gabriel Knight - German DOS CD (from Tobis87)
- // SCI interpreter version 2.000.000
- {{"gk1", "CD", {
- {"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392},
- {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Gabriel Knight - Spanish DOS CD (from jvprat)
- // Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995"
- {{"gk1", "CD", {
- {"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404},
- {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Gabriel Knight 2 - English Windows Non-Interactive Demo
- // Executable scanning reports "2.100.002"
- {{"gk2", "Demo", {
- {"resource.map", 0, "e0effce11c4908f4b91838741716c83d", 1351},
- {"resource.000", 0, "d04cfc7f04b6f74d13025378be49ec2b", 4640330},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
- // Gabriel Knight 2 - English DOS (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "1.1"
- {{"gk2", "", {
- {"resmap.001", 0, "1b8bf6a23b37ed67358eb825fc687260", 2776},
- {"ressci.001", 0, "24463ae235b1afbbc4ff5e2ed1b8e3b2", 50496082},
- {"resmap.002", 0, "2028230674bb54cd24370e0745e7a9f4", 1975},
- {"ressci.002", 0, "f0edc1dcd704bd99e598c5a742dc7150", 42015676},
- {"resmap.003", 0, "51f3372a2133c406719dafad86369be3", 1687},
- {"ressci.003", 0, "86cb3f3d176994e7f8a9ad663a4b907e", 35313750},
- {"resmap.004", 0, "0f6e48f3e84e867f7d4a5215fcff8d5c", 2719},
- {"ressci.004", 0, "4f30aa6e6f895132402c8652f9e1d741", 58317316},
- {"resmap.005", 0, "2dac0e232262b4a51271fd28559b3e70", 2065},
- {"ressci.005", 0, "14b62d4a3bddee57a03cb1495a798a0f", 38075705},
- {"resmap.006", 0, "ce9359037277b7d7976da185c2fa0aad", 2977},
- {"ressci.006", 0, "8e44e03890205a7be12f45aaba9644b4", 60659424},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Hoyle 1 - English DOS (supplied by wibble92 in bug report #2644547)
- // SCI interpreter version 0.000.530
- {{"hoyle1", "", {
- {"resource.map", 0, "9de9aa6d23569b3c8bf798503cf1216a", 7818},
- {"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 162783},
- {"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 342309},
- {"resource.003", 0, "e0dd44069a62a463fd124974b915f10d", 328912},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Hoyle 1 - English DOS (supplied by merkur in bug report #2719227)
- // SCI interpreter version 0.000.530
- {{"hoyle1", "", {
- {"resource.map", 0, "1034a218943d12f1f36e753fa10c95b8", 4386},
- {"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 518308},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
-#if 0 // TODO: unknown if these files are corrupt
- // Hoyle 1 - English Amiga (from www.back2roots.org)
- // SCI interpreter version 0.000.519 - FIXME: some have 0.000.530, others x.yyy.zzz
- {{"hoyle1", "", {
- {"resource.map", 0, "2a72b1aba65fa6e339370eb86d8601d1", 5166},
- {"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 218755},
- {"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 439502},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-#endif
-
- // Hoyle 2 - English DOS
- // SCI interpreter version 0.000.572
- {{"hoyle2", "", {
- {"resource.map", 0, "4f894d203f64aa23d9ff64d30ae36926", 2100},
- {"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 98138},
- {"resource.002", 0, "8f2dd70abe01112eca464cda818b5eb6", 196631},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Hoyle 2 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.002.032"
- // SCI interpreter version 0.000.685
- {{"hoyle2", "", {
- {"resource.map", 0, "62ed48d20c580e5a98f102f7cd93706a", 1356},
- {"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 222704},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
-#if 0 // TODO: unknown if these files are corrupt
- // Hoyle 3 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.005.000"
- // SCI interpreter version 1.000.510
- {{"hoyle3", "", {
- {"resource.map", 0, "f1f158e428398cb87fc41fb4aa8c2119", 2088},
- {"resource.000", 0, "595b6039ea1356e7f96a52c58eedcf22", 355791},
- {"resource.001", 0, "143df8aef214a2db34c2d48190742012", 632273},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-#endif
-
- // Hoyle 3 - English DOS Non-Interactive Demo
- // Executable scanning reports "x.yyy.zzz"
- // SCI interpreter version 1.000.510 (just a guess)
- {{"hoyle3", "Demo", {
- {"resource.map", 0, "0d06cacc87dc21a08cd017e73036f905", 735},
- {"resource.001", 0, "24db2bccda0a3c43ac4a7b5edb116c7e", 797678},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Hoyle 3 - English DOS Floppy (from jvprat)
- // Executable scanning reports "x.yyy.zzz", Floppy label reports "1.0, 11.2.91", VERSION file reports "1.000"
- // SCI interpreter version 1.000.510 (just a guess)
- {{"hoyle3", "", {
- {"resource.map", 0, "7216a2972f9c595c45ab314941628e43", 2247},
- {"resource.000", 0, "6ef28cac094dcd97fdb461662ead6f92", 541845},
- {"resource.001", 0, "0a98a268ee99b92c233a0d7187c1f0fa", 845795},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Hoyle 4 - English DOS Demo
- // SCI interpreter version 1.001.200 (just a guess)
- {{"hoyle4", "Demo", {
- {"resource.map", 0, "662087cb383e52e3cc4ae7ecb10e20aa", 938},
- {"resource.000", 0, "24c10844792c54d476d272213cbac300", 675252},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
-#if 0
- // Jones in the Fast Lane - English DOS
- // SCI interpreter version 1.000.172
- {{"jones", "", {
- {"resource.map", 0, "65cbe19b36fffc71c8e7b2686bd49ad7", 1800},
- {"resource.001", 0, "bac3ec6cb3e3920984ab0f32becf5163", 313476},
- {"resource.002", 0, "b86daa3ba2784d1502da881eedb80d9b", 719747},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-#endif
-
- // King's Quest 1 SCI Remake - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.003.007"
- // SCI interpreter version 0.001.010
- {{"kq1sci", "SCI Remake", {
- {"resource.map", 0, "37ed1a05eb719629eba15059c2eb6cbe", 6798},
- {"resource.001", 0, "9ae2a13708d691cd42f9129173c4b39d", 266621},
- {"resource.002", 0, "9ae2a13708d691cd42f9129173c4b39d", 795123},
- {"resource.003", 0, "9ae2a13708d691cd42f9129173c4b39d", 763224},
- {"resource.004", 0, "9ae2a13708d691cd42f9129173c4b39d", 820443},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 1 SCI Remake - English DOS Non-Interactive Demo
- // Executable scanning reports "S.old.010"
- {{"kq1sci", "SCI Remake Demo", {
- {"resource.map", 0, "59b13619078bd47011421468959ee5d4", 954},
- {"resource.001", 0, "4cfb9040db152868f7cb6a1e8151c910", 296555},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 1 SCI Remake - English DOS (from the King's Quest Collection)
- // Executable scanning reports "S.old.010", VERSION file reports "1.000.051"
- // SCI interpreter version 0.000.999
- {{"kq1sci", "SCI Remake", {
- {"resource.map", 0, "7fe9399a0bec84ca5727309778d27f07", 5790},
- {"resource.001", 0, "fed9e0072ffd511d248674e60dee2099", 555439},
- {"resource.002", 0, "fed9e0072ffd511d248674e60dee2099", 714062},
- {"resource.003", 0, "fed9e0072ffd511d248674e60dee2099", 717478},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 4 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.002.032"
- // SCI interpreter version 0.000.685
- {{"kq4sci", "", {
- {"resource.map", 0, "f88dd267fb9504d40a04d599c048d42b", 6354},
- {"resource.000", 0, "77615c595388acf3d1df8e107bfb6b52", 138523},
- {"resource.001", 0, "52c2231765eced34faa7f7bcff69df83", 44751},
- {"resource.002", 0, "fb351106ec865fad9af5d78bd6b8e3cb", 663629},
- {"resource.003", 0, "fd16c9c223f7dc5b65f06447615224ff", 683016},
- {"resource.004", 0, "3fac034c7d130e055d05bc43a1f8d5f8", 549993},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 4 - English DOS Non-Interactive Demo
- // Executable scanning reports "0.000.494"
- {{"kq4sci", "Demo", {
- {"resource.map", 0, "992ac7cc31d3717fe53818a9bb6d1dae", 594},
- {"resource.001", 0, "143e1c14f15ad0fbfc714f648a65f661", 205330},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // King's Quest 4 - English DOS (from the King's Quest Collection)
- // Executable scanning reports "0.000.502"
- // SCI interpreter version 0.000.502
- {{"kq4sci", "", {
- {"resource.map", 0, "3164a39790b599c954ecf716d0b32be8", 7476},
- {"resource.001", 0, "77615c595388acf3d1df8e107bfb6b52", 452523},
- {"resource.002", 0, "77615c595388acf3d1df8e107bfb6b52", 536573},
- {"resource.003", 0, "77615c595388acf3d1df8e107bfb6b52", 707591},
- {"resource.004", 0, "77615c595388acf3d1df8e107bfb6b52", 479562},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // King's Quest 4 - English DOS
- // SCI interpreter version 0.000.274
- {{"kq4sci", "", {
- {"resource.map", 0, "adbe267662a5915d3c89c9075ec8cf3e", 9474},
- {"resource.001", 0, "851a62d00972dc4002f472cc0d84e71d", 188239},
- {"resource.002", 0, "851a62d00972dc4002f472cc0d84e71d", 329895},
- {"resource.003", 0, "851a62d00972dc4002f472cc0d84e71d", 355385},
- {"resource.004", 0, "851a62d00972dc4002f472cc0d84e71d", 322951},
- {"resource.005", 0, "851a62d00972dc4002f472cc0d84e71d", 321593},
- {"resource.006", 0, "851a62d00972dc4002f472cc0d84e71d", 333777},
- {"resource.007", 0, "851a62d00972dc4002f472cc0d84e71d", 341038},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // King's Quest 4 - English DOS
- // SCI interpreter version 0.000.253
- {{"kq4sci", "", {
- {"resource.map", 0, "381d9dcb69c626f0a60631dbfec1d13a", 9474},
- {"resource.001", 0, "0c8566848a76eea19a6d6220914030a7", 191559},
- {"resource.002", 0, "0c8566848a76eea19a6d6220914030a7", 333345},
- {"resource.003", 0, "0c8566848a76eea19a6d6220914030a7", 358513},
- {"resource.004", 0, "0c8566848a76eea19a6d6220914030a7", 326297},
- {"resource.005", 0, "0c8566848a76eea19a6d6220914030a7", 325102},
- {"resource.006", 0, "0c8566848a76eea19a6d6220914030a7", 337288},
- {"resource.007", 0, "0c8566848a76eea19a6d6220914030a7", 343882},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // King's Quest 5 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.004.018"
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "fcbcca058e1157221ffc27251cd59bc3", 8040},
- {"resource.000", 0, "c595ca99e7fa9b2cabcf69cfab0caf67", 344909},
- {"resource.001", 0, "964a3be90d810a99baf72ea70c09f935", 836477},
- {"resource.002", 0, "d10f3e8ff2cd95a798b21cd08797b694", 814730},
- {"resource.003", 0, "f72fdd994d9ba03a8360d639f256344e", 804882},
- {"resource.004", 0, "a5b80f95c66b3a032348989408eec287", 747914},
- {"resource.005", 0, "31a5487f4d942e6354d5be49d59707c9", 834146},
- {"resource.006", 0, "26c0c25399b6715fec03fc3e12544fe3", 823048},
- {"resource.007", 0, "b914b5901e786327213e779725d30dd1", 778772},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - German Amiga
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "bfbffd923cd64b24498e54f797aa6e41", 8250},
- {"resource.000", 0, "79479b5e4e5b0085d8eea1c7ff0f9f5a", 306893},
- {"resource.001", 0, "7840aadc82977c7b4f504a7e4a12829f", 720376},
- {"resource.002", 0, "d547167d4204170b44de8e1d63506215", 792586},
- {"resource.003", 0, "9cbb0712816097cbc9d0c1f987717c7f", 646446},
- {"resource.004", 0, "319712573661bd122390cdfbafb000fd", 831842},
- {"resource.005", 0, "5aa3d59968b569cd509dde00d4eb8751", 754201},
- {"resource.006", 0, "56546b20db11a4836f900efa6d3a3e74", 672099},
- {"resource.007", 0, "56546b20db11a4836f900efa6d3a3e74", 794194},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - Italian Amiga
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "12e2f80c0269932411716dad06d2b229", 8250},
- {"resource.000", 0, "c598ff615a61bc0e418761283409f128", 305879},
- {"resource.001", 0, "17e63cfe78632fe07222e13a26dc0fb2", 720023},
- {"resource.002", 0, "abb340a53e4873a7c3bacfb16c0b779d", 792432},
- {"resource.003", 0, "aced8ce0be07eef77c0e7cff8cc4e476", 646088},
- {"resource.004", 0, "13fc1f1679f7f226ba52ffffe2e65f38", 831805},
- {"resource.005", 0, "de3c5c09e350fded36ca354998c2194d", 754784},
- {"resource.006", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 672527},
- {"resource.007", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 794259},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - English DOS CD (from the King's Quest Collection)
- // Executable scanning reports "x.yyy.zzz", VERSION file reports "1.000.052"
- // SCI interpreter version 1.000.784
- {{"kq5", "CD", {
- {"resource.map", 0, "f68ba690e5920725dcf9328001b90e33", 13122},
- {"resource.000", 0, "449471bfd77be52f18a3773c7f7d843d", 571368},
- {"resource.001", 0, "b45a581ff8751e052c7e364f58d3617f", 16800210},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // King's Quest 5 - English DOS Floppy
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "d6172c27b453350e158815fbae23f41e", 8004},
- {"resource.000", 0, "a591bd4b879fc832b8095c0b3befe9e2", 276351},
- {"resource.001", 0, "3f28c72dc7531aaccf8e972c7ee50d14", 1022087},
- {"resource.002", 0, "3e56ba5bf5e8637c619b57f6b6cacbb4", 1307211},
- {"resource.003", 0, "5d5d498f33ca7cde0d5b058630b36ad3", 1347875},
- {"resource.004", 0, "944a996f9cc90dabde9f51ed7dd52366", 1239689},
- {"resource.005", 0, "b6c43441cb78a9b484efc8e614aac092", 1287999},
- {"resource.006", 0, "672ede1136e9e401658538e51bd5dc22", 1172619},
- {"resource.007", 0, "2f48faf27666b58c276dda20f91f4a93", 1240456},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - German DOS Floppy (supplied by markcoolio in bug report #2727101)
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "bff44f0c326a71b1757c793a02b502d6", 8283},
- {"resource.000", 0, "d7ed18ec4a5de02a9a57830aa65a600d", 336826},
- {"resource.001", 0, "b1e5ec6a17be7e75ddb955f6f73191e4", 1136919},
- {"resource.002", 0, "04a88122db44610a4af019a579ec5ff6", 1340813},
- {"resource.003", 0, "215bb35acefae75fc80757c717166d7e", 1323916},
- {"resource.004", 0, "fecdec847e3bd8e3b0f9827900aa95fd", 1331811},
- {"resource.005", 0, "9c429782d102739f6bbb81e8b953b0cb", 1267525},
- {"resource.006", 0, "d1a75fdc01840664d00366cff6919366", 1208972},
- {"resource.007", 0, "c07494f0cce7c05210893938786a955b", 1337361},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - French DOS Floppy (from the King's Quest Collector's Edition 1994)
- // Supplied by aroenai in bug report #2812611
- // VERSION file reports "1.000", SCI interpreter version 1.000.784
- {{"kq5", "", {
- {"resource.map", 0, "eb7853832f3bb10900b13b421a0bbe7f", 8283},
- {"resource.000", 0, "f063775b279208c14a83eda47073be90", 332806},
- {"resource.001", 0, "3e6add38564250fd1a5bb10593007530", 1136827},
- {"resource.002", 0, "d9a97a9cf6c79bbe8f19378f6dea45d5", 1343738},
- {"resource.003", 0, "bef90d755076c110e67ee3e635503f82", 1324811},
- {"resource.004", 0, "c14dbafcfbe00855ac6b2f2701058047", 1332216},
- {"resource.005", 0, "f4b31cafc5defac75125c5f7b7f9a31a", 1268334},
- {"resource.006", 0, "f7dc85307632ef657ceb1651204f6f51", 1210081},
- {"resource.007", 0, "7db4d0a1d8d547c0019cb7d2a6acbdd4", 1338473},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - Italian DOS Floppy (from glorifindel)
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "d55c9e83894a0885e37cd79bacf86384", 8283},
- {"resource.000", 0, "c99bbb11ace4aaacdc98b588a2ecea06", 332246},
- {"resource.001", 0, "42b98457b1a7282daa27afd89eef53f4", 1136389},
- {"resource.002", 0, "8cdc160f9dfc84aed7caa6c66fa31000", 1340730},
- {"resource.003", 0, "d0cb52dc41488c018359aa79a6527f51", 1323676},
- {"resource.004", 0, "e5c57060adf2b5c6fc24142acba023da", 1331097},
- {"resource.005", 0, "f4e441f284560eaa8022102315656a7d", 1267757},
- {"resource.006", 0, "8eeabd92af71e766e323db2100879102", 1209325},
- {"resource.007", 0, "dc10c107e0923b902326a040b9c166b9", 1337859},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 5 - Polish DOS Floppy (supplied by jacek909 in bug report #2725722)
- // SCI interpreter version 1.000.060
- {{"kq5", "", {
- {"resource.map", 0, "70010c20138541f89013bb5e1b30f16a", 7998},
- {"resource.000", 0, "a591bd4b879fc832b8095c0b3befe9e2", 276398},
- {"resource.001", 0, "c0f48d4a7ebeaa6aa074fc98d77423e9", 1018560},
- {"resource.002", 0, "7f188a95acdb60bbe32a8379ba299393", 1307048},
- {"resource.003", 0, "0860785af59518b94d54718dddcd6907", 1348500},
- {"resource.004", 0, "c4745dd1e261c22daa6477961d08bf6c", 1239887},
- {"resource.005", 0, "6556ff8e7c4d1acf6a78aea154daa76c", 1287869},
- {"resource.006", 0, "da82e4beb744731d0a151f1d4922fafa", 1170456},
- {"resource.007", 0, "431def14ca29cdb5e6a5e84d3f38f679", 1240176},
- {NULL, 0, NULL, 0}}, Common::PL_POL, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 6 - English DOS Non-Interactive Demo
- // Executable scanning reports "1.001.055", VERSION file reports "1.000.000"
- // SCI interpreter version 1.001.055
- {{"kq6", "Demo", {
- {"resource.map", 0, "f75727c00a6d884234fa2a43c951943a", 706},
- {"resource.000", 0, "535b1b920441ec73f42eaa4ccfd47b89", 264116},
- {"resource.msg", 0, "54d1fdc936f98c81f9e4c19e04fb1510", 8260},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 6 - English DOS Floppy
- // SCI interpreter version 1.001.054
- {{"kq6", "", {
- {"resource.map", 0, "a362063318eebe7d6423b1d9dc6213e1", 8703},
- {"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
- {"resource.msg", 0, "3cf5de44de36191f109d425b8450efc8", 258590},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 6 - German DOS Floppy (supplied by markcoolio in bug report #2727156)
- // SCI interpreter version 1.001.054
- {{"kq6", "", {
- {"resource.map", 0, "a362063318eebe7d6423b1d9dc6213e1", 8703},
- {"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
- {"resource.msg", 0, "756297b2155db9e43f621c6f6fb763c3", 282822},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 6 - English Windows CD (from the King's Quest Collection)
- // Executable scanning reports "1.cfs.158", VERSION file reports "1.034 9/11/94 - KQ6 version 1.000.00G"
- // SCI interpreter version 1.001.054
- {{"kq6", "CD", {
- {"resource.map", 0, "7a550ebfeae2575ca00d47703a6a774c", 9215},
- {"resource.000", 0, "233394a5f33b475ae5975e7e9a420865", 8376352},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // King's Quest 6 - Spanish DOS CD (from jvprat)
- // Executable scanning reports "1.cfs.158", VERSION file reports "1.000.000, July 5, 1994"
- // SCI interpreter version 1.001.055
- {{"kq6", "CD", {
- {"resource.map", 0, "a73a5ab04b8f60c4b75b946a4dccea5a", 8953},
- {"resource.000", 0, "4da3ad5868a775549a7cc4f72770a58e", 8537260},
- {"resource.msg", 0, "41eed2d3893e1ca6c3695deba4e9d2e8", 267102},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // King's Quest 7 - English DOS (from the King's Quest Collection)
- // Executable scanning reports "2.100.002", VERSION file reports "1.4"
- {{"kq7", "", {
- {"resource.map", 0, "2be9ab94429c721af8e05c507e048a15", 18697},
- {"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 203882535},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 7 - English DOS (from FRG)
- // SCI interpreter version 2.100.002
- {{"kq7", "", {
- {"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709},
- {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 7 - German Windows (supplied by markcoolio in bug report #2727402)
- // SCI interpreter version 2.100.002
- {{"kq7", "", {
- {"resource.map", 0, "838b9ff132bd6962026fee832e8a7ddb", 18697},
- {"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 206626576},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 7 - Spanish DOS (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "2.00"
- {{"kq7", "", {
- {"resource.map", 0, "0b62693cbe87e3aaca3e8655a437f27f", 18709},
- {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // King's Quest 7 - English DOS Non-Interactive Demo
- // SCI interpreter version 2.100.002
- {{"kq7", "Demo", {
- {"resource.map", 0, "b44f774108d63faa1d021101221c5a54", 1690},
- {"resource.000", 0, "d9659d2cf0c269c6a9dc776707f5bea0", 2433827},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Laura Bow - English Amiga
- // Executable scanning reports "1.002.030"
- // SCI interpreter version 0.000.685
- {{"laurabow", "", {
- {"resource.map", 0, "731ab85e138f8cef1a7f4d1f36dfd375", 7422},
- {"resource.000", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 126317},
- {"resource.001", 0, "42fe895e9eb60e103025fd9ca737a849", 264763},
- {"resource.002", 0, "6f1ebd3692ce76644e0e06a38b7b56b5", 677436},
- {"resource.003", 0, "2ab23f64306b18c28302c8ec2964c5d6", 605134},
- {"resource.004", 0, "aa553977f7e5804081de293800d3bcce", 695067},
- {"resource.005", 0, "bfd870d51dc97729f0914095f58e6957", 676881},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow - English Atari ST (from jvprat)
- // Executable scanning reports "1.002.030", Floppy label reports "1.000.062, 9.23.90"
- // SCI interpreter version 0.000.685
- {{"laurabow", "", {
- {"resource.map", 0, "9f90878e6e1b8c96e692203f068ce2b1", 8478},
- {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 515964},
- {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 721149},
- {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 667365},
- {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 683737},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow - English DOS Non-Interactive Demo
- // Executable scanning reports "x.yyy.zzz"
- {{"laurabow", "Demo", {
- {"resource.map", 0, "e625726268ff4e123ada11f31f0249f3", 768},
- {"resource.001", 0, "0c8912290af0890f8d95faeb4ddb2d68", 333031},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow - English DOS 3.5" Floppy (from "The Roberta Williams Anthology"/1996)
- // SCI interpreter version 0.000.631
- {{"laurabow", "", {
- {"resource.map", 0, "4e511f47d9893fa529d6621a93fa0030", 8478},
- {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 515788},
- {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 721381},
- {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 667468},
- {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 683807},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow - English DOS (from FRG)
- // SCI interpreter version 0.000.631 (or 0.000.685?)
- {{"laurabow", "", {
- {"resource.map", 0, "b1905f6aa68ff65a057b080b1eae954c", 12030},
- {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 108032},
- {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 354680},
- {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 361815},
- {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 339714},
- {"resource.005", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 327465},
- {"resource.006", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 328390},
- {"resource.007", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 317687},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow - German DOS (from Tobis87)
- // SCI interpreter version 0.000.631 (or 0.000.685?)
- {{"laurabow", "", {
- {"resource.map", 0, "b1905f6aa68ff65a057b080b1eae954c", 12030},
- {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 108032},
- {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 354680},
- {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 361815},
- {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 339714},
- {"resource.005", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 327465},
- {"resource.006", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 328390},
- {"resource.007", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 317687},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow 2 - English DOS Non-Interactive Demo (from FRG)
- // Executable scanning reports "x.yyy.zzz"
- // SCI interpreter version 1.001.069 (just a guess)
- {{"laurabow2", "Demo", {
- {"resource.map", 0, "24dffc5db1d88c7999f13e8767ed7346", 855},
- {"resource.000", 0, "2b2b1b4f7584f9b38fd13f6ab95634d1", 781912},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow 2 - English DOS Floppy
- // Executable scanning reports "2.000.274"
- // SCI interpreter version 1.001.069 (just a guess)
- {{"laurabow2", "", {
- {"resource.map", 0, "610bfd9a852004222f0faaf5fc9e630a", 6489},
- {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5035964},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow 2 - English DOS CD (from "The Roberta Williams Antology"/1996)
- // Executable scanning reports "1.001.072", VERSION file reports "1.1" (from jvprat)
- // SCI interpreter version 1.001.069 (just a guess)
- {{"laurabow2", "CD", {
- {"resource.map", 0, "a70945e61ba7ac7bfea6b7bd72c6aec5", 7274},
- {"resource.000", 0, "82578b8d5a7e09c4c58891ca49fae35b", 5598672},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Laura Bow 2 v1.1 - German DOS Floppy (from Tobis87, updated info from markcoolio in bug report #2723787, updated info from #2797962))
- // Executable scanning reports "2.000.274"
- {{"laurabow2", "", {
- {"resource.map", 0, "3b6dfbcda210bbc3f23fd1927113bf98", 6483},
- {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
- {"resource.msg", 0, "795c928cd00dfec9fbc62ebcd12e1f65", 303185},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Laura Bow 2 - Spanish DOS CD (from jvprat)
- // Executable scanning reports "2.000.274", VERSION file reports "1.000.000, May 10, 1994"
- {{"laurabow2", "CD", {
- {"resource.map", 0, "3b6dfbcda210bbc3f23fd1927113bf98", 6483},
- {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
- {"resource.msg", 0, "71f1f0cd9f082da2e750c793a8ed9d84", 286141},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 1 EGA Remake - English DOS (from spookypeanut)
- // SCI interpreter version 0.000.510 (or 0.000.577?)
- {{"lsl1sci", "EGA Remake", {
- {"resource.map", 0, "abc0dc50c55de5b9723bb6de193f8756", 3282},
- {"resource.000", 0, "d3bceaebef3f7be941c2038b3565161e", 451366},
- {"resource.001", 0, "38936d3c68b6f79d3ffb13955713fed7", 591352},
- {"resource.002", 0, "24c958bc922b07f91e25e8c93aa01fcf", 491230},
- {"resource.003", 0, "685cd6c1e05a695ab1e0db826337ee2a", 553279},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 1 VGA Remake - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.784
- {{"lsl1sci", "VGA Remake", {
- {"resource.map", 0, "7d115a9e27dc8ac71e8d5ef33d589bd5", 3366},
- {"resource.000", 0, "e67fd129d5810fc7ad8ea509d891cc00", 363073},
- {"resource.001", 0, "24ed6dc01b1e7fbc66c3d63a5994549a", 750465},
- {"resource.002", 0, "5790ac0505f7ca98d4567132b875eb1e", 681041},
- {"resource.003", 0, "4a34c3367c2fe7eb380d741374da1989", 572251},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 1 VGA Remake - English DOS (from spookypeanut)
- // Executable scanning reports "1.000.577", VERSION file reports "2.1"
- {{"lsl1sci", "VGA Remake", {
- {"resource.map", 0, "6d04d26466337a1a64b8c6c0eb65c9a9", 3222},
- {"resource.000", 0, "d3bceaebef3f7be941c2038b3565161e", 922406},
- {"resource.001", 0, "ec20246209d7b19f38989261e5c8f5b8", 1111226},
- {"resource.002", 0, "85d6935ef77e6b0e16bc307640a0d913", 1088312},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 1 VGA Remake - English DOS (from FRG)
- // SCI interpreter version 1.000.510
- {{"lsl1sci", "VGA Remake", {
- {"resource.map", 0, "8606b083b011a0cc4a1fbfc2198a0a77", 3198},
- {"resource.000", 0, "d3bceaebef3f7be941c2038b3565161e", 918242},
- {"resource.001", 0, "d34cadb11e1aefbb497cf91bc1d3baa7", 1114688},
- {"resource.002", 0, "85b030bb66d5342b0a068f1208c431a8", 1078443},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 1 VGA Remake - English DOS Non-Interactive Demo
- // SCI interpreter version 1.000.084
- {{"lsl1sci", "VGA Remake Demo", {
- {"resource.map", 0, "434e1f6c39d71647b34f0ee57b2bbd68", 444},
- {"resource.001", 0, "0c0768215c562d9dace4a5ca53696cf3", 359913},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 1 VGA Remake - Spanish DOS (from the Leisure Suit Larry Collection)
- // Executable scanning reports "1.SQ4.057", VERSION file reports "1.000"
- // This version is known to be corrupted
- // SCI interpreter version 1.000.510
- {{"lsl1sci", "VGA Remake", {
- {"resource.map", 0, "4fbe5c25878d51d7b2a68b710de4491b", 3327},
- {"resource.000", 0, "5e501a9bf8c753bf4c96158042422f00", 839172},
- {"resource.001", 0, "112648995dbc194037f1e4ed2e195910", 1063341},
- {"resource.002", 0, "3fe2a3aec0ed53c7d6db1845a67e3aa2", 1095908},
- {"resource.003", 0, "ac175df0ea9a2cba57f0248651856d27", 376556},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 1 VGA Remake - Russian DOS
- // Executable scanning reports "1.000.510", VERSION file reports "2.0"
- // SCI interpreter version 1.000.510
- {{"lsl1sci", "VGA Remake", {
- {"resource.map", 0, "b54413d35e206d21ae2b2bdb092bd13a", 3198},
- {"resource.000", 0, "0d7b2afa666bd36d9535a15d3a837a66", 928566},
- {"resource.001", 0, "bc8ca10c807515d959cbd91f9ba47735", 1123759},
- {"resource.002", 0, "b7409ab32bc3bee2d6cce887cd33f2b6", 1092160},
- {NULL, 0, NULL, 0}}, Common::RU_RUS, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 2 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "x.yyy.zzz"
- // SCI interpreter version 0.000.572
- {{"lsl2", "", {
- {"resource.map", 0, "e36ce0fc94d1678d15acbf12d84ec47d", 6612},
- {"resource.001", 0, "a0d4a625311d307257da7fc43d00459d", 409124},
- {"resource.002", 0, "a0d4a625311d307257da7fc43d00459d", 630106},
- {"resource.003", 0, "a0d4a625311d307257da7fc43d00459d", 570356},
- {"resource.004", 0, "a0d4a625311d307257da7fc43d00459d", 717844},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 2 - English DOS Non-Interactive Demo
- // Executable scanning reports "x.yyy.zzz"
- // SCI interpreter version 0.000.409
- {{"lsl2", "Demo", {
- {"resource.map", 0, "03dba704bb77da55a91ad27b5a3cac09", 528},
- {"resource.001", 0, "9f5520f0297206928df0b0b36493cd33", 127532},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 2 - English DOS
- // SCI interpreter version 0.000.409
- {{"lsl2", "", {
- {"resource.map", 0, "42258cf767a8ebaa9e66b6151a80e601", 5628},
- {"resource.001", 0, "4a24443a25e2b1492462a52809605dc2", 143847},
- {"resource.002", 0, "4a24443a25e2b1492462a52809605dc2", 348331},
- {"resource.003", 0, "4a24443a25e2b1492462a52809605dc2", 236550},
- {"resource.004", 0, "4a24443a25e2b1492462a52809605dc2", 204861},
- {"resource.005", 0, "4a24443a25e2b1492462a52809605dc2", 277732},
- {"resource.006", 0, "4a24443a25e2b1492462a52809605dc2", 345683},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 2 - English DOS
- // SCI interpreter version 0.000.343
- {{"lsl2", "", {
- {"resource.map", 0, "6bd43c92eaf561f64818116eed683fcf", 5598},
- {"resource.001", 0, "96033f57accfca903750413fd09193c8", 140526},
- {"resource.002", 0, "96033f57accfca903750413fd09193c8", 348672},
- {"resource.003", 0, "96033f57accfca903750413fd09193c8", 236676},
- {"resource.004", 0, "96033f57accfca903750413fd09193c8", 204867},
- {"resource.005", 0, "96033f57accfca903750413fd09193c8", 274953},
- {"resource.006", 0, "96033f57accfca903750413fd09193c8", 345818},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 3 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.002.032"
- // SCI interpreter version 0.000.685
- {{"lsl3", "", {
- {"resource.map", 0, "4a6da6322ce189431b5ffbac992bad3a", 5328},
- {"resource.000", 0, "cdc2e21e297b10fe8fed6377af8c5698", 66523},
- {"resource.001", 0, "6abbaf8c7e3b36dd868868ed187e8995", 71761},
- {"resource.002", 0, "a883424fe6d594fec0cd5a79e7ad54c8", 476490},
- {"resource.003", 0, "5c10e462c8cf589610773e4fe8bfd996", 527238},
- {"resource.004", 0, "f408e59cbee1457f042e5773b8c53951", 651634},
- {"resource.005", 0, "433911eb764089d493aed1f958a5615a", 524259},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 3 - English DOS
- // SCI interpreter version 0.000.572
- {{"lsl3", "", {
- {"resource.map", 0, "0b6bd3e039682830a51c5755c06591db", 5916},
- {"resource.001", 0, "f18441027154292836b973c655fa3175", 456722},
- {"resource.002", 0, "f18441027154292836b973c655fa3175", 578024},
- {"resource.003", 0, "f18441027154292836b973c655fa3175", 506807},
- {"resource.004", 0, "f18441027154292836b973c655fa3175", 513651},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 3 - English DOS
- // SCI interpreter version 0.000.572
- {{"lsl3", "", {
- {"resource.map", 0, "0f429f5186f96d6c501838a1cb44bd43", 7452},
- {"resource.001", 0, "f18441027154292836b973c655fa3175", 141381},
- {"resource.002", 0, "f18441027154292836b973c655fa3175", 345171},
- {"resource.003", 0, "f18441027154292836b973c655fa3175", 329214},
- {"resource.004", 0, "f18441027154292836b973c655fa3175", 290173},
- {"resource.005", 0, "f18441027154292836b973c655fa3175", 302946},
- {"resource.006", 0, "f18441027154292836b973c655fa3175", 282465},
- {"resource.007", 0, "f18441027154292836b973c655fa3175", 257174},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 3 - English DOS Non-Interactive Demo
- // SCI interpreter version 0.000.530
- {{"lsl3", "Demo", {
- {"resource.map", 0, "33a2384f395470af3d2180e37ad0322a", 1140},
- {"resource.001", 0, "f773d79b93dfd4052ec8c1cc64c1e6ab", 76525},
- {"resource.002", 0, "f773d79b93dfd4052ec8c1cc64c1e6ab", 268299},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 3 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723832)
- // Executable scanning reports "S.old.123"
- // SCI interpreter version 0.000.572 (just a guess)
- {{"lsl3", "", {
- {"resource.map", 0, "4a77c8382e48a90c4168d3c144fc1b8f", 6480},
- {"resource.001", 0, "3827a9b17b926e12dcc336860f50612a", 460488},
- {"resource.002", 0, "3827a9b17b926e12dcc336860f50612a", 672403},
- {"resource.003", 0, "3827a9b17b926e12dcc336860f50612a", 587036},
- {"resource.004", 0, "3827a9b17b926e12dcc336860f50612a", 691932},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 3 - French DOS (provided by richiefs in bug report #2670691)
- // Executable scanning reports "S.old.123"
- // SCI interpreter version 0.000.572 (just a guess)
- {{"lsl3", "", {
- {"resource.map", 0, "13541234d440c7988a13582468b0e4be", 6480},
- {"resource.001", 0, "65f1bdaa20f6d0470e9d969f22473873", 457402},
- {"resource.002", 0, "65f1bdaa20f6d0470e9d969f22473873", 671614},
- {"resource.003", 0, "65f1bdaa20f6d0470e9d969f22473873", 586921},
- {"resource.004", 0, "65f1bdaa20f6d0470e9d969f22473873", 690826},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Larry 5 - English Amiga
- // Executable scanning reports "1.004.023"
- // SCI interpreter version 1.000.784
- {{"lsl5", "", {
- {"resource.map", 0, "e36052ae0c8b14d6f074bcb0aee50a38", 6096},
- {"resource.000", 0, "d8b58ce10de52aa16f8b2006838c4fcc", 310510},
- {"resource.001", 0, "8caa8fbb50ea43f3efdfb66f1e68998b", 800646},
- {"resource.002", 0, "abdaa299e00c908052d33cd82eb60e9b", 784576},
- {"resource.003", 0, "810ad1d61638c27a780576cb09f18ed7", 805941},
- {"resource.004", 0, "3ce5901f1bc171ac0274d99a4eeb9e57", 623022},
- {"resource.005", 0, "f8b2d1137bb767e5d232056b99dd69eb", 623621},
- {"resource.006", 0, "bafc64e3144f115dc58c6aee02de98fb", 715598},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - German Amiga
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.784
- {{"lsl5", "", {
- {"resource.map", 0, "863326c2eb5160f0b0960e159e8bf954", 6372},
- {"resource.000", 0, "5113d03db08e3da77a5b61294001331b", 357525},
- {"resource.001", 0, "59eba83ad465b08d763b44f86afa86f6", 837566},
- {"resource.002", 0, "59eba83ad465b08d763b44f86afa86f6", 622229},
- {"resource.003", 0, "59eba83ad465b08d763b44f86afa86f6", 383690},
- {"resource.004", 0, "59eba83ad465b08d763b44f86afa86f6", 654296},
- {"resource.005", 0, "59eba83ad465b08d763b44f86afa86f6", 664717},
- {"resource.006", 0, "bafc64e3144f115dc58c6aee02de98fb", 754966},
- {"resource.007", 0, "59eba83ad465b08d763b44f86afa86f6", 683135},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - English DOS Non-Interactive Demo (from FRG)
- // SCI interpreter version 1.000.181
- {{"lsl5", "Demo", {
- {"resource.map", 0, "efe8d3f45ce4f6bd9a6643e0ac8d2a97", 504},
- {"resource.001", 0, "8bd8d9c0b5f455ee1269d63ce86c50dd", 531380},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - English DOS (from spookypeanut)
- // SCI interpreter version 1.000.510
- {{"lsl5", "", {
- {"resource.map", 0, "be00ef895197754ae4eab021ca44cbcd", 6417},
- {"resource.000", 0, "f671ab479df0c661b19cd16237692846", 726823},
- {"resource.001", 0, "db4a1381d88028876a99303bfaaba893", 751296},
- {"resource.002", 0, "d39d8db1a1e7806e7ccbfea3ef22df44", 1137646},
- {"resource.003", 0, "13fd4942bb818f9acd2970d66fca6509", 768599},
- {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1024516},
- {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 1011944},
- {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1024810},
- {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 1030656},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - German DOS (from Tobis87)
- // SCI interpreter version 1.000.510 (just a guess)
- {{"lsl5", "", {
- {"resource.map", 0, "c97297aa76d4dd2ed144c7b7769e2caf", 6867},
- {"resource.000", 0, "4c00c14b8181ad47076a51d86097d97e", 759095},
- {"resource.001", 0, "245c44f8ccd796732e61857e67b30079", 918742},
- {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 947382},
- {"resource.003", 0, "74edc89d8c1cb346ca346081b927e4c6", 1006884},
- {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1023776},
- {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 959342},
- {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1021774},
- {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 993408},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - French DOS (provided by richiefs in bug report #2670691)
- // Executable scanning reports "1.lsl5.019"
- // SCI interpreter version 1.000.510 (just a guess)
- {{"lsl5", "", {
- {"resource.map", 0, "499898e652dc41b51e368ae41acce41f", 7023},
- {"resource.000", 0, "4c00c14b8181ad47076a51d86097d97e", 958096},
- {"resource.001", 0, "245c44f8ccd796732e61857e67b30079", 1196765},
- {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 948898},
- {"resource.003", 0, "74edc89d8c1cb346ca346081b927e4c6", 1006608},
- {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 971293},
- {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 920524},
- {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 946540},
- {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 958842},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - Spanish DOS (from the Leisure Suit Larry Collection)
- // Executable scanning reports "1.ls5.006", VERSION file reports "1.000, 4/21/92"
- // SCI interpreter version 1.000.510 (just a guess)
- {{"lsl5", "", {
- {"resource.map", 0, "b6f7da7bf24e5a6b2946032cec3ea59c", 6861},
- {"resource.000", 0, "4c00c14b8181ad47076a51d86097d97e", 765418},
- {"resource.001", 0, "245c44f8ccd796732e61857e67b30079", 916028},
- {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 929645},
- {"resource.003", 0, "74edc89d8c1cb346ca346081b927e4c6", 1005496},
- {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1021996},
- {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 958079},
- {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1015136},
- {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 987222},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 5 - Italian DOS Floppy (from glorifindel)
- // SCI interpreter version 1.000.510 (just a guess)
- {{"lsl5", "", {
- {"resource.map", 0, "a99776df795127f387cb35dae872d4e4", 5919},
- {"resource.000", 0, "a8989a5a89e7d4f702b26b378c7a357a", 7001981},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 6 - English DOS (from spookypeanut)
- // SCI interpreter version 1.001.113
- {{"lsl6", "", {
- {"resource.map", 0, "bb8a39d9e2a77ba449a1e591109ad9a8", 6973},
- {"resource.000", 0, "4462fe48c7452d98fddcec327a3e738d", 5789138},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 6 - English/German/French DOS CD - LORES
- // SCI interpreter version 1.001.115
- {{"lsl6", "", {
- {"resource.map", 0, "0b91234b7112782962cb480b7791b6e2", 7263},
- {"resource.000", 0, "57d5fe8bb9e044158514476ea7678eb0", 5754790},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 6 - German DOS CD - LORES (provided by richiefs in bug report #2670691)
- // SCI interpreter version 1.001.115
- {{"lsl6", "", {
- {"resource.map", 0, "bafe85f32738854135991d4324ad147e", 7268},
- {"resource.000", 0, "f6cbc6da7b90ea135883e0759848ca2c", 5773160},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 6 - French DOS CD - LORES (provided by richiefs in bug report #2670691)
- // SCI interpreter version 1.001.115
- {{"lsl6", "", {
- {"resource.map", 0, "97797ea775baaf18a1907d357d3c0ea6", 7268},
- {"resource.000", 0, "f6cbc6da7b90ea135883e0759848ca2c", 5776092},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 6 - Spanish DOS - LORES (from the Leisure Suit Larry Collection)
- // Executable scanning reports "1.001.113", VERSION file reports "1.000, 11.06.93, FIVE PATCHES ADDED TO DISK 6 ON 11-18-93"
- {{"lsl6", "", {
- {"resource.map", 0, "633bf8f42170b6271019917c8009989b", 6943},
- {"resource.000", 0, "7884a8db9253e29e6b37a2651fd90ba3", 5733116},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Leisure Suit Larry's Casino - English DOS (from the Leisure Suit Larry Collection)
- // Executable scanning reports "1.001.029", VERSION file reports "1.000"
- {{"lslcasino", "", {
- {"resource.map", 0, "194f1578f2624db813c9072359ad1639", 783},
- {"resource.001", 0, "3733433b517ec3d14a3331d9ab3842ae", 344830},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Larry 6 - English/German DOS CD - HIRES
- // SCI interpreter version 2.100.002
- {{"lsl6", "", {
- {"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872},
- {"resource.000", 0, "9a9f4870504444cda863dd14d077a680", 18520872},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 6 - German DOS CD - HIRES (provided by richiefs in bug report #2670691)
- // SCI interpreter version 2.100.002
- {{"lsl6", "", {
- {"resource.map", 0, "badfdf446ffed569a310d2c63a249421", 8896},
- {"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18534274},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 6 - French DOS CD - HIRES (provided by richiefs in bug report #2670691)
- // SCI interpreter version 2.100.002
- {{"lsl6", "", {
- {"resource.map", 0, "d184e9aa4f2d4b5670ddb3669db82cda", 8896},
- {"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18538987},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 7 - English DOS CD (from spookypeanut)
- // SCI interpreter version 3.000.000
- {{"lsl7", "", {
- {"resmap.000", 0, "eae93e1b1d1ccc58b4691c371281c95d", 8188},
- {"ressci.000", 0, "89353723488219e25589165d73ed663e", 66965678},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 7 - German DOS (from Tobis87)
- // SCI interpreter version 3.000.000
- {{"lsl7", "", {
- {"resmap.000", 0, "c11e6bfcfc2f2d05da47e5a7df3e9b1a", 8188},
- {"ressci.000", 0, "a8c6817bb94f332ff498a71c8b47f893", 66971724},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 7 - French DOS (provided by richiefs in bug report #2670691)
- // SCI interpreter version 3.000.000
- {{"lsl7", "", {
- {"resmap.000", 0, "4407849fd52fe3efb0c30fba60cd5cd4", 8206},
- {"ressci.000", 0, "dc37c3055fffbefb494ff22b145d377b", 66964472},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 7 - Italian DOS CD (from glorifindel)
- // SCI interpreter version 3.000.000
- {{"lsl7", "", {
- {"resmap.000", 0, "9852a97141f789413f29bf956052acdb", 8212},
- {"ressci.000", 0, "440b9fed89590abb4e4386ed6f948ee2", 67140181},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Larry 7 - Spanish DOS (from the Leisure Suit Larry Collection)
- // Executable scanning reports "3.000.000", VERSION file reports "1.0s"
- {{"lsl7", "", {
- {"resmap.000", 0, "8f3d603e1acc834a5d598b30cdfc93f3", 8188},
- {"ressci.000", 0, "32792f9bc1bf3633a88b382bb3f6e40d", 67071418},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691)
- // SCI interpreter version 2.100.002
- {{"lsl7", "Demo", {
- {"ressci.000", 0, "5cc6159688b2dc03790a67c90ccc67f9", 10195878},
- {"resmap.000", 0, "6a2b2811eef82e87cde91cf1de845af8", 2695},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Lighthouse - English Windows Demo (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "1.00"
- {{"lighthouse", "Demo", {
- {"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64},
- {"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Lighthouse - English Windows Demo
- // Executable scanning reports "3.000.000", VERSION file reports "1.00"
- {{"lighthouse", "Demo", {
- {"resmap.000", 0, "3bdee7a16926975a4729f75cf6b80a92", 1525},
- {"ressci.000", 0, "3c585827fa4a82f4c04a56a0bc52ccee", 11494351},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Lighthouse - English DOS (from jvprat)
- // Executable scanning reports "3.000.000", VERSION file reports "1.1"
- {{"lighthouse", "", {
- {"resmap.001", 0, "47abc502c0b541b582db28f38dbc6a56", 7801},
- {"ressci.001", 0, "14e922c47b92156377cb49e241691792", 99591924},
- {"resmap.002", 0, "c68db5333f152fea6ca2dfc75cad8b34", 7573},
- {"ressci.002", 0, "175468431a979b9f317c294ce3bc1430", 94628315},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Lighthouse - Spanish DOS (from jvprat)
- // Executable scanning reports "3.000.000", VERSION file reports "1.1"
- {{"lighthouse", "", {
- {"resmap.001", 0, "c5d49b2a8a4eafc92fd041a3a0f2da68", 7846},
- {"ressci.001", 0, "18553177dbf83fb2cb6c8edcbb174183", 99543093},
- {"resmap.002", 0, "e7dc85884a2417e2eff9de0c63dd65fa", 7630},
- {"ressci.002", 0, "3c8d627c555b0e3e4f1d9955bc0f0df4", 94631127},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Mixed-Up Fairy Tales v1.000 - English DOS Non-Interactive Demo
- {{"fairytales", "Demo", {
- {"resource.map", 0, "c2cf672c3f4251e7472d4542af3bf764", 933},
- {"resource.000", 0, "8be56a3a88c065ee00c02c0e29199f3a", 14643},
- {"resource.001", 0, "9e33566515b18bee7915db448063bba2", 871853},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Mixed-Up Fairy Tales v1.000 - English DOS (supplied by markcoolio in bug report #2723791)
- // Executable scanning reports "1.000.145"
- {{"fairytales", "", {
- {"resource.map", 0, "9ae5aecc1cb797b11ea5cf0caeea272c", 3261},
- {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 923685},
- {"resource.001", 0, "49c8f7dcd9989e4491a93554bec325b0", 52324},
- {"resource.002", 0, "6767f8c8585f617aaa91d442f41ae714", 1032989},
- {"resource.003", 0, "b1288e0821ee358d1ffe877e5900c8ec", 1047565},
- {"resource.004", 0, "f79daa70390d73746742ffcfc3dc4471", 937580},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Mixed-Up Fairy Tales - English DOS Floppy (from jvprat)
- // Executable scanning reports "1.000.145", Floppy label reports "1.0, 11.13.91", VERSION file reports "1.000"
- {{"fairytales", "", {
- {"resource.map", 0, "66105c02fa8f1785a3fd28957e41cb48", 3249},
- {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 984439},
- {"resource.001", 0, "49c8f7dcd9989e4491a93554bec325b0", 238019},
- {"resource.002", 0, "564f516d991032e781492592a4eaa275", 1414142},
- {"resource.003", 0, "dd6cef0c592eadb7e6be9a25307c57a2", 1344719},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Mixed-Up Mother Goose - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.003.009"
- // SCI interpreter version 0.001.010
- {{"mothergoose", "", {
- {"resource.map", 0, "4aa28ac93fae03cf854594da13d9229c", 2700},
- {"resource.001", 0, "fb552ae550ca1dac19ed8f6a3767612d", 262885},
- {"resource.002", 0, "fb552ae550ca1dac19ed8f6a3767612d", 817191},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Mixed-Up Mother Goose v2.000 - English DOS Floppy (supplied by markcoolio in bug report #2723795)
- // Executable scanning reports "1.001.031"
- {{"mothergoose", "", {
- {"resource.map", 0, "52aae15e493cafd1da7e1c9b657a5bb9", 7026},
- {"resource.000", 0, "b7ecd8ae9e254e80310b5a668b276e6e", 2948975},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Mixed-Up Mother Goose - English DOS CD (from jvprat)
- // Executable scanning reports "x.yyy.zzz"
- // SCI interpreter version 0.000.999 (just a guess)
- {{"mothergoose", "CD", {
- {"resource.map", 0, "1c7f311b0a2c927b2fbe81ae341fb2f6", 5790},
- {"resource.001", 0, "5a0ed1d745855148364de1b3be099bac", 4369438},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Mixed-Up Mother Goose - English Windows Interactive Demo
- // Executable scanning reports "x.yyy.zzz"
- {{"mothergoose", "Demo", {
- {"resource.map", 0, "87f9dc1cafc4d4fa835fb2f00cf3a6ef", 4560},
- {"resource.001", 0, "5a0ed1d745855148364de1b3be099bac", 2070072},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
- // Executable scanning reports "2.100.002"
- {{"mothergoose", "", {
- {"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741},
- {"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Ms. Astro Chicken - English DOS
- // SCI interpreter version 1.000.679
- {{"msastrochicken", "", {
- {"resource.map", 0, "5b457cbe5042f557e5b610148171f6c0", 1158},
- {"resource.001", 0, "453ea81ef66a50cbe33ce06302afe47f", 229737},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Phantasmagoria - English DOS (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "1.100.000UK"
- {{"phantasmagoria", "", {
- {"resmap.001", 0, "416138651ea828219ca454cae18341a3", 11518},
- {"ressci.001", 0, "3aae6559aa1df273bc542d5ac6330d75", 65844612},
- {"resmap.002", 0, "de521d0c7ab32897e7fe58e421c816b7", 12058},
- {"ressci.002", 0, "3aae6559aa1df273bc542d5ac6330d75", 71588691},
- {"resmap.003", 0, "25df95bd7da3686f71a0af8784a2b8ca", 12334},
- {"ressci.003", 0, "3aae6559aa1df273bc542d5ac6330d75", 73651084},
- {"resmap.004", 0, "e108a3d35794f1721aeea3e62a3f8b3b", 12556},
- {"ressci.004", 0, "3aae6559aa1df273bc542d5ac6330d75", 75811935},
- {"resmap.005", 0, "390d81f9e14a3f3ee2ea477135f0288e", 12604},
- {"ressci.005", 0, "3aae6559aa1df273bc542d5ac6330d75", 78814934},
- {"resmap.006", 0, "8ea3c954606e80604680f9fe707f15d8", 12532},
- {"ressci.006", 0, "3aae6559aa1df273bc542d5ac6330d75", 77901360},
- {"resmap.007", 0, "afbd16ea77869a720afa1c5371de107d", 7972},
- //{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Phantasmagoria 2 - English Windows (from jvprat)
- // Executable scanning reports "3.000.000", VERSION file reports "001.0.06"
- {{"phantasmagoria2", "", {
- {"resmap.001", 0, "0a961e135f4f7effb195158325856633", 1108},
- {"ressci.001", 0, "53f457cddb0dffc056593905c4cbb989", 24379964},
- {"resmap.002", 0, "5d3189fe3d4f286f83c5c8031fa3e9f7", 1126},
- {"ressci.002", 0, "53f457cddb0dffc056593905c4cbb989", 34465805},
- {"resmap.003", 0, "c92e3c840b827c236ab6671c03760c56", 1162},
- {"ressci.003", 0, "53f457cddb0dffc056593905c4cbb989", 38606375},
- {"resmap.004", 0, "8d5cfe19365f71370b87063686f39171", 1288},
- {"ressci.004", 0, "53f457cddb0dffc056593905c4cbb989", 42447131},
- {"resmap.005", 0, "8bd5ceeedcbe16dfe55d1b90dcd4be84", 1942},
- {"ressci.005", 0, "05f9fe2bee749659acb3cd2c90252fc5", 67905112},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Pepper's Adventure In Time 1.000 English
- // Executable scanning reports "1.001.072", VERSION file reports "1.000"
- {{"pepper", "", {
- {"resource.map", 0, "72726dc81c1b4c1110c486be77369bc8", 5179},
- {"resource.000", 0, "670d0c53622429f4b11275caf7f8d292", 5459574},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Pepper - English DOS Non-Interactive Demo
- // Executable scanning reports "1.001.060", VERSION file reports "1.000"
- {{"pepper", "Demo", {
- {"resource.map", 0, "379bb4fb896630b14f2d91ed21e36ba1", 984},
- {"resource.000", 0, "118f6c31a93ec7fd9a231c61125229e3", 645494},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Pepper - English DOS/Windows Interactive Demo
- // Executable scanning reports "1.001.069", VERSION file reports ".001"
- {{"pepper", "Demo", {
- {"resource.map", 0, "975e8df76106a5c13d12ab674f906a02", 2514},
- {"resource.000", 0, "e6a918a2dd7a4bcecd8fb389f43287c2", 1698164},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Pepper - English DOS Interactive Demo
- // Executable scanning reports "1.001.072", VERSION file reports "1.000"
- {{"pepper", "Demo", {
- {"resource.map", 0, "9c9b7b900651a370dd3fb38d478b1798", 2524},
- {"resource.000", 0, "e6a918a2dd7a4bcecd8fb389f43287c2", 1713544},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 1 VGA Remake - English DOS (from the Police Quest Collection)
- // Executable scanning reports "1.001.029", VERSION file reports "2.000"
- {{"pq1sci", "VGA Remake", {
- {"resource.map", 0, "35efa814fb994b1cbdac9611e401da67", 5013},
- {"resource.000", 0, "e0d5ddf34eda903a38f0837e2aa7145b", 6401433},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 2 - English Amiga (from www.back2roots.org)
- // SCI interpreter version 0.000.685 (just a guess)
- {{"pq2", "", {
- {"resource.map", 0, "499de78ae72b7ce219f944c5e7ef0c5b", 3426},
- {"resource.000", 0, "77f02def3094af804fd2371db25b7100", 250232},
- {"resource.001", 0, "523db0c07f1da2a822c2c39ee0482544", 179334},
- {"resource.002", 0, "499737c21a28ac026e11ab817100d610", 511099},
- {"resource.003", 0, "e008f5d6e2a7c4d4a0da0173e4fa8f8b", 553970},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 2 - English DOS Non-Interactive Demo
- // Executable scanning reports "0.000.413"
- {{"pq2", "Demo", {
- {"resource.map", 0, "8b77d0d4650c2052b356cece28294b58", 576},
- {"resource.001", 0, "376ef6d6eaaeed66e1424bd219c4b9ab", 215398},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Police Quest 2 - English DOS (provided by richiefs in bug report #2670691)
- // SCI interpreter version 0.000.395
- {{"pq2", "", {
- {"resource.map", 0, "9cff78c4be9e6a4848b6e9377569e3d9", 5700},
- {"resource.001", 0, "77f02def3094af804fd2371db25b7100", 163291},
- {"resource.002", 0, "77f02def3094af804fd2371db25b7100", 329367},
- {"resource.003", 0, "77f02def3094af804fd2371db25b7100", 305819},
- {"resource.004", 0, "77f02def3094af804fd2371db25b7100", 342149},
- {"resource.005", 0, "77f02def3094af804fd2371db25b7100", 349899},
- {"resource.006", 0, "77f02def3094af804fd2371db25b7100", 354991},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Police Quest 2 - English DOS (from the Police Quest Collection)
- // Executable scanning reports "0.000.490"
- {{"pq2", "", {
- {"resource.map", 0, "28a6f471c7900c2c92da40eecb615d9d", 4584},
- {"resource.001", 0, "77f02def3094af804fd2371db25b7100", 509525},
- {"resource.002", 0, "77f02def3094af804fd2371db25b7100", 546000},
- {"resource.003", 0, "77f02def3094af804fd2371db25b7100", 591851},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Police Quest 2 - English DOS (from FRG)
- // SCI interpreter version 0.000.395
- {{"pq2", "", {
- {"resource.map", 0, "fe019e9773623fcb7da810db9e64c8a9", 4548},
- {"resource.001", 0, "77f02def3094af804fd2371db25b7100", 509760},
- {"resource.002", 0, "77f02def3094af804fd2371db25b7100", 542897},
- {"resource.003", 0, "77f02def3094af804fd2371db25b7100", 586857},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Police Quest 3 - English Amiga
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.784
- {{"pq3", "", {
- {"resource.map", 0, "29923fe1ef1f0909b57255d61c558e68", 5742},
- {"resource.000", 0, "4908e4f4977e8e19c90c29b36a741ffe", 298541},
- {"resource.001", 0, "0eb943ca807e2f69578821d490770d2c", 836567},
- {"resource.002", 0, "f7044bb08a1fcbe5077791ed8d4996f0", 691207},
- {"resource.003", 0, "630bfa65beb05f743552704ac2899dae", 759891},
- {"resource.004", 0, "7b229fbdf30d670d0728cede3e984a7e", 838663},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 3 - German Amiga
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.784
- {{"pq3", "", {
- {"resource.map", 0, "357304811fc2bbaa3443fc62d677fe06", 6282},
- {"resource.000", 0, "49879e6ce7c19151ffa6af1a09763dc7", 324273},
- {"resource.001", 0, "015e6119badb391ab5f4b36abedb5d4a", 718814},
- {"resource.002", 0, "1ee419ba252fbed47fbce8399f56f8ad", 674823},
- {"resource.003", 0, "87361c17fd863b58f98828de68770279", 682288},
- {"resource.004", 0, "6258d5dd85898d8e218eb8113ebc9059", 722738},
- {"resource.005", 0, "6258d5dd85898d8e218eb8113ebc9059", 704485},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 3 - English DOS (from the Police Quest Collection)
- // Executable scanning reports "T.A00.178", VERSION file reports "1.00"
- // SCI interpreter version 1.000.510
- {{"pq3", "", {
- {"resource.map", 0, "6457bf0c8ca865a42d9ff5827ab49b89", 5559},
- {"resource.000", 0, "7659713720d61d9465a59091b7ee63ea", 737253},
- {"resource.001", 0, "61c7c187d25a8346be0a092d5f037278", 1196787},
- {"resource.002", 0, "c18e0d408e4f4f40365d42aa15931f67", 1153561},
- {"resource.003", 0, "8791b9eef53edf77c2dac950142221d3", 1159791},
- {"resource.004", 0, "1b91e891a3c60a941dac0eecdf83375b", 1143606},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 3 - English DOS Non-Interactive Demo
- // Executable scanning reports "T.A00.052"
- // SCI interpreter version 1.000.510
- {{"pq3", "Demo", {
- {"resource.map", 0, "ec8e58e7663ae5173853abf6c76b52bb", 867},
- {"resource.000", 0, "277f97771f7a6d89677141f02da313d6", 65150},
- {"resource.001", 0, "5c5a551b6c86cce2ee75becb90e0b586", 624411},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 3 - German DOS (supplied by markcoolio in bug report #2723837)
- // Executable scanning reports "T.A00.178"
- // SCI interpreter version 1.000.510
- {{"pq3", "", {
- {"resource.map", 0, "8a970edf98eba4c11bb1827aab1694d1", 5625},
- {"resource.000", 0, "5ee460af3d70c06a745cc482b6c783ba", 865204},
- {"resource.001", 0, "ff6182bf96c8f8af5bd8c11769c9cbf2", 1183456},
- {"resource.002", 0, "cce99b96a578b62ff6cebdae8d122feb", 1179358},
- {"resource.003", 0, "4836f460f4cfc8de61e2df4c45775504", 1180956},
- {"resource.004", 0, "0c3eb84b9755852d9e795e0d5c9373c7", 1171760},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 4 - English DOS Non-Interactive Demo (from FRG)
- // SCI interpreter version 1.001.096
- {{"pq4", "Demo", {
- {"resource.map", 0, "be56f87a1c4a13062a30a362df860c2f", 1472},
- {"resource.000", 0, "527d5684016e6816157cd15d9071b11b", 1121310},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Police Quest 4 - English DOS (from the Police Quest Collection)
- // Executable scanning reports "2.100.002", VERSION file reports "1.100.000"
- {{"pq4", "", {
- {"resource.map", 0, "379dfe80ed6bd16c47e4b950c4722eac", 11374},
- {"resource.000", 0, "fd316a09b628b7032248139003369022", 18841068},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 4 - English DOS
- // SCI interpreter version 2.000.000 (a guess?)
- {{"pq4", "", {
- {"resource.map", 0, "aed9643158ccf01b71f359db33137f82", 9895},
- {"resource.000", 0, "da383857b3be1e4514daeba2524359e0", 15141432},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest 4 - German DOS (supplied by markcoolio in bug report #2723840)
- // SCI interpreter version 2.000.000 (a guess?)
- {{"pq4", "", {
- {"resource.map", 0, "2393ee728ab930b2762cb5889f9b5aff", 9256},
- {"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730155},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest: SWAT - English DOS/Windows Demo (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "0.001.200"
- {{"pqswat", "Demo", {
- {"resource.map", 0, "8c96733ef94c21526792f7ca4e3f2120", 1648},
- {"resource.000", 0, "d8892f1b8c56c8f7704325460f49b300", 3676175},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Police Quest: SWAT - English Windows (from the Police Quest Collection)
- // Executable scanning reports "2.100.002", VERSION file reports "1.0c"
- {{"pqswat", "", {
- {"resmap.001", 0, "de5ea1beb3d9490737aa5fd398fe9765", 6937},
- {"ressci.001", 0, "7cd5414f54748f90904a46123a52472f", 29467363},
- {"resmap.002", 0, "ff7a7e0f3dea2c73182b7ea84e3431cc", 6211},
- {"ressci.002", 0, "e613357f3349c4bfa5a7b7b312be7f97", 25987989},
- {"resmap.003", 0, "84303aa019fa75a0eb20ba502bc4ccae", 6601},
- {"ressci.003", 0, "00a755e917c442ca8cf1a1bea689e6fb", 45073980},
- {"resmap.004", 0, "4228038906f041623e65789500b22285", 6835},
- {"ressci.004", 0, "b7e619e6ecf62fe65d5116a3a422e5f0", 46223872},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by merkur in bug report #2718784)
- // Executable scanning reports "0.000.566"
- {{"qfg1", "", {
- {"resource.map", 0, "c1dc4470fb947c067567252f62d6c1b6", 6474},
- {"resource.000", 0, "481b034132106390cb5160fe61dd5f58", 80334},
- {"resource.001", 0, "4d67acf52833ff45c7f753d6663532e8", 462727},
- {"resource.002", 0, "439ba9b6dde216e6eb97ef3a9830fbe4", 646869},
- {"resource.003", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 642203},
- {"resource.004", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 641688},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Quest for Glory 1 / Hero's Quest - English DOS 5.25" Floppy (supplied by markcoolio in bug report #2723843)
- // Executable scanning reports "0.000.566"
- {{"qfg1", "", {
- {"resource.map", 0, "94bc3f2ae2dad12f1303606740d087ff", 6936},
- {"resource.000", 0, "481b034132106390cb5160fe61dd5f58", 80334},
- {"resource.001", 0, "4d67acf52833ff45c7f753d6663532e8", 95498},
- {"resource.002", 0, "3e2a89d60d385caca5b3394049da4bc4", 271587},
- {"resource.003", 0, "e56e9fd2f7d2c98774699f7a5087e524", 255998},
- {"resource.004", 0, "d74cd4290bf60e1409117202e4ce8592", 266415},
- {"resource.005", 0, "7288ed6d5da89b7a80b4af3897a7963a", 271185},
- {"resource.006", 0, "69366c2a2f99917199fe1b60a4fee19d", 267852},
- {"resource.007", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 272747},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Quest for Glory 1 - Japanese PC-98 5.25" Floppy
- // Executable scanning reports "S.old.201"
- {{"qfg1", "8 Colors", {
- {"resource.map", 0, "5cbeb95dd2a4b7cb242b415cc6ec1c47", 6444},
- {"resource.001", 0, "a21451ef6fa8179bd4b22c4950004c44", 859959},
- {"resource.002", 0, "a21451ef6fa8179bd4b22c4950004c44", 1136968},
- {"resource.003", 0, "a21451ef6fa8179bd4b22c4950004c44", 769897},
- {NULL, 0, NULL, 0}}, Common::JA_JPN, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 1 - Japanese PC-98 5.25" Floppy
- // Executable scanning reports "S.old.201"
- {{"qfg1", "16 Colors", {
- {"resource.map", 0, "3ecaba33bf77cb434067a0b8aee15097", 6444},
- {"resource.001", 0, "a21451ef6fa8179bd4b22c4950004c44", 864754},
- {"resource.002", 0, "a21451ef6fa8179bd4b22c4950004c44", 1147121},
- {"resource.003", 0, "a21451ef6fa8179bd4b22c4950004c44", 777575},
- {NULL, 0, NULL, 0}}, Common::JA_JPN, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 1 - English Amiga
- // Executable scanning reports "1.002.020"
- // SCI interpreter version 0.000.685
- {{"qfg1", "", {
- {"resource.map", 0, "e65034832f0c9df1dc22128227b782d0", 6066},
- {"resource.000", 0, "1c0255dea2d3cd71eee9f2db201eee3f", 111987},
- {"resource.001", 0, "a270012fa74445d74c044d1b65a9ff8c", 143570},
- {"resource.002", 0, "e64004e020fdf1813be52b639b08be89", 553201},
- {"resource.003", 0, "16cd4414c37ae3bb6d6da33dce8e25e8", 654096},
- {"resource.004", 0, "16cd4414c37ae3bb6d6da33dce8e25e8", 689124},
- {"resource.005", 0, "5f3386ef2f2b1254e4a066f5d9027324", 609529},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 1 - English DOS
- // SCI interpreter version 0.000.629
- {{"qfg1", "", {
- {"resource.map", 0, "74a108a7fb345bfc84f4113b6e5241bb", 6432},
- {"resource.000", 0, "40332d3ebfc70a4b6a6a0443c2763287", 79181},
- {"resource.001", 0, "917fcef303e9489597154727baaa9e07", 461422},
- {"resource.002", 0, "05ddce5f437a516b89ede2438fac09d8", 635734},
- {"resource.003", 0, "951299a82a8134ed12c5c18118d45c2f", 640483},
- {"resource.004", 0, "951299a82a8134ed12c5c18118d45c2f", 644443},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 1 VGA Remake - English DOS
- // Executable scanning reports "2.000.411"
- {{"qfg1", "VGA Remake", {
- {"resource.map", 0, "a731fb6c9c0b282443f7027bc8694d4c", 8469},
- {"resource.000", 0, "ecace1a2771846b1a8aa1afdd44111a0", 6570147},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 1 VGA Remake - English DOS Non-Interactive Demo (from FRG)
- // SCI interpreter version 1.001.029
- {{"qfg1", "VGA Remake Demo", {
- {"resource.map", 0, "ac0257051c95a59c0cdc0be24d9b11fa", 729},
- {"resource.000", 0, "ec6f5cf369054dd3e5392995e9975b9e", 768218},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 2 - English Amiga
- // Executable scanning reports "1.003.004"
- // SCI interpreter version 0.001.010
- {{"qfg2", "", {
- {"resource.map", 0, "365ea1033ba26d227ec4007be88c59cc", 7596},
- {"resource.000", 0, "810245be50fde5a67e3ea95e876e3e64", 233341},
- {"resource.001", 0, "7a5fde9875211ed67a896fc0d91940c8", 127294},
- {"resource.002", 0, "dcf6bc2c18660d7ad532fb61861eb721", 543644},
- {"resource.003", 0, "dcf6bc2c18660d7ad532fb61861eb721", 565044},
- {"resource.004", 0, "dcf6bc2c18660d7ad532fb61861eb721", 466630},
- {"resource.005", 0, "a77d2576c842b2b06da57d4ac8fc51c0", 579975},
- {"resource.006", 0, "ccf5dba33e5cab6d5872838c0f8db44c", 500039},
- {"resource.007", 0, "4c9fc1587545879295cb9627f56a2cb8", 575056},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 2 - English (from FRG)
- // Executable scanning reports "1.000.072"
- {{"qfg2", "", {
- {"resource.map", 0, "bc79c5685c00edab3ad6df18691703bc", 6906},
- {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212119},
- {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 867866},
- {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 790750},
- {"resource.003", 0, "b192607c42f6960ecdf2ad2e4f90e9bc", 972804},
- {"resource.004", 0, "cd2de58e27665d5853530de93fae7cd6", 983617},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 2 - English DOS
- // Executable scanning reports "1.000.072"
- {{"qfg2", "", {
- {"resource.map", 0, "be23af27e9557bf232efe213ac7f277c", 8166},
- {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212120},
- {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 331973},
- {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 467505},
- {"resource.003", 0, "df137dc7869cab07e1149ba2333c815c", 502560},
- {"resource.004", 0, "df137dc7869cab07e1149ba2333c815c", 488541},
- {"resource.005", 0, "df137dc7869cab07e1149ba2333c815c", 478688},
- {"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
- {"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 2 - English DOS Non-Interactive Demo
- // Executable scanning reports "1.000.046"
- {{"qfg2", "Demo", {
- {"resource.map", 0, "e75eb86bdd517b3ef709058249986a87", 906},
- {"resource.001", 0, "9b098f9e1008abe30e56c93b896494e6", 362123},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 3 - English DOS Non-Interactive Demo (from FRG)
- // Executable scanning reports "1.001.021", VERSION file reports "1.000, 0.001.059, 6.12.92"
- {{"qfg3", "Demo", {
- {"resource.map", 0, "fd71de9b588a45f085317caacf050e91", 687},
- {"resource.000", 0, "b6c69bf6c18bf177492249fe81fc6a6d", 648702},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 3 - English DOS
- // SCI interpreter version 1.001.050
- {{"qfg3", "", {
- {"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
- {"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868000},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 3 - German DOS (supplied by markcoolio in bug report #2723846)
- // Executable scanning reports "L.rry.083"
- {{"qfg3", "", {
- {"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
- {"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868042},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 3 - Spanish DOS CD (from jvprat)
- // Executable scanning reports "L.rry.083", VERSION file reports "1.000.000, June 30, 1994"
- {{"qfg3", "", {
- {"resource.map", 0, "10809197c33a5e62819311d8a2f73f85", 5978},
- {"resource.000", 0, "ba7ac86155e4c531e46cd73c86daa80a", 5884098},
- {"resource.msg", 0, "a63974730d294dec0bea10057c36e506", 256014},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Quest for Glory 4 - English DOS Non-Interactive Demo (from FRG)
- // SCI interpreter version 1.001.069 (just a guess)
- {{"qfg4", "Demo", {
- {"resource.map", 0, "1ba7c7ae1efb315326d45cb931569b1b", 922},
- {"resource.000", 0, "41ba03f0b188b029132daa3ece0d3e14", 623154},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Quest for Glory 4 1.1 Floppy - English DOS (supplied by markcool in bug report #2723852)
- // SCI interpreter version 2.000.000 (a guess?)
- {{"qfg4", "", {
- {"resource.map", 0, "685bdb1ed47bbbb0e5e25db392da83ce", 9301},
- {"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11004993},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 4 1.1 Floppy - German DOS (supplied by markcool in bug report #2723850)
- // SCI interpreter version 2.000.000 (a guess?)
- {{"qfg4", "", {
- {"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301},
- {"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Quest for Glory 4 - English DOS/Windows (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "1.0"
- {{"qfg4", "", {
- {"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246},
- {"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
-#if 0
- // NOTE: This version looks to be exactly the same as the English one
- // Perhaps it's the English one?
-
- // Quest for Glory 4 - German DOS/Windows (from PCJoker 2/98)
- {{"qfg4", "", {
- {"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246},
- {"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-#endif
-
- // Quest for Glory 4 - German DOS/Windows Disk V1.1 (from PCJoker 2/89)
- // SCI interpreter version 2.000.000 (a guess?)
- {{"qfg4", "", {
- {"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301},
- {"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-#endif
-
- // Slater & Charlie go camping
- {{"slater", "", {
- {"resource.000", 0, "1846b57fe84774be72f7c50ab3c90df0", 2256126},
- {"resource.map", 0, "21f85414124dc23e54544a5536dc35cd", 4044},
- {"resource.msg", 0, "c44f51fb955eae266fecf360ebcd5ad2", 1132},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // RAMA - English DOS/Windows Demo
- // Executable scanning reports "2.100.002", VERSION file reports "000.000.008"
- {{"rama", "Demo", {
- {"resmap.001", 0, "775304e9b2a545156be4d94209550094", 1393},
- {"ressci.001", 0, "259437fd75fdf51e8207fda8c01fa4fd", 2334384},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // RAMA - English Windows (from jvprat)
- // Executable scanning reports "3.000.000", VERSION file reports "1.100.000"
- {{"rama", "", {
- {"resmap.001", 0, "3bac72a1910a563f8f92cf5b77c8b7f2", 8338},
- {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70588050},
- {"resmap.002", 0, "83c2aa4653a985ab4b49ff60532ed08f", 12082},
- {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128562138},
- {"resmap.003", 0, "31ef4c0621711585d031f0ae81707251", 1636},
- {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6860492},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // RAMA - Italian Windows CD (from glorifindel)
- // SCI interpreter version 3.000.000 (a guess?)
- {{"rama", "", {
- {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70611091},
- {"resmap.001", 0, "70ba2ff04a2b7fb2c52420ba7fbd47c2", 8338},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE},
- 0
- },
-
- // Shivers - English Windows (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "1.02"
- {{"shivers", "", {
- {"resmap.000", 0, "f2ead37749ed8f6535a2445a7d05a0cc", 46525},
- {"ressci.000", 0, "4294c6d7510935f2e0a52e302073c951", 262654836},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Shivers - German Windows (from Tobis87)
- {{"shivers", "", {
- {"resmap.000", 0, "f483d0a1f78334c18052e92785c3086e", 46537},
- {"ressci.000", 0, "6751b144671e2deed919eb9d284b07eb", 262390692},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Shivers - English Windows Demo
- // Executable scanning reports "2.100.002"
- {{"shivers", "Demo", {
- {"resmap.000", 0, "d9e0bc5eddefcbe47f528760085d8927", 1186},
- {"ressci.000", 0, "3a93c6340b54e07e65d0e5583354d186", 10505469},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Shivers2 - English Windows Demo
- // Executable scanning reports "3.000.000"
- {{"shivers2", "Demo", {
- {"resmap.000", 0, "d8659188b84beaef076bd869837cd530", 634},
- {"ressci.000", 0, "7fbac0807a044c9543e8ac376d200e59", 4925003},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // Slater & Charlie Go Camping - English DOS Demo
- // Executable scanning reports "1.cfs.081", VERSION file reports "1.000"
- {{"slater", "Demo", {
- {"resource.map", 0, "61b4f74039399e5aa1e737b16d0fc023", 1409},
- {"resource.msg", 0, "1aeafe2b495de288d002109650b66614", 1364},
- {"resource.000", 0, "8e10d4f05c1fd9f883384fa38a898489", 377394},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 1 VGA Remake - English Amiga (from www.back2roots.org)
- // SCI interpreter version 1.000.510 (just a guess)
- {{"sq1sci", "VGA Remake", {
- {"resource.map", 0, "106484b372af1d4cbf866472cc2813dc", 6396},
- {"resource.000", 0, "cc9d6ace343661ae51ec8bd6e6b00a8c", 340944},
- {"resource.001", 0, "59efcfa2268d2f8608f544e2674d8151", 761721},
- {"resource.002", 0, "f00ef883128bf5fc2fbb888cdd7adf25", 814461},
- {"resource.003", 0, "2588c1c2ca8b9bed0e3411948c0856a9", 839302},
- {"resource.004", 0, "b25a1539c71701f7715f738c5037e9a6", 775515},
- {"resource.005", 0, "640ffe1a9acde392cc33cc1b1a528328", 806324},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 1 VGA Remake - English DOS (from the Space Quest Collection)
- // Executable scanning reports "T.A00.081", VERSION file reports "2.000"
- // SCI interpreter version 1.000.510 (just a guess)
- {{"sq1sci", "VGA Remake", {
- {"resource.map", 0, "38a74d8f555a2da9ca4f21d14e3c1d33", 5913},
- {"resource.000", 0, "e9d866534f8c84de82e25f2631ff258c", 1016436},
- {"resource.001", 0, "a89b7b52064c75b1985b289edc2f5c69", 1038757},
- {"resource.002", 0, "a9e847c687529481f3a22b9bf01f45f7", 1169831},
- {"resource.003", 0, "c47600e50c6fc591957ae0c5020ee7b8", 1213262},
- {"resource.004", 0, "e19ea4ad131472f9238590f2e1d40289", 1203051},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 1 VGA Remake - English Non-Interactive Demo (from FRG)
- // SCI interpreter version 1.000.181
- {{"sq1sci", "VGA Remake Demo", {
- {"resource.map", 0, "5af709ac5e0e923e0b8174f49978c30e", 636},
- {"resource.001", 0, "fd99ea43f57576ded7c86036996346cf", 507642},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 1 VGA Remake - Spanish DOS Floppy (from jvprat)
- // Executable scanning reports "T.A00.081", VERSION file reports "2.000"
- // SCI interpreter version 1.000.510 (just a guess)
- {{"sq1sci", "VGA Remake", {
- {"resource.map", 0, "cee2a67fa7f8f1f520f398110ca1c37e", 6111},
- {"resource.000", 0, "945081a73211e0c40e62f709edcd8d1d", 970657},
- {"resource.001", 0, "94692dc84c85c93bb8850f58aebf3cfc", 1085687},
- {"resource.002", 0, "fc9ad3357e4cedec1611ad2b67b193a9", 1175465},
- {"resource.003", 0, "8c22700a02991b763f512f837636b3ca", 1211307},
- {"resource.004", 0, "9b78228ad4f9f335fedf74f1812dcfca", 513325},
- {"resource.005", 0, "7d4ebcb745c0bf8fc42e4013f52ecd49", 1101812},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 3 - English Amiga (from www.back2roots.org)
- // SCI interpreter version 0.000.453 (just a guess)
- {{"sq3", "", {
- {"resource.map", 0, "bad41385acde6d677a8d55a7b20437e3", 5868},
- {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 171636},
- {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 754432},
- {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 746496},
- {"resource.004", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 761984},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Space Quest 3 - German Amiga
- // Executable scanning reports "1.004.006"
- // SCI interpreter version 0.000.453 (just a guess)
- {{"sq3", "", {
- {"resource.map", 0, "44f53185fdf3f44f946e9cac3ca6588b", 6348},
- {"resource.001", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 238664},
- {"resource.002", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 642014},
- {"resource.003", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 712374},
- {"resource.004", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 545053},
- {"resource.005", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 687507},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 3 - English DOS Non-Interactive Demo
- // SCI interpreter version 0.000.453
- {{"sq3", "Demo", {
- {"resource.map", 0, "ec66ac2b1ce58b2575ba00b65058de1a", 612},
- {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 180245},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Space Quest 3 - English DOS (provided by richiefs in bug report #2670691)
- // SCI interpreter version 0.000.453
- {{"sq3", "", {
- {"resource.map", 0, "fee82d211c3918a90ce3b476d3dbb245", 5484},
- {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 485158},
- {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720244},
- {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688367},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Space Quest 3 - English DOS (from the Space Quest Collection)
- // Executable scanning reports "0.000.685", VERSION file reports "1.018"
- {{"sq3", "", {
- {"resource.map", 0, "55e91aeef1705bce2a9b79172682f36d", 5730},
- {"resource.001", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 490247},
- {"resource.002", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 715777},
- {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 3 - German DOS (from Tobis87)
- // SCI interpreter version 0.000.453 (?)
- {{"sq3", "", {
- {"resource.map", 0, "4965c78b5eff50d5e4148ce114594ba8", 7584},
- {"resource.001", 0, "9107c2aa5398e28b5c5406df13491f85", 117869},
- {"resource.002", 0, "9107c2aa5398e28b5c5406df13491f85", 336101},
- {"resource.003", 0, "9107c2aa5398e28b5c5406df13491f85", 350391},
- {"resource.004", 0, "9107c2aa5398e28b5c5406df13491f85", 349750},
- {"resource.005", 0, "9107c2aa5398e28b5c5406df13491f85", 322107},
- {"resource.006", 0, "9107c2aa5398e28b5c5406df13491f85", 320643},
- {"resource.007", 0, "9107c2aa5398e28b5c5406df13491f85", 344287},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_629
- },
-
- // Space Quest 3 v1.052 - German DOS (supplied by markcoolio in bug report #2723860)
- // Executable scanning reports "S.old.114"
- {{"sq3", "", {
- {"resource.map", 0, "f0dd735098c254f584878649c6f08dbc", 5154},
- {"resource.001", 0, "9107c2aa5398e28b5c5406df13491f85", 567245},
- {"resource.002", 0, "9107c2aa5398e28b5c5406df13491f85", 596768},
- {"resource.003", 0, "9107c2aa5398e28b5c5406df13491f85", 693573},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - English Amiga
- // Executable scanning reports "1.004.024"
- // SCI interpreter version 1.000.200
- {{"sq4", "", {
- {"resource.map", 0, "d87ae90031e7fd04f32a27db054f5c9c", 6174},
- {"resource.000", 0, "19671ac620a0a4720a1937c20c2e24a1", 323309},
- {"resource.001", 0, "abca51a4c896df550f095a2db71dce46", 805915},
- {"resource.002", 0, "5667852471ba5b7f5b9a770eabd07df2", 796615},
- {"resource.003", 0, "6ec43464f6a17e612636e2928fd9471c", 803868},
- {"resource.004", 0, "1887ed88bb34ae7238650e8f77f26315", 798226},
- {"resource.005", 0, "3540d1cc84d674cf4b2c898b88a3b563", 790296},
- {"resource.006", 0, "ade814bc4d56244c156d9e9bcfebbc11", 664085},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - German Amiga (from www.back2roots.org)
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "79641c0d43408e33c251a1d494d2575e", 6252},
- {"resource.000", 0, "feff51c52146b3a31d4793c718279e13", 345170},
- {"resource.001", 0, "ab33060bfebe32450c0b8d9a3a066efc", 822470},
- {"resource.002", 0, "f79fd6a62da082addb205ed6cef99629", 810458},
- {"resource.003", 0, "f4c21da916f450d4b893b4cba6120866", 815854},
- {"resource.004", 0, "99c6a017da5e769a3b427ca52c8a564f", 824601},
- {"resource.005", 0, "10ee1709e6559c724676d058199b75b5", 818745},
- {"resource.006", 0, "67fb188b191d88efe8414af6ea297b93", 672675},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - English DOS
- // Executable scanning reports "1.000.753"
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "a18088c8aceb06025dbc945f29e02935", 5124},
- {"resource.000", 0, "e1f46832cd2458796028e054a0466031", 5502009},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - English DOS
- // Executable scanning reports "1.000.753"
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "71ccf4f82ac4efb588731acfb7bf2603", 5646},
- {"resource.000", 0, "e1f46832cd2458796028e054a0466031", 933928},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 1.052 - English DOS Floppy (supplied by markcoolio in bug report #2723865)
- // Executable scanning reports "1.000.753"
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "98852d6379622001efd0b50ae93c9a30", 5928},
- {"resource.000", 0, "e1f46832cd2458796028e054a0466031", 173330},
- {"resource.001", 0, "cc2f89e6057e05b040566b3699df7288", 1247215},
- {"resource.002", 0, "9c342cd76b421369406d6fafd7b1a285", 1218373},
- {"resource.003", 0, "96fa33d89d838bc3f671c5b953e7a896", 1240130},
- {"resource.004", 0, "ff9c87da3bc53473fdee8b9d3edbc93c", 1200631},
- {"resource.005", 0, "e33019ac19f755ae33fbf49b4fc9066c", 1053294},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - German DOS (from Tobis87)
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "71715e775e3791178d606cfe6c7e1fb9", 6339},
- {"resource.000", 0, "5f6a1fff40584ee807efd547899b1ba5", 206032},
- {"resource.001", 0, "e924cf86a72ada7736043f045cce345f", 1065442},
- {"resource.002", 0, "e18d731c3fba51333a7f402e454714a5", 858402},
- {"resource.003", 0, "7c2e7508af1a6af877d921e476f70b5e", 1172738},
- {"resource.004", 0, "b8d6efbd3235329bfe844c794097b2c9", 1064761},
- {"resource.005", 0, "47ee647b5b12232d27e63cc627c25899", 1156765},
- {"resource.006", 0, "dfb023e4e2a1e7a00fa18f9ede72a91b", 924059},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - Italian DOS Floppy (from glorifindel)
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "e753dfa96d68dd95f84f6cd80479a35e", 6135},
- {"resource.000", 0, "2ac39ff61e369b79f3d7a4ad514f8e29", 203170},
- {"resource.001", 0, "99a6df6d366b3f061271ff3450ac0d32", 1286269},
- {"resource.002", 0, "a6a8d7a24dbb7a266a26b084e7275e89", 1241124},
- {"resource.003", 0, "5289000399d503b59da9e23129256f1a", 1325546},
- {"resource.004", 0, "4277c61bed40a50dadc4b5a344520af2", 1251000},
- {"resource.005", 0, "5f885abd335978e2fd4e5f886d7676c8", 1102880},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - Japanese PC-98 5.25" Floppy
- // SCI interpreter version 1.000.1068
- {{"sq4", "", {
- {"resource.map", 0, "ca7bba01019222b6f3e54e9051067a99", 5283},
- {"resource.000", 0, "161d719f38ed98d33f058a8cf3dc09c3", 952909},
- {"resource.001", 0, "454684e3a7a68cbca073945e50778447", 1187088},
- {"resource.002", 0, "6dc668326cc22cb9e8bd8ca9e68d2a66", 1181249},
- {NULL, 0, NULL, 0}}, Common::JA_JPN, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - Japanese PC-98 5.25" Floppy
- // SCI interpreter version 1.000.1068
- {{"sq4", "", {
- {"resource.map", 0, "ca7bba01019222b6f3e54e9051067a99", 5283},
- {"resource.000", 0, "161d719f38ed98d33f058a8cf3dc09c3", 952909},
- {"resource.001", 0, "454684e3a7a68cbca073945e50778447", 1187088},
- {"resource.002", 0, "6dc668326cc22cb9e8bd8ca9e68d2a66", 1181249},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 - English DOS CD (from the Space Quest Collection)
- // Executable scanning reports "1.001.064", VERSION file reports "1.0"
- {{"sq4", "CD", {
- {"resource.map", 0, "ed90a8e3ccc53af6633ff6ab58392bae", 7054},
- {"resource.000", 0, "63247e3901ab8963d4eece73747832e0", 5157378},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Space Quest 4 - Spanish DOS CD (from jvprat)
- // Executable scanning reports "1.SQ4.057", VERSION file reports "1.000"
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "51bcb305568ec19713f8b79727f10071", 6159},
- {"resource.000", 0, "8000a55aebc50a68b7cce07a8c33758c", 204315},
- {"resource.001", 0, "99a6df6d366b3f061271ff3450ac0d32", 1269094},
- {"resource.002", 0, "a6a8d7a24dbb7a266a26b084e7275e89", 1240998},
- {"resource.003", 0, "42a307941edeb1a3be31daeb2e4be90b", 1319306},
- {"resource.004", 0, "776fba81c110d1908776232cbe190e20", 1253752},
- {"resource.005", 0, "55fae26c2a92f16ef72c1e216e827c0f", 1098328},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Space Quest 4 - Spanish DOS Floppy (from jvprat)
- // Executable scanning reports "1.SQ4.056", VERSION file reports "1.000"
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "41543ae71036046fef69df29a838ee05", 5589},
- {"resource.000", 0, "2ac39ff61e369b79f3d7a4ad514f8e29", 242470},
- {"resource.001", 0, "567608beb69d9dffdb42a8f39cb11a5e", 994323},
- {"resource.002", 0, "74c62fa2146ff3b3b2ea2b3fb95b9af9", 1140801},
- {"resource.003", 0, "42a307941edeb1a3be31daeb2e4be90b", 1088408},
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 4 1.000 - German DOS Floppy (supplied by markcoolio in bug report #2723862)
- // Executable scanning reports "1.SQ4.030"
- // SCI interpreter version 1.000.200 (just a guess)
- {{"sq4", "", {
- {"resource.map", 0, "8f08b97ca093f370c56d99715b015554", 6153},
- {"resource.000", 0, "5f6a1fff40584ee807efd547899b1ba5", 206032},
- {"resource.001", 0, "99a6df6d366b3f061271ff3450ac0d32", 1270577},
- {"resource.002", 0, "a6a8d7a24dbb7a266a26b084e7275e89", 1242817},
- {"resource.003", 0, "47ee647b5b12232d27e63cc627c25899", 1321146},
- {"resource.004", 0, "c06350184a490c10eb4585fff0aa3192", 1254368},
- {"resource.005", 0, "b8d6efbd3235329bfe844c794097b2c9", 1098717},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 5 - English DOS (from the Space Quest Collection)
- // Executable scanning reports "1.001.068", VERSION file reports "1.04"
- {{"sq5", "", {
- {"resource.map", 0, "66317c12ac6e818d1f7c17e83c1d9819", 6143},
- {"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
- {"resource.msg", 0, "bb8ad78793c26bdb3f77498b1d6515a9", 125988},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 5 - English DOS
- // SCI interpreter version 1.001.067
- {{"sq5", "", {
- {"resource.map", 0, "8bde0a9adb9a3e9aaa861826874c9834", 6473},
- {"resource.000", 0, "f4a48705764544d7cc64a7bb22a610df", 6025184},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 5 v1.04 - German DOS (from Tobis87, updated information by markcool from bug reports #2723935 and #2724762)
- // SCI interpreter version 1.001.068
- {{"sq5", "", {
- {"resource.map", 0, "66317c12ac6e818d1f7c17e83c1d9819", 6143},
- {"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
- {"resource.msg", 0, "7c71cfc36153cfe07b450423a51f7e68", 146282},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 5 - Italian DOS Floppy (from glorifindel)
- // SCI interpreter version 1.001.068 (just a guess)
- {{"sq5", "", {
- {"resource.000", 0, "5040026519f37199f3616fb1d4704dff", 6047170},
- {"resource.map", 0, "5b09168baa2f6e2e22787429b2d72f54", 6492},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Space Quest 6 - English DOS/Win3.11 CD (from the Space Quest Collection)
- // Executable scanning reports "2.100.002", VERSION file reports "1.0"
- {{"sq6", "", {
- {"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528},
- {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Space Quest 6 - English DOS/Win3.11 CD ver 1.11 (from FRG)
- // SCI interpreter version 2.100.002 (just a guess)
- {{"sq6", "", {
- {"resource.map", 0, "e0615d6e4e10e37ae42e6a2a95aaf145", 10528},
- {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // Space Quest 6 - English DOS/Win3.11 Interactive Demo (from FRG)
- // SCI interpreter version 2.100.002 (just a guess)
- {{"sq6", "Demo", {
- {"resource.map", 0, "368f07b07433db3f819fa3fa0e5efee5", 2572},
- {"resource.000", 0, "ab12724e078dea34b624e0d2a38dcd7c", 2272050},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Space Quest 6 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723884)
- // SCI interpreter version 2.100.002 (just a guess)
- {{"sq6", "", {
- {"resource.map", 0, "664d797415484f85c90b1b45aedc7686", 10534},
- {"resource.000", 0, "ba87ba91e5bdabb4169dd0df75777722", 40933685},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-#endif // ENABLE_SCI32
-
- // The Island of Dr. Brain - English DOS CD (from jvprat)
- // Executable scanning reports "1.001.053", VERSION file reports "1.0 10.27.92"
- {{"islandbrain", "", {
- {"resource.map", 0, "2388efef8430b041b0f3b00b9050e4a2", 3281},
- {"resource.000", 0, "b3acd9b9dd7fe53c4ee133ac9a1acfab", 2103560},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
- 0
- },
-
- // The Island of Dr. Brain - English DOS (from Quietust)
- // Executable scanning reports "1.001.053", VERSION file reports "1.1 2.3.93"
- {{"islandbrain", "", {
- {"resource.map", 0, "3c07da06bdd1689f9d07af78fb94d0ec", 3101},
- {"resource.000", 0, "ecc686e0034fb4d41de077ac7167b3cf", 1947866},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- 0
- },
-
- // The Island of Dr. Brain - English DOS Non-Interactive Demo
- // SCI interpreter version 1.001.053 (just a guess)
- {{"islandbrain", "Demo", {
- {"resource.map", 0, "a8e5ca8ed1996974afa59f4c45e06195", 986},
- {"resource.000", 0, "b3acd9b9dd7fe53c4ee133ac9a1acfab", 586560},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
-#ifdef ENABLE_SCI32
- // Torin's Passage - English Windows Interactive Demo
- // SCI interpreter version 2.100.002 (just a guess)
- {{"torin", "Demo", {
- {"resmap.000", 0, "9a3e172cde9963d0a969f26469318cec", 3403},
- {"ressci.000", 0, "db3e290481c35c3224e9602e71e4a1f1", 5073868},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
- 0
- },
-
- // Torin's Passage - English Windows
- // SCI interpreter version 2.100.002 (just a guess)
- {{"torin", "", {
- {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
- {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
- {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Torin's Passage - Spanish Windows (from jvprat)
- // Executable scanning reports "2.100.002", VERSION file reports "1.0"
- {{"torin", "", {
- {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
- {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
- // TODO: depend on one of the patches?
- {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Torin's Passage - French Windows
- // SCI interpreter version 2.100.002 (just a guess)
- {{"torin", "", {
- {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
- {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
- {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Torin's Passage - German Windows
- // SCI interpreter version 2.100.002 (just a guess)
- {{"torin", "", {
- {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
- {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
- {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
- 0
- },
-
- // Torin's Passage - Italian Windows CD (from glorifindel)
- // SCI interpreter version 2.100.002 (just a guess)
- {{"torin", "", {
- {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
- {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
- {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE},
- 0
- },
-#endif // ENABLE_SCI32
-
- // SCI Fanmade Games
- FANMADE("Al Pond 2: Island Quest", "9625372e710d1a95d2027b48f9e325af", 1506, "a0f9aa65b9bf3d8703adff5a621f243c", 889843),
- FANMADE("Al Pond: Island Quest 2", "4cba6a5a4c8f66f21935ed78b0511a92", 870, "876587dc9a5ec569287a3dc4b29139d8", 613769),
- FANMADE("Another DG Game: I Want My C64 Back", "4a8ca7ca2abd18899ef856f47665e2e9", 588, "12ff558d20c72e42cc6adb408f34d6d8", 150513),
- FANMADE_L("Another DG Game: I Want My C64 Back", "13dc1d9ebc57daf8895412eee5e39fea", 576, "e2ad60b3a280171429db5c85f158f84a", 141697, Common::FR_FRA),
- FANMADE("Bluntman and Chronic (Politically Correct Version)", "c3ef9fa6c7c5fb840078bf28d87c7f8b", 1362, "441636a9f6f86710844868fded868ee7", 596688),
- FANMADE("Cascade Quest", "c94efc10d18c040b6e22a1dc6d3adfe1", 3468, "8ada33dfa945f81531e5508240b573de", 1432195),
- FANMADE("Curt Quest 1.0", "b0e555370380d218968a40a68eaaaffc", 1146, "c851182cdf6fc6a81b840f4d4875f1a0", 307165),
- FANMADE("Curt Quest 1.1", "54084c29346683296e45ef32d7ae74f3", 1128, "c851182cdf6fc6a81b840f4d4875f1a0", 302000),
- FANMADE("Demo Quest", "c89a0c9e0a4e4af0ecedb300a3b31dbf", 384, "a32f3495ba24764cba091119cc3f1e13", 160098),
- FANMADE("Dr. Jummybummy's Space Adventure 2", "6ae6cb7de423f51736d9487b4ca0c6da", 810, "26e5b563f578e104d79689f36568b7cf", 394670),
- FANMADE_L("Grostesteing: Plus Mechant que Jamais", "ec9a97ccb134f69249f6ea8b16c13d8e", 1500, "b869f5f11bfe2ab5f67f4f0c618f2ce1", 464657, Common::FR_FRA), // FIXME: Accent
- FANMADE("Jim Quest", "0af50be1d3f0cb77a09137709a76ef4f", 960, "9c042c136548b20d9183495668e03526", 496446),
- FANMADE("Knight's Quest Demo 1.0", "5e816edf993956752ed06fccfeeae6d9", 1260, "959321f88a22905fa1f8c6d897874744", 703836),
- FANMADE("LockerGnome Quest", "3eeff9130206cad0c4e1551e2b9dd2c5", 420, "ae05ca90806fd90cc43f147c82d3547c", 158906),
- FANMADE("New Year's Mystery", "efd1beb5120293725065c95959144f81", 714, "b3bd3c2372ed6efa28adb12403c4c31a", 305027),
- FANMADE("Osama", "db8f1710453cfbecf4214b2946970043", 390, "7afd75d4620dedf97a84ae8f0a7523cf", 123827),
- FANMADE("Quest for the Cheat", "a359d4cf27f98264b42b55c017671214", 882, "8a943029f73c4bc85d454b7f473455ba", 455209),
- FANMADE("SCI Companion Template", "ad54d4f504086cd597aa2348d0aa3b09", 354, "6798b7b601ce8154c1d1bc0f0edcdd18", 113061),
- FANMADE("SCI Studio Template 3.0", "ca0dc8d586e0a8670b7621cde090b532", 354, "58a48ee692a86c0575e6bd0b00a92b9a", 113097),
- FANMADE("SCI Quest", "9067e1f1e54436d2dbfce855524bc84a", 552, "ffa7d355cd9223f245289108a696bcd2", 149634),
- FANMADE("The Legend of the Lost Jewel", "ba1bca315e3818c5626eda51bcfbcccf", 636, "9b0736d69924af0cff32a0f78db96855", 300398),
-
- // FIXME: The vga demo does not have a resource.000/001 file.
- //FANMADE_V("SCI VGA Demo", "00b1abd87bad356b90fcdfcb6132c26f", 8, "", 0, 0),
-
- {AD_TABLE_END_MARKER, 0}
-};
+#include "sci/detection_tables.h"
/**
* The fallback game descriptor used by the SCI engine's fallbackDetector.
@@ -3006,7 +118,7 @@ static SciGameDescription s_fallbackDesc = {
Common::UNK_LANG,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ Common::GUIO_NONE
},
0
};
@@ -3014,7 +126,7 @@ static SciGameDescription s_fallbackDesc = {
static const ADParams detectionParams = {
// Pointer to ADGameDescription or its superset structure
- (const byte *)SciGameDescriptions,
+ (const byte *)Sci::SciGameDescriptions,
// Size of that superset structure
sizeof(SciGameDescription),
// Number of bytes to compute MD5 sum for
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
new file mode 100644
index 0000000000..f935bdff0d
--- /dev/null
+++ b/engines/sci/detection_tables.h
@@ -0,0 +1,2918 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+namespace Sci {
+
+#define FANMADE_L(name, resMapMd5, resMapSize, resMd5, resSize, lang) \
+ {{"sci-fanmade", name, { \
+ {"resource.map", 0, resMapMd5, resMapSize}, \
+ {"resource.001", 0, resMd5, resSize}, \
+ {NULL, 0, NULL, 0}}, lang, Common::kPlatformPC, 0, GUIO_NOSPEECH}, \
+ 0 \
+ }
+
+#define FANMADE(name, resMapMd5, resMapSize, resMd5, resSize) FANMADE_L(name, resMapMd5, resMapSize, resMd5, resSize, Common::EN_ANY)
+
+using Common::GUIO_NONE;
+using Common::GUIO_NOSPEECH;
+
+// Game descriptions
+static const struct SciGameDescription SciGameDescriptions[] = {
+ // Astro Chicken - English DOS
+ // SCI interpreter version 0.000.453
+ {{"astrochicken", "", {
+ {"resource.map", 0, "f3d1be7752d30ba60614533d531e2e98", 474},
+ {"resource.001", 0, "6fd05926c2199af0af6f72f90d0d7260", 126895},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Castle of Dr. Brain - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.005.000"
+ // SCI interpreter version 1.000.510
+ {{"castlebrain", "", {
+ {"resource.map", 0, "9f9fb826aa7e944b95eadbf568244a68", 2766},
+ {"resource.000", 0, "0efa8409c43d42b32642f96652d3230d", 314773},
+ {"resource.001", 0, "3fb02ce493f6eacdcc3713851024f80e", 559540},
+ {"resource.002", 0, "d226d7d3b4f77c4a566913fc310487fc", 792380},
+ {"resource.003", 0, "d226d7d3b4f77c4a566913fc310487fc", 464348},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Castle of Dr. Brain - German Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.005.001"
+ // SCI interpreter version 1.000.510
+ {{"castlebrain", "", {
+ {"resource.map", 0, "8e60424682db52a982bcc3535a7e86f3", 2796},
+ {"resource.000", 0, "0efa8409c43d42b32642f96652d3230d", 332468},
+ {"resource.001", 0, "4e0836fadc324316c1a418125709ba45", 569057},
+ {"resource.002", 0, "85e51acb5f9c539d66e3c8fe40e17da5", 826309},
+ {"resource.003", 0, "85e51acb5f9c539d66e3c8fe40e17da5", 493638},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Castle of Dr. Brain - English DOS Non-Interactive Demo
+ // SCI interpreter version 1.000.005
+ {{"castlebrain", "Demo", {
+ {"resource.map", 0, "467bb5e3224bb54640c3280032aebff5", 633},
+ {"resource.000", 0, "9780f040d58182994e22d2e34fab85b0", 67367},
+ {"resource.001", 0, "2af49dbd8f2e1db4ab09f9310dc91259", 570553},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Castle of Dr. Brain - English DOS Floppy (from jvprat)
+ // Executable scanning reports "1.000.044", Floppy label reports "1.0, 10.30.91", VERSION file reports "1.000"
+ // SCI interpreter version 1.000.510
+ {{"castlebrain", "", {
+ {"resource.map", 0, "1302ceb141d44b05a42723791b2d84c6", 2739},
+ {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 346731},
+ {"resource.001", 0, "d2f5a1be74ed963fa849a76892be5290", 794832},
+ {"resource.002", 0, "c0c29c51af66d65cb53f49e785a2d978", 1280907},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Castle of Dr. Brain - English DOS Floppy 1.1
+ {{"castlebrain", "", {
+ {"resource.map", 0, "f77728304c70017c54793eb6ca648174", 2745},
+ {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 347071},
+ {"resource.001", 0, "13e81e1839cd7b216d2bb5615c1ca160", 796776},
+ {"resource.002", 0, "930e416bec196b9703a331d81b3d66f2", 1283812},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Castle of Dr. Brain - Spanish DOS
+ // SCI interpreter version 1.000.510
+ {{"castlebrain", "", {
+ {"resource.map", 0, "5738c163e014bbe046474de009020b82", 2727},
+ {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 1197694},
+ {"resource.001", 0, "735be4e58957180cfc807d5e18fdffcd", 1433302},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Christmas Card 1988 - English DOS
+ // SCI interpreter version 0.000.294
+ {{"christmas1988", "", {
+ {"resource.map", 0, "39485580d34a72997f3d5b3aba4d24f1", 426},
+ {"resource.001", 0, "11391434f41c834090d7a1e9488ce936", 129739},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Christmas Card 1990: The Seasoned Professional - English DOS (16 Colors)
+ // SCI interpreter version 1.000.172
+ {{"christmas1990", "16 Colors", {
+ {"resource.map", 0, "8f656714a05b94423ac6eb10ee8797d0", 600},
+ {"resource.001", 0, "acde93e58fca4f7a2a5a220558a94aa8", 272629},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Christmas Card 1990: The Seasoned Professional - English DOS (256 Colors)
+ // SCI interpreter version 1.000.174
+ {{"christmas1990", "256 Colors", {
+ {"resource.map", 0, "44b8f45b841b9b5e17e939a35e443988", 600},
+ {"resource.001", 0, "acde93e58fca4f7a2a5a220558a94aa8", 335362},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Christmas Card 1992 - English DOS
+ // SCI interpreter version 1.001.055
+ {{"christmas1992", "", {
+ {"resource.map", 0, "f1f8c8a8443f523422af70b4ec85b71c", 318},
+ {"resource.000", 0, "62fb9256f8e7e6e65a6875efdb7939ac", 203396},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Codename: Iceman - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.002.031"
+ // SCI interpreter version 0.000.685
+ {{"iceman", "", {
+ {"resource.map", 0, "035829b391709a4e542d7c7b224625f6", 6000},
+ {"resource.000", 0, "b1bccd827453d4cb834bfd5b45bef63c", 73682},
+ {"resource.001", 0, "ede5a0e1e2a80fb629dae72c72f33d37", 293145},
+ {"resource.002", 0, "36670a917550757d57df84c96cf9e6d9", 469387},
+ {"resource.003", 0, "d97a96f1ab91b41cf46a02cc89b0a04e", 619219},
+ {"resource.004", 0, "8613c45fc771d658e5a505b9a4a54f31", 713382},
+ {"resource.005", 0, "605b67a9ef199a9bb015745e7c004cf4", 478384},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Codename: Iceman - English DOS Non-Interactive Demo
+ // Executable scanning reports "0.000.685"
+ {{"iceman", "Demo", {
+ {"resource.map", 0, "782974f29d8a824782d2d4aea39964e3", 1056},
+ {"resource.001", 0, "d4b75e280d1c3a97cfef1b0bebff387c", 573647},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Codename: Iceman - English DOS (from jvprat)
+ // Executable scanning reports "0.000.685", Floppy label reports "1.033, 6.8.90", VERSION file reports "1.033"
+ // SCI interpreter version 0.000.685
+ {{"iceman", "", {
+ {"resource.map", 0, "a18f3cef4481a81d3415fb87a754343e", 5700},
+ {"resource.000", 0, "b1bccd827453d4cb834bfd5b45bef63c", 26989},
+ {"resource.001", 0, "32b351072fccf76fc82234d73d28c08b", 438872},
+ {"resource.002", 0, "36670a917550757d57df84c96cf9e6d9", 566549},
+ {"resource.003", 0, "d97a96f1ab91b41cf46a02cc89b0a04e", 624303},
+ {"resource.004", 0, "8613c45fc771d658e5a505b9a4a54f31", 670883},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Codename: Iceman - English DOS (from FRG)
+ // SCI interpreter version 0.000.668
+ {{"iceman", "", {
+ {"resource.map", 0, "554b44b79b0e9a7fc59f66dda0daac02", 5670},
+ {"resource.000", 0, "b1bccd827453d4cb834bfd5b45bef63c", 26974},
+ {"resource.001", 0, "005bd332d4b0f9d8e99d3b905223a332", 438501},
+ {"resource.002", 0, "250b859381ebf2bf8922bd99683b0cc1", 566464},
+ {"resource.003", 0, "dc7c5280e7acfaffe6ef2a6c963c5f94", 622118},
+ {"resource.004", 0, "64f342463f6f35ba71b3509ef696ae3f", 669188},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of Camelot - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.002.030"
+ // SCI interpreter version 0.000.685
+ {{"camelot", "", {
+ {"resource.map", 0, "51aba42f8e63b219755d4372ea424509", 6654},
+ {"resource.000", 0, "dfadf0b4c9fb44ce55570149856c302d", 128100},
+ {"resource.001", 0, "67391de361b9347f123ac0899b4b91f7", 300376},
+ {"resource.002", 0, "8c7f12b2c38d225d4c7121b30ea1b4d2", 605334},
+ {"resource.003", 0, "82a73e7572e7ee627429bb5111ff82ca", 672392},
+ {"resource.004", 0, "6821dc97cf643ba521a4e840dda3c58b", 647410},
+ {"resource.005", 0, "c6e551bdc24f0acc193159038d4ca767", 605882},
+ {"resource.006", 0, "8f880a536908ab496bbc552f7f5c3738", 585255},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of Camelot - English DOS Non-Interactive Demo
+ // SCI interpreter version 0.000.668
+ {{"camelot", "Demo", {
+ {"resource.map", 0, "f4cd75c15be75e04cdca3acda2c0b0ea", 468},
+ {"resource.001", 0, "4930708722f34bfbaa4945fb08f55f61", 232523},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of Camelot - English DOS (from jvprat)
+ // Executable scanning reports "0.000.685", Floppy label reports "1.001, 0.000.685", VERSION file reports "1.001.000"
+ // SCI interpreter version 0.000.685
+ {{"camelot", "", {
+ {"resource.map", 0, "95eca3991906dfd7ed26d193df07596f", 7278},
+ {"resource.001", 0, "8e1a3a8c588007404b532b8dfacc1460", 596774},
+ {"resource.002", 0, "8e1a3a8c588007404b532b8dfacc1460", 722250},
+ {"resource.003", 0, "8e1a3a8c588007404b532b8dfacc1460", 723712},
+ {"resource.004", 0, "8e1a3a8c588007404b532b8dfacc1460", 729143},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of Camelot - English DOS
+ // SCI interpreter version 0.000.685
+ {{"camelot", "", {
+ {"resource.map", 0, "86bffb2a393b7a5d8de45e735091f037", 9504},
+ {"resource.001", 0, "8e1a3a8c588007404b532b8dfacc1460", 212461},
+ {"resource.002", 0, "8e1a3a8c588007404b532b8dfacc1460", 317865},
+ {"resource.003", 0, "8e1a3a8c588007404b532b8dfacc1460", 359145},
+ {"resource.004", 0, "8e1a3a8c588007404b532b8dfacc1460", 345180},
+ {"resource.005", 0, "8e1a3a8c588007404b532b8dfacc1460", 345734},
+ {"resource.006", 0, "8e1a3a8c588007404b532b8dfacc1460", 332446},
+ {"resource.007", 0, "8e1a3a8c588007404b532b8dfacc1460", 358182},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of the Longbow - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.005.001"
+ // SCI interpreter version 1.000.510
+ {{"longbow", "", {
+ {"resource.map", 0, "6204f3d00c0f6c0f5f95a29a4190f2f9", 6048},
+ {"resource.000", 0, "8d11c744b4a51e7a8ceac687a46f08ca", 830333},
+ {"resource.001", 0, "76caf8593e065a98c8ab4a6e2c7dbafc", 839008},
+ {"resource.002", 0, "eb312373045906b54a3181bebaf6651a", 733145},
+ {"resource.003", 0, "7fe3b3372d7fdda60045807e9c8e4867", 824554},
+ {"resource.004", 0, "d1038c75d85a6650d48e07d174a6a913", 838175},
+ {"resource.005", 0, "1c3804e56b114028c5873a35c2f06d13", 653002},
+ {"resource.006", 0, "f9487732289a4f4966b4e34eea413325", 842817},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of the Longbow - English DOS
+ // SCI interpreter version 1.000.510
+ {{"longbow", "", {
+ {"resource.map", 0, "36d3b81ff75b67dd4d27b7f5d3166503", 6261},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 1096767},
+ {"resource.001", 0, "d4c299213f8d799da1492680d12d0fb3", 1133226},
+ {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1128555},
+ {"resource.003", 0, "21ebe6b39b57a73fc449f67f013765aa", 972635},
+ {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1064637},
+ {"resource.005", 0, "d036df0872f2db19bca34601276be2d7", 1154950},
+ {"resource.006", 0, "b367a6a59f29ee30dde1d88a5a41152d", 1042966},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of the Longbow - English DOS Floppy (from jvprat)
+ // Executable scanning reports "1.000.168", Floppy label reports "1.1, 1.13.92", VERSION file reports "1.1"
+ // SCI interpreter version 1.000.510
+ {{"longbow", "", {
+ {"resource.map", 0, "247f955865572569342751de47e861ab", 6027},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 1297120},
+ {"resource.001", 0, "1e6084a19f7a6c50af88d3a9b32c411e", 1366155},
+ {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1234743},
+ {"resource.003", 0, "1867136d01ece57b531032d466910522", 823686},
+ {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1261462},
+ {"resource.005", 0, "21ebe6b39b57a73fc449f67f013765aa", 1284720},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of the Longbow - English DOS
+ // SCI interpreter version 1.000.510
+ {{"longbow", "", {
+ {"resource.map", 0, "737c6f83a1ee601727ff026898f19fa1", 6045},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 1296607},
+ {"resource.001", 0, "1e6084a19f7a6c50af88d3a9b32c411e", 1379267},
+ {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1234140},
+ {"resource.003", 0, "1867136d01ece57b531032d466910522", 823610},
+ {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1260237},
+ {"resource.005", 0, "21ebe6b39b57a73fc449f67f013765aa", 1284609},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of the Longbow EGA - English DOS
+ // SCI interpreter version 1.000.510
+ {{"longbow", "EGA", {
+ {"resource.map", 0, "7676ec9f08967d7a9a7724f5170456e0", 6261},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 718161},
+ {"resource.001", 0, "3c3735caa34fa3f261a9552831bb43ed", 705680},
+ {"resource.002", 0, "7025b87e735b1df3f0e9488a621f4333", 700633},
+ {"resource.003", 0, "eaca7933e8e56bea22b42f7fd5d7a8a7", 686510},
+ {"resource.004", 0, "b7bb35c027bb424ecefcd122768e5e60", 705631},
+ {"resource.005", 0, "58942b1aa6d6ffeb66e9f8897fd4435f", 469243},
+ {"resource.006", 0, "8c767b3939add63d11274065e46aad04", 713158},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0,
+ },
+
+ // Conquests of the Longbow - English DOS Non-Interactive Demo
+ // SCI interpreter version 1.000.510
+ {{"longbow", "Demo", {
+ {"resource.map", 0, "cbc5cb73341de1bff1b1e20a640af220", 588},
+ {"resource.001", 0, "f05a20cc07eee85da8e999d0ac0f596b", 869916},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Conquests of the Longbow - German DOS (suplied by markcoolio in bug report #2727681)
+ // SCI interpreter version 1.000.510
+ {{"longbow", "", {
+ {"resource.map", 0, "7376b7a07f8bd3a8ab8d67595d3f5b51", 6285},
+ {"resource.000", 0, "ee39f92e006142424cf9209329e727c6", 977281},
+ {"resource.001", 0, "d4c299213f8d799da1492680d12d0fb3", 1167657},
+ {"resource.002", 0, "7f6ce331219d58d5087731e4475ab4f1", 1172521},
+ {"resource.003", 0, "a204de2a083a7770ff455a838210a678", 1165249},
+ {"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1101869},
+ {"resource.005", 0, "d036df0872f2db19bca34601276be2d7", 1176914},
+ {"resource.006", 0, "b367a6a59f29ee30dde1d88a5a41152d", 1123585},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest - English DOS Non-Interactive Demo (from FRG)
+ // Executable scanning reports "x.yyy.zzz"
+ // SCI interpreter version 1.001.069 (just a guess)
+ {{"ecoquest", "Demo", {
+ {"resource.map", 0, "c819e171359b7c95f4c13b846d5c034e", 873},
+ {"resource.001", 0, "baf9393a9bfa73098adb501e5bc5487b", 657518},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest - English DOS CD 1.1
+ // SCI interpreter version 1.001.064
+ {{"ecoquest", "CD", {
+ {"resource.map", 0, "a4b73d5d2b55bdb6e44345e99c8fbdd0", 4804},
+ {"resource.000", 0, "d908dbef56816ac6c60dd145fdeafb2b", 3536046},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Eco Quest - English DOS Floppy
+ // SCI interpreter version 1.000.510
+ {{"ecoquest", "Floppy", {
+ {"resource.map", 0, "704367225929a88aad281ac72844ddac", 4053},
+ {"resource.000", 0, "241b98d3903f6a5b872baa19b80aef3b", 1099239},
+ {"resource.001", 0, "96d4435d24c01f1c1675e46457604c5f", 1413719},
+ {"resource.002", 0, "28fe9b4f0567e71feb198bc9f3a2c605", 1241816},
+ {"resource.003", 0, "f3146df0ad4297f5ce35aa8c4753bf6c", 586832},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest - English DOS Floppy
+ // SCI interpreter version 1.000.510
+ {{"ecoquest", "Floppy", {
+ {"resource.map", 0, "f77baec05fae76707205f5be6534a7f3", 4059},
+ {"resource.000", 0, "241b98d3903f6a5b872baa19b80aef3b", 858490},
+ {"resource.001", 0, "2fed7451bca81b0c891eed1a956f2263", 1212161},
+ {"resource.002", 0, "323b3b12f43d53f27d259beb225f0aa7", 1129316},
+ {"resource.003", 0, "83ac03e4bddb2c1ac2d36d2a587d0536", 1145616},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest - German DOS Floppy (supplied by markcoolio in bug report #2723744)
+ // SCI interpreter version 1.000.510
+ {{"ecoquest", "Floppy", {
+ {"resource.map", 0, "7a9b43bf27dc000ac8559ecbe824b659", 4395},
+ {"resource.000", 0, "99b73d40403a51c7e60d01df0d6cd34a", 998227},
+ {"resource.001", 0, "2fed7451bca81b0c891eed1a956f2263", 1212060},
+ {"resource.002", 0, "02d7d0411f7903aacb3bc8b0f8ca8a9a", 1202581},
+ {"resource.003", 0, "84dd11b6825255671c703aee5ceff620", 1175835},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest - Spanish DOS Floppy (from jvprat)
+ // Executable scanning reports "1.ECO.013", VERSION file reports "1.000, 11.12.92"
+ // SCI interpreter version 1.000.510
+ {{"ecoquest", "Floppy", {
+ {"resource.map", 0, "82e6b1e3bdb2f064b18380009df7b345", 4395},
+ {"resource.000", 0, "0b12a91c935e385308af8d17811deded", 1004085},
+ {"resource.001", 0, "2fed7451bca81b0c891eed1a956f2263", 1212060},
+ {"resource.002", 0, "2d21a1d2dcbffa551552e3e0725d2284", 1186033},
+ {"resource.003", 0, "84dd11b6825255671c703aee5ceff620", 1174993},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest - French DOS Floppy (from Strangerke)
+ // SCI interpreter version 1.ECO.013
+ {{"ecoquest", "Floppy", {
+ {"resource.map", 0, "67742945cd59b896d9f22a549f605217", 4407},
+ {"resource.000", 0, "0b12a91c935e385308af8d17811deded", 973723},
+ {"resource.001", 0, "fc7fba54b6bb88fd7e9c229636599aa9", 1205841},
+ {"resource.002", 0, "b836c6ee9de67d814ac5d1b05f5b9858", 1173872},
+ {"resource.003", 0, "f8f767f9d6351432621c6e54c1b2ba8c", 1141520},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest 2 - English DOS Non-Interactive Demo
+ // SCI interpreter version 1.001.055
+ {{"ecoquest2", "Demo", {
+ {"resource.map", 0, "607cfa0d8a03b7d348c06ee727e3d939", 1321},
+ {"resource.000", 0, "dd6f614c43c029f063e93cd243af90a4", 525992},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest 2 - English DOS Floppy (supplied by markcoolio in bug report #2723761)
+ // SCI interpreter version 1.001.065
+ {{"ecoquest2", "Floppy", {
+ {"resource.map", 0, "28fb7b6abb9fc1cb8882d7c2e701b63f", 5658},
+ {"resource.000", 0, "cc1d17e5637528dbe4a812699e1cbfc6", 4208192},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Eco Quest 2 - French DOS Floppy (from Strangerke)
+ // SCI interpreter version 1.001.081
+ {{"ecoquest2", "Floppy", {
+ {"resource.map", 0, "c22ab8b33c339c138b6b1697b77b9e79", 5588},
+ {"resource.000", 0, "1c4093f7248240329121fdf8c0d59152", 4231946},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Freddy Pharkas - English DOS demo (from FRG)
+ // SCI interpreter version 1.001.069
+ {{"freddypharkas", "Demo", {
+ {"resource.map", 0, "97aa9fcfe84c9993a64debd28c32393a", 1909},
+ {"resource.000", 0, "5ea8e7a3ea10cce6efd5c106dc62fd8c", 867724},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Freddy Pharkas - English CD (from FRG)
+ // SCI interpreter version 1.001.132
+ {{"freddypharkas", "CD", {
+ {"resource.map", 0, "d46b282f228a67ba13bd4b4009e95f8f", 6058},
+ {"resource.000", 0, "ee3c64ffff0ba9fb08bea2624631c598", 5490246},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Freddy Pharkas - English DOS Floppy (updated information from markcoolio in bug reports #2723773 and #2724720)
+ // Executable scanning reports "1.cfs.081"
+ // SCI interpreter version 1.001.132 (just a guess)
+ {{"freddypharkas", "Floppy", {
+ {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
+ {"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
+ {"resource.msg", 0, "554f65315d851184f6e38211489fdd8f", -1},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Freddy Pharkas - German DOS Floppy (from Tobis87, updated information from markcoolio in bug reports #2723772 and #2724720)
+ // Executable scanning reports "1.cfs.081"
+ // SCI interpreter version 1.001.132 (just a guess)
+ {{"freddypharkas", "", {
+ {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
+ {"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
+ {"resource.msg", 0, "304b5a5781800affd2235152a5794fa8", -1},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Freddy Pharkas - Spanish DOS (from jvprat)
+ // Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
+ // SCI interpreter version 1.001.132 (just a guess)
+ {{"freddypharkas", "CD", {
+ {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
+ {"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 1456640},
+ {"resource.001", 0, "15298fac241b5360763bfb68add1db07", 1456640},
+ {"resource.002", 0, "419dbd5366f702b4123dedbbb0cffaae", 1456640},
+ {"resource.003", 0, "05acdc256c742e79c50b9fe7ec2cc898", 863310},
+ {"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Freddy Pharkas - Spanish DOS (from jvprat)
+ // Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
+ // SCI interpreter version 1.001.132 (just a guess)
+ {{"freddypharkas", "Floppy", {
+ {"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
+ {"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
+ {"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Freddy Pharkas - English DOS CD Demo
+ // SCI interpreter version 1.001.095
+ {{"freddypharkas", "CD Demo", {
+ {"resource.map", 0, "a62a7eae85dd1e6b07f39662b278437e", 1918},
+ {"resource.000", 0, "4962a3c4dd44e36e78ea4a7a374c2220", 957382},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE},
+ 0
+ },
+
+ // Fun Seeker's Guide - English DOS
+ // SCI interpreter version 0.000.506
+ {{"funseeker", "", {
+ {"resource.map", 0, "7ee6859ef74314f6d91938c3595348a9", 282},
+ {"resource.001", 0, "f1e680095424e31f7fae1255d36bacba", 40692},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Gabriel Knight - English DOS CD Demo
+ // SCI interpreter version 1.001.092
+ {{"gk1", "CD Demo", {
+ {"resource.map", 0, "39645952ae0ed8072c7e838f31b75464", 2490},
+ {"resource.000", 0, "eb3ed7477ca4110813fe1fcf35928561", 1718450},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Gabriel Knight - English DOS Floppy
+ // SCI interpreter version 2.000.000
+ {{"gk1", "", {
+ {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10783},
+ {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Gabriel Knight - English DOS Floppy (supplied my markcoolio in bug report #2723777)
+ // SCI interpreter version 2.000.000
+ {{"gk1", "", {
+ {"resource.map", 0, "65e8c14092e4c9b3b3538b7602c8c5ec", 10783},
+ {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Gabriel Knight - German DOS Floppy (supplied my markcoolio in bug report #2723775)
+ // SCI interpreter version 2.000.000
+ {{"gk1", "", {
+ {"resource.map", 0, "ad6508b0296b25c07b1f58828dc33696", 10789},
+ {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13077029},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Gabriel Knight - English DOS CD (from jvprat)
+ // Executable scanning reports "2.000.000", VERSION file reports "01.100.000"
+ {{"gk1", "CD", {
+ {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996},
+ {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Gabriel Knight - German DOS CD (from Tobis87)
+ // SCI interpreter version 2.000.000
+ {{"gk1", "CD", {
+ {"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392},
+ {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Gabriel Knight - Spanish DOS CD (from jvprat)
+ // Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995"
+ {{"gk1", "CD", {
+ {"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404},
+ {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Gabriel Knight 2 - English Windows Non-Interactive Demo
+ // Executable scanning reports "2.100.002"
+ {{"gk2", "Demo", {
+ {"resource.map", 0, "e0effce11c4908f4b91838741716c83d", 1351},
+ {"resource.000", 0, "d04cfc7f04b6f74d13025378be49ec2b", 4640330},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+ // Gabriel Knight 2 - English DOS (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.1"
+ {{"gk2", "", {
+ {"resmap.001", 0, "1b8bf6a23b37ed67358eb825fc687260", 2776},
+ {"ressci.001", 0, "24463ae235b1afbbc4ff5e2ed1b8e3b2", 50496082},
+ {"resmap.002", 0, "2028230674bb54cd24370e0745e7a9f4", 1975},
+ {"ressci.002", 0, "f0edc1dcd704bd99e598c5a742dc7150", 42015676},
+ {"resmap.003", 0, "51f3372a2133c406719dafad86369be3", 1687},
+ {"ressci.003", 0, "86cb3f3d176994e7f8a9ad663a4b907e", 35313750},
+ {"resmap.004", 0, "0f6e48f3e84e867f7d4a5215fcff8d5c", 2719},
+ {"ressci.004", 0, "4f30aa6e6f895132402c8652f9e1d741", 58317316},
+ {"resmap.005", 0, "2dac0e232262b4a51271fd28559b3e70", 2065},
+ {"ressci.005", 0, "14b62d4a3bddee57a03cb1495a798a0f", 38075705},
+ {"resmap.006", 0, "ce9359037277b7d7976da185c2fa0aad", 2977},
+ {"ressci.006", 0, "8e44e03890205a7be12f45aaba9644b4", 60659424},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Hoyle 1 - English DOS (supplied by wibble92 in bug report #2644547)
+ // SCI interpreter version 0.000.530
+ {{"hoyle1", "", {
+ {"resource.map", 0, "9de9aa6d23569b3c8bf798503cf1216a", 7818},
+ {"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 162783},
+ {"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 342309},
+ {"resource.003", 0, "e0dd44069a62a463fd124974b915f10d", 328912},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Hoyle 1 - English DOS (supplied by merkur in bug report #2719227)
+ // SCI interpreter version 0.000.530
+ {{"hoyle1", "", {
+ {"resource.map", 0, "1034a218943d12f1f36e753fa10c95b8", 4386},
+ {"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 518308},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+#if 0 // TODO: unknown if these files are corrupt
+ // Hoyle 1 - English Amiga (from www.back2roots.org)
+ // SCI interpreter version 0.000.519 - FIXME: some have 0.000.530, others x.yyy.zzz
+ {{"hoyle1", "", {
+ {"resource.map", 0, "2a72b1aba65fa6e339370eb86d8601d1", 5166},
+ {"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 218755},
+ {"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 439502},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+#endif
+
+ // Hoyle 2 - English DOS
+ // SCI interpreter version 0.000.572
+ {{"hoyle2", "", {
+ {"resource.map", 0, "4f894d203f64aa23d9ff64d30ae36926", 2100},
+ {"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 98138},
+ {"resource.002", 0, "8f2dd70abe01112eca464cda818b5eb6", 196631},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Hoyle 2 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.002.032"
+ // SCI interpreter version 0.000.685
+ {{"hoyle2", "", {
+ {"resource.map", 0, "62ed48d20c580e5a98f102f7cd93706a", 1356},
+ {"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 222704},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+#if 0 // TODO: unknown if these files are corrupt
+ // Hoyle 3 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.005.000"
+ // SCI interpreter version 1.000.510
+ {{"hoyle3", "", {
+ {"resource.map", 0, "f1f158e428398cb87fc41fb4aa8c2119", 2088},
+ {"resource.000", 0, "595b6039ea1356e7f96a52c58eedcf22", 355791},
+ {"resource.001", 0, "143df8aef214a2db34c2d48190742012", 632273},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif
+
+ // Hoyle 3 - English DOS Non-Interactive Demo
+ // Executable scanning reports "x.yyy.zzz"
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"hoyle3", "Demo", {
+ {"resource.map", 0, "0d06cacc87dc21a08cd017e73036f905", 735},
+ {"resource.001", 0, "24db2bccda0a3c43ac4a7b5edb116c7e", 797678},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Hoyle 3 - English DOS Floppy (from jvprat)
+ // Executable scanning reports "x.yyy.zzz", Floppy label reports "1.0, 11.2.91", VERSION file reports "1.000"
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"hoyle3", "", {
+ {"resource.map", 0, "7216a2972f9c595c45ab314941628e43", 2247},
+ {"resource.000", 0, "6ef28cac094dcd97fdb461662ead6f92", 541845},
+ {"resource.001", 0, "0a98a268ee99b92c233a0d7187c1f0fa", 845795},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Hoyle 4 - English DOS Demo
+ // SCI interpreter version 1.001.200 (just a guess)
+ {{"hoyle4", "Demo", {
+ {"resource.map", 0, "662087cb383e52e3cc4ae7ecb10e20aa", 938},
+ {"resource.000", 0, "24c10844792c54d476d272213cbac300", 675252},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+#if 0
+ // Jones in the Fast Lane - English DOS
+ // SCI interpreter version 1.000.172
+ {{"jones", "", {
+ {"resource.map", 0, "65cbe19b36fffc71c8e7b2686bd49ad7", 1800},
+ {"resource.001", 0, "bac3ec6cb3e3920984ab0f32becf5163", 313476},
+ {"resource.002", 0, "b86daa3ba2784d1502da881eedb80d9b", 719747},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif
+
+ // King's Quest 1 SCI Remake - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.003.007"
+ // SCI interpreter version 0.001.010
+ {{"kq1sci", "SCI Remake", {
+ {"resource.map", 0, "37ed1a05eb719629eba15059c2eb6cbe", 6798},
+ {"resource.001", 0, "9ae2a13708d691cd42f9129173c4b39d", 266621},
+ {"resource.002", 0, "9ae2a13708d691cd42f9129173c4b39d", 795123},
+ {"resource.003", 0, "9ae2a13708d691cd42f9129173c4b39d", 763224},
+ {"resource.004", 0, "9ae2a13708d691cd42f9129173c4b39d", 820443},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 1 SCI Remake - English DOS Non-Interactive Demo
+ // Executable scanning reports "S.old.010"
+ {{"kq1sci", "SCI Remake Demo", {
+ {"resource.map", 0, "59b13619078bd47011421468959ee5d4", 954},
+ {"resource.001", 0, "4cfb9040db152868f7cb6a1e8151c910", 296555},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 1 SCI Remake - English DOS (from the King's Quest Collection)
+ // Executable scanning reports "S.old.010", VERSION file reports "1.000.051"
+ // SCI interpreter version 0.000.999
+ {{"kq1sci", "SCI Remake", {
+ {"resource.map", 0, "7fe9399a0bec84ca5727309778d27f07", 5790},
+ {"resource.001", 0, "fed9e0072ffd511d248674e60dee2099", 555439},
+ {"resource.002", 0, "fed9e0072ffd511d248674e60dee2099", 714062},
+ {"resource.003", 0, "fed9e0072ffd511d248674e60dee2099", 717478},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 4 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.002.032"
+ // SCI interpreter version 0.000.685
+ {{"kq4sci", "", {
+ {"resource.map", 0, "f88dd267fb9504d40a04d599c048d42b", 6354},
+ {"resource.000", 0, "77615c595388acf3d1df8e107bfb6b52", 138523},
+ {"resource.001", 0, "52c2231765eced34faa7f7bcff69df83", 44751},
+ {"resource.002", 0, "fb351106ec865fad9af5d78bd6b8e3cb", 663629},
+ {"resource.003", 0, "fd16c9c223f7dc5b65f06447615224ff", 683016},
+ {"resource.004", 0, "3fac034c7d130e055d05bc43a1f8d5f8", 549993},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 4 - English DOS Non-Interactive Demo
+ // Executable scanning reports "0.000.494"
+ {{"kq4sci", "Demo", {
+ {"resource.map", 0, "992ac7cc31d3717fe53818a9bb6d1dae", 594},
+ {"resource.001", 0, "143e1c14f15ad0fbfc714f648a65f661", 205330},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // King's Quest 4 - English DOS (from the King's Quest Collection)
+ // Executable scanning reports "0.000.502"
+ // SCI interpreter version 0.000.502
+ {{"kq4sci", "", {
+ {"resource.map", 0, "3164a39790b599c954ecf716d0b32be8", 7476},
+ {"resource.001", 0, "77615c595388acf3d1df8e107bfb6b52", 452523},
+ {"resource.002", 0, "77615c595388acf3d1df8e107bfb6b52", 536573},
+ {"resource.003", 0, "77615c595388acf3d1df8e107bfb6b52", 707591},
+ {"resource.004", 0, "77615c595388acf3d1df8e107bfb6b52", 479562},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // King's Quest 4 - English DOS
+ // SCI interpreter version 0.000.274
+ {{"kq4sci", "", {
+ {"resource.map", 0, "adbe267662a5915d3c89c9075ec8cf3e", 9474},
+ {"resource.001", 0, "851a62d00972dc4002f472cc0d84e71d", 188239},
+ {"resource.002", 0, "851a62d00972dc4002f472cc0d84e71d", 329895},
+ {"resource.003", 0, "851a62d00972dc4002f472cc0d84e71d", 355385},
+ {"resource.004", 0, "851a62d00972dc4002f472cc0d84e71d", 322951},
+ {"resource.005", 0, "851a62d00972dc4002f472cc0d84e71d", 321593},
+ {"resource.006", 0, "851a62d00972dc4002f472cc0d84e71d", 333777},
+ {"resource.007", 0, "851a62d00972dc4002f472cc0d84e71d", 341038},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // King's Quest 4 - English DOS
+ // SCI interpreter version 0.000.253
+ {{"kq4sci", "", {
+ {"resource.map", 0, "381d9dcb69c626f0a60631dbfec1d13a", 9474},
+ {"resource.001", 0, "0c8566848a76eea19a6d6220914030a7", 191559},
+ {"resource.002", 0, "0c8566848a76eea19a6d6220914030a7", 333345},
+ {"resource.003", 0, "0c8566848a76eea19a6d6220914030a7", 358513},
+ {"resource.004", 0, "0c8566848a76eea19a6d6220914030a7", 326297},
+ {"resource.005", 0, "0c8566848a76eea19a6d6220914030a7", 325102},
+ {"resource.006", 0, "0c8566848a76eea19a6d6220914030a7", 337288},
+ {"resource.007", 0, "0c8566848a76eea19a6d6220914030a7", 343882},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // King's Quest 5 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.004.018"
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "fcbcca058e1157221ffc27251cd59bc3", 8040},
+ {"resource.000", 0, "c595ca99e7fa9b2cabcf69cfab0caf67", 344909},
+ {"resource.001", 0, "964a3be90d810a99baf72ea70c09f935", 836477},
+ {"resource.002", 0, "d10f3e8ff2cd95a798b21cd08797b694", 814730},
+ {"resource.003", 0, "f72fdd994d9ba03a8360d639f256344e", 804882},
+ {"resource.004", 0, "a5b80f95c66b3a032348989408eec287", 747914},
+ {"resource.005", 0, "31a5487f4d942e6354d5be49d59707c9", 834146},
+ {"resource.006", 0, "26c0c25399b6715fec03fc3e12544fe3", 823048},
+ {"resource.007", 0, "b914b5901e786327213e779725d30dd1", 778772},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - German Amiga
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "bfbffd923cd64b24498e54f797aa6e41", 8250},
+ {"resource.000", 0, "79479b5e4e5b0085d8eea1c7ff0f9f5a", 306893},
+ {"resource.001", 0, "7840aadc82977c7b4f504a7e4a12829f", 720376},
+ {"resource.002", 0, "d547167d4204170b44de8e1d63506215", 792586},
+ {"resource.003", 0, "9cbb0712816097cbc9d0c1f987717c7f", 646446},
+ {"resource.004", 0, "319712573661bd122390cdfbafb000fd", 831842},
+ {"resource.005", 0, "5aa3d59968b569cd509dde00d4eb8751", 754201},
+ {"resource.006", 0, "56546b20db11a4836f900efa6d3a3e74", 672099},
+ {"resource.007", 0, "56546b20db11a4836f900efa6d3a3e74", 794194},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - Italian Amiga
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "12e2f80c0269932411716dad06d2b229", 8250},
+ {"resource.000", 0, "c598ff615a61bc0e418761283409f128", 305879},
+ {"resource.001", 0, "17e63cfe78632fe07222e13a26dc0fb2", 720023},
+ {"resource.002", 0, "abb340a53e4873a7c3bacfb16c0b779d", 792432},
+ {"resource.003", 0, "aced8ce0be07eef77c0e7cff8cc4e476", 646088},
+ {"resource.004", 0, "13fc1f1679f7f226ba52ffffe2e65f38", 831805},
+ {"resource.005", 0, "de3c5c09e350fded36ca354998c2194d", 754784},
+ {"resource.006", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 672527},
+ {"resource.007", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 794259},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - English DOS CD (from the King's Quest Collection)
+ // Executable scanning reports "x.yyy.zzz", VERSION file reports "1.000.052"
+ // SCI interpreter version 1.000.784
+ {{"kq5", "CD", {
+ {"resource.map", 0, "f68ba690e5920725dcf9328001b90e33", 13122},
+ {"resource.000", 0, "449471bfd77be52f18a3773c7f7d843d", 571368},
+ {"resource.001", 0, "b45a581ff8751e052c7e364f58d3617f", 16800210},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // King's Quest 5 - English DOS Floppy
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "d6172c27b453350e158815fbae23f41e", 8004},
+ {"resource.000", 0, "a591bd4b879fc832b8095c0b3befe9e2", 276351},
+ {"resource.001", 0, "3f28c72dc7531aaccf8e972c7ee50d14", 1022087},
+ {"resource.002", 0, "3e56ba5bf5e8637c619b57f6b6cacbb4", 1307211},
+ {"resource.003", 0, "5d5d498f33ca7cde0d5b058630b36ad3", 1347875},
+ {"resource.004", 0, "944a996f9cc90dabde9f51ed7dd52366", 1239689},
+ {"resource.005", 0, "b6c43441cb78a9b484efc8e614aac092", 1287999},
+ {"resource.006", 0, "672ede1136e9e401658538e51bd5dc22", 1172619},
+ {"resource.007", 0, "2f48faf27666b58c276dda20f91f4a93", 1240456},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - German DOS Floppy (supplied by markcoolio in bug report #2727101)
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "bff44f0c326a71b1757c793a02b502d6", 8283},
+ {"resource.000", 0, "d7ed18ec4a5de02a9a57830aa65a600d", 336826},
+ {"resource.001", 0, "b1e5ec6a17be7e75ddb955f6f73191e4", 1136919},
+ {"resource.002", 0, "04a88122db44610a4af019a579ec5ff6", 1340813},
+ {"resource.003", 0, "215bb35acefae75fc80757c717166d7e", 1323916},
+ {"resource.004", 0, "fecdec847e3bd8e3b0f9827900aa95fd", 1331811},
+ {"resource.005", 0, "9c429782d102739f6bbb81e8b953b0cb", 1267525},
+ {"resource.006", 0, "d1a75fdc01840664d00366cff6919366", 1208972},
+ {"resource.007", 0, "c07494f0cce7c05210893938786a955b", 1337361},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - French DOS Floppy (from the King's Quest Collector's Edition 1994)
+ // Supplied by aroenai in bug report #2812611
+ // VERSION file reports "1.000", SCI interpreter version 1.000.784
+ {{"kq5", "", {
+ {"resource.map", 0, "eb7853832f3bb10900b13b421a0bbe7f", 8283},
+ {"resource.000", 0, "f063775b279208c14a83eda47073be90", 332806},
+ {"resource.001", 0, "3e6add38564250fd1a5bb10593007530", 1136827},
+ {"resource.002", 0, "d9a97a9cf6c79bbe8f19378f6dea45d5", 1343738},
+ {"resource.003", 0, "bef90d755076c110e67ee3e635503f82", 1324811},
+ {"resource.004", 0, "c14dbafcfbe00855ac6b2f2701058047", 1332216},
+ {"resource.005", 0, "f4b31cafc5defac75125c5f7b7f9a31a", 1268334},
+ {"resource.006", 0, "f7dc85307632ef657ceb1651204f6f51", 1210081},
+ {"resource.007", 0, "7db4d0a1d8d547c0019cb7d2a6acbdd4", 1338473},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - Italian DOS Floppy (from glorifindel)
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "d55c9e83894a0885e37cd79bacf86384", 8283},
+ {"resource.000", 0, "c99bbb11ace4aaacdc98b588a2ecea06", 332246},
+ {"resource.001", 0, "42b98457b1a7282daa27afd89eef53f4", 1136389},
+ {"resource.002", 0, "8cdc160f9dfc84aed7caa6c66fa31000", 1340730},
+ {"resource.003", 0, "d0cb52dc41488c018359aa79a6527f51", 1323676},
+ {"resource.004", 0, "e5c57060adf2b5c6fc24142acba023da", 1331097},
+ {"resource.005", 0, "f4e441f284560eaa8022102315656a7d", 1267757},
+ {"resource.006", 0, "8eeabd92af71e766e323db2100879102", 1209325},
+ {"resource.007", 0, "dc10c107e0923b902326a040b9c166b9", 1337859},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 5 - Polish DOS Floppy (supplied by jacek909 in bug report #2725722)
+ // SCI interpreter version 1.000.060
+ {{"kq5", "", {
+ {"resource.map", 0, "70010c20138541f89013bb5e1b30f16a", 7998},
+ {"resource.000", 0, "a591bd4b879fc832b8095c0b3befe9e2", 276398},
+ {"resource.001", 0, "c0f48d4a7ebeaa6aa074fc98d77423e9", 1018560},
+ {"resource.002", 0, "7f188a95acdb60bbe32a8379ba299393", 1307048},
+ {"resource.003", 0, "0860785af59518b94d54718dddcd6907", 1348500},
+ {"resource.004", 0, "c4745dd1e261c22daa6477961d08bf6c", 1239887},
+ {"resource.005", 0, "6556ff8e7c4d1acf6a78aea154daa76c", 1287869},
+ {"resource.006", 0, "da82e4beb744731d0a151f1d4922fafa", 1170456},
+ {"resource.007", 0, "431def14ca29cdb5e6a5e84d3f38f679", 1240176},
+ {NULL, 0, NULL, 0}}, Common::PL_POL, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 6 - English DOS Non-Interactive Demo
+ // Executable scanning reports "1.001.055", VERSION file reports "1.000.000"
+ // SCI interpreter version 1.001.055
+ {{"kq6", "Demo", {
+ {"resource.map", 0, "f75727c00a6d884234fa2a43c951943a", 706},
+ {"resource.000", 0, "535b1b920441ec73f42eaa4ccfd47b89", 264116},
+ {"resource.msg", 0, "54d1fdc936f98c81f9e4c19e04fb1510", 8260},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 6 - English DOS Floppy
+ // SCI interpreter version 1.001.054
+ {{"kq6", "", {
+ {"resource.map", 0, "a362063318eebe7d6423b1d9dc6213e1", 8703},
+ {"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
+ {"resource.msg", 0, "3cf5de44de36191f109d425b8450efc8", 258590},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 6 - German DOS Floppy (supplied by markcoolio in bug report #2727156)
+ // SCI interpreter version 1.001.054
+ {{"kq6", "", {
+ {"resource.map", 0, "a362063318eebe7d6423b1d9dc6213e1", 8703},
+ {"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
+ {"resource.msg", 0, "756297b2155db9e43f621c6f6fb763c3", 282822},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 6 - English Windows CD (from the King's Quest Collection)
+ // Executable scanning reports "1.cfs.158", VERSION file reports "1.034 9/11/94 - KQ6 version 1.000.00G"
+ // SCI interpreter version 1.001.054
+ {{"kq6", "CD", {
+ {"resource.map", 0, "7a550ebfeae2575ca00d47703a6a774c", 9215},
+ {"resource.000", 0, "233394a5f33b475ae5975e7e9a420865", 8376352},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // King's Quest 6 - Spanish DOS CD (from jvprat)
+ // Executable scanning reports "1.cfs.158", VERSION file reports "1.000.000, July 5, 1994"
+ // SCI interpreter version 1.001.055
+ {{"kq6", "CD", {
+ {"resource.map", 0, "a73a5ab04b8f60c4b75b946a4dccea5a", 8953},
+ {"resource.000", 0, "4da3ad5868a775549a7cc4f72770a58e", 8537260},
+ {"resource.msg", 0, "41eed2d3893e1ca6c3695deba4e9d2e8", 267102},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // King's Quest 7 - English DOS (from the King's Quest Collection)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.4"
+ {{"kq7", "", {
+ {"resource.map", 0, "2be9ab94429c721af8e05c507e048a15", 18697},
+ {"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 203882535},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 7 - English DOS (from FRG)
+ // SCI interpreter version 2.100.002
+ {{"kq7", "", {
+ {"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709},
+ {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 7 - German Windows (supplied by markcoolio in bug report #2727402)
+ // SCI interpreter version 2.100.002
+ {{"kq7", "", {
+ {"resource.map", 0, "838b9ff132bd6962026fee832e8a7ddb", 18697},
+ {"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 206626576},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 7 - Spanish DOS (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "2.00"
+ {{"kq7", "", {
+ {"resource.map", 0, "0b62693cbe87e3aaca3e8655a437f27f", 18709},
+ {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // King's Quest 7 - English DOS Non-Interactive Demo
+ // SCI interpreter version 2.100.002
+ {{"kq7", "Demo", {
+ {"resource.map", 0, "b44f774108d63faa1d021101221c5a54", 1690},
+ {"resource.000", 0, "d9659d2cf0c269c6a9dc776707f5bea0", 2433827},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Laura Bow - English Amiga
+ // Executable scanning reports "1.002.030"
+ // SCI interpreter version 0.000.685
+ {{"laurabow", "", {
+ {"resource.map", 0, "731ab85e138f8cef1a7f4d1f36dfd375", 7422},
+ {"resource.000", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 126317},
+ {"resource.001", 0, "42fe895e9eb60e103025fd9ca737a849", 264763},
+ {"resource.002", 0, "6f1ebd3692ce76644e0e06a38b7b56b5", 677436},
+ {"resource.003", 0, "2ab23f64306b18c28302c8ec2964c5d6", 605134},
+ {"resource.004", 0, "aa553977f7e5804081de293800d3bcce", 695067},
+ {"resource.005", 0, "bfd870d51dc97729f0914095f58e6957", 676881},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow - English Atari ST (from jvprat)
+ // Executable scanning reports "1.002.030", Floppy label reports "1.000.062, 9.23.90"
+ // SCI interpreter version 0.000.685
+ {{"laurabow", "", {
+ {"resource.map", 0, "9f90878e6e1b8c96e692203f068ce2b1", 8478},
+ {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 515964},
+ {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 721149},
+ {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 667365},
+ {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 683737},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow - English DOS Non-Interactive Demo
+ // Executable scanning reports "x.yyy.zzz"
+ {{"laurabow", "Demo", {
+ {"resource.map", 0, "e625726268ff4e123ada11f31f0249f3", 768},
+ {"resource.001", 0, "0c8912290af0890f8d95faeb4ddb2d68", 333031},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow - English DOS 3.5" Floppy (from "The Roberta Williams Anthology"/1996)
+ // SCI interpreter version 0.000.631
+ {{"laurabow", "", {
+ {"resource.map", 0, "4e511f47d9893fa529d6621a93fa0030", 8478},
+ {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 515788},
+ {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 721381},
+ {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 667468},
+ {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 683807},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow - English DOS (from FRG)
+ // SCI interpreter version 0.000.631 (or 0.000.685?)
+ {{"laurabow", "", {
+ {"resource.map", 0, "b1905f6aa68ff65a057b080b1eae954c", 12030},
+ {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 108032},
+ {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 354680},
+ {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 361815},
+ {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 339714},
+ {"resource.005", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 327465},
+ {"resource.006", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 328390},
+ {"resource.007", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 317687},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow - German DOS (from Tobis87)
+ // SCI interpreter version 0.000.631 (or 0.000.685?)
+ {{"laurabow", "", {
+ {"resource.map", 0, "b1905f6aa68ff65a057b080b1eae954c", 12030},
+ {"resource.001", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 108032},
+ {"resource.002", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 354680},
+ {"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 361815},
+ {"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 339714},
+ {"resource.005", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 327465},
+ {"resource.006", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 328390},
+ {"resource.007", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 317687},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow 2 - English DOS Non-Interactive Demo (from FRG)
+ // Executable scanning reports "x.yyy.zzz"
+ // SCI interpreter version 1.001.069 (just a guess)
+ {{"laurabow2", "Demo", {
+ {"resource.map", 0, "24dffc5db1d88c7999f13e8767ed7346", 855},
+ {"resource.000", 0, "2b2b1b4f7584f9b38fd13f6ab95634d1", 781912},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow 2 - English DOS Floppy
+ // Executable scanning reports "2.000.274"
+ // SCI interpreter version 1.001.069 (just a guess)
+ {{"laurabow2", "", {
+ {"resource.map", 0, "610bfd9a852004222f0faaf5fc9e630a", 6489},
+ {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5035964},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow 2 - English DOS CD (from "The Roberta Williams Antology"/1996)
+ // Executable scanning reports "1.001.072", VERSION file reports "1.1" (from jvprat)
+ // SCI interpreter version 1.001.069 (just a guess)
+ {{"laurabow2", "CD", {
+ {"resource.map", 0, "a70945e61ba7ac7bfea6b7bd72c6aec5", 7274},
+ {"resource.000", 0, "82578b8d5a7e09c4c58891ca49fae35b", 5598672},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Laura Bow 2 v1.1 - German DOS Floppy (from Tobis87, updated info from markcoolio in bug report #2723787, updated info from #2797962))
+ // Executable scanning reports "2.000.274"
+ {{"laurabow2", "", {
+ {"resource.map", 0, "3b6dfbcda210bbc3f23fd1927113bf98", 6483},
+ {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
+ {"resource.msg", 0, "795c928cd00dfec9fbc62ebcd12e1f65", 303185},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Laura Bow 2 - Spanish DOS CD (from jvprat)
+ // Executable scanning reports "2.000.274", VERSION file reports "1.000.000, May 10, 1994"
+ {{"laurabow2", "CD", {
+ {"resource.map", 0, "3b6dfbcda210bbc3f23fd1927113bf98", 6483},
+ {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
+ {"resource.msg", 0, "71f1f0cd9f082da2e750c793a8ed9d84", 286141},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 1 EGA Remake - English DOS (from spookypeanut)
+ // SCI interpreter version 0.000.510 (or 0.000.577?)
+ {{"lsl1sci", "EGA Remake", {
+ {"resource.map", 0, "abc0dc50c55de5b9723bb6de193f8756", 3282},
+ {"resource.000", 0, "d3bceaebef3f7be941c2038b3565161e", 451366},
+ {"resource.001", 0, "38936d3c68b6f79d3ffb13955713fed7", 591352},
+ {"resource.002", 0, "24c958bc922b07f91e25e8c93aa01fcf", 491230},
+ {"resource.003", 0, "685cd6c1e05a695ab1e0db826337ee2a", 553279},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 1 VGA Remake - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.784
+ {{"lsl1sci", "VGA Remake", {
+ {"resource.map", 0, "7d115a9e27dc8ac71e8d5ef33d589bd5", 3366},
+ {"resource.000", 0, "e67fd129d5810fc7ad8ea509d891cc00", 363073},
+ {"resource.001", 0, "24ed6dc01b1e7fbc66c3d63a5994549a", 750465},
+ {"resource.002", 0, "5790ac0505f7ca98d4567132b875eb1e", 681041},
+ {"resource.003", 0, "4a34c3367c2fe7eb380d741374da1989", 572251},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 1 VGA Remake - English DOS (from spookypeanut)
+ // Executable scanning reports "1.000.577", VERSION file reports "2.1"
+ {{"lsl1sci", "VGA Remake", {
+ {"resource.map", 0, "6d04d26466337a1a64b8c6c0eb65c9a9", 3222},
+ {"resource.000", 0, "d3bceaebef3f7be941c2038b3565161e", 922406},
+ {"resource.001", 0, "ec20246209d7b19f38989261e5c8f5b8", 1111226},
+ {"resource.002", 0, "85d6935ef77e6b0e16bc307640a0d913", 1088312},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 1 VGA Remake - English DOS (from FRG)
+ // SCI interpreter version 1.000.510
+ {{"lsl1sci", "VGA Remake", {
+ {"resource.map", 0, "8606b083b011a0cc4a1fbfc2198a0a77", 3198},
+ {"resource.000", 0, "d3bceaebef3f7be941c2038b3565161e", 918242},
+ {"resource.001", 0, "d34cadb11e1aefbb497cf91bc1d3baa7", 1114688},
+ {"resource.002", 0, "85b030bb66d5342b0a068f1208c431a8", 1078443},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 1 VGA Remake - English DOS Non-Interactive Demo
+ // SCI interpreter version 1.000.084
+ {{"lsl1sci", "VGA Remake Demo", {
+ {"resource.map", 0, "434e1f6c39d71647b34f0ee57b2bbd68", 444},
+ {"resource.001", 0, "0c0768215c562d9dace4a5ca53696cf3", 359913},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 1 VGA Remake - Spanish DOS (from the Leisure Suit Larry Collection)
+ // Executable scanning reports "1.SQ4.057", VERSION file reports "1.000"
+ // This version is known to be corrupted
+ // SCI interpreter version 1.000.510
+ {{"lsl1sci", "VGA Remake", {
+ {"resource.map", 0, "4fbe5c25878d51d7b2a68b710de4491b", 3327},
+ {"resource.000", 0, "5e501a9bf8c753bf4c96158042422f00", 839172},
+ {"resource.001", 0, "112648995dbc194037f1e4ed2e195910", 1063341},
+ {"resource.002", 0, "3fe2a3aec0ed53c7d6db1845a67e3aa2", 1095908},
+ {"resource.003", 0, "ac175df0ea9a2cba57f0248651856d27", 376556},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 1 VGA Remake - Russian DOS
+ // Executable scanning reports "1.000.510", VERSION file reports "2.0"
+ // SCI interpreter version 1.000.510
+ {{"lsl1sci", "VGA Remake", {
+ {"resource.map", 0, "b54413d35e206d21ae2b2bdb092bd13a", 3198},
+ {"resource.000", 0, "0d7b2afa666bd36d9535a15d3a837a66", 928566},
+ {"resource.001", 0, "bc8ca10c807515d959cbd91f9ba47735", 1123759},
+ {"resource.002", 0, "b7409ab32bc3bee2d6cce887cd33f2b6", 1092160},
+ {NULL, 0, NULL, 0}}, Common::RU_RUS, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 2 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "x.yyy.zzz"
+ // SCI interpreter version 0.000.572
+ {{"lsl2", "", {
+ {"resource.map", 0, "e36ce0fc94d1678d15acbf12d84ec47d", 6612},
+ {"resource.001", 0, "a0d4a625311d307257da7fc43d00459d", 409124},
+ {"resource.002", 0, "a0d4a625311d307257da7fc43d00459d", 630106},
+ {"resource.003", 0, "a0d4a625311d307257da7fc43d00459d", 570356},
+ {"resource.004", 0, "a0d4a625311d307257da7fc43d00459d", 717844},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 2 - English DOS Non-Interactive Demo
+ // Executable scanning reports "x.yyy.zzz"
+ // SCI interpreter version 0.000.409
+ {{"lsl2", "Demo", {
+ {"resource.map", 0, "03dba704bb77da55a91ad27b5a3cac09", 528},
+ {"resource.001", 0, "9f5520f0297206928df0b0b36493cd33", 127532},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 2 - English DOS
+ // SCI interpreter version 0.000.409
+ {{"lsl2", "", {
+ {"resource.map", 0, "42258cf767a8ebaa9e66b6151a80e601", 5628},
+ {"resource.001", 0, "4a24443a25e2b1492462a52809605dc2", 143847},
+ {"resource.002", 0, "4a24443a25e2b1492462a52809605dc2", 348331},
+ {"resource.003", 0, "4a24443a25e2b1492462a52809605dc2", 236550},
+ {"resource.004", 0, "4a24443a25e2b1492462a52809605dc2", 204861},
+ {"resource.005", 0, "4a24443a25e2b1492462a52809605dc2", 277732},
+ {"resource.006", 0, "4a24443a25e2b1492462a52809605dc2", 345683},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 2 - English DOS
+ // SCI interpreter version 0.000.343
+ {{"lsl2", "", {
+ {"resource.map", 0, "6bd43c92eaf561f64818116eed683fcf", 5598},
+ {"resource.001", 0, "96033f57accfca903750413fd09193c8", 140526},
+ {"resource.002", 0, "96033f57accfca903750413fd09193c8", 348672},
+ {"resource.003", 0, "96033f57accfca903750413fd09193c8", 236676},
+ {"resource.004", 0, "96033f57accfca903750413fd09193c8", 204867},
+ {"resource.005", 0, "96033f57accfca903750413fd09193c8", 274953},
+ {"resource.006", 0, "96033f57accfca903750413fd09193c8", 345818},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 3 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.002.032"
+ // SCI interpreter version 0.000.685
+ {{"lsl3", "", {
+ {"resource.map", 0, "4a6da6322ce189431b5ffbac992bad3a", 5328},
+ {"resource.000", 0, "cdc2e21e297b10fe8fed6377af8c5698", 66523},
+ {"resource.001", 0, "6abbaf8c7e3b36dd868868ed187e8995", 71761},
+ {"resource.002", 0, "a883424fe6d594fec0cd5a79e7ad54c8", 476490},
+ {"resource.003", 0, "5c10e462c8cf589610773e4fe8bfd996", 527238},
+ {"resource.004", 0, "f408e59cbee1457f042e5773b8c53951", 651634},
+ {"resource.005", 0, "433911eb764089d493aed1f958a5615a", 524259},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 3 - English DOS
+ // SCI interpreter version 0.000.572
+ {{"lsl3", "", {
+ {"resource.map", 0, "0b6bd3e039682830a51c5755c06591db", 5916},
+ {"resource.001", 0, "f18441027154292836b973c655fa3175", 456722},
+ {"resource.002", 0, "f18441027154292836b973c655fa3175", 578024},
+ {"resource.003", 0, "f18441027154292836b973c655fa3175", 506807},
+ {"resource.004", 0, "f18441027154292836b973c655fa3175", 513651},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 3 - English DOS
+ // SCI interpreter version 0.000.572
+ {{"lsl3", "", {
+ {"resource.map", 0, "0f429f5186f96d6c501838a1cb44bd43", 7452},
+ {"resource.001", 0, "f18441027154292836b973c655fa3175", 141381},
+ {"resource.002", 0, "f18441027154292836b973c655fa3175", 345171},
+ {"resource.003", 0, "f18441027154292836b973c655fa3175", 329214},
+ {"resource.004", 0, "f18441027154292836b973c655fa3175", 290173},
+ {"resource.005", 0, "f18441027154292836b973c655fa3175", 302946},
+ {"resource.006", 0, "f18441027154292836b973c655fa3175", 282465},
+ {"resource.007", 0, "f18441027154292836b973c655fa3175", 257174},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 3 - English DOS Non-Interactive Demo
+ // SCI interpreter version 0.000.530
+ {{"lsl3", "Demo", {
+ {"resource.map", 0, "33a2384f395470af3d2180e37ad0322a", 1140},
+ {"resource.001", 0, "f773d79b93dfd4052ec8c1cc64c1e6ab", 76525},
+ {"resource.002", 0, "f773d79b93dfd4052ec8c1cc64c1e6ab", 268299},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 3 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723832)
+ // Executable scanning reports "S.old.123"
+ // SCI interpreter version 0.000.572 (just a guess)
+ {{"lsl3", "", {
+ {"resource.map", 0, "4a77c8382e48a90c4168d3c144fc1b8f", 6480},
+ {"resource.001", 0, "3827a9b17b926e12dcc336860f50612a", 460488},
+ {"resource.002", 0, "3827a9b17b926e12dcc336860f50612a", 672403},
+ {"resource.003", 0, "3827a9b17b926e12dcc336860f50612a", 587036},
+ {"resource.004", 0, "3827a9b17b926e12dcc336860f50612a", 691932},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 3 - French DOS (provided by richiefs in bug report #2670691)
+ // Executable scanning reports "S.old.123"
+ // SCI interpreter version 0.000.572 (just a guess)
+ {{"lsl3", "", {
+ {"resource.map", 0, "13541234d440c7988a13582468b0e4be", 6480},
+ {"resource.001", 0, "65f1bdaa20f6d0470e9d969f22473873", 457402},
+ {"resource.002", 0, "65f1bdaa20f6d0470e9d969f22473873", 671614},
+ {"resource.003", 0, "65f1bdaa20f6d0470e9d969f22473873", 586921},
+ {"resource.004", 0, "65f1bdaa20f6d0470e9d969f22473873", 690826},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Larry 5 - English Amiga
+ // Executable scanning reports "1.004.023"
+ // SCI interpreter version 1.000.784
+ {{"lsl5", "", {
+ {"resource.map", 0, "e36052ae0c8b14d6f074bcb0aee50a38", 6096},
+ {"resource.000", 0, "d8b58ce10de52aa16f8b2006838c4fcc", 310510},
+ {"resource.001", 0, "8caa8fbb50ea43f3efdfb66f1e68998b", 800646},
+ {"resource.002", 0, "abdaa299e00c908052d33cd82eb60e9b", 784576},
+ {"resource.003", 0, "810ad1d61638c27a780576cb09f18ed7", 805941},
+ {"resource.004", 0, "3ce5901f1bc171ac0274d99a4eeb9e57", 623022},
+ {"resource.005", 0, "f8b2d1137bb767e5d232056b99dd69eb", 623621},
+ {"resource.006", 0, "bafc64e3144f115dc58c6aee02de98fb", 715598},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - German Amiga
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.784
+ {{"lsl5", "", {
+ {"resource.map", 0, "863326c2eb5160f0b0960e159e8bf954", 6372},
+ {"resource.000", 0, "5113d03db08e3da77a5b61294001331b", 357525},
+ {"resource.001", 0, "59eba83ad465b08d763b44f86afa86f6", 837566},
+ {"resource.002", 0, "59eba83ad465b08d763b44f86afa86f6", 622229},
+ {"resource.003", 0, "59eba83ad465b08d763b44f86afa86f6", 383690},
+ {"resource.004", 0, "59eba83ad465b08d763b44f86afa86f6", 654296},
+ {"resource.005", 0, "59eba83ad465b08d763b44f86afa86f6", 664717},
+ {"resource.006", 0, "bafc64e3144f115dc58c6aee02de98fb", 754966},
+ {"resource.007", 0, "59eba83ad465b08d763b44f86afa86f6", 683135},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - English DOS Non-Interactive Demo (from FRG)
+ // SCI interpreter version 1.000.181
+ {{"lsl5", "Demo", {
+ {"resource.map", 0, "efe8d3f45ce4f6bd9a6643e0ac8d2a97", 504},
+ {"resource.001", 0, "8bd8d9c0b5f455ee1269d63ce86c50dd", 531380},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - English DOS (from spookypeanut)
+ // SCI interpreter version 1.000.510
+ {{"lsl5", "", {
+ {"resource.map", 0, "be00ef895197754ae4eab021ca44cbcd", 6417},
+ {"resource.000", 0, "f671ab479df0c661b19cd16237692846", 726823},
+ {"resource.001", 0, "db4a1381d88028876a99303bfaaba893", 751296},
+ {"resource.002", 0, "d39d8db1a1e7806e7ccbfea3ef22df44", 1137646},
+ {"resource.003", 0, "13fd4942bb818f9acd2970d66fca6509", 768599},
+ {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1024516},
+ {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 1011944},
+ {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1024810},
+ {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 1030656},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - German DOS (from Tobis87)
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"lsl5", "", {
+ {"resource.map", 0, "c97297aa76d4dd2ed144c7b7769e2caf", 6867},
+ {"resource.000", 0, "4c00c14b8181ad47076a51d86097d97e", 759095},
+ {"resource.001", 0, "245c44f8ccd796732e61857e67b30079", 918742},
+ {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 947382},
+ {"resource.003", 0, "74edc89d8c1cb346ca346081b927e4c6", 1006884},
+ {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1023776},
+ {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 959342},
+ {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1021774},
+ {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 993408},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - French DOS (provided by richiefs in bug report #2670691)
+ // Executable scanning reports "1.lsl5.019"
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"lsl5", "", {
+ {"resource.map", 0, "499898e652dc41b51e368ae41acce41f", 7023},
+ {"resource.000", 0, "4c00c14b8181ad47076a51d86097d97e", 958096},
+ {"resource.001", 0, "245c44f8ccd796732e61857e67b30079", 1196765},
+ {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 948898},
+ {"resource.003", 0, "74edc89d8c1cb346ca346081b927e4c6", 1006608},
+ {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 971293},
+ {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 920524},
+ {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 946540},
+ {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 958842},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - Spanish DOS (from the Leisure Suit Larry Collection)
+ // Executable scanning reports "1.ls5.006", VERSION file reports "1.000, 4/21/92"
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"lsl5", "", {
+ {"resource.map", 0, "b6f7da7bf24e5a6b2946032cec3ea59c", 6861},
+ {"resource.000", 0, "4c00c14b8181ad47076a51d86097d97e", 765418},
+ {"resource.001", 0, "245c44f8ccd796732e61857e67b30079", 916028},
+ {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 929645},
+ {"resource.003", 0, "74edc89d8c1cb346ca346081b927e4c6", 1005496},
+ {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1021996},
+ {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 958079},
+ {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1015136},
+ {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 987222},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 5 - Italian DOS Floppy (from glorifindel)
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"lsl5", "", {
+ {"resource.map", 0, "a99776df795127f387cb35dae872d4e4", 5919},
+ {"resource.000", 0, "a8989a5a89e7d4f702b26b378c7a357a", 7001981},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 6 - English DOS (from spookypeanut)
+ // SCI interpreter version 1.001.113
+ {{"lsl6", "", {
+ {"resource.map", 0, "bb8a39d9e2a77ba449a1e591109ad9a8", 6973},
+ {"resource.000", 0, "4462fe48c7452d98fddcec327a3e738d", 5789138},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 6 - English/German/French DOS CD - LORES
+ // SCI interpreter version 1.001.115
+ {{"lsl6", "", {
+ {"resource.map", 0, "0b91234b7112782962cb480b7791b6e2", 7263},
+ {"resource.000", 0, "57d5fe8bb9e044158514476ea7678eb0", 5754790},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 6 - German DOS CD - LORES (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 1.001.115
+ {{"lsl6", "", {
+ {"resource.map", 0, "bafe85f32738854135991d4324ad147e", 7268},
+ {"resource.000", 0, "f6cbc6da7b90ea135883e0759848ca2c", 5773160},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 6 - French DOS CD - LORES (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 1.001.115
+ {{"lsl6", "", {
+ {"resource.map", 0, "97797ea775baaf18a1907d357d3c0ea6", 7268},
+ {"resource.000", 0, "f6cbc6da7b90ea135883e0759848ca2c", 5776092},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 6 - Spanish DOS - LORES (from the Leisure Suit Larry Collection)
+ // Executable scanning reports "1.001.113", VERSION file reports "1.000, 11.06.93, FIVE PATCHES ADDED TO DISK 6 ON 11-18-93"
+ {{"lsl6", "", {
+ {"resource.map", 0, "633bf8f42170b6271019917c8009989b", 6943},
+ {"resource.000", 0, "7884a8db9253e29e6b37a2651fd90ba3", 5733116},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Leisure Suit Larry's Casino - English DOS (from the Leisure Suit Larry Collection)
+ // Executable scanning reports "1.001.029", VERSION file reports "1.000"
+ {{"lslcasino", "", {
+ {"resource.map", 0, "194f1578f2624db813c9072359ad1639", 783},
+ {"resource.001", 0, "3733433b517ec3d14a3331d9ab3842ae", 344830},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Larry 6 - English/German DOS CD - HIRES
+ // SCI interpreter version 2.100.002
+ {{"lsl6", "", {
+ {"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872},
+ {"resource.000", 0, "9a9f4870504444cda863dd14d077a680", 18520872},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 6 - German DOS CD - HIRES (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 2.100.002
+ {{"lsl6", "", {
+ {"resource.map", 0, "badfdf446ffed569a310d2c63a249421", 8896},
+ {"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18534274},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 6 - French DOS CD - HIRES (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 2.100.002
+ {{"lsl6", "", {
+ {"resource.map", 0, "d184e9aa4f2d4b5670ddb3669db82cda", 8896},
+ {"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18538987},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 7 - English DOS CD (from spookypeanut)
+ // SCI interpreter version 3.000.000
+ {{"lsl7", "", {
+ {"resmap.000", 0, "eae93e1b1d1ccc58b4691c371281c95d", 8188},
+ {"ressci.000", 0, "89353723488219e25589165d73ed663e", 66965678},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 7 - German DOS (from Tobis87)
+ // SCI interpreter version 3.000.000
+ {{"lsl7", "", {
+ {"resmap.000", 0, "c11e6bfcfc2f2d05da47e5a7df3e9b1a", 8188},
+ {"ressci.000", 0, "a8c6817bb94f332ff498a71c8b47f893", 66971724},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 7 - French DOS (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 3.000.000
+ {{"lsl7", "", {
+ {"resmap.000", 0, "4407849fd52fe3efb0c30fba60cd5cd4", 8206},
+ {"ressci.000", 0, "dc37c3055fffbefb494ff22b145d377b", 66964472},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 7 - Italian DOS CD (from glorifindel)
+ // SCI interpreter version 3.000.000
+ {{"lsl7", "", {
+ {"resmap.000", 0, "9852a97141f789413f29bf956052acdb", 8212},
+ {"ressci.000", 0, "440b9fed89590abb4e4386ed6f948ee2", 67140181},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Larry 7 - Spanish DOS (from the Leisure Suit Larry Collection)
+ // Executable scanning reports "3.000.000", VERSION file reports "1.0s"
+ {{"lsl7", "", {
+ {"resmap.000", 0, "8f3d603e1acc834a5d598b30cdfc93f3", 8188},
+ {"ressci.000", 0, "32792f9bc1bf3633a88b382bb3f6e40d", 67071418},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 2.100.002
+ {{"lsl7", "Demo", {
+ {"ressci.000", 0, "5cc6159688b2dc03790a67c90ccc67f9", 10195878},
+ {"resmap.000", 0, "6a2b2811eef82e87cde91cf1de845af8", 2695},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Lighthouse - English Windows Demo (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.00"
+ {{"lighthouse", "Demo", {
+ {"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64},
+ {"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Lighthouse - English Windows Demo
+ // Executable scanning reports "3.000.000", VERSION file reports "1.00"
+ {{"lighthouse", "Demo", {
+ {"resmap.000", 0, "3bdee7a16926975a4729f75cf6b80a92", 1525},
+ {"ressci.000", 0, "3c585827fa4a82f4c04a56a0bc52ccee", 11494351},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Lighthouse - English DOS (from jvprat)
+ // Executable scanning reports "3.000.000", VERSION file reports "1.1"
+ {{"lighthouse", "", {
+ {"resmap.001", 0, "47abc502c0b541b582db28f38dbc6a56", 7801},
+ {"ressci.001", 0, "14e922c47b92156377cb49e241691792", 99591924},
+ {"resmap.002", 0, "c68db5333f152fea6ca2dfc75cad8b34", 7573},
+ {"ressci.002", 0, "175468431a979b9f317c294ce3bc1430", 94628315},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Lighthouse - Spanish DOS (from jvprat)
+ // Executable scanning reports "3.000.000", VERSION file reports "1.1"
+ {{"lighthouse", "", {
+ {"resmap.001", 0, "c5d49b2a8a4eafc92fd041a3a0f2da68", 7846},
+ {"ressci.001", 0, "18553177dbf83fb2cb6c8edcbb174183", 99543093},
+ {"resmap.002", 0, "e7dc85884a2417e2eff9de0c63dd65fa", 7630},
+ {"ressci.002", 0, "3c8d627c555b0e3e4f1d9955bc0f0df4", 94631127},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Mixed-Up Fairy Tales v1.000 - English DOS Non-Interactive Demo
+ {{"fairytales", "Demo", {
+ {"resource.map", 0, "c2cf672c3f4251e7472d4542af3bf764", 933},
+ {"resource.000", 0, "8be56a3a88c065ee00c02c0e29199f3a", 14643},
+ {"resource.001", 0, "9e33566515b18bee7915db448063bba2", 871853},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Mixed-Up Fairy Tales v1.000 - English DOS (supplied by markcoolio in bug report #2723791)
+ // Executable scanning reports "1.000.145"
+ {{"fairytales", "", {
+ {"resource.map", 0, "9ae5aecc1cb797b11ea5cf0caeea272c", 3261},
+ {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 923685},
+ {"resource.001", 0, "49c8f7dcd9989e4491a93554bec325b0", 52324},
+ {"resource.002", 0, "6767f8c8585f617aaa91d442f41ae714", 1032989},
+ {"resource.003", 0, "b1288e0821ee358d1ffe877e5900c8ec", 1047565},
+ {"resource.004", 0, "f79daa70390d73746742ffcfc3dc4471", 937580},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Mixed-Up Fairy Tales - English DOS Floppy (from jvprat)
+ // Executable scanning reports "1.000.145", Floppy label reports "1.0, 11.13.91", VERSION file reports "1.000"
+ {{"fairytales", "", {
+ {"resource.map", 0, "66105c02fa8f1785a3fd28957e41cb48", 3249},
+ {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 984439},
+ {"resource.001", 0, "49c8f7dcd9989e4491a93554bec325b0", 238019},
+ {"resource.002", 0, "564f516d991032e781492592a4eaa275", 1414142},
+ {"resource.003", 0, "dd6cef0c592eadb7e6be9a25307c57a2", 1344719},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Mixed-Up Mother Goose - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.003.009"
+ // SCI interpreter version 0.001.010
+ {{"mothergoose", "", {
+ {"resource.map", 0, "4aa28ac93fae03cf854594da13d9229c", 2700},
+ {"resource.001", 0, "fb552ae550ca1dac19ed8f6a3767612d", 262885},
+ {"resource.002", 0, "fb552ae550ca1dac19ed8f6a3767612d", 817191},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Mixed-Up Mother Goose v2.000 - English DOS Floppy (supplied by markcoolio in bug report #2723795)
+ // Executable scanning reports "1.001.031"
+ {{"mothergoose", "", {
+ {"resource.map", 0, "52aae15e493cafd1da7e1c9b657a5bb9", 7026},
+ {"resource.000", 0, "b7ecd8ae9e254e80310b5a668b276e6e", 2948975},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Mixed-Up Mother Goose - English DOS CD (from jvprat)
+ // Executable scanning reports "x.yyy.zzz"
+ // SCI interpreter version 0.000.999 (just a guess)
+ {{"mothergoose", "CD", {
+ {"resource.map", 0, "1c7f311b0a2c927b2fbe81ae341fb2f6", 5790},
+ {"resource.001", 0, "5a0ed1d745855148364de1b3be099bac", 4369438},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Mixed-Up Mother Goose - English Windows Interactive Demo
+ // Executable scanning reports "x.yyy.zzz"
+ {{"mothergoose", "Demo", {
+ {"resource.map", 0, "87f9dc1cafc4d4fa835fb2f00cf3a6ef", 4560},
+ {"resource.001", 0, "5a0ed1d745855148364de1b3be099bac", 2070072},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
+ // Executable scanning reports "2.100.002"
+ {{"mothergoose", "", {
+ {"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741},
+ {"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Ms. Astro Chicken - English DOS
+ // SCI interpreter version 1.000.679
+ {{"msastrochicken", "", {
+ {"resource.map", 0, "5b457cbe5042f557e5b610148171f6c0", 1158},
+ {"resource.001", 0, "453ea81ef66a50cbe33ce06302afe47f", 229737},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Phantasmagoria - English DOS (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.100.000UK"
+ {{"phantasmagoria", "", {
+ {"resmap.001", 0, "416138651ea828219ca454cae18341a3", 11518},
+ {"ressci.001", 0, "3aae6559aa1df273bc542d5ac6330d75", 65844612},
+ {"resmap.002", 0, "de521d0c7ab32897e7fe58e421c816b7", 12058},
+ {"ressci.002", 0, "3aae6559aa1df273bc542d5ac6330d75", 71588691},
+ {"resmap.003", 0, "25df95bd7da3686f71a0af8784a2b8ca", 12334},
+ {"ressci.003", 0, "3aae6559aa1df273bc542d5ac6330d75", 73651084},
+ {"resmap.004", 0, "e108a3d35794f1721aeea3e62a3f8b3b", 12556},
+ {"ressci.004", 0, "3aae6559aa1df273bc542d5ac6330d75", 75811935},
+ {"resmap.005", 0, "390d81f9e14a3f3ee2ea477135f0288e", 12604},
+ {"ressci.005", 0, "3aae6559aa1df273bc542d5ac6330d75", 78814934},
+ {"resmap.006", 0, "8ea3c954606e80604680f9fe707f15d8", 12532},
+ {"ressci.006", 0, "3aae6559aa1df273bc542d5ac6330d75", 77901360},
+ {"resmap.007", 0, "afbd16ea77869a720afa1c5371de107d", 7972},
+ //{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Phantasmagoria 2 - English Windows (from jvprat)
+ // Executable scanning reports "3.000.000", VERSION file reports "001.0.06"
+ {{"phantasmagoria2", "", {
+ {"resmap.001", 0, "0a961e135f4f7effb195158325856633", 1108},
+ {"ressci.001", 0, "53f457cddb0dffc056593905c4cbb989", 24379964},
+ {"resmap.002", 0, "5d3189fe3d4f286f83c5c8031fa3e9f7", 1126},
+ {"ressci.002", 0, "53f457cddb0dffc056593905c4cbb989", 34465805},
+ {"resmap.003", 0, "c92e3c840b827c236ab6671c03760c56", 1162},
+ {"ressci.003", 0, "53f457cddb0dffc056593905c4cbb989", 38606375},
+ {"resmap.004", 0, "8d5cfe19365f71370b87063686f39171", 1288},
+ {"ressci.004", 0, "53f457cddb0dffc056593905c4cbb989", 42447131},
+ {"resmap.005", 0, "8bd5ceeedcbe16dfe55d1b90dcd4be84", 1942},
+ {"ressci.005", 0, "05f9fe2bee749659acb3cd2c90252fc5", 67905112},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Pepper's Adventure In Time 1.000 English
+ // Executable scanning reports "1.001.072", VERSION file reports "1.000"
+ {{"pepper", "", {
+ {"resource.map", 0, "72726dc81c1b4c1110c486be77369bc8", 5179},
+ {"resource.000", 0, "670d0c53622429f4b11275caf7f8d292", 5459574},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Pepper - English DOS Non-Interactive Demo
+ // Executable scanning reports "1.001.060", VERSION file reports "1.000"
+ {{"pepper", "Demo", {
+ {"resource.map", 0, "379bb4fb896630b14f2d91ed21e36ba1", 984},
+ {"resource.000", 0, "118f6c31a93ec7fd9a231c61125229e3", 645494},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Pepper - English DOS/Windows Interactive Demo
+ // Executable scanning reports "1.001.069", VERSION file reports ".001"
+ {{"pepper", "Demo", {
+ {"resource.map", 0, "975e8df76106a5c13d12ab674f906a02", 2514},
+ {"resource.000", 0, "e6a918a2dd7a4bcecd8fb389f43287c2", 1698164},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Pepper - English DOS Interactive Demo
+ // Executable scanning reports "1.001.072", VERSION file reports "1.000"
+ {{"pepper", "Demo", {
+ {"resource.map", 0, "9c9b7b900651a370dd3fb38d478b1798", 2524},
+ {"resource.000", 0, "e6a918a2dd7a4bcecd8fb389f43287c2", 1713544},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 1 VGA Remake - English DOS (from the Police Quest Collection)
+ // Executable scanning reports "1.001.029", VERSION file reports "2.000"
+ {{"pq1sci", "VGA Remake", {
+ {"resource.map", 0, "35efa814fb994b1cbdac9611e401da67", 5013},
+ {"resource.000", 0, "e0d5ddf34eda903a38f0837e2aa7145b", 6401433},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 2 - English Amiga (from www.back2roots.org)
+ // SCI interpreter version 0.000.685 (just a guess)
+ {{"pq2", "", {
+ {"resource.map", 0, "499de78ae72b7ce219f944c5e7ef0c5b", 3426},
+ {"resource.000", 0, "77f02def3094af804fd2371db25b7100", 250232},
+ {"resource.001", 0, "523db0c07f1da2a822c2c39ee0482544", 179334},
+ {"resource.002", 0, "499737c21a28ac026e11ab817100d610", 511099},
+ {"resource.003", 0, "e008f5d6e2a7c4d4a0da0173e4fa8f8b", 553970},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 2 - English DOS Non-Interactive Demo
+ // Executable scanning reports "0.000.413"
+ {{"pq2", "Demo", {
+ {"resource.map", 0, "8b77d0d4650c2052b356cece28294b58", 576},
+ {"resource.001", 0, "376ef6d6eaaeed66e1424bd219c4b9ab", 215398},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Police Quest 2 - English DOS (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 0.000.395
+ {{"pq2", "", {
+ {"resource.map", 0, "9cff78c4be9e6a4848b6e9377569e3d9", 5700},
+ {"resource.001", 0, "77f02def3094af804fd2371db25b7100", 163291},
+ {"resource.002", 0, "77f02def3094af804fd2371db25b7100", 329367},
+ {"resource.003", 0, "77f02def3094af804fd2371db25b7100", 305819},
+ {"resource.004", 0, "77f02def3094af804fd2371db25b7100", 342149},
+ {"resource.005", 0, "77f02def3094af804fd2371db25b7100", 349899},
+ {"resource.006", 0, "77f02def3094af804fd2371db25b7100", 354991},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Police Quest 2 - English DOS (from the Police Quest Collection)
+ // Executable scanning reports "0.000.490"
+ {{"pq2", "", {
+ {"resource.map", 0, "28a6f471c7900c2c92da40eecb615d9d", 4584},
+ {"resource.001", 0, "77f02def3094af804fd2371db25b7100", 509525},
+ {"resource.002", 0, "77f02def3094af804fd2371db25b7100", 546000},
+ {"resource.003", 0, "77f02def3094af804fd2371db25b7100", 591851},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Police Quest 2 - English DOS (from FRG)
+ // SCI interpreter version 0.000.395
+ {{"pq2", "", {
+ {"resource.map", 0, "fe019e9773623fcb7da810db9e64c8a9", 4548},
+ {"resource.001", 0, "77f02def3094af804fd2371db25b7100", 509760},
+ {"resource.002", 0, "77f02def3094af804fd2371db25b7100", 542897},
+ {"resource.003", 0, "77f02def3094af804fd2371db25b7100", 586857},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Police Quest 3 - English Amiga
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.784
+ {{"pq3", "", {
+ {"resource.map", 0, "29923fe1ef1f0909b57255d61c558e68", 5742},
+ {"resource.000", 0, "4908e4f4977e8e19c90c29b36a741ffe", 298541},
+ {"resource.001", 0, "0eb943ca807e2f69578821d490770d2c", 836567},
+ {"resource.002", 0, "f7044bb08a1fcbe5077791ed8d4996f0", 691207},
+ {"resource.003", 0, "630bfa65beb05f743552704ac2899dae", 759891},
+ {"resource.004", 0, "7b229fbdf30d670d0728cede3e984a7e", 838663},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 3 - German Amiga
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.784
+ {{"pq3", "", {
+ {"resource.map", 0, "357304811fc2bbaa3443fc62d677fe06", 6282},
+ {"resource.000", 0, "49879e6ce7c19151ffa6af1a09763dc7", 324273},
+ {"resource.001", 0, "015e6119badb391ab5f4b36abedb5d4a", 718814},
+ {"resource.002", 0, "1ee419ba252fbed47fbce8399f56f8ad", 674823},
+ {"resource.003", 0, "87361c17fd863b58f98828de68770279", 682288},
+ {"resource.004", 0, "6258d5dd85898d8e218eb8113ebc9059", 722738},
+ {"resource.005", 0, "6258d5dd85898d8e218eb8113ebc9059", 704485},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 3 - English DOS (from the Police Quest Collection)
+ // Executable scanning reports "T.A00.178", VERSION file reports "1.00"
+ // SCI interpreter version 1.000.510
+ {{"pq3", "", {
+ {"resource.map", 0, "6457bf0c8ca865a42d9ff5827ab49b89", 5559},
+ {"resource.000", 0, "7659713720d61d9465a59091b7ee63ea", 737253},
+ {"resource.001", 0, "61c7c187d25a8346be0a092d5f037278", 1196787},
+ {"resource.002", 0, "c18e0d408e4f4f40365d42aa15931f67", 1153561},
+ {"resource.003", 0, "8791b9eef53edf77c2dac950142221d3", 1159791},
+ {"resource.004", 0, "1b91e891a3c60a941dac0eecdf83375b", 1143606},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 3 - English DOS Non-Interactive Demo
+ // Executable scanning reports "T.A00.052"
+ // SCI interpreter version 1.000.510
+ {{"pq3", "Demo", {
+ {"resource.map", 0, "ec8e58e7663ae5173853abf6c76b52bb", 867},
+ {"resource.000", 0, "277f97771f7a6d89677141f02da313d6", 65150},
+ {"resource.001", 0, "5c5a551b6c86cce2ee75becb90e0b586", 624411},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 3 - German DOS (supplied by markcoolio in bug report #2723837)
+ // Executable scanning reports "T.A00.178"
+ // SCI interpreter version 1.000.510
+ {{"pq3", "", {
+ {"resource.map", 0, "8a970edf98eba4c11bb1827aab1694d1", 5625},
+ {"resource.000", 0, "5ee460af3d70c06a745cc482b6c783ba", 865204},
+ {"resource.001", 0, "ff6182bf96c8f8af5bd8c11769c9cbf2", 1183456},
+ {"resource.002", 0, "cce99b96a578b62ff6cebdae8d122feb", 1179358},
+ {"resource.003", 0, "4836f460f4cfc8de61e2df4c45775504", 1180956},
+ {"resource.004", 0, "0c3eb84b9755852d9e795e0d5c9373c7", 1171760},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 4 - English DOS Non-Interactive Demo (from FRG)
+ // SCI interpreter version 1.001.096
+ {{"pq4", "Demo", {
+ {"resource.map", 0, "be56f87a1c4a13062a30a362df860c2f", 1472},
+ {"resource.000", 0, "527d5684016e6816157cd15d9071b11b", 1121310},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Police Quest 4 - English DOS (from the Police Quest Collection)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.100.000"
+ {{"pq4", "", {
+ {"resource.map", 0, "379dfe80ed6bd16c47e4b950c4722eac", 11374},
+ {"resource.000", 0, "fd316a09b628b7032248139003369022", 18841068},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 4 - English DOS
+ // SCI interpreter version 2.000.000 (a guess?)
+ {{"pq4", "", {
+ {"resource.map", 0, "aed9643158ccf01b71f359db33137f82", 9895},
+ {"resource.000", 0, "da383857b3be1e4514daeba2524359e0", 15141432},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest 4 - German DOS (supplied by markcoolio in bug report #2723840)
+ // SCI interpreter version 2.000.000 (a guess?)
+ {{"pq4", "", {
+ {"resource.map", 0, "2393ee728ab930b2762cb5889f9b5aff", 9256},
+ {"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730155},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest: SWAT - English DOS/Windows Demo (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "0.001.200"
+ {{"pqswat", "Demo", {
+ {"resource.map", 0, "8c96733ef94c21526792f7ca4e3f2120", 1648},
+ {"resource.000", 0, "d8892f1b8c56c8f7704325460f49b300", 3676175},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Police Quest: SWAT - English Windows (from the Police Quest Collection)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.0c"
+ {{"pqswat", "", {
+ {"resmap.001", 0, "de5ea1beb3d9490737aa5fd398fe9765", 6937},
+ {"ressci.001", 0, "7cd5414f54748f90904a46123a52472f", 29467363},
+ {"resmap.002", 0, "ff7a7e0f3dea2c73182b7ea84e3431cc", 6211},
+ {"ressci.002", 0, "e613357f3349c4bfa5a7b7b312be7f97", 25987989},
+ {"resmap.003", 0, "84303aa019fa75a0eb20ba502bc4ccae", 6601},
+ {"ressci.003", 0, "00a755e917c442ca8cf1a1bea689e6fb", 45073980},
+ {"resmap.004", 0, "4228038906f041623e65789500b22285", 6835},
+ {"ressci.004", 0, "b7e619e6ecf62fe65d5116a3a422e5f0", 46223872},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by merkur in bug report #2718784)
+ // Executable scanning reports "0.000.566"
+ {{"qfg1", "", {
+ {"resource.map", 0, "c1dc4470fb947c067567252f62d6c1b6", 6474},
+ {"resource.000", 0, "481b034132106390cb5160fe61dd5f58", 80334},
+ {"resource.001", 0, "4d67acf52833ff45c7f753d6663532e8", 462727},
+ {"resource.002", 0, "439ba9b6dde216e6eb97ef3a9830fbe4", 646869},
+ {"resource.003", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 642203},
+ {"resource.004", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 641688},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Quest for Glory 1 / Hero's Quest - English DOS 5.25" Floppy (supplied by markcoolio in bug report #2723843)
+ // Executable scanning reports "0.000.566"
+ {{"qfg1", "", {
+ {"resource.map", 0, "94bc3f2ae2dad12f1303606740d087ff", 6936},
+ {"resource.000", 0, "481b034132106390cb5160fe61dd5f58", 80334},
+ {"resource.001", 0, "4d67acf52833ff45c7f753d6663532e8", 95498},
+ {"resource.002", 0, "3e2a89d60d385caca5b3394049da4bc4", 271587},
+ {"resource.003", 0, "e56e9fd2f7d2c98774699f7a5087e524", 255998},
+ {"resource.004", 0, "d74cd4290bf60e1409117202e4ce8592", 266415},
+ {"resource.005", 0, "7288ed6d5da89b7a80b4af3897a7963a", 271185},
+ {"resource.006", 0, "69366c2a2f99917199fe1b60a4fee19d", 267852},
+ {"resource.007", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 272747},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Quest for Glory 1 - Japanese PC-98 5.25" Floppy
+ // Executable scanning reports "S.old.201"
+ {{"qfg1", "8 Colors", {
+ {"resource.map", 0, "5cbeb95dd2a4b7cb242b415cc6ec1c47", 6444},
+ {"resource.001", 0, "a21451ef6fa8179bd4b22c4950004c44", 859959},
+ {"resource.002", 0, "a21451ef6fa8179bd4b22c4950004c44", 1136968},
+ {"resource.003", 0, "a21451ef6fa8179bd4b22c4950004c44", 769897},
+ {NULL, 0, NULL, 0}}, Common::JA_JPN, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 1 - Japanese PC-98 5.25" Floppy
+ // Executable scanning reports "S.old.201"
+ {{"qfg1", "16 Colors", {
+ {"resource.map", 0, "3ecaba33bf77cb434067a0b8aee15097", 6444},
+ {"resource.001", 0, "a21451ef6fa8179bd4b22c4950004c44", 864754},
+ {"resource.002", 0, "a21451ef6fa8179bd4b22c4950004c44", 1147121},
+ {"resource.003", 0, "a21451ef6fa8179bd4b22c4950004c44", 777575},
+ {NULL, 0, NULL, 0}}, Common::JA_JPN, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 1 - English Amiga
+ // Executable scanning reports "1.002.020"
+ // SCI interpreter version 0.000.685
+ {{"qfg1", "", {
+ {"resource.map", 0, "e65034832f0c9df1dc22128227b782d0", 6066},
+ {"resource.000", 0, "1c0255dea2d3cd71eee9f2db201eee3f", 111987},
+ {"resource.001", 0, "a270012fa74445d74c044d1b65a9ff8c", 143570},
+ {"resource.002", 0, "e64004e020fdf1813be52b639b08be89", 553201},
+ {"resource.003", 0, "16cd4414c37ae3bb6d6da33dce8e25e8", 654096},
+ {"resource.004", 0, "16cd4414c37ae3bb6d6da33dce8e25e8", 689124},
+ {"resource.005", 0, "5f3386ef2f2b1254e4a066f5d9027324", 609529},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 1 - English DOS
+ // SCI interpreter version 0.000.629
+ {{"qfg1", "", {
+ {"resource.map", 0, "74a108a7fb345bfc84f4113b6e5241bb", 6432},
+ {"resource.000", 0, "40332d3ebfc70a4b6a6a0443c2763287", 79181},
+ {"resource.001", 0, "917fcef303e9489597154727baaa9e07", 461422},
+ {"resource.002", 0, "05ddce5f437a516b89ede2438fac09d8", 635734},
+ {"resource.003", 0, "951299a82a8134ed12c5c18118d45c2f", 640483},
+ {"resource.004", 0, "951299a82a8134ed12c5c18118d45c2f", 644443},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 1 VGA Remake - English DOS
+ // Executable scanning reports "2.000.411"
+ {{"qfg1", "VGA Remake", {
+ {"resource.map", 0, "a731fb6c9c0b282443f7027bc8694d4c", 8469},
+ {"resource.000", 0, "ecace1a2771846b1a8aa1afdd44111a0", 6570147},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 1 VGA Remake - English DOS Non-Interactive Demo (from FRG)
+ // SCI interpreter version 1.001.029
+ {{"qfg1", "VGA Remake Demo", {
+ {"resource.map", 0, "ac0257051c95a59c0cdc0be24d9b11fa", 729},
+ {"resource.000", 0, "ec6f5cf369054dd3e5392995e9975b9e", 768218},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 2 - English Amiga
+ // Executable scanning reports "1.003.004"
+ // SCI interpreter version 0.001.010
+ {{"qfg2", "", {
+ {"resource.map", 0, "365ea1033ba26d227ec4007be88c59cc", 7596},
+ {"resource.000", 0, "810245be50fde5a67e3ea95e876e3e64", 233341},
+ {"resource.001", 0, "7a5fde9875211ed67a896fc0d91940c8", 127294},
+ {"resource.002", 0, "dcf6bc2c18660d7ad532fb61861eb721", 543644},
+ {"resource.003", 0, "dcf6bc2c18660d7ad532fb61861eb721", 565044},
+ {"resource.004", 0, "dcf6bc2c18660d7ad532fb61861eb721", 466630},
+ {"resource.005", 0, "a77d2576c842b2b06da57d4ac8fc51c0", 579975},
+ {"resource.006", 0, "ccf5dba33e5cab6d5872838c0f8db44c", 500039},
+ {"resource.007", 0, "4c9fc1587545879295cb9627f56a2cb8", 575056},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 2 - English (from FRG)
+ // Executable scanning reports "1.000.072"
+ {{"qfg2", "", {
+ {"resource.map", 0, "bc79c5685c00edab3ad6df18691703bc", 6906},
+ {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212119},
+ {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 867866},
+ {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 790750},
+ {"resource.003", 0, "b192607c42f6960ecdf2ad2e4f90e9bc", 972804},
+ {"resource.004", 0, "cd2de58e27665d5853530de93fae7cd6", 983617},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 2 - English DOS
+ // Executable scanning reports "1.000.072"
+ {{"qfg2", "", {
+ {"resource.map", 0, "be23af27e9557bf232efe213ac7f277c", 8166},
+ {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212120},
+ {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 331973},
+ {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 467505},
+ {"resource.003", 0, "df137dc7869cab07e1149ba2333c815c", 502560},
+ {"resource.004", 0, "df137dc7869cab07e1149ba2333c815c", 488541},
+ {"resource.005", 0, "df137dc7869cab07e1149ba2333c815c", 478688},
+ {"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
+ {"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 2 - English DOS Non-Interactive Demo
+ // Executable scanning reports "1.000.046"
+ {{"qfg2", "Demo", {
+ {"resource.map", 0, "e75eb86bdd517b3ef709058249986a87", 906},
+ {"resource.001", 0, "9b098f9e1008abe30e56c93b896494e6", 362123},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 3 - English DOS Non-Interactive Demo (from FRG)
+ // Executable scanning reports "1.001.021", VERSION file reports "1.000, 0.001.059, 6.12.92"
+ {{"qfg3", "Demo", {
+ {"resource.map", 0, "fd71de9b588a45f085317caacf050e91", 687},
+ {"resource.000", 0, "b6c69bf6c18bf177492249fe81fc6a6d", 648702},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 3 - English DOS
+ // SCI interpreter version 1.001.050
+ {{"qfg3", "", {
+ {"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
+ {"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868000},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 3 - German DOS (supplied by markcoolio in bug report #2723846)
+ // Executable scanning reports "L.rry.083"
+ {{"qfg3", "", {
+ {"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
+ {"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868042},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 3 - Spanish DOS CD (from jvprat)
+ // Executable scanning reports "L.rry.083", VERSION file reports "1.000.000, June 30, 1994"
+ {{"qfg3", "", {
+ {"resource.map", 0, "10809197c33a5e62819311d8a2f73f85", 5978},
+ {"resource.000", 0, "ba7ac86155e4c531e46cd73c86daa80a", 5884098},
+ {"resource.msg", 0, "a63974730d294dec0bea10057c36e506", 256014},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Quest for Glory 4 - English DOS Non-Interactive Demo (from FRG)
+ // SCI interpreter version 1.001.069 (just a guess)
+ {{"qfg4", "Demo", {
+ {"resource.map", 0, "1ba7c7ae1efb315326d45cb931569b1b", 922},
+ {"resource.000", 0, "41ba03f0b188b029132daa3ece0d3e14", 623154},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Quest for Glory 4 1.1 Floppy - English DOS (supplied by markcool in bug report #2723852)
+ // SCI interpreter version 2.000.000 (a guess?)
+ {{"qfg4", "", {
+ {"resource.map", 0, "685bdb1ed47bbbb0e5e25db392da83ce", 9301},
+ {"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11004993},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 4 1.1 Floppy - German DOS (supplied by markcool in bug report #2723850)
+ // SCI interpreter version 2.000.000 (a guess?)
+ {{"qfg4", "", {
+ {"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301},
+ {"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Quest for Glory 4 - English DOS/Windows (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.0"
+ {{"qfg4", "", {
+ {"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246},
+ {"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+#if 0
+ // NOTE: This version looks to be exactly the same as the English one
+ // Perhaps it's the English one?
+
+ // Quest for Glory 4 - German DOS/Windows (from PCJoker 2/98)
+ {{"qfg4", "", {
+ {"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246},
+ {"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif
+
+ // Quest for Glory 4 - German DOS/Windows Disk V1.1 (from PCJoker 2/89)
+ // SCI interpreter version 2.000.000 (a guess?)
+ {{"qfg4", "", {
+ {"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301},
+ {"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif
+
+ // Slater & Charlie go camping
+ {{"slater", "", {
+ {"resource.000", 0, "1846b57fe84774be72f7c50ab3c90df0", 2256126},
+ {"resource.map", 0, "21f85414124dc23e54544a5536dc35cd", 4044},
+ {"resource.msg", 0, "c44f51fb955eae266fecf360ebcd5ad2", 1132},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // RAMA - English DOS/Windows Demo
+ // Executable scanning reports "2.100.002", VERSION file reports "000.000.008"
+ {{"rama", "Demo", {
+ {"resmap.001", 0, "775304e9b2a545156be4d94209550094", 1393},
+ {"ressci.001", 0, "259437fd75fdf51e8207fda8c01fa4fd", 2334384},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // RAMA - English Windows (from jvprat)
+ // Executable scanning reports "3.000.000", VERSION file reports "1.100.000"
+ {{"rama", "", {
+ {"resmap.001", 0, "3bac72a1910a563f8f92cf5b77c8b7f2", 8338},
+ {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70588050},
+ {"resmap.002", 0, "83c2aa4653a985ab4b49ff60532ed08f", 12082},
+ {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128562138},
+ {"resmap.003", 0, "31ef4c0621711585d031f0ae81707251", 1636},
+ {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6860492},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // RAMA - Italian Windows CD (from glorifindel)
+ // SCI interpreter version 3.000.000 (a guess?)
+ {{"rama", "", {
+ {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70611091},
+ {"resmap.001", 0, "70ba2ff04a2b7fb2c52420ba7fbd47c2", 8338},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE},
+ 0
+ },
+
+ // Shivers - English Windows (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.02"
+ {{"shivers", "", {
+ {"resmap.000", 0, "f2ead37749ed8f6535a2445a7d05a0cc", 46525},
+ {"ressci.000", 0, "4294c6d7510935f2e0a52e302073c951", 262654836},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Shivers - German Windows (from Tobis87)
+ {{"shivers", "", {
+ {"resmap.000", 0, "f483d0a1f78334c18052e92785c3086e", 46537},
+ {"ressci.000", 0, "6751b144671e2deed919eb9d284b07eb", 262390692},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Shivers - English Windows Demo
+ // Executable scanning reports "2.100.002"
+ {{"shivers", "Demo", {
+ {"resmap.000", 0, "d9e0bc5eddefcbe47f528760085d8927", 1186},
+ {"ressci.000", 0, "3a93c6340b54e07e65d0e5583354d186", 10505469},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Shivers2 - English Windows Demo
+ // Executable scanning reports "3.000.000"
+ {{"shivers2", "Demo", {
+ {"resmap.000", 0, "d8659188b84beaef076bd869837cd530", 634},
+ {"ressci.000", 0, "7fbac0807a044c9543e8ac376d200e59", 4925003},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // Slater & Charlie Go Camping - English DOS Demo
+ // Executable scanning reports "1.cfs.081", VERSION file reports "1.000"
+ {{"slater", "Demo", {
+ {"resource.map", 0, "61b4f74039399e5aa1e737b16d0fc023", 1409},
+ {"resource.msg", 0, "1aeafe2b495de288d002109650b66614", 1364},
+ {"resource.000", 0, "8e10d4f05c1fd9f883384fa38a898489", 377394},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 1 VGA Remake - English Amiga (from www.back2roots.org)
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"sq1sci", "VGA Remake", {
+ {"resource.map", 0, "106484b372af1d4cbf866472cc2813dc", 6396},
+ {"resource.000", 0, "cc9d6ace343661ae51ec8bd6e6b00a8c", 340944},
+ {"resource.001", 0, "59efcfa2268d2f8608f544e2674d8151", 761721},
+ {"resource.002", 0, "f00ef883128bf5fc2fbb888cdd7adf25", 814461},
+ {"resource.003", 0, "2588c1c2ca8b9bed0e3411948c0856a9", 839302},
+ {"resource.004", 0, "b25a1539c71701f7715f738c5037e9a6", 775515},
+ {"resource.005", 0, "640ffe1a9acde392cc33cc1b1a528328", 806324},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 1 VGA Remake - English DOS (from the Space Quest Collection)
+ // Executable scanning reports "T.A00.081", VERSION file reports "2.000"
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"sq1sci", "VGA Remake", {
+ {"resource.map", 0, "38a74d8f555a2da9ca4f21d14e3c1d33", 5913},
+ {"resource.000", 0, "e9d866534f8c84de82e25f2631ff258c", 1016436},
+ {"resource.001", 0, "a89b7b52064c75b1985b289edc2f5c69", 1038757},
+ {"resource.002", 0, "a9e847c687529481f3a22b9bf01f45f7", 1169831},
+ {"resource.003", 0, "c47600e50c6fc591957ae0c5020ee7b8", 1213262},
+ {"resource.004", 0, "e19ea4ad131472f9238590f2e1d40289", 1203051},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 1 VGA Remake - English Non-Interactive Demo (from FRG)
+ // SCI interpreter version 1.000.181
+ {{"sq1sci", "VGA Remake Demo", {
+ {"resource.map", 0, "5af709ac5e0e923e0b8174f49978c30e", 636},
+ {"resource.001", 0, "fd99ea43f57576ded7c86036996346cf", 507642},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 1 VGA Remake - Spanish DOS Floppy (from jvprat)
+ // Executable scanning reports "T.A00.081", VERSION file reports "2.000"
+ // SCI interpreter version 1.000.510 (just a guess)
+ {{"sq1sci", "VGA Remake", {
+ {"resource.map", 0, "cee2a67fa7f8f1f520f398110ca1c37e", 6111},
+ {"resource.000", 0, "945081a73211e0c40e62f709edcd8d1d", 970657},
+ {"resource.001", 0, "94692dc84c85c93bb8850f58aebf3cfc", 1085687},
+ {"resource.002", 0, "fc9ad3357e4cedec1611ad2b67b193a9", 1175465},
+ {"resource.003", 0, "8c22700a02991b763f512f837636b3ca", 1211307},
+ {"resource.004", 0, "9b78228ad4f9f335fedf74f1812dcfca", 513325},
+ {"resource.005", 0, "7d4ebcb745c0bf8fc42e4013f52ecd49", 1101812},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 3 - English Amiga (from www.back2roots.org)
+ // SCI interpreter version 0.000.453 (just a guess)
+ {{"sq3", "", {
+ {"resource.map", 0, "bad41385acde6d677a8d55a7b20437e3", 5868},
+ {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 171636},
+ {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 754432},
+ {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 746496},
+ {"resource.004", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 761984},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Space Quest 3 - German Amiga
+ // Executable scanning reports "1.004.006"
+ // SCI interpreter version 0.000.453 (just a guess)
+ {{"sq3", "", {
+ {"resource.map", 0, "44f53185fdf3f44f946e9cac3ca6588b", 6348},
+ {"resource.001", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 238664},
+ {"resource.002", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 642014},
+ {"resource.003", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 712374},
+ {"resource.004", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 545053},
+ {"resource.005", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 687507},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 3 - English DOS Non-Interactive Demo
+ // SCI interpreter version 0.000.453
+ {{"sq3", "Demo", {
+ {"resource.map", 0, "ec66ac2b1ce58b2575ba00b65058de1a", 612},
+ {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 180245},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Space Quest 3 - English DOS (provided by richiefs in bug report #2670691)
+ // SCI interpreter version 0.000.453
+ {{"sq3", "", {
+ {"resource.map", 0, "fee82d211c3918a90ce3b476d3dbb245", 5484},
+ {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 485158},
+ {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720244},
+ {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688367},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Space Quest 3 - English DOS (from the Space Quest Collection)
+ // Executable scanning reports "0.000.685", VERSION file reports "1.018"
+ {{"sq3", "", {
+ {"resource.map", 0, "55e91aeef1705bce2a9b79172682f36d", 5730},
+ {"resource.001", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 490247},
+ {"resource.002", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 715777},
+ {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 3 - German DOS (from Tobis87)
+ // SCI interpreter version 0.000.453 (?)
+ {{"sq3", "", {
+ {"resource.map", 0, "4965c78b5eff50d5e4148ce114594ba8", 7584},
+ {"resource.001", 0, "9107c2aa5398e28b5c5406df13491f85", 117869},
+ {"resource.002", 0, "9107c2aa5398e28b5c5406df13491f85", 336101},
+ {"resource.003", 0, "9107c2aa5398e28b5c5406df13491f85", 350391},
+ {"resource.004", 0, "9107c2aa5398e28b5c5406df13491f85", 349750},
+ {"resource.005", 0, "9107c2aa5398e28b5c5406df13491f85", 322107},
+ {"resource.006", 0, "9107c2aa5398e28b5c5406df13491f85", 320643},
+ {"resource.007", 0, "9107c2aa5398e28b5c5406df13491f85", 344287},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ GF_FOR_SCI0_BEFORE_629
+ },
+
+ // Space Quest 3 v1.052 - German DOS (supplied by markcoolio in bug report #2723860)
+ // Executable scanning reports "S.old.114"
+ {{"sq3", "", {
+ {"resource.map", 0, "f0dd735098c254f584878649c6f08dbc", 5154},
+ {"resource.001", 0, "9107c2aa5398e28b5c5406df13491f85", 567245},
+ {"resource.002", 0, "9107c2aa5398e28b5c5406df13491f85", 596768},
+ {"resource.003", 0, "9107c2aa5398e28b5c5406df13491f85", 693573},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - English Amiga
+ // Executable scanning reports "1.004.024"
+ // SCI interpreter version 1.000.200
+ {{"sq4", "", {
+ {"resource.map", 0, "d87ae90031e7fd04f32a27db054f5c9c", 6174},
+ {"resource.000", 0, "19671ac620a0a4720a1937c20c2e24a1", 323309},
+ {"resource.001", 0, "abca51a4c896df550f095a2db71dce46", 805915},
+ {"resource.002", 0, "5667852471ba5b7f5b9a770eabd07df2", 796615},
+ {"resource.003", 0, "6ec43464f6a17e612636e2928fd9471c", 803868},
+ {"resource.004", 0, "1887ed88bb34ae7238650e8f77f26315", 798226},
+ {"resource.005", 0, "3540d1cc84d674cf4b2c898b88a3b563", 790296},
+ {"resource.006", 0, "ade814bc4d56244c156d9e9bcfebbc11", 664085},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - German Amiga (from www.back2roots.org)
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "79641c0d43408e33c251a1d494d2575e", 6252},
+ {"resource.000", 0, "feff51c52146b3a31d4793c718279e13", 345170},
+ {"resource.001", 0, "ab33060bfebe32450c0b8d9a3a066efc", 822470},
+ {"resource.002", 0, "f79fd6a62da082addb205ed6cef99629", 810458},
+ {"resource.003", 0, "f4c21da916f450d4b893b4cba6120866", 815854},
+ {"resource.004", 0, "99c6a017da5e769a3b427ca52c8a564f", 824601},
+ {"resource.005", 0, "10ee1709e6559c724676d058199b75b5", 818745},
+ {"resource.006", 0, "67fb188b191d88efe8414af6ea297b93", 672675},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - English DOS
+ // Executable scanning reports "1.000.753"
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "a18088c8aceb06025dbc945f29e02935", 5124},
+ {"resource.000", 0, "e1f46832cd2458796028e054a0466031", 5502009},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - English DOS
+ // Executable scanning reports "1.000.753"
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "71ccf4f82ac4efb588731acfb7bf2603", 5646},
+ {"resource.000", 0, "e1f46832cd2458796028e054a0466031", 933928},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 1.052 - English DOS Floppy (supplied by markcoolio in bug report #2723865)
+ // Executable scanning reports "1.000.753"
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "98852d6379622001efd0b50ae93c9a30", 5928},
+ {"resource.000", 0, "e1f46832cd2458796028e054a0466031", 173330},
+ {"resource.001", 0, "cc2f89e6057e05b040566b3699df7288", 1247215},
+ {"resource.002", 0, "9c342cd76b421369406d6fafd7b1a285", 1218373},
+ {"resource.003", 0, "96fa33d89d838bc3f671c5b953e7a896", 1240130},
+ {"resource.004", 0, "ff9c87da3bc53473fdee8b9d3edbc93c", 1200631},
+ {"resource.005", 0, "e33019ac19f755ae33fbf49b4fc9066c", 1053294},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - German DOS (from Tobis87)
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "71715e775e3791178d606cfe6c7e1fb9", 6339},
+ {"resource.000", 0, "5f6a1fff40584ee807efd547899b1ba5", 206032},
+ {"resource.001", 0, "e924cf86a72ada7736043f045cce345f", 1065442},
+ {"resource.002", 0, "e18d731c3fba51333a7f402e454714a5", 858402},
+ {"resource.003", 0, "7c2e7508af1a6af877d921e476f70b5e", 1172738},
+ {"resource.004", 0, "b8d6efbd3235329bfe844c794097b2c9", 1064761},
+ {"resource.005", 0, "47ee647b5b12232d27e63cc627c25899", 1156765},
+ {"resource.006", 0, "dfb023e4e2a1e7a00fa18f9ede72a91b", 924059},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - Italian DOS Floppy (from glorifindel)
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "e753dfa96d68dd95f84f6cd80479a35e", 6135},
+ {"resource.000", 0, "2ac39ff61e369b79f3d7a4ad514f8e29", 203170},
+ {"resource.001", 0, "99a6df6d366b3f061271ff3450ac0d32", 1286269},
+ {"resource.002", 0, "a6a8d7a24dbb7a266a26b084e7275e89", 1241124},
+ {"resource.003", 0, "5289000399d503b59da9e23129256f1a", 1325546},
+ {"resource.004", 0, "4277c61bed40a50dadc4b5a344520af2", 1251000},
+ {"resource.005", 0, "5f885abd335978e2fd4e5f886d7676c8", 1102880},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - Japanese PC-98 5.25" Floppy
+ // SCI interpreter version 1.000.1068
+ {{"sq4", "", {
+ {"resource.map", 0, "ca7bba01019222b6f3e54e9051067a99", 5283},
+ {"resource.000", 0, "161d719f38ed98d33f058a8cf3dc09c3", 952909},
+ {"resource.001", 0, "454684e3a7a68cbca073945e50778447", 1187088},
+ {"resource.002", 0, "6dc668326cc22cb9e8bd8ca9e68d2a66", 1181249},
+ {NULL, 0, NULL, 0}}, Common::JA_JPN, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - Japanese PC-98 5.25" Floppy
+ // SCI interpreter version 1.000.1068
+ {{"sq4", "", {
+ {"resource.map", 0, "ca7bba01019222b6f3e54e9051067a99", 5283},
+ {"resource.000", 0, "161d719f38ed98d33f058a8cf3dc09c3", 952909},
+ {"resource.001", 0, "454684e3a7a68cbca073945e50778447", 1187088},
+ {"resource.002", 0, "6dc668326cc22cb9e8bd8ca9e68d2a66", 1181249},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC98, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 - English DOS CD (from the Space Quest Collection)
+ // Executable scanning reports "1.001.064", VERSION file reports "1.0"
+ {{"sq4", "CD", {
+ {"resource.map", 0, "ed90a8e3ccc53af6633ff6ab58392bae", 7054},
+ {"resource.000", 0, "63247e3901ab8963d4eece73747832e0", 5157378},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Space Quest 4 - Spanish DOS CD (from jvprat)
+ // Executable scanning reports "1.SQ4.057", VERSION file reports "1.000"
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "51bcb305568ec19713f8b79727f10071", 6159},
+ {"resource.000", 0, "8000a55aebc50a68b7cce07a8c33758c", 204315},
+ {"resource.001", 0, "99a6df6d366b3f061271ff3450ac0d32", 1269094},
+ {"resource.002", 0, "a6a8d7a24dbb7a266a26b084e7275e89", 1240998},
+ {"resource.003", 0, "42a307941edeb1a3be31daeb2e4be90b", 1319306},
+ {"resource.004", 0, "776fba81c110d1908776232cbe190e20", 1253752},
+ {"resource.005", 0, "55fae26c2a92f16ef72c1e216e827c0f", 1098328},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Space Quest 4 - Spanish DOS Floppy (from jvprat)
+ // Executable scanning reports "1.SQ4.056", VERSION file reports "1.000"
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "41543ae71036046fef69df29a838ee05", 5589},
+ {"resource.000", 0, "2ac39ff61e369b79f3d7a4ad514f8e29", 242470},
+ {"resource.001", 0, "567608beb69d9dffdb42a8f39cb11a5e", 994323},
+ {"resource.002", 0, "74c62fa2146ff3b3b2ea2b3fb95b9af9", 1140801},
+ {"resource.003", 0, "42a307941edeb1a3be31daeb2e4be90b", 1088408},
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 4 1.000 - German DOS Floppy (supplied by markcoolio in bug report #2723862)
+ // Executable scanning reports "1.SQ4.030"
+ // SCI interpreter version 1.000.200 (just a guess)
+ {{"sq4", "", {
+ {"resource.map", 0, "8f08b97ca093f370c56d99715b015554", 6153},
+ {"resource.000", 0, "5f6a1fff40584ee807efd547899b1ba5", 206032},
+ {"resource.001", 0, "99a6df6d366b3f061271ff3450ac0d32", 1270577},
+ {"resource.002", 0, "a6a8d7a24dbb7a266a26b084e7275e89", 1242817},
+ {"resource.003", 0, "47ee647b5b12232d27e63cc627c25899", 1321146},
+ {"resource.004", 0, "c06350184a490c10eb4585fff0aa3192", 1254368},
+ {"resource.005", 0, "b8d6efbd3235329bfe844c794097b2c9", 1098717},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 5 - English DOS (from the Space Quest Collection)
+ // Executable scanning reports "1.001.068", VERSION file reports "1.04"
+ {{"sq5", "", {
+ {"resource.map", 0, "66317c12ac6e818d1f7c17e83c1d9819", 6143},
+ {"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
+ {"resource.msg", 0, "bb8ad78793c26bdb3f77498b1d6515a9", 125988},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 5 - English DOS
+ // SCI interpreter version 1.001.067
+ {{"sq5", "", {
+ {"resource.map", 0, "8bde0a9adb9a3e9aaa861826874c9834", 6473},
+ {"resource.000", 0, "f4a48705764544d7cc64a7bb22a610df", 6025184},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 5 v1.04 - German DOS (from Tobis87, updated information by markcool from bug reports #2723935 and #2724762)
+ // SCI interpreter version 1.001.068
+ {{"sq5", "", {
+ {"resource.map", 0, "66317c12ac6e818d1f7c17e83c1d9819", 6143},
+ {"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
+ {"resource.msg", 0, "7c71cfc36153cfe07b450423a51f7e68", 146282},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 5 - Italian DOS Floppy (from glorifindel)
+ // SCI interpreter version 1.001.068 (just a guess)
+ {{"sq5", "", {
+ {"resource.000", 0, "5040026519f37199f3616fb1d4704dff", 6047170},
+ {"resource.map", 0, "5b09168baa2f6e2e22787429b2d72f54", 6492},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Space Quest 6 - English DOS/Win3.11 CD (from the Space Quest Collection)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.0"
+ {{"sq6", "", {
+ {"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528},
+ {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Space Quest 6 - English DOS/Win3.11 CD ver 1.11 (from FRG)
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"sq6", "", {
+ {"resource.map", 0, "e0615d6e4e10e37ae42e6a2a95aaf145", 10528},
+ {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // Space Quest 6 - English DOS/Win3.11 Interactive Demo (from FRG)
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"sq6", "Demo", {
+ {"resource.map", 0, "368f07b07433db3f819fa3fa0e5efee5", 2572},
+ {"resource.000", 0, "ab12724e078dea34b624e0d2a38dcd7c", 2272050},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Space Quest 6 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723884)
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"sq6", "", {
+ {"resource.map", 0, "664d797415484f85c90b1b45aedc7686", 10534},
+ {"resource.000", 0, "ba87ba91e5bdabb4169dd0df75777722", 40933685},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // The Island of Dr. Brain - English DOS CD (from jvprat)
+ // Executable scanning reports "1.001.053", VERSION file reports "1.0 10.27.92"
+ {{"islandbrain", "", {
+ {"resource.map", 0, "2388efef8430b041b0f3b00b9050e4a2", 3281},
+ {"resource.000", 0, "b3acd9b9dd7fe53c4ee133ac9a1acfab", 2103560},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE},
+ 0
+ },
+
+ // The Island of Dr. Brain - English DOS (from Quietust)
+ // Executable scanning reports "1.001.053", VERSION file reports "1.1 2.3.93"
+ {{"islandbrain", "", {
+ {"resource.map", 0, "3c07da06bdd1689f9d07af78fb94d0ec", 3101},
+ {"resource.000", 0, "ecc686e0034fb4d41de077ac7167b3cf", 1947866},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // The Island of Dr. Brain - English DOS Non-Interactive Demo
+ // SCI interpreter version 1.001.053 (just a guess)
+ {{"islandbrain", "Demo", {
+ {"resource.map", 0, "a8e5ca8ed1996974afa59f4c45e06195", 986},
+ {"resource.000", 0, "b3acd9b9dd7fe53c4ee133ac9a1acfab", 586560},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+#ifdef ENABLE_SCI32
+ // Torin's Passage - English Windows Interactive Demo
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"torin", "Demo", {
+ {"resmap.000", 0, "9a3e172cde9963d0a969f26469318cec", 3403},
+ {"ressci.000", 0, "db3e290481c35c3224e9602e71e4a1f1", 5073868},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Torin's Passage - English Windows
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"torin", "", {
+ {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+ {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Torin's Passage - Spanish Windows (from jvprat)
+ // Executable scanning reports "2.100.002", VERSION file reports "1.0"
+ {{"torin", "", {
+ {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+ {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+ // TODO: depend on one of the patches?
+ {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Torin's Passage - French Windows
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"torin", "", {
+ {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+ {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+ {NULL, 0, NULL, 0}}, Common::FR_FRA, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Torin's Passage - German Windows
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"torin", "", {
+ {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+ {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+ {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NOSPEECH},
+ 0
+ },
+
+ // Torin's Passage - Italian Windows CD (from glorifindel)
+ // SCI interpreter version 2.100.002 (just a guess)
+ {{"torin", "", {
+ {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+ {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+ {NULL, 0, NULL, 0}}, Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE},
+ 0
+ },
+#endif // ENABLE_SCI32
+
+ // SCI Fanmade Games
+ FANMADE("Al Pond 2: Island Quest", "9625372e710d1a95d2027b48f9e325af", 1506, "a0f9aa65b9bf3d8703adff5a621f243c", 889843),
+ FANMADE("Al Pond: Island Quest 2", "4cba6a5a4c8f66f21935ed78b0511a92", 870, "876587dc9a5ec569287a3dc4b29139d8", 613769),
+ FANMADE("Another DG Game: I Want My C64 Back", "4a8ca7ca2abd18899ef856f47665e2e9", 588, "12ff558d20c72e42cc6adb408f34d6d8", 150513),
+ FANMADE_L("Another DG Game: I Want My C64 Back", "13dc1d9ebc57daf8895412eee5e39fea", 576, "e2ad60b3a280171429db5c85f158f84a", 141697, Common::FR_FRA),
+ FANMADE("Bluntman and Chronic (Politically Correct Version)", "c3ef9fa6c7c5fb840078bf28d87c7f8b", 1362, "441636a9f6f86710844868fded868ee7", 596688),
+ FANMADE("Cascade Quest", "c94efc10d18c040b6e22a1dc6d3adfe1", 3468, "8ada33dfa945f81531e5508240b573de", 1432195),
+ FANMADE("Curt Quest 1.0", "b0e555370380d218968a40a68eaaaffc", 1146, "c851182cdf6fc6a81b840f4d4875f1a0", 307165),
+ FANMADE("Curt Quest 1.1", "54084c29346683296e45ef32d7ae74f3", 1128, "c851182cdf6fc6a81b840f4d4875f1a0", 302000),
+ FANMADE("Demo Quest", "c89a0c9e0a4e4af0ecedb300a3b31dbf", 384, "a32f3495ba24764cba091119cc3f1e13", 160098),
+ FANMADE("Dr. Jummybummy's Space Adventure 2", "6ae6cb7de423f51736d9487b4ca0c6da", 810, "26e5b563f578e104d79689f36568b7cf", 394670),
+ FANMADE_L("Grostesteing: Plus Mechant que Jamais", "ec9a97ccb134f69249f6ea8b16c13d8e", 1500, "b869f5f11bfe2ab5f67f4f0c618f2ce1", 464657, Common::FR_FRA), // FIXME: Accent
+ FANMADE("Jim Quest", "0af50be1d3f0cb77a09137709a76ef4f", 960, "9c042c136548b20d9183495668e03526", 496446),
+ FANMADE("Knight's Quest Demo 1.0", "5e816edf993956752ed06fccfeeae6d9", 1260, "959321f88a22905fa1f8c6d897874744", 703836),
+ FANMADE("LockerGnome Quest", "3eeff9130206cad0c4e1551e2b9dd2c5", 420, "ae05ca90806fd90cc43f147c82d3547c", 158906),
+ FANMADE("New Year's Mystery", "efd1beb5120293725065c95959144f81", 714, "b3bd3c2372ed6efa28adb12403c4c31a", 305027),
+ FANMADE("Osama", "db8f1710453cfbecf4214b2946970043", 390, "7afd75d4620dedf97a84ae8f0a7523cf", 123827),
+ FANMADE("Quest for the Cheat", "a359d4cf27f98264b42b55c017671214", 882, "8a943029f73c4bc85d454b7f473455ba", 455209),
+ FANMADE("SCI Companion Template", "ad54d4f504086cd597aa2348d0aa3b09", 354, "6798b7b601ce8154c1d1bc0f0edcdd18", 113061),
+ FANMADE("SCI Studio Template 3.0", "ca0dc8d586e0a8670b7621cde090b532", 354, "58a48ee692a86c0575e6bd0b00a92b9a", 113097),
+ FANMADE("SCI Quest", "9067e1f1e54436d2dbfce855524bc84a", 552, "ffa7d355cd9223f245289108a696bcd2", 149634),
+ FANMADE("The Legend of the Lost Jewel", "ba1bca315e3818c5626eda51bcfbcccf", 636, "9b0736d69924af0cff32a0f78db96855", 300398),
+
+ // FIXME: The vga demo does not have a resource.000/001 file.
+ //FANMADE_V("SCI VGA Demo", "00b1abd87bad356b90fcdfcb6132c26f", 8, "", 0, 0),
+
+ {AD_TABLE_END_MARKER, 0}
+};
+
+} // End of namespace Sci
--
cgit v1.2.3
From 4c62b6ac86d28d5701dd2563eb030bf5cfa0d036 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 24 Aug 2009 08:10:29 +0000
Subject: - Removed the code which reads the SCI version string from the game
executable in the fallback detector. We no longer use the actual SCI version
string, and we can auto-detect a lot of features from the game resources now.
The EXE version string was only used to display the detected SCI version in
the console, which isn't very useful to us anymore. - Added detection for PC
and Amiga versions based on the game's detected view types. Still need to do
detection for Mac and Atari ST versions
svn-id: r43683
---
engines/sci/detection.cpp | 40 +++++++----
engines/sci/exereader.cpp | 172 ----------------------------------------------
engines/sci/exereader.h | 1 -
3 files changed, 26 insertions(+), 187 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 177fc2fbd1..55ea8ee00a 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -260,7 +260,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
bool foundResMap = false;
bool foundRes000 = false;
Common::Platform exePlatform = Common::kPlatformUnknown;
- Common::String exeVersionString;
// First grab all filenames
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
@@ -293,22 +292,15 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
// Check if it's a known executable name
// Note: "sier" matches "sier.exe", "sierra.exe", "sierw.exe" and "sierw5.exe"
+ // TODO: Try to remove this code, and base platform detection on game resources
+ // instead of the executable itself
if (filename.contains("scidhuv") || filename.contains("sciduv") ||
filename.contains("sciv") || filename.contains("sciw") ||
filename.contains("prog") || filename.contains("sier")) {
- // We already found a valid exe, no need to check this one.
- if (!exeVersionString.empty())
- continue;
-
// Is it really an executable file?
Common::SeekableReadStream *fileStream = file->createReadStream();
exePlatform = getGameExePlatform(fileStream);
-
- // It's a valid exe, read the interpreter version string
- if (exePlatform != Common::kPlatformUnknown)
- exeVersionString = readSciVersionFromExe(fileStream, exePlatform);
-
delete fileStream;
}
}
@@ -319,19 +311,40 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
return 0;
}
+ ResourceManager *resMgr = new ResourceManager(fslist);
+ SciVersion version = resMgr->sciVersion();
+ SegManager *segManager = new SegManager(resMgr, version);
+
// Set some defaults
s_fallbackDesc.desc.extra = "";
s_fallbackDesc.desc.language = Common::UNK_LANG;
+ if (exePlatform == Common::kPlatformUnknown) {
+ // Try to determine the platform from game resources
+ ViewType gameViews = resMgr->getViewType();
+ if (gameViews == kViewEga || gameViews == kViewVga ||
+ gameViews == kViewVga11) {
+ // Must be PC or Mac, set to PC for now
+ // TODO: Is there a reliable way to determine the game
+ // platform from the resources? So far, I've noticed
+ // that Mac versions have a different signature for
+ // kGetEvent and kNewWindow. I'm unsure about Atari ST
+ // versions. Could we base detection on this?
+ exePlatform = Common::kPlatformPC;
+ } else if (gameViews == kViewAmiga) {
+ exePlatform = Common::kPlatformAmiga;
+ }
+ // TODO: detection for Mac and Atari ST
+ }
+
s_fallbackDesc.desc.platform = exePlatform;
s_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
// Determine the game id
- ResourceManager *resMgr = new ResourceManager(fslist);
- SciVersion version = resMgr->sciVersion();
- SegManager *segManager = new SegManager(resMgr, version);
if (!script_instantiate(resMgr, segManager, version, 0)) {
warning("fallbackDetect(): Could not instantiate script 0");
SearchMan.remove("SCI_detection");
+ delete segManager;
+ delete resMgr;
return 0;
}
reg_t game_obj = script_lookup_export(segManager, 0, 0);
@@ -345,7 +358,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
printf("If this is *NOT* a fan-modified version (in particular, not a fan-made\n");
printf("translation), please, report the data above, including the following\n");
printf("version number, from the game's executable:\n");
- printf("Version: %s\n\n", exeVersionString.empty() ? "not found" : exeVersionString.c_str());
SearchMan.remove("SCI_detection");
diff --git a/engines/sci/exereader.cpp b/engines/sci/exereader.cpp
index ce6bf184fb..fbeda66b45 100644
--- a/engines/sci/exereader.cpp
+++ b/engines/sci/exereader.cpp
@@ -96,62 +96,6 @@ Common::Platform getGameExePlatform(Common::SeekableReadStream *exeStream) {
return Common::kPlatformUnknown;
}
-bool isLZEXECompressed(Common::SeekableReadStream *exeStream) {
- uint32 filepos = 0;
-
- exeStream->seek(0, SEEK_SET);
-
- // First 2 bytes should be "MZ" (0x5A4D)
- if (exeStream->readUint16LE() != 0x5A4D) // at pos 0, +2
- return false;
-
- exeStream->skip(6);
-
- // Header size should be 2
- filepos = exeStream->readUint16LE();
- if (filepos != 2) // at pos 8, +2
- return false;
-
- exeStream->skip(12);
-
- // Calculate code segment offset in exe file
- filepos += exeStream->readUint16LE(); // at pos 22, +2
- filepos <<= 4;
-
- // First relocation item offset should be 0x1c
- if (exeStream->readUint16LE() != 0x1c) // at pos 24, +2
- return false;
-
- // Number of overlays should be 0
- if (exeStream->readUint16LE() != 0) // at pos 26, +2
- return false;
-
- // Look for LZEXE signature
- byte magic[4];
- exeStream->read(magic, 4);
-
- if (memcmp(magic, "LZ09", 4) && memcmp(magic, "LZ91", 4))
- return false;
-
- // Seek to offset 8 of info table at start of code segment
- exeStream->seek(filepos + 8, SEEK_SET);
- if (exeStream->err())
- return false;
-
- // Read size of compressed data in paragraphs
- uint16 size = exeStream->readUint16LE();
-
- // Move file pointer to start of compressed data
- filepos -= size << 4;
- exeStream->seek(filepos, SEEK_SET);
- if (exeStream->err())
- return false;
-
- // All conditions met, this is an LZEXE packed file
- // We are currently at the start of the compressed file data
- return true;
-}
-
uint getBit(Common::SeekableReadStream *input) {
uint bit = _bits & 1;
_bitCount--;
@@ -172,120 +116,4 @@ uint getBit(Common::SeekableReadStream *input) {
return bit;
}
-Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream, Common::Platform platform) {
- int len = exeStream->size();
- unsigned char *buffer = NULL;
-
- // Read the executable
- bool isLZEXE = isLZEXECompressed(exeStream);
-
- if (!isLZEXE) {
- buffer = new unsigned char[exeStream->size()];
-
- exeStream->seek(0, SEEK_SET);
- exeStream->read(buffer, exeStream->size());
- } else {
- buffer = new unsigned char[exeStream->size() * 3];
- _bitCount = 0;
-
- // Skip LZEXE header
- exeStream->seek(32, SEEK_SET);
-
- int pos = 0;
- int repeat;
- short offset;
-
- while (1) {
- if (exeStream->ioFailed()) {
- warning("Error reading from input file");
- delete[] buffer;
- return NULL;
- }
-
- if (getBit(exeStream)) {
- buffer[pos++] = exeStream->readByte();
- } else {
- if (getBit(exeStream)) {
- byte tmp[2];
- exeStream->read(tmp, 2);
- repeat = (tmp[1] & 0x07);
- offset = ((tmp[1] & ~0x07) << 5) | tmp[0] | 0xE000;
-
- if (repeat == 0) {
- repeat = exeStream->readByte();
-
- if (repeat == 0) {
- len = pos;
- break;
- }
- else if (repeat == 1)
- continue;
- else
- repeat++;
- } else
- repeat += 2;
- } else {
- repeat = getBit(exeStream) << 1;
- repeat += getBit(exeStream) + 2;
- offset = exeStream->readByte() | 0xFF00;
- }
-
- while (repeat > 0) {
- buffer[pos] = buffer[pos + offset];
- pos++;
- repeat--;
- }
- }
- }
- }
-
- // Find SCI version number
-
- int state = 0;
- /* 'state' encodes how far we have matched the version pattern
- ** "n.nnn.nnn"
- **
- ** n.nnn.nnn
- ** 0123456789
- **
- ** Since we cannot be certain that the pattern does not begin with an
- ** alphanumeric character, some states are ambiguous.
- ** The pattern is expected to be terminated with a non-alphanumeric
- ** character.
- */
-
-
- int accept;
- unsigned char *buf = buffer;
-
- // String-encoded result, copied from buffer
- char currentString[10];
-
- for (int i = 0; i < len; i++) {
- unsigned char ch = *buf++;
- // By default, we don't like this character
- accept = 0;
-
- if (isalnum(ch)) {
- accept = (state != 1 && state != 5 && state != 9);
- } else if (ch == '.') {
- accept = (state == 1 || state == 5);
- } else if (state == 9) {
- // Terminate string
- currentString[9] = 0;
-
- // Return the current string
- return currentString;
- }
-
- if (accept)
- currentString[state++] = ch;
- else
- state = 0;
- }
-
- delete[] buffer;
- return "unknown";
-}
-
} // End of namespace Sci
diff --git a/engines/sci/exereader.h b/engines/sci/exereader.h
index e30d3d90c4..e114c0a3a4 100644
--- a/engines/sci/exereader.h
+++ b/engines/sci/exereader.h
@@ -32,7 +32,6 @@
namespace Sci {
Common::Platform getGameExePlatform(Common::SeekableReadStream *exeStream);
-Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream, Common::Platform platform);
} // End of namespace Sci
--
cgit v1.2.3
From 45802e31244502d946461992357aef4373843e1c Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 24 Aug 2009 08:15:00 +0000
Subject: Updated the MSVC project files of the SCI engine (added
detection_tables.h)
svn-id: r43684
---
dists/msvc8/sci.vcproj | 1 +
dists/msvc9/sci.vcproj | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dists/msvc8/sci.vcproj b/dists/msvc8/sci.vcproj
index eab736cd4c..47abc4f2ed 100644
--- a/dists/msvc8/sci.vcproj
+++ b/dists/msvc8/sci.vcproj
@@ -124,6 +124,7 @@
+
diff --git a/dists/msvc9/sci.vcproj b/dists/msvc9/sci.vcproj
index 1fe6c97ec8..c49cf03097 100644
--- a/dists/msvc9/sci.vcproj
+++ b/dists/msvc9/sci.vcproj
@@ -1,7 +1,7 @@
+
--
cgit v1.2.3
From de2e283492fc9378909ffa892f2ef5f1b0698e1e Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Mon, 24 Aug 2009 09:07:21 +0000
Subject: Added code to launch the GMM save/load dialogues from the in-game
Player menu, replacing the older code that just saved/loaded the game in a
single slot without prompting
svn-id: r43685
---
engines/cruise/cruise.h | 1 +
engines/cruise/detection.cpp | 4 ++++
engines/cruise/menu.cpp | 42 +++++++++++++++++++++++++++++++++++++++---
3 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h
index 574017dfc7..eff3e9b92f 100644
--- a/engines/cruise/cruise.h
+++ b/engines/cruise/cruise.h
@@ -83,6 +83,7 @@ public:
virtual bool hasFeature(EngineFeature f) const;
int getGameType() const;
+ const char *getGameId() const;
uint32 getFeatures() const;
Common::Language getLanguage() const;
Common::Platform getPlatform() const;
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index 1045ed3b0b..054550e439 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -41,6 +41,10 @@ struct CRUISEGameDescription {
uint32 features;
};
+const char *CruiseEngine::getGameId() const {
+ return _gameDescription->desc.gameid;
+}
+
int CruiseEngine::getGameType() const {
return _gameDescription->gameType;
}
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index 7e454e78f8..c620a39b7d 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -27,8 +27,13 @@
#include "cruise/cruise_main.h"
#include "cruise/staticres.h"
+#include "engines/metaengine.h"
+#include "gui/saveload.h"
+
namespace Cruise {
+extern int currentMouseButton;
+
menuStruct *menuTable[8];
menuStruct *createMenu(int X, int Y, const char *menuName) {
@@ -202,6 +207,38 @@ int processMenu(menuStruct *pMenu) {
return -1;
}
+static void handleSaveLoad(bool saveFlag) {
+ const EnginePlugin *plugin = 0;
+ EngineMan.findGame(_vm->getGameId(), &plugin);
+ GUI::SaveLoadChooser *dialog;
+ if (saveFlag)
+ dialog = new GUI::SaveLoadChooser("Save game:", "Save");
+ else
+ dialog = new GUI::SaveLoadChooser("Load game:", "Load");
+
+ dialog->setSaveMode(saveFlag);
+ int slot = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+
+ if (slot >= 0) {
+ if (!saveFlag)
+ _vm->loadGameState(slot);
+ else {
+ Common::String result(dialog->getResultString());
+ if (result.empty()) {
+ // If the user was lazy and entered no save name, come up with a default name.
+ char buf[20];
+ snprintf(buf, 20, "Save %d", slot + 1);
+
+ _vm->saveGameState(slot, buf);
+ } else {
+ _vm->saveGameState(slot, result.c_str());
+ }
+ }
+ }
+
+ delete dialog;
+}
+
int playerMenu(int menuX, int menuY) {
int retourMenu;
//int restartGame = 0;
@@ -251,15 +288,14 @@ int playerMenu(int menuX, int menuY) {
freeMenu(menuTable[0]);
menuTable[0] = NULL;
+ currentMouseButton = 0;
switch (retourMenu) {
case 3: // select save drive
break;
case 4: // save
- saveSavegameData(0, "Default Save");
- break;
case 5: // load
- loadSavegameData(0);
+ handleSaveLoad(retourMenu == 4);
break;
case 6: // restart
_vm->sound().fadeOutMusic();
--
cgit v1.2.3
From 1793787bb9b6d604b2f8d03d6f8187fb753e5efa Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 24 Aug 2009 09:31:10 +0000
Subject: Some cleanup of the MSVC project files
svn-id: r43686
---
dists/msvc9/scumm.vcproj | 2 +-
dists/msvc9/scummvm.vcproj | 1911 +++++++++-----------------------------------
2 files changed, 369 insertions(+), 1544 deletions(-)
diff --git a/dists/msvc9/scumm.vcproj b/dists/msvc9/scumm.vcproj
index c2c116ef8b..a428fbceee 100644
--- a/dists/msvc9/scumm.vcproj
+++ b/dists/msvc9/scumm.vcproj
@@ -1,7 +1,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -886,558 +237,156 @@
/>
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1460,14 +409,8 @@
/>
-
-
-
-
+
+
@@ -1490,169 +433,51 @@
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
--
cgit v1.2.3
From cba88415bbd3fbb6d66e54b36379a38a7c4f3eea Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Mon, 24 Aug 2009 10:06:38 +0000
Subject: Fix bug #2843387 - PUTTPUTT/FATTYBEAR: Macintosh versions assert on
startup.
svn-id: r43687
---
engines/scumm/he/script_v60he.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 92848ce981..4c01d3b15c 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -98,6 +98,13 @@ int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) {
int len = resStrLen(dst);
if (_game.platform == Common::kPlatformMacintosh) {
+ // Remove : prefix in HE71 games
+ if (dst[0] == ':') {
+ len -= 1;
+ memmove(dst, dst + 1, len);
+ dst[len] = 0;
+ }
+
// Switch all : to / for portablity
for (int i = 0; i < len; i++) {
if (dst[i] == ':')
--
cgit v1.2.3
From 8d5a2542fbd4fd9a16d2e4451d6cf4d7e3078965 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Mon, 24 Aug 2009 10:09:31 +0000
Subject: Whitespace changes.
svn-id: r43689
---
engines/agos/rooms.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index d5146ae408..c390269fec 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -92,7 +92,7 @@ void AGOSEngine::changeDoorState(SubRoom *r, uint16 d, uint16 n) {
mask <<= d;
n <<= d;
r->roomExitStates &= ~mask;
- r->roomExitStates|= n;
+ r->roomExitStates |= n;
}
void AGOSEngine::setDoorState(Item *i, uint16 d, uint16 n) {
--
cgit v1.2.3
From 1f39c1b569831913ccf44f44113393f5c7510760 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Mon, 24 Aug 2009 10:23:22 +0000
Subject: Bugfix for freeze when the in-game Pause 'P' key is used
svn-id: r43690
---
engines/cruise/cruise.cpp | 2 ++
engines/cruise/cruise_main.cpp | 3 +++
2 files changed, 5 insertions(+)
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index 1286c38ff3..c4b2cd53fe 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -201,6 +201,8 @@ void CruiseEngine::pauseEngine(bool pause) {
flipScreen();
changeCursor(_savedCursor);
}
+
+ gfxModuleData_addDirtyRect(Common::Rect(64, 100, 256, 117));
}
Common::Error CruiseEngine::loadGameState(int slot) {
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index aa3283aab7..5bde40b7ad 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1330,6 +1330,8 @@ bool checkInput(int16 *buttonPtr) {
return false;
}
+extern bool manageEvents();
+
int CruiseEngine::processInput(void) {
int16 mouseX = 0;
int16 mouseY = 0;
@@ -1367,6 +1369,7 @@ int CruiseEngine::processInput(void) {
bool pausedButtonDown = false;
while (!_vm->shouldQuit()) {
+ manageEvents();
getMouseStatus(&main10, &mouseX, &button, &mouseY);
if (button) pausedButtonDown = true;
--
cgit v1.2.3
From ea08733873a0f2a0058ef452a7751beed4882e8e Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 24 Aug 2009 11:36:00 +0000
Subject: Small syntax change in the hope to make the motoezx target happy.
svn-id: r43692
---
engines/m4/script.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/engines/m4/script.h b/engines/m4/script.h
index 63dc32958b..2cb2219b8d 100644
--- a/engines/m4/script.h
+++ b/engines/m4/script.h
@@ -120,8 +120,7 @@ public:
clear();
}
template
- T *load(Common::File *fd, uint32 ofs) {
- T *item;
+ void load(Common::File *fd, uint32 ofs, T *&item) {
if (_cache.contains(ofs)) {
item = (T*)(_cache[ofs]);
} else {
@@ -130,7 +129,6 @@ public:
item->load(fd);
_cache[ofs] = item;
}
- return item;
}
void clear() {
// TODO: Free all cached items
@@ -300,7 +298,8 @@ public:
const T& toData(const ScriptValue &value) {
printf("ScriptInterpreter::toData() index = %d; type = %d; max = %d\n", value.value, _data[value.value]->type, _data.size());
assert((uint32)value.value < _data.size());
- T *result = _dataCache->load(_scriptFile, _data[value.value]->offset);
+ T *result = 0;
+ _dataCache->load(_scriptFile, _data[value.value]->offset, result);
return *result;
}
--
cgit v1.2.3
From 40aac5fbf7a2f582ecc38d99c67a52e5fefdff17 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 24 Aug 2009 12:27:25 +0000
Subject: Add comment why the syntax for ScriptDataCache::load was changed.
svn-id: r43694
---
engines/m4/script.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/engines/m4/script.h b/engines/m4/script.h
index 2cb2219b8d..2eb608ccbb 100644
--- a/engines/m4/script.h
+++ b/engines/m4/script.h
@@ -119,6 +119,15 @@ public:
~ScriptDataCache() {
clear();
}
+
+ // WORKAROUND: The old prototype for this function was:
+ // template T *load(Common::File *fd, uint32 ofs);
+ // that caused a parser error in g++ 3.3.6 used by our
+ // "motoezx" target of our buildbot. The actual parser
+ // error happended, when calling the function like this:
+ // "T *result = _dataCache->load(_scriptFile, _data[value.value]->offset);"
+ // in ScriptInterpreter::toData. To work around this
+ // we moved the return value as parameter instead.
template
void load(Common::File *fd, uint32 ofs, T *&item) {
if (_cache.contains(ofs)) {
--
cgit v1.2.3
From 184aae3c8c863541771fbeb09ce5f1a72ecabb95 Mon Sep 17 00:00:00 2001
From: Norbert Lange
Date: Mon, 24 Aug 2009 12:39:03 +0000
Subject: Enable alternative palettse for Amiga Monkey Island - Patch ID:
2819787 use tables for palette colors instead of code with constants
svn-id: r43696
---
common/endian.h | 302 +++++++++++++++++++++++++++++-------------
common/stream.h | 101 +++++++-------
engines/saga/animation.cpp | 4 +-
engines/scumm/palette.cpp | 320 ++++++++++++++++++---------------------------
engines/scumm/scumm.cpp | 4 +-
engines/scumm/scumm.h | 9 +-
6 files changed, 399 insertions(+), 341 deletions(-)
diff --git a/common/endian.h b/common/endian.h
index c889371a2f..2e52af139b 100644
--- a/common/endian.h
+++ b/common/endian.h
@@ -32,23 +32,47 @@
// Endian conversion functions, macros etc., follow from here!
//
+// Sanity check
+#if !defined(SCUMM_LITTLE_ENDIAN) && !defined(SCUMM_BIG_ENDIAN)
+# error No endianness defined
+#endif
+
/**
* Swap the bytes in a 32 bit word in order to convert LE encoded data to BE
* and vice versa.
+ * compilerspecific variants come first, fallback last
*/
-FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) {
- return ((a >> 24) & 0x000000FF) |
- ((a >> 8) & 0x0000FF00) |
- ((a << 8) & 0x00FF0000) |
- ((a << 24) & 0xFF000000);
-}
+
+// Test for GCC >= 4.3.0 as this version added the bswap builtin
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+
+ FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) {
+ return __builtin_bswap32(a);
+ }
+
+// test for MSVC 7 or newer
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
+
+ FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) {
+ return _byteswap_ulong(a);
+ }
+
+// generic fallback
+#else
+
+ inline uint32 SWAP_BYTES_32(uint32 a) {
+ const uint16 low = (uint16)a, high = (uint16)(a >> 16);
+ return ((uint32)(uint16)((low >> 8) | (low << 8)) << 16)
+ | (uint16)((high >> 8) | (high << 8));
+ }
+#endif
/**
* Swap the bytes in a 16 bit word in order to convert LE encoded data to BE
* and vice versa.
*/
-FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) {
- return ((a >> 8) & 0x00FF) + ((a << 8) & 0xFF00);
+FORCEINLINE uint16 SWAP_BYTES_16(const uint16 a) {
+ return (a >> 8) | (a << 8);
}
@@ -70,25 +94,123 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) {
* For the latter systems we provide the INVERSE_MKID override.
*/
#if defined(INVERSE_MKID)
-#define MKID_BE(a) ((uint32) \
- (((a) >> 24) & 0x000000FF) | \
- (((a) >> 8) & 0x0000FF00) | \
- (((a) << 8) & 0x00FF0000) | \
- (((a) << 24) & 0xFF000000))
+#define MKID_BE(a) ((uint32)( \
+ (((a) >> 24) & 0x00FF) | \
+ (((a) >> 8) & 0xFF00) | \
+ (((a) & 0xFF00) << 8) | \
+ (((a) & 0x00FF) << 24) ))
#else
# define MKID_BE(a) ((uint32)(a))
#endif
+// Functions for reading/writing native Integers,
+// this transparently handles the need for alignment
+
+#if !defined(SCUMM_NEED_ALIGNMENT)
+
+ FORCEINLINE uint16 READ_UINT16(const void *ptr) {
+ return *(const uint16 *)(ptr);
+ }
+
+ FORCEINLINE uint32 READ_UINT32(const void *ptr) {
+ return *(const uint32 *)(ptr);
+ }
+
+ FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
+ *(uint16 *)(ptr) = value;
+ }
+
+ FORCEINLINE void WRITE_UINT32(void *ptr, uint32 value) {
+ *(uint32 *)(ptr) = value;
+ }
+
+// test for GCC >= 4.0. these implementations will automatically use CPU-specific
+// instructions for unaligned data when they are available (eg. MIPS)
+#elif defined(__GNUC__) && (__GNUC__ >= 4)
+
+ FORCEINLINE uint16 READ_UINT16(const void *ptr) {
+ struct Unaligned16 { uint16 val; } __attribute__ ((__packed__));
+ return ((const Unaligned16 *)ptr)->val;
+ }
+
+ FORCEINLINE uint32 READ_UINT32(const void *ptr) {
+ struct Unaligned32 { uint32 val; } __attribute__ ((__packed__));
+ return ((const Unaligned32 *)ptr)->val;
+ }
+
+ FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
+ struct Unaligned16 { uint16 val; } __attribute__ ((__packed__));
+ ((Unaligned16 *)ptr)->val = value;
+ }
+
+ FORCEINLINE void WRITE_UINT32(void *ptr, uint32 value) {
+ struct Unaligned32 { uint32 val; } __attribute__ ((__packed__));
+ ((Unaligned32 *)ptr)->val = value;
+ }
+
+// use software fallback by loading each byte explicitely
+#else
+
+# if defined(SCUMM_LITTLE_ENDIAN)
+
+ FORCEINLINE uint16 READ_UINT16(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[1] << 8) | b[0];
+ }
+ inline uint32 READ_UINT32(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | (b[0]);
+ }
+ FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 0);
+ b[1] = (uint8)(value >> 8);
+ }
+ inline void WRITE_UINT32(void *ptr, uint32 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 0);
+ b[1] = (uint8)(value >> 8);
+ b[2] = (uint8)(value >> 16);
+ b[3] = (uint8)(value >> 24);
+ }
+
+# elif defined(SCUMM_BIG_ENDIAN)
+
+ FORCEINLINE uint16 READ_UINT16(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[0] << 8) | b[1];
+ }
+ inline uint32 READ_UINT32(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
+ }
+ FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 8);
+ b[1] = (uint8)(value >> 0);
+ }
+ inline void WRITE_UINT32(void *ptr, uint32 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 24);
+ b[1] = (uint8)(value >> 16);
+ b[2] = (uint8)(value >> 8);
+ b[3] = (uint8)(value >> 0);
+ }
+
+# endif
+#endif
+
+// Map Funtions for reading/writing BE/LE integers depending on native endianess
#if defined(SCUMM_LITTLE_ENDIAN)
- #define READ_UINT16(a) READ_LE_UINT16(a)
- #define READ_UINT32(a) READ_LE_UINT32(a)
+ #define READ_LE_UINT16(a) READ_UINT16(a)
+ #define READ_LE_UINT32(a) READ_UINT32(a)
- #define WRITE_UINT16(a, v) WRITE_LE_UINT16(a, v)
- #define WRITE_UINT32(a, v) WRITE_LE_UINT32(a, v)
+ #define WRITE_LE_UINT16(a, v) WRITE_UINT16(a, v)
+ #define WRITE_LE_UINT32(a, v) WRITE_UINT32(a, v)
#define FROM_LE_32(a) ((uint32)(a))
#define FROM_LE_16(a) ((uint16)(a))
@@ -102,16 +224,57 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) {
#define TO_BE_32(a) SWAP_BYTES_32(a)
#define TO_BE_16(a) SWAP_BYTES_16(a)
+# if defined(SCUMM_NEED_ALIGNMENT)
+
+ FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[0] << 8) | b[1];
+ }
+ inline uint32 READ_BE_UINT32(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
+ }
+ FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 8);
+ b[1] = (uint8)(value >> 0);
+ }
+ inline void WRITE_BE_UINT32(void *ptr, uint32 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 24);
+ b[1] = (uint8)(value >> 16);
+ b[2] = (uint8)(value >> 8);
+ b[3] = (uint8)(value >> 0);
+ }
+# else
+
+ FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+ return SWAP_BYTES_16(*(const uint16 *)ptr);
+ }
+ FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
+ return SWAP_BYTES_32(*(const uint32 *)ptr);
+ }
+ FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+ *(uint16 *)ptr = SWAP_BYTES_16(value);
+ }
+ FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
+ *(uint32 *)ptr = SWAP_BYTES_32(value);
+ }
+
+# endif // if defined(SCUMM_NEED_ALIGNMENT)
+
#elif defined(SCUMM_BIG_ENDIAN)
+ // I thought this would be compiler-specific and not dependent
+ // on endianess after the comments above?
#define MKID(a) ((uint32)(a))
#define MKID_BE(a) ((uint32)(a))
- #define READ_UINT16(a) READ_BE_UINT16(a)
- #define READ_UINT32(a) READ_BE_UINT32(a)
+ #define READ_BE_UINT16(a) READ_UINT16(a)
+ #define READ_BE_UINT32(a) READ_UINT32(a)
- #define WRITE_UINT16(a, v) WRITE_BE_UINT16(a, v)
- #define WRITE_UINT32(a, v) WRITE_BE_UINT32(a, v)
+ #define WRITE_BE_UINT16(a, v) WRITE_UINT16(a, v)
+ #define WRITE_BE_UINT32(a, v) WRITE_UINT32(a, v)
#define FROM_LE_32(a) SWAP_BYTES_32(a)
#define FROM_LE_16(a) SWAP_BYTES_16(a)
@@ -125,96 +288,55 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) {
#define TO_BE_32(a) ((uint32)(a))
#define TO_BE_16(a) ((uint16)(a))
-#else
-
- #error No endianness defined
-
-
-#endif
-
+# if defined(SCUMM_NEED_ALIGNMENT)
-#if defined(SCUMM_NEED_ALIGNMENT) || !defined(SCUMM_LITTLE_ENDIAN)
FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
- const byte *b = (const byte *)ptr;
- return (b[1] << 8) + b[0];
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[1] << 8) | b[0];
}
- FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
- const byte *b = (const byte *)ptr;
- return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
+ inline uint32 READ_LE_UINT32(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | (b[0]);
}
FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
- byte *b = (byte *)ptr;
- b[0] = (byte)(value >> 0);
- b[1] = (byte)(value >> 8);
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 0);
+ b[1] = (uint8)(value >> 8);
}
- FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
- byte *b = (byte *)ptr;
- b[0] = (byte)(value >> 0);
- b[1] = (byte)(value >> 8);
- b[2] = (byte)(value >> 16);
- b[3] = (byte)(value >> 24);
+ inline void WRITE_LE_UINT32(void *ptr, uint32 value) {
+ uint8 *b = (uint8 *)ptr;
+ b[0] = (uint8)(value >> 0);
+ b[1] = (uint8)(value >> 8);
+ b[2] = (uint8)(value >> 16);
+ b[3] = (uint8)(value >> 24);
}
-#else
+# else
+
FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
- return *(const uint16 *)(ptr);
+ return SWAP_BYTES_16(*(const uint16 *)ptr);
}
FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
- return *(const uint32 *)(ptr);
+ return SWAP_BYTES_32(*(const uint32 *)ptr);
}
FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
- *(uint16 *)(ptr) = value;
+ *(uint16 *)ptr = SWAP_BYTES_16(value);
}
FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
- *(uint32 *)(ptr) = value;
+ *(uint32 *)ptr = SWAP_BYTES_32(value);
}
-#endif
-
+
+# endif // if defined(SCUMM_NEED_ALIGNMENT)
-#if defined(SCUMM_NEED_ALIGNMENT) || !defined(SCUMM_BIG_ENDIAN)
- FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
- const byte *b = (const byte *)ptr;
- return (b[0] << 8) + b[1];
- }
- FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
- const byte *b = (const byte*)ptr;
- return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
- }
- FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
- byte *b = (byte *)ptr;
- b[0] = (byte)(value >> 8);
- b[1] = (byte)(value >> 0);
- }
- FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
- byte *b = (byte *)ptr;
- b[0] = (byte)(value >> 24);
- b[1] = (byte)(value >> 16);
- b[2] = (byte)(value >> 8);
- b[3] = (byte)(value >> 0);
- }
-#else
- FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
- return *(const uint16 *)(ptr);
- }
- FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
- return *(const uint32 *)(ptr);
- }
- FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
- *(uint16 *)(ptr) = value;
- }
- FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
- *(uint32 *)(ptr) = value;
- }
-#endif
+#endif // if defined(SCUMM_LITTLE_ENDIAN)
FORCEINLINE uint32 READ_LE_UINT24(const void *ptr) {
- const byte *b = (const byte *)ptr;
- return (b[2] << 16) + (b[1] << 8) + (b[0]);
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[2] << 16) | (b[1] << 8) | (b[0]);
}
FORCEINLINE uint32 READ_BE_UINT24(const void *ptr) {
- const byte *b = (const byte*)ptr;
- return (b[0] << 16) + (b[1] << 8) + (b[2]);
+ const uint8 *b = (const uint8 *)ptr;
+ return (b[0] << 16) | (b[1] << 8) | (b[2]);
}
-
#endif
diff --git a/common/stream.h b/common/stream.h
index 86e8e71134..9475f6fa2d 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -27,6 +27,7 @@
#define COMMON_STREAM_H
#include "common/scummsys.h"
+#include "common/endian.h"
namespace Common {
@@ -106,38 +107,38 @@ public:
}
void writeUint16LE(uint16 value) {
- writeByte((byte)(value & 0xff));
- writeByte((byte)(value >> 8));
+ value = TO_LE_16(value);
+ write(&value, 2);
}
void writeUint32LE(uint32 value) {
- writeUint16LE((uint16)(value & 0xffff));
- writeUint16LE((uint16)(value >> 16));
+ value = TO_LE_32(value);
+ write(&value, 4);
}
void writeUint16BE(uint16 value) {
- writeByte((byte)(value >> 8));
- writeByte((byte)(value & 0xff));
+ value = TO_BE_16(value);
+ write(&value, 2);
}
void writeUint32BE(uint32 value) {
- writeUint16BE((uint16)(value >> 16));
- writeUint16BE((uint16)(value & 0xffff));
+ value = TO_BE_32(value);
+ write(&value, 4);
}
- void writeSint16LE(int16 value) {
+ FORCEINLINE void writeSint16LE(int16 value) {
writeUint16LE((uint16)value);
}
- void writeSint32LE(int32 value) {
+ FORCEINLINE void writeSint32LE(int32 value) {
writeUint32LE((uint32)value);
}
- void writeSint16BE(int16 value) {
+ FORCEINLINE void writeSint16BE(int16 value) {
writeUint16BE((uint16)value);
}
- void writeSint32BE(int32 value) {
+ FORCEINLINE void writeSint32BE(int32 value) {
writeUint32BE((uint32)value);
}
@@ -188,7 +189,7 @@ public:
* calling err() and eos() ).
*/
byte readByte() {
- byte b = 0;
+ byte b = 0; // FIXME: remove initialisation
read(&b, 1);
return b;
}
@@ -200,7 +201,7 @@ public:
* calling err() and eos() ).
*/
int8 readSByte() {
- int8 b = 0;
+ int8 b = 0; // FIXME: remove initialisation
read(&b, 1);
return b;
}
@@ -213,9 +214,9 @@ public:
* calling err() and eos() ).
*/
uint16 readUint16LE() {
- uint16 a = readByte();
- uint16 b = readByte();
- return a | (b << 8);
+ uint16 val;
+ read(&val, 2);
+ return FROM_LE_16(val);
}
/**
@@ -226,9 +227,9 @@ public:
* calling err() and eos() ).
*/
uint32 readUint32LE() {
- uint32 a = readUint16LE();
- uint32 b = readUint16LE();
- return (b << 16) | a;
+ uint32 val;
+ read(&val, 4);
+ return FROM_LE_32(val);
}
/**
@@ -239,9 +240,9 @@ public:
* calling err() and eos() ).
*/
uint16 readUint16BE() {
- uint16 b = readByte();
- uint16 a = readByte();
- return a | (b << 8);
+ uint16 val;
+ read(&val, 2);
+ return FROM_BE_16(val);
}
/**
@@ -252,9 +253,9 @@ public:
* calling err() and eos() ).
*/
uint32 readUint32BE() {
- uint32 b = readUint16BE();
- uint32 a = readUint16BE();
- return (b << 16) | a;
+ uint32 val;
+ read(&val, 4);
+ return FROM_BE_32(val);
}
/**
@@ -264,7 +265,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- int16 readSint16LE() {
+ FORCEINLINE int16 readSint16LE() {
return (int16)readUint16LE();
}
@@ -275,7 +276,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- int32 readSint32LE() {
+ FORCEINLINE int32 readSint32LE() {
return (int32)readUint32LE();
}
@@ -286,7 +287,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- int16 readSint16BE() {
+ FORCEINLINE int16 readSint16BE() {
return (int16)readUint16BE();
}
@@ -297,7 +298,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- int32 readSint32BE() {
+ FORCEINLINE int32 readSint32BE() {
return (int32)readUint32BE();
}
@@ -460,26 +461,31 @@ public:
* @see SubReadStream
*/
class SeekableSubReadStreamEndian : public SeekableSubReadStream {
-public:
- bool _bigEndian;
+private:
+ const bool _bigEndian;
+public:
SeekableSubReadStreamEndian(SeekableReadStream *parentStream, uint32 begin, uint32 end, bool bigEndian = false, bool disposeParentStream = false)
: SeekableSubReadStream(parentStream, begin, end, disposeParentStream), _bigEndian(bigEndian) {
}
- inline uint16 readUint16() {
- return (_bigEndian) ? readUint16BE() : readUint16LE();
+ uint16 readUint16() {
+ uint16 val;
+ read(&val, 2);
+ return (_bigEndian) ? TO_BE_16(val) : TO_LE_16(val);
}
- inline uint32 readUint32() {
- return (_bigEndian) ? readUint32BE() : readUint32LE();
+ uint32 readUint32() {
+ uint32 val;
+ read(&val, 4);
+ return (_bigEndian) ? TO_BE_32(val) : TO_LE_32(val);
}
- inline int16 readSint16() {
+ FORCEINLINE int16 readSint16() {
return (int16)readUint16();
}
- inline int32 readSint32() {
+ FORCEINLINE int32 readSint32() {
return (int32)readUint32();
}
};
@@ -582,23 +588,28 @@ public:
*/
class MemoryReadStreamEndian : public Common::MemoryReadStream {
private:
+ const bool _bigEndian;
+
public:
- bool _bigEndian;
MemoryReadStreamEndian(const byte *buf, uint32 len, bool bigEndian = false) : MemoryReadStream(buf, len), _bigEndian(bigEndian) {}
- inline uint16 readUint16() {
- return (_bigEndian) ? readUint16BE() : readUint16LE();
+ uint16 readUint16() {
+ uint16 val;
+ read(&val, 2);
+ return (_bigEndian) ? TO_BE_16(val) : TO_LE_16(val);
}
- inline uint32 readUint32() {
- return (_bigEndian) ? readUint32BE() : readUint32LE();
+ uint32 readUint32() {
+ uint32 val;
+ read(&val, 4);
+ return (_bigEndian) ? TO_BE_32(val) : TO_LE_32(val);
}
- inline int16 readSint16() {
+ FORCEINLINE int16 readSint16() {
return (int16)readUint16();
}
- inline int32 readSint32() {
+ FORCEINLINE int32 readSint32() {
return (int32)readUint32();
}
};
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 0d298bf96a..95a850cfe2 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -826,12 +826,10 @@ int Anim::fillFrameOffsets(AnimationData *anim, bool reallyFill) {
int i;
bool longData = isLongData();
- MemoryReadStreamEndian readS(anim->resourceData, anim->resourceLength, _vm->isBigEndian());
+ MemoryReadStreamEndian readS(anim->resourceData, anim->resourceLength, !_vm->isBigEndian()); // RLE has inversion BE<>LE
readS.seek(12);
- readS._bigEndian = !_vm->isBigEndian(); // RLE has inversion BE<>LE
-
while (readS.pos() != readS.size()) {
if (reallyFill) {
anim->frameOffsets[currentFrame] = readS.pos();
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index a596cc5b1a..2fe3f34530 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -55,230 +55,155 @@ uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) {
}
void ScummEngine::resetPalette() {
+ static const byte tableC64Palette[] = {
+ 0x00, 0x00, 0x00, 0xFD, 0xFE, 0xFC, 0xBE, 0x1A, 0x24, 0x30, 0xE6, 0xC6,
+ 0xB4, 0x1A, 0xE2, 0x1F, 0xD2, 0x1E, 0x21, 0x1B, 0xAE, 0xDF, 0xF6, 0x0A,
+ 0xB8, 0x41, 0x04, 0x6A, 0x33, 0x04, 0xFE, 0x4A, 0x57, 0x42, 0x45, 0x40,
+ 0x70, 0x74, 0x6F, 0x59, 0xFE, 0x59, 0x5F, 0x53, 0xFE, 0xA4, 0xA7, 0xA2,
+
+ // Use 17 color table for v1 games to allow correct color for inventory and
+ // sentence line. Original games used some kind of dynamic color table
+ // remapping between rooms.
+ 0xFF, 0x55, 0xFF
+ };
+
+ static const byte tableNESPalette[] = {
+ /* 0x1D */
+ 0x00, 0x00, 0x00, 0x00, 0x24, 0x92, 0x00, 0x00, 0xDB, 0x6D, 0x49, 0xDB,
+ 0x92, 0x00, 0x6D, 0xB6, 0x00, 0x6D, 0xB6, 0x24, 0x00, 0x92, 0x49, 0x00,
+ 0x6D, 0x49, 0x00, 0x24, 0x49, 0x00, 0x00, 0x6D, 0x24, 0x00, 0x92, 0x00,
+ 0x00, 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0xB6, 0xB6, 0xB6, 0x00, 0x6D, 0xDB, 0x00, 0x49, 0xFF, 0x92, 0x00, 0xFF,
+ 0xB6, 0x00, 0xFF, 0xFF, 0x00, 0x92, 0xFF, 0x00, 0x00, 0xDB, 0x6D, 0x00,
+ 0x92, 0x6D, 0x00, 0x24, 0x92, 0x00, 0x00, 0x92, 0x00, 0x00, 0xB6, 0x6D,
+ /* 0x00 */
+ 0x00, 0x92, 0x92, 0x6D, 0x6D, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0xFF, 0xFF, 0xFF, 0x6D, 0xB6, 0xFF, 0x92, 0x92, 0xFF, 0xDB, 0x6D, 0xFF,
+ 0xFF, 0x00, 0xFF, 0xFF, 0x6D, 0xFF, 0xFF, 0x92, 0x00, 0xFF, 0xB6, 0x00,
+ 0xDB, 0xDB, 0x00, 0x6D, 0xDB, 0x00, 0x00, 0xFF, 0x00, 0x49, 0xFF, 0xDB,
+ 0x00, 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0xFF, 0xFF, 0xFF, 0xB6, 0xDB, 0xFF, 0xDB, 0xB6, 0xFF, 0xFF, 0xB6, 0xFF,
+ 0xFF, 0x92, 0xFF, 0xFF, 0xB6, 0xB6, 0xFF, 0xDB, 0x92, 0xFF, 0xFF, 0x49,
+ 0xFF, 0xFF, 0x6D, 0xB6, 0xFF, 0x49, 0x92, 0xFF, 0x6D, 0x49, 0xFF, 0xDB,
+ 0x92, 0xDB, 0xFF, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+
+ static const byte tableAmigaPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x00, 0xBB, 0x00, 0x00, 0xBB, 0xBB,
+ 0xBB, 0x00, 0x00, 0xBB, 0x00, 0xBB, 0xBB, 0x77, 0x00, 0xBB, 0xBB, 0xBB,
+ 0x77, 0x77, 0x77, 0x77, 0x77, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0x88, 0x88, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF
+ };
+
+ static const byte tableAmigaMIPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x88, 0x22, 0x00, 0x66, 0x77,
+ 0xBB, 0x66, 0x66, 0xAA, 0x22, 0xAA, 0x88, 0x55, 0x22, 0x77, 0x77, 0x77,
+ 0x33, 0x33, 0x33, 0x22, 0x55, 0xDD, 0x22, 0xDD, 0x44, 0x00, 0xCC, 0xFF,
+ 0xFF, 0x99, 0x99, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0x77, 0xFF, 0xFF, 0xFF
+ };
+
+ static const byte tableEGAPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0x00, 0xAA, 0xAA,
+ 0xAA, 0x00, 0x00, 0xAA, 0x00, 0xAA, 0xAA, 0x55, 0x00, 0xAA, 0xAA, 0xAA,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0xFF, 0x55, 0xFF, 0x55, 0x55, 0xFF, 0xFF,
+ 0xFF, 0x55, 0x55, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0x55, 0xFF, 0xFF, 0xFF
+ };
+
+ static const byte tableV1Palette[] = {
+ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xAA, 0x00, 0x00, 0x00, 0xAA, 0xAA,
+ 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0x00, 0x00, 0xAA, 0xFF, 0xFF, 0x55,
+ 0xFF, 0x55, 0x55, 0xAA, 0x55, 0x00, 0xFF, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xAA, 0xAA, 0xAA, 0x55, 0xFF, 0x55, 0x55, 0x55, 0xFF, 0x55, 0x55, 0x55,
+
+ 0xFF, 0x55, 0xFF
+ };
+
+ static const byte tableCGAPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xA8, 0xA8, 0xA8, 0x00, 0xA8, 0xA8, 0xA8, 0xA8
+ };
+
+ static const byte tableHercAPalette[] = {
+ 0x00, 0x00, 0x00, 0xAE, 0x69, 0x38
+ };
+
+ static const byte tableHercGPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
+ };
+
if (_game.version <= 1) {
if (_game.platform == Common::kPlatformApple2GS) {
// TODO: unique palette?
- setC64Palette();
+ setPaletteFromTable(tableC64Palette, sizeof(tableC64Palette) / 3);
} else if (_game.platform == Common::kPlatformC64) {
- setC64Palette();
+ setPaletteFromTable(tableC64Palette, sizeof(tableC64Palette) / 3);
} else if (_game.platform == Common::kPlatformNES) {
- setNESPalette();
+ setPaletteFromTable(tableNESPalette, sizeof(tableNESPalette) / 3);
} else {
- setV1Palette();
+ setPaletteFromTable(tableV1Palette, sizeof(tableV1Palette) / 3);
+ if (_game.id == GID_ZAK)
+ setPalColor(15, 170, 170, 170);
}
} else if (_game.features & GF_16COLOR) {
+ bool setupCursor = false;
+
switch (_renderMode) {
case Common::kRenderEGA:
- setEGAPalette();
+ setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
break;
case Common::kRenderAmiga:
- setAmigaPalette();
+ setPaletteFromTable(tableAmigaPalette, sizeof(tableAmigaPalette) / 3);
break;
case Common::kRenderCGA:
- setCGAPalette();
+ setPaletteFromTable(tableCGAPalette, sizeof(tableCGAPalette) / 3);
+ setupCursor = true;
break;
case Common::kRenderHercA:
+ setPaletteFromTable(tableHercAPalette, sizeof(tableHercAPalette) / 3);
+ setupCursor = true;
+ break;
+
case Common::kRenderHercG:
- setHercPalette();
+ setPaletteFromTable(tableHercGPalette, sizeof(tableHercGPalette) / 3);
+ setupCursor = true;
break;
default:
if ((_game.platform == Common::kPlatformAmiga) || (_game.platform == Common::kPlatformAtariST))
- setAmigaPalette();
+ setPaletteFromTable(tableAmigaPalette, sizeof(tableAmigaPalette) / 3);
else
- setEGAPalette();
+ setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
+ }
+ if (setupCursor) {
+ // Setup cursor palette
+ setPalColor( 7, 170, 170, 170);
+ setPalColor( 8, 85, 85, 85);
+ setPalColor(15, 255, 255, 255);
}
- } else
- setDirtyColors(0, 255);
-}
-
-void ScummEngine::setC64Palette() {
- setPalColor( 0, 0x00, 0x00, 0x00);
- setPalColor( 1, 0xFD, 0xFE, 0xFC);
- setPalColor( 2, 0xBE, 0x1A, 0x24);
- setPalColor( 3, 0x30, 0xE6, 0xC6);
- setPalColor( 4, 0xB4, 0x1A, 0xE2);
- setPalColor( 5, 0x1F, 0xD2, 0x1E);
- setPalColor( 6, 0x21, 0x1B, 0xAE);
- setPalColor( 7, 0xDF, 0xF6, 0x0A);
- setPalColor( 8, 0xB8, 0x41, 0x04);
- setPalColor( 9, 0x6A, 0x33, 0x04);
- setPalColor(10, 0xFE, 0x4A, 0x57);
- setPalColor(11, 0x42, 0x45, 0x40);
- setPalColor(12, 0x70, 0x74, 0x6F);
- setPalColor(13, 0x59, 0xFE, 0x59);
- setPalColor(14, 0x5F, 0x53, 0xFE);
- setPalColor(15, 0xA4, 0xA7, 0xA2);
-
- // Use 17 color table for v1 games to allow correct color for inventory and
- // sentence line. Original games used some kind of dynamic color table
- // remapping between rooms.
- setPalColor(16, 255, 85, 255);
-}
-
-void ScummEngine::setNESPalette() {
- setPalColor(0x00,0x00,0x00,0x00); // 0x1D
- setPalColor(0x01,0x00,0x24,0x92);
- setPalColor(0x02,0x00,0x00,0xDB);
- setPalColor(0x03,0x6D,0x49,0xDB);
- setPalColor(0x04,0x92,0x00,0x6D);
- setPalColor(0x05,0xB6,0x00,0x6D);
- setPalColor(0x06,0xB6,0x24,0x00);
- setPalColor(0x07,0x92,0x49,0x00);
- setPalColor(0x08,0x6D,0x49,0x00);
- setPalColor(0x09,0x24,0x49,0x00);
- setPalColor(0x0A,0x00,0x6D,0x24);
- setPalColor(0x0B,0x00,0x92,0x00);
- setPalColor(0x0C,0x00,0x49,0x49);
- setPalColor(0x0D,0x00,0x00,0x00);
- setPalColor(0x0E,0x00,0x00,0x00);
- setPalColor(0x0F,0x00,0x00,0x00);
-
- setPalColor(0x10,0xB6,0xB6,0xB6);
- setPalColor(0x11,0x00,0x6D,0xDB);
- setPalColor(0x12,0x00,0x49,0xFF);
- setPalColor(0x13,0x92,0x00,0xFF);
- setPalColor(0x14,0xB6,0x00,0xFF);
- setPalColor(0x15,0xFF,0x00,0x92);
- setPalColor(0x16,0xFF,0x00,0x00);
- setPalColor(0x17,0xDB,0x6D,0x00);
- setPalColor(0x18,0x92,0x6D,0x00);
- setPalColor(0x19,0x24,0x92,0x00);
- setPalColor(0x1A,0x00,0x92,0x00);
- setPalColor(0x1B,0x00,0xB6,0x6D);
- setPalColor(0x1C,0x00,0x92,0x92);
- setPalColor(0x1D,0x6D,0x6D,0x6D); // 0x00
- setPalColor(0x1E,0x00,0x00,0x00);
- setPalColor(0x1F,0x00,0x00,0x00);
-
- setPalColor(0x20,0xFF,0xFF,0xFF);
- setPalColor(0x21,0x6D,0xB6,0xFF);
- setPalColor(0x22,0x92,0x92,0xFF);
- setPalColor(0x23,0xDB,0x6D,0xFF);
- setPalColor(0x24,0xFF,0x00,0xFF);
- setPalColor(0x25,0xFF,0x6D,0xFF);
- setPalColor(0x26,0xFF,0x92,0x00);
- setPalColor(0x27,0xFF,0xB6,0x00);
- setPalColor(0x28,0xDB,0xDB,0x00);
- setPalColor(0x29,0x6D,0xDB,0x00);
- setPalColor(0x2A,0x00,0xFF,0x00);
- setPalColor(0x2B,0x49,0xFF,0xDB);
- setPalColor(0x2C,0x00,0xFF,0xFF);
- setPalColor(0x2D,0x49,0x49,0x49);
- setPalColor(0x2E,0x00,0x00,0x00);
- setPalColor(0x2F,0x00,0x00,0x00);
-
- setPalColor(0x30,0xFF,0xFF,0xFF);
- setPalColor(0x31,0xB6,0xDB,0xFF);
- setPalColor(0x32,0xDB,0xB6,0xFF);
- setPalColor(0x33,0xFF,0xB6,0xFF);
- setPalColor(0x34,0xFF,0x92,0xFF);
- setPalColor(0x35,0xFF,0xB6,0xB6);
- setPalColor(0x36,0xFF,0xDB,0x92);
- setPalColor(0x37,0xFF,0xFF,0x49);
- setPalColor(0x38,0xFF,0xFF,0x6D);
- setPalColor(0x39,0xB6,0xFF,0x49);
- setPalColor(0x3A,0x92,0xFF,0x6D);
- setPalColor(0x3B,0x49,0xFF,0xDB);
- setPalColor(0x3C,0x92,0xDB,0xFF);
- setPalColor(0x3D,0x92,0x92,0x92);
- setPalColor(0x3E,0x00,0x00,0x00);
- setPalColor(0x3F,0x00,0x00,0x00);
-}
-
-void ScummEngine::setAmigaPalette() {
- setPalColor( 0, 0, 0, 0);
- setPalColor( 1, 0, 0, 187);
- setPalColor( 2, 0, 187, 0);
- setPalColor( 3, 0, 187, 187);
- setPalColor( 4, 187, 0, 0);
- setPalColor( 5, 187, 0, 187);
- setPalColor( 6, 187, 119, 0);
- setPalColor( 7, 187, 187, 187);
- setPalColor( 8, 119, 119, 119);
- setPalColor( 9, 119, 119, 255);
- setPalColor(10, 0, 255, 0);
- setPalColor(11, 0, 255, 255);
- setPalColor(12, 255, 136, 136);
- setPalColor(13, 255, 0, 255);
- setPalColor(14, 255, 255, 0);
- setPalColor(15, 255, 255, 255);
-}
-
-void ScummEngine::setHercPalette() {
- setPalColor( 0, 0, 0, 0);
-
- if (_renderMode == Common::kRenderHercA)
- setPalColor( 1, 0xAE, 0x69, 0x38);
- else
- setPalColor( 1, 0x00, 0xFF, 0x00);
-
- // Setup cursor palette
- setPalColor( 7, 170, 170, 170);
- setPalColor( 8, 85, 85, 85);
- setPalColor(15, 255, 255, 255);
-}
-
-void ScummEngine::setCGAPalette() {
- setPalColor( 0, 0, 0, 0);
- setPalColor( 1, 0, 168, 168);
- setPalColor( 2, 168, 0, 168);
- setPalColor( 3, 168, 168, 168);
-
- // Setup cursor palette
- setPalColor( 7, 170, 170, 170);
- setPalColor( 8, 85, 85, 85);
- setPalColor(15, 255, 255, 255);
-}
-void ScummEngine::setEGAPalette() {
- setPalColor( 0, 0, 0, 0);
- setPalColor( 1, 0, 0, 170);
- setPalColor( 2, 0, 170, 0);
- setPalColor( 3, 0, 170, 170);
- setPalColor( 4, 170, 0, 0);
- setPalColor( 5, 170, 0, 170);
- setPalColor( 6, 170, 85, 0);
- setPalColor( 7, 170, 170, 170);
- setPalColor( 8, 85, 85, 85);
- setPalColor( 9, 85, 85, 255);
- setPalColor(10, 85, 255, 85);
- setPalColor(11, 85, 255, 255);
- setPalColor(12, 255, 85, 85);
- setPalColor(13, 255, 85, 255);
- setPalColor(14, 255, 255, 85);
- setPalColor(15, 255, 255, 255);
+ } else {
+ if ((_game.platform == Common::kPlatformAmiga) && _game.version == 4) {
+ // if rendermode is set to EGA we use the full palette from the resources
+ // else we initialise and then lock down the first 16 colors.
+ if (_renderMode != Common::kRenderEGA)
+ setPaletteFromTable(tableAmigaMIPalette, sizeof(tableAmigaMIPalette) / 3);
+ }
+ setDirtyColors(0, 255);
+ }
}
-void ScummEngine::setV1Palette() {
- setPalColor( 0, 0, 0, 0);
- setPalColor( 1, 255, 255, 255);
- setPalColor( 2, 170, 0, 0);
- setPalColor( 3, 0, 170, 170);
- setPalColor( 4, 170, 0, 170);
- setPalColor( 5, 0, 170, 0);
- setPalColor( 6, 0, 0, 170);
- setPalColor( 7, 255, 255, 85);
- setPalColor( 8, 255, 85, 85);
- setPalColor( 9, 170, 85, 0);
- setPalColor(10, 255, 85, 85);
- setPalColor(11, 85, 85, 85);
- setPalColor(12, 170, 170, 170);
- setPalColor(13, 85, 255, 85);
- setPalColor(14, 85, 85, 255);
-
- if (_game.id == GID_ZAK)
- setPalColor(15, 170, 170, 170);
- else
- setPalColor(15, 85, 85, 85);
-
- setPalColor(16, 255, 85, 255);
+void ScummEngine::setPaletteFromTable(const byte *ptr, int numcolor, int index) {
+ for ( ; numcolor > 0; --numcolor, ++index, ptr += 3)
+ setPalColor( index, ptr[0], ptr[1], ptr[2]);
}
void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
+ int firstIndex = 0;
int i;
byte *dest, r, g, b;
@@ -298,7 +223,14 @@ void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
dest = _currentPalette;
- for (i = 0; i < numcolor; i++) {
+ // Test for Amiga Monkey Island and EGA Mode unset, if true then skip the first 16 colors.
+ if ((_game.platform == Common::kPlatformAmiga) && _game.version == 4 && _renderMode != Common::kRenderEGA) {
+ firstIndex = 16;
+ dest += 3 * 16;
+ ptr += 3 * 16;
+ }
+
+ for (i = firstIndex; i < numcolor; i++) {
r = *ptr++;
g = *ptr++;
b = *ptr++;
@@ -323,7 +255,7 @@ void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
memcpy(_darkenPalette, _currentPalette, 768);
}
- setDirtyColors(0, numcolor - 1);
+ setDirtyColors(firstIndex, numcolor - 1);
}
void ScummEngine::setDirtyColors(int min, int max) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9f3ebb8053..af6b9278c6 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -499,7 +499,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
case Common::kRenderCGA:
case Common::kRenderEGA:
case Common::kRenderAmiga:
- if ((_game.version >= 4 && !(_game.features & GF_16COLOR)) || (_game.features & GF_OLD256))
+ if ((_game.version >= 4 && !(_game.features & GF_16COLOR)
+ && !(_game.platform == Common::kPlatformAmiga && _renderMode == Common::kRenderEGA))
+ || (_game.features & GF_OLD256))
_renderMode = Common::kRenderDefault;
break;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 7d2bf3336a..6866b17668 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1029,14 +1029,7 @@ protected:
const byte *getPalettePtr(int palindex, int room);
- void setC64Palette();
- void setNESPalette();
- void setAmigaPalette();
- void setHercPalette();
- void setCGAPalette();
- void setEGAPalette();
- void setV1Palette();
-
+ void setPaletteFromTable(const byte *ptr, int numcolor, int firstIndex = 0);
void resetPalette();
void setCurrentPalette(int pal);
--
cgit v1.2.3
From 54ef7a892ba9460c21fdb7bb5cc72fedc9d4b8cd Mon Sep 17 00:00:00 2001
From: Norbert Lange
Date: Mon, 24 Aug 2009 13:08:21 +0000
Subject: reverting changes from patch 43696 that shouldnt have been committed
svn-id: r43697
---
common/endian.h | 302 ++++++++++++++-------------------------------
common/stream.h | 101 +++++++--------
engines/saga/animation.cpp | 4 +-
3 files changed, 138 insertions(+), 269 deletions(-)
diff --git a/common/endian.h b/common/endian.h
index 2e52af139b..c889371a2f 100644
--- a/common/endian.h
+++ b/common/endian.h
@@ -32,47 +32,23 @@
// Endian conversion functions, macros etc., follow from here!
//
-// Sanity check
-#if !defined(SCUMM_LITTLE_ENDIAN) && !defined(SCUMM_BIG_ENDIAN)
-# error No endianness defined
-#endif
-
/**
* Swap the bytes in a 32 bit word in order to convert LE encoded data to BE
* and vice versa.
- * compilerspecific variants come first, fallback last
*/
-
-// Test for GCC >= 4.3.0 as this version added the bswap builtin
-#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-
- FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) {
- return __builtin_bswap32(a);
- }
-
-// test for MSVC 7 or newer
-#elif defined(_MSC_VER) && _MSC_VER >= 1300
-
- FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) {
- return _byteswap_ulong(a);
- }
-
-// generic fallback
-#else
-
- inline uint32 SWAP_BYTES_32(uint32 a) {
- const uint16 low = (uint16)a, high = (uint16)(a >> 16);
- return ((uint32)(uint16)((low >> 8) | (low << 8)) << 16)
- | (uint16)((high >> 8) | (high << 8));
- }
-#endif
+FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) {
+ return ((a >> 24) & 0x000000FF) |
+ ((a >> 8) & 0x0000FF00) |
+ ((a << 8) & 0x00FF0000) |
+ ((a << 24) & 0xFF000000);
+}
/**
* Swap the bytes in a 16 bit word in order to convert LE encoded data to BE
* and vice versa.
*/
-FORCEINLINE uint16 SWAP_BYTES_16(const uint16 a) {
- return (a >> 8) | (a << 8);
+FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) {
+ return ((a >> 8) & 0x00FF) + ((a << 8) & 0xFF00);
}
@@ -94,123 +70,25 @@ FORCEINLINE uint16 SWAP_BYTES_16(const uint16 a) {
* For the latter systems we provide the INVERSE_MKID override.
*/
#if defined(INVERSE_MKID)
-#define MKID_BE(a) ((uint32)( \
- (((a) >> 24) & 0x00FF) | \
- (((a) >> 8) & 0xFF00) | \
- (((a) & 0xFF00) << 8) | \
- (((a) & 0x00FF) << 24) ))
+#define MKID_BE(a) ((uint32) \
+ (((a) >> 24) & 0x000000FF) | \
+ (((a) >> 8) & 0x0000FF00) | \
+ (((a) << 8) & 0x00FF0000) | \
+ (((a) << 24) & 0xFF000000))
#else
# define MKID_BE(a) ((uint32)(a))
#endif
-// Functions for reading/writing native Integers,
-// this transparently handles the need for alignment
-
-#if !defined(SCUMM_NEED_ALIGNMENT)
-
- FORCEINLINE uint16 READ_UINT16(const void *ptr) {
- return *(const uint16 *)(ptr);
- }
-
- FORCEINLINE uint32 READ_UINT32(const void *ptr) {
- return *(const uint32 *)(ptr);
- }
-
- FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
- *(uint16 *)(ptr) = value;
- }
-
- FORCEINLINE void WRITE_UINT32(void *ptr, uint32 value) {
- *(uint32 *)(ptr) = value;
- }
-
-// test for GCC >= 4.0. these implementations will automatically use CPU-specific
-// instructions for unaligned data when they are available (eg. MIPS)
-#elif defined(__GNUC__) && (__GNUC__ >= 4)
-
- FORCEINLINE uint16 READ_UINT16(const void *ptr) {
- struct Unaligned16 { uint16 val; } __attribute__ ((__packed__));
- return ((const Unaligned16 *)ptr)->val;
- }
-
- FORCEINLINE uint32 READ_UINT32(const void *ptr) {
- struct Unaligned32 { uint32 val; } __attribute__ ((__packed__));
- return ((const Unaligned32 *)ptr)->val;
- }
-
- FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
- struct Unaligned16 { uint16 val; } __attribute__ ((__packed__));
- ((Unaligned16 *)ptr)->val = value;
- }
-
- FORCEINLINE void WRITE_UINT32(void *ptr, uint32 value) {
- struct Unaligned32 { uint32 val; } __attribute__ ((__packed__));
- ((Unaligned32 *)ptr)->val = value;
- }
-
-// use software fallback by loading each byte explicitely
-#else
-
-# if defined(SCUMM_LITTLE_ENDIAN)
-
- FORCEINLINE uint16 READ_UINT16(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[1] << 8) | b[0];
- }
- inline uint32 READ_UINT32(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | (b[0]);
- }
- FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 0);
- b[1] = (uint8)(value >> 8);
- }
- inline void WRITE_UINT32(void *ptr, uint32 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 0);
- b[1] = (uint8)(value >> 8);
- b[2] = (uint8)(value >> 16);
- b[3] = (uint8)(value >> 24);
- }
-
-# elif defined(SCUMM_BIG_ENDIAN)
-
- FORCEINLINE uint16 READ_UINT16(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[0] << 8) | b[1];
- }
- inline uint32 READ_UINT32(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
- }
- FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 8);
- b[1] = (uint8)(value >> 0);
- }
- inline void WRITE_UINT32(void *ptr, uint32 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 24);
- b[1] = (uint8)(value >> 16);
- b[2] = (uint8)(value >> 8);
- b[3] = (uint8)(value >> 0);
- }
-
-# endif
-#endif
-
-// Map Funtions for reading/writing BE/LE integers depending on native endianess
#if defined(SCUMM_LITTLE_ENDIAN)
- #define READ_LE_UINT16(a) READ_UINT16(a)
- #define READ_LE_UINT32(a) READ_UINT32(a)
+ #define READ_UINT16(a) READ_LE_UINT16(a)
+ #define READ_UINT32(a) READ_LE_UINT32(a)
- #define WRITE_LE_UINT16(a, v) WRITE_UINT16(a, v)
- #define WRITE_LE_UINT32(a, v) WRITE_UINT32(a, v)
+ #define WRITE_UINT16(a, v) WRITE_LE_UINT16(a, v)
+ #define WRITE_UINT32(a, v) WRITE_LE_UINT32(a, v)
#define FROM_LE_32(a) ((uint32)(a))
#define FROM_LE_16(a) ((uint16)(a))
@@ -224,57 +102,16 @@ FORCEINLINE uint16 SWAP_BYTES_16(const uint16 a) {
#define TO_BE_32(a) SWAP_BYTES_32(a)
#define TO_BE_16(a) SWAP_BYTES_16(a)
-# if defined(SCUMM_NEED_ALIGNMENT)
-
- FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[0] << 8) | b[1];
- }
- inline uint32 READ_BE_UINT32(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
- }
- FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 8);
- b[1] = (uint8)(value >> 0);
- }
- inline void WRITE_BE_UINT32(void *ptr, uint32 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 24);
- b[1] = (uint8)(value >> 16);
- b[2] = (uint8)(value >> 8);
- b[3] = (uint8)(value >> 0);
- }
-# else
-
- FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
- return SWAP_BYTES_16(*(const uint16 *)ptr);
- }
- FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
- return SWAP_BYTES_32(*(const uint32 *)ptr);
- }
- FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
- *(uint16 *)ptr = SWAP_BYTES_16(value);
- }
- FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
- *(uint32 *)ptr = SWAP_BYTES_32(value);
- }
-
-# endif // if defined(SCUMM_NEED_ALIGNMENT)
-
#elif defined(SCUMM_BIG_ENDIAN)
- // I thought this would be compiler-specific and not dependent
- // on endianess after the comments above?
#define MKID(a) ((uint32)(a))
#define MKID_BE(a) ((uint32)(a))
- #define READ_BE_UINT16(a) READ_UINT16(a)
- #define READ_BE_UINT32(a) READ_UINT32(a)
+ #define READ_UINT16(a) READ_BE_UINT16(a)
+ #define READ_UINT32(a) READ_BE_UINT32(a)
- #define WRITE_BE_UINT16(a, v) WRITE_UINT16(a, v)
- #define WRITE_BE_UINT32(a, v) WRITE_UINT32(a, v)
+ #define WRITE_UINT16(a, v) WRITE_BE_UINT16(a, v)
+ #define WRITE_UINT32(a, v) WRITE_BE_UINT32(a, v)
#define FROM_LE_32(a) SWAP_BYTES_32(a)
#define FROM_LE_16(a) SWAP_BYTES_16(a)
@@ -288,55 +125,96 @@ FORCEINLINE uint16 SWAP_BYTES_16(const uint16 a) {
#define TO_BE_32(a) ((uint32)(a))
#define TO_BE_16(a) ((uint16)(a))
-# if defined(SCUMM_NEED_ALIGNMENT)
+#else
+
+ #error No endianness defined
+
+
+#endif
+
+#if defined(SCUMM_NEED_ALIGNMENT) || !defined(SCUMM_LITTLE_ENDIAN)
FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[1] << 8) | b[0];
+ const byte *b = (const byte *)ptr;
+ return (b[1] << 8) + b[0];
}
- inline uint32 READ_LE_UINT32(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | (b[0]);
+ FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
+ const byte *b = (const byte *)ptr;
+ return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
}
FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 0);
- b[1] = (uint8)(value >> 8);
+ byte *b = (byte *)ptr;
+ b[0] = (byte)(value >> 0);
+ b[1] = (byte)(value >> 8);
}
- inline void WRITE_LE_UINT32(void *ptr, uint32 value) {
- uint8 *b = (uint8 *)ptr;
- b[0] = (uint8)(value >> 0);
- b[1] = (uint8)(value >> 8);
- b[2] = (uint8)(value >> 16);
- b[3] = (uint8)(value >> 24);
+ FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
+ byte *b = (byte *)ptr;
+ b[0] = (byte)(value >> 0);
+ b[1] = (byte)(value >> 8);
+ b[2] = (byte)(value >> 16);
+ b[3] = (byte)(value >> 24);
}
-# else
-
+#else
FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
- return SWAP_BYTES_16(*(const uint16 *)ptr);
+ return *(const uint16 *)(ptr);
}
FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
- return SWAP_BYTES_32(*(const uint32 *)ptr);
+ return *(const uint32 *)(ptr);
}
FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
- *(uint16 *)ptr = SWAP_BYTES_16(value);
+ *(uint16 *)(ptr) = value;
}
FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
- *(uint32 *)ptr = SWAP_BYTES_32(value);
+ *(uint32 *)(ptr) = value;
}
-
-# endif // if defined(SCUMM_NEED_ALIGNMENT)
+#endif
+
-#endif // if defined(SCUMM_LITTLE_ENDIAN)
+#if defined(SCUMM_NEED_ALIGNMENT) || !defined(SCUMM_BIG_ENDIAN)
+ FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+ const byte *b = (const byte *)ptr;
+ return (b[0] << 8) + b[1];
+ }
+ FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
+ const byte *b = (const byte*)ptr;
+ return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
+ }
+ FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+ byte *b = (byte *)ptr;
+ b[0] = (byte)(value >> 8);
+ b[1] = (byte)(value >> 0);
+ }
+ FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
+ byte *b = (byte *)ptr;
+ b[0] = (byte)(value >> 24);
+ b[1] = (byte)(value >> 16);
+ b[2] = (byte)(value >> 8);
+ b[3] = (byte)(value >> 0);
+ }
+#else
+ FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+ return *(const uint16 *)(ptr);
+ }
+ FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
+ return *(const uint32 *)(ptr);
+ }
+ FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+ *(uint16 *)(ptr) = value;
+ }
+ FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
+ *(uint32 *)(ptr) = value;
+ }
+#endif
FORCEINLINE uint32 READ_LE_UINT24(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[2] << 16) | (b[1] << 8) | (b[0]);
+ const byte *b = (const byte *)ptr;
+ return (b[2] << 16) + (b[1] << 8) + (b[0]);
}
FORCEINLINE uint32 READ_BE_UINT24(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[0] << 16) | (b[1] << 8) | (b[2]);
+ const byte *b = (const byte*)ptr;
+ return (b[0] << 16) + (b[1] << 8) + (b[2]);
}
+
#endif
diff --git a/common/stream.h b/common/stream.h
index 9475f6fa2d..86e8e71134 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -27,7 +27,6 @@
#define COMMON_STREAM_H
#include "common/scummsys.h"
-#include "common/endian.h"
namespace Common {
@@ -107,38 +106,38 @@ public:
}
void writeUint16LE(uint16 value) {
- value = TO_LE_16(value);
- write(&value, 2);
+ writeByte((byte)(value & 0xff));
+ writeByte((byte)(value >> 8));
}
void writeUint32LE(uint32 value) {
- value = TO_LE_32(value);
- write(&value, 4);
+ writeUint16LE((uint16)(value & 0xffff));
+ writeUint16LE((uint16)(value >> 16));
}
void writeUint16BE(uint16 value) {
- value = TO_BE_16(value);
- write(&value, 2);
+ writeByte((byte)(value >> 8));
+ writeByte((byte)(value & 0xff));
}
void writeUint32BE(uint32 value) {
- value = TO_BE_32(value);
- write(&value, 4);
+ writeUint16BE((uint16)(value >> 16));
+ writeUint16BE((uint16)(value & 0xffff));
}
- FORCEINLINE void writeSint16LE(int16 value) {
+ void writeSint16LE(int16 value) {
writeUint16LE((uint16)value);
}
- FORCEINLINE void writeSint32LE(int32 value) {
+ void writeSint32LE(int32 value) {
writeUint32LE((uint32)value);
}
- FORCEINLINE void writeSint16BE(int16 value) {
+ void writeSint16BE(int16 value) {
writeUint16BE((uint16)value);
}
- FORCEINLINE void writeSint32BE(int32 value) {
+ void writeSint32BE(int32 value) {
writeUint32BE((uint32)value);
}
@@ -189,7 +188,7 @@ public:
* calling err() and eos() ).
*/
byte readByte() {
- byte b = 0; // FIXME: remove initialisation
+ byte b = 0;
read(&b, 1);
return b;
}
@@ -201,7 +200,7 @@ public:
* calling err() and eos() ).
*/
int8 readSByte() {
- int8 b = 0; // FIXME: remove initialisation
+ int8 b = 0;
read(&b, 1);
return b;
}
@@ -214,9 +213,9 @@ public:
* calling err() and eos() ).
*/
uint16 readUint16LE() {
- uint16 val;
- read(&val, 2);
- return FROM_LE_16(val);
+ uint16 a = readByte();
+ uint16 b = readByte();
+ return a | (b << 8);
}
/**
@@ -227,9 +226,9 @@ public:
* calling err() and eos() ).
*/
uint32 readUint32LE() {
- uint32 val;
- read(&val, 4);
- return FROM_LE_32(val);
+ uint32 a = readUint16LE();
+ uint32 b = readUint16LE();
+ return (b << 16) | a;
}
/**
@@ -240,9 +239,9 @@ public:
* calling err() and eos() ).
*/
uint16 readUint16BE() {
- uint16 val;
- read(&val, 2);
- return FROM_BE_16(val);
+ uint16 b = readByte();
+ uint16 a = readByte();
+ return a | (b << 8);
}
/**
@@ -253,9 +252,9 @@ public:
* calling err() and eos() ).
*/
uint32 readUint32BE() {
- uint32 val;
- read(&val, 4);
- return FROM_BE_32(val);
+ uint32 b = readUint16BE();
+ uint32 a = readUint16BE();
+ return (b << 16) | a;
}
/**
@@ -265,7 +264,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- FORCEINLINE int16 readSint16LE() {
+ int16 readSint16LE() {
return (int16)readUint16LE();
}
@@ -276,7 +275,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- FORCEINLINE int32 readSint32LE() {
+ int32 readSint32LE() {
return (int32)readUint32LE();
}
@@ -287,7 +286,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- FORCEINLINE int16 readSint16BE() {
+ int16 readSint16BE() {
return (int16)readUint16BE();
}
@@ -298,7 +297,7 @@ public:
* if a read error occurred (for which client code can check by
* calling err() and eos() ).
*/
- FORCEINLINE int32 readSint32BE() {
+ int32 readSint32BE() {
return (int32)readUint32BE();
}
@@ -461,31 +460,26 @@ public:
* @see SubReadStream
*/
class SeekableSubReadStreamEndian : public SeekableSubReadStream {
-private:
- const bool _bigEndian;
-
public:
+ bool _bigEndian;
+
SeekableSubReadStreamEndian(SeekableReadStream *parentStream, uint32 begin, uint32 end, bool bigEndian = false, bool disposeParentStream = false)
: SeekableSubReadStream(parentStream, begin, end, disposeParentStream), _bigEndian(bigEndian) {
}
- uint16 readUint16() {
- uint16 val;
- read(&val, 2);
- return (_bigEndian) ? TO_BE_16(val) : TO_LE_16(val);
+ inline uint16 readUint16() {
+ return (_bigEndian) ? readUint16BE() : readUint16LE();
}
- uint32 readUint32() {
- uint32 val;
- read(&val, 4);
- return (_bigEndian) ? TO_BE_32(val) : TO_LE_32(val);
+ inline uint32 readUint32() {
+ return (_bigEndian) ? readUint32BE() : readUint32LE();
}
- FORCEINLINE int16 readSint16() {
+ inline int16 readSint16() {
return (int16)readUint16();
}
- FORCEINLINE int32 readSint32() {
+ inline int32 readSint32() {
return (int32)readUint32();
}
};
@@ -588,28 +582,23 @@ public:
*/
class MemoryReadStreamEndian : public Common::MemoryReadStream {
private:
- const bool _bigEndian;
-
public:
+ bool _bigEndian;
MemoryReadStreamEndian(const byte *buf, uint32 len, bool bigEndian = false) : MemoryReadStream(buf, len), _bigEndian(bigEndian) {}
- uint16 readUint16() {
- uint16 val;
- read(&val, 2);
- return (_bigEndian) ? TO_BE_16(val) : TO_LE_16(val);
+ inline uint16 readUint16() {
+ return (_bigEndian) ? readUint16BE() : readUint16LE();
}
- uint32 readUint32() {
- uint32 val;
- read(&val, 4);
- return (_bigEndian) ? TO_BE_32(val) : TO_LE_32(val);
+ inline uint32 readUint32() {
+ return (_bigEndian) ? readUint32BE() : readUint32LE();
}
- FORCEINLINE int16 readSint16() {
+ inline int16 readSint16() {
return (int16)readUint16();
}
- FORCEINLINE int32 readSint32() {
+ inline int32 readSint32() {
return (int32)readUint32();
}
};
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 95a850cfe2..0d298bf96a 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -826,10 +826,12 @@ int Anim::fillFrameOffsets(AnimationData *anim, bool reallyFill) {
int i;
bool longData = isLongData();
- MemoryReadStreamEndian readS(anim->resourceData, anim->resourceLength, !_vm->isBigEndian()); // RLE has inversion BE<>LE
+ MemoryReadStreamEndian readS(anim->resourceData, anim->resourceLength, _vm->isBigEndian());
readS.seek(12);
+ readS._bigEndian = !_vm->isBigEndian(); // RLE has inversion BE<>LE
+
while (readS.pos() != readS.size()) {
if (reallyFill) {
anim->frameOffsets[currentFrame] = readS.pos();
--
cgit v1.2.3
From 56189652821ee3248cf931b3e2500766082caab9 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 24 Aug 2009 13:47:38 +0000
Subject: More work on the fallback detector: added detection of CD games and
prevented a crash when detecting a SCI32 game if SCI32 isn't compiled in
svn-id: r43698
---
engines/sci/detection.cpp | 55 +++++++++++++++++++++++++++++++++++++++--------
1 file changed, 46 insertions(+), 9 deletions(-)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 55ea8ee00a..7f2a3ff705 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -261,6 +261,13 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
bool foundRes000 = false;
Common::Platform exePlatform = Common::kPlatformUnknown;
+ // Set some defaults
+ s_fallbackDesc.desc.extra = "";
+ s_fallbackDesc.desc.language = Common::UNK_LANG;
+ s_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
+ s_fallbackDesc.desc.platform = Common::kPlatformUnknown;
+ s_fallbackDesc.desc.gameid = "sci";
+
// First grab all filenames
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
if (file->isDirectory())
@@ -286,6 +293,28 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
foundResMap = true;
}
+ // Determine if we got a CD version and set the CD flag accordingly, by checking for
+ // resource.aud. We assume that the file should be over 10MB, as it contains all the
+ // game speech and is usually around 450MB+. The size check is for some floppy game
+ // versions like KQ6 floppy, which also have a small resource.aud file
+ if (filename.contains("resource.aud")) {
+ Common::SeekableReadStream *tmpStream = file->createReadStream();
+ if (tmpStream->size() > 10 * 1024 * 1024) {
+ // We got a CD version, so set the CD flag accordingly
+ s_fallbackDesc.desc.flags |= ADGF_CD;
+ s_fallbackDesc.desc.extra = "CD";
+ }
+ delete tmpStream;
+ }
+
+ // Check if we got a map file for older SCI1 CD versions (like KQ5CD)
+ // It's named like "audioXXX.map"
+ if (filename.contains("audio") && filename.contains(".map")) {
+ // We got a CD version, so set the CD flag accordingly
+ s_fallbackDesc.desc.flags |= ADGF_CD;
+ s_fallbackDesc.desc.extra = "CD";
+ }
+
if (filename.contains("resource.000") || filename.contains("resource.001")
|| filename.contains("ressci.000") || filename.contains("ressci.001"))
foundRes000 = true;
@@ -313,14 +342,27 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
ResourceManager *resMgr = new ResourceManager(fslist);
SciVersion version = resMgr->sciVersion();
+ ViewType gameViews = resMgr->getViewType();
+
+ // Have we identified the game views? If not, stop here
+ if (gameViews == kViewUnknown) {
+ SearchMan.remove("SCI_detection");
+ return (const ADGameDescription *)&s_fallbackDesc;
+ }
+
+#ifndef ENABLE_SCI32
+ // Is SCI32 compiled in? If not, and this is a SCI32 game,
+ // stop here
+ if (resMgr->sciVersion() == SCI_VERSION_32) {
+ SearchMan.remove("SCI_detection");
+ return (const ADGameDescription *)&s_fallbackDesc;
+ }
+#endif
+
SegManager *segManager = new SegManager(resMgr, version);
- // Set some defaults
- s_fallbackDesc.desc.extra = "";
- s_fallbackDesc.desc.language = Common::UNK_LANG;
if (exePlatform == Common::kPlatformUnknown) {
// Try to determine the platform from game resources
- ViewType gameViews = resMgr->getViewType();
if (gameViews == kViewEga || gameViews == kViewVga ||
gameViews == kViewVga11) {
// Must be PC or Mac, set to PC for now
@@ -337,7 +379,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
}
s_fallbackDesc.desc.platform = exePlatform;
- s_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
// Determine the game id
if (!script_instantiate(resMgr, segManager, version, 0)) {
@@ -355,10 +396,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
delete segManager;
delete resMgr;
- printf("If this is *NOT* a fan-modified version (in particular, not a fan-made\n");
- printf("translation), please, report the data above, including the following\n");
- printf("version number, from the game's executable:\n");
-
SearchMan.remove("SCI_detection");
return (const ADGameDescription *)&s_fallbackDesc;
--
cgit v1.2.3
From f7b7b494f95a46808eab570c99d40b2626673b34 Mon Sep 17 00:00:00 2001
From: Filippos Karapetis
Date: Mon, 24 Aug 2009 14:00:29 +0000
Subject: Show if a game is using EGA graphics or not in the detected entry
svn-id: r43699
---
engines/sci/detection.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 7f2a3ff705..ef229c8a19 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -359,6 +359,10 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
}
#endif
+ // EGA views
+ if (gameViews == kViewEga)
+ s_fallbackDesc.desc.extra = "EGA";
+
SegManager *segManager = new SegManager(resMgr, version);
if (exePlatform == Common::kPlatformUnknown) {
--
cgit v1.2.3
From dd7868acc2512c9761d892e67a4837f4dc38bdc0 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 24 Aug 2009 16:07:46 +0000
Subject: - Change shorten.h guard to match the sjis.h guard. - Also enable
shorten code when the build includes support for dynamic engine plugins.
svn-id: r43700
---
sound/shorten.h | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/sound/shorten.h b/sound/shorten.h
index c2a40280d3..bc9f229687 100644
--- a/sound/shorten.h
+++ b/sound/shorten.h
@@ -23,13 +23,15 @@
*
*/
-// The code in this file is currently only used in SAGA2 (in the
-// SAGA engine), so if that engine isn't enabled, we will skip
-// compiling it. If you plan to use this code in another engine,
-// you will have to add the proper define check here.
-// Also please add the define check at the comment after the
-// matching #endif further down this file.
-#if defined(ENABLE_SAGA2)
+// The code in this file is currently only used in SAGA2.
+// So when it is disabled, we will skip compiling it.
+// We also enable this code for ScummVM builds including support
+// for dynamic engine plugins.
+// If you plan to use this code in another engine, you will have
+// to add the proper define check here.
+#if !(defined(ENABLE_SAGA2) || defined(DYNAMIC_MODULES))
+
+#else
#ifndef SOUND_SHORTEN_H
#define SOUND_SHORTEN_H
@@ -48,7 +50,7 @@ class AudioStream;
* start of the audio data, and size, rate and flags contain information
* necessary for playback.
*/
-extern byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, byte &flags);
+byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, byte &flags);
/**
* Try to load a Shorten file from the given stream and create an AudioStream
@@ -62,6 +64,5 @@ AudioStream *makeShortenStream(Common::ReadStream &stream);
#endif
-#endif // defined(ENABLE_SAGA2)
-
+#endif // engine and dynamic plugins guard
--
cgit v1.2.3