config refactor pt.2

This commit is contained in:
Ole Morud
2022-06-08 17:17:22 +02:00
parent c425e2b5b7
commit b6ba286971

View File

@@ -1,12 +1,10 @@
#include <unistd.h> #include <unistd.h>
#include "graphics.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "graphics.h"
#define FRAMERATE 60 #include "config.h"
#define GRAVITY 0.001f
/* /*
* Points store position, position in previous frame and forces * Points store position, position in previous frame and forces
@@ -42,8 +40,8 @@ void update_point(Point* p);
* Main * Main
*/ */
int main(){ int main(){
char *data = malloc(40*40); char *data = malloc(WIDTH*HEIGHT);
Canvas cnv = {40, 40, data}; Canvas cnv = {WIDTH, HEIGHT, data};
// Add 4 points, link them, and add points and links to respective arrays // Add 4 points, link them, and add points and links to respective arrays
Point a = { 10.0, 10.0, Point a = { 10.0, 10.0,
@@ -140,4 +138,6 @@ void update_link(Link* l){
double cur_dist = distance(l->a, l->b); double cur_dist = distance(l->a, l->b);
double delta = l->length - cur_dist; double delta = l->length - cur_dist;
} }