1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* fixed r-click on tavern hero crash

* fixed removing one-week bonuses
* added keybindings for components in selection window (eg. for treasure chest dialog)
* HANDLE_EXCEPTIONC macro will rethrow exception after logging
This commit is contained in:
Michał W. Urbańczyk 2009-02-07 13:28:23 +00:00
parent 811e6c0945
commit 131c220685
9 changed files with 129 additions and 25 deletions

View File

@ -172,6 +172,90 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="RD|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin\AI"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Oy-"
Optimization="3"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;D:\!GameDevelopment\VCMI\libs\include&quot;;G:\vcmt\repa\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GENIUS_EXPORTS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerOutput="2"
AssemblerListingLocation="$(SolutionDir)$(ConfigurationName)\"
ProgramDataBaseFileName="$(SolutionDir)$(ConfigurationName)\GeniusAI.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="VCMI_lib.lib"
OutputFile="../GeniusAI.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="G:\vcmt\repa\libs"
GenerateManifest="false"
GenerateDebugInformation="true"
GenerateMapFile="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>

View File

@ -476,7 +476,7 @@ void CGameState::applyNL(IPack * pack)
h->bonuses.remove_if(HeroBonus::OneDay);
if(getDate(1) == 7) //new week
BOOST_FOREACH(CGHeroInstance *h, map->heroes)
h->bonuses.remove_if(HeroBonus::OneDay);
h->bonuses.remove_if(HeroBonus::OneWeek);
break;
}
case 102: //set resource amount

View File

@ -497,7 +497,7 @@ void CGarrisonInt::splitStacks(int am2)
am2);
}
CGarrisonInt::CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *pomsur, int OX, int OY, const CArmedInstance *s1,
CGarrisonInt::CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1,
const CArmedInstance *s2)
:interx(inx),intery(iny),sur(pomsur),highlighted(NULL),sup(NULL),sdown(NULL),oup(s1),odown(s2),
offx(OX),offy(OY)
@ -878,6 +878,8 @@ CSelWindow::CSelWindow(std::string text, int player, int charperline, std::vecto
{
components.push_back(comps[i]);
comps[i]->onSelect = boost::bind(&CSelWindow::selectionChange,this,i);
if(i<9)
comps[i]->assignedKeys.insert(SDLK_1+i);
}
CMessage::drawIWindow(this,text,player,charperline);
}
@ -2222,17 +2224,18 @@ void CPlayerInterface::battleAttack(BattleAttack *ba)
else
{
CStack * attacker = cb->battleGetStackByID(ba->stackAttacking);
int shift = 0;
if(ba->counter() && BattleInfo::mutualPosition(curAction->destinationTile, attacker->position) < 0)
{
if(attacker->attackerOwned)
shift = 1;
else
shift = -1;
}
battleInt->stackAttacking( ba->stackAttacking, ba->counter() ? curAction->destinationTile + shift : curAction->additionalInfo );
int shift = 0;
if(ba->counter() && BattleInfo::mutualPosition(curAction->destinationTile, attacker->position) < 0)
{
if(attacker->attackerOwned)
shift = 1;
else
shift = -1;
}
battleInt->stackAttacking( ba->stackAttacking, ba->counter() ? curAction->destinationTile + shift : curAction->additionalInfo );
}
}
void CPlayerInterface::showComp(SComponent comp)
{
boost::unique_lock<boost::recursive_mutex> un(*pim);

View File

@ -302,7 +302,7 @@ public:
int interx, intery;
CGarrisonSlot *highlighted;
SDL_Surface *sur;
SDL_Surface *&sur;
int offx, offy, p2;
bool ignoreEvent, update, active, splitting, pb;
@ -324,7 +324,7 @@ public:
void splitClick();
void splitStacks(int am2);
CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *pomsur, int OX, int OY, const CArmedInstance *s1, const CArmedInstance *s2=NULL);
CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1, const CArmedInstance *s2=NULL);
~CGarrisonInt();
};

View File

@ -176,7 +176,7 @@
</Configuration>
<Configuration
Name="RD|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
@ -199,10 +199,11 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Oy-"
Optimization="3"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
OmitFramePointers="false"
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="G:\vcmt\repa\include"
@ -211,6 +212,8 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="false"
EnableEnhancedInstructionSet="0"
AssemblerOutput="2"
AssemblerListingLocation="$(SolutionDir)$(ConfigurationName)\"
WarningLevel="3"
DebugInformationFormat="3"
/>
@ -228,6 +231,7 @@
AdditionalDependencies="SDL.lib zdll.lib SDL_image.lib SDL_ttf.lib SDL_mixer.lib lua5.1.lib VCMI_lib.lib"
AdditionalLibraryDirectories="G:\vcmt\repa\libs"
GenerateDebugInformation="true"
GenerateMapFile="true"
Driver="0"
OptimizeReferences="2"
EnableCOMDATFolding="2"

View File

@ -249,22 +249,24 @@ extern DLL_EXPORT CLogger<5> tlog5; //gray - minor log info
catch (const std::exception * e) \
{ \
tlog1 << e->what()<< std::endl; \
delete e; \
throw; \
} \
catch (const std::string& e) { \
tlog1 << e << std::endl; \
tlog1 << e << std::endl; \
throw; \
}
#define HANDLE_EXCEPTIONC(COMMAND) \
catch (const std::exception& e) { \
COMMAND; \
tlog1 << e.what() << std::endl; \
COMMAND; \
tlog1 << e.what() << std::endl; \
throw; \
} \
catch (const std::exception * e) \
{ \
COMMAND; \
tlog1 << e->what()<< std::endl; \
delete e; \
throw; \
}

View File

@ -242,7 +242,10 @@ void CGeneralTextHandler::load()
{
loadToIt(temp,buf,it,3);
temp = temp.substr(1,temp.length()-2);
mines[i++].second = temp;
if(i < mines.size())
mines[i++].second = temp;
else
tlog2 << "Warning - too much entries in MINEEVNT. Omitting this one: " << temp << std::endl;
}
tlog5 << "\t\tReading RESTYPES \n";

View File

@ -171,7 +171,7 @@
</Configuration>
<Configuration
Name="RD|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
@ -194,10 +194,11 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Oy-"
Optimization="3"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
OmitFramePointers="false"
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="G:\vcmt\repa\include"
@ -206,6 +207,8 @@
BasicRuntimeChecks="0"
RuntimeLibrary="2"
EnableFunctionLevelLinking="false"
AssemblerOutput="2"
AssemblerListingLocation="$(SolutionDir)$(ConfigurationName)\"
WarningLevel="3"
DebugInformationFormat="3"
/>
@ -224,6 +227,7 @@
Version=""
AdditionalLibraryDirectories="G:\vcmt\repa\libs"
GenerateDebugInformation="true"
GenerateMapFile="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="0"

View File

@ -165,7 +165,7 @@
</Configuration>
<Configuration
Name="RD|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
@ -188,14 +188,17 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Oy-"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
OmitFramePointers="false"
EnableFiberSafeOptimizations="true"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="false"
AssemblerOutput="2"
AssemblerListingLocation="$(SolutionDir)$(ConfigurationName)\"
WarningLevel="3"
DebugInformationFormat="3"
DisableSpecificWarnings="4251"
@ -214,6 +217,7 @@
AdditionalDependencies="VCMI_lib.lib zdll.lib"
AdditionalLibraryDirectories="G:\vcmt\repa\libs"
GenerateDebugInformation="true"
GenerateMapFile="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"