|
@@ -0,0 +1,1197 @@
|
|
|
+#include "CFTTXmlReaderNode.h"
|
|
|
+#include "GM.h"
|
|
|
+#include "XML.h"
|
|
|
+#include "XSYS.h"
|
|
|
+#include "CBall.h"
|
|
|
+#include "CPlayer.h"
|
|
|
+#include "TEdgeGroup.h"
|
|
|
+#include "CFTTAABB32.h"
|
|
|
+#include "CFTTCamera.h"
|
|
|
+#include "global_func.h"
|
|
|
+#include "CFTTMatrix32.h"
|
|
|
+#include "TFreeControl.h"
|
|
|
+#include "CRSplineF.h"
|
|
|
+#include "memctrl.h"
|
|
|
+void testqqq(){
|
|
|
+ LOGE("%x",sizeof(TEdgeGroup));
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00199300 //^_-不太一样,可能跟FTTVector<>构造有关
|
|
|
+TEdgeGroup::TEdgeGroup() {
|
|
|
+ ui_20 = 0xFF7FFFFF;
|
|
|
+ uint* p = (uint*)&dbl_24;
|
|
|
+ p[0] = 0xFF7FFFFF;
|
|
|
+ p[1] = 0xFF7FFFFF;
|
|
|
+
|
|
|
+ field_14 = 0x7F7FFFFF;
|
|
|
+ field_18 = 0x7F7FFFFF;
|
|
|
+ field_1C = 0x7F7FFFFF;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 001a5d70 //^_-赋值前多出一个FTTVector<>构造
|
|
|
+TEdgeGroup::TEdgeGroup(TEdgeGroup const& obj1) {
|
|
|
+ vec_00 = obj1.vec_00;
|
|
|
+ memcpy(&field_14, &obj1.field_14, sizeof(TEdgeGroup) - sizeof(vec_00));
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 001A5AF2 //^_^
|
|
|
+TEdgeGroup& TEdgeGroup::operator=(TEdgeGroup&& obj1) {
|
|
|
+ FTTVector<FTTPair<uint, uint>>::swap(vec_00, obj1.vec_00);
|
|
|
+
|
|
|
+ auto dbl = obj1.dbl_2C;
|
|
|
+ field_34 = obj1.field_34;
|
|
|
+ dbl_2C = dbl;
|
|
|
+
|
|
|
+ dbl = obj1.dbl_38;
|
|
|
+ field_40 = obj1.field_40;
|
|
|
+ dbl_38 = dbl;
|
|
|
+
|
|
|
+ dbl = obj1.dbl_44;
|
|
|
+ field_4C = obj1.field_4C;
|
|
|
+ dbl_44 = dbl;
|
|
|
+
|
|
|
+ field_50 = obj1.field_50;
|
|
|
+ c_54 = obj1.c_54;
|
|
|
+
|
|
|
+ field_14 = obj1.field_14;
|
|
|
+ field_18 = obj1.field_18;
|
|
|
+ field_1C = obj1.field_1C;
|
|
|
+
|
|
|
+ dbl = obj1.dbl_24;
|
|
|
+ ui_20 = obj1.ui_20;
|
|
|
+ dbl_24 = dbl;
|
|
|
+
|
|
|
+ sh_56 = obj1.sh_56;
|
|
|
+
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 001a5ad6 //^_^
|
|
|
+TEdgeGroup& TEdgeGroup::operator=(TEdgeGroup const& obj1) {
|
|
|
+ vec_00 = obj1.vec_00;
|
|
|
+ memcpy(&field_14, &obj1.field_14, sizeof(TEdgeGroup) - sizeof(vec_00));
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 001a5e58 //^_-被优化了,没有局部变量
|
|
|
+//原版使用D16+栈变量,这里使用了D16-D17
|
|
|
+void TEdgeGroup::swap(TEdgeGroup& obj0, TEdgeGroup& obj1) {
|
|
|
+ FTTVector<FTTPair<uint, uint>>::swap(obj0.vec_00, obj1.vec_00);
|
|
|
+ auto dbl28 = obj0.dbl_2C;
|
|
|
+ auto field20 = obj0.field_34;
|
|
|
+ obj0.field_34 = obj1.field_34;
|
|
|
+ obj0.dbl_2C = obj1.dbl_2C;
|
|
|
+ obj1.field_34 = field20;
|
|
|
+ obj1.dbl_2C = dbl28;
|
|
|
+
|
|
|
+ // 001A5E8C
|
|
|
+ dbl28 = obj0.dbl_38;
|
|
|
+ field20 = obj0.field_40;
|
|
|
+ obj0.field_40 = obj1.field_40;
|
|
|
+ obj0.dbl_38 = obj1.dbl_38;
|
|
|
+ obj1.field_40 = field20;
|
|
|
+ obj1.dbl_38 = dbl28;
|
|
|
+
|
|
|
+ // 001A5EB0
|
|
|
+ dbl28 = obj0.dbl_44;
|
|
|
+ field20 = obj0.field_4C;
|
|
|
+ obj0.field_4C = obj1.field_4C;
|
|
|
+ obj0.dbl_44 = obj1.dbl_44;
|
|
|
+ obj1.field_4C = field20;
|
|
|
+ obj1.dbl_44 = dbl28;
|
|
|
+
|
|
|
+ // 001A5ED4
|
|
|
+ field20 = obj0.field_50;
|
|
|
+ obj0.field_50 = obj1.field_50;
|
|
|
+ obj1.field_50 = field20;
|
|
|
+
|
|
|
+ // 001A5EDA
|
|
|
+ auto c1 = obj0.c_54;
|
|
|
+ obj0.c_54 = obj1.c_54;
|
|
|
+ obj1.c_54 = c1;
|
|
|
+
|
|
|
+ // 001A5EEE
|
|
|
+ auto i1 = obj0.field_14;
|
|
|
+ auto i2 = obj0.field_18;
|
|
|
+ auto i3 = obj0.field_1C;
|
|
|
+ auto i4 = obj0.ui_20;
|
|
|
+ obj0.field_14 = obj1.field_14;
|
|
|
+ obj0.field_18 = obj1.field_18;
|
|
|
+ obj0.field_1C = obj1.field_1C;
|
|
|
+ obj0.ui_20 = obj1.ui_20;
|
|
|
+ obj1.field_14 = i1;
|
|
|
+ obj1.field_18 = i2;
|
|
|
+ obj1.field_1C = i3;
|
|
|
+ obj1.ui_20 = i4;
|
|
|
+
|
|
|
+ dbl28 = obj0.dbl_24;
|
|
|
+ obj0.dbl_24 = obj1.dbl_24;
|
|
|
+ obj1.dbl_24 = dbl28;
|
|
|
+
|
|
|
+ // 001A5F24
|
|
|
+ auto sh = obj0.sh_56;
|
|
|
+ obj0.sh_56 = obj1.sh_56;
|
|
|
+ obj1.sh_56 = sh;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+
|
|
|
+// 001F9296 //^_^
|
|
|
+TEventInfo& TEventInfo::operator=(TEventInfo const& obj) {
|
|
|
+ field_0 = obj.field_0;
|
|
|
+ EventParam_8 = obj.EventParam_8;
|
|
|
+ point_38 = obj.point_38;
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 001f92b6 //^_^
|
|
|
+TEventInfo& TEventInfo::operator=(TEventInfo&& obj) {
|
|
|
+ field_0 = obj.field_0;
|
|
|
+ EventParam_8 = obj.EventParam_8;
|
|
|
+ point_38 = obj.point_38;
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
+#if 0
|
|
|
+//001A5D8C ^_-
|
|
|
+int HeightSort::operator()(TEdgeGroup *pTedgeGroup_r1,TEdgeGroup *pTedgeGroup_r2){
|
|
|
+
|
|
|
+ float s16_field_14 = pTedgeGroup_r1->field_14;
|
|
|
+ float s17_field_20 = pTedgeGroup_r1->ui_20;
|
|
|
+ float s24_field_18 = pTedgeGroup_r2->field_18;
|
|
|
+ float s30_field_24 = pTedgeGroup_r2->field_24;
|
|
|
+ float s2_add1 = pTedgeGroup_r2->field_10 + pTedgeGroup_r2->field_1C;
|
|
|
+ float s20_add2 = pTedgeGroup_r2->field_14 + pTedgeGroup_r2->field_20;
|
|
|
+ float s22_atan2d_1 = atan2f((pTedgeGroup_r1->field_18 + pTedgeGroup_r1->field_24) * 0.5f,(pTedgeGroup_r1->field_10 + pTedgeGroup_r1->field_1C) * 0.5f);
|
|
|
+ float s16_add3 = s16_field_14 + s17_field_20;
|
|
|
+ float s0_atan2d_2 = atan2f((s24_field_18 + s30_field_24) * 0.5f, s2_add1 * 0.5f);
|
|
|
+
|
|
|
+ bool r1_bool = s22_atan2d_1 < s0_atan2d_2 ;
|
|
|
+
|
|
|
+ bool r0_bool = (s16_add3 * 0.5f) < (s20_add2 * 0.5f);
|
|
|
+
|
|
|
+ //这里汇编有差异,原版是IT PL,这里是IT GE
|
|
|
+ return fabsf(s22_atan2d_1 - s0_atan2d_2) >= 0.3927f ? r1_bool : r0_bool;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 0019249A
|
|
|
+double stod_19249A(char* a1) {
|
|
|
+ return strtod(a1, 0);
|
|
|
+}
|
|
|
+
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 0014BAC8
|
|
|
+//^_^
|
|
|
+uint StrToEaser(char const* p_c_r0) {
|
|
|
+ const char* StringEaserConvert[9] = {"None", "Linear", "QuadOut", "QuadIn", "QuadInOut", "CubicOut", "CubicIn", "CubicInOut", "ElasticOut"};
|
|
|
+ for (uint ud_r4 = 0; ud_r4 <= 8; ud_r4++) { // 0014BAE4
|
|
|
+ // 0014BAD6
|
|
|
+ if (strcmp(p_c_r0, StringEaserConvert[ud_r4]) == 0) { // 0014BAE0
|
|
|
+ // 0014BAEA
|
|
|
+ return ud_r4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+// 001F8EF8
|
|
|
+TAnalyticsEventParams& TAnalyticsEventParams::operator=(TAnalyticsEventParams const& obj) {
|
|
|
+ if (0 == field_20)
|
|
|
+ field_24 = rand();
|
|
|
+ pwstr_id_0 = obj.pwstr_id_0;
|
|
|
+ memcpy(field_4, obj.field_4, 0x2c);
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00191F48 //^_^
|
|
|
+bool GetFlag(CFTTXmlReaderNode node0, char const* pName, bool b2) {
|
|
|
+ bool ret = b2;
|
|
|
+ auto node18 = node0.GetFirstChild(pName);
|
|
|
+ if (node18.IsValid()) {
|
|
|
+ // 00191F60
|
|
|
+ auto node1c = node0.GetFirstChild(pName);
|
|
|
+ char* text = node1c.GetText(nullptr);
|
|
|
+ ret = strcmp(text, "false") != 0;
|
|
|
+ }
|
|
|
+ // loc_191F82
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00191FB8 ^_- 有数据结构头文件找不到
|
|
|
+//单元测试等级: 目测游戏表现
|
|
|
+//单元测试内容: 1-10
|
|
|
+//单元测试结果: 正常
|
|
|
+//已测试分支 1 2 3 4 5 6 7 8 9 10 11 12
|
|
|
+SH_NEV_INLINE
|
|
|
+CAdAttribute<TPointF, TAdPointInterpolator>*
|
|
|
+GetPointAttribute(CFTTXmlReaderNode r0_node) {
|
|
|
+// sp4c=r0_node
|
|
|
+#if 1
|
|
|
+ return nullptr;
|
|
|
+#else
|
|
|
+ CFTTXmlReaderNode node_sp70 = r0_node.GetFirstChild("Value");
|
|
|
+ if (node_sp70.IsValid()) { // 00191FE6
|
|
|
+ TPointF pointf_sp0;
|
|
|
+ pointf_sp0.fx_0 = 0;
|
|
|
+ pointf_sp0.fy_4 = 0;
|
|
|
+ TPointF pointf_sp44 = XMLGetPosF(r0_node, "Value", NULL, pointf_sp0);
|
|
|
+ int r5_icount = r0_node.CountElement("Easer");
|
|
|
+ r5_icount += r0_node.CountElement("SEaser");
|
|
|
+ r5_icount += r0_node.CountElement("Spline");
|
|
|
+ CAdAttribute<TPointF, TAdPointInterpolator>* pattr_sp24 = new CAdAttribute<TPointF, TAdPointInterpolator>(pointf_sp44, (uchar)r5_icount);
|
|
|
+ CFTTXmlReaderNode node_sp40 = r0_node.GetFirstChild("Value");
|
|
|
+ node_sp40 = node_sp40.GetNextSibling(NULL);
|
|
|
+ float s16_f = 1.0f;
|
|
|
+ // loc_1923EE
|
|
|
+ while (node_sp40.IsValid()) {
|
|
|
+ // loc_19207A
|
|
|
+ char* r5_pname = node_sp40.GetName();
|
|
|
+ if (strcmp(r5_pname, "Easer")) {
|
|
|
+ if (strcmp(r5_pname, "SEaser")) {
|
|
|
+ // 0019209A
|
|
|
+ if (strcmp(r5_pname, "Spline") == 0) { // 001920AA
|
|
|
+ bool flag_sp28 = GetFlag(node_sp40, "Loop", false);
|
|
|
+ float s18_f = s16_f;
|
|
|
+ if (flag_sp28) { // 001920C0
|
|
|
+ s18_f = XMLGetFloat(node_sp40, "Loop", NULL, 0);
|
|
|
+ }
|
|
|
+ // loc_1920D2
|
|
|
+ int r8_i = 0;
|
|
|
+ int itime_sp14 = XMLGetInt(node_sp40, "Time", NULL, 0);
|
|
|
+ float falpha_sp10 = XMLGetFloat(node_sp40, "Alpha", NULL, 0);
|
|
|
+ int r9_i = node_sp40.CountElement("Value");
|
|
|
+ CFTTVector32x4* r5_pvector32x4 = new CFTTVector32x4[r9_i];
|
|
|
+ CFTTVector32x4* r4_pvector32x4 = r5_pvector32x4;
|
|
|
+ CFTTXmlReaderNode node_sp50 = node_sp40.GetFirstChild("Value");
|
|
|
+ // loc_192162
|
|
|
+ while (node_sp50.IsValid()) {
|
|
|
+ // loc_192134
|
|
|
+ TPointF pointf_sp70 = StrToPosF(node_sp50.GetText(NULL));
|
|
|
+ r4_pvector32x4->my[0] = pointf_sp70.fx_0;
|
|
|
+ r4_pvector32x4->my[1] = pointf_sp70.fy_4;
|
|
|
+ r4_pvector32x4->my[2] = 0;
|
|
|
+ r4_pvector32x4->my[3] = 0;
|
|
|
+ node_sp50 = node_sp50.GetNextSibling("Value");
|
|
|
+ r4_pvector32x4++;
|
|
|
+ r8_i++;
|
|
|
+ }
|
|
|
+ // 0019216C
|
|
|
+ float s20_f;
|
|
|
+ float s22_f;
|
|
|
+ if (flag_sp28) { // 00192174
|
|
|
+ s20_f = r5_pvector32x4[1].my[1];
|
|
|
+ s22_f = r5_pvector32x4[1].my[0];
|
|
|
+ } else { // loc_1922AC
|
|
|
+ s20_f = r4_pvector32x4[-3].my[2]; // check 偏移
|
|
|
+ s22_f = r4_pvector32x4[-3].my[1];
|
|
|
+ }
|
|
|
+ // loc_1922B4
|
|
|
+ node_sp50 = node_sp40.GetFirstChild("SegLength");
|
|
|
+ float* r9_pf;
|
|
|
+ CRSplineF* r7_prsplinef;
|
|
|
+ if (node_sp50.IsValid()) {
|
|
|
+ // 001922DC
|
|
|
+ r9_pf = new float[r9_i];
|
|
|
+ float* r4_pf = r9_pf;
|
|
|
+
|
|
|
+ // loc_192320
|
|
|
+ while (node_sp50.IsValid()) {
|
|
|
+ // loc_1922FE
|
|
|
+ *r4_pf = stod_19249A(node_sp50.GetText(NULL));
|
|
|
+ node_sp50 = node_sp50.GetNextSibling("Value");
|
|
|
+ r4_pf++;
|
|
|
+ }
|
|
|
+ // 0019232A
|
|
|
+ // check CRSplineF大小
|
|
|
+ r7_prsplinef = new CRSplineF(r5_pvector32x4, r8_i, falpha_sp10, r9_pf, flag_sp28);
|
|
|
+ delete r9_pf;
|
|
|
+ } else { // loc_19237C
|
|
|
+ r7_prsplinef = new CRSplineF(r5_pvector32x4, r8_i, falpha_sp10, NULL, flag_sp28);
|
|
|
+ }
|
|
|
+ // loc_19239C
|
|
|
+ TAdPointSpline* r0_padpoint_spline = new TAdPointSpline;
|
|
|
+ r0_padpoint_spline->field_c = itime_sp14;
|
|
|
+ r0_padpoint_spline->prsplinef_10 = r7_prsplinef;
|
|
|
+ r0_padpoint_spline->f_14 = s18_f;
|
|
|
+ r0_padpoint_spline->pointf_04.fx_0 = s22_f;
|
|
|
+ r0_padpoint_spline->pointf_04.fy_4 = s20_f;
|
|
|
+ pattr_sp24->pBuf_10[pattr_sp24->c_14++] = r0_padpoint_spline; // check
|
|
|
+ delete[] r5_pvector32x4;
|
|
|
+ }
|
|
|
+ // loc_1923E6
|
|
|
+ node_sp40 = node_sp40.GetNextSibling(NULL);
|
|
|
+ } else {
|
|
|
+ // loc_1921E4
|
|
|
+ char pc_sp70[0x20];
|
|
|
+ char pc_sp50[0x20];
|
|
|
+ int i = 0;
|
|
|
+ char* r0_pc = node_sp40.GetText(NULL);
|
|
|
+ ////loc_1921FC
|
|
|
+ while (*r0_pc) {
|
|
|
+ char r2_c = *r0_pc;
|
|
|
+ if (r2_c == ' ') { // loc_1921F2
|
|
|
+ r2_c = *(++r0_pc);
|
|
|
+ }
|
|
|
+ // loc_1921F6
|
|
|
+ pc_sp70[i++] = r2_c;
|
|
|
+ r0_pc++;
|
|
|
+ }
|
|
|
+ // 00192206
|
|
|
+ pc_sp70[i] = 0;
|
|
|
+ char* r4_pc1 = strchr(pc_sp70, 0x2c);
|
|
|
+ char* r5_pc2 = strchr(r4_pc1 + 1, 0x2c);
|
|
|
+ int r4_i = r4_pc1 - pc_sp70;
|
|
|
+ int r8_i = strlen(pc_sp70);
|
|
|
+ memcpy(pc_sp50, pc_sp70, r4_i);
|
|
|
+ int r6_i = r5_pc2 - pc_sp70;
|
|
|
+ pc_sp50[r4_i] = 0;
|
|
|
+ r4_i = r6_i - r4_i - 1;
|
|
|
+ int r9_i = atoi(pc_sp50);
|
|
|
+ memcpy(pc_sp50, r4_pc1 + 1, r4_i);
|
|
|
+ pc_sp50[r4_i] = 0;
|
|
|
+ r4_i = StrToEaser(pc_sp50);
|
|
|
+ int r5_i = r8_i - r6_i - 1;
|
|
|
+ memcpy(pc_sp50, r5_pc2 + 1, r5_i);
|
|
|
+ pc_sp50[r5_i] = 0;
|
|
|
+ TPointF pointf_sp38 = StrToPosF(pc_sp50);
|
|
|
+ TAdPointEaser* r0_adpointeaser = new TAdPointEaser;
|
|
|
+ r0_adpointeaser->field_c = r9_i;
|
|
|
+
|
|
|
+ r0_adpointeaser->pointf_04 = pointf_sp38;
|
|
|
+ r0_adpointeaser->i_10 = r4_i;
|
|
|
+ pattr_sp24->pBuf_10[pattr_sp24->c_14++] = r0_adpointeaser;
|
|
|
+ // loc_1923E6
|
|
|
+ node_sp40 = node_sp40.GetNextSibling(NULL);
|
|
|
+ }
|
|
|
+ } else { // loc_19217E
|
|
|
+ int r8_i = XMLGetInt(node_sp40, "Time", NULL, 0);
|
|
|
+ TPointF pointf_sp0;
|
|
|
+ pointf_sp0.fx_0 = 0;
|
|
|
+ pointf_sp0.fy_4 = 0;
|
|
|
+ TPointF pointf_sp70 = XMLGetPosF(node_sp40, "Value", 0, pointf_sp0);
|
|
|
+ char* r5_pc = XMLGetString(node_sp40, "Type", NULL, NULL);
|
|
|
+
|
|
|
+ TAdPointEaser* r4_padpointeaser = new TAdPointEaser;
|
|
|
+
|
|
|
+ int r0_i = StrToEaser(r5_pc);
|
|
|
+ r4_padpointeaser->field_c = r8_i;
|
|
|
+ r4_padpointeaser->pointf_04 = pointf_sp70;
|
|
|
+ r4_padpointeaser->i_10 = r0_i;
|
|
|
+ pattr_sp24->pBuf_10[pattr_sp24->c_14++] =
|
|
|
+ r4_padpointeaser;
|
|
|
+ // loc_1923E6
|
|
|
+ node_sp40 = node_sp40.GetNextSibling(NULL);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // loc_192430
|
|
|
+ return pattr_sp24;
|
|
|
+ } else { // loc_192400
|
|
|
+ TPointF pointf_sp70 = StrToPosF(r0_node.GetText(NULL));
|
|
|
+ CAdAttribute<TPointF, TAdPointInterpolator>* r9_pattr = new CAdAttribute<TPointF, TAdPointInterpolator>();
|
|
|
+
|
|
|
+ r9_pattr->mem_00 = pointf_sp70;
|
|
|
+ r9_pattr->mem_08 = pointf_sp70;
|
|
|
+ r9_pattr->pBuf_10 = 0;
|
|
|
+ r9_pattr->c_14 = 0;
|
|
|
+ r9_pattr->cLen_15 = 0;
|
|
|
+ return r9_pattr;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+}
|
|
|
+// 001924A8 广告相关, 暂时先合并, 没整理
|
|
|
+CAdAttribute<uint, TAdColourInterpolator>* GetColourAttribute(CFTTXmlReaderNode node0) {
|
|
|
+ CAdAttribute<uint, TAdColourInterpolator>* pCAdAttributeR10;
|
|
|
+#if 0
|
|
|
+ CFTTXmlReaderNode pNodeSP40 = node0.GetFirstChild("Value");
|
|
|
+ //.text:001924D4 BEQ.W loc_1929B6
|
|
|
+ if (pNodeSP40.IsValid())
|
|
|
+ {//.text:00192A5C
|
|
|
+ uint fR8 = XMLGetColour(node0, "Value", 0, 0xFF000000);
|
|
|
+ int iR5 = node0.CountElement("Easer") + node0.CountElement("SEaser") + node0.CountElement("Spline");
|
|
|
+ pCAdAttributeR10 = new CAdAttribute<uint, TAdColourInterpolator>(fR8, iR5);
|
|
|
+
|
|
|
+ //.text:0019256A B loc_1929A4
|
|
|
+ for (CFTTXmlReaderNode pNodeSP38 = node0.GetFirstChild("Value").GetNextSibling(NULL);
|
|
|
+ pNodeSP38.IsValid();
|
|
|
+ pNodeSP38 = pNodeSP38.GetNextSibling(NULL))
|
|
|
+ {//loc_19256C
|
|
|
+
|
|
|
+ char * pNameR6 = pNodeSP38.GetName();
|
|
|
+ //.text:0019257C BEQ.W loc_1927F2
|
|
|
+ if (strcmp(pNameR6, "Easer") == 0)
|
|
|
+ {//loc_1927F2
|
|
|
+ int iR8 = XMLGetInt(pNodeSP38, "Time", 0, 0);
|
|
|
+ uint fR7 = XMLGetColour(pNodeSP38, "Value", 0, 0xFF000000);
|
|
|
+ char * pcType = XMLGetString(pNodeSP38, "Type", 0, 0);
|
|
|
+ TAdColourEaser * p = new TAdColourEaser();
|
|
|
+ uint u = StrToEaser(pcType);
|
|
|
+
|
|
|
+ p->XMLValue_4 = fR7;
|
|
|
+ p->XMLTime_8 = iR8;
|
|
|
+ p->field_C = u;
|
|
|
+ pCAdAttributeR10->mpData[pCAdAttributeR10->mSize] = p;
|
|
|
+ pCAdAttributeR10->mSize++;
|
|
|
+ }//.text:0019258A BEQ.W loc_192890
|
|
|
+ else if (strcmp(pNameR6, "SEaser") == 0)
|
|
|
+ {//loc_192890
|
|
|
+ char str[32];
|
|
|
+ char *pText = pNodeSP38.GetText(0);
|
|
|
+ char *pc = strchr(pText, ',');
|
|
|
+ char * pe = strchr(pc + 1, ',');
|
|
|
+ int lenR11 = strlen(pText);
|
|
|
+ memcpy(str, pText, pc - pText);
|
|
|
+ str[pc - pText] = 0;
|
|
|
+ int lenR9 = pe - pText;
|
|
|
+ int lenR7 = pe - pc - 2;
|
|
|
+ int iR5 = atoi(str);
|
|
|
+ memcpy(str, pc + 2, lenR7);
|
|
|
+ str[lenR7] = 0;
|
|
|
+ int iR6 = lenR11 - lenR9 - 2;
|
|
|
+ int iR7 = StrToEaser(str);
|
|
|
+ memcpy(str, pe + 2, iR6);
|
|
|
+ str[iR6] = 0;
|
|
|
+
|
|
|
+ uint f = StrToCol(str);;
|
|
|
+ TAdColourEaser * p = new TAdColourEaser();
|
|
|
+ p->XMLTime_8 = iR5;
|
|
|
+ p->XMLValue_4 = f;
|
|
|
+ p->field_C = iR7;
|
|
|
+
|
|
|
+ pCAdAttributeR10->mpData[pCAdAttributeR10->mSize] = p;
|
|
|
+ pCAdAttributeR10->mSize++;
|
|
|
+
|
|
|
+ }//.text:0019259A BNE.W loc_19299C
|
|
|
+ else if (strcmp(pNameR6, "Spline") == 0)
|
|
|
+ {
|
|
|
+ float fS16 = 1.0;
|
|
|
+ int flagSO14 = GetFlag(pNodeSP38, "Loop", 0);
|
|
|
+ //.text:001925B0 CBZ R0, loc_1925C4
|
|
|
+ if (flagSO14)
|
|
|
+ fS16 = XMLGetFloat(pNodeSP38, "Loop", 0, 0.0);
|
|
|
+ //loc_1925C4
|
|
|
+ int timeSP18 = XMLGetInt(pNodeSP38, "Time", 0, 0);
|
|
|
+ float alphaSP10 = XMLGetFloat(pNodeSP38, "Alpha", 0, 0.0);
|
|
|
+ int iR8 = pNodeSP38.CountElement("Value");
|
|
|
+ CFTTVector32x4 *vecSP1C = new CFTTVector32x4[iR8];
|
|
|
+ int indexR6 = 0;
|
|
|
+ //.text:00192620 B loc_192676
|
|
|
+ for (CFTTXmlReaderNode pNodeR0 = pNodeSP38.GetFirstChild("Value");
|
|
|
+ pNodeR0.IsValid();
|
|
|
+ pNodeR0 = pNodeR0.GetNextSibling(NULL))
|
|
|
+ {//loc_192622
|
|
|
+ uint color=StrToCol(pNodeR0.GetText(NULL));
|
|
|
+ vecSP1C[indexR6].my[0] = (color>>16) &0xFF;
|
|
|
+ vecSP1C[indexR6].my[1] = (color >> 8) & 0xFF;
|
|
|
+ vecSP1C[indexR6].my[2] = color &0xff;
|
|
|
+ vecSP1C[indexR6].my[3] = (color >> 24) & 0xFF;;
|
|
|
+ ++indexR6;
|
|
|
+ }//.text:00192680 BNE loc_192622
|
|
|
+ uint uR11 = XMATH_Clamp(vecSP1C[indexR6-1].my[3], 0, 255) | (XMATH_Clamp(vecSP1C[indexR6 - 1].my[1], 0, 255) << 16)
|
|
|
+ | (XMATH_Clamp(vecSP1C[indexR6 - 1].my[0], 0, 255) << 24) | (XMATH_Clamp(vecSP1C[indexR6 - 1].my[2], 0, 255) << 8);
|
|
|
+
|
|
|
+ if (flagSO14)
|
|
|
+ uR11 = XMATH_Clamp(vecSP1C[1].my[3], 0, 255) | (XMATH_Clamp(vecSP1C[1].my[1], 0, 255) << 16)
|
|
|
+ | (XMATH_Clamp(vecSP1C[1].my[0], 0, 255) << 24) | (XMATH_Clamp(vecSP1C[1].my[2], 0, 255) << 8);
|
|
|
+
|
|
|
+ CFTTXmlReaderNode node = pNodeSP38.GetFirstChild("SegLength");
|
|
|
+ CRSplineF * pCRSplineF;
|
|
|
+ //.text:00192770 BEQ.W loc_19293A
|
|
|
+ if (node.IsValid())
|
|
|
+ {
|
|
|
+ float * pf = new float[iR8];
|
|
|
+ float* p = pf;
|
|
|
+ //.text:0019279E B loc_1927C2
|
|
|
+ while (node.IsValid())
|
|
|
+ {//loc_1927A0
|
|
|
+ *p = myatof(node.GetText(NULL));
|
|
|
+ node = node.GetNextSibling("SegLength");
|
|
|
+ p++;
|
|
|
+ }//.text:001927CA BNE loc_1927A0
|
|
|
+ pCRSplineF = new CRSplineF(vecSP1C, indexR6, alphaSP10, pf, flagSO14);
|
|
|
+ delete[] pf;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {//loc_19293A
|
|
|
+ pCRSplineF = new CRSplineF(vecSP1C, indexR6, alphaSP10, 0, flagSO14);
|
|
|
+ }
|
|
|
+
|
|
|
+ TAdColourSpline * pTAd = new TAdColourSpline();
|
|
|
+
|
|
|
+ pTAd->XMLTime_8 = timeSP18;
|
|
|
+ pTAd->field_C = pCRSplineF;
|
|
|
+ pTAd->field_10 = fS16;
|
|
|
+ pTAd->XMLValue_4 = uR11;
|
|
|
+ pCAdAttributeR10->mpData[pCAdAttributeR10->mSize] = pTAd;
|
|
|
+ pCAdAttributeR10->mSize++;
|
|
|
+ delete[]vecSP1C;
|
|
|
+ }
|
|
|
+ //loc_19299C
|
|
|
+ pNodeSP38 = pNodeSP38.GetNextSibling(NULL);
|
|
|
+ }//.text:001929AE BNE.W loc_19256C
|
|
|
+ //.text:001929B4 B loc_1929DA
|
|
|
+ }
|
|
|
+ else
|
|
|
+ { //loc_1929B6
|
|
|
+ uint f = StrToCol(node0.GetText(NULL));
|
|
|
+ pCAdAttributeR10 = (CAdAttribute<uint, TAdColourInterpolator>*) new char[0x10];
|
|
|
+
|
|
|
+ pCAdAttributeR10->mSize = 0;
|
|
|
+ pCAdAttributeR10->mpData = 0;
|
|
|
+ pCAdAttributeR10->field_0 = f;
|
|
|
+ pCAdAttributeR10->field_4 = f;
|
|
|
+ }
|
|
|
+ //loc_1929DA
|
|
|
+#endif
|
|
|
+ return pCAdAttributeR10;
|
|
|
+}
|
|
|
+// 00192A2C 广告相关, 暂时先合并, 没整理
|
|
|
+CAdAttribute<float, TAdFloatInterpolator>* GetFloatAttribute(CFTTXmlReaderNode node0) {
|
|
|
+ CAdAttribute<float, TAdFloatInterpolator>* pCAdAttributeR10;
|
|
|
+#if 0
|
|
|
+ CFTTXmlReaderNode pNodeSP40 = node0.GetFirstChild("Value");
|
|
|
+ //.text:00192A58 BEQ.W loc_192E18
|
|
|
+ if (pNodeSP40.IsValid())
|
|
|
+ {//.text:00192A5C
|
|
|
+ float fR8 = XMLGetFloat(node0, "Value", 0, 0.0);
|
|
|
+ int iR5 = node0.CountElement("Easer") + node0.CountElement("SEaser") + node0.CountElement("Spline");
|
|
|
+ pCAdAttributeR10=new CAdAttribute<float, TAdFloatInterpolator>(fR8,iR5);
|
|
|
+ CFTTXmlReaderNode pNodeSP38 = node0.GetFirstChild("Value");
|
|
|
+ pNodeSP38 = pNodeSP38.GetNextSibling(NULL);
|
|
|
+ //.text:00192AE8 B loc_192DF0
|
|
|
+ //.text:00192DFA BNE.W loc_192AEA
|
|
|
+ while (pNodeSP38.IsValid())
|
|
|
+ {//loc_192AEA
|
|
|
+ char * pNameR6 = pNodeSP38.GetName();
|
|
|
+ //.text:00192AFA BEQ.W loc_192C78
|
|
|
+ if (strcmp(pNameR6, "Easer")==0)
|
|
|
+ {//loc_192C78
|
|
|
+ int iR8 = XMLGetInt(pNodeSP38,"Time", 0, 0);
|
|
|
+ float fR7 = XMLGetFloat(pNodeSP38, "Value", 0, 0.0);
|
|
|
+ char * pcType = XMLGetString(pNodeSP38, "Type", 0, 0);
|
|
|
+ TAdFloatEaser * p = new TAdFloatEaser();
|
|
|
+ uint u = StrToEaser(pcType);
|
|
|
+ p->XMLTime_8 = iR8;
|
|
|
+ p->field_C = u;
|
|
|
+ p->XMLValue_4 = fR7;
|
|
|
+
|
|
|
+
|
|
|
+ pCAdAttributeR10->mpData[pCAdAttributeR10->mSize] = p;
|
|
|
+ pCAdAttributeR10->mSize++;
|
|
|
+ }
|
|
|
+ //.text:00192B08 BEQ.W loc_192CD4
|
|
|
+ else if (strcmp(pNameR6, "SEaser")==0)
|
|
|
+ {//loc_192CD4
|
|
|
+ char str[32];
|
|
|
+ char *pText = pNodeSP38.GetText(0);
|
|
|
+ char *pc = strchr(pText, ',');
|
|
|
+ char * pe = strchr(pc + 1, ',');
|
|
|
+ int lenR11 = strlen(pText);
|
|
|
+ memcpy(str, pText, pc - pText);
|
|
|
+ str[pc - pText] = 0;
|
|
|
+ int lenR9 = pe - pText;
|
|
|
+ int lenR7 = pe - pc - 2;
|
|
|
+ int iR5 = atoi(str);
|
|
|
+ memcpy(str, pc + 2, lenR7);
|
|
|
+ str[lenR7] = 0;
|
|
|
+ int iR6 = lenR11 - lenR9 - 2;
|
|
|
+ int iR7 = StrToEaser(str);
|
|
|
+ memcpy(str, pe + 2, iR6);
|
|
|
+ str[iR6] = 0;
|
|
|
+
|
|
|
+ float f = myatof(str);;
|
|
|
+ TAdFloatEaser * p = new TAdFloatEaser();
|
|
|
+ p->XMLTime_8 = iR5;
|
|
|
+ p->XMLValue_4 = f;
|
|
|
+ p->field_C = iR7;
|
|
|
+
|
|
|
+ pCAdAttributeR10->mpData[pCAdAttributeR10->mSize] = p;
|
|
|
+ pCAdAttributeR10->mSize++;
|
|
|
+
|
|
|
+ }
|
|
|
+ //.text:00192B18 BNE.W loc_192DE8
|
|
|
+ else if (strcmp(pNameR6, "Spline")==0)
|
|
|
+ {//.text:00192B1C
|
|
|
+ float fS16 = 1.0;
|
|
|
+ int flagSO14 = GetFlag(pNodeSP38, "Loop", 0);
|
|
|
+ //.text:00192B30 BEQ loc_192B44
|
|
|
+ if (flagSO14)
|
|
|
+ fS16 = XMLGetFloat(pNodeSP38, "Loop", 0, 0.0);
|
|
|
+ //loc_192B44
|
|
|
+ int timeSP18 = XMLGetInt(pNodeSP38, "Time", 0, 0);
|
|
|
+ float alphaSP10 = XMLGetFloat(pNodeSP38, "Alpha", 0, 0.0);
|
|
|
+ int iR8 = pNodeSP38.CountElement("Value");
|
|
|
+ CFTTVector32x4 *vecSP1C = new CFTTVector32x4[iR8];
|
|
|
+ int indexR6 = 0;
|
|
|
+ //.text:00192BA2 B loc_192BCE
|
|
|
+ for (CFTTXmlReaderNode pNodeR0 = pNodeSP38.GetFirstChild("Value");
|
|
|
+ pNodeR0.IsValid();
|
|
|
+ pNodeR0 = pNodeR0.GetNextSibling(NULL))
|
|
|
+ {//loc_192BA4
|
|
|
+ vecSP1C[indexR6].my[0]= myatof(pNodeR0.GetText(NULL));
|
|
|
+ vecSP1C[indexR6].my[1] = 0;
|
|
|
+ vecSP1C[indexR6].my[2] = 1;
|
|
|
+ vecSP1C[indexR6].my[3] = 2;
|
|
|
+ ++indexR6;
|
|
|
+ }//.text:00192BD8 BNE loc_192BA4
|
|
|
+
|
|
|
+ float fS20 = vecSP1C[indexR6-2].my[0];
|
|
|
+ if (flagSO14)
|
|
|
+ fS20 = vecSP1C[1].my[0];
|
|
|
+
|
|
|
+ CFTTXmlReaderNode node = pNodeSP38.GetFirstChild("SegLength");
|
|
|
+ CRSplineF * pCRSplineF;
|
|
|
+ //.text:00192C02 BEQ.W loc_192D86
|
|
|
+ if (node.IsValid())
|
|
|
+ {
|
|
|
+ float * pf = new float [iR8];
|
|
|
+ float* p = pf;
|
|
|
+ //.text:00192C26 B loc_192C4A
|
|
|
+ //.text:00192C52 BNE loc_192C28
|
|
|
+ while (node.IsValid())
|
|
|
+ {//loc_192C28
|
|
|
+ *p= myatof(node.GetText(NULL));
|
|
|
+ node= node.GetNextSibling("SegLength");
|
|
|
+ p++;
|
|
|
+ }
|
|
|
+ //.text:00192C54 MOVS R0, #0x10
|
|
|
+ pCRSplineF=new CRSplineF(vecSP1C, indexR6, alphaSP10, pf, flagSO14);
|
|
|
+ delete[] pf;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {//loc_192D86
|
|
|
+ pCRSplineF =new CRSplineF(vecSP1C, indexR6, alphaSP10, 0, flagSO14);
|
|
|
+ }
|
|
|
+ //loc_192DA0
|
|
|
+ TAdFloatSpline * pTAd = new TAdFloatSpline();
|
|
|
+
|
|
|
+ pTAd->XMLTime_8 = timeSP18;
|
|
|
+ pTAd->field_C = pCRSplineF;
|
|
|
+ pTAd->field_10 =fS16;
|
|
|
+ pTAd->XMLValue_4 = fS20;
|
|
|
+ pCAdAttributeR10->mpData[pCAdAttributeR10->mSize]= (TAdFloatInterpolator*)pTAd;
|
|
|
+ pCAdAttributeR10->mSize++;
|
|
|
+ delete[]vecSP1C;
|
|
|
+ }
|
|
|
+ //loc_192DE8
|
|
|
+ pNodeSP38 = pNodeSP38.GetNextSibling(NULL);
|
|
|
+ }
|
|
|
+ //.text:00192E00 B loc_192E42
|
|
|
+ }
|
|
|
+ else
|
|
|
+ { //loc_192E18
|
|
|
+ float f= myatof(node0.GetText(NULL));
|
|
|
+ pCAdAttributeR10 =(CAdAttribute<float, TAdFloatInterpolator>*) new char[0x10];
|
|
|
+
|
|
|
+ pCAdAttributeR10->mSize = 0;
|
|
|
+ pCAdAttributeR10->mpData = 0;
|
|
|
+ pCAdAttributeR10->field_0 = f;
|
|
|
+ pCAdAttributeR10->field_4 = f;
|
|
|
+ }
|
|
|
+ //loc_192E42
|
|
|
+#endif
|
|
|
+ return pCAdAttributeR10;
|
|
|
+}
|
|
|
+
|
|
|
+// 00192EBC
|
|
|
+void GetAlignment(CFTTXmlReaderNode rn0, eAlignmentX& pui1, eAlignmentY& pui2) {
|
|
|
+ int R7_0, R0_0, R0_6, R6_0;
|
|
|
+ eAlignmentX R4_0;
|
|
|
+ eAlignmentY R4_1;
|
|
|
+ CFTTXmlReaderNode *R0_1, *R0_2, R0_3, R0_4, *R0_5, R0_7, R0_10;
|
|
|
+ CFTTXmlReaderNode var_1C, var_08, var_04;
|
|
|
+ char *R0_8, *R7_1, *R0_9, *R0_12, *R0_11, *R0_13;
|
|
|
+
|
|
|
+ var_1C = rn0;
|
|
|
+
|
|
|
+ R0_2 = &var_1C;
|
|
|
+
|
|
|
+ R0_3 = R0_2->GetFirstChild("AlignX");
|
|
|
+ var_08 = R0_3;
|
|
|
+ R0_1 = &var_08;
|
|
|
+ R0_0 = R0_1->IsValid();
|
|
|
+
|
|
|
+ R7_0 = R0_0;
|
|
|
+
|
|
|
+ R0_4 = R0_2->GetFirstChild("AlignY");
|
|
|
+ var_04 = R0_4;
|
|
|
+ R0_5 = &var_04;
|
|
|
+ R0_6 = R0_5->IsValid();
|
|
|
+
|
|
|
+ R6_0 = R0_6;
|
|
|
+
|
|
|
+ // 00192EF0
|
|
|
+ if (!R7_0) {
|
|
|
+ // 00192F22
|
|
|
+ R4_0 = (eAlignmentX)1;
|
|
|
+ // 00192F22
|
|
|
+ } else {
|
|
|
+ // 00192EF2
|
|
|
+ R4_0 = (eAlignmentX)0;
|
|
|
+ R0_7 = var_1C;
|
|
|
+ R0_8 = XMLGetString(R0_7, "AlignX", NULL, NULL);
|
|
|
+
|
|
|
+ R7_1 = R0_8;
|
|
|
+
|
|
|
+ // 00192F08
|
|
|
+ if (strcmp(R0_8, "Left")) {
|
|
|
+ // 00192F0E
|
|
|
+ R0_9 = R7_1;
|
|
|
+
|
|
|
+ R4_0 = (eAlignmentX)1;
|
|
|
+ // 00192F1A
|
|
|
+ if (!strcmp(R0_9, "Right")) {
|
|
|
+ // 00192F1E
|
|
|
+ R4_0 = (eAlignmentX)2;
|
|
|
+ // 00192F1E
|
|
|
+ }
|
|
|
+ // 00192F20
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ pui1 = R4_0;
|
|
|
+
|
|
|
+ // 00192F24
|
|
|
+ if (R6_0 == 0) {
|
|
|
+ // 00192F5A
|
|
|
+ R4_1 = (eAlignmentY)1;
|
|
|
+ // 00192F5A
|
|
|
+ } else {
|
|
|
+ // 00192F2A
|
|
|
+ R0_10 = var_1C;
|
|
|
+
|
|
|
+ R4_1 = (eAlignmentY)0;
|
|
|
+ R0_12 = XMLGetString(R0_10, "AlignY", NULL, NULL);
|
|
|
+
|
|
|
+ R0_11 = R0_12;
|
|
|
+
|
|
|
+ // 00192F44
|
|
|
+ if (strcmp(R0_11, "Top")) {
|
|
|
+ // 00192F46
|
|
|
+ R0_13 = R0_12;
|
|
|
+
|
|
|
+ R4_1 = (eAlignmentY)1;
|
|
|
+ // 00192F52
|
|
|
+ if (!strcmp(R0_13, "Bottom")) {
|
|
|
+ // 00192F56
|
|
|
+ R4_1 = (eAlignmentY)2;
|
|
|
+ // 00192F56
|
|
|
+ }
|
|
|
+ // 00192F58
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ pui2 = (eAlignmentY)R4_1;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00192f84 //^_^
|
|
|
+void GetScale(CFTTXmlReaderNode node0, eScaleX& ex1, eScaleY& ey2) {
|
|
|
+ auto ScaleXnode = node0.GetFirstChild("ScaleX");
|
|
|
+ bool b7 = ScaleXnode.IsValid();
|
|
|
+
|
|
|
+ // 00192FA4
|
|
|
+ auto ScaleYnode = node0.GetFirstChild("ScaleY");
|
|
|
+ bool b6 = ScaleYnode.IsValid();
|
|
|
+ eScaleX esx0;
|
|
|
+ if (!b7) {
|
|
|
+ // loc_192FFE
|
|
|
+ esx0 = eScaleX_0;
|
|
|
+ } else {
|
|
|
+ // 00192FB8
|
|
|
+ char* p7 = XMLGetString(node0, "ScaleX", nullptr, nullptr);
|
|
|
+ if (0 == strcmp(p7, "Proportion")) {
|
|
|
+ // loc_193002
|
|
|
+ esx0 = eScaleX_1;
|
|
|
+ } else if (0 == strcmp(p7, "ImageWidth")) { // 00192FD2
|
|
|
+ // loc_193006
|
|
|
+ esx0 = eScaleX_2;
|
|
|
+ } else if (0 == strcmp(p7, "Ratio")) { // 00192FDE
|
|
|
+ // loc_19300A
|
|
|
+ esx0 = eScaleX_3;
|
|
|
+ } else { // 00192FEA
|
|
|
+ esx0 = (0 == strcmp(p7, "Y")) ? eScaleX_4 : eScaleX_0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // loc_19300C
|
|
|
+ ex1 = esx0;
|
|
|
+
|
|
|
+ eScaleY esy0;
|
|
|
+ if (!b6) {
|
|
|
+ // loc_193058
|
|
|
+ esy0 = eScaleY_0;
|
|
|
+ } else {
|
|
|
+ // 00193012
|
|
|
+ char* p5 = XMLGetString(node0, "ScaleY", nullptr, nullptr);
|
|
|
+ if (0 == strcmp(p5, "Proportion")) {
|
|
|
+ // loc_19305C
|
|
|
+ esy0 = eScaleY_1;
|
|
|
+ } else if (0 == strcmp(p5, "ImageHeight")) { // 0019302C
|
|
|
+ // loc_193060
|
|
|
+ esy0 = eScaleY_2;
|
|
|
+ } else if (0 == strcmp(p5, "Ratio")) { // 00193038
|
|
|
+ // loc_193064
|
|
|
+ esy0 = eScaleY_3;
|
|
|
+ } else { // 00193044
|
|
|
+ esy0 = (0 == strcmp(p5, "X")) ? eScaleY_4 : eScaleY_0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // loc_193066
|
|
|
+ ey2 = esy0;
|
|
|
+ return;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 0019309c //^_^
|
|
|
+void GetPosType(CFTTXmlReaderNode node0, ePosTypeX& ex1, ePosTypeY& ey2) {
|
|
|
+ auto vNode1C = node0.GetFirstChild("PosTypeX");
|
|
|
+ bool isValid7 = vNode1C.IsValid();
|
|
|
+ // 001930B8
|
|
|
+ auto vNode20 = node0.GetFirstChild("PosTypeY");
|
|
|
+ bool isValid6 = vNode20.IsValid();
|
|
|
+ ePosTypeX ex;
|
|
|
+ // 001930CE
|
|
|
+ if (isValid7) {
|
|
|
+ // 001930D0
|
|
|
+ auto ret = XMLGetString(node0, "PosTypeX", nullptr, nullptr);
|
|
|
+ ex = (ePosTypeX)(0 == strcmp(ret, "Proportion"));
|
|
|
+ } else { // loc_1930EE
|
|
|
+ ex = ePosTypeX_0;
|
|
|
+ }
|
|
|
+ // loc_1930F0
|
|
|
+ ex1 = ex;
|
|
|
+ ePosTypeY ey;
|
|
|
+ if (isValid6) {
|
|
|
+ auto ret = XMLGetString(node0, "PosTypeY", nullptr, nullptr);
|
|
|
+ ey = (ePosTypeY)(0 == strcmp(ret, "Proportion"));
|
|
|
+ } else {
|
|
|
+ // loc_193114
|
|
|
+ ey = ePosTypeY_0;
|
|
|
+ }
|
|
|
+ // loc_193116
|
|
|
+ ey2 = ey;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00193a18 //^_^
|
|
|
+CAdElText* GetTextElement(CFTTXmlReaderNode node0) {
|
|
|
+ char* pStr48 = XMLGetString(node0, "String", nullptr, nullptr);
|
|
|
+ auto posNode = GetPointAttribute(node0.GetFirstChild("Position"));
|
|
|
+ // 00193A46
|
|
|
+ auto sizeNode = GetPointAttribute(node0.GetFirstChild("Size"));
|
|
|
+ auto clrNode = GetColourAttribute(node0.GetFirstChild("Colour"));
|
|
|
+ // 00193A62
|
|
|
+ auto lenNode = GetFloatAttribute(node0.GetFirstChild("Length"));
|
|
|
+ auto bold = GetFlag(node0, "Bold", false);
|
|
|
+
|
|
|
+ eAlignmentX eAlignmentX2C;
|
|
|
+ eAlignmentY eAlignmentY30;
|
|
|
+ GetAlignment(node0, eAlignmentX2C, eAlignmentY30);
|
|
|
+
|
|
|
+ eScaleX eScaleX34;
|
|
|
+ eScaleY eScaleY38;
|
|
|
+ GetScale(node0, eScaleX34, eScaleY38);
|
|
|
+
|
|
|
+ ePosTypeX ePosTypeX3C;
|
|
|
+ ePosTypeY ePosTypeY40;
|
|
|
+ GetPosType(node0, ePosTypeX3C, ePosTypeY40);
|
|
|
+
|
|
|
+ // 00193A9E
|
|
|
+ CAdElText* pAdText = new CAdElText(posNode, sizeNode, clrNode, lenNode, pStr48, bold);
|
|
|
+ pAdText->eAlignmentX_14 = eAlignmentX2C;
|
|
|
+ pAdText->eAlignmentY_18 = eAlignmentY30;
|
|
|
+ pAdText->eScaleX_1C = eScaleX34;
|
|
|
+ pAdText->eScaleY_20 = eScaleY38;
|
|
|
+ pAdText->ePosTypeX_24 = ePosTypeX3C;
|
|
|
+ pAdText->ePosTypeY_28 = ePosTypeY40;
|
|
|
+
|
|
|
+ auto node44 = node0.GetFirstChild("Name");
|
|
|
+ char* pName = nullptr;
|
|
|
+ if (node44.IsValid()) {
|
|
|
+ // 00193AEA
|
|
|
+ pName = node0.GetText("Name");
|
|
|
+ }
|
|
|
+ // loc_193AF6
|
|
|
+ pAdText->SetName(pName);
|
|
|
+
|
|
|
+ return pAdText;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00193688 //^_^
|
|
|
+CAdElShape* GetShapeElement(CFTTXmlReaderNode node0) {
|
|
|
+ auto attPos54 = GetPointAttribute(node0.GetFirstChild("Position"));
|
|
|
+ auto attSize9 = GetPointAttribute(node0.GetFirstChild("Size"));
|
|
|
+ auto attColor10 = GetColourAttribute(node0.GetFirstChild("Colour"));
|
|
|
+
|
|
|
+ // 001936C2
|
|
|
+ eAlignmentX v2c;
|
|
|
+ eAlignmentY v30;
|
|
|
+ GetAlignment(node0, v2c, v30);
|
|
|
+
|
|
|
+ eScaleX v34;
|
|
|
+ eScaleY v38;
|
|
|
+ GetScale(node0, v34, v38);
|
|
|
+
|
|
|
+ ePosTypeX v3c;
|
|
|
+ ePosTypeY v40;
|
|
|
+ GetPosType(node0, v3c, v40);
|
|
|
+
|
|
|
+ // 001936E0
|
|
|
+ auto PtsNode = node0.GetFirstChild("Points");
|
|
|
+ uchar cnt = PtsNode.CountElement("Point") / 3;
|
|
|
+ TPointF* pPoint = new TPointF[cnt * 3];
|
|
|
+
|
|
|
+ uchar i8 = 0;
|
|
|
+ // 00193722
|
|
|
+ for (auto currentNode = PtsNode.GetFirstChild("Point"); currentNode.IsValid();
|
|
|
+ currentNode = currentNode.GetNextSibling("Point")) {
|
|
|
+ // loc_193724
|
|
|
+ auto pText = currentNode.GetText(nullptr);
|
|
|
+ auto pt = StrToPosF(pText);
|
|
|
+ pPoint[i8++] = {pt.fx_0, pt.fy_4};
|
|
|
+ }
|
|
|
+ // 0019375E
|
|
|
+ CAdElShape* pShape = new CAdElShape();
|
|
|
+ pShape->attPos_4 = attPos54;
|
|
|
+ pShape->attSize_8 = attSize9;
|
|
|
+ pShape->attColor_C = attColor10;
|
|
|
+ pShape->pPointf_30 = pPoint;
|
|
|
+ pShape->cPointCnt_34 = cnt;
|
|
|
+ pShape->eAlignmentX_14 = v2c;
|
|
|
+ pShape->eAlignmentY_18 = v30;
|
|
|
+ pShape->eScaleX_1C = v34;
|
|
|
+ pShape->eScaleY_20 = v38;
|
|
|
+ pShape->ePosTypeX_24 = v3c;
|
|
|
+ pShape->ePosTypeY_28 = v40;
|
|
|
+ char* p6 = nullptr;
|
|
|
+ // 001937AA
|
|
|
+ auto nameNode = node0.GetFirstChild("Name");
|
|
|
+ if (nameNode.IsValid()) {
|
|
|
+ p6 = node0.GetText("Name");
|
|
|
+ }
|
|
|
+ // loc_1937C8
|
|
|
+ pShape->SetName(p6);
|
|
|
+ return pShape;
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 001909c0 //^_-fs0,fs2,fs4赋值顺序有点差别
|
|
|
+bool GFX_FastOnScreenTest(CFTTMatrix32& mat0, CFTTVector32& vec1, CFTTVector32& vec2) {
|
|
|
+ float fs6 = vec2.float_0 + mat0.d[3][0];
|
|
|
+ float fs0 = vec1.float_0 + mat0.d[3][0];
|
|
|
+
|
|
|
+ float fs12 = vec1.float_4 + mat0.d[3][1];
|
|
|
+ float fs2 = vec2.float_4 + mat0.d[3][1];
|
|
|
+
|
|
|
+ float fs8 = vec1.float_8 + mat0.d[3][2];
|
|
|
+ float fs4 = vec2.float_8 + mat0.d[3][2];
|
|
|
+
|
|
|
+ CFTTAABB32 aabb;
|
|
|
+ aabb.filed_30 = true;
|
|
|
+
|
|
|
+ aabb.filed_c.float_0 = fs6;
|
|
|
+ aabb.filed_0.float_0 = fs0;
|
|
|
+ aabb.filed_0.float_4 = fs12;
|
|
|
+ aabb.filed_c.float_4 = fs2;
|
|
|
+ aabb.filed_0.float_8 = fs8;
|
|
|
+ aabb.filed_c.float_8 = fs4;
|
|
|
+
|
|
|
+ return CFTTCamera::IsAABBInFrustum(aabb, nullptr);
|
|
|
+}
|
|
|
+//-------------------------------------------------------------------------------------------------
|
|
|
+// 00193590 //^_^
|
|
|
+CAdElement* GetPrimitiveElement(CFTTXmlReaderNode node0, EAdElPrimitive e1) {
|
|
|
+ auto attPoint8 = GetPointAttribute(node0.GetFirstChild("Position"));
|
|
|
+ auto attPoint6 = GetPointAttribute(node0.GetFirstChild("Size"));
|
|
|
+ // 001935C0
|
|
|
+ auto attColor5 = GetColourAttribute(node0.GetFirstChild("Colour"));
|
|
|
+
|
|
|
+ eAlignmentX e20;
|
|
|
+ eAlignmentY e24;
|
|
|
+ GetAlignment(node0, e20, e24);
|
|
|
+
|
|
|
+ // 001935D6
|
|
|
+ eScaleX e28;
|
|
|
+ eScaleY e2c;
|
|
|
+ GetScale(node0, e28, e2c);
|
|
|
+
|
|
|
+ ePosTypeX e30;
|
|
|
+ ePosTypeY e34;
|
|
|
+ GetPosType(node0, e30, e34);
|
|
|
+ // 001935EC
|
|
|
+ CAdElement* pElement = nullptr;
|
|
|
+ if (e1 == EAdElPrimitive_0) {
|
|
|
+ // loc_1935F8
|
|
|
+ pElement = new CAdElRectangle;
|
|
|
+ pElement->b2C = true;
|
|
|
+ pElement->attLen_10 = nullptr;
|
|
|
+ pElement->attPos_4 = attPoint8;
|
|
|
+ pElement->attSize_8 = attPoint6;
|
|
|
+ pElement->attColor_C = attColor5;
|
|
|
+ } else if (e1 == EAdElPrimitive_1) {
|
|
|
+ // loc_1935FC
|
|
|
+ pElement = new CAdElCircle;
|
|
|
+ pElement->b2C = true;
|
|
|
+ pElement->attLen_10 = nullptr;
|
|
|
+ pElement->attPos_4 = attPoint8;
|
|
|
+ pElement->attSize_8 = attPoint6;
|
|
|
+ pElement->attColor_C = attColor5;
|
|
|
+ }
|
|
|
+ // loc_19361E
|
|
|
+ pElement->eAlignmentX_14 = e20;
|
|
|
+ pElement->eAlignmentY_18 = e24;
|
|
|
+ pElement->eScaleX_1C = e28;
|
|
|
+ pElement->eScaleY_20 = e2c;
|
|
|
+ pElement->ePosTypeX_24 = e30;
|
|
|
+ pElement->ePosTypeY_28 = e34;
|
|
|
+
|
|
|
+ // 00193636
|
|
|
+ auto node38 = node0.GetFirstChild("Name");
|
|
|
+ char* pStr;
|
|
|
+ if (node38.IsValid()) {
|
|
|
+ // 00193648
|
|
|
+ pStr = node0.GetText("Name");
|
|
|
+ } else { // loc_193656
|
|
|
+ pStr = nullptr;
|
|
|
+ }
|
|
|
+ // loc_193658
|
|
|
+ pElement->SetName(pStr);
|
|
|
+ return pElement;
|
|
|
+}
|
|
|
+
|
|
|
+// 00193330 //乱写的
|
|
|
+SH_NEV_INLINE void CAdElement::SetName(char const* p1) {
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (nullptr == p1)
|
|
|
+ return;
|
|
|
+ if (nullptr == attPos_4 || nullptr == attSize_8)
|
|
|
+ return;
|
|
|
+ if (attPos_4->mem_00.fx_0 != attSize_8->mem_00.fx_0)
|
|
|
+ attPos_4->mem_00 = attSize_8->mem_00;
|
|
|
+
|
|
|
+ if (attPos_4->mem_08.fx_0 != attSize_8->mem_08.fx_0)
|
|
|
+ attPos_4->mem_08 = attSize_8->mem_08;
|
|
|
+
|
|
|
+ attPos_4->pBuf_10 = (int*)p1;
|
|
|
+ attSize_8->pBuf_10 = nullptr;
|
|
|
+ field_2D = rand() % 20;
|
|
|
+}
|
|
|
+
|
|
|
+// 001937FC 有数据结构没有实现, 而且跟广告相关, 先合并放着吧
|
|
|
+//???
|
|
|
+CAdElement* GetImageElement(CFTTXmlReaderNode nd0) {
|
|
|
+#if 1
|
|
|
+ return nullptr;
|
|
|
+#else
|
|
|
+ CAdAttribute<float, TAdFloatInterpolator>*R0_9, *R5_5;
|
|
|
+ CAdAttribute<TPointF, TAdPointInterpolator>*R0_50, *R0_20, *R9_2, *R1_5, *R2_5;
|
|
|
+ CAdAttribute<uint, TAdColourInterpolator>*R0_21, *R10_1, *R3_5;
|
|
|
+ eAlignmentX* R1_2;
|
|
|
+ eAlignmentY* R2_2;
|
|
|
+ CFTTXmlReaderNode var_28, var_24, var_20,
|
|
|
+ R0_0, R0_3, R0_4, R0_5, R0_6, R0_11, R0_12, R0_13, R0_14, R0_15, *R0_2, *R0_32;
|
|
|
+ eScaleX var_1C;
|
|
|
+ eScaleY var_18;
|
|
|
+ ePosTypeX var_14;
|
|
|
+ ePosTypeY var_10;
|
|
|
+ CFTTXmlReaderNode var_0C;
|
|
|
+ char *R0_1, *R1_0, *R11_30, *R0_34, *R1_30;
|
|
|
+ const char* R7_2;
|
|
|
+ int R0_40, R0_25, R6_5;
|
|
|
+ CAdElement* R0_16;
|
|
|
+
|
|
|
+ var_28 = nd0;
|
|
|
+
|
|
|
+ R0_0 = nd0;
|
|
|
+ R0_1 = XMLGetString(R0_0, "File", NULL, NULL);
|
|
|
+
|
|
|
+ R1_0 = R0_1;
|
|
|
+ R0_40 = strcmp("ads_as.png", R1_0);
|
|
|
+
|
|
|
+ R0_2 = &var_28;
|
|
|
+
|
|
|
+ R0_3 = R0_2->GetFirstChild("Position"); // call
|
|
|
+ R0_50 = GetPointAttribute(R0_3);
|
|
|
+
|
|
|
+ R0_4 = R0_2->GetFirstChild("Size");
|
|
|
+ R0_20 = GetPointAttribute(R0_4);
|
|
|
+
|
|
|
+ R9_2 = R0_20;
|
|
|
+
|
|
|
+ R0_5 = R0_2->GetFirstChild("Colour");
|
|
|
+ R0_21 = GetColourAttribute(R0_5);
|
|
|
+ R10_1 = R0_21;
|
|
|
+
|
|
|
+ R0_6 = R0_2->GetFirstChild("Rotation");
|
|
|
+ var_24 = R0_6;
|
|
|
+
|
|
|
+ R7_2 = "ads_gp.png";
|
|
|
+
|
|
|
+ // 0019385E
|
|
|
+ if (R0_40 != 0) {
|
|
|
+ // 00193868
|
|
|
+ R7_2 = R0_1;
|
|
|
+ // 00193868
|
|
|
+ }
|
|
|
+
|
|
|
+ // 0019386E
|
|
|
+ if ((&var_24)->IsValid() == 0) {
|
|
|
+ // 00193882
|
|
|
+ CAdAttribute<float, TAdFloatInterpolator>* R0_9 = new CAdAttribute<float, TAdFloatInterpolator>(0, 0);
|
|
|
+ R5_5 = R0_9;
|
|
|
+ // 00193896
|
|
|
+ } else {
|
|
|
+ // 00193870
|
|
|
+ R0_11 = (&var_28)->GetFirstChild("Rotation");
|
|
|
+ CAdAttribute<float, TAdFloatInterpolator>* R0_23 = GetFloatAttribute(R0_11);
|
|
|
+ R5_5 = R0_23;
|
|
|
+ // 00193880
|
|
|
+ }
|
|
|
+
|
|
|
+ R0_12 = var_28;
|
|
|
+ R11_30 = NULL;
|
|
|
+ char const* R2_100 = "Remote";
|
|
|
+ R0_25 = GetFlag(R0_12, R2_100, 0);
|
|
|
+
|
|
|
+ R0_13 = var_28;
|
|
|
+ R1_2 = (eAlignmentX*)(&var_24);
|
|
|
+ R2_2 = (eAlignmentY*)&var_20;
|
|
|
+ GetAlignment(R0_13, *R1_2, *R2_2);
|
|
|
+
|
|
|
+ R0_14 = var_28;
|
|
|
+ GetScale(R0_14, var_1C, var_18); //`m
|
|
|
+
|
|
|
+ R0_15 = var_28;
|
|
|
+ GetPosType(R0_15, var_14, var_10);
|
|
|
+
|
|
|
+ R1_5 = R0_50;
|
|
|
+ R2_5 = R9_2;
|
|
|
+ R3_5 = R10_1;
|
|
|
+ R6_5 = R0_25;
|
|
|
+ R0_16 = new CAdElImage(R1_5, R2_5, R3_5, R5_5, R7_2, R6_5);
|
|
|
+
|
|
|
+ R0_16->eAlignmentX_14 = *(eAlignmentX*)&var_24;
|
|
|
+ R0_16->eAlignmentY_18 = *(eAlignmentY*)&var_20;
|
|
|
+ R0_16->eScaleX_1C = var_1C;
|
|
|
+ R0_16->eScaleY_20 = var_18;
|
|
|
+
|
|
|
+ R0_16->ePosTypeX_24 = var_14;
|
|
|
+ R0_16->ePosTypeY_28 = var_10;
|
|
|
+
|
|
|
+ var_0C = (&var_28)->GetFirstChild("Name");
|
|
|
+
|
|
|
+ R0_32 = &var_0C;
|
|
|
+ // 0019390E
|
|
|
+ if (!R0_32->IsValid()) {
|
|
|
+ } else {
|
|
|
+ // 00193910
|
|
|
+ R0_34 = (&var_28)->GetText("Name");
|
|
|
+ R11_30 = R0_34;
|
|
|
+ // 0019391A
|
|
|
+ }
|
|
|
+
|
|
|
+ R1_30 = R11_30;
|
|
|
+ R0_16->SetName(R1_30);
|
|
|
+
|
|
|
+ return R0_16;
|
|
|
+#endif
|
|
|
+}
|