main.c fixed

This commit is contained in:
Michael Chen 2018-01-18 15:22:53 +01:00
parent c8ffc7840c
commit 4bbd306407

45
main.c
View File

@ -13,50 +13,11 @@
#include "gamestate.h"
#include "highscores.h"
<<<<<<< HEAD
#include "main.h"
=======
#ifndef __nullptr__
#define Nullptr(type) (type *)0
#endif // __nullptr__
#define ae "\204"
#define oe "\224"
#define ue "\201"
#define ss "\341"
// Prototypes
void GAME_ChangeState(GameState state);
void HandleSDLEvents();
void mousePress(SDL_MouseButtonEvent b);
void keyPress(SDL_KeyboardEvent b);
void toggleFullscreen();
void windowChanged(SDL_WindowEvent b);
void DrawBackground(SDL_Renderer * renderer);
void INITIALIZE();
void QUIT();
int readIntFromIO(char * m1, char * m2, char * m3, int min, int max);
// End Prototypes
// Default Render Size (Upscaled for bigger monitors)
const int width = 1920;
const int height = 1080;
float XScale = 1.0f, YScale = 1.0f;
// End render properties
int numKeys;
const Uint8 * keystate; // TODO: export all this into scenery and enemy waves
SDL_Window * window;
SDL_Renderer * renderer;
SDL_Event event;
bool running = true, fullscreen = false;
GameState gameState = MainMenu;
Scenery scenery;
>>>>>>> 04d0cfb994382d9a6e6ebd1bb4ff3aa41b5af2bb
int main(int argc, char * args[]){
//printf("Spielbereiche\n\t- 1: Hauptmen"ue "\n\t- 2: Spiel\n\t- 3: Level Select\n\t- 4: Settings\n\t- 5: Highscores\n");
//GAME_ChangeState(readIntFromIO("W"ae "hle einen Spielbereich aus, den du testen m"oe "chtest:", "Fehlerhafte Eingabe!\n", "%d ist kein g"ue "ltiger Spielbereich!\n", 1, 5));
// printf("Spielbereiche\n\t- 1: Hauptmen"ue "\n\t- 2: Spiel\n\t- 3: Level Select\n\t- 4: Settings\n\t- 5: Highscores\n");
// GAME_ChangeState(readIntFromIO("W"ae "hle einen Spielbereich aus, den du testen m"oe "chtest:", "Fehlerhafte Eingabe!\n", "%d ist kein g"ue "ltiger Spielbereich!\n", 1, 5));
INITIALIZE();
while (running) { // Gameloop
HandleSDLEvents();
@ -68,7 +29,7 @@ int main(int argc, char * args[]){
break;
case MainMenu:
// Startmenu_Update(keystate);
Startmenu_Draw(renderer);
break;
case Highscores: