summaryrefslogtreecommitdiff
path: root/src/animtiles.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-07-23 23:55:14 +0200
committerTreeki <treeki@gmail.com>2011-07-23 23:55:14 +0200
commit803c43cce9a5494d842856dd2e2aeb40666fe48a (patch)
tree14ced075735b06eb5768302602d92c1f01891b25 /src/animtiles.cpp
parent77d7cadea5d8762a0e2a7d9a1a40f314748a6dcf (diff)
parent693dc221a8af9a90754a3e500f459c4a9517b439 (diff)
downloadkamek-803c43cce9a5494d842856dd2e2aeb40666fe48a.tar.gz
kamek-803c43cce9a5494d842856dd2e2aeb40666fe48a.zip
merged
Diffstat (limited to '')
-rw-r--r--src/animtiles.cpp122
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);
+}