-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathDrawing.h
102 lines (84 loc) · 2.5 KB
/
Drawing.h
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Drawing related static class.
This provides access to the game's Surfaces, color value conversion
and text aligning helpers.
*/
#pragma once
#include <ColorScheme.h>
#include <GeneralDefinitions.h>
#include <Helpers/CompileTime.h>
#include <Surface.h>
class Drawing
{
public:
static constexpr reference<ColorStruct, 0xB0FA1Cu> const TooltipColor{};
//TextBox dimensions for tooltip-style boxes
static RectangleStruct* __fastcall GetTextDimensions(
RectangleStruct* pOutBuffer, wchar_t const* pText, Point2D location,
WORD flags, int marginX = 0, int marginY = 0)
{ JMP_STD(0x4A59E0); }
static RectangleStruct __fastcall GetTextDimensions(
wchar_t const* pText, Point2D location, WORD flags, int marginX = 0,
int marginY = 0)
{
RectangleStruct buffer;
GetTextDimensions(&buffer, pText, location, flags, marginX, marginY);
return buffer;
}
// Rectangles
static RectangleStruct* __fastcall Intersect(
RectangleStruct* pOutBuffer, RectangleStruct const& rect1,
RectangleStruct const& rect2, int* delta_left = nullptr,
int* delta_top = nullptr)
{ JMP_STD(0x421B60); }
static RectangleStruct __fastcall Intersect(
RectangleStruct const& rect1, RectangleStruct const& rect2,
int* delta_left = nullptr, int* delta_top = nullptr)
{
RectangleStruct buffer;
Intersect(&buffer, rect1, rect2, delta_left, delta_top);
return buffer;
}
//Stuff
/** Message is a vswprintf format specifier, ... is for any arguments needed */
static Point2D * __cdecl PrintUnicode(Point2D *Position1, wchar_t *Message, Surface *a3, RectangleStruct *Rect, Point2D *Position2,
ColorScheme *a6, int a7, int a8, ...)
{ JMP_STD(0x4A61C0); };
};
//A few preset 16bit colors.
#define COLOR_BLACK 0x0000
#define COLOR_WHITE 0xFFFF
#define COLOR_RED 0xF800
#define COLOR_GREEN 0x07E0
#define COLOR_BLUE 0x001F
#define COLOR_PURPLE (COLOR_RED | COLOR_BLUE)
class ABufferClass {
public:
static constexpr reference<ABufferClass*, 0x87E8A4u> const ABuffer{};
ABufferClass(RectangleStruct rect)
{ JMP_THIS(0x410CE0); }
RectangleStruct Bounds;
int field_10;
BSurface* Surface;
WORD* BufferStart;
WORD* BufferEnd;
int BufferSizeInBytes;
int field_24;
int Width;
int Height;
};
class ZBufferClass {
public:
static constexpr reference<ZBufferClass*, 0x887644u> const ZBuffer{};
ZBufferClass(RectangleStruct rect)
{ JMP_THIS(0x7BC970); }
RectangleStruct Bounds;
int field_10;
BSurface* Surface;
WORD* BufferStart;
WORD* BufferEnd;
int BufferSizeInBytes;
int field_24;
int Width;
int Height;
};