Open LearnCocos2D opened 10 years ago
Note: it does not crash in release builds, instead references to the image are replaced by "Missing Texture" spriteframes.
Nevertheless this is hazardous. Consider a simple, late-project "folder restructuring" only to find out you are forced to undo all changes (if you can remember them) or re-assign each sprite's image ... ouch!
Also consider developers not caring for or knowing about spritesheets initially, and later in the project creating a spritesheet and adding existing images to it. This poses the same problem, having to re-assign each image after creating the smart spritesheet folder.
+1 for this issue. In particular, I wanted to combine two small spritesheets into a single sheet. Moving the files broke references in a way that wasn't very easy to figure out. Once in cocos2d, it reported missing textures, but it didn't say what CCB file contained the missing texture, so fixing it by hand was difficult.
I guess the only fix for this is associating GUIDs with each asset, and making sure files that are moved or renamed keep the same GUID. That's a somewhat big change with its own set of drawbacks.
Very easy to reproduce:
Notes:
log:
Refers to:
NSAssert(path != nil, @"TextureCache: fileimage MUST not be nil");
call stack: