Quantcast

Page 7 of 7 FirstFirst ... 34567
Results 91 to 97 of 97

Thread: Tile and Sprite editor for Genesis/Megadrive

  1. #91
    Wildside Expert Archer's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands, The Hague
    Posts
    206
    Rep Power
    10

    Default

    A status update (more like a bug report)

    I have changed the Color picker window, and now it has two functional buttons "Apply" and "Cancel" that work like you would expect. I still have a small memory leak, every time you open the color picker memory usage increases 0.1 MB (FIXED)

    I noticed a bug in the Flood-Fill routine. When the fill goes over the edge of the editor, it also fills the opposite side with the new color.

    Still thinking about how to implement line/rectangle drawing preview without changing the buffer. I was thinking about saving the start and endpoint, when the endpoint changes draw a "line/rectangle" with colors from the buffer to erase the old preview. Than redraw the preview without saving in the buffer. It might flicker a bit, but i think it should work.


    EDIT-1: I fixed the memory leak in the color picker, it was something with GtkBuilder. Memory now stays stable between 1.9 MB and 2.0 MB on my system. I still need to fix a few things before i can release a new version.

    EDIT-2: I think i have a solution for my line/rectangle preview "problem". I will rewrite the editor to use "layers". One layer for preview's, second layer for undo/redo, and third layer is the stored image. The combined layers represent the image you see in the editor. When saving the preview layer is not used. And also in a small "preview" window the "preview-layer" is not shown.

    EDIT-3: My solution for preview and undo looks promising, it is kind of working already

    EDIT-4: I now have a working undo function for the last draw action, but it's not perfect yet and needs a lot more tuning.

    EDIT-5: Line drawing now works It get's a bit slow when the editor is too large (in pixels) but it still works, I will do rectangles next. I think i will post this version somewhere today. By implementing undo, i broke the save and load functions. When they work again and rectangle drawing works i will post it.
    Last edited by Archer; 06-12-2011 at 04:09 AM.
    Learning the genesis one bit at a time

  2. #92
    Wildside Expert Archer's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands, The Hague
    Posts
    206
    Rep Power
    10

    Default

    I am not sure it's stable, but that's why it's still an alpha version right

    New features:
    - Color Picker has "Cancel" and "Apply" buttons
    - Palette menu (color mode: Shadow, Highlight, Normal) (default palette reset)
    - Disabled menu options that are not working yet
    - commandline options are now optional, and help is displayed if incorrect options are given
    - Functional Toolbox (options not implemented are disabled)
    - Pixel drawing (not really new, but now you can HAVE TO switch too it from the toolbox)
    - Line drawing
    - Rectangle drawing
    - Flood fill
    - Fixed a few memory leaks
    - Undo last draw action (pixel draw, holding mouse button counts as one action)

    I have not tested exporting, but i am pretty sure it's broken in this version. Focus is on the new features. I did test saving and loading and they are working, saving resets the undo level to zero. Meaning you can't undo something you draw before you saved.

    This is the Linux only version

    To show windows and MacOS users that it's working, i included a screenshot of some random drawings i made showing rectangles, lines and flood filled parts.

    EDIT-1: First step of the rewrite is complete, all names including "vdp" have been renamed. Now i will cleanup the editor_buffer to make line drawing a bit faster.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Archer; 06-12-2011 at 11:01 AM.
    Learning the genesis one bit at a time

  3. #93
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    78

    Default

    Wow! Great job! Seems to be working nicely - it doesn't blow up when you don't give the sizes, the color picker has working buttons, the command buttons select the drawing commands which seem to work well in my quick tests... so far so good!

    EDIT: Hey, how about sprite rotation? That would be handy, especially on sprites larger than one tile. You might want to check the wikipedia page:

    http://en.wikipedia.org/wiki/Pixel_a...thms#RotSprite

    EDIT 2: Actually, scaling would be nice, too. Just read that whole page.

    EDIT 3: Here's a link to the explanation of RotSprite:

    http://forums.sonicretro.org/index.p...dpost&p=159754
    Last edited by Chilly Willy; 06-13-2011 at 01:41 AM.

  4. #94
    Wildside Expert Archer's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands, The Hague
    Posts
    206
    Rep Power
    10

    Default

    Quote Originally Posted by Chilly Willy View Post
    Wow! Great job! Seems to be working nicely - it doesn't blow up when you don't give the sizes, the color picker has working buttons, the command buttons select the drawing commands which seem to work well in my quick tests... so far so good!
    Thanks, it is working better but there are a few bugs left. Just try "-s 28" and you will see a corrupted part at the bottom, if you draw into the corrupted area it will crash.

    Quote Originally Posted by Chilly Willy
    EDIT: Hey, how about sprite rotation? That would be handy, especially on sprites larger than one tile. You might want to check the wikipedia page:

    http://en.wikipedia.org/wiki/Pixel_a...thms#RotSprite

    EDIT 2: Actually, scaling would be nice, too. Just read that whole page.

    EDIT 3: Here's a link to the explanation of RotSprite:

    http://forums.sonicretro.org/index.p...dpost&p=159754
    At first i thought, why would that be usefull. But seeing the examples at sonicretro makes it al clear I have read those pages, but the explanation is very vague to me. I downloaded the program, but there is no source code. Without example code i can not include RotSprite, sorry. I think i can do 90 degree rotation though, and mirror too.

    I will now focus on importing sprites from images. I have example code for libpng, but stating with a fixed format BMP image to import from is easier. I made an extremely small BMP viewer in dos a few years ago, if i remember correctly it was less than 1KB.
    Learning the genesis one bit at a time

  5. #95
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    78

    Default

    The basic gist of RotSprite is he does a good quality expansion on the sprite to 8x, then he does the "standard" nearest-neighbor rotate, then scales it according to what the user specified... by 1/8th if the user wanted no scaling, 1/4th if the user wanted 2x, etc. I'll see if I can locate some example code for the rotating.

    As for loading images, I recommend stb_image.c. It can be found here along with a lot of other good stuff. It's PD so you don't have to worry about any license issues. I use stb_image.c on my N64 stuff at the moment.

    EDIT: You can find threads on Sean's stb_ stuff here along with a LOT of other good PD code. Looks like there will be an update to stb_image.c in the next day or two with some bug fixes.
    Last edited by Chilly Willy; 06-13-2011 at 06:00 AM.

  6. #96
    Wildside Expert Archer's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands, The Hague
    Posts
    206
    Rep Power
    10

    Default

    I had very little time last week, so not much happen on gentile. But i have a very simple BMP import function working now. it makes a lot of assumptions, does no checking at all. Expects 24bit per pixel no alpha no padding. Colors are converted on the fly like this ((8.0 / 255) * fgetc(fh)); for each component. Each new color is added to a temporary palette, the palette is searched for doubles first.

    To make this visible i made more assumptions, that there are no more than 16 unique colors after conversion. The editor buffer and palette are filled with the converted values. Here is a screenshot of the result:


    In case you are wondering what this is, it's a tile from supertux that makes up the ice below the snow. The colors are reduced to only 11 unique colors in the gentile image.
    Learning the genesis one bit at a time

  7. #97
    Sports Talker theelf's Avatar
    Join Date
    Apr 2010
    Posts
    37
    Rep Power
    0

    Default

    I use windows, but i'm really looking forward to test this editor

    For now, im using Paint Shop Pro + picture with all MD palette, it works, but slow

    Thanks for your work

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •