Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // .lgo
- public: virtual long __thiscall MindPower::lwGeomObjInfo::Load(const char * file) {
- /* line 2814 [0x0001:0x00179b90] [0x9] */
- /* line 2815 [0x0001:0x00179b99] [0x14] */ _iobuf *fp = fopen(file, "rb");
- /* line 2816 [0x0001:0x00179bad] [0x6] */ if (!fp)
- /* line 2817 [0x0001:0x00179bb3] [0x5] */ return -1;
- /* line 2819 [0x0001:0x00179bb8] [0x14] */ unsigned long version;
- /* line 2820 [0x0001:0x00179bb8] [0x14] */ fread(*version, 4, 1, fp);
- /* line 2822 [0x0001:0x00179bcc] [0x13] */ long ret = this->Load(fp, version);
- /* line 2824 [0x0001:0x00179bdf] [0x6] */ if (fp)
- /* line 2826 [0x0001:0x00179be5] [0xc] */ fclose(fp);
- /* line 2829 [0x0001:0x00179bf1] [0x3] */ return ret;
- /* line 2831 [0x0001:0x00179bf4] [0x6] */
- }
- public: long __thiscall MindPower::lwGeomObjInfo::Load(struct _iobuf *fp, unsigned long version) {
- /* line 2709 [0x0001:0x001799f0] [0x7] */
- /* line 2710 [0x0001:0x001799f7] [0x17] */ fread(*(this->id), sizeof(MindPower::lwGeomObjInfo::lwGeomObjInfoHeader), 1, fp); // read a structure of MindPower::lwGeomObjInfo::lwGeomObjInfoHeader
- /* line 2713 [0x0001:0x00179a0e] [0xf] */ this->state_ctrl.SetState(5, 0);
- /* line 2714 [0x0001:0x00179a1d] [0xf] */ this->state_ctrl.SetState(3, 1);
- /* line 2717 [0x0001:0x00179a2c] [0xc] */ if (this->mtl_size > 100000) {
- /* line 2719 [0x0001:0x00179a38] [0x14] */ MessageBoxA(0,"iii", "error", 0);
- /* line 2720 [0x0001:0x00179a4c] [0x8] */ return -1;
- /* line 2721 [0x0001:0x00179a4c] [0x8] */ };
- /* line 2725 [0x0001:0x00179a54] [0x9] */ if (this->mtl_size > 0)
- /* line 2727 [0x0001:0x00179a5d] [0x1e] */ MindPower::lwLoadMtlTexInfo(this->mtl_seq, this->mtl_num, fp, version);
- /* line 2731 [0x0001:0x00179a7b] [0x9] */ if (this->mesh_size > 0)
- /* line 2733 [0x0001:0x00179a84] [0x1a] */ MindPower::lwMeshInfo_Load(*(this->mesh), fp, version);
- /* line 2737 [0x0001:0x00179a9e] [0x9] */ if (this->helper_size > 0)
- /* line 2739 [0x0001:0x00179aa7] [0x16] */ this->helper_data.Load(fp, version);
- /* line 2743 [0x0001:0x00179abd] [0x9] */ if (this->anim_size > 0)
- /* line 2745 [0x0001:0x00179ac6] [0x16] */ this->anim_data.Load(fp, version);
- /* line 2777 [0x0001:0x00179adc] [0x2] */ return 0;
- /* line 2779 [0x0001:0x00179ade] [0x6] */
- }
- public: void __thiscall MindPower::lwStateCtrl::SetState(unsigned long state, unsigned char value) {
- /* line 515 [0x0001:0x0017b7d0] [0x18] */ this->_state_seq = value;
- }
- long __cdecl MindPower::lwLoadMtlTexInfo(struct MindPower::lwMtlTexInfo **out_buf, unsigned long *out_num, struct _iobuf *fp, unsigned long version) {
- /* line 258 [0x0001:0x00171d70] [0x1b] */
- /* line 259 [0x0001:0x00171d8b] [0x7] */ MindPower::lwMtlTexInfo *buf;
- /* line 260 [0x0001:0x00171d92] [0x7] */ unsigned long num = 0;
- /* line 262 [0x0001:0x00171d99] [0x6] */ if (version == 0) {
- /* line 264 [0x0001:0x00171d9f] [0x14] */ unsigned long old_version;
- /* line 265 [0x0001:0x00171d9f] [0x14] */ fread(*old_version, sizeof(unsigned long), 1, fp);
- /* line 266 [0x0001:0x00171db3] [0x6] */ version = old_version;
- /* line 267 [0x0001:0x00171db3] [0x6] */ };
- /* line 269 [0x0001:0x00171db9] [0x14] */ fread(*num, sizeof(unsigned long), 1, fp);
- /* line 270 [0x0001:0x00171dcd] [0x61] */ buf = new (MindPower::lwMtlTexInfo())[num];
- /* line 272 [0x0001:0x00171e2e] [0x1a] */ for (unsigned long i = 0; i < num; i++) {
- /* line 274 [0x0001:0x00171e48] [0x1d] */ MindPower::lwMtlTexInfo_Load(*(buf[i]), fp, version);
- /* line 275 [0x0001:0x00171e65] [0x2] */ }
- /* line 277 [0x0001:0x00171e67] [0x8] */ *out_buf = buf;
- /* line 278 [0x0001:0x00171e6f] [0x8] */ out_num = num;
- /* line 280 [0x0001:0x00171e77] [0x2] */ return 0;
- /* line 281 [0x0001:0x00171e79] [0xe] */
- }
- long __cdecl MindPower::lwMtlTexInfo_Load(struct MindPower::lwMtlTexInfo *info, struct _iobuf *fp, unsigned long version) {
- /* line 38 [0x0001:0x001714b0] [0x14] */
- /* line 39 [0x0001:0x001714c4] [0x9] */ if (version >= 0x1000) {
- /* line 41 [0x0001:0x001714cd] [0x14] */ fread(*(info->opacity), sizeof(float), 1, fp);
- /* line 42 [0x0001:0x001714e1] [0x17] */ fread(*(info->transp_type), sizeof(unsigned long), 1, fp);
- /* line 43 [0x0001:0x001714f8] [0x17] */ fread(*(info->mtl), sizeof(MindPower::lwMaterial), 1, fp);
- /* line 44 [0x0001:0x0017150f] [0x17] */ fread(*(info->rs_set), sizeof(MindPower::lwRenderStateAtom)*8, 1, fp);
- /* line 45 [0x0001:0x00171526] [0x1c] */ fread(*(info->tex_seq), sizeof(MindPower::lwTexInfo)*4, 1, fp);
- /* line 47 [0x0001:0x00171542] [0xb] */ } else if (version = 2) {
- /* line 49 [0x0001:0x0017154d] [0x14] */ fread(*(info->opacity), sizeof(float), 1, fp);
- /* line 50 [0x0001:0x00171561] [0x17] */ fread(*(info->transp_type), sizeof(unsigned long), 1, fp);
- /* line 51 [0x0001:0x00171578] [0x17] */ fread(*(info->mtl), sizeof(MindPower::lwMaterial), 1, fp);
- /* line 52 [0x0001:0x0017158f] [0x17] */ fread(*(info->rs_set), sizeof(MindPower::lwRenderStateAtom)*8, 1, fp);
- /* line 53 [0x0001:0x001715a6] [0x1d] */ fread(*(info->tex_seq), sizeof(MindPower::lwTexInfo)*4, 1, fp);
- /* line 55 [0x0001:0x001715c3] [0xf] */ } else if (version = 1) {
- /* line 58 [0x0001:0x001715d2] [0x14] */ fread(*(info->opacity), sizeof(float), 1, fp);
- /* line 59 [0x0001:0x001715e6] [0x17] */ fread(*(info->transp_type), sizeof(unsigned long), 1, fp);
- /* line 60 [0x0001:0x001715fd] [0x17] */ fread(*(info->mtl), sizeof(MindPower::lwMaterial), 1, fp);
- /* line 61 [0x0001:0x00171614] [0x1a] */ MindPower::lwRenderStateSetTemplate<2,8> rsm;
- /* line 62 [0x0001:0x00171614] [0x1a] */ fread(*rsm, sizeof(MindPower::lwRenderStateSetTemplate<2,8>), 1, fp);
- /* line 63 [0x0001:0x0017162e] [0x1a] */ MindPower::lwTexInfo_0001 tex_info[4];
- /* line 64 [0x0001:0x0017162e] [0x1a] */ fread(*tex_info, sizeof(MindPower::lwTexInfo_0001)*4, 1, fp);
- /* line 67 [0x0001:0x00171648] [0x28] */ for (unsigned long i = 0; i < 8; i++) {
- /* line 69 [0x0001:0x00171670] [0x13] */ MindPower::lwRenderStateValue *rsv = *(rsm[0][i]);
- /* line 70 [0x0001:0x00171683] [0xb] */ if (rsv->state == -1)
- /* line 71 [0x0001:0x0017168e] [0x5] */ break;
- /* line 73 [0x0001:0x00171693] [0x22] */ unsigned long v;
- /* line 74 [0x0001:0x00171693] [0x22] */ if (rsv->state == 25) {
- /* line 77 [0x0001:0x001716b5] [0xa] */ v = 5;
- /* line 78 [0x0001:0x001716bf] [0x2] */ } else if (rsv->state == 24) {
- /* line 80 [0x0001:0x001716c1] [0xa] */ v = 129;
- /* line 81 [0x0001:0x001716cb] [0x2] */ } else {
- /* line 83 [0x0001:0x001716cd] [0xf] */ v = rsv->value;
- /* line 84 [0x0001:0x001716cd] [0xf] */ };
- /* line 86 [0x0001:0x001716dc] [0x18] */ info->rs_set[i].state = rsv->state;
- /* line 87 [0x0001:0x001716f4] [0x16] */ info->rs_set[i].value0 = v;
- /* line 88 [0x0001:0x0017170a] [0x16] */ info->rs_set[i].value1 = v;
- /* line 89 [0x0001:0x00171720] [0x5] */ };
- /* line 93 [0x0001:0x00171725] [0x28] */ for (unsigned long i = 0; i < 4; i++) {
- /* line 95 [0x0001:0x0017174d] [0x16] */ MindPower::lwTexInfo_0001 *p = *(tex_info[i]);
- /* line 97 [0x0001:0x00171763] [0x8] */ if (p->state == -1)
- /* line 98 [0x0001:0x0017176b] [0x5] */ break;
- /* line 100 [0x0001:0x00171770] [0x1c] */ MindPower::lwTexInfo *t = *(info->tex_seq[i])
- /* line 102 [0x0001:0x0017178c] [0xf] */ t->level = p->level;
- /* line 103 [0x0001:0x0017179b] [0xf] */ t->usage = p->usage;
- /* line 104 [0x0001:0x001717aa] [0xf] */ t->pool = p->pool;
- /* line 105 [0x0001:0x001717b9] [0xf] */ t->type = p->type;
- /* line 107 [0x0001:0x001717c8] [0xf] */ t->width = p->width;
- /* line 108 [0x0001:0x001717d7] [0xf] */ t->height = p->height;
- /* line 110 [0x0001:0x001717e6] [0xd] */ t->stage = p->stage;
- /* line 111 [0x0001:0x001717f3] [0xf] */ t->format = p->format;
- /* line 112 [0x0001:0x00171802] [0xf] */ t->colorkey = p->colorkey;
- /* line 113 [0x0001:0x00171811] [0xf] */ t->colorkey_type = p->colorkey_type;
- /* line 114 [0x0001:0x00171820] [0xf] */ t->byte_alignment_flag = p->byte_alignment_flag;
- /* line 115 [0x0001:0x0017182f] [0x19] */ strcpy(t->file_name, p->file_name);
- /* line 118 [0x0001:0x00171848] [0x24] */ for (unsigned long j = 0; j < 8, j++) {
- /* line 120 [0x0001:0x0017186c] [0x13] */ MindPower::lwRenderStateValue *rsv = *(p->tss_set[j][0]);
- /* line 121 [0x0001:0x0017187f] [0xb] */ if (rsv->state == -1)
- /* line 122 [0x0001:0x0017188a] [0x2] */ break;
- /* line 124 [0x0001:0x0017188c] [0x1b] */ t->tss_set[j].state = rsv->state;
- /* line 125 [0x0001:0x001718a7] [0x1c] */ t->tss_set[j].value0 = rsv->value;
- /* line 126 [0x0001:0x001718c3] [0x1c] */ t->tss_set[j].value1 = rsv->value;
- /* line 127 [0x0001:0x001718df] [0x5] */ };
- /* line 128 [0x0001:0x001718e4] [0x5] */ };
- /* line 130 [0x0001:0x001718e9] [0xf] */ } else if (version == 0) {
- /* line 133 [0x0001:0x001718f8] [0x17] */ fread(*(info->mtl),sizeof(MindPower::lwMaterial), 1, fp);
- /* line 134 [0x0001:0x0017190f] [0x1a] */ MindPower::lwRenderStateSetTemplate<2,8> rsm;
- /* line 135 [0x0001:0x0017190f] [0x1a] */ fread(*(rsm), sizeof(MindPower::lwRenderStateSetTemplate<2,8>), 1, fp);
- /* line 136 [0x0001:0x00171929] [0x1a] */ MindPower::lwTexInfo_0000 tex_info[4];
- /* line 137 [0x0001:0x00171929] [0x1a] */ fread(*(tex_info), sizeof(MindPower::lwTexInfo_0000)*4, 1, fp);
- /* line 140 [0x0001:0x00171943] [0x28] */ for (unsigned long i = 0; i < 8; i++) {
- /* line 142 [0x0001:0x0017196b] [0x13] */ MindPower::lwRenderStateValue *rsv = *(rsm[0][i]);
- /* line 143 [0x0001:0x0017197e] [0xb] */ if (rsv->state == -1)
- /* line 144 [0x0001:0x00171989] [0x5] */ break;
- /* line 146 [0x0001:0x0017198e] [0x22] */ unsigned long v;
- /* line 147 [0x0001:0x0017198e] [0x22] */ if (rsv->state == 25) {
- /* line 150 [0x0001:0x001719b0] [0xa] */ v = 5;
- /* line 151 [0x0001:0x001719ba] [0x2] */ } else if (rsv->state == 24) {
- /* line 153 [0x0001:0x001719bc] [0xa] */ v = 129;
- /* line 154 [0x0001:0x001719c6] [0x2] */ } else {
- /* line 156 [0x0001:0x001719c8] [0xf] */ v = rsv->value;
- /* line 157 [0x0001:0x001719c8] [0xf] */ };
- /* line 159 [0x0001:0x001719d7] [0x18] */ info->rs_set[i].state = rsv->state;
- /* line 160 [0x0001:0x001719ef] [0x16] */ info->rs_set[i].value0 = v;
- /* line 161 [0x0001:0x00171a05] [0x16] */ info->rs_set[i].value1 = v;
- /* line 162 [0x0001:0x00171a1b] [0x5] */ };
- /* line 166 [0x0001:0x00171a20] [0x28] */ for (unsigned long i = 0; i < 4; i++) {
- /* line 168 [0x0001:0x00171a48] [0x19] */ MindPower::lwTexInfo_0000 *p = *(tex_info[i]);
- /* line 170 [0x0001:0x00171a61] [0xb] */ if (p->state == -1)
- /* line 171 [0x0001:0x00171a6c] [0x5] */ break;
- /* line 173 [0x0001:0x00171a71] [0x1c] */ MindPower::lwTexInfo *t = *(info->tex_seq[i]);
- /* line 174 [0x0001:0x00171a8d] [0xd] */ t->level = 1;
- /* line 175 [0x0001:0x00171a9a] [0xd] */ t->usage = 0;
- /* line 176 [0x0001:0x00171aa7] [0xd] */ t->pool = 0;
- /* line 177 [0x0001:0x00171ab4] [0xd] */ t->type = 0;
- /* line 179 [0x0001:0x00171ac1] [0x10] */ t->stage = p->stage;
- /* line 180 [0x0001:0x00171ad1] [0x12] */ t->format = p->format;
- /* line 181 [0x0001:0x00171ae3] [0x12] */ t->colorkey = p->colorkey;
- /* line 182 [0x0001:0x00171af5] [0x12] */ t->colorkey_type = p->colorkey_type
- /* line 183 [0x0001:0x00171b07] [0xd] */ t->byte_alignment_flag = 0;
- /* line 184 [0x0001:0x00171b14] [0x1c] */ strcpy(t->file_name, p->file_name);
- /* line 187 [0x0001:0x00171b30] [0x24] */ for (unsigned long j = 0; j < 8; j++) {
- /* line 189 [0x0001:0x00171b54] [0x16] */ MindPower::lwRenderStateValue *rsv = *(p->tss_set[0][j]);
- /* line 190 [0x0001:0x00171b6a] [0xb] */ if (rsv->state == -1)
- /* line 191 [0x0001:0x00171b75] [0x2] */ break;
- /* line 193 [0x0001:0x00171b77] [0x1b] */ t->tss_set[j].state = rsv->state;
- /* line 194 [0x0001:0x00171b92] [0x1c] */ t->tss_set[j].value0 = rsv->value;
- /* line 195 [0x0001:0x00171bae] [0x1c] */ t->tss_set[j].value1 = rsv->value;
- /* line 196 [0x0001:0x00171bca] [0x5] */ };
- /* line 197 [0x0001:0x00171bcf] [0x5] */ };
- /* line 199 [0x0001:0x00171bd4] [0xc] */ if ( info->tex_seq[0].format == 26 )
- /* line 201 [0x0001:0x00171be0] [0xd] */ info->tex_seq[0].format = 25;
- /* line 204 [0x0001:0x00171bed] [0x2] */ } else {
- /* line 206 [0x0001:0x00171bef] [0x14] */ MessageBoxA(0, "invalid file version", "error", 0);
- /* line 207 [0x0001:0x00171c03] [0x8] */ return -1;
- /* line 208 [0x0001:0x00171c03] [0x8] */ };
- /* line 213 [0x0001:0x00171c0b] [0xd] */ info->tex_seq[0].pool = 1;
- /* line 214 [0x0001:0x00171c18] [0xd] */ info->tex_seq[0].level = 3;
- /* line 218 [0x0001:0x00171c25] [0x7] */ int transp_flag = 0;
- /* line 219 [0x0001:0x00171c2c] [0x24] */ unsigned long i;
- /* line 220 [0x0001:0x00171c2c] [0x24] */ for (i = 0; i < 8; i++) {
- /* line 222 [0x0001:0x00171c50] [0x13] */ MindPower::lwRenderStateAtom *rsa = &info->rs_set[i];
- /* line 224 [0x0001:0x00171c63] [0x8] */ if (rsa->state == -1 )
- /* line 225 [0x0001:0x00171c6b] [0x2] */ break;
- /* line 227 [0x0001:0x00171c6d] [0x1a] */ if ((rsa->state == 20)&&((rsa->value0 == 2)||(rsa->value0 == 4)))
- /* line 229 [0x0001:0x00171c87] [0x7] */ transp_flag = 1;
- /* line 231 [0x0001:0x00171c8e] [0x14] */ if ((rsa->state == 137)&&(rsa->value0 == 0))
- /* line 233 [0x0001:0x00171ca2] [0x9] */ transp_flag++;
- /* line 236 [0x0001:0x00171cab] [0x2] */ };
- /* line 238 [0x0001:0x00171cad] [0xf] */ if ((transp_flag = 1)&&(i < 7)
- /* line 240 [0x0001:0x00171cbc] [0x20] */ MindPower::RSA_VALUE(*(info->rs_set[i]), 137, 0);
- /* line 243 [0x0001:0x00171cdc] [0x2] */ return 0;
- /* line 244 [0x0001:0x00171cde] [0xf] */
- }
- long __cdecl MindPower::lwMeshInfo_Load(struct MindPower::lwMeshInfo *info, struct _iobuf *fp, unsigned long version) {
- /* line 1387 [0x0001:0x00174f60] [0x1e] */
- /* line 1388 [0x0001:0x00174f7e] [0x6] */ if (version == 0) {
- /* line 1390 [0x0001:0x00174f84] [0x14] */ unsigned long old_version;
- /* line 1391 [0x0001:0x00174f84] [0x14] */ fread(*(old_version), sizeof(unsigned long), 1, fp);
- /* line 1392 [0x0001:0x00174f98] [0x6] */ version = old_version;
- /* line 1393 [0x0001:0x00174f98] [0x6] */ };
- /* line 1396 [0x0001:0x00174f9e] [0x9] */ if (version >= 0x1004) {
- /* line 1398 [0x0001:0x00174fa7] [0x17] */ fread(*(info->header), sizeof(MindPower::lwMeshInfo::lwMeshInfoHeader), 1, fp);
- /* line 1400 [0x0001:0x00174fbe] [0xe] */ } else if (version >= 0x1003) {
- /* line 1402 [0x0001:0x00174fcc] [0x17] */ MindPower::lwMeshInfo_0003::lwMeshInfoHeader header;
- /* line 1403 [0x0001:0x00174fcc] [0x17] */ fread(*(header), sizeof(MindPower::lwMeshInfo_0003::lwMeshInfoHeader), 1, fp);
- /* line 1404 [0x0001:0x00174fe3] [0xb] */ info->header.fvf = header->fvf;
- /* line 1405 [0x0001:0x00174fee] [0xc] */ info->header.pt_type = header->pt_type;
- /* line 1406 [0x0001:0x00174ffa] [0xc] */ info->header.vertex_num = header->vertex_num;
- /* line 1407 [0x0001:0x00175006] [0x9] */ info->header.index_num = header->index_num;
- /* line 1408 [0x0001:0x0017500f] [0x9] */ info->header.subset_num = header->subset_num;
- /* line 1409 [0x0001:0x00175018] [0x9] */ info->header.bone_index_num = header->bone_index_num;
- /* line 1410 [0x0001:0x00175021] [0x13] */ info->header.bone_infl_factor = info->header.bone_index_num > 0 ? 2 : 0;
- /* line 1411 [0x0001:0x00175034] [0xa] */ info->header.vertex_element_num = 0;
- /* line 1413 [0x0001:0x0017503e] [0x18] */ } else if ((version >= 0x1000)||(version == 1)) {
- /* line 1415 [0x0001:0x00175056] [0x17] */ MindPower::lwMeshInfo_0003::lwMeshInfoHeader header;
- /* line 1416 [0x0001:0x00175056] [0x17] */ fread(header, sizeof(MindPower::lwMeshInfo_0003::lwMeshInfoHeader), 1, fp);
- /* line 1417 [0x0001:0x0017506d] [0xb] */ info->header.fvf = header->fvf;
- /* line 1418 [0x0001:0x00175078] [0xc] */ info->header.pt_type = header->pt_type;
- /* line 1419 [0x0001:0x00175084] [0xc] */ info->header.vertex_num = header->vertex_num;
- /* line 1420 [0x0001:0x00175090] [0xc] */ info->header.index_num = header->index_num;
- /* line 1421 [0x0001:0x0017509c] [0xc] */ info->header.subset_num = header->subset_num;
- /* line 1422 [0x0001:0x001750a8] [0xc] */ info->header.bone_index_num = header->bone_index_num;
- /* line 1423 [0x0001:0x001750b4] [0x13] */ info->header.bone_infl_factor = info->header.bone_index_num > 0 ? 2 : 0;
- /* line 1424 [0x0001:0x001750c7] [0xa] */ info->header.vertex_element_num = 0;
- /* line 1426 [0x0001:0x001750d1] [0xf] */ } else if (version == 0) {
- /* line 1428 [0x0001:0x001750e0] [0x1a] */ MindPower::lwMeshInfo_0000::lwMeshInfoHeader header;
- /* line 1429 [0x0001:0x001750e0] [0x1a] */ fread(*(header), sizeof(MindPower::lwMeshInfo_0000::lwMeshInfoHeader), 1, fp);
- /* line 1430 [0x0001:0x001750fa] [0xb] */ info->header.fvf = header->fvf;
- /* line 1431 [0x0001:0x00175105] [0xc] */ info->header.pt_type = header->pt_type;
- /* line 1432 [0x0001:0x00175111] [0xc] */ info->header.vertex_num = header->vertex_num;
- /* line 1433 [0x0001:0x0017511d] [0xc] */ info->header.index_num = header->index_num;
- /* line 1434 [0x0001:0x00175129] [0xc] */ info->header.subset_num = header->subset_num;
- /* line 1435 [0x0001:0x00175135] [0xc] */ info->header.bone_index_num = header->bone_index_num;
- /* line 1438 [0x0001:0x00175141] [0x28] */ for (unsigned long j = 0; j < 8; j++) {
- /* line 1440 [0x0001:0x00175169] [0x13] */ MindPower::lwRenderStateValue *rsv = &header->rs_set[i][0];
- /* line 1441 [0x0001:0x0017517c] [0xb] */ if (rsa->state == -1)
- /* line 1442 [0x0001:0x00175187] [0x5] */ break;
- /* line 1444 [0x0001:0x0017518c] [0x1c] */ unsigned long v;
- /* line 1445 [0x0001:0x0017518c] [0x1c] */ if (rsv->state == 147) {
- /* line 1448 [0x0001:0x001751a8] [0xa] */ v = 2;
- /* line 1449 [0x0001:0x001751b2] [0x2] */ } else {
- /* line 1451 [0x0001:0x001751b4] [0xf] */ v = rsv->value;
- /* line 1452 [0x0001:0x001751b4] [0xf] */ };
- /* line 1454 [0x0001:0x001751c3] [0x18] */ info->header.rs_set[i].state = rsv->state;
- /* line 1455 [0x0001:0x001751db] [0x16] */ info->header.rs_set[i].value0 = v;
- /* line 1456 [0x0001:0x001751f1] [0x16] */ info->header.rs_set[i].value1 = v;
- /* line 1457 [0x0001:0x00175207] [0x5] */ };
- /* line 1459 [0x0001:0x0017520c] [0x2] */ } else {
- /* line 1461 [0x0001:0x0017520e] [0x14] */ MessageBoxA(0, "invalid version", "error", 0);
- /* line 1461 [0x0001:0x0017520e] [0x14] */ };
- /* line 1465 [0x0001:0x00175222] [0xd] */ if (version >= 0x1004) {
- /* line 1467 [0x0001:0x0017522f] [0x9] */ if (info->header.vertex_element_num > 0) {
- /* line 1469 [0x0001:0x00175238] [0x27] */ info->vertex_element_seq = new _D3DVERTEXELEMENT9[info->header.vertex_element_num];
- /* line 1470 [0x0001:0x0017525f] [0x1f] */ fread(info->vertex_element_seq, sizeof(_D3DVERTEXELEMENT9), info->header.vertex_element_num, fp);
- /* line 1471 [0x0001:0x0017525f] [0x1f] */ };
- /* line 1473 [0x0001:0x0017527e] [0xd] */ if (info->header.vertex_num > 0) {
- /* line 1475 [0x0001:0x0017528b] [0x88] */ info->normal_seq = new D3DXVECTOR3[info->header.vertex_num];
- /* line 1476 [0x0001:0x00175313] [0x1f] */ fread(info->vertex_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
- /* line 1477 [0x0001:0x00175313] [0x1f] */ };
- /* line 1479 [0x0001:0x00175332] [0xe] */ if (info->header.fvf & 0x10) {
- /* line 1481 [0x0001:0x00175340] [0x88] */ info->normal_seq = new D3DXVECTOR3[info->header.vertex_num];
- /* line 1482 [0x0001:0x001753c8] [0x1f] */ fread(info->normal_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
- /* line 1483 [0x0001:0x001753c8] [0x1f] */ };
- /* line 1485 [0x0001:0x001753e7] [0x11] */ if (info->header.fvf & 0x100) {
- /* line 1487 [0x0001:0x001753f8] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1488 [0x0001:0x00175480] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1490 [0x0001:0x0017549f] [0x15] */ } else if (info->header.fvf & 0x200) {
- /* line 1492 [0x0001:0x001754b4] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1493 [0x0001:0x0017553c] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1494 [0x0001:0x001755c4] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1495 [0x0001:0x001755e3] [0x1f] */ fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1497 [0x0001:0x00175602] [0x15] */ } else if (info->fvf & 0x300) {
- /* line 1499 [0x0001:0x00175617] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->vertex_num];
- /* line 1500 [0x0001:0x0017569f] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->vertex_num];
- /* line 1501 [0x0001:0x00175727] [0x88] */ info->texcoord2_seq = new D3DXVECTOR2[info->vertex_num];
- /* line 1502 [0x0001:0x001757af] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
- /* line 1503 [0x0001:0x001757ce] [0x1f] */ fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
- /* line 1504 [0x0001:0x001757ed] [0x1f] */ fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
- /* line 1506 [0x0001:0x0017580c] [0x16] */ } else if (info->fvf & 0x400) {
- /* line 1508 [0x0001:0x00175822] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1509 [0x0001:0x001758aa] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1510 [0x0001:0x00175932] [0x88] */ info->texcoord2_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1511 [0x0001:0x001759ba] [0x88] */ info->texcoord3_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1512 [0x0001:0x00175a42] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1513 [0x0001:0x00175a61] [0x1f] */ fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1514 [0x0001:0x00175a80] [0x1f] */ fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1515 [0x0001:0x00175a9f] [0x1f] */ fread(info->texcoord3_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1516 [0x0001:0x00175a9f] [0x1f] */ };
- /* line 1518 [0x0001:0x00175abe] [0xa] */ if (info->header.fvf & 0x40) {
- /* line 1520 [0x0001:0x00175ac8] [0x27] */ info->vercol_seq = new unsigned long[info->header.vertex_num];
- /* line 1521 [0x0001:0x00175aef] [0x1f] */ fread(info->vercol_seq, sizeof(unsigned long), info->header.vertex_num, fp);
- /* line 1522 [0x0001:0x00175aef] [0x1f] */ };
- /* line 1524 [0x0001:0x00175b0e] [0xd] */ if (info->header.bone_index_num > 0) {
- /* line 1526 [0x0001:0x00175b1b] [0x27] */ info->blend_seq = new MindPower::lwBlendInfo[info->header.vertex_num];
- /* line 1527 [0x0001:0x00175b42] [0x27] */ info->bone_index_seq = new unsigned long[info->header.bone_index_num];
- /* line 1528 [0x0001:0x00175b69] [0x1f] */ fread(info->blend_seq, sizeof(MindPower::lwBlendInfo), info->header.vertex_num, fp);
- /* line 1529 [0x0001:0x00175b88] [0x1f] */ fread(info->bone_index_seq, sizeof(unsigned long), info->header.bone_index_num, fp);
- /* line 1530 [0x0001:0x00175b88] [0x1f] */ };
- /* line 1532 [0x0001:0x00175ba7] [0x9] */ if (info->header.index_num > 0) {
- /* line 1534 [0x0001:0x00175bb0] [0x27] */ info->index_seq = new unsigned long[info->header.index_num];
- /* line 1535 [0x0001:0x00175bd7] [0x1f] */ fread(info->index_seq, sizeof(unsigned long), info->header.index_num, fp);
- /* line 1536 [0x0001:0x00175bd7] [0x1f] */ };
- /* line 1538 [0x0001:0x00175bf6] [0x9] */ if (info->header.subset_num > 0) {
- /* line 1540 [0x0001:0x00175bff] [0x27] */ info->subset_seq = new MindPower::lwSubsetInfo[info->header.subset_num];
- /* line 1541 [0x0001:0x00175c26] [0x1f] */ fread(info->subset_seq, sizeof(MindPower::lwSubsetInfo), info->header.subset_num, fp);
- /* line 1544 [0x0001:0x00175c45] [0x5] */ };
- /* line 1545 [0x0001:0x00175c4a] [0x27] */ } else {
- /* line 1546 [0x0001:0x00175c4a] [0x27] */ info->header.subset_seq = new MindPower::lwSubsetInfo[info->header.subset_num];
- /* line 1547 [0x0001:0x00175c71] [0x1f] */ fread(info->subset_seq, sizeof(MindPower::lwSubsetInfo), info->header.subset_num, fp);
- /* line 1549 [0x0001:0x00175c90] [0x88] */ info->vertex_seq = new D3DXVECTOR3[info->header.vertex_num];
- /* line 1550 [0x0001:0x00175d18] [0x1f] */ fread(info->vertex_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
- /* line 1552 [0x0001:0x00175d37] [0xe] */ if (info->header.fvf & 0x10) {
- /* line 1554 [0x0001:0x00175d45] [0x88] */ info->normal_seq = new D3DXVECTOR3[info->header.vertex_num];
- /* line 1555 [0x0001:0x00175dcd] [0x1f] */ fread(info->normal_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
- /* line 1556 [0x0001:0x00175dcd] [0x1f] */ };
- /* line 1558 [0x0001:0x00175dec] [0x11] */ if (info->header.fvf & 0x100) {
- /* line 1560 [0x0001:0x00175dfd] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1561 [0x0001:0x00175e85] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1563 [0x0001:0x00175ea4] [0x15] */ } else if (info->header.fvf & 0x200) {
- /* line 1565 [0x0001:0x00175eb9] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1566 [0x0001:0x00175f41] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1567 [0x0001:0x00175fc9] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1568 [0x0001:0x00175fe8] [0x1f] */ fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1570 [0x0001:0x00176007] [0x15] */ } else if (info->fvf & 0x300) {
- /* line 1572 [0x0001:0x0017601c] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->vertex_num];
- /* line 1573 [0x0001:0x001760a4] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->vertex_num];
- /* line 1574 [0x0001:0x0017612c] [0x88] */ info->texcoord2_seq = new D3DXVECTOR2[info->vertex_num];
- /* line 1575 [0x0001:0x001761b4] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
- /* line 1576 [0x0001:0x001761d3] [0x1f] */ fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
- /* line 1577 [0x0001:0x001761f2] [0x1f] */ fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
- /* line 1579 [0x0001:0x00176211] [0x16] */ } else if (info->header.fvf & 0x400) {
- /* line 1581 [0x0001:0x00176227] [0x88] */ info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1582 [0x0001:0x001762af] [0x88] */ info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1583 [0x0001:0x00176337] [0x88] */ info->texcoord2_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1584 [0x0001:0x001763bf] [0x88] */ info->texcoord3_seq = new D3DXVECTOR2[info->header.vertex_num];
- /* line 1585 [0x0001:0x00176447] [0x1f] */ fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1586 [0x0001:0x00176466] [0x1f] */ fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1587 [0x0001:0x00176485] [0x1f] */ fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1588 [0x0001:0x001764a4] [0x1f] */ fread(info->texcoord3_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
- /* line 1589 [0x0001:0x001764a4] [0x1f] */ };
- /* line 1591 [0x0001:0x001764c3] [0xa] */ if (info->header.fvf & 0x40) {
- /* line 1593 [0x0001:0x001764cd] [0x27] */ info->vercol_seq = new unsigned long[info->header.vertex_num];
- /* line 1594 [0x0001:0x001764f4] [0x1f] */ fread(info->vercol_seq, sizeof(unsigned long), info->header.vertex_num, fp);
- /* line 1595 [0x0001:0x001764f4] [0x1f] */ };
- /* line 1597 [0x0001:0x00176513] [0x11] */ if (info->header.fvf & 0x1000) {
- /* line 1599 [0x0001:0x00176524] [0x27] */ info->blend_seq = new MindPower::lwBlendInfo[info->header.vertex_num];
- /* line 1601 [0x0001:0x0017654b] [0x21] */ unsigned char *byte_index_seq = new char[info->header.bone_index_num];
- /* line 1603 [0x0001:0x0017656c] [0x1f] */ fread(info->blend_seq, sizeof(MindPower::lwBlendInfo), info->header.vertex_num, fp);
- /* line 1604 [0x0001:0x0017658b] [0x1c] */ fread(byte_index_seq, sizeof(char), info->header.bone_index_num, fp);
- /* line 1607 [0x0001:0x001765a7] [0x27] */ info->bone_index_seq = new unsigned long[info->header.bone_index_num];
- /* line 1608 [0x0001:0x001765ce] [0x29] */ for (unsigned long i = 0; ; i++) {
- /* line 1610 [0x0001:0x001765f7] [0x21] */ info->bone_index_seq[i] = (char)byte_index_seq[i];
- /* line 1611 [0x0001:0x00176618] [0x2] */ };
- /* line 1613 [0x0001:0x0017661a] [0x1b] */ delete [] byte_index_seq;
- /* line 1614 [0x0001:0x0017661a] [0x1b] */ };
- /* line 1616 [0x0001:0x00176635] [0x9] */ if (info->header.index_num > 0) {
- /* line 1618 [0x0001:0x0017663e] [0x27] */ info->index_seq = new unsigned long[info->header.index_num];
- /* line 1619 [0x0001:0x00176665] [0x1f] */ fread(info->index_seq, sizeof(unsigned long), info->header.index_num, fp);
- /* line 1620 [0x0001:0x00176665] [0x1f] */ };
- /* line 1621 [0x0001:0x00176665] [0x1f] */ };
- /* line 1624 [0x0001:0x00176684] [0x2] */ return 0;
- /* line 1625 [0x0001:0x00176686] [0xe] */
- }
- public: long __thiscall MindPower::lwHelperInfo::Load(struct _iobuf *fp, unsigned long version) {
- /* line 2347 [0x0001:0x00178630] [0x9] */
- /* line 2348 [0x0001:0x00178639] [0x6] */ if (version == 0) {
- /* line 2350 [0x0001:0x0017863f] [0x14] */ unsigned long old_version;
- /* line 2351 [0x0001:0x0017863f] [0x14] */ fread(*(old_version), sizeof(unsigned long), 1, fp); // No messing around with 'version' O_o
- /* line 2352 [0x0001:0x00178653] [0x17] */ };
- /* line 2354 [0x0001:0x00178653] [0x17] */ fread(*(this->type), sizeof(unsigned long), 1, fp);
- /* line 2356 [0x0001:0x0017866a] [0xb] */ if (this->type & 0x1)
- /* line 2358 [0x0001:0x00178675] [0x10] */ this->_LoadHelperDummyInfo(fp, version);
- /* line 2361 [0x0001:0x00178685] [0xb] */ if (this->type & 0x2)
- /* line 2363 [0x0001:0x00178690] [0x10] */ this->_LoadHelperBoxInfo(fp, version);
- /* line 2366 [0x0001:0x001786a0] [0xb] */ if (this->type & 0x4)
- /* line 2368 [0x0001:0x001786ab] [0x10] */ this->_LoadHelperMeshInfo(fp, version);
- /* line 2371 [0x0001:0x001786bb] [0xb] */ if (this->type & 0x10)
- /* line 2373 [0x0001:0x001786c6] [0x10] */ this->_LoadBoundingBoxInfo(fp, version);
- /* line 2376 [0x0001:0x001786d6] [0xb] */ if (this->type & 0x20)
- /* line 2378 [0x0001:0x001786e1] [0x10] */ this->_LoadBoundingSphereInfo(fp, version);
- /* line 2381 [0x0001:0x001786f1] [0x2] */ return 0;
- /* line 2383 [0x0001:0x001786f3] [0x6] */
- }
- public: long __thiscall MindPower::lwHelperInfo::_LoadHelperDummyInfo(struct _iobuf *fp, unsigned long version) {
- /* line 2514 [0x0001:0x00178c80] [0x20] */
- /* line 2516 [0x0001:0x00178ca0] [0xd] */ if (version >= 0x1001) {
- /* line 2518 [0x0001:0x00178cad] [0x17] */ fread(*(this->dummy_num), sizeof(unsigned long), 1, fp);
- /* line 2519 [0x0001:0x00178cc4] [0x67] */ this->dummy_seq = new MindPower::lwHelperDummyInfo[this->dummy_num];
- /* line 2520 [0x0001:0x00178d2b] [0x1f] */ fread(this->dummy_seq, sizeof(MindPower::lwHelperDummyInfo), this->dummy_num, fp);
- /* line 2522 [0x0001:0x00178d4a] [0x12] */ } else if (version <= 0x1000) {
- /* line 2524 [0x0001:0x00178d5c] [0x17] */ fread(*(this->dummy_num), sizeof(unsigned long), 1, fp);
- /* line 2525 [0x0001:0x00178d73] [0x5e] */ struct MindPower::lwHelperDummyInfo_1000 *old_s = new MindPower::lwIndexMatrix44[this->dummy_num];
- /* line 2526 [0x0001:0x00178dd1] [0x19] */ fread(old_s, sizeof(MindPower::lwHelperDummyInfo_1000), this->dummy_num, fp);
- /* line 2528 [0x0001:0x00178dea] [0x67] */ this->dummy_seq = new MindPower::lwHelperDummyInfo[this->dummy_num];
- /* line 2529 [0x0001:0x00178e51] [0x1d] */ for (unsigned long i = 0; i < this->dummy_num; i++) {
- /* line 2531 [0x0001:0x00178e6e] [0x1e] */ this->dummy_seq[i]->id = old_s[i]->id
- /* line 2532 [0x0001:0x00178e8c] [0x27] */ this->dummy_seq[i]->mat = old_s[i]->mat;
- /* line 2533 [0x0001:0x00178eb3] [0x1a] */ this->dummy_seq[i]->parent_type = 0;
- /* line 2534 [0x0001:0x00178ecd] [0x1a] */ this->dummy_seq[i]->parent_id = 0;
- /* line 2535 [0x0001:0x00178ee7] [0x5] */ };
- /* line 2537 [0x0001:0x00178eec] [0x12] */ delete [] old_s;
- /* line 2538 [0x0001:0x00178eec] [0x12] */ };
- /* line 2540 [0x0001:0x00178efe] [0x2] */ return 0;
- /* line 2541 [0x0001:0x00178f00] [0x12] */
- }
- public: long __thiscall MindPower::lwHelperInfo::_LoadHelperBoxInfo(struct _iobuf *fp, unsigned long version) {
- /* line 2543 [0x0001:0x00178f20] [0x1e] */
- /* line 2544 [0x0001:0x00178f3e] [0x17] */ fread(*(this->box_num), sizeof(unsigned long), 1, fp);
- /* line 2546 [0x0001:0x00178f55] [0x67] */ this->box_seq = new MindPower::lwHelperBoxInfo[this->box_num];
- /* line 2547 [0x0001:0x00178fbc] [0x1f] */ fread(this->box_seq, sizeof(MindPower::lwHelperBoxInfo), this->box_num, fp);
- /* line 2549 [0x0001:0x00178fdb] [0xd] */ if (version <= 0x1001) {
- /* line 2552 [0x0001:0x00178fe8] [0x8] */ MindPower::lwBox_1001 old_b = MindPower::lwBox_1001();
- /* line 2553 [0x0001:0x00178ff0] [0x21] */ for (unsigned long i = 0; i < this->box_num, i++) {
- /* line 2555 [0x0001:0x00179011] [0x16] */ MindPower::lwBox *b = this->box_seq[i];
- /* line 2556 [0x0001:0x00179027] [0x14] */ old_b.p = b->c;
- /* line 2557 [0x0001:0x0017903b] [0x17] */ old_b.s = b->r;
- /* line 2559 [0x0001:0x00179052] [0x27] */ b->r = old_b.s / 2;
- /* line 2560 [0x0001:0x00179079] [0x26] */ b->c = old_b.p + b->r;
- /* line 2561 [0x0001:0x0017909f] [0x5] */ };
- /* line 2562 [0x0001:0x0017909f] [0x5] */ };
- /* line 2564 [0x0001:0x001790a4] [0x2] */ return 0;
- /* line 2565 [0x0001:0x001790a6] [0x10] */
- }
- public: long __thiscall MindPower::lwHelperInfo::_LoadHelperMeshInfo(struct _iobuf *fp, unsigned long version) {
- /* line 2567 [0x0001:0x001790c0] [0x1e] */
- /* line 2568 [0x0001:0x001790de] [0x17] */ fread(*(this->mesh_num), sizeof(unsigned long), 1, fp);
- /* line 2570 [0x0001:0x001790f5] [0x7d] */ this->mesh_seq = new MindPower::lwHelperMeshInfo[this->mesh_num];
- /* line 2574 [0x0001:0x00179172] [0x21] */ for (unsigned long i = 0; i < this->mesh_num; i++) {
- /* line 2576 [0x0001:0x00179193] [0x12] */ MindPower::lwHelperMeshInfo *info = this->mesh_seq[i];
- /* line 2578 [0x0001:0x001791a5] [0x14] */ fread(*(info->id), sizeof(unsigned long), 1, fp);
- /* line 2579 [0x0001:0x001791b9] [0x17] */ fread(*(info->type), sizeof(unsigned long), 1, fp);
- /* line 2580 [0x0001:0x001791d0] [0x17] */ fread(*(info->sub_type), sizeof(unsigned long), 1, fp);
- /* line 2581 [0x0001:0x001791e7] [0x17] */ fread(*(info->name), 20, 1, fp); // sizeof(info->name) = 20;
- /* line 2582 [0x0001:0x001791fe] [0x17] */ fread(*(info->state) sizeof(unsigned long), 1, fp);
- /* line 2583 [0x0001:0x00179215] [0x17] */ fread(*(info->mat), sizeof(D3DXMATRIX), 1, fp);
- /* line 2584 [0x0001:0x0017922c] [0x17] */ fread(*(info->box), sizeof(MindPower::lwBox), 1, fp);
- /* line 2585 [0x0001:0x00179243] [0x19] */ fread(*(info->vertex_num), sizeof(unsigned long), 1, fp);
- /* line 2586 [0x0001:0x0017925c] [0x1a] */ fread(*(info->face_num), sizeof(unsigned long), 1, fp);
- /* line 2588 [0x0001:0x00179276] [0x67] */ info->vertex_seq = new D3DXVECTOR4[info->vertex_num];
- /* line 2589 [0x0001:0x001792dd] [0x67] */ info->face_seq = new MindPower::lwHelperMeshFaceInfo[info->face_num];
- /* line 2591 [0x0001:0x00179344] [0x22] */ fread(info->vertex_seq, sizeof(D3DXVECTOR3), info->vertex_num, fp);
- /* line 2592 [0x0001:0x00179366] [0x22] */ fread(info->face_seq, sizeof(MindPower::lwHelperMeshFaceInfo), info->face_num, fp);
- /* line 2593 [0x0001:0x00179388] [0x5] */ };
- /* line 2595 [0x0001:0x0017938d] [0xd] */ if (version <= 0x1001) {
- /* line 2598 [0x0001:0x0017939a] [0x8] */ MindPower::lwBox_1001 old_b = MindPower::lwBox_1001();
- /* line 2599 [0x0001:0x001793a2] [0x21] */ for(unsigned long i = 0; i < this->mesh_num; i++) {
- /* line 2601 [0x0001:0x001793c3] [0x16] */ MindPower::lwBox *b = this->mesh_seq[i]->box;
- /* line 2602 [0x0001:0x001793d9] [0x14] */ old_b.p = b->c;
- /* line 2603 [0x0001:0x001793ed] [0x17] */ old_b.s = b->r;
- /* line 2605 [0x0001:0x00179404] [0x27] */ b->r = old_b.s / 2;
- /* line 2606 [0x0001:0x0017942b] [0x26] */ b->c = old_b.p + b->r;
- /* line 2607 [0x0001:0x00179451] [0x5] */ };
- /* line 2608 [0x0001:0x00179451] [0x5] */ };
- /* line 2610 [0x0001:0x00179456] [0x2] */ return 0;
- /* line 2611 [0x0001:0x00179458] [0x10] */
- }
- public: long __thiscall MindPower::lwHelperInfo::_LoadBoundingBoxInfo(struct _iobuf *fp, unsigned long version) {
- /* line 2614 [0x0001:0x00179470] [0x1e] */
- /* line 2615 [0x0001:0x0017948e] [0x17] */ fread(*(this->bbox_num), sizeof(unsigned long), 1, fp);
- /* line 2617 [0x0001:0x001794a5] [0x61] */ info->bbox_seq = new MindPower::lwBoundingBoxInfo[this->bbox_num];
- /* line 2619 [0x0001:0x00179506] [0x1c] */ fread(info->bbox_seq, sizeof(MindPower::lwBoundingBoxInfo), this->bbox_num, fp);
- /* line 2621 [0x0001:0x00179522] [0xd] */ if (version <= 0x1001) {
- /* line 2624 [0x0001:0x0017952f] [0x8] */ MindPower::lwBox_1001 old_b = MindPower::lwBox_1001();
- /* line 2625 [0x0001:0x00179537] [0x21] */ for (unsigned long i = 0; i < this->bbox_num; i++) {
- /* line 2627 [0x0001:0x00179558] [0x13] */ MindPower::lwBox *b = info->bbox_seq[i]->box;
- /* line 2628 [0x0001:0x0017956b] [0x14] */ old_b.p = b->c;
- /* line 2629 [0x0001:0x0017957f] [0x17] */ old_b.s = b->r;
- /* line 2631 [0x0001:0x00179596] [0x27] */ b->r = old_b.s / 2;
- /* line 2632 [0x0001:0x001795bd] [0x26] */ b->c = old_b.p + b->r;
- /* line 2633 [0x0001:0x001795e3] [0x5] */ };
- /* line 2634 [0x0001:0x001795e3] [0x5] */ };
- /* line 2636 [0x0001:0x001795e8] [0x2] */ return 0;
- /* line 2638 [0x0001:0x001795ea] [0x10] */
- }
- public: long __thiscall MindPower::lwHelperInfo::_LoadBoundingSphereInfo(struct _iobuf *fp, unsigned long version) {
- /* line 2640 [0x0001:0x00179600] [0x1e] */
- /* line 2641 [0x0001:0x0017961e] [0x17] */ fread(*(this->bsphere_num), sizeof(unsigned long), 1, fp);
- /* line 2643 [0x0001:0x00179635] [0x61] */ info->bsphere_seq = new MindPower::lwBoundingSphereInfo[this->bsphere_num];
- /* line 2645 [0x0001:0x00179696] [0x1c] */ fread(this->bsphere_seq, sizeof(MindPower::lwBoundingSphereInfo), this->bsphere_num, fp);
- /* line 2647 [0x0001:0x001796b2] [0x2] */ return 0;
- /* line 2648 [0x0001:0x001796b4] [0x10] */
- }
- public: long __thiscall MindPower::lwAnimDataInfo::Load(struct _iobuf *fp, unsigned long version) {
- /* line 1773 [0x0001:0x00176d30] [0x24] */
- /* line 1774 [0x0001:0x00176d54] [0x6] */ if (version = 0) {
- /* line 1776 [0x0001:0x00176d5a] [0x17] */ unsigned long old_version;
- /* line 1777 [0x0001:0x00176d5a] [0x17] */ fread(*(old_version), sizeof(unsigned long), 1, fp);
- /* line 1778 [0x0001:0x00176d5a] [0x17] */ };
- /* line 1780 [0x0001:0x00176d71] [0x14] */ unsigned long data_bone_size;
- /* line 1781 [0x0001:0x00176d71] [0x14] */ unsigned long data_mat_size;
- /* line 1782 [0x0001:0x00176d71] [0x14] */ unsigned long data_mtlopac_size[16];
- /* line 1783 [0x0001:0x00176d71] [0x14] */ unsigned long data_texuv_size[4][16];
- /* line 1784 [0x0001:0x00176d71] [0x14] */ unsigned long data_teximg_size[4][16];
- /* line 1785 [0x0001:0x00176d71] [0x14] */ fread(*(data_bone_size), sizeof(unsigned long), 1, fp);
- /* line 1786 [0x0001:0x00176d85] [0x17] */ fread(*(data_mat_size), sizeof(unsigned long), 1, fp);
- /* line 1788 [0x0001:0x00176d9c] [0x9] */ if (version >= 0x1005) {
- /* line 1790 [0x0001:0x00176da5] [0x17] */ fread(*(data_mtlopac_size), sizeof(data_mtlopac_size), 1, fp);
- /* line 1791 [0x0001:0x00176da5] [0x17] */ };
- /* line 1793 [0x0001:0x00176dbc] [0x1a] */ fread(*(data_texuv_size), sizeof(data_texuv_size), 1, fp);
- /* line 1794 [0x0001:0x00176dd6] [0x1a] */ fread(*(data_teximg_size), sizeof(data_teximg_size), 1, fp);
- /* line 1796 [0x0001:0x00176df0] [0x6] */ if (version > 0) {
- /* line 1798 [0x0001:0x00176df6] [0x5f] */ this->anim_bone = new MindPower::lwAnimDataBone();
- /* line 1799 [0x0001:0x00176e55] [0x16] */ this->anim_bone->Load(fp, version);
- /* line 1800 [0x0001:0x00176e55] [0x16] */ };
- /* line 1802 [0x0001:0x00176e6b] [0x9] */ if (data_mat_size > 0) {
- /* line 1808 [0x0001:0x00176e74] [0x5f] */ this->anim_mat = new MindPower::lwAnimDataMatrix();
- /* line 1809 [0x0001:0x00176ed3] [0x16] */ this->anim_mat->Load(fp, version);
- /* line 1810 [0x0001:0x00176ed3] [0x16] */ };
- /* line 1813 [0x0001:0x00176ee9] [0xd] */ if (version >= 0x1005) {
- /* line 1815 [0x0001:0x00176ef6] [0x28] */ for (unsigned long i = 0; i < 16; i++) {
- /* line 1817 [0x0001:0x00176f1e] [0x10] */ if (data_mtlopac_size[i] == 0 )
- /* line 1818 [0x0001:0x00176f2e] [0x2] */ continue;
- /* line 1820 [0x0001:0x00176f30] [0x66] */ this->anim_mtlopac[i] = new MindPower::lwAnimDataMtlOpacity();
- /* line 1821 [0x0001:0x00176f96] [0x1d] */ this->anim_mtlopac[i]->Load(fp, version);
- /* line 1822 [0x0001:0x00176fb3] [0x5] */ };
- /* line 1823 [0x0001:0x00176fb3] [0x5] */ };
- /* line 1825 [0x0001:0x00176fb8] [0x28] */ for(unsigned long i = 0; i < 16; i++) {
- /* line 1827 [0x0001:0x00176fe0] [0x28] */ for(unsigned long j = 0; j < 4; j++) {
- /* line 1829 [0x0001:0x00177008] [0x1c] */ if (data_texuv_size[i][j] == 0 )
- /* line 1830 [0x0001:0x00177024] [0x2] */ continue;
- /* line 1832 [0x0001:0x00177026] [0x72] */ this->anim_tex[i][j] = new MindPower::lwAnimDataTexUV();
- /* line 1833 [0x0001:0x00177098] [0x29] */ this->anim_tex[i][j]->Load(fp, version);
- /* line 1834 [0x0001:0x001770c1] [0x5] */ };
- /* line 1835 [0x0001:0x001770c6] [0x5] */ };
- /* line 1837 [0x0001:0x001770cb] [0x28] */ for (unsigned long i = 0; i < 16; i++) {
- /* line 1839 [0x0001:0x001770f3] [0x28] */ for(unsigned long j = 0; j < 4; j++) {
- /* line 1841 [0x0001:0x0017711b] [0x1c] */ if (data_teximg_size[i][j] == 0 )
- /* line 1842 [0x0001:0x00177137] [0x2] */ continue;
- /* line 1844 [0x0001:0x00177139] [0x78] */ this->anim_img[i][j] = new MindPower::lwAnimDataTexImg();
- /* line 1845 [0x0001:0x001771b1] [0x2c] */ this->anim_img[i][j]->Load();
- /* line 1846 [0x0001:0x001771dd] [0x5] */ };
- /* line 1847 [0x0001:0x001771e2] [0x5] */ };
- /* line 1849 [0x0001:0x001771e7] [0x2] */ return 0;
- /* line 1851 [0x0001:0x001771e9] [0x10] */
- }
- // .lab
- public: virtual long __thiscall MindPower::lwAnimDataBone::Load(const char * file) {
- /* line 746 [0x0001:0x00173300] [0x17] */
- /* line 747 [0x0001:0x00173317] [0x7] */ long ret = -1;
- /* line 749 [0x0001:0x0017331e] [0x14] */ _iobuf *fp = fopen(file, "rb");
- /* line 750 [0x0001:0x00173332] [0x6] */ if (fp) {
- /* line 751 [0x0001:0x00173338] [0x2] */ unsigned long version;
- /* line 754 [0x0001:0x0017333a] [0x14] */ fread(&version, sizeof(unsigned long), 1, fp);
- /* line 756 [0x0001:0x0017334e] [0x9] */ if ( version < 0x1000 ) {
- /* line 758 [0x0001:0x00173357] [0x7] */ version = 0;
- /* line 759 [0x0001:0x0017335e] [0x18] */ char buf[256];
- /* line 760 [0x0001:0x0017335e] [0x18] */ sprintf(&buf, "old animation file: %s, need re-export it", file);
- /* line 761 [0x0001:0x00173376] [0x16] */ MessageBoxA(0, &buf, "warning", 0);
- /* line 762 [0x0001:0x00173376] [0x16] */ };
- /* line 764 [0x0001:0x0017338c] [0x17] */ if (this->MindPower::lwAnimDataBone::Load(fp, version) >= 0) { // Overloaded version
- /* line 766 [0x0001:0x001733a3] [0x2] */ ret = 0;
- /* line 767 [0x0001:0x001733a5] [0x7] */ }
- /* line 768 [0x0001:0x001733a5] [0x7] */ };
- /* line 770 [0x0001:0x001733ac] [0x6] */ if (fp)
- /* line 772 [0x0001:0x001733b2] [0xc] */ fclose(fp);
- /* line 775 [0x0001:0x001733be] [0x3] */ return ret;
- /* line 777 [0x0001:0x001733c1] [0xe] */
- }
- public: long __thiscall MindPower::lwAnimDataBone::Load(struct _iobuf *fp, unsigned long version) {
- /* line 603 [0x0001:0x001729b0] [0x24] */
- /* line 604 [0x0001:0x001729d4] [0x6] */ if (version == 0) {
- /* line 606 [0x0001:0x001729da] [0x14] */ unsigned long old_version;
- /* line 607 [0x0001:0x001729da] [0x14] */ fread(old_version, sizeof(unsigned long), 1, fp);
- /* line 608 [0x0001:0x001729ee] [0x7] */ int x = 0;
- /* line 609 [0x0001:0x001729ee] [0x7] */ };
- /* line 612 [0x0001:0x001729f5] [0xc] */ if (this->_base_seq) {
- /* line 613 [0x0001:0x00172a01] [0x8] */ return -1;
- /* line 614 [0x0001:0x00172a01] [0x8] */ };
- /* line 615 [0x0001:0x00172a09] [0x1a] */ fread(*(this->_header), sizeof(MindPower::lwAnimDataBone::lwBoneInfoHeader), 1, fp);
- /* line 617 [0x0001:0x00172a23] [0x24] */ this->_base_seq = new MindPower::lwBoneBaseInfo[this->_header.bone_num];
- /* line 618 [0x0001:0x00172a47] [0x86] */ this->_key_seq = new MindPower::lwBoneKeyInfo[this->_header._bone_num];
- /* line 619 [0x0001:0x00172acd] [0x70] */ this->_invmat_seq = new D3DXMATRIX[this->_header._bone_num];
- /* line 620 [0x0001:0x00172b3d] [0x70] */ this->_dummy_seq = new MindPower::lwBoneDummyInfo[this->_header.dummy_num];
- /* line 622 [0x0001:0x00172bad] [0x22] */ fread(this->_base_seq, sizeof(MindPower::lwBoneBaseInfo), this->_header.bone_num, fp);
- /* line 623 [0x0001:0x00172bcf] [0x22] */ fread(this->_invmat_seq, sizeof(D3DXMATRIX), this->_header.bone_num, fp);
- /* line 624 [0x0001:0x00172bf1] [0x22] */ fread(this->_dummy_seq, sizeof(MindPower::lwBoneDummyInfo), this->_header.dummy_num, fp);
- /* line 629 [0x0001:0x00172c13] [0x37] */ if (this->_header.key_type == 1) {
- /* line 632 [0x0001:0x00172c4a] [0x24] */ for (unsigned long i = 0; i < this->_header.bone_num; i++) {
- /* line 634 [0x0001:0x00172c6e] [0x12] */ MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
- /* line 635 [0x0001:0x00172c80] [0x6c] */ key->mat43_seq = new MindPower::lwMatrix43[this->frame_num];
- /* line 636 [0x0001:0x00172cec] [0x1e] */ fread(key->mat43_seq, sizeof(MindPower::lwMatrix43), this->_header.frame_num, fp);
- /* line 637 [0x0001:0x00172d0a] [0x5] */ };
- /* line 638 [0x0001:0x00172d0f] [0x5] */ } else if (this->_header.key_type == 2) {
- /* line 640 [0x0001:0x00172d14] [0x24] */ for (unsigned long i = 0; i < this->_header.bone_num; i++) {
- /* line 642 [0x0001:0x00172d38] [0x12] */ MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
- /* line 643 [0x0001:0x00172d4a] [0x6d] */ key->mat44_seq = new D3DXMATRIX[this->_header.frame_num];
- /* line 644 [0x0001:0x00172db7] [0x1f] */ fread(key->mat44_seq, sizeof(D3DXMATRIX), this->_header.frame_num, fp);
- /* line 645 [0x0001:0x00172dd6] [0x5] */ };
- /* line 646 [0x0001:0x00172ddb] [0x5] */ } else if (this->_header.key_type == 3) {
- /* line 648 [0x0001:0x00172de0] [0xd] */ if (version >= 0x1003) {
- /* line 650 [0x0001:0x00172ded] [0x24] */ for (unsigned long i = 0; i < this->_header.bone_num; i++) {
- /* line 652 [0x0001:0x00172e11] [0x12] */ MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
- /* line 654 [0x0001:0x00172e23] [0x6d] */ key->pos_seq = new D3DXVECTOR3[this->_header.frame_num];
- /* line 655 [0x0001:0x00172e90] [0x1f] */ fread(key->pos_seq, sizeof(D3DXVECTOR3), this->_header.frame_num, fp);
- /* line 657 [0x0001:0x00172eaf] [0x6d] */ key->quat_seq = new D3DXQUATERNION[this->_header.frame_num];
- /* line 658 [0x0001:0x00172f1c] [0x1f] */ fread(key->quat_seq, sizeof(D3DXQUATERNION), this->_header.frame_num, fp);
- /* line 659 [0x0001:0x00172f3b] [0x5] */ };
- /* line 661 [0x0001:0x00172f40] [0x5] */ } else {
- /* line 663 [0x0001:0x00172f45] [0x24] */ for (unsigned long i = 0; i < this->_header.bone_num; i++) {
- /* line 665 [0x0001:0x00172f69] [0x12] */ MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
- /* line 667 [0x0001:0x00172f7b] [0x3a] */ unsigned long pos_num = this->_base_seq[i]->parent_id == -1 ? this->_header.frame_num : 1;
- /* line 669 [0x0001:0x00172fb5] [0x7f] */ key->pos_seq = new D3DXVECTOR3[this->_header.frame_num];
- /* line 670 [0x0001:0x00173034] [0x19] */ fread(key->pos_seq, sizeof(D3DXVECTOR3), pos_num, fp);
- /* line 672 [0x0001:0x0017304d] [0x6] */ if (pos_num == 1) {
- /* line 674 [0x0001:0x00173053] [0x20] */ for (unsigned long j = 1; j < this->_header.frame_num; j++) {
- /* line 676 [0x0001:0x00173073] [0x24] */ key->pos_seq[i] = key->pos_seq[0];
- /* line 677 [0x0001:0x00173097] [0x2] */ };
- /* line 678 [0x0001:0x00173097] [0x2] */ };
- /* line 680 [0x0001:0x00173099] [0x88] */ key->quat_seq = new D3DXQUATERNION[this->_header.frame_num];
- /* line 681 [0x0001:0x00173121] [0x1f] */ fread(key->quat_seq, sizeof(D3DXQUATERNION), this->_header.frame_num, fp);
- /* line 682 [0x0001:0x00173140] [0x5] */ };
- /* line 690 [0x0001:0x00173145] [0x2] */ };
- /* line 691 [0x0001:0x00173145] [0x2] */ };
- /* line 692 [0x0001:0x00173145] [0x2] */ return 0;
- /* line 694 [0x0001:0x00173147] [0x10] */
- }
- public: long __thiscall MindPower::lwAnimDataMatrix::Load(struct _iobuf *fp, unsigned long version) {
- /* line 1056 [0x0001:0x00173ea0] [0x1e] */
- /* line 1057 [0x0001:0x00173ebe] [0x17] */ fread(*(this->_frame_num), sizeof(unsigned long), 1, fp);
- /* line 1059 [0x0001:0x00173ed5] [0x61] */ this->_mat_seq = new MindPower::lwMatrix43[this->_frame_num];
- /* line 1060 [0x0001:0x00173f36] [0x1c] */ fread(this->_mat_seq, sizeof(MindPower::lwMatrix43), this->_frame_num, fp);
- /* line 1065 [0x0001:0x00173f52] [0x2] */ return 0;
- /* line 1067 [0x0001:0x00173f54] [0x10] */
- }
- public: long __thiscall MindPower::lwAnimDataMtlOpacity::Load(struct _iobuf *fp, unsigned long version) {
- /* line 522 [0x0001:0x00172620] [0x1e] */
- /* line 523 [0x0001:0x0017263e] [0x7] */ long ret = -1;
- /* line 527 [0x0001:0x00172645] [0x14] */ unsigned long num;
- /* line 528 [0x0001:0x00172645] [0x14] */ fread(*(num), sizeof(unsigned long), 1, fp);
- /* line 531 [0x0001:0x00172659] [0x18] */ MindPower::lwKeyFloat *seq = new MindPower::lwKeyFloat[num];
- /* line 533 [0x0001:0x00172671] [0x16] */ fread(seq, sizeof(MindPower::lwKeyFloat), num, fp);
- /* line 535 [0x0001:0x00172687] [0x44] */ this->_aks_ctrl = new MindPower::lwAnimKeySetFloat();
- /* line 537 [0x0001:0x001726cb] [0x1f] */ if (this->_aks_ctrl->SetKeySequence(seq, num) >= 0) {
- /* line 538 [0x0001:0x001726ea] [0x2] */ ret = 0;
- /* line 540 [0x0001:0x001726ec] [0x7] */ };
- /* line 542 [0x0001:0x001726f3] [0x3] */ return ret;
- /* line 544 [0x0001:0x001726f6] [0x10] */
- }
- public: long __thiscall MindPower::lwAnimDataTexUV::Load(struct _iobuf *fp, unsigned long version) {
- /* line 308 [0x0001:0x00171f60] [0x1e] */
- /* line 309 [0x0001:0x00171f7e] [0x17] */ fread(*(this->_frame_num), sizeof(unsigned long), 1, fp);
- /* line 311 [0x0001:0x00171f95] [0x61] */ this->_mat_seq = new D3DXMATRIX[this->_frame_num];
- /* line 312 [0x0001:0x00171ff6] [0x1c] */ fread(this->_mat_seq, sizeof(D3DXMATRIX), this->_frame_num, fp);
- /* line 317 [0x0001:0x00172012] [0x2] */ return 0;
- /* line 319 [0x0001:0x00172014] [0x10] */
- }
- public: long __thiscall MindPower::lwAnimDataTexImg::Load(struct _iobuf *fp, unsigned long version) {
- /* line 435 [0x0001:0x001722d0] [0x17] */
- /* line 436 [0x0001:0x001722e7] [0x6] */ long ret = 0;
- /* line 436 [0x0001:0x001722e7] [0x6] */ if (version == 0) {
- /* line 438 [0x0001:0x001722ed] [0x14] */ char buf[256];
- /* line 439 [0x0001:0x001722ed] [0x14] */ sprintf(*buf, "old version file, need re-export it");
- /* line 440 [0x0001:0x00172301] [0x16] */ MessageBoxA(0, &buf, "warning", 0);
- /* line 441 [0x0001:0x00172317] [0x5] */ ret = -1;
- /* line 444 [0x0001:0x0017231c] [0x1a] */ } else {
- /* line 445 [0x0001:0x0017231c] [0x1a] */ fread(*(this->_data_num), sizeof(unsigned long), 1, fp);
- /* line 446 [0x0001:0x00172336] [0x2d] */ this->_data_seq = new MindPower::lwTexInfo[this->_data_num];
- /* line 447 [0x0001:0x00172363] [0x25] */ fread(this->_data_seq, sizeof(MindPower::lwTexInfo), this->_data_num, fp);
- /* line 449 [0x0001:0x00172388] [0x2] */ };
- /* line 450 [0x0001:0x00172388] [0x2] */ return ret;
- /* line 451 [0x0001:0x0017238a] [0xe] */
- }
- // .lmo
- public: virtual long __thiscall MindPower::lwModelObjInfo::Load(const char *file) {
- /* line 2872 [0x0001:0x00179d20] [0x24] */
- /* line 2873 [0x0001:0x00179d44] [0x14] */ _iobuf *fp = fopen(file, "rb");
- /* line 2874 [0x0001:0x00179d58] [0x6] */ if ( !fp )
- /* line 2875 [0x0001:0x00179d5e] [0x8] */ return -1;
- /* line 2877 [0x0001:0x00179d66] [0x14] */ unsigned long version;
- /* line 2879 [0x0001:0x00179d66] [0x14] */ fread(&version, sizeof(unsigned long), 1, fp);
- /* line 2882 [0x0001:0x00179d7a] [0x14] */ unsigned long obj_num;
- /* line 2883 [0x0001:0x00179d7a] [0x14] */ fread(&obj_num, sizeof(unsigned long), 1, fp);
- /* line 2885 [0x0001:0x00179d8e] [0x19] */ MindPower::lwModelObjInfo::lwModelObjInfoHeader header[33];
- /* line 2886 [0x0001:0x00179d8e] [0x19] */ fread(&header, sizeof(MindPower::lwModelObjInfo::lwModelObjInfoHeader), obj_num, fp);
- /* line 2888 [0x0001:0x00179da7] [0xd] */ this->geom_obj_num = 0;
- /* line 2890 [0x0001:0x00179db4] [0x2a] */ for (unsigned long i = 0; i < obj_num; i++) {
- /* line 2892 [0x0001:0x00179dde] [0x1f] */ fseek(fp, header[i].addr, 0);
- /* line 2894 [0x0001:0x00179dfd] [0x31] */ if (header[i].type == 1) {
- /* line 2897 [0x0001:0x00179e2e] [0x6c] */ this->geom_obj_seq[this->geom_obj_num] = new MindPower::lwGeomObjInfo();
- /* line 2898 [0x0001:0x00179e9a] [0x6] */ if ( version == 0) {
- /* line 2900 [0x0001:0x00179ea0] [0x17] */ unsigned long old_version;
- /* line 2901 [0x0001:0x00179ea0] [0x17] */ fread(&old_version, 4, 1, fp);
- /* line 2902 [0x0001:0x00179ea0] [0x17] */ }
- /* line 2903 [0x0001:0x00179eb7] [0x20] */ this->geom_obj_seq[this->geom_obj_num]->MindPower::lwGeomObjInfo::Load(fp, version);
- /* line 2904 [0x0001:0x00179ed7] [0x15] */ this->geom_obj_num++;
- /* line 2905 [0x0001:0x00179eec] [0x2] */ } else if (header[i].type == 2) {
- /* line 2907 [0x0001:0x00179eee] [0x19] */ this->helper_data->MindPower::lwHelperInfo::Load(fp, version);
- /* line 2908 [0x0001:0x00179eee] [0x19] */ };
- /* line 2912 [0x0001:0x00179f07] [0x5] */ };
- /* line 2915 [0x0001:0x00179f0c] [0x6] */ if (fp)
- /* line 2917 [0x0001:0x00179f12] [0xc] */ fclose(fp);
- /* line 2920 [0x0001:0x00179f1e] [0x2] */ return 0;
- /* line 2922 [0x0001:0x00179f20] [0x10] */
- }
- public: long __thiscall MindPower::lwHelperDummyObjInfo::Load(struct _iobuf *fp, unsigned long version) {
- /* line 3078 [0x0001:0x0017a360] [0x1e] */
- /* line 3079 [0x0001:0x0017a37e] [0x7] */ long ret = -1;
- /* line 3081 [0x0001:0x0017a385] [0x17] */ fread(&this->_id, sizeof(unsigned long), 1, fp);
- /* line 3082 [0x0001:0x0017a39c] [0x17] */ fread(&this->_mat, sizeof(D3DXMATRIX), 1, fp);
- /* line 3084 [0x0001:0x0017a3b3] [0x23] */ if (this->_anim_data ) delete this->_anim_data;
- /* line 3086 [0x0001:0x0017a3d6] [0x7] */ unsigned long anim_data_flag = 0;
- /* line 3087 [0x0001:0x0017a3dd] [0x14] */ fread(&anim_data_flag, sizeof(unsigned long), 1, fp);
- /* line 3088 [0x0001:0x0017a3f1] [0xa] */ if (anim_data_flag == 1) {
- /* line 3090 [0x0001:0x0017a3fb] [0x41] */ MindPower::lwAnimDataMatrix *anim_data = new MindPower::lwAnimDataMatrix();
- /* line 3091 [0x0001:0x0017a43c] [0x12] */ if (anim_data->MindPower::lwAnimDataMatrix::Load(fp, 0) < 0) {
- /* line 3093 [0x0001:0x0017a44e] [0x28] */ delete anim_data;
- /* line 3094 [0x0001:0x0017a476] [0x2] */ return -1;
- /* line 3095 [0x0001:0x0017a476] [0x2] */ } else {
- /* line 3096 [0x0001:0x0017a478] [0x9] */ this->_anim_data = anim_data;
- /* line 3097 [0x0001:0x0017a478] [0x9] */ };
- /* line 3099 [0x0001:0x0017a481] [0x7] */ };
- /* line 3100 [0x0001:0x0017a481] [0x7] */ ret = 0;
- /* line 3102 [0x0001:0x0017a488] [0x3] */ return ret;
- /* line 3104 [0x0001:0x0017a48b] [0x10] */
- }
- public: long __thiscall MindPower::lwModelNodeInfo::Load(struct _iobuf *fp, unsigned long version) {
- /* line 3151 [0x0001:0x0017a640] [0x1e] */
- /* line 3152 [0x0001:0x0017a65e] [0x7] */ long ret = -1;
- /* line 3154 [0x0001:0x0017a665] [0x14] */ fread(&this->_head, sizeof(MindPower::lwModelNodeHeadInfo), 1, fp);
- /* line 3156 [0x0001:0x0017a679] [0x9] */ switch (this->_head.type) {
- /* line 3158 [0x0001:0x0017a682] [0x47] */ this->_data = new MindPower::lwGeomObjInfo();
- /* line 3159 [0x0001:0x0017a6c9] [0x17] */ if ((MindPower::lwGeomObjInfo *)(this->_data)->MindPower::lwGeomObjInfo::Load(fp, version) >= 0) ret = 0;
- /* line 3160 [0x0001:0x0017a6e0] [0x5] */ break;
- /* line 3162 [0x0001:0x0017a6e5] [0xe] */ case 2:
- /* line 3164 [0x0001:0x0017a6f3] [0x44] */ this->_data = new MindPower::lwAnimDataBone();
- /* line 3165 [0x0001:0x0017a737] [0x17] */ if ((MindPower::lwAnimDataBone *)(this->_data)->MindPower::lwAnimDataBone::Load(fp, version) >= 0) ret = 0;
- /* line 3166 [0x0001:0x0017a74e] [0x5] */ break;
- /* line 3168 [0x0001:0x0017a753] [0xe] */ case 3:
- /* line 3170 [0x0001:0x0017a761] [0x44] */ this->_data = new MindPower::lwHelperDummyObjInfo();
- /* line 3171 [0x0001:0x0017a7a5] [0x17] */ if ((MindPower::lwHelperDummyObjInfo *)(this->_data)->MindPower::lwHelperDummyObjInfo::Load(fp, version) >= 0) ret = 0;
- /* line 3172 [0x0001:0x0017a7bc] [0x2] */ break;
- /* line 3174 [0x0001:0x0017a7be] [0xb] */ case 4:
- /* line 3176 [0x0001:0x0017a7c9] [0x44] */ this->_data = new MindPower::lwHelperInfo();
- /* line 3177 [0x0001:0x0017a80d] [0x17] */ if ((MindPower::lwHelperInfo *)(this->_data)->MindPower::lwHelperInfo::Load(fp, version) >= 0) ret = 0;
- /* line 3178 [0x0001:0x0017a824] [0x2] */ break;
- /* line 3180 [0x0001:0x0017a826] [0x2] */ default:
- /* line 3182 [0x0001:0x0017a828] [0x2] */ };
- /* line 3185 [0x0001:0x0017a82a] [0x7] */
- /* line 3187 [0x0001:0x0017a831] [0x3] */ return ret;
- /* line 3188 [0x0001:0x0017a834] [0x10] */
- }
- // .lxo
- public: long __thiscall MindPower::lwModelInfo::Load(const char *file) {
- /* line 3302 [0x0001:0x0017a9b0] [0x1e] */
- /* line 3303 [0x0001:0x0017a9ce] [0x7] */ long ret = -1;
- /* line 3305 [0x0001:0x0017a9d5] [0x14] */ _iobuf *fp = fopen(file, "rb");
- /* line 3306 [0x0001:0x0017a9e9] [0x6] */ if (!fp) {
- /* line 3307 [0x0001:0x0017a9ef] [0x5] */ goto __ret;
- /* line 3308 [0x0001:0x0017a9f4] [0x14] */ };
- /* line 3309 [0x0001:0x0017a9f4] [0x14] */ fread(&this->_head, sizeof(MindPower::lwModelHeadInfo), 1, fp);
- /* line 3310 [0x0001:0x0017aa08] [0x14] */ unsigned long obj_num
- /* line 3312 [0x0001:0x0017aa08] [0x14] */ fread(&obj_num, sizeof(unsigned long), 1, fp);
- /* line 3314 [0x0001:0x0017aa1c] [0x6] */ if (obj_num == 0) {
- /* line 3315 [0x0001:0x0017aa22] [0x5] */ goto __addr_ret_ok;
- /* line 3316 [0x0001:0x0017aa27] [0x7] */ };
- /* line 3317 [0x0001:0x0017aa27] [0x7] */ MindPower::lwITreeNode *tree_node = 0;
- /* line 3318 [0x0001:0x0017aa2e] [0x7] */ MindPower::lwModelNodeInfo *node_info = 0;
- /* line 3320 [0x0001:0x0017aa35] [0x1e] */ for (unsigned long i = 0; i < obj_num; i++) {
- /* line 3322 [0x0001:0x0017aa53] [0x41] */ node_info = new MindPower::lwModelNodeInfo();
- /* line 3323 [0x0001:0x0017aa94] [0x17] */ if (node_info->MindPower::lwModelNodeInfo::Load(fp, this->_head.version) < 0) {
- /* line 3325 [0x0001:0x0017aaab] [0x28] */ delete node_info;
- /* line 3326 [0x0001:0x0017aad3] [0x5] */ goto __ret;
- /* line 3328 [0x0001:0x0017aad8] [0x41] */ }
- /* line 3329 [0x0001:0x0017aad8] [0x41] */ tree_node = new MindPower::lwTreeNode();
- /* line 3330 [0x0001:0x0017ab19] [0xf] */ tree_node->_SetRegisterID((void *)node_info); // MindPower::lwTreeNode::_SetRegisterID(unsigned long)
- /* line 3333 [0x0001:0x0017ab28] [0x9] */ if (this->_obj_tree == 0) {
- /* line 3335 [0x0001:0x0017ab31] [0x9] */ this->_obj_tree = tree_node;
- /* line 3337 [0x0001:0x0017ab3a] [0x2] */ } else {
- /* line 3339 [0x0001:0x0017ab3c] [0x9] */ MindPower::__find_info param;
- /* line 3340 [0x0001:0x0017ab3c] [0x9] */ param.handle = node_info->_parent_handle;
- /* line 3341 [0x0001:0x0017ab45] [0x7] */ param.node = 0;
- /* line 3342 [0x0001:0x0017ab4c] [0x1c] */ this->_obj_tree->EnumTree(MindPower::__tree_proc_find_node, ¶m, 0);
- /* line 3344 [0x0001:0x0017ab68] [0x6] */ if (param.node = 0) {
- /* line 3345 [0x0001:0x0017ab6e] [0x2] */ goto __ret;
- /* line 3346 [0x0001:0x0017ab70] [0x15] */ };
- /* line 3347 [0x0001:0x0017ab70] [0x15] */ if (param.node->InsertChild(0, tree_node) < 0) {
- /* line 3348 [0x0001:0x0017ab85] [0x2] */ goto __ret;
- /* line 3349 [0x0001:0x0017ab87] [0x5] */ };
- /* line 3350 [0x0001:0x0017ab87] [0x5] */ };
- /* line 3351 [0x0001:0x0017ab87] [0x5] */ };
- /* line 3364 [0x0001:0x0017ab8c] [0x7] */ __addr_ret_ok:
- /* line 3365 [0x0001:0x0017ab8c] [0x7] */ ret = 0;
- /* line 3366 [0x0001:0x0017ab93] [0x6] */ __ret:
- /* line 3367 [0x0001:0x0017ab93] [0x6] */ if (fp)
- /* line 3369 [0x0001:0x0017ab99] [0xc] */ fclose(fp);
- /* line 3372 [0x0001:0x0017aba5] [0x3] */ return ret;
- /* line 3374 [0x0001:0x0017aba8] [0x10] */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement