hedgewars/uWorld.pas
branchexperimental3D
changeset 4347 0ddb100fea61
parent 4345 2c93d6a10869
child 4812 f924be23ffb4
equal deleted inserted replaced
4345:2c93d6a10869 4347:0ddb100fea61
   573     if cStereoMode = smNone then
   573     if cStereoMode = smNone then
   574         begin
   574         begin
   575         glClear(GL_COLOR_BUFFER_BIT);
   575         glClear(GL_COLOR_BUFFER_BIT);
   576         DrawWorldStereo(Lag, rmDefault)
   576         DrawWorldStereo(Lag, rmDefault)
   577         end
   577         end
       
   578 {$IFNDEF S3D_DISABLED}
   578     else if (cStereoMode = smAFR) then
   579     else if (cStereoMode = smAFR) then
   579         begin
   580         begin
   580         AFRToggle:= not AFRToggle;
   581         AFRToggle:= not AFRToggle;
   581         glClear(GL_COLOR_BUFFER_BIT);
   582         glClear(GL_COLOR_BUFFER_BIT);
   582         if AFRToggle then
   583         if AFRToggle then
   680             glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE)
   681             glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE)
   681         else
   682         else
   682             glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE);
   683             glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE);
   683         DrawWorldStereo(Lag, rmRightEye);
   684         DrawWorldStereo(Lag, rmRightEye);
   684         end
   685         end
       
   686 {$ENDIF}
   685 end;
   687 end;
   686 
   688 
   687 procedure ChangeDepth(rm: TRenderMode; d: GLfloat);
   689 procedure ChangeDepth(rm: TRenderMode; d: GLfloat);
   688 begin
   690 begin
       
   691 {$IFDEF S3D_DISABLED}
       
   692     exit;
       
   693 {$ELSE}
   689     d:= d / 5;
   694     d:= d / 5;
   690     if rm = rmDefault then exit
   695     if rm = rmDefault then exit
   691     else if rm = rmLeftEye then d:= -d;
   696     else if rm = rmLeftEye then d:= -d;
   692     stereoDepth:= stereoDepth + d;
   697     stereoDepth:= stereoDepth + d;
   693     glMatrixMode(GL_PROJECTION);
   698     glMatrixMode(GL_PROJECTION);
   694     glTranslatef(d, 0, 0);
   699     glTranslatef(d, 0, 0);
   695     glMatrixMode(GL_MODELVIEW)
   700     glMatrixMode(GL_MODELVIEW);
       
   701 {$ENDIF}
   696 end;
   702 end;
   697  
   703  
   698 procedure ResetDepth(rm: TRenderMode);
   704 procedure ResetDepth(rm: TRenderMode);
   699 begin
   705 begin
       
   706 {$IFDEF S3D_DISABLED}
       
   707     exit;
       
   708 {$ELSE}
   700     if rm = rmDefault then exit;
   709     if rm = rmDefault then exit;
   701     glMatrixMode(GL_PROJECTION);
   710     glMatrixMode(GL_PROJECTION);
   702     glTranslatef(-stereoDepth, 0, 0);
   711     glTranslatef(-stereoDepth, 0, 0);
   703     glMatrixMode(GL_MODELVIEW);
   712     glMatrixMode(GL_MODELVIEW);
   704     stereoDepth:= 0;
   713     stereoDepth:= 0;
       
   714 {$ENDIF}
   705 end;
   715 end;
   706  
   716  
   707 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
   717 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
   708 var i, t: LongInt;
   718 var i, t: LongInt;
   709     r: TSDL_Rect;
   719     r: TSDL_Rect;