changeset 188:27bdff4ed3e6

Слияние
author Ritor1
date Thu, 20 Dec 2012 20:35:47 +0600
parents 4436fa701162 (current diff) 0a0eb74e8e95 (diff)
children cdb5d83a9fd8
files VideoPlayer.cpp
diffstat 5 files changed, 172 insertions(+), 173 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Thu Dec 20 20:35:33 2012 +0600
+++ b/Player.cpp	Thu Dec 20 20:35:47 2012 +0600
@@ -570,41 +570,41 @@
 //----- (004948B1) --------------------------------------------------------
 __int16 Player::PlaySound(int a2, int a3)
 {
-  Player *v3; // edi@1
+  Player *pPlayer; // edi@1
   int v4; // eax@4
   signed int v5; // esi@4
-  char *v6; // ebx@4
+  unsigned __int8 *v6; // ebx@4
   signed int v7; // ecx@5
-  char v8; // al@6
+  unsigned __int8 v8; // al@6
   int v9; // eax@10
-  unsigned int v10; // ecx@10
+  unsigned int pVoiceID; // ecx@10
   int v11; // esi@10
   signed int v12; // eax@11
   signed int v13; // esi@12
   int v14; // eax@12
   int v15; // eax@17
-  int v16; // ebx@17
+  int pExpression; // ebx@17
   signed int v17; // ecx@19
-  char *v18; // edi@20
+  char *pSoundID; // edi@20
   int v20[5]; // [sp+Ch] [bp-1Ch]@7
-  Player *v21; // [sp+20h] [bp-8h]@1
-  int v22; // [sp+24h] [bp-4h]@1
+  Player *pPlayer2; // [sp+20h] [bp-8h]@1
+  int pPlayerNum; // [sp+24h] [bp-4h]@1
   int v23; // [sp+30h] [bp+8h]@4
 
-  v3 = this;
-  v21 = this;
-  v22 = 1;
+  pPlayer = this;
+  pPlayer2 = this;
+  pPlayerNum = 1;
   do
   {
-    if ( this == pPlayers[v22] )
+    if ( this == pPlayers[pPlayerNum] )
       break;
-    ++v22;
-  }
-  while ( v22 <= 4 );
-  v4 = a2;
+    ++pPlayerNum;
+  }
+  while ( pPlayerNum <= 4 );
+  v4 = a2;//102
   v5 = 0;
   v23 = 0;
-  v6 = (char *)&unk_4ED3D8 + 8 * v4;
+  v6 = &byte_4ED3D8[8 * v4];
   if ( uVoicesVolumeMultiplier )
   {
     v7 = 0;
@@ -612,21 +612,21 @@
     {
       v8 = v6[v7];
       if ( v8 )
-        v20[v5++] = (unsigned __int8)v8;
+        v20[v5++] = v8;
       ++v7;
     }
     while ( v7 < 2 );
     if ( v5 )
     {
       v9 = rand();
-      v10 = v3->uVoiceID;
+      pVoiceID = pPlayer->uVoiceID;
       v11 = v20[v9 % v5];
-      if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[v10]) )
-      {
-        v23 = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[v10])
-            + 2 * (v11 + 50 * v21->uVoiceID)
+      if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID]) )
+      {
+        v23 = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID])
+            + 2 * (v11 + 50 * pPlayer2->uVoiceID)
             + 4998;
-        v12 = 8 * v22 + 312;
+        v12 = 8 * pPlayerNum + 312;
         LOBYTE(v12) = v12 | 4;
         pAudioPlayer->PlaySound((SoundID)v23, v12, 0, -1, 0, 0, (signed __int64)(pSoundVolumeLevels[(char)uVoicesVolumeMultiplier] * 128.0), 0);
       }
@@ -644,9 +644,9 @@
   if ( v13 )
   {
     v15 = rand();
-    v22 = 0;
-    v16 = v20[v15 % v13];
-    if ( v16 == 21 && v23 )
+    pPlayerNum = 0;
+    pExpression = v20[v15 % v13];
+    if ( pExpression == 21 && v23 )
     {
       v17 = 0;
       if ( (signed int)pSoundList->uNumSounds <= 0 )
@@ -656,19 +656,19 @@
       }
       else
       {
-        v18 = (char *)&pSoundList->pSounds->uSoundID;
-        while ( *(int *)v18 != v23 )
+        pSoundID = (char *)&pSoundList->pSounds->uSoundID;
+        while ( *(int *)pSoundID != v23 )
         {
           ++v17;
-          v18 += 120;
+          pSoundID += 120;
           if ( v17 >= (signed int)pSoundList->uNumSounds )
             goto LABEL_23;
         }
       }
       if ( pSoundList->pSounds[v17].pSoundData[0] )
-        v22 = (sLastTrackLengthMS << 7) / 1000;
-    }
-    LOWORD(v14) = v21->PlayEmotion(v16, v22);
+        pPlayerNum = (sLastTrackLengthMS << 7) / 1000;
+    }
+    LOWORD(v14) = pPlayer2->PlayEmotion(pExpression, pPlayerNum);
   }
   return v14;
 }
--- a/VideoPlayer.cpp	Thu Dec 20 20:35:33 2012 +0600
+++ b/VideoPlayer.cpp	Thu Dec 20 20:35:47 2012 +0600
@@ -360,7 +360,7 @@
       pRenderer->ClearTarget(0);
       pRenderer->EndScene();
     }
-    pCurrentScreen = 16;
+    pCurrentScreen = 16; //   
     if ( pVideoPlayer->uMovieFormat == 2 )
     {
       if ( pVideoPlayer->pBinkMovie )
@@ -422,7 +422,7 @@
       pCurrentScreen = 0;
     pVideoPlayer->bPlayingMovie = 0;
     ShowCursor(1);
-    if ( pCurrentScreen == 16 )
+    if ( pCurrentScreen == 16 )//   
       pCurrentScreen = 0;
   }
 }
@@ -507,29 +507,29 @@
 //----- (004BEB41) --------------------------------------------------------
 void VideoPlayer::Prepare()
 {
-  VideoPlayer *v1; // esi@1
+  VideoPlayer *pVideoPlayer; // esi@1
   IDirectDrawSurface *v2; // [sp-4h] [bp-Ch]@5
 
-  v1 = this;
+  pVideoPlayer = this;
   pEventTimer->Pause();
-  v1->bStopBeforeSchedule = 0;
+  pVideoPlayer->bStopBeforeSchedule = 0;
   if ( pAudioPlayer->hAILRedbook )
     AIL_redbook_pause(pAudioPlayer->hAILRedbook);
-  v1->field_54 = 1;
-  v1->hWindow = hWnd;
-  v1->pSmackerMovie = 0;
-  v1->pSmackerBuffer = 0;
-  v1->pBinkMovie = 0;
-  v1->pBinkBuffer = 0;
-  v1->bPlayingMovie = 0;
-  v1->bFirstFrame = 0;
-  v1->bUsingSmackerMMX = SmackUseMMX(1);
+  pVideoPlayer->field_54 = 1;
+  pVideoPlayer->hWindow = hWnd;
+  pVideoPlayer->pSmackerMovie = 0;
+  pVideoPlayer->pSmackerBuffer = 0;
+  pVideoPlayer->pBinkMovie = 0;
+  pVideoPlayer->pBinkBuffer = 0;
+  pVideoPlayer->bPlayingMovie = 0;
+  pVideoPlayer->bFirstFrame = 0;
+  pVideoPlayer->bUsingSmackerMMX = SmackUseMMX(1);
   BinkSetSoundSystem(BinkOpenMiles, pAudioPlayer->hDigDriver);
   if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5 )
     v2 = (IDirectDrawSurface*)pRenderer->pBackBuffer4;
   else
     v2 = (IDirectDrawSurface*)pRenderer->pBackBuffer2;
-  v1->uBinkDirectDrawSurfaceType = BinkDDSurfaceType(v2);
+  pVideoPlayer->uBinkDirectDrawSurfaceType = BinkDDSurfaceType(v2);
   _flushall();
 }
 
@@ -886,7 +886,6 @@
 
   return nullptr;
 }
-
 //----- (004BF1E6) --------------------------------------------------------
 _SMACK *VideoPlayer::OpenSmack(const char *pFilename)
 {
@@ -1043,7 +1042,6 @@
       {
         Unload();
         sprintf(pVideoName, "Can't load file - anims\\%s.smk", pFilename);
-//LABEL_17:
         MessageBoxA(0, pVideoName, "Smacker Error", 0);
         return;
       }
@@ -1057,9 +1055,7 @@
       {
         Unload();
         v12 = "Can't allocate memory for buffer";
-//LABEL_16:
         sprintf(pVideoName, v12);
-        //goto LABEL_17;
 		MessageBoxA(0, pVideoName, "Smacker Error", 0);
         return;
       }
@@ -1086,7 +1082,6 @@
       {
         Unload();
         v12 = "Failed to open Blit API";
-        //goto LABEL_16;
 		sprintf(pVideoName, v12);
         MessageBoxA(0, pVideoName, "Smacker Error", 0);
         return;
--- a/mm7_5.cpp	Thu Dec 20 20:35:33 2012 +0600
+++ b/mm7_5.cpp	Thu Dec 20 20:35:47 2012 +0600
@@ -14663,16 +14663,16 @@
   int v18; // eax@61
   int v19; // eax@62
   void *v20; // ebp@66
-  char *v21; // edx@66
-  GUIButton *v22; // ebp@79
+  char *pHint; // edx@66
+  GUIButton *pButtonPtr_1C; // ebp@79
   char *v23; // edx@80
   char v24; // zf@81
-  unsigned int v25; // eax@91
+  //unsigned int v25; // eax@91
   int v26; // eax@98
   unsigned int v27; // ebp@106
-  GUIWindow *v28; // ecx@109
+  GUIWindow *pGUIWindow2; // ecx@109
   unsigned int v29; // eax@111
-  GUIFont *v30; // ST1C_4@115
+  GUIFont *pGUIFont; // ST1C_4@115
   int v31; // eax@115
   void *v32; // ebp@118
   int v33; // eax@119
@@ -14682,18 +14682,18 @@
   int v37; // eax@123
   int v38; // eax@124
   int v39; // eax@129
-  char *v40; // edx@138
-  unsigned int v41; // eax@142
-  GUIButton *v42; // ebp@146
-  char *v43; // edx@146
-  unsigned int v44; // [sp-1Ch] [bp-124h]@17
-  unsigned int v45; // [sp-18h] [bp-120h]@17
-  Texture *v46; // [sp-14h] [bp-11Ch]@17
-  Texture *v47; // [sp-14h] [bp-11Ch]@86
+  //char *v40; // edx@138
+  unsigned int pNumMessages; // eax@142
+  GUIButton *pGUIButton; // ebp@146
+  //char *v43; // edx@146
+  unsigned int pX; // [sp-1Ch] [bp-124h]@17
+  unsigned int pY; // [sp-18h] [bp-120h]@17
+  Texture *pTexture; // [sp-14h] [bp-11Ch]@17
+  Texture *pTexture2; // [sp-14h] [bp-11Ch]@86
   int i; // [sp+0h] [bp-108h]@3
-  ItemGen _this; // [sp+4h] [bp-104h]@98
-  GUIButton Dst; // [sp+28h] [bp-E0h]@133
-  ItemGen v51; // [sp+E4h] [bp-24h]@129
+  ItemGen pItemGen; // [sp+4h] [bp-104h]@98
+  GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133
+  ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129
 
   if (GetCurrentMenuID() != MENU_CREATEPARTY)
     sub_41CD4F(34);
@@ -14702,33 +14702,29 @@
     //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
     pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1];
     pWindowType = pWindow->eWindowType;
-
     switch (pWindow->eWindowType)
     {
       case WINDOW_MainMenu_Load:
         GameUI_MainMenu_DrawLoad();
         continue;
-
       case WINDOW_5E: // window that initiates savegame loading
       {
         if (pWindow->Hint != (char *)1)
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-        auto v20 = (GUIButton *)pWindow->ptr_1C;
-        pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, v20->pTextures[0]);
-        v21 = pWindow->Hint;
+        auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C;
+        pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]);
+        pHint = pWindow->Hint;
         viewparams->bRedrawGameUI = 1;
-        if ( v21 && v21 != (char *)1 )
-          v20->DrawLabel(v21, pFontCreate, 0, 0);
+        if ( pHint && pHint != (char *)1 )
+          pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
         pWindow->Release();
-        if (pCurrentScreen == 11)
+        if (pCurrentScreen == 11)//  
           pMessageQueue_50CBD0->SendMessage(UIMSG_SaveGame, 0, 0);
         else
           pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0);
       }
       continue;
     }
-
-
     if ( (signed int)pWindowType > 70 )
     {
       if ( (signed int)pWindowType > 95 )
@@ -14738,19 +14734,19 @@
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v42 = (GUIButton *)pWindow->ptr_1C;
-          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, v42->pTextures[0]);
-          v43 = pWindow->Hint;
+          pGUIButton = (GUIButton *)pWindow->ptr_1C;
+          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]);
+          pHint = pWindow->Hint;
           viewparams->bRedrawGameUI = 1;
-          if ( v43 && v43 != (char *)1 )
-            v42->DrawLabel(v43, pFontCreate, 0, 0);
+          if ( pHint && pHint != (char *)1 )
+            pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0);
           pWindow->Release();
           if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
             continue;
-          v41 = pMessageQueue_50CBD0->uNumMessages;
-LABEL_151:
-          pMessageQueue_50CBD0->pMessages[v41].eType = (UIMessageType)113;
-LABEL_152:
+          pNumMessages = pMessageQueue_50CBD0->uNumMessages;
+//LABEL_151:
+          pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
+//LABEL_152:
           pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
           *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
           ++pMessageQueue_50CBD0->uNumMessages;
@@ -14786,7 +14782,7 @@
                 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
                 if ( !pKeyActionMap->field_204 )
                 {
-                  v51.Reset();
+                  ItemGen2.Reset();
                   pWindow->Release();
                   pEventTimer->Resume();
                   pCurrentScreen = 0;
@@ -14801,29 +14797,33 @@
               }
               continue;
             }
-            v46 = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);
-            v45 = pWindow->uFrameY;
-            v44 = pWindow->uFrameX;
-LABEL_18:
-            pRenderer->DrawTextureIndexed(v44, v45, v46);
-LABEL_114:
+            pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);
+            pY = pWindow->uFrameY;
+            pX = pWindow->uFrameX;
+//LABEL_18:
+            pRenderer->DrawTextureIndexed(pX, pY, pTexture);
+//LABEL_114:
             viewparams->bRedrawGameUI = 1;
             continue;
           }
-          memset(&Dst, 0, 0xBCu);
-          Dst.uZ = 197;
-          Dst.uW = 197;
-          Dst.uX = 27;
-          Dst.uY = 161;
-          Dst.uWidth = 171;
-          Dst.uHeight = 37;
-          Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent;
+          memset(&GUIButton2, 0, 0xBCu);
+          GUIButton2.uZ = 197;
+          GUIButton2.uW = 197;
+          GUIButton2.uX = 27;
+          GUIButton2.uY = 161;
+          GUIButton2.uWidth = 171;
+          GUIButton2.uHeight = 37;
+          GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent;
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
           pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15));
           viewparams->bRedrawGameUI = 1;
-          Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);
-          Dst.pParent = 0;
-          goto LABEL_134;
+          GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//   8 
+          GUIButton2.pParent = 0;
+          //goto LABEL_134;
+		  pGUIWindow2 = pWindow;
+          //goto LABEL_110;
+		  pGUIWindow2->Release();
+          continue;
         }
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -14838,15 +14838,22 @@
         v32 = pWindow->ptr_1C;
         pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 15));
 LABEL_138:
-        v40 = pWindow->Hint;
+        pHint = pWindow->Hint;
         viewparams->bRedrawGameUI = 1;
-        if ( v40 && v40 != (char *)1 )
-          ((GUIButton *)v32)->DrawLabel(v40, pFontCreate, 0, 0);
+        if ( pHint && pHint != (char *)1 )
+          ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0);
         pWindow->Release();
 LABEL_142:
-        v41 = pMessageQueue_50CBD0->uNumMessages;
+        pNumMessages = pMessageQueue_50CBD0->uNumMessages;
         if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-          goto LABEL_151;
+          //goto LABEL_151;
+		{
+		  pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+          *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+          ++pMessageQueue_50CBD0->uNumMessages;
+          continue;
+		}
         continue;
       }
       v14 = pWindowType - 80;
@@ -14860,7 +14867,7 @@
           pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
           if ( !pKeyActionMap->field_204 )
           {
-            _this.Reset();
+            pItemGen.Reset();
             pWindow->Release();
             pEventTimer->Resume();
             pCurrentScreen = 0;
@@ -14870,20 +14877,20 @@
             {
               if ( v26 < 800 )
               {
-                _this.uAttributes |= 1u;
-                _this.uItemID = v26;
+                pItemGen.uAttributes |= 1u;
+                pItemGen.uItemID = v26;
                 if ( pItemsTable->pItems[v26].uEquipType == 12 )
                 {
-                  _this.uNumCharges = rand() % 6 + pItemsTable->pItems[_this.uItemID].uDamageMod + 1;
-                  _this.uMaxCharges = LOBYTE(_this.uNumCharges);
+                  pItemGen.uNumCharges = rand() % 6 + pItemsTable->pItems[pItemGen.uItemID].uDamageMod + 1;
+                  pItemGen.uMaxCharges = LOBYTE(pItemGen.uNumCharges);
                 }
                 else
                 {
                   if ( v26 >= 221 && v26 < 271 )
-                    _this._bonus_type = rand() % 10 + 1;
+                    pItemGen._bonus_type = rand() % 10 + 1;
                 }
-                pItemsTable->SetSpecialBonus(&_this);
-                pParty->SetHoldingItem(&_this);
+                pItemsTable->SetSpecialBonus(&pItemGen);
+                pParty->SetHoldingItem(&pItemGen);
               }
             }
           }
@@ -14894,17 +14901,17 @@
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v22 = (GUIButton *)pWindow->ptr_1C;
-          if ( (v22->uX /*& 0x80000000u*/) == 0 )
-          {
-            if ( (signed int)v22->uX <= 640 )
-            {
-              v25 = v22->uY;
-              if ( (v25 /*& 0x80000000u*/) == 0 )
+          pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
+          if ( (pButtonPtr_1C->uX /*& 0x80000000u*/) == 0 )
+          {
+            if ( (signed int)pButtonPtr_1C->uX <= 640 )
+            {
+              //v25 = pButtonPtr_1C->uY;
+              if ( (pButtonPtr_1C->uY /*& 0x80000000u*/) == 0 )
               {
-                if ( (signed int)v25 <= 480 )
+                if ( (signed int)pButtonPtr_1C->uY <= 480 )
                 {
-                  v47 = v22->pTextures[0];
+                  pTexture2 = pButtonPtr_1C->pTextures[0];
                   goto LABEL_94;
                 }
               }
@@ -14917,19 +14924,21 @@
             v24 = v23 == (char *)1;
             goto LABEL_82;
           }
-LABEL_134:
-          v28 = pWindow;
-          goto LABEL_110;
+//LABEL_134:
+          pGUIWindow2 = pWindow;
+          //goto LABEL_110;
+		  pGUIWindow2->Release();
+          continue;
         }
         v17 = v16 - 1;
         if ( !v17 )
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v22 = (GUIButton *)pWindow->ptr_1C;
-          v47 = v22->pTextures[1];
+          pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
+          pTexture2 = pButtonPtr_1C->pTextures[1];
 LABEL_94:
-          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, v47);
+          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pTexture2);
 LABEL_80:
           v23 = pWindow->Hint;
           viewparams->bRedrawGameUI = 1;
@@ -14938,17 +14947,21 @@
             v24 = v23 == (char *)1;
 LABEL_82:
             if ( !v24 )
-              v22->DrawLabel(v23, pFontCreate, 0, 0);
-          }
-          goto LABEL_134;
+              pButtonPtr_1C->DrawLabel(v23, pFontCreate, 0, 0);
+          }
+          //goto LABEL_134;
+		  pGUIWindow2 = pWindow;
+          //goto LABEL_110;
+		  pGUIWindow2->Release();
+          continue;
         }
         v18 = v17 - 1;
         if ( !v18 )
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v22 = (GUIButton *)pWindow->ptr_1C;
-          pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, v22->pTextures[0]);
+          pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
+          pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]);
           goto LABEL_80;
         }
         v19 = v18 - 1;
@@ -14958,7 +14971,11 @@
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
           pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 16));
           viewparams->bRedrawGameUI = 1;
-          goto LABEL_134;
+          //goto LABEL_134;
+		  pGUIWindow2 = pWindow;
+          //goto LABEL_110;
+		  pGUIWindow2->Release();
+          continue;
         }
       }
       else
@@ -14967,18 +14984,10 @@
         if ( ptr_507BD0->field_40 == 1 )
         {
           ptr_507BD0->DrawMessageBox(0);
-          ptr_507BD0->DrawText(
-            pFontCreate,
-            30,
-            40,
-            v27,
-            (const char *)pKeyActionMap->pPressedKeysBuffer,
-            0,
-            0,
-            0);
-          v30 = pFontCreate;
+          ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
+          pGUIFont = pFontCreate;
           v31 = pFontCreate->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
-          ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, v30);
+          ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pGUIFont);
           continue;
         }
         if ( ptr_507BD0->field_40 == 2 )
@@ -14995,15 +15004,17 @@
           pEventTimer->Resume();
           ptr_507BD0->Release();
           pCurrentScreen = 0;
-          goto LABEL_114;
+          //goto LABEL_114;
+		  viewparams->bRedrawGameUI = 1;
+          continue;
         }
         if ( ptr_507BD0->field_40 == 3 )
         {
           pWindow->field_40 = 0;
           pEventTimer->Resume();
-          v28 = ptr_507BD0;
-LABEL_110:
-          v28->Release();
+          pGUIWindow2 = ptr_507BD0;
+//LABEL_110:
+          pGUIWindow2->Release();
           continue;
         }
       }
@@ -15031,9 +15042,7 @@
                 draw_leather();
                 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
                 CharacterUI_DrawPaperdoll(uActiveCharacter);
-                pRenderer->DrawTextureTransparent(
-                  pBtn_ExitCancel->uX,
-                  pBtn_ExitCancel->uY,
+                pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
                   (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
               }
             }
@@ -15080,9 +15089,7 @@
                   pRenderer->ClearZBuffer(0, 479);
                   draw_leather();
                   CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-                  pRenderer->DrawTextureIndexed(
-                    pBtn_ExitCancel->uX,
-                    pBtn_ExitCancel->uY,
+                  pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
                     (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
                 }
               }
@@ -15168,10 +15175,13 @@
             }
             continue;
           }
-          v46 = (Texture *)(uTextureID_507944 != -1 ? &pIcons_LOD->pTextures[uTextureID_507944] : 0);
-          v45 = pViewport->uViewportY;
-          v44 = pViewport->uViewportX;
-          goto LABEL_18;
+          pTexture = (Texture *)(uTextureID_507944 != -1 ? &pIcons_LOD->pTextures[uTextureID_507944] : 0);
+          pY = pViewport->uViewportY;
+          pX = pViewport->uViewportX;
+          //goto LABEL_18;
+		  pRenderer->DrawTextureIndexed(pX, pY, pTexture);
+          viewparams->bRedrawGameUI = 1;
+          continue;
         }
         DrawDialogueUI();
       }
@@ -15183,12 +15193,6 @@
     sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0);
 }
 
-
-
-
-
-
-
 //----- (00416196) --------------------------------------------------------
 void __cdecl identify_item()
 {
--- a/mm7_data.cpp	Thu Dec 20 20:35:33 2012 +0600
+++ b/mm7_data.cpp	Thu Dec 20 20:35:47 2012 +0600
@@ -1056,7 +1056,7 @@
   "pc19lhu", "pc20lhu", "pc21lhu", "pc22lhu", "pc23lhu", "pc24lhu",
   "pc25lhu"
 };
-_UNKNOWN unk_4ED3D8; // weak
+unsigned __int8 byte_4ED3D8[192]; // weak
 unsigned char byte_4ED498 = 15; // weak
 __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4] = {34, 149, 264, 379};
 char byte_4ED970_skill_learn_ability_by_class_table[32][37];
--- a/mm7_data.h	Thu Dec 20 20:35:33 2012 +0600
+++ b/mm7_data.h	Thu Dec 20 20:35:47 2012 +0600
@@ -980,7 +980,7 @@
 extern const char *drh_texnames_by_face[25];
 extern const char *dlh_texnames_by_face[25];
 extern const char *dlhu_texnames_by_face[25];
-extern _UNKNOWN unk_4ED3D8; // weak
+extern unsigned __int8 byte_4ED3D8[192]; // weak
 extern unsigned char byte_4ED498; // weak
 extern __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4];
 extern char byte_4ED970_skill_learn_ability_by_class_table[32][37];