]> git.saurik.com Git - winterboard.git/blobdiff - Library.mm
Just in case, simply don't resource theme backupd.
[winterboard.git] / Library.mm
index b902d4a0528f8603393841fb99c3b69984469551..219f4e7633f5516646ecef1dfec0e1cda0abafd6 100644 (file)
@@ -304,25 +304,23 @@ static NSArray *$useScale$(NSArray *files, bool use = true) {
         NSString *base([file stringByDeletingPathExtension]);
         NSString *extension([file pathExtension]);
 
-        if (use) {
-            if (Scale_ != 1) {
-                [scaled addObject:[NSString stringWithFormat:@"%@@%ux~%@.%@", base, Scale_, idiom, extension]];
-                [scaled addObject:[NSString stringWithFormat:@"%@@%ux.%@", base, Scale_, extension]];
-            }
-
-            for (unsigned scale(3); scale >= 2; --scale)
-                if (scale != Scale_) {
-                    [scaled addObject:[NSString stringWithFormat:@"%@@%ux~%@.%@", base, scale, idiom, extension]];
-                    [scaled addObject:[NSString stringWithFormat:@"%@@%ux.%@", base, scale, extension]];
-                }
+#define WBScaleImage(scale) \
+    if (scale == 1) { \
+        [scaled addObject:[NSString stringWithFormat:@"%@~%@.%@", base, idiom, extension]]; \
+        [scaled addObject:file]; \
+    } else { \
+        [scaled addObject:[NSString stringWithFormat:@"%@@%ux~%@.%@", base, scale, idiom, extension]]; \
+        [scaled addObject:[NSString stringWithFormat:@"%@@%ux.%@", base, scale, extension]]; \
+    }
 
-            [scaled addObject:[NSString stringWithFormat:@"%@~%@.%@", base, idiom, extension]];
+        if (use) {
+            WBScaleImage(Scale_);
 
-            // if (!IsWild_) <- support old themes
-            [scaled addObject:file];
+            for (unsigned scale(3); scale >= 1; --scale)
+                if (scale != Scale_)
+                    WBScaleImage(scale);
         } else if ([base hasSuffix: @"@2x"] || [base hasSuffix:@"@3x"]) {
-            [scaled addObject:[NSString stringWithFormat:@"%@~%@.%@", base, idiom, extension]];
-            [scaled addObject:file];
+            WBScaleImage(1);
 
             // 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)]);
@@ -2572,6 +2570,7 @@ MSInitialize {
     // }}}
     // Foundation {{{
     if (true) {
+        if (![identifier isEqualToString:@"com.apple.backupd"]) // XXX: rethink
         MSHookFunction(CFBundleCopyResourceURL, MSHake(CFBundleCopyResourceURL));
     }
     // }}}