161 if (weaponCell == nil) { |
161 if (weaponCell == nil) { |
162 weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
162 weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
163 weaponCell.delegate = self; |
163 weaponCell.delegate = self; |
164 } |
164 } |
165 |
165 |
166 int size = 32 * [[UIScreen mainScreen] scale]; |
166 CGFloat theScale = [[UIScreen mainScreen] safeScale]; |
167 int corners = 8 * [[UIScreen mainScreen] scale]; |
167 int size = 32 * theScale; |
168 int x = ((row*size)/(int)(self.ammoStoreImage.size.height * [[UIScreen mainScreen] scale]))*size; |
168 int corners = 8 * theScale; |
169 int y = (row*size)%(int)(self.ammoStoreImage.size.height * [[UIScreen mainScreen] scale]); |
169 int x = ((row*size)/(int)(self.ammoStoreImage.size.height * theScale))*size; |
|
170 int y = (row*size)%(int)(self.ammoStoreImage.size.height * theScale); |
170 |
171 |
171 UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, size, size)] makeRoundCornersOfSize:CGSizeMake(corners, corners)]; |
172 UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, size, size)] makeRoundCornersOfSize:CGSizeMake(corners, corners)]; |
172 weaponCell.weaponIcon.image = img; |
173 weaponCell.weaponIcon.image = img; |
173 weaponCell.weaponName.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(row)]; |
174 weaponCell.weaponName.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(row)]; |
174 weaponCell.tag = row; |
175 weaponCell.tag = row; |