project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
changeset 3924 2a9ace189288
parent 3829 81db3c85784b
child 3926 668b71f31e51
equal deleted inserted replaced
3923:694e6f6e0e30 3924:2a9ace189288
   213         if (weaponCell == nil) {
   213         if (weaponCell == nil) {
   214             weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
   214             weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
   215             weaponCell.delegate = self;
   215             weaponCell.delegate = self;
   216         }
   216         }
   217 
   217 
   218         int x = ((row*32)/1024)*32;
   218         int x = ((row*32)/(int)self.ammoStoreImage.size.height)*32;
   219         int y = (row*32)%1024;
   219         int y = (row*32)%(int)self.ammoStoreImage.size.height;
   220 
   220 
   221         UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, 32, 32)] makeRoundCornersOfSize:CGSizeMake(7, 7)];
   221         UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, 32, 32)] makeRoundCornersOfSize:CGSizeMake(7, 7)];
   222         weaponCell.weaponIcon.image = img;
   222         weaponCell.weaponIcon.image = img;
   223         weaponCell.weaponName.text = [ammoNames objectAtIndex:row];
   223         weaponCell.weaponName.text = [ammoNames objectAtIndex:row];
   224         weaponCell.tag = row;
   224         weaponCell.tag = row;