1. floodfill algorithm

hi folks.

I'm not very experienced when it comes to writing my own graphics routines and functions, and i'm not going to ask you guys to answer me point-blank ( Allthough that would be nice ).
I'm writing some graphics routines in assembly with BC 3.1 compiler. Im sure at least one of you has fiddled with paint or any graphics program till now. And i'm sure you've noticed the "Bucket" tool or whatever you used to use to fill in a big area of the screen. Now, my question is if anyone knows that algorithm , and if it involves more than just plotting one pixel.
I've been trying day & night to crack it .....

This would certainly come in handy for us....

Take care,
Stef

2. there is a standard floodfill algorithm which u can find in any C graphics book. its called floddfill algo and deals with plotting pixels of same intensity with a new color

3. A common filling algorithm is a recursive 4/8 connect one:

Code:
```void fillFourConnect (int x, int y, int col)
{
int thisColour = *(0xA0000000L + x + (y * X_ROW_SIZE));
// Get this pixel^

*(0xA0000000L + x + (y * X_ROW_SIZE)) = col; // Change pixel.

if (*(0xA0000000L + x + 1 + (y * X_ROW_SIZE)) == thisColour)
fillFourConnect (x + 1, y, col);

if (*(0xA0000000L + x - 1 + (y * X_ROW_SIZE)) == thisColour)
fillFourConnect (x - 1, y, col);

if (*(0xA0000000L + x + ((y + 1) * X_ROW_SIZE)) == thisColour)
fillFourConnect (x, y + 1, col);

if (*(0xA0000000L + x + ((y - 1) * X_ROW_SIZE)) == thisColour)
fillFourConnect (x, y - 1, col);
}```
*(0xA0000000L + x + ((y + 1) * X_ROW_SIZE))
is just a low level way of accessing the video buffer, feel free to use any method you choose. This method only works in mode 0x13 (standard VGA) anyway.

It's recursive (but easy) so it may put strain on your stack. Beware.