mirror of https://github.com/PrimeDecomp/prime.git
Improve match for CScriptSpecialFunction::Render
This commit is contained in:
parent
3256933c63
commit
80843df748
|
@ -16,7 +16,7 @@ lbl_803E2B68:
|
|||
.4byte SetActive__6CActorFb
|
||||
.4byte PreRender__22CScriptSpecialFunctionFR13CStateManagerRC14CFrustumPlanes
|
||||
.4byte AddToRenderer__22CScriptSpecialFunctionFRC14CFrustumPlanesR13CStateManager
|
||||
.4byte Render__22CScriptSpecialFunctionCFRC13CStateManager
|
||||
.4byte Render__22CScriptSpecialFunctionFR13CStateManager
|
||||
.4byte CanRenderUnsorted__6CActorCFRC13CStateManager
|
||||
.4byte CalculateRenderBounds__6CActorFv
|
||||
.4byte HealthInfo__6CActorFR13CStateManager
|
||||
|
@ -958,8 +958,8 @@ lbl_8014FC98:
|
|||
/* 8014FCB4 0014CC14 38 21 08 B0 */ addi r1, r1, 0x8b0
|
||||
/* 8014FCB8 0014CC18 4E 80 00 20 */ blr
|
||||
|
||||
.global Render__22CScriptSpecialFunctionCFRC13CStateManager
|
||||
Render__22CScriptSpecialFunctionCFRC13CStateManager:
|
||||
.global Render__22CScriptSpecialFunctionFR13CStateManager
|
||||
Render__22CScriptSpecialFunctionFR13CStateManager:
|
||||
/* 8014FCBC 0014CC1C 94 21 FE A0 */ stwu r1, -0x160(r1)
|
||||
/* 8014FCC0 0014CC20 7C 08 02 A6 */ mflr r0
|
||||
/* 8014FCC4 0014CC24 90 01 01 64 */ stw r0, 0x164(r1)
|
||||
|
|
|
@ -67,6 +67,13 @@ public:
|
|||
CVector3f ClampToBox(const CVector3f& vec) const;
|
||||
CAABox GetTransformedAABox(const CTransform4f& xf) const;
|
||||
|
||||
inline CVector3f GetExtents() const {
|
||||
// Name is a guess
|
||||
CVector3f result = max - min;
|
||||
result *= 0.5f;
|
||||
return result;
|
||||
}
|
||||
|
||||
const CVector3f& GetMinPoint() const { return min; }
|
||||
const CVector3f& GetMaxPoint() const { return max; }
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
// RotateZ__12CTransform4fFRC9CRelAngle
|
||||
// Scale__12CTransform4fFf
|
||||
// Scale__12CTransform4fFfff
|
||||
// Scale__12CTransform4fFRC9CVector3f
|
||||
static CTransform4f Scale(const CVector3f&);
|
||||
// ScaleBy__12CTransform4fFf
|
||||
// SetRotation__12CTransform4fFRC12CTransform4f
|
||||
// SetRotation__12CTransform4fFRC9CMatrix3f
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
virtual void DrawModelFlat();
|
||||
virtual void SetWireframeFlags();
|
||||
virtual void SetWorldFog();
|
||||
virtual void RenderFogVolume();
|
||||
virtual void RenderFogVolume(const CColor&, const CAABox&, const TLockedToken<CModel>*, const CSkinnedModel*);
|
||||
virtual void SetThermal();
|
||||
virtual void SetThermalColdScale();
|
||||
virtual void DoThermalBlendCold();
|
||||
|
|
|
@ -147,6 +147,7 @@ public:
|
|||
xef4_pendingScreenTex.xc_extent = extent;
|
||||
}
|
||||
const SOnScreenTex& GetPendingScreenTex() const { return xef4_pendingScreenTex; }
|
||||
float IntegrateVisorFog(float f);
|
||||
|
||||
void SetShouldQuitGame(bool should) { xf94_25_quitGame = should; }
|
||||
void SetSkipCinematicSpecialFunction(TUniqueId id) { xf38_skipCineSpecialFunc = id; }
|
||||
|
|
|
@ -13,10 +13,12 @@
|
|||
#include "MetroidPrime/ScriptObjects/CScriptPlatform.hpp"
|
||||
#include "MetroidPrime/TCastTo.hpp"
|
||||
|
||||
#include "MetaRender/CCubeRenderer.hpp"
|
||||
|
||||
#include "Collision/CMaterialFilter.hpp"
|
||||
|
||||
#include "Kyoto/Audio/CSfxManager.hpp"
|
||||
#include "Kyoto/Graphics/CGraphics.hpp"
|
||||
#include "Kyoto/Math/CFrustumPlanes.hpp"
|
||||
#include "Kyoto/Math/CMath.hpp"
|
||||
#include "Kyoto/Math/CRelAngle.hpp"
|
||||
|
@ -27,14 +29,12 @@
|
|||
#include "Runtime/w_fmod.h"
|
||||
#include "rstl/math.hpp"
|
||||
|
||||
|
||||
namespace rstl {
|
||||
static int string_find(const string& haystack, const string& needle, int) {
|
||||
// TODO: proper implementation
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace rstl
|
||||
|
||||
CScriptSpecialFunction::CScriptSpecialFunction(
|
||||
TUniqueId uid, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf,
|
||||
|
@ -847,7 +847,8 @@ void CScriptSpecialFunction::ThinkSpinnerController(float dt, CStateManager& mgr
|
|||
animData->SetPlaybackRate(1.f);
|
||||
// Redundant copy is needed
|
||||
SAdvancementDeltas deltas = plat->UpdateAnimation(dur, mgr, true);
|
||||
plat->SetTransform(x13c_spinnerInitialXf * deltas.xc_rotDelta.BuildTransform4f(deltas.x0_posDelta));
|
||||
plat->SetTransform(x13c_spinnerInitialXf *
|
||||
deltas.xc_rotDelta.BuildTransform4f(deltas.x0_posDelta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -926,17 +927,28 @@ void CScriptSpecialFunction::ThinkObjectFollowObject(float, CStateManager& mgr)
|
|||
|
||||
void CScriptSpecialFunction::Render(CStateManager& mgr) {
|
||||
if (xe8_function == kSF_FogVolume) {
|
||||
/* TODO
|
||||
const float z = mgr.IntegrateVisorFog(xfc_float1 * std::sin(CGraphics::GetSecondsMod900()));
|
||||
if (GetActive()) {
|
||||
const float z = mgr.IntegrateVisorFog(
|
||||
xfc_float1 * CMath::FastSinR(CGraphics::GetSecondsMod900() * x100_float2));
|
||||
if (z > 0.f) {
|
||||
CVector3f max = GetTranslation() + x10c_vector3f;
|
||||
max.SetZ(max.GetZ() + z);
|
||||
const CAABox box(GetTranslation() - x10c_vector3f, max);
|
||||
const CTransform4f modelMtx = CTransform4f::Translate(box.center()) *
|
||||
CTransform4f::Scale(box.extents()); g_Renderer->SetModelMatrix(modelMtx);
|
||||
g_Renderer->RenderFogVolume(x118_color, zeus::CAABox(-1.f, 1.f), nullptr, nullptr);
|
||||
CVector3f translation = GetTranslation();
|
||||
CVector3f min(translation - x10c_vector3f);
|
||||
CVector3f max(translation.GetX() + x10c_vector3f.GetX(),
|
||||
translation.GetY() + x10c_vector3f.GetY(), 0.0);
|
||||
max.SetZ(translation.GetZ() + x10c_vector3f.GetZ() + z);
|
||||
CAABox box(min, max);
|
||||
CVector3f extents(box.GetExtents());
|
||||
CTransform4f modelMtx =
|
||||
CTransform4f::Translate(box.GetCenterPoint()) * CTransform4f::Scale(extents);
|
||||
|
||||
CVector3f renderMin(-1.f, -1.f, -1.f);
|
||||
CVector3f renderMax(1.f, 1.f, 1.f);
|
||||
CAABox renderbox(renderMin, renderMax);
|
||||
|
||||
gpRender->SetModelMatrix(modelMtx);
|
||||
gpRender->RenderFogVolume(x118_color, renderbox, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
CActor::Render(mgr);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue