diff options
author | Treeki <treeki@gmail.com> | 2011-07-23 23:55:14 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-07-23 23:55:14 +0200 |
commit | 803c43cce9a5494d842856dd2e2aeb40666fe48a (patch) | |
tree | 14ced075735b06eb5768302602d92c1f01891b25 /src/randtiles.h | |
parent | 77d7cadea5d8762a0e2a7d9a1a40f314748a6dcf (diff) | |
parent | 693dc221a8af9a90754a3e500f459c4a9517b439 (diff) | |
download | kamek-803c43cce9a5494d842856dd2e2aeb40666fe48a.tar.gz kamek-803c43cce9a5494d842856dd2e2aeb40666fe48a.zip |
merged
Diffstat (limited to 'src/randtiles.h')
-rw-r--r-- | src/randtiles.h | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/src/randtiles.h b/src/randtiles.h index ab2553d..14355da 100644 --- a/src/randtiles.h +++ b/src/randtiles.h @@ -1,63 +1,63 @@ -#ifndef __NEWER_RANDTILES_H
-#define __NEWER_RANDTILES_H
-
-#include <common.h>
-#include "fileload.h"
-
-#define RAND_CHECK_HORZ
-#define RAND_CHECK_VERT
-#define RAND_CHECK_BOTH
-
-struct RandTiles_Header {
- u32 magic;
- u32 sectionCount;
-};
-
-struct RandTiles_Section {
- u32 nameHash;
- u32 entryCount;
-};
-
-struct RandTiles_Entry {
- u16 startTile;
- u16 endTile;
- u8 count;
- u8 type;
- u16 reserved;
- u32 dataOffset;
-};
-
-inline u32 RandTiles_GetSectionCount(void *file) {
- return ((RandTiles_Header*)file)->sectionCount;
-}
-
-inline u32 *RandTiles_GetOffsets(void *file) {
- return (u32*)(((RandTiles_Header*)file)+1);
-}
-
-inline RandTiles_Section *RandTiles_GetSection(void *file, int id) {
- u32 offs = RandTiles_GetOffsets(file)[id];
- return (RandTiles_Section*)(((char*)file)+offs);
-};
-
-inline RandTiles_Entry *RandTiles_GetTiles(void *file, RandTiles_Section *section) {
- return (RandTiles_Entry*)(section+1);
-}
-
-inline RandTiles_Entry *RandTiles_GetTiles(void *file, int sectionID) {
- return (RandTiles_Entry*)(RandTiles_GetSection(file, sectionID)+1);
-}
-
-inline char *RandTiles_GetName(void *file, RandTiles_Section *section) {
- return ((char*)file)+section->nameOffset;
-}
-
-inline u16 *RandTiles_GetData(void *file, RandTiles_Entry *entry) {
- return (u16*)(((char*)file)+entry->dataOffset);
-}
-
-u32 djb2(u8 *str);
-RandTiles_Section *RandTiles_Search(void *file, u32 nameHash);
-
-
-#endif
+#ifndef __NEWER_RANDTILES_H +#define __NEWER_RANDTILES_H + +#include <common.h> +#include "fileload.h" + +#define RAND_CHECK_HORZ +#define RAND_CHECK_VERT +#define RAND_CHECK_BOTH + +struct RandTiles_Header { + u32 magic; + u32 sectionCount; +}; + +struct RandTiles_Section { + u32 nameHash; + u32 entryCount; +}; + +struct RandTiles_Entry { + u16 startTile; + u16 endTile; + u8 count; + u8 type; + u16 reserved; + u32 dataOffset; +}; + +inline u32 RandTiles_GetSectionCount(void *file) { + return ((RandTiles_Header*)file)->sectionCount; +} + +inline u32 *RandTiles_GetOffsets(void *file) { + return (u32*)(((RandTiles_Header*)file)+1); +} + +inline RandTiles_Section *RandTiles_GetSection(void *file, int id) { + u32 offs = RandTiles_GetOffsets(file)[id]; + return (RandTiles_Section*)(((char*)file)+offs); +}; + +inline RandTiles_Entry *RandTiles_GetTiles(void *file, RandTiles_Section *section) { + return (RandTiles_Entry*)(section+1); +} + +inline RandTiles_Entry *RandTiles_GetTiles(void *file, int sectionID) { + return (RandTiles_Entry*)(RandTiles_GetSection(file, sectionID)+1); +} + +inline char *RandTiles_GetName(void *file, RandTiles_Section *section) { + return ((char*)file)+section->nameOffset; +} + +inline u16 *RandTiles_GetData(void *file, RandTiles_Entry *entry) { + return (u16*)(((char*)file)+entry->dataOffset); +} + +u32 djb2(u8 *str); +RandTiles_Section *RandTiles_Search(void *file, u32 nameHash); + + +#endif |