2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2019-09-22 14:52:05 -07:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "Runtime/Graphics/CLight.hpp"
|
|
|
|
#include "Runtime/GuiSys/CGuiWidget.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CColor.hpp>
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2017-01-21 17:40:12 -08:00
|
|
|
class CSimplePool;
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CGuiLight : public CGuiWidget {
|
|
|
|
ELightType xb8_type;
|
|
|
|
float xbc_spotCutoff;
|
|
|
|
float xc0_distC;
|
|
|
|
float xc4_distL;
|
|
|
|
float xc8_distQ;
|
|
|
|
float xcc_angleC;
|
|
|
|
float xd0_angleL;
|
|
|
|
float xd4_angleQ;
|
|
|
|
u32 xd8_lightId;
|
2019-02-23 23:15:54 -08:00
|
|
|
zeus::CColor xdc_ambColor = zeus::skBlack;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
2016-03-11 20:58:56 -08:00
|
|
|
public:
|
2019-08-09 05:45:18 -07:00
|
|
|
~CGuiLight() override;
|
2018-12-07 21:30:43 -08:00
|
|
|
CGuiLight(const CGuiWidgetParms& parms, const CLight& light);
|
2019-08-09 05:45:18 -07:00
|
|
|
FourCC GetWidgetTypeID() const override { return FOURCC('LITE'); }
|
2018-12-07 21:30:43 -08:00
|
|
|
|
|
|
|
CLight BuildLight() const;
|
2019-08-09 05:45:18 -07:00
|
|
|
void SetIsVisible(bool vis) override;
|
2018-12-07 21:30:43 -08:00
|
|
|
u32 GetLightId() const { return xd8_lightId; }
|
|
|
|
const zeus::CColor& GetAmbientLightColor() const { return xdc_ambColor; }
|
|
|
|
void SetSpotCutoff(float v) { xbc_spotCutoff = v; }
|
|
|
|
void SetDistC(float v) { xc0_distC = v; }
|
|
|
|
void SetDistL(float v) { xc4_distL = v; }
|
|
|
|
void SetDistQ(float v) { xc8_distQ = v; }
|
|
|
|
void SetAngleC(float v) { xcc_angleC = v; }
|
|
|
|
void SetAngleL(float v) { xd0_angleL = v; }
|
|
|
|
void SetAngleQ(float v) { xd4_angleQ = v; }
|
|
|
|
void SetLightId(u32 idx) { xd8_lightId = idx; }
|
|
|
|
void SetAmbientLightColor(const zeus::CColor& color) { xdc_ambColor = color; }
|
|
|
|
|
|
|
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
|
|
|
|
|
|
|
std::shared_ptr<CGuiLight> shared_from_this() {
|
|
|
|
return std::static_pointer_cast<CGuiLight>(CGuiObject::shared_from_this());
|
|
|
|
}
|
2016-03-11 20:58:56 -08:00
|
|
|
};
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|