Skip to content

Commit 3dd1c96

Browse files
author
Julien Poulton
committed
Merge branch 'fix-sdk' into 'master'
fix(sdk): fixed broken 3.4.0 See merge request codingame/game-engine!195
2 parents 20ff9ec + e004bc1 commit 3dd1c96

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

engine/core/src/main/resources/view/core/Drawer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ export class Drawer {
702702

703703
loader.add('avatar' + index, agent.avatar, {loadType: 2, crossOrigin: true}, function (event) {
704704
agentData.avatar = event.texture
705-
PIXI.Texture.AddToCache(event.texture, '$' + agentData.index)
705+
PIXI.Texture.addToCache(event.texture, '$' + agentData.index)
706706
})
707707
return agentData
708708
})
@@ -816,7 +816,7 @@ export class Drawer {
816816
this.demo.agents.forEach(agent => {
817817
loader.add('avatar' + agent.index, agent.avatar, {loadType: 2, crossOrigin: true}, function (event) {
818818
agent.avatarTexture = event.texture
819-
PIXI.Texture.AddToCache(event.texture, '$' + agent.index)
819+
PIXI.Texture.addToCache(event.texture, '$' + agent.index)
820820
})
821821
})
822822
}
@@ -837,8 +837,8 @@ export class Drawer {
837837
const onComplete = function () {
838838
var key
839839
for (key in resources.images) {
840-
if (resources.images.hasOwnProperty(key)) {
841-
PIXI.Texture.AddToCache(loader.resources[key].texture, key)
840+
if (resources.images.hasOwnProperty(key) && loader.resources[key].texture) {
841+
PIXI.Texture.addToCache(loader.resources[key].texture, key)
842842
}
843843
}
844844
for (key in resources.spines) {

engine/modules/endscreen/src/main/resources/view/endscreen-module/EndScreenModule.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {WIDTH, HEIGHT} from '../core/constants.js'
2-
import {lerp, unlerp} from '../core/utils.js'
3-
import {ErrorLog} from '../core/ErrorLog.js'
4-
import {MissingImageError} from './errors/MissingImageError.js'
1+
import { WIDTH, HEIGHT } from '../core/constants.js'
2+
import { lerp, unlerp } from '../core/utils.js'
3+
import { ErrorLog } from '../core/ErrorLog.js'
4+
import { MissingImageError } from './errors/MissingImageError.js'
55

66
/* global PIXI */
77

@@ -210,8 +210,8 @@ export class EndScreenModule {
210210

211211
let sprite = this.spriteName
212212
var titleRanking
213-
if (PIXI.utils.TextureCache.hasOwnProperty(sprite)) {
214-
titleRanking = new PIXI.Sprite.fromFrame(sprite)
213+
if (PIXI.utils.TextureCache[sprite]) {
214+
titleRanking = PIXI.Sprite.fromFrame(sprite)
215215
} else {
216216
ErrorLog.push(new MissingImageError(sprite))
217217
titleRanking = new PIXI.Sprite(PIXI.Texture.EMPTY)

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {PROPERTIES} from './properties.js'
2-
import {EntityFactory} from './EntityFactory.js'
1+
import { PROPERTIES } from './properties.js'
2+
import { EntityFactory } from './EntityFactory.js'
33
import * as transitions from '../core/transitions.js'
4-
import {assets} from '../assets.js'
4+
import { assets } from '../assets.js'
55

66
/* global PIXI */
77

@@ -98,8 +98,8 @@ export class LoadCommand {
9898
}
9999
}
100100
const dataString = 'data:text/json;charset=UTF-8,' + JSON.stringify(data)
101-
if (!PIXI.utils.TextureCache.hasOwnProperty(dataString + '_image')) {
102-
this.loader.add(dataString, {crossOrigin: true})
101+
if (!PIXI.utils.TextureCache[dataString + '_image']) {
102+
this.loader.add(dataString, { crossOrigin: true })
103103
}
104104
}
105105

@@ -151,7 +151,7 @@ export class PropertiesCommand {
151151

152152
apply (entities, frameInfo) {
153153
let entity = entities.get(this.id)
154-
entity.addState(this.t, {values: this.params, curve: this.curve}, frameInfo.number, frameInfo)
154+
entity.addState(this.t, { values: this.params, curve: this.curve }, frameInfo.number, frameInfo)
155155
}
156156
}
157157
export class WorldCommitCommand {
@@ -162,7 +162,7 @@ export class WorldCommitCommand {
162162
apply (entities, frameInfo) {
163163
entities.forEach(entity => {
164164
this.times.forEach(time => {
165-
entity.addState(time, {values: {}, curve: {}}, frameInfo.number, frameInfo)
165+
entity.addState(time, { values: {}, curve: {} }, frameInfo.number, frameInfo)
166166
})
167167
})
168168
}

playground/misc/misc-3-release-notes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The CodinGame SDK is regularly updated and improved. This document lets you know what changed in the latest releases.
44

5-
## 3.4.0
5+
## 3.4.1
66

77
### 🎁 New features
88

@@ -17,6 +17,10 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
1717

1818
- PIXI updated from v4.4.3 to v4.8.5
1919

20+
## 3.4.0
21+
22+
⛔ Broken version
23+
2024
## 3.3.2
2125

2226
### 🐞 Bug fixes

0 commit comments

Comments
 (0)