summaryrefslogtreecommitdiff
path: root/src/rwcharset.h
blob: 3988654a80bcc42dc146cb8632f4234f16f87d9d (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
namespace rw {

struct Charset
{
	struct Desc {
		int32 count;	// num of chars
		int32 tileWidth, tileHeight;	// chars in raster
		int32 width, height;	// of char
		int32 width_internal, height_internal;	// + border
	} desc;
	Raster *raster;

	static bool32 open(void);
	static void close(void);
	static Charset *create(const RGBA *foreground, const RGBA *background);
	void destroy(void);
	Charset *setColors(const RGBA *foreground, const RGBA *background);
	void print(const char *str, int32 x, int32 y, bool32 hideSpaces);
	void printBuffered(const char *str, int32 x, int32 y, bool32 hideSpaces);
	static void flushBuffer(void);
private:
	void printChar(int32 c, int32 x, int32 y);
};

}