]> git.tdb.fi Git - r2c2.git/commitdiff
Make some internal colors darker to match linear color space
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Apr 2015 23:45:49 +0000 (02:45 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Apr 2015 23:45:49 +0000 (02:45 +0300)
source/3d/allocation.cpp
source/3d/allocation.h
source/3d/overlay.cpp

index 3835f8c8df2ba99ae70c0c597025c9cc189bac78..cbf2f85e31d55ac72336f52c215c5d321a58cd80 100644 (file)
@@ -21,12 +21,18 @@ void Allocation3D::set_color(const GL::Color &c)
        color = c;
        for(PathMap::const_iterator i=paths.begin(); i!=paths.end(); ++i)
        {
-               float intensity = 0.5+train.get_block_allocator().is_block_current(*i->first)*0.5;
+               GL::Color block_color = get_color_for_block(*i->first);
                for(PathList::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
-                       (*j)->set_color(color*intensity);
+                       (*j)->set_color(block_color);
        }
 }
 
+GL::Color Allocation3D::get_color_for_block(const Block &block) const
+{
+       float intensity = 0.25+train.get_block_allocator().is_block_current(block)*0.75;
+       return color*intensity;
+}
+
 void Allocation3D::block_reserved(Block &block, Train *t)
 {
        if(t==&train)
@@ -35,14 +41,14 @@ void Allocation3D::block_reserved(Block &block, Train *t)
                        return;
 
                PathList &bpaths = paths[&block];
+               GL::Color block_color = get_color_for_block(block);
                const Block::TrackSet &tracks = block.get_tracks();
                for(Block::TrackSet::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
                {
                        Path3D *path = new Path3D(layout.get_3d(**i));
                        bpaths.push_back(path);
                        path->set_layer(1);
-                       float intensity = 0.5+train.get_block_allocator().is_block_current(block)*0.5;
-                       path->set_color(color*intensity);
+                       path->set_color(block_color);
                        path->set_automatic();
                }
        }
index 87ea3096be28c6fe19faea8aa02647d30fce5941..13a6112882295e9362e0ad630bfbf2b2fbb9dc40 100644 (file)
@@ -24,8 +24,9 @@ public:
        Allocation3D(Layout3D &, Train &);
 
        void set_color(const Msp::GL::Color &);
-
 private:
+       Msp::GL::Color get_color_for_block(const Block &) const;
+
        void block_reserved(Block &, Train *);
        void train_advanced(Block &);
 };
index a9083e5f8fa94dc9aac066dec10e84900176ccc2..2a26915a6e5fce5288254ac8b9d3af907bac7f5b 100644 (file)
@@ -158,7 +158,7 @@ void Overlay3D::update_icon(Icon &icon)
 
        {
                GL::MeshBuilder bld(icon.background);
-               bld.color(0.2f, 0.2f, 0.2f, 0.7f);
+               bld.color(0.05f, 0.05f, 0.05f, 0.7f);
 
                bld.begin(GL::TRIANGLE_FAN);
                bld.vertex(0.4, 0.5);