mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	różne poprawki, jest ogólnie lepiej
This commit is contained in:
		| @@ -347,7 +347,7 @@ void CAmbarCendamo::deh3m() | ||||
| 	} | ||||
| 	//allowed hero's abilities have been read | ||||
|  | ||||
| 	THC std::cout<<"Wczytywanie naglowka: "<<th.getDif()<<std::endl; | ||||
| 	THC std::cout<<"Reading header: "<<th.getDif()<<std::endl; | ||||
| 	int rumNr = readNormalNr(i,4);i+=4; | ||||
| 	for (int it=0;it<rumNr;it++) | ||||
| 	{ | ||||
| @@ -360,7 +360,7 @@ void CAmbarCendamo::deh3m() | ||||
| 			ourRumor.text+=bufor[i++]; | ||||
| 		map.rumors.push_back(ourRumor); //add to our list | ||||
| 	} | ||||
| 	THC std::cout<<"Wczytywanie plotek: "<<th.getDif()<<std::endl; | ||||
| 	THC std::cout<<"Reading rumors: "<<th.getDif()<<std::endl; | ||||
| 	i+=156; | ||||
| 	for (int c=0; c<map.width; c++) // reading terrain | ||||
| 	{ | ||||
| @@ -391,7 +391,7 @@ void CAmbarCendamo::deh3m() | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	THC std::cout<<"Wczytywanie terenu: "<<th.getDif()<<std::endl; | ||||
| 	THC std::cout<<"Reading terrain: "<<th.getDif()<<std::endl; | ||||
| 	int defAmount = bufor[i]; // liczba defow | ||||
| 	defAmount = readNormalNr(i); | ||||
| 	i+=4; | ||||
| @@ -465,12 +465,12 @@ void CAmbarCendamo::deh3m() | ||||
| 		} | ||||
| 	} | ||||
| 	SDL_FreeSurface(alphaTransSurf); | ||||
| 	THC std::cout<<"Wczytywanie defow: "<<th.getDif()<<std::endl; | ||||
| 	THC std::cout<<"Reading defs: "<<th.getDif()<<std::endl; | ||||
| 	////loading objects | ||||
| 	int howManyObjs = readNormalNr(i, 4); i+=4; | ||||
| 	for(int ww=0; ww<howManyObjs; ++ww) //comment this line to turn loading objects off | ||||
| 	{ | ||||
| 		std::cout << "object nr "<<ww<<std::endl; | ||||
| 		//std::cout << "object nr "<<ww<<std::endl; | ||||
| 		CObjectInstance nobj; //we will read this object | ||||
| 		nobj.id = CGameInfo::mainObj->objh->objInstances.size(); | ||||
| 		nobj.x = bufor[i++]; | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								CDefHandler.cpp
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								CDefHandler.cpp
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -20,7 +20,13 @@ void CGeneralTextHandler::load() | ||||
| 			break; | ||||
| 	} | ||||
| 	i+=2; | ||||
| 	loadToIt(cantAddManager, buf, i, 2); | ||||
| 	for(int jj=0; jj<764; ++jj) | ||||
| 	{ | ||||
| 		std::string buflet; | ||||
| 		loadToIt(buflet, buf, i, 2); | ||||
| 		allTexts.push_back(buflet); | ||||
| 	} | ||||
| 	/*loadToIt(cantAddManager, buf, i, 2); | ||||
| 	loadToIt(experienceLimitScenarioReached, buf, i, 2); | ||||
| 	loadToIt(heroExperienceInfo, buf, i, 2); | ||||
| 	loadToIt(perDay, buf, i, 2); | ||||
| @@ -74,6 +80,90 @@ void CGeneralTextHandler::load() | ||||
| 	loadToIt(cannotBuildBoat, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(systemUppercase, buf, i, 2); | ||||
| 	loadToIt(worldMapHelp, buf, i, 2); | ||||
| 	loadToIt(sureEndTurnHeroMayMove, buf, i, 2); | ||||
| 	loadToIt(diggingArtifactWholeDay, buf, i, 2); | ||||
| 	loadToIt(noRoomForArtifact, buf, i, 2); | ||||
| 	loadToIt(heroUncoveredThe, buf, i, 2); | ||||
| 	loadToIt(diggingNothing, buf, i, 2); | ||||
| 	loadToIt(tryLookingOnLand, buf, i, 2); | ||||
| 	loadToIt(unchartedTerritory, buf, i, 2); | ||||
| 	loadToIt(month, buf, i, 2); | ||||
| 	loadToIt(week, buf, i, 2); | ||||
| 	loadToIt(day, buf, i, 2); | ||||
| 	loadToIt(enemyViewTip, buf, i, 2); | ||||
| 	loadToIt(pingInfo, buf, i, 2); | ||||
| 	loadToIt(sureToRestart, buf, i, 2); | ||||
| 	loadToIt(sureToStartNewGame, buf, i, 2); | ||||
| 	loadToIt(sureQuit, buf, i, 2); | ||||
| 	loadToIt(dimensionDoorFiled, buf, i, 2); | ||||
| 	loadToIt(chooseBonus, buf, i, 2); | ||||
| 	loadToIt(ping, buf, i, 2); | ||||
| 	loadToIt(pingSomething, buf, i, 2); | ||||
| 	loadToIt(pingEveryone, buf, i, 2); | ||||
| 	loadToIt(score, buf, i, 2); | ||||
| 	loadToIt(autosaveUppercase, buf, i, 2); | ||||
| 	loadToIt(startingHeroB, buf, i, 2); | ||||
| 	loadToIt(heroSpecialityB, buf, i, 2); | ||||
| 	loadToIt(associatedCreaturesB, buf, i, 2); | ||||
| 	loadToIt(townAlignmentB, buf, i, 2); | ||||
| 	loadToIt(errorSendingDataKeepTrying, buf, i, 2); | ||||
| 	loadToIt(tooFewPalyersForMultiGame, buf, i, 2); | ||||
| 	loadToIt(artifactBonusB, buf, i, 2); | ||||
| 	loadToIt(goldBonusB, buf, i, 2); | ||||
| 	loadToIt(resourceBonusB, buf, i, 2); | ||||
| 	loadToIt(randomBonusB, buf, i, 2); | ||||
| 	loadToIt(fiveHundredToOneThousand, buf, i, 2); | ||||
| 	loadToIt(armageddonDamages, buf, i, 2); | ||||
| 	loadToIt(woodOreBonus, buf, i, 2); | ||||
| 	loadToIt(randomlyChoosenArtifact, buf, i, 2); | ||||
| 	loadToIt(disruptingRayReducesDefence, buf, i, 2); | ||||
| 	loadToIt(goldStartingBonus, buf, i, 2); | ||||
| 	loadToIt(woodOreStartingBonus, buf, i, 2); | ||||
| 	loadToIt(randomStartingBonus, buf, i, 2); | ||||
| 	loadToIt(youEliminatedFormGame, buf, i, 2); | ||||
| 	loadToIt(scoreToHallOfFame, buf, i, 2); | ||||
| 	loadToIt(trySearchingOnClearGround, buf, i, 2); | ||||
| 	loadToIt(sendingData, buf, i, 2); | ||||
| 	loadToIt(receivingData, buf, i, 2); | ||||
| 	loadToIt(chaosMp2, buf, i, 2); | ||||
| 	loadToIt(randomHeroB, buf, i, 2); | ||||
| 	loadToIt(randomStartingHeroInfo, buf, i, 2); | ||||
| 	loadToIt(randomTownB, buf, i, 2); | ||||
| 	loadToIt(randomStartingTownInfo, buf, i, 2); | ||||
| 	loadToIt(somethingSurrendersInfo, buf, i, 2); | ||||
| 	loadToIt(heroesCDNotFound, buf, i, 2); | ||||
| 	loadToIt(autosaving, buf, i, 2); | ||||
| 	loadToIt(playerexitUppercase, buf, i, 2); | ||||
| 	loadToIt(statusWindowTip, buf, i, 2); | ||||
| 	loadToIt(border, buf, i, 2); | ||||
| 	loadToIt(somethingAbsorbsMana, buf, i, 2); | ||||
| 	loadToIt(somethingsAbsorbMana, buf, i, 2); | ||||
| 	loadToIt(unableChangeHeroesDirectory, buf, i, 2); | ||||
| 	loadToIt(unableFindHeoresDataFiles, buf, i, 2); | ||||
| 	loadToIt(victoryAchievementText, buf, i, 2); | ||||
| 	loadToIt(somethingsRiseFromDeath, buf, i, 2); | ||||
| 	loadToIt(somethingRisesFormDeath, buf, i, 2); | ||||
| 	loadToIt(somethingDiesUnderGaze, buf, i, 2); | ||||
| 	loadToIt(somethingsDieUnderGaze, buf, i, 2); | ||||
| 	loadToIt(somethingTakesDefensiveStance, buf, i, 2); | ||||
| 	loadToIt(somethingsTakeDefensiveStance, buf, i, 2); | ||||
| 	loadToIt(somethingExp, buf, i, 2); | ||||
| 	loadToIt(nearestTownOccupied, buf, i, 2); | ||||
| 	loadToIt(noAvailableTown, buf, i, 2); | ||||
| 	loadToIt(heroTooTiredSpell, buf, i, 2); | ||||
| 	loadToIt(townGateCannotBeUsed, buf, i, 2); | ||||
| 	loadToIt(youHaveNoHeroes, buf, i, 2); | ||||
| 	loadToIt(heroHasCastSpell, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2); | ||||
| 	loadToIt(requires, buf, i, 2);*/ | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -2,15 +2,25 @@ | ||||
| #define CGENERALTEXTHANDLER_H | ||||
|  | ||||
| #include <string> | ||||
| #include <vector> | ||||
|  | ||||
| class CGeneralTextHandler | ||||
| class CGeneralTextHandler //Handles general texts | ||||
| { | ||||
| public: | ||||
| 	std::string cantAddManager, experienceLimitScenarioReached, heroExperienceInfo, perDay, or, somethingVanquished, lastTownLostInfo, heroesAbandonedYou, heroesAbandonedHim; | ||||
| 	std::vector<std::string> allTexts; | ||||
| 	/*std::string cantAddManager, experienceLimitScenarioReached, heroExperienceInfo, perDay, or, somethingVanquished, lastTownLostInfo, heroesAbandonedYou, heroesAbandonedHim; | ||||
| 	std::string couldNotSaveGame, errorOpeningFile, newgameUppercase, sureToDismissArmy, playersTurn, errorReceivingDataKeepTrying, somethingTheSomething, recruit, noRoomInGarrision, numberOFAdventuringHeroes, heroWithoutCreatures; | ||||
| 	std::string videoQuality, itemCantBeTraded, sureDismissHero, selectSpellTarget, invalidTeleportDestination, teleportHere, castSomething, castSomethingOnSomething, sureRetreat, notEnoughGold, capturedEnemyArtifact, none; | ||||
| 	std::string surrenderProposal, highMoraleNextAttack, lowMoraleFreeze, makeRoomInArmyForSomething, attackSomethingSomethingDamage, shootSomethingOneShootLeftSomethingDamage; | ||||
| 	std::string campaignDescription, somethingIsActive, sessionName, userName, creature, creatures, badLuckOnSomething, goodLuckOnSomething, treasure, somethingSomethingsUnderAttack, town, hero, townScreen, cannotBuildBoat, requires, systemUppercase; | ||||
| 	std::string worldMapHelp, sureEndTurnHeroMayMove, diggingArtifactWholeDay, noRoomForArtifact, heroUncoveredThe, diggingNothing, tryLookingOnLand, unchartedTerritory; | ||||
| 	std::string month, week, day, enemyViewTip, pingInfo, sureToRestart, sureToStartNewGame, sureQuit, dimensionDoorFiled, chooseBonus, ping, pingSomething, pingEveryone, score, autosaveUppercase; | ||||
| 	std::string startingHeroB, heroSpecialityB, associatedCreaturesB, townAlignmentB, errorSendingDataKeepTrying, tooFewPalyersForMultiGame, artifactBonusB, goldBonusB, resourceBonusB, randomBonusB; | ||||
| 	std::string fiveHundredToOneThousand, armageddonDamages, woodOreBonus, randomlyChoosenArtifact, disruptingRayReducesDefence, goldStartingBonus, woodOreStartingBonus, randomStartingBonus; | ||||
| 	std::string youEliminatedFormGame, scoreToHallOfFame, trySearchingOnClearGround, sendingData, receivingData, chaosMp2, randomHeroB, randomStartingHeroInfo, randomTownB, randomStartingTownInfo, somethingSurrendersInfo; | ||||
| 	std::string heroesCDNotFound, autosaving, playerexitUppercase, statusWindowTip, border, somethingAbsorbsMana, somethingsAbsorbMana, unableChangeHeroesDirectory, unableFindHeoresDataFiles, victoryAchievementText; | ||||
| 	std::string somethingsRiseFromDeath, somethingRisesFormDeath, somethingDiesUnderGaze, somethingsDieUnderGaze, somethingTakesDefensiveStance, somethingsTakeDefensiveStance, somethingExp, nearestTownOccupied, noAvailableTown, heroTooTiredSpell, townGateCannotBeUsed, youHaveNoHeroes, heroHasCastSpell; | ||||
| 	std::string doYouWishToSaveSomethingsArmy, problemsWithInputDevices, problemsWithSound, problemsWithMouse, problemsWithWindows, abandonedShipyard, spellFailed, somethingPauses, somethingsPause, somethingLevelSomething, somethingStudiedMagic, learnsSpeced, andSpaced, fromSomethingSpaced;*/ | ||||
|  | ||||
| 	void loadToIt(std::string & dest, std::string & src, int & iter, int mode = 0); //mode 0 - dump to tab, dest to tab, dump to eol //mode 1 - dump to tab, src to eol //mode 2 - copy to tab, dump to eol //mode 3 - copy to eol | ||||
| 	void load(); | ||||
|   | ||||
| @@ -444,7 +444,6 @@ std::vector<CDefHandler *> CLodHandler::extractManyFiles(std::vector<std::string | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	FLOD.close(); | ||||
| 	//std::cout<<"*** Archive: "+FName+" closed\n"; | ||||
| 	return ret; | ||||
| } | ||||
|   | ||||
							
								
								
									
										29
									
								
								CMT.cpp
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								CMT.cpp
									
									
									
									
									
								
							| @@ -247,17 +247,17 @@ int _tmain(int argc, _TCHAR* argv[]) | ||||
| 		//	fclose(ko);fclose(zr); | ||||
| 		//} | ||||
| 		SDL_WM_SetCaption(NAME,""); //set window title | ||||
| 		CGameInfo * cgi = new CGameInfo; | ||||
| 		CGameInfo * cgi = new CGameInfo; //contains all global informations about game (texts, lodHandlers, map handler itp.) | ||||
| 		CGameInfo::mainObj = cgi; | ||||
| 		cgi->mush = mush; | ||||
| 		THC std::cout<<"Inicjalizacja ekranu, czcionek, obslugi dzwieku: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Initializing screen, fonts and sound handling: "<<tmh.getDif()<<std::endl; | ||||
| 		cgi->spriteh = new CLodHandler; | ||||
| 		cgi->spriteh->init(std::string("newH3sprite.lod")); | ||||
| 		cgi->bitmaph = new CLodHandler; | ||||
| 		cgi->bitmaph->init(std::string("newH3bitmap.lod")); | ||||
| 		THC std::cout<<"Ladowanie .lodow: "<<tmh.getDif()<<std::endl; | ||||
| 		CPreGame * cpg = new CPreGame(); | ||||
| 		THC std::cout<<"Razem inicjalizacja CPreGame: "<<tmh.getDif()<<std::endl; | ||||
| 		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; | ||||
| 		cpg->mush = mush; | ||||
| 		cpg->runLoop(); | ||||
| 		THC tmh.getDif(); | ||||
| @@ -315,8 +315,9 @@ int _tmain(int argc, _TCHAR* argv[]) | ||||
| 		cgi->dobjinfo = new CDefObjInfoHandler; | ||||
| 		cgi->dobjinfo->load(); | ||||
|  | ||||
| 		THC std::cout<<"Inicjalizacja wszelakich handlerow: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Handlers initailization: "<<tmh.getDif()<<std::endl; | ||||
| 		std::string mapname; | ||||
| 		CPG->ourScenSel->mapsel.selected = 1; | ||||
| 		if (CPG) mapname = CPG->ourScenSel->mapsel.ourMaps[CPG->ourScenSel->mapsel.selected].filename; | ||||
| 		gzFile map = gzopen(mapname.c_str(),"rb"); | ||||
| 		std::string mapstr;int pom; | ||||
| @@ -328,23 +329,23 @@ int _tmain(int argc, _TCHAR* argv[]) | ||||
| 		//CAmbarCendamo * ac = new CAmbarCendamo("4gryf"); //4gryf | ||||
| 		CMapHeader * mmhh = new CMapHeader(ac->bufor); //czytanie nag��wka | ||||
| 		cgi->ac = ac; | ||||
| 		THC std::cout<<"Wczytywanie pliku: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Reading file: "<<tmh.getDif()<<std::endl; | ||||
| 		ac->deh3m(); | ||||
| 		THC std::cout<<"Rozpoznawianie pliku lacznie: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Detecting file (together): "<<tmh.getDif()<<std::endl; | ||||
| 		ac->loadDefs(); | ||||
| 		THC std::cout<<"Wczytywanie defow terenu: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Reading terrain defs: "<<tmh.getDif()<<std::endl; | ||||
| 		CMapHandler * mh = new CMapHandler(); | ||||
| 		mh->reader = ac; | ||||
| 		THC std::cout<<"Stworzenie mapHandlera: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Creating mapHandler: "<<tmh.getDif()<<std::endl; | ||||
| 		mh->init(); | ||||
| 		THC std::cout<<"Inicjalizacja mapHandlera: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Initializing mapHandler: "<<tmh.getDif()<<std::endl; | ||||
| 		//SDL_Rect * sr = new SDL_Rect(); sr->h=64;sr->w=64;sr->x=0;sr->y=0; | ||||
| 		SDL_Surface * teren = mh->terrainRect(xx,yy,25,19); | ||||
| 		THC std::cout<<"Przygotowanie terenu do wyswietlenia: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Preparing terrain to display: "<<tmh.getDif()<<std::endl; | ||||
| 		SDL_BlitSurface(teren,NULL,ekran,NULL); | ||||
| 		SDL_FreeSurface(teren); | ||||
| 		SDL_UpdateRect(ekran, 0, 0, ekran->w, ekran->h); | ||||
| 		THC std::cout<<"Wyswietlenie terenu: "<<tmh.getDif()<<std::endl; | ||||
| 		THC std::cout<<"Displaying terrain: "<<tmh.getDif()<<std::endl; | ||||
|  | ||||
| 		//SDL_Surface * ss = ac->defs[0]->ourImages[0].bitmap; | ||||
| 		//SDL_BlitSurface(ss, NULL, ekran, NULL); | ||||
| @@ -523,7 +524,7 @@ int _tmain(int argc, _TCHAR* argv[]) | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		printf("Co� posz�o nie tak: %s/n", SDL_GetError()); | ||||
| 		printf("Something was wrong: %s/n", SDL_GetError()); | ||||
| 		return -1; | ||||
| 	} | ||||
| } | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								CPreGame.cpp
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								CPreGame.cpp
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user