--- a/pmc/main.cc
+++ b/pmc/main.cc
@@ -16,6 +16,8 @@
#define MAX 3
+using namespace algebra;
+
int main (int argc, char **argv)
{
Surface *surface;
@@ -45,7 +47,7 @@
d[2] = new Cube (surface, p1, p2, p3, p4, height);
bool running = true;
- int x, y;
+ int i, x, y;
x = y = 0;
@@ -60,7 +62,7 @@
if (event.type == SDL_KEYDOWN) {
surface->setColor (Surface::BLACK);
- for (int i = 0; i < MAX; i++)
+ for (i = 0; i < MAX; i++)
d[i]->show ();
surface->setColor (Surface::RED);
@@ -70,29 +72,29 @@
break;
case SDLK_UP:
- for (int i = 0; i < MAX; i++)
+ for (i = 0; i < MAX; i++)
d[i]->move ((Vector (x, y - STEP)));
break;
case SDLK_DOWN:
- for (int i = 0; i < MAX; i++)
+ for (i = 0; i < MAX; i++)
d[i]->move ((Vector (x, y + STEP)));
break;
case SDLK_LEFT:
- for (int i = 0; i < MAX; i++)
+ for (i = 0; i < MAX; i++)
d[i]->move ((Vector (x - STEP, y)));
break;
case SDLK_RIGHT:
- for (int i = 0; i < MAX; i++)
+ for (i = 0; i < MAX; i++)
d[i]->move ((Vector (x + STEP, y)));
break;
default:
break;
}
- for (int i = 0; i < MAX; i++) {
+ for (i = 0; i < MAX; i++) {
d[i]->show ();
}
@@ -100,7 +102,7 @@
}
}
- for (int i = 0; i < MAX; i++)
+ for (i = 0; i < MAX; i++)
delete d[i];
delete surface;