Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Graphics/Legacy/DrawingLegacy.hpp
1168 views
1
2
namespace Legacy
3
{
4
5
#define LEGACY_SURFACE_COUNT (24)
6
#define LEGACY_GFXDATA_SIZE (0x800 * 0x800)
7
8
#define LEGACY_DRAWLAYER_COUNT (8)
9
10
enum DrawFXFlags { FX_SCALE, FX_ROTATE, FX_ROTOZOOM, FX_INK, FX_TINT, FX_FLIP };
11
12
struct DrawListEntry {
13
int32 entityRefs[LEGACY_v4_ENTITY_COUNT];
14
int32 listSize;
15
};
16
17
struct GFXSurface {
18
char fileName[0x40];
19
int32 height;
20
int32 width;
21
int32 widthShift;
22
int32 depth;
23
int32 dataPosition;
24
};
25
26
extern int32 SCREEN_XSIZE;
27
extern int32 SCREEN_CENTERX;
28
29
extern DrawListEntry drawListEntries[LEGACY_DRAWLAYER_COUNT];
30
31
extern int32 gfxDataPosition;
32
extern GFXSurface gfxSurface[LEGACY_SURFACE_COUNT];
33
extern uint8 graphicData[LEGACY_GFXDATA_SIZE];
34
35
extern uint16 blendLookupTable[0x20 * 0x100];
36
extern uint16 subtractLookupTable[0x20 * 0x100];
37
extern uint16 tintLookupTable[0x10000];
38
39
void GenerateBlendLookupTable();
40
41
inline void ClearGraphicsData()
42
{
43
for (int32 i = 0; i < LEGACY_SURFACE_COUNT; ++i) MEM_ZERO(gfxSurface[i]);
44
gfxDataPosition = 0;
45
}
46
void ClearScreen(uint8 index);
47
48
// TileLayer Drawing
49
void DrawHLineScrollLayer(int32 layerID);
50
void DrawVLineScrollLayer(int32 layerID);
51
void Draw3DFloorLayer(int32 layerID);
52
void Draw3DSkyLayer(int32 layerID);
53
54
// Shape Drawing
55
void DrawRectangle(int32 XPos, int32 YPos, int32 width, int32 height, int32 R, int32 G, int32 B, int32 A);
56
void DrawTintRectangle(int32 XPos, int32 YPos, int32 width, int32 height);
57
void DrawScaledTintMask(int32 direction, int32 XPos, int32 YPos, int32 pivotX, int32 pivotY, int32 scaleX, int32 scaleY, int32 width, int32 height,
58
int32 sprX, int32 sprY, int32 sheetID);
59
60
// Sprite Drawing
61
void DrawSprite(int32 XPos, int32 YPos, int32 width, int32 height, int32 sprX, int32 sprY, int32 sheetID);
62
void DrawSpriteFlipped(int32 XPos, int32 YPos, int32 width, int32 height, int32 sprX, int32 sprY, int32 direction, int32 sheetID);
63
void DrawSpriteScaled(int32 direction, int32 XPos, int32 YPos, int32 pivotX, int32 pivotY, int32 scaleX, int32 scaleY, int32 width, int32 height,
64
int32 sprX, int32 sprY, int32 sheetID);
65
void DrawSpriteRotated(int32 direction, int32 XPos, int32 YPos, int32 pivotX, int32 pivotY, int32 sprX, int32 sprY, int32 width, int32 height,
66
int32 rotation, int32 sheetID);
67
void DrawSpriteRotozoom(int32 direction, int32 XPos, int32 YPos, int32 pivotX, int32 pivotY, int32 sprX, int32 sprY, int32 width, int32 height,
68
int32 rotation, int32 scale, int32 sheetID);
69
70
void DrawBlendedSprite(int32 XPos, int32 YPos, int32 width, int32 height, int32 sprX, int32 sprY, int32 sheetID);
71
void DrawAlphaBlendedSprite(int32 XPos, int32 YPos, int32 width, int32 height, int32 sprX, int32 sprY, int32 alpha, int32 sheetID);
72
void DrawAdditiveBlendedSprite(int32 XPos, int32 YPos, int32 width, int32 height, int32 sprX, int32 sprY, int32 alpha, int32 sheetID);
73
void DrawSubtractiveBlendedSprite(int32 XPos, int32 YPos, int32 width, int32 height, int32 sprX, int32 sprY, int32 alpha, int32 sheetID);
74
75
void DrawFace(void *v, uint32 color);
76
void DrawTexturedFace(void *v, uint8 sheetID);
77
78
namespace v4
79
{
80
void DrawObjectAnimation(void *objScr, void *ent, int32 XPos, int32 YPos);
81
82
void DrawFadedFace(void *v, uint32 color, uint32 fogColor, int32 alpha);
83
void DrawTexturedFaceBlended(void *v, uint8 sheetID);
84
} // namespace v4
85
86
namespace v3
87
{
88
void DrawObjectAnimation(void *objScr, void *ent, int32 XPos, int32 YPos);
89
}
90
91
void DrawTextMenu(void *menu, int32 XPos, int32 YPos);
92
void DrawTextMenuEntry(void *menu, int32 rowID, int32 XPos, int32 YPos, int32 textHighlight);
93
void DrawStageTextEntry(void *menu, int32 rowID, int32 XPos, int32 YPos, int32 textHighlight);
94
void DrawBlendedTextMenuEntry(void *menu, int32 rowID, int32 XPos, int32 YPos, int32 textHighlight);
95
96
} // namespace Legacy
97
98
#include "v3/DrawingLegacyv3.hpp"
99
#include "v4/DrawingLegacyv4.hpp"
100