Parcourir la source

Added hero selection (buggy)

Michał W. Urbańczyk il y a 18 ans
Parent
commit
40607240b4
4 fichiers modifiés avec 12 ajouts et 8 suppressions
  1. 10 7
      CMT.cpp
  2. BIN
      CPreGame.cpp
  3. 1 1
      CPreGame.h
  4. 1 0
      global.h

+ 10 - 7
CMT.cpp

@@ -268,6 +268,15 @@ int _tmain(int argc, _TCHAR* argv[])
 
 		cgi->townh = new CTownHandler;
 		cgi->townh->loadNames();
+
+		CAbilityHandler * abilh = new CAbilityHandler;
+		abilh->loadAbilities();
+		cgi->abilh = abilh;
+		CHeroHandler * heroh = new CHeroHandler;
+		heroh->loadHeroes();
+		heroh->loadPortraits();
+		cgi->heroh = heroh;
+
 		THC std::cout<<"Loading .lods: "<<tmh.getDif()<<std::endl;
 		CPreGame * cpg = new CPreGame(); //main menu and submenus
 		THC std::cout<<"Initialization CPreGame (together): "<<tmh.getDif()<<std::endl;
@@ -311,13 +320,7 @@ int _tmain(int argc, _TCHAR* argv[])
 		CCreatureHandler * creh = new CCreatureHandler;
 		creh->loadCreatures();
 		cgi->creh = creh;
-		CAbilityHandler * abilh = new CAbilityHandler;
-		abilh->loadAbilities();
-		cgi->abilh = abilh;
-		CHeroHandler * heroh = new CHeroHandler;
-		heroh->loadHeroes();
-		heroh->loadPortraits();
-		cgi->heroh = heroh;
+
 		CSpellHandler * spellh = new CSpellHandler;
 		spellh->loadSpells();
 		cgi->spellh = spellh;

BIN
CPreGame.cpp


+ 1 - 1
CPreGame.h

@@ -60,7 +60,7 @@ class Options : public PreGameTab
 		PlayerOptions(int serial, int player);
 		Ecolor color;
 		//SDL_Surface * bg;
-		OptionSwitch left, right;
+		OptionSwitch left, right, Hleft, Hright;
 		int nr;
 	};
 public:

+ 1 - 0
global.h

@@ -19,6 +19,7 @@ enum ElossCon {lossCastle, lossHero, timeExpires, lossStandard=255};
 
 const int F_NUMBER = 9; //factions quantity
 const int PLAYER_LIMIT = 8; //player limit per map
+const int HEROES_PER_TYPE=8; //amount of heroes of each type
 
 #define DEFBYPASS
 #endif //GLOBAL_H