diff --git a/RSDKv3/Drawing.cpp b/RSDKv3/Drawing.cpp index f088a730..6ea33794 100644 --- a/RSDKv3/Drawing.cpp +++ b/RSDKv3/Drawing.cpp @@ -1950,7 +1950,7 @@ void DrawStageGFX() // Hacky fix for Tails Object not working properly on non-Origins bytecode if (forceUseScripts || GetGlobalVariableByName("NOTIFY_1P_VS_SELECT") != 0) #endif - DrawObjectList(7); // Extra Origins draw list (who knows why it comes before 6) + DrawObjectList(7); // Extra Origins draw list (who knows why it comes before 6) DrawObjectList(6); #if !RETRO_USE_ORIGINAL_CODE @@ -4810,7 +4810,7 @@ void SetFadeHQ(int R, int G, int B, int A) // Not Avaliable in HW mode } -void DrawTintRectangle(int XPos, int YPos, int width, int height) +void DrawTintRectangle(uint XPos, uint YPos, int width, int height) { if (renderType == RENDER_SW) { if (width + XPos > GFX_LINESIZE) @@ -4826,13 +4826,13 @@ void DrawTintRectangle(int XPos, int YPos, int width, int height) height += YPos; YPos = 0; } - if (width <= 0 || height <= 0) + if (width < 0 || height < 0) return; int yOffset = GFX_LINESIZE - width; for (ushort *frameBufferPtr = &Engine.frameBuffer[XPos + GFX_LINESIZE * YPos];; frameBufferPtr += yOffset) { height--; - if (!height) + if (height < 0) break; int w = width; diff --git a/RSDKv3/Drawing.hpp b/RSDKv3/Drawing.hpp index 9b494c83..1b4b654a 100644 --- a/RSDKv3/Drawing.hpp +++ b/RSDKv3/Drawing.hpp @@ -187,7 +187,7 @@ void Draw3DSkyLayer(int layerID); // Shape Drawing void DrawRectangle(int XPos, int YPos, int width, int height, int R, int G, int B, int A); void SetFadeHQ(int R, int G, int B, int A); -void DrawTintRectangle(int XPos, int YPos, int width, int height); +void DrawTintRectangle(uint XPos, uint YPos, int width, int height); void DrawScaledTintMask(int direction, int XPos, int YPos, int pivotX, int pivotY, int scaleX, int scaleY, int width, int height, int sprX, int sprY, int sheetID); diff --git a/RSDKv3/Palette.cpp b/RSDKv3/Palette.cpp index e115346a..3089ac36 100644 --- a/RSDKv3/Palette.cpp +++ b/RSDKv3/Palette.cpp @@ -72,7 +72,7 @@ void SetLimitedFade(byte paletteID, byte R, byte G, byte B, ushort alpha, int st return; uint alpha2 = 0xFF - alpha; - for (int i = startIndex; i < endIndex; ++i) { + for (int i = startIndex; i <= endIndex; ++i) { PACK_RGB888(activePalette[i], (byte)((ushort)(R * alpha + alpha2 * activePalette32[i].r) >> 8), (byte)((ushort)(G * alpha + alpha2 * activePalette32[i].g) >> 8), (byte)((ushort)(B * alpha + alpha2 * activePalette32[i].b) >> 8));