From aeef1c75d50f39bf57c3e608bbe41005479c44da Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 17 Apr 2021 21:31:04 +0300 Subject: [PATCH] Convert Lighting to use shared actions --- source/materials/lighting.cpp | 7 +++++++ source/materials/lighting.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/source/materials/lighting.cpp b/source/materials/lighting.cpp index eeb4f30e..fa0c26b4 100644 --- a/source/materials/lighting.cpp +++ b/source/materials/lighting.cpp @@ -102,8 +102,15 @@ void Lighting::update_shader_data(ProgramData &shdata, const Matrix &view_matrix } +DataFile::Loader::ActionMap Lighting::Loader::shared_actions; + Lighting::Loader::Loader(Lighting &l): DataFile::ObjectLoader(l) +{ + set_actions(shared_actions); +} + +void Lighting::Loader::init_actions() { add("ambient", &Loader::ambient); add("fog_color", &Loader::fog_color); diff --git a/source/materials/lighting.h b/source/materials/lighting.h index ca214fc8..56c728a1 100644 --- a/source/materials/lighting.h +++ b/source/materials/lighting.h @@ -21,10 +21,15 @@ class Lighting public: class Loader: public DataFile::ObjectLoader { + private: + static ActionMap shared_actions; + public: Loader(Lighting &); private: + virtual void init_actions(); + void ambient(float, float, float); void fog_color(float, float, float); void fog_density(float); -- 2.45.2