comparison mm7_4.cpp @ 1603:c58916c53d8e

Merge
author Grumpy7
date Thu, 12 Sep 2013 09:58:07 +0200
parents a52a01aaf439 e42073046f92
children 61ea994a1812
comparison
equal deleted inserted replaced
1602:96a1f5e0b6cd 1603:c58916c53d8e
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;
3374 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); 3347 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1);
3375 } 3348 }
3376 3349
3377 3350
3378 //----- (004B3FE5) -------------------------------------------------------- 3351 //----- (004B3FE5) --------------------------------------------------------
3379 void __fastcall sub_4B3FE5(int a4) 3352 void __fastcall _4B3FE5_training_dialogue(int a4)
3380 { 3353 {
3381 int v1; // edi@1 3354 int v1; // edi@1
3382 char *v2; // edi@1 3355 char *v2; // edi@1
3383 3356
3384 __debugbreak(); 3357 __debugbreak();
3610 case DIALOGUE_22: npc_event_id = speakingNPC->evt_D; break; 3583 case DIALOGUE_22: npc_event_id = speakingNPC->evt_D; break;
3611 case DIALOGUE_23: npc_event_id = speakingNPC->evt_E; break; 3584 case DIALOGUE_23: npc_event_id = speakingNPC->evt_E; break;
3612 case DIALOGUE_24: npc_event_id = speakingNPC->evt_F; break; 3585 case DIALOGUE_24: npc_event_id = speakingNPC->evt_F; break;
3613 } 3586 }
3614 if ( (npc_event_id >= 200) && (npc_event_id <= 310) ) 3587 if ( (npc_event_id >= 200) && (npc_event_id <= 310) )
3615 sub_4B3FE5(npc_event_id); //200-310 3588 _4B3FE5_training_dialogue(npc_event_id); //200-310
3616 else if (( npc_event_id >= 400) && (npc_event_id <= 410) ) 3589 else if (( npc_event_id >= 400) && (npc_event_id <= 410) )
3617 { //400-410 3590 { //400-410
3618 dword_F8B1D8 = newDialogueType; 3591 dword_F8B1D8 = newDialogueType;
3619 DrawJoinGuildWindow(npc_event_id - 400); 3592 DrawJoinGuildWindow(npc_event_id - 400);
3620 } 3593 }