mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-11 02:27:43 +00:00
Merge remote-tracking branch 'origin/master' into hsh
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#define FOGVOL_NEAR 0.2
|
||||
#define SPHERE_RAMP_RES 32
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
namespace {
|
||||
struct FogVolumeControl {
|
||||
std::array<std::array<u32, 2>, 12> xfc_{
|
||||
@@ -222,6 +222,7 @@ CBooRenderer::CAreaListItem::CAreaListItem(const std::vector<CMetroidModelInstan
|
||||
CBooRenderer::CAreaListItem::~CAreaListItem() = default;
|
||||
|
||||
void CBooRenderer::ActivateLightsForModel(CAreaListItem* item, CBooModel& model) {
|
||||
OPTICK_EVENT();
|
||||
constexpr size_t lightCount = 4;
|
||||
std::vector<CLight> thisLights;
|
||||
thisLights.reserve(lightCount);
|
||||
@@ -761,6 +762,7 @@ void CBooRenderer::DisablePVS() { xc8_pvs = std::nullopt; }
|
||||
|
||||
void CBooRenderer::UpdateAreaUniforms(int areaIdx, EWorldShadowMode shadowMode, bool activateLights, int cubeFace,
|
||||
const CModelFlags* ballShadowFlags) {
|
||||
OPTICK_EVENT();
|
||||
SetupRendererStates();
|
||||
|
||||
CModelFlags flags;
|
||||
@@ -772,14 +774,17 @@ void CBooRenderer::UpdateAreaUniforms(int areaIdx, EWorldShadowMode shadowMode,
|
||||
if (shadowMode == EWorldShadowMode::BallOnWorldShadow || shadowMode == EWorldShadowMode::BallOnWorldIds)
|
||||
continue;
|
||||
|
||||
for (auto it = item.x10_models.begin(); it != item.x10_models.end(); ++it) {
|
||||
CBooModel* model = *it;
|
||||
if (model->TryLockTextures()) {
|
||||
if (activateLights)
|
||||
ActivateLightsForModel(&item, *model);
|
||||
model->UpdateUniformData(flags, nullptr, nullptr, bufIdx);
|
||||
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
|
||||
for (auto it = item.x10_models.begin(); it != item.x10_models.end(); ++it) {
|
||||
CBooModel* model = *it;
|
||||
if (model->TryLockTextures()) {
|
||||
if (activateLights)
|
||||
ActivateLightsForModel(&item, *model);
|
||||
model->UpdateUniformData(flags, nullptr, nullptr, bufIdx, &ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} BooTrace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1040,6 +1045,7 @@ void CBooRenderer::SetViewport(int left, int bottom, int width, int height) {
|
||||
void CBooRenderer::SetDebugOption(EDebugOption, int) {}
|
||||
|
||||
void CBooRenderer::BeginScene() {
|
||||
OPTICK_EVENT();
|
||||
CGraphics::SetViewport(0, 0, g_Viewport.x8_width, g_Viewport.xc_height);
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true);
|
||||
@@ -1067,6 +1073,7 @@ void CBooRenderer::BeginScene() {
|
||||
}
|
||||
|
||||
void CBooRenderer::EndScene() {
|
||||
OPTICK_EVENT();
|
||||
CGraphics::EndScene();
|
||||
if (x2dc_reflectionAge >= 2) {
|
||||
// Delete reflection tex x14c_
|
||||
@@ -1161,6 +1168,7 @@ void CBooRenderer::SetThermal(bool thermal, float level, const zeus::CColor& col
|
||||
x2f4_thermColor = color;
|
||||
CDecal::SetMoveRedToAlphaBuffer(false);
|
||||
CElementGen::SetMoveRedToAlphaBuffer(false);
|
||||
m_thermalHotPass = false;
|
||||
}
|
||||
|
||||
void CBooRenderer::SetThermalColdScale(float scale) { x2f8_thermColdScale = zeus::clamp(0.f, scale, 1.f); }
|
||||
@@ -1418,4 +1426,4 @@ void CBooRenderer::BindMainDrawTarget() {
|
||||
g_Viewport = CachedVP;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <zeus/CTransform.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CBooModel;
|
||||
class CMemorySys;
|
||||
class CParticleGen;
|
||||
@@ -323,4 +323,4 @@ public:
|
||||
bool IsInAreaDraw() const { return x318_30_inAreaDraw; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Runtime/GCNTypes.hpp"
|
||||
#include <zeus/CAABox.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
enum class EDrawableType : u16 { WorldSurface, Particle, Actor, SimpleShadow, Decal };
|
||||
|
||||
class CDrawable {
|
||||
@@ -24,4 +24,4 @@ public:
|
||||
const void* GetData() const { return x4_data; }
|
||||
u16 GetExtraSort() const { return x2_extraSort; }
|
||||
};
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Runtime/Graphics/CDrawable.hpp"
|
||||
#include <zeus/CPlane.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CDrawablePlaneObject : public CDrawable {
|
||||
friend class Buckets;
|
||||
u16 x24_targetBucket = 0;
|
||||
@@ -22,4 +22,4 @@ public:
|
||||
, x3c_25_zOnly{zOnly} {}
|
||||
const zeus::CPlane& GetPlane() const { return x2c_plane; }
|
||||
};
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <zeus/Math.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
/// GX global state
|
||||
ERglEnum gx_DepthTest;
|
||||
@@ -53,6 +53,9 @@ SViewport g_Viewport = {
|
||||
0, 0, 640, 480, 640 / 2.f, 480 / 2.f, 0.0f,
|
||||
};
|
||||
u32 CGraphics::g_FrameCounter = 0;
|
||||
u32 CGraphics::g_Framerate = 0;
|
||||
u32 CGraphics::g_FramesPast = 0;
|
||||
frame_clock::time_point CGraphics::g_FrameStartTime = frame_clock::now();
|
||||
|
||||
const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{
|
||||
/* Right */
|
||||
@@ -159,6 +162,8 @@ void CGraphics::EndScene() {
|
||||
g_LastFrameUsedAbove = g_InterruptLastFrameUsedAbove;
|
||||
|
||||
++g_FrameCounter;
|
||||
|
||||
UpdateFPSCounter();
|
||||
}
|
||||
|
||||
void CGraphics::SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1) {}
|
||||
@@ -411,10 +416,23 @@ float CGraphics::GetSecondsMod900() {
|
||||
}
|
||||
|
||||
void CGraphics::TickRenderTimings() {
|
||||
OPTICK_EVENT();
|
||||
g_RenderTimings = (g_RenderTimings + 1) % u32(900 * 60);
|
||||
g_DefaultSeconds = g_RenderTimings / 60.f;
|
||||
}
|
||||
|
||||
static constexpr u64 FPS_REFRESH_RATE = 1000;
|
||||
void CGraphics::UpdateFPSCounter() {
|
||||
++g_FramesPast;
|
||||
|
||||
std::chrono::duration<double, std::milli> timeElapsed = frame_clock::now() - g_FrameStartTime;
|
||||
if (timeElapsed.count() > FPS_REFRESH_RATE) {
|
||||
g_Framerate = g_FramesPast;
|
||||
g_FrameStartTime = frame_clock::now();
|
||||
g_FramesPast = 0;
|
||||
}
|
||||
}
|
||||
|
||||
boo::IGraphicsDataFactory::Platform CGraphics::g_BooPlatform = boo::IGraphicsDataFactory::Platform::Null;
|
||||
boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr;
|
||||
boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr;
|
||||
@@ -464,4 +482,4 @@ const CTevCombiners::CTevPass CGraphics::sTevPass805a6038(
|
||||
const CTevCombiners::CTevPass CGraphics::sTevPass805a6084(
|
||||
{GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_CPREV, GX::TevColorArg::CC_APREV, GX::TevColorArg::CC_ZERO},
|
||||
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_APREV});
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include "optick.h"
|
||||
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
|
||||
@@ -17,7 +19,9 @@
|
||||
#include <zeus/CVector2i.hpp>
|
||||
#include <zeus/CVector2f.hpp>
|
||||
|
||||
namespace urde {
|
||||
using frame_clock = std::chrono::high_resolution_clock;
|
||||
|
||||
namespace metaforce {
|
||||
extern hecl::CVar* g_disableLighting;
|
||||
class CLight;
|
||||
class CTimeProvider;
|
||||
@@ -336,7 +340,12 @@ public:
|
||||
static float GetSecondsMod900();
|
||||
static void TickRenderTimings();
|
||||
static u32 g_FrameCounter;
|
||||
static u32 g_Framerate;
|
||||
static u32 g_FramesPast;
|
||||
static frame_clock::time_point g_FrameStartTime;
|
||||
static u32 GetFrameCounter() { return g_FrameCounter; }
|
||||
static u32 GetFPS() { return g_Framerate; }
|
||||
static void UpdateFPSCounter();
|
||||
|
||||
static hsh::owner<hsh::render_texture2d> g_SpareTexture;
|
||||
|
||||
@@ -678,7 +687,7 @@ public:
|
||||
};
|
||||
#define SCOPED_GRAPHICS_DEBUG_GROUP(...) GraphicsDebugGroup _GfxDbg_(__VA_ARGS__);
|
||||
#else
|
||||
#define SCOPED_GRAPHICS_DEBUG_GROUP(...)
|
||||
#define SCOPED_GRAPHICS_DEBUG_GROUP(name, ...) OPTICK_EVENT_DYNAMIC(name)
|
||||
#endif
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <memory>
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
enum class EPaletteFormat {
|
||||
IA8 = 0x0,
|
||||
@@ -32,4 +32,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <cfloat>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
constexpr zeus::CVector3f kDefaultPosition(0.f, 0.f, 0.f);
|
||||
constexpr zeus::CVector3f kDefaultDirection(0.f, -1.f, 0.f);
|
||||
@@ -113,4 +113,4 @@ CLight CLight::BuildLocalAmbient(const zeus::CVector3f& pos, const zeus::CColor&
|
||||
return CLight(ELightType::LocalAmbient, pos, kDefaultDirection, color, 180.f);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <zeus/CColor.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
enum class ELightType {
|
||||
Spot = 0,
|
||||
@@ -103,4 +103,4 @@ public:
|
||||
static CLight BuildLocalAmbient(const zeus::CVector3f& pos, const zeus::CColor& color);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
|
||||
#include <logvisor/logvisor.hpp>
|
||||
|
||||
namespace urde {
|
||||
logvisor::Module LineRendererLog("urde::CLineRenderer");
|
||||
namespace metaforce {
|
||||
logvisor::Module LineRendererLog("metaforce::CLineRenderer");
|
||||
|
||||
CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, hsh::texture2d texture,
|
||||
bool additive, hsh::Compare zComp)
|
||||
: m_mode(mode), m_maxVerts(maxVerts) {
|
||||
OPTICK_EVENT();
|
||||
if (maxVerts < 2) {
|
||||
LineRendererLog.report(logvisor::Fatal, FMT_STRING(_SYS_STR("maxVerts < 2, maxVerts = {}")), maxVerts);
|
||||
return;
|
||||
@@ -342,4 +343,4 @@ void CLineRenderer::Render(bool alphaWrite, const zeus::CColor& moduColor) {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "zeus/CVector3f.hpp"
|
||||
#include "zeus/CVector4f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CLineRenderer {
|
||||
public:
|
||||
@@ -74,4 +74,4 @@ public:
|
||||
void Render(bool alphaWrite = false, const zeus::CColor& moduColor = zeus::skWhite);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <zeus/CAABox.hpp>
|
||||
#include <zeus/CTransform.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CBooModel;
|
||||
struct CBooSurface;
|
||||
|
||||
@@ -44,4 +44,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "zeus/CAABox.hpp"
|
||||
#include "zeus/CColor.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CLight;
|
||||
class CModel;
|
||||
class CPoseAsTransforms;
|
||||
@@ -40,7 +40,7 @@ struct CModelFlags {
|
||||
: x0_blendMode(blendMode), x1_matSetIdx(shadIdx), x2_flags(flags), x4_color(col) {}
|
||||
|
||||
/* Flags
|
||||
0x1: depth equal
|
||||
0x1: depth lequal
|
||||
0x2: depth update
|
||||
0x4: render without texture lock
|
||||
0x8: depth greater
|
||||
@@ -55,7 +55,7 @@ struct CModelFlags {
|
||||
bool operator!=(const CModelFlags& other) const { return !operator==(other); }
|
||||
};
|
||||
|
||||
/* urde addition: doesn't require hacky stashing of
|
||||
/* metaforce addition: doesn't require hacky stashing of
|
||||
* pointers within loaded CMDL buffer */
|
||||
struct CBooSurface {
|
||||
DataSpec::DNACMDL::SurfaceHeader_2 m_data;
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
CModelShaders::FragmentUniform m_lightingData{};
|
||||
bool m_lightsActive = false;
|
||||
|
||||
/* urde addition: boo! */
|
||||
/* metaforce addition: boo! */
|
||||
size_t m_uniformDataSize = 0;
|
||||
std::vector<ModelInstance> m_instances;
|
||||
ModelInstance m_ballShadowInstance;
|
||||
@@ -158,7 +158,7 @@ private:
|
||||
hsh::texture2d m_lastDrawnOneTexture;
|
||||
hsh::texturecube m_lastDrawnReflectionCube;
|
||||
|
||||
ModelInstance* PushNewModelInstance(int sharedLayoutBuf = -1);
|
||||
ModelInstance* PushNewModelInstance(int sharedLayoutBuf = -1, boo::IGraphicsDataFactory::Context* ctx = nullptr);
|
||||
void DrawAlphaSurfaces(const CModelFlags& flags) const;
|
||||
void DrawNormalSurfaces(const CModelFlags& flags) const;
|
||||
void DrawSurfaces(const CModelFlags& flags) const;
|
||||
@@ -196,7 +196,8 @@ public:
|
||||
void VerifyCurrentShader(int shaderIdx);
|
||||
hsh::dynamic_owner<hsh::vertex_buffer_typeless>* UpdateUniformData(const CModelFlags& flags, const CSkinRules* cskr,
|
||||
const CPoseAsTransforms* pose,
|
||||
int sharedLayoutBuf = -1);
|
||||
int sharedLayoutBuf = -1,
|
||||
boo::IGraphicsDataFactory::Context* ctx = nullptr);
|
||||
void DrawAlpha(const CModelFlags& flags, const CSkinRules* cskr, const CPoseAsTransforms* pose);
|
||||
void DrawNormal(const CModelFlags& flags, const CSkinRules* cskr, const CPoseAsTransforms* pose);
|
||||
void Draw(const CModelFlags& flags, const CSkinRules* cskr, const CPoseAsTransforms* pose);
|
||||
@@ -255,7 +256,7 @@ class CModel {
|
||||
// CModel* x34_prev = nullptr;
|
||||
int x38_lastFrame;
|
||||
|
||||
/* urde addition: boo2! */
|
||||
/* metaforce addition: boo2! */
|
||||
hsh::owner<hsh::vertex_buffer_typeless> m_staticVbo;
|
||||
hecl::HMDLMeta m_hmdlMeta;
|
||||
std::unique_ptr<uint8_t[]> m_dynamicVertexData;
|
||||
@@ -291,8 +292,8 @@ public:
|
||||
const hecl::HMDLMeta& GetHMDLMeta() const { return m_hmdlMeta; }
|
||||
};
|
||||
|
||||
CFactoryFnReturn FModelFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const urde::CVParamTransfer& vparms, CObjectReference* selfRef);
|
||||
CFactoryFnReturn FModelFactory(const metaforce::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const metaforce::CVParamTransfer& vparms, CObjectReference* selfRef);
|
||||
|
||||
template <typename F>
|
||||
constexpr auto MapVertData(const hecl::HMDLMeta& meta, F&& Func) {
|
||||
@@ -332,4 +333,4 @@ constexpr auto MapVertData(const hecl::HMDLMeta& meta, F&& Func) {
|
||||
// fallback
|
||||
return Func.template operator()<CModelShaders::VertData<0, 0, 0>>();
|
||||
}
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
#include <hecl/Runtime.hpp>
|
||||
#include <logvisor/logvisor.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
namespace {
|
||||
logvisor::Module Log("urde::CBooModel");
|
||||
logvisor::Module Log("metaforce::CBooModel");
|
||||
CBooModel* g_FirstModel = nullptr;
|
||||
|
||||
constexpr zeus::CMatrix4f ReflectBaseMtx{
|
||||
@@ -46,6 +46,7 @@ void CBooModel::Shutdown() {
|
||||
}
|
||||
|
||||
void CBooModel::ClearModelUniformCounters() {
|
||||
OPTICK_EVENT();
|
||||
for (CBooModel* model = g_FirstModel; model; model = model->m_next)
|
||||
model->ClearUniformCounter();
|
||||
}
|
||||
@@ -215,7 +216,8 @@ GeometryUniformLayout::GeometryUniformLayout(const CModel* model, const Material
|
||||
}
|
||||
}
|
||||
|
||||
ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf) {
|
||||
ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf, boo::IGraphicsDataFactory::Context* ctx) {
|
||||
OPTICK_EVENT();
|
||||
if (!x40_24_texturesLoaded && !g_DummyTextures) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -733,7 +735,7 @@ hsh::dynamic_owner<hsh::vertex_buffer_typeless>* CBooModel::UpdateUniformData(co
|
||||
if (sharedLayoutBuf >= 0) {
|
||||
if (m_instances.size() <= sharedLayoutBuf) {
|
||||
do {
|
||||
inst = PushNewModelInstance(m_instances.size());
|
||||
inst = PushNewModelInstance(m_instances.size(), ctx);
|
||||
if (inst == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -744,7 +746,7 @@ hsh::dynamic_owner<hsh::vertex_buffer_typeless>* CBooModel::UpdateUniformData(co
|
||||
m_uniUpdateCount = sharedLayoutBuf + 1;
|
||||
} else {
|
||||
if (m_instances.size() <= m_uniUpdateCount) {
|
||||
inst = PushNewModelInstance(sharedLayoutBuf);
|
||||
inst = PushNewModelInstance(sharedLayoutBuf, ctx);
|
||||
if (inst == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1057,11 +1059,11 @@ void CModel::WarmupShaders(const SObjectTag& cmdlTag) {
|
||||
modelObj->_WarmupShaders();
|
||||
}
|
||||
|
||||
CFactoryFnReturn FModelFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const urde::CVParamTransfer& vparms, CObjectReference* selfRef) {
|
||||
CFactoryFnReturn FModelFactory(const metaforce::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const metaforce::CVParamTransfer& vparms, CObjectReference* selfRef) {
|
||||
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
|
||||
CFactoryFnReturn ret = TToken<CModel>::GetIObjObjectFor(std::make_unique<CModel>(std::move(in), len, sp, selfRef));
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "CMoviePlayer.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CMoviePlayerPipeline : pipeline<topology<hsh::TriangleStrip>, BlendAttachment<true>, depth_write<false>> {
|
||||
@@ -217,7 +217,7 @@ CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bo
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
CTHPTextureSet& set = x80_textures.emplace_back();
|
||||
if (deinterlace) {
|
||||
/* urde addition: this way interlaced THPs don't look horrible */
|
||||
/* metaforce addition: this way interlaced THPs don't look horrible */
|
||||
set.Y[0] = hsh::create_dynamic_texture2d({x6c_videoInfo.width, x6c_videoInfo.height / 2}, hsh::R8_UNORM, 1);
|
||||
set.Y[1] = hsh::create_dynamic_texture2d({x6c_videoInfo.width, x6c_videoInfo.height / 2}, hsh::R8_UNORM, 1);
|
||||
set.U = hsh::create_dynamic_texture2d({x6c_videoInfo.width / 2, x6c_videoInfo.height / 2}, hsh::R8_UNORM, 1);
|
||||
@@ -314,7 +314,7 @@ void CMoviePlayer::MixAudio(s16* out, const s16* in, u32 samples) {
|
||||
tex->playedSamples += thisSamples;
|
||||
samples -= thisSamples;
|
||||
} else {
|
||||
/* urde addition: failsafe for buffer overrun */
|
||||
/* metaforce addition: failsafe for buffer overrun */
|
||||
if (in)
|
||||
std::memcpy(out, in, samples * 4);
|
||||
else
|
||||
@@ -333,7 +333,7 @@ void CMoviePlayer::MixStaticAudio(s16* out, const s16* in, u32 samples) {
|
||||
const u8* thisOffsetLeft = &StaticAudio[StaticAudioOffset / 2];
|
||||
const u8* thisOffsetRight = &StaticAudio[StaticAudioSize / 2 + StaticAudioOffset / 2];
|
||||
|
||||
/* urde addition: mix samples with `in` or no mix */
|
||||
/* metaforce addition: mix samples with `in` or no mix */
|
||||
if (in) {
|
||||
for (u32 i = 0; i < thisSamples; i += 2) {
|
||||
out[0] = DSPSampClamp(
|
||||
@@ -415,7 +415,7 @@ void CMoviePlayer::DrawFrame() {
|
||||
tex.binding[m_deinterlace ? (xfc_fieldIndex != 0) : 0].draw(0, 4);
|
||||
|
||||
/* ensure second field is being displayed by VI to signal advance
|
||||
* (faked in urde with continuous xor) */
|
||||
* (faked in metaforce with continuous xor) */
|
||||
if (!xfc_fieldIndex && CGraphics::g_LastFrameUsedAbove)
|
||||
xf4_26_fieldFlip = true;
|
||||
|
||||
@@ -611,4 +611,4 @@ void CMoviePlayer::PostDVDReadRequestIfNeeded() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "Graphics/CGraphics.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CMoviePlayer : public CDvdFile {
|
||||
public:
|
||||
@@ -147,4 +147,4 @@ public:
|
||||
static void Shutdown();
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Runtime/Graphics/CPVSAreaSet.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CPVSAreaSet::CPVSAreaSet(const u8* data, u32 len) {
|
||||
CMemoryInStream r(data, len);
|
||||
@@ -18,4 +18,4 @@ CPVSAreaSet::CPVSAreaSet(const u8* data, u32 len) {
|
||||
x20_octree = CPVSVisOctree::MakePVSVisOctree(octreeData);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
#include "Runtime/Graphics/CPVSVisOctree.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CPVSAreaSet {
|
||||
u32 x0_numFeatures;
|
||||
@@ -37,4 +37,4 @@ public:
|
||||
CPVSVisSet Get2ndLightSet(size_t lightIdx) const { return _GetLightSet(lightIdx); }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CPVSVisOctree CPVSVisOctree::MakePVSVisOctree(const u8* data) {
|
||||
CMemoryInStream r(data, 68);
|
||||
@@ -90,4 +90,4 @@ s32 CPVSVisOctree::IterateSearch(u8 nodeData, const zeus::CVector3f& tp) const {
|
||||
highFlags[2] * axisCounts[0] * axisCounts[1] * bool(nodeData & 0x4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <zeus/CAABox.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CPVSVisOctree {
|
||||
zeus::CAABox x0_aabb;
|
||||
@@ -31,4 +31,4 @@ public:
|
||||
s32 IterateSearch(u8 nodeData, const zeus::CVector3f& tp) const;
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Runtime/Graphics/CPVSVisOctree.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
void CPVSVisSet::Reset(EPVSVisSetState state) {
|
||||
x0_state = state;
|
||||
@@ -88,4 +88,4 @@ void CPVSVisSet::SetTestPoint(const CPVSVisOctree& octree, const zeus::CVector3f
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CPVSVisOctree;
|
||||
|
||||
enum class EPVSVisSetState { EndOfTree, NodeFound, OutOfBounds };
|
||||
@@ -23,4 +23,4 @@ public:
|
||||
void SetTestPoint(const CPVSVisOctree& octree, const zeus::CVector3f&);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Runtime/Graphics/CBooRenderer.hpp"
|
||||
#include "Runtime/World/CWorld.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CRainSplashGenerator::CRainSplashGenerator(const zeus::CVector3f& scale, u32 maxSplashes, u32 genRate, float minZ,
|
||||
float alpha)
|
||||
@@ -188,4 +188,4 @@ void CRainSplashGenerator::GeneratePoints(const std::vector<std::pair<zeus::CVec
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CStateManager;
|
||||
|
||||
class CRainSplashGenerator {
|
||||
@@ -73,4 +73,4 @@ public:
|
||||
bool IsRaining() const { return x48_25_raining; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Runtime/CStateManager.hpp"
|
||||
#include "Runtime/Collision/CGameCollision.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CSimpleShadow::CSimpleShadow(float scale, float userAlpha, float maxObjHeight, float displacement)
|
||||
: x30_scale(scale), x38_userAlpha(userAlpha), x40_maxObjHeight(maxObjHeight), x44_displacement(displacement) {}
|
||||
@@ -81,4 +81,4 @@ void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform&
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <zeus/CAABox.hpp>
|
||||
#include <zeus/CTransform.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
class CStateManager;
|
||||
|
||||
@@ -36,4 +36,4 @@ public:
|
||||
void Render(const TLockedToken<CTexture>& tex);
|
||||
void Calculate(const zeus::CAABox& aabb, const zeus::CTransform& xf, const CStateManager& mgr);
|
||||
};
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include <logvisor/logvisor.hpp>
|
||||
|
||||
namespace urde {
|
||||
static logvisor::Module Log("urde::CSkinnedModel");
|
||||
namespace metaforce {
|
||||
static logvisor::Module Log("metaforce::CSkinnedModel");
|
||||
|
||||
CSkinnedModel::CSkinnedModel(TLockedToken<CModel> model, TLockedToken<CSkinRules> skinRules,
|
||||
TLockedToken<CCharLayoutInfo> layoutInfo, int shaderIdx, int drawInsts)
|
||||
@@ -53,6 +53,7 @@ void CSkinnedModel::Calculate(const CPoseAsTransforms& pose, const CModelFlags&
|
||||
}
|
||||
|
||||
void CSkinnedModel::Draw(const CModelFlags& drawFlags) const {
|
||||
OPTICK_EVENT();
|
||||
if (m_modelInst->TryLockTextures())
|
||||
m_modelInst->DrawSurfaces(drawFlags);
|
||||
}
|
||||
@@ -64,4 +65,4 @@ CMorphableSkinnedModel::CMorphableSkinnedModel(IObjectStore& store, CAssetId mod
|
||||
CSkinnedModel::FPointGenerator CSkinnedModel::g_PointGenFunc = nullptr;
|
||||
void* CSkinnedModel::g_PointGenCtx = nullptr;
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CCharLayoutInfo;
|
||||
class CModel;
|
||||
class CPoseAsTransforms;
|
||||
@@ -66,4 +66,4 @@ public:
|
||||
const float* GetMorphMagnitudes() const { return x40_morphMagnitudes.get(); }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Runtime/IOStreams.hpp"
|
||||
#include "Runtime/Graphics/CGraphics.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CVParamTransfer;
|
||||
class CTextureInfo;
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
const CTextureInfo* GetTextureInfo() const { return m_textureInfo; }
|
||||
};
|
||||
|
||||
CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const urde::CVParamTransfer& vparms, CObjectReference* selfRef);
|
||||
CFactoryFnReturn FTextureFactory(const metaforce::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const metaforce::CVParamTransfer& vparms, CObjectReference* selfRef);
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include "Runtime/CTextureCache.hpp"
|
||||
#include "Runtime/GameGlobalObjects.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
namespace {
|
||||
logvisor::Module Log("urde::CTextureBoo");
|
||||
logvisor::Module Log("metaforce::CTextureBoo");
|
||||
|
||||
/* GX uses this upsampling technique to extract full 8-bit range */
|
||||
constexpr u8 Convert3To8(u8 v) {
|
||||
@@ -727,8 +727,8 @@ hsh::texture2d_array CTexture::GetFontTexture(EFontType tp) {
|
||||
return m_booTex.get();
|
||||
}
|
||||
|
||||
CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const urde::CVParamTransfer& vparms, CObjectReference* selfRef) {
|
||||
CFactoryFnReturn FTextureFactory(const metaforce::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||
const metaforce::CVParamTransfer& vparms, CObjectReference* selfRef) {
|
||||
u32 u32Owned = vparms.GetOwnedObj<u32>();
|
||||
const CTextureInfo* inf = nullptr;
|
||||
if (g_TextureCache)
|
||||
@@ -737,4 +737,4 @@ CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag, std::unique_ptr<u8
|
||||
std::make_unique<CTexture>(std::move(in), len, u32Owned == SBIG('OTEX'), inf));
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Runtime/Character/CSkinRules.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CVertexMorphEffect::CVertexMorphEffect(const zeus::CUnitVector3f& v1, const zeus::CVector3f& v2, float diagExtent,
|
||||
float f2, CRandom16& random)
|
||||
@@ -12,4 +12,4 @@ void CVertexMorphEffect::MorphVertices(std::vector<std::pair<zeus::CVector3f, ze
|
||||
const float* magnitudes, const TLockedToken<CSkinRules>& skinRules,
|
||||
const CPoseAsTransforms& pose) const {}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <zeus/CUnitVector.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CRandom16;
|
||||
class CSkinRules;
|
||||
|
||||
@@ -34,4 +34,4 @@ public:
|
||||
void Update(float) {}
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <zeus/CPlane.hpp>
|
||||
#include <zeus/CRectangle.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CAreaOctTree;
|
||||
class CLight;
|
||||
class CMetroidModelInstance;
|
||||
@@ -104,4 +104,4 @@ public:
|
||||
virtual void PrepareDynamicLights(const std::vector<CLight>& lights) = 0;
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "Runtime/Particle/CParticleGen.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
void CDefaultWeaponRenderer::AddParticleGen(CParticleGen& gen) { gen.Render(); }
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CParticleGen;
|
||||
|
||||
class IWeaponRenderer {
|
||||
@@ -14,4 +14,4 @@ public:
|
||||
void AddParticleGen(CParticleGen&) override;
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Runtime/Graphics/CGraphics.hpp"
|
||||
#include "CAABoxShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CAABoxShaderPipeline : pipeline<topology<hsh::TriangleStrip>,
|
||||
@@ -66,4 +66,4 @@ void CAABoxShader::draw(const zeus::CColor& color) {
|
||||
m_dataBind.draw(0, VertexCount);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@ class CColor;
|
||||
class CAABox;
|
||||
} // namespace zeus
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CAABoxShader {
|
||||
public:
|
||||
struct Vert {
|
||||
@@ -29,4 +29,4 @@ public:
|
||||
void draw(const zeus::CColor& color);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "CCameraBlurFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CCameraBlurFilterPipeline : FilterPipeline<EFilterType::Blend> {
|
||||
@@ -82,4 +82,4 @@ void CCameraBlurFilter::draw(float amount, bool clearDepth) {
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "hsh/hsh.h"
|
||||
#include "zeus/CVector4f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CCameraBlurFilter {
|
||||
friend struct CCameraBlurFilterPipeline;
|
||||
@@ -29,4 +29,4 @@ public:
|
||||
void draw(float amount, bool clearDepth = false);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "CColoredQuadFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <EFilterType Type>
|
||||
@@ -89,4 +89,4 @@ void CWideScreenFilter::SetViewportToFull() {
|
||||
CGraphics::g_SpareTexture.attach(rect);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
enum class EFilterShape;
|
||||
@@ -52,4 +52,4 @@ public:
|
||||
static void SetViewportToFull();
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "CColoredStripShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <CColoredStripShader::Mode Mode>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "zeus/CColor.hpp"
|
||||
#include "zeus/CMatrix4f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CColoredStripShader {
|
||||
public:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "CDecalShaders.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <bool Additive, bool RedToAlpha>
|
||||
@@ -51,4 +51,4 @@ void CDecalShaders::BuildShaderDataBinding(hsh::binding& binding, CQuadDecal& de
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
struct CQuadDecal;
|
||||
|
||||
class CDecalShaders {
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
static void BuildShaderDataBinding(hsh::binding& binding, CQuadDecal& decal, hsh::texture2d tex);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -12,7 +12,7 @@ enum class BlendMode {
|
||||
|
||||
#include "CElementGenShaders.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <BlendMode Mode, bool AlphaWrite>
|
||||
@@ -147,4 +147,4 @@ void CElementGenShaders::BuildShaderDataBinding(CElementGen& gen) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <array>
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CElementGen;
|
||||
|
||||
class CElementGenShaders {
|
||||
@@ -13,4 +13,4 @@ public:
|
||||
static void BuildShaderDataBinding(CElementGen& gen);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "CEnergyBarShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CEnergyBarShaderPipeline
|
||||
@@ -79,4 +79,4 @@ void CEnergyBarShader::draw(const zeus::CColor& color0, const std::vector<Vertex
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
class CEnergyBarShader {
|
||||
@@ -38,4 +38,4 @@ public:
|
||||
hsh::texture2d tex);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "CEnvFxShaders.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <bool Blend>
|
||||
@@ -46,4 +46,4 @@ void CEnvFxShaders::BuildShaderDataBinding(CEnvFxManager& fxMgr, CEnvFxManagerGr
|
||||
CEnvFxShadersPipeline<isUnderwater>(vboBuf, envFxUniBuf, fogUniBuf, texFlake, texEnv));
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CEnvFxManager;
|
||||
class CEnvFxManagerGrid;
|
||||
|
||||
@@ -25,4 +25,4 @@ public:
|
||||
static void BuildShaderDataBinding(CEnvFxManager& fxMgr, CEnvFxManagerGrid& grid);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Runtime/World/CRipple.hpp"
|
||||
#include "Runtime/World/CRippleManager.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
void CFluidPlaneShader::PrepareBinding(u32 maxVertCount) {
|
||||
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
|
||||
@@ -166,4 +166,4 @@ void CFluidPlaneShader::loadVerts(const std::vector<Vertex>& verts, const std::v
|
||||
m_pvbo->load(pVerts.data(), pVerts.size() * sizeof(PatchVertex));
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "zeus/CVector3f.hpp"
|
||||
#include "zeus/CVector4f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
enum class EFluidType { NormalWater, PoisonWater, Lava, PhazonFluid, Four, ThickLava };
|
||||
|
||||
@@ -108,4 +108,4 @@ public:
|
||||
void loadVerts(const std::vector<Vertex>& verts, const std::vector<PatchVertex>& pVerts);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "CFogVolumeFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <bool TwoWay>
|
||||
@@ -82,4 +82,4 @@ void CFogVolumeFilter::draw1WayPass(const zeus::CColor& color) {
|
||||
m_dataBind1Way.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace zeus {
|
||||
class CColor;
|
||||
} // namespace zeus
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CFogVolumeFilter {
|
||||
public:
|
||||
@@ -30,4 +30,4 @@ public:
|
||||
void draw1WayPass(const zeus::CColor& color);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "CFogVolumePlaneShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <size_t I>
|
||||
@@ -81,4 +81,4 @@ void CFogVolumePlaneShader::draw(size_t pass) {
|
||||
m_dataBinds[pass].draw(0, m_verts.size());
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CFogVolumePlaneShader {
|
||||
public:
|
||||
@@ -36,4 +36,4 @@ public:
|
||||
void draw(size_t pass);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "Runtime/Graphics/CLineRenderer.hpp"
|
||||
#include "CLineRendererShaders.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <bool Additive, bool AlphaWrite, hsh::Compare ZComp>
|
||||
@@ -74,4 +74,4 @@ void CLineRendererShaders::BindShader(CLineRenderer& renderer, hsh::texture2d te
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CLineRenderer;
|
||||
|
||||
class CLineRendererShaders {
|
||||
@@ -13,4 +13,4 @@ public:
|
||||
hsh::Compare zcomp);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "CMapSurfaceShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CMapSurfaceShaderPipeline : pipeline<topology<hsh::TriangleStrip>, BlendAttachment<>, depth_compare<hsh::GEqual>,
|
||||
@@ -29,4 +29,4 @@ void CMapSurfaceShader::draw(const zeus::CColor& color, u32 start, u32 count) {
|
||||
m_dataBind.draw_indexed(start, count);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CMapSurfaceShader {
|
||||
public:
|
||||
@@ -31,4 +31,4 @@ public:
|
||||
void draw(const zeus::CColor& color, u32 start, u32 count);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "zeus/CAABox.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using BlendMaterial = hecl::blender::Material;
|
||||
using MaterialBlendMode = BlendMaterial::BlendMode;
|
||||
|
||||
@@ -73,7 +73,7 @@ using DynReflectionTexType = typename DynReflectionTex<CubeReflection>::type;
|
||||
|
||||
#include "CModelShaders.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
void CModelShaders::FragmentUniform::ActivateLights(const std::vector<CLight>& lts) {
|
||||
ambient = zeus::skClear;
|
||||
@@ -1183,4 +1183,4 @@ struct CCubeMaterial {
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace hecl::Backend {
|
||||
class ShaderTag;
|
||||
} // namespace hecl::Backend
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CLight;
|
||||
struct CModelFlags;
|
||||
struct CBooSurface;
|
||||
@@ -27,7 +27,10 @@ class CBooModel;
|
||||
enum class EExtendedShader : uint8_t {
|
||||
Flat,
|
||||
Lighting,
|
||||
Thermal,
|
||||
ThermalModel,
|
||||
ThermalModelNoZTestNoZWrite,
|
||||
ThermalStatic,
|
||||
ThermalStaticNoZWrite,
|
||||
ForcedAlpha,
|
||||
ForcedAdditive,
|
||||
SolidColor,
|
||||
@@ -138,4 +141,4 @@ struct ModelInstance {
|
||||
};
|
||||
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "CParticleSwooshShaders.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <bool Additive, bool AlphaWrite, bool ZWrite>
|
||||
@@ -67,4 +67,4 @@ void CParticleSwooshShaders::BuildShaderDataBinding(CParticleSwoosh& gen) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CParticleSwoosh;
|
||||
|
||||
class CParticleSwooshShaders {
|
||||
@@ -25,4 +25,4 @@ public:
|
||||
static void BuildShaderDataBinding(CParticleSwoosh& gen);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "Runtime/Graphics/CBooRenderer.hpp"
|
||||
#include "Runtime/Graphics/CGraphics.hpp"
|
||||
#include "Runtime/Graphics/CTexture.hpp"
|
||||
|
||||
#include "CPhazonSuitFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CPhazonSuitFilterPipeline : pipeline<topology<hsh::TriangleStrip>, AdditiveAttachment<>, depth_write<false>> {
|
||||
@@ -161,4 +162,4 @@ void CPhazonSuitFilter::draw(const zeus::CColor& color, float indScale, float in
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace zeus {
|
||||
class CColor;
|
||||
} // namespace zeus
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
class CPhazonSuitFilter {
|
||||
@@ -42,4 +42,4 @@ public:
|
||||
void draw(const zeus::CColor& color, float indScale, float indOffX, float indOffY);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "CRadarPaintShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CRadarPaintShaderPipeline : pipeline<topology<hsh::TriangleStrip>, AdditiveAttachment<>, depth_write<false>> {
|
||||
@@ -39,4 +39,4 @@ void CRadarPaintShader::draw(const std::vector<Instance>& instances, const CText
|
||||
m_dataBind.draw_instanced(0, 4, instances.size());
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
class CRadarPaintShader {
|
||||
@@ -30,4 +30,4 @@ public:
|
||||
void draw(const std::vector<Instance>& instances, const CTexture* tex);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "CRandomStaticFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <EFilterType Type, bool CookieCutter>
|
||||
@@ -94,4 +94,4 @@ void CRandomStaticFilter::draw(const zeus::CColor& color, float t) {
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "Runtime/CToken.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
enum class EFilterShape;
|
||||
@@ -43,4 +43,4 @@ public:
|
||||
: CCookieCutterDepthRandomStaticFilter(type) {}
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "CScanLinesFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <EFilterType Type>
|
||||
@@ -41,4 +41,4 @@ void CScanLinesFilter::draw(const zeus::CColor& color) {
|
||||
m_dataBind.draw(0, 670);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "zeus/CColor.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
enum class EFilterShape;
|
||||
@@ -42,4 +42,4 @@ public:
|
||||
explicit CScanLinesFilterOdd(EFilterType type, const TLockedToken<CTexture>&) : CScanLinesFilterOdd(type) {}
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "CSpaceWarpFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CSpaceWarpFilterPipeline
|
||||
@@ -168,4 +168,4 @@ void CSpaceWarpFilter::draw(const zeus::CVector3f& pt) {
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CSpaceWarpFilter {
|
||||
public:
|
||||
@@ -39,4 +39,4 @@ public:
|
||||
void draw(const zeus::CVector3f& pt);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "CTextSupportShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
constexpr hsh::sampler ClampEdgeSamp(hsh::Linear, hsh::Linear, hsh::Linear, hsh::ClampToEdge, hsh::ClampToEdge,
|
||||
@@ -140,4 +140,4 @@ void CTextSupportShader::BuildImageShaderBinding(CTextRenderBuffer& buf, BooImag
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "zeus/CVector2i.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CGlyph;
|
||||
class CFontImageDef;
|
||||
class CTextRenderBuffer;
|
||||
@@ -47,4 +47,4 @@ public:
|
||||
static void BuildImageShaderBinding(CTextRenderBuffer& buf, BooImage& img, CGuiWidget::EGuiModelDrawFlags flags);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "CTexturedQuadFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
template <EFilterType Type, bool TexAlpha>
|
||||
struct CTexturedQuadFilterPipeline : FilterPipeline<Type> {
|
||||
@@ -193,4 +193,4 @@ CTexturedQuadFilterAlpha::CTexturedQuadFilterAlpha(EFilterType type, TLockedToke
|
||||
m_tex = tex;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "zeus/CVector2f.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
enum class EFilterShape;
|
||||
@@ -62,4 +62,4 @@ public:
|
||||
explicit CTexturedQuadFilterAlpha(EFilterType type, hsh::render_texture2d tex);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "CThermalColdFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CThermalColdFilterPipeline : pipeline<topology<hsh::TriangleStrip>,
|
||||
@@ -69,4 +69,4 @@ void CThermalColdFilter::draw() {
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "zeus/CColor.hpp"
|
||||
#include "zeus/CMatrix4f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CThermalColdFilter {
|
||||
public:
|
||||
@@ -42,4 +42,4 @@ public:
|
||||
void draw();
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "CThermalHotFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CThermalHotFilterPipeline
|
||||
@@ -53,4 +53,4 @@ void CThermalHotFilter::draw() {
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "hsh/hsh.h"
|
||||
#include "zeus/CColor.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CThermalHotFilter {
|
||||
public:
|
||||
@@ -31,4 +31,4 @@ public:
|
||||
void draw();
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "CWorldShadowShader.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
template <bool Depth>
|
||||
@@ -79,4 +79,4 @@ void CWorldShadowShader::blendPreviousShadow() {
|
||||
|
||||
void CWorldShadowShader::resolveTexture() { m_tex.resolve_color_binding(0, hsh::rect2d{{}, {m_w, m_h}}, false); }
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "zeus/CColor.hpp"
|
||||
#include "zeus/CMatrix4f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CWorldShadowShader {
|
||||
public:
|
||||
@@ -45,4 +45,4 @@ public:
|
||||
hsh::render_texture2d GetTexture() const { return m_tex.get_color(0); }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "CXRayBlurFilter.cpp.hshhead"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
using namespace hsh::pipeline;
|
||||
|
||||
struct CXRayBlurFilterPipeline
|
||||
@@ -86,4 +86,4 @@ void CXRayBlurFilter::draw(float amount) {
|
||||
m_dataBind.draw(0, 4);
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "hsh/hsh.h"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CTexture;
|
||||
|
||||
class CXRayBlurFilter {
|
||||
@@ -32,4 +32,4 @@ public:
|
||||
void draw(float amount);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
Reference in New Issue
Block a user