wip bindings upgrade

This commit is contained in:
goaaats 2025-04-06 20:59:23 +02:00
parent bd7e56850a
commit 0690cce995
272 changed files with 139041 additions and 1541 deletions

View file

@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Text;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.ManagedFontAtlas;
@ -14,13 +14,14 @@ public struct SafeFontConfig
/// <summary>
/// The raw config.
/// </summary>
public ImFontConfig Raw;
public ImFontConfigPtr Raw;
/// <summary>
/// Initializes a new instance of the <see cref="SafeFontConfig"/> struct.
/// </summary>
public SafeFontConfig()
public unsafe SafeFontConfig()
{
this.Raw.Handle = ImGui.ImFontConfig();
this.OversampleH = 1;
this.OversampleV = 1;
this.PixelSnapH = true;
@ -28,7 +29,7 @@ public struct SafeFontConfig
this.RasterizerMultiply = 1f;
this.RasterizerGamma = 1.7f;
this.EllipsisChar = unchecked((char)-1);
this.Raw.FontDataOwnedByAtlas = 1;
this.Raw.FontDataOwnedByAtlas = true;
}
/// <summary>
@ -39,9 +40,9 @@ public struct SafeFontConfig
public unsafe SafeFontConfig(ImFontConfigPtr config)
: this()
{
if (config.NativePtr is not null)
if (config.Handle is not null)
{
this.Raw = *config.NativePtr;
this.Raw = config.Handle;
this.Raw.GlyphRanges = null;
}
}
@ -107,8 +108,8 @@ public struct SafeFontConfig
/// </summary>
public bool PixelSnapH
{
get => this.Raw.PixelSnapH != 0;
set => this.Raw.PixelSnapH = value ? (byte)1 : (byte)0;
get => this.Raw.PixelSnapH;
set => this.Raw.PixelSnapH = value;
}
/// <summary>
@ -237,11 +238,11 @@ public struct SafeFontConfig
/// </summary>
public unsafe ImFontPtr MergeFont
{
get => this.Raw.DstFont is not null ? this.Raw.DstFont : default;
get => this.Raw.DstFont.Handle != null ? this.Raw.DstFont : default;
set
{
this.Raw.MergeMode = value.NativePtr is null ? (byte)0 : (byte)1;
this.Raw.DstFont = value.NativePtr is null ? default : value.NativePtr;
this.Raw.MergeMode = value.Handle != null;
this.Raw.DstFont = value.Handle == null ? ImFontPtr.Null : value.Handle;
}
}