-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|510|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
Pakz
Created : 30 January 2021
Edited : 30 January 2021
Language : Raylib c language

Scanline fill

Fast scanline fill routine in c language

Latest Update

I read about how to do a scanline fill a couple of years ago and tried to create it today.

A scanline fill starts at x,y. It loops filling the line to the left and to the right. At every position you call the same function again but at one spot higher and one spot lower.

There also is a bresenham line function in the code which I used to test the scanline fill.

More raylib code at :
https://github.com/Pakz001/Raylib-Examples

 

Comments


Sunday, 31 January 2021, 08:46
Pakz
I had just tested the code with larger maps and it starts causing problems with the cache at larger maps(What is up with that in 2021?) I assumed this method had less problems with that but maybe I did something wrong. I had to get back to the method using a list that store the edges.