Skip to content

Commit 90e960f

Browse files
committed
Merge origin/tmm-dev into tmm-dev
2 parents 66d63b7 + 2f12847 commit 90e960f

File tree

2 files changed

+47
-5
lines changed

2 files changed

+47
-5
lines changed

source/GM-TE/GMTEEditorTileMap.class.st

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ GMTEEditorTileMap >> currentTileChanges: aTileDictionary [
5555

5656
{
5757
#category : #updating,
58-
#'squeak_changestamp' : 'Alex M 7/12/2024 17:16'
58+
#'squeak_changestamp' : 'Valentin Teutschbein 7/12/2024 18:28'
5959
}
6060
GMTEEditorTileMap >> deleteTiles: anIndexSet inLayer: aLayer [
6161
"delete tiles from editable matrix stack at given indices"
@@ -220,13 +220,13 @@ GMTEEditorTileMap >> mouseUp: anEvent [
220220

221221
{
222222
#category : #updating,
223-
#'squeak_changestamp' : 'Alex M 7/12/2024 17:15'
223+
#'squeak_changestamp' : 'Valentin Teutschbein 7/12/2024 18:27'
224224
}
225-
GMTEEditorTileMap >> placeTiles: aCoordinateCollection inLayer: aLayer [
225+
GMTEEditorTileMap >> placeTiles: anIndexSet inLayer: aLayer [
226226
"add currently selected tile (model) to editable matrix stack at given indices"
227-
227+
228228
| tile |
229-
aCoordinateCollection do: [:c |
229+
anIndexSet do: [:c |
230230
self savePreviousImageFromIndex: c inLayer: aLayer.
231231
((self tileMatrixStack layer: aLayer) inBounds: c) ifTrue: [
232232
tile := self tileMatrixStack layer: aLayer at: c y at: c x.

source/GM-TE/GMTETileMap.class.st

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,23 @@ GMTETileMap >> correctedTilePositionMap: aPoint [
296296
^ self correctedTilePosition: aPoint startingOffset: self tileCornerOffsetMap
297297
]
298298

299+
{
300+
#category : #updating,
301+
#'squeak_changestamp' : 'Valentin Teutschbein 7/12/2024 18:32'
302+
}
303+
GMTETileMap >> deleteTiles: anIndexSet inLayer: aLayer [
304+
"delete tiles from editable matrix stack at given indices"
305+
306+
| tile |
307+
anIndexSet do: [:c |
308+
((self tileMatrixStack layer: aLayer) inBounds: c) ifTrue: [
309+
tile := self tileMatrixStack layer: aLayer at: c y at: c x.
310+
tile ifNotNil: [
311+
tile abandon.
312+
self tileMatrixStack layer: aLayer at: c y at: c x put: nil.
313+
self saveNewImageFromIndex: c inLayer: aLayer]]]
314+
]
315+
299316
{
300317
#category : #checking,
301318
#'squeak_changestamp' : 'Ivo Zilkenat 6/24/2024 11:08'
@@ -811,6 +828,31 @@ GMTETileMap >> moveViewBy: aPoint [
811828
self updateMap
812829
]
813830

831+
{
832+
#category : #updating,
833+
#'squeak_changestamp' : 'Valentin Teutschbein 7/12/2024 19:22'
834+
}
835+
GMTETileMap >> placeTiles: anIndexSet inLayer: aLayer ofClass: aTileClass withImage: anImage [
836+
837+
| tile |
838+
self assert: (aTileClass inheritsFrom: GMTETile) description: 'Expected GMTETile or subclass'.
839+
840+
anIndexSet do: [:c |
841+
((self tileMatrixStack layer: aLayer) inBounds: c) ifTrue: [
842+
tile := self tileMatrixStack layer: aLayer at: c y at: c x.
843+
tile ifNil: [tile := self generateTileAtlayer: aLayer x: c x y: c y stack: tileMatrixStack tileType: aTileClass].
844+
tile updateSprite: anImage]]
845+
]
846+
847+
{
848+
#category : #updating,
849+
#'squeak_changestamp' : 'Valentin Teutschbein 7/12/2024 18:58'
850+
}
851+
GMTETileMap >> placeTiles: anIndexSet inLayer: aLayer withImage: anImage [
852+
853+
self placeTiles: anIndexSet inLayer: aLayer ofClass: GMTETile withImage: anImage
854+
]
855+
814856
{
815857
#category : #updating,
816858
#'squeak_changestamp' : 'Ivo Zilkenat 6/24/2024 11:27'

0 commit comments

Comments
 (0)