diff options
author | Max Horn | 2003-04-30 11:26:36 +0000 |
---|---|---|
committer | Max Horn | 2003-04-30 11:26:36 +0000 |
commit | 1be2d3076f17a116d918b4a9468be9c53374986f (patch) | |
tree | 813bb5e4a155b0335ca385e4aecd01a3c0792fb7 | |
parent | 4ce574f579a407092ad7f4e0b2c55bbe9e94c020 (diff) | |
download | scummvm-rg350-1be2d3076f17a116d918b4a9468be9c53374986f.tar.gz scummvm-rg350-1be2d3076f17a116d918b4a9468be9c53374986f.tar.bz2 scummvm-rg350-1be2d3076f17a116d918b4a9468be9c53374986f.zip |
som changes to make Palm OS happy
svn-id: r7216
-rw-r--r-- | scumm/smush/chunk.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/codec1.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/codec37.cpp | 7 | ||||
-rw-r--r-- | scumm/smush/codec47.cpp | 28 | ||||
-rw-r--r-- | scumm/smush/codec47.h | 5 | ||||
-rw-r--r-- | scumm/smush/imuse_channel.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/saud_channel.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/smush_font.cpp | 4 | ||||
-rw-r--r-- | scumm/smush/smush_mixer.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/smush_mixer.h | 2 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 4 |
11 files changed, 46 insertions, 14 deletions
diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp index 0f3bfbf734..fc6c0d2323 100644 --- a/scumm/smush/chunk.cpp +++ b/scumm/smush/chunk.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "chunk.h" #include "common/engine.h" diff --git a/scumm/smush/codec1.cpp b/scumm/smush/codec1.cpp index 673a9c1d0e..8269d85950 100644 --- a/scumm/smush/codec1.cpp +++ b/scumm/smush/codec1.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "common/scummsys.h" void smush_decode_codec1(byte *dst, byte *src, int height) { diff --git a/scumm/smush/codec37.cpp b/scumm/smush/codec37.cpp index a2087c4b51..1d231d58e6 100644 --- a/scumm/smush/codec37.cpp +++ b/scumm/smush/codec37.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "codec37.h" #include "common/engine.h" @@ -30,8 +30,7 @@ void Codec37Decoder::init(int width, int height) { _height = height; _frameSize = _width * _height; _deltaSize = _frameSize * 3 + 0x13600; - _deltaBuf = new byte[_deltaSize]; - memset(_deltaBuf, 0, _deltaSize); + _deltaBuf = (byte *)calloc(_deltaSize, sizeof(byte)); if(_deltaBuf == 0) error("unable to allocate decoder buffer"); _deltaBufs[0] = _deltaBuf + 0x4D80; @@ -64,7 +63,7 @@ void Codec37Decoder::deinit() { _tableLastIndex = -1; } if(_deltaBuf) { - delete []_deltaBuf; + free(_deltaBuf); _deltaSize = 0; _deltaBuf = 0; _deltaBufs[0] = 0; diff --git a/scumm/smush/codec47.cpp b/scumm/smush/codec47.cpp index 6561e8d702..904daa7e1d 100644 --- a/scumm/smush/codec47.cpp +++ b/scumm/smush/codec47.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "codec47.h" #include "common/engine.h" @@ -40,6 +40,7 @@ (dst)[1] = (src)[1]; \ } while(0) + #else /* SCUMM_NEED_ALIGNMENT */ #define COPY_4X1_LINE(dst, src) \ @@ -64,6 +65,10 @@ (dst)[1] = val; \ } while(0) +#ifdef __PALM_OS__ +static int32 *codec37_table; +static int16 *codec47_table; +#else static int32 codec37_table[] = { 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, @@ -260,6 +265,7 @@ static int16 codec47_table[] = { 23, 36, -19, 39, 16, 40, -13, 41, 9, 42, -6, 43, 1, 43, 0, 0, 0, 0, 0, 0 }; +#endif void Codec47Decoder::makeTables37(int32 param) { int32 variable1, variable2; @@ -669,6 +675,10 @@ void Codec47Decoder::init(int width, int height) { } Codec47Decoder::Codec47Decoder() { +#ifdef __PALM_OS__ + _tableBig = (byte *)calloc(99328, sizeof(byte)); + _tableSmall = (byte *)calloc(32768, sizeof(byte)); +#endif _deltaBuf = 0; } @@ -685,6 +695,10 @@ void Codec47Decoder::deinit() { Codec47Decoder::~Codec47Decoder() { deinit(); +#ifdef __PALM_OS__ + free(_tableBig); + free(_tableSmall); +#endif } bool Codec47Decoder::decode(byte *dst, const byte *src) { @@ -748,3 +762,15 @@ bool Codec47Decoder::decode(byte *dst, const byte *src) { return true; } + +#ifdef __PALM_OS__ +#include "scumm_globals.h" // init globals +void Codec47_initGlobals() { + GSETPTR(codec37_table, GBVARS_CODEC37TABLE_INDEX, int32 , GBVARS_SCUMM) + GSETPTR(codec47_table, GBVARS_CODEC47TABLE_INDEX, int16 , GBVARS_SCUMM) +} +void Codec47_releaseGlobals() { + GRELEASEPTR(GBVARS_CODEC37TABLE_INDEX , GBVARS_SCUMM) + GRELEASEPTR(GBVARS_CODEC47TABLE_INDEX , GBVARS_SCUMM) +} +#endif
\ No newline at end of file diff --git a/scumm/smush/codec47.h b/scumm/smush/codec47.h index 425f0daacf..e900a6993e 100644 --- a/scumm/smush/codec47.h +++ b/scumm/smush/codec47.h @@ -36,8 +36,13 @@ private: const byte *_d_src, *_paramPtr; int _d_pitch; int32 _offset1, _offset2; +#ifdef __PALM_OS__ + byte *_tableBig; + byte *_tableSmall; +#else byte _tableBig[99328]; byte _tableSmall[32768]; +#endif int16 _table[256]; int32 _frameSize; int _width, _height; diff --git a/scumm/smush/imuse_channel.cpp b/scumm/smush/imuse_channel.cpp index 064b662a33..9785de15ae 100644 --- a/scumm/smush/imuse_channel.cpp +++ b/scumm/smush/imuse_channel.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "channel.h" #include "chunk.h" #include "chunk_type.h" diff --git a/scumm/smush/saud_channel.cpp b/scumm/smush/saud_channel.cpp index 3ab0f03faa..386c3b7781 100644 --- a/scumm/smush/saud_channel.cpp +++ b/scumm/smush/saud_channel.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "channel.h" #include "chunk.h" diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp index 2e1207be38..7741ad8205 100644 --- a/scumm/smush/smush_font.cpp +++ b/scumm/smush/smush_font.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "common/util.h" #include "common/engine.h" #include "common/file.h" @@ -34,6 +34,8 @@ SmushFont::SmushFont(bool use_original_colors, bool new_colors) : _original(use_original_colors) { for(int i = 0; i < 256; i++) _chars[i].chr = NULL; + + _dataSrc = NULL; } SmushFont::~SmushFont() { diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp index b674430f99..33211f0d05 100644 --- a/scumm/smush/smush_mixer.cpp +++ b/scumm/smush/smush_mixer.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "common/util.h" #include "smush_mixer.h" #include "channel.h" diff --git a/scumm/smush/smush_mixer.h b/scumm/smush/smush_mixer.h index ea446a228e..e12014c9a2 100644 --- a/scumm/smush/smush_mixer.h +++ b/scumm/smush/smush_mixer.h @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "sound/mixer.h" diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index f605ca4e26..3ab385a2f1 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -19,7 +19,7 @@ * */ -#include <stdafx.h> +#include "stdafx.h" #include "common/file.h" #include "common/util.h" #include "common/engine.h" @@ -384,7 +384,7 @@ void SmushPlayer::handleImuseAction(Chunk &b) { int flags = b.getWord(); int unknown = b.getShort(); int track_flags = b.getWord(); - + if (flags != 46) return; assert(flags == 46 && unknown == 0); |