From 26654506261a8f129976ee0ce7b6c015c4a22b7d Mon Sep 17 00:00:00 2001 From: Mark B Date: Thu, 21 Oct 2021 08:02:11 -0400 Subject: [PATCH] more fitting return types for functions --- .gitignore | 1 + src/Controls.c | 2 +- src/Controls.h | 2 +- src/Copying.c | 2 +- src/Debug.c | 4 +--- src/Debug.h | 2 +- src/Main.c | 12 ++++-------- 7 files changed, 10 insertions(+), 15 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c438c3f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +T_V_X_E diff --git a/src/Controls.c b/src/Controls.c index eadf8cc..d236194 100644 --- a/src/Controls.c +++ b/src/Controls.c @@ -4,7 +4,7 @@ #include "Controls.h" // Controls -int Func_Controls() +void Func_Controls() { if (IsKeyDown(KEY_LEFT)) {TuxPos_x -= GetFrameTime() * 800.0f;} if (IsKeyDown(KEY_RIGHT)) {TuxPos_x += GetFrameTime() * 800.0f;} diff --git a/src/Controls.h b/src/Controls.h index d9ef624..56f7d33 100644 --- a/src/Controls.h +++ b/src/Controls.h @@ -1,3 +1,3 @@ #pragma once -int Func_Controls(); +void Func_Controls(); diff --git a/src/Copying.c b/src/Copying.c index b3a6b20..fdb54b6 100644 --- a/src/Copying.c +++ b/src/Copying.c @@ -6,7 +6,7 @@ void Func_License() // Outputs Copying info in the command line printf ( - "Tux Vs X Engine Copyright (C) 2021 Canneddonuts Team.\n" + "\nTux Vs X Engine Copyright (C) 2021 Canneddonuts Team.\n" "This program comes with ABSOLUTELY NO WARRANTY; \n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions; for details read the LICENSE.\n" diff --git a/src/Debug.c b/src/Debug.c index 67f50a1..289f508 100644 --- a/src/Debug.c +++ b/src/Debug.c @@ -1,11 +1,9 @@ #include #include "Main.h" -#include "Controls.h" #include "Debug.h" - -int Func_ShowPos() +void Func_ShowPos() { // Ouput Position Infomation in the command line printf diff --git a/src/Debug.h b/src/Debug.h index 2d5ddcd..8392152 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -1,3 +1,3 @@ #pragma once -int Func_ShowPos(); +void Func_ShowPos(); diff --git a/src/Main.c b/src/Main.c index 728c71e..08a6baa 100644 --- a/src/Main.c +++ b/src/Main.c @@ -1,4 +1,3 @@ -#include #include "raylib.h" @@ -12,10 +11,8 @@ float EnemyPos_x = 482.0f, EnemyPos_y = 62.0f; float TuxPos_x = 32.0f, TuxPos_y = 62.0f; - - // Setup Code -int Func_Setup() +void Func_Setup() { const int screenWidth = 800; const int screenHeight = 450; @@ -26,7 +23,7 @@ int Func_Setup() } // GameLoop Code -int Func_MainGameLoop() +void Func_MainGameLoop() { // Load Textures Texture2D tux = LoadTexture("assets/tux.png"); @@ -34,12 +31,10 @@ int Func_MainGameLoop() Texture2D arctic = LoadTexture("assets/arctic.png"); // GameLoop - while (!WindowShouldClose()) - { + while (!WindowShouldClose()) { Func_ShowPos(); Func_Controls(); - BeginDrawing(); ClearBackground(RAYWHITE); @@ -48,6 +43,7 @@ int Func_MainGameLoop() DrawTexture(tux, TuxPos_x, TuxPos_y, RAYWHITE); DrawTexture(enemy, EnemyPos_x, EnemyPos_y, RAYWHITE); DrawText("Tux Vs X ENGINE PROTOTYPE please read the LINCENSE", 50, 18, 20, BLACK); + EndDrawing(); } // Unload Textures