The checksum computation here is almost useless: It returned the same
value for over a minute, until i quit the game...
Sint32 Map::checkSum(bool heavy)
{
Sint32 cs=size;
if (heavy)
for (int y=0; y<h; y++)
for (int x=0; x<w; x++)
{
...
cs=(cs<<1)|(cs>>31);
}
return cs;
}
The rotate Statement cs=(cs<<1)|(cs>>31); is wrong for signed integers
and will overwrite the whole integer with 0xFFFFFFFF when cs is negative.
Game.cpp expects an Uint32 as return type anyway, so we just have to
change the type of cs to Uint32, and make Map::checkSum return an
Uint32. After changing this, it returned usable values...
Simon
_______________________________________________
glob2-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/glob2-devel