+ NSString *base([file stringByDeletingPathExtension]);
+ NSString *extension([file pathExtension]);
+
+ if (use) {
+ if (Scale_ == 2) {
+ [scaled addObject:[NSString stringWithFormat:@"%@@2x~%@.%@", base, idiom, extension]];
+ if (!IsWild_)
+ [scaled addObject:[NSString stringWithFormat:@"%@@2x.%@", base, extension]];
+ }
+
+ [scaled addObject:[NSString stringWithFormat:@"%@~%@.%@", base, idiom, extension]];
+
+ // if (!IsWild_) <- support old themes
+ [scaled addObject:file];
+ } else if ([base hasSuffix: @"@2x"]) {
+ [scaled addObject:[NSString stringWithFormat:@"%@~iphone.%@", base, extension]];
+ [scaled addObject:file];
+
+ // XXX: this actually can't be used, as the person loading the file doesn't realize that the @2x changed
+ /*NSString *rest([base substringWithRange:NSMakeRange(0, [base length] - 3)]);
+ [scaled addObject:[NSString stringWithFormat:@"%@~iphone.%@", rest, extension]];
+ [scaled addObject:[rest stringByAppendingPathExtension:extension]];*/
+ } else {
+ // XXX: this code isn't really complete
+
+ [scaled addObject:file];
+
+ if ([base hasSuffix:@"~iphone"])
+ [scaled addObject:[[base substringWithRange:NSMakeRange(0, [base length] - 7)] stringByAppendingPathExtension:extension]];
+ }