FREE.cpp 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  1. #include "FREE.h"
  2. #include "memctrl.h"
  3. #include "CBall.h"
  4. #include "CFTTPObject.h"
  5. #include "CFTTPPBox.h"
  6. #include "CFTTPPCone.h"
  7. #include "CFTTPPCylinder.h"
  8. #include "CFTTPPPolyhedron.h"
  9. #include "CFTTPPSphere.h"
  10. #include "CFTTPhysics.h"
  11. #include "CModelManager.h"
  12. #include "fpoint.h"
  13. #include "sub.h"
  14. // FREE_tInfo 0x1D20
  15. // FREE_tGoal 0x7634
  16. TFreeInfo FREE_tInfo;
  17. CFTTModel *FREE_pStarModel;
  18. int FREE_iPropWeather;
  19. const char *s_sPropModels_SNOW[3] = {
  20. "PKG:/data/env/dressing/cone_snow.ftm",
  21. "PKG:/data/env/dressing/mannequin_snow.ftm",
  22. "PKG:/data/env/dressing/rebounder.ftm"};
  23. CFTTModel *FREE_pPropModel[3];
  24. const char *s_sPropModels[3] = {"PKG:/data/env/dressing/cone.ftm",
  25. "PKG:/data/env/dressing/mannequin.ftm",
  26. "PKG:/data/env/dressing/rebounder.ftm"};
  27. const char *s_sPropModels_Shadow[3] = {"PKG:/data/env/dressing/cone.ftm",
  28. "PKG:/data/env/dressing/mannequin_s.ftm",
  29. "PKG:/data/env/dressing/rebounder.ftm"};
  30. CFTTModel *FREE_pPropModelShadow[3];
  31. //-------------------------------------------------------------------------------------------------
  32. // 001D2758
  33. int FREE_GetLevelFilename(char *, int, char *, bool &) { return 0; }
  34. //-------------------------------------------------------------------------------------------------
  35. // 001D27EC
  36. void FREE_GetWorldRot(TPoint, TPoint) {}
  37. //-------------------------------------------------------------------------------------------------
  38. // 001D281C
  39. void FREE_CalcKickAngle(TPoint3D *, TPoint3D, TPoint3D, int, int, int *) {}
  40. //-------------------------------------------------------------------------------------------------
  41. // 001D2A98
  42. int FREE_PassCheckPath(CPlayer *, TPoint, TPoint) { return 0; }
  43. //-------------------------------------------------------------------------------------------------
  44. // 001D2BC0
  45. void FREE_ResolveEndPoint(TPoint3D *, TPoint3D *, TPoint *, int *, bool) {}
  46. //-------------------------------------------------------------------------------------------------
  47. // 001D30B8
  48. void FREE_GetKickPower(EAnimID, int *, int *) {}
  49. //-------------------------------------------------------------------------------------------------
  50. // 001D30FC
  51. void FREE_ProcessControls(bool) {}
  52. //-------------------------------------------------------------------------------------------------
  53. // 001D3EC8
  54. int FREE_CalcKickTargetTime(int) { return 0; }
  55. //-------------------------------------------------------------------------------------------------
  56. // 001D3EEC
  57. void FREE_ResetControls() {}
  58. //-------------------------------------------------------------------------------------------------
  59. // 001D3F24
  60. int FREE_PassIsLowKick(TFreeControl *, TPoint3D *, TPoint3D *, int) {
  61. return 0;
  62. }
  63. //-------------------------------------------------------------------------------------------------
  64. // 001D3FA8
  65. void FREE_ControlGetKickLimits(CPlayer *player0, int *pi1, int *pi2, int *pi3) {
  66. int *var_58 = pi1;
  67. int *var_54 = pi2;
  68. int *var_50 = pi3;
  69. int var_2C = 0;
  70. int var_28 = 0;
  71. TPoint3D var_38;
  72. TPoint3D var_48;
  73. int r0_i = player0->tStr32_44.field_10;
  74. FREE_GetKickPower((EAnimID)r0_i, &var_28, &var_2C);
  75. var_28 = 100;
  76. int r4_i = 21627;
  77. var_48.point_0.dy_4 = XMATH_InterpolateClamp(100, 0, 1600, 0, r4_i);
  78. r0_i = XMATH_InterpolateClamp(var_2C, 0, 1600, 0, r4_i);
  79. // 001D3FF0
  80. if (r0_i < r4_i) {
  81. // 001D3FF4
  82. r4_i = r0_i;
  83. }
  84. // 001D3FF6
  85. var_48.dz_8 = r4_i;
  86. r0_i = 0;
  87. int r7_i = 163840;
  88. int r6_i = 0;
  89. r4_i = 0;
  90. var_48.point_0.dx_0 = r0_i;
  91. int r1_i;
  92. // loc_1D40EA
  93. while (r7_i != 1998848) {
  94. // loc_1D4006
  95. int r2_i = FREE_CalcKickTargetTime(r7_i);
  96. int r9_i = 4096;
  97. // r5 = cball
  98. int r8_i = cBall.ballPosPrev_4.point_0.dx_0;
  99. int r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  100. int r10_i = r7_i + r3_i;
  101. // 356A7C - 0x356A70
  102. r0_i = cBall.ballPosPrev_4.dz_8;
  103. int var_3C = r6_i;
  104. int r11_i;
  105. // 001D4024
  106. if (r0_i < 32768) {
  107. // 001D402A
  108. TPoint3D tp1;
  109. // int var_4C = r2_i;
  110. tp1.point_0.dx_0 = r8_i;
  111. tp1.point_0.dy_4 = r3_i;
  112. tp1.dz_8 = r0_i;
  113. TPoint3D tp2;
  114. tp2.point_0.dx_0 = r8_i;
  115. tp2.point_0.dy_4 = r10_i;
  116. tp2.dz_8 = r9_i;
  117. /*
  118. * 描述:此处在连续入栈时STRD和STM有出入
  119. * 原始汇编: STMEA.W SP, {R0,R8,R10}
  120. * 自已汇编: STRD.W R10, R8, [SP,#0x78+var_78]
  121. */
  122. int var_4C = r2_i;
  123. r0_i = cBall.SetBallMoveToPosLow(&var_38, tp1, tp2, r2_i, -1);
  124. r11_i = r7_i;
  125. r1_i = var_48.point_0.dx_0;
  126. // 001D404A
  127. if (r0_i < var_48.dz_8) {
  128. // 001D4050
  129. r1_i = r7_i;
  130. }
  131. var_48.point_0.dx_0 = r1_i;
  132. r1_i = var_48.point_0.dy_4;
  133. // 001D4056
  134. if (r0_i < r1_i) {
  135. // 001D405A
  136. r11_i = r4_i;
  137. }
  138. // 001D405C
  139. if (r4_i != 0) {
  140. // 001D4060
  141. r11_i = r4_i;
  142. }
  143. // 001D4062
  144. r2_i = cBall.ballPosPrev_4.point_0.dx_0;
  145. r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  146. r1_i = r8_i;
  147. r0_i = cBall.ballPosPrev_4.dz_8;
  148. r8_i = r2_i;
  149. r2_i = var_4C;
  150. } else {
  151. // loc_1D4070
  152. r1_i = r8_i;
  153. r11_i = r4_i;
  154. }
  155. // 001D4076
  156. TPoint3D var_78;
  157. var_78.point_0.dx_0 = r8_i;
  158. var_78.point_0.dy_4 = r3_i;
  159. var_78.dz_8 = r0_i;
  160. TPoint3D var_6C;
  161. var_6C.point_0.dx_0 = r1_i;
  162. var_6C.point_0.dy_4 = r10_i;
  163. var_6C.dz_8 = r9_i;
  164. r4_i = r2_i;
  165. int r5_i =
  166. cBall.SetBallMoveToPosSpin(&var_38, 0, -2000, var_78, var_6C, r2_i, 0);
  167. r0_i = r0_i * 2;
  168. r1_i = (uint)r0_i / (uint)5u;
  169. // r0_i = var_38.dz_8 ;
  170. r0_i = r7_i;
  171. // 001D40A4
  172. if (var_38.dz_8 > r1_i) {
  173. // 001D40AA
  174. r5_i = XMATH_Mag3D(&var_38);
  175. r0_i = var_38.dz_8;
  176. r0_i = r0_i / 49;
  177. r0_i = r0_i * r7_i;
  178. r0_i = r0_i / r4_i;
  179. } // loc_1D40C4
  180. r4_i = r0_i;
  181. r1_i = var_48.point_0.dy_4;
  182. r7_i += 32768;
  183. // 001D40CC
  184. if (r5_i < r1_i) {
  185. // 001D40D0
  186. r4_i = r11_i;
  187. }
  188. // 001D40D2
  189. if (r11_i != 0) {
  190. // 001D40D8
  191. r4_i = r11_i;
  192. }
  193. r6_i = var_3C;
  194. // 001D40DC
  195. if (r0_i <= r6_i) {
  196. // 001D40E0
  197. r0_i = r6_i;
  198. }
  199. r1_i = var_48.dz_8;
  200. // 001D40EA
  201. if (r5_i < r1_i) {
  202. // 001D40E8
  203. r6_i = r0_i;
  204. }
  205. } // loc_1D4006
  206. r0_i = r4_i << 1u;
  207. r1_i = 3;
  208. r0_i = r0_i / r1_i;
  209. int *r1_pi = var_58;
  210. *r1_pi = r0_i;
  211. r1_i = var_48.point_0.dx_0;
  212. // 001D40EA
  213. if (r1_i >= 1146880) {
  214. // 001D40F0
  215. r1_i = 1146880;
  216. }
  217. *var_54 = r1_i;
  218. *var_50 = r6_i;
  219. }
  220. //-------------------------------------------------------------------------------------------------
  221. // 001D4120
  222. void FREE_Init() {}
  223. //-------------------------------------------------------------------------------------------------
  224. // 001D4160
  225. void FREE_Shutdown() {}
  226. //-------------------------------------------------------------------------------------------------
  227. // 001D41B0
  228. void FREE_InitGoal(int, bool, bool, bool) {}
  229. //-------------------------------------------------------------------------------------------------
  230. // 001D4318
  231. void FREE_SetupDifficulty() {}
  232. //-------------------------------------------------------------------------------------------------
  233. // 001D4424
  234. void FREE_Initialise() {}
  235. //-------------------------------------------------------------------------------------------------
  236. // 001D49C0
  237. void FREE_UpdateCamera(bool) {}
  238. //-------------------------------------------------------------------------------------------------
  239. // 001D56CC
  240. void FREE_ClipPathBounds(TPoint3D *, TPoint3D *, int, int, int, int) {}
  241. //-------------------------------------------------------------------------------------------------
  242. // 001D5718
  243. // void FREE_GameLoop() {
  244. // int r0_i = 0;
  245. // int r1_i = 0;
  246. // int r2_i = 0;
  247. // // 001D571E
  248. // if (NIS_Active() != 0) {
  249. // // 001D5720
  250. // // NIS_GameLoop();
  251. // CFreeHUD::Process();
  252. // // 47F7D8 - 0x47DFB0
  253. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  254. // // 001D5734
  255. // if (r0_i == 6) {
  256. // // 001D5738
  257. // FREE_ProcessFail();
  258. // r1_i = FREE_tInfo.filed_0.field_182C;
  259. // r1_i = r1_i + 1;
  260. // FREE_tInfo.filed_0.field_182C = r1_i;
  261. // return;
  262. // } else {
  263. // // locret_1D582E
  264. // return;
  265. // }
  266. // }
  267. // // loc_1D5748
  268. // // 47F7D8 - 0x47DFB0 = 1828
  269. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  270. // // 001D5754
  271. // if (r0_i != 8) {
  272. // // 001D5758
  273. // tGame.maybe_sound_0++;
  274. // }
  275. // // loc_1D5764
  276. // // 004877F5
  277. // NISGOAL_tInfo.field_1 = 0;
  278. // // 47DFB1 - 0x47DFB0
  279. // FREE_tInfo.filed_0.b_1 = 1;
  280. // // 001D5776
  281. // if (CReplay::Playing() != 0) {
  282. // // 001D5778
  283. // CReplay::Play();
  284. // }
  285. // // loc_1D577C
  286. // // 47F7D8 - 0x47DFB0
  287. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  288. // // 001D5782
  289. // if (r0_i == 7) {
  290. // // 47F7DC - 0x47DFB0
  291. // r1_i = FREE_tInfo.filed_0.field_182C;
  292. // // 3A27BC - 0x39BB88
  293. // r2_i = tGame.field_6C34;
  294. // // 001D5798
  295. // if (r2_i < r1_i) {
  296. // // 001D579C
  297. // r0_i = tGame.mTLogic_6678.field_50;
  298. // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  299. // if (r1_i == r0_i) {
  300. // // 001D57C6
  301. // CGFXFX::EnableStarPlayerEffects();
  302. // }
  303. // } else {
  304. // // loc_1D57B0
  305. // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  306. // r1_i = FREE_tInfo.filed_0.field_1830;
  307. // if (r1_i == r0_i) {
  308. // // 001D57C6
  309. // CGFXFX::EnableStarPlayerEffects();
  310. // }
  311. // }
  312. // }
  313. // // loc_1D57CA
  314. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  315. // float r0_f = 0.01666666753590107;
  316. // CGFXFX::Update(r0_f);
  317. // GFXCAMERA_ApplyIngameSettings(-1, -1);
  318. // GFXCAMERA_UpdateMatrices();
  319. // int r4_i = FREE_ProcessLogic();
  320. // // 47FC60 - 0x47DFB0
  321. // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
  322. // // 001D57F2
  323. // if (r4_i != 0) {
  324. // // 001D57F8
  325. // if (CReplay::Playing() != 0) {
  326. // // loc_1D57FA
  327. // CAM_Update();
  328. // return;
  329. // }
  330. // } else {
  331. // // loc_1D57FA
  332. // CAM_Update();
  333. // return;
  334. // }
  335. // // loc_1D5802
  336. // // 3A2208 - 0x39BB88
  337. // r0_i = tGame.mTLogic_6678.field_8;
  338. // // 001D580E
  339. // if (r0_i == 2) {
  340. // // 001D5812
  341. // // 3A2238 - 0x39BB88
  342. // r0_i = tGame.mTLogic_6678.field_38;
  343. // // 001D5818
  344. // if (r0_i <= 29) {
  345. // // 001D581C
  346. // CReplay::RecordFrame();
  347. // }
  348. // } else {
  349. // // loc_1D5822
  350. // CReplay::RecordFrame();
  351. // }
  352. // // loc_1D5826
  353. // // 3A22A0 - 0x39BB88
  354. // r0_i = tGame.mTLogic_6678.field_A0;
  355. // // 001D582C
  356. // if (r0_i != 0) {
  357. // // locret_1D582E
  358. // return;
  359. // }
  360. // // loc_1D5830
  361. // CPlayerManager::UpdatePlayersLogic();
  362. // FREE_CheckCollision();
  363. // cBall.UpdateFrame();
  364. // // 47F7D8 - 0x47DFB0
  365. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  366. // // 001D584A
  367. // if (r0_i != 4) {
  368. // // 001D584E
  369. // COL_PlayerCollisions();
  370. // }
  371. // // 001D5852
  372. // PhysicsTest();
  373. // cBall.CheckEvents();
  374. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  375. // GFXNET::Update(0.01666666753590107f);
  376. // GL_UpdatePlayMode();
  377. // GM_CalcPlayerDist();
  378. // GM_CalcPlayerBallInterceptions();
  379. // FREE_LogicProcess();
  380. // // 3A2204 - 0x39BB88
  381. // r0_i = (uchar)tGame.mTLogic_6678.field_4;
  382. // // 001D5878
  383. // if (r0_i == 0) {
  384. // // 001D587C
  385. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  386. // // 001D5882
  387. // if (r0_i >= 4) {
  388. // // 001D5886
  389. // CPlayerManager::UpdatePlayers();
  390. // }
  391. // // 001D588A
  392. // COMM_Process();
  393. // }
  394. // // loc_1D57FA
  395. // CAM_Update();
  396. // return;
  397. // }
  398. //-------------------------------------------------------------------------------------------------
  399. // 001D58B4
  400. void FREE_StoreRewindState() {}
  401. //-------------------------------------------------------------------------------------------------
  402. // 001D5A3E
  403. void FREE_UpdateRewindState() {}
  404. //-------------------------------------------------------------------------------------------------
  405. // 001D5A40
  406. void FREE_RestoreRewindState() {}
  407. //-------------------------------------------------------------------------------------------------
  408. // 001D5AE4
  409. void FREE_BeginRewind() {}
  410. //-------------------------------------------------------------------------------------------------
  411. // 001D5B30
  412. int FREE_RewindFrame() { return 0; }
  413. //-------------------------------------------------------------------------------------------------
  414. // 001D5C0C
  415. void FREE_ClipPathBounds(TPoint *, TPoint *, int, int, int, int) {}
  416. //-------------------------------------------------------------------------------------------------
  417. // 001D656C
  418. void FREE_IdleProcess() {}
  419. //-------------------------------------------------------------------------------------------------
  420. // 001D66F0
  421. void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
  422. //-------------------------------------------------------------------------------------------------
  423. // 001D6778
  424. void FREE_LogicProcess() {}
  425. //-------------------------------------------------------------------------------------------------
  426. // 001D67E8
  427. int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
  428. //-------------------------------------------------------------------------------------------------
  429. // 001D6918
  430. void FREE_ProcessShotAnim(CPlayer *) {}
  431. //-------------------------------------------------------------------------------------------------
  432. // 001D6CD8
  433. void FREE_ProcessUserTeam() {}
  434. //-------------------------------------------------------------------------------------------------
  435. // 001D7D74
  436. void FREE_ProcessOppoTeam() {}
  437. //-------------------------------------------------------------------------------------------------
  438. // 001D848C
  439. void FREE_ProcessFree() {}
  440. //-------------------------------------------------------------------------------------------------
  441. // 001D86C4
  442. void FREE_ProcessFail() {}
  443. //-------------------------------------------------------------------------------------------------
  444. // 001D8884
  445. void FREE_PlayCommentaryClearance() {}
  446. //-------------------------------------------------------------------------------------------------
  447. // 001D8944
  448. void FREE_PlayCommentaryInterception() {}
  449. //-------------------------------------------------------------------------------------------------
  450. // 001D8998
  451. void FREE_SetupKickAction(TPoint3D, int, int) {}
  452. //-------------------------------------------------------------------------------------------------
  453. // 001D8AD0
  454. void FREE_CheckGKHandPos(CPlayer *, int) {}
  455. //-------------------------------------------------------------------------------------------------
  456. // 001D8B9C
  457. int FREE_SetupPhaseTransition(bool) { return 0; }
  458. //-------------------------------------------------------------------------------------------------
  459. // 001D8DB4
  460. int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
  461. //-------------------------------------------------------------------------------------------------
  462. // 001D8E68
  463. void FREE_ProcessInProgressCore() {}
  464. //-------------------------------------------------------------------------------------------------
  465. // 001D956C
  466. void FREE_UpdateSuccess() {}
  467. //-------------------------------------------------------------------------------------------------
  468. // 001D96E4
  469. int FREE_ProcessLogic() { return 0; }
  470. //-------------------------------------------------------------------------------------------------
  471. // 001DA0A8
  472. void FREE_PlayCommentaryPassReceive() {}
  473. //-------------------------------------------------------------------------------------------------
  474. // 001DA208
  475. void FREE_PlayCommentaryKick() {}
  476. //-------------------------------------------------------------------------------------------------
  477. // 001DA484
  478. void FREE_SetComplete() {}
  479. //-------------------------------------------------------------------------------------------------
  480. // 001DA5C0
  481. void FREE_PlayersUpset(int) {}
  482. //-------------------------------------------------------------------------------------------------
  483. // 001DA620
  484. void FREE_PlayersCelebrate() {}
  485. //-------------------------------------------------------------------------------------------------
  486. // 001DA670
  487. void FREE_CheckCollision() {}
  488. //-------------------------------------------------------------------------------------------------
  489. // 001DA674
  490. //^_^
  491. void FREE_InitProps(void) {}
  492. //-------------------------------------------------------------------------------------------------
  493. // 001DA730
  494. void FREE_UpdateProps() {}
  495. //-------------------------------------------------------------------------------------------------
  496. // 001DA764
  497. void FREE_ShutdownProps() {}
  498. //-------------------------------------------------------------------------------------------------
  499. // 001DA7A4
  500. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  501. //-------------------------------------------------------------------------------------------------
  502. // 001DA7BC
  503. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  504. //-------------------------------------------------------------------------------------------------
  505. // 001DA7D4
  506. void FREE_RenderPropShadows() {}
  507. //-------------------------------------------------------------------------------------------------
  508. // 001DA8C0
  509. void FREE_RenderProps() {}
  510. //-------------------------------------------------------------------------------------------------
  511. // 001DA9AC
  512. void FREE_ProcessPropCollision(TFreeProp *) {}
  513. //-------------------------------------------------------------------------------------------------
  514. // 001DA9AE
  515. void FREE_ProcessPropCollisions() {}
  516. //-------------------------------------------------------------------------------------------------
  517. // 001DA9B0
  518. //^_^
  519. void FREE_RenderInitOnce() {}
  520. //-------------------------------------------------------------------------------------------------
  521. // 001DA9E0
  522. void FREE_RenderShutdownOnce() {}
  523. //-------------------------------------------------------------------------------------------------
  524. // 001DAA00
  525. void FREE_RenderInit() {}
  526. //-------------------------------------------------------------------------------------------------
  527. // 001DAAAC
  528. void FREE_RenderShutdown() {}
  529. //-------------------------------------------------------------------------------------------------
  530. // 001DAAF4
  531. void FREE_RenderListBegin(char const *, bool, bool) {}
  532. //-------------------------------------------------------------------------------------------------
  533. // 001DAB84
  534. void FREE_RenderListEnd() {}
  535. //-------------------------------------------------------------------------------------------------
  536. // 001DABD4
  537. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  538. //-------------------------------------------------------------------------------------------------
  539. // 001DAC40
  540. void FREE_RenderStar(TPoint3D, float, float) {}
  541. //-------------------------------------------------------------------------------------------------
  542. // 001DACE4
  543. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  544. //-------------------------------------------------------------------------------------------------
  545. // 001DAEEC
  546. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  547. //-------------------------------------------------------------------------------------------------
  548. // 001DB0BC
  549. void FREE_RenderRangeCone() {}
  550. //-------------------------------------------------------------------------------------------------
  551. // 001DB3CC
  552. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  553. //-------------------------------------------------------------------------------------------------
  554. // 001DB5C0
  555. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  556. //-------------------------------------------------------------------------------------------------
  557. // 001DB9C8
  558. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  559. //-------------------------------------------------------------------------------------------------
  560. // 001DBBCC
  561. void FREE_Render3DOpaque() {}
  562. //-------------------------------------------------------------------------------------------------
  563. // 001DBBF0
  564. void FREE_RenderHeroPlayer(bool) {}
  565. //-------------------------------------------------------------------------------------------------
  566. // 001DBEEC
  567. void FREE_Render3DDecal() {}
  568. //-------------------------------------------------------------------------------------------------
  569. // 001DBFC4
  570. void FREE_RenderPreSelectedPlayer() {}
  571. //-------------------------------------------------------------------------------------------------
  572. // 001DC0E0
  573. void FREE_RenderProcess() {}
  574. //-------------------------------------------------------------------------------------------------
  575. // 001DC0E4
  576. void FREE_AddVisualFeedback(int, EVFEffect, int) {}
  577. //-------------------------------------------------------------------------------------------------
  578. // 001DC290
  579. void FREE_AddVisualFeedback_Pass() {}
  580. //-------------------------------------------------------------------------------------------------
  581. // 001DC354
  582. void FREE_AddVisualFeedback_Goal() {}
  583. //-------------------------------------------------------------------------------------------------
  584. // 001DC440
  585. void FREE_AddVisualFeedback_Fail() {}
  586. //-------------------------------------------------------------------------------------------------
  587. // 001DC494
  588. void FREE_AddVisualFeedback_Offside() {}
  589. //-------------------------------------------------------------------------------------------------
  590. // 001DC4C8
  591. void FREE_SortPlayers(TFreeGoal *) {}
  592. //-------------------------------------------------------------------------------------------------
  593. // 001DC664
  594. void FREE_SortPlayersDistance(TFreeGoal *) {}
  595. //-------------------------------------------------------------------------------------------------
  596. // 001DC848
  597. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  598. //-------------------------------------------------------------------------------------------------
  599. // 001DC888
  600. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  601. //-------------------------------------------------------------------------------------------------
  602. // 001DCA14
  603. void FREE_ReadXMLLevel(TFreeGoal *, CFTTXmlReaderNode) {}
  604. //-------------------------------------------------------------------------------------------------
  605. // 00169A80 ^_-
  606. //单元测试等级: 游戏运行正常
  607. //单元测试内容: 1-10关
  608. //单元测试结果: 正常
  609. void PhysicsTest() {
  610. LOGE("PhysicsTest_0");//OK
  611. fpointQ<PointType_18> fpointq_sp240;
  612. fpointq_sp240.field_0 = 0;
  613. fpointq_sp240.field_4 = 0;
  614. fpointq_sp240.field_8 = 0;
  615. fpointq_sp240.field_C = 0x40000;
  616. fpoint3<PointType_18> fpoint3_sp25c;
  617. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  618. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  619. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  620. CFTTPObject *r6_pobject = new CFTTPObject(
  621. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  622. r6_pobject->fpoint3_1C.x_0 =
  623. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  624. r6_pobject->fpoint3_1C.y_4 =
  625. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  626. r6_pobject->fpoint3_1C.z_8 =
  627. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  628. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  629. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  630. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  631. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  632. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  633. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  634. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  635. r6_pobject->field_34 = 0x94D65;
  636. r6_pobject->field_38 = 0x37D2A4D;
  637. fpoint<PointType_18> fpoint_sp23c;
  638. fpoint3<PointType_18> fpoint3_sp230;
  639. fpointQ<PointType_18> fpointQ_sp220;
  640. fpointQ_sp220.field_0 = 0;
  641. fpointQ_sp220.field_4 = 0;
  642. fpointQ_sp220.field_8 = 0;
  643. fpointQ_sp220.field_C = 0x40000;
  644. fpoint3_sp230.x_0 = 0;
  645. fpoint3_sp230.y_4 = 0;
  646. fpoint3_sp230.z_8 = 0;
  647. fpoint_sp23c.var_0 = 0x8000;
  648. // check 传参是否都是用了栈
  649. CFTTPPSphere *r0_psphere =
  650. new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230, fpointQ_sp220);//这里头文件更新
  651. // 00169B60
  652. r6_pobject->field_3C = 0x8000;
  653. r0_psphere->field_64 = 0x8000;
  654. r6_pobject->field_44 = 0x10000;
  655. r6_pobject->field_40 = 0x40000;
  656. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  657. r0_psphere->filed_4 = r6_pobject;
  658. // sp1c=r6_pobject
  659. CFTTPhysics physics_sp218(0x40);
  660. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  661. // 00169B98
  662. pfpoint3_sp34[14].z_8 = 0;
  663. pfpoint3_sp34[15].x_0 = 0;
  664. pfpoint3_sp34[15].y_4 = 0;
  665. pfpoint3_sp34[15].z_8 = 0;
  666. pfpoint3_sp34[13].z_8 = 0;
  667. pfpoint3_sp34[14].x_0 = 0;
  668. pfpoint3_sp34[14].y_4 = 0;
  669. pfpoint3_sp34[14].z_8 = 0;
  670. pfpoint3_sp34[12].y_4 = 0;
  671. pfpoint3_sp34[12].z_8 = 0;
  672. pfpoint3_sp34[13].x_0 = 0;
  673. pfpoint3_sp34[13].y_4 = 0;
  674. // 00169C06
  675. pfpoint3_sp34[11].x_0 = 0;
  676. pfpoint3_sp34[11].y_4 = 0;
  677. pfpoint3_sp34[11].z_8 = 0;
  678. pfpoint3_sp34[12].x_0 = 0;
  679. // 00169C16
  680. pfpoint3_sp34[1].y_4 = 0x20000;
  681. pfpoint3_sp34[2].z_8 = 0x3333;
  682. pfpoint3_sp34[2].x_0 = 0x18000;
  683. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  684. // 00169C2C
  685. pfpoint3_sp34[2].z_8 = 0x3333;
  686. pfpoint3_sp34[3].x_0 = 0x10000;
  687. pfpoint3_sp34[3].y_4 = 0x72AAA;
  688. pfpoint3_sp34[3].z_8 = 0x3333;
  689. // 00169C34
  690. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  691. pfpoint3_sp34[4].y_4 = 0x72AAA;
  692. pfpoint3_sp34[4].z_8 = 0x3333;
  693. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  694. // 00169C3C
  695. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  696. pfpoint3_sp34[4].z_8 = 0x3333;
  697. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  698. pfpoint3_sp34[5].y_4 = 0x20000;
  699. // 00169C44
  700. pfpoint3_sp34[5].z_8 = 0x3333;
  701. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  702. pfpoint3_sp34[6].y_4 = 0;
  703. pfpoint3_sp34[6].z_8 = 0x3333;
  704. // 00169C4C
  705. pfpoint3_sp34[7].x_0 = 0x10000;
  706. pfpoint3_sp34[7].y_4 = 0;
  707. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  708. pfpoint3_sp34[7].x_0 = 0x18000;
  709. // 00169C5A
  710. pfpoint3_sp34[7].y_4 = 0x20000;
  711. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  712. pfpoint3_sp34[8].x_0 = 0x18000;
  713. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  714. // 00169C60
  715. pfpoint3_sp34[0].x_0 = 0x10000;
  716. pfpoint3_sp34[0].y_4 = 0;
  717. pfpoint3_sp34[0].z_8 = 0x3333;
  718. pfpoint3_sp34[1].x_0 = 0x18000;
  719. // 00169C68
  720. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  721. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  722. pfpoint3_sp34[15].y_4 = 0;
  723. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  724. // 00169C6C
  725. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  726. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  727. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  728. pfpoint3_sp34[14].y_4 = 0x20000;
  729. // 00169C74
  730. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  731. pfpoint3_sp34[12].y_4 = 0x72AAA;
  732. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  733. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  734. // 00169C7C
  735. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  736. pfpoint3_sp34[11].x_0 = 0x10000;
  737. pfpoint3_sp34[11].y_4 = 0x72AAA;
  738. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  739. // sp48=FREE_tInfo
  740. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  741. // 00169C90
  742. // loc_16A21E
  743. LOGE("PhysicsTest_case");
  744. for (int r2_i = 0;
  745. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  746. r2_i++) {
  747. // loc_169CC0
  748. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  749. .m_iType_C) {
  750. case 0: // loc_169EC0
  751. {
  752. // check 手机左移
  753. // sp4c = r2
  754. // check 运算
  755. LOGE("PhysicsTest_case_0");
  756. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  757. .m_iRot_10 *
  758. 0x40000 / 0xB4;
  759. uint64 r3r1_ull = 0x3243F4000;
  760. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  761. int r4_i = r1r0_ll / 2;
  762. int i_sp1b0;
  763. int i_sp214 = r4_i;
  764. sub_16A57C(i_sp1b0, i_sp214);
  765. sub_16A6CC(i_sp214, r4_i);
  766. fpoint3<PointType_18> fpoint3_spc0;
  767. fpointQ<PointType_18> fpointQ_spb0;
  768. // check 乘法
  769. fpoint3_spc0.x_0 =
  770. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  771. .m_tPoint3D_0.point_0.dx_0 *
  772. 8;
  773. fpoint3_spc0.y_4 =
  774. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  775. .m_tPoint3D_0.dz_8 *
  776. 8;
  777. fpoint3_spc0.z_8 =
  778. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  779. .m_tPoint3D_0.point_0.dy_4 *
  780. 8;
  781. fpointQ_spb0.field_0 = 0;
  782. fpointQ_spb0.field_4 = i_sp1b0;
  783. fpointQ_spb0.field_8 = 0;
  784. fpointQ_spb0.field_C = i_sp214;
  785. CFTTPObject *r4_pobject = new CFTTPObject(
  786. EPhysicsObjectType_2,
  787. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  788. .m_iType_C,
  789. 2, fpoint3_spc0, fpointQ_spb0);
  790. // 00169F5C
  791. r4_pobject->field_34 = 0;
  792. r4_pobject->field_38 = 0;
  793. r4_pobject->field_3C = 0x40000;
  794. r4_pobject->field_40 = 0x4000; // dword_16A448
  795. r4_pobject->field_44 = 0x20000;
  796. fpoint<PointType_18> fpoint_spac;
  797. fpoint<PointType_18> fpoint_spa8;
  798. fpoint<PointType_18> fpoint_spa4;
  799. fpoint3<PointType_18> fpoint3_sp98;
  800. fpointQ<PointType_18> fpointQ_sp80;
  801. fpoint3_sp98.x_0 = 0;
  802. fpoint_spac.var_0 = 0x3333;
  803. fpoint_spa8.var_0 = 0x6666;
  804. fpoint_spa4.var_0 = 0x15555;
  805. fpointQ_sp80.field_0 = 0;
  806. fpointQ_sp80.field_4 = 0;
  807. fpointQ_sp80.field_8 = 0;
  808. fpointQ_sp80.field_C = 0x40000;
  809. fpoint3_sp98.y_4 = 0xEAAA;
  810. fpoint3_sp98.z_8 = 0;
  811. // fpointQ_sp80
  812. CFTTPPCone *r5_pcone =
  813. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  814. fpoint3_sp98, fpointQ_sp80);
  815. fpoint3<PointType_18> fpoint3_sp74;
  816. fpoint3<PointType_18> fpoint3_sp68;
  817. fpointQ<PointType_18> fpointQ_sp50;
  818. fpoint3_sp74.x_0 = 0xCCCC;
  819. fpointQ_sp50.field_0 = 0;
  820. fpointQ_sp50.field_4 = 0;
  821. fpointQ_sp50.field_8 = 0;
  822. fpointQ_sp50.field_C = 0x40000;
  823. fpoint3_sp74.y_4 = 0x4000;
  824. fpoint3_sp74.z_8 = 0xCCCC;
  825. fpoint3_sp68.x_0 = 0;
  826. fpoint3_sp68.y_4 = 0x2000;
  827. fpoint3_sp68.z_8 = 0;
  828. CFTTPPBox *r0_pbox =
  829. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  830. r5_pcone->field_64 = 0x15555;
  831. r0_pbox->field_64 = 0xCCCC;
  832. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  833. r0_pbox->filed_4 = r4_pobject;
  834. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  835. r5_pcone->filed_4 = r4_pobject;
  836. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  837. r4_pobject;
  838. break;
  839. }
  840. case 2: // loc_16A030
  841. {
  842. LOGE("PhysicsTest_case_2");
  843. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  844. .m_iRot_10 *
  845. 0x40000 / 0xB4;
  846. uint64 r3r1_ull = 0x3243F4000;
  847. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  848. int r4_i = r1r0_ll / 2;
  849. int i_sp214;
  850. int i_sp1b0 = r4_i;
  851. sub_16A57C(i_sp214, i_sp1b0);
  852. int i_sp210;
  853. i_sp1b0 = r4_i;
  854. sub_16A6CC(i_sp210, i_sp1b0);
  855. // sp40=i_sp210
  856. // sp3c=sp214
  857. fpoint3<PointType_18> fpoint3_sp154;
  858. fpoint3<PointType_18> fpoint3_sp148;
  859. fpointQ<PointType_18> fpointQ_sp138;
  860. fpointQ<PointType_18> fpointQ_sp1b0;
  861. fpoint3_sp154.x_0 = 0x70000;
  862. fpoint3_sp154.y_4 = 0x20000;
  863. fpoint3_sp154.z_8 = 0x6666;
  864. fpointQ_sp1b0.field_0 = 0x3333;
  865. fpointQ_sp1b0.field_4 = 0;
  866. fpointQ_sp1b0.field_8 = 0;
  867. fpointQ_sp1b0.field_C = 0x40000;
  868. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  869. CFTTPPBox *pbox_sp38 =
  870. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  871. // 0016A0DC
  872. pbox_sp38->field_64 = 0x70000;
  873. fpoint3<PointType_18> fpoint3_sp12c;
  874. fpoint3<PointType_18> fpoint3_sp120;
  875. fpointQ<PointType_18> fpointQ_sp110;
  876. fpoint3_sp120.x_0 = 0xFFFD0000;
  877. fpoint3_sp12c.x_0 = 0x6666;
  878. fpoint3_sp12c.y_4 = 0x20000;
  879. fpoint3_sp12c.z_8 = 0x15555;
  880. fpoint3_sp120.y_4 = 0x10000;
  881. fpoint3_sp120.z_8 = 0xAAAA;
  882. fpointQ_sp1b0.field_0 = 0x3333;
  883. fpointQ_sp1b0.field_4 = 0;
  884. fpointQ_sp1b0.field_8 = 0;
  885. fpointQ_sp1b0.field_C = 0x40000;
  886. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  887. // 0016A120
  888. CFTTPPBox *r4_pbox =
  889. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  890. // 0016A122
  891. fpoint3<PointType_18> fpoint3_sp104;
  892. fpoint3<PointType_18> fpoint3_spf8;
  893. fpointQ<PointType_18> fpointQ_spe8;
  894. fpoint3_sp104.x_0 = 0x6666;
  895. fpoint3_sp104.y_4 = 0x20000;
  896. fpoint3_sp104.z_8 = 0x15555;
  897. fpoint3_spf8.x_0 = 0x30000;
  898. fpoint3_spf8.y_4 = 0x10000;
  899. fpoint3_spf8.z_8 = 0xAAAA;
  900. fpointQ_sp1b0.field_0 = 0x3333;
  901. fpointQ_sp1b0.field_4 = 0;
  902. fpointQ_sp1b0.field_8 = 0;
  903. fpointQ_sp1b0.field_C = 0x40000;
  904. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  905. // 0016A164
  906. CFTTPPBox *r6_pbox =
  907. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  908. // 0016A166
  909. r4_pbox->field_64 = 0x15555;
  910. r6_pbox->field_64 = 0x15555;
  911. fpoint3<PointType_18> fpoint3_spdc;
  912. fpointQ<PointType_18> fpointQ_spcc;
  913. fpointQ_spcc.field_4 = i_sp214;
  914. fpointQ_spcc.field_C = i_sp210;
  915. fpoint3_spdc.x_0 =
  916. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  917. .m_tPoint3D_0.point_0.dx_0 *
  918. 8;
  919. fpoint3_spdc.z_8 =
  920. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  921. .m_tPoint3D_0.point_0.dy_4 *
  922. 8;
  923. fpoint3_spdc.y_4 =
  924. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  925. .m_tPoint3D_0.dz_8 *
  926. 8;
  927. fpointQ_spcc.field_0 = 0;
  928. fpointQ_spcc.field_8 = 0;
  929. CFTTPObject *r0_pobject = new CFTTPObject(
  930. EPhysicsObjectType_2,
  931. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  932. .m_iType_C,
  933. 3, fpoint3_spdc, fpointQ_spcc);
  934. //0016A1B0
  935. r0_pobject->field_34=0;
  936. r0_pobject->field_38=0;
  937. r0_pobject->field_3C=0x70000;
  938. r0_pobject->field_40=0x30000;
  939. r0_pobject->field_44=0x4000;
  940. r0_pobject->field_A0=0x18;
  941. r0_pobject->pprimitive_98[r0_pobject->uc_9C++]=pbox_sp38;
  942. pbox_sp38->filed_4=r0_pobject;
  943. r0_pobject->pprimitive_98[r0_pobject->uc_9C++]=r4_pbox;
  944. r4_pbox->filed_4=r0_pobject;
  945. r0_pobject->pprimitive_98[r0_pobject->uc_9C++]=r6_pbox;
  946. r6_pbox->filed_4=r0_pobject;
  947. physics_sp218.ppobject_0[physics_sp218.object_counts_4++]=r0_pobject;
  948. break;
  949. }
  950. case 1: // 00169CDA
  951. {
  952. // sp4c = r2
  953. // check 运算
  954. LOGE("PhysicsTest_case_1");
  955. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  956. .m_iRot_10 *
  957. 0x40000 / 0xB4;
  958. uint64 r3r1_ull = 0x3243F4000;
  959. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  960. int r4_i = r1r0_ll / 2;
  961. int i_sp214;
  962. int i_sp210;
  963. sub_16A57C(i_sp214, r4_i);
  964. sub_16A6CC(i_sp210, r4_i);
  965. fpoint3<PointType_18> fpoint3_sp204;
  966. fpointQ<PointType_18> fpointQ_sp1f4;
  967. fpointQ_sp1f4.field_0 = 0;
  968. fpointQ_sp1f4.field_4 = i_sp214;
  969. fpointQ_sp1f4.field_8 = 0;
  970. fpointQ_sp1f4.field_C = i_sp210;
  971. TPoint3D point3D =
  972. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  973. .m_tPoint3D_0;
  974. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  975. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  976. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  977. CFTTPObject *r11_pobject = new CFTTPObject(
  978. EPhysicsObjectType_2,
  979. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  980. .m_iType_C,
  981. 3, fpoint3_sp204, fpointQ_sp1f4);
  982. int i_sp1b0;
  983. int i_sp1f0 = 0x7F1AA;
  984. sub_16A818(&i_sp1b0, &i_sp1f0);
  985. r11_pobject->field_34 = 0;
  986. r11_pobject->field_38 = 0;
  987. r11_pobject->field_3C = i_sp1b0;
  988. r11_pobject->field_40 = 0x10000;
  989. r11_pobject->field_44 = 0x10000;
  990. r11_pobject->field_A0 = 0x18;
  991. fpoint<PointType_18> fpoint_sp1ec;
  992. fpoint<PointType_18> fpoint_sp1e8;
  993. fpoint3<PointType_18> fpoint3_sp1dc;
  994. fpointQ<PointType_18> fpointQ_sp1cc;
  995. fpoint_sp1ec.var_0 = 0x10000;
  996. fpoint3_sp1dc.x_0 = 0;
  997. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  998. fpoint3_sp1dc.z_8 = 0;
  999. fpoint_sp1e8.var_0 = 0x6666;
  1000. fpointQ<PointType_18> fpointQ_sp1b0;
  1001. fpointQ_sp1b0.field_0 = 0x40000;
  1002. fpointQ_sp1b0.field_4 = 0;
  1003. fpointQ_sp1b0.field_8 = 0;
  1004. fpointQ_sp1b0.field_C = 0x40000;
  1005. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  1006. // check 前俩个参数传递是否使用栈
  1007. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  1008. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  1009. fpoint3<PointType_18> fpoint3_sp1a4;
  1010. fpoint3<PointType_18> fpoint3_sp198;
  1011. fpointQ<PointType_18> fpointQ_sp180;
  1012. fpoint3_sp1a4.z_8 = 0x6666;
  1013. // 00169DF4
  1014. fpointQ_sp180.field_0 = 0;
  1015. fpointQ_sp180.field_4 = 0;
  1016. fpointQ_sp180.field_8 = 0;
  1017. fpointQ_sp180.field_C = 0x40000;
  1018. fpoint3_sp1a4.x_0 = 0x20000;
  1019. fpoint3_sp1a4.y_4 = 0x20000;
  1020. fpoint3_sp198.x_0 = 0;
  1021. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  1022. fpoint3_sp198.z_8 = 0;
  1023. CFTTPPBox *r5_pbox =
  1024. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  1025. // 00169E14
  1026. fpoint3<PointType_18> fpoint3_sp174;
  1027. fpointQ<PointType_18> fpointQ_sp160;
  1028. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  1029. fpoint3_sp174.x_0 = 0;
  1030. fpoint3_sp174.z_8 = 0;
  1031. fpointQ_sp160.field_0 = 0;
  1032. fpointQ_sp160.field_4 = 0;
  1033. fpointQ_sp160.field_8 = 0;
  1034. fpointQ_sp160.field_C = 0x40000;
  1035. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  1036. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  1037. // 00169E32
  1038. r4_pcylinder->field_64 = 0x10000;
  1039. r5_pbox->field_64 = 0x20000;
  1040. r0_ppolyhedron->field_64 = 0xABFFF;
  1041. // 00169E42
  1042. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  1043. r5_pbox->filed_4 = r11_pobject;
  1044. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  1045. r0_ppolyhedron->filed_4 = r11_pobject;
  1046. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  1047. r4_pcylinder->filed_4 = r11_pobject;
  1048. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1049. r11_pobject;
  1050. break;
  1051. }
  1052. }
  1053. }
  1054. }
  1055. // loc_16A232
  1056. physics_sp218.ppobject_0[physics_sp218.object_counts_4++]= r6_pobject;
  1057. if(physics_sp218.Process()){
  1058. //0016A24E
  1059. //sp18=cBall
  1060. LOGE("PhysicsTest_1");
  1061. cBall.ballPosPrev_4.point_0.dx_0=r6_pobject->fpoint3_0.x_0/(-8);//这里fpoint3_0猜测可能为ballPosPrev_4
  1062. cBall.ballPosPrev_4.point_0.dy_4=r6_pobject->fpoint3_0.z_8/8;
  1063. cBall.ballPosPrev_4.dz_8=r6_pobject->fpoint3_0.y_4/8;
  1064. cBall.ballMovePrev_10.point_0.dx_0=r6_pobject->fpoint3_1C.x_0/(-8);
  1065. cBall.ballMovePrev_10.point_0.dy_4=r6_pobject->fpoint3_1C.z_8/8;
  1066. cBall.ballMovePrev_10.dz_8=r6_pobject->fpoint3_1C.y_4/8;
  1067. fpointQ<PointType_18> fpointQ_sp1b0;
  1068. sub_16A88C(fpointQ_sp1b0,r6_pobject->fpointQ_C);
  1069. //check 除法
  1070. //0016A2AA
  1071. cBall.quat_68.d1_0=fpointQ_sp1b0.field_0/64;
  1072. cBall.quat_68.d2_4=fpointQ_sp1b0.field_4/64;
  1073. cBall.quat_68.d3_8=fpointQ_sp1b0.field_8/64;
  1074. cBall.quat_68.d4_C=fpointQ_sp1b0.field_C/64;
  1075. //check
  1076. cBall.point3D_1C.point_0.dx_0= r6_pobject->fpoint3_28.x_0/(-101);
  1077. cBall.point3D_1C.point_0.dy_4= r6_pobject->fpoint3_28.z_8/101;
  1078. cBall.point3D_1C.dz_8= r6_pobject->fpoint3_28.y_4/101;
  1079. //loc_16A344
  1080. for(int r5_i=0;r5_i<physics_sp218.object_counts_4;r5_i++){
  1081. //loc_16A30C
  1082. if(physics_sp218.ppobject_0[r5_i]->field_9E){
  1083. if(physics_sp218.ppobject_0[r5_i]->field_90!=EFreePropType_3){
  1084. if(FREE_tInfo.filed_0.ugamestatus_1828<=8){
  1085. //check
  1086. if((1<<FREE_tInfo.filed_0.ugamestatus_1828)&0x190){
  1087. LOGE("PhysicsTest_2");
  1088. tGame.field_6C98=0;
  1089. tGame.mTLogic_6678.freeproptype_74= physics_sp218.ppobject_0[r5_i]->field_90;
  1090. }
  1091. }
  1092. }
  1093. }
  1094. }
  1095. }
  1096. //loc_16A348
  1097. delete [] pfpoint3_sp34;
  1098. }
  1099. //-------------------------------------------------------------------------------------------------