Commits

Didrole committed 1fef682

Steam4NET2: Fixed arrays in callbacks.

Comments (0)

Files changed (1)

Steam4NET2/Steam4NET2/Steam4Intermediate/Nodes/CXXRecordNode.cs

                         size = basetype.GetAttribute("size");
                         types = basetype.ResolveType(1, out basetype, out constness, out pointer);
 
-                        pointer = true;
                         arraytype = true;
                     }
 
                     types = generator.ResolveType( types, constness, pointer, true, false );
 
+                    if (types == "CSteamID")
+                    {
+                        types = "SteamID_t";
+                    }
+                    else if (types == "CGameID")
+                    {
+                        types = "GameID_t";
+                    }
+
+                    if(arraytype)
+                    {
+                        if (types == "SByte")
+                        {
+                            types = "string";
+                        }
+                        else 
+                        {
+                            types += "[]";
+                        }
+                    }
+
                     if ( types == "bool" )
                     {
                         generator.EmitLine( "[MarshalAs(UnmanagedType.I1)]", depth + 1 );
                             types = "IntPtr";
                         }
                     }
-                    else if (types == "CSteamID")
-                    {
-                        types = "SteamID_t";
-                    }
-                    else if (types == "CGameID")
-                    {
-                        types = "GameID_t";
-                    }
                     else if (pointer)
                     {
                         types = "IntPtr";
                     }
+                    else if (arraytype)
+                    {
+                        generator.EmitLine("[MarshalAs(UnmanagedType.ByValArray, SizeConst = " + size + ")]", depth + 1);
+                    }
                     else if (types == child.GetName())
                     {
                         continue;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.