Skip to content

Commit

Permalink
Merge origin/tmm-dev into tmm-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
RedToxyl committed Jun 23, 2024
2 parents 8247c34 + 85abb76 commit bf2ace9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 33 deletions.
10 changes: 5 additions & 5 deletions source/GM-TE/GMTETileMatrixLayer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ GMTETileMatrixLayer >> aboveLayer: aLayer [

{
#category : #adding,
#'squeak_changestamp' : 'jj 6/22/2024 16:23'
#'squeak_changestamp' : 'TW 6/23/2024 20:38'
}
GMTETileMatrixLayer >> addTile: aTile at: x at: y [
GMTETileMatrixLayer >> addTile: aTile at: y at: x [

aTile ifNotNil: [
aTile morphicLayerNumber: self layerIdx.
aTile visible: self visible].
^ self at: x at: y put: aTile
^ self at: y at: x put: aTile
]

{
Expand Down Expand Up @@ -72,7 +72,7 @@ GMTETileMatrixLayer >> belowLayer: aLayer [

{
#category : #accessing,
#'squeak_changestamp' : 'TW 6/23/2024 19:53'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:47'
}
GMTETileMatrixLayer >> displayName [

Expand All @@ -81,7 +81,7 @@ GMTETileMatrixLayer >> displayName [

{
#category : #accessing,
#'squeak_changestamp' : 'TW 6/23/2024 19:53'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:54'
}
GMTETileMatrixLayer >> displayName: anObject [

Expand Down
64 changes: 37 additions & 27 deletions source/GM-TE/GMTETileMatrixStack.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,18 @@ GMTETileMatrixStack class >> morphicLayerOffsetDefault [
^ 100
]

{
#category : #accessing,
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 20:23'
}
GMTETileMatrixStack >> basicVisible: aBool [

visible := aBool
]

{
#category : #updating,
#'squeak_changestamp' : 'jj 6/22/2024 16:28'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 20:19'
}
GMTETileMatrixStack >> blendLayer: anIdx1 with: anIdx2 [

Expand All @@ -75,14 +84,15 @@ GMTETileMatrixStack >> blendLayer: anIdx1 with: anIdx2 [
topIdx := anIdx1.
bottomIdx := anIdx2].

1 to: bottomLayer columnCount do: [ :x |
1 to: bottomLayer rowCount do: [ :y |
bottomCell := bottomLayer at: x at: y.
topCell := topLayer at: x at: y.
1 to: bottomLayer columnCount do: [:x |
1 to: bottomLayer rowCount do: [:y |
bottomCell := bottomLayer at: y at: x.
topCell := topLayer at: y at: x.
bottomCell
ifNil: [
newCellEntry := topCell.
bottomLayer addTile: newCellEntry at: x at: y]
newCellEntry := topCell veryDeepCopy.
topCell ifNotNil: [topCell owner addMorph: newCellEntry].
bottomLayer addTile: newCellEntry at: y at: x]
ifNotNil: [
newCellEntry := bottomCell asBlendedWithImageMorph: topCell.
bottomCell updateSprite: newCellEntry image]]].
Expand All @@ -108,31 +118,31 @@ GMTETileMatrixStack >> blendLayers: aSet [

{
#category : #eumerating,
#'squeak_changestamp' : 'Valentin Teutschbein 6/7/2024 21:50'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:53'
}
GMTETileMatrixStack >> doLayers: aBlock [

self matrixLayers do: [ :layer | aBlock value: layer]
self matrixLayers do: [:layer | aBlock value: layer]
]

{
#category : #eumerating,
#'squeak_changestamp' : 'Valentin Teutschbein 6/7/2024 21:50'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:53'
}
GMTETileMatrixStack >> doTiles: aBlock [

self doLayers: [ :layer | layer doTiles: aBlock]
self doLayers: [:layer | layer doTiles: aBlock]
]

{
#category : #eumerating,
#'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 15:28'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:53'
}
GMTETileMatrixStack >> doTilesXYLidx: aBlock [

1 to: self width do: [ :x |
1 to: self height do: [ :y |
1 to: self layerCount do: [ :layerIdx |
1 to: self width do: [:x |
1 to: self height do: [:y |
1 to: self layerCount do: [:layerIdx |
aBlock value: x value: y value: layerIdx]]]
]

Expand Down Expand Up @@ -197,20 +207,20 @@ GMTETileMatrixStack >> layer: aLayerIdx [

{
#category : #accessing,
#'squeak_changestamp' : 'jj 6/22/2024 16:29'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:58'
}
GMTETileMatrixStack >> layer: aLayerIdx at: x at: y [
GMTETileMatrixStack >> layer: aLayerIdx at: y at: x [

^ (self matrixLayers at: aLayerIdx) at: x at: y
^ (self matrixLayers at: aLayerIdx) at: y at: x
]

{
#category : #accessing,
#'squeak_changestamp' : 'jj 6/22/2024 16:29'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:58'
}
GMTETileMatrixStack >> layer: aLayerIdx at: x at: y put: aTile [
GMTETileMatrixStack >> layer: aLayerIdx at: y at: x put: aTile [

^ (self matrixLayers at: aLayerIdx) addTile: aTile at: x at: y
^ (self matrixLayers at: aLayerIdx) addTile: aTile at: y at: x
]

{
Expand All @@ -232,7 +242,7 @@ GMTETileMatrixStack >> layerNameOf: anIdx [
]

{
#category : #accessing,
#category : #checking,
#'squeak_changestamp' : 'jj 6/22/2024 16:29'
}
GMTETileMatrixStack >> layerVisible: anIdx [
Expand All @@ -242,14 +252,14 @@ GMTETileMatrixStack >> layerVisible: anIdx [

{
#category : #'multiselect-helpers',
#'squeak_changestamp' : 'jj 6/22/2024 16:29'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:54'
}
GMTETileMatrixStack >> mapLayers: anOrderedCollection withUnaryBlock: aBlock [

| tmpResult |
tmpResult := OrderedCollection new.

anOrderedCollection do: [ :layerIdx |
anOrderedCollection do: [:layerIdx |
tmpResult add: (aBlock value: layerIdx)].

^ tmpResult
Expand Down Expand Up @@ -495,12 +505,12 @@ GMTETileMatrixStack >> visible [

{
#category : #accessing,
#'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 23:10'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 20:23'
}
GMTETileMatrixStack >> visible: aBool [

visible := aBool.

self basicVisible: aBool.
self doLayers: [ :aLayer |
aLayer visible: aBool]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ as yet unclassified
setUp

self editor ifNil: [self editor: GMTEEditor new].
self fileUUID: nil
self fileUUID: UUID new asString
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"fileUUID:" : "jj 6/22/2024 16:55",
"loadTestMapFileToFileDirectory" : "JS 6/23/2024 18:18",
"setUp" : "jj 6/23/2024 18:55",
"setup" : "TW 6/23/2024 20:38",
"tearDown" : "jj 6/22/2024 20:24",
"testAddLayerButton" : "TW 6/23/2024 20:08",
"testDeleteLayer" : "jj 6/22/2024 20:25",
Expand Down

0 comments on commit bf2ace9

Please sign in to comment.