Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing fixes. #1574

Merged
merged 7 commits into from
Apr 21, 2015
Merged

Publishing fixes. #1574

merged 7 commits into from
Apr 21, 2015

Conversation

slembcke
Copy link
Contributor

Two fixes so far:

  1. Added an argument to FCFormatConverter to request mipmap generation when exporting PVR files.
  2. Spritesheets were being generated incorrectly. (Ex: Foo.plist would contain references to Bar-1x.png, Bar-2x.png and Bar-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.

@slembcke
Copy link
Contributor Author

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.

@rkachowski
Copy link
Contributor

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

@slembcke
Copy link
Contributor Author

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.

@slembcke
Copy link
Contributor Author

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.

rkachowski added a commit that referenced this pull request Apr 21, 2015
@rkachowski rkachowski merged commit 3c4db04 into spritebuilder:develop Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants