Jump to content
SubSpace Forum Network

Recommended Posts

Posted

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...

  • Replies 219
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted (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 smile.gif

 

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 blum.gif

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 :D

 

 

 

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 smile.gif

 

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

Edited by Drake7707
Posted

wha lots of stuff... sounds interesting, will check later smile.gif thx

 

yeh i wanted to get rid of that black square with transparent pasting... had no idea how.. smile.gif

Posted

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

Posted

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 :D

Posted

I didnt change anything since that build3 fixB file... so you can do stuff safely for now blum.gif then I'll just have to add what I done for FixA and FixB

 

but I like SOS' idea

Posted

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 :blink: :D ?

 

 

And about the hosting hmm maybe ... don't know actually, it changes quite a lot these days blum.gif

DCME_sam3_Drake7707fixes4.zip

Posted (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 blum.gif

 

registering DCME at https://opensvn.csie.org/ ... let's see how that works blum.gif

 

... 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' blum.gif

 

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 bug

1.png

2.png

3.png

DCME___1.1.01.zip

Edited by Samapico
Posted

well actually, i registered DCME there :blink: blum.gif 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 blum.gif otherwise ppl will think it's the compiled version blum.gif

Posted

pmed you.

 

Change log so far (else i forget when i actually have to write it blum.gif )

- 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 blum.gif

- 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 little

This will prolly be edited quite a while blum.gif

 

 

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 blum.gif )

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 :blink: 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 :blink:

DCME1101_Drake7707edit.zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...