Jump to content
SSForum.net is back!

Drake7707

⛊ Project Moderator
  • Posts

    1309
  • Joined

  • Last visited

Everything posted by Drake7707

  1. so eh .. its been a while so i'd check in here i've tried instead of using setpixel, trying to use DMA for setting pixels on the pixel level map to increase speed ... guess it kinda ... little ... messed up .. tinyyy littleeeeeee things. No really, once i did that and got it working (hooo boy was that a big pain in the !@#$%^&*) i came to the constatation that erhm it was slower..... yes you read that right slower. The actual problem doesn't reside in the setting pixels, but bitblting it to the radar, as this encounters in updatepreview. To put it shortly bitblt needs something from the picturebox that DMA doesn't want to have, so in order to bitblt i need to create that again, bitblt, and then remove it again. Well heck ... slowdown >.> Soooooooooooooooo paintpicture as an alternative for bitblt.... guess what ... same problem. I'll see for further .. errr... 'possibilities' to see if i can do any good to it. If not, i restore it back to setpixel. The problem is that the current version i'm working on has also implemented some fixes that aren't in the last posted version, so unless i fix or restore it, i can't post the slowed down version. note to self: insert lvz coordinate calculator here, in awaiting the actual lvz implementation (yes i know, i steal ideas from other programs and i'm good at it and no you can't prevent me so hah )
  2. why go back in time, besides the nostaglic feeling ? I mean , come on... instead of wasting your time going back to something thats already been done and been surp!@#$%^&*ed, wouldn't it be better if we wrote a new subspace, with new addition, more options and such, maybe even 3D (ppl already done some progress, too bad the project is dropped). Whats the point of going back to the original (can't you just download the original cd and play it that way, maybe with help from dosbox) if you can spend your time improving the current one or start over from scratch. Its been done with continuum, maybe it can be done once again.
  3. visual basic ^^
  4. java is a dumb language anyway ">.> I hoped to learn c/c++ in college rather than java . The more crossplatform it is, the less efficient and its usually a memory hog too.
  5. Thanks I've started cleaning up some code, and !@#$%^&* somehow i finished cleaning up the whole frmGeneral code. It took 2 hours o_O", and thats only about like 1/15th of the total source code. This way the code is much more readable and everything is commented in frmgeneral. The other stuff is for the next time I've attached the current source and executable (that implements the above fixes) DCME1103_srcEdits1.zip DCME1103_Edits1.zip
  6. Heh it has come to my attention that no other map editor has the TTM or PTM functionality as far as i know (only facts did have PTM, but not with the Floyd-Eisenberg Error Diffusion Dithering Algorithm to convert images to monochrome) yay PTM works like this: When you select an image, it first converts this image using the Floyd-Eisenberg algorithm to convert an image to monochrome, then i scan the whole picture, and if it's black then i don't put a tile, else i do put the selected tile, throw that into the selection the same way as TTM and you got yourself a picture in the map. just added an invert option to invert this check, not that it changes much but it might come in handy also fixed an overflow when silly as it seems, fill the map with flags edit: now also fixed the always creating a selection when most zoomed out and you just rightclick, with no intention of creating a selection but just applying a selection Btw did i ever mentioned i passed all my exams i had to do in january
  7. Here's the source code so far, and i don't know how opensvn works either :sDCME1103_src.zip
  8. Hmm im doing some more changes Still fixing some other things, will post new update as soon as im finished tinkering with it Edit: i've attached a sneak preview lvl map of the PTM function , you should check it out TestPTM.zip
  9. yeah i know about the bug, don't really know how to fix it, i think its a rounding problem I've done the descriptions on the tooltips of the tiles I've attached the source and compiled version (this is the latest so far) DCME1102.zip DCME1102_src.zip
  10. edit works now :s wth is going on o_O" anyway delete this post, it's all in the previous
  11. pmed you. Change log so far (else i forget when i actually have to write it ) This 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
  12. 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
  13. Well fixed some more bugs, made the pasting so it can be used between different open maps Added 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
  14. 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
  15. 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
  16. 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 pasting Update 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 If Note 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.zip DCME_sam3_Drake7707fixes3.zip
  17. 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 :/
  18. GAH!
  19. you also need to do a check when you have pasted something, you may not zoom (and i think not any other tool too) until the selection is applied. (For zoom you can use if parent.clipB.pasting then) See for yourself what happens if you zoom after you pasted something, but didn't apply it
  20. no, unless sam implemented that. I didn't do that because i haven't got a clue what ASSS regions and ELVL are And about the cut thing, did you select a large area, cutting or copying a large area is so ineffective it could take hours to copy the full map to the clipboard. Try creating a string dim str as string str = String(1000000, chr(0)) and then replace the parts in the string, like the first 10 chars instead of adding a parts of the string, i know what the problem is, i don't know how to solve it properly. The problem is this: keep in mind that everytime you do s = s + "blahblah" copies the entire string s added with "blahblah" to a new string. So if s becomes very very veerrrrrrrry large, which it will, the copy overhead is so large that the entire program seems to hang. Thats why i'm suggesting allocating the size of the entire string, then replacing parts in it, so it won't have to copy to a new string. I don't know if this is possible at all. I wonder how ssme or any non text or picture related program copies a huge array of stuff in the clipboard.
  21. nice update, didn't know about the restrictions on the special tiles Walltiles should be the next milestone
  22. don't wipe the tiles then, only the objects :/ This is exactly the reason why it would be much easier if selection has it own layer, rather than using a picclipboard, as the data is editable without changing anything to the map until the selection has been applied i should have implemented it that way
  23. why make a form for it ? you can add an icon for rotating selections in the toolbar the job's done
  24. You also copied the -1 tiles, when you rotate to the destination, and searchobject tries to look for the left top of the -1 tiles, but there doesn't exist a left top, thats why you got the error. Change this 'Retile the new selection with corresponding tiles For j = newselstarty To newselendy For i = newselstartx To newselendx 'this if is required to not copy the -1 tiles to the destination ! If tmptile(seltilestartx + (j - newselstarty), seltilestarty + (newselendx - i)) <> -1 Then Call parent.setTile(i, j, tmptile(seltilestartx + (j - newselstarty), seltilestarty + (newselendx - i)), undoch) Call parent.UpdateLevelTile(i, j, False) End If Next Next And rotation will work
  25. well i hope you knew, gonna ask it on visual basic forum again :/ rotating special tiles that are larger than 1x1 are not that easy to rotate, check out flip and mirror carefully. The problem resides in that the special tiles are stored like this: 220 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 The actual number is always left top of the region of the wormhole lets say. If you rotate that, it won't be on the left top anymore, so you have to check, when you encounter a 220, you mustn't rotate it like the rest. Wasn't really that hard you have a menu editor available in visual basic, i believe it was CTRL+E when you select a form edit: bleh... didnt attach the right files at first..... fixed i'll see if i can fix it Edit: i think you attached the wrong source... no ?
×
×
  • Create New...