0

I'm having issues with -hd suffixed files in Cocos2d. My SD tilesize is 52x52 with a map that's 6 wide x 9 high, and the HD tilesize is 104x104. Everything's resized appropriately, and I have both SD and HD versions of both my TMX map and my tileset.

In the Retina simulator, everything works fine, despite getting the following nonsensical lines in the log:

Filename(sprites-hd.PNG) contains -hd suffix. Removing it. See cocos2d issue #1040
cocos2d: CCFileUtils: Warning HD file not found: sprites-hd.PNG

But on the device, it does what you'd expect given the errors, and uses the original SD file which looks awful and messes up collision detection. It also generates no #1040 errors on the TMX file, and I suspect it's never using the -hd TMX file at all; when I removed it, I never saw a line warning me that it was missing.

What's going on here, and how do I fix it?

Tinstar
  • 175
  • 12
  • look in your you name-hd.tmx file and check if – zeiteisen Jul 09 '12 at 10:44
  • Fixed it! For anyone with the same error, don't give your spritesheet a -hd suffix; just use something else to distinguish it from your sd sprites (spriteshd.PNG without the hyphen does fine), and reference the hd sheet as normal in your -hd TMX file. – Tinstar Jul 09 '12 at 19:58
  • Since you mention "sprites-hd.PNG" as being the filename the issue could simply be that the file is actually named "sprites-hd.png" (all lowercase). The Simulator will load it just fine, because it uses your Mac's case-insensitive file system to find the file. But an iOS device will fail to find the file because iOS uses a case-sensitive file system. In any case, the warning is only related to the issue of caching the same image multiple times, which cocos2d fixes (and really it shouldn't mention that in the log). See: http://tinyurl.com/6md4nl8 – CodeSmile Jul 10 '12 at 13:38
  • I had the case-sensitive issue earlier on - it persisted after I fixed the .PNG in the TMX sheet, so unfortunately that wasn't the solution. I'm still not sure why the -hd sprites didn't work, but giving them a different name in the -hd TMX file did. A little hackish, but it's a fix. – Tinstar Jul 12 '12 at 05:46

0 Answers0