From 01a21af4c041c6f3133b4202ca35c156ffb00f32 Mon Sep 17 00:00:00 2001 From: Charadon Date: Wed, 1 Jun 2022 17:34:51 -0400 Subject: Migrate to meson --- src/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 89422ba..9339b92 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,6 @@ #include "pong.h" #include "sounds.h" +#include #include @@ -67,7 +68,7 @@ int audio() { } bool play_audio(int SoundEffect) { - int i; + unsigned int i; while(mtx_trylock(&AudioQueueBeingModified) == thrd_busy); for(i = 1; i != 20; i++) { if (AudioQueue[i-1] == -1) { @@ -94,6 +95,7 @@ int main() { SetWindowIcon(Icon); SetWindowState(FLAG_VSYNC_HINT); SetWindowState(FLAG_WINDOW_RESIZABLE); + SetWindowMinSize(1280, 720); //Initialize Variables Camera2D MainCamera; @@ -101,7 +103,7 @@ int main() { MainCamera.offset = (Vector2){0, 0}; MainCamera.rotation = 0; //Populate Audio Queue - for(int i = 0; i < sizeof(AudioQueue); i++) { + for(unsigned int i = 0; i < sizeof(AudioQueue); i++) { AudioQueue[i] = -1; } mtx_init(&AudioQueueBeingModified, mtx_plain); @@ -153,6 +155,9 @@ int main() { while(!WindowShouldClose() && GameGoing == true) { MainCamera.zoom = GetScreenHeight()/720.0f; + MainCamera.offset = (Vector2){GetScreenWidth()/2.0f, GetScreenHeight()/2.0f}; + MainCamera.target = (Vector2){1280/2.0f, 720/2.0f}; + if (Enemy.Score >= 5) { play_audio(MUSIC_DEFEAT); longjmp(RestartGame, 0); -- cgit 1.4.1-2-gfad0