mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-11-24 14:29:20 +03:00
Remove unnecessary intersectRect() function
This function checked the intersection of rectangles, but it used floats for some reason when its only caller used ints. There's already an intersection function (UtilityClass::intersects()), so we should be using that one instead in order to minimize code duplication. Graphics::Hitest() is used for per-pixel collision detection, directly checking the pixels of both entities' sprites. I checked with one of my TASes and it still syncs, so I'm pretty sure this won't cause any issues.
This commit is contained in:
1 parent
154e81292e
commit
627e971e90
3 files changed
+3
-8
No files matched your search
@@ -501,11 +501,6 @@ void FillRect( SDL_Surface* _surface, SDL_Rect rect, int rgba )
|
||||
SDL_FillRect(_surface, &rect, rgba);
|
||||
}
|
||||
|
||||
bool intersectRect( float left1, float right1, float bottom1, float top1, float left2, float right2, float bottom2, float top2 )
|
||||
{
|
||||
return !( left2 > right1 || right2 < left1 || top2 < bottom1 || bottom2 > top1);
|
||||
}
|
||||
|
||||
void OverlaySurfaceKeyed( SDL_Surface* _src, SDL_Surface* _dest, Uint32 _key )
|
||||
{
|
||||
// const SDL_PixelFormat& fmt = *(_src->format);
|
||||
|
||||
Reference in new issue
Block a user