changeset 649:0e368c04acfb

Sleeping in a tavern
author Nomad
date Mon, 11 Mar 2013 23:43:52 +0200
parents 35ce4761382c
children 14d13880daa9
files LOD.cpp mm7_1.cpp mm7_5.cpp mm7_data.cpp mm7_data.h mm7text_ru.cpp
diffstat 6 files changed, 21 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/LOD.cpp	Mon Mar 11 23:32:27 2013 +0200
+++ b/LOD.cpp	Mon Mar 11 23:43:52 2013 +0200
@@ -3094,6 +3094,7 @@
   uint id = LoadTexture(pContainer, uTextureType);
   if (id == -1)
   {
+    assert(false);
     Log::Warning(L"LOD error\\no container: \"%S\"", pContainer);
     return nullptr;
   }
@@ -3120,11 +3121,12 @@
 //  if (!uNumLoadedFiles)
 //  {
 //LABEL_5:
-    if (uNumLoadedFiles >= 1000)
+    assert(uNumLoadedFiles < 1000);
+    /*if (uNumLoadedFiles >= 1000)
     {
       Log::Warning(L"Maximum texture number exceeded");
       AbortWithError();
-    }
+    }*/
     if (LoadTextureFromLOD(&pTextures[uNumLoadedFiles], pContainer, uTextureType) == -1)
     {
       v6 = 0;
--- a/mm7_1.cpp	Mon Mar 11 23:32:27 2013 +0200
+++ b/mm7_1.cpp	Mon Mar 11 23:43:52 2013 +0200
@@ -3698,7 +3698,7 @@
   Player **ppPlayers; // ecx@1
   Player *pPlayer; // eax@2
   unsigned int v3; // eax@15
-  char v4; // al@17
+  //char v4; // al@17
   bool v5; // eax@21
   GUIButton Dst; // [sp+8h] [bp-DCh]@19
   //double v7; // [sp+C4h] [bp-20h]@17
@@ -3751,18 +3751,18 @@
       _507CD4_RestUI_hourglass_anim_controller = 0;
     }
     v9 = v3;
-    v8 = (double)v3 * 0.001953125 * 120.0;
+    v8 = (double)v3 / 512.0 * 120.0;
     //v7 = v8 + 6.7553994e15;
     HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7);
-    v4 = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1;
-    byte_4E2BC8 = v4;
-    if ( (unsigned __int8)(v4) >= 0x78u )
+    hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1;
+    //hourglass_icon_idx = v4;
+    if (hourglass_icon_idx >= 120 )
     {
-      v4 = 1;
-      byte_4E2BC8 = 1;
+      //v4 = 1;
+      hourglass_icon_idx = 1;
     }
-    sprintf(pTmpBuf, "hglas%03d", (unsigned __int8)v4);
-    pTexture_RestUI_CurrentHourglassFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
+    sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx);
+    pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
     pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame);
     memset(&Dst, 0, 0xBCu);
     Dst.uX = 24;
--- a/mm7_5.cpp	Mon Mar 11 23:32:27 2013 +0200
+++ b/mm7_5.cpp	Mon Mar 11 23:43:52 2013 +0200
@@ -15116,10 +15116,10 @@
 			break;
 			}
 		case WINDOW_Rest:
-			{
+	    {
 			RestUI_Draw();
 			break;
-			}
+		}
 		case WINDOW_Dialogue:
 			{
 			DrawDialogueUI();
--- a/mm7_data.cpp	Mon Mar 11 23:32:27 2013 +0200
+++ b/mm7_data.cpp	Mon Mar 11 23:43:52 2013 +0200
@@ -487,7 +487,7 @@
 char _4E2AD8_ui_colors[72];
 char _4E2B21_buff_spell_tooltip_colors[80];
 char byte_4E2B70[777]; // weak
-char byte_4E2BC8; // weak
+unsigned char hourglass_icon_idx = 12; // weak
 
 char aSS[777]; // idb
 char ascii_4E2C54[6];
--- a/mm7_data.h	Mon Mar 11 23:32:27 2013 +0200
+++ b/mm7_data.h	Mon Mar 11 23:43:52 2013 +0200
@@ -473,7 +473,7 @@
 extern char _4E2AD8_ui_colors[72];
 extern char _4E2B21_buff_spell_tooltip_colors[80];
 extern char byte_4E2B70[]; // weak
-extern char byte_4E2BC8; // weak
+extern unsigned char hourglass_icon_idx; // weak
 
 extern char aSS[]; // idb
 extern char ascii_4E2C54[6];
--- a/mm7text_ru.cpp	Mon Mar 11 23:32:27 2013 +0200
+++ b/mm7text_ru.cpp	Mon Mar 11 23:43:52 2013 +0200
@@ -1166,8 +1166,8 @@
   assert(strlen(str) < sizeof(buf));
 
   int next_integer_token = 0;
-  bool integer_tokens_defined[2] = {false, false};
-  int integer_tokens[2] = {0, 0};
+  bool integer_tokens_defined[10] = {false, false, false, false, false, false, false, false, false, false};
+  int integer_tokens[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
   bool gender_token_defined = false;
   int gender_token = 0;
@@ -1184,7 +1184,8 @@
         if (src[2] != '[')
           goto _invalid_token;
         src += 3;  // ^I[
-
+        
+        assert(next_integer_token < 10);
         if (sscanf(src, "%d", &integer_tokens[next_integer_token]))
           integer_tokens_defined[next_integer_token++] = true;