- replaced MIN/MAX in common code.
This commit is contained in:
parent
07a181090b
commit
eb69bbcae0
63 changed files with 200 additions and 236 deletions
|
|
@ -460,7 +460,7 @@ struct bCopyAlpha
|
|||
struct bOverlay
|
||||
{
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = (s*a + d*(255-a))/255; }
|
||||
static __forceinline void OpA(uint8_t &d, uint8_t s, FCopyInfo *i) { d = MAX(s,d); }
|
||||
static __forceinline void OpA(uint8_t &d, uint8_t s, FCopyInfo *i) { d = max(s,d); }
|
||||
static __forceinline bool ProcessAlpha0() { return false; }
|
||||
};
|
||||
|
||||
|
|
@ -473,21 +473,21 @@ struct bBlend
|
|||
|
||||
struct bAdd
|
||||
{
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = MIN<int>((d*BLENDUNIT + s*i->alpha) >> BLENDBITS, 255); }
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = min<int>((d*BLENDUNIT + s*i->alpha) >> BLENDBITS, 255); }
|
||||
static __forceinline void OpA(uint8_t &d, uint8_t s, FCopyInfo *i) { d = s; }
|
||||
static __forceinline bool ProcessAlpha0() { return false; }
|
||||
};
|
||||
|
||||
struct bSubtract
|
||||
{
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = MAX<int>((d*BLENDUNIT - s*i->alpha) >> BLENDBITS, 0); }
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = max<int>((d*BLENDUNIT - s*i->alpha) >> BLENDBITS, 0); }
|
||||
static __forceinline void OpA(uint8_t &d, uint8_t s, FCopyInfo *i) { d = s; }
|
||||
static __forceinline bool ProcessAlpha0() { return false; }
|
||||
};
|
||||
|
||||
struct bReverseSubtract
|
||||
{
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = MAX<int>((-d*BLENDUNIT + s*i->alpha) >> BLENDBITS, 0); }
|
||||
static __forceinline void OpC(uint8_t &d, uint8_t s, uint8_t a, FCopyInfo *i) { d = max<int>((-d*BLENDUNIT + s*i->alpha) >> BLENDBITS, 0); }
|
||||
static __forceinline void OpA(uint8_t &d, uint8_t s, FCopyInfo *i) { d = s; }
|
||||
static __forceinline bool ProcessAlpha0() { return false; }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue