summaryrefslogtreecommitdiff
path: root/include/rvl/tpl.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-12 23:17:12 +0100
committerTreeki <treeki@gmail.com>2011-03-12 23:17:12 +0100
commit7d4e4c0b34a613dd3c0220475ae4e448197522c1 (patch)
tree4f5cee367de3fdef4f9a7c84af59ffe76a2bb1c3 /include/rvl/tpl.h
downloadkamek-7d4e4c0b34a613dd3c0220475ae4e448197522c1.tar.gz
kamek-7d4e4c0b34a613dd3c0220475ae4e448197522c1.zip
initial commit. now I can start playing with stuff!
Diffstat (limited to '')
-rwxr-xr-xinclude/rvl/tpl.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/include/rvl/tpl.h b/include/rvl/tpl.h
new file mode 100755
index 0000000..9e68fac
--- /dev/null
+++ b/include/rvl/tpl.h
@@ -0,0 +1,107 @@
+/*---------------------------------------------------------------------------*
+ This TPL library provides a simple interface for TPL files, which used
+ to be the texture data format for the character pipeline in the Nintendo GameCube
+ software development kit.
+ This file also contains wrapper definitions for the conventional TEX API in
+ the new library.
+ *---------------------------------------------------------------------------*/
+
+#ifndef TPL_H
+#define TPL_H
+
+/*---------------------------------------------------------------------------*/
+#include "rvl/GXTexture.h"
+
+// Macros for conventional character pipeline functions
+#ifdef COMPATIBLE_OLD_TEXPALETTE
+
+#define TEXPalettePtr TPLPalettePtr
+#define TEXDescriptorPtr TPLDescriptorPtr
+#define TEXGetPalette TPLGetPalette
+#define TEXReleasePalette TPLReleasePalette
+#define TEXGet TPLGet
+
+#define TEXGetGXTexObjFromPalette TPLGetGXTexObjFromPalette
+#define TEXGetGXTexObjFromPaletteCI TPLGetGXTexObjFromPaletteCI
+
+#endif
+
+/*---------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*---------------------------------------------------------------------------*
+ Structure definitions
+ *---------------------------------------------------------------------------*/
+typedef struct
+{
+ u16 numEntries;
+ u8 unpacked;
+ u8 pad8;
+
+ GXTlutFmt format;
+ Ptr data;
+
+} TPLClutHeader, *TPLClutHeaderPtr;
+
+/*---------------------------------------------------------------------------*/
+typedef struct
+{
+ u16 height;
+ u16 width;
+
+ u32 format;
+ Ptr data;
+
+ GXTexWrapMode wrapS;
+ GXTexWrapMode wrapT;
+
+ GXTexFilter minFilter;
+ GXTexFilter magFilter;
+
+ float LODBias;
+
+ u8 edgeLODEnable;
+ u8 minLOD;
+ u8 maxLOD;
+ u8 unpacked;
+
+} TPLHeader, *TPLHeaderPtr;
+
+/*---------------------------------------------------------------------------*/
+typedef struct
+{
+ TPLHeaderPtr textureHeader;
+ TPLClutHeaderPtr CLUTHeader;
+
+} TPLDescriptor, *TPLDescriptorPtr;
+
+/*---------------------------------------------------------------------------*/
+typedef struct
+{
+ u32 versionNumber;
+
+ u32 numDescriptors;
+ TPLDescriptorPtr descriptorArray;
+
+} TPLPalette, *TPLPalettePtr;
+
+/*---------------------------------------------------------------------------*
+ Function prototypes
+ *---------------------------------------------------------------------------*/
+void TPLBind ( TPLPalettePtr pal );
+TPLDescriptorPtr TPLGet ( TPLPalettePtr pal, u32 id );
+
+void TPLGetGXTexObjFromPalette ( TPLPalettePtr pal, GXTexObj *to, u32 id );
+void TPLGetGXTexObjFromPaletteCI ( TPLPalettePtr pal, GXTexObj *to,
+ GXTlutObj *tlo, GXTlut tluts, u32 id );
+
+
+
+/*---------------------------------------------------------------------------*/
+#ifdef __cplusplus
+}
+#endif
+
+#endif