Anonymous | Login | 2024-11-21 19:37 UTC |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0001072 | VCMI | Other | public | 2012-09-13 09:48 | 2012-09-28 12:53 | ||||
Reporter | AlexVinS | ||||||||
Assigned To | Tow | ||||||||
Priority | normal | Severity | major | Reproducibility | N/A | ||||
Status | closed | Resolution | fixed | ||||||
Platform | WIN32 | OS | OS Version | ||||||
Product Version | 0.89b | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0001072: [patch] Mingw support and C::B project files | ||||||||
Description | 1) mingw32 support (should work for mingw64 but untested) 2) Code::Blocks project files 3) small cleanup in config | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | mingw_codeblocks.patch [^] (64,179 bytes) 2012-09-14 08:22 [Show Content] [Hide Content]Index: . =================================================================== --- . (revision 2878) +++ . (working copy) Property changes on: . ___________________________________________________________________ Modified: svn:ignore ## -5,3 +5,9 ## Heroes3.snd MP3 Maps +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI =================================================================== --- AI (revision 2878) +++ AI (working copy) Property changes on: AI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/EmptyAI =================================================================== --- AI/EmptyAI (revision 2878) +++ AI/EmptyAI (working copy) Property changes on: AI/EmptyAI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/EmptyAI/EmptyAI.cbp =================================================================== --- AI/EmptyAI/EmptyAI.cbp (revision 0) +++ AI/EmptyAI/EmptyAI.cbp (working copy) @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="EmptyAI" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\EmptyAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\EmptyAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-fpermissive" /> + </Compiler> + <Linker> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="CEmptyAI.cpp" /> + <Unit filename="CEmptyAI.h" /> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="exp_funcs.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: AI/EmptyAI/exp_funcs.cpp =================================================================== --- AI/EmptyAI/exp_funcs.cpp (revision 2878) +++ AI/EmptyAI/exp_funcs.cpp (working copy) @@ -3,27 +3,27 @@ #include "CEmptyAI.h" std::set<CGlobalAI*> ais; -extern "C" DLL_LINKAGE int GetGlobalAiVersion() +extern "C" DLL_EXPORT int GetGlobalAiVersion() { return AI_INTERFACE_VER; } -extern "C" DLL_LINKAGE void GetAiName(char* name) +extern "C" DLL_EXPORT void GetAiName(char* name) { strcpy(name,NAME); } -extern "C" DLL_LINKAGE char * GetAiNameS() +extern "C" DLL_EXPORT char * GetAiNameS() { char * ret = new char[50]; strcpy(ret,NAME); return ret; } -extern "C" DLL_LINKAGE CGlobalAI * GetNewAI() +extern "C" DLL_EXPORT CGlobalAI * GetNewAI() { return new CEmptyAI(); // return } -extern "C" DLL_LINKAGE void ReleaseAI(CGlobalAI * i) +extern "C" DLL_EXPORT void ReleaseAI(CGlobalAI * i) { delete (CEmptyAI*)i; ais.erase(i); Index: AI/FuzzyLite =================================================================== --- AI/FuzzyLite (revision 2878) +++ AI/FuzzyLite (working copy) Property changes on: AI/FuzzyLite ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/FuzzyLite/FuzzyLite.cbp =================================================================== --- AI/FuzzyLite/FuzzyLite.cbp (revision 0) +++ AI/FuzzyLite/FuzzyLite.cbp (working copy) @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="FuzzyLite" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\FuzzyLite" prefix_auto="1" extension_auto="1" /> + <Option working_dir="" /> + <Option object_output="obj\Debug\" /> + <Option type="2" /> + <Option compiler="gcc" /> + <Option createDefFile="1" /> + <Compiler> + <Add option="-Wall" /> + <Add option="-g" /> + </Compiler> + </Target> + <Target title="Release"> + <Option output="bin\Release\FuzzyLite" prefix_auto="1" extension_auto="1" /> + <Option working_dir="" /> + <Option object_output="obj\Release\" /> + <Option type="2" /> + <Option compiler="gcc" /> + <Option createDefFile="1" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + <Add option="-Wall" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Unit filename="AreaCentroidAlgorithm.cpp" /> + <Unit filename="AreaCentroidAlgorithm.h" /> + <Unit filename="CompoundTerm.cpp" /> + <Unit filename="CompoundTerm.h" /> + <Unit filename="DescriptiveAntecedent.cpp" /> + <Unit filename="DescriptiveAntecedent.h" /> + <Unit filename="DiscreteTerm.cpp" /> + <Unit filename="DiscreteTerm.h" /> + <Unit filename="FunctionTerm.cpp" /> + <Unit filename="FunctionTerm.h" /> + <Unit filename="FuzzyAnd.cpp" /> + <Unit filename="FuzzyAnd.h" /> + <Unit filename="FuzzyAntecedent.cpp" /> + <Unit filename="FuzzyAntecedent.h" /> + <Unit filename="FuzzyConsequent.cpp" /> + <Unit filename="FuzzyConsequent.h" /> + <Unit filename="FuzzyDefuzzifier.cpp" /> + <Unit filename="FuzzyDefuzzifier.h" /> + <Unit filename="FuzzyEngine.cpp" /> + <Unit filename="FuzzyEngine.h" /> + <Unit filename="FuzzyException.cpp" /> + <Unit filename="FuzzyException.h" /> + <Unit filename="FuzzyExceptions.cpp" /> + <Unit filename="FuzzyExceptions.h" /> + <Unit filename="FuzzyLite.h" /> + <Unit filename="FuzzyModulation.cpp" /> + <Unit filename="FuzzyModulation.h" /> + <Unit filename="FuzzyOperation.cpp" /> + <Unit filename="FuzzyOperation.h" /> + <Unit filename="FuzzyOperator.cpp" /> + <Unit filename="FuzzyOperator.h" /> + <Unit filename="FuzzyOr.cpp" /> + <Unit filename="FuzzyOr.h" /> + <Unit filename="FuzzyRule.cpp" /> + <Unit filename="FuzzyRule.h" /> + <Unit filename="Hedge.cpp" /> + <Unit filename="Hedge.h" /> + <Unit filename="HedgeSet.cpp" /> + <Unit filename="HedgeSet.h" /> + <Unit filename="InfixToPostfix.cpp" /> + <Unit filename="InfixToPostfix.h" /> + <Unit filename="InputLVar.cpp" /> + <Unit filename="InputLVar.h" /> + <Unit filename="LinguisticTerm.cpp" /> + <Unit filename="LinguisticTerm.h" /> + <Unit filename="LinguisticVariable.cpp" /> + <Unit filename="LinguisticVariable.h" /> + <Unit filename="MamdaniConsequent.cpp" /> + <Unit filename="MamdaniConsequent.h" /> + <Unit filename="MamdaniRule.cpp" /> + <Unit filename="MamdaniRule.h" /> + <Unit filename="OutputLVar.cpp" /> + <Unit filename="OutputLVar.h" /> + <Unit filename="RectangularTerm.cpp" /> + <Unit filename="RectangularTerm.h" /> + <Unit filename="RuleBlock.cpp" /> + <Unit filename="RuleBlock.h" /> + <Unit filename="ShoulderTerm.cpp" /> + <Unit filename="ShoulderTerm.h" /> + <Unit filename="SingletonTerm.cpp" /> + <Unit filename="SingletonTerm.h" /> + <Unit filename="StrOp.cpp" /> + <Unit filename="StrOp.h" /> + <Unit filename="TakagiSugenoConsequent.cpp" /> + <Unit filename="TakagiSugenoConsequent.h" /> + <Unit filename="TakagiSugenoRule.cpp" /> + <Unit filename="TakagiSugenoRule.h" /> + <Unit filename="TakagiSugenoTerm.cpp" /> + <Unit filename="TakagiSugenoTerm.h" /> + <Unit filename="TrapezoidalTerm.cpp" /> + <Unit filename="TrapezoidalTerm.h" /> + <Unit filename="TriangularTerm.cpp" /> + <Unit filename="TriangularTerm.h" /> + <Unit filename="defs.h" /> + <Unit filename="flScalar.h" /> + <Unit filename="main.cpp" /> + <Unit filename="test.h" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: AI/StupidAI =================================================================== --- AI/StupidAI (revision 2878) +++ AI/StupidAI (working copy) Property changes on: AI/StupidAI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/StupidAI/StupidAI.cbp =================================================================== --- AI/StupidAI/StupidAI.cbp (revision 0) +++ AI/StupidAI/StupidAI.cbp (working copy) @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="StupidAI" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\StupidAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\StupidAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + </Compiler> + <Linker> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="StupidAI.cpp" /> + <Unit filename="StupidAI.h" /> + <Unit filename="main.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: AI/VCAI =================================================================== --- AI/VCAI (revision 2878) +++ AI/VCAI (working copy) Property changes on: AI/VCAI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/VCAI/VCAI.cbp =================================================================== --- AI/VCAI/VCAI.cbp (revision 0) +++ AI/VCAI/VCAI.cbp (working copy) @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCAI" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\VCAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + <Add directory="..\FuzzyLite\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\VCAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="..\..\bin\Release" /> + <Add directory="..\FuzzyLite\bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + </Compiler> + <Linker> + <Add option="-lFuzzyLite" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="Fuzzy.cpp" /> + <Unit filename="Fuzzy.h" /> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="VCAI.cpp" /> + <Unit filename="VCAI.h" /> + <Unit filename="main.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: client =================================================================== --- client (revision 2878) +++ client (working copy) Property changes on: client ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +*.gch Index: client/BattleInterface/CBattleAnimations.cpp =================================================================== --- client/BattleInterface/CBattleAnimations.cpp (revision 2878) +++ client/BattleInterface/CBattleAnimations.cpp (working copy) @@ -1,4 +1,4 @@ -#include "StdInc.h" +#include "../StdInc.h" #include "CBattleAnimations.h" #include <boost/math/constants/constants.hpp> @@ -17,7 +17,7 @@ CBattleAnimation::CBattleAnimation(CBattleInterface * _owner) -: owner(_owner), ID(_owner->animIDhelper++) +: owner(_owner), ID(_owner->animIDhelper++) {} void CBattleAnimation::endAnim() @@ -60,7 +60,7 @@ } CBattleStackAnimation::CBattleStackAnimation(CBattleInterface * _owner, const CStack * _stack) -: CBattleAnimation(_owner), stack(_stack) +: CBattleAnimation(_owner), stack(_stack) {} bool CBattleStackAnimation::isToReverseHlp(BattleHex hexFrom, BattleHex hexTo, bool curDir) @@ -140,7 +140,7 @@ { assert(attackingStack && "attackingStack is NULL in CBattleAttack::CBattleAttack !\n"); - bool isCatapultAttack = attackingStack->hasBonusOfType(Bonus::CATAPULT) + bool isCatapultAttack = attackingStack->hasBonusOfType(Bonus::CATAPULT) && owner->curInt->cb->battleHexToWallPart(_dest) >= 0; assert(attackedStack || isCatapultAttack); @@ -150,7 +150,7 @@ CDefenceAnimation::CDefenceAnimation(StackAttackedInfo _attackedInfo, CBattleInterface * _owner) : CBattleStackAnimation(_owner, _attackedInfo.defender), dmg(_attackedInfo.dmg), amountKilled(_attackedInfo.amountKilled), attacker(_attackedInfo.attacker), byShooting(_attackedInfo.byShooting), -killed(_attackedInfo.killed) +killed(_attackedInfo.killed) {} bool CDefenceAnimation::init() @@ -205,7 +205,7 @@ //unit reversed if(byShooting) //delay hit animation - { + { for(std::list<ProjectileInfo>::const_iterator it = owner->projectiles.begin(); it != owner->projectiles.end(); ++it) { if(it->creID == attacker->getCreature()->idNumber) @@ -273,8 +273,8 @@ delete this; } -CDummyAnimation::CDummyAnimation(CBattleInterface * _owner, int howManyFrames) -: CBattleAnimation(_owner), counter(0), howMany(howManyFrames) +CDummyAnimation::CDummyAnimation(CBattleInterface * _owner, int howManyFrames) +: CBattleAnimation(_owner), counter(0), howMany(howManyFrames) {} bool CDummyAnimation::init() @@ -309,7 +309,7 @@ if(!attackingStack || myAnim()->getType() == 5) { endAnim(); - + return false; } @@ -360,7 +360,7 @@ } CMeleeAttackAnimation::CMeleeAttackAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked) -: CAttackAnimation(_owner, attacker, _dest, _attacked) +: CAttackAnimation(_owner, attacker, _dest, _attacked) {} void CMeleeAttackAnimation::nextFrame() @@ -435,7 +435,7 @@ //step shift calculation posX = myAnim()->pos.x, posY = myAnim()->pos.y; // for precise calculations ;] - if(mutPos == -1 && movedStack->hasBonusOfType(Bonus::FLYING)) + if(mutPos == -1 && movedStack->hasBonusOfType(Bonus::FLYING)) { steps *= distance; steps /= 2; //to make animation faster @@ -549,7 +549,7 @@ } CMovementEndAnimation::CMovementEndAnimation(CBattleInterface * _owner, const CStack * _stack, BattleHex destTile) -: CBattleStackAnimation(_owner, _stack), destinationTile(destTile) +: CBattleStackAnimation(_owner, _stack), destinationTile(destTile) {} bool CMovementEndAnimation::init() @@ -592,7 +592,7 @@ } CMovementStartAnimation::CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack) -: CBattleStackAnimation(_owner, _stack) +: CBattleStackAnimation(_owner, _stack) {} bool CMovementStartAnimation::init() @@ -634,7 +634,7 @@ } CReverseAnimation::CReverseAnimation(CBattleInterface * _owner, const CStack * stack, BattleHex dest, bool _priority) -: CBattleStackAnimation(_owner, stack), partOfAnim(1), secondPartSetup(false), hex(dest), priority(_priority) +: CBattleStackAnimation(_owner, stack), partOfAnim(1), secondPartSetup(false), hex(dest), priority(_priority) {} bool CReverseAnimation::init() @@ -726,7 +726,7 @@ } CShootingAnimation::CShootingAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked, bool _catapult, int _catapultDmg) -: CAttackAnimation(_owner, attacker, _dest, _attacked), catapultDamage(_catapultDmg), catapult(_catapult) +: CAttackAnimation(_owner, attacker, _dest, _attacked), catapultDamage(_catapultDmg), catapult(_catapult) {} bool CShootingAnimation::init() @@ -785,7 +785,7 @@ if (attackedStack) { - destcoord = CClickableHex::getXYUnitAnim(dest, false, attackedStack, owner); + destcoord = CClickableHex::getXYUnitAnim(dest, false, attackedStack, owner); destcoord.x += 250; destcoord.y += 210; //TODO: find a better place to shoot // Calculate projectile start position. Offsets are read out of the CRANIM.TXT. @@ -795,13 +795,13 @@ spi.x = xycoord.x + projectileOrigin.x + shooterInfo->upperRightMissleOffsetX; spi.y = xycoord.y + projectileOrigin.y + shooterInfo->upperRightMissleOffsetY; } - else if (projectileAngle < -straightAngle) + else if (projectileAngle < -straightAngle) { //lower shot spi.x = xycoord.x + projectileOrigin.x + shooterInfo->lowerRightMissleOffsetX; spi.y = xycoord.y + projectileOrigin.y + shooterInfo->lowerRightMissleOffsetY; } - else + else { //straight shot spi.x = xycoord.x + projectileOrigin.x + shooterInfo->rightMissleOffsetX; @@ -816,7 +816,7 @@ spi.dy = (destcoord.y - spi.y) / spi.lastStep; spi.catapultInfo = 0; } - else + else { // Catapult attack // These are the values for equations of this kind: f(x) = ax^2 + bx + c @@ -903,11 +903,11 @@ } CSpellEffectAnimation::CSpellEffectAnimation(CBattleInterface * _owner, ui32 _effect, BattleHex _destTile, int _dx, int _dy, bool _Vflip) -:CBattleAnimation(_owner), effect(_effect), destTile(_destTile), customAnim(""), x(0), y(0), dx(_dx), dy(_dy), Vflip(_Vflip) +:CBattleAnimation(_owner), effect(_effect), destTile(_destTile), customAnim(""), x(0), y(0), dx(_dx), dy(_dy), Vflip(_Vflip) {} CSpellEffectAnimation::CSpellEffectAnimation(CBattleInterface * _owner, std::string _customAnim, int _x, int _y, int _dx, int _dy, bool _Vflip) -:CBattleAnimation(_owner), effect(-1), destTile(0), customAnim(_customAnim), x(_x), y(_y), dx(_dx), dy(_dy), Vflip(_Vflip) +:CBattleAnimation(_owner), effect(-1), destTile(0), customAnim(_customAnim), x(_x), y(_y), dx(_dx), dy(_dy), Vflip(_Vflip) {} bool CSpellEffectAnimation::init() @@ -1020,7 +1020,7 @@ return false; } } - //battleEffects + //battleEffects return true; } @@ -1068,4 +1068,4 @@ } delete this; -} \ No newline at end of file +} Index: client/CVideoHandler.cpp =================================================================== --- client/CVideoHandler.cpp (revision 2878) +++ client/CVideoHandler.cpp (working copy) @@ -47,7 +47,7 @@ void blitBuffer(char *buffer, int x, int y, int w, int h, SDL_Surface *dst) { - const int bpp = dst->format->BytesPerPixel; + const int bpp = dst->format->BytesPerPixel; char *dest; for(int i = h; i > 0; i--) { @@ -142,10 +142,13 @@ tlog1 << "BIK handler: failed to open " << name << std::endl; goto checkErrorAndClean; } + //GCC wants scope of waveout to be reduced. + { + void *waveout = GetProcAddress(dll,"_BinkOpenWaveOut@4"); + if(waveout) + binkSetSoundSystem(waveout,NULL); - void *waveout = GetProcAddress(dll,"_BinkOpenWaveOut@4"); - if(waveout) - binkSetSoundSystem(waveout,NULL); + } hBink = binkOpen(hBinkFile, 0x8a800000); if(!hBink) @@ -166,8 +169,8 @@ void CBIKHandler::show( int x, int y, SDL_Surface *dst, bool update ) { - const int w = hBink->width, - h = hBink->height, + const int w = hBink->width, + h = hBink->height, Bpp = dst->format->BytesPerPixel; int mode = -1; @@ -298,7 +301,7 @@ Uint32 flags[2] = {0xff400, 0xfe400}; data = ptrSmackOpen( (void*)name.c_str(), flags[1], -1); - if (!data) + if (!data) { tlog1 << "Smack cannot open " << name << std::endl; checkForError(); @@ -337,9 +340,9 @@ { int w = std::min<int>(data->width, dst->w - x), h = std::min<int>(data->height, dst->h - y); /* Lock the screen for direct access to the pixels */ - if ( SDL_MUSTLOCK(dst) ) + if ( SDL_MUSTLOCK(dst) ) { - if ( SDL_LockSurface(dst) < 0 ) + if ( SDL_LockSurface(dst) < 0 ) { fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError()); return; @@ -374,7 +377,7 @@ //convert rgb 555 to 565 Uint16 pixel = *addr; Uint16 *p = (Uint16 *)((Uint8 *)dst->pixels + (j+y) * dst->pitch + (i + x) * dst->format->BytesPerPixel); - *p = (pixel & 0x1F) + *p = (pixel & 0x1F) + ((pixel & 0x3e0) << 1) + ((pixel & 0x7c00) << 1); @@ -383,7 +386,7 @@ } } - if ( SDL_MUSTLOCK(dst) ) + if ( SDL_MUSTLOCK(dst) ) { SDL_UnlockSurface(dst); } @@ -425,7 +428,7 @@ out.exceptions(std::ifstream::failbit | std::ifstream::badbit); out.write(data.get(), myVideo->getSize()); } - + current->open(name); return true; } @@ -526,7 +529,7 @@ - if(!w) + if(!w) { show(x,y,dst,update); } @@ -700,7 +703,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay) { close(); - + this->fname = fname; offset = 0; refreshWait = 3; @@ -790,7 +793,7 @@ // Unsupported codec return false; } - + // Open codec #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 6, 0) if ( avcodec_open(codecContext, codec) < 0 ) @@ -802,7 +805,7 @@ codec = NULL; return false; } - + // Allocate video frame frame = avcodec_alloc_frame(); @@ -826,8 +829,8 @@ // Convert the image into YUV format that SDL uses if (overlay) { - sws = sws_getContext(codecContext->width, codecContext->height, - codecContext->pix_fmt, codecContext->width, codecContext->height, + sws = sws_getContext(codecContext->width, codecContext->height, + codecContext->pix_fmt, codecContext->width, codecContext->height, PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL); } else @@ -842,8 +845,8 @@ default: return false; } - sws = sws_getContext(codecContext->width, codecContext->height, - codecContext->pix_fmt, codecContext->width, codecContext->height, + sws = sws_getContext(codecContext->width, codecContext->height, + codecContext->pix_fmt, codecContext->width, codecContext->height, screenFormat, SWS_BICUBIC, NULL, NULL, NULL); } @@ -905,7 +908,7 @@ if (overlay) { SDL_LockYUVOverlay(overlay); - + pict.data[0] = overlay->pixels[0]; pict.data[1] = overlay->pixels[2]; pict.data[2] = overlay->pixels[1]; @@ -945,7 +948,7 @@ pos.x = x; pos.y = y; CSDL_Ext::blitSurface(dest, &destRect, dst, &pos); - + if (update) SDL_UpdateRect(dst, pos.x, pos.y, pos.w, pos.h); } @@ -968,14 +971,14 @@ else { open(fname); - nextFrame(); - + nextFrame(); + // The y position is wrong at the first frame. // Note: either the windows player or the linux player is - // broken. Compensate here until the bug is found. + // broken. Compensate here until the bug is found. show(x, y--, dst, update); } - } + } else { redraw(x, y, dst, update); @@ -986,7 +989,7 @@ void CVideoPlayer::close() { - fname = ""; + fname = ""; if (sws) { sws_freeContext(sws); @@ -1049,7 +1052,7 @@ while(nextFrame()) { - + if(stopOnKey && keyDown()) return false; @@ -1071,7 +1074,7 @@ close(); return ret; } - + CVideoPlayer::~CVideoPlayer() { close(); Index: config/creatures.json =================================================================== --- config/creatures.json (revision 2878) +++ config/creatures.json (working copy) @@ -492,7 +492,7 @@ "name": [ "HellHound" ], "faction": 3, "upgrades": [47], - "ability_remove": [ "FLYING" ], + "ability_remove": [ "FLYING" ], //hell hound doesn't fly "defname": "CHHOUN.DEF" }, @@ -503,7 +503,7 @@ "faction": 3, "ability_add": [ [ "THREE_HEADED_ATTACK", 0, 0, 0 ], [ "BLOCKS_RETALIATION", 0, 0, 0 ] ], - "ability_remove": [ "FLYING" ], + "ability_remove": [ "FLYING" ], //cerberus doesn't fly "defname": "CCERBU.DEF" }, @@ -1523,7 +1523,7 @@ "level": 0, "name": [ "FirstAidTent" ], "faction": 9, - "ability_add": [ [ "HEALER", 0, 0, 0 ] ], //Gorynyches fly + "ability_add": [ [ "HEALER", 0, 0, 0 ] ], "defname": "SMTENT.DEF" }, @@ -1532,7 +1532,7 @@ "level": 0, "name": [ "AmmoCart" ], "faction": 9, - "ability_add": [ [ "NOT_ACTIVE", 0, 0, 0 ] ], //hell hound doesn't fly + "ability_add": [ [ "NOT_ACTIVE", 0, 0, 0 ] ], "defname": "SMCART.DEF" }, @@ -1541,7 +1541,7 @@ "level": 0, "name": [ "ArrowTower" ], "faction": 9, - "ability_add": [ [ "SHOOTER", 0, 0, 0 ] ], //cerberus doesn't fly + "ability_add": [ [ "SHOOTER", 0, 0, 0 ] ], "defname": "x" }, @@ -1700,7 +1700,7 @@ "level": 0, "name": [ "Gorynych" ], "faction": 9, - "ability_add": [ [ "FLYING", 0, 0, 0 ] ], + "ability_add": [ [ "FLYING", 0, 0, 0 ] ], //Gorynyches fly "defname": "ZM168DG.DEF" }, Index: Global.h =================================================================== --- Global.h (revision 2878) +++ Global.h (working copy) @@ -97,7 +97,11 @@ // Import + Export macro declarations #ifdef _WIN32 +#ifdef __GNUC__ +#define DLL_EXPORT __attribute__((dllexport)) +#else #define DLL_EXPORT __declspec(dllexport) +#endif #else #if defined(__GNUC__) && GCC_VERSION >= 400 #define DLL_EXPORT __attribute__ ((visibility("default"))) @@ -107,7 +111,11 @@ #endif #ifdef _WIN32 +#ifdef __GNUC__ +#define DLL_IMPORT __attribute__((dllimport)) +#else #define DLL_IMPORT __declspec(dllimport) +#endif #else #if defined(__GNUC__) && GCC_VERSION >= 400 #define DLL_IMPORT __attribute__ ((visibility("default"))) Index: lib =================================================================== --- lib (revision 2878) +++ lib (working copy) Property changes on: lib ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +*.gch Index: lib/CConsoleHandler.cpp =================================================================== --- lib/CConsoleHandler.cpp (revision 2878) +++ lib/CConsoleHandler.cpp (working copy) @@ -25,9 +25,10 @@ #else #define WIN32_LEAN_AND_MEAN //excludes rarely used stuff from windows headers - delete this line if something is missing #include <windows.h> +#ifndef __MINGW32__ #include <dbghelp.h> #pragma comment(lib, "dbghelp.lib") - +#endif typedef WORD TColor; HANDLE handleIn; HANDLE handleOut; @@ -43,6 +44,7 @@ TColor defColor; #ifdef _WIN32 +#ifndef __MINGW32__ void printWinError() { @@ -108,7 +110,7 @@ if (einfo->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { - tlog1 << "Attempt to " << (einfo->ExceptionInformation[0] == 1 ? "write to " : "read from ") + tlog1 << "Attempt to " << (einfo->ExceptionInformation[0] == 1 ? "write to " : "read from ") << "0x" << std::setw(8) << (void*)einfo->ExceptionInformation[1] << std::endl;; } const DWORD threadId = ::GetCurrentThreadId(); @@ -120,7 +122,7 @@ //create file where dump will be placed char *mname = NULL; char buffer[MAX_PATH + 1]; - HMODULE hModule = NULL; + HMODULE hModule = NULL; GetModuleFileNameA(hModule, buffer, MAX_PATH); mname = strrchr(buffer, '\\'); if (mname != 0) @@ -136,6 +138,7 @@ return EXCEPTION_EXECUTE_HANDLER; } #endif +#endif void CConsoleHandler::setColor(int level) @@ -216,8 +219,10 @@ GetConsoleScreenBufferInfo(handleOut,&csbi); defColor = csbi.wAttributes; #ifndef _DEBUG +#ifndef __MINGW32__ SetUnhandledExceptionFilter(onUnhandledException); #endif +#endif #else defColor = "\x1b[0m"; #endif @@ -233,7 +238,7 @@ } void CConsoleHandler::end() { - if (thread) + if (thread) { #ifndef _WIN32 thread->interrupt(); Index: lib/CThreadHelper.cpp =================================================================== --- lib/CThreadHelper.cpp (revision 2878) +++ lib/CThreadHelper.cpp (working copy) @@ -35,7 +35,7 @@ while(true) { { - boost::unique_lock<boost::mutex> lock(rtinm); + boost::unique_lock<boost::mutex> lock(rtinm); if((pom = currentTask) >= amount) break; else @@ -50,6 +50,7 @@ void setThreadName(const std::string &name) { #ifdef _WIN32 +#ifndef __GNUC__ //follows http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx const DWORD MS_VC_EXCEPTION=0x406D1388; #pragma pack(push,8) @@ -67,6 +68,7 @@ info.dwThreadID = -1; info.dwFlags = 0; + __try { RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info ); @@ -75,6 +77,10 @@ { } #else +//not supported +#endif + +#else prctl(PR_SET_NAME, name.c_str(), 0, 0, 0); #endif -} \ No newline at end of file +} Index: lib/NetPacks.h =================================================================== --- lib/NetPacks.h (revision 2878) +++ lib/NetPacks.h (working copy) @@ -48,7 +48,7 @@ { tlog1 << "CPack serialized... this should not happen!\n"; } - DLL_LINKAGE void applyGs(CGameState *gs) + void applyGs(CGameState *gs) {}; }; @@ -60,7 +60,7 @@ void applyFirstCl(CClient *cl)//called before applying to gs {}; void applyCl(CClient *cl)//called after applying to gs - {}; + {}; }; struct CPackForServer : public CPack @@ -70,7 +70,7 @@ CGameState* GS(CGameHandler *gh); CPackForServer() { - type = 2; + type = 2; c = NULL; player = 255; }; @@ -82,7 +82,7 @@ struct Query : public CPackForClient { ui32 queryID; // equals to -1 if it is not an actual query (and should not be answered) - + Query() { queryID = -1; @@ -95,7 +95,7 @@ private: enum EMessage {TEXACT_STRING, TLOCAL_STRING, TNUMBER, TREPLACE_ESTRING, TREPLACE_LSTRING, TREPLACE_NUMBER, TREPLACE_PLUSNUMBER}; public: - enum {GENERAL_TXT=1, XTRAINFO_TXT, OBJ_NAMES, RES_NAMES, ART_NAMES, ARRAY_TXT, CRE_PL_NAMES, CREGENS, MINE_NAMES, + enum {GENERAL_TXT=1, XTRAINFO_TXT, OBJ_NAMES, RES_NAMES, ART_NAMES, ARRAY_TXT, CRE_PL_NAMES, CREGENS, MINE_NAMES, MINE_EVNTS, ADVOB_TXT, ART_EVNTS, SPELL_NAME, SEC_SKILL_NAME, CRE_SING_NAMES, CREGENS4, COLOR, ART_DESCR}; std::vector<ui8> message; //vector of EMessage @@ -169,7 +169,7 @@ { type = 2001; } -}; +}; struct StackLocation { @@ -276,16 +276,16 @@ { h & player & resid & val; } -}; +}; struct SetResources : public CPackForClient //104 { SetResources(){type = 104;}; void applyCl(CClient *cl); DLL_LINKAGE void applyGs(CGameState *gs); - + ui8 player; TResources res; //res[resid] => res amount - + template <typename Handler> void serialize(Handler &h, const int version) { h & player & res; @@ -307,7 +307,7 @@ { h & abs & id & which & val; } -}; +}; struct SetSecSkill : public CPackForClient //106 { SetSecSkill(){type = 106;}; @@ -344,7 +344,7 @@ { h & flags & tid & hid; } -}; +}; struct ChangeSpells : public CPackForClient //109 { ChangeSpells(){type = 109;}; @@ -359,7 +359,7 @@ { h & learn & hid & spells; } -}; +}; struct SetMana : public CPackForClient //110 { @@ -402,7 +402,7 @@ { h & tiles & player & mode; } -}; +}; struct SetAvailableHeroes : public CPackForClient //113 { @@ -431,7 +431,7 @@ { GiveBonus(ui8 Who = 0) { - who = Who; + who = Who; type = 115; } @@ -454,7 +454,7 @@ { ChangeObjPos() { - type = 116; + type = 116; flags = 0; } void applyFirstCl(CClient *cl); @@ -495,7 +495,7 @@ { RemoveBonus(ui8 Who = 0) { - who = Who; + who = Who; type = 118; } @@ -584,7 +584,7 @@ { h & id; } -}; +}; struct TryMoveHero : public CPackForClient //501 { TryMoveHero(){type = 501;humanKnows=false; attackedFrom = int3(-1, -1, -1);}; @@ -616,24 +616,24 @@ // SetGarrisons(){type = 502;}; // void applyCl(CClient *cl); // DLL_LINKAGE void applyGs(CGameState *gs); -// +// // std::map<ui32,CCreatureSet> garrs; -// +// // template <typename Handler> void serialize(Handler &h, const int version) // { // h & garrs; // } -// }; +// }; struct NewStructures : public CPackForClient //504 { NewStructures(){type = 504;}; void applyCl(CClient *cl); - DLL_LINKAGE virtual void applyGs(CGameState *gs); + DLL_LINKAGE void applyGs(CGameState *gs); si32 tid; std::set<si32> bid; - si16 builded; + si16 builded; template <typename Handler> void serialize(Handler &h, const int version) { @@ -648,7 +648,7 @@ si32 tid; std::set<si32> bid; - si16 destroyed; + si16 destroyed; template <typename Handler> void serialize(Handler &h, const int version) { @@ -668,7 +668,7 @@ { h & tid & creatures; } -}; +}; struct SetHeroesInTown : public CPackForClient //508 { SetHeroesInTown(){type = 508;}; @@ -689,19 +689,19 @@ // void applyCl(CClient *cl); // DLL_LINKAGE void applyGs(CGameState *gs); // DLL_LINKAGE void setArtAtPos(ui16 pos, const CArtifact* art); -// +// // si32 hid; // std::vector<const CArtifact*> artifacts; //hero's artifacts from bag // std::map<ui16, const CArtifact*> artifWorn; //map<position,artifact_id>; positions: 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 -// +// // template <typename Handler> void serialize(Handler &h, const int version) // { // h & hid & artifacts & artifWorn; // } -// +// // std::vector<const CArtifact*> equipped, unequipped; //used locally // BonusList gained, lost; //used locally as hlp when applying -// }; +// }; struct HeroRecruited : public CPackForClient //515 { @@ -717,7 +717,7 @@ { h & hid & tid & tile & player; } -}; +}; struct GiveHero : public CPackForClient //516 { @@ -733,7 +733,7 @@ { h & id & player; } -}; +}; struct OpenWindow : public CPackForClient //517 { @@ -1072,7 +1072,7 @@ { h & heroes & cres & res & day & resetBuilded & specialWeek & creatureid; } -}; +}; struct Component : public CPack //2002 helper for object scrips informations { @@ -1110,10 +1110,10 @@ { h & text & components & player & soundID; } - InfoWindow() - { + InfoWindow() + { type = 103; - soundID = 0; + soundID = 0; } }; @@ -1134,7 +1134,7 @@ ui32 val; SetObjectProperty(){type = 1001;}; SetObjectProperty(ui32 ID, ui8 What, ui32 Val):id(ID),what(What),val(Val){type = 1001;}; - + template <typename Handler> void serialize(Handler &h, const int version) { h & id & what & val; @@ -1149,7 +1149,7 @@ MetaString name; SetHoverName(){type = 1002;}; SetHoverName(ui32 ID, MetaString& Name):id(ID),name(Name){type = 1002;}; - + template <typename Handler> void serialize(Handler &h, const int version) { h & id & name; @@ -1165,7 +1165,7 @@ std::vector<ui16> skills; HeroLevelUp(){type = 2000;}; - + template <typename Handler> void serialize(Handler &h, const int version) { h & queryID & heroid & primskill & level & skills; @@ -1273,14 +1273,14 @@ BattleInfo * info; - + template <typename Handler> void serialize(Handler &h, const int version) { h & info; } }; struct BattleNextRound : public CPackForClient//3001 -{ +{ BattleNextRound(){type = 3001;}; void applyFirstCl(CClient *cl); void applyCl(CClient *cl); @@ -1874,7 +1874,7 @@ { GarrisonHeroSwap(){}; GarrisonHeroSwap(si32 TID):tid(TID){}; - si32 tid; + si32 tid; bool applyGh(CGameHandler *gh); template <typename Handler> void serialize(Handler &h, const int version) @@ -1971,7 +1971,7 @@ } }; -struct BuildBoat : public CPackForServer +struct BuildBoat : public CPackForServer { BuildBoat(){}; si32 objid; //where player wants to buy a boat @@ -2084,7 +2084,7 @@ { h & text & player; } -}; +}; struct SetSelection : public CPackForClient, public CPackForServer //514 @@ -2241,7 +2241,7 @@ { enum {TOWN, HERO, BONUS}; ui8 what; - si8 direction; //-1 or +1 + si8 direction; //-1 or +1 ui8 playerID; RequestOptionsChange(ui8 What, si8 Dir, ui8 Player) Index: lib/ResourceSet.h =================================================================== --- lib/ResourceSet.h (revision 2878) +++ lib/ResourceSet.h (working copy) @@ -10,7 +10,7 @@ class ResourceSet; bool canAfford(const ResourceSet &res, const ResourceSet &price); //can a be used to pay price b - enum ERes + enum ERes { WOOD = 0, MERCURY, ORE, SULFUR, CRYSTAL, GEMS, GOLD, MITHRIL }; @@ -25,7 +25,7 @@ #define scalarOperator(OPSIGN) \ - DLL_LINKAGE ResourceSet operator OPSIGN(const TResource &rhs) const \ + ResourceSet operator OPSIGN(const TResource &rhs) const \ { \ ResourceSet ret = *this; \ for(int i = 0; i < size(); i++) \ @@ -37,7 +37,7 @@ #define vectorOperator(OPSIGN) \ - DLL_LINKAGE ResourceSet operator OPSIGN(const ResourceSet &rhs) const \ + ResourceSet operator OPSIGN(const ResourceSet &rhs) const \ { \ ResourceSet ret = *this; \ for(int i = 0; i < size(); i++) \ @@ -48,7 +48,7 @@ #define opEqOperator(OPSIGN, RHS_TYPE) \ - DLL_LINKAGE ResourceSet& operator OPSIGN ## =(const RHS_TYPE &rhs) \ + ResourceSet& operator OPSIGN ## =(const RHS_TYPE &rhs) \ { \ return *this = *this OPSIGN rhs; \ } @@ -70,7 +70,7 @@ #undef opEqOperator //to be used for calculations of type "how many units of sth can I afford?" - DLL_LINKAGE int operator/(const ResourceSet &rhs) + int operator/(const ResourceSet &rhs) { int ret = INT_MAX; for(int i = 0; i < size(); i++) @@ -80,7 +80,7 @@ return ret; } - DLL_LINKAGE ResourceSet & operator=(const TResource &rhs) + ResourceSet & operator=(const TResource &rhs) { for(int i = 0; i < size(); i++) at(i) = rhs; @@ -88,14 +88,14 @@ return *this; } - // WARNING: comparison operators are used for "can afford" relation: a <= b means that foreach i a[i] <= b[i] + // WARNING: comparison operators are used for "can afford" relation: a <= b means that foreach i a[i] <= b[i] // that doesn't work the other way: a > b doesn't mean that a cannot be afforded with b, it's still b can afford a // bool operator<(const ResourceSet &rhs) // { // for(int i = 0; i < size(); i++) // if(at(i) >= rhs[i]) // return false; -// +// // return true; // } @@ -118,7 +118,7 @@ } cur; const ResourceSet &rs; void advance(); - + public: nziterator(const ResourceSet &RS); bool valid(); @@ -126,7 +126,7 @@ nziterator operator++(int); const ResEntry& operator*() const; const ResEntry* operator->() const; - + }; }; } Index: Scripting/ERM =================================================================== --- Scripting/ERM (revision 2878) +++ Scripting/ERM (working copy) Property changes on: Scripting/ERM ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,5 ## +bin +obj +*.depend +*.layout +*_build_log.html Index: Scripting/ERM/ERM.cbp =================================================================== --- Scripting/ERM/ERM.cbp (revision 0) +++ Scripting/ERM/ERM.cbp (working copy) @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="ERM" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\ERM" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\ERM" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="..\..\bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-O1" /> + <Add option="-O" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + </Compiler> + <Linker> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="ERMInterpreter.cpp" /> + <Unit filename="ERMInterpreter.h" /> + <Unit filename="ERMParser.cpp" /> + <Unit filename="ERMParser.h" /> + <Unit filename="ERMScriptModule.cpp" /> + <Unit filename="ERMScriptModule.h" /> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: vcmi.workspace =================================================================== --- vcmi.workspace (revision 0) +++ vcmi.workspace (working copy) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_workspace_file> + <Workspace title="vcmi"> + <Project filename="VCMI_lib.cbp" /> + <Project filename="VCMI_client.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="VCMI_server.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="AI/FuzzyLite/FuzzyLite.cbp" /> + <Project filename="AI/EmptyAI/EmptyAI.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="AI/VCAI/VCAI.cbp"> + <Depends filename="VCMI_lib.cbp" /> + <Depends filename="AI/FuzzyLite/FuzzyLite.cbp" /> + </Project> + <Project filename="AI/StupidAI/StupidAI.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="Scripting/ERM/ERM.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + </Workspace> +</CodeBlocks_workspace_file> Index: VCMI_client.cbp =================================================================== --- VCMI_client.cbp (revision 0) +++ VCMI_client.cbp (working copy) @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCMI_client" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\VCMI_client" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + <Linker> + <Add directory="bin\Debug" /> + <Add directory="d:\projects\vcmi\3rdparty\SDL-1.2.15\lib" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\VCMI_client" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-fpermissive" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-DBOOST_SYSTEM_NO_DEPRECATED" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + <Add option="-DBOOST_THREAD_VERSION=3" /> + <Add directory="client" /> + <Add directory="..\include" /> + </Compiler> + <Linker> + <Add option="-lole32" /> + <Add option="-loleaut32" /> + <Add option="-lws2_32" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lSDL" /> + <Add option="-lSDL_image" /> + <Add option="-lSDL_mixer" /> + <Add option="-lSDL_ttf" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="CCallback.cpp" /> + <Unit filename="CCallback.h" /> + <Unit filename="client\AdventureMapClasses.cpp" /> + <Unit filename="client\AdventureMapClasses.h" /> + <Unit filename="client\BattleInterface\CBattleAnimations.cpp" /> + <Unit filename="client\BattleInterface\CBattleAnimations.h" /> + <Unit filename="client\BattleInterface\CBattleInterface.cpp" /> + <Unit filename="client\BattleInterface\CBattleInterface.h" /> + <Unit filename="client\BattleInterface\CBattleInterfaceClasses.cpp" /> + <Unit filename="client\BattleInterface\CBattleInterfaceClasses.h" /> + <Unit filename="client\BattleInterface\CCreatureAnimation.cpp" /> + <Unit filename="client\BattleInterface\CCreatureAnimation.h" /> + <Unit filename="client\CAdvmapInterface.cpp" /> + <Unit filename="client\CAdvmapInterface.h" /> + <Unit filename="client\CAnimation.cpp" /> + <Unit filename="client\CAnimation.h" /> + <Unit filename="client\CBitmapHandler.cpp" /> + <Unit filename="client\CBitmapHandler.h" /> + <Unit filename="client\CCastleInterface.cpp" /> + <Unit filename="client\CCastleInterface.h" /> + <Unit filename="client\CConfigHandler.cpp" /> + <Unit filename="client\CConfigHandler.h" /> + <Unit filename="client\CCreatureWindow.cpp" /> + <Unit filename="client\CCreatureWindow.h" /> + <Unit filename="client\CDefHandler.cpp" /> + <Unit filename="client\CDefHandler.h" /> + <Unit filename="client\CGameInfo.cpp" /> + <Unit filename="client\CGameInfo.h" /> + <Unit filename="client\CHeroWindow.cpp" /> + <Unit filename="client\CHeroWindow.h" /> + <Unit filename="client\CKingdomInterface.cpp" /> + <Unit filename="client\CKingdomInterface.h" /> + <Unit filename="client\CMT.cpp" /> + <Unit filename="client\CMessage.cpp" /> + <Unit filename="client\CMessage.h" /> + <Unit filename="client\CMusicHandler.cpp" /> + <Unit filename="client\CMusicHandler.h" /> + <Unit filename="client\CPlayerInterface.cpp" /> + <Unit filename="client\CPlayerInterface.h" /> + <Unit filename="client\CPreGame.cpp" /> + <Unit filename="client\CPreGame.h" /> + <Unit filename="client\CQuestLog.cpp" /> + <Unit filename="client\CQuestLog.h" /> + <Unit filename="client\CSoundBase.h" /> + <Unit filename="client\CSpellWindow.cpp" /> + <Unit filename="client\CSpellWindow.h" /> + <Unit filename="client\CVideoHandler.cpp" /> + <Unit filename="client\CVideoHandler.h" /> + <Unit filename="client\Client.cpp" /> + <Unit filename="client\Client.h" /> + <Unit filename="client\FontBase.h" /> + <Unit filename="client\FunctionList.h" /> + <Unit filename="client\GUIClasses.cpp" /> + <Unit filename="client\GUIClasses.h" /> + <Unit filename="client\Graphics.cpp" /> + <Unit filename="client\Graphics.h" /> + <Unit filename="client\NetPacksClient.cpp" /> + <Unit filename="client\StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="client\UIFramework\CCursorHandler.cpp" /> + <Unit filename="client\UIFramework\CCursorHandler.h" /> + <Unit filename="client\UIFramework\CGuiHandler.cpp" /> + <Unit filename="client\UIFramework\CGuiHandler.h" /> + <Unit filename="client\UIFramework\CIntObject.cpp" /> + <Unit filename="client\UIFramework\CIntObject.h" /> + <Unit filename="client\UIFramework\CIntObjectClasses.cpp" /> + <Unit filename="client\UIFramework\CIntObjectClasses.h" /> + <Unit filename="client\UIFramework\Geometries.cpp" /> + <Unit filename="client\UIFramework\Geometries.h" /> + <Unit filename="client\UIFramework\SDL_Extensions.cpp" /> + <Unit filename="client\UIFramework\SDL_Extensions.h" /> + <Unit filename="client\UIFramework\SDL_Pixels.h" /> + <Unit filename="client\VCMI_client.rc"> + <Option compilerVar="WINDRES" /> + </Unit> + <Unit filename="client\mapHandler.cpp" /> + <Unit filename="client\mapHandler.h" /> + <Unit filename="client\resource.h" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + <DoxyBlocks> + <comment_style block="0" line="0" /> + <doxyfile_project /> + <doxyfile_build /> + <doxyfile_warnings /> + <doxyfile_output /> + <doxyfile_dot /> + <general /> + </DoxyBlocks> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: VCMI_lib.cbp =================================================================== --- VCMI_lib.cbp (revision 0) +++ VCMI_lib.cbp (working copy) @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCMI_lib" /> + <Option execution_dir="D:\projects\vcmi\engine\VCMI_lib\" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option platforms="Windows;" /> + <Option output="bin\Debug\VCMI_lib" prefix_auto="0" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-O1" /> + <Add option="-O" /> + </Compiler> + </Target> + <Target title="Release"> + <Option platforms="Windows;" /> + <Option output="bin\Release\VCMI_lib" prefix_auto="0" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-DVCMI_DLL" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + <Add option="-DBOOST_THREAD_VERSION=3" /> + <Add directory="d:\projects\vcmi\engine\" /> + <Add directory="lib" /> + <Add directory="..\include" /> + </Compiler> + <Linker> + <Add option="-lws2_32" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add library="D:\MinGW\lib\libz.a" /> + </Linker> + <Unit filename="Global.h" /> + <Unit filename="lib\AI_Base.h" /> + <Unit filename="lib\BattleAction.cpp" /> + <Unit filename="lib\BattleAction.h" /> + <Unit filename="lib\BattleHex.cpp" /> + <Unit filename="lib\BattleHex.h" /> + <Unit filename="lib\BattleState.cpp" /> + <Unit filename="lib\BattleState.h" /> + <Unit filename="lib\CArtHandler.cpp" /> + <Unit filename="lib\CArtHandler.h" /> + <Unit filename="lib\CBattleCallback.cpp" /> + <Unit filename="lib\CBattleCallback.h" /> + <Unit filename="lib\CBuildingHandler.cpp" /> + <Unit filename="lib\CBuildingHandler.h" /> + <Unit filename="lib\CCampaignHandler.cpp" /> + <Unit filename="lib\CCampaignHandler.h" /> + <Unit filename="lib\CConsoleHandler.cpp" /> + <Unit filename="lib\CConsoleHandler.h" /> + <Unit filename="lib\CCreatureHandler.cpp" /> + <Unit filename="lib\CCreatureHandler.h" /> + <Unit filename="lib\CCreatureSet.cpp" /> + <Unit filename="lib\CCreatureSet.h" /> + <Unit filename="lib\CDefObjInfoHandler.cpp" /> + <Unit filename="lib\CDefObjInfoHandler.h" /> + <Unit filename="lib\CGameInterface.cpp" /> + <Unit filename="lib\CGameInterface.h" /> + <Unit filename="lib\CGameState.cpp" /> + <Unit filename="lib\CGameState.h" /> + <Unit filename="lib\CGeneralTextHandler.cpp" /> + <Unit filename="lib\CGeneralTextHandler.h" /> + <Unit filename="lib\CHeroHandler.cpp" /> + <Unit filename="lib\CHeroHandler.h" /> + <Unit filename="lib\CLogger.cpp" /> + <Unit filename="lib\CLogger.h" /> + <Unit filename="lib\CMapInfo.cpp" /> + <Unit filename="lib\CMapInfo.h" /> + <Unit filename="lib\CModHandler.cpp" /> + <Unit filename="lib\CModHandler.h" /> + <Unit filename="lib\CObjectHandler.cpp" /> + <Unit filename="lib\CObjectHandler.h" /> + <Unit filename="lib\CObstacleInstance.cpp" /> + <Unit filename="lib\CObstacleInstance.h" /> + <Unit filename="lib\CScriptingModule.h" /> + <Unit filename="lib\CSpellHandler.cpp" /> + <Unit filename="lib\CSpellHandler.h" /> + <Unit filename="lib\CStopWatch.h" /> + <Unit filename="lib\CThreadHelper.cpp" /> + <Unit filename="lib\CThreadHelper.h" /> + <Unit filename="lib\CTownHandler.cpp" /> + <Unit filename="lib\CTownHandler.h" /> + <Unit filename="lib\CondSh.h" /> + <Unit filename="lib\Connection.cpp" /> + <Unit filename="lib\Connection.h" /> + <Unit filename="lib\ConstTransitivePtr.h" /> + <Unit filename="lib\Filesystem\CBinaryReader.cpp" /> + <Unit filename="lib\Filesystem\CBinaryReader.h" /> + <Unit filename="lib\Filesystem\CCompressedStream.cpp" /> + <Unit filename="lib\Filesystem\CCompressedStream.h" /> + <Unit filename="lib\Filesystem\CFileInfo.cpp" /> + <Unit filename="lib\Filesystem\CFileInfo.h" /> + <Unit filename="lib\Filesystem\CFileInputStream.cpp" /> + <Unit filename="lib\Filesystem\CFileInputStream.h" /> + <Unit filename="lib\Filesystem\CFilesystemLoader.cpp" /> + <Unit filename="lib\Filesystem\CFilesystemLoader.h" /> + <Unit filename="lib\Filesystem\CInputStream.h" /> + <Unit filename="lib\Filesystem\CLodArchiveLoader.cpp" /> + <Unit filename="lib\Filesystem\CLodArchiveLoader.h" /> + <Unit filename="lib\Filesystem\CMemoryStream.cpp" /> + <Unit filename="lib\Filesystem\CMemoryStream.h" /> + <Unit filename="lib\Filesystem\CResourceLoader.cpp" /> + <Unit filename="lib\Filesystem\CResourceLoader.h" /> + <Unit filename="lib\Filesystem\ISimpleResourceLoader.h" /> + <Unit filename="lib\GameConstants.h" /> + <Unit filename="lib\HeroBonus.cpp" /> + <Unit filename="lib\HeroBonus.h" /> + <Unit filename="lib\IGameCallback.cpp" /> + <Unit filename="lib\IGameCallback.h" /> + <Unit filename="lib\IGameEventsReceiver.h" /> + <Unit filename="lib\Interprocess.h" /> + <Unit filename="lib\JsonNode.cpp" /> + <Unit filename="lib\JsonNode.h" /> + <Unit filename="lib\NetPacks.h" /> + <Unit filename="lib\NetPacksLib.cpp" /> + <Unit filename="lib\RegisterTypes.h" /> + <Unit filename="lib\ResourceSet.cpp" /> + <Unit filename="lib\ResourceSet.h" /> + <Unit filename="lib\StartInfo.h" /> + <Unit filename="lib\StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="lib\UnlockGuard.h" /> + <Unit filename="lib\VCMIDirs.h" /> + <Unit filename="lib\VCMI_Lib.cpp" /> + <Unit filename="lib\VCMI_Lib.h" /> + <Unit filename="lib\int3.h" /> + <Unit filename="lib\map.cpp" /> + <Unit filename="lib\map.h" /> + <Unit filename="lib\vcmi_endian.h" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: VCMI_server.cbp =================================================================== --- VCMI_server.cbp (revision 0) +++ VCMI_server.cbp (working copy) @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCMI_server" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\VCMI_server" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Option use_console_runner="0" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\VCMI_server" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-DBOOST_THREAD_VERSION=3" /> + </Compiler> + <Linker> + <Add option="-lole32" /> + <Add option="-loleaut32" /> + <Add option="-lws2_32" /> + <Add option="-lmswsock" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="server\CGameHandler.cpp" /> + <Unit filename="server\CGameHandler.h" /> + <Unit filename="server\CVCMIServer.cpp" /> + <Unit filename="server\CVCMIServer.h" /> + <Unit filename="server\NetPacksServer.cpp" /> + <Unit filename="server\StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + <DoxyBlocks> + <comment_style block="0" line="0" /> + <doxyfile_project /> + <doxyfile_build /> + <doxyfile_warnings /> + <doxyfile_output /> + <doxyfile_dot /> + <general /> + </DoxyBlocks> + </Extensions> + </Project> +</CodeBlocks_project_file> mingw_codeblocks2.patch [^] (103,803 bytes) 2012-09-14 08:23 [Show Content] [Hide Content] Index: . =================================================================== --- . (revision 2878) +++ . (working copy) Property changes on: . ___________________________________________________________________ Modified: svn:ignore ## -5,3 +5,9 ## Heroes3.snd MP3 Maps +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI =================================================================== --- AI (revision 2878) +++ AI (working copy) Property changes on: AI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/EmptyAI =================================================================== --- AI/EmptyAI (revision 2878) +++ AI/EmptyAI (working copy) Property changes on: AI/EmptyAI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/EmptyAI/EmptyAI.cbp =================================================================== --- AI/EmptyAI/EmptyAI.cbp (revision 0) +++ AI/EmptyAI/EmptyAI.cbp (working copy) @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="EmptyAI" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\EmptyAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\EmptyAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="..\..\bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-fpermissive" /> + </Compiler> + <Linker> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="CEmptyAI.cpp" /> + <Unit filename="CEmptyAI.h" /> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="exp_funcs.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: AI/EmptyAI/exp_funcs.cpp =================================================================== --- AI/EmptyAI/exp_funcs.cpp (revision 2878) +++ AI/EmptyAI/exp_funcs.cpp (working copy) @@ -3,27 +3,27 @@ #include "CEmptyAI.h" std::set<CGlobalAI*> ais; -extern "C" DLL_LINKAGE int GetGlobalAiVersion() +extern "C" DLL_EXPORT int GetGlobalAiVersion() { return AI_INTERFACE_VER; } -extern "C" DLL_LINKAGE void GetAiName(char* name) +extern "C" DLL_EXPORT void GetAiName(char* name) { strcpy(name,NAME); } -extern "C" DLL_LINKAGE char * GetAiNameS() +extern "C" DLL_EXPORT char * GetAiNameS() { char * ret = new char[50]; strcpy(ret,NAME); return ret; } -extern "C" DLL_LINKAGE CGlobalAI * GetNewAI() +extern "C" DLL_EXPORT CGlobalAI * GetNewAI() { return new CEmptyAI(); // return } -extern "C" DLL_LINKAGE void ReleaseAI(CGlobalAI * i) +extern "C" DLL_EXPORT void ReleaseAI(CGlobalAI * i) { delete (CEmptyAI*)i; ais.erase(i); Index: AI/FuzzyLite =================================================================== --- AI/FuzzyLite (revision 2878) +++ AI/FuzzyLite (working copy) Property changes on: AI/FuzzyLite ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/FuzzyLite/FuzzyLite.cbp =================================================================== --- AI/FuzzyLite/FuzzyLite.cbp (revision 0) +++ AI/FuzzyLite/FuzzyLite.cbp (working copy) @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="FuzzyLite" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\FuzzyLite" prefix_auto="1" extension_auto="1" /> + <Option working_dir="" /> + <Option object_output="obj\Debug\" /> + <Option type="2" /> + <Option compiler="gcc" /> + <Option createDefFile="1" /> + <Compiler> + <Add option="-g" /> + </Compiler> + </Target> + <Target title="Release"> + <Option output="bin\Release\FuzzyLite" prefix_auto="1" extension_auto="1" /> + <Option working_dir="" /> + <Option object_output="obj\Release\" /> + <Option type="2" /> + <Option compiler="gcc" /> + <Option createDefFile="1" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + </Compiler> + <Unit filename="AreaCentroidAlgorithm.cpp" /> + <Unit filename="AreaCentroidAlgorithm.h" /> + <Unit filename="CompoundTerm.cpp" /> + <Unit filename="CompoundTerm.h" /> + <Unit filename="DescriptiveAntecedent.cpp" /> + <Unit filename="DescriptiveAntecedent.h" /> + <Unit filename="DiscreteTerm.cpp" /> + <Unit filename="DiscreteTerm.h" /> + <Unit filename="FunctionTerm.cpp" /> + <Unit filename="FunctionTerm.h" /> + <Unit filename="FuzzyAnd.cpp" /> + <Unit filename="FuzzyAnd.h" /> + <Unit filename="FuzzyAntecedent.cpp" /> + <Unit filename="FuzzyAntecedent.h" /> + <Unit filename="FuzzyConsequent.cpp" /> + <Unit filename="FuzzyConsequent.h" /> + <Unit filename="FuzzyDefuzzifier.cpp" /> + <Unit filename="FuzzyDefuzzifier.h" /> + <Unit filename="FuzzyEngine.cpp" /> + <Unit filename="FuzzyEngine.h" /> + <Unit filename="FuzzyException.cpp" /> + <Unit filename="FuzzyException.h" /> + <Unit filename="FuzzyExceptions.cpp" /> + <Unit filename="FuzzyExceptions.h" /> + <Unit filename="FuzzyLite.h" /> + <Unit filename="FuzzyModulation.cpp" /> + <Unit filename="FuzzyModulation.h" /> + <Unit filename="FuzzyOperation.cpp" /> + <Unit filename="FuzzyOperation.h" /> + <Unit filename="FuzzyOperator.cpp" /> + <Unit filename="FuzzyOperator.h" /> + <Unit filename="FuzzyOr.cpp" /> + <Unit filename="FuzzyOr.h" /> + <Unit filename="FuzzyRule.cpp" /> + <Unit filename="FuzzyRule.h" /> + <Unit filename="Hedge.cpp" /> + <Unit filename="Hedge.h" /> + <Unit filename="HedgeSet.cpp" /> + <Unit filename="HedgeSet.h" /> + <Unit filename="InfixToPostfix.cpp" /> + <Unit filename="InfixToPostfix.h" /> + <Unit filename="InputLVar.cpp" /> + <Unit filename="InputLVar.h" /> + <Unit filename="LinguisticTerm.cpp" /> + <Unit filename="LinguisticTerm.h" /> + <Unit filename="LinguisticVariable.cpp" /> + <Unit filename="LinguisticVariable.h" /> + <Unit filename="MamdaniConsequent.cpp" /> + <Unit filename="MamdaniConsequent.h" /> + <Unit filename="MamdaniRule.cpp" /> + <Unit filename="MamdaniRule.h" /> + <Unit filename="OutputLVar.cpp" /> + <Unit filename="OutputLVar.h" /> + <Unit filename="RectangularTerm.cpp" /> + <Unit filename="RectangularTerm.h" /> + <Unit filename="RuleBlock.cpp" /> + <Unit filename="RuleBlock.h" /> + <Unit filename="ShoulderTerm.cpp" /> + <Unit filename="ShoulderTerm.h" /> + <Unit filename="SingletonTerm.cpp" /> + <Unit filename="SingletonTerm.h" /> + <Unit filename="StrOp.cpp" /> + <Unit filename="StrOp.h" /> + <Unit filename="TakagiSugenoConsequent.cpp" /> + <Unit filename="TakagiSugenoConsequent.h" /> + <Unit filename="TakagiSugenoRule.cpp" /> + <Unit filename="TakagiSugenoRule.h" /> + <Unit filename="TakagiSugenoTerm.cpp" /> + <Unit filename="TakagiSugenoTerm.h" /> + <Unit filename="TrapezoidalTerm.cpp" /> + <Unit filename="TrapezoidalTerm.h" /> + <Unit filename="TriangularTerm.cpp" /> + <Unit filename="TriangularTerm.h" /> + <Unit filename="defs.h" /> + <Unit filename="flScalar.h" /> + <Unit filename="main.cpp" /> + <Unit filename="test.h" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: AI/StupidAI =================================================================== --- AI/StupidAI (revision 2878) +++ AI/StupidAI (working copy) Property changes on: AI/StupidAI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/StupidAI/StupidAI.cbp =================================================================== --- AI/StupidAI/StupidAI.cbp (revision 0) +++ AI/StupidAI/StupidAI.cbp (working copy) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="StupidAI" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\StupidAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\StupidAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="..\..\bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-pedantic" /> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + </Compiler> + <Linker> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="StupidAI.cpp" /> + <Unit filename="StupidAI.h" /> + <Unit filename="main.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: AI/VCAI =================================================================== --- AI/VCAI (revision 2878) +++ AI/VCAI (working copy) Property changes on: AI/VCAI ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,6 ## +bin +obj +*.gch +*.layout +*.depend +*_build_log.html Index: AI/VCAI/VCAI.cbp =================================================================== --- AI/VCAI/VCAI.cbp (revision 0) +++ AI/VCAI/VCAI.cbp (working copy) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCAI" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\VCAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + <Add directory="..\FuzzyLite\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\VCAI" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="..\..\bin\Release" /> + <Add directory="..\FuzzyLite\bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-pedantic" /> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + </Compiler> + <Linker> + <Add option="-lFuzzyLite" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="Fuzzy.cpp" /> + <Unit filename="Fuzzy.h" /> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="VCAI.cpp" /> + <Unit filename="VCAI.h" /> + <Unit filename="main.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: client =================================================================== --- client (revision 2878) +++ client (working copy) Property changes on: client ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +*.gch Index: client/BattleInterface/CBattleAnimations.cpp =================================================================== --- client/BattleInterface/CBattleAnimations.cpp (revision 2878) +++ client/BattleInterface/CBattleAnimations.cpp (working copy) @@ -1,4 +1,4 @@ -#include "StdInc.h" +#include "../StdInc.h" #include "CBattleAnimations.h" #include <boost/math/constants/constants.hpp> @@ -17,7 +17,7 @@ CBattleAnimation::CBattleAnimation(CBattleInterface * _owner) -: owner(_owner), ID(_owner->animIDhelper++) +: owner(_owner), ID(_owner->animIDhelper++) {} void CBattleAnimation::endAnim() @@ -60,7 +60,7 @@ } CBattleStackAnimation::CBattleStackAnimation(CBattleInterface * _owner, const CStack * _stack) -: CBattleAnimation(_owner), stack(_stack) +: CBattleAnimation(_owner), stack(_stack) {} bool CBattleStackAnimation::isToReverseHlp(BattleHex hexFrom, BattleHex hexTo, bool curDir) @@ -140,7 +140,7 @@ { assert(attackingStack && "attackingStack is NULL in CBattleAttack::CBattleAttack !\n"); - bool isCatapultAttack = attackingStack->hasBonusOfType(Bonus::CATAPULT) + bool isCatapultAttack = attackingStack->hasBonusOfType(Bonus::CATAPULT) && owner->curInt->cb->battleHexToWallPart(_dest) >= 0; assert(attackedStack || isCatapultAttack); @@ -150,7 +150,7 @@ CDefenceAnimation::CDefenceAnimation(StackAttackedInfo _attackedInfo, CBattleInterface * _owner) : CBattleStackAnimation(_owner, _attackedInfo.defender), dmg(_attackedInfo.dmg), amountKilled(_attackedInfo.amountKilled), attacker(_attackedInfo.attacker), byShooting(_attackedInfo.byShooting), -killed(_attackedInfo.killed) +killed(_attackedInfo.killed) {} bool CDefenceAnimation::init() @@ -205,7 +205,7 @@ //unit reversed if(byShooting) //delay hit animation - { + { for(std::list<ProjectileInfo>::const_iterator it = owner->projectiles.begin(); it != owner->projectiles.end(); ++it) { if(it->creID == attacker->getCreature()->idNumber) @@ -273,8 +273,8 @@ delete this; } -CDummyAnimation::CDummyAnimation(CBattleInterface * _owner, int howManyFrames) -: CBattleAnimation(_owner), counter(0), howMany(howManyFrames) +CDummyAnimation::CDummyAnimation(CBattleInterface * _owner, int howManyFrames) +: CBattleAnimation(_owner), counter(0), howMany(howManyFrames) {} bool CDummyAnimation::init() @@ -309,7 +309,7 @@ if(!attackingStack || myAnim()->getType() == 5) { endAnim(); - + return false; } @@ -360,7 +360,7 @@ } CMeleeAttackAnimation::CMeleeAttackAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked) -: CAttackAnimation(_owner, attacker, _dest, _attacked) +: CAttackAnimation(_owner, attacker, _dest, _attacked) {} void CMeleeAttackAnimation::nextFrame() @@ -435,7 +435,7 @@ //step shift calculation posX = myAnim()->pos.x, posY = myAnim()->pos.y; // for precise calculations ;] - if(mutPos == -1 && movedStack->hasBonusOfType(Bonus::FLYING)) + if(mutPos == -1 && movedStack->hasBonusOfType(Bonus::FLYING)) { steps *= distance; steps /= 2; //to make animation faster @@ -549,7 +549,7 @@ } CMovementEndAnimation::CMovementEndAnimation(CBattleInterface * _owner, const CStack * _stack, BattleHex destTile) -: CBattleStackAnimation(_owner, _stack), destinationTile(destTile) +: CBattleStackAnimation(_owner, _stack), destinationTile(destTile) {} bool CMovementEndAnimation::init() @@ -592,7 +592,7 @@ } CMovementStartAnimation::CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack) -: CBattleStackAnimation(_owner, _stack) +: CBattleStackAnimation(_owner, _stack) {} bool CMovementStartAnimation::init() @@ -634,7 +634,7 @@ } CReverseAnimation::CReverseAnimation(CBattleInterface * _owner, const CStack * stack, BattleHex dest, bool _priority) -: CBattleStackAnimation(_owner, stack), partOfAnim(1), secondPartSetup(false), hex(dest), priority(_priority) +: CBattleStackAnimation(_owner, stack), partOfAnim(1), secondPartSetup(false), hex(dest), priority(_priority) {} bool CReverseAnimation::init() @@ -726,7 +726,7 @@ } CShootingAnimation::CShootingAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked, bool _catapult, int _catapultDmg) -: CAttackAnimation(_owner, attacker, _dest, _attacked), catapultDamage(_catapultDmg), catapult(_catapult) +: CAttackAnimation(_owner, attacker, _dest, _attacked), catapultDamage(_catapultDmg), catapult(_catapult) {} bool CShootingAnimation::init() @@ -785,7 +785,7 @@ if (attackedStack) { - destcoord = CClickableHex::getXYUnitAnim(dest, false, attackedStack, owner); + destcoord = CClickableHex::getXYUnitAnim(dest, false, attackedStack, owner); destcoord.x += 250; destcoord.y += 210; //TODO: find a better place to shoot // Calculate projectile start position. Offsets are read out of the CRANIM.TXT. @@ -795,13 +795,13 @@ spi.x = xycoord.x + projectileOrigin.x + shooterInfo->upperRightMissleOffsetX; spi.y = xycoord.y + projectileOrigin.y + shooterInfo->upperRightMissleOffsetY; } - else if (projectileAngle < -straightAngle) + else if (projectileAngle < -straightAngle) { //lower shot spi.x = xycoord.x + projectileOrigin.x + shooterInfo->lowerRightMissleOffsetX; spi.y = xycoord.y + projectileOrigin.y + shooterInfo->lowerRightMissleOffsetY; } - else + else { //straight shot spi.x = xycoord.x + projectileOrigin.x + shooterInfo->rightMissleOffsetX; @@ -816,7 +816,7 @@ spi.dy = (destcoord.y - spi.y) / spi.lastStep; spi.catapultInfo = 0; } - else + else { // Catapult attack // These are the values for equations of this kind: f(x) = ax^2 + bx + c @@ -903,11 +903,11 @@ } CSpellEffectAnimation::CSpellEffectAnimation(CBattleInterface * _owner, ui32 _effect, BattleHex _destTile, int _dx, int _dy, bool _Vflip) -:CBattleAnimation(_owner), effect(_effect), destTile(_destTile), customAnim(""), x(0), y(0), dx(_dx), dy(_dy), Vflip(_Vflip) +:CBattleAnimation(_owner), effect(_effect), destTile(_destTile), customAnim(""), x(0), y(0), dx(_dx), dy(_dy), Vflip(_Vflip) {} CSpellEffectAnimation::CSpellEffectAnimation(CBattleInterface * _owner, std::string _customAnim, int _x, int _y, int _dx, int _dy, bool _Vflip) -:CBattleAnimation(_owner), effect(-1), destTile(0), customAnim(_customAnim), x(_x), y(_y), dx(_dx), dy(_dy), Vflip(_Vflip) +:CBattleAnimation(_owner), effect(-1), destTile(0), customAnim(_customAnim), x(_x), y(_y), dx(_dx), dy(_dy), Vflip(_Vflip) {} bool CSpellEffectAnimation::init() @@ -1020,7 +1020,7 @@ return false; } } - //battleEffects + //battleEffects return true; } @@ -1068,4 +1068,4 @@ } delete this; -} \ No newline at end of file +} Index: client/BattleInterface/CBattleInterface.h =================================================================== --- client/BattleInterface/CBattleInterface.h (revision 2878) +++ client/BattleInterface/CBattleInterface.h (working copy) @@ -29,7 +29,7 @@ struct BattleSpellCast; struct CObstacleInstance; template <typename T> struct CondSh; -struct SetStackEffect;; +struct SetStackEffect; struct BattleAction; class CGTownInstance; struct CatapultAttack; @@ -185,7 +185,7 @@ const CBattleInterface * owner; public: const CGTownInstance * town; //besieged town - + SiegeHelper(const CGTownInstance * siegeTown, const CBattleInterface * _owner); //c-tor ~SiegeHelper(); //d-tor @@ -291,7 +291,7 @@ friend class CPlayerInterface; friend class CAdventureMapButton; friend class CInGameConsole; - + friend class CBattleResultWindow; friend class CBattleHero; friend class CSpellEffectAnimation; Index: client/CBitmapHandler.h =================================================================== --- client/CBitmapHandler.h (revision 2878) +++ client/CBitmapHandler.h (working copy) @@ -27,4 +27,4 @@ SDL_Surface * loadBitmapFromDir(std::string path, std::string fname, bool setKey=true); //Load file from any LODs SDL_Surface * loadBitmap(std::string fname, bool setKey=true); -}; +} Index: client/CDefHandler.cpp =================================================================== --- client/CDefHandler.cpp (revision 2878) +++ client/CDefHandler.cpp (working copy) @@ -351,7 +351,7 @@ Uint32 keycol = SDL_MapRGBA(ret->format, ttcol.r, ttcol.b, ttcol.g, ttcol.unused); SDL_SetColorKey(ret, SDL_SRCCOLORKEY, keycol); return ret; -}; +} CDefEssential * CDefHandler::essentialize() { Index: client/CPlayerInterface.h =================================================================== --- client/CPlayerInterface.h (revision 2878) +++ client/CPlayerInterface.h (working copy) @@ -7,7 +7,7 @@ #include "UIFramework/CIntObject.h" #ifdef __GNUC__ -#define sprintf_s snprintf +#define sprintf_s snprintf #endif #ifdef max @@ -69,9 +69,9 @@ { class mutex; class recursive_mutex; -}; +} -enum +enum { /*CHANGE_SCREEN_RESOLUTION = 1,*/ RETURN_TO_MAIN_MENU = 2, @@ -100,7 +100,7 @@ CCastleInterface * castleInt; //NULL if castle window isn't opened static CBattleInterface * battleInt; //NULL if no battle CInGameConsole * cingconsole; - + CCallback * cb; //to communicate with engine const BattleAction *curAction; //during the battle - action currently performed by active stack (or NULL) @@ -155,7 +155,7 @@ void receivedResource(int type, int val) OVERRIDE; void showInfoDialog(const std::string &text, const std::vector<Component*> &components, int soundID) OVERRIDE; void showRecruitmentDialog(const CGDwelling *dwelling, const CArmedInstance *dst, int level) OVERRIDE; - void showShipyardDialog(const IShipyard *obj) OVERRIDE; //obj may be town or shipyard; + void showShipyardDialog(const IShipyard *obj) OVERRIDE; //obj may be town or shipyard; void showBlockingDialog(const std::string &text, const std::vector<Component> &components, ui32 askID, int soundID, bool selection, bool cancel) OVERRIDE; //Show a dialog, player must take decision. If selection then he has to choose between one of given components, if cancel he is allowed to not choose. After making choice, CCallback::selectionMade should be called with number of selected component (1 - n) or 0 for cancel (if allowed) and askID. void showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, int queryID) OVERRIDE; void showPuzzleMap() OVERRIDE; @@ -234,7 +234,7 @@ CGPath *getAndVerifyPath( const CGHeroInstance * h ); void acceptTurn(); //used during hot seat after your turn message is close void tryDiggging(const CGHeroInstance *h); - void showShipyardDialogOrProblemPopup(const IShipyard *obj); //obj may be town or shipyard; + void showShipyardDialogOrProblemPopup(const IShipyard *obj); //obj may be town or shipyard; void requestReturningToMainMenu(); void requestStoppingClient(); void sendCustomEvent(int code); Index: client/CPreGame.h =================================================================== --- client/CPreGame.h (revision 2878) +++ client/CPreGame.h (working copy) @@ -124,7 +124,7 @@ CPicture *playerListBg; CHighlightableButtonsGroup *difficulty; - CDefHandler *sizes, *sFlags;; + CDefHandler *sizes, *sFlags; void changeSelection(const CMapInfo *to); void showAll(SDL_Surface * to); Index: client/CVideoHandler.cpp =================================================================== --- client/CVideoHandler.cpp (revision 2878) +++ client/CVideoHandler.cpp (working copy) @@ -47,7 +47,7 @@ void blitBuffer(char *buffer, int x, int y, int w, int h, SDL_Surface *dst) { - const int bpp = dst->format->BytesPerPixel; + const int bpp = dst->format->BytesPerPixel; char *dest; for(int i = h; i > 0; i--) { @@ -142,10 +142,13 @@ tlog1 << "BIK handler: failed to open " << name << std::endl; goto checkErrorAndClean; } + //GCC wants scope of waveout to be reduced. + { + void *waveout = GetProcAddress(dll,"_BinkOpenWaveOut@4"); + if(waveout) + binkSetSoundSystem(waveout,NULL); - void *waveout = GetProcAddress(dll,"_BinkOpenWaveOut@4"); - if(waveout) - binkSetSoundSystem(waveout,NULL); + } hBink = binkOpen(hBinkFile, 0x8a800000); if(!hBink) @@ -166,8 +169,8 @@ void CBIKHandler::show( int x, int y, SDL_Surface *dst, bool update ) { - const int w = hBink->width, - h = hBink->height, + const int w = hBink->width, + h = hBink->height, Bpp = dst->format->BytesPerPixel; int mode = -1; @@ -298,7 +301,7 @@ Uint32 flags[2] = {0xff400, 0xfe400}; data = ptrSmackOpen( (void*)name.c_str(), flags[1], -1); - if (!data) + if (!data) { tlog1 << "Smack cannot open " << name << std::endl; checkForError(); @@ -337,9 +340,9 @@ { int w = std::min<int>(data->width, dst->w - x), h = std::min<int>(data->height, dst->h - y); /* Lock the screen for direct access to the pixels */ - if ( SDL_MUSTLOCK(dst) ) + if ( SDL_MUSTLOCK(dst) ) { - if ( SDL_LockSurface(dst) < 0 ) + if ( SDL_LockSurface(dst) < 0 ) { fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError()); return; @@ -374,7 +377,7 @@ //convert rgb 555 to 565 Uint16 pixel = *addr; Uint16 *p = (Uint16 *)((Uint8 *)dst->pixels + (j+y) * dst->pitch + (i + x) * dst->format->BytesPerPixel); - *p = (pixel & 0x1F) + *p = (pixel & 0x1F) + ((pixel & 0x3e0) << 1) + ((pixel & 0x7c00) << 1); @@ -383,7 +386,7 @@ } } - if ( SDL_MUSTLOCK(dst) ) + if ( SDL_MUSTLOCK(dst) ) { SDL_UnlockSurface(dst); } @@ -425,7 +428,7 @@ out.exceptions(std::ifstream::failbit | std::ifstream::badbit); out.write(data.get(), myVideo->getSize()); } - + current->open(name); return true; } @@ -526,7 +529,7 @@ - if(!w) + if(!w) { show(x,y,dst,update); } @@ -700,7 +703,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay) { close(); - + this->fname = fname; offset = 0; refreshWait = 3; @@ -790,7 +793,7 @@ // Unsupported codec return false; } - + // Open codec #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 6, 0) if ( avcodec_open(codecContext, codec) < 0 ) @@ -802,7 +805,7 @@ codec = NULL; return false; } - + // Allocate video frame frame = avcodec_alloc_frame(); @@ -826,8 +829,8 @@ // Convert the image into YUV format that SDL uses if (overlay) { - sws = sws_getContext(codecContext->width, codecContext->height, - codecContext->pix_fmt, codecContext->width, codecContext->height, + sws = sws_getContext(codecContext->width, codecContext->height, + codecContext->pix_fmt, codecContext->width, codecContext->height, PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL); } else @@ -842,8 +845,8 @@ default: return false; } - sws = sws_getContext(codecContext->width, codecContext->height, - codecContext->pix_fmt, codecContext->width, codecContext->height, + sws = sws_getContext(codecContext->width, codecContext->height, + codecContext->pix_fmt, codecContext->width, codecContext->height, screenFormat, SWS_BICUBIC, NULL, NULL, NULL); } @@ -905,7 +908,7 @@ if (overlay) { SDL_LockYUVOverlay(overlay); - + pict.data[0] = overlay->pixels[0]; pict.data[1] = overlay->pixels[2]; pict.data[2] = overlay->pixels[1]; @@ -945,7 +948,7 @@ pos.x = x; pos.y = y; CSDL_Ext::blitSurface(dest, &destRect, dst, &pos); - + if (update) SDL_UpdateRect(dst, pos.x, pos.y, pos.w, pos.h); } @@ -968,14 +971,14 @@ else { open(fname); - nextFrame(); - + nextFrame(); + // The y position is wrong at the first frame. // Note: either the windows player or the linux player is - // broken. Compensate here until the bug is found. + // broken. Compensate here until the bug is found. show(x, y--, dst, update); } - } + } else { redraw(x, y, dst, update); @@ -986,7 +989,7 @@ void CVideoPlayer::close() { - fname = ""; + fname = ""; if (sws) { sws_freeContext(sws); @@ -1049,7 +1052,7 @@ while(nextFrame()) { - + if(stopOnKey && keyDown()) return false; @@ -1071,7 +1074,7 @@ close(); return ret; } - + CVideoPlayer::~CVideoPlayer() { close(); Index: client/UIFramework/CGuiHandler.h =================================================================== --- client/UIFramework/CGuiHandler.h (revision 2878) +++ client/UIFramework/CGuiHandler.h (working copy) @@ -89,11 +89,11 @@ ui8 defActionsDef; //default auto actions ui8 captureChildren; //all newly created objects will get their parents from stack and will be added to parents children list std::list<CIntObject *> createdObj; //stack of objs being created - + static SDLKey arrowToNum(SDLKey key); //converts arrow key to according numpad key static SDLKey numToDigit(SDLKey key);//converts numpad digit key to normal digit key static bool isNumKey(SDLKey key, bool number = true); //checks if key is on numpad (numbers - check only for numpad digits) - static bool isArrowKey(SDLKey key); + static bool isArrowKey(SDLKey key); static bool amIGuiThread(); static void pushSDLEvent(int type, int usercode = 0); }; @@ -122,9 +122,9 @@ namespace Colors { - -}; +} + #define OBJ_CONSTRUCTION SObjectConstruction obj__i(this) #define OBJ_CONSTRUCTION_CAPTURING_ALL defActions = 255; SSetCaptureState obj__i1(true, 255); SObjectConstruction obj__i(this) #define BLOCK_CAPTURING SSetCaptureState obj__i(false, 0) Index: client/UIFramework/CIntObjectClasses.cpp =================================================================== --- client/UIFramework/CIntObjectClasses.cpp (revision 2878) +++ client/UIFramework/CIntObjectClasses.cpp (working copy) @@ -22,7 +22,7 @@ CPicture::CPicture( SDL_Surface *BG, int x, int y, bool Free ) { init(); - bg = BG; + bg = BG; freeSurf = Free; pos.x += x; pos.y += y; @@ -33,7 +33,7 @@ CPicture::CPicture( const std::string &bmpname, int x, int y ) { init(); - bg = BitmapHandler::loadBitmap(bmpname); + bg = BitmapHandler::loadBitmap(bmpname); freeSurf = true;; pos.x += x; pos.y += y; @@ -315,12 +315,12 @@ if(isBlocked()) return; - if (down) + if (down) { if (!soundDisabled) CCS->soundh->playSound(soundBase::button); setState(PRESSED); - } + } else if(hoverable && hovered) setState(HIGHLIGHTED); else @@ -355,8 +355,8 @@ if(pressedL && on) setState(PRESSED); - std::string *name = (vstd::contains(hoverTexts,getState())) - ? (&hoverTexts[getState()]) + std::string *name = (vstd::contains(hoverTexts,getState())) + ? (&hoverTexts[getState()]) : (vstd::contains(hoverTexts,0) ? (&hoverTexts[0]) : NULL); if(name && name->size() && !isBlocked()) //if there is no name, there is nohing to display also { @@ -533,7 +533,7 @@ bt->callback += boost::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID); bt->onlyOn = true; buttons.push_back(bt); -} +} CHighlightableButtonsGroup::CHighlightableButtonsGroup(const CFunctionList2<void(int)> &OnChange, bool musicLikeButtons) : onChange(OnChange), musicLike(musicLikeButtons) @@ -597,7 +597,7 @@ void CHighlightableButtonsGroup::block( ui8 on ) { - for(size_t i=0;i<buttons.size(); ++i) + for(size_t i=0;i<buttons.size(); ++i) { buttons[i]->block(on); } @@ -614,7 +614,7 @@ double v = 0; if(horizontal) { - if( std::abs(sEvent.y-(pos.y+pos.h/2)) > pos.h/2+40 || std::abs(sEvent.x-(pos.x+pos.w/2)) > pos.w/2 ) + if( std::abs(sEvent.y-(pos.y+pos.h/2)) > pos.h/2+40 || std::abs(sEvent.x-(pos.x+pos.w/2)) > pos.w/2 ) return; v = sEvent.x - pos.x - 24; v *= positions; @@ -622,7 +622,7 @@ } else { - if(std::abs(sEvent.x-(pos.x+pos.w/2)) > pos.w/2+40 || std::abs(sEvent.y-(pos.y+pos.h/2)) > pos.h/2 ) + if(std::abs(sEvent.x-(pos.x+pos.w/2)) > pos.w/2+40 || std::abs(sEvent.y-(pos.y+pos.h/2)) > pos.h/2 ) return; v = sEvent.y - pos.y - 24; v *= positions; @@ -746,7 +746,7 @@ left->pos.x = pos.x; right->pos.x = pos.x + totalw - 16; } - else + else { left->pos.x = slider->pos.x = right->pos.x = pos.x; left->pos.y = pos.y; @@ -859,7 +859,7 @@ return; } - moveTo(moveDest); + moveTo(moveDest); } void CSlider::moveToMax() @@ -1270,7 +1270,7 @@ CIntObject::showAll(to); const Font &f = *graphics->fonts[font]; - int lineHeight = f.height; + int lineHeight = f.height; int lineCapacity = pos.h / lineHeight; int dy = f.height; //line height @@ -1301,7 +1301,7 @@ lines.clear(); const Font &f = *graphics->fonts[font]; - int lineHeight = f.height; + int lineHeight = f.height; lines = CMessage::breakText(Txt, pos.w, font); @@ -1313,13 +1313,13 @@ CLabelGroup::CLabelGroup(EFonts Font, EAlignment Align, const SDL_Color &Color): font(Font), align(Align), color(Color) -{}; +{} void CLabelGroup::add(int x, int y, const std::string &text) { OBJ_CONSTRUCTION_CAPTURING_ALL; new CLabel(x, y, font, align, color, text); -}; +} CTextBox::CTextBox(std::string Text, const Rect &rect, int SliderStyle, EFonts Font /*= FONT_SMALL*/, EAlignment Align /*= TOPLEFT*/, const SDL_Color &Color /*= Colors::Cornsilk*/) :CBoundedLabel(rect.x, rect.y, Font, Align, Color, Text), sliderStyle(SliderStyle), slider(NULL) @@ -1340,7 +1340,7 @@ vstd::clear_pointer(slider); lines.clear(); const Font &f = *graphics->fonts[font]; - int lineHeight = f.height; + int lineHeight = f.height; int lineCapacity = pos.h / lineHeight; lines = CMessage::breakText(Txt, pos.w, font); @@ -1535,7 +1535,7 @@ void CTextInput::keyPressed( const SDL_KeyboardEvent & key ) { - if(!focus || key.state != SDL_PRESSED) + if(!focus || key.state != SDL_PRESSED) return; if(key.keysym.sym == SDLK_TAB) Index: client/UIFramework/SDL_Extensions.h =================================================================== --- client/UIFramework/SDL_Extensions.h (revision 2878) +++ client/UIFramework/SDL_Extensions.h (working copy) @@ -193,4 +193,4 @@ void applyEffect(SDL_Surface * surf, const SDL_Rect * rect, int mode); //mode: 0 - sepia, 1 - grayscale std::string trimToFit(std::string text, int widthLimit, EFonts font); -}; +} Index: config/creatures.json =================================================================== --- config/creatures.json (revision 2878) +++ config/creatures.json (working copy) @@ -492,7 +492,7 @@ "name": [ "HellHound" ], "faction": 3, "upgrades": [47], - "ability_remove": [ "FLYING" ], + "ability_remove": [ "FLYING" ], //hell hound doesn't fly "defname": "CHHOUN.DEF" }, @@ -503,7 +503,7 @@ "faction": 3, "ability_add": [ [ "THREE_HEADED_ATTACK", 0, 0, 0 ], [ "BLOCKS_RETALIATION", 0, 0, 0 ] ], - "ability_remove": [ "FLYING" ], + "ability_remove": [ "FLYING" ], //cerberus doesn't fly "defname": "CCERBU.DEF" }, @@ -1523,7 +1523,7 @@ "level": 0, "name": [ "FirstAidTent" ], "faction": 9, - "ability_add": [ [ "HEALER", 0, 0, 0 ] ], //Gorynyches fly + "ability_add": [ [ "HEALER", 0, 0, 0 ] ], "defname": "SMTENT.DEF" }, @@ -1532,7 +1532,7 @@ "level": 0, "name": [ "AmmoCart" ], "faction": 9, - "ability_add": [ [ "NOT_ACTIVE", 0, 0, 0 ] ], //hell hound doesn't fly + "ability_add": [ [ "NOT_ACTIVE", 0, 0, 0 ] ], "defname": "SMCART.DEF" }, @@ -1541,7 +1541,7 @@ "level": 0, "name": [ "ArrowTower" ], "faction": 9, - "ability_add": [ [ "SHOOTER", 0, 0, 0 ] ], //cerberus doesn't fly + "ability_add": [ [ "SHOOTER", 0, 0, 0 ] ], "defname": "x" }, @@ -1700,7 +1700,7 @@ "level": 0, "name": [ "Gorynych" ], "faction": 9, - "ability_add": [ [ "FLYING", 0, 0, 0 ] ], + "ability_add": [ [ "FLYING", 0, 0, 0 ] ], //Gorynyches fly "defname": "ZM168DG.DEF" }, Index: Global.h =================================================================== --- Global.h (revision 2878) +++ Global.h (working copy) @@ -51,6 +51,8 @@ //The only available version is 3, as of Boost 1.50 #define BOOST_FILESYSTEM_VERSION 3 +#define BOOST_THREAD_VERSION 3 +//#define BOOST_SYSTEM_NO_DEPRECATED 1 #include <boost/algorithm/string.hpp> #include <boost/assert.hpp> @@ -97,7 +99,11 @@ // Import + Export macro declarations #ifdef _WIN32 +#ifdef __GNUC__ +#define DLL_EXPORT __attribute__((dllexport)) +#else #define DLL_EXPORT __declspec(dllexport) +#endif #else #if defined(__GNUC__) && GCC_VERSION >= 400 #define DLL_EXPORT __attribute__ ((visibility("default"))) @@ -107,7 +113,11 @@ #endif #ifdef _WIN32 +#ifdef __GNUC__ +#define DLL_IMPORT __attribute__((dllimport)) +#else #define DLL_IMPORT __declspec(dllimport) +#endif #else #if defined(__GNUC__) && GCC_VERSION >= 400 #define DLL_IMPORT __attribute__ ((visibility("default"))) Index: lib =================================================================== --- lib (revision 2878) +++ lib (working copy) Property changes on: lib ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +*.gch Index: lib/CArtHandler.cpp =================================================================== --- lib/CArtHandler.cpp (revision 2878) +++ lib/CArtHandler.cpp (working copy) @@ -55,12 +55,12 @@ // { // if (!vstd::contains(possibleSlots, slotID)) // return false; -// +// // // Can't put an artifact in a locked slot. // std::map<ui16, const CArtifact*>::const_iterator it = artifWorn.find(slotID); // if (it != artifWorn.end() && it->second->id == 145) // return false; -// +// // // Check if a combination artifact fits. // // TODO: Might want a more general algorithm? // // Assumes that misc & rings fits only in their slots, and others in only one slot and no duplicates. @@ -71,14 +71,14 @@ // const ui16 miscSlots[] = {9, 10, 11, 12, 18}; // int rings = 0; // int misc = 0; -// +// // VLC->arth->unequipArtifact(tempArtifWorn, slotID); -// -// BOOST_FOREACH(ui32 constituentID, *constituents) +// +// BOOST_FOREACH(ui32 constituentID, *constituents) // { // const CArtifact& constituent = *VLC->arth->artifacts[constituentID]; // const int slot = constituent.possibleSlots[0]; -// +// // if (slot == 6 || slot == 7) // rings++; // else if ((slot >= 9 && slot <= 12) || slot == 18) @@ -86,18 +86,18 @@ // else if (tempArtifWorn.find(slot) != tempArtifWorn.end()) // return false; // } -// +// // // Ensure enough ring slots are free -// for (int i = 0; i < sizeof(ringSlots)/sizeof(*ringSlots); i++) +// for (int i = 0; i < sizeof(ringSlots)/sizeof(*ringSlots); i++) // { // if (tempArtifWorn.find(ringSlots[i]) == tempArtifWorn.end() || ringSlots[i] == slotID) // rings--; // } // if (rings > 0) // return false; -// +// // // Ensure enough misc slots are free. -// for (int i = 0; i < sizeof(miscSlots)/sizeof(*miscSlots); i++) +// for (int i = 0; i < sizeof(miscSlots)/sizeof(*miscSlots); i++) // { // if (tempArtifWorn.find(miscSlots[i]) == tempArtifWorn.end() || miscSlots[i] == slotID) // misc--; @@ -105,7 +105,7 @@ // if (misc > 0) // return false; // } -// +// // return true; // } @@ -113,16 +113,16 @@ // { // if (constituentOf == NULL || !vstd::contains(*constituentOf, artifactID)) // return false; -// +// // const CArtifact &artifact = *VLC->arth->artifacts[artifactID]; // assert(artifact.constituents); -// -// BOOST_FOREACH(ui32 constituentID, *artifact.constituents) +// +// BOOST_FOREACH(ui32 constituentID, *artifact.constituents) // { // bool found = false; -// for (std::map<ui16, const CArtifact*>::const_iterator it = artifWorn.begin(); it != artifWorn.end(); ++it) +// for (std::map<ui16, const CArtifact*>::const_iterator it = artifWorn.begin(); it != artifWorn.end(); ++it) // { -// if (it->second->id == constituentID) +// if (it->second->id == constituentID) // { // found = true; // break; @@ -131,7 +131,7 @@ // if (!found) // return false; // } -// +// // return true; // } @@ -237,7 +237,7 @@ std::vector<ui16> slots; slots += 17, 16, 15, 14, 13, 18, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0; growingArtifacts += 146, 147, 148, 150, 151, 152, 153; - static std::map<char, CArtifact::EartClass> classes = + static std::map<char, CArtifact::EartClass> classes = map_list_of('S',CArtifact::ART_SPECIAL)('T',CArtifact::ART_TREASURE)('N',CArtifact::ART_MINOR)('J',CArtifact::ART_MAJOR)('R',CArtifact::ART_RELIC); CLegacyConfigParser parser("DATA/ARTRAITS.TXT"); @@ -287,7 +287,7 @@ // Fill in information about combined artifacts. Should perhaps be moved to a config file? nart.constituentOf = NULL; - switch (nart.id) + switch (nart.id) { case 129: // Angelic Alliance nart.constituents = new std::vector<ui32>(); @@ -363,7 +363,7 @@ const JsonNode config(ResourceID("config/commanders.json")); BOOST_FOREACH(const JsonNode &artifact, config["artifacts"].Vector()) { - auto ga = dynamic_cast <CGrowingArtifact *>(artifacts[artifact["id"].Float()].get()); + auto ga = dynamic_cast <CGrowingArtifact *>(artifacts[artifact["id"].Float()].get()); BOOST_FOREACH (auto b, artifact["bonusesPerLevel"].Vector()) { ga->bonusesPerLevel.push_back (std::pair <ui16, Bonus> (b["level"].Float(), *ParseBonus (b["bonus"].Vector()))); @@ -382,11 +382,11 @@ addBonuses(); // Populate reverse mappings of combinational artifacts. - BOOST_FOREACH(CArtifact *artifact, artifacts) + BOOST_FOREACH(CArtifact *artifact, artifacts) { - if (artifact->constituents != NULL) + if (artifact->constituents != NULL) { - BOOST_FOREACH(ui32 constituentID, *artifact->constituents) + BOOST_FOREACH(ui32 constituentID, *artifact->constituents) { if (artifacts[constituentID]->constituentOf == NULL) artifacts[constituentID]->constituentOf = new std::vector<ui32>(); @@ -484,7 +484,7 @@ std::vector<ConstTransitivePtr<CArtifact> > out; getAllowed(out, flags); CArtifact *art = out[rand % out.size()]; - return art->id; + return art->id; } void CArtHandler::getAllowed(std::vector<ConstTransitivePtr<CArtifact> > &out, int flags) { @@ -575,7 +575,7 @@ a->possibleSlots[ArtBearer::COMMANDER].clear(); } a->possibleSlots[ArtBearer::CREATURE].push_back(ArtifactPosition::CREATURE_SLOT); -}; +} void CArtHandler::makeItCommanderArt (int aid, bool onlyCommander /*=true*/) { @@ -587,7 +587,7 @@ } for (int i = ArtifactPosition::COMMANDER1; i <= ArtifactPosition::COMMANDER6; ++i) a->possibleSlots[ArtBearer::COMMANDER].push_back(i); -}; +} void CArtHandler::addBonuses() { @@ -601,11 +601,11 @@ //Propagators/limiters used more than once auto battleWidePropagator = make_shared<CPropagatorNodeType>(CBonusSystemNode::BATTLE); - auto visitedTownPropagator = make_shared<CPropagatorNodeType>(CBonusSystemNode::TOWN_AND_VISITOR); + auto visitedTownPropagator = make_shared<CPropagatorNodeType>(CBonusSystemNode::TOWN_AND_VISITOR); auto shooterOnlyLimiter = make_shared<HasAnotherBonusLimiter>(Bonus::SHOOTER); auto dragonNatureLimiter = make_shared<HasAnotherBonusLimiter>(Bonus::DRAGON_NATURE); - + //Attack bonus artifacts (Weapons) ART_PRIM_SKILL(7,0,+2); //Centaur Axe ART_PRIM_SKILL(8,0,+3); //Blackshard of the Dead Knight @@ -625,7 +625,7 @@ ART_PRIM_SKILL(18,0,-3); //Sentinel's Shield //Knowledge bonus artifacts (Helmets) - ART_PRIM_SKILL(19,3,+1); //Helm of the Alabaster Unicorn + ART_PRIM_SKILL(19,3,+1); //Helm of the Alabaster Unicorn ART_PRIM_SKILL(20,3,+2); //Skull Helmet ART_PRIM_SKILL(21,3,+3); //Helm of Chaos ART_PRIM_SKILL(22,3,+4); //Crown of the Supreme Magi @@ -662,13 +662,13 @@ ART_POWER_AND_KNOWLEDGE(43,+3); //Necklace of Dragonteeth ART_POWER_AND_KNOWLEDGE(44,+4); //Crown of Dragontooth - //Luck and morale + //Luck and morale ART_MORALE(45,+1); //Still Eye of the Dragon ART_LUCK(45,+1); //Still Eye of the Dragon ART_LUCK(46,+1); //Clover of Fortune ART_LUCK(47,+1); //Cards of Prophecy ART_LUCK(48,+1); //Ladybird of Luck - ART_MORALE(49,+1); //Badge of Courage -> +1 morale + ART_MORALE(49,+1); //Badge of Courage -> +1 morale giveArtBonus(49,Bonus::MIND_IMMUNITY,0); //immunity to hostile mind spells: ART_MORALE(50,+1); //Crest of Valor ART_MORALE(51,+1); //Glyph of Gallantry @@ -772,11 +772,11 @@ giveArtBonus(121,Bonus::CREATURE_GROWTH,+2,4, visitedTownPropagator); //Arms of Legion giveArtBonus(122,Bonus::CREATURE_GROWTH,+1,5, visitedTownPropagator); //Head of Legion - //Sea Captain's Hat - giveArtBonus(123,Bonus::WHIRLPOOL_PROTECTION,0); - giveArtBonus(123,Bonus::SEA_MOVEMENT,+500); - giveArtBonus(123,Bonus::SPELL,3,0, Bonus::INDEPENDENT_MAX); - giveArtBonus(123,Bonus::SPELL,3,1, Bonus::INDEPENDENT_MAX); + //Sea Captain's Hat + giveArtBonus(123,Bonus::WHIRLPOOL_PROTECTION,0); + giveArtBonus(123,Bonus::SEA_MOVEMENT,+500); + giveArtBonus(123,Bonus::SPELL,3,0, Bonus::INDEPENDENT_MAX); + giveArtBonus(123,Bonus::SPELL,3,1, Bonus::INDEPENDENT_MAX); giveArtBonus(124, Bonus::SPELLS_OF_LEVEL,3,1); //Spellbinder's Hat giveArtBonus(125, Bonus::BATTLE_NO_FLEEING,0, 0, battleWidePropagator); //Shackles of War @@ -919,32 +919,32 @@ // void CArtHandler::equipArtifact( std::map<ui16, const CArtifact*> &artifWorn, ui16 slotID, const CArtifact* art ) const // { // unequipArtifact(artifWorn, slotID); -// +// // if (art) //false when artifact is NULL -> slot set to empty // { // const CArtifact &artifact = *art; -// +// // // Add artifact. // artifWorn[slotID] = art; -// +// // // Add locks, in reverse order of being removed. -// if (artifact.constituents != NULL) +// if (artifact.constituents != NULL) // { // bool destConsumed = false; // Determines which constituent that will be counted for together with the artifact. -// -// BOOST_FOREACH(ui32 constituentID, *artifact.constituents) +// +// BOOST_FOREACH(ui32 constituentID, *artifact.constituents) // { // const CArtifact &constituent = *artifacts[constituentID]; -// -// if (!destConsumed && vstd::contains(constituent.possibleSlots, slotID)) +// +// if (!destConsumed && vstd::contains(constituent.possibleSlots, slotID)) // { // destConsumed = true; -// } -// else +// } +// else // { -// BOOST_FOREACH(ui16 slot, constituent.possibleSlots) +// BOOST_FOREACH(ui16 slot, constituent.possibleSlots) // { -// if (!vstd::contains(artifWorn, slot)) +// if (!vstd::contains(artifWorn, slot)) // { // artifWorn[slot] = VLC->arth->artifacts[145]; //lock // break; @@ -955,7 +955,7 @@ // } // } // } -// +// // /** // * Locally unequips an artifact from a hero's worn slots. // * Does not test if the operation is legal. @@ -966,30 +966,30 @@ // { // if (!vstd::contains(artifWorn, slotID)) // return; -// +// // const CArtifact &artifact = *artifWorn[slotID]; -// +// // // Remove artifact, if it's not already removed. // artifWorn.erase(slotID); -// +// // // Remove locks, in reverse order of being added. -// if (artifact.constituents != NULL) +// if (artifact.constituents != NULL) // { // bool destConsumed = false; -// -// BOOST_FOREACH(ui32 constituentID, *artifact.constituents) +// +// BOOST_FOREACH(ui32 constituentID, *artifact.constituents) // { // const CArtifact &constituent = *artifacts[constituentID]; -// -// if (!destConsumed && vstd::contains(constituent.possibleSlots, slotID)) +// +// if (!destConsumed && vstd::contains(constituent.possibleSlots, slotID)) // { // destConsumed = true; -// } -// else +// } +// else // { -// BOOST_REVERSE_FOREACH(ui16 slot, constituent.possibleSlots) +// BOOST_REVERSE_FOREACH(ui16 slot, constituent.possibleSlots) // { -// if (vstd::contains(artifWorn, slot) && artifWorn[slot]->id == 145) +// if (vstd::contains(artifWorn, slot) && artifWorn[slot]->id == 145) // { // artifWorn.erase(slot); // break; @@ -1152,7 +1152,7 @@ || artType->constituents) //combined artifact already: no combining of combined artifacts... for now. return ret; - BOOST_FOREACH(ui32 possibleCombinedArt, *artType->constituentOf) + BOOST_FOREACH(ui32 possibleCombinedArt, *artType->constituentOf) { const CArtifact * const artifact = VLC->arth->artifacts[possibleCombinedArt]; assert(artifact->constituents); @@ -1228,7 +1228,7 @@ return supposedPart == this; } -bool CCombinedArtifactInstance::canBePutAt(const CArtifactSet *artSet, int slot, bool assumeDestRemoved /*= false*/) const +bool CCombinedArtifactInstance::canBePutAt(const CArtifactSet *artSet, int slot, bool assumeDestRemoved /*= false*/) const { bool canMainArtifactBePlaced = CArtifactInstance::canBePutAt(artSet, slot, assumeDestRemoved); if(!canMainArtifactBePlaced) @@ -1319,7 +1319,7 @@ const bool suggestedPosValid = ci.art->canBePutAt(suggestedPos); int pos = -1; - if(inActiveSlot && suggestedPosValid) //there is a valid suggestion where to place lock + if(inActiveSlot && suggestedPosValid) //there is a valid suggestion where to place lock pos = ci.slot; else ci.slot = pos = ci.art->firstAvailableSlot(al.getHolderArtSet()); @@ -1517,7 +1517,7 @@ ArtSlotInfo & CArtifactSet::retreiveNewArtSlot(ui16 slot) { assert(!vstd::contains(artifactsWorn, slot)); - ArtSlotInfo &ret = slot < GameConstants::BACKPACK_START + ArtSlotInfo &ret = slot < GameConstants::BACKPACK_START ? artifactsWorn[slot] : *artifactsInBackpack.insert(artifactsInBackpack.begin() + (slot - GameConstants::BACKPACK_START), ArtSlotInfo()); Index: lib/CConsoleHandler.cpp =================================================================== --- lib/CConsoleHandler.cpp (revision 2878) +++ lib/CConsoleHandler.cpp (working copy) @@ -25,9 +25,10 @@ #else #define WIN32_LEAN_AND_MEAN //excludes rarely used stuff from windows headers - delete this line if something is missing #include <windows.h> +#ifndef __MINGW32__ #include <dbghelp.h> #pragma comment(lib, "dbghelp.lib") - +#endif typedef WORD TColor; HANDLE handleIn; HANDLE handleOut; @@ -108,19 +109,20 @@ if (einfo->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { - tlog1 << "Attempt to " << (einfo->ExceptionInformation[0] == 1 ? "write to " : "read from ") + tlog1 << "Attempt to " << (einfo->ExceptionInformation[0] == 1 ? "write to " : "read from ") << "0x" << std::setw(8) << (void*)einfo->ExceptionInformation[1] << std::endl;; } const DWORD threadId = ::GetCurrentThreadId(); tlog1 << "Thread ID: " << threadId << " [" << std::dec << std::setw(0) << threadId << "]\n"; +#ifndef __MINGW32__ //exception info to be placed in the dump MINIDUMP_EXCEPTION_INFORMATION meinfo = {threadId, exception, TRUE}; //create file where dump will be placed char *mname = NULL; char buffer[MAX_PATH + 1]; - HMODULE hModule = NULL; + HMODULE hModule = NULL; GetModuleFileNameA(hModule, buffer, MAX_PATH); mname = strrchr(buffer, '\\'); if (mname != 0) @@ -132,6 +134,7 @@ HANDLE dfile = CreateFileA(mname, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); tlog1 << "Crash info will be put in " << mname << std::endl; MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), dfile, MiniDumpWithDataSegs, &meinfo, 0, 0); +#endif MessageBoxA(0, "VCMI has crashed. We are sorry. File with information about encountered problem has been created.", "VCMI Crashhandler", MB_OK | MB_ICONERROR); return EXCEPTION_EXECUTE_HANDLER; } @@ -216,7 +219,9 @@ GetConsoleScreenBufferInfo(handleOut,&csbi); defColor = csbi.wAttributes; #ifndef _DEBUG +//#ifndef __MINGW32__ SetUnhandledExceptionFilter(onUnhandledException); +//#endif #endif #else defColor = "\x1b[0m"; @@ -233,7 +238,7 @@ } void CConsoleHandler::end() { - if (thread) + if (thread) { #ifndef _WIN32 thread->interrupt(); Index: lib/CCreatureSet.h =================================================================== --- lib/CCreatureSet.h (revision 2878) +++ lib/CCreatureSet.h (working copy) @@ -133,7 +133,7 @@ class DLL_LINKAGE CCreatureSet : public IArmyDescriptor //seven combined creatures { - CCreatureSet(const CCreatureSet&);; + CCreatureSet(const CCreatureSet&); CCreatureSet &operator=(const CCreatureSet&); public: TSlots stacks; //slots[slot_id]->> pair(creature_id,creature_quantity) @@ -143,7 +143,7 @@ virtual ~CCreatureSet(); virtual void armyChanged(); - const CStackInstance &operator[](TSlot slot) const; + const CStackInstance &operator[](TSlot slot) const; const TSlots &Slots() const {return stacks;} @@ -161,13 +161,13 @@ void giveStackExp(expType exp); void setStackExp(TSlot slot, expType exp); - //derivative + //derivative void eraseStack(TSlot slot); //slot must be occupied void joinStack(TSlot slot, CStackInstance * stack); //adds new stack to the existing stack of the same type void changeStackCount(TSlot slot, TQuantity toAdd); //stack must exist! bool setCreature (TSlot slot, TCreature type, TQuantity quantity) OVERRIDE; //replaces creature in stack; slots 0 to 6, if quantity=0 erases stack void setToArmy(CSimpleArmy &src); //erases all our army and moves stacks from src to us; src MUST NOT be an armed object! WARNING: use it wisely. Or better do not use at all. - + const CStackInstance& getStack(TSlot slot) const; //stack must exist const CStackInstance* getStackPtr(TSlot slot) const; //if stack doesn't exist, returns NULL const CCreature* getCreature(TSlot slot) const; //workaround of map issue; @@ -186,7 +186,7 @@ ui64 getPower (TSlot slot) const; //value of specific stack std::string getRoughAmount (TSlot slot) const; //rough size of specific stack bool hasStackAtSlot(TSlot slot) const; - + bool contains(const CStackInstance *stack) const; bool canBeMergedWith(const CCreatureSet &cs, bool allowMergingStacks = true) const; Index: lib/CObjectHandler.cpp =================================================================== --- lib/CObjectHandler.cpp (revision 2878) +++ lib/CObjectHandler.cpp (working copy) @@ -53,13 +53,13 @@ std::vector<int> CGTownInstance::universitySkills; void IObjectInterface::onHeroVisit(const CGHeroInstance * h) const -{}; +{} void IObjectInterface::onHeroLeave(const CGHeroInstance * h) const -{}; +{} void IObjectInterface::newTurn () const -{}; +{} IObjectInterface::~IObjectInterface() {} Index: lib/Connection.h =================================================================== --- lib/Connection.h (revision 2878) +++ lib/Connection.h (working copy) @@ -5,8 +5,8 @@ #include <boost/type_traits/is_fundamental.hpp> #include <boost/type_traits/is_enum.hpp> -#include <boost/type_traits/is_pointer.hpp> -#include <boost/type_traits/is_class.hpp> +#include <boost/type_traits/is_pointer.hpp> +#include <boost/type_traits/is_class.hpp> #include <boost/type_traits/is_base_of.hpp> #include <boost/type_traits/is_array.hpp> #include <boost/type_traits/remove_pointer.hpp> @@ -66,7 +66,7 @@ class basic_socket_acceptor; } class mutex; -}; +} enum SerializationLvl { @@ -200,7 +200,7 @@ template<typename T> struct SerializationLevel -{ +{ typedef mpl::integral_c_tag tag; typedef typename mpl::eval_if< @@ -252,7 +252,7 @@ TTypeVecMap vectors; //entry must be a pointer to vector containing pointers to the objects of key type bool smartVectorMembersSerialization; - bool sendStackInstanceByIds; + bool sendStackInstanceByIds; CSerializer(); ~CSerializer(); @@ -274,7 +274,7 @@ const VectorisedObjectInfo<T> *getVectorisedTypeInfo() { const std::type_info *myType = NULL; -// +// // if(boost::is_base_of<CGObjectInstance, T>::value) //ugly workaround to support also types derived from CGObjectInstance -> if we encounter one, treat it aas CGObj.. // myType = &typeid(CGObjectInstance); // else @@ -342,7 +342,7 @@ template <typename T> //metafunction returning CGObjectInstance if T is its derivate or T elsewise struct VectorisedTypeFor { - typedef typename + typedef typename //if mpl::eval_if<boost::is_base_of<CGObjectInstance,T>, mpl::identity<CGObjectInstance>, @@ -471,10 +471,10 @@ COSer & operator&(const T & t) { return * this->This() << t; - } - + } + int write(const void * data, unsigned size); template <typename T> void savePrimitive(const T &data) @@ -539,7 +539,7 @@ //that part of ptr serialization was extracted to allow customization of its behavior in derived classes template <typename T> void savePointerHlp(ui16 tid, const T &data) - { + { if(!tid) *this << *data; //if type is unregistered simply write all data in a standard way else @@ -556,7 +556,7 @@ template <typename T> void save(const T &data) { - typedef + typedef //if typename mpl::eval_if< mpl::equal_to<SerializationLevel<T>,mpl::int_<Primitive> >, mpl::identity<SavePrimitive<Serializer,T> >, @@ -703,7 +703,7 @@ ~CISer() { std::map<ui16,CBasicPointerLoader*>::iterator iter; - + for(iter = loaders.begin(); iter != loaders.end(); iter++) delete iter->second; } @@ -725,18 +725,18 @@ this->This()->load(t); return * this->This(); } - + template<class T> CISer & operator&(T & t) { return * this->This() >> t; - } + } int write(const void * data, unsigned size); template <typename T> void load(T &data) { - typedef + typedef //if typename mpl::eval_if< mpl::equal_to<SerializationLevel<T>,mpl::int_<Primitive> >, mpl::identity<LoadPrimitive<Serializer,T> >, @@ -782,7 +782,7 @@ nonConstT &hlp = const_cast<nonConstT&>(data); hlp.serialize(*this,fileVersion); //data.serialize(*this,myVersion); - } + } template <typename T> void loadSerializable(T &data) @@ -806,7 +806,7 @@ data = NULL; return; } - + if(smartVectorMembersSerialization) { typedef typename boost::remove_const<typename boost::remove_pointer<T>::type>::type TObjectType; //eg: const CGHeroInstance * => CGHeroInstance @@ -830,7 +830,7 @@ return; } - ui32 pid = 0xffffffff; //pointer id (or maybe rather pointee id) + ui32 pid = 0xffffffff; //pointer id (or maybe rather pointee id) if(smartPointerSerialization) { *this >> pid; //get the id @@ -1081,7 +1081,7 @@ class CApplier { public: - std::map<ui16,T*> apps; + std::map<ui16,T*> apps; ~CApplier() { Index: lib/CThreadHelper.cpp =================================================================== --- lib/CThreadHelper.cpp (revision 2878) +++ lib/CThreadHelper.cpp (working copy) @@ -35,7 +35,7 @@ while(true) { { - boost::unique_lock<boost::mutex> lock(rtinm); + boost::unique_lock<boost::mutex> lock(rtinm); if((pom = currentTask) >= amount) break; else @@ -50,6 +50,7 @@ void setThreadName(const std::string &name) { #ifdef _WIN32 +#ifndef __GNUC__ //follows http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx const DWORD MS_VC_EXCEPTION=0x406D1388; #pragma pack(push,8) @@ -67,6 +68,7 @@ info.dwThreadID = -1; info.dwFlags = 0; + __try { RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info ); @@ -75,6 +77,10 @@ { } #else +//not supported +#endif + +#else prctl(PR_SET_NAME, name.c_str(), 0, 0, 0); #endif -} \ No newline at end of file +} Index: lib/HeroBonus.h =================================================================== --- lib/HeroBonus.h (revision 2878) +++ lib/HeroBonus.h (working copy) @@ -217,7 +217,7 @@ enum BonusDuration //when bonus is automatically removed { PERMANENT = 1, - ONE_BATTLE = 2, //at the end of battle + ONE_BATTLE = 2, //at the end of battle ONE_DAY = 4, //at the end of day ONE_WEEK = 8, //at the end of week (bonus lasts till the end of week, thats NOT 7 days N_TURNS = 16, //used during battles, after battle bonus is always removed @@ -236,7 +236,7 @@ enum LimitEffect { - NO_LIMIT = 0, + NO_LIMIT = 0, ONLY_DISTANCE_FIGHT=1, ONLY_MELEE_FIGHT, //used to mark bonuses for attack/defense primary skills from spells like Precision (distance only) ONLY_ENEMY_ARMY }; @@ -265,7 +265,7 @@ TLimiterPtr limiter; TPropagatorPtr propagator; - std::string description; + std::string description; Bonus(ui16 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, std::string Desc, si32 Subtype=-1); Bonus(ui16 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, si32 Subtype=-1, ui8 ValType = ADDITIVE_VALUE); @@ -357,7 +357,7 @@ public: BonusList(bool BelongsToTree = false); BonusList(const BonusList &bonusList); - BonusList& operator=(const BonusList &bonusList); + BonusList& operator=(const BonusList &bonusList); // wrapper functions of the STL vector container std::vector<Bonus*>::size_type size() const { return bonuses.size(); } @@ -393,7 +393,7 @@ //void limit(const CBonusSystemNode &node); //erases bonuses using limitor void eliminateDuplicates(); - + // remove_if implementation for STL vector types template <class Predicate> void remove_if(Predicate pred) @@ -409,7 +409,7 @@ bonuses.resize(newList.size()); std::copy(newList.begin(), newList.end(), bonuses.begin()); } - + template <class InputIterator> void insert(const int position, InputIterator first, InputIterator last); @@ -465,7 +465,7 @@ CPropagatorNodeType(); CPropagatorNodeType(ui8 NodeType); bool shouldBeAttached(CBonusSystemNode *dest); - //CBonusSystemNode *getDestNode(CBonusSystemNode *source, CBonusSystemNode *redParent, CBonusSystemNode *redChild) OVERRIDE; + //CBonusSystemNode *getDestNode(CBonusSystemNode *source, CBonusSystemNode *redParent, CBonusSystemNode *redChild) OVERRIDE; template <typename Handler> void serialize(Handler &h, const int version) { @@ -479,7 +479,7 @@ const CBonusSystemNode &node; const BonusList &alreadyAccepted; }; - + class DLL_LINKAGE ILimiter { public: @@ -500,7 +500,7 @@ // * selector is predicate that tests if HeroBonus matches our criteria // * root is node on which call was made (NULL will be replaced with this) //interface - virtual const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = NULL, const std::string &cachingStr = "") const = 0; + virtual const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = NULL, const std::string &cachingStr = "") const = 0; void getModifiersWDescr(TModDescr &out, const CSelector &selector, const std::string &cachingStr = "") const; //out: pairs<modifier value, modifier description> int getBonusesCount(const CSelector &selector, const std::string &cachingStr = "") const; int valOfBonuses(const CSelector &selector, const std::string &cachingStr = "") const; @@ -508,7 +508,7 @@ const TBonusListPtr getBonuses(const CSelector &selector, const CSelector &limit, const std::string &cachingStr = "") const; const TBonusListPtr getBonuses(const CSelector &selector, const std::string &cachingStr = "") const; - //legacy interface + //legacy interface int valOfBonuses(Bonus::BonusType type, const CSelector &selector) const; int valOfBonuses(Bonus::BonusType type, int subtype = -1) const; //subtype -> subtype of bonus, if -1 then anyt; bool hasBonusOfType(Bonus::BonusType type, int subtype = -1) const;//determines if hero has a bonus of given type (and optionally subtype) @@ -540,16 +540,16 @@ TNodesVector parents; //parents -> we inherit bonuses from them, we may attach our bonuses to them TNodesVector children; - + ui8 nodeType; std::string description; - - static const bool cachingEnabled; + + static const bool cachingEnabled; mutable BonusList cachedBonuses; - mutable int cachedLast; + mutable int cachedLast; static int treeChanged; - // Setting a value to cachingStr before getting any bonuses caches the result for later requests. + // Setting a value to cachingStr before getting any bonuses caches the result for later requests. // This string needs to be unique, that's why it has to be setted in the following manner: // [property key]_[value] => only for selector mutable std::map<std::string, TBonusListPtr > cachedRequests; @@ -562,7 +562,7 @@ explicit CBonusSystemNode(); virtual ~CBonusSystemNode(); - + void limitBonuses(const BonusList &allBonuses, BonusList &out) const; //out will bo populed with bonuses that are not limited here TBonusListPtr limitBonuses(const BonusList &allBonuses) const; //same as above, returns out by val for convienence const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = NULL, const std::string &cachingStr = "") const; @@ -573,8 +573,8 @@ void getParents(TNodes &out); //retrieves list of parent nodes (nodes to inherit bonuses from) void getRedParents(TNodes &out); //retrieves list of red parent nodes (nodes bonuses propagate from) void getRedAncestors(TNodes &out); - void getRedChildren(TNodes &out); - void getRedDescendants(TNodes &out); + void getRedChildren(TNodes &out); + void getRedDescendants(TNodes &out); Bonus *getBonus(const CSelector &selector); void attachTo(CBonusSystemNode *parent); @@ -604,7 +604,7 @@ void deserializationFix(); void exportBonus(Bonus * b); void exportBonuses(); - + static void incrementTreeChangedNum(); BonusList &getBonusList(); const BonusList &getBonusList() const; @@ -628,7 +628,7 @@ } enum ENodeTypes { - UNKNOWN, STACK_INSTANCE, STACK_BATTLE, SPECIALITY, ARTIFACT, CREATURE, ARTIFACT_INSTANCE, HERO, PLAYER, TEAM, + UNKNOWN, STACK_INSTANCE, STACK_BATTLE, SPECIALITY, ARTIFACT, CREATURE, ARTIFACT_INSTANCE, HERO, PLAYER, TEAM, TOWN_AND_VISITOR, BATTLE }; }; @@ -641,7 +641,7 @@ //DLL_LINKAGE const HeroBonus * get(const CBonusSystemNode *obj, int from, int id ); DLL_LINKAGE void getModifiersWDescr(const CBonusSystemNode *obj, TModDescr &out, Bonus::BonusType type, int subtype = -1 ); //out: pairs<modifier value, modifier description> DLL_LINKAGE int getCount(const CBonusSystemNode *obj, int from, int id); -}; +} /// generates HeroBonus from given data inline Bonus makeFeatureVal(Bonus::BonusType type, ui8 duration, si16 subtype, si32 value, Bonus::BonusSource source, ui16 turnsRemain = 0, si32 additionalInfo = 0) @@ -725,7 +725,7 @@ { return turnsRequested <= 0 //every present effect will last zero (or "less") turns || !(bonus->duration & Bonus::N_TURNS) //so do every not expriing after N-turns effect - || bonus->turnsRemain > turnsRequested; + || bonus->turnsRemain > turnsRequested; } CWillLastTurns& operator()(const int &setVal) { @@ -769,7 +769,7 @@ } }; -class DLL_LINKAGE CreatureNativeTerrainLimiter : public ILimiter //applies only to creatures that are on their native terrain +class DLL_LINKAGE CreatureNativeTerrainLimiter : public ILimiter //applies only to creatures that are on their native terrain { public: si8 terrainType; Index: lib/NetPacks.h =================================================================== --- lib/NetPacks.h (revision 2878) +++ lib/NetPacks.h (working copy) @@ -48,7 +48,7 @@ { tlog1 << "CPack serialized... this should not happen!\n"; } - DLL_LINKAGE void applyGs(CGameState *gs) + void applyGs(CGameState *gs) {}; }; @@ -60,7 +60,7 @@ void applyFirstCl(CClient *cl)//called before applying to gs {}; void applyCl(CClient *cl)//called after applying to gs - {}; + {}; }; struct CPackForServer : public CPack @@ -70,7 +70,7 @@ CGameState* GS(CGameHandler *gh); CPackForServer() { - type = 2; + type = 2; c = NULL; player = 255; }; @@ -82,7 +82,7 @@ struct Query : public CPackForClient { ui32 queryID; // equals to -1 if it is not an actual query (and should not be answered) - + Query() { queryID = -1; @@ -95,7 +95,7 @@ private: enum EMessage {TEXACT_STRING, TLOCAL_STRING, TNUMBER, TREPLACE_ESTRING, TREPLACE_LSTRING, TREPLACE_NUMBER, TREPLACE_PLUSNUMBER}; public: - enum {GENERAL_TXT=1, XTRAINFO_TXT, OBJ_NAMES, RES_NAMES, ART_NAMES, ARRAY_TXT, CRE_PL_NAMES, CREGENS, MINE_NAMES, + enum {GENERAL_TXT=1, XTRAINFO_TXT, OBJ_NAMES, RES_NAMES, ART_NAMES, ARRAY_TXT, CRE_PL_NAMES, CREGENS, MINE_NAMES, MINE_EVNTS, ADVOB_TXT, ART_EVNTS, SPELL_NAME, SEC_SKILL_NAME, CRE_SING_NAMES, CREGENS4, COLOR, ART_DESCR}; std::vector<ui8> message; //vector of EMessage @@ -169,7 +169,7 @@ { type = 2001; } -}; +}; struct StackLocation { @@ -276,16 +276,16 @@ { h & player & resid & val; } -}; +}; struct SetResources : public CPackForClient //104 { SetResources(){type = 104;}; void applyCl(CClient *cl); DLL_LINKAGE void applyGs(CGameState *gs); - + ui8 player; TResources res; //res[resid] => res amount - + template <typename Handler> void serialize(Handler &h, const int version) { h & player & res; @@ -307,7 +307,7 @@ { h & abs & id & which & val; } -}; +}; struct SetSecSkill : public CPackForClient //106 { SetSecSkill(){type = 106;}; @@ -344,7 +344,7 @@ { h & flags & tid & hid; } -}; +}; struct ChangeSpells : public CPackForClient //109 { ChangeSpells(){type = 109;}; @@ -359,7 +359,7 @@ { h & learn & hid & spells; } -}; +}; struct SetMana : public CPackForClient //110 { @@ -402,7 +402,7 @@ { h & tiles & player & mode; } -}; +}; struct SetAvailableHeroes : public CPackForClient //113 { @@ -431,7 +431,7 @@ { GiveBonus(ui8 Who = 0) { - who = Who; + who = Who; type = 115; } @@ -454,7 +454,7 @@ { ChangeObjPos() { - type = 116; + type = 116; flags = 0; } void applyFirstCl(CClient *cl); @@ -495,7 +495,7 @@ { RemoveBonus(ui8 Who = 0) { - who = Who; + who = Who; type = 118; } @@ -584,7 +584,7 @@ { h & id; } -}; +}; struct TryMoveHero : public CPackForClient //501 { TryMoveHero(){type = 501;humanKnows=false; attackedFrom = int3(-1, -1, -1);}; @@ -616,24 +616,24 @@ // SetGarrisons(){type = 502;}; // void applyCl(CClient *cl); // DLL_LINKAGE void applyGs(CGameState *gs); -// +// // std::map<ui32,CCreatureSet> garrs; -// +// // template <typename Handler> void serialize(Handler &h, const int version) // { // h & garrs; // } -// }; +// }; struct NewStructures : public CPackForClient //504 { NewStructures(){type = 504;}; void applyCl(CClient *cl); - DLL_LINKAGE virtual void applyGs(CGameState *gs); + DLL_LINKAGE void applyGs(CGameState *gs); si32 tid; std::set<si32> bid; - si16 builded; + si16 builded; template <typename Handler> void serialize(Handler &h, const int version) { @@ -648,7 +648,7 @@ si32 tid; std::set<si32> bid; - si16 destroyed; + si16 destroyed; template <typename Handler> void serialize(Handler &h, const int version) { @@ -668,7 +668,7 @@ { h & tid & creatures; } -}; +}; struct SetHeroesInTown : public CPackForClient //508 { SetHeroesInTown(){type = 508;}; @@ -689,19 +689,19 @@ // void applyCl(CClient *cl); // DLL_LINKAGE void applyGs(CGameState *gs); // DLL_LINKAGE void setArtAtPos(ui16 pos, const CArtifact* art); -// +// // si32 hid; // std::vector<const CArtifact*> artifacts; //hero's artifacts from bag // std::map<ui16, const CArtifact*> artifWorn; //map<position,artifact_id>; positions: 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 -// +// // template <typename Handler> void serialize(Handler &h, const int version) // { // h & hid & artifacts & artifWorn; // } -// +// // std::vector<const CArtifact*> equipped, unequipped; //used locally // BonusList gained, lost; //used locally as hlp when applying -// }; +// }; struct HeroRecruited : public CPackForClient //515 { @@ -717,7 +717,7 @@ { h & hid & tid & tile & player; } -}; +}; struct GiveHero : public CPackForClient //516 { @@ -733,7 +733,7 @@ { h & id & player; } -}; +}; struct OpenWindow : public CPackForClient //517 { @@ -1072,7 +1072,7 @@ { h & heroes & cres & res & day & resetBuilded & specialWeek & creatureid; } -}; +}; struct Component : public CPack //2002 helper for object scrips informations { @@ -1110,10 +1110,10 @@ { h & text & components & player & soundID; } - InfoWindow() - { + InfoWindow() + { type = 103; - soundID = 0; + soundID = 0; } }; @@ -1134,7 +1134,7 @@ ui32 val; SetObjectProperty(){type = 1001;}; SetObjectProperty(ui32 ID, ui8 What, ui32 Val):id(ID),what(What),val(Val){type = 1001;}; - + template <typename Handler> void serialize(Handler &h, const int version) { h & id & what & val; @@ -1149,7 +1149,7 @@ MetaString name; SetHoverName(){type = 1002;}; SetHoverName(ui32 ID, MetaString& Name):id(ID),name(Name){type = 1002;}; - + template <typename Handler> void serialize(Handler &h, const int version) { h & id & name; @@ -1165,7 +1165,7 @@ std::vector<ui16> skills; HeroLevelUp(){type = 2000;}; - + template <typename Handler> void serialize(Handler &h, const int version) { h & queryID & heroid & primskill & level & skills; @@ -1273,14 +1273,14 @@ BattleInfo * info; - + template <typename Handler> void serialize(Handler &h, const int version) { h & info; } }; struct BattleNextRound : public CPackForClient//3001 -{ +{ BattleNextRound(){type = 3001;}; void applyFirstCl(CClient *cl); void applyCl(CClient *cl); @@ -1874,7 +1874,7 @@ { GarrisonHeroSwap(){}; GarrisonHeroSwap(si32 TID):tid(TID){}; - si32 tid; + si32 tid; bool applyGh(CGameHandler *gh); template <typename Handler> void serialize(Handler &h, const int version) @@ -1971,7 +1971,7 @@ } }; -struct BuildBoat : public CPackForServer +struct BuildBoat : public CPackForServer { BuildBoat(){}; si32 objid; //where player wants to buy a boat @@ -2084,7 +2084,7 @@ { h & text & player; } -}; +}; struct SetSelection : public CPackForClient, public CPackForServer //514 @@ -2241,7 +2241,7 @@ { enum {TOWN, HERO, BONUS}; ui8 what; - si8 direction; //-1 or +1 + si8 direction; //-1 or +1 ui8 playerID; RequestOptionsChange(ui8 What, si8 Dir, ui8 Player) Index: lib/ResourceSet.h =================================================================== --- lib/ResourceSet.h (revision 2878) +++ lib/ResourceSet.h (working copy) @@ -10,7 +10,7 @@ class ResourceSet; bool canAfford(const ResourceSet &res, const ResourceSet &price); //can a be used to pay price b - enum ERes + enum ERes { WOOD = 0, MERCURY, ORE, SULFUR, CRYSTAL, GEMS, GOLD, MITHRIL }; @@ -25,7 +25,7 @@ #define scalarOperator(OPSIGN) \ - DLL_LINKAGE ResourceSet operator OPSIGN(const TResource &rhs) const \ + ResourceSet operator OPSIGN(const TResource &rhs) const \ { \ ResourceSet ret = *this; \ for(int i = 0; i < size(); i++) \ @@ -37,7 +37,7 @@ #define vectorOperator(OPSIGN) \ - DLL_LINKAGE ResourceSet operator OPSIGN(const ResourceSet &rhs) const \ + ResourceSet operator OPSIGN(const ResourceSet &rhs) const \ { \ ResourceSet ret = *this; \ for(int i = 0; i < size(); i++) \ @@ -48,7 +48,7 @@ #define opEqOperator(OPSIGN, RHS_TYPE) \ - DLL_LINKAGE ResourceSet& operator OPSIGN ## =(const RHS_TYPE &rhs) \ + ResourceSet& operator OPSIGN ## =(const RHS_TYPE &rhs) \ { \ return *this = *this OPSIGN rhs; \ } @@ -70,7 +70,7 @@ #undef opEqOperator //to be used for calculations of type "how many units of sth can I afford?" - DLL_LINKAGE int operator/(const ResourceSet &rhs) + int operator/(const ResourceSet &rhs) { int ret = INT_MAX; for(int i = 0; i < size(); i++) @@ -80,7 +80,7 @@ return ret; } - DLL_LINKAGE ResourceSet & operator=(const TResource &rhs) + ResourceSet & operator=(const TResource &rhs) { for(int i = 0; i < size(); i++) at(i) = rhs; @@ -88,14 +88,14 @@ return *this; } - // WARNING: comparison operators are used for "can afford" relation: a <= b means that foreach i a[i] <= b[i] + // WARNING: comparison operators are used for "can afford" relation: a <= b means that foreach i a[i] <= b[i] // that doesn't work the other way: a > b doesn't mean that a cannot be afforded with b, it's still b can afford a // bool operator<(const ResourceSet &rhs) // { // for(int i = 0; i < size(); i++) // if(at(i) >= rhs[i]) // return false; -// +// // return true; // } @@ -118,7 +118,7 @@ } cur; const ResourceSet &rs; void advance(); - + public: nziterator(const ResourceSet &RS); bool valid(); @@ -126,7 +126,7 @@ nziterator operator++(int); const ResEntry& operator*() const; const ResEntry* operator->() const; - + }; }; } Index: Scripting/ERM =================================================================== --- Scripting/ERM (revision 2878) +++ Scripting/ERM (working copy) Property changes on: Scripting/ERM ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,5 ## +bin +obj +*.depend +*.layout +*_build_log.html Index: Scripting/ERM/ERM.cbp =================================================================== --- Scripting/ERM/ERM.cbp (revision 0) +++ Scripting/ERM/ERM.cbp (working copy) @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="ERM" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\ERM" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="..\..\bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\ERM" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O3" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="..\..\bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-O1" /> + <Add option="-O" /> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + </Compiler> + <Linker> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + </Linker> + <Unit filename="ERMInterpreter.cpp" /> + <Unit filename="ERMInterpreter.h" /> + <Unit filename="ERMParser.cpp" /> + <Unit filename="ERMParser.h" /> + <Unit filename="ERMScriptModule.cpp" /> + <Unit filename="ERMScriptModule.h" /> + <Unit filename="StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + <DoxyBlocks> + <comment_style block="0" line="0" /> + <doxyfile_project /> + <doxyfile_build /> + <doxyfile_warnings /> + <doxyfile_output /> + <doxyfile_dot /> + <general /> + </DoxyBlocks> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: vcmi.workspace =================================================================== --- vcmi.workspace (revision 0) +++ vcmi.workspace (working copy) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_workspace_file> + <Workspace title="vcmi"> + <Project filename="VCMI_lib.cbp" /> + <Project filename="VCMI_client.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="VCMI_server.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="AI/FuzzyLite/FuzzyLite.cbp" /> + <Project filename="AI/EmptyAI/EmptyAI.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + <Project filename="AI/VCAI/VCAI.cbp"> + <Depends filename="VCMI_lib.cbp" /> + <Depends filename="AI/FuzzyLite/FuzzyLite.cbp" /> + </Project> + <Project filename="AI/StupidAI/StupidAI.cbp"> + <Depends filename="VCMI_lib.cbp" /> + </Project> + </Workspace> +</CodeBlocks_workspace_file> Index: VCMI_client.cbp =================================================================== --- VCMI_client.cbp (revision 0) +++ VCMI_client.cbp (working copy) @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCMI_client" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\VCMI_client" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + <Linker> + <Add directory="bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\VCMI_client" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-fpermissive" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + <Add directory="." /> + <Add directory="client" /> + <Add directory="include" /> + </Compiler> + <Linker> + <Add option="-lole32" /> + <Add option="-loleaut32" /> + <Add option="-lws2_32" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lSDL" /> + <Add option="-lSDL_image" /> + <Add option="-lSDL_mixer" /> + <Add option="-lSDL_ttf" /> + <Add option="-lVCMI_lib" /> + <Add directory="libs" /> + </Linker> + <Unit filename="CCallback.cpp" /> + <Unit filename="CCallback.h" /> + <Unit filename="client\AdventureMapClasses.cpp" /> + <Unit filename="client\AdventureMapClasses.h" /> + <Unit filename="client\BattleInterface\CBattleAnimations.cpp" /> + <Unit filename="client\BattleInterface\CBattleAnimations.h" /> + <Unit filename="client\BattleInterface\CBattleInterface.cpp" /> + <Unit filename="client\BattleInterface\CBattleInterface.h" /> + <Unit filename="client\BattleInterface\CBattleInterfaceClasses.cpp" /> + <Unit filename="client\BattleInterface\CBattleInterfaceClasses.h" /> + <Unit filename="client\BattleInterface\CCreatureAnimation.cpp" /> + <Unit filename="client\BattleInterface\CCreatureAnimation.h" /> + <Unit filename="client\CAdvmapInterface.cpp" /> + <Unit filename="client\CAdvmapInterface.h" /> + <Unit filename="client\CAnimation.cpp" /> + <Unit filename="client\CAnimation.h" /> + <Unit filename="client\CBitmapHandler.cpp" /> + <Unit filename="client\CBitmapHandler.h" /> + <Unit filename="client\CCastleInterface.cpp" /> + <Unit filename="client\CCastleInterface.h" /> + <Unit filename="client\CConfigHandler.cpp" /> + <Unit filename="client\CConfigHandler.h" /> + <Unit filename="client\CCreatureWindow.cpp" /> + <Unit filename="client\CCreatureWindow.h" /> + <Unit filename="client\CDefHandler.cpp" /> + <Unit filename="client\CDefHandler.h" /> + <Unit filename="client\CGameInfo.cpp" /> + <Unit filename="client\CGameInfo.h" /> + <Unit filename="client\CHeroWindow.cpp" /> + <Unit filename="client\CHeroWindow.h" /> + <Unit filename="client\CKingdomInterface.cpp" /> + <Unit filename="client\CKingdomInterface.h" /> + <Unit filename="client\CMT.cpp" /> + <Unit filename="client\CMessage.cpp" /> + <Unit filename="client\CMessage.h" /> + <Unit filename="client\CMusicHandler.cpp" /> + <Unit filename="client\CMusicHandler.h" /> + <Unit filename="client\CPlayerInterface.cpp" /> + <Unit filename="client\CPlayerInterface.h" /> + <Unit filename="client\CPreGame.cpp" /> + <Unit filename="client\CPreGame.h" /> + <Unit filename="client\CQuestLog.cpp" /> + <Unit filename="client\CQuestLog.h" /> + <Unit filename="client\CSoundBase.h" /> + <Unit filename="client\CSpellWindow.cpp" /> + <Unit filename="client\CSpellWindow.h" /> + <Unit filename="client\CVideoHandler.cpp" /> + <Unit filename="client\CVideoHandler.h" /> + <Unit filename="client\Client.cpp" /> + <Unit filename="client\Client.h" /> + <Unit filename="client\FontBase.h" /> + <Unit filename="client\FunctionList.h" /> + <Unit filename="client\GUIClasses.cpp" /> + <Unit filename="client\GUIClasses.h" /> + <Unit filename="client\Graphics.cpp" /> + <Unit filename="client\Graphics.h" /> + <Unit filename="client\NetPacksClient.cpp" /> + <Unit filename="client\StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="client\UIFramework\CCursorHandler.cpp" /> + <Unit filename="client\UIFramework\CCursorHandler.h" /> + <Unit filename="client\UIFramework\CGuiHandler.cpp" /> + <Unit filename="client\UIFramework\CGuiHandler.h" /> + <Unit filename="client\UIFramework\CIntObject.cpp" /> + <Unit filename="client\UIFramework\CIntObject.h" /> + <Unit filename="client\UIFramework\CIntObjectClasses.cpp" /> + <Unit filename="client\UIFramework\CIntObjectClasses.h" /> + <Unit filename="client\UIFramework\Geometries.cpp" /> + <Unit filename="client\UIFramework\Geometries.h" /> + <Unit filename="client\UIFramework\SDL_Extensions.cpp" /> + <Unit filename="client\UIFramework\SDL_Extensions.h" /> + <Unit filename="client\UIFramework\SDL_Pixels.h" /> + <Unit filename="client\VCMI_client.rc"> + <Option compilerVar="WINDRES" /> + </Unit> + <Unit filename="client\mapHandler.cpp" /> + <Unit filename="client\mapHandler.h" /> + <Unit filename="client\resource.h" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + <DoxyBlocks> + <comment_style block="0" line="0" /> + <doxyfile_project /> + <doxyfile_build /> + <doxyfile_warnings /> + <doxyfile_output /> + <doxyfile_dot /> + <general /> + </DoxyBlocks> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: VCMI_lib.cbp =================================================================== --- VCMI_lib.cbp (revision 0) +++ VCMI_lib.cbp (working copy) @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCMI_lib" /> + <Option execution_dir="D:\projects\vcmi\engine\VCMI_lib\" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option platforms="Windows;" /> + <Option output="bin\Debug\VCMI_lib" prefix_auto="0" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-O1" /> + <Add option="-O" /> + </Compiler> + </Target> + <Target title="Release"> + <Option platforms="Windows;" /> + <Option output="bin\Release\VCMI_lib" prefix_auto="0" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="3" /> + <Option compiler="gcc" /> + <Option createStaticLib="1" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-pedantic" /> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-DVCMI_DLL" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + <Add directory="." /> + <Add directory="include" /> + <Add directory="lib" /> + </Compiler> + <Linker> + <Add option="-lws2_32" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lz" /> + <Add directory="libs" /> + </Linker> + <Unit filename="Global.h" /> + <Unit filename="lib\AI_Base.h" /> + <Unit filename="lib\BattleAction.cpp" /> + <Unit filename="lib\BattleAction.h" /> + <Unit filename="lib\BattleHex.cpp" /> + <Unit filename="lib\BattleHex.h" /> + <Unit filename="lib\BattleState.cpp" /> + <Unit filename="lib\BattleState.h" /> + <Unit filename="lib\CArtHandler.cpp" /> + <Unit filename="lib\CArtHandler.h" /> + <Unit filename="lib\CBattleCallback.cpp" /> + <Unit filename="lib\CBattleCallback.h" /> + <Unit filename="lib\CBuildingHandler.cpp" /> + <Unit filename="lib\CBuildingHandler.h" /> + <Unit filename="lib\CCampaignHandler.cpp" /> + <Unit filename="lib\CCampaignHandler.h" /> + <Unit filename="lib\CConsoleHandler.cpp" /> + <Unit filename="lib\CConsoleHandler.h" /> + <Unit filename="lib\CCreatureHandler.cpp" /> + <Unit filename="lib\CCreatureHandler.h" /> + <Unit filename="lib\CCreatureSet.cpp" /> + <Unit filename="lib\CCreatureSet.h" /> + <Unit filename="lib\CDefObjInfoHandler.cpp" /> + <Unit filename="lib\CDefObjInfoHandler.h" /> + <Unit filename="lib\CGameInterface.cpp" /> + <Unit filename="lib\CGameInterface.h" /> + <Unit filename="lib\CGameState.cpp" /> + <Unit filename="lib\CGameState.h" /> + <Unit filename="lib\CGeneralTextHandler.cpp" /> + <Unit filename="lib\CGeneralTextHandler.h" /> + <Unit filename="lib\CHeroHandler.cpp" /> + <Unit filename="lib\CHeroHandler.h" /> + <Unit filename="lib\CLogger.cpp" /> + <Unit filename="lib\CLogger.h" /> + <Unit filename="lib\CMapInfo.cpp" /> + <Unit filename="lib\CMapInfo.h" /> + <Unit filename="lib\CModHandler.cpp" /> + <Unit filename="lib\CModHandler.h" /> + <Unit filename="lib\CObjectHandler.cpp" /> + <Unit filename="lib\CObjectHandler.h" /> + <Unit filename="lib\CObstacleInstance.cpp" /> + <Unit filename="lib\CObstacleInstance.h" /> + <Unit filename="lib\CScriptingModule.h" /> + <Unit filename="lib\CSpellHandler.cpp" /> + <Unit filename="lib\CSpellHandler.h" /> + <Unit filename="lib\CStopWatch.h" /> + <Unit filename="lib\CThreadHelper.cpp" /> + <Unit filename="lib\CThreadHelper.h" /> + <Unit filename="lib\CTownHandler.cpp" /> + <Unit filename="lib\CTownHandler.h" /> + <Unit filename="lib\CondSh.h" /> + <Unit filename="lib\Connection.cpp" /> + <Unit filename="lib\Connection.h" /> + <Unit filename="lib\ConstTransitivePtr.h" /> + <Unit filename="lib\Filesystem\CBinaryReader.cpp" /> + <Unit filename="lib\Filesystem\CBinaryReader.h" /> + <Unit filename="lib\Filesystem\CCompressedStream.cpp" /> + <Unit filename="lib\Filesystem\CCompressedStream.h" /> + <Unit filename="lib\Filesystem\CFileInfo.cpp" /> + <Unit filename="lib\Filesystem\CFileInfo.h" /> + <Unit filename="lib\Filesystem\CFileInputStream.cpp" /> + <Unit filename="lib\Filesystem\CFileInputStream.h" /> + <Unit filename="lib\Filesystem\CFilesystemLoader.cpp" /> + <Unit filename="lib\Filesystem\CFilesystemLoader.h" /> + <Unit filename="lib\Filesystem\CInputStream.h" /> + <Unit filename="lib\Filesystem\CLodArchiveLoader.cpp" /> + <Unit filename="lib\Filesystem\CLodArchiveLoader.h" /> + <Unit filename="lib\Filesystem\CMemoryStream.cpp" /> + <Unit filename="lib\Filesystem\CMemoryStream.h" /> + <Unit filename="lib\Filesystem\CResourceLoader.cpp" /> + <Unit filename="lib\Filesystem\CResourceLoader.h" /> + <Unit filename="lib\Filesystem\ISimpleResourceLoader.h" /> + <Unit filename="lib\GameConstants.h" /> + <Unit filename="lib\HeroBonus.cpp" /> + <Unit filename="lib\HeroBonus.h" /> + <Unit filename="lib\IGameCallback.cpp" /> + <Unit filename="lib\IGameCallback.h" /> + <Unit filename="lib\IGameEventsReceiver.h" /> + <Unit filename="lib\Interprocess.h" /> + <Unit filename="lib\JsonNode.cpp" /> + <Unit filename="lib\JsonNode.h" /> + <Unit filename="lib\NetPacks.h" /> + <Unit filename="lib\NetPacksLib.cpp" /> + <Unit filename="lib\RegisterTypes.h" /> + <Unit filename="lib\ResourceSet.cpp" /> + <Unit filename="lib\ResourceSet.h" /> + <Unit filename="lib\StartInfo.h" /> + <Unit filename="lib\StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Unit filename="lib\UnlockGuard.h" /> + <Unit filename="lib\VCMIDirs.h" /> + <Unit filename="lib\VCMI_Lib.cpp" /> + <Unit filename="lib\VCMI_Lib.h" /> + <Unit filename="lib\int3.h" /> + <Unit filename="lib\map.cpp" /> + <Unit filename="lib\map.h" /> + <Unit filename="lib\vcmi_endian.h" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> Index: VCMI_server.cbp =================================================================== --- VCMI_server.cbp (revision 0) +++ VCMI_server.cbp (working copy) @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="VCMI_server" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="bin\Debug\VCMI_server" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Debug\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Option use_console_runner="0" /> + <Compiler> + <Add option="-ggdb" /> + </Compiler> + <Linker> + <Add directory="bin\Debug" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="bin\Release\VCMI_server" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\Release\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-fomit-frame-pointer" /> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add directory="bin\Release" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wextra" /> + <Add option="-Wall" /> + <Add option="-fexceptions" /> + <Add option="-Wpointer-arith" /> + <Add option="-Wno-switch" /> + <Add option="-Wno-sign-compare" /> + <Add option="-Wno-unused-parameter" /> + <Add option="-Wno-overloaded-virtual" /> + <Add option="-D_WIN32_WINNT=0x0501" /> + <Add option="-DBOOST_THREAD_USE_LIB" /> + <Add directory="." /> + <Add directory="include" /> + </Compiler> + <Linker> + <Add option="-lole32" /> + <Add option="-loleaut32" /> + <Add option="-lws2_32" /> + <Add option="-lmswsock" /> + <Add option="-lboost_program_options-mgw47-mt-1_51" /> + <Add option="-lboost_filesystem-mgw47-mt-1_51" /> + <Add option="-lboost_system-mgw47-mt-1_51" /> + <Add option="-lboost_thread-mgw47-mt-1_51" /> + <Add option="-lboost_iostreams-mgw47-mt-1_51" /> + <Add option="-lboost_chrono-mgw47-mt-1_51" /> + <Add option="-lVCMI_lib" /> + <Add directory="libs" /> + </Linker> + <Unit filename="server\CGameHandler.cpp" /> + <Unit filename="server\CGameHandler.h" /> + <Unit filename="server\CVCMIServer.cpp" /> + <Unit filename="server\CVCMIServer.h" /> + <Unit filename="server\NetPacksServer.cpp" /> + <Unit filename="server\StdInc.h"> + <Option compile="1" /> + <Option weight="0" /> + </Unit> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + <DoxyBlocks> + <comment_style block="0" line="0" /> + <doxyfile_project /> + <doxyfile_build /> + <doxyfile_warnings /> + <doxyfile_output /> + <doxyfile_dot /> + <general /> + </DoxyBlocks> + </Extensions> + </Project> +</CodeBlocks_project_file> | ||||||||
Notes | |
(0003008) Tow (developer) 2012-09-13 17:56 |
Uhm... it looks you've forgotten to attach the path. ;-) |
(0003009) AlexVinS (developer) 2012-09-14 08:20 |
Sorry) |
(0003010) AlexVinS (developer) 2012-09-14 08:26 |
There are two versions. Second is newer, but got crashes on map load (I didnt find reason yet)? |
(0003064) Ivan (developer) 2012-09-28 12:53 |
Patch already in, closing. |
Issue History | |||
Date Modified | Username | Field | Change |
2012-09-13 09:48 | AlexVinS | New Issue | |
2012-09-13 17:56 | Tow | Note Added: 0003008 | |
2012-09-13 17:56 | Tow | Assigned To | => Tow |
2012-09-13 17:56 | Tow | Status | new => feedback |
2012-09-14 08:20 | AlexVinS | Note Added: 0003009 | |
2012-09-14 08:20 | AlexVinS | Status | feedback => assigned |
2012-09-14 08:22 | AlexVinS | File Added: mingw_codeblocks.patch | |
2012-09-14 08:23 | AlexVinS | File Added: mingw_codeblocks2.patch | |
2012-09-14 08:26 | AlexVinS | Note Added: 0003010 | |
2012-09-28 12:53 | Ivan | Note Added: 0003064 | |
2012-09-28 12:53 | Ivan | Status | assigned => closed |
2012-09-28 12:53 | Ivan | Resolution | open => fixed |
Copyright © 2000 - 2024 MantisBT Team |