comparison SpriteObject.cpp @ 1297:5450af4f57ef

moving files mm7_x ending
author Ritor1
date Wed, 19 Jun 2013 17:06:58 +0600
parents 33e360a9b4bf
children 13b7be8b06a0
comparison
equal deleted inserted replaced
1296:c423f946dc99 1297:5450af4f57ef
1086 if (pSpriteObjects[i].uObjectDescID) 1086 if (pSpriteObjects[i].uObjectDescID)
1087 memcpy(&pSpriteObjects[new_obj_pos++], &pSpriteObjects[i],sizeof(SpriteObject)); 1087 memcpy(&pSpriteObjects[new_obj_pos++], &pSpriteObjects[i],sizeof(SpriteObject));
1088 } 1088 }
1089 uNumSpriteObjects = new_obj_pos; 1089 uNumSpriteObjects = new_obj_pos;
1090 } 1090 }
1091 //----- (00408896) --------------------------------------------------------
1092 void InitializeSpriteObjects()
1093 {
1094 for (uint i = 0; i < uNumSpriteObjects; ++i)
1095 {
1096 auto item = &pSpriteObjects[i];
1097
1098 if (item->uType &&
1099 (item->uSoundID & 8 || pObjectList->pObjects[item->uType].uFlags & 0x10))
1100 SpriteObject::OnInteraction(i);
1101 }
1102
1103 for (uint i = 0; i < 100; ++i)
1104 array_5118E8.pElements[i].field_C_time_left = 0;
1105 }
1106 //----- (0046BEF1) --------------------------------------------------------
1107 void SpriteObject::_46BEF1_apply_spells_aoe()
1108 {
1109 SpriteObject *v1; // edi@1
1110 Actor *v2; // esi@2
1111 __int16 v3; // fps@4
1112 unsigned __int8 v4; // c0@4
1113 unsigned __int8 v5; // c3@4
1114 signed int v6; // [sp+8h] [bp-4h]@1
1115
1116 int v7,v8,v9,v10,v11;
1117
1118 v6 = 0;
1119 v1 = this;
1120 if ( (signed int)uNumActors > 0 )
1121 {
1122 v2 = pActors.data();//[0].vPosition.y;
1123 do
1124 {
1125 if ( v2->CanAct() )
1126 {
1127 //UNDEF(v3);
1128 //.text:0046BF26 movsx eax, word ptr [esi-2]
1129 //.text:0046BF2A sub eax, [edi+4]
1130 //.text:0046BF31 mov [ebp+var_8], eax
1131 //.text:0046BF37 fild [ebp+var_8]
1132 // v7 pushed to stack
1133 v7 = v2->vPosition.x - this->vPosition.x;
1134
1135 //.text:0046BF2D movsx ecx, word ptr [esi+2]
1136 v8 = v2->vPosition.z;
1137
1138 //.text:0046BF34 movsx eax, word ptr [esi]
1139 //.text:0046BF3A sub eax, [edi+8]
1140 //.text:0046BF3D mov [ebp+var_8], eax
1141 //.text:0046BF44 fild [ebp+var_8]
1142 // v9 pushed to stack
1143 v9 = v2->vPosition.y - this->vPosition.y;
1144
1145 //.text:0046BF40 movsx eax, word ptr [esi-6]
1146 //.text:0046BF47 sar eax, 1
1147 //.text:0046BF49 add eax, ecx
1148 //.text:0046BF4B sub eax, [edi+0Ch]
1149 //.text:0046BF4E mov [ebp+var_8], eax
1150 //.text:0046BF51 fild [ebp+var_8]
1151 //.text:0046BF58 fld st
1152 // v10 pushed to stack, two times
1153 v10 = v2->uActorHeight / 2 + v8 - this->vVelocity.y;
1154
1155 //.text:0046BF54 movsx eax, word ptr [esi-8]
1156 //.text:0046BF5A add eax, 100h
1157 //.text:0046BF63 mov ecx, eax
1158 v11 = this->vVelocity.x;
1159
1160 //.text:0046BF5F fmul st, st(1)
1161 // stack: v10*v10, v10, v9, v7
1162 //.text:0046BF61 fld st(2)
1163 // stack: v7, v10*v10, v10, v9, v7
1164
1165
1166 //.text:0046BF65 fmul st, st(3)
1167 // stack: v7*v9, v10*v10, v10, v9, v7
1168
1169 //.text:0046BF67 imul ecx, eax
1170 v11 = v11 * v11;
1171
1172 //.text:0046BF6A faddp st(1), st
1173 // stack: v10*v10+v7*v9, v10, v9, v7
1174 //.text:0046BF6C fld st(3)
1175 // stack: v7, v10*v10+v7*v9, v10, v9, v7
1176 //.text:0046BF6E fmul st, st(4)
1177 // stack: v7*v7, v10*v10+v7*v9, v10, v9, v7
1178 //.text:0046BF70 faddp st(1), st
1179 // stack: v10*v10+v7*v9+v7*v7, v10, v9, v7
1180
1181 //.text:0046BF72 mov [ebp+var_8], ecx
1182 //.text:0046BF75 fild [ebp+var_8]
1183 // v11 pushed to stack
1184
1185 //.text:0046BF78 fcompp
1186 // if ( v11 > v10*v10+v7*v9+v7*v7 )
1187 // stack: v10, v9, v7
1188
1189 //.text:0046BF7A fstp st
1190 // stack: v9, v7
1191
1192 //.text:0046BF7C fnstsw ax
1193 //.text:0046BF7E fstp st
1194 // stack: v7
1195
1196 //.text:0046BF80 test ah, 41h
1197 //.text:0046BF83 fstp st
1198 //.text:0046BF85 jnz short loc_46BFDD
1199
1200 if ( v11 >= v10*v10+v7*v9+v7*v7 )
1201 {
1202 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) )
1203 {
1204 v2->pActorBuffs[v1->spell_id].Apply(
1205 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335),
1206 v1->spell_skill,
1207 4u,
1208 0,
1209 0);
1210 HIWORD(v2->uAttributes) |= 8u;
1211 }
1212 }
1213 }
1214 ++v6;
1215 ++v2;
1216 }
1217 while ( v6 < (signed int)uNumActors );
1218 }
1219 }