Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Color.cpp
Show All 26 Lines | |||||
#if HAVE_SSE | #if HAVE_SSE | ||||
# include <xmmintrin.h> | # include <xmmintrin.h> | ||||
# include "lib/sysdep/arch/x86_x64/x86_x64.h" | # include "lib/sysdep/arch/x86_x64/x86_x64.h" | ||||
#endif | #endif | ||||
static SColor4ub fallback_ConvertRGBColorTo4ub(const RGBColor& src) | static SColor4ub fallback_ConvertRGBColorTo4ub(const RGBColor& src) | ||||
{ | { | ||||
SColor4ub result; | SColor4ub result; | ||||
result.R = clamp(static_cast<int>(src.X * 255), 0, 255); | result.R = Clamp(static_cast<int>(src.X * 255), 0, 255); | ||||
result.G = clamp(static_cast<int>(src.Y * 255), 0, 255); | result.G = Clamp(static_cast<int>(src.Y * 255), 0, 255); | ||||
result.B = clamp(static_cast<int>(src.Z * 255), 0, 255); | result.B = Clamp(static_cast<int>(src.Z * 255), 0, 255); | ||||
Stan: rgb are ints ? | |||||
Done Inline ActionsSColor4ub - yes. vladislavbelov: `SColor4ub` - yes. | |||||
Done Inline ActionsCould have used std::limits but I guess that's too verbose. Stan: Could have used std::limits but I guess that's too verbose. | |||||
Done Inline ActionsIt requires more changes, as adding a component type as own type. vladislavbelov: It requires more changes, as adding a component type as own type. | |||||
result.A = 255; | result.A = 255; | ||||
return result; | return result; | ||||
} | } | ||||
// on IA32, this is replaced by an SSE assembly version in ia32.cpp | // on IA32, this is replaced by an SSE assembly version in ia32.cpp | ||||
SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src) = fallback_ConvertRGBColorTo4ub; | SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src) = fallback_ConvertRGBColorTo4ub; | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
rgb are ints ?