summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2BitImage.h
blob: 53b670fa0b0208a5756aa7a88ec543aea211ad37 (plain)
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
#ifndef T2DLL_T2BITIMAGE_H
#define T2DLL_T2BITIMAGE_H
#include "../common.h"

// unknown name
struct Bitmap256 {
	BITMAPINFOHEADER header;
	short palette[256];
};

class AFX_CLASS_EXPORT T2BitImage {
public:
	T2BitImage(const char* path, unsigned int id, BOOL flip);
	T2BitImage(HINSTANCE path, unsigned int id, BOOL flip);
	T2BitImage(const RECT&);
	virtual ~T2BitImage();
	virtual BOOL IsExist();

	BOOL BeginDrawing();
	void EndDrawing();
	void CopyImage(T2BitImage&, const RECT&, const RECT&, int unk = 0, CRgn* rgn = NULL);
	void CopyImage(CDC*, const RECT&, const RECT&, int unk = 0, CRgn* rgn = NULL);
	void Clear(int);
	void SetBackGndColor(int);
	void SetForeGndColor(int);
	void SetOrigin(int, int);
	void SetClipRect(RECT*);
	void SetHalftoneMode(BOOL);
	void DrawFocusRect(RECT);
	void FillMesh(RECT, int);
	void FillRect(RECT, int);
	int GetPixel(int, int);
	int GetPixel(const POINT&);
	void DrawFrameRect(RECT, int);

	int GetParam() { return mParam; }
	void SetParam(int v) { mParam = v; }

	Bitmap256 mBitmap;
	unsigned char *mData;
	POINT mOrigin;
	HGLOBAL mMemHandle;
	int mForeGndColor;
	int mBackGndColor;
	RECT mClipRect;
	BOOL mHasClipRect;
	BOOL mHalftoneMode;
	int mParam;

protected:
	void SetupBitmap(BITMAPINFO* info, BOOL flip);
	void DrawFocusRect2(RECT);
	void DrawFocusLine(int, int, int, int);
	void DrawFrameLine(int, int, int, int, int);
};
#endif