changeset 126:2331a331d36a

3.11.12 palette
author Ritor1
date Sun, 04 Nov 2012 09:37:15 +0600
parents d7e68aebe0b3
children 9eac46182d8f
files Indoor.cpp Outdoor.cpp mm7_2.cpp
diffstat 3 files changed, 37 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Sat Nov 03 19:59:36 2012 +0600
+++ b/Indoor.cpp	Sun Nov 04 09:37:15 2012 +0600
@@ -4446,9 +4446,9 @@
   }
   if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d23.blv") )
     bNoNPCHiring = 1;
-  pPaletteManager->pPalette_tintColor[0] = 0;
-  pPaletteManager->pPalette_tintColor[1] = 0;
-  pPaletteManager->pPalette_tintColor[2] = 0;
+  pPaletteManager->field_267AD3 = 0;
+  pPaletteManager->field_267AD4 = 0;
+  pPaletteManager->field_267AD5 = 0;
   pPaletteManager->RecalculateAll();
   if ( qword_A750D8 )
     qword_A750D8 = 0i64;
--- a/Outdoor.cpp	Sat Nov 03 19:59:36 2012 +0600
+++ b/Outdoor.cpp	Sun Nov 04 09:37:15 2012 +0600
@@ -1305,11 +1305,11 @@
   __int32 v134; // [sp+9A0h] [bp-1E0h]@38
   __int32 v135; // [sp+9ACh] [bp-1D4h]@38
   __int32 v136; // [sp+9D0h] [bp-1B0h]@10
-  char FileName[8]; // [sp+A20h] [bp-160h]@8
-  char v138; // [sp+A28h] [bp-158h]@12
-  int v139; // [sp+B1Ch] [bp-64h]@10
+  char FileName[32]; // [sp+A20h] [bp-160h]@8
+  //char v138; // [sp+A28h] [bp-158h]@12
+  //char v139; // [sp+B1Ch] [bp-64h]@10
   char pContainer[32]; // [sp+B20h] [bp-60h]@1
-  int *v141; // [sp+B40h] [bp-40h]@50
+  //char *v141; // [sp+B40h] [bp-40h]@50
   __int64 v142; // [sp+B44h] [bp-3Ch]@55
   size_t pSource; // [sp+B4Ch] [bp-34h]@56
   int v144; // [sp+B50h] [bp-30h]@61
@@ -1326,26 +1326,26 @@
   strcpy(pContainer, pFilename);
   if ( bUnderwater )
   {
-    pPaletteManager->pPalette_tintColor[0] = 0x10u;
-    pPaletteManager->pPalette_tintColor[1] = 0xC2u;
-    pPaletteManager->pPalette_tintColor[2] = 0x99u;
-    pPaletteManager->pPalette_mistColor[0] = 0x25u;
-    pPaletteManager->pPalette_mistColor[1] = 0x8Fu;
-    pPaletteManager->pPalette_mistColor[2] = 0x5Cu;
+    pPaletteManager->field_267AD3 = 0x10u;
+    pPaletteManager->field_267AD4 = 0xC2u;
+    pPaletteManager->field_267AD5 = 0x99u;
+    pPaletteManager->field_267AD0 = 0x25u;
+    pPaletteManager->field_267AD1 = 0x8Fu;
+    pPaletteManager->field_267AD2 = 0x5Cu;
 LABEL_7:
     pPaletteManager->RecalculateAll();
     goto LABEL_8;
   }
-  pPaletteManager->pPalette_tintColor[0] = 0;
-  pPaletteManager->pPalette_tintColor[1] = 0;
-  pPaletteManager->pPalette_tintColor[2] = 0;
-  if ( pPaletteManager->pPalette_mistColor[0] != 0x80u
-    || pPaletteManager->pPalette_mistColor[1] != 0x80u
-    || pPaletteManager->pPalette_mistColor[2] != 0x80u )
+  pPaletteManager->field_267AD3 = 0;
+  pPaletteManager->field_267AD4 = 0;
+  pPaletteManager->field_267AD5 = 0;
+  if ( pPaletteManager->field_267AD0 != 0x80u
+    || pPaletteManager->field_267AD1 != 0x80u
+    || pPaletteManager->field_267AD2 != 0x80u )
   {
-    pPaletteManager->pPalette_mistColor[0] = 0x80u;
-    pPaletteManager->pPalette_mistColor[1] = 0x80u;
-    pPaletteManager->pPalette_mistColor[2] = 0x80u;
+    pPaletteManager->field_267AD0 = 0x80u;
+    pPaletteManager->field_267AD1 = 0x80u;
+    pPaletteManager->field_267AD2 = 0x80u;
     goto LABEL_7;
   }
 LABEL_8:
@@ -1361,7 +1361,7 @@
     *(int *)thisa = 1;
     v8 = strlen(pContainer);
     v108 = 2;
-    *((char *)&v139 + v8) = 0;
+    *((char *)&pContainer[-4] + v8) = 0;
     viewparams->uTextureID_LocationMap = pIcons_LOD->LoadTexture(pContainer, (enum TEXTURE_TYPE)v108);
     fread(&DstBuf, 0x180u, 1u, (FILE *)v7);
     fseek((FILE *)v7, Offset, 0);
@@ -1421,9 +1421,10 @@
         pOutdoorLocation->pBModels[v12].pNodes = 0;
         FileName[0] = 0;
         v108 = (int)&pOutdoorLocation->pBModels[v12];
-        sprintfex(FileName, "%s", v108);
+        sprintf(FileName, "%s", v108);
         v13 = pOutdoorLocation->pBModels;
-        v138 = 0;
+        FileName[8] = 0;
+		v108 = (int)FileName;
         pOutdoorLocation->pBModels[v12].pVertices.pVertices = (Vec3_int_ *)pAllocator->AllocNamedChunk(v13[v12].pVertices.pVertices, 12 * v13[v12].pVertices.uNumVertices,
                                                                FileName);
         pOutdoorLocation->pBModels[v12].pFaces = (ODMFace *)pAllocator->AllocNamedChunk(pOutdoorLocation->pBModels[v12].pFaces, 308 * pOutdoorLocation->pBModels[v12].uNumFaces,
@@ -1622,9 +1623,9 @@
   strcpy(Str, pContainer);
   Dst[strlen(Str) + 964] = 0;
   viewparams->uTextureID_LocationMap = pIcons_LOD->LoadTexture(Str, TEXTURE_16BIT_PALETTE);
-  v141 = &v139;
-  v38 = strlen(pContainer);
-  strcpy((char *)&v139 + v38, ".odm");
+  //v141 = &pContainer[-4];
+  //v38 = strlen(pContainer);
+  strcpy((char *)&pContainer[strlen(pContainer) - 4], ".odm");
   v39 = pGames_LOD->FindContainer(pContainer, 1);
   header.uCompressedSize = 0;
   header.uDecompressedSize = 0;
@@ -1722,7 +1723,7 @@
       v108 = (int)&pOutdoorLocation->pBModels[v48];
       sprintf(FileName, "%s", v108);
       v49 = pOutdoorLocation->pBModels;
-      v138 = 0;
+      FileName[8] = 0;
       v50 = &v49[v48];
       v108 = (int)FileName;
       v107 = 12 * v50->pVertices.uNumVertices;
@@ -1889,9 +1890,8 @@
   memcpy(v71, uSourceLen, 24 * v72);
   pGameLoadingUI_ProgressBar->Progress();
   free((void *)HIDWORD(v142));
-  v108 = (int)".ddm";
-  v73 = strlen(pContainer);
-  strcpy((char *)v141 + v73, (const char *)v108);
+  //v73 = strlen(pContainer);
+  strcpy(&pContainer[strlen(pContainer) - 4], ".ddm");
   v151 = (int)pNew_LOD->FindContainer(pContainer, 1);//
   fread(&header, 0x10u, 1u, (FILE *)v151);
   Str2 = 0;
@@ -2009,9 +2009,8 @@
   }
   *(int *)thisa = 0;
 LABEL_120:
-  v108 = (int)".odm";
-  v83 = strlen(pContainer);
-  strcpy((char *)v141 + v83, (const char *)v108);
+  //v83 = strlen(pContainer);
+  strcpy(&pContainer[strlen(pContainer) - 4], ".odm");
   memcpy(pOutdoorLocation->array_528, (const void *)v74, 0x3C8u);
   v84 = (const void *)(v74 + 968);
   memcpy(pOutdoorLocation->array_8F0, v84, 0x3C8u);
--- a/mm7_2.cpp	Sat Nov 03 19:59:36 2012 +0600
+++ b/mm7_2.cpp	Sun Nov 04 09:37:15 2012 +0600
@@ -13929,9 +13929,9 @@
   pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
   pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
   pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
-  pPaletteManager->pPalette_mistColor[0] = 128;
-  pPaletteManager->pPalette_mistColor[1] = 128;
-  pPaletteManager->pPalette_mistColor[2] = 128;
+  pPaletteManager->field_267AD0 = 128;
+  pPaletteManager->field_267AD1 = 128;
+  pPaletteManager->field_267AD2 = 128;
   pPaletteManager->RecalculateAll();
   pSprites_LOD->field_ECAC = 1;
   pObjectList->InitializeSprites();