mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-16 04:17:03 +00:00
More CCubeMaterial, more CGraphics, more aurora::gx
This commit is contained in:
@@ -44,21 +44,19 @@ void CGuiFrame::SortDrawOrder() {
|
||||
});
|
||||
}
|
||||
|
||||
void CGuiFrame::EnableLights(u32 lights) const {
|
||||
void CGuiFrame::EnableLights(ERglLight lights) const {
|
||||
CGraphics::DisableAllLights();
|
||||
|
||||
zeus::CColor ambColor(zeus::skBlack);
|
||||
ERglLight lightId = ERglLight::Zero;
|
||||
int idx = 0;
|
||||
ERglLight lightId = 0;
|
||||
int enabledLights = 0;
|
||||
for (CGuiLight* light : m_indexedLights) {
|
||||
if (light == nullptr || !light->GetIsVisible()) {
|
||||
++reinterpret_cast<std::underlying_type_t<ERglLight>&>(lightId);
|
||||
++idx;
|
||||
++lightId;
|
||||
continue;
|
||||
}
|
||||
if ((lights & (1 << idx)) != 0) {
|
||||
const zeus::CColor& geomCol = light->GetGeometryColor();
|
||||
if ((lights & (1 << lightId)) != 0) {
|
||||
const auto& geomCol = light->GetGeometryColor();
|
||||
if (geomCol.r() != 0.f || geomCol.g() != 0.f || geomCol.b() != 0.f) {
|
||||
CGraphics::LoadLight(lightId, light->BuildLight());
|
||||
CGraphics::EnableLight(lightId);
|
||||
@@ -67,8 +65,7 @@ void CGuiFrame::EnableLights(u32 lights) const {
|
||||
ambColor += light->GetAmbientLightColor();
|
||||
++enabledLights;
|
||||
}
|
||||
++reinterpret_cast<std::underlying_type_t<ERglLight>&>(lightId);
|
||||
++idx;
|
||||
++lightId;
|
||||
}
|
||||
if (enabledLights == 0) {
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "Runtime/GuiSys/CGuiHeadWidget.hpp"
|
||||
#include "Runtime/GuiSys/CGuiWidgetIdDB.hpp"
|
||||
#include "Runtime/GuiSys/CGuiWidget.hpp"
|
||||
#include "Runtime/Graphics/CGraphics.hpp"
|
||||
|
||||
namespace metaforce {
|
||||
class CGuiCamera;
|
||||
@@ -69,7 +70,7 @@ public:
|
||||
void SetHeadWidget(std::shared_ptr<CGuiHeadWidget>&& hwig) { xc_headWidget = std::move(hwig); }
|
||||
CGuiHeadWidget* GetHeadWidget() const { return xc_headWidget.get(); }
|
||||
void SortDrawOrder();
|
||||
void EnableLights(u32 lights) const;
|
||||
void EnableLights(ERglLight lights) const;
|
||||
void DisableLights() const;
|
||||
void RemoveLight(CGuiLight* light);
|
||||
void AddLight(CGuiLight* light);
|
||||
|
||||
Reference in New Issue
Block a user