summaryrefslogtreecommitdiff
path: root/include/g3dhax.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-06-15 04:24:48 +0200
committerTreeki <treeki@gmail.com>2011-06-15 04:24:48 +0200
commita36737f8a870182a69b67282a4a41ea5e056c8dd (patch)
tree7519166c3a232e5a5438105c660229e1a1f2e402 /include/g3dhax.h
parentba9d9bf56844028cbb227a8d1985a11446a022de (diff)
downloadkamek-a36737f8a870182a69b67282a4a41ea5e056c8dd.tar.gz
kamek-a36737f8a870182a69b67282a4a41ea5e056c8dd.zip
also, I still don't know how to use git
Diffstat (limited to '')
-rw-r--r--include/g3dhax.h268
1 files changed, 140 insertions, 128 deletions
diff --git a/include/g3dhax.h b/include/g3dhax.h
index 125a93f..ac5ba80 100644
--- a/include/g3dhax.h
+++ b/include/g3dhax.h
@@ -4,194 +4,206 @@
// nw4r::g3d wrapper
namespace nw4r {
-namespace g3d {
+ namespace g3d {
-class ResName {
-public:
- const char *name;
+ class ResName {
+ public:
+ const char *name;
+
+ ResName(const char *p = NULL) {
+ name = p;
+ }
+ };
- ResName(const char *p = NULL) {
- name = p;
- }
-};
+ class ResMdl {
+ public:
+ void * /*ResMdlData*/ data;
-class ResFile {
-public:
- void * /*ResFileData*/ data;
+ ResMdl(void *p = NULL) {
+ data = p;
+ }
- ResFile(void *p = NULL) {
- data = p;
- }
+ void * /*ResMat*/ GetResMat(const char *str) const;
+ };
- void Init();
- bool CheckRevision() const;
-
- void * /*ResMdl*/ GetResMdl(const char *str) const;
- void * /*ResPltt*/ GetResPltt(const ResName n) const;
- void * /*ResTex*/ GetResTex(const char *str) const;
- void * /*ResTex*/ GetResTex(const ResName n) const;
- void * /*ResTex*/ GetResTex(u32 idx) const;
- void * /*ResAnmChr*/ GetResAnmChr(const char *str) const;
- void * /*ResAnmVis*/ GetResAnmVis(const char *str) const;
- void * /*ResAnmClr*/ GetResAnmClr(const char *str) const;
- void * /*ResAnmTexPat*/ GetResAnmTexPat(const char *str) const;
- void * /*ResAnmTexSrt*/ GetResAnmTexSrt(const char *str) const;
- void * /*ResAnmScn*/ GetResAnmScn(const char *str) const;
-
- bool Bind(ResFile rhs);
-};
+ class ResFile {
+ public:
+ void * /*ResFileData*/ data;
-void *__ScnMdlSimple__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResMdl*/ mdl,
- int nView = 1);
+ ResFile(void *p = NULL) {
+ data = p;
+ }
+ void Init();
+ bool CheckRevision() const;
-void *__ScnMdl__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResMdl*/ mdl,
- u32 bufferOption,
- int nView = 1);
+ ResMdl GetResMdl(const char *str) const;
+ void * /*ResPltt*/ GetResPltt(const ResName n) const;
+ void * /*ResTex*/ GetResTex(const char *str) const;
+ void * /*ResTex*/ GetResTex(const ResName n) const;
+ void * /*ResTex*/ GetResTex(u32 idx) const;
+ void * /*ResAnmChr*/ GetResAnmChr(const char *str) const;
+ void * /*ResAnmVis*/ GetResAnmVis(const char *str) const;
+ void * /*ResAnmClr*/ GetResAnmClr(const char *str) const;
+ void * /*ResAnmTexPat*/ GetResAnmTexPat(const char *str) const;
+ void * /*ResAnmTexSrt*/ GetResAnmTexSrt(const char *str) const;
+ void * /*ResAnmScn*/ GetResAnmScn(const char *str) const;
+ bool Bind(ResFile rhs);
+ };
-void *__AnmObjChrRes__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResAnmChr*/ resAnm,
- void * /*ResMdl*/ resMdl,
- bool bHasCache);
+ void *__ScnMdlSimple__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResMdl*/ mdl,
+ int nView = 1);
-void *__AnmObjVisRes__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResAnmVis*/ resAnm,
- void * /*ResMdl*/ resMdl);
+ void *__ScnMdl__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResMdl*/ mdl,
+ u32 bufferOption,
+ int nView = 1);
-void *__AnmObjTexPatRes__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResAnmTexPat*/ resAnm,
- void * /*ResMdl*/ resMdl,
- bool bHasCache);
+ void *__AnmObjChrRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmChr*/ resAnm,
+ void * /*ResMdl*/ resMdl,
+ bool bHasCache);
-void *__AnmObjTexSrtRes__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResAnmTexSrt*/ resAnm,
- void * /*ResMdl*/ resMdl,
- bool bHasCache);
+ void *__AnmObjVisRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmVis*/ resAnm,
+ void * /*ResMdl*/ resMdl);
-void *__AnmObjMatClrRes__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResAnmMatClr*/ resAnm,
- void * /*ResMdl*/ resMdl,
- bool bHasCache);
+ void *__AnmObjTexPatRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmTexPat*/ resAnm,
+ void * /*ResMdl*/ resMdl,
+ bool bHasCache);
-void *__AnmObjShpRes__Construct(
- void * /*MEMAllocator*/ pHeap,
- u32 *pSize,
- void * /*ResAnmShp*/ resAnm,
- void * /*ResMdl*/ resMdl,
- bool bHasCache);
+ void *__AnmObjTexSrtRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmTexSrt*/ resAnm,
+ void * /*ResMdl*/ resMdl,
+ bool bHasCache);
+ void *__AnmObjMatClrRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmMatClr*/ resAnm,
+ void * /*ResMdl*/ resMdl,
+ bool bHasCache);
-bool InsertIntoScene(void *scnObj); // 80164F90
-extern void *g3dMemAllocator; // 8042A6A8
+ void *__AnmObjShpRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmShp*/ resAnm,
+ void * /*ResMdl*/ resMdl,
+ bool bHasCache);
-inline void *ConstructScnMdlSimple(void *mdl, int nView = 1) {
- return __ScnMdlSimple__Construct(g3dMemAllocator, 0, mdl, nView);
-}
-inline void *ConstructScnMdl(void *mdl, u32 bufferOption, int nView = 1) {
- return __ScnMdl__Construct(g3dMemAllocator, 0, mdl, bufferOption, nView);
-}
+ bool InsertIntoScene(void *scnObj); // 80164F90
+ extern void *g3dMemAllocator; // 8042A6A8
-}
+ inline void *ConstructScnMdlSimple(void *mdl, int nView = 1) {
+ return __ScnMdlSimple__Construct(g3dMemAllocator, 0, mdl, nView);
+ }
+
+ inline void *ConstructScnMdl(void *mdl, u32 bufferOption, int nView = 1) {
+ return __ScnMdl__Construct(g3dMemAllocator, 0, mdl, bufferOption, nView);
+ }
+
+
+
+ }
}
class mHeapAllocator_c { // Actually that weird subclass. INCOMPLETE!!
-public:
- char data1[0x10];
+ public:
+ char data1[0x10];
- mHeapAllocator_c();
- virtual ~mHeapAllocator_c();
- virtual void *alloc(u32 size);
- virtual void free(void *block);
+ mHeapAllocator_c();
+ virtual ~mHeapAllocator_c();
+ virtual void *alloc(u32 size);
+ virtual void free(void *block);
- bool link(s32 size, void *heap, const char *name, int align);
- u32 unlink();
+ bool link(s32 size, void *heap, const char *name, int align);
+ u32 unlink();
- char data2[8];
+ char data2[8];
};
namespace m3d {
// random, just dumped it here because I dunno where else
void DisableIndirectTexturing();
+ void InitTexObjWithResTex(GXTexObj *obj, /* ResTex */ void *resTex, GXTexWrapMode wrapS, GXTexWrapMode wrapT, GXTexFilter minFilt, GXTexFilter magFilt);
// I need to do scnLeaf_c some time...
class proc_c {
- public:
- proc_c();
- virtual ~proc_c();
+ public:
+ proc_c();
+ virtual ~proc_c();
- void setup(void *allocator = 0, u32 *size = 0);
- virtual int returnUnknown();
- virtual void free();
- virtual bool scheduleForDrawing();
- virtual void drawOpa();
- virtual void drawXlu();
+ void setup(void *allocator = 0, u32 *size = 0);
+ virtual int returnUnknown();
+ virtual void free();
+ virtual bool scheduleForDrawing();
+ virtual void drawOpa();
+ virtual void drawXlu();
- void setScnObjOption(ulong, ulong);
- bool getScnObjOption(ulong, ulong*);
+ void setScnObjOption(ulong, ulong);
+ bool getScnObjOption(ulong, ulong*);
- void setScale(float x, float y, float z);
- void setScale(Vec vec);
+ void setScale(float x, float y, float z);
+ void setScale(Vec vec);
- void setDrawMatrix(Mtx *mtx);
- void getLocalMatrix(Mtx *mtx);
- void getViewMatrix(Mtx *mtx);
+ void setDrawMatrix(Mtx *mtx);
+ void getLocalMatrix(Mtx *mtx);
+ void getViewMatrix(Mtx *mtx);
- void calcWorld(bool);
- void calcView(bool);
+ void calcWorld(bool);
+ void calcView(bool);
- void setDrawPriorities(int opa, int xlu);
+ void setDrawPriorities(int opa, int xlu);
- void *scnObj;
+ void *scnObj;
};
class mdl_c {
- public:
- mdl_c();
- virtual ~mdl_c();
+ public:
+ mdl_c();
+ virtual ~mdl_c();
- virtual void _vf0C();
- virtual void _vf10();
- virtual bool scheduleForDrawing();
- virtual void bindAnim(void *anim, float boo);
- virtual void _vf1C();
+ virtual void _vf0C();
+ virtual void _vf10();
+ virtual bool scheduleForDrawing();
+ virtual void bindAnim(void *anim, float boo);
+ virtual void _vf1C();
- bool setup(void *model, void *allocator, u32 bufferOption, int nView, u32 *size);
- void oneSetupType();
- void sub_80064BF0();
+ bool setup(nw4r::g3d::ResMdl model, void *allocator, u32 bufferOption, int nView, u32 *size);
+ void oneSetupType();
+ void sub_80064BF0();
- void setDrawMatrix(const Mtx matrix);
+ void setDrawMatrix(const Mtx matrix);
- char data[0x3C];
+ char data[0x3C];
};
};