Skip to content
Snippets Groups Projects
Commit 72a6cd13 authored by John Hodge (sonata)'s avatar John Hodge (sonata)
Browse files

Usermode/AxWin4 - (minor) Fix CColour to compile in non-native context

parent 7f206823
No related merge requests found
...@@ -12,6 +12,7 @@ namespace AxWin { ...@@ -12,6 +12,7 @@ namespace AxWin {
class CColour class CColour
{ {
static const uint8_t uint8_max = 0xFF;
static const unsigned int comp_max = 0x7FFF; static const unsigned int comp_max = 0x7FFF;
unsigned int m_alpha; unsigned int m_alpha;
...@@ -21,10 +22,10 @@ class CColour ...@@ -21,10 +22,10 @@ class CColour
private: private:
static unsigned int u8_to_ui(uint8_t u8v) { static unsigned int u8_to_ui(uint8_t u8v) {
return (unsigned int)u8v * comp_max / UINT8_MAX; return (unsigned int)u8v * comp_max / uint8_max;
} }
static uint8_t ui_to_u8(unsigned int uiv) { static uint8_t ui_to_u8(unsigned int uiv) {
return uiv * UINT8_MAX / comp_max; return uiv * uint8_max / comp_max;
} }
// Perform an alpha-based blend on two components // Perform an alpha-based blend on two components
static unsigned int alpha_blend(unsigned int alpha_comp, unsigned int left, unsigned int right) { static unsigned int alpha_blend(unsigned int alpha_comp, unsigned int left, unsigned int right) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment