aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-04-20 19:59:18 +0000
committerMax Horn2005-04-20 19:59:18 +0000
commitd2624d8e08d1868c7f8f9b9becc46d10784024c0 (patch)
tree903f70ec799f8e275f003a8ef45d46f9968dc753
parent89c0e7a69cbfe630cce2bfe9078a49abdff8e4ef (diff)
downloadscummvm-rg350-d2624d8e08d1868c7f8f9b9becc46d10784024c0.tar.gz
scummvm-rg350-d2624d8e08d1868c7f8f9b9becc46d10784024c0.tar.bz2
scummvm-rg350-d2624d8e08d1868c7f8f9b9becc46d10784024c0.zip
cleanup
svn-id: r17718
-rw-r--r--scumm/gfx.cpp27
-rw-r--r--scumm/input.cpp4
-rw-r--r--scumm/scumm.cpp8
-rw-r--r--scumm/scumm.h5
-rw-r--r--scumm/smush/smush_font.cpp10
-rw-r--r--scumm/smush/smush_font.h2
-rw-r--r--scumm/smush/smush_player.cpp12
7 files changed, 33 insertions, 35 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 34ceca3e78..7bd5660048 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1270,11 +1270,12 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
if (_vm->_features & GF_SMALL_HEADER) {
if (_vm->_features & GF_16COLOR)
zplane_list[1] = ptr + READ_LE_UINT16(ptr);
- else
+ else {
zplane_list[1] = ptr + READ_LE_UINT32(ptr);
- if (_vm->_features & GF_OLD256) {
- if (0 == READ_LE_UINT32(zplane_list[1]))
- zplane_list[1] = 0;
+ if (_vm->_features & GF_OLD256) {
+ if (0 == READ_LE_UINT32(zplane_list[1]))
+ zplane_list[1] = 0;
+ }
}
for (i = 2; i < numzbuf; i++) {
zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]);
@@ -2582,19 +2583,13 @@ void Gdi::unkDecode7(byte *dst, int dstPitch, const byte *src, int height) const
*dst = *src++;
NEXT_ROW;
}
- return;
+ } else {
+ do {
+ memcpy(dst, src, 8);
+ dst += dstPitch;
+ src += 8;
+ } while (--height);
}
-
- do {
-#if defined(SCUMM_NEED_ALIGNMENT)
- memcpy(dst, src, 8);
-#else
- ((uint32 *)dst)[0] = ((const uint32 *)src)[0];
- ((uint32 *)dst)[1] = ((const uint32 *)src)[1];
-#endif
- dst += dstPitch;
- src += 8;
- } while (--height);
}
void Gdi::unkDecode8(byte *dst, int dstPitch, const byte *src, int height) const {
diff --git a/scumm/input.cpp b/scumm/input.cpp
index 666bfe9084..b9ac0abb92 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -35,6 +35,10 @@
#include "scumm/scumm.h"
#include "scumm/sound.h"
+#ifdef _WIN32_WCE
+#define KEY_ALL_SKIP 3457
+#endif
+
namespace Scumm {
enum MouseButtonStatus {
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index f2b31a4bb5..adfa75654d 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -104,13 +104,13 @@ static const ScummGameSettings scumm_settings[] = {
/* Scumm Version 2 */
{"maniac", "Maniac Mansion", GID_MANIAC, 2, 0, 25, MDT_PCSPK,
- GF_SMALL_HEADER | GF_USE_KEY | GF_16COLOR | GF_OLD_BUNDLE | GF_NO_SCALING | GF_MULTIPLE_VERSIONS, Common::kPlatformUnknown, 0, 0},
+ GF_SMALL_HEADER | GF_NO_SCALING | GF_16COLOR | GF_USE_KEY | GF_OLD_BUNDLE | GF_MULTIPLE_VERSIONS, Common::kPlatformUnknown, 0, 0},
{"zak", "Zak McKracken and the Alien Mindbenders", GID_ZAK, 2, 0, 13, MDT_PCSPK,
- GF_SMALL_HEADER | GF_USE_KEY | GF_16COLOR | GF_OLD_BUNDLE | GF_NO_SCALING | GF_MULTIPLE_VERSIONS, Common::kPlatformUnknown, 0, 0},
+ GF_SMALL_HEADER | GF_NO_SCALING | GF_16COLOR | GF_USE_KEY | GF_OLD_BUNDLE | GF_MULTIPLE_VERSIONS, Common::kPlatformUnknown, 0, 0},
/* Scumm Version 3 */
{"indy3EGA", "Indiana Jones and the Last Crusade", GID_INDY3, 3, 0, 13, MDT_PCSPK | MDT_ADLIB,
- GF_SMALL_HEADER | GF_NO_SCALING | GF_USE_KEY | GF_16COLOR | GF_OLD_BUNDLE, Common::kPlatformUnknown, 0, 0},
+ GF_SMALL_HEADER | GF_NO_SCALING | GF_16COLOR | GF_USE_KEY | GF_OLD_BUNDLE, Common::kPlatformUnknown, 0, 0},
{"indy3Towns", "Indiana Jones and the Last Crusade (FM-TOWNS)", GID_INDY3, 3, 0, 13, MDT_TOWNS,
GF_SMALL_HEADER | GF_NO_SCALING | GF_OLD256 | GF_FEW_LOCALS | GF_AUDIOTRACKS, Common::kPlatformFMTowns, 0, 0},
{"indy3", "Indiana Jones and the Last Crusade (256)", GID_INDY3, 3, 0, 13, MDT_PCSPK | MDT_ADLIB,
@@ -119,7 +119,7 @@ static const ScummGameSettings scumm_settings[] = {
{"zakTowns", "Zak McKracken and the Alien Mindbenders (FM-TOWNS)", GID_ZAK256, 3, 0, 13, MDT_TOWNS,
GF_SMALL_HEADER | GF_NO_SCALING | GF_OLD256 | GF_AUDIOTRACKS, Common::kPlatformFMTowns, 0, 0},
{"loom", "Loom", GID_LOOM, 3, 0, 13, MDT_PCSPK | MDT_ADLIB | MDT_NATIVE,
- GF_SMALL_HEADER | GF_NO_SCALING | GF_USE_KEY | GF_16COLOR | GF_OLD_BUNDLE, Common::kPlatformUnknown, 0, 0},
+ GF_SMALL_HEADER | GF_NO_SCALING | GF_16COLOR | GF_USE_KEY | GF_OLD_BUNDLE, Common::kPlatformUnknown, 0, 0},
{"loomTowns", "Loom (FM Towns)", GID_LOOM, 3, 0, 13, MDT_TOWNS,
GF_SMALL_HEADER | GF_NO_SCALING | GF_OLD256 | GF_AUDIOTRACKS, Common::kPlatformFMTowns, 0, 0},
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 64b144e1a2..4bd97252b7 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -68,8 +68,7 @@ extern ScummEngine *g_scumm;
/* System Wide Constants */
enum {
NUM_SENTENCE = 6,
- NUM_SHADOW_PALETTE = 8,
- KEY_ALL_SKIP = 3457 // WinCE
+ NUM_SHADOW_PALETTE = 8
};
/**
@@ -99,7 +98,7 @@ enum GameFeatures {
/** EGA games. */
GF_16COLOR = 1 << 7,
- /** VGA versions of V3 games. */
+ /** VGA versions of V3 games. Equivalent to (version == 3 && not GF_16COLOR) */
GF_OLD256 = 1 << 8,
/** Games which have Audio CD tracks. */
diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp
index 4b71700b36..914691f84a 100644
--- a/scumm/smush/smush_font.cpp
+++ b/scumm/smush/smush_font.cpp
@@ -28,8 +28,8 @@
namespace Scumm {
-SmushFont::SmushFont(bool use_original_colors, bool new_colors) :
- NutRenderer(g_scumm), // FIXME: evil hack
+SmushFont::SmushFont(ScummEngine *vm, bool use_original_colors, bool new_colors) :
+ NutRenderer(vm),
_color(-1),
_new_colors(new_colors),
_original(use_original_colors) {
@@ -44,8 +44,8 @@ int SmushFont::getStringWidth(const char *str) {
int width = 0;
while (*str) {
- if(*str & 0x80 && g_scumm->_useCJKMode) {
- width += g_scumm->_2byteWidth + 1;
+ if(*str & 0x80 && _vm->_useCJKMode) {
+ width += _vm->_2byteWidth + 1;
str += 2;
} else
width += getCharWidth(*str++);
@@ -131,7 +131,7 @@ int SmushFont::draw2byte(byte *buffer, int dst_width, int x, int y, int idx) {
if (_new_colors)
color = (char)0xff;
- if (g_scumm->_gameId == GID_FT)
+ if (_vm->_gameId == GID_FT)
color = 1;
for (int j = 0; j < h; j++) {
diff --git a/scumm/smush/smush_font.h b/scumm/smush/smush_font.h
index aa609a69f0..3cb0c4d19f 100644
--- a/scumm/smush/smush_font.h
+++ b/scumm/smush/smush_font.h
@@ -41,7 +41,7 @@ protected:
void drawSubstring(const char *str, byte *buffer, int dst_width, int x, int y);
public:
- SmushFont(bool use_original_colors, bool new_colors);
+ SmushFont(ScummEngine *vm, bool use_original_colors, bool new_colors);
void setColor(byte c) { _color = c; }
void drawString (const char *str, byte *buffer, int dst_width, int dst_height, int x, int y, bool center);
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 883cf43e2c..eed89dedd0 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -991,10 +991,10 @@ void SmushPlayer::setupAnim(const char *file) {
if (_vm->_gameId == GID_FT) {
if (!((_vm->_features & GF_DEMO) && (_vm->_platform == Common::kPlatformPC))) {
- _sf[0] = new SmushFont(true, false);
- _sf[1] = new SmushFont(true, false);
- _sf[2] = new SmushFont(true, false);
- _sf[3] = new SmushFont(true, false);
+ _sf[0] = new SmushFont(_vm, true, false);
+ _sf[1] = new SmushFont(_vm, true, false);
+ _sf[2] = new SmushFont(_vm, true, false);
+ _sf[3] = new SmushFont(_vm, true, false);
_sf[0]->loadFont("scummfnt.nut");
_sf[1]->loadFont("techfnt.nut");
_sf[2]->loadFont("titlfnt.nut");
@@ -1004,7 +1004,7 @@ void SmushPlayer::setupAnim(const char *file) {
if (!(_vm->_features & GF_DEMO)) {
for (i = 0; i < 4; i++) {
sprintf(file_font, "font%d.nut", i);
- _sf[i] = new SmushFont(i != 0, false);
+ _sf[i] = new SmushFont(_vm, i != 0, false);
_sf[i]->loadFont(file_font);
}
}
@@ -1013,7 +1013,7 @@ void SmushPlayer::setupAnim(const char *file) {
if ((_vm->_features & GF_DEMO) && (i == 4))
break;
sprintf(file_font, "font%d.nut", i);
- _sf[i] = new SmushFont(false, true);
+ _sf[i] = new SmushFont(_vm, false, true);
_sf[i]->loadFont(file_font);
}
} else {