This commit is contained in:
2026-06-08 17:19:24 +02:00
parent 3e8ce40cc3
commit 948c2304e7
43 changed files with 1243 additions and 1332 deletions

View File

@@ -162,7 +162,6 @@ class SDL3Generator : Cpp2BeefGenerator, this(Span<char8*> args)
}
BeginCursor(cursor);
if (spelling == "Button") str.Append("[AllowDuplicates] ");
AccessSpecifier(cursor);
str.Append("enum ");
GetNameInBindings(cursor, str);
@@ -179,6 +178,7 @@ class SDL3Generator : Cpp2BeefGenerator, this(Span<char8*> args)
fileInfo.queuedTokens = .None;
}
bool isSDL_GLContextFlag = spelling == "GlContext";
bool isSDL_MouseButtonFlags = spelling == "Button";
{
BeginBody!(cursor);
for (let macro in this.[Friend]unitMacros)
@@ -197,6 +197,11 @@ class SDL3Generator : Cpp2BeefGenerator, this(Span<char8*> args)
continue;
macroSpelling.RemoveFromEnd(5);
}
if (isSDL_MouseButtonFlags && macroSpelling.EndsWith("MASK"))
{
@macro.Remove();
continue;
}
macroSpelling.RemoveFromStart(prefix.Length);
BeginCursor(macroCursor);
FixCurly();
@@ -205,7 +210,9 @@ class SDL3Generator : Cpp2BeefGenerator, this(Span<char8*> args)
let tokens = ScopeTokenize!(macroCursor, unit);
AllWhiteSpaceBetween(Clang.GetRangeEnd(Clang.GetTokenExtent(unit, tokens[0])), Clang.GetRangeStart(Clang.GetTokenExtent(unit, tokens[1])));
str.Append("= ");
if (isSDL_MouseButtonFlags) str.Append("1 << (");
WriteTokens(tokens[1...], Clang.GetNullLocation(), .Punctuation);
if (isSDL_MouseButtonFlags) str.Append("-1)");
str.Append(',');
@macro.Remove();
WriteComments(Clang.GetCursorLocation(macroCursor));