changed flood fill function to prevent stack overflow crashes
The previous implementation of the flood fill function (as used in the
level editor) used recursion, which could cause the program to crash
on some systems when using it with maximum level size. This was caused
by a stack overflow on systems that use a stack size not large enough
for the deep recursion involved in such cases. (Such crashes happened
on Windows systems, which usually have a stack size of 1 MB, while it
did not happen on Linux systems, which usually have 8 MB stack size.)
The new flood fill function which uses an iterative algorithm does not
have this problem (as the memory used for it is not on the stack).