diff Indoor.cpp @ 554:9caf59edb1ee

Cave and Temple load and even doesn't crash (for a while).
author Nomad
date Mon, 04 Mar 2013 22:44:41 +0200
parents 35f28d4c0ff9
children 8b77231088d8
line wrap: on
line diff
--- a/Indoor.cpp	Mon Mar 04 20:29:31 2013 +0200
+++ b/Indoor.cpp	Mon Mar 04 22:44:41 2013 +0200
@@ -2679,28 +2679,28 @@
     j += pSector->uNumFloors;
 
     pSector->pWalls = ptr_0002B0_sector_rdata + j;
-    j += pSector->field_C;
+    j += pSector->uNumWalls;
 
     pSector->pCeilings = ptr_0002B0_sector_rdata + j;
-    j += pSector->field_14;
+    j += pSector->uNumCeilings;
 
     pSector->pFluids = ptr_0002B0_sector_rdata + j;
-    j += pSector->field_1C;
+    j += pSector->uNumFluids;
 
     pSector->pPortals = ptr_0002B0_sector_rdata + j;
     j += pSector->uNumPortals;
 
     pSector->pFaceIDs = ptr_0002B0_sector_rdata + j;
-    j += pSector->field_2C;
+    j += pSector->uNumFaces;
 
     pSector->pCogs = ptr_0002B0_sector_rdata + j;
-    j += pSector->field_3C;
+    j += pSector->uNumCogs;
 
     pSector->pDecorationIDs = ptr_0002B0_sector_rdata + j;
     j += pSector->uNumDecorations;
 
     pSector->pMarkers = ptr_0002B0_sector_rdata + j;
-    j += pSector->field_4C;
+    j += pSector->uNumMarkers;
 
 
     //do
@@ -2758,8 +2758,8 @@
 
   for (uint i = 0, j = 0; i < uNumSectors; ++i)
   {
-    pSectors->pLights = (unsigned __int16 *)(ptr_0002B8_sector_lrdata + j);
-    j += pSectors->uNumLights;
+    pSectors[i].pLights = ptr_0002B8_sector_lrdata + j;
+    j += pSectors[i].uNumLights;
   }
 
   pGameLoadingUI_ProgressBar->Progress();
@@ -3712,8 +3712,7 @@
             v25 = abs(v15->pFacePlane_old.vNormal.z);
             //v26 = v87;
             if ( v24 > v25 )
-              Abortf(
-                "Door Error\ndoor id: %i\nfacet no: %i\n\nOverflow dividing facet->d [%i] by facet->nz [%i]",
+              Abortf("Door Error\ndoor id: %i\nfacet no: %i\n\nOverflow dividing facet->d [%i] by facet->nz [%i]",
                 door->uDoorID,
                 door->pFaceIDs[v88],
                 v15->pFacePlane_old.dist,
@@ -3886,7 +3885,9 @@
           }
           //v2 = v87;
         }
-        LOWORD(v39) = v84 + ((signed __int16)v39 != -1 ? pBitmaps_LOD->pTextures[(signed __int16)v39].uTextureWidth : 24);
+        LOWORD(v39) = v84;
+        if (v15->uBitmapID != -1)
+          LOWORD(v39) += pBitmaps_LOD->pTextures[v15->uBitmapID].uTextureWidth;
 LABEL_50:
         v28->sTextureDeltaU -= v39;
         goto LABEL_51;