Closed slembcke closed 9 years ago
Bah. Spritesheets no longer pack at exactly the same sizes. Seems as though there were some tests with hardcoded sizes in them. Will look into it more tomorrow morning.
I'll look through this, but I'm also not totally familiar with the publishing code.
It seems like there are a lot of dead paths through the code here that never actually happen.
You are almost certainly right, feel free to remove as much as you can
A little more information about what I changed for the spritesheet fix. Say you were making a spritesheet out of this directory:
Sprites/
foo.png
bar.png
It would first rescale the images and output them into the old directory structure in a temporary location:
SomeTempFolder/
Sprites/ (Not sure what this dir was for...)
Sprites-phone/
foor.png
bar.png
Sprites-... (same for the -tablet, -tablethd directories)
Then it would make spritesheets out of the -phone, -tablet, etc directories and output them to their final location. Because of the change from directories to suffixes, this was happening:
SomeTempFolder/
Sprites/
foor-1x.png
bar-1x.png
foor-2x.png
bar-2x.png
foor-4x.png
bar-4x.png
Sprites-1x/ (these were all empty)
Sprites-2x/
Sprites-4x/
The weird thing is that before, spritesheets would be made from both the files in Sprites
and Sprites-phone
(or -tablet, etc). AFAIK, the untagged directory would be empty. So it would generate sprite sheets with all of the resolutions in a single sprite sheet. The names were also added to the .plist file with the suffixes on them, so Cocos2D couldn't find them.
What I changed was to make it grab all of the (for example) -4x images, strip their resolution tags and build a spritesheet out of them. That's why I'm not terribly happy with the change, it's a little roundabout. Most of the filesystem work the conversion and spritesheet methods are doing seems unnecessary now. This could all be vastly simplified for v2, but it would probably be a lot of work.
Added a temporary fix that outputs a partial metadata file with just the filename aliases in in when outputting fileLookup.plist. Cocos2D no longer needs the fileLookup.plist file. There are a bunch of SB tests around it though. That needs to get cleaned up at some point.
Two fixes so far:
Foo.plist
would contain references toBar-1x.png
,Bar-2x.png
andBar-4x.png
) I'm not very certain that my fix for this is correct. It seems like there are a lot of dead paths through the code here that never actually happen.Will see how far I can get with the metadata generation tomorrow. It's preventing PVR and JPEG files from loading since there is no filename aliasing data exported yet.
@rkachowski and/or @vlidholt If you can review ASAP, that would be helpful. I'm don't know the publishing code very well.