Mercurial > mm7
comparison UIHouses.cpp @ 1235:7da06d00ad25
Слияние
author | Ritor1 |
---|---|
date | Sun, 09 Jun 2013 21:10:32 +0600 |
parents | fd3bea473c0c |
children | b237a61e61d3 |
comparison
equal
deleted
inserted
replaced
1234:6c55c6bd67e0 | 1235:7da06d00ad25 |
---|---|
334 //unsigned int v9; // eax@16 | 334 //unsigned int v9; // eax@16 |
335 //unsigned int v10; // eax@19 | 335 //unsigned int v10; // eax@19 |
336 //int v11; // ecx@19 | 336 //int v11; // ecx@19 |
337 //char pContainer[36]; // [sp+Ch] [bp-54h]@16 | 337 //char pContainer[36]; // [sp+Ch] [bp-54h]@16 |
338 int v13; // [sp+30h] [bp-30h]@11 | 338 int v13; // [sp+30h] [bp-30h]@11 |
339 int Dst[6]; // [sp+34h] [bp-2Ch]@1 | 339 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1 |
340 //unsigned int v15; // [sp+4Ch] [bp-14h]@1 | 340 //unsigned int v15; // [sp+4Ch] [bp-14h]@1 |
341 int uAnimationID; // [sp+50h] [bp-10h]@1 | 341 int uAnimationID; // [sp+50h] [bp-10h]@1 |
342 //unsigned int *v17; // [sp+54h] [bp-Ch]@3 | 342 //unsigned int *v17; // [sp+54h] [bp-Ch]@3 |
343 //unsigned int v18; // [sp+58h] [bp-8h]@1 | 343 //unsigned int v18; // [sp+58h] [bp-8h]@1 |
344 //int v19; // [sp+5Ch] [bp-4h]@7 | 344 //int v19; // [sp+5Ch] [bp-4h]@7 |
345 | 345 |
346 //v15 = uHouseID; | 346 |
347 //v1 = 52 * uHouseID; | |
348 //uAnimationID = p2DEvents_minus1___02[26 * uHouseID]; | |
349 uAnimationID = p2DEvents[house - 1].uAnimationID; | 347 uAnimationID = p2DEvents[house - 1].uAnimationID; |
350 //v18 = 52 * uHouseID; | 348 memset(npc_id_arr, 0, sizeof(npc_id_arr)); |
351 memset(Dst, 0, 0x18u); | |
352 //uExitPic = *(__int16 *)((char *)p2DEvents_minus1_::2C + v1); | |
353 //uExitPic = p2DEvents[uHouseID - 1].uExitPicID; | |
354 uNumDialogueNPCPortraits = 0; | 349 uNumDialogueNPCPortraits = 0; |
355 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID; | 350 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID; |
356 if ( uHouse_ExitPic ) | 351 if ( uHouse_ExitPic ) |
357 { | 352 { |
358 //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1); | |
359 uExitMapID = p2DEvents[house - 1]._quest_related; | 353 uExitMapID = p2DEvents[house - 1]._quest_related; |
360 if ( uExitMapID > 0 ) | 354 if ( uExitMapID > 0 ) |
361 { | 355 { |
362 //v17 = (unsigned int *)(uExitMapID - 1); | |
363 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID)) | 356 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID)) |
364 // if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) ) | 357 { |
365 { | |
366 //uExitPic = 0; | |
367 uHouse_ExitPic = 0; | 358 uHouse_ExitPic = 0; |
368 } | 359 } |
369 } | 360 } |
370 } | 361 } |
371 | 362 |
372 dword_591080 = pAnimatedRooms[uAnimationID].field_8; | 363 dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id; |
373 //result = dword_591080; | 364 HouseNPCData[0]=0; |
374 | |
375 //v2 = 0; | |
376 uNumDialogueNPCPortraits = 0; | 365 uNumDialogueNPCPortraits = 0; |
377 if ( dword_591080 ) | 366 if ( dword_591080 ) |
378 { | 367 { |
379 //v2 = 1; | 368 |
380 Dst[0] = dword_591080; | 369 npc_id_arr[0] = dword_591080; |
381 uNumDialogueNPCPortraits = 1; | 370 uNumDialogueNPCPortraits = 1; |
382 } | 371 } |
383 | 372 |
384 //v19 = 1; | 373 for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i) |
385 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
386 { | 374 { |
387 auto npc = pNPCStats->pNewNPCData + i; | 375 if (pNPCStats->pNewNPCData[i].Location2D == house ) |
388 //v6 = &pNPCStats->pNewNPCData[1].uFlags; | 376 { |
389 //v17 = &pNPCStats->pNewNPCData[1].uFlags; | 377 if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80)) |
390 //do | 378 { |
391 //{ | 379 |
392 if (npc->Location2D == house ) | 380 HouseNPCData[uNumDialogueNPCPortraits+1- (dword_591080 != 0) ? 1 : 0] = &pNPCStats->pNewNPCData[i]; |
393 { | 381 npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID; |
394 if (~npc->uFlags & 0x80) | 382 ++uNumDialogueNPCPortraits; |
395 //if ( !(*(char *)v6 & 0x80) ) | 383 if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2) |
396 { | 384 ++pNPCStats->pNewNPCData[i].uFlags; |
397 v7 = uNumDialogueNPCPortraits++ - (dword_591080 != 0) ? 1 : 0; | 385 } |
398 HouseNPCData[v7] = npc; | 386 } |
399 //v6 = v17; | 387 |
400 //*(&v13 + v2) = *(v17 - 1); | |
401 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; | |
402 //v1 = v18; | |
403 if ((npc->uFlags & 3) != 2) | |
404 ++npc->uFlags; | |
405 } | |
406 } | |
407 //++v19; | |
408 //v6 += 19; | |
409 //v17 = v6; | |
410 //} | |
411 //while ( v19 < (signed int)pNPCStats->uNumNewNPCs ); | |
412 } | 388 } |
413 //uNumDialogueNPCPortraits = v2; | 389 |
414 | |
415 //v19 = 0; | |
416 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i) | 390 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i) |
417 //if ( v2 > 0 ) | |
418 { | 391 { |
419 //do | 392 |
420 //{ | |
421 //v8 = v19; | |
422 char icon_name[128]; | 393 char icon_name[128]; |
423 sprintfex(icon_name, "npc%03u", Dst[i]); | 394 sprintfex(icon_name, "npc%03u", npc_id_arr[i]); |
424 //v9 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
425 //++v19; | |
426 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE); | 395 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE); |
427 //result = v19; | |
428 //} | |
429 //while ( v19 < uNumDialogueNPCPortraits ); | |
430 //uExitPic = uHouse_ExitPic; | |
431 } | 396 } |
432 | 397 |
433 if (uHouse_ExitPic) | 398 if (uHouse_ExitPic) |
434 { | 399 { |
435 //v10 = pIcons_LOD->LoadTexture(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE); | 400 pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE); |
436 //v11 = uNumDialogueNPCPortraits++; | 401 ++uNumDialogueNPCPortraits; |
437 pDialogueNPCPortraits[uNumDialogueNPCPortraits++] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE); | |
438 //result = *(__int16 *)((char *)p2DEvents_minus1_::2E + v1); | |
439 //result = p2DEvents[house - 1].uExitMapID; | |
440 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID; | 402 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID; |
441 } | 403 } |
442 //return result; | |
443 } | 404 } |
444 | 405 |
445 | 406 |
446 //----- (0044622E) -------------------------------------------------------- | 407 //----- (0044622E) -------------------------------------------------------- |
447 bool EnterHouse(enum HOUSE_ID uHouseID) | 408 bool EnterHouse(enum HOUSE_ID uHouseID) |