]> git.tdb.fi Git - libs/gl.git/commitdiff
Convert Lighting to use shared actions
authorMikko Rasa <tdb@tdb.fi>
Sat, 17 Apr 2021 18:31:04 +0000 (21:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 17 Apr 2021 19:05:00 +0000 (22:05 +0300)
source/materials/lighting.cpp
source/materials/lighting.h

index eeb4f30ee8e4ca0796ded102bfaf44049f1063c5..fa0c26b41bfa815abe6902394e505cf474c3276c 100644 (file)
@@ -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<Lighting>(l)
+{
+       set_actions(shared_actions);
+}
+
+void Lighting::Loader::init_actions()
 {
        add("ambient", &Loader::ambient);
        add("fog_color", &Loader::fog_color);
index ca214fc829601c9c26fa05e73e9e6d37f08d46be..56c728a12c2bbad1ef597a9c457109c03713b174 100644 (file)
@@ -21,10 +21,15 @@ class Lighting
 public:
        class Loader: public DataFile::ObjectLoader<Lighting>
        {
+       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);