forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PCX.h
40 lines (30 loc) · 977 Bytes
/
PCX.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
//This can be used to load PCX files into BSurfaces!
#pragma once
#include <Drawing.h>
#include <Surface.h>
#include <GeneralDefinitions.h>
class PCX
{
protected:
// Load a PCX file
bool ForceLoadFile(const char* pFileName, int flag1, int flag2)
{ JMP_THIS(0x6B9D00); }
public:
static PCX * const Instance;
static WORD DefaultTransparentColor;
//Load a PCX file
bool LoadFile(const char* pFileName, int flag1 = 2, int flag2 = 0)
{
if(Instance->GetSurface(pFileName, nullptr)) {
return true;
}
return Instance->ForceLoadFile(pFileName, flag1, flag2);
}
// Get a BSurface for a PCX file. File needs to be loaded some time first!
BSurface* GetSurface(const char* pFileName, BytePalette * pPalette = nullptr)
{ JMP_THIS(0x6BA140); }
// Draws a PCX file
bool BlitToSurface(RectangleStruct *BoundingRect, DSurface *TargetSurface, BSurface *PCXSurface, WORD TransparentColor = DefaultTransparentColor)
{ JMP_THIS(0x6BA580); }
void *Buffer;
};