Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LittlePlanetCD committed May 28, 2024
2 parents 1a639c5 + 1c3766e commit 9087b33
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions RSDKv4/Drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,7 @@ void SetFadeHQ(int R, int G, int B, int A)
#endif
}

void DrawTintRectangle(int XPos, int YPos, int width, int height)
void DrawTintRectangle(uint XPos, uint YPos, int width, int height)
{
#if RETRO_SOFTWARE_RENDER
if (width + XPos > GFX_LINESIZE)
Expand All @@ -2772,12 +2772,14 @@ 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;
while (w--) {
Expand Down
2 changes: 1 addition & 1 deletion RSDKv4/Drawing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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);

Expand Down
4 changes: 2 additions & 2 deletions RSDKv4/Palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void SetLimitedFade(byte paletteID, byte R, byte G, byte B, ushort blendAmount,
return;

uint blendA = 0xFF - blendAmount;
for (int i = startIndex; i < endIndex; ++i) {
for (int i = startIndex; i <= endIndex; ++i) {
PACK_RGB888(activePalette[i], (byte)((ushort)(R * blendAmount + blendA * activePalette32[i].r) >> 8),
(byte)((ushort)(G * blendAmount + blendA * activePalette32[i].g) >> 8),
(byte)((ushort)(B * blendAmount + blendA * activePalette32[i].b) >> 8));
Expand All @@ -96,7 +96,7 @@ void SetPaletteFade(byte destPaletteID, byte srcPaletteA, byte srcPaletteB, usho
uint blendA = 0xFF - blendAmount;
ushort *dst = &fullPalette[destPaletteID][startIndex];
PaletteEntry *dst32 = &fullPalette32[destPaletteID][startIndex];
for (int l = startIndex; l < endIndex; ++l) {
for (int l = startIndex; l <= endIndex; ++l) {
*dst = PACK_RGB888((byte)((ushort)(fullPalette32[srcPaletteB][l].r * blendAmount + blendA * fullPalette32[srcPaletteA][l].r) >> 8),
(byte)((ushort)(fullPalette32[srcPaletteB][l].g * blendAmount + blendA * fullPalette32[srcPaletteA][l].g) >> 8),
(byte)((ushort)(fullPalette32[srcPaletteB][l].b * blendAmount + blendA * fullPalette32[srcPaletteA][l].b) >> 8));
Expand Down
2 changes: 1 addition & 1 deletion dependencies/android/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Android

## Install dependencies
* SDL2: [Download the source code](https://github.com/libsdl-org/SDL/tree/SDL2) and unzip it in `dependencies/android/SDL`.
* SDL2: [Download the source code of 2.28.3](https://libsdl.org/release/SDL2-2.28.3.zip) and unzip it in `dependencies/android/SDL`.

* GLEW: [Download the binaries](http://glew.sourceforge.net/) and unzip it in `dependencies/android/glew`.

Expand Down

0 comments on commit 9087b33

Please sign in to comment.