]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Game.cpp
toggle fullscreen with alt+enter
[lugaru.git] / Source / Game.cpp
index 524009d2500b504846f927c4223147d5fba8fe47..66aafdf565c0afcc003bf3f63e820fb659f39980 100644 (file)
@@ -3,11 +3,30 @@
 #include "SDL_thread.h"
 
 extern int mainmenu;
-extern OPENAL_SAMPLE *samp[100];
-extern int channels[100];
-extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused);
-
 
+int numdialogues;
+int numdialogueboxes[max_dialogues];
+int dialoguetype[max_dialogues];
+int dialogueboxlocation[max_dialogues][max_dialoguelength];
+float dialogueboxcolor[max_dialogues][max_dialoguelength][3];
+int dialogueboxsound[max_dialogues][max_dialoguelength];
+char dialoguetext[max_dialogues][max_dialoguelength][128];
+char dialoguename[max_dialogues][max_dialoguelength][64];
+XYZ dialoguecamera[max_dialogues][max_dialoguelength];
+XYZ participantlocation[max_dialogues][10];
+int participantfocus[max_dialogues][max_dialoguelength];
+int participantaction[max_dialogues][max_dialoguelength];
+float participantrotation[max_dialogues][10];
+XYZ participantfacing[max_dialogues][max_dialoguelength][10];
+float dialoguecamerarotation[max_dialogues][max_dialoguelength];
+float dialoguecamerarotation2[max_dialogues][max_dialoguelength];
+int indialogue;
+int whichdialogue;
+int directing;
+float dialoguetime;
+int dialoguegonethrough[20];
+
+std::vector<TextureInfo> Game::textures;
 
 Game::Game()
 {
@@ -67,13 +86,8 @@ Game::Game()
 //     SkyBox skybox;
 
        cameramode = 0;
-       cameratogglekeydown = 0;
-       chattogglekeydown = 0;
        olddrawmode = 0;
        drawmode = 0;
-       drawmodetogglekeydown = 0;
-       explodetogglekeydown = 0;
-       detailtogglekeydown = 0;
        firstload = 0;
        oldbutton = 0;
 
@@ -137,10 +151,6 @@ Game::Game()
 //     XYZ cameraloc;
        cameradist = 0;
 
-       envtogglekeydown = 0;
-       slomotogglekeydown = 0;
-       texturesizetogglekeydown = 0;
-       freezetogglekeydown = 0;
        drawtoggle = 0;
 
        editorenabled = 0;
@@ -177,13 +187,9 @@ Game::Game()
        displayblink = 0;
        displayselected = 0;
        consolekeydown = 0;
-       consoletogglekeydown = 0;
        consoleblinkdelay = 0;
        consoleblink = 0;
        consoleselected = 0;
-//     memset(togglekey, 0, sizeof(togglekey));
-//     memset(togglekeydelay, 0, sizeof(togglekeydelay));
-       registernow = 0;
        autocam = 0;
 
        crouchkey = 0,jumpkey = 0,forwardkey = 0,chatkey = 0,backkey = 0,leftkey = 0,rightkey = 0,drawkey = 0,throwkey = 0,attackkey = 0;
@@ -219,14 +225,7 @@ typedef struct {
 } params_thread;
 
 void Game::fireSound(int sound) {
-       float gLoc[3]={0,0,0};
-       float vel[3]={0,0,0};
-       OPENAL_Sample_SetMinMaxDistance(samp[sound], 9999.0f, 99999.0f);
-       PlaySoundEx( sound, samp[sound], NULL, true);
-       OPENAL_3D_SetAttributes(channels[sound], gLoc, vel);
-       OPENAL_SetVolume(channels[sound], 256);
-       OPENAL_SetPaused(channels[sound], false);
-       OPENAL_Sample_SetMinMaxDistance(samp[sound], 8.0f, 2000.0f);
+       emit_sound_at(sound);
 }
 
 void Game::inputText(char* str, int* charselected, int* nb_chars) {
@@ -355,3 +354,12 @@ int Game::thread(void *data) {
         (pt->game->*(pt->method))();
     }
 }
+
+void Game::DrawGL() {
+       if ( stereomode == stereoNone ) {
+               DrawGLScene(stereoCenter);
+       } else {
+               DrawGLScene(stereoLeft);
+               DrawGLScene(stereoRight);
+       }
+}