projects
/
swarmPDK.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix hard-coded screen size; increase number of pixels.
[swarmPDK.git]
/
src
/
Pixel.cpp
diff --git
a/src/Pixel.cpp
b/src/Pixel.cpp
index
5a27aee
..
5bb9ed0
100644
(file)
--- a/
src/Pixel.cpp
+++ b/
src/Pixel.cpp
@@
-3,9
+3,9
@@
#include <GLES/gl.h>
#include "SDL.h"
#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();
this->vx = (rand() / (float)RAND_MAX) * 10.0 - 5.0;
this->vy = (rand() / (float)RAND_MAX) * 10.0 - 5.0;
this->lastupdate = SDL_GetTicks();