-
Notifications
You must be signed in to change notification settings - Fork 44
/
Blitters.h
114 lines (93 loc) · 4.31 KB
/
Blitters.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
#pragma once
// This file contains strong language, excessive amounts of copy pasting and is known to make grown men cry.
// Proceed at your own risk.
// Don't forget to email ex-Westwood coders and tell them just how much you love their awesome code.
class BlitterCore {
public:
BlitterCore() = default;
virtual ~BlitterCore() = default;
// depending on the blitter, these have different intepretations and usage
// zBuf - pointer to Z-buffer data
// zMin - minimum Z value (context)
// aBuf - pointer to Alpha buffer data
// aLvl - Alpha threshold (context)
// warpOffset - offset for warping the data (context)
virtual void Blit
(void *dst, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl, int warpOffset) = 0;
// actual body: this->Blit(dst, src, length, zMin, zBuf, aBuf, aLvl, 0);
virtual void CallBlit0
(void *dst, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl,
WORD unknownArg, DWORD useless) = 0;
// actual body: this->Blit(dst, src, length, zMin, zBuf, aBuf, aLvl, 0);
virtual void CallBlit1
(void *dst, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl) = 0;
// actual body: this->Blit(dst, src, length, zMin, zBuf, aBuf, aLvl, 0);
virtual void CallBlit2
(void *dst, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl,
DWORD useless) = 0;
};
template<typename T>
class Blitter : public BlitterCore {
public:
Blitter() = default;
virtual ~Blitter() = default;
// depending on the blitter, these have different intepretations and usage
// zBuf - pointer to Z-buffer data
// zMin - minimum Z value (context)
// aBuf - pointer to Alpha buffer data
// aLvl - Alpha threshold (context)
// warpOffset - offset for warping the data (context)
virtual void Blit
(void *dest, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl, int warpOffset) = 0;
// actual body: this->Blit(dst, src, length, zMin, zBuf, aBuf, aLvl, 0);
virtual void CallBlit0
(void *dest, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl,
WORD unknownArg, DWORD useless) = 0;
// actual body: this->Blit(dst, src, length, zMin, zBuf, aBuf, aLvl, 0);
virtual void CallBlit1
(void *dest, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl) = 0;
// actual body: this->Blit(dst, src, length, zMin, zBuf, aBuf, aLvl, 0);
virtual void CallBlit2
(void *dest, byte *src, unsigned int length, WORD zMin, WORD *zBuf, WORD *aBuf, WORD aLvl,
DWORD useless) = 0;
byte *Data; // LightConvertClass's byte buffer
};
class RLEBlitterCore {
public:
RLEBlitterCore() = default;
virtual ~RLEBlitterCore() = default;
// depending on the blitter, these have different intepretations and usage
// zBuf - pointer to Z-buffer data
// zMin - minimum Z value (context)
// aBuf - pointer to Alpha buffer data
// aLvl - Alpha threshold (context)
// warpOffset - offset for warping the data (context)
virtual void Blit
(void *dst, byte *src, byte Length, int EncodedLen, int a6, int a7, int a8, int a9, int a10, int a11) = 0;
// actual body: this->Blit(dst, src, Length, EncodedLen, a6, a7, a8, a9, a10, a11);
virtual void CallBlit0
(void *dst, byte *src, byte Length, int EncodedLen, int a6, int a7, int a8, int a9, int a10, int a11,
DWORD useless) = 0;
byte *Data; // LightConvertClass's byte buffer
};
template<typename T>
class RLEBlitter : public RLEBlitterCore {
public:
RLEBlitter() = default;
virtual ~RLEBlitter() = default;
/*
// depending on the blitter, these have different intepretations and usage
// zBuf - pointer to Z-buffer data
// zMin - minimum Z value (context)
// aBuf - pointer to Alpha buffer data
// aLvl - Alpha threshold (context)
// warpOffset - offset for warping the data (context)
virtual void Blit
(T *dst, byte *src, byte Length, int EncodedLen, int a6, int a7, int a8, int a9, int a10, int a11) = 0;
// actual body: this->Blit(dst, src, Length, EncodedLen, a6, a7, a8, a9, a10, a11);
virtual void CallBlit0
(T *dst, byte *src, byte Length, int EncodedLen, int a6, int a7, int a8, int a9, int a10, int a11,
DWORD useless) = 0;
byte *Data; // LightConvertClass's byte buffer
*/
};