NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
lyt_arcResourceAccessor.h
1#ifndef NW4R_LYT_ARC_RESOURCE_ACCESSOR_H
2#define NW4R_LYT_ARC_RESOURCE_ACCESSOR_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/lyt/lyt_resourceAccessor.h>
6
7#include <nw4r/ut.h>
8
9#include <revolution/ARC.h>
10
11namespace nw4r {
12namespace lyt {
13
14/******************************************************************************
15 *
16 * FontRefLink
17 *
18 ******************************************************************************/
20public:
21 const char* GetFontName() const {
22 return mFontName;
23 }
24
25 ut::Font* GetFont() const {
26 return mpFont;
27 }
28
29public:
30 NW4R_UT_LINKLIST_NODE_DECL(); // at 0x0
31
32protected:
33 static const int FONTNAMEBUF_MAX = 128;
34
35protected:
36 char mFontName[FONTNAMEBUF_MAX]; // at 0x8
37 ut::Font* mpFont; // at 0x88
38};
39
40NW4R_UT_LINKLIST_TYPEDEF_DECL(FontRefLink);
41
42/******************************************************************************
43 *
44 * ArcResourceAccessor
45 *
46 ******************************************************************************/
47class ArcResourceAccessor : public ResourceAccessor {
48public:
49 static const ulong RES_TYPE_ANIMATION = 'anim';
50 static const ulong RES_TYPE_LAYOUT = 'blyt';
51 static const ulong RES_TYPE_FONT = 'font';
52 static const ulong RES_TYPE_TEXTURE = 'timg';
53
54public:
55 ArcResourceAccessor();
56
57 virtual void* GetResource(ulong type, const char* pName,
58 size_t* pSize); // at 0xC
59
60 virtual ut::Font* GetFont(const char* pName); // at 0x10
61
62 bool Attach(void* pArchive, const char* pRootDir);
63 void *Detach();
64
65 bool IsAttached() const {
66 return mArcBuf != NULL;
67 }
68
69protected:
70 static const int ROOTPATH_MAX = 128;
71
72protected:
73 ARCHandle mArcHandle; // at 0x4
74 void* mArcBuf; // at 0x20
75 FontRefLinkList mFontList; // at 0x24
76 char mResRootDir[ROOTPATH_MAX]; // at 0x30
77};
78
79} // namespace lyt
80} // namespace nw4r
81
82#endif
2D graphics drawing library.