vitasdk
Documentation of the vitasdk
gxt.h
Go to the documentation of this file.
1
7
#ifndef _PSP2_GXT_H_
8
#define _PSP2_GXT_H_
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
13
14
#include <
vitasdk/build_utils.h
>
15
#include <
psp2/gxm.h
>
16
18
typedef
enum
SceGxtErrorCode
{
19
SCE_GXT_ERROR_INVALID_VALUE
= 0x805D0000,
20
SCE_GXT_ERROR_INVALID_POINTER
= 0x805D0001,
21
SCE_GXT_ERROR_INVALID_ALIGNMENT
= 0x805D0002
22
}
SceGxtErrorCode
;
23
25
typedef
struct
SceGxtHeader
{
26
uint32_t
tag
;
27
uint32_t
version
;
28
uint32_t
numTextures
;
29
uint32_t
dataOffset
;
30
uint32_t
dataSize
;
31
uint32_t
numP4Palettes
;
32
uint32_t
numP8Palettes
;
33
uint32_t
pad
;
34
}
SceGxtHeader
;
35
VITASDK_BUILD_ASSERT_EQ
(0x20,
SceGxtHeader
);
36
38
typedef
struct
SceGxtTextureInfo
{
39
uint32_t
dataOffset
;
40
uint32_t
dataSize
;
41
uint32_t
paletteIndex
;
42
uint32_t
flags
;
43
uint32_t
type
;
44
uint32_t
format
;
45
uint16_t
width
;
46
uint16_t
height
;
47
uint8_t
mipCount
;
48
uint8_t
pad
[3];
49
}
SceGxtTextureInfo
;
50
VITASDK_BUILD_ASSERT_EQ
(0x20,
SceGxtTextureInfo
);
51
58
static
const
void
*sceGxtGetDataAddress(
const
void
*gxt){
59
const
SceGxtHeader
*header = (
const
SceGxtHeader
*)gxt;
60
return
(
const
void
*)(((
SceUIntPtr
)gxt) + header->
dataOffset
);
61
}
62
63
#ifdef __cplusplus
64
}
65
#endif
66
67
#endif
/* _PSP2_GXT_H_ */
68
build_utils.h
SceGxtTextureInfo::format
uint32_t format
Texture format.
Definition:
gxt.h:44
SceGxtErrorCode
SceGxtErrorCode
GXT error codes.
Definition:
gxt.h:18
SceGxtHeader::pad
uint32_t pad
Padding.
Definition:
gxt.h:33
VITASDK_BUILD_ASSERT_EQ
VITASDK_BUILD_ASSERT_EQ(0x20, SceGxtHeader)
SceGxtHeader::dataOffset
uint32_t dataOffset
Offset to the texture data.
Definition:
gxt.h:29
SceGxtHeader::numP4Palettes
uint32_t numP4Palettes
Number of 16 entry palettes.
Definition:
gxt.h:31
SceGxtTextureInfo::paletteIndex
uint32_t paletteIndex
Index of the palette.
Definition:
gxt.h:41
SceGxtHeader::version
uint32_t version
Version number.
Definition:
gxt.h:27
SceGxtTextureInfo::dataSize
uint32_t dataSize
Size of the texture data.
Definition:
gxt.h:40
SceGxtTextureInfo::height
uint16_t height
Texture height.
Definition:
gxt.h:46
SceGxtHeader::numP8Palettes
uint32_t numP8Palettes
Number of 256 entry palettes.
Definition:
gxt.h:32
SceGxtTextureInfo::flags
uint32_t flags
Texture flags.
Definition:
gxt.h:42
SceGxtTextureInfo::pad
uint8_t pad[3]
Padding.
Definition:
gxt.h:48
SceGxtTextureInfo::width
uint16_t width
Texture width.
Definition:
gxt.h:45
SceGxtTextureInfo::dataOffset
uint32_t dataOffset
Offset to the texture data.
Definition:
gxt.h:39
SceGxtHeader::dataSize
uint32_t dataSize
Total size of the texture data.
Definition:
gxt.h:30
SceGxtTextureInfo::mipCount
uint8_t mipCount
Number of mipmaps.
Definition:
gxt.h:47
SceGxtHeader::numTextures
uint32_t numTextures
Number of textures.
Definition:
gxt.h:28
SceGxtHeader::tag
uint32_t tag
GXT Identifier.
Definition:
gxt.h:26
SceGxtTextureInfo::type
uint32_t type
Texture type.
Definition:
gxt.h:43
SCE_GXT_ERROR_INVALID_ALIGNMENT
@ SCE_GXT_ERROR_INVALID_ALIGNMENT
Definition:
gxt.h:21
SCE_GXT_ERROR_INVALID_VALUE
@ SCE_GXT_ERROR_INVALID_VALUE
Definition:
gxt.h:19
SCE_GXT_ERROR_INVALID_POINTER
@ SCE_GXT_ERROR_INVALID_POINTER
Definition:
gxt.h:20
SceGxtHeader
Header for a GXT file.
Definition:
gxt.h:25
SceGxtTextureInfo
This structure contains information about each texture in the GXT file.
Definition:
gxt.h:38
SceUIntPtr
unsigned int SceUIntPtr
Definition:
types.h:84
gxm.h
include
psp2
gxt.h
Vita SDK