Skip to content

Commit 7c5f70e

Browse files
author
Valentin Vetter
committed
Revert "feat(Sprite): add scaleMode field"
This reverts commit c4865bc.
1 parent c4865bc commit 7c5f70e

File tree

7 files changed

+6
-39
lines changed

7 files changed

+6
-39
lines changed

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/ScaleMode.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/Serializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class Serializer {
7272
keys.put("tileY", "ty");
7373
keys.put("tileScaleX", "tsx");
7474
keys.put("tileScaleY", "tsy");
75-
keys.put("scaleMode", "sm");
7675

7776
commands = new HashMap<>();
7877
commands.put("CREATE", "C");

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/SpriteBasedEntity.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public abstract class SpriteBasedEntity<T extends SpriteBasedEntity<?>> extends
88

99
private String image;
1010
private Integer baseWidth, baseHeight;
11-
private ScaleMode scaleMode = ScaleMode.LINEAR;
1211

1312
/**
1413
* Sets the image for this <code>Sprite</code>.
@@ -85,28 +84,4 @@ public Integer getBaseHeight() {
8584
return baseHeight;
8685
}
8786

88-
/**
89-
* Sets the scale mode of this <code>TextureBasedEntity</code>.
90-
*
91-
* @param scaleMode
92-
* the scale mode of this <code>TextureBasedEntity</code>.
93-
* @return this <code>TextureBasedEntity</code>.
94-
*/
95-
public T setScaleMode(ScaleMode scaleMode) {
96-
this.scaleMode = scaleMode;
97-
set("scaleMode", scaleMode);
98-
return self();
99-
}
100-
101-
/**
102-
* Returns the scale mode of this <code>TextureBasedEntity</code>.
103-
* <p>
104-
* Default is LINEAR.
105-
*
106-
* @return the scale mode of this <code>TextureBasedEntity</code>.
107-
*/
108-
public ScaleMode getScaleMode() {
109-
return scaleMode;
110-
}
111-
11287
}

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/TextureBasedEntity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
/**
44
* Any PIXI Entity based on a texture shares the properties found in this <code>TextureBasedEntity</code>.
55
*
6-
* @param <T>
7-
* a subclass inheriting Entity, used in order to return <b>this</b> as a T instead of a <code>TextureBasedEntity</code>.
6+
* @param <T> a subclass inheriting Entity, used in order to return <b>this</b> as a T instead of a <code>TextureBasedEntity</code>.
87
*/
98
public abstract class TextureBasedEntity<T extends BlendableEntity<?>> extends BlendableEntity<T> {
109

10+
1111
private double anchorX = 0, anchorY = 0;
1212
private int tint = 0xFFFFFF;
1313

1414
TextureBasedEntity() {
1515
super();
1616
}
1717

18+
19+
1820
/**
1921
* Sets both the X and Y anchors of this <code>TextureBasedEntity</code> as a percentage of its width and height.
2022
* <p>

engine/modules/entities/src/main/resources/view/entity-module/Command.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ const PROPERTY_KEY_MAP = {
4747
tx: 'tileX',
4848
ty: 'tileY',
4949
tsx: 'tileScaleX',
50-
tsy: 'tileScaleY',
51-
sm: 'scaleMode'
50+
tsy: 'tileScaleY'
5251
}
5352

5453
export class CreateCommand {

engine/modules/entities/src/main/resources/view/entity-module/SpriteBasedEntity.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export class SpriteBasedEntity extends TextureBasedEntity {
1010
Object.assign(this.defaultState, {
1111
image: null,
1212
baseWidth: null,
13-
baseHeight: null,
14-
scaleMode: 'LINEAR'
13+
baseHeight: null
1514
})
1615
this.missingTextures = {}
1716
}
@@ -25,7 +24,6 @@ export class SpriteBasedEntity extends TextureBasedEntity {
2524
} else {
2625
this.graphics.texture = PIXI.Texture.EMPTY
2726
}
28-
this.graphics.texture.baseTexture.scaleMode = PIXI.SCALE_MODES[state.scaleMode]
2927
} catch (error) {
3028
if (!this.missingTextures[state.image]) {
3129
this.missingTextures[state.image] = true

engine/modules/entities/src/main/resources/view/entity-module/properties.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const PROPERTIES = {
7676
baseHeight: constOpts,
7777
image: stringOpts,
7878
images: stringOpts,
79-
scaleMode: stringOpts,
8079
restarted: {
8180
type: String,
8281
convert (value, globalData, frameInfo, t) {

0 commit comments

Comments
 (0)