mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-09 12:50:34 +00:00
Fixed bug in acronym capitalization handling, when multiple acronyms exist in the same enum.
This commit is contained in:
parent
7f0e30fadc
commit
9d93398613
|
@ -101,9 +101,10 @@ namespace Bind
|
||||||
|
|
||||||
// Split on IHV names, to ensure that characters appearing after these name are uppercase.
|
// Split on IHV names, to ensure that characters appearing after these name are uppercase.
|
||||||
var match = Utilities.Acronyms.Match(name);
|
var match = Utilities.Acronyms.Match(name);
|
||||||
|
int offset = 0; // Everytime we insert a match, we must increase offset to compensate.
|
||||||
while (match.Success)
|
while (match.Success)
|
||||||
{
|
{
|
||||||
int insert_pos = match.Index + match.Length;
|
int insert_pos = match.Index + match.Length + offset++;
|
||||||
translator.Insert(insert_pos, "_");
|
translator.Insert(insert_pos, "_");
|
||||||
match = match.NextMatch();
|
match = match.NextMatch();
|
||||||
}
|
}
|
||||||
|
@ -117,7 +118,6 @@ namespace Bind
|
||||||
// 4. if current char is lowercase, respect next char case.
|
// 4. if current char is lowercase, respect next char case.
|
||||||
bool is_after_underscore_or_number = true;
|
bool is_after_underscore_or_number = true;
|
||||||
bool is_previous_uppercase = false;
|
bool is_previous_uppercase = false;
|
||||||
int pos = 0;
|
|
||||||
foreach (char c in name)
|
foreach (char c in name)
|
||||||
{
|
{
|
||||||
char char_to_add;
|
char char_to_add;
|
||||||
|
|
|
@ -74,6 +74,7 @@ namespace Bind
|
||||||
RegexOptions.Compiled);
|
RegexOptions.Compiled);
|
||||||
public static readonly Regex Acronyms = new Regex(Extensions.ToString() + "|EGL|3TC|DXT|ES|RGBA|BGRA|RGB|BGR|ETC",
|
public static readonly Regex Acronyms = new Regex(Extensions.ToString() + "|EGL|3TC|DXT|ES|RGBA|BGRA|RGB|BGR|ETC",
|
||||||
RegexOptions.Compiled);
|
RegexOptions.Compiled);
|
||||||
|
|
||||||
#region internal StreamReader OpenSpecFile(string file)
|
#region internal StreamReader OpenSpecFile(string file)
|
||||||
|
|
||||||
internal static StreamReader OpenSpecFile(string folder, string file)
|
internal static StreamReader OpenSpecFile(string folder, string file)
|
||||||
|
|
Loading…
Reference in a new issue