mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	New non battle stack class. (Base for future improved bonus system, stack exp / arts)
Fixed #443
This commit is contained in:
		| @@ -3652,12 +3652,12 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult &br, const SDL_Rect | ||||
| 	{ | ||||
| 		int bestMonsterID = -1; | ||||
| 		int bestPower = 0; | ||||
| 		for(std::map<si32,std::pair<ui32,si32> >::const_iterator it = owner->army1->slots.begin(); it!=owner->army1->slots.end(); ++it) | ||||
| 		for(TSlots::const_iterator it = owner->army1->slots.begin(); it!=owner->army1->slots.end(); ++it) | ||||
| 		{ | ||||
| 			if( CGI->creh->creatures[it->first].AIValue > bestPower) | ||||
| 			if( it->second.type->AIValue > bestPower) | ||||
| 			{ | ||||
| 				bestPower = CGI->creh->creatures[it->first].AIValue; | ||||
| 				bestMonsterID = it->first; | ||||
| 				bestPower = it->second.type->AIValue; | ||||
| 				bestMonsterID = it->second.type->idNumber; | ||||
| 			} | ||||
| 		} | ||||
| 		SDL_BlitSurface(graphics->bigImgs[bestMonsterID], NULL, background, &genRect(64, 58, 21, 38)); | ||||
| @@ -3674,12 +3674,12 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult &br, const SDL_Rect | ||||
| 	{ | ||||
| 		int bestMonsterID = -1; | ||||
| 		int bestPower = 0; | ||||
| 		for(std::map<si32,std::pair<ui32,si32> >::const_iterator it = owner->army2->slots.begin(); it!=owner->army2->slots.end(); ++it) | ||||
| 		for(TSlots::const_iterator it = owner->army2->slots.begin(); it!=owner->army2->slots.end(); ++it) | ||||
| 		{ | ||||
| 			if( CGI->creh->creatures[it->second.first].AIValue > bestPower) | ||||
| 			if( it->second.type->AIValue > bestPower) | ||||
| 			{ | ||||
| 				bestPower = CGI->creh->creatures[it->second.first].AIValue; | ||||
| 				bestMonsterID = it->second.first; | ||||
| 				bestPower = it->second.type->AIValue; | ||||
| 				bestMonsterID = it->second.type->idNumber; | ||||
| 			} | ||||
| 		} | ||||
| 		SDL_BlitSurface(graphics->bigImgs[bestMonsterID], NULL, background, &genRect(64, 58, 391, 38)); | ||||
|   | ||||
| @@ -528,6 +528,8 @@ void startGame(StartInfo * options) | ||||
| 		ev.user.code = 1; | ||||
| 		SDL_PushEvent(&ev); | ||||
| 	} | ||||
| 	else | ||||
| 		setResolution = true; | ||||
|  | ||||
| 	client = new CClient; | ||||
| 	if(options->mode == 0) //new game | ||||
|   | ||||
| @@ -487,17 +487,13 @@ void CGarrisonInt::createSlots() | ||||
| 	if(set1) | ||||
| 	{ | ||||
| 		sup = new std::vector<CGarrisonSlot*>(7,(CGarrisonSlot *)(NULL)); | ||||
| 		for | ||||
| 			(std::map<si32,std::pair<ui32,si32> >::const_iterator i=set1->slots.begin(); | ||||
| 			i!=set1->slots.end(); i++) | ||||
| 		{ | ||||
| 			(*sup)[i->first] = | ||||
| 				new CGarrisonSlot(this, pos.x + (i->first*(w+interx)), pos.y,i->first, 0,  | ||||
| 									&CGI->creh->creatures[i->second.first],i->second.second); | ||||
| 		} | ||||
| 		for(TSlots::const_iterator i=set1->slots.begin(); i!=set1->slots.end(); i++) | ||||
| 			(*sup)[i->first] =	new CGarrisonSlot(this, pos.x + (i->first*(w+interx)), pos.y, i->first, 0, i->second.type,i->second.count); | ||||
|  | ||||
| 		for(int i=0; i<sup->size(); i++) | ||||
| 			if((*sup)[i] == NULL) | ||||
| 				(*sup)[i] = new CGarrisonSlot(this, pos.x + (i*(w+interx)), pos.y,i,0,NULL, 0); | ||||
|  | ||||
| 		if (shiftPos) | ||||
| 			for (int i=shiftPos; i<sup->size(); i++) | ||||
| 			{ | ||||
| @@ -508,13 +504,10 @@ void CGarrisonInt::createSlots() | ||||
| 	if(set2) | ||||
| 	{ | ||||
| 		sdown = new std::vector<CGarrisonSlot*>(7,(CGarrisonSlot *)(NULL)); | ||||
| 		for | ||||
| 			(std::map<si32,std::pair<ui32,si32> >::const_iterator i=set2->slots.begin(); | ||||
| 			i!=set2->slots.end(); i++) | ||||
| 		for(TSlots::const_iterator i=set2->slots.begin(); i!=set2->slots.end(); i++) | ||||
| 		{ | ||||
| 			(*sdown)[i->first] = | ||||
| 				new CGarrisonSlot(this, pos.x + (i->first*(w+interx)) + garOffset.x, pos.y + garOffset.y,i->first,1,  | ||||
| 									&CGI->creh->creatures[i->second.first],i->second.second); | ||||
| 				new CGarrisonSlot(this, pos.x + (i->first*(w+interx)) + garOffset.x, pos.y + garOffset.y,i->first,1, i->second.type,i->second.count); | ||||
| 		} | ||||
| 		for(int i=0; i<sdown->size(); i++) | ||||
| 			if((*sdown)[i] == NULL) | ||||
|   | ||||
| @@ -51,17 +51,17 @@ SDL_Surface * Graphics::drawHeroInfoWin(const InfoAboutHero &curh) | ||||
| 	blitAt(graphics->portraitLarge[curh.portrait],11,12,ret); //portrait | ||||
|  | ||||
| 	//army | ||||
| 	for (std::map<si32,std::pair<ui32,si32> >::const_iterator i=curh.army.slots.begin(); i!=curh.army.slots.end();i++) | ||||
| 	for (TSlots::const_iterator i = curh.army.slots.begin(); i!=curh.army.slots.end();i++) | ||||
| 	{ | ||||
| 		blitAt(graphics->smallImgs[(*i).second.first],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret); | ||||
| 		blitAt(graphics->smallImgs[(*i).second.type->idNumber],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret); | ||||
| 		if(curh.details) | ||||
| 		{ | ||||
| 			SDL_itoa((*i).second.second,buf,10); | ||||
| 			SDL_itoa((*i).second.count,buf,10); | ||||
| 			printAtMiddle(buf,slotsPos[(*i).first].first+17,slotsPos[(*i).first].second+41,FONT_TINY,zwykly,ret); | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			printAtMiddle(VLC->generaltexth->arraytxt[174 + 3*i->second.second],slotsPos[(*i).first].first+17,slotsPos[(*i).first].second+41,FONT_TINY,zwykly,ret); | ||||
| 			printAtMiddle(VLC->generaltexth->arraytxt[174 + 3*i->second.count],slotsPos[(*i).first].first+17,slotsPos[(*i).first].second+41,FONT_TINY,zwykly,ret); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @@ -108,15 +108,15 @@ SDL_Surface * Graphics::drawTownInfoWin( const InfoAboutTown & curh ) | ||||
| 	int pom = curh.fortLevel - 1; if(pom<0) pom = 3; //fort pic id | ||||
| 	blitAt(forts->ourImages[pom].bitmap,115,42,ret); //fort | ||||
|  | ||||
| 	for (std::map<si32,std::pair<ui32,si32> >::const_iterator i=curh.army.slots.begin(); i!=curh.army.slots.end();i++) | ||||
| 	for (TSlots::const_iterator i=curh.army.slots.begin(); i!=curh.army.slots.end();i++) | ||||
| 	{ | ||||
| 		//if(!i->second.second) | ||||
| 		//	continue; | ||||
| 		blitAt(graphics->smallImgs[(*i).second.first],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret); | ||||
| 		blitAt(graphics->smallImgs[(*i).second.type->idNumber],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret); | ||||
| 		if(curh.details) | ||||
| 		{ | ||||
| 			// Show exact creature amount. | ||||
| 			SDL_itoa((*i).second.second,buf,10); | ||||
| 			SDL_itoa((*i).second.count,buf,10); | ||||
| 			printAtMiddle(buf,slotsPos[(*i).first].first+17,slotsPos[(*i).first].second+41,FONT_TINY,zwykly,ret); | ||||
| 		} | ||||
| 		else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user