Hi, I'm trying to write a library of graphics routines in Turbo Assembler 4. Line and point drawing is easy, but the flood fill is giving me some problems.
I want an algorithm that is capable of filling an area bounded by colour B, starting at position X,Y. I've written a semirecursive function that will do this, but only with small areas (about 100 pixels...). Beyond that, the stack overflows and causes a nasty crash. Ideally, I need an iterative routine that makes minimal (or no) use of the stack, although I'd guess that this is fairly difficult to do.
I can write the code myself. What I really need is a basic description of an algorithm that will do this. To kick-start my brain.