Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!uniwa!andreww From: andreww@uniwa.uwa.oz (Andrew John Williams) Newsgroups: comp.lang.pascal Subject: Re: Fill procedure for 320by200 with 256 color mode? Message-ID: <1991Jun22.052658.20993@uniwa.uwa.oz> Date: 22 Jun 91 05:26:58 GMT References: <13568@uhccux.uhcc.Hawaii.Edu> Organization: University of Western Australia Lines: 18 (Someone having trouble with flood-fill) The way I always do it is (roughly) scan left until you find a border pixel. Check pixel above. If it is not border, push it to a stack. Same for below. Then scan right, setting pixels, and checking the pixels above and below. If the pixel above (below) is not border and the one to the left of it is, push it to the stack. When you hit a border pixel (on this line), pop a pixel from the stack and start again from there. This method can survive with extremely small stacks, and is one of the fastest methods I've seen (after a few tweaks such as forgetting pixels and going a word at a time). But I'm not sure that flood-fills are good for arcade games. They are VERY slow. I don't know exactly what you want it for, but you might consider a polygon-fill instead. John West (stealing Andrew's account) Why is this fish in my ear?