X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment0%2Fnbody.c;h=d8153d75503e4907014c366a75205591fe62754b;hb=9c233e7bc17d9d24ad793d2552b3d246094545d3;hp=76c90675cc787e272328b716a377a3f163a426a5;hpb=188f263700258d5b742d914baa25cbd316b64826;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment0/nbody.c b/course/semester2/pprog/assignment0/nbody.c index 76c90675..d8153d75 100644 --- a/course/semester2/pprog/assignment0/nbody.c +++ b/course/semester2/pprog/assignment0/nbody.c @@ -327,9 +327,12 @@ void System_Step(System * system) } + + return; //Check for collisions //Note: Only allows for one collision per step + for (unsigned a = 0; a < system->nMax; ++a) { if ((system->bodies+a)->exists == false || (system->bodies+a)->collided) @@ -351,10 +354,12 @@ void System_Step(System * system) } + /* Reflections if ((system->bodies+a)->x[0] + system->x[0] < 0 || (system->bodies+a)->x[0] + system->x[0] > 640) (system->bodies+a)->v[0] = -(system->bodies+a)->v[0]; if ((system->bodies+a)->x[1] + system->x[1] < 0 || (system->bodies+a)->x[1] + system->x[1] > 480) (system->bodies+a)->v[1] = -(system->bodies+a)->v[1]; + */ } @@ -476,25 +481,6 @@ void System_Draw(System * system) } } -/** - * @function Process_Events - * @purpose Handle any SDL events recieved. - */ -void Process_Events() -{ - SDL_Event event; - while (SDL_PollEvent(&event)) - { - switch(event.type) - { - case SDL_QUIT: - exit(EXIT_SUCCESS); - break; - } - } - //SDL_Delay(1); -} - #endif //_GRAPHICS_H //EOF