Fix hard-coded screen size; increase number of pixels.
[swarmPDK.git] / src / Pixel.cpp
index 5a27aee..5bb9ed0 100644 (file)
@@ -3,9 +3,9 @@
 #include <GLES/gl.h>
 #include "SDL.h"
 
-Pixel::Pixel(void) {
-       this->x = (rand() / (float)RAND_MAX) * 320.0;
-       this->y = (rand() / (float)RAND_MAX) * 400.0;
+Pixel::Pixel(SDL_Surface* screen) {
+       this->x = (rand() / (float)RAND_MAX) * screen->w;
+       this->y = (rand() / (float)RAND_MAX) * screen->h;
        this->vx = (rand() / (float)RAND_MAX) * 10.0 - 5.0;
        this->vy = (rand() / (float)RAND_MAX) * 10.0 - 5.0;
        this->lastupdate = SDL_GetTicks();