diff --git a/boxes.cpp b/boxes.cpp index c21e7ffd25f..bdb2e775740 100644 --- a/boxes.cpp +++ b/boxes.cpp @@ -89,7 +89,7 @@ bool Scumm::checkXYInBoxBounds(int b, int x, int y) { box.ur.x== box.ll.x && box.ur.y== box.ll.y) { - Point pt; + ScummPoint pt; pt = closestPtOnLine(box.ul.x, box.ul.y, box.ll.x, box.ll.y, x, y); if (distanceFromPt(x, y, pt.x,pt.y) <= 4) return 1; @@ -148,11 +148,11 @@ bool Scumm::getSideOfLine(int x1,int y1, int x2, int y2, int x, int y, int box) return (x-x1)*(y2-y1) <= (y-y1)*(x2-x1); } -Point Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) { +ScummPoint Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) { int lydiff,lxdiff; int32 dist,a,b,c; int x2,y2; - Point pt; + ScummPoint pt; if (llx==ulx) { x2 = ulx; @@ -254,7 +254,7 @@ bool Scumm::inBoxQuickReject(int b, int x, int y, int threshold) { } AdjustBoxResult Scumm::getClosestPtOnBox(int b, int x, int y) { - Point pt; + ScummPoint pt; AdjustBoxResult best; uint dist; uint bestdist = (uint)0xFFFF; @@ -332,7 +332,7 @@ int Scumm::getPathToDestBox(byte from, byte to) { int Scumm::findPathTowards(Actor *a, byte box1nr, byte box2nr, byte box3nr) { BoxCoords box1; BoxCoords box2; - Point tmp; + ScummPoint tmp; int i,j; int flag; int q,pos; diff --git a/gfx.cpp b/gfx.cpp index b5eeee50763..f2020fab92c 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -231,7 +231,7 @@ void Scumm::setCameraAt(int pos_x, int pos_y) { if(_features & GF_AFTER_V7) { CameraData *cd = &camera; - Point old; + ScummPoint old; old = cd->_cur; @@ -1641,7 +1641,7 @@ void Gdi::clearUpperMask() { ); } -void Scumm::clampCameraPos(Point *pt) { +void Scumm::clampCameraPos(ScummPoint *pt) { if (pt->x < _vars[VAR_CAMERA_MIN_X]) pt->x = _vars[VAR_CAMERA_MIN_X]; @@ -1659,7 +1659,7 @@ void Scumm::clampCameraPos(Point *pt) { void Scumm::moveCamera() { if(_features & GF_AFTER_V7) { CameraData *cd = &camera; - Point old = cd->_cur; + ScummPoint old = cd->_cur; Actor *a; if (cd->_follows) { diff --git a/resource.cpp b/resource.cpp index ec84d8360b2..e232e4e3e73 100644 --- a/resource.cpp +++ b/resource.cpp @@ -167,7 +167,11 @@ bool Scumm::openResourceFile(const char *filename) { debug(9, "openResourceFile(%s)",filename); if (_resFilePath) { + #if defined(__APPLE__CW) + sprintf(buf, ":%s.%d:%s", _resFilePath, _resFilePathId, filename); + #else sprintf(buf, "%s.%d\\%s", _resFilePath, _resFilePathId, filename); + #endif } else if (_resFilePrefix) { sprintf(buf, "%s%s", _resFilePrefix, filename); } else { diff --git a/saveload.cpp b/saveload.cpp index ea8afd50731..b28c5a29bf9 100644 --- a/saveload.cpp +++ b/saveload.cpp @@ -144,8 +144,12 @@ bool Scumm::loadState(int slot, bool compat) { } void Scumm::makeSavegameName(char *out, int slot, bool compatible) { + #if !defined(__APPLE__CW) const char *dir = getenv("SCUMMVM_SAVEPATH"); if (dir==NULL) dir=""; + #else + const char *dir = ""; + #endif /* snprintf should be used here, but it's not portable enough */ sprintf(out, "%s%s.%c%.2d", dir, _exe_name, compatible ? 'c': 's', slot); } diff --git a/scumm.h b/scumm.h index 9747673cbc0..808b6e8cae0 100644 --- a/scumm.h +++ b/scumm.h @@ -85,7 +85,7 @@ const int16 many_direction_tab_2 [16] = { 270, 315 }; -struct Point { +struct ScummPoint { int x,y; }; @@ -621,10 +621,10 @@ struct Actor { }; struct CameraData { - Point _cur; - Point _dest; - Point _accel; - Point _last; + ScummPoint _cur; + ScummPoint _dest; + ScummPoint _accel; + ScummPoint _last; int _leftTrigger, _rightTrigger; byte _follows, _mode; bool _movingToActor; @@ -830,10 +830,10 @@ enum MouseButtonStatus { }; struct BoxCoords { - Point ul; - Point ur; - Point ll; - Point lr; + ScummPoint ul; + ScummPoint ur; + ScummPoint ll; + ScummPoint lr; }; #ifdef COMPRESSED_SOUND_FILE @@ -1267,7 +1267,7 @@ struct Scumm { void main(); uint distanceFromPt(int x, int y, int ptx, int pty); - Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); + ScummPoint closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); bool getSideOfLine(int x1,int y1, int x2, int y2, int x, int y, int box); void getBoxCoordinates(int boxnum, BoxCoords *bc); byte getMaskFromBox(int box); @@ -1799,7 +1799,7 @@ struct Scumm { void actorFollowCamera(int act); void setCameraAtEx(int at); - void clampCameraPos(Point *pt); + void clampCameraPos(ScummPoint *pt); void setCursorHotspot2(int x,int y); diff --git a/scummsys.h b/scummsys.h index 94255273546..4e1b1718702 100644 --- a/scummsys.h +++ b/scummsys.h @@ -139,6 +139,34 @@ typedef signed long int32; #define NORETURN #endif +#elif defined(__APPLE__CW) +#include +#include + +#define scumm_stricmp strcmp +inline char* strdup(char *buf) {return (char*)buf;}; + +#define CHECK_HEAP +#define SCUMM_BIG_ENDIAN + +#define FORCEINLINE inline +#define CDECL + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; +typedef signed long int32; + +#define START_PACK_STRUCTS pack (1) +#define END_PACK_STRUCTS pack () +#define GCC_PACK +#define NORETURN +#define NEED_STRDUP + #elif defined(__DC__) #define scumm_stricmp strcasecmp diff --git a/scummvm.cpp b/scummvm.cpp index 66c53efb391..70a46999cd1 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -420,6 +420,7 @@ int Scumm::scummLoop(int delta) { "\tf - fullscreen mode\n" void Scumm::parseCommandLine(int argc, char **argv) { + #if !defined(__APPLE__CW) int i; char *s; @@ -501,6 +502,12 @@ NextArg:; _exe_name = s; } } + #else + + //sprintf(_gameDataPath, ":%s:", *argv); + //_gameDataPath = *argv; + _exe_name = *argv; + #endif } @@ -549,7 +556,7 @@ static const VersionSettings version_settings[] = { /* Scumm Version 7 */ {"ft", "Full Throttle", GID_FT, 7, 3, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7}, - {"dig", "The Dig", GID_DIG, 7, 5, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7}, + {"dig", "The Dig", GID_DIG, 7, 5, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7}, /* Scumm Version 8 */ // {"curse", "The Curse of Monkey Island", GID_CMI, 8, 1, 0,}, @@ -1226,6 +1233,7 @@ void NORETURN CDECL error(const char *s, ...) { } void CDECL warning(const char *s, ...) { +#if 0 char buf[1024]; va_list va; @@ -1234,9 +1242,11 @@ void CDECL warning(const char *s, ...) { va_end(va); fprintf(stderr, "WARNING: %s!\n", buf); +#endif } void CDECL debug(int level, const char *s, ...) { +#if 0 char buf[1024]; va_list va; @@ -1248,6 +1258,7 @@ void CDECL debug(int level, const char *s, ...) { va_end(va); printf("%s\n", buf); fflush(stdout); +#endif } void checkHeap() { diff --git a/stdafx.h b/stdafx.h index 082ce536f88..21fe3758cc8 100644 --- a/stdafx.h +++ b/stdafx.h @@ -2,6 +2,9 @@ * $Id$ * * $Log$ + * Revision 1.10 2002/03/08 17:05:09 mutle + * Some changes, need to be done to get the Mac Port running. For example Point is now called ScummPoint, as the name Point is already in use by Apple. + * * Revision 1.9 2002/03/06 12:24:56 ender * Applied cleanup and scaling patch by Rob. * @@ -73,8 +76,10 @@ #if defined(NEED_SDL_HEADERS) #include #endif +#if !defined(__APPLE__CW) #include #include +#endif #if !defined (__BEOS__) #include #endif @@ -101,6 +106,10 @@ #define SCUMMVM_PLATFORM_VERSION "X11 version" #else +#ifdef __APPLE__CW +#define SCUMMVM_PLATFORM_VERSION "Carbon Mac version" +#else + #ifdef SDL_COMPILEDVERSION #define SCUMMVM_PLATFORM_VERSION "SDL version" //SDL_COMPILEDVERSION is a number... :( @@ -109,4 +118,5 @@ #endif #endif #endif +#endif