diff Indoor.cpp @ 1231:182b910c528d

Слияние
author Ritor1
date Sun, 09 Jun 2013 10:18:51 +0600
parents 513a7893aa29 96a81634669e
children 8eb865b584db
line wrap: on
line diff
--- a/Indoor.cpp	Sun Jun 09 10:16:10 2013 +0600
+++ b/Indoor.cpp	Sun Jun 09 10:18:51 2013 +0600
@@ -51,7 +51,7 @@
 
 struct DecorationList *pDecorationList;
 
-LevelDecoration pLevelDecorations[3000];
+std::array<LevelDecoration, 3000> pLevelDecorations;
 size_t uNumLevelDecorations;
 LevelDecoration* activeLevelDecoration;
 
@@ -63,7 +63,7 @@
 BspRenderer_stru2 stru_F8A590;
 BspRenderer *pBspRenderer = new BspRenderer; // idb
 stru141 stru_721530;
-stru352 stru_F83B80[480];
+std::array<stru352, 480> stru_F83B80;
 
 
 
@@ -78,7 +78,7 @@
 };
 
 
-const char *_4E6BDC_loc_names[11]=
+std::array<const char *, 11> _4E6BDC_loc_names=
     {
     "mdt12.blv",
     "d18.blv",
@@ -2684,7 +2684,7 @@
   pGameLoadingUI_ProgressBar->Progress();
   
   memcpy(&uNumLevelDecorations, pData, 4);
-  memcpy(pLevelDecorations, pData + 4, uNumLevelDecorations * sizeof(LevelDecoration));
+  memcpy(pLevelDecorations.data(), pData + 4, uNumLevelDecorations * sizeof(LevelDecoration));
   pData += 4 + uNumLevelDecorations * sizeof(LevelDecoration);
 
   for (uint i = 0; i < uNumLevelDecorations; ++i)
@@ -2785,7 +2785,7 @@
   if (dword_6BE364_game_settings_1 & 0x2000 )
     _i = 29030400;
   bool _a = false;
-  if ( a3 - dlv.uLastRepawnDay >= _i && _stricmp(pCurrentMapName, "d29.dlv") )
+  if ( a3 - dlv.uLastRepawnDay >= _i && _stricmp(pCurrentMapName.data(), "d29.dlv") )
     _a = true;
 
   //v154 = 875;
@@ -2879,21 +2879,21 @@
   pGameLoadingUI_ProgressBar->Progress();
 
   memcpy(&uNumActors, pData, 4);
-  memcpy(pActors, pData + 4, uNumActors * sizeof(Actor));
+  memcpy(pActors.data(), pData + 4, uNumActors * sizeof(Actor));
   pData += 4 + uNumActors * sizeof(Actor);
 
   pGameLoadingUI_ProgressBar->Progress();
   pGameLoadingUI_ProgressBar->Progress();
 
   memcpy(&uNumSpriteObjects, pData, 4);
-  memcpy(pSpriteObjects, pData + 4, uNumSpriteObjects * sizeof(SpriteObject));
+  memcpy(pSpriteObjects.data(), pData + 4, uNumSpriteObjects * sizeof(SpriteObject));
   pData += 4 + uNumSpriteObjects * sizeof(SpriteObject);
 
   pGameLoadingUI_ProgressBar->Progress();
 
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto pItem = pSpriteObjects + i;
+    auto pItem = &pSpriteObjects[i];
  
     if (pItem->stru_24.uItemID && !(pItem->uAttributes & 0x0100))
     {
@@ -2912,7 +2912,7 @@
   pGameLoadingUI_ProgressBar->Progress();
 
   memcpy(&uNumChests, pData, 4);
-  memcpy(pChests, pData + 4, uNumChests * sizeof(Chest));
+  memcpy(pChests.data(), pData + 4, uNumChests * sizeof(Chest));
   pData += 4 + uNumChests * sizeof(Chest);
 
   pGameLoadingUI_ProgressBar->Progress();
@@ -4322,7 +4322,7 @@
     bUnderwater = 1;
     pGame->uFlags2 |= 8u;
   }
-  if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d23.blv") )
+  if ( !_stricmp(pCurrentMapName.data(), "out15.odm") || !_stricmp(pCurrentMapName.data(), "d23.blv") )
     bNoNPCHiring = 1;
   pPaletteManager->pPalette_tintColor[0] = 0;
   pPaletteManager->pPalette_tintColor[1] = 0;
@@ -4330,7 +4330,7 @@
   pPaletteManager->RecalculateAll();
   if ( qword_A750D8 )
     qword_A750D8 = 0i64;
-  v2 = pMapStats->GetMapInfo(pCurrentMapName);
+  v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
   v39 = v2;
   if ( v2 )
   {
@@ -4349,7 +4349,7 @@
   TryLoadLevelFromLOD();
   pStationaryLightsStack->uNumLightsActive = 0;
   v4 = pIndoor->Load(
-         pCurrentMapName,
+         pCurrentMapName.data(),
          (unsigned int)(signed __int64)((double)pParty->uTimePlayed * 0.234375) / 60 / 60 / 24 + 1,
          v1,
          (char *)&pDest)
@@ -4484,7 +4484,7 @@
   
   for (uint i = 0; i < uNumLevelDecorations; ++i)
   {
-    auto pDecortaion = pLevelDecorations + i;
+    auto pDecortaion = &pLevelDecorations[i];
     
     pDecorationList->InitializeDecorationSprite(pDecortaion->uDecorationDescID);
 
@@ -4546,7 +4546,7 @@
 
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto p = pSpriteObjects + i;
+    auto p = &pSpriteObjects[i];
     if (p->uObjectDescID)
     {
       auto uItemID = p->stru_24.uItemID;
@@ -4563,7 +4563,7 @@
   for (uint i = 0; i < uNumActors; ++i)
   //if ( (signed int)uNumActors > (signed int)v13 )
   {
-    Actor *pActor = pActors + i;
+    Actor *pActor = &pActors[i];
     //v26 = (char *)&pActors[0].uAttributes;
     //do
     //{