Mercurial > mm7
comparison Sprites.cpp @ 1554:e303d8a9bcdc
Merge
author | Grumpy7 |
---|---|
date | Sat, 07 Sep 2013 21:14:48 +0200 |
parents | 9a6567c6c76c |
children | 75fafd8ced59 |
comparison
equal
deleted
inserted
replaced
1553:b98812ead5d9 | 1554:e303d8a9bcdc |
---|---|
349 | 349 |
350 v1 = this; | 350 v1 = this; |
351 v2 = fopen("data\\dsft.bin", "wb"); | 351 v2 = fopen("data\\dsft.bin", "wb"); |
352 v3 = v2; | 352 v3 = v2; |
353 if ( !v2 ) | 353 if ( !v2 ) |
354 Abortf("Unable to save dsft.bin!"); | 354 Error("Unable to save dsft.bin!"); |
355 fwrite(v1, 4u, 1u, v2); | 355 fwrite(v1, 4u, 1u, v2); |
356 fwrite(&v1->uNumEFrames, 4u, 1u, v3); | 356 fwrite(&v1->uNumEFrames, 4u, 1u, v3); |
357 fwrite(v1->pSpriteSFrames, 0x3Cu, v1->uNumSpriteFrames, v3); | 357 fwrite(v1->pSpriteSFrames, 0x3Cu, v1->uNumSpriteFrames, v3); |
358 fwrite(v1->pSpriteEFrames, 2u, v1->uNumEFrames, v3); | 358 fwrite(v1->pSpriteEFrames, 2u, v1->uNumEFrames, v3); |
359 fclose(v3); | 359 fclose(v3); |
403 { | 403 { |
404 memcpy(pSpriteSFrames + num_mm7_frames + i, (char *)data_mm6 + 8 + i * sizeof(SpriteFrame_mm6), sizeof(SpriteFrame_mm6)); | 404 memcpy(pSpriteSFrames + num_mm7_frames + i, (char *)data_mm6 + 8 + i * sizeof(SpriteFrame_mm6), sizeof(SpriteFrame_mm6)); |
405 pSpriteSFrames[num_mm7_frames + i].uAnimLength = 0; | 405 pSpriteSFrames[num_mm7_frames + i].uAnimLength = 0; |
406 } | 406 } |
407 memcpy(pSpriteEFrames + num_mm7_frames, (char *)data_mm6 + 8 + mm6_frames_size, 2 * num_mm6_eframes); | 407 memcpy(pSpriteEFrames + num_mm7_frames, (char *)data_mm6 + 8 + mm6_frames_size, 2 * num_mm6_eframes); |
408 | 408 |
409 if (data_mm8) __debugbreak(); | |
410 auto mm8_frames_size = num_mm8_frames * sizeof(SpriteFrame); | 409 auto mm8_frames_size = num_mm8_frames * sizeof(SpriteFrame); |
411 memcpy(pSpriteSFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8, mm8_frames_size); | 410 memcpy(pSpriteSFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8, mm8_frames_size); |
412 memcpy(pSpriteEFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8 + mm8_frames_size, 2 * num_mm8_eframes); | 411 memcpy(pSpriteEFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8 + mm8_frames_size, 2 * num_mm8_eframes); |
413 | 412 |
414 for (uint i = 0; i < num_mm7_frames; ++i) | 413 for (uint i = 0; i < num_mm7_frames; ++i) |
477 v2 = this; | 476 v2 = this; |
478 ReleaseSFrames(); | 477 ReleaseSFrames(); |
479 v3 = fopen(Args, "r"); | 478 v3 = fopen(Args, "r"); |
480 File = v3; | 479 File = v3; |
481 if ( !v3 ) | 480 if ( !v3 ) |
482 Abortf("CSpriteFrameTable::load - Unable to open file: %s.", Args); | 481 Error("CSpriteFrameTable::load - Unable to open file: %s.", Args); |
482 | |
483 v4 = 0; | 483 v4 = 0; |
484 Argsa = 0; | 484 Argsa = 0; |
485 if ( fgets(Buf, 490, v3) ) | 485 if ( fgets(Buf, 490, v3) ) |
486 { | 486 { |
487 do | 487 do |
777 if ( stru_721530.sMinZ >= v11 ) | 777 if ( stru_721530.sMinZ >= v11 ) |
778 { | 778 { |
779 v12 = v8 - stru_721530.normal.x; | 779 v12 = v8 - stru_721530.normal.x; |
780 v19 = v9 - stru_721530.normal.y; | 780 v19 = v9 - stru_721530.normal.y; |
781 v13 = stru_721530.prolly_normal_d + v7; | 781 v13 = stru_721530.prolly_normal_d + v7; |
782 v21 = ((v8 - stru_721530.normal.x) * stru_721530.field_58.y | 782 v21 = ((v8 - stru_721530.normal.x) * stru_721530.direction.y |
783 - (v9 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16; | 783 - (v9 - stru_721530.normal.y) * stru_721530.direction.x) >> 16; |
784 if ( abs(v21) <= stru_721530.prolly_normal_d + v7 ) | 784 if ( abs(v21) <= stru_721530.prolly_normal_d + v7 ) |
785 { | 785 { |
786 v14 = (v12 * stru_721530.field_58.x + v19 * stru_721530.field_58.y) >> 16; | 786 v14 = (v12 * stru_721530.direction.x + v19 * stru_721530.direction.y) >> 16; |
787 if ( v14 > 0 ) | 787 if ( v14 > 0 ) |
788 { | 788 { |
789 v15 = v5->vPosition.z; | 789 v15 = v5->vPosition.z; |
790 v16 = stru_721530.normal.z | 790 v16 = stru_721530.normal.z |
791 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v14) >> 16); | 791 + ((unsigned __int64)(stru_721530.direction.z * (signed __int64)v14) >> 16); |
792 if ( v16 >= v15 ) | 792 if ( v16 >= v15 ) |
793 { | 793 { |
794 if ( v16 <= v22 + v15 ) | 794 if ( v16 <= v22 + v15 ) |
795 { | 795 { |
796 v17 = v14 - integer_sqrt(v13 * v13 - v21 * v21); | 796 v17 = v14 - integer_sqrt(v13 * v13 - v21 * v21); |