# HG changeset patch # User Nomad # Date 1362751609 -7200 # Node ID 5cfb5dadf330044bc7561800cbe4f1a482b201d3 # Parent f2697c2b410945c9ed0b56617cb378732d8da38f Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs diff -r f2697c2b4109 -r 5cfb5dadf330 Indoor.cpp --- a/Indoor.cpp Fri Mar 08 15:52:47 2013 +0200 +++ b/Indoor.cpp Fri Mar 08 16:06:49 2013 +0200 @@ -1233,7 +1233,7 @@ } //----- (004B0EA8) -------------------------------------------------------- -void BspRenderer::PrepareFaceRenderList_d3d(int a2, unsigned int uFaceID) +void BspRenderer::AddFaceToRenderList_d3d(int a2, unsigned int uFaceID) { //unsigned int v3; // edx@1 //stru170 *v4; // ebx@1 @@ -1384,14 +1384,14 @@ } else { - static RenderVertexSoft static_subPrepareFaceRenderList_d3d_stru_F7AA08[64]; - static RenderVertexSoft static_subPrepareFaceRenderList_d3d_stru_F79E08[64]; + static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F7AA08[64]; + static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F79E08[64]; //v23 = 0; a2 = pFace->uNumVertices; for (uint k = 0; k < pFace->uNumVertices; ++k) { - //v24 = (char *)&static_subPrepareFaceRenderList_d3d_stru_F7AA08[0].vWorldPosition.z; + //v24 = (char *)&static_subAddFaceToRenderList_d3d_stru_F7AA08[0].vWorldPosition.z; //do //{ //v25 = pFace->pVertexIDs[k]; @@ -1400,24 +1400,24 @@ //v27 = (double)v26->z; //v28 = v26->y; //v17 = v39; - static_subPrepareFaceRenderList_d3d_stru_F7AA08[k].vWorldPosition.x = pVertex->x; - static_subPrepareFaceRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pVertex->y; - static_subPrepareFaceRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pVertex->z; + static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.x = pVertex->x; + static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pVertex->y; + static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pVertex->z; //v24 += 48; //} //while ( v23 < a2 ); } pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum( - static_subPrepareFaceRenderList_d3d_stru_F7AA08, + static_subAddFaceToRenderList_d3d_stru_F7AA08, (unsigned int *)&a2, - static_subPrepareFaceRenderList_d3d_stru_F79E08, + static_subAddFaceToRenderList_d3d_stru_F79E08, p->std__vector_0007AC, 4, 0, 0); v29 = pGame->pStru10Instance->_49C5DA( pFace, - static_subPrepareFaceRenderList_d3d_stru_F79E08, + static_subAddFaceToRenderList_d3d_stru_F79E08, &a2, field_FA8[std__vector_000FA8].std__vector_0007AC, field_FA8[std__vector_000FA8].pVertices); @@ -1451,7 +1451,7 @@ //----- (004AFB86) -------------------------------------------------------- -void BspRenderer::PrepareFaceRenderList_sw(int a2, unsigned int uFaceID) +void BspRenderer::AddFaceToRenderList_sw(int a2, unsigned int uFaceID) { BspRenderer *v3; // ebx@1 BLVFace *v4; // eax@1 @@ -3198,7 +3198,7 @@ if (pSector->pBounding.y1 <= sY && pSector->pBounding.y2 >= sY) if (pSector->pBounding.z1 - 64 <= sZ && pSector->pBounding.z2 + 64 >= sZ) { - Log::Warning(L"Sector[%u]", i); + //Log::Warning(L"Sector[%u]", i); v51 = pSector->uNumFloors + pSector->uNumPortals; if (!v51) continue; diff -r f2697c2b4109 -r 5cfb5dadf330 Indoor_stuff.h --- a/Indoor_stuff.h Fri Mar 08 15:52:47 2013 +0200 +++ b/Indoor_stuff.h Fri Mar 08 16:06:49 2013 +0200 @@ -79,8 +79,8 @@ uNumVisibleNotEmptySectors = 0; } - void PrepareFaceRenderList_sw(int a2, unsigned int uFaceID); - void PrepareFaceRenderList_d3d(signed int a2, unsigned int uFaceID); + void AddFaceToRenderList_sw(int a2, unsigned int uFaceID); + void AddFaceToRenderList_d3d(signed int a2, unsigned int uFaceID); void MakeVisibleSectorList(); void DrawFaceOutlines(); diff -r f2697c2b4109 -r 5cfb5dadf330 NPC.h --- a/NPC.h Fri Mar 08 15:52:47 2013 +0200 +++ b/NPC.h Fri Mar 08 16:06:49 2013 +0200 @@ -202,6 +202,10 @@ #pragma pack(push, 1) struct NPCProfession { + inline NPCProfession(): + uHirePrice(0), pBenefits(nullptr), pActionText(nullptr), pJoinText(nullptr), pDismissText(nullptr) + {} + unsigned int uHirePrice; char *pBenefits; char *pActionText; diff -r f2697c2b4109 -r 5cfb5dadf330 Vis.cpp --- a/Vis.cpp Fri Mar 08 15:52:47 2013 +0200 +++ b/Vis.cpp Fri Mar 08 16:06:49 2013 +0200 @@ -343,6 +343,7 @@ int v17; // [sp+48h] [bp-8h]@1 Vis *thisa; // [sp+4Ch] [bp-4h]@1 + __debugbreak(); // refactor for BLV picking v5 = 0; diff -r f2697c2b4109 -r 5cfb5dadf330 mm7_3.cpp --- a/mm7_3.cpp Fri Mar 08 15:52:47 2013 +0200 +++ b/mm7_3.cpp Fri Mar 08 16:06:49 2013 +0200 @@ -1766,14 +1766,12 @@ switch ( pPartyActionQueue->Next() ) { case PARTY_TurnLeft: - __debugbreak(); v12 = uTurnSpeed; if ( uTurnSpeed ) goto LABEL_58; v13 = (double)v82 * fTurnSpeedMultiplier; goto LABEL_51; case PARTY_TurnRight: - __debugbreak(); LODWORD(v15) = uTurnSpeed; if ( uTurnSpeed ) goto LABEL_56; @@ -1842,12 +1840,10 @@ v26 = stru_5C6E00->Cos(angle); v27 = (double)v81; //v88 = v27; - v78 = (unsigned __int64)(v26 - * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; + v78 = (unsigned __int64)(v26 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; v2 -= v78; v28 = stru_5C6E00->Sin(angle); - v78 = (unsigned __int64)(v28 - * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; + v78 = (unsigned __int64)(v28 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; LABEL_68: v1 -= v78; LABEL_64: @@ -1873,7 +1869,6 @@ v72 = 1; goto LABEL_87; case PARTY_LookUp: - __debugbreak(); _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); if ( _view_angle > 128 ) _view_angle = 128; @@ -1884,7 +1879,6 @@ v63 = SPEECH_63; goto LABEL_76; case PARTY_LookDown: - __debugbreak(); _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0); if ( _view_angle < -128 ) _view_angle = -128; @@ -1898,11 +1892,9 @@ } break; case PARTY_CenterView: - __debugbreak(); _view_angle = 0; break; case PARTY_Jump: - __debugbreak(); if ( (!bJumping || party_z <= v80 + 6 && v89 <= 0) && pParty->field_24 ) { bJumping = 1; @@ -11529,22 +11521,16 @@ v3 = &pIndoor->pSectors[pBspRenderer->field_FA8[a1].uSectorID]; if ( pRenderer->pRenderD3D ) { - if ( v3->uNumNonBSPFaces > 0 ) - { - do - { - Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); - pBspRenderer->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]); - } - while ( v2 < v3->uNumNonBSPFaces ); - } + for (uint i = 0; i < v3->uNumNonBSPFaces; ++i) + //Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); + pBspRenderer->AddFaceToRenderList_d3d(v1, v3->pFaceIDs[i]); } else { if ( v3->uNumNonBSPFaces > 0 ) { do - pBspRenderer->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]); + pBspRenderer->AddFaceToRenderList_sw(v1, v3->pFaceIDs[v2++]); while ( v2 < v3->uNumNonBSPFaces ); } } @@ -11567,7 +11553,7 @@ bool v11; // [sp+14h] [bp-8h]@5 BspRenderer_stru0 *v12; // [sp+18h] [bp-4h]@1 - Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode); + //Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode); v10 = a1; v12 = &pBspRenderer->field_FA8[a1]; @@ -11592,17 +11578,17 @@ v7 = v3->uCoplanarOffset; v8 = v7 + v3->uCoplanarSize; - Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]); + //Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]); if ( pRenderer->pRenderD3D ) { while ( v7 < v8 ) - pBspRenderer->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]); + pBspRenderer->AddFaceToRenderList_d3d(v10, v2->pFaceIDs[v7++]); } else { while ( v7 < v8 ) - pBspRenderer->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]); + pBspRenderer->AddFaceToRenderList_sw(v10, v2->pFaceIDs[v7++]); } v9 = v11 ? v3->uFront : v3->uBack; if ( v9 == -1 ) diff -r f2697c2b4109 -r 5cfb5dadf330 mm7_5.cpp --- a/mm7_5.cpp Fri Mar 08 15:52:47 2013 +0200 +++ b/mm7_5.cpp Fri Mar 08 16:06:49 2013 +0200 @@ -15817,7 +15817,7 @@ if ( v5 ) { if ( a2 == 57 ) - v7 = pNPCTopics[512].pText; + v7 = pNPCTopics[512].pText; // Baby dragon else v7 = (const CHAR *)pNPCStats->pProfessions[v5->uProfession].pBenefits; lpsz = v7;