SFML community forums

Help => Graphics => Topic started by: Mr. House on December 31, 2011, 02:52:25 pm

Title: Comparing Images
Post by: Mr. House on December 31, 2011, 02:52:25 pm
Hello,

I'm trying to check if one image matches another for a platforming game (to check if the tile is solid).

I have this snippet of code

Code: [Select]
if(TileMapObj->TileMapVect[i].GetImage() == TileMapObj->TileVect[1])

and it is giving me the error "no match for operator== in ...."

TileMapVect is a vector that contains sf::Sprites while TileVect is a vector that contains objects of type sf::Image.

So yea, I'm probably trying to compare apples and oranges.
Title: Comparing Images
Post by: Nexus on December 31, 2011, 03:22:02 pm
There is no such operator== overload in SFML. And if it were implemented pixel-wise, it would be very slow, especially for many checks per frame.

Why don't you store the property if the tile is solid as a bool?