]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Game.cpp
Added an enum for decal type
[lugaru.git] / Source / Game.cpp
index 7efff10ea413b28276b053c00dfb6dee58b56db5..5da0518b1583e617cffca29ad293b8e75bbe9645 100644 (file)
@@ -18,10 +18,12 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#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 <SDL_thread.h>
 
 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;
@@ -108,11 +112,6 @@ int numchallengelevels = 0;
 
 bool console = false;
 std::string consoletext[15] = {};
-std::string displaytext[15] = {};
-float displaytime[15] = {};
-float displayblinkdelay = 0;
-bool displayblink = 0;
-unsigned displayselected = 0;
 float consoleblinkdelay = 0;
 bool consoleblink = 0;
 unsigned consoleselected = 0;
@@ -127,7 +126,6 @@ int targetlevel = 0;
 float changedelay = 0;
 
 bool waiting = false;
-Account* accountactive = NULL;
 }
 
 void Game::fireSound(int sound)
@@ -192,76 +190,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;
-    }
-}