Advertisement
Guest User

.l?? Read Routines

a guest
Nov 9th, 2011
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 61.84 KB | None | 0 0
  1. // .lgo
  2. public: virtual long __thiscall MindPower::lwGeomObjInfo::Load(const char * file) {
  3.   /* line 2814 [0x0001:0x00179b90] [0x9]  */
  4.   /* line 2815 [0x0001:0x00179b99] [0x14] */ _iobuf *fp = fopen(file, "rb");
  5.   /* line 2816 [0x0001:0x00179bad] [0x6]  */ if (!fp)
  6.   /* line 2817 [0x0001:0x00179bb3] [0x5]  */   return -1;
  7.   /* line 2819 [0x0001:0x00179bb8] [0x14] */ unsigned long version;
  8.   /* line 2820 [0x0001:0x00179bb8] [0x14] */ fread(*version, 4, 1, fp);
  9.   /* line 2822 [0x0001:0x00179bcc] [0x13] */ long ret = this->Load(fp, version);
  10.   /* line 2824 [0x0001:0x00179bdf] [0x6]  */ if (fp)
  11.   /* line 2826 [0x0001:0x00179be5] [0xc]  */   fclose(fp);
  12.   /* line 2829 [0x0001:0x00179bf1] [0x3]  */ return ret;
  13.   /* line 2831 [0x0001:0x00179bf4] [0x6]  */
  14. }
  15.  
  16. public: long __thiscall MindPower::lwGeomObjInfo::Load(struct _iobuf *fp, unsigned long version) {
  17.   /* line 2709 [0x0001:0x001799f0] [0x7]  */
  18.   /* line 2710 [0x0001:0x001799f7] [0x17] */ fread(*(this->id), sizeof(MindPower::lwGeomObjInfo::lwGeomObjInfoHeader), 1, fp); // read a structure of MindPower::lwGeomObjInfo::lwGeomObjInfoHeader
  19.   /* line 2713 [0x0001:0x00179a0e] [0xf]  */ this->state_ctrl.SetState(5, 0);
  20.   /* line 2714 [0x0001:0x00179a1d] [0xf]  */ this->state_ctrl.SetState(3, 1);
  21.   /* line 2717 [0x0001:0x00179a2c] [0xc]  */ if (this->mtl_size > 100000) {
  22.   /* line 2719 [0x0001:0x00179a38] [0x14] */   MessageBoxA(0,"iii", "error", 0);
  23.   /* line 2720 [0x0001:0x00179a4c] [0x8]  */   return -1;
  24.   /* line 2721 [0x0001:0x00179a4c] [0x8]  */ };
  25.   /* line 2725 [0x0001:0x00179a54] [0x9]  */ if (this->mtl_size > 0)
  26.   /* line 2727 [0x0001:0x00179a5d] [0x1e] */   MindPower::lwLoadMtlTexInfo(this->mtl_seq, this->mtl_num, fp, version);
  27.   /* line 2731 [0x0001:0x00179a7b] [0x9]  */ if (this->mesh_size > 0)
  28.   /* line 2733 [0x0001:0x00179a84] [0x1a] */   MindPower::lwMeshInfo_Load(*(this->mesh), fp, version);
  29.   /* line 2737 [0x0001:0x00179a9e] [0x9]  */ if (this->helper_size > 0)
  30.   /* line 2739 [0x0001:0x00179aa7] [0x16] */   this->helper_data.Load(fp, version);
  31.   /* line 2743 [0x0001:0x00179abd] [0x9]  */ if (this->anim_size > 0)
  32.   /* line 2745 [0x0001:0x00179ac6] [0x16] */   this->anim_data.Load(fp, version);
  33.   /* line 2777 [0x0001:0x00179adc] [0x2]  */ return 0;
  34.   /* line 2779 [0x0001:0x00179ade] [0x6]  */
  35. }
  36.  
  37. public: void __thiscall MindPower::lwStateCtrl::SetState(unsigned long state, unsigned char value) {
  38.   /* line 515 [0x0001:0x0017b7d0] [0x18] */ this->_state_seq = value;
  39. }
  40.  
  41. long __cdecl MindPower::lwLoadMtlTexInfo(struct MindPower::lwMtlTexInfo **out_buf, unsigned long *out_num, struct _iobuf *fp, unsigned long version) {
  42.   /* line 258 [0x0001:0x00171d70] [0x1b] */
  43.   /* line 259 [0x0001:0x00171d8b] [0x7]  */ MindPower::lwMtlTexInfo *buf;
  44.   /* line 260 [0x0001:0x00171d92] [0x7]  */ unsigned long num = 0;
  45.   /* line 262 [0x0001:0x00171d99] [0x6]  */ if (version == 0) {
  46.   /* line 264 [0x0001:0x00171d9f] [0x14] */   unsigned long old_version;
  47.   /* line 265 [0x0001:0x00171d9f] [0x14] */   fread(*old_version, sizeof(unsigned long), 1, fp);
  48.   /* line 266 [0x0001:0x00171db3] [0x6]  */   version = old_version;
  49.   /* line 267 [0x0001:0x00171db3] [0x6]  */ };
  50.   /* line 269 [0x0001:0x00171db9] [0x14] */ fread(*num, sizeof(unsigned long), 1, fp);
  51.   /* line 270 [0x0001:0x00171dcd] [0x61] */ buf = new (MindPower::lwMtlTexInfo())[num];
  52.   /* line 272 [0x0001:0x00171e2e] [0x1a] */ for (unsigned long i = 0; i < num; i++) {
  53.   /* line 274 [0x0001:0x00171e48] [0x1d] */   MindPower::lwMtlTexInfo_Load(*(buf[i]), fp, version);
  54.   /* line 275 [0x0001:0x00171e65] [0x2]  */ }
  55.   /* line 277 [0x0001:0x00171e67] [0x8]  */ *out_buf = buf;
  56.   /* line 278 [0x0001:0x00171e6f] [0x8]  */ out_num = num;
  57.   /* line 280 [0x0001:0x00171e77] [0x2]  */ return 0;
  58.   /* line 281 [0x0001:0x00171e79] [0xe]  */
  59. }
  60.  
  61. long __cdecl MindPower::lwMtlTexInfo_Load(struct MindPower::lwMtlTexInfo *info, struct _iobuf *fp, unsigned long version) {
  62.   /* line 38 [0x0001:0x001714b0] [0x14]  */
  63.   /* line 39 [0x0001:0x001714c4] [0x9]   */ if (version >= 0x1000) {
  64.   /* line 41 [0x0001:0x001714cd] [0x14]  */   fread(*(info->opacity), sizeof(float), 1, fp);
  65.   /* line 42 [0x0001:0x001714e1] [0x17]  */   fread(*(info->transp_type), sizeof(unsigned long), 1, fp);
  66.   /* line 43 [0x0001:0x001714f8] [0x17]  */   fread(*(info->mtl), sizeof(MindPower::lwMaterial), 1, fp);
  67.   /* line 44 [0x0001:0x0017150f] [0x17]  */   fread(*(info->rs_set), sizeof(MindPower::lwRenderStateAtom)*8, 1, fp);
  68.   /* line 45 [0x0001:0x00171526] [0x1c]  */   fread(*(info->tex_seq), sizeof(MindPower::lwTexInfo)*4, 1, fp);
  69.   /* line 47 [0x0001:0x00171542] [0xb]   */ } else if (version = 2) {
  70.   /* line 49 [0x0001:0x0017154d] [0x14]  */   fread(*(info->opacity), sizeof(float), 1, fp);
  71.   /* line 50 [0x0001:0x00171561] [0x17]  */   fread(*(info->transp_type), sizeof(unsigned long), 1, fp);
  72.   /* line 51 [0x0001:0x00171578] [0x17]  */   fread(*(info->mtl), sizeof(MindPower::lwMaterial), 1, fp);
  73.   /* line 52 [0x0001:0x0017158f] [0x17]  */   fread(*(info->rs_set), sizeof(MindPower::lwRenderStateAtom)*8, 1, fp);
  74.   /* line 53 [0x0001:0x001715a6] [0x1d]  */   fread(*(info->tex_seq), sizeof(MindPower::lwTexInfo)*4, 1, fp);
  75.   /* line 55 [0x0001:0x001715c3] [0xf]   */ } else if (version = 1) {
  76.   /* line 58 [0x0001:0x001715d2] [0x14]  */   fread(*(info->opacity), sizeof(float), 1, fp);
  77.   /* line 59 [0x0001:0x001715e6] [0x17]  */   fread(*(info->transp_type), sizeof(unsigned long), 1, fp);
  78.   /* line 60 [0x0001:0x001715fd] [0x17]  */   fread(*(info->mtl), sizeof(MindPower::lwMaterial), 1, fp);
  79.   /* line 61 [0x0001:0x00171614] [0x1a]  */   MindPower::lwRenderStateSetTemplate<2,8> rsm;
  80.   /* line 62 [0x0001:0x00171614] [0x1a]  */   fread(*rsm, sizeof(MindPower::lwRenderStateSetTemplate<2,8>), 1, fp);
  81.   /* line 63 [0x0001:0x0017162e] [0x1a]  */   MindPower::lwTexInfo_0001 tex_info[4];
  82.   /* line 64 [0x0001:0x0017162e] [0x1a]  */   fread(*tex_info, sizeof(MindPower::lwTexInfo_0001)*4, 1, fp);
  83.   /* line 67 [0x0001:0x00171648] [0x28]  */   for (unsigned long i = 0; i < 8; i++) {
  84.   /* line 69 [0x0001:0x00171670] [0x13]  */     MindPower::lwRenderStateValue *rsv = *(rsm[0][i]);
  85.   /* line 70 [0x0001:0x00171683] [0xb]   */     if (rsv->state == -1)
  86.   /* line 71 [0x0001:0x0017168e] [0x5]   */       break;
  87.   /* line 73 [0x0001:0x00171693] [0x22]  */     unsigned long v;
  88.   /* line 74 [0x0001:0x00171693] [0x22]  */     if (rsv->state == 25) {
  89.   /* line 77 [0x0001:0x001716b5] [0xa]   */       v = 5;
  90.   /* line 78 [0x0001:0x001716bf] [0x2]   */     } else if (rsv->state == 24) {
  91.   /* line 80 [0x0001:0x001716c1] [0xa]   */       v = 129;
  92.   /* line 81 [0x0001:0x001716cb] [0x2]   */     } else {
  93.   /* line 83 [0x0001:0x001716cd] [0xf]   */       v = rsv->value;
  94.   /* line 84 [0x0001:0x001716cd] [0xf]   */     };
  95.   /* line 86 [0x0001:0x001716dc] [0x18]  */     info->rs_set[i].state = rsv->state;
  96.   /* line 87 [0x0001:0x001716f4] [0x16]  */     info->rs_set[i].value0 = v;
  97.   /* line 88 [0x0001:0x0017170a] [0x16]  */     info->rs_set[i].value1 = v;
  98.   /* line 89 [0x0001:0x00171720] [0x5]   */   };
  99.   /* line 93 [0x0001:0x00171725] [0x28]  */   for (unsigned long i = 0; i < 4; i++) {
  100.   /* line 95 [0x0001:0x0017174d] [0x16]  */     MindPower::lwTexInfo_0001 *p = *(tex_info[i]);
  101.   /* line 97 [0x0001:0x00171763] [0x8]   */     if (p->state == -1)
  102.   /* line 98 [0x0001:0x0017176b] [0x5]   */       break;
  103.   /* line 100 [0x0001:0x00171770] [0x1c] */     MindPower::lwTexInfo *t = *(info->tex_seq[i])
  104.   /* line 102 [0x0001:0x0017178c] [0xf]  */     t->level = p->level;
  105.   /* line 103 [0x0001:0x0017179b] [0xf]  */     t->usage = p->usage;
  106.   /* line 104 [0x0001:0x001717aa] [0xf]  */     t->pool = p->pool;
  107.   /* line 105 [0x0001:0x001717b9] [0xf]  */     t->type = p->type;
  108.   /* line 107 [0x0001:0x001717c8] [0xf]  */     t->width = p->width;
  109.   /* line 108 [0x0001:0x001717d7] [0xf]  */     t->height = p->height;
  110.   /* line 110 [0x0001:0x001717e6] [0xd]  */     t->stage = p->stage;
  111.   /* line 111 [0x0001:0x001717f3] [0xf]  */     t->format = p->format;
  112.   /* line 112 [0x0001:0x00171802] [0xf]  */     t->colorkey = p->colorkey;
  113.   /* line 113 [0x0001:0x00171811] [0xf]  */     t->colorkey_type = p->colorkey_type;
  114.   /* line 114 [0x0001:0x00171820] [0xf]  */     t->byte_alignment_flag = p->byte_alignment_flag;
  115.   /* line 115 [0x0001:0x0017182f] [0x19] */     strcpy(t->file_name, p->file_name);
  116.   /* line 118 [0x0001:0x00171848] [0x24] */     for (unsigned long j = 0; j < 8, j++) {
  117.   /* line 120 [0x0001:0x0017186c] [0x13] */       MindPower::lwRenderStateValue *rsv = *(p->tss_set[j][0]);
  118.   /* line 121 [0x0001:0x0017187f] [0xb]  */       if (rsv->state == -1)
  119.   /* line 122 [0x0001:0x0017188a] [0x2]  */         break;
  120.   /* line 124 [0x0001:0x0017188c] [0x1b] */       t->tss_set[j].state = rsv->state;
  121.   /* line 125 [0x0001:0x001718a7] [0x1c] */       t->tss_set[j].value0 = rsv->value;
  122.   /* line 126 [0x0001:0x001718c3] [0x1c] */       t->tss_set[j].value1 = rsv->value;
  123.   /* line 127 [0x0001:0x001718df] [0x5]  */     };
  124.   /* line 128 [0x0001:0x001718e4] [0x5]  */   };
  125.   /* line 130 [0x0001:0x001718e9] [0xf]  */ } else if (version == 0) {
  126.   /* line 133 [0x0001:0x001718f8] [0x17] */   fread(*(info->mtl),sizeof(MindPower::lwMaterial), 1, fp);
  127.   /* line 134 [0x0001:0x0017190f] [0x1a] */   MindPower::lwRenderStateSetTemplate<2,8> rsm;
  128.   /* line 135 [0x0001:0x0017190f] [0x1a] */   fread(*(rsm), sizeof(MindPower::lwRenderStateSetTemplate<2,8>), 1, fp);
  129.   /* line 136 [0x0001:0x00171929] [0x1a] */   MindPower::lwTexInfo_0000 tex_info[4];
  130.   /* line 137 [0x0001:0x00171929] [0x1a] */   fread(*(tex_info), sizeof(MindPower::lwTexInfo_0000)*4, 1, fp);
  131.   /* line 140 [0x0001:0x00171943] [0x28] */   for (unsigned long i = 0; i < 8; i++) {
  132.   /* line 142 [0x0001:0x0017196b] [0x13] */     MindPower::lwRenderStateValue *rsv = *(rsm[0][i]);
  133.   /* line 143 [0x0001:0x0017197e] [0xb]  */     if (rsv->state == -1)
  134.   /* line 144 [0x0001:0x00171989] [0x5]  */       break;
  135.   /* line 146 [0x0001:0x0017198e] [0x22] */     unsigned long v;
  136.   /* line 147 [0x0001:0x0017198e] [0x22] */     if (rsv->state == 25) {
  137.   /* line 150 [0x0001:0x001719b0] [0xa]  */       v = 5;
  138.   /* line 151 [0x0001:0x001719ba] [0x2]  */     } else if (rsv->state == 24) {
  139.   /* line 153 [0x0001:0x001719bc] [0xa]  */       v = 129;
  140.   /* line 154 [0x0001:0x001719c6] [0x2]  */     } else {
  141.   /* line 156 [0x0001:0x001719c8] [0xf]  */       v = rsv->value;
  142.   /* line 157 [0x0001:0x001719c8] [0xf]  */     };
  143.   /* line 159 [0x0001:0x001719d7] [0x18] */     info->rs_set[i].state = rsv->state;
  144.   /* line 160 [0x0001:0x001719ef] [0x16] */     info->rs_set[i].value0 = v;
  145.   /* line 161 [0x0001:0x00171a05] [0x16] */     info->rs_set[i].value1 = v;
  146.   /* line 162 [0x0001:0x00171a1b] [0x5]  */   };
  147.   /* line 166 [0x0001:0x00171a20] [0x28] */   for (unsigned long i = 0; i < 4; i++) {
  148.   /* line 168 [0x0001:0x00171a48] [0x19] */     MindPower::lwTexInfo_0000 *p = *(tex_info[i]);
  149.   /* line 170 [0x0001:0x00171a61] [0xb]  */     if (p->state == -1)
  150.   /* line 171 [0x0001:0x00171a6c] [0x5]  */       break;
  151.   /* line 173 [0x0001:0x00171a71] [0x1c] */     MindPower::lwTexInfo *t = *(info->tex_seq[i]);
  152.   /* line 174 [0x0001:0x00171a8d] [0xd]  */     t->level = 1;
  153.   /* line 175 [0x0001:0x00171a9a] [0xd]  */     t->usage = 0;
  154.   /* line 176 [0x0001:0x00171aa7] [0xd]  */     t->pool = 0;
  155.   /* line 177 [0x0001:0x00171ab4] [0xd]  */     t->type = 0;
  156.   /* line 179 [0x0001:0x00171ac1] [0x10] */     t->stage = p->stage;
  157.   /* line 180 [0x0001:0x00171ad1] [0x12] */     t->format = p->format;
  158.   /* line 181 [0x0001:0x00171ae3] [0x12] */     t->colorkey = p->colorkey;
  159.   /* line 182 [0x0001:0x00171af5] [0x12] */     t->colorkey_type = p->colorkey_type
  160.   /* line 183 [0x0001:0x00171b07] [0xd]  */     t->byte_alignment_flag = 0;
  161.   /* line 184 [0x0001:0x00171b14] [0x1c] */     strcpy(t->file_name, p->file_name);
  162.   /* line 187 [0x0001:0x00171b30] [0x24] */     for (unsigned long j = 0; j < 8; j++) {
  163.   /* line 189 [0x0001:0x00171b54] [0x16] */       MindPower::lwRenderStateValue *rsv = *(p->tss_set[0][j]);
  164.   /* line 190 [0x0001:0x00171b6a] [0xb]  */       if (rsv->state == -1)
  165.   /* line 191 [0x0001:0x00171b75] [0x2]  */         break;
  166.   /* line 193 [0x0001:0x00171b77] [0x1b] */       t->tss_set[j].state = rsv->state;
  167.   /* line 194 [0x0001:0x00171b92] [0x1c] */       t->tss_set[j].value0 = rsv->value;
  168.   /* line 195 [0x0001:0x00171bae] [0x1c] */       t->tss_set[j].value1 = rsv->value;
  169.   /* line 196 [0x0001:0x00171bca] [0x5]  */     };
  170.   /* line 197 [0x0001:0x00171bcf] [0x5]  */   };
  171.   /* line 199 [0x0001:0x00171bd4] [0xc]  */   if ( info->tex_seq[0].format == 26 )
  172.   /* line 201 [0x0001:0x00171be0] [0xd]  */     info->tex_seq[0].format = 25;
  173.   /* line 204 [0x0001:0x00171bed] [0x2]  */ } else {
  174.   /* line 206 [0x0001:0x00171bef] [0x14] */   MessageBoxA(0, "invalid file version", "error", 0);
  175.   /* line 207 [0x0001:0x00171c03] [0x8]  */   return -1;
  176.   /* line 208 [0x0001:0x00171c03] [0x8]  */ };
  177.   /* line 213 [0x0001:0x00171c0b] [0xd]  */ info->tex_seq[0].pool = 1;
  178.   /* line 214 [0x0001:0x00171c18] [0xd]  */ info->tex_seq[0].level = 3;
  179.   /* line 218 [0x0001:0x00171c25] [0x7]  */ int transp_flag = 0;
  180.   /* line 219 [0x0001:0x00171c2c] [0x24] */ unsigned long i;
  181.   /* line 220 [0x0001:0x00171c2c] [0x24] */ for (i = 0; i < 8; i++) {
  182.   /* line 222 [0x0001:0x00171c50] [0x13] */   MindPower::lwRenderStateAtom *rsa = &info->rs_set[i];
  183.   /* line 224 [0x0001:0x00171c63] [0x8]  */   if (rsa->state == -1 )
  184.   /* line 225 [0x0001:0x00171c6b] [0x2]  */     break;
  185.   /* line 227 [0x0001:0x00171c6d] [0x1a] */   if ((rsa->state == 20)&&((rsa->value0 == 2)||(rsa->value0 == 4)))
  186.   /* line 229 [0x0001:0x00171c87] [0x7]  */     transp_flag = 1;
  187.   /* line 231 [0x0001:0x00171c8e] [0x14] */   if ((rsa->state == 137)&&(rsa->value0 == 0))
  188.   /* line 233 [0x0001:0x00171ca2] [0x9]  */     transp_flag++;
  189.   /* line 236 [0x0001:0x00171cab] [0x2]  */ };
  190.   /* line 238 [0x0001:0x00171cad] [0xf]  */ if ((transp_flag = 1)&&(i < 7)
  191.   /* line 240 [0x0001:0x00171cbc] [0x20] */   MindPower::RSA_VALUE(*(info->rs_set[i]), 137, 0);
  192.   /* line 243 [0x0001:0x00171cdc] [0x2]  */ return 0;
  193.   /* line 244 [0x0001:0x00171cde] [0xf]  */
  194. }
  195.  
  196. long __cdecl MindPower::lwMeshInfo_Load(struct MindPower::lwMeshInfo *info, struct _iobuf *fp, unsigned long version) {
  197.   /* line 1387 [0x0001:0x00174f60] [0x1e] */
  198.   /* line 1388 [0x0001:0x00174f7e] [0x6]  */ if (version == 0) {
  199.   /* line 1390 [0x0001:0x00174f84] [0x14] */   unsigned long old_version;
  200.   /* line 1391 [0x0001:0x00174f84] [0x14] */   fread(*(old_version), sizeof(unsigned long), 1, fp);
  201.   /* line 1392 [0x0001:0x00174f98] [0x6]  */   version = old_version;
  202.   /* line 1393 [0x0001:0x00174f98] [0x6]  */ };
  203.   /* line 1396 [0x0001:0x00174f9e] [0x9]  */ if (version >= 0x1004) {
  204.   /* line 1398 [0x0001:0x00174fa7] [0x17] */   fread(*(info->header), sizeof(MindPower::lwMeshInfo::lwMeshInfoHeader), 1, fp);
  205.   /* line 1400 [0x0001:0x00174fbe] [0xe]  */ } else if (version >= 0x1003) {
  206.   /* line 1402 [0x0001:0x00174fcc] [0x17] */   MindPower::lwMeshInfo_0003::lwMeshInfoHeader header;
  207.   /* line 1403 [0x0001:0x00174fcc] [0x17] */   fread(*(header), sizeof(MindPower::lwMeshInfo_0003::lwMeshInfoHeader), 1, fp);
  208.   /* line 1404 [0x0001:0x00174fe3] [0xb]  */   info->header.fvf = header->fvf;
  209.   /* line 1405 [0x0001:0x00174fee] [0xc]  */   info->header.pt_type = header->pt_type;
  210.   /* line 1406 [0x0001:0x00174ffa] [0xc]  */   info->header.vertex_num = header->vertex_num;
  211.   /* line 1407 [0x0001:0x00175006] [0x9]  */   info->header.index_num = header->index_num;
  212.   /* line 1408 [0x0001:0x0017500f] [0x9]  */   info->header.subset_num = header->subset_num;
  213.   /* line 1409 [0x0001:0x00175018] [0x9]  */   info->header.bone_index_num = header->bone_index_num;
  214.   /* line 1410 [0x0001:0x00175021] [0x13] */   info->header.bone_infl_factor = info->header.bone_index_num > 0 ? 2 : 0;
  215.   /* line 1411 [0x0001:0x00175034] [0xa]  */   info->header.vertex_element_num = 0;
  216.   /* line 1413 [0x0001:0x0017503e] [0x18] */ } else if ((version >= 0x1000)||(version == 1)) {
  217.   /* line 1415 [0x0001:0x00175056] [0x17] */   MindPower::lwMeshInfo_0003::lwMeshInfoHeader header;
  218.   /* line 1416 [0x0001:0x00175056] [0x17] */   fread(header, sizeof(MindPower::lwMeshInfo_0003::lwMeshInfoHeader), 1, fp);
  219.   /* line 1417 [0x0001:0x0017506d] [0xb]  */   info->header.fvf = header->fvf;
  220.   /* line 1418 [0x0001:0x00175078] [0xc]  */   info->header.pt_type = header->pt_type;
  221.   /* line 1419 [0x0001:0x00175084] [0xc]  */   info->header.vertex_num = header->vertex_num;
  222.   /* line 1420 [0x0001:0x00175090] [0xc]  */   info->header.index_num = header->index_num;
  223.   /* line 1421 [0x0001:0x0017509c] [0xc]  */   info->header.subset_num = header->subset_num;
  224.   /* line 1422 [0x0001:0x001750a8] [0xc]  */   info->header.bone_index_num = header->bone_index_num;
  225.   /* line 1423 [0x0001:0x001750b4] [0x13] */   info->header.bone_infl_factor = info->header.bone_index_num > 0 ? 2 : 0;
  226.   /* line 1424 [0x0001:0x001750c7] [0xa]  */   info->header.vertex_element_num = 0;
  227.   /* line 1426 [0x0001:0x001750d1] [0xf]  */ } else if (version == 0) {
  228.   /* line 1428 [0x0001:0x001750e0] [0x1a] */   MindPower::lwMeshInfo_0000::lwMeshInfoHeader header;
  229.   /* line 1429 [0x0001:0x001750e0] [0x1a] */   fread(*(header), sizeof(MindPower::lwMeshInfo_0000::lwMeshInfoHeader), 1, fp);
  230.   /* line 1430 [0x0001:0x001750fa] [0xb]  */   info->header.fvf = header->fvf;
  231.   /* line 1431 [0x0001:0x00175105] [0xc]  */   info->header.pt_type = header->pt_type;
  232.   /* line 1432 [0x0001:0x00175111] [0xc]  */   info->header.vertex_num = header->vertex_num;
  233.   /* line 1433 [0x0001:0x0017511d] [0xc]  */   info->header.index_num = header->index_num;
  234.   /* line 1434 [0x0001:0x00175129] [0xc]  */   info->header.subset_num = header->subset_num;
  235.   /* line 1435 [0x0001:0x00175135] [0xc]  */   info->header.bone_index_num = header->bone_index_num;
  236.   /* line 1438 [0x0001:0x00175141] [0x28] */   for (unsigned long j = 0; j < 8; j++) {
  237.   /* line 1440 [0x0001:0x00175169] [0x13] */     MindPower::lwRenderStateValue *rsv = &header->rs_set[i][0];
  238.   /* line 1441 [0x0001:0x0017517c] [0xb]  */     if (rsa->state == -1)
  239.   /* line 1442 [0x0001:0x00175187] [0x5]  */       break;
  240.   /* line 1444 [0x0001:0x0017518c] [0x1c] */     unsigned long v;
  241.   /* line 1445 [0x0001:0x0017518c] [0x1c] */     if (rsv->state == 147) {
  242.   /* line 1448 [0x0001:0x001751a8] [0xa]  */       v = 2;
  243.   /* line 1449 [0x0001:0x001751b2] [0x2]  */     } else {
  244.   /* line 1451 [0x0001:0x001751b4] [0xf]  */       v = rsv->value;
  245.   /* line 1452 [0x0001:0x001751b4] [0xf]  */     };
  246.   /* line 1454 [0x0001:0x001751c3] [0x18] */     info->header.rs_set[i].state = rsv->state;
  247.   /* line 1455 [0x0001:0x001751db] [0x16] */     info->header.rs_set[i].value0 = v;
  248.   /* line 1456 [0x0001:0x001751f1] [0x16] */     info->header.rs_set[i].value1 = v;
  249.   /* line 1457 [0x0001:0x00175207] [0x5]  */   };
  250.   /* line 1459 [0x0001:0x0017520c] [0x2]  */ } else {
  251.   /* line 1461 [0x0001:0x0017520e] [0x14] */   MessageBoxA(0, "invalid version", "error", 0);
  252.   /* line 1461 [0x0001:0x0017520e] [0x14] */ };
  253.   /* line 1465 [0x0001:0x00175222] [0xd]  */ if (version >= 0x1004) {
  254.   /* line 1467 [0x0001:0x0017522f] [0x9]  */   if (info->header.vertex_element_num > 0) {
  255.   /* line 1469 [0x0001:0x00175238] [0x27] */     info->vertex_element_seq = new _D3DVERTEXELEMENT9[info->header.vertex_element_num];
  256.   /* line 1470 [0x0001:0x0017525f] [0x1f] */     fread(info->vertex_element_seq, sizeof(_D3DVERTEXELEMENT9), info->header.vertex_element_num, fp);
  257.   /* line 1471 [0x0001:0x0017525f] [0x1f] */   };
  258.   /* line 1473 [0x0001:0x0017527e] [0xd]  */   if (info->header.vertex_num > 0) {
  259.   /* line 1475 [0x0001:0x0017528b] [0x88] */     info->normal_seq = new D3DXVECTOR3[info->header.vertex_num];
  260.   /* line 1476 [0x0001:0x00175313] [0x1f] */     fread(info->vertex_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
  261.   /* line 1477 [0x0001:0x00175313] [0x1f] */   };
  262.   /* line 1479 [0x0001:0x00175332] [0xe]  */   if (info->header.fvf & 0x10) {
  263.   /* line 1481 [0x0001:0x00175340] [0x88] */     info->normal_seq = new D3DXVECTOR3[info->header.vertex_num];
  264.   /* line 1482 [0x0001:0x001753c8] [0x1f] */     fread(info->normal_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
  265.   /* line 1483 [0x0001:0x001753c8] [0x1f] */   };
  266.   /* line 1485 [0x0001:0x001753e7] [0x11] */   if (info->header.fvf & 0x100) {
  267.   /* line 1487 [0x0001:0x001753f8] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
  268.   /* line 1488 [0x0001:0x00175480] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  269.   /* line 1490 [0x0001:0x0017549f] [0x15] */   } else if (info->header.fvf & 0x200) {
  270.   /* line 1492 [0x0001:0x001754b4] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
  271.   /* line 1493 [0x0001:0x0017553c] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
  272.   /* line 1494 [0x0001:0x001755c4] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  273.   /* line 1495 [0x0001:0x001755e3] [0x1f] */     fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  274.   /* line 1497 [0x0001:0x00175602] [0x15] */   } else if (info->fvf & 0x300) {
  275.   /* line 1499 [0x0001:0x00175617] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->vertex_num];
  276.   /* line 1500 [0x0001:0x0017569f] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->vertex_num];
  277.   /* line 1501 [0x0001:0x00175727] [0x88] */     info->texcoord2_seq = new D3DXVECTOR2[info->vertex_num];
  278.   /* line 1502 [0x0001:0x001757af] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
  279.   /* line 1503 [0x0001:0x001757ce] [0x1f] */     fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
  280.   /* line 1504 [0x0001:0x001757ed] [0x1f] */     fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
  281.   /* line 1506 [0x0001:0x0017580c] [0x16] */   } else if (info->fvf & 0x400) {
  282.   /* line 1508 [0x0001:0x00175822] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
  283.   /* line 1509 [0x0001:0x001758aa] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
  284.   /* line 1510 [0x0001:0x00175932] [0x88] */     info->texcoord2_seq = new D3DXVECTOR2[info->header.vertex_num];
  285.   /* line 1511 [0x0001:0x001759ba] [0x88] */     info->texcoord3_seq = new D3DXVECTOR2[info->header.vertex_num];
  286.   /* line 1512 [0x0001:0x00175a42] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  287.   /* line 1513 [0x0001:0x00175a61] [0x1f] */     fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  288.   /* line 1514 [0x0001:0x00175a80] [0x1f] */     fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  289.   /* line 1515 [0x0001:0x00175a9f] [0x1f] */     fread(info->texcoord3_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  290.   /* line 1516 [0x0001:0x00175a9f] [0x1f] */   };
  291.   /* line 1518 [0x0001:0x00175abe] [0xa]  */   if (info->header.fvf & 0x40) {
  292.   /* line 1520 [0x0001:0x00175ac8] [0x27] */     info->vercol_seq = new unsigned long[info->header.vertex_num];
  293.   /* line 1521 [0x0001:0x00175aef] [0x1f] */     fread(info->vercol_seq, sizeof(unsigned long), info->header.vertex_num, fp);
  294.   /* line 1522 [0x0001:0x00175aef] [0x1f] */   };
  295.   /* line 1524 [0x0001:0x00175b0e] [0xd]  */   if (info->header.bone_index_num > 0) {
  296.   /* line 1526 [0x0001:0x00175b1b] [0x27] */     info->blend_seq = new MindPower::lwBlendInfo[info->header.vertex_num];
  297.   /* line 1527 [0x0001:0x00175b42] [0x27] */     info->bone_index_seq = new unsigned long[info->header.bone_index_num];
  298.   /* line 1528 [0x0001:0x00175b69] [0x1f] */     fread(info->blend_seq, sizeof(MindPower::lwBlendInfo), info->header.vertex_num, fp);
  299.   /* line 1529 [0x0001:0x00175b88] [0x1f] */     fread(info->bone_index_seq, sizeof(unsigned long), info->header.bone_index_num, fp);
  300.   /* line 1530 [0x0001:0x00175b88] [0x1f] */   };
  301.   /* line 1532 [0x0001:0x00175ba7] [0x9]  */   if (info->header.index_num > 0) {
  302.   /* line 1534 [0x0001:0x00175bb0] [0x27] */     info->index_seq = new unsigned long[info->header.index_num];
  303.   /* line 1535 [0x0001:0x00175bd7] [0x1f] */     fread(info->index_seq, sizeof(unsigned long), info->header.index_num, fp);
  304.   /* line 1536 [0x0001:0x00175bd7] [0x1f] */   };
  305.   /* line 1538 [0x0001:0x00175bf6] [0x9]  */   if (info->header.subset_num > 0) {
  306.   /* line 1540 [0x0001:0x00175bff] [0x27] */     info->subset_seq = new MindPower::lwSubsetInfo[info->header.subset_num];
  307.   /* line 1541 [0x0001:0x00175c26] [0x1f] */     fread(info->subset_seq, sizeof(MindPower::lwSubsetInfo), info->header.subset_num, fp);
  308.   /* line 1544 [0x0001:0x00175c45] [0x5]  */   };
  309.   /* line 1545 [0x0001:0x00175c4a] [0x27] */ } else {
  310.   /* line 1546 [0x0001:0x00175c4a] [0x27] */   info->header.subset_seq = new MindPower::lwSubsetInfo[info->header.subset_num];
  311.   /* line 1547 [0x0001:0x00175c71] [0x1f] */   fread(info->subset_seq, sizeof(MindPower::lwSubsetInfo), info->header.subset_num, fp);
  312.   /* line 1549 [0x0001:0x00175c90] [0x88] */   info->vertex_seq = new D3DXVECTOR3[info->header.vertex_num];
  313.   /* line 1550 [0x0001:0x00175d18] [0x1f] */   fread(info->vertex_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
  314.   /* line 1552 [0x0001:0x00175d37] [0xe]  */   if (info->header.fvf & 0x10) {
  315.   /* line 1554 [0x0001:0x00175d45] [0x88] */     info->normal_seq = new D3DXVECTOR3[info->header.vertex_num];
  316.   /* line 1555 [0x0001:0x00175dcd] [0x1f] */     fread(info->normal_seq, sizeof(D3DXVECTOR3), info->header.vertex_num, fp);
  317.   /* line 1556 [0x0001:0x00175dcd] [0x1f] */   };
  318.   /* line 1558 [0x0001:0x00175dec] [0x11] */   if (info->header.fvf & 0x100) {
  319.   /* line 1560 [0x0001:0x00175dfd] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
  320.   /* line 1561 [0x0001:0x00175e85] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  321.   /* line 1563 [0x0001:0x00175ea4] [0x15] */   } else if (info->header.fvf & 0x200) {
  322.   /* line 1565 [0x0001:0x00175eb9] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
  323.   /* line 1566 [0x0001:0x00175f41] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
  324.   /* line 1567 [0x0001:0x00175fc9] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  325.   /* line 1568 [0x0001:0x00175fe8] [0x1f] */     fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  326.   /* line 1570 [0x0001:0x00176007] [0x15] */   } else if (info->fvf & 0x300) {
  327.   /* line 1572 [0x0001:0x0017601c] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->vertex_num];
  328.   /* line 1573 [0x0001:0x001760a4] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->vertex_num];
  329.   /* line 1574 [0x0001:0x0017612c] [0x88] */     info->texcoord2_seq = new D3DXVECTOR2[info->vertex_num];
  330.   /* line 1575 [0x0001:0x001761b4] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
  331.   /* line 1576 [0x0001:0x001761d3] [0x1f] */     fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
  332.   /* line 1577 [0x0001:0x001761f2] [0x1f] */     fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->vertex_num, fp);
  333.   /* line 1579 [0x0001:0x00176211] [0x16] */   } else if (info->header.fvf & 0x400) {
  334.   /* line 1581 [0x0001:0x00176227] [0x88] */     info->texcoord0_seq = new D3DXVECTOR2[info->header.vertex_num];
  335.   /* line 1582 [0x0001:0x001762af] [0x88] */     info->texcoord1_seq = new D3DXVECTOR2[info->header.vertex_num];
  336.   /* line 1583 [0x0001:0x00176337] [0x88] */     info->texcoord2_seq = new D3DXVECTOR2[info->header.vertex_num];
  337.   /* line 1584 [0x0001:0x001763bf] [0x88] */     info->texcoord3_seq = new D3DXVECTOR2[info->header.vertex_num];
  338.   /* line 1585 [0x0001:0x00176447] [0x1f] */     fread(info->texcoord0_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  339.   /* line 1586 [0x0001:0x00176466] [0x1f] */     fread(info->texcoord1_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  340.   /* line 1587 [0x0001:0x00176485] [0x1f] */     fread(info->texcoord2_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  341.   /* line 1588 [0x0001:0x001764a4] [0x1f] */     fread(info->texcoord3_seq, sizeof(D3DXVECTOR2), info->header.vertex_num, fp);
  342.   /* line 1589 [0x0001:0x001764a4] [0x1f] */   };
  343.   /* line 1591 [0x0001:0x001764c3] [0xa]  */   if (info->header.fvf & 0x40) {
  344.   /* line 1593 [0x0001:0x001764cd] [0x27] */     info->vercol_seq = new unsigned long[info->header.vertex_num];
  345.   /* line 1594 [0x0001:0x001764f4] [0x1f] */     fread(info->vercol_seq, sizeof(unsigned long), info->header.vertex_num, fp);
  346.   /* line 1595 [0x0001:0x001764f4] [0x1f] */   };
  347.   /* line 1597 [0x0001:0x00176513] [0x11] */   if (info->header.fvf & 0x1000) {
  348.   /* line 1599 [0x0001:0x00176524] [0x27] */     info->blend_seq = new MindPower::lwBlendInfo[info->header.vertex_num];
  349.   /* line 1601 [0x0001:0x0017654b] [0x21] */     unsigned char *byte_index_seq = new char[info->header.bone_index_num];
  350.   /* line 1603 [0x0001:0x0017656c] [0x1f] */     fread(info->blend_seq, sizeof(MindPower::lwBlendInfo), info->header.vertex_num, fp);
  351.   /* line 1604 [0x0001:0x0017658b] [0x1c] */     fread(byte_index_seq, sizeof(char), info->header.bone_index_num, fp);
  352.   /* line 1607 [0x0001:0x001765a7] [0x27] */     info->bone_index_seq = new unsigned long[info->header.bone_index_num];
  353.   /* line 1608 [0x0001:0x001765ce] [0x29] */     for (unsigned long i = 0; ; i++) {
  354.   /* line 1610 [0x0001:0x001765f7] [0x21] */       info->bone_index_seq[i] = (char)byte_index_seq[i];
  355.   /* line 1611 [0x0001:0x00176618] [0x2]  */     };
  356.   /* line 1613 [0x0001:0x0017661a] [0x1b] */     delete [] byte_index_seq;
  357.   /* line 1614 [0x0001:0x0017661a] [0x1b] */   };
  358.   /* line 1616 [0x0001:0x00176635] [0x9]  */   if (info->header.index_num > 0) {
  359.   /* line 1618 [0x0001:0x0017663e] [0x27] */     info->index_seq = new unsigned long[info->header.index_num];
  360.   /* line 1619 [0x0001:0x00176665] [0x1f] */     fread(info->index_seq, sizeof(unsigned long), info->header.index_num, fp);
  361.   /* line 1620 [0x0001:0x00176665] [0x1f] */   };
  362.   /* line 1621 [0x0001:0x00176665] [0x1f] */ };
  363.   /* line 1624 [0x0001:0x00176684] [0x2]  */ return 0;
  364.   /* line 1625 [0x0001:0x00176686] [0xe]  */
  365. }
  366.  
  367. public: long __thiscall MindPower::lwHelperInfo::Load(struct _iobuf *fp, unsigned long version) {
  368.   /* line 2347 [0x0001:0x00178630] [0x9]  */
  369.   /* line 2348 [0x0001:0x00178639] [0x6]  */ if (version == 0) {
  370.   /* line 2350 [0x0001:0x0017863f] [0x14] */   unsigned long old_version;
  371.   /* line 2351 [0x0001:0x0017863f] [0x14] */   fread(*(old_version), sizeof(unsigned long), 1, fp); // No messing around with 'version' O_o
  372.   /* line 2352 [0x0001:0x00178653] [0x17] */ };
  373.   /* line 2354 [0x0001:0x00178653] [0x17] */ fread(*(this->type), sizeof(unsigned long), 1, fp);
  374.   /* line 2356 [0x0001:0x0017866a] [0xb]  */ if (this->type & 0x1)
  375.   /* line 2358 [0x0001:0x00178675] [0x10] */   this->_LoadHelperDummyInfo(fp, version);
  376.   /* line 2361 [0x0001:0x00178685] [0xb]  */ if (this->type & 0x2)
  377.   /* line 2363 [0x0001:0x00178690] [0x10] */   this->_LoadHelperBoxInfo(fp, version);
  378.   /* line 2366 [0x0001:0x001786a0] [0xb]  */ if (this->type & 0x4)
  379.   /* line 2368 [0x0001:0x001786ab] [0x10] */   this->_LoadHelperMeshInfo(fp, version);
  380.   /* line 2371 [0x0001:0x001786bb] [0xb]  */ if (this->type & 0x10)
  381.   /* line 2373 [0x0001:0x001786c6] [0x10] */   this->_LoadBoundingBoxInfo(fp, version);
  382.   /* line 2376 [0x0001:0x001786d6] [0xb]  */ if (this->type & 0x20)
  383.   /* line 2378 [0x0001:0x001786e1] [0x10] */   this->_LoadBoundingSphereInfo(fp, version);
  384.   /* line 2381 [0x0001:0x001786f1] [0x2]  */ return 0;
  385.   /* line 2383 [0x0001:0x001786f3] [0x6]  */
  386. }
  387.  
  388. public: long __thiscall MindPower::lwHelperInfo::_LoadHelperDummyInfo(struct _iobuf *fp, unsigned long version) {
  389.   /* line 2514 [0x0001:0x00178c80] [0x20] */
  390.   /* line 2516 [0x0001:0x00178ca0] [0xd]  */ if (version >= 0x1001) {
  391.   /* line 2518 [0x0001:0x00178cad] [0x17] */   fread(*(this->dummy_num), sizeof(unsigned long), 1, fp);
  392.   /* line 2519 [0x0001:0x00178cc4] [0x67] */   this->dummy_seq = new MindPower::lwHelperDummyInfo[this->dummy_num];
  393.   /* line 2520 [0x0001:0x00178d2b] [0x1f] */   fread(this->dummy_seq, sizeof(MindPower::lwHelperDummyInfo), this->dummy_num, fp);
  394.   /* line 2522 [0x0001:0x00178d4a] [0x12] */ } else if (version <= 0x1000) {
  395.   /* line 2524 [0x0001:0x00178d5c] [0x17] */   fread(*(this->dummy_num), sizeof(unsigned long), 1, fp);
  396.   /* line 2525 [0x0001:0x00178d73] [0x5e] */   struct MindPower::lwHelperDummyInfo_1000 *old_s = new MindPower::lwIndexMatrix44[this->dummy_num];
  397.   /* line 2526 [0x0001:0x00178dd1] [0x19] */   fread(old_s, sizeof(MindPower::lwHelperDummyInfo_1000), this->dummy_num, fp);
  398.   /* line 2528 [0x0001:0x00178dea] [0x67] */   this->dummy_seq = new MindPower::lwHelperDummyInfo[this->dummy_num];
  399.   /* line 2529 [0x0001:0x00178e51] [0x1d] */   for (unsigned long i = 0; i < this->dummy_num; i++) {
  400.   /* line 2531 [0x0001:0x00178e6e] [0x1e] */     this->dummy_seq[i]->id = old_s[i]->id
  401.   /* line 2532 [0x0001:0x00178e8c] [0x27] */     this->dummy_seq[i]->mat = old_s[i]->mat;
  402.   /* line 2533 [0x0001:0x00178eb3] [0x1a] */     this->dummy_seq[i]->parent_type = 0;
  403.   /* line 2534 [0x0001:0x00178ecd] [0x1a] */     this->dummy_seq[i]->parent_id = 0;
  404.   /* line 2535 [0x0001:0x00178ee7] [0x5]  */   };
  405.   /* line 2537 [0x0001:0x00178eec] [0x12] */   delete [] old_s;
  406.   /* line 2538 [0x0001:0x00178eec] [0x12] */ };
  407.   /* line 2540 [0x0001:0x00178efe] [0x2]  */ return 0;
  408.   /* line 2541 [0x0001:0x00178f00] [0x12] */
  409. }
  410.  
  411. public: long __thiscall MindPower::lwHelperInfo::_LoadHelperBoxInfo(struct _iobuf *fp, unsigned long version) {
  412.   /* line 2543 [0x0001:0x00178f20] [0x1e] */
  413.   /* line 2544 [0x0001:0x00178f3e] [0x17] */ fread(*(this->box_num), sizeof(unsigned long), 1, fp);
  414.   /* line 2546 [0x0001:0x00178f55] [0x67] */ this->box_seq = new MindPower::lwHelperBoxInfo[this->box_num];
  415.   /* line 2547 [0x0001:0x00178fbc] [0x1f] */ fread(this->box_seq, sizeof(MindPower::lwHelperBoxInfo), this->box_num, fp);
  416.   /* line 2549 [0x0001:0x00178fdb] [0xd]  */ if (version <= 0x1001) {
  417.   /* line 2552 [0x0001:0x00178fe8] [0x8]  */   MindPower::lwBox_1001 old_b = MindPower::lwBox_1001();
  418.   /* line 2553 [0x0001:0x00178ff0] [0x21] */   for (unsigned long i = 0; i < this->box_num, i++) {
  419.   /* line 2555 [0x0001:0x00179011] [0x16] */     MindPower::lwBox *b = this->box_seq[i];
  420.   /* line 2556 [0x0001:0x00179027] [0x14] */     old_b.p = b->c;
  421.   /* line 2557 [0x0001:0x0017903b] [0x17] */     old_b.s = b->r;
  422.   /* line 2559 [0x0001:0x00179052] [0x27] */     b->r = old_b.s / 2;
  423.   /* line 2560 [0x0001:0x00179079] [0x26] */     b->c = old_b.p + b->r;
  424.   /* line 2561 [0x0001:0x0017909f] [0x5]  */   };
  425.   /* line 2562 [0x0001:0x0017909f] [0x5]  */ };
  426.   /* line 2564 [0x0001:0x001790a4] [0x2]  */ return 0;
  427.   /* line 2565 [0x0001:0x001790a6] [0x10] */
  428. }
  429.  
  430. public: long __thiscall MindPower::lwHelperInfo::_LoadHelperMeshInfo(struct _iobuf *fp, unsigned long version) {
  431.   /* line 2567 [0x0001:0x001790c0] [0x1e] */
  432.   /* line 2568 [0x0001:0x001790de] [0x17] */ fread(*(this->mesh_num), sizeof(unsigned long), 1, fp);
  433.   /* line 2570 [0x0001:0x001790f5] [0x7d] */ this->mesh_seq = new MindPower::lwHelperMeshInfo[this->mesh_num];
  434.   /* line 2574 [0x0001:0x00179172] [0x21] */ for (unsigned long i = 0; i < this->mesh_num; i++) {
  435.   /* line 2576 [0x0001:0x00179193] [0x12] */   MindPower::lwHelperMeshInfo *info = this->mesh_seq[i];
  436.   /* line 2578 [0x0001:0x001791a5] [0x14] */   fread(*(info->id), sizeof(unsigned long), 1, fp);
  437.   /* line 2579 [0x0001:0x001791b9] [0x17] */   fread(*(info->type), sizeof(unsigned long), 1, fp);
  438.   /* line 2580 [0x0001:0x001791d0] [0x17] */   fread(*(info->sub_type), sizeof(unsigned long), 1, fp);
  439.   /* line 2581 [0x0001:0x001791e7] [0x17] */   fread(*(info->name), 20, 1, fp); // sizeof(info->name) = 20;
  440.   /* line 2582 [0x0001:0x001791fe] [0x17] */   fread(*(info->state) sizeof(unsigned long), 1, fp);
  441.   /* line 2583 [0x0001:0x00179215] [0x17] */   fread(*(info->mat), sizeof(D3DXMATRIX), 1, fp);
  442.   /* line 2584 [0x0001:0x0017922c] [0x17] */   fread(*(info->box), sizeof(MindPower::lwBox), 1, fp);
  443.   /* line 2585 [0x0001:0x00179243] [0x19] */   fread(*(info->vertex_num), sizeof(unsigned long), 1, fp);
  444.   /* line 2586 [0x0001:0x0017925c] [0x1a] */   fread(*(info->face_num), sizeof(unsigned long), 1, fp);
  445.   /* line 2588 [0x0001:0x00179276] [0x67] */   info->vertex_seq = new D3DXVECTOR4[info->vertex_num];
  446.   /* line 2589 [0x0001:0x001792dd] [0x67] */   info->face_seq = new MindPower::lwHelperMeshFaceInfo[info->face_num];
  447.   /* line 2591 [0x0001:0x00179344] [0x22] */   fread(info->vertex_seq, sizeof(D3DXVECTOR3), info->vertex_num, fp);
  448.   /* line 2592 [0x0001:0x00179366] [0x22] */   fread(info->face_seq, sizeof(MindPower::lwHelperMeshFaceInfo), info->face_num, fp);
  449.   /* line 2593 [0x0001:0x00179388] [0x5]  */ };
  450.   /* line 2595 [0x0001:0x0017938d] [0xd]  */ if (version <= 0x1001) {
  451.   /* line 2598 [0x0001:0x0017939a] [0x8]  */   MindPower::lwBox_1001 old_b = MindPower::lwBox_1001();
  452.   /* line 2599 [0x0001:0x001793a2] [0x21] */   for(unsigned long i = 0; i < this->mesh_num; i++) {
  453.   /* line 2601 [0x0001:0x001793c3] [0x16] */     MindPower::lwBox *b = this->mesh_seq[i]->box;
  454.   /* line 2602 [0x0001:0x001793d9] [0x14] */     old_b.p = b->c;
  455.   /* line 2603 [0x0001:0x001793ed] [0x17] */     old_b.s = b->r;
  456.   /* line 2605 [0x0001:0x00179404] [0x27] */     b->r = old_b.s / 2;
  457.   /* line 2606 [0x0001:0x0017942b] [0x26] */     b->c = old_b.p + b->r;
  458.   /* line 2607 [0x0001:0x00179451] [0x5]  */   };
  459.   /* line 2608 [0x0001:0x00179451] [0x5]  */ };
  460.   /* line 2610 [0x0001:0x00179456] [0x2]  */ return 0;
  461.   /* line 2611 [0x0001:0x00179458] [0x10] */
  462. }
  463.  
  464. public: long __thiscall MindPower::lwHelperInfo::_LoadBoundingBoxInfo(struct _iobuf *fp, unsigned long version) {
  465.   /* line 2614 [0x0001:0x00179470] [0x1e] */
  466.   /* line 2615 [0x0001:0x0017948e] [0x17] */ fread(*(this->bbox_num), sizeof(unsigned long), 1, fp);
  467.   /* line 2617 [0x0001:0x001794a5] [0x61] */ info->bbox_seq = new MindPower::lwBoundingBoxInfo[this->bbox_num];
  468.   /* line 2619 [0x0001:0x00179506] [0x1c] */ fread(info->bbox_seq, sizeof(MindPower::lwBoundingBoxInfo), this->bbox_num, fp);
  469.   /* line 2621 [0x0001:0x00179522] [0xd]  */ if (version <= 0x1001) {
  470.   /* line 2624 [0x0001:0x0017952f] [0x8]  */   MindPower::lwBox_1001 old_b = MindPower::lwBox_1001();
  471.   /* line 2625 [0x0001:0x00179537] [0x21] */   for (unsigned long i = 0; i < this->bbox_num; i++) {
  472.   /* line 2627 [0x0001:0x00179558] [0x13] */     MindPower::lwBox *b = info->bbox_seq[i]->box;
  473.   /* line 2628 [0x0001:0x0017956b] [0x14] */     old_b.p = b->c;
  474.   /* line 2629 [0x0001:0x0017957f] [0x17] */     old_b.s = b->r;
  475.   /* line 2631 [0x0001:0x00179596] [0x27] */     b->r = old_b.s / 2;
  476.   /* line 2632 [0x0001:0x001795bd] [0x26] */     b->c = old_b.p + b->r;
  477.   /* line 2633 [0x0001:0x001795e3] [0x5]  */   };
  478.   /* line 2634 [0x0001:0x001795e3] [0x5]  */ };
  479.   /* line 2636 [0x0001:0x001795e8] [0x2]  */ return 0;
  480.   /* line 2638 [0x0001:0x001795ea] [0x10] */
  481. }
  482.  
  483. public: long __thiscall MindPower::lwHelperInfo::_LoadBoundingSphereInfo(struct _iobuf *fp, unsigned long version) {
  484.   /* line 2640 [0x0001:0x00179600] [0x1e] */
  485.   /* line 2641 [0x0001:0x0017961e] [0x17] */ fread(*(this->bsphere_num), sizeof(unsigned long), 1, fp);
  486.   /* line 2643 [0x0001:0x00179635] [0x61] */ info->bsphere_seq = new MindPower::lwBoundingSphereInfo[this->bsphere_num];
  487.   /* line 2645 [0x0001:0x00179696] [0x1c] */ fread(this->bsphere_seq, sizeof(MindPower::lwBoundingSphereInfo), this->bsphere_num, fp);
  488.   /* line 2647 [0x0001:0x001796b2] [0x2]  */ return 0;
  489.   /* line 2648 [0x0001:0x001796b4] [0x10] */
  490. }
  491.  
  492. public: long __thiscall MindPower::lwAnimDataInfo::Load(struct _iobuf *fp, unsigned long version) {
  493.   /* line 1773 [0x0001:0x00176d30] [0x24] */
  494.   /* line 1774 [0x0001:0x00176d54] [0x6]  */ if (version = 0) {
  495.   /* line 1776 [0x0001:0x00176d5a] [0x17] */   unsigned long old_version;
  496.   /* line 1777 [0x0001:0x00176d5a] [0x17] */   fread(*(old_version), sizeof(unsigned long), 1, fp);
  497.   /* line 1778 [0x0001:0x00176d5a] [0x17] */ };
  498.   /* line 1780 [0x0001:0x00176d71] [0x14] */ unsigned long data_bone_size;
  499.   /* line 1781 [0x0001:0x00176d71] [0x14] */ unsigned long data_mat_size;
  500.   /* line 1782 [0x0001:0x00176d71] [0x14] */ unsigned long data_mtlopac_size[16];
  501.   /* line 1783 [0x0001:0x00176d71] [0x14] */ unsigned long data_texuv_size[4][16];
  502.   /* line 1784 [0x0001:0x00176d71] [0x14] */ unsigned long data_teximg_size[4][16];
  503.   /* line 1785 [0x0001:0x00176d71] [0x14] */ fread(*(data_bone_size), sizeof(unsigned long), 1, fp);
  504.   /* line 1786 [0x0001:0x00176d85] [0x17] */ fread(*(data_mat_size), sizeof(unsigned long), 1, fp);
  505.   /* line 1788 [0x0001:0x00176d9c] [0x9]  */ if (version >= 0x1005) {
  506.   /* line 1790 [0x0001:0x00176da5] [0x17] */   fread(*(data_mtlopac_size), sizeof(data_mtlopac_size), 1, fp);
  507.   /* line 1791 [0x0001:0x00176da5] [0x17] */ };
  508.   /* line 1793 [0x0001:0x00176dbc] [0x1a] */ fread(*(data_texuv_size), sizeof(data_texuv_size), 1, fp);
  509.   /* line 1794 [0x0001:0x00176dd6] [0x1a] */ fread(*(data_teximg_size), sizeof(data_teximg_size), 1, fp);
  510.   /* line 1796 [0x0001:0x00176df0] [0x6]  */ if (version > 0) {
  511.   /* line 1798 [0x0001:0x00176df6] [0x5f] */   this->anim_bone = new MindPower::lwAnimDataBone();
  512.   /* line 1799 [0x0001:0x00176e55] [0x16] */   this->anim_bone->Load(fp, version);
  513.   /* line 1800 [0x0001:0x00176e55] [0x16] */ };
  514.   /* line 1802 [0x0001:0x00176e6b] [0x9]  */ if (data_mat_size > 0) {
  515.   /* line 1808 [0x0001:0x00176e74] [0x5f] */   this->anim_mat = new MindPower::lwAnimDataMatrix();
  516.   /* line 1809 [0x0001:0x00176ed3] [0x16] */   this->anim_mat->Load(fp, version);
  517.   /* line 1810 [0x0001:0x00176ed3] [0x16] */ };
  518.   /* line 1813 [0x0001:0x00176ee9] [0xd]  */ if (version >= 0x1005) {
  519.   /* line 1815 [0x0001:0x00176ef6] [0x28] */   for (unsigned long i = 0; i < 16; i++) {
  520.   /* line 1817 [0x0001:0x00176f1e] [0x10] */     if (data_mtlopac_size[i] == 0 )
  521.   /* line 1818 [0x0001:0x00176f2e] [0x2]  */       continue;
  522.   /* line 1820 [0x0001:0x00176f30] [0x66] */     this->anim_mtlopac[i] = new MindPower::lwAnimDataMtlOpacity();
  523.   /* line 1821 [0x0001:0x00176f96] [0x1d] */     this->anim_mtlopac[i]->Load(fp, version);
  524.   /* line 1822 [0x0001:0x00176fb3] [0x5]  */   };
  525.   /* line 1823 [0x0001:0x00176fb3] [0x5]  */ };
  526.   /* line 1825 [0x0001:0x00176fb8] [0x28] */ for(unsigned long i = 0; i < 16; i++) {
  527.   /* line 1827 [0x0001:0x00176fe0] [0x28] */   for(unsigned long j = 0; j < 4; j++) {
  528.   /* line 1829 [0x0001:0x00177008] [0x1c] */     if (data_texuv_size[i][j] == 0 )
  529.   /* line 1830 [0x0001:0x00177024] [0x2]  */       continue;
  530.   /* line 1832 [0x0001:0x00177026] [0x72] */     this->anim_tex[i][j] = new MindPower::lwAnimDataTexUV();
  531.   /* line 1833 [0x0001:0x00177098] [0x29] */     this->anim_tex[i][j]->Load(fp, version);
  532.   /* line 1834 [0x0001:0x001770c1] [0x5]  */   };
  533.   /* line 1835 [0x0001:0x001770c6] [0x5]  */ };
  534.   /* line 1837 [0x0001:0x001770cb] [0x28] */ for (unsigned long i = 0; i < 16; i++) {
  535.   /* line 1839 [0x0001:0x001770f3] [0x28] */   for(unsigned long j = 0; j < 4; j++) {
  536.   /* line 1841 [0x0001:0x0017711b] [0x1c] */     if (data_teximg_size[i][j] == 0 )
  537.   /* line 1842 [0x0001:0x00177137] [0x2]  */       continue;
  538.   /* line 1844 [0x0001:0x00177139] [0x78] */     this->anim_img[i][j] = new MindPower::lwAnimDataTexImg();
  539.   /* line 1845 [0x0001:0x001771b1] [0x2c] */     this->anim_img[i][j]->Load();
  540.   /* line 1846 [0x0001:0x001771dd] [0x5]  */   };
  541.   /* line 1847 [0x0001:0x001771e2] [0x5]  */ };
  542.   /* line 1849 [0x0001:0x001771e7] [0x2]  */ return 0;
  543.   /* line 1851 [0x0001:0x001771e9] [0x10] */
  544. }
  545.  
  546. // .lab
  547. public: virtual long __thiscall MindPower::lwAnimDataBone::Load(const char * file) {
  548.   /* line 746 [0x0001:0x00173300] [0x17] */
  549.   /* line 747 [0x0001:0x00173317] [0x7]  */ long ret = -1;
  550.   /* line 749 [0x0001:0x0017331e] [0x14] */ _iobuf *fp = fopen(file, "rb");
  551.   /* line 750 [0x0001:0x00173332] [0x6]  */ if (fp) {
  552.   /* line 751 [0x0001:0x00173338] [0x2]  */   unsigned long version;
  553.   /* line 754 [0x0001:0x0017333a] [0x14] */   fread(&version, sizeof(unsigned long), 1, fp);
  554.   /* line 756 [0x0001:0x0017334e] [0x9]  */   if ( version < 0x1000 ) {
  555.   /* line 758 [0x0001:0x00173357] [0x7]  */     version = 0;
  556.   /* line 759 [0x0001:0x0017335e] [0x18] */     char buf[256];
  557.   /* line 760 [0x0001:0x0017335e] [0x18] */     sprintf(&buf, "old animation file: %s, need re-export it", file);
  558.   /* line 761 [0x0001:0x00173376] [0x16] */     MessageBoxA(0, &buf, "warning", 0);
  559.   /* line 762 [0x0001:0x00173376] [0x16] */   };
  560.   /* line 764 [0x0001:0x0017338c] [0x17] */   if (this->MindPower::lwAnimDataBone::Load(fp, version) >= 0) { // Overloaded version
  561.   /* line 766 [0x0001:0x001733a3] [0x2]  */      ret = 0;
  562.   /* line 767 [0x0001:0x001733a5] [0x7]  */   }
  563.   /* line 768 [0x0001:0x001733a5] [0x7]  */ };
  564.   /* line 770 [0x0001:0x001733ac] [0x6]  */ if (fp)
  565.   /* line 772 [0x0001:0x001733b2] [0xc]  */   fclose(fp);
  566.   /* line 775 [0x0001:0x001733be] [0x3]  */ return ret;
  567.   /* line 777 [0x0001:0x001733c1] [0xe]  */
  568. }
  569.  
  570. public: long __thiscall MindPower::lwAnimDataBone::Load(struct _iobuf *fp, unsigned long version) {
  571.   /* line 603 [0x0001:0x001729b0] [0x24] */
  572.   /* line 604 [0x0001:0x001729d4] [0x6]  */ if (version == 0) {
  573.   /* line 606 [0x0001:0x001729da] [0x14] */   unsigned long old_version;
  574.   /* line 607 [0x0001:0x001729da] [0x14] */   fread(old_version, sizeof(unsigned long), 1, fp);
  575.   /* line 608 [0x0001:0x001729ee] [0x7]  */   int x = 0;
  576.   /* line 609 [0x0001:0x001729ee] [0x7]  */ };
  577.   /* line 612 [0x0001:0x001729f5] [0xc]  */ if (this->_base_seq) {
  578.   /* line 613 [0x0001:0x00172a01] [0x8]  */   return -1;
  579.   /* line 614 [0x0001:0x00172a01] [0x8]  */ };
  580.   /* line 615 [0x0001:0x00172a09] [0x1a] */ fread(*(this->_header), sizeof(MindPower::lwAnimDataBone::lwBoneInfoHeader), 1, fp);
  581.   /* line 617 [0x0001:0x00172a23] [0x24] */ this->_base_seq = new MindPower::lwBoneBaseInfo[this->_header.bone_num];
  582.   /* line 618 [0x0001:0x00172a47] [0x86] */ this->_key_seq = new MindPower::lwBoneKeyInfo[this->_header._bone_num];
  583.   /* line 619 [0x0001:0x00172acd] [0x70] */ this->_invmat_seq = new D3DXMATRIX[this->_header._bone_num];
  584.   /* line 620 [0x0001:0x00172b3d] [0x70] */ this->_dummy_seq = new MindPower::lwBoneDummyInfo[this->_header.dummy_num];
  585.   /* line 622 [0x0001:0x00172bad] [0x22] */ fread(this->_base_seq, sizeof(MindPower::lwBoneBaseInfo), this->_header.bone_num, fp);
  586.   /* line 623 [0x0001:0x00172bcf] [0x22] */ fread(this->_invmat_seq, sizeof(D3DXMATRIX), this->_header.bone_num, fp);
  587.   /* line 624 [0x0001:0x00172bf1] [0x22] */ fread(this->_dummy_seq, sizeof(MindPower::lwBoneDummyInfo), this->_header.dummy_num, fp);
  588.   /* line 629 [0x0001:0x00172c13] [0x37] */ if (this->_header.key_type == 1) {
  589.   /* line 632 [0x0001:0x00172c4a] [0x24] */   for (unsigned long i = 0; i < this->_header.bone_num; i++) {
  590.   /* line 634 [0x0001:0x00172c6e] [0x12] */     MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
  591.   /* line 635 [0x0001:0x00172c80] [0x6c] */     key->mat43_seq = new MindPower::lwMatrix43[this->frame_num];
  592.   /* line 636 [0x0001:0x00172cec] [0x1e] */     fread(key->mat43_seq, sizeof(MindPower::lwMatrix43), this->_header.frame_num, fp);
  593.   /* line 637 [0x0001:0x00172d0a] [0x5]  */   };
  594.   /* line 638 [0x0001:0x00172d0f] [0x5]  */ } else if (this->_header.key_type == 2) {
  595.   /* line 640 [0x0001:0x00172d14] [0x24] */   for (unsigned long i = 0; i < this->_header.bone_num; i++) {
  596.   /* line 642 [0x0001:0x00172d38] [0x12] */     MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
  597.   /* line 643 [0x0001:0x00172d4a] [0x6d] */     key->mat44_seq = new D3DXMATRIX[this->_header.frame_num];
  598.   /* line 644 [0x0001:0x00172db7] [0x1f] */     fread(key->mat44_seq, sizeof(D3DXMATRIX), this->_header.frame_num, fp);
  599.   /* line 645 [0x0001:0x00172dd6] [0x5]  */   };
  600.   /* line 646 [0x0001:0x00172ddb] [0x5]  */ } else if (this->_header.key_type == 3) {
  601.   /* line 648 [0x0001:0x00172de0] [0xd]  */   if (version >= 0x1003) {
  602.   /* line 650 [0x0001:0x00172ded] [0x24] */     for (unsigned long i = 0; i < this->_header.bone_num; i++) {
  603.   /* line 652 [0x0001:0x00172e11] [0x12] */        MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
  604.   /* line 654 [0x0001:0x00172e23] [0x6d] */        key->pos_seq = new D3DXVECTOR3[this->_header.frame_num];
  605.   /* line 655 [0x0001:0x00172e90] [0x1f] */        fread(key->pos_seq, sizeof(D3DXVECTOR3), this->_header.frame_num, fp);
  606.   /* line 657 [0x0001:0x00172eaf] [0x6d] */        key->quat_seq = new D3DXQUATERNION[this->_header.frame_num];
  607.   /* line 658 [0x0001:0x00172f1c] [0x1f] */        fread(key->quat_seq, sizeof(D3DXQUATERNION), this->_header.frame_num, fp);
  608.   /* line 659 [0x0001:0x00172f3b] [0x5]  */     };
  609.   /* line 661 [0x0001:0x00172f40] [0x5]  */   } else {
  610.   /* line 663 [0x0001:0x00172f45] [0x24] */     for (unsigned long i = 0; i < this->_header.bone_num; i++) {
  611.   /* line 665 [0x0001:0x00172f69] [0x12] */       MindPower::lwBoneKeyInfo *key = this->_key_seq[i];
  612.   /* line 667 [0x0001:0x00172f7b] [0x3a] */       unsigned long pos_num = this->_base_seq[i]->parent_id == -1 ? this->_header.frame_num : 1;
  613.   /* line 669 [0x0001:0x00172fb5] [0x7f] */       key->pos_seq = new D3DXVECTOR3[this->_header.frame_num];
  614.   /* line 670 [0x0001:0x00173034] [0x19] */       fread(key->pos_seq, sizeof(D3DXVECTOR3), pos_num, fp);
  615.   /* line 672 [0x0001:0x0017304d] [0x6]  */       if (pos_num == 1) {
  616.   /* line 674 [0x0001:0x00173053] [0x20] */         for (unsigned long j = 1; j < this->_header.frame_num; j++) {
  617.   /* line 676 [0x0001:0x00173073] [0x24] */           key->pos_seq[i] = key->pos_seq[0];
  618.   /* line 677 [0x0001:0x00173097] [0x2]  */         };
  619.   /* line 678 [0x0001:0x00173097] [0x2]  */       };
  620.   /* line 680 [0x0001:0x00173099] [0x88] */       key->quat_seq = new D3DXQUATERNION[this->_header.frame_num];
  621.   /* line 681 [0x0001:0x00173121] [0x1f] */       fread(key->quat_seq, sizeof(D3DXQUATERNION), this->_header.frame_num, fp);
  622.   /* line 682 [0x0001:0x00173140] [0x5]  */     };
  623.   /* line 690 [0x0001:0x00173145] [0x2]  */   };
  624.   /* line 691 [0x0001:0x00173145] [0x2]  */ };
  625.   /* line 692 [0x0001:0x00173145] [0x2]  */ return 0;
  626.   /* line 694 [0x0001:0x00173147] [0x10] */
  627. }
  628.  
  629. public: long __thiscall MindPower::lwAnimDataMatrix::Load(struct _iobuf *fp, unsigned long version) {
  630.   /* line 1056 [0x0001:0x00173ea0] [0x1e] */
  631.   /* line 1057 [0x0001:0x00173ebe] [0x17] */ fread(*(this->_frame_num), sizeof(unsigned long), 1, fp);
  632.   /* line 1059 [0x0001:0x00173ed5] [0x61] */ this->_mat_seq = new MindPower::lwMatrix43[this->_frame_num];
  633.   /* line 1060 [0x0001:0x00173f36] [0x1c] */ fread(this->_mat_seq, sizeof(MindPower::lwMatrix43), this->_frame_num, fp);
  634.   /* line 1065 [0x0001:0x00173f52] [0x2]  */ return 0;
  635.   /* line 1067 [0x0001:0x00173f54] [0x10] */
  636. }
  637.  
  638. public: long __thiscall MindPower::lwAnimDataMtlOpacity::Load(struct _iobuf *fp, unsigned long version) {
  639.   /* line 522 [0x0001:0x00172620] [0x1e] */
  640.   /* line 523 [0x0001:0x0017263e] [0x7]  */ long ret = -1;
  641.   /* line 527 [0x0001:0x00172645] [0x14] */ unsigned long num;
  642.   /* line 528 [0x0001:0x00172645] [0x14] */ fread(*(num), sizeof(unsigned long), 1, fp);
  643.   /* line 531 [0x0001:0x00172659] [0x18] */ MindPower::lwKeyFloat *seq = new MindPower::lwKeyFloat[num];
  644.   /* line 533 [0x0001:0x00172671] [0x16] */ fread(seq, sizeof(MindPower::lwKeyFloat), num, fp);
  645.   /* line 535 [0x0001:0x00172687] [0x44] */ this->_aks_ctrl = new MindPower::lwAnimKeySetFloat();
  646.   /* line 537 [0x0001:0x001726cb] [0x1f] */ if (this->_aks_ctrl->SetKeySequence(seq, num) >= 0) {
  647.   /* line 538 [0x0001:0x001726ea] [0x2]  */    ret = 0;
  648.   /* line 540 [0x0001:0x001726ec] [0x7]  */ };
  649.   /* line 542 [0x0001:0x001726f3] [0x3]  */ return ret;
  650.   /* line 544 [0x0001:0x001726f6] [0x10] */
  651. }
  652.  
  653. public: long __thiscall MindPower::lwAnimDataTexUV::Load(struct _iobuf *fp, unsigned long version) {
  654.   /* line 308 [0x0001:0x00171f60] [0x1e] */
  655.   /* line 309 [0x0001:0x00171f7e] [0x17] */ fread(*(this->_frame_num), sizeof(unsigned long), 1, fp);
  656.   /* line 311 [0x0001:0x00171f95] [0x61] */ this->_mat_seq = new D3DXMATRIX[this->_frame_num];
  657.   /* line 312 [0x0001:0x00171ff6] [0x1c] */ fread(this->_mat_seq, sizeof(D3DXMATRIX), this->_frame_num, fp);
  658.   /* line 317 [0x0001:0x00172012] [0x2]  */ return 0;
  659.   /* line 319 [0x0001:0x00172014] [0x10] */
  660. }
  661.  
  662. public: long __thiscall MindPower::lwAnimDataTexImg::Load(struct _iobuf *fp, unsigned long version) {
  663.   /* line 435 [0x0001:0x001722d0] [0x17] */
  664.   /* line 436 [0x0001:0x001722e7] [0x6]  */ long ret = 0;
  665.   /* line 436 [0x0001:0x001722e7] [0x6]  */ if (version == 0) {
  666.   /* line 438 [0x0001:0x001722ed] [0x14] */   char buf[256];
  667.   /* line 439 [0x0001:0x001722ed] [0x14] */   sprintf(*buf, "old version file, need re-export it");
  668.   /* line 440 [0x0001:0x00172301] [0x16] */   MessageBoxA(0, &buf, "warning", 0);
  669.   /* line 441 [0x0001:0x00172317] [0x5]  */   ret = -1;
  670.   /* line 444 [0x0001:0x0017231c] [0x1a] */ } else {
  671.   /* line 445 [0x0001:0x0017231c] [0x1a] */   fread(*(this->_data_num), sizeof(unsigned long), 1, fp);
  672.   /* line 446 [0x0001:0x00172336] [0x2d] */   this->_data_seq = new MindPower::lwTexInfo[this->_data_num];
  673.   /* line 447 [0x0001:0x00172363] [0x25] */   fread(this->_data_seq, sizeof(MindPower::lwTexInfo), this->_data_num, fp);
  674.   /* line 449 [0x0001:0x00172388] [0x2]  */ };
  675.   /* line 450 [0x0001:0x00172388] [0x2]  */ return ret;
  676.   /* line 451 [0x0001:0x0017238a] [0xe]  */
  677. }
  678.  
  679. // .lmo
  680. public: virtual long __thiscall MindPower::lwModelObjInfo::Load(const char *file) {
  681.   /* line 2872 [0x0001:0x00179d20] [0x24] */
  682.   /* line 2873 [0x0001:0x00179d44] [0x14] */ _iobuf *fp = fopen(file, "rb");
  683.   /* line 2874 [0x0001:0x00179d58] [0x6]  */ if ( !fp )
  684.   /* line 2875 [0x0001:0x00179d5e] [0x8]  */   return -1;
  685.   /* line 2877 [0x0001:0x00179d66] [0x14] */ unsigned long version;
  686.   /* line 2879 [0x0001:0x00179d66] [0x14] */ fread(&version, sizeof(unsigned long), 1, fp);
  687.   /* line 2882 [0x0001:0x00179d7a] [0x14] */ unsigned long obj_num;
  688.   /* line 2883 [0x0001:0x00179d7a] [0x14] */ fread(&obj_num, sizeof(unsigned long), 1, fp);
  689.   /* line 2885 [0x0001:0x00179d8e] [0x19] */ MindPower::lwModelObjInfo::lwModelObjInfoHeader header[33];
  690.   /* line 2886 [0x0001:0x00179d8e] [0x19] */ fread(&header, sizeof(MindPower::lwModelObjInfo::lwModelObjInfoHeader), obj_num, fp);
  691.   /* line 2888 [0x0001:0x00179da7] [0xd]  */ this->geom_obj_num = 0;
  692.   /* line 2890 [0x0001:0x00179db4] [0x2a] */ for (unsigned long i = 0; i < obj_num; i++) {
  693.   /* line 2892 [0x0001:0x00179dde] [0x1f] */   fseek(fp, header[i].addr, 0);
  694.   /* line 2894 [0x0001:0x00179dfd] [0x31] */   if (header[i].type == 1) {
  695.   /* line 2897 [0x0001:0x00179e2e] [0x6c] */     this->geom_obj_seq[this->geom_obj_num] = new MindPower::lwGeomObjInfo();
  696.   /* line 2898 [0x0001:0x00179e9a] [0x6]  */     if ( version == 0) {
  697.   /* line 2900 [0x0001:0x00179ea0] [0x17] */       unsigned long old_version;
  698.   /* line 2901 [0x0001:0x00179ea0] [0x17] */       fread(&old_version, 4, 1, fp);
  699.   /* line 2902 [0x0001:0x00179ea0] [0x17] */     }
  700.   /* line 2903 [0x0001:0x00179eb7] [0x20] */     this->geom_obj_seq[this->geom_obj_num]->MindPower::lwGeomObjInfo::Load(fp, version);
  701.   /* line 2904 [0x0001:0x00179ed7] [0x15] */     this->geom_obj_num++;
  702.   /* line 2905 [0x0001:0x00179eec] [0x2]  */   } else if (header[i].type == 2) {
  703.   /* line 2907 [0x0001:0x00179eee] [0x19] */     this->helper_data->MindPower::lwHelperInfo::Load(fp, version);
  704.   /* line 2908 [0x0001:0x00179eee] [0x19] */   };
  705.   /* line 2912 [0x0001:0x00179f07] [0x5]  */ };
  706.   /* line 2915 [0x0001:0x00179f0c] [0x6]  */ if (fp)
  707.   /* line 2917 [0x0001:0x00179f12] [0xc]  */   fclose(fp);
  708.   /* line 2920 [0x0001:0x00179f1e] [0x2]  */ return 0;
  709.   /* line 2922 [0x0001:0x00179f20] [0x10] */
  710. }
  711.  
  712. public: long __thiscall MindPower::lwHelperDummyObjInfo::Load(struct _iobuf *fp, unsigned long version) {
  713.   /* line 3078 [0x0001:0x0017a360] [0x1e] */
  714.   /* line 3079 [0x0001:0x0017a37e] [0x7]  */ long ret = -1;
  715.   /* line 3081 [0x0001:0x0017a385] [0x17] */ fread(&this->_id, sizeof(unsigned long), 1, fp);
  716.   /* line 3082 [0x0001:0x0017a39c] [0x17] */ fread(&this->_mat, sizeof(D3DXMATRIX), 1, fp);
  717.   /* line 3084 [0x0001:0x0017a3b3] [0x23] */ if (this->_anim_data ) delete this->_anim_data;
  718.   /* line 3086 [0x0001:0x0017a3d6] [0x7]  */ unsigned long anim_data_flag = 0;
  719.   /* line 3087 [0x0001:0x0017a3dd] [0x14] */ fread(&anim_data_flag, sizeof(unsigned long), 1, fp);
  720.   /* line 3088 [0x0001:0x0017a3f1] [0xa]  */ if (anim_data_flag == 1) {
  721.   /* line 3090 [0x0001:0x0017a3fb] [0x41] */   MindPower::lwAnimDataMatrix *anim_data = new MindPower::lwAnimDataMatrix();
  722.   /* line 3091 [0x0001:0x0017a43c] [0x12] */   if (anim_data->MindPower::lwAnimDataMatrix::Load(fp, 0) < 0) {
  723.   /* line 3093 [0x0001:0x0017a44e] [0x28] */     delete anim_data;
  724.   /* line 3094 [0x0001:0x0017a476] [0x2]  */     return -1;
  725.   /* line 3095 [0x0001:0x0017a476] [0x2]  */   } else {
  726.   /* line 3096 [0x0001:0x0017a478] [0x9]  */     this->_anim_data = anim_data;
  727.   /* line 3097 [0x0001:0x0017a478] [0x9]  */   };
  728.   /* line 3099 [0x0001:0x0017a481] [0x7]  */ };
  729.   /* line 3100 [0x0001:0x0017a481] [0x7]  */ ret = 0;
  730.   /* line 3102 [0x0001:0x0017a488] [0x3]  */ return ret;
  731.   /* line 3104 [0x0001:0x0017a48b] [0x10] */
  732. }
  733.  
  734. public: long __thiscall MindPower::lwModelNodeInfo::Load(struct _iobuf *fp, unsigned long version) {
  735.   /* line 3151 [0x0001:0x0017a640] [0x1e] */
  736.   /* line 3152 [0x0001:0x0017a65e] [0x7]  */ long ret = -1;
  737.   /* line 3154 [0x0001:0x0017a665] [0x14] */ fread(&this->_head, sizeof(MindPower::lwModelNodeHeadInfo), 1, fp);
  738.   /* line 3156 [0x0001:0x0017a679] [0x9]  */ switch (this->_head.type) {
  739.   /* line 3158 [0x0001:0x0017a682] [0x47] */     this->_data = new MindPower::lwGeomObjInfo();
  740.   /* line 3159 [0x0001:0x0017a6c9] [0x17] */     if ((MindPower::lwGeomObjInfo *)(this->_data)->MindPower::lwGeomObjInfo::Load(fp, version) >= 0) ret = 0;
  741.   /* line 3160 [0x0001:0x0017a6e0] [0x5]  */     break;
  742.   /* line 3162 [0x0001:0x0017a6e5] [0xe]  */   case 2:
  743.   /* line 3164 [0x0001:0x0017a6f3] [0x44] */     this->_data = new MindPower::lwAnimDataBone();
  744.   /* line 3165 [0x0001:0x0017a737] [0x17] */     if ((MindPower::lwAnimDataBone *)(this->_data)->MindPower::lwAnimDataBone::Load(fp, version) >= 0) ret = 0;
  745.   /* line 3166 [0x0001:0x0017a74e] [0x5]  */     break;
  746.   /* line 3168 [0x0001:0x0017a753] [0xe]  */   case 3:
  747.   /* line 3170 [0x0001:0x0017a761] [0x44] */     this->_data = new MindPower::lwHelperDummyObjInfo();
  748.   /* line 3171 [0x0001:0x0017a7a5] [0x17] */     if ((MindPower::lwHelperDummyObjInfo *)(this->_data)->MindPower::lwHelperDummyObjInfo::Load(fp, version) >= 0) ret = 0;
  749.   /* line 3172 [0x0001:0x0017a7bc] [0x2]  */     break;
  750.   /* line 3174 [0x0001:0x0017a7be] [0xb]  */   case 4:
  751.   /* line 3176 [0x0001:0x0017a7c9] [0x44] */     this->_data = new MindPower::lwHelperInfo();
  752.   /* line 3177 [0x0001:0x0017a80d] [0x17] */     if ((MindPower::lwHelperInfo *)(this->_data)->MindPower::lwHelperInfo::Load(fp, version) >= 0) ret = 0;
  753.   /* line 3178 [0x0001:0x0017a824] [0x2]  */     break;
  754.   /* line 3180 [0x0001:0x0017a826] [0x2]  */   default:
  755.   /* line 3182 [0x0001:0x0017a828] [0x2]  */ };
  756.   /* line 3185 [0x0001:0x0017a82a] [0x7]  */
  757.   /* line 3187 [0x0001:0x0017a831] [0x3]  */ return ret;
  758.   /* line 3188 [0x0001:0x0017a834] [0x10] */
  759. }
  760.  
  761. // .lxo
  762. public: long __thiscall MindPower::lwModelInfo::Load(const char *file) {
  763.   /* line 3302 [0x0001:0x0017a9b0] [0x1e] */
  764.   /* line 3303 [0x0001:0x0017a9ce] [0x7]  */ long ret = -1;
  765.   /* line 3305 [0x0001:0x0017a9d5] [0x14] */ _iobuf *fp = fopen(file, "rb");
  766.   /* line 3306 [0x0001:0x0017a9e9] [0x6]  */ if (!fp) {
  767.   /* line 3307 [0x0001:0x0017a9ef] [0x5]  */   goto __ret;
  768.   /* line 3308 [0x0001:0x0017a9f4] [0x14] */ };
  769.   /* line 3309 [0x0001:0x0017a9f4] [0x14] */ fread(&this->_head, sizeof(MindPower::lwModelHeadInfo), 1, fp);
  770.   /* line 3310 [0x0001:0x0017aa08] [0x14] */ unsigned long obj_num
  771.   /* line 3312 [0x0001:0x0017aa08] [0x14] */ fread(&obj_num, sizeof(unsigned long), 1, fp);
  772.   /* line 3314 [0x0001:0x0017aa1c] [0x6]  */ if (obj_num == 0) {
  773.   /* line 3315 [0x0001:0x0017aa22] [0x5]  */   goto __addr_ret_ok;
  774.   /* line 3316 [0x0001:0x0017aa27] [0x7]  */ };
  775.   /* line 3317 [0x0001:0x0017aa27] [0x7]  */ MindPower::lwITreeNode *tree_node = 0;
  776.   /* line 3318 [0x0001:0x0017aa2e] [0x7]  */ MindPower::lwModelNodeInfo *node_info = 0;
  777.   /* line 3320 [0x0001:0x0017aa35] [0x1e] */ for (unsigned long i = 0; i < obj_num; i++) {
  778.   /* line 3322 [0x0001:0x0017aa53] [0x41] */   node_info = new MindPower::lwModelNodeInfo();
  779.   /* line 3323 [0x0001:0x0017aa94] [0x17] */   if (node_info->MindPower::lwModelNodeInfo::Load(fp, this->_head.version) < 0) {
  780.   /* line 3325 [0x0001:0x0017aaab] [0x28] */     delete node_info;
  781.   /* line 3326 [0x0001:0x0017aad3] [0x5]  */     goto __ret;
  782.   /* line 3328 [0x0001:0x0017aad8] [0x41] */   }
  783.   /* line 3329 [0x0001:0x0017aad8] [0x41] */   tree_node = new MindPower::lwTreeNode();
  784.   /* line 3330 [0x0001:0x0017ab19] [0xf]  */   tree_node->_SetRegisterID((void *)node_info); // MindPower::lwTreeNode::_SetRegisterID(unsigned long)
  785.   /* line 3333 [0x0001:0x0017ab28] [0x9]  */   if (this->_obj_tree == 0) {
  786.   /* line 3335 [0x0001:0x0017ab31] [0x9]  */     this->_obj_tree = tree_node;
  787.   /* line 3337 [0x0001:0x0017ab3a] [0x2]  */   } else {
  788.   /* line 3339 [0x0001:0x0017ab3c] [0x9]  */     MindPower::__find_info param;
  789.   /* line 3340 [0x0001:0x0017ab3c] [0x9]  */     param.handle = node_info->_parent_handle;
  790.   /* line 3341 [0x0001:0x0017ab45] [0x7]  */     param.node = 0;
  791.   /* line 3342 [0x0001:0x0017ab4c] [0x1c] */     this->_obj_tree->EnumTree(MindPower::__tree_proc_find_node, &param, 0);
  792.   /* line 3344 [0x0001:0x0017ab68] [0x6]  */     if (param.node = 0) {
  793.   /* line 3345 [0x0001:0x0017ab6e] [0x2]  */       goto __ret;
  794.   /* line 3346 [0x0001:0x0017ab70] [0x15] */     };
  795.   /* line 3347 [0x0001:0x0017ab70] [0x15] */     if (param.node->InsertChild(0, tree_node) < 0) {
  796.   /* line 3348 [0x0001:0x0017ab85] [0x2]  */       goto __ret;
  797.   /* line 3349 [0x0001:0x0017ab87] [0x5]  */     };
  798.   /* line 3350 [0x0001:0x0017ab87] [0x5]  */   };
  799.   /* line 3351 [0x0001:0x0017ab87] [0x5]  */ };
  800.   /* line 3364 [0x0001:0x0017ab8c] [0x7]  */ __addr_ret_ok:
  801.   /* line 3365 [0x0001:0x0017ab8c] [0x7]  */   ret = 0;
  802.   /* line 3366 [0x0001:0x0017ab93] [0x6]  */ __ret:
  803.   /* line 3367 [0x0001:0x0017ab93] [0x6]  */   if (fp)
  804.   /* line 3369 [0x0001:0x0017ab99] [0xc]  */     fclose(fp);
  805.   /* line 3372 [0x0001:0x0017aba5] [0x3]  */   return ret;
  806.   /* line 3374 [0x0001:0x0017aba8] [0x10] */
  807. }
  808.  
  809.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement