]> git.jsancho.org Git - lugaru.git/commitdiff
merge
authorCôme BERNIGAUD <come.bernigaud@gmail.com>
Mon, 24 May 2010 19:37:39 +0000 (21:37 +0200)
committerCôme BERNIGAUD <come.bernigaud@gmail.com>
Mon, 24 May 2010 19:37:39 +0000 (21:37 +0200)
1  2 
Data/config.txt
Source/GameDraw.cpp
Source/GameTick.cpp
Source/Globals.cpp
Source/OpenGL_Windows.cpp
Source/Settings.cpp

diff --combined Data/config.txt
index fc8049b6bbbeb502301e43deb03acb9542e450b5,203c615fadae7c3efd01178c31f47811010558a5..4759143d8bb572d42c3d782d6b9f53148caaba8c
@@@ -70,5 -70,9 +70,11 @@@ Attack key
  mouse1
  Chat key:
  unknown
 +Damage bar:
 +1
+ StereoMode:
+ 0
+ StereoSeparation:
+ 0.05
+ StereoReverse:
+ 0
diff --combined Source/GameDraw.cpp
index e01f46ce516c498ce6019bda1c2f8abcfd1ea52a,0e153a9420bfd6c07be9c524e868c9dc27d6623f..c3b087de033646d6b605735ed70ef03bb254fe71
@@@ -175,8 -175,6 +175,8 @@@ extern float accountcampaigntime[10]
  
  extern bool gamestarted;
  
 +extern bool showdamagebar;
 +
  extern OPENAL_SAMPLE  *samp[100];
  extern int channels[100];
  extern "C"    void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused);
@@@ -213,7 -211,7 +213,7 @@@ long long Game::MD5_string (char *strin
        //return 1111111111111111;
  }
  
- int Game::DrawGLScene(void)
+ int Game::DrawGLScene(StereoSide side)
  {     
        static float texcoordwidth,texcoordheight;
        static float texviewwidth, texviewheight;
  
        lastcheck+=multiplier;
  
-       glColorMask( 1.0, 1.0, 1.0, 1.0 );
+       if ( stereomode == stereoAnaglyph ) {
+               switch(side) {
+                       case stereoLeft: glColorMask( 0.0, 1.0, 1.0, 1.0 ); break;
+                       case stereoRight: glColorMask( 1.0, 0.0, 0.0, 1.0 ); break;
+               }
+       } else {
+               glColorMask( 1.0, 1.0, 1.0, 1.0 );
+               
+               if ( stereomode == stereoHorizontalInterlaced || stereomode == stereoVerticalInterlaced ) {
+                       glStencilFunc(side == stereoLeft ? GL_NOTEQUAL : GL_EQUAL, 0x01, 0x01);
+               }
+       }
  
        if(freeze||winfreeze||(mainmenu&&gameon)||(!gameon&&gamestarted)){
                tempmult=multiplier;
                glMatrixMode (GL_MODELVIEW);
                glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
                glLoadIdentity ();
+               
+               // Move the camera for the current eye's point of view.
+               // Reverse the movement if we're reversing stereo
+               glTranslatef((stereoseparation/2) * side * (stereoreverse  ? -1 : 1), 0, 0);
+               
                if(!cameramode&&!freeze&&!winfreeze){
                        glRotatef(float(Random()%100)/10*camerashake/*+(woozy*woozy)/10*/,0,0,1);
                        glRotatef(rotation2+sin(woozy/2)*(player[0].damage/player[0].damagetolerance)*5,1,0,0);
                                        text.glPrintOutline(1024/40-4,768/16-4+768*14/16,string,1,1.5*1.25,1024,768);
                                        glColor4f(1,0,0,1);
                                        text.glPrint(1024/40,768/16+768*14/16,string,1,1.5,1024,768);
 +                                      if(showdamagebar) {
 +                                              glDisable(GL_DEPTH_TEST);                                                       // Disables Depth Testing
 +                                              glDisable(GL_CULL_FACE);
 +                                              glDisable(GL_LIGHTING);
 +                                              glDisable(GL_TEXTURE_2D);
 +                                              glDepthMask(0);
 +                                              glMatrixMode(GL_PROJECTION);                                            // Select The Projection Matrix
 +                                              glPushMatrix();                                                                         // Store The Projection Matrix
 +                                              glLoadIdentity();                                                                       // Reset The Projection Matrix
 +                                              glOrtho(0,screenwidth,0,screenheight,-100,100);         // Set Up An Ortho Screen
 +                                              glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
 +                                              glPushMatrix();                                                                         // Store The Modelview Matrix
 +                                              glLoadIdentity();                                                                       // Reset The Modelview Matrix
 +                                              glTranslatef(15,screenheight*17.5/20,0);
 +                                              glScalef(screenwidth/3+20,screenheight/20,1);
 +                                              glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
 +                                              glEnable(GL_BLEND);
 +                                              glColor4f(0.0,0.4,0.0,0.7);
 +                                              float bar=((float)player[0].damage)/player[0].damagetolerance;
 +                                              glBegin(GL_QUADS);
 +                                              glVertex3f((bar<1?bar:1),0,0.0f);
 +                                              glVertex3f(1,0,0.0f);
 +                                              glVertex3f(1,1,0.0f);
 +                                              glVertex3f((bar<1?bar:1),1,0.0f);
 +                                              glEnd();
 +                                              glColor4f(0.1,0.0,0.0,1);
 +                                              bar = ((float)player[0].bloodloss)/player[0].damagetolerance;
 +                                              glBegin(GL_QUADS);
 +                                              glVertex3f(0,0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),1,0.0f);
 +                                              glVertex3f(0,1,0.0f);
 +                                              glEnd();
 +                                              glColor4f(0.4,0.0,0.0,0.7);
 +                                              bar = ((float)player[0].damage)/player[0].damagetolerance;
 +                                              glBegin(GL_QUADS);
 +                                              glVertex3f(0,0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),1,0.0f);
 +                                              glVertex3f(0,1,0.0f);
 +                                              glEnd();
 +                                              glColor4f(0.4,0.0,0.0,0.7);
 +                                              bar = ((float)player[0].permanentdamage)/player[0].damagetolerance;
 +                                              glBegin(GL_QUADS);
 +                                              glVertex3f(0,0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),1,0.0f);
 +                                              glVertex3f(0,1,0.0f);
 +                                              glEnd();
 +                                              glColor4f(0.4,0.0,0.0,0.7);
 +                                              bar = ((float)player[0].superpermanentdamage)/player[0].damagetolerance;
 +                                              glBegin(GL_QUADS);
 +                                              glVertex3f(0,0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),0,0.0f);
 +                                              glVertex3f((bar<1?bar:1),1,0.0f);
 +                                              glVertex3f(0,1,0.0f);
 +                                              glEnd();
 +                                              glColor4f(0.0,0.0,0.0,0.7);
 +                                              glLineWidth(2.0);
 +                                              glBegin(GL_LINE_STRIP);
 +                                              glVertex3f(0,0,0.0f);
 +                                              glVertex3f(1,0,0.0f);
 +                                              glVertex3f(1,1,0.0f);
 +                                              glVertex3f(0,1,0.0f);
 +                                              glVertex3f(0,0,0.0f);
 +                                              glEnd();
 +                                              
 +                                              glMatrixMode(GL_PROJECTION);                                            // Select The Projection Matrix
 +                                              glPopMatrix();                                                                          // Restore The Old Projection Matrix
 +                                              glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
 +                                              glPopMatrix();                                                                          // Restore The Old Projection Matrix
 +                                              glEnable(GL_DEPTH_TEST);                                                        // Enables Depth Testing
 +                                              glEnable(GL_CULL_FACE);
 +                                              glDisable(GL_BLEND);
 +                                              glDepthMask(1);
 +                                              glEnable(GL_TEXTURE_2D);
 +                                              
 +                                              // writing the numbers : 
 +                                              sprintf (string, "Damages : %d/%d (%d)",(int)(player[0].damage),(int)(player[0].damagetolerance),(int)(player[0].bloodloss));
 +                                              glColor4f(0,0,0,1);
 +                                              text.glPrintOutline(1024/40-4,768/16-4+768*14/16-40,string,1,1.5*1.25,1024,768);
 +                                              glColor4f(1,0,0,1);
 +                                              text.glPrint(1024/40,768/16+768*14/16-40,string,1,1.5,1024,768);
 +                                      }
                                }
  
                                glColor4f(.5,.5,.5,1);
  
                /*if(mainmenu!=0)*/oldmainmenu=mainmenu;
  
-               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==13||mainmenu==17){
+               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==13||mainmenu==17||mainmenu==18){
                        glClear(GL_DEPTH_BUFFER_BIT);
                        glEnable(GL_ALPHA_TEST);
                        glAlphaFunc(GL_GREATER, 0.001f);
                        glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
  
                        if(mainmenu==3){                        
-                               nummenuitems=12;
+                               nummenuitems=13;
                                if((float)newscreenwidth>(float)newscreenheight*1.61||(float)newscreenwidth<(float)newscreenheight*1.59)sprintf (menustring[0], "Resolution: %d*%d",(int)newscreenwidth,(int)newscreenheight);
                                else sprintf (menustring[0], "Resolution: %d*%d (widescreen)",(int)newscreenwidth,(int)newscreenheight);
                                startx[0]=10+20;
                                movex[7]=0;
                                movey[7]=0;
  
+                               sprintf (menustring[12], "-Configure Stereo -");
+                               startx[12]=10+15;
+                               starty[12]=60;
+                               endx[12]=startx[12]+strlen(menustring[7])*10;
+                               endy[12]=starty[12]+20;
+                               movex[12]=0;
+                               movey[12]=0;
+                               
                                if(newdetail==detail&&newscreenheight==(int)screenheight&&newscreenwidth==(int)screenwidth)sprintf (menustring[8], "Back");
                                else sprintf (menustring[8], "Back (some changes take effect next time Lugaru is opened)");
                                startx[8]=10;
                                movex[7]=0;
                                movey[7]=0;*/
                        }
+                       if (mainmenu==18) {
+                               nummenuitems=4;
+                               sprintf (menustring[0], "Stereo mode: %s", StereoModeName(newstereomode));
+                               startx[0]=70;
+                               starty[0]=400;
+                               endx[0]=startx[0]+strlen(menustring[0])*10;
+                               endy[0]=starty[0]+20;
+                               movex[0]=0;
+                               movey[0]=0;
+                               
+                               sprintf (menustring[1], "Stereo separation: %.3f", stereoseparation);
+                               startx[1]=10;
+                               starty[1]=360;
+                               endx[1]=startx[1]+strlen(menustring[1])*10;
+                               endy[1]=starty[1]+20;
+                               movex[1]=0;
+                               movey[1]=0;
+                               sprintf (menustring[2], "Reverse stereo: %s", stereoreverse ? "Yes" : "No");
+                               startx[2]=40;
+                               starty[2]=320;
+                               endx[2]=startx[2]+strlen(menustring[2])*10;
+                               endy[2]=starty[2]+20;
+                               movex[2]=0;
+                               movey[2]=0;
+                               
+                               sprintf (menustring[3], "Back");
+                               startx[3]=10;
+                               endx[3]=startx[3]+strlen(menustring[3])*10;
+                               starty[3]=10;
+                               endy[3]=starty[3]+20;
+                               movex[3]=0;
+                               movey[3]=0;                             
+                       }
                }
  
                if(mainmenu==13){       
                                }
                        }
  
-                       if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17)
+                       if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==18)
                                for(i=0;i<nummenuitems;i++){
                                        if((mousecoordh/screenwidth*640)>startx[i]&&(mousecoordh/screenwidth*640)<endx[i]&&480-(mousecoordv/screenheight*480)>starty[i]&&480-(mousecoordv/screenheight*480)<endy[i]){
                                                if(mainmenu!=5)selected=i;
                                                                                        }
                                                                                }
                                                                        }
-                                                                       if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17)
+                                                                       if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==18)
                                                                        {
                                                                                if(mainmenu!=5||j<6)
                                                                                {
                                                                                                        if(mainmenu==10)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                                                        if(mainmenu==17)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                                                        if(mainmenu==13&&j!=1)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+                                                                                                       if(mainmenu==18)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                                                        /*else{
                                                                                                        if(displayblink){
                                                                                                        sprintf (string, "_");
  
                                                                if(flashamount>0)
                                                                {
+                                                                       //printf("Flash amount: %f, delay %i\n", flashamount, flashdelay);
                                                                        if(flashamount>1)flashamount=1;
                                                                        if(flashdelay<=0)flashamount-=multiplier;
                                                                        flashdelay--;
  
  
        //glFlush();
-       if(drawmode!=motionblurmode||mainmenu){
-               swap_gl_buffers();
-   }
+       if ( side == stereoRight || side == stereoCenter ) {
+               if(drawmode!=motionblurmode||mainmenu){
+                       swap_gl_buffers();
+               }
+       }
  
        //myassert(glGetError() == GL_NO_ERROR);
        glDrawBuffer(GL_BACK);
diff --combined Source/GameTick.cpp
index 14905eefc1b9f388d55b8ee1ec844060c9ca10a5,5c8b4acd77ef67faaadbdaee4fe991ef27b0d20b..00bcdc400cc1d9c6f288cf00091cbc95f8fbcf09
@@@ -101,7 -101,6 +101,7 @@@ extern bool foliage
  extern bool trilinear;
  extern bool damageeffects;
  extern bool showpoints;
 +extern bool showdamagebar; // (des)activate the damage bar
  extern bool texttoggle;
  extern bool alwaysblur;
  extern float gamespeed;
@@@ -738,6 -737,11 +738,11 @@@ static void ch_wolfie(Game *game, cons
    set_proportion(0, "1 1 1 1");
  }
  
+ static void ch_wolfieisgod(Game *game, const char *args)
+ {
+   ch_wolfie(game, args);
+ }
  static void ch_wolf(Game *game, const char *args)
  {
    game->LoadTextureSave(":Data:Textures:Wolf.jpg",&player[0].skeleton.drawmodel.textureptr,1,
@@@ -756,6 -760,12 +761,12 @@@ static void ch_darkwolf(Game *game, con
                        &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize);
  }
  
+ static void ch_lizardwolf(Game *game, const char *args)
+ {
+   game->LoadTextureSave(":Data:Textures:Lizardwolf.jpg",&player[0].skeleton.drawmodel.textureptr,1,
+                       &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize);
+ }
  static void ch_white(Game *game, const char *args)
  {
    game->LoadTextureSave(":Data:Textures:fur.jpg",&player[0].skeleton.drawmodel.textureptr,1,
@@@ -2610,6 -2620,43 +2621,43 @@@ void  Game::Tick(
  
  
        static bool mainmenutogglekeydown;
+       if (IsKeyDown(theKeyMap, MAC_F6_KEY) && !freezetogglekeydown) {
+               if (IsKeyDown(theKeyMap, MAC_SHIFT_KEY)) {
+                       stereoreverse=true;
+               } else {
+                       stereoreverse=false;
+               }
+               if (stereoreverse) {
+                       printf("Stereo reversed\n");
+               } else {
+                       printf("Stereo unreversed\n");
+               }
+               freezetogglekeydown=1;
+       }
+       if (IsKeyDown(theKeyMap, MAC_F7_KEY)) {
+               if (IsKeyDown(theKeyMap, MAC_SHIFT_KEY)) {
+                       stereoseparation -= 0.001;
+               } else {
+                       stereoseparation -= 0.010;
+               }
+               printf("Stereo decreased increased to %f\n", stereoseparation);
+       }
+       if (IsKeyDown(theKeyMap, MAC_F8_KEY)) {
+               if (IsKeyDown(theKeyMap, MAC_SHIFT_KEY)) {
+                       stereoseparation += 0.001;
+               } else {
+                       stereoseparation += 0.010;
+               }
+               printf("Stereo separation increased to %f\n", stereoseparation);
+       }
        if(!console){
                if(mainmenu&&endgame==1)mainmenu=10;
                if(IsKeyDown(theKeyMap, MAC_ESCAPE_KEY)&&!mainmenutogglekeydown&&(mainmenu==7&&entername)){
                                mainmenu=4;
                                keyselect=-1;
                        }
+                       if(Button() && !oldbutton && selected == 12) {
+                               flashr=1;
+                               flashg=0;
+                               flashb=0;
+                               flashamount=1;
+                               flashdelay=1;
+                               
+                               newstereomode = stereomode;
+                               mainmenu=18;
+                               keyselect = -1;
+                       }
                        if(Button()&&!oldbutton&&selected==8){
                                float gLoc[3]={0,0,0};
                                float vel[3]={0,0,0};
                        if(Button())oldbutton=1;
                        else oldbutton=0;
                }
+               if (mainmenu==18) {
+                       if(Button()&&!oldbutton) {
+                               printf("Button %i pressed\n", selected);
+                       }
+                       
+                       if(Button()&&!oldbutton&&selected==0) {
+                               newstereomode = (StereoMode)(newstereomode + 1);
+                               while(!CanInitStereo(newstereomode)) {
+                                       printf("Failed to initialize mode %s (%i)\n", StereoModeName(newstereomode), newstereomode);
+                                       newstereomode = (StereoMode)(newstereomode + 1);
+                                       if ( newstereomode >= stereoCount ) {
+                                               newstereomode = stereoNone;
+                                       }
+                               }
+                       }
+                       
+                       if(buttons[0]&&!oldbutton&&selected==1) {
+                               stereoseparation+=0.001;
+                       }
+                       if(buttons[1]&&!oldbutton&&selected==1) {
+                               stereoseparation-=0.001;
+                       }
+                       if(Button()&&!oldbutton&&selected==2) {
+                               stereoreverse =! stereoreverse;
+                       }
+                       
+                       if(Button()&&!oldbutton&&selected==3) {
+                               flashr=1;
+                               flashg=0;
+                               flashb=0;
+                               flashamount=1;
+                               flashdelay=1;
+                               stereomode = newstereomode;
+                               InitStereo(stereomode);
+                               
+                               mainmenu=3;
+                       }
+                       
+                       if(Button() || buttons[1])oldbutton=1;
+                       else oldbutton=0;
+               }
  
  
-               if(Button())oldbutton=1;
+               if(Button()||buttons[1])oldbutton=1;
                else oldbutton=0;
  
                if(IsKeyDown(theKeyMap, MAC_Q_KEY)&&IsKeyDown(theKeyMap, MAC_COMMAND_KEY)){
diff --combined Source/Globals.cpp
index dfb570df66db83fe7bec1590087829f6dd4d26ab,01d883915679b2c3cd23bee90779b715367bbde7..eae0bd07f0590fbda565f78b41bd0c97c2a3068e
@@@ -33,6 -33,7 +33,7 @@@ Foundation, Inc., 59 Temple Place - Sui
  #include "Person.h"
  #include "TGALoader.h"
  #include "openal_wrapper.h"
+ #include "Stereo.h"
  
  #include "Constants.h"
  
@@@ -119,7 -120,6 +120,7 @@@ char mapname[256] = {0}
  bool loadingstuff = 0;
  bool stillloading = 0;
  bool showpoints = 0;
 +bool showdamagebar = 0;
  bool alwaysblur = 0;
  bool immediate = 0;
  bool velocityblur = 0;
@@@ -268,3 -268,7 +269,7 @@@ bool gamestarted = 0
  
  //TextureList textures;
  
+ StereoMode stereomode =  stereoNone;
+ StereoMode newstereomode = stereoNone;
+ float stereoseparation = 0.05;
+ bool  stereoreverse = false;
index 76f9777e402a7860c1399fbed70fa6e733c8683f,5759ddc15fa40d270e876cca271091b7f05df98f..b68c60bcfd37bc3d4e03960d401d03430aa5ddea
@@@ -297,7 -297,12 +297,12 @@@ void ShutdownDSp (
  
  void DrawGL (Game & game)
  {
-       game.DrawGLScene();
+       if ( stereomode == stereoNone ) {
+               game.DrawGLScene(stereoCenter);
+       } else {
+               game.DrawGLScene(stereoLeft);
+               game.DrawGLScene(stereoRight);
+       }
  }
  
  
@@@ -567,6 -572,7 +572,6 @@@ Boolean SetUp (Game & game
                fprintf(stderr, "Failed to load config, creating default\n");
                SaveSettings(game);
        }
 -      
        if(kBitsPerPixel!=32&&kBitsPerPixel!=16){
                kBitsPerPixel=16;
        }
      SDL_ShowCursor(0);
  
      SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+     SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
+     
      if (SDL_SetVideoMode(kContextWidth, kContextHeight, 0, sdlflags) == NULL)
      {
          fprintf(stderr, "SDL_SetVideoMode() failed: %s\n", SDL_GetError());
        glDisable( GL_FOG);
        glDisable( GL_LIGHTING);
        glDisable( GL_LOGIC_OP);
-       glDisable( GL_STENCIL_TEST);
        glDisable( GL_TEXTURE_1D);
        glDisable( GL_TEXTURE_2D);
        glPixelTransferi( GL_MAP_COLOR, GL_FALSE);
        game.newscreenwidth=screenwidth;
        game.newscreenheight=screenheight;
  
+       if ( CanInitStereo(stereomode) ) {
+               InitStereo(stereomode);
+       } else {
+               fprintf(stderr, "Failed to initialize stereo, disabling.\n");
+               stereomode = stereoNone;
+       }
        game.InitGame();
  
        return true;
diff --combined Source/Settings.cpp
index 7f90a0756820941c5ad3b370d636a8e91e656417,754c2ac4e316ec2c0a995dcebfd741227ba3009d..b2c761ddbe312dbe1fabc825ab2d19b100ac8aa4
@@@ -23,7 -23,6 +23,7 @@@ void DefaultSettings(Game &game) 
        texttoggle=1;
        alwaysblur=0;
        showpoints=0;
 +      showdamagebar=0;
        immediate=0;
        velocityblur=0;
        volume = 0.8f;
@@@ -118,8 -117,13 +118,14 @@@ void SaveSettings(Game &game) 
        opstream << KeyToChar(game.attackkey);
        opstream << "\nChat key:\n";
        opstream << KeyToChar(game.chatkey);
 -      
 +      opstream << "\nDamage bar:\n";
 +      opstream << showdamagebar;
+       opstream << "\nStereoMode:\n";
+       opstream << stereomode;
+       opstream << "\nStereoSeparation:\n";
+       opstream << stereoseparation;
+       opstream << "\nStereoReverse:\n";
+       opstream << stereoreverse;
        opstream.close();
  }
  
@@@ -236,8 -240,14 +242,16 @@@ bool LoadSettings(Game &game) 
                } else if ( !strncmp(setting, "Chat key", 8) ) {
                        ipstream >> string;
                        game.chatkey = CharToKey(string);
 +              } else if ( !strncmp(setting, "Damage bar", 10) ) {
 +                      ipstream >> showdamagebar;
+               } else if ( !strncmp(setting, "StereoMode", 10) ) {
+                       int i;
+                       ipstream >> i;
+                       stereomode = (StereoMode)i;
+               } else if ( !strncmp(setting, "StereoSeparation", 16) ) {
+                       ipstream >> stereoseparation;
+               } else if ( !strncmp(setting, "StereoReverse", 13) ) {
+                       ipstream >> stereoreverse;
                } else {
                        ipstream >> string;
                        fprintf(stderr, "Unknown config option '%s' with value '%s'. Ignoring.\n", setting, string);