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/Ship.cpp | |
parent | 72bb517271dad40a440533ad0796a88247011199 (diff) | |
download | starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.zip starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.gz starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.bz2 |
Removed MemDebug from FoundationEx
Diffstat (limited to 'Stars45/Ship.cpp')
-rw-r--r-- | Stars45/Ship.cpp | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/Stars45/Ship.cpp b/Stars45/Ship.cpp index 89b582f..531f99f 100644 --- a/Stars45/Ship.cpp +++ b/Stars45/Ship.cpp @@ -11,7 +11,6 @@ Starship class */ -#include "MemDebug.h" #include "Ship.h" #include "ShipAI.h" #include "ShipCtrl.h" @@ -168,7 +167,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int int sys_id = 0; for (int i = 0; i < design->reactors.size(); i++) { - PowerSource* reactor = new(__FILE__,__LINE__) PowerSource(*design->reactors[i]); + PowerSource* reactor = new PowerSource(*design->reactors[i]); reactor->SetShip(this); reactor->SetID(sys_id++); reactors.append(reactor); @@ -176,7 +175,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } for (int i = 0; i < design->drives.size(); i++) { - Drive* drive = new(__FILE__,__LINE__) Drive(*design->drives[i]); + Drive* drive = new Drive(*design->drives[i]); drive->SetShip(this); drive->SetID(sys_id++); @@ -189,7 +188,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->quantum_drive) { - quantum_drive = new(__FILE__,__LINE__) QuantumDrive(*design->quantum_drive); + quantum_drive = new QuantumDrive(*design->quantum_drive); quantum_drive->SetShip(this); quantum_drive->SetID(sys_id++); @@ -202,7 +201,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->farcaster) { - farcaster = new(__FILE__,__LINE__) Farcaster(*design->farcaster); + farcaster = new Farcaster(*design->farcaster); farcaster->SetShip(this); farcaster->SetID(sys_id++); @@ -215,7 +214,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->thruster) { - thruster = new(__FILE__,__LINE__) Thruster(*design->thruster); + thruster = new Thruster(*design->thruster); thruster->SetShip(this); thruster->SetID(sys_id++); @@ -228,7 +227,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->shield) { - shield = new(__FILE__,__LINE__) Shield(*design->shield); + shield = new Shield(*design->shield); shield->SetShip(this); shield->SetID(sys_id++); @@ -237,7 +236,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int reactors[src_index]->AddClient(shield); if (design->shield_model) { - shieldRep = new(__FILE__,__LINE__) ShieldRep; + shieldRep = new ShieldRep; shieldRep->UseModel(design->shield_model); } @@ -245,7 +244,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } for (int i = 0; i < design->flight_decks.size(); i++) { - FlightDeck* deck = new(__FILE__,__LINE__) FlightDeck(*design->flight_decks[i]); + FlightDeck* deck = new FlightDeck(*design->flight_decks[i]); deck->SetShip(this); deck->SetCarrier(this); deck->SetID(sys_id++); @@ -261,14 +260,14 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int if (design->flight_decks.size() > 0) { if (!hangar) { - hangar = new(__FILE__,__LINE__) Hangar; + hangar = new Hangar; hangar->SetShip(this); } } if (design->squadrons.size() > 0) { if (!hangar) { - hangar = new(__FILE__,__LINE__) Hangar; + hangar = new Hangar; hangar->SetShip(this); } @@ -279,7 +278,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->gear) { - gear = new(__FILE__,__LINE__) LandingGear(*design->gear); + gear = new LandingGear(*design->gear); gear->SetShip(this); gear->SetID(sys_id++); @@ -291,7 +290,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->sensor) { - sensor = new(__FILE__,__LINE__) Sensor(*design->sensor); + sensor = new Sensor(*design->sensor); sensor->SetShip(this); sensor->SetID(sys_id++); @@ -308,7 +307,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int int wep_index = 1; for (int i = 0; i < design->weapons.size(); i++) { - Weapon* gun = new(__FILE__,__LINE__) Weapon(*design->weapons[i]); + Weapon* gun = new Weapon(*design->weapons[i]); gun->SetID(sys_id++); gun->SetOwner(this); gun->SetIndex(wep_index++); @@ -332,7 +331,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int int loadout_size = design->hard_points.size(); if (load && loadout_size > 0) { - loadout = new(__FILE__,__LINE__) int[loadout_size]; + loadout = new int[loadout_size]; for (int i = 0; i < loadout_size; i++) { int mounted_weapon = loadout[i] = load[i]; @@ -385,7 +384,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->decoy) { - decoy = new(__FILE__,__LINE__) Weapon(*design->decoy); + decoy = new Weapon(*design->decoy); decoy->SetOwner(this); decoy->SetID(sys_id++); decoy->SetIndex(wep_index++); @@ -398,7 +397,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } for (int i = 0; i < design->navlights.size(); i++) { - NavLight* navlight = new(__FILE__,__LINE__) NavLight(*design->navlights[i]); + NavLight* navlight = new NavLight(*design->navlights[i]); navlight->SetShip(this); navlight->SetID(sys_id++); navlight->SetOffset(((DWORD) this) << 2); @@ -407,7 +406,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->navsys) { - navsys = new(__FILE__,__LINE__) NavSystem(*design->navsys); + navsys = new NavSystem(*design->navsys); navsys->SetShip(this); navsys->SetID(sys_id++); @@ -419,7 +418,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int } if (design->probe) { - probe = new(__FILE__,__LINE__) Weapon(*design->probe); + probe = new Weapon(*design->probe); probe->SetOwner(this); probe->SetID(sys_id++); probe->SetIndex(wep_index++); @@ -435,7 +434,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int Computer* comp = 0; if (design->computers[i]->Subtype() == Computer::FLIGHT) { - flcs = new(__FILE__,__LINE__) FlightComp(*design->computers[i]); + flcs = new FlightComp(*design->computers[i]); flcs->SetShip(this); flcs->SetMode(flcs_mode); @@ -453,7 +452,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int comp = flcs; } else { - comp = new(__FILE__,__LINE__) Computer(*design->computers[i]); + comp = new Computer(*design->computers[i]); } comp->SetShip(this); @@ -466,12 +465,12 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int systems.append(comp); } - radio_orders = new(__FILE__,__LINE__) Instruction("", Point(0,0,0)); + radio_orders = new Instruction("", Point(0,0,0)); // Load Detail Set: for (int i = 0; i < DetailSet::MAX_DETAIL; i++) { if (design->models[i].size() > 0) { - Solid* solid = new(__FILE__,__LINE__) ShipSolid(this); + Solid* solid = new ShipSolid(this); solid->UseModel(design->models[i].at(0)); solid->CreateShadows(1); @@ -479,17 +478,17 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int Point* spin = 0; if (design->offsets[i].size() > 0) - offset = new(__FILE__,__LINE__) Point(*design->offsets[i].at(0)); + offset = new Point(*design->offsets[i].at(0)); if (design->spin_rates.size() > 0) - spin = new(__FILE__,__LINE__) Point(*design->spin_rates.at(0)); + spin = new Point(*design->spin_rates.at(0)); detail_level = detail.DefineLevel(design->feature_size[i], solid, offset, spin); } if (design->models[i].size() > 1) { for (int n = 1; n < design->models[i].size(); n++) { - Solid* solid = new(__FILE__,__LINE__) ShipSolid(this); //Solid; + Solid* solid = new ShipSolid(this); //Solid; solid->UseModel(design->models[i].at(n)); solid->CreateShadows(1); @@ -497,10 +496,10 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int Point* spin = 0; if (design->offsets[i].size() > n) - offset = new(__FILE__,__LINE__) Point(*design->offsets[i].at(n)); + offset = new Point(*design->offsets[i].at(n)); if (design->spin_rates.size() > n) - spin = new(__FILE__,__LINE__) Point(*design->spin_rates.at(n)); + spin = new Point(*design->spin_rates.at(n)); detail.AddToLevel(detail_level, solid, offset, spin); } @@ -512,7 +511,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int rep = detail.GetRep(detail_level); if (design->cockpit_model) { - cockpit = new(__FILE__,__LINE__) Solid; + cockpit = new Solid; cockpit->UseModel(design->cockpit_model); cockpit->SetForeground(true); } @@ -1039,7 +1038,7 @@ Ship::ClearTrack() const int DEFAULT_TRACK_LENGTH = 20; // 10 seconds if (!track) { - track = new(__FILE__,__LINE__) Point[DEFAULT_TRACK_LENGTH]; + track = new Point[DEFAULT_TRACK_LENGTH]; } track[0] = Location(); @@ -1056,7 +1055,7 @@ Ship::UpdateTrack() DWORD time = Clock::GetInstance()->GameTime(); if (!track) { - track = new(__FILE__,__LINE__) Point[DEFAULT_TRACK_LENGTH]; + track = new Point[DEFAULT_TRACK_LENGTH]; track[0] = Location(); ntrack = 1; track_time = time; @@ -1641,7 +1640,7 @@ Ship::HitBy(Shot* shot, Point& impact) if (Class() > DRONE && s->Class() > DRONE) { if (s->IsRogue() && !was_rogue) { - RadioMessage* warn = new(__FILE__,__LINE__) RadioMessage(s, this, RadioMessage::DECLARE_ROGUE); + RadioMessage* warn = new RadioMessage(s, this, RadioMessage::DECLARE_ROGUE); RadioTraffic::Transmit(warn); } else if (!s->IsRogue() && (Clock::GetInstance()->GameTime() - ff_warn_time) > 5000) { @@ -1649,9 +1648,9 @@ Ship::HitBy(Shot* shot, Point& impact) RadioMessage* warn = 0; if (s->GetTarget() == this) - warn = new(__FILE__,__LINE__) RadioMessage(s, this, RadioMessage::WARN_TARGETED); + warn = new RadioMessage(s, this, RadioMessage::WARN_TARGETED); else - warn = new(__FILE__,__LINE__) RadioMessage(s, this, RadioMessage::WARN_ACCIDENT); + warn = new RadioMessage(s, this, RadioMessage::WARN_ACCIDENT); RadioTraffic::Transmit(warn); } @@ -2121,7 +2120,7 @@ Ship::CommandMode() { if (!dir || dir->Type() != ShipCtrl::DIR_TYPE) { const char* msg = "Captain on the bridge"; - RadioVox* vox = new(__FILE__,__LINE__) RadioVox(0, "1", msg); + RadioVox* vox = new RadioVox(0, "1", msg); if (vox) { vox->AddPhrase(msg); @@ -2137,7 +2136,7 @@ Ship::CommandMode() else { const char* msg = "Exec, you have the conn"; - RadioVox* vox = new(__FILE__,__LINE__) RadioVox(0, "1", msg); + RadioVox* vox = new RadioVox(0, "1", msg); if (vox) { vox->AddPhrase(msg); @@ -3651,7 +3650,7 @@ void Ship::DeathSpiral() { if (!killer) - killer = new(__FILE__,__LINE__) ShipKiller(this); + killer = new ShipKiller(this); ListIter<System> iter = systems; while (++iter) @@ -3831,7 +3830,7 @@ Ship::FindWeaponGroup(const char* name) group = iter.value(); if (!group) { - group = new(__FILE__,__LINE__) WeaponGroup(name); + group = new WeaponGroup(name); weapons.append(group); } @@ -4951,7 +4950,7 @@ Ship::SetControls(MotionController* m) if (IsDropping() || IsAttaining()) { if (dir && dir->Type() != DropShipAI::DIR_TYPE) { delete dir; - dir = new(__FILE__,__LINE__) DropShipAI(this); + dir = new DropShipAI(this); } return; @@ -5002,7 +5001,7 @@ Ship::SetControls(MotionController* m) } if (!nav) { - nav = new(__FILE__,__LINE__) NavAI(this); + nav = new NavAI(this); dir = nav; return; } @@ -5020,7 +5019,7 @@ Ship::SetControls(MotionController* m) if (m) { Keyboard::FlushKeys(); m->Acquire(); - dir = new(__FILE__,__LINE__) ShipCtrl(this, m); + dir = new ShipCtrl(this, m); director_info = ContentBundle::GetInstance()->GetText("flcs.auto"); } else if (GetIFF() < 100) { |