X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=src%2FPixel.cpp;fp=src%2FPixel.cpp;h=5bb9ed09c005eb88d401094ce7716bc4e144f9ab;hb=ed537b5851e68c5730dab4c0d93421a66e6726e1;hp=5a27aeef2e72d568989dc4581ace5dc08db63afb;hpb=bdad36145ef42f2a44b58cc544846b4b34a6ca4f;p=swarmPDK.git diff --git a/src/Pixel.cpp b/src/Pixel.cpp index 5a27aee..5bb9ed0 100644 --- a/src/Pixel.cpp +++ b/src/Pixel.cpp @@ -3,9 +3,9 @@ #include #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();