diff Spells.cpp @ 1206:ab6560001f5b

arrays to std::arrays phase 2 - some more arrays converted
author Grumpy7
date Sun, 09 Jun 2013 01:10:49 +0200
parents 8c02e6f74b29
children 86a83e12d795 dcc52e17b517
line wrap: on
line diff
--- a/Spells.cpp	Sun Jun 09 00:30:48 2013 +0200
+++ b/Spells.cpp	Sun Jun 09 01:10:49 2013 +0200
@@ -15,21 +15,21 @@
 
 
 
-TownPortalData TownPortalList[6] = //4ECBB8
-{
+std::array<TownPortalData, 6> TownPortalList = //4ECBB8
+{{
  {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0},
  {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0},
  {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0},
  {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0},
  {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0},
  {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0}
-} ;
+}} ;
 
 struct SpellStats *pSpellStats;
 
 
-stru324_spell stru_4E3ACC[103] =
-{
+std::array<stru324_spell, 103> stru_4E3ACC =
+{{
   {10, 0},
   {1000, 0}, {1010, 0}, {1020, 0}, {1030, 0}, {1040, 0}, {1050, 0}, {1060, 0}, {1070, 0}, {1080, 0}, {1090, 0}, {1100, 0},
   {2000, 0}, {2010, 0}, {2020, 0}, {2030, 0}, {2040, 0}, {2050, 0}, {2060, 0}, {2070, 0}, {2080, 0}, {2090, 0}, {2100, 0},
@@ -43,9 +43,9 @@
   {545, 0},
   {545, 0},
   {555, 0}
-};
+}};
  //9 spellbook pages  11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1!
-SpellData pSpellDatas[100]={
+std::array<SpellData, 100> pSpellDatas={{
 					 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
 
 					 {1, 1, 1, 1, 60, 60, 60, 40, 0, 0},//0
@@ -155,10 +155,10 @@
 	                 {50, 50, 50, 50, 120, 120, 120, 100, 6400, 0},
 	                 {55, 55, 55, 55, 250, 250, 250, 250, 306, 0},
 	                 {60, 60, 60, 60, 300, 300, 300, 300, 2073, 0}
-	};
+  }};
 
 
-unsigned int wand_spell_ids[25] =
+std::array<unsigned int, 25> wand_spell_ids =
 {
 // 135 Wand of Fire               136 Wand of Sparks             137 Wand of Poison             138 Wand of Stunning           139 Wand of Harm
   SPELL_FIRE_FIRE_BOLT,           SPELL_AIR_SPARKS,              SPELL_WATER_POISON_SPRAY,      SPELL_EARTH_STUN,              SPELL_BODY_HARM,
@@ -186,43 +186,43 @@
 		{0,  9,  3,  7,  1,  5,  2, 10, 11,  8,  6,  4}
 }};
 
-	struct SpellBookIconPos pIconPos[9][12]={
+	std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos={{
 
-		{{  0,   0}, { 17,  13}, {115,   2}, {217,  15},
-		 {299,   6}, { 28, 125}, {130, 133}, {294, 114},
-		 { 11, 232}, {134, 233}, {237, 171}, {296, 231}},
+		 {  0,   0,  17,  13, 115,   2, 217,  15,
+		 299,   6,  28, 125, 130, 133, 294, 114,
+      11, 232, 134, 233, 237, 171, 296, 231},
 
-		{{  0,   0},  {19,   9}, {117,   3}, {206,  13},	
-		 {285,   7},  {16, 123}, {113, 101}, {201, 118},
-		 {317, 110},  {11, 230}, {149, 236}, {296, 234}},
+		 {  0,   0, 19,   9, 117,   3, 206,  13,	
+		 285,   7,  16, 123, 113, 101, 201, 118,
+		 317, 110,  11, 230, 149, 236, 296, 234},
 
-		{{  0,   0},  {17,   9}, {140,   0}, {210,  34},
-		 {293,   5},  {15,  98}, { 78, 121}, {175, 136},
-		 {301, 115},  {15, 226}, {154, 225}, {272, 220}},
+		 {  0,   0,  17,   9, 140,   0, 210,  34,
+		 293,   5,   15,  98,  78, 121, 175, 136,
+     301, 115,   15, 226, 154, 225, 272, 220},
 
-		{{ 0,    0}, {  7,   9}, {156,   2}, {277,   9},
-		 { 11, 117}, {111,  82}, {180, 102}, {303, 108},
-		 { 10, 229}, {120, 221}, {201, 217}, {296, 225}},
+		 { 0,    0,   7,   9, 156,   2, 277,   9,
+		  11, 117, 111,  82, 180, 102, 303, 108,
+		  10, 229, 120, 221, 201, 217, 296, 225},
 
-		{{  0,   0},  {18,   8}, { 89,  15}, {192,  14},
-		 {292,   7},  {22, 129}, {125, 146}, {217, 136},
-		 {305, 115},  {22, 226}, {174, 237}, {290, 231}},
+		 {  0,   0,  18,   8,  89,  15, 192,  14,
+		 292,   7,  22, 129, 125, 146, 217, 136,
+		 305, 115,  22, 226, 174, 237, 290, 231},
 
-		{{ 0,    0}, { 18,  12}, {148,   9}, {292,   7},
-		 { 17, 122}, {121,  99}, {220,  87}, {293, 112},
-		 { 13, 236}, {128, 213}, {220, 223}, {315, 223}},
+     { 0,    0,  18,  12, 148,   9, 292,   7,
+     17, 122, 121,  99, 220,  87, 293, 112,
+     13, 236, 128, 213, 220, 223, 315, 223},
 
-		{{  0,   0},  {23,  14}, {127,   8}, {204, 0},
-		 {306,   8},  {14, 115}, {122, 132}, {200, 116},
-		 {293, 122},  {20, 228}, {154, 228}, {294, 239}},
+     {  0,   0,  23,  14, 127,   8, 204, 0,
+     306,   8,  14, 115, 122, 132, 200, 116,
+     293, 122,  20, 228, 154, 228, 294, 239},
 
-		{{  0,   0}, { 19,  14}, {124,  10}, {283,  12},
-		 {  8, 105}, {113,  89}, {190,  82}, {298, 108},
-		 { 18, 181}, {101, 204}, {204, 203}, {285, 218}},
+     {  0,   0,  19,  14, 124,  10, 283,  12,
+     8, 105, 113,  89, 190,  82, 298, 108,
+     18, 181, 101, 204, 204, 203, 285, 218},
 
-		{{  0,   0}, {18,  17}, {110,  16}, {201,  15},
-		 {307,  15}, {18, 148}, {125, 166}, {201, 123},
-		 {275, 120}, {28, 235}, {217, 222}, {324, 216}}};
+		 {  0,   0, 18,  17, 110,  16, 201,  15,
+		 307,  15, 18, 148, 125, 166, 201, 123,
+     275, 120, 28, 235, 217, 222, 324, 216}}};
 
 
 //----- (0042EB31) --------------------------------------------------------