]> git.tdb.fi Git - r2c2.git/commitdiff
Miscellaneous compilation fixes
authorMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 14:26:47 +0000 (16:26 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 14:26:47 +0000 (16:26 +0200)
source/3d/vehicletype.cpp
source/libr2c2/intellibox.h
source/libr2c2/speedquantizer.cpp

index a2f4a34415ef1954e1bdd30910123c4d235e2764..0c6465898987396d00fe5f0dd664da091b507b23 100644 (file)
@@ -158,7 +158,9 @@ GL::Technique *VehicleType3D::create_technique(const map<string, string> &params
        tex->storage(GL::RGB, 2, 1);
        tex->set_min_filter(GL::NEAREST);
        tex->set_mag_filter(GL::NEAREST);
-       unsigned char data[6] = { color>>16, color>>8, color, color2>>16, color2>>8, color2 };
+       unsigned char data[6];
+       data[0] = color>>16;  data[1] = color>>8;  data[2] = color;
+       data[3] = color2>>16; data[4] = color2>>8; data[5] = color2;
        tex->image(0, GL::RGB, GL::UNSIGNED_BYTE, data);
        pass.set_texture(0, tex);
 
index d3008d2f8ed200219d630f939d8c100f68f2dfee..efdf3b2edd633b72fe54a1f0471b75d45269bef4 100644 (file)
@@ -62,7 +62,7 @@ private:
                ERR_NO_I2C_SPACE,
                ERR_LOW_TURNOUT_SPACE=0x40,
                ERR_LOK_HALTED,
-               ERR_LOK_POWER_OFF,
+               ERR_LOK_POWER_OFF
        };
 
        enum Protocol
index 9fa127cb3125fcce5868416d71535558d98195e8..fa7a4be8b31311d348118cb47c4237e0e59ae8c7 100644 (file)
@@ -82,7 +82,7 @@ unsigned SpeedQuantizer::find_speed_step(float speed) const
                        else
                                return 0;
                }
-               return min(min(static_cast<unsigned>(low*speed/steps[low].speed), steps.size()-1), last+limit);
+               return min(min<unsigned>(low*speed/steps[low].speed, steps.size()-1), last+limit);
        }
 
        float f = (speed-steps[low].speed)/(steps[high].speed-steps[low].speed);