@@ -157,8 +157,8 @@ void eAnimatedPortraits::Process()
157
157
eAirEntry Animation;
158
158
int iAnimEntry;
159
159
160
- if (!eSettingsManager::bEnableSelectAnimations)
161
- {
160
+ if (!eCursor::Player1_Selected || ! eSettingsManager::bEnableSelectAnimations) {
161
+
162
162
eMugenCharacterInfo* CharactersArray = *(eMugenCharacterInfo**)0x503394 ;
163
163
164
164
// get anims
@@ -175,6 +175,7 @@ void eAnimatedPortraits::Process()
175
175
}
176
176
177
177
Animation = AIR_Reader.GetAnimation (AnimationTable[iAnimEntry].SelectAnimationID + multipiler);
178
+
178
179
// set scale
179
180
if (eSettingsManager::bEnableAnimationScale) {
180
181
*(float *)(*(int *)eSystem::pMugenResourcesPointer + 0x808 + 0x40 ) = AnimationTable[iAnimEntry].SpritesScaleX ; // p1.face.scale
@@ -183,79 +184,40 @@ void eAnimatedPortraits::Process()
183
184
184
185
185
186
// loop
186
- if (iFrameCounter_p1 > Animation.MaxFrames - 1 )
187
+ if (eCursor::Player1_Character == -2 )
188
+ iFrameCounter_p1 = 0 ;
189
+ else
187
190
{
188
- if (Animation.IsLooping )
189
- iFrameCounter_p1 = Animation.LoopStart - 1 ;
190
- else
191
- iFrameCounter_p1 = 0 ;
192
- }
193
-
194
- // set sprites
195
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x80C ) = Animation.vAnimData [iFrameCounter_p1].Group ; // p1.face group
196
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 ) = Animation.vAnimData [iFrameCounter_p1].Index ; // p1.face index
197
-
198
- // perform animation
199
- if (eSystem::GetTimer () - iTickCounter_p1 <= Animation.vAnimData [iFrameCounter_p1].Frametime ) return ;
200
- iFrameCounter_p1++;
201
-
202
- // reset timer
203
- iTickCounter_p1 = eSystem::GetTimer ();
204
- }
205
- else
206
- {
207
- if (!eCursor::Player1_Selected) {
208
-
209
- eMugenCharacterInfo* CharactersArray = *(eMugenCharacterInfo**)0x503394 ;
210
-
211
- // get anims
212
- AIR_Reader = GetAIRFromName (GetCellFName (eCursor::Player1_Row, eCursor::Player1_Column));
213
- iAnimEntry = FindPortraitEntry (eCursor::Player1_Row, eCursor::Player1_Column);
214
- int multipiler = 0 ;
215
- if ((CharactersArray[eCursor::Player1_Character].CharacterFlag & CHAR_FLAG_VARIATIONS))
216
- {
217
- if (CharactersArray[eCursor::Player1_Character].CurrentVariation > 1 )
218
- {
219
- multipiler = 100 * (CharactersArray[eCursor::Player1_Character].CurrentVariation - 1 );
220
- }
221
-
222
- }
223
-
224
- Animation = AIR_Reader.GetAnimation (AnimationTable[iAnimEntry].SelectAnimationID + multipiler);
225
-
226
- // set scale
227
- if (eSettingsManager::bEnableAnimationScale) {
228
- *(float *)(*(int *)eSystem::pMugenResourcesPointer + 0x808 + 0x40 ) = AnimationTable[iAnimEntry].SpritesScaleX ; // p1.face.scale
229
- *(float *)(*(int *)eSystem::pMugenResourcesPointer + 0x808 + 0x44 ) = AnimationTable[iAnimEntry].SpritesScaleY ; // p1.face.scale
230
- }
231
-
232
-
233
- // loop
234
191
if (iFrameCounter_p1 > Animation.MaxFrames - 1 )
235
192
{
236
193
if (Animation.IsLooping )
237
194
iFrameCounter_p1 = Animation.LoopStart - 1 ;
238
195
else
239
196
iFrameCounter_p1 = 0 ;
240
197
}
198
+ }
241
199
242
- // set sprites
243
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x80C ) = Animation.vAnimData [iFrameCounter_p1].Group ; // p1.face group
244
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 ) = Animation.vAnimData [iFrameCounter_p1].Index ; // p1.face index
200
+
201
+ // set sprites
202
+ *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x80C ) = Animation.vAnimData [iFrameCounter_p1].Group ; // p1.face group
203
+ *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 ) = Animation.vAnimData [iFrameCounter_p1].Index ; // p1.face index
245
204
246
205
247
- // perform animation
248
- if (eSystem::GetTimer () - iTickCounter_p1 <= Animation.vAnimData [iFrameCounter_p1].Frametime ) return ;
206
+ // perform animation
207
+ if (eSystem::GetTimer () - iTickCounter_p1 <= Animation.vAnimData [iFrameCounter_p1].Frametime ) return ;
208
+ if (!(eCursor::Player1_Character == -2 ))
249
209
iFrameCounter_p1++;
250
210
251
- // reset timer
252
- iTickCounter_p1 = eSystem::GetTimer ();
211
+ // reset timer
212
+ iTickCounter_p1 = eSystem::GetTimer ();
253
213
254
- // fix bug where any character select animation would be stuck at last frame
255
- iSelectCounter_p1 = 0 ;
214
+ // fix bug where any character select animation would be stuck at last frame
215
+ iSelectCounter_p1 = 0 ;
256
216
257
- }
258
- else
217
+ }
218
+ else
219
+ {
220
+ if (eSettingsManager::bEnableSelectAnimations)
259
221
{
260
222
eMugenCharacterInfo* CharactersArray = *(eMugenCharacterInfo**)0x503394 ;
261
223
@@ -286,7 +248,7 @@ void eAnimatedPortraits::Process()
286
248
if (Animation.IsLooping )
287
249
iSelectCounter_p1 = Animation.LoopStart - 1 ;
288
250
else
289
- iSelectCounter_p1 = Animation.MaxFrames - 1 ;
251
+ iSelectCounter_p1 = Animation.MaxFrames - 1 ;
290
252
}
291
253
292
254
// set sprites
@@ -297,20 +259,22 @@ void eAnimatedPortraits::Process()
297
259
iSelectCounter_p1++;
298
260
iTickCounter_p1 = eSystem::GetTimer ();
299
261
}
262
+
300
263
}
301
264
}
302
-
265
+ static bool m_bGotAnimation = false ;
303
266
void eAnimatedPortraits::ProcessP2 ()
304
267
{
305
268
eAirReader reader;
306
269
eAirEntry animation, alt_anim;
307
270
bool m_bOnPlayerOne = false ;
271
+
308
272
int iMaxFrames;
309
273
int iAnimEntry;
310
274
311
275
if (eCursor::Player1_Row == eCursor::Player2_Row && eCursor::Player1_Column == eCursor::Player2_Column) m_bOnPlayerOne = true ;
312
276
313
- if (!eSettingsManager::bEnableSelectAnimations)
277
+ if (!eCursor::Player2_Selected || ! eSettingsManager::bEnableSelectAnimations)
314
278
{
315
279
reader = GetAIRFromName (GetCellFName (eCursor::Player2_Row, eCursor::Player2_Column));
316
280
iAnimEntry = FindPortraitEntry (eCursor::Player2_Row, eCursor::Player2_Column);
@@ -325,7 +289,7 @@ void eAnimatedPortraits::ProcessP2()
325
289
}
326
290
327
291
}
328
-
292
+
329
293
animation = reader.GetAnimation (AnimationTable[iAnimEntry].SelectAnimationID + multipiler);
330
294
alt_anim = reader.GetAnimation (AnimationTable[iAnimEntry].SelectAnimationAlternateID + multipiler);
331
295
@@ -339,6 +303,8 @@ void eAnimatedPortraits::ProcessP2()
339
303
*(float *)(*(int *)eSystem::pMugenResourcesPointer + 0x808 + 0x40 + 0xD4 + 8 ) = AnimationTable[iAnimEntry].SpritesScaleY ; // p2.face.scale
340
304
}
341
305
306
+
307
+
342
308
if (iFrameCounter_p2 > iMaxFrames)
343
309
{
344
310
if (animation.IsLooping || alt_anim.IsLooping )
@@ -352,7 +318,6 @@ void eAnimatedPortraits::ProcessP2()
352
318
iFrameCounter_p2 = 0 ;
353
319
}
354
320
355
-
356
321
if (m_bOnPlayerOne && eSettingsManager::bEnableAlternateAnims)
357
322
{
358
323
*(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 + 0xD0 + 4 ) = alt_anim.vAnimData [iFrameCounter_p2].Group ;
@@ -367,69 +332,11 @@ void eAnimatedPortraits::ProcessP2()
367
332
if (eSystem::GetTimer () - iTickCounter_p2 <= animation.vAnimData [iFrameCounter_p2].Frametime ) return ;
368
333
iFrameCounter_p2++;
369
334
iTickCounter_p2 = eSystem::GetTimer ();
335
+ iSelectCounter_p2 = 0 ;
370
336
}
371
- else {
372
- if (!eCursor::Player2_Selected)
373
- {
374
- reader = GetAIRFromName (GetCellFName (eCursor::Player2_Row, eCursor::Player2_Column));
375
- iAnimEntry = FindPortraitEntry (eCursor::Player2_Row, eCursor::Player2_Column);
376
- eMugenCharacterInfo* CharactersArray = *(eMugenCharacterInfo**)0x503394 ;
377
-
378
- int multipiler = 0 ;
379
- if ((CharactersArray[eCursor::Player2_Character].CharacterFlag & CHAR_FLAG_VARIATIONS))
380
- {
381
- if (CharactersArray[eCursor::Player2_Character].CurrentVariation > 1 )
382
- {
383
- multipiler = 100 * (CharactersArray[eCursor::Player2_Character].CurrentVariation - 1 );
384
- }
385
-
386
- }
387
-
388
- animation = reader.GetAnimation (AnimationTable[iAnimEntry].SelectAnimationID + multipiler);
389
- alt_anim = reader.GetAnimation (AnimationTable[iAnimEntry].SelectAnimationAlternateID + multipiler);
390
-
391
-
392
- if (m_bOnPlayerOne && eSettingsManager::bEnableAlternateAnims) iMaxFrames = alt_anim.MaxFrames - 1 ;
393
- else iMaxFrames = animation.MaxFrames - 1 ;
394
-
395
- if (eSettingsManager::bEnableAnimationScale)
396
- {
397
- *(float *)(*(int *)eSystem::pMugenResourcesPointer + 0x808 + 0x40 + 0xD4 + 4 ) = AnimationTable[iAnimEntry].SpritesScaleX ; // p2.face.scale
398
- *(float *)(*(int *)eSystem::pMugenResourcesPointer + 0x808 + 0x40 + 0xD4 + 8 ) = AnimationTable[iAnimEntry].SpritesScaleY ; // p2.face.scale
399
- }
400
-
401
-
402
-
403
- if (iFrameCounter_p2 > iMaxFrames)
404
- {
405
- if (animation.IsLooping || alt_anim.IsLooping )
406
- {
407
- if (animation.IsLooping )
408
- iFrameCounter_p2 = animation.LoopStart - 1 ;
409
- else if (alt_anim.IsLooping )
410
- iFrameCounter_p2 = alt_anim.LoopStart - 1 ;
411
- }
412
- else
413
- iFrameCounter_p2 = 0 ;
414
- }
415
-
416
- if (m_bOnPlayerOne && eSettingsManager::bEnableAlternateAnims)
417
- {
418
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 + 0xD0 + 4 ) = alt_anim.vAnimData [iFrameCounter_p2].Group ;
419
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 + 0xD0 + 8 ) = alt_anim.vAnimData [iFrameCounter_p2].Index ;
420
- }
421
- else {
422
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 + 0xD0 + 4 ) = animation.vAnimData [iFrameCounter_p2].Group ;
423
- *(int *)(*(int *)eSystem::pMugenResourcesPointer + 0x810 + 0xD0 + 8 ) = animation.vAnimData [iFrameCounter_p2].Index ;
424
- }
425
-
426
-
427
- if (eSystem::GetTimer () - iTickCounter_p2 <= animation.vAnimData [iFrameCounter_p2].Frametime ) return ;
428
- iFrameCounter_p2++;
429
- iTickCounter_p2 = eSystem::GetTimer ();
430
- iSelectCounter_p2 = 0 ;
431
- }
432
- else
337
+ else
338
+ {
339
+ if (eSettingsManager::bEnableSelectAnimations)
433
340
{
434
341
reader = GetAIRFromName (GetCellFName (eCursor::Player2_Row, eCursor::Player2_Column));
435
342
iAnimEntry = FindPortraitEntry (eCursor::Player2_Row, eCursor::Player2_Column);
@@ -445,8 +352,6 @@ void eAnimatedPortraits::ProcessP2()
445
352
}
446
353
447
354
}
448
-
449
-
450
355
animation = GetAIRFromName (GetCellFName (eCursor::Player2_Row, eCursor::Player2_Column)).GetAnimation (AnimationTable[iAnimEntry].WinAnimationID + multipiler);
451
356
alt_anim = GetAIRFromName (GetCellFName (eCursor::Player2_Row, eCursor::Player2_Column)).GetAnimation (AnimationTable[iAnimEntry].WinAnimationAlternateID + multipiler);
452
357
@@ -462,7 +367,7 @@ void eAnimatedPortraits::ProcessP2()
462
367
if (animation.IsLooping )
463
368
iSelectCounter_p2 = animation.LoopStart - 1 ;
464
369
else if (alt_anim.IsLooping )
465
- iSelectCounter_p2 = alt_anim.LoopStart - 1 ;
370
+ iSelectCounter_p2 = alt_anim.LoopStart - 1 ;
466
371
}
467
372
else
468
373
iSelectCounter_p2 = iMaxFrames;
@@ -556,7 +461,6 @@ int eAnimatedPortraits::HookDisplaySprites(int a1, int a2, int a3, int a4, int a
556
461
ProcessP2 ();
557
462
}
558
463
559
-
560
464
eCommonHooks::ProcessCharacterSpriteEvent ();
561
465
562
466
return DrawSprites (a1, a2, a3, a4, a5, a6, 0 );
0 commit comments