Skip to content

Commit

Permalink
static_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
headshot2017 committed Jun 23, 2024
1 parent 4f9cdd8 commit a921d21
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arm9/src/gdrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,8 @@ void gdrv_bitmap8::ScaleIndexed(float scaleX, float scaleY)
{
for (int x = 0; x < Width; x++)
{
/*auto px = static_cast<int>(x / scaleX);
auto py = static_cast<int>(y / scaleY);
newIndBuf[dst] = IndexedBmpPtr[(py * IndexedStride) + px];*/
int smallX = (int)(x / (float)Width * (float)newWidht);
int smallY = (int)(y / (float)Height * (float)newHeight);
int smallX = static_cast<int>(static_cast<float>(x) / Width * newWidht);
int smallY = static_cast<int>(static_cast<float>(y) / Height * newHeight);
newIndBuf[smallY * newWidht + smallX] = IndexedBmpPtr[(y * IndexedStride) + x];
}
}
Expand Down

0 comments on commit a921d21

Please sign in to comment.