sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
Loading...
Searching...
No Matches
gsToolkit.h
Go to the documentation of this file.
1
5
// ____ ___ | / _____ _____
6
// | __ | |___/ | |
7
// |___| ___| | \ __|__ | gsKit Open Source Project.
8
// ----------------------------------------------------------------------
9
// Copyright 2004 - Chris "Neovanglist" Gilbert <Neovanglist@LainOS.org>
10
// Licenced under Academic Free License version 2.0
11
// Review gsKit README & LICENSE files for further details.
12
//
13
// gsToolkit.h - Header for gsToolkit.c
14
//
15
16
#ifndef __GSTOOLKIT_H__
17
#define __GSTOOLKIT_H__
18
19
#include "
gsKit.h
"
20
21
struct
gsBitMapFileHeader
22
{
23
u16 Type;
24
u32 Size;
25
u16 Reserved1;
26
u16 Reserved2;
27
u32 Offset;
28
}
__attribute__
((packed));
29
typedef
struct
gsBitMapFileHeader
GSBMFHDR;
30
31
struct
gsBitMapInfoHeader
32
{
33
u32 Size;
34
u32 Width;
35
u32 Height;
36
u16 Planes;
37
u16 BitCount;
38
u32 Compression;
39
u32 SizeImage;
40
u32 XPelsPerMeter;
41
u32 YPelsPerMeter;
42
u32 ColorUsed;
43
u32 ColorImportant;
44
}
__attribute__
((packed));
45
typedef
struct
gsBitMapInfoHeader
GSBMIHDR;
46
47
struct
gsBitMapClut
48
{
49
u8 Blue;
50
u8 Green;
51
u8 Red;
52
u8 Alpha;
53
}
__attribute__
((packed));
54
typedef
struct
gsBitMapClut
GSBMCLUT;
55
56
struct
gsBitmap
57
{
58
GSBMFHDR FileHeader;
59
GSBMIHDR InfoHeader;
60
char
*Texture;
61
GSBMCLUT *Clut;
62
};
63
typedef
struct
gsBitmap
GSBITMAP;
64
65
//remove fontm specific things here
66
#define GSKIT_FTYPE_FNT 0x00
67
#define GSKIT_FTYPE_BMP_DAT 0x01
68
#define GSKIT_FTYPE_PNG_DAT 0x02
69
73
struct
gsFont
74
{
75
char
*
Path
;
76
char
*
Path_DAT
;
77
u8
Type
;
78
u8 *
RawData
;
79
int
RawSize
;
80
GSTEXTURE *
Texture
;
81
u32
CharWidth
;
82
u32
CharHeight
;
83
u32
HChars
;
84
u32
VChars
;
85
s16 *
Additional
;
86
int
pgcount;
87
};
88
typedef
struct
gsFont
GSFONT;
89
90
#ifdef __cplusplus
91
extern
"C"
{
92
#endif
93
94
int
gsKit_texture_bmp(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
);
95
int
gsKit_texture_png(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
);
96
int
gsKit_texture_jpeg_scale(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
,
bool
scale_down);
97
int
gsKit_texture_jpeg(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
);
98
int
gsKit_texture_tiff(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
);
99
int
gsKit_texture_tga(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
);
100
int
gsKit_texture_raw(GSGLOBAL *
gsGlobal
, GSTEXTURE *
Texture
,
char
*
Path
);
101
103
GSFONT *
gsKit_init_font
(u8 type,
char
*path);
104
GSFONT *gsKit_init_font_raw(u8 type, u8 *data,
int
size);
105
106
int
gsKit_font_upload(GSGLOBAL *
gsGlobal
, GSFONT *
gsFont
);
107
int
gsKit_font_upload_raw(GSGLOBAL *
gsGlobal
, GSFONT *
gsFont
);
108
109
//int gsKit_texture_fnt(GSGLOBAL *gsGlobal, GSFONT *gsFont);
110
int
gsKit_texture_fnt_raw(GSGLOBAL *
gsGlobal
, GSFONT *
gsFont
);
111
112
void
gsKit_font_print_scaled(GSGLOBAL *
gsGlobal
, GSFONT *
gsFont
,
float
X,
float
Y,
int
Z,
113
float
scale,
unsigned
long
color,
const
char
*String);
114
115
#define gsKit_font_print(gsGlobal, gsFont, X, Y, Z, color, String) \
116
gsKit_font_print_scaled(gsGlobal, gsFont, X, Y, Z, 1.0f, color, String);
117
118
#ifdef __cplusplus
119
}
120
#endif
121
122
#endif
/* __GSTOOLKIT_H__ */
gsKit.h
gsKit_init_font
GSFONT * gsKit_init_font(u8 type, char *path)
Initialize Font Object (From Memory).
Definition
gsToolkit.c:968
gsBitMapClut
Definition
gsToolkit.h:48
gsBitMapFileHeader
Definition
gsToolkit.h:22
gsBitMapInfoHeader
Definition
gsToolkit.h:32
gsBitmap
Definition
gsToolkit.h:57
gsFont
Definition
gsToolkit.h:74
gsFont::Type
u8 Type
Font Type.
Definition
gsToolkit.h:77
gsFont::RawData
u8 * RawData
Raw File Data.
Definition
gsToolkit.h:78
gsFont::Path_DAT
char * Path_DAT
Path (string) to the Glyph DAT File.
Definition
gsToolkit.h:76
gsFont::Path
char * Path
Path (string) to the Font File.
Definition
gsToolkit.h:75
gsFont::VChars
u32 VChars
Character Columns.
Definition
gsToolkit.h:84
gsFont::RawSize
int RawSize
Raw File Datasize.
Definition
gsToolkit.h:79
gsFont::Texture
GSTEXTURE * Texture
Font Texture Object.
Definition
gsToolkit.h:80
gsFont::HChars
u32 HChars
Character Rows.
Definition
gsToolkit.h:83
gsFont::Additional
s16 * Additional
Additional Font Data.
Definition
gsToolkit.h:85
gsFont::CharHeight
u32 CharHeight
Character Height.
Definition
gsToolkit.h:82
gsFont::CharWidth
u32 CharWidth
Character Width.
Definition
gsToolkit.h:81
gsGlobal
Definition
gsInit.h:900
__attribute__
Definition
gsInit.h:971
gskit-toolkit
include
gsToolkit.h
Generated by
1.18.0