Sure, but that ternary operator should probably be switched out with another construct (like a switch) for clarity and flexibility.
For example:
// Always init your pointers. CCString* file = NULL; switch (Utils::getArtScaleFactor()) { // Scale factor shouldn't ever be 0, but we should account for it // so it doesn't get picked up by the default case. case 0: case 1: file = CCString::create("randomFile-sd.plist"); break; case 2: file = CCString::create("randomFile-hd.plist"); break; // Scale factors 3 and above get the largest resource. default: file = CCString::create("randomFile-super-hd.plist"); break; }
Yes, this type of logic is on the wiki, except they use if-else for three resource sizes. I've seen it on the forums and tutorials, too.
According to this thread on the cocos2d-iphone forums, yes:
CCSprite can display CCSpriteFrames with different textures. So there’s no problem at all even to use animation that mixes frames from different textures (spritesheets) - Stepan Generalov
The implementations posted there are in obj-c but you can convert the cocos2d api calls to cpp easily.