X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGame.cpp;h=76455fb7a55fb9258f078f3a87aa7369c0044f4c;hb=97573902b6b557687bd89dc92885be90f3634d50;hp=7efff10ea413b28276b053c00dfb6dee58b56db5;hpb=e7b76642d8998c250272a8313ad8aa7c7efff319;p=lugaru.git diff --git a/Source/Game.cpp b/Source/Game.cpp index 7efff10..76455fb 100644 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -18,10 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "openal_wrapper.h" -#include "SDL_thread.h" -#include "Dialog.h" +#include "Game.hpp" + +#include "Audio/openal_wrapper.hpp" +#include "Level/Dialog.hpp" + +#include extern int mainmenu; @@ -67,7 +69,9 @@ bool firstload = 0; Texture hawktexture; float hawkyaw = 0; float hawkcalldelay = 0; + float leveltime = 0; +float wonleveltime = 0; float loadtime = 0; Model hawk; @@ -127,7 +131,6 @@ int targetlevel = 0; float changedelay = 0; bool waiting = false; -Account* accountactive = NULL; } void Game::fireSound(int sound) @@ -192,76 +195,3 @@ void Game::inputText(string& str, unsigned* charselected) SDL_StopTextInput(); } } - -int setKeySelected_thread(void* data) -{ - using namespace Game; - int scancode = -1; - SDL_Event evenement; - while (scancode == -1) { - SDL_WaitEvent(&evenement); - switch (evenement.type) { - case SDL_KEYDOWN: - scancode = evenement.key.keysym.scancode; - break; - case SDL_MOUSEBUTTONDOWN: - scancode = SDL_NUM_SCANCODES + evenement.button.button; - break; - default: - break; - } - } - if (scancode != SDL_SCANCODE_ESCAPE) { - fireSound(); - switch (keyselect) { - case 0: - forwardkey = scancode; - break; - case 1: - backkey = scancode; - break; - case 2: - leftkey = scancode; - break; - case 3: - rightkey = scancode; - break; - case 4: - crouchkey = scancode; - break; - case 5: - jumpkey = scancode; - break; - case 6: - drawkey = scancode; - break; - case 7: - throwkey = scancode; - break; - case 8: - attackkey = scancode; - break; - case 9: - consolekey = scancode; - break; - default: - break; - } - } - keyselect = -1; - waiting = false; - LoadMenu(); - return 0; -} - -void Game::setKeySelected() -{ - waiting = true; - printf("launch thread\n"); - SDL_Thread* thread = SDL_CreateThread(setKeySelected_thread, NULL, NULL); - if ( thread == NULL ) { - fprintf(stderr, "Unable to create thread: %s\n", SDL_GetError()); - waiting = false; - return; - } -}