@@ -1951,22 +1951,27 @@ public static void method311(Component arg1) {
1951
1951
arg1 .removeFocusListener (Class59 .keyFocusListener );
1952
1952
}
1953
1953
1954
- public static void method450 () {
1955
- if (Player .headIconDrawType == 2 ) {
1956
- MovedStatics .getProjectedScreenPosition (2 * ActorDefinition .hintIconPosZ , Class35 .hintIconInnerPosY + (-Class26 .baseY + hintIconPosY << 7 ), (ProducingGraphicsBuffer .hintIconPosX + -baseX << 7 ) + Landscape .hintIconInnerPosX );
1957
- if (ISAAC .anInt522 > -1 && pulseCycle % 20 < 10 )
1958
- hintIconSprites [0 ].drawImage (ISAAC .anInt522 + -12 , -28 + Class44 .anInt1048 );
1959
- }
1960
- }
1954
+ public static void method450 () {
1955
+ if (Player .headIconDrawType != 2 ) {
1956
+ return ;
1957
+ }
1958
+
1959
+ Point2d screenPos = MovedStatics .getProjectedScreenPosition (2 * ActorDefinition .hintIconPosZ , Class35 .hintIconInnerPosY + (-Class26 .baseY + hintIconPosY << 7 ), (ProducingGraphicsBuffer .hintIconPosX + -baseX << 7 ) + Landscape .hintIconInnerPosX );
1960
+
1961
+ if (screenPos == null ) {
1962
+ return ;
1963
+ }
1964
+
1965
+ if (pulseCycle % 20 < 10 )
1966
+ hintIconSprites [0 ].drawImage (screenPos .x - 12 , screenPos .y - 28 );
1967
+ }
1961
1968
1962
1969
/**
1963
1970
* Project 3d pos to 3d
1964
1971
*/
1965
- public static void getProjectedScreenPosition (int z , int y , int x ) {
1972
+ public static Point2d getProjectedScreenPosition (int z , int y , int x ) {
1966
1973
if (x < 128 || y < 128 || x > 13056 || y > 13056 ) {
1967
- Class44 .anInt1048 = -1 ;
1968
- ISAAC .anInt522 = -1 ;
1969
- return ;
1974
+ return null ;
1970
1975
}
1971
1976
1972
1977
int drawHeight = Scene .getFloorDrawHeight (Player .worldLevel , x , y ) - z ;
@@ -1990,19 +1995,20 @@ public static void getProjectedScreenPosition(int z, int y, int x) {
1990
1995
y = y * cosinePitch + drawHeight * sinePitch >> 16 ;
1991
1996
drawHeight = tmp ;
1992
1997
1993
- // statics to hold entity draw location
1998
+ // TODO (jkm) why don't we draw below y=50?
1994
1999
if (y < 50 ) {
1995
- Class44 .anInt1048 = -1 ;
1996
- ISAAC .anInt522 = -1 ;
1997
- } else {
1998
- if (ScreenController .frameMode == ScreenMode .FIXED ) {
1999
- ISAAC .anInt522 = 256 + (x << 9 ) / y ;
2000
- Class44 .anInt1048 = (drawHeight << 9 ) / y + 167 ;
2001
- } else {
2002
- ISAAC .anInt522 = ScreenController .drawWidth / 2 + (x << 9 ) / y ;
2003
- Class44 .anInt1048 = (drawHeight << 9 ) / y + ScreenController .drawHeight / 2 ;
2004
- }
2000
+ return null ;
2001
+ }
2002
+
2003
+ return new Point2d ((x << 9 ) / y , (drawHeight << 9 ) / y )
2004
+ .add (getScreenMidpoint ());
2005
+ }
2005
2006
2007
+ public static Point2d getScreenMidpoint () {
2008
+ if (ScreenController .frameMode == ScreenMode .FIXED ) {
2009
+ return new Point2d (256 , 167 );
2010
+ } else {
2011
+ return new Point2d (ScreenController .drawWidth / 2 , ScreenController .drawHeight / 2 );
2006
2012
}
2007
2013
}
2008
2014
0 commit comments