From b6ba286971e86e4d5cc65de2e1c648532791fc29 Mon Sep 17 00:00:00 2001 From: Ole Morud Date: Wed, 8 Jun 2022 17:17:22 +0200 Subject: [PATCH] config refactor pt.2 --- physics.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/physics.c b/physics.c index b2dcb05..4d69bbf 100644 --- a/physics.c +++ b/physics.c @@ -1,12 +1,10 @@ #include -#include "graphics.h" #include #include #include - -#define FRAMERATE 60 -#define GRAVITY 0.001f +#include "graphics.h" +#include "config.h" /* * Points store position, position in previous frame and forces @@ -42,8 +40,8 @@ void update_point(Point* p); * Main */ int main(){ - char *data = malloc(40*40); - Canvas cnv = {40, 40, data}; + char *data = malloc(WIDTH*HEIGHT); + Canvas cnv = {WIDTH, HEIGHT, data}; // Add 4 points, link them, and add points and links to respective arrays Point a = { 10.0, 10.0, @@ -139,5 +137,7 @@ void update_point(Point* p){ void update_link(Link* l){ double cur_dist = distance(l->a, l->b); double delta = l->length - cur_dist; + } +