1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

corrected that missclick! hope so

This commit is contained in:
Łukasz Wychrystenko
2008-12-26 01:15:47 +00:00
parent fa38b6ef79
commit b356524aee
44 changed files with 6029 additions and 3728 deletions

View File

@ -1,181 +1,181 @@
#ifndef __GENIUS_AI__ #ifndef __CGENIUSAI_H__
#define __GENIUS_AI__ #define __CGENIUSAI_H__
#define VCMI_DLL #define VCMI_DLL
#pragma warning (disable: 4100 4251 4245 4018 4081) #pragma warning (disable: 4100 4251 4245 4018 4081)
#include "../../global.h" #include "../../global.h"
#include "../../AI_Base.h" #include "../../AI_Base.h"
#include "../../CCallback.h" #include "../../CCallback.h"
#include "../../hch/CCreatureHandler.h" #include "../../hch/CCreatureHandler.h"
#include "../../hch/CObjectHandler.h" #include "../../hch/CObjectHandler.h"
#pragma warning (default: 4100 4251 4245 4018 4081) #pragma warning (default: 4100 4251 4245 4018 4081)
#pragma warning (disable: 4100) #pragma warning (disable: 4100)
namespace GeniusAI { namespace GeniusAI {
class CBattleHelper class CBattleHelper
{ {
public: public:
CBattleHelper(); CBattleHelper();
~CBattleHelper(); ~CBattleHelper();
int GetBattleFieldPosition(int x, int y); int GetBattleFieldPosition(int x, int y);
int DecodeXPosition(int battleFieldPosition); int DecodeXPosition(int battleFieldPosition);
int DecodeYPosition(int battleFieldPosition); int DecodeYPosition(int battleFieldPosition);
int GetShortestDistance(int pointA, int pointB); int GetShortestDistance(int pointA, int pointB);
int GetDistanceWithObstacles(int pointA, int pointB); int GetDistanceWithObstacles(int pointA, int pointB);
int GetVoteForMaxDamage() const { return m_voteForMaxDamage; } int GetVoteForMaxDamage() const { return m_voteForMaxDamage; }
int GetVoteForMinDamage() const { return m_voteForMinDamage; } int GetVoteForMinDamage() const { return m_voteForMinDamage; }
int GetVoteForMaxSpeed() const { return m_voteForMaxSpeed; } int GetVoteForMaxSpeed() const { return m_voteForMaxSpeed; }
int GetVoteForDistance() const { return m_voteForDistance; } int GetVoteForDistance() const { return m_voteForDistance; }
int GetVoteForDistanceFromShooters() const { return m_voteForDistanceFromShooters; } int GetVoteForDistanceFromShooters() const { return m_voteForDistanceFromShooters; }
int GetVoteForHitPoints() const { return m_voteForHitPoints; } int GetVoteForHitPoints() const { return m_voteForHitPoints; }
const int InfiniteDistance; const int InfiniteDistance;
const int BattlefieldWidth; const int BattlefieldWidth;
const int BattlefieldHeight; const int BattlefieldHeight;
private: private:
int m_voteForMaxDamage; int m_voteForMaxDamage;
int m_voteForMinDamage; int m_voteForMinDamage;
int m_voteForMaxSpeed; int m_voteForMaxSpeed;
int m_voteForDistance; int m_voteForDistance;
int m_voteForDistanceFromShooters; int m_voteForDistanceFromShooters;
int m_voteForHitPoints; int m_voteForHitPoints;
CBattleHelper(const CBattleHelper &); CBattleHelper(const CBattleHelper &);
CBattleHelper &operator=(const CBattleHelper &); CBattleHelper &operator=(const CBattleHelper &);
}; };
/** /**
* Maybe it is a additional proxy, but i've separated the game IA for transparent. * Maybe it is a additional proxy, but i've separated the game IA for transparent.
*/ */
class CBattleLogic class CBattleLogic
{ {
private: private:
enum EMainStrategyType enum EMainStrategyType
{ {
strategy_super_aggresive, strategy_super_aggresive,
strategy_aggresive, strategy_aggresive,
strategy_neutral, strategy_neutral,
strategy_defensive, strategy_defensive,
strategy_super_defensive, strategy_super_defensive,
strategy_berserk_attack /** cause max damage, usually when creatures fight against overwhelming army*/ strategy_berserk_attack /** cause max damage, usually when creatures fight against overwhelming army*/
}; };
enum ECreatureRoleInBattle enum ECreatureRoleInBattle
{ {
creature_role_shooter, creature_role_shooter,
creature_role_defenser, creature_role_defenser,
creature_role_fast_attacker, creature_role_fast_attacker,
creature_role_attacker creature_role_attacker
}; };
enum EActionType enum EActionType
{ {
action_cancel = 0, // Cancel BattleAction action_cancel = 0, // Cancel BattleAction
action_cast_spell = 1, // Hero cast a spell action_cast_spell = 1, // Hero cast a spell
action_walk = 2, // Walk action_walk = 2, // Walk
action_defend = 3, // Defend action_defend = 3, // Defend
action_retreat = 4, // Retreat from the battle action_retreat = 4, // Retreat from the battle
action_surrender = 5, // Surrender action_surrender = 5, // Surrender
action_walk_and_attack = 6, // Walk and Attack action_walk_and_attack = 6, // Walk and Attack
action_shoot = 7, // Shoot action_shoot = 7, // Shoot
action_wait = 8, // Wait action_wait = 8, // Wait
action_catapult = 9, // Catapult action_catapult = 9, // Catapult
action_monster_casts_spell = 10 // Monster casts a spell (i.e. Faerie Dragons) action_monster_casts_spell = 10 // Monster casts a spell (i.e. Faerie Dragons)
}; };
struct SCreatureCasualties struct SCreatureCasualties
{ {
int amount_max; // amount of creatures that will be dead int amount_max; // amount of creatures that will be dead
int amount_min; int amount_min;
int damage_max; // number of hit points that creature will lost int damage_max; // number of hit points that creature will lost
int damage_min; int damage_min;
int leftHitPoints_for_max; // number of hit points that will remain (for last unity) int leftHitPoints_for_max; // number of hit points that will remain (for last unity)
int leftHitPoint_for_min; // scenario int leftHitPoint_for_min; // scenario
}; };
public: public:
CBattleLogic(ICallback *cb, CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side); CBattleLogic(ICallback *cb, CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side);
~CBattleLogic(); ~CBattleLogic();
void SetCurrentTurn(int turn); void SetCurrentTurn(int turn);
BattleAction MakeDecision(int stackID); BattleAction MakeDecision(int stackID);
private: private:
CBattleHelper m_battleHelper; CBattleHelper m_battleHelper;
//BattleInfo m_battleInfo; //BattleInfo m_battleInfo;
int m_iCurrentTurn; int m_iCurrentTurn;
bool m_bIsAttacker; bool m_bIsAttacker;
ICallback *m_cb; ICallback *m_cb;
CCreatureSet *m_army1; CCreatureSet *m_army1;
CCreatureSet *m_army2; CCreatureSet *m_army2;
int3 m_tile; int3 m_tile;
CGHeroInstance *m_hero1; CGHeroInstance *m_hero1;
CGHeroInstance *m_hero2; CGHeroInstance *m_hero2;
bool m_side; bool m_side;
void MakeStatistics(int currentCreatureId); // before decision we have to make some calculation and simulation void MakeStatistics(int currentCreatureId); // before decision we have to make some calculation and simulation
// statistics // statistics
typedef std::vector<std::pair<int, int> > creature_stat; // first - creature id, second - value typedef std::vector<std::pair<int, int> > creature_stat; // first - creature id, second - value
creature_stat m_statMaxDamage; creature_stat m_statMaxDamage;
creature_stat m_statMinDamage; creature_stat m_statMinDamage;
// //
creature_stat m_statMaxSpeed; creature_stat m_statMaxSpeed;
creature_stat m_statDistance; creature_stat m_statDistance;
creature_stat m_statDistanceFromShooters; creature_stat m_statDistanceFromShooters;
creature_stat m_statHitPoints; creature_stat m_statHitPoints;
typedef std::vector<std::pair<int, SCreatureCasualties> > creature_stat_casualties; typedef std::vector<std::pair<int, SCreatureCasualties> > creature_stat_casualties;
creature_stat_casualties m_statCasualties; creature_stat_casualties m_statCasualties;
bool m_bEnemyDominates; bool m_bEnemyDominates;
std::vector<int> GetAvailableHexesForAttacker(CStack *defender, CStack *attacker = NULL); std::vector<int> GetAvailableHexesForAttacker(CStack *defender, CStack *attacker = NULL);
BattleAction MakeDefend(int stackID); BattleAction MakeDefend(int stackID);
int PerformBerserkAttack(int stackID); // return ID of creature to attack, -2 means wait, -1 - defend int PerformBerserkAttack(int stackID); // return ID of creature to attack, -2 means wait, -1 - defend
int PerformDefaultAction(int stackID); int PerformDefaultAction(int stackID);
void CBattleLogic::PrintBattleAction(const BattleAction &action); void CBattleLogic::PrintBattleAction(const BattleAction &action);
}; };
class CGeniusAI : public CGlobalAI class CGeniusAI : public CGlobalAI
{ {
private: private:
ICallback *m_cb; ICallback *m_cb;
CBattleLogic *m_battleLogic; CBattleLogic *m_battleLogic;
public: public:
virtual void init(ICallback * CB); virtual void init(ICallback * CB);
virtual void yourTurn(); virtual void yourTurn();
virtual void heroKilled(const CGHeroInstance *); virtual void heroKilled(const CGHeroInstance *);
virtual void heroCreated(const CGHeroInstance *); virtual void heroCreated(const CGHeroInstance *);
virtual void heroMoved(const HeroMoveDetails &); virtual void heroMoved(const HeroMoveDetails &);
virtual void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val) {}; virtual void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val) {};
virtual void showSelDialog(std::string text, std::vector<CSelectableComponent*> & components, int askID){}; virtual void showSelDialog(std::string text, std::vector<CSelectableComponent*> & components, int askID){};
virtual void tileRevealed(int3 pos){}; virtual void tileRevealed(int3 pos){};
virtual void tileHidden(int3 pos){}; virtual void tileHidden(int3 pos){};
virtual void heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback); virtual void heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback);
// battle // battle
virtual void actionFinished(const BattleAction *action);//occurs AFTER every action taken by any stack or by the hero virtual void actionFinished(const BattleAction *action);//occurs AFTER every action taken by any stack or by the hero
virtual void actionStarted(const BattleAction *action);//occurs BEFORE every action taken by any stack or by the hero virtual void actionStarted(const BattleAction *action);//occurs BEFORE every action taken by any stack or by the hero
virtual void battleAttack(BattleAttack *ba); //called when stack is performing attack virtual void battleAttack(BattleAttack *ba); //called when stack is performing attack
virtual void battleStackAttacked(BattleStackAttacked * bsa); //called when stack receives damage (after battleAttack()) virtual void battleStackAttacked(BattleStackAttacked * bsa); //called when stack receives damage (after battleAttack())
virtual void battleEnd(BattleResult *br); virtual void battleEnd(BattleResult *br);
virtual void battleNewRound(int round); //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn virtual void battleNewRound(int round); //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
virtual void battleStackMoved(int ID, int dest); virtual void battleStackMoved(int ID, int dest);
virtual void battleSpellCasted(SpellCasted *sc); virtual void battleSpellCasted(SpellCasted *sc);
virtual 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 virtual 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
virtual void battlefieldPrepared(int battlefieldType, std::vector<CObstacle*> obstacles); //called when battlefield is prepared, prior the battle beginning virtual void battlefieldPrepared(int battlefieldType, std::vector<CObstacle*> obstacles); //called when battlefield is prepared, prior the battle beginning
// //
virtual void battleStackMoved(int ID, int dest, bool startMoving, bool endMoving); virtual void battleStackMoved(int ID, int dest, bool startMoving, bool endMoving);
virtual void battleStackAttacking(int ID, int dest); virtual void battleStackAttacking(int ID, int dest);
virtual void battleStackIsAttacked(int ID, int dmg, int killed, int IDby, bool byShooting); virtual void battleStackIsAttacked(int ID, int dmg, int killed, int IDby, bool byShooting);
virtual BattleAction activeStack(int stackID); virtual BattleAction activeStack(int stackID);
}; };
} }
#endif/*__GENIUS_AI__*/ #endif // __CGENIUSAI_H__

View File

@ -1,14 +1,14 @@
#ifndef AIBASE_H #ifndef __AI_BASE_H__
#define AIBASE_H #define __AI_BASE_H__
#ifndef __AI_BASE_H__
#ifdef _MSC_VER #define __AI_BASE_H__
#pragma once
#endif
#include <vector>
#include <vector> #include <iostream>
#include <iostream> #include "CGameInterface.h"
#include "CGameInterface.h"
#define AI_INTERFACE_VER 1
#define AI_INTERFACE_VER 1
#endif // __AI_BASE_H__
#endif //AIBASE_H #endif // __AI_BASE_H__

View File

@ -1,101 +1,98 @@
#ifndef ADVENTUREMAPBUTTON_H #ifndef ADVENTUREMAPBUTTON_H
#define ADVENTUREMAPBUTTON_H #define ADVENTUREMAPBUTTON_H
#ifdef _MSC_VER
#pragma once
#endif #include "CPlayerInterface.h"
#include "client/FunctionList.h"
#include <boost/bind.hpp>
#include "CPlayerInterface.h"
#include "client/FunctionList.h" namespace config{struct ButtonInfo;}
#include <boost/bind.hpp>
class AdventureMapButton
namespace config{struct ButtonInfo;} : public ClickableR, public Hoverable, public KeyShortcut, public CButtonBase
{
class AdventureMapButton public:
: public ClickableR, public Hoverable, public KeyShortcut, public CButtonBase std::map<int,std::string> hoverTexts; //state -> text for statusbar
{ std::string helpBox; //for right-click help
public: CFunctionList<void()> callback;
std::map<int,std::string> hoverTexts; //state -> text for statusbar bool colorChange, blocked,
std::string helpBox; //for right-click help actOnDown; //runs when mouse is pressed down over it, not when up
CFunctionList<void()> callback;
bool colorChange, blocked, void clickRight (tribool down);
actOnDown; //runs when mouse is pressed down over it, not when up virtual void clickLeft (tribool down);
void hover (bool on);
void clickRight (tribool down); void block(bool on); //if button is blocked then it'll change it's graphic to inactive (offset==2) and won't react on l-clicks
virtual void clickLeft (tribool down); void activate(); // makes button active
void hover (bool on); void deactivate(); // makes button inactive (but doesn't delete)
void block(bool on); //if button is blocked then it'll change it's graphic to inactive (offset==2) and won't react on l-clicks
void activate(); // makes button active AdventureMapButton(); //c-tor
void deactivate(); // makes button inactive (but doesn't delete) AdventureMapButton( const std::map<int,std::string> &, const std::string &HelpBox, const CFunctionList<void()> &Callback, int x, int y, const std::string &defName, int key=0, std::vector<std::string> * add = NULL, bool playerColoredButton = false );//c-tor
AdventureMapButton( const std::string &Name, const std::string &HelpBox, const CFunctionList<void()> &Callback, int x, int y, const std::string &defName, int key=0, std::vector<std::string> * add = NULL, bool playerColoredButton = false );//c-tor
AdventureMapButton(); //c-tor AdventureMapButton( const std::string &Name, const std::string &HelpBox, const CFunctionList<void()> &Callback, config::ButtonInfo *info, int key=0);//c-tor
AdventureMapButton( const std::map<int,std::string> &, const std::string &HelpBox, const CFunctionList<void()> &Callback, int x, int y, const std::string &defName, int key=0, std::vector<std::string> * add = NULL, bool playerColoredButton = false );//c-tor //AdventureMapButton( std::string Name, std::string HelpBox, boost::function<void()> Callback, int x, int y, std::string defName, bool activ=false, std::vector<std::string> * add = NULL, bool playerColoredButton = false );//c-tor
AdventureMapButton( const std::string &Name, const std::string &HelpBox, const CFunctionList<void()> &Callback, int x, int y, const std::string &defName, int key=0, std::vector<std::string> * add = NULL, bool playerColoredButton = false );//c-tor
AdventureMapButton( const std::string &Name, const std::string &HelpBox, const CFunctionList<void()> &Callback, config::ButtonInfo *info, int key=0);//c-tor void init(const CFunctionList<void()> &Callback, const std::map<int,std::string> &Name, const std::string &HelpBox, bool playerColoredButton, const std::string &defName, std::vector<std::string> * add, int x, int y, int key );
//AdventureMapButton( std::string Name, std::string HelpBox, boost::function<void()> Callback, int x, int y, std::string defName, bool activ=false, std::vector<std::string> * add = NULL, bool playerColoredButton = false );//c-tor };
void init(const CFunctionList<void()> &Callback, const std::map<int,std::string> &Name, const std::string &HelpBox, bool playerColoredButton, const std::string &defName, std::vector<std::string> * add, int x, int y, int key ); class CHighlightableButton
}; : public AdventureMapButton
{
class CHighlightableButton public:
: public AdventureMapButton CHighlightableButton(const CFunctionList<void()> &onSelect, const CFunctionList<void()> &onDeselect, const std::map<int,std::string> &Name, const std::string &HelpBox, bool playerColoredButton, const std::string &defName, std::vector<std::string> * add, int x, int y, int key=0 );
{ bool selected, onlyOn;
public: CFunctionList<void()> callback2; //when disselecting
CHighlightableButton(const CFunctionList<void()> &onSelect, const CFunctionList<void()> &onDeselect, const std::map<int,std::string> &Name, const std::string &HelpBox, bool playerColoredButton, const std::string &defName, std::vector<std::string> * add, int x, int y, int key=0 ); void select(bool on);
bool selected, onlyOn; void clickLeft (tribool down);
CFunctionList<void()> callback2; //when disselecting };
void select(bool on);
void clickLeft (tribool down); class CHighlightableButtonsGroup
}; {
public:
class CHighlightableButtonsGroup CFunctionList2<void(int)> onChange; //called when changing selected button with new button's id
{ std::vector<CHighlightableButton*> buttons;
public:
CFunctionList2<void(int)> onChange; //called when changing selected button with new button's id //void addButton(const std::map<int,std::string> &tooltip, const std::string &HelpBox, const std::string &defName, int x, int y, int uid);
std::vector<CHighlightableButton*> buttons; void addButton(CHighlightableButton* bt);//add existing button, it'll be deleted by CHighlightableButtonsGroup destructor
void addButton(const std::map<int,std::string> &tooltip, const std::string &HelpBox, const std::string &defName, int x, int y, int uid, const CFunctionList<void()> &OnSelect=0, int key=0); //creates new button
//void addButton(const std::map<int,std::string> &tooltip, const std::string &HelpBox, const std::string &defName, int x, int y, int uid); CHighlightableButtonsGroup(const CFunctionList2<void(int)> &OnChange);
void addButton(CHighlightableButton* bt);//add existing button, it'll be deleted by CHighlightableButtonsGroup destructor ~CHighlightableButtonsGroup();
void addButton(const std::map<int,std::string> &tooltip, const std::string &HelpBox, const std::string &defName, int x, int y, int uid, const CFunctionList<void()> &OnSelect=0, int key=0); //creates new button void activate();
CHighlightableButtonsGroup(const CFunctionList2<void(int)> &OnChange); void deactivate();
~CHighlightableButtonsGroup(); void select(int id, bool mode); //mode==0: id is serial; mode==1: id is unique button id
void activate(); void selectionChanged(int to);
void deactivate(); void show(SDL_Surface * to = NULL);
void select(int id, bool mode); //mode==0: id is serial; mode==1: id is unique button id };
void selectionChanged(int to);
void show(SDL_Surface * to = NULL);
}; class CSlider : public IShowable, public MotionInterested, public ClickableL
{
public:
class CSlider : public IShowable, public MotionInterested, public ClickableL AdventureMapButton left, right, slider; //if vertical then left=up
{ int capacity,//how many elements can be active at same time
public: amount, //how many elements
AdventureMapButton left, right, slider; //if vertical then left=up value; //first active element
int capacity,//how many elements can be active at same time bool horizontal, moving;
amount, //how many elements CDefEssential *imgs ;
value; //first active element
bool horizontal, moving; boost::function<void(int)> moved;
CDefEssential *imgs ; //void(T::*moved)(int to);
//T* owner;
boost::function<void(int)> moved;
//void(T::*moved)(int to); void redrawSlider();
//T* owner;
void sliderClicked();
void redrawSlider(); void moveLeft();
void clickLeft (tribool down);
void sliderClicked(); void mouseMoved (const SDL_MouseMotionEvent & sEvent);
void moveLeft(); void moveRight();
void clickLeft (tribool down); void moveTo(int to);
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void block(bool on);
void moveRight(); void activate(); // makes button active
void moveTo(int to); void deactivate(); // makes button inactive (but doesn't delete)
void block(bool on); void show(SDL_Surface * to = NULL);
void activate(); // makes button active CSlider(int x, int y, int totalw, boost::function<void(int)> Moved, int Capacity, int Amount,
void deactivate(); // makes button inactive (but doesn't delete) int Value=0, bool Horizontal=true);
void show(SDL_Surface * to = NULL); ~CSlider();
CSlider(int x, int y, int totalw, boost::function<void(int)> Moved, int Capacity, int Amount, };
int Value=0, bool Horizontal=true); #endif //ADVENTUREMAPBUTTON_H
~CSlider();
};
#endif //ADVENTUREMAPBUTTON_H

View File

@ -1,177 +1,177 @@
#ifndef CADVENTUREMAPINTERFACE_H #ifndef __CADVMAPINTERFACE_H__
#define CADVENTUREMAPINTERFACE_H #define __CADVMAPINTERFACE_H__
#include <typeinfo> #include <typeinfo>
#include "global.h" #include "global.h"
#include "SDL.h" #include "SDL.h"
#include "CPlayerInterface.h" #include "CPlayerInterface.h"
#include <map> #include <map>
#include "AdventureMapButton.h" #include "AdventureMapButton.h"
class CDefHandler; class CDefHandler;
class CCallback; class CCallback;
struct CPath; struct CPath;
class CAdvMapInt; class CAdvMapInt;
class CGHeroInstance; class CGHeroInstance;
class CGTownInstance; class CGTownInstance;
class CHeroWindow; class CHeroWindow;
/*****************************/ /*****************************/
class CMinimap class CMinimap
: public ClickableL, public ClickableR, public Hoverable, public MotionInterested, public virtual CIntObject : public ClickableL, public ClickableR, public Hoverable, public MotionInterested, public virtual CIntObject
{ {
public: public:
SDL_Surface * radar; SDL_Surface * radar;
SDL_Surface * temps; SDL_Surface * temps;
std::map<int,SDL_Color> colors; std::map<int,SDL_Color> colors;
std::map<int,SDL_Color> colorsBlocked; std::map<int,SDL_Color> colorsBlocked;
std::vector<SDL_Surface *> map, FoW; //one bitmap for each level (terrain, Fog of War) std::vector<SDL_Surface *> map, FoW; //one bitmap for each level (terrain, Fog of War)
//TODO flagged buildings //TODO flagged buildings
std::string statusbarTxt, rcText; std::string statusbarTxt, rcText;
CMinimap(bool draw=true); CMinimap(bool draw=true);
void draw(); void draw();
void redraw(int level=-1);// (level==-1) => redraw all levels void redraw(int level=-1);// (level==-1) => redraw all levels
void updateRadar(); void updateRadar();
void clickRight (tribool down); void clickRight (tribool down);
void clickLeft (tribool down); void clickLeft (tribool down);
void hover (bool on); void hover (bool on);
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent);
void activate(); // makes button active void activate(); // makes button active
void deactivate(); // makes button inactive (but don't deletes) void deactivate(); // makes button inactive (but don't deletes)
void hideTile(const int3 &pos); //puts FoW void hideTile(const int3 &pos); //puts FoW
void showTile(const int3 &pos); //removes FoW void showTile(const int3 &pos); //removes FoW
}; };
class CTerrainRect class CTerrainRect
: public ClickableL, public ClickableR, public Hoverable, public MotionInterested : public ClickableL, public ClickableR, public Hoverable, public MotionInterested
{ {
public: public:
int tilesw, tilesh; //width and height of terrain to blit in tiles int tilesw, tilesh; //width and height of terrain to blit in tiles
int3 curHoveredTile; int3 curHoveredTile;
int moveX, moveY; //shift between actual position of screen and the one we wil blit; ranges from -31 to 31 (in pixels) int moveX, moveY; //shift between actual position of screen and the one we wil blit; ranges from -31 to 31 (in pixels)
CDefHandler * arrows; CDefHandler * arrows;
CTerrainRect(); CTerrainRect();
CPath * currentPath; CPath * currentPath;
void activate(); void activate();
void deactivate(); void deactivate();
void clickLeft(tribool down); void clickLeft(tribool down);
void clickRight(tribool down); void clickRight(tribool down);
void hover(bool on); void hover(bool on);
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent);
void show(); void show();
void showPath(); void showPath();
int3 whichTileIsIt(const int & x, const int & y); //x,y are cursor position int3 whichTileIsIt(const int & x, const int & y); //x,y are cursor position
int3 whichTileIsIt(); //uses current cursor pos int3 whichTileIsIt(); //uses current cursor pos
}; };
class CResDataBar class CResDataBar
:public ClickableR, public virtual CIntObject :public ClickableR, public virtual CIntObject
{ {
public: public:
SDL_Surface * bg; SDL_Surface * bg;
std::vector<std::pair<int,int> > txtpos; std::vector<std::pair<int,int> > txtpos;
std::string datetext; std::string datetext;
void clickRight (tribool down); void clickRight (tribool down);
void activate(); void activate();
void deactivate(); void deactivate();
CResDataBar(); CResDataBar();
CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist); CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist);
~CResDataBar(); ~CResDataBar();
void draw(); void draw();
}; };
class CInfoBar class CInfoBar
:public virtual CIntObject, public TimeInterested :public virtual CIntObject, public TimeInterested
{ {
public: public:
CDefHandler *day, *week1, *week2, *week3, *week4; CDefHandler *day, *week1, *week2, *week3, *week4;
SComponent * current; SComponent * current;
int mode; int mode;
int pom; int pom;
CInfoBar(); CInfoBar();
~CInfoBar(); ~CInfoBar();
void newDay(int Day); void newDay(int Day);
void showComp(SComponent * comp, int time=5000); void showComp(SComponent * comp, int time=5000);
void tick(); void tick();
void draw(const CGObjectInstance * specific=NULL); // if specific==0 function draws info about selected hero/town void draw(const CGObjectInstance * specific=NULL); // if specific==0 function draws info about selected hero/town
void blitAnim(int mode);//0 - day, 1 - week void blitAnim(int mode);//0 - day, 1 - week
CDefHandler * getAnim(int mode); CDefHandler * getAnim(int mode);
}; };
/*****************************/ /*****************************/
class CAdvMapInt : public CMainInterface, public KeyInterested //adventure map interface class CAdvMapInt : public CMainInterface, public KeyInterested //adventure map interface
{ {
public: public:
CAdvMapInt(int Player); CAdvMapInt(int Player);
~CAdvMapInt(); ~CAdvMapInt();
int3 position; //top left corner of visible map part int3 position; //top left corner of visible map part
int player; int player;
std::vector<CDefHandler *> gems; std::vector<CDefHandler *> gems;
bool scrollingLeft ; bool scrollingLeft ;
bool scrollingRight ; bool scrollingRight ;
bool scrollingUp ; bool scrollingUp ;
bool scrollingDown ; bool scrollingDown ;
bool updateScreen, updateMinimap ; bool updateScreen, updateMinimap ;
unsigned char anim, animValHitCount; //animation frame unsigned char anim, animValHitCount; //animation frame
unsigned char heroAnim, heroAnimValHitCount; //animation frame unsigned char heroAnim, heroAnimValHitCount; //animation frame
CMinimap minimap; CMinimap minimap;
SDL_Surface * bg; SDL_Surface * bg;
AdventureMapButton kingOverview,//- kingdom overview AdventureMapButton kingOverview,//- kingdom overview
underground,//- underground switch underground,//- underground switch
questlog,//- questlog questlog,//- questlog
sleepWake, //- sleep/wake hero sleepWake, //- sleep/wake hero
moveHero, //- move hero moveHero, //- move hero
spellbook,//- spellbook spellbook,//- spellbook
advOptions, //- adventure options advOptions, //- adventure options
sysOptions,//- system options sysOptions,//- system options
nextHero, //- next hero nextHero, //- next hero
endTurn;//- end turn endTurn;//- end turn
//CHeroList herolist; //CHeroList herolist;
CTerrainRect terrain; //visible terrain CTerrainRect terrain; //visible terrain
CStatusBar statusbar; CStatusBar statusbar;
CResDataBar resdatabar; CResDataBar resdatabar;
CHeroList heroList; CHeroList heroList;
CTownList townList; CTownList townList;
CInfoBar infoBar; CInfoBar infoBar;
CHeroWindow * heroWindow; CHeroWindow * heroWindow;
const CArmedInstance *selection; const CArmedInstance *selection;
//fuctions binded to buttons //fuctions binded to buttons
void fshowOverview(); void fshowOverview();
void fswitchLevel(); void fswitchLevel();
void fshowQuestlog(); void fshowQuestlog();
void fsleepWake(); void fsleepWake();
void fmoveHero(); void fmoveHero();
void fshowSpellbok(); void fshowSpellbok();
void fadventureOPtions(); void fadventureOPtions();
void fsystemOptions(); void fsystemOptions();
void fnextHero(); void fnextHero();
void fendTurn(); void fendTurn();
void activate(); void activate();
void deactivate(); void deactivate();
void show(SDL_Surface * to=NULL); //shows and activates adv. map interface void show(SDL_Surface * to=NULL); //shows and activates adv. map interface
void hide(); //deactivates advmap interface void hide(); //deactivates advmap interface
void update(); //redraws terrain void update(); //redraws terrain
void select(const CArmedInstance *sel); void select(const CArmedInstance *sel);
void selectionChanged(); void selectionChanged();
void centerOn(int3 on); void centerOn(int3 on);
int3 verifyPos(int3 ver); int3 verifyPos(int3 ver);
void handleRightClick(std::string text, tribool down, CIntObject * client); void handleRightClick(std::string text, tribool down, CIntObject * client);
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key);
}; };
#endif //CADVENTUREMAPINTERFACE_H #endif // __CADVMAPINTERFACE_H__

View File

@ -1,261 +1,258 @@
#ifndef CBATTLEINTERFACE_H #ifndef CBATTLEINTERFACE_H
#define CBATTLEINTERFACE_H #define CBATTLEINTERFACE_H
#ifdef _MSC_VER
#pragma once
#endif #include "global.h"
#include "CPlayerInterface.h"
#include <list>
#include "global.h"
#include "CPlayerInterface.h" class CCreatureSet;
#include <list> class CGHeroInstance;
class CDefHandler;
class CCreatureSet; class CStack;
class CGHeroInstance; class CCallback;
class CDefHandler; class AdventureMapButton;
class CStack; class CHighlightableButton;
class CCallback; class CHighlightableButtonsGroup;
class AdventureMapButton; struct BattleResult;
class CHighlightableButton; struct SpellCasted;
class CHighlightableButtonsGroup; template <typename T> struct CondSh;
struct BattleResult;
struct SpellCasted; class CBattleInterface;
template <typename T> struct CondSh;
class CBattleHero : public IShowable, public ClickableL
class CBattleInterface; {
public:
class CBattleHero : public IShowable, public ClickableL bool flip; //false if it's attacking hero, true otherwise
{ CDefHandler * dh, *flag; //animation and flag
public: const CGHeroInstance * myHero; //this animation's hero instance
bool flip; //false if it's attacking hero, true otherwise const CBattleInterface * myOwner; //battle interface to which this animation is assigned
CDefHandler * dh, *flag; //animation and flag int phase; //stage of animation
const CGHeroInstance * myHero; //this animation's hero instance int image; //frame of animation
const CBattleInterface * myOwner; //battle interface to which this animation is assigned unsigned char flagAnim, flagAnimCount; //for flag animation
int phase; //stage of animation void show(SDL_Surface * to); //prints next frame of animation to to
int image; //frame of animation void activate();
unsigned char flagAnim, flagAnimCount; //for flag animation void deactivate();
void show(SDL_Surface * to); //prints next frame of animation to to void setPhase(int newPhase);
void activate(); void clickLeft(boost::logic::tribool down);
void deactivate(); CBattleHero(const std::string & defName, int phaseG, int imageG, bool filpG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner); //c-tor
void setPhase(int newPhase); ~CBattleHero(); //d-tor
void clickLeft(boost::logic::tribool down); };
CBattleHero(const std::string & defName, int phaseG, int imageG, bool filpG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner); //c-tor
~CBattleHero(); //d-tor class CBattleHex : public Hoverable, public MotionInterested, public ClickableL, public ClickableR
}; {
private:
class CBattleHex : public Hoverable, public MotionInterested, public ClickableL, public ClickableR bool setAlterText; //if true, this hex has set alternative text in console and will clean it
{ public:
private: unsigned int myNumber;
bool setAlterText; //if true, this hex has set alternative text in console and will clean it bool accesible;
public: //CStack * ourStack;
unsigned int myNumber; bool hovered, strictHovered;
bool accesible; CBattleInterface * myInterface; //interface that owns me
//CStack * ourStack; static std::pair<int, int> getXYUnitAnim(const int & hexNum, const bool & attacker, const CCreature * creature); //returns (x, y) of left top corner of animation
bool hovered, strictHovered; //for user interactions
CBattleInterface * myInterface; //interface that owns me void hover (bool on);
static std::pair<int, int> getXYUnitAnim(const int & hexNum, const bool & attacker, const CCreature * creature); //returns (x, y) of left top corner of animation void activate();
//for user interactions void deactivate();
void hover (bool on); void mouseMoved (const SDL_MouseMotionEvent & sEvent);
void activate(); void clickLeft(boost::logic::tribool down);
void deactivate(); void clickRight(boost::logic::tribool down);
void mouseMoved (const SDL_MouseMotionEvent & sEvent); CBattleHex();
void clickLeft(boost::logic::tribool down); };
void clickRight(boost::logic::tribool down);
CBattleHex(); class CBattleObstacle
}; {
std::vector<int> lockedHexes;
class CBattleObstacle };
{
std::vector<int> lockedHexes; class CBattleConsole : public IShowable, public CIntObject
}; {
private:
class CBattleConsole : public IShowable, public CIntObject std::vector< std::string > texts; //a place where texts are stored
{ int lastShown; //last shown line of text
private: public:
std::vector< std::string > texts; //a place where texts are stored std::string alterTxt; //if it's not empty, this text is displayed
int lastShown; //last shown line of text CBattleConsole(); //c-tor
public: ~CBattleConsole(); //d-tor
std::string alterTxt; //if it's not empty, this text is displayed void show(SDL_Surface * to = 0);
CBattleConsole(); //c-tor bool addText(const std::string & text); //adds text at the last position; returns false if failed (e.g. text longer than 70 characters)
~CBattleConsole(); //d-tor void eraseText(unsigned int pos); //erases added text at position pos
void show(SDL_Surface * to = 0); void changeTextAt(const std::string & text, unsigned int pos); //if we have more than pos texts, pos-th is changed to given one
bool addText(const std::string & text); //adds text at the last position; returns false if failed (e.g. text longer than 70 characters) void scrollUp(unsigned int by = 1); //scrolls console up by 'by' positions
void eraseText(unsigned int pos); //erases added text at position pos void scrollDown(unsigned int by = 1); //scrolls console up by 'by' positions
void changeTextAt(const std::string & text, unsigned int pos); //if we have more than pos texts, pos-th is changed to given one };
void scrollUp(unsigned int by = 1); //scrolls console up by 'by' positions
void scrollDown(unsigned int by = 1); //scrolls console up by 'by' positions class CBattleReslutWindow : public IShowable, public CIntObject, public IActivable
}; {
private:
class CBattleReslutWindow : public IShowable, public CIntObject, public IActivable SDL_Surface * background;
{ AdventureMapButton * exit;
private: public:
SDL_Surface * background; CBattleReslutWindow(const BattleResult & br, const SDL_Rect & pos, const CBattleInterface * owner); //c-tor
AdventureMapButton * exit; ~CBattleReslutWindow(); //d-tor
public:
CBattleReslutWindow(const BattleResult & br, const SDL_Rect & pos, const CBattleInterface * owner); //c-tor void bExitf();
~CBattleReslutWindow(); //d-tor
void activate();
void bExitf(); void deactivate();
void show(SDL_Surface * to = 0);
void activate(); };
void deactivate();
void show(SDL_Surface * to = 0); class CBattleOptionsWindow : public IShowable, public CIntObject, public IActivable
}; {
private:
class CBattleOptionsWindow : public IShowable, public CIntObject, public IActivable CBattleInterface * myInt;
{ SDL_Surface * background;
private: AdventureMapButton * setToDefault, * exit;
CBattleInterface * myInt; CHighlightableButton * viewGrid, * movementShadow, * mouseShadow;
SDL_Surface * background; CHighlightableButtonsGroup * animSpeeds;
AdventureMapButton * setToDefault, * exit; public:
CHighlightableButton * viewGrid, * movementShadow, * mouseShadow; CBattleOptionsWindow(const SDL_Rect & position, CBattleInterface * owner); //c-tor
CHighlightableButtonsGroup * animSpeeds; ~CBattleOptionsWindow(); //d-tor
public:
CBattleOptionsWindow(const SDL_Rect & position, CBattleInterface * owner); //c-tor void bDefaultf();
~CBattleOptionsWindow(); //d-tor void bExitf();
void bDefaultf(); void activate();
void bExitf(); void deactivate();
void show(SDL_Surface * to = 0);
void activate(); };
void deactivate();
void show(SDL_Surface * to = 0); class CBattleInterface : public CMainInterface, public MotionInterested, public KeyInterested
}; {
private:
class CBattleInterface : public CMainInterface, public MotionInterested, public KeyInterested SDL_Surface * background, * menu, * amountNormal, * amountNegative, * amountPositive, * amountEffNeutral, * cellBorders, * backgroundWithHexes;
{ AdventureMapButton * bOptions, * bSurrender, * bFlee, * bAutofight, * bSpell,
private: * bWait, * bDefence, * bConsoleUp, * bConsoleDown;
SDL_Surface * background, * menu, * amountNormal, * amountNegative, * amountPositive, * amountEffNeutral, * cellBorders, * backgroundWithHexes; CBattleConsole * console;
AdventureMapButton * bOptions, * bSurrender, * bFlee, * bAutofight, * bSpell, CBattleHero * attackingHero, * defendingHero;
* bWait, * bDefence, * bConsoleUp, * bConsoleDown; CCreatureSet * army1, * army2; //fighting armies
CBattleConsole * console; CGHeroInstance * attackingHeroInstance, * defendingHeroInstance;
CBattleHero * attackingHero, * defendingHero; std::map< int, CCreatureAnimation * > creAnims; //animations of creatures from fighting armies (order by BattleInfo's stacks' ID)
CCreatureSet * army1, * army2; //fighting armies std::map< int, CDefHandler * > idToProjectile; //projectiles of creaures (creatureID, defhandler)
CGHeroInstance * attackingHeroInstance, * defendingHeroInstance; std::map< int, bool > creDir; // <creatureID, if false reverse creature's animation>
std::map< int, CCreatureAnimation * > creAnims; //animations of creatures from fighting armies (order by BattleInfo's stacks' ID) unsigned char animCount;
std::map< int, CDefHandler * > idToProjectile; //projectiles of creaures (creatureID, defhandler) int activeStack; //number of active stack; -1 - no one
std::map< int, bool > creDir; // <creatureID, if false reverse creature's animation> std::vector<int> shadedHexes; //hexes available for active stack
unsigned char animCount; int previouslyHoveredHex; //number of hex that was hovered by the cursor a while ago
int activeStack; //number of active stack; -1 - no one int currentlyHoveredHex; //number of hex that is supposed to be hovered (for a while it may be inappropriately set, but will be renewed soon)
std::vector<int> shadedHexes; //hexes available for active stack int animSpeed; //speed of animation; 1 - slowest, 2 - medium, 4 - fastest
int previouslyHoveredHex; //number of hex that was hovered by the cursor a while ago float getAnimSpeedMultiplier() const; //returns multiplier for number of frames in a group
int currentlyHoveredHex; //number of hex that is supposed to be hovered (for a while it may be inappropriately set, but will be renewed soon)
int animSpeed; //speed of animation; 1 - slowest, 2 - medium, 4 - fastest bool spellDestSelectMode; //if true, player is choosing destination for his spell
float getAnimSpeedMultiplier() const; //returns multiplier for number of frames in a group int spellSelMode; //0 - any location, 1 - any firendly creature, 2 - any hostile creature, 3 - any creature, 4 - obstacle, -1 - no location
BattleAction * spellToCast; //spell for which player is choosing destination
bool spellDestSelectMode; //if true, player is choosing destination for his spell
int spellSelMode; //0 - any location, 1 - any firendly creature, 2 - any hostile creature, 3 - any creature, 4 - obstacle, -1 - no location class CAttHelper
BattleAction * spellToCast; //spell for which player is choosing destination {
public:
class CAttHelper int ID; //attacking stack
{ int IDby; //attacked stack
public: int dest; //atacked hex
int ID; //attacking stack int frame, maxframe; //frame of animation, number of frames of animation
int IDby; //attacked stack int hitCount; //for delaying animation
int dest; //atacked hex bool reversing;
int frame, maxframe; //frame of animation, number of frames of animation int posShiftDueToDist;
int hitCount; //for delaying animation bool shooting;
bool reversing; int shootingGroup; //if shooting is true, print this animation group
int posShiftDueToDist; } * attackingInfo;
bool shooting; void attackingShowHelper();
int shootingGroup; //if shooting is true, print this animation group void redrawBackgroundWithHexes(int activeStack);
} * attackingInfo; void printConsoleAttacked(int ID, int dmg, int killed, int IDby);
void attackingShowHelper();
void redrawBackgroundWithHexes(int activeStack); struct SProjectileInfo
void printConsoleAttacked(int ID, int dmg, int killed, int IDby); {
int x, y; //position on the screen
struct SProjectileInfo int dx, dy; //change in position in one step
{ int step, lastStep; //to know when finish showing this projectile
int x, y; //position on the screen int creID; //ID of creature that shot this projectile
int dx, dy; //change in position in one step int frameNum; //frame to display form projectile animation
int step, lastStep; //to know when finish showing this projectile bool spin; //if true, frameNum will be increased
int creID; //ID of creature that shot this projectile int animStartDelay; //how many times projectile must be attempted to be shown till it's really show (decremented after hit)
int frameNum; //frame to display form projectile animation };
bool spin; //if true, frameNum will be increased std::list<SProjectileInfo> projectiles;
int animStartDelay; //how many times projectile must be attempted to be shown till it's really show (decremented after hit) void projectileShowHelper(SDL_Surface * to=NULL); //prints projectiles present on the battlefield
}; void giveCommand(ui8 action, ui16 tile, ui32 stack, si32 additional=-1);
std::list<SProjectileInfo> projectiles; bool isTileAttackable(const int & number) const; //returns true if tile 'number' is neighbouring any tile from active stack's range or is one of these tiles
void projectileShowHelper(SDL_Surface * to=NULL); //prints projectiles present on the battlefield
void giveCommand(ui8 action, ui16 tile, ui32 stack, si32 additional=-1); struct SBattleEffect
bool isTileAttackable(const int & number) const; //returns true if tile 'number' is neighbouring any tile from active stack's range or is one of these tiles {
int x, y; //position on the screen
struct SBattleEffect int frame, maxFrame;
{ CDefHandler * anim; //animation to display
int x, y; //position on the screen };
int frame, maxFrame; std::list<SBattleEffect> battleEffects; //different animations to display on the screen like spell effects
CDefHandler * anim; //animation to display public:
}; CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2, const SDL_Rect & myRect); //c-tor
std::list<SBattleEffect> battleEffects; //different animations to display on the screen like spell effects ~CBattleInterface(); //d-tor
public:
CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2, const SDL_Rect & myRect); //c-tor //std::vector<TimeInterested*> timeinterested; //animation handling
~CBattleInterface(); //d-tor bool printCellBorders; //if true, cell borders will be printed
void setPrintCellBorders(bool set); //set for above member
//std::vector<TimeInterested*> timeinterested; //animation handling bool printStackRange; //if true,range of active stack will be printed
bool printCellBorders; //if true, cell borders will be printed void setPrintStackRange(bool set); //set for above member
void setPrintCellBorders(bool set); //set for above member bool printMouseShadow; //if true, hex under mouse will be shaded
bool printStackRange; //if true,range of active stack will be printed void setPrintMouseShadow(bool set); //set for above member
void setPrintStackRange(bool set); //set for above member void setAnimSpeed(int set); //set for animSpeed
bool printMouseShadow; //if true, hex under mouse will be shaded int getAnimSpeed() const; //get for animSpeed
void setPrintMouseShadow(bool set); //set for above member
void setAnimSpeed(int set); //set for animSpeed CBattleHex bfield[BFIELD_SIZE]; //11 lines, 17 hexes on each
int getAnimSpeed() const; //get for animSpeed std::vector< CBattleObstacle * > obstacles; //vector of obstacles on the battlefield
SDL_Surface * cellBorder, * cellShade;
CBattleHex bfield[BFIELD_SIZE]; //11 lines, 17 hexes on each CondSh<BattleAction *> *givenCommand; //data != NULL if we have i.e. moved current unit
std::vector< CBattleObstacle * > obstacles; //vector of obstacles on the battlefield bool myTurn; //if true, interface is active (commands can be ordered
SDL_Surface * cellBorder, * cellShade; CBattleReslutWindow * resWindow; //window of end of battle
CondSh<BattleAction *> *givenCommand; //data != NULL if we have i.e. moved current unit bool showStackQueue; //if true, queue of stacks will be shown
bool myTurn; //if true, interface is active (commands can be ordered
CBattleReslutWindow * resWindow; //window of end of battle //button handle funcs:
bool showStackQueue; //if true, queue of stacks will be shown void bOptionsf();
void bSurrenderf();
//button handle funcs: void bFleef();
void bOptionsf(); void reallyFlee(); //performs fleeing without asking player
void bSurrenderf(); void bAutofightf();
void bFleef(); void bSpellf();
void reallyFlee(); //performs fleeing without asking player void bWaitf();
void bAutofightf(); void bDefencef();
void bSpellf(); void bConsoleUpf();
void bWaitf(); void bConsoleDownf();
void bDefencef(); //end of button handle funcs
void bConsoleUpf(); //napisz tu klase odpowiadajaca za wyswietlanie bitwy i obsluge uzytkownika, polecenia ma przekazywac callbackiem
void bConsoleDownf(); void activate();
//end of button handle funcs void deactivate();
//napisz tu klase odpowiadajaca za wyswietlanie bitwy i obsluge uzytkownika, polecenia ma przekazywac callbackiem void show(SDL_Surface * to = NULL);
void activate(); void keyPressed(const SDL_KeyboardEvent & key);
void deactivate(); void mouseMoved(const SDL_MouseMotionEvent &sEvent);
void show(SDL_Surface * to = NULL); bool reverseCreature(int number, int hex, bool wideTrick = false); //reverses animation of given creature playing animation of reversing
void keyPressed(const SDL_KeyboardEvent & key);
void mouseMoved(const SDL_MouseMotionEvent &sEvent); struct SStackAttackedInfo
bool reverseCreature(int number, int hex, bool wideTrick = false); //reverses animation of given creature playing animation of reversing {
int ID; //id of attacked stack
struct SStackAttackedInfo int dmg; //damage dealt
{ int amountKilled; //how many creatures in stack has been killed
int ID; //id of attacked stack int IDby; //ID of attacking stack
int dmg; //damage dealt bool byShooting; //if true, stack has been attacked by shooting
int amountKilled; //how many creatures in stack has been killed bool killed; //if true, stack has been killed
int IDby; //ID of attacking stack };
bool byShooting; //if true, stack has been attacked by shooting
bool killed; //if true, stack has been killed //call-ins
}; void newStack(CStack stack); //new stack appeared on battlefield
void stackRemoved(CStack stack); //stack disappeared from batlefiled
//call-ins //void stackKilled(int ID, int dmg, int killed, int IDby, bool byShooting); //stack has been killed (but corpses remain)
void newStack(CStack stack); //new stack appeared on battlefield void stackActivated(int number); //active stack has been changed
void stackRemoved(CStack stack); //stack disappeared from batlefiled void stackMoved(int number, int destHex, bool endMoving); //stack with id number moved to destHex
//void stackKilled(int ID, int dmg, int killed, int IDby, bool byShooting); //stack has been killed (but corpses remain) void stacksAreAttacked(std::vector<SStackAttackedInfo> attackedInfos); //called when a certain amount of stacks has been attacked
void stackActivated(int number); //active stack has been changed void stackAttacking(int ID, int dest); //called when stack with id ID is attacking something on hex dest
void stackMoved(int number, int destHex, bool endMoving); //stack with id number moved to destHex void newRound(int number); //caled when round is ended; number is the number of round
void stacksAreAttacked(std::vector<SStackAttackedInfo> attackedInfos); //called when a certain amount of stacks has been attacked void hexLclicked(int whichOne); //hex only call-in
void stackAttacking(int ID, int dest); //called when stack with id ID is attacking something on hex dest void stackIsShooting(int ID, int dest); //called when stack with id ID is shooting to hex dest
void newRound(int number); //caled when round is ended; number is the number of round void battleFinished(const BattleResult& br); //called when battle is finished - battleresult window should be printed
void hexLclicked(int whichOne); //hex only call-in void spellCasted(SpellCasted * sc); //called when a hero casts a spell
void stackIsShooting(int ID, int dest); //called when stack with id ID is shooting to hex dest void castThisSpell(int spellID); //called when player has chosen a spell from spellbook
void battleFinished(const BattleResult& br); //called when battle is finished - battleresult window should be printed void displayEffect(ui32 effect, int destTile); //displays effect of a spell on the battlefield; affected: true - attacker. false - defender
void spellCasted(SpellCasted * sc); //called when a hero casts a spell
void castThisSpell(int spellID); //called when player has chosen a spell from spellbook friend class CBattleHex;
void displayEffect(ui32 effect, int destTile); //displays effect of a spell on the battlefield; affected: true - attacker. false - defender friend class CBattleReslutWindow;
friend class CPlayerInterface;
friend class CBattleHex; };
friend class CBattleReslutWindow;
friend class CPlayerInterface;
};
#endif //CBATTLEINTERFACE_H #endif //CBATTLEINTERFACE_H

View File

@ -1,231 +1,228 @@
#ifndef CCASTLEINTERFACE_H #ifndef CCASTLEINTERFACE_H
#define CCASTLEINTERFACE_H #define CCASTLEINTERFACE_H
#ifdef _MSC_VER
#pragma once
#endif #include "global.h"
#include <SDL.h>
#include "CPlayerInterface.h"
#include "global.h" //#include "boost/tuple/tuple.hpp"
#include <SDL.h> class CGTownInstance;
#include "CPlayerInterface.h" class CTownHandler;
//#include "boost/tuple/tuple.hpp" class CHallInterface;
class CGTownInstance; struct Structure;
class CTownHandler; class CSpell;
class CHallInterface; class AdventureMapButton;
struct Structure; class CResDataBar;
class CSpell; class CBuildingRect : public Hoverable, public MotionInterested, public ClickableL, public ClickableR//, public TimeInterested
class AdventureMapButton; {
class CResDataBar; public:
class CBuildingRect : public Hoverable, public MotionInterested, public ClickableL, public ClickableR//, public TimeInterested bool moi; //motion interested is active
{ int offset, max; //first and last animation frame
public: Structure* str;
bool moi; //motion interested is active CDefHandler* def;
int offset, max; //first and last animation frame SDL_Surface* border;
Structure* str; SDL_Surface* area;
CDefHandler* def; CBuildingRect(Structure *Str);
SDL_Surface* border; ~CBuildingRect();
SDL_Surface* area; void activate();
CBuildingRect(Structure *Str); void deactivate();
~CBuildingRect(); bool operator<(const CBuildingRect & p2) const;
void activate(); void hover(bool on);
void deactivate(); void clickLeft (tribool down);
bool operator<(const CBuildingRect & p2) const; void clickRight (tribool down);
void hover(bool on); void mouseMoved (const SDL_MouseMotionEvent & sEvent);
void clickLeft (tribool down); };
void clickRight (tribool down); class CHeroGSlot : public ClickableL, public ClickableR, public Hoverable
void mouseMoved (const SDL_MouseMotionEvent & sEvent); {
}; public:
class CHeroGSlot : public ClickableL, public ClickableR, public Hoverable CCastleInterface *owner;
{ const CGHeroInstance *hero;
public: int upg; //0 - up garrison, 1 - down garrison
CCastleInterface *owner; bool highlight;
const CGHeroInstance *hero;
int upg; //0 - up garrison, 1 - down garrison void hover (bool on);
bool highlight; void clickRight (boost::logic::tribool down);
void clickLeft(boost::logic::tribool down);
void hover (bool on); void activate();
void clickRight (boost::logic::tribool down); void deactivate();
void clickLeft(boost::logic::tribool down); void show();
void activate(); CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h,CCastleInterface * Owner);
void deactivate(); ~CHeroGSlot();
void show(); };
CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h,CCastleInterface * Owner);
~CHeroGSlot(); class CCastleInterface : public CMainInterface
}; {
public:
class CCastleInterface : public CMainInterface SDL_Rect pos;
{ bool showing;
public: CBuildingRect * hBuild; //highlighted building
SDL_Rect pos; SDL_Surface * townInt;
bool showing; SDL_Surface * cityBg;
CBuildingRect * hBuild; //highlighted building const CGTownInstance * town;
SDL_Surface * townInt; CStatusBar * statusbar;
SDL_Surface * cityBg; CResDataBar *resdatabar;
const CGTownInstance * town; unsigned char animval, count;
CStatusBar * statusbar;
CResDataBar *resdatabar; CDefHandler *hall,*fort;
unsigned char animval, count; CDefEssential* bicons; //150x70 buildings imgs
CTownList * townlist;
CDefHandler *hall,*fort;
CDefEssential* bicons; //150x70 buildings imgs CHeroGSlot hslotup, hslotdown;
CTownList * townlist; CGarrisonInt * garr;
AdventureMapButton *exit;
CHeroGSlot hslotup, hslotdown; AdventureMapButton *split;
CGarrisonInt * garr;
AdventureMapButton *exit; std::vector<CBuildingRect*> buildings; //building id, building def, structure struct, border, filling
AdventureMapButton *split;
CCastleInterface(const CGTownInstance * Town, bool Activate=true);
std::vector<CBuildingRect*> buildings; //building id, building def, structure struct, border, filling ~CCastleInterface();
void townChange();
CCastleInterface(const CGTownInstance * Town, bool Activate=true); void show(SDL_Surface * to=NULL);
~CCastleInterface(); void showAll(SDL_Surface * to=NULL, bool forceTotalRedraw = false);
void townChange(); void buildingClicked(int building);
void show(SDL_Surface * to=NULL); void enterMageGuild();
void showAll(SDL_Surface * to=NULL, bool forceTotalRedraw = false); CRecrutationWindow * showRecruitmentWindow(int building);
void buildingClicked(int building); void enterHall();
void enterMageGuild(); void close();
CRecrutationWindow * showRecruitmentWindow(int building); void splitF();
void enterHall(); void activate();
void close(); void deactivate();
void splitF(); void addBuilding(int bid);
void activate(); void removeBuilding(int bid);
void deactivate(); void recreateBuildings();
void addBuilding(int bid); };
void removeBuilding(int bid); class CHallInterface : public IShowActivable
void recreateBuildings(); {
}; public:
class CHallInterface : public IShowActivable CMinorResDataBar resdatabar;
{ SDL_Rect pos;
public:
CMinorResDataBar resdatabar; class CBuildingBox : public Hoverable, public ClickableL, public ClickableR
SDL_Rect pos; {
public:
class CBuildingBox : public Hoverable, public ClickableL, public ClickableR int BID;
{ int state;// 0 - no more than one capitol, 1 - lack of water, 2 - forbidden, 3 - Add another level to Mage Guild, 4 - already built, 5 - cannot build, 6 - cannot afford, 7 - build, 8 - lack of requirements
public: //(-1) - forbidden in this town, 0 - possible, 1 - lack of res, 2 - requirements/buildings per turn limit, (3) - already exists
int BID; void hover(bool on);
int state;// 0 - no more than one capitol, 1 - lack of water, 2 - forbidden, 3 - Add another level to Mage Guild, 4 - already built, 5 - cannot build, 6 - cannot afford, 7 - build, 8 - lack of requirements void clickLeft (tribool down);
//(-1) - forbidden in this town, 0 - possible, 1 - lack of res, 2 - requirements/buildings per turn limit, (3) - already exists void clickRight (tribool down);
void hover(bool on); void show(SDL_Surface * to=NULL);
void clickLeft (tribool down); void activate();
void clickRight (tribool down); void deactivate();
void show(SDL_Surface * to=NULL); CBuildingBox(int id);
void activate(); CBuildingBox(int id, int x, int y);
void deactivate(); ~CBuildingBox();
CBuildingBox(int id); };
CBuildingBox(int id, int x, int y);
~CBuildingBox(); class CBuildWindow: public IShowable, public ClickableR
}; {
public:
class CBuildWindow: public IShowable, public ClickableR int tid, bid, state; //town id, building id, state
{ bool mode; // 0 - normal (with buttons), 1 - r-click popup
public: SDL_Surface * bitmap; //main window bitmap, with blitted res/text, without buttons/subtitle in "statusbar"
int tid, bid, state; //town id, building id, state AdventureMapButton *buy, *cancel;
bool mode; // 0 - normal (with buttons), 1 - r-click popup
SDL_Surface * bitmap; //main window bitmap, with blitted res/text, without buttons/subtitle in "statusbar" void activate();
AdventureMapButton *buy, *cancel; void deactivate();
std::string getTextForState(int state);
void activate(); void clickRight (tribool down);
void deactivate(); void show(SDL_Surface * to=NULL);
std::string getTextForState(int state); void Buy();
void clickRight (tribool down); void close();
void show(SDL_Surface * to=NULL); CBuildWindow(int Tid, int Bid, int State, bool Mode);
void Buy(); ~CBuildWindow();
void close(); };
CBuildWindow(int Tid, int Bid, int State, bool Mode);
~CBuildWindow(); CDefEssential *bars, //0 - yellow, 1 - green, 2 - red, 3 - gray
}; *status; //0 - already, 1 - can't, 2 - lack of resources
std::vector< std::vector<CBuildingBox*> >boxes;
CDefEssential *bars, //0 - yellow, 1 - green, 2 - red, 3 - gray
*status; //0 - already, 1 - can't, 2 - lack of resources AdventureMapButton *exit;
std::vector< std::vector<CBuildingBox*> >boxes;
SDL_Surface * bg;
AdventureMapButton *exit;
SDL_Surface * bg; CHallInterface(CCastleInterface * owner);
~CHallInterface();
void close();
CHallInterface(CCastleInterface * owner); void show(SDL_Surface * to=NULL);
~CHallInterface(); void activate();
void close(); void deactivate();
void show(SDL_Surface * to=NULL); };
void activate();
void deactivate(); class CFortScreen : public CMainInterface, public CIntObject
}; {
class RecArea : public ClickableL
class CFortScreen : public CMainInterface, public CIntObject {
{ public:
class RecArea : public ClickableL int bid;
{ RecArea(int BID):bid(BID){};
public: void clickLeft (tribool down);
int bid; void activate();
RecArea(int BID):bid(BID){}; void deactivate();
void clickLeft (tribool down); };
void activate(); public:
void deactivate(); CMinorResDataBar resdatabar;
}; AdventureMapButton *exit;
public: SDL_Surface * bg;
CMinorResDataBar resdatabar; std::vector<SDL_Rect> positions;
AdventureMapButton *exit; std::vector<RecArea*> recAreas;
SDL_Surface * bg; std::vector<CCreaturePic*> crePics;
std::vector<SDL_Rect> positions;
std::vector<RecArea*> recAreas; CFortScreen(CCastleInterface * owner);
std::vector<CCreaturePic*> crePics;
void draw( CCastleInterface * owner, bool first);
CFortScreen(CCastleInterface * owner); ~CFortScreen();
void close();
void draw( CCastleInterface * owner, bool first); void show(SDL_Surface * to=NULL);
~CFortScreen(); void activate();
void close(); void deactivate();
void show(SDL_Surface * to=NULL); };
void activate();
void deactivate(); class CMageGuildScreen : public IShowActivable, public CIntObject
}; {
public:
class CMageGuildScreen : public IShowActivable, public CIntObject class Scroll : public ClickableL, public Hoverable, public ClickableR
{ {
public: public:
class Scroll : public ClickableL, public Hoverable, public ClickableR CSpell *spell;
{
public: Scroll(CSpell *Spell):spell(Spell){};
CSpell *spell; void clickLeft (tribool down);
void clickRight (tribool down);
Scroll(CSpell *Spell):spell(Spell){}; void hover(bool on);
void clickLeft (tribool down); void activate();
void clickRight (tribool down); void deactivate();
void hover(bool on); };
void activate(); std::vector<std::vector<SDL_Rect> > positions;
void deactivate();
}; SDL_Surface *bg;
std::vector<std::vector<SDL_Rect> > positions; CDefEssential *scrolls, *scrolls2;
AdventureMapButton *exit;
SDL_Surface *bg; std::vector<Scroll> spells;
CDefEssential *scrolls, *scrolls2; CMinorResDataBar resdatabar;
AdventureMapButton *exit;
std::vector<Scroll> spells;
CMinorResDataBar resdatabar; CMageGuildScreen(CCastleInterface * owner);
~CMageGuildScreen();
void close();
CMageGuildScreen(CCastleInterface * owner); void show(SDL_Surface * to=NULL);
~CMageGuildScreen(); void activate();
void close(); void deactivate();
void show(SDL_Surface * to=NULL); };
void activate();
void deactivate(); class CBlacksmithDialog : public IShowable, public CIntObject
}; {
public:
class CBlacksmithDialog : public IShowable, public CIntObject AdventureMapButton *buy, *cancel;
{ SDL_Surface *bmp;
public:
AdventureMapButton *buy, *cancel; CBlacksmithDialog(bool possible, int creMachineID, int aid, int hid);
SDL_Surface *bmp; ~CBlacksmithDialog();
void close();
CBlacksmithDialog(bool possible, int creMachineID, int aid, int hid); void show(SDL_Surface * to=NULL);
~CBlacksmithDialog(); void activate();
void close(); void deactivate();
void show(SDL_Surface * to=NULL); };
void activate();
void deactivate();
};
#endif //CCASTLEINTERFACE_H #endif //CCASTLEINTERFACE_H

View File

@ -1,136 +1,133 @@
#ifndef CHEROWINDOW_H #ifndef CHEROWINDOW_H
#define CHEROWINDOW_H #define CHEROWINDOW_H
#ifdef _MSC_VER
#pragma once #include "CPlayerInterface.h"
#endif
class AdventureMapButton;
#include "CPlayerInterface.h" struct SDL_Surface;
class CGHeroInstance;
class AdventureMapButton; class CDefHandler;
struct SDL_Surface; class CArtifact;
class CGHeroInstance; class CHeroWindow;
class CDefHandler;
class CArtifact; class LClickableArea: public ClickableL
class CHeroWindow; {
public:
class LClickableArea: public ClickableL virtual void clickLeft (tribool down);
{ virtual void activate();
public: virtual void deactivate();
virtual void clickLeft (tribool down); };
virtual void activate();
virtual void deactivate(); class RClickableArea: public ClickableR
}; {
public:
class RClickableArea: public ClickableR virtual void clickRight (tribool down);
{ virtual void activate();
public: virtual void deactivate();
virtual void clickRight (tribool down); };
virtual void activate();
virtual void deactivate(); class LClickableAreaHero : public LClickableArea
}; {
public:
class LClickableAreaHero : public LClickableArea int id;
{ CHeroWindow * owner;
public: virtual void clickLeft (tribool down);
int id; };
CHeroWindow * owner;
virtual void clickLeft (tribool down); class LRClickableAreaWText: public LClickableArea, public RClickableArea, public Hoverable
}; {
public:
class LRClickableAreaWText: public LClickableArea, public RClickableArea, public Hoverable std::string text, hoverText;
{ virtual void activate();
public: virtual void deactivate();
std::string text, hoverText; virtual void clickLeft (tribool down);
virtual void activate(); virtual void clickRight (tribool down);
virtual void deactivate(); virtual void hover(bool on);
virtual void clickLeft (tribool down); };
virtual void clickRight (tribool down);
virtual void hover(bool on); class LRClickableAreaWTextComp: public LClickableArea, public RClickableArea, public Hoverable
}; {
public:
class LRClickableAreaWTextComp: public LClickableArea, public RClickableArea, public Hoverable std::string text, hoverText;
{ int baseType;
public: int bonus, type;
std::string text, hoverText; virtual void activate();
int baseType; virtual void deactivate();
int bonus, type; virtual void clickLeft (tribool down);
virtual void activate(); virtual void clickRight (tribool down);
virtual void deactivate(); virtual void hover(bool on);
virtual void clickLeft (tribool down); };
virtual void clickRight (tribool down);
virtual void hover(bool on); class CArtPlace: public IShowable, public LRClickableAreaWTextComp
}; {
private:
class CArtPlace: public IShowable, public LRClickableAreaWTextComp bool active;
{ public:
private: //bool spellBook, warMachine1, warMachine2, warMachine3, warMachine4,
bool active; // misc1, misc2, misc3, misc4, misc5, feet, lRing, rRing, torso,
public: // lHand, rHand, neck, shoulders, head; //my types
//bool spellBook, warMachine1, warMachine2, warMachine3, warMachine4, ui16 slotID; //0 head 1 shoulders 2 neck 3 right hand 4 left hand 5 torso 6 right ring 7 left ring 8 feet 9 misc. slot 1 10 misc. slot 2 11 misc. slot 3 12 misc. slot 4 13 ballista (war machine 1) 14 ammo cart (war machine 2) 15 first aid tent (war machine 3) 16 catapult 17 spell book 18 misc. slot 5 19+ backpack slots
// misc1, misc2, misc3, misc4, misc5, feet, lRing, rRing, torso,
// lHand, rHand, neck, shoulders, head; //my types bool clicked;
ui16 slotID; //0 head 1 shoulders 2 neck 3 right hand 4 left hand 5 torso 6 right ring 7 left ring 8 feet 9 misc. slot 1 10 misc. slot 2 11 misc. slot 3 12 misc. slot 4 13 ballista (war machine 1) 14 ammo cart (war machine 2) 15 first aid tent (war machine 3) 16 catapult 17 spell book 18 misc. slot 5 19+ backpack slots CHeroWindow * ourWindow;
const CArtifact * ourArt;
bool clicked; CArtPlace(const CArtifact * Art);
CHeroWindow * ourWindow; void clickLeft (tribool down);
const CArtifact * ourArt; void clickRight (tribool down);
CArtPlace(const CArtifact * Art); void activate();
void clickLeft (tribool down); void deactivate();
void clickRight (tribool down); void show(SDL_Surface * to = NULL);
void activate(); bool fitsHere(const CArtifact * art); //returns true if given artifact can be placed here
void deactivate(); ~CArtPlace();
void show(SDL_Surface * to = NULL); };
bool fitsHere(const CArtifact * art); //returns true if given artifact can be placed here
~CArtPlace(); class CHeroWindow: public IShowActivable, public virtual CIntObject
}; {
SDL_Surface * background, * curBack;
class CHeroWindow: public IShowActivable, public virtual CIntObject const CGHeroInstance * curHero;
{ CGarrisonInt * garInt;
SDL_Surface * background, * curBack; CStatusBar * ourBar; //heroWindow's statusBar
const CGHeroInstance * curHero;
CGarrisonInt * garInt; //general graphics
CStatusBar * ourBar; //heroWindow's statusBar CDefHandler *flags;
//general graphics //buttons
CDefHandler *flags; AdventureMapButton * gar4button; //splitting
std::vector<LClickableAreaHero *> heroListMi; //new better list of heroes
//buttons
AdventureMapButton * gar4button; //splitting std::vector<CArtPlace *> artWorn; // 0 - head; 1 - shoulders; 2 - neck; 3 - right hand; 4 - left hand; 5 - torso; 6 - right ring; 7 - left ring; 8 - feet; 9 - misc1; 10 - misc2; 11 - misc3; 12 - misc4; 13 - mach1; 14 - mach2; 15 - mach3; 16 - mach4; 17 - spellbook; 18 - misc5
std::vector<LClickableAreaHero *> heroListMi; //new better list of heroes std::vector<CArtPlace *> backpack; //hero's visible backpack (only 5 elements!)
int backpackPos; //unmber of first art visible in backpack (in hero's vector)
std::vector<CArtPlace *> artWorn; // 0 - head; 1 - shoulders; 2 - neck; 3 - right hand; 4 - left hand; 5 - torso; 6 - right ring; 7 - left ring; 8 - feet; 9 - misc1; 10 - misc2; 11 - misc3; 12 - misc4; 13 - mach1; 14 - mach2; 15 - mach3; 16 - mach4; 17 - spellbook; 18 - misc5 CArtPlace * activeArtPlace;
std::vector<CArtPlace *> backpack; //hero's visible backpack (only 5 elements!) //clickable areas
int backpackPos; //unmber of first art visible in backpack (in hero's vector) LRClickableAreaWText * portraitArea;
CArtPlace * activeArtPlace; std::vector<LRClickableAreaWTextComp *> primSkillAreas;
//clickable areas LRClickableAreaWText * expArea;
LRClickableAreaWText * portraitArea; LRClickableAreaWText * spellPointsArea;
std::vector<LRClickableAreaWTextComp *> primSkillAreas; std::vector<LRClickableAreaWTextComp *> secSkillAreas;
LRClickableAreaWText * expArea; public:
LRClickableAreaWText * spellPointsArea; AdventureMapButton * quitButton, * dismissButton, * questlogButton, //general
std::vector<LRClickableAreaWTextComp *> secSkillAreas; * leftArtRoll, * rightArtRoll;
public: CHighlightableButton *gar2button; //garrison / formation handling;
AdventureMapButton * quitButton, * dismissButton, * questlogButton, //general CHighlightableButtonsGroup *formations;
* leftArtRoll, * rightArtRoll; int player;
CHighlightableButton *gar2button; //garrison / formation handling; CHeroWindow(int playerColor); //c-tor
CHighlightableButtonsGroup *formations; ~CHeroWindow(); //d-tor
int player; void setHero(const CGHeroInstance * Hero); //sets main displayed hero
CHeroWindow(int playerColor); //c-tor void activate(); //activates hero window;
~CHeroWindow(); //d-tor void deactivate(); //activates hero window;
void setHero(const CGHeroInstance * Hero); //sets main displayed hero virtual void show(SDL_Surface * to = NULL); //shows hero window
void activate(); //activates hero window; void redrawCurBack(); //redraws curBAck from scratch
void deactivate(); //activates hero window; void quit(); //stops displaying hero window
virtual void show(SDL_Surface * to = NULL); //shows hero window void dismissCurrent(); //dissmissed currently displayed hero (curHero)
void redrawCurBack(); //redraws curBAck from scratch void questlog(); //show quest log in hero window
void quit(); //stops displaying hero window void leftArtRoller(); //scrolls artifacts in bag left
void dismissCurrent(); //dissmissed currently displayed hero (curHero) void rightArtRoller(); //scrolls artifacts in bag right
void questlog(); //show quest log in hero window void switchHero(); //changes displayed hero
void leftArtRoller(); //scrolls artifacts in bag left
void rightArtRoller(); //scrolls artifacts in bag right //friends
void switchHero(); //changes displayed hero friend void CArtPlace::clickLeft(tribool down);
friend class CPlayerInterface;
//friends };
friend void CArtPlace::clickLeft(tribool down);
friend class CPlayerInterface;
};
#endif //CHEROWINDOW_H #endif //CHEROWINDOW_H

View File

@ -1,47 +1,44 @@
#ifndef CBITMAPHANDLER_H #ifndef CBITMAPHANDLER_H
#define CBITMAPHANDLER_H #define CBITMAPHANDLER_H
#ifdef _MSC_VER
#pragma once
#endif #include "../global.h"
struct SDL_Surface;
class CLodHandler;
#include "../global.h"
struct SDL_Surface; enum Epcxformat {PCX8B, PCX24B};
class CLodHandler;
struct BMPPalette
enum Epcxformat {PCX8B, PCX24B}; {
unsigned char R,G,B,F;
struct BMPPalette };
{ struct BMPHeader
unsigned char R,G,B,F; {
}; int fullSize, _h1, _h2, _h3, _c1, _c2, _c3, _c4, x, y,
struct BMPHeader dataSize1, dataSize2; //DataSize=X*Y+2*Y
{ unsigned char _c5[8];
int fullSize, _h1, _h2, _h3, _c1, _c2, _c3, _c4, x, y, void print(std::ostream & out);
dataSize1, dataSize2; //DataSize=X*Y+2*Y BMPHeader(){_h1=_h2=0;for(int i=0;i<8;i++)_c5[i]=0;};
unsigned char _c5[8]; };
void print(std::ostream & out); class CPCXConv
BMPHeader(){_h1=_h2=0;for(int i=0;i<8;i++)_c5[i]=0;}; {
}; public:
class CPCXConv unsigned char * pcx, *bmp;
{ int pcxs, bmps;
public: void fromFile(std::string path);
unsigned char * pcx, *bmp; void saveBMP(std::string path);
int pcxs, bmps; void openPCX(char * PCX, int len);
void fromFile(std::string path); void openPCX();
void saveBMP(std::string path); void convert();
void openPCX(char * PCX, int len); SDL_Surface * getSurface(); //for standard H3 PCX
void openPCX(); //SDL_Surface * getSurfaceZ(); //for ZSoft PCX
void convert(); CPCXConv(){pcx=bmp=NULL;pcxs=bmps=0;};
SDL_Surface * getSurface(); //for standard H3 PCX ~CPCXConv(){if (pcxs) delete[] pcx; if(bmps) delete[] bmp;}
//SDL_Surface * getSurfaceZ(); //for ZSoft PCX };
CPCXConv(){pcx=bmp=NULL;pcxs=bmps=0;}; namespace BitmapHandler
~CPCXConv(){if (pcxs) delete[] pcx; if(bmps) delete[] bmp;} {
}; extern CLodHandler *bitmaph;
namespace BitmapHandler SDL_Surface * loadBitmap(std::string fname, bool setKey=false);
{ };
extern CLodHandler *bitmaph;
SDL_Surface * loadBitmap(std::string fname, bool setKey=false);
};
#endif //CBITMAPHANDLER_H #endif //CBITMAPHANDLER_H

View File

@ -1,67 +1,66 @@
#ifndef CCONFIGHANDLER_H #ifndef CCONFIGHANDLER_H
#define CCONFIGHANDLER_H #define CCONFIGHANDLER_H
#pragma once #include "../global.h"
#include "../global.h" class CAdvMapInt;
class CAdvMapInt; namespace config
namespace config {
{ struct ClientConfig
struct ClientConfig {
{ int resx, resy, bpp, fullscreen; //client resolution/colours
int resx, resy, bpp, fullscreen; //client resolution/colours int port, localInformation;
int port, localInformation; std::string server, //server address (e.g. 127.0.0.1)
std::string server, //server address (e.g. 127.0.0.1) defaultAI; //dll name
defaultAI; //dll name };
}; struct ButtonInfo
struct ButtonInfo {
{ std::string defName;
std::string defName; std::vector<std::string> additionalDefs;
std::vector<std::string> additionalDefs; int x, y; //position on the screen
int x, y; //position on the screen bool playerColoured; //if true button will be colored to main player's color (works properly only for appropriate 8bpp graphics)
bool playerColoured; //if true button will be colored to main player's color (works properly only for appropriate 8bpp graphics) };
}; struct AdventureMapConfig
struct AdventureMapConfig {
{ //minimap properties
//minimap properties int minimapX, minimapY, minimapW, minimapH;
int minimapX, minimapY, minimapW, minimapH; //statusbar
//statusbar int statusbarX, statusbarY; //pos
int statusbarX, statusbarY; //pos std::string statusbarG; //graphic name
std::string statusbarG; //graphic name //resdatabar
//resdatabar int resdatabarX, resdatabarY, resDist, resDateDist, resOffsetX, resOffsetY; //pos
int resdatabarX, resdatabarY, resDist, resDateDist, resOffsetX, resOffsetY; //pos std::string resdatabarG; //graphic name
std::string resdatabarG; //graphic name //infobox
//infobox int infoboxX, infoboxY;
int infoboxX, infoboxY; //advmap
//advmap int tilesW, tilesH, advmapX, advmapY, advmapTrimX, advmapTrimY;
int tilesW, tilesH, advmapX, advmapY, advmapTrimX, advmapTrimY; //general properties
//general properties std::string mainGraphic;
std::string mainGraphic; //buttons
//buttons ButtonInfo kingOverview, underground, questlog, sleepWake, moveHero, spellbook, advOptions,
ButtonInfo kingOverview, underground, questlog, sleepWake, moveHero, spellbook, advOptions, sysOptions, nextHero, endTurn;
sysOptions, nextHero, endTurn; //hero list
//hero list int hlistX, hlistY, hlistSize;
int hlistX, hlistY, hlistSize; std::string hlistMB, hlistMN, hlistAU, hlistAD;
std::string hlistMB, hlistMN, hlistAU, hlistAD; //town list
//town list int tlistX, tlistY, tlistSize;
int tlistX, tlistY, tlistSize; std::string tlistAU, tlistAD;
std::string tlistAU, tlistAD; //gems
//gems int gemX[4], gemY[4];
int gemX[4], gemY[4]; std::vector<std::string> gemG;
std::vector<std::string> gemG; };
}; struct GUIOptions
struct GUIOptions {
{ AdventureMapConfig ac;
AdventureMapConfig ac; };
}; class CConfigHandler
class CConfigHandler {
{ public:
public: ClientConfig cc;
ClientConfig cc; std::map<std::pair<int,int>, GUIOptions > guiOptions;
std::map<std::pair<int,int>, GUIOptions > guiOptions; GUIOptions *go(); //return pointer to gui options appropriate for used screen resolution
GUIOptions *go(); //return pointer to gui options appropriate for used screen resolution void init();
void init(); CConfigHandler(void);
CConfigHandler(void); ~CConfigHandler(void);
~CConfigHandler(void); };
}; }
} extern config::CConfigHandler conf;
extern config::CConfigHandler conf;
#endif //CCONFIGHANDLER_H #endif //CCONFIGHANDLER_H

View File

@ -1,57 +1,54 @@
#ifndef CCREATUREANIMATION_H #ifndef CCREATUREANIMATION_H
#define CCREATUREANIMATION_H #define CCREATUREANIMATION_H
#ifdef _MSC_VER
#pragma once #include "../global.h"
#endif #include "../CPlayerInterface.h"
#include "../hch/CDefHandler.h"
#include "../global.h"
#include "../CPlayerInterface.h" class CCreatureAnimation : public CIntObject
#include "../hch/CDefHandler.h" {
private:
class CCreatureAnimation : public CIntObject int totalEntries, DEFType, totalBlocks;
{ int length;
private: BMPPalette palette[256];
int totalEntries, DEFType, totalBlocks; int * RLEntries;
int length; struct SEntry
BMPPalette palette[256]; {
int * RLEntries; std::string name;
struct SEntry int offset;
{ int group;
std::string name; } ;
int offset; std::vector<SEntry> SEntries ;
int group; std::string defName, curDir;
} ; int readNormalNr (int pos, int bytCon, unsigned char * str=NULL) const;
std::vector<SEntry> SEntries ; void putPixel(
std::string defName, curDir; SDL_Surface * dest,
int readNormalNr (int pos, int bytCon, unsigned char * str=NULL) const; const int & ftcp,
void putPixel( const BMPPalette & color,
SDL_Surface * dest, const unsigned char & palc,
const int & ftcp, const bool & yellowBorder
const BMPPalette & color, ) const;
const unsigned char & palc,
const bool & yellowBorder ////////////
) const;
unsigned char * FDef; //animation raw data
//////////// int curFrame; //number of currently displayed frame
unsigned int frames; //number of frames
unsigned char * FDef; //animation raw data public:
int curFrame; //number of currently displayed frame int type; //type of animation being displayed (-1 - whole animation, >0 - specified part [default: -1])
unsigned int frames; //number of frames int fullWidth, fullHeight; //read-only, please!
public: CCreatureAnimation(std::string name); //c-tor
int type; //type of animation being displayed (-1 - whole animation, >0 - specified part [default: -1]) ~CCreatureAnimation(); //d-tor
int fullWidth, fullHeight; //read-only, please!
CCreatureAnimation(std::string name); //c-tor void setType(int type); //sets type of animation and cleares framecount
~CCreatureAnimation(); //d-tor int getType() const; //returns type of animation
void setType(int type); //sets type of animation and cleares framecount int nextFrame(SDL_Surface * dest, int x, int y, bool attacker, bool incrementFrame = true, bool yellowBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next
int getType() const; //returns type of animation int nextFrameMiddle(SDL_Surface * dest, int x, int y, bool attacker, bool IncrementFrame = true, bool yellowBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next
void incrementFrame();
int nextFrame(SDL_Surface * dest, int x, int y, bool attacker, bool incrementFrame = true, bool yellowBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next int getFrame() const;
int nextFrameMiddle(SDL_Surface * dest, int x, int y, bool attacker, bool IncrementFrame = true, bool yellowBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next
void incrementFrame(); int framesInGroup(int group) const; //retirns number of fromes in given group
int getFrame() const; };
int framesInGroup(int group) const; //retirns number of fromes in given group
};
#endif //CCREATUREANIMATION_H #endif //CCREATUREANIMATION_H

View File

@ -1,95 +1,92 @@
#ifndef CSPELLWINDOW_H #ifndef CSPELLWINDOW_H
#define CSPELLWINDOW_H #define CSPELLWINDOW_H
#ifdef _MSC_VER
#pragma once #include "../global.h"
#endif #include "../CPlayerInterface.h"
#include "../global.h" struct SDL_Surface;
#include "../CPlayerInterface.h" class CDefHandler;
struct SDL_Rect;
struct SDL_Surface; class CGHeroInstance;
class CDefHandler;
struct SDL_Rect; class SpellbookInteractiveArea : public ClickableL, public ClickableR, public Hoverable
class CGHeroInstance; {
private:
class SpellbookInteractiveArea : public ClickableL, public ClickableR, public Hoverable boost::function<void()> onLeft;
{ std::string textOnRclick;
private: boost::function<void()> onHoverOn;
boost::function<void()> onLeft; boost::function<void()> onHoverOff;
std::string textOnRclick; public:
boost::function<void()> onHoverOn; void clickLeft(boost::logic::tribool down);
boost::function<void()> onHoverOff; void clickRight(boost::logic::tribool down);
public: void hover(bool on);
void clickLeft(boost::logic::tribool down); void activate();
void clickRight(boost::logic::tribool down); void deactivate();
void hover(bool on);
void activate(); SpellbookInteractiveArea(const SDL_Rect & myRect, boost::function<void()> funcL, const std::string & textR, boost::function<void()> funcHon, boost::function<void()> funcHoff);//c-tor
void deactivate(); };
SpellbookInteractiveArea(const SDL_Rect & myRect, boost::function<void()> funcL, const std::string & textR, boost::function<void()> funcHon, boost::function<void()> funcHoff);//c-tor class CSpellWindow : public IShowActivable, public CIntObject
}; {
private:
class CSpellWindow : public IShowActivable, public CIntObject class SpellArea : public ClickableL, public ClickableR, public Hoverable
{ {
private: public:
class SpellArea : public ClickableL, public ClickableR, public Hoverable int mySpell;
{ CSpellWindow * owner;
public:
int mySpell; SpellArea(SDL_Rect pos, CSpellWindow * owner);
CSpellWindow * owner; void clickLeft(boost::logic::tribool down);
void clickRight(boost::logic::tribool down);
SpellArea(SDL_Rect pos, CSpellWindow * owner); void hover(bool on);
void clickLeft(boost::logic::tribool down); void activate();
void clickRight(boost::logic::tribool down); void deactivate();
void hover(bool on); };
void activate();
void deactivate(); SDL_Surface * background, * leftCorner, * rightCorner;
}; CDefHandler * spells, //pictures of spells
* spellTab, //school select
SDL_Surface * background, * leftCorner, * rightCorner; * schools, //schools' pictures
CDefHandler * spells, //pictures of spells * schoolBorders [4]; //schools' 'borders': [0]: air, [1]: fire, [2]: water, [3]: earth
* spellTab, //school select
* schools, //schools' pictures SpellbookInteractiveArea * exitBtn, * battleSpells, * adventureSpells, * manaPoints;
* schoolBorders [4]; //schools' 'borders': [0]: air, [1]: fire, [2]: water, [3]: earth SpellbookInteractiveArea * selectSpellsA, * selectSpellsE, * selectSpellsF, * selectSpellsW, * selectSpellsAll;
SpellbookInteractiveArea * lCorner, * rCorner;
SpellbookInteractiveArea * exitBtn, * battleSpells, * adventureSpells, * manaPoints; SpellArea * spellAreas[12];
SpellbookInteractiveArea * selectSpellsA, * selectSpellsE, * selectSpellsF, * selectSpellsW, * selectSpellsAll; CStatusBar * statusBar;
SpellbookInteractiveArea * lCorner, * rCorner;
SpellArea * spellAreas[12]; Uint8 sitesPerTabAdv[5];
CStatusBar * statusBar; Uint8 sitesPerTabBattle[5];
Uint8 sitesPerTabAdv[5]; bool battleSpellsOnly; //if true, only battle spells are displayed; if false, only adventure map spells are displayed
Uint8 sitesPerTabBattle[5]; Uint8 selectedTab; // 0 - air magic, 1 - fire magic, 2 - water magic, 3 - earth magic, 4 - all schools
Uint8 spellSite; //changes when corners are clicked
bool battleSpellsOnly; //if true, only battle spells are displayed; if false, only adventure map spells are displayed std::set<ui32> mySpells; //all spels in this spellbook
Uint8 selectedTab; // 0 - air magic, 1 - fire magic, 2 - water magic, 3 - earth magic, 4 - all schools Uint8 schoolLvls[4]; //levels of magic for different schools: [0]: air, [1]: fire, [2]: water, [3]: earth; 0 - none, 1 - beginner, 2 - medium, 3 - expert
Uint8 spellSite; //changes when corners are clicked
std::set<ui32> mySpells; //all spels in this spellbook void computeSpellsPerArea(); //recalculates spellAreas::mySpell
Uint8 schoolLvls[4]; //levels of magic for different schools: [0]: air, [1]: fire, [2]: water, [3]: earth; 0 - none, 1 - beginner, 2 - medium, 3 - expert
public:
void computeSpellsPerArea(); //recalculates spellAreas::mySpell CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * myHero); //c-tor
~CSpellWindow(); //d-tor
public:
CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * myHero); //c-tor void fexitb();
~CSpellWindow(); //d-tor void fadvSpellsb();
void fbattleSpellsb();
void fexitb(); void fmanaPtsb();
void fadvSpellsb();
void fbattleSpellsb(); void fspellsAb();
void fmanaPtsb(); void fspellsEb();
void fspellsFb();
void fspellsAb(); void fspellsWb();
void fspellsEb(); void fspellsAllb();
void fspellsFb();
void fspellsWb(); void fLcornerb();
void fspellsAllb(); void fRcornerb();
void fLcornerb(); void activate();
void fRcornerb(); void deactivate();
void show(SDL_Surface * to = NULL);
void activate(); };
void deactivate();
void show(SDL_Surface * to = NULL);
};
#endif //CSPELLWINDOW_H #endif //CSPELLWINDOW_H

View File

@ -1,65 +1,62 @@
#ifndef CLIENT_H #ifndef CLIENT_H
#define CLIENT_H #define CLIENT_H
#ifdef _MSC_VER
#pragma once #include "../global.h"
#endif #include <boost/thread.hpp>
struct StartInfo;
#include "../global.h" class CGameState;
#include <boost/thread.hpp> class CGameInterface;
struct StartInfo; class CConnection;
class CGameState; class CCallback;
class CGameInterface; class CClient;
class CConnection; void processCommand(const std::string &message, CClient *&client);
class CCallback; namespace boost
class CClient; {
void processCommand(const std::string &message, CClient *&client); class mutex;
namespace boost class condition_variable;
{ }
class mutex;
class condition_variable; template <typename T>
} struct CSharedCond
{
template <typename T> boost::mutex *mx;
struct CSharedCond boost::condition_variable *cv;
{ T *res;
boost::mutex *mx; CSharedCond(T*R)
boost::condition_variable *cv; {
T *res; res = R;
CSharedCond(T*R) mx = new boost::mutex;
{ cv = new boost::condition_variable;
res = R; }
mx = new boost::mutex; ~CSharedCond()
cv = new boost::condition_variable; {
} delete res;
~CSharedCond() delete mx;
{ delete cv;
delete res; }
delete mx; };
delete cv;
} class CClient
}; {
CCallback *cb;
class CClient CGameState *gs;
{ std::map<ui8,CGameInterface *> playerint;
CCallback *cb; CConnection *serv;
CGameState *gs;
std::map<ui8,CGameInterface *> playerint; void waitForMoveAndSend(int color);
CConnection *serv; public:
CClient(void);
void waitForMoveAndSend(int color); CClient(CConnection *con, StartInfo *si);
public: ~CClient(void);
CClient(void);
CClient(CConnection *con, StartInfo *si); void close();
~CClient(void); void save(const std::string & fname);
void process(int what);
void close(); void run();
void save(const std::string & fname);
void process(int what); friend class CCallback; //handling players actions
void run(); friend class CScriptCallback; //for objects scripts
friend void processCommand(const std::string &message, CClient *&client); //handling console
friend class CCallback; //handling players actions };
friend class CScriptCallback; //for objects scripts
friend void processCommand(const std::string &message, CClient *&client); //handling console
};
#endif //CLIENT_H #endif //CLIENT_H

View File

@ -1,69 +1,66 @@
#ifndef GRAPHICS_H #ifndef GRAPHICS_H
#define GRAPHICS_H #define GRAPHICS_H
#ifdef _MSC_VER
#pragma once #include "../global.h"
#endif
#include "../global.h" class CDefEssential;
struct SDL_Surface;
class CGHeroInstance;
class CDefEssential; class CGTownInstance;
struct SDL_Surface; class CDefHandler;
class CGHeroInstance; class CHeroClass;
class CGTownInstance; struct SDL_Color;
class CDefHandler; class Graphics
class CHeroClass; {
struct SDL_Color; public:
class Graphics //various graphics
{ SDL_Color * playerColors; //array [8]
public: SDL_Color * neutralColor;
//various graphics SDL_Color * playerColorPalette; //palette to make interface colors good - array of size [256]
SDL_Color * playerColors; //array [8] SDL_Surface * hInfo, *tInfo; //hero and town infobox bgs
SDL_Color * neutralColor; SDL_Surface *heroInGarrison; //icon for town infobox
SDL_Color * playerColorPalette; //palette to make interface colors good - array of size [256] std::vector<std::pair<int, int> > slotsPos; //creature slot positions in infoboxes
SDL_Surface * hInfo, *tInfo; //hero and town infobox bgs CDefEssential *luck22, *luck30, *luck42, *luck82,
SDL_Surface *heroInGarrison; //icon for town infobox *morale22, *morale30, *morale42, *morale82,
std::vector<std::pair<int, int> > slotsPos; //creature slot positions in infoboxes *halls, *forts, *bigTownPic;
CDefEssential *luck22, *luck30, *luck42, *luck82, std::map<int,SDL_Surface*> heroWins; //hero_ID => infobox
*morale22, *morale30, *morale42, *morale82, std::map<int,SDL_Surface*> townWins; //town_ID => infobox
*halls, *forts, *bigTownPic; CDefHandler * artDefs; //artifacts
std::map<int,SDL_Surface*> heroWins; //hero_ID => infobox std::vector<SDL_Surface *> portraitSmall; //48x32 px portraits of heroes
std::map<int,SDL_Surface*> townWins; //town_ID => infobox std::vector<SDL_Surface *> portraitLarge; //58x64 px portraits of heroes
CDefHandler * artDefs; //artifacts std::vector<CDefHandler *> flags1, flags2, flags3, flags4; //flags blitted on heroes when ,
std::vector<SDL_Surface *> portraitSmall; //48x32 px portraits of heroes CDefHandler * pskillsb, *resources; //82x93
std::vector<SDL_Surface *> portraitLarge; //58x64 px portraits of heroes CDefHandler * pskillsm; //42x42
std::vector<CDefHandler *> flags1, flags2, flags3, flags4; //flags blitted on heroes when , CDefHandler * un44; //many things
CDefHandler * pskillsb, *resources; //82x93 CDefHandler * smallIcons, *resources32; //resources 32x32
CDefHandler * pskillsm; //42x42 CDefHandler * flags;
CDefHandler * un44; //many things //creatures
CDefHandler * smallIcons, *resources32; //resources 32x32 std::map<int,SDL_Surface*> smallImgs; //creature ID -> small 32x32 img of creature; //ID=-2 is for blank (black) img; -1 for the border
CDefHandler * flags; std::map<int,SDL_Surface*> bigImgs; //creature ID -> big 58x64 img of creature; //ID=-2 is for blank (black) img; -1 for the border
//creatures std::map<int,SDL_Surface*> backgrounds; //castle ID -> 100x130 background creature image // -1 is for neutral
std::map<int,SDL_Surface*> smallImgs; //creature ID -> small 32x32 img of creature; //ID=-2 is for blank (black) img; -1 for the border std::map<int,SDL_Surface*> backgroundsm; //castle ID -> 100x120 background creature image // -1 is for neutral
std::map<int,SDL_Surface*> bigImgs; //creature ID -> big 58x64 img of creature; //ID=-2 is for blank (black) img; -1 for the border //for battles
std::map<int,SDL_Surface*> backgrounds; //castle ID -> 100x130 background creature image // -1 is for neutral std::vector< std::vector< std::string > > battleBacks; //battleBacks[terType] - vector of possible names for certain terrain type
std::map<int,SDL_Surface*> backgroundsm; //castle ID -> 100x120 background creature image // -1 is for neutral std::vector< std::string > battleHeroes; //battleHeroes[hero type] - name of def that has hero animation for battle
//for battles std::map< int, std::vector < std::string > > battleACToDef; //maps AC format to vector of appropriate def names
std::vector< std::vector< std::string > > battleBacks; //battleBacks[terType] - vector of possible names for certain terrain type CDefHandler * spellEffectsPics; //bitmaps representing spells affecting a stack in battle
std::vector< std::string > battleHeroes; //battleHeroes[hero type] - name of def that has hero animation for battle std::vector<std::string> guildBgs;// name of bitmaps with imgs for mage guild screen
std::map< int, std::vector < std::string > > battleACToDef; //maps AC format to vector of appropriate def names //functions
CDefHandler * spellEffectsPics; //bitmaps representing spells affecting a stack in battle Graphics();
std::vector<std::string> guildBgs;// name of bitmaps with imgs for mage guild screen void initializeBattleGraphics();
//functions void loadPaletteAndColors();
Graphics(); void loadHeroFlags();
void initializeBattleGraphics(); void loadHeroFlags(std::pair<std::vector<CDefHandler *> Graphics::*, std::vector<const char *> > &pr, bool mode);
void loadPaletteAndColors(); void loadHeroAnim(std::vector<CDefHandler **> & anims);
void loadHeroFlags(); void loadHeroPortraits();
void loadHeroFlags(std::pair<std::vector<CDefHandler *> Graphics::*, std::vector<const char *> > &pr, bool mode); SDL_Surface * drawHeroInfoWin(const CGHeroInstance * curh);
void loadHeroAnim(std::vector<CDefHandler **> & anims); SDL_Surface * drawPrimarySkill(const CGHeroInstance *curh, SDL_Surface *ret, int from=0, int to=PRIMARY_SKILLS);
void loadHeroPortraits(); SDL_Surface * drawTownInfoWin(const CGTownInstance * curh);
SDL_Surface * drawHeroInfoWin(const CGHeroInstance * curh); SDL_Surface * getPic(int ID, bool fort=true, bool builded=false); //returns small picture of town: ID=-1 - blank; -2 - border; -3 - random
SDL_Surface * drawPrimarySkill(const CGHeroInstance *curh, SDL_Surface *ret, int from=0, int to=PRIMARY_SKILLS); void blueToPlayersAdv(SDL_Surface * sur, int player); //replaces blue interface colour with a color of player
SDL_Surface * drawTownInfoWin(const CGTownInstance * curh); };
SDL_Surface * getPic(int ID, bool fort=true, bool builded=false); //returns small picture of town: ID=-1 - blank; -2 - border; -3 - random
void blueToPlayersAdv(SDL_Surface * sur, int player); //replaces blue interface colour with a color of player extern Graphics * graphics;
};
extern Graphics * graphics;
#endif //GRAPHICS_H #endif //GRAPHICS_H

View File

@ -0,0 +1,5 @@
# This code depends on make tool being used
DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

View File

@ -0,0 +1,92 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk

View File

@ -0,0 +1,257 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=
# Macros
PLATFORM=GNU-Linux-x86
# Include project Makefile
include Makefile
# Object Directory
OBJECTDIR=build/Debug/${PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSpellHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CLuaHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCastleInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCursorHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CObjectHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CCreatureAnimation.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Client.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInfo.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CHeroWindow.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMessage.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPlayerInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CAbilityHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSndHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../mapHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPathfinder.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPreGame.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CBitmapHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Graphics.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CDefHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../AdventureMapButton.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_Extensions.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CConfigHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CAdvmapInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CThreadHelper.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_framerate.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCallback.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMT.o
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=-D_GNU_SOURCE=1 -D_REENTRANT
CXXFLAGS=-D_GNU_SOURCE=1 -D_REENTRANT
# Fortran Compiler Flags
FFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=-L../../../../boost/lib -Wl,-rpath ../../lib/vcmi_lib/dist/Debug/GNU-Linux-x86 -L../../lib/vcmi_lib/dist/Debug/GNU-Linux-x86 -lvcmi_lib
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
${MAKE} -f nbproject/Makefile-Debug.mk dist/Debug/${PLATFORM}/vcmi_client
dist/Debug/${PLATFORM}/vcmi_client: ../../lib/vcmi_lib/dist/Debug/GNU-Linux-x86/libvcmi_lib.so
dist/Debug/${PLATFORM}/vcmi_client: ${OBJECTFILES}
${MKDIR} -p dist/Debug/${PLATFORM}
${LINK.cc} -lboost_system-gcc43-mt-1_37 -lboost_thread-gcc43-mt-1_37 -lboost_filesystem-gcc43-mt-1_37 -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer -o dist/Debug/${PLATFORM}/vcmi_client ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSpellHandler.o: ../../hch/CSpellHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSpellHandler.o ../../hch/CSpellHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CLuaHandler.o: ../../CLuaHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CLuaHandler.o ../../CLuaHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.o: ../CSpellWindow.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.o ../CSpellWindow.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCastleInterface.o: ../../CCastleInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCastleInterface.o ../../CCastleInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCursorHandler.o: ../../CCursorHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCursorHandler.o ../../CCursorHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CObjectHandler.o: ../../hch/CObjectHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CObjectHandler.o ../../hch/CObjectHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CCreatureAnimation.o: ../CCreatureAnimation.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CCreatureAnimation.o ../CCreatureAnimation.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Client.o: ../Client.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Client.o ../Client.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInfo.o: ../../CGameInfo.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInfo.o ../../CGameInfo.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CHeroWindow.o: ../../CHeroWindow.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CHeroWindow.o ../../CHeroWindow.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMessage.o: ../../CMessage.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMessage.o ../../CMessage.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPlayerInterface.o: ../../CPlayerInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPlayerInterface.o ../../CPlayerInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CAbilityHandler.o: ../../hch/CAbilityHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CAbilityHandler.o ../../hch/CAbilityHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSndHandler.o: ../../hch/CSndHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSndHandler.o ../../hch/CSndHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.o: ../../CBattleInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.o ../../CBattleInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../mapHandler.o: ../../mapHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../mapHandler.o ../../mapHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPathfinder.o: ../../CPathfinder.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPathfinder.o ../../CPathfinder.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInterface.o: ../../CGameInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInterface.o ../../CGameInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPreGame.o: ../../CPreGame.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPreGame.o ../../CPreGame.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CBitmapHandler.o: ../CBitmapHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CBitmapHandler.o ../CBitmapHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Graphics.o: ../Graphics.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Graphics.o ../Graphics.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CDefHandler.o: ../../hch/CDefHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CDefHandler.o ../../hch/CDefHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../AdventureMapButton.o: ../../AdventureMapButton.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../AdventureMapButton.o ../../AdventureMapButton.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_Extensions.o: ../../SDL_Extensions.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_Extensions.o ../../SDL_Extensions.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CConfigHandler.o: ../CConfigHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CConfigHandler.o ../CConfigHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CAdvmapInterface.o: ../../CAdvmapInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CAdvmapInterface.o ../../CAdvmapInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CThreadHelper.o: ../../CThreadHelper.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CThreadHelper.o ../../CThreadHelper.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.o: ../../hch/CMusicHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.o ../../hch/CMusicHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_framerate.o: ../../SDL_framerate.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_framerate.o ../../SDL_framerate.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCallback.o: ../../CCallback.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCallback.o ../../CCallback.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMT.o: ../../CMT.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -g -Wall -I/usr/include/SDL -I../../../../boost/include/boost-1_37 -I.. -I../../hch -I/usr/include/lua5.1 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMT.o ../../CMT.cpp
# Subprojects
.build-subprojects:
cd ../../lib/vcmi_lib && ${MAKE} -f Makefile-nb CONF=Debug
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r build/Debug
${RM} dist/Debug/${PLATFORM}/vcmi_client
# Subprojects
.clean-subprojects:
cd ../../lib/vcmi_lib && ${MAKE} -f Makefile-nb CONF=Debug clean
# Enable dependency checking
.dep.inc: .depcheck-impl
include .dep.inc

View File

@ -0,0 +1,253 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=
# Macros
PLATFORM=GNU-Linux-x86
# Include project Makefile
include Makefile
# Object Directory
OBJECTDIR=build/Release/${PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSpellHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CLuaHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCastleInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCursorHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CObjectHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CCreatureAnimation.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Client.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInfo.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CHeroWindow.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMessage.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPlayerInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CAbilityHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSndHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../mapHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPathfinder.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPreGame.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CBitmapHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Graphics.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CDefHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../AdventureMapButton.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_Extensions.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CConfigHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CAdvmapInterface.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CThreadHelper.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_framerate.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCallback.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMT.o
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=
CXXFLAGS=
# Fortran Compiler Flags
FFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
${MAKE} -f nbproject/Makefile-Release.mk dist/Release/${PLATFORM}/vcmi_client
dist/Release/${PLATFORM}/vcmi_client: ${OBJECTFILES}
${MKDIR} -p dist/Release/${PLATFORM}
${LINK.cc} -o dist/Release/${PLATFORM}/vcmi_client ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSpellHandler.o: ../../hch/CSpellHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSpellHandler.o ../../hch/CSpellHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CLuaHandler.o: ../../CLuaHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CLuaHandler.o ../../CLuaHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.o: ../CSpellWindow.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.o ../CSpellWindow.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCastleInterface.o: ../../CCastleInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCastleInterface.o ../../CCastleInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCursorHandler.o: ../../CCursorHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCursorHandler.o ../../CCursorHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CObjectHandler.o: ../../hch/CObjectHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CObjectHandler.o ../../hch/CObjectHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CCreatureAnimation.o: ../CCreatureAnimation.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CCreatureAnimation.o ../CCreatureAnimation.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Client.o: ../Client.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Client.o ../Client.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInfo.o: ../../CGameInfo.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInfo.o ../../CGameInfo.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CHeroWindow.o: ../../CHeroWindow.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CHeroWindow.o ../../CHeroWindow.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMessage.o: ../../CMessage.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMessage.o ../../CMessage.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPlayerInterface.o: ../../CPlayerInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPlayerInterface.o ../../CPlayerInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CAbilityHandler.o: ../../hch/CAbilityHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CAbilityHandler.o ../../hch/CAbilityHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSndHandler.o: ../../hch/CSndHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CSndHandler.o ../../hch/CSndHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.o: ../../CBattleInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.o ../../CBattleInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../mapHandler.o: ../../mapHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../mapHandler.o ../../mapHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPathfinder.o: ../../CPathfinder.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPathfinder.o ../../CPathfinder.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInterface.o: ../../CGameInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CGameInterface.o ../../CGameInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPreGame.o: ../../CPreGame.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CPreGame.o ../../CPreGame.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CBitmapHandler.o: ../CBitmapHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CBitmapHandler.o ../CBitmapHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Graphics.o: ../Graphics.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../Graphics.o ../Graphics.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CDefHandler.o: ../../hch/CDefHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CDefHandler.o ../../hch/CDefHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../AdventureMapButton.o: ../../AdventureMapButton.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../AdventureMapButton.o ../../AdventureMapButton.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_Extensions.o: ../../SDL_Extensions.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_Extensions.o ../../SDL_Extensions.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CConfigHandler.o: ../CConfigHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../CConfigHandler.o ../CConfigHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CAdvmapInterface.o: ../../CAdvmapInterface.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CAdvmapInterface.o ../../CAdvmapInterface.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CThreadHelper.o: ../../CThreadHelper.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CThreadHelper.o ../../CThreadHelper.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.o: ../../hch/CMusicHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.o ../../hch/CMusicHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_framerate.o: ../../SDL_framerate.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../SDL_framerate.o ../../SDL_framerate.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCallback.o: ../../CCallback.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CCallback.o ../../CCallback.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMT.o: ../../CMT.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../..
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/client/vcmi_client/../../CMT.o ../../CMT.cpp
# Subprojects
.build-subprojects:
# Clean Targets
.clean-conf:
${RM} -r build/Release
${RM} dist/Release/${PLATFORM}/vcmi_client
# Subprojects
.clean-subprojects:
# Enable dependency checking
.dep.inc: .depcheck-impl
include .dep.inc

View File

@ -0,0 +1,123 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=vcmi_client
# Active Configuration
DEFAULTCONF=Debug
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=Debug Release
# build
.build-impl: .build-pre .validate-impl .depcheck-impl
@#echo "=> Running $@... Configuration=$(CONF)"
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre .validate-impl .depcheck-impl
@#echo "=> Running $@... Configuration=$(CONF)"
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
@#echo "=> Running $@..."
for CONF in ${ALLCONFS}; \
do \
${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
done
# all
.all-impl: .all-pre .depcheck-impl
@#echo "=> Running $@..."
for CONF in ${ALLCONFS}; \
do \
${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
done
# dependency checking support
.depcheck-impl:
@echo "# This code depends on make tool being used" >.dep.inc
@if [ -n "${MAKE_VERSION}" ]; then \
echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
echo "include \$${DEPFILES}" >>.dep.inc; \
echo "endif" >>.dep.inc; \
else \
echo ".KEEP_STATE:" >>.dep.inc; \
echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
fi
# configuration validation
.validate-impl:
@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
echo ""; \
echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
echo "See 'make help' for details."; \
echo "Current directory: " `pwd`; \
echo ""; \
fi
@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
exit 1; \
fi
# help
.help-impl: .help-pre
@echo "This makefile supports the following configurations:"
@echo " ${ALLCONFS}"
@echo ""
@echo "and the following targets:"
@echo " build (default target)"
@echo " clean"
@echo " clobber"
@echo " all"
@echo " help"
@echo ""
@echo "Makefile Usage:"
@echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
@echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
@echo " make [SUB=no] clobber"
@echo " make [SUB=no] all"
@echo " make help"
@echo ""
@echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
@echo " also clean subprojects."
@echo "Target 'clobber' will remove all built files from all configurations and,"
@echo " unless 'SUB=no', also from subprojects."
@echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'help' prints this message."
@echo ""

View File

@ -0,0 +1,72 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
PLATFORM=GNU-Linux-x86
TMPDIR=build/Debug/${PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=dist/Debug/${PLATFORM}/vcmi_client
OUTPUT_BASENAME=vcmi_client
PACKAGE_TOP_DIR=vcmiclient/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p dist/Debug/${PLATFORM}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/vcmiclient/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
# Generate tar file
cd "${TOP}"
rm -f dist/Debug/${PLATFORM}/package/vcmiclient.tar
cd ${TMPDIR}
tar -vcf ../../../../dist/Debug/${PLATFORM}/package/vcmiclient.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}

View File

@ -0,0 +1,72 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
PLATFORM=GNU-Linux-x86
TMPDIR=build/Release/${PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=dist/Release/${PLATFORM}/vcmi_client
OUTPUT_BASENAME=vcmi_client
PACKAGE_TOP_DIR=vcmiclient/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p dist/Release/${PLATFORM}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/vcmiclient/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
# Generate tar file
cd "${TOP}"
rm -f dist/Release/${PLATFORM}/package/vcmiclient.tar
cd ${TMPDIR}
tar -vcf ../../../../dist/Release/${PLATFORM}/package/vcmiclient.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}

View File

@ -0,0 +1,595 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="51">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../../AdventureMapButton.h</itemPath>
<itemPath>../../AI_Base.h</itemPath>
<itemPath>../../hch/CAbilityHandler.h</itemPath>
<itemPath>../../CAdvmapInterface.h</itemPath>
<itemPath>../../hch/CAmbarCendamo.h</itemPath>
<itemPath>../../hch/CArtHandler.h</itemPath>
<itemPath>../../CBattleInterface.h</itemPath>
<itemPath>../CBitmapHandler.h</itemPath>
<itemPath>../../hch/CBuildingHandler.h</itemPath>
<itemPath>../../CCallback.h</itemPath>
<itemPath>../../CCastleInterface.h</itemPath>
<itemPath>../CConfigHandler.h</itemPath>
<itemPath>../CCreatureAnimation.h</itemPath>
<itemPath>../../CCursorHandler.h</itemPath>
<itemPath>../../hch/CDefHandler.h</itemPath>
<itemPath>../../CGameInfo.h</itemPath>
<itemPath>../../CGameInterface.h</itemPath>
<itemPath>../../hch/CHeroHandler.h</itemPath>
<itemPath>../../CHeroWindow.h</itemPath>
<itemPath>../Client.h</itemPath>
<itemPath>../../CLuaHandler.h</itemPath>
<itemPath>../../CMessage.h</itemPath>
<itemPath>../../hch/CMusicHandler.h</itemPath>
<itemPath>../../hch/CObjectHandler.h</itemPath>
<itemPath>../../CPathfinder.h</itemPath>
<itemPath>../../CPlayerInterface.h</itemPath>
<itemPath>../../CPreGame.h</itemPath>
<itemPath>../../hch/CSndHandler.h</itemPath>
<itemPath>../CSpellWindow.h</itemPath>
<itemPath>../../CThreadHelper.h</itemPath>
<itemPath>../FunctionList.h</itemPath>
<itemPath>../../global.h</itemPath>
<itemPath>../Graphics.h</itemPath>
<itemPath>../../int3.h</itemPath>
<itemPath>../../map.h</itemPath>
<itemPath>../../mapHandler.h</itemPath>
<itemPath>../../nodrze.h</itemPath>
<itemPath>../../SDL_framerate.h</itemPath>
<itemPath>../../StartInfo.h</itemPath>
<itemPath>../../stdafx.h</itemPath>
<itemPath>../../timeHandler.h</itemPath>
</logicalFolder>
<logicalFolder name="ResourceFiles"
displayName="Resource Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../AdventureMapButton.cpp</itemPath>
<itemPath>../../hch/CAbilityHandler.cpp</itemPath>
<itemPath>../../CAdvmapInterface.cpp</itemPath>
<itemPath>../../CBattleInterface.cpp</itemPath>
<itemPath>../CBitmapHandler.cpp</itemPath>
<itemPath>../../CCallback.cpp</itemPath>
<itemPath>../../CCastleInterface.cpp</itemPath>
<itemPath>../CConfigHandler.cpp</itemPath>
<itemPath>../CCreatureAnimation.cpp</itemPath>
<itemPath>../../CCursorHandler.cpp</itemPath>
<itemPath>../../hch/CDefHandler.cpp</itemPath>
<itemPath>../../CGameInfo.cpp</itemPath>
<itemPath>../../CGameInterface.cpp</itemPath>
<itemPath>../../CHeroWindow.cpp</itemPath>
<itemPath>../Client.cpp</itemPath>
<itemPath>../../CLuaHandler.cpp</itemPath>
<itemPath>../../CMessage.cpp</itemPath>
<itemPath>../../CMT.cpp</itemPath>
<itemPath>../../hch/CMusicHandler.cpp</itemPath>
<itemPath>../../hch/CObjectHandler.cpp</itemPath>
<itemPath>../../CPathfinder.cpp</itemPath>
<itemPath>../../CPlayerInterface.cpp</itemPath>
<itemPath>../../CPreGame.cpp</itemPath>
<itemPath>../../hch/CSndHandler.cpp</itemPath>
<itemPath>../../hch/CSpellHandler.cpp</itemPath>
<itemPath>../CSpellWindow.cpp</itemPath>
<itemPath>../../CThreadHelper.cpp</itemPath>
<itemPath>../Graphics.cpp</itemPath>
<itemPath>../../mapHandler.cpp</itemPath>
<itemPath>../../SDL_Extensions.cpp</itemPath>
<itemPath>../../SDL_framerate.cpp</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>..</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="Debug" type="1">
<toolsSet>
<developmentServer>localhost</developmentServer>
<compilerSet>GNU|GNU</compilerSet>
<platform>2</platform>
</toolsSet>
<compileType>
<ccCompilerTool>
<includeDirectories>
<directoryPath>/usr/include/SDL</directoryPath>
<directoryPath>../../../../boost/include/boost-1_37</directoryPath>
<directoryPath>..</directoryPath>
<directoryPath>../../hch</directoryPath>
<directoryPath>/usr/include/lua5.1</directoryPath>
</includeDirectories>
<commandLine>-D_GNU_SOURCE=1 -D_REENTRANT</commandLine>
<warningLevel>2</warningLevel>
</ccCompilerTool>
<linkerTool>
<output>dist/Debug/${PLATFORM}/vcmi_client</output>
<linkerAddLib>
<directoryPath>../../../../boost/lib</directoryPath>
</linkerAddLib>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../../lib/vcmi_lib"
CT="2"
CN="Debug"
AC="true"
BL="true"
WD="../../lib/vcmi_lib"
BC="${MAKE} -f Makefile-nb CONF=Debug"
CC="${MAKE} -f Makefile-nb CONF=Debug clean"
OP="dist/Debug/GNU-Linux-x86/libvcmi_lib.so">
</makeArtifact>
</linkerLibProjectItem>
</linkerLibItems>
<commandLine>-lboost_system-gcc43-mt-1_37 -lboost_thread-gcc43-mt-1_37 -lboost_filesystem-gcc43-mt-1_37 -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer</commandLine>
</linkerTool>
</compileType>
<item path="../../AI_Base.h">
<itemTool>3</itemTool>
</item>
<item path="../../AdventureMapButton.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../AdventureMapButton.h">
<itemTool>3</itemTool>
</item>
<item path="../../CAdvmapInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CAdvmapInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CBattleInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CBattleInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CCallback.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CCallback.h">
<itemTool>3</itemTool>
</item>
<item path="../../CCastleInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CCastleInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CCursorHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CCursorHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../CGameInfo.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CGameInfo.h">
<itemTool>3</itemTool>
</item>
<item path="../../CGameInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CGameInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CHeroWindow.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CHeroWindow.h">
<itemTool>3</itemTool>
</item>
<item path="../../CLuaHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CLuaHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../CMT.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CMessage.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CMessage.h">
<itemTool>3</itemTool>
</item>
<item path="../../CPathfinder.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CPathfinder.h">
<itemTool>3</itemTool>
</item>
<item path="../../CPlayerInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CPlayerInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CPreGame.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CPreGame.h">
<itemTool>3</itemTool>
</item>
<item path="../../CThreadHelper.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CThreadHelper.h">
<itemTool>3</itemTool>
</item>
<item path="../../SDL_Extensions.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../SDL_framerate.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../SDL_framerate.h">
<itemTool>3</itemTool>
</item>
<item path="../../StartInfo.h">
<itemTool>3</itemTool>
</item>
<item path="../../global.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CAbilityHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CAbilityHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CAmbarCendamo.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CArtHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CBuildingHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CDefHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CDefHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CHeroHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CMusicHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CMusicHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CObjectHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CObjectHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CSndHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CSndHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CSpellHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../int3.h">
<itemTool>3</itemTool>
</item>
<item path="../../map.h">
<itemTool>3</itemTool>
</item>
<item path="../../mapHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../mapHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../nodrze.h">
<itemTool>3</itemTool>
</item>
<item path="../../stdafx.h">
<itemTool>3</itemTool>
</item>
<item path="../../timeHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../CBitmapHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CBitmapHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../CConfigHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CConfigHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../CCreatureAnimation.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CCreatureAnimation.h">
<itemTool>3</itemTool>
</item>
<item path="../CSpellWindow.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CSpellWindow.h">
<itemTool>3</itemTool>
</item>
<item path="../Client.cpp">
<itemTool>1</itemTool>
</item>
<item path="../Client.h">
<itemTool>3</itemTool>
</item>
<item path="../FunctionList.h">
<itemTool>3</itemTool>
</item>
<item path="../Graphics.cpp">
<itemTool>1</itemTool>
</item>
<item path="../Graphics.h">
<itemTool>3</itemTool>
</item>
</conf>
<conf name="Release" type="1">
<toolsSet>
<developmentServer>localhost</developmentServer>
<compilerSet>GNU|GNU</compilerSet>
<platform>2</platform>
</toolsSet>
<compileType>
<cCompilerTool>
<developmentMode>5</developmentMode>
</cCompilerTool>
<ccCompilerTool>
<developmentMode>5</developmentMode>
</ccCompilerTool>
<fortranCompilerTool>
<developmentMode>5</developmentMode>
</fortranCompilerTool>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
</compileType>
<item path="../../AI_Base.h">
<itemTool>3</itemTool>
</item>
<item path="../../AdventureMapButton.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../AdventureMapButton.h">
<itemTool>3</itemTool>
</item>
<item path="../../CAdvmapInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CAdvmapInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CBattleInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CBattleInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CCallback.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CCallback.h">
<itemTool>3</itemTool>
</item>
<item path="../../CCastleInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CCastleInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CCursorHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CCursorHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../CGameInfo.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CGameInfo.h">
<itemTool>3</itemTool>
</item>
<item path="../../CGameInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CGameInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CHeroWindow.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CHeroWindow.h">
<itemTool>3</itemTool>
</item>
<item path="../../CLuaHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CLuaHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../CMT.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CMessage.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CMessage.h">
<itemTool>3</itemTool>
</item>
<item path="../../CPathfinder.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CPathfinder.h">
<itemTool>3</itemTool>
</item>
<item path="../../CPlayerInterface.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CPlayerInterface.h">
<itemTool>3</itemTool>
</item>
<item path="../../CPreGame.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CPreGame.h">
<itemTool>3</itemTool>
</item>
<item path="../../CThreadHelper.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../CThreadHelper.h">
<itemTool>3</itemTool>
</item>
<item path="../../SDL_Extensions.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../SDL_framerate.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../SDL_framerate.h">
<itemTool>3</itemTool>
</item>
<item path="../../StartInfo.h">
<itemTool>3</itemTool>
</item>
<item path="../../global.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CAbilityHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CAbilityHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CAmbarCendamo.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CArtHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CBuildingHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CDefHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CDefHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CHeroHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CMusicHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CMusicHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CObjectHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CObjectHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CSndHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../hch/CSndHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../hch/CSpellHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../int3.h">
<itemTool>3</itemTool>
</item>
<item path="../../map.h">
<itemTool>3</itemTool>
</item>
<item path="../../mapHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../../mapHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../../nodrze.h">
<itemTool>3</itemTool>
</item>
<item path="../../stdafx.h">
<itemTool>3</itemTool>
</item>
<item path="../../timeHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../CBitmapHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CBitmapHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../CConfigHandler.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CConfigHandler.h">
<itemTool>3</itemTool>
</item>
<item path="../CCreatureAnimation.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CCreatureAnimation.h">
<itemTool>3</itemTool>
</item>
<item path="../CSpellWindow.cpp">
<itemTool>1</itemTool>
</item>
<item path="../CSpellWindow.h">
<itemTool>3</itemTool>
</item>
<item path="../Client.cpp">
<itemTool>1</itemTool>
</item>
<item path="../Client.h">
<itemTool>3</itemTool>
</item>
<item path="../FunctionList.h">
<itemTool>3</itemTool>
</item>
<item path="../Graphics.cpp">
<itemTool>1</itemTool>
</item>
<item path="../Graphics.h">
<itemTool>3</itemTool>
</item>
</conf>
</confs>
</configurationDescriptor>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="51">
<projectmakefile>Makefile</projectmakefile>
<defaultConf>0</defaultConf>
<confs>
<conf name="Debug" type="1">
<gdbdebugger version="2">
<gdb_command>gdb</gdb_command>
<array_repeat_threshold>10</array_repeat_threshold>
</gdbdebugger>
<runprofile version="5">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<environment>
</environment>
</runprofile>
</conf>
<conf name="Release" type="1">
<gdbdebugger version="2">
<gdb_command>gdb</gdb_command>
<array_repeat_threshold>10</array_repeat_threshold>
</gdbdebugger>
<runprofile version="5">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1">
<file>
<url>file:/home/t0/vcmi/trunk/client/vcmi_client/../../hch/CMusicHandler.cpp</url>
<line>67</line>
</file>
<file>
<url>file:/home/t0/vcmi/trunk/CPreGame.h</url>
<line>272</line>
</file>
<file>
<url>file:/home/t0/vcmi/trunk/client/vcmi_client/../CSpellWindow.cpp</url>
<line>638</line>
</file>
<file>
<url>file:/home/t0/vcmi/trunk/client/vcmi_client/../../CBattleInterface.cpp</url>
<line>1754</line>
<line>2257</line>
</file>
<file>
<url>file:/home/t0/vcmi/trunk/CMessage.cpp</url>
<line>103</line>
</file>
</editor-bookmarks>
</project-private>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.cnd.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>vcmi_client</name>
<make-project-type>0</make-project-type>
<c-extensions/>
<cpp-extensions>cpp</cpp-extensions>
<header-extensions>h</header-extensions>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects>
<make-dep-project>../../lib/vcmi_lib</make-dep-project>
</make-dep-projects>
</data>
</configuration>
</project>

View File

@ -1,58 +1,58 @@
#ifndef COBJINFOECTHANDLER_H #ifndef __CDEFOBJINFOHANDLER_H__
#define COBJINFOECTHANDLER_H #define __CDEFOBJINFOHANDLER_H__
#include <vector> #include <vector>
#include <map> #include <map>
#include "../global.h" #include "../global.h"
class CDefHandler; class CDefHandler;
class CLodHandler; class CLodHandler;
class DLL_EXPORT CGDefInfo class DLL_EXPORT CGDefInfo
{ {
public: public:
std::string name; std::string name;
unsigned char visitMap[6]; unsigned char visitMap[6];
unsigned char blockMap[6]; unsigned char blockMap[6];
unsigned char visitDir; //directions from which object can be entered, format same as for moveDir in CGHeroInstance(but 0 - 7) unsigned char visitDir; //directions from which object can be entered, format same as for moveDir in CGHeroInstance(but 0 - 7)
int id, subid; //of object described by this defInfo int id, subid; //of object described by this defInfo
int terrainAllowed, //on which terrain it is possible to place object int terrainAllowed, //on which terrain it is possible to place object
terrainMenu; //in which menus in map editor object will be showed terrainMenu; //in which menus in map editor object will be showed
int width, height; //tiles int width, height; //tiles
int type; //(0- ground, 1- towns, 2-creatures, 3- heroes, 4-artifacts, 5- resources) int type; //(0- ground, 1- towns, 2-creatures, 3- heroes, 4-artifacts, 5- resources)
CDefHandler * handler; CDefHandler * handler;
int printPriority; int printPriority;
bool isVisitable(); bool isVisitable();
bool operator<(const CGDefInfo& por) bool operator<(const CGDefInfo& por)
{ {
if(id!=por.id) if(id!=por.id)
return id<por.id; return id<por.id;
else else
return subid<por.subid; return subid<por.subid;
} }
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & name & visitMap & blockMap & visitDir & id & subid &terrainAllowed & terrainMenu & width & height & type & printPriority; h & name & visitMap & blockMap & visitDir & id & subid &terrainAllowed & terrainMenu & width & height & type & printPriority;
} }
CGDefInfo(); CGDefInfo();
}; };
class DLL_EXPORT CDefObjInfoHandler class DLL_EXPORT CDefObjInfoHandler
{ {
public: public:
std::map<int,std::map<int,CGDefInfo*> > gobjs; std::map<int,std::map<int,CGDefInfo*> > gobjs;
std::map<int,CGDefInfo*> castles; std::map<int,CGDefInfo*> castles;
//std::vector<DefObjInfo> objs; //std::vector<DefObjInfo> objs;
void load(); void load();
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & gobjs; h & gobjs;
if(!h.saving) //recrete castles map if(!h.saving) //recrete castles map
for(std::map<int,std::map<int,CGDefInfo*> >::iterator i=gobjs.begin(); i!=gobjs.end(); i++) for(std::map<int,std::map<int,CGDefInfo*> >::iterator i=gobjs.begin(); i!=gobjs.end(); i++)
for(std::map<int,CGDefInfo*>::iterator j=i->second.begin(); j!=i->second.end(); j++) for(std::map<int,CGDefInfo*>::iterator j=i->second.begin(); j!=i->second.end(); j++)
if(j->second->id == 98) if(j->second->id == 98)
castles[j->second->subid]=j->second; castles[j->second->subid]=j->second;
} }
}; };
#endif //COBJINFOECTHANDLER_H #endif // __CDEFOBJINFOHANDLER_H__

View File

@ -1,150 +1,150 @@
#ifndef CVIDEOHANDLEER_H #ifndef __CVIDEOHANDLER_H__
#define CVIDEOHANDLEER_H #define __CVIDEOHANDLER_H__
#include <stdio.h> #include <stdio.h>
#ifdef WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
#else #else
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
// //
#define BINKNOTHREADEDIO 0x00800000 #define BINKNOTHREADEDIO 0x00800000
// //
// protected // protected
// FLib: HINST; // FLib: HINST;
// FLibName: string; // FLibName: string;
// FFileHandle: HFile; // FFileHandle: HFile;
// function GetCurrentFrame: int; virtual; abstract; // function GetCurrentFrame: int; virtual; abstract;
// function GetFramesCount: int; virtual; abstract; // function GetFramesCount: int; virtual; abstract;
// procedure SetCurrentFrame(v: int); virtual; abstract; // procedure SetCurrentFrame(v: int); virtual; abstract;
// procedure DoOpen(FileHandle: hFile); virtual; abstract; // procedure DoOpen(FileHandle: hFile); virtual; abstract;
// function NormalizeFrame(i:int):int; // function NormalizeFrame(i:int):int;
// procedure SetPause(v:Boolean); virtual; abstract; // procedure SetPause(v:Boolean); virtual; abstract;
// //
// procedure LoadProc(var Proc:Pointer; const ProcName:string); // procedure LoadProc(var Proc:Pointer; const ProcName:string);
// public // public
// Width:pint; // Width:pint;
// Height:pint; // Height:pint;
// constructor Create(const LibName:string); // constructor Create(const LibName:string);
// destructor Destroy; override; // destructor Destroy; override;
// procedure Open(FileHandle:hFile); overload; // procedure Open(FileHandle:hFile); overload;
// procedure Open(FileName:string); overload; // procedure Open(FileName:string); overload;
//// procedure Open(FileData:TRSByteArray); overload; //// procedure Open(FileData:TRSByteArray); overload;
// procedure SetVolume(i: int); virtual; // procedure SetVolume(i: int); virtual;
// procedure Close; virtual; // procedure Close; virtual;
// procedure NextFrame; virtual; abstract; // procedure NextFrame; virtual; abstract;
// procedure PreparePic(b:TBitmap); virtual; // procedure PreparePic(b:TBitmap); virtual;
// procedure GotoFrame(Index:int; b:TBitmap); virtual; // procedure GotoFrame(Index:int; b:TBitmap); virtual;
// function ExtractFrame(b:TBitmap = nil):TBitmap; virtual; abstract; // function ExtractFrame(b:TBitmap = nil):TBitmap; virtual; abstract;
// function Wait:Boolean; virtual; abstract; // function Wait:Boolean; virtual; abstract;
// // Workaround for Bink and Smack thread synchronization bug // // Workaround for Bink and Smack thread synchronization bug
// property Frame: int read GetCurrentFrame write SetCurrentFrame; // property Frame: int read GetCurrentFrame write SetCurrentFrame;
// property FramesCount: int read GetFramesCount; // property FramesCount: int read GetFramesCount;
// property LibInstance: HINST read FLib; // property LibInstance: HINST read FLib;
// property Pause: Boolean write SetPause; // property Pause: Boolean write SetPause;
//TRSSmkStruct = packed record //TRSSmkStruct = packed record
// Version: int; // Version: int;
// Width: int; // Width: int;
// Height: int; // Height: int;
// FrameCount: int; // FrameCount: int;
// mspf: int; // mspf: int;
// Unk1: array[0..87] of byte; // Unk1: array[0..87] of byte;
// Palette: array[0..775] of byte; // Palette: array[0..775] of byte;
// CurrentFrame: int; // Starting with 0 // CurrentFrame: int; // Starting with 0
// // 72 - ��� // // 72 - ���
// // 1060 - interesting // // 1060 - interesting
// // 1100 - Mute:Bool // // 1100 - Mute:Bool
//end; //end;
//TRSBinkStruct = packed record //TRSBinkStruct = packed record
// Width: int; // Width: int;
// Height: int; // Height: int;
// FrameCount: int; // FrameCount: int;
// CurrentFrame: int; // Starting with 1 // CurrentFrame: int; // Starting with 1
// LastFrame: int; // LastFrame: int;
// FPSMul: int; // frames/second multiplier // FPSMul: int; // frames/second multiplier
// FPSDiv: int; // frames/second divisor // FPSDiv: int; // frames/second divisor
// Unk1: int; // Unk1: int;
// Flags: int; // Flags: int;
// Unk2: array[0..259] of byte; // Unk2: array[0..259] of byte;
// CurrentPlane: int; // CurrentPlane: int;
// Plane1: ptr; // Plane1: ptr;
// Plane2: ptr; // Plane2: ptr;
// Unk3: array[0..1] of int; // Unk3: array[0..1] of int;
// YPlaneWidth: int; // YPlaneWidth: int;
// YPlaneHeight: int; // YPlaneHeight: int;
// UVPlaneWidth: int; // UVPlaneWidth: int;
// UVPlaneHeight: int; // UVPlaneHeight: int;
//end; //end;
typedef struct typedef struct
{ {
int width; int width;
int height; int height;
int frameCount; int frameCount;
int currentFrame; int currentFrame;
int lastFrame; int lastFrame;
int FPSMul; int FPSMul;
int FPSDiv; int FPSDiv;
int unknown0; int unknown0;
unsigned char flags; unsigned char flags;
unsigned char unknown1[260]; unsigned char unknown1[260];
int CurPlane; // current plane int CurPlane; // current plane
void *plane0; // pointer to plane 0 void *plane0; // pointer to plane 0
void *plane1; // pointer to plane 1 void *plane1; // pointer to plane 1
int unknown2; int unknown2;
int unknown3; int unknown3;
int yWidth; // Y plane width int yWidth; // Y plane width
int yHeight; // Y plane height int yHeight; // Y plane height
int uvWidth; // U&V plane width int uvWidth; // U&V plane width
int uvHeight; // U&V plane height int uvHeight; // U&V plane height
int d,e,f,g,h,i; int d,e,f,g,h,i;
} BINK_STRUCT, *HBINK; } BINK_STRUCT, *HBINK;
struct SMKStruct struct SMKStruct
{ {
int version, width, height, frameCount, mspf, currentFrame; int version, width, height, frameCount, mspf, currentFrame;
unsigned char unk1[88], palette[776]; unsigned char unk1[88], palette[776];
}; };
class DLLHandler class DLLHandler
{ {
public: public:
#if !defined(__amigaos4__) && !defined(__unix__) #if !defined(__amigaos4__) && !defined(__unix__)
HINSTANCE dll; HINSTANCE dll;
#else #else
void *dll; void *dll;
#endif #endif
void Instantiate(const char *filename); void Instantiate(const char *filename);
const char *GetLibExtension(); const char *GetLibExtension();
void *FindAddress234(const char *symbol); void *FindAddress234(const char *symbol);
virtual ~DLLHandler(); virtual ~DLLHandler();
}; };
class CBIKHandler class CBIKHandler
{ {
public: public:
DLLHandler ourLib; DLLHandler ourLib;
int newmode; int newmode;
#if !defined(__amigaos4__) && !defined(__unix__) #if !defined(__amigaos4__) && !defined(__unix__)
HANDLE hBinkFile; HANDLE hBinkFile;
#else #else
void *hBinkFile; void *hBinkFile;
#endif #endif
HBINK hBink; HBINK hBink;
BINK_STRUCT data; BINK_STRUCT data;
unsigned char * buffer; unsigned char * buffer;
void * waveOutOpen, * BinkGetError, *BinkOpen, *BinkSetSoundSystem ; void * waveOutOpen, * BinkGetError, *BinkOpen, *BinkSetSoundSystem ;
int width, height; int width, height;
CBIKHandler(); CBIKHandler();
void open(std::string name); void open(std::string name);
void close(); void close();
}; };
#endif //CVIDEOHANDLEER_H #endif // __CVIDEOHANDLER_H__

View File

@ -1,13 +1,14 @@
#pragma once #ifndef __BATTLEACTION_H__
struct BattleAction #define __BATTLEACTION_H__
{ struct BattleAction
ui8 side; //who made this action: false - left, true - right player {
ui32 stackNumber;//stack ID, -1 left hero, -2 right hero, ui8 side; //who made this action: false - left, true - right player
ui8 actionType; // 0 = Cancel BattleAction 1 = Hero cast a spell 2 = Walk 3 = Defend 4 = Retreat from the battle 5 = Surrender 6 = Walk and Attack 7 = Shoot 8 = Wait 9 = Catapult 10 = Monster casts a spell (i.e. Faerie Dragons) ui32 stackNumber;//stack ID, -1 left hero, -2 right hero,
ui16 destinationTile; ui8 actionType; // 0 = Cancel BattleAction 1 = Hero cast a spell 2 = Walk 3 = Defend 4 = Retreat from the battle 5 = Surrender 6 = Walk and Attack 7 = Shoot 8 = Wait 9 = Catapult 10 = Monster casts a spell (i.e. Faerie Dragons)
si32 additionalInfo; // e.g. spell number if type is 1 || 10; tile to attack if type is 6 ui16 destinationTile;
template <typename Handler> void serialize(Handler &h, const int version) si32 additionalInfo; // e.g. spell number if type is 1 || 10; tile to attack if type is 6
{ template <typename Handler> void serialize(Handler &h, const int version)
h & side & stackNumber & actionType & destinationTile & additionalInfo; {
} h & side & stackNumber & actionType & destinationTile & additionalInfo;
}; }
};#endif // __BATTLEACTION_H__

View File

@ -1,13 +1,14 @@
#pragma once #ifndef __CONDSH_H__
#include <boost/thread.hpp> #define __CONDSH_H__
template <typename T> struct CondSh #include <boost/thread.hpp>
{ template <typename T> struct CondSh
T data; {
boost::condition_variable cond; T data;
boost::mutex mx; boost::condition_variable cond;
CondSh(){}; boost::mutex mx;
CondSh(T t){data = t;}; CondSh(){};
void set(T t){mx.lock();data=t;mx.unlock();}; //set data CondSh(T t){data = t;};
void setn(T t){mx.lock();data=t;mx.unlock();cond.notify_all();}; //set data and notify void set(T t){mx.lock();data=t;mx.unlock();}; //set data
T get(){boost::unique_lock<boost::mutex> lock(mx); return data;}; void setn(T t){mx.lock();data=t;mx.unlock();cond.notify_all();}; //set data and notify
}; T get(){boost::unique_lock<boost::mutex> lock(mx); return data;};
};#endif // __CONDSH_H__

View File

@ -1,417 +1,416 @@
#ifndef CONNECTION_H #ifndef CONNECTION_H
#define CONNECTION_H #define CONNECTION_H
#pragma once #include "../global.h"
#include "../global.h" #include <string>
#include <string> #include <vector>
#include <vector> #include <set>
#include <set>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/is_fundamental.hpp> #include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_enum.hpp> #include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_pointer.hpp> #include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_class.hpp> #include <boost/type_traits/remove_pointer.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/eval_if.hpp> #include <boost/mpl/equal_to.hpp>
#include <boost/mpl/equal_to.hpp> #include <boost/mpl/int.hpp>
#include <boost/mpl/int.hpp> #include <boost/mpl/identity.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_array.hpp> const int version = 63;
const int version = 63; class CConnection;
class CConnection;
namespace mpl = boost::mpl;
namespace mpl = boost::mpl;
namespace boost
namespace boost {
{ namespace asio
namespace asio {
{ namespace ip
namespace ip {
{ class tcp;
class tcp; }
} class io_service;
class io_service;
template <typename Protocol> class stream_socket_service;
template <typename Protocol> class stream_socket_service; template <typename Protocol,typename StreamSocketService>
template <typename Protocol,typename StreamSocketService> class basic_stream_socket;
class basic_stream_socket;
template <typename Protocol> class socket_acceptor_service;
template <typename Protocol> class socket_acceptor_service; template <typename Protocol,typename SocketAcceptorService>
template <typename Protocol,typename SocketAcceptorService> class basic_socket_acceptor;
class basic_socket_acceptor; }
} class mutex;
class mutex; };
};
enum SerializationLvl
enum SerializationLvl {
{ Wrong=0,
Wrong=0, Primitive,
Primitive, Pointer,
Pointer, Serializable
Serializable };
};
template<typename Ser,typename T>
template<typename Ser,typename T> struct SavePrimitive
struct SavePrimitive {
{ static void invoke(Ser &s, const T &data)
static void invoke(Ser &s, const T &data) {
{ s.savePrimitive(data);
s.savePrimitive(data); }
} };
}; template<typename Ser,typename T>
template<typename Ser,typename T> struct SaveSerializable
struct SaveSerializable {
{ static void invoke(Ser &s, const T &data)
static void invoke(Ser &s, const T &data) {
{ s.saveSerializable(data);
s.saveSerializable(data); }
} };
}; template<typename Ser,typename T>
template<typename Ser,typename T> struct LoadPrimitive
struct LoadPrimitive {
{ static void invoke(Ser &s, T &data)
static void invoke(Ser &s, T &data) {
{ s.loadPrimitive(data);
s.loadPrimitive(data); }
} };
}; template<typename Ser,typename T>
template<typename Ser,typename T> struct SavePointer
struct SavePointer {
{ static void invoke(Ser &s, const T &data)
static void invoke(Ser &s, const T &data) {
{ s.savePointer(data);
s.savePointer(data); }
} };
}; template<typename Ser,typename T>
template<typename Ser,typename T> struct LoadPointer
struct LoadPointer {
{ static void invoke(Ser &s, T &data)
static void invoke(Ser &s, T &data) {
{ s.loadPointer(data);
s.loadPointer(data); }
} };
}; template<typename Ser,typename T>
template<typename Ser,typename T> struct LoadSerializable
struct LoadSerializable {
{ static void invoke(Ser &s, T &data)
static void invoke(Ser &s, T &data) {
{ s.loadSerializable(data);
s.loadSerializable(data); }
} };
};
template<typename Ser,typename T>
template<typename Ser,typename T> struct SaveWrong
struct SaveWrong {
{ static void invoke(Ser &s, const T &data)
static void invoke(Ser &s, const T &data) {
{ throw std::exception("Wrong save serialization call!");
throw std::exception("Wrong save serialization call!"); }
} };
}; template<typename Ser,typename T>
template<typename Ser,typename T> struct LoadWrong
struct LoadWrong {
{ static void invoke(Ser &s, const T &data)
static void invoke(Ser &s, const T &data) {
{ throw std::exception("Wrong load serialization call!");
throw std::exception("Wrong load serialization call!"); }
} };
};
template<typename T>
template<typename T> struct SerializationLevel
struct SerializationLevel {
{ typedef mpl::integral_c_tag tag;
typedef mpl::integral_c_tag tag; typedef
typedef typename mpl::eval_if<
typename mpl::eval_if< boost::is_fundamental<T>,
boost::is_fundamental<T>, mpl::int_<Primitive>,
mpl::int_<Primitive>, //else
//else typename mpl::eval_if<
typename mpl::eval_if< boost::is_class<T>,
boost::is_class<T>, mpl::int_<Serializable>,
mpl::int_<Serializable>, //else
//else typename mpl::eval_if<
typename mpl::eval_if< boost::is_array<T>,
boost::is_array<T>, mpl::int_<Primitive>,
mpl::int_<Primitive>, //else
//else typename mpl::eval_if<
typename mpl::eval_if< boost::is_pointer<T>,
boost::is_pointer<T>, mpl::int_<Pointer>,
mpl::int_<Pointer>, //else
//else typename mpl::eval_if<
typename mpl::eval_if< boost::is_enum<T>,
boost::is_enum<T>, mpl::int_<Primitive>,
mpl::int_<Primitive>, //else
//else mpl::int_<Wrong>
mpl::int_<Wrong> >
> >
> >
> >
> >::type type;
>::type type; static const int value = SerializationLevel::type::value;
static const int value = SerializationLevel::type::value; };
};
template <typename Serializer> class DLL_EXPORT COSer
template <typename Serializer> class DLL_EXPORT COSer {
{ public:
public: bool saving;
bool saving; COSer(){saving=true;};
COSer(){saving=true;}; Serializer * This()
Serializer * This() {
{ return static_cast<Serializer*>(this);
return static_cast<Serializer*>(this); }
}
template<class T>
template<class T> Serializer & operator<<(const T &t)
Serializer & operator<<(const T &t) {
{ this->This()->save(t);
this->This()->save(t); return * this->This();
return * this->This(); }
}
template<class T>
template<class T> COSer & operator&(T & t)
COSer & operator&(T & t) {
{ return * this->This() << t;
return * this->This() << t; }
}
int write(const void * data, unsigned size);
int write(const void * data, unsigned size); template <typename T>
template <typename T> void savePrimitive(const T &data)
void savePrimitive(const T &data) {
{ this->This()->write(&data,sizeof(data));
this->This()->write(&data,sizeof(data)); }
} template <typename T>
template <typename T> void savePointer(const T &data)
void savePointer(const T &data) {
{ *this << *data;
*this << *data; }
} template <typename T>
template <typename T> void save(const T &data)
void save(const T &data) {
{ typedef
typedef //if
//if typename mpl::eval_if< mpl::equal_to<SerializationLevel<T>,mpl::int_<Primitive> >,
typename mpl::eval_if< mpl::equal_to<SerializationLevel<T>,mpl::int_<Primitive> >, mpl::identity<SavePrimitive<Serializer,T> >,
mpl::identity<SavePrimitive<Serializer,T> >, //else if
//else if typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Pointer> >,
typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Pointer> >, mpl::identity<SavePointer<Serializer,T> >,
mpl::identity<SavePointer<Serializer,T> >, //else if
//else if typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Serializable> >,
typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Serializable> >, mpl::identity<SaveSerializable<Serializer,T> >,
mpl::identity<SaveSerializable<Serializer,T> >, //else
//else mpl::identity<SaveWrong<Serializer,T> >
mpl::identity<SaveWrong<Serializer,T> > >
> >
> >::type typex;
>::type typex; typex::invoke(* this->This(), data);
typex::invoke(* this->This(), data); }
} template <typename T>
template <typename T> void saveSerializable(const T &data)
void saveSerializable(const T &data) {
{ const_cast<T&>(data).serialize(*this,version);
const_cast<T&>(data).serialize(*this,version); }
} template <typename T>
template <typename T> void saveSerializable(const std::vector<T> &data)
void saveSerializable(const std::vector<T> &data) {
{ boost::uint32_t length = data.size();
boost::uint32_t length = data.size(); *this << length;
*this << length; for(ui32 i=0;i<length;i++)
for(ui32 i=0;i<length;i++) *this << data[i];
*this << data[i]; }
} template <typename T>
template <typename T> void saveSerializable(const std::set<T> &data)
void saveSerializable(const std::set<T> &data) {
{ std::set<T> &d = const_cast<std::set<T> &>(data);
std::set<T> &d = const_cast<std::set<T> &>(data); boost::uint32_t length = d.size();
boost::uint32_t length = d.size(); *this << length;
*this << length; for(typename std::set<T>::iterator i=d.begin();i!=d.end();i++)
for(typename std::set<T>::iterator i=d.begin();i!=d.end();i++) *this << *i;
*this << *i; }
} void saveSerializable(const std::string &data)
void saveSerializable(const std::string &data) {
{ if(!data.length())
if(!data.length()) {
{ *this << ui8(0);
*this << ui8(0); }
} else
else {
{ *this << ui32(data.length());
*this << ui32(data.length()); this->This()->write(data.c_str(),data.size());
this->This()->write(data.c_str(),data.size()); }
} }
} template <typename T1, typename T2>
template <typename T1, typename T2> void saveSerializable(const std::pair<T1,T2> &data)
void saveSerializable(const std::pair<T1,T2> &data) {
{ *this << data.first << data.second;
*this << data.first << data.second; }
} template <typename T1, typename T2>
template <typename T1, typename T2> void saveSerializable(const std::map<T1,T2> &data)
void saveSerializable(const std::map<T1,T2> &data) {
{ *this << ui32(data.size());
*this << ui32(data.size()); for(typename std::map<T1,T2>::const_iterator i=data.begin();i!=data.end();i++)
for(typename std::map<T1,T2>::const_iterator i=data.begin();i!=data.end();i++) *this << i->first << i->second;
*this << i->first << i->second; }
} };
}; template <typename Serializer> class DLL_EXPORT CISer
template <typename Serializer> class DLL_EXPORT CISer {
{ public:
public: bool saving;
bool saving; CISer(){saving = false;};
CISer(){saving = false;}; Serializer * This()
Serializer * This() {
{ return static_cast<Serializer*>(this);
return static_cast<Serializer*>(this); }
}
template<class T>
template<class T> Serializer & operator>>(T &t)
Serializer & operator>>(T &t) {
{ this->This()->load(t);
this->This()->load(t); return * this->This();
return * this->This(); }
}
template<class T>
template<class T> CISer & operator&(T & t)
CISer & operator&(T & t) {
{ return * this->This() >> t;
return * this->This() >> t; }
}
int write(const void * data, unsigned size);
int write(const void * data, unsigned size); template <typename T>
template <typename T> void load(T &data)
void load(T &data) {
{ typedef
typedef //if
//if typename mpl::eval_if< mpl::equal_to<SerializationLevel<T>,mpl::int_<Primitive> >,
typename mpl::eval_if< mpl::equal_to<SerializationLevel<T>,mpl::int_<Primitive> >, mpl::identity<LoadPrimitive<Serializer,T> >,
mpl::identity<LoadPrimitive<Serializer,T> >, //else if
//else if typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Pointer> >,
typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Pointer> >, mpl::identity<LoadPointer<Serializer,T> >,
mpl::identity<LoadPointer<Serializer,T> >, //else if
//else if typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Serializable> >,
typename mpl::eval_if<mpl::equal_to<SerializationLevel<T>,mpl::int_<Serializable> >, mpl::identity<LoadSerializable<Serializer,T> >,
mpl::identity<LoadSerializable<Serializer,T> >, //else
//else mpl::identity<LoadWrong<Serializer,T> >
mpl::identity<LoadWrong<Serializer,T> > >
> >
> >::type typex;
>::type typex; typex::invoke(* this->This(), data);
typex::invoke(* this->This(), data); }
} template <typename T>
template <typename T> void loadPrimitive(T &data)
void loadPrimitive(T &data) {
{ this->This()->read(&data,sizeof(data));
this->This()->read(&data,sizeof(data)); }
} template <typename T>
template <typename T> void loadSerializable(T &data)
void loadSerializable(T &data) {
{ data.serialize(*this,version);
data.serialize(*this,version); }
} template <typename T>
template <typename T> void loadPointer(T &data)
void loadPointer(T &data) {
{ tlog5<<"Allocating memory for pointer!"<<std::endl;
tlog5<<"Allocating memory for pointer!"<<std::endl; typedef typename boost::remove_pointer<T>::type npT;
typedef typename boost::remove_pointer<T>::type npT; data = new npT;
data = new npT; *this >> *data;
*this >> *data; }
} template <typename T>
template <typename T> void loadSerializable(std::vector<T> &data)
void loadSerializable(std::vector<T> &data) {
{ boost::uint32_t length;
boost::uint32_t length; *this >> length;
*this >> length; data.resize(length);
data.resize(length); for(ui32 i=0;i<length;i++)
for(ui32 i=0;i<length;i++) *this >> data[i];
*this >> data[i]; }
} template <typename T>
template <typename T> void loadSerializable(std::set<T> &data)
void loadSerializable(std::set<T> &data) {
{ boost::uint32_t length;
boost::uint32_t length; *this >> length;
*this >> length; T ins;
T ins; for(ui32 i=0;i<length;i++)
for(ui32 i=0;i<length;i++) {
{ *this >> ins;
*this >> ins; data.insert(ins);
data.insert(ins); }
} }
} template <typename T1, typename T2>
template <typename T1, typename T2> void loadSerializable(std::pair<T1,T2> &data)
void loadSerializable(std::pair<T1,T2> &data) {
{ *this >> data.first >> data.second;
*this >> data.first >> data.second; }
}
template <typename T1, typename T2>
template <typename T1, typename T2> void loadSerializable(std::map<T1,T2> &data)
void loadSerializable(std::map<T1,T2> &data) {
{ ui32 length;
ui32 length; *this >> length;
*this >> length; T1 t;
T1 t; for(int i=0;i<length;i++)
for(int i=0;i<length;i++) {
{ *this >> t;
*this >> t; *this >> data[t];
*this >> data[t]; }
} }
} void loadSerializable(std::string &data)
void loadSerializable(std::string &data) {
{ ui8 length[4];
ui8 length[4]; *this >> length[0];
*this >> length[0]; if(!length[0]) return;
if(!length[0]) return; *this >> length[1];
*this >> length[1]; *this >> length[2];
*this >> length[2]; *this >> length[3];
*this >> length[3]; data.resize(*((ui32*)length));
data.resize(*((ui32*)length)); this->This()->read((void*)data.c_str(),*((ui32*)length));
this->This()->read((void*)data.c_str(),*((ui32*)length)); }
}
};
};
class DLL_EXPORT CSaveFile
class DLL_EXPORT CSaveFile : public COSer<CSaveFile>
: public COSer<CSaveFile> {
{ void dummyMagicFunction()
void dummyMagicFunction() {
{ *this << std::string("This function makes stuff working.");
*this << std::string("This function makes stuff working."); }
} public:
public: std::ofstream *sfile;
std::ofstream *sfile; CSaveFile(const std::string &fname);
CSaveFile(const std::string &fname); ~CSaveFile();
~CSaveFile(); int write(const void * data, unsigned size);
int write(const void * data, unsigned size); };
};
class DLL_EXPORT CConnection
class DLL_EXPORT CConnection :public CISer<CConnection>, public COSer<CConnection>
:public CISer<CConnection>, public COSer<CConnection> {
{ std::ostream &out;
std::ostream &out; CConnection(void);
CConnection(void); void init();
void init(); public:
public: boost::mutex *rmx, *wmx; // read/write mutexes
boost::mutex *rmx, *wmx; // read/write mutexes boost::asio::basic_stream_socket < boost::asio::ip::tcp , boost::asio::stream_socket_service<boost::asio::ip::tcp> > * socket;
boost::asio::basic_stream_socket < boost::asio::ip::tcp , boost::asio::stream_socket_service<boost::asio::ip::tcp> > * socket; bool logging;
bool logging; bool connected;
bool connected; bool myEndianess, contactEndianess; //true if little endian, if ednianess is different we'll have to revert recieved multi-byte vars
bool myEndianess, contactEndianess; //true if little endian, if ednianess is different we'll have to revert recieved multi-byte vars boost::asio::io_service *io_service;
boost::asio::io_service *io_service; std::string name; //who uses this connection
std::string name; //who uses this connection
CConnection
CConnection (std::string host, std::string port, std::string Name, std::ostream & Out);
(std::string host, std::string port, std::string Name, std::ostream & Out); CConnection
CConnection (boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > * acceptor,
(boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > * acceptor, boost::asio::io_service *Io_service, std::string Name, std::ostream & Out);
boost::asio::io_service *Io_service, std::string Name, std::ostream & Out); CConnection
CConnection (boost::asio::basic_stream_socket < boost::asio::ip::tcp , boost::asio::stream_socket_service<boost::asio::ip::tcp> > * Socket,
(boost::asio::basic_stream_socket < boost::asio::ip::tcp , boost::asio::stream_socket_service<boost::asio::ip::tcp> > * Socket, std::string Name, std::ostream & Out); //use immediately after accepting connection into socket
std::string Name, std::ostream & Out); //use immediately after accepting connection into socket int write(const void * data, unsigned size);
int write(const void * data, unsigned size); int read(void * data, unsigned size);
int read(void * data, unsigned size); int readLine(void * data, unsigned maxSize);
int readLine(void * data, unsigned maxSize); void close();
void close(); ~CConnection(void);
~CConnection(void); };
}; #endif //CONNECTION_H
#endif //CONNECTION_H

View File

@ -1,52 +1,53 @@
#pragma once #ifndef __IGAMECALLBACK_H__
#define __IGAMECALLBACK_H__
#include "../global.h"
#include <vector> #include "../global.h"
#include <set> #include <vector>
#include "../client/FunctionList.h" #include <set>
#include "../client/FunctionList.h"
class CGObjectInstance;
class CGTownInstance; class CGObjectInstance;
class CGHeroInstance; class CGTownInstance;
struct SelectionDialog; class CGHeroInstance;
struct YesNoDialog; struct SelectionDialog;
struct InfoWindow; struct YesNoDialog;
struct MetaString; struct InfoWindow;
struct ShowInInfobox; struct MetaString;
struct BattleResult; struct ShowInInfobox;
struct BattleResult;
class IGameCallback
{ class IGameCallback
public: {
virtual ~IGameCallback(){}; public:
virtual ~IGameCallback(){};
virtual int getOwner(int heroID)=0;
virtual int getResource(int player, int which)=0; virtual int getOwner(int heroID)=0;
virtual int getSelectedHero()=0; virtual int getResource(int player, int which)=0;
virtual int getDate(int mode=0)=0; virtual int getSelectedHero()=0;
virtual const CGObjectInstance* getObj(int objid)=0; virtual int getDate(int mode=0)=0;
virtual const CGHeroInstance* getHero(int objid)=0; virtual const CGObjectInstance* getObj(int objid)=0;
virtual const CGTownInstance* getTown(int objid)=0; virtual const CGHeroInstance* getHero(int objid)=0;
virtual const CGHeroInstance* getSelectedHero(int player)=0; //NULL if no hero is selected virtual const CGTownInstance* getTown(int objid)=0;
virtual int getCurrentPlayer()=0; virtual const CGHeroInstance* getSelectedHero(int player)=0; //NULL if no hero is selected
virtual int getCurrentPlayer()=0;
//do sth
virtual void changeSpells(int hid, bool give, const std::set<ui32> &spells)=0; //do sth
virtual void removeObject(int objid)=0; virtual void changeSpells(int hid, bool give, const std::set<ui32> &spells)=0;
virtual void setBlockVis(int objid, bool bv)=0; virtual void removeObject(int objid)=0;
virtual void setOwner(int objid, ui8 owner)=0; virtual void setBlockVis(int objid, bool bv)=0;
virtual void setHoverName(int objid, MetaString * name)=0; virtual void setOwner(int objid, ui8 owner)=0;
virtual void changePrimSkill(int ID, int which, int val, bool abs=false)=0; virtual void setHoverName(int objid, MetaString * name)=0;
virtual void showInfoDialog(InfoWindow *iw)=0; virtual void changePrimSkill(int ID, int which, int val, bool abs=false)=0;
virtual void showYesNoDialog(YesNoDialog *iw, const CFunctionList<void(ui32)> &callback)=0; virtual void showInfoDialog(InfoWindow *iw)=0;
virtual void showSelectionDialog(SelectionDialog *iw, const CFunctionList<void(ui32)> &callback)=0; //returns question id virtual void showYesNoDialog(YesNoDialog *iw, const CFunctionList<void(ui32)> &callback)=0;
virtual void giveResource(int player, int which, int val)=0; virtual void showSelectionDialog(SelectionDialog *iw, const CFunctionList<void(ui32)> &callback)=0; //returns question id
virtual void showCompInfo(ShowInInfobox * comp)=0; virtual void giveResource(int player, int which, int val)=0;
virtual void heroVisitCastle(int obj, int heroID)=0; virtual void showCompInfo(ShowInInfobox * comp)=0;
virtual void stopHeroVisitCastle(int obj, int heroID)=0; virtual void heroVisitCastle(int obj, int heroID)=0;
virtual void giveHeroArtifact(int artid, int hid, int position)=0; //pos==-1 - first free slot in backpack=0; pos==-2 - default if available or backpack virtual void stopHeroVisitCastle(int obj, int heroID)=0;
virtual void startBattleI(const CCreatureSet * army1, const CCreatureSet * army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, boost::function<void(BattleResult*)> cb)=0; //use hero=NULL for no hero virtual void giveHeroArtifact(int artid, int hid, int position)=0; //pos==-1 - first free slot in backpack=0; pos==-2 - default if available or backpack
virtual void startBattleI(int heroID, CCreatureSet army, int3 tile, boost::function<void(BattleResult*)> cb)=0; //for hero<=>neutral army virtual void startBattleI(const CCreatureSet * army1, const CCreatureSet * army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, boost::function<void(BattleResult*)> cb)=0; //use hero=NULL for no hero
virtual void setAmount(int objid, ui32 val)=0; virtual void startBattleI(int heroID, CCreatureSet army, int3 tile, boost::function<void(BattleResult*)> cb)=0; //for hero<=>neutral army
virtual void moveHero(int hid, int3 pos, bool instant)=0; virtual void setAmount(int objid, ui32 val)=0;
}; virtual void moveHero(int hid, int3 pos, bool instant)=0;
};#endif // __IGAMECALLBACK_H__

92
lib/vcmi_lib/Makefile-nb Normal file
View File

@ -0,0 +1,92 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk

View File

@ -0,0 +1,163 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=
# Macros
PLATFORM=GNU-Linux-x86
# Include project Makefile
include Makefile-nb
# Object Directory
OBJECTDIR=build/Debug/${PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CHeroHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CTownHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../Connection.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../VCMI_Lib.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CSpellHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CCreatureHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameState.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CDefObjInfoHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CConsoleHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CLodHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CObjectHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameInfo.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CGeneralTextHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../map.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CArtHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CBuildingHandler.o
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=
CXXFLAGS=
# Fortran Compiler Flags
FFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=-L../../../../boost/lib
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
${MAKE} -f nbproject/Makefile-Debug.mk dist/Debug/${PLATFORM}/libvcmi_lib.so
dist/Debug/${PLATFORM}/libvcmi_lib.so: ${OBJECTFILES}
${MKDIR} -p dist/Debug/${PLATFORM}
${LINK.cc} -shared -o dist/Debug/${PLATFORM}/libvcmi_lib.so -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CHeroHandler.o: ../../hch/CHeroHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CHeroHandler.o ../../hch/CHeroHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CTownHandler.o: ../../hch/CTownHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CTownHandler.o ../../hch/CTownHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../Connection.o: ../Connection.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/..
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../Connection.o ../Connection.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../VCMI_Lib.o: ../VCMI_Lib.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/..
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../VCMI_Lib.o ../VCMI_Lib.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CSpellHandler.o: ../../hch/CSpellHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CSpellHandler.o ../../hch/CSpellHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CCreatureHandler.o: ../../hch/CCreatureHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CCreatureHandler.o ../../hch/CCreatureHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameState.o: ../../CGameState.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameState.o ../../CGameState.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CDefObjInfoHandler.o: ../../hch/CDefObjInfoHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CDefObjInfoHandler.o ../../hch/CDefObjInfoHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CConsoleHandler.o: ../../CConsoleHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CConsoleHandler.o ../../CConsoleHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CLodHandler.o: ../../hch/CLodHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CLodHandler.o ../../hch/CLodHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CObjectHandler.o: ../../hch/CObjectHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CObjectHandler.o ../../hch/CObjectHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameInfo.o: ../../CGameInfo.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameInfo.o ../../CGameInfo.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CGeneralTextHandler.o: ../../hch/CGeneralTextHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CGeneralTextHandler.o ../../hch/CGeneralTextHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../map.o: ../../map.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../map.o ../../map.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CArtHandler.o: ../../hch/CArtHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CArtHandler.o ../../hch/CArtHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CBuildingHandler.o: ../../hch/CBuildingHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -g -I../../hch -I../.. -I../../../../boost/include/boost-1_37 -I/usr/include/SDL -I../../../../boost/include/boost-1_37/boost -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CBuildingHandler.o ../../hch/CBuildingHandler.cpp
# Subprojects
.build-subprojects:
# Clean Targets
.clean-conf:
${RM} -r build/Debug
${RM} dist/Debug/${PLATFORM}/libvcmi_lib.so
# Subprojects
.clean-subprojects:
# Enable dependency checking
.dep.inc: .depcheck-impl
include .dep.inc

View File

@ -0,0 +1,163 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=
# Macros
PLATFORM=GNU-Linux-x86
# Include project Makefile
include Makefile-nb
# Object Directory
OBJECTDIR=build/Release/${PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CHeroHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CTownHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../Connection.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../VCMI_Lib.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CSpellHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CCreatureHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameState.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CDefObjInfoHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CConsoleHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CLodHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CObjectHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameInfo.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CGeneralTextHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../map.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CArtHandler.o \
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CBuildingHandler.o
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=
CXXFLAGS=
# Fortran Compiler Flags
FFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
${MAKE} -f nbproject/Makefile-Release.mk dist/Release/${PLATFORM}/libvcmi_lib.so
dist/Release/${PLATFORM}/libvcmi_lib.so: ${OBJECTFILES}
${MKDIR} -p dist/Release/${PLATFORM}
${LINK.cc} -shared -o dist/Release/${PLATFORM}/libvcmi_lib.so -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CHeroHandler.o: ../../hch/CHeroHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CHeroHandler.o ../../hch/CHeroHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CTownHandler.o: ../../hch/CTownHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CTownHandler.o ../../hch/CTownHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../Connection.o: ../Connection.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/..
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../Connection.o ../Connection.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../VCMI_Lib.o: ../VCMI_Lib.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/..
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../VCMI_Lib.o ../VCMI_Lib.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CSpellHandler.o: ../../hch/CSpellHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CSpellHandler.o ../../hch/CSpellHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CCreatureHandler.o: ../../hch/CCreatureHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CCreatureHandler.o ../../hch/CCreatureHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameState.o: ../../CGameState.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameState.o ../../CGameState.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CDefObjInfoHandler.o: ../../hch/CDefObjInfoHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CDefObjInfoHandler.o ../../hch/CDefObjInfoHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CConsoleHandler.o: ../../CConsoleHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CConsoleHandler.o ../../CConsoleHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CLodHandler.o: ../../hch/CLodHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CLodHandler.o ../../hch/CLodHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CObjectHandler.o: ../../hch/CObjectHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CObjectHandler.o ../../hch/CObjectHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameInfo.o: ../../CGameInfo.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../CGameInfo.o ../../CGameInfo.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CGeneralTextHandler.o: ../../hch/CGeneralTextHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CGeneralTextHandler.o ../../hch/CGeneralTextHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../map.o: ../../map.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../..
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../map.o ../../map.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CArtHandler.o: ../../hch/CArtHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CArtHandler.o ../../hch/CArtHandler.cpp
${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CBuildingHandler.o: ../../hch/CBuildingHandler.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch
${RM} $@.d
$(COMPILE.cc) -O2 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/home/t0/vcmi/trunk/lib/vcmi_lib/../../hch/CBuildingHandler.o ../../hch/CBuildingHandler.cpp
# Subprojects
.build-subprojects:
# Clean Targets
.clean-conf:
${RM} -r build/Release
${RM} dist/Release/${PLATFORM}/libvcmi_lib.so
# Subprojects
.clean-subprojects:
# Enable dependency checking
.dep.inc: .depcheck-impl
include .dep.inc

View File

@ -0,0 +1,123 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=vcmi_lib
# Active Configuration
DEFAULTCONF=Debug
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=Debug Release
# build
.build-impl: .build-pre .validate-impl .depcheck-impl
@#echo "=> Running $@... Configuration=$(CONF)"
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre .validate-impl .depcheck-impl
@#echo "=> Running $@... Configuration=$(CONF)"
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
@#echo "=> Running $@..."
for CONF in ${ALLCONFS}; \
do \
${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
done
# all
.all-impl: .all-pre .depcheck-impl
@#echo "=> Running $@..."
for CONF in ${ALLCONFS}; \
do \
${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
done
# dependency checking support
.depcheck-impl:
@echo "# This code depends on make tool being used" >.dep.inc
@if [ -n "${MAKE_VERSION}" ]; then \
echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
echo "include \$${DEPFILES}" >>.dep.inc; \
echo "endif" >>.dep.inc; \
else \
echo ".KEEP_STATE:" >>.dep.inc; \
echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
fi
# configuration validation
.validate-impl:
@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
echo ""; \
echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
echo "See 'make help' for details."; \
echo "Current directory: " `pwd`; \
echo ""; \
fi
@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
exit 1; \
fi
# help
.help-impl: .help-pre
@echo "This makefile supports the following configurations:"
@echo " ${ALLCONFS}"
@echo ""
@echo "and the following targets:"
@echo " build (default target)"
@echo " clean"
@echo " clobber"
@echo " all"
@echo " help"
@echo ""
@echo "Makefile Usage:"
@echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
@echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
@echo " make [SUB=no] clobber"
@echo " make [SUB=no] all"
@echo " make help"
@echo ""
@echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
@echo " also clean subprojects."
@echo "Target 'clobber' will remove all built files from all configurations and,"
@echo " unless 'SUB=no', also from subprojects."
@echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'help' prints this message."
@echo ""

View File

@ -0,0 +1,72 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
PLATFORM=GNU-Linux-x86
TMPDIR=build/Debug/${PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=dist/Debug/${PLATFORM}/libvcmi_lib.so
OUTPUT_BASENAME=libvcmi_lib.so
PACKAGE_TOP_DIR=libvcmilib.so/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p dist/Debug/${PLATFORM}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/libvcmilib.so/lib
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
# Generate tar file
cd "${TOP}"
rm -f dist/Debug/${PLATFORM}/package/libvcmilib.so.tar
cd ${TMPDIR}
tar -vcf ../../../../dist/Debug/${PLATFORM}/package/libvcmilib.so.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}

View File

@ -0,0 +1,72 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
PLATFORM=GNU-Linux-x86
TMPDIR=build/Release/${PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=dist/Release/${PLATFORM}/libvcmi_lib.so
OUTPUT_BASENAME=libvcmi_lib.so
PACKAGE_TOP_DIR=libvcmilib.so/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p dist/Release/${PLATFORM}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/libvcmilib.so/lib
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
# Generate tar file
cd "${TOP}"
rm -f dist/Release/${PLATFORM}/package/libvcmilib.so.tar
cd ${TMPDIR}
tar -vcf ../../../../dist/Release/${PLATFORM}/package/libvcmilib.so.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}

780
map.h
View File

@ -1,390 +1,390 @@
#ifndef MAPD_H #ifndef __MAP_H__
#define MAPD_H #define __MAP_H__
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning (disable : 4482) #pragma warning (disable : 4482)
#endif #endif
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#include <map> #include <map>
#include <set> #include <set>
#include "global.h" #include "global.h"
class CGDefInfo; class CGDefInfo;
class CGObjectInstance; class CGObjectInstance;
class CGHeroInstance; class CGHeroInstance;
class CGTownInstance; class CGTownInstance;
enum ESortBy{_name, _playerAm, _size, _format, _viccon, _loscon}; enum ESortBy{_name, _playerAm, _size, _format, _viccon, _loscon};
enum EDefType {TOWN_DEF, HERO_DEF, CREATURES_DEF, SEERHUT_DEF, RESOURCE_DEF, TERRAINOBJ_DEF, enum EDefType {TOWN_DEF, HERO_DEF, CREATURES_DEF, SEERHUT_DEF, RESOURCE_DEF, TERRAINOBJ_DEF,
EVENTOBJ_DEF, SIGN_DEF, GARRISON_DEF, ARTIFACT_DEF, WITCHHUT_DEF, SCHOLAR_DEF, PLAYERONLY_DEF, EVENTOBJ_DEF, SIGN_DEF, GARRISON_DEF, ARTIFACT_DEF, WITCHHUT_DEF, SCHOLAR_DEF, PLAYERONLY_DEF,
SHRINE_DEF, SPELLSCROLL_DEF, PANDORA_DEF, GRAIL_DEF, CREGEN_DEF, CREGEN2_DEF, CREGEN3_DEF, SHRINE_DEF, SPELLSCROLL_DEF, PANDORA_DEF, GRAIL_DEF, CREGEN_DEF, CREGEN2_DEF, CREGEN3_DEF,
BORDERGUARD_DEF, HEROPLACEHOLDER_DEF}; BORDERGUARD_DEF, HEROPLACEHOLDER_DEF};
class DLL_EXPORT CSpecObjInfo class DLL_EXPORT CSpecObjInfo
{ {
public: public:
virtual ~CSpecObjInfo(){}; virtual ~CSpecObjInfo(){};
}; };
class DLL_EXPORT CCreGenObjInfo : public CSpecObjInfo class DLL_EXPORT CCreGenObjInfo : public CSpecObjInfo
{ {
public: public:
unsigned char player; //owner unsigned char player; //owner
bool asCastle; bool asCastle;
int identifier; int identifier;
unsigned char castles[2]; //allowed castles unsigned char castles[2]; //allowed castles
}; };
class DLL_EXPORT CCreGen2ObjInfo : public CSpecObjInfo class DLL_EXPORT CCreGen2ObjInfo : public CSpecObjInfo
{ {
public: public:
unsigned char player; //owner unsigned char player; //owner
bool asCastle; bool asCastle;
int identifier; int identifier;
unsigned char castles[2]; //allowed castles unsigned char castles[2]; //allowed castles
unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6> unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6>
}; };
class DLL_EXPORT CCreGen3ObjInfo : public CSpecObjInfo class DLL_EXPORT CCreGen3ObjInfo : public CSpecObjInfo
{ {
public: public:
unsigned char player; //owner unsigned char player; //owner
unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6> unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6>
}; };
struct DLL_EXPORT Sresource struct DLL_EXPORT Sresource
{ {
std::string resName; //name of this resource std::string resName; //name of this resource
int amount; //it can be greater and lesser than 0 int amount; //it can be greater and lesser than 0
}; };
struct DLL_EXPORT TimeEvent struct DLL_EXPORT TimeEvent
{ {
std::string eventName; std::string eventName;
std::string message; std::string message;
std::vector<Sresource> decIncRes; //decreases / increases of resources std::vector<Sresource> decIncRes; //decreases / increases of resources
unsigned int whichPlayers; //which players are affected by this event (+1 - first, +2 - second, +4 - third, +8 - fourth etc.) unsigned int whichPlayers; //which players are affected by this event (+1 - first, +2 - second, +4 - third, +8 - fourth etc.)
bool areHumansAffected; bool areHumansAffected;
bool areCompsAffected; bool areCompsAffected;
int firstAfterNDays; //how many days after appears this event int firstAfterNDays; //how many days after appears this event
int nextAfterNDays; //how many days after the epperance before appaers this event int nextAfterNDays; //how many days after the epperance before appaers this event
}; };
struct DLL_EXPORT TerrainTile struct DLL_EXPORT TerrainTile
{ {
EterrainType tertype; // type of terrain EterrainType tertype; // type of terrain
unsigned char terview; // look of terrain unsigned char terview; // look of terrain
Eriver nuine; // type of Eriver (0 if there is no Eriver) Eriver nuine; // type of Eriver (0 if there is no Eriver)
unsigned char rivDir; // direction of Eriver unsigned char rivDir; // direction of Eriver
Eroad malle; // type of Eroad (0 if there is no Eriver) Eroad malle; // type of Eroad (0 if there is no Eriver)
unsigned char roadDir; // direction of Eroad unsigned char roadDir; // direction of Eroad
unsigned char siodmyTajemniczyBajt; //bitfield, info whether this tile is coastal and how to rotate tile graphics unsigned char siodmyTajemniczyBajt; //bitfield, info whether this tile is coastal and how to rotate tile graphics
bool visitable; //false = not visitable; true = visitable bool visitable; //false = not visitable; true = visitable
bool blocked; //false = free; true = blocked; bool blocked; //false = free; true = blocked;
std::vector <CGObjectInstance*> visitableObjects; //pointers to objects hero can visit while being on this tile std::vector <CGObjectInstance*> visitableObjects; //pointers to objects hero can visit while being on this tile
std::vector <CGObjectInstance*> blockingObjects; //pointers to objects that are blocking this tile std::vector <CGObjectInstance*> blockingObjects; //pointers to objects that are blocking this tile
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & tertype & terview & nuine & rivDir & malle &roadDir & siodmyTajemniczyBajt; h & tertype & terview & nuine & rivDir & malle &roadDir & siodmyTajemniczyBajt;
} }
}; };
struct DLL_EXPORT SheroName //name of starting hero struct DLL_EXPORT SheroName //name of starting hero
{ {
int heroID; int heroID;
std::string heroName; std::string heroName;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & heroID & heroName; h & heroID & heroName;
} }
}; };
struct DLL_EXPORT PlayerInfo struct DLL_EXPORT PlayerInfo
{ {
si32 p7, p8, p9; si32 p7, p8, p9;
ui8 canHumanPlay; ui8 canHumanPlay;
ui8 canComputerPlay; ui8 canComputerPlay;
ui32 AITactic; //(00 - random, 01 - warrior, 02 - builder, 03 - explorer) ui32 AITactic; //(00 - random, 01 - warrior, 02 - builder, 03 - explorer)
ui32 allowedFactions; //(01 - castle; 02 - rampart; 04 - tower; 08 - inferno; 16 - necropolis; 32 - dungeon; 64 - stronghold; 128 - fortress; 256 - conflux); ui32 allowedFactions; //(01 - castle; 02 - rampart; 04 - tower; 08 - inferno; 16 - necropolis; 32 - dungeon; 64 - stronghold; 128 - fortress; 256 - conflux);
ui8 isFactionRandom; ui8 isFactionRandom;
ui32 mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard ui32 mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard
std::string mainHeroName; std::string mainHeroName;
std::vector<SheroName> heroesNames; std::vector<SheroName> heroesNames;
ui8 hasMainTown; ui8 hasMainTown;
ui8 generateHeroAtMainTown; ui8 generateHeroAtMainTown;
int3 posOfMainTown; int3 posOfMainTown;
ui8 team; ui8 team;
ui8 generateHero; ui8 generateHero;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & p7 & p8 & p9 & canHumanPlay & canComputerPlay & AITactic & allowedFactions & isFactionRandom & h & p7 & p8 & p9 & canHumanPlay & canComputerPlay & AITactic & allowedFactions & isFactionRandom &
mainHeroPortrait & mainHeroName & heroesNames & hasMainTown & generateHeroAtMainTown & mainHeroPortrait & mainHeroName & heroesNames & hasMainTown & generateHeroAtMainTown &
posOfMainTown & team & generateHero; posOfMainTown & team & generateHero;
} }
}; };
struct DLL_EXPORT LossCondition struct DLL_EXPORT LossCondition
{ {
ElossCon typeOfLossCon; ElossCon typeOfLossCon;
int3 castlePos; int3 castlePos;
int3 heroPos; int3 heroPos;
int timeLimit; // in days int timeLimit; // in days
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & typeOfLossCon & castlePos & heroPos & timeLimit; h & typeOfLossCon & castlePos & heroPos & timeLimit;
} }
}; };
struct DLL_EXPORT CspecificVictoryConidtions struct DLL_EXPORT CspecificVictoryConidtions
{ {
bool allowNormalVictory; bool allowNormalVictory;
bool appliesToAI; bool appliesToAI;
}; };
struct DLL_EXPORT VicCon0 : public CspecificVictoryConidtions //acquire artifact struct DLL_EXPORT VicCon0 : public CspecificVictoryConidtions //acquire artifact
{ {
int ArtifactID; int ArtifactID;
}; };
struct DLL_EXPORT VicCon1 : public CspecificVictoryConidtions //accumulate creatures struct DLL_EXPORT VicCon1 : public CspecificVictoryConidtions //accumulate creatures
{ {
int monsterID; int monsterID;
int neededQuantity; int neededQuantity;
}; };
struct DLL_EXPORT VicCon2 : public CspecificVictoryConidtions // accumulate resources struct DLL_EXPORT VicCon2 : public CspecificVictoryConidtions // accumulate resources
{ {
int resourceID; int resourceID;
int neededQuantity; int neededQuantity;
}; };
struct DLL_EXPORT VicCon3 : public CspecificVictoryConidtions // upgrade specific town struct DLL_EXPORT VicCon3 : public CspecificVictoryConidtions // upgrade specific town
{ {
int3 posOfCity; int3 posOfCity;
int councilNeededLevel; //0 - town; 1 - city; 2 - capitol int councilNeededLevel; //0 - town; 1 - city; 2 - capitol
int fortNeededLevel;// 0 - fort; 1 - citadel; 2 - castle int fortNeededLevel;// 0 - fort; 1 - citadel; 2 - castle
}; };
struct DLL_EXPORT VicCon4 : public CspecificVictoryConidtions // build grail structure struct DLL_EXPORT VicCon4 : public CspecificVictoryConidtions // build grail structure
{ {
bool anyLocation; bool anyLocation;
int3 whereBuildGrail; int3 whereBuildGrail;
}; };
struct DLL_EXPORT VicCon5 : public CspecificVictoryConidtions // defeat a specific hero struct DLL_EXPORT VicCon5 : public CspecificVictoryConidtions // defeat a specific hero
{ {
int3 locationOfHero; int3 locationOfHero;
}; };
struct DLL_EXPORT VicCon6 : public CspecificVictoryConidtions // capture a specific town struct DLL_EXPORT VicCon6 : public CspecificVictoryConidtions // capture a specific town
{ {
int3 locationOfTown; int3 locationOfTown;
}; };
struct DLL_EXPORT VicCon7 : public CspecificVictoryConidtions // defeat a specific monster struct DLL_EXPORT VicCon7 : public CspecificVictoryConidtions // defeat a specific monster
{ {
int3 locationOfMonster; int3 locationOfMonster;
}; };
struct DLL_EXPORT VicCona : public CspecificVictoryConidtions //transport specific artifact struct DLL_EXPORT VicCona : public CspecificVictoryConidtions //transport specific artifact
{ {
int artifactID; int artifactID;
int3 destinationPlace; int3 destinationPlace;
}; };
struct DLL_EXPORT Rumor struct DLL_EXPORT Rumor
{ {
std::string name, text; std::string name, text;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & name & text; h & name & text;
} }
}; };
struct DLL_EXPORT DisposedHero struct DLL_EXPORT DisposedHero
{ {
ui32 ID; ui32 ID;
ui16 portrait; //0xFF - default ui16 portrait; //0xFF - default
std::string name; std::string name;
ui8 players; //who can hire this hero (bitfield) ui8 players; //who can hire this hero (bitfield)
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & ID & portrait & name & players; h & ID & portrait & name & players;
} }
}; };
class DLL_EXPORT CMapEvent class DLL_EXPORT CMapEvent
{ {
public: public:
std::string name, message; std::string name, message;
si32 wood, mercury, ore, sulfur, crystal, gems, gold; //gained / taken resources si32 wood, mercury, ore, sulfur, crystal, gems, gold; //gained / taken resources
ui8 players; //affected players ui8 players; //affected players
ui8 humanAffected; ui8 humanAffected;
ui8 computerAffected; ui8 computerAffected;
ui32 firstOccurence; ui32 firstOccurence;
ui32 nextOccurence; //after nextOccurance day event will occure; if it it 0, event occures only one time; ui32 nextOccurence; //after nextOccurance day event will occure; if it it 0, event occures only one time;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & name & message & wood & mercury & ore & sulfur & crystal & gems & gold h & name & message & wood & mercury & ore & sulfur & crystal & gems & gold
& players & humanAffected & computerAffected & firstOccurence & nextOccurence; & players & humanAffected & computerAffected & firstOccurence & nextOccurence;
} }
}; };
class DLL_EXPORT CMapHeader class DLL_EXPORT CMapHeader
{ {
public: public:
Eformat version; // version of map Eformat Eformat version; // version of map Eformat
bool areAnyPLayers; // if there are any playable players on map bool areAnyPLayers; // if there are any playable players on map
int height, width; int height, width;
bool twoLevel; // if map has underground level bool twoLevel; // if map has underground level
std::string name; //name of map std::string name; //name of map
std::string description; //and description std::string description; //and description
int difficulty; // 0 easy - 4 impossible int difficulty; // 0 easy - 4 impossible
int levelLimit; int levelLimit;
LossCondition lossCondition; LossCondition lossCondition;
EvictoryConditions victoryCondition; //victory conditions EvictoryConditions victoryCondition; //victory conditions
CspecificVictoryConidtions * vicConDetails; // used only if vistory conditions aren't standard CspecificVictoryConidtions * vicConDetails; // used only if vistory conditions aren't standard
PlayerInfo players[8]; // info about players PlayerInfo players[8]; // info about players
std::vector<int> teams; // teams[i] = team of player no i std::vector<int> teams; // teams[i] = team of player no i
int howManyTeams; int howManyTeams;
CMapHeader(unsigned char *map); //an argument is a reference to string described a map (unpacked) CMapHeader(unsigned char *map); //an argument is a reference to string described a map (unpacked)
}; };
class DLL_EXPORT CMapInfo : public CMapHeader class DLL_EXPORT CMapInfo : public CMapHeader
{ {
public: public:
std::string filename; std::string filename;
int playerAmnt, humenPlayers; int playerAmnt, humenPlayers;
CMapInfo(std::string fname, unsigned char *map):CMapHeader(map),filename(fname) CMapInfo(std::string fname, unsigned char *map):CMapHeader(map),filename(fname)
{ {
playerAmnt=humenPlayers=0; playerAmnt=humenPlayers=0;
for (int i=0;i<PLAYER_LIMIT;i++) for (int i=0;i<PLAYER_LIMIT;i++)
{ {
if (players[i].canHumanPlay) {playerAmnt++;humenPlayers++;} if (players[i].canHumanPlay) {playerAmnt++;humenPlayers++;}
else if (players[i].canComputerPlay) {playerAmnt++;} else if (players[i].canComputerPlay) {playerAmnt++;}
} }
}; };
}; };
class DLL_EXPORT mapSorter class DLL_EXPORT mapSorter
{ {
public: public:
ESortBy sortBy; ESortBy sortBy;
bool operator()(const CMapHeader & a, const CMapHeader& b) bool operator()(const CMapHeader & a, const CMapHeader& b)
{ {
switch (sortBy) switch (sortBy)
{ {
case _format: case _format:
return (a.version<b.version); return (a.version<b.version);
break; break;
case _loscon: case _loscon:
return (a.lossCondition.typeOfLossCon<b.lossCondition.typeOfLossCon); return (a.lossCondition.typeOfLossCon<b.lossCondition.typeOfLossCon);
break; break;
case _playerAm: case _playerAm:
int playerAmntB,humenPlayersB,playerAmntA,humenPlayersA; int playerAmntB,humenPlayersB,playerAmntA,humenPlayersA;
playerAmntB=humenPlayersB=playerAmntA=humenPlayersA=0; playerAmntB=humenPlayersB=playerAmntA=humenPlayersA=0;
for (int i=0;i<8;i++) for (int i=0;i<8;i++)
{ {
if (a.players[i].canHumanPlay) {playerAmntA++;humenPlayersA++;} if (a.players[i].canHumanPlay) {playerAmntA++;humenPlayersA++;}
else if (a.players[i].canComputerPlay) {playerAmntA++;} else if (a.players[i].canComputerPlay) {playerAmntA++;}
if (b.players[i].canHumanPlay) {playerAmntB++;humenPlayersB++;} if (b.players[i].canHumanPlay) {playerAmntB++;humenPlayersB++;}
else if (b.players[i].canComputerPlay) {playerAmntB++;} else if (b.players[i].canComputerPlay) {playerAmntB++;}
} }
if (playerAmntB!=playerAmntA) if (playerAmntB!=playerAmntA)
return (playerAmntA<playerAmntB); return (playerAmntA<playerAmntB);
else else
return (humenPlayersA<humenPlayersB); return (humenPlayersA<humenPlayersB);
break; break;
case _size: case _size:
return (a.width<b.width); return (a.width<b.width);
break; break;
case _viccon: case _viccon:
return (a.victoryCondition<b.victoryCondition); return (a.victoryCondition<b.victoryCondition);
break; break;
case _name: case _name:
return (a.name<b.name); return (a.name<b.name);
break; break;
default: default:
return (a.name<b.name); return (a.name<b.name);
break; break;
} }
}; };
mapSorter(ESortBy es):sortBy(es){}; mapSorter(ESortBy es):sortBy(es){};
}; };
struct DLL_EXPORT Mapa struct DLL_EXPORT Mapa
{ {
Eformat version; // version of map Eformat Eformat version; // version of map Eformat
ui32 checksum; ui32 checksum;
int twoLevel; // if map has underground level int twoLevel; // if map has underground level
int difficulty; // 0 easy - 4 impossible int difficulty; // 0 easy - 4 impossible
int levelLimit; int levelLimit;
bool areAnyPLayers; // if there are any playable players on map bool areAnyPLayers; // if there are any playable players on map
std::string name; //name of map std::string name; //name of map
std::string description; //and description std::string description; //and description
int height, width; int height, width;
TerrainTile*** terrain; TerrainTile*** terrain;
std::vector<Rumor> rumors; std::vector<Rumor> rumors;
std::vector<DisposedHero> disposedHeroes; std::vector<DisposedHero> disposedHeroes;
std::vector<CGHeroInstance*> predefinedHeroes; std::vector<CGHeroInstance*> predefinedHeroes;
std::vector<CGDefInfo *> defy; // list of .def files with definitions from .h3m (may be custom) std::vector<CGDefInfo *> defy; // list of .def files with definitions from .h3m (may be custom)
std::set<CGDefInfo *> defs; // other defInfos - for randomized objects, objects added or modified by scripts std::set<CGDefInfo *> defs; // other defInfos - for randomized objects, objects added or modified by scripts
PlayerInfo players[8]; // info about players PlayerInfo players[8]; // info about players
std::vector<int> teams; // teams[i] = team of player no i std::vector<int> teams; // teams[i] = team of player no i
LossCondition lossCondition; LossCondition lossCondition;
EvictoryConditions victoryCondition; //victory conditions EvictoryConditions victoryCondition; //victory conditions
CspecificVictoryConidtions * vicConDetails; // used only if vistory conditions aren't standard CspecificVictoryConidtions * vicConDetails; // used only if vistory conditions aren't standard
int howManyTeams; int howManyTeams;
std::vector<bool> allowedSpell; //allowedSpell[spell_ID] - if the spell is allowed std::vector<bool> allowedSpell; //allowedSpell[spell_ID] - if the spell is allowed
std::vector<bool> allowedArtifact; //allowedArtifact[artifact_ID] - if the artifact is allowed std::vector<bool> allowedArtifact; //allowedArtifact[artifact_ID] - if the artifact is allowed
std::vector<bool> allowedAbilities; //allowedAbilities[ability_ID] - if the ability is allowed std::vector<bool> allowedAbilities; //allowedAbilities[ability_ID] - if the ability is allowed
std::vector<bool> allowedHeroes; //allowedHeroes[hero_ID] - if the hero is allowed std::vector<bool> allowedHeroes; //allowedHeroes[hero_ID] - if the hero is allowed
std::vector<CMapEvent> events; std::vector<CMapEvent> events;
int3 grailPos; int3 grailPos;
int grailRadious; int grailRadious;
std::vector<CGObjectInstance*> objects; std::vector<CGObjectInstance*> objects;
std::vector<CGHeroInstance*> heroes; std::vector<CGHeroInstance*> heroes;
std::vector<CGTownInstance*> towns; std::vector<CGTownInstance*> towns;
void initFromBytes(unsigned char * bufor); //creates map from decompressed .h3m data void initFromBytes(unsigned char * bufor); //creates map from decompressed .h3m data
void readEvents( unsigned char * bufor, int &i); void readEvents( unsigned char * bufor, int &i);
void readObjects( unsigned char * bufor, int &i); void readObjects( unsigned char * bufor, int &i);
void readDefInfo( unsigned char * bufor, int &i); void readDefInfo( unsigned char * bufor, int &i);
void readTerrain( unsigned char * bufor, int &i); void readTerrain( unsigned char * bufor, int &i);
void readPredefinedHeroes( unsigned char * bufor, int &i); void readPredefinedHeroes( unsigned char * bufor, int &i);
void readHeader( unsigned char * bufor, int &i); void readHeader( unsigned char * bufor, int &i);
void readRumors( unsigned char * bufor, int &i); void readRumors( unsigned char * bufor, int &i);
void loadViCLossConditions( unsigned char * bufor, int &i); void loadViCLossConditions( unsigned char * bufor, int &i);
void loadPlayerInfo( int &pom, unsigned char * bufor, int &i); void loadPlayerInfo( int &pom, unsigned char * bufor, int &i);
void loadHero( CGObjectInstance * &nobj, unsigned char * bufor, int &i); void loadHero( CGObjectInstance * &nobj, unsigned char * bufor, int &i);
void loadTown( CGObjectInstance * &nobj, unsigned char * bufor, int &i); void loadTown( CGObjectInstance * &nobj, unsigned char * bufor, int &i);
int loadSeerHut( unsigned char * bufor, int i, CGObjectInstance *& nobj); int loadSeerHut( unsigned char * bufor, int i, CGObjectInstance *& nobj);
void addBlockVisTiles(CGObjectInstance * obj); void addBlockVisTiles(CGObjectInstance * obj);
void removeBlockVisTiles(CGObjectInstance * obj); void removeBlockVisTiles(CGObjectInstance * obj);
Mapa(std::string filename); //creates map structure from .h3m file Mapa(std::string filename); //creates map structure from .h3m file
CGHeroInstance * getHero(int ID, int mode=0); CGHeroInstance * getHero(int ID, int mode=0);
bool isInTheMap(int3 pos); bool isInTheMap(int3 pos);
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & version & name & description & width & height & twoLevel & difficulty & levelLimit & rumors & defy & defs h & version & name & description & width & height & twoLevel & difficulty & levelLimit & rumors & defy & defs
& players & teams & lossCondition & victoryCondition & howManyTeams & allowedSpell & allowedAbilities & players & teams & lossCondition & victoryCondition & howManyTeams & allowedSpell & allowedAbilities
& allowedArtifact &allowedHeroes & events; & allowedArtifact &allowedHeroes & events;
//TODO: viccondetails //TODO: viccondetails
if(h.saving) if(h.saving)
{ {
//saving terrain //saving terrain
for (int i = 0; i < width ; i++) for (int i = 0; i < width ; i++)
for (int j = 0; j < height ; j++) for (int j = 0; j < height ; j++)
for (int k = 0; k <= twoLevel ; k++) for (int k = 0; k <= twoLevel ; k++)
h & terrain[i][j][k]; h & terrain[i][j][k];
} }
else else
{ {
//loading terrain //loading terrain
terrain = new TerrainTile**[width]; // allocate memory terrain = new TerrainTile**[width]; // allocate memory
for (int ii=0;ii<width;ii++) for (int ii=0;ii<width;ii++)
{ {
terrain[ii] = new TerrainTile*[height]; // allocate memory terrain[ii] = new TerrainTile*[height]; // allocate memory
for(int jj=0;jj<height;jj++) for(int jj=0;jj<height;jj++)
terrain[ii][jj] = new TerrainTile[twoLevel+1]; terrain[ii][jj] = new TerrainTile[twoLevel+1];
} }
for (int i = 0; i < width ; i++) for (int i = 0; i < width ; i++)
for (int j = 0; j < height ; j++) for (int j = 0; j < height ; j++)
for (int k = 0; k <= twoLevel ; k++) for (int k = 0; k <= twoLevel ; k++)
h & terrain[i][j][k]; h & terrain[i][j][k];
} }
//TODO: recreate blockvis maps //TODO: recreate blockvis maps
} }
}; };
#endif //MAPD_H #endif // __MAP_H__

1824
nodrze.h

File diff suppressed because it is too large Load Diff

View File

@ -1,173 +1,172 @@
#ifndef CGAMEHANDLER_H #ifndef CGAMEHANDLER_H
#define CGAMEHANDLER_H #define CGAMEHANDLER_H
#pragma once #include "../global.h"
#include "../global.h" #include <set>
#include <set> #include "../client/FunctionList.h"
#include "../client/FunctionList.h" #include "../CGameState.h"
#include "../CGameState.h" #include "../lib/Connection.h"
#include "../lib/Connection.h" #include "../lib/IGameCallback.h"
#include "../lib/IGameCallback.h" #include <boost/function.hpp>
#include <boost/function.hpp> #include <boost/thread.hpp>
#include <boost/thread.hpp> class CVCMIServer;
class CVCMIServer; class CGameState;
class CGameState; struct StartInfo;
struct StartInfo; class CCPPObjectScript;
class CCPPObjectScript; class CScriptCallback;
class CScriptCallback; struct BattleResult;
struct BattleResult; struct BattleAttack;
struct BattleAttack; struct BattleStackAttacked;
struct BattleStackAttacked; template <typename T> struct CPack;
template <typename T> struct CPack; template <typename T> struct Query;
template <typename T> struct Query; class CGHeroInstance;
class CGHeroInstance; extern std::map<ui32, CFunctionList<void(ui32)> > callbacks; //question id => callback functions - for selection dialogs
extern std::map<ui32, CFunctionList<void(ui32)> > callbacks; //question id => callback functions - for selection dialogs extern boost::mutex gsm;
extern boost::mutex gsm;
struct PlayerStatus
struct PlayerStatus {
{ bool makingTurn, engagedIntoBattle;
bool makingTurn, engagedIntoBattle; std::set<ui32> queries;
std::set<ui32> queries;
PlayerStatus():makingTurn(false),engagedIntoBattle(false){};
PlayerStatus():makingTurn(false),engagedIntoBattle(false){}; template <typename Handler> void serialize(Handler &h, const int version)
template <typename Handler> void serialize(Handler &h, const int version) {
{ h & makingTurn & engagedIntoBattle & queries;
h & makingTurn & engagedIntoBattle & queries; }
} };
}; class PlayerStatuses
class PlayerStatuses {
{ public:
public: std::map<ui8,PlayerStatus> players;
std::map<ui8,PlayerStatus> players; boost::mutex mx;
boost::mutex mx; boost::condition_variable cv; //notifies when any changes are made
boost::condition_variable cv; //notifies when any changes are made
void addPlayer(ui8 player);
void addPlayer(ui8 player); PlayerStatus operator[](ui8 player);
PlayerStatus operator[](ui8 player); bool hasQueries(ui8 player);
bool hasQueries(ui8 player); bool checkFlag(ui8 player, bool PlayerStatus::*flag);
bool checkFlag(ui8 player, bool PlayerStatus::*flag); void setFlag(ui8 player, bool PlayerStatus::*flag, bool val);
void setFlag(ui8 player, bool PlayerStatus::*flag, bool val); void addQuery(ui8 player, ui32 id);
void addQuery(ui8 player, ui32 id); void removeQuery(ui8 player, ui32 id);
void removeQuery(ui8 player, ui32 id); template <typename Handler> void serialize(Handler &h, const int version)
template <typename Handler> void serialize(Handler &h, const int version) {
{ h & players;
h & players; }
} };
};
class CGameHandler : public IGameCallback
class CGameHandler : public IGameCallback {
{ static ui32 QID;
static ui32 QID; CGameState *gs;
CGameState *gs; //std::set<CCPPObjectScript *> cppscripts; //C++ scripts
//std::set<CCPPObjectScript *> cppscripts; //C++ scripts //std::map<int, std::map<std::string, CObjectScript*> > objscr; //non-C++ scripts
//std::map<int, std::map<std::string, CObjectScript*> > objscr; //non-C++ scripts
CVCMIServer *s;
CVCMIServer *s; std::map<int,CConnection*> connections; //player color -> connection to clinet with interface of that player
std::map<int,CConnection*> connections; //player color -> connection to clinet with interface of that player PlayerStatuses states; //player color -> player state
PlayerStatuses states; //player color -> player state std::set<CConnection*> conns;
std::set<CConnection*> conns;
void changeSecSkill(int ID, ui16 which, int val, bool abs=false);
void changeSecSkill(int ID, ui16 which, int val, bool abs=false); void giveSpells(const CGTownInstance *t, const CGHeroInstance *h);
void giveSpells(const CGTownInstance *t, const CGHeroInstance *h); void moveStack(int stack, int dest);
void moveStack(int stack, int dest); void startBattle(CCreatureSet army1, CCreatureSet army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, boost::function<void(BattleResult*)> cb); //use hero=NULL for no hero
void startBattle(CCreatureSet army1, CCreatureSet army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, boost::function<void(BattleResult*)> cb); //use hero=NULL for no hero void prepareAttack(BattleAttack &bat, CStack *att, CStack *def); //if last parameter is true, attack is by shooting, if false it's a melee attack
void prepareAttack(BattleAttack &bat, CStack *att, CStack *def); //if last parameter is true, attack is by shooting, if false it's a melee attack void prepareAttacked(BattleStackAttacked &bsa, CStack *def);
void prepareAttacked(BattleStackAttacked &bsa, CStack *def); void checkForBattleEnd( std::vector<CStack*> &stacks );
void checkForBattleEnd( std::vector<CStack*> &stacks ); void setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army1, CCreatureSet &army2, CGHeroInstance * hero1, CGHeroInstance * hero2 );
void setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army1, CCreatureSet &army2, CGHeroInstance * hero1, CGHeroInstance * hero2 );
public:
public: CGameHandler(void);
CGameHandler(void); ~CGameHandler(void);
~CGameHandler(void);
//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////// //from IGameCallback
//from IGameCallback //get info
//get info int getOwner(int heroID);
int getOwner(int heroID); int getResource(int player, int which);
int getResource(int player, int which); int getSelectedHero();
int getSelectedHero(); int getDate(int mode=0);
int getDate(int mode=0); const CGObjectInstance* getObj(int objid);
const CGObjectInstance* getObj(int objid); const CGHeroInstance* getHero(int objid);
const CGHeroInstance* getHero(int objid); const CGTownInstance* getTown(int objid);
const CGTownInstance* getTown(int objid); const CGHeroInstance* getSelectedHero(int player); //NULL if no hero is selected
const CGHeroInstance* getSelectedHero(int player); //NULL if no hero is selected int getCurrentPlayer();
int getCurrentPlayer();
//do sth
//do sth void changeSpells(int hid, bool give, const std::set<ui32> &spells);
void changeSpells(int hid, bool give, const std::set<ui32> &spells); void removeObject(int objid);
void removeObject(int objid); void setBlockVis(int objid, bool bv);
void setBlockVis(int objid, bool bv); void setOwner(int objid, ui8 owner);
void setOwner(int objid, ui8 owner); void setHoverName(int objid, MetaString * name);
void setHoverName(int objid, MetaString * name); void changePrimSkill(int ID, int which, int val, bool abs=false);
void changePrimSkill(int ID, int which, int val, bool abs=false); void showInfoDialog(InfoWindow *iw);
void showInfoDialog(InfoWindow *iw); void showYesNoDialog(YesNoDialog *iw, const CFunctionList<void(ui32)> &callback);
void showYesNoDialog(YesNoDialog *iw, const CFunctionList<void(ui32)> &callback); void showSelectionDialog(SelectionDialog *iw, const CFunctionList<void(ui32)> &callback); //returns question id
void showSelectionDialog(SelectionDialog *iw, const CFunctionList<void(ui32)> &callback); //returns question id void giveResource(int player, int which, int val);
void giveResource(int player, int which, int val); void showCompInfo(ShowInInfobox * comp);
void showCompInfo(ShowInInfobox * comp); void heroVisitCastle(int obj, int heroID);
void heroVisitCastle(int obj, int heroID); void stopHeroVisitCastle(int obj, int heroID);
void stopHeroVisitCastle(int obj, int heroID); void giveHeroArtifact(int artid, int hid, int position); //pos==-1 - first free slot in backpack; pos==-2 - default if available or backpack
void giveHeroArtifact(int artid, int hid, int position); //pos==-1 - first free slot in backpack; pos==-2 - default if available or backpack void startBattleI(const CCreatureSet * army1, const CCreatureSet * army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, boost::function<void(BattleResult*)> cb); //use hero=NULL for no hero
void startBattleI(const CCreatureSet * army1, const CCreatureSet * army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, boost::function<void(BattleResult*)> cb); //use hero=NULL for no hero void startBattleI(int heroID, CCreatureSet army, int3 tile, boost::function<void(BattleResult*)> cb); //for hero<=>neutral army
void startBattleI(int heroID, CCreatureSet army, int3 tile, boost::function<void(BattleResult*)> cb); //for hero<=>neutral army void setAmount(int objid, ui32 val);
void setAmount(int objid, ui32 val); void moveHero(int hid, int3 pos, bool instant);
void moveHero(int hid, int3 pos, bool instant); //////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void init(StartInfo *si, int Seed);
void init(StartInfo *si, int Seed); void handleConnection(std::set<int> players, CConnection &c);
void handleConnection(std::set<int> players, CConnection &c); template <typename Handler> void serialize(Handler &h, const int version)
template <typename Handler> void serialize(Handler &h, const int version) {
{ h & QID & gs & states;
h & QID & gs & states; }
} template <typename T> void applyAndAsk(Query<T> * sel, ui8 player, boost::function<void(ui32)> &callback)
template <typename T> void applyAndAsk(Query<T> * sel, ui8 player, boost::function<void(ui32)> &callback) {
{ gsm.lock();
gsm.lock(); sel->id = QID;
sel->id = QID; callbacks[QID] = callback;
callbacks[QID] = callback; states.addQuery(player,QID);
states.addQuery(player,QID); QID++;
QID++; sendAndApply(sel);
sendAndApply(sel); gsm.unlock();
gsm.unlock(); }
} template <typename T> void ask(Query<T> * sel, ui8 player, const CFunctionList<void(ui32)> &callback)
template <typename T> void ask(Query<T> * sel, ui8 player, const CFunctionList<void(ui32)> &callback) {
{ gsm.lock();
gsm.lock(); sel->id = QID;
sel->id = QID; callbacks[QID] = callback;
callbacks[QID] = callback; states.addQuery(player,QID);
states.addQuery(player,QID); sendToAllClients(sel);
sendToAllClients(sel); QID++;
QID++; gsm.unlock();
gsm.unlock(); }
}
template <typename T>void sendDataToClients(const T & data)
template <typename T>void sendDataToClients(const T & data) {
{ for(std::set<CConnection*>::iterator i=conns.begin(); i!=conns.end();i++)
for(std::set<CConnection*>::iterator i=conns.begin(); i!=conns.end();i++) {
{ (*i)->wmx->lock();
(*i)->wmx->lock(); **i << data;
**i << data; (*i)->wmx->unlock();
(*i)->wmx->unlock(); }
} }
} template <typename T>void sendToAllClients(CPack<T> * info)
template <typename T>void sendToAllClients(CPack<T> * info) {
{ for(std::set<CConnection*>::iterator i=conns.begin(); i!=conns.end();i++)
for(std::set<CConnection*>::iterator i=conns.begin(); i!=conns.end();i++) {
{ (*i)->wmx->lock();
(*i)->wmx->lock(); **i << info->getType() << *info->This();
**i << info->getType() << *info->This(); (*i)->wmx->unlock();
(*i)->wmx->unlock(); }
} }
} template <typename T>void sendAndApply(CPack<T> * info)
template <typename T>void sendAndApply(CPack<T> * info) {
{ gs->apply(info);
gs->apply(info); sendToAllClients(info);
sendToAllClients(info); }
} void run();
void run(); void newTurn();
void newTurn();
friend class CVCMIServer;
friend class CVCMIServer; friend class CScriptCallback;
friend class CScriptCallback; };
};
#endif //CGAMEHANDLER_H #endif //CGAMEHANDLER_H

View File

@ -1,32 +1,34 @@
#pragma once #ifndef __CVCMISERVER_H__
#include "../global.h" #define __CVCMISERVER_H__
#include <set> #include "../global.h"
class CConnection; #include <set>
namespace boost class CConnection;
{ namespace boost
namespace asio {
{ namespace asio
class io_service; {
namespace ip class io_service;
{ namespace ip
class tcp; {
} class tcp;
template <typename Protocol> class socket_acceptor_service; }
template <typename Protocol,typename SocketAcceptorService> template <typename Protocol> class socket_acceptor_service;
class basic_socket_acceptor; template <typename Protocol,typename SocketAcceptorService>
} class basic_socket_acceptor;
}; }
};
class CVCMIServer
{ class CVCMIServer
boost::asio::io_service *io; {
boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > * acceptor; boost::asio::io_service *io;
std::map<int,CConnection*> connections; boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > * acceptor;
std::set<CConnection*> conns; std::map<int,CConnection*> connections;
public: std::set<CConnection*> conns;
CVCMIServer(); public:
~CVCMIServer(); CVCMIServer();
void setUpConnection(CConnection *c, std::string mapname, si32 checksum); ~CVCMIServer();
void newGame(CConnection *c); void setUpConnection(CConnection *c, std::string mapname, si32 checksum);
void start(); void newGame(CConnection *c);
}; void start();
};
#endif // __CVCMISERVER_H__

View File

@ -0,0 +1,92 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk

View File

@ -1,27 +1,27 @@
#ifndef _ZJEBANYNAGLOWEKWINDOWEGOVISUALAKTORENIKTNIEUZYWA_H #ifndef __STDAFX_H__
#define _ZJEBANYNAGLOWEKWINDOWEGOVISUALAKTORENIKTNIEUZYWA_H #define __STDAFX_H__
#ifndef __STDAFX_H__
// stdafx.h : include file for standard system include files, #define __STDAFX_H__
// or project specific include files that are used frequently, but
// are changed infrequently // stdafx.h : include file for standard system include files,
// // or project specific include files that are used frequently, but
#ifdef _MSC_VER // are changed infrequently
#pragma once //
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <cstdio>
#include <cstdio> #ifdef _WIN32
#ifdef _WIN32 #include <tchar.h>
#include <tchar.h> #else
#else #include "tchar_amigaos4.h"
#include "tchar_amigaos4.h" #endif
#endif #include <string>
#include <string> #include <vector>
#include <vector> #include <map>
#include <map> #include <algorithm>
#include <algorithm> #include <fstream>
#include <fstream> #include "global.h"
#include "global.h" // TODO: reference additional headers your program requires here
// TODO: reference additional headers your program requires here
#endif // __STDAFX_H__
#endif //_ZJEBANYNAGLOWEKWINDOWEGOVISUALAKTORENIKTNIEUZYWA_H #endif // __STDAFX_H__