From a605bc683de2f8c5d83de325c75ec3d017205200 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 19 Feb 2020 09:11:36 +0000 Subject: [PATCH] plain uint arrays --- Generator/CodeWriter/Struct.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index 5c23f1a..44538b0 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -136,6 +136,13 @@ namespace Generator WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U4)]" ); } + if ( t.StartsWith( "uint " ) && t.Contains( "[" ) ) + { + var num = t.Replace( "uint", "" ).Trim( '[', ']', ' ' ); + t = $"uint[]"; + WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U4)]" ); + } + if ( t.StartsWith( "float " ) && t.Contains( "[" ) ) { var num = t.Replace( "float", "" ).Trim( '[', ']', ' ' );