annotate ObjectList.cpp @ 1607:d4282f59f312

Слияние
author Ritor1
date Wed, 11 Sep 2013 00:16:58 +0600
parents 75fafd8ced59
children c1c74df0a33e
rev   line source
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1 #include "ObjectList.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2 #include "mm7_data.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3 #include "Sprites.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4 #include "FrameTableInc.h"
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
5 #include "ErrorHandling.h"
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
6
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
7 //----- (0042EB42) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
8 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
9 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
10 unsigned int v2; // edx@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
11 signed int v3; // eax@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
12 char *v4; // ecx@2
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
13
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
14 v2 = this->uNumObjects;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
15 v3 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
16 if ( (signed int)this->uNumObjects <= 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
17 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
18 LABEL_5:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
19 LOWORD(v3) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
20 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
21 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
22 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
23 v4 = (char *)&this->pObjects->uObjectID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
24 while ( uItemID != *(short *)v4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
25 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
26 ++v3;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
27 v4 += 56;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
28 if ( v3 >= (signed int)v2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
29 goto LABEL_5;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
30 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
31 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
32 return v3;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
33 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
34 //----- (00459064) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
35 void ObjectList::InitializeSprites()
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
36 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
37 for (uint i = 0; i < uNumObjects; ++i)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
38 pSpriteFrameTable->InitializeSprite(pObjects[i].uSpriteID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
39 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
40
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
41 //----- (00459090) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
42 void ObjectList::ToFile()
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
43 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
44 ObjectList *v1; // esi@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
45 FILE *v2; // eax@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
46 FILE *v3; // edi@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
47
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
48 v1 = this;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
49 v2 = fopen("data\\dobjlist.bin", "wb");
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
50 v3 = v2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
51 if ( !v2 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
52 Error("Unable to save dobjlist.bin!");
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
53 fwrite(v1, 4u, 1u, v2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
54 fwrite(v1->pObjects, 0x38u, v1->uNumObjects, v3);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
55 fclose(v3);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
56 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
57
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
58 //----- (004590DC) --------------------------------------------------------
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
59 void ObjectList::FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
60 {
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
61 uint num_mm6_objs = data_mm6 ? *(int *)data_mm6 : 0,
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
62 num_mm7_objs = data_mm7 ? *(int *)data_mm7 : 0,
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
63 num_mm8_objs = data_mm8 ? *(int *)data_mm8 : 0;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
64
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
65 uNumObjects = num_mm6_objs + num_mm7_objs + num_mm8_objs;
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
66 Assert(uNumObjects);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
67 Assert(!num_mm8_objs);
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
68
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1545
diff changeset
69 pObjects = (ObjectDesc *)malloc(uNumObjects * sizeof(ObjectDesc));
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
70 memcpy(pObjects, (char *)data_mm7 + 4, num_mm7_objs * sizeof(ObjectDesc));
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
71 for (uint i = 0; i < num_mm6_objs; ++i)
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
72 {
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
73 auto src = (ObjectDesc_mm6 *)((char *)data_mm6 + 4) + i;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
74 auto dst = pObjects + num_mm7_objs + i;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
75 memcpy(dst->field_0, src->field_0, sizeof(dst->field_0));
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
76 dst->uObjectID = src->uObjectID;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
77 dst->uRadius = src->uRadius;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
78 dst->uHeight = src->uHeight;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
79 dst->uFlags = src->uFlags;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
80 dst->uSpriteID = src->uSpriteID;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
81 dst->uLifetime = src->uLifetime;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
82 dst->uParticleTrailColor = src->uParticleTrailColor;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
83 dst->uSpeed = src->uSpeed;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
84 dst->uParticleTrailColorR = src->uParticleTrailColorR;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
85 dst->uParticleTrailColorG = src->uParticleTrailColorG;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
86 dst->uParticleTrailColorB = src->uParticleTrailColorB;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
87 dst->field_35_clr = src->field_35_clr;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
88 dst->field_36_clr = 0;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
89 dst->field_37_clr = 0;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1306
diff changeset
90 }
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
91 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
92
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
93 //----- (00459123) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
94 bool ObjectList::FromFileTxt(const char *Args)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
95 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
96 ObjectList *v2; // ebx@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
97 __int32 v3; // edi@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
98 FILE *v4; // eax@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
99 unsigned int v5; // esi@3
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
100 void *v6; // eax@9
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
101 FILE *v7; // ST0C_4@11
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
102 char *i; // eax@11
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
103 unsigned __int16 v9; // ax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
104 const char *v10; // ST20_4@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
105 __int16 v11; // ax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
106 const char *v12; // ST1C_4@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
107 __int16 v13; // ax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
108 const char *v14; // ST18_4@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
109 __int16 v15; // ax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
110 const char *v16; // ST14_4@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
111 __int16 v17; // ax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
112 const char *v18; // ST10_4@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
113 __int16 v19; // ax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
114 const char *v20; // ST0C_4@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
115 int v21; // esi@16
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
116 const char *v22; // edi@16
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
117 int v23; // eax@17
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
118 int v24; // eax@19
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
119 int v25; // eax@21
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
120 int v26; // eax@21
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
121 int v27; // eax@21
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
122 int v28; // eax@23
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
123 int v29; // eax@25
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
124 int v30; // eax@27
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
125 int v31; // eax@29
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
126 const char *v32; // edi@30
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
127 const char *v33; // ST20_4@35
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
128 int v34; // eax@35
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
129 char v35; // al@35
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
130 const char *v36; // ST1C_4@35
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
131 char v37; // al@35
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
132 const char *v38; // ST18_4@35
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
133 FrameTableTxtLine v40; // [sp+8h] [bp-460h]@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
134 FrameTableTxtLine v41; // [sp+84h] [bp-3E4h]@12
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
135 char Dest; // [sp+100h] [bp-368h]@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
136 char Buf; // [sp+178h] [bp-2F0h]@3
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
137 FrameTableTxtLine v44; // [sp+36Ch] [bp-FCh]@4
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
138 FrameTableTxtLine v45; // [sp+3E8h] [bp-80h]@4
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
139 FILE *File; // [sp+464h] [bp-4h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
140 unsigned int Argsa; // [sp+470h] [bp+8h]@3
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
141 int Argsb; // [sp+470h] [bp+8h]@15
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
142
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
143 v2 = this;
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1545
diff changeset
144 free(this->pObjects);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
145 v3 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
146 v2->pObjects = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
147 v2->uNumObjects = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
148 v4 = fopen(Args, "r");
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
149 File = v4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
150 if ( !v4 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
151 Error("ObjectDescriptionList::load - Unable to open file: %s.");
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
152
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
153 v5 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
154 Argsa = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
155 if ( fgets(&Buf, 490, v4) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
156 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
157 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
158 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
159 *strchr(&Buf, 10) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
160 memcpy(&v45, frame_table_txt_parser(&Buf, &v44), sizeof(v45));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
161 if ( v45.uPropCount && *v45.pProperties[0] != '/' )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
162 ++Argsa;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
163 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
164 while ( fgets(&Buf, 490, File) );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
165 v5 = Argsa;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
166 v3 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
167 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
168 v2->uNumObjects = v5;
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1545
diff changeset
169 v6 = malloc(56 * v5);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
170 v2->pObjects = (ObjectDesc *)v6;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
171 if ( v6 == (void *)v3 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
172 Error("ObjectDescriptionList::load - Out of Memory!");
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
173
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
174 memset(v6, v3, 56 * v2->uNumObjects);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
175 v7 = File;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
176 v2->uNumObjects = v3;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
177 fseek(v7, v3, v3);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
178 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
179 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
180 *strchr(&Buf, 10) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
181 memcpy(&v45, frame_table_txt_parser(&Buf, &v41), sizeof(v45));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
182 if ( v45.uPropCount && *v45.pProperties[0] != 47 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
183 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
184 strcpy(v2->pObjects[v2->uNumObjects].field_0, v45.pProperties[0]);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
185 v9 = pSpriteFrameTable->FastFindSprite((char *)v45.pProperties[1]);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
186 v10 = v45.pProperties[2];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
187 v2->pObjects[v2->uNumObjects].uSpriteID = v9;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
188 v11 = atoi(v10);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
189 v12 = v45.pProperties[3];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
190 v2->pObjects[v2->uNumObjects].uObjectID = v11;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
191 v13 = atoi(v12);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
192 v14 = v45.pProperties[4];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
193 v2->pObjects[v2->uNumObjects].uRadius = v13;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
194 v15 = atoi(v14);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
195 v16 = v45.pProperties[5];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
196 v2->pObjects[v2->uNumObjects].uHeight = v15;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
197 v17 = atoi(v16);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
198 v18 = v45.pProperties[6];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
199 v2->pObjects[v2->uNumObjects].uLifetime = v17;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
200 v19 = atoi(v18);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
201 v20 = v45.pProperties[7];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
202 v2->pObjects[v2->uNumObjects].uSpeed = v19;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
203 strcpy(&Dest, v20);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
204 memcpy(&v44, frame_table_txt_parser(&Dest, &v40), sizeof(v44));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
205 if ( v45.uPropCount > 7 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
206 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
207 for ( Argsb = 0; Argsb < v44.uPropCount; ++Argsb )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
208 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
209 v21 = Argsb;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
210 v22 = v44.pProperties[Argsb];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
211 if ( !_stricmp(v44.pProperties[Argsb], "NoDraw") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
212 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
213 v23 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
214 *(char *)v23 |= 1u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
215 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
216 if ( !_stricmp(v22, "Lifetime") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
217 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
218 v24 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
219 *(char *)v24 |= 4u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
220 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
221 if ( !_stricmp(v22, "FTLifetime") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
222 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
223 v25 = (int)&v2->pObjects[v2->uNumObjects];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
224 *(short *)(v25 + 42) = 8 * pSpriteFrameTable->pSpriteSFrames[*(short *)(v25 + 40)].uAnimLength;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
225 v26 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
226 *(char *)v26 |= 8u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
227 v27 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
228 *(char *)v27 |= 4u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
229 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
230 if ( !_stricmp(v22, "NoPickup") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
231 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
232 v28 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
233 *(char *)v28 |= 0x10u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
234 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
235 if ( !_stricmp(v22, "NoGravity") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
236 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
237 v29 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
238 *(char *)v29 |= 0x20u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
239 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
240 if ( !_stricmp(v22, "FlagOnIntercept") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
241 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
242 v30 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
243 *(char *)v30 |= 0x40u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
244 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
245 if ( !_stricmp(v22, "Bounce") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
246 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
247 v31 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
248 *(char *)v31 |= 0x80u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
249 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
250 v32 = v45.pProperties[v21];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
251 if ( !_stricmp(v45.pProperties[v21], "Fire") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
252 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 2u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
253 if ( !_stricmp(v32, "Lines") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
254 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 4u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
255 if ( !_stricmp(v44.pProperties[v21], "bits") )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
256 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
257 v33 = v44.pProperties[v21 + 1];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
258 v34 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
259 *(char *)(v34 + 1) |= 1u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
260 v35 = atoi(v33);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
261 v36 = v44.pProperties[v21 + 2];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
262 v2->pObjects[v2->uNumObjects].uParticleTrailColorR = v35;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
263 v37 = atoi(v36);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
264 v38 = v44.pProperties[v21 + 3];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
265 v2->pObjects[v2->uNumObjects].uParticleTrailColorG = v37;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
266 v2->pObjects[v2->uNumObjects].uParticleTrailColorB = atoi(v38);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
267 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
268 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
269 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
270 ++v2->uNumObjects;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
271 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
272 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
273 fclose(File);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
274 return 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
275 }