Samapico Posted February 18, 2006 Report Posted February 18, 2006 Fixed all bugs that I found while moving/pasting selection, and when changing view with zoomIn , zoomOut, or the Hand tool didnt do much testing... so feel free to report any remaining bug EDIT: fixed attachment... forgot to include default.bmp , also fixed last post with build sam3, also forgot to include default.bmp there... sorry for those who downloaded it and got that error at startup... Quote
Samapico Posted February 18, 2006 Report Posted February 18, 2006 Another quick fix... it does not crash when default.bmp is missing, just asks you to find a tileset manually Quote
Drake7707 Posted February 18, 2006 Author Report Posted February 18, 2006 like auto-asking for import a tileset? or rather select the default.bmp on another path, as the latter will include the bmp into the map although you selected the default :/ Quote
»D1st0rt Posted February 19, 2006 Report Posted February 19, 2006 Drake, you might want to set up a site herehttps://opensvn.csie.org/ It's got Subversion and Trac to help manage the project Quote
Drake7707 Posted February 19, 2006 Author Report Posted February 19, 2006 (edited) ok i'll check it out. Sam, i see that you have disabled the auto-switch to dropper when you press the control key. I assume that was for testing purposes for your rectangle and ellipse from cursor in center drawing. ElseIf KeyDown And Shift = 2 And (curtool = t_pencil Or curtool = t_bucket Or curtool = T_line Or curtool = t_spline) Then tempdropping = True toolbeforetempdropping = curtool frmGeneral.SetCurrentTool (t_dropper) Else Enable it again and remove the T_ellipse and the T_rectangle from the elseif statement, so that with every tool the dropper still works, except for the ellipse and rectangle Also use transparentblt when you don't use normal pastingUpdate this in the UpdateSelectionOnPreview If c_selstate = append And (curtool = T_selection Or curtool = T_magnifier) Then If Not parent.clip.pasting Then parent.picempty.Width = parent.shpdraw.Width parent.picempty.Height = parent.shpdraw.Height 'draw an empty space to indicate where the source of the selection 'was, this makes the user think that the tiles are already removed, 'but they are not, this is easier if the selection is stopped 'so we don't have to hold the data of the original source 'in an external array BitBlt parent.picpreview.hdc, (selsourcex - Int(parent.hScr.value / (TileW * parent.magnifier.Zoom))) * (TileW * parent.magnifier.Zoom), (selsourcey - Int(parent.vscr.value / (TileH * parent.magnifier.Zoom))) * (TileH * parent.magnifier.Zoom), parent.shpdraw.Width, parent.shpdraw.Height, parent.picempty.hdc, 0, 0, vbSrcCopy BitBlt parent.picpreview.hdc, parent.shpdraw.Left, parent.shpdraw.Top, parent.shpdraw.Width, parent.shpdraw.Height, parent.piclevel.hdc, (selsourcex - Int(parent.hScr.value / (TileW * parent.magnifier.Zoom))) * (TileW * parent.magnifier.Zoom), (selsourcey - Int(parent.vscr.value / (TileH * parent.magnifier.Zoom))) * (TileH * parent.magnifier.Zoom), vbSrcCopy Else ' USE TRANSPARENTBLT IN ORDER TO REMOVE THE BLACK BACKGROUND ' FROM THE PICPASTE PICTURE If parent.pastetype = p_normal Then BitBlt parent.picpreview.hdc, parent.shpdraw.Left, parent.shpdraw.Top, parent.shpdraw.Width, parent.shpdraw.Height, parent.picclipboard.hdc, 0, 0, vbSrcCopy Else TransparentBlt parent.picpreview.hdc, parent.shpdraw.Left, parent.shpdraw.Top, parent.shpdraw.Width, parent.shpdraw.Height, parent.picclipboard.hdc, 0, 0, RGB(0, 0, 0) End If End If End If(the else statement, i have attached the Transparency module where TranparentBlt is defined in (extract it as it didn't want to attach as bas file)) Btw i've edited the code a bit to speed things up, e.g now it always draws a non-filled ellipse, but when mouse_up it will fill it (so the preview isn't as slow as !@#$%^&*) If ((((i - cx) ^ 2) / a ^ 2) + (((j - cy) ^ 2) / b ^ 2)) <= 1 Then If parent.getTile(i, j) = 0 Or parent.fillshapes Then If Not onpreview Then Call parent.setTile(i, j, parent.tilesetleft, undoch, False) Call parent.UpdateLevelTile(i, j, False) 'Call DrawLine(tilenr, i, j, i, j, undoch, onpreview, False) End If End If End IfNote that i've changed < 1 into <= 1 as sometimes some tiles were missing And with filled rectangles you do waaay to much iterations, as it is a rectangle, just do layers of drawlines Use this:If filled = True Then If startx > endx Then Swap startx, endx End If If starty > endy Then Swap starty, endy End If For j = starty To endy If Not onpreview Then Call DrawLine(tilenr, startx + 1, j, endx - 1, j, undoch, onpreview, False) End If Next End If I've added a button for rotating selections in the toolbar, as some references didn't work anymore (as buttons were called by index instead of by key) i've changed all references to their keys rather than their indexes. So a lot of changes occured in the frmGeneral. I based myself onto DCME_sam3_source (as fixA & B weren't with the source code). I think it may be easier to apply those fixes to this patched up version rather than implement all my changes in your version Edit: i thought about an idea for speeding up the copy-pasting: instead of using the real clipboard, i just copy the selection to be copied to an array, and it just reads from that array when pasting (meaning you can't copy a selection from one DCME to another, also not between maps, but thats just a matter of putting the clipdata to the sharedvar, rather than each array per map). I implemented it, and guess what, the entire map copied and pasted in a matter of seconds Edit2: in the above code put the if not onpreview then OUTSIDE the for next loops, this solves an additional overhead.Also found some minor bugs, such as when shrinking the menu, some labels are still visible, the about was in front of the buttons when you shrink the window, etc)Transparency.zipDCME_sam3_Drake7707fixes3.zip Edited February 19, 2006 by Drake7707 Quote
Samapico Posted February 20, 2006 Report Posted February 20, 2006 wha lots of stuff... sounds interesting, will check later thx yeh i wanted to get rid of that black square with transparent pasting... had no idea how.. Quote
Drake7707 Posted February 20, 2006 Author Report Posted February 20, 2006 it's not my first time i build a map editor with transparency layer, so i already had the Tranparency module laying around somewhere Edit: edited the extra tiles a bit Quote
Samapico Posted February 20, 2006 Report Posted February 20, 2006 About the filled rectangle... I did it that way because I wanted to add that 'filled shapes entirely' thing... so you can cover a whole place with a certain tile, without screwing up existing tiles edit: ... err.. I guess I could make that 'if' statement before... so if this option is selected, check each pixel, else, just do it the fast way.. mhm Quote
Drake7707 Posted February 20, 2006 Author Report Posted February 20, 2006 True, you could use the same options that are already present for the pasting (like under and stuff) Btw you should move the clipdata to the SharedVar, same with the clipdatax and y sizes, so that pasting between maps are possible. The only thing you'll have to change is that it reads and writes from/to SharedVar.clipdata, rather than to write to its own in the class. I should have done it, but considering you already worked out the version with most fixes from me and you combined, i'll wait until you post your current source code, so you don't have to do it over again in the source i still have Quote
»D1st0rt Posted February 21, 2006 Report Posted February 21, 2006 One of the benefits of using some type of source control system Quote
»SOS Posted February 21, 2006 Report Posted February 21, 2006 Indeed. Hmm, hey if you DCME coder guys want to use Subversion then I have a server running on my computer 24/7, I could create a repository there for you if you want... Quote
Samapico Posted February 21, 2006 Report Posted February 21, 2006 I didnt change anything since that build3 fixB file... so you can do stuff safely for now then I'll just have to add what I done for FixA and FixB but I like SOS' idea Quote
»D1st0rt Posted February 21, 2006 Report Posted February 21, 2006 Drake, you might want to set up a site herehttps://opensvn.csie.org/ It's got Subversion and Trac to help manage the project SOS's computer works as well. Quote
»SOS Posted February 21, 2006 Report Posted February 21, 2006 Wow, I never noticed that post on feb 19 Hmm, that opensvn site looks interesting Anyway, Sama and Drake, let me know if you want a repository on my computer. Quote
»D1st0rt Posted February 21, 2006 Report Posted February 21, 2006 I liked it when I was trying it out because of the trac site addon and how everytime I commited it would email me a copy of the project. Having someone else's server host it was a bonus too Quote
Drake7707 Posted February 22, 2006 Author Report Posted February 22, 2006 Well fixed some more bugs, made the pasting so it can be used between different open mapsAdded a new function "Save as SSME compatible", which removes the tiles > 190 (except for 216,217,218, 219 and 220 which are asteroids and stuff which are included in ssme)and cleaned a bit up. Btw why the !@#$%^&* is there a square around the warpholes ? And about the hosting hmm maybe ... don't know actually, it changes quite a lot these days DCME_sam3_Drake7707fixes4.zip Quote
»D1st0rt Posted February 22, 2006 Report Posted February 22, 2006 Do you understand what the hosting is for? Changing a lot is the whole point of getting it. Quote
Samapico Posted February 22, 2006 Report Posted February 22, 2006 (edited) oh the square ... Just cause I had trouble figuring out the borders of a wormhole when tiling a couple of them next to each other... i always ended up deleting the one I just put instead of puting a new one beside... I personnaly prefer it that way registering DCME at https://opensvn.csie.org/ ... let's see how that works ... still waiting for password... edit: bleh... was waiting for nothing... it said 'Project DCME has been registered' ... I thought that meant they were sending me the password... but it meant 'Project DCME has 'already' been registered' so I guess someone already created a project for DCME? or some other weird project was called DCME in the past... anyways... Added what I had done for FixA and FixB to your release... and posted a bugDCME___1.1.01.zip Edited February 22, 2006 by Samapico Quote
Drake7707 Posted February 22, 2006 Author Report Posted February 22, 2006 well actually, i registered DCME there I sent you the password to your hotmail adress And for the bug, i think i know what it is, but i don't have time now to look into it, maybe later Btw you should name the zip DCME1.1.0.1_SOURCE otherwise ppl will think it's the compiled version Quote
Drake7707 Posted February 23, 2006 Author Report Posted February 23, 2006 pmed you. Change log so far (else i forget when i actually have to write it )- Added switch between left & right tile- Added tooltiptext when you select tiles so you see its number (in the tileset)- Added condition: if no data is on the clipboard, don't stopselecting and try to paste nothing- Removed some annoying Msgboxes that say 'You can't use this tool with special tiles'... which is a little obvious ....- Changed menu Replace into Switch/Replace- Changed icon of Text To Map- Added Switch/Replace into the toolbar (and removed the button on the right)- Fixed texttomap when the font is using antialiasing- Fixed texttomap 'pasting', and then magnifying (same problem paste used to have)- Also fixed the !@#$%^&* annoying switching to selection when you zoomed while you had selected something - Undo/Redo didn't work properly with filled ellipse and rectangle, you don't have undo for filled stuff now (until undo is has better performance)- Added version to about- Reverted MouseUp of selection back to sam3_source, because it didn't select special tiles properly anymore- Changed the applyselection a bit to speed it up a littleThis will prolly be edited quite a while Btw the bug you showed is because it just blts to the position of the selection from the picpreview, rather than drawing each pixel over and over again in the selection (which is a fairly large optimalisation), the disadvantage is that the source rectangle (that is covered with black) must be within the picpreview, so once you drag it out it can't be fully copied anymore to the preview. This is not a major problem as it will still function when you apply it, it might only be a little annoying. I could change it but i have different solutions:1) Leave as it is (well the easiest way )2 ) Make it so that the tiles are drawn each by each from the source array rather than one blt (this is some serious slowdown when selecting a huge portion of the map... well i think so, the counterpart in this is that you have to zoom out to select a huge part of the map _and_on_pixel_level_it_can_still_be_copied_from_the_pic1024 picture, which can be done with one blt... )3) Instead of taking the source from the picpreview, i could use picclipboard as a temponary buffer, (also already used in the same way when pasting) and take it from there, but this will create an overhead of copying the source tiles to the clipboard array, only to copy it back....... unless i use the picclipboard only as picture, and don't fill the array, buuuuuuuut this is getting quite complex). Another advantage when using the clip array as holder for the selection you can perform tools onto it, to make it even more complex :s I don't know what would be the best solution :/ Edit: WTF if i enter _and_on_pixel_level_it_can_still_be_copied_from_the_pic1024 without the underscores, i get forbidden and errors when i try to edit. I belive the forum seem to think i'm doing some SQL injection of some kind DCME1101_Drake7707edit.zip Quote
Drake7707 Posted February 23, 2006 Author Report Posted February 23, 2006 edit works now :s wth is going on o_O" anyway delete this post, it's all in the previous Quote
spedhead Posted February 24, 2006 Report Posted February 24, 2006 lol nothing is works the the first 20 times Quote
GENERAL_SLAYER Posted February 24, 2006 Report Posted February 24, 2006 so whats the offical, final, updated, version. lol. (lost) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.