ID:273810
 
In a project I am presently working on, I am pregenerating dozens and dozens of icons to be packaged with the map files.

However, the icon files that have been generated are pretty big.

In my particular situation though, there are a large number of generated icons that "look" identical.

How do I go about determining if one generated icon is identical to another?
When I was writing the Lighting Generator, I used a hash. I'm not sure if there's a better way, but I haven't been able to think of it.

Basically, as I calculated each pixel, I was building an x and y centroid of the alpha-values. I also stored the sum of the alpha-values. It's a pretty basic hash, but I haven't seen any collisions yet, so it seems to work well enough.
In response to DarkCampainger
Unfortunately for me, looping through every pixel isn't going to work.

:[
In response to D4RK3 54B3R
D4RK3 54B3R wrote:
Unfortunately for me, looping through every pixel isn't going to work.

:[

You can't do it while it's generated? How are you creating them?
In response to DarkCampainger
MapColors()
In response to D4RK3 54B3R
You're talking about your walls, right? Why not make a hash of the starting wall icon state, and the relevant values from MapColors()?
In response to DarkCampainger
Well, I'm doing a large number of icon operations for each nearby light source, including MapColors(), Blend(), and SetIntensity(). What I'm trying to save is the resultant icon.

I've managed to solve the problem by rescaling the icon and hashing the RGBA values.

Could you get on Steam or something? I seem to have broken your static lighting...