Small changes, mostly cosmetics

This commit is contained in:
ptitSeb 2019-03-31 17:16:33 +02:00
parent 804522b8fb
commit 0c30342259
3 changed files with 11 additions and 10 deletions

0
Sources/Engine/CurrentVersion.h Normal file → Executable file
View File

8
Sources/Engine/Graphics/Color.cpp Normal file → Executable file
View File

@ -425,10 +425,10 @@ COLOR MulColors( COLOR col1, COLOR col2)
conv1.col = col1;
conv2.col = col2;
conv1.bytes[0] = (UBYTE) ((((DWORD) conv1.bytes[0]) * ((DWORD) conv2.bytes[0])) / 255);
conv1.bytes[1] = (UBYTE) ((((DWORD) conv1.bytes[1]) * ((DWORD) conv2.bytes[1])) / 255);
conv1.bytes[2] = (UBYTE) ((((DWORD) conv1.bytes[2]) * ((DWORD) conv2.bytes[2])) / 255);
conv1.bytes[3] = (UBYTE) ((((DWORD) conv1.bytes[3]) * ((DWORD) conv2.bytes[3])) / 255);
conv1.bytes[0] = (UBYTE) ((((DWORD) conv1.bytes[0]) * ((DWORD) conv2.bytes[0])) >> 8);
conv1.bytes[1] = (UBYTE) ((((DWORD) conv1.bytes[1]) * ((DWORD) conv2.bytes[1])) >> 8);
conv1.bytes[2] = (UBYTE) ((((DWORD) conv1.bytes[2]) * ((DWORD) conv2.bytes[2])) >> 8);
conv1.bytes[3] = (UBYTE) ((((DWORD) conv1.bytes[3]) * ((DWORD) conv2.bytes[3])) >> 8);
return(conv1.col);
#endif

View File

@ -125,7 +125,8 @@ public:
// increment a byte without overflowing it
static inline void IncrementByteWithClip( UBYTE &ub, SLONG slAdd)
{
ub = pubClipByte[(SLONG)ub+slAdd];
SLONG t = (SLONG)ub+slAdd;
ub = (t<0)?0:pubClipByte[t];
}
#if 0 // DG: unused.
@ -867,7 +868,7 @@ skipPixel:
sl1oL = auw1oSqrt[sl1oL];
SLONG slIntensity = _slLightMax;
if( sl1oL<256) slIntensity = 0;
else if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*_slLightStep)/*>>16*/;
else if( sl1oL<slMax1oL) slIntensity = (((sl1oL-256)*_slLightStep));
// add the intensity to the pixel
AddToCluster( pubLayer, slIntensity);
}
@ -1083,7 +1084,7 @@ skipPixel:
sl1oL = auw1oSqrt[sl1oL];
SLONG slIntensity = _slLightMax;
if( sl1oL<256) slIntensity = 0;
else if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*_slLightStep)/*>>16*/;
else if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*(_slLightStep));
// add the intensity to the pixel
AddToCluster( pubLayer, slIntensity);
}
@ -1807,14 +1808,14 @@ void CLayerMixer::MixOneMipmap(CBrushShadowMap *pbsm, INDEX iMipmap)
);
#else
register ULONG count = this->lm_pixCanvasSizeU * this->lm_pixCanvasSizeV;
ULONG count = this->lm_pixCanvasSizeU * this->lm_pixCanvasSizeV;
#if PLATFORM_LITTLEENDIAN
// Forces C fallback; BYTESWAP itself is a no-op on little endian.
register ULONG swapped = BYTESWAP32_unsigned(colAmbient);
ULONG swapped = BYTESWAP32_unsigned(colAmbient);
#else
STUBBED("actually need byteswap?");
// (uses inline asm on MacOS PowerPC)
register ULONG swapped = colAmbient;
ULONG swapped = colAmbient;
BYTESWAP(swapped);
#endif