Skip to content

Commit

Permalink
Fixed an SDL1 difference in the world code
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Oct 13, 2024
1 parent 627323a commit 849fb9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/smw/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,18 @@ void WorldVehicle::Draw(short iWorldOffsetX, short iWorldOffsetY, bool fVehicles
{
if (fVehiclesSleeping) {
SDL_Rect rDst = {ix + iWorldOffsetX, iy + iWorldOffsetY, iTileSize, iTileSize};
#ifdef USE_SDL2
SDL_BlitSurface(rm->spr_worldvehicle[iTileSheet].getSurface(), &srcRects[4], blitdest, &rDst);
#else // SDL_BlitSurface uses a non-const source rect
SDL_BlitSurface(rm->spr_worldvehicle[iTileSheet].getSurface(), const_cast<SDL_Rect*>(&srcRects[4]), blitdest, &rDst);
#endif
} else {
SDL_Rect rDst = {ix + iWorldOffsetX + iPaceOffset, iy + iWorldOffsetY, iTileSize, iTileSize};
#ifdef USE_SDL2
SDL_BlitSurface(rm->spr_worldvehicle[iTileSheet].getSurface(), &srcRects[iDrawDirection + iAnimationFrame], blitdest, &rDst);
#else // SDL_BlitSurface uses a non-const source rect
SDL_BlitSurface(rm->spr_worldvehicle[iTileSheet].getSurface(), const_cast<SDL_Rect*>(&srcRects[iDrawDirection + iAnimationFrame]), blitdest, &rDst);
#endif
}
}

Expand Down

0 comments on commit 849fb9a

Please sign in to comment.