svn-id: r15739
This commit is contained in:
Chris Apers 2004-11-09 10:26:33 +00:00
parent 0823f2be2a
commit 2abe17e594
10 changed files with 20 additions and 67 deletions

View File

@ -3,7 +3,7 @@
// Header generated by Constructor for Palm OS (R) 1.9.1
//
// Generated at 16:09:56 on jeudi 27 novembre 2003
// Generated at 17:44:44 on mardi 16 mars 2004
//
// Generated for file: Builder.rsrc
//

View File

@ -99,13 +99,8 @@ const char *Engine::getGameDataPath() const {
}
void NORETURN CDECL error(const char *s, ...) {
#ifdef __PALM_OS__
char buf_input[256]; // 1024 is too big overflow the stack
char buf_output[256];
#else
char buf_input[1024];
char buf_output[1024];
#endif
char buf_input[STRINGBUFLEN];
char buf_output[STRINGBUFLEN];
va_list va;
va_start(va, s);
@ -152,11 +147,7 @@ void NORETURN CDECL error(const char *s, ...) {
}
void CDECL warning(const char *s, ...) {
#ifdef __PALM_OS__
char buf[256]; // 1024 is too big overflow the stack
#else
char buf[1024];
#endif
char buf[STRINGBUFLEN];
va_list va;
va_start(va, s);
@ -183,11 +174,7 @@ void CDECL warning(const char *s, ...) {
}
void CDECL debug(int level, const char *s, ...) {
#ifdef __PALM_OS__
char buf[256]; // 1024 is too big overflow the stack
#else
char buf[1024];
#endif
char buf[STRINGBUFLEN];
va_list va;
if (level > g_debugLevel)
@ -215,11 +202,7 @@ void CDECL debug(int level, const char *s, ...) {
}
void CDECL debug(const char *s, ...) {
#ifdef __PALM_OS__
char buf[256]; // 1024 is too big overflow the stack
#else
char buf[1024];
#endif
char buf[STRINGBUFLEN];
va_list va;
va_start(va, s);

View File

@ -169,6 +169,8 @@
#include "globals.h"
#include "extend.h"
#define STRINGBUFLEN 256
#define __PALM_OS__
#define scumm_stricmp stricmp
#define scumm_strnicmp strnicmp
@ -440,6 +442,10 @@ FORCEINLINE uint32 READ_BE_UINT24(const void *ptr) {
typedef int16 OverlayColor;
#endif
#ifndef STRINGBUFLEN
#define STRINGBUFLEN 1024
#endif
/*
#if !defined(__PALM_OS__)
// Initialized operator new

View File

@ -28,6 +28,7 @@
#include "queen/resource.h"
#if defined(__PALM_OS__)
#include "init_arm.h"
#include "arm/native.h"
#include "arm/macros.h"
#endif
@ -52,18 +53,12 @@ Display::Display(QueenEngine *vm, OSystem *system)
initFont();
#ifndef __PALM_OS__
_screenBuf = new uint8[SCREEN_W * SCREEN_H];
_panelBuf = new uint8[PANEL_W * PANEL_H];
_backdropBuf = new uint8[BACKDROP_W * BACKDROP_H];
memset(_screenBuf, 0, SCREEN_W * SCREEN_H);
memset(_panelBuf, 0, PANEL_W * PANEL_H);
memset(_backdropBuf, 0, BACKDROP_W * BACKDROP_H);
#else
_screenBuf = (uint8 *)calloc(SCREEN_W * SCREEN_H, sizeof(uint8));
_panelBuf = (uint8 *)calloc(PANEL_W * PANEL_H, sizeof(uint8));
_backdropBuf = (uint8 *)calloc(BACKDROP_W * BACKDROP_H, sizeof(uint8));
#endif
_fullRefresh = 1;
_dirtyBlocksWidth = SCREEN_W / D_BLOCK_W;
@ -85,15 +80,9 @@ Display::Display(QueenEngine *vm, OSystem *system)
}
Display::~Display() {
#ifndef __PALM_OS__
delete[] _backdropBuf;
delete[] _panelBuf;
delete[] _screenBuf;
#else
free(_backdropBuf);
free(_panelBuf);
free(_screenBuf);
#endif
delete[] _pal.room;
delete[] _pal.screen;

View File

@ -105,15 +105,13 @@ uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size,
*size = sz;
}
byte *dstBuf;
#ifndef __PALM_OS__
if (useMalloc) {
dstBuf = (byte *)malloc(sz);
} else {
dstBuf = new byte[sz];
}
#else
dstBuf = (byte *)calloc(sz, sizeof(byte));
#endif
_resourceFile->seek(re->offset + skipBytes);
_resourceFile->read(dstBuf, sz);
return dstBuf;

View File

@ -40,11 +40,7 @@ extern uint16 g_debugLevel;
namespace Scumm {
void CDECL debugC(int channel, const char *s, ...) {
#ifdef __PALM_OS__
char buf[256]; // 1024 is too big overflow the stack
#else
char buf[1024];
#endif
char buf[STRINGBUFLEN];
va_list va;
// FIXME: Still spew all debug at -d9, for crashes in startup etc.

View File

@ -424,21 +424,13 @@ void ScummEngine::askForDisk(const char *filename, int disknum) {
result = displayMessage("Quit", buf);
if (!result) {
#ifdef __PALM_OS__
error("Cannot find file: '%s'", filename);
#else
_system->quit();
#endif
}
} else {
sprintf(buf, "Cannot find file: '%s'", filename);
InfoDialog dialog(this, (char*)buf);
runDialog(dialog);
#ifdef __PALM_OS__
error("Cannot find file: '%s'", filename);
#else
_system->quit();
#endif
}
}

View File

@ -635,6 +635,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_switchRoomEffect2 = 0;
_switchRoomEffect = 0;
_scrollBuffer = NULL;
_doEffect = false;
memset(&_flashlight, 0, sizeof(_flashlight));
_roomStrips = 0;
@ -2482,11 +2483,7 @@ void ScummEngine::confirmrestartDialog() {
}
char ScummEngine::displayMessage(const char *altButton, const char *message, ...) {
#ifdef __PALM_OS__
char buf[256]; // 1024 is too big overflow the stack
#else
char buf[1024];
#endif
char buf[STRINGBUFLEN];
va_list va;
va_start(va, message);

View File

@ -218,11 +218,7 @@ void SimonEngine::render_string(uint vga_sprite_id, uint color, uint width, uint
}
void SimonEngine::showMessageFormat(const char *s, ...) {
#ifndef __PALM_OS__
char buf[1024];
#else
char buf[256];
#endif
char buf[STRINGBUFLEN];
char *str;
va_list va;

View File

@ -698,11 +698,7 @@ void Control::readSavegameDescriptions(void) {
}
int Control::displayMessage(const char *altButton, const char *message, ...) {
#ifdef __PALM_OS__
char buf[256]; // 1024 is too big overflow the stack
#else
char buf[1024];
#endif
char buf[STRINGBUFLEN];
va_list va;
va_start(va, message);