@@ -45,11 +45,11 @@ public void EmitImports(bool singleFile = false)
4545 var prefix = singleFile ? "./" : "../" ;
4646 _cb . AppendLine ( $ "import {{ Vector3 }} from '{ prefix } types/Vector3';") ;
4747 _cb . AppendLine ( ) ;
48- EmitTypeScriptAliases ( ) ;
48+ EmitTypeScriptAliases ( _cb ) ;
4949 }
5050 else
5151 {
52- EmitLuaAliases ( ) ;
52+ EmitLuaAliases ( _cb ) ;
5353 }
5454 }
5555
@@ -75,8 +75,6 @@ public static void EmitTypeScriptAliases(CodeBuilder cb)
7575 cb . AppendLine ( ) ;
7676 }
7777
78- private void EmitTypeScriptAliases ( ) => EmitTypeScriptAliases ( _cb ) ;
79-
8078 /// <summary>
8179 /// Emits Lua aliases. Static so it can be used by other emitters.
8280 /// </summary>
@@ -97,8 +95,6 @@ public static void EmitLuaAliases(CodeBuilder cb)
9795 cb . AppendLine ( ) ;
9896 }
9997
100- private void EmitLuaAliases ( ) => EmitLuaAliases ( _cb ) ;
101-
10298 public void EmitModuleHeader ( string moduleName )
10399 {
104100 if ( _lang == Language . Lua )
@@ -294,16 +290,10 @@ private void EmitInvokeNative(NativeDefinition native, List<NativeParameter> out
294290 else
295291 args . Add ( native . Hash ) ;
296292
297- // Input params - use ArgumentBuilder shared logic
298- foreach ( var p in native . Parameters . Where ( p => ! p . IsPureOutput ) )
299- {
300- args . Add ( GetArgumentExpression ( p ) ) ;
301- }
302-
303- // Output param pointers - use the type mapper
304- foreach ( var p in outputParams )
293+ // All params - ArgumentBuilder handles input, output, and in-out pointers
294+ foreach ( var p in native . Parameters )
305295 {
306- args . Add ( _typeMapper . GetPointerPlaceholder ( p . Type ) ) ;
296+ args . Add ( ArgumentBuilder . GetArgumentExpression ( p , _typeMapper , _config , rawMode : true ) ) ;
307297 }
308298
309299 // Result marker - use the type mapper
@@ -342,45 +332,6 @@ private void EmitInvokeNative(NativeDefinition native, List<NativeParameter> out
342332 }
343333 }
344334
345- /// <summary>
346- /// Gets the argument expression for a parameter.
347- /// Handles float wrapping, hash wrapping, Vector3 expansion.
348- /// </summary>
349- private string GetArgumentExpression ( NativeParameter p )
350- {
351- var f = _config . FloatWrapperAlias ;
352- var h = _config . HashWrapperAlias ;
353- var useFloat = _config . UseFloatWrapper ;
354- var useHash = _config . UseHashWrapper ;
355-
356- if ( p . Type . Category == TypeCategory . Vector3 )
357- {
358- // Vector3 components are floats - wrap if language needs it
359- if ( useFloat )
360- return $ "{ f } ({ p . Name } .x), { f } ({ p . Name } .y), { f } ({ p . Name } .z)";
361- else
362- return $ "{ p . Name } .x, { p . Name } .y, { p . Name } .z";
363- }
364- else if ( p . Type . Category == TypeCategory . Hash || p . Type . Name == "Hash" )
365- {
366- if ( useHash )
367- return $ "{ h } ({ p . Name } )";
368- else
369- return p . Name ;
370- }
371- else if ( p . Type . Name is "float" or "f32" or "f64" or "double" )
372- {
373- if ( useFloat )
374- return $ "{ f } ({ p . Name } )";
375- else
376- return p . Name ;
377- }
378- else
379- {
380- return p . Name ;
381- }
382- }
383-
384335 private void EmitComplexReturn ( NativeDefinition native , List < NativeParameter > outputParams , List < string > args )
385336 {
386337 var isSingleVector3 = outputParams . Count == 1 &&
0 commit comments