som changes to make Palm OS happy

svn-id: r7216
This commit is contained in:
Max Horn 2003-04-30 11:26:36 +00:00
parent 4ce574f579
commit 1be2d3076f
11 changed files with 46 additions and 14 deletions

View File

@ -19,7 +19,7 @@
*
*/
#include <stdafx.h>
#include "stdafx.h"
#include "chunk.h"
#include "common/engine.h"

View File

@ -19,7 +19,7 @@
*
*/
#include <stdafx.h>
#include "stdafx.h"
#include "common/scummsys.h"
void smush_decode_codec1(byte *dst, byte *src, int height) {

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -19,7 +19,7 @@
*
*/
#include <stdafx.h>
#include "stdafx.h"
#include "channel.h"
#include "chunk.h"
#include "chunk_type.h"

View File

@ -19,7 +19,7 @@
*
*/
#include <stdafx.h>
#include "stdafx.h"
#include "channel.h"
#include "chunk.h"

View File

@ -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() {

View File

@ -19,7 +19,7 @@
*
*/
#include <stdafx.h>
#include "stdafx.h"
#include "common/util.h"
#include "smush_mixer.h"
#include "channel.h"

View File

@ -19,7 +19,7 @@
*
*/
#include <stdafx.h>
#include "stdafx.h"
#include "sound/mixer.h"

View File

@ -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);