mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of https://github.com/AxioDL/urde
This commit is contained in:
commit
4519e3abf2
|
@ -116,8 +116,9 @@ bool ReadMAPAToBlender(hecl::BlenderConnection& conn,
|
||||||
"\n"
|
"\n"
|
||||||
"# Clear Scene\n"
|
"# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
" bpy.context.scene.objects.unlink(ob)\n"
|
" if ob.type != 'CAMERA':\n"
|
||||||
" bpy.data.objects.remove(ob)\n"
|
" bpy.context.scene.objects.unlink(ob)\n"
|
||||||
|
" bpy.data.objects.remove(ob)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"def add_triangle(bm, verts):\n"
|
"def add_triangle(bm, verts):\n"
|
||||||
" verts = [bm.verts[vi] for vi in verts]\n"
|
" verts = [bm.verts[vi] for vi in verts]\n"
|
||||||
|
|
|
@ -39,8 +39,9 @@ bool ReadMLVLToBlender(hecl::BlenderConnection& conn,
|
||||||
"\n"
|
"\n"
|
||||||
"# Clear Scene\n"
|
"# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
" bpy.context.scene.objects.unlink(ob)\n"
|
" if ob.type != 'CAMERA':\n"
|
||||||
" bpy.data.objects.remove(ob)\n");
|
" bpy.context.scene.objects.unlink(ob)\n"
|
||||||
|
" bpy.data.objects.remove(ob)\n");
|
||||||
|
|
||||||
/* Insert area empties */
|
/* Insert area empties */
|
||||||
int areaIdx = 0;
|
int areaIdx = 0;
|
||||||
|
|
|
@ -353,8 +353,9 @@ bool FRME::Extract(const SpecBase &dataSpec,
|
||||||
"bpy.types.Object.retro_widget_model_draw_flags = bpy.props.EnumProperty(items=model_draw_flags, name='Retro: Model Draw Flags', default='RETRO_ALPHA')\n"
|
"bpy.types.Object.retro_widget_model_draw_flags = bpy.props.EnumProperty(items=model_draw_flags, name='Retro: Model Draw Flags', default='RETRO_ALPHA')\n"
|
||||||
"# Clear Scene\n"
|
"# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
" bpy.context.scene.objects.unlink(ob)\n"
|
" if ob.type != 'CAMERA':\n"
|
||||||
" bpy.data.objects.remove(ob)\n"
|
" bpy.context.scene.objects.unlink(ob)\n"
|
||||||
|
" bpy.data.objects.remove(ob)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"def duplicateObject(copy_obj):\n"
|
"def duplicateObject(copy_obj):\n"
|
||||||
" # Create new mesh\n"
|
" # Create new mesh\n"
|
||||||
|
|
|
@ -95,8 +95,9 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
os << "# Clear Scene\n"
|
os << "# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
" bpy.context.scene.objects.unlink(ob)\n"
|
" if ob.type != 'CAMERA':\n"
|
||||||
" bpy.data.objects.remove(ob)\n"
|
" bpy.context.scene.objects.unlink(ob)\n"
|
||||||
|
" bpy.data.objects.remove(ob)\n"
|
||||||
"bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
"bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
||||||
"bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
"bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
||||||
"bpy.types.Object.retro_disable_enviro_visor = bpy.props.BoolProperty(name='Retro: Disable in Combat/Scan Visor')\n"
|
"bpy.types.Object.retro_disable_enviro_visor = bpy.props.BoolProperty(name='Retro: Disable in Combat/Scan Visor')\n"
|
||||||
|
|
|
@ -227,8 +227,9 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
os << "# Clear Scene\n"
|
os << "# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
" bpy.context.scene.objects.unlink(ob)\n"
|
" if ob.type != 'CAMERA':\n"
|
||||||
" bpy.data.objects.remove(ob)\n"
|
" bpy.context.scene.objects.unlink(ob)\n"
|
||||||
|
" bpy.data.objects.remove(ob)\n"
|
||||||
"bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
"bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
||||||
"bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
"bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
||||||
"bpy.types.Object.retro_disable_enviro_visor = bpy.props.BoolProperty(name='Retro: Disable in Combat/Scan Visor')\n"
|
"bpy.types.Object.retro_disable_enviro_visor = bpy.props.BoolProperty(name='Retro: Disable in Combat/Scan Visor')\n"
|
||||||
|
|
|
@ -126,8 +126,9 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
os << "# Clear Scene\n"
|
os << "# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
" bpy.context.scene.objects.unlink(ob)\n"
|
" if ob.type != 'CAMERA':\n"
|
||||||
" bpy.data.objects.remove(ob)\n"
|
" bpy.context.scene.objects.unlink(ob)\n"
|
||||||
|
" bpy.data.objects.remove(ob)\n"
|
||||||
"bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
"bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
||||||
"bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
"bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
|
@ -197,8 +197,8 @@ void CStateManager::UpdateThermalVisor()
|
||||||
std::unique_ptr<CGameArea>& connArea = x850_world->GetGameAreas()[x8cc_nextAreaId];
|
std::unique_ptr<CGameArea>& connArea = x850_world->GetGameAreas()[x8cc_nextAreaId];
|
||||||
if (connArea->IsPostConstructed())
|
if (connArea->IsPostConstructed())
|
||||||
{
|
{
|
||||||
u32 something = connArea->GetPostConstructed()->x10dc_;
|
CGameArea::EOcclusionState occState = connArea->GetPostConstructed()->x10dc_occlusionState;
|
||||||
if (something == 1)
|
if (occState == CGameArea::EOcclusionState::Occluded)
|
||||||
{
|
{
|
||||||
closestDist = dist;
|
closestDist = dist;
|
||||||
lastArea = connArea.get();
|
lastArea = connArea.get();
|
||||||
|
|
|
@ -223,4 +223,15 @@ void CActor::SetSfxPitchBend(s32 val)
|
||||||
CSfxManager::PitchBend(*x8c_sfxHandle.get(), val);
|
CSfxManager::PitchBend(*x8c_sfxHandle.get(), val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CActor::OnScanStateChanged(EScanState state, CStateManager& mgr)
|
||||||
|
{
|
||||||
|
if (state == EScanState::Zero)
|
||||||
|
SendScriptMsgs(EScriptObjectState::UNKS7, mgr, EScriptObjectMessage::None);
|
||||||
|
else if (state == EScanState::One)
|
||||||
|
SendScriptMsgs(EScriptObjectState::UNKS8, mgr, EScriptObjectMessage::None);
|
||||||
|
else if (state == EScanState::Two)
|
||||||
|
SendScriptMsgs(EScriptObjectState::ScanDone, mgr, EScriptObjectMessage::None);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,43 +45,28 @@ protected:
|
||||||
bool xe4_28_ : 1;
|
bool xe4_28_ : 1;
|
||||||
bool xe4_29_ : 1;
|
bool xe4_29_ : 1;
|
||||||
bool xe4_30_ : 1;
|
bool xe4_30_ : 1;
|
||||||
};
|
|
||||||
u8 _dummy1 = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool xe5_0_opaque : 1;
|
bool xe5_0_opaque : 1;
|
||||||
bool xe5_26_muted : 1;
|
bool xe5_26_muted : 1;
|
||||||
bool xe5_27_useInSortedLists : 1;
|
bool xe5_27_useInSortedLists : 1;
|
||||||
bool xe5_28_callTouch : 1;
|
bool xe5_28_callTouch : 1;
|
||||||
};
|
|
||||||
u8 _dummy2 = 0;
|
|
||||||
};
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool xe6_26_inFluid : 1;
|
bool xe6_26_inFluid : 1;
|
||||||
bool xe6_30_enablePitchBend : 1;
|
bool xe6_30_enablePitchBend : 1;
|
||||||
};
|
|
||||||
u8 _dummy3 = 0;
|
|
||||||
};
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool xe7_29_ : 1;
|
bool xe7_29_ : 1;
|
||||||
};
|
};
|
||||||
u8 _dummy4 = 0;
|
u32 dummy = 0;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
enum class EFluidState
|
enum class EFluidState
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class EScanState
|
||||||
|
{
|
||||||
|
Zero,
|
||||||
|
One,
|
||||||
|
Two,
|
||||||
|
};
|
||||||
|
|
||||||
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
|
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
|
||||||
const zeus::CTransform&, CModelData&&, const CMaterialList&,
|
const zeus::CTransform&, CModelData&&, const CMaterialList&,
|
||||||
const CActorParameters&, TUniqueId);
|
const CActorParameters&, TUniqueId);
|
||||||
|
@ -111,7 +96,8 @@ public:
|
||||||
void RemoveEmitter();
|
void RemoveEmitter();
|
||||||
|
|
||||||
virtual rstl::optional_object<zeus::CAABox> GetTouchBounds() const { return {} ; }
|
virtual rstl::optional_object<zeus::CAABox> GetTouchBounds() const { return {} ; }
|
||||||
virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&, int);
|
virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
|
||||||
|
CWeaponMode&, int);
|
||||||
|
|
||||||
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
|
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
|
||||||
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
|
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
|
||||||
|
@ -138,6 +124,8 @@ public:
|
||||||
bool HasModelData() const;
|
bool HasModelData() const;
|
||||||
const CSfxHandle* GetSfxHandle() const;
|
const CSfxHandle* GetSfxHandle() const;
|
||||||
void SetSfxPitchBend(s32);
|
void SetSfxPitchBend(s32);
|
||||||
|
|
||||||
|
virtual void OnScanStateChanged(EScanState, CStateManager&);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,7 +504,7 @@ void CGameArea::UpdateThermalVisor(float dt)
|
||||||
|
|
||||||
void CGameArea::AliveUpdate(float dt)
|
void CGameArea::AliveUpdate(float dt)
|
||||||
{
|
{
|
||||||
if (!x12c_postConstructed->x10dc_)
|
if (x12c_postConstructed->x10dc_occlusionState == EOcclusionState::NotOccluded)
|
||||||
x12c_postConstructed->x10e4_ += dt;
|
x12c_postConstructed->x10e4_ += dt;
|
||||||
else
|
else
|
||||||
x12c_postConstructed->x10e4_ = 0.f;
|
x12c_postConstructed->x10e4_ = 0.f;
|
||||||
|
@ -515,23 +515,38 @@ void CGameArea::AliveUpdate(float dt)
|
||||||
|
|
||||||
void CGameArea::SetOcclusionState(EOcclusionState state)
|
void CGameArea::SetOcclusionState(EOcclusionState state)
|
||||||
{
|
{
|
||||||
|
if (!xf0_24_postConstructed || x12c_postConstructed->x10dc_occlusionState == state)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (state == EOcclusionState::NotOccluded)
|
||||||
|
{
|
||||||
|
ReloadAllUnloadedTextures();
|
||||||
|
AddStaticGeometry();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x12c_postConstructed->x1108_26_ = true;
|
||||||
|
x12c_postConstructed->x1108_27_ = false;
|
||||||
|
RemoveStaticGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameArea::RemoveStaticGeometry()
|
void CGameArea::RemoveStaticGeometry()
|
||||||
{
|
{
|
||||||
if (!xf0_24_postConstructed || !x12c_postConstructed || !x12c_postConstructed->x10dc_)
|
if (!xf0_24_postConstructed || !x12c_postConstructed ||
|
||||||
|
x12c_postConstructed->x10dc_occlusionState == EOcclusionState::NotOccluded)
|
||||||
return;
|
return;
|
||||||
x12c_postConstructed->x10e0_ = 0;
|
x12c_postConstructed->x10e0_ = 0;
|
||||||
x12c_postConstructed->x10dc_ = 0;
|
x12c_postConstructed->x10dc_occlusionState = EOcclusionState::NotOccluded;
|
||||||
g_Renderer->RemoveStaticGeometry(&x12c_postConstructed->x4c_insts);
|
g_Renderer->RemoveStaticGeometry(&x12c_postConstructed->x4c_insts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameArea::AddStaticGeometry()
|
void CGameArea::AddStaticGeometry()
|
||||||
{
|
{
|
||||||
if (x12c_postConstructed->x10dc_ != 1)
|
if (x12c_postConstructed->x10dc_occlusionState != EOcclusionState::Occluded)
|
||||||
{
|
{
|
||||||
x12c_postConstructed->x10e0_ = 0;
|
x12c_postConstructed->x10e0_ = 0;
|
||||||
x12c_postConstructed->x10dc_ = 1;
|
x12c_postConstructed->x10dc_occlusionState = EOcclusionState::Occluded;
|
||||||
if (!x12c_postConstructed->x1108_25_)
|
if (!x12c_postConstructed->x1108_25_)
|
||||||
FillInStaticGeometry();
|
FillInStaticGeometry();
|
||||||
g_Renderer->AddStaticGeometry(&x12c_postConstructed->x4c_insts,
|
g_Renderer->AddStaticGeometry(&x12c_postConstructed->x4c_insts,
|
||||||
|
@ -620,6 +635,10 @@ bool CGameArea::StartStreamingMainArea()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGameArea::ReloadAllUnloadedTextures()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
u32 CGameArea::GetNumPartSizes() const
|
u32 CGameArea::GetNumPartSizes() const
|
||||||
{
|
{
|
||||||
return hecl::SBig(*reinterpret_cast<u32*>(x110_mreaSecBufs[0].first.get() + 60));
|
return hecl::SBig(*reinterpret_cast<u32*>(x110_mreaSecBufs[0].first.get() + 60));
|
||||||
|
|
|
@ -122,6 +122,12 @@ class CGameArea : public IGameArea
|
||||||
std::list<std::shared_ptr<ProjectResourceFactoryBase::AsyncTask>> xf8_loadTransactions;
|
std::list<std::shared_ptr<ProjectResourceFactoryBase::AsyncTask>> xf8_loadTransactions;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
enum class EOcclusionState
|
||||||
|
{
|
||||||
|
NotOccluded,
|
||||||
|
Occluded
|
||||||
|
};
|
||||||
|
|
||||||
class CAreaFog
|
class CAreaFog
|
||||||
{
|
{
|
||||||
ERglFogMode x0_fogMode = ERglFogMode::None;
|
ERglFogMode x0_fogMode = ERglFogMode::None;
|
||||||
|
@ -170,7 +176,7 @@ public:
|
||||||
u32 x10d0_sclySize = 0;
|
u32 x10d0_sclySize = 0;
|
||||||
u32 x10d4_ = 0;
|
u32 x10d4_ = 0;
|
||||||
u32 x10d8_ = 0;
|
u32 x10d8_ = 0;
|
||||||
u32 x10dc_ = 0;
|
EOcclusionState x10dc_occlusionState = EOcclusionState::NotOccluded;
|
||||||
u32 x10e0_ = 0;
|
u32 x10e0_ = 0;
|
||||||
float x10e4_ = 5.f;
|
float x10e4_ = 5.f;
|
||||||
u32 x10e8_ = -1;
|
u32 x10e8_ = -1;
|
||||||
|
@ -185,6 +191,7 @@ public:
|
||||||
bool x1108_24_ : 1;
|
bool x1108_24_ : 1;
|
||||||
bool x1108_25_ : 1;
|
bool x1108_25_ : 1;
|
||||||
bool x1108_26_ : 1;
|
bool x1108_26_ : 1;
|
||||||
|
bool x1108_27_ : 1;
|
||||||
bool x1108_28_ : 1;
|
bool x1108_28_ : 1;
|
||||||
bool x1108_29_ : 1;
|
bool x1108_29_ : 1;
|
||||||
bool x1108_30_ : 1;
|
bool x1108_30_ : 1;
|
||||||
|
@ -236,9 +243,6 @@ public:
|
||||||
bool IsQualified(const CEntity& ent);
|
bool IsQualified(const CEntity& ent);
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class EOcclusionState
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
CGameArea(CInputStream& in, int idx, int mlvlVersion);
|
CGameArea(CInputStream& in, int idx, int mlvlVersion);
|
||||||
|
|
||||||
|
@ -274,6 +278,7 @@ public:
|
||||||
bool StartStreamingMainArea();
|
bool StartStreamingMainArea();
|
||||||
//void UnloadAllLoadedTextures();
|
//void UnloadAllLoadedTextures();
|
||||||
//void ReloadAllLoadedTextures();
|
//void ReloadAllLoadedTextures();
|
||||||
|
void ReloadAllUnloadedTextures();
|
||||||
u32 GetNumPartSizes() const;
|
u32 GetNumPartSizes() const;
|
||||||
void AllocNewAreaData(int, int);
|
void AllocNewAreaData(int, int);
|
||||||
void Invalidate(CStateManager& mgr);
|
void Invalidate(CStateManager& mgr);
|
||||||
|
|
Loading…
Reference in New Issue