Michał W. Urbańczyk 16 лет назад
Родитель
Сommit
9dbe9bd277

+ 6 - 8
AI/GeniusAI/genius.vcproj

@@ -41,13 +41,13 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
+				AdditionalIncludeDirectories="G:\vcmt\repa\include"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GENIUS_EXPORTS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="1"
+				WarningLevel="4"
 				DebugInformationFormat="4"
 			/>
 			<Tool
@@ -64,7 +64,7 @@
 				AdditionalDependencies="VCMI_lib.lib"
 				OutputFile="../GeniusAI.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				OptimizeReferences="0"
@@ -120,9 +120,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="3"
 				EnableIntrinsicFunctions="true"
-				OmitFramePointers="true"
-				EnableFiberSafeOptimizations="true"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
+				AdditionalIncludeDirectories="&quot;D:\!GameDevelopment\VCMI\libs\include&quot;;G:\vcmt\repa\include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GENIUS_EXPORTS"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
@@ -142,9 +140,9 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="VCMI_lib.lib"
-				OutputFile="F:\3DO\Heroes3\AI\GeniusAI.dll"
+				OutputFile="../GeniusAI.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateManifest="false"
 				GenerateDebugInformation="true"
 				SubSystem="2"

+ 15 - 7
CPlayerInterface.cpp

@@ -1947,7 +1947,6 @@ void CPlayerInterface::heroGotLevel(const CGHeroInstance *hero, int pskill, std:
 			showingDialog->cond.wait(un);
 	}
 	boost::unique_lock<boost::recursive_mutex> un(*pim);
-	LOCPLINT->showingDialog->setn(true);
 	CLevelWindow *lw = new CLevelWindow(hero,pskill,skills,callback);
 	curint->deactivate();
 	lw->activate();
@@ -2101,6 +2100,7 @@ void CPlayerInterface::actionStarted(const BattleAction* action)
 			battleInt->defendingHero->setPhase(4);
 		else
 			battleInt->attackingHero->setPhase(4);
+		return;
 	}
 	if(!stack)
 	{
@@ -3582,18 +3582,17 @@ void CLevelWindow::close()
 	}
 	delete this;
 	LOCPLINT->curint->activate();
+	LOCPLINT->showingDialog->setn(false);
 }
 CLevelWindow::CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback)
 {
+	LOCPLINT->showingDialog->setn(true);
 	heroType = hero->subID;
 	cb = callback;
 	for(int i=0;i<skills.size();i++)
-		comps.push_back(new CSelectableComponent(SComponent::secskill44,skills[i],hero->getSecSkillLevel(skills[i])+1,boost::bind(&CLevelWindow::selectionChanged,this,i)));
-	if(comps.size())
 	{
-		comps[0]->assignedKeys.insert(SDLK_1);
-		if(comps.size() > 1)
-			comps[1]->assignedKeys.insert(SDLK_2);
+		comps.push_back(new CSelectableComponent(SComponent::secskill44,skills[i],hero->getSecSkillLevel(skills[i])+1,boost::bind(&CLevelWindow::selectionChanged,this,i)));
+		comps.back()->assignedKeys.insert(SDLK_1 + i);
 	}
 	bitmap = BitmapHandler::loadBitmap("LVLUPBKG.bmp");
 	graphics->blueToPlayersAdv(bitmap,hero->tempOwner);
@@ -3603,7 +3602,6 @@ CLevelWindow::CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<u
 	pos.w = bitmap->w;
 	pos.h = bitmap->h;
 	ok = new AdventureMapButton("","",boost::bind(&CLevelWindow::close,this),pos.x+297,pos.y+413,"IOKAY.DEF",SDLK_RETURN);
-	ok->block(true);
 	//draw window
 	char buf[100], buf2[100];
 	strcpy(buf2,CGI->generaltexth->allTexts[444].c_str()); //%s has gained a level.
@@ -3631,6 +3629,16 @@ CLevelWindow::CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<u
 			curx += ort->w + 18;
 		}
 	}
+
+	if(comps.size() > 1)
+	{
+		ok->block(true);
+	}
+	else if(comps.size() == 1)
+	{
+		comps[0]->select(true);
+	}
+
 	SDL_FreeSurface(ort);
 
 }

+ 810 - 810
CPlayerInterface.h

@@ -1,813 +1,813 @@
-#ifndef __CPLAYERINTERFACE_H__
-#define __CPLAYERINTERFACE_H__
-#include "global.h"
-#include "CGameInterface.h"
-#include "SDL_framerate.h"
-#include <map>
-#include <list>
-
-#ifdef __GNUC__
-#define sprintf_s snprintf 
-#endif
-
-class CDefEssential;
-class AdventureMapButton;
-class CHighlightableButtonsGroup;
-class CDefHandler;
-struct HeroMoveDetails;
-class CDefEssential;
-class CGHeroInstance;
-class CAdvMapInt;
-class CCastleInterface;
-class CBattleInterface;
-class CStack;
-class SComponent;
-class CCreature;
-struct SDL_Surface;
-struct CPath;
-class CCreatureAnimation;
-class CSelectableComponent;
-class CCreatureSet;
-class CGObjectInstance;
-class CSlider;
-struct UpgradeInfo;
-template <typename T> struct CondSh;
-
-namespace boost
-{
-	class mutex;
-	class recursive_mutex;
-};
-
-struct Point
-{
-	int x, y;
-
-	//constructors
-	Point(){};
-	Point(int X, int Y)
-		:x(X),y(Y)
-	{};
-	Point(const int3 &a)
-		:x(a.x),y(a.y)
-	{}
-
-
-
-	Point operator+(const Point &b)
-	{
-		return Point(x+b.x,y+b.y);
-	}
-	Point operator-(const Point &b)
-	{
-		return Point(x+b.x,y+b.y);
-	}
-	bool operator<(const Point &b)
-	{
-		return x < b.x   &&   y < b.y;
-	}
-};
-
-struct Rect : public SDL_Rect
-{
-	Rect()
-	{
-		x = y = w = h = -1;
-	}
-	Rect(int X, int Y, int W, int H)
-	{
-		x = X;
-		y = Y;
-		w = W;
-		h = H;
-	};
-	Rect(const SDL_Rect & r)
-	{
-		x = r.x;
-		y = r.y;
-		w = r.w;
-		h = r.h;
-	};
-	bool isIn(int qx, int qy)
+#ifndef __CPLAYERINTERFACE_H__
+#define __CPLAYERINTERFACE_H__
+#include "global.h"
+#include "CGameInterface.h"
+#include "SDL_framerate.h"
+#include <map>
+#include <list>
+
+#ifdef __GNUC__
+#define sprintf_s snprintf 
+#endif
+
+class CDefEssential;
+class AdventureMapButton;
+class CHighlightableButtonsGroup;
+class CDefHandler;
+struct HeroMoveDetails;
+class CDefEssential;
+class CGHeroInstance;
+class CAdvMapInt;
+class CCastleInterface;
+class CBattleInterface;
+class CStack;
+class SComponent;
+class CCreature;
+struct SDL_Surface;
+struct CPath;
+class CCreatureAnimation;
+class CSelectableComponent;
+class CCreatureSet;
+class CGObjectInstance;
+class CSlider;
+struct UpgradeInfo;
+template <typename T> struct CondSh;
+
+namespace boost
+{
+	class mutex;
+	class recursive_mutex;
+};
+
+struct Point
+{
+	int x, y;
+
+	//constructors
+	Point(){};
+	Point(int X, int Y)
+		:x(X),y(Y)
+	{};
+	Point(const int3 &a)
+		:x(a.x),y(a.y)
+	{}
+
+
+
+	Point operator+(const Point &b)
+	{
+		return Point(x+b.x,y+b.y);
+	}
+	Point operator-(const Point &b)
+	{
+		return Point(x+b.x,y+b.y);
+	}
+	bool operator<(const Point &b)
+	{
+		return x < b.x   &&   y < b.y;
+	}
+};
+
+struct Rect : public SDL_Rect
+{
+	Rect()
+	{
+		x = y = w = h = -1;
+	}
+	Rect(int X, int Y, int W, int H)
+	{
+		x = X;
+		y = Y;
+		w = W;
+		h = H;
+	};
+	Rect(const SDL_Rect & r)
+	{
+		x = r.x;
+		y = r.y;
+		w = r.w;
+		h = r.h;
+	};
+	bool isIn(int qx, int qy)
 	{
 		if (qx > x   &&   qx<x+w   &&   qy>y   &&   qy<y+h)
 			return true;
-		return false;
-	}
-	bool isIn(const Point &q)
-	{
-		return isIn(q.x,q.y);
-	}
-	Point topLeft()
-	{
-		return Point(x,y);
-	}
-	Point bottomRight()
-	{
-		return Point(x+w,y+h);
-	}
-	Rect operator+(const Rect &p)
-	{
-		return Rect(x+p.x,y+p.y,w,h);
-	}
-	Rect operator+(const Point &p)
-	{
-		return Rect(x+p.x,y+p.y,w,h);
-	}
-	Rect& operator+=(const Rect &p)
-	{
-		x += p.x;
-		y += p.y;
-		return *this;
-	}
-};
-
-class IShowable
-{
-public:
-	virtual void show(SDL_Surface * to = NULL)=0;
-	virtual ~IShowable(){};
-};
-
-class IStatusBar
-{
-public:
-	virtual ~IStatusBar(){}; //d-tor
-	virtual void print(const std::string & text)=0; //prints text and refreshes statusbar
-	virtual void clear()=0;//clears statusbar and refreshes
-	virtual void show()=0; //shows statusbar (with current text)
-	virtual std::string getCurrent()=0;
-};
-
-class IActivable
-{
-public:
-	virtual void activate()=0;
-	virtual void deactivate()=0;
-	virtual ~IActivable(){};
-};
-class IShowActivable : public IShowable, public IActivable
-{
-public:
-	virtual ~IShowActivable(){};
-};
-class CMainInterface : public IShowActivable
-{
-public:
-	IShowActivable *subInt;
-};
-class CIntObject //interface object
-{
-public:
-	Rect pos;
-	int ID;
-
-	//virtual bool isIn(int x, int y)
-	//{
-	//	return pos.isIn(x,y);
-	//}
-	virtual ~CIntObject(){};
-};
-class CSimpleWindow : public virtual CIntObject, public IShowable
-{
-public:
-	SDL_Surface * bitmap;
-	CIntObject * owner;
-	virtual void show(SDL_Surface * to = NULL);
-	CSimpleWindow():bitmap(NULL),owner(NULL){};
-	virtual ~CSimpleWindow();
-};
-class CButtonBase : public virtual CIntObject, public IShowable, public IActivable //basic buttton class
-{
-public:
-	int bitmapOffset;
-	int type; //advmapbutton=2
-	bool abs;
-	bool active;
-	bool notFreeButton;
-	CIntObject * ourObj; // "owner"
-	int state;
-	std::vector< std::vector<SDL_Surface*> > imgs;
-	int curimg;
-	virtual void show(SDL_Surface * to = NULL);
-	virtual void activate()=0;
-	virtual void deactivate()=0;
-	CButtonBase();
-	virtual ~CButtonBase();
-};
-class ClickableL : public virtual CIntObject  //for left-clicks
-{
-public:
-	bool pressedL;
-	ClickableL();
-	virtual ~ClickableL();//{};
-	virtual void clickLeft (boost::logic::tribool down)=0;
-	virtual void activate();
-	virtual void deactivate();
-};
-class ClickableR : public virtual CIntObject //for right-clicks
-{
-public:
-	bool pressedR;
-	ClickableR();
-	virtual ~ClickableR();//{};
-	virtual void clickRight (boost::logic::tribool down)=0;
-	virtual void activate()=0;
-	virtual void deactivate()=0;
-};
-class Hoverable  : public virtual CIntObject
-{
-public:
-	Hoverable(){hovered=false;}
-	virtual ~Hoverable();//{};
-	bool hovered;
-	virtual void hover (bool on)=0;
-	virtual void activate()=0;
-	virtual void deactivate()=0;
-};
-class KeyInterested : public virtual CIntObject
-{
-public:
-	virtual ~KeyInterested();//{};
-	virtual void keyPressed(const SDL_KeyboardEvent & key)=0;
-	virtual void activate()=0;
-	virtual void deactivate()=0;
-};
-
-class KeyShortcut : public KeyInterested, public ClickableL
-{
-public:
-	std::set<int> assignedKeys;
-	KeyShortcut(){};
-	KeyShortcut(int key){assignedKeys.insert(key);};
-	KeyShortcut(std::set<int> Keys):assignedKeys(Keys){};
-	virtual void keyPressed(const SDL_KeyboardEvent & key);
-};
-
-class MotionInterested: public virtual CIntObject
-{
-public:
-	bool strongInterest; //if true - report all mouse movements, if not - only when hovered
-	MotionInterested(){strongInterest=false;};
-	virtual ~MotionInterested(){};
-	virtual void mouseMoved (const SDL_MouseMotionEvent & sEvent)=0;
-	virtual void activate()=0;
-	virtual void deactivate()=0;
-};
-class TimeInterested: public virtual CIntObject
-{
-public:
-	virtual ~TimeInterested(){};
-	int toNextTick;
-	virtual void tick()=0;
-	virtual void activate();
-	virtual void deactivate();
-};
-class CInfoWindow : public CSimpleWindow //text + comp. + ok button
-{ //window able to delete its components when closed
-public:
-	bool delComps; //whether comps will be deleted
-	std::vector<AdventureMapButton *> buttons;
-	std::vector<SComponent*> components;
-	virtual void close();
-	virtual void show(SDL_Surface * to = NULL);
-	void activate();
-	void deactivate();
-	CInfoWindow(std::string text, int player, int charperline, const std::vector<SComponent*> &comps, std::vector<std::pair<std::string,CFunctionList<void()> > > &Buttons);
-	CInfoWindow();
-	~CInfoWindow();
-};
-class CSelWindow : public CInfoWindow //component selection window
-{ //uwaga - to okno usuwa swoje komponenty przy zamykaniu
-public:
-	void selectionChange(unsigned to);
-	void close();
-	CSelWindow(std::string text, int player, int charperline, std::vector<CSelectableComponent*> &comps, std::vector<std::pair<std::string,boost::function<void()> > > &Buttons);
-	CSelWindow(){};
-};
-
-class CRClickPopup : public IShowable, public ClickableR
-{
-public:
-	virtual void activate();
-	virtual void deactivate();
-	virtual void close()=0;
-	void clickRight (boost::logic::tribool down);
-	virtual ~CRClickPopup(){};
-};
-
-class CInfoPopup : public CRClickPopup
-{
-public:
-	bool free;
-	SDL_Surface * bitmap;
-	CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false);
-	void close();
-	void show(SDL_Surface * to = NULL);
-	CInfoPopup(){free=false;bitmap=NULL;}
-	~CInfoPopup(){};
-};
-
-class SComponent : public ClickableR
-{
-public:
-	enum Etype
-	{
-		primskill, secskill, resource, creature, artifact, experience, secskill44, spell, morale, luck
-	} type;
-	int subtype;
-	int val;
-
-	std::string description; //r-click
-	std::string subtitle;
-
-	void init(Etype Type, int Subtype, int Val);
-	SComponent(Etype Type, int Subtype, int Val);
-	SComponent(const Component &c);
-	SComponent(){};
-	virtual ~SComponent(){};
-
-	void clickRight (boost::logic::tribool down);
-	virtual SDL_Surface * getImg();
-	virtual void show(SDL_Surface * to = NULL);
-	virtual void activate();
-	virtual void deactivate();
-};
-
-class CCustomImgComponent :  public SComponent
-{
-public:
-	bool free; //should surface be freed on delete
-	SDL_Surface *bmp;
-	SDL_Surface * getImg();
-	CCustomImgComponent(Etype Type, int Subtype, int Val, SDL_Surface *sur, bool freeSur);
-	~CCustomImgComponent();
-};
-
-class CSelectableComponent : public SComponent, public KeyShortcut
-{
-public:
-	bool selected;
-
-	bool customB;
-	SDL_Surface * border, *myBitmap;
-	boost::function<void()> onSelect;
-
-	void clickLeft(boost::logic::tribool down);
-	void init(SDL_Surface * Border);
-	CSelectableComponent(Etype Type, int Sub, int Val, boost::function<void()> OnSelect = 0, SDL_Surface * Border=NULL);
-	CSelectableComponent(const Component &c, boost::function<void()> OnSelect = 0, SDL_Surface * Border=NULL);
-	~CSelectableComponent();
-	virtual void show(SDL_Surface * to = NULL);
-	void activate();
-	void deactivate();
-	void select(bool on);
-	SDL_Surface * getImg();
-};
-class CGarrisonInt;
-class CGarrisonSlot : public ClickableL, public ClickableR, public Hoverable
-{
-public:
-	CGarrisonInt *owner;
-	const CCreature * creature;
-	int count;
-	int upg; //0 - up garrison, 1 - down garrison
-	bool active;
-
-	virtual void hover (bool on);
-	const CArmedInstance * getObj();
-	void clickRight (boost::logic::tribool down);
-	void clickLeft(boost::logic::tribool down);
-	void activate();
-	void deactivate();
-	void show();
-	CGarrisonSlot(CGarrisonInt *Owner, int x, int y, int IID, int Upg=0, const CCreature * Creature=NULL, int Count=0);
-	~CGarrisonSlot();
-};
-
-class CGarrisonInt :public CIntObject
-{
-public:
-	int interx, intery;
-	CGarrisonSlot *highlighted;
-
-	SDL_Surface *&sur;
-	int offx, offy, p2;
-	bool ignoreEvent, update, active, splitting, pb;
-
-	const CCreatureSet *set1;
-	const CCreatureSet *set2;
-
-	std::vector<CGarrisonSlot*> *sup, *sdown;
-	const CArmedInstance *oup, *odown;
-
-	void activate();
-	void deactivate();
-	void show();
-	void activeteSlots();
-	void deactiveteSlots();
-	void deleteSlots();
-	void createSlots();
-	void recreateSlots();
-
-	void splitClick();
-	void splitStacks(int am2);
-
-	CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1, const CArmedInstance *s2=NULL);
-	~CGarrisonInt();
-};
-
-class CPlayerInterface : public CGameInterface
-{
-public:
-	//minor interfaces
-	CondSh<bool> *showingDialog;
-	boost::recursive_mutex *pim;
-	bool makingTurn;
-	int heroMoveSpeed;
-	void setHeroMoveSpeed(int newSpeed) {heroMoveSpeed = newSpeed;} //set for the member above
-	int mapScrollingSpeed;
-	void setMapScrollingSpeed(int newSpeed) {mapScrollingSpeed = newSpeed;} //set the member above
-	SDL_Event * current;
-	CMainInterface *curint;
-	CAdvMapInt * adventureInt;
-	CCastleInterface * castleInt;
-	CBattleInterface * battleInt;
-	FPSmanager * mainFPSmng;
-	IStatusBar *statusbar;
-	//to commucate with engine
-	CCallback * cb;
-	const BattleAction *curAction;
-
-	//GUI elements
-	std::list<ClickableL*> lclickable;
-	std::list<ClickableR*> rclickable;
-	std::list<Hoverable*> hoverable;
-	std::list<KeyInterested*> keyinterested;
-	std::list<MotionInterested*> motioninterested;
-	std::list<TimeInterested*> timeinterested;
-	std::vector<IShowable*> objsToBlit;
-
-	//overloaded funcs from CGameInterface
-	void buildChanged(const CGTownInstance *town, int buildingID, int what); //what: 1 - built, 2 - demolished
-	void garrisonChanged(const CGObjectInstance * obj);
-	void heroArtifactSetChanged(const CGHeroInstance*hero);
-	void heroCreated(const CGHeroInstance* hero);
-	void heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback);
-	void heroInGarrisonChange(const CGTownInstance *town);
-	void heroKilled(const CGHeroInstance* hero);
-	void heroMoved(const HeroMoveDetails & details);
-	void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val);
-	void heroManaPointsChanged(const CGHeroInstance * hero);
-	void heroMovePointsChanged(const CGHeroInstance * hero);
-	void heroVisitsTown(const CGHeroInstance* hero, const CGTownInstance * town);
-	void receivedResource(int type, int val);
-	void showInfoDialog(std::string &text, const std::vector<Component*> &components);
-	void showSelDialog(std::string &text, const std::vector<Component*> &components, ui32 askID);
-	void showYesNoDialog(std::string &text, const std::vector<Component*> &components, ui32 askID);
-	void tileHidden(const std::set<int3> &pos);
-	void tileRevealed(const std::set<int3> &pos);
-	void yourTurn();
-	void availableCreaturesChanged(const CGTownInstance *town);
-	void heroBonusChanged(const CGHeroInstance *hero, const HeroBonus &bonus, bool gain);//if gain hero received bonus, else he lost it
-	//for battles
-	void actionFinished(const BattleAction* action);//occurs AFTER action taken by active stack or by the hero
-	void actionStarted(const BattleAction* action);//occurs BEFORE action taken by active stack or by the hero
-	BattleAction activeStack(int stackID); //called when it's turn of that stack
-	void battleAttack(BattleAttack *ba); //stack performs attack
-	void battleEnd(BattleResult *br);
-	void battleResultQuited();
-	void battleNewRound(int round); //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
-	void battleStackMoved(int ID, int dest);
-	void battleSpellCasted(SpellCasted *sc);
-	void battleStackAttacked(BattleStackAttacked * bsa);
-	void battleStart(CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side); //called by engine when battle starts; side=0 - left, side=1 - right
-	void battlefieldPrepared(int battlefieldType, std::vector<CObstacle*> obstacles); //called when battlefield is prepared, prior the battle beginning
-
-
-	//-------------//
-	void redrawHeroWin(const CGHeroInstance * hero);
-	void updateWater();
-	void showComp(SComponent comp);
-	void openTownWindow(const CGTownInstance * town); //shows townscreen
-	void openHeroWindow(const CGHeroInstance * hero); //shows hero window with given hero
-	SDL_Surface * infoWin(const CGObjectInstance * specific); //specific=0 => draws info about selected town/hero
-	void handleEvent(SDL_Event * sEvent);
-	void handleKeyDown(SDL_Event *sEvent);
-	void handleKeyUp(SDL_Event *sEvent);
-	void handleMouseMotion(SDL_Event *sEvent);
-	void init(ICallback * CB);
-	int3 repairScreenPos(int3 pos);
-	void removeObjToBlit(IShowable* obj);
-	void showInfoDialog(std::string &text, const std::vector<SComponent*> & components);
-	void showYesNoDialog(std::string &text, const std::vector<SComponent*> & components, CFunctionList<void()> onYes, CFunctionList<void()> onNo, bool deactivateCur, bool DelComps); //deactivateCur - whether current main interface should be deactivated; delComps - if components will be deleted on window close
-
-	CPlayerInterface(int Player, int serial);//c-tor
-	~CPlayerInterface();//d-tor
-};
-class CStatusBar
-	: public CIntObject, public IStatusBar
-{
-public:
-	SDL_Surface * bg; //background
-	int middlex, middley; //middle of statusbar
-	std::string current; //text currently printed
-
-	CStatusBar(int x, int y, std::string name="ADROLLVR.bmp", int maxw=-1); //c-tor
-	~CStatusBar(); //d-tor
-	void print(const std::string & text); //prints text and refreshes statusbar
-	void clear();//clears statusbar and refreshes
-	void show(); //shows statusbar (with current text)
-	std::string getCurrent();
-};
-
-class CList
-	: public ClickableL, public ClickableR, public Hoverable, public KeyInterested, public virtual CIntObject, public MotionInterested
-{
-public:
-	SDL_Surface * bg;
-	CDefHandler *arrup, *arrdo;
-	SDL_Surface *empty, *selection;
-	SDL_Rect arrupp, arrdop; //positions of arrows
-	int posw, posh; //position width/height
-	int selected, //id of selected position, <0 if none
-		from;
-	const int SIZE;
-	boost::logic::tribool pressed; //true=up; false=down; indeterminate=none
-
-	CList(int Size = 5);
-	void clickLeft(boost::logic::tribool down);
-	void activate();
-	void deactivate();
-	virtual void mouseMoved (const SDL_MouseMotionEvent & sEvent)=0;
-	virtual void genList()=0;
-	virtual void select(int which)=0;
-	virtual void draw()=0;
-};
-class CHeroList
-	: public CList
-{
-public:
-	CDefHandler *mobile, *mana;
-	std::vector<std::pair<const CGHeroInstance*, CPath *> > items;
-	int posmobx, posporx, posmanx, posmoby, pospory, posmany;
-
-	CHeroList(int Size);
-	int getPosOfHero(const CArmedInstance* h);
-	void genList();
-	void select(int which);
-	void mouseMoved (const SDL_MouseMotionEvent & sEvent);
-	void clickLeft(boost::logic::tribool down);
-	void clickRight(boost::logic::tribool down);
-	void hover (bool on);
-	void keyPressed (const SDL_KeyboardEvent & key);
-	void updateHList();
-	void updateMove(const CGHeroInstance* which); //draws move points bar
-	void redrawAllOne(int which);
-	void draw();
-	void init();
-};
-
-class CTownList
-	: public CList
-{
-public:
-	boost::function<void()> fun;
-	std::vector<const CGTownInstance*> items;
-	int posporx,pospory;
-
-	CTownList(int Size, int x, int y, std::string arrupg, std::string arrdog);
-	~CTownList();
-	void genList();
-	void select(int which);
-	void mouseMoved (const SDL_MouseMotionEvent & sEvent);
-	void clickLeft(boost::logic::tribool down);
-	void clickRight(boost::logic::tribool down);
-	void hover (bool on);
-	void keyPressed (const SDL_KeyboardEvent & key);
-	void draw();
-};
-
-class CCreaturePic //draws picture with creature on background, use nextFrame=true to get animation
-{
-public:
-	bool big; //big => 100x130; !big => 100x120
-	CCreature *c;
-	CCreatureAnimation *anim;
-	CCreaturePic(CCreature *cre, bool Big=true);
-	~CCreaturePic();
-	int blitPic(SDL_Surface *to, int x, int y, bool nextFrame);
-	SDL_Surface * getPic(bool nextFrame);
-};
-
-class CRecrutationWindow : public IShowable, public ClickableL, public ClickableR
-{
-public:
-	struct creinfo
-	{
-		SDL_Rect pos;
-		CCreaturePic *pic;
-		int ID, amount; //creature ID and available amount
-		std::vector<std::pair<int,int> > res; //res_id - cost_per_unit
-	};
-	std::vector<int> amounts; //how many creatures we can afford
-	std::vector<creinfo> creatures;
-	boost::function<void(int,int)> recruit; //void (int ID, int amount) <-- call to recruit creatures
-	CSlider *slider;
-	AdventureMapButton *max, *buy, *cancel;
-	SDL_Surface *bitmap;
-	CStatusBar *bar;
-	int which; //which creature is active
-
-	void close();
-	void Max();
-	void Buy();
-	void Cancel();
-	void sliderMoved(int to);
-	void clickLeft(boost::logic::tribool down);
-	void clickRight(boost::logic::tribool down);
-	void activate();
-	void deactivate();
-	void show(SDL_Surface * to = NULL);
-	CRecrutationWindow(const std::vector<std::pair<int,int> > & Creatures, const boost::function<void(int,int)> & Recruit); //creatures - pairs<creature_ID,amount>
-	~CRecrutationWindow();
-};
-
-class CSplitWindow : public IShowable, public KeyInterested
-{
-public:
-	CGarrisonInt *gar;
-	CSlider *slider;
-	CCreaturePic *anim;
-	AdventureMapButton *ok, *cancel;
-	SDL_Surface *bitmap;
-	int a1, a2, c;
-	bool which;
-
-	CSplitWindow(int cid, int max, CGarrisonInt *Owner);
-	~CSplitWindow();
-	void activate();
-	void split();
-	void close();
-	void deactivate();
-	void show(SDL_Surface * to = NULL);
-	void keyPressed (const SDL_KeyboardEvent & key);
-	void sliderMoved(int to);
-};
-
-class CCreInfoWindow : public IShowable, public KeyInterested, public ClickableR
-{
-public:
-	bool active;
-	int type;//0 - rclick popup; 1 - normal window
-	SDL_Surface *bitmap;
-	char anf;
-	std::string count; //creature count in text format
-
-	boost::function<void()> dsm;
-	CCreaturePic *anim;
-	CCreature *c;
-	CInfoWindow *dependant; //it may be dialog asking whther upgrade/dismiss stack (if opened)
-	std::vector<SComponent*> upgResCost; //cost of upgrade (if not possible then empty)
-
-	AdventureMapButton *dismiss, *upgrade, *ok;
-	CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui);
-	~CCreInfoWindow();
-	void activate();
-	void close();
-	void clickRight(boost::logic::tribool down);
-	void dismissF();
-	void keyPressed (const SDL_KeyboardEvent & key);
-	void deactivate();
-	void show(SDL_Surface * to = NULL);
-	void onUpgradeYes();
-	void onUpgradeNo();
-};
-
-class CLevelWindow : public IShowable, public CIntObject
-{
-public:
-	int heroType;
-	SDL_Surface *bitmap;
-	std::vector<CSelectableComponent *> comps; //skills to select
-	AdventureMapButton *ok;
-	boost::function<void(ui32)> cb;
-
-	void close();
-	CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback);
-	~CLevelWindow();
-	void activate();
-	void deactivate();
-	void selectionChanged(unsigned to);
-	void show(SDL_Surface * to = NULL);
-};
-
-class CMinorResDataBar : public IShowable, public CIntObject
-{
-public:
-	SDL_Surface *bg;
-	void show(SDL_Surface * to=NULL);
-	CMinorResDataBar();
-	~CMinorResDataBar();
-};
-
-class CMarketplaceWindow : public IShowActivable, public CIntObject
-{
-public:
-	class CTradeableItem : public ClickableL
-	{
-	public:
-		int type; //0 - res, 1 - artif big, 2 - artif small, 3 - player flag
-		int id;
-		bool left;
-		CFunctionList<void()> callback;
-
-		void activate();
-		void deactivate();
-		void show(SDL_Surface * to=NULL);
-		void clickLeft(boost::logic::tribool down);
-		SDL_Surface *getSurface();
-		CTradeableItem(int Type, int ID, bool Left);
-	};
-
-	SDL_Surface *bg;
-	std::vector<CTradeableItem*> left, right;
-	std::vector<std::string> rSubs;
-	CTradeableItem *hLeft, *hRight; //highlighted items (NULL if no highlight)
-
-	int mode,//0 - res<->res; 1 - res<->plauer; 2 - buy artifact; 3 - sell artifact
-		r1, r2; 
-	AdventureMapButton *ok, *max, *deal;
-	CSlider *slider;
-
-	void activate();
-	void deactivate();
-	void show(SDL_Surface * to=NULL);
-	void setMax();
-	void sliderMoved(int to);
-	void makeDeal();
-	void selectionChanged(bool side); //true == left
-	CMarketplaceWindow(int Mode=0);
-	~CMarketplaceWindow();
-	void setMode(int mode);
-	void clear();
-};
-
-class CSystemOptionsWindow : public IShowActivable, public CIntObject
-{
-private:
-	SDL_Surface * background; //background of window
-	AdventureMapButton * quitGame, * backToMap;
-	CHighlightableButtonsGroup * heroMoveSpeed;
-	CHighlightableButtonsGroup * mapScrollSpeed;
-public:
-	CSystemOptionsWindow(const SDL_Rect & pos, CPlayerInterface * owner); //c-tor
-	~CSystemOptionsWindow(); //d-tor
-
-	//functions for butons
-	void bquitf(); //quit game
-	void breturnf(); //return to game
-
-	void activate();
-	void deactivate();
-	void show(SDL_Surface * to = NULL);
-};
-
-class CTavernWindow : public IShowActivable, public CIntObject
-{
-public:
-	class HeroPortrait : public ClickableL, public ClickableR, public Hoverable
-	{
-	public:
-		std::string hoverName;
-		vstd::assigner<int,int> as;
-		const CGHeroInstance *h;
-		void activate();
-		void deactivate();
-		void clickLeft(boost::logic::tribool down);
-		void clickRight(boost::logic::tribool down);
-		void hover (bool on);
-		HeroPortrait(int &sel, int id, int x, int y, const CGHeroInstance *H);
-		void show(SDL_Surface * to = NULL);
-	} h1, h2;
-
-	SDL_Surface *bg;
-	CStatusBar *bar;
-	int selected;//0 (left) or 1 (right)
-
-	AdventureMapButton *thiefGuild, *cancel, *recruit;
-
-	CTavernWindow(const CGHeroInstance *H1, const CGHeroInstance *H2, const std::string &gossip); //c-tor
-	~CTavernWindow(); //d-tor
-
-	void recruitb();
-	void close();
-	void activate();
-	void deactivate();
-	void show(SDL_Surface * to = NULL);
-};
-
-extern CPlayerInterface * LOCPLINT;
-
-
-#endif // __CPLAYERINTERFACE_H__
+		return false;
+	}
+	bool isIn(const Point &q)
+	{
+		return isIn(q.x,q.y);
+	}
+	Point topLeft()
+	{
+		return Point(x,y);
+	}
+	Point bottomRight()
+	{
+		return Point(x+w,y+h);
+	}
+	Rect operator+(const Rect &p)
+	{
+		return Rect(x+p.x,y+p.y,w,h);
+	}
+	Rect operator+(const Point &p)
+	{
+		return Rect(x+p.x,y+p.y,w,h);
+	}
+	Rect& operator+=(const Rect &p)
+	{
+		x += p.x;
+		y += p.y;
+		return *this;
+	}
+};
+
+class IShowable
+{
+public:
+	virtual void show(SDL_Surface * to = NULL)=0;
+	virtual ~IShowable(){};
+};
+
+class IStatusBar
+{
+public:
+	virtual ~IStatusBar(){}; //d-tor
+	virtual void print(const std::string & text)=0; //prints text and refreshes statusbar
+	virtual void clear()=0;//clears statusbar and refreshes
+	virtual void show()=0; //shows statusbar (with current text)
+	virtual std::string getCurrent()=0;
+};
+
+class IActivable
+{
+public:
+	virtual void activate()=0;
+	virtual void deactivate()=0;
+	virtual ~IActivable(){};
+};
+class IShowActivable : public IShowable, public IActivable
+{
+public:
+	virtual ~IShowActivable(){};
+};
+class CMainInterface : public IShowActivable
+{
+public:
+	IShowActivable *subInt;
+};
+class CIntObject //interface object
+{
+public:
+	Rect pos;
+	int ID;
+
+	//virtual bool isIn(int x, int y)
+	//{
+	//	return pos.isIn(x,y);
+	//}
+	virtual ~CIntObject(){};
+};
+class CSimpleWindow : public virtual CIntObject, public IShowable
+{
+public:
+	SDL_Surface * bitmap;
+	CIntObject * owner;
+	virtual void show(SDL_Surface * to = NULL);
+	CSimpleWindow():bitmap(NULL),owner(NULL){};
+	virtual ~CSimpleWindow();
+};
+class CButtonBase : public virtual CIntObject, public IShowable, public IActivable //basic buttton class
+{
+public:
+	int bitmapOffset;
+	int type; //advmapbutton=2
+	bool abs;
+	bool active;
+	bool notFreeButton;
+	CIntObject * ourObj; // "owner"
+	int state;
+	std::vector< std::vector<SDL_Surface*> > imgs;
+	int curimg;
+	virtual void show(SDL_Surface * to = NULL);
+	virtual void activate()=0;
+	virtual void deactivate()=0;
+	CButtonBase();
+	virtual ~CButtonBase();
+};
+class ClickableL : public virtual CIntObject  //for left-clicks
+{
+public:
+	bool pressedL;
+	ClickableL();
+	virtual ~ClickableL();//{};
+	virtual void clickLeft (boost::logic::tribool down)=0;
+	virtual void activate();
+	virtual void deactivate();
+};
+class ClickableR : public virtual CIntObject //for right-clicks
+{
+public:
+	bool pressedR;
+	ClickableR();
+	virtual ~ClickableR();//{};
+	virtual void clickRight (boost::logic::tribool down)=0;
+	virtual void activate()=0;
+	virtual void deactivate()=0;
+};
+class Hoverable  : public virtual CIntObject
+{
+public:
+	Hoverable(){hovered=false;}
+	virtual ~Hoverable();//{};
+	bool hovered;
+	virtual void hover (bool on)=0;
+	virtual void activate()=0;
+	virtual void deactivate()=0;
+};
+class KeyInterested : public virtual CIntObject
+{
+public:
+	virtual ~KeyInterested();//{};
+	virtual void keyPressed(const SDL_KeyboardEvent & key)=0;
+	virtual void activate()=0;
+	virtual void deactivate()=0;
+};
+
+class KeyShortcut : public KeyInterested, public ClickableL
+{
+public:
+	std::set<int> assignedKeys;
+	KeyShortcut(){};
+	KeyShortcut(int key){assignedKeys.insert(key);};
+	KeyShortcut(std::set<int> Keys):assignedKeys(Keys){};
+	virtual void keyPressed(const SDL_KeyboardEvent & key);
+};
+
+class MotionInterested: public virtual CIntObject
+{
+public:
+	bool strongInterest; //if true - report all mouse movements, if not - only when hovered
+	MotionInterested(){strongInterest=false;};
+	virtual ~MotionInterested(){};
+	virtual void mouseMoved (const SDL_MouseMotionEvent & sEvent)=0;
+	virtual void activate()=0;
+	virtual void deactivate()=0;
+};
+class TimeInterested: public virtual CIntObject
+{
+public:
+	virtual ~TimeInterested(){};
+	int toNextTick;
+	virtual void tick()=0;
+	virtual void activate();
+	virtual void deactivate();
+};
+class CInfoWindow : public CSimpleWindow //text + comp. + ok button
+{ //window able to delete its components when closed
+public:
+	bool delComps; //whether comps will be deleted
+	std::vector<AdventureMapButton *> buttons;
+	std::vector<SComponent*> components;
+	virtual void close();
+	virtual void show(SDL_Surface * to = NULL);
+	void activate();
+	void deactivate();
+	CInfoWindow(std::string text, int player, int charperline, const std::vector<SComponent*> &comps, std::vector<std::pair<std::string,CFunctionList<void()> > > &Buttons);
+	CInfoWindow();
+	~CInfoWindow();
+};
+class CSelWindow : public CInfoWindow //component selection window
+{ //uwaga - to okno usuwa swoje komponenty przy zamykaniu
+public:
+	void selectionChange(unsigned to);
+	void close();
+	CSelWindow(std::string text, int player, int charperline, std::vector<CSelectableComponent*> &comps, std::vector<std::pair<std::string,boost::function<void()> > > &Buttons);
+	CSelWindow(){};
+};
+
+class CRClickPopup : public IShowable, public ClickableR
+{
+public:
+	virtual void activate();
+	virtual void deactivate();
+	virtual void close()=0;
+	void clickRight (boost::logic::tribool down);
+	virtual ~CRClickPopup(){};
+};
+
+class CInfoPopup : public CRClickPopup
+{
+public:
+	bool free;
+	SDL_Surface * bitmap;
+	CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false);
+	void close();
+	void show(SDL_Surface * to = NULL);
+	CInfoPopup(){free=false;bitmap=NULL;}
+	~CInfoPopup(){};
+};
+
+class SComponent : public ClickableR
+{
+public:
+	enum Etype
+	{
+		primskill, secskill, resource, creature, artifact, experience, secskill44, spell, morale, luck
+	} type;
+	int subtype;
+	int val;
+
+	std::string description; //r-click
+	std::string subtitle;
+
+	void init(Etype Type, int Subtype, int Val);
+	SComponent(Etype Type, int Subtype, int Val);
+	SComponent(const Component &c);
+	SComponent(){};
+	virtual ~SComponent(){};
+
+	void clickRight (boost::logic::tribool down);
+	virtual SDL_Surface * getImg();
+	virtual void show(SDL_Surface * to = NULL);
+	virtual void activate();
+	virtual void deactivate();
+};
+
+class CCustomImgComponent :  public SComponent
+{
+public:
+	bool free; //should surface be freed on delete
+	SDL_Surface *bmp;
+	SDL_Surface * getImg();
+	CCustomImgComponent(Etype Type, int Subtype, int Val, SDL_Surface *sur, bool freeSur);
+	~CCustomImgComponent();
+};
+
+class CSelectableComponent : public SComponent, public KeyShortcut
+{
+public:
+	bool selected;
+
+	bool customB;
+	SDL_Surface * border, *myBitmap;
+	boost::function<void()> onSelect;
+
+	void clickLeft(boost::logic::tribool down);
+	void init(SDL_Surface * Border);
+	CSelectableComponent(Etype Type, int Sub, int Val, boost::function<void()> OnSelect = 0, SDL_Surface * Border=NULL);
+	CSelectableComponent(const Component &c, boost::function<void()> OnSelect = 0, SDL_Surface * Border=NULL);
+	~CSelectableComponent();
+	virtual void show(SDL_Surface * to = NULL);
+	void activate();
+	void deactivate();
+	void select(bool on);
+	SDL_Surface * getImg();
+};
+class CGarrisonInt;
+class CGarrisonSlot : public ClickableL, public ClickableR, public Hoverable
+{
+public:
+	CGarrisonInt *owner;
+	const CCreature * creature;
+	int count;
+	int upg; //0 - up garrison, 1 - down garrison
+	bool active;
+
+	virtual void hover (bool on);
+	const CArmedInstance * getObj();
+	void clickRight (boost::logic::tribool down);
+	void clickLeft(boost::logic::tribool down);
+	void activate();
+	void deactivate();
+	void show();
+	CGarrisonSlot(CGarrisonInt *Owner, int x, int y, int IID, int Upg=0, const CCreature * Creature=NULL, int Count=0);
+	~CGarrisonSlot();
+};
+
+class CGarrisonInt :public CIntObject
+{
+public:
+	int interx, intery;
+	CGarrisonSlot *highlighted;
+
+	SDL_Surface *&sur;
+	int offx, offy, p2;
+	bool ignoreEvent, update, active, splitting, pb;
+
+	const CCreatureSet *set1;
+	const CCreatureSet *set2;
+
+	std::vector<CGarrisonSlot*> *sup, *sdown;
+	const CArmedInstance *oup, *odown;
+
+	void activate();
+	void deactivate();
+	void show();
+	void activeteSlots();
+	void deactiveteSlots();
+	void deleteSlots();
+	void createSlots();
+	void recreateSlots();
+
+	void splitClick();
+	void splitStacks(int am2);
+
+	CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1, const CArmedInstance *s2=NULL);
+	~CGarrisonInt();
+};
+
+class CPlayerInterface : public CGameInterface
+{
+public:
+	//minor interfaces
+	CondSh<bool> *showingDialog;
+	boost::recursive_mutex *pim;
+	bool makingTurn;
+	int heroMoveSpeed;
+	void setHeroMoveSpeed(int newSpeed) {heroMoveSpeed = newSpeed;} //set for the member above
+	int mapScrollingSpeed;
+	void setMapScrollingSpeed(int newSpeed) {mapScrollingSpeed = newSpeed;} //set the member above
+	SDL_Event * current;
+	CMainInterface *curint;
+	CAdvMapInt * adventureInt;
+	CCastleInterface * castleInt;
+	CBattleInterface * battleInt;
+	FPSmanager * mainFPSmng;
+	IStatusBar *statusbar;
+	//to commucate with engine
+	CCallback * cb;
+	const BattleAction *curAction;
+
+	//GUI elements
+	std::list<ClickableL*> lclickable;
+	std::list<ClickableR*> rclickable;
+	std::list<Hoverable*> hoverable;
+	std::list<KeyInterested*> keyinterested;
+	std::list<MotionInterested*> motioninterested;
+	std::list<TimeInterested*> timeinterested;
+	std::vector<IShowable*> objsToBlit;
+
+	//overloaded funcs from CGameInterface
+	void buildChanged(const CGTownInstance *town, int buildingID, int what); //what: 1 - built, 2 - demolished
+	void garrisonChanged(const CGObjectInstance * obj);
+	void heroArtifactSetChanged(const CGHeroInstance*hero);
+	void heroCreated(const CGHeroInstance* hero);
+	void heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback);
+	void heroInGarrisonChange(const CGTownInstance *town);
+	void heroKilled(const CGHeroInstance* hero);
+	void heroMoved(const HeroMoveDetails & details);
+	void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val);
+	void heroManaPointsChanged(const CGHeroInstance * hero);
+	void heroMovePointsChanged(const CGHeroInstance * hero);
+	void heroVisitsTown(const CGHeroInstance* hero, const CGTownInstance * town);
+	void receivedResource(int type, int val);
+	void showInfoDialog(std::string &text, const std::vector<Component*> &components);
+	void showSelDialog(std::string &text, const std::vector<Component*> &components, ui32 askID);
+	void showYesNoDialog(std::string &text, const std::vector<Component*> &components, ui32 askID);
+	void tileHidden(const std::set<int3> &pos);
+	void tileRevealed(const std::set<int3> &pos);
+	void yourTurn();
+	void availableCreaturesChanged(const CGTownInstance *town);
+	void heroBonusChanged(const CGHeroInstance *hero, const HeroBonus &bonus, bool gain);//if gain hero received bonus, else he lost it
+	//for battles
+	void actionFinished(const BattleAction* action);//occurs AFTER action taken by active stack or by the hero
+	void actionStarted(const BattleAction* action);//occurs BEFORE action taken by active stack or by the hero
+	BattleAction activeStack(int stackID); //called when it's turn of that stack
+	void battleAttack(BattleAttack *ba); //stack performs attack
+	void battleEnd(BattleResult *br);
+	void battleResultQuited();
+	void battleNewRound(int round); //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
+	void battleStackMoved(int ID, int dest);
+	void battleSpellCasted(SpellCasted *sc);
+	void battleStackAttacked(BattleStackAttacked * bsa);
+	void battleStart(CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side); //called by engine when battle starts; side=0 - left, side=1 - right
+	void battlefieldPrepared(int battlefieldType, std::vector<CObstacle*> obstacles); //called when battlefield is prepared, prior the battle beginning
+
+
+	//-------------//
+	void redrawHeroWin(const CGHeroInstance * hero);
+	void updateWater();
+	void showComp(SComponent comp);
+	void openTownWindow(const CGTownInstance * town); //shows townscreen
+	void openHeroWindow(const CGHeroInstance * hero); //shows hero window with given hero
+	SDL_Surface * infoWin(const CGObjectInstance * specific); //specific=0 => draws info about selected town/hero
+	void handleEvent(SDL_Event * sEvent);
+	void handleKeyDown(SDL_Event *sEvent);
+	void handleKeyUp(SDL_Event *sEvent);
+	void handleMouseMotion(SDL_Event *sEvent);
+	void init(ICallback * CB);
+	int3 repairScreenPos(int3 pos);
+	void removeObjToBlit(IShowable* obj);
+	void showInfoDialog(std::string &text, const std::vector<SComponent*> & components);
+	void showYesNoDialog(std::string &text, const std::vector<SComponent*> & components, CFunctionList<void()> onYes, CFunctionList<void()> onNo, bool deactivateCur, bool DelComps); //deactivateCur - whether current main interface should be deactivated; delComps - if components will be deleted on window close
+
+	CPlayerInterface(int Player, int serial);//c-tor
+	~CPlayerInterface();//d-tor
+};
+class CStatusBar
+	: public CIntObject, public IStatusBar
+{
+public:
+	SDL_Surface * bg; //background
+	int middlex, middley; //middle of statusbar
+	std::string current; //text currently printed
+
+	CStatusBar(int x, int y, std::string name="ADROLLVR.bmp", int maxw=-1); //c-tor
+	~CStatusBar(); //d-tor
+	void print(const std::string & text); //prints text and refreshes statusbar
+	void clear();//clears statusbar and refreshes
+	void show(); //shows statusbar (with current text)
+	std::string getCurrent();
+};
+
+class CList
+	: public ClickableL, public ClickableR, public Hoverable, public KeyInterested, public virtual CIntObject, public MotionInterested
+{
+public:
+	SDL_Surface * bg;
+	CDefHandler *arrup, *arrdo;
+	SDL_Surface *empty, *selection;
+	SDL_Rect arrupp, arrdop; //positions of arrows
+	int posw, posh; //position width/height
+	int selected, //id of selected position, <0 if none
+		from;
+	const int SIZE;
+	boost::logic::tribool pressed; //true=up; false=down; indeterminate=none
+
+	CList(int Size = 5);
+	void clickLeft(boost::logic::tribool down);
+	void activate();
+	void deactivate();
+	virtual void mouseMoved (const SDL_MouseMotionEvent & sEvent)=0;
+	virtual void genList()=0;
+	virtual void select(int which)=0;
+	virtual void draw()=0;
+};
+class CHeroList
+	: public CList
+{
+public:
+	CDefHandler *mobile, *mana;
+	std::vector<std::pair<const CGHeroInstance*, CPath *> > items;
+	int posmobx, posporx, posmanx, posmoby, pospory, posmany;
+
+	CHeroList(int Size);
+	int getPosOfHero(const CArmedInstance* h);
+	void genList();
+	void select(int which);
+	void mouseMoved (const SDL_MouseMotionEvent & sEvent);
+	void clickLeft(boost::logic::tribool down);
+	void clickRight(boost::logic::tribool down);
+	void hover (bool on);
+	void keyPressed (const SDL_KeyboardEvent & key);
+	void updateHList();
+	void updateMove(const CGHeroInstance* which); //draws move points bar
+	void redrawAllOne(int which);
+	void draw();
+	void init();
+};
+
+class CTownList
+	: public CList
+{
+public:
+	boost::function<void()> fun;
+	std::vector<const CGTownInstance*> items;
+	int posporx,pospory;
+
+	CTownList(int Size, int x, int y, std::string arrupg, std::string arrdog);
+	~CTownList();
+	void genList();
+	void select(int which);
+	void mouseMoved (const SDL_MouseMotionEvent & sEvent);
+	void clickLeft(boost::logic::tribool down);
+	void clickRight(boost::logic::tribool down);
+	void hover (bool on);
+	void keyPressed (const SDL_KeyboardEvent & key);
+	void draw();
+};
+
+class CCreaturePic //draws picture with creature on background, use nextFrame=true to get animation
+{
+public:
+	bool big; //big => 100x130; !big => 100x120
+	CCreature *c;
+	CCreatureAnimation *anim;
+	CCreaturePic(CCreature *cre, bool Big=true);
+	~CCreaturePic();
+	int blitPic(SDL_Surface *to, int x, int y, bool nextFrame);
+	SDL_Surface * getPic(bool nextFrame);
+};
+
+class CRecrutationWindow : public IShowable, public ClickableL, public ClickableR
+{
+public:
+	struct creinfo
+	{
+		SDL_Rect pos;
+		CCreaturePic *pic;
+		int ID, amount; //creature ID and available amount
+		std::vector<std::pair<int,int> > res; //res_id - cost_per_unit
+	};
+	std::vector<int> amounts; //how many creatures we can afford
+	std::vector<creinfo> creatures;
+	boost::function<void(int,int)> recruit; //void (int ID, int amount) <-- call to recruit creatures
+	CSlider *slider;
+	AdventureMapButton *max, *buy, *cancel;
+	SDL_Surface *bitmap;
+	CStatusBar *bar;
+	int which; //which creature is active
+
+	void close();
+	void Max();
+	void Buy();
+	void Cancel();
+	void sliderMoved(int to);
+	void clickLeft(boost::logic::tribool down);
+	void clickRight(boost::logic::tribool down);
+	void activate();
+	void deactivate();
+	void show(SDL_Surface * to = NULL);
+	CRecrutationWindow(const std::vector<std::pair<int,int> > & Creatures, const boost::function<void(int,int)> & Recruit); //creatures - pairs<creature_ID,amount>
+	~CRecrutationWindow();
+};
+
+class CSplitWindow : public IShowable, public KeyInterested
+{
+public:
+	CGarrisonInt *gar;
+	CSlider *slider;
+	CCreaturePic *anim;
+	AdventureMapButton *ok, *cancel;
+	SDL_Surface *bitmap;
+	int a1, a2, c;
+	bool which;
+
+	CSplitWindow(int cid, int max, CGarrisonInt *Owner);
+	~CSplitWindow();
+	void activate();
+	void split();
+	void close();
+	void deactivate();
+	void show(SDL_Surface * to = NULL);
+	void keyPressed (const SDL_KeyboardEvent & key);
+	void sliderMoved(int to);
+};
+
+class CCreInfoWindow : public IShowable, public KeyInterested, public ClickableR
+{
+public:
+	bool active;
+	int type;//0 - rclick popup; 1 - normal window
+	SDL_Surface *bitmap;
+	char anf;
+	std::string count; //creature count in text format
+
+	boost::function<void()> dsm;
+	CCreaturePic *anim;
+	CCreature *c;
+	CInfoWindow *dependant; //it may be dialog asking whther upgrade/dismiss stack (if opened)
+	std::vector<SComponent*> upgResCost; //cost of upgrade (if not possible then empty)
+
+	AdventureMapButton *dismiss, *upgrade, *ok;
+	CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui);
+	~CCreInfoWindow();
+	void activate();
+	void close();
+	void clickRight(boost::logic::tribool down);
+	void dismissF();
+	void keyPressed (const SDL_KeyboardEvent & key);
+	void deactivate();
+	void show(SDL_Surface * to = NULL);
+	void onUpgradeYes();
+	void onUpgradeNo();
+};
+
+class CLevelWindow : public IShowable, public CIntObject
+{
+public:
+	int heroType;
+	SDL_Surface *bitmap;
+	std::vector<CSelectableComponent *> comps; //skills to select
+	AdventureMapButton *ok;
+	boost::function<void(ui32)> cb;
+
+	void close();
+	CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback);
+	~CLevelWindow();
+	void activate();
+	void deactivate();
+	void selectionChanged(unsigned to);
+	void show(SDL_Surface * to = NULL);
+};
+
+class CMinorResDataBar : public IShowable, public CIntObject
+{
+public:
+	SDL_Surface *bg;
+	void show(SDL_Surface * to=NULL);
+	CMinorResDataBar();
+	~CMinorResDataBar();
+};
+
+class CMarketplaceWindow : public IShowActivable, public CIntObject
+{
+public:
+	class CTradeableItem : public ClickableL
+	{
+	public:
+		int type; //0 - res, 1 - artif big, 2 - artif small, 3 - player flag
+		int id;
+		bool left;
+		CFunctionList<void()> callback;
+
+		void activate();
+		void deactivate();
+		void show(SDL_Surface * to=NULL);
+		void clickLeft(boost::logic::tribool down);
+		SDL_Surface *getSurface();
+		CTradeableItem(int Type, int ID, bool Left);
+	};
+
+	SDL_Surface *bg;
+	std::vector<CTradeableItem*> left, right;
+	std::vector<std::string> rSubs;
+	CTradeableItem *hLeft, *hRight; //highlighted items (NULL if no highlight)
+
+	int mode,//0 - res<->res; 1 - res<->plauer; 2 - buy artifact; 3 - sell artifact
+		r1, r2; 
+	AdventureMapButton *ok, *max, *deal;
+	CSlider *slider;
+
+	void activate();
+	void deactivate();
+	void show(SDL_Surface * to=NULL);
+	void setMax();
+	void sliderMoved(int to);
+	void makeDeal();
+	void selectionChanged(bool side); //true == left
+	CMarketplaceWindow(int Mode=0);
+	~CMarketplaceWindow();
+	void setMode(int mode);
+	void clear();
+};
+
+class CSystemOptionsWindow : public IShowActivable, public CIntObject
+{
+private:
+	SDL_Surface * background; //background of window
+	AdventureMapButton * quitGame, * backToMap;
+	CHighlightableButtonsGroup * heroMoveSpeed;
+	CHighlightableButtonsGroup * mapScrollSpeed;
+public:
+	CSystemOptionsWindow(const SDL_Rect & pos, CPlayerInterface * owner); //c-tor
+	~CSystemOptionsWindow(); //d-tor
+
+	//functions for butons
+	void bquitf(); //quit game
+	void breturnf(); //return to game
+
+	void activate();
+	void deactivate();
+	void show(SDL_Surface * to = NULL);
+};
+
+class CTavernWindow : public IShowActivable, public CIntObject
+{
+public:
+	class HeroPortrait : public ClickableL, public ClickableR, public Hoverable
+	{
+	public:
+		std::string hoverName;
+		vstd::assigner<int,int> as;
+		const CGHeroInstance *h;
+		void activate();
+		void deactivate();
+		void clickLeft(boost::logic::tribool down);
+		void clickRight(boost::logic::tribool down);
+		void hover (bool on);
+		HeroPortrait(int &sel, int id, int x, int y, const CGHeroInstance *H);
+		void show(SDL_Surface * to = NULL);
+	} h1, h2;
+
+	SDL_Surface *bg;
+	CStatusBar *bar;
+	int selected;//0 (left) or 1 (right)
+
+	AdventureMapButton *thiefGuild, *cancel, *recruit;
+
+	CTavernWindow(const CGHeroInstance *H1, const CGHeroInstance *H2, const std::string &gossip); //c-tor
+	~CTavernWindow(); //d-tor
+
+	void recruitb();
+	void close();
+	void activate();
+	void deactivate();
+	void show(SDL_Surface * to = NULL);
+};
+
+extern CPlayerInterface * LOCPLINT;
+
+
+#endif // __CPLAYERINTERFACE_H__

+ 16 - 0
README

@@ -0,0 +1,16 @@
+    VCMI Project
+    Copyright (C) 2007-2009  VCMI Team (check AUTHORS file for the contributors list)
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 (included in the license.txt)
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

+ 23 - 17
client/CBitmapHandler.cpp

@@ -167,7 +167,7 @@ SDL_Surface * CPCXConv::getSurface()
 {
 	SDL_Surface * ret;
 
-	BMPHeader bh;
+	int width = -1, height = -1;
 	Epcxformat format;
 	int fSize,y;//,i; //TODO use me 'i'
 	bool check1, check2;
@@ -175,13 +175,13 @@ SDL_Surface * CPCXConv::getSurface()
 	int it=0;
 
 	fSize = readNormalNr(it,4,pcx);it+=4;
-	bh.x = readNormalNr(it,4,pcx);it+=4;
-	bh.y = readNormalNr(it,4,pcx);it+=4;
-	if (fSize==bh.x*bh.y*3)
+	width = readNormalNr(it,4,pcx);it+=4;
+	height = readNormalNr(it,4,pcx);it+=4;
+	if (fSize==width*height*3)
 		check1=true;
 	else 
 		check1=false;
-	if (fSize==bh.x*bh.y)
+	if (fSize==width*height)
 		check2=true;
 	else 
 		check2=false;
@@ -191,12 +191,12 @@ SDL_Surface * CPCXConv::getSurface()
 		format=PCX8B;
 	else 
 		return NULL;
-	add = 4 - bh.x%4;
+	add = 4 - width%4;
 	if (add==4)
 		add=0;
 	if (format==PCX8B)
 	{
-		ret = SDL_CreateRGBSurface(SDL_SWSURFACE, bh.x+add, bh.y, 8, 0, 0, 0, 0);
+		ret = SDL_CreateRGBSurface(SDL_SWSURFACE, width+add, height, 8, 0, 0, 0, 0);
 	}
 	else
 	{
@@ -209,7 +209,7 @@ SDL_Surface * CPCXConv::getSurface()
 		int gmask = 0x00ff00;
 		int rmask = 0xff0000;
 #endif
-		ret = SDL_CreateRGBSurface(SDL_SWSURFACE, bh.x+add, bh.y, 24, rmask, gmask, bmask, 0);
+		ret = SDL_CreateRGBSurface(SDL_SWSURFACE, width+add, height, 24, rmask, gmask, bmask, 0);
 	}
 	if (format==PCX8B)
 	{
@@ -229,10 +229,10 @@ SDL_Surface * CPCXConv::getSurface()
 			tp.unused = 0;
 			*(ret->format->palette->colors+i) = tp;
 		}
-		for (y=bh.y;y>0;y--)
+		for (y=height;y>0;y--)
 		{
-			it=0xC+(y-1)*bh.x;
-			for (int j=0;j<bh.x;j++)
+			it=0xC+(y-1)*width;
+			for (int j=0;j<width;j++)
 			{
 				*((char*)ret->pixels + ret->pitch * (y-1) + ret->format->BytesPerPixel * j) = pcx[it+j];
 			}
@@ -240,17 +240,17 @@ SDL_Surface * CPCXConv::getSurface()
 			{
 				for (int j=0;j<add;j++)
 				{
-					*((char*)ret->pixels + ret->pitch * (y-1) + ret->format->BytesPerPixel * (j+bh.x)) = 0;
+					*((char*)ret->pixels + ret->pitch * (y-1) + ret->format->BytesPerPixel * (j+width)) = 0;
 				}
 			}
 		}
 	}
 	else
 	{
-		for (y=bh.y; y>0; y--)
+		for (y=height; y>0; y--)
 		{
-			it=0xC+(y-1)*bh.x*3;
-			for (int j=0;j<bh.x*3;j++)
+			it=0xC+(y-1)*width*3;
+			for (int j=0;j<width*3;j++)
 			{
 				*((char*)ret->pixels + ret->pitch * (y-1) + j) = pcx[it+j];
 			}
@@ -258,7 +258,7 @@ SDL_Surface * CPCXConv::getSurface()
 			{
 				for (int j=0;j<add*3;j++)
 				{
-					*((char*)ret->pixels + ret->pitch * (y-1) + (j+bh.x*3)) = 0;
+					*((char*)ret->pixels + ret->pitch * (y-1) + (j+width*3)) = 0;
 				}
 			}
 		}
@@ -269,7 +269,10 @@ SDL_Surface * CPCXConv::getSurface()
 SDL_Surface * BitmapHandler::loadBitmap(std::string fname, bool setKey)
 {
 	if(!fname.size())
+	{
+		tlog2 << "Call to loadBitmap with void fname!\n";
 		return NULL;
+	}
 	unsigned char * pcx;
 	std::transform(fname.begin(),fname.end(),fname.begin(),toupper);
 	fname.replace(fname.find_first_of('.'),fname.find_first_of('.')+4,".PCX");
@@ -295,7 +298,10 @@ SDL_Surface * BitmapHandler::loadBitmap(std::string fname, bool setKey)
 			fname.replace(fname.find_first_of('.'),fname.find_first_of('.')+4,".PCX");
 			f = fopen(fname.c_str(),"r");
 			if(!f)
+			{
+				tlog1 << "Cannot open " << fname << " - not present as bmp nor as pcx.\n";
 				return NULL; 
+			}
 			fread(sign,1,3,f);
 			if(sign[0]=='B' && sign[1]=='M') //BMP named as PCX - people (eg. Kulex) sometimes use such files
 			{
@@ -338,7 +344,7 @@ SDL_Surface * BitmapHandler::loadBitmap(std::string fname, bool setKey)
 		int res=bitmaph->infs2(pcd,e->size,e->realSize,pcx);
 		if(res!=0)
 		{
-			tlog2<<"an error "<<res<<" occured while extracting file "<<fname<<std::endl;
+			tlog2<<"an error "<<res<<" occurred while extracting file "<<fname<<std::endl;
 		}
 		delete [] pcd;
 	}

+ 0 - 1
client/CBitmapHandler.h

@@ -29,7 +29,6 @@ public:
 	void fromFile(std::string path);
 	void saveBMP(std::string path);
 	void openPCX(char * PCX, int len);
-	void openPCX();
 	void convert();
 	SDL_Surface * getSurface(); //for standard H3 PCX
 	//SDL_Surface * getSurfaceZ(); //for ZSoft PCX

+ 6 - 6
client/CSpellWindow.cpp

@@ -70,13 +70,13 @@ CSpellWindow::CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * myHer
 	selectedTab(4),
 	spellSite(0)
 {
+	mySpells = myHero->spells;
 	//XXX for testing only
-	//mySpells = myHero->spells;
-	for(ui32 v=0; v<CGI->spellh->spells.size(); ++v)
-	{
-		if(!CGI->spellh->spells[v].creatureAbility)
-			mySpells.insert(v);
-	}
+	//for(ui32 v=0; v<CGI->spellh->spells.size(); ++v)
+	//{
+	//	if(!CGI->spellh->spells[v].creatureAbility)
+	//		mySpells.insert(v);
+	//}
 
 	for(int b=0; b<4; ++b) schoolLvls[b] = 0;
 	for(size_t b=0; b<myHero->secSkills.size(); ++b)

+ 5 - 6
client/VCMI_client.vcproj

@@ -41,7 +41,7 @@
 				Name="VCCLCompilerTool"
 				AdditionalOptions="/MP2"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
+				AdditionalIncludeDirectories="G:\vcmt\repa\include"
 				GeneratePreprocessedFile="0"
 				MinimalRebuild="false"
 				BasicRuntimeChecks="3"
@@ -63,7 +63,7 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib zdll.lib SDL_image.lib SDL_ttf.lib SDL_mixer.lib lua5.1.lib VCMI_lib.lib"
 				ShowProgress="0"
-				AdditionalLibraryDirectories="&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="true"
 				OptimizeReferences="1"
 				TargetMachine="1"
@@ -122,7 +122,7 @@
 				OmitFramePointers="true"
 				EnableFiberSafeOptimizations="true"
 				WholeProgramOptimization="true"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
+				AdditionalIncludeDirectories="G:\vcmt\repa\include"
 				StringPooling="true"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
@@ -143,13 +143,12 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib zdll.lib SDL_image.lib SDL_ttf.lib SDL_mixer.lib lua5.1.lib VCMI_lib.lib"
-				OutputFile="F:\3DO\Heroes3\$(ProjectName).exe"
-				AdditionalLibraryDirectories="&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="true"
 				Driver="0"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
-				LinkTimeCodeGeneration="1"
+				LinkTimeCodeGeneration="0"
 				TargetMachine="1"
 				Profile="true"
 			/>

+ 5 - 6
lib/VCMI_lib.vcproj

@@ -41,7 +41,7 @@
 				Name="VCCLCompilerTool"
 				AdditionalOptions="/MP2"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
+				AdditionalIncludeDirectories="G:\vcmt\repa\include"
 				MinimalRebuild="false"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -61,7 +61,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib zdll.lib SDL_image.lib SDL_ttf.lib"
-				AdditionalLibraryDirectories="&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="true"
 				TargetMachine="1"
 			/>
@@ -118,7 +118,7 @@
 				OmitFramePointers="true"
 				EnableFiberSafeOptimizations="true"
 				WholeProgramOptimization="true"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
+				AdditionalIncludeDirectories="G:\vcmt\repa\include"
 				StringPooling="true"
 				MinimalRebuild="false"
 				BasicRuntimeChecks="0"
@@ -139,13 +139,12 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="zdll.lib"
-				OutputFile="F:\3DO\Heroes3\$(ProjectName).dll"
 				Version=""
-				AdditionalLibraryDirectories="&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="false"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
-				LinkTimeCodeGeneration="1"
+				LinkTimeCodeGeneration="0"
 				TargetMachine="1"
 			/>
 			<Tool

+ 2 - 5
server/VCMI_server.vcproj

@@ -41,7 +41,6 @@
 				Name="VCCLCompilerTool"
 				AdditionalOptions="/MP2"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
 				MinimalRebuild="false"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -61,7 +60,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="VCMI_lib.lib  zdll.lib"
-				AdditionalLibraryDirectories="&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="true"
 				TargetMachine="1"
 			/>
@@ -117,7 +116,6 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="true"
 				EnableFiberSafeOptimizations="true"
-				AdditionalIncludeDirectories="&quot;E:\C++\Lua_includes&quot;;&quot;E:\vcmi\rep - assembla\trunk\lua src&quot;;&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\boost_1_36_0&quot;;&quot;E:\C++\SDL_mixer-1.2.7\include&quot;;&quot;E:\C++\SDL_ttf-2.0.8\include&quot;;&quot;E:\C++\zlib 1.2.3 binaries\include&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\include&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\include&quot;"
 				StringPooling="true"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="false"
@@ -137,8 +135,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="VCMI_lib.lib  zdll.lib"
-				OutputFile="F:\3DO\Heroes3\$(ProjectName).exe"
-				AdditionalLibraryDirectories="&quot;E:\vcmi\rep - assembla\trunk&quot;;&quot;E:\C++\lua bin&quot;;&quot;E:\C++\boost_1_36_0\lib&quot;;&quot;E:\C++\SDL_mixer-1.2.7\lib&quot;;&quot;E:\C++\SDL_ttf-2.0.8\lib&quot;;&quot;E:\C++\zlib 1.2.3 binaries\lib&quot;;&quot;E:\C++\SDL-1.2.11\devlibs - visual\SDL-1.2.11\lib&quot;;&quot;E:\C++\SDL_Image 1.2.5\SDL_image-1.2.5\lib&quot;"
+				AdditionalLibraryDirectories="G:\vcmt\repa\libs"
 				GenerateDebugInformation="false"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"