1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Hopefully fixed compilation. Unified line endings.

This commit is contained in:
Michał W. Urbańczyk
2009-12-30 07:49:25 +00:00
parent 6bff8aec34
commit 5d74e61e3e
9 changed files with 47 additions and 47 deletions

View File

@ -813,8 +813,8 @@ const TerrainTile * CCallback::getTileInfo( int3 tile ) const
int CCallback::canBuildStructure( const CGTownInstance *t, int ID ) int CCallback::canBuildStructure( const CGTownInstance *t, int ID )
{ {
return gs->canBuildStructure(t,ID); return gs->canBuildStructure(t,ID);
} }
std::set<int> CCallback::getBuildingRequiments( const CGTownInstance *t, int ID ) std::set<int> CCallback::getBuildingRequiments( const CGTownInstance *t, int ID )
{ {
return gs->getBuildingRequiments(t,ID); return gs->getBuildingRequiments(t,ID);

View File

@ -273,7 +273,7 @@ public:
std::vector<const CGHeroInstance *> getAvailableHeroes(const CGTownInstance * town) const; //heroes that can be recruited std::vector<const CGHeroInstance *> getAvailableHeroes(const CGTownInstance * town) const; //heroes that can be recruited
const TerrainTile * getTileInfo(int3 tile) const; const TerrainTile * getTileInfo(int3 tile) const;
int canBuildStructure(const CGTownInstance *t, int ID);//// 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 int canBuildStructure(const CGTownInstance *t, int ID);//// 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
std::set<int> getBuildingRequiments(const CGTownInstance *t, int ID); std::set<int> getBuildingRequiments(const CGTownInstance *t, int ID);
bool getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath &ret); bool getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath &ret);
const CGPathNode *getPathInfo(int3 tile); const CGPathNode *getPathInfo(int3 tile);
bool getPath2(int3 dest, CGPath &ret); bool getPath2(int3 dest, CGPath &ret);

View File

@ -667,20 +667,20 @@ void CCastleInterface::buildingClicked(int building)
//TODO: case 24: //basic horde 2 //TODO: case 24: //basic horde 2
//TODO: case 25: //upg horde 2 //TODO: case 25: //upg horde 2
//TODO: case 26: //grail //TODO: case 26: //grail
default: default:
defaultBuildingClicked(building); defaultBuildingClicked(building);
break; break;
} }
} }
} }
void CCastleInterface::defaultBuildingClicked(int building) void CCastleInterface::defaultBuildingClicked(int building)
{ {
std::vector<SComponent*> comps(1, std::vector<SComponent*> comps(1,
new CCustomImgComponent(SComponent::building,town->subID,building,bicons->ourImages[building].bitmap,false)); new CCustomImgComponent(SComponent::building,town->subID,building,bicons->ourImages[building].bitmap,false));
LOCPLINT->showInfoDialog( LOCPLINT->showInfoDialog(
CGI->buildh->buildings[town->subID][building]->Description(), CGI->buildh->buildings[town->subID][building]->Description(),
comps, soundBase::sound_todo); comps, soundBase::sound_todo);
} }
void CCastleInterface::enterHall() void CCastleInterface::enterHall()
@ -1387,7 +1387,7 @@ CHallInterface::CHallInterface(CCastleInterface * owner)
resdatabar->pos.x += pos.x; resdatabar->pos.x += pos.x;
resdatabar->pos.y += pos.y; resdatabar->pos.y += pos.y;
LOCPLINT->castleInt->statusbar->clear(); LOCPLINT->castleInt->statusbar->clear();
bg = BitmapHandler::loadBitmap(CGI->buildh->hall[owner->town->subID].first); bg = BitmapHandler::loadBitmap(CGI->buildh->hall[owner->town->subID].first);
bid = owner->town->hallLevel()+10; bid = owner->town->hallLevel()+10;
graphics->blueToPlayersAdv(bg,LOCPLINT->playerID); graphics->blueToPlayersAdv(bg,LOCPLINT->playerID);
exit = new AdventureMapButton exit = new AdventureMapButton
@ -1461,9 +1461,9 @@ void CHallInterface::close()
GH.popIntTotally(this); GH.popIntTotally(this);
} }
void CHallInterface::show(SDL_Surface * to) void CHallInterface::show(SDL_Surface * to)
{ {
blitAt(bg,pos,to); blitAt(bg,pos,to);
LOCPLINT->castleInt->statusbar->show(to); LOCPLINT->castleInt->statusbar->show(to);
printAtMiddle(CGI->buildh->buildings[LOCPLINT->castleInt->town->subID][bid]->Name(),400+pos.x,13+pos.y,GEORXX,zwykly,to); printAtMiddle(CGI->buildh->buildings[LOCPLINT->castleInt->town->subID][bid]->Name(),400+pos.x,13+pos.y,GEORXX,zwykly,to);
resdatabar->show(to); resdatabar->show(to);
exit->show(to); exit->show(to);
@ -1471,7 +1471,7 @@ void CHallInterface::show(SDL_Surface * to)
{ {
for(size_t j=0;j<boxes[i].size(); ++j) for(size_t j=0;j<boxes[i].size(); ++j)
boxes[i][j]->show(to); boxes[i][j]->show(to);
} }
} }
void CHallInterface::activate() void CHallInterface::activate()
{ {
@ -1561,12 +1561,12 @@ std::string CHallInterface::CBuildWindow::getTextForState(int state)
case 8: case 8:
{ {
ret = CGI->generaltexth->allTexts[52]; ret = CGI->generaltexth->allTexts[52];
std::set<int> reqs= LOCPLINT->cb->getBuildingRequiments(LOCPLINT->castleInt->town, bid); std::set<int> reqs= LOCPLINT->cb->getBuildingRequiments(LOCPLINT->castleInt->town, bid);
bool first=true; bool first=true;
for(std::set<int>::iterator i=reqs.begin();i!=reqs.end();i++) for(std::set<int>::iterator i=reqs.begin();i!=reqs.end();i++)
{ {
if (vstd::contains(LOCPLINT->castleInt->town->builtBuildings, *i)) if (vstd::contains(LOCPLINT->castleInt->town->builtBuildings, *i))
continue;//skipping constructed buildings continue;//skipping constructed buildings
ret+=(((first)?(" "):(", ")) + CGI->buildh->buildings[tid][*i]->Name()); ret+=(((first)?(" "):(", ")) + CGI->buildh->buildings[tid][*i]->Name());
first = false;//TODO - currently can return "Mage guild lvl 1, MG lvl 2..." - extra check needed first = false;//TODO - currently can return "Mage guild lvl 1, MG lvl 2..." - extra check needed

View File

@ -77,7 +77,7 @@ class CCastleInterface : public CWindowWithGarrison
public: public:
int crid,bid; int crid,bid;
CCreaInfo(int CRID, int BID); //c-tor CCreaInfo(int CRID, int BID); //c-tor
~CCreaInfo();//d-tor ~CCreaInfo();//d-tor
int AddToString(std::string from, std::string & to, int numb); int AddToString(std::string from, std::string & to, int numb);
void hover(bool on); void hover(bool on);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState);
@ -128,7 +128,7 @@ public:
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key);
void show(SDL_Surface * to); void show(SDL_Surface * to);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to);
void buildingClicked(int building); void buildingClicked(int building);
void defaultBuildingClicked(int building);//for buildings with simple description + pic left-click messages void defaultBuildingClicked(int building);//for buildings with simple description + pic left-click messages
void enterTavern(); void enterTavern();
void enterMageGuild(); void enterMageGuild();

View File

@ -15,7 +15,7 @@
#include "CConfigHandler.h" #include "CConfigHandler.h"
#include "CCreatureAnimation.h" #include "CCreatureAnimation.h"
#include "Graphics.h" #include "Graphics.h"
#include "../hch/CArtHandler.h" #include "../hch/CArtHandler.h"
#include "../hch/CBuildingHandler.h" #include "../hch/CBuildingHandler.h"
#include "../hch/CGeneralTextHandler.h" #include "../hch/CGeneralTextHandler.h"
#include "../hch/CHeroHandler.h" #include "../hch/CHeroHandler.h"
@ -820,10 +820,10 @@ void SComponent::init(Etype Type, int Subtype, int Val)
tlog1 << "Wrong subtype=" << Subtype << std::endl; tlog1 << "Wrong subtype=" << Subtype << std::endl;
} }
subtitle = oss.str(); subtitle = oss.str();
break; break;
case building: case building:
description = CGI->buildh->buildings[Subtype][Val]->Description(); description = CGI->buildh->buildings[Subtype][Val]->Description();
subtitle = CGI->buildh->buildings[Subtype][Val]->Name(); subtitle = CGI->buildh->buildings[Subtype][Val]->Name();
break; break;
case secskill44: case secskill: case secskill44: case secskill:
subtitle += CGI->generaltexth->levels[Val-1] + " " + CGI->generaltexth->skillName[Subtype]; subtitle += CGI->generaltexth->levels[Val-1] + " " + CGI->generaltexth->skillName[Subtype];

View File

@ -226,14 +226,14 @@ void CLodHandler::init(std::string lodFile, std::string dirName)
{ {
if(boost::filesystem::is_regular(dir->status())) if(boost::filesystem::is_regular(dir->status()))
{ {
std::string name = dir->path().leaf(); std::string name = dir->path().leaf();
std::string realname = name; std::string realname = name;
std::transform(name.begin(), name.end(), name.begin(), (int(*)(int))toupper); std::transform(name.begin(), name.end(), name.begin(), (int(*)(int))toupper);
boost::algorithm::replace_all(name,".BMP",".PCX"); boost::algorithm::replace_all(name,".BMP",".PCX");
Entry * e = entries.znajdz(name); Entry * e = entries.znajdz(name);
if(e) //file present in .lod - overwrite its entry if(e) //file present in .lod - overwrite its entry
{ {
e->offset = -1; e->offset = -1;
e->realName = realname; e->realName = realname;
e->realSize = e->size = boost::filesystem::file_size(dir->path()); e->realSize = e->size = boost::filesystem::file_size(dir->path());
} }
@ -241,7 +241,7 @@ void CLodHandler::init(std::string lodFile, std::string dirName)
{ {
Entry e2; Entry e2;
e2.offset = -1; e2.offset = -1;
e2.nameStr = name; e2.nameStr = name;
e2.realName = realname; e2.realName = realname;
e2.realSize = e2.size = boost::filesystem::file_size(dir->path()); e2.realSize = e2.size = boost::filesystem::file_size(dir->path());
entries.push_back(e2); entries.push_back(e2);

View File

@ -40,7 +40,7 @@ struct LodEntry {
struct Entry struct Entry
{ {
// Info extracted from LOD file // Info extracted from LOD file
std::string nameStr, std::string nameStr,
realName; realName;
int offset, //from beginning int offset, //from beginning
realSize, //size without compression realSize, //size without compression

View File

@ -1796,20 +1796,20 @@ int CGameState::getMovementCost(const CGHeroInstance *h, const int3 &src, const
} }
return ret; return ret;
} }
std::set<int> CGameState::getBuildingRequiments(const CGTownInstance *t, int ID) std::set<int> CGameState::getBuildingRequiments(const CGTownInstance *t, int ID)
{ {
std::set<int> used; std::set<int> used;
used.insert(ID); used.insert(ID);
std::set<int> reqs = VLC->townh->requirements[t->subID][ID]; std::set<int> reqs = VLC->townh->requirements[t->subID][ID];
while(true) while(true)
{ {
size_t noloop=0; size_t noloop=0;
for(std::set<int>::iterator i=reqs.begin();i!=reqs.end();i++) for(std::set<int>::iterator i=reqs.begin();i!=reqs.end();i++)
{ {
if(used.find(*i)==used.end()) //we haven't added requirements for this building if(used.find(*i)==used.end()) //we haven't added requirements for this building
{ {
used.insert(*i); used.insert(*i);
for( for(
std::set<int>::iterator j=VLC->townh->requirements[t->subID][*i].begin(); std::set<int>::iterator j=VLC->townh->requirements[t->subID][*i].begin();
@ -1826,14 +1826,14 @@ std::set<int> CGameState::getBuildingRequiments(const CGTownInstance *t, int ID)
} }
if(noloop==reqs.size()) if(noloop==reqs.size())
break; break;
} }
return reqs; return reqs;
} }
int CGameState::canBuildStructure( const CGTownInstance *t, int ID ) int CGameState::canBuildStructure( const CGTownInstance *t, int ID )
{ {
int ret = 7; //allowed by default int ret = 7; //allowed by default
if(t->builded >= MAX_BUILDING_PER_TURN) if(t->builded >= MAX_BUILDING_PER_TURN)
ret = 5; //building limit ret = 5; //building limit
@ -1849,8 +1849,8 @@ int CGameState::canBuildStructure( const CGTownInstance *t, int ID )
ret = 6; //lack of res ret = 6; //lack of res
} }
//checking for requirements //checking for requirements
std::set<int> reqs = getBuildingRequiments(t, ID);//getting all requiments std::set<int> reqs = getBuildingRequiments(t, ID);//getting all requiments
for( std::set<int>::iterator ri = reqs.begin(); ri != reqs.end(); ri++ ) for( std::set<int>::iterator ri = reqs.begin(); ri != reqs.end(); ri++ )
{ {

View File

@ -47,8 +47,8 @@ CTypeList typeList;
void CConnection::init() void CConnection::init()
{ {
CISer::smartPointerSerialization = false; CISer<CConnection>::smartPointerSerialization = false;
COSer::smartPointerSerialization = false; COSer<CConnection>::smartPointerSerialization = false;
registerTypes(static_cast<CISer<CConnection>&>(*this)); registerTypes(static_cast<CISer<CConnection>&>(*this));
registerTypes(static_cast<COSer<CConnection>&>(*this)); registerTypes(static_cast<COSer<CConnection>&>(*this));
#ifdef LIL_ENDIAN #ifdef LIL_ENDIAN