gluckgames / pixi-packer

Fast and flexible texture packer for PIXI.js
MIT License
40 stars 6 forks source link

Attempt to fix error caused by same sprite found in two spritesheets #6

Closed marekventur closed 9 years ago

marekventur commented 9 years ago
Error: Sprite word_option_button_00018 exists twice in manifest web_retina. Contained groups: game, game

My current theory as to why this is happening is that due to some file system shenigans the order of sprites processed has changed. Since the group hash is based on a sorted list of sprites this will mean the group hash stays the same. It might however change which sprites gets put into which spritesheet, potentially leading to a case where only some spritesheets get reprossesed and certain sprites now being found in two spritesheets.

This fix adds the whole set of sprite paths to the spritesheet hash invalidating them when the collection of sprites on that sheet changes.

Disclaimer: I have so far not been able to replicate this locally, so this fix is an educated guess.

This will change the hash key for all spritesheets, so expect longer build times for the one build after the update.

marekventur commented 9 years ago

@uorbe001 are you happy with this? I could do a shared release together with #4, it would save me the work of having to update all the games twice.

uorbe001 commented 9 years ago

@marekventur just one comment