project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m
changeset 5976 306cedbeb213
parent 5662 99083392cd4f
child 6000 dbcebcd3d79f
--- a/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m	Tue Sep 20 23:43:52 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m	Wed Sep 21 02:05:42 2011 +0200
@@ -169,9 +169,10 @@
         [self.view addSubview:button];
         [array addObject:button];
 
-        int x_src = ((i*32)/(int)ammoStoreImage.size.height)*32;
-        int y_src = (i*32)%(int)ammoStoreImage.size.height;
-        UIImage *img = [ammoStoreImage cutAt:CGRectMake(x_src, y_src, 32, 32)];
+        int size = 32*getScreenScale();
+        int x_src = ((i*size)/(int)(ammoStoreImage.size.height*getScreenScale()))*size;
+        int y_src = (i*size)%(int)(ammoStoreImage.size.height*getScreenScale());
+        UIImage *img = [ammoStoreImage cutAt:CGRectMake(x_src, y_src, size, size)];
         [imgs addObject:img];
     }
     [self performSelectorOnMainThread:@selector(setButtonsArray:) withObject:array waitUntilDone:NO];