Explorar o código

Fix AngelScriptAPI.h header generation.

- Define int64 and uint64 and redefine the existing type to closer match AngelScript documentation.
- Replace occurances of ?& (any reference) to void*.
Yao Wei Tjong 姚伟忠 %!s(int64=12) %!d(string=hai) anos
pai
achega
596aa3eac6
Modificáronse 2 ficheiros con 19 adicións e 9 borrados
  1. 10 8
      Docs/AngelScriptAPI.h
  2. 9 1
      Source/Engine/Script/Script.cpp

+ 10 - 8
Docs/AngelScriptAPI.h

@@ -1,9 +1,11 @@
-// Script API header for AngelScript content assist / code completion in IDE
-
-#define uint8 uint
-#define uint16 uint
-#define int8 int
-#define int16 int
+// Script API header intended to be 'force included' in IDE for AngelScript content assist / code completion
+
+#define int8 signed char
+#define int16 signed short
+#define int64 long
+#define uint8 unsigned char
+#define uint16 unsigned short
+#define uint64 unsigned long
 #define null 0
 
 // Enumerations
@@ -421,8 +423,8 @@ bool empty;
 class Dictionary
 {
 // Methods:
-void Set(const String&, ?&);
-bool Get(const String&, ?&) const;
+void Set(const String&, void*);
+bool Get(const String&, void*) const;
 void Set(const String&, int64&);
 bool Get(const String&, int64&) const;
 void Set(const String&, double&);

+ 9 - 1
Source/Engine/Script/Script.cpp

@@ -252,7 +252,14 @@ void Script::DumpAPI(DumpMode mode)
     if (mode == DOXYGEN)
         Log::WriteRaw("namespace Urho3D\n{\n\n/**\n\\page ScriptAPI Scripting API\n\n");
     else if (mode == C_HEADER)
-        Log::WriteRaw("// Script API header for AngelScript content assist / code completion in IDE\n\n#define uint8 uint\n#define uint16 uint\n#define int8 int\n#define int16 int\n#define null 0\n");
+        Log::WriteRaw("// Script API header intended to be 'force included' in IDE for AngelScript content assist / code completion\n\n"
+            "#define int8 signed char\n"
+            "#define int16 signed short\n"
+            "#define int64 long\n"
+            "#define uint8 unsigned char\n"
+            "#define uint16 unsigned short\n"
+            "#define uint64 unsigned long\n"
+            "#define null 0\n");
 
     if (mode == DOXYGEN)
         Log::WriteRaw("\\section ScriptAPI_Enums Enumerations\n");
@@ -547,6 +554,7 @@ void Script::OutputAPIRow(DumpMode mode, const String& row, bool removeReference
     else if (mode == C_HEADER)
     {
         out.Replace("@", "");
+        out.Replace("?&", "void*");
 
         // s/(\w+)\[\]/Array<\1>/g
         unsigned posBegin = String::NPOS;