sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
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
22{
23 u16 Type;
24 u32 Size;
25 u16 Reserved1;
26 u16 Reserved2;
27 u32 Offset;
28} __attribute__ ((packed));
29typedef struct gsBitMapFileHeader GSBMFHDR;
30
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));
45typedef struct gsBitMapInfoHeader GSBMIHDR;
46
48{
49 u8 Blue;
50 u8 Green;
51 u8 Red;
52 u8 Alpha;
53} __attribute__ ((packed));
54typedef struct gsBitMapClut GSBMCLUT;
55
57{
58 GSBMFHDR FileHeader;
59 GSBMIHDR InfoHeader;
60 char *Texture;
61 GSBMCLUT *Clut;
62};
63typedef 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
73struct gsFont
74{
75 char *Path;
76 char *Path_DAT;
77 u8 Type;
78 u8 *RawData;
79 int RawSize;
80 GSTEXTURE *Texture;
83 u32 HChars;
84 u32 VChars;
86 int pgcount;
87};
88typedef struct gsFont GSFONT;
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
94int gsKit_texture_bmp(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path);
95int gsKit_texture_png(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path);
96int gsKit_texture_jpeg_scale(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path, bool scale_down);
97int gsKit_texture_jpeg(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path);
98int gsKit_texture_tiff(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path);
99int gsKit_texture_tga(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path);
100int gsKit_texture_raw(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, char *Path);
101
103GSFONT *gsKit_init_font(u8 type, char *path);
104GSFONT *gsKit_init_font_raw(u8 type, u8 *data, int size);
105
106int gsKit_font_upload(GSGLOBAL *gsGlobal, GSFONT *gsFont);
107int gsKit_font_upload_raw(GSGLOBAL *gsGlobal, GSFONT *gsFont);
108
109//int gsKit_texture_fnt(GSGLOBAL *gsGlobal, GSFONT *gsFont);
110int gsKit_texture_fnt_raw(GSGLOBAL *gsGlobal, GSFONT *gsFont);
111
112void 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__ */
GSFONT * gsKit_init_font(u8 type, char *path)
Initialize Font Object (From Memory).
Definition gsToolkit.c:968
u8 Type
Font Type.
Definition gsToolkit.h:77
u8 * RawData
Raw File Data.
Definition gsToolkit.h:78
char * Path_DAT
Path (string) to the Glyph DAT File.
Definition gsToolkit.h:76
char * Path
Path (string) to the Font File.
Definition gsToolkit.h:75
u32 VChars
Character Columns.
Definition gsToolkit.h:84
int RawSize
Raw File Datasize.
Definition gsToolkit.h:79
GSTEXTURE * Texture
Font Texture Object.
Definition gsToolkit.h:80
u32 HChars
Character Rows.
Definition gsToolkit.h:83
s16 * Additional
Additional Font Data.
Definition gsToolkit.h:85
u32 CharHeight
Character Height.
Definition gsToolkit.h:82
u32 CharWidth
Character Width.
Definition gsToolkit.h:81