Mercurial > mm7
changeset 602:628694cd5744
Margaret working
author | zipi |
---|---|
date | Wed, 06 Mar 2013 23:26:46 +0000 |
parents | d59398528e4f |
children | 8724a4b3ca45 |
files | Actor.cpp Actor.h Events.cpp GUIWindow.cpp Player.cpp mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_data.cpp mm7_data.h |
diffstat | 12 files changed, 47 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/Actor.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -46,7 +46,7 @@ v3 = 0; if ( (signed int)uNumActors > 0 ) { - v4 = (int *)&pActors[0].uNPC_ID; + v4 = (int *)&pActors[0].sNPC_ID; while ( *(short *)v4 != npc ) { ++v3; @@ -147,7 +147,7 @@ void Actor::InitializeDialogue(int bPlayerSaysHello) { Actor *v2; // esi@1 - unsigned int v3; // ecx@1 + signed int v3; // ecx@1 NPCData *v4; // eax@1 NPCData *v5; // ebp@1 unsigned int v6; // eax@1 @@ -173,8 +173,8 @@ pMiscTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); uDialogueType = 0; - v3 = v2->uNPC_ID; - uDialogue_SpeakingActorNPC_ID = v2->uNPC_ID; + v3 = v2->sNPC_ID; + sDialogue_SpeakingActorNPC_ID = v2->sNPC_ID; pDialogue_SpeakingActor = v2; v4 = GetNPCData(v3); v5 = v4; @@ -247,7 +247,7 @@ } } } - if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) != 0 ) + if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) != 0 ) v9 = 4; v11 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)10, v9, 0); pDialogueWindow = v11; @@ -3895,7 +3895,7 @@ { this->pActorName[0] = 0; this->word_000086_some_monster_id = 0; - this->uNPC_ID = 0; + this->sNPC_ID = 0; this->vPosition.z = 0; this->vPosition.y = 0; this->vPosition.x = 0;
--- a/Actor.h Thu Mar 07 01:07:45 2013 +0400 +++ b/Actor.h Wed Mar 06 23:26:46 2013 +0000 @@ -238,7 +238,7 @@ char pActorName[32]; - unsigned __int16 uNPC_ID; + signed __int16 sNPC_ID; __int16 field_22; unsigned int uAttributes; __int16 sCurrentHP;
--- a/Events.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/Events.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -531,7 +531,7 @@ //Actor::Actor(&Dst); memset(&Dst, 0, 0x344u); dword_5B65D0_dialogue_actor_npc_id = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); - Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id; + Dst.sNPC_ID = dword_5B65D0_dialogue_actor_npc_id; Dst.InitializeDialogue(0); } else
--- a/GUIWindow.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/GUIWindow.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -1796,8 +1796,8 @@ { num_menu_buttons = 0; v11 = LOBYTE(pFontArrus->uFontHeight) - 3; - speakingNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); - if ( sub_445C8B(uDialogue_SpeakingActorNPC_ID) == 1 ) + speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); + if ( sub_445C8B(sDialogue_SpeakingActorNPC_ID) == 1 ) { if ( speakingNPC->joins ) {
--- a/Player.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/Player.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -9386,7 +9386,7 @@ { case 232: VarNum = (VariableType)0; - GetNewNPCData(uDialogue_SpeakingActorNPC_ID, (int)&VarNum); + GetNewNPCData(sDialogue_SpeakingActorNPC_ID, (int)&VarNum); result = (bool) pValue; dword_5B65CC = 0; if ( (int)VarNum == pValue )
--- a/mm7_1.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_1.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -2831,7 +2831,7 @@ v3 = &pActors[v2]; v121 = v3; v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); - v5 = v3->uNPC_ID; + v5 = v3->sNPC_ID; a5 = v4; v6 = GetNPCData(v5); v7 = v3->pMonsterInfo.uID; @@ -3046,7 +3046,7 @@ if ( v36 >= 0 ) pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); } - if ( v121->uNPC_ID ) + if ( v121->sNPC_ID ) { v37 = v112[6]; if ( v37 ) @@ -3068,7 +3068,7 @@ else v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; } - if(!v121->uNPC_ID || (v121->uNPC_ID && !v37)) + if(!v121->sNPC_ID || (v121->sNPC_ID && !v37)) strncpy(pTmpBuf, v72, v77); v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); @@ -5314,7 +5314,7 @@ return; v18 = a2.y; Actor::FaceObject(a2.y, 4u, 0, 0); - if ( !v17->uNPC_ID ) + if ( !v17->sNPC_ID ) { v19 = pNPCStats->pGroups_copy[v17->uGroup]; if ( v19 )
--- a/mm7_2.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_2.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -3172,7 +3172,7 @@ ++pMessageQueue_50CBD0->uNumMessages; }*/ dword_50C9DC = 195; - ptr_50C9E0 = GetNPCData(uDialogue_SpeakingActorNPC_ID); + ptr_50C9E0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); return 0; } if ( a1 == 42 ) @@ -11323,30 +11323,30 @@ v4 = (v3 - 1) % 3; if ( 2 == v4 ) { - if ( pActor->uNPC_ID && pActor->uNPC_ID < 5000 ) + if ( pActor->sNPC_ID && pActor->sNPC_ID < 5000 ) continue; } else { if ( v4 != 1 ) { - if ( v4 != 0 || pActor->uNPC_ID ) + if ( v4 != 0 || pActor->sNPC_ID ) continue; goto LABEL_12; } } - if ( pActor->uNPC_ID > 0 && pActor->uNPC_ID < 5000 ) + if ( pActor->sNPC_ID > 0 && pActor->sNPC_ID < 5000 ) continue; if ( v17 ) { pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], v3, 0, v19); v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000; ++pNPCStats->uNewlNPCBufPos; - pActor->uNPC_ID = v14; + pActor->sNPC_ID = v14; continue; } LABEL_12: - pActor->uNPC_ID = 0; + pActor->sNPC_ID = 0; //LABEL_13: //++v15; //v2 += 836; @@ -15453,7 +15453,7 @@ if ( !v13->GetActorsRelation(0) && !(BYTE2(v13->uAttributes) & 8) && v13->CanAct() ) { Actor::FaceObject(v12, 4u, 0, 0); - if ( v13->uNPC_ID ) + if ( v13->sNPC_ID ) { pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v12, 0); /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
--- a/mm7_3.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_3.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -14122,8 +14122,8 @@ if ( !pDialogueWindow ) return; memcpy(&v51, pDialogueWindow, sizeof(v51)); - pNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); - v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID); + pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); + v1 = sub_445C8B(sDialogue_SpeakingActorNPC_ID); v51.uFrameWidth -= 10; v51.uFrameZ -= 10; //v54 = v1; @@ -14423,7 +14423,7 @@ } //----- (004459F9) -------------------------------------------------------- -NPCData *__fastcall GetNPCData(unsigned int npcid) +NPCData *__fastcall GetNPCData(signed int npcid) { unsigned int v1; // esi@1 NPCData *result; // eax@5 @@ -14460,13 +14460,13 @@ } if ( (signed int)npcid >= 5000 ) return &pNPCStats->array_13EF4[npcid - 5000]; - if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) + if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) { result = 0; } else { - v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1; + v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1; v4 = 0; v5 = 0; v6 = pParty->pHirelings; @@ -14518,16 +14518,16 @@ if ( npcid >= 5000 ) return &pNPCStats->pAdditionalNPC[npcid - 5000]; - if (uDialogue_SpeakingActorNPC_ID >= 0) + if (sDialogue_SpeakingActorNPC_ID >= 0) { result = 0; } else { - v3 = uDialogue_SpeakingActorNPC_ID - 1; + v3 = abs(sDialogue_SpeakingActorNPC_ID) - 1; v4 = 0; - for (i = 0; i < 4; ++i) + for (i = 0; i < 2; ++i) { if (pParty->pHirelings[i].pName) pTmpBuf[v4++] = i; @@ -14597,14 +14597,14 @@ } if ( npcid >= 5000 ) goto LABEL_7; - if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) + if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) { *(int *)a2 = 0; result = 0; } else { - v5 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1; + v5 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1; v6 = 0; v7 = 0; v8 = pParty->pHirelings; @@ -14671,7 +14671,7 @@ } if ( a1 >= 5000 ) return 2; - v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1; + v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1; v4 = 0; v5 = 0; v6 = pParty->pHirelings; @@ -14706,7 +14706,7 @@ //----- (0044603D) -------------------------------------------------------- void __cdecl sub_44603D() { - uDialogue_SpeakingActorNPC_ID = 0; + sDialogue_SpeakingActorNPC_ID = 0; pDialogueWindow->Release(); pDialogueWindow = 0; pMiscTimer->Resume();
--- a/mm7_4.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_4.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -4904,7 +4904,7 @@ npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; } else - npc = GetNPCData(uDialogue_SpeakingActorNPC_ID); + npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); //v65 = v9; //v10 = 0; //v64 = 0; @@ -10589,7 +10589,7 @@ //GUIWindow *v2; // ecx@1 __debugbreak(); - v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID); + v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); v1 = 0; pDialogueWindow->eWindowType = WINDOW_MainMenu; pDialogueWindow->Release(); @@ -11943,7 +11943,7 @@ const char *v15; // [sp-4h] [bp-14h]@60 //v1 = _this; - speakingNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); + speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); //v3 = v1; uDialogueType = newDialogueType; if ( !speakingNPC->uFlags ) @@ -12050,7 +12050,7 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); - if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) + if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) pDialogue_SpeakingActor->uAIState = Removed; if ( uActiveCharacter ) pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0);
--- a/mm7_5.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_5.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -299,7 +299,7 @@ //Actor::Actor(&actor); memset(&actor, 0, 0x344u); dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID; - actor.uNPC_ID = bDialogueUI_InitializeActor_NPC_ID; + actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID; actor.InitializeDialogue(0); bDialogueUI_InitializeActor_NPC_ID = 0; } @@ -329,7 +329,7 @@ viewparams->field_48 = v0; if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].uNPC_ID; + dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID; pActor = &pActors[uMessageParam]; //goto _actor_init_dlg; pActor->InitializeDialogue(v0); @@ -383,7 +383,7 @@ { //Actor::Actor(&actor); memset(&actor, 0, 0x344u); - actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx; + actor.sNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx; pActor = &actor; pActor->InitializeDialogue(v0); } @@ -15811,8 +15811,8 @@ } if ( (signed int)((char *)v17 + (unsigned __int8)pParty->field_709) < v1 ) { - uDialogue_SpeakingActorNPC_ID = -1 - (unsigned __int8)pParty->field_709 - (int)v17; - v5 = GetNewNPCData(uDialogue_SpeakingActorNPC_ID, (int)&a2); + sDialogue_SpeakingActorNPC_ID = -1 - (unsigned __int8)pParty->field_709 - (int)v17; + v5 = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, (int)&a2); v6 = v5; if ( v5 ) {
--- a/mm7_data.cpp Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_data.cpp Wed Mar 06 23:26:46 2013 +0000 @@ -2005,7 +2005,7 @@ int dword_591084; // weak struct Actor *pDialogue_SpeakingActor; unsigned int uDialogueType; -unsigned int uDialogue_SpeakingActorNPC_ID; +signed int sDialogue_SpeakingActorNPC_ID; struct LevelDecoration *_591094_decoration; char sHouseName[200]; // idb int uCurrentHouse_Animation; // weak @@ -2039,7 +2039,7 @@ int dword_5B65C4; // weak int dword_5B65C8_timers_count; // weak int dword_5B65CC; // weak -int dword_5B65D0_dialogue_actor_npc_id; // weak +signed int dword_5B65D0_dialogue_actor_npc_id; // weak int dword_5C3418; // weak int dword_5C341C; // weak int _5C3420_pDecoration;
--- a/mm7_data.h Thu Mar 07 01:07:45 2013 +0400 +++ b/mm7_data.h Wed Mar 06 23:26:46 2013 +0000 @@ -1320,7 +1320,7 @@ extern int dword_591084; // weak extern struct Actor *pDialogue_SpeakingActor; extern unsigned int uDialogueType; -extern unsigned int uDialogue_SpeakingActorNPC_ID; +extern signed int sDialogue_SpeakingActorNPC_ID; extern struct LevelDecoration *_591094_decoration; extern char sHouseName[200]; // idb extern int uCurrentHouse_Animation; // weak @@ -2020,7 +2020,7 @@ void __cdecl sub_4452BB(); const char *GetProfessionActionText(int a1); void __cdecl DrawDialogueUI(); -struct NPCData *__fastcall GetNPCData(unsigned int npcid); +struct NPCData *__fastcall GetNPCData(signed int npcid); struct NPCData *__fastcall GetNewNPCData(signed int npcid, int a2); int __fastcall sub_445C8B(signed int a1); void __cdecl sub_44603D();