changeset 5112 | 4e2ebd8ac298 |
parent 5051 | 7b5fa8d3c904 |
child 5543 | 5e597b725316 |
5111:d8856d98ce7d | 5112:4e2ebd8ac298 |
---|---|
33 #include <math.h> |
33 #include <math.h> |
34 |
34 |
35 QImage getAmmoImage(int num) |
35 QImage getAmmoImage(int num) |
36 { |
36 { |
37 static QImage ammo(":Ammos.png"); |
37 static QImage ammo(":Ammos.png"); |
38 int x = floor(num/(ammo.height()/32)); |
38 int x = num/(ammo.height()/32); |
39 int y = (num-((ammo.height()/32)*x))*32; |
39 int y = (num-((ammo.height()/32)*x))*32; |
40 x*=32; |
40 x*=32; |
41 return ammo.copy(x, y, 32, 32); |
41 return ammo.copy(x, y, 32, 32); |
42 } |
42 } |
43 |
43 |