FREE.cpp 42 KB

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