Skip to content

Commit

Permalink
Now it compile on 64Bits platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb authored and civctp2 committed Oct 15, 2018
1 parent 0f78710 commit 3285b19
Show file tree
Hide file tree
Showing 140 changed files with 1,490 additions and 951 deletions.
4 changes: 4 additions & 0 deletions ctp2_code/GameWatch/gamewatch/GameWatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include "GWDelivery.h"
#include "GWRecorder.h"
#ifdef __linux__
#include "../../ctp/cifm.h"
#define fopen(a, b) ci_fopen(a, b)
#endif

DllExport GameWatch gameWatch;

Expand Down
4 changes: 4 additions & 0 deletions ctp2_code/GameWatch/gwciv/GWCivRecord.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#include "GWCivRecord.h"
#ifdef __linux__
#include "../../ctp/cifm.h"
#define fopen(a, b) ci_fopen(a, b)
#endif

class GWUnitRecord {
public:
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/ctpai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#include "Scheduler.h"
#include "Goal.h"
#include "GoalRecord.h" // g_theGoalDB
#include "Agent.h"
#include "agent.h"
#include "mapanalysis.h"
#include "governor.h"
#include "AgreementMatrix.h"
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/ReactEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"
#include "player.h"
#include "c3_utilitydialogbox.h"

Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/RejectResponseEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "ctpai.h"
#include "AgreementMatrix.h"

#include "aicause.h"
#include "AICause.h"

#include "Diplomat.h"
#include "mapanalysis.h"
Expand Down
6 changes: 3 additions & 3 deletions ctp2_code/ai/diplomacy/ResponseEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
//
// Modifications from the original Activision code:
//
// - Added HotSeat and PBEM human-human diplomacy support. (17-Oct-2007 Martin Gühmann)
// - Added HotSeat and PBEM human-human diplomacy support. (17-Oct-2007 Martin G�hmann)
// - Seperated the NewProposal event from the Response event so that the
// NewProposal event can be called from slic witout any problems. (17-Oct-2007 Martin Gühmann)
// NewProposal event can be called from slic witout any problems. (17-Oct-2007 Martin G�hmann)
//
//----------------------------------------------------------------------------

Expand All @@ -41,7 +41,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"
#include "player.h"

#include "Diplomat.h"
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/counterresponseevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"
#include "Diplomat.h"
#include "mapanalysis.h"
#include "ProposalAnalysis.h"
Expand Down
9 changes: 7 additions & 2 deletions ctp2_code/ai/diplomacy/diplomat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#include "dynarr.h"
#include "World.h"
#include "Cell.h"
#include "gold.h"
#include "Gold.h"
#include "AdvanceListRecord.h"
#include "AdvanceRecord.h"
#include "UnitData.h"
Expand All @@ -96,7 +96,7 @@
#include "ctpai.h"
#include "GSLogs.h"
#include "profileDB.h"
#include "aicause.h"
#include "AICause.h"
#include "CivilisationRecord.h"
#include "Civilisation.h"
#include "TurnCnt.h" // g_turn
Expand All @@ -114,6 +114,11 @@
#include "net_diplomacy.h"
#include "RandGen.h" // g_rand

#ifdef __linux__
#include "../ctp/cifm.h"
#define fopen(a, b) ci_fopen(a, b)
#endif

extern sint32 g_saveFileVersion;

namespace
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/dstateevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"
#include "Diplomat.h"
#include "mapanalysis.h"
#include "AgreementMatrix.h"
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/motivationevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "mapanalysis.h"
#include "GoalRecord.h"
#include "Goal.h"
#include "gold.h"
#include "Gold.h"
#include "stringutils.h"
#include "ctpai.h"

Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/nproposalevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include "network.h"
#include "pollution.h"
#include "director.h"
#include "gold.h"
#include "Gold.h"


STDEHANDLER(General_NewProposalEvent)
Expand Down
18 changes: 9 additions & 9 deletions ctp2_code/ai/diplomacy/proposalanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "AgreementMatrix.h"
#include "GSLogs.h"
#include "mapanalysis.h"
#include "gold.h"
#include "Gold.h"
#include "DiplomacyProposalRecord.h"
#include "diplomacyutil.h"

Expand Down Expand Up @@ -375,32 +375,32 @@ void ProposalAnalysis::ComputeResult( const PLAYER_INDEX &sender,
case PROPOSAL_OFFER_REDUCE_NUCLEAR_WEAPONS:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration/2)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_REQUEST_REDUCE_NUCLEAR_WEAPONS:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration/2)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_OFFER_REDUCE_BIO_WEAPONS:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration/2)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_REQUEST_REDUCE_BIO_WEAPONS:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration/2)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_OFFER_REDUCE_NANO_WEAPONS:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration/2)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_REQUEST_REDUCE_NANO_WEAPONS:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration/2)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_OFFER_GIVE_ADVANCE:
{
Expand Down Expand Up @@ -465,12 +465,12 @@ void ProposalAnalysis::ComputeResult( const PLAYER_INDEX &sender,
case PROPOSAL_OFFER_REDUCE_POLLUTION:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_REQUEST_REDUCE_POLLUTION:

if (turns_since_last_agreed >= 0 && turns_since_last_agreed < duration)
scale_regard = std::min((proposal_arg.percent + 0.25), 1.0);
scale_regard = std::min<double>((proposal_arg.percent + 0.25), 1.0);
break;
case PROPOSAL_OFFER_MAP:

Expand Down
4 changes: 2 additions & 2 deletions ctp2_code/ai/diplomacy/proposalresponseevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "UnitData.h"
#include "StrDB.h"
#include "GameEventManager.h"
#include "aicause.h"
#include "AICause.h"
#include "Diplomat.h"
#include "mapanalysis.h"
#include "AgreementMatrix.h"
Expand All @@ -51,7 +51,7 @@
#include "pollution.h"
#include "newturncount.h"
#include "Sci.h"
#include "gold.h"
#include "Gold.h"



Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/regardevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"
#include "Diplomat.h"
#include "player.h"
#include "ArmyData.h"
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/sstateevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"

#include "Diplomat.h"
#include "mapanalysis.h"
Expand Down
2 changes: 1 addition & 1 deletion ctp2_code/ai/diplomacy/threatresponseevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "StrDB.h"
#include "GameEventManager.h"

#include "aicause.h"
#include "AICause.h"
#include "Diplomat.h"
#include "mapanalysis.h"
#include "AgreementMatrix.h"
Expand Down
11 changes: 6 additions & 5 deletions ctp2_code/ai/mapanalysis/mapanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
//
// - Relaxed an Assert to prevent lots of popups with e.g. the CTC mod.
// - Corrected the Distance To Empire Center computation
// - Initialized local variables. (Sep 9th 2005 Martin Gühmann)
// - Standartized code (May 21st 2006 Martin Gühmann)
// - Standartized army strength computation. (30-Apr-2008 Martin Gühmann)
// - Initialized local variables. (Sep 9th 2005 Martin G�hmann)
// - Standartized code (May 21st 2006 Martin G�hmann)
// - Standartized army strength computation. (30-Apr-2008 Martin G�hmann)
// - Added AI attack, defense, ranged, land bombard, sea bombard, and air bombard
// player power grids to the mapanalysis. (30-Apr-2008 Martin Gühmann)
// - Fixed AI city rank calculation. (9-Nov-2009 Martin Gühmann)
// player power grids to the mapanalysis. (30-Apr-2008 Martin G�hmann)
// - Fixed AI city rank calculation. (9-Nov-2009 Martin G�hmann)
//
//----------------------------------------------------------------------------

Expand Down Expand Up @@ -60,6 +60,7 @@
#include <vector>
#include <limits>

template<>
MapGrid < sint32 >::MapGridArray MapGrid < sint32 >::s_scratch;

MapAnalysis MapAnalysis::s_mapAnalysis;
Expand Down
4 changes: 2 additions & 2 deletions ctp2_code/ai/mapanalysis/mapgrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class MapGrid {

~MapGrid()
{
s_scratch.resize(0);
//s_scratch.resize(0);

m_values.free();
//m_values.free(); // no free in valarray, and this is not really needed anyway
}

void Resize(const sint32 & xSize,
Expand Down
3 changes: 2 additions & 1 deletion ctp2_code/ai/mapanalysis/settlemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// - Modified GetSettleTargets so that no settle targets are found that cannot
// be settled, because the player does not has any units for the tile in
// question. (May 20th 2006 Martin Gühmann)
// question. (May 20th 2006 Martin G�hmann)
// - Corrected delete operator for array.
// - Improved settle radius determination on city growth.
//
Expand Down Expand Up @@ -61,6 +61,7 @@ namespace

SettleMap SettleMap::s_settleMap;

template<>
MapGrid<double>::MapGridArray MapGrid<double>::s_scratch;

SettleMap::SettleMap()
Expand Down
6 changes: 3 additions & 3 deletions ctp2_code/ai/strategy/scheduler/Plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@

#include "profileai.h"
#include "debugassert.h"
#include "goal.h"
#include "Goal.h"
#include "Scheduler.h"
#include "Agent.h"
#include "agent.h"
#include "ArmyData.h"
#include "agent.h"
#include "squad_strength.h"
#include "squad_Strength.h"
#include "ctpaidebug.h"

#include "GoalRecord.h"
Expand Down
4 changes: 2 additions & 2 deletions ctp2_code/ai/strategy/scheduler/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#include <algorithm>
#include <list>

#include "goal.h"
#include "Goal.h"
#include "Plan.h"
#include "agent.h"

Expand All @@ -77,7 +77,7 @@
#include "gfx_options.h"
#include "Army.h"
#include "ArmyData.h"
#include "CityData.h"
#include "citydata.h"
#include "World.h"

namespace
Expand Down
7 changes: 7 additions & 0 deletions ctp2_code/ctp/c3.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,16 @@

#if defined(__GNUC__)
#define _MAX_PATH PATH_MAX

#endif // __GNUC__
#include "c3debug.h"
#include "c3errors.h"
#include "aui.h"

#ifdef __linux__
// try to handle Case insisentive stuff globaly here
#include "cifm.h"
#define fopen(a, b) ci_fopen(a, b)
#endif

#endif // __C3_H__
Loading

0 comments on commit 3285b19

Please sign in to comment.