-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDrawing.cs
64 lines (57 loc) · 2.52 KB
/
Drawing.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace PatcherYRpp
{
[StructLayout(LayoutKind.Explicit, Size = 48)]
public struct ABufferClass
{
private static IntPtr ppABuffer = new IntPtr(0x87E8A4);
public static Pointer<ABufferClass> ABuffer { get => ((Pointer<Pointer<ABufferClass>>)ppABuffer).Data; set => ((Pointer<Pointer<ABufferClass>>)ppABuffer).Ref = value; }
public unsafe Pointer<short> GetBufferAt(Point2D point)
{
var func = (delegate* unmanaged[Thiscall]<ref ABufferClass, int,int,IntPtr>)0x4114B0;
return func(ref this, point.X, point.Y);
}
public unsafe Pointer<short> AdjustedGetBufferAt(Point2D point)
{
return GetBufferAt(point - new Point2D(0, Rect.Y));
}
[FieldOffset(0)] public RectangleStruct Rect;
[FieldOffset(16)] public int _10;
[FieldOffset(20)] public Pointer<Surface> BSurface;
[FieldOffset(24)] public Pointer<byte> BufferStart;
[FieldOffset(28)] public Pointer<byte> BufferEndpoint;
[FieldOffset(32)] public int BufferSize;
[FieldOffset(36)] public int _24;
[FieldOffset(40)] public int Width;
[FieldOffset(44)] public int Height;
}
[StructLayout(LayoutKind.Explicit, Size = 0x30)]
public struct ZBufferClass
{
private static IntPtr ppZBuffer = new IntPtr(0x887644);
public static Pointer<ZBufferClass> ZBuffer { get => ((Pointer<Pointer<ZBufferClass>>)ppZBuffer).Data; set => ((Pointer<Pointer<ZBufferClass>>)ppZBuffer).Ref = value; }
public unsafe Pointer<short> GetBufferAt(Point2D point)
{
var func = (delegate* unmanaged[Thiscall]<ref ZBufferClass, int, int, IntPtr>)0x7BD130;
return func(ref this, point.X, point.Y);
}
public unsafe Pointer<short> AdjustedGetBufferAt(Point2D point)
{
return GetBufferAt(point - new Point2D(0, Rect.Y));
}
[FieldOffset(0)] public RectangleStruct Rect;
[FieldOffset(16)] public int CurrentOffset;
[FieldOffset(20)] public Pointer<Surface> BSurface;
[FieldOffset(24)] public Pointer<byte> BufferStart;
[FieldOffset(28)] public Pointer<byte> BufferEndpoint;
[FieldOffset(32)] public int BufferSize;
[FieldOffset(36)] public int CurrentBaseZ;
[FieldOffset(40)] public int Width;
[FieldOffset(44)] public int Height;
}
}