summaryrefslogtreecommitdiffstats
path: root/rwsdk/include/d3d8/rttoc.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-05-18 12:39:39 +0200
committeraap <aap@papnet.eu>2019-05-18 12:39:39 +0200
commit9e496100b7baff8834658f577d3138d9f8fc3765 (patch)
treea725be9b0dba9a4ce76c19a6629ef62c36e46814 /rwsdk/include/d3d8/rttoc.h
parentfixed pathfind (diff)
downloadre3-9e496100b7baff8834658f577d3138d9f8fc3765.tar
re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.gz
re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.bz2
re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.lz
re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.xz
re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.zst
re3-9e496100b7baff8834658f577d3138d9f8fc3765.zip
Diffstat (limited to '')
-rw-r--r--rwsdk/include/d3d8/rttoc.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/rwsdk/include/d3d8/rttoc.h b/rwsdk/include/d3d8/rttoc.h
new file mode 100644
index 00000000..02893aa8
--- /dev/null
+++ b/rwsdk/include/d3d8/rttoc.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ * *
+ * Module : rttoc.h *
+ * *
+ * Purpose : Table Of Contents (TOC) *
+ * *
+ **************************************************************************/
+
+#ifndef RTTOC_H
+#define RTTOC_H
+
+/**
+ * \defgroup rttoc RtTOC
+ * \ingroup rttool
+ *
+ * Table Of Contents (TOC) - e.g. creating a TOC for a RwStream.
+ */
+
+/****************************************************************************
+ Includes
+ */
+#include "rwcore.h"
+
+#include "rpcriter.h"
+
+/****************************************************************************
+ Defines
+ */
+
+/****************************************************************************
+ Global Types
+ */
+
+typedef struct _rtTOCGUID _rtTOCGUID;
+struct _rtTOCGUID
+{
+ RwUInt32 data1;
+ RwUInt16 data2;
+ RwUInt16 data3;
+ RwUInt8 data4[8];
+};
+
+typedef struct RtTOCEntry RtTOCEntry;
+/**
+ * \ingroup rttoc
+ * \struct RtTOCEntry
+ *
+ * BLAH
+ */
+struct RtTOCEntry
+{
+ RwCorePluginID id; /**< Chunk ID */
+ RwUInt32 offset;/**< Offset of chunk from the start of the file
+ * including TOC */
+ _rtTOCGUID guid; /**< GUID */
+};
+
+typedef struct RtTOC RtTOC;
+
+/**
+ * \ingroup rttoc
+ * \struct RtTOC
+ *
+ * BLAH
+ */
+struct RtTOC
+{
+ RwInt32 numEntries; /**< Number of entries*/
+ RtTOCEntry entry[1]; /**< Entry*/
+};
+
+/****************************************************************************
+ Function prototypes
+ */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/* Create/Destroy */
+extern RtTOC *RtTOCCreate(RwStream *stream);
+extern void RtTOCDestroy(RtTOC *toc);
+
+/* Access */
+extern RwInt32 RtTOCGetNumEntries(const RtTOC *toc);
+extern RtTOCEntry *RtTOCGetEntry(RtTOC *toc, RwInt32 entry);
+
+/* Serialization */
+extern RwUInt32 RtTOCStreamGetSize(const RtTOC *toc);
+extern const RtTOC *RtTOCStreamWrite(RtTOC *toc, RwStream *stream);
+extern RtTOC *RtTOCStreamRead(RwStream *stream);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* RTTOC_H */