976 end |
976 end |
977 {$ENDIF} |
977 {$ENDIF} |
978 end; |
978 end; |
979 |
979 |
980 procedure ChangeDepth(rm: TRenderMode; d: GLfloat); |
980 procedure ChangeDepth(rm: TRenderMode; d: GLfloat); |
981 begin |
981 var tmp: LongInt; |
982 rm:= rm; d:= d; // avoid hint |
982 begin |
983 {$IFDEF USE_S3D_RENDERING} |
983 {$IFNDEF USE_S3D_RENDERING} |
|
984 rm:= rm; d:= d; tmp:= tmp; // avoid hint |
|
985 {$ELSE} |
984 d:= d / 5; |
986 d:= d / 5; |
985 if rm = rmDefault then |
987 if rm = rmDefault then |
986 exit |
988 exit |
987 else if rm = rmLeftEye then |
989 else if rm = rmLeftEye then |
988 d:= -d; |
990 d:= -d; |
989 cStereoDepth:= cStereoDepth + d; |
991 cStereoDepth:= cStereoDepth + d; |
990 openglTranslProjMatrix(d, 0, 0); |
992 openglTranslProjMatrix(d, 0, 0); |
|
993 tmp:= round(d / cScaleFactor * cScreenWidth); |
|
994 ViewLeftX := ViewLeftX - tmp; |
|
995 ViewRightX:= ViewRightX - tmp; |
991 {$ENDIF} |
996 {$ENDIF} |
992 end; |
997 end; |
993 |
998 |
994 procedure ResetDepth(rm: TRenderMode); |
999 procedure ResetDepth(rm: TRenderMode); |
995 begin |
1000 var tmp: LongInt; |
996 rm:= rm; // avoid hint |
1001 begin |
997 {$IFDEF USE_S3D_RENDERING} |
1002 {$IFNDEF USE_S3D_RENDERING} |
|
1003 rm:= rm; tmp:= tmp; // avoid hint |
|
1004 {$ELSE} |
998 if rm = rmDefault then |
1005 if rm = rmDefault then |
999 exit; |
1006 exit; |
1000 openglTranslProjMatrix(-cStereoDepth, 0, 0); |
1007 openglTranslProjMatrix(-cStereoDepth, 0, 0); |
|
1008 tmp:= round(cStereoDepth / cScaleFactor * cScreenWidth); |
|
1009 ViewLeftX := ViewLeftX + tmp; |
|
1010 ViewRightX:= ViewRightX + tmp; |
1001 cStereoDepth:= 0; |
1011 cStereoDepth:= 0; |
1002 {$ENDIF} |
1012 {$ENDIF} |
1003 end; |
1013 end; |
1004 |
1014 |
1005 procedure RenderWorldEdge; |
1015 procedure RenderWorldEdge; |