comparison mm7_4.cpp @ 1583:75fafd8ced59

Allocator (CMemory) bye-bye
author Nomad
date Tue, 10 Sep 2013 21:07:07 +0200
parents 9f8b3e904e14
children e42073046f92
comparison
equal deleted inserted replaced
1577:1b6217e07b26 1583:75fafd8ced59
22 #include "Outdoor.h" 22 #include "Outdoor.h"
23 #include "Outdoor_stuff.h" 23 #include "Outdoor_stuff.h"
24 #include "IndoorCamera.h" 24 #include "IndoorCamera.h"
25 #include "LOD.h" 25 #include "LOD.h"
26 #include "Actor.h" 26 #include "Actor.h"
27 #include "Allocator.h"
28 #include "Events.h" 27 #include "Events.h"
29 #include "Viewport.h" 28 #include "Viewport.h"
30 #include "FrameTableInc.h" 29 #include "FrameTableInc.h"
31 #include "Math.h" 30 #include "Math.h"
32 #include "SpriteObject.h" 31 #include "SpriteObject.h"
395 } 394 }
396 } 395 }
397 } 396 }
398 397
399 //----- (00487DA9) -------------------------------------------------------- 398 //----- (00487DA9) --------------------------------------------------------
400 void sub_487DA9() 399 void sub_487DA9()
401 { 400 {
402 for (int i = 0; i < 20000; ++i) 401 for (int i = 0; i < 20000; ++i)
403 array_77EC08[i].field_108 = 0; 402 array_77EC08[i].field_108 = 0;
404 }
405
406 //----- (00487DBE) --------------------------------------------------------
407 void Software_ResetNewEdges()
408 {
409 int v0; // ecx@1
410 Edge **v1; // eax@1
411 signed int v2; // eax@3
412
413 v0 = 0;
414 v1 = ptr_80CA10.data();
415 do
416 {
417 ++v0;
418 *((int *)&pNewEdges[v0] - 9) = (int)&defaultEdge;
419 *v1 = 0;
420 ++v1;
421 }
422 while ( (signed int)v1 < (signed int)&unk_80D190 );
423 v2 = 2000;
424 do
425 {
426 pSurfs->field_22 = 0;
427 --v2;
428 }
429 while ( v2 );
430 } 403 }
431 404
432 //----- (0048A959) -------------------------------------------------------- 405 //----- (0048A959) --------------------------------------------------------
433 unsigned int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace) 406 unsigned int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace)
434 { 407 {
1569 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0; 1542 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0;
1570 uNumFrames = num_mm6_frames + num_mm7_frames + num_mm8_frames; 1543 uNumFrames = num_mm6_frames + num_mm7_frames + num_mm8_frames;
1571 assert(uNumFrames); 1544 assert(uNumFrames);
1572 assert(!num_mm8_frames); 1545 assert(!num_mm8_frames);
1573 1546
1574 pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, uNumFrames * sizeof(PlayerFrame), "P Frames"); 1547 pFrames = (PlayerFrame *)malloc(uNumFrames * sizeof(PlayerFrame));
1575 memcpy(pFrames, (char *)data_mm7 + 4, num_mm7_frames * sizeof(PlayerFrame)); 1548 memcpy(pFrames, (char *)data_mm7 + 4, num_mm7_frames * sizeof(PlayerFrame));
1576 memcpy(pFrames + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(PlayerFrame)); 1549 memcpy(pFrames + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(PlayerFrame));
1577 memcpy(pFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(PlayerFrame)); 1550 memcpy(pFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(PlayerFrame));
1578 } 1551 }
1579 1552
1632 } 1605 }
1633 while ( fgets(&Buf, 490, File) ); 1606 while ( fgets(&Buf, 490, File) );
1634 v4 = v25; 1607 v4 = v25;
1635 } 1608 }
1636 v2->uNumFrames = v4; 1609 v2->uNumFrames = v4;
1637 v5 = pAllocator->AllocNamedChunk(v2->pFrames, 10 * v4, "P Frames"); 1610 v5 = malloc(10 * v4);
1638 v2->pFrames = (PlayerFrame *)v5; 1611 v2->pFrames = (PlayerFrame *)v5;
1639 if ( !v5 ) 1612 if ( !v5 )
1640 Error("PlayerFrameTable::load - Out of Memory!"); 1613 Error("PlayerFrameTable::load - Out of Memory!");
1641 v6 = File; 1614 v6 = File;
1642 v2->uNumFrames = 0; 1615 v2->uNumFrames = 0;