diff Outdoor.cpp @ 2006:30c2b575d25c

signed fixes DamagePlayerFromMonster -1 indexing
author zipi
date Wed, 06 Nov 2013 13:06:02 +0000
parents 72af4d93bdfb
children 7a9477135943
line wrap: on
line diff
--- a/Outdoor.cpp	Wed Nov 06 00:09:47 2013 -0800
+++ b/Outdoor.cpp	Wed Nov 06 13:06:02 2013 +0000
@@ -1170,15 +1170,15 @@
   v1->pFaceIDLIST = (unsigned __int16 *)v6;
   *(short *)v6 = 0;
   strcpy(v1->pSkyTextureName, pDefaultSkyTexture.data());
-  v1->uSky_TextureID = pBitmaps_LOD->LoadTexture(v1->pSkyTextureName);
+  v1->sSky_TextureID = pBitmaps_LOD->LoadTexture(v1->pSkyTextureName);
   strcpy(v1->pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data());
   v7 = pBitmaps_LOD->LoadTexture(v1->pGroundTileset);
-  v1->uMainTile_BitmapID = v7;
+  v1->sMainTile_BitmapID = v7;
 
-  if ( v1->uSky_TextureID == -1 )
+  if ( v1->sSky_TextureID == -1 )
     Error("Invalid Sky Tex Handle");
 
-  if ( v1->uMainTile_BitmapID == -1 )
+  if ( v1->sMainTile_BitmapID == -1 )
     Error("Invalid Ground Tex Handle");
 }
 
@@ -1667,16 +1667,16 @@
       v108 = 0;
       v107 = (int)pDefaultSkyTexture;
     }
-    uSky_TextureID = pBitmaps_LOD->LoadTexture((const char *)v107, (enum TEXTURE_TYPE)v108);
+    sSky_TextureID = pBitmaps_LOD->LoadTexture((const char *)v107, (enum TEXTURE_TYPE)v108);
     strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture);
     v34 = pTileTable->GetTileById(pTileTypes[0].uTileID);
     v35 = pBitmaps_LOD->LoadTexture(v34->pTileName);
-    v36 = uSky_TextureID;
-    uMainTile_BitmapID = v35;
+    v36 = sSky_TextureID;
+    sMainTile_BitmapID = v35;
     if ( v36 != -1 )
       pBitmaps_LOD->pTextures[v36].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v36].palette_id1);
 
-    v37 = uMainTile_BitmapID;
+    v37 = sMainTile_BitmapID;
     if ( v37 != -1 )
       pBitmaps_LOD->pTextures[v37].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v37].palette_id1);
 
@@ -2323,9 +2323,9 @@
   //v108 = 0;
   TileDesc* v98 = pTileTable->GetTileById(pTileTypes[0].uTileID);
   //v99 = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT);
-  uMainTile_BitmapID = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT);
-  if (uMainTile_BitmapID != -1)
-    pBitmaps_LOD->pTextures[uMainTile_BitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[uMainTile_BitmapID].palette_id1);
+  sMainTile_BitmapID = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT);
+  if (sMainTile_BitmapID != -1)
+    pBitmaps_LOD->pTextures[sMainTile_BitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[sMainTile_BitmapID].palette_id1);
 
   _47F0E2();
 
@@ -2349,9 +2349,9 @@
     strcpy(loc_time.sky_texture_name, "plansky3");
   }
   //v101 = pBitmaps_LOD->LoadTexture(field_4F8);
-  uSky_TextureID = pBitmaps_LOD->LoadTexture(loc_time.sky_texture_name);
-  if (uSky_TextureID != -1)
-    pBitmaps_LOD->pTextures[uSky_TextureID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[uSky_TextureID].palette_id1);
+  sSky_TextureID = pBitmaps_LOD->LoadTexture(loc_time.sky_texture_name);
+  if (sSky_TextureID != -1)
+    pBitmaps_LOD->pTextures[sSky_TextureID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[sSky_TextureID].palette_id1);
 
   pPaletteManager->RecalculateAll();
   pSoundList->LoadSound(53, 0);
@@ -2427,14 +2427,14 @@
 }
 
 //----- (0047ED08) --------------------------------------------------------
-unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uY)
+unsigned int OutdoorLocation::DoGetTileTexture(signed int sX, signed int sY)
 {
   int v3; // esi@5
   unsigned int result; // eax@9
 
-  assert(uX < 128 && uY < 128);
+  assert(sX < 128 && sY < 128);
 
- v3 = this->pTerrain.pTilemap[uY * 128 + uX];
+ v3 = this->pTerrain.pTilemap[sY * 128 + sX];
  if (v3 < 198) // < Tileset_3
  {
   if (v3 >= 90)
@@ -2490,12 +2490,12 @@
 }
 
 //----- (0047EDB3) --------------------------------------------------------
-int OutdoorLocation::ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY)
+int OutdoorLocation::ActuallyGetSomeOtherTileInfo(signed int sX, signed int sY)
 {
-  assert(uX < 128 && uY < 128);
+  assert(sX < 128 && sY < 128);
   int v3; // esi@5
 
-  v3 = this->pTerrain.pTilemap[uY * 128 + uX];
+  v3 = this->pTerrain.pTilemap[sY * 128 + sX];
   if ( v3 >= 90 )
     v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90;
   return pTileTable->pTiles[v3].uAttributes;
@@ -3101,7 +3101,7 @@
 		v36 = actor->pMonsterInfo.uID;
         v28->field_1E = v62 | 0x200;
         v28->pSpriteFrame = v15;
-        v28->uTintColor = pMonsterList->pMonsters[actor->pMonsterInfo.uID-1].uTintColor;//*((int *)&v35[v36] - 36);
+        v28->sTintColor = pMonsterList->pMonsters[actor->pMonsterInfo.uID-1].sTintColor;//*((int *)&v35[v36] - 36);
         if (actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime)
           v28->field_1E = v62 | 0x200;
       }