Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
195 KB
Referenced Files
None
Subscribers
None
This document is not UTF8. It was detected as JIS and converted to UTF8 for display.
diff --git a/OpenMortal.xcode/project.pbxproj b/OpenMortal.xcode/project.pbxproj
new file mode 100755
index 0000000..388270c
--- /dev/null
+++ b/OpenMortal.xcode/project.pbxproj
@@ -0,0 +1,1552 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 39;
+ objects = {
+ 080E96DDFE201D6D7F000001 = {
+ children = (
+ F5A47A9D01A0482F01D3D55B,
+ F5A47A9E01A0483001D3D55B,
+ );
+ isa = PBXGroup;
+ name = Classes;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 089C165CFE840E0CC02AAC07 = {
+ children = (
+ 089C165DFE840E0CC02AAC07,
+ );
+ isa = PBXVariantGroup;
+ name = InfoPlist.strings;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 089C165DFE840E0CC02AAC07 = {
+ fileEncoding = 10;
+ isa = PBXFileReference;
+ lastKnownFileType = text.plist.strings;
+ name = InfoPlist.strings;
+ path = osx/res/English.lproj/InfoPlist.strings;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 089C165EFE840E0CC02AAC07 = {
+ fileRef = 089C165CFE840E0CC02AAC07;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//080
+//081
+//082
+//083
+//084
+//100
+//101
+//102
+//103
+//104
+ 1058C7A0FEA54F0111CA2CBB = {
+ children = (
+ C2D9A71006467782001D72D9,
+ C2D9A71106467782001D72D9,
+ C2D9A71206467782001D72D9,
+ C2D9A71306467782001D72D9,
+ 1058C7A1FEA54F0111CA2CBB,
+ );
+ isa = PBXGroup;
+ name = "Linked Frameworks";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 1058C7A1FEA54F0111CA2CBB = {
+ fallbackIsa = PBXFileReference;
+ isa = PBXFrameworkReference;
+ lastKnownFileType = wrapper.framework;
+ name = Cocoa.framework;
+ path = /System/Library/Frameworks/Cocoa.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ 1058C7A2FEA54F0111CA2CBB = {
+ children = (
+ 29B97325FDCFA39411CA2CEA,
+ 29B97324FDCFA39411CA2CEA,
+ );
+ isa = PBXGroup;
+ name = "Other Frameworks";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 1058C7A3FEA54F0111CA2CBB = {
+ fileRef = 1058C7A1FEA54F0111CA2CBB;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//100
+//101
+//102
+//103
+//104
+//170
+//171
+//172
+//173
+//174
+ 17587328FF379C6511CA2CBB = {
+ explicitFileType = wrapper.application;
+ fallbackIsa = PBXFileReference;
+ isa = PBXApplicationReference;
+ path = OpenMortal.app;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+//170
+//171
+//172
+//173
+//174
+//190
+//191
+//192
+//193
+//194
+ 19C28FACFE9D520D11CA2CBB = {
+ children = (
+ 17587328FF379C6511CA2CBB,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+//190
+//191
+//192
+//193
+//194
+//290
+//291
+//292
+//293
+//294
+ 29B97313FDCFA39411CA2CEA = {
+ buildSettings = {
+ };
+ buildStyles = (
+ 4A9504CCFFE6A4B311CA0CBA,
+ 4A9504CDFFE6A4B311CA0CBA,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ mainGroup = 29B97314FDCFA39411CA2CEA;
+ projectDirPath = "";
+ targets = (
+ 29B97326FDCFA39411CA2CEA,
+ );
+ };
+ 29B97314FDCFA39411CA2CEA = {
+ children = (
+ C2257B7D061E987C001FE296,
+ 080E96DDFE201D6D7F000001,
+ 29B97315FDCFA39411CA2CEA,
+ 29B97317FDCFA39411CA2CEA,
+ 29B97323FDCFA39411CA2CEA,
+ 19C28FACFE9D520D11CA2CBB,
+ );
+ isa = PBXGroup;
+ name = OpenMortal;
+ path = "";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA = {
+ children = (
+ C2257D33061EA0F4001FE296,
+ C2257D34061EA0F4001FE296,
+ C2258142061EA646001FE296,
+ );
+ isa = PBXGroup;
+ name = "Mac Specific Sources";
+ path = "";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA = {
+ children = (
+ C21273500642C3C500BCB7BC,
+ 089C165CFE840E0CC02AAC07,
+ );
+ isa = PBXGroup;
+ name = Resources;
+ path = "";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA = {
+ children = (
+ 1058C7A0FEA54F0111CA2CBB,
+ 1058C7A2FEA54F0111CA2CBB,
+ );
+ isa = PBXGroup;
+ name = Frameworks;
+ path = "";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 29B97324FDCFA39411CA2CEA = {
+ fallbackIsa = PBXFileReference;
+ isa = PBXFrameworkReference;
+ lastKnownFileType = wrapper.framework;
+ name = AppKit.framework;
+ path = /System/Library/Frameworks/AppKit.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ 29B97325FDCFA39411CA2CEA = {
+ fallbackIsa = PBXFileReference;
+ isa = PBXFrameworkReference;
+ lastKnownFileType = wrapper.framework;
+ name = Foundation.framework;
+ path = /System/Library/Frameworks/Foundation.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ 29B97326FDCFA39411CA2CEA = {
+ buildPhases = (
+ C2B1A4CF0630257F005C3AFA,
+ 29B97327FDCFA39411CA2CEA,
+ 29B97328FDCFA39411CA2CEA,
+ 29B9732BFDCFA39411CA2CEA,
+ 29B9732DFDCFA39411CA2CEA,
+ );
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "\"$(HOME)/Library/Frameworks\" /Volumes/Adat/Workspace/_ports_/OpenMortal/Frameworks";
+ HEADER_SEARCH_PATHS = "\"$(HOME)/Library/Frameworks/SDL.framework/Headers\"";
+ INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = /Volumes/Adat/Workspace/_ports_/OpenMortal/sdl;
+ PREFIX_HEADER = mac_common.pch;
+ PRODUCT_NAME = OpenMortal;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = app;
+ };
+ dependencies = (
+ );
+ isa = PBXApplicationTarget;
+ name = OpenMortal;
+ productInstallPath = "$(HOME)/Applications";
+ productName = OpenMortal;
+ productReference = 17587328FF379C6511CA2CBB;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>OpenMortal</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Mortテ。l Szombat 0.7</string>
+ <key>CFBundleIconFile</key>
+ <string>OpenMortalEU.icns</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Mortテ。l Szombat</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>Mortテ。l Szombat 0.7</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.7</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
+";
+ };
+ 29B97327FDCFA39411CA2CEA = {
+ buildActionMask = 2147483647;
+ files = (
+ F5A47AA101A0483001D3D55B,
+ C2258143061EA646001FE296,
+ C2FF3919061EC43100C5C3CC,
+ C2E7AE4D064231BB0005F2F4,
+ C2E7AE4F064231BB0005F2F4,
+ C2E7AE50064231BB0005F2F4,
+ C2E7AE51064231BB0005F2F4,
+ C2E7AE56064231BB0005F2F4,
+ C2E7AE57064231BB0005F2F4,
+ C2E7AE5A064231BB0005F2F4,
+ C2E7AE5C064231BB0005F2F4,
+ C2E7AE5E064231BB0005F2F4,
+ C2E7AE60064231BB0005F2F4,
+ C2E7AE62064231BB0005F2F4,
+ C2E7AE64064231BB0005F2F4,
+ C2E7AE65064231BB0005F2F4,
+ C2E7AE66064231BB0005F2F4,
+ C2E7AE67064231BB0005F2F4,
+ C2E7AE68064231BB0005F2F4,
+ C2E7AE6D064231BB0005F2F4,
+ C2E7AE6E064231BB0005F2F4,
+ C2E7AE6F064231BB0005F2F4,
+ C2E7AE71064231BB0005F2F4,
+ C2E7AE72064231BB0005F2F4,
+ C2E7AE74064231BB0005F2F4,
+ C2E7AE75064231BB0005F2F4,
+ C2E7AE77064231BB0005F2F4,
+ C2E7AE79064231BB0005F2F4,
+ C2E7AE7A064231BB0005F2F4,
+ C2E7AE7B064231BB0005F2F4,
+ C2E7AE7C064231BB0005F2F4,
+ C2E7AE7D064231BB0005F2F4,
+ C2E7AE80064231BB0005F2F4,
+ C2E7AE82064231BB0005F2F4,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 29B97328FDCFA39411CA2CEA = {
+ buildActionMask = 2147483647;
+ files = (
+ C21273640642C3F000BCB7BC,
+ 089C165EFE840E0CC02AAC07,
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 29B9732BFDCFA39411CA2CEA = {
+ buildActionMask = 2147483647;
+ files = (
+ F5A47AA301A0483001D3D55B,
+ C2FF3914061EC43000C5C3CC,
+ C2E7AE4C064231BB0005F2F4,
+ C2E7AE4E064231BB0005F2F4,
+ C2E7AE52064231BB0005F2F4,
+ C2E7AE53064231BB0005F2F4,
+ C2E7AE54064231BB0005F2F4,
+ C2E7AE55064231BB0005F2F4,
+ C2E7AE58064231BB0005F2F4,
+ C2E7AE59064231BB0005F2F4,
+ C2E7AE5B064231BB0005F2F4,
+ C2E7AE5D064231BB0005F2F4,
+ C2E7AE5F064231BB0005F2F4,
+ C2E7AE61064231BB0005F2F4,
+ C2E7AE63064231BB0005F2F4,
+ C2E7AE69064231BB0005F2F4,
+ C2E7AE6A064231BB0005F2F4,
+ C2E7AE6B064231BB0005F2F4,
+ C2E7AE6C064231BB0005F2F4,
+ C2E7AE70064231BB0005F2F4,
+ C2E7AE73064231BB0005F2F4,
+ C2E7AE76064231BB0005F2F4,
+ C2E7AE78064231BB0005F2F4,
+ C2E7AE7E064231BB0005F2F4,
+ C2E7AE7F064231BB0005F2F4,
+ C2E7AE81064231BB0005F2F4,
+ C2E7AE83064231BB0005F2F4,
+ C2E7AE84064231BB0005F2F4,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 29B9732DFDCFA39411CA2CEA = {
+ buildActionMask = 2147483647;
+ files = (
+ 1058C7A3FEA54F0111CA2CBB,
+ C2D9A71406467782001D72D9,
+ C2D9A71506467782001D72D9,
+ C2D9A71606467782001D72D9,
+ C2D9A71706467782001D72D9,
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+//290
+//291
+//292
+//293
+//294
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+ 4A9504CCFFE6A4B311CA0CBA = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = NO;
+ GCC_PREFIX_HEADER = mac_common.pch;
+ HEADER_SEARCH_PATHS = "/Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_net.framework/Headers /Library/Frameworks/SDL_image.framework/Headers /Library/Frameworks/SDL_mixer.framework/Headers /System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/ /usr/local/include/freetype2";
+ LIBRARY_SEARCH_PATHS = "/usr/local/lib /System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/";
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-lperl -lz /usr/local/lib/libfreetype.a";
+ ZERO_LINK = NO;
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ 4A9504CDFFE6A4B311CA0CBA = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_PREFIX_HEADER = mac_common.pch;
+ HEADER_SEARCH_PATHS = "osx/src /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_net.framework/Headers /Library/Frameworks/SDL_image.framework/Headers /Library/Frameworks/SDL_mixer.framework/Headers /System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/ /usr/local/include/freetype2";
+ LIBRARY_SEARCH_PATHS = "/usr/local/lib /System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/";
+ OTHER_LDFLAGS = "-lperl -lz /usr/local/lib/libfreetype.a";
+ ZERO_LINK = NO;
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+//C20
+//C21
+//C22
+//C23
+//C24
+ C21273500642C3C500BCB7BC = {
+ isa = PBXFileReference;
+ lastKnownFileType = image.icns;
+ name = OpenMortalEU.icns;
+ path = osx/res/OpenMortalEU.icns;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C21273510642C3C500BCB7BC = {
+ fileRef = C21273500642C3C500BCB7BC;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C21273640642C3F000BCB7BC = {
+ fileRef = C21273500642C3C500BCB7BC;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2257B7D061E987C001FE296 = {
+ children = (
+ C2E7AE13064231BB0005F2F4,
+ C2E7AE14064231BB0005F2F4,
+ C2E7AE15064231BB0005F2F4,
+ C2E7AE16064231BB0005F2F4,
+ C2E7AE17064231BB0005F2F4,
+ C2E7AE18064231BB0005F2F4,
+ C2E7AE19064231BB0005F2F4,
+ C2E7AE1A064231BB0005F2F4,
+ C2E7AE1B064231BB0005F2F4,
+ C2E7AE1C064231BB0005F2F4,
+ C2E7AE1D064231BB0005F2F4,
+ C2E7AE1E064231BB0005F2F4,
+ C2E7AE1F064231BB0005F2F4,
+ C2E7AE20064231BB0005F2F4,
+ C2E7AE21064231BB0005F2F4,
+ C2E7AE22064231BB0005F2F4,
+ C2E7AE23064231BB0005F2F4,
+ C2E7AE24064231BB0005F2F4,
+ C2E7AE25064231BB0005F2F4,
+ C2E7AE26064231BB0005F2F4,
+ C2E7AE27064231BB0005F2F4,
+ C2E7AE28064231BB0005F2F4,
+ C2E7AE29064231BB0005F2F4,
+ C2E7AE2A064231BB0005F2F4,
+ C2E7AE2B064231BB0005F2F4,
+ C2E7AE2C064231BB0005F2F4,
+ C2E7AE2D064231BB0005F2F4,
+ C2E7AE2E064231BB0005F2F4,
+ C2E7AE2F064231BB0005F2F4,
+ C2E7AE30064231BB0005F2F4,
+ C2E7AE31064231BB0005F2F4,
+ C2E7AE32064231BB0005F2F4,
+ C2E7AE33064231BB0005F2F4,
+ C2E7AE34064231BB0005F2F4,
+ C2E7AE35064231BB0005F2F4,
+ C2E7AE36064231BB0005F2F4,
+ C2E7AE37064231BB0005F2F4,
+ C2E7AE38064231BB0005F2F4,
+ C2E7AE39064231BB0005F2F4,
+ C2E7AE3A064231BB0005F2F4,
+ C2E7AE3B064231BB0005F2F4,
+ C2E7AE3C064231BB0005F2F4,
+ C2E7AE3D064231BB0005F2F4,
+ C2E7AE3E064231BB0005F2F4,
+ C2E7AE3F064231BB0005F2F4,
+ C2E7AE40064231BB0005F2F4,
+ C2E7AE41064231BB0005F2F4,
+ C2E7AE42064231BB0005F2F4,
+ C2E7AE43064231BB0005F2F4,
+ C2E7AE44064231BB0005F2F4,
+ C2E7AE45064231BB0005F2F4,
+ C2E7AE46064231BB0005F2F4,
+ C2E7AE47064231BB0005F2F4,
+ C2E7AE48064231BB0005F2F4,
+ C2E7AE49064231BB0005F2F4,
+ C2E7AE4A064231BB0005F2F4,
+ C2E7AE4B064231BB0005F2F4,
+ );
+ isa = PBXGroup;
+ name = Sources;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2257D33061EA0F4001FE296 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = mac_datadir.h;
+ path = osx/src/mac_datadir.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2257D34061EA0F4001FE296 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = mac_datadir.c;
+ path = osx/src/mac_datadir.c;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2258142061EA646001FE296 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = mac_common.pch;
+ path = osx/src/mac_common.pch;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2258143061EA646001FE296 = {
+ fileRef = C2258142061EA646001FE296;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2B1A4CF0630257F005C3AFA = {
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ C2D9A74306467787001D72D9,
+ C2D9A74406467787001D72D9,
+ C2D9A74506467787001D72D9,
+ C2D9A74606467787001D72D9,
+ C21273510642C3C500BCB7BC,
+ );
+ isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C2D9A71006467782001D72D9 = {
+ isa = PBXFileReference;
+ lastKnownFileType = wrapper.framework;
+ name = SDL_image.framework;
+ path = /Library/Frameworks/SDL_image.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2D9A71106467782001D72D9 = {
+ isa = PBXFileReference;
+ lastKnownFileType = wrapper.framework;
+ name = SDL_mixer.framework;
+ path = /Library/Frameworks/SDL_mixer.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2D9A71206467782001D72D9 = {
+ isa = PBXFileReference;
+ lastKnownFileType = wrapper.framework;
+ name = SDL_net.framework;
+ path = /Library/Frameworks/SDL_net.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2D9A71306467782001D72D9 = {
+ isa = PBXFileReference;
+ lastKnownFileType = wrapper.framework;
+ name = SDL.framework;
+ path = /Library/Frameworks/SDL.framework;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2D9A71406467782001D72D9 = {
+ fileRef = C2D9A71006467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A71506467782001D72D9 = {
+ fileRef = C2D9A71106467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A71606467782001D72D9 = {
+ fileRef = C2D9A71206467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A71706467782001D72D9 = {
+ fileRef = C2D9A71306467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A74306467787001D72D9 = {
+ fileRef = C2D9A71006467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A74406467787001D72D9 = {
+ fileRef = C2D9A71106467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A74506467787001D72D9 = {
+ fileRef = C2D9A71206467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2D9A74606467787001D72D9 = {
+ fileRef = C2D9A71306467782001D72D9;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE13064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = GameOver.cpp;
+ path = src/GameOver.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE14064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = sge_surface.h;
+ path = src/sge_surface.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE15064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = sge_surface.cpp;
+ path = src/sge_surface.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE16064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Game.h;
+ path = src/Game.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE17064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = gfx.h;
+ path = src/gfx.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE18064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = sge_primitives.h;
+ path = src/sge_primitives.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE19064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = sge_primitives.cpp;
+ path = src/sge_primitives.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE1A064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = main.cpp;
+ path = src/main.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE1B064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = gfx.cpp;
+ path = src/gfx.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE1C064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = PlayerSelect.cpp;
+ path = src/PlayerSelect.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE1D064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = MortalNetworkImpl.h;
+ path = src/MortalNetworkImpl.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE1E064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = PlayerSelectView.h;
+ path = src/PlayerSelectView.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE1F064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = PlayerSelectView.cpp;
+ path = src/PlayerSelectView.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE20064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = common.cpp;
+ path = src/common.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE21064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = MortalNetwork.h;
+ path = src/MortalNetwork.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE22064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Game.cpp;
+ path = src/Game.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE23064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = sge_bm_text.h;
+ path = src/sge_bm_text.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE24064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = sge_bm_text.cpp;
+ path = src/sge_bm_text.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE25064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = TextArea.h;
+ path = src/TextArea.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE26064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = TextArea.cpp;
+ path = src/TextArea.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE27064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = State.h;
+ path = src/State.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE28064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = State.cpp;
+ path = src/State.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE29064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = sge_tt_text.h;
+ path = src/sge_tt_text.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE2A064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = sge_tt_text.cpp;
+ path = src/sge_tt_text.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE2B064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = MszPerl.h;
+ path = src/MszPerl.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE2C064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Joystick.h;
+ path = src/Joystick.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE2D064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = sge_internal.h;
+ path = src/sge_internal.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE2E064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = sge_config.h;
+ path = src/sge_config.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE2F064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = RlePack.h;
+ path = src/RlePack.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE30064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = RlePack.cpp;
+ path = src/RlePack.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE31064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = MortalNetworkImpl.cpp;
+ path = src/MortalNetworkImpl.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE32064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Joystick.cpp;
+ path = src/Joystick.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE33064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = menu.cpp;
+ path = src/menu.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE34064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = PlayerSelect.h;
+ path = src/PlayerSelect.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE35064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = OnlineChat.h;
+ path = src/OnlineChat.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE36064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Event.h;
+ path = src/Event.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE37064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = FighterStats.cpp;
+ path = src/FighterStats.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE38064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = DrawRle.h;
+ path = src/DrawRle.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE39064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = menu.h;
+ path = src/menu.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE3A064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Backend.cpp;
+ path = src/Backend.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE3B064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Background.h;
+ path = src/Background.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE3C064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = PlayerSelectController.h;
+ path = src/PlayerSelectController.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE3D064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = PlayerSelectController.cpp;
+ path = src/PlayerSelectController.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE3E064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = FighterEnum.h;
+ path = src/FighterEnum.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE3F064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = FlyingChars.cpp;
+ path = src/FlyingChars.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE40064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = common.h;
+ path = src/common.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE41064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = FlyingChars.h;
+ path = src/FlyingChars.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE42064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Demo.h;
+ path = src/Demo.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE43064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Backend.h;
+ path = src/Backend.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE44064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Audio.h;
+ path = src/Audio.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE45064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = OnlineChat.cpp;
+ path = src/OnlineChat.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE46064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Demo.cpp;
+ path = src/Demo.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE47064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = FighterStats.h;
+ path = src/FighterStats.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE48064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Chooser.cpp;
+ path = src/Chooser.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE49064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = Chooser.h;
+ path = src/Chooser.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE4A064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Background.cpp;
+ path = src/Background.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE4B064231BB0005F2F4 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = Audio.cpp;
+ path = src/Audio.cpp;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ C2E7AE4C064231BB0005F2F4 = {
+ fileRef = C2E7AE13064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE4D064231BB0005F2F4 = {
+ fileRef = C2E7AE14064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE4E064231BB0005F2F4 = {
+ fileRef = C2E7AE15064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE4F064231BB0005F2F4 = {
+ fileRef = C2E7AE16064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE50064231BB0005F2F4 = {
+ fileRef = C2E7AE17064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE51064231BB0005F2F4 = {
+ fileRef = C2E7AE18064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE52064231BB0005F2F4 = {
+ fileRef = C2E7AE19064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE53064231BB0005F2F4 = {
+ fileRef = C2E7AE1A064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE54064231BB0005F2F4 = {
+ fileRef = C2E7AE1B064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE55064231BB0005F2F4 = {
+ fileRef = C2E7AE1C064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE56064231BB0005F2F4 = {
+ fileRef = C2E7AE1D064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE57064231BB0005F2F4 = {
+ fileRef = C2E7AE1E064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE58064231BB0005F2F4 = {
+ fileRef = C2E7AE1F064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE59064231BB0005F2F4 = {
+ fileRef = C2E7AE20064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE5A064231BB0005F2F4 = {
+ fileRef = C2E7AE21064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE5B064231BB0005F2F4 = {
+ fileRef = C2E7AE22064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE5C064231BB0005F2F4 = {
+ fileRef = C2E7AE23064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE5D064231BB0005F2F4 = {
+ fileRef = C2E7AE24064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE5E064231BB0005F2F4 = {
+ fileRef = C2E7AE25064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE5F064231BB0005F2F4 = {
+ fileRef = C2E7AE26064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE60064231BB0005F2F4 = {
+ fileRef = C2E7AE27064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE61064231BB0005F2F4 = {
+ fileRef = C2E7AE28064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE62064231BB0005F2F4 = {
+ fileRef = C2E7AE29064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE63064231BB0005F2F4 = {
+ fileRef = C2E7AE2A064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE64064231BB0005F2F4 = {
+ fileRef = C2E7AE2B064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE65064231BB0005F2F4 = {
+ fileRef = C2E7AE2C064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE66064231BB0005F2F4 = {
+ fileRef = C2E7AE2D064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE67064231BB0005F2F4 = {
+ fileRef = C2E7AE2E064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE68064231BB0005F2F4 = {
+ fileRef = C2E7AE2F064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE69064231BB0005F2F4 = {
+ fileRef = C2E7AE30064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE6A064231BB0005F2F4 = {
+ fileRef = C2E7AE31064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE6B064231BB0005F2F4 = {
+ fileRef = C2E7AE32064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE6C064231BB0005F2F4 = {
+ fileRef = C2E7AE33064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE6D064231BB0005F2F4 = {
+ fileRef = C2E7AE34064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE6E064231BB0005F2F4 = {
+ fileRef = C2E7AE35064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE6F064231BB0005F2F4 = {
+ fileRef = C2E7AE36064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE70064231BB0005F2F4 = {
+ fileRef = C2E7AE37064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE71064231BB0005F2F4 = {
+ fileRef = C2E7AE38064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE72064231BB0005F2F4 = {
+ fileRef = C2E7AE39064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE73064231BB0005F2F4 = {
+ fileRef = C2E7AE3A064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE74064231BB0005F2F4 = {
+ fileRef = C2E7AE3B064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE75064231BB0005F2F4 = {
+ fileRef = C2E7AE3C064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE76064231BB0005F2F4 = {
+ fileRef = C2E7AE3D064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE77064231BB0005F2F4 = {
+ fileRef = C2E7AE3E064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE78064231BB0005F2F4 = {
+ fileRef = C2E7AE3F064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE79064231BB0005F2F4 = {
+ fileRef = C2E7AE40064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE7A064231BB0005F2F4 = {
+ fileRef = C2E7AE41064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE7B064231BB0005F2F4 = {
+ fileRef = C2E7AE42064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE7C064231BB0005F2F4 = {
+ fileRef = C2E7AE43064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE7D064231BB0005F2F4 = {
+ fileRef = C2E7AE44064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE7E064231BB0005F2F4 = {
+ fileRef = C2E7AE45064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE7F064231BB0005F2F4 = {
+ fileRef = C2E7AE46064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE80064231BB0005F2F4 = {
+ fileRef = C2E7AE47064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE81064231BB0005F2F4 = {
+ fileRef = C2E7AE48064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE82064231BB0005F2F4 = {
+ fileRef = C2E7AE49064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE83064231BB0005F2F4 = {
+ fileRef = C2E7AE4A064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2E7AE84064231BB0005F2F4 = {
+ fileRef = C2E7AE4B064231BB0005F2F4;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2FF3914061EC43000C5C3CC = {
+ fileRef = C2257D34061EA0F4001FE296;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C2FF3919061EC43100C5C3CC = {
+ fileRef = C2257D33061EA0F4001FE296;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//C20
+//C21
+//C22
+//C23
+//C24
+//F50
+//F51
+//F52
+//F53
+//F54
+ F5A47A9D01A0482F01D3D55B = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = SDLMain.h;
+ path = osx/src/SDLMain.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ F5A47A9E01A0483001D3D55B = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.objc;
+ name = SDLMain.m;
+ path = osx/src/SDLMain.m;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ F5A47AA101A0483001D3D55B = {
+ fileRef = F5A47A9D01A0482F01D3D55B;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5A47AA301A0483001D3D55B = {
+ fileRef = F5A47A9E01A0483001D3D55B;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA;
+}
diff --git a/OpenMortal.xcode/segabor.pbxuser b/OpenMortal.xcode/segabor.pbxuser
new file mode 100644
index 0000000..e1d2527
--- /dev/null
+++ b/OpenMortal.xcode/segabor.pbxuser
@@ -0,0 +1,1368 @@
+// !$*UTF8*$!
+{
+ 089C165DFE840E0CC02AAC07 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {652, 347}}";
+ sepNavSelRange = "{176, 0}";
+ sepNavVisRect = "{{0, 0}, {652, 347}}";
+ };
+ };
+ 29B97313FDCFA39411CA2CEA = {
+ activeBuildStyle = 4A9504CDFFE6A4B311CA0CBA;
+ activeExecutable = C2257AFD061E8F7C001FE296;
+ activeTarget = 29B97326FDCFA39411CA2CEA;
+ addToTargets = (
+ 29B97326FDCFA39411CA2CEA,
+ );
+ breakpoints = (
+ C212731F0642B77E00BCB7BC,
+ C21273260642B85D00BCB7BC,
+ );
+ codeSenseManager = C2257B09061E8F90001FE296;
+ executables = (
+ C2257AFD061E8F7C001FE296,
+ );
+ perUserDictionary = {
+ PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 418.8799,
+ 231.2085,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXErrorsWarningsDataSource_TypeID,
+ PBXErrorsWarningsDataSource_MessageID,
+ PBXErrorsWarningsDataSource_LocationID,
+ );
+ };
+ PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 22,
+ 681.7974,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXExecutablesDataSource_ActiveFlagID,
+ PBXExecutablesDataSource_NameID,
+ );
+ };
+ PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 429,
+ 20,
+ 79,
+ 43,
+ 43,
+ 20,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ PBXFileDataSource_Target_ColumnID,
+ );
+ };
+ PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 366,
+ 81,
+ 20,
+ 81,
+ 43,
+ 43,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXTargetDataSource_PrimaryAttribute,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ );
+ };
+ PBXPerProjectTemplateStateSaveDate = 105283414;
+ PBXPrepackagedSmartGroups_v2 = (
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ activationKey = OldTargetSmartGroup;
+ clz = PBXTargetSmartGroup;
+ description = "Displays all targets of the project.";
+ globalID = 1C37FABC04509CD000000102;
+ name = Targets;
+ preferences = {
+ image = Targets;
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXTargetSmartGroup2;
+ description = "Displays all targets of the project as well as nested build phases.";
+ globalID = 1C37FBAC04509CD000000102;
+ name = Targets;
+ preferences = {
+ image = Targets;
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXExecutablesSmartGroup;
+ description = "Displays all executables of the project.";
+ globalID = 1C37FAAC04509CD000000102;
+ name = Executables;
+ preferences = {
+ image = Executable;
+ };
+ },
+ {
+ " PBXTransientLocationAtTop " = bottom;
+ absolutePathToBundle = "";
+ clz = PBXErrorsWarningsSmartGroup;
+ description = "Displays files with errors or warnings.";
+ globalID = 1C08E77C0454961000C914BD;
+ name = "Errors and Warnings";
+ preferences = {
+ fnmatch = "";
+ image = WarningsErrors;
+ recursive = 1;
+ regex = "";
+ root = "<PROJECT>";
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXFilenameSmartGroup;
+ description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+ globalID = 1CC0EA4004350EF90044410B;
+ name = "Implementation Files";
+ preferences = {
+ canSave = 1;
+ fnmatch = "";
+ image = SmartFolder;
+ isLeaf = 0;
+ recursive = 1;
+ regex = "?*\\.[mcMC]";
+ root = "<PROJECT>";
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXFilenameSmartGroup;
+ description = "This group displays Interface Builder NIB Files.";
+ globalID = 1CC0EA4004350EF90041110B;
+ name = "NIB Files";
+ preferences = {
+ canSave = 1;
+ fnmatch = "*.nib";
+ image = SmartFolder;
+ isLeaf = 0;
+ recursive = 1;
+ regex = "";
+ root = "<PROJECT>";
+ };
+ },
+ {
+ PBXTransientLocationAtTop = no;
+ absolutePathToBundle = "";
+ clz = PBXFindSmartGroup;
+ description = "Displays Find Results.";
+ globalID = 1C37FABC05509CD000000102;
+ name = "Find Results";
+ preferences = {
+ image = spyglass;
+ };
+ },
+ {
+ PBXTransientLocationAtTop = no;
+ absolutePathToBundle = "";
+ clz = PBXBookmarksSmartGroup;
+ description = "Displays Project Bookmarks.";
+ globalID = 1C37FABC05539CD112110102;
+ name = Bookmarks;
+ preferences = {
+ image = Bookmarks;
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = XCSCMSmartGroup;
+ description = "Displays files with interesting SCM status.";
+ globalID = E2644B35053B69B200211256;
+ name = SCM;
+ preferences = {
+ image = PBXRepository;
+ isLeaf = 0;
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXSymbolsSmartGroup;
+ description = "Displays all symbols for the project.";
+ globalID = 1C37FABC04509CD000100104;
+ name = "Project Symbols";
+ preferences = {
+ image = ProjectSymbols;
+ isLeaf = 1;
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXFilenameSmartGroup;
+ description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+ globalID = PBXTemplateMarker;
+ name = "Simple Filter SmartGroup";
+ preferences = {
+ canSave = 1;
+ fnmatch = "*.nib";
+ image = SmartFolder;
+ isLeaf = 0;
+ recursive = 1;
+ regex = "";
+ root = "<PROJECT>";
+ };
+ },
+ {
+ PBXTransientLocationAtTop = bottom;
+ absolutePathToBundle = "";
+ clz = PBXFilenameSmartGroup;
+ description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+ globalID = PBXTemplateMarker;
+ name = "Simple Regular Expression SmartGroup";
+ preferences = {
+ canSave = 1;
+ fnmatch = "";
+ image = SmartFolder;
+ isLeaf = 0;
+ recursive = 1;
+ regex = "?*\\.[mcMC]";
+ root = "<PROJECT>";
+ };
+ },
+ );
+ PBXWorkspaceContents = (
+ {
+ PBXProjectWorkspaceModule_StateKey_Rev39 = {
+ PBXProjectWorkspaceModule_DEGV_Geometry = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ isCollapsed = yes;
+ sizes = (
+ "{{0, 0}, {697, 184}}",
+ "{{0, 184}, {697, 373}}",
+ );
+ };
+ PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
+ BoundsStr = "{{0, 0}, {682, 1080}}";
+ Rows = (
+ 0,
+ );
+ VisibleRectStr = "{{0, 0}, {682, 167}}";
+ };
+ PBXProjectWorkspaceModule_EditorOpen = true;
+ PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
+ PBXSplitModuleInNavigatorKey = {
+ Split0 = {
+ bookmark = C21EFD7706467F96007C6FA1;
+ history = (
+ C2258145061EA646001FE296,
+ C2FF409B061F06C400C5C3CC,
+ C2FF409F061F08EC00C5C3CC,
+ C2C57947061F302900F36BAE,
+ C21272EA0642B20F00BCB7BC,
+ C21272FE0642B2ED00BCB7BC,
+ C21273100642B50800BCB7BC,
+ C21273300642BA1400BCB7BC,
+ C21273830642C57E00BCB7BC,
+ C2D9A76A06467A2B001D72D9,
+ C2D9A76F06467A76001D72D9,
+ C2D9A77306467AE0001D72D9,
+ C2D9A77706467B22001D72D9,
+ C2D9A77F06467C3F001D72D9,
+ C2D9A7A006467DCF001D72D9,
+ C2D9A7A506467E63001D72D9,
+ C2D9A7B106467E73001D72D9,
+ C2D9A7C006467E87001D72D9,
+ C2D9A7D206467EBE001D72D9,
+ C2D9A7DA06467ECB001D72D9,
+ C2D9A7E106467EDA001D72D9,
+ C2D9A7E506467EDF001D72D9,
+ C2D9A7E806467F08001D72D9,
+ );
+ prevStack = (
+ C225812F061EA587001FE296,
+ C2FF408E061F056B00C5C3CC,
+ C2FF40A0061F08EC00C5C3CC,
+ C2C57948061F302900F36BAE,
+ C2E7AEFB064235A00005F2F4,
+ C2E7AF02064236EC0005F2F4,
+ C2E7AF0F0642385B0005F2F4,
+ C21272DF0642B10400BCB7BC,
+ C21272E50642B1D000BCB7BC,
+ C21272EC0642B20F00BCB7BC,
+ C21273120642B50800BCB7BC,
+ C21273560642C3DB00BCB7BC,
+ C2D9A75D0646786C001D72D9,
+ C2D9A76C06467A2B001D72D9,
+ C2D9A77006467A76001D72D9,
+ C2D9A79306467C88001D72D9,
+ C2D9A7AD06467E6C001D72D9,
+ C2D9A7B306467E73001D72D9,
+ C2D9A7C206467E87001D72D9,
+ C2D9A7C806467E91001D72D9,
+ C2D9A7D306467EBE001D72D9,
+ C2D9A7E606467EDF001D72D9,
+ );
+ };
+ SplitCount = 1;
+ };
+ };
+ PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+ PBXProjectWorkspaceModule_SGTM_Geometry = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ sizes = (
+ "{{0, 0}, {212, 557}}",
+ "{{212, 0}, {697, 557}}",
+ );
+ };
+ };
+ PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {697, 184}}";
+ PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 184}, {697, 373}}";
+ PBXProjectWorkspaceModule_OldSuperviewFrame = "{{212, 0}, {697, 557}}";
+ PBXProjectWorkspaceModule_SGTM = {
+ PBXBottomSmartGroupGIDs = (
+ 1C37FBAC04509CD000000102,
+ 1C37FAAC04509CD000000102,
+ 1C08E77C0454961000C914BD,
+ 1CC0EA4004350EF90044410B,
+ 1CC0EA4004350EF90041110B,
+ 1C37FABC05509CD000000102,
+ 1C37FABC05539CD112110102,
+ E2644B35053B69B200211256,
+ 1C37FABC04509CD000100104,
+ );
+ PBXSmartGroupTreeModuleColumnData = {
+ PBXSmartGroupTreeModuleColumnWidthsKey = (
+ 195,
+ );
+ PBXSmartGroupTreeModuleColumnsKey_v4 = (
+ MainColumn,
+ );
+ };
+ PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
+ PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
+ 29B97314FDCFA39411CA2CEA,
+ 080E96DDFE201D6D7F000001,
+ 29B97315FDCFA39411CA2CEA,
+ 29B97317FDCFA39411CA2CEA,
+ 29B97323FDCFA39411CA2CEA,
+ 1058C7A2FEA54F0111CA2CBB,
+ 1C37FBAC04509CD000000102,
+ 1C37FAAC04509CD000000102,
+ );
+ PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
+ (
+ 0,
+ ),
+ );
+ PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 0}, {195, 539}}";
+ };
+ PBXTopSmartGroupGIDs = (
+ );
+ };
+ };
+ },
+ );
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXCVSModule" = {
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
+ Debugger = {
+ HorizontalSplitView = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ isCollapsed = yes;
+ sizes = (
+ "{{0, 0}, {257, 186}}",
+ "{{257, 0}, {609, 186}}",
+ );
+ };
+ VerticalSplitView = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ isCollapsed = yes;
+ sizes = (
+ "{{0, 0}, {866, 186}}",
+ "{{0, 186}, {866, 253}}",
+ );
+ };
+ };
+ LauncherConfigVersion = 8;
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
+ PBXSplitModuleInNavigatorKey = {
+ SplitCount = 1;
+ };
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXProjectFindModule" = {
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
+ PBXProjectWorkspaceModule_StateKey_Rev39 = {
+ PBXProjectWorkspaceModule_DEGV_Geometry = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ isCollapsed = yes;
+ sizes = (
+ "{{0, 0}, {697, 178}}",
+ "{{0, 178}, {697, 379}}",
+ );
+ };
+ PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
+ BoundsStr = "{{0, 0}, {682, 161}}";
+ Rows = (
+ 0,
+ );
+ VisibleRectStr = "{{0, 0}, {682, 161}}";
+ };
+ PBXProjectWorkspaceModule_EditorOpen = true;
+ PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
+ PBXSplitModuleInNavigatorKey = {
+ Split0 = {
+ bookmark = C2D9A762064679A8001D72D9;
+ history = (
+ C2258145061EA646001FE296,
+ C2FF409B061F06C400C5C3CC,
+ C2FF409F061F08EC00C5C3CC,
+ C2C57947061F302900F36BAE,
+ C2E7AEF9064235A00005F2F4,
+ C21272EA0642B20F00BCB7BC,
+ C21272FE0642B2ED00BCB7BC,
+ C21273100642B50800BCB7BC,
+ C21273300642BA1400BCB7BC,
+ C21273350642BAE900BCB7BC,
+ C212733C0642BD1B00BCB7BC,
+ C21273450642C38700BCB7BC,
+ C21273830642C57E00BCB7BC,
+ C2D9A75B0646786C001D72D9,
+ C2D9A75C0646786C001D72D9,
+ );
+ prevStack = (
+ C225812F061EA587001FE296,
+ C2FF408E061F056B00C5C3CC,
+ C2FF40A0061F08EC00C5C3CC,
+ C2C57948061F302900F36BAE,
+ C2E7AEFB064235A00005F2F4,
+ C2E7AF02064236EC0005F2F4,
+ C2E7AF0F0642385B0005F2F4,
+ C21272DF0642B10400BCB7BC,
+ C21272E50642B1D000BCB7BC,
+ C21272EC0642B20F00BCB7BC,
+ C21273120642B50800BCB7BC,
+ C21273560642C3DB00BCB7BC,
+ C2D9A75D0646786C001D72D9,
+ );
+ };
+ SplitCount = 1;
+ };
+ };
+ PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+ PBXProjectWorkspaceModule_SGTM_Geometry = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ sizes = (
+ "{{0, 0}, {212, 557}}",
+ "{{212, 0}, {697, 557}}",
+ );
+ };
+ };
+ PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {697, 178}}";
+ PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 178}, {697, 379}}";
+ PBXProjectWorkspaceModule_OldSuperviewFrame = "{{212, 0}, {697, 557}}";
+ PBXProjectWorkspaceModule_SGTM = {
+ PBXBottomSmartGroupGIDs = (
+ 1C37FBAC04509CD000000102,
+ 1C37FAAC04509CD000000102,
+ 1C08E77C0454961000C914BD,
+ 1CC0EA4004350EF90044410B,
+ 1CC0EA4004350EF90041110B,
+ 1C37FABC05509CD000000102,
+ 1C37FABC05539CD112110102,
+ E2644B35053B69B200211256,
+ 1C37FABC04509CD000100104,
+ );
+ PBXSmartGroupTreeModuleColumnData = {
+ PBXSmartGroupTreeModuleColumnWidthsKey = (
+ 195,
+ );
+ PBXSmartGroupTreeModuleColumnsKey_v4 = (
+ MainColumn,
+ );
+ };
+ PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
+ PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
+ 29B97314FDCFA39411CA2CEA,
+ C2257B7D061E987C001FE296,
+ 29B97317FDCFA39411CA2CEA,
+ 29B97323FDCFA39411CA2CEA,
+ 1058C7A2FEA54F0111CA2CBB,
+ 1C37FBAC04509CD000000102,
+ C2D9A70E0646774D001D72D9,
+ C2D9A70F06467751001D72D9,
+ 1C37FAAC04509CD000000102,
+ 1C08E77C0454961000C914BD,
+ );
+ PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
+ (
+ 53,
+ 1,
+ 0,
+ ),
+ );
+ PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 788}, {195, 539}}";
+ };
+ PBXTopSmartGroupGIDs = (
+ );
+ };
+ };
+ };
+ "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXRunSessionModule" = {
+ LauncherConfigVersion = 3;
+ Runner = {
+ HorizontalSplitView = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ isCollapsed = yes;
+ sizes = (
+ "{{0, 0}, {366, 167}}",
+ "{{0, 176}, {366, 267}}",
+ );
+ };
+ VerticalSplitView = {
+ _collapsingFrameDimension = 0;
+ _indexOfCollapsedView = 0;
+ _percentageOfCollapsedView = 0;
+ isCollapsed = yes;
+ sizes = (
+ "{{0, 0}, {405, 443}}",
+ "{{414, 0}, {514, 443}}",
+ );
+ };
+ };
+ };
+ PBXWorkspaceGeometries = (
+ {
+ Frame = "{{0, 0}, {909, 557}}";
+ PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+ };
+ RubberWindowFrame = "79 98 909 599 0 0 1024 746 ";
+ },
+ );
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
+ Frame = "{{0, 0}, {663, 396}}";
+ PBXModuleWindowStatusBarHidden = YES;
+ RubberWindowFrame = "210 119 663 417 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXCVSModule" = {
+ Frame = "{{0, 0}, {482, 276}}";
+ RubberWindowFrame = "264 68 482 318 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
+ Frame = "{{0, 0}, {400, 201}}";
+ PBXModuleWindowStatusBarHidden = YES;
+ RubberWindowFrame = "50 718 400 222 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
+ DebugConsoleDrawerSize = "{820, 140}";
+ DebugConsoleVisible = Drawer;
+ DebugConsoleWindowFrame = "{{200, 200}, {500, 300}}";
+ DebugSTDIOWindowFrame = "{{200, 200}, {500, 300}}";
+ Frame = "{{0, 0}, {866, 439}}";
+ RubberWindowFrame = "61 265 866 481 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
+ Frame = "{{0, 0}, {750, 481}}";
+ PBXModuleWindowStatusBarHidden = YES;
+ RubberWindowFrame = "157 113 750 502 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXProjectFindModule" = {
+ Frame = "{{0, 0}, {645, 416}}";
+ RubberWindowFrame = "231 285 645 458 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
+ Frame = "{{0, 0}, {909, 557}}";
+ PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+ PBXProjectWorkspaceModule_SCMWindowVisible = true;
+ };
+ RubberWindowFrame = "79 98 909 599 0 0 1024 746 ";
+ };
+ "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXRunSessionModule" = {
+ Frame = "{{0, 0}, {745, 443}}";
+ PBXModuleWindowStatusBarHidden = YES;
+ RubberWindowFrame = "28 180 745 464 0 0 1024 746 ";
+ };
+ PBXWorkspaceStateSaveDate = 105283414;
+ };
+ perUserProjectItems = {
+ C21272DF0642B10400BCB7BC = C21272DF0642B10400BCB7BC;
+ C21272E50642B1D000BCB7BC = C21272E50642B1D000BCB7BC;
+ C21272EA0642B20F00BCB7BC = C21272EA0642B20F00BCB7BC;
+ C21272EC0642B20F00BCB7BC = C21272EC0642B20F00BCB7BC;
+ C21272FE0642B2ED00BCB7BC = C21272FE0642B2ED00BCB7BC;
+ C21273100642B50800BCB7BC = C21273100642B50800BCB7BC;
+ C21273120642B50800BCB7BC = C21273120642B50800BCB7BC;
+ C21273300642BA1400BCB7BC = C21273300642BA1400BCB7BC;
+ C21273560642C3DB00BCB7BC = C21273560642C3DB00BCB7BC;
+ C21273830642C57E00BCB7BC = C21273830642C57E00BCB7BC;
+ C21EFD7706467F96007C6FA1 = C21EFD7706467F96007C6FA1;
+ C225812F061EA587001FE296 = C225812F061EA587001FE296;
+ C2258145061EA646001FE296 = C2258145061EA646001FE296;
+ C2C57947061F302900F36BAE = C2C57947061F302900F36BAE;
+ C2C57948061F302900F36BAE = C2C57948061F302900F36BAE;
+ C2D9A75D0646786C001D72D9 = C2D9A75D0646786C001D72D9;
+ C2D9A76A06467A2B001D72D9 = C2D9A76A06467A2B001D72D9;
+ C2D9A76C06467A2B001D72D9 = C2D9A76C06467A2B001D72D9;
+ C2D9A76F06467A76001D72D9 = C2D9A76F06467A76001D72D9;
+ C2D9A77006467A76001D72D9 = C2D9A77006467A76001D72D9;
+ C2D9A77306467AE0001D72D9 = C2D9A77306467AE0001D72D9;
+ C2D9A77706467B22001D72D9 = C2D9A77706467B22001D72D9;
+ C2D9A77F06467C3F001D72D9 = C2D9A77F06467C3F001D72D9;
+ C2D9A79306467C88001D72D9 = C2D9A79306467C88001D72D9;
+ C2D9A7A006467DCF001D72D9 = C2D9A7A006467DCF001D72D9;
+ C2D9A7A506467E63001D72D9 = C2D9A7A506467E63001D72D9;
+ C2D9A7AD06467E6C001D72D9 = C2D9A7AD06467E6C001D72D9;
+ C2D9A7B106467E73001D72D9 = C2D9A7B106467E73001D72D9;
+ C2D9A7B306467E73001D72D9 = C2D9A7B306467E73001D72D9;
+ C2D9A7C006467E87001D72D9 = C2D9A7C006467E87001D72D9;
+ C2D9A7C206467E87001D72D9 = C2D9A7C206467E87001D72D9;
+ C2D9A7C806467E91001D72D9 = C2D9A7C806467E91001D72D9;
+ C2D9A7D206467EBE001D72D9 = C2D9A7D206467EBE001D72D9;
+ C2D9A7D306467EBE001D72D9 = C2D9A7D306467EBE001D72D9;
+ C2D9A7DA06467ECB001D72D9 = C2D9A7DA06467ECB001D72D9;
+ C2D9A7E106467EDA001D72D9 = C2D9A7E106467EDA001D72D9;
+ C2D9A7E506467EDF001D72D9 = C2D9A7E506467EDF001D72D9;
+ C2D9A7E606467EDF001D72D9 = C2D9A7E606467EDF001D72D9;
+ C2D9A7E806467F08001D72D9 = C2D9A7E806467F08001D72D9;
+ C2E7AEFB064235A00005F2F4 = C2E7AEFB064235A00005F2F4;
+ C2E7AF02064236EC0005F2F4 = C2E7AF02064236EC0005F2F4;
+ C2E7AF0F0642385B0005F2F4 = C2E7AF0F0642385B0005F2F4;
+ C2FF408E061F056B00C5C3CC = C2FF408E061F056B00C5C3CC;
+ C2FF409B061F06C400C5C3CC = C2FF409B061F06C400C5C3CC;
+ C2FF409F061F08EC00C5C3CC = C2FF409F061F08EC00C5C3CC;
+ C2FF40A0061F08EC00C5C3CC = C2FF40A0061F08EC00C5C3CC;
+ };
+ sourceControlManager = C2257B08061E8F90001FE296;
+ userBuildSettings = {
+ };
+ };
+ 29B97326FDCFA39411CA2CEA = {
+ activeExec = 0;
+ executables = (
+ C2257AFD061E8F7C001FE296,
+ );
+ };
+ C21272DF0642B10400BCB7BC = {
+ fRef = C2E7AE3A064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = FighterStats;
+ rLen = 12;
+ rLoc = 5519;
+ rType = 0;
+ vrLen = 811;
+ vrLoc = 5310;
+ };
+ C21272E50642B1D000BCB7BC = {
+ fRef = C2E7AE48064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = FighterStats;
+ rLen = 12;
+ rLoc = 1869;
+ rType = 0;
+ vrLen = 465;
+ vrLoc = 2300;
+ };
+ C21272EA0642B20F00BCB7BC = {
+ fRef = C2E7AE22064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = Reset;
+ rLen = 5;
+ rLoc = 2110;
+ rType = 0;
+ vrLen = 415;
+ vrLoc = 1870;
+ };
+ C21272EC0642B20F00BCB7BC = {
+ fRef = C2E7AE22064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = Reset;
+ rLen = 5;
+ rLoc = 2110;
+ rType = 0;
+ vrLen = 415;
+ vrLoc = 1870;
+ };
+ C21272FE0642B2ED00BCB7BC = {
+ fRef = C2E7AE3E064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "FighterEnum.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 288;
+ vrLoc = 464;
+ };
+ C21273100642B50800BCB7BC = {
+ fRef = C2E7AE1C064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = characters;
+ rLen = 10;
+ rLoc = 3457;
+ rType = 0;
+ vrLen = 661;
+ vrLoc = 3042;
+ };
+ C21273120642B50800BCB7BC = {
+ fRef = C2E7AE1C064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = characters;
+ rLen = 10;
+ rLoc = 3457;
+ rType = 0;
+ vrLen = 661;
+ vrLoc = 3042;
+ };
+ C212731F0642B77E00BCB7BC = {
+ fileReference = C2E7AE48064231BB0005F2F4;
+ functionName = "CChooser::Init()";
+ isa = PBXFileBreakpoint;
+ lineNumber = 48;
+ state = 1;
+ };
+ C21273260642B85D00BCB7BC = {
+ fileReference = C2E7AE48064231BB0005F2F4;
+ functionName = "CChooser::Init()";
+ isa = PBXFileBreakpoint;
+ lineNumber = 61;
+ state = 1;
+ };
+ C21273300642BA1400BCB7BC = {
+ fRef = C2E7AE48064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = m_iNumberOfFighters;
+ rLen = 19;
+ rLoc = 1166;
+ rType = 0;
+ vrLen = 507;
+ vrLoc = 910;
+ };
+ C21273500642C3C500BCB7BC = {
+ uiCtxt = {
+ sepNavWindowFrame = "{{157, 57}, {750, 558}}";
+ };
+ };
+ C21273560642C3DB00BCB7BC = {
+ isa = PBXTargetBookmark;
+ trg = 29B97326FDCFA39411CA2CEA;
+ };
+ C21273830642C57E00BCB7BC = {
+ isa = PBXTargetBookmark;
+ trg = 29B97326FDCFA39411CA2CEA;
+ };
+ C21EFD7706467F96007C6FA1 = {
+ fRef = C2257D33061EA0F4001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_datadir.h: 12";
+ rLen = 0;
+ rLoc = 209;
+ rType = 0;
+ vrLen = 273;
+ vrLoc = 0;
+ };
+ C2257AFD061E8F7C001FE296 = {
+ activeArgIndex = 0;
+ activeArgIndices = (
+ YES,
+ );
+ argumentStrings = (
+ "-debug",
+ );
+ configStateDict = {
+ };
+ debuggerPlugin = GDBDebugging;
+ dylibVariantSuffix = "";
+ enableDebugStr = 1;
+ environmentEntries = (
+ );
+ isa = PBXExecutable;
+ name = OpenMortal;
+ shlibInfoDictList = (
+ );
+ sourceDirectories = (
+ );
+ };
+ C2257B08061E8F90001FE296 = {
+ isa = PBXSourceControlManager;
+ scmConfiguration = {
+ };
+ scmType = scm.cvs;
+ };
+ C2257B09061E8F90001FE296 = {
+ indexTemplatePath = "";
+ isa = PBXCodeSenseManager;
+ usesDefaults = 1;
+ wantsCodeCompletion = 1;
+ wantsCodeCompletionAutoPopup = 0;
+ wantsCodeCompletionAutoSuggestions = 0;
+ wantsCodeCompletionCaseSensitivity = 1;
+ wantsCodeCompletionOnlyMatchingItems = 1;
+ wantsCodeCompletionParametersIncluded = 1;
+ wantsCodeCompletionPlaceholdersInserted = 1;
+ wantsCodeCompletionTabCompletes = 1;
+ wantsIndex = 1;
+ };
+ C2257B8A061E989A001FE296 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = common.h;
+ path = "/Volumes/Adat/Workspace/_ports_/openmortal-0.6/src/common.h";
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2257B9A061E989A001FE296 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = main.cpp;
+ path = "/Volumes/Adat/Workspace/_ports_/openmortal-0.6/src/main.cpp";
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2257BA5061E989A001FE296 = {
+ fileEncoding = 15;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ name = RlePack.cpp;
+ path = "/Volumes/Adat/Workspace/_ports_/openmortal-0.6/src/RlePack.cpp";
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ C2257D33061EA0F4001FE296 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {652, 341}}";
+ sepNavSelRange = "{209, 0}";
+ sepNavVisRect = "{{0, 0}, {652, 341}}";
+ sepNavWindowFrame = "{{233, 28}, {750, 558}}";
+ };
+ };
+ C2257D34061EA0F4001FE296 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {652, 882}}";
+ sepNavSelRange = "{121, 0}";
+ sepNavVisRect = "{{0, 42}, {652, 347}}";
+ };
+ };
+ C225812F061EA587001FE296 = {
+ fRef = C2257B8A061E989A001FE296;
+ isa = PBXTextBookmark;
+ name = "common.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 771;
+ vrLoc = 0;
+ };
+ C2258142061EA646001FE296 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {652, 363}}";
+ sepNavSelRange = "{363, 0}";
+ sepNavVisRect = "{{0, 9}, {652, 347}}";
+ sepNavWindowFrame = "{{88, 120}, {750, 558}}";
+ };
+ };
+ C2258145061EA646001FE296 = {
+ fRef = C2257B8A061E989A001FE296;
+ isa = PBXTextBookmark;
+ name = "common.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 771;
+ vrLoc = 0;
+ };
+ C2C57947061F302900F36BAE = {
+ exec = C2257AFD061E8F7C001FE296;
+ isa = PBXExecutableBookmark;
+ };
+ C2C57948061F302900F36BAE = {
+ exec = C2257AFD061E8F7C001FE296;
+ isa = PBXExecutableBookmark;
+ };
+ C2D9A75D0646786C001D72D9 = {
+ fRef = C2E7AE13064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "GameOver.cpp: 15";
+ rLen = 0;
+ rLoc = 551;
+ rType = 0;
+ vrLen = 640;
+ vrLoc = 0;
+ };
+ C2D9A76A06467A2B001D72D9 = {
+ fRef = C2E7AE46064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "Demo.cpp: 415";
+ rLen = 0;
+ rLoc = 7826;
+ rType = 0;
+ vrLen = 319;
+ vrLoc = 8039;
+ };
+ C2D9A76C06467A2B001D72D9 = {
+ fRef = C2E7AE46064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "Demo.cpp: 415";
+ rLen = 0;
+ rLoc = 7826;
+ rType = 0;
+ vrLen = 319;
+ vrLoc = 8039;
+ };
+ C2D9A76F06467A76001D72D9 = {
+ fRef = C2E7AE1B064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "gfx.cpp: 14";
+ rLen = 0;
+ rLoc = 512;
+ rType = 0;
+ vrLen = 644;
+ vrLoc = 0;
+ };
+ C2D9A77006467A76001D72D9 = {
+ fRef = C2E7AE1B064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "gfx.cpp: 14";
+ rLen = 0;
+ rLoc = 512;
+ rType = 0;
+ vrLen = 644;
+ vrLoc = 0;
+ };
+ C2D9A77306467AE0001D72D9 = {
+ fRef = C2E7AE1A064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "main.cpp: 272";
+ rLen = 0;
+ rLoc = 7748;
+ rType = 0;
+ vrLen = 585;
+ vrLoc = 7647;
+ };
+ C2D9A77706467B22001D72D9 = {
+ fRef = C2E7AE2A064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "sge_tt_text.cpp: 33";
+ rLen = 0;
+ rLoc = 866;
+ rType = 0;
+ vrLen = 586;
+ vrLoc = 456;
+ };
+ C2D9A77F06467C3F001D72D9 = {
+ fRef = C2E7AE28064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "State.cpp: 148";
+ rLen = 0;
+ rLoc = 3130;
+ rType = 0;
+ vrLen = 730;
+ vrLoc = 0;
+ };
+ C2D9A79306467C88001D72D9 = {
+ fRef = C2258142061EA646001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_common.pch: 22";
+ rLen = 0;
+ rLoc = 363;
+ rType = 0;
+ vrLen = 419;
+ vrLoc = 3;
+ };
+ C2D9A7A006467DCF001D72D9 = {
+ fRef = C2E7AE13064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "GameOver.cpp: 15";
+ rLen = 0;
+ rLoc = 551;
+ rType = 0;
+ vrLen = 640;
+ vrLoc = 0;
+ };
+ C2D9A7A506467E63001D72D9 = {
+ fRef = C2E7AE3A064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "Backend.cpp: 250";
+ rLen = 0;
+ rLoc = 5171;
+ rType = 0;
+ vrLen = 605;
+ vrLoc = 4803;
+ };
+ C2D9A7AD06467E6C001D72D9 = {
+ fRef = C2257D33061EA0F4001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_datadir.h: 12";
+ rLen = 0;
+ rLoc = 209;
+ rType = 0;
+ vrLen = 273;
+ vrLoc = 0;
+ };
+ C2D9A7B106467E73001D72D9 = {
+ fRef = C21273500642C3C500BCB7BC;
+ isa = PBXBookmark;
+ };
+ C2D9A7B306467E73001D72D9 = {
+ fRef = C21273500642C3C500BCB7BC;
+ isa = PBXBookmark;
+ };
+ C2D9A7C006467E87001D72D9 = {
+ fRef = 089C165DFE840E0CC02AAC07;
+ isa = PBXTextBookmark;
+ name = "InfoPlist.strings: 5";
+ rLen = 0;
+ rLoc = 176;
+ rType = 0;
+ vrLen = 264;
+ vrLoc = 0;
+ };
+ C2D9A7C206467E87001D72D9 = {
+ fRef = 089C165DFE840E0CC02AAC07;
+ isa = PBXTextBookmark;
+ name = "InfoPlist.strings: 5";
+ rLen = 0;
+ rLoc = 176;
+ rType = 0;
+ vrLen = 264;
+ vrLoc = 0;
+ };
+ C2D9A7C806467E91001D72D9 = {
+ fRef = F5A47A9D01A0482F01D3D55B;
+ isa = PBXTextBookmark;
+ name = "SDLMain.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 307;
+ vrLoc = 0;
+ };
+ C2D9A7D206467EBE001D72D9 = {
+ fRef = F5A47A9E01A0483001D3D55B;
+ isa = PBXTextBookmark;
+ name = "SDLMain.m: 164";
+ rLen = 0;
+ rLoc = 4679;
+ rType = 0;
+ vrLen = 592;
+ vrLoc = 7170;
+ };
+ C2D9A7D306467EBE001D72D9 = {
+ fRef = F5A47A9E01A0483001D3D55B;
+ isa = PBXTextBookmark;
+ name = "SDLMain.m: 164";
+ rLen = 0;
+ rLoc = 4679;
+ rType = 0;
+ vrLen = 592;
+ vrLoc = 7170;
+ };
+ C2D9A7DA06467ECB001D72D9 = {
+ fRef = C2258142061EA646001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_common.pch: 22";
+ rLen = 0;
+ rLoc = 363;
+ rType = 0;
+ vrLen = 422;
+ vrLoc = 0;
+ };
+ C2D9A7E106467EDA001D72D9 = {
+ fRef = F5A47A9D01A0482F01D3D55B;
+ isa = PBXTextBookmark;
+ name = "SDLMain.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 307;
+ vrLoc = 0;
+ };
+ C2D9A7E506467EDF001D72D9 = {
+ fRef = C2257D34061EA0F4001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_datadir.c: 6";
+ rLen = 0;
+ rLoc = 121;
+ rType = 0;
+ vrLen = 655;
+ vrLoc = 36;
+ };
+ C2D9A7E606467EDF001D72D9 = {
+ fRef = C2257D34061EA0F4001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_datadir.c: 6";
+ rLen = 0;
+ rLoc = 121;
+ rType = 0;
+ vrLen = 655;
+ vrLoc = 36;
+ };
+ C2D9A7E806467F08001D72D9 = {
+ fRef = C2257D33061EA0F4001FE296;
+ isa = PBXTextBookmark;
+ name = "mac_datadir.h: 12";
+ rLen = 0;
+ rLoc = 209;
+ rType = 0;
+ vrLen = 273;
+ vrLoc = 0;
+ };
+ C2E7AE13064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {652, 3065}}";
+ sepNavSelRange = "{551, 0}";
+ sepNavVisRect = "{{0, 0}, {652, 347}}";
+ };
+ };
+ C2E7AE14064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1046, 1385}}";
+ sepNavSelRange = "{123, 0}";
+ sepNavVisRect = "{{0, 0}, {682, 359}}";
+ };
+ };
+ C2E7AE1A064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {866, 9015}}";
+ sepNavSelRange = "{7748, 0}";
+ sepNavVisRect = "{{0, 3655}, {652, 347}}";
+ sepNavWindowFrame = "{{134, 78}, {750, 558}}";
+ };
+ };
+ C2E7AE1B064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {740, 6565}}";
+ sepNavSelRange = "{512, 0}";
+ sepNavVisRect = "{{0, 0}, {652, 347}}";
+ };
+ };
+ C2E7AE1C064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {890, 10765}}";
+ sepNavSelRange = "{3457, 10}";
+ sepNavVisRect = "{{0, 2057}, {682, 353}}";
+ sepNavWindowFrame = "{{65, 141}, {750, 558}}";
+ };
+ };
+ C2E7AE1F064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {872, 8231}}";
+ sepNavSelRange = "{10861, 0}";
+ sepNavVisRect = "{{0, 5930}, {821, 221}}";
+ };
+ };
+ C2E7AE20064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {682, 2491}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 2058}, {682, 359}}";
+ };
+ };
+ C2E7AE22064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {896, 17737}}";
+ sepNavSelRange = "{2110, 5}";
+ sepNavVisRect = "{{0, 1217}, {682, 353}}";
+ sepNavWindowFrame = "{{19, 183}, {750, 558}}";
+ };
+ };
+ C2E7AE24064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {806, 7797}}";
+ sepNavSelRange = "{948, 0}";
+ sepNavVisRect = "{{0, 214}, {682, 359}}";
+ };
+ };
+ C2E7AE27064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {682, 1049}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 420}, {682, 359}}";
+ };
+ };
+ C2E7AE28064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {836, 5207}}";
+ sepNavSelRange = "{3130, 0}";
+ sepNavVisRect = "{{0, 0}, {652, 347}}";
+ };
+ };
+ C2E7AE2A064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1154, 24947}}";
+ sepNavSelRange = "{866, 0}";
+ sepNavVisRect = "{{0, 227}, {652, 347}}";
+ };
+ };
+ C2E7AE3A064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {662, 7209}}";
+ sepNavSelRange = "{5171, 0}";
+ sepNavVisRect = "{{0, 3276}, {652, 347}}";
+ };
+ };
+ C2E7AE3E064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {682, 881}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 200}, {682, 353}}";
+ };
+ };
+ C2E7AE46064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {872, 6943}}";
+ sepNavSelRange = "{7826, 0}";
+ sepNavVisRect = "{{0, 5929}, {652, 347}}";
+ };
+ };
+ C2E7AE48064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {705, 6061}}";
+ sepNavSelRange = "{1166, 19}";
+ sepNavVisRect = "{{0, 633}, {705, 428}}";
+ sepNavWindowFrame = "{{88, 120}, {750, 558}}";
+ };
+ };
+ C2E7AE49064231BB0005F2F4 = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {705, 1035}}";
+ sepNavSelRange = "{1620, 11}";
+ sepNavVisRect = "{{0, 586}, {705, 449}}";
+ sepNavWindowFrame = "{{111, 99}, {750, 558}}";
+ };
+ };
+ C2E7AEFB064235A00005F2F4 = {
+ fRef = C2E7AE2A064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "sge_tt_text.cpp: 33";
+ rLen = 0;
+ rLoc = 900;
+ rType = 0;
+ vrLen = 608;
+ vrLoc = 456;
+ };
+ C2E7AF02064236EC0005F2F4 = {
+ fRef = C2E7AE28064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "State.cpp: 163";
+ rLen = 0;
+ rLoc = 4292;
+ rType = 0;
+ vrLen = 690;
+ vrLoc = 3021;
+ };
+ C2E7AF0F0642385B0005F2F4 = {
+ fRef = C2E7AE1A064231BB0005F2F4;
+ isa = PBXTextBookmark;
+ name = "\tg_oBackend.PerlEvalF( \"$CppRetval = GetNumberOfFighterFiles('%s')\", DATADIR \"/characters\" );\n\n";
+ rLen = 164;
+ rLoc = 8173;
+ rType = 0;
+ vrLen = 670;
+ vrLoc = 7497;
+ };
+ C2FF408E061F056B00C5C3CC = {
+ fRef = C2257BA5061E989A001FE296;
+ isa = PBXTextBookmark;
+ name = "#if SDL_BYTEORDER == SDL_LIL_ENDIAN\n";
+ rLen = 36;
+ rLoc = 661;
+ rType = 0;
+ vrLen = 620;
+ vrLoc = 496;
+ };
+ C2FF409B061F06C400C5C3CC = {
+ fRef = C2257BA5061E989A001FE296;
+ isa = PBXTextBookmark;
+ name = "RlePack.cpp: 792";
+ rLen = 0;
+ rLoc = 16509;
+ rType = 0;
+ vrLen = 633;
+ vrLoc = 11827;
+ };
+ C2FF409F061F08EC00C5C3CC = {
+ fRef = C2257B9A061E989A001FE296;
+ isa = PBXTextBookmark;
+ name = "main.cpp: bDebug";
+ rLen = 0;
+ rLoc = 1286;
+ rType = 0;
+ vrLen = 816;
+ vrLoc = 1031;
+ };
+ C2FF40A0061F08EC00C5C3CC = {
+ fRef = C2257B9A061E989A001FE296;
+ isa = PBXTextBookmark;
+ name = "main.cpp: bDebug";
+ rLen = 0;
+ rLoc = 1286;
+ rType = 0;
+ vrLen = 816;
+ vrLoc = 1031;
+ };
+ F5A47A9D01A0482F01D3D55B = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {652, 347}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {652, 347}}";
+ sepNavWindowFrame = "{{65, 141}, {750, 558}}";
+ };
+ };
+ F5A47A9E01A0483001D3D55B = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {734, 3975}}";
+ sepNavSelRange = "{4679, 0}";
+ sepNavVisRect = "{{0, 3628}, {652, 347}}";
+ sepNavWindowFrame = "{{19, 183}, {750, 558}}";
+ };
+ };
+}
diff --git a/osx/res/English.lproj/InfoPlist.strings b/osx/res/English.lproj/InfoPlist.strings
new file mode 100755
index 0000000..15a51c3
Binary files /dev/null and b/osx/res/English.lproj/InfoPlist.strings differ
diff --git a/osx/res/OpenMortal.icns b/osx/res/OpenMortal.icns
new file mode 100644
index 0000000..4f3abfa
Binary files /dev/null and b/osx/res/OpenMortal.icns differ
diff --git a/osx/res/OpenMortalEU.icns b/osx/res/OpenMortalEU.icns
new file mode 100644
index 0000000..78196e0
Binary files /dev/null and b/osx/res/OpenMortalEU.icns differ
diff --git a/osx/src/SDLMain.h b/osx/src/SDLMain.h
new file mode 100755
index 0000000..4683df5
--- /dev/null
+++ b/osx/src/SDLMain.h
@@ -0,0 +1,11 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
diff --git a/osx/src/SDLMain.m b/osx/src/SDLMain.m
new file mode 100755
index 0000000..bbd5395
--- /dev/null
+++ b/osx/src/SDLMain.m
@@ -0,0 +1,283 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#import "SDL.h"
+#import "SDLMain.h"
+#import <sys/param.h> /* for MAXPATHLEN */
+#import <unistd.h>
+
+//my
+#include "mac_datadir.h"
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#else
+/* An internal Apple class used to setup Apple menus */
+@interface NSAppleMenuController:NSObject {}
+- (void)controlMenu:(NSMenu *)aMenu;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ char parentdir[MAXPATHLEN];
+ char *c;
+
+ strncpy ( parentdir, gArgv[0], sizeof(parentdir) );
+ c = (char*) parentdir;
+
+ while (*c != '\0') /* go to end */
+ c++;
+
+ while (*c != '/') /* back up to parent */
+ c--;
+
+ *c++ = '\0'; /* cut off last part (binary name) */
+
+ if (shouldChdir)
+ {
+ assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
+ assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+void setupAppleMenu(void)
+{
+ /* warning: this code is very odd */
+ NSAppleMenuController *appleMenuController;
+ NSMenu *appleMenu;
+ NSMenuItem *appleMenuItem;
+
+ appleMenuController = [[NSAppleMenuController alloc] init];
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+ appleMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+
+ [appleMenuItem setSubmenu:appleMenu];
+
+ /* yes, we do need to add it and then remove it --
+ if you don't add it, it doesn't get displayed
+ if you don't remove it, you have an extra, titleless item in the menubar
+ when you remove it, it appears to stick around
+ very, very odd */
+ [[NSApp mainMenu] addItem:appleMenuItem];
+ [appleMenuController controlMenu:appleMenu];
+ [[NSApp mainMenu] removeItem:appleMenuItem];
+ [appleMenu release];
+ [appleMenuItem release];
+}
+
+/* Create a window menu */
+void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+void CustomApplicationMain (argc, argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setupAppleMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:[[NSProcessInfo processInfo] processName]];
+#endif
+ //[segabor]
+ initMacDataDir();
+
+ /* Hand off to main application code */
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+
+ /* Copy the arguments into a global variable */
+ int i;
+
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ gArgc = argc;
+ gFinderLaunch = NO;
+ }
+ gArgv = (char**) malloc (sizeof(*gArgv) * (gArgc+1));
+ assert (gArgv != NULL);
+ for (i = 0; i < gArgc; i++)
+ gArgv[i] = argv[i];
+ gArgv[i] = NULL;
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
diff --git a/osx/src/mac_common.pch b/osx/src/mac_common.pch
new file mode 100644
index 0000000..edd2bd2
--- /dev/null
+++ b/osx/src/mac_common.pch
@@ -0,0 +1,25 @@
+/*
+ * mac_common.h
+ * OpenMortal
+ *
+ * Created by Sebesty?n G?bor on Sat Apr 03 2004.
+ * Copyright (c) 2004 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+//#include <Carbon/Carbon.h>
+
+#ifndef _MAC_COMMON_H_
+#define _MAC_COMMON_H_
+
+//[segabor] My identity
+#define MACOSX
+
+//#include "mac_datadir.h"
+extern char mac_datadir[255];
+
+#define DATADIR mac_datadir
+#define VERSION "0.7"
+#define PACKAGE "openmortal"
+
+#endif
diff --git a/osx/src/mac_datadir.c b/osx/src/mac_datadir.c
new file mode 100644
index 0000000..08d77db
--- /dev/null
+++ b/osx/src/mac_datadir.c
@@ -0,0 +1,64 @@
+/*
+ * mac_datadir.c
+ * OpenMortal
+ *
+ * Created by Sebesty?n G?bor on Sat Apr 03 2004.
+ * Copyright (c) 2004 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+//#include "mac_datadir.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+const char *data_path_sys = "/Library/Application Support/OpenMortal/data";
+
+char mac_datadir[255];
+
+void getResourcePath() {
+ CFURLRef resUrl, dataUrl;
+ CFBundleRef mainBundle = CFBundleGetMainBundle();
+
+ // get resources path
+ resUrl = CFBundleCopyResourcesDirectoryURL (mainBundle);
+ dataUrl = CFURLCreateCopyAppendingPathComponent (
+ kCFAllocatorDefault,
+ resUrl,
+ CFSTR("data"),
+ true
+ );
+ CFURLGetFileSystemRepresentation (
+ dataUrl,
+ true,
+ mac_datadir,
+ 255
+ );
+}
+
+void initMacDataDir()
+{
+ struct stat sb;
+
+ // First, check local path
+ char *homedir = getenv("HOME");
+ if (homedir) {
+ strcpy(mac_datadir, homedir);
+ strcat(mac_datadir, data_path_sys);
+
+ if (!stat(mac_datadir, &sb))
+ return;
+ }
+
+ // Second, check the sys path
+ strcpy(mac_datadir, data_path_sys);
+ if (!stat(mac_datadir, &sb))
+ return;
+
+ // get the path inside from the .app folder
+ getResourcePath();
+}
+
diff --git a/osx/src/mac_datadir.h b/osx/src/mac_datadir.h
new file mode 100644
index 0000000..a953724
--- /dev/null
+++ b/osx/src/mac_datadir.h
@@ -0,0 +1,16 @@
+/*
+ * mac_datadir.h
+ * OpenMortal
+ *
+ * Created by Sebesty?n G?bor on Sat Apr 03 2004.
+ * Copyright (c) 2004 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#ifndef _MAC_DATADIR_H_
+#define _MAC_DATADIR_H_
+
+// extern char mac_datadir[255];
+void initMacDataDir();
+
+#endif
\ No newline at end of file
diff --git a/src/Backend.cpp b/src/Backend.cpp
index 1831ecf..a28bfab 100644
--- a/src/Backend.cpp
+++ b/src/Backend.cpp
@@ -1,514 +1,514 @@
/***************************************************************************
Backend.cpp - description
-------------------
begin : Mon Dec 9 2002
copyright : (C) 2002 by upi
email : upi@apocalypse.rulez.org
***************************************************************************/
#include "common.h"
#include "Backend.h"
#include "Audio.h"
#include "State.h"
#include <string>
#include <stdarg.h>
#include "MszPerl.h"
/***************************************************************************
PUBLIC EXPORTED VARIABLES
***************************************************************************/
PerlInterpreter* my_perl;
Backend g_oBackend;
/***************************************************************************
PRIVATE VARIABLES (perl variable space)
***************************************************************************/
SV
*perl_bgx, *perl_bgy,
*perl_px[MAXPLAYERS], *perl_py[MAXPLAYERS], *perl_pf[MAXPLAYERS],
*perl_ph[MAXPLAYERS], *perl_phreal[MAXPLAYERS],
*perl_gametick, *perl_over, *perl_ko;
SV
*perl_doodad_x, *perl_doodad_y,
*perl_doodad_t, *perl_doodad_f,
*perl_doodad_dir, *perl_doodad_gfxowner,
*perl_doodad_text;
SV
*perl_sound, *perl_Translated;
/***************************************************************************
TRANSLATION SERVICES
***************************************************************************/
const char* Translate( const char* a_pcText )
{
dSP ;
ENTER ;
SAVETMPS ;
PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSVpv(a_pcText, 0)));
PUTBACK ;
call_pv("Translate", G_DISCARD);
FREETMPS ;
LEAVE ;
if ( NULL == perl_Translated )
{
perl_Translated = get_sv("Translated", TRUE);
}
return SvPV_nolen( perl_Translated );
}
const char* TranslateUTF8( const char* a_pcText )
{
dSP ;
ENTER ;
SAVETMPS ;
PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSVpv(a_pcText, 0)));
PUTBACK ;
call_pv("Translate", G_DISCARD);
FREETMPS ;
LEAVE ;
if ( NULL == perl_Translated )
{
perl_Translated = get_sv("Translated", TRUE);
}
return SvPVutf8_nolen( perl_Translated );
}
/***************************************************************************
BACKEND CLASS IMPLEMENTATION
***************************************************************************/
#define PERLEVAL(A) eval_pv(A, TRUE);
#define PERLCALL(PROC,A,B) { \
dSP; \
ENTER; \
SAVETMPS; \
PUSHMARK(SP); \
XPUSHs(sv_2mortal(newSViv(A))); \
XPUSHs(sv_2mortal(newSViv(B))); \
PUTBACK ; \
\
call_pv( (PROC), G_DISCARD ); \
\
FREETMPS; \
LEAVE; \
}
Backend::Backend()
{
m_iBgX = m_iBgY = 0;
m_iNumDoodads = m_iNumSounds = 0;
for ( int i=0; i<MAXPLAYERS; ++i )
{
m_aoPlayers[i].m_iX = m_aoPlayers[i].m_iY = 0;
m_aoPlayers[i].m_iFrame = 0;
m_aoPlayers[i].m_iHitPoints = 0;
}
}
Backend::~Backend()
{
if ( NULL != my_perl )
{
perl_destruct( my_perl );
perl_free( my_perl );
my_perl = NULL;
}
}
bool Backend::Construct()
{
if ( my_perl != NULL )
{
// Already inited
return false;
}
perl_bgx = NULL;
perl_doodad_x = NULL;
std::string sFileName = DATADIR;
sFileName += "/script";
#ifndef _WINDOWS
chdir( sFileName.c_str() );
#endif
// char *perl_argv[] = {"", "-d:Trace", "Backend.pl"};
// int perl_argc = 3;
char *perl_argv[] = {"", "Backend.pl"};
int perl_argc = 2;
my_perl = perl_alloc();
if ( my_perl == NULL )
{
return false;
}
perl_construct( my_perl );
if ( perl_parse( my_perl, NULL, perl_argc, perl_argv, (char**)NULL ) )
{
char *error = SvPV_nolen(get_sv("@", FALSE));
fprintf( stderr, "%s", error );
return false;
}
if ( perl_run( my_perl ) )
{
char *error = SvPV_nolen(get_sv("@", FALSE));
fprintf( stderr, "%s", error );
return false;
}
return true;
}
const char* Backend::PerlEvalF( const char* a_pcFormat, ... )
{
va_list ap;
va_start( ap, a_pcFormat );
char acBuffer[1024];
vsnprintf( acBuffer, 1023, a_pcFormat, ap );
acBuffer[1023] = 0;
eval_pv(acBuffer,FALSE);
const char *pcError = SvPV_nolen(get_sv("@", FALSE));
if ( pcError && *pcError )
{
debug( "eval '%s': '%s'\n", acBuffer, pcError );
exit(0);
}
va_end( ap );
return pcError;
}
const char* Backend::GetPerlString( const char* acScalarName )
{
SV* poScalar = get_sv( acScalarName, FALSE );
if ( NULL == poScalar )
{
return "";
}
return SvPV_nolen( poScalar );
}
int Backend::GetPerlInt( const char* acScalarName )
{
SV* poScalar = get_sv( acScalarName, FALSE );
if ( NULL == poScalar )
{
return 0;
}
return SvIV( poScalar );
}
/** Returns the total number of registered fighters in the backend.
This may be more than the actual number of playable characters, as
some or many characters may not be ready or installed.
\see GetFighterID
\see GetNumberOfAvailableFighters
*/
int Backend::GetNumberOfFighters()
{
- PerlEvalF( "$::CppNumberOfFighters = scalar keys %::FighterStats;" );
+ PerlEvalF( "$::CppNumberOfFighters = scalar keys %%::FighterStats;" );
return GetPerlInt( "CppNumberOfFighters" );
}
/** Returns the ID of a fighter. The index parameter should start from
zero, and be less than the value returned by GetNumberOfFighters().
\see GetNumberOfFighters
*/
FighterEnum Backend::GetFighterID( int a_iIndex )
{
PerlEvalF( "$::CppFighterID = (sort { $a - $b } keys %%::FighterStats)[%d];", a_iIndex );
return (FighterEnum) GetPerlInt( "CppFighterID" );
}
/** Returns the number of fighters that are locally availaible for play.
This number is smaller or equal to the value returned by GetNumberOfFighters().
Note that the method GetFighterID() returns ID's of non-available
fighters as well, so it can only be used in conjunction with GetNumberOfFighters()
\see GetNumberOfFighters
*/
int Backend::GetNumberOfAvailableFighters()
{
PerlEvalF( "GetNumberOfAvailableFighters();" ); // Defined in FighterStats.pl
return GetPerlInt( "CppNumberOfAvailableFighters" );
}
void Backend::AdvancePerl()
{
PerlEvalF("GameAdvance();");
}
void Backend::ReadFromPerl()
{
int i;
if ( perl_bgx == NULL )
{
perl_gametick = get_sv("gametick", TRUE);
perl_bgx = get_sv("bgx", TRUE);
perl_bgy = get_sv("bgy", TRUE);
perl_over= get_sv("over", TRUE);
perl_ko = get_sv("ko", TRUE);
char acVarName[128];
for ( i=0; i<MAXPLAYERS; ++i )
{
sprintf( acVarName, "p%dx", i+1 );
perl_px[i] = get_sv(acVarName, TRUE);
sprintf( acVarName, "p%dy", i+1 );
perl_py[i] = get_sv(acVarName, TRUE);
sprintf( acVarName, "p%df", i+1 );
perl_pf[i] = get_sv(acVarName, TRUE);
sprintf( acVarName, "p%dh", i+1 );
perl_ph[i] = get_sv(acVarName, TRUE);
sprintf( acVarName, "p%dhreal", i+1 );
perl_phreal[i] = get_sv(acVarName, TRUE);
}
}
m_iGameTick = SvIV( perl_gametick );
m_iBgX = SvIV( perl_bgx );
m_iBgY = SvIV( perl_bgy );
m_iGameOver = SvIV( perl_over );
m_bKO = SvIV( perl_ko );
for ( i=0; i<g_oState.m_iNumPlayers; ++i )
{
m_aoPlayers[i].m_iX = SvIV( perl_px[i] );
m_aoPlayers[i].m_iY = SvIV( perl_py[i] );
m_aoPlayers[i].m_iFrame = SvIV( perl_pf[i] );
m_aoPlayers[i].m_iHitPoints = SvIV( perl_ph[i] ) / 10;
m_aoPlayers[i].m_iRealHitPoints = SvIV( perl_phreal[i] );
}
// READ DOODAD DATA
if ( perl_doodad_x == NULL )
{
perl_doodad_x = get_sv("doodad_x", TRUE);
perl_doodad_y = get_sv("doodad_y", TRUE);
perl_doodad_t = get_sv("doodad_t", TRUE);
perl_doodad_f = get_sv("doodad_f", TRUE);
perl_doodad_dir = get_sv("doodad_dir", TRUE);
perl_doodad_gfxowner = get_sv("doodad_gfxowner", TRUE);
perl_doodad_text = get_sv("doodad_text", TRUE);
}
for ( m_iNumDoodads=0; m_iNumDoodads<MAXDOODADS; ++m_iNumDoodads )
{
PERLEVAL("GetNextDoodadData();");
SDoodad& oDoodad = m_aoDoodads[m_iNumDoodads];
oDoodad.m_iType = SvIV(perl_doodad_t);
if ( oDoodad.m_iType < 0 )
{
break;
}
oDoodad.m_iX = SvIV(perl_doodad_x);
oDoodad.m_iY = SvIV(perl_doodad_y);
oDoodad.m_iFrame = SvIV(perl_doodad_f);
oDoodad.m_iDir = SvIV(perl_doodad_dir);
oDoodad.m_iGfxOwner = SvIV(perl_doodad_gfxowner);
if ( oDoodad.m_iType == 0 )
{
oDoodad.m_sText = SvPV_nolen(perl_doodad_text);
}
else
{
oDoodad.m_sText = "";
}
}
// READ SOUND DATA
if ( perl_sound == NULL )
{
perl_sound = get_sv("sound", TRUE);
}
for ( m_iNumSounds=0; m_iNumSounds<MAXSOUNDS; ++m_iNumSounds )
{
PERLEVAL("GetNextSoundData();");
const char* pcSound = SvPV_nolen(perl_sound);
if ( NULL == pcSound
|| 0 == *pcSound )
{
break;
}
m_asSounds[ m_iNumSounds ] = pcSound;
//Audio->PlaySample( pcSound );
}
}
bool Backend::IsDead( int a_iPlayer )
{
return m_aoPlayers[ a_iPlayer ].m_iRealHitPoints <= 0;
}
void Backend::PlaySounds()
{
for ( int i=0; i<m_iNumSounds; ++i )
{
Audio->PlaySample( m_asSounds[i].c_str() );
}
}
/***************************************************************************
PLAYBACK STRING CONVERSION ROUTINES
***************************************************************************/
void Backend::WriteToString( std::string& a_rsOutString )
{
char acBuffer[2048];
int iNumChars = sprintf( acBuffer, "%d %d %d %d %d %d %d %d %d %d %d ",
m_iBgX, m_iBgY,
m_aoPlayers[0].m_iX, m_aoPlayers[0].m_iY, m_aoPlayers[0].m_iFrame, m_aoPlayers[0].m_iHitPoints,
m_aoPlayers[1].m_iX, m_aoPlayers[1].m_iY, m_aoPlayers[1].m_iFrame, m_aoPlayers[1].m_iHitPoints,
m_iNumDoodads );
int i;
for ( i = 0; i<m_iNumDoodads; ++i )
{
SDoodad& roDoodad = m_aoDoodads[i];
iNumChars += sprintf( acBuffer+iNumChars, "%d %d %d %d %d %d %d %s ",
roDoodad.m_iX, roDoodad.m_iY, roDoodad.m_iType, roDoodad.m_iFrame,
roDoodad.m_iDir, roDoodad.m_iGfxOwner,
roDoodad.m_sText.size(), roDoodad.m_sText.c_str() );
}
iNumChars += sprintf( acBuffer+iNumChars, "%d ", m_iNumSounds );
for ( i = 0; i<m_iNumSounds; ++i )
{
iNumChars += sprintf( acBuffer+iNumChars, " %d %s",
m_asSounds[i].size(), m_asSounds[i].c_str() );
}
// debug( "Frame: '%s'\n", acBuffer );
a_rsOutString = acBuffer;
}
void Backend::ReadFromString( const std::string& a_rsString )
{
ReadFromString( a_rsString.c_str() );
}
void Backend::ReadFromString( const char* a_pcBuffer )
{
if ( strlen( a_pcBuffer ) < 10 )
{
m_iNumDoodads = m_iNumSounds = 0;
return;
}
int iNumMatches;
int iOffset, iTotal;
iNumMatches = sscanf( a_pcBuffer, "%d %d %d %d %d %d %d %d %d %d %d%n",
&m_iBgX, &m_iBgY,
&m_aoPlayers[0].m_iX, &m_aoPlayers[0].m_iY, &m_aoPlayers[0].m_iFrame, &m_aoPlayers[0].m_iHitPoints,
&m_aoPlayers[1].m_iX, &m_aoPlayers[1].m_iY, &m_aoPlayers[1].m_iFrame, &m_aoPlayers[1].m_iHitPoints,
&m_iNumDoodads, &iTotal );
if ( m_iNumDoodads > MAXDOODADS )
{
m_iNumDoodads = m_iNumSounds = 0;
return;
}
int i, j;
for ( i=0; i<m_iNumDoodads; ++i )
{
SDoodad& roDoodad = m_aoDoodads[i];
iNumMatches += sscanf( a_pcBuffer+iTotal, "%d %d %d %d %d %d %d %n",
&roDoodad.m_iX, &roDoodad.m_iY, &roDoodad.m_iType, &roDoodad.m_iFrame,
&roDoodad.m_iDir, &roDoodad.m_iGfxOwner,
&j, &iOffset );
iTotal += iOffset;
roDoodad.m_sText.assign( a_pcBuffer + iTotal, j );
iTotal += j;
}
iNumMatches += sscanf( a_pcBuffer + iTotal, "%d%n",
&m_iNumSounds, &iOffset );
if ( m_iNumSounds > MAXSOUNDS )
{
m_iNumSounds = 0;
return;
}
iTotal += iOffset;
for ( i=0; i<m_iNumSounds; ++i )
{
iNumMatches += sscanf( a_pcBuffer+iTotal, "%d %n",
&j, &iOffset );
iTotal += iOffset;
m_asSounds[i].assign( a_pcBuffer + iTotal, j );
iTotal += j;
}
}
diff --git a/src/Demo.cpp b/src/Demo.cpp
index ceca133..d9b795a 100644
--- a/src/Demo.cpp
+++ b/src/Demo.cpp
@@ -1,490 +1,495 @@
/***************************************************************************
Demo.cpp - description
-------------------
begin : Wed Aug 16 22:18:47 CEST 2003
copyright : (C) 2003 by upi
email : upi@apocalypse.rulez.org
***************************************************************************/
#include "FlyingChars.h"
#include "SDL.h"
#include "State.h"
#include "gfx.h"
#include "common.h"
#include "Backend.h"
#include "RlePack.h"
#include "FighterStats.h" // #includes Demo.h
#include "Event.h"
#include "config.h"
Demo::Demo()
{
m_poFlyingChars = NULL;
m_bAdvanceGame = false;
}
Demo::~Demo()
{
delete m_poFlyingChars;
m_poFlyingChars = NULL;
}
int Demo::Advance( int a_iNumFrames, bool a_bFlip )
{
int iRetVal = 1;
if ( a_iNumFrames > 5 )
a_iNumFrames = 5;
if ( m_poBackground )
{
SDL_BlitSurface( m_poBackground, NULL, gamescreen, NULL );
}
if ( m_poFlyingChars )
{
iRetVal &= AdvanceFlyingChars( a_iNumFrames );
m_poFlyingChars->Draw();
}
if ( m_bAdvanceGame )
{
iRetVal &= AdvanceGame( a_iNumFrames );
//@ DRAW GAME?
}
if ( a_bFlip )
{
SDL_Flip( gamescreen );
}
return iRetVal;
}
int Demo::AdvanceFlyingChars( int a_iNumFrames )
{
m_poFlyingChars->Advance( a_iNumFrames );
return ( m_poFlyingChars->IsDone() ? 1 : 0 );
}
int Demo::AdvanceGame( int a_iNumFrames )
{
for ( int i=0; i<a_iNumFrames; ++i )
{
g_oBackend.AdvancePerl();
}
return 0;
}
int Demo::Run()
{
SState::TGameMode enOriginalGameMode = g_oState.m_enGameMode;
int thisTick, lastTick, firstTick, gameSpeed;
gameSpeed = 12;
/*
if ( m_poBackground )
{
DrawTextMSZ( "Press Escape for the menu", impactFont, 10, 450, UseShadow, C_WHITE, m_poBackground );
}
*/
thisTick = SDL_GetTicks() / gameSpeed;
lastTick = thisTick - 1;
firstTick = SDL_GetTicks() / gameSpeed;
while ( 1 )
{
// 1. Wait for the next tick (on extremely fast machines..)
while (1)
{
thisTick = SDL_GetTicks() / gameSpeed;
if ( thisTick==lastTick )
{
SDL_Delay(1);
}
else
{
break;
}
}
// 2. Call ADVANCE.
int iRetVal = Advance(thisTick-lastTick, true);
lastTick = thisTick;
if ( iRetVal )
{
return 0;
}
// 3. Handle events.
SDL_Event oSdlEvent;
SMortalEvent oEvent;
while ( SDL_PollEvent(&oSdlEvent) )
{
TranslateEvent( &oSdlEvent, &oEvent );
switch (oEvent.m_enType)
{
case Me_QUIT:
g_oState.m_bQuitFlag = true;
break;
case Me_MENU:
OnMenu();
break;
case Me_PLAYERKEYDOWN:
if ( oEvent.m_iKey < 4 )
break;
if ( SState::IN_DEMO == g_oState.m_enGameMode )
{
OnMenu();
}
else
{
return 0;
}
break;
case Me_SKIP:
return 0;
case Me_NOTHING:
if ( SDL_KEYDOWN == oSdlEvent.type && SState::IN_DEMO == g_oState.m_enGameMode )
{
OnMenu();
continue;
}
break;
case Me_PLAYERKEYUP:
break;
} // switch
} // while MortalPollEvent
if ( g_oState.m_enGameMode != enOriginalGameMode
|| g_oState.m_bQuitFlag )
{
return 1;
}
} // while 1;
}
void Demo::OnMenu()
{
::DoMenu();
}
class CreditsDemo: public Demo
{
public:
CreditsDemo()
{
m_poBackground = LoadBackground( "Credits.jpg", 240 );
SDL_UnlockSurface( m_poBackground );
DrawGradientText( "Credits", titleFont, 20, m_poBackground );
SDL_Flip( m_poBackground );
SDL_Rect oRect;
oRect.x = 110; oRect.w = gamescreen->w - 220;
oRect.y = 100; oRect.h = 350;
m_poFlyingChars = new FlyingChars( creditsFont, oRect );
m_sText1 = Translate( "CreditsText1" );
m_sText2 = Translate( "CreditsText2" );
m_sText3 = Translate( "CreditsText3" );
m_poFlyingChars->AddText( m_sText1.c_str(), FlyingChars::FC_AlignCenter, true );
m_poFlyingChars->AddText( m_sText2.c_str(), FlyingChars::FC_AlignJustify, true );
m_poFlyingChars->AddText( m_sText3.c_str(), FlyingChars::FC_AlignCenter, true );
m_poFlyingChars->AddText( "\n\n\n\n\n\n:)", FlyingChars::FC_AlignRight, true );
}
protected:
std::string m_sText1;
std::string m_sText2;
std::string m_sText3;
};
class EuDemo: public Demo
{
public:
EuDemo()
{
m_poBackground = LoadBackground( "eu.jpg", 240 );
SDL_UnlockSurface( m_poBackground );
SDL_Rect oRect;
oRect.x = 50; oRect.w = gamescreen->w - 100;
oRect.y = 50; oRect.h = gamescreen->h - 100;
m_poFlyingChars = new FlyingChars( storyFont, oRect, -1 );
m_sText1 = "This version of OpenMortal was released on 2004-05-01, the day that Hungary "
"along with 9 other countries joined the European Union.\n\n\n\n\n\n\n\n\n";
m_poFlyingChars->AddText( m_sText1.c_str(), FlyingChars::FC_AlignJustify, true );
}
protected:
std::string m_sText1;
};
class Story1Demo: public Demo
{
public:
Story1Demo()
{
m_poBackground = LoadBackground( "Story1.jpg", 240 );
SDL_UnlockSurface( m_poBackground );
SDL_Rect oRect;
oRect.x = 50; oRect.w = gamescreen->w - 100;
oRect.y = 50; oRect.h = gamescreen->h - 100;
m_poFlyingChars = new FlyingChars( storyFont, oRect, -1 );
m_sText1 = Translate( "Story1Text" );
m_poFlyingChars->AddText( m_sText1.c_str(), FlyingChars::FC_AlignJustify, true );
}
protected:
std::string m_sText1;
};
class Story2Demo: public Demo
{
public:
Story2Demo()
{
m_poBackground = LoadBackground( "Story2.jpg", 240 );
SDL_UnlockSurface( m_poBackground );
SDL_Rect oRect;
oRect.x = 50; oRect.w = gamescreen->w - 100;
oRect.y = 50; oRect.h = gamescreen->h - 100;
m_poFlyingChars = new FlyingChars( storyFont, oRect, -1 );
m_sText1 = Translate( "Story2Text" );
m_poFlyingChars->AddText( m_sText1.c_str(), FlyingChars::FC_AlignJustify, true );
}
protected:
std::string m_sText1;
};
class MainScreenDemo: public Demo
{
public:
MainScreenDemo()
{
i = 0;
m_iTimeLeft = 50;
m_poBackground = LoadBackground( "Mortal.jpg", 240 );
DrawTextMSZ( "Version " VERSION " ゥ 2003-2004 by UPi", inkFont, 320, 430, UseShadow | AlignHCenter, C_WHITE, m_poBackground, false );
std::string sStaffFilename = DATADIR;
sStaffFilename += "/characters/STAFF.DAT";
m_poPack = new RlePack( sStaffFilename.c_str(), 255 );
m_poPack->ApplyPalette();
SDL_BlitSurface( m_poBackground, NULL, gamescreen, NULL );
SDL_Flip( gamescreen );
int j, k, l;
for ( j=0; j<14; ++j )
{
m_aiOrder[j] = j;
m_bShown[j] = false;
}
for ( j=0; j<14; ++j )
{
k = rand() % 14;
l = m_aiOrder[j]; m_aiOrder[j] = m_aiOrder[k]; m_aiOrder[k] = l;
}
}
~MainScreenDemo()
{
delete m_poPack;
m_poPack = NULL;
}
int Advance( int a_iNumFrames, bool a_bFlip )
{
static int x[14] = {
0, 26, 67, 125, 159, 209,
249, 289, 358, 397, 451, 489, 532, 161 };
static int y[14] = {
5, 4, 5, 5, 5, 7,
4, 0, 7, 5, 5, 6, 5, 243 };
m_iTimeLeft -= a_iNumFrames;
if ( m_iTimeLeft <= 0
&& i >= 14 )
{
return 1;
}
if ( m_iTimeLeft <= 0 )
{
m_bShown[ m_aiOrder[i] ] = true;
for ( int j=0; j<=14; ++j )
{
if ( m_bShown[j] )
{
m_poPack->Draw( j, x[j], y[j], false );
}
}
SDL_Flip( gamescreen );
++i;
m_iTimeLeft += 20;
if ( i >= 14 )
{
m_iTimeLeft += 50;
}
}
return 0;
}
protected:
RlePack* m_poPack;
int m_iTimeLeft;
int i;
int m_aiOrder[14];
bool m_bShown[14];
};
void DoReplayDemo()
{
static int aiOrder[6] = {-1, -1, -1, -1, -1, -1};
static int iNext = 0;
if ( aiOrder[0]<0 )
{
// shuffle
int i, j, k;
for ( i=0; i<6; ++i ) aiOrder[i]=i;
for ( i=0; i<6; ++i )
{
j = rand() % 6;
k = aiOrder[i];
aiOrder[i] = aiOrder[j];
aiOrder[j] = k;
}
iNext = 0;
}
char acFilename[1024];
+#if defined (MACOSX)
+ //[segabor] path fix.
+ sprintf( acFilename, "%s/demo%d.om", DATADIR, aiOrder[iNext] );
+#else
sprintf( acFilename, DATADIR "/demo%d.om", aiOrder[iNext] );
-// DoGame( acFilename, true, false );
+#endif
+ // DoGame( acFilename, true, false );
iNext = ( iNext + 1 ) % 6;
}
static bool g_bFirstTime = true;
void DoDemos()
{
#define DoDemos_BREAKONEND \
if ( g_oState.m_enGameMode != SState::IN_DEMO \
|| g_oState.m_bQuitFlag ) \
return;
if ( g_bFirstTime )
{
g_bFirstTime = false;
}
else
{
MainScreenDemo oDemo;
oDemo.Run();
}
while (1)
{
DoDemos_BREAKONEND;
{
EuDemo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
DoReplayDemo();
DoDemos_BREAKONEND;
{
Story1Demo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
DoReplayDemo();
DoDemos_BREAKONEND;
{
FighterStatsDemo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
DoReplayDemo();
DoDemos_BREAKONEND;
{
Story2Demo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
{
FighterStatsDemo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
DoReplayDemo();
DoDemos_BREAKONEND;
{
CreditsDemo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
{
MainScreenDemo oDemo;
oDemo.Run();
}
DoDemos_BREAKONEND;
}
}
diff --git a/src/State.cpp b/src/State.cpp
index a855344..6f3498b 100644
--- a/src/State.cpp
+++ b/src/State.cpp
@@ -1,340 +1,371 @@
/***************************************************************************
State.cpp - description
-------------------
begin : Mon Aug 12 2003
copyright : (C) 2003 by upi
email : upi@apocalypse.rulez.org
***************************************************************************/
+//[segabor] using Xcode to build OpenMortal makes config.h unneccessary
+#ifndef MACOSX
#include "../config.h"
+#endif
#include "gfx.h"
#include "common.h"
#include "State.h"
#include "SDL_keysym.h"
#include "SDL_mixer.h"
#include <string>
#include <fstream>
+#ifdef MACOSX
+//[segabor]
+#include <CoreFoundation/CoreFoundation.h>
+#endif
//include <unistd.h>
#include "Backend.h"
#include "MszPerl.h"
extern PerlInterpreter* my_perl;
SState g_oState;
std::string GetConfigHeader()
{
std::string sHeader( "Simple config file " );
sHeader += PACKAGE " " VERSION;
return sHeader;
}
std::string GetConfigFilename()
{
#ifdef _WINDOWS
if ( NULL != g_oState.m_pcArgv0 )
{
return std::string(g_oState.m_pcArgv0) + ".ini";
}
return "c:\\openmortal.ini";
+#elif defined(MACOSX)
+ //[segabor] get os-ified path
+ return std::string(getenv("HOME")) + "/Library/Preferences/OpenMortal.cfg";
#else
return std::string(getenv("HOME")) + "/.openmortalrc";
#endif
}
SState::SState()
{
// 1. SET THE TRIVIAL DEFAULTS
m_enGameMode = IN_DEMO;
m_bQuitFlag = false;
m_pcArgv0 = NULL;
m_iNumPlayers = 2;
m_enTeamMode = Team_ONE_VS_ONE;
m_iTeamSize = 5;
m_bTeamMultiselect = false;
m_iGameTime = 60;
m_iHitPoints = 100;
m_iGameSpeed = 12;
#ifdef _WINDOWS
#ifdef _DEBUG
m_bFullscreen = false;
#else
m_bFullscreen = true;
#endif
+ #elif defined(MACOSX)
+ //[segabor]
+ #ifdef DEBUG
+ m_bFullscreen = false;
+ #else
+ m_bFullscreen = true;
+ #endif
#else
m_bFullscreen = false;
#endif
m_iChannels = 2;
m_iMixingRate = MIX_DEFAULT_FREQUENCY;
m_iMixingBits = 2;
m_iMusicVolume = 50;
m_iSoundVolume = 100;
static const int aiDefaultKeys[MAXPLAYERS][9] = {
{ SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, SDLK_PAGEDOWN,
SDLK_DELETE, SDLK_INSERT, SDLK_END, SDLK_HOME },
{ SDLK_w, SDLK_s, SDLK_a, SDLK_d, SDLK_x,
SDLK_f, SDLK_r, SDLK_g, SDLK_t },
{ SDLK_u, SDLK_j, SDLK_h, SDLK_k, SDLK_i,
SDLK_b, SDLK_n, SDLK_m, SDLK_COMMA },
{ SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6,
SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10 },
};
for ( int i=0; i<MAXPLAYERS; ++i )
for ( int j=0; j<9; ++j )
m_aiPlayerKeys[i][j] = aiDefaultKeys[i][j];
strcpy( m_acLatestServer, "apocalypse.rulez.org" );
m_bServer = false;
strcpy( m_acNick, "Mortal" );
strcpy( m_acLanguage, "en" );
// 2. SO FAR THESE WERE THE EASY DEFAULTS
// NOW MOVE ON TO THE TRICKIER ONES.
// 2.1. FIND THE LANGUAGE
#ifdef _WINDOWS
LANGID iLangID = GetUserDefaultLangID() & 0x007f;
const char* pcLang;
switch ( iLangID )
{
case 0x0e: pcLang = "hu";
case 0x0c: pcLang = "fr";
case 0x0a: pcLang = "es";
default: pcLang = "en";
}
strcpy( m_acNick, pcLang );
+#elif defined(MACOSX)
+ //[segabor] OS X style locale handling
+ CFLocaleRef userLocaleRef = CFLocaleCopyCurrent();
+ char cbuff[255];
+
+ CFStringGetCString(CFLocaleGetIdentifier(userLocaleRef),
+ cbuff,
+ 255,
+ kCFStringEncodingASCII);
+ m_acLanguage[0] = cbuff[0];
+ m_acLanguage[1] = cbuff[1];
+ m_acLanguage[2] = 0;
+
+ debug("Language code is %s\n", m_acLanguage);
#else
// Read the locale from the operating system
char* pcLocale = setlocale( LC_CTYPE, NULL );
debug( "The locale returned by the operating system is '%s'\n", pcLocale ? pcLocale : "NULL" );
if ( NULL == pcLocale
|| strcmp( pcLocale, "C") == 0 )
{
// Try the 'GETENV' method
pcLocale = getenv( "LANG" );
debug( "The LANG envvar is '%s'\n", pcLocale ? pcLocale : "NULL" );
}
if ( NULL != pcLocale )
{
strncpy( m_acLanguage, pcLocale, 2 );
m_acLanguage[2] = 0;
}
else
{
strcpy( m_acLanguage, "en" );
}
#endif
// 2.2. FIND THE USER NAME
#ifdef _WINDOWS
m_acNick[0] = 0;
DWORD iLen = 127;
BOOL iResult = GetUserName( m_acNick, &iLen );
if ( 0 == iResult )
{
m_acNick[0] = 0;
debug( "GetUserName failed: %d.\n", iResult );
}
#else
int iResult = getlogin_r( m_acNick, 127 );
if ( iResult )
{
debug( "getlogin_r failed: %d\n", iResult );
strcpy( m_acNick, getenv("USER") );
}
#endif
if ( !m_acNick[0] )
{
strcpy( m_acNick, "Mortal"); // Last-ditch default..
}
};
void SState::ToggleFullscreen()
{
m_bFullscreen = !m_bFullscreen;
bool bPaletted = ( gamescreen->format->BitsPerPixel <= 8 );
SDL_Color aoPalette[256];
int iNumColors = 0;
if ( bPaletted )
{
iNumColors = gamescreen->format->palette->ncolors;
if ( iNumColors > 256 ) iNumColors = 256;
for ( int i=0; i<iNumColors; ++i )
{
aoPalette[i].r = gamescreen->format->palette->colors[i].r;
aoPalette[i].g = gamescreen->format->palette->colors[i].g;
aoPalette[i].b = gamescreen->format->palette->colors[i].b;
aoPalette[i].unused = 0;
}
}
SetVideoMode( gamescreen->w > 640, m_bFullscreen );
if ( bPaletted )
{
SDL_SetPalette( gamescreen, SDL_LOGPAL | SDL_PHYSPAL, aoPalette, 0, iNumColors );
}
}
void SState::SetLanguage( const char* a_pcLanguage )
{
if ( m_acLanguage != a_pcLanguage )
{
strncpy( m_acLanguage, a_pcLanguage, 9 );
m_acLanguage[9] = 0;
}
g_oBackend.PerlEvalF( "SetLanguage('%s');", m_acLanguage );
SV* poSv = get_sv("LanguageNumber", FALSE);
if (poSv)
{
m_iLanguageCode = SvIV( poSv );
}
else
{
m_iLanguageCode = 0;
}
}
void SState::SetServer( const char* a_pcServer )
{
if ( a_pcServer )
{
strncpy( m_acLatestServer, a_pcServer, 255 );
m_acLatestServer[255] = 0;
m_bServer = false;
}
else
{
m_bServer = true;
}
}
void SState::Load()
{
std::string sFilename = GetConfigFilename();
g_oBackend.PerlEvalF( "ParseConfig('%s');", sFilename.c_str() );
SV* poSv;
// poSv = get_sv("", FALSE); if (poSv) m_ = SvIV( poSv );
poSv = get_sv("NUMPLAYERS", FALSE); if (poSv) m_iNumPlayers = SvIV( poSv );
poSv = get_sv("TEAMMODE", FALSE); if (poSv) m_enTeamMode = (TTeamModeEnum) SvIV( poSv );
poSv = get_sv("TEAMSIZE", FALSE); if (poSv) m_iTeamSize = SvIV( poSv );
poSv = get_sv("TEAMMULTISELECT", FALSE); if (poSv) m_bTeamMultiselect = SvIV( poSv );
poSv = get_sv("GAMETIME", FALSE); if (poSv) m_iGameTime = SvIV( poSv );
poSv = get_sv("HITPOINTS", FALSE); if (poSv) m_iHitPoints = SvIV( poSv );
poSv = get_sv("GAMESPEED", FALSE); if (poSv) m_iGameSpeed = SvIV( poSv );
poSv = get_sv("FULLSCREEN", FALSE); if (poSv) m_bFullscreen = SvIV( poSv );
poSv = get_sv("CHANNELS", FALSE); if (poSv) m_iChannels = SvIV( poSv );
poSv = get_sv("MIXINGRATE", FALSE); if (poSv) m_iMixingRate = SvIV( poSv );
poSv = get_sv("MIXINGBITS", FALSE); if (poSv) m_iMixingBits = SvIV( poSv );
poSv = get_sv("MUSICVOLUME", FALSE); if (poSv) m_iMusicVolume = SvIV( poSv );
poSv = get_sv("SOUNDVOLUME", FALSE); if (poSv) m_iSoundVolume = SvIV( poSv );
poSv = get_sv("LANGUAGE", FALSE); if (poSv) { strncpy( m_acLanguage, SvPV_nolen( poSv ), 9 ); m_acLanguage[9] = 0; }
poSv = get_sv("LATESTSERVER", FALSE); if (poSv) { strncpy( m_acLatestServer, SvPV_nolen( poSv ), 255 ); m_acLatestServer[255] = 0; }
poSv = get_sv("SERVER", FALSE); if (poSv) m_bServer = SvIV( poSv );
poSv = get_sv("NICK", FALSE); if (poSv) { strncpy( m_acNick, SvPV_nolen( poSv ), 127 ); m_acNick[127] = 0; }
char pcBuffer[1024];
for ( int i=0; i<MAXPLAYERS; ++i )
{
for ( int j=0; j<9; ++j )
{
sprintf( pcBuffer, "PLAYER%dKEY%d", i, j );
poSv = get_sv(pcBuffer, FALSE); if (poSv) m_aiPlayerKeys[i][j] = SvIV( poSv );
}
}
}
void SState::Save()
{
std::string sFilename = GetConfigFilename();
std::ofstream oStream( sFilename.c_str(), std::ios_base::out | std::ios_base::trunc );
if ( oStream.rdstate() & std::ios::failbit )
{
debug( "Unable to open config file: %s\n", sFilename.c_str() );
return;
}
oStream << GetConfigHeader() << '\n';
// oStream << "=" << m_ << '\n';
oStream << "NUMPLAYERS=" << m_iNumPlayers << '\n';
oStream << "TEAMMODE=" << m_enTeamMode << '\n';
oStream << "TEAMSIZE=" << m_iTeamSize << '\n';
oStream << "TEAMMULTISELECT=" << m_bTeamMultiselect << '\n';
oStream << "GAMETIME=" << m_iGameTime << '\n';
oStream << "HITPOINTS=" << m_iHitPoints << '\n';
oStream << "GAMESPEED=" << m_iGameSpeed << '\n';
oStream << "FULLSCREEN=" << m_bFullscreen << '\n';
oStream << "CHANNELS=" << m_iChannels << '\n';
oStream << "MIXINGRATE=" << m_iMixingRate << '\n';
oStream << "MIXINGBITS=" << m_iMixingBits << '\n';
oStream << "MUSICVOLUME=" << m_iMusicVolume << '\n';
oStream << "SOUNDVOLUME=" << m_iSoundVolume << '\n';
oStream << "LANGUAGE=" << m_acLanguage << '\n';
oStream << "LATESTSERVER=" << m_acLatestServer << '\n';
oStream << "SERVER=" << m_bServer << '\n';
oStream << "NICK=" << m_acNick << '\n';
for ( int i=0; i<MAXPLAYERS; ++i )
{
for ( int j=0; j<9; ++j )
{
oStream << "PLAYER" <<i<< "KEY" <<j<< '=' << m_aiPlayerKeys[i][j] << '\n';
}
}
oStream.flush();
oStream.close();
}
diff --git a/src/gfx.cpp b/src/gfx.cpp
index c87149a..1e7dede 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1,465 +1,468 @@
/***************************************************************************
gfx.cpp - description
-------------------
begin : Tue Apr 10 2001
copyright : (C) 2001 by UPi
email : upi@apocalypse.rulez.org
***************************************************************************/
#include <string.h>
+//[segabor]: On OS X we don't need malloc.h
+#ifndef MACOSX
#include <malloc.h>
+#endif
#include "SDL.h"
#include "SDL_video.h"
#include "SDL_image.h"
#include "sge_tt_text.h"
#include "sge_surface.h"
#ifndef __COMMON_H
#include "common.h"
#endif
#ifndef _GFX_H
#include "gfx.h"
#endif
#include "State.h"
#include "Event.h"
int CSurfaceLocker::m_giLockCount = 0;
Uint16 *UTF8_to_UNICODE(Uint16 *unicode, const char *utf8, int len);
void sge_TTF_SizeText( _sge_TTFont*font, const char* text, int* x, int* y )
{
#ifdef MSZ_USES_UTF8
Uint16 *unicode_text;
int unicode_len;
/* Copy the UTF-8 text to a UNICODE text buffer */
unicode_len = strlen(text);
unicode_text = (Uint16 *)malloc( (unicode_len+1) * sizeof (Uint16) );
if ( unicode_text == NULL )
{
SDL_SetError("SGE - Out of memory");
*x = *y = 0;
return;
}
UTF8_to_UNICODE(unicode_text, text, unicode_len);
/* Render the new text */
SDL_Rect r = sge_TTF_TextSizeUNI(font, unicode_text);
/* Free the text buffer and return */
free(unicode_text);
#else
SDL_Rect r = sge_TTF_TextSize( font, text );
#endif
*x = r.w;
*y = r.h;
}
int DrawTextMSZ( const char* string, _sge_TTFont* font, int x, int y, int flags,
int fg, SDL_Surface* target, bool a_bTranslate )
{
int retval = 0;
if (!string || !*string) return retval;
if ( a_bTranslate )
{
string = Translate( string );
}
if (flags & UseTilde)
{
char *str2 = strdup( string );
char onechar[2];
char *c1, *c2, *c3;
int w = 0;
int i, j;
bool notend;
if (flags & AlignHCenter)
{
// Determine width of the string without the stupid tildes
c1 = c2 = str2;
notend = true;
while (notend)
{
c2 = c1; // c1: start of this run
while (*c2 && (*c2!='~')) c2++; // c2: end of this run
notend = *c2;
*c2 = 0;
sge_TTF_SizeText( font, c1, &i, &j);
w += i;
if (notend) { *c2='~'; c1=c2+1; } // next run..
}
x -= w/2;
}
flags &= ~(UseTilde | AlignHCenter);
c1 = str2;
onechar[1]=0;
notend = true;
while (1)
{
c2 = c1;
while (*c2 && (*c2!='~')) c2++; // c2: end of this run
notend = *c2;
*c2 = 0;
sge_TTF_SizeText( font, c1, &i, &j);
DrawTextMSZ( c1, font, x, y, flags, fg, target, false );
x += i;
// At this point, we're either at a ~ or end of the text (notend)
if (!notend) break;
onechar[0]= *++c2; // Could be 0, if ~ at end.
if (!onechar[0]) break;
sge_TTF_SizeText( font, onechar, &i, &j);
DrawTextMSZ( onechar, font, x, y, flags, C_LIGHTCYAN, target, false );
x += i;
retval += i;
c1 = c2+1;
if (!*c1) break; // ~X was end of string
}
delete( str2 );
return retval;
}
SDL_Rect dest;
int w, h;
sge_TTF_SizeText( font, string, &w, &h );
dest.w = retval = w;
dest.h = h;
dest.x = flags & AlignHCenter ? x-dest.w/2 : x;
dest.y = flags & AlignVCenter ? y-dest.h/2 : y;
//debug( "X: %d, Y: %d, W: %d, H: %d\n", dest.x, dest.y, dest.w, dest.h );
CSurfaceLocker oLock;
if ( flags & UseShadow )
{
#ifdef MSZ_USES_UTF8
sge_tt_textout_UTF8( target, font, string, dest.x+2, dest.y+2+sge_TTF_FontAscent(font), C_BLACK, C_BLACK, 255 );
#else
sge_tt_textout( target, font, string, dest.x+2, dest.y+2+sge_TTF_FontAscent(font), C_BLACK, C_BLACK, 255 );
#endif
}
sge_TTF_AAOn();
#ifdef MSZ_USES_UTF8
dest = sge_tt_textout_UTF8( target, font, string, dest.x, dest.y+sge_TTF_FontAscent(font), fg, C_BLACK, 255 );
#else
dest = sge_tt_textout( target, font, string, dest.x, dest.y+sge_TTF_FontAscent(font), fg, C_BLACK, 255 );
#endif
sge_TTF_AAOff();
return dest.w;
}
void DrawGradientText( const char* text, _sge_TTFont* font, int y, SDL_Surface* target, bool a_bTranslate )
{
int i, j;
if ( a_bTranslate )
{
text = Translate( text );
}
// 1. CREATE OFFSCREEN SURFACE
SDL_Rect size = sge_TTF_TextSize( font, (char*)text );
size.w += 2;
size.h += 2;
size.x = 320 - size.w / 2;
if ( size.x < 0 ) size.x = 0;
size.y = y;
SDL_Surface* surface = SDL_CreateRGBSurface( SDL_SRCCOLORKEY, size.w, size.h, 8, 0,0,0,0 );
if ( NULL == surface )
{
debug( "DrawGradientText: Couldn't allocate %d by %d surface!\n", size.w, size.h );
return;
}
// 2. SET OFFSCREEN SURFACE COLORS
SDL_SetColorKey( surface, SDL_SRCCOLORKEY, 0 );
SDL_Color colors[256];
colors[0].r = colors[0].g = colors[0].b = 0;
colors[1] = colors[0];
// The rest is red->yellow gradient.
for ( i=2; i<255; ++i )
{
int j = i > 25 ? i-25 : 0;
colors[i].r = 255;
colors[i].g = 255-j;
colors[i].b = 0;
}
SDL_SetColors( surface, colors, 0, 256 );
// 3. DRAW TEXT, APPLY BORDER, APPLY GRADIENT.
int y1 = sge_TTF_FontAscent(font);
sge_tt_textout( surface, font, text,
1, y1, 255, 0, 255);
if ( SDL_MUSTLOCK(surface) ) SDL_LockSurface(surface);
for ( y=1; y<size.h-1; ++y )
{
int color = 254 * y / (size.h-1) + 1;
unsigned char *p0, *p1, *p2;
p1 = (unsigned char*) surface->pixels;
p1 += surface->pitch * y + 1;
p0 = p1 - surface->pitch;
p2 = p1 + surface->pitch;
for ( int x=1; x<size.w-1; ++x, ++p0, ++p1, ++p2 )
{
if ( *p1 > 2 )
{
*p1 = color;
}
else
{
if ( (*(p1-1) > 2) || (*(p1+1) > 2) || *p0 > 2 || *p2 > 2 )
{
*p1 = 1;
}
}
}
}
if ( SDL_MUSTLOCK(surface) ) SDL_UnlockSurface(surface);
// 4. FINALLY
SDL_BlitSurface( surface, NULL, target, &size );
SDL_FreeSurface( surface );
SDL_UpdateRect( target, size.x, size.y, size.w, size.h );
}
SDL_Color MakeColor( Uint8 r, Uint8 g, Uint8 b )
{
SDL_Color color;
color.r = r; color.g = g; color.b = b; color.unused = 0;
return color;
}
/**
Waits for a key event and returns it.
\param a_bTranslate If this is true, then keypad events will also be
read and processed info keys (cursor, return and escape).
*/
SDLKey GetKey( bool a_bTranslate )
{
SDL_Event oSdlEvent;
SMortalEvent oEvent;
while (SDL_WaitEvent(&oSdlEvent))
{
if ( SDL_KEYDOWN == oSdlEvent.type )
{
return oSdlEvent.key.keysym.sym;
}
if ( SDL_QUIT == oSdlEvent.type )
{
g_oState.m_bQuitFlag = true;
return SDLK_ESCAPE;
}
if ( ! a_bTranslate )
{
continue;
}
// Handle gamepad and others
TranslateEvent( &oSdlEvent, &oEvent );
switch (oEvent.m_enType)
{
case Me_QUIT:
g_oState.m_bQuitFlag = true;
return SDLK_ESCAPE;
case Me_PLAYERKEYDOWN:
switch ( oEvent.m_iKey ) {
case Mk_UP: return SDLK_UP;
case Mk_DOWN: return SDLK_DOWN;
case Mk_LEFT: return SDLK_LEFT;
case Mk_RIGHT: return SDLK_RIGHT;
default: return SDLK_RETURN;
}
break;
case Me_MENU:
return SDLK_ESCAPE;
default:
break;
} // switch statement
} // Polling events
// Code will never reach this point, unless there's an error.
return SDLK_ESCAPE;
}
SDL_Surface* LoadBackground( const char* a_pcFilename, int a_iNumColors, int a_iPaletteOffset, bool a_bTransparent )
{
char acFilepath[FILENAME_MAX+1];
strcpy( acFilepath, DATADIR );
strcat( acFilepath, "/gfx/" );
strcat( acFilepath, a_pcFilename );
SDL_Surface* poBackground = IMG_Load( acFilepath );
if (!poBackground)
{
debug( "Can't load file: %s\n", acFilepath );
return NULL;
}
SDL_Palette* pal = poBackground->format->palette;
if ( pal && gamescreen->format->palette )
{
int ncolors = pal->ncolors;
if (ncolors>a_iNumColors) ncolors = a_iNumColors;
if (ncolors+a_iPaletteOffset > 255) ncolors = 255 - a_iPaletteOffset;
SDL_SetColors( gamescreen, pal->colors, a_iPaletteOffset, ncolors );
}
SDL_Surface* poRetval = SDL_DisplayFormat( poBackground );
SDL_FreeSurface( poBackground );
// 2. TRY TO LOAD AN IMAGE MASK
// This means trying to load a .png file which acts as a mask for the
// original [jpg] image.
// If the original file is <Basename>.jpg, the mask is <Basename>.mask.png
int iLength = strlen( acFilepath );
char acMaskFilename[FILENAME_MAX+1];
strncpy( acMaskFilename, acFilepath, iLength-4 );
acMaskFilename[iLength-4] = 0;
strcat( acMaskFilename, ".mask.png" );
SDL_Surface* poMask = IMG_Load( acMaskFilename );
if ( !poMask )
{
// No mask.
return poRetval;
}
if ( poMask->w < poRetval->w
|| poMask->h < poRetval->h )
{
debug( "Error loading mask for %s: mask is too small.\n", acFilepath );
SDL_FreeSurface( poMask );
return poRetval;
}
debug( "Loading mask for %s.\n", acFilepath );
Uint32 iTransparent = SDL_MapRGB( gamescreen->format, 255, 217, 0 ); // an unlikely color in openmortal..
- Uint32 iMask = sge_GetPixel( poMask, 0, 0 );
+ Uint32 iMask = sge_GetPixel( poMask, 0, 0 );
Uint32 iPixel;
for ( int y = 0; y < poRetval->h; ++y ) {
for ( int x=0; x< poRetval->w; ++x ) {
iPixel = sge_GetPixel( poMask, x, y );
// debug( "%d ", iPixel );
if ( iPixel == iMask ) {
sge_PutPixel( poRetval, x, y, iTransparent );
}
}
// debug( "\n" );
}
SDL_FreeSurface( poMask );
SDL_SetColorKey( poRetval, SDL_SRCCOLORKEY, iTransparent );
return poRetval;
}
bool SetVideoMode( bool a_bLarge, bool a_bFullScreen, int a_iAdditionalFlags )
{
// SET THE PARAMETERS FOR THE VIDEO MODE
int iBpp = 16; // Try the display's BPP first.
if ( NULL != gamescreen )
{
iBpp = gamescreen->format->BitsPerPixel;
}
int iFlags = a_iAdditionalFlags;
if ( a_bFullScreen )
{
iFlags |= SDL_FULLSCREEN;
}
// CALL SDL_SetVideoMode
int iWidth = a_bLarge ? 800 : 640;
int iHeight = a_bLarge ? 600 : 480;
// if ( !a_bFullScreen ) iHeight = 480;
gamescreen = SDL_SetVideoMode( iWidth, iHeight, iBpp, iFlags );
if ( NULL == gamescreen )
{
debug( "SDL_SetVideoMode( %d, %d, %d, %d ) failed.\n", iWidth, iHeight, iBpp, iFlags );
return false;
}
// IF THE DISPLAY IS 24BPP OR 8 BPP OR LESS, EMULATE 16 BPP INSTEAD
// (because we are lazy and won't write 8bpp and 24bpp code anymore)
if ( gamescreen->format->BytesPerPixel != 2
&& gamescreen->format->BytesPerPixel != 4 )
{
gamescreen = SDL_SetVideoMode( iWidth, iHeight, 16, iFlags );
if ( NULL == gamescreen )
{
debug( "SDL_SetVideoMode( %d, %d, %d, %d ) failed.\n", iWidth, iHeight, 16, iFlags );
return false;
}
}
return true;
}
diff --git a/src/main.cpp b/src/main.cpp
index 9b4c0a1..9facd18 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,636 +1,643 @@
/***************************************************************************
main.cpp - description
-------------------
begin : Wed Aug 22 10:18:47 CEST 2001
copyright : (C) 2001 by upi
email : upi@apocalypse.rulez.org
***************************************************************************/
#include "config.h"
#include "PlayerSelect.h"
#include "SDL_video.h"
#include "sge_tt_text.h"
#include "sge_bm_text.h"
#include "sge_surface.h"
#include "SDL.h"
#include "SDL_image.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <string>
#include "common.h"
#include "gfx.h"
#include "Audio.h"
#include "RlePack.h"
#include "Backend.h"
#include "State.h"
#include "FighterStats.h"
#include "MortalNetwork.h"
#ifdef _WINDOWS
#undef DATADIR // GRRR.. windows keyword...
#include <windows.h>
#define DATADIR "../data"
#endif
_sge_TTFont* inkFont;
_sge_TTFont* impactFont;
_sge_TTFont* titleFont;
_sge_TTFont* chatFont;
sge_bmpFont* fastFont;
sge_bmpFont* creditsFont;
sge_bmpFont* storyFont;
bool bDebug = false;
Uint32 C_BLACK, C_BLUE, C_GREEN, C_CYAN, C_RED, C_MAGENTA, C_ORANGE, C_LIGHTGRAY,
C_DARKGRAY, C_LIGHTBLUE, C_LIGHTGREEN, C_LIGHTCYAN, C_LIGHTRED, C_LIGHTMAGENTA, C_YELLOW, C_WHITE;
SDL_Color Colors[] =
{
{ 0, 0, 0, 0 }, { 0, 0, 42, 0 }, { 0, 42, 0, 0 }, { 0, 42, 42, 0 },
{ 42, 0, 0, 0 }, { 42, 0, 42, 0 }, { 63, 42, 0, 0 }, { 42, 42, 42, 0 },
{ 21, 21, 21, 0 }, { 21, 21, 63, 0 }, { 21, 63, 21, 0 }, { 21, 63, 63, 0 },
{ 63, 21, 21, 0 }, { 63, 21, 63, 0 }, { 63, 63, 21, 0 }, { 63, 63, 63, 0 }
};
void Complain( const char* a_pcError )
{
#ifdef _WINDOWS
::MessageBoxA( 0, a_pcError, "OpenMortal", MB_ICONEXCLAMATION );
#else
fprintf( stderr, "%s", a_pcError );
#endif
}
_sge_TTFont* LoadTTF( const char* a_pcFilename, int a_iSize )
{
std::string sPath = std::string(DATADIR) + "/fonts/" + a_pcFilename;
_sge_TTFont* poFont = sge_TTF_OpenFont( sPath.c_str(), a_iSize );
if ( NULL == poFont )
{
Complain( ("Couldn't load font: " + sPath).c_str() );
}
return poFont;
}
sge_bmpFont* LoadBMPFont( const char* a_pcFilename )
{
std::string sPath = std::string(DATADIR) + "/fonts/" + a_pcFilename;
sge_bmpFont* poFont = sge_BF_OpenFont( sPath.c_str(), SGE_BFSFONT | SGE_BFTRANSP );
if ( NULL == poFont )
{
Complain( ("Couldn't load font: " + sPath).c_str() );
}
return poFont;
}
int init()
{
if (SDL_Init(SDL_INIT_VIDEO /*| SDL_INIT_AUDIO*/) < 0)
{
fprintf(stderr, "Failed to initialize SDL: %s\n", SDL_GetError());
return -1;
}
atexit(SDL_Quit);
SetVideoMode( false, g_oState.m_bFullscreen );
if (gamescreen == NULL)
{
fprintf(stderr, "failed to set video mode: %s\n", SDL_GetError());
return -1;
}
SDL_WM_SetCaption( "OpenMortal", "OpenMortal" );
std::string sPath = std::string(DATADIR) + "/gfx/icon.png";
SDL_WM_SetIcon(IMG_Load(sPath.c_str()), NULL);
SDL_ShowCursor( SDL_DISABLE );
int i;
for ( i=0; i<16; ++i )
{
Colors[i].r *=4; Colors[i].g *=4; Colors[i].b *=4;
}
if ( gamescreen->format->BitsPerPixel > 8 )
{
i = 0;
C_BLACK = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_BLUE = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_GREEN = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_CYAN = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_RED = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_MAGENTA = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_ORANGE = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_LIGHTGRAY = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_DARKGRAY = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_LIGHTBLUE = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_LIGHTGREEN = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_LIGHTCYAN = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_LIGHTRED = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_LIGHTMAGENTA = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_YELLOW = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
C_WHITE = SDL_MapRGB( gamescreen->format, Colors[i].r, Colors[i].g, Colors[i].b ); ++i;
}
else
{
SDL_SetColors( gamescreen, Colors, 256-16, 16 );
C_BLACK = 240;
C_BLUE = 241;
C_GREEN = 242;
C_CYAN = 243;
C_RED = 244;
C_MAGENTA = 245;
C_ORANGE = 246;
C_LIGHTGRAY = 247;
C_DARKGRAY = 248;
C_LIGHTBLUE = 249;
C_LIGHTGREEN = 250;
C_LIGHTCYAN = 251;
C_LIGHTRED = 252;
C_LIGHTMAGENTA = 253;
C_YELLOW = 254;
C_WHITE = 255;
}
if ( sge_TTF_Init() )
{
fprintf(stderr, "couldn't start ttf engine: %s\n", SDL_GetError());
return -1;
}
sge_TTF_AAOff();
inkFont = LoadTTF( "aardvark.ttf", 20 );
if ( !inkFont ) return -1;
impactFont = LoadTTF( "bradybun.ttf", 20 ); // gooddogc.ttf, 20
if ( !impactFont ) return -1;
titleFont = LoadTTF( "deadgrit.ttf", 48 ); // deadgrit.ttf, 48
if ( !titleFont ) return -1;
chatFont = LoadTTF( "thin.ttf", 20 ); // deadgrit.ttf, 48
if ( !chatFont ) return -1;
fastFont = LoadBMPFont( "brandybun3.png" );
if ( !fastFont ) return -1;
creditsFont = LoadBMPFont( "CreditsFont2.png" );//"fangfont.png" );
if ( !creditsFont ) return -1;
storyFont = LoadBMPFont( "glossyfont.png" );
if ( !storyFont ) return -1;
return 0;
}
int init2()
{
if ( !g_oBackend.Construct() )
{
fprintf(stderr, "couldn't start backend.\n" );
return -1;
}
return 0;
}
int DrawMainScreen()
{
SDL_Surface* background = LoadBackground( "Mortal.jpg", 240 );
DrawTextMSZ( "Version " VERSION " - European Union Editition", inkFont, 320, 430, UseShadow | AlignHCenter, C_WHITE, background, false );
SDL_Rect r;
r.x = r.y = 0;
std::string sStaffFilename = DATADIR;
sStaffFilename += "/characters/STAFF.DAT";
RlePack pack( sStaffFilename.c_str(), 256 );
pack.ApplyPalette();
SDL_BlitSurface( background, NULL, gamescreen, &r );
SDL_Flip( gamescreen );
/* char* filename[15] = {
"Jacint.pl", "Jozsi.pl", "Agent.pl", "Mrsmith.pl",
"Sleepy.pl", "Tejszin.pl",
"UPi.pl", "Zoli.pl", "Ulmar.pl", "Bence.pl",
"Descant.pl", "Grizli.pl", "Sirpi.pl", "Macy.pl", "Cumi.pl" };*/
int x[14] = {
0, 26, 67, 125, 159, 209,
249, 289, 358, 397, 451, 489, 532, 161 };
int y[14] = {
5, 4, 5, 5, 5, 7,
4, 0, 7, 5, 5, 6, 5, 243 };
/*
int i;
g_oBackend.PerlEvalF( "eval( \"require '%s/characters/Kinga.pl';\" )", DATADIR );
g_oBackend.PerlEvalF( "eval( \"require '%s/characters/Ambrus.pl';\" )", DATADIR );
g_oBackend.PerlEvalF( "eval( \"require '%s/characters/Dani.pl';\" )", DATADIR );
for ( i=0; i<15; ++i )
{
pack.Draw( i, x[i], y[i], false );
SDL_Flip( gamescreen );
if ( filename[i] != NULL )
{
debug( "Loading fighter %s", filename[i] );
g_oBackend.PerlEvalF( "eval( \"require '%s/characters/%s';\" )", DATADIR, filename[i] );
}
}
int retval = 0;
i = 0;
*/
int iNumFighterFiles, i;
+#ifdef MACOSX
+ //[segabor]
+ char char_buf[256];
+ sprintf(char_buf, "%s/characters", DATADIR);
+ g_oBackend.PerlEvalF( "$CppRetval = GetNumberOfFighterFiles('%s')", char_buf );
+#else
g_oBackend.PerlEvalF( "$CppRetval = GetNumberOfFighterFiles('%s')", DATADIR "/characters" );
+#endif
iNumFighterFiles = g_oBackend.GetPerlInt( "CppRetval" );
for ( i=0; i<iNumFighterFiles; ++i )
{
g_oBackend.PerlEvalF( "LoadFighterFile(%d);", i );
if ( i < 15 ) {
pack.Draw( i, x[i], y[i], false );
SDL_Flip( gamescreen );
}
}
SDL_FreeSurface( background );
return 0;
}
int InitJoystick();
/**
The game loop consists of the following events:
\li Player selection
\li DoGame
\li GameOver and FighterStatsDemo (not in network mode)
The loop ends if the game mode changes to a non-game mode (e.g. IN_DEMO or IN_CHAT)
*/
void GameLoop()
{
class CVideoModeChange
{
public:
CVideoModeChange( bool a_bWide )
{
m_bWide = a_bWide;
if ( m_bWide ) SetVideoMode( true, g_oState.m_bFullscreen );
}
~CVideoModeChange()
{
if ( m_bWide ) SetVideoMode( false, g_oState.m_bFullscreen );
}
bool m_bWide;
} oVideoModeChanger( g_oState.m_iNumPlayers > 2 );
#define IS_GAME_MODE (g_oState.m_enGameMode != SState::IN_DEMO \
&& g_oState.m_enGameMode != SState::IN_CHAT \
&& !g_oState.m_bQuitFlag)
Audio->PlaySample( "GAME_NEW" );
Audio->PlayMusic( "GameMusic" );
bool bNetworkGame = SState::IN_NETWORK == g_oState.m_enGameMode;
if ( bNetworkGame )
{
g_oState.m_enTeamMode = SState::Team_ONE_VS_ONE;
}
while ( IS_GAME_MODE )
{
if ( SState::Team_GOOD_VS_EVIL == g_oState.m_enTeamMode )
{
std::vector<FighterEnum>& roTeam0 = g_oPlayerSelect.EditPlayerInfo(0).m_aenTeam;
std::vector<FighterEnum>& roTeam1 = g_oPlayerSelect.EditPlayerInfo(1).m_aenTeam;
roTeam0.clear();
roTeam1.clear();
roTeam0.push_back( SIRPI );
roTeam0.push_back( MACI );
roTeam0.push_back( GRIZLI );
roTeam0.push_back( DANI );
roTeam0.push_back( KINGA );
roTeam0.push_back( CUMI );
roTeam1.push_back( ZOLI );
roTeam1.push_back( ULMAR );
roTeam1.push_back( BENCE );
roTeam1.push_back( AMBRUS );
roTeam1.push_back( DESCANT ); // Temporary assignment
roTeam1.push_back( UPI );
for ( int i=0; i<10; ++i )
{
int j = rand() % ( roTeam0.size() -1 );
int k = rand() % ( roTeam0.size() -1 );
FighterEnum enTemp;
enTemp = roTeam0[j]; roTeam0[j] = roTeam0[k]; roTeam0[k] = enTemp;
j = rand() % ( roTeam1.size() -1 );
k = rand() % ( roTeam1.size() -1 );
enTemp = roTeam1[j]; roTeam1[j] = roTeam1[k]; roTeam1[k] = enTemp;
}
}
else
{
g_oPlayerSelect.DoPlayerSelect();
}
if ( !IS_GAME_MODE ) break;
//sprintf( acReplayFile, "/tmp/msz%d.replay", ++iGameNumber );
int iGameResult = DoGame( NULL, false, bDebug );
//int iGameResult = DoGame( acReplayFile, false, bDebug );
//DoGame( acReplayFile, true, bDebug );
debug ( "iGameResult = %d\n", iGameResult );
if ( !IS_GAME_MODE ) break;
if ( iGameResult >= 0 && !bNetworkGame )
{
GameOver( iGameResult );
FighterStatsDemo oDemo( g_oPlayerSelect.GetPlayerInfo( iGameResult ).m_enFighter );
oDemo.Run();
}
if ( !IS_GAME_MODE ) break;
}
if ( bNetworkGame && !g_oState.m_bQuitFlag )
{
DrawTextMSZ( "Connection closed.", inkFont, 320, 210, AlignHCenter | UseShadow, C_WHITE, gamescreen );
DrawTextMSZ( g_poNetwork->GetLastError(), impactFont, 320, 250, AlignHCenter | UseShadow, C_WHITE, gamescreen );
SDL_Delay( 1000 );
GetKey( true );
}
if ( !g_oState.m_bQuitFlag )
{
Audio->PlayMusic( "DemoMusic" );
}
}
/**
The chat loop consists of:
\li DoOnlineChat
\li GameLoop (if a game was started
The loop ends if DoOnlineChat returns with a quit or disconnect
(not IN_NETWORK mode).
*/
void ChatLoop()
{
while (1)
{
DoOnlineChat();
if ( g_oState.m_bQuitFlag ||
SState::IN_CHAT != g_oState.m_enGameMode )
{
break;
}
if ( SState::IN_NETWORK == g_oState.m_enGameMode )
{
GameLoop();
}
if ( g_oState.m_bQuitFlag ) break;
g_oState.m_enGameMode = SState::IN_CHAT;
}
}
int main(int argc, char *argv[])
{
srand( (unsigned int)time(NULL) );
if ( 0 != init2() )
{
fprintf( stderr, "init2() failed." );
return -1;
}
g_oState.m_pcArgv0 = argv[0];
g_oState.Load();
CMortalNetwork::Create();
bDebug = false;
int i;
for ( i=1; i<argc; ++i )
{
if ( !strcmp(argv[i], "-debug") )
{
bDebug = true;
}
/*
else if ( !strcmp(argv[i], "-fullscreen") )
{
iFlags |= SDL_FULLSCREEN;
}
else if ( !strcmp(argv[i], "-hwsurface") )
{
iFlags |= SDL_HWSURFACE;
}
else if ( !strcmp(argv[i], "-doublebuf") )
{
iFlags |= SDL_DOUBLEBUF;
}
else if ( !strcmp(argv[i], "-anyformat") )
{
iFlags |= SDL_ANYFORMAT;
}
*/
else
{
// printf( "Usage: %s [-debug] [-fullscreen] [-hwsurface] [-doublebuf] [-anyformat]\n", argv[0] );
printf( "Usage: %s [-debug]\n", argv[0] );
return 0;
}
}
if (init()<0)
{
return -1;
}
InitJoystick();
g_oState.SetLanguage( g_oState.m_acLanguage );
new MszAudio;
// Audio->LoadMusic( "Last_Ninja_-_The_Wilderness.mid", "DemoMusic" );
Audio->LoadMusic( "ride.mod", "DemoMusic" );
Audio->PlayMusic( "DemoMusic" );
Audio->LoadMusic( "2nd_pm.s3m", "GameMusic" );
DrawMainScreen();
g_oPlayerSelect.SetPlayer( 0, ZOLI );
g_oPlayerSelect.SetPlayer( 1, ZOLI );
/*
{
int iGameNumber=0;
char acReplayFile[1024];
for ( i=0; i<15; ++i )
{
sprintf( acReplayFile, DATADIR "/msz%i.replay", i );
DrawTextMSZ( acReplayFile, impactFont, 10, 10, 0, C_WHITE, gamescreen );
SDL_Delay(5000 );
DoGame( acReplayFile, true, bDebug );
}
}
*/
/* while ( !g_oState.m_bQuitFlag )
{
g_oState.m_enGameMode = SState::IN_MULTI;
g_oState.m_bTeamMultiselect = false;
g_oState.m_iTeamSize = 3;
g_oState.m_enTeamMode = SState::Team_CUSTOM;
std::vector<FighterEnum>& roTeam0 = g_oPlayerSelect.EditPlayerInfo(0).m_aenTeam;
std::vector<FighterEnum>& roTeam1 = g_oPlayerSelect.EditPlayerInfo(1).m_aenTeam;
roTeam0.clear();
roTeam0.push_back( ZOLI );
roTeam0.push_back( SIRPI );
roTeam0.push_back( MACI );
roTeam1.clear();
roTeam1.push_back( UPI );
roTeam1.push_back( ZOLI );
roTeam1.push_back( ULMAR );
DoGame( NULL, false, false );
}
*/
while ( 1 )
{
if ( g_oState.m_bQuitFlag ) break;
switch ( g_oState.m_enGameMode )
{
case SState::IN_DEMO:
DoDemos();
continue;
case SState::IN_CHAT:
ChatLoop();
continue;
default:
GameLoop();
continue;
}
#if 0
// Remaining are game modes: IN_SINGLE, IN_MULTI, IN_NETWORK
Audio->PlaySample( "car_start.voc" );
Audio->PlayMusic( "GameMusic" );
bNetworkGame = false;
while ( g_oState.m_enGameMode != SState::IN_DEMO
&& g_oState.m_enGameMode != SState::IN_CHAT
&& !g_oState.m_bQuitFlag )
{
bNetworkGame = SState::IN_NETWORK == g_oState.m_enGameMode;
g_oPlayerSelect.DoPlayerSelect();
if ( g_oState.m_bQuitFlag || g_oState.m_enGameMode == SState::IN_DEMO ) break;
//sprintf( acReplayFile, "/tmp/msz%d.replay", ++iGameNumber );
int iGameResult = DoGame( NULL, false, bDebug );
//int iGameResult = DoGame( acReplayFile, false, bDebug );
//DoGame( acReplayFile, true, bDebug );
if ( g_oState.m_bQuitFlag || g_oState.m_enGameMode == SState::IN_DEMO ) break;
debug ( "iGameResult = %d\n", iGameResult );
if ( iGameResult >= 0 && !bNetworkGame )
{
GameOver( iGameResult );
FighterStatsDemo oDemo( g_oPlayerSelect.GetPlayerInfo( iGameResult ).m_enFighter );
oDemo.Run();
}
if ( g_oState.m_bQuitFlag || g_oState.m_enGameMode == SState::IN_DEMO ) break;
}
if ( bNetworkGame && !g_oState.m_bQuitFlag )
{
DrawTextMSZ( "Connection closed.", inkFont, 320, 210, AlignHCenter | UseShadow, C_WHITE, gamescreen );
DrawTextMSZ( g_poNetwork->GetLastError(), impactFont, 320, 250, AlignHCenter | UseShadow, C_WHITE, gamescreen );
SDL_Delay( 1000 );
GetKey( true );
}
if ( g_oState.m_bQuitFlag ) break;
Audio->PlayMusic( "DemoMusic" );
#endif
}
g_oState.Save();
SDL_Quit();
return EXIT_SUCCESS;
}
diff --git a/src/sge_tt_text.cpp b/src/sge_tt_text.cpp
index a17698e..350004b 100644
--- a/src/sge_tt_text.cpp
+++ b/src/sge_tt_text.cpp
@@ -1,1778 +1,1781 @@
/*
* SDL Graphics Extension
* Text/TrueType font functions
*
* Started 990815
*
* License: LGPL v2+ (see the file LICENSE)
* (c)1999-2001 Anders Lindstr?m
*
* Uses the excellent FreeType 2 library, available at:
* http://www.freetype.org/
*/
/*********************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
*********************************************************************/
/*
* Most of this code is taken from the SDL ttf lib by Sam Lantinga
* <slouken@devolution.com>
*/
#include "SDL.h"
#include <stdlib.h>
+//[segabor]
+#ifndef MACOSX
#include <malloc.h>
+#endif
#include <memory.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include "sge_surface.h"
#include "sge_primitives.h"
#include "sge_tt_text.h"
#ifndef _SGE_NOTTF
#include <ft2build.h>
#include <freetype/freetype.h>
#include <freetype/ftoutln.h>
#include <freetype/ttnameid.h>
/* The structure used to hold glyph information (cached) */
struct glyph {
int stored;
FT_UInt index;
//FT_Bitmap bitmap;
FT_Bitmap pixmap;
int minx;
int maxx;
int miny;
int maxy;
int yoffset;
int advance;
Uint16 cached;
};
/* the truetype font structure */
struct _sge_TTFont{
FT_Face face;
/* Font metrics */
int height;
int ascent;
int descent;
int lineskip;
/* The font style */
Uint8 style;
/* Extra width in glyph bounds for text styles */
int glyph_overhang;
float glyph_italics;
/* Information in the font for underlining */
int underline_offset;
int underline_height;
/* For now, support Latin-1 character set caching */
glyph *current;
glyph cache[256];
glyph scratch;
};
/* Macro to convert a character to a Unicode value -- assume already Unicode */
//Should really make a proper convert algorithm someday
#define UNICODE(c) c
/* FIXME: Right now we assume the gray-scale renderer Freetype is using
supports 256 shades of gray, but we should instead key off of num_grays
in the result FT_Bitmap after the FT_Render_Glyph() call. */
#define NUM_GRAYS 256
/* Handy routines for converting from fixed point */
#define FT_FLOOR(X) ((X & -64) / 64)
#define FT_CEIL(X) (((X + 63) & -64) / 64)
#define CACHED_METRICS 0x10
#define CACHED_BITMAP 0x01
#define CACHED_PIXMAP 0x02
/* The FreeType font engine/library */
static FT_Library _sge_library;
static int _sge_TTF_initialized = 0;
Uint8 _sge_TTF_AA=1; //Rendering mode: 0-OFF, 1-AA, 2-Alpha
/**********************************************************************************/
/** Open/misc font functions **/
/**********************************************************************************/
//==================================================================================
// Turns TTF AntiAliasing On/Off or alpha (nice but slow) (Default: On)
//==================================================================================
void sge_TTF_AAOff(void)
{
_sge_TTF_AA=0;
}
void sge_TTF_AAOn(void)
{
_sge_TTF_AA=1;
}
void sge_TTF_AA_Alpha(void)
{
_sge_TTF_AA=2;
}
//==================================================================================
// Closes the ttf engine, done by exit
//==================================================================================
void sge_TTF_Quit(void)
{
if ( _sge_TTF_initialized ) {
FT_Done_FreeType( _sge_library );
}
_sge_TTF_initialized = 0;
}
//==================================================================================
// Starts the ttf engine, must be called first
//==================================================================================
int sge_TTF_Init(void)
{
FT_Error error;
error = FT_Init_FreeType( &_sge_library );
if ( error ) {
SDL_SetError("SGE - Couldn't init FreeType engine");
return(-1);
} else {
_sge_TTF_initialized = 1;
}
atexit(sge_TTF_Quit); //dont't trust the user...
return(0);
}
//==================================================================================
// Some helper functions
//==================================================================================
void Flush_Glyph(glyph *glyph)
{
glyph->stored = 0;
glyph->index = 0;
//if( glyph->bitmap.buffer ) {
// free( glyph->bitmap.buffer );
// glyph->bitmap.buffer = 0;
//}
if( glyph->pixmap.buffer ) {
free( glyph->pixmap.buffer );
glyph->pixmap.buffer = 0;
}
glyph->cached = 0;
}
void Flush_Cache(sge_TTFont *font)
{
int i;
int size = sizeof( font->cache ) / sizeof( font->cache[0] );
for( i = 0; i < size; ++i ) {
if( font->cache[i].cached ) {
Flush_Glyph( &font->cache[i] );
}
}
if( font->scratch.cached ) {
Flush_Glyph( &font->scratch );
}
}
//==================================================================================
// Remove font from memory
//==================================================================================
void sge_TTF_CloseFont(sge_TTFont *font)
{
Flush_Cache( font );
FT_Done_Face( font->face );
free( font );
}
//==================================================================================
// Open the TT font file and returns the font with pt size
//==================================================================================
sge_TTFont *sge_TTF_OpenFont(const char *file, int ptsize)
{
sge_TTFont *font;
FT_Error error;
FT_Face face;
FT_Fixed scale;
font = (sge_TTFont *)malloc(sizeof(*font));
if ( font == NULL ) {
SDL_SetError("SGE - Out of memory");
return(NULL);
}
memset(font, 0, sizeof(*font));
/* Open the font and create ancillary data */
error = FT_New_Face( _sge_library, file, 0, &font->face );
if ( error ) {
sge_SetError("SGE - Couldn't load font file: %s",file);
free(font);
return(NULL);
}
face = font->face;
/* Make sure that our font face is scalable (global metrics) */
if ( ! FT_IS_SCALABLE(face) ) {
sge_SetError("SGE - Font face is not scalable: %s",file);
sge_TTF_CloseFont( font );
return NULL;
}
/* Set the character size and use 96 DPI */
error = FT_Set_Char_Size( font->face, 0, ptsize * 64, 96, 96 );
//error = FT_Set_Pixel_Sizes( font->face, 0, ptsize );
if( error ) {
sge_SetError("SGE - Couldn't set font size: %s",file);
sge_TTF_CloseFont( font );
return NULL;
}
/* Get the scalable font metrics for this font */
scale = face->size->metrics.y_scale;
font->ascent = FT_CEIL(FT_MulFix(face->bbox.yMax, scale));
font->descent = FT_CEIL(FT_MulFix(face->bbox.yMin, scale));
font->height = font->ascent - font->descent + /* baseline */ 1;
font->lineskip = FT_CEIL(FT_MulFix(face->height, scale));
font->underline_offset = FT_FLOOR(FT_MulFix(face->underline_position, scale));
font->underline_height = FT_FLOOR(FT_MulFix(face->underline_thickness, scale));
if ( font->underline_height < 1 ) {
font->underline_height = 1;
}
/* Set the default font style */
font->style = SGE_TTF_NORMAL;
font->glyph_overhang = face->size->metrics.y_ppem / 10;
/* x offset = cos(((90.0-12)/360)*2*M_PI), or 12 degree angle */
font->glyph_italics = 0.207f;
font->glyph_italics *= font->height;
return font;
}
//==================================================================================
// Load a glyph
//==================================================================================
FT_Error Load_Glyph(sge_TTFont *font, Uint16 ch, glyph *cached, int want )
{
FT_Face face;
FT_Error error;
FT_GlyphSlot glyph;
FT_Glyph_Metrics* metrics;
FT_Outline* outline;
//assert( font );
//assert( font->face );
face = font->face;
/* Load the glyph */
if ( ! cached->index ) {
cached->index = FT_Get_Char_Index( face, ch );
}
error = FT_Load_Glyph( face, cached->index, FT_LOAD_DEFAULT );
if( error ) {
return error;
}
/* Get our glyph shortcuts */
glyph = face->glyph;
metrics = &glyph->metrics;
outline = &glyph->outline;
/* Get the glyph metrics if desired */
if ( (want & CACHED_METRICS) && !(cached->stored & CACHED_METRICS) ) {
/* Get the bounding box */
cached->minx = FT_FLOOR(metrics->horiBearingX);
cached->maxx = cached->minx + FT_CEIL(metrics->width);
cached->maxy = FT_FLOOR(metrics->horiBearingY);
cached->miny = cached->maxy - FT_CEIL(metrics->height);
cached->yoffset = font->ascent - cached->maxy;
cached->advance = FT_CEIL(metrics->horiAdvance);
/* Adjust for bold and italic text */
if ( font->style & SGE_TTF_BOLD ) {
cached->maxx += font->glyph_overhang;
}
if ( font->style & SGE_TTF_ITALIC ) {
cached->maxx += (int)ceil(font->glyph_italics);
}
cached->stored |= CACHED_METRICS;
}
if ( ((want & CACHED_BITMAP) && !(cached->stored & CACHED_BITMAP)) ||
((want & CACHED_PIXMAP) && !(cached->stored & CACHED_PIXMAP)) ) {
//int mono = (want & CACHED_BITMAP);
int i;
FT_Bitmap* src;
FT_Bitmap* dst;
/* Handle the italic style */
if( font->style & SGE_TTF_ITALIC ) {
FT_Matrix shear;
shear.xx = 1 << 16;
shear.xy = (int) ( font->glyph_italics * ( 1 << 16 ) ) / font->height;
shear.yx = 0;
shear.yy = 1 << 16;
FT_Outline_Transform( outline, &shear );
}
/* Render the glyph */
//if ( mono ) {
// error = FT_Render_Glyph( glyph, ft_render_mode_mono );
//} else {
error = FT_Render_Glyph( glyph, ft_render_mode_normal );
//}
if( error ) {
return error;
}
/* Copy over information to cache */
src = &glyph->bitmap;
//if ( mono ) {
// dst = &cached->bitmap;
//} else {
dst = &cached->pixmap;
//}
memcpy( dst, src, sizeof( *dst ) );
//if ( mono ) {
// dst->pitch *= 8;
//}
/* Adjust for bold and italic text */
if( font->style & SGE_TTF_BOLD ) {
int bump = font->glyph_overhang;
dst->pitch += bump;
dst->width += bump;
}
if( font->style & SGE_TTF_ITALIC ) {
int bump = (int)ceil(font->glyph_italics);
dst->pitch += bump;
dst->width += bump;
}
dst->buffer = (unsigned char *)malloc( dst->pitch * dst->rows );
if( !dst->buffer ) {
return FT_Err_Out_Of_Memory;
}
memset( dst->buffer, 0, dst->pitch * dst->rows );
for( i = 0; i < src->rows; i++ ) {
int soffset = i * src->pitch;
int doffset = i * dst->pitch;
/*if ( mono ) {
unsigned char *srcp = src->buffer + soffset;
unsigned char *dstp = dst->buffer + doffset;
int j;
for ( j = 0; j < src->width; j += 8 ) {
unsigned char ch = *srcp++;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
ch <<= 1;
*dstp++ = (ch&0x80) >> 7;
}
} else {*/
memcpy(dst->buffer+doffset,
src->buffer+soffset, src->pitch);
//}
}
/* Handle the bold style */
if ( font->style & SGE_TTF_BOLD ) {
int row;
int col;
int offset;
int pixel;
Uint8* pixmap;
/* The pixmap is a little hard, we have to add and clamp */
for( row = dst->rows - 1; row >= 0; --row ) {
pixmap = (Uint8*) dst->buffer + row * dst->pitch;
for( offset=1; offset <= font->glyph_overhang; ++offset ) {
for( col = dst->width - 1; col > 0; --col ) {
pixel = (pixmap[col] + pixmap[col-1]);
if( pixel > NUM_GRAYS - 1 ) {
pixel = NUM_GRAYS - 1;
}
pixmap[col] = (Uint8) pixel;
}
}
}
}
/* Mark that we rendered this format */
//if ( mono ) {
// cached->stored |= CACHED_BITMAP;
//} else {
cached->stored |= CACHED_PIXMAP;
//}
}
/* We're done, mark this glyph cached */
cached->cached = ch;
return 0;
}
//==================================================================================
// Find glyph
//==================================================================================
FT_Error Find_Glyph(sge_TTFont *font, Uint16 ch, int want)
{
int retval = 0;
if( ch < 256 ) {
font->current = &font->cache[ch];
} else {
if ( font->scratch.cached != ch ) {
Flush_Glyph( &font->scratch );
}
font->current = &font->scratch;
}
if ( (font->current->stored & want) != want ) {
retval = Load_Glyph( font, ch, font->current, want );
}
return retval;
}
//==================================================================================
// Change the size of font
//==================================================================================
int sge_TTF_SetFontSize(sge_TTFont *font, int ptsize)
{
FT_Error error;
FT_Fixed scale;
FT_Face face;
/* Set the character size and use 96 DPI */
error = FT_Set_Char_Size( font->face, 0, ptsize * 64, 96, 96 );
//error = FT_Set_Pixel_Sizes( font->face, 0, ptsize );
if( error ) {
sge_SetError("SGE - Couldn't set font size");
sge_TTF_CloseFont( font );
return -1;
}
Flush_Cache(font);
face = font->face;
/* Get the scalable font metrics for this font */
scale = face->size->metrics.y_scale;
font->ascent = FT_CEIL(FT_MulFix(face->bbox.yMax, scale));
font->descent = FT_CEIL(FT_MulFix(face->bbox.yMin, scale));
font->height = font->ascent - font->descent + /* baseline */ 1;
font->lineskip = FT_CEIL(FT_MulFix(face->height, scale));
font->underline_offset = FT_FLOOR(FT_MulFix(face->underline_position, scale));
font->underline_height = FT_FLOOR(FT_MulFix(face->underline_thickness, scale));
if ( font->underline_height < 1 ) {
font->underline_height = 1;
}
/* Set the default font style */
//font->style = SGE_TTF_NORMAL;
font->glyph_overhang = face->size->metrics.y_ppem / 10;
/* x offset = cos(((90.0-12)/360)*2*M_PI), or 12 degree angle */
font->glyph_italics = 0.207f;
font->glyph_italics *= font->height;
return 0;
}
//==================================================================================
// Get font geometrics
//==================================================================================
int sge_TTF_FontHeight(sge_TTFont *font)
{
return(font->height);
}
int sge_TTF_FontAscent(sge_TTFont *font)
{
return(font->ascent);
}
int sge_TTF_FontDescent(sge_TTFont *font)
{
return(font->descent);
}
int sge_TTF_FontLineSkip(sge_TTFont *font)
{
return(font->lineskip);
}
int sge_TTF_GlyphMetrics(sge_TTFont *font, Uint16 ch, int* minx, int* maxx, int* miny, int* maxy, int* advance)
{
FT_Error error;
error = Find_Glyph(font, ch, CACHED_METRICS);
if ( error ) {
return -1;
}
if ( minx ) {
*minx = font->current->minx;
}
if ( maxx ) {
*maxx = font->current->maxx;
}
if ( miny ) {
*miny = font->current->miny;
}
if ( maxy ) {
*maxy = font->current->maxy;
}
if ( advance ) {
*advance = font->current->advance;
}
return 0;
}
//==================================================================================
// Set font style
//==================================================================================
void sge_TTF_SetFontStyle(sge_TTFont *font, Uint8 style)
{
font->style = style;
Flush_Cache(font);
}
//==================================================================================
// Get font style
//==================================================================================
Uint8 sge_TTF_GetFontStyle(sge_TTFont *font)
{
return(font->style);
}
#endif /* _SGE_NOTTF */
//==================================================================================
// Convert the Latin-1 text to UNICODE
//==================================================================================
Uint16 *ASCII_to_UNICODE(Uint16 *unicode, const char *text, int len)
{
int i;
for ( i=0; i < len; ++i ) {
unicode[i] = ((const unsigned char *)text)[i];
}
unicode[i] = 0;
return unicode;
}
Uint16 *sge_Latin1_Uni(const char *text)
{
Uint16 *unicode_text;
int i, unicode_len;
/* Copy the Latin-1 text to a UNICODE text buffer */
unicode_len = strlen(text);
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text));
if ( unicode_text == NULL ) {
SDL_SetError("SGE - Out of memory");
return(NULL);
}
for ( i=0; i < unicode_len; ++i ) {
unicode_text[i] = ((const unsigned char *)text)[i];
}
unicode_text[i] = 0;
return(unicode_text);
}
//==================================================================================
// Convert the UTF-8 text to UNICODE
//==================================================================================
Uint16 *UTF8_to_UNICODE(Uint16 *unicode, const char *utf8, int len)
{
int i, j;
Uint16 ch;
for ( i=0, j=0; i < len; ++i, ++j ) {
ch = ((const unsigned char *)utf8)[i];
if ( ch >= 0xF0 ) {
ch = (Uint16)(utf8[i]&0x07) << 18;
ch |= (Uint16)(utf8[++i]&0x3F) << 12;
ch |= (Uint16)(utf8[++i]&0x3F) << 6;
ch |= (Uint16)(utf8[++i]&0x3F);
} else
if ( ch >= 0xE0 ) {
ch = (Uint16)(utf8[i]&0x3F) << 12;
ch |= (Uint16)(utf8[++i]&0x3F) << 6;
ch |= (Uint16)(utf8[++i]&0x3F);
} else
if ( ch >= 0xC0 ) {
ch = (Uint16)(utf8[i]&0x3F) << 6;
ch |= (Uint16)(utf8[++i]&0x3F);
}
unicode[j] = ch;
}
unicode[j] = 0;
return unicode;
}
Uint16 *sge_UTF8_Uni(const char *text)
{
Uint16 *unicode_text;
int unicode_len;
/* Copy the UTF-8 text to a UNICODE text buffer */
unicode_len = strlen(text);
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text));
if ( unicode_text == NULL ) {
SDL_SetError("SGE - Out of memory");
return(NULL);
}
return UTF8_to_UNICODE(unicode_text, text, unicode_len);
}
#ifndef _SGE_NOTTF
//==================================================================================
// Get the width of the text with the given font
//==================================================================================
SDL_Rect sge_TTF_TextSizeUNI(sge_TTFont *font, const Uint16 *text)
{
SDL_Rect ret; ret.x=0; ret.y=0, ret.w=0, ret.h=0;
const Uint16 *ch;
int x, z;
int minx, maxx;
int miny, maxy;
glyph *glyph;
FT_Error error;
/* Initialize everything to 0 */
if ( ! _sge_TTF_initialized ) {
return ret;
}
minx = miny = 0;
maxx = maxy = 0;
/* Load each character and sum it's bounding box */
x= 0;
for ( ch=text; *ch; ++ch ) {
error = Find_Glyph(font, *ch, CACHED_METRICS);
if ( error ) {
return ret;
}
glyph = font->current;
z = x + glyph->minx;
if ( minx > z ) {
minx = z;
}
if ( font->style & SGE_TTF_BOLD ) {
x += font->glyph_overhang;
}
if ( glyph->advance > glyph->maxx ) {
z = x + glyph->advance;
} else {
z = x + glyph->maxx;
}
if ( maxx < z ) {
maxx = z;
}
x += glyph->advance;
if ( glyph->miny < miny ) {
miny = glyph->miny;
}
if ( glyph->maxy > maxy ) {
maxy = glyph->maxy;
}
}
/* Fill the bounds rectangle */
ret.w = (maxx - minx);
//ret.h = (maxy - miny); /* This is correct, but breaks many applications */
ret.h = font->height;
return ret;
}
SDL_Rect sge_TTF_TextSize(sge_TTFont *font, const char *text, int a_iMaxLength)
{
SDL_Rect ret; ret.x=ret.y=ret.w=ret.y=0;
Uint16 *unicode_text;
int unicode_len;
/* Copy the Latin-1 text to a UNICODE text buffer */
unicode_len = strlen(text);
if ( unicode_len > a_iMaxLength
&& a_iMaxLength>=0 )
{
unicode_len = a_iMaxLength;
}
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text));
if ( unicode_text == NULL ) {
SDL_SetError("SGE - Out of memory");
return ret;
}
ASCII_to_UNICODE( unicode_text, text, unicode_len );
/* Render the new text */
ret = sge_TTF_TextSizeUNI(font, unicode_text);
/* Free the text buffer and return */
free(unicode_text);
return ret;
}
/**********************************************************************************/
/** TTF output functions **/
/**********************************************************************************/
//==================================================================================
// TT Render (unicode)
// Returns an 8bit or 32bit(8/8/8/8-alpha) surface with TT text
//==================================================================================
SDL_Surface *sge_TTF_RenderUNICODE(sge_TTFont *font,const Uint16 *text, SDL_Color fg, SDL_Color bg)
{
int xstart, width;
int w, h;
SDL_Surface *textbuf;
SDL_Palette *palette;
int index;
int rdiff, gdiff, bdiff;
const Uint16 *ch;
Uint8 *src, *dst;
Uint32 *dst32;
Uint32 alpha=0;
Uint32 pixel=0;
Uint32 Rmask=0, Gmask=0, Bmask=0, Amask=0;
int row, col;
FT_Error error;
/* Get the dimensions of the text surface */
SDL_Rect ret=sge_TTF_TextSizeUNI(font, text);
w=ret.w; h=ret.h;
if ( !w ) {
SDL_SetError("SGE - Text has zero width");
return(NULL);
}
/* Create the target surface */
width = w;
if(_sge_TTF_AA!=2) /* Allocate an 8-bit pixmap */
textbuf = SDL_AllocSurface(SDL_SWSURFACE, w, h, 8, 0, 0, 0, 0);
else{ /* Allocate an 32-bit alpha pixmap */
if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
Rmask = 0x000000FF;
Gmask = 0x0000FF00;
Bmask = 0x00FF0000;
Amask = 0xFF000000;
} else {
Rmask = 0xFF000000;
Gmask = 0x00FF0000;
Bmask = 0x0000FF00;
Amask = 0x000000FF;
}
textbuf = SDL_AllocSurface(SDL_SWSURFACE, w, h, 32, Rmask, Gmask, Bmask, Amask);
}
if ( textbuf == NULL ) {
SDL_SetError("SGE - Out of memory");
return(NULL);
}
/* Setup our colors */
switch(_sge_TTF_AA){
case 0:{ /* No fancy antialiasing or alpha component */
palette = textbuf->format->palette;
palette->colors[0].r = bg.r;
palette->colors[0].g = bg.g;
palette->colors[0].b = bg.b;
palette->colors[1].r = fg.r;
palette->colors[1].g = fg.g;
palette->colors[1].b = fg.b;
}
break;
case 1:{ /* Fill the palette with NUM_GRAYS levels of shading from bg to fg */
palette = textbuf->format->palette;
rdiff = fg.r - bg.r;
gdiff = fg.g - bg.g;
bdiff = fg.b - bg.b;
for ( index=0; index< NUM_GRAYS; ++index ) {
palette->colors[index].r = bg.r + (index*rdiff)/(NUM_GRAYS-1);
palette->colors[index].g = bg.g + (index*gdiff)/(NUM_GRAYS-1);
palette->colors[index].b = bg.b + (index*bdiff)/(NUM_GRAYS-1);
}
}
break;
case 2:{ /* Alpha component magic */
sge_ClearSurface(textbuf, SDL_MapRGBA(textbuf->format, bg.r,bg.g,bg.b,SDL_ALPHA_TRANSPARENT));
//pixel = (fg.r<<16)|(fg.g<<8)|fg.b;
pixel = (fg.b<<16)|(fg.g<<8)|fg.r;
}
break;
}
/* Load and render each character */
xstart = 0;
for ( ch=text; *ch; ++ch ) {
error = Find_Glyph(font, *ch, CACHED_METRICS|CACHED_PIXMAP);
if ( ! error ) {
w = font->current->pixmap.width;
src = (Uint8 *)font->current->pixmap.buffer;
for ( row = 0; row < font->current->pixmap.rows; ++row ) {
dst = (Uint8 *)textbuf->pixels + (row + font->current->yoffset)* textbuf->pitch + xstart + font->current->minx;
switch(_sge_TTF_AA){
case 0:{ /* Normal */
src = font->current->pixmap.buffer + row * font->current->pixmap.pitch;
for ( col=w; col>0; --col ) {
*dst++ |= (*src++<NUM_GRAYS/2)? 0:1;
}
}
break;
case 1:{ /* Antialiasing */
src = font->current->pixmap.buffer + row * font->current->pixmap.pitch;
for ( col=w; col>0; --col ) {
*dst++ |= *src++;
}
}
break;
case 2:{ /* Alpha */
dst32 = (Uint32 *)textbuf->pixels + (row + font->current->yoffset)* textbuf->pitch/4 + xstart + font->current->minx;
for ( col=w; col>0; --col ) {
alpha = *src++;
*dst32++ |= pixel | (alpha << 24);
}
}
break;
}
}
xstart += font->current->advance;
if ( font->style & SGE_TTF_BOLD ) {
xstart += font->glyph_overhang;
}
}
}
/* Handle the underline style */
if ( font->style & SGE_TTF_UNDERLINE ) {
int row_offset;
row_offset = font->ascent - font->underline_offset - 1;
if ( row_offset > textbuf->h ) {
row_offset = (textbuf->h-1) - font->underline_height;
}
if(_sge_TTF_AA==0){
dst = (Uint8 *)textbuf->pixels + row_offset * textbuf->pitch;
for ( row=font->underline_height; row>0; --row ) {
memset(dst, 1, textbuf->w );
dst += textbuf->pitch;
}
}else if(_sge_TTF_AA==1){
dst = (Uint8 *)textbuf->pixels + row_offset * textbuf->pitch;
for ( row=font->underline_height; row>0; --row ) {
memset(dst, NUM_GRAYS - 1, textbuf->w );
dst += textbuf->pitch;
}
}else{
pixel |= Amask;
dst32 = (Uint32 *)textbuf->pixels+row_offset*textbuf->pitch/4;
for ( row=font->underline_height; row>0; --row ) {
for ( col=0; col < textbuf->w; ++col ) {
dst32[col] = pixel;
}
dst32 += textbuf->pitch/4;
}
}
}
return(textbuf);
}
//==================================================================================
// Renders the Unicode string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (255-solid, 0-max).
//==================================================================================
SDL_Rect sge_tt_textout_UNI(SDL_Surface *Surface, sge_TTFont *font, const Uint16 *uni, Sint16 x, Sint16 y, Uint32 fcolor, Uint32 bcolor, int Alpha)
{
SDL_Rect ret; ret.x=0; ret.y=0; ret.w=0; ret.h=0;
SDL_Color temp;
SDL_Surface *text;
text=sge_TTF_RenderUNICODE(font,uni,sge_GetRGB(Surface,fcolor),sge_GetRGB(Surface,bcolor));
if(text==NULL){return ret;}
/* Align the surface text to the baseline */
Uint16 ascent=font->ascent;
temp=sge_GetRGB(Surface,bcolor);
sge_BlitTransparent(text,Surface,0,0,x,y-ascent,text->w,text->h,SDL_MapRGB(text->format,temp.r,temp.g,temp.b),Alpha);
sge_UpdateRect(Surface,x,y-ascent,text->w,text->h);
ret.x=x; ret.y=y-ascent; ret.w=text->w; ret.h=text->h;
SDL_FreeSurface(text);
return ret;
}
//==================================================================================
// Renders the Unicode string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (0-solid, 255-max). (RGB)
//==================================================================================
SDL_Rect sge_tt_textout_UNI(SDL_Surface *Surface, sge_TTFont *font, const Uint16 *uni, Sint16 x, Sint16 y, Uint8 fR, Uint8 fG, Uint8 fB, Uint8 bR, Uint8 bG, Uint8 bB, int Alpha)
{
SDL_Rect ret; ret.x=0; ret.y=0; ret.w=0; ret.h=0;
SDL_Surface *text;
text=sge_TTF_RenderUNICODE(font,uni,sge_FillPaletteEntry(fR,fG,fB),sge_FillPaletteEntry(bR,bG,bB));
if(text==NULL){return ret;}
/* Align the surface text to the baseline */
Uint16 ascent=font->ascent;
sge_BlitTransparent(text,Surface,0,0,x,y-ascent,text->w,text->h,SDL_MapRGB(text->format,bR,bG,bB),Alpha);
sge_UpdateRect(Surface,x,y-ascent,text->w,text->h);
ret.x=x; ret.y=y-ascent; ret.w=text->w; ret.h=text->h;
SDL_FreeSurface(text);
return ret;
}
//==================================================================================
// Renders the Latin-1 string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (0-solid, 255-max).
//==================================================================================
SDL_Rect sge_tt_textout(SDL_Surface *Surface, sge_TTFont *font, const char *string, Sint16 x, Sint16 y, Uint32 fcolor, Uint32 bcolor, int Alpha)
{
SDL_Rect ret;
Uint16 *uni;
uni=sge_Latin1_Uni(string);
ret=sge_tt_textout_UNI(Surface,font,uni,x,y,fcolor,bcolor,Alpha);
free(uni);
return ret;
}
//==================================================================================
// Renders the Latin-1 string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (0-solid, 255-max). (RGB)
//==================================================================================
SDL_Rect sge_tt_textout(SDL_Surface *Surface, sge_TTFont *font, const char *string, Sint16 x, Sint16 y, Uint8 fR, Uint8 fG, Uint8 fB, Uint8 bR, Uint8 bG, Uint8 bB, int Alpha)
{
SDL_Rect ret;
Uint16 *uni;
uni=sge_Latin1_Uni(string);
ret=sge_tt_textout_UNI(Surface,font,uni,x,y, fR,fG,fB, bR,bG,bB, Alpha);
free(uni);
return ret;
}
//==================================================================================
// Renders the UTF-8 string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (0-solid, 255-max).
//==================================================================================
SDL_Rect sge_tt_textout_UTF8(SDL_Surface *Surface, sge_TTFont *font, const char *string, Sint16 x, Sint16 y, Uint32 fcolor, Uint32 bcolor, int Alpha)
{
SDL_Rect ret;
Uint16 *uni;
uni=sge_UTF8_Uni(string);
ret=sge_tt_textout_UNI(Surface,font,uni,x,y,fcolor,bcolor,Alpha);
free(uni);
return ret;
}
//==================================================================================
// Renders the UTF-8 string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (0-solid, 255-max). (RGB)
//==================================================================================
SDL_Rect sge_tt_textout_UTF8(SDL_Surface *Surface, sge_TTFont *font, const char *string, Sint16 x, Sint16 y, Uint8 fR, Uint8 fG, Uint8 fB, Uint8 bR, Uint8 bG, Uint8 bB, int Alpha)
{
SDL_Rect ret;
Uint16 *uni;
uni=sge_UTF8_Uni(string);
ret=sge_tt_textout_UNI(Surface,font,uni,x,y, fR,fG,fB, bR,bG,bB, Alpha);
free(uni);
return ret;
}
//==================================================================================
// Renders the formatet Latin-1 string to TrueType on surface, with the color fcolor.
// bcolor is the target color for the antialiasing.
// Alpha sets the transparency of the text (0-solid, 255-max). (RGB ONLY)
// * just like printf(char *format,...) *
//==================================================================================
SDL_Rect sge_tt_textoutf(SDL_Surface *Surface, sge_TTFont *font, Sint16 x, Sint16 y, Uint8 fR, Uint8 fG, Uint8 fB, Uint8 bR, Uint8 bG, Uint8 bB, int Alpha ,const char *format,...)
{
char buf[256];
va_list ap;
#ifdef __WIN32__
va_start((va_list*)ap, format); //Stupid win32 crosscompiler
#else
va_start(ap, format);
#endif
vsprintf(buf, format, ap);
va_end(ap);
return sge_tt_textout(Surface, font, buf, x,y, fR,fG,fB, bR,bG,bB, Alpha);
}
/**********************************************************************************/
/** TTF 'input' functions **/
/**********************************************************************************/
// First some internel functions for TTF input
//==================================================================================
// Fast update function for TTF input
//
// type=0 - in ret smaller then out ret
// type=1 - in ret bigger then out ret
// type=3 - safe
//==================================================================================
SDL_Rect fast_update(SDL_Surface *Surface,SDL_Surface *buffer,SDL_Rect ret, int type,sge_TTFont *font,Uint16 *string, Sint16 x,Sint16 y, Uint32 fcol, Uint32 bcol,int Alpha)
{
if(type==0){
sge_Update_OFF();
sge_FilledRect(Surface, ret.x, ret.y, ret.x+ret.w, ret.y+ret.h, bcol);
ret=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, 0);
sge_Update_ON();
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
}
else if(type==1){
SDL_Rect temp;
sge_Update_OFF();
sge_FilledRect(Surface, ret.x, ret.y, ret.x+ret.w, ret.y+ret.h, bcol);
temp=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, 0);
sge_Update_ON();
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
ret=temp;
}
else{
SDL_Rect temp;
sge_Update_OFF();
sge_FilledRect(Surface, ret.x, ret.y, ret.x+ret.w, ret.y+ret.h, bcol);
temp=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, 0);
sge_Update_ON();
if(ret.w>=temp.w){
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
}
else{
sge_UpdateRect(Surface, temp.x, temp.y, temp.w, temp.h);
}
ret=temp;
}
return ret;
}
//==================================================================================
// Update function for TTF input that preserve background
//
// type=0 - in ret smaller then out ret
// type=1 - in ret bigger then out ret
// type=3 - safe
//==================================================================================
SDL_Rect nice_update(SDL_Surface *Surface,SDL_Surface *buffer,SDL_Rect ret, int type,sge_TTFont *font,Uint16 *string, Sint16 x,Sint16 y, Uint32 fcol, Uint32 bcol, int Alpha)
{
if(type==0){
sge_Update_OFF();
sge_Blit(buffer,Surface, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
ret=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, Alpha);
sge_Update_ON();
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
}
else if(type==1){
SDL_Rect temp;
sge_Update_OFF();
sge_Blit(buffer,Surface, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
temp=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, Alpha);
sge_Update_ON();
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
ret=temp;
}
else{
SDL_Rect temp;
sge_Update_OFF();
sge_Blit(buffer,Surface, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
temp=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, Alpha);
sge_Update_ON();
if(ret.w>=temp.w){
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
}
else{
sge_UpdateRect(Surface, temp.x, temp.y, temp.w, temp.h);
}
ret=temp;
}
return ret;
}
#endif /* _SGE_NOTTF */
//==================================================================================
// Handle keyrepeats
//==================================================================================
int keyrepeat(SDL_Event *event, int wait)
{
int keydown=1,c=0,ret=0;
SDL_Event ev;
do{
if(SDL_PollEvent(&ev)==1){
if(ev.type==SDL_QUIT){ret=-1;keydown=0;}
if(ev.type==SDL_KEYUP || ev.type==SDL_KEYDOWN){ //Keyrepeat cancelled
keydown=0;
if(ev.type==SDL_KEYDOWN){
SDL_PeepEvents(&ev,1, SDL_ADDEVENT, 0); //Return the newly pressed key to the event queue
}
}
}
SDL_Delay(10);
c++;
if(c>wait && keydown==1){ //trigers keyrepeat
ret=1;
SDL_PeepEvents(event,1, SDL_ADDEVENT, 0); //Return the old key to the event queue
keydown=0;
}
}while(keydown==1);
return ret;
}
//==================================================================================
// Insert a element
//==================================================================================
void insert_char(Uint16 *string, Uint16 ch, int pos, int max)
{
if(pos>max || pos<0){return;}
else if(pos==max){string[pos]=ch;}
else{
for(int i=max; i>=pos; i--){
string[i+1]=string[i];
}
string[pos]=ch;
}
}
//==================================================================================
// Delete a element
//==================================================================================
void delete_char(Uint16 *string, int pos, int max)
{
if(pos>max || pos<0){return;}
else if(pos==max){string[pos]=0;}
else{
for(int i=pos; i<=max-1; i++){
string[i]=string[i+1];
}
string[max]=0;
}
}
#ifndef _SGE_NOTTF
// These functions handle keyboard input and shows the result on screen. The text
// can be edited with [Backspace], [Delete], [Left arrow] and [Right arrow].
// Text input is terminated when [Return] or [Enter] is pressed, or if a quit event
// is recived.
// The sge_tt_input functions puts the result in 'string'.
//
// Flags: SGE_IBG - Keeps background, else bye bye background
// SGE_IDEL - Delete text on exit
// SGE_INOKR - No keyrepeat
// (use OR | to give more than one)
//
// If you want a 'default' text you can copy it to string before call and set pos to
// the first empty element in string - ex. "Hello" => pos=5. If not - zero.
// len is the max numbers of chars editable - ex. if you set the default text to "100"
// and only want 3 digits out, set len to 3. string should have atleast len+1 elements
// allocated
// This is *not* a fast, optimized function - but it gets the job done...
// Return:
// Zero or above - the lenght of the string
// -1 recieved a quit event (the lenght is lost)
// -2 invalid indata
// -3 out of memory
//==================================================================================
// Text input UNICODE (the core)
//==================================================================================
int sge_tt_input_UNI(SDL_Surface *screen,sge_TTFont *font,Uint16 *string, Uint8 flags, int pos,int len,Sint16 x,Sint16 y, Uint32 fcol, Uint32 bcol, int Alpha)
{
if(len<pos || pos<0 || len<0){return -2;}
Uint16 cur=124;//The charactar for the cursor - '|'
int max; //The strings size
/* Set update function */
SDL_Rect (*_update)(SDL_Surface *screen,SDL_Surface *buffer,SDL_Rect ret, int type,sge_TTFont *font,Uint16 *string, Sint16 x,Sint16 y, Uint32 fcol, Uint32 bcol, int Alpha);
SDL_Surface *buffer;
if(flags&SGE_FLAG1){ /* Keep background? */
_update=nice_update;
buffer=SDL_DisplayFormat(screen); /* Fixme: Yum! Memory! */
if(buffer==NULL){SDL_SetError("SGE - Out of memory");return -3;}
}
else{ /* nope */
_update=fast_update;
buffer=NULL;
Alpha=0;
}
SDL_Rect ret;
max=pos;
string[pos+1]=0;
SDL_EnableUNICODE(1);
/* Init cursor */
string[pos]=cur;
ret=sge_tt_textout_UNI(screen,font,string, x,y, fcol, bcol, Alpha);
SDL_Event event;
int quit=0;
do{
/* Check events */
SDL_WaitEvent(&event);
if(event.type==SDL_QUIT){quit=-1;}
else if(event.type==SDL_KEYDOWN && event.key.keysym.sym==SDLK_ESCAPE){quit=1;}
else if(event.type==SDL_KEYDOWN && (event.key.keysym.sym==SDLK_RETURN || event.key.keysym.sym==SDLK_KP_ENTER)){quit=1;}
else if(event.type==SDL_KEYDOWN && event.key.keysym.sym==SDLK_BACKSPACE){
if(pos>0){
/* Delete char cursor-1 */
delete_char(string,pos-1,max); pos--; max--;
ret=_update(screen,buffer,ret,1,font,string, x,y, fcol, bcol, Alpha);
/* Handle keyrepeat */
if(!(flags&SGE_FLAG3))
if(keyrepeat(&event, 20)==-1){quit=-1;}
}
}
else if(event.type==SDL_KEYDOWN && event.key.keysym.sym==SDLK_RIGHT){
if(pos!=max && pos!=len){
/* Move cursor right */
delete_char(string,pos,max);pos++;
insert_char(string,cur,pos,max);
ret=_update(screen,buffer,ret,3,font,string, x,y, fcol, bcol, Alpha);
/* Handle keyrepeat */
if(!(flags&SGE_FLAG3))
if(keyrepeat(&event, 20)==-1){quit=-1;}
}
}
else if(event.type==SDL_KEYDOWN && event.key.keysym.sym==SDLK_LEFT){
if(pos>0){
/* Move cursor left */
delete_char(string,pos,max);pos--;
insert_char(string,cur,pos,max);
ret=_update(screen,buffer,ret,3,font,string, x,y, fcol, bcol, Alpha);
/* Handle keyrepeat */
if(!(flags&SGE_FLAG3))
if(keyrepeat(&event, 20)==-1){quit=-1;}
}
}
else if(event.type==SDL_KEYDOWN && event.key.keysym.sym==SDLK_DELETE){
/* Delete char cursor+1 */
if(pos!=max && pos!=len){
delete_char(string,pos+1,max);max--;
ret=_update(screen,buffer,ret,1,font,string, x,y, fcol, bcol, Alpha);
/* Handle keyrepeat */
if(!(flags&SGE_FLAG3))
if(keyrepeat(&event, 20)==-1){quit=-1;}
}
}
else if(event.type==SDL_KEYDOWN && event.key.keysym.unicode!=0){
/* Insert new char */
if(max!=len){
max++;
insert_char(string, event.key.keysym.unicode, pos,max); pos++;
ret=_update(screen,buffer,ret,0,font,string, x,y, fcol, bcol, Alpha);
/* Handle keyrepeat */
if(!(flags&SGE_FLAG3))
if(keyrepeat(&event, 40)==-1){quit=-1;}
}
}
}while(quit==0);
/* Remove the cursor from string */
delete_char(string,pos,max);
if(flags&SGE_FLAG2){ //Remove the text
if(flags&SGE_FLAG1){
sge_Blit(buffer,screen, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
sge_UpdateRect(screen, ret.x, ret.y, ret.w, ret.h);
}
else{
sge_FilledRect(screen,ret.x, ret.y, ret.x+ret.w, ret.y+ret.h,bcol);
}
}
else{ //Draw text without cursor
ret=_update(screen,buffer,ret,1,font,string, x,y, fcol, bcol, Alpha);
}
if(flags&SGE_FLAG1){SDL_FreeSurface(buffer);}
if(quit==-1){return -1;} //Waaa! The user killed me!
return max;
}
CReadline::CReadline( SDL_Surface *a_poScreen, sge_TTFont *a_poFont,
char *a_pcString, int a_iPos, int a_iLen,
int a_x, int a_y, int a_w, Uint32 a_iFCol, Uint32 a_iBCol, int a_iAlpha )
{
m_iResult = 0;
m_poScreen = a_poScreen;
m_poFont = a_poFont;
m_piString = 0;
m_iLen = -1;
w = a_w;
x = a_x;
y = a_y;
SDL_EnableUNICODE(1);
// Create background copy.
m_oWorkArea.x = x;
m_oWorkArea.y = y - sge_TTF_FontAscent(m_poFont);
m_oWorkArea.w = w;
m_oWorkArea.h = sge_TTF_FontHeight(a_poFont);
m_poBackground = sge_copy_surface( a_poScreen, m_oWorkArea.x, m_oWorkArea.y, m_oWorkArea.w, m_oWorkArea.h );
Restart( a_pcString, a_iPos, a_iLen, a_iFCol, a_iBCol, a_iAlpha );
}
void CReadline::Restart( char *a_pcString, int a_iPos, int a_iLen,
Uint32 a_iFCol, Uint32 a_iBCol, int a_iAlpha )
{
if ( NULL == m_piString
|| m_iLen <= a_iLen )
{
if ( m_piString ) delete[] m_piString;
m_iLen = a_iLen;
m_piString = new Uint16[a_iLen+2];
}
m_iResult = 0;
m_pcLatin1String = a_pcString;
m_iPos = a_iPos;
m_iFCol = a_iFCol;
m_iBCol = a_iBCol;
m_iAlpha = a_iAlpha;
// Convert the original string into an unicode string
int i;
for(i=0; i<m_iPos; i++)
{
m_piString[i]=(unsigned char)m_pcLatin1String[i];
}
m_piString[m_iPos]=0;
// Insert the cursor at the end
m_iCursor = 124; // '|' character
m_iMax=m_iPos;
m_piString[m_iPos+1]=0;
m_piString[m_iPos]=m_iCursor;
Redraw();
SDL_EnableKeyRepeat( SDL_DEFAULT_REPEAT_DELAY/2, SDL_DEFAULT_REPEAT_INTERVAL/2 );
}
CReadline::~CReadline()
{
delete[] m_piString;
SDL_FreeSurface( m_poBackground );
m_poBackground = NULL;
SDL_EnableKeyRepeat( 0, 0 );
}
/** Returns the current state of the line input.
\retval -1 A quit event was encountered.
\retval -2 Escape was pressed
\retval 0 Input is in progress.
\retval 1 Input has finished.
*/
int CReadline::GetResult()
{
if ( m_iResult == 0 )
{
return m_iResult;
}
SDL_EnableKeyRepeat( 0, 0 );
sge_Blit( m_poBackground, m_poScreen, m_oUpdateRect.x, m_oUpdateRect.y,
m_oUpdateRect.x, m_oUpdateRect.y, m_oUpdateRect.w, m_oUpdateRect.h);
sge_UpdateRect(m_poScreen, m_oUpdateRect.x, m_oUpdateRect.y, m_oUpdateRect.w, m_oUpdateRect.h);
if ( m_iResult < 0 )
{
return m_iResult;
}
delete_char( m_piString, m_iPos, m_iMax );
memset( m_pcLatin1String, 0, sizeof(char)*(m_iPos+1) );
for( int i=0; i<=m_iMax; i++)
{
m_pcLatin1String[i] = (char)m_piString[i];
}
insert_char( m_piString, m_iCursor, m_iPos, m_iMax );
return 1;
}
/** Internal method for redrawing the string. */
void CReadline::Update( int a_iCode )
{
//m_oUpdateRect = nice_update( m_poScreen, m_poBackground, m_oUpdateRect, a_iCode, m_poFont, m_piString,
// x, y, m_iFCol, m_iBCol, m_iAlpha );
SDL_Rect oOldClipRect;
SDL_GetClipRect( m_poScreen, &oOldClipRect );
SDL_SetClipRect( m_poScreen, &m_oWorkArea );
sge_Blit( m_poBackground, m_poScreen, 0, 0, m_oWorkArea.x, m_oWorkArea.y, m_oWorkArea.w, m_oWorkArea.h );
sge_tt_textout_UNI( m_poScreen, m_poFont, m_piString, x, y, m_iFCol, m_iBCol, m_iAlpha );
sge_UpdateRect( m_poScreen, m_oWorkArea.x, m_oWorkArea.y, m_oWorkArea.w, m_oWorkArea.h );
SDL_SetClipRect( m_poScreen, &oOldClipRect );
}
void CReadline::Redraw()
{
m_oUpdateRect = sge_tt_textout_UNI( m_poScreen, m_poFont, m_piString, x, y, m_iFCol, m_iBCol, m_iAlpha );
sge_UpdateRect( m_poScreen, m_oWorkArea.x, m_oWorkArea.y, m_oWorkArea.w, m_oWorkArea.h );
}
void CReadline::Clear()
{
sge_Blit( m_poBackground, m_poScreen, 0, 0, m_oWorkArea.x, m_oWorkArea.y, m_oWorkArea.w, m_oWorkArea.h );
}
/** Runs the event queue until the input is finished.
\see GetResult
*/
int CReadline::Execute()
{
int iRetval;
SDL_Event e;
while ( 1 )
{
SDL_WaitEvent( &e );
HandleKeyEvent( e );
iRetval = GetResult();
if ( iRetval )
break;
}
return iRetval;
}
void CReadline::HandleKeyEvent( SDL_Event& a_roEvent )
{
if(a_roEvent.type==SDL_QUIT)
{
m_iResult = -1;
return;
}
if ( a_roEvent.type != SDL_KEYDOWN )
{
return;
}
if( a_roEvent.key.keysym.sym==SDLK_ESCAPE )
{
m_iResult = -2;
return;
}
if ( a_roEvent.key.keysym.sym==SDLK_RETURN
|| a_roEvent.key.keysym.sym==SDLK_KP_ENTER )
{
m_iResult = 1;
return;
}
if( a_roEvent.key.keysym.sym==SDLK_BACKSPACE )
{
if ( m_iPos == 0 )
{
return;
}
/* Delete char cursor-1 */
delete_char(m_piString,m_iPos-1,m_iMax);
m_iPos--;
m_iMax--;
Update( 1 );
return;
}
if( a_roEvent.key.keysym.sym==SDLK_RIGHT
&& m_iPos!=m_iMax && m_iPos!=m_iLen )
{
/* Move cursor right */
delete_char(m_piString,m_iPos,m_iMax);
m_iPos++;
insert_char(m_piString,m_iCursor,m_iPos,m_iMax);
Update( 3 );
return;
}
if ( a_roEvent.key.keysym.sym==SDLK_LEFT
&& m_iPos>0 )
{
/* Move cursor left */
delete_char(m_piString,m_iPos,m_iMax);
m_iPos--;
insert_char(m_piString,m_iCursor,m_iPos,m_iMax);
Update( 3 );
return;
}
if( a_roEvent.key.keysym.sym==SDLK_DELETE )
{
if ( m_iPos!=m_iMax && m_iPos!=m_iLen )
{
delete_char(m_piString,m_iPos+1,m_iMax);
m_iMax--;
Update( 1 );
}
return;
}
if( a_roEvent.key.keysym.unicode!=0
&& a_roEvent.key.keysym.unicode >=32
&& a_roEvent.key.keysym.unicode <=255
&& m_iMax != m_iLen )
{
m_iMax++;
insert_char(m_piString, a_roEvent.key.keysym.unicode, m_iPos, m_iMax);
m_iPos++;
Update( 0 );
}
}
/*
SDL_Rect CReadline::NiceUpdate( SDL_Surface *Surface,SDL_Surface *buffer,
SDL_Rect ret, int type,sge_TTFont *font,Uint16 *string, Sint16 x,Sint16 y,
Uint32 fcol, Uint32 bcol, int Alpha )
{
if(type==0){
sge_Update_OFF();
sge_Blit(buffer,Surface, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
ret=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, Alpha);
sge_Update_ON();
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
}
else if(type==1){
SDL_Rect temp;
sge_Update_OFF();
sge_Blit(buffer,Surface, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
temp=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, Alpha);
sge_Update_ON();
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
ret=temp;
}
else{
SDL_Rect temp;
sge_Update_OFF();
sge_Blit(buffer,Surface, ret.x, ret.y, ret.x, ret.y, ret.w, ret.h);
temp=sge_tt_textout_UNI(Surface,font,string, x,y, fcol, bcol, Alpha);
sge_Update_ON();
if(ret.w>=temp.w){
sge_UpdateRect(Surface, ret.x, ret.y, ret.w, ret.h);
}
else{
sge_UpdateRect(Surface, temp.x, temp.y, temp.w, temp.h);
}
ret=temp;
}
return ret;
}
*/
//==================================================================================
// Text input UNICODE (RGB)
//==================================================================================
int sge_tt_input_UNI(SDL_Surface *screen,sge_TTFont *font,Uint16 *string,Uint8 flags, int pos,int len,Sint16 x,Sint16 y, Uint8 fR, Uint8 fG, Uint8 fB, Uint8 bR,Uint8 bG,Uint8 bB, int Alpha)
{
return sge_tt_input_UNI(screen,font,string,flags,pos,len,x,y,SDL_MapRGB(screen->format, fR,fG,fB),SDL_MapRGB(screen->format, bR,bG,bB),Alpha);
}
//==================================================================================
// Text input Latin1
//
// Will fail miserable if ret<0!
//==================================================================================
int sge_tt_input(SDL_Surface *screen,sge_TTFont *font,char *string,Uint8 flags, int pos,int len,Sint16 x,Sint16 y, Uint32 fcol, Uint32 bcol, int Alpha)
{
if(len<pos || pos<0 || len<0){return -2;}
#ifndef __GNUC__
Uint16 *uni=new Uint16[len+2]; //ANSI C++
#else
Uint16 uni[len+2];
#endif
int ret;
int i;
if(pos!=0){
for(i=0; i<pos; i++){ //Convert Latin1 => Uni
uni[i]=(unsigned char)string[i];
}
}
uni[pos]=0;
ret=sge_tt_input_UNI(screen,font,uni,flags,pos,len,x,y,fcol,bcol,Alpha);
memset(string,0,sizeof(char)*(pos+1));
if(ret>0){
for( i=0; i<=ret; i++){ //Convert Uni => Latin1
string[i] = (char)uni[i];
}
}
#ifndef __GNUC__
delete[] uni;
#endif
return ret;
}
//==================================================================================
// Text input Latin1 (RGB)
//==================================================================================
int sge_tt_input(SDL_Surface *screen,sge_TTFont *font,char *string,Uint8 flags, int pos,int len,Sint16 x,Sint16 y, Uint8 fR, Uint8 fG, Uint8 fB, Uint8 bR,Uint8 bG,Uint8 bB, int Alpha)
{
return sge_tt_input(screen,font,string,flags,pos,len,x,y,SDL_MapRGB(screen->format, fR,fG,fB),SDL_MapRGB(screen->format, bR,bG,bB),Alpha);
}
#endif /* _SGE_NOTTF */

File Metadata

Mime Type
text/x-diff
Expires
Wed, Jun 17, 9:25 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70829
Default Alt Text
(195 KB)

Event Timeline