mirror of
https://github.com/Starpelly/raylib-beef.git
synced 2025-06-14 17:34:09 +02:00
Some wasm fixes
This commit is contained in:
parent
6e604a801b
commit
9a00da9fce
4 changed files with 3170 additions and 1067 deletions
|
@ -186,9 +186,32 @@ namespace RaylibBeefGenerator
|
|||
foreach (var func in functionsWStructs)
|
||||
{
|
||||
AppendLine($"/// {func.Description}");
|
||||
// AppendLine($"[Import(Raylib.RaylibBin), CallingConvention(.Cdecl), LinkName(\"{func.Name}\")]");
|
||||
AppendLine("[CLink]");
|
||||
AppendLine($"public static extern {func.ReturnType.ConvertTypes()} {func.Name.ConvertName()}({Parameters2String(func.Params, api, true)});");
|
||||
|
||||
AppendLine("[Inline]");
|
||||
AppendLine($"public static {func.ReturnType.ConvertTypes()} {func.Name.ConvertName()}({Parameters2String(func.Params, api, false)})");
|
||||
AppendLine("{");
|
||||
IncreaseTab();
|
||||
{
|
||||
var implParamsStr = new StringBuilder();
|
||||
foreach (var param in func.Params)
|
||||
{
|
||||
implParamsStr.Append(param.Name.ConvertName());
|
||||
if (param != func.Params.Last())
|
||||
implParamsStr.Append(", ");
|
||||
}
|
||||
|
||||
var lineStr = new StringBuilder();
|
||||
if (func.ReturnType != "void")
|
||||
lineStr.Append("return ");
|
||||
lineStr.Append($"{func.Name.ConvertName()}_Impl({implParamsStr});");
|
||||
|
||||
AppendLine(lineStr.ToString());
|
||||
}
|
||||
DecreaseTab();
|
||||
AppendLine("}");
|
||||
|
||||
AppendLine($"[LinkName(\"{func.Name}\")]");
|
||||
AppendLine($"private static extern {func.ReturnType.ConvertTypes()} {func.Name.ConvertName()}_Impl({Parameters2String(func.Params, api, true)});");
|
||||
|
||||
GenerateBeefHelperFunctions(func, api);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue