Skip to content

Commit

Permalink
Do not remove file ending when generating texture ids
Browse files Browse the repository at this point in the history
  • Loading branch information
sajmoni committed Dec 10, 2021
1 parent 493aaea commit 2ed7ebe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ const extractTextures = (app: App | Application): void => {
)

textureEntries.forEach(([key, texture]) => {
const name = key.slice(0, -4)
textureIds.push(name)
textureIds.push(key)

if (textureMap[name]) {
if (textureMap[key]) {
throw new Error(
`pixi-ex: Duplicate texture name found: ${name}. Texture names need to be unique`,
`pixi-ex: Duplicate texture name found: ${key}. Texture names need to be unique`,
)
} else {
textureMap[name] = texture
textureMap[key] = texture
}
})
}
Expand Down

0 comments on commit 2ed7ebe

Please sign in to comment.