diff mm7_3.cpp @ 1202:0dbf6c4dd029

arrays to std::arrays phase 1
author Grumpy7
date Sat, 08 Jun 2013 21:33:22 +0200
parents 15ad868d972f
children 8c02e6f74b29
line wrap: on
line diff
--- a/mm7_3.cpp	Sat Jun 08 19:34:33 2013 +0200
+++ b/mm7_3.cpp	Sat Jun 08 21:33:22 2013 +0200
@@ -11849,7 +11849,7 @@
 
   if (sizeof(pLevelStrOffsets) != 2000)
     Log::Warning(L"pLevelStrOffsets: deserialization warning");
-  memset(pLevelStrOffsets, 0, 2000);
+  memset(pLevelStrOffsets.data(), 0, 2000);
   
   max_string_length = 0;
   string_num = 1;
@@ -11937,7 +11937,7 @@
 	{
 		auto pEvent = pLevelEVT_Index[i];
 
-		auto _evt = (_evt_raw *)(pLevelEVT + pEvent.uEventOffsetInEVT);
+		auto _evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
 
 		if (_evt->_e_type == EVENT_PlaySound)
 		{
@@ -12067,10 +12067,10 @@
   char pContainerName[120]; // [sp+8h] [bp-98h]@1
 
   sprintf(pContainerName, "%s.evt", pLevelName);
-  uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT, 0x2400u);
+  uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT.data(), 0x2400u);
 
   sprintf(pContainerName, "%s.str", pLevelName);
-  uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr, 0x2400u);
+  uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr.data(), 0x2400u);
   if (uLevelStrFileSize)
     LoadLevel_InitializeLevelStr();
 }
@@ -12424,9 +12424,9 @@
   if ( !npc_event_id )
     return 0;
   evt_seq_num = entry_line;
-  pSomeOtherEVT = pGlobalEVT;
+  pSomeOtherEVT = pGlobalEVT.data();
   uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents;
-  memcpy(pSomeOtherEVT_Events, pGlobalEVT_Index, sizeof(EventIndex)*4400);
+  memcpy(pSomeOtherEVT_Events.data(), pGlobalEVT_Index.data(), sizeof(EventIndex)*4400);
   npc_activity = 1;
   ready_to_exit = false;
   if ( uSomeOtherEVT_NumEvents <= 0 )
@@ -12785,7 +12785,7 @@
     {
       if ( (signed int)uNumActors > Standing )
       {
-        v6 = pActors;//[0].uAttributes;
+        v6 = pActors.data();//[0].uAttributes;
         do
         {
           if ( v6->uGroup == v4 )
@@ -12808,7 +12808,7 @@
       v7 = uNumActors;
       if ( (signed int)uNumActors > Standing )
       {
-        v8 = pActors;//[0].uAIState;
+        v8 = pActors.data();//[0].uAIState;
         do
         {
           if ( v8->uGroup == v4 )
@@ -13731,7 +13731,7 @@
     v5 = 0;
     if ( (signed int)uNumLevelDecorations > 0 )
     {
-      v6 = pLevelDecorations;
+      v6 = pLevelDecorations.data();
       while ( v6->uDecorationDescID != (signed __int16)v4 )
       {
         ++v5;
@@ -14051,7 +14051,7 @@
   ai_arrays_size = 0;
   for (uint i = 0; i < uNumActors; ++i)
   {
-    auto actor = pActors + i;
+    auto actor = &pActors[i];
 
     actor->uAttributes &= 0xFFFFFBFF;
     if (!actor->CanAct())
@@ -14227,7 +14227,7 @@
   v43 = 0;
   if ( (signed int)uNumActors > 0 )
   {
-    v0 = pActors;//[0].uAttributes;
+    v0 = pActors.data();//[0].uAttributes;
     do
     {
       BYTE1(v0->uAttributes) &= 0xFBu;
@@ -14344,7 +14344,7 @@
   ai_arrays_size = v19;
   if ( (signed int)uNumActors > 0 )
   {
-    v24 = pActors;//[0].uAttributes;
+    v24 = pActors.data();//[0].uAttributes;
     do
     {
       if ( v24->CanAct() && v24->uSectorID == v37 )