Some misc graphics stuff

This commit is contained in:
robojumper
2025-03-15 00:07:44 +01:00
parent 7400f6c66a
commit 3967ab8dc6
30 changed files with 991 additions and 156 deletions
+4 -4
View File
@@ -14,8 +14,8 @@ void mdlAnmChr::setFrame(f32 f) {
mAnm.setFrameOnly(f);
}
void mdlAnmChr::setAnm(const char *name, playMode_e mode) {
setAnm(name, mode, 0.0f);
bool mdlAnmChr::setAnm(const char *name, playMode_e mode) {
return setAnm(name, mode, 0.0f);
}
void mdlAnmChr::setRate(f32 rate) {
@@ -75,13 +75,13 @@ bool mdlAnmChr::create(
return create(resFile, resFile, mdlName, anmName, nullptr, alloc, bufferOption, nView, pSize);
}
void mdlAnmChr::setAnm(const char *name, playMode_e mode, f32 blend) {
bool mdlAnmChr::setAnm(const char *name, playMode_e mode, f32 blend) {
nw4r::g3d::ResAnmChr anm = mAnmFile.GetResAnmChr(name);
if (!anm.IsValid()) {
anm = mMdlFile.GetResAnmChr(name);
}
mAnm.setAnm(mMdl, anm, mode);
mMdl.setAnm(mAnm, blend);
return mMdl.setAnm(mAnm, blend);
}
} // namespace m3d
+3 -3
View File
@@ -49,17 +49,17 @@ bool bmdl_c::getNodeWorldMtxMultVec(u32 p1, nw4r::math::VEC3 &in, nw4r::math::VE
}
}
void bmdl_c::setAnm(banm_c &anm) {
bool bmdl_c::setAnm(banm_c &anm) {
nw4r::g3d::ScnMdlSimple *mdl;
if (anm.getType() == nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_SHP) {
mdl = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::ScnMdl>(mpScnLeaf);
mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
return mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
} else {
mdl = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::ScnMdlSimple>(mpScnLeaf);
if (anm.getType() == nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_CHR) {
mpCurrentAnm = &anm;
}
mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
return mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
}
}
+4 -4
View File
@@ -217,8 +217,8 @@ void mdl_c::remove() {
bmdl_c::remove();
}
void mdl_c::setAnm(m3d::banm_c &anm) {
setAnm(anm, 0.0f);
bool mdl_c::setAnm(m3d::banm_c &anm) {
return setAnm(anm, 0.0f);
}
void mdl_c::play() {
@@ -226,11 +226,11 @@ void mdl_c::play() {
mpCallback->calcBlend();
}
void mdl_c::setAnm(m3d::banm_c &anm, f32 f) {
bool mdl_c::setAnm(m3d::banm_c &anm, f32 f) {
if (anm.getType() == nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_CHR) {
mpCallback->setBlendFrame(f);
}
bmdl_c::setAnm(anm);
return bmdl_c::setAnm(anm);
}
void mdl_c::setCallback(callback_c *cb) {