فهرست منبع

Merge pull request #539 from blackberry-gaming/next-setaylor

Next setaylor
Sean Paul Taylor 13 سال پیش
والد
کامیت
245673fb35

+ 258 - 0
gameplay-luagen/gameplay-luagen.xcodeproj/project.pbxproj

@@ -0,0 +1,258 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		42B7F6FD15B06EFE002BB8C3 /* ClassBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7F6F215B06EFE002BB8C3 /* ClassBinding.cpp */; };
+		42B7F6FE15B06EFE002BB8C3 /* DebugNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7F6F415B06EFE002BB8C3 /* DebugNew.cpp */; };
+		42B7F6FF15B06EFE002BB8C3 /* FunctionBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7F6F715B06EFE002BB8C3 /* FunctionBinding.cpp */; };
+		42B7F70015B06EFE002BB8C3 /* Generator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7F6F915B06EFE002BB8C3 /* Generator.cpp */; };
+		42B7F70115B06EFE002BB8C3 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7F6FB15B06EFE002BB8C3 /* main.cpp */; };
+		42B7F71215B06F67002BB8C3 /* libtinyxml2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42B7F71115B06F67002BB8C3 /* libtinyxml2.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+		42B7F6DE15B06E85002BB8C3 /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = /usr/share/man/man1/;
+			dstSubfolderSpec = 0;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+		42B7F6E015B06E85002BB8C3 /* gameplay-luagen */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "gameplay-luagen"; sourceTree = BUILT_PRODUCTS_DIR; };
+		42B7F6F115B06EFE002BB8C3 /* Base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Base.h; path = src/Base.h; sourceTree = SOURCE_ROOT; };
+		42B7F6F215B06EFE002BB8C3 /* ClassBinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClassBinding.cpp; path = src/ClassBinding.cpp; sourceTree = SOURCE_ROOT; };
+		42B7F6F315B06EFE002BB8C3 /* ClassBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClassBinding.h; path = src/ClassBinding.h; sourceTree = SOURCE_ROOT; };
+		42B7F6F415B06EFE002BB8C3 /* DebugNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DebugNew.cpp; path = src/DebugNew.cpp; sourceTree = SOURCE_ROOT; };
+		42B7F6F515B06EFE002BB8C3 /* DebugNew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugNew.h; path = src/DebugNew.h; sourceTree = SOURCE_ROOT; };
+		42B7F6F615B06EFE002BB8C3 /* EnumBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnumBinding.h; path = src/EnumBinding.h; sourceTree = SOURCE_ROOT; };
+		42B7F6F715B06EFE002BB8C3 /* FunctionBinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FunctionBinding.cpp; path = src/FunctionBinding.cpp; sourceTree = SOURCE_ROOT; };
+		42B7F6F815B06EFE002BB8C3 /* FunctionBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionBinding.h; path = src/FunctionBinding.h; sourceTree = SOURCE_ROOT; };
+		42B7F6F915B06EFE002BB8C3 /* Generator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Generator.cpp; path = src/Generator.cpp; sourceTree = SOURCE_ROOT; };
+		42B7F6FA15B06EFE002BB8C3 /* Generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Generator.h; path = src/Generator.h; sourceTree = SOURCE_ROOT; };
+		42B7F6FB15B06EFE002BB8C3 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; };
+		42B7F6FC15B06EFE002BB8C3 /* TypedefBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypedefBinding.h; path = src/TypedefBinding.h; sourceTree = SOURCE_ROOT; };
+		42B7F71115B06F67002BB8C3 /* libtinyxml2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtinyxml2.a; path = "../external-deps/tinyxml2/lib/macosx/libtinyxml2.a"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		42B7F6DD15B06E85002BB8C3 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				42B7F71215B06F67002BB8C3 /* libtinyxml2.a in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		42B7F6D515B06E85002BB8C3 = {
+			isa = PBXGroup;
+			children = (
+				42B7F6E315B06E85002BB8C3 /* src */,
+				42B7F70B15B06F3A002BB8C3 /* Libraries */,
+				42B7F6E115B06E85002BB8C3 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		42B7F6E115B06E85002BB8C3 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				42B7F6E015B06E85002BB8C3 /* gameplay-luagen */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		42B7F6E315B06E85002BB8C3 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				42B7F6F115B06EFE002BB8C3 /* Base.h */,
+				42B7F6F215B06EFE002BB8C3 /* ClassBinding.cpp */,
+				42B7F6F315B06EFE002BB8C3 /* ClassBinding.h */,
+				42B7F6F415B06EFE002BB8C3 /* DebugNew.cpp */,
+				42B7F6F515B06EFE002BB8C3 /* DebugNew.h */,
+				42B7F6F615B06EFE002BB8C3 /* EnumBinding.h */,
+				42B7F6F715B06EFE002BB8C3 /* FunctionBinding.cpp */,
+				42B7F6F815B06EFE002BB8C3 /* FunctionBinding.h */,
+				42B7F6F915B06EFE002BB8C3 /* Generator.cpp */,
+				42B7F6FA15B06EFE002BB8C3 /* Generator.h */,
+				42B7F6FB15B06EFE002BB8C3 /* main.cpp */,
+				42B7F6FC15B06EFE002BB8C3 /* TypedefBinding.h */,
+			);
+			name = src;
+			path = "gameplay-luagen";
+			sourceTree = "<group>";
+		};
+		42B7F70B15B06F3A002BB8C3 /* Libraries */ = {
+			isa = PBXGroup;
+			children = (
+				42B7F71115B06F67002BB8C3 /* libtinyxml2.a */,
+			);
+			name = Libraries;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		42B7F6DF15B06E85002BB8C3 /* gameplay-luagen */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 42B7F6EA15B06E85002BB8C3 /* Build configuration list for PBXNativeTarget "gameplay-luagen" */;
+			buildPhases = (
+				42B7F6DC15B06E85002BB8C3 /* Sources */,
+				42B7F6DD15B06E85002BB8C3 /* Frameworks */,
+				42B7F6DE15B06E85002BB8C3 /* CopyFiles */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "gameplay-luagen";
+			productName = "gameplay-luagen";
+			productReference = 42B7F6E015B06E85002BB8C3 /* gameplay-luagen */;
+			productType = "com.apple.product-type.tool";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		42B7F6D715B06E85002BB8C3 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0430;
+			};
+			buildConfigurationList = 42B7F6DA15B06E85002BB8C3 /* Build configuration list for PBXProject "gameplay-luagen" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = 42B7F6D515B06E85002BB8C3;
+			productRefGroup = 42B7F6E115B06E85002BB8C3 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				42B7F6DF15B06E85002BB8C3 /* gameplay-luagen */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		42B7F6DC15B06E85002BB8C3 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				42B7F6FD15B06EFE002BB8C3 /* ClassBinding.cpp in Sources */,
+				42B7F6FE15B06EFE002BB8C3 /* DebugNew.cpp in Sources */,
+				42B7F6FF15B06EFE002BB8C3 /* FunctionBinding.cpp in Sources */,
+				42B7F70015B06EFE002BB8C3 /* Generator.cpp in Sources */,
+				42B7F70115B06EFE002BB8C3 /* main.cpp in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		42B7F6E815B06E85002BB8C3 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				COPY_PHASE_STRIP = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = macosx;
+			};
+			name = Debug;
+		};
+		42B7F6E915B06E85002BB8C3 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				SDKROOT = macosx;
+			};
+			name = Release;
+		};
+		42B7F6EB15B06E85002BB8C3 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				HEADER_SEARCH_PATHS = "../external-deps/tinyxml2/include";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SRCROOT)/../external-deps/tinyxml2/lib/macosx\"",
+				);
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		42B7F6EC15B06E85002BB8C3 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				HEADER_SEARCH_PATHS = "../external-deps/tinyxml2/include";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SRCROOT)/../external-deps/tinyxml2/lib/macosx\"",
+				);
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		42B7F6DA15B06E85002BB8C3 /* Build configuration list for PBXProject "gameplay-luagen" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				42B7F6E815B06E85002BB8C3 /* Debug */,
+				42B7F6E915B06E85002BB8C3 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		42B7F6EA15B06E85002BB8C3 /* Build configuration list for PBXNativeTarget "gameplay-luagen" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				42B7F6EB15B06E85002BB8C3 /* Debug */,
+				42B7F6EC15B06E85002BB8C3 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 42B7F6D715B06E85002BB8C3 /* Project object */;
+}

+ 113 - 0
gameplay-luagen/gameplay-luagen.xcodeproj/xcshareddata/xcschemes/gameplay-luagen.xcscheme

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   version = "1.7">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "42B7F6DF15B06E85002BB8C3"
+               BuildableName = "gameplay-luagen"
+               BlueprintName = "gameplay-luagen"
+               ReferencedContainer = "container:gameplay-luagen.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <Testables>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "42B7F6DF15B06E85002BB8C3"
+            BuildableName = "gameplay-luagen"
+            BlueprintName = "gameplay-luagen"
+            ReferencedContainer = "container:gameplay-luagen.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Debug"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      allowLocationSimulation = "YES">
+      <PreActions>
+         <ExecutionAction
+            ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
+            <ActionContent
+               title = "Run Script"
+               scriptText = "rm ${SRCROOT}/../gameplay/src/lua/*&#10;">
+               <EnvironmentBuildable>
+                  <BuildableReference
+                     BuildableIdentifier = "primary"
+                     BlueprintIdentifier = "42B7F6DF15B06E85002BB8C3"
+                     BuildableName = "gameplay-luagen"
+                     BlueprintName = "gameplay-luagen"
+                     ReferencedContainer = "container:gameplay-luagen.xcodeproj">
+                  </BuildableReference>
+               </EnvironmentBuildable>
+            </ActionContent>
+         </ExecutionAction>
+      </PreActions>
+      <BuildableProductRunnable>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "42B7F6DF15B06E85002BB8C3"
+            BuildableName = "gameplay-luagen"
+            BlueprintName = "gameplay-luagen"
+            ReferencedContainer = "container:gameplay-luagen.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <CommandLineArguments>
+         <CommandLineArgument
+            argument = "$(PROJECT_DIR)/xml"
+            isEnabled = "YES">
+         </CommandLineArgument>
+         <CommandLineArgument
+            argument = "$(PROJECT_DIR)/../gameplay/src/lua/"
+            isEnabled = "YES">
+         </CommandLineArgument>
+      </CommandLineArguments>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Release"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "42B7F6DF15B06E85002BB8C3"
+            BuildableName = "gameplay-luagen"
+            BlueprintName = "gameplay-luagen"
+            ReferencedContainer = "container:gameplay-luagen.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 4 - 0
gameplay-luagen/src/Base.h

@@ -6,6 +6,8 @@
 #include <set>
 #include <set>
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
+#include <sys/types.h>
+#include <sys/stat.h>
 using namespace std;
 using namespace std;
 
 
 #define LUA_GLOBAL_FILENAME "lua_Global"
 #define LUA_GLOBAL_FILENAME "lua_Global"
@@ -21,6 +23,8 @@ using namespace std;
 #pragma warning(disable : 4996)
 #pragma warning(disable : 4996)
 #pragma warning(disable : 4244)
 #pragma warning(disable : 4244)
 #pragma warning(disable : 4345)
 #pragma warning(disable : 4345)
+#else
+#include <dirent.h>
 #endif
 #endif
 
 
 // Object deletion macro
 // Object deletion macro

+ 2 - 2
gameplay-luagen/src/ClassBinding.cpp

@@ -91,7 +91,7 @@ void ClassBinding::write(string dir, const set<string>& includes, string* bindin
     // Write out the header.
     // Write out the header.
     {
     {
         string path = dir + string("lua_") + uniquename + string(".h");
         string path = dir + string("lua_") + uniquename + string(".h");
-        ofstream o(path);
+        ofstream o(path.c_str());
         if (!o)
         if (!o)
         {
         {
             GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
             GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
@@ -131,7 +131,7 @@ void ClassBinding::write(string dir, const set<string>& includes, string* bindin
     // Write out the implementation.
     // Write out the implementation.
     {
     {
         string path = dir + string("lua_") + uniquename + string(".cpp");
         string path = dir + string("lua_") + uniquename + string(".cpp");
-        ofstream o(path);
+        ofstream o(path.c_str());
         if (!o)
         if (!o)
         {
         {
             GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
             GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());

+ 1 - 1
gameplay-luagen/src/DebugNew.cpp

@@ -282,7 +282,7 @@ extern void printMemoryLeaks()
             else
             else
                 printError("[memory] LEAK: HEAP allocation leak at address %#x of size %d from line %d in file '%s'.\n", rec->address, rec->size, rec->line, rec->file);
                 printError("[memory] LEAK: HEAP allocation leak at address %#x of size %d from line %d in file '%s'.\n", rec->address, rec->size, rec->line, rec->file);
 #else
 #else
-            gameplay::printError("[memory] LEAK: HEAP allocation leak at address %#x of size %d from line %d in file '%s'.\n", rec->address, rec->size, rec->line, rec->file);
+                printError("[memory] LEAK: HEAP allocation leak at address %#x of size %d from line %d in file '%s'.\n", rec->address, rec->size, rec->line, rec->file);
 #endif
 #endif
             rec = rec->next;
             rec = rec->next;
         }
         }

+ 1 - 0
gameplay-luagen/src/FunctionBinding.cpp

@@ -975,6 +975,7 @@ static inline void outputReturnValue(ostream& o, const FunctionBinding& b, int i
         break;
         break;
     case FunctionBinding::Param::TYPE_DESTRUCTOR:
     case FunctionBinding::Param::TYPE_DESTRUCTOR:
     case FunctionBinding::Param::TYPE_VOID:
     case FunctionBinding::Param::TYPE_VOID:
+    default:
         o << "\n";
         o << "\n";
         indent(o, indentLevel);
         indent(o, indentLevel);
         o << "return 0;\n";
         o << "return 0;\n";

+ 13 - 13
gameplay-luagen/src/Generator.cpp

@@ -52,7 +52,6 @@ string Generator::getUniqueNameFromRef(string refId)
 vector<string> Generator::getScopePath(string classname, string ns)
 vector<string> Generator::getScopePath(string classname, string ns)
 {
 {
     size_t i = classname.find("::");
     size_t i = classname.find("::");
-    int index = 0;
     vector<string> scopePath;
     vector<string> scopePath;
     while (i != classname.npos)
     while (i != classname.npos)
     {
     {
@@ -201,8 +200,7 @@ void Generator::run(string inDir, string outDir)
             cout << "Parsing namespace " << name << "...\n";
             cout << "Parsing namespace " << name << "...\n";
             getNamespace(node, name);
             getNamespace(node, name);
         }
         }
-        else if ((kind && strcmp(kind, "class") == 0 || strcmp(kind, "struct") == 0) &&
-            strcmp(node->Attribute("prot"), "public") == 0)
+        else if ( (kind && (strcmp(kind, "class") == 0 || strcmp(kind, "struct") == 0) ) && strcmp(node->Attribute("prot"), "public") == 0)
         {
         {
             string name = getCompoundName(node);
             string name = getCompoundName(node);
             cout << "Parsing class/struct " << name << "...\n";
             cout << "Parsing class/struct " << name << "...\n";
@@ -1326,14 +1324,16 @@ void Generator::resolveTypes()
 void Generator::generateBindings()
 void Generator::generateBindings()
 {
 {
     string* bindingNS = new string("gameplay");
     string* bindingNS = new string("gameplay");
-
-    ofstream luaAllH(_outDir + string(LUA_ALL_BINDINGS_FILENAME) + string(".h"));
+    
+    string luaAllHStr = _outDir + string(LUA_ALL_BINDINGS_FILENAME) + string(".h");
+    ofstream luaAllH(luaAllHStr.c_str());
     string includeGuard = string(LUA_ALL_BINDINGS_FILENAME) + string("_H_");
     string includeGuard = string(LUA_ALL_BINDINGS_FILENAME) + string("_H_");
     transform(includeGuard.begin(), includeGuard.end(), includeGuard.begin(), ::toupper);
     transform(includeGuard.begin(), includeGuard.end(), includeGuard.begin(), ::toupper);
     luaAllH << "#ifndef " << includeGuard << "\n";
     luaAllH << "#ifndef " << includeGuard << "\n";
     luaAllH << "#define " << includeGuard << "\n\n";
     luaAllH << "#define " << includeGuard << "\n\n";
     
     
-    ofstream luaAllCpp(_outDir + string(LUA_ALL_BINDINGS_FILENAME) + string(".cpp"));
+    string luaAllCppStr = _outDir + string(LUA_ALL_BINDINGS_FILENAME) + string(".cpp");
+    ofstream luaAllCpp(luaAllCppStr.c_str());
     luaAllCpp << "#include \"Base.h\"\n";
     luaAllCpp << "#include \"Base.h\"\n";
     luaAllCpp << "#include \"" << string(LUA_ALL_BINDINGS_FILENAME) << ".h\"\n\n";
     luaAllCpp << "#include \"" << string(LUA_ALL_BINDINGS_FILENAME) << ".h\"\n\n";
     if (bindingNS)
     if (bindingNS)
@@ -1373,7 +1373,8 @@ void Generator::generateBindings()
         for (map<string, EnumBinding>::iterator iter = _enums.begin(); iter != _enums.end(); iter++)
         for (map<string, EnumBinding>::iterator iter = _enums.begin(); iter != _enums.end(); iter++)
         {
         {
             // Header.
             // Header.
-            ofstream enumH(_outDir + string("lua_") + getUniqueName(iter->first) + string(".h"));
+            string enumHStr = _outDir + string("lua_") + getUniqueName(iter->first) + string(".h");
+            ofstream enumH(enumHStr.c_str());
             includeGuard = string("lua_") + getUniqueName(iter->first) + string("_H_");
             includeGuard = string("lua_") + getUniqueName(iter->first) + string("_H_");
             transform(includeGuard.begin(), includeGuard.end(), includeGuard.begin(), ::toupper);
             transform(includeGuard.begin(), includeGuard.end(), includeGuard.begin(), ::toupper);
             enumH << "#ifndef " << includeGuard << "\n";
             enumH << "#ifndef " << includeGuard << "\n";
@@ -1399,7 +1400,8 @@ void Generator::generateBindings()
             enumH.close();
             enumH.close();
 
 
             // Implementation.
             // Implementation.
-            ofstream enumCpp(_outDir + string("lua_") + getUniqueName(iter->first) + string(".cpp"));
+            string enumCppStr = _outDir + string("lua_") + getUniqueName(iter->first) + string(".cpp"); 
+            ofstream enumCpp(enumCppStr.c_str());
             enumCpp << "#include \"Base.h\"\n";
             enumCpp << "#include \"Base.h\"\n";
             enumCpp << "#include \"lua_" << getUniqueName(iter->first) << ".h\"\n\n";
             enumCpp << "#include \"lua_" << getUniqueName(iter->first) << ".h\"\n\n";
 
 
@@ -1492,7 +1494,7 @@ void Generator::generateBindings()
         // Write out the header file.
         // Write out the header file.
         {
         {
             string path = _outDir + string(LUA_GLOBAL_FILENAME) + string(".h");
             string path = _outDir + string(LUA_GLOBAL_FILENAME) + string(".h");
-            ofstream global(path);
+            ofstream global(path.c_str());
             if (!global)
             if (!global)
             {
             {
                 GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
                 GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
@@ -1548,7 +1550,7 @@ void Generator::generateBindings()
         // Write out the implementation.
         // Write out the implementation.
         {
         {
             string path = _outDir + string(LUA_GLOBAL_FILENAME) + string(".cpp");
             string path = _outDir + string(LUA_GLOBAL_FILENAME) + string(".cpp");
-            ofstream global(path);
+            ofstream global(path.c_str());
             if (!global)
             if (!global)
             {
             {
                 GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
                 GP_ERROR("Failed to open file '%s' for generating Lua bindings.", path.c_str());
@@ -1823,9 +1825,7 @@ static bool getFileList(string directory, vector<string>& files, bool (*isWanted
                 string filename = dp->d_name;
                 string filename = dp->d_name;
                 if (isWantedFile(filename))
                 if (isWantedFile(filename))
                 {
                 {
-                    if (includePath)
-                        filename = string(directory) + filename;
-
+                    filename = string(directory) + string("/") + filename;
                     files.push_back(filename);
                     files.push_back(filename);
                 }
                 }
             }
             }

+ 4 - 0
gameplay-luagen/src/main.cpp

@@ -7,6 +7,7 @@ void printError(const char* format, ...)
 {
 {
     va_list argptr;
     va_list argptr;
     va_start(argptr, format);
     va_start(argptr, format);
+#ifdef WIN32
     int sz = vfprintf(stderr, format, argptr);
     int sz = vfprintf(stderr, format, argptr);
     if (sz > 0)
     if (sz > 0)
     {
     {
@@ -16,6 +17,9 @@ void printError(const char* format, ...)
         OutputDebugStringA(buf);
         OutputDebugStringA(buf);
         SAFE_DELETE_ARRAY(buf);
         SAFE_DELETE_ARRAY(buf);
     }
     }
+#else
+    vfprintf(stderr, format, argptr);
+#endif
     va_end(argptr);
     va_end(argptr);
 }
 }
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1237 - 8
gameplay/gameplay.xcodeproj/project.pbxproj


+ 5 - 0
gameplay/src/AnimationClip.h

@@ -64,6 +64,11 @@ public:
              */
              */
             END
             END
         };
         };
+        
+        /*
+         * Destructor.
+         */
+        virtual ~Listener() { }
 
 
         /**
         /**
          * Handles when animation event occurs.
          * Handles when animation event occurs.

+ 5 - 0
gameplay/src/Control.h

@@ -140,6 +140,11 @@ public:
              */
              */
             RIGHT_CLICK     = 0x40,
             RIGHT_CLICK     = 0x40,
         };
         };
+    
+        /*
+         * Destructor.
+         */
+        virtual ~Listener() { }
 
 
         /**
         /**
          * Method called by controls when an event is triggered.
          * Method called by controls when an event is triggered.

+ 7 - 7
gameplay/src/ScriptController.inl

@@ -44,9 +44,9 @@ template<typename T>T* ScriptUtil::getObjectPointer(int index, const char* type,
                         lua_pop(sc->_lua, 2);
                         lua_pop(sc->_lua, 2);
                         T* ptr = (T*)((ScriptUtil::LuaObject*)p)->instance;
                         T* ptr = (T*)((ScriptUtil::LuaObject*)p)->instance;
                         if (ptr)
                         if (ptr)
-                            memcpy(&values[i], ptr, sizeof(T));
+                            memcpy((void*)&values[i], (void*)ptr, sizeof(T));
                         else
                         else
-                            memset(&values[i], 0, sizeof(T));
+                            memset((void*)&values[i], 0, sizeof(T));
 
 
                         lua_pop(sc->_lua, 1);
                         lua_pop(sc->_lua, 1);
                         continue;
                         continue;
@@ -63,15 +63,15 @@ template<typename T>T* ScriptUtil::getObjectPointer(int index, const char* type,
                             lua_pop(sc->_lua, 2);
                             lua_pop(sc->_lua, 2);
                             T* ptr = (T*)((ScriptUtil::LuaObject*)p)->instance;
                             T* ptr = (T*)((ScriptUtil::LuaObject*)p)->instance;
                             if (ptr)
                             if (ptr)
-                                memcpy(&values[i], ptr, sizeof(T));
-                            else
-                                memset(&values[i], 0, sizeof(T));
-                            lua_pop(sc->_lua, 1);
+                                memcpy((void*)&values[i], (void*)ptr, sizeof(T));
+                            else
+                                memset((void*)&values[i], 0, sizeof(T));
+
+                            lua_pop(sc->_lua, 1);
                             continue;
                             continue;
                         }
                         }
                         lua_pop(sc->_lua, 1);
                         lua_pop(sc->_lua, 1);
                     }
                     }
-            
                     lua_pop(sc->_lua, 1);
                     lua_pop(sc->_lua, 1);
                 }
                 }
             }
             }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است