diff --git a/modules/gfx/src/color.cc b/modules/gfx/src/color.cc index 43316f51c455e0643c7660274d10a5177177652b..60607ad0ed0fd0c85a0a67342b4b2929cfcbe426 100644 --- a/modules/gfx/src/color.cc +++ b/modules/gfx/src/color.cc @@ -263,7 +263,7 @@ Color& Color::operator/=(float rhs) void Color::to_rgb() const { - float hh=fmod(hsv_[0],1.0); + float hh=fmod(hsv_[0],1.0f); if(hh<0.0) hh+=1.0; float ss=std::min(1.0f,std::max(0.0f,hsv_[1])); float vv=std::min(1.0f,std::max(0.0f,hsv_[2])); diff --git a/modules/gfx/src/color.hh b/modules/gfx/src/color.hh index 6f0220bc2d2863c2744b502fee8c96dad21424ac..1340967f9b61d53d1aa4b5e307b0f9f560413d2d 100644 --- a/modules/gfx/src/color.hh +++ b/modules/gfx/src/color.hh @@ -159,7 +159,7 @@ private: mutable bool hsv_dirty_; }; - +#undef RGB /// \brief RGB color spec from floats (0.0-1.0) Color DLLEXPORT_OST_GFX RGB(float r, float g, float b); diff --git a/modules/gfx/src/texture.hh b/modules/gfx/src/texture.hh index dd71404feb5f946a0965416546e7f57b42467fc3..aa3fec45f8f0a5d288d977dd290e40210a9c5253 100644 --- a/modules/gfx/src/texture.hh +++ b/modules/gfx/src/texture.hh @@ -32,7 +32,7 @@ namespace ost { namespace gfx { -class Bitmap; +struct Bitmap; class Texture { diff --git a/modules/gfx/src/vertex_array.cc b/modules/gfx/src/vertex_array.cc index d37c83af141994eb83e638e1e0cb1ed5ca8b0024..520e0d0e9c95f640c3578b99af95090e7f4aabec 100644 --- a/modules/gfx/src/vertex_array.cc +++ b/modules/gfx/src/vertex_array.cc @@ -617,6 +617,7 @@ void IndexedVertexArray::Reset() outline_exp_factor_=0.1; outline_exp_color_=Color(0,0,0); solid_=false; + #undef RGB solid_color_=RGB(1,1,1); clip_offset_=0.0; draw_normals_=false; diff --git a/modules/gfx/tests/test_color.cc b/modules/gfx/tests/test_color.cc index 88856fb1762fa5b636fc2f4ec449ea735865c62f..26784b4cc6bbac872aa3b4703564b1b3be8aeb95 100644 --- a/modules/gfx/tests/test_color.cc +++ b/modules/gfx/tests/test_color.cc @@ -36,13 +36,13 @@ static const float tolerance=1e-4; namespace { bool compare_colors(const Color& c1, const Color& c2, float tol=1e-6) { - return std::fabs(c1.GetRed()-c2.GetRed()<tol) && - std::fabs(c1.GetGreen()-c2.GetGreen()<tol) && - std::fabs(c1.GetBlue()-c2.GetBlue()<tol) && - std::fabs(c1.GetAlpha()-c2.GetAlpha()<tol) && - std::fabs(c1.GetHue()-c2.GetHue()<tol) && - std::fabs(c1.GetSat()-c2.GetSat()<tol) && - std::fabs(c1.GetVal()-c2.GetVal()<tol); + return std::abs<float>(c1.GetRed()-c2.GetRed()<tol) && + std::abs<float>(c1.GetGreen()-c2.GetGreen()<tol) && + std::abs<float>(c1.GetBlue()-c2.GetBlue()<tol) && + std::abs<float>(c1.GetAlpha()-c2.GetAlpha()<tol) && + std::abs<float>(c1.GetHue()-c2.GetHue()<tol) && + std::abs<float>(c1.GetSat()-c2.GetSat()<tol) && + std::abs<float>(c1.GetVal()-c2.GetVal()<tol); } }