summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-07-24 14:10:37 -0500
committerColin Noga <Tempus@chronometry.ca>2012-07-24 14:10:37 -0500
commit45aee4cd0356305fc1a1ebec5d15bc0e17a54b0a (patch)
treef6b80204398bb71e2a3d454005526c216b792074
parent0b935b5b0a4dfba5621d5f925ca088007811fc49 (diff)
downloadkamek-45aee4cd0356305fc1a1ebec5d15bc0e17a54b0a.tar.gz
kamek-45aee4cd0356305fc1a1ebec5d15bc0e17a54b0a.zip
trying laki fixes, linked in anmClr
Diffstat (limited to '')
-rw-r--r--include/g3dhax.h40
-rw-r--r--kamek_pal.x24
-rw-r--r--src/koopatlas/map.cpp4
-rw-r--r--src/koopatlas/shop.cpp48
-rw-r--r--src/koopatlas/shop.h4
5 files changed, 116 insertions, 4 deletions
diff --git a/include/g3dhax.h b/include/g3dhax.h
index d358436..eb4ffd0 100644
--- a/include/g3dhax.h
+++ b/include/g3dhax.h
@@ -30,6 +30,7 @@ namespace nw4r {
class ResAnmChr { public: void* data; ResAnmChr(void *p = NULL) { data = p; } };
class ResAnmVis { public: void* data; ResAnmVis(void *p = NULL) { data = p; } };
+ class ResAnmClr { public: void* data; ResAnmClr(void *p = NULL) { data = p; } };
class ResAnmTexPat { public: void* data; ResAnmTexPat(void *p = NULL) { data = p; } };
class ResAnmTexSrt { public: void* data; ResAnmTexSrt(void *p = NULL) { data = p; } };
@@ -51,7 +52,7 @@ namespace nw4r {
void * /*ResTex*/ GetResTex(u32 idx) const;
ResAnmChr GetResAnmChr(const char *str) const;
ResAnmVis GetResAnmVis(const char *str) const;
- void * /*ResAnmClr*/ GetResAnmClr(const char *str) const;
+ ResAnmClr GetResAnmClr(const char *str) const;
ResAnmTexPat GetResAnmTexPat(const char *str) const;
ResAnmTexSrt GetResAnmTexSrt(const char *str) const;
void * /*ResAnmScn*/ GetResAnmScn(const char *str) const;
@@ -89,6 +90,13 @@ namespace nw4r {
void * /*ResMdl*/ resMdl);
+ void *__AnmObjClrRes__Construct(
+ void * /*MEMAllocator*/ pHeap,
+ u32 *pSize,
+ void * /*ResAnmVis*/ resAnm,
+ void * /*ResMdl*/ resMdl);
+
+
void *__AnmObjTexPatRes__Construct(
void * /*MEMAllocator*/ pHeap,
u32 *pSize,
@@ -315,6 +323,36 @@ namespace m3d {
void bind(/*b*/mdl_c *model, nw4r::g3d::ResAnmVis anmRes, int unk);
};
+ class anmClr_c : public fanm_c {
+ public:
+ class child_c : public fanm_c {
+ ~child_c();
+ int _vf0C();
+ // some methods missing
+ };
+
+ ~anmClr_c();
+ int _vf0C();
+ void detach();
+ void process();
+
+ bool setup(nw4r::g3d::ResMdl modelRes, nw4r::g3d::ResAnmClr anmRes,
+ mAllocator_c *allocator, u32 *sizeOutPtr, int count); // count usually 1 or 2, sizeOutPtr usually 0
+
+ void bind(/*b*/mdl_c *model, nw4r::g3d::ResAnmVis anmRes, int entryNumber, int _param4); // usually entryNumber is 0, param4 is 0 or 1
+
+
+ float getFrameForEntry(int number);
+ void setFrameForEntry(float value, int number);
+ float getUpdateRateForEntry(int number);
+ void setUpdateRateForEntry(float value, int number);
+ bool isEntryAnimationDone(int number);
+ bool queryEntrySomething(float value, int number);
+ void setEntryByte34(u8 value, int number);
+ float getEntryField28(int number);
+
+ };
+
class anmTexPat_c : public banm_c {
public:
class child_c : public fanm_c {
diff --git a/kamek_pal.x b/kamek_pal.x
index 1619ca6..f397994 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -1237,11 +1237,13 @@ SECTIONS {
GetResMdl = 0x80239F70;
GetResAnmChr = 0x8023A1F0;
GetResAnmVis = 0x8023A260;
+ GetResAnmClr = 0x8023A2D0;
GetResAnmTexPat = 0x8023A340;
GetResAnmTexSrt = 0x8023a3b0;
GetResAnmChr__Q34nw4r3g3d7ResFileCFPCc = 0x8023a1f0;
GetResAnmVis__Q34nw4r3g3d7ResFileCFPCc = 0x8023a260;
+ GetResAnmClr__Q34nw4r3g3d7ResFileCFPCc = 0x8023A2D0;
GetResAnmTexPat__Q34nw4r3g3d7ResFileCFPCc = 0x8023a340;
GetResAnmTexSrt__Q34nw4r3g3d7ResFileCFPCc = 0x8023a3b0;
@@ -1285,6 +1287,28 @@ SECTIONS {
bind__Q23m3d8anmVis_cFPQ23m3d5mdl_cQ34nw4r3g3d9ResAnmVisi = 0x80167ea0;
internalBind__Q23m3d8anmVis_cFv = 0x80167f90;
+ /* m3d::anmClr_c */
+ __vt__Q23m3d8anmClr_c = 0x80329860;
+ __dt__Q23m3d8anmClr_cFv = 0x80165FB0;
+ vf0C__Q23m3d8anmClr_cFv = 0x801664E0;
+ detach__Q23m3d8anmClrFv = 0x80166020;
+ process__Q23m3d8anmClrFv = 0x80166310;
+
+ setup__Q23m3d8anmClrFQ34nw4r3g3d6ResMdlQ34nw4r3g3d9ResAnmClrP12mAllocator_cPUii = 0x80165D70;
+ bind__Q23m3d8anmClrFPQ23m3d5mdl_cPQ34nw4r3g3d9ResAnmClrii = 0x80166110;
+
+
+ getFrameForEntry__Q23m3d8anmClrFv = 0x80166420;
+ setFrameForEntry__Q23m3d8anmClrFfi = 0x80166430;
+ getUpdateRateForEntry__Q23m3d8anmClrFv = 0x80166440;
+ setUpdateRateForEntry__Q23m3d8anmClrFfi = 0x80166450;
+ isEntryAnimationDone__Q23m3d8anmClrFv = 0x80166460;
+ queryEntrySomething__Q23m3d8anmClrFv = 0x80166470;
+ setEntryByte34__Q23m3d8anmClrFUci = 0x80166480;
+ getEntryField28__Q23m3d8anmClrFv = 0x801664A0;
+
+
+ /* m3d::anmTexPat_c */
__vt__Q23m3d11anmTexPat_c = 0x80329890;
__dt__Q23m3d11anmTexPat_cFv = 0x80166bb0;
detach__Q23m3d11anmTexPat_cFv = 0x80166c20;
diff --git a/src/koopatlas/map.cpp b/src/koopatlas/map.cpp
index 4d2bc1d..1c2de26 100644
--- a/src/koopatlas/map.cpp
+++ b/src/koopatlas/map.cpp
@@ -387,6 +387,7 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer, int alpha) {
else
frame = anim->start + (delta * value);
+ float scaleYMod;
// and apply it!
switch (anim->type) {
case dKPDoodad_s::animation_s::X_POS:
@@ -403,6 +404,9 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer, int alpha) {
break;
case dKPDoodad_s::animation_s::Y_SCALE:
effectiveHeight = (effectiveHeight * frame / 100.0);
+
+ scaleYMod = doodad->height - effectiveHeight;
+ effectiveY += scaleYMod;
break;
case dKPDoodad_s::animation_s::OPACITY:
// TODO
diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp
index 04d7e54..ed64c8e 100644
--- a/src/koopatlas/shop.cpp
+++ b/src/koopatlas/shop.cpp
@@ -165,6 +165,8 @@ int dWMShop_c::onCreate() {
layout.enableNonLoopAnim(i);
}
+ layout.drawOrder = 0x01;
+
layoutLoaded = true;
}
@@ -186,7 +188,7 @@ int dWMShop_c::onExecute() {
if (!layout.isAnyAnimOn()) {
if (nowPressed & WPAD_B) {
- MapSoundPlayer(SoundRelatedClass, SE_SYS_WINDOW_CLOSE, 1);
+ MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_OUT_AUTO, 1);
CloseUpShop();
} else if (nowPressed & WPAD_DOWN) {
if (currentItem == 6) { return true; }
@@ -252,6 +254,48 @@ int dWMShop_c::onDraw() {
return true;
}
+void dWMShop_c::specialDraw1() {
+ OSReport("Lakionnnne....");
+ if (!isHidden) {
+ Vec pos = {layout.posX, layout.posY, 40000.0};
+ S16Vec rot = {0,0,0};
+ Vec scale = {1.0, 1.0, 1.0};
+ matrix.translation(pos.x, pos.y, pos.z);
+ matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
+
+ shopkeep.setDrawMatrix(matrix);
+ shopkeep.setScale(&scale);
+ shopkeep.calcWorld(false);
+ shopkeep.scheduleForDrawing();
+ shopkeep._vf1C();
+
+ if(this->ska.isAnimationDone())
+ this->ska.setCurrentFrame(0.0);
+ }
+ return;
+}
+
+void dWMShop_c::specialDraw2() {
+ OSReport("Lakituuu....");
+ if (!isHidden) {
+ Vec pos = {layout.posX, layout.posY, 40000.0};
+ S16Vec rot = {0,0,0};
+ Vec scale = {1.0, 1.0, 1.0};
+ matrix.translation(pos.x, pos.y, pos.z);
+ matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
+
+ shopkeep.setDrawMatrix(matrix);
+ shopkeep.setScale(&scale);
+ shopkeep.calcWorld(false);
+ shopkeep.scheduleForDrawing();
+ shopkeep._vf1C();
+
+ if(this->ska.isAnimationDone())
+ this->ska.setCurrentFrame(0.0);
+ }
+ return;
+}
+
void dWMShop_c::changeItem(int last, int current) {
@@ -295,7 +339,7 @@ void dWMShop_c::LoadShopForWorld(int world) {
return; }
// Handle showing it
- MapSoundPlayer(SoundRelatedClass, SE_SYS_WINDOW_OPEN, 1);
+ MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_IN, 1);
isHidden = false;
layout.enableNonLoopAnim(18);
diff --git a/src/koopatlas/shop.h b/src/koopatlas/shop.h
index 64e4453..b4281b7 100644
--- a/src/koopatlas/shop.h
+++ b/src/koopatlas/shop.h
@@ -8,7 +8,7 @@ extern "C" void *MapSoundPlayer(void *SoundClass, int soundID, int unk);
class dShopItem;
-class dWMShop_c : public dBase_c {
+class dWMShop_c : public dActor_c {
public:
dWMShop_c();
@@ -16,6 +16,8 @@ class dWMShop_c : public dBase_c {
int onDelete();
int onExecute();
int onDraw();
+ void specialDraw1();
+ void specialDraw2();
bool layoutLoaded;
m2d::EmbedLayout_c layout;