From: Jay Freeman (saurik) Date: Thu, 20 Oct 2011 03:13:29 +0000 (+0000) Subject: Support @2x.png if @2x~iphone.png. X-Git-Tag: v0.9.3902~18 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/895006e2139cda492033879692323b4b329b9271?ds=sidebyside Support @2x.png if @2x~iphone.png. --- diff --git a/Library.mm b/Library.mm index e97e739..505851f 100644 --- a/Library.mm +++ b/Library.mm @@ -237,9 +237,6 @@ static unsigned $getScale$(NSString *path) { } static NSArray *$useScale$(NSArray *files, bool use = true) { - if (!use) - return files; - if (Scale_ == 0) { UIScreen *screen([UIScreen mainScreen]); if ([screen respondsToSelector:@selector(scale)]) @@ -254,7 +251,10 @@ static NSArray *$useScale$(NSArray *files, bool use = true) { NSMutableArray *scaled([NSMutableArray arrayWithCapacity:([files count] * 2)]); for (NSString *file in files) { - [scaled addObject:[NSString stringWithFormat:@"%@@2x.%@", [file stringByDeletingPathExtension], [file pathExtension]]]; + if (use && Scale_ == 2) + [scaled addObject:[NSString stringWithFormat:@"%@@2x.%@", [file stringByDeletingPathExtension], [file pathExtension]]]; + if ([file hasSuffix:@"@2x~iphone.png"]) + [scaled addObject:[[file substringWithRange:NSMakeRange(0, [file length] - 11)] stringByAppendingPathExtension:@"png"]]; [scaled addObject:file]; }