Mercurial > mm7
comparison Sprites.cpp @ 639:4f2837124c69
Decoration animations
author | Nomad |
---|---|
date | Mon, 11 Mar 2013 22:20:05 +0200 |
parents | 1bfe546561c4 |
children | 9824e2eeee30 |
comparison
equal
deleted
inserted
replaced
638:ccf8b4815a1f | 639:4f2837124c69 |
---|---|
324 } | 324 } |
325 v5->field_8 = -1; | 325 v5->field_8 = -1; |
326 } | 326 } |
327 | 327 |
328 //----- (0044D8D0) -------------------------------------------------------- | 328 //----- (0044D8D0) -------------------------------------------------------- |
329 SpriteFrame *SpriteFrameTable::GetFrame(unsigned int uSpriteID, unsigned int uFrameID) | 329 SpriteFrame *SpriteFrameTable::GetFrame(unsigned int uSpriteID, unsigned int uTime) |
330 { | 330 { |
331 SpriteFrame *v3; // edi@1 | 331 //SpriteFrame *v3; // edi@1 |
332 SpriteFrame *v4; // ecx@1 | 332 SpriteFrame *v4; // ecx@1 |
333 __int16 v5; // dx@2 | 333 //__int16 v5; // dx@2 |
334 int v6; // edx@3 | 334 //int v6; // edx@3 |
335 unsigned int v7; // eax@3 | 335 //unsigned int v7; // eax@3 |
336 char *i; // ecx@3 | 336 //char *i; // ecx@3 |
337 int v9; // esi@5 | 337 //int v9; // esi@5 |
338 SpriteFrame *result; // eax@6 | 338 //SpriteFrame *result; // eax@6 |
339 | 339 |
340 v3 = this->pSpriteSFrames; | 340 v4 = &pSpriteSFrames[uSpriteID]; |
341 v4 = &v3[uSpriteID]; | 341 if (~v4->uFlags & 1 || !v4->uAnimLength) |
342 if ( v4->uFlags & 1 && (v5 = v4->uAnimLength) != 0 ) | 342 return pSpriteSFrames + uSpriteID; |
343 { | 343 |
344 v6 = ((signed int)uFrameID >> 3) % v5; | 344 for (uint t = (uTime / 8) % v4->uAnimLength; t > v4->uAnimTime; ++v4) |
345 v7 = uSpriteID; | 345 t -= v4->uAnimTime; |
346 return v4; | |
347 | |
348 /*for (v4; v4->uAnimTime <= t; ++v4) | |
349 | |
350 v6 = (uTime / 8) % v4->uAnimLength; | |
351 //v7 = uSpriteID; | |
346 for ( i = (char *)&v4->uAnimTime; ; i += 60 ) | 352 for ( i = (char *)&v4->uAnimTime; ; i += 60 ) |
347 { | 353 { |
348 v9 = *(short *)i; | 354 v9 = *(short *)i; |
349 if ( v6 <= v9 ) | 355 if ( v6 <= v9 ) |
350 break; | 356 break; |
351 v6 -= v9; | 357 v6 -= v9; |
352 ++v7; | 358 ++v7; |
353 } | 359 } |
354 result = &v3[v7]; | 360 return &pSpriteSFrames[v7];*/ |
355 } | 361 |
356 else | |
357 { | |
358 result = &v3[uSpriteID]; | |
359 } | |
360 return result; | |
361 } | 362 } |
362 | 363 |
363 //----- (0044D91F) -------------------------------------------------------- | 364 //----- (0044D91F) -------------------------------------------------------- |
364 SpriteFrame *SpriteFrameTable::GetFrameBy_x(unsigned int uSpriteID, signed int a3) | 365 SpriteFrame *SpriteFrameTable::GetFrameBy_x(unsigned int uSpriteID, signed int a3) |
365 { | 366 { |