diff --git a/Game/XMultiply.exe b/Game/XMultiply.exe index 02d2fcb..b3099e9 100644 Binary files a/Game/XMultiply.exe and b/Game/XMultiply.exe differ diff --git a/Game/XMultiply.zip b/Game/XMultiply.zip index 820cb7c..f72de8f 100644 Binary files a/Game/XMultiply.zip and b/Game/XMultiply.zip differ diff --git a/ModuleAudio.cpp b/ModuleAudio.cpp index aa47437..7258d33 100644 --- a/ModuleAudio.cpp +++ b/ModuleAudio.cpp @@ -34,8 +34,8 @@ bool ModuleAudio::Init() else { - int init = Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096); // frequency, Uint16 format, channel, chunksize - + //int init = Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096); // frequency, Uint16 format, channel, chunksize + int init = Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 1024); //Reduces buffer and lag of the sound_fx if (init == -1) { LOG("Could not initialize Mixer lib. Mix_Init: %s", Mix_GetError()); diff --git a/ModuleInput.cpp b/ModuleInput.cpp index 7be6c5e..c6fe730 100644 --- a/ModuleInput.cpp +++ b/ModuleInput.cpp @@ -55,6 +55,14 @@ update_status ModuleInput::PreUpdate() if(keyboard[SDL_SCANCODE_ESCAPE]) return update_status::UPDATE_STOP; + SDL_PumpEvents(); + while (SDL_PollEvent(&Events)) + { + if (Events.type == SDL_QUIT) { + return update_status::UPDATE_STOP; + } + } + return update_status::UPDATE_CONTINUE; } diff --git a/ModuleInput.h b/ModuleInput.h index a900940..5afe6ae 100644 --- a/ModuleInput.h +++ b/ModuleInput.h @@ -31,6 +31,7 @@ class ModuleInput : public Module public: KEY_STATE keyboard[MAX_KEYS]; + SDL_Event Events; }; #endif // __ModuleInput_H__ \ No newline at end of file diff --git a/ModuleWindow.cpp b/ModuleWindow.cpp index 4021640..b7fa909 100644 --- a/ModuleWindow.cpp +++ b/ModuleWindow.cpp @@ -43,7 +43,7 @@ bool ModuleWindow::Init() if(WIN_FULLSCREEN_DESKTOP == true) flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; - window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags); + window = SDL_CreateWindow("XMultiply - v0.3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags); if(window == NULL) {