#include "GM.h" #include "CBall.h" #include "GU.h" #include "TGame.h" #include "XMATH.h" #define Add2Ptr(PTR, INC, CAST) ((CAST)((uint64)(PTR) + (INC))) #define PI 3.14159274f #define NEGPI -3.14159274f //------------------------------------------------------------------------------------------------- // 0015B0A4 void GM_CheckGoalSide() {} //------------------------------------------------------------------------------------------------- // 0015B340 void GM_CalcPlayerDist() {} //------------------------------------------------------------------------------------------------- // 0015B7C8 void GM_IsOnPitch(TPoint) {} //------------------------------------------------------------------------------------------------- // 0015B7F8 void GM_SwapInt(int &i0, int &i1) { int tmp_r2 = i1; i1 = i0; i0 = tmp_r2; } //------------------------------------------------------------------------------------------------- // 0015B804 int GM_CalcGoalDist(TPoint, int) { return 0; } //------------------------------------------------------------------------------------------------- // 0016E0BC void GM_GetRotPowerTrajectory(TPoint3D pt0, int *i1, int *i2, int *i3) {} //------------------------------------------------------------------------------------------------- // 0016E108 void GM_GetVecFromRotPowerTrajectory(TPoint3D *, int, int, int) {} //------------------------------------------------------------------------------------------------- // 00171E50 void GM_DeflectBallFromDribbler(CPlayer *player, int *i1) { LOGE("%p%pGM_DeflectBallFromDribbler",player,i1); *i1=rand(); } //------------------------------------------------------------------------------------------------- // 00178C7C int GM_CheckInterception(CPlayer *, int, int, int) { return 0; } //------------------------------------------------------------------------------------------------- // 00178D3C void GM_CheckInterceptionPos(CPlayer *, int, int, TPoint *) {} //------------------------------------------------------------------------------------------------- // 00179170 void GM_CheckInterceptionX(CPlayer *, int) {} //------------------------------------------------------------------------------------------------- // 0017918C void GM_CalcPlayerBallInterceptions() {} //------------------------------------------------------------------------------------------------- // 00179A44 int GM_GetPlayerNearestPoint(int i0, TPoint pt1, int i2, int *i3) { return 0; } //------------------------------------------------------------------------------------------------- // 00179AD0 int GM_GetPlayerNearestPoint(int i0, TPoint pt1, int *i2) { LOGE("GM_GetPlayerNearestPoint%d%d%x%p",i0,pt1.dx_0,pt1.dy_4,i2); return rand(); } //------------------------------------------------------------------------------------------------- // 00179B60 void GM_GetPlayerNearestPointF(int, TPoint, int, int, int) {} //------------------------------------------------------------------------------------------------- // 00179BE0 void GM_GetPlayerNearestPointFX(int, TPoint, bool *, int, int, int, int) {} //------------------------------------------------------------------------------------------------- // 00179C80 void GM_GetPlayerNearestPointRange(int, TPoint, bool *, int, int) {} //------------------------------------------------------------------------------------------------- // 00179F90 void GM_GetLineIntersectWeighted(TPoint, TPoint, TPoint, int, int, int *, int *) {} //------------------------------------------------------------------------------------------------- // 0017A04C int GM_GetPlayerFutureNearestLineWeighted(int i0, int i1, bool *b2, TPoint3D tp3d_3, TPoint3D tp3d_6, int i9, int i10, int *pi11, int *pi12) { TPoint3D tp3_SP68; // [sp+68h] [bp-48h] BYREF TPoint3D point3D_sp80=tp3d_3; TPoint3D point3D_sp74=tp3d_6; int distanseR11 = XMATH_Distance(&tp3d_3.point_0, &tp3d_6.point_0) / 2; PlayTeam *allTeam = tGame.allplay_14; int iR9 = 0x7FFFFFFF; uint ui_SP2C = 0; int i_SP30 = -1; uint ui_SP28 = 0x7FFFFFFF; for (int iR1 = 0; iR1 < 2; iR1++) { bool b = i0 == -1; if (i0 != -1) b = iR1 == i0; // if(i0!=-1&&iR1!=i0) if (b) { int maxHeight_SP3C[11]; // [sp+3Ch] [bp-74h] for (int iR6 = 0; iR6 < 11; iR6++) { maxHeight_SP3C[iR6] = allTeam[iR1].teamlist_0[iR6]->GetInterceptMaxHeight(); } for (int iR10 = 0; iR10 != 11; ++iR10) { if (!b2[iR10]) { CPlayer *pPlayerR6 = tGame.allplay_14[iR1].teamlist_0[iR10]; if (!pPlayerR6->tStr32_44.uc_2) { //0017A100 tp3_SP68.point_0.dx_0 = (tp3d_3.point_0.dx_0 + tp3d_6.point_0.dx_0) / 2; tp3_SP68.point_0.dy_4 = (tp3d_6.point_0.dy_4 + tp3d_3.point_0.dy_4) / 2; tp3_SP68.dz_8 = (tp3d_6.dz_8 + tp3d_3.dz_8) / 2; int i_r0=XMATH_Distance(&pPlayerR6->point_98, &tp3_SP68.point_0) ; if ((i_r0 - distanseR11) < iR9) { //0017A13C TPoint tp4_SP34 = pPlayerR6->GetTimePos(i1); int iR8 = (uint)i9 << 10; for (int i = 0; i < 9; i++) { tp3_SP68.point_0.dx_0 = (tp3d_3.point_0.dx_0 / 2 * ((8 - i) * 0x80) + tp3d_6.point_0.dx_0 / 2 * (i * 0x80)) / 512; tp3_SP68.point_0.dy_4 = (tp3d_3.point_0.dy_4 / 2 * ((8 - i) * 0x80) + tp3d_6.point_0.dy_4 / 2 * (i * 0x80)) / 512; tp3_SP68.dz_8 = (tp3d_3.dz_8 / 2 * ((8 - i) * 0x80) + tp3d_6.dz_8 / 2 * (i * 0x80)) / 512; if (maxHeight_SP3C[iR10] >= tp3_SP68.dz_8) { int iR0 = XMATH_Distance(&tp4_SP34, &tp3_SP68.point_0); int ic = iR0 / 1024 * iR8; if (ic < iR9) { ui_SP2C = (i * 0x80); ui_SP28 = iR0; i_SP30 = iR10; iR9 = ic; } } iR8 += (i10 << 7) - (i9 << 7); } } } } } } } if (pi11) *pi11 = XMATH_CalcSqrt(ui_SP28) << 10; if (pi12) *pi12 = ui_SP2C; return i_SP30; } //------------------------------------------------------------------------------------------------- // 0017A24C int GM_GetPlayerFutureNearestLine(int, CPlayer *, TPoint, TPoint, int *, int *) { return 0; } //------------------------------------------------------------------------------------------------- // 0017A340 void GM_GetPlayerTotalSpace(int, int) {} //------------------------------------------------------------------------------------------------- // 0017A510 void GM_GetPointSpace(int, TPoint) {} //------------------------------------------------------------------------------------------------- // 0017A558 void GM_GetPlayerSpaceRot(CPlayer *, int, int, int) {} //------------------------------------------------------------------------------------------------- // 0017A744 void GM_DistanceSq(TPoint const *, TPoint const *) {} //------------------------------------------------------------------------------------------------- // 0017A76A void GM_Distance(TPoint const *, TPoint const *) {} //------------------------------------------------------------------------------------------------- // 0017A796 uint GM_Distance3D(TPoint3D *pt0, TPoint3D *pt1) { return 0; } //------------------------------------------------------------------------------------------------- // 0017A7DA void GM_PlayerLimitDistancePos(CPlayer *Player, TPoint pt1, unsigned int ui2) {} //------------------------------------------------------------------------------------------------- // 0017A810 void GM_PlayerLimitDistance(CPlayer *, int) {} //------------------------------------------------------------------------------------------------- // 0017A858 void GM_PlayerLimitDistancePosPol(CPlayer *, TPoint, int, int) {} //------------------------------------------------------------------------------------------------- // 0017A898 void GM_SetBestPointSpace(int, TPoint *, int, int) {} //------------------------------------------------------------------------------------------------- // 0017A9EC void GM_PointIsBetweenPoints(TPoint, TPoint, TPoint, int) {} //------------------------------------------------------------------------------------------------- // 0017AA3A void GM_TendAngle(int, int) {} //------------------------------------------------------------------------------------------------- // 0017AA88 float GM_BlendAngleF(float f0, float f1, float f2) { return 0.0f; } //------------------------------------------------------------------------------------------------- // 0017AB34 ^_^ float GM_BlendAngleAroundF(float f0, float f1, float f2, float f3) { return 0.0f; } //------------------------------------------------------------------------------------------------- // 0017ABC8 ^_- int GM_BlendAngle(int i0, int i1, int i2) { i0 = i0 & 0x3fff; i1 = i1 & 0x3fff; if (i0 == i1) { // 0017ABD2 return i0; } int r3_i = i0 - i1; int r12_i = 0x100 - i2; if (r3_i < 0) { // 0017ABDE r3_i = -r3_i; } if (r3_i > 0x2000) { // /0017ABE6 if ((uint)i0<=0x1fff) { // 0017ABEE i1 *= i2; i0 |= 0x4000; } else { // loc_17ABF6 i1 |= 0x4000; i1 *= i2; } } else { // loc_17ABFA i1 *= i2; } // loc_17ABFC i0 = r12_i * i0 + i1; i0 = i0 / 256 & 0x3fff; return i0; } //-------------------------------------------------------------------------------------------------