forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConvertClass.h
125 lines (96 loc) · 3.15 KB
/
ConvertClass.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Converts are palettes... AFAIK
*/
#pragma once
#include <AbstractClass.h>
#include <ArrayClasses.h>
#include <Surface.h>
#include <Blitters.h>
#include <FileFormats/SHP.h>
struct ColorStruct;
class DSurface;
// struct Blitter;
class ConvertClass
{
public:
//global array
static DynamicVectorClass<ConvertClass*>* Array;
static ConvertClass* FindOrAllocate(const char * FileName);
ConvertClass(
BytePalette* pColorData,
BytePalette* pUnknownColorData, //???
DSurface* pSurface,
size_t Count,
bool SkipBlitters)
{ JMP_THIS(0x48E740); }
static void __fastcall CreateFromFile(const char* Filename, BytePalette* &pPalette, ConvertClass* &pDestination)
{ JMP_STD(0x72ADE0); }
// if you're drawing a SHP, call SHPStruct::HasCompression and choose one of these two based on that
BlitterCore * SelectPlainBlitter(eBlitterFlags flags)
{ JMP_THIS(0x490B90); }
RLEBlitterCore * SelectRLEBlitter(eBlitterFlags flags)
{ JMP_THIS(0x490E50); }
void* SelectProperBlitter(SHPStruct * SHP, int FrameIndex, eBlitterFlags flags) {
return (SHP->HasCompression(FrameIndex))
? static_cast<void*>(this->SelectRLEBlitter(flags))
: static_cast<void*>(this->SelectPlainBlitter(flags))
;
}
virtual ~ConvertClass() RX;
protected:
ConvertClass() { }
ConvertClass(bool) { }
//===========================================================================
//===== Properties ==========================================================
//===========================================================================
public:
//That's right, I don't know anything about this class, except what it's used for...
// == 1 ? alloc_a_few_blitters_for_uchar : alloc_a_fuckton_of_blitters_for_ushort
// actually this is just the result of Surface->GetBytesPerPixel()
// but this name sounds better
DWORD LeanAndMean;
BlitterCore * Blitters [89];
size_t Count;
byte * BufferA; // new(Count * 8 * LeanAndMean) - gets filled with pColorData values on CTOR
byte * Midpoint; // points to the middle of BufferA above, ??
byte * BufferB; // if(LeanAndMean == 1) { BufferB = new byte[0x100]; }
DWORD f_17C;
DWORD f_180;
DWORD f_184;
// PROTECTED_PROPERTY(BYTE, unknown_0[0x188]);
};
class LightConvertClass : public ConvertClass
{
public:
//global array
static DynamicVectorClass<LightConvertClass*>* Array;
//Constructor, Destructor
LightConvertClass(
BytePalette *Pal1,
BytePalette *Pal2,
Surface *Surface,
int Color_R,
int Color_G,
int Color_B,
bool SkipBlitters,
size_t Count,
DWORD arg20) : ConvertClass(false)
{ JMP_THIS(0x555DA0); }
virtual ~LightConvertClass() RX;
void UpdateColors(int Red, int Green, int Blue, bool bUnknown)
{ JMP_THIS(0x556090); }
protected:
LightConvertClass() : ConvertClass(false) {}
public:
//===========================================================================
//===== Properties ==========================================================
//===========================================================================
BytePalette* UsedPalette1;
BytePalette* UsedPalette2;
void* unknown_190;
int UsageCount;
TintStruct Color1;
TintStruct Color2;
BYTE unknown_1B0;
PROTECTED_PROPERTY(BYTE, align_1B1[3]);
};