BASIC

Author Topic: Very fast floodfill  (Read 6481 times)

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Very fast floodfill
« Reply #15 on: 2013-Apr-24 »
Welcome back Brick  :booze:

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Brick Redux

  • Mr. Drawsprite
  • **
  • Posts: 60
    • View Profile
Re: Very fast floodfill
« Reply #16 on: 2013-Apr-25 »
Cheers Lee & keep up the good work.
A mournful owner of a HP HDX18 Laptop that has died...FECK!

Offline Brick Redux

  • Mr. Drawsprite
  • **
  • Posts: 60
    • View Profile
Re: Very fast floodfill
« Reply #17 on: 2013-Jul-28 »
Ive cracked the pattern fill and its very quick.  Its now part of of my Sprite Editor re-write.  Coming soon folks.
A mournful owner of a HP HDX18 Laptop that has died...FECK!

Offline Brick Redux

  • Mr. Drawsprite
  • **
  • Posts: 60
    • View Profile
Re: Very fast floodfill
« Reply #18 on: 2013-Jul-28 »
heey brick! back again uh!

Hope all that mailing cd went ok and that you are all fine!
Welcome again! :good:

Sorry Erico, I never noticed your reply unitl now - tut-tut - Yes, all is good, back coding with this excellent basic.  Post more of your work buddy.
A mournful owner of a HP HDX18 Laptop that has died...FECK!

Offline Brick Redux

  • Mr. Drawsprite
  • **
  • Posts: 60
    • View Profile
Re: Very fast floodfill
« Reply #19 on: 2013-Aug-30 »
In my Sprite Editor I found this way to use a sprite/brush as a pattern fill.

First fill the selected area with the set transparent colour.
Copy the selected area to a virtual screen.
Grab it as a Sprite.
Save the Sprite. (only way to later recognise the transparency)
Draw the Pattern in columns & rows inside the virtual screen.
Load the Sprite and draw it over the Pattern.
Copy back to the main screen.

I dunno how this would work with full screen, but it works like a dream in my editor.

Hope it helps anyone exploring this.
A mournful owner of a HP HDX18 Laptop that has died...FECK!

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4041
    • View Profile
    • Portfolio
Re: Very fast floodfill
« Reply #20 on: 2013-Aug-30 »
Nice it works fine. :good:

There was a discussion about alpha sometime ago based on Ian Price´s game "Aquaventure" (go play it, it is wonderful!).
We all gave a go on sorting the alpha thing, it was really a nightmare.

I wonder if your solution could eventually be used on that case and it is fast enough to keep the game up at good speed.
The thread is here:
http://www.glbasic.com/forum/index.php?topic=8906.0

Makes for a good reading...except for the part I said my game is almost done :-[ I added a lot of stuff to it after that and more then 6 months later I´m still on the same stage! (but the added stuff looks great at least :P)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4041
    • View Profile
    • Portfolio
Re: Very fast floodfill
« Reply #21 on: 2013-Aug-30 »
About your sprite editor, it would wonderful if it also works on the likes of android or even a caanoo.
Since I got a note II I have been looking for productive tools on this front and alas there are none good enough... :(

Grafx2 may work ok but it is really hard to make it work and it dosen´t read the wacom pen on note II on a fine way, so it is actually useless.
I found a few sound/music programs that are more or less ok.
But I can state that android lacks productive tools to the point that if I had time I would code my own tools.

People may not work on phones, but the note II or bigger tablets are well capable to handle fine art and music for retro games.
Heck, when I´m travelling, time would be well spent drawing game assets on them. :(
I can do some of that stuff on my caanoo that the note II can´t handle at all.

I dream of a pixel sprite editor capable of handling animations and onion skin, it would be a dream come true if such appears on mobiles and tablets.

The best tool so far I found for it is Dr. Pepper´s "Cherry Brush"
http://www.drpetter.se/projects.html

Post a peep on your sprite editor when you can, I would like to see it.
Cheers.

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Very fast floodfill
« Reply #22 on: 2013-Aug-30 »
Thanks for bringing my attention back to this routine of mine as I accidentally overwrote my newer version with an older one when I changed computers (along with a few others as well  :D ). Luckily nothing of great importance was lost as most where just experiments & proof of concept type things.

The way I done a pattern fill from what I recall was just SPRITE2MEM the pattern to use as the fill & a little bit of maths to convert the current fill position to the appropriate array position of the pattern, taking into account pattern size & repeating obviously.

When I have finished my current item I will revisit this routine & try to remember how I done it last time. Also started work on gradient fills on the lost version, but only got as far as RGB to HSV conversion with a straight up linear fill I think (angles & radial type etc was the next stage).

Because I have not had a need for a fill routine for quite some time I mainly the reason I forgot all about it  :whip:

Glad you found a solution that works well in your Sprite Ed Brick  :good:

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Brick Redux

  • Mr. Drawsprite
  • **
  • Posts: 60
    • View Profile
Re: Very fast floodfill
« Reply #23 on: 2013-Aug-30 »
About your sprite editor, it would wonderful if it also works on the likes of android or even a caanoo.
Since I got a note II I have been looking for productive tools on this front and alas there are none good enough... :(

Grafx2 may work ok but it is really hard to make it work and it dosen´t read the wacom pen on note II on a fine way, so it is actually useless.
I found a few sound/music programs that are more or less ok.
But I can state that android lacks productive tools to the point that if I had time I would code my own tools.

People may not work on phones, but the note II or bigger tablets are well capable to handle fine art and music for retro games.
Heck, when I´m travelling, time would be well spent drawing game assets on them. :(
I can do some of that stuff on my caanoo that the note II can´t handle at all.

I dream of a pixel sprite editor capable of handling animations and onion skin, it would be a dream come true if such appears on mobiles and tablets.

The best tool so far I found for it is Dr. Pepper´s "Cherry Brush"
http://www.drpetter.se/projects.html

Post a peep on your sprite editor when you can, I would like to see it.
Cheers.

Ok Erico, here you go - a sneek peek at my editor.  The leen eyed will notice no save/load/animate etc icons. Thats because i click the tab under the paintbox from 1 to 2 to display the other icons/options.

A mournful owner of a HP HDX18 Laptop that has died...FECK!

Offline Brick Redux

  • Mr. Drawsprite
  • **
  • Posts: 60
    • View Profile
Re: Very fast floodfill
« Reply #24 on: 2013-Aug-31 »
In the paintbox Ive selected what I call DOT.  You can also see all the nibs / stamps / brushes or what ever you want to call them :)  I added all of them with speed in mind when designing an image - saves messing around having to creating such a thing and then copy it as a brush.

I like GraFX but find the icons along the bottom annoying at times - my younger self still screams at this when reflecting upon DPaint :).
A mournful owner of a HP HDX18 Laptop that has died...FECK!

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4041
    • View Profile
    • Portfolio
Re: Very fast floodfill
« Reply #25 on: 2013-Sep-06 »
Looks awesome! Can´t wait to check it out, speed it up!

While thinking about an editor, I wondered if the brush tool could support pre-made dither as a color.
Like you would have different sets of dither between 2 colors (main and background)possibly controlled by a slider and it would paint that dither.

Just something that sparked on my mind but I hardly think it really necessary.

Cheers!