You should check if all _LoadImage calls are succeeding.
I am quite certain that _FreeImage is throwing an "illegal function call" because it is trying to free an invalid image handle.
Update:
^this.
I am quite certain that _FreeImage is throwing an "illegal function call" because it is trying to free an invalid image handle.
Update:
Quote:Oh! Should be:
_FreeImage tiles(a) ' <<< missing tiles
^this.