A handy bit of code to generate patches

Blitz3D Forums/Blitz3D Programming/A handy bit of code to generate patches

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Bear in mind that some people will create custom maps for their games, that may well use a fixed file size, eg. storing an absolute 256 x 256 'map' of bytes; if one of those bytes is changed -- possibly changing all instances of a certain tile in a game level -- checking the file size only will detect no change so the new patch folder won't be complete or correct. Same goes for any file where it remains the same after a 'tweak'...

Try calculating a CRC32 checksum for each file and compare the 'possible new' checksum against the old one.

I'd swear I posted CRC32 code ages ago, but it ain't there; however, MrCredo has done the hard part for you... :)

http://www.blitzbasic.com/codearcs/codearcs.php?code=790