├── Frameworks ├── freealut.framework │ ├── Headers │ ├── Resources │ ├── Versions │ │ ├── A │ │ │ ├── Headers │ │ │ │ └── alut.h │ │ │ ├── Resources │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── Info.plist │ │ │ └── freealut │ │ └── Current │ └── freealut ├── libpng.framework │ ├── Headers │ ├── Resources │ ├── Versions │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── png.h │ │ │ │ └── pngconf.h │ │ │ ├── Resources │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── Info.plist │ │ │ └── libpng │ │ └── Current │ └── libpng ├── plib.framework │ ├── Headers │ ├── Resources │ ├── Versions │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── sg.h │ │ │ │ ├── sl.h │ │ │ │ ├── slPortability.h │ │ │ │ ├── ssg.h │ │ │ │ ├── ssgAux.h │ │ │ │ ├── ssgaFire.h │ │ │ │ ├── ssgaLensFlare.h │ │ │ │ ├── ssgaParticleSystem.h │ │ │ │ ├── ssgaScreenDump.h │ │ │ │ ├── ssgaShapes.h │ │ │ │ ├── ssgaWaveSystem.h │ │ │ │ ├── ssgconf.h │ │ │ │ └── ul.h │ │ │ ├── Resources │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── Info.plist │ │ │ └── plib │ │ └── Current │ └── plib └── zlib.framework │ ├── Resources │ ├── Versions │ ├── A │ │ ├── Resources │ │ │ └── Info.plist │ │ └── zlib │ └── Current │ └── zlib ├── Headers ├── isnan.h ├── learning │ ├── ANN.h │ ├── Distribution.h │ ├── List.h │ ├── MathFunctions.h │ ├── ann_policy.h │ ├── learn_debug.h │ ├── policy.h │ ├── real.h │ └── string_utils.h └── tmath │ ├── linalg_t.h │ ├── straight2_t.h │ ├── v2_t.h │ ├── v3_t.h │ └── v4_t.h ├── Info.plist ├── README.md ├── Resources └── Torcs.icns ├── Torcs.xcodeproj └── project.pbxproj ├── mac_setup_resources.mk └── torcs-1.3.1-mac.diff /Frameworks/freealut.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/freealut.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/freealut.framework/Versions/A/Headers/alut.h: -------------------------------------------------------------------------------- 1 | #if !defined(AL_ALUT_H) 2 | #define AL_ALUT_H 3 | 4 | #if defined(_MSC_VER) 5 | #include 6 | #include 7 | #elif defined(__APPLE__) 8 | #include 9 | #include 10 | #else 11 | #include 12 | #include 13 | #endif 14 | 15 | #if defined(__cplusplus) 16 | extern "C" { 17 | #endif 18 | 19 | #if defined(_WIN32) && !defined(_XBOX) 20 | #if defined (ALUT_BUILD_LIBRARY) 21 | #define ALUT_API __declspec(dllexport) 22 | #else 23 | #define ALUT_API __declspec(dllimport) 24 | #endif 25 | #else 26 | #if defined(ALUT_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY) 27 | #define ALUT_API __attribute__((visibility("default"))) 28 | #else 29 | #define ALUT_API extern 30 | #endif 31 | #endif 32 | 33 | #if defined(_WIN32) 34 | #define ALUT_APIENTRY __cdecl 35 | #else 36 | #define ALUT_APIENTRY 37 | #endif 38 | 39 | #if defined(__MWERKS_) 40 | #pragma export on 41 | #endif 42 | 43 | /* Flag deprecated functions if possible (VisualC++ .NET and GCC >= 3.1.1). */ 44 | #if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(MIDL_PASS) 45 | #define ALUT_ATTRIBUTE_DEPRECATED __declspec(deprecated) 46 | #elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 1)))) 47 | #define ALUT_ATTRIBUTE_DEPRECATED __attribute__((deprecated)) 48 | #else 49 | #define ALUT_ATTRIBUTE_DEPRECATED 50 | #endif 51 | 52 | #define ALUT_API_MAJOR_VERSION 1 53 | #define ALUT_API_MINOR_VERSION 1 54 | 55 | #define ALUT_ERROR_NO_ERROR 0 56 | #define ALUT_ERROR_OUT_OF_MEMORY 0x200 57 | #define ALUT_ERROR_INVALID_ENUM 0x201 58 | #define ALUT_ERROR_INVALID_VALUE 0x202 59 | #define ALUT_ERROR_INVALID_OPERATION 0x203 60 | #define ALUT_ERROR_NO_CURRENT_CONTEXT 0x204 61 | #define ALUT_ERROR_AL_ERROR_ON_ENTRY 0x205 62 | #define ALUT_ERROR_ALC_ERROR_ON_ENTRY 0x206 63 | #define ALUT_ERROR_OPEN_DEVICE 0x207 64 | #define ALUT_ERROR_CLOSE_DEVICE 0x208 65 | #define ALUT_ERROR_CREATE_CONTEXT 0x209 66 | #define ALUT_ERROR_MAKE_CONTEXT_CURRENT 0x20A 67 | #define ALUT_ERROR_DESTROY_CONTEXT 0x20B 68 | #define ALUT_ERROR_GEN_BUFFERS 0x20C 69 | #define ALUT_ERROR_BUFFER_DATA 0x20D 70 | #define ALUT_ERROR_IO_ERROR 0x20E 71 | #define ALUT_ERROR_UNSUPPORTED_FILE_TYPE 0x20F 72 | #define ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE 0x210 73 | #define ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA 0x211 74 | 75 | #define ALUT_WAVEFORM_SINE 0x100 76 | #define ALUT_WAVEFORM_SQUARE 0x101 77 | #define ALUT_WAVEFORM_SAWTOOTH 0x102 78 | #define ALUT_WAVEFORM_WHITENOISE 0x103 79 | #define ALUT_WAVEFORM_IMPULSE 0x104 80 | 81 | #define ALUT_LOADER_BUFFER 0x300 82 | #define ALUT_LOADER_MEMORY 0x301 83 | 84 | ALUT_API ALboolean ALUT_APIENTRY alutInit (int *argcp, char **argv); 85 | ALUT_API ALboolean ALUT_APIENTRY alutInitWithoutContext (int *argcp, char **argv); 86 | ALUT_API ALboolean ALUT_APIENTRY alutExit (void); 87 | 88 | ALUT_API ALenum ALUT_APIENTRY alutGetError (void); 89 | ALUT_API const char *ALUT_APIENTRY alutGetErrorString (ALenum error); 90 | 91 | ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFile (const char *fileName); 92 | ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFileImage (const ALvoid *data, ALsizei length); 93 | ALUT_API ALuint ALUT_APIENTRY alutCreateBufferHelloWorld (void); 94 | ALUT_API ALuint ALUT_APIENTRY alutCreateBufferWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration); 95 | 96 | ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFile (const char *fileName, ALenum *format, ALsizei *size, ALfloat *frequency); 97 | ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFileImage (const ALvoid *data, ALsizei length, ALenum *format, ALsizei *size, ALfloat *frequency); 98 | ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryHelloWorld (ALenum *format, ALsizei *size, ALfloat *frequency); 99 | ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration, ALenum *format, ALsizei *size, ALfloat *freq); 100 | 101 | ALUT_API const char *ALUT_APIENTRY alutGetMIMETypes (ALenum loader); 102 | 103 | ALUT_API ALint ALUT_APIENTRY alutGetMajorVersion (void); 104 | ALUT_API ALint ALUT_APIENTRY alutGetMinorVersion (void); 105 | 106 | ALUT_API ALboolean ALUT_APIENTRY alutSleep (ALfloat duration); 107 | 108 | /* Nasty Compatibility stuff, WARNING: THESE FUNCTIONS ARE STRONGLY DEPRECATED */ 109 | #if defined(__APPLE__) 110 | ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency); 111 | ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency); 112 | #else 113 | ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop); 114 | ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop); 115 | #endif 116 | ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutUnloadWAV (ALenum format, ALvoid *data, ALsizei size, ALsizei frequency); 117 | 118 | #if defined(__MWERKS_) 119 | #pragma export off 120 | #endif 121 | 122 | #if defined(__cplusplus) 123 | } 124 | #endif 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /Frameworks/freealut.framework/Versions/A/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/freealut.framework/Versions/A/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Frameworks/freealut.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | freealut 9 | CFBundleIdentifier 10 | com.yourcompany.yourcocoaframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | freealut 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | 22 | 23 | -------------------------------------------------------------------------------- /Frameworks/freealut.framework/Versions/A/freealut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/freealut.framework/Versions/A/freealut -------------------------------------------------------------------------------- /Frameworks/freealut.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Frameworks/freealut.framework/freealut: -------------------------------------------------------------------------------- 1 | Versions/Current/freealut -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Versions/A/Headers/pngconf.h: -------------------------------------------------------------------------------- 1 | 2 | /* pngconf.h - machine configurable file for libpng 3 | * 4 | * libpng version 1.2.25 - February 18, 2008 5 | * For conditions of distribution and use, see copyright notice in png.h 6 | * Copyright (c) 1998-2008 Glenn Randers-Pehrson 7 | * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 8 | * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 9 | */ 10 | 11 | /* Any machine specific code is near the front of this file, so if you 12 | * are configuring libpng for a machine, you may want to read the section 13 | * starting here down to where it starts to typedef png_color, png_text, 14 | * and png_info. 15 | */ 16 | 17 | #ifndef PNGCONF_H 18 | #define PNGCONF_H 19 | 20 | #define PNG_1_2_X 21 | 22 | /* 23 | * PNG_USER_CONFIG has to be defined on the compiler command line. This 24 | * includes the resource compiler for Windows DLL configurations. 25 | */ 26 | #ifdef PNG_USER_CONFIG 27 | # ifndef PNG_USER_PRIVATEBUILD 28 | # define PNG_USER_PRIVATEBUILD 29 | # endif 30 | #include "pngusr.h" 31 | #endif 32 | 33 | /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ 34 | #ifdef PNG_CONFIGURE_LIBPNG 35 | #ifdef HAVE_CONFIG_H 36 | #include "config.h" 37 | #endif 38 | #endif 39 | 40 | /* 41 | * Added at libpng-1.2.8 42 | * 43 | * If you create a private DLL you need to define in "pngusr.h" the followings: 44 | * #define PNG_USER_PRIVATEBUILD 46 | * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." 47 | * #define PNG_USER_DLLFNAME_POSTFIX 51 | * e.g. // private DLL "libpng13gx.dll" 52 | * #define PNG_USER_DLLFNAME_POSTFIX "gx" 53 | * 54 | * The following macros are also at your disposal if you want to complete the 55 | * DLL VERSIONINFO structure. 56 | * - PNG_USER_VERSIONINFO_COMMENTS 57 | * - PNG_USER_VERSIONINFO_COMPANYNAME 58 | * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS 59 | */ 60 | 61 | #ifdef __STDC__ 62 | #ifdef SPECIALBUILD 63 | # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ 64 | are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") 65 | #endif 66 | 67 | #ifdef PRIVATEBUILD 68 | # pragma message("PRIVATEBUILD is deprecated.\ 69 | Use PNG_USER_PRIVATEBUILD instead.") 70 | # define PNG_USER_PRIVATEBUILD PRIVATEBUILD 71 | #endif 72 | #endif /* __STDC__ */ 73 | 74 | #ifndef PNG_VERSION_INFO_ONLY 75 | 76 | /* End of material added to libpng-1.2.8 */ 77 | 78 | /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble 79 | Restored at libpng-1.2.21 */ 80 | #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ 81 | !defined(PNG_WARN_UNINITIALIZED_ROW) 82 | # define PNG_WARN_UNINITIALIZED_ROW 1 83 | #endif 84 | /* End of material added at libpng-1.2.19/1.2.21 */ 85 | 86 | /* This is the size of the compression buffer, and thus the size of 87 | * an IDAT chunk. Make this whatever size you feel is best for your 88 | * machine. One of these will be allocated per png_struct. When this 89 | * is full, it writes the data to the disk, and does some other 90 | * calculations. Making this an extremely small size will slow 91 | * the library down, but you may want to experiment to determine 92 | * where it becomes significant, if you are concerned with memory 93 | * usage. Note that zlib allocates at least 32Kb also. For readers, 94 | * this describes the size of the buffer available to read the data in. 95 | * Unless this gets smaller than the size of a row (compressed), 96 | * it should not make much difference how big this is. 97 | */ 98 | 99 | #ifndef PNG_ZBUF_SIZE 100 | # define PNG_ZBUF_SIZE 8192 101 | #endif 102 | 103 | /* Enable if you want a write-only libpng */ 104 | 105 | #ifndef PNG_NO_READ_SUPPORTED 106 | # define PNG_READ_SUPPORTED 107 | #endif 108 | 109 | /* Enable if you want a read-only libpng */ 110 | 111 | #ifndef PNG_NO_WRITE_SUPPORTED 112 | # define PNG_WRITE_SUPPORTED 113 | #endif 114 | 115 | /* Enabled by default in 1.2.0. You can disable this if you don't need to 116 | support PNGs that are embedded in MNG datastreams */ 117 | #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) 118 | # ifndef PNG_MNG_FEATURES_SUPPORTED 119 | # define PNG_MNG_FEATURES_SUPPORTED 120 | # endif 121 | #endif 122 | 123 | #ifndef PNG_NO_FLOATING_POINT_SUPPORTED 124 | # ifndef PNG_FLOATING_POINT_SUPPORTED 125 | # define PNG_FLOATING_POINT_SUPPORTED 126 | # endif 127 | #endif 128 | 129 | /* If you are running on a machine where you cannot allocate more 130 | * than 64K of memory at once, uncomment this. While libpng will not 131 | * normally need that much memory in a chunk (unless you load up a very 132 | * large file), zlib needs to know how big of a chunk it can use, and 133 | * libpng thus makes sure to check any memory allocation to verify it 134 | * will fit into memory. 135 | #define PNG_MAX_MALLOC_64K 136 | */ 137 | #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) 138 | # define PNG_MAX_MALLOC_64K 139 | #endif 140 | 141 | /* Special munging to support doing things the 'cygwin' way: 142 | * 'Normal' png-on-win32 defines/defaults: 143 | * PNG_BUILD_DLL -- building dll 144 | * PNG_USE_DLL -- building an application, linking to dll 145 | * (no define) -- building static library, or building an 146 | * application and linking to the static lib 147 | * 'Cygwin' defines/defaults: 148 | * PNG_BUILD_DLL -- (ignored) building the dll 149 | * (no define) -- (ignored) building an application, linking to the dll 150 | * PNG_STATIC -- (ignored) building the static lib, or building an 151 | * application that links to the static lib. 152 | * ALL_STATIC -- (ignored) building various static libs, or building an 153 | * application that links to the static libs. 154 | * Thus, 155 | * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and 156 | * this bit of #ifdefs will define the 'correct' config variables based on 157 | * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but 158 | * unnecessary. 159 | * 160 | * Also, the precedence order is: 161 | * ALL_STATIC (since we can't #undef something outside our namespace) 162 | * PNG_BUILD_DLL 163 | * PNG_STATIC 164 | * (nothing) == PNG_USE_DLL 165 | * 166 | * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent 167 | * of auto-import in binutils, we no longer need to worry about 168 | * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, 169 | * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes 170 | * to __declspec() stuff. However, we DO need to worry about 171 | * PNG_BUILD_DLL and PNG_STATIC because those change some defaults 172 | * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. 173 | */ 174 | #if defined(__CYGWIN__) 175 | # if defined(ALL_STATIC) 176 | # if defined(PNG_BUILD_DLL) 177 | # undef PNG_BUILD_DLL 178 | # endif 179 | # if defined(PNG_USE_DLL) 180 | # undef PNG_USE_DLL 181 | # endif 182 | # if defined(PNG_DLL) 183 | # undef PNG_DLL 184 | # endif 185 | # if !defined(PNG_STATIC) 186 | # define PNG_STATIC 187 | # endif 188 | # else 189 | # if defined (PNG_BUILD_DLL) 190 | # if defined(PNG_STATIC) 191 | # undef PNG_STATIC 192 | # endif 193 | # if defined(PNG_USE_DLL) 194 | # undef PNG_USE_DLL 195 | # endif 196 | # if !defined(PNG_DLL) 197 | # define PNG_DLL 198 | # endif 199 | # else 200 | # if defined(PNG_STATIC) 201 | # if defined(PNG_USE_DLL) 202 | # undef PNG_USE_DLL 203 | # endif 204 | # if defined(PNG_DLL) 205 | # undef PNG_DLL 206 | # endif 207 | # else 208 | # if !defined(PNG_USE_DLL) 209 | # define PNG_USE_DLL 210 | # endif 211 | # if !defined(PNG_DLL) 212 | # define PNG_DLL 213 | # endif 214 | # endif 215 | # endif 216 | # endif 217 | #endif 218 | 219 | /* This protects us against compilers that run on a windowing system 220 | * and thus don't have or would rather us not use the stdio types: 221 | * stdin, stdout, and stderr. The only one currently used is stderr 222 | * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will 223 | * prevent these from being compiled and used. #defining PNG_NO_STDIO 224 | * will also prevent these, plus will prevent the entire set of stdio 225 | * macros and functions (FILE *, printf, etc.) from being compiled and used, 226 | * unless (PNG_DEBUG > 0) has been #defined. 227 | * 228 | * #define PNG_NO_CONSOLE_IO 229 | * #define PNG_NO_STDIO 230 | */ 231 | 232 | #if defined(_WIN32_WCE) 233 | # include 234 | /* Console I/O functions are not supported on WindowsCE */ 235 | # define PNG_NO_CONSOLE_IO 236 | # ifdef PNG_DEBUG 237 | # undef PNG_DEBUG 238 | # endif 239 | #endif 240 | 241 | #ifdef PNG_BUILD_DLL 242 | # ifndef PNG_CONSOLE_IO_SUPPORTED 243 | # ifndef PNG_NO_CONSOLE_IO 244 | # define PNG_NO_CONSOLE_IO 245 | # endif 246 | # endif 247 | #endif 248 | 249 | # ifdef PNG_NO_STDIO 250 | # ifndef PNG_NO_CONSOLE_IO 251 | # define PNG_NO_CONSOLE_IO 252 | # endif 253 | # ifdef PNG_DEBUG 254 | # if (PNG_DEBUG > 0) 255 | # include 256 | # endif 257 | # endif 258 | # else 259 | # if !defined(_WIN32_WCE) 260 | /* "stdio.h" functions are not supported on WindowsCE */ 261 | # include 262 | # endif 263 | # endif 264 | 265 | /* This macro protects us against machines that don't have function 266 | * prototypes (ie K&R style headers). If your compiler does not handle 267 | * function prototypes, define this macro and use the included ansi2knr. 268 | * I've always been able to use _NO_PROTO as the indicator, but you may 269 | * need to drag the empty declaration out in front of here, or change the 270 | * ifdef to suit your own needs. 271 | */ 272 | #ifndef PNGARG 273 | 274 | #ifdef OF /* zlib prototype munger */ 275 | # define PNGARG(arglist) OF(arglist) 276 | #else 277 | 278 | #ifdef _NO_PROTO 279 | # define PNGARG(arglist) () 280 | # ifndef PNG_TYPECAST_NULL 281 | # define PNG_TYPECAST_NULL 282 | # endif 283 | #else 284 | # define PNGARG(arglist) arglist 285 | #endif /* _NO_PROTO */ 286 | 287 | 288 | #endif /* OF */ 289 | 290 | #endif /* PNGARG */ 291 | 292 | /* Try to determine if we are compiling on a Mac. Note that testing for 293 | * just __MWERKS__ is not good enough, because the Codewarrior is now used 294 | * on non-Mac platforms. 295 | */ 296 | #ifndef MACOS 297 | # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ 298 | defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) 299 | # define MACOS 300 | # endif 301 | #endif 302 | 303 | /* enough people need this for various reasons to include it here */ 304 | #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) 305 | # include 306 | #endif 307 | 308 | #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) 309 | # define PNG_SETJMP_SUPPORTED 310 | #endif 311 | 312 | #ifdef PNG_SETJMP_SUPPORTED 313 | /* This is an attempt to force a single setjmp behaviour on Linux. If 314 | * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. 315 | */ 316 | 317 | # ifdef __linux__ 318 | # ifdef _BSD_SOURCE 319 | # define PNG_SAVE_BSD_SOURCE 320 | # undef _BSD_SOURCE 321 | # endif 322 | # ifdef _SETJMP_H 323 | /* If you encounter a compiler error here, see the explanation 324 | * near the end of INSTALL. 325 | */ 326 | __pngconf.h__ already includes setjmp.h; 327 | __dont__ include it again.; 328 | # endif 329 | # endif /* __linux__ */ 330 | 331 | /* include setjmp.h for error handling */ 332 | # include 333 | 334 | # ifdef __linux__ 335 | # ifdef PNG_SAVE_BSD_SOURCE 336 | # ifndef _BSD_SOURCE 337 | # define _BSD_SOURCE 338 | # endif 339 | # undef PNG_SAVE_BSD_SOURCE 340 | # endif 341 | # endif /* __linux__ */ 342 | #endif /* PNG_SETJMP_SUPPORTED */ 343 | 344 | #ifdef BSD 345 | # include 346 | #else 347 | # include 348 | #endif 349 | 350 | /* Other defines for things like memory and the like can go here. */ 351 | #ifdef PNG_INTERNAL 352 | 353 | #include 354 | 355 | /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which 356 | * aren't usually used outside the library (as far as I know), so it is 357 | * debatable if they should be exported at all. In the future, when it is 358 | * possible to have run-time registry of chunk-handling functions, some of 359 | * these will be made available again. 360 | #define PNG_EXTERN extern 361 | */ 362 | #define PNG_EXTERN 363 | 364 | /* Other defines specific to compilers can go here. Try to keep 365 | * them inside an appropriate ifdef/endif pair for portability. 366 | */ 367 | 368 | #if defined(PNG_FLOATING_POINT_SUPPORTED) 369 | # if defined(MACOS) 370 | /* We need to check that hasn't already been included earlier 371 | * as it seems it doesn't agree with , yet we should really use 372 | * if possible. 373 | */ 374 | # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) 375 | # include 376 | # endif 377 | # else 378 | # include 379 | # endif 380 | # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) 381 | /* Amiga SAS/C: We must include builtin FPU functions when compiling using 382 | * MATH=68881 383 | */ 384 | # include 385 | # endif 386 | #endif 387 | 388 | /* Codewarrior on NT has linking problems without this. */ 389 | #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) 390 | # define PNG_ALWAYS_EXTERN 391 | #endif 392 | 393 | /* This provides the non-ANSI (far) memory allocation routines. */ 394 | #if defined(__TURBOC__) && defined(__MSDOS__) 395 | # include 396 | # include 397 | #endif 398 | 399 | /* I have no idea why is this necessary... */ 400 | #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ 401 | defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) 402 | # include 403 | #endif 404 | 405 | /* This controls how fine the dithering gets. As this allocates 406 | * a largish chunk of memory (32K), those who are not as concerned 407 | * with dithering quality can decrease some or all of these. 408 | */ 409 | #ifndef PNG_DITHER_RED_BITS 410 | # define PNG_DITHER_RED_BITS 5 411 | #endif 412 | #ifndef PNG_DITHER_GREEN_BITS 413 | # define PNG_DITHER_GREEN_BITS 5 414 | #endif 415 | #ifndef PNG_DITHER_BLUE_BITS 416 | # define PNG_DITHER_BLUE_BITS 5 417 | #endif 418 | 419 | /* This controls how fine the gamma correction becomes when you 420 | * are only interested in 8 bits anyway. Increasing this value 421 | * results in more memory being used, and more pow() functions 422 | * being called to fill in the gamma tables. Don't set this value 423 | * less then 8, and even that may not work (I haven't tested it). 424 | */ 425 | 426 | #ifndef PNG_MAX_GAMMA_8 427 | # define PNG_MAX_GAMMA_8 11 428 | #endif 429 | 430 | /* This controls how much a difference in gamma we can tolerate before 431 | * we actually start doing gamma conversion. 432 | */ 433 | #ifndef PNG_GAMMA_THRESHOLD 434 | # define PNG_GAMMA_THRESHOLD 0.05 435 | #endif 436 | 437 | #endif /* PNG_INTERNAL */ 438 | 439 | /* The following uses const char * instead of char * for error 440 | * and warning message functions, so some compilers won't complain. 441 | * If you do not want to use const, define PNG_NO_CONST here. 442 | */ 443 | 444 | #ifndef PNG_NO_CONST 445 | # define PNG_CONST const 446 | #else 447 | # define PNG_CONST 448 | #endif 449 | 450 | /* The following defines give you the ability to remove code from the 451 | * library that you will not be using. I wish I could figure out how to 452 | * automate this, but I can't do that without making it seriously hard 453 | * on the users. So if you are not using an ability, change the #define 454 | * to and #undef, and that part of the library will not be compiled. If 455 | * your linker can't find a function, you may want to make sure the 456 | * ability is defined here. Some of these depend upon some others being 457 | * defined. I haven't figured out all the interactions here, so you may 458 | * have to experiment awhile to get everything to compile. If you are 459 | * creating or using a shared library, you probably shouldn't touch this, 460 | * as it will affect the size of the structures, and this will cause bad 461 | * things to happen if the library and/or application ever change. 462 | */ 463 | 464 | /* Any features you will not be using can be undef'ed here */ 465 | 466 | /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user 467 | * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS 468 | * on the compile line, then pick and choose which ones to define without 469 | * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED 470 | * if you only want to have a png-compliant reader/writer but don't need 471 | * any of the extra transformations. This saves about 80 kbytes in a 472 | * typical installation of the library. (PNG_NO_* form added in version 473 | * 1.0.1c, for consistency) 474 | */ 475 | 476 | /* The size of the png_text structure changed in libpng-1.0.6 when 477 | * iTXt support was added. iTXt support was turned off by default through 478 | * libpng-1.2.x, to support old apps that malloc the png_text structure 479 | * instead of calling png_set_text() and letting libpng malloc it. It 480 | * was turned on by default in libpng-1.3.0. 481 | */ 482 | 483 | #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 484 | # ifndef PNG_NO_iTXt_SUPPORTED 485 | # define PNG_NO_iTXt_SUPPORTED 486 | # endif 487 | # ifndef PNG_NO_READ_iTXt 488 | # define PNG_NO_READ_iTXt 489 | # endif 490 | # ifndef PNG_NO_WRITE_iTXt 491 | # define PNG_NO_WRITE_iTXt 492 | # endif 493 | #endif 494 | 495 | #if !defined(PNG_NO_iTXt_SUPPORTED) 496 | # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) 497 | # define PNG_READ_iTXt 498 | # endif 499 | # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) 500 | # define PNG_WRITE_iTXt 501 | # endif 502 | #endif 503 | 504 | /* The following support, added after version 1.0.0, can be turned off here en 505 | * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility 506 | * with old applications that require the length of png_struct and png_info 507 | * to remain unchanged. 508 | */ 509 | 510 | #ifdef PNG_LEGACY_SUPPORTED 511 | # define PNG_NO_FREE_ME 512 | # define PNG_NO_READ_UNKNOWN_CHUNKS 513 | # define PNG_NO_WRITE_UNKNOWN_CHUNKS 514 | # define PNG_NO_READ_USER_CHUNKS 515 | # define PNG_NO_READ_iCCP 516 | # define PNG_NO_WRITE_iCCP 517 | # define PNG_NO_READ_iTXt 518 | # define PNG_NO_WRITE_iTXt 519 | # define PNG_NO_READ_sCAL 520 | # define PNG_NO_WRITE_sCAL 521 | # define PNG_NO_READ_sPLT 522 | # define PNG_NO_WRITE_sPLT 523 | # define PNG_NO_INFO_IMAGE 524 | # define PNG_NO_READ_RGB_TO_GRAY 525 | # define PNG_NO_READ_USER_TRANSFORM 526 | # define PNG_NO_WRITE_USER_TRANSFORM 527 | # define PNG_NO_USER_MEM 528 | # define PNG_NO_READ_EMPTY_PLTE 529 | # define PNG_NO_MNG_FEATURES 530 | # define PNG_NO_FIXED_POINT_SUPPORTED 531 | #endif 532 | 533 | /* Ignore attempt to turn off both floating and fixed point support */ 534 | #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ 535 | !defined(PNG_NO_FIXED_POINT_SUPPORTED) 536 | # define PNG_FIXED_POINT_SUPPORTED 537 | #endif 538 | 539 | #ifndef PNG_NO_FREE_ME 540 | # define PNG_FREE_ME_SUPPORTED 541 | #endif 542 | 543 | #if defined(PNG_READ_SUPPORTED) 544 | 545 | #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ 546 | !defined(PNG_NO_READ_TRANSFORMS) 547 | # define PNG_READ_TRANSFORMS_SUPPORTED 548 | #endif 549 | 550 | #ifdef PNG_READ_TRANSFORMS_SUPPORTED 551 | # ifndef PNG_NO_READ_EXPAND 552 | # define PNG_READ_EXPAND_SUPPORTED 553 | # endif 554 | # ifndef PNG_NO_READ_SHIFT 555 | # define PNG_READ_SHIFT_SUPPORTED 556 | # endif 557 | # ifndef PNG_NO_READ_PACK 558 | # define PNG_READ_PACK_SUPPORTED 559 | # endif 560 | # ifndef PNG_NO_READ_BGR 561 | # define PNG_READ_BGR_SUPPORTED 562 | # endif 563 | # ifndef PNG_NO_READ_SWAP 564 | # define PNG_READ_SWAP_SUPPORTED 565 | # endif 566 | # ifndef PNG_NO_READ_PACKSWAP 567 | # define PNG_READ_PACKSWAP_SUPPORTED 568 | # endif 569 | # ifndef PNG_NO_READ_INVERT 570 | # define PNG_READ_INVERT_SUPPORTED 571 | # endif 572 | # ifndef PNG_NO_READ_DITHER 573 | # define PNG_READ_DITHER_SUPPORTED 574 | # endif 575 | # ifndef PNG_NO_READ_BACKGROUND 576 | # define PNG_READ_BACKGROUND_SUPPORTED 577 | # endif 578 | # ifndef PNG_NO_READ_16_TO_8 579 | # define PNG_READ_16_TO_8_SUPPORTED 580 | # endif 581 | # ifndef PNG_NO_READ_FILLER 582 | # define PNG_READ_FILLER_SUPPORTED 583 | # endif 584 | # ifndef PNG_NO_READ_GAMMA 585 | # define PNG_READ_GAMMA_SUPPORTED 586 | # endif 587 | # ifndef PNG_NO_READ_GRAY_TO_RGB 588 | # define PNG_READ_GRAY_TO_RGB_SUPPORTED 589 | # endif 590 | # ifndef PNG_NO_READ_SWAP_ALPHA 591 | # define PNG_READ_SWAP_ALPHA_SUPPORTED 592 | # endif 593 | # ifndef PNG_NO_READ_INVERT_ALPHA 594 | # define PNG_READ_INVERT_ALPHA_SUPPORTED 595 | # endif 596 | # ifndef PNG_NO_READ_STRIP_ALPHA 597 | # define PNG_READ_STRIP_ALPHA_SUPPORTED 598 | # endif 599 | # ifndef PNG_NO_READ_USER_TRANSFORM 600 | # define PNG_READ_USER_TRANSFORM_SUPPORTED 601 | # endif 602 | # ifndef PNG_NO_READ_RGB_TO_GRAY 603 | # define PNG_READ_RGB_TO_GRAY_SUPPORTED 604 | # endif 605 | #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ 606 | 607 | #if !defined(PNG_NO_PROGRESSIVE_READ) && \ 608 | !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ 609 | # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ 610 | #endif /* about interlacing capability! You'll */ 611 | /* still have interlacing unless you change the following line: */ 612 | 613 | #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ 614 | 615 | #ifndef PNG_NO_READ_COMPOSITE_NODIV 616 | # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ 617 | # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ 618 | # endif 619 | #endif 620 | 621 | #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 622 | /* Deprecated, will be removed from version 2.0.0. 623 | Use PNG_MNG_FEATURES_SUPPORTED instead. */ 624 | #ifndef PNG_NO_READ_EMPTY_PLTE 625 | # define PNG_READ_EMPTY_PLTE_SUPPORTED 626 | #endif 627 | #endif 628 | 629 | #endif /* PNG_READ_SUPPORTED */ 630 | 631 | #if defined(PNG_WRITE_SUPPORTED) 632 | 633 | # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ 634 | !defined(PNG_NO_WRITE_TRANSFORMS) 635 | # define PNG_WRITE_TRANSFORMS_SUPPORTED 636 | #endif 637 | 638 | #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED 639 | # ifndef PNG_NO_WRITE_SHIFT 640 | # define PNG_WRITE_SHIFT_SUPPORTED 641 | # endif 642 | # ifndef PNG_NO_WRITE_PACK 643 | # define PNG_WRITE_PACK_SUPPORTED 644 | # endif 645 | # ifndef PNG_NO_WRITE_BGR 646 | # define PNG_WRITE_BGR_SUPPORTED 647 | # endif 648 | # ifndef PNG_NO_WRITE_SWAP 649 | # define PNG_WRITE_SWAP_SUPPORTED 650 | # endif 651 | # ifndef PNG_NO_WRITE_PACKSWAP 652 | # define PNG_WRITE_PACKSWAP_SUPPORTED 653 | # endif 654 | # ifndef PNG_NO_WRITE_INVERT 655 | # define PNG_WRITE_INVERT_SUPPORTED 656 | # endif 657 | # ifndef PNG_NO_WRITE_FILLER 658 | # define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ 659 | # endif 660 | # ifndef PNG_NO_WRITE_SWAP_ALPHA 661 | # define PNG_WRITE_SWAP_ALPHA_SUPPORTED 662 | # endif 663 | # ifndef PNG_NO_WRITE_INVERT_ALPHA 664 | # define PNG_WRITE_INVERT_ALPHA_SUPPORTED 665 | # endif 666 | # ifndef PNG_NO_WRITE_USER_TRANSFORM 667 | # define PNG_WRITE_USER_TRANSFORM_SUPPORTED 668 | # endif 669 | #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ 670 | 671 | #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ 672 | !defined(PNG_WRITE_INTERLACING_SUPPORTED) 673 | #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant 674 | encoders, but can cause trouble 675 | if left undefined */ 676 | #endif 677 | 678 | #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ 679 | !defined(PNG_WRITE_WEIGHTED_FILTER) && \ 680 | defined(PNG_FLOATING_POINT_SUPPORTED) 681 | # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED 682 | #endif 683 | 684 | #ifndef PNG_NO_WRITE_FLUSH 685 | # define PNG_WRITE_FLUSH_SUPPORTED 686 | #endif 687 | 688 | #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 689 | /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ 690 | #ifndef PNG_NO_WRITE_EMPTY_PLTE 691 | # define PNG_WRITE_EMPTY_PLTE_SUPPORTED 692 | #endif 693 | #endif 694 | 695 | #endif /* PNG_WRITE_SUPPORTED */ 696 | 697 | #ifndef PNG_1_0_X 698 | # ifndef PNG_NO_ERROR_NUMBERS 699 | # define PNG_ERROR_NUMBERS_SUPPORTED 700 | # endif 701 | #endif /* PNG_1_0_X */ 702 | 703 | #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ 704 | defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) 705 | # ifndef PNG_NO_USER_TRANSFORM_PTR 706 | # define PNG_USER_TRANSFORM_PTR_SUPPORTED 707 | # endif 708 | #endif 709 | 710 | #ifndef PNG_NO_STDIO 711 | # define PNG_TIME_RFC1123_SUPPORTED 712 | #endif 713 | 714 | /* This adds extra functions in pngget.c for accessing data from the 715 | * info pointer (added in version 0.99) 716 | * png_get_image_width() 717 | * png_get_image_height() 718 | * png_get_bit_depth() 719 | * png_get_color_type() 720 | * png_get_compression_type() 721 | * png_get_filter_type() 722 | * png_get_interlace_type() 723 | * png_get_pixel_aspect_ratio() 724 | * png_get_pixels_per_meter() 725 | * png_get_x_offset_pixels() 726 | * png_get_y_offset_pixels() 727 | * png_get_x_offset_microns() 728 | * png_get_y_offset_microns() 729 | */ 730 | #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) 731 | # define PNG_EASY_ACCESS_SUPPORTED 732 | #endif 733 | 734 | /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 735 | * and removed from version 1.2.20. The following will be removed 736 | * from libpng-1.4.0 737 | */ 738 | 739 | #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) 740 | # ifndef PNG_OPTIMIZED_CODE_SUPPORTED 741 | # define PNG_OPTIMIZED_CODE_SUPPORTED 742 | # endif 743 | #endif 744 | 745 | #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) 746 | # ifndef PNG_ASSEMBLER_CODE_SUPPORTED 747 | # define PNG_ASSEMBLER_CODE_SUPPORTED 748 | # endif 749 | 750 | # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) 751 | /* work around 64-bit gcc compiler bugs in gcc-3.x */ 752 | # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 753 | # define PNG_NO_MMX_CODE 754 | # endif 755 | # endif 756 | 757 | # if defined(__APPLE__) 758 | # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 759 | # define PNG_NO_MMX_CODE 760 | # endif 761 | # endif 762 | 763 | # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) 764 | # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 765 | # define PNG_NO_MMX_CODE 766 | # endif 767 | # endif 768 | 769 | # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 770 | # define PNG_MMX_CODE_SUPPORTED 771 | # endif 772 | 773 | #endif 774 | /* end of obsolete code to be removed from libpng-1.4.0 */ 775 | 776 | #if !defined(PNG_1_0_X) 777 | #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) 778 | # define PNG_USER_MEM_SUPPORTED 779 | #endif 780 | #endif /* PNG_1_0_X */ 781 | 782 | /* Added at libpng-1.2.6 */ 783 | #if !defined(PNG_1_0_X) 784 | #ifndef PNG_SET_USER_LIMITS_SUPPORTED 785 | #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) 786 | # define PNG_SET_USER_LIMITS_SUPPORTED 787 | #endif 788 | #endif 789 | #endif /* PNG_1_0_X */ 790 | 791 | /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter 792 | * how large, set these limits to 0x7fffffffL 793 | */ 794 | #ifndef PNG_USER_WIDTH_MAX 795 | # define PNG_USER_WIDTH_MAX 1000000L 796 | #endif 797 | #ifndef PNG_USER_HEIGHT_MAX 798 | # define PNG_USER_HEIGHT_MAX 1000000L 799 | #endif 800 | 801 | /* These are currently experimental features, define them if you want */ 802 | 803 | /* very little testing */ 804 | /* 805 | #ifdef PNG_READ_SUPPORTED 806 | # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED 807 | # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED 808 | # endif 809 | #endif 810 | */ 811 | 812 | /* This is only for PowerPC big-endian and 680x0 systems */ 813 | /* some testing */ 814 | /* 815 | #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED 816 | # define PNG_READ_BIG_ENDIAN_SUPPORTED 817 | #endif 818 | */ 819 | 820 | /* Buggy compilers (e.g., gcc 2.7.2.2) need this */ 821 | /* 822 | #define PNG_NO_POINTER_INDEXING 823 | */ 824 | 825 | /* These functions are turned off by default, as they will be phased out. */ 826 | /* 827 | #define PNG_USELESS_TESTS_SUPPORTED 828 | #define PNG_CORRECT_PALETTE_SUPPORTED 829 | */ 830 | 831 | /* Any chunks you are not interested in, you can undef here. The 832 | * ones that allocate memory may be expecially important (hIST, 833 | * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info 834 | * a bit smaller. 835 | */ 836 | 837 | #if defined(PNG_READ_SUPPORTED) && \ 838 | !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ 839 | !defined(PNG_NO_READ_ANCILLARY_CHUNKS) 840 | # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED 841 | #endif 842 | 843 | #if defined(PNG_WRITE_SUPPORTED) && \ 844 | !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ 845 | !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) 846 | # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED 847 | #endif 848 | 849 | #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED 850 | 851 | #ifdef PNG_NO_READ_TEXT 852 | # define PNG_NO_READ_iTXt 853 | # define PNG_NO_READ_tEXt 854 | # define PNG_NO_READ_zTXt 855 | #endif 856 | #ifndef PNG_NO_READ_bKGD 857 | # define PNG_READ_bKGD_SUPPORTED 858 | # define PNG_bKGD_SUPPORTED 859 | #endif 860 | #ifndef PNG_NO_READ_cHRM 861 | # define PNG_READ_cHRM_SUPPORTED 862 | # define PNG_cHRM_SUPPORTED 863 | #endif 864 | #ifndef PNG_NO_READ_gAMA 865 | # define PNG_READ_gAMA_SUPPORTED 866 | # define PNG_gAMA_SUPPORTED 867 | #endif 868 | #ifndef PNG_NO_READ_hIST 869 | # define PNG_READ_hIST_SUPPORTED 870 | # define PNG_hIST_SUPPORTED 871 | #endif 872 | #ifndef PNG_NO_READ_iCCP 873 | # define PNG_READ_iCCP_SUPPORTED 874 | # define PNG_iCCP_SUPPORTED 875 | #endif 876 | #ifndef PNG_NO_READ_iTXt 877 | # ifndef PNG_READ_iTXt_SUPPORTED 878 | # define PNG_READ_iTXt_SUPPORTED 879 | # endif 880 | # ifndef PNG_iTXt_SUPPORTED 881 | # define PNG_iTXt_SUPPORTED 882 | # endif 883 | #endif 884 | #ifndef PNG_NO_READ_oFFs 885 | # define PNG_READ_oFFs_SUPPORTED 886 | # define PNG_oFFs_SUPPORTED 887 | #endif 888 | #ifndef PNG_NO_READ_pCAL 889 | # define PNG_READ_pCAL_SUPPORTED 890 | # define PNG_pCAL_SUPPORTED 891 | #endif 892 | #ifndef PNG_NO_READ_sCAL 893 | # define PNG_READ_sCAL_SUPPORTED 894 | # define PNG_sCAL_SUPPORTED 895 | #endif 896 | #ifndef PNG_NO_READ_pHYs 897 | # define PNG_READ_pHYs_SUPPORTED 898 | # define PNG_pHYs_SUPPORTED 899 | #endif 900 | #ifndef PNG_NO_READ_sBIT 901 | # define PNG_READ_sBIT_SUPPORTED 902 | # define PNG_sBIT_SUPPORTED 903 | #endif 904 | #ifndef PNG_NO_READ_sPLT 905 | # define PNG_READ_sPLT_SUPPORTED 906 | # define PNG_sPLT_SUPPORTED 907 | #endif 908 | #ifndef PNG_NO_READ_sRGB 909 | # define PNG_READ_sRGB_SUPPORTED 910 | # define PNG_sRGB_SUPPORTED 911 | #endif 912 | #ifndef PNG_NO_READ_tEXt 913 | # define PNG_READ_tEXt_SUPPORTED 914 | # define PNG_tEXt_SUPPORTED 915 | #endif 916 | #ifndef PNG_NO_READ_tIME 917 | # define PNG_READ_tIME_SUPPORTED 918 | # define PNG_tIME_SUPPORTED 919 | #endif 920 | #ifndef PNG_NO_READ_tRNS 921 | # define PNG_READ_tRNS_SUPPORTED 922 | # define PNG_tRNS_SUPPORTED 923 | #endif 924 | #ifndef PNG_NO_READ_zTXt 925 | # define PNG_READ_zTXt_SUPPORTED 926 | # define PNG_zTXt_SUPPORTED 927 | #endif 928 | #ifndef PNG_NO_READ_UNKNOWN_CHUNKS 929 | # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED 930 | # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED 931 | # define PNG_UNKNOWN_CHUNKS_SUPPORTED 932 | # endif 933 | # ifndef PNG_NO_HANDLE_AS_UNKNOWN 934 | # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED 935 | # endif 936 | #endif 937 | #if !defined(PNG_NO_READ_USER_CHUNKS) && \ 938 | defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) 939 | # define PNG_READ_USER_CHUNKS_SUPPORTED 940 | # define PNG_USER_CHUNKS_SUPPORTED 941 | # ifdef PNG_NO_READ_UNKNOWN_CHUNKS 942 | # undef PNG_NO_READ_UNKNOWN_CHUNKS 943 | # endif 944 | # ifdef PNG_NO_HANDLE_AS_UNKNOWN 945 | # undef PNG_NO_HANDLE_AS_UNKNOWN 946 | # endif 947 | #endif 948 | #ifndef PNG_NO_READ_OPT_PLTE 949 | # define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ 950 | #endif /* optional PLTE chunk in RGB and RGBA images */ 951 | #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ 952 | defined(PNG_READ_zTXt_SUPPORTED) 953 | # define PNG_READ_TEXT_SUPPORTED 954 | # define PNG_TEXT_SUPPORTED 955 | #endif 956 | 957 | #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ 958 | 959 | #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED 960 | 961 | #ifdef PNG_NO_WRITE_TEXT 962 | # define PNG_NO_WRITE_iTXt 963 | # define PNG_NO_WRITE_tEXt 964 | # define PNG_NO_WRITE_zTXt 965 | #endif 966 | #ifndef PNG_NO_WRITE_bKGD 967 | # define PNG_WRITE_bKGD_SUPPORTED 968 | # ifndef PNG_bKGD_SUPPORTED 969 | # define PNG_bKGD_SUPPORTED 970 | # endif 971 | #endif 972 | #ifndef PNG_NO_WRITE_cHRM 973 | # define PNG_WRITE_cHRM_SUPPORTED 974 | # ifndef PNG_cHRM_SUPPORTED 975 | # define PNG_cHRM_SUPPORTED 976 | # endif 977 | #endif 978 | #ifndef PNG_NO_WRITE_gAMA 979 | # define PNG_WRITE_gAMA_SUPPORTED 980 | # ifndef PNG_gAMA_SUPPORTED 981 | # define PNG_gAMA_SUPPORTED 982 | # endif 983 | #endif 984 | #ifndef PNG_NO_WRITE_hIST 985 | # define PNG_WRITE_hIST_SUPPORTED 986 | # ifndef PNG_hIST_SUPPORTED 987 | # define PNG_hIST_SUPPORTED 988 | # endif 989 | #endif 990 | #ifndef PNG_NO_WRITE_iCCP 991 | # define PNG_WRITE_iCCP_SUPPORTED 992 | # ifndef PNG_iCCP_SUPPORTED 993 | # define PNG_iCCP_SUPPORTED 994 | # endif 995 | #endif 996 | #ifndef PNG_NO_WRITE_iTXt 997 | # ifndef PNG_WRITE_iTXt_SUPPORTED 998 | # define PNG_WRITE_iTXt_SUPPORTED 999 | # endif 1000 | # ifndef PNG_iTXt_SUPPORTED 1001 | # define PNG_iTXt_SUPPORTED 1002 | # endif 1003 | #endif 1004 | #ifndef PNG_NO_WRITE_oFFs 1005 | # define PNG_WRITE_oFFs_SUPPORTED 1006 | # ifndef PNG_oFFs_SUPPORTED 1007 | # define PNG_oFFs_SUPPORTED 1008 | # endif 1009 | #endif 1010 | #ifndef PNG_NO_WRITE_pCAL 1011 | # define PNG_WRITE_pCAL_SUPPORTED 1012 | # ifndef PNG_pCAL_SUPPORTED 1013 | # define PNG_pCAL_SUPPORTED 1014 | # endif 1015 | #endif 1016 | #ifndef PNG_NO_WRITE_sCAL 1017 | # define PNG_WRITE_sCAL_SUPPORTED 1018 | # ifndef PNG_sCAL_SUPPORTED 1019 | # define PNG_sCAL_SUPPORTED 1020 | # endif 1021 | #endif 1022 | #ifndef PNG_NO_WRITE_pHYs 1023 | # define PNG_WRITE_pHYs_SUPPORTED 1024 | # ifndef PNG_pHYs_SUPPORTED 1025 | # define PNG_pHYs_SUPPORTED 1026 | # endif 1027 | #endif 1028 | #ifndef PNG_NO_WRITE_sBIT 1029 | # define PNG_WRITE_sBIT_SUPPORTED 1030 | # ifndef PNG_sBIT_SUPPORTED 1031 | # define PNG_sBIT_SUPPORTED 1032 | # endif 1033 | #endif 1034 | #ifndef PNG_NO_WRITE_sPLT 1035 | # define PNG_WRITE_sPLT_SUPPORTED 1036 | # ifndef PNG_sPLT_SUPPORTED 1037 | # define PNG_sPLT_SUPPORTED 1038 | # endif 1039 | #endif 1040 | #ifndef PNG_NO_WRITE_sRGB 1041 | # define PNG_WRITE_sRGB_SUPPORTED 1042 | # ifndef PNG_sRGB_SUPPORTED 1043 | # define PNG_sRGB_SUPPORTED 1044 | # endif 1045 | #endif 1046 | #ifndef PNG_NO_WRITE_tEXt 1047 | # define PNG_WRITE_tEXt_SUPPORTED 1048 | # ifndef PNG_tEXt_SUPPORTED 1049 | # define PNG_tEXt_SUPPORTED 1050 | # endif 1051 | #endif 1052 | #ifndef PNG_NO_WRITE_tIME 1053 | # define PNG_WRITE_tIME_SUPPORTED 1054 | # ifndef PNG_tIME_SUPPORTED 1055 | # define PNG_tIME_SUPPORTED 1056 | # endif 1057 | #endif 1058 | #ifndef PNG_NO_WRITE_tRNS 1059 | # define PNG_WRITE_tRNS_SUPPORTED 1060 | # ifndef PNG_tRNS_SUPPORTED 1061 | # define PNG_tRNS_SUPPORTED 1062 | # endif 1063 | #endif 1064 | #ifndef PNG_NO_WRITE_zTXt 1065 | # define PNG_WRITE_zTXt_SUPPORTED 1066 | # ifndef PNG_zTXt_SUPPORTED 1067 | # define PNG_zTXt_SUPPORTED 1068 | # endif 1069 | #endif 1070 | #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS 1071 | # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 1072 | # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED 1073 | # define PNG_UNKNOWN_CHUNKS_SUPPORTED 1074 | # endif 1075 | # ifndef PNG_NO_HANDLE_AS_UNKNOWN 1076 | # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1077 | # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1078 | # endif 1079 | # endif 1080 | #endif 1081 | #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ 1082 | defined(PNG_WRITE_zTXt_SUPPORTED) 1083 | # define PNG_WRITE_TEXT_SUPPORTED 1084 | # ifndef PNG_TEXT_SUPPORTED 1085 | # define PNG_TEXT_SUPPORTED 1086 | # endif 1087 | #endif 1088 | 1089 | #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ 1090 | 1091 | /* Turn this off to disable png_read_png() and 1092 | * png_write_png() and leave the row_pointers member 1093 | * out of the info structure. 1094 | */ 1095 | #ifndef PNG_NO_INFO_IMAGE 1096 | # define PNG_INFO_IMAGE_SUPPORTED 1097 | #endif 1098 | 1099 | /* need the time information for reading tIME chunks */ 1100 | #if defined(PNG_tIME_SUPPORTED) 1101 | # if !defined(_WIN32_WCE) 1102 | /* "time.h" functions are not supported on WindowsCE */ 1103 | # include 1104 | # endif 1105 | #endif 1106 | 1107 | /* Some typedefs to get us started. These should be safe on most of the 1108 | * common platforms. The typedefs should be at least as large as the 1109 | * numbers suggest (a png_uint_32 must be at least 32 bits long), but they 1110 | * don't have to be exactly that size. Some compilers dislike passing 1111 | * unsigned shorts as function parameters, so you may be better off using 1112 | * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may 1113 | * want to have unsigned int for png_uint_32 instead of unsigned long. 1114 | */ 1115 | 1116 | typedef unsigned long png_uint_32; 1117 | typedef long png_int_32; 1118 | typedef unsigned short png_uint_16; 1119 | typedef short png_int_16; 1120 | typedef unsigned char png_byte; 1121 | 1122 | /* This is usually size_t. It is typedef'ed just in case you need it to 1123 | change (I'm not sure if you will or not, so I thought I'd be safe) */ 1124 | #ifdef PNG_SIZE_T 1125 | typedef PNG_SIZE_T png_size_t; 1126 | # define png_sizeof(x) png_convert_size(sizeof (x)) 1127 | #else 1128 | typedef size_t png_size_t; 1129 | # define png_sizeof(x) sizeof (x) 1130 | #endif 1131 | 1132 | /* The following is needed for medium model support. It cannot be in the 1133 | * PNG_INTERNAL section. Needs modification for other compilers besides 1134 | * MSC. Model independent support declares all arrays and pointers to be 1135 | * large using the far keyword. The zlib version used must also support 1136 | * model independent data. As of version zlib 1.0.4, the necessary changes 1137 | * have been made in zlib. The USE_FAR_KEYWORD define triggers other 1138 | * changes that are needed. (Tim Wegner) 1139 | */ 1140 | 1141 | /* Separate compiler dependencies (problem here is that zlib.h always 1142 | defines FAR. (SJT) */ 1143 | #ifdef __BORLANDC__ 1144 | # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) 1145 | # define LDATA 1 1146 | # else 1147 | # define LDATA 0 1148 | # endif 1149 | /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ 1150 | # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) 1151 | # define PNG_MAX_MALLOC_64K 1152 | # if (LDATA != 1) 1153 | # ifndef FAR 1154 | # define FAR __far 1155 | # endif 1156 | # define USE_FAR_KEYWORD 1157 | # endif /* LDATA != 1 */ 1158 | /* Possibly useful for moving data out of default segment. 1159 | * Uncomment it if you want. Could also define FARDATA as 1160 | * const if your compiler supports it. (SJT) 1161 | # define FARDATA FAR 1162 | */ 1163 | # endif /* __WIN32__, __FLAT__, __CYGWIN__ */ 1164 | #endif /* __BORLANDC__ */ 1165 | 1166 | 1167 | /* Suggest testing for specific compiler first before testing for 1168 | * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, 1169 | * making reliance oncertain keywords suspect. (SJT) 1170 | */ 1171 | 1172 | /* MSC Medium model */ 1173 | #if defined(FAR) 1174 | # if defined(M_I86MM) 1175 | # define USE_FAR_KEYWORD 1176 | # define FARDATA FAR 1177 | # include 1178 | # endif 1179 | #endif 1180 | 1181 | /* SJT: default case */ 1182 | #ifndef FAR 1183 | # define FAR 1184 | #endif 1185 | 1186 | /* At this point FAR is always defined */ 1187 | #ifndef FARDATA 1188 | # define FARDATA 1189 | #endif 1190 | 1191 | /* Typedef for floating-point numbers that are converted 1192 | to fixed-point with a multiple of 100,000, e.g., int_gamma */ 1193 | typedef png_int_32 png_fixed_point; 1194 | 1195 | /* Add typedefs for pointers */ 1196 | typedef void FAR * png_voidp; 1197 | typedef png_byte FAR * png_bytep; 1198 | typedef png_uint_32 FAR * png_uint_32p; 1199 | typedef png_int_32 FAR * png_int_32p; 1200 | typedef png_uint_16 FAR * png_uint_16p; 1201 | typedef png_int_16 FAR * png_int_16p; 1202 | typedef PNG_CONST char FAR * png_const_charp; 1203 | typedef char FAR * png_charp; 1204 | typedef png_fixed_point FAR * png_fixed_point_p; 1205 | 1206 | #ifndef PNG_NO_STDIO 1207 | #if defined(_WIN32_WCE) 1208 | typedef HANDLE png_FILE_p; 1209 | #else 1210 | typedef FILE * png_FILE_p; 1211 | #endif 1212 | #endif 1213 | 1214 | #ifdef PNG_FLOATING_POINT_SUPPORTED 1215 | typedef double FAR * png_doublep; 1216 | #endif 1217 | 1218 | /* Pointers to pointers; i.e. arrays */ 1219 | typedef png_byte FAR * FAR * png_bytepp; 1220 | typedef png_uint_32 FAR * FAR * png_uint_32pp; 1221 | typedef png_int_32 FAR * FAR * png_int_32pp; 1222 | typedef png_uint_16 FAR * FAR * png_uint_16pp; 1223 | typedef png_int_16 FAR * FAR * png_int_16pp; 1224 | typedef PNG_CONST char FAR * FAR * png_const_charpp; 1225 | typedef char FAR * FAR * png_charpp; 1226 | typedef png_fixed_point FAR * FAR * png_fixed_point_pp; 1227 | #ifdef PNG_FLOATING_POINT_SUPPORTED 1228 | typedef double FAR * FAR * png_doublepp; 1229 | #endif 1230 | 1231 | /* Pointers to pointers to pointers; i.e., pointer to array */ 1232 | typedef char FAR * FAR * FAR * png_charppp; 1233 | 1234 | #if defined(PNG_1_0_X) || defined(PNG_1_2_X) 1235 | /* SPC - Is this stuff deprecated? */ 1236 | /* It'll be removed as of libpng-1.3.0 - GR-P */ 1237 | /* libpng typedefs for types in zlib. If zlib changes 1238 | * or another compression library is used, then change these. 1239 | * Eliminates need to change all the source files. 1240 | */ 1241 | typedef charf * png_zcharp; 1242 | typedef charf * FAR * png_zcharpp; 1243 | typedef z_stream FAR * png_zstreamp; 1244 | #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ 1245 | 1246 | /* 1247 | * Define PNG_BUILD_DLL if the module being built is a Windows 1248 | * LIBPNG DLL. 1249 | * 1250 | * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. 1251 | * It is equivalent to Microsoft predefined macro _DLL that is 1252 | * automatically defined when you compile using the share 1253 | * version of the CRT (C Run-Time library) 1254 | * 1255 | * The cygwin mods make this behavior a little different: 1256 | * Define PNG_BUILD_DLL if you are building a dll for use with cygwin 1257 | * Define PNG_STATIC if you are building a static library for use with cygwin, 1258 | * -or- if you are building an application that you want to link to the 1259 | * static library. 1260 | * PNG_USE_DLL is defined by default (no user action needed) unless one of 1261 | * the other flags is defined. 1262 | */ 1263 | 1264 | #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) 1265 | # define PNG_DLL 1266 | #endif 1267 | /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. 1268 | * When building a static lib, default to no GLOBAL ARRAYS, but allow 1269 | * command-line override 1270 | */ 1271 | #if defined(__CYGWIN__) 1272 | # if !defined(PNG_STATIC) 1273 | # if defined(PNG_USE_GLOBAL_ARRAYS) 1274 | # undef PNG_USE_GLOBAL_ARRAYS 1275 | # endif 1276 | # if !defined(PNG_USE_LOCAL_ARRAYS) 1277 | # define PNG_USE_LOCAL_ARRAYS 1278 | # endif 1279 | # else 1280 | # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) 1281 | # if defined(PNG_USE_GLOBAL_ARRAYS) 1282 | # undef PNG_USE_GLOBAL_ARRAYS 1283 | # endif 1284 | # endif 1285 | # endif 1286 | # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) 1287 | # define PNG_USE_LOCAL_ARRAYS 1288 | # endif 1289 | #endif 1290 | 1291 | /* Do not use global arrays (helps with building DLL's) 1292 | * They are no longer used in libpng itself, since version 1.0.5c, 1293 | * but might be required for some pre-1.0.5c applications. 1294 | */ 1295 | #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) 1296 | # if defined(PNG_NO_GLOBAL_ARRAYS) || \ 1297 | (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) 1298 | # define PNG_USE_LOCAL_ARRAYS 1299 | # else 1300 | # define PNG_USE_GLOBAL_ARRAYS 1301 | # endif 1302 | #endif 1303 | 1304 | #if defined(__CYGWIN__) 1305 | # undef PNGAPI 1306 | # define PNGAPI __cdecl 1307 | # undef PNG_IMPEXP 1308 | # define PNG_IMPEXP 1309 | #endif 1310 | 1311 | /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", 1312 | * you may get warnings regarding the linkage of png_zalloc and png_zfree. 1313 | * Don't ignore those warnings; you must also reset the default calling 1314 | * convention in your compiler to match your PNGAPI, and you must build 1315 | * zlib and your applications the same way you build libpng. 1316 | */ 1317 | 1318 | #if defined(__MINGW32__) && !defined(PNG_MODULEDEF) 1319 | # ifndef PNG_NO_MODULEDEF 1320 | # define PNG_NO_MODULEDEF 1321 | # endif 1322 | #endif 1323 | 1324 | #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) 1325 | # define PNG_IMPEXP 1326 | #endif 1327 | 1328 | #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ 1329 | (( defined(_Windows) || defined(_WINDOWS) || \ 1330 | defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) 1331 | 1332 | # ifndef PNGAPI 1333 | # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) 1334 | # define PNGAPI __cdecl 1335 | # else 1336 | # define PNGAPI _cdecl 1337 | # endif 1338 | # endif 1339 | 1340 | # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ 1341 | 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) 1342 | # define PNG_IMPEXP 1343 | # endif 1344 | 1345 | # if !defined(PNG_IMPEXP) 1346 | 1347 | # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol 1348 | # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol 1349 | 1350 | /* Borland/Microsoft */ 1351 | # if defined(_MSC_VER) || defined(__BORLANDC__) 1352 | # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) 1353 | # define PNG_EXPORT PNG_EXPORT_TYPE1 1354 | # else 1355 | # define PNG_EXPORT PNG_EXPORT_TYPE2 1356 | # if defined(PNG_BUILD_DLL) 1357 | # define PNG_IMPEXP __export 1358 | # else 1359 | # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in 1360 | VC++ */ 1361 | # endif /* Exists in Borland C++ for 1362 | C++ classes (== huge) */ 1363 | # endif 1364 | # endif 1365 | 1366 | # if !defined(PNG_IMPEXP) 1367 | # if defined(PNG_BUILD_DLL) 1368 | # define PNG_IMPEXP __declspec(dllexport) 1369 | # else 1370 | # define PNG_IMPEXP __declspec(dllimport) 1371 | # endif 1372 | # endif 1373 | # endif /* PNG_IMPEXP */ 1374 | #else /* !(DLL || non-cygwin WINDOWS) */ 1375 | # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) 1376 | # ifndef PNGAPI 1377 | # define PNGAPI _System 1378 | # endif 1379 | # else 1380 | # if 0 /* ... other platforms, with other meanings */ 1381 | # endif 1382 | # endif 1383 | #endif 1384 | 1385 | #ifndef PNGAPI 1386 | # define PNGAPI 1387 | #endif 1388 | #ifndef PNG_IMPEXP 1389 | # define PNG_IMPEXP 1390 | #endif 1391 | 1392 | #ifdef PNG_BUILDSYMS 1393 | # ifndef PNG_EXPORT 1394 | # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END 1395 | # endif 1396 | # ifdef PNG_USE_GLOBAL_ARRAYS 1397 | # ifndef PNG_EXPORT_VAR 1398 | # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT 1399 | # endif 1400 | # endif 1401 | #endif 1402 | 1403 | #ifndef PNG_EXPORT 1404 | # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol 1405 | #endif 1406 | 1407 | #ifdef PNG_USE_GLOBAL_ARRAYS 1408 | # ifndef PNG_EXPORT_VAR 1409 | # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type 1410 | # endif 1411 | #endif 1412 | 1413 | /* User may want to use these so they are not in PNG_INTERNAL. Any library 1414 | * functions that are passed far data must be model independent. 1415 | */ 1416 | 1417 | #ifndef PNG_ABORT 1418 | # define PNG_ABORT() abort() 1419 | #endif 1420 | 1421 | #ifdef PNG_SETJMP_SUPPORTED 1422 | # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) 1423 | #else 1424 | # define png_jmpbuf(png_ptr) \ 1425 | (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) 1426 | #endif 1427 | 1428 | #if defined(USE_FAR_KEYWORD) /* memory model independent fns */ 1429 | /* use this to make far-to-near assignments */ 1430 | # define CHECK 1 1431 | # define NOCHECK 0 1432 | # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) 1433 | # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) 1434 | # define png_snprintf _fsnprintf /* Added to v 1.2.19 */ 1435 | # define png_strlen _fstrlen 1436 | # define png_memcmp _fmemcmp /* SJT: added */ 1437 | # define png_memcpy _fmemcpy 1438 | # define png_memset _fmemset 1439 | #else /* use the usual functions */ 1440 | # define CVT_PTR(ptr) (ptr) 1441 | # define CVT_PTR_NOCHECK(ptr) (ptr) 1442 | # ifndef PNG_NO_SNPRINTF 1443 | # ifdef _MSC_VER 1444 | # define png_snprintf _snprintf /* Added to v 1.2.19 */ 1445 | # define png_snprintf2 _snprintf 1446 | # define png_snprintf6 _snprintf 1447 | # else 1448 | # define png_snprintf snprintf /* Added to v 1.2.19 */ 1449 | # define png_snprintf2 snprintf 1450 | # define png_snprintf6 snprintf 1451 | # endif 1452 | # else 1453 | /* You don't have or don't want to use snprintf(). Caution: Using 1454 | * sprintf instead of snprintf exposes your application to accidental 1455 | * or malevolent buffer overflows. If you don't have snprintf() 1456 | * as a general rule you should provide one (you can get one from 1457 | * Portable OpenSSH). */ 1458 | # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) 1459 | # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) 1460 | # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ 1461 | sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) 1462 | # endif 1463 | # define png_strlen strlen 1464 | # define png_memcmp memcmp /* SJT: added */ 1465 | # define png_memcpy memcpy 1466 | # define png_memset memset 1467 | #endif 1468 | /* End of memory model independent support */ 1469 | 1470 | /* Just a little check that someone hasn't tried to define something 1471 | * contradictory. 1472 | */ 1473 | #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) 1474 | # undef PNG_ZBUF_SIZE 1475 | # define PNG_ZBUF_SIZE 65536L 1476 | #endif 1477 | 1478 | /* Added at libpng-1.2.8 */ 1479 | #endif /* PNG_VERSION_INFO_ONLY */ 1480 | 1481 | #endif /* PNGCONF_H */ 1482 | -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Versions/A/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/libpng.framework/Versions/A/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | libpng 9 | CFBundleIdentifier 10 | com.yourcompany.yourcocoaframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | libpng 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | 22 | 23 | -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Versions/A/libpng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/libpng.framework/Versions/A/libpng -------------------------------------------------------------------------------- /Frameworks/libpng.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Frameworks/libpng.framework/libpng: -------------------------------------------------------------------------------- 1 | Versions/Current/libpng -------------------------------------------------------------------------------- /Frameworks/plib.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/plib.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/sl.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net 20 | 21 | $Id: sl.h 1924 2004-04-06 13:32:26Z sjbaker $ 22 | */ 23 | 24 | 25 | #ifndef __SL_H__ 26 | #define __SL_H__ 1 27 | 28 | #include 29 | #include "slPortability.h" 30 | 31 | #ifdef SL_USING_OSS_AUDIO 32 | #define SLDSP_DEFAULT_DEVICE "/dev/dsp" 33 | #elif defined(UL_WIN32) 34 | #define SLDSP_DEFAULT_DEVICE "dsp" 35 | #elif defined(UL_BSD) 36 | #define SLDSP_DEFAULT_DEVICE "/dev/audio" 37 | #elif defined(UL_IRIX) 38 | #define SLDSP_DEFAULT_DEVICE "dsp" // dummy ... 39 | #elif defined(UL_AIX) 40 | #define SLDSP_DEFAULT_DEVICE "dsp" // dummy ... 41 | #elif defined(UL_SOLARIS) 42 | #define SLDSP_DEFAULT_DEVICE "/dev/audio" 43 | #elif defined(UL_HPUX) 44 | #define SLDSP_DEFAULT_DEVICE "/dev/audio" 45 | #elif defined(UL_MACINTOSH) || defined(UL_MAC_OSX) 46 | #define SLDSP_DEFAULT_DEVICE "dsp" // dummy 47 | #else 48 | #error "Port me !" 49 | #endif 50 | 51 | # define SL_TRUE 1 52 | # define SL_FALSE 0 53 | 54 | typedef unsigned char Uchar ; 55 | typedef unsigned short Ushort ; 56 | 57 | #define SL_DEFAULT_SAMPLING_RATE 11025 58 | 59 | class slSample ; 60 | class slPlayer ; 61 | class slSamplePlayer ; 62 | class slEnvelope ; 63 | class slScheduler ; 64 | class slDSP ; 65 | 66 | extern const char *__slPendingError ; 67 | 68 | class slDSP 69 | { 70 | private: 71 | 72 | int stereo ; 73 | int rate ; 74 | int bps ; 75 | 76 | int error ; 77 | int fd ; 78 | 79 | #if defined(SL_USING_OSS_AUDIO) 80 | audio_buf_info buff_info ; 81 | #elif defined(UL_BSD) 82 | audio_info_t ainfo; // ioctl structure 83 | audio_offset_t audio_offset; // offset in audiostream 84 | long counter; // counter-written packets 85 | #elif defined(UL_SOLARIS) 86 | audio_info_t ainfo; 87 | long counter; 88 | #elif defined(UL_IRIX) 89 | ALconfig config; // configuration stuff 90 | ALport port; // .. we are here 91 | #elif defined(UL_MACINTOSH) || defined(UL_MAC_OSX) 92 | 93 | // Size of the data chunks written with write(). 94 | // This should be a multiple of 1024. 95 | #define BUFFER_SIZE 8192 96 | 97 | // Size of storage space for sound data. 98 | // This should be evenly divisible by BUFFER_SIZE. 99 | #define VIRTUAL_BUFFER_SIZE 131072 100 | 101 | SndChannelPtr sndChannel ; // sound channel we are using 102 | ExtSoundHeader extSndHeader ; // sound header for bufferCmd 103 | SndCommand currentCmd ; // command we are sending to chnl 104 | OSErr osErr ; 105 | 106 | char *buf ; // buffer containing sound data 107 | char *rpos ; // read position for buffer 108 | char *wpos ; // write position for buffer 109 | char *ptr ; // ptr to data from write() 110 | 111 | float bytesPerSample ; // conversions 112 | float bytesPerSecond ; 113 | float secondsPerPacket ; 114 | 115 | float secLeft ; // seconds left in buffer 116 | float secUsed ; // seconds used in buffer 117 | UnsignedWide lastTime ; // used for timing in secondsUsed() 118 | UnsignedWide currTime ; 119 | 120 | #endif 121 | 122 | 123 | #if !defined(UL_WIN32) && !defined(UL_MACINTOSH) && !defined(UL_MAC_OSX) 124 | int ioctl ( int cmd, int param = 0 ) 125 | { 126 | if ( error ) return param ; 127 | 128 | if ( ::ioctl ( fd, cmd, & param ) == -1 ) 129 | { 130 | perror ( "slDSP: ioctl" ) ; 131 | error = SL_TRUE ; 132 | } 133 | 134 | return param ; 135 | } 136 | 137 | #elif defined(UL_WIN32) 138 | 139 | #define BUFFER_COUNT (3*8) 140 | #define BUFFER_SIZE (1024*1) 141 | 142 | friend void CALLBACK waveOutProc( HWAVEOUT hwo, UINT uMsg, 143 | DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); 144 | HWAVEOUT hWaveOut; // device handle 145 | WAVEFORMATEX Format; // open needs this 146 | MMTIME mmt; // timing 147 | WAVEHDR *wavehdr[ BUFFER_COUNT ]; // for round robin .. 148 | int curr_header; // index of actual wavehdr 149 | int counter; // counter-written packets 150 | DWORD written; // counter-written samples 151 | 152 | #endif 153 | 154 | void open ( const char *device, int _rate, int _stereo, int _bps ) ; 155 | void close () ; 156 | void getBufferInfo () ; 157 | void write ( void *buffer, size_t length ) ; 158 | 159 | protected: 160 | 161 | void setError () { error = SL_TRUE ; } 162 | int getDriverBufferSize () ; 163 | 164 | public: 165 | 166 | slDSP ( int _rate = SL_DEFAULT_SAMPLING_RATE, 167 | int _stereo = SL_FALSE, int _bps = 8 ) 168 | { 169 | open ( SLDSP_DEFAULT_DEVICE, _rate, _stereo, _bps ) ; 170 | } 171 | 172 | slDSP ( const char *device, int _rate = SL_DEFAULT_SAMPLING_RATE, 173 | int _stereo = SL_FALSE, int _bps = 8 ) 174 | { 175 | open ( device, _rate, _stereo, _bps ) ; 176 | } 177 | 178 | ~slDSP () { close () ; } 179 | 180 | float secondsRemaining () ; 181 | float secondsUsed () ; 182 | 183 | void play ( void *buffer, size_t length ) { write ( buffer, length ) ; } 184 | 185 | /* This was a typo - but people use it */ 186 | int not_working() const { return error ; } 187 | 188 | int notWorking () const { return error ; } 189 | 190 | int getBps () const { return bps ; } 191 | int getRate () const { return rate ; } 192 | int getStereo() const { return stereo ; } 193 | 194 | void sync () ; 195 | void stop () ; 196 | } ; 197 | 198 | 199 | class slSample 200 | { 201 | int ref_count ; 202 | protected: 203 | 204 | char *comment; 205 | int rate ; 206 | int bps ; 207 | int stereo ; 208 | 209 | Uchar *buffer ; 210 | int length ; 211 | 212 | void init () 213 | { 214 | ref_count = 0 ; 215 | comment = NULL ; 216 | buffer = NULL ; 217 | length = 0 ; 218 | rate = SL_DEFAULT_SAMPLING_RATE ; 219 | bps = 8 ; 220 | stereo = SL_FALSE ; 221 | } 222 | 223 | public: 224 | 225 | slSample () { init () ; } 226 | 227 | slSample ( const Uchar *buff, int leng ) 228 | { 229 | init () ; 230 | setBuffer ( buff, leng ) ; 231 | } 232 | 233 | slSample ( const char *fname, const class slDSP *dsp = NULL ) 234 | { 235 | if ( dsp != NULL && dsp->notWorking () ) 236 | dsp = NULL ; 237 | 238 | init () ; 239 | loadFile ( fname ) ; 240 | autoMatch ( dsp ) ; 241 | } 242 | 243 | ~slSample () 244 | { 245 | if ( ref_count != 0 && __slPendingError == NULL ) 246 | __slPendingError = 247 | "slSample: FATAL ERROR - Application deleted a sample while it was playing." ; 248 | 249 | delete [] buffer ; 250 | } 251 | 252 | void ref () { ref_count++ ; } 253 | void unRef () { ref_count-- ; } 254 | 255 | int getPlayCount () const { return ref_count ; } 256 | 257 | char *getComment () const { return comment ; } 258 | 259 | void setComment ( const char *nc ) 260 | { 261 | delete [] comment ; 262 | comment = ulStrDup ( nc ) ; 263 | } 264 | 265 | Uchar *getBuffer () const { return buffer ; } 266 | int getLength () const { return length ; } 267 | 268 | void autoMatch ( const slDSP *dsp ) ; 269 | 270 | void setBuffer ( const Uchar *buff, int leng ) 271 | { 272 | delete [] buffer ; 273 | 274 | buffer = new Uchar [ leng ] ; 275 | 276 | if ( buff != NULL ) 277 | memcpy ( buffer, buff, leng ) ; 278 | 279 | length = leng ; 280 | } 281 | 282 | /* These routines only set flags - use changeXXX () to convert a sound */ 283 | 284 | void setRate ( int r ) { rate = r ; } 285 | void setBps ( int b ) { bps = b ; } 286 | void setStereo ( int s ) { stereo = s ; } 287 | 288 | int getRate () const { return rate ; } 289 | int getBps () const { return bps ; } 290 | int getStereo () const { return stereo ; } 291 | 292 | float getDuration () const { return (float) getLength() / 293 | (float) ( (getStereo()?2.0f:1.0f)* 294 | (getBps()/8.0f)*getRate() ) ; } 295 | 296 | int loadFile ( const char *fname ) ; 297 | 298 | int loadRawFile ( const char *fname ) ; 299 | int loadAUFile ( const char *fname ) ; 300 | int loadWavFile ( const char *fname ) ; 301 | 302 | void changeRate ( int r ) ; 303 | void changeBps ( int b ) ; 304 | void changeStereo ( int s ) ; 305 | void changeToUnsigned () ; 306 | 307 | void adjustVolume ( float vol ) ; 308 | 309 | void print ( FILE *fd ) const 310 | { 311 | if ( buffer == NULL ) 312 | { 313 | fprintf ( fd, "Empty sample buffer\n" ) ; 314 | } 315 | else 316 | { 317 | fprintf ( fd, "\"%s\"\n",(getComment() == NULL || 318 | getComment()[0]=='\0') ? "Sample" : comment ) ; 319 | fprintf ( fd, "%s, %d bits per sample.\n", 320 | getStereo() ? "Stereo" : "Mono", getBps() ) ; 321 | fprintf ( fd, "%gKHz sample rate.\n", (float) getRate() / 1000.0f ) ; 322 | fprintf ( fd, "%d bytes of samples == %g seconds duration.\n", getLength(), getDuration() ) ; 323 | } 324 | } 325 | } ; 326 | 327 | 328 | enum slSampleStatus 329 | { 330 | SL_SAMPLE_WAITING, /* Sound hasn't started playing yet */ 331 | SL_SAMPLE_RUNNING, /* Sound has started playing */ 332 | SL_SAMPLE_DONE , /* Sound is complete */ 333 | SL_SAMPLE_PAUSED /* Sound hasn't started playing yet */ 334 | } ; 335 | 336 | 337 | enum slPreemptMode 338 | { 339 | SL_SAMPLE_CONTINUE, /* Don't allow yourself to be preempted */ 340 | SL_SAMPLE_ABORT , /* Abort playing the sound when preempted */ 341 | SL_SAMPLE_RESTART , /* Restart the sound when load permits */ 342 | SL_SAMPLE_MUTE , /* Continue silently until load permits */ 343 | SL_SAMPLE_DELAY /* Pause until load permits */ 344 | } ; 345 | 346 | 347 | enum slReplayMode 348 | { 349 | SL_SAMPLE_LOOP, /* Loop sound so that it plays forever */ 350 | SL_SAMPLE_ONE_SHOT /* Play sound just once */ 351 | } ; 352 | 353 | enum slEvent 354 | { 355 | SL_EVENT_COMPLETE, /* Sound finished playing */ 356 | SL_EVENT_LOOPED, /* Sound looped back to the start */ 357 | SL_EVENT_PREEMPTED /* Sound was preempted */ 358 | } ; 359 | 360 | typedef void (*slCallBack) ( slSample *, slEvent, int ) ; 361 | 362 | class slEnvelope 363 | { 364 | protected: 365 | 366 | float *time ; 367 | float *value ; 368 | int nsteps ; 369 | int ref_count ; 370 | float previous_value ; 371 | unsigned char prev_pitchenv ; 372 | slReplayMode replay_mode ; 373 | 374 | int getStepDelta ( float *_time, float *delta ) const ; 375 | 376 | public: 377 | 378 | slEnvelope ( int _nsteps, slReplayMode _rm, float *_times, float *_values ) 379 | { 380 | ref_count = 0 ; 381 | nsteps = _nsteps ; 382 | time = new float [ nsteps ] ; 383 | value = new float [ nsteps ] ; 384 | memcpy ( time , _times , sizeof(float) * nsteps ) ; 385 | memcpy ( value, _values, sizeof(float) * nsteps ) ; 386 | prev_pitchenv = 0x80 ; 387 | previous_value = 0.0f ; 388 | replay_mode = _rm ; 389 | } 390 | 391 | 392 | slEnvelope ( int _nsteps = 1, slReplayMode _rm = SL_SAMPLE_ONE_SHOT ) 393 | { 394 | ref_count = 0 ; 395 | nsteps = _nsteps ; 396 | time = new float [ nsteps ] ; 397 | value = new float [ nsteps ] ; 398 | prev_pitchenv = 0x80 ; 399 | previous_value = 0.0f ; 400 | 401 | for ( int i = 0 ; i < nsteps ; i++ ) 402 | time [ i ] = value [ i ] = 0.0 ; 403 | 404 | replay_mode = _rm ; 405 | } 406 | 407 | ~slEnvelope () 408 | { 409 | if ( ref_count != 0 && __slPendingError == NULL ) 410 | __slPendingError = 411 | "slEnvelope: FATAL ERROR - Application deleted an envelope while it was playing.\n" ; 412 | 413 | delete [] time ; 414 | delete [] value ; 415 | } 416 | 417 | void ref () { ref_count++ ; } 418 | void unRef () { ref_count-- ; } 419 | 420 | int getPlayCount () const { return ref_count ; } 421 | 422 | void applyToLPFilter ( unsigned char *dst, 423 | unsigned char *src, 424 | int nframes, int start ) ; 425 | 426 | void setStep ( int n, float _time, float _value ) 427 | { 428 | if ( n >= 0 && n < nsteps ) 429 | { 430 | time [ n ] = _time ; 431 | value [ n ] = _value ; 432 | } 433 | } 434 | 435 | float getStepValue ( int s ) const { return value [ s ] ; } 436 | float getStepTime ( int s ) const { return time [ s ] ; } 437 | 438 | int getNumSteps () const { return nsteps ; } 439 | 440 | float getValue ( float _time ) const ; 441 | 442 | void applyToPitch ( Uchar *dst, slPlayer *src, int nframes, int start, int next_env ) ; 443 | void applyToInvPitch ( Uchar *dst, slPlayer *src, int nframes, int start, int next_env ) ; 444 | void applyToVolume ( Uchar *dst, Uchar *src, int nframes, int start ) ; 445 | void applyToInvVolume ( Uchar *dst, Uchar *src, int nframes, int start ) ; 446 | } ; 447 | 448 | #define SL_MAX_PRIORITY 16 449 | #define SL_MAX_SAMPLES 32 450 | #define SL_MAX_CALLBACKS (SL_MAX_SAMPLES * 2) 451 | #define SL_MAX_ENVELOPES 32 452 | #define SL_MAX_MIXERINPUTS 16 453 | 454 | enum slEnvelopeType 455 | { 456 | SL_PITCH_ENVELOPE , SL_INVERSE_PITCH_ENVELOPE , 457 | SL_VOLUME_ENVELOPE, SL_INVERSE_VOLUME_ENVELOPE, 458 | SL_FILTER_ENVELOPE, SL_INVERSE_FILTER_ENVELOPE, 459 | SL_PAN_ENVELOPE , SL_INVERSE_PAN_ENVELOPE , 460 | SL_ECHO_ENVELOPE , SL_INVERSE_ECHO_ENVELOPE , 461 | 462 | SL_NULL_ENVELOPE 463 | } ; 464 | 465 | struct slPendingCallBack 466 | { 467 | slCallBack callback ; 468 | slSample *sample ; 469 | slEvent event ; 470 | int magic ; 471 | } ; 472 | 473 | class slPlayer 474 | { 475 | protected: 476 | 477 | slEnvelope *env [ SL_MAX_ENVELOPES ] ; 478 | slEnvelopeType env_type [ SL_MAX_ENVELOPES ] ; 479 | int env_start_time [ SL_MAX_ENVELOPES ] ; 480 | 481 | slReplayMode replay_mode ; 482 | slPreemptMode preempt_mode ; 483 | slSampleStatus status ; 484 | int priority ; 485 | 486 | slCallBack callback ; 487 | int magic ; 488 | 489 | virtual void low_read ( int nframes, Uchar *dest ) = 0 ; 490 | virtual void skip ( int nframes ) = 0 ; 491 | 492 | public: 493 | 494 | slPlayer ( slReplayMode rp_mode = SL_SAMPLE_ONE_SHOT, 495 | int pri = 0, slPreemptMode pr_mode = SL_SAMPLE_DELAY, 496 | int _magic = 0, slCallBack cb = NULL ) 497 | { 498 | magic = _magic ; 499 | callback = cb ; 500 | 501 | for ( int i = 0 ; i < SL_MAX_ENVELOPES ; i++ ) 502 | { 503 | env [ i ] = NULL ; 504 | env_type [ i ] = SL_NULL_ENVELOPE ; 505 | } 506 | 507 | status = SL_SAMPLE_WAITING ; 508 | replay_mode = rp_mode ; 509 | preempt_mode = pr_mode ; 510 | priority = pri ; 511 | } 512 | 513 | virtual ~slPlayer () ; 514 | 515 | slPreemptMode getPreemptMode () const { return preempt_mode ; } 516 | 517 | int getPriority () const 518 | { 519 | return ( isRunning() && 520 | preempt_mode == SL_SAMPLE_CONTINUE ) ? (SL_MAX_PRIORITY+1) : 521 | priority ; 522 | } 523 | 524 | void addEnvelope ( int i, slEnvelope *_env, slEnvelopeType _type ) ; 525 | 526 | virtual void pause () 527 | { 528 | if ( status != SL_SAMPLE_DONE ) 529 | status = SL_SAMPLE_PAUSED ; 530 | } 531 | 532 | virtual void resume () 533 | { 534 | if ( status == SL_SAMPLE_PAUSED ) 535 | status = SL_SAMPLE_RUNNING ; 536 | } 537 | 538 | virtual void reset () 539 | { 540 | status = SL_SAMPLE_WAITING ; 541 | } 542 | 543 | virtual void start () 544 | { 545 | status = SL_SAMPLE_RUNNING ; 546 | } 547 | 548 | virtual void stop () 549 | { 550 | status = SL_SAMPLE_DONE ; 551 | } 552 | 553 | int getMagic () const { return magic ; } 554 | int isWaiting () const { return status == SL_SAMPLE_WAITING ; } 555 | int isPaused () const { return status == SL_SAMPLE_PAUSED ; } 556 | int isRunning () const { return status == SL_SAMPLE_RUNNING ; } 557 | int isDone () const { return status == SL_SAMPLE_DONE ; } 558 | 559 | virtual int preempt ( int delay ) ; 560 | 561 | virtual slSample *getSample () const = 0 ; 562 | 563 | void read ( int nframes, Uchar *dest, int next_env = 0 ) ; 564 | } ; 565 | 566 | 567 | class MODfile ; 568 | 569 | class slMODPlayer : public slPlayer 570 | { 571 | MODfile *mf ; 572 | 573 | void low_read ( int nframes, Uchar *dest ) ; 574 | void init ( const char *fname ) ; 575 | public: 576 | 577 | slMODPlayer ( const char *fname, slReplayMode rp_mode = SL_SAMPLE_ONE_SHOT, 578 | int pri = 0, slPreemptMode pr_mode = SL_SAMPLE_DELAY, 579 | int _magic = 0, slCallBack cb = NULL ) : 580 | slPlayer ( rp_mode, pri, pr_mode, _magic, cb ) 581 | { 582 | init ( fname ) ; 583 | reset () ; 584 | } 585 | 586 | ~slMODPlayer () ; 587 | 588 | int preempt ( int delay ) ; 589 | virtual slSample *getSample () const { return NULL ; } 590 | 591 | void skip ( int nframes ) ; 592 | } ; 593 | 594 | 595 | class slSamplePlayer : public slPlayer 596 | { 597 | int lengthRemaining ; /* Sample frames remaining until repeat */ 598 | Uchar *bufferPos ; /* Sample frame to replay next */ 599 | slSample *sample ; 600 | 601 | void low_read ( int nframes, Uchar *dest ) ; 602 | 603 | public: 604 | 605 | slSamplePlayer ( slSample *s, slReplayMode rp_mode = SL_SAMPLE_ONE_SHOT, 606 | int pri = 0, slPreemptMode pr_mode = SL_SAMPLE_DELAY, 607 | int _magic = 0, slCallBack cb = NULL ) : 608 | slPlayer ( rp_mode, pri, pr_mode, _magic, cb ) 609 | { 610 | sample = s ; 611 | 612 | if ( sample ) sample -> ref () ; 613 | 614 | reset () ; 615 | } 616 | 617 | ~slSamplePlayer () ; 618 | 619 | int preempt ( int delay ) ; 620 | 621 | void reset () 622 | { 623 | slPlayer::reset () ; 624 | 625 | lengthRemaining = sample->getLength () ; 626 | bufferPos = sample->getBuffer () ; 627 | } 628 | 629 | void start () 630 | { 631 | slPlayer::start () ; 632 | 633 | lengthRemaining = sample->getLength () ; 634 | bufferPos = sample->getBuffer () ; 635 | } 636 | 637 | void stop () 638 | { 639 | slPlayer::stop () ; 640 | 641 | lengthRemaining = 0 ; 642 | bufferPos = NULL ; 643 | } 644 | 645 | slSample *getSample () const { return sample ; } 646 | 647 | void skip ( int nframes ) ; 648 | } ; 649 | 650 | 651 | class slScheduler : public slDSP 652 | { 653 | slPendingCallBack pending_callback [ SL_MAX_CALLBACKS ] ; 654 | int num_pending_callbacks ; 655 | 656 | float safety_margin ; 657 | 658 | int mixer_buffer_size, mixer_gain ; 659 | float seconds_per_buffer; 660 | 661 | Uchar *mixer_buffer ; 662 | Uchar *mixer_inputs [ SL_MAX_MIXERINPUTS + 1 ] ; 663 | 664 | Uchar *mixer ; 665 | int amount_left ; 666 | 667 | slPlayer *player [ SL_MAX_SAMPLES ] ; 668 | slPlayer *music ; 669 | 670 | void init () ; 671 | 672 | void realUpdate ( int dump_first = SL_FALSE ) ; 673 | 674 | void initBuffers () ; 675 | 676 | int now ; 677 | 678 | static slScheduler *current ; 679 | 680 | public: 681 | 682 | slScheduler ( int _rate = SL_DEFAULT_SAMPLING_RATE ) : slDSP ( _rate, SL_FALSE, 8 ) { init () ; } 683 | slScheduler ( const char *device, 684 | int _rate = SL_DEFAULT_SAMPLING_RATE ) : slDSP ( device, _rate, SL_FALSE, 8 ) { init () ; } 685 | ~slScheduler () ; 686 | 687 | static slScheduler *getCurrent () { return current ; } 688 | 689 | int getTimeNow () const { return now ; } 690 | float getElapsedTime ( int then ) const { return (float)(now-then)/(float)getRate() ; } 691 | 692 | void setMaxConcurrent ( int mc ); 693 | int getMaxConcurrent () const ; 694 | 695 | void flushCallBacks () ; 696 | void addCallBack ( slCallBack c, slSample *s, slEvent e, int m ) ; 697 | 698 | void update () { realUpdate ( SL_FALSE ) ; } 699 | void dumpUpdate () { realUpdate ( SL_TRUE ) ; } 700 | 701 | void resumeSample ( slSample *s = NULL, int magic = 0 ) ; 702 | void resumeMusic ( int magic = 0 ) ; 703 | void pauseSample ( slSample *s = NULL, int magic = 0 ) ; 704 | void pauseMusic ( int magic = 0 ) ; 705 | void stopSample ( slSample *s = NULL, int magic = 0 ) ; 706 | void stopMusic ( int magic = 0 ) ; 707 | 708 | void addSampleEnvelope ( slSample *s = NULL, int magic = 0, 709 | int slot = 1, slEnvelope *e = NULL, 710 | slEnvelopeType t = SL_VOLUME_ENVELOPE ) ; 711 | void addMusicEnvelope ( int magic = 0, 712 | int slot = 1, slEnvelope *e = NULL, 713 | slEnvelopeType t = SL_VOLUME_ENVELOPE ) ; 714 | int loopSample ( slSample *s, int pri = 0, 715 | slPreemptMode mode = SL_SAMPLE_MUTE, 716 | int magic = 0, slCallBack cb = NULL ) ; 717 | int loopMusic ( const char *fname, int pri = 0, 718 | slPreemptMode mode = SL_SAMPLE_MUTE, 719 | int magic = 0, slCallBack cb = NULL ) ; 720 | int playSample ( slSample *s, int pri = 1, 721 | slPreemptMode mode = SL_SAMPLE_ABORT, 722 | int magic = 0, slCallBack cb = NULL ) ; 723 | int playMusic ( const char *fname, int pri = 1, 724 | slPreemptMode mode = SL_SAMPLE_ABORT, 725 | int magic = 0, slCallBack cb = NULL ) ; 726 | 727 | void setSafetyMargin ( float seconds ) { safety_margin = seconds ; } 728 | } ; 729 | 730 | #endif 731 | 732 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/slPortability.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net 20 | 21 | $Id: slPortability.h 2013 2005-01-16 06:03:31Z sjbaker $ 22 | */ 23 | 24 | 25 | #ifndef __SLPORTABILITY_H__ 26 | #define __SLPORTABILITY_H__ 1 27 | 28 | /* ------------------------------------------------------------- */ 29 | /* OS specific includes and defines ... */ 30 | /* ------------------------------------------------------------- */ 31 | 32 | #include "ul.h" 33 | #include 34 | #include 35 | 36 | #ifdef UL_MACINTOSH 37 | #include 38 | #include 39 | #ifdef __MWERKS__ 40 | #include 41 | #endif 42 | #endif 43 | 44 | #ifdef UL_MAC_OSX 45 | #include 46 | #endif 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | #if (defined(UL_LINUX) || defined(UL_BSD)) && !defined(__NetBSD__) 55 | #define SL_USING_OSS_AUDIO 1 56 | #endif 57 | 58 | #ifdef SL_USING_OSS_AUDIO 59 | # if defined(UL_LINUX) 60 | # include 61 | # include 62 | # elif defined(__FreeBSD__) 63 | # include 64 | # else 65 | /* 66 | Tom thinks this file may be under some 67 | unixen - but that isn't where the OSS manuals say it 68 | should be. 69 | 70 | If you ever find out the truth, please email me: 71 | Steve Baker 72 | */ 73 | # include 74 | # endif 75 | #endif 76 | 77 | #ifdef UL_BSD 78 | #ifndef __FreeBSD__ 79 | # include 80 | #endif 81 | #endif 82 | 83 | /* Tom */ 84 | 85 | #ifdef UL_IRIX 86 | # include 87 | #endif 88 | 89 | #ifdef UL_SOLARIS 90 | # include 91 | # include 92 | #endif 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgAux.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net 20 | 21 | $Id: ssgAux.h 1772 2003-06-27 08:15:15Z sjbaker $ 22 | */ 23 | 24 | 25 | #ifndef _SSGAUX_H_ 26 | #define _SSGAUX_H_ 1 27 | 28 | #include "ssg.h" 29 | #include "ssgaShapes.h" 30 | #include "ssgaParticleSystem.h" 31 | #include "ssgaFire.h" 32 | #include "ssgaWaveSystem.h" 33 | #include "ssgaLensFlare.h" 34 | #include "ssgaScreenDump.h" 35 | 36 | 37 | #define _SSGA_TYPE_SHAPE 0x00008000 38 | #define _SSGA_TYPE_CUBE 0x00004000 39 | #define _SSGA_TYPE_SPHERE 0x00002000 40 | #define _SSGA_TYPE_CYLINDER 0x00001000 41 | #define _SSGA_TYPE_PATCH 0x00010000 42 | #define _SSGA_TYPE_TEAPOT 0x00020000 43 | #define _SSGA_TYPE_PARTICLESYSTEM 0x00040000 44 | #define _SSGA_TYPE_WAVESYSTEM 0x00080000 45 | #define _SSGA_TYPE_LENSFLARE 0x00100000 46 | 47 | inline int ssgaTypeShape () { return _SSGA_TYPE_SHAPE | ssgTypeBranch ();} 48 | inline int ssgaTypeCube () { return _SSGA_TYPE_CUBE | ssgaTypeShape ();} 49 | inline int ssgaTypeSphere () { return _SSGA_TYPE_SPHERE | ssgaTypeShape ();} 50 | inline int ssgaTypeCylinder() { return _SSGA_TYPE_CYLINDER | ssgaTypeShape ();} 51 | inline int ssgaTypePatch () { return _SSGA_TYPE_PATCH | ssgaTypeShape ();} 52 | inline int ssgaTypeTeapot () { return _SSGA_TYPE_TEAPOT | ssgaTypeShape ();} 53 | inline int ssgaTypeParticleSystem () 54 | { return _SSGA_TYPE_PARTICLESYSTEM | ssgaTypeShape ();} 55 | inline int ssgaTypeWaveSystem () 56 | { return _SSGA_TYPE_WAVESYSTEM | ssgaTypeShape ();} 57 | inline int ssgaTypeLensFlare () 58 | { return _SSGA_TYPE_LENSFLARE | ssgaTypeShape ();} 59 | 60 | void ssgaInit () ; 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgaFire.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net */ 20 | 21 | 22 | 23 | #include "ssgAux.h" 24 | 25 | 26 | class ssgaFire : public ssgaParticleSystem 27 | { 28 | int tableSize ; 29 | float *colourTable ; 30 | float *sizeTable ; 31 | 32 | sgVec4 hot_colour ; 33 | float max_ttl ; 34 | float start_size ; 35 | float upward_speed ; 36 | float radius ; 37 | 38 | void reInit () ; 39 | 40 | public: 41 | 42 | void createParticle ( int idx, ssgaParticle *p ) ; 43 | void updateParticle ( int idx, ssgaParticle *p ) ; 44 | 45 | ssgaFire ( int num_tris, float _radius = 1.0f, 46 | float height = 5.0f, 47 | float speed = 2.0f ) ; 48 | 49 | virtual ~ssgaFire () ; 50 | 51 | virtual void update ( float t ) ; 52 | 53 | void setUpwardSpeed ( float spd ) 54 | { 55 | upward_speed = spd ; 56 | } 57 | 58 | void setHeight ( float hgt ) 59 | { 60 | max_ttl = hgt / upward_speed ; 61 | getBSphere () -> setRadius ( hgt * 2.0f ) ; 62 | getBSphere () -> setCenter ( 0, 0, 0 ) ; 63 | reInit () ; 64 | } 65 | 66 | void setHotColour ( sgVec4 col ) 67 | { 68 | sgCopyVec4 ( hot_colour, col ) ; 69 | reInit () ; 70 | } 71 | 72 | void getHotColour ( sgVec4 col ) { sgCopyVec4 ( col, hot_colour ) ; } 73 | 74 | } ; 75 | 76 | unsigned char *_ssgaGetFireTexture () ; 77 | 78 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgaLensFlare.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net */ 20 | 21 | 22 | 23 | #include "ssgaShapes.h" 24 | 25 | class ssgaLensFlare : public ssgaShape 26 | { 27 | ssgVtxTable *vt ; 28 | ssgVertexArray *v0 ; 29 | ssgNormalArray *n0 ; 30 | ssgColourArray *c0 ; 31 | ssgTexCoordArray *t0 ; 32 | 33 | void update ( sgMat4 m ) ; 34 | 35 | protected: 36 | virtual void copy_from ( ssgaLensFlare *src, int clone_flags ) ; 37 | public: 38 | 39 | ssgaLensFlare () ; 40 | ssgaLensFlare ( int nt ) ; 41 | 42 | virtual ~ssgaLensFlare () ; 43 | 44 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 45 | virtual void regenerate () ; 46 | virtual const char *getTypeName ( void ) ; 47 | virtual void cull ( sgFrustum *f, sgMat4 m, int test_needed ) ; 48 | } ; 49 | 50 | unsigned char *_ssgaGetLensFlareTexture () ; 51 | 52 | 53 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgaParticleSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net */ 20 | 21 | 22 | 23 | class ssgaParticle 24 | { 25 | public: 26 | 27 | sgVec4 col ; 28 | sgVec3 pos ; 29 | sgVec3 vel ; 30 | sgVec3 acc ; 31 | 32 | float size ; 33 | 34 | float time_to_live ; 35 | void *userData ; 36 | 37 | void update ( float dt ) 38 | { 39 | sgAddScaledVec3 ( vel, acc, dt ) ; 40 | sgAddScaledVec3 ( pos, vel, dt ) ; 41 | time_to_live -= dt ; 42 | } 43 | 44 | ssgaParticle () 45 | { 46 | sgSetVec4 ( col, 1, 1, 1, 1 ) ; 47 | sgZeroVec3 ( pos ) ; 48 | sgZeroVec3 ( vel ) ; 49 | sgZeroVec3 ( acc ) ; 50 | time_to_live = 0 ; 51 | userData = NULL ; 52 | size = 1.0f ; 53 | } 54 | 55 | } ; 56 | 57 | 58 | class ssgaParticleSystem ; 59 | 60 | 61 | typedef void (* ssgaParticleCreateFunc) ( ssgaParticleSystem *ps, 62 | int index, 63 | ssgaParticle *p ) ; 64 | 65 | typedef void (* ssgaParticleUpdateFunc) ( float deltaTime, 66 | ssgaParticleSystem *ps, 67 | int index, 68 | ssgaParticle *p ) ; 69 | 70 | typedef void (* ssgaParticleDeleteFunc) ( ssgaParticleSystem *ps, 71 | int index, 72 | ssgaParticle *p ) ; 73 | 74 | class ssgaParticleSystem : public ssgVtxTable 75 | { 76 | int num_particles ; 77 | int num_verts ; 78 | int turn_to_face ; 79 | int num_active ; 80 | ssgaParticle *particle ; 81 | 82 | float create_error ; 83 | float create_rate ; 84 | 85 | float size ; 86 | 87 | ssgaParticleCreateFunc particle_create ; 88 | ssgaParticleUpdateFunc particle_update ; 89 | ssgaParticleDeleteFunc particle_delete ; 90 | 91 | public: 92 | 93 | ssgaParticleSystem ( int num, int initial_num, 94 | float _create_rate, int _turn_to_face, 95 | float sz, float bsphere_size, 96 | ssgaParticleCreateFunc _particle_create, 97 | ssgaParticleUpdateFunc _particle_update = NULL, 98 | ssgaParticleDeleteFunc _particle_delete = NULL ) ; 99 | 100 | virtual ~ssgaParticleSystem () ; 101 | virtual void update ( float t ) ; 102 | 103 | void setSize ( float sz ) { size = sz ; } 104 | float getSize () { return size ; } 105 | 106 | void draw_geometry () ; 107 | 108 | void setCreationRate ( float cr ) { create_rate = cr ; } 109 | float getCreationRate () { return create_rate ; } 110 | 111 | int getNumParticles () { return num_particles ; } 112 | int getNumActiveParticles () { return num_active ; } 113 | } ; 114 | 115 | 116 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgaScreenDump.h: -------------------------------------------------------------------------------- 1 | 2 | /* Dump to disk in '.rgb' format */ 3 | 4 | void ssgaScreenDump ( char *filename, 5 | int width, int height, 6 | int frontBuffer = TRUE ) ; 7 | 8 | /* Put low order 24 bits to disk (R=lsb, G=middle byte, B=msb) */ 9 | 10 | void ssgaScreenDepthDump ( char *filename, 11 | int width, int height, 12 | int frontBuffer = TRUE ) ; 13 | 14 | /* Dump to a memory buffer - three bytes per pixel */ 15 | 16 | unsigned char *ssgaScreenDump ( int width, int height, 17 | int frontBuffer = TRUE ) ; 18 | 19 | unsigned int *ssgaScreenDepthDump ( int width, int height, 20 | int frontBuffer = TRUE ) ; 21 | 22 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgaShapes.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net 20 | 21 | $Id: ssgaShapes.h 1568 2002-09-02 06:05:49Z sjbaker $ 22 | */ 23 | 24 | 25 | #ifndef _SSGASHAPES_H_ 26 | #define _SSGASHAPES_H_ 1 27 | 28 | #include "ssg.h" 29 | 30 | typedef float sgVec9 [ 9 ] ; /* Needed for ssgaPatch */ 31 | 32 | class ssgaShape : public ssgBranch 33 | { 34 | int corrupted ; 35 | 36 | protected: 37 | virtual void copy_from ( ssgaShape *src, int clone_flags ) ; 38 | 39 | sgVec4 colour ; 40 | sgVec3 center ; 41 | sgVec3 size ; 42 | 43 | int ntriangles ; 44 | 45 | ssgState *kidState ; 46 | ssgCallback kidPreDrawCB ; 47 | ssgCallback kidPostDrawCB ; 48 | 49 | void init () ; 50 | 51 | protected: 52 | 53 | ssgState *getKidState () { return kidState ; } 54 | ssgCallback getKidPreDrawCB () { return kidPreDrawCB ; } 55 | ssgCallback getKidPostDrawCB () { return kidPostDrawCB ; } 56 | 57 | public: 58 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 59 | ssgaShape (void) ; 60 | ssgaShape ( int numtris ) ; 61 | virtual ~ssgaShape (void) ; 62 | virtual const char *getTypeName(void) ; 63 | 64 | void makeCorrupt () { corrupted = TRUE ; } 65 | int isCorrupt () { return corrupted ; } 66 | 67 | float *getCenter () { return center ; } 68 | float *getSize () { return size ; } 69 | int getNumTris () { return ntriangles ; } 70 | 71 | void setColour ( sgVec4 c ) { sgCopyVec4 ( colour, c ) ; regenerate () ; } 72 | void setCenter ( sgVec3 c ) { sgCopyVec3 ( center, c ) ; regenerate () ; } 73 | void setSize ( sgVec3 s ) { sgCopyVec3 ( size , s ) ; regenerate () ; } 74 | void setSize ( float s ) { sgSetVec3 ( size,s,s,s) ; regenerate () ; } 75 | void setNumTris ( int ntri ) { ntriangles = ntri ; regenerate () ; } 76 | 77 | void setKidState ( ssgState *s ) 78 | { 79 | kidState = s ; 80 | 81 | for ( int i = 0 ; i < getNumKids() ; i++ ) 82 | ((ssgLeaf *)getKid(i)) -> setState ( s ) ; 83 | } 84 | 85 | void setKidCallback ( int cb_type, ssgCallback cb ) 86 | { 87 | if ( cb_type == SSG_CALLBACK_PREDRAW ) 88 | kidPreDrawCB = cb ; 89 | else 90 | kidPostDrawCB = cb ; 91 | 92 | for ( int i = 0 ; i < getNumKids() ; i++ ) 93 | ((ssgLeaf *)getKid(i)) -> setCallback ( cb_type, cb ) ; 94 | } 95 | 96 | virtual void regenerate () = 0 ; 97 | 98 | virtual int load ( FILE * ) ; 99 | virtual int save ( FILE * ) ; 100 | } ; 101 | 102 | 103 | 104 | class ssgaCube : public ssgaShape 105 | { 106 | protected: 107 | virtual void copy_from ( ssgaCube *src, int clone_flags ) ; 108 | public: 109 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 110 | ssgaCube (void) ; 111 | ssgaCube ( int numtris ) ; 112 | virtual ~ssgaCube (void) ; 113 | virtual const char *getTypeName(void) ; 114 | virtual void regenerate () ; 115 | } ; 116 | 117 | 118 | 119 | #define SSGA_HAVE_PATCH 1 120 | 121 | class ssgaPatch : public ssgaShape 122 | { 123 | int levels ; 124 | sgVec9 control_points[4][4] ; 125 | void makePatch ( sgVec9 points[4][4], int levels ) ; 126 | void writePatch ( sgVec9 points[4][4] ) ; 127 | void makeHSpline ( sgVec9 points[4] , sgVec9 nv[7] ) ; 128 | void makeVSplines ( sgVec9 points[4][7], sgVec9 nv[7][7] ) ; 129 | 130 | 131 | protected: 132 | virtual void copy_from ( ssgaPatch *src, int clone_flags ) ; 133 | public: 134 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 135 | ssgaPatch (void) ; 136 | ssgaPatch ( int numtris ) ; 137 | 138 | void setControlPoint ( int s, int t, sgVec3 xyz, sgVec2 uv, sgVec4 rgba ) ; 139 | void setControlPoint ( int s, int t, 140 | float x, float y, float z, 141 | float u, float v, 142 | float r, float g, float b, float a ) ; 143 | void getControlPoint ( int s, int t, sgVec3 xyz, sgVec2 uv, sgVec4 rgba ) ; 144 | 145 | virtual ~ssgaPatch (void) ; 146 | virtual const char *getTypeName(void) ; 147 | virtual void regenerate () ; 148 | 149 | virtual int load ( FILE * ) ; 150 | virtual int save ( FILE * ) ; 151 | } ; 152 | 153 | 154 | 155 | #define SSGA_HAVE_TEAPOT 1 156 | 157 | class ssgaTeapot : public ssgaShape 158 | { 159 | protected: 160 | virtual void copy_from ( ssgaTeapot *src, int clone_flags ) ; 161 | public: 162 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 163 | ssgaTeapot (void) ; 164 | ssgaTeapot ( int numtris ) ; 165 | virtual ~ssgaTeapot (void) ; 166 | virtual const char *getTypeName(void) ; 167 | virtual void regenerate () ; 168 | 169 | virtual int load ( FILE * ) ; 170 | virtual int save ( FILE * ) ; 171 | } ; 172 | 173 | 174 | 175 | class ssgaSphere : public ssgaShape 176 | { 177 | int latlong_style ; 178 | 179 | void regenerateLatLong () ; 180 | void regenerateTessellatedIcosahedron () ; 181 | protected: 182 | virtual void copy_from ( ssgaSphere *src, int clone_flags ) ; 183 | public: 184 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 185 | ssgaSphere (void) ; 186 | ssgaSphere ( int numtris ) ; 187 | virtual ~ssgaSphere (void) ; 188 | virtual const char *getTypeName(void) ; 189 | virtual void regenerate () ; 190 | 191 | void setLatLongStyle ( int ll ) { latlong_style = ll ; regenerate () ; } 192 | int isLatLongStyle () { return latlong_style ; } 193 | 194 | virtual int load ( FILE * ) ; 195 | virtual int save ( FILE * ) ; 196 | } ; 197 | 198 | 199 | 200 | class ssgaCylinder : public ssgaShape 201 | { 202 | int capped ; 203 | 204 | protected: 205 | virtual void copy_from ( ssgaCylinder *src, int clone_flags ) ; 206 | public: 207 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 208 | ssgaCylinder (void) ; 209 | ssgaCylinder ( int numtris ) ; 210 | virtual ~ssgaCylinder (void) ; 211 | virtual const char *getTypeName(void) ; 212 | virtual void regenerate () ; 213 | 214 | void makeCapped ( int c ) { capped = c ; regenerate () ; } 215 | int isCapped () { return capped ; } 216 | 217 | virtual int load ( FILE * ) ; 218 | virtual int save ( FILE * ) ; 219 | } ; 220 | 221 | #endif 222 | 223 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgaWaveSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net */ 20 | 21 | 22 | 23 | #include "ssgaShapes.h" 24 | 25 | typedef float (* ssgaWSDepthCallback ) ( float x, float y ) ; 26 | 27 | #define SSGA_MAX_WAVETRAIN 16 28 | 29 | class ssgaWaveTrain 30 | { 31 | float height ; 32 | float length ; 33 | float lambda ; 34 | float speed ; 35 | float heading; 36 | 37 | public: 38 | 39 | ssgaWaveTrain () 40 | { 41 | height = 0.5f ; 42 | length = 0.8f ; 43 | lambda = 1.0f ; 44 | speed = (float) sqrt ( 2.0f/3.0f ) ; 45 | heading = 0.0f ; 46 | } 47 | 48 | float getSpeed () { return speed ; } 49 | void setSpeed ( float h ) { speed = h ; } 50 | 51 | float getLength () { return length ; } 52 | void setLength ( float h ) { length = h ; } 53 | 54 | float getLambda () { return lambda ; } 55 | void setLambda ( float h ) { lambda = h ; } 56 | 57 | float getHeading () { return heading ; } 58 | void setHeading ( float h ) { heading = h ; } 59 | 60 | float getWaveHeight () { return height ; } 61 | void setWaveHeight ( float h ) { height = h ; } 62 | } ; 63 | 64 | class ssgaWaveSystem : public ssgaShape 65 | { 66 | ssgaWSDepthCallback gridGetter ; 67 | 68 | sgVec2 offset ; 69 | sgVec3 *normals ; 70 | sgVec4 *colours ; 71 | sgVec2 *texcoords ; 72 | sgVec3 *vertices ; 73 | sgVec3 *orig_vertices ; 74 | 75 | ssgaWaveTrain *train [ SSGA_MAX_WAVETRAIN ] ; 76 | 77 | float windSpeed ; 78 | float windHeading ; 79 | float edgeFlatten ; 80 | 81 | float tu, tv ; 82 | 83 | int nstrips ; 84 | int nstacks ; 85 | 86 | protected: 87 | virtual void copy_from ( ssgaWaveSystem *src, int clone_flags ) ; 88 | public: 89 | 90 | ssgaWaveSystem ( int ntri ) ; 91 | 92 | virtual ~ssgaWaveSystem () ; 93 | 94 | virtual ssgBase *clone ( int clone_flags = 0 ) ; 95 | virtual void regenerate () ; 96 | virtual const char *getTypeName ( void ) ; 97 | 98 | virtual int load ( FILE * ) ; 99 | virtual int save ( FILE * ) ; 100 | 101 | ssgaWSDepthCallback getDepthCallback () { return gridGetter ; } 102 | 103 | ssgaWaveTrain *getWaveTrain ( int i ) 104 | { 105 | return ( i < 0 || i >= SSGA_MAX_WAVETRAIN ) ? NULL : train [ i ] ; 106 | } 107 | 108 | void setWaveTrain ( int i, ssgaWaveTrain *t ) 109 | { 110 | assert ( i >= 0 && i < SSGA_MAX_WAVETRAIN ) ; 111 | train [ i ] = t ; 112 | } 113 | 114 | float getWindSpeed () { return windSpeed ; } 115 | float getWindDirn () { return windHeading ; } 116 | float getEdgeFlatten () { return edgeFlatten ; } 117 | float getTexScaleU () { return tu ; } 118 | float getTexScaleV () { return tv ; } 119 | 120 | void setDepthCallback ( ssgaWSDepthCallback cb ) { gridGetter = cb ; } 121 | void setWindSpeed ( float speed ) { windSpeed = speed ; } 122 | void setWindDirn ( float dirn ) { windHeading = dirn ; } 123 | void setEdgeFlatten ( float dist ) { edgeFlatten = dist ; } 124 | void setTexScale ( float u, float v ) { tu = u ; tv = v ; } 125 | 126 | void setOffset ( sgVec2 _offset ) { sgCopyVec2 ( offset, _offset ) ; } 127 | 128 | void updateAnimation ( float t ) ; 129 | } ; 130 | 131 | 132 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ssgconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net 20 | 21 | $Id: ssgconf.h 1959 2004-09-14 12:19:05Z wolfram_kuss $ 22 | */ 23 | 24 | #ifndef _INCLUDED_SSGCONF_H_ 25 | #define _INCLUDED_SSGCONF_H_ 26 | 27 | /* ssgconf.h - machine configurable file for libssg */ 28 | 29 | #define _SSG_USE_DLIST 1 30 | 31 | /* The following defines give you the ability to remove code from the 32 | * library that you will not be using. I wish I could figure out how to 33 | * automate this, but I can't do that without making it seriously hard 34 | * on the users. So if you are not using an ability, change the #define 35 | * to an #undef, and that part of the library will not be compiled. If 36 | * your linker can't find a function, you may want to make sure the 37 | * ability is defined here. 38 | */ 39 | 40 | /* 41 | For optional use of PNG textures, download the glpng library from 42 | http://www.wyatt100.freeserve.co.uk/download.htm and 43 | change the #undef to a #define in the following line. 44 | */ 45 | 46 | #undef SSG_LOAD_PNG_SUPPORTED 47 | 48 | #define SSG_LOAD_SGI_SUPPORTED 49 | #define SSG_LOAD_TGA_SUPPORTED 50 | #define SSG_LOAD_BMP_SUPPORTED 51 | #define SSG_LOAD_MDL_SUPPORTED 52 | #define SSG_LOAD_MDL_BGL_TEXTURE_SUPPORTED 53 | #define SSG_LOAD_XPL_SUPPORTED 54 | #define SSG_LOAD_PCX_SUPPORTED 55 | #endif 56 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Headers/ul.h: -------------------------------------------------------------------------------- 1 | /* 2 | PLIB - A Suite of Portable Game Libraries 3 | Copyright (C) 1998,2002 Steve Baker 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | For further information visit http://plib.sourceforge.net 20 | 21 | $Id: ul.h 2117 2007-09-13 23:21:09Z fayjf $ 22 | */ 23 | 24 | // 25 | // UL - utility library 26 | // 27 | // Contains: 28 | // - necessary system includes 29 | // - basic types 30 | // - error message routines 31 | // - high performance clocks 32 | // - ulList 33 | // - ulLinkedList 34 | // - more to come (endian support, version ID) 35 | // 36 | 37 | #ifndef _INCLUDED_UL_H_ 38 | #define _INCLUDED_UL_H_ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | /**********************\ 48 | * * 49 | * Determine OS type * 50 | * * 51 | \**********************/ 52 | 53 | #if defined(__CYGWIN__) 54 | 55 | #define UL_WIN32 1 56 | #define UL_CYGWIN 1 /* Windoze AND Cygwin. */ 57 | 58 | #elif defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) 59 | 60 | #define UL_WIN32 1 61 | #define UL_MSVC 1 /* Windoze AND MSVC. */ 62 | 63 | #elif defined(__BEOS__) 64 | 65 | #define UL_BEOS 1 66 | 67 | #elif defined( macintosh ) 68 | 69 | #define UL_MACINTOSH 1 70 | 71 | #elif defined(__APPLE__) 72 | 73 | #define UL_MAC_OSX 1 74 | 75 | #elif defined(__linux__) 76 | 77 | #define UL_LINUX 1 78 | 79 | #elif defined(__sgi) 80 | 81 | #define UL_IRIX 1 82 | 83 | #elif defined(_AIX) 84 | 85 | #define UL_AIX 1 86 | 87 | #elif defined(SOLARIS) || defined(sun) 88 | 89 | #define UL_SOLARIS 1 90 | 91 | #elif defined(hpux) 92 | 93 | #define UL_HPUX 1 94 | 95 | #elif (defined(__unix__) || defined(unix)) && !defined(USG) 96 | 97 | #define UL_BSD 1 98 | 99 | #endif 100 | 101 | 102 | /* 103 | Add specialised includes/defines... 104 | */ 105 | 106 | #ifdef UL_WIN32 107 | #define WIN32_LEAN_AND_MEAN 108 | #include 109 | #include 110 | #include 111 | #define UL_WGL 1 112 | #endif 113 | 114 | #ifdef UL_CYGWIN 115 | #include 116 | #define UL_WGL 1 117 | #endif 118 | 119 | #ifdef UL_BEOS 120 | #include 121 | #define UL_GLX 1 122 | #endif 123 | 124 | #ifdef UL_MACINTOSH 125 | #include 126 | #include 127 | #define UL_AGL 1 128 | #endif 129 | 130 | #ifdef UL_MAC_OSX 131 | #include 132 | #define UL_CGL 1 133 | #endif 134 | 135 | #if defined(UL_LINUX) || defined(UL_BSD) || defined(UL_IRIX) || defined(UL_SOLARIS) || defined(UL_AIX) 136 | #include 137 | #include 138 | #include 139 | #define UL_GLX 1 140 | #endif 141 | 142 | #if defined(UL_BSD) 143 | #include 144 | #define UL_GLX 1 145 | #endif 146 | 147 | #include 148 | #include 149 | #include 150 | #include 151 | #include 152 | 153 | /* PLIB version macros */ 154 | 155 | #define PLIB_MAJOR_VERSION 1 156 | #define PLIB_MINOR_VERSION 8 157 | #define PLIB_TINY_VERSION 5 158 | 159 | #define PLIB_VERSION (PLIB_MAJOR_VERSION*100 \ 160 | +PLIB_MINOR_VERSION*10 \ 161 | +PLIB_TINY_VERSION) 162 | 163 | /* SGI machines seem to suffer from a lack of FLT_EPSILON so... */ 164 | 165 | #ifndef FLT_EPSILON 166 | #define FLT_EPSILON 1.19209290e-07f 167 | #endif 168 | 169 | #ifndef DBL_EPSILON 170 | #define DBL_EPSILON 1.19209290e-07f 171 | #endif 172 | 173 | #ifndef TRUE 174 | #define TRUE 1 175 | #define FALSE 0 176 | #endif 177 | 178 | /* SUNWspro 4.2 and earlier need bool to be defined */ 179 | 180 | #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x500 181 | typedef int bool ; 182 | const int true = 1 ; 183 | const int false = 0 ; 184 | #endif 185 | 186 | /* Let's define our own "min" and "max" so that different operating systems 187 | * don't complain 188 | */ 189 | #define ulMax(a,b) ((a)>(b)?(a):(b)) 190 | #define ulMin(a,b) ((a)<(b)?(a):(b)) 191 | 192 | 193 | /* 194 | Basic Types 195 | */ 196 | 197 | 198 | /* 199 | High precision clocks. 200 | */ 201 | 202 | class ulClock 203 | { 204 | double start ; 205 | double now ; 206 | double delta ; 207 | double last_time ; 208 | double max_delta ; 209 | 210 | #ifdef UL_WIN32 211 | static double res ; 212 | static int perf_timer ; 213 | void initPerformanceTimer () ; 214 | #endif 215 | 216 | double getRawTime () const ; 217 | 218 | public: 219 | 220 | ulClock () { reset () ; } 221 | 222 | void reset () 223 | { 224 | #ifdef UL_WIN32 225 | initPerformanceTimer () ; 226 | #endif 227 | start = getRawTime () ; 228 | now = 0.0 ; 229 | max_delta = 0.2 ; 230 | delta = 0.0000001 ; /* Faked so stoopid programs won't div0 */ 231 | last_time = 0.0 ; 232 | } 233 | 234 | void setMaxDelta ( double maxDelta ) { max_delta = maxDelta ; } 235 | double getMaxDelta () const { return max_delta ; } 236 | void update () ; 237 | double getAbsTime () const { return now ; } 238 | double getDeltaTime () const { return delta ; } 239 | double getFrameRate () const { return 1.0 / delta ; } 240 | } ; 241 | 242 | 243 | inline void ulSleep ( int seconds ) 244 | { 245 | if ( seconds >= 0 ) 246 | { 247 | #ifdef UL_WIN32 248 | Sleep ( 1000 * seconds ) ; 249 | #else 250 | sleep ( seconds ) ; 251 | #endif 252 | } 253 | } 254 | 255 | 256 | inline void ulMilliSecondSleep ( int milliseconds ) 257 | { 258 | if ( milliseconds >= 0 ) 259 | { 260 | #ifdef UL_WIN32 261 | Sleep ( milliseconds ) ; 262 | #else 263 | usleep ( milliseconds * 1000 ) ; 264 | #endif 265 | } 266 | } 267 | 268 | 269 | /* 270 | This is extern C to enable 'configure.in' to 271 | find it with a C-coded probe. 272 | */ 273 | 274 | extern "C" void ulInit () ; 275 | 276 | /* 277 | Error handler. 278 | */ 279 | 280 | enum ulSeverity 281 | { 282 | UL_DEBUG, // Messages that can safely be ignored. 283 | UL_WARNING, // Messages that are important. 284 | UL_FATAL, // Errors that we cannot recover from. 285 | UL_MAX_SEVERITY 286 | } ; 287 | 288 | 289 | typedef void (*ulErrorCallback) ( enum ulSeverity severity, char* msg ) ; 290 | 291 | void ulSetError ( enum ulSeverity severity, const char *fmt, ... ) ; 292 | char* ulGetError ( void ) ; 293 | void ulClearError ( void ) ; 294 | ulErrorCallback ulGetErrorCallback ( void ) ; 295 | void ulSetErrorCallback ( ulErrorCallback cb ) ; 296 | 297 | /* 298 | Directory Reading 299 | */ 300 | 301 | #define UL_NAME_MAX 256 302 | typedef struct _ulDir ulDir ; 303 | struct ulDirEnt 304 | { 305 | char d_name [ UL_NAME_MAX+1 ]; 306 | bool d_isdir ; 307 | } ; 308 | 309 | int ulIsAbsolutePathName ( const char *pathname ) ; 310 | char *ulGetCWD ( char *result, int maxlength ) ; 311 | 312 | ulDir* ulOpenDir ( const char* dirname ) ; 313 | ulDirEnt* ulReadDir ( ulDir* dir ) ; 314 | void ulCloseDir ( ulDir* dir ) ; 315 | 316 | // file handling 317 | 318 | char* ulMakePath( char* path, const char* dir, const char* fname ); 319 | 320 | bool ulFileExists ( const char *fileName ) ; 321 | 322 | void ulFindFile( char *filenameOutput, const char *path, 323 | const char * tfnameInput, const char *sAPOM ) ; 324 | 325 | 326 | /* 327 | Endian handling 328 | */ 329 | 330 | static const int _ulEndianTest = 1; 331 | #define ulIsLittleEndian (*((char *) &_ulEndianTest ) != 0) 332 | #define ulIsBigEndian (*((char *) &_ulEndianTest ) == 0) 333 | 334 | inline void ulEndianSwap(unsigned int *x) 335 | { 336 | *x = (( *x >> 24 ) & 0x000000FF ) | 337 | (( *x >> 8 ) & 0x0000FF00 ) | 338 | (( *x << 8 ) & 0x00FF0000 ) | 339 | (( *x << 24 ) & 0xFF000000 ) ; 340 | } 341 | 342 | 343 | inline void ulEndianSwap(unsigned short *x) 344 | { 345 | *x = (( *x >> 8 ) & 0x00FF ) | 346 | (( *x << 8 ) & 0xFF00 ) ; 347 | } 348 | 349 | 350 | inline void ulEndianSwap(float *x) { ulEndianSwap((unsigned int *)x); } 351 | inline void ulEndianSwap(int *x) { ulEndianSwap((unsigned int *)x); } 352 | inline void ulEndianSwap(short *x) { ulEndianSwap((unsigned short *)x); } 353 | 354 | 355 | inline unsigned short ulEndianLittle16(unsigned short x) { 356 | if (ulIsLittleEndian) { 357 | return x; 358 | } else { 359 | ulEndianSwap(&x); 360 | return x; 361 | } 362 | } 363 | 364 | inline unsigned int ulEndianLittle32(unsigned int x) { 365 | if (ulIsLittleEndian) { 366 | return x; 367 | } else { 368 | ulEndianSwap(&x); 369 | return x; 370 | } 371 | } 372 | 373 | inline float ulEndianLittleFloat(float x) { 374 | if (ulIsLittleEndian) { 375 | return x; 376 | } else { 377 | ulEndianSwap(&x); 378 | return x; 379 | } 380 | } 381 | 382 | inline void ulEndianLittleArray16(unsigned short *x, int length) { 383 | if (ulIsLittleEndian) { 384 | return; 385 | } else { 386 | for (int i = 0; i < length; i++) { 387 | ulEndianSwap(x++); 388 | } 389 | } 390 | } 391 | 392 | inline void ulEndianLittleArray32(unsigned int *x, int length) { 393 | if (ulIsLittleEndian) { 394 | return; 395 | } else { 396 | for (int i = 0; i < length; i++) { 397 | ulEndianSwap(x++); 398 | } 399 | } 400 | } 401 | 402 | inline void ulEndianLittleArrayFloat(float *x, int length) { 403 | if (ulIsLittleEndian) { 404 | return; 405 | } else { 406 | for (int i = 0; i < length; i++) { 407 | ulEndianSwap(x++); 408 | } 409 | } 410 | } 411 | 412 | inline void ulEndianBigArray16(unsigned short *x, int length) { 413 | if (ulIsBigEndian) { 414 | return; 415 | } else { 416 | for (int i = 0; i < length; i++) { 417 | ulEndianSwap(x++); 418 | } 419 | } 420 | } 421 | 422 | inline void ulEndianBigArray32(unsigned int *x, int length) { 423 | if (ulIsBigEndian) { 424 | return; 425 | } else { 426 | for (int i = 0; i < length; i++) { 427 | ulEndianSwap(x++); 428 | } 429 | } 430 | } 431 | 432 | inline void ulEndianBigArrayFloat(float *x, int length) { 433 | if (ulIsBigEndian) { 434 | return; 435 | } else { 436 | for (int i = 0; i < length; i++) { 437 | ulEndianSwap(x++); 438 | } 439 | } 440 | } 441 | 442 | inline unsigned short ulEndianBig16(unsigned short x) { 443 | if (ulIsBigEndian) { 444 | return x; 445 | } else { 446 | ulEndianSwap(&x); 447 | return x; 448 | } 449 | } 450 | 451 | inline unsigned int ulEndianBig32(unsigned int x) { 452 | if (ulIsBigEndian) { 453 | return x; 454 | } else { 455 | ulEndianSwap(&x); 456 | return x; 457 | } 458 | } 459 | 460 | inline float ulEndianBigFloat(float x) { 461 | if (ulIsBigEndian) { 462 | return x; 463 | } else { 464 | ulEndianSwap(&x); 465 | return x; 466 | } 467 | } 468 | 469 | inline unsigned short ulEndianReadLittle16(FILE *f) { 470 | unsigned short x; 471 | fread(&x, 2, 1, f); 472 | return ulEndianLittle16(x); 473 | } 474 | 475 | inline unsigned int ulEndianReadLittle32(FILE *f) { 476 | unsigned int x; 477 | fread(&x, 4, 1, f); 478 | return ulEndianLittle32(x); 479 | } 480 | 481 | inline float ulEndianReadLittleFloat(FILE *f) { 482 | float x; 483 | fread(&x, 4, 1, f); 484 | return ulEndianLittleFloat(x); 485 | } 486 | 487 | inline unsigned short ulEndianReadBig16(FILE *f) { 488 | unsigned short x; 489 | fread(&x, 2, 1, f); 490 | return ulEndianBig16(x); 491 | } 492 | 493 | inline unsigned int ulEndianReadBig32(FILE *f) { 494 | unsigned int x; 495 | fread(&x, 4, 1, f); 496 | return ulEndianBig32(x); 497 | } 498 | 499 | inline float ulEndianReadBigFloat(FILE *f) { 500 | float x; 501 | fread(&x, 4, 1, f); 502 | return ulEndianBigFloat(x); 503 | } 504 | 505 | inline size_t ulEndianWriteLittle16(FILE *f, unsigned short x) { 506 | x = ulEndianLittle16(x); 507 | return fwrite( &x, 2, 1, f ); 508 | } 509 | 510 | inline size_t ulEndianWriteLittle32(FILE *f, unsigned int x) { 511 | x = ulEndianLittle32(x); 512 | return fwrite( &x, 4, 1, f ); 513 | } 514 | 515 | inline size_t ulEndianWriteLittleFloat(FILE *f, float x) { 516 | x = ulEndianLittleFloat(x); 517 | return fwrite( &x, 4, 1, f ); 518 | } 519 | 520 | inline size_t ulEndianWriteBig16(FILE *f, unsigned short x) { 521 | x = ulEndianBig16(x); 522 | return fwrite( &x, 2, 1, f ); 523 | } 524 | 525 | inline size_t ulEndianWriteBig32(FILE *f, unsigned int x) { 526 | x = ulEndianBig32(x); 527 | return fwrite( &x, 4, 1, f ); 528 | } 529 | 530 | inline size_t ulEndianWriteBigFloat(FILE *f, float x) { 531 | x = ulEndianBigFloat(x); 532 | return fwrite( &x, 4, 1, f ); 533 | } 534 | 535 | 536 | /* 537 | Windoze/BEOS code based on contribution from Sean L. Palmer 538 | */ 539 | 540 | 541 | #ifdef UL_WIN32 542 | 543 | class ulDynamicLibrary 544 | { 545 | HMODULE handle ; 546 | 547 | public: 548 | 549 | ulDynamicLibrary ( const char *libname ) 550 | { 551 | char dllname[1024]; 552 | strcpy ( dllname, libname ) ; 553 | strcat ( dllname, ".dll" ) ; 554 | handle = (HMODULE) LoadLibrary ( dllname ) ; 555 | } 556 | 557 | void *getFuncAddress ( const char *funcname ) 558 | { 559 | return (void *) GetProcAddress ( handle, funcname ) ; //lint !e611 560 | } 561 | 562 | ~ulDynamicLibrary () 563 | { 564 | if ( handle != NULL ) 565 | FreeLibrary ( handle ) ; 566 | } 567 | } ; 568 | 569 | #elif defined (UL_MACINTOSH) 570 | 571 | class ulDynamicLibrary 572 | { 573 | CFragConnectionID connection; 574 | OSStatus error; 575 | 576 | public: 577 | 578 | ulDynamicLibrary ( const char *libname ) 579 | { 580 | Str63 pstr; 581 | int sz; 582 | 583 | sz = strlen (libname); 584 | 585 | if (sz < 64) { 586 | 587 | pstr[0] = sz; 588 | memcpy (pstr+1, libname, sz); 589 | 590 | error = GetSharedLibrary (pstr, kPowerPCCFragArch, kReferenceCFrag, 591 | &connection, NULL, NULL); 592 | } 593 | else 594 | error = 1; 595 | } 596 | 597 | ~ulDynamicLibrary () 598 | { 599 | if ( ! error ) 600 | CloseConnection (&connection); 601 | } 602 | 603 | void* getFuncAddress ( const char *funcname ) 604 | { 605 | if ( ! error ) { 606 | 607 | char* addr; 608 | Str255 sym; 609 | int sz; 610 | 611 | sz = strlen (funcname); 612 | if (sz < 256) { 613 | 614 | sym[0] = sz; 615 | memcpy (sym+1, funcname, sz); 616 | 617 | error = FindSymbol (connection, sym, &addr, 0); 618 | if ( ! error ) 619 | return addr; 620 | } 621 | } 622 | 623 | return NULL; 624 | } 625 | }; 626 | 627 | #elif defined (UL_MAC_OSX) 628 | 629 | 630 | class ulDynamicLibrary 631 | { 632 | 633 | public: 634 | 635 | ulDynamicLibrary ( const char *libname ) 636 | { 637 | } 638 | 639 | ~ulDynamicLibrary () 640 | { 641 | } 642 | 643 | void* getFuncAddress ( const char *funcname ) 644 | { 645 | ulSetError ( UL_WARNING, "ulDynamicLibrary unsuppored on Mac OS X" ); 646 | return NULL; 647 | } 648 | }; 649 | 650 | #elif defined (__BEOS__) 651 | 652 | class ulDynamicLibrary 653 | { 654 | image_id *handle ; 655 | 656 | public: 657 | 658 | ulDynamicLibrary ( const char *libname ) 659 | { 660 | char addonname[1024] ; 661 | strcpy ( addonname, libname ) ; 662 | strcat ( addonname, ".so" ) ; 663 | handle = new image_id ; 664 | 665 | *handle = load_add_on ( addonname ) ; 666 | 667 | if ( *handle == B_ERROR ) 668 | { 669 | delete handle ; 670 | handle = NULL ; 671 | } 672 | } 673 | 674 | void *getFuncAddress ( const char *funcname ) 675 | { 676 | void *sym = NULL ; 677 | 678 | if ( handle && 679 | get_image_symbol ( handle, "funcname", 680 | B_SYMBOL_TYPE_TEXT, &sym ) == B_NO_ERROR ) 681 | return sym ; 682 | 683 | return NULL ; 684 | } 685 | 686 | ~ulDynamicLibrary () 687 | { 688 | if ( handle != NULL ) 689 | unload_add_on ( handle ) ; 690 | 691 | delete handle ; 692 | } 693 | } ; 694 | 695 | # else 696 | 697 | /* 698 | Linux/UNIX 699 | */ 700 | 701 | class ulDynamicLibrary 702 | { 703 | void *handle ; 704 | 705 | public: 706 | 707 | ulDynamicLibrary ( const char *libname ) 708 | { 709 | char dsoname [ 1024 ] ; 710 | strcpy ( dsoname, libname ) ; 711 | strcat ( dsoname, ".so" ) ; 712 | handle = (void *) dlopen ( dsoname, RTLD_NOW | RTLD_GLOBAL ) ; 713 | 714 | if ( handle == NULL ) 715 | ulSetError ( UL_WARNING, "ulDynamicLibrary: %s\n", dlerror() ) ; 716 | } 717 | 718 | void *getFuncAddress ( const char *funcname ) 719 | { 720 | return (handle==NULL) ? NULL : dlsym ( handle, funcname ) ; 721 | } 722 | 723 | ~ulDynamicLibrary () 724 | { 725 | if ( handle != NULL ) 726 | dlclose ( handle ) ; 727 | } 728 | } ; 729 | 730 | #endif 731 | 732 | 733 | class ulList 734 | { 735 | protected: 736 | unsigned int total ; /* The total number of entities in the list */ 737 | unsigned int limit ; /* The current limit on number of entities */ 738 | unsigned int next ; /* The next entity when we are doing getNext ops */ 739 | 740 | void **entity_list ; /* The list. */ 741 | 742 | void sizeChk (void) ; 743 | 744 | public: 745 | 746 | ulList ( int init_max = 1 ) ; 747 | virtual ~ulList (void) ; 748 | 749 | void *getEntity ( unsigned int n ) 750 | { 751 | next = n + 1 ; 752 | return ( n >= total ) ? (void *) NULL : entity_list [ n ] ; 753 | } 754 | 755 | virtual void addEntity ( void *entity ) ; 756 | virtual void addEntityBefore ( int n, void *entity ) ; 757 | virtual void removeEntity ( unsigned int n ) ; 758 | 759 | void removeAllEntities () ; 760 | 761 | void removeEntity ( void *entity ) 762 | { 763 | removeEntity ( searchForEntity ( entity ) ) ; 764 | } 765 | 766 | virtual void replaceEntity ( unsigned int n, void *new_entity ) ; 767 | 768 | void replaceEntity ( void *old_entity, void *new_entity ) 769 | { 770 | replaceEntity ( searchForEntity ( old_entity ), new_entity ) ; 771 | } 772 | 773 | void *getNextEntity (void) { return getEntity ( next ) ; } 774 | 775 | int getNumEntities (void) const { return total ; } 776 | int searchForEntity ( void *entity ) const ; 777 | } ; 778 | 779 | 780 | typedef bool (*ulIterateFunc)( const void *data, void *user_data ) ; 781 | typedef int (*ulCompareFunc)( const void *data1, const void *data2 ) ; 782 | 783 | /* 784 | Linked list. 785 | */ 786 | 787 | class ulListNode ; 788 | 789 | class ulLinkedList 790 | { 791 | protected: 792 | 793 | ulListNode *head ; 794 | ulListNode *tail ; 795 | 796 | int nnodes ; 797 | bool sorted ; 798 | 799 | void unlinkNode ( ulListNode *prev, ulListNode *node ) ; 800 | 801 | bool isValidPosition ( int pos ) const 802 | { 803 | if ( ( pos < 0 ) || ( pos >= nnodes ) ) 804 | { 805 | ulSetError ( UL_WARNING, "ulLinkedList: Invalid 'pos' %u", pos ) ; 806 | return false ; 807 | } 808 | return true ; 809 | } 810 | 811 | public: 812 | 813 | ulLinkedList () 814 | { 815 | head = tail = NULL ; 816 | nnodes = 0 ; 817 | sorted = true ; 818 | } 819 | 820 | ~ulLinkedList () { empty () ; } 821 | 822 | int getNumNodes ( void ) const { return nnodes ; } 823 | bool isSorted ( void ) const { return sorted ; } 824 | 825 | int getNodePosition ( void *data ) const ; 826 | 827 | void insertNode ( void *data, int pos ) ; 828 | void prependNode ( void *data ) { insertNode ( data, 0 ) ; } 829 | void appendNode ( void *data ) ; 830 | 831 | int insertSorted ( void *data, ulCompareFunc comparefn ) ; 832 | 833 | void removeNode ( void *data ) ; 834 | void * removeNode ( int pos ) ; 835 | 836 | void * getNodeData ( int pos ) const ; 837 | 838 | void * forEach ( ulIterateFunc fn, void *user_data = NULL ) const ; 839 | 840 | void empty ( ulIterateFunc destroyfn = NULL, void *user_data = NULL ) ; 841 | } ; 842 | 843 | 844 | extern char *ulStrDup ( const char *s ) ; 845 | extern int ulStrNEqual ( const char *s1, const char *s2, int len ); 846 | extern int ulStrEqual ( const char *s1, const char *s2 ); 847 | 848 | //lint -restore 849 | 850 | #endif 851 | 852 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/plib.framework/Versions/A/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | plib 9 | CFBundleIdentifier 10 | com.yourcompany.yourcocoaframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | plib 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | 22 | 23 | -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/A/plib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/plib.framework/Versions/A/plib -------------------------------------------------------------------------------- /Frameworks/plib.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Frameworks/plib.framework/plib: -------------------------------------------------------------------------------- 1 | Versions/Current/plib -------------------------------------------------------------------------------- /Frameworks/zlib.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/zlib.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | zlib 9 | CFBundleIdentifier 10 | com.yourcompany.yourcocoaframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | zlib 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | 22 | 23 | -------------------------------------------------------------------------------- /Frameworks/zlib.framework/Versions/A/zlib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Frameworks/zlib.framework/Versions/A/zlib -------------------------------------------------------------------------------- /Frameworks/zlib.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Frameworks/zlib.framework/zlib: -------------------------------------------------------------------------------- 1 | Versions/Current/zlib -------------------------------------------------------------------------------- /Headers/isnan.h: -------------------------------------------------------------------------------- 1 | /* 2 | isnan definition for gcc on Mac OS X, taken from math.h. 3 | isnan is not available to C++ code (see ), 4 | and including math.h has no effect because it's undefined in cmath. So we redefine it here 5 | instead. 6 | */ 7 | 8 | #define isnan(x) \ 9 | ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \ 10 | : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \ 11 | : __inline_isnan ((long double)(x))) 12 | -------------------------------------------------------------------------------- /Headers/learning/ANN.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/ANN.h -------------------------------------------------------------------------------- /Headers/learning/Distribution.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/Distribution.h -------------------------------------------------------------------------------- /Headers/learning/List.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/List.h -------------------------------------------------------------------------------- /Headers/learning/MathFunctions.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/MathFunctions.h -------------------------------------------------------------------------------- /Headers/learning/ann_policy.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/ann_policy.h -------------------------------------------------------------------------------- /Headers/learning/learn_debug.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/learn_debug.h -------------------------------------------------------------------------------- /Headers/learning/policy.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/policy.h -------------------------------------------------------------------------------- /Headers/learning/real.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/real.h -------------------------------------------------------------------------------- /Headers/learning/string_utils.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/learning/string_utils.h -------------------------------------------------------------------------------- /Headers/tmath/linalg_t.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/math/linalg_t.h -------------------------------------------------------------------------------- /Headers/tmath/straight2_t.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/math/straight2_t.h -------------------------------------------------------------------------------- /Headers/tmath/v2_t.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/math/v2_t.h -------------------------------------------------------------------------------- /Headers/tmath/v3_t.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/math/v3_t.h -------------------------------------------------------------------------------- /Headers/tmath/v4_t.h: -------------------------------------------------------------------------------- 1 | ../../../src/libs/math/v4_t.h -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Torcs 11 | CFBundleIdentifier 12 | net.sourceforge.torcs 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.3.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.3.1 25 | 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | About 2 | ----- 3 | This project contains all necessary files to patch and compile the original Torcs 1.3.1 sources into 4 | a bundled Mac OS X application using Xcode. 5 | 6 | The Xcode project is based on previous [work][2] by Stephen Hudson and others, with vast changes to 7 | streamline the build, leverage the existing Torcs makefiles for installing data, and reduce the size 8 | of the final application bundle. The Mac-specific changes to the source code have been redone to 9 | minimize impact (for instance, there is now no need to change the way learning and tmath headers are 10 | included). As a result, this port should be easier to maintain and adapt to future versions of Torcs. 11 | 12 | Camillo Lugaresi 13 | 14 | How to install 15 | -------------- 16 | - Download the Torcs 1.3.1 source package from SourceForge: [torcs-1.3.1.tar.bz2][1] 17 | - Extract it, and put the MacTorcs folder inside the torcs-1.3.1 folder 18 | - Open the Torcs project 19 | - Build the "Apply patch" target to patch the source code for Mac support 20 | - Build the "Torcs.app" target to build Torcs as a Mac application 21 | - Enjoy! 22 | 23 | How to add a driver 24 | ------------------- 25 | - Duplicate one of the existing driver targets (eg "tita.so") and rename it as appropriate 26 | (eg "newdriver.so") 27 | - Double-click the new target, go to the "Build" tab and change the product name (eg "newdriver") 28 | - Expand the new target and remove all files from the Compile Sources phase 29 | - Add the new driver's source files to the project; choose to add them to the new target you just 30 | set up 31 | - Add the new target to "All Dynamic Libraries" (drag it) 32 | - Double-click on the "Install drivers" phase in the "Torcs.app" target and add your newdriver.so to 33 | the input files (follow the pattern). 34 | 35 | TODO 36 | ---- 37 | - Save settings in the Preferences folder instead of modifying the application bundle. 38 | 39 | 40 | [1]: http://sourceforge.net/projects/torcs/files/all-in-one/1.3.1/torcs-1.3.1.tar.bz2/download 41 | [2]: http://publish.uwo.ca/~shudson2/Home/Blog/7805725A-C647-41F0-B9C2-B91E8388D4EC.html -------------------------------------------------------------------------------- /Resources/Torcs.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camillol/MacTorcs/5b57c5fefd375c7d3ac6779446d609db952f4c51/Resources/Torcs.icns -------------------------------------------------------------------------------- /mac_setup_resources.mk: -------------------------------------------------------------------------------- 1 | # targets: 2 | # resinstall 3 | # datainstall 4 | # shipinstall 5 | # 6 | # required variables: 7 | # TORCS_BASE - torcs source dir 8 | # MAKE_DEFAULT - this file 9 | # datadir - destination dir 10 | # 11 | # example: 12 | # cd torcs-1.3.1 13 | # make resinstall TORCS_BASE=$PWD MAKE_DEFAULT=$PWD/../mac_setup_resources.mk \ 14 | # datadir=$PWD/../../RES 15 | # 16 | # - CL 17 | 18 | ifndef TORCS_BASE 19 | error: 20 | @echo "TORCS_BASE should be defined" 21 | @exit 1 22 | endif 23 | 24 | INSTALL = /usr/bin/install -c 25 | INSTALL_DATA = ${INSTALL} -m 644 26 | 27 | mkinstalldirs = $(SHELL) $(TORCS_BASE)/mkinstalldirs 28 | 29 | INSTDATABASE = ${DESTDIR}${datadir} 30 | INSTVARBASE = ${DESTDIR}${datadir} 31 | 32 | define recursedirs 33 | for Dir in $$RecurseDirs ;\ 34 | do ${MAKE} -C $$Dir $$RecurseFlags TORCS_BASE=${TORCS_BASE} MAKE_DEFAULT=${MAKE_DEFAULT}; \ 35 | if [ $$? != 0 ]; then exit 1; fi ; \ 36 | done 37 | endef 38 | 39 | # Recursive targets 40 | 41 | .PHONY: datainstall installdata installdatadirs makedatadir shipinstall installship installshipmkdir instshipdirs installshipdirs 42 | 43 | resinstall: datainstall shipinstall 44 | 45 | datainstall: installdatadirs installdata 46 | 47 | installdata: makedatadir $(patsubst %, ${INSTDATABASE}/${DATADIR}/%, $(DATA)) 48 | 49 | makedatadir: 50 | @D=`pwd` ; \ 51 | createdir="${INSTDATABASE}/${DATADIR}" ; \ 52 | $(mkinstalldirs) $$createdir 53 | 54 | $(patsubst %, ${INSTDATABASE}/${DATADIR}/%, $(DATA)) : ${INSTDATABASE}/${DATADIR}/% : % 55 | $(INSTALL_DATA) $< $@ 56 | 57 | instdatadirs: 58 | @RecurseDirs="${DATASUBDIRS}" ; \ 59 | RecurseFlags="install" ; \ 60 | ${recursedirs} 61 | 62 | installdatadirs: 63 | @if [ -n "${DATASUBDIRS}" ] ; \ 64 | then R=`for I in ${DATASUBDIRS} ; \ 65 | do echo $$I ;\ 66 | done | sort -u` ; \ 67 | RecurseDirs="$$R" ; \ 68 | RecurseFlags="datainstall" ; \ 69 | ${recursedirs} ; \ 70 | fi 71 | 72 | 73 | shipinstall: installshipdirs installship installshipmkdir 74 | 75 | installship: makeshipdir $(patsubst %, ${INSTDATABASE}/${SHIPDIR}/%, $(SHIP)) 76 | 77 | makeshipdir: 78 | @D=`pwd` ; \ 79 | createdir="${INSTDATABASE}/${SHIPDIR}" ; \ 80 | $(mkinstalldirs) $$createdir 81 | 82 | $(patsubst %, ${INSTDATABASE}/${SHIPDIR}/%, $(SHIP)) : ${INSTDATABASE}/${SHIPDIR}/% : % 83 | $(INSTALL_DATA) $< $@ 84 | 85 | installshipmkdir: 86 | @for D in $(SHIPCREATEDIRS) ; \ 87 | do echo " Creating ${INSTVARBASE}/$$D Directory" ; \ 88 | $(mkinstalldirs) ${INSTVARBASE}/$$D ; \ 89 | done 90 | 91 | instshipdirs: 92 | @RecurseDirs="${SHIPSUBDIRS}" ; \ 93 | RecurseFlags="install" ; \ 94 | ${recursedirs} 95 | 96 | installshipdirs: 97 | @if [ -n "${SHIPSUBDIRS}" ] ; \ 98 | then R=`for I in ${SHIPSUBDIRS} ; \ 99 | do echo $$I ;\ 100 | done | sort -u` ; \ 101 | RecurseDirs="$$R" ; \ 102 | RecurseFlags="shipinstall" ; \ 103 | ${recursedirs} ; \ 104 | fi 105 | -------------------------------------------------------------------------------- /torcs-1.3.1-mac.diff: -------------------------------------------------------------------------------- 1 | Only in torcs-1.3.1-mac: .DS_Store 2 | Only in torcs-1.3.1-mac: MacTorcs 3 | diff -ru torcs-1.3.1/data/tracks/aalborg/Makefile torcs-1.3.1-mac/data/tracks/aalborg/Makefile 4 | --- torcs-1.3.1/data/tracks/aalborg/Makefile 2005-03-21 22:14:06.000000000 +0100 5 | +++ torcs-1.3.1-mac/data/tracks/aalborg/Makefile 2010-06-16 00:23:09.000000000 +0200 6 | @@ -25,7 +25,7 @@ 7 | tr-curb-bw-aa-r.rgb grass-aa.rgb tr-g-to-asphalt-aa-l_n.rgb tr-grass-aa-l_n.rgb \ 8 | tr-asphalt-2-aa-r_n.rgb tr-asphalt-aa-bw2-e_n.rgb tr-asphalt-aa-bw2_n.rgb \ 9 | tarmac-wall-1-g2.rgb tr-asphalt-to-g-aa-l_n.rgb tr-asphalt-aa-bw2-s_n.rgb \ 10 | - aalborg.png background.png 11 | + background.png 12 | 13 | data-tracks-road_PKGFILES = $(DATA) 14 | 15 | diff -ru torcs-1.3.1/data/tracks/road/alpine-2/Makefile torcs-1.3.1-mac/data/tracks/road/alpine-2/Makefile 16 | --- torcs-1.3.1/data/tracks/road/alpine-2/Makefile 2008-06-05 01:09:11.000000000 +0200 17 | +++ torcs-1.3.1-mac/data/tracks/road/alpine-2/Makefile 2010-06-16 00:23:09.000000000 +0200 18 | @@ -23,7 +23,7 @@ 19 | arbor2_n.rgb concrete2.rgb shadow2.rgb tr-stone-wall.rgb truck_arbor_berniw_n.rgb \ 20 | truck_arbor_dummy_n.rgb truck_arbor_hymie_n.rgb truck_arbor_inferno_n.rgb \ 21 | truck_arbor_mouse_n.rgb truck_arbor_ole_n.rgb truck_arbor_speedy_n.rgb \ 22 | - truck_arbor_tp_n.rgb truck_arbor_usr_n.rgb alpine-2.png armco2_arbor.png \ 23 | + truck_arbor_tp_n.rgb truck_arbor_usr_n.rgb armco2_arbor.png \ 24 | armco_snow_arbor.png armcoturn_arbor.png background.png BARS_tree_n.png BLBDBK.png \ 25 | BLDG05_tree.png brick01.png cliff.png CMNTA.png concdark.png CONCRE.png \ 26 | concrete01.png concwall2.png concwall.png GRDRA_tree_n.png ice.png LOGOMELA.png \ 27 | diff -ru torcs-1.3.1/data/tracks/road/forza/Makefile torcs-1.3.1-mac/data/tracks/road/forza/Makefile 28 | --- torcs-1.3.1/data/tracks/road/forza/Makefile 2008-02-24 13:55:08.000000000 +0100 29 | +++ torcs-1.3.1-mac/data/tracks/road/forza/Makefile 2010-06-16 00:23:09.000000000 +0200 30 | @@ -23,7 +23,7 @@ 31 | 100.png 300.png ABtree_n.png background.png BAtree_n.png BEtree_n.png \ 32 | BLBDBK.png BLDAB.png BLDA.png BLUPOLE.png BRtree_n.png BTOWB.png BUtree_n.png \ 33 | CAtree_n.png CHtree_n.png CMNTA.png CMNTBB.png CMNTB.png conc.png CONCTP.png CRNA.png \ 34 | - CRNB.png CRNC.png CRND.png CRNF.png DBLOGO.png FERRED.png FLTBLK.png FNCEB.png forza.png \ 35 | + CRNB.png CRNC.png CRND.png CRNF.png DBLOGO.png FERRED.png FLTBLK.png FNCEB.png \ 36 | FRRI.png FRtree_n.png G2tree_n.png GBtree_n.png GCtree_n.png GDtree_n.png GEtree_n.png \ 37 | GFtree_n.png GGtree.png GNtree_n.png GRAS2B.png GRtree_n.png GSBLUE.png GSBSTAIR.png \ 38 | GSDH.png GSPAtree.png GSRNDF.png GSSOLID.png GStree_n.png GSUNDER.png ITtree_n.png \ 39 | diff -ru torcs-1.3.1/data/tracks/road/ruudskogen/Makefile torcs-1.3.1-mac/data/tracks/road/ruudskogen/Makefile 40 | --- torcs-1.3.1/data/tracks/road/ruudskogen/Makefile 2006-08-19 23:52:07.000000000 +0200 41 | +++ torcs-1.3.1-mac/data/tracks/road/ruudskogen/Makefile 2010-06-16 00:23:09.000000000 +0200 42 | @@ -20,7 +20,7 @@ 43 | DATADIR = tracks/road/$(TRACK) 44 | 45 | DATA = $(TRACK).xml $(TRACK).acc $(TRACK).png readme.txt background.png shadow2.rgb \ 46 | - env.png arb01_n.png arb02_n.png background.png dekk01.png grass01.png \ 47 | + env.png arb01_n.png arb02_n.png dekk01.png grass01.png \ 48 | grass02.png hus02.png hytte01.png lave01.png lave02.png rk_tree_1_n.png \ 49 | rk_tree_2_n.png rk_tree_3_n.png road01-dashlines.png road01-pitentry.png \ 50 | road01-pits_n.png road01.png road02.png road03.png road-edge.png \ 51 | diff -ru torcs-1.3.1/data/tracks/road/wheel-2/Makefile torcs-1.3.1-mac/data/tracks/road/wheel-2/Makefile 52 | --- torcs-1.3.1/data/tracks/road/wheel-2/Makefile 2008-02-24 15:24:44.000000000 +0100 53 | +++ torcs-1.3.1-mac/data/tracks/road/wheel-2/Makefile 2010-06-16 00:23:09.000000000 +0200 54 | @@ -24,7 +24,7 @@ 55 | background.png building1.png building2.png clkdtm.png girder_tree_n.png grass.png \ 56 | rmbl.png sand.png sbridge2.png shadow2.png sign1.png sign2.png sign3.png swall2.png \ 57 | tirewall.png tr-barrier.png tr-barrier-tree_n.png treeg11_n.png treeline.png \ 58 | - tree_n.png tr-spec.png truck_arbor_ctd_n.png water_green2.png wheel-2.png wheel.png \ 59 | + tree_n.png tr-spec.png truck_arbor_ctd_n.png water_green2.png wheel.png \ 60 | barr1_n.rgb concdal.rgb shadow2.rgb texwheel.rgb torcs1.rgb truck0.rgb 61 | 62 | 63 | diff -ru torcs-1.3.1/src/drivers/olethros/driver.cpp torcs-1.3.1-mac/src/drivers/olethros/driver.cpp 64 | --- torcs-1.3.1/src/drivers/olethros/driver.cpp 2008-05-31 00:18:32.000000000 +0200 65 | +++ torcs-1.3.1-mac/src/drivers/olethros/driver.cpp 2010-06-16 00:23:09.000000000 +0200 66 | @@ -41,6 +41,8 @@ 67 | #ifdef WIN32 68 | #include 69 | #define isnan _isnan 70 | +#elif defined(__APPLE__) 71 | +#include "isnan.h" 72 | #endif 73 | 74 | #undef TEST_PITSTOPS 75 | diff -ru torcs-1.3.1/src/drivers/olethros/geometry.cpp torcs-1.3.1-mac/src/drivers/olethros/geometry.cpp 76 | --- torcs-1.3.1/src/drivers/olethros/geometry.cpp 2006-01-06 16:22:29.000000000 +0100 77 | +++ torcs-1.3.1-mac/src/drivers/olethros/geometry.cpp 2010-06-16 00:23:09.000000000 +0200 78 | @@ -27,6 +27,8 @@ 79 | #ifdef WIN32 80 | #include 81 | #define isnan _isnan 82 | +#elif defined(__APPLE__) 83 | +#include "isnan.h" 84 | #endif 85 | 86 | 87 | diff -ru torcs-1.3.1/src/libs/client/splash.cpp torcs-1.3.1-mac/src/libs/client/splash.cpp 88 | --- torcs-1.3.1/src/libs/client/splash.cpp 2008-08-16 16:58:51.000000000 +0200 89 | +++ torcs-1.3.1-mac/src/libs/client/splash.cpp 2010-06-16 00:23:09.000000000 +0200 90 | @@ -20,7 +20,11 @@ 91 | #include 92 | #define HAVE_CONFIG_H 93 | #endif 94 | -#include 95 | +#ifdef __APPLE__ 96 | + #include 97 | +#else 98 | + #include 99 | +#endif 100 | #include 101 | #include 102 | 103 | diff -ru torcs-1.3.1/src/libs/learning/policy.cpp torcs-1.3.1-mac/src/libs/learning/policy.cpp 104 | --- torcs-1.3.1/src/libs/learning/policy.cpp 2005-09-19 14:48:03.000000000 +0200 105 | +++ torcs-1.3.1-mac/src/libs/learning/policy.cpp 2010-06-16 00:23:09.000000000 +0200 106 | @@ -18,7 +18,9 @@ 107 | #ifdef WIN32 108 | #include 109 | #define isnan _isnan 110 | -#endif // WIN32 111 | +#elif defined(__APPLE__) 112 | +#include "isnan.h" 113 | +#endif 114 | 115 | #undef POLICY_LOG 116 | 117 | diff -ru torcs-1.3.1/src/libs/tgfclient/fg_gm.cpp torcs-1.3.1-mac/src/libs/tgfclient/fg_gm.cpp 118 | --- torcs-1.3.1/src/libs/tgfclient/fg_gm.cpp 2008-11-09 18:50:22.000000000 +0100 119 | +++ torcs-1.3.1-mac/src/libs/tgfclient/fg_gm.cpp 2010-06-16 00:23:09.000000000 +0200 120 | @@ -42,8 +42,13 @@ 121 | 2004/10/03 Bernhard Wymann: Added Randr support, bugfixes. 122 | */ 123 | 124 | +#ifdef __APPLE__ 125 | +#include 126 | +#include 127 | +#else 128 | #include 129 | #include 130 | +#endif 131 | #include 132 | #include 133 | #include 134 | @@ -51,7 +56,7 @@ 135 | #include 136 | #include "fg_gm.h" 137 | 138 | -#ifndef WIN32 139 | +#if !defined(WIN32) && !defined(__APPLE__) 140 | 141 | #include 142 | #include 143 | @@ -468,7 +473,7 @@ 144 | */ 145 | void fglutGameModeString( const char* string ) 146 | { 147 | -#ifndef WIN32 148 | +#if !defined(WIN32) && !defined(__APPLE__) 149 | int width = 640, height = 480, depth = 16, refresh = 72; 150 | 151 | /* 152 | @@ -501,7 +506,7 @@ 153 | */ 154 | int fglutEnterGameMode( void ) 155 | { 156 | -#ifndef WIN32 157 | +#if !defined(WIN32) && !defined(__APPLE__) 158 | /* 159 | * Remember the current resolution, etc. 160 | */ 161 | @@ -529,7 +534,7 @@ 162 | */ 163 | void fglutLeaveGameMode( void ) 164 | { 165 | -#ifndef WIN32 166 | +#if !defined(WIN32) && !defined(__APPLE__) 167 | /* 168 | * Then, have the desktop visual settings restored 169 | */ 170 | diff -ru torcs-1.3.1/src/libs/tgfclient/glfeatures.h torcs-1.3.1-mac/src/libs/tgfclient/glfeatures.h 171 | --- torcs-1.3.1/src/libs/tgfclient/glfeatures.h 2005-08-05 11:26:39.000000000 +0200 172 | +++ torcs-1.3.1-mac/src/libs/tgfclient/glfeatures.h 2010-06-16 00:23:09.000000000 +0200 173 | @@ -28,14 +28,16 @@ 174 | #ifndef _GRFEATURES_H_ 175 | #define _GRFEATURES_H_ 176 | 177 | -#ifdef WIN32 178 | -#include 179 | -#include 180 | -#include 181 | -#else 182 | -#include 183 | -#endif // WIN32 184 | - 185 | +#ifdef WIN32 186 | +#include 187 | +#include 188 | +#include 189 | +#elif defined(__APPLE__) 190 | +#include 191 | +#else 192 | +#include 193 | +#endif // WIN32 194 | + 195 | #include 196 | #include 197 | 198 | diff -ru torcs-1.3.1/src/libs/tgfclient/gui.cpp torcs-1.3.1-mac/src/libs/tgfclient/gui.cpp 199 | --- torcs-1.3.1/src/libs/tgfclient/gui.cpp 2008-11-09 18:50:22.000000000 +0100 200 | +++ torcs-1.3.1-mac/src/libs/tgfclient/gui.cpp 2010-06-16 02:51:58.000000000 +0200 201 | @@ -249,6 +249,11 @@ 202 | int modifier; 203 | tGfuiObject *obj; 204 | 205 | +#ifdef __APPLE__ 206 | + /* work around GLUT bug on OS X which swaps the delete and backspace keys */ 207 | + if (key == 8) key = 127; 208 | + else if (key == 127) key = 8; 209 | +#endif 210 | modifier = glutGetModifiers(); 211 | 212 | /* user preempt key */ 213 | @@ -322,6 +327,11 @@ 214 | tGfuiKey *curKey; 215 | int modifier; 216 | 217 | +#ifdef __APPLE__ 218 | + /* work around GLUT bug on OS X which swaps the delete and backspace keys */ 219 | + if (key == 8) key = 127; 220 | + else if (key == 127) key = 8; 221 | +#endif 222 | modifier = glutGetModifiers(); 223 | 224 | /* user preempt key */ 225 | diff -ru torcs-1.3.1/src/libs/tgfclient/guifont.cpp torcs-1.3.1-mac/src/libs/tgfclient/guifont.cpp 226 | --- torcs-1.3.1/src/libs/tgfclient/guifont.cpp 2008-11-09 18:50:22.000000000 +0100 227 | +++ torcs-1.3.1-mac/src/libs/tgfclient/guifont.cpp 2010-06-16 00:23:09.000000000 +0200 228 | @@ -24,7 +24,7 @@ 229 | 230 | #ifdef WIN32 231 | #include 232 | -#elif defined(__FreeBSD__) 233 | +#elif defined(__FreeBSD__) || defined(__APPLE__) 234 | #include 235 | #else 236 | #include 237 | diff -ru torcs-1.3.1/src/libs/tgfclient/guimenu.cpp torcs-1.3.1-mac/src/libs/tgfclient/guimenu.cpp 238 | --- torcs-1.3.1/src/libs/tgfclient/guimenu.cpp 2008-11-09 18:50:22.000000000 +0100 239 | +++ torcs-1.3.1-mac/src/libs/tgfclient/guimenu.cpp 2010-06-16 00:23:09.000000000 +0200 240 | @@ -29,7 +29,11 @@ 241 | #ifdef WIN32 242 | #include 243 | #endif 244 | -#include 245 | +#ifdef __APPLE__ 246 | + #include 247 | +#else 248 | + #include 249 | +#endif 250 | 251 | #include 252 | #include "gui.h" 253 | diff -ru torcs-1.3.1/src/libs/tgfclient/img.cpp torcs-1.3.1-mac/src/libs/tgfclient/img.cpp 254 | --- torcs-1.3.1/src/libs/tgfclient/img.cpp 2006-10-29 16:55:33.000000000 +0100 255 | +++ torcs-1.3.1-mac/src/libs/tgfclient/img.cpp 2010-06-16 00:23:09.000000000 +0200 256 | @@ -28,7 +28,11 @@ 257 | #include 258 | #endif 259 | 260 | +#ifdef __APPLE__ 261 | +#include 262 | +#else 263 | #include "png.h" 264 | +#endif 265 | 266 | #include 267 | #include 268 | diff -ru torcs-1.3.1/src/libs/tgfclient/screen.cpp torcs-1.3.1-mac/src/libs/tgfclient/screen.cpp 269 | --- torcs-1.3.1/src/libs/tgfclient/screen.cpp 2008-11-09 18:50:22.000000000 +0100 270 | +++ torcs-1.3.1-mac/src/libs/tgfclient/screen.cpp 2010-06-16 00:23:09.000000000 +0200 271 | @@ -27,7 +27,12 @@ 272 | #ifdef WIN32 273 | #include 274 | #endif 275 | -#include 276 | +#ifdef __APPLE__ 277 | + #include 278 | + #include 279 | +#else 280 | + #include 281 | +#endif 282 | #include 283 | #ifndef WIN32 284 | #include 285 | @@ -248,6 +253,19 @@ 286 | int maxfreq; 287 | int i, depth; 288 | 289 | +#ifdef __APPLE__ 290 | + /* glutInit chdirs into the resource directory, but GfScrInit attempts to access the config 291 | + files before calling it. Set the working directory in advance, so that the configuration 292 | + files can be found. We could also move glutInit here on OS X. */ 293 | + char *resPath; 294 | + CFURLRef resDir = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); 295 | + resPath = (char *)malloc(4096); 296 | + CFURLGetFileSystemRepresentation(resDir, true, (UInt8 *)resPath, 4096); 297 | + chdir(resPath); 298 | + free(resPath); 299 | + CFRelease(resDir); 300 | +#endif 301 | + 302 | sprintf(buf, "%s%s", GetLocalDir(), GFSCR_CONF_FILE); 303 | handle = GfParmReadFile(buf, GFPARM_RMODE_STD | GFPARM_RMODE_CREAT); 304 | xw = (int)GfParmGetNum(handle, GFSCR_SECT_PROP, GFSCR_ATT_X, (char*)NULL, 640); 305 | @@ -487,7 +505,7 @@ 306 | static const int CMDSIZE = 1024; 307 | char cmd[CMDSIZE]; 308 | 309 | -#ifndef WIN32 310 | +#if !defined(WIN32) && !defined(__APPLE__) 311 | char *arg[8]; 312 | int curArg; 313 | #endif 314 | @@ -515,6 +533,24 @@ 315 | #else 316 | GfScrShutdown(); 317 | 318 | +#ifdef __APPLE__ 319 | + /* On Mac OS X, a multithreaded process cannot call exec. Therefore, we fork first. */ 320 | + CFURLRef binUrl = CFBundleCopyExecutableURL(CFBundleGetMainBundle()); 321 | + CFURLGetFileSystemRepresentation(binUrl, true, (UInt8 *)cmd, sizeof(cmd)); 322 | + CFRelease(binUrl); 323 | + pid_t pid = fork(); 324 | + if (pid == 0) { /* child */ 325 | + execl(cmd, cmd, NULL); 326 | + perror("exec failed"); 327 | + exit(1); 328 | + } 329 | + else if (pid > 0) { /* parent */ 330 | + exit(0); 331 | + } 332 | + perror("fork failed"); 333 | + exit(1); 334 | +#else 335 | + 336 | sprintf (cmd, "%storcs-bin", GetLibDir ()); 337 | memset (arg, 0, sizeof (arg)); 338 | curArg = 0; 339 | @@ -567,8 +603,8 @@ 340 | break; 341 | } 342 | 343 | - 344 | -#endif 345 | +#endif // __APPLE__ 346 | +#endif // WIN32 347 | if (retcode) { 348 | perror("torcs"); 349 | exit(1); 350 | diff -ru torcs-1.3.1/src/libs/tgfclient/tgfclient.h torcs-1.3.1-mac/src/libs/tgfclient/tgfclient.h 351 | --- torcs-1.3.1/src/libs/tgfclient/tgfclient.h 2008-08-16 16:12:08.000000000 +0200 352 | +++ torcs-1.3.1-mac/src/libs/tgfclient/tgfclient.h 2010-06-16 00:23:09.000000000 +0200 353 | @@ -28,7 +28,11 @@ 354 | #define __TGFCLIENT__H__ 355 | 356 | #include 357 | -#include 358 | +#ifdef __APPLE__ 359 | + #include 360 | +#else 361 | + #include 362 | +#endif 363 | #include 364 | #include 365 | 366 | diff -ru torcs-1.3.1/src/linux/main.cpp torcs-1.3.1-mac/src/linux/main.cpp 367 | --- torcs-1.3.1/src/linux/main.cpp 2008-11-09 18:50:22.000000000 +0100 368 | +++ torcs-1.3.1-mac/src/linux/main.cpp 2010-06-16 00:23:09.000000000 +0200 369 | @@ -19,7 +19,11 @@ 370 | 371 | #include 372 | 373 | -#include 374 | +#ifdef __APPLE__ 375 | + #include 376 | +#else 377 | + #include 378 | +#endif 379 | 380 | #include 381 | #include 382 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/OpenalSoundInterface.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/OpenalSoundInterface.cpp 383 | --- torcs-1.3.1/src/modules/graphic/ssggraph/OpenalSoundInterface.cpp 2006-01-05 10:53:37.000000000 +0100 384 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/OpenalSoundInterface.cpp 2010-06-16 00:23:09.000000000 +0200 385 | @@ -164,7 +164,7 @@ 386 | void OpenalSoundInterface::setNCars(int n_cars) 387 | { 388 | engpri = new SoundPri[n_cars]; 389 | - car_src = new SoundSource[n_cars]; 390 | + car_src = new TorcsSoundSource[n_cars]; 391 | } 392 | 393 | 394 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/PlibSoundInterface.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/PlibSoundInterface.cpp 395 | --- torcs-1.3.1/src/modules/graphic/ssggraph/PlibSoundInterface.cpp 2005-11-18 01:20:32.000000000 +0100 396 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/PlibSoundInterface.cpp 2010-06-16 00:23:09.000000000 +0200 397 | @@ -60,7 +60,7 @@ 398 | void PlibSoundInterface::setNCars(int n_cars) 399 | { 400 | engpri = new SoundPri[n_cars]; 401 | - car_src = new SoundSource[n_cars]; 402 | + car_src = new TorcsSoundSource[n_cars]; 403 | } 404 | 405 | slScheduler* PlibSoundInterface::getScheduler() 406 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/SoundInterface.h torcs-1.3.1-mac/src/modules/graphic/ssggraph/SoundInterface.h 407 | --- torcs-1.3.1/src/modules/graphic/ssggraph/SoundInterface.h 2005-11-18 01:20:32.000000000 +0100 408 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/SoundInterface.h 2010-06-16 00:23:09.000000000 +0200 409 | @@ -241,8 +241,8 @@ 410 | slScheduler* sched; 411 | std::vector sound_list; 412 | SoundPri* engpri; 413 | - SoundSource* car_src; 414 | - SoundSource tyre_src[4]; 415 | + TorcsSoundSource* car_src; 416 | + TorcsSoundSource tyre_src[4]; 417 | void DopplerShift (SoundChar* sound, float* p_src, float* u_src, float* p, float* u); 418 | void SetMaxSoundCar(CarSoundData** car_sound_data, QueueSoundMap* smap); 419 | float global_gain; 420 | @@ -274,8 +274,8 @@ 421 | float a; //amplitude modulation 422 | } SoundChar; 423 | protected: 424 | - SoundSource* car_src; 425 | - SoundSource tyre_src[4]; 426 | + TorcsSoundSource* car_src; 427 | + TorcsSoundSource tyre_src[4]; 428 | ALCcontext* cc; 429 | ALCdevice* dev; 430 | float global_gain; 431 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/TorcsSound.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/TorcsSound.cpp 432 | --- torcs-1.3.1/src/modules/graphic/ssggraph/TorcsSound.cpp 2005-11-18 01:20:32.000000000 +0100 433 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/TorcsSound.cpp 2010-06-16 00:23:09.000000000 +0200 434 | @@ -186,7 +186,7 @@ 435 | } 436 | 437 | /// Create a sound source 438 | -SoundSource::SoundSource() 439 | +TorcsSoundSource::TorcsSoundSource() 440 | { 441 | a = 0.0; 442 | f = 1.0; 443 | @@ -198,7 +198,7 @@ 444 | * At the moment this 445 | */ 446 | 447 | -void SoundSource::update() 448 | +void TorcsSoundSource::update() 449 | { 450 | // Get relative speed/position vector 451 | sgVec3 u; 452 | @@ -259,7 +259,7 @@ 453 | 454 | /** Set source position and velocity. 455 | */ 456 | -void SoundSource::setSource(sgVec3 p, sgVec3 u) 457 | +void TorcsSoundSource::setSource(sgVec3 p, sgVec3 u) 458 | { 459 | for (int i=0; i<3; i++) { 460 | p_src[i] = p[i]; 461 | @@ -269,7 +269,7 @@ 462 | 463 | /** Set listener position and velocity. 464 | */ 465 | -void SoundSource::setListener (sgVec3 p, sgVec3 u) 466 | +void TorcsSoundSource::setListener (sgVec3 p, sgVec3 u) 467 | { 468 | for (int i=0; i<3; i++) { 469 | p_lis[i] = p[i]; 470 | @@ -330,7 +330,11 @@ 471 | ALenum format; 472 | ALboolean srcloop; 473 | 474 | +#ifdef __APPLE__ 475 | + alutLoadWAVFile((ALbyte *) filename, &format, &wave, &size, &freq); 476 | +#else 477 | alutLoadWAVFile((ALbyte *) filename, &format, &wave, &size, &freq, &srcloop); 478 | +#endif 479 | error = alGetError(); 480 | if (error != AL_NO_ERROR) { 481 | printf("OpenAL Error: %d, could not load %s\n", error, filename); 482 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/TorcsSound.h torcs-1.3.1-mac/src/modules/graphic/ssggraph/TorcsSound.h 483 | --- torcs-1.3.1/src/modules/graphic/ssggraph/TorcsSound.h 2005-11-18 01:20:32.000000000 +0100 484 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/TorcsSound.h 2010-06-16 00:23:09.000000000 +0200 485 | @@ -26,9 +26,15 @@ 486 | 487 | #include 488 | #include 489 | +#ifdef __APPLE__ 490 | +#include 491 | +#include 492 | +#include 493 | +#else 494 | #include 495 | #include 496 | #include 497 | +#endif 498 | #include "sound_defines.h" 499 | 500 | class SoundInterface; 501 | @@ -136,7 +142,7 @@ 502 | * principle possible to implement multiple listeners, something which 503 | * should be extremely useful for same-computer multiplayer games. 504 | */ 505 | -class SoundSource { 506 | +class TorcsSoundSource { 507 | public: 508 | sgVec3 p_lis; ///< listener position for this source 509 | sgVec3 u_lis; ///< listener velocity for this source 510 | @@ -145,7 +151,7 @@ 511 | float a; ///< Environmental attenuation 512 | float f; ///< Environmental frequency shift 513 | float lp; ///< Environmental filtering 514 | - SoundSource(); 515 | + TorcsSoundSource(); 516 | void update(); 517 | void setSource(sgVec3 p, sgVec3 u); 518 | void setListener (sgVec3 p, sgVec3 u); 519 | @@ -174,7 +180,7 @@ 520 | public: 521 | OpenalTorcsSound(const char* filename, 522 | OpenalSoundInterface* sitf, 523 | - int flags = (ACTIVE_VOLUME|ACTIVE_PITCH), 524 | + int flags = (ACTIVE_VOLUME|ACTIVE_PITCH), 525 | bool loop = false, bool static_pool = true); 526 | virtual ~OpenalTorcsSound(); 527 | virtual void setVolume(float vol); 528 | @@ -182,7 +188,7 @@ 529 | virtual void setLPFilter(float lp); 530 | virtual void setSource(sgVec3 p, sgVec3 u); 531 | virtual void getSource (sgVec3 p, sgVec3 u); 532 | - virtual void setReferenceDistance (float dist); 533 | + virtual void setReferenceDistance (float dist); 534 | //virtual void setListener (sgVec3 p, sgVec3 u); 535 | virtual void play(); 536 | virtual void start(); 537 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grcam.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grcam.cpp 538 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grcam.cpp 2007-11-06 21:43:31.000000000 +0100 539 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grcam.cpp 2010-06-16 00:23:09.000000000 +0200 540 | @@ -21,11 +21,16 @@ 541 | #include 542 | #include 543 | #include 544 | +#ifdef __APPLE__ 545 | +#include 546 | +#include 547 | +#else 548 | #ifdef WIN32 549 | #include 550 | #endif 551 | #include 552 | #include 553 | +#endif 554 | #include 555 | 556 | #include 557 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grcar.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grcar.cpp 558 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grcar.cpp 2008-08-24 21:26:46.000000000 +0200 559 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grcar.cpp 2010-06-16 00:23:09.000000000 +0200 560 | @@ -26,7 +26,11 @@ 561 | #ifdef WIN32 562 | #include 563 | #endif 564 | -#include 565 | +#ifdef __APPLE__ 566 | + #include 567 | +#else 568 | + #include 569 | +#endif 570 | #include 571 | 572 | #include 573 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grcarlight.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grcarlight.cpp 574 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grcarlight.cpp 2008-08-29 01:24:54.000000000 +0200 575 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grcarlight.cpp 2010-06-16 00:23:09.000000000 +0200 576 | @@ -25,7 +25,11 @@ 577 | #ifdef WIN32 578 | #include 579 | #endif 580 | -#include 581 | +#ifdef __APPLE__ 582 | + #include 583 | +#else 584 | + #include 585 | +#endif 586 | #include 587 | 588 | #include 589 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grmain.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grmain.cpp 590 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grmain.cpp 2005-08-05 11:48:29.000000000 +0200 591 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grmain.cpp 2010-06-16 00:23:09.000000000 +0200 592 | @@ -23,7 +23,11 @@ 593 | #ifdef WIN32 594 | #include 595 | #endif 596 | -#include 597 | +#ifdef __APPLE__ 598 | + #include 599 | +#else 600 | + #include 601 | +#endif 602 | #include 603 | 604 | #include 605 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grscene.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grscene.cpp 606 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grscene.cpp 2006-02-20 21:16:09.000000000 +0100 607 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grscene.cpp 2010-06-16 00:23:09.000000000 +0200 608 | @@ -28,7 +28,11 @@ 609 | #include 610 | #include 611 | #endif 612 | -#include 613 | +#ifdef __APPLE__ 614 | + #include 615 | +#else 616 | + #include 617 | +#endif 618 | #include 619 | #include 620 | #include 621 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grskidmarks.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grskidmarks.cpp 622 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grskidmarks.cpp 2005-12-25 02:22:06.000000000 +0100 623 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grskidmarks.cpp 2010-06-16 00:23:09.000000000 +0200 624 | @@ -26,7 +26,11 @@ 625 | #ifdef WIN32 626 | #include 627 | #endif 628 | -#include 629 | +#ifdef __APPLE__ 630 | + #include 631 | +#else 632 | + #include 633 | +#endif 634 | #include 635 | 636 | #include 637 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grsmoke.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grsmoke.cpp 638 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grsmoke.cpp 2005-07-21 23:27:15.000000000 +0200 639 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grsmoke.cpp 2010-06-16 00:23:09.000000000 +0200 640 | @@ -24,7 +24,11 @@ 641 | #ifdef WIN32 642 | #include 643 | #endif 644 | -#include 645 | +#ifdef __APPLE__ 646 | + #include 647 | +#else 648 | + #include 649 | +#endif 650 | #include 651 | 652 | #include 653 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grtrackmap.h torcs-1.3.1-mac/src/modules/graphic/ssggraph/grtrackmap.h 654 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grtrackmap.h 2005-08-05 11:48:30.000000000 +0200 655 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grtrackmap.h 2010-06-16 00:23:09.000000000 +0200 656 | @@ -29,9 +29,15 @@ 657 | 658 | #include 659 | #include 660 | -#include 661 | -#include 662 | -#include 663 | +#ifdef __APPLE__ 664 | + #include 665 | + #include 666 | + #include 667 | +#else 668 | + #include 669 | + #include 670 | + #include 671 | +#endif 672 | 673 | #ifndef WIN32 674 | #include 675 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grutil.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grutil.cpp 676 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grutil.cpp 2008-11-09 18:50:22.000000000 +0100 677 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grutil.cpp 2010-06-16 00:23:09.000000000 +0200 678 | @@ -25,7 +25,11 @@ 679 | #ifdef WIN32 680 | #include 681 | #endif 682 | -#include 683 | +#ifdef __APPLE__ 684 | + #include 685 | +#else 686 | + #include 687 | +#endif 688 | #include 689 | 690 | #include 691 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/grvtxtable.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/grvtxtable.cpp 692 | --- torcs-1.3.1/src/modules/graphic/ssggraph/grvtxtable.cpp 2005-09-19 21:00:57.000000000 +0200 693 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/grvtxtable.cpp 2010-06-16 00:23:09.000000000 +0200 694 | @@ -31,7 +31,11 @@ 695 | #include "grscene.h" 696 | #include "grcar.h" 697 | #include "grutil.h" 698 | +#ifdef __APPLE__ 699 | +#include 700 | +#else 701 | #include 702 | +#endif 703 | 704 | /* from grloadac.cpp (beuark!) */ 705 | extern double shad_xmax; 706 | diff -ru torcs-1.3.1/src/modules/graphic/ssggraph/ssggraph.cpp torcs-1.3.1-mac/src/modules/graphic/ssggraph/ssggraph.cpp 707 | --- torcs-1.3.1/src/modules/graphic/ssggraph/ssggraph.cpp 2005-02-01 20:08:19.000000000 +0100 708 | +++ torcs-1.3.1-mac/src/modules/graphic/ssggraph/ssggraph.cpp 2010-06-16 00:23:09.000000000 +0200 709 | @@ -20,7 +20,11 @@ 710 | #ifdef WIN32 711 | #include 712 | #endif 713 | -#include 714 | +#ifdef __APPLE__ 715 | + #include 716 | +#else 717 | + #include 718 | +#endif 719 | 720 | #include 721 | 722 | diff -ru torcs-1.3.1/src/modules/simu/simuv2/SOLID-2.0/src/C-api.cpp torcs-1.3.1-mac/src/modules/simu/simuv2/SOLID-2.0/src/C-api.cpp 723 | --- torcs-1.3.1/src/modules/simu/simuv2/SOLID-2.0/src/C-api.cpp 2006-04-28 01:33:35.000000000 +0200 724 | +++ torcs-1.3.1-mac/src/modules/simu/simuv2/SOLID-2.0/src/C-api.cpp 2010-06-16 00:23:09.000000000 +0200 725 | @@ -23,10 +23,10 @@ 726 | Eindhoven University of Technology 727 | P.O. Box 513, 5600 MB Eindhoven, The Netherlands 728 | */ 729 | - 730 | -#ifdef _MSC_VER 731 | -#pragma warning(disable:4786) // identifier was truncated to '255' 732 | -#endif // _MSC_VER 733 | + 734 | +#ifdef _MSC_VER 735 | +#pragma warning(disable:4786) // identifier was truncated to '255' 736 | +#endif // _MSC_VER 737 | 738 | #include 739 | 740 | @@ -44,7 +44,7 @@ 741 | #include "Polyhedron.h" 742 | #include "Response.h" 743 | #include "RespTable.h" 744 | -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) 745 | +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) 746 | # include 747 | #endif 748 | 749 | diff -ru torcs-1.3.1/src/tools/texmapper/maintexmapper.cpp torcs-1.3.1-mac/src/tools/texmapper/maintexmapper.cpp 750 | --- torcs-1.3.1/src/tools/texmapper/maintexmapper.cpp 2008-11-09 18:50:23.000000000 +0100 751 | +++ torcs-1.3.1-mac/src/tools/texmapper/maintexmapper.cpp 2010-06-16 00:23:09.000000000 +0200 752 | @@ -28,7 +28,11 @@ 753 | #include 754 | #include 755 | #include 756 | -#include 757 | +#ifdef __APPLE__ 758 | + #include 759 | +#else 760 | + #include 761 | +#endif 762 | 763 | #include 764 | 765 | diff -ru torcs-1.3.1/src/tools/trackgen/maintrackgen.cpp torcs-1.3.1-mac/src/tools/trackgen/maintrackgen.cpp 766 | --- torcs-1.3.1/src/tools/trackgen/maintrackgen.cpp 2008-11-09 18:50:23.000000000 +0100 767 | +++ torcs-1.3.1-mac/src/tools/trackgen/maintrackgen.cpp 2010-06-16 00:23:09.000000000 +0200 768 | @@ -37,7 +37,11 @@ 769 | #include 770 | #include 771 | #include 772 | -#include 773 | +#ifdef __APPLE__ 774 | + #include 775 | +#else 776 | + #include 777 | +#endif 778 | 779 | #include 780 | #include 781 | diff -ru torcs-1.3.1/src/tools/trackgen/objects.cpp torcs-1.3.1-mac/src/tools/trackgen/objects.cpp 782 | --- torcs-1.3.1/src/tools/trackgen/objects.cpp 2008-11-09 18:50:23.000000000 +0100 783 | +++ torcs-1.3.1-mac/src/tools/trackgen/objects.cpp 2010-06-16 00:23:09.000000000 +0200 784 | @@ -32,7 +32,11 @@ 785 | #endif 786 | #include 787 | #include 788 | -#include 789 | +#ifdef __APPLE__ 790 | + #include 791 | +#else 792 | + #include 793 | +#endif 794 | 795 | #include 796 | #include 797 | diff -ru torcs-1.3.1/src/tools/trackgen/relief.cpp torcs-1.3.1-mac/src/tools/trackgen/relief.cpp 798 | --- torcs-1.3.1/src/tools/trackgen/relief.cpp 2008-11-09 18:50:23.000000000 +0100 799 | +++ torcs-1.3.1-mac/src/tools/trackgen/relief.cpp 2010-06-16 00:23:09.000000000 +0200 800 | @@ -33,7 +33,11 @@ 801 | #endif 802 | #include 803 | #include 804 | -#include 805 | +#ifdef __APPLE__ 806 | + #include 807 | +#else 808 | + #include 809 | +#endif 810 | 811 | #include 812 | #include 813 | --------------------------------------------------------------------------------