Removed unused contain() function.

This commit is contained in:
Sheldon Lee 2020-06-18 23:34:48 +01:00
parent 59f7bfa061
commit 36cbc3ae6b

14
main.c
View File

@ -6,9 +6,6 @@
#include "grid.h"
#include "vect.h"
static void contain(int* pos, int* velocity, int min, int max);
int main()
{
// init
@ -63,14 +60,3 @@ int main()
return 0;
}
static void contain(int* pos, int* velocity, int min, int max)
{
bool above_max = max < *pos;
bool below_min = *pos < min;
bool not_in_range = below_min || above_max;
if (not_in_range) {
if (below_min) *pos = min;
else if (above_max) *pos = max;
*velocity *= -1;
}
}