@@ -791,47 +791,42 @@ private void renderPlainTile(GenericTile plainTile, int arg1, int tileX, int til
791
791
int zC = this .scene .landscape .tile_height [arg1 ][tileX + 1 ][tileY + 1 ] - currentCamera .getPosition ().z ;
792
792
int zD = this .scene .landscape .tile_height [arg1 ][tileX ][tileY + 1 ] - currentCamera .getPosition ().z ;
793
793
794
- int sinX = currentCamera .getRotation ().yawSine ;
795
- int cosineX = currentCamera .getRotation ().yawCosine ;
796
- int sinY = currentCamera .getRotation ().pitchSine ;
797
- int cosineY = currentCamera .getRotation ().pitchCosine ;
798
-
799
- int temp = yA * sinX + xA * cosineX >> 16 ;
800
- yA = yA * cosineX - xA * sinX >> 16 ;
801
- xA = temp ;
802
- temp = zA * cosineY - yA * sinY >> 16 ;
803
- yA = zA * sinY + yA * cosineY >> 16 ;
804
- zA = temp ;
805
- if (yA < 50 ) {
794
+ int [] resultA = Util3d .getProjectedPoint (currentCamera , xA , yA , zA );
795
+ if (resultA == null ) {
806
796
return ;
807
797
}
808
- temp = yB * sinX + xB * cosineX >> 16 ;
809
- yB = yB * cosineX - xB * sinX >> 16 ;
810
- xB = temp ;
811
- temp = zB * cosineY - yB * sinY >> 16 ;
812
- yB = zB * sinY + yB * cosineY >> 16 ;
813
- zB = temp ;
814
- if (yB < 50 ) {
798
+
799
+ xA = resultA [ 0 ] ;
800
+ yA = resultA [ 1 ] ;
801
+ zA = resultA [ 2 ] ;
802
+
803
+ int [] resultB = Util3d . getProjectedPoint ( currentCamera , xB , yB , zB ) ;
804
+ if (resultB == null ) {
815
805
return ;
816
806
}
817
- temp = yD * sinX + xD * cosineX >> 16 ;
818
- yD = yD * cosineX - xD * sinX >> 16 ;
819
- xD = temp ;
820
- temp = zC * cosineY - yD * sinY >> 16 ;
821
- yD = zC * sinY + yD * cosineY >> 16 ;
822
- zC = temp ;
823
- if (yD < 50 ) {
807
+
808
+ xB = resultB [ 0 ] ;
809
+ yB = resultB [ 1 ] ;
810
+ zB = resultB [ 2 ] ;
811
+
812
+ int [] resultD = Util3d . getProjectedPoint ( currentCamera , xD , yD , zC ) ;
813
+ if (resultD == null ) {
824
814
return ;
825
815
}
826
- temp = yC * sinX + xC * cosineX >> 16 ;
827
- yC = yC * cosineX - xC * sinX >> 16 ;
828
- xC = temp ;
829
- temp = zD * cosineY - yC * sinY >> 16 ;
830
- yC = zD * sinY + yC * cosineY >> 16 ;
831
- zD = temp ;
832
- if (yC < 50 ) {
816
+
817
+ xD = resultD [ 0 ] ;
818
+ yD = resultD [ 1 ] ;
819
+ zC = resultD [ 2 ] ;
820
+
821
+ int [] resultC = Util3d . getProjectedPoint ( currentCamera , xC , yC , zD ) ;
822
+ if (resultC == null ) {
833
823
return ;
834
824
}
825
+
826
+ xC = resultC [0 ];
827
+ yC = resultC [1 ];
828
+ zD = resultC [2 ];
829
+
835
830
int screenXA = Rasterizer3D .center_x + (xA << 9 ) / yA ;
836
831
int screenYA = Rasterizer3D .center_y + (zA << 9 ) / yA ;
837
832
int screenXB = Rasterizer3D .center_x + (xB << 9 ) / yB ;
0 commit comments