From: Mikko Rasa Date: Sat, 17 Apr 2021 18:31:04 +0000 (+0300) Subject: Convert Lighting to use shared actions X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=aeef1c75d50f39bf57c3e608bbe41005479c44da Convert Lighting to use shared actions --- 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);