From 7f39731cb7e993b5aa84162dbc59fc8407c6ad91 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 12 Jan 2018 10:25:01 +0000 Subject: [PATCH] Fixed some includes, syntax, increased frame rate --- breakout/breakout.c | 2 +- breakout/include/structs.h | 4 +++- breakout/paddleAndBall.c | 4 ++++ breakout/render.c | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/breakout/breakout.c b/breakout/breakout.c index 0400af1..c3d09a8 100644 --- a/breakout/breakout.c +++ b/breakout/breakout.c @@ -131,7 +131,7 @@ int main(void) { */ char subSteps = 1; // Draw every N+1 frames, thereby calculating movement more precisely - int targetFPS = 60; // Limit FPS to this value, to stop unneccessary calculations + int targetFPS = 90; // Limit FPS to this value, to stop unneccessary calculations char moveX=0; // Toggled between -1, 0 and 1 by keypresses later diff --git a/breakout/include/structs.h b/breakout/include/structs.h index 814d58c..ffbe8f9 100644 --- a/breakout/include/structs.h +++ b/breakout/include/structs.h @@ -1,3 +1,5 @@ + + typedef struct coord { double x; double y; @@ -45,4 +47,4 @@ typedef struct brickCD { int height; struct brickCD *container; int brickID; -} brickCD; \ No newline at end of file +} brickCD; diff --git a/breakout/paddleAndBall.c b/breakout/paddleAndBall.c index da7a9d9..842fc6e 100644 --- a/breakout/paddleAndBall.c +++ b/breakout/paddleAndBall.c @@ -1,9 +1,13 @@ #ifdef _WIN32 +#include #include #else #include #endif +#include +#include #include "include/structs.h" +#include "include/paddleAndBall.h" #include "include/utilityFunctions.h" void updatePaddle(Uint32 tickrate, paddle *thePaddle, char moveX, int winWidth, int winHeight) { diff --git a/breakout/render.c b/breakout/render.c index 82bdee2..79b14a6 100644 --- a/breakout/render.c +++ b/breakout/render.c @@ -15,6 +15,7 @@ #include #include "include/structs.h" +#include "include/paddleAndBall.h" void drawText(const char *text, TTF_Font *font, SDL_Color txtColour, coord loc) { SDL_Surface *text_surface = TTF_RenderUTF8_Blended(font, text, txtColour);