diff options
author | Aki <please@ignore.pl> | 2022-03-27 17:42:26 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-27 17:42:26 +0200 |
commit | a12e588079700d55a0b788fea2df7727c2e41f52 (patch) | |
tree | 690072569624c73af5043b3619acaab4d298b1fa /Stars45/CampaignMissionStarship.cpp | |
parent | 72bb517271dad40a440533ad0796a88247011199 (diff) | |
download | starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.zip starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.gz starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.bz2 |
Removed MemDebug from FoundationEx
Diffstat (limited to 'Stars45/CampaignMissionStarship.cpp')
-rw-r--r-- | Stars45/CampaignMissionStarship.cpp | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/Stars45/CampaignMissionStarship.cpp b/Stars45/CampaignMissionStarship.cpp index 35cf9b5..60d88af 100644 --- a/Stars45/CampaignMissionStarship.cpp +++ b/Stars45/CampaignMissionStarship.cpp @@ -13,7 +13,6 @@ dynamic campaign. */ -#include "MemDebug.h" #include "CampaignMissionStarship.h" #include "CampaignMissionRequest.h" #include "Campaign.h" @@ -139,7 +138,7 @@ CampaignMissionStarship::GenerateMission(int id) SelectType(); if (request && request->Script().length()) { - MissionTemplate* mt = new(__FILE__,__LINE__) MissionTemplate(id, request->Script(), campaign->Path()); + MissionTemplate* mt = new MissionTemplate(id, request->Script(), campaign->Path()); if (mt) mt->SetPlayerSquadron(player_group); mission = mt; @@ -152,13 +151,13 @@ CampaignMissionStarship::GenerateMission(int id) found = mission_info != 0; if (found) { - MissionTemplate* mt = new(__FILE__,__LINE__) MissionTemplate(id, mission_info->script, campaign->Path()); + MissionTemplate* mt = new MissionTemplate(id, mission_info->script, campaign->Path()); if (mt) mt->SetPlayerSquadron(player_group); mission = mt; } else { - mission = new(__FILE__,__LINE__) Mission(id); + mission = new Mission(id); if (mission) mission->SetType(mission_type); } @@ -200,7 +199,7 @@ CampaignMissionStarship::GenerateMission(int id) else { delete mission; - mission = new(__FILE__,__LINE__) Mission(id); + mission = new Mission(id); if (!mission) { Exit(); @@ -341,7 +340,7 @@ CampaignMissionStarship::GenerateMissionElements() CreateTargets(); if (ward && player) { - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ESCORT, ward->Name()); + Instruction* obj = new Instruction(Instruction::ESCORT, ward->Name()); if (obj) { switch (mission->Type()) { @@ -439,7 +438,7 @@ CampaignMissionStarship::CreateElements(CombatGroup* g) if (g->Type() == CombatGroup::CARRIER_GROUP && elem->MissionRole() == Mission::ESCORT) { - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ESCORT, cmdr->Name()); + Instruction* obj = new Instruction(Instruction::ESCORT, cmdr->Name()); if (obj) { obj->SetTargetDesc(Text("the ") + g->GetDescription()); elem->AddObjective(obj); @@ -475,7 +474,7 @@ CampaignMissionStarship::CreateSingleElement(CombatGroup* g, CombatUnit* u) return 0; } - MissionElement* elem = new(__FILE__,__LINE__) MissionElement; + MissionElement* elem = new MissionElement; if (!elem) { Exit(); return 0; @@ -546,7 +545,7 @@ CampaignMissionStarship::CreateSingleElement(CombatGroup* g, CombatUnit* u) Text src = name.substring(0, dash); Text dst = name.substring(dash+1, name.length() - (dash+1)); - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::VECTOR, dst + "-" + src); + Instruction* obj = new Instruction(Instruction::VECTOR, dst + "-" + src); if (obj) elem->AddObjective(obj); } @@ -589,7 +588,7 @@ CampaignMissionStarship::CreateSquadron(CombatGroup* g) int live_count = fighter->LiveCount(); int maint_count = (live_count > 4) ? live_count / 2 : 0; - MissionElement* elem = new(__FILE__,__LINE__) MissionElement; + MissionElement* elem = new MissionElement; if (!elem) { Exit(); @@ -668,7 +667,7 @@ CampaignMissionStarship::CreateWardFreight() navpt_loc += delta; - n = new(__FILE__,__LINE__) Instruction(elem->Region(), + n = new Instruction(elem->Region(), navpt_loc, Instruction::VECTOR); if (n) { @@ -683,7 +682,7 @@ CampaignMissionStarship::CreateWardFreight() else rgn2 = *zones[zones.size()-1]->GetRegions()[0]; - n = new(__FILE__,__LINE__) Instruction(rgn2, + n = new Instruction(rgn2, Point(0, 0, 0), Instruction::VECTOR); if (n) { @@ -746,7 +745,7 @@ CampaignMissionStarship::CreateTargetsAssault() if (!player_lead) return; - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ASSAULT, prime_target->Name()); + Instruction* obj = new Instruction(Instruction::ASSAULT, prime_target->Name()); if (obj) { obj->SetTargetDesc(Text("preplanned target '") + prime_target->Name() + "'"); player_lead->AddObjective(obj); @@ -770,7 +769,7 @@ CampaignMissionStarship::CreateTargetsAssault() rloc.SetAzimuth(90*DEGREES); rloc.SetAzimuthVar(45*DEGREES); - instr = new(__FILE__,__LINE__) Instruction(prime_target->Region(), dummy, Instruction::VECTOR); + instr = new Instruction(prime_target->Region(), dummy, Instruction::VECTOR); if (!instr) return; @@ -790,7 +789,7 @@ CampaignMissionStarship::CreateTargetsAssault() rloc2.SetDistance(50e3); rloc2.SetDistanceVar(5e3); - instr = new(__FILE__,__LINE__) Instruction(prime_target->Region(), dummy, Instruction::VECTOR); + instr = new Instruction(prime_target->Region(), dummy, Instruction::VECTOR); if (!instr) return; @@ -823,7 +822,7 @@ CampaignMissionStarship::CreateTargetsAssault() rloc.SetAzimuth(90*DEGREES); rloc.SetAzimuthVar(45*DEGREES); - instr = new(__FILE__,__LINE__) Instruction(prime_target->Region(), dummy, Instruction::ASSAULT); + instr = new Instruction(prime_target->Region(), dummy, Instruction::ASSAULT); if (!instr) return; @@ -844,7 +843,7 @@ CampaignMissionStarship::CreateTargetsAssault() rloc2.SetDistance(50e3); rloc2.SetDistanceVar(5e3); - instr = new(__FILE__,__LINE__) Instruction(prime_target->Region(), dummy, Instruction::ASSAULT); + instr = new Instruction(prime_target->Region(), dummy, Instruction::ASSAULT); if (!instr) return; @@ -900,7 +899,7 @@ CampaignMissionStarship::CreateTargetsPatrol() Point patrol_loc = base_loc + RandomDirection() * Random(170e3, 250e3); - Instruction* n = new(__FILE__,__LINE__) Instruction(region, + Instruction* n = new Instruction(region, patrol_loc, Instruction::PATROL); player->AddNavPoint(n); @@ -908,7 +907,7 @@ CampaignMissionStarship::CreateTargetsPatrol() for (int i = 1; i < player_group_elements.size(); i++) { MissionElement* elem = player_group_elements[i]; - n = new(__FILE__,__LINE__) Instruction(region, + n = new Instruction(region, patrol_loc + RandomDirection() * Random(20e3, 40e3), Instruction::PATROL); if (n) @@ -917,7 +916,7 @@ CampaignMissionStarship::CreateTargetsPatrol() Point loc2 = patrol_loc + RandomDirection() * Random(150e3, 200e3); - n = new(__FILE__,__LINE__) Instruction(region, + n = new Instruction(region, loc2, Instruction::PATROL); if (n) @@ -926,7 +925,7 @@ CampaignMissionStarship::CreateTargetsPatrol() for (int i = 1; i < player_group_elements.size(); i++) { MissionElement* elem = player_group_elements[i]; - n = new(__FILE__,__LINE__) Instruction(region, + n = new Instruction(region, loc2 + RandomDirection() * Random(20e3, 40e3), Instruction::PATROL); @@ -944,7 +943,7 @@ CampaignMissionStarship::CreateTargetsPatrol() if (t < 1) ntries--; } - Instruction* obj = new(__FILE__,__LINE__) Instruction(*n); + Instruction* obj = new Instruction(*n); if (obj) { obj->SetTargetDesc("inbound enemy units"); player->AddObjective(obj); @@ -972,7 +971,7 @@ CampaignMissionStarship::CreateTargetsFreightEscort() elem->SetLocation(ward->Location() + RandomPoint() * 5); - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ASSAULT, ward->Name()); + Instruction* obj = new Instruction(Instruction::ASSAULT, ward->Name()); if (obj) elem->AddObjective(obj); mission->AddElement(elem); @@ -982,14 +981,14 @@ CampaignMissionStarship::CreateTargetsFreightEscort() e2->SetIntelLevel(Intel::KNOWN); e2->SetLocation(elem->Location() + RandomPoint() * 0.25); - Instruction* obj2 = new(__FILE__,__LINE__) Instruction(Instruction::ESCORT, elem->Name()); + Instruction* obj2 = new Instruction(Instruction::ESCORT, elem->Name()); if (obj2) e2->AddObjective(obj2); mission->AddElement(e2); } } - Instruction* obj3 = new(__FILE__,__LINE__) Instruction(mission->GetRegion(), + Instruction* obj3 = new Instruction(mission->GetRegion(), Point(0,0,0), Instruction::PATROL); if (player && obj3) { @@ -1091,7 +1090,7 @@ CampaignMissionStarship::CreateRandomTarget(const char* rgn, Point base_loc) e2->SetRegion(rgn); e2->SetLocation(elem->Location() + RandomPoint() * 0.5); - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ESCORT, elem->Name()); + Instruction* obj = new Instruction(Instruction::ESCORT, elem->Name()); if (obj) e2->AddObjective(obj); @@ -1127,13 +1126,13 @@ CampaignMissionStarship::CreateRandomTarget(const char* rgn, Point base_loc) if (elem) { elem->SetIntelLevel(Intel::KNOWN); elem->Loadouts().destroy(); - elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "Ship Strike")); + elem->Loadouts().append(new MissionLoad(-1, "Ship Strike")); elem->SetRegion(rgn); elem->SetLocation(base_loc + RandomPoint()); mission->AddElement(elem); if (player) { - Instruction* n = new(__FILE__,__LINE__) Instruction(player->Region(), + Instruction* n = new Instruction(player->Region(), player->Location() + RandomPoint(), Instruction::ASSAULT); n->SetTarget(player->Name()); @@ -1154,13 +1153,13 @@ CampaignMissionStarship::CreateRandomTarget(const char* rgn, Point base_loc) if (elem) { elem->SetIntelLevel(Intel::KNOWN); elem->Loadouts().destroy(); - elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "Hvy Ship Strike")); + elem->Loadouts().append(new MissionLoad(-1, "Hvy Ship Strike")); elem->SetRegion(rgn); elem->SetLocation(base_loc + RandomPoint() * 1.3); mission->AddElement(elem); if (player) { - Instruction* n = new(__FILE__,__LINE__) Instruction(player->Region(), + Instruction* n = new Instruction(player->Region(), player->Location() + RandomPoint(), Instruction::ASSAULT); n->SetTarget(player->Name()); @@ -1198,7 +1197,7 @@ CampaignMissionStarship::CreateRandomTarget(const char* rgn, Point base_loc) e2->SetRegion(rgn); e2->SetLocation(elem->Location() + RandomPoint() * 0.5); - Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ESCORT, elem->Name()); + Instruction* obj = new Instruction(Instruction::ESCORT, elem->Name()); if (obj) e2->AddObjective(obj); mission->AddElement(e2); @@ -1240,7 +1239,7 @@ CampaignMissionStarship::CreateFighterPackage(CombatGroup* squadron, int count, return 0; } - MissionElement* elem = new(__FILE__,__LINE__) MissionElement; + MissionElement* elem = new MissionElement; if (!elem) { Exit(); @@ -1265,7 +1264,7 @@ CampaignMissionStarship::CreateFighterPackage(CombatGroup* squadron, int count, elem->SetRegion(fighter->GetRegion()); elem->SetSquadron(fighter->Name()); elem->SetMissionRole(role); - elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "ACM Medium Range")); + elem->Loadouts().append(new MissionLoad(-1, "ACM Medium Range")); if (carrier) elem->SetLocation(carrier->Location() + RandomPoint() * 0.3); @@ -1372,7 +1371,7 @@ CampaignMissionStarship::DescribeMission() strcpy_s(player_info, player->GetCombatGroup()->GetDescription()); } - MissionInfo* info = new(__FILE__,__LINE__) MissionInfo; + MissionInfo* info = new MissionInfo; if (info) { info->id = mission->Identity(); |