summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-06-26 17:37:40 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-06-26 17:37:40 +0200
commitfd7869d603f3a7c17ece6b72cc1ae2652fbf5d58 (patch)
tree12598da4299f5c8d881dbefbd311ef21dff486fb /engine
parente22eda6d883a6e3b04be37a11ee63dcd7e01a2c2 (diff)
Use unsigned ints to get rid of warnings in bullet patterns.
Diffstat (limited to 'engine')
-rw-r--r--engine/bulletpattern.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/engine/bulletpattern.cpp b/engine/bulletpattern.cpp
index eabf554..200b374 100644
--- a/engine/bulletpattern.cpp
+++ b/engine/bulletpattern.cpp
@@ -9,8 +9,8 @@ BulletPattern1::BulletPattern1(const Vector2& initpos) {
color_b = 0;
bullets = new Bullet[8*32];
- int k = 0;
- for(int j = 0; j < 8; j++) {
+ unsigned int k = 0;
+ for(unsigned int j = 0; j < 8; j++) {
for(float i = 0; i < M_PI; i += 0.1, k++) {
bullets[k].pos.x = initpos.x + sinf(j % 2 ? M_PI_2 + i : M_PI - i + M_PI_2) * 0.09;
bullets[k].pos.y = initpos.y + cosf(M_PI_2 + i) * 0.1;
@@ -26,7 +26,7 @@ void BulletPattern1::update() {
while(num_bullets < 256 && (unsigned int)(bullets[num_bullets].data) < steps) {
num_bullets++;
}
- for(int i = 0; i < num_bullets; i++) {
+ for(unsigned int i = 0; i < num_bullets; i++) {
bullets[i].pos += bullets[i].dir;
}
}
@@ -38,8 +38,8 @@ BulletPattern2::BulletPattern2(const Vector2& initpos) {
color_b = 1.0;
bullets = new Bullet[24*16];
- int k = 0;
- for(int j = 0; j < 24; j++) {
+ unsigned int k = 0;
+ for(unsigned int j = 0; j < 24; j++) {
for(float i = 0; i < 2 * M_PI; i += 0.4, k++) {
bullets[k].pos = initpos;
bullets[k].dir.x = cosf(i) / 40;
@@ -55,7 +55,7 @@ void BulletPattern2::update() {
while(num_bullets < 384 && (unsigned int)(bullets[num_bullets].data.a) < steps) {
num_bullets++;
}
- for(int i = 0; i < num_bullets; i++) {
+ for(unsigned int i = 0; i < num_bullets; i++) {
float l = bullets[i].data.b - log1pf((steps - bullets[i].data.a));
bullets[i].dir.x = cosf(l) / 500;
bullets[i].dir.y = sinf(l) / 500;
@@ -68,7 +68,7 @@ BulletPattern3::BulletPattern3(const Vector2& initpos) {
color_r = 1;
bullets = new Bullet[512];
- int k = 0;
+ unsigned int k = 0;
for(float i = 0; i < M_PI * 16; i += 0.1) {
bullets[k].pos.x = initpos.x + cosf(i) * 0.05;
@@ -83,7 +83,7 @@ void BulletPattern3::update() {
while(num_bullets < 503 && num_bullets / 2 < steps) {
num_bullets++;
}
- for(int i = 0; i < num_bullets; i++) {
+ for(unsigned int i = 0; i < num_bullets; i++) {
bullets[i].pos += bullets[i].dir;
}
}
@@ -95,8 +95,8 @@ BulletPattern4::BulletPattern4(const Vector2& initpos) {
color_b = 0.0;
bullets = new Bullet[24*16];
- int k = 0;
- for(int j = 0; j < 24; j++) {
+ unsigned int k = 0;
+ for(unsigned int j = 0; j < 24; j++) {
for(float i = 0; i < 2 * M_PI; i += 0.4, k++) {
bullets[k].pos = initpos;
bullets[k].dir.x = cosf(i) * 0.002;
@@ -115,7 +115,7 @@ void BulletPattern4::update() {
Matrix2 m = rotation_matrix(cos(steps * 0.010) * 0.005);
- for(int i = 0; i < num_bullets; i++) {
+ for(unsigned int i = 0; i < num_bullets; i++) {
bullets[i].dir = m * bullets[i].dir;
bullets[i].pos += bullets[i].dir;
}