summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Color.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'StarsEx/Color.cpp')
-rw-r--r--StarsEx/Color.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/StarsEx/Color.cpp b/StarsEx/Color.cpp
index 8c468dd..5ed6257 100644
--- a/StarsEx/Color.cpp
+++ b/StarsEx/Color.cpp
@@ -14,7 +14,6 @@
#include "Color.h"
#include "Video.h"
#include "Pcx.h"
-#include "Fix.h"
#include "Utils.h"
// +--------------------------------------------------------------------+
@@ -118,10 +117,10 @@ Color::operator*(const Color& c) const
Color
Color::operator*(double scale) const
{
- int r = fast_f2i(Red() * scale); if (r > 255) r = 255;
- int g = fast_f2i(Green() * scale); if (g > 255) g = 255;
- int b = fast_f2i(Blue() * scale); if (b > 255) b = 255;
- int a = fast_f2i(Alpha() * scale); if (a > 255) a = 255;
+ int r = static_cast<int>(Red() * scale); if (r > 255) r = 255;
+ int g = static_cast<int>(Green() * scale); if (g > 255) g = 255;
+ int b = static_cast<int>(Blue() * scale); if (b > 255) b = 255;
+ int a = static_cast<int>(Alpha() * scale); if (a > 255) a = 255;
return Color((BYTE) r, (BYTE) g, (BYTE) b, (BYTE) a);
}
@@ -129,9 +128,9 @@ Color::operator*(double scale) const
Color
Color::dim(double scale) const
{
- int r = fast_f2i(Red() * scale);
- int g = fast_f2i(Green() * scale);
- int b = fast_f2i(Blue() * scale);
+ int r = static_cast<int>(Red() * scale);
+ int g = static_cast<int>(Green() * scale);
+ int b = static_cast<int>(Blue() * scale);
return Color((BYTE) r, (BYTE) g, (BYTE) b, (BYTE) Alpha());
}