Erwan
- some performance improvements - "daily build". The daily build was compiled in "profile" mode. If you have problems running the exe, or problems with Visual Studio please let me know
This commit is contained in:
Binary file not shown.
@@ -43,6 +43,7 @@ class MTGCardInstance: public MTGCard, public Damageable {
|
||||
int removeBlocker(MTGCardInstance * c);
|
||||
int setAttacker(int value);
|
||||
public:
|
||||
MTGGameZone * currentZone;
|
||||
Pos* view;
|
||||
int regenerateTokens;
|
||||
bool isToken;
|
||||
|
||||
@@ -9,9 +9,9 @@ using std::map;
|
||||
|
||||
class Subtypes{
|
||||
protected:
|
||||
int nb_items;
|
||||
map<string,int> values;
|
||||
|
||||
map<int,string> valuesById;
|
||||
int nb_items;
|
||||
public:
|
||||
static Subtypes * subtypesList;
|
||||
Subtypes();
|
||||
|
||||
@@ -8,15 +8,20 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Profile|Win32 = Profile|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Release|Win32.Build.0 = Release|Win32
|
||||
{89159C26-2282-404A-A194-103B0A49DF7B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{89159C26-2282-404A-A194-103B0A49DF7B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{89159C26-2282-404A-A194-103B0A49DF7B}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{89159C26-2282-404A-A194-103B0A49DF7B}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{89159C26-2282-404A-A194-103B0A49DF7B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{89159C26-2282-404A-A194-103B0A49DF7B}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
|
||||
@@ -106,6 +106,7 @@ void MTGCardInstance::initMTGCI(){
|
||||
lastController = NULL;
|
||||
regenerateTokens = 0;
|
||||
blocked = false;
|
||||
currentZone = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -184,16 +185,7 @@ int MTGCardInstance::destroy(){
|
||||
}
|
||||
|
||||
MTGGameZone * MTGCardInstance::getCurrentZone(){
|
||||
GameObserver * game = GameObserver::GetInstance();
|
||||
for (int i = 0; i < 2; i++){
|
||||
MTGPlayerCards * g = game->players[i]->game;
|
||||
MTGGameZone * zones[] = {g->inPlay,g->graveyard,g->hand, g->library, g->stack, g->temp};
|
||||
for (int k = 0; k < 6; k++){
|
||||
MTGGameZone * zone = zones[k];
|
||||
if (zone->hasCard(this)) return zone;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return currentZone;
|
||||
}
|
||||
|
||||
int MTGCardInstance::has(int basicAbility){
|
||||
@@ -319,16 +311,6 @@ int MTGCardInstance::reset(){
|
||||
|
||||
|
||||
Player * MTGCardInstance::controller(){
|
||||
GameObserver * game = GameObserver::GetInstance();
|
||||
if (!game) return NULL;
|
||||
for (int i = 0; i < 2; ++i){
|
||||
if (game->players[i]->game->inPlay->hasCard(this)) return game->players[i];
|
||||
if (game->players[i]->game->stack->hasCard(this)) return game->players[i];
|
||||
if (game->players[i]->game->graveyard->hasCard(this)) return game->players[i];
|
||||
if (game->players[i]->game->hand->hasCard(this)) return game->players[i];
|
||||
if (game->players[i]->game->library->hasCard(this)) return game->players[i];
|
||||
if (game->players[i]->game->temp->hasCard(this)) return game->players[i];
|
||||
}
|
||||
return lastController;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +186,7 @@ MTGGameZone::~MTGGameZone(){
|
||||
void MTGGameZone::setOwner(Player * player){
|
||||
for (int i=0; i<nb_cards; i++) {
|
||||
cards[i]->owner = player;
|
||||
cards[i]->lastController = player;
|
||||
}
|
||||
owner = player;
|
||||
}
|
||||
@@ -195,6 +196,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy
|
||||
cardsMap.erase(card);
|
||||
for (i=0; i<(nb_cards); i++) {
|
||||
if (cards[i] == card){
|
||||
card->currentZone = NULL;
|
||||
nb_cards--;
|
||||
cards.erase(cards.begin()+i);
|
||||
MTGCardInstance * copy = card;
|
||||
@@ -216,7 +218,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy
|
||||
}
|
||||
|
||||
MTGCardInstance * MTGGameZone::hasCard(MTGCardInstance * card){
|
||||
if (cardsMap.find(card) != cardsMap.end()) return card;
|
||||
if (card->currentZone == this) return card;
|
||||
return NULL;
|
||||
|
||||
}
|
||||
@@ -273,6 +275,7 @@ void MTGGameZone::addCard(MTGCardInstance * card){
|
||||
nb_cards++;
|
||||
cardsMap[card] = 1;
|
||||
card->lastController = this->owner;
|
||||
card->currentZone = this;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ int Subtypes::Add(string value){
|
||||
std::transform( value.begin(), value.end(), value.begin(), ::tolower );
|
||||
nb_items++;
|
||||
values[value] = nb_items;
|
||||
valuesById[nb_items] = value;
|
||||
return nb_items;
|
||||
}
|
||||
|
||||
@@ -39,11 +40,8 @@ int Subtypes::find(const char * subtype){
|
||||
|
||||
}
|
||||
|
||||
/*This will be slow... */
|
||||
string Subtypes::find(int id){
|
||||
map<string,int>::iterator it;
|
||||
for (it = values.begin(); it != values.end(); it++){
|
||||
if (it->second == id) return it->first;
|
||||
}
|
||||
return NULL;
|
||||
map<int,string>::iterator it=valuesById.find(id);;
|
||||
if (it != valuesById.end()) return it->second;
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -208,6 +208,105 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Profile|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/template.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../../JGE/include;../../JGE/Dependencies/include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/template.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3081"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib libpng.lib fmodvc.lib zdll.lib jge.lib libjpeg-static-mt.lib freetype.lib"
|
||||
OutputFile="bin/template.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="..\..\JGE\Dependencies\lib,..\..\JGE\lib\win"
|
||||
IgnoreDefaultLibraryNames="LIBCD,LIBCMT"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Release/template.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/template.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
@@ -317,6 +416,15 @@
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Profile|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\GameLauncher.cpp"
|
||||
@@ -339,6 +447,15 @@
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Profile|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\GameObserver.cpp"
|
||||
@@ -553,11 +670,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\WEvent.cpp"
|
||||
RelativePath=".\src\WCachedResource.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\WCachedResource.cpp"
|
||||
RelativePath=".\src\WEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -905,6 +1022,10 @@
|
||||
RelativePath=".\include\utils.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\WCachedResource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\WEvent.h"
|
||||
>
|
||||
@@ -913,10 +1034,6 @@
|
||||
RelativePath=".\include\WResourceManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\WCachedResource.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
|
||||
Reference in New Issue
Block a user