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 {
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;
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];
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 
uint32_t format
Texture format.
Definition: gxt.h:44
SceGxtErrorCode
GXT error codes.
Definition: gxt.h:18
uint32_t pad
Padding.
Definition: gxt.h:33
VITASDK_BUILD_ASSERT_EQ(0x20, SceGxtHeader)
uint32_t dataOffset
Offset to the texture data.
Definition: gxt.h:29
uint32_t numP4Palettes
Number of 16 entry palettes.
Definition: gxt.h:31
uint32_t paletteIndex
Index of the palette.
Definition: gxt.h:41
uint32_t version
Version number.
Definition: gxt.h:27
uint32_t dataSize
Size of the texture data.
Definition: gxt.h:40
uint16_t height
Texture height.
Definition: gxt.h:46
uint32_t numP8Palettes
Number of 256 entry palettes.
Definition: gxt.h:32
uint32_t flags
Texture flags.
Definition: gxt.h:42
uint8_t pad[3]
Padding.
Definition: gxt.h:48
uint16_t width
Texture width.
Definition: gxt.h:45
uint32_t dataOffset
Offset to the texture data.
Definition: gxt.h:39
uint32_t dataSize
Total size of the texture data.
Definition: gxt.h:30
uint8_t mipCount
Number of mipmaps.
Definition: gxt.h:47
uint32_t numTextures
Number of textures.
Definition: gxt.h:28
uint32_t tag
GXT Identifier.
Definition: gxt.h:26
uint32_t type
Texture type.
Definition: gxt.h:43
@ SCE_GXT_ERROR_INVALID_ALIGNMENT
Definition: gxt.h:21
@ SCE_GXT_ERROR_INVALID_VALUE
Definition: gxt.h:19
@ SCE_GXT_ERROR_INVALID_POINTER
Definition: gxt.h:20
Header for a GXT file.
Definition: gxt.h:25
This structure contains information about each texture in the GXT file.
Definition: gxt.h:38
unsigned int SceUIntPtr
Definition: types.h:84