diff options
author | Colin Noga <Tempus@Spectrum-Song.local> | 2011-07-23 11:47:43 -0500 |
---|---|---|
committer | Colin Noga <Tempus@Spectrum-Song.local> | 2011-07-23 11:47:43 -0500 |
commit | 09d075c5469f64f500de70123bbb1042315d7ac0 (patch) | |
tree | ee92906230c7fa01e89afb84beeb65b8855393ad /src/animtiles.cpp | |
parent | ffa9dabc6b535da90b3cd8a7849079c546cacfbd (diff) | |
download | kamek-09d075c5469f64f500de70123bbb1042315d7ac0.tar.gz kamek-09d075c5469f64f500de70123bbb1042315d7ac0.zip |
Added Crowd clapper. Changed everything to LF only. If anyone on Windows tries to read the code now, they will be faced with a single impenetrable line!
Diffstat (limited to 'src/animtiles.cpp')
-rw-r--r-- | src/animtiles.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/animtiles.cpp b/src/animtiles.cpp index 26cdbf8..2efba16 100644 --- a/src/animtiles.cpp +++ b/src/animtiles.cpp @@ -1,61 +1,61 @@ -#include <common.h>
-#include <game.h>
-#include "fileload.h"
-
-struct AnimDef_Header {
- u32 magic;
- u32 entryCount;
-};
-
-struct AnimDef_Entry {
- u16 texNameOffset;
- u16 frameDelayOffset;
- u16 tileNum;
- u8 tilesetNum;
- u8 reverse;
-};
-
-FileHandle fh;
-
-void DoTiles(void* self) {
- //OSReport("fucker\n");
- AnimDef_Header *header;
-
- header = (AnimDef_Header*)LoadFile(&fh, "/NewerRes/AnimTiles.bin");
-
- if (!header) {
- OSReport("anim load fail\n");
- return;
- }
-
- if (header->magic != 'NWRa') {
- OSReport("anim info incorrect\n");
- FreeFile(&fh);
- return;
- }
-
- AnimDef_Entry *entries = (AnimDef_Entry*)(header+1);
-
- OSReport("Loading animated tiles\n");
-
- for (int i = 0; i < header->entryCount; i++) {
- AnimDef_Entry *entry = &entries[i];
- char *name = (char*)fh.filePtr+entry->texNameOffset;
- char *frameDelays = (char*)fh.filePtr+entry->frameDelayOffset;
-
- char realName[0x40];
- snprintf(realName, 0x40, "BG_tex/%s", name);
-
- void *blah = BgTexMng__LoadAnimTile(self, entry->tilesetNum, entry->tileNum, realName, frameDelays, entry->reverse);
-
- OSReport("[%d] %s %08x\n", i, name, blah);
- //OSReport("Returned: %08x\n", blah);
- }
-
- OSReport("Animated tiles complete\n");
-}
-
-
-void DestroyTiles(void *self) {
- FreeFile(&fh);
-}
+#include <common.h> +#include <game.h> +#include "fileload.h" + +struct AnimDef_Header { + u32 magic; + u32 entryCount; +}; + +struct AnimDef_Entry { + u16 texNameOffset; + u16 frameDelayOffset; + u16 tileNum; + u8 tilesetNum; + u8 reverse; +}; + +FileHandle fh; + +void DoTiles(void* self) { + //OSReport("fucker\n"); + AnimDef_Header *header; + + header = (AnimDef_Header*)LoadFile(&fh, "/NewerRes/AnimTiles.bin"); + + if (!header) { + OSReport("anim load fail\n"); + return; + } + + if (header->magic != 'NWRa') { + OSReport("anim info incorrect\n"); + FreeFile(&fh); + return; + } + + AnimDef_Entry *entries = (AnimDef_Entry*)(header+1); + + OSReport("Loading animated tiles\n"); + + for (int i = 0; i < header->entryCount; i++) { + AnimDef_Entry *entry = &entries[i]; + char *name = (char*)fh.filePtr+entry->texNameOffset; + char *frameDelays = (char*)fh.filePtr+entry->frameDelayOffset; + + char realName[0x40]; + snprintf(realName, 0x40, "BG_tex/%s", name); + + void *blah = BgTexMng__LoadAnimTile(self, entry->tilesetNum, entry->tileNum, realName, frameDelays, entry->reverse); + + OSReport("[%d] %s %08x\n", i, name, blah); + //OSReport("Returned: %08x\n", blah); + } + + OSReport("Animated tiles complete\n"); +} + + +void DestroyTiles(void *self) { + FreeFile(&fh); +} |