mirror of https://github.com/AxioDL/metaforce.git
Various stubs, and starting on core functionality
This commit is contained in:
parent
1e55a59568
commit
b261e09f51
|
@ -166,7 +166,7 @@ def make_uva4():
|
||||||
# Modulo
|
# Modulo
|
||||||
mod1 = new_grp.nodes.new('ShaderNodeMath')
|
mod1 = new_grp.nodes.new('ShaderNodeMath')
|
||||||
mod1.operation = 'MODULO'
|
mod1.operation = 'MODULO'
|
||||||
mod1.inputs[1].default_value = 1.0
|
mod1.inputs[1].default_value = 900.0
|
||||||
mod1.location = (-400, 0)
|
mod1.location = (-400, 0)
|
||||||
|
|
||||||
# Multiply3
|
# Multiply3
|
||||||
|
@ -236,7 +236,7 @@ def make_uva5():
|
||||||
# Modulo
|
# Modulo
|
||||||
mod1 = new_grp.nodes.new('ShaderNodeMath')
|
mod1 = new_grp.nodes.new('ShaderNodeMath')
|
||||||
mod1.operation = 'MODULO'
|
mod1.operation = 'MODULO'
|
||||||
mod1.inputs[1].default_value = 1.0
|
mod1.inputs[1].default_value = 900.0
|
||||||
mod1.location = (-400, 0)
|
mod1.location = (-400, 0)
|
||||||
|
|
||||||
# Multiply3
|
# Multiply3
|
||||||
|
|
|
@ -14,5 +14,7 @@ add_library(DNACommon
|
||||||
ANIM.hpp ANIM.cpp
|
ANIM.hpp ANIM.cpp
|
||||||
DeafBabe.hpp
|
DeafBabe.hpp
|
||||||
BabeDead.hpp
|
BabeDead.hpp
|
||||||
|
Tweaks/ITweakGame.hpp
|
||||||
|
Tweaks/ITweakParticle.hpp
|
||||||
Tweaks/ITweakPlayer.hpp
|
Tweaks/ITweakPlayer.hpp
|
||||||
Tweaks/ITweakPlayerControl.hpp)
|
Tweaks/ITweakPlayerControl.hpp)
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef __DNACOMMON_ITWEAKGAME_HPP__
|
||||||
|
#define __DNACOMMON_ITWEAKGAME_HPP__
|
||||||
|
|
||||||
|
#include "../DNACommon.hpp"
|
||||||
|
|
||||||
|
namespace Retro
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ITweakGame : BigYAML
|
||||||
|
{
|
||||||
|
virtual const std::string& GetWorldPrefix() const=0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,15 @@
|
||||||
|
#ifndef __DNACOMMON_ITWEAKPARTICLE_HPP__
|
||||||
|
#define __DNACOMMON_ITWEAKPARTICLE_HPP__
|
||||||
|
|
||||||
|
#include "../DNACommon.hpp"
|
||||||
|
|
||||||
|
namespace Retro
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ITweakParticle : BigYAML
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -13,6 +13,7 @@ make_dnalist(liblist
|
||||||
MREA
|
MREA
|
||||||
DeafBabe
|
DeafBabe
|
||||||
SCAN
|
SCAN
|
||||||
|
Tweaks/CTweakGame
|
||||||
Tweaks/CTweakParticle
|
Tweaks/CTweakParticle
|
||||||
Tweaks/CTweakPlayer
|
Tweaks/CTweakPlayer
|
||||||
Tweaks/CTweakPlayerControl)
|
Tweaks/CTweakPlayerControl)
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#ifndef _DNAMP1_CTWEAKGAME_HPP_
|
||||||
|
#define _DNAMP1_CTWEAKGAME_HPP_
|
||||||
|
|
||||||
|
#include "../../DNACommon/Tweaks/ITweakGame.hpp"
|
||||||
|
|
||||||
|
namespace Retro
|
||||||
|
{
|
||||||
|
namespace DNAMP1
|
||||||
|
{
|
||||||
|
|
||||||
|
struct CTweakGame : ITweakGame
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
String<-1> m_worldPrefix;
|
||||||
|
String<-1> m_ruinsArea; // ????
|
||||||
|
|
||||||
|
virtual const std::string& GetWorldPrefix() const { return m_worldPrefix; }
|
||||||
|
CTweakGame(Athena::io::IStreamReader& in) { this->read(in); }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,14 +1,14 @@
|
||||||
#ifndef _DNAMP1_CTWEAKPARTICLE_HPP_
|
#ifndef _DNAMP1_CTWEAKPARTICLE_HPP_
|
||||||
#define _DNAMP1_CTWEAKPARTICLE_HPP_
|
#define _DNAMP1_CTWEAKPARTICLE_HPP_
|
||||||
|
|
||||||
#include "../../DNACommon/DNACommon.hpp"
|
#include "../../DNACommon/Tweaks/ITweakParticle.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
namespace DNAMP1
|
namespace DNAMP1
|
||||||
{
|
{
|
||||||
|
|
||||||
struct CTweakParticle : BigYAML
|
struct CTweakParticle : ITweakParticle
|
||||||
{
|
{
|
||||||
DECL_YAML
|
DECL_YAML
|
||||||
String<-1> m_particle;
|
String<-1> m_particle;
|
||||||
|
|
|
@ -14,4 +14,5 @@ add_library(DNAMP2
|
||||||
ANCS.cpp
|
ANCS.cpp
|
||||||
CMDL.hpp
|
CMDL.hpp
|
||||||
MREA.cpp
|
MREA.cpp
|
||||||
|
MAPA.hpp
|
||||||
STRG.hpp STRG.cpp)
|
STRG.hpp STRG.cpp)
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "CMDL.hpp"
|
#include "CMDL.hpp"
|
||||||
#include "ANCS.hpp"
|
#include "ANCS.hpp"
|
||||||
#include "MREA.hpp"
|
#include "MREA.hpp"
|
||||||
|
#include "MAPA.hpp"
|
||||||
#include "../DNACommon/TXTR.hpp"
|
#include "../DNACommon/TXTR.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
|
@ -222,6 +223,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& ent
|
||||||
return {nullptr, MREA::Extract, {_S(".blend")}, 3};
|
return {nullptr, MREA::Extract, {_S(".blend")}, 3};
|
||||||
case SBIG('MLVL'):
|
case SBIG('MLVL'):
|
||||||
return {MLVL::Extract, nullptr, {_S(".yaml")}};
|
return {MLVL::Extract, nullptr, {_S(".yaml")}};
|
||||||
|
// case SBIG('MAPA'):
|
||||||
|
// return {nullptr, MAPA::Extract, {_S(".blend")}, 4};
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef __DNAMP2_MAPA_HPP__
|
||||||
|
#define __DNAMP2_MAPA_HPP__
|
||||||
|
|
||||||
|
#include "../DNAMP1/MAPA.hpp"
|
||||||
|
|
||||||
|
namespace Retro
|
||||||
|
{
|
||||||
|
namespace DNAMP2
|
||||||
|
{
|
||||||
|
struct MAPA : DNAMP1::MAPA
|
||||||
|
{};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
2
MathLib
2
MathLib
|
@ -1 +1 @@
|
||||||
Subproject commit 2efe395f5003ab4afbecf965ed2d28a51ed53593
|
Subproject commit 40ca0c32191ca691c8a2d8b645a22616bff751aa
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include "CActor.hpp"
|
||||||
|
|
||||||
|
namespace Retro
|
||||||
|
{
|
||||||
|
}
|
|
@ -2,22 +2,80 @@
|
||||||
#define __RETRO_CACTOR_HPP__
|
#define __RETRO_CACTOR_HPP__
|
||||||
|
|
||||||
#include "CEntity.hpp"
|
#include "CEntity.hpp"
|
||||||
|
#include <MathLib.hpp>
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
class CTransform;
|
|
||||||
|
enum ECollisionResponseType
|
||||||
|
{
|
||||||
|
CR_Unknown12 = 0xC,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EMaterialTypes
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
class CModelData;
|
class CModelData;
|
||||||
class CMaterialList;
|
class CMaterialList;
|
||||||
class CActorParameters;
|
class CActorParameters;
|
||||||
|
class CWeaponMode;
|
||||||
|
|
||||||
class CActor : public CEntity
|
class CActor : public CEntity
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
enum Flags
|
||||||
|
{
|
||||||
|
Unknown5 = (1 << 5),
|
||||||
|
Unknown6 = (1 << 6),
|
||||||
|
Unknown7 = (1 << 7),
|
||||||
|
};
|
||||||
|
|
||||||
|
Zeus::CTransform x34_transform;
|
||||||
|
float x40_unknown;
|
||||||
|
float x50_unknown;
|
||||||
|
float x60_unknown;
|
||||||
|
u32 x68_unknown;
|
||||||
|
u32 x6c_unknown;
|
||||||
|
bool xd0_b0_flags : 1;
|
||||||
|
bool xd0_b1_flags : 1;
|
||||||
|
bool xd0_b2_flags : 1;
|
||||||
public:
|
public:
|
||||||
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
|
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
|
||||||
const CTransform&, const CModelData&, const CMaterialList&,
|
const Zeus::CTransform&, const CModelData&, const CMaterialList&,
|
||||||
const CActorParameters&, TUniqueId);
|
const CActorParameters&, TUniqueId);
|
||||||
|
|
||||||
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
|
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
|
||||||
|
virtual Zeus::CVector3f GetAimPosition(const CStateManager&, float)
|
||||||
|
{ return Zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); }
|
||||||
|
|
||||||
|
virtual bool ValidAimTarget() { return true; }
|
||||||
|
virtual bool ValidOrbitTarget() { return true; }
|
||||||
|
virtual bool GetOrbitDistanceCheck() { return true; }
|
||||||
|
virtual Zeus::CVector3f GetOrbitPosition()
|
||||||
|
{ return Zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); }
|
||||||
|
|
||||||
|
virtual ECollisionResponseType GetCollisionResponseType(const Zeus::CVector3f&, const Zeus::CVector3f&, CWeaponMode&, int) { return CR_Unknown12; }
|
||||||
|
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){}
|
||||||
|
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){ }
|
||||||
|
void RemoveMaterial(EMaterialTypes, EMaterialTypes, CStateManager&){ }
|
||||||
|
void RemoveMaterial(EMaterialTypes, CStateManager&){ }
|
||||||
|
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){ }
|
||||||
|
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){}
|
||||||
|
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){ }
|
||||||
|
void AddMaterial(EMaterialTypes, EMaterialTypes, CStateManager&){ }
|
||||||
|
void AddMaterial(EMaterialTypes, CStateManager&){ }
|
||||||
|
|
||||||
|
virtual void SetActive(bool active)
|
||||||
|
{
|
||||||
|
//xd0_flags |= (Unknown5 | Unknown6 | Unknown7);
|
||||||
|
CEntity::SetActive(active);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SetCallTouch(bool callTouch)
|
||||||
|
{
|
||||||
|
//xd1_flags = Unknown6
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,9 @@ void CBasics::Init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
char STRINGIZE_STR[2048];
|
|
||||||
|
|
||||||
const char* CBasics::Stringize(const char* fmt, ...)
|
const char* CBasics::Stringize(const char* fmt, ...)
|
||||||
{
|
{
|
||||||
|
char STRINGIZE_STR[2048] = {0};
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(STRINGIZE_STR, 2048, fmt, ap);
|
vsnprintf(STRINGIZE_STR, 2048, fmt, ap);
|
||||||
|
|
|
@ -34,6 +34,7 @@ add_library(RuntimeCommon
|
||||||
CResLoader.hpp CResLoader.cpp
|
CResLoader.hpp CResLoader.cpp
|
||||||
CDvdRequest.hpp CNODDvdRequest.cpp
|
CDvdRequest.hpp CNODDvdRequest.cpp
|
||||||
CDvdFile.hpp CNODDvdFile.cpp
|
CDvdFile.hpp CNODDvdFile.cpp
|
||||||
|
CVirtualDvdFile.hpp CVirtualDvdFile.cpp
|
||||||
IObjectStore.hpp
|
IObjectStore.hpp
|
||||||
CSimplePool.hpp CSimplePool.cpp
|
CSimplePool.hpp CSimplePool.cpp
|
||||||
CAi.hpp CAi.cpp
|
CAi.hpp CAi.cpp
|
||||||
|
|
|
@ -6,8 +6,115 @@
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class CCollisionPrimitive
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Zeus::CVector3f x1d8_offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CCollisionInfoList
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
class CPhysicsActor : public CActor
|
class CPhysicsActor : public CActor
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
float xd8_mass;
|
||||||
|
float xdc_massRecip;
|
||||||
|
float xe0_inertialTensor;
|
||||||
|
float xe4_inertialTensorRecip;
|
||||||
|
Zeus::CAABox x194_baseBoundingBox;
|
||||||
|
CCollisionPrimitive x1b0_collisionPrimitive;
|
||||||
|
float x228_stepUpHeight;
|
||||||
|
float x22c_stepDownHeight;
|
||||||
|
float x230_restitutionCoefModifier;
|
||||||
|
float x234_collisionAccuracyModifier;
|
||||||
|
public:
|
||||||
|
|
||||||
|
float GetCollisionAccuracyModifier()
|
||||||
|
{ return x234_collisionAccuracyModifier; }
|
||||||
|
|
||||||
|
void SetCollisionAccuracyModifier(float modifier)
|
||||||
|
{ x234_collisionAccuracyModifier = modifier; }
|
||||||
|
|
||||||
|
float GetCoefficientOfRestitutionModifier()
|
||||||
|
{ return x230_restitutionCoefModifier; }
|
||||||
|
|
||||||
|
void SetCoefficientOfRestitutionModifier(float modifier)
|
||||||
|
{ x230_restitutionCoefModifier = modifier;}
|
||||||
|
|
||||||
|
void DrawCollisionPrimitive()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
void Render(const CStateManager&)
|
||||||
|
{}
|
||||||
|
|
||||||
|
Zeus::CVector3f GetAimPosition(const CStateManager&, float val)
|
||||||
|
{
|
||||||
|
if (val <= 0.0)
|
||||||
|
return GetBoundingBox().center();
|
||||||
|
//Zeus::CVector3f delta = PredictMotion(val);
|
||||||
|
return Zeus::CVector3f();
|
||||||
|
}
|
||||||
|
|
||||||
|
Zeus::CVector3f GetOrbitPosition(const CStateManager&)
|
||||||
|
{ return GetBoundingBox().center(); }
|
||||||
|
|
||||||
|
float GetStepUpHeight()
|
||||||
|
{ return x228_stepUpHeight; }
|
||||||
|
|
||||||
|
float GetStepDownHeight()
|
||||||
|
{ return x22c_stepDownHeight; }
|
||||||
|
|
||||||
|
void SetPrimitiveOffset(const Zeus::CVector2f& offset)
|
||||||
|
{ x1b0_collisionPrimitive.x1d8_offset = offset; }
|
||||||
|
|
||||||
|
Zeus::CVector3f GetPrimitiveOffset()
|
||||||
|
{ return x1b0_collisionPrimitive.x1d8_offset; }
|
||||||
|
|
||||||
|
float GetWeight()
|
||||||
|
{ return 24.525002f * xd8_mass; }
|
||||||
|
|
||||||
|
void SetBoundingBox(const Zeus::CAABox& box)
|
||||||
|
{ x194_baseBoundingBox = box; }
|
||||||
|
|
||||||
|
Zeus::CAABox GetMotionVolume()
|
||||||
|
{ return Zeus::CAABox::skInvertedBox; }
|
||||||
|
|
||||||
|
Zeus::CAABox GetBoundingBox()
|
||||||
|
{ return Zeus::CAABox::skInvertedBox; }
|
||||||
|
|
||||||
|
const Zeus::CAABox& GetBaseBoundingBox() const
|
||||||
|
{ return x194_baseBoundingBox; }
|
||||||
|
|
||||||
|
void CollidedWith(const TUniqueId&, const CCollisionInfoList&, CStateManager&)
|
||||||
|
{}
|
||||||
|
|
||||||
|
Zeus::CTransform GetPrimitiveTransform()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const CCollisionPrimitive& GetCollisionPrimitive() const
|
||||||
|
{ return x1b0_collisionPrimitive; }
|
||||||
|
|
||||||
|
void SetInterialTensorScalar(float tensor)
|
||||||
|
{
|
||||||
|
if (tensor <= 0.0f)
|
||||||
|
tensor = 1.0f;
|
||||||
|
xe0_inertialTensor = tensor;
|
||||||
|
xe4_inertialTensorRecip = 1.0f / tensor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetMass(float mass)
|
||||||
|
{
|
||||||
|
xd8_mass = mass;
|
||||||
|
float tensor = 1.0f;
|
||||||
|
if (mass > 0.0f)
|
||||||
|
tensor = 1.0f / mass;
|
||||||
|
|
||||||
|
xdc_massRecip = tensor;
|
||||||
|
SetInterialTensorScalar(mass * tensor);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ class IDvdRequest;
|
||||||
|
|
||||||
class CResLoader
|
class CResLoader
|
||||||
{
|
{
|
||||||
|
std::string m_loaderPath;
|
||||||
//std::list<std::unique_ptr<CPakFile>> x4_unusedList;
|
//std::list<std::unique_ptr<CPakFile>> x4_unusedList;
|
||||||
std::list<std::unique_ptr<CPakFile>> x1c_pakLoadedList;
|
std::list<std::unique_ptr<CPakFile>> x1c_pakLoadedList;
|
||||||
std::list<std::unique_ptr<CPakFile>> x34_pakLoadingList;
|
std::list<std::unique_ptr<CPakFile>> x34_pakLoadingList;
|
||||||
|
|
|
@ -7,8 +7,8 @@ extern CTimeProvider* g_TimeProvider;
|
||||||
class CTimeProvider
|
class CTimeProvider
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const float& x0_currentTime; // in seconds
|
const float& x0_currentTime; // in seconds
|
||||||
bool x4_first = true;
|
bool x4_first = true;
|
||||||
CTimeProvider* x8_lastProvider = nullptr;
|
CTimeProvider* x8_lastProvider = nullptr;
|
||||||
|
|
||||||
CTimeProvider(const float& time);
|
CTimeProvider(const float& time);
|
||||||
|
|
|
@ -13,6 +13,7 @@ extern class CGameState* g_GameState;
|
||||||
extern class CInGameTweakManagerBase* g_TweakManager;
|
extern class CInGameTweakManagerBase* g_TweakManager;
|
||||||
extern class CBooRenderer* g_Renderer;
|
extern class CBooRenderer* g_Renderer;
|
||||||
|
|
||||||
|
extern struct ITweakGame* g_tweakGame;
|
||||||
extern struct ITweakPlayer* g_tweakPlayer;
|
extern struct ITweakPlayer* g_tweakPlayer;
|
||||||
extern struct ITweakPlayerControl* g_tweakPlayerControl;
|
extern struct ITweakPlayerControl* g_tweakPlayerControl;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "CMemory.hpp"
|
#include "CMemory.hpp"
|
||||||
#include "CTweaks.hpp"
|
#include "CTweaks.hpp"
|
||||||
#include "CPlayMovie.hpp"
|
#include "CPlayMovie.hpp"
|
||||||
|
#include "IOStreams.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
@ -21,19 +22,16 @@ enum EGameplayResult
|
||||||
GameplayResultPlaying
|
GameplayResultPlaying
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class WindowCallback : public boo::IWindowCallback
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
class CMain : public boo::IApplicationCallback
|
class CMain : public boo::IApplicationCallback
|
||||||
{
|
{
|
||||||
boo::IWindow* mainWindow = NULL;
|
boo::IWindow* mainWindow;
|
||||||
#if 0
|
//ApplicationDeviceFinder devFinder;
|
||||||
ApplicationDeviceFinder devFinder;
|
|
||||||
WindowCallback windowCallback;
|
WindowCallback windowCallback;
|
||||||
void appLaunched(boo::IApplication* app)
|
int appMain(boo::IApplication* app);
|
||||||
{
|
|
||||||
mainWindow = app->newWindow("YAY!");
|
|
||||||
mainWindow->setCallback(&windowCallback);
|
|
||||||
mainWindow->showWindow();
|
|
||||||
devFinder.startScanning();
|
|
||||||
}
|
|
||||||
void appQuitting(boo::IApplication*)
|
void appQuitting(boo::IApplication*)
|
||||||
{}
|
{}
|
||||||
void appFilesOpen(boo::IApplication*, const std::vector<std::string>& paths)
|
void appFilesOpen(boo::IApplication*, const std::vector<std::string>& paths)
|
||||||
|
@ -43,7 +41,6 @@ class CMain : public boo::IApplicationCallback
|
||||||
fprintf(stderr, "%s ", path.c_str());
|
fprintf(stderr, "%s ", path.c_str());
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
CMemorySys x6c_memSys;
|
CMemorySys x6c_memSys;
|
||||||
CTweaks x70_tweaks;
|
CTweaks x70_tweaks;
|
||||||
|
|
|
@ -2,7 +2,6 @@ include_directories(. ..)
|
||||||
add_executable(mp1
|
add_executable(mp1
|
||||||
CTweaks.hpp CTweaks.cpp
|
CTweaks.hpp CTweaks.cpp
|
||||||
CInGameTweakManager.hpp CInGameTweakManager.cpp
|
CInGameTweakManager.hpp CInGameTweakManager.cpp
|
||||||
CTweakParticle.hpp CTweakParticle.cpp
|
|
||||||
CMainFlow.hpp CMainFlow.cpp
|
CMainFlow.hpp CMainFlow.cpp
|
||||||
CMFGame.hpp CMFGame.cpp
|
CMFGame.hpp CMFGame.cpp
|
||||||
CPlayMovie.hpp CPlayMovie.cpp
|
CPlayMovie.hpp CPlayMovie.cpp
|
||||||
|
@ -16,6 +15,6 @@ target_link_libraries(mp1
|
||||||
DNAMP1
|
DNAMP1
|
||||||
DNACommon
|
DNACommon
|
||||||
HECLDatabase HECLBlender HECLCommon AthenaCore NOD
|
HECLDatabase HECLBlender HECLCommon AthenaCore NOD
|
||||||
LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash
|
LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash Math
|
||||||
${ZLIB_LIBRARIES} ${LZO_LIB}
|
${ZLIB_LIBRARIES} ${LZO_LIB}
|
||||||
${BOO_SYS_LIBS})
|
${BOO_SYS_LIBS})
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
#include "CTweakParticle.hpp"
|
|
||||||
|
|
||||||
namespace Retro
|
|
||||||
{
|
|
||||||
namespace MP1
|
|
||||||
{
|
|
||||||
|
|
||||||
CTweakParticle::CTweakParticle(CInputStream& reader)
|
|
||||||
: DNAMP1::CTweakParticle(reader)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
#ifndef __RETRO_CTWEAKPARTICLE_HPP__
|
|
||||||
#define __RETRO_CTWEAKPARTICLE_HPP__
|
|
||||||
|
|
||||||
#include "IOStreams.hpp"
|
|
||||||
#include "DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp"
|
|
||||||
|
|
||||||
namespace Retro
|
|
||||||
{
|
|
||||||
namespace MP1
|
|
||||||
{
|
|
||||||
|
|
||||||
class CTweakParticle : DNAMP1::CTweakParticle
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CTweakParticle(CInputStream& reader);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __RETRO_CTWEAKPARTICLE_HPP__
|
|
|
@ -3,11 +3,13 @@
|
||||||
#include "CResFactory.hpp"
|
#include "CResFactory.hpp"
|
||||||
#include "CResLoader.hpp"
|
#include "CResLoader.hpp"
|
||||||
#include "GameGlobalObjects.hpp"
|
#include "GameGlobalObjects.hpp"
|
||||||
|
#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp"
|
||||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
||||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp"
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
ITweakGame* g_tweakGame = nullptr;
|
||||||
ITweakPlayer* g_tweakPlayer = nullptr;
|
ITweakPlayer* g_tweakPlayer = nullptr;
|
||||||
ITweakPlayerControl* g_tweakPlayerControl = nullptr;
|
ITweakPlayerControl* g_tweakPlayerControl = nullptr;
|
||||||
|
|
||||||
|
@ -31,6 +33,9 @@ void CTweaks::RegisterTweaks()
|
||||||
CResLoader& loader = factory.GetLoader();
|
CResLoader& loader = factory.GetLoader();
|
||||||
std::unique_ptr<CInputStream> strm;
|
std::unique_ptr<CInputStream> strm;
|
||||||
|
|
||||||
|
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "Game"), nullptr));
|
||||||
|
TOneStatic<DNAMP1::CTweakGame> game(*strm);
|
||||||
|
g_tweakGame = game.GetAllocSpace();
|
||||||
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "Player"), nullptr));
|
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "Player"), nullptr));
|
||||||
TOneStatic<DNAMP1::CTweakPlayer> player(*strm);
|
TOneStatic<DNAMP1::CTweakPlayer> player(*strm);
|
||||||
g_tweakPlayer = player.GetAllocSpace();
|
g_tweakPlayer = player.GetAllocSpace();
|
||||||
|
|
|
@ -2,16 +2,15 @@
|
||||||
#define __RETRO_CTWEAKS_HPP__
|
#define __RETRO_CTWEAKS_HPP__
|
||||||
|
|
||||||
#include "RetroTypes.hpp"
|
#include "RetroTypes.hpp"
|
||||||
#include "CTweakParticle.hpp"
|
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace MP1
|
namespace MP1
|
||||||
{
|
{
|
||||||
|
|
||||||
class CTweaks
|
class CTweaks
|
||||||
{
|
{
|
||||||
TOneStatic<CTweakParticle> m_particle;
|
|
||||||
public:
|
public:
|
||||||
void RegisterTweaks();
|
void RegisterTweaks();
|
||||||
void RegisterResourceTweaks();
|
void RegisterResourceTweaks();
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <clocale>
|
#include <clocale>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boo/boo.hpp>
|
#include <boo/boo.hpp>
|
||||||
|
#include <boo/graphicsdev/GL.hpp>
|
||||||
#include "CBasics.hpp"
|
#include "CBasics.hpp"
|
||||||
#include "CMemoryCardSys.hpp"
|
#include "CMemoryCardSys.hpp"
|
||||||
#include "CResFactory.hpp"
|
#include "CResFactory.hpp"
|
||||||
|
@ -33,11 +34,12 @@
|
||||||
#include "CMain.hpp"
|
#include "CMain.hpp"
|
||||||
|
|
||||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
||||||
|
#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
CMemoryCardSys* g_MemoryCardSys = nullptr;
|
CMemoryCardSys* g_MemoryCardSys = nullptr;
|
||||||
CResFactory* g_ResFactory = nullptr;
|
CResFactory* g_ResFactory = nullptr;
|
||||||
CSimplePool* g_SimplePool = nullptr;
|
CSimplePool* g_SimplePool = nullptr;
|
||||||
CCharacterFactoryBuilder* g_CharFactoryBuilder = nullptr;
|
CCharacterFactoryBuilder* g_CharFactoryBuilder = nullptr;
|
||||||
CAiFuncMap* g_AiFuncMap = nullptr;
|
CAiFuncMap* g_AiFuncMap = nullptr;
|
||||||
|
@ -132,6 +134,7 @@ void CMain::RegisterResourceTweaks()
|
||||||
void CMain::ResetGameState()
|
void CMain::ResetGameState()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMain::InitializeSubsystems()
|
void CMain::InitializeSubsystems()
|
||||||
{
|
{
|
||||||
CElementGen::Initialize();
|
CElementGen::Initialize();
|
||||||
|
@ -140,15 +143,37 @@ void CMain::InitializeSubsystems()
|
||||||
}
|
}
|
||||||
void CMain::AddWorldPaks()
|
void CMain::AddWorldPaks()
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
u32 i = 0;
|
||||||
|
while (i <= 255)
|
||||||
|
{
|
||||||
|
std::string pakName = CBasics::Stringize("%s%i.pak", g_tweakGame->GetWorldPrefix().c_str(), i);
|
||||||
|
if (!CDvdFile::FileExists(pakName.c_str()))
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_ResFactory->GetLoader().AddPakFile(pakName, false);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMain::FillInAssetIDs()
|
void CMain::FillInAssetIDs()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
void CMain::LoadAudio()
|
void CMain::LoadAudio()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
int CMain::RsMain(int argc, const boo::SystemChar* argv[])
|
|
||||||
|
int CMain::appMain(boo::IApplication* app)
|
||||||
{
|
{
|
||||||
|
Zeus::detectCPU();
|
||||||
|
mainWindow = app->newWindow("Metroid Prime 1 Reimplementation vZygote");
|
||||||
|
mainWindow->setCallback(&windowCallback);
|
||||||
|
mainWindow->showWindow();
|
||||||
|
//devFinder.startScanning();
|
||||||
TOneStatic<CGameGlobalObjects> globalObjs;
|
TOneStatic<CGameGlobalObjects> globalObjs;
|
||||||
InitializeSubsystems();
|
InitializeSubsystems();
|
||||||
globalObjs->PostInitialize(x6c_memSys);
|
globalObjs->PostInitialize(x6c_memSys);
|
||||||
|
@ -157,9 +182,19 @@ int CMain::RsMain(int argc, const boo::SystemChar* argv[])
|
||||||
g_TweakManager->ReadFromMemoryCard("AudioTweaks");
|
g_TweakManager->ReadFromMemoryCard("AudioTweaks");
|
||||||
FillInAssetIDs();
|
FillInAssetIDs();
|
||||||
TOneStatic<CGameArchitectureSupport> archSupport;
|
TOneStatic<CGameArchitectureSupport> archSupport;
|
||||||
|
|
||||||
|
boo::IGraphicsCommandQueue* gfxQ = mainWindow->getCommandQueue();
|
||||||
|
float rgba[4] = { 0.5f, 0.5f, 0.5f, 1.0f};
|
||||||
|
gfxQ->setClearColor(rgba);
|
||||||
|
|
||||||
while (!xe8_b24_finished)
|
while (!xe8_b24_finished)
|
||||||
{
|
{
|
||||||
|
mainWindow->waitForRetrace();
|
||||||
xe8_b24_finished = archSupport->Update();
|
xe8_b24_finished = archSupport->Update();
|
||||||
|
gfxQ->clearTarget();
|
||||||
|
|
||||||
|
gfxQ->present();
|
||||||
|
gfxQ->execute();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -178,11 +213,10 @@ int main(int argc, const char* argv[])
|
||||||
#else
|
#else
|
||||||
std::setlocale(LC_ALL, "en-US.UTF-8");
|
std::setlocale(LC_ALL, "en-US.UTF-8");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LogVisor::RegisterConsoleLogger();
|
LogVisor::RegisterConsoleLogger();
|
||||||
Retro::TOneStatic<Retro::MP1::CMain> main;
|
Retro::TOneStatic<Retro::MP1::CMain> main;
|
||||||
std::unique_ptr<boo::IApplication> app =
|
int ret = boo::ApplicationRun(boo::IApplication::PLAT_AUTO, *main,
|
||||||
boo::ApplicationBootstrap(boo::IApplication::PLAT_AUTO, *main,
|
|
||||||
_S("mp1"), _S("MP1"), argc, argv);
|
_S("mp1"), _S("MP1"), argc, argv);
|
||||||
return main->RsMain(argc, argv);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,39 @@ namespace Retro
|
||||||
|
|
||||||
class CElementGen : public CParticleGen
|
class CElementGen : public CParticleGen
|
||||||
{
|
{
|
||||||
|
bool x68_particleEmission;
|
||||||
|
float x78_generatorRate;
|
||||||
|
Zeus::CVector3f x88_globalTranslation;
|
||||||
|
Zeus::CTransform x1d8_globalOrientation;
|
||||||
|
std::vector<CElementGen> x238_children;
|
||||||
|
std::vector<CElementGen> x240_children;
|
||||||
|
std::vector<CElementGen> x254_children;
|
||||||
public:
|
public:
|
||||||
|
virtual const Zeus::CVector3f& GetGlobalTranslation() const
|
||||||
|
{ return x88_globalTranslation; }
|
||||||
|
virtual const Zeus::CTransform& GetGlobalOrientation() const
|
||||||
|
{ return x1d8_globalOrientation; }
|
||||||
|
virtual bool GetParticleEmission() const
|
||||||
|
{ return x68_particleEmission; }
|
||||||
|
|
||||||
|
void SetGeneratorRateScalar(float scalar)
|
||||||
|
{
|
||||||
|
if (scalar >= 0.0f)
|
||||||
|
x78_generatorRate = scalar;
|
||||||
|
else
|
||||||
|
x78_generatorRate = 0.0f;
|
||||||
|
|
||||||
|
for (CElementGen& child : x240_children)
|
||||||
|
child.SetGeneratorRateScalar(x78_generatorRate);
|
||||||
|
|
||||||
|
for (CElementGen& child : x254_children)
|
||||||
|
child.SetGeneratorRateScalar(x78_generatorRate);
|
||||||
|
}
|
||||||
|
|
||||||
static void Initialize()
|
static void Initialize()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void BuildParticleSystemBounds();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ namespace Retro
|
||||||
{
|
{
|
||||||
class CWarp;
|
class CWarp;
|
||||||
class CLight;
|
class CLight;
|
||||||
|
class CGenDescription
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
class CParticleGen
|
class CParticleGen
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,6 +66,17 @@ using TAreaId = u32;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
T GetAverageValue(const T* v, int count)
|
||||||
|
{
|
||||||
|
u32 unk = count * sizeof(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, int Count>
|
||||||
|
class TReservedAverage
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
template<>
|
template<>
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 046c0194f8b9d22449d4b853397e86783fa14770
|
Subproject commit b2d58faae7bd32488c641474db476bb9a29411db
|
2
libBoo
2
libBoo
|
@ -1 +1 @@
|
||||||
Subproject commit 55bf4bbdea051618a0a288681eb8eabed1176a91
|
Subproject commit 4f650ce5f558b68e06cb120648be0b8d8619a93a
|
Loading…
Reference in New Issue