summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--FoundationEx/CMakeLists.txt1
-rw-r--r--FoundationEx/Dictionary.inl13
-rw-r--r--FoundationEx/List.inl10
-rw-r--r--FoundationEx/MemDebug.cpp296
-rw-r--r--FoundationEx/MemDebug.h97
-rw-r--r--FoundationEx/Text.cpp89
-rw-r--r--NetEx/HttpClient.cpp6
-rw-r--r--NetEx/HttpServer.cpp34
-rw-r--r--NetEx/HttpServlet.cpp6
-rw-r--r--NetEx/HttpServletExec.cpp6
-rw-r--r--NetEx/NetAddr.cpp3
-rw-r--r--NetEx/NetClient.cpp4
-rw-r--r--NetEx/NetGram.cpp2
-rw-r--r--NetEx/NetHost.cpp5
-rw-r--r--NetEx/NetLayer.cpp2
-rw-r--r--NetEx/NetLink.cpp12
-rw-r--r--NetEx/NetMsg.cpp6
-rw-r--r--NetEx/NetPeer.cpp18
-rw-r--r--NetEx/NetServer.cpp8
-rw-r--r--NetEx/NetSock.cpp3
-rw-r--r--Stars45/ActiveWindow.cpp19
-rw-r--r--Stars45/Archive.cpp21
-rw-r--r--Stars45/Asteroid.cpp15
-rw-r--r--Stars45/AudDlg.cpp1
-rw-r--r--Stars45/AudioConfig.cpp7
-rw-r--r--Stars45/AwardDlg.cpp1
-rw-r--r--Stars45/AwardShowDlg.cpp1
-rw-r--r--Stars45/Bitmap.cpp19
-rw-r--r--Stars45/Bmp.cpp13
-rw-r--r--Stars45/Bmp.h2
-rw-r--r--Stars45/Bolt.cpp1
-rw-r--r--Stars45/Button.cpp1
-rw-r--r--Stars45/Callsign.cpp1
-rw-r--r--Stars45/Camera.cpp1
-rw-r--r--Stars45/CameraDirector.cpp3
-rw-r--r--Stars45/CameraView.cpp1
-rw-r--r--Stars45/Campaign.cpp67
-rw-r--r--Stars45/CampaignMissionFighter.cpp125
-rw-r--r--Stars45/CampaignMissionRequest.cpp1
-rw-r--r--Stars45/CampaignMissionStarship.cpp67
-rw-r--r--Stars45/CampaignPlanAssignment.cpp5
-rw-r--r--Stars45/CampaignPlanEvent.cpp17
-rw-r--r--Stars45/CampaignPlanMission.cpp9
-rw-r--r--Stars45/CampaignPlanMovement.cpp1
-rw-r--r--Stars45/CampaignPlanStrategic.cpp1
-rw-r--r--Stars45/CampaignSaveGame.cpp5
-rw-r--r--Stars45/CampaignSituationReport.cpp1
-rw-r--r--Stars45/CarrierAI.cpp5
-rw-r--r--Stars45/CmdDlg.cpp1
-rw-r--r--Stars45/CmdForceDlg.cpp1
-rw-r--r--Stars45/CmdIntelDlg.cpp3
-rw-r--r--Stars45/CmdMissionsDlg.cpp1
-rw-r--r--Stars45/CmdMsgDlg.cpp1
-rw-r--r--Stars45/CmdOrdersDlg.cpp1
-rw-r--r--Stars45/CmdTheaterDlg.cpp3
-rw-r--r--Stars45/CmdTitleDlg.cpp1
-rw-r--r--Stars45/CmpCompleteDlg.cpp1
-rw-r--r--Stars45/CmpFileDlg.cpp1
-rw-r--r--Stars45/CmpLoadDlg.cpp1
-rw-r--r--Stars45/CmpSceneDlg.cpp3
-rw-r--r--Stars45/CmpSelectDlg.cpp3
-rw-r--r--Stars45/CmpnScreen.cpp19
-rw-r--r--Stars45/Color.cpp1
-rw-r--r--Stars45/CombatAction.cpp7
-rw-r--r--Stars45/CombatAssignment.cpp1
-rw-r--r--Stars45/CombatEvent.cpp1
-rw-r--r--Stars45/CombatGroup.cpp15
-rw-r--r--Stars45/CombatRoster.cpp3
-rw-r--r--Stars45/CombatUnit.cpp1
-rw-r--r--Stars45/CombatZone.cpp9
-rw-r--r--Stars45/Combatant.cpp1
-rw-r--r--Stars45/ComboBox.cpp7
-rw-r--r--Stars45/ComboList.cpp9
-rw-r--r--Stars45/Component.cpp1
-rw-r--r--Stars45/Computer.cpp1
-rw-r--r--Stars45/ConfirmDlg.cpp1
-rw-r--r--Stars45/Contact.cpp3
-rw-r--r--Stars45/ContentBundle.cpp1
-rw-r--r--Stars45/CtlDlg.cpp1
-rw-r--r--Stars45/D3DXImage.cpp7
-rw-r--r--Stars45/DataLoader.cpp15
-rw-r--r--Stars45/DebriefDlg.cpp1
-rw-r--r--Stars45/Debris.cpp3
-rw-r--r--Stars45/DetailSet.cpp13
-rw-r--r--Stars45/DisplayView.cpp5
-rw-r--r--Stars45/Drive.cpp9
-rw-r--r--Stars45/DriveSprite.cpp1
-rw-r--r--Stars45/Drone.cpp1
-rw-r--r--Stars45/DropShipAI.cpp1
-rw-r--r--Stars45/EditBox.cpp3
-rw-r--r--Stars45/Element.cpp3
-rw-r--r--Stars45/Encrypt.cpp9
-rw-r--r--Stars45/EngDlg.cpp1
-rw-r--r--Stars45/EventDispatch.cpp3
-rw-r--r--Stars45/ExitDlg.cpp1
-rw-r--r--Stars45/Explosion.cpp17
-rw-r--r--Stars45/FadeView.cpp1
-rw-r--r--Stars45/Farcaster.cpp1
-rw-r--r--Stars45/FighterAI.cpp5
-rw-r--r--Stars45/FighterTacticalAI.cpp1
-rw-r--r--Stars45/FirstTimeDlg.cpp1
-rw-r--r--Stars45/Fix.cpp1
-rw-r--r--Stars45/FlightComp.cpp1
-rw-r--r--Stars45/FlightDeck.cpp15
-rw-r--r--Stars45/FlightPlanner.cpp31
-rw-r--r--Stars45/FltDlg.cpp7
-rw-r--r--Stars45/Font.cpp13
-rw-r--r--Stars45/FontMgr.cpp3
-rw-r--r--Stars45/FormDef.cpp9
-rw-r--r--Stars45/FormWindow.cpp17
-rw-r--r--Stars45/FormatUtil.cpp1
-rw-r--r--Stars45/Galaxy.cpp11
-rw-r--r--Stars45/Game.cpp3
-rw-r--r--Stars45/GameScreen.cpp43
-rw-r--r--Stars45/GameWinDX9.cpp7
-rw-r--r--Stars45/Geometry.cpp1
-rw-r--r--Stars45/Graphic.cpp1
-rw-r--r--Stars45/Grid.cpp1
-rw-r--r--Stars45/GroundAI.cpp3
-rw-r--r--Stars45/HUDSounds.cpp1
-rw-r--r--Stars45/HUDView.cpp55
-rw-r--r--Stars45/Hangar.cpp3
-rw-r--r--Stars45/HardPoint.cpp3
-rw-r--r--Stars45/Hoop.cpp9
-rw-r--r--Stars45/ImageBox.cpp1
-rw-r--r--Stars45/ImgView.cpp1
-rw-r--r--Stars45/Instruction.cpp1
-rw-r--r--Stars45/Intel.cpp1
-rw-r--r--Stars45/JoyDlg.cpp1
-rw-r--r--Stars45/Joystick.cpp4
-rw-r--r--Stars45/Joystick.h1
-rw-r--r--Stars45/KeyDlg.cpp1
-rw-r--r--Stars45/KeyMap.cpp1
-rw-r--r--Stars45/Keyboard.cpp1
-rw-r--r--Stars45/LandingGear.cpp3
-rw-r--r--Stars45/Layout.cpp1
-rw-r--r--Stars45/Light.cpp1
-rw-r--r--Stars45/ListBox.cpp19
-rw-r--r--Stars45/LoadDlg.cpp1
-rw-r--r--Stars45/LoadScreen.cpp5
-rw-r--r--Stars45/Locale_ss.cpp7
-rw-r--r--Stars45/MCIWave.cpp3
-rw-r--r--Stars45/MachineInfo.cpp5
-rw-r--r--Stars45/Main.cpp11
-rw-r--r--Stars45/MapView.cpp35
-rw-r--r--Stars45/Menu.cpp5
-rw-r--r--Stars45/MenuDlg.cpp1
-rw-r--r--Stars45/MenuScreen.cpp61
-rw-r--r--Stars45/MenuView.cpp1
-rw-r--r--Stars45/Mfd.cpp3
-rw-r--r--Stars45/Mission.cpp17
-rw-r--r--Stars45/Mission.h2
-rw-r--r--Stars45/MissionEvent.cpp7
-rw-r--r--Stars45/MissionTemplate.cpp13
-rw-r--r--Stars45/ModConfig.cpp13
-rw-r--r--Stars45/ModDlg.cpp1
-rw-r--r--Stars45/ModInfo.cpp9
-rw-r--r--Stars45/ModInfoDlg.cpp1
-rw-r--r--Stars45/Mouse.cpp7
-rw-r--r--Stars45/MouseController.cpp1
-rw-r--r--Stars45/MsnDlg.cpp1
-rw-r--r--Stars45/MsnEditDlg.cpp5
-rw-r--r--Stars45/MsnEditNavDlg.cpp1
-rw-r--r--Stars45/MsnElemDlg.cpp5
-rw-r--r--Stars45/MsnEventDlg.cpp5
-rw-r--r--Stars45/MsnNavDlg.cpp1
-rw-r--r--Stars45/MsnObjDlg.cpp5
-rw-r--r--Stars45/MsnPkgDlg.cpp1
-rw-r--r--Stars45/MsnSelectDlg.cpp1
-rw-r--r--Stars45/MsnWepDlg.cpp5
-rw-r--r--Stars45/MultiController.cpp1
-rw-r--r--Stars45/MusicDirector.cpp7
-rw-r--r--Stars45/MusicTrack.cpp1
-rw-r--r--Stars45/NPClientWraps.cpp1
-rw-r--r--Stars45/NavAI.cpp1
-rw-r--r--Stars45/NavDlg.cpp3
-rw-r--r--Stars45/NavLight.cpp5
-rw-r--r--Stars45/NavSystem.cpp1
-rw-r--r--Stars45/NetAddrDlg.cpp1
-rw-r--r--Stars45/NetAdminChat.cpp1
-rw-r--r--Stars45/NetAdminServer.cpp19
-rw-r--r--Stars45/NetAuth.cpp1
-rw-r--r--Stars45/NetBrokerClient.cpp3
-rw-r--r--Stars45/NetChat.cpp1
-rw-r--r--Stars45/NetClientConfig.cpp11
-rw-r--r--Stars45/NetClientDlg.cpp1
-rw-r--r--Stars45/NetData.cpp13
-rw-r--r--Stars45/NetFileServlet.cpp3
-rw-r--r--Stars45/NetGame.cpp5
-rw-r--r--Stars45/NetGameClient.cpp13
-rw-r--r--Stars45/NetGameServer.cpp9
-rw-r--r--Stars45/NetLobby.cpp9
-rw-r--r--Stars45/NetLobbyClient.cpp17
-rw-r--r--Stars45/NetLobbyDlg.cpp3
-rw-r--r--Stars45/NetLobbyServer.cpp19
-rw-r--r--Stars45/NetPacket.cpp3
-rw-r--r--Stars45/NetPassDlg.cpp1
-rw-r--r--Stars45/NetPlayer.cpp3
-rw-r--r--Stars45/NetServerConfig.cpp21
-rw-r--r--Stars45/NetServerDlg.cpp1
-rw-r--r--Stars45/NetUnitDlg.cpp1
-rw-r--r--Stars45/NetUser.cpp1
-rw-r--r--Stars45/NetUtil.cpp1
-rw-r--r--Stars45/OptDlg.cpp1
-rw-r--r--Stars45/PCX.CPP13
-rw-r--r--Stars45/ParseUtil.cpp1
-rw-r--r--Stars45/Parser.cpp31
-rw-r--r--Stars45/Particles.cpp19
-rw-r--r--Stars45/Physical.cpp1
-rw-r--r--Stars45/PlanScreen.cpp13
-rw-r--r--Stars45/Player.cpp13
-rw-r--r--Stars45/PlayerDlg.cpp1
-rw-r--r--Stars45/PngImage.cpp3
-rw-r--r--Stars45/PngImage.h2
-rw-r--r--Stars45/Polygon.cpp59
-rw-r--r--Stars45/Power.cpp1
-rw-r--r--Stars45/Projector.cpp1
-rw-r--r--Stars45/QuantumDrive.cpp1
-rw-r--r--Stars45/QuantumFlash.cpp9
-rw-r--r--Stars45/QuantumView.cpp3
-rw-r--r--Stars45/QuitView.cpp3
-rw-r--r--Stars45/RLoc.cpp1
-rw-r--r--Stars45/RadioHandler.cpp21
-rw-r--r--Stars45/RadioMessage.cpp1
-rw-r--r--Stars45/RadioTraffic.cpp11
-rw-r--r--Stars45/RadioView.cpp29
-rw-r--r--Stars45/RadioVox.cpp3
-rw-r--r--Stars45/Random.cpp1
-rw-r--r--Stars45/Reader.cpp1
-rw-r--r--Stars45/Res.cpp1
-rw-r--r--Stars45/RichTextBox.cpp1
-rw-r--r--Stars45/Scene.cpp1
-rw-r--r--Stars45/Screen.cpp1
-rw-r--r--Stars45/ScrollWindow.cpp1
-rw-r--r--Stars45/SeekerAI.cpp1
-rw-r--r--Stars45/Sensor.cpp15
-rw-r--r--Stars45/Shadow.cpp5
-rw-r--r--Stars45/Shield.cpp1
-rw-r--r--Stars45/ShieldRep.cpp3
-rw-r--r--Stars45/Ship.cpp81
-rw-r--r--Stars45/ShipAI.cpp5
-rw-r--r--Stars45/ShipCtrl.cpp1
-rw-r--r--Stars45/ShipDesign.cpp99
-rw-r--r--Stars45/ShipKiller.cpp1
-rw-r--r--Stars45/ShipSolid.cpp1
-rw-r--r--Stars45/Shot.cpp19
-rw-r--r--Stars45/Sim.cpp49
-rw-r--r--Stars45/SimEvent.cpp5
-rw-r--r--Stars45/SimObject.cpp1
-rw-r--r--Stars45/Skin.cpp3
-rw-r--r--Stars45/Sky.cpp19
-rw-r--r--Stars45/Slider.cpp1
-rw-r--r--Stars45/Solid.cpp59
-rw-r--r--Stars45/Sound.cpp5
-rw-r--r--Stars45/SoundCard.cpp1
-rw-r--r--Stars45/SoundD3D.cpp11
-rw-r--r--Stars45/Sprite.cpp1
-rw-r--r--Stars45/StarServer.cpp11
-rw-r--r--Stars45/StarSystem.cpp35
-rw-r--r--Stars45/Starshatter.cpp59
-rw-r--r--Stars45/StarshipAI.cpp3
-rw-r--r--Stars45/StarshipTacticalAI.cpp3
-rw-r--r--Stars45/SteerAI.cpp9
-rw-r--r--Stars45/System.cpp5
-rw-r--r--Stars45/SystemDesign.cpp7
-rw-r--r--Stars45/TacRefDlg.cpp7
-rw-r--r--Stars45/TacticalAI.cpp5
-rw-r--r--Stars45/TacticalView.cpp33
-rw-r--r--Stars45/Term.cpp1
-rw-r--r--Stars45/Terrain.cpp29
-rw-r--r--Stars45/TerrainApron.cpp11
-rw-r--r--Stars45/TerrainClouds.cpp7
-rw-r--r--Stars45/TerrainHaze.cpp1
-rw-r--r--Stars45/TerrainPatch.cpp17
-rw-r--r--Stars45/TerrainRegion.cpp3
-rw-r--r--Stars45/TexCubeDX9.cpp1
-rw-r--r--Stars45/TexDX9.cpp3
-rw-r--r--Stars45/Thruster.cpp9
-rw-r--r--Stars45/Token.cpp19
-rw-r--r--Stars45/TrackIR.cpp1
-rw-r--r--Stars45/Trail.cpp7
-rw-r--r--Stars45/VidDlg.cpp1
-rw-r--r--Stars45/Video.cpp1
-rw-r--r--Stars45/VideoDX9.cpp41
-rw-r--r--Stars45/VideoDX9Enum.cpp11
-rw-r--r--Stars45/VideoDX9VertexBuffer.cpp1
-rw-r--r--Stars45/VideoFactory.cpp5
-rw-r--r--Stars45/VideoSettings.cpp1
-rw-r--r--Stars45/Water.cpp5
-rw-r--r--Stars45/Weapon.cpp13
-rw-r--r--Stars45/WeaponDesign.cpp13
-rw-r--r--Stars45/WeaponGroup.cpp1
-rw-r--r--Stars45/Weather.cpp1
-rw-r--r--Stars45/WebBrowser.cpp1
-rw-r--r--Stars45/WepView.cpp1
-rw-r--r--Stars45/Window.cpp1
296 files changed, 1070 insertions, 1881 deletions
diff --git a/FoundationEx/CMakeLists.txt b/FoundationEx/CMakeLists.txt
index c2b546b..497c732 100644
--- a/FoundationEx/CMakeLists.txt
+++ b/FoundationEx/CMakeLists.txt
@@ -2,7 +2,6 @@ project(FoundationEx)
add_library(
FoundationEx
STATIC
- MemDebug.cpp
Text.cpp
Utils.cpp
)
diff --git a/FoundationEx/Dictionary.inl b/FoundationEx/Dictionary.inl
index 53ee998..cd58679 100644
--- a/FoundationEx/Dictionary.inl
+++ b/FoundationEx/Dictionary.inl
@@ -63,15 +63,8 @@ T& Dictionary<T>::operator[](const Text& key)
if (cell == 0) { // empty chain
items++;
-
-#ifdef MEM_DEBUG
- cell = new(__FILE__,__LINE__) DictionaryCell<T>(key);
-#else
cell = new DictionaryCell<T>(key);
-#endif
-
table[idx] = cell;
-
return cell->value;
}
else { // search for key
@@ -80,13 +73,7 @@ T& Dictionary<T>::operator[](const Text& key)
if (cell->key != key) { // not found in chain
items++;
-
-#ifdef MEM_DEBUG
- cell->next = new(__FILE__,__LINE__) DictionaryCell<T>(key);
-#else
cell->next = new DictionaryCell<T>(key);
-#endif
-
return cell->next->value;
}
else { // found: return it!
diff --git a/FoundationEx/List.inl b/FoundationEx/List.inl
index e39cc27..5fff962 100644
--- a/FoundationEx/List.inl
+++ b/FoundationEx/List.inl
@@ -21,12 +21,7 @@ template <class T>
List<T>::List(const List<T>& l)
: items(l.items), extent(l.extent)
{
-#ifdef MEM_DEBUG
- array = new(__FILE__,__LINE__) PTR[extent];
-#else
array = new PTR[extent];
-#endif
-
for (int i = 0; i < extent; i++)
array[i] = l.array[i];
}
@@ -123,12 +118,7 @@ void List<T>::resize(int newsize)
{
if (newsize > extent) {
extent = 16 * (newsize/16 + 1);
-
-#ifdef MEM_DEBUG
- T** v = new(__FILE__,__LINE__) PTR[extent];
-#else
T** v = new PTR[extent];
-#endif
int i;
for (i = 0; i < items; i++)
v[i] = array[i];
diff --git a/FoundationEx/MemDebug.cpp b/FoundationEx/MemDebug.cpp
deleted file mode 100644
index 077f06d..0000000
--- a/FoundationEx/MemDebug.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Starshatter: The Open Source Project
- Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
- Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
- Copyright (c) 1997-2006, Destroyer Studios LLC.
-
- AUTHOR: John DiCamillo
-
-
- OVERVIEW
- ========
- Memory Debugging class
-*/
-
-#include "MemDebug.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <crtdbg.h>
-#include <malloc.h>
-
-// +--------------------------------------------------------------------+
-
-#ifndef FOUNDATION_USE_MFC
-static Memory::LEVEL mem_chk_level = Memory::PERIODIC;
-#endif
-
-#ifdef _DEBUG
-static _CrtMemState mem_chk_p1,
- mem_chk_p2;
-#endif
-
-static HANDLE mem_log_file = 0;
-
-// +--------------------------------------------------------------------+
-
-#ifdef _DEBUG
-#define CrtSetDebugField(a) _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
-#define CrtClrDebugField(a) _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
-#endif
-
-#ifdef FOUNDATION_USE_MFC
-
-#ifndef _DEBUG
-
-void* __cdecl operator new(unsigned int s, const char*, int)
-{
- return ::operator new(s);
-}
-
-void __cdecl operator delete(void* p, const char*, int)
-{
- ::operator delete(p);
-}
-
-#else
-
-// No definitions for the following:
-//void* __cdecl operator new(unsigned int s, const char*, int) {}
-//void __cdecl operator delete(void* p, const char*, int) {}
-
-#endif
-
-#else // if not defined FOUNDATION_USE_MFC
-
-#ifndef _DEBUG
-
-void* __cdecl operator new[](unsigned int s, const char*, int)
-{
- return ::operator new[](s);
-}
-
-void* __cdecl operator new(unsigned int s, const char*, int)
-{
- return ::operator new(s);
-}
-
-void __cdecl operator delete[](void* p, const char*, int)
-{
- ::operator delete[](p);
-}
-
-void __cdecl operator delete(void* p, const char*, int)
-{
- ::operator delete(p);
-}
-
-#else
-
-// No definitions for the following:
-//void* __cdecl operator new(unsigned int, int, const char*, int) {}
-
-void* __cdecl operator new[](unsigned int s, const char*, int)
-{
- return ::operator new[](s);
-}
-
-void* __cdecl operator new(unsigned int s, const char* f, int l)
-{
- return ::operator new(s, 1, f, l);
-}
-
-void* __cdecl operator new(unsigned int s)
-{
- return ::operator new(s, 1, __FILE__, __LINE__);
-}
-
-void __cdecl operator delete[](void* p, const char*, int)
-{
- ::operator delete[](p);
-}
-
-void __cdecl operator delete(void* p, const char*, int)
-{
- ::operator delete(p);
-}
-
-#endif // _DEBUG
-
-#endif // FOUNDATION_USE_MFC
-
-static void heapdump()
-{
- _HEAPINFO hinfo;
- int heapstatus;
- DWORD used = 0;
- DWORD avail = 0;
- char report[256];
-
- hinfo._pentry = NULL;
- while ((heapstatus = _heapwalk( &hinfo )) == _HEAPOK) {
- sprintf_s(report, "%6s block at %Fp of size %4.4X\n",
- ( hinfo._useflag == _USEDENTRY ? "USED" : "FREE" ),
- hinfo._pentry, hinfo._size);
-
- _RPT0(_CRT_WARN, report);
-
- if (hinfo._useflag == _USEDENTRY)
- used += hinfo._size;
- else
- avail += hinfo._size;
- }
-
- sprintf_s(report, "------\nUsed Blocks: %d\nAvail Blocks: %d\nTotal Blocks: %d\n", used, avail, used+avail); //-V576
- _RPT0(_CRT_WARN, report);
-
- switch (heapstatus) {
- case _HEAPEMPTY:
- _RPT0(_CRT_WARN, "OK - empty heap\n" );
- break;
- case _HEAPEND:
- _RPT0(_CRT_WARN, "OK - end of heap\n" );
- break;
- case _HEAPBADPTR:
- _RPT0(_CRT_WARN, "ERROR - bad pointer to heap\n" );
- break;
- case _HEAPBADBEGIN:
- _RPT0(_CRT_WARN, "ERROR - bad start of heap\n" );
- break;
- case _HEAPBADNODE:
- _RPT0(_CRT_WARN, "ERROR - bad node in heap\n" );
- break;
- }
-}
-
-// +--------------------------------------------------------------------+
-
-#ifndef FOUNDATION_USE_MFC
-void
-Memory::OpenLog(const char* filename)
-{
-#ifdef _DEBUG
- if (!filename || !strlen(filename))
- filename = "memdbg.txt";
-
- mem_log_file = CreateFile(filename, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
-
- if (mem_log_file) {
- _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- _CrtSetReportFile(_CRT_WARN, mem_log_file);
- _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- _CrtSetReportFile(_CRT_ERROR, mem_log_file);
- _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- _CrtSetReportFile(_CRT_ASSERT, mem_log_file);
- }
-
- _CrtMemCheckpoint(&mem_chk_p1);
-#endif
-}
-
-// +--------------------------------------------------------------------+
-
-void
-Memory::CloseLog()
-{
-#ifdef _DEBUG
- if (mem_log_file) {
- CloseHandle(mem_log_file);
- mem_log_file = 0;
-
- _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
- _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
- _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
- }
-#endif
-}
-
-// +--------------------------------------------------------------------+
-
-void
-Memory::Check()
-{
-#ifdef _DEBUG
- if (! _CrtCheckMemory()) {
- _RPT0(_CRT_ERROR, "\n\nMemory Check Failed.\n");
- heapdump();
- Checkpoint();
- _asm { int 3 }
- exit(1111);
- }
-#endif
-}
-
-// +--------------------------------------------------------------------+
-
-void
-Memory::Checkpoint()
-{
-#ifdef _DEBUG
- if (mem_chk_level < PERIODIC) return;
-
- _RPT0(_CRT_WARN, "\n\nMemory Checkpoint:\n"
- "--------------------------------------------------\n");
-
- _CrtMemState s;
- _CrtMemCheckpoint(&mem_chk_p2);
- _CrtMemDifference(&s, &mem_chk_p1, &mem_chk_p2);
- _CrtMemDumpStatistics(&s);
-
- memcpy(&mem_chk_p1, &mem_chk_p2, sizeof(mem_chk_p1));
-#endif
-}
-
-// +--------------------------------------------------------------------+
-
-void
-Memory::Stats()
-{
-#ifdef _DEBUG
- if (mem_chk_level < PERIODIC) return;
-
- _RPT0(_CRT_WARN, "\n\nMemory Stats:\n"
- "--------------------------------------------------\n");
-
- _CrtMemState s;
- _CrtMemCheckpoint(&s);
- _CrtMemDumpStatistics(&s);
-#endif
-}
-
-// +--------------------------------------------------------------------+
-
-void
-Memory::DumpLeaks()
-{
-#ifdef _DEBUG
- _RPT0(_CRT_WARN, "\n\nMemory Dump Leaks:\n"
- "--------------------------------------------------\n");
- _CrtDumpMemoryLeaks();
-#endif
-}
-
-// +--------------------------------------------------------------------+
-
-void
-Memory::SetLevel(LEVEL l)
-{
-#ifdef _DEBUG
- mem_chk_level = l;
-
- _CrtSetDbgFlag(0);
-
- switch (mem_chk_level) {
- case MAXIMAL: CrtSetDebugField(_CRTDBG_CHECK_ALWAYS_DF);
- case PERIODIC: CrtSetDebugField(_CRTDBG_DELAY_FREE_MEM_DF);
- case LEAKS: CrtSetDebugField(_CRTDBG_LEAK_CHECK_DF);
- case OFF:
- default: break;
- }
-#endif
-}
-
-#endif
-
diff --git a/FoundationEx/MemDebug.h b/FoundationEx/MemDebug.h
deleted file mode 100644
index c54b776..0000000
--- a/FoundationEx/MemDebug.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Starshatter: The Open Source Project
- Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
- Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
- Copyright (c) 1997-2006, Destroyer Studios LLC.
-
- AUTHOR: John DiCamillo
-
-
- OVERVIEW
- ========
- Memory Debugging class
-*/
-
-
-#ifndef MemDebug_h
-#define MemDebug_h
-
-// +--------------------------------------------------------------------+
-
-#ifdef WIN32
-#include <windows.h>
-#include <windowsx.h>
-#endif
-
-#ifdef FOUNDATION_USE_MFC
-
-#ifndef _DEBUG
-
-void* __cdecl operator new[](unsigned int, const char*, int);
-void* __cdecl operator new(unsigned int s, const char*, int);
-void __cdecl operator delete[](void* p, const char*, int);
-void __cdecl operator delete(void* p, const char*, int);
-
-#else
-
-void* __cdecl operator new[](unsigned int, const char*, int);
-void* __cdecl operator new(unsigned int s, const char*, int);
-void __cdecl operator delete[](void* p, const char*, int);
-void __cdecl operator delete(void* p, const char*, int);
-
-#endif
-
-#else
-
-//
-// MEMORY DEBUGGING NOT SUPPORTED UNDER MFC
-//
-
-// +--------------------------------------------------------------------+
-
-class Memory
-{
-public:
- enum LEVEL { OFF, LEAKS, PERIODIC, MAXIMAL };
-
- static void OpenLog(const char* filename=0);
- static void CloseLog();
-
- static void Check();
- static void Checkpoint();
- static void Stats();
- static void DumpLeaks();
-
- static void SetLevel(LEVEL l);
-};
-
-// +--------------------------------------------------------------------+
-
-#ifndef _DEBUG
-
-void* __cdecl operator new[](unsigned int, const char*, int);
-void* __cdecl operator new(unsigned int s, const char*, int);
-void __cdecl operator delete[](void* p, const char*, int);
-void __cdecl operator delete(void* p, const char*, int);
-
-#else
-/*_CRTIMP*/
-void* __cdecl operator new[](unsigned int, const char*, int);
-
-void* __cdecl operator new(unsigned int, int, const char*, int);
-
-void* __cdecl operator new(unsigned int s, const char* f, int l);
-
-void* __cdecl operator new(unsigned int s);
-
-void __cdecl operator delete[](void* p, const char*, int);
-
-void __cdecl operator delete(void* p, const char*, int);
-
-#endif // _DEBUG
-
-// +--------------------------------------------------------------------+
-
-#endif // FOUNDATION_USE_MFC
-
-#endif // MemDebug_h
-
diff --git a/FoundationEx/Text.cpp b/FoundationEx/Text.cpp
index 235bbaa..e73149a 100644
--- a/FoundationEx/Text.cpp
+++ b/FoundationEx/Text.cpp
@@ -11,7 +11,6 @@
Implementation of the Text class
*/
-#include "MemDebug.h"
#include "Text.h"
#include "stdio.h"
#include <ctype.h>
@@ -26,11 +25,7 @@ TextRep TextRep::nullrep;
TextRep::TextRep()
: ref(1234567), data(0), length(0), hash(0), sensitive(true)
{
-#ifdef MEM_DEBUG
- data = new(__FILE__,__LINE__) char[4];
-#else
data = new char[4];
-#endif
if (data)
ZeroMemory(data, 4);
@@ -46,11 +41,7 @@ TextRep::TextRep(const char* s)
{
if (s) length = ::strlen(s);
-#ifdef MEM_DEBUG
- data = new(__FILE__,__LINE__) char[length+1];
-#else
data = new char[length+1];
-#endif
if (data) {
if (s) ::strcpy(data, s);
@@ -65,11 +56,7 @@ TextRep::TextRep(const char* s, int len)
{
if (length < 0) length = 0;
-#ifdef MEM_DEBUG
- data = new(__FILE__,__LINE__) char[length+1];
-#else
data = new char[length+1];
-#endif
if (data) {
::CopyMemory(data, s, length);
@@ -83,11 +70,7 @@ TextRep::TextRep(char c, int len)
{
if (length < 0) length = 0;
-#ifdef MEM_DEBUG
- data = new(__FILE__,__LINE__) char[length+1];
-#else
data = new char[length+1];
-#endif
if (data) {
::FillMemory(data, length, c);
@@ -101,11 +84,7 @@ TextRep::TextRep(const TextRep* rep)
{
length = rep->length;
-#ifdef MEM_DEBUG
- data = new(__FILE__,__LINE__) char[length+1];
-#else
data = new char[length+1];
-#endif
hash = rep->hash;
sensitive = rep->sensitive;
@@ -177,11 +156,7 @@ Text::Text(char c)
{
char buf[2]; buf[0] = c; buf[1] = '\0';
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(buf);
-#else
rep = new TextRep(buf);
-#endif
if (!rep) {
rep = &TextRep::nullrep;
@@ -193,11 +168,7 @@ Text::Text(char c)
Text::Text(const char* s)
{
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(s);
-#else
rep = new TextRep(s);
-#endif
if (!rep) {
rep = &TextRep::nullrep;
@@ -209,11 +180,7 @@ Text::Text(const char* s)
Text::Text(const char* s, int len)
{
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(s, len);
-#else
rep = new TextRep(s, len);
-#endif
if (!rep) {
rep = &TextRep::nullrep;
@@ -225,11 +192,7 @@ Text::Text(const char* s, int len)
Text::Text(char c, int len)
{
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(c, len);
-#else
rep = new TextRep(c, len);
-#endif
if (!rep) {
rep = &TextRep::nullrep;
@@ -258,11 +221,7 @@ Text&
Text::operator=(const char* s)
{
if (rep->deref() == 0) delete rep;
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(s);
-#else
rep = new TextRep(s);
-#endif
if (!rep)
rep = &TextRep::nullrep;
@@ -283,11 +242,7 @@ Text::operator=(const Text& s)
Text
Text::operator+(char c)
{
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[rep->length + 2];
-#else
char* buf = new char[rep->length + 2];
-#endif
if (buf) {
::strcpy(buf, sym);
@@ -306,11 +261,7 @@ Text::operator+(char c)
Text
Text::operator+(const char* s)
{
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[::strlen(s) + rep->length + 1];
-#else
char* buf = new char[::strlen(s) + rep->length + 1];
-#endif
if (buf) {
::strcpy(buf, sym);
@@ -328,11 +279,7 @@ Text::operator+(const char* s)
Text
Text::operator+(const Text& s)
{
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[s.rep->length + rep->length + 1];
-#else
char* buf = new char[s.rep->length + rep->length + 1];
-#endif
if (buf) {
::strcpy(buf, sym);
@@ -362,11 +309,7 @@ Text::setSensitive(bool s)
Text&
Text::append(char c)
{
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[rep->length + 2];
-#else
char* buf = new char[rep->length + 2];
-#endif
if (buf) {
::strcpy(buf, sym);
@@ -374,11 +317,7 @@ Text::append(char c)
buf[rep->length+1] = '\0';
if (rep->deref() == 0) delete rep;
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(buf);
-#else
rep = new TextRep(buf);
-#endif
if (!rep)
rep = &TextRep::nullrep;
@@ -393,22 +332,14 @@ Text::append(char c)
Text&
Text::append(const char* s)
{
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[::strlen(s) + rep->length + 1];
-#else
char* buf = new char[::strlen(s) + rep->length + 1];
-#endif
if (buf) {
::strcpy(buf, sym);
::strcat(buf, s);
if (rep->deref() == 0) delete rep;
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(buf);
-#else
rep = new TextRep(buf);
-#endif
if (!rep)
rep = &TextRep::nullrep;
@@ -423,11 +354,7 @@ Text::append(const char* s)
Text&
Text::append(const Text& s)
{
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[s.rep->length + rep->length + 1];
-#else
char* buf = new char[s.rep->length + rep->length + 1];
-#endif
if (buf) {
int lenA = rep->length;
@@ -439,11 +366,7 @@ Text::append(const Text& s)
if (rep->deref() == 0) delete rep;
-#ifdef MEM_DEBUG
- rep = new(__FILE__,__LINE__) TextRep(buf, lenA + lenB);
-#else
rep = new TextRep(buf);
-#endif
if (!rep)
rep = &TextRep::nullrep;
@@ -461,11 +384,7 @@ Text::clone()
if (rep->ref > 1) {
rep->deref();
-#ifdef MEM_DEBUG
- TextRep* t = new(__FILE__,__LINE__) TextRep(rep);
-#else
TextRep* t = new TextRep(rep);
-#endif
rep = t;
@@ -522,11 +441,7 @@ Text::operator()(int start, int len) const
if (start + len > rep->length)
len = rep->length - start;
-#ifdef MEM_DEBUG
- char* buf = new(__FILE__,__LINE__) char[len+1];
-#else
char* buf = new char[len+1];
-#endif
if (buf) {
::strncpy(buf, sym+start, len);
@@ -689,11 +604,7 @@ Text::substring(int start, int length)
const char* s = sym + start;
-#ifdef MEM_DEBUG
- result.rep = new(__FILE__,__LINE__) TextRep(s, length);
-#else
result.rep = new TextRep(s, length);
-#endif
if (!result.rep)
result.rep = &TextRep::nullrep;
diff --git a/NetEx/HttpClient.cpp b/NetEx/HttpClient.cpp
index 710ab88..5b62a51 100644
--- a/NetEx/HttpClient.cpp
+++ b/NetEx/HttpClient.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpClient.h"
#include "NetHost.h"
#include "NetLayer.h"
@@ -38,7 +36,7 @@ HttpClient::DoRequest(HttpRequest& request)
Text req = request.operator Text();
Text msg = SendRecv(req);
- HttpResponse* response = new(__FILE__,__LINE__) HttpResponse(msg);
+ HttpResponse* response = new HttpResponse(msg);
if (response) {
// save cookies returned in response:
@@ -59,7 +57,7 @@ HttpClient::CombineCookies(List<HttpParam>& dst, List<HttpParam>& src)
d->value = s->value;
}
else {
- HttpParam* cookie = new(__FILE__,__LINE__) HttpParam(s->name, s->value);
+ HttpParam* cookie = new HttpParam(s->name, s->value);
if (cookie)
dst.append(cookie);
}
diff --git a/NetEx/HttpServer.cpp b/NetEx/HttpServer.cpp
index 9a63577..8098351 100644
--- a/NetEx/HttpServer.cpp
+++ b/NetEx/HttpServer.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpServer.h"
#include "NetLayer.h"
@@ -313,7 +311,7 @@ HttpRequest::ParseRequest(Text request)
if (*pQuery == '&')
pQuery++;
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, DecodeParam(value_buf));
+ HttpParam* param = new HttpParam(name_buf, DecodeParam(value_buf));
if (param)
query.append(param);
}
@@ -347,7 +345,7 @@ HttpRequest::ParseRequest(Text request)
ParseCookie(value_buf);
}
else {
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, value_buf);
+ HttpParam* param = new HttpParam(name_buf, value_buf);
if (param)
headers.append(param);
}
@@ -385,7 +383,7 @@ HttpRequest::ParseRequest(Text request)
if (*pQuery == '&')
pQuery++;
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, DecodeParam(value_buf));
+ HttpParam* param = new HttpParam(name_buf, DecodeParam(value_buf));
if (param)
query.append(param);
}
@@ -435,7 +433,7 @@ HttpRequest::ParseCookie(const char* param)
if (*p == ';')
p++;
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, data);
+ HttpParam* param = new HttpParam(name, data);
if (param)
cookies.append(param);
}
@@ -492,7 +490,7 @@ HttpRequest::SetHeader(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -500,7 +498,7 @@ HttpRequest::SetHeader(const char* name, const char* value)
void
HttpRequest::AddHeader(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -534,7 +532,7 @@ HttpRequest::SetCookie(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -542,7 +540,7 @@ HttpRequest::SetCookie(const char* name, const char* value)
void
HttpRequest::AddCookie(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -564,7 +562,7 @@ HttpRequest::DecodeParam(const char* value)
char* p = sbuf;
if (size > 255) {
- lbuf = new(__FILE__,__LINE__) char[size+1];
+ lbuf = new char[size+1];
dst = lbuf;
p = lbuf;
}
@@ -618,7 +616,7 @@ HttpRequest::EncodeParam(const char* value)
char* p = sbuf;
if (size > 255) {
- lbuf = new(__FILE__,__LINE__) char[4*size+1];
+ lbuf = new char[4*size+1];
dst = lbuf;
p = lbuf;
}
@@ -820,7 +818,7 @@ HttpResponse::SetHeader(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -828,7 +826,7 @@ HttpResponse::SetHeader(const char* name, const char* value)
void
HttpResponse::AddHeader(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -862,7 +860,7 @@ HttpResponse::SetCookie(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -870,7 +868,7 @@ HttpResponse::SetCookie(const char* name, const char* value)
void
HttpResponse::AddCookie(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -927,7 +925,7 @@ HttpResponse::ParseResponse(Text response)
ParseCookie(value_buf);
}
else {
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, value_buf);
+ HttpParam* param = new HttpParam(name_buf, value_buf);
if (param)
headers.append(param);
}
@@ -987,7 +985,7 @@ HttpResponse::ParseCookie(const char* param)
// ignore the version attribute
if (_stricmp(name, "version")) {
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, data);
+ HttpParam* param = new HttpParam(name, data);
if (param)
cookies.append(param);
}
diff --git a/NetEx/HttpServlet.cpp b/NetEx/HttpServlet.cpp
index 40632cd..eb9f19e 100644
--- a/NetEx/HttpServlet.cpp
+++ b/NetEx/HttpServlet.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpServlet.h"
#include "NetLayer.h"
@@ -131,7 +129,7 @@ HttpSession::SetAttribute(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
attributes.append(param);
}
@@ -184,7 +182,7 @@ HttpSession::SetIntAttribute(const char* name, int value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, buf);
+ HttpParam* param = new HttpParam(name, buf);
if (param)
attributes.append(param);
}
diff --git a/NetEx/HttpServletExec.cpp b/NetEx/HttpServletExec.cpp
index 434945e..357a5f8 100644
--- a/NetEx/HttpServletExec.cpp
+++ b/NetEx/HttpServletExec.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpServletExec.h"
#include "HttpServlet.h"
#include "NetLayer.h"
@@ -120,7 +118,7 @@ HttpServletExec::~HttpServletExec()
HttpServlet*
HttpServletExec::GetServlet(HttpRequest& request)
{
- return new(__FILE__,__LINE__) HttpTestServlet;
+ return new HttpTestServlet;
}
// +--------------------------------------------------------------------+
@@ -144,7 +142,7 @@ HttpServletExec::GetSession(HttpRequest& request)
}
if (!session) {
- session = new(__FILE__,__LINE__) HttpSession;
+ session = new HttpSession;
if (session) {
sessions.append(session);
diff --git a/NetEx/NetAddr.cpp b/NetEx/NetAddr.cpp
index 2e043f1..62eb24a 100644
--- a/NetEx/NetAddr.cpp
+++ b/NetEx/NetAddr.cpp
@@ -11,13 +11,12 @@
Network Address
*/
-
-#include "MemDebug.h"
#include "NetAddr.h"
#include "NetHost.h"
#include "NetLayer.h"
#include <ctype.h>
+
NetAddr::NetAddr(const char* host_name, WORD p)
: addr(0), port(p)
{
diff --git a/NetEx/NetClient.cpp b/NetEx/NetClient.cpp
index 7e7e7b9..a334d64 100644
--- a/NetEx/NetClient.cpp
+++ b/NetEx/NetClient.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "NetClient.h"
#include "NetHost.h"
#include "NetLayer.h"
@@ -39,7 +37,7 @@ NetClient::Send(Text msg)
if (sock)
delete sock;
- sock = new(__FILE__,__LINE__) NetSock(addr, true);
+ sock = new NetSock(addr, true);
delta = 0;
time = timeGetTime();
diff --git a/NetEx/NetGram.cpp b/NetEx/NetGram.cpp
index a2dc346..701d562 100644
--- a/NetEx/NetGram.cpp
+++ b/NetEx/NetGram.cpp
@@ -11,8 +11,6 @@
Generic Network Packet (Datagram) Implementation
*/
-
-#include "MemDebug.h"
#include "NetGram.h"
#include "NetLayer.h"
diff --git a/NetEx/NetHost.cpp b/NetEx/NetHost.cpp
index dca3de0..1c24ff0 100644
--- a/NetEx/NetHost.cpp
+++ b/NetEx/NetHost.cpp
@@ -11,12 +11,11 @@
Network Host
*/
-
-#include "MemDebug.h"
#include "NetHost.h"
#include "NetLayer.h"
#include <ctype.h>
+
NetHost::NetHost()
{
char host_name[256];
@@ -54,7 +53,7 @@ void NetHost::Init(const char* host_name)
char** addr = h->h_addr_list;
while (*addr) {
- NetAddr* pna = new(__FILE__,__LINE__) NetAddr(**(DWORD**) addr);
+ NetAddr* pna = new NetAddr(**(DWORD**) addr);
if (pna)
addresses.append(pna);
addr++;
diff --git a/NetEx/NetLayer.cpp b/NetEx/NetLayer.cpp
index 029091b..c67c6a4 100644
--- a/NetEx/NetLayer.cpp
+++ b/NetEx/NetLayer.cpp
@@ -11,8 +11,6 @@
Wrapper for WinSock Library
*/
-
-#include "MemDebug.h"
#include <windows.h>
#include "NetLayer.h"
diff --git a/NetEx/NetLink.cpp b/NetEx/NetLink.cpp
index a1b83e7..bbba59b 100644
--- a/NetEx/NetLink.cpp
+++ b/NetEx/NetLink.cpp
@@ -11,8 +11,6 @@
Network (IP) Socket Wrapper Implementation
*/
-
-#include "MemDebug.h"
#include "NetLink.h"
#include "NetGram.h"
#include "NetMsg.h"
@@ -94,7 +92,7 @@ NetLink::AddPeer(const NetAddr& a)
NetPeer* peer = FindPeer(a);
if (!peer) {
- peer = new(__FILE__, __LINE__) NetPeer(a, base_netid++);
+ peer = new NetPeer(a, base_netid++);
if (peer)
peer_list.append(peer);
}
@@ -110,13 +108,13 @@ NetLink::AddPeer(const NetAddr& a)
bool
NetLink::SendMessage(DWORD nid, void* d, int l, BYTE f)
{
- return SendMessage(new(__FILE__,__LINE__) NetMsg(nid, d, l, f));
+ return SendMessage(new NetMsg(nid, d, l, f));
}
bool
NetLink::SendMessage(DWORD nid, BYTE type, const char* text, int len, BYTE f)
{
- return SendMessage(new(__FILE__,__LINE__) NetMsg(nid, type, text, len, f));
+ return SendMessage(new NetMsg(nid, type, text, len, f));
}
bool
@@ -323,7 +321,7 @@ NetLink::RecvNetGram()
packets_recv += 1;
bytes_recv += msg.length() + UDP_HEADER_SIZE;
- return new(__FILE__, __LINE__) NetGram(from, msg);
+ return new NetGram(from, msg);
}
// +--------------------------------------------------------------------+
@@ -392,7 +390,7 @@ NetLink::QueueNetGram(NetGram* gram)
sequence = peer->Sequence();
}
else {
- peer = new(__FILE__, __LINE__) NetPeer(gram->Address(), base_netid++);
+ peer = new NetPeer(gram->Address(), base_netid++);
if (peer)
peer_list.append(peer);
}
diff --git a/NetEx/NetMsg.cpp b/NetEx/NetMsg.cpp
index a63bfc0..63489d9 100644
--- a/NetEx/NetMsg.cpp
+++ b/NetEx/NetMsg.cpp
@@ -11,8 +11,6 @@
User level network message
*/
-
-#include "MemDebug.h"
#include <windows.h>
#include "NetMsg.h"
@@ -25,7 +23,7 @@ static DWORD net_msg_sequence = 1;
NetMsg::NetMsg(DWORD nid, void* d, int l, BYTE f)
: msgid(net_msg_sequence++), netid(nid), len(l), flags(f)
{
- data = new(__FILE__,__LINE__) BYTE[len];
+ data = new BYTE[len];
if (data) {
CopyMemory(data, d, len);
@@ -45,7 +43,7 @@ NetMsg::NetMsg(DWORD nid, void* d, int l, BYTE f)
NetMsg::NetMsg(DWORD nid, BYTE type, const char* text, int l, BYTE f)
: msgid(net_msg_sequence++), netid(nid), len(2+l), flags(f)
{
- data = new(__FILE__,__LINE__) BYTE[len];
+ data = new BYTE[len];
if (data) {
data[0] = type;
diff --git a/NetEx/NetPeer.cpp b/NetEx/NetPeer.cpp
index 4ba22a5..a324f94 100644
--- a/NetEx/NetPeer.cpp
+++ b/NetEx/NetPeer.cpp
@@ -11,8 +11,6 @@
One side of a UDP net link connection
*/
-
-#include "MemDebug.h"
#include <windows.h>
#include "NetPeer.h"
#include "NetGram.h"
@@ -105,10 +103,10 @@ NetPeer::SendMessage(NetMsg* msg)
CopyMemory(multi_part_buffer.payload, p, part_size);
p += part_size;
- part = new(__FILE__,__LINE__) NetMsg(msg->NetID(),
- &multi_part_buffer,
- header_size + part_size,
- msg->Flags());
+ part = new NetMsg(msg->NetID(),
+ &multi_part_buffer,
+ header_size + part_size,
+ msg->Flags());
if (part) {
list->append(part);
@@ -205,7 +203,7 @@ NetPeer::ComposeGram()
}
if (xmit_size > 0 && nmsg > 0) {
- BYTE* buffer = new(__FILE__,__LINE__) BYTE[xmit_size];
+ BYTE* buffer = new BYTE[xmit_size];
BYTE* p = buffer;
if (multi_msg) {
@@ -250,7 +248,7 @@ NetPeer::ComposeGram()
if (hist_indx >= HIST_SIZE)
hist_indx = 0;
- g = new(__FILE__,__LINE__) NetGram(addr, user_data, retries);
+ g = new NetGram(addr, user_data, retries);
delete[] buffer;
}
}
@@ -291,7 +289,7 @@ NetPeer::ReceiveGram(NetGram* g, List<NetMsg>* q)
if (!block_type || !block_size)
break;
- NetMsg* msg = new(__FILE__,__LINE__) NetMsg(netid, p, block_size);
+ NetMsg* msg = new NetMsg(netid, p, block_size);
if (msg) {
if (msg->Type() < NetMsg::RESERVED) {
@@ -427,7 +425,7 @@ NetPeer::CheckMultiRecv(List<NetMsg>* q)
}
}
- NetMsg* msg = new(__FILE__,__LINE__) NetMsg(netid, buffer, a->nbytes, NetMsg::RELIABLE);
+ NetMsg* msg = new NetMsg(netid, buffer, a->nbytes, NetMsg::RELIABLE);
if (msg) {
recv_list.insertSort(msg);
diff --git a/NetEx/NetServer.cpp b/NetEx/NetServer.cpp
index 8de804b..7681aa1 100644
--- a/NetEx/NetServer.cpp
+++ b/NetEx/NetServer.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "NetServer.h"
#include "NetHost.h"
#include "NetLayer.h"
@@ -42,9 +40,9 @@ NetServer::NetServer(WORD port, int nthreads)
if (poolsize < 1) poolsize = 1;
- pool = new(__FILE__,__LINE__) HANDLE[poolsize];
- conn = new(__FILE__,__LINE__) NetSock*[poolsize];
- clients = new(__FILE__,__LINE__) NetAddr[poolsize];
+ pool = new HANDLE[poolsize];
+ conn = new NetSock*[poolsize];
+ clients = new NetAddr[poolsize];
if (pool && conn && clients) {
ZeroMemory(pool, poolsize * sizeof(HANDLE));
diff --git a/NetEx/NetSock.cpp b/NetEx/NetSock.cpp
index 9a6f7e9..5d4f35d 100644
--- a/NetEx/NetSock.cpp
+++ b/NetEx/NetSock.cpp
@@ -15,7 +15,6 @@
// WINSOCK2.H MUST COME FIRST!!
#include <winsock2.h>
-#include "MemDebug.h"
#include "NetSock.h"
#include "NetLayer.h"
@@ -111,7 +110,7 @@ NetSock::accept(NetAddr* addr)
if (conn == INVALID_SOCKET)
return 0;
- return new(__FILE__,__LINE__) NetSock(conn, stream);
+ return new NetSock(conn, stream);
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/ActiveWindow.cpp b/Stars45/ActiveWindow.cpp
index f65a3c3..4c99ef8 100644
--- a/Stars45/ActiveWindow.cpp
+++ b/Stars45/ActiveWindow.cpp
@@ -12,7 +12,6 @@
*/
#include <vector>
-#include "MemDebug.h"
#include "ActiveWindow.h"
#include "EventDispatch.h"
#include "Color.h"
@@ -180,7 +179,7 @@ const std::vector<float>& weight_x,
const std::vector<float>& weight_y)
{
if (!layout)
- layout = new(__FILE__,__LINE__) Layout;
+ layout = new Layout;
if (layout)
layout->SetConstraints(min_x, min_y, weight_x, weight_y);
@@ -193,7 +192,7 @@ const std::vector<float>& weight_x,
const std::vector<float>& weight_y)
{
if (!layout)
- layout = new(__FILE__,__LINE__) Layout;
+ layout = new Layout;
if (layout)
layout->SetConstraints(min_x, min_y, weight_x, weight_y);
@@ -208,7 +207,7 @@ float* weight_x,
float* weight_y)
{
if (!layout)
- layout = new(__FILE__,__LINE__) Layout;
+ layout = new Layout;
if (layout)
layout->SetConstraints(nrows, ncols, min_x, min_y, weight_x, weight_y);
@@ -340,7 +339,7 @@ ActiveWindow::CalcGrid()
tex_w = (float) texture->Width();
tex_h = (float) texture->Height();
- vset = new(__FILE__,__LINE__) VertexSet(nverts);
+ vset = new VertexSet(nverts);
int v = 0;
@@ -365,10 +364,10 @@ ActiveWindow::CalcGrid()
}
}
- mtl = new(__FILE__,__LINE__) Material;
+ mtl = new Material;
mtl->tex_diffuse = texture;
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ polys = new Poly[npolys];
Poly* p = polys;
@@ -602,7 +601,7 @@ ActiveWindow::SetText(const char* t)
int len = strlen(t);
if (len > 0) {
- char* buf = new(__FILE__,__LINE__) char[2*len];
+ char* buf = new char[2*len];
if (buf != 0) {
const char* src = t;
@@ -647,7 +646,7 @@ ActiveWindow::SetText(const Text& t)
int len = t.length();
if (len > 0 && t.contains('\\')) {
- char* buf = new(__FILE__,__LINE__) char[2*len];
+ char* buf = new char[2*len];
if (buf != 0) {
const char* src = t;
@@ -777,7 +776,7 @@ ActiveWindow::DrawText(const char* txt, int count, Rect& txt_rect, DWORD flags)
void
ActiveWindow::RegisterClient(int eid, ActiveWindow* client, PFVAWE callback)
{
- AWMap* map = new(__FILE__,__LINE__) AWMap(eid, client, callback);
+ AWMap* map = new AWMap(eid, client, callback);
if (map != 0)
clients.append(map);
diff --git a/Stars45/Archive.cpp b/Stars45/Archive.cpp
index 258452d..9d859c2 100644
--- a/Stars45/Archive.cpp
+++ b/Stars45/Archive.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "Types.h"
#include "Archive.h"
#include "Utils.h"
@@ -57,7 +56,7 @@ void DataArchive::WriteEntry(int index, BYTE* buf)
if (f != -1) {
header.dir_size_comp = DirBlocks() * BLOCK_SIZE;
- dirbuf = new(__FILE__,__LINE__) BYTE[header.dir_size_comp];
+ dirbuf = new BYTE[header.dir_size_comp];
if (!dirbuf) {
err = Z_MEM_ERROR;
@@ -134,7 +133,7 @@ void DataArchive::CreateBlockMap()
}
nblocks = max_usage/BLOCK_SIZE;
- block_map = new(__FILE__,__LINE__) DWORD[nblocks];
+ block_map = new DWORD[nblocks];
if (!block_map) {
nblocks = 0;
@@ -207,8 +206,8 @@ void DataArchive::LoadDatafile(const char* name)
DWORD len = DirBlocks() * BLOCK_SIZE;
DWORD dirsize = header.nfiles + 64;
- dirbuf = new(__FILE__,__LINE__) BYTE[len];
- directory = new(__FILE__,__LINE__) DataEntry[dirsize];
+ dirbuf = new BYTE[len];
+ directory = new DataEntry[dirsize];
if (!dirbuf || !directory) {
err = Z_MEM_ERROR;
@@ -291,7 +290,7 @@ BYTE* DataArchive::CompressEntry(int i)
DWORD len = ftell(f);
fseek(f, 0, SEEK_SET);
- BYTE* buf = new(__FILE__,__LINE__) BYTE[len];
+ BYTE* buf = new BYTE[len];
if (!buf) {
err = Z_MEM_ERROR;
@@ -304,7 +303,7 @@ BYTE* DataArchive::CompressEntry(int i)
directory[i].size_orig = len;
directory[i].size_comp = (int) (len * 1.1);
- BYTE* cbuf = new(__FILE__,__LINE__) BYTE[directory[i].size_comp];
+ BYTE* cbuf = new BYTE[directory[i].size_comp];
if (!cbuf) {
err = Z_MEM_ERROR;
@@ -335,7 +334,7 @@ int DataArchive::ExpandEntry(int i, BYTE*& buf, bool null_terminate)
if (f) {
DWORD clen = directory[i].size_comp;
- BYTE* cbuf = new(__FILE__,__LINE__) BYTE[clen];
+ BYTE* cbuf = new BYTE[clen];
if (!cbuf) {
err = Z_MEM_ERROR;
@@ -348,12 +347,12 @@ int DataArchive::ExpandEntry(int i, BYTE*& buf, bool null_terminate)
len = directory[i].size_orig;
if (null_terminate) {
- buf = new(__FILE__,__LINE__) BYTE[len+1];
+ buf = new BYTE[len+1];
if (buf) buf[len] = 0;
}
else {
- buf = new(__FILE__,__LINE__) BYTE[len];
+ buf = new BYTE[len];
}
if (!buf) {
@@ -409,7 +408,7 @@ int DataArchive::InsertEntry(const char* name)
}
}
- DataEntry* dir = new(__FILE__,__LINE__) DataEntry[dirsize + 64];
+ DataEntry* dir = new DataEntry[dirsize + 64];
if (directory && dirsize) {
ZeroMemory(dir, (dirsize + 64) * sizeof(DataEntry));
diff --git a/Stars45/Asteroid.cpp b/Stars45/Asteroid.cpp
index 745f1ad..fa0f175 100644
--- a/Stars45/Asteroid.cpp
+++ b/Stars45/Asteroid.cpp
@@ -11,7 +11,6 @@
Asteroid Sprite animation class
*/
-#include "MemDebug.h"
#include "Asteroid.h"
#include "Shot.h"
#include "Explosion.h"
@@ -48,37 +47,37 @@ Asteroid::Initialize()
int n = 0;
- Model* a = new(__FILE__,__LINE__) Model;
+ Model* a = new Model;
if (a) {
a->Load("a1.mag", 100);
asteroid_model[n++] = a;
}
- a = new(__FILE__,__LINE__) Model;
+ a = new Model;
if (a) {
a->Load("a2.mag", 50);
asteroid_model[n++] = a;
}
- a = new(__FILE__,__LINE__) Model;
+ a = new Model;
if (a) {
a->Load("a1.mag", 8);
asteroid_model[n++] = a;
}
- a = new(__FILE__,__LINE__) Model;
+ a = new Model;
if (a) {
a->Load("a2.mag", 10);
asteroid_model[n++] = a;
}
- a = new(__FILE__,__LINE__) Model;
+ a = new Model;
if (a) {
a->Load("a3.mag", 30);
asteroid_model[n++] = a;
}
- a = new(__FILE__,__LINE__) Model;
+ a = new Model;
if (a) {
a->Load("a4.mag", 20);
asteroid_model[n++] = a;
@@ -90,7 +89,7 @@ Asteroid::Initialize()
ListIter<Text> iter = mod_asteroids;
while (++iter && n < 32) {
- a = new(__FILE__,__LINE__) Model;
+ a = new Model;
if (a) {
a->Load(*iter.value(), 50);
asteroid_model[n++] = a;
diff --git a/Stars45/AudDlg.cpp b/Stars45/AudDlg.cpp
index 8a4ca77..ec25996 100644
--- a/Stars45/AudDlg.cpp
+++ b/Stars45/AudDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "AudDlg.h"
#include "MenuScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/AudioConfig.cpp b/Stars45/AudioConfig.cpp
index 15a7c28..8d4d74a 100644
--- a/Stars45/AudioConfig.cpp
+++ b/Stars45/AudioConfig.cpp
@@ -11,7 +11,6 @@
Audio Configuration class
*/
-#include "MemDebug.h"
#include "AudioConfig.h"
#include "DataLoader.h"
@@ -49,7 +48,7 @@ AudioConfig::~AudioConfig()
void
AudioConfig::Initialize()
{
- audio_config = new(__FILE__,__LINE__) AudioConfig;
+ audio_config = new AudioConfig;
if (audio_config)
audio_config->Load();
}
@@ -240,7 +239,7 @@ AudioConfig::Load()
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -250,7 +249,7 @@ AudioConfig::Load()
if (blocklen == 0)
return;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
diff --git a/Stars45/AwardDlg.cpp b/Stars45/AwardDlg.cpp
index 46daf2a..bdaf4a5 100644
--- a/Stars45/AwardDlg.cpp
+++ b/Stars45/AwardDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "AwardDlg.h"
#include "PlanScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/AwardShowDlg.cpp b/Stars45/AwardShowDlg.cpp
index aeb6ae1..10e6423 100644
--- a/Stars45/AwardShowDlg.cpp
+++ b/Stars45/AwardShowDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "AwardShowDlg.h"
#include "MenuScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/Bitmap.cpp b/Stars45/Bitmap.cpp
index e5b8811..70cff64 100644
--- a/Stars45/Bitmap.cpp
+++ b/Stars45/Bitmap.cpp
@@ -11,7 +11,6 @@
Bitmap Resource class
*/
-#include "MemDebug.h"
#include "Bitmap.h"
#include "Clock.h"
#include "Video.h"
@@ -263,7 +262,7 @@ Bitmap::CopyBitmap(const Bitmap& rhs)
mapsize = width * height;
if (rhs.pix) {
- pix = new(__FILE__,__LINE__) ColorIndex[mapsize];
+ pix = new ColorIndex[mapsize];
if (!pix) {
width = 0;
@@ -277,7 +276,7 @@ Bitmap::CopyBitmap(const Bitmap& rhs)
}
if (rhs.hipix) {
- hipix = new(__FILE__,__LINE__) Color[mapsize];
+ hipix = new Color[mapsize];
if (!hipix && !pix) {
width = 0;
@@ -335,7 +334,7 @@ Bitmap::CopyImage(int w, int h, BYTE* p, int t)
texture = false;
mapsize = w * h;
- pix = new(__FILE__,__LINE__) ColorIndex[mapsize];
+ pix = new ColorIndex[mapsize];
if (!pix) {
width = 0;
@@ -370,7 +369,7 @@ Bitmap::CopyHighColorImage(int w, int h, DWORD* p, int t)
texture = false;
mapsize = w * h;
- hipix = new(__FILE__,__LINE__) Color[mapsize];
+ hipix = new Color[mapsize];
if (!hipix) {
width = 0;
@@ -497,7 +496,7 @@ Bitmap::ScaleTo(int w, int h)
if (hipix) {
Color* src = hipix;
- Color* buf = new(__FILE__,__LINE__) Color[w*h];
+ Color* buf = new Color[w*h];
Color* dst = buf;
if (!buf) {
@@ -524,7 +523,7 @@ Bitmap::ScaleTo(int w, int h)
if (pix) {
ColorIndex* src = pix;
- ColorIndex* buf = new(__FILE__,__LINE__) ColorIndex[w*h];
+ ColorIndex* buf = new ColorIndex[w*h];
ColorIndex* dst = buf;
if (!buf) {
@@ -564,7 +563,7 @@ Bitmap::MakeIndexed()
if (hipix) {
if (pix && ownpix)
delete [] pix;
- pix = new(__FILE__,__LINE__) ColorIndex[mapsize];
+ pix = new ColorIndex[mapsize];
if (pix) {
Color* src = hipix;
@@ -594,7 +593,7 @@ Bitmap::MakeHighColor()
if (hipix && ownpix)
delete [] hipix;
- hipix = new(__FILE__,__LINE__) Color[mapsize];
+ hipix = new Color[mapsize];
if (hipix) {
ColorIndex* src = pix;
@@ -802,7 +801,7 @@ Bitmap::Default()
def.width = def.height = 64;
def.mapsize = 64*64;
def.ownpix = true;
- def.pix = new(__FILE__,__LINE__) ColorIndex[def.mapsize];
+ def.pix = new ColorIndex[def.mapsize];
// 8 bit palette mode
if (def.pix) {
diff --git a/Stars45/Bmp.cpp b/Stars45/Bmp.cpp
index 19711a5..345b9eb 100644
--- a/Stars45/Bmp.cpp
+++ b/Stars45/Bmp.cpp
@@ -12,13 +12,14 @@
*/
-#include "MemDebug.h"
#include "Bmp.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "Types.h"
+
// +--------------------------------------------------------------------+
BmpImage::BmpImage()
@@ -48,7 +49,7 @@ BmpImage::BmpImage(short w, short h, unsigned long* hibits)
int pixels = width * height;
- image = new(__FILE__,__LINE__) DWORD [pixels];
+ image = new DWORD [pixels];
if (image && pixels) {
for (int i = 0; i < pixels; i++)
@@ -96,7 +97,7 @@ int BmpImage::Load(char *filename)
int pixels = width*height;
delete [] image;
- image = new(__FILE__,__LINE__) DWORD[pixels];
+ image = new DWORD[pixels];
if (image == NULL)
return BMP_NOMEM;
@@ -115,7 +116,7 @@ int BmpImage::Load(char *filename)
int pixels = width*height;
delete [] image;
- image = new(__FILE__,__LINE__) DWORD[pixels];
+ image = new DWORD[pixels];
if (image == NULL)
return BMP_NOMEM;
@@ -167,7 +168,7 @@ int BmpImage::LoadBuffer(unsigned char* buf, int len)
int pixels = width*height;
delete [] image;
- image = new(__FILE__,__LINE__) DWORD[pixels];
+ image = new DWORD[pixels];
if (image == NULL)
return BMP_NOMEM;
@@ -186,7 +187,7 @@ int BmpImage::LoadBuffer(unsigned char* buf, int len)
int pixels = width*height;
delete [] image;
- image = new(__FILE__,__LINE__) DWORD[pixels];
+ image = new DWORD[pixels];
if (image == NULL)
return BMP_NOMEM;
diff --git a/Stars45/Bmp.h b/Stars45/Bmp.h
index 7e780e6..7f914b9 100644
--- a/Stars45/Bmp.h
+++ b/Stars45/Bmp.h
@@ -14,6 +14,8 @@
#ifndef BMP_H
#define BMP_H
+#include "Types.h"
+
// +--------------------------------------------------------------------+
enum { BMP_OK, BMP_NOMEM, BMP_INVALID, BMP_NOFILE };
diff --git a/Stars45/Bolt.cpp b/Stars45/Bolt.cpp
index be8792a..7483678 100644
--- a/Stars45/Bolt.cpp
+++ b/Stars45/Bolt.cpp
@@ -11,7 +11,6 @@
3D Bolt (Polygon) Object
*/
-#include "MemDebug.h"
#include "Bolt.h"
#include "Bitmap.h"
#include "Camera.h"
diff --git a/Stars45/Button.cpp b/Stars45/Button.cpp
index 8c7e474..72867e8 100644
--- a/Stars45/Button.cpp
+++ b/Stars45/Button.cpp
@@ -11,7 +11,6 @@
Button class
*/
-#include "MemDebug.h"
#include "Button.h"
#include "Video.h"
#include "Bitmap.h"
diff --git a/Stars45/Callsign.cpp b/Stars45/Callsign.cpp
index bc2801e..7cb7499 100644
--- a/Stars45/Callsign.cpp
+++ b/Stars45/Callsign.cpp
@@ -11,7 +11,6 @@
Package Callsign catalog class
*/
-#include "MemDebug.h"
#include "Callsign.h"
// +----------------------------------------------------------------------+
diff --git a/Stars45/Camera.cpp b/Stars45/Camera.cpp
index a2953a1..c8671e1 100644
--- a/Stars45/Camera.cpp
+++ b/Stars45/Camera.cpp
@@ -11,7 +11,6 @@
Camera Class - Position and Point of View
*/
-#include "MemDebug.h"
#include "Camera.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/CameraDirector.cpp b/Stars45/CameraDirector.cpp
index 6ed224b..7da704c 100644
--- a/Stars45/CameraDirector.cpp
+++ b/Stars45/CameraDirector.cpp
@@ -11,7 +11,6 @@
Camera Director singleton manages the main view camera based on the current ship
*/
-#include "MemDebug.h"
#include "CameraDirector.h"
#include "Ship.h"
#include "FlightDeck.h"
@@ -37,7 +36,7 @@ CameraDirector*
CameraDirector::GetInstance()
{
if (!instance)
- instance = new(__FILE__,__LINE__) CameraDirector;
+ instance = new CameraDirector;
return instance;
}
diff --git a/Stars45/CameraView.cpp b/Stars45/CameraView.cpp
index ed39abd..9f58dd8 100644
--- a/Stars45/CameraView.cpp
+++ b/Stars45/CameraView.cpp
@@ -12,7 +12,6 @@
uses abstract PolyRender class to draw the triangles
*/
-#include "MemDebug.h"
#include "CameraView.h"
#include "Color.h"
#include "Window.h"
diff --git a/Stars45/Campaign.cpp b/Stars45/Campaign.cpp
index d6e4fb1..af1eb86 100644
--- a/Stars45/Campaign.cpp
+++ b/Stars45/Campaign.cpp
@@ -11,7 +11,6 @@
Campaign defines a strategic military scenario.
*/
-#include "MemDebug.h"
#include "Campaign.h"
#include "CampaignPlanStrategic.h"
#include "CampaignPlanAssignment.h"
@@ -164,7 +163,7 @@ Campaign::Initialize()
if (loader->FindFile("campaign.def")) {
char txt[256];
sprintf_s(txt, "Dynamic Campaign %02d", i);
- c = new(__FILE__,__LINE__) Campaign(i, txt);
+ c = new Campaign(i, txt);
if (c) {
campaigns.insertSort(c);
@@ -172,18 +171,18 @@ Campaign::Initialize()
}
}
- c = new(__FILE__,__LINE__) Campaign(SINGLE_MISSIONS, "Single Missions");
+ c = new Campaign(SINGLE_MISSIONS, "Single Missions");
if (c) {
campaigns.insertSort(c);
current_campaign = c;
}
- c = new(__FILE__,__LINE__) Campaign(MULTIPLAYER_MISSIONS, "Multiplayer Missions");
+ c = new Campaign(MULTIPLAYER_MISSIONS, "Multiplayer Missions");
if (c) {
campaigns.insertSort(c);
}
- c = new(__FILE__,__LINE__) Campaign(CUSTOM_MISSIONS, "Custom Missions");
+ c = new Campaign(CUSTOM_MISSIONS, "Custom Missions");
if (c) {
campaigns.insertSort(c);
}
@@ -248,7 +247,7 @@ Campaign::CreateCustomCampaign(const char* name, const char* path)
if (id == 0)
id = CUSTOM_MISSIONS + 1;
- Campaign* c = new(__FILE__,__LINE__) Campaign(id, name, path);
+ Campaign* c = new Campaign(id, name, path);
Print("Campaign: created custom campaign %d '%s'\n", id, name);
campaigns.append(c);
@@ -433,7 +432,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full)
loader->UseFileSystem(true);
loader->LoadBuffer(filename, block, true);
loader->UseFileSystem(Starshatter::UseFileSystem());
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -533,7 +532,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full)
}
loader->SetDataPath(path);
- Combatant* c = new(__FILE__,__LINE__) Combatant(name, clone);
+ Combatant* c = new Combatant(name, clone);
if (c) {
combatants.append(c);
}
@@ -792,29 +791,29 @@ Campaign::ParseAction(TermStruct* val, const char* filename)
else if (pdef->name()->value() == "asset_kill") {
if (!action)
- action = new(__FILE__,__LINE__) CombatAction(id, type, subtype, team);
+ action = new CombatAction(id, type, subtype, team);
if (action) {
char txt[64];
GetDefText(txt, pdef, filename);
- action->AssetKills().append(new (__FILE__,__LINE__) Text(txt));
+ action->AssetKills().append(new Text(txt));
}
}
else if (pdef->name()->value() == "target_kill") {
if (!action)
- action = new(__FILE__,__LINE__) CombatAction(id, type, subtype, team);
+ action = new CombatAction(id, type, subtype, team);
if (action) {
char txt[64];
GetDefText(txt, pdef, filename);
- action->TargetKills().append(new (__FILE__,__LINE__) Text(txt));
+ action->TargetKills().append(new Text(txt));
}
}
else if (pdef->name()->value() == "req") {
if (!action)
- action = new(__FILE__,__LINE__) CombatAction(id, type, subtype, team);
+ action = new CombatAction(id, type, subtype, team);
if (!pdef->term() || !pdef->term()->isStruct()) {
::Print("WARNING: action req struct missing in '%s'\n", filename);
@@ -902,7 +901,7 @@ Campaign::ParseAction(TermStruct* val, const char* filename)
}
if (!action)
- action = new(__FILE__,__LINE__) CombatAction(id, type, subtype, team);
+ action = new CombatAction(id, type, subtype, team);
if (action) {
action->SetSource(source);
@@ -971,7 +970,7 @@ Campaign::LoadMissionList(DataLoader* loader)
loader->UseFileSystem(true);
loader->LoadBuffer(filename, block, true);
loader->UseFileSystem(Starshatter::UseFileSystem());
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -1052,7 +1051,7 @@ Campaign::LoadMissionList(DataLoader* loader)
}
}
- MissionInfo* info = new(__FILE__,__LINE__) MissionInfo;
+ MissionInfo* info = new MissionInfo;
if (info) {
info->id = id;
info->name = name;
@@ -1113,7 +1112,7 @@ Campaign::LoadCustomMissions(DataLoader* loader)
int type = 0;
int msn_id = 0;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
if (!term) {
@@ -1181,7 +1180,7 @@ Campaign::LoadCustomMissions(DataLoader* loader)
msn_id = i+1;
}
- MissionInfo* info = new(__FILE__,__LINE__) MissionInfo;
+ MissionInfo* info = new MissionInfo;
if (info) {
info->id = msn_id;
info->name = name;
@@ -1226,7 +1225,7 @@ Campaign::LoadTemplateList(DataLoader* loader)
loader->UseFileSystem(true);
loader->LoadBuffer(filename, block, true);
loader->UseFileSystem(Starshatter::UseFileSystem());
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -1338,7 +1337,7 @@ Campaign::LoadTemplateList(DataLoader* loader)
}
}
- MissionInfo* info = new(__FILE__,__LINE__) MissionInfo;
+ MissionInfo* info = new MissionInfo;
if (info) {
info->id = id;
info->name = name;
@@ -1358,7 +1357,7 @@ Campaign::LoadTemplateList(DataLoader* loader)
TemplateList* templist = GetTemplateList(msn_type, grp_type);
if (!templist) {
- templist = new(__FILE__,__LINE__) TemplateList;
+ templist = new TemplateList;
templist->mission_type = msn_type;
templist->group_type = grp_type;
templates.append(templist);
@@ -1387,23 +1386,23 @@ Campaign::CreatePlanners()
CampaignPlan* p;
// PLAN EVENT MUST BE FIRST PLANNER:
- p = new(__FILE__,__LINE__) CampaignPlanEvent(this);
+ p = new CampaignPlanEvent(this);
if (p)
planners.append(p);
- p = new(__FILE__,__LINE__) CampaignPlanStrategic(this);
+ p = new CampaignPlanStrategic(this);
if (p)
planners.append(p);
- p = new(__FILE__,__LINE__) CampaignPlanAssignment(this);
+ p = new CampaignPlanAssignment(this);
if (p)
planners.append(p);
- p = new(__FILE__,__LINE__) CampaignPlanMovement(this);
+ p = new CampaignPlanMovement(this);
if (p)
planners.append(p);
- p = new(__FILE__,__LINE__) CampaignPlanMission(this);
+ p = new CampaignPlanMission(this);
if (p)
planners.append(p);
@@ -1532,7 +1531,7 @@ Campaign::GetMission(int id)
if (info) {
if (!info->mission) {
::Print("Campaign::GetMission(%d) loading mission...\n", id);
- info->mission = new(__FILE__,__LINE__) Mission(id, info->script, path);
+ info->mission = new Mission(id, info->script, path);
if (info->mission)
info->mission->Load();
}
@@ -1583,7 +1582,7 @@ Campaign::GetMissionByFile(const char* filename)
if (!info->mission) {
::Print("Campaign::GetMission(%d) loading mission...\n", id);
- info->mission = new(__FILE__,__LINE__) Mission(id, info->script, path);
+ info->mission = new Mission(id, info->script, path);
if (info->mission)
info->mission->Load();
}
@@ -1603,12 +1602,12 @@ Campaign::GetMissionByFile(const char* filename)
}
else {
- info = new(__FILE__,__LINE__) MissionInfo;
+ info = new MissionInfo;
if (info) {
info->id = maxid+1;
info->name = "New Custom Mission";
info->script = filename;
- info->mission = new(__FILE__,__LINE__) Mission(info->id, info->script, "Mods/Missions/");
+ info->mission = new Mission(info->id, info->script, "Mods/Missions/");
info->mission->SetName(info->name);
info->script.setSensitive(false);
@@ -1640,12 +1639,12 @@ Campaign::CreateNewMission()
char filename[64];
sprintf_s(filename, "custom%03d.def", maxid+1);
- info = new(__FILE__,__LINE__) MissionInfo;
+ info = new MissionInfo;
if (info) {
info->id = maxid+1;
info->name = "New Custom Mission";
info->script = filename;
- info->mission = new(__FILE__,__LINE__) Mission(info->id, filename, path);
+ info->mission = new Mission(info->id, filename, path);
info->mission->SetName(info->name);
info->script.setSensitive(false);
@@ -1706,7 +1705,7 @@ Campaign::GetMissionInfo(int id)
if (m) {
if (!m->mission) {
- m->mission = new(__FILE__,__LINE__) Mission(id, m->script);
+ m->mission = new Mission(id, m->script);
if (m->mission)
m->mission->Load();
}
@@ -1747,7 +1746,7 @@ Campaign::LoadNetMission(int id, const char* net_mission_script)
}
mission_id = id;
- mission = new(__FILE__,__LINE__) Mission(id);
+ mission = new Mission(id);
if (mission && mission->ParseMission(net_mission_script))
mission->Validate();
diff --git a/Stars45/CampaignMissionFighter.cpp b/Stars45/CampaignMissionFighter.cpp
index 16c3f7b..be39d58 100644
--- a/Stars45/CampaignMissionFighter.cpp
+++ b/Stars45/CampaignMissionFighter.cpp
@@ -13,7 +13,6 @@
dynamic campaign.
*/
-#include "MemDebug.h"
#include "CampaignMissionFighter.h"
#include "CampaignMissionRequest.h"
#include "Campaign.h"
@@ -176,7 +175,7 @@ CampaignMissionFighter::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(squadron);
mission = mt;
@@ -188,13 +187,13 @@ CampaignMissionFighter::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(squadron);
mission = mt;
}
else {
- mission = new(__FILE__,__LINE__) Mission(id);
+ mission = new Mission(id);
if (mission)
mission->SetType(mission_type);
}
@@ -241,7 +240,7 @@ CampaignMissionFighter::GenerateMission(int id)
else {
delete mission;
- mission = new(__FILE__,__LINE__) Mission(id);
+ mission = new Mission(id);
mission->SetType(mission_type);
mission->SetName(name);
mission->SetTeam(squadron->GetIFF());
@@ -465,7 +464,7 @@ CampaignMissionFighter::GenerateMissionElements()
CreateEscorts();
if (player_elem) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(mission->GetRegion(),
+ Instruction* obj = new Instruction(mission->GetRegion(),
Point(0,0,0),
Instruction::RTB);
@@ -496,7 +495,7 @@ CampaignMissionFighter::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)
elem->AddObjective(obj);
}
@@ -531,7 +530,7 @@ CampaignMissionFighter::CreateSingleElement(CombatGroup* g, CombatUnit* u)
return 0;
}
- MissionElement* elem = new(__FILE__,__LINE__) MissionElement;
+ MissionElement* elem = new MissionElement;
if (!elem) {
Exit();
return 0;
@@ -618,7 +617,7 @@ CampaignMissionFighter::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);
elem->AddObjective(obj);
}
else if ((u->Type() & Ship::STARSHIPS) != 0) {
@@ -659,7 +658,7 @@ CampaignMissionFighter::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();
@@ -719,13 +718,13 @@ CampaignMissionFighter::CreatePlayer(CombatGroup* g)
double delta = (pickup - elem->Location()).length();
if (delta > 30e3) {
- Instruction* n = new(__FILE__,__LINE__) Instruction(elem->Region(), pickup, Instruction::ESCORT);
+ Instruction* n = new Instruction(elem->Region(), pickup, Instruction::ESCORT);
n->SetTarget(ward->Name());
n->SetSpeed(750);
elem->AddNavPoint(n);
}
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ESCORT, ward->Name());
+ Instruction* obj = new Instruction(Instruction::ESCORT, ward->Name());
switch (mission->Type()) {
case Mission::ESCORT_FREIGHT:
@@ -880,7 +879,7 @@ CampaignMissionFighter::CreateWardFreight()
npt_loc += delta;
- n = new(__FILE__,__LINE__) Instruction(elem->Region(),
+ n = new Instruction(elem->Region(),
npt_loc,
Instruction::VECTOR);
@@ -896,7 +895,7 @@ CampaignMissionFighter::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);
@@ -944,7 +943,7 @@ CampaignMissionFighter::CreateWardShuttle()
npt_loc += delta;
- n = new(__FILE__,__LINE__) Instruction(elem->Region(),
+ n = new Instruction(elem->Region(),
npt_loc,
Instruction::VECTOR);
@@ -953,7 +952,7 @@ CampaignMissionFighter::CreateWardShuttle()
elem->AddNavPoint(n);
}
- n = new(__FILE__,__LINE__) Instruction(air_region,
+ n = new Instruction(air_region,
Point(0, 0, 10.0e3),
Instruction::VECTOR);
@@ -971,7 +970,7 @@ CampaignMissionFighter::CreateWardShuttle()
elem->SetLocation(src);
- n = new(__FILE__,__LINE__) Instruction(elem->Region(), dst, Instruction::DOCK);
+ n = new Instruction(elem->Region(), dst, Instruction::DOCK);
if (n) {
n->SetTarget(carrier->Name());
n->SetSpeed(500);
@@ -1009,7 +1008,7 @@ CampaignMissionFighter::CreateWardStrike()
elem->SetRegion(squadron->GetRegion());
if (strike_target) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ASSAULT, strike_target->Name());
+ Instruction* obj = new Instruction(Instruction::ASSAULT, strike_target->Name());
if (obj) {
if (airborne)
@@ -1034,7 +1033,7 @@ CampaignMissionFighter::CreateWardStrike()
delta *= -30.0e3;
npt_loc += delta;
- n = new(__FILE__,__LINE__) Instruction(elem->Region(),
+ n = new Instruction(elem->Region(),
npt_loc,
Instruction::VECTOR);
if (n) {
@@ -1044,7 +1043,7 @@ CampaignMissionFighter::CreateWardStrike()
npt_loc = Point(0, 0, 10.0e3);
- n = new(__FILE__,__LINE__) Instruction(air_region,
+ n = new Instruction(air_region,
npt_loc,
Instruction::VECTOR);
if (n) {
@@ -1061,7 +1060,7 @@ CampaignMissionFighter::CreateWardStrike()
npt_loc = strike_target->Location() + delta + Point(0, 0, 8.0e3);
- n = new(__FILE__,__LINE__) Instruction(strike_target->GetRegion(),
+ n = new Instruction(strike_target->GetRegion(),
npt_loc,
Instruction::STRIKE);
if (n) {
@@ -1071,7 +1070,7 @@ CampaignMissionFighter::CreateWardStrike()
}
if (airborne) {
- n = new(__FILE__,__LINE__) Instruction(air_region,
+ n = new Instruction(air_region,
Point(0, 0, 30.0e3),
Instruction::VECTOR);
if (n) {
@@ -1081,7 +1080,7 @@ CampaignMissionFighter::CreateWardStrike()
}
if (carrier) {
- n = new(__FILE__,__LINE__) Instruction(elem->Region(),
+ n = new Instruction(elem->Region(),
carrier->Location() - Point(0, -20.0e3, 0),
Instruction::VECTOR);
if (n) {
@@ -1127,7 +1126,7 @@ CampaignMissionFighter::CreateEscorts()
ListIter<Instruction> npt_iter = player_elem->NavList();
while (++npt_iter) {
Instruction* npt = npt_iter.value();
- Instruction* n = new(__FILE__,__LINE__) Instruction(npt->RegionName(),
+ Instruction* n = new Instruction(npt->RegionName(),
npt->Location() + offset,
Instruction::ESCORT);
if (n) {
@@ -1190,7 +1189,7 @@ CampaignMissionFighter::CreateTargetsPatrol()
RandomDirection() * Random(110e3, 160e3);
}
- Instruction* n = new(__FILE__,__LINE__) Instruction(region,
+ Instruction* n = new Instruction(region,
patrol_loc,
Instruction::PATROL);
if (n)
@@ -1208,12 +1207,12 @@ CampaignMissionFighter::CreateTargetsPatrol()
OrbitalInsertion(player_elem);
}
- Instruction* obj = new(__FILE__,__LINE__) Instruction(*n);
+ Instruction* obj = new Instruction(*n);
obj->SetTargetDesc("inbound enemy units");
player_elem->AddObjective(obj);
if (carrier_elem && !airborne) {
- obj = new(__FILE__,__LINE__) Instruction(Instruction::DEFEND, carrier_elem->Name());
+ obj = new Instruction(Instruction::DEFEND, carrier_elem->Name());
if (obj) {
obj->SetTargetDesc(Text("the ") + carrier_elem->Name() + " battle group");
player_elem->AddObjective(obj);
@@ -1244,7 +1243,7 @@ CampaignMissionFighter::CreateTargetsSweep()
sweep_loc += Point(sin(a), -cos(a), 0) * 100.0e3;
- n = new(__FILE__,__LINE__) Instruction(region,
+ n = new Instruction(region,
sweep_loc,
Instruction::VECTOR);
if (n) {
@@ -1262,7 +1261,7 @@ CampaignMissionFighter::CreateTargetsSweep()
sweep_loc += Point(sin(a), -cos(a), 0) * 80.0e3;
- n = new(__FILE__,__LINE__) Instruction(region,
+ n = new Instruction(region,
sweep_loc,
Instruction::SWEEP);
if (n) {
@@ -1289,7 +1288,7 @@ CampaignMissionFighter::CreateTargetsSweep()
sweep_loc = base_loc;
sweep_loc.y += 30.0e3;
- n = new(__FILE__,__LINE__) Instruction(region,
+ n = new Instruction(region,
sweep_loc,
Instruction::VECTOR);
if (n) {
@@ -1297,7 +1296,7 @@ CampaignMissionFighter::CreateTargetsSweep()
player_elem->AddNavPoint(n);
}
- Instruction* obj = new(__FILE__,__LINE__) Instruction(region,
+ Instruction* obj = new Instruction(region,
sweep_loc,
Instruction::SWEEP);
if (obj) {
@@ -1306,7 +1305,7 @@ CampaignMissionFighter::CreateTargetsSweep()
}
if (carrier_elem && !airborne) {
- obj = new(__FILE__,__LINE__) Instruction(Instruction::DEFEND, carrier_elem->Name());
+ obj = new Instruction(Instruction::DEFEND, carrier_elem->Name());
if (obj) {
obj->SetTargetDesc(Text("the ") + carrier_elem->Name() + " battle group");
player_elem->AddObjective(obj);
@@ -1334,10 +1333,10 @@ CampaignMissionFighter::CreateTargetsIntercept()
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"));
if (carrier) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ASSAULT, carrier->Name());
+ Instruction* obj = new Instruction(Instruction::ASSAULT, carrier->Name());
if (obj) {
elem->AddObjective(obj);
elem->SetLocation(carrier->Location() + RandomPoint() * 6);
@@ -1353,7 +1352,7 @@ CampaignMissionFighter::CreateTargetsIntercept()
if (!prime_target) {
prime_target = elem;
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::INTERCEPT, attacker);
+ Instruction* obj = new Instruction(Instruction::INTERCEPT, attacker);
if (obj) {
obj->SetTargetDesc(Text("inbound strike package '") + elem->Name() + "'");
player_elem->AddObjective(obj);
@@ -1365,7 +1364,7 @@ CampaignMissionFighter::CreateTargetsIntercept()
e2->SetIntelLevel(Intel::KNOWN);
e2->SetLocation(elem->Location() + RandomPoint() * 0.25);
- 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);
@@ -1383,7 +1382,7 @@ CampaignMissionFighter::CreateTargetsIntercept()
Player* p = Player::GetCurrentPlayer();
elem->SetAlert(p ? !p->FlyingStart() : true);
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::INTERCEPT, attacker);
+ Instruction* obj = new Instruction(Instruction::INTERCEPT, attacker);
if (obj)
elem->AddObjective(obj);
mission->AddElement(elem);
@@ -1392,7 +1391,7 @@ CampaignMissionFighter::CreateTargetsIntercept()
}
if (carrier && !airborne) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::DEFEND, carrier->Name());
+ Instruction* obj = new Instruction(Instruction::DEFEND, carrier->Name());
if (obj) {
obj->SetTargetDesc(Text("the ") + carrier->Name() + " battle group");
player_elem->AddObjective(obj);
@@ -1424,7 +1423,7 @@ CampaignMissionFighter::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);
@@ -1434,14 +1433,14 @@ CampaignMissionFighter::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);
@@ -1470,7 +1469,7 @@ CampaignMissionFighter::CreateTargetsStrikeEscort()
ListIter<Instruction> npt_iter = ward->NavList();
while (++npt_iter) {
Instruction* npt = npt_iter.value();
- Instruction* n = new(__FILE__,__LINE__) Instruction(npt->RegionName(),
+ Instruction* n = new Instruction(npt->RegionName(),
npt->Location() + offset,
Instruction::ESCORT);
if (n) {
@@ -1500,7 +1499,7 @@ CampaignMissionFighter::CreateTargetsStrike()
if (elem->GetCombatGroup() == strike_target) {
prime_target = elem;
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::STRIKE, elem->Name());
+ Instruction* obj = new Instruction(Instruction::STRIKE, elem->Name());
if (obj) {
obj->SetTargetDesc(Text("preplanned target '") + elem->Name() + "'");
player_elem->AddObjective(obj);
@@ -1527,7 +1526,7 @@ CampaignMissionFighter::CreateTargetsStrike()
rloc.SetAzimuth(90*DEGREES);
rloc.SetAzimuthVar(25*DEGREES);
- n = new(__FILE__,__LINE__) Instruction(prime_target->Region(),
+ n = new Instruction(prime_target->Region(),
Point(),
Instruction::VECTOR);
if (n) {
@@ -1546,7 +1545,7 @@ CampaignMissionFighter::CreateTargetsStrike()
loc = prime_target->Location() + delta;
loc.z = 8.0e3;
- n = new(__FILE__,__LINE__) Instruction(prime_target->Region(),
+ n = new Instruction(prime_target->Region(),
loc,
Instruction::STRIKE);
if (n) {
@@ -1562,7 +1561,7 @@ CampaignMissionFighter::CreateTargetsStrike()
rloc.SetAzimuth(-90*DEGREES);
rloc.SetAzimuthVar(25*DEGREES);
- n = new(__FILE__,__LINE__) Instruction(prime_target->Region(),
+ n = new Instruction(prime_target->Region(),
Point(),
Instruction::VECTOR);
if (n) {
@@ -1579,7 +1578,7 @@ CampaignMissionFighter::CreateTargetsStrike()
rloc.SetAzimuth(180*DEGREES);
rloc.SetAzimuthVar(30*DEGREES);
- n = new(__FILE__,__LINE__) Instruction(carrier_elem->Region(),
+ n = new Instruction(carrier_elem->Region(),
Point(),
Instruction::RTB);
if (n) {
@@ -1632,7 +1631,7 @@ CampaignMissionFighter::CreateTargetsAssault()
if (prime_target) {
MissionElement* elem = prime_target;
- Instruction* obj = new(__FILE__,__LINE__) Instruction(Instruction::ASSAULT, elem->Name());
+ Instruction* obj = new Instruction(Instruction::ASSAULT, elem->Name());
if (obj) {
obj->SetTargetDesc(Text("preplanned target '") + elem->Name() + "'");
player_elem->AddObjective(obj);
@@ -1663,7 +1662,7 @@ CampaignMissionFighter::CreateTargetsAssault()
rloc.SetAzimuth(90*DEGREES);
rloc.SetAzimuthVar(45*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(elem->Region(), dummy, Instruction::VECTOR);
+ instr = new Instruction(elem->Region(), dummy, Instruction::VECTOR);
if (instr) {
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
@@ -1682,7 +1681,7 @@ CampaignMissionFighter::CreateTargetsAssault()
rloc.SetAzimuth(120*DEGREES);
rloc.SetAzimuthVar(15*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(elem->Region(), dummy, Instruction::ASSAULT);
+ instr = new Instruction(elem->Region(), dummy, Instruction::ASSAULT);
if (instr) {
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
@@ -1699,7 +1698,7 @@ CampaignMissionFighter::CreateTargetsAssault()
rloc.SetAzimuth(180*DEGREES);
rloc.SetAzimuthVar(60*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(carrier_elem->Region(), dummy, Instruction::RTB);
+ instr = new Instruction(carrier_elem->Region(), dummy, Instruction::RTB);
if (instr) {
instr->SetSpeed(500);
instr->GetRLoc() = rloc;
@@ -1763,7 +1762,7 @@ CampaignMissionFighter::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);
@@ -1815,7 +1814,7 @@ CampaignMissionFighter::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);
@@ -1846,7 +1845,7 @@ CampaignMissionFighter::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);
@@ -1910,7 +1909,7 @@ CampaignMissionFighter::PlanetaryInsertion(MissionElement* elem)
npt_loc += delta;
- n = new(__FILE__,__LINE__) Instruction(elem->Region(),
+ n = new Instruction(elem->Region(),
npt_loc,
Instruction::VECTOR);
if (n) {
@@ -1919,7 +1918,7 @@ CampaignMissionFighter::PlanetaryInsertion(MissionElement* elem)
}
}
- n = new(__FILE__,__LINE__) Instruction(air_region,
+ n = new Instruction(air_region,
Point(0, 0, 15e3),
Instruction::VECTOR);
if (n) {
@@ -1931,7 +1930,7 @@ CampaignMissionFighter::PlanetaryInsertion(MissionElement* elem)
void
CampaignMissionFighter::OrbitalInsertion(MissionElement* elem)
{
- Instruction* n = new(__FILE__,__LINE__) Instruction(air_region,
+ Instruction* n = new Instruction(air_region,
Point(0, 0, 30.0e3),
Instruction::VECTOR);
if (n) {
@@ -1965,7 +1964,7 @@ CampaignMissionFighter::CreateFighterPackage(CombatGroup* squadron, int count, i
return 0;
}
- MissionElement* elem = new(__FILE__,__LINE__) MissionElement;
+ MissionElement* elem = new MissionElement;
if (!elem) {
Exit();
return 0;
@@ -1994,17 +1993,17 @@ CampaignMissionFighter::CreateFighterPackage(CombatGroup* squadron, int count, i
case Mission::ASSAULT:
if (request->GetObjective() &&
request->GetObjective()->Type() == CombatGroup::MINEFIELD)
- elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "Rockets"));
+ elem->Loadouts().append(new MissionLoad(-1, "Rockets"));
else
- elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "Ship Strike"));
+ elem->Loadouts().append(new MissionLoad(-1, "Ship Strike"));
break;
case Mission::STRIKE:
- elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "Ground Strike"));
+ elem->Loadouts().append(new MissionLoad(-1, "Ground Strike"));
break;
default:
- elem->Loadouts().append(new(__FILE__,__LINE__) MissionLoad(-1, "ACM Medium Range"));
+ elem->Loadouts().append(new MissionLoad(-1, "ACM Medium Range"));
break;
}
@@ -2125,7 +2124,7 @@ CampaignMissionFighter::DescribeMission()
(const char*) player_elem->Name());
}
- MissionInfo* info = new(__FILE__,__LINE__) MissionInfo;
+ MissionInfo* info = new MissionInfo;
info->id = mission->Identity();
info->mission = mission;
diff --git a/Stars45/CampaignMissionRequest.cpp b/Stars45/CampaignMissionRequest.cpp
index 4026a28..e8fbc68 100644
--- a/Stars45/CampaignMissionRequest.cpp
+++ b/Stars45/CampaignMissionRequest.cpp
@@ -11,7 +11,6 @@
CampaignMissionRequest
*/
-#include "MemDebug.h"
#include "CampaignMissionRequest.h"
#include "Campaign.h"
#include "Combatant.h"
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();
diff --git a/Stars45/CampaignPlanAssignment.cpp b/Stars45/CampaignPlanAssignment.cpp
index b71f565..c4381ed 100644
--- a/Stars45/CampaignPlanAssignment.cpp
+++ b/Stars45/CampaignPlanAssignment.cpp
@@ -13,7 +13,6 @@
force tasking.
*/
-#include "MemDebug.h"
#include "CampaignPlanAssignment.h"
#include "Campaign.h"
#include "Combatant.h"
@@ -114,7 +113,7 @@ CampaignPlanAssignment::ProcessZone(Combatant* c, CombatZone* zone)
ListIter<CombatGroup> g = assets;
while (++g) {
- CombatAssignment* a = new(__FILE__,__LINE__)
+ CombatAssignment* a = new
CombatAssignment(Mission::DEFEND,
def.value(),
g.value());
@@ -146,7 +145,7 @@ CampaignPlanAssignment::ProcessZone(Combatant* c, CombatZone* zone)
else if (target->Type() == CombatGroup::LCA_SQUADRON)
mtype = Mission::INTERCEPT;
- CombatAssignment* a = new(__FILE__,__LINE__)
+ CombatAssignment* a = new
CombatAssignment(mtype, target, asset);
if (a)
diff --git a/Stars45/CampaignPlanEvent.cpp b/Stars45/CampaignPlanEvent.cpp
index 05f94b1..f487984 100644
--- a/Stars45/CampaignPlanEvent.cpp
+++ b/Stars45/CampaignPlanEvent.cpp
@@ -14,7 +14,6 @@
campaign.
*/
-#include "MemDebug.h"
#include "CampaignPlanEvent.h"
#include "Campaign.h"
#include "Combatant.h"
@@ -87,7 +86,7 @@ CampaignPlanEvent::ExecScriptedEvents()
switch (action->Type()) {
case CombatAction::COMBAT_EVENT:
{
- CombatEvent* event = new(__FILE__,__LINE__)
+ CombatEvent* event = new
CombatEvent(campaign,
action->Subtype(),
(int) campaign->GetTime(),
@@ -206,7 +205,7 @@ CampaignPlanEvent::ExecScriptedEvents()
// don't announce the move unless it's for the player's team:
if (action->GetIFF() == campaign->GetPlayerIFF() && _stricmp(action->GetText(), "do-not-display")) {
- CombatEvent* event = new(__FILE__,__LINE__)
+ CombatEvent* event = new
CombatEvent(campaign,
CombatEvent::MOVE_TO,
(int) campaign->GetTime(),
@@ -291,7 +290,7 @@ CampaignPlanEvent::ExecScriptedEvents()
// don't announce the move unless it's for the player's team:
if (action->GetIFF() == campaign->GetPlayerIFF() && _stricmp(action->GetText(), "do-not-display")) {
- CombatEvent* event = new(__FILE__,__LINE__)
+ CombatEvent* event = new
CombatEvent(campaign,
CombatEvent::MOVE_TO,
(int) campaign->GetTime(),
@@ -616,7 +615,7 @@ CampaignPlanEvent::CreateEventDefend(CombatAssignment* a)
Text title = Text(group->Name()) + " in Defensive Engagement";
Text info;
- event = new(__FILE__,__LINE__) CombatEvent(campaign,
+ event = new CombatEvent(campaign,
CombatEvent::DEFEND,
event_time,
group->GetIFF(),
@@ -695,7 +694,7 @@ CampaignPlanEvent::CreateEventFighterAssault(CombatAssignment* a)
Text title = Text(group->Name());
Text info;
- event = new(__FILE__,__LINE__) CombatEvent(campaign,
+ event = new CombatEvent(campaign,
CombatEvent::ATTACK,
event_time,
group->GetIFF(),
@@ -824,7 +823,7 @@ CampaignPlanEvent::CreateEventFighterStrike(CombatAssignment* a)
Text title = Text(group->Name());
Text info;
- event = new(__FILE__,__LINE__) CombatEvent(campaign,
+ event = new CombatEvent(campaign,
CombatEvent::ATTACK,
event_time,
group->GetIFF(),
@@ -964,7 +963,7 @@ CampaignPlanEvent::CreateEventFighterSweep(CombatAssignment* a)
Text title = Text(group->Name());
Text info;
- event = new(__FILE__,__LINE__) CombatEvent(campaign,
+ event = new CombatEvent(campaign,
CombatEvent::ATTACK,
event_time,
group->GetIFF(),
@@ -1110,7 +1109,7 @@ CampaignPlanEvent::CreateEventStarship(CombatAssignment* a)
Text title = Text(group->Name());
Text info;
- event = new(__FILE__,__LINE__) CombatEvent(campaign,
+ event = new CombatEvent(campaign,
CombatEvent::ATTACK,
event_time,
group->GetIFF(),
diff --git a/Stars45/CampaignPlanMission.cpp b/Stars45/CampaignPlanMission.cpp
index a98cbc8..fb8b38c 100644
--- a/Stars45/CampaignPlanMission.cpp
+++ b/Stars45/CampaignPlanMission.cpp
@@ -13,7 +13,6 @@
dynamic campaign.
*/
-#include "MemDebug.h"
#include "CampaignPlanMission.h"
#include "CampaignMissionRequest.h"
#include "CampaignMissionFighter.h"
@@ -160,7 +159,7 @@ CampaignPlanMission::PlanCampaignMission()
(player_group->Type() == CombatGroup::WING &&
player_group->FindGroup(g->Type(), g->GetID())))) {
- request = new(__FILE__,__LINE__)
+ request = new
CampaignMissionRequest(campaign,
action->Subtype(),
start,
@@ -210,7 +209,7 @@ CampaignPlanMission::PlanStrategicMission()
CombatAssignment* a = assignments[assignment_index++];
- request = new(__FILE__,__LINE__)
+ request = new
CampaignMissionRequest(campaign,
a->Type(),
start,
@@ -269,7 +268,7 @@ CampaignPlanMission::PlanRandomStarshipMission()
}
CampaignMissionRequest* request = 0;
- request = new(__FILE__,__LINE__)
+ request = new
CampaignMissionRequest(campaign, type, start, player_group);
return request;
@@ -363,7 +362,7 @@ CampaignPlanMission::PlanRandomFighterMission()
}
}
- request = new(__FILE__,__LINE__)
+ request = new
CampaignMissionRequest(campaign, type, start, primary);
if (request)
diff --git a/Stars45/CampaignPlanMovement.cpp b/Stars45/CampaignPlanMovement.cpp
index a66f202..8d692aa 100644
--- a/Stars45/CampaignPlanMovement.cpp
+++ b/Stars45/CampaignPlanMovement.cpp
@@ -12,7 +12,6 @@
of starship groups between missions.
*/
-#include "MemDebug.h"
#include "CampaignPlanMovement.h"
#include "Campaign.h"
#include "Combatant.h"
diff --git a/Stars45/CampaignPlanStrategic.cpp b/Stars45/CampaignPlanStrategic.cpp
index c5de80d..209c888 100644
--- a/Stars45/CampaignPlanStrategic.cpp
+++ b/Stars45/CampaignPlanStrategic.cpp
@@ -12,7 +12,6 @@
allied forces as the first step in force tasking.
*/
-#include "MemDebug.h"
#include "CampaignPlanStrategic.h"
#include "Campaign.h"
#include "Combatant.h"
diff --git a/Stars45/CampaignSaveGame.cpp b/Stars45/CampaignSaveGame.cpp
index 29f87f8..f4b16ce 100644
--- a/Stars45/CampaignSaveGame.cpp
+++ b/Stars45/CampaignSaveGame.cpp
@@ -12,7 +12,6 @@
campaign games in progress.
*/
-#include "MemDebug.h"
#include "CampaignSaveGame.h"
#include "Campaign.h"
#include "Combatant.h"
@@ -168,7 +167,7 @@ CampaignSaveGame::Load(const char* filename)
Sleep(10);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
if (!term) {
@@ -380,7 +379,7 @@ CampaignSaveGame::Load(const char* filename)
if (campaign && type[0]) {
loader->SetDataPath(campaign->Path());
- CombatEvent* event = new(__FILE__,__LINE__)
+ CombatEvent* event = new
CombatEvent(campaign,
CombatEvent::TypeFromName(type),
time,
diff --git a/Stars45/CampaignSituationReport.cpp b/Stars45/CampaignSituationReport.cpp
index 38402c8..c83ad8d 100644
--- a/Stars45/CampaignSituationReport.cpp
+++ b/Stars45/CampaignSituationReport.cpp
@@ -13,7 +13,6 @@
mission in a dynamic campaign.
*/
-#include "MemDebug.h"
#include "CampaignSituationReport.h"
#include "Campaign.h"
#include "Combatant.h"
diff --git a/Stars45/CarrierAI.cpp b/Stars45/CarrierAI.cpp
index dc55dc5..92ac561 100644
--- a/Stars45/CarrierAI.cpp
+++ b/Stars45/CarrierAI.cpp
@@ -11,7 +11,6 @@
"Air Boss" AI class for managing carrier fighter squadrons
*/
-#include "MemDebug.h"
#include "CarrierAI.h"
#include "ShipAI.h"
#include "Ship.h"
@@ -47,7 +46,7 @@ CarrierAI::CarrierAI(Ship* s, int level)
patrol_elem[i] = 0;
if (ship)
- flight_planner = new(__FILE__,__LINE__) FlightPlanner(ship);
+ flight_planner = new FlightPlanner(ship);
hold_time = (int) Clock::GetInstance()->GameTime();
}
@@ -313,7 +312,7 @@ CarrierAI::CreatePackage(int squadron, int size, int code, const char* target, c
case Mission::DEFEND: i_code = Instruction::DEFEND; break;
}
- Instruction* objective = new(__FILE__,__LINE__) Instruction(i_code, target);
+ Instruction* objective = new Instruction(i_code, target);
if (objective)
elem->AddObjective(objective);
}
diff --git a/Stars45/CmdDlg.cpp b/Stars45/CmdDlg.cpp
index 7e01621..d260c6c 100644
--- a/Stars45/CmdDlg.cpp
+++ b/Stars45/CmdDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog Active Window class
*/
-#include "MemDebug.h"
#include "CmdDlg.h"
#include "CmpFileDlg.h"
#include "CmpnScreen.h"
diff --git a/Stars45/CmdForceDlg.cpp b/Stars45/CmdForceDlg.cpp
index baee4a8..91f8cb6 100644
--- a/Stars45/CmdForceDlg.cpp
+++ b/Stars45/CmdForceDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog (Order of Battle Tab)
*/
-#include "MemDebug.h"
#include "CmdForceDlg.h"
#include "CmdMsgDlg.h"
#include "CmpnScreen.h"
diff --git a/Stars45/CmdIntelDlg.cpp b/Stars45/CmdIntelDlg.cpp
index 3fbc6ec..afa7dd2 100644
--- a/Stars45/CmdIntelDlg.cpp
+++ b/Stars45/CmdIntelDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog (Intel/Newsfeed Tab)
*/
-#include "MemDebug.h"
#include "CmdIntelDlg.h"
#include "CmpnScreen.h"
#include "Starshatter.h"
@@ -104,7 +103,7 @@ CmdIntelDlg::RegisterControls()
if (mov_news) {
CameraDirector* cam_dir = CameraDirector::GetInstance();
- cam_view = new(__FILE__,__LINE__) CameraView(mov_news, cam_dir->GetCamera(), 0);
+ cam_view = new CameraView(mov_news, cam_dir->GetCamera(), 0);
if (cam_view)
mov_news->AddView(cam_view);
diff --git a/Stars45/CmdMissionsDlg.cpp b/Stars45/CmdMissionsDlg.cpp
index a2dac90..ee5b265 100644
--- a/Stars45/CmdMissionsDlg.cpp
+++ b/Stars45/CmdMissionsDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog (Mission List Tab)
*/
-#include "MemDebug.h"
#include "CmdMissionsDlg.h"
#include "CmpnScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/CmdMsgDlg.cpp b/Stars45/CmdMsgDlg.cpp
index 4a4d03e..0d0b0ba 100644
--- a/Stars45/CmdMsgDlg.cpp
+++ b/Stars45/CmdMsgDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "CmdMsgDlg.h"
#include "CmpnScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/CmdOrdersDlg.cpp b/Stars45/CmdOrdersDlg.cpp
index fd6e860..7fd4183 100644
--- a/Stars45/CmdOrdersDlg.cpp
+++ b/Stars45/CmdOrdersDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog (Campaign Orders Tab)
*/
-#include "MemDebug.h"
#include "CmdOrdersDlg.h"
#include "CmdDlg.h"
#include "CmpnScreen.h"
diff --git a/Stars45/CmdTheaterDlg.cpp b/Stars45/CmdTheaterDlg.cpp
index c2f8fb7..b07fa70 100644
--- a/Stars45/CmdTheaterDlg.cpp
+++ b/Stars45/CmdTheaterDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog (Theater Map Tab)
*/
-#include "MemDebug.h"
#include "CmdTheaterDlg.h"
#include "CmdDlg.h"
#include "CmpnScreen.h"
@@ -95,7 +94,7 @@ CmdTheaterDlg::RegisterControls()
}
if (map_theater)
- map_view = new(__FILE__,__LINE__) MapView(map_theater);
+ map_view = new MapView(map_theater);
for (int i = 0; i < 3; i++) {
view_btn[i] = (Button*) FindControl(401 + i);
diff --git a/Stars45/CmdTitleDlg.cpp b/Stars45/CmdTitleDlg.cpp
index d372f68..dfc89ff 100644
--- a/Stars45/CmdTitleDlg.cpp
+++ b/Stars45/CmdTitleDlg.cpp
@@ -11,7 +11,6 @@
Operational Command Dialog (Intel/Newsfeed Tab)
*/
-#include "MemDebug.h"
#include "CmdTitleDlg.h"
#include "CmpnScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/CmpCompleteDlg.cpp b/Stars45/CmpCompleteDlg.cpp
index d86cc9e..a80e460 100644
--- a/Stars45/CmpCompleteDlg.cpp
+++ b/Stars45/CmpCompleteDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "CmpCompleteDlg.h"
#include "CmpnScreen.h"
#include "Campaign.h"
diff --git a/Stars45/CmpFileDlg.cpp b/Stars45/CmpFileDlg.cpp
index bd37883..1f359e5 100644
--- a/Stars45/CmpFileDlg.cpp
+++ b/Stars45/CmpFileDlg.cpp
@@ -11,7 +11,6 @@
Mission Select Dialog Active Window class
*/
-#include "MemDebug.h"
#include "CmpFileDlg.h"
#include "CmpnScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/CmpLoadDlg.cpp b/Stars45/CmpLoadDlg.cpp
index 96c4f45..08fefd7 100644
--- a/Stars45/CmpLoadDlg.cpp
+++ b/Stars45/CmpLoadDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "CmpLoadDlg.h"
#include "Campaign.h"
#include "Starshatter.h"
diff --git a/Stars45/CmpSceneDlg.cpp b/Stars45/CmpSceneDlg.cpp
index 72e92e7..4cedc21 100644
--- a/Stars45/CmpSceneDlg.cpp
+++ b/Stars45/CmpSceneDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "CmpSceneDlg.h"
#include "CmpnScreen.h"
#include "GameScreen.h"
@@ -67,7 +66,7 @@ CmpSceneDlg::RegisterControls()
if (mov_scene) {
CameraDirector* cam_dir = CameraDirector::GetInstance();
- cam_view = new(__FILE__,__LINE__) CameraView(mov_scene, cam_dir->GetCamera(), 0);
+ cam_view = new CameraView(mov_scene, cam_dir->GetCamera(), 0);
if (cam_view)
mov_scene->AddView(cam_view);
diff --git a/Stars45/CmpSelectDlg.cpp b/Stars45/CmpSelectDlg.cpp
index 8df1fd5..afcf6d2 100644
--- a/Stars45/CmpSelectDlg.cpp
+++ b/Stars45/CmpSelectDlg.cpp
@@ -11,7 +11,6 @@
Mission Select Dialog Active Window class
*/
-#include "MemDebug.h"
#include "CmpSelectDlg.h"
#include "ConfirmDlg.h"
#include "MenuScreen.h"
@@ -239,7 +238,7 @@ CmpSelectDlg::ShowNewCampaigns()
Campaign* c = iter.value();
if (c->GetCampaignId() < Campaign::SINGLE_MISSIONS) {
- Bitmap* bmp = new(__FILE__,__LINE__) Bitmap;
+ Bitmap* bmp = new Bitmap;
bmp->CopyBitmap(*c->GetImage(0));
images.append(bmp);
diff --git a/Stars45/CmpnScreen.cpp b/Stars45/CmpnScreen.cpp
index b5b787b..970eaf9 100644
--- a/Stars45/CmpnScreen.cpp
+++ b/Stars45/CmpnScreen.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "CmpnScreen.h"
#include "CmdForceDlg.h"
@@ -75,39 +74,39 @@ CmpnScreen::Setup(Screen* s)
FormDef cmd_orders_def("CmdOrdersDlg", 0);
cmd_orders_def.Load("CmdOrdersDlg");
- cmd_orders_dlg = new(__FILE__,__LINE__) CmdOrdersDlg(screen, cmd_orders_def, this);
+ cmd_orders_dlg = new CmdOrdersDlg(screen, cmd_orders_def, this);
FormDef cmd_force_def("CmdForceDlg", 0);
cmd_force_def.Load("CmdForceDlg");
- cmd_force_dlg = new(__FILE__,__LINE__) CmdForceDlg(screen, cmd_force_def, this);
+ cmd_force_dlg = new CmdForceDlg(screen, cmd_force_def, this);
FormDef cmd_theater_def("CmdTheaterDlg", 0);
cmd_theater_def.Load("CmdTheaterDlg");
- cmd_theater_dlg = new(__FILE__,__LINE__) CmdTheaterDlg(screen, cmd_theater_def, this);
+ cmd_theater_dlg = new CmdTheaterDlg(screen, cmd_theater_def, this);
FormDef cmd_intel_def("CmdIntelDlg", 0);
cmd_intel_def.Load("CmdIntelDlg");
- cmd_intel_dlg = new(__FILE__,__LINE__) CmdIntelDlg(screen, cmd_intel_def, this);
+ cmd_intel_dlg = new CmdIntelDlg(screen, cmd_intel_def, this);
FormDef cmd_missions_def("CmdMissionsDlg", 0);
cmd_missions_def.Load("CmdMissionsDlg");
- cmd_missions_dlg = new(__FILE__,__LINE__) CmdMissionsDlg(screen, cmd_missions_def, this);
+ cmd_missions_dlg = new CmdMissionsDlg(screen, cmd_missions_def, this);
FormDef file_def("FileDlg", 0);
file_def.Load("FileDlg");
- cmp_file_dlg = new(__FILE__,__LINE__) CmpFileDlg(screen, file_def, this);
+ cmp_file_dlg = new CmpFileDlg(screen, file_def, this);
FormDef msg_def("CmdMsgDlg", 0);
msg_def.Load("CmdMsgDlg");
- cmd_msg_dlg = new(__FILE__,__LINE__) CmdMsgDlg(screen, msg_def, this);
+ cmd_msg_dlg = new CmdMsgDlg(screen, msg_def, this);
FormDef end_def("CmpCompleteDlg", 0);
end_def.Load("CmpCompleteDlg");
- cmp_end_dlg = new(__FILE__,__LINE__) CmpCompleteDlg(screen, end_def, this);
+ cmp_end_dlg = new CmpCompleteDlg(screen, end_def, this);
FormDef scene_def("CmpSceneDlg", 0);
scene_def.Load("CmpSceneDlg");
- cmp_scene_dlg = new(__FILE__,__LINE__) CmpSceneDlg(screen, scene_def, this);
+ cmp_scene_dlg = new CmpSceneDlg(screen, scene_def, this);
loader->UseFileSystem(Starshatter::UseFileSystem());
diff --git a/Stars45/Color.cpp b/Stars45/Color.cpp
index aa01293..15687be 100644
--- a/Stars45/Color.cpp
+++ b/Stars45/Color.cpp
@@ -11,7 +11,6 @@
Universal Color Format class
*/
-#include "MemDebug.h"
#include "Color.h"
#include "Video.h"
#include "Pcx.h"
diff --git a/Stars45/CombatAction.cpp b/Stars45/CombatAction.cpp
index 2ffbabc..2f2a748 100644
--- a/Stars45/CombatAction.cpp
+++ b/Stars45/CombatAction.cpp
@@ -11,7 +11,6 @@
A significant (newsworthy) event in the dynamic campaign.
*/
-#include "MemDebug.h"
#include "CombatAction.h"
#include "CombatGroup.h"
#include "Campaign.h"
@@ -207,19 +206,19 @@ CombatAction::FailAction()
void
CombatAction::AddRequirement(int action, int stat, bool _not)
{
- requirements.append(new(__FILE__,__LINE__) CombatActionReq(action, stat, _not));
+ requirements.append(new CombatActionReq(action, stat, _not));
}
void
CombatAction::AddRequirement(Combatant* c1, Combatant* c2, int comp, int score)
{
- requirements.append(new(__FILE__,__LINE__) CombatActionReq(c1, c2, comp, score));
+ requirements.append(new CombatActionReq(c1, c2, comp, score));
}
void
CombatAction::AddRequirement(Combatant* c1, int group_type, int group_id, int comp, int score, int intel)
{
- requirements.append(new(__FILE__,__LINE__) CombatActionReq(c1, group_type, group_id, comp, score, intel));
+ requirements.append(new CombatActionReq(c1, group_type, group_id, comp, score, intel));
}
// +----------------------------------------------------------------------+
diff --git a/Stars45/CombatAssignment.cpp b/Stars45/CombatAssignment.cpp
index 9d246eb..e9d931e 100644
--- a/Stars45/CombatAssignment.cpp
+++ b/Stars45/CombatAssignment.cpp
@@ -11,7 +11,6 @@
High level assignment of one group to damage another
*/
-#include "MemDebug.h"
#include "CombatAssignment.h"
#include "CombatGroup.h"
#include "Mission.h"
diff --git a/Stars45/CombatEvent.cpp b/Stars45/CombatEvent.cpp
index 503606d..8c02142 100644
--- a/Stars45/CombatEvent.cpp
+++ b/Stars45/CombatEvent.cpp
@@ -11,7 +11,6 @@
A significant (newsworthy) event in the dynamic campaign.
*/
-#include "MemDebug.h"
#include "CombatEvent.h"
#include "CombatGroup.h"
#include "Campaign.h"
diff --git a/Stars45/CombatGroup.cpp b/Stars45/CombatGroup.cpp
index 9844445..42976bd 100644
--- a/Stars45/CombatGroup.cpp
+++ b/Stars45/CombatGroup.cpp
@@ -11,7 +11,6 @@
An element in the dynamic campaign
*/
-#include "MemDebug.h"
#include "CombatGroup.h"
#include "CombatUnit.h"
#include "CombatZone.h"
@@ -385,7 +384,7 @@ CombatGroup::FindGroup(int t, int n)
CombatGroup*
CombatGroup::Clone(bool deep)
{
- CombatGroup* clone = new(__FILE__,__LINE__)
+ CombatGroup* clone = new
CombatGroup(type, id, name, iff, enemy_intel);
clone->combatant = combatant;
@@ -395,7 +394,7 @@ CombatGroup::Clone(bool deep)
clone->expanded = expanded;
for (int i = 0; i < units.size(); i++) {
- CombatUnit* u = new(__FILE__,__LINE__) CombatUnit(*units[i]);
+ CombatUnit* u = new CombatUnit(*units[i]);
u->SetCombatGroup(clone);
clone->units.append(u);
}
@@ -970,7 +969,7 @@ CombatGroup::LoadOrderOfBattle(const char* filename, int team, Combatant* combat
BYTE* block;
loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
if (!term) {
@@ -1117,7 +1116,7 @@ CombatGroup::LoadOrderOfBattle(const char* filename, int team, Combatant* combat
return 0;
}
- CombatUnit* cu = new(__FILE__,__LINE__) CombatUnit(unit_name, unit_regnum, unit_class, unit_design, unit_count, iff);
+ CombatUnit* cu = new CombatUnit(unit_name, unit_regnum, unit_class, unit_design, unit_count, iff);
cu->SetRegion(unit_region);
cu->SetSkin(unit_skin);
cu->MoveTo(unit_loc);
@@ -1137,7 +1136,7 @@ CombatGroup::LoadOrderOfBattle(const char* filename, int team, Combatant* combat
parent_group = force->FindGroup(TypeFromName(parent_type), parent_id);
}
- CombatGroup* g = new(__FILE__,__LINE__)
+ CombatGroup* g = new
CombatGroup(TypeFromName(type), id, name, iff, Intel::IntelFromName(intel), parent_group);
g->region = region;
@@ -1214,7 +1213,7 @@ CombatGroup::MergeOrderOfBattle(BYTE* block, const char* filename, int team, Com
{
CombatGroup* force = 0;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
if (!term) {
@@ -1363,7 +1362,7 @@ CombatGroup::MergeOrderOfBattle(BYTE* block, const char* filename, int team, Com
}
if (force) {
- CombatUnit* cu = new(__FILE__,__LINE__) CombatUnit(unit_name, unit_regnum, unit_class, unit_design, unit_count, iff);
+ CombatUnit* cu = new CombatUnit(unit_name, unit_regnum, unit_class, unit_design, unit_count, iff);
cu->SetRegion(unit_region);
cu->MoveTo(unit_loc);
cu->Kill(unit_dead);
diff --git a/Stars45/CombatRoster.cpp b/Stars45/CombatRoster.cpp
index 34a3f52..9f552a9 100644
--- a/Stars45/CombatRoster.cpp
+++ b/Stars45/CombatRoster.cpp
@@ -12,7 +12,6 @@
for all combatants in the game.
*/
-#include "MemDebug.h"
#include "CombatRoster.h"
#include "CombatGroup.h"
@@ -75,7 +74,7 @@ CombatRoster::GetForce(const char* name)
void
CombatRoster::Initialize()
{
- roster = new(__FILE__,__LINE__) CombatRoster();
+ roster = new CombatRoster();
}
void
diff --git a/Stars45/CombatUnit.cpp b/Stars45/CombatUnit.cpp
index 7d6d3df..b7af000 100644
--- a/Stars45/CombatUnit.cpp
+++ b/Stars45/CombatUnit.cpp
@@ -11,7 +11,6 @@
A ship, station, or ground unit in the dynamic campaign.
*/
-#include "MemDebug.h"
#include "CombatUnit.h"
#include "CombatGroup.h"
#include "Campaign.h"
diff --git a/Stars45/CombatZone.cpp b/Stars45/CombatZone.cpp
index 40b3290..21dbcd5 100644
--- a/Stars45/CombatZone.cpp
+++ b/Stars45/CombatZone.cpp
@@ -15,7 +15,6 @@
within them.
*/
-#include "MemDebug.h"
#include "CombatZone.h"
#include "CombatGroup.h"
#include "CombatUnit.h"
@@ -89,7 +88,7 @@ void
CombatZone::AddRegion(const char* rgn)
{
if (rgn && *rgn) {
- regions.append(new (__FILE__,__LINE__) Text(rgn));
+ regions.append(new Text(rgn));
if (name.length() < 1)
name = rgn;
@@ -128,7 +127,7 @@ CombatZone::FindForce(int iff)
ZoneForce*
CombatZone::MakeForce(int iff)
{
- ZoneForce* f = new(__FILE__,__LINE__) ZoneForce(iff);
+ ZoneForce* f = new ZoneForce(iff);
forces.append(f);
return f;
}
@@ -146,7 +145,7 @@ CombatZone::Load(const char* filename)
BYTE* block = 0;
loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -174,7 +173,7 @@ CombatZone::Load(const char* filename)
else {
TermStruct* val = def->term()->isStruct();
- CombatZone* zone = new(__FILE__,__LINE__) CombatZone();
+ CombatZone* zone = new CombatZone();
char rgn[64];
ZeroMemory(rgn, sizeof(rgn));
diff --git a/Stars45/Combatant.cpp b/Stars45/Combatant.cpp
index 1b39722..b6d8794 100644
--- a/Stars45/Combatant.cpp
+++ b/Stars45/Combatant.cpp
@@ -11,7 +11,6 @@
One side in a military conflict
*/
-#include "MemDebug.h"
#include "Combatant.h"
#include "CombatGroup.h"
#include "Mission.h"
diff --git a/Stars45/ComboBox.cpp b/Stars45/ComboBox.cpp
index 2413a73..4269a96 100644
--- a/Stars45/ComboBox.cpp
+++ b/Stars45/ComboBox.cpp
@@ -11,7 +11,6 @@
Drop-down list of Buttons class
*/
-#include "MemDebug.h"
#include "ComboBox.h"
#include "ComboList.h"
#include "Button.h"
@@ -295,7 +294,7 @@ void ComboBox::MoveTo(const Rect& r)
void ComboBox::ShowList()
{
if (!list) {
- list = new(__FILE__,__LINE__) ComboList(this, screen,
+ list = new ComboList(this, screen,
rect.x, rect.y,
rect.w, rect.h,
items.size());
@@ -372,7 +371,7 @@ void ComboBox::ClearItems()
void ComboBox::AddItem(const char* item)
{
- Text* t = new(__FILE__,__LINE__) Text(item);
+ Text* t = new Text(item);
if (t) items.append(t);
}
@@ -392,7 +391,7 @@ void ComboBox::SetItem(int index, const char* item)
}
else {
- Text* t = new(__FILE__,__LINE__) Text(item);
+ Text* t = new Text(item);
if (t)
items.append(t);
}
diff --git a/Stars45/ComboList.cpp b/Stars45/ComboList.cpp
index 43e3620..4d03809 100644
--- a/Stars45/ComboList.cpp
+++ b/Stars45/ComboList.cpp
@@ -15,7 +15,6 @@
#include <algorithm>
-#include "MemDebug.h"
#include "ComboList.h"
#include "ComboBox.h"
#include "Button.h"
@@ -350,20 +349,20 @@ void ComboList::ClearItems()
void ComboList::AddItem(const char* item)
{
- items.append(new(__FILE__,__LINE__) Text(item));
+ items.append(new Text(item));
}
void ComboList::AddItems(ListIter<Text> item)
{
while (++item)
- items.append(new(__FILE__,__LINE__) Text(*item));
+ items.append(new Text(*item));
}
void ComboList::SetItems(ListIter<Text> item)
{
items.destroy();
while (++item)
- items.append(new(__FILE__,__LINE__) Text(*item));
+ items.append(new Text(*item));
// Resize window:
@@ -405,7 +404,7 @@ void ComboList::SetItem(int index, const char* item)
if (index >= 0 && index < items.size())
*items[index] = item;
else
- items.append(new(__FILE__,__LINE__) Text(item));
+ items.append(new Text(item));
}
int ComboList::GetCount()
diff --git a/Stars45/Component.cpp b/Stars45/Component.cpp
index 35915bf..97e1460 100644
--- a/Stars45/Component.cpp
+++ b/Stars45/Component.cpp
@@ -11,7 +11,6 @@
Generic ship system sub-component class
*/
-#include "MemDebug.h"
#include "Component.h"
#include "System.h"
#include "Game.h"
diff --git a/Stars45/Computer.cpp b/Stars45/Computer.cpp
index 2687bde..60f5ee0 100644
--- a/Stars45/Computer.cpp
+++ b/Stars45/Computer.cpp
@@ -11,7 +11,6 @@
Computer System class
*/
-#include "MemDebug.h"
#include "Computer.h"
#include "Game.h"
#include "ContentBundle.h"
diff --git a/Stars45/ConfirmDlg.cpp b/Stars45/ConfirmDlg.cpp
index 33a7520..4e528f5 100644
--- a/Stars45/ConfirmDlg.cpp
+++ b/Stars45/ConfirmDlg.cpp
@@ -11,7 +11,6 @@
General-purpose confirmation dialog class
*/
-#include "MemDebug.h"
#include "ConfirmDlg.h"
#include "MenuScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/Contact.cpp b/Stars45/Contact.cpp
index cde6bcf..2dbec5a 100644
--- a/Stars45/Contact.cpp
+++ b/Stars45/Contact.cpp
@@ -11,7 +11,6 @@
Integrated (Passive and Active) Sensor Package class implementation
*/
-#include "MemDebug.h"
#include "Contact.h"
#include "Drone.h"
#include "Sensor.h"
@@ -334,7 +333,7 @@ Contact::UpdateTrack()
return;
if (!track) {
- track = new(__FILE__,__LINE__) Point[DEFAULT_TRACK_LENGTH];
+ track = new Point[DEFAULT_TRACK_LENGTH];
track[0] = loc;
ntrack = 1;
track_time = time;
diff --git a/Stars45/ContentBundle.cpp b/Stars45/ContentBundle.cpp
index 534f550..cd10893 100644
--- a/Stars45/ContentBundle.cpp
+++ b/Stars45/ContentBundle.cpp
@@ -11,7 +11,6 @@
Chained collection of localized strings
*/
-#include "MemDebug.h"
#include "ContentBundle.h"
#include "DataLoader.h"
#include "Utils.h"
diff --git a/Stars45/CtlDlg.cpp b/Stars45/CtlDlg.cpp
index 73f3ce0..fc74e17 100644
--- a/Stars45/CtlDlg.cpp
+++ b/Stars45/CtlDlg.cpp
@@ -11,7 +11,6 @@
Control Options (keyboard/joystick) Dialog Active Window class
*/
-#include "MemDebug.h"
#include "CtlDlg.h"
#include "KeyDlg.h"
#include "MenuScreen.h"
diff --git a/Stars45/D3DXImage.cpp b/Stars45/D3DXImage.cpp
index 1e0a187..9ab9779 100644
--- a/Stars45/D3DXImage.cpp
+++ b/Stars45/D3DXImage.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "D3DXImage.h"
#include "VideoDX9.h"
@@ -31,7 +30,7 @@ D3DXImage::D3DXImage(WORD w, WORD h, DWORD* img)
int pixels = width * height;
- image = new(__FILE__,__LINE__) DWORD [pixels];
+ image = new DWORD [pixels];
if (image && pixels) {
for (int i = 0; i < pixels; i++)
@@ -62,7 +61,7 @@ bool D3DXImage::Load(char *filename)
len = ftell(f);
fseek(f, 0, SEEK_SET);
- buf = new(__FILE__,__LINE__) BYTE[len];
+ buf = new BYTE[len];
if (buf) {
fread(buf, len, 1, f);
@@ -129,7 +128,7 @@ bool D3DXImage::LoadBuffer(BYTE* buf, int len)
if (SUCCEEDED(hr)) {
// copy surface into image
- image = new(__FILE__,__LINE__) DWORD[width*height];
+ image = new DWORD[width*height];
if (image) {
for (DWORD i = 0; i < height; i++) {
BYTE* dst = (BYTE*) (image + i * width);
diff --git a/Stars45/DataLoader.cpp b/Stars45/DataLoader.cpp
index 9c58608..22ac803 100644
--- a/Stars45/DataLoader.cpp
+++ b/Stars45/DataLoader.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "DataLoader.h"
#include "Archive.h"
#include "Color.h"
@@ -45,7 +44,7 @@ DataLoader::UseVideo(Video* v)
void
DataLoader::Initialize()
{
- def_loader = new(__FILE__,__LINE__) DataLoader;
+ def_loader = new DataLoader;
loader = def_loader;
archives.destroy();
@@ -95,7 +94,7 @@ DataLoader::EnableDatafile(const char* name)
if (f) {
::fclose(f);
- DataArchive* a = new(__FILE__,__LINE__) DataArchive(name);
+ DataArchive* a = new DataArchive(name);
if (a && a->NumFiles() >= 1) {
status = DATAFILE_OK;
@@ -360,13 +359,13 @@ DataLoader::LoadBuffer(const char* name, BYTE*& buf, bool null_terminate, bool o
::fseek(f, 0, SEEK_SET);
if (null_terminate) {
- buf = new(__FILE__,__LINE__) BYTE[len+1];
+ buf = new BYTE[len+1];
if (buf)
buf[len] = 0;
}
else {
- buf = new(__FILE__,__LINE__) BYTE[len];
+ buf = new BYTE[len];
}
if (buf)
@@ -431,7 +430,7 @@ DataLoader::LoadPartialFile(const char* name, BYTE*& buf, int max_load, bool opt
len = max_load;
}
- buf = new(__FILE__,__LINE__) BYTE[len];
+ buf = new BYTE[len];
if (buf)
::fread(buf, len, 1, f);
@@ -476,7 +475,7 @@ DataLoader::CacheBitmap(const char* name, Bitmap*& bitmap, int type, bool option
if (bitmap) return 1;
// not in cache yet:
- bitmap = new(__FILE__,__LINE__) Bitmap;
+ bitmap = new Bitmap;
if (bitmap)
result = LoadBitmap(name, *bitmap, type, optional);
@@ -533,7 +532,7 @@ DataLoader::LoadTexture(const char* name, Bitmap*& bitmap, int type, bool preloa
if (bitmap) return 1;
// not in cache yet:
- bitmap = new(__FILE__,__LINE__) Bitmap;
+ bitmap = new Bitmap;
if (bitmap) {
result = LoadHiColor(name, *bitmap, type);
diff --git a/Stars45/DebriefDlg.cpp b/Stars45/DebriefDlg.cpp
index c8b08b4..d4977ab 100644
--- a/Stars45/DebriefDlg.cpp
+++ b/Stars45/DebriefDlg.cpp
@@ -11,7 +11,6 @@
Mission Debriefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "DebriefDlg.h"
#include "PlanScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/Debris.cpp b/Stars45/Debris.cpp
index b90d88c..952c133 100644
--- a/Stars45/Debris.cpp
+++ b/Stars45/Debris.cpp
@@ -11,7 +11,6 @@
Debris Sprite animation class
*/
-#include "MemDebug.h"
#include "Debris.h"
#include "Shot.h"
#include "Explosion.h"
@@ -37,7 +36,7 @@ Debris::Debris(Model* model, const Vec3& pos, const Vec3& vel, double m)
integrity = mass * 10.0f;
life = 300;
- Solid* solid = new(__FILE__,__LINE__) Solid;
+ Solid* solid = new Solid;
if (solid) {
solid->UseModel(model);
diff --git a/Stars45/DetailSet.cpp b/Stars45/DetailSet.cpp
index c0e79ec..6edaec4 100644
--- a/Stars45/DetailSet.cpp
+++ b/Stars45/DetailSet.cpp
@@ -11,7 +11,6 @@
Level of Detail manager class
*/
-#include "MemDebug.h"
#include "DetailSet.h"
#include "Random.h"
#include "Video.h"
@@ -53,14 +52,14 @@ DetailSet::DefineLevel(double r, Graphic* g, Point* o, Point* spin_rate)
off[levels].append(o);
else if (g)
- off[levels].append(new(__FILE__,__LINE__) Point(0,0,0));
+ off[levels].append(new Point(0,0,0));
if (rate.size() == 0) {
if (spin_rate) {
rate.append(spin_rate);
// randomize the initial orientation:
- Point* initial_spin = new(__FILE__,__LINE__) Point();
+ Point* initial_spin = new Point();
if (spin_rate->x != 0) initial_spin->x = Random(-PI, PI);
if (spin_rate->y != 0) initial_spin->y = Random(-PI, PI);
if (spin_rate->z != 0) initial_spin->z = Random(-PI, PI);
@@ -68,8 +67,8 @@ DetailSet::DefineLevel(double r, Graphic* g, Point* o, Point* spin_rate)
spin.append(initial_spin);
}
else {
- rate.append(new(__FILE__,__LINE__) Point());
- spin.append(new(__FILE__,__LINE__) Point());
+ rate.append(new Point());
+ spin.append(new Point());
}
}
else {
@@ -90,7 +89,7 @@ DetailSet::AddToLevel(int level, Graphic* g, Point* offset, Point* spin_rate)
rep[level].append(g);
if (!offset)
- offset = new(__FILE__,__LINE__) Point(0,0,0);
+ offset = new Point(0,0,0);
off[level].append(offset);
@@ -103,7 +102,7 @@ DetailSet::AddToLevel(int level, Graphic* g, Point* offset, Point* spin_rate)
}
if (spin.size() < rep[level].size()) {
- Point* initial_spin = new(__FILE__,__LINE__) Point();
+ Point* initial_spin = new Point();
if (spin_rate) {
// randomize the initial orientation:
diff --git a/Stars45/DisplayView.cpp b/Stars45/DisplayView.cpp
index f1d70df..89d019d 100644
--- a/Stars45/DisplayView.cpp
+++ b/Stars45/DisplayView.cpp
@@ -11,7 +11,6 @@
View class for Quantum Destination HUD Overlay
*/
-#include "MemDebug.h"
#include "DisplayView.h"
#include "QuantumDrive.h"
#include "HUDView.h"
@@ -196,7 +195,7 @@ double hold,
double fade_in,
double fade_out)
{
- DisplayElement* elem = new(__FILE__,__LINE__) DisplayElement;
+ DisplayElement* elem = new DisplayElement;
if (fade_in == 0 && fade_out == 0 && hold == 0)
hold = 300;
@@ -221,7 +220,7 @@ double hold,
double fade_in,
double fade_out)
{
- DisplayElement* elem = new(__FILE__,__LINE__) DisplayElement;
+ DisplayElement* elem = new DisplayElement;
if (fade_in == 0 && fade_out == 0 && hold == 0)
hold = 300;
diff --git a/Stars45/Drive.cpp b/Stars45/Drive.cpp
index 24536cf..bf1966c 100644
--- a/Stars45/Drive.cpp
+++ b/Stars45/Drive.cpp
@@ -15,7 +15,6 @@
#include <algorithm>
-#include "MemDebug.h"
#include "Drive.h"
#include "Power.h"
#include "Ship.h"
@@ -208,7 +207,7 @@ void
Drive::AddPort(const Point& loc, float flare_scale)
{
if (flare_scale == 0) flare_scale = scale;
- DrivePort* port = new(__FILE__,__LINE__) DrivePort(loc, flare_scale);
+ DrivePort* port = new DrivePort(loc, flare_scale);
ports.append(port);
}
@@ -228,17 +227,17 @@ Drive::CreatePort(const Point& loc, float flare_scale)
glow_bmp = drive_glow_bitmap[subtype];
if (subtype != Drive::STEALTH && flare_scale > 0) {
- DrivePort* port = new(__FILE__,__LINE__) DrivePort(loc, flare_scale);
+ DrivePort* port = new DrivePort(loc, flare_scale);
if (flare_bmp) {
- DriveSprite* flare_rep = new(__FILE__,__LINE__) DriveSprite(flare_bmp, glow_bmp);
+ DriveSprite* flare_rep = new DriveSprite(flare_bmp, glow_bmp);
flare_rep->Scale(flare_scale * 1.5);
flare_rep->SetShade(0);
port->flare = flare_rep;
}
if (trail_bmp && show_trail) {
- Bolt* trail_rep = new(__FILE__,__LINE__) Bolt(flare_scale * 30, flare_scale * 8, trail_bmp, true);
+ Bolt* trail_rep = new Bolt(flare_scale * 30, flare_scale * 8, trail_bmp, true);
port->trail = trail_rep;
}
diff --git a/Stars45/DriveSprite.cpp b/Stars45/DriveSprite.cpp
index 4163bc9..804ef4b 100644
--- a/Stars45/DriveSprite.cpp
+++ b/Stars45/DriveSprite.cpp
@@ -11,7 +11,6 @@
Sprite for rendering drive flares. Remains visible at extreme ranges.
*/
-#include "MemDebug.h"
#include "DriveSprite.h"
#include "Bitmap.h"
diff --git a/Stars45/Drone.cpp b/Stars45/Drone.cpp
index f4116e3..b568987 100644
--- a/Stars45/Drone.cpp
+++ b/Stars45/Drone.cpp
@@ -11,7 +11,6 @@
Laser and Missile class
*/
-#include "MemDebug.h"
#include "Drone.h"
#include "Weapon.h"
#include "Ship.h"
diff --git a/Stars45/DropShipAI.cpp b/Stars45/DropShipAI.cpp
index 8411662..bc563fc 100644
--- a/Stars45/DropShipAI.cpp
+++ b/Stars45/DropShipAI.cpp
@@ -11,7 +11,6 @@
Drop Ship (orbit/surface and surface/orbit) AI class
*/
-#include "MemDebug.h"
#include "DropShipAI.h"
#include "TacticalAI.h"
#include "Ship.h"
diff --git a/Stars45/EditBox.cpp b/Stars45/EditBox.cpp
index db5861f..cf08a4b 100644
--- a/Stars45/EditBox.cpp
+++ b/Stars45/EditBox.cpp
@@ -11,7 +11,6 @@
EditBox ActiveWindow class
*/
-#include "MemDebug.h"
#include "EditBox.h"
#include "FormWindow.h"
#include "Video.h"
@@ -152,7 +151,7 @@ Text EditBox::GetSelText()
return text;
Text selection;
- char* buf = new(__FILE__,__LINE__) char[sel_length+1];
+ char* buf = new char[sel_length+1];
if (buf) {
for (int i = 0; i < sel_length; i++)
diff --git a/Stars45/Element.cpp b/Stars45/Element.cpp
index c5f68e5..9223cbf 100644
--- a/Stars45/Element.cpp
+++ b/Stars45/Element.cpp
@@ -11,7 +11,6 @@
Package Element (e.g. Flight) class implementation
*/
-#include "MemDebug.h"
#include "Element.h"
#include "Instruction.h"
#include "RadioMessage.h"
@@ -532,7 +531,7 @@ Element::ClearInstructions()
void
Element::AddInstruction(const char* instr)
{
- instructions.append(new(__FILE__,__LINE__) Text(instr));
+ instructions.append(new Text(instr));
}
Text
diff --git a/Stars45/Encrypt.cpp b/Stars45/Encrypt.cpp
index ba07099..44d07ca 100644
--- a/Stars45/Encrypt.cpp
+++ b/Stars45/Encrypt.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "Encrypt.h"
#include "Utils.h"
@@ -80,7 +79,7 @@ Encryption::Encrypt(Text block)
len += 8;
}
- BYTE* work = new(__FILE__,__LINE__) BYTE[len];
+ BYTE* work = new BYTE[len];
ZeroMemory(work, len);
CopyMemory(work, block.data(), block.length());
@@ -107,7 +106,7 @@ Encryption::Decrypt(Text block)
return Text();
}
- BYTE* work = new(__FILE__,__LINE__) BYTE[len];
+ BYTE* work = new BYTE[len];
CopyMemory(work, block.data(), len);
long* v = (long*) work;
@@ -129,7 +128,7 @@ Text
Encryption::Encode(Text block)
{
int len = block.length() * 2;
- char* work = new(__FILE__,__LINE__) char[len + 1];
+ char* work = new char[len + 1];
for (int i = 0; i < block.length(); i++) {
BYTE b = (BYTE) (block.data()[i]);
@@ -150,7 +149,7 @@ Text
Encryption::Decode(Text block)
{
int len = block.length() / 2;
- char* work = new(__FILE__,__LINE__) char[len + 1];
+ char* work = new char[len + 1];
for (int i = 0; i < len; i++) {
char u = block[2*i];
diff --git a/Stars45/EngDlg.cpp b/Stars45/EngDlg.cpp
index 8bd865d..7df1f9f 100644
--- a/Stars45/EngDlg.cpp
+++ b/Stars45/EngDlg.cpp
@@ -11,7 +11,6 @@
Engineering (Power/Maint) Dialog Active Window class
*/
-#include "MemDebug.h"
#include "EngDlg.h"
#include "GameScreen.h"
#include "Ship.h"
diff --git a/Stars45/EventDispatch.cpp b/Stars45/EventDispatch.cpp
index ba19df9..0a9b95c 100644
--- a/Stars45/EventDispatch.cpp
+++ b/Stars45/EventDispatch.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "EventDispatch.h"
#include "Mouse.h"
#include "Keyboard.h"
@@ -35,7 +34,7 @@ EventDispatch::~EventDispatch()
void
EventDispatch::Create()
{
- dispatcher = new(__FILE__,__LINE__) EventDispatch;
+ dispatcher = new EventDispatch;
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/ExitDlg.cpp b/Stars45/ExitDlg.cpp
index d175b79..5d42448 100644
--- a/Stars45/ExitDlg.cpp
+++ b/Stars45/ExitDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "ExitDlg.h"
#include "MenuScreen.h"
#include "MusicDirector.h"
diff --git a/Stars45/Explosion.cpp b/Stars45/Explosion.cpp
index d72ffcd..9a47b0b 100644
--- a/Stars45/Explosion.cpp
+++ b/Stars45/Explosion.cpp
@@ -11,7 +11,6 @@
Explosion Sprite animation class
*/
-#include "MemDebug.h"
#include "Explosion.h"
#include "QuantumFlash.h"
#include "Particles.h"
@@ -74,10 +73,10 @@ SimRegion* rgn, SimObject* src)
if (type == QUANTUM_FLASH) {
life = 1.1;
- QuantumFlash* q = new(__FILE__,__LINE__) QuantumFlash();
+ QuantumFlash* q = new QuantumFlash();
rep = q;
- light = new(__FILE__,__LINE__) Light(1e9, 0.66f);
+ light = new Light(1e9, 0.66f);
light->SetColor(Color(180, 200, 255));
}
@@ -92,7 +91,7 @@ SimRegion* rgn, SimObject* src)
if (lengths[type] > 0) {
int repeat = (lengths[type] == 1);
- Sprite* s = new(__FILE__,__LINE__) Sprite(bitmaps[type], lengths[type], repeat);
+ Sprite* s = new Sprite(bitmaps[type], lengths[type], repeat);
s->Scale(exp_scale * scales[type]);
s->SetAngle(PI * rand()/16384.0);
s->SetLuminous(true);
@@ -100,12 +99,12 @@ SimRegion* rgn, SimObject* src)
}
if (light_levels[type] > 0) {
- light = new(__FILE__,__LINE__) Light(light_levels[type], light_decays[type]);
+ light = new Light(light_levels[type], light_decays[type]);
light->SetColor(light_colors[type]);
}
if (num_parts[type] > 0) {
- particles = new(__FILE__,__LINE__) Particles(particle_bitmaps[type],
+ particles = new Particles(particle_bitmaps[type],
num_parts[type],
pos,
Vec3(0.0f, 0.0f, 0.0f),
@@ -204,7 +203,7 @@ Explosion::Initialize()
loader->SetDataPath("Explosions/");
int blocklen = loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -416,7 +415,7 @@ Explosion::Initialize()
recycles[type] = continuous;
if (length > 0) {
- bitmaps[type] = new(__FILE__,__LINE__) Bitmap[length];
+ bitmaps[type] = new Bitmap[length];
if (length > 1) {
for (int n = 0; n < length; n++) {
@@ -432,7 +431,7 @@ Explosion::Initialize()
}
if (particle_bitmap[0]) {
- particle_bitmaps[type] = new(__FILE__,__LINE__) Bitmap[part_nframes];
+ particle_bitmaps[type] = new Bitmap[part_nframes];
if (part_nframes > 1) {
for (int i = 0; i < part_nframes; i++) {
diff --git a/Stars45/FadeView.cpp b/Stars45/FadeView.cpp
index 0dbb302..7abb3bc 100644
--- a/Stars45/FadeView.cpp
+++ b/Stars45/FadeView.cpp
@@ -11,7 +11,6 @@
Fading Bitmap "billboard" Image View class
*/
-#include "MemDebug.h"
#include "FadeView.h"
#include "Color.h"
#include "Window.h"
diff --git a/Stars45/Farcaster.cpp b/Stars45/Farcaster.cpp
index ccf52db..bb1194e 100644
--- a/Stars45/Farcaster.cpp
+++ b/Stars45/Farcaster.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "Farcaster.h"
#include "QuantumDrive.h"
#include "Ship.h"
diff --git a/Stars45/FighterAI.cpp b/Stars45/FighterAI.cpp
index c394cca..4160174 100644
--- a/Stars45/FighterAI.cpp
+++ b/Stars45/FighterAI.cpp
@@ -11,7 +11,6 @@
Fighter (low-level) Artificial Intelligence class
*/
-#include "MemDebug.h"
#include "FighterAI.h"
#include "FighterTacticalAI.h"
#include "Ship.h"
@@ -52,7 +51,7 @@ go_manual(false)
brakes = 0;
z_shift = 0;
- tactical = new(__FILE__,__LINE__) FighterTacticalAI(this);
+ tactical = new FighterTacticalAI(this);
}
@@ -608,7 +607,7 @@ FighterAI::Navigator()
Ship* s = elem->GetShip(i+1);
if (s) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(dock_target, s, RadioMessage::CALL_INBOUND);
+ RadioMessage* msg = new RadioMessage(dock_target, s, RadioMessage::CALL_INBOUND);
RadioTraffic::Transmit(msg);
}
}
diff --git a/Stars45/FighterTacticalAI.cpp b/Stars45/FighterTacticalAI.cpp
index 2ad916d..433b3a9 100644
--- a/Stars45/FighterTacticalAI.cpp
+++ b/Stars45/FighterTacticalAI.cpp
@@ -11,7 +11,6 @@
Fighter-specific mid-level (tactical) AI class
*/
-#include "MemDebug.h"
#include "FighterTacticalAI.h"
#include "ShipAI.h"
#include "Ship.h"
diff --git a/Stars45/FirstTimeDlg.cpp b/Stars45/FirstTimeDlg.cpp
index b122d97..4376243 100644
--- a/Stars45/FirstTimeDlg.cpp
+++ b/Stars45/FirstTimeDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "FirstTimeDlg.h"
#include "Player.h"
#include "MenuScreen.h"
diff --git a/Stars45/Fix.cpp b/Stars45/Fix.cpp
index dbcbb42..67b3782 100644
--- a/Stars45/Fix.cpp
+++ b/Stars45/Fix.cpp
@@ -11,7 +11,6 @@
Fixed point number class with 16 bits of fractional precision
*/
-#include "MemDebug.h"
#include "Fix.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/FlightComp.cpp b/Stars45/FlightComp.cpp
index 2f8f65d..bbb38b6 100644
--- a/Stars45/FlightComp.cpp
+++ b/Stars45/FlightComp.cpp
@@ -11,7 +11,6 @@
Flight Computer System class
*/
-#include "MemDebug.h"
#include "FlightComp.h"
#include "Ship.h"
#include "ShipDesign.h"
diff --git a/Stars45/FlightDeck.cpp b/Stars45/FlightDeck.cpp
index df48def..8b2d070 100644
--- a/Stars45/FlightDeck.cpp
+++ b/Stars45/FlightDeck.cpp
@@ -11,7 +11,6 @@
Everything needed to launch and recover space craft...
*/
-#include "MemDebug.h"
#include "FlightDeck.h"
#include "Ship.h"
#include "ShipCtrl.h"
@@ -206,7 +205,7 @@ num_catsounds(0), num_approach_pts(s.num_approach_pts)
{
Mount(s);
- slots = new(__FILE__,__LINE__) FlightDeckSlot[num_slots];
+ slots = new FlightDeckSlot[num_slots];
for (int i = 0; i < num_slots; i++) {
slots[i].spot_rel = s.slots[i].spot_rel;
slots[i].filter = s.slots[i].filter;
@@ -219,7 +218,7 @@ num_catsounds(0), num_approach_pts(s.num_approach_pts)
runway_rel[i] = s.runway_rel[i];
if (s.light) {
- light = new(__FILE__,__LINE__) Light(*s.light);
+ light = new Light(*s.light);
}
}
@@ -535,7 +534,7 @@ FlightDeck::LaunchShip(Ship* slot_ship)
Point departure = end_point;
departure = departure.OtherHand();
- Instruction* launch_point = new(__FILE__,__LINE__)
+ Instruction* launch_point = new
Instruction(carrier->GetRegion(), departure, Instruction::LAUNCH);
launch_point->SetSpeed(350);
@@ -611,7 +610,7 @@ void
FlightDeck::SetLight(double l)
{
LIGHT_DESTROY(light);
- light = new(__FILE__,__LINE__) Light((float) l);
+ light = new Light((float) l);
}
void
@@ -656,7 +655,7 @@ void
FlightDeck::AddSlot(const Point& spot, DWORD filter)
{
if (!slots)
- slots = new(__FILE__,__LINE__) FlightDeckSlot[10];
+ slots = new FlightDeckSlot[10];
slots[num_slots].spot_rel = spot;
slots[num_slots].filter = filter;
@@ -699,7 +698,7 @@ FlightDeck::Orient(const Physical* rep)
if (num_hoops < 1) {
num_hoops = 4;
- hoops = new(__FILE__,__LINE__) Hoop[num_hoops];
+ hoops = new Hoop[num_hoops];
}
Point hoop_vec = start_point - end_point;
@@ -1026,7 +1025,7 @@ FlightDeck::GrantClearance()
Ship* dst = recovery_queue[0]->GetShip();
- RadioMessage* clearance = new(__FILE__,__LINE__) RadioMessage(dst, carrier, RadioMessage::CALL_CLEARANCE);
+ RadioMessage* clearance = new RadioMessage(dst, carrier, RadioMessage::CALL_CLEARANCE);
clearance->SetInfo(Text("for final approach to ") + Name());
RadioTraffic::Transmit(clearance);
}
diff --git a/Stars45/FlightPlanner.cpp b/Stars45/FlightPlanner.cpp
index aa344f5..e8d11c8 100644
--- a/Stars45/FlightPlanner.cpp
+++ b/Stars45/FlightPlanner.cpp
@@ -12,7 +12,6 @@
Used both by the CarrierAI class and the Flight Dialog.
*/
-#include "MemDebug.h"
#include "FlightPlanner.h"
#include "Ship.h"
#include "ShipDesign.h"
@@ -76,7 +75,7 @@ FlightPlanner::CreatePatrolRoute(Element* elem, int index)
rloc.SetAzimuth(-10*DEGREES + zone);
rloc.SetAzimuthVar(0);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::VECTOR);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::VECTOR);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
@@ -92,7 +91,7 @@ FlightPlanner::CreatePatrolRoute(Element* elem, int index)
rloc.SetAzimuth(-20*DEGREES + zone);
rloc.SetAzimuthVar(15*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::PATROL);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::PATROL);
instr->SetSpeed(500);
instr->GetRLoc() = rloc;
@@ -104,7 +103,7 @@ FlightPlanner::CreatePatrolRoute(Element* elem, int index)
rloc.SetAzimuth(60*DEGREES + zone);
rloc.SetAzimuthVar(20*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::PATROL);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::PATROL);
instr->SetSpeed(350);
instr->GetRLoc() = rloc;
@@ -116,7 +115,7 @@ FlightPlanner::CreatePatrolRoute(Element* elem, int index)
rloc.SetAzimuth(120*DEGREES + zone);
rloc.SetAzimuthVar(20*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::PATROL);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::PATROL);
instr->SetSpeed(350);
instr->GetRLoc() = rloc;
@@ -129,7 +128,7 @@ FlightPlanner::CreatePatrolRoute(Element* elem, int index)
rloc.SetAzimuth(180*DEGREES + ship->CompassHeading());
rloc.SetAzimuthVar(0*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::RTB);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::RTB);
instr->SetSpeed(500);
instr->GetRLoc() = rloc;
@@ -175,7 +174,7 @@ FlightPlanner::CreateStrikeRoute(Element* elem, Element* target)
rloc.SetAzimuth(head);
rloc.SetAzimuthVar(2*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::VECTOR);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::VECTOR);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
@@ -203,7 +202,7 @@ FlightPlanner::CreateStrikeRoute(Element* elem, Element* target)
rloc.SetAzimuth(beam);
rloc.SetAzimuthVar(5*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(tgt_ship->GetRegion(), dummy, Instruction::ASSAULT);
+ instr = new Instruction(tgt_ship->GetRegion(), dummy, Instruction::ASSAULT);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
instr->SetTarget(target->Name());
@@ -220,7 +219,7 @@ FlightPlanner::CreateStrikeRoute(Element* elem, Element* target)
rloc.SetAzimuth(beam);
rloc.SetAzimuthVar(15*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(tgt_ship->GetRegion(), dummy, Instruction::VECTOR);
+ instr = new Instruction(tgt_ship->GetRegion(), dummy, Instruction::VECTOR);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
@@ -238,7 +237,7 @@ FlightPlanner::CreateStrikeRoute(Element* elem, Element* target)
if (tgt_ship->IsGroundUnit())
action = Instruction::STRIKE;
- instr = new(__FILE__,__LINE__) Instruction(tgt_ship->GetRegion(), dummy, action);
+ instr = new Instruction(tgt_ship->GetRegion(), dummy, action);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
instr->SetTarget(target->Name());
@@ -255,7 +254,7 @@ FlightPlanner::CreateStrikeRoute(Element* elem, Element* target)
rloc.SetAzimuth(tgt_ship->CompassHeading());
rloc.SetAzimuthVar(20*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(tgt_ship->GetRegion(), dummy, Instruction::INTERCEPT);
+ instr = new Instruction(tgt_ship->GetRegion(), dummy, Instruction::INTERCEPT);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
instr->SetTarget(target->Name());
@@ -272,7 +271,7 @@ FlightPlanner::CreateStrikeRoute(Element* elem, Element* target)
rloc.SetAzimuth(180*DEGREES + ship->CompassHeading());
rloc.SetAzimuthVar(0*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::RTB);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::RTB);
instr->SetSpeed(500);
instr->GetRLoc() = rloc;
@@ -306,7 +305,7 @@ FlightPlanner::CreateEscortRoute(Element* elem, Element* ward)
rloc.SetAzimuth(head);
rloc.SetAzimuthVar(0);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::VECTOR);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::VECTOR);
instr->SetSpeed(750);
instr->GetRLoc() = rloc;
@@ -327,7 +326,7 @@ FlightPlanner::CreateEscortRoute(Element* elem, Element* ward)
rloc.SetAzimuth(0);
rloc.SetAzimuthVar(90*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::ESCORT);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::ESCORT);
instr->SetSpeed(350);
instr->GetRLoc() = rloc;
instr->SetTarget(ward->Name());
@@ -346,7 +345,7 @@ FlightPlanner::CreateEscortRoute(Element* elem, Element* ward)
rloc.SetAzimuth(0);
rloc.SetAzimuthVar(90*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::DEFEND);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::DEFEND);
instr->SetSpeed(500);
instr->GetRLoc() = rloc;
instr->SetTarget(ward->Name());
@@ -363,7 +362,7 @@ FlightPlanner::CreateEscortRoute(Element* elem, Element* ward)
rloc.SetAzimuth(180*DEGREES + ship->CompassHeading());
rloc.SetAzimuthVar(0*DEGREES);
- instr = new(__FILE__,__LINE__) Instruction(ship->GetRegion(), dummy, Instruction::RTB);
+ instr = new Instruction(ship->GetRegion(), dummy, Instruction::RTB);
instr->SetSpeed(500);
instr->GetRLoc() = rloc;
diff --git a/Stars45/FltDlg.cpp b/Stars45/FltDlg.cpp
index 44770b2..5c3fe1b 100644
--- a/Stars45/FltDlg.cpp
+++ b/Stars45/FltDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "FltDlg.h"
#include "GameScreen.h"
#include "Sim.h"
@@ -145,7 +144,7 @@ FltDlg::SetShip(Ship* s)
filter_list->AddItem(ContentBundle::GetInstance()->GetText("FltDlg.ACTIVE"));
}
- flight_planner = new(__FILE__,__LINE__) FlightPlanner(ship);
+ flight_planner = new FlightPlanner(ship);
}
OnFilter(0);
@@ -683,7 +682,7 @@ FltDlg::OnPackage(AWEvent* event)
int index = objective_list->GetListIndex();
Text target = objective_list->GetItemText(index);
- Instruction* objective = new(__FILE__,__LINE__) Instruction(code, target.data());
+ Instruction* objective = new Instruction(code, target.data());
elem->AddObjective(objective);
tgt = sim->FindElement(target.data());
@@ -928,7 +927,7 @@ FltDlg::OnRecall(AWEvent* event)
Ship* recall = hangar->GetShip(slot);
if (recall) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(recall, ship, RadioMessage::RTB);
+ RadioMessage* msg = new RadioMessage(recall, ship, RadioMessage::RTB);
RadioTraffic::Transmit(msg);
}
}
diff --git a/Stars45/Font.cpp b/Stars45/Font.cpp
index fdb710c..c3ba23b 100644
--- a/Stars45/Font.cpp
+++ b/Stars45/Font.cpp
@@ -11,7 +11,6 @@
Font Resource class implementation
*/
-#include "MemDebug.h"
#include "Font.h"
#include "Polygon.h"
#include "Bitmap.h"
@@ -103,7 +102,7 @@ Font::Load(const char* name)
height = bitmap.Height();
int imgsize = bitmap.Width() * bitmap.Height();
- image = new(__FILE__,__LINE__) BYTE[imgsize];
+ image = new BYTE[imgsize];
if (image) {
if (bitmap.Pixels()) {
@@ -116,7 +115,7 @@ Font::Load(const char* name)
}
}
- material = new(__FILE__,__LINE__) Material;
+ material = new Material;
material->tex_diffuse = &bitmap;
}
else {
@@ -160,7 +159,7 @@ Font::LoadDef(char* defname, char* imgname)
if (!block || blocklen < 4)
return;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -428,7 +427,7 @@ static bool nokern(char c)
void
Font::AutoKern()
{
- FontKernData* data = new(__FILE__,__LINE__) FontKernData[256];
+ FontKernData* data = new FontKernData[256];
if (!data)
return;
@@ -1085,7 +1084,7 @@ Font::DrawString(const char* str, int len, int x1, int y1, const Rect& clip, Bit
// allocate verts, if necessary
int nverts = 4*len;
if (!vset) {
- vset = new(__FILE__,__LINE__) VertexSet(nverts);
+ vset = new VertexSet(nverts);
if (!vset)
return false;
@@ -1202,7 +1201,7 @@ Font::DrawString(const char* str, int len, int x1, int y1, const Rect& clip, Bit
delete [] polys;
npolys = count;
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ polys = new Poly[npolys];
Poly* p = polys;
int index = 0;
diff --git a/Stars45/FontMgr.cpp b/Stars45/FontMgr.cpp
index 2f9c464..2e1529a 100644
--- a/Stars45/FontMgr.cpp
+++ b/Stars45/FontMgr.cpp
@@ -11,7 +11,6 @@
Font Resource Manager class implementation
*/
-#include "MemDebug.h"
#include "FontMgr.h"
// +--------------------------------------------------------------------+
@@ -31,7 +30,7 @@ FontMgr::Close()
void
FontMgr::Register(const char* name, Font* font)
{
- FontItem* item = new(__FILE__,__LINE__) FontItem;
+ FontItem* item = new FontItem;
if (item) {
item->name = name;
diff --git a/Stars45/FormDef.cpp b/Stars45/FormDef.cpp
index 77eb1ca..853003c 100644
--- a/Stars45/FormDef.cpp
+++ b/Stars45/FormDef.cpp
@@ -11,7 +11,6 @@
Form and Control Definition Resources
*/
-#include "MemDebug.h"
#include "FormDef.h"
#include "ParseUtil.h"
#include "DataLoader.h"
@@ -340,7 +339,7 @@ Text CtrlDef::GetItem(int i) const
void CtrlDef::AddItem(const char* t)
{
- items.append(new(__FILE__,__LINE__) Text(t));
+ items.append(new Text(t));
}
int CtrlDef::NumColumns() const
@@ -360,7 +359,7 @@ ColumnDef* CtrlDef::GetColumn(int i) const
void CtrlDef::AddColumn(const char* t, int w, int a, int s)
{
- columns.append(new(__FILE__,__LINE__) ColumnDef(t,w,a,s));
+ columns.append(new ColumnDef(t,w,a,s));
}
int CtrlDef::NumTabs() const
@@ -581,7 +580,7 @@ FormDef::Load(const char* fname)
if (!block || blocklen < 4)
return;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -755,7 +754,7 @@ FormDef::Load(const char* fname)
Print("WARNING: ctrl structure missing in '%s'\n", filename);
}
else {
- CtrlDef* ctrl = new(__FILE__,__LINE__) CtrlDef;
+ CtrlDef* ctrl = new CtrlDef;
TermStruct* val = pdef->term()->isStruct();
form->AddCtrl(ctrl);
diff --git a/Stars45/FormWindow.cpp b/Stars45/FormWindow.cpp
index bfc4558..e58042d 100644
--- a/Stars45/FormWindow.cpp
+++ b/Stars45/FormWindow.cpp
@@ -11,7 +11,6 @@
Form Window class
*/
-#include "MemDebug.h"
#include "FormWindow.h"
#include "Screen.h"
#include "DataLoader.h"
@@ -86,7 +85,7 @@ FormWindow::CreateButton(const char* btn_text, int ax, int ay, int aw, int ah, D
if (pid)
parent = FindControl(pid);
- button = new(__FILE__,__LINE__) Button(parent, ax, ay, aw, ah, aid);
+ button = new Button(parent, ax, ay, aw, ah, aid);
if (button) {
button->SetForm(this);
@@ -110,7 +109,7 @@ FormWindow::CreateImageBox(const char* lbl_text, int ax, int ay, int aw, int ah,
if (pid)
parent = FindControl(pid);
- image = new(__FILE__,__LINE__) ImageBox(parent, ax, ay, aw, ah, aid);
+ image = new ImageBox(parent, ax, ay, aw, ah, aid);
if (image) {
image->SetForm(this);
@@ -134,7 +133,7 @@ FormWindow::CreateLabel(const char* label_text, int ax, int ay, int aw, int ah,
if (pid)
parent = FindControl(pid);
- label = new(__FILE__,__LINE__) ActiveWindow(screen, ax, ay, aw, ah, aid, astyle, parent);
+ label = new ActiveWindow(screen, ax, ay, aw, ah, aid, astyle, parent);
if (label) {
label->SetForm(this);
@@ -158,7 +157,7 @@ FormWindow::CreateListBox(const char* lbl_text, int ax, int ay, int aw, int ah,
if (pid)
parent = FindControl(pid);
- list = new(__FILE__,__LINE__) ListBox(parent, ax, ay, aw, ah, aid);
+ list = new ListBox(parent, ax, ay, aw, ah, aid);
if (list) {
list->SetForm(this);
@@ -181,7 +180,7 @@ FormWindow::CreateComboBox(const char* lbl_text, int ax, int ay, int aw, int ah,
if (pid)
parent = FindControl(pid);
- combo = new(__FILE__,__LINE__) ComboBox(parent, ax, ay, aw, ah, aid);
+ combo = new ComboBox(parent, ax, ay, aw, ah, aid);
if (combo) {
combo->SetForm(this);
@@ -205,7 +204,7 @@ FormWindow::CreateEditBox(const char* lbl_text, int ax, int ay, int aw, int ah,
if (pid)
parent = FindControl(pid);
- edit = new(__FILE__,__LINE__) EditBox(parent, ax, ay, aw, ah, aid);
+ edit = new EditBox(parent, ax, ay, aw, ah, aid);
if (edit) {
edit->SetForm(this);
@@ -229,7 +228,7 @@ FormWindow::CreateRichTextBox(const char* label_text, int ax, int ay, int aw, in
if (pid)
parent = FindControl(pid);
- rtb = new(__FILE__,__LINE__) RichTextBox(parent, ax, ay, aw, ah, aid, astyle);
+ rtb = new RichTextBox(parent, ax, ay, aw, ah, aid, astyle);
if (rtb) {
rtb->SetForm(this);
@@ -253,7 +252,7 @@ FormWindow::CreateSlider(const char* label_text, int ax, int ay, int aw, int ah,
if (pid)
parent = FindControl(pid);
- slider = new(__FILE__,__LINE__) Slider(parent, ax, ay, aw, ah, aid);
+ slider = new Slider(parent, ax, ay, aw, ah, aid);
if (slider) {
slider->SetForm(this);
diff --git a/Stars45/FormatUtil.cpp b/Stars45/FormatUtil.cpp
index 86e5060..fd3ce66 100644
--- a/Stars45/FormatUtil.cpp
+++ b/Stars45/FormatUtil.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "FormatUtil.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/Galaxy.cpp b/Stars45/Galaxy.cpp
index 29766f9..1b5bb6f 100644
--- a/Stars45/Galaxy.cpp
+++ b/Stars45/Galaxy.cpp
@@ -11,7 +11,6 @@
Galaxy (list of star systems) for a single campaign.
*/
-#include "MemDebug.h"
#include "Galaxy.h"
#include "StarSystem.h"
#include "Starshatter.h"
@@ -47,7 +46,7 @@ void
Galaxy::Initialize()
{
if (galaxy) delete galaxy;
- galaxy = new(__FILE__,__LINE__) Galaxy("Galaxy");
+ galaxy = new Galaxy("Galaxy");
galaxy->Load();
}
@@ -99,7 +98,7 @@ Galaxy::Load(const char* filename)
DataLoader* loader = DataLoader::GetLoader();
loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -174,11 +173,11 @@ Galaxy::Load(const char* filename)
}
if (sys_name[0]) {
- StarSystem* star_system = new(__FILE__,__LINE__) StarSystem(sys_name, sys_loc, sys_iff, star_class);
+ StarSystem* star_system = new StarSystem(sys_name, sys_loc, sys_iff, star_class);
star_system->Load();
systems.append(star_system);
- Star* star = new(__FILE__,__LINE__) Star(sys_name, sys_loc, star_class);
+ Star* star = new Star(sys_name, sys_loc, star_class);
stars.append(star);
}
}
@@ -227,7 +226,7 @@ Galaxy::Load(const char* filename)
}
if (star_name[0]) {
- Star* star = new(__FILE__,__LINE__) Star(star_name, star_loc, star_class);
+ Star* star = new Star(star_name, star_loc, star_class);
stars.append(star);
}
}
diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp
index 5c93e6f..bd6484e 100644
--- a/Stars45/Game.cpp
+++ b/Stars45/Game.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "Game.h"
#include "Mouse.h"
#include "Universe.h"
@@ -50,7 +49,7 @@ Game::Game()
max_frame_length = MAX_FRAME_TIME_NORMAL;
- video_settings = new(__FILE__,__LINE__) VideoSettings;
+ video_settings = new VideoSettings;
}
else
status = TOO_MANY;
diff --git a/Stars45/GameScreen.cpp b/Stars45/GameScreen.cpp
index 353db2d..87ce925 100644
--- a/Stars45/GameScreen.cpp
+++ b/Stars45/GameScreen.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "GameScreen.h"
#include "Sim.h"
@@ -71,7 +70,7 @@ viddlg(0), moddlg(0), modInfoDlg(0),
flare1(0), flare2(0), flare3(0), flare4(0),
optdlg(0), cam_dir(0), sim(0)
{
- cam_dir = new(__FILE__,__LINE__) CameraDirector;
+ cam_dir = new CameraDirector;
sim = Sim::GetSim();
loader = DataLoader::GetLoader();
@@ -109,40 +108,40 @@ GameScreen::Setup(Screen* s)
loader->UseFileSystem(true);
// create windows
- gamewin = new(__FILE__,__LINE__) Window(screen, 0, 0, screen->Width(), screen->Height());
+ gamewin = new Window(screen, 0, 0, screen->Width(), screen->Height());
// attach views to windows (back to front)
// fade in:
- gamewin->AddView(new(__FILE__,__LINE__) FadeView(gamewin, 1, 0, 0));
+ gamewin->AddView(new FadeView(gamewin, 1, 0, 0));
// camera:
cam_dir = CameraDirector::GetInstance();
- cam_view = new(__FILE__,__LINE__) CameraView(gamewin, cam_dir->GetCamera(), 0);
+ cam_view = new CameraView(gamewin, cam_dir->GetCamera(), 0);
if (cam_view)
gamewin->AddView(cam_view);
// HUD:
- hud_view = new(__FILE__,__LINE__) HUDView(gamewin);
+ hud_view = new HUDView(gamewin);
gamewin->AddView(hud_view);
- wep_view = new(__FILE__,__LINE__) WepView(gamewin);
+ wep_view = new WepView(gamewin);
gamewin->AddView(wep_view);
- quantum_view = new(__FILE__,__LINE__) QuantumView(gamewin);
+ quantum_view = new QuantumView(gamewin);
gamewin->AddView(quantum_view);
- radio_view = new(__FILE__,__LINE__) RadioView(gamewin);
+ radio_view = new RadioView(gamewin);
gamewin->AddView(radio_view);
- tac_view = new(__FILE__,__LINE__) TacticalView(gamewin, this);
+ tac_view = new TacticalView(gamewin, this);
gamewin->AddView(tac_view);
disp_view = DisplayView::GetInstance();
// note: quit view must be last in chain
// so it can release window surface
- quit_view = new(__FILE__,__LINE__) QuitView(gamewin);
+ quit_view = new QuitView(gamewin);
gamewin->AddView(quit_view);
Starshatter* stars = Starshatter::GetInstance();
@@ -163,47 +162,47 @@ GameScreen::Setup(Screen* s)
FormDef aud_def("AudDlg", 0);
aud_def.Load("AudDlg");
- auddlg = new(__FILE__,__LINE__) AudDlg(screen, aud_def, this);
+ auddlg = new AudDlg(screen, aud_def, this);
FormDef ctl_def("CtlDlg", 0);
ctl_def.Load("CtlDlg");
- ctldlg = new(__FILE__,__LINE__) CtlDlg(screen, ctl_def, this);
+ ctldlg = new CtlDlg(screen, ctl_def, this);
FormDef opt_def("OptDlg", 0);
opt_def.Load("OptDlg");
- optdlg = new(__FILE__,__LINE__) OptDlg(screen, opt_def, this);
+ optdlg = new OptDlg(screen, opt_def, this);
FormDef vid_def("VidDlg", 0);
vid_def.Load("VidDlg");
- viddlg = new(__FILE__,__LINE__) VidDlg(screen, vid_def, this);
+ viddlg = new VidDlg(screen, vid_def, this);
FormDef mod_def("ModDlg", 0);
mod_def.Load("ModDlg");
- moddlg = new(__FILE__,__LINE__) ModDlg(screen, mod_def, this);
+ moddlg = new ModDlg(screen, mod_def, this);
FormDef joy_def("JoyDlg", 0);
joy_def.Load("JoyDlg");
- joydlg = new(__FILE__,__LINE__) JoyDlg(screen, joy_def, this);
+ joydlg = new JoyDlg(screen, joy_def, this);
FormDef key_def("KeyDlg", 0);
key_def.Load("KeyDlg");
- keydlg = new(__FILE__,__LINE__) KeyDlg(screen, key_def, this);
+ keydlg = new KeyDlg(screen, key_def, this);
FormDef mod_info_def("ModInfoDlg", 0);
mod_info_def.Load("ModInfoDlg");
- modInfoDlg = new(__FILE__,__LINE__) ModInfoDlg(screen, mod_info_def, this);
+ modInfoDlg = new ModInfoDlg(screen, mod_info_def, this);
FormDef nav_def("NavDlg", 0);
nav_def.Load("NavDlg");
- navdlg = new(__FILE__,__LINE__) NavDlg(screen, nav_def, this);
+ navdlg = new NavDlg(screen, nav_def, this);
FormDef eng_def("EngDlg", 0);
eng_def.Load("EngDlg");
- engdlg = new(__FILE__,__LINE__) EngDlg(screen, eng_def, this);
+ engdlg = new EngDlg(screen, eng_def, this);
FormDef flt_def("FltDlg", 0);
flt_def.Load("FltDlg");
- fltdlg = new(__FILE__,__LINE__) FltDlg(screen, flt_def, this);
+ fltdlg = new FltDlg(screen, flt_def, this);
if (engdlg) engdlg->Hide();
if (fltdlg) fltdlg->Hide();
diff --git a/Stars45/GameWinDX9.cpp b/Stars45/GameWinDX9.cpp
index 2189712..5414027 100644
--- a/Stars45/GameWinDX9.cpp
+++ b/Stars45/GameWinDX9.cpp
@@ -14,7 +14,6 @@
#include "DataLoader.h"
#include "Game.h"
#include "MachineInfo.h"
-#include "MemDebug.h"
#include "Panic.h"
#include "Screen.h"
#include "Types.h"
@@ -242,7 +241,7 @@ GameWinDX9::InitGame()
}
Print(" Created video object.\n");
Color::UseVideo(video);
- screen = new(__FILE__, __LINE__) Screen(video);
+ screen = new Screen(video);
if (!screen) {
Panic::Panic("Could not create the Screen object.");
return false;
@@ -262,7 +261,7 @@ GameWinDX9::InitVideo()
if (server) return true;
// create a video factory, and video object:
- video_factory = new(__FILE__,__LINE__) VideoFactory(hwnd);
+ video_factory = new VideoFactory(hwnd);
if (video_factory) {
Print(" Init Video...\n");
@@ -323,7 +322,7 @@ GameWinDX9::ResetVideo()
Color::UseVideo(video);
- screen = new(__FILE__,__LINE__) Screen(video);
+ screen = new Screen(video);
if (!screen) {
Panic::Panic("Could not re-create Screen object.");
return false;
diff --git a/Stars45/Geometry.cpp b/Stars45/Geometry.cpp
index ecd38b9..60b5c4d 100644
--- a/Stars45/Geometry.cpp
+++ b/Stars45/Geometry.cpp
@@ -11,7 +11,6 @@
Geometric Utilities
*/
-#include "MemDebug.h"
#include "Geometry.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/Graphic.cpp b/Stars45/Graphic.cpp
index 978d538..ff8115b 100644
--- a/Stars45/Graphic.cpp
+++ b/Stars45/Graphic.cpp
@@ -11,7 +11,6 @@
Abstract 3D Graphic Object
*/
-#include "MemDebug.h"
#include "Graphic.h"
#include "Scene.h"
#include "Projector.h"
diff --git a/Stars45/Grid.cpp b/Stars45/Grid.cpp
index 4461802..f65b483 100644
--- a/Stars45/Grid.cpp
+++ b/Stars45/Grid.cpp
@@ -11,7 +11,6 @@
Tactical Grid class
*/
-#include "MemDebug.h"
#include "Grid.h"
#include "Game.h"
diff --git a/Stars45/GroundAI.cpp b/Stars45/GroundAI.cpp
index 805d375..4435742 100644
--- a/Stars45/GroundAI.cpp
+++ b/Stars45/GroundAI.cpp
@@ -11,7 +11,6 @@
Low-Level Artificial Intelligence class for Ground Units
*/
-#include "MemDebug.h"
#include "GroundAI.h"
#include "SteerAI.h"
#include "System.h"
@@ -57,7 +56,7 @@ GroundAI::GroundAI(SimObject* s)
}
if (ship && ship->GetHangar() && ship->GetCommandAILevel() > 0)
- carrier_ai = new(__FILE__,__LINE__) CarrierAI(ship, ai_level);
+ carrier_ai = new CarrierAI(ship, ai_level);
}
diff --git a/Stars45/HUDSounds.cpp b/Stars45/HUDSounds.cpp
index a387d46..3dcab0b 100644
--- a/Stars45/HUDSounds.cpp
+++ b/Stars45/HUDSounds.cpp
@@ -11,7 +11,6 @@
HUDSounds singleton class utility implementation
*/
-#include "MemDebug.h"
#include "HUDSounds.h"
#include "AudioConfig.h"
diff --git a/Stars45/HUDView.cpp b/Stars45/HUDView.cpp
index 6846b09..c280333 100644
--- a/Stars45/HUDView.cpp
+++ b/Stars45/HUDView.cpp
@@ -11,7 +11,6 @@
View class for Heads Up Display
*/
-#include "MemDebug.h"
#include "HUDView.h"
#include "HUDSounds.h"
#include "Ship.h"
@@ -426,23 +425,23 @@ show_warn(false), show_inst(false), inst_page(0)
pitch_ladder_pos.SetType(Bitmap::BMP_TRANSLUCENT);
pitch_ladder_neg.SetType(Bitmap::BMP_TRANSLUCENT);
- hud_left_sprite = new(__FILE__,__LINE__) Sprite(&hud_left_fighter);
- hud_right_sprite = new(__FILE__,__LINE__) Sprite(&hud_right_fighter);
- instr_left_sprite = new(__FILE__,__LINE__) Sprite(&instr_left);
- instr_right_sprite = new(__FILE__,__LINE__) Sprite(&instr_right);
- warn_left_sprite = new(__FILE__,__LINE__) Sprite(&warn_left);
- warn_right_sprite = new(__FILE__,__LINE__) Sprite(&warn_right);
- icon_ship_sprite = new(__FILE__,__LINE__) Sprite(&icon_ship);
- icon_target_sprite = new(__FILE__,__LINE__) Sprite(&icon_target);
- fpm_sprite = new(__FILE__,__LINE__) Sprite(&fpm);
- hpm_sprite = new(__FILE__,__LINE__) Sprite(&hpm);
- lead_sprite = new(__FILE__,__LINE__) Sprite(&lead);
- aim_sprite = new(__FILE__,__LINE__) Sprite(&cross);
- tgt1_sprite = new(__FILE__,__LINE__) Sprite(&cross1);
- tgt2_sprite = new(__FILE__,__LINE__) Sprite(&cross2);
- tgt3_sprite = new(__FILE__,__LINE__) Sprite(&cross3);
- tgt4_sprite = new(__FILE__,__LINE__) Sprite(&cross4);
- chase_sprite = new(__FILE__,__LINE__) Sprite(&chase_left);
+ hud_left_sprite = new Sprite(&hud_left_fighter);
+ hud_right_sprite = new Sprite(&hud_right_fighter);
+ instr_left_sprite = new Sprite(&instr_left);
+ instr_right_sprite = new Sprite(&instr_right);
+ warn_left_sprite = new Sprite(&warn_left);
+ warn_right_sprite = new Sprite(&warn_right);
+ icon_ship_sprite = new Sprite(&icon_ship);
+ icon_target_sprite = new Sprite(&icon_target);
+ fpm_sprite = new Sprite(&fpm);
+ hpm_sprite = new Sprite(&hpm);
+ lead_sprite = new Sprite(&lead);
+ aim_sprite = new Sprite(&cross);
+ tgt1_sprite = new Sprite(&cross1);
+ tgt2_sprite = new Sprite(&cross2);
+ tgt3_sprite = new Sprite(&cross3);
+ tgt4_sprite = new Sprite(&cross4);
+ chase_sprite = new Sprite(&chase_left);
ZeroMemory(hud_sprite, sizeof(hud_sprite));
@@ -468,7 +467,7 @@ show_warn(false), show_inst(false), inst_page(0)
double UV[8];
for (i = 0; i < 15; i++) {
- pitch_ladder[i] = new(__FILE__,__LINE__) Sprite(&pitch_ladder_pos);
+ pitch_ladder[i] = new Sprite(&pitch_ladder_pos);
CopyMemory(UV, pitch_ladder_UV, sizeof(UV));
UV[1] = UV[3] = (pitch_ladder_UV[1] * (i ));
@@ -482,7 +481,7 @@ show_warn(false), show_inst(false), inst_page(0)
// zero mark at i=15
{
- pitch_ladder[i] = new(__FILE__,__LINE__) Sprite(&pitch_ladder_pos);
+ pitch_ladder[i] = new Sprite(&pitch_ladder_pos);
UV[0] = UV[6] = 0;
UV[2] = UV[4] = 1;
@@ -496,7 +495,7 @@ show_warn(false), show_inst(false), inst_page(0)
}
for (i = 16; i < 31; i++) {
- pitch_ladder[i] = new(__FILE__,__LINE__) Sprite(&pitch_ladder_neg);
+ pitch_ladder[i] = new Sprite(&pitch_ladder_neg);
CopyMemory(UV, pitch_ladder_UV, sizeof(UV));
UV[1] = UV[3] = (pitch_ladder_UV[1] * (30 - i ));
@@ -509,7 +508,7 @@ show_warn(false), show_inst(false), inst_page(0)
}
for (i = 0; i < 3; i++)
- mfd[i] = new(__FILE__,__LINE__) MFD(window, i);
+ mfd[i] = new MFD(window, i);
mfd[0]->SetRect(Rect( 8, height - 136, 128, 128));
mfd[1]->SetRect(Rect(width - 136, height - 136, 128, 128));
@@ -604,10 +603,10 @@ show_warn(false), show_inst(false), inst_page(0)
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("HUD/");
- az_ring = new(__FILE__,__LINE__) Solid;
- az_pointer = new(__FILE__,__LINE__) Solid;
- el_ring = new(__FILE__,__LINE__) Solid;
- el_pointer = new(__FILE__,__LINE__) Solid;
+ az_ring = new Solid;
+ az_pointer = new Solid;
+ el_ring = new Solid;
+ el_pointer = new Solid;
az_ring->Load("CompassRing.mag", compass_scale);
az_pointer->Load("CompassPointer.mag", compass_scale);
@@ -4155,7 +4154,7 @@ HUDView::PrepareBitmap(const char* name, Bitmap& img, BYTE*& shades)
int w = img.Width();
int h = img.Height();
- shades = new(__FILE__,__LINE__) BYTE[w*h];
+ shades = new BYTE[w*h];
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++)
@@ -4177,7 +4176,7 @@ HUDView::TransferBitmap(const Bitmap& src, Bitmap& img, BYTE*& shades)
int w = img.Width();
int h = img.Height();
- shades = new(__FILE__,__LINE__) BYTE[w*h];
+ shades = new BYTE[w*h];
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++)
diff --git a/Stars45/Hangar.cpp b/Stars45/Hangar.cpp
index 7aafada..7e7f7d8 100644
--- a/Stars45/Hangar.cpp
+++ b/Stars45/Hangar.cpp
@@ -13,7 +13,6 @@
See Also: FlightDeck
*/
-#include "MemDebug.h"
#include "Hangar.h"
#include "FlightDeck.h"
#include "Ship.h"
@@ -296,7 +295,7 @@ const ShipDesign* design, int count, int iff,
int* def_load, int maint_count, int dead_count)
{
if (nsquadrons < MAX_SQUADRONS && count > 0) {
- HangarSlot* s = new(__FILE__,__LINE__) HangarSlot[count];
+ HangarSlot* s = new HangarSlot[count];
for (int i = 0; i < count; i++) {
s[i].squadron = squadron;
diff --git a/Stars45/HardPoint.cpp b/Stars45/HardPoint.cpp
index 8b39518..2fa15f0 100644
--- a/Stars45/HardPoint.cpp
+++ b/Stars45/HardPoint.cpp
@@ -11,7 +11,6 @@
HardPoint class
*/
-#include "MemDebug.h"
#include "HardPoint.h"
#include "Weapon.h"
#include "WeaponDesign.h"
@@ -77,7 +76,7 @@ HardPoint::CreateWeapon(int type_index)
if (designs[type_index]->turret.length() == 0)
muzzle_pt = &muzzle;
- Weapon* missile = new(__FILE__,__LINE__) Weapon(designs[type_index],
+ Weapon* missile = new Weapon(designs[type_index],
1,
muzzle_pt,
aim_azimuth,
diff --git a/Stars45/Hoop.cpp b/Stars45/Hoop.cpp
index 8d40f01..cfd2a65 100644
--- a/Stars45/Hoop.cpp
+++ b/Stars45/Hoop.cpp
@@ -11,7 +11,6 @@
ILS Hoop (HUD display) class
*/
-#include "MemDebug.h"
#include "Hoop.h"
#include "Game.h"
@@ -53,7 +52,7 @@ void Hoop::SetColor(Color c)
void
Hoop::CreatePolys()
{
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
mtl->tex_diffuse = hoop_texture;
mtl->blend = Material::MTL_ADDITIVE;
@@ -61,10 +60,10 @@ Hoop::CreatePolys()
int w = width /2;
int h = height/2;
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
own_model = 1;
- Surface* surface = new(__FILE__,__LINE__) Surface;
+ Surface* surface = new Surface;
surface->SetName("hoop");
surface->CreateVerts(4);
@@ -118,7 +117,7 @@ Hoop::CreatePolys()
}
// then assign them to cohesive segments:
- Segment* segment = new(__FILE__,__LINE__) Segment;
+ Segment* segment = new Segment;
segment->npolys = 2;
segment->polys = &polys[0];
segment->material = segment->polys->material;
diff --git a/Stars45/ImageBox.cpp b/Stars45/ImageBox.cpp
index fcd4397..0821ee1 100644
--- a/Stars45/ImageBox.cpp
+++ b/Stars45/ImageBox.cpp
@@ -11,7 +11,6 @@
ImageBox class
*/
-#include "MemDebug.h"
#include "ImageBox.h"
#include "Video.h"
#include "Bitmap.h"
diff --git a/Stars45/ImgView.cpp b/Stars45/ImgView.cpp
index e127c21..e2c8bba 100644
--- a/Stars45/ImgView.cpp
+++ b/Stars45/ImgView.cpp
@@ -11,7 +11,6 @@
Bitmap "billboard" Image View class
*/
-#include "MemDebug.h"
#include "ImgView.h"
#include "Color.h"
#include "Window.h"
diff --git a/Stars45/Instruction.cpp b/Stars45/Instruction.cpp
index 5b17203..18ef168 100644
--- a/Stars45/Instruction.cpp
+++ b/Stars45/Instruction.cpp
@@ -11,7 +11,6 @@
Navigation Point class implementation
*/
-#include "MemDebug.h"
#include "Instruction.h"
#include "Element.h"
#include "RadioMessage.h"
diff --git a/Stars45/Intel.cpp b/Stars45/Intel.cpp
index 1ca5364..51b1806 100644
--- a/Stars45/Intel.cpp
+++ b/Stars45/Intel.cpp
@@ -11,7 +11,6 @@
An element in the dynamic campaign
*/
-#include "MemDebug.h"
#include "Intel.h"
#include "Game.h"
diff --git a/Stars45/JoyDlg.cpp b/Stars45/JoyDlg.cpp
index bf6de68..b0ac318 100644
--- a/Stars45/JoyDlg.cpp
+++ b/Stars45/JoyDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "JoyDlg.h"
#include "KeyMap.h"
#include "MenuScreen.h"
diff --git a/Stars45/Joystick.cpp b/Stars45/Joystick.cpp
index 916068e..48ec842 100644
--- a/Stars45/Joystick.cpp
+++ b/Stars45/Joystick.cpp
@@ -11,10 +11,10 @@
Joystick Input class
*/
-#include "MemDebug.h"
+#include "Game.h"
#include "Joystick.h"
#include "MachineInfo.h"
-#include "Game.h"
+#include "Types.h"
#define DIRECTINPUT_VERSION 0x0800
diff --git a/Stars45/Joystick.h b/Stars45/Joystick.h
index 7928029..5e645c8 100644
--- a/Stars45/Joystick.h
+++ b/Stars45/Joystick.h
@@ -15,6 +15,7 @@
#define Joystick_h
#include "MotionController.h"
+#include "Types.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/KeyDlg.cpp b/Stars45/KeyDlg.cpp
index 7603351..cbd7c68 100644
--- a/Stars45/KeyDlg.cpp
+++ b/Stars45/KeyDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "KeyDlg.h"
#include "KeyMap.h"
#include "MenuScreen.h"
diff --git a/Stars45/KeyMap.cpp b/Stars45/KeyMap.cpp
index 6cbdea3..6c5e2ab 100644
--- a/Stars45/KeyMap.cpp
+++ b/Stars45/KeyMap.cpp
@@ -11,7 +11,6 @@
Weapon class
*/
-#include "MemDebug.h"
#include "Keyboard.h"
#include "KeyMap.h"
#include "Game.h"
diff --git a/Stars45/Keyboard.cpp b/Stars45/Keyboard.cpp
index 0efdc70..63b93e9 100644
--- a/Stars45/Keyboard.cpp
+++ b/Stars45/Keyboard.cpp
@@ -11,7 +11,6 @@
Keyboard Input class
*/
-#include "MemDebug.h"
#include "Keyboard.h"
#include "Game.h"
diff --git a/Stars45/LandingGear.cpp b/Stars45/LandingGear.cpp
index 086b4af..f5fa00b 100644
--- a/Stars45/LandingGear.cpp
+++ b/Stars45/LandingGear.cpp
@@ -11,7 +11,6 @@
LandingGear System class
*/
-#include "MemDebug.h"
#include "LandingGear.h"
#include "Ship.h"
#include "Sim.h"
@@ -52,7 +51,7 @@ LandingGear::LandingGear(const LandingGear& g)
for (i = 0; i < ngear; i++) {
models[i] = 0;
- gear[i] = new(__FILE__,__LINE__) Solid;
+ gear[i] = new Solid;
start[i] = g.start[i];
end[i] = g.end[i];
diff --git a/Stars45/Layout.cpp b/Stars45/Layout.cpp
index d22d37d..5637831 100644
--- a/Stars45/Layout.cpp
+++ b/Stars45/Layout.cpp
@@ -11,7 +11,6 @@
Layout Resource class implementation
*/
-#include "MemDebug.h"
#include "Layout.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/Light.cpp b/Stars45/Light.cpp
index 7206b7c..c0c3a26 100644
--- a/Stars45/Light.cpp
+++ b/Stars45/Light.cpp
@@ -11,7 +11,6 @@
Dynamic Light Source
*/
-#include "MemDebug.h"
#include "Light.h"
#include "Scene.h"
diff --git a/Stars45/ListBox.cpp b/Stars45/ListBox.cpp
index 1434b45..8b4eeeb 100644
--- a/Stars45/ListBox.cpp
+++ b/Stars45/ListBox.cpp
@@ -11,7 +11,6 @@
ListBox ActiveWindow class
*/
-#include "MemDebug.h"
#include "ListBox.h"
#include "Button.h"
#include "Bitmap.h"
@@ -559,7 +558,7 @@ void ListBox::SetItemText(int index, int column, const char* text)
column--;
if (column >= 0 && column < columns.size()-1) {
while (column >= item->subitems.size()) {
- ListBoxCell* cell = new(__FILE__,__LINE__) ListBoxCell;
+ ListBoxCell* cell = new ListBoxCell;
if (cell)
item->subitems.append(cell);
}
@@ -599,7 +598,7 @@ void ListBox::SetItemData(int index, int column, DWORD data)
column--;
if (column >= 0 && column < columns.size()-1) {
while (column >= item->subitems.size()) {
- ListBoxCell* cell = new(__FILE__,__LINE__) ListBoxCell;
+ ListBoxCell* cell = new ListBoxCell;
if (cell)
item->subitems.append(cell);
}
@@ -639,7 +638,7 @@ void ListBox::SetItemImage(int index, int column, Bitmap* img)
column--;
if (column >= 0 && column < columns.size()-1) {
while (column >= item->subitems.size()) {
- ListBoxCell* cell = new(__FILE__,__LINE__) ListBoxCell;
+ ListBoxCell* cell = new ListBoxCell;
if (cell)
item->subitems.append(cell);
}
@@ -651,7 +650,7 @@ void ListBox::SetItemImage(int index, int column, Bitmap* img)
int ListBox::AddItem(const char* text)
{
- ListBoxItem* item = new(__FILE__,__LINE__) ListBoxItem;
+ ListBoxItem* item = new ListBoxItem;
if (item) {
item->text = text;
@@ -669,7 +668,7 @@ int ListBox::AddItem(const char* text)
int ListBox::AddItemWithData(const char* text, int data)
{
- ListBoxItem* item = new(__FILE__,__LINE__) ListBoxItem;
+ ListBoxItem* item = new ListBoxItem;
if (item) {
item->text = text;
@@ -688,7 +687,7 @@ int ListBox::AddItemWithData(const char* text, int data)
int ListBox::AddImage(Bitmap* img)
{
- ListBoxItem* item = new(__FILE__,__LINE__) ListBoxItem;
+ ListBoxItem* item = new ListBoxItem;
if (item) {
item->image = img;
@@ -707,7 +706,7 @@ int ListBox::AddImage(Bitmap* img)
void ListBox::InsertItem(int index, const char* text)
{
if (index >=0 && index < items.size()) {
- ListBoxItem* item = new(__FILE__,__LINE__) ListBoxItem;
+ ListBoxItem* item = new ListBoxItem;
if (item) {
item->text = text;
@@ -724,7 +723,7 @@ void ListBox::InsertItem(int index, const char* text)
void ListBox::InsertItemWithData(int index, const char* text, int data)
{
if (index >=0 && index < items.size()) {
- ListBoxItem* item = new(__FILE__,__LINE__) ListBoxItem;
+ ListBoxItem* item = new ListBoxItem;
if (item) {
item->text = text;
@@ -775,7 +774,7 @@ void ListBox::RemoveSelectedItems()
void ListBox::AddColumn(const char* title, int width, int align, int sort)
{
- ListBoxColumn* column = new(__FILE__,__LINE__) ListBoxColumn;
+ ListBoxColumn* column = new ListBoxColumn;
if (column) {
column->title = title;
diff --git a/Stars45/LoadDlg.cpp b/Stars45/LoadDlg.cpp
index 1d98e0d..1138fec 100644
--- a/Stars45/LoadDlg.cpp
+++ b/Stars45/LoadDlg.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "LoadDlg.h"
#include "Starshatter.h"
diff --git a/Stars45/LoadScreen.cpp b/Stars45/LoadScreen.cpp
index 2741178..60972e2 100644
--- a/Stars45/LoadScreen.cpp
+++ b/Stars45/LoadScreen.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "LoadScreen.h"
#include "LoadDlg.h"
#include "CmpLoadDlg.h"
@@ -53,11 +52,11 @@ LoadScreen::Setup(Screen* s)
// create windows
FormDef load_def("LoadDlg", 0);
load_def.Load("LoadDlg");
- load_dlg = new(__FILE__,__LINE__) LoadDlg(screen, load_def);
+ load_dlg = new LoadDlg(screen, load_def);
FormDef cmp_load_def("CmpLoadDlg", 0);
cmp_load_def.Load("CmpLoadDlg");
- cmp_load_dlg = new(__FILE__,__LINE__) CmpLoadDlg(screen, cmp_load_def);
+ cmp_load_dlg = new CmpLoadDlg(screen, cmp_load_def);
loader->UseFileSystem(Starshatter::UseFileSystem());
ShowLoadDlg();
diff --git a/Stars45/Locale_ss.cpp b/Stars45/Locale_ss.cpp
index 334434a..427753c 100644
--- a/Stars45/Locale_ss.cpp
+++ b/Stars45/Locale_ss.cpp
@@ -11,7 +11,6 @@
3D Locale (Polygon) Object
*/
-#include "MemDebug.h"
#include "Locale_ss.h"
#include "Utils.h"
@@ -147,11 +146,11 @@ Locale::CreateLocale(const char* l, const char* c, const char* v)
if (l[0]) {
if (c[0]) {
if (v[0]) {
- return new(__FILE__,__LINE__) Locale(l, c, v);
+ return new Locale(l, c, v);
}
- return new(__FILE__,__LINE__) Locale(l, c);
+ return new Locale(l, c);
}
- return new(__FILE__,__LINE__) Locale(l);
+ return new Locale(l);
}
return 0;
diff --git a/Stars45/MCIWave.cpp b/Stars45/MCIWave.cpp
index cf92c2f..4840eb6 100644
--- a/Stars45/MCIWave.cpp
+++ b/Stars45/MCIWave.cpp
@@ -11,7 +11,6 @@
MCI Wave Output stuff
*/
-#include "MemDebug.h"
#include "Types.h"
#include "Game.h"
#include "Utils.h"
@@ -124,7 +123,7 @@ int load_wave_file(const char* fname, LPWAVEHDR hdr, LPWAVEFORMATEX format)
}
// allocate the data block:
- hdr->lpData = (LPSTR) new(__FILE__,__LINE__) BYTE[dwDataSize];
+ hdr->lpData = (LPSTR) new BYTE[dwDataSize];
hdr->dwBufferLength = dwDataSize;
/* Read the waveform data subchunk. */
diff --git a/Stars45/MachineInfo.cpp b/Stars45/MachineInfo.cpp
index 85d2bd6..64552ba 100644
--- a/Stars45/MachineInfo.cpp
+++ b/Stars45/MachineInfo.cpp
@@ -13,7 +13,6 @@
#include <chrono>
-#include "MemDebug.h"
#include "MachineInfo.h"
#include "Utils.h"
@@ -762,7 +761,7 @@ static void DescribeDriverVersion(const char* file)
return;
}
- LPBYTE pBlock = new(__FILE__,__LINE__) BYTE[nBytes];
+ LPBYTE pBlock = new BYTE[nBytes];
if (pBlock && GetFileVersionInfo(szFile, dwHandle, nBytes, (LPVOID) pBlock)) {
GetTranslation(pBlock);
@@ -799,7 +798,7 @@ static void DescribeDXVersion(const char* component)
return;
}
- LPBYTE pBlock = new(__FILE__,__LINE__) BYTE[nBytes];
+ LPBYTE pBlock = new BYTE[nBytes];
if (pBlock && GetFileVersionInfo(szFile, dwHandle, nBytes, (LPVOID) pBlock)) {
GetTranslation(pBlock);
diff --git a/Stars45/Main.cpp b/Stars45/Main.cpp
index dbb3a45..a71476d 100644
--- a/Stars45/Main.cpp
+++ b/Stars45/Main.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "Starshatter.h"
#include "StarServer.h"
#include "HUDView.h"
@@ -45,8 +44,6 @@ static void PrintLogHeader()
Print("+====================================================================+\n");
Print("| STARSHATTER %-25s%29s |\n", versionInfo, sTime.data());
- Memory::SetLevel(Memory::MAXIMAL);
- Memory::OpenLog();
MachineInfo::DescribeMachine();
}
@@ -105,7 +102,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
NetLayer net;
if (do_server) {
- StarServer* server = new(__FILE__,__LINE__) StarServer();
+ StarServer* server = new StarServer();
if (server->Init(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
result = server->Run();
@@ -119,7 +116,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
else {
Starshatter* stars = 0;
- stars = new(__FILE__,__LINE__) Starshatter;
+ stars = new Starshatter;
stars->SetTestMode(test_mode);
if (stars->Init(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
@@ -142,10 +139,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
}
/* } */
- Memory::Stats();
- Memory::DumpLeaks();
- Memory::CloseLog();
-
Print("+====================================================================+\n");
Print(" END OF LINE.\n");
diff --git a/Stars45/MapView.cpp b/Stars45/MapView.cpp
index 486785b..dc992d1 100644
--- a/Stars45/MapView.cpp
+++ b/Stars45/MapView.cpp
@@ -11,7 +11,6 @@
Star Map class
*/
-#include "MemDebug.h"
#include "MapView.h"
#include "Galaxy.h"
@@ -86,7 +85,7 @@ MapView::MapView(Window* win)
view_offset_y[i] = offset_y;
}
- menu_view = new(__FILE__,__LINE__) MenuView(window);
+ menu_view = new MenuView(window);
title_font = FontMgr::Find("Limerick12");
font = FontMgr::Find("Verdana");
@@ -281,7 +280,7 @@ MapView::BuildMenu()
{
ClearMenu();
- map_system_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.STARSYSTEM"));
+ map_system_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.STARSYSTEM"));
if (system_list.size() > 0) {
int i = 0;
@@ -297,18 +296,18 @@ MapView::BuildMenu()
map_system_menu->AddItem(system->Name(), MAP_SYSTEM);
}
- map_sector_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SECTOR"));
+ map_sector_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SECTOR"));
for (int i = 0; i < regions.size(); i++) {
Orbital* rgn = regions[i];
map_sector_menu->AddItem(rgn->Name(), MAP_SECTOR + i);
}
- map_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.MAP"));
+ map_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.MAP"));
map_menu->AddMenu("System", map_system_menu);
map_menu->AddMenu("Sector", map_sector_menu);
if (ship || mission) {
- ship_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SHIP"));
+ ship_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SHIP"));
ship_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Starsystem"), map_system_menu);
ship_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Sector"), map_sector_menu);
@@ -316,36 +315,36 @@ MapView::BuildMenu()
ship_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV);
ship_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Clear-All"), MAP_CLEAR);
- action_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.ACTION"));
+ action_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.ACTION"));
for (int i = 0; i < Instruction::NUM_ACTIONS; i++) {
action_menu->AddItem(ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(i)), MAP_ACTION + i);
}
- formation_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.FORMATION"));
+ formation_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.FORMATION"));
for (int i = 0; i < Instruction::NUM_FORMATIONS; i++) {
formation_menu->AddItem(ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(i)), MAP_FORMATION + i);
}
- speed_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SPEED"));
+ speed_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SPEED"));
speed_menu->AddItem("250", MAP_SPEED + 0);
speed_menu->AddItem("500", MAP_SPEED + 1);
speed_menu->AddItem("750", MAP_SPEED + 2);
speed_menu->AddItem("1000", MAP_SPEED + 3);
- hold_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.HOLD"));
+ hold_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.HOLD"));
hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.None"), MAP_HOLD + 0);
hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.1-Minute"), MAP_HOLD + 1);
hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.5-Minutes"), MAP_HOLD + 2);
hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.10-Minutes"), MAP_HOLD + 3);
hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.15-Minutes"), MAP_HOLD + 4);
- farcast_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.FARCAST"));
+ farcast_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.FARCAST"));
farcast_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Use-Quantum"), MAP_FARCAST + 0);
farcast_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Use-Farcast"), MAP_FARCAST + 1);
- objective_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.OBJECTIVE"));
+ objective_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.OBJECTIVE"));
- nav_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.NAVPT"));
+ nav_menu = new Menu(ContentBundle::GetInstance()->GetText("MapView.menu.NAVPT"));
nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Action"), action_menu);
nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Objective"), objective_menu);
nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Formation"), formation_menu);
@@ -489,10 +488,10 @@ MapView::ProcessMenuItem(int action)
if (rgn->IsAirSpace())
init_pt.z = 10e3;
- n = new(__FILE__,__LINE__) Instruction(rgn, init_pt);
+ n = new Instruction(rgn, init_pt);
}
else {
- n = new(__FILE__,__LINE__) Instruction(rgn_name, init_pt);
+ n = new Instruction(rgn_name, init_pt);
}
n->SetSpeed(500);
@@ -513,7 +512,7 @@ MapView::ProcessMenuItem(int action)
if (regions[current_region]->Type() == Orbital::TERRAIN)
init_pt.z = 10e3;
- n = new(__FILE__,__LINE__) Instruction(rgn_name, init_pt);
+ n = new Instruction(rgn_name, init_pt);
n->SetSpeed(500);
if (prior) {
@@ -794,7 +793,7 @@ List<Text>& result)
if (!editor && !friendly && (elem->GetIFF() == 0 || elem->GetIFF() == mission->Team()))
continue;
- result.append(new(__FILE__,__LINE__) Text(elem->Name()));
+ result.append(new Text(elem->Name()));
}
}
@@ -818,7 +817,7 @@ List<Text>& result)
if (!friendly && (s->GetIFF() == 0 || s->GetIFF() == ship->GetIFF()))
continue;
- result.append(new(__FILE__,__LINE__) Text(s->Name()));
+ result.append(new Text(s->Name()));
}
}
}
diff --git a/Stars45/Menu.cpp b/Stars45/Menu.cpp
index e6edbd9..35f5715 100644
--- a/Stars45/Menu.cpp
+++ b/Stars45/Menu.cpp
@@ -11,7 +11,6 @@
Simple menu hierarchy class
*/
-#include "MemDebug.h"
#include "Menu.h"
// +--------------------------------------------------------------------+
@@ -19,7 +18,7 @@
void
Menu::AddItem(Text label, DWORD value, bool enabled)
{
- MenuItem* item = new(__FILE__,__LINE__) MenuItem(label, value, enabled);
+ MenuItem* item = new MenuItem(label, value, enabled);
if (item) {
item->menu = this;
@@ -39,7 +38,7 @@ Menu::AddItem(MenuItem* item)
void
Menu::AddMenu(Text label, Menu* menu, DWORD value)
{
- MenuItem* item = new(__FILE__,__LINE__) MenuItem(label, value);
+ MenuItem* item = new MenuItem(label, value);
if (item) {
item->menu = this;
diff --git a/Stars45/MenuDlg.cpp b/Stars45/MenuDlg.cpp
index 04b1cb0..36dce15 100644
--- a/Stars45/MenuDlg.cpp
+++ b/Stars45/MenuDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MenuDlg.h"
#include "MenuScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/MenuScreen.cpp b/Stars45/MenuScreen.cpp
index 6b8e89a..f45d2c5 100644
--- a/Stars45/MenuScreen.cpp
+++ b/Stars45/MenuScreen.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "MenuScreen.h"
#include "FormDef.h"
@@ -100,118 +99,118 @@ MenuScreen::Setup(Screen* s)
FormDef menu_def("MenuDlg", 0);
menu_def.Load("MenuDlg");
- menudlg = new(__FILE__,__LINE__) MenuDlg(screen, menu_def, this);
+ menudlg = new MenuDlg(screen, menu_def, this);
FormDef exit_def("ExitDlg", 0);
exit_def.Load("ExitDlg");
- exitdlg = new(__FILE__,__LINE__) ExitDlg(screen, exit_def, this);
+ exitdlg = new ExitDlg(screen, exit_def, this);
FormDef aud_def("AudDlg", 0);
aud_def.Load("AudDlg");
- auddlg = new(__FILE__,__LINE__) AudDlg(screen, aud_def, this);
+ auddlg = new AudDlg(screen, aud_def, this);
FormDef ctl_def("CtlDlg", 0);
ctl_def.Load("CtlDlg");
- ctldlg = new(__FILE__,__LINE__) CtlDlg(screen, ctl_def, this);
+ ctldlg = new CtlDlg(screen, ctl_def, this);
FormDef opt_def("OptDlg", 0);
opt_def.Load("OptDlg");
- optdlg = new(__FILE__,__LINE__) OptDlg(screen, opt_def, this);
+ optdlg = new OptDlg(screen, opt_def, this);
FormDef vid_def("VidDlg", 0);
vid_def.Load("VidDlg");
- viddlg = new(__FILE__,__LINE__) VidDlg(screen, vid_def, this);
+ viddlg = new VidDlg(screen, vid_def, this);
FormDef mod_def("ModDlg", 0);
mod_def.Load("ModDlg");
- modDlg = new(__FILE__,__LINE__) ModDlg(screen, mod_def, this);
+ modDlg = new ModDlg(screen, mod_def, this);
FormDef tac_ref_def("TacRefDlg", 0);
tac_ref_def.Load("TacRefDlg");
- tacRefDlg = new(__FILE__,__LINE__) TacRefDlg(screen, tac_ref_def, this);
+ tacRefDlg = new TacRefDlg(screen, tac_ref_def, this);
FormDef cmp_sel_def("CmpSelectDlg", 0);
cmp_sel_def.Load("CmpSelectDlg");
- cmpSelectDlg = new(__FILE__,__LINE__) CmpSelectDlg(screen, cmp_sel_def, this);
+ cmpSelectDlg = new CmpSelectDlg(screen, cmp_sel_def, this);
FormDef net_lobby_def("NetLobbyDlg", 0);
net_lobby_def.Load("NetLobbyDlg");
- netLobbyDlg = new(__FILE__,__LINE__) NetLobbyDlg(screen, net_lobby_def, this);
+ netLobbyDlg = new NetLobbyDlg(screen, net_lobby_def, this);
FormDef net_client_def("NetClientDlg", 0);
net_client_def.Load("NetClientDlg");
- netClientDlg = new(__FILE__,__LINE__) NetClientDlg(screen, net_client_def, this);
+ netClientDlg = new NetClientDlg(screen, net_client_def, this);
FormDef net_server_def("NetServerDlg", 0);
net_server_def.Load("NetServerDlg");
- netServerDlg = new(__FILE__,__LINE__) NetServerDlg(screen, net_server_def, this);
+ netServerDlg = new NetServerDlg(screen, net_server_def, this);
FormDef net_unit_def("NetUnitDlg", 0);
net_unit_def.Load("NetUnitDlg");
- netUnitDlg = new(__FILE__,__LINE__) NetUnitDlg(screen, net_unit_def, this);
+ netUnitDlg = new NetUnitDlg(screen, net_unit_def, this);
FormDef net_addr_def("NetAddrDlg", 0);
net_addr_def.Load("NetAddrDlg");
- netAddrDlg = new(__FILE__,__LINE__) NetAddrDlg(screen, net_addr_def, this);
+ netAddrDlg = new NetAddrDlg(screen, net_addr_def, this);
FormDef net_pass_def("NetPassDlg", 0);
net_pass_def.Load("NetPassDlg");
- netPassDlg = new(__FILE__,__LINE__) NetPassDlg(screen, net_pass_def, this);
+ netPassDlg = new NetPassDlg(screen, net_pass_def, this);
FormDef msn_edit_def("MsnEditDlg", 0);
msn_edit_def.Load("MsnEditDlg");
- msnEditDlg = new(__FILE__,__LINE__) MsnEditDlg(screen, msn_edit_def, this);
+ msnEditDlg = new MsnEditDlg(screen, msn_edit_def, this);
FormDef msn_nav_def("MsnEditNavDlg", 0);
msn_nav_def.Load("MsnEditNavDlg");
- msnEditNavDlg = new(__FILE__,__LINE__) MsnEditNavDlg(screen, msn_nav_def, this);
+ msnEditNavDlg = new MsnEditNavDlg(screen, msn_nav_def, this);
FormDef msn_elem_def("MsnElemDlg", 0);
msn_elem_def.Load("MsnElemDlg");
- msnElemDlg = new(__FILE__,__LINE__) MsnElemDlg(screen, msn_elem_def, this);
+ msnElemDlg = new MsnElemDlg(screen, msn_elem_def, this);
FormDef msn_event_def("MsnEventDlg", 0);
msn_event_def.Load("MsnEventDlg");
- msnEventDlg = new(__FILE__,__LINE__) MsnEventDlg(screen, msn_event_def, this);
+ msnEventDlg = new MsnEventDlg(screen, msn_event_def, this);
FormDef msn_def("MsnSelectDlg", 0);
msn_def.Load("MsnSelectDlg");
- msnSelectDlg = new(__FILE__,__LINE__) MsnSelectDlg(screen, msn_def, this);
+ msnSelectDlg = new MsnSelectDlg(screen, msn_def, this);
FormDef player_def("PlayerDlg", 0);
player_def.Load("PlayerDlg");
- playdlg = new(__FILE__,__LINE__) PlayerDlg(screen, player_def, this);
+ playdlg = new PlayerDlg(screen, player_def, this);
FormDef award_def("AwardDlg", 0);
award_def.Load("AwardDlg");
- awarddlg = new(__FILE__,__LINE__) AwardShowDlg(screen, award_def, this);
+ awarddlg = new AwardShowDlg(screen, award_def, this);
FormDef joy_def("JoyDlg", 0);
joy_def.Load("JoyDlg");
- joydlg = new(__FILE__,__LINE__) JoyDlg(screen, joy_def, this);
+ joydlg = new JoyDlg(screen, joy_def, this);
FormDef key_def("KeyDlg", 0);
key_def.Load("KeyDlg");
- keydlg = new(__FILE__,__LINE__) KeyDlg(screen, key_def, this);
+ keydlg = new KeyDlg(screen, key_def, this);
FormDef first_def("FirstTimeDlg", 0);
first_def.Load("FirstTimeDlg");
- firstdlg = new(__FILE__,__LINE__) FirstTimeDlg(screen, first_def, this);
+ firstdlg = new FirstTimeDlg(screen, first_def, this);
FormDef mod_info_def("ModInfoDlg", 0);
mod_info_def.Load("ModInfoDlg");
- modInfoDlg = new(__FILE__,__LINE__) ModInfoDlg(screen, mod_info_def, this);
+ modInfoDlg = new ModInfoDlg(screen, mod_info_def, this);
FormDef confirm_def("ConfirmDlg", 0);
confirm_def.Load("ConfirmDlg");
- confirmdlg = new(__FILE__,__LINE__) ConfirmDlg(screen, confirm_def, this);
+ confirmdlg = new ConfirmDlg(screen, confirm_def, this);
FormDef load_def("LoadDlg", 0);
load_def.Load("LoadDlg");
- loadDlg = new(__FILE__,__LINE__) LoadDlg(screen, load_def);
+ loadDlg = new LoadDlg(screen, load_def);
- fadewin = new(__FILE__,__LINE__) Window(screen, 0, 0, 1, 1);
- fadeview = new(__FILE__,__LINE__) FadeView(fadewin, 2, 0, 0);
+ fadewin = new Window(screen, 0, 0, 1, 1);
+ fadeview = new FadeView(fadewin, 2, 0, 0);
fadewin->AddView(fadeview);
screen->AddWindow(fadewin);
diff --git a/Stars45/MenuView.cpp b/Stars45/MenuView.cpp
index fc32fa6..6c4d26e 100644
--- a/Stars45/MenuView.cpp
+++ b/Stars45/MenuView.cpp
@@ -11,7 +11,6 @@
*/
-#include "MemDebug.h"
#include "MenuView.h"
#include "Color.h"
diff --git a/Stars45/Mfd.cpp b/Stars45/Mfd.cpp
index 849c151..f79f2af 100644
--- a/Stars45/Mfd.cpp
+++ b/Stars45/Mfd.cpp
@@ -11,7 +11,6 @@
Class for all Multi Function Displays
*/
-#include "MemDebug.h"
#include "Mfd.h"
#include "HUDView.h"
#include "Ship.h"
@@ -71,7 +70,7 @@ MFD::MFD(Window* c, int n)
ship(0), hidden(true), camview(0), lines(0), mouse_latch(0), mouse_in(false),
cockpit_hud_texture(0)
{
- sprite = new(__FILE__,__LINE__) Sprite(&sensor_fov);
+ sprite = new Sprite(&sensor_fov);
sprite->SetBlendMode(2);
sprite->SetFilter(0);
diff --git a/Stars45/Mission.cpp b/Stars45/Mission.cpp
index 9c9b181..64d5948 100644
--- a/Stars45/Mission.cpp
+++ b/Stars45/Mission.cpp
@@ -11,7 +11,6 @@
Mission classes
*/
-#include "MemDebug.h"
#include "Mission.h"
#include "MissionEvent.h"
#include "StarSystem.h"
@@ -268,7 +267,7 @@ Mission::Load(const char* fname, const char* pname)
bool
Mission::ParseMission(const char* block)
{
- Parser parser(new(__FILE__,__LINE__) BlockReader(block));
+ Parser parser(new BlockReader(block));
Term* term = parser.ParseTerm();
char err[256];
@@ -580,7 +579,7 @@ Mission::ParseElement(TermStruct* val)
int deck = 1;
char err[256];
- MissionElement* element = new(__FILE__,__LINE__) MissionElement();
+ MissionElement* element = new MissionElement();
element->rgn_name = region;
element->elem_id = elem_id++;
@@ -736,7 +735,7 @@ Mission::ParseElement(TermStruct* val)
}
else if (defname == "instr") {
- Text* obj = new(__FILE__,__LINE__) Text;
+ Text* obj = new Text;
if (GetDefText(*obj, pdef, filename))
element->instructions.append(obj);
else
@@ -801,7 +800,7 @@ Mission::ParseElement(TermStruct* val)
MissionEvent*
Mission::ParseEvent(TermStruct* val)
{
- MissionEvent* event = new(__FILE__,__LINE__) MissionEvent;
+ MissionEvent* event = new MissionEvent;
Text event_name;
Text trigger_name;
static int event_id = 1;
@@ -916,7 +915,7 @@ Mission::ParseEvent(TermStruct* val)
MissionShip*
Mission::ParseShip(TermStruct* val, MissionElement* element)
{
- MissionShip* msn_ship = new(__FILE__,__LINE__) MissionShip;
+ MissionShip* msn_ship = new MissionShip;
Text name;
Text skin_name;
@@ -1132,7 +1131,7 @@ Mission::ParseInstruction(TermStruct* val, MissionElement* element)
if (tgt_desc.length() && tgt_name.length())
tgt_desc = tgt_desc + " " + tgt_name;
- Instruction* instr = new(__FILE__,__LINE__) Instruction(rgn, loc, order);
+ Instruction* instr = new Instruction(rgn, loc, order);
instr->SetStatus(status);
instr->SetEMCON(emcon);
@@ -1179,7 +1178,7 @@ Mission::ParseLoadout(TermStruct* val, MissionElement* element)
}
}
- MissionLoad* load = new(__FILE__,__LINE__) MissionLoad(ship);
+ MissionLoad* load = new MissionLoad(ship);
if (name.length())
load->SetName(name);
@@ -1194,7 +1193,7 @@ RLoc*
Mission::ParseRLoc(TermStruct* val)
{
Vec3 base_loc;
- RLoc* rloc = new(__FILE__,__LINE__) RLoc;
+ RLoc* rloc = new RLoc;
RLoc* ref = 0;
double dex = 0;
diff --git a/Stars45/Mission.h b/Stars45/Mission.h
index 5496531..956bb5b 100644
--- a/Stars45/Mission.h
+++ b/Stars45/Mission.h
@@ -290,7 +290,7 @@ public:
int GetNavIndex(const Instruction* n);
void AddObjective(Instruction* obj) { objectives.append(obj); }
- void AddInstruction(const char* i) { instructions.append(new(__FILE__,__LINE__) Text(i)); }
+ void AddInstruction(const char* i) { instructions.append(new Text(i)); }
CombatGroup* GetCombatGroup() { return combat_group; }
void SetCombatGroup(CombatGroup* g) { combat_group = g; }
diff --git a/Stars45/MissionEvent.cpp b/Stars45/MissionEvent.cpp
index 2d005f9..24da372 100644
--- a/Stars45/MissionEvent.cpp
+++ b/Stars45/MissionEvent.cpp
@@ -11,7 +11,6 @@
Events for mission scripting
*/
-#include "MemDebug.h"
#include "MissionEvent.h"
#include "Mission.h"
#include "StarSystem.h"
@@ -321,7 +320,7 @@ MissionEvent::Execute(bool silent)
case MESSAGE:
if (event_message.length() > 0) {
if (ship) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(ship, src, event_param[0]);
+ RadioMessage* msg = new RadioMessage(ship, src, event_param[0]);
msg->SetInfo(event_message);
msg->SetChannel(ship->GetIFF());
if (tgt)
@@ -330,7 +329,7 @@ MissionEvent::Execute(bool silent)
}
else if (elem) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, src, event_param[0]);
+ RadioMessage* msg = new RadioMessage(elem, src, event_param[0]);
msg->SetInfo(event_message);
msg->SetChannel(elem->GetIFF());
if (tgt)
@@ -351,7 +350,7 @@ MissionEvent::Execute(bool silent)
elem->ClearObjectives();
}
- Instruction* obj = new(__FILE__,__LINE__) Instruction(event_param[0], 0);
+ Instruction* obj = new Instruction(event_param[0], 0);
obj->SetTarget(event_target);
elem->AddObjective(obj);
diff --git a/Stars45/MissionTemplate.cpp b/Stars45/MissionTemplate.cpp
index 1d7dacd..54efbe6 100644
--- a/Stars45/MissionTemplate.cpp
+++ b/Stars45/MissionTemplate.cpp
@@ -11,7 +11,6 @@
Mission Template classes
*/
-#include "MemDebug.h"
#include "MissionTemplate.h"
#include "MissionEvent.h"
#include "StarSystem.h"
@@ -52,7 +51,7 @@ MissionTemplate::AddElement(MissionElement* elem)
{
if (elem) {
elements.append(elem);
- aliases.append(new(__FILE__,__LINE__) MissionAlias(elem->Name(), elem));
+ aliases.append(new MissionAlias(elem->Name(), elem));
}
}
@@ -112,7 +111,7 @@ MissionTemplate::MapElement(MissionElement* elem)
elem->SetSquadron(sqdr->Name());
if (!elem->IsDropship()) {
- aliases.append(new(__FILE__,__LINE__) MissionAlias(elem->Name(), elem));
+ aliases.append(new MissionAlias(elem->Name(), elem));
elem->SetName(elem->GetCombatUnit()->Name());
}
@@ -186,7 +185,7 @@ MissionTemplate::MapCallsign(const char* name, int iff)
if (iff >= 0) {
const char* callsign = Callsign::GetCallsign(iff);
- MissionCallsign* mc = new(__FILE__,__LINE__) MissionCallsign(callsign, name);
+ MissionCallsign* mc = new MissionCallsign(callsign, name);
callsigns.append(mc);
return mc->Callsign();
@@ -304,7 +303,7 @@ MissionTemplate::Load(const char* fname, const char* pname)
loader->SetDataPath(0);
loader->UseFileSystem(old_fs);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -632,7 +631,7 @@ MissionTemplate::ParseAlias(TermStruct* val)
delete rloc;
- aliases.append(new(__FILE__,__LINE__) MissionAlias(name, elem));
+ aliases.append(new MissionAlias(name, elem));
}
else {
::Print("WARNING: Could not resolve mission alias '%s'\n", (const char*) name);
@@ -663,7 +662,7 @@ MissionTemplate::ParseAlias(TermStruct* val)
}
else if (defname == "instr") {
- Text* obj = new(__FILE__,__LINE__) Text;
+ Text* obj = new Text;
if (GetDefText(*obj, pdef, filename))
elem->Instructions().append(obj);
}
diff --git a/Stars45/ModConfig.cpp b/Stars45/ModConfig.cpp
index 0839e6e..3cc433e 100644
--- a/Stars45/ModConfig.cpp
+++ b/Stars45/ModConfig.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "ModConfig.h"
#include "ModInfo.h"
#include "Campaign.h"
@@ -55,7 +54,7 @@ ModConfig::~ModConfig()
void
ModConfig::Initialize()
{
- mod_config = new(__FILE__,__LINE__) ModConfig;
+ mod_config = new ModConfig;
}
void
@@ -93,7 +92,7 @@ ModConfig::Load()
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -103,7 +102,7 @@ ModConfig::Load()
if (blocklen == 0)
return;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -130,7 +129,7 @@ ModConfig::Load()
if (def) {
Text name;
GetDefText(name, def, filename);
- enabled.append(new(__FILE__,__LINE__) Text(name));
+ enabled.append(new Text(name));
}
}
}
@@ -240,7 +239,7 @@ ModConfig::Deploy()
Print(" %d. %s\n", i++, name->data());
- ModInfo* mod_info = new(__FILE__,__LINE__) ModInfo;
+ ModInfo* mod_info = new ModInfo;
if (mod_info->Load(name->data()) && mod_info->Enable()) {
mods.append(mod_info);
@@ -304,7 +303,7 @@ ModConfig::EnableMod(const char* name)
enabled.append(mod_name);
if (!IsDeployed(*mod_name)) {
- ModInfo* mod_info = new(__FILE__,__LINE__) ModInfo;
+ ModInfo* mod_info = new ModInfo;
if (mod_info->Load(*mod_name) && mod_info->Enable()) {
mods.append(mod_info);
diff --git a/Stars45/ModDlg.cpp b/Stars45/ModDlg.cpp
index dc24f09..45323a3 100644
--- a/Stars45/ModDlg.cpp
+++ b/Stars45/ModDlg.cpp
@@ -11,7 +11,6 @@
Mod Config Dialog Active Window class
*/
-#include "MemDebug.h"
#include "ModDlg.h"
#include "ModInfoDlg.h"
#include "BaseScreen.h"
diff --git a/Stars45/ModInfo.cpp b/Stars45/ModInfo.cpp
index 9e5c801..0c75ed1 100644
--- a/Stars45/ModInfo.cpp
+++ b/Stars45/ModInfo.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "ModInfo.h"
#include "Campaign.h"
#include "ShipDesign.h"
@@ -75,7 +74,7 @@ ModInfo::Load(const char* fname)
if (logoname.length()) {
PcxImage pcx;
- logo = new(__FILE__,__LINE__) Bitmap;
+ logo = new Bitmap;
n = a.FindEntry(logoname);
if (n > -1) {
@@ -107,7 +106,7 @@ bool
ModInfo::ParseModInfo(const char* block)
{
bool ok = false;
- Parser parser(new(__FILE__,__LINE__) BlockReader(block));
+ Parser parser(new BlockReader(block));
Term* term = parser.ParseTerm();
if (!term) {
@@ -179,7 +178,7 @@ ModInfo::ParseModInfo(const char* block)
else {
TermStruct* val = def->term()->isStruct();
- ModCampaign* c = new(__FILE__,__LINE__) ModCampaign;
+ ModCampaign* c = new ModCampaign;
for (int i = 0; i < val->elements()->size(); i++) {
TermDef* pdef = val->elements()->at(i)->isDef();
@@ -214,7 +213,7 @@ ModInfo::ParseModInfo(const char* block)
else {
TermStruct* val = def->term()->isStruct();
- ModCatalog* c = new(__FILE__,__LINE__) ModCatalog;
+ ModCatalog* c = new ModCatalog;
for (int i = 0; i < val->elements()->size(); i++) {
TermDef* pdef = val->elements()->at(i)->isDef();
diff --git a/Stars45/ModInfoDlg.cpp b/Stars45/ModInfoDlg.cpp
index 8bfdc46..cebdc54 100644
--- a/Stars45/ModInfoDlg.cpp
+++ b/Stars45/ModInfoDlg.cpp
@@ -11,7 +11,6 @@
Mod Config Dialog Active Window class
*/
-#include "MemDebug.h"
#include "ModInfoDlg.h"
#include "BaseScreen.h"
#include "ModConfig.h"
diff --git a/Stars45/Mouse.cpp b/Stars45/Mouse.cpp
index 7b185ed..c772bc2 100644
--- a/Stars45/Mouse.cpp
+++ b/Stars45/Mouse.cpp
@@ -11,7 +11,6 @@
Mouse class
*/
-#include "MemDebug.h"
#include "Mouse.h"
#include "DataLoader.h"
#include "Window.h"
@@ -41,7 +40,7 @@ void Mouse::Create(Screen* screen)
{
if (screen) {
delete window;
- window = new(__FILE__,__LINE__) Window(screen, 0, 0, screen->Width(), screen->Height());
+ window = new Window(screen, 0, 0, screen->Width(), screen->Height());
}
}
@@ -51,7 +50,7 @@ void Mouse::Resize(Screen* screen)
{
if (screen) {
delete window;
- window = new(__FILE__,__LINE__) Window(screen, 0, 0, screen->Width(), screen->Height());
+ window = new Window(screen, 0, 0, screen->Width(), screen->Height());
}
}
@@ -112,7 +111,7 @@ Mouse::LoadCursor(CURSOR c, const char* name, HOTSPOT hs)
image[c] = 0;
if (name && *name) {
- image[c] = new(__FILE__,__LINE__) Bitmap;
+ image[c] = new Bitmap;
result = DataLoader::GetLoader()->LoadBitmap(name, *image[c], Bitmap::BMP_TRANSPARENT);
if (result) {
diff --git a/Stars45/MouseController.cpp b/Stars45/MouseController.cpp
index e4ab97d..75fd0f5 100644
--- a/Stars45/MouseController.cpp
+++ b/Stars45/MouseController.cpp
@@ -11,7 +11,6 @@
MouseController Input class
*/
-#include "MemDebug.h"
#include "MouseController.h"
#include "Keyboard.h"
#include "Mouse.h"
diff --git a/Stars45/MsnDlg.cpp b/Stars45/MsnDlg.cpp
index 65a3b00..4d2bfba 100644
--- a/Stars45/MsnDlg.cpp
+++ b/Stars45/MsnDlg.cpp
@@ -11,7 +11,6 @@
Mission Briefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnDlg.h"
#include "PlanScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/MsnEditDlg.cpp b/Stars45/MsnEditDlg.cpp
index 838ac59..13f5cf7 100644
--- a/Stars45/MsnEditDlg.cpp
+++ b/Stars45/MsnEditDlg.cpp
@@ -11,7 +11,6 @@
Mission Editor Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnEditDlg.h"
#include "MsnElemDlg.h"
#include "MsnEventDlg.h"
@@ -692,7 +691,7 @@ MsnEditDlg::OnElemAdd(AWEvent* event)
{
if (lst_elem && mission) {
List<MissionElement>& elements = mission->GetElements();
- MissionElement* elem = new(__FILE__,__LINE__) MissionElement;
+ MissionElement* elem = new MissionElement;
if (elements.size() > 0)
elem->SetLocation(RandomPoint());
@@ -820,7 +819,7 @@ MsnEditDlg::OnEventAdd(AWEvent* event)
{
if (lst_event && mission) {
List<MissionEvent>& events = mission->GetEvents();
- MissionEvent* event = new(__FILE__,__LINE__) MissionEvent;
+ MissionEvent* event = new MissionEvent;
int id = 1;
for (int i = 0; i < events.size(); i++) {
diff --git a/Stars45/MsnEditNavDlg.cpp b/Stars45/MsnEditNavDlg.cpp
index e481bd8..eab1d13 100644
--- a/Stars45/MsnEditNavDlg.cpp
+++ b/Stars45/MsnEditNavDlg.cpp
@@ -11,7 +11,6 @@
Mission Briefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnEditNavDlg.h"
#include "MsnEditDlg.h"
#include "MenuScreen.h"
diff --git a/Stars45/MsnElemDlg.cpp b/Stars45/MsnElemDlg.cpp
index e6f4eea..780bc72 100644
--- a/Stars45/MsnElemDlg.cpp
+++ b/Stars45/MsnElemDlg.cpp
@@ -11,7 +11,6 @@
Mod Config Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnElemDlg.h"
#include "MsnEditDlg.h"
#include "MenuScreen.h"
@@ -746,7 +745,7 @@ MsnElemDlg::OnAccept(AWEvent* event)
const char* loadname = cmb_loadout->GetSelectedItem();
if (loadname && *loadname) {
- MissionLoad* mload = new(__FILE__,__LINE__) MissionLoad(-1, cmb_loadout->GetSelectedItem());
+ MissionLoad* mload = new MissionLoad(-1, cmb_loadout->GetSelectedItem());
elem->Loadouts().append(mload);
}
}
@@ -759,7 +758,7 @@ MsnElemDlg::OnAccept(AWEvent* event)
const char* target = cmb_target->GetSelectedItem();
if (action >= Instruction::VECTOR) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(action, target);
+ Instruction* obj = new Instruction(action, target);
objectives.append(obj);
}
}
diff --git a/Stars45/MsnEventDlg.cpp b/Stars45/MsnEventDlg.cpp
index dfc241f..57f7174 100644
--- a/Stars45/MsnEventDlg.cpp
+++ b/Stars45/MsnEventDlg.cpp
@@ -11,7 +11,6 @@
Mod Config Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnEventDlg.h"
#include "MsnEditDlg.h"
#include "MenuScreen.h"
@@ -311,7 +310,7 @@ MsnEventDlg::OnAccept(AWEvent* e)
event->event_nparams = 1;
}
else if (*buf == '(') {
- Parser parser(new(__FILE__,__LINE__) BlockReader(buf));
+ Parser parser(new BlockReader(buf));
Term* term = parser.ParseTerm();
if (term && term->isArray()) {
@@ -362,7 +361,7 @@ MsnEventDlg::OnAccept(AWEvent* e)
}
else if (*buf == '(') {
- Parser parser(new(__FILE__,__LINE__) BlockReader(buf));
+ Parser parser(new BlockReader(buf));
Term* term = parser.ParseTerm();
if (term && term->isArray()) {
diff --git a/Stars45/MsnNavDlg.cpp b/Stars45/MsnNavDlg.cpp
index 87c8b5a..7858aaf 100644
--- a/Stars45/MsnNavDlg.cpp
+++ b/Stars45/MsnNavDlg.cpp
@@ -11,7 +11,6 @@
Mission Briefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnNavDlg.h"
#include "PlanScreen.h"
#include "Campaign.h"
diff --git a/Stars45/MsnObjDlg.cpp b/Stars45/MsnObjDlg.cpp
index 3089c91..384f83e 100644
--- a/Stars45/MsnObjDlg.cpp
+++ b/Stars45/MsnObjDlg.cpp
@@ -11,7 +11,6 @@
Mission Briefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnObjDlg.h"
#include "PlanScreen.h"
#include "Campaign.h"
@@ -116,7 +115,7 @@ MsnObjDlg::RegisterControls()
scene.AddLight(back_light);
- camview = new(__FILE__,__LINE__) CameraView(beauty, &cam, &scene);
+ camview = new CameraView(beauty, &cam, &scene);
camview->SetProjectionType(Video::PROJECTION_PERSPECTIVE);
camview->SetFieldOfView(2);
@@ -203,7 +202,7 @@ MsnObjDlg::Show()
Model* model = design->models[n-1].at(0);
if (model) {
- ship = new(__FILE__,__LINE__) ShipSolid(0);
+ ship = new ShipSolid(0);
ship->UseModel(model);
ship->CreateShadows(1);
ship->SetSkin(elem->GetSkin());
diff --git a/Stars45/MsnPkgDlg.cpp b/Stars45/MsnPkgDlg.cpp
index d13c518..6616fd2 100644
--- a/Stars45/MsnPkgDlg.cpp
+++ b/Stars45/MsnPkgDlg.cpp
@@ -11,7 +11,6 @@
Mission Briefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnPkgDlg.h"
#include "PlanScreen.h"
#include "Campaign.h"
diff --git a/Stars45/MsnSelectDlg.cpp b/Stars45/MsnSelectDlg.cpp
index ee75cb0..fdd6b06 100644
--- a/Stars45/MsnSelectDlg.cpp
+++ b/Stars45/MsnSelectDlg.cpp
@@ -11,7 +11,6 @@
Mission Select Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnSelectDlg.h"
#include "MsnEditDlg.h"
#include "MsnEditNavDlg.h"
diff --git a/Stars45/MsnWepDlg.cpp b/Stars45/MsnWepDlg.cpp
index dcc33a7..2249d48 100644
--- a/Stars45/MsnWepDlg.cpp
+++ b/Stars45/MsnWepDlg.cpp
@@ -11,7 +11,6 @@
Mission Briefing Dialog Active Window class
*/
-#include "MemDebug.h"
#include "MsnWepDlg.h"
#include "PlanScreen.h"
#include "Starshatter.h"
@@ -395,7 +394,7 @@ MsnWepDlg::OnMount(AWEvent* event)
int nstations = elem->GetDesign()->hard_points.size();
if (elem->Loadouts().size() < 1) {
- MissionLoad* l = new(__FILE__,__LINE__) MissionLoad;
+ MissionLoad* l = new MissionLoad;
elem->Loadouts().append(l);
for (int n = 0; n < nstations; n++)
@@ -465,7 +464,7 @@ MsnWepDlg::OnLoadout(AWEvent* event)
}
if (elem->Loadouts().size() < 1) {
- MissionLoad* l = new(__FILE__,__LINE__) MissionLoad(-1, shipload->name);
+ MissionLoad* l = new MissionLoad(-1, shipload->name);
elem->Loadouts().append(l);
}
else {
diff --git a/Stars45/MultiController.cpp b/Stars45/MultiController.cpp
index 47aa7e1..3df791b 100644
--- a/Stars45/MultiController.cpp
+++ b/Stars45/MultiController.cpp
@@ -11,7 +11,6 @@
MultiController Input class
*/
-#include "MemDebug.h"
#include "MultiController.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/MusicDirector.cpp b/Stars45/MusicDirector.cpp
index b349f4c..fdcfafc 100644
--- a/Stars45/MusicDirector.cpp
+++ b/Stars45/MusicDirector.cpp
@@ -13,7 +13,6 @@
*/
-#include "MemDebug.h"
#include "MusicDirector.h"
#include "MusicTrack.h"
@@ -68,7 +67,7 @@ void
MusicDirector::Initialize()
{
if (music_director) delete music_director;
- music_director = new(__FILE__,__LINE__) MusicDirector();
+ music_director = new MusicDirector();
}
void
@@ -165,7 +164,7 @@ MusicDirector::ScanTracks()
ListIter<Text> iter = files;
while (++iter) {
Text* name = iter.value();
- Text* file = new(__FILE__,__LINE__) Text("Music/");
+ Text* file = new Text("Music/");
name->setSensitive(false);
file->append(*name);
@@ -411,7 +410,7 @@ MusicDirector::GetNextTrack(int index)
}
}
- next_track = new(__FILE__,__LINE__) MusicTrack(*tracks->at(index), mode, index);
+ next_track = new MusicTrack(*tracks->at(index), mode, index);
next_track->FadeIn();
}
diff --git a/Stars45/MusicTrack.cpp b/Stars45/MusicTrack.cpp
index fef2b73..cca61a5 100644
--- a/Stars45/MusicTrack.cpp
+++ b/Stars45/MusicTrack.cpp
@@ -13,7 +13,6 @@
*/
-#include "MemDebug.h"
#include "MusicTrack.h"
#include "MusicDirector.h"
#include "Starshatter.h"
diff --git a/Stars45/NPClientWraps.cpp b/Stars45/NPClientWraps.cpp
index ffdfe14..0705696 100644
--- a/Stars45/NPClientWraps.cpp
+++ b/Stars45/NPClientWraps.cpp
@@ -21,7 +21,6 @@
// *
// *******************************************************************************
//
-#include "MemDebug.h"
#include "Game.h"
#include "Text.h"
diff --git a/Stars45/NavAI.cpp b/Stars45/NavAI.cpp
index fe1ac75..ad897d0 100644
--- a/Stars45/NavAI.cpp
+++ b/Stars45/NavAI.cpp
@@ -11,7 +11,6 @@
Automatic Navigator Artificial Intelligence class
*/
-#include "MemDebug.h"
#include "NavAI.h"
#include "TacticalAI.h"
#include "Instruction.h"
diff --git a/Stars45/NavDlg.cpp b/Stars45/NavDlg.cpp
index d5494c1..8847957 100644
--- a/Stars45/NavDlg.cpp
+++ b/Stars45/NavDlg.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "NavDlg.h"
#include "MapView.h"
#include "MsnElemDlg.h"
@@ -99,7 +98,7 @@ NavDlg::RegisterControls()
map_win = FindControl(100);
if (map_win) {
- star_map = new(__FILE__,__LINE__) MapView(map_win);
+ star_map = new MapView(map_win);
REGISTER_CLIENT(EID_LBUTTON_DOWN, map_win, NavDlg, OnMapDown);
REGISTER_CLIENT(EID_MOUSE_MOVE, map_win, NavDlg, OnMapMove);
diff --git a/Stars45/NavLight.cpp b/Stars45/NavLight.cpp
index dc19e37..1be4fd5 100644
--- a/Stars45/NavLight.cpp
+++ b/Stars45/NavLight.cpp
@@ -11,7 +11,6 @@
Navigation Light System class
*/
-#include "MemDebug.h"
#include "NavLight.h"
#include "Clock.h"
@@ -55,7 +54,7 @@ nlights(0), enable(true)
pattern[i] = c.pattern[i];
beacon_type[i] = c.beacon_type[i];
- DriveSprite* rep = new(__FILE__,__LINE__) DriveSprite(images[beacon_type[i]]);
+ DriveSprite* rep = new DriveSprite(images[beacon_type[i]]);
rep->Scale(c.scale);
beacon[i] = rep;
@@ -142,7 +141,7 @@ NavLight::AddBeacon(Point l, DWORD ptn, int t)
pattern[nlights] = ptn;
beacon_type[nlights] = t;
- DriveSprite* rep = new(__FILE__,__LINE__) DriveSprite(images[t]);
+ DriveSprite* rep = new DriveSprite(images[t]);
rep->Scale(scale);
beacon[nlights] = rep;
diff --git a/Stars45/NavSystem.cpp b/Stars45/NavSystem.cpp
index 877e720..da5a3d6 100644
--- a/Stars45/NavSystem.cpp
+++ b/Stars45/NavSystem.cpp
@@ -11,7 +11,6 @@
Navigation System class implementation
*/
-#include "MemDebug.h"
#include "NavSystem.h"
#include "Ship.h"
#include "Sim.h"
diff --git a/Stars45/NetAddrDlg.cpp b/Stars45/NetAddrDlg.cpp
index 8bd24d3..6af21a3 100644
--- a/Stars45/NetAddrDlg.cpp
+++ b/Stars45/NetAddrDlg.cpp
@@ -11,7 +11,6 @@
Mission Select Dialog Active Window class
*/
-#include "MemDebug.h"
#include "NetAddrDlg.h"
#include "MenuScreen.h"
#include "NetClientConfig.h"
diff --git a/Stars45/NetAdminChat.cpp b/Stars45/NetAdminChat.cpp
index 9ef0384..359173a 100644
--- a/Stars45/NetAdminChat.cpp
+++ b/Stars45/NetAdminChat.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetAdminChat.h"
#include "NetLobbyServer.h"
#include "NetServerConfig.h"
diff --git a/Stars45/NetAdminServer.cpp b/Stars45/NetAdminServer.cpp
index 4ea6c9b..b5efad7 100644
--- a/Stars45/NetAdminServer.cpp
+++ b/Stars45/NetAdminServer.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetAdminServer.h"
#include "NetLobbyServer.h"
#include "NetServerConfig.h"
@@ -70,7 +69,7 @@ public:
}
else if (name == admin_name && pass == admin_pass) {
- user = new(__FILE__,__LINE__) NetUser(name);
+ user = new NetUser(name);
user->SetAddress(request.GetClientAddr());
if (session)
@@ -432,7 +431,7 @@ NetAdminServer*
NetAdminServer::GetInstance(WORD port)
{
if (!net_Admin_server && port > 0)
- net_Admin_server = new(__FILE__,__LINE__) NetAdminServer(port);
+ net_Admin_server = new NetAdminServer(port);
return net_Admin_server;
}
@@ -458,24 +457,24 @@ NetAdminServer::GetServlet(HttpRequest& request)
path.setSensitive(false);
if (path.indexOf("/login") == 0)
- return new(__FILE__,__LINE__) NetAdminLogin;
+ return new NetAdminLogin;
if (path.indexOf("/chat") == 0)
- return new(__FILE__,__LINE__) NetAdminChat;
+ return new NetAdminChat;
if (path.indexOf("/server") == 0)
- return new(__FILE__,__LINE__) NetAdminServerMgr;
+ return new NetAdminServerMgr;
if (path.indexOf("/file") == 0)
- return new(__FILE__,__LINE__) NetAdminFile;
+ return new NetAdminFile;
if (path.indexOf("/user") == 0)
- return new(__FILE__,__LINE__) NetAdminUserList;
+ return new NetAdminUserList;
if (path.indexOf("/ban") == 0)
- return new(__FILE__,__LINE__) NetAdminBanUser;
+ return new NetAdminBanUser;
- return new(__FILE__,__LINE__) NetAdminServlet;
+ return new NetAdminServlet;
}
// +-------------------------------------------------------------------+
diff --git a/Stars45/NetAuth.cpp b/Stars45/NetAuth.cpp
index 3408923..f9e4d02 100644
--- a/Stars45/NetAuth.cpp
+++ b/Stars45/NetAuth.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetAuth.h"
#include "NetLobby.h"
#include "NetUser.h"
diff --git a/Stars45/NetBrokerClient.cpp b/Stars45/NetBrokerClient.cpp
index f991137..043c580 100644
--- a/Stars45/NetBrokerClient.cpp
+++ b/Stars45/NetBrokerClient.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetBrokerClient.h"
#include "HttpClient.h"
@@ -208,7 +207,7 @@ NetBrokerClient::GameList(const char* type, List<NetServerInfo>& server_list)
}
else if (!strncmp(p, "###", 3)) {
- NetServerInfo* server = new(__FILE__,__LINE__) NetServerInfo;
+ NetServerInfo* server = new NetServerInfo;
server->name = name;
server->hostname = addr;
server->type = type;
diff --git a/Stars45/NetChat.cpp b/Stars45/NetChat.cpp
index b1caf43..7c1f4d2 100644
--- a/Stars45/NetChat.cpp
+++ b/Stars45/NetChat.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetChat.h"
#include "NetLayer.h"
diff --git a/Stars45/NetClientConfig.cpp b/Stars45/NetClientConfig.cpp
index 72eb716..2fd4d1b 100644
--- a/Stars45/NetClientConfig.cpp
+++ b/Stars45/NetClientConfig.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "NetClientConfig.h"
#include "NetLobbyClient.h"
@@ -49,7 +48,7 @@ void
NetClientConfig::Initialize()
{
if (!instance)
- instance = new(__FILE__,__LINE__) NetClientConfig();
+ instance = new NetClientConfig();
}
void
@@ -73,7 +72,7 @@ NetClientConfig::AddServer(const char* name, const char* addr, WORD port, const
else
sprintf_s(buffer, "%s:%d", addr, port);
- NetServerInfo* server = new(__FILE__,__LINE__) NetServerInfo;
+ NetServerInfo* server = new NetServerInfo;
server->name = buffer;
server->hostname = addr;
server->addr = NetAddr(addr, port);
@@ -154,7 +153,7 @@ NetClientConfig::Load()
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -166,7 +165,7 @@ NetClientConfig::Load()
servers.destroy();
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -281,7 +280,7 @@ NetClientConfig::CreateConnection()
}
if (addr.IPAddr() && addr.Port() && !conn) {
- conn = new(__FILE__,__LINE__) NetLobbyClient; // (addr);
+ conn = new NetLobbyClient; // (addr);
}
}
diff --git a/Stars45/NetClientDlg.cpp b/Stars45/NetClientDlg.cpp
index 7597a2c..2a6ce66 100644
--- a/Stars45/NetClientDlg.cpp
+++ b/Stars45/NetClientDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "NetClientDlg.h"
#include "NetClientConfig.h"
#include "NetLobbyClient.h"
diff --git a/Stars45/NetData.cpp b/Stars45/NetData.cpp
index 54c6376..4d625b9 100644
--- a/Stars45/NetData.cpp
+++ b/Stars45/NetData.cpp
@@ -11,7 +11,6 @@
Payload structures for multiplayer network packets
*/
-#include "MemDebug.h"
#include "NetData.h"
#include "NetLink.h"
#include "NetMsg.h"
@@ -869,7 +868,7 @@ NetCommMsg::~NetCommMsg()
void
NetCommMsg::SetRadioMessage(RadioMessage* m)
{
- radio_message = new(__FILE__,__LINE__) RadioMessage(*m);
+ radio_message = new RadioMessage(*m);
}
BYTE*
@@ -967,9 +966,9 @@ NetCommMsg::Unpack(const BYTE* p)
delete radio_message;
if (elem)
- radio_message = new(__FILE__,__LINE__) RadioMessage(elem, src, action);
+ radio_message = new RadioMessage(elem, src, action);
else
- radio_message = new(__FILE__,__LINE__) RadioMessage(dst, src, action);
+ radio_message = new RadioMessage(dst, src, action);
radio_message->SetChannel(channel);
radio_message->SetLocation(loc);
@@ -1237,7 +1236,7 @@ NetNavData::SetNavPoint(Instruction* n)
}
if (n)
- navpoint = new(__FILE__,__LINE__) Instruction(*n);
+ navpoint = new Instruction(*n);
}
BYTE*
@@ -1345,9 +1344,9 @@ NetNavData::Unpack(const BYTE* p)
rgn = sim->FindRegion(rgn_name);
if (rgn)
- navpoint = new(__FILE__,__LINE__) Instruction(rgn, loc, action);
+ navpoint = new Instruction(rgn, loc, action);
else
- navpoint = new(__FILE__,__LINE__) Instruction(rgn_name, loc, action);
+ navpoint = new Instruction(rgn_name, loc, action);
navpoint->SetFormation(formation);
navpoint->SetStatus(status);
diff --git a/Stars45/NetFileServlet.cpp b/Stars45/NetFileServlet.cpp
index 509d7fc..6b23d9d 100644
--- a/Stars45/NetFileServlet.cpp
+++ b/Stars45/NetFileServlet.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetFileServlet.h"
#include "NetAdminServer.h"
#include "NetLayer.h"
@@ -79,7 +78,7 @@ NetWebServlet::DoGet(HttpRequest& request, HttpResponse& response)
int len = ftell(f);
::fseek(f, 0, SEEK_SET);
- BYTE* buf = new(__FILE__,__LINE__) BYTE[len];
+ BYTE* buf = new BYTE[len];
::fread(buf, len, 1, f);
::fclose(f);
diff --git a/Stars45/NetGame.cpp b/Stars45/NetGame.cpp
index 9b09e2d..c02b390 100644
--- a/Stars45/NetGame.cpp
+++ b/Stars45/NetGame.cpp
@@ -11,7 +11,6 @@
Network Game Manager class
*/
-#include "MemDebug.h"
#include "NetGame.h"
#include "NetGameClient.h"
#include "NetGameServer.h"
@@ -106,10 +105,10 @@ NetGame::Create()
{
if (!netgame) {
if (NetServerConfig::GetInstance())
- netgame = new(__FILE__,__LINE__) NetGameServer;
+ netgame = new NetGameServer;
else if (NetClientConfig::GetInstance() && NetClientConfig::GetInstance()->GetSelectedServer())
- netgame = new(__FILE__,__LINE__) NetGameClient;
+ netgame = new NetGameClient;
}
return netgame;
diff --git a/Stars45/NetGameClient.cpp b/Stars45/NetGameClient.cpp
index c333547..5b1440f 100644
--- a/Stars45/NetGameClient.cpp
+++ b/Stars45/NetGameClient.cpp
@@ -11,7 +11,6 @@
Network Game Manager class
*/
-#include "MemDebug.h"
#include "NetGameClient.h"
#include "NetClientConfig.h"
#include "NetLobby.h"
@@ -73,7 +72,7 @@ NetGameClient::NetGameClient()
if (server_name.length() && port > 0) {
Print(" '%s' is a client of '%s'\n", me.Name(), server_name.data());
- link = new(__FILE__,__LINE__) NetLink;
+ link = new NetLink;
server_id = link->AddPeer(NetAddr(server_name, port));
SendJoinRequest();
}
@@ -143,7 +142,7 @@ NetGameClient::DoJoinAnnounce(NetMsg* msg)
Sim* sim = Sim::GetSim();
if (!sim) return;
- NetJoinAnnounce* join_ann = new(__FILE__,__LINE__) NetJoinAnnounce;
+ NetJoinAnnounce* join_ann = new NetJoinAnnounce;
bool saved = false;
if (join_ann->Unpack(msg->Data())) {
@@ -229,7 +228,7 @@ NetGameClient::DoJoinAnnounce(NetMsg* msg)
if (shield)
shield->SetNetShieldLevel(shld_lvl);
- NetPlayer* remote_player = new(__FILE__,__LINE__) NetPlayer(nid);
+ NetPlayer* remote_player = new NetPlayer(nid);
remote_player->SetName(name);
remote_player->SetObjID(oid);
remote_player->SetShip(ship);
@@ -311,7 +310,7 @@ NetGameClient::DoJoinBacklog(NetJoinAnnounce* join_ann)
if (shield)
shield->SetNetShieldLevel(shld_lvl);
- NetPlayer* remote_player = new(__FILE__,__LINE__) NetPlayer(nid);
+ NetPlayer* remote_player = new NetPlayer(nid);
remote_player->SetName(name);
remote_player->SetObjID(oid);
remote_player->SetShip(ship);
@@ -667,7 +666,7 @@ NetGameClient::DoElemCreate(NetMsg* msg)
elem->SetLoadout(load);
if (code > Instruction::RTB || target.length() > 0) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(code, target);
+ Instruction* obj = new Instruction(code, target);
elem->AddObjective(obj);
}
@@ -823,7 +822,7 @@ NetGameClient::DoNavData(NetMsg* msg)
if (elem) {
if (nav_data.IsAdd()) {
- Instruction* navpt = new(__FILE__,__LINE__) Instruction(*nav_data.GetNavPoint());
+ Instruction* navpt = new Instruction(*nav_data.GetNavPoint());
Instruction* after = 0;
int index = nav_data.GetIndex();
diff --git a/Stars45/NetGameServer.cpp b/Stars45/NetGameServer.cpp
index 84a199d..ef33a90 100644
--- a/Stars45/NetGameServer.cpp
+++ b/Stars45/NetGameServer.cpp
@@ -11,7 +11,6 @@
Server-Side Network Game Manager class
*/
-#include "MemDebug.h"
#include "NetGameServer.h"
#include "NetServerConfig.h"
#include "NetLobbyServer.h"
@@ -64,7 +63,7 @@ NetGameServer::NetGameServer()
NetAddr server(hostname.data(), server_port);
- link = new(__FILE__,__LINE__) NetLink(server);
+ link = new NetLink(server);
ListIter<SimRegion> rgn_iter = sim->GetRegions();
while (++rgn_iter) {
@@ -281,7 +280,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg)
Ignore(ship);
ships.remove(ship);
- remote_player = new(__FILE__,__LINE__) NetPlayer(nid);
+ remote_player = new NetPlayer(nid);
remote_player->SetName(name);
remote_player->SetSerialNumber(serno);
remote_player->SetObjID(ship->GetObjID());
@@ -658,7 +657,7 @@ NetGameServer::DoElemCreate(NetMsg* msg)
elem->SetLoadout(load);
if (code > Instruction::RTB || target.length() > 0) {
- Instruction* obj = new(__FILE__,__LINE__) Instruction(code, target);
+ Instruction* obj = new Instruction(code, target);
elem->AddObjective(obj);
}
@@ -742,7 +741,7 @@ NetGameServer::DoNavData(NetMsg* msg)
if (elem) {
if (nav_data.IsAdd()) {
- Instruction* navpt = new(__FILE__,__LINE__) Instruction(*nav_data.GetNavPoint());
+ Instruction* navpt = new Instruction(*nav_data.GetNavPoint());
Instruction* after = 0;
int index = nav_data.GetIndex();
diff --git a/Stars45/NetLobby.cpp b/Stars45/NetLobby.cpp
index 7effc09..81eecae 100644
--- a/Stars45/NetLobby.cpp
+++ b/Stars45/NetLobby.cpp
@@ -11,7 +11,6 @@
Base Class for Multiplayer Game Lobby classes
*/
-#include "MemDebug.h"
#include "NetLobby.h"
#include "NetLobbyClient.h"
#include "NetLobbyServer.h"
@@ -118,7 +117,7 @@ NetLobby::Recv()
text = buffer;
}
else if (msg->Length() < 1024 * 1024) {
- text = new(__FILE__,__LINE__) char[msg->Length()];
+ text = new char[msg->Length()];
ZeroMemory(text, msg->Length());
CopyMemory(text, msg->Data()+2, msg->Length()-2);
}
@@ -375,7 +374,7 @@ NetLobby::ParseMsg(Text msg, List<NetLobbyParam>& params)
val = val.substring(1, val.length()-2);
}
- NetLobbyParam* param = new(__FILE__,__LINE__) NetLobbyParam(name.symbol(), val);
+ NetLobbyParam* param = new NetLobbyParam(name.symbol(), val);
params.append(param);
name = lexer.Get();
@@ -402,7 +401,7 @@ void
NetLobby::AddChat(NetUser* user, const char* msg, bool route)
{
if (user && msg && *msg)
- chat_log.append(new(__FILE__,__LINE__) NetChatEntry(user, msg));
+ chat_log.append(new NetChatEntry(user, msg));
}
List<NetChatEntry>&
@@ -431,7 +430,7 @@ void
NetLobby::AddUnitMap(MissionElement* elem, int index)
{
if (elem)
- unit_map.append(new(__FILE__,__LINE__) NetUnitEntry(elem, index));
+ unit_map.append(new NetUnitEntry(elem, index));
}
List<NetUnitEntry>&
diff --git a/Stars45/NetLobbyClient.cpp b/Stars45/NetLobbyClient.cpp
index bec2d42..ca0ff81 100644
--- a/Stars45/NetLobbyClient.cpp
+++ b/Stars45/NetLobbyClient.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetLobbyClient.h"
#include "NetClientConfig.h"
#include "NetAuth.h"
@@ -60,7 +59,7 @@ NetLobbyClient::NetLobbyClient()
if (server_name.length() && port > 0) {
Print(" '%s' is a client of '%s'\n", me.Name(), server_name.data());
- link = new(__FILE__,__LINE__) NetLink;
+ link = new NetLink;
server_id = link->AddPeer(NetAddr(server_name, port));
}
else if (port == 0) {
@@ -83,7 +82,7 @@ temporary(true)
mods_req_time = 0;
if (addr.IPAddr() != 0) {
- link = new(__FILE__,__LINE__) NetLink;
+ link = new NetLink;
server_id = link->AddPeer(addr);
}
}
@@ -513,7 +512,7 @@ NetLobbyClient::DoChat(NetPeer* peer, Text msg)
// receive chat from server:
if (id && chat_msg.length()) {
- NetChatEntry* entry = new(__FILE__,__LINE__) NetChatEntry(id, user_name, chat_msg);
+ NetChatEntry* entry = new NetChatEntry(id, user_name, chat_msg);
if (!chat_log.contains(entry))
chat_log.insertSort(entry);
@@ -549,7 +548,7 @@ NetLobbyClient::DoServerMods(NetPeer* peer, Text msg)
else if (p->name == "ver") {
version = p->value;
- ModInfo* info = new(__FILE__,__LINE__) ModInfo(name, version, url);
+ ModInfo* info = new ModInfo(name, version, url);
server_mods.append(info);
}
}
@@ -608,7 +607,7 @@ NetLobbyClient::DoUserList(NetPeer* peer, Text msg)
else if (p->name == "host") {
host_flag = p->value;
- NetUser* u = new(__FILE__,__LINE__) NetUser(user_name);
+ NetUser* u = new NetUser(user_name);
u->SetHost((host_flag == "true") ? true : false);
u->SetSignature(signature);
u->SetSquadron(squadron);
@@ -641,7 +640,7 @@ NetLobbyClient::DoMissionList(NetPeer* peer, Text msg)
NetLobbyParam* p = params[i];
if (p->name == "c_id") {
- c = new(__FILE__,__LINE__) NetCampaignInfo;
+ c = new NetCampaignInfo;
sscanf_s(p->value, "0x%x", &c->id);
campaigns.append(c);
@@ -662,7 +661,7 @@ NetLobbyClient::DoMissionList(NetPeer* peer, Text msg)
for (int i = 0; i < campaigns.size(); i++) {
NetCampaignInfo* c = campaigns[i];
if (c->id == c_id) {
- m = new(__FILE__,__LINE__) MissionInfo;
+ m = new MissionInfo;
m->id = m_id;
c->missions.append(m);
missions.append(m); // for later garbage collection
@@ -776,7 +775,7 @@ NetLobbyClient::DoUnitList(NetPeer* peer, Text msg)
else if (p->name == "lock") {
sscanf_s(p->value, "%d", &lock);
- NetUnitEntry* entry = new(__FILE__,__LINE__) NetUnitEntry(elem_name, design, iff, index);
+ NetUnitEntry* entry = new NetUnitEntry(elem_name, design, iff, index);
entry->SetUserName(user_name);
entry->SetLives(lives);
entry->SetIntegrity(hull);
diff --git a/Stars45/NetLobbyDlg.cpp b/Stars45/NetLobbyDlg.cpp
index 729a76e..f878916 100644
--- a/Stars45/NetLobbyDlg.cpp
+++ b/Stars45/NetLobbyDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "NetLobbyDlg.h"
#include "NetUnitDlg.h"
#include "NetClientConfig.h"
@@ -127,7 +126,7 @@ NetLobbyDlg::Show()
if (!user) {
Player* player = Player::GetCurrentPlayer();
if (player) {
- user = new(__FILE__,__LINE__) NetUser(player);
+ user = new NetUser(player);
user->SetHost(true);
}
else {
diff --git a/Stars45/NetLobbyServer.cpp b/Stars45/NetLobbyServer.cpp
index 0520f96..b3060c5 100644
--- a/Stars45/NetLobbyServer.cpp
+++ b/Stars45/NetLobbyServer.cpp
@@ -11,7 +11,6 @@
NetLink Engine for Multiplayer Lobby
*/
-#include "MemDebug.h"
#include "NetLobbyServer.h"
#include "NetServerConfig.h"
#include "NetClientConfig.h"
@@ -71,7 +70,7 @@ NetLobbyServer::NetLobbyServer()
NetAuth::SetAuthLevel(server_config->GetAuthLevel());
server_addr = NetAddr(hostname.data(), server_port);
- link = new(__FILE__,__LINE__) NetLink(server_addr);
+ link = new NetLink(server_addr);
}
LoadMOTD();
@@ -81,7 +80,7 @@ NetLobbyServer::NetLobbyServer()
// only one mission:
if (star_server && server_mission.length() > 0) {
- NetCampaignInfo* c = new(__FILE__,__LINE__) NetCampaignInfo;
+ NetCampaignInfo* c = new NetCampaignInfo;
c->id = Campaign::MULTIPLAYER_MISSIONS;
c->name = "Persistent Multiplayer";
campaigns.append(c);
@@ -119,7 +118,7 @@ NetLobbyServer::NetLobbyServer()
Campaign* campaign = c_iter.value();
if (campaign->GetCampaignId() >= Campaign::MULTIPLAYER_MISSIONS) {
- NetCampaignInfo* c = new(__FILE__,__LINE__) NetCampaignInfo;
+ NetCampaignInfo* c = new NetCampaignInfo;
c->id = campaign->GetCampaignId();
c->name = campaign->Name();
campaigns.append(c);
@@ -187,7 +186,7 @@ NetLobbyServer::LoadMOTD()
while (n >= 0 && isspace(line[n]))
line[n--] = 0;
- motd.append(new(__FILE__,__LINE__) Text(line));
+ motd.append(new Text(line));
}
}
}
@@ -280,7 +279,7 @@ NetLobbyServer::ExecFrame()
NetCampaignInfo* c = campaigns.last();
if (!c || c->name != "Persistent Multiplayer") {
- c = new(__FILE__,__LINE__) NetCampaignInfo;
+ c = new NetCampaignInfo;
c->id = Campaign::MULTIPLAYER_MISSIONS;
c->name = "Persistent Multiplayer";
campaigns.append(c);
@@ -523,7 +522,7 @@ NetLobbyServer::AddChat(NetUser* user, const char* msg, bool route)
}
if (msg_ok) {
- entry = new(__FILE__,__LINE__) NetChatEntry(user, msg);
+ entry = new NetChatEntry(user, msg);
chat_log.append(entry);
@@ -629,7 +628,7 @@ NetLobbyServer::GetUnitMap()
if (elem->IsPlayable()) {
NetUnitEntry* u = 0;
if (elem->Count() == 1) {
- u = new(__FILE__,__LINE__) NetUnitEntry(elem, 0);
+ u = new NetUnitEntry(elem, 0);
u->SetLives(elem->RespawnCount() + 1);
u->SetMissionRole(elem->MissionRole());
u->SetIFF(elem->GetIFF());
@@ -645,7 +644,7 @@ NetLobbyServer::GetUnitMap()
}
else {
for (int i = 0; i < elem->Count(); i++) {
- u = new(__FILE__,__LINE__) NetUnitEntry(elem, i+1);
+ u = new NetUnitEntry(elem, i+1);
u->SetMissionRole(elem->MissionRole());
u->SetIFF(elem->GetIFF());
@@ -982,7 +981,7 @@ NetLobbyServer::DoLogin(NetPeer* peer, Text msg)
// otherwise, create a new user:
else {
- NetUser* user = new(__FILE__,__LINE__) NetUser(name);
+ NetUser* user = new NetUser(name);
user->SetAddress(peer->Address());
user->SetNetID(peer->NetID());
user->SetPass(pass);
diff --git a/Stars45/NetPacket.cpp b/Stars45/NetPacket.cpp
index 1f33a35..1056e11 100644
--- a/Stars45/NetPacket.cpp
+++ b/Stars45/NetPacket.cpp
@@ -11,7 +11,6 @@
Network Game Manager and Player classes
*/
-#include "MemDebug.h"
#include "NetPacket.h"
#include "NetLink.h"
#include "NetMsg.h"
@@ -51,7 +50,7 @@ NetPacket::NetPacket(DWORD netid, BYTE type)
default: len = JOIN_REQ_SIZE; break;
}
- msg = new(__FILE__,__LINE__) NetMsg(netid, type, buf, len);
+ msg = new NetMsg(netid, type, buf, len);
}
NetPacket::~NetPacket()
diff --git a/Stars45/NetPassDlg.cpp b/Stars45/NetPassDlg.cpp
index adf2052..d510dbd 100644
--- a/Stars45/NetPassDlg.cpp
+++ b/Stars45/NetPassDlg.cpp
@@ -11,7 +11,6 @@
Network Server Password Dialog Active Window class
*/
-#include "MemDebug.h"
#include "NetPassDlg.h"
#include "MenuScreen.h"
#include "NetClientConfig.h"
diff --git a/Stars45/NetPlayer.cpp b/Stars45/NetPlayer.cpp
index 96a83f7..9632b94 100644
--- a/Stars45/NetPlayer.cpp
+++ b/Stars45/NetPlayer.cpp
@@ -17,7 +17,6 @@
#include <algorithm>
-#include "MemDebug.h"
#include "NetPlayer.h"
#include "NetGame.h"
#include "NetMsg.h"
@@ -376,7 +375,7 @@ NetPlayer::DoCommMessage(NetCommMsg* comm_msg)
// radio traffic owns the sent message,
// so we must give it a cloned object that is
// safe to delete:
- traffic->SendMessage(new(__FILE__,__LINE__) RadioMessage(*radio_msg));
+ traffic->SendMessage(new RadioMessage(*radio_msg));
return true;
}
}
diff --git a/Stars45/NetServerConfig.cpp b/Stars45/NetServerConfig.cpp
index 84f39fa..bb4e235 100644
--- a/Stars45/NetServerConfig.cpp
+++ b/Stars45/NetServerConfig.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "NetServerConfig.h"
#include "NetUser.h"
@@ -68,7 +67,7 @@ void
NetServerConfig::Initialize()
{
if (!instance)
- instance = new(__FILE__,__LINE__) NetServerConfig();
+ instance = new NetServerConfig();
}
void
@@ -99,7 +98,7 @@ NetServerConfig::Load()
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -111,7 +110,7 @@ NetServerConfig::Load()
return;
}
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -310,7 +309,7 @@ NetServerConfig::Clean(const char* s)
if (!s || !*s) return Text();
int len = strlen(s);
- char* buff = new(__FILE__,__LINE__) char[len+1];
+ char* buff = new char[len+1];
ZeroMemory(buff, len+1);
char* p = buff;
@@ -349,7 +348,7 @@ NetServerConfig::LoadBanList()
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -361,7 +360,7 @@ NetServerConfig::LoadBanList()
return;
}
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -392,13 +391,13 @@ NetServerConfig::LoadBanList()
if (def->name()->value() == "name") {
Text name;
GetDefText(name, def, filename);
- banned_names.append(new(__FILE__,__LINE__) Text(name));
+ banned_names.append(new Text(name));
}
else if (def->name()->value() == "addr") {
DWORD addr;
GetDefNumber(addr, def, filename);
- banned_addrs.append(new(__FILE__,__LINE__) NetAddr(addr));
+ banned_addrs.append(new NetAddr(addr));
}
}
@@ -419,8 +418,8 @@ NetServerConfig::BanUser(NetUser* user)
if (!user || IsUserBanned(user))
return;
- NetAddr* user_addr = new(__FILE__,__LINE__) NetAddr(user->GetAddress().IPAddr());
- Text* user_name = new(__FILE__,__LINE__) Text(user->Name());
+ NetAddr* user_addr = new NetAddr(user->GetAddress().IPAddr());
+ Text* user_name = new Text(user->Name());
banned_addrs.append(user_addr);
banned_names.append(user_name);
diff --git a/Stars45/NetServerDlg.cpp b/Stars45/NetServerDlg.cpp
index 239ac1c..1729123 100644
--- a/Stars45/NetServerDlg.cpp
+++ b/Stars45/NetServerDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "NetServerDlg.h"
#include "NetServerConfig.h"
#include "MenuScreen.h"
diff --git a/Stars45/NetUnitDlg.cpp b/Stars45/NetUnitDlg.cpp
index 9499ad5..038c082 100644
--- a/Stars45/NetUnitDlg.cpp
+++ b/Stars45/NetUnitDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "NetUnitDlg.h"
#include "NetClientConfig.h"
#include "ConfirmDlg.h"
diff --git a/Stars45/NetUser.cpp b/Stars45/NetUser.cpp
index 55247c1..d8a8ba9 100644
--- a/Stars45/NetUser.cpp
+++ b/Stars45/NetUser.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetUser.h"
#include "NetAuth.h"
#include "NetLobby.h"
diff --git a/Stars45/NetUtil.cpp b/Stars45/NetUtil.cpp
index 22c44b7..4b3fb97 100644
--- a/Stars45/NetUtil.cpp
+++ b/Stars45/NetUtil.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "NetUtil.h"
#include "NetData.h"
#include "NetGame.h"
diff --git a/Stars45/OptDlg.cpp b/Stars45/OptDlg.cpp
index 4be133b..ddc01ad 100644
--- a/Stars45/OptDlg.cpp
+++ b/Stars45/OptDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "OptDlg.h"
#include "MenuScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/PCX.CPP b/Stars45/PCX.CPP
index 2337be2..b1d8656 100644
--- a/Stars45/PCX.CPP
+++ b/Stars45/PCX.CPP
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "Pcx.h"
#include <stdio.h>
@@ -108,7 +107,7 @@ PcxImage::PcxImage(short w, short h, unsigned char* bits, unsigned char* colors)
height = h;
imagebytes = width * height;
- bitmap = new(__FILE__,__LINE__) unsigned char [imagebytes];
+ bitmap = new unsigned char [imagebytes];
if (bitmap) {
for (unsigned long i = 0; i < imagebytes; i++)
@@ -201,7 +200,7 @@ PcxImage::PcxImage(short w, short h, unsigned long* hibits)
height = h;
imagebytes = width * height;
- himap = new(__FILE__,__LINE__) unsigned long [imagebytes];
+ himap = new unsigned long [imagebytes];
if (himap) {
for (unsigned long i = 0; i < imagebytes; i++)
@@ -249,7 +248,7 @@ int PcxImage::Load(char *filename)
delete [] himap; himap = 0;
delete [] bitmap; bitmap = 0;
- himap = new(__FILE__,__LINE__) unsigned long [imagebytes];
+ himap = new unsigned long [imagebytes];
if (himap == NULL)
return PCX_NOMEM;
@@ -288,7 +287,7 @@ int PcxImage::Load(char *filename)
delete [] himap; himap = 0;
delete [] bitmap; bitmap = 0;
- himap = new(__FILE__,__LINE__) unsigned long [imagebytes];
+ himap = new unsigned long [imagebytes];
if (himap == NULL)
return PCX_NOMEM;
@@ -356,7 +355,7 @@ int PcxImage::LoadBuffer(unsigned char* buf, int len)
delete [] himap; himap = 0;
delete [] bitmap; bitmap = 0;
- himap = new(__FILE__,__LINE__) unsigned long [imagebytes];
+ himap = new unsigned long [imagebytes];
if (himap == NULL)
return PCX_NOMEM;
@@ -394,7 +393,7 @@ int PcxImage::LoadBuffer(unsigned char* buf, int len)
delete [] himap; himap = 0;
delete [] bitmap; bitmap = 0;
- himap = new(__FILE__,__LINE__) unsigned long [imagebytes];
+ himap = new unsigned long [imagebytes];
if (himap == NULL)
return PCX_NOMEM;
diff --git a/Stars45/ParseUtil.cpp b/Stars45/ParseUtil.cpp
index f7d61bd..fd701d9 100644
--- a/Stars45/ParseUtil.cpp
+++ b/Stars45/ParseUtil.cpp
@@ -11,7 +11,6 @@
Parser utility functions
*/
-#include "MemDebug.h"
#include "ParseUtil.h"
#include "DataLoader.h"
diff --git a/Stars45/Parser.cpp b/Stars45/Parser.cpp
index b1c9ef5..09827cf 100644
--- a/Stars45/Parser.cpp
+++ b/Stars45/Parser.cpp
@@ -11,7 +11,6 @@
Implementation of the generic Parser class
*/
-#include "MemDebug.h"
#include "Reader.h"
#include "Token.h"
#include "Parser.h"
@@ -38,8 +37,8 @@ Term* error(char* msg, const Token& token)
Parser::Parser(Reader* r)
{
- reader = r ? r : new(__FILE__, __LINE__) ConsoleReader;
- lexer = new(__FILE__, __LINE__) Scanner(reader);
+ reader = r ? r : new ConsoleReader;
+ lexer = new Scanner(reader);
Token::addKey("true", KEY_TRUE);
Token::addKey("false", KEY_FALSE);
@@ -79,7 +78,7 @@ Parser::ParseTermRest(Term* base)
// concatenate adjacent string literal tokens:
TermText* text = base->isText();
if (text) {
- TermText* base2 = new(__FILE__, __LINE__) TermText(text->value() + t.symbol()(1, t.symbol().length()-2));
+ TermText* base2 = new TermText(text->value() + t.symbol()(1, t.symbol().length()-2));
delete base;
return ParseTermRest(base2);
}
@@ -93,7 +92,7 @@ Parser::ParseTermRest(Term* base)
switch (t.key()) {
case KEY_DEF:
if (base->isText())
- return new(__FILE__, __LINE__) TermDef(base->isText(), ParseTerm());
+ return new TermDef(base->isText(), ParseTerm());
else
return error("(Parse) illegal lhs in def", t);
@@ -153,7 +152,7 @@ Parser::ParseTermBase()
else
n = atol(nstr);
- return new(__FILE__, __LINE__) TermNumber(n);
+ return new TermNumber(n);
}
case Token::FloatLiteral: {
@@ -167,28 +166,28 @@ Parser::ParseTermBase()
*p++ = '\0';
d = atof(nstr);
- return new(__FILE__, __LINE__) TermNumber(d);
+ return new TermNumber(d);
}
case Token::StringLiteral:
if (dump_tokens)
Print("%s", t.symbol().data());
- return new(__FILE__, __LINE__) TermText(t.symbol()(1, t.symbol().length()-2));
+ return new TermText(t.symbol()(1, t.symbol().length()-2));
case Token::AlphaIdent:
if (dump_tokens)
Print("%s", t.symbol().data());
- return new(__FILE__, __LINE__) TermText(t.symbol());
+ return new TermText(t.symbol());
case Token::Keyword:
if (dump_tokens)
Print("%s", t.symbol().data());
switch (t.key()) {
- case KEY_FALSE: return new(__FILE__, __LINE__) TermBool(0);
- case KEY_TRUE: return new(__FILE__, __LINE__) TermBool(1);
+ case KEY_FALSE: return new TermBool(0);
+ case KEY_TRUE: return new TermBool(1);
case KEY_MINUS: {
Token next = lexer->Get();
@@ -203,7 +202,7 @@ Parser::ParseTermBase()
*p++ = '\0';
n = -1 * atol(nstr);
- return new(__FILE__, __LINE__) TermNumber(n);
+ return new TermNumber(n);
}
else if (next.type() == Token::FloatLiteral) {
if (dump_tokens)
@@ -216,7 +215,7 @@ Parser::ParseTermBase()
*p++ = '\0';
d = -1.0 * atof(nstr);
- return new(__FILE__, __LINE__) TermNumber(d);
+ return new TermNumber(d);
}
else {
lexer->PutBack();
@@ -252,7 +251,7 @@ Parser::ParseArray()
if (end.type() != Token::RParen)
return (TermArray*) error("(Parse) ')' missing in array-decl", end);
- return new(__FILE__, __LINE__) TermArray(elems);
+ return new TermArray(elems);
}
TermStruct*
@@ -264,13 +263,13 @@ Parser::ParseStruct()
if (end.type() != Token::RBrace)
return (TermStruct*) error("(Parse) '}' missing in struct", end);
- return new(__FILE__, __LINE__) TermStruct(elems);
+ return new TermStruct(elems);
}
TermList*
Parser::ParseTermList(int for_struct)
{
- TermList* tlist = new(__FILE__, __LINE__) TermList;
+ TermList* tlist = new TermList;
Term* term = ParseTerm();
while (term) {
diff --git a/Stars45/Particles.cpp b/Stars45/Particles.cpp
index 436f568..911b06f 100644
--- a/Stars45/Particles.cpp
+++ b/Stars45/Particles.cpp
@@ -11,7 +11,6 @@
Particle Burst class
*/
-#include "MemDebug.h"
#include "Particles.h"
#include "Projector.h"
#include "Light.h"
@@ -44,14 +43,14 @@ blend(a), extra(0.0f), point_sprite(0), emitting(true)
if (max_scale < min_scale)
max_scale = min_scale;
- velocity = new(__FILE__,__LINE__) Point[nverts];
- part_loc = new(__FILE__,__LINE__) Point[nverts];
- release = new(__FILE__,__LINE__) Point[nverts];
- intensity = new(__FILE__,__LINE__) float[nverts];
- timestamp = new(__FILE__,__LINE__) float[nverts];
- scale = new(__FILE__,__LINE__) float[nverts];
- angle = new(__FILE__,__LINE__) float[nverts];
- frame = new(__FILE__,__LINE__) BYTE[nverts];
+ velocity = new Point[nverts];
+ part_loc = new Point[nverts];
+ release = new Point[nverts];
+ intensity = new float[nverts];
+ timestamp = new float[nverts];
+ scale = new float[nverts];
+ angle = new float[nverts];
+ frame = new BYTE[nverts];
float speed = base_speed;
@@ -86,7 +85,7 @@ blend(a), extra(0.0f), point_sprite(0), emitting(true)
nverts = (int) (nparts * 0.125 * release_rate);
}
- point_sprite = new(__FILE__,__LINE__) Sprite(bitmap, nframes);
+ point_sprite = new Sprite(bitmap, nframes);
point_sprite->Scale(s);
point_sprite->SetBlendMode(blend);
point_sprite->SetFrameRate(nframes * decay);
diff --git a/Stars45/Physical.cpp b/Stars45/Physical.cpp
index 28cac6d..6c2e90e 100644
--- a/Stars45/Physical.cpp
+++ b/Stars45/Physical.cpp
@@ -11,7 +11,6 @@
Abstract Physical Object
*/
-#include "MemDebug.h"
#include "Physical.h"
#include "Graphic.h"
#include "Light.h"
diff --git a/Stars45/PlanScreen.cpp b/Stars45/PlanScreen.cpp
index f613877..e560be4 100644
--- a/Stars45/PlanScreen.cpp
+++ b/Stars45/PlanScreen.cpp
@@ -7,7 +7,6 @@
*/
-#include "MemDebug.h"
#include "PlanScreen.h"
#include "FormDef.h"
#include "MsnObjDlg.h"
@@ -65,27 +64,27 @@ PlanScreen::Setup(Screen* s)
FormDef msn_obj_def("MsnObjDlg", 0);
msn_obj_def.Load("MsnObjDlg");
- objdlg = new(__FILE__,__LINE__) MsnObjDlg(screen, msn_obj_def, this);
+ objdlg = new MsnObjDlg(screen, msn_obj_def, this);
FormDef msn_pkg_def("MsnPkgDlg", 0);
msn_pkg_def.Load("MsnPkgDlg");
- pkgdlg = new(__FILE__,__LINE__) MsnPkgDlg(screen, msn_pkg_def, this);
+ pkgdlg = new MsnPkgDlg(screen, msn_pkg_def, this);
FormDef msn_nav_def("MsnNavDlg", 0);
msn_nav_def.Load("MsnNavDlg");
- navdlg = new(__FILE__,__LINE__) MsnNavDlg(screen, msn_nav_def, this);
+ navdlg = new MsnNavDlg(screen, msn_nav_def, this);
FormDef msn_wep_def("MsnWepDlg", 0);
msn_wep_def.Load("MsnWepDlg");
- wepdlg = new(__FILE__,__LINE__) MsnWepDlg(screen, msn_wep_def, this);
+ wepdlg = new MsnWepDlg(screen, msn_wep_def, this);
FormDef award_def("AwardDlg", 0);
award_def.Load("AwardDlg");
- award_dlg = new(__FILE__,__LINE__) AwardDlg(screen, award_def, this);
+ award_dlg = new AwardDlg(screen, award_def, this);
FormDef debrief_def("DebriefDlg", 0);
debrief_def.Load("DebriefDlg");
- debrief_dlg = new(__FILE__,__LINE__) DebriefDlg(screen, debrief_def, this);
+ debrief_dlg = new DebriefDlg(screen, debrief_def, this);
loader->UseFileSystem(Starshatter::UseFileSystem());
ShowMsnDlg();
diff --git a/Stars45/Player.cpp b/Stars45/Player.cpp
index 8639187..bb4a6d3 100644
--- a/Stars45/Player.cpp
+++ b/Stars45/Player.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "Player.h"
#include "NetLobbyServer.h"
#include "NetLayer.h"
@@ -858,7 +857,7 @@ Player::Create(const char* name)
if (Find(name))
return 0;
- Player* newbie = new(__FILE__,__LINE__) Player(name);
+ Player* newbie = new Player(name);
newbie->SetCreateDate(NetLayer::GetUTC());
player_roster.append(newbie);
@@ -953,7 +952,7 @@ Player::Load()
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -963,7 +962,7 @@ Player::Load()
if (blocklen == 0)
return;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -997,7 +996,7 @@ Player::Load()
Print("WARNING: player structure missing in '%s'\n", filename);
}
else {
- Player* player = new(__FILE__,__LINE__) Player;
+ Player* player = new Player;
bool current = false;
TermStruct* val = def->term()->isStruct();
@@ -1341,7 +1340,7 @@ Player::LoadAwardTables()
loader->SetDataPath("Awards/");
loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -1373,7 +1372,7 @@ Player::LoadAwardTables()
Print("WARNING: award structure missing in '%s'\n", filename);
}
else {
- AwardInfo* award = new(__FILE__,__LINE__) AwardInfo;
+ AwardInfo* award = new AwardInfo;
TermStruct* val = def->term()->isStruct();
for (int i = 0; i < val->elements()->size(); i++) {
diff --git a/Stars45/PlayerDlg.cpp b/Stars45/PlayerDlg.cpp
index 0ea6d18..e69a515 100644
--- a/Stars45/PlayerDlg.cpp
+++ b/Stars45/PlayerDlg.cpp
@@ -11,7 +11,6 @@
Main Menu Dialog Active Window class
*/
-#include "MemDebug.h"
#include "PlayerDlg.h"
#include "AwardShowDlg.h"
#include "ConfirmDlg.h"
diff --git a/Stars45/PngImage.cpp b/Stars45/PngImage.cpp
index b1c4c81..d8f1244 100644
--- a/Stars45/PngImage.cpp
+++ b/Stars45/PngImage.cpp
@@ -12,13 +12,14 @@
*/
-#include "MemDebug.h"
#include "PngImage.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "Types.h"
+
// Needed for compatibility with libpng 1.4++
#define png_infopp_NULL (png_infopp)NULL
#define png_voidp_NULL (png_voidp)NULL
diff --git a/Stars45/PngImage.h b/Stars45/PngImage.h
index 4bd11cf..f712461 100644
--- a/Stars45/PngImage.h
+++ b/Stars45/PngImage.h
@@ -16,6 +16,8 @@
#include "png.h"
+#include "Types.h"
+
// +--------------------------------------------------------------------+
enum { PNG_OK, PNG_NOMEM, PNG_INVALID, PNG_NOFILE };
diff --git a/Stars45/Polygon.cpp b/Stars45/Polygon.cpp
index 8ff154a..d3e3b27 100644
--- a/Stars45/Polygon.cpp
+++ b/Stars45/Polygon.cpp
@@ -11,7 +11,6 @@
Polygon and VertexSet structures for 3D rendering
*/
-#include "MemDebug.h"
#include "Polygon.h"
#include "Bitmap.h"
@@ -48,14 +47,14 @@ VertexSet::Resize(int m, bool preserve)
}
else {
- loc = new(__FILE__,__LINE__) Vec3[nverts];
- nrm = new(__FILE__,__LINE__) Vec3[nverts];
- s_loc = new(__FILE__,__LINE__) Vec3[nverts];
- tu = new(__FILE__,__LINE__) float[nverts];
- tv = new(__FILE__,__LINE__) float[nverts];
- rw = new(__FILE__,__LINE__) float[nverts];
- diffuse = new(__FILE__,__LINE__) DWORD[nverts];
- specular = new(__FILE__,__LINE__) DWORD[nverts];
+ loc = new Vec3[nverts];
+ nrm = new Vec3[nverts];
+ s_loc = new Vec3[nverts];
+ tu = new float[nverts];
+ tv = new float[nverts];
+ rw = new float[nverts];
+ diffuse = new DWORD[nverts];
+ specular = new DWORD[nverts];
if (additional_tex_coords)
CreateAdditionalTexCoords();
@@ -88,22 +87,22 @@ VertexSet::Resize(int m, bool preserve)
if (nverts < np)
np = nverts;
- Vec3* new_loc = new(__FILE__,__LINE__) Vec3[nverts];
- Vec3* new_nrm = new(__FILE__,__LINE__) Vec3[nverts];
- Vec3* new_s_loc = new(__FILE__,__LINE__) Vec3[nverts];
- float* new_rw = new(__FILE__,__LINE__) float[nverts];
- float* new_tu = new(__FILE__,__LINE__) float[nverts];
- float* new_tv = new(__FILE__,__LINE__) float[nverts];
+ Vec3* new_loc = new Vec3[nverts];
+ Vec3* new_nrm = new Vec3[nverts];
+ Vec3* new_s_loc = new Vec3[nverts];
+ float* new_rw = new float[nverts];
+ float* new_tu = new float[nverts];
+ float* new_tv = new float[nverts];
float* new_tu1 = 0;
float* new_tv1 = 0;
- DWORD* new_diffuse = new(__FILE__,__LINE__) DWORD[nverts];
- DWORD* new_specular = new(__FILE__,__LINE__) DWORD[nverts];
+ DWORD* new_diffuse = new DWORD[nverts];
+ DWORD* new_specular = new DWORD[nverts];
if (tu1)
- new_tu1 = new(__FILE__,__LINE__) float[nverts];
+ new_tu1 = new float[nverts];
if (tv1)
- new_tv1 = new(__FILE__,__LINE__) float[nverts];
+ new_tv1 = new float[nverts];
if (new_loc) {
CopyMemory(new_loc, loc, np * sizeof(Vec3));
@@ -231,8 +230,8 @@ VertexSet::CreateTangents()
binormal = 0;
if (nverts) {
- tangent = new(__FILE__,__LINE__) Vec3[nverts];
- binormal = new(__FILE__,__LINE__) Vec3[nverts];
+ tangent = new Vec3[nverts];
+ binormal = new Vec3[nverts];
}
}
@@ -248,8 +247,8 @@ VertexSet::CreateAdditionalTexCoords()
tv1 = 0;
if (nverts) {
- tu1 = new(__FILE__,__LINE__) float[nverts];
- tv1 = new(__FILE__,__LINE__) float[nverts];
+ tu1 = new float[nverts];
+ tv1 = new float[nverts];
}
}
@@ -288,7 +287,7 @@ VertexSet::CopyVertex(int dst, int src)
VertexSet*
VertexSet::Clone() const
{
- VertexSet* result = new(__FILE__,__LINE__) VertexSet(nverts);
+ VertexSet* result = new VertexSet(nverts);
CopyMemory(result->loc, loc, nverts * sizeof(Vec3));
CopyMemory(result->nrm, nrm, nverts * sizeof(Vec3));
@@ -301,28 +300,28 @@ VertexSet::Clone() const
if (tu1) {
if (!result->tu1)
- result->tu1 = new(__FILE__,__LINE__) float[nverts];
+ result->tu1 = new float[nverts];
CopyMemory(result->tu1, tu1, nverts * sizeof(float));
}
if (tv1) {
if (!result->tv1)
- result->tv1 = new(__FILE__,__LINE__) float[nverts];
+ result->tv1 = new float[nverts];
CopyMemory(result->tv1, tv1, nverts * sizeof(float));
}
if (tangent) {
if (!result->tangent)
- result->tangent = new(__FILE__,__LINE__) Vec3[nverts];
+ result->tangent = new Vec3[nverts];
CopyMemory(result->tangent, tangent, nverts * sizeof(Vec3));
}
if (binormal) {
if (!result->binormal)
- result->binormal = new(__FILE__,__LINE__) Vec3[nverts];
+ result->binormal = new Vec3[nverts];
CopyMemory(result->binormal, binormal, nverts * sizeof(Vec3));
}
@@ -597,7 +596,7 @@ void
Material::CreateThumbnail(int size)
{
if (!thumbnail) {
- thumbnail = new(__FILE__,__LINE__) Bitmap(size, size);
+ thumbnail = new Bitmap(size, size);
}
if (!thumbnail || thumbnail->Width() != thumbnail->Height())
@@ -605,7 +604,7 @@ Material::CreateThumbnail(int size)
size = thumbnail->Width();
- DWORD* image = new(__FILE__,__LINE__) DWORD[size*size];
+ DWORD* image = new DWORD[size*size];
DWORD* dst = image;
for (int j = 0; j < size; j++) {
diff --git a/Stars45/Power.cpp b/Stars45/Power.cpp
index e3dfebe..f86c5af 100644
--- a/Stars45/Power.cpp
+++ b/Stars45/Power.cpp
@@ -11,7 +11,6 @@
Power generation and usage classes
*/
-#include "MemDebug.h"
#include "Power.h"
#include "Ship.h"
#include "NetUtil.h"
diff --git a/Stars45/Projector.cpp b/Stars45/Projector.cpp
index 8396d48..afa456e 100644
--- a/Stars45/Projector.cpp
+++ b/Stars45/Projector.cpp
@@ -17,7 +17,6 @@
#include <algorithm>
-#include "MemDebug.h"
#include "Projector.h"
#include "Utils.h"
diff --git a/Stars45/QuantumDrive.cpp b/Stars45/QuantumDrive.cpp
index a6785d2..bcc8356 100644
--- a/Stars45/QuantumDrive.cpp
+++ b/Stars45/QuantumDrive.cpp
@@ -11,7 +11,6 @@
Quantum Drive class
*/
-#include "MemDebug.h"
#include "QuantumDrive.h"
#include "Ship.h"
#include "Explosion.h"
diff --git a/Stars45/QuantumFlash.cpp b/Stars45/QuantumFlash.cpp
index a8afebb..34d2764 100644
--- a/Stars45/QuantumFlash.cpp
+++ b/Stars45/QuantumFlash.cpp
@@ -11,7 +11,6 @@
Quantum Warp Out special effect class
*/
-#include "MemDebug.h"
#include "QuantumFlash.h"
#include "Light.h"
@@ -45,10 +44,10 @@ shade(1.0)
loc = Vec3(0.0f, 0.0f, 1000.0f);
- mtl = new(__FILE__,__LINE__) Material;
- verts = new(__FILE__,__LINE__) VertexSet(nverts);
- polys = new(__FILE__,__LINE__) Poly[npolys];
- beams = new(__FILE__,__LINE__) Matrix[npolys];
+ mtl = new Material;
+ verts = new VertexSet(nverts);
+ polys = new Poly[npolys];
+ beams = new Matrix[npolys];
mtl->Kd = Color::White;
mtl->tex_diffuse = texture;
diff --git a/Stars45/QuantumView.cpp b/Stars45/QuantumView.cpp
index fa2905d..c3ab4f4 100644
--- a/Stars45/QuantumView.cpp
+++ b/Stars45/QuantumView.cpp
@@ -11,7 +11,6 @@
View class for Quantum Destination HUD Overlay
*/
-#include "MemDebug.h"
#include "QuantumView.h"
#include "QuantumDrive.h"
#include "HUDView.h"
@@ -51,7 +50,7 @@ QuantumView::Initialize()
static int initialized = 0;
if (initialized) return;
- quantum_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("QuantumView.menu"));
+ quantum_menu = new Menu(ContentBundle::GetInstance()->GetText("QuantumView.menu"));
initialized = 1;
}
diff --git a/Stars45/QuitView.cpp b/Stars45/QuitView.cpp
index f0af6a3..90b90ab 100644
--- a/Stars45/QuitView.cpp
+++ b/Stars45/QuitView.cpp
@@ -11,7 +11,6 @@
View class for End Mission menu
*/
-#include "MemDebug.h"
#include "QuitView.h"
#include "HUDView.h"
#include "RadioView.h"
@@ -53,7 +52,7 @@ void
QuitView::Initialize()
{
if (!menu_bmp) {
- menu_bmp = new(__FILE__,__LINE__) Bitmap;
+ menu_bmp = new Bitmap;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Screens/");
diff --git a/Stars45/RLoc.cpp b/Stars45/RLoc.cpp
index 35e888a..911c4ea 100644
--- a/Stars45/RLoc.cpp
+++ b/Stars45/RLoc.cpp
@@ -11,7 +11,6 @@
Navigation Point class implementation
*/
-#include "MemDebug.h"
#include "RLoc.h"
#include "Random.h"
diff --git a/Stars45/RadioHandler.cpp b/Stars45/RadioHandler.cpp
index 00dadce..b395c6e 100644
--- a/Stars45/RadioHandler.cpp
+++ b/Stars45/RadioHandler.cpp
@@ -11,7 +11,6 @@
Radio message handler class implementation
*/
-#include "MemDebug.h"
#include "RadioHandler.h"
#include "RadioMessage.h"
#include "RadioTraffic.h"
@@ -57,7 +56,7 @@ RadioHandler::ProcessMessage(RadioMessage* msg, Ship* s)
if (msg->Sender()->IsRogue()) {
Ship* sender = (Ship*) msg->Sender(); // cast-away const
- RadioMessage* nak = new(__FILE__,__LINE__) RadioMessage(sender, s, RadioMessage::NACK);
+ RadioMessage* nak = new RadioMessage(sender, s, RadioMessage::NACK);
RadioTraffic::Transmit(nak);
return false;
}
@@ -392,7 +391,7 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship)
// if no space (or not a carrier!) wave sender off:
if (!deck || !same_rgn || squadron < 0 || slot < 0) {
- RadioMessage* wave_off = new(__FILE__,__LINE__) RadioMessage(inbound, ship, RadioMessage::NACK);
+ RadioMessage* wave_off = new RadioMessage(inbound, ship, RadioMessage::NACK);
if (!hangar)
wave_off->SetInfo(ContentBundle::GetInstance()->GetText("RadioHandler.no-hangar"));
@@ -414,7 +413,7 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship)
int sequence = 0;
if (!inbound_slot) {
- inbound_slot = new(__FILE__,__LINE__) InboundSlot(inbound, deck, squadron, slot);
+ inbound_slot = new InboundSlot(inbound, deck, squadron, slot);
sequence = deck->Inbound(inbound_slot);
}
else {
@@ -422,7 +421,7 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship)
}
// inform sender of status:
- RadioMessage* approach = new(__FILE__,__LINE__) RadioMessage(inbound, ship, RadioMessage::CALL_APPROACH);
+ RadioMessage* approach = new RadioMessage(inbound, ship, RadioMessage::CALL_APPROACH);
if (inbound_slot->Cleared()) {
char info[256];
@@ -468,7 +467,7 @@ RadioHandler::Picture(RadioMessage* msg, Ship* ship)
if (tgt) {
Element* sender = msg->Sender()->GetElement();
Element* tgt_elem = tgt->GetElement();
- RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::ATTACK);
+ RadioMessage* response = new RadioMessage(sender, ship, RadioMessage::ATTACK);
if (tgt_elem) {
for (int i = 1; i <= tgt_elem->NumShips(); i++)
@@ -484,7 +483,7 @@ RadioHandler::Picture(RadioMessage* msg, Ship* ship)
// nobody worth killin':
else {
Ship* sender = (Ship*) msg->Sender(); // cast-away const
- RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::PICTURE);
+ RadioMessage* response = new RadioMessage(sender, ship, RadioMessage::PICTURE);
RadioTraffic::Transmit(response);
}
@@ -518,13 +517,13 @@ RadioHandler::Support(RadioMessage* msg, Ship* ship)
// found some:
if (help) {
- RadioMessage* escort = new(__FILE__,__LINE__) RadioMessage(help, ship, RadioMessage::ESCORT);
+ RadioMessage* escort = new RadioMessage(help, ship, RadioMessage::ESCORT);
escort->TargetList().append(msg->Sender());
RadioTraffic::Transmit(escort);
Text ok = ContentBundle::GetInstance()->GetText("RadioHandler.help-enroute");
Ship* sender = (Ship*) msg->Sender(); // cast-away const
- RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::ACK);
+ RadioMessage* response = new RadioMessage(sender, ship, RadioMessage::ACK);
response->SetInfo(ok);
RadioTraffic::Transmit(response);
}
@@ -533,7 +532,7 @@ RadioHandler::Support(RadioMessage* msg, Ship* ship)
else {
Text nope = ContentBundle::GetInstance()->GetText("RadioHandler.no-help-for-you");
Ship* sender = (Ship*) msg->Sender(); // cast-away const
- RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::NACK);
+ RadioMessage* response = new RadioMessage(sender, ship, RadioMessage::NACK);
response->SetInfo(nope);
RadioTraffic::Transmit(response);
}
@@ -551,7 +550,7 @@ RadioHandler::AcknowledgeMessage(RadioMessage* msg, Ship* s)
return; // nothing to say here
Ship* sender = (Ship*) msg->Sender(); // cast-away const
- RadioMessage* ack = new(__FILE__,__LINE__) RadioMessage(sender, s, RadioMessage::ACK);
+ RadioMessage* ack = new RadioMessage(sender, s, RadioMessage::ACK);
RadioTraffic::Transmit(ack);
}
}
diff --git a/Stars45/RadioMessage.cpp b/Stars45/RadioMessage.cpp
index a9f0adf..ecf3e04 100644
--- a/Stars45/RadioMessage.cpp
+++ b/Stars45/RadioMessage.cpp
@@ -11,7 +11,6 @@
Radio communication message class implementation
*/
-#include "MemDebug.h"
#include "RadioMessage.h"
#include "Ship.h"
#include "Text.h"
diff --git a/Stars45/RadioTraffic.cpp b/Stars45/RadioTraffic.cpp
index 782885c..a67cd9f 100644
--- a/Stars45/RadioTraffic.cpp
+++ b/Stars45/RadioTraffic.cpp
@@ -11,7 +11,6 @@
Radio message handler class implementation
*/
-#include "MemDebug.h"
#include "RadioTraffic.h"
#include "RadioMessage.h"
#include "RadioView.h"
@@ -50,7 +49,7 @@ void
RadioTraffic::Initialize()
{
if (!radio_traffic)
- radio_traffic = new(__FILE__,__LINE__) RadioTraffic;
+ radio_traffic = new RadioTraffic;
}
void
@@ -74,16 +73,16 @@ RadioTraffic::SendQuickMessage(Ship* ship, int action)
Ship* controller = ship->GetController();
if (controller && !ship->IsStarship()) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(controller, ship, action);
+ RadioMessage* msg = new RadioMessage(controller, ship, action);
Transmit(msg);
}
}
else if (action >= RadioMessage::SPLASH_1 && action <= RadioMessage::DISTRESS) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage((Element*) 0, ship, action);
+ RadioMessage* msg = new RadioMessage((Element*) 0, ship, action);
Transmit(msg);
}
else {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, action);
+ RadioMessage* msg = new RadioMessage(elem, ship, action);
if (action == RadioMessage::ATTACK || action == RadioMessage::ESCORT)
msg->AddTarget(ship->GetTarget());
@@ -369,7 +368,7 @@ RadioTraffic::DisplayMessage(RadioMessage* msg)
// vox:
const char* path[8] = { "1", "1", "2", "3", "4", "5", "6", "7" };
- RadioVox* vox = new(__FILE__,__LINE__) RadioVox(vox_channel, path[vox_channel], txt_buf);
+ RadioVox* vox = new RadioVox(vox_channel, path[vox_channel], txt_buf);
if (vox) {
vox->AddPhrase(dst_buf);
diff --git a/Stars45/RadioView.cpp b/Stars45/RadioView.cpp
index 43d4fff..ca30092 100644
--- a/Stars45/RadioView.cpp
+++ b/Stars45/RadioView.cpp
@@ -11,7 +11,6 @@
View class for Radio Communications HUD Overlay
*/
-#include "MemDebug.h"
#include "RadioView.h"
#include "RadioMessage.h"
#include "RadioTraffic.h"
@@ -68,59 +67,59 @@ RadioView::Initialize()
static int initialized = 0;
if (initialized) return;
- target_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.TARGET"));
+ target_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.TARGET"));
target_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.attack"), RadioMessage::ATTACK);
target_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.bracket"), RadioMessage::BRACKET);
target_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.escort"), RadioMessage::ESCORT);
- combat_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.COMBAT"));
+ combat_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.COMBAT"));
combat_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.cover"), RadioMessage::COVER_ME);
combat_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.break-attack"), RadioMessage::WEP_FREE);
combat_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.form-up"), RadioMessage::FORM_UP);
- formation_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.FORMATION"));
+ formation_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.FORMATION"));
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.diamond"), RadioMessage::GO_DIAMOND);
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.spread"), RadioMessage::GO_SPREAD);
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.box"), RadioMessage::GO_BOX);
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.trail"), RadioMessage::GO_TRAIL);
- sensors_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.SENSORS"));
+ sensors_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.SENSORS"));
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.emcon-1"), RadioMessage::GO_EMCON1);
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.emcon-2"), RadioMessage::GO_EMCON2);
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.emcon-3"), RadioMessage::GO_EMCON3);
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.probe"), RadioMessage::LAUNCH_PROBE);
- mission_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.MISSION"));
+ mission_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.MISSION"));
mission_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.skip-navpt"), RadioMessage::SKIP_NAVPOINT);
mission_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.resume"), RadioMessage::RESUME_MISSION);
mission_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.rtb"), RadioMessage::RTB);
- wing_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.WINGMAN"));
+ wing_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.WINGMAN"));
wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.target"), target_menu);
wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.combat"), combat_menu);
wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.formation"), formation_menu);
wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.mission"), mission_menu);
wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu);
- elem_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.ELEMENT"));
+ elem_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.ELEMENT"));
elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.target"), target_menu);
elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.combat"), combat_menu);
elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.formation"), formation_menu);
elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.mission"), mission_menu);
elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu);
- control_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.CONTROL"));
+ control_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.CONTROL"));
control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.picture"), RadioMessage::REQUEST_PICTURE);
control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.backup"), RadioMessage::REQUEST_SUPPORT);
control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.call-inbound"), RadioMessage::CALL_INBOUND);
control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.call-finals"), RadioMessage::CALL_FINALS);
- fighter_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.RADIO"));
+ fighter_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.RADIO"));
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.wingman"), wing_menu);
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.element"), elem_menu);
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.control"), control_menu);
- starship_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.RADIO"));
+ starship_menu = new Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.RADIO"));
initialized = 1;
}
@@ -361,7 +360,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
// check destination:
if (dst_elem) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(dst_elem, ship, item->GetData());
+ RadioMessage* msg = new RadioMessage(dst_elem, ship, item->GetData());
if (TargetRequired(item))
msg->AddTarget(ship->GetTarget());
@@ -384,7 +383,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
if (wing) {
Ship* dst = elem->GetShip(wing);
if (dst) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(dst, ship, item->GetData());
+ RadioMessage* msg = new RadioMessage(dst, ship, item->GetData());
if (TargetRequired(item))
msg->AddTarget(ship->GetTarget());
@@ -395,7 +394,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
}
else if (history.Find(ContentBundle::GetInstance()->GetText("RadioView.menu.ELEMENT"))) { // element menu
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, item->GetData());
+ RadioMessage* msg = new RadioMessage(elem, ship, item->GetData());
if (TargetRequired(item))
msg->AddTarget(ship->GetTarget());
@@ -408,7 +407,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
Ship* controller = ship->GetController();
if (controller) {
- msg = new(__FILE__,__LINE__) RadioMessage(controller, ship, item->GetData());
+ msg = new RadioMessage(controller, ship, item->GetData());
RadioTraffic::Transmit(msg);
}
}
diff --git a/Stars45/RadioVox.cpp b/Stars45/RadioVox.cpp
index 59340a4..2131aae 100644
--- a/Stars45/RadioVox.cpp
+++ b/Stars45/RadioVox.cpp
@@ -11,7 +11,6 @@
View class for Radio Communications HUD Overlay
*/
-#include "MemDebug.h"
#include "RadioVox.h"
#include "RadioView.h"
#include "AudioConfig.h"
@@ -136,7 +135,7 @@ void
RadioVox::Initialize()
{
if (!controller) {
- controller = new(__FILE__,__LINE__) RadioVoxController;
+ controller = new RadioVoxController;
}
}
diff --git a/Stars45/Random.cpp b/Stars45/Random.cpp
index f769823..18f6031 100644
--- a/Stars45/Random.cpp
+++ b/Stars45/Random.cpp
@@ -11,7 +11,6 @@
Utility functions for generating random numbers and locations.
*/
-#include "MemDebug.h"
#include "Random.h"
// +----------------------------------------------------------------------+
diff --git a/Stars45/Reader.cpp b/Stars45/Reader.cpp
index 07f4e7a..682627d 100644
--- a/Stars45/Reader.cpp
+++ b/Stars45/Reader.cpp
@@ -11,7 +11,6 @@
Implementation of the Reader class
*/
-#include "MemDebug.h"
#include "Reader.h"
#include <stdio.h>
#include <fstream>
diff --git a/Stars45/Res.cpp b/Stars45/Res.cpp
index 713bed2..f6a160e 100644
--- a/Stars45/Res.cpp
+++ b/Stars45/Res.cpp
@@ -11,7 +11,6 @@
Abstract Resource class
*/
-#include "MemDebug.h"
#include "Res.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/RichTextBox.cpp b/Stars45/RichTextBox.cpp
index ff4ec77..fe64f0d 100644
--- a/Stars45/RichTextBox.cpp
+++ b/Stars45/RichTextBox.cpp
@@ -11,7 +11,6 @@
Window class
*/
-#include "MemDebug.h"
#include "RichTextBox.h"
#include "EventDispatch.h"
#include "Color.h"
diff --git a/Stars45/Scene.cpp b/Stars45/Scene.cpp
index 5fc4f19..4f977f4 100644
--- a/Stars45/Scene.cpp
+++ b/Stars45/Scene.cpp
@@ -11,7 +11,6 @@
A 3D Scene
*/
-#include "MemDebug.h"
#include "Scene.h"
#include "Graphic.h"
#include "Light.h"
diff --git a/Stars45/Screen.cpp b/Stars45/Screen.cpp
index 2d87307..36dd577 100644
--- a/Stars45/Screen.cpp
+++ b/Stars45/Screen.cpp
@@ -11,7 +11,6 @@
General Screen class - maintains and displays a list of windows
*/
-#include "MemDebug.h"
#include "Screen.h"
#include "Bitmap.h"
#include "Color.h"
diff --git a/Stars45/ScrollWindow.cpp b/Stars45/ScrollWindow.cpp
index a7d9a41..6425ff8 100644
--- a/Stars45/ScrollWindow.cpp
+++ b/Stars45/ScrollWindow.cpp
@@ -11,7 +11,6 @@
ScrollWindow ActiveWindow class
*/
-#include "MemDebug.h"
#include "ScrollWindow.h"
#include "Button.h"
#include "Bitmap.h"
diff --git a/Stars45/SeekerAI.cpp b/Stars45/SeekerAI.cpp
index cc6c253..7976dfd 100644
--- a/Stars45/SeekerAI.cpp
+++ b/Stars45/SeekerAI.cpp
@@ -11,7 +11,6 @@
Seeker Missile (low-level) Artificial Intelligence class
*/
-#include "MemDebug.h"
#include "SeekerAI.h"
#include "Ship.h"
#include "Shot.h"
diff --git a/Stars45/Sensor.cpp b/Stars45/Sensor.cpp
index 3a0f15e..e5a4932 100644
--- a/Stars45/Sensor.cpp
+++ b/Stars45/Sensor.cpp
@@ -11,7 +11,6 @@
Integrated (Passive and Active) Sensor Package class implementation
*/
-#include "MemDebug.h"
#include "Sensor.h"
#include "Contact.h"
#include "Element.h"
@@ -207,7 +206,7 @@ Sensor::ExecFrame(double seconds)
Contact* c = FindContact(c_ship);
if (!c) {
- c = new(__FILE__,__LINE__) Contact(c_ship, 0.0f, 0.0f);
+ c = new Contact(c_ship, 0.0f, 0.0f);
contacts.append(c);
}
@@ -267,7 +266,7 @@ Sensor::ExecFrame(double seconds)
if (c_ship) {
if (!t) {
- Contact* track = new(__FILE__,__LINE__) Contact(c_ship, contact->d_pas, contact->d_act);
+ Contact* track = new Contact(c_ship, contact->d_pas, contact->d_act);
track->loc = c_ship->Location();
track_list.append(track);
}
@@ -281,7 +280,7 @@ Sensor::ExecFrame(double seconds)
else if (c_shot) {
if (!t) {
- Contact* track = new(__FILE__,__LINE__) Contact(c_shot, contact->d_pas, contact->d_act);
+ Contact* track = new Contact(c_shot, contact->d_pas, contact->d_act);
track->loc = c_shot->Location();
track_list.append(track);
}
@@ -435,7 +434,7 @@ Sensor::ProcessContact(Ship* c_ship, double az1, double az2)
Contact* c = FindContact(c_ship);
if (!c) {
- c = new(__FILE__,__LINE__) Contact(c_ship, 0.0f, 0.0f);
+ c = new Contact(c_ship, 0.0f, 0.0f);
contacts.append(c);
}
@@ -515,7 +514,7 @@ Sensor::ProcessContact(Shot* c_shot, double az1, double az2)
Contact* c = FindContact(c_shot);
if (!c) {
- c = new(__FILE__,__LINE__) Contact(c_shot, 0.0f, 0.0f);
+ c = new Contact(c_shot, 0.0f, 0.0f);
contacts.append(c);
}
@@ -642,7 +641,7 @@ Sensor::LockTarget(int type, bool closest, bool hostile)
if (hostile && (contact->GetIFF(ship) == 0 || contact->GetIFF(ship) == ship->GetIFF()))
continue;
- targets.append(new(__FILE__,__LINE__) TargetOffset(test, tgt_range));
+ targets.append(new TargetOffset(test, tgt_range));
}
// clip:
@@ -654,7 +653,7 @@ Sensor::LockTarget(int type, bool closest, bool hostile)
el = fabs(el / PI);
if (az <= 0.2 && el <= 0.2)
- targets.append(new(__FILE__,__LINE__) TargetOffset(test, az+el));
+ targets.append(new TargetOffset(test, az+el));
}
}
diff --git a/Stars45/Shadow.cpp b/Stars45/Shadow.cpp
index 06fb276..f64c033 100644
--- a/Stars45/Shadow.cpp
+++ b/Stars45/Shadow.cpp
@@ -11,7 +11,6 @@
Dynamic Stencil Shadow Volumes
*/
-#include "MemDebug.h"
#include "Shadow.h"
#include "Light.h"
#include "Solid.h"
@@ -32,8 +31,8 @@ Shadow::Shadow(Solid* s)
int npolys = model->NumPolys();
max_verts = model->NumVerts() * 4;
- verts = new(__FILE__,__LINE__) Vec3[max_verts];
- edges = new(__FILE__,__LINE__) WORD[npolys * 6];
+ verts = new Vec3[max_verts];
+ edges = new WORD[npolys * 6];
}
}
diff --git a/Stars45/Shield.cpp b/Stars45/Shield.cpp
index c287e7b..e7c8fb8 100644
--- a/Stars45/Shield.cpp
+++ b/Stars45/Shield.cpp
@@ -11,7 +11,6 @@
Weapon class
*/
-#include "MemDebug.h"
#include "Shield.h"
#include "Shot.h"
#include "WeaponDesign.h"
diff --git a/Stars45/ShieldRep.cpp b/Stars45/ShieldRep.cpp
index 38e19f4..ccce2d6 100644
--- a/Stars45/ShieldRep.cpp
+++ b/Stars45/ShieldRep.cpp
@@ -11,7 +11,6 @@
ShieldRep Solid class
*/
-#include "MemDebug.h"
#include "ShieldRep.h"
#include "Random.h"
@@ -47,7 +46,7 @@ ShieldRep::ShieldRep()
trans = true;
nhits = 0;
- hits = new(__FILE__,__LINE__) ShieldHit[MAX_SHIELD_HITS];
+ hits = new ShieldHit[MAX_SHIELD_HITS];
}
ShieldRep::~ShieldRep()
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) {
diff --git a/Stars45/ShipAI.cpp b/Stars45/ShipAI.cpp
index 43c34d9..4030f34 100644
--- a/Stars45/ShipAI.cpp
+++ b/Stars45/ShipAI.cpp
@@ -11,7 +11,6 @@
Starship (low-level) Artificial Intelligence class
*/
-#include "MemDebug.h"
#include "ShipAI.h"
#include "TacticalAI.h"
#include "Ship.h"
@@ -281,7 +280,7 @@ ShipAI::ExecFrame(double secs)
// if this isn't the same ship we last called out:
if (target->Identity() != engaged_ship_id && Clock::GetInstance()->GameTime() - last_call_time > 10000) {
// call engaging:
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(ship->GetElement(), ship, RadioMessage::CALL_ENGAGING);
+ RadioMessage* msg = new RadioMessage(ship->GetElement(), ship, RadioMessage::CALL_ENGAGING);
msg->AddTarget(target);
RadioTraffic::Transmit(msg);
last_call_time = Clock::GetInstance()->GameTime();
@@ -309,7 +308,7 @@ ShipAI::ExecFrame(double secs)
*** put down.
if (element_index == 1) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(ship->GetElement(), ship, RadioMessage::RESUME_MISSION);
+ RadioMessage* msg = new RadioMessage(ship->GetElement(), ship, RadioMessage::RESUME_MISSION);
RadioTraffic::Transmit(msg);
}
diff --git a/Stars45/ShipCtrl.cpp b/Stars45/ShipCtrl.cpp
index 800f927..d1fd00e 100644
--- a/Stars45/ShipCtrl.cpp
+++ b/Stars45/ShipCtrl.cpp
@@ -11,7 +11,6 @@
Ship Controller class
*/
-#include "MemDebug.h"
#include "ShipCtrl.h"
#include "Ship.h"
#include "ShipDesign.h"
diff --git a/Stars45/ShipDesign.cpp b/Stars45/ShipDesign.cpp
index f110f0f..cda8013 100644
--- a/Stars45/ShipDesign.cpp
+++ b/Stars45/ShipDesign.cpp
@@ -11,7 +11,6 @@
Starship Design parameters class
*/
-#include "MemDebug.h"
#include "ShipDesign.h"
#include "Ship.h"
#include "Shot.h"
@@ -265,7 +264,7 @@ bolt_hit_sound_resource(0), beam_hit_sound_resource(0), lod_levels(0)
return;
}
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -310,7 +309,7 @@ bolt_hit_sound_resource(0), beam_hit_sound_resource(0), lod_levels(0)
while (++iter) {
const char* model_name = iter.value()->data();
- Model* model = new(__FILE__,__LINE__) Model;
+ Model* model = new Model;
if (!model->Load(model_name, scale)) {
Print("ERROR: Could not load detail %d, model '%s'\n", i, model_name);
delete model;
@@ -332,7 +331,7 @@ bolt_hit_sound_resource(0), beam_hit_sound_resource(0), lod_levels(0)
offsets[i].append(offset[i].at(n)); // transfer ownership
}
else
- offsets[i].append(new(__FILE__,__LINE__) Point);
+ offsets[i].append(new Point);
n++;
}
@@ -347,7 +346,7 @@ bolt_hit_sound_resource(0), beam_hit_sound_resource(0), lod_levels(0)
if (cockpit_name[0]) {
const char* model_name = cockpit_name;
- cockpit_model = new(__FILE__,__LINE__) Model;
+ cockpit_model = new Model;
if (!cockpit_model->Load(model_name, cockpit_scale)) {
Print("ERROR: Could not load cockpit model '%s'\n", model_name);
delete cockpit_model;
@@ -528,7 +527,7 @@ void AddModCatalogEntry(const char* design_name, const char* design_path)
return;
}
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -585,7 +584,7 @@ void AddModCatalogEntry(const char* design_name, const char* design_path)
if (valid && name.length() && type.length()) {
Print("Add Mod Catalog Entry '%s' Class '%s'\n", name.data(), type.data());
- ShipCatalogEntry* entry = new(__FILE__,__LINE__) ShipCatalogEntry(name, type, path, file);
+ ShipCatalogEntry* entry = new ShipCatalogEntry(name, type, path, file);
mod_catalog.append(entry);
}
}
@@ -666,7 +665,7 @@ ShipDesign::LoadCatalog(const char* path, const char* fname, bool mod)
BYTE* block;
int blocklen = loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -726,7 +725,7 @@ ShipDesign::LoadCatalog(const char* path, const char* fname, bool mod)
}
}
- ShipCatalogEntry* entry = new(__FILE__,__LINE__) ShipCatalogEntry(name, type, path, fname, hide);
+ ShipCatalogEntry* entry = new ShipCatalogEntry(name, type, path, fname, hide);
if (mod) mod_catalog.append(entry);
else catalog.append(entry);
@@ -772,7 +771,7 @@ ShipDesign::LoadSkins(const char* path, const char* archive)
continue;
}
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
ShipDesign* design = 0;
@@ -851,7 +850,7 @@ ShipDesign::PreloadCatalog(int index)
return;
if (!entry->design) {
- entry->design = new(__FILE__,__LINE__) ShipDesign(entry->name,
+ entry->design = new ShipDesign(entry->name,
entry->path,
entry->file,
entry->hide);
@@ -864,7 +863,7 @@ ShipDesign::PreloadCatalog(int index)
ShipCatalogEntry* entry = iter.value();
if (!entry->design) {
- entry->design = new(__FILE__,__LINE__) ShipDesign(entry->name,
+ entry->design = new ShipDesign(entry->name,
entry->path,
entry->file,
entry->hide);
@@ -939,7 +938,7 @@ ShipDesign::Get(const char* design_name, const char* design_path)
if (entry) {
if (!entry->design) {
- entry->design = new(__FILE__,__LINE__) ShipDesign(entry->name,
+ entry->design = new ShipDesign(entry->name,
entry->path,
entry->file,
entry->hide);
@@ -966,12 +965,12 @@ ShipDesign::FindModDesign(const char* design_name, const char* design_path)
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath(path);
- ShipDesign* design = new(__FILE__,__LINE__) ShipDesign(design_name, path, file);
+ ShipDesign* design = new ShipDesign(design_name, path, file);
if (design->valid) {
Print("ShipDesign: found mod design '%s'\n", design->name);
- ShipCatalogEntry* entry = new(__FILE__,__LINE__) ShipCatalogEntry(design->name,
+ ShipCatalogEntry* entry = new ShipCatalogEntry(design->name,
ClassName(design->type),
path,
file);
@@ -1019,7 +1018,7 @@ ShipDesign::GetDesignList(int type, List<Text>& designs)
int etype = ClassForName(e->type);
if (etype & type) {
if (!e->design)
- e->design = new(__FILE__,__LINE__) ShipDesign(e->name,
+ e->design = new ShipDesign(e->name,
e->path,
e->file,
e->hide);
@@ -1099,63 +1098,63 @@ ShipDesign::ParseShip(TermDef* def)
if (!GetDefText(detail_name, def, filename))
Print("WARNING: invalid or missing model in '%s'\n", filename);
- detail[0].append(new(__FILE__,__LINE__) Text(detail_name));
+ detail[0].append(new Text(detail_name));
}
else if (defname == "detail_1") {
if (!GetDefText(detail_name, def, filename))
Print("WARNING: invalid or missing detail_1 in '%s'\n", filename);
- detail[1].append(new(__FILE__,__LINE__) Text(detail_name));
+ detail[1].append(new Text(detail_name));
}
else if (defname == "detail_2") {
if (!GetDefText(detail_name, def, filename))
Print("WARNING: invalid or missing detail_2 in '%s'\n", filename);
- detail[2].append(new(__FILE__,__LINE__) Text(detail_name));
+ detail[2].append(new Text(detail_name));
}
else if (defname == "detail_3") {
if (!GetDefText(detail_name, def, filename))
Print("WARNING: invalid or missing detail_3 in '%s'\n", filename);
- detail[3].append(new(__FILE__,__LINE__) Text(detail_name));
+ detail[3].append(new Text(detail_name));
}
else if (defname == "spin") {
if (!GetDefVec(spin, def, filename))
Print("WARNING: invalid or missing spin in '%s'\n", filename);
- spin_rates.append(new(__FILE__,__LINE__) Point(spin));
+ spin_rates.append(new Point(spin));
}
else if (defname == "offset_0") {
if (!GetDefVec(off_loc, def, filename))
Print("WARNING: invalid or missing offset_0 in '%s'\n", filename);
- offset[0].append(new(__FILE__,__LINE__) Point(off_loc));
+ offset[0].append(new Point(off_loc));
}
else if (defname == "offset_1") {
if (!GetDefVec(off_loc, def, filename))
Print("WARNING: invalid or missing offset_1 in '%s'\n", filename);
- offset[1].append(new(__FILE__,__LINE__) Point(off_loc));
+ offset[1].append(new Point(off_loc));
}
else if (defname == "offset_2") {
if (!GetDefVec(off_loc, def, filename))
Print("WARNING: invalid or missing offset_2 in '%s'\n", filename);
- offset[2].append(new(__FILE__,__LINE__) Point(off_loc));
+ offset[2].append(new Point(off_loc));
}
else if (defname == "offset_3") {
if (!GetDefVec(off_loc, def, filename))
Print("WARNING: invalid or missing offset_3 in '%s'\n", filename);
- offset[3].append(new(__FILE__,__LINE__) Point(off_loc));
+ offset[3].append(new Point(off_loc));
}
else if (defname == "beauty") {
@@ -1602,7 +1601,7 @@ ShipDesign::ParsePower(TermStruct* val)
}
}
- PowerSource* source = new(__FILE__,__LINE__) PowerSource((PowerSource::SUBTYPE) stype, output);
+ PowerSource* source = new PowerSource((PowerSource::SUBTYPE) stype, output);
if (pname.length()) source->SetName(pname);
if (pabrv.length()) source->SetName(pabrv);
source->SetFuelRange(fuel);
@@ -1736,7 +1735,7 @@ ShipDesign::ParseDrive(TermStruct* val)
}
if (!drive)
- drive = new(__FILE__,__LINE__) Drive((Drive::SUBTYPE) dtype, dthrust, daug, trail);
+ drive = new Drive((Drive::SUBTYPE) dtype, dthrust, daug, trail);
drive->AddPort(port, flare_scale);
}
@@ -1782,7 +1781,7 @@ ShipDesign::ParseDrive(TermStruct* val)
}
if (!drive)
- drive = new(__FILE__,__LINE__) Drive((Drive::SUBTYPE) dtype, dthrust, daug, trail);
+ drive = new Drive((Drive::SUBTYPE) dtype, dthrust, daug, trail);
drive->SetSourceIndex(reactors.size()-1);
drive->Mount(loc, size, hull);
@@ -1886,7 +1885,7 @@ ShipDesign::ParseQuantumDrive(TermStruct* val)
}
}
- QuantumDrive* drive = new(__FILE__,__LINE__) QuantumDrive((QuantumDrive::SUBTYPE) subtype, capacity, consumption);
+ QuantumDrive* drive = new QuantumDrive((QuantumDrive::SUBTYPE) subtype, capacity, consumption);
drive->SetSourceIndex(reactors.size()-1);
drive->Mount(loc, size, hull);
drive->SetCountdown(countdown);
@@ -1991,7 +1990,7 @@ ShipDesign::ParseFarcaster(TermStruct* val)
}
}
- Farcaster* caster = new(__FILE__,__LINE__) Farcaster(capacity, consumption);
+ Farcaster* caster = new Farcaster(capacity, consumption);
caster->SetSourceIndex(reactors.size()-1);
caster->Mount(loc, size, hull);
@@ -2129,7 +2128,7 @@ ShipDesign::ParseThruster(TermStruct* val)
}
if (!drive)
- drive = new(__FILE__,__LINE__) Thruster(dtype, thrust, tscale);
+ drive = new Thruster(dtype, thrust, tscale);
if (defname == "port" || defname == "port_bottom")
drive->AddPort(Thruster::BOTTOM, port, fire, port_scale);
@@ -2165,7 +2164,7 @@ ShipDesign::ParseThruster(TermStruct* val)
}
if (!drive)
- drive = new(__FILE__,__LINE__) Thruster(dtype, thrust, tscale);
+ drive = new Thruster(dtype, thrust, tscale);
drive->SetSourceIndex(reactors.size()-1);
drive->Mount(loc, size, hull);
@@ -2269,7 +2268,7 @@ ShipDesign::ParseNavlight(TermStruct* val)
}
}
- NavLight* nav = new(__FILE__,__LINE__) NavLight(period, dscale);
+ NavLight* nav = new NavLight(period, dscale);
if (dname.length()) nav->SetName(dname);
if (dabrv.length()) nav->SetAbbreviation(dabrv);
@@ -2424,7 +2423,7 @@ ShipDesign::ParseFlightDeck(TermStruct* val)
}
}
- FlightDeck* deck = new(__FILE__,__LINE__) FlightDeck();
+ FlightDeck* deck = new FlightDeck();
deck->Mount(loc, size, hull);
if (dname.length()) deck->SetName(dname);
if (dabrv.length()) deck->SetAbbreviation(dabrv);
@@ -2524,7 +2523,7 @@ ShipDesign::ParseLandingGear(TermStruct* val)
}
if (ngear < LandingGear::MAX_GEAR) {
- Model* m = new(__FILE__,__LINE__) Model;
+ Model* m = new Model;
if (!m->Load(mod_name, scale)) {
Print("WARNING: Could not load landing gear model '%s'\n", mod_name);
delete m;
@@ -2545,7 +2544,7 @@ ShipDesign::ParseLandingGear(TermStruct* val)
}
}
- gear = new(__FILE__,__LINE__) LandingGear();
+ gear = new LandingGear();
if (dname.length()) gear->SetName(dname);
if (dabrv.length()) gear->SetAbbreviation(dabrv);
@@ -2712,7 +2711,7 @@ ShipDesign::ParseWeapon(TermStruct* val)
muzzles[i] *= (float) meta->scale;
}
- Weapon* gun = new(__FILE__,__LINE__) Weapon(meta, nmuz, muzzles, az, el);
+ Weapon* gun = new Weapon(meta, nmuz, muzzles, az, el);
gun->SetSourceIndex(reactors.size()-1);
gun->Mount(loc, size, hull);
@@ -2837,7 +2836,7 @@ ShipDesign::ParseHardPoint(TermStruct* val)
}
}
- HardPoint* hp = new(__FILE__,__LINE__) HardPoint(muzzle, az, el);
+ HardPoint* hp = new HardPoint(muzzle, az, el);
if (hp) {
for (int i = 0; i < ntypes; i++) {
WeaponDesign* meta = WeaponDesign::Find(wtypes[i]);
@@ -2866,7 +2865,7 @@ ShipDesign::ParseHardPoint(TermStruct* val)
void
ShipDesign::ParseLoadout(TermStruct* val)
{
- ShipLoad* load = new(__FILE__,__LINE__) ShipLoad;
+ ShipLoad* load = new ShipLoad;
if (!load) return;
@@ -2946,7 +2945,7 @@ ShipDesign::ParseSensor(TermStruct* val)
}
if (!sensor) {
- sensor = new(__FILE__,__LINE__) Sensor();
+ sensor = new Sensor();
if (design_name.length()) {
SystemDesign* sd = SystemDesign::Find(design_name);
@@ -3007,7 +3006,7 @@ ShipDesign::ParseNavsys(TermStruct* val)
}
if (!navsys) {
- navsys = new(__FILE__,__LINE__) NavSystem;
+ navsys = new NavSystem;
if (design_name.length()) {
SystemDesign* sd = SystemDesign::Find(design_name);
@@ -3068,7 +3067,7 @@ ShipDesign::ParseComputer(TermStruct* val)
}
}
- Computer* comp = new(__FILE__,__LINE__) Computer(comp_type, comp_name);
+ Computer* comp = new Computer(comp_type, comp_name);
comp->Mount(loc, size, hull);
comp->SetAbbreviation(comp_abrv);
comp->SetSourceIndex(reactors.size()-1);
@@ -3180,7 +3179,7 @@ ShipDesign::ParseShield(TermStruct* val)
if (!shield) {
if (shield_type) {
- shield = new(__FILE__,__LINE__) Shield((Shield::SUBTYPE) shield_type);
+ shield = new Shield((Shield::SUBTYPE) shield_type);
shield->SetSourceIndex(reactors.size()-1);
shield->Mount(loc, size, hull);
if (dname.length()) shield->SetName(dname);
@@ -3213,7 +3212,7 @@ ShipDesign::ParseShield(TermStruct* val)
shield->SetEMCONPower(1, emcon_3);
if (model_name.length()) {
- shield_model = new(__FILE__,__LINE__) Model;
+ shield_model = new Model;
if (!shield_model->Load(model_name, scale)) {
Print("ERROR: Could not load shield model '%s'\n", model_name.data());
delete shield_model;
@@ -3312,7 +3311,7 @@ ShipDesign::ParseDeathSpiral(TermStruct* val)
if (def->term() && def->term()->isText()) {
Text model_name;
GetDefText(model_name, def, filename);
- Model* model = new(__FILE__,__LINE__) Model;
+ Model* model = new Model;
if (!model->Load(model_name, scale)) {
Print("Could not load debris model '%s'\n", model_name.data());
delete model;
@@ -3420,7 +3419,7 @@ ShipDesign::ParseDebris(TermStruct* val, int index)
if (defname == "model") {
GetDefText(model_name, def, filename);
- Model* model = new(__FILE__,__LINE__) Model;
+ Model* model = new Model;
if (!model->Load(model_name, scale)) {
Print("Could not load debris model '%s'\n", model_name);
delete model;
@@ -3487,7 +3486,7 @@ ShipDesign::ParseMap(TermStruct* val)
if (defname == "sprite") {
GetDefText(sprite_name, pdef, filename);
- Bitmap* sprite = new(__FILE__,__LINE__) Bitmap();
+ Bitmap* sprite = new Bitmap();
DataLoader* loader = DataLoader::GetLoader();
loader->LoadBitmap(sprite_name, *sprite, Bitmap::BMP_TRANSLUCENT);
@@ -3531,7 +3530,7 @@ ShipDesign::ParseSquadron(TermStruct* val)
}
}
- ShipSquadron* s = new(__FILE__,__LINE__) ShipSquadron;
+ ShipSquadron* s = new ShipSquadron;
strcpy_s(s->name, name);
s->design = Get(design);
@@ -3560,7 +3559,7 @@ ShipDesign::ParseSkin(TermStruct* val)
if (defname == "name") {
GetDefText(name, def, filename);
- skin = new(__FILE__,__LINE__) Skin(name);
+ skin = new Skin(name);
}
else if (defname == "material" || defname == "mtl") {
if (!def->term() || !def->term()->isStruct()) {
@@ -3589,7 +3588,7 @@ ShipDesign::ParseSkin(TermStruct* val)
void
ShipDesign::ParseSkinMtl(TermStruct* val, Skin* skin)
{
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
if (mtl == nullptr)
return;
diff --git a/Stars45/ShipKiller.cpp b/Stars45/ShipKiller.cpp
index 3c6b614..f071115 100644
--- a/Stars45/ShipKiller.cpp
+++ b/Stars45/ShipKiller.cpp
@@ -11,7 +11,6 @@
ShipKiller class implementation
*/
-#include "MemDebug.h"
#include "ShipKiller.h"
#include "Sim.h"
#include "Ship.h"
diff --git a/Stars45/ShipSolid.cpp b/Stars45/ShipSolid.cpp
index 5df0d06..bffcc54 100644
--- a/Stars45/ShipSolid.cpp
+++ b/Stars45/ShipSolid.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "ShipSolid.h"
#include "Ship.h"
#include "Sim.h"
diff --git a/Stars45/Shot.cpp b/Stars45/Shot.cpp
index da516b8..0af927e 100644
--- a/Stars45/Shot.cpp
+++ b/Stars45/Shot.cpp
@@ -11,7 +11,6 @@
Laser and Missile class
*/
-#include "MemDebug.h"
#include "Shot.h"
#include "Weapon.h"
#include "DriveSprite.h"
@@ -66,7 +65,7 @@ charge(1.0f), design(dsn), offset(1.0e5f), altitude_agl(-1.0e6f), hit_target(fal
switch (design->graphic_type) {
case Graphic::BOLT: {
- Bolt* s = new(__FILE__,__LINE__) Bolt(design->length, design->width, design->shot_img, 1);
+ Bolt* s = new Bolt(design->length, design->width, design->shot_img, 1);
s->SetDirection(cam.vpn());
rep = s;
}
@@ -76,9 +75,9 @@ charge(1.0f), design(dsn), offset(1.0e5f), altitude_agl(-1.0e6f), hit_target(fal
Sprite* s = 0;
if (design->animation)
- s = new(__FILE__,__LINE__) DriveSprite(design->animation, design->anim_length);
+ s = new DriveSprite(design->animation, design->anim_length);
else
- s = new(__FILE__,__LINE__) DriveSprite(design->shot_img);
+ s = new DriveSprite(design->shot_img);
s->Scale((double) design->scale);
rep = s;
@@ -86,7 +85,7 @@ charge(1.0f), design(dsn), offset(1.0e5f), altitude_agl(-1.0e6f), hit_target(fal
break;
case Graphic::SOLID: {
- Solid* s = new(__FILE__,__LINE__) Solid;
+ Solid* s = new Solid;
s->UseModel(design->shot_model);
rep = s;
@@ -101,7 +100,7 @@ charge(1.0f), design(dsn), offset(1.0e5f), altitude_agl(-1.0e6f), hit_target(fal
light = 0;
if (design->light > 0) {
- light = new(__FILE__,__LINE__) Light(design->light);
+ light = new Light(design->light);
light->SetColor(design->light_color);
}
@@ -116,14 +115,14 @@ charge(1.0f), design(dsn), offset(1.0e5f), altitude_agl(-1.0e6f), hit_target(fal
SetAngularRates((float) design->roll_rate, (float) design->pitch_rate, (float) design->yaw_rate);
if (design->flash_img != 0) {
- flash = new(__FILE__,__LINE__) Sprite(design->flash_img);
+ flash = new Sprite(design->flash_img);
flash->Scale((double) design->flash_scale);
flash->MoveTo(pos - cam.vpn() * design->length);
flash->SetLuminous(true);
}
if (design->flare_img != 0) {
- flare = new(__FILE__,__LINE__) DriveSprite(design->flare_img);
+ flare = new DriveSprite(design->flare_img);
flare->Scale((double) design->flare_scale);
flare->MoveTo(pos);
}
@@ -196,7 +195,7 @@ Shot::SeekTarget(SimObject* target, System* sub)
dir = 0;
if (target) {
- SeekerAI* seeker = new(__FILE__,__LINE__) SeekerAI(this);
+ SeekerAI* seeker = new SeekerAI(this);
seeker->SetTarget(target, sub);
seeker->SetPursuit(design->guided);
seeker->SetDelay(1);
@@ -308,7 +307,7 @@ Shot::ExecFrame(double seconds)
if (!trail && life > 0 && design->life - life > 0.2) {
if (design->trail.length()) {
- trail = new(__FILE__,__LINE__) Trail(design->trail_img, design->trail_length);
+ trail = new Trail(design->trail_img, design->trail_length);
if (design->trail_width > 0)
trail->SetWidth(design->trail_width);
diff --git a/Stars45/Sim.cpp b/Stars45/Sim.cpp
index ccfab62..36d5356 100644
--- a/Stars45/Sim.cpp
+++ b/Stars45/Sim.cpp
@@ -11,7 +11,6 @@
Simulation Universe and Region classes
*/
-#include "MemDebug.h"
#include "Sim.h"
#include "SimEvent.h"
#include "SimObject.h"
@@ -381,7 +380,7 @@ Sim::ExecMission()
dust_factor = Starshatter::GetInstance()->Dust();
if (star_system->NumDust() * dust_factor) {
- dust = new(__FILE__,__LINE__) Dust(star_system->NumDust() * 2*(dust_factor+1), dust_factor > 1);
+ dust = new Dust(star_system->NumDust() * 2*(dust_factor+1), dust_factor > 1);
scene.AddGraphic(dust);
}
@@ -425,7 +424,7 @@ Sim::CreateRegions()
while (++moon) {
ListIter<OrbitalRegion> rgn = moon->Regions();
while (++rgn) {
- SimRegion* sim_region = new(__FILE__,__LINE__) SimRegion(this, rgn.value());
+ SimRegion* sim_region = new SimRegion(this, rgn.value());
regions.append(sim_region);
if (!strcmp(active_region_name, sim_region->Name())) {
ActivateRegion(sim_region);
@@ -435,7 +434,7 @@ Sim::CreateRegions()
ListIter<OrbitalRegion> rgn = planet->Regions();
while (++rgn) {
- SimRegion* sim_region = new(__FILE__,__LINE__) SimRegion(this, rgn.value());
+ SimRegion* sim_region = new SimRegion(this, rgn.value());
regions.append(sim_region);
if (!strcmp(active_region_name, sim_region->Name())) {
ActivateRegion(sim_region);
@@ -445,7 +444,7 @@ Sim::CreateRegions()
ListIter<OrbitalRegion> rgn = star->Regions();
while (++rgn) {
- SimRegion* sim_region = new(__FILE__,__LINE__) SimRegion(this, rgn.value());
+ SimRegion* sim_region = new SimRegion(this, rgn.value());
regions.append(sim_region);
if (!strcmp(active_region_name, sim_region->Name())) {
ActivateRegion(sim_region);
@@ -606,7 +605,7 @@ Sim::CreateElements()
Instruction* o = obj.value();
Instruction* instr = 0;
- instr = new(__FILE__,__LINE__) Instruction(*o);
+ instr = new Instruction(*o);
element->AddObjective(instr);
}
@@ -626,7 +625,7 @@ Sim::CreateElements()
rgn = FindRegion(msn_elem->Region());
if (rgn) {
- Instruction* npt = new(__FILE__,__LINE__)
+ Instruction* npt = new
Instruction(rgn, nav->Location(), nav->Action());
npt->SetStatus(nav->Status());
@@ -909,7 +908,7 @@ Sim::CopyEvents()
ListIter<MissionEvent> iter = mission->GetEvents();
while (++iter) {
MissionEvent* orig = iter.value();
- MissionEvent* event = new(__FILE__,__LINE__) MissionEvent(*orig);
+ MissionEvent* event = new MissionEvent(*orig);
events.append(event);
}
}
@@ -935,7 +934,7 @@ Sim::FindAvailCallsign(int IFF)
Element*
Sim::CreateElement(const char* callsign, int IFF, int type)
{
- Element* elem = new(__FILE__,__LINE__) Element(callsign, IFF, type);
+ Element* elem = new Element(callsign, IFF, type);
elements.append(elem);
return elem;
}
@@ -999,7 +998,7 @@ Sim::CreateShip(const char* name, const char* reg_num, ShipDesign* design, const
return 0;
}
- Ship* ship = new(__FILE__,__LINE__) Ship(name, reg_num, design, IFF, cmd_ai, loadout);
+ Ship* ship = new Ship(name, reg_num, design, IFF, cmd_ai, loadout);
ship->MoveTo(loc.OtherHand());
if (rgn) {
@@ -1100,9 +1099,9 @@ Sim::CreateShot(const Point& pos, const Camera& shot_cam, WeaponDesign* design,
Shot* shot = 0;
if (design->drone)
- shot = new(__FILE__,__LINE__) Drone(pos, shot_cam, design, ship);
+ shot = new Drone(pos, shot_cam, design, ship);
else
- shot = new(__FILE__,__LINE__) Shot( pos, shot_cam, design, ship);
+ shot = new Shot( pos, shot_cam, design, ship);
if (rgn)
rgn->InsertObject(shot);
@@ -1122,7 +1121,7 @@ Sim::CreateExplosion(const Point& pos, const Point& vel, int type, float exp_sca
if (!rgn || !active_region || rgn != active_region)
return 0;
- Explosion* exp = new(__FILE__,__LINE__) Explosion(type, pos, vel, exp_scale, part_scale, rgn, source);
+ Explosion* exp = new Explosion(type, pos, vel, exp_scale, part_scale, rgn, source);
if (rgn)
rgn->InsertObject(exp);
@@ -1138,7 +1137,7 @@ Sim::CreateExplosion(const Point& pos, const Point& vel, int type, float exp_sca
Debris*
Sim::CreateDebris(const Point& pos, const Point& vel, Model* model, double mass, SimRegion* rgn)
{
- Debris* debris = new(__FILE__,__LINE__) Debris(model, pos, vel, mass);
+ Debris* debris = new Debris(model, pos, vel, mass);
if (rgn)
rgn->InsertObject(debris);
@@ -1154,7 +1153,7 @@ Sim::CreateDebris(const Point& pos, const Point& vel, Model* model, double mass,
Asteroid*
Sim::CreateAsteroid(const Point& pos, int t, double mass, SimRegion* rgn)
{
- Asteroid* asteroid = new(__FILE__,__LINE__) Asteroid(t, pos, mass);
+ Asteroid* asteroid = new Asteroid(t, pos, mass);
if (rgn)
rgn->InsertObject(asteroid);
@@ -1171,7 +1170,7 @@ void
Sim::CreateSplashDamage(Ship* ship)
{
if (ship && ship->GetRegion() && ship->Design()->splash_radius > 1) {
- SimSplash* splash = new(__FILE__,__LINE__)
+ SimSplash* splash = new
SimSplash(ship->GetRegion(),
ship->Location(),
ship->Design()->integrity / 4,
@@ -1192,7 +1191,7 @@ Sim::CreateSplashDamage(Shot* shot)
if (damage < shot->Design()->damage)
damage = shot->Design()->damage;
- SimSplash* splash = new(__FILE__,__LINE__)
+ SimSplash* splash = new
SimSplash(shot->GetRegion(),
shot->Location(),
damage,
@@ -1483,7 +1482,7 @@ int type, Ship* fc1, Ship* fc2)
if (obj->GetQuantumDrive() && obj->GetQuantumDrive()->Subtype() == QuantumDrive::HYPER)
hyperdrive = true;
- jumplist.append(new(__FILE__,__LINE__) SimHyper(obj, rgn, loc, type, hyperdrive, fc1, fc2));
+ jumplist.append(new SimHyper(obj, rgn, loc, type, hyperdrive, fc1, fc2));
}
// +--------------------------------------------------------------------+
@@ -2034,7 +2033,7 @@ Sim::CreateMissionElement(Element* elem)
}
if (elem && !elem->IsNetObserver()) {
- msn_elem = new(__FILE__,__LINE__) MissionElement;
+ msn_elem = new MissionElement;
msn_elem->SetName(elem->Name());
msn_elem->SetIFF(elem->GetIFF());
@@ -2110,7 +2109,7 @@ Sim::CreateMissionElement(Element* elem)
msn_elem->SetRespawnCount(ship->RespawnCount());
}
- MissionLoad* loadout = new(__FILE__,__LINE__) MissionLoad;
+ MissionLoad* loadout = new MissionLoad;
CopyMemory(loadout->GetStations(), elem->Loadout(), 16 * sizeof(int));
msn_elem->Loadouts().append(loadout);
@@ -2120,7 +2119,7 @@ Sim::CreateMissionElement(Element* elem)
Instruction* o = elem->GetObjective(i);
Instruction* instr = 0;
- instr = new(__FILE__,__LINE__) Instruction(*o);
+ instr = new Instruction(*o);
msn_elem->AddObjective(instr);
}
@@ -2134,7 +2133,7 @@ Sim::CreateMissionElement(Element* elem)
ListIter<Instruction> nav_iter = elem->GetFlightPlan();
while (++nav_iter) {
Instruction* nav = nav_iter.value();
- Instruction* npt = new(__FILE__,__LINE__)
+ Instruction* npt = new
Instruction(nav->RegionName(), nav->Location(), nav->Action());
npt->SetFormation(nav->Formation());
@@ -2151,7 +2150,7 @@ Sim::CreateMissionElement(Element* elem)
ship = elem->GetShip(i+1);
if (ship) {
- MissionShip* s = new(__FILE__,__LINE__) MissionShip;
+ MissionShip* s = new MissionShip;
s->SetName(ship->Name());
s->SetRegNum(ship->Registry());
@@ -2247,13 +2246,13 @@ SimRegion::SimRegion(Sim* s, OrbitalRegion* r)
if (orbital_region) {
name = orbital_region->Name();
- grid = new(__FILE__,__LINE__) Grid((int) orbital_region->Radius(),
+ grid = new Grid((int) orbital_region->Radius(),
(int) orbital_region->GridSpace());
if (orbital_region->Type() == Orbital::TERRAIN) {
TerrainRegion* trgn = (TerrainRegion*) orbital_region;
- terrain = new(__FILE__,__LINE__) Terrain(trgn);
+ terrain = new Terrain(trgn);
type = AIR_SPACE;
}
diff --git a/Stars45/SimEvent.cpp b/Stars45/SimEvent.cpp
index 731f090..4fad773 100644
--- a/Stars45/SimEvent.cpp
+++ b/Stars45/SimEvent.cpp
@@ -11,7 +11,6 @@
Simulation Events for mission summary
*/
-#include "MemDebug.h"
#include "SimEvent.h"
#include "Sim.h"
#include "Clock.h"
@@ -204,7 +203,7 @@ ShipStats::AddEvent(SimEvent* e)
SimEvent*
ShipStats::AddEvent(int event, const char* tgt, const char* info)
{
- SimEvent* e = new(__FILE__,__LINE__) SimEvent(event, tgt, info);
+ SimEvent* e = new SimEvent(event, tgt, info);
events.append(e);
return e;
}
@@ -252,7 +251,7 @@ ShipStats::Find(const char* name)
return stats;
}
- ShipStats* stats = new(__FILE__,__LINE__) ShipStats(name);
+ ShipStats* stats = new ShipStats(name);
records.append(stats);
return stats;
}
diff --git a/Stars45/SimObject.cpp b/Stars45/SimObject.cpp
index 7a5dab2..24fac59 100644
--- a/Stars45/SimObject.cpp
+++ b/Stars45/SimObject.cpp
@@ -11,7 +11,6 @@
Simulation Object and Observer classes
*/
-#include "MemDebug.h"
#include "SimObject.h"
#include "Graphic.h"
diff --git a/Stars45/Skin.cpp b/Stars45/Skin.cpp
index ff41494..62363c5 100644
--- a/Stars45/Skin.cpp
+++ b/Stars45/Skin.cpp
@@ -11,7 +11,6 @@
Classes for rendering solid meshes of polygons
*/
-#include "MemDebug.h"
#include "Skin.h"
#include "Solid.h"
#include "Utils.h"
@@ -83,7 +82,7 @@ Skin::AddMaterial(const Material* mtl)
}
if (!found) {
- SkinCell* s = new(__FILE__,__LINE__) SkinCell(mtl);
+ SkinCell* s = new SkinCell(mtl);
cells.append(s);
}
}
diff --git a/Stars45/Sky.cpp b/Stars45/Sky.cpp
index f65b39e..ff25044 100644
--- a/Stars45/Sky.cpp
+++ b/Stars45/Sky.cpp
@@ -11,7 +11,6 @@
Celestial sphere, stars, planets, space dust...
*/
-#include "MemDebug.h"
#include "Sky.h"
#include "StarSystem.h"
@@ -31,8 +30,8 @@ Stars::Stars(int nstars)
luminous = true;
shadow = false;
- vset = new(__FILE__,__LINE__) VertexSet(nstars);
- colors = new(__FILE__,__LINE__) Color[nstars];
+ vset = new VertexSet(nstars);
+ colors = new Color[nstars];
for (int i = 0; i < nstars; i++) {
vset->loc[i] = RandomVector(1000);
@@ -92,7 +91,7 @@ Dust::Dust(int ndust, bool b)
{
radius = (float) BOUNDARYx2;
luminous = true;
- vset = new(__FILE__,__LINE__) VertexSet(ndust);
+ vset = new VertexSet(ndust);
Reset(Point(0, 0, 0));
strcpy_s(name, "Dust");
@@ -254,7 +253,7 @@ PlanetRep::PlanetRep(const char* surface_name, const char* glow_name,
loader->LoadTexture(gloss_name, bmp_spec, Bitmap::BMP_SOLID, true);
}
- mtl_surf = new(__FILE__,__LINE__) Material;
+ mtl_surf = new Material;
mtl_surf->Ka = Color::LightGray;
mtl_surf->Kd = Color::White;
@@ -275,7 +274,7 @@ PlanetRep::PlanetRep(const char* surface_name, const char* glow_name,
}
if (atmosphere != Color::Black) {
- mtl_limb = new(__FILE__,__LINE__) Material;
+ mtl_limb = new Material;
mtl_limb->Ka = atmosphere;
@@ -293,7 +292,7 @@ PlanetRep::PlanetRep(const char* surface_name, const char* glow_name,
ring_rad = (maxrad + minrad)/2;
loader->LoadTexture(rngname, bmp_ring, Bitmap::BMP_SOLID, true);
- mtl_ring = new(__FILE__,__LINE__) Material;
+ mtl_ring = new Material;
mtl_ring->Ka = Color::LightGray;
mtl_ring->Kd = Color::White;
@@ -325,10 +324,10 @@ double tscale)
{
const int sect_verts = nsections + 1;
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
own_model = 1;
- Surface* surface = new(__FILE__,__LINE__) Surface;
+ Surface* surface = new Surface;
int i, j, m, n;
@@ -626,7 +625,7 @@ double tscale)
segment->npolys++;
}
else {
- segment = new(__FILE__,__LINE__) Segment;
+ segment = new Segment;
segment->npolys = 1;
segment->polys = &polys[n];
diff --git a/Stars45/Slider.cpp b/Stars45/Slider.cpp
index 4065c4b..2970ac6 100644
--- a/Stars45/Slider.cpp
+++ b/Stars45/Slider.cpp
@@ -11,7 +11,6 @@
Slider/Gauge ActiveWindow class
*/
-#include "MemDebug.h"
#include "Slider.h"
#include "Video.h"
#include "Font.h"
diff --git a/Stars45/Solid.cpp b/Stars45/Solid.cpp
index 6ea1430..ff4f610 100644
--- a/Stars45/Solid.cpp
+++ b/Stars45/Solid.cpp
@@ -11,7 +11,6 @@
Classes for rendering solid meshes of polygons
*/
-#include "MemDebug.h"
#include "Solid.h"
#include "Scene.h"
#include "Bitmap.h"
@@ -51,8 +50,8 @@ public:
nverts = s->NumVerts();
ntris = s->NumIndices() / 3;
- locs = new(__FILE__,__LINE__) IcePoint[nverts];
- tris = new(__FILE__,__LINE__) IndexedTriangle[ntris];
+ locs = new IcePoint[nverts];
+ tris = new IndexedTriangle[ntris];
if (locs && tris) {
int i, n = 0;
@@ -548,7 +547,7 @@ Solid::Load(const char* mag_file, double scale)
ClearModel();
// loading our own copy, so we own the model:
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
own_model = 1;
// now load the model:
@@ -570,7 +569,7 @@ Solid::Load(ModelFile* mod_file, double scale)
ClearModel();
// loading our own copy, so we own the model:
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
own_model = 1;
// now load the model:
@@ -617,7 +616,7 @@ void
Solid::CreateShadows(int nlights)
{
while (shadows.size() < nlights) {
- shadows.append(new(__FILE__,__LINE__) Shadow(this));
+ shadows.append(new Shadow(this));
}
}
@@ -819,7 +818,7 @@ Model::operator = (const Model& m)
ListIter<Material> m_iter = pmod->materials;
while (++m_iter) {
Material* matl1 = m_iter.value();
- Material* matl2 = new(__FILE__,__LINE__) Material;
+ Material* matl2 = new Material;
CopyMemory(matl2, matl1, sizeof(Material));
matl2->thumbnail = 0;
@@ -830,7 +829,7 @@ Model::operator = (const Model& m)
ListIter<Surface> s_iter = pmod->surfaces;
while (++s_iter) {
Surface* surf1 = s_iter.value();
- Surface* surf2 = new(__FILE__,__LINE__) Surface;
+ Surface* surf2 = new Surface;
surf2->Copy(*surf1, this);
surfaces.append(surf2);
@@ -1043,7 +1042,7 @@ Model::LoadMag5(BYTE* block, int len, double scale)
// read texture list:
for (int i = 0; i < ntex; i++) {
- mtl = new(__FILE__,__LINE__) Material;
+ mtl = new Material;
char tname[32];
if (mtl) {
@@ -1085,15 +1084,15 @@ Model::LoadMag5(BYTE* block, int len, double scale)
nverts = npolys * 4;
- Surface* s = new(__FILE__,__LINE__) Surface;
+ Surface* s = new Surface;
VertexSet* vset = 0;
if (s) {
strcpy_s(s->name, "default");
s->model = this;
- s->vertex_set = new(__FILE__,__LINE__) VertexSet(nverts);
- s->vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ s->vertex_set = new VertexSet(nverts);
+ s->vloc = new Vec3[nverts];
ZeroMemory(s->vertex_set->loc, nverts * sizeof(Vec3));
ZeroMemory(s->vertex_set->diffuse, nverts * sizeof(DWORD));
@@ -1104,7 +1103,7 @@ Model::LoadMag5(BYTE* block, int len, double scale)
ZeroMemory(s->vloc, nverts * sizeof(Vec3));
s->npolys = npolys;
- s->polys = new(__FILE__,__LINE__) Poly[npolys];
+ s->polys = new Poly[npolys];
ZeroMemory(s->polys, sizeof(Poly) * npolys);
surfaces.append(s);
@@ -1274,7 +1273,7 @@ Model::LoadMag5(BYTE* block, int len, double scale)
}
if (!segment) {
- segment = new(__FILE__,__LINE__) Segment;
+ segment = new Segment;
segment->npolys = 1;
segment->polys = &s->polys[n];
@@ -1341,7 +1340,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
// read texture list:
if (ntex) {
- char* buffer = new(__FILE__,__LINE__) char[ntex];
+ char* buffer = new char[ntex];
char* p = buffer;
Bitmap* bmp = 0;
@@ -1359,7 +1358,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
for (int i = 0; i < nmtls; i++) {
MaterialMag6 m6;
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
loader->fread(&m6, sizeof(m6), 1, fp);
@@ -1415,7 +1414,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
loader->fread(&namelen, 1, 1, fp);
loader->fread(name, 1, namelen, fp);
- Surface* surface = new(__FILE__,__LINE__) Surface;
+ Surface* surface = new Surface;
surface->model = this;
surface->SetName(name);
surface->CreateVerts(nverts);
@@ -1510,7 +1509,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
}
if (!segment) {
- segment = new(__FILE__,__LINE__) Segment;
+ segment = new Segment;
segment->npolys = 1;
segment->polys = &polys[n];
@@ -1828,14 +1827,14 @@ Surface::Copy(Surface& s, Model* m)
vertex_set = s.vertex_set->Clone();
if (nhull > 0) {
- vloc = new(__FILE__,__LINE__) Vec3[nhull];
+ vloc = new Vec3[nhull];
CopyMemory(vloc, s.vloc, nhull * sizeof(Vec3));
}
else {
vloc = 0;
}
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ polys = new Poly[npolys];
CopyMemory(polys, s.polys, npolys * sizeof(Poly));
for (int i = 0; i < npolys; i++) {
@@ -1848,7 +1847,7 @@ Surface::Copy(Surface& s, Model* m)
ListIter<Segment> iter = s.segments;
while (++iter) {
Segment* seg1 = iter.value();
- Segment* seg2 = new(__FILE__,__LINE__) Segment;
+ Segment* seg2 = new Segment;
seg2->npolys = seg1->npolys;
seg2->polys = polys + (seg1->polys - s.polys);
@@ -1908,8 +1907,8 @@ void
Surface::CreateVerts(int nverts)
{
if (!vertex_set && !vloc) {
- vertex_set = new(__FILE__,__LINE__) VertexSet(nverts);
- vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ vertex_set = new VertexSet(nverts);
+ vloc = new Vec3[nverts];
}
}
@@ -1918,7 +1917,7 @@ Surface::CreatePolys(int np)
{
if (!polys && !npolys) {
npolys = np;
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ polys = new Poly[npolys];
ZeroMemory(polys, npolys * sizeof(Poly));
}
@@ -1938,7 +1937,7 @@ Surface::AddPolys(int np, int nv)
vertex_set->Resize(newverts, true);
- Poly* pset = new(__FILE__,__LINE__) Poly[newpolys];
+ Poly* pset = new Poly[newpolys];
Poly* pnew = pset + npolys;
CopyMemory(pset, polys, npolys * sizeof(Poly));
@@ -1978,7 +1977,7 @@ Surface::ExplodeMesh()
}
// create target vertex set:
- VertexSet* vset = new(__FILE__,__LINE__) VertexSet(nverts);
+ VertexSet* vset = new VertexSet(nverts);
v = 0;
// explode verts:
@@ -2010,7 +2009,7 @@ Surface::ExplodeMesh()
if (vloc)
delete [] vloc;
- vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ vloc = new Vec3[nverts];
ComputeTangents();
BuildHull();
@@ -2100,7 +2099,7 @@ Surface::OptimizeMesh()
}
// create target vertex set:
- VertexSet* vset = new(__FILE__,__LINE__) VertexSet(used);
+ VertexSet* vset = new VertexSet(used);
int v = 0;
// compress verts:
@@ -2154,7 +2153,7 @@ Surface::OptimizeMesh()
if (vloc)
delete [] vloc;
- vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ vloc = new Vec3[nverts];
ComputeTangents();
BuildHull();
@@ -2400,7 +2399,7 @@ Surface::CalcGradients(Poly& p, Vec3& tangent, Vec3& binormal)
void
Surface::InitializeCollisionHull()
{
- opcode = new(__FILE__,__LINE__) OPCODE_data(this);
+ opcode = new OPCODE_data(this);
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/Sound.cpp b/Stars45/Sound.cpp
index b164467..01537e9 100644
--- a/Stars45/Sound.cpp
+++ b/Stars45/Sound.cpp
@@ -11,7 +11,6 @@
Abstract sound class
*/
-#include "MemDebug.h"
#include "Sound.h"
#include "SoundCard.h"
#include "Wave.h"
@@ -70,7 +69,7 @@ Sound::CreateStream(const char* filename)
len = 4096;
}
- buf = new(__FILE__,__LINE__) BYTE[len];
+ buf = new BYTE[len];
if (buf && len)
fread(buf, len, 1, f);
@@ -161,7 +160,7 @@ Sound::CreateOggStream(const char* filename)
::fopen_s(&f, filename, "rb");
if (f) {
- OggVorbis_File* povf = new(__FILE__,__LINE__) OggVorbis_File;
+ OggVorbis_File* povf = new OggVorbis_File;
if (!povf) {
Print("Sound::CreateOggStream(%s) - out of memory!\n", filename);
diff --git a/Stars45/SoundCard.cpp b/Stars45/SoundCard.cpp
index 05039b4..c0b1368 100644
--- a/Stars45/SoundCard.cpp
+++ b/Stars45/SoundCard.cpp
@@ -11,7 +11,6 @@
Abstract sound card class
*/
-#include "MemDebug.h"
#include "SoundCard.h"
#include "Sound.h"
diff --git a/Stars45/SoundD3D.cpp b/Stars45/SoundD3D.cpp
index 812164d..617c8d3 100644
--- a/Stars45/SoundD3D.cpp
+++ b/Stars45/SoundD3D.cpp
@@ -18,7 +18,6 @@
#include <dsound.h>
-#include "MemDebug.h"
#include "SoundD3D.h"
#include "Game.h"
#include "Utils.h"
@@ -258,7 +257,7 @@ SoundCardD3D::CreateSound(DWORD flags, LPWAVEFORMATEX format)
{
if (!soundcard) return 0;
- Sound* result = new(__FILE__,__LINE__) SoundD3D(soundcard, flags, format);
+ Sound* result = new SoundD3D(soundcard, flags, format);
if (result) AddSound(result);
return result;
}
@@ -269,7 +268,7 @@ Sound*
SoundCardD3D::CreateSound(DWORD flags, LPWAVEFORMATEX format, DWORD len, LPBYTE data)
{
if (!soundcard) return 0;
- Sound* result = new(__FILE__,__LINE__) SoundD3D(soundcard, flags, format, len, data);
+ Sound* result = new SoundD3D(soundcard, flags, format, len, data);
if (flags & (Sound::STREAMED | Sound::OGGVORBIS)) {
if (result)
@@ -436,7 +435,7 @@ ov_file(0)
else {
data_len = len;
- data = new(__FILE__,__LINE__) BYTE[len];
+ data = new BYTE[len];
if (!data) {
data_len = 0;
@@ -863,7 +862,7 @@ SoundD3D::StreamFile(const char* name, DWORD offset)
// preload the buffer:
w = r = 0;
- transfer = new(__FILE__,__LINE__) BYTE[read_size + 1024];
+ transfer = new BYTE[read_size + 1024];
if (!transfer) {
hr = E_FAIL;
@@ -918,7 +917,7 @@ SoundD3D::StreamOggFile()
// preload the buffer:
w = r = 0;
- transfer = new(__FILE__,__LINE__) BYTE[read_size + 1024];
+ transfer = new BYTE[read_size + 1024];
if (!transfer) {
hr = E_FAIL;
diff --git a/Stars45/Sprite.cpp b/Stars45/Sprite.cpp
index 9cf6f37..a845344 100644
--- a/Stars45/Sprite.cpp
+++ b/Stars45/Sprite.cpp
@@ -11,7 +11,6 @@
Sprite (Polygon) Object
*/
-#include "MemDebug.h"
#include "Sprite.h"
#include "Bitmap.h"
#include "Camera.h"
diff --git a/Stars45/StarServer.cpp b/Stars45/StarServer.cpp
index c95b2cb..ceaa5ca 100644
--- a/Stars45/StarServer.cpp
+++ b/Stars45/StarServer.cpp
@@ -9,7 +9,6 @@
#include <iostream>
-#include "MemDebug.h"
#include "StarServer.h"
#include "Campaign.h"
@@ -190,7 +189,7 @@ StarServer::InitGame()
::Print("Admin Server Port: %d\n", server_config->GetAdminPort());
::Print("-----------------------\n");
- NetLobbyServer* nls = new(__FILE__,__LINE__) NetLobbyServer;
+ NetLobbyServer* nls = new NetLobbyServer;
NetAdminServer* nas = NetAdminServer::GetInstance(server_config->GetAdminPort());
nas->SetServerName(server_config->Name());
@@ -260,7 +259,7 @@ StarServer::CreateWorld()
// create world
if (!world) {
- Sim* sim = new(__FILE__,__LINE__) Sim(0);
+ Sim* sim = new Sim(0);
world = sim;
Print(" World Created.\n");
}
@@ -269,8 +268,6 @@ StarServer::CreateWorld()
void
StarServer::InstantiateMission()
{
- Memory::Check();
-
current_mission = 0;
if (Campaign::GetCampaign()) {
@@ -295,8 +292,6 @@ StarServer::InstantiateMission()
Print(" *** WARNING: StarServer::InstantiateMission() - no mission selected ***\n");
}
}
-
- Memory::Check();
}
// +--------------------------------------------------------------------+
@@ -386,8 +381,6 @@ StarServer::GameState()
Sleep(10);
}
-
- Memory::Check();
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/StarSystem.cpp b/Stars45/StarSystem.cpp
index d1558d7..9d8e377 100644
--- a/Stars45/StarSystem.cpp
+++ b/Stars45/StarSystem.cpp
@@ -11,7 +11,6 @@
Various Heavenly Bodies
*/
-#include "MemDebug.h"
#include "StarSystem.h"
#include "Galaxy.h"
#include "Sky.h"
@@ -88,7 +87,7 @@ active_region(0), instantiated(false), ambient(0,0,0),
sun_color(255,255,255), sun_scale(1), point_stars(0), poly_stars(0),
nebula(0), haze(0)
{
- center = new(__FILE__,__LINE__) Orbital(this, "CG", Orbital::NOTHING, 1.0e35f, 0.0f, 0.0f, 0);
+ center = new Orbital(this, "CG", Orbital::NOTHING, 1.0e35f, 0.0f, 0.0f, 0);
radius = 0.0f;
}
@@ -137,7 +136,7 @@ StarSystem::Load()
return;
}
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block));
+ Parser parser(new BlockReader((const char*) block));
Term* term = parser.ParseTerm();
@@ -351,7 +350,7 @@ StarSystem::ParseStar(TermStruct* val)
}
}
- OrbitalBody* star = new(__FILE__,__LINE__) OrbitalBody(this, star_name, Orbital::STAR, mass, radius, orbit, center);
+ OrbitalBody* star = new OrbitalBody(this, star_name, Orbital::STAR, mass, radius, orbit, center);
star->map_name = map_name;
star->tex_name = img_name;
star->light = light;
@@ -487,7 +486,7 @@ StarSystem::ParsePlanet(TermStruct* val)
}
}
- OrbitalBody* planet = new(__FILE__,__LINE__) OrbitalBody(this, pln_name, Orbital::PLANET, mass, radius, orbit, primary_star);
+ OrbitalBody* planet = new OrbitalBody(this, pln_name, Orbital::PLANET, mass, radius, orbit, primary_star);
planet->map_name = map_name;
planet->tex_name = img_name;
planet->tex_high_res = hi_name;
@@ -604,7 +603,7 @@ StarSystem::ParseMoon(TermStruct* val)
}
}
- OrbitalBody* moon = new(__FILE__,__LINE__) OrbitalBody(this, pln_name, Orbital::MOON, mass, radius, orbit, primary_planet);
+ OrbitalBody* moon = new OrbitalBody(this, pln_name, Orbital::MOON, mass, radius, orbit, primary_planet);
moon->map_name = map_name;
moon->tex_name = img_name;
moon->tex_high_res = hi_name;
@@ -657,7 +656,7 @@ StarSystem::ParseRegion(TermStruct* val)
else if (pdef->name()->value() == "link") {
GetDefText(lnk_name, pdef, filename);
if (lnk_name[0]) {
- links.append(new(__FILE__,__LINE__) Text(lnk_name));
+ links.append(new Text(lnk_name));
}
}
@@ -685,7 +684,7 @@ StarSystem::ParseRegion(TermStruct* val)
if (!primary) primary = primary_planet;
if (!primary) primary = primary_star;
- OrbitalRegion* region = new(__FILE__,__LINE__) OrbitalRegion(this, rgn_name, 0, size, orbit, primary);
+ OrbitalRegion* region = new OrbitalRegion(this, rgn_name, 0, size, orbit, primary);
region->grid = grid;
region->inclination = inclination;
region->asteroids = asteroids;
@@ -871,7 +870,7 @@ StarSystem::ParseTerrain(TermStruct* val)
else {
if (!region)
- region = new(__FILE__,__LINE__) TerrainRegion(this, rgn_name, size, primary);
+ region = new TerrainRegion(this, rgn_name, size, primary);
TermStruct* val = pdef->term()->isStruct();
ParseLayer(region, val);
@@ -881,7 +880,7 @@ StarSystem::ParseTerrain(TermStruct* val)
}
if (!region)
- region = new(__FILE__,__LINE__) TerrainRegion(this, rgn_name, size, primary);
+ region = new TerrainRegion(this, rgn_name, size, primary);
region->grid = grid;
region->inclination = inclination;
@@ -970,7 +969,7 @@ StarSystem::Create()
// poly star shell:
if (sky_poly_stars.length()) {
- poly_stars = new(__FILE__,__LINE__) Solid;
+ poly_stars = new Solid;
poly_stars->Load(sky_poly_stars, 120);
poly_stars->SetLuminous(true);
poly_stars->SetInfinite(true);
@@ -981,14 +980,14 @@ StarSystem::Create()
if (sky_stars) {
Print("Point Stars: %d\n", sky_stars);
- point_stars = new(__FILE__,__LINE__) Stars(sky_stars);
+ point_stars = new Stars(sky_stars);
}
loader->SetDataPath(datapath);
// nebula:
if (sky_nebula.length()) {
- nebula = new(__FILE__,__LINE__) Solid;
+ nebula = new Solid;
nebula->Load(sky_nebula, 100);
nebula->SetLuminous(true);
nebula->SetInfinite(true);
@@ -1000,7 +999,7 @@ StarSystem::Create()
// atmospheric haze:
if (sky_haze.length()) {
loader->SetDataPath(datapath);
- haze = new(__FILE__,__LINE__) TerrainHaze();
+ haze = new TerrainHaze();
haze->Load(sky_haze, 120);
haze->SetInfinite(true);
@@ -1045,7 +1044,7 @@ StarSystem::CreateBody(OrbitalBody& body)
Point starloc = body.loc;
starloc = starloc.OtherHand();
- PlanetRep* rep = new(__FILE__,__LINE__) PlanetRep(body.tex_name,
+ PlanetRep* rep = new PlanetRep(body.tex_name,
0,
body.radius,
starloc,
@@ -1058,7 +1057,7 @@ StarSystem::CreateBody(OrbitalBody& body)
sun_brightness = body.light;
sun_color = body.color;
- Light* sun_light = new(__FILE__,__LINE__) Light(1.1f);
+ Light* sun_light = new Light(1.1f);
sun_light->SetColor(sun_color);
sun_light->SetShadow(true);
sun_light->MoveTo(body.loc);
@@ -1068,7 +1067,7 @@ StarSystem::CreateBody(OrbitalBody& body)
body.light_rep = sun_light;
if (body.back != Color::Black) {
- Light* back_light = new(__FILE__,__LINE__) Light(0.6f);
+ Light* back_light = new Light(0.6f);
back_light->SetColor(body.back);
back_light->SetShadow(false);
back_light->MoveTo(body.loc * -1);
@@ -1103,7 +1102,7 @@ StarSystem::CreateBody(OrbitalBody& body)
glow = body.tex_glow_high_res;
}
- PlanetRep* rep = new(__FILE__,__LINE__) PlanetRep(surface,
+ PlanetRep* rep = new PlanetRep(surface,
glow,
body.radius,
planetloc,
diff --git a/Stars45/Starshatter.cpp b/Stars45/Starshatter.cpp
index b49fbc4..77aaca5 100644
--- a/Stars45/Starshatter.cpp
+++ b/Stars45/Starshatter.cpp
@@ -8,7 +8,6 @@
*/
-#include "MemDebug.h"
#include "Starshatter.h"
#include "MenuScreen.h"
@@ -208,20 +207,20 @@ chat_mode(0), exit_time(1.2), cutscene(0)
// create the fonts
loader->SetDataPath("Fonts/");
- HUDfont = new(__FILE__,__LINE__) Font("HUDfont");
+ HUDfont = new Font("HUDfont");
FontMgr::Register("HUD", HUDfont);
- GUIfont = new(__FILE__,__LINE__) Font("GUIfont");
+ GUIfont = new Font("GUIfont");
FontMgr::Register("GUI", GUIfont);
- GUI_small_font = new(__FILE__,__LINE__) Font("GUIsmall");
+ GUI_small_font = new Font("GUIsmall");
FontMgr::Register("GUIsmall", GUI_small_font);
- limerick12 = new(__FILE__,__LINE__) Font("Limerick12");
- limerick18 = new(__FILE__,__LINE__) Font("Limerick18");
- terminal = new(__FILE__,__LINE__) Font("Terminal");
- verdana = new(__FILE__,__LINE__) Font("Verdana");
- ocrb = new(__FILE__,__LINE__) Font("OCRB");
+ limerick12 = new Font("Limerick12");
+ limerick18 = new Font("Limerick18");
+ terminal = new Font("Terminal");
+ verdana = new Font("Verdana");
+ ocrb = new Font("OCRB");
FontMgr::Register("Limerick12", limerick12);
FontMgr::Register("Limerick18", limerick18);
@@ -421,23 +420,23 @@ Starshatter::InitGame()
Print(" Loaded key.cfg\n\n");
// create the appropriate motion controller and player_ship
- input = new(__FILE__,__LINE__) MultiController;
- Keyboard* k = new(__FILE__,__LINE__) Keyboard;
+ input = new MultiController;
+ Keyboard* k = new Keyboard;
input->AddController(k);
ActivateKeyboardLayout(GetKeyboardLayout(0), 0);
- mouse_input = new(__FILE__,__LINE__) MouseController;
+ mouse_input = new MouseController;
input->AddController(mouse_input);
::Print("\nStarshatter::InitGame() create joystick\n");
- Joystick* j = new(__FILE__,__LINE__) Joystick;
+ Joystick* j = new Joystick;
j->SetSensitivity(15, 5000);
input->AddController(j);
Joystick::EnumerateDevices();
::Print("\n");
- head_tracker = new(__FILE__,__LINE__) TrackIR();
+ head_tracker = new TrackIR();
MapKeys();
SystemDesign::Initialize("sys.def");
@@ -742,7 +741,7 @@ Starshatter::CreateWorld()
// create world
if (!world) {
- Sim* sim = new(__FILE__,__LINE__) Sim(input);
+ Sim* sim = new Sim(input);
world = sim;
Print(" World Created.\n");
}
@@ -753,8 +752,6 @@ Starshatter::CreateWorld()
void
Starshatter::InstantiateMission()
{
- Memory::Check();
-
current_mission = 0;
if (Campaign::GetCampaign()) {
@@ -777,8 +774,6 @@ Starshatter::InstantiateMission()
Print(" Mission Instantiated.\n");
}
-
- Memory::Check();
}
// +--------------------------------------------------------------------+
@@ -1080,8 +1075,6 @@ Starshatter::GameState()
if (music_dir)
music_dir->ExecFrame();
-
- Memory::Check();
}
// +--------------------------------------------------------------------+
@@ -2239,11 +2232,11 @@ Starshatter::SetupSplash()
int screen_width = GetScreenWidth();
int screen_height = GetScreenHeight();
- gamewin = new(__FILE__,__LINE__) Window(screen, 0, 0, screen_width, screen_height);
- splash = new(__FILE__,__LINE__) FadeView(gamewin, 2, 2, 2);
+ gamewin = new Window(screen, 0, 0, screen_width, screen_height);
+ splash = new FadeView(gamewin, 2, 2, 2);
gamewin->AddView(splash);
- gamewin->AddView(new(__FILE__,__LINE__) ImgView(gamewin, &splash_image));
+ gamewin->AddView(new ImgView(gamewin, &splash_image));
screen->AddWindow(gamewin);
}
@@ -2257,7 +2250,7 @@ Starshatter::SetupMenuScreen()
menuscreen = 0;
}
- menuscreen = new(__FILE__,__LINE__) MenuScreen();
+ menuscreen = new MenuScreen();
menuscreen->Setup(screen);
}
@@ -2271,7 +2264,7 @@ Starshatter::SetupCmpnScreen()
cmpnscreen = 0;
}
- cmpnscreen = new(__FILE__,__LINE__) CmpnScreen();
+ cmpnscreen = new CmpnScreen();
cmpnscreen->Setup(screen);
}
@@ -2285,7 +2278,7 @@ Starshatter::SetupPlanScreen()
planscreen = 0;
}
- planscreen = new(__FILE__,__LINE__) PlanScreen();
+ planscreen = new PlanScreen();
planscreen->Setup(screen);
}
@@ -2299,7 +2292,7 @@ Starshatter::SetupLoadScreen()
loadscreen = 0;
}
- loadscreen = new(__FILE__,__LINE__) LoadScreen();
+ loadscreen = new LoadScreen();
loadscreen->Setup(screen);
}
@@ -2313,7 +2306,7 @@ Starshatter::SetupGameScreen()
gamescreen = 0;
}
- gamescreen = new(__FILE__,__LINE__) GameScreen();
+ gamescreen = new GameScreen();
gamescreen->Setup(screen);
gamescreen->SetFieldOfView(field_of_view);
@@ -2357,7 +2350,7 @@ Starshatter::LoadVideoConfig(const char* filename)
blocklen = ftell(f);
::fseek(f, 0, SEEK_SET);
- block = new(__FILE__,__LINE__) BYTE[blocklen+1];
+ block = new BYTE[blocklen+1];
block[blocklen] = 0;
::fread(block, blocklen, 1, f);
@@ -2367,7 +2360,7 @@ Starshatter::LoadVideoConfig(const char* filename)
if (blocklen == 0)
return;
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -2624,7 +2617,7 @@ Starshatter::ExecCutscene(const char* msn_file, const char* path)
if (!world)
CreateWorld();
- cutscene_mission = new(__FILE__,__LINE__) Mission(0);
+ cutscene_mission = new Mission(0);
cutscene_basetime = StarSystem::GetBaseTime();
if (cutscene_mission->Load(msn_file, path)) {
@@ -2782,7 +2775,7 @@ Starshatter::StartLobby()
NetServerConfig* server_config = NetServerConfig::GetInstance();
if (server_config)
- net_lobby = new(__FILE__,__LINE__) NetLobbyServer;
+ net_lobby = new NetLobbyServer;
}
else {
diff --git a/Stars45/StarshipAI.cpp b/Stars45/StarshipAI.cpp
index 5b6b697..69abdae 100644
--- a/Stars45/StarshipAI.cpp
+++ b/Stars45/StarshipAI.cpp
@@ -11,7 +11,6 @@
Starship (low-level) Artificial Intelligence class
*/
-#include "MemDebug.h"
#include "StarshipAI.h"
#include "StarshipTacticalAI.h"
#include "Ship.h"
@@ -63,7 +62,7 @@ StarshipAI::StarshipAI(SimObject* s)
}
else {
- tactical = new(__FILE__,__LINE__) StarshipTacticalAI(this);
+ tactical = new StarshipTacticalAI(this);
}
sub_select_time = Clock::GetInstance()->GameTime() + (DWORD) Random(0, 2000);
diff --git a/Stars45/StarshipTacticalAI.cpp b/Stars45/StarshipTacticalAI.cpp
index 1e59b79..4e20c1b 100644
--- a/Stars45/StarshipTacticalAI.cpp
+++ b/Stars45/StarshipTacticalAI.cpp
@@ -17,7 +17,6 @@
#include <algorithm>
-#include "MemDebug.h"
#include "StarshipTacticalAI.h"
#include "ShipAI.h"
#include "Ship.h"
@@ -269,7 +268,7 @@ StarshipTacticalAI::CheckBugOut(Ship* c_ship, double rng)
}
if (escort) {
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(escort, ship, RadioMessage::QUANTUM_TO);
+ RadioMessage* msg = new RadioMessage(escort, ship, RadioMessage::QUANTUM_TO);
if (msg) {
msg->SetInfo(dst->Name());
RadioTraffic::Transmit(msg);
diff --git a/Stars45/SteerAI.cpp b/Stars45/SteerAI.cpp
index 5573b95..6bc758a 100644
--- a/Stars45/SteerAI.cpp
+++ b/Stars45/SteerAI.cpp
@@ -11,7 +11,6 @@
Steering (low-level) Artificial Intelligence class
*/
-#include "MemDebug.h"
#include "SteerAI.h"
#include "SeekerAI.h"
#include "FighterAI.h"
@@ -88,17 +87,17 @@ Director*
SteerAI::Create(SimObject* self, int type)
{
switch (type) {
- case SEEKER: return new(__FILE__,__LINE__) SeekerAI(self);
+ case SEEKER: return new SeekerAI(self);
break;
- case STARSHIP: return new(__FILE__,__LINE__) StarshipAI(self);
+ case STARSHIP: return new StarshipAI(self);
break;
- case GROUND: return new(__FILE__,__LINE__) GroundAI(self);
+ case GROUND: return new GroundAI(self);
break;
default:
- case FIGHTER: return new(__FILE__,__LINE__) FighterAI(self);
+ case FIGHTER: return new FighterAI(self);
break;
}
}
diff --git a/Stars45/System.cpp b/Stars45/System.cpp
index 51af575..111addc 100644
--- a/Stars45/System.cpp
+++ b/Stars45/System.cpp
@@ -11,7 +11,6 @@
Generic Ship Subsystem class
*/
-#include "MemDebug.h"
#include "System.h"
#include "SystemDesign.h"
#include "Component.h"
@@ -57,7 +56,7 @@ emcon(s.emcon)
// cast-away const
ListIter<Component> c = (List<Component>&) s.components;
while (++c) {
- Component* comp = new(__FILE__,__LINE__) Component(*(c.value()));
+ Component* comp = new Component(*(c.value()));
comp->SetSystem(this);
components.append(comp);
}
@@ -90,7 +89,7 @@ System::SetDesign(SystemDesign* d)
ListIter<ComponentDesign> cd = design->components;
while (++cd) {
- Component* comp = new(__FILE__,__LINE__) Component(cd.value(), this);
+ Component* comp = new Component(cd.value(), this);
components.append(comp);
}
}
diff --git a/Stars45/SystemDesign.cpp b/Stars45/SystemDesign.cpp
index 7d9869e..97b65a3 100644
--- a/Stars45/SystemDesign.cpp
+++ b/Stars45/SystemDesign.cpp
@@ -11,7 +11,6 @@
Weapon Design parameters class
*/
-#include "MemDebug.h"
#include "SystemDesign.h"
#include "Component.h"
@@ -49,7 +48,7 @@ SystemDesign::Initialize(const char* filename)
BYTE* block;
int blocklen = loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -81,7 +80,7 @@ SystemDesign::Initialize(const char* filename)
}
else {
TermStruct* val = def->term()->isStruct();
- SystemDesign* design = new(__FILE__,__LINE__) SystemDesign;
+ SystemDesign* design = new SystemDesign;
for (int i = 0; i < val->elements()->size(); i++) {
TermDef* pdef = val->elements()->at(i)->isDef();
@@ -94,7 +93,7 @@ SystemDesign::Initialize(const char* filename)
}
else {
TermStruct* val2 = pdef->term()->isStruct();
- ComponentDesign* comp_design = new(__FILE__,__LINE__) ComponentDesign;
+ ComponentDesign* comp_design = new ComponentDesign;
for (int i = 0; i < val2->elements()->size(); i++) {
TermDef* pdef2 = val2->elements()->at(i)->isDef();
diff --git a/Stars45/TacRefDlg.cpp b/Stars45/TacRefDlg.cpp
index 3a4e965..ff623bc 100644
--- a/Stars45/TacRefDlg.cpp
+++ b/Stars45/TacRefDlg.cpp
@@ -11,7 +11,6 @@
Tactical Reference Dialog Active Window class
*/
-#include "MemDebug.h"
#include "TacRefDlg.h"
#include "MenuScreen.h"
#include "Campaign.h"
@@ -126,13 +125,13 @@ TacRefDlg::RegisterControls()
scene.AddLight(back_light);
- camview = new(__FILE__,__LINE__) CameraView(beauty, &cam, &scene);
+ camview = new CameraView(beauty, &cam, &scene);
camview->SetProjectionType(Video::PROJECTION_PERSPECTIVE);
camview->SetFieldOfView(2);
beauty->AddView(camview);
- imgview = new(__FILE__,__LINE__) ImgView(beauty, 0);
+ imgview = new ImgView(beauty, 0);
imgview->SetBlend(Video::BLEND_ALPHA);
}
}
@@ -178,7 +177,7 @@ TacRefDlg::SelectShip(const ShipDesign* design)
for (int i = 0; i < n; i++) {
Model* model = design->models[level].at(i);
- Solid* s = new(__FILE__,__LINE__) Solid;
+ Solid* s = new Solid;
s->UseModel(model);
s->CreateShadows(1);
s->MoveTo(*design->offsets[level].at(i));
diff --git a/Stars45/TacticalAI.cpp b/Stars45/TacticalAI.cpp
index 82385f3..7f4e64d 100644
--- a/Stars45/TacticalAI.cpp
+++ b/Stars45/TacticalAI.cpp
@@ -11,7 +11,6 @@
Generic Ship Tactical Level AI class
*/
-#include "MemDebug.h"
#include "TacticalAI.h"
#include "ShipAI.h"
#include "CarrierAI.h"
@@ -52,7 +51,7 @@ directed_tgtid(0)
if (ship && ship->GetHangar() && ship->GetCommandAILevel() > 0 &&
ship != sim->GetPlayerShip())
- carrier_ai = new(__FILE__,__LINE__) CarrierAI(ship, ship_ai->GetAILevel());
+ carrier_ai = new CarrierAI(ship, ship_ai->GetAILevel());
}
agression = 0;
@@ -299,7 +298,7 @@ TacticalAI::ProcessOrders()
double range = Point(controller->Location() - ship->Location()).length();
if (range < 50e3) {
- msg = new(__FILE__,__LINE__) RadioMessage(controller, ship, RadioMessage::CALL_INBOUND);
+ msg = new RadioMessage(controller, ship, RadioMessage::CALL_INBOUND);
RadioTraffic::Transmit(msg);
}
}
diff --git a/Stars45/TacticalView.cpp b/Stars45/TacticalView.cpp
index 0f59619..a631fad 100644
--- a/Stars45/TacticalView.cpp
+++ b/Stars45/TacticalView.cpp
@@ -11,7 +11,6 @@
View class for Tactical Data Readout HUD Overlay
*/
-#include "MemDebug.h"
#include "TacticalView.h"
#include "QuantumView.h"
#include "RadioView.h"
@@ -80,7 +79,7 @@ msg_ship(0), base_alt(0), move_alt(0)
mouse_action.x = 0;
mouse_action.y = 0;
- menu_view = new(__FILE__,__LINE__) MenuView(window);
+ menu_view = new MenuView(window);
}
TacticalView::~TacticalView()
@@ -918,39 +917,39 @@ TacticalView::Initialize()
static int initialized = 0;
if (initialized) return;
- view_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.view"));
+ view_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.view"));
view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.forward"), VIEW_FORWARD);
view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.chase"), VIEW_CHASE);
view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.orbit"), VIEW_ORBIT);
view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.padlock"), VIEW_PADLOCK);
- emcon_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.emcon"));
+ emcon_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.emcon"));
- quantum_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.quantum"));
- farcast_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.farcast"));
+ quantum_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.quantum"));
+ farcast_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.farcast"));
- main_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.main"));
+ main_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.main"));
- action_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.action"));
+ action_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.action"));
action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.engage"), RadioMessage::ATTACK);
action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.bracket"), RadioMessage::BRACKET);
action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.escort"), RadioMessage::ESCORT);
action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.identify"), RadioMessage::IDENTIFY);
action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.hold"), RadioMessage::WEP_HOLD);
- formation_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.formation"));
+ formation_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.formation"));
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.diamond"), RadioMessage::GO_DIAMOND);
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.spread"), RadioMessage::GO_SPREAD);
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.box"), RadioMessage::GO_BOX);
formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.trail"), RadioMessage::GO_TRAIL);
- sensors_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.emcon"));
+ sensors_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.emcon"));
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1);
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2);
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3);
sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE);
- fighter_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.context"));
+ fighter_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.context"));
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.action"), action_menu);
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.formation"), formation_menu);
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.sensors"), sensors_menu);
@@ -961,7 +960,7 @@ TacticalView::Initialize()
fighter_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.dock"), RadioMessage::DOCK_WITH);
fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.farcast"), farcast_menu);
- starship_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.context"));
+ starship_menu = new Menu(ContentBundle::GetInstance()->GetText("TacView.menu.context"));
starship_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.action"), action_menu);
starship_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.sensors"), sensors_menu);
starship_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL);
@@ -1025,7 +1024,7 @@ TacticalView::ProcessMenuItem(int action)
case RadioMessage::LAUNCH_PROBE:
if (msg_ship) {
Element* elem = msg_ship->GetElement();
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, action);
+ RadioMessage* msg = new RadioMessage(elem, ship, action);
if (msg)
RadioTraffic::Transmit(msg);
}
@@ -1078,7 +1077,7 @@ TacticalView::ProcessMenuItem(int action)
else {
Element* elem = msg_ship->GetElement();
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, RadioMessage::QUANTUM_TO);
+ RadioMessage* msg = new RadioMessage(elem, ship, RadioMessage::QUANTUM_TO);
if (msg) {
msg->SetInfo(rgn_name);
RadioTraffic::Transmit(msg);
@@ -1097,7 +1096,7 @@ TacticalView::ProcessMenuItem(int action)
if (rgn) {
Element* elem = msg_ship->GetElement();
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, RadioMessage::FARCAST_TO);
+ RadioMessage* msg = new RadioMessage(elem, ship, RadioMessage::FARCAST_TO);
if (msg) {
msg->SetInfo(rgn_name);
RadioTraffic::Transmit(msg);
@@ -1360,7 +1359,7 @@ TacticalView::SendMove()
if (GetMouseLoc3D()) {
Element* elem = msg_ship->GetElement();
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, RadioMessage::MOVE_PATROL);
+ RadioMessage* msg = new RadioMessage(elem, ship, RadioMessage::MOVE_PATROL);
Point dest = move_loc;
dest.y += move_alt;
msg->SetLocation(dest);
@@ -1468,7 +1467,7 @@ TacticalView::SendAction()
if (tgt) {
Element* elem = msg_ship->GetElement();
- RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, show_action);
+ RadioMessage* msg = new RadioMessage(elem, ship, show_action);
/***
Element* tgt_elem = tgt->GetElement();
diff --git a/Stars45/Term.cpp b/Stars45/Term.cpp
index 4c9831c..acd2c74 100644
--- a/Stars45/Term.cpp
+++ b/Stars45/Term.cpp
@@ -12,7 +12,6 @@
*/
-#include "MemDebug.h"
#include "Term.h"
#include "Utils.h"
diff --git a/Stars45/Terrain.cpp b/Stars45/Terrain.cpp
index 2cbdf3b..4d0a5f9 100644
--- a/Stars45/Terrain.cpp
+++ b/Stars45/Terrain.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "Terrain.h"
#include "TerrainApron.h"
#include "TerrainClouds.h"
@@ -58,7 +57,7 @@ aprons(0), clouds(0), terrain_normals(0)
ListIter<TerrainLayer> iter = region->GetLayers();
while (++iter) {
TerrainLayer* orig = iter.value();
- TerrainLayer* copy = new(__FILE__,__LINE__) TerrainLayer;
+ TerrainLayer* copy = new TerrainLayer;
*copy = *orig;
layers.append(copy);
}
@@ -158,9 +157,9 @@ Terrain::BuildTerrain()
double offset = -subdivisions/2;
if (water_texture) {
- water = new(__FILE__,__LINE__) Water*[6];
+ water = new Water*[6];
for (i = 0; i < 6; i++) {
- water[i] = new(__FILE__,__LINE__) Water();
+ water[i] = new Water();
int n = (1<<i) + 1;
water[i]->Init(n, (float) (scale*patch_size), 90.0f);
}
@@ -182,10 +181,10 @@ Terrain::BuildTerrain()
loader->LoadTexture(layer->detail_name, layer->detail_texture);
}
- patches = new(__FILE__,__LINE__) TerrainPatch*[subdivisions*subdivisions];
+ patches = new TerrainPatch*[subdivisions*subdivisions];
if (water_texture)
- water_patches = new(__FILE__,__LINE__) TerrainPatch*[subdivisions*subdivisions];
+ water_patches = new TerrainPatch*[subdivisions*subdivisions];
for (i = 0; i < subdivisions; i++) {
for (j = 0; j < subdivisions; j++) {
@@ -195,10 +194,10 @@ Terrain::BuildTerrain()
Point p2((j1 + offset+1)*dx, mtnscale, (i + offset+1)*dz);
int index = i*subdivisions+j;
- patches[index] = new(__FILE__,__LINE__) TerrainPatch(this, &terrain_patch, rect, p1, p2);
+ patches[index] = new TerrainPatch(this, &terrain_patch, rect, p1, p2);
if (water_texture && patches[index]->MinHeight() < 3)
- water_patches[index] = new(__FILE__,__LINE__) TerrainPatch(this, rect, p1, p2, 30);
+ water_patches[index] = new TerrainPatch(this, rect, p1, p2, 30);
else if (water_patches != 0)
water_patches[index] = 0;
@@ -211,7 +210,7 @@ Terrain::BuildTerrain()
offset = -3.0/2;
double xoffset = offset + 1.0/16.0;
- aprons = new(__FILE__,__LINE__) TerrainApron*[8];
+ aprons = new TerrainApron*[8];
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
@@ -221,7 +220,7 @@ Terrain::BuildTerrain()
Point p1((j1 + xoffset )*dx, 0, (i + offset )*dz);
Point p2((j1 + xoffset+1)*dx, mtnscale, (i + offset+1)*dz);
- aprons[a++] = new(__FILE__,__LINE__) TerrainApron(this, &terrain_apron, rect, p1, p2);
+ aprons[a++] = new TerrainApron(this, &terrain_apron, rect, p1, p2);
}
}
}
@@ -235,12 +234,12 @@ Terrain::BuildTerrain()
if (state == Weather::MODERATE_CLOUDS)
nclouds *= 2;
- clouds = new(__FILE__,__LINE__) TerrainClouds*[nclouds];
+ clouds = new TerrainClouds*[nclouds];
a = 0;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
- clouds[a] = new(__FILE__,__LINE__) TerrainClouds(this, 0);
+ clouds[a] = new TerrainClouds(this, 0);
double xloc = (j-1) * 75000 + (rand()/32768.0 - 0.5) * 50000;
double yloc = (i-1) * 75000 + (rand()/32768.0 - 0.5) * 50000;
@@ -255,7 +254,7 @@ Terrain::BuildTerrain()
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
- clouds[a] = new(__FILE__,__LINE__) TerrainClouds(this, 1);
+ clouds[a] = new TerrainClouds(this, 1);
double xloc = (j-1) * 75000 + (rand()/32768.0 - 0.5) * 50000;
double yloc = (i-1) * 75000 + (rand()/32768.0 - 0.5) * 50000;
@@ -283,11 +282,11 @@ Terrain::BuildNormals()
int w = terrain_patch.Width();
int h = terrain_patch.Height();
Color* pix = terrain_patch.HiPixels();
- BYTE* alt = new(__FILE__,__LINE__) BYTE[h*w];
+ BYTE* alt = new BYTE[h*w];
int nverts = w * h;
double scale = region->MountainScale() / (region->LateralScale() * 2.0);
- terrain_normals = new(__FILE__,__LINE__) Vec3B[nverts];
+ terrain_normals = new Vec3B[nverts];
ZeroMemory(terrain_normals, sizeof(Vec3B) * nverts);
diff --git a/Stars45/TerrainApron.cpp b/Stars45/TerrainApron.cpp
index e5cbdbc..6c605cf 100644
--- a/Stars45/TerrainApron.cpp
+++ b/Stars45/TerrainApron.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "Terrain.h"
#include "TerrainApron.h"
#include "TerrainRegion.h"
@@ -46,7 +45,7 @@ const Point& p1, const Point& p2)
loc.y = base;
radius = (float) (size * 0.75);
- heights = new(__FILE__,__LINE__) float[MAX_VERTS];
+ heights = new float[MAX_VERTS];
float* pHeight = heights;
@@ -104,11 +103,11 @@ TerrainApron::BuildApron()
int nverts = MAX_VERTS;
int npolys = detail_size * detail_size * 2;
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
model->SetLuminous(true);
model->SetDynamic(true);
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
mtl->Ka = ColorValue(0.5f, 0.5f, 0.5f);
mtl->Kd = ColorValue(0.3f, 0.6f, 0.2f);
mtl->Ks = Color::Black;
@@ -118,7 +117,7 @@ TerrainApron::BuildApron()
model->GetMaterials().append(mtl);
- Surface* s = new(__FILE__,__LINE__) Surface;
+ Surface* s = new Surface;
VertexSet* vset = 0;
if (s) {
@@ -199,7 +198,7 @@ TerrainApron::BuildApron()
// create continguous segments for each material:
s->Normalize();
- Segment* segment = new(__FILE__,__LINE__) Segment(npolys, s->GetPolys(), mtl, model);
+ Segment* segment = new Segment(npolys, s->GetPolys(), mtl, model);
s->GetSegments().append(segment);
model->AddSurface(s);
diff --git a/Stars45/TerrainClouds.cpp b/Stars45/TerrainClouds.cpp
index 1acfc0a..6c7bde1 100644
--- a/Stars45/TerrainClouds.cpp
+++ b/Stars45/TerrainClouds.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "TerrainClouds.h"
#include "Terrain.h"
#include "TerrainRegion.h"
@@ -86,9 +85,9 @@ TerrainClouds::BuildClouds()
mtl_shade.blend = Material::MTL_TRANSLUCENT;
mtl_shade.tex_diffuse = shade_texture;
- verts = new(__FILE__,__LINE__) VertexSet(nverts);
- mverts = new(__FILE__,__LINE__) Vec3[nverts];
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ verts = new VertexSet(nverts);
+ mverts = new Vec3[nverts];
+ polys = new Poly[npolys];
verts->nverts = nverts;
diff --git a/Stars45/TerrainHaze.cpp b/Stars45/TerrainHaze.cpp
index da84a75..590b357 100644
--- a/Stars45/TerrainHaze.cpp
+++ b/Stars45/TerrainHaze.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "Terrain.h"
#include "TerrainHaze.h"
#include "TerrainRegion.h"
diff --git a/Stars45/TerrainPatch.cpp b/Stars45/TerrainPatch.cpp
index 046b8f6..af70e0f 100644
--- a/Stars45/TerrainPatch.cpp
+++ b/Stars45/TerrainPatch.cpp
@@ -10,7 +10,6 @@
========
*/
-#include "MemDebug.h"
#include "Terrain.h"
#include "TerrainLayer.h"
#include "TerrainPatch.h"
@@ -62,7 +61,7 @@ const Point& p1, const Point& p2)
loc.y = base;
radius = (float) (size * 0.75);
- heights = new(__FILE__,__LINE__) float[MAX_VERTS];
+ heights = new float[MAX_VERTS];
float* pHeight = heights;
int tscale = rect.w / (PATCH_SIZE-1);
@@ -101,7 +100,7 @@ const Point& p1, const Point& p2)
}
}
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
mtl->Ka = ColorValue(0.5f, 0.5f, 0.5f);
mtl->Kd = ColorValue(0.3f, 0.6f, 0.2f);
mtl->Ks = Color::Black;
@@ -122,7 +121,7 @@ const Point& p1, const Point& p2)
if (!texd)
texd = terrain->DetailTexture(0);
- mtl = new(__FILE__,__LINE__) Material;
+ mtl = new Material;
mtl->Ka = ColorValue(0.5f, 0.5f, 0.5f);
mtl->Kd = ColorValue(0.3f, 0.6f, 0.2f);
mtl->Ks = Color::Black;
@@ -173,7 +172,7 @@ double sea_level)
loc.y = base;
radius = (float) (size * 0.75);
- heights = new(__FILE__,__LINE__) float[MAX_VERTS];
+ heights = new float[MAX_VERTS];
float* pHeight = heights;
int i, j;
@@ -184,7 +183,7 @@ double sea_level)
}
}
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
mtl->Ka = Color::Gray;
mtl->Kd = Color::White;
mtl->Ks = Color::White;
@@ -273,7 +272,7 @@ TerrainPatch::BuildDetailLevel(int level)
if (detail_size > PATCH_SIZE)
return false;
- Model* model = new(__FILE__,__LINE__) Model;
+ Model* model = new Model;
detail_levels[level] = model;
model->SetLuminous(luminous);
@@ -294,7 +293,7 @@ TerrainPatch::BuildDetailLevel(int level)
total = npolys;
}
- Surface* s = new(__FILE__,__LINE__) Surface;
+ Surface* s = new Surface;
VertexSet* vset = 0;
if (s) {
@@ -575,7 +574,7 @@ TerrainPatch::BuildDetailLevel(int level)
}
if (!segment) {
- segment = new(__FILE__,__LINE__) Segment;
+ segment = new Segment;
segment->npolys = 1;
segment->polys = &spolys[n];
diff --git a/Stars45/TerrainRegion.cpp b/Stars45/TerrainRegion.cpp
index f54aea0..0a05df0 100644
--- a/Stars45/TerrainRegion.cpp
+++ b/Stars45/TerrainRegion.cpp
@@ -11,7 +11,6 @@
Various Heavenly Bodies
*/
-#include "MemDebug.h"
#include "TerrainRegion.h"
#include "Sky.h"
#include "TerrainHaze.h"
@@ -222,7 +221,7 @@ TerrainRegion::LoadSkyColors(const char* bmp_name)
void
TerrainRegion::AddLayer(double h, const char* tile, const char* detail)
{
- TerrainLayer* layer = new(__FILE__,__LINE__) TerrainLayer;
+ TerrainLayer* layer = new TerrainLayer;
layer->min_height = h;
layer->tile_name = tile;
diff --git a/Stars45/TexCubeDX9.cpp b/Stars45/TexCubeDX9.cpp
index 755a0b1..c2e5a89 100644
--- a/Stars45/TexCubeDX9.cpp
+++ b/Stars45/TexCubeDX9.cpp
@@ -11,7 +11,6 @@
Direct3D Texture Cache
*/
-#include "MemDebug.h"
#include "TexCubeDX9.h"
#include "VideoDX9.h"
#include "Bitmap.h"
diff --git a/Stars45/TexDX9.cpp b/Stars45/TexDX9.cpp
index 75b5d0f..b2c5b2b 100644
--- a/Stars45/TexDX9.cpp
+++ b/Stars45/TexDX9.cpp
@@ -11,7 +11,6 @@
Direct3D Texture Cache
*/
-#include "MemDebug.h"
#include "TexDX9.h"
#include "VideoDX9.h"
#include "Bitmap.h"
@@ -57,7 +56,7 @@ TexCacheDX9::TexCacheDX9(VideoDX9* v)
d3ddevice = video->D3DDevice();
// clear the texture cache
- cache = new(__FILE__,__LINE__) TexCacheDX9Entry[DX9_TEXTURE_CACHE_SIZE];
+ cache = new TexCacheDX9Entry[DX9_TEXTURE_CACHE_SIZE];
vidmem = video->VidMemFree();
}
diff --git a/Stars45/Thruster.cpp b/Stars45/Thruster.cpp
index dda7410..3852516 100644
--- a/Stars45/Thruster.cpp
+++ b/Stars45/Thruster.cpp
@@ -11,7 +11,6 @@
Weapon class
*/
-#include "MemDebug.h"
#include "Thruster.h"
#include "Component.h"
#include "Drive.h"
@@ -502,7 +501,7 @@ void
Thruster::AddPort(int type, const Point& loc, DWORD fire, float flare_scale)
{
if (flare_scale == 0) flare_scale = scale;
- ThrusterPort* port = new(__FILE__,__LINE__) ThrusterPort(type, loc, fire, flare_scale);
+ ThrusterPort* port = new ThrusterPort(type, loc, fire, flare_scale);
ports.append(port);
}
@@ -513,13 +512,13 @@ Thruster::CreatePort(int type, const Point& loc, DWORD fire, float flare_scale)
Bitmap* trail_bmp = drive_trail_bitmap[subtype];
if (subtype != Drive::STEALTH) {
- Sprite* flare_rep = new(__FILE__,__LINE__) Sprite(flare_bmp);
+ Sprite* flare_rep = new Sprite(flare_bmp);
flare_rep->Scale(flare_scale * 0.667f);
flare_rep->SetShade(0);
- Bolt* trail_rep = new(__FILE__,__LINE__) Bolt(flare_scale * 30, flare_scale * 8, trail_bmp, true);
+ Bolt* trail_rep = new Bolt(flare_scale * 30, flare_scale * 8, trail_bmp, true);
- ThrusterPort* port = new(__FILE__,__LINE__) ThrusterPort(type, loc, fire, flare_scale);
+ ThrusterPort* port = new ThrusterPort(type, loc, fire, flare_scale);
port->flare = flare_rep;
port->trail = trail_rep;
ports.append(port);
diff --git a/Stars45/Token.cpp b/Stars45/Token.cpp
index b9453a9..2cc97b5 100644
--- a/Stars45/Token.cpp
+++ b/Stars45/Token.cpp
@@ -11,7 +11,6 @@
Scanner class implementation
*/
-#include "MemDebug.h"
#include "Token.h"
#include "Reader.h"
#include "Text.h"
@@ -44,7 +43,7 @@ Token::Token(const Token& rhs)
strcpy_s(mSymbol, rhs.mSymbol);
}
else {
- mFullSymbol = new(__FILE__, __LINE__) char[mLength + 1];
+ mFullSymbol = new char[mLength + 1];
strcpy(mFullSymbol, rhs.mFullSymbol);
}
}
@@ -64,7 +63,7 @@ Token::Token(const char* s, int t, int k, int l, int c)
strcpy_s(mSymbol, s);
}
else {
- mFullSymbol = new(__FILE__, __LINE__) char[mLength + 1];
+ mFullSymbol = new char[mLength + 1];
strcpy(mFullSymbol, s);
}
}
@@ -77,7 +76,7 @@ Token::Token(const Text& s, int t, int k, int l, int c)
strcpy_s(mSymbol, s.data());
}
else {
- mFullSymbol = new(__FILE__, __LINE__) char[mLength + 1];
+ mFullSymbol = new char[mLength + 1];
strcpy(mFullSymbol, s.data());
}
}
@@ -109,7 +108,7 @@ Token::operator = (const Token& rhs)
strcpy_s(mSymbol, rhs.mSymbol);
}
else {
- mFullSymbol = new(__FILE__, __LINE__) char[mLength + 1];
+ mFullSymbol = new char[mLength + 1];
strcpy(mFullSymbol, rhs.mFullSymbol);
}
@@ -296,7 +295,7 @@ Scanner::Scanner(const Scanner& rhs)
reader(rhs.reader),
line(rhs.line), old_line(0), lineStart(rhs.lineStart)
{
- str = new(__FILE__, __LINE__) char [strlen(rhs.str) + 1];
+ str = new char [strlen(rhs.str) + 1];
strcpy(str, rhs.str);
}
@@ -304,7 +303,7 @@ Scanner::Scanner(const Text& s)
: reader(0), index(0), old_index(0), length(s.length()), line(0),
old_line(0), lineStart(0)
{
- str = new(__FILE__, __LINE__) char [s.length() + 1];
+ str = new char [s.length() + 1];
strcpy(str, s.data());
}
@@ -319,7 +318,7 @@ Scanner&
Scanner::operator = (const Scanner& rhs)
{
delete [] str;
- str = new(__FILE__, __LINE__) char [strlen(rhs.str) + 1];
+ str = new char [strlen(rhs.str) + 1];
strcpy(str, rhs.str);
index = rhs.index;
@@ -338,7 +337,7 @@ void
Scanner::Load(const Text& s)
{
delete [] str;
- str = new(__FILE__, __LINE__) char [s.length() + 1];
+ str = new char [s.length() + 1];
strcpy(str, s.data());
index = 0;
@@ -465,7 +464,7 @@ Scanner::Get(Need need)
int col = start - lineStart;
if (line == 0) col++;
- char* buf = new(__FILE__, __LINE__) char [extent + 1];
+ char* buf = new char [extent + 1];
strncpy(buf, str + start, extent);
buf[extent] = '\0';
diff --git a/Stars45/TrackIR.cpp b/Stars45/TrackIR.cpp
index 6fdebe4..fbe8108 100644
--- a/Stars45/TrackIR.cpp
+++ b/Stars45/TrackIR.cpp
@@ -11,7 +11,6 @@
TrackIR head tracker interface class
*/
-#include "MemDebug.h"
#include "TrackIR.h"
#include "NPClient.h"
#include "NPClientWraps.h"
diff --git a/Stars45/Trail.cpp b/Stars45/Trail.cpp
index 80735d2..a29deca 100644
--- a/Stars45/Trail.cpp
+++ b/Stars45/Trail.cpp
@@ -11,7 +11,6 @@
Missile Trail representation class
*/
-#include "MemDebug.h"
#include "Trail.h"
#include "Weapon.h"
#include "Sim.h"
@@ -38,8 +37,8 @@ Trail::Trail(Bitmap* tex, int n)
mtl.luminous = true;
if (maxtrail < 4) maxtrail = 512;
- trail = new(__FILE__,__LINE__) Point[maxtrail];
- verts = new(__FILE__,__LINE__) VertexSet(maxtrail*2);
+ trail = new Point[maxtrail];
+ verts = new VertexSet(maxtrail*2);
verts->Clear();
verts->nverts = 0;
@@ -50,7 +49,7 @@ Trail::Trail(Bitmap* tex, int n)
verts->tv[i] = (i & 1) ? 1.0f : 0.0f;
}
- polys = new(__FILE__,__LINE__) Poly[maxtrail];
+ polys = new Poly[maxtrail];
for (int i = 0; i < maxtrail; i++) {
polys[i].vertex_set = verts;
diff --git a/Stars45/VidDlg.cpp b/Stars45/VidDlg.cpp
index aca48fa..8a4e4ed 100644
--- a/Stars45/VidDlg.cpp
+++ b/Stars45/VidDlg.cpp
@@ -12,7 +12,6 @@
*/
#include "GameWinDX9.h"
-#include "MemDebug.h"
#include "VidDlg.h"
#include "BaseScreen.h"
#include "Starshatter.h"
diff --git a/Stars45/Video.cpp b/Stars45/Video.cpp
index 73e5e8a..368f50c 100644
--- a/Stars45/Video.cpp
+++ b/Stars45/Video.cpp
@@ -11,7 +11,6 @@
Abstract Video Interface (singleton definition)
*/
-#include "MemDebug.h"
#include "Video.h"
#include "VideoSettings.h"
diff --git a/Stars45/VideoDX9.cpp b/Stars45/VideoDX9.cpp
index ecc0332..cf7ed68 100644
--- a/Stars45/VideoDX9.cpp
+++ b/Stars45/VideoDX9.cpp
@@ -11,7 +11,6 @@
Direct3D Video class for DirectX 9
*/
-#include "MemDebug.h"
#include "VideoDX9.h"
#include "VideoDX9Enum.h"
#include "VideoDX9VertexBuffer.h"
@@ -262,7 +261,7 @@ magic_fx(0), magic_fx_code(0), magic_fx_code_len(0)
HRESULT err = E_OUTOFMEMORY;
d3d = Direct3DCreate9(D3D_SDK_VERSION);
- dx9enum = new(__FILE__,__LINE__) VideoDX9Enum(d3d);
+ dx9enum = new VideoDX9Enum(d3d);
if (d3d && dx9enum) {
if (vs) {
@@ -391,7 +390,7 @@ magic_fx(0), magic_fx_code(0), magic_fx_code_len(0)
ZeroMemory(&rect, sizeof(rect));
if (!texcache)
- texcache = new(__FILE__,__LINE__) TexCacheDX9(this);
+ texcache = new TexCacheDX9(this);
if (texcache)
texcache->count++;
@@ -622,7 +621,7 @@ VideoDX9::CreateBuffers()
UINT index_size = sizeof(WORD);
if (!screen_vbuf) {
- screen_vbuf = new(__FILE__,__LINE__) VideoDX9VertexBuffer(
+ screen_vbuf = new VideoDX9VertexBuffer(
this,
NUM_SCREEN_VERTS,
vertex_size,
@@ -631,14 +630,14 @@ VideoDX9::CreateBuffers()
}
if (!screen_ibuf) {
- screen_ibuf = new(__FILE__,__LINE__) VideoDX9IndexBuffer(
+ screen_ibuf = new VideoDX9IndexBuffer(
this,
NUM_SCREEN_INDICES,
D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
}
- screen_line_verts = new(__FILE__,__LINE__) VideoDX9ScreenVertex[256];
- line_verts = new(__FILE__,__LINE__) VideoDX9LineVertex[512];
+ screen_line_verts = new VideoDX9ScreenVertex[256];
+ line_verts = new VideoDX9LineVertex[512];
// create effects:
LPD3DXBUFFER code_buffer = 0;
@@ -658,7 +657,7 @@ VideoDX9::CreateBuffers()
magic_fx_code_len = ftell(f);
::fseek(f, 0, SEEK_SET);
- magic_fx_code = new(__FILE__,__LINE__) BYTE[magic_fx_code_len+1];
+ magic_fx_code = new BYTE[magic_fx_code_len+1];
if (magic_fx_code) {
::fread(magic_fx_code, magic_fx_code_len, 1, f);
magic_fx_code[magic_fx_code_len] = 0;
@@ -1497,7 +1496,7 @@ VideoDX9::SetEnvironment(Bitmap** faces)
}
if (!environment_cube) {
- environment_cube = new(__FILE__,__LINE__) TexCubeDX9(this);
+ environment_cube = new TexCubeDX9(this);
}
if (environment_cube) {
@@ -1762,14 +1761,14 @@ VideoDX9::DrawPolys(int npolys, Poly* polys)
DWORD fvf = 0;
void* verts = 0;
int vsize = 0;
- WORD* indices = new(__FILE__,__LINE__) WORD[npolys*6];
+ WORD* indices = new WORD[npolys*6];
if (polys->material) {
luminous = polys->material->luminous;
}
if (vset->tu1 != 0) {
- VideoDX9DetailVertex* v = new(__FILE__,__LINE__) VideoDX9DetailVertex[nverts];
+ VideoDX9DetailVertex* v = new VideoDX9DetailVertex[nverts];
verts = v;
vsize = sizeof(VideoDX9DetailVertex);
fvf = VideoDX9DetailVertex::FVF;
@@ -1792,7 +1791,7 @@ VideoDX9::DrawPolys(int npolys, Poly* polys)
}
else if (luminous) {
- VideoDX9LuminousVertex* v = new(__FILE__,__LINE__) VideoDX9LuminousVertex[nverts];
+ VideoDX9LuminousVertex* v = new VideoDX9LuminousVertex[nverts];
verts = v;
vsize = sizeof(VideoDX9LuminousVertex);
fvf = VideoDX9LuminousVertex::FVF;
@@ -1812,7 +1811,7 @@ VideoDX9::DrawPolys(int npolys, Poly* polys)
}
else {
- VideoDX9SolidVertex* v = new(__FILE__,__LINE__) VideoDX9SolidVertex[nverts];
+ VideoDX9SolidVertex* v = new VideoDX9SolidVertex[nverts];
verts = v;
vsize = sizeof(VideoDX9SolidVertex);
fvf = VideoDX9SolidVertex::FVF;
@@ -2828,7 +2827,7 @@ VideoDX9::DrawPoints(VertexSet* vset)
HRESULT hr = E_FAIL;
int nverts = vset->nverts;
- VideoDX9LineVertex* verts = new(__FILE__,__LINE__) VideoDX9LineVertex[nverts];
+ VideoDX9LineVertex* verts = new VideoDX9LineVertex[nverts];
if (verts) {
for (int i = 0; i < nverts; i++) {
@@ -2951,13 +2950,13 @@ VideoDX9::PrepareSurface(Surface* surf)
VideoDX9SurfaceData* surf_data = (VideoDX9SurfaceData*) surf->GetVideoPrivateData();
if (!surf_data) {
- surf_data = new(__FILE__,__LINE__) VideoDX9SurfaceData(surf->GetModel());
+ surf_data = new VideoDX9SurfaceData(surf->GetModel());
surface_has_tangent_data = false;
if (surf->GetVertexSet()->tangent && surf->GetVertexSet()->binormal) {
surface_has_tangent_data = true;
- surf_data->vertex_buffer = new(__FILE__,__LINE__) VideoDX9VertexBuffer(
+ surf_data->vertex_buffer = new VideoDX9VertexBuffer(
this,
nverts,
sizeof(VideoDX9NormalVertex),
@@ -2966,7 +2965,7 @@ VideoDX9::PrepareSurface(Surface* surf)
}
else if (detail) {
- surf_data->vertex_buffer = new(__FILE__,__LINE__) VideoDX9VertexBuffer(
+ surf_data->vertex_buffer = new VideoDX9VertexBuffer(
this,
nverts,
sizeof(VideoDX9DetailVertex),
@@ -2975,7 +2974,7 @@ VideoDX9::PrepareSurface(Surface* surf)
}
else if (luminous) {
- surf_data->vertex_buffer = new(__FILE__,__LINE__) VideoDX9VertexBuffer(
+ surf_data->vertex_buffer = new VideoDX9VertexBuffer(
this,
nverts,
sizeof(VideoDX9LuminousVertex),
@@ -2984,7 +2983,7 @@ VideoDX9::PrepareSurface(Surface* surf)
}
else {
- surf_data->vertex_buffer = new(__FILE__,__LINE__) VideoDX9VertexBuffer(
+ surf_data->vertex_buffer = new VideoDX9VertexBuffer(
this,
nverts,
sizeof(VideoDX9SolidVertex),
@@ -2992,7 +2991,7 @@ VideoDX9::PrepareSurface(Surface* surf)
dynamic | D3DUSAGE_WRITEONLY);
}
- surf_data->index_buffer = new(__FILE__,__LINE__) VideoDX9IndexBuffer(
+ surf_data->index_buffer = new VideoDX9IndexBuffer(
this,
nindices,
dynamic | D3DUSAGE_WRITEONLY);
@@ -3151,7 +3150,7 @@ VideoDX9::PrepareSurface(Surface* surf)
Segment* segment = seg_iter.value();
if (!segment->video_data) {
- VideoDX9SegmentData* seg_data = new(__FILE__,__LINE__) VideoDX9SegmentData;
+ VideoDX9SegmentData* seg_data = new VideoDX9SegmentData;
int num_tris = 0;
for (int i = 0; i < segment->npolys; i++)
diff --git a/Stars45/VideoDX9Enum.cpp b/Stars45/VideoDX9Enum.cpp
index 96f938a..c254513 100644
--- a/Stars45/VideoDX9Enum.cpp
+++ b/Stars45/VideoDX9Enum.cpp
@@ -11,7 +11,6 @@
Direct3D Video class for DirectX 9
*/
-#include "MemDebug.h"
#include "VideoDX9Enum.h"
#include "VideoSettings.h"
#include "Color.h"
@@ -267,7 +266,7 @@ VideoDX9Enum::Enumerate()
UINT num_adapters = d3d->GetAdapterCount();
for (UINT ordinal = 0; ordinal < num_adapters; ordinal++) {
- adapter_info = new(__FILE__,__LINE__) VideoDX9AdapterInfo;
+ adapter_info = new VideoDX9AdapterInfo;
if (!adapter_info)
return E_OUTOFMEMORY;
@@ -292,7 +291,7 @@ VideoDX9Enum::Enumerate()
continue;
}
- VideoDX9DisplayMode* dx9_display_mode = new(__FILE__,__LINE__) VideoDX9DisplayMode(display_mode);
+ VideoDX9DisplayMode* dx9_display_mode = new VideoDX9DisplayMode(display_mode);
if (!dx9_display_mode) {
delete adapter_info;
@@ -365,7 +364,7 @@ VideoDX9Enum::EnumerateDevices(VideoDX9AdapterInfo* adapter_info, std::vector<D3
VideoDX9DeviceInfo* device_info = 0;
for (int i = 0; i < 3; i++ ) {
- device_info = new(__FILE__,__LINE__) VideoDX9DeviceInfo;
+ device_info = new VideoDX9DeviceInfo;
if (!device_info)
return E_OUTOFMEMORY;
@@ -455,7 +454,7 @@ VideoDX9Enum::EnumerateDeviceCombos(VideoDX9DeviceInfo* device_info, std::vector
// multisample type, vertex processing type, and present interval.
VideoDX9DeviceCombo* device_combo = 0;
- device_combo = new(__FILE__,__LINE__) VideoDX9DeviceCombo;
+ device_combo = new VideoDX9DeviceCombo;
if (!device_combo)
return E_OUTOFMEMORY;
@@ -593,7 +592,7 @@ VideoDX9Enum::BuildDSMSConflictList(VideoDX9DeviceCombo* device_combo)
multisample_type,
NULL))) {
- VideoDX9FormatConflict* conflict = new(__FILE__,__LINE__) VideoDX9FormatConflict;
+ VideoDX9FormatConflict* conflict = new VideoDX9FormatConflict;
conflict->ds_format = depth_format;
conflict->multisample_type = multisample_type;
diff --git a/Stars45/VideoDX9VertexBuffer.cpp b/Stars45/VideoDX9VertexBuffer.cpp
index dcbde0e..6febba5 100644
--- a/Stars45/VideoDX9VertexBuffer.cpp
+++ b/Stars45/VideoDX9VertexBuffer.cpp
@@ -11,7 +11,6 @@
Direct3D Video class for DirectX 9
*/
-#include "MemDebug.h"
#include "VideoDX9VertexBuffer.h"
#include "Color.h"
diff --git a/Stars45/VideoFactory.cpp b/Stars45/VideoFactory.cpp
index cb4d542..68da591 100644
--- a/Stars45/VideoFactory.cpp
+++ b/Stars45/VideoFactory.cpp
@@ -11,7 +11,6 @@
Video and Polygon Renderer Factory class
*/
-#include "MemDebug.h"
#include "VideoFactory.h"
#include "VideoDX9.h"
@@ -32,7 +31,7 @@ Video*
VideoFactory::CreateVideo(VideoSettings* vs)
{
if (!video) {
- video = (Video*) new(__FILE__,__LINE__) VideoDX9(hwnd, vs);
+ video = (Video*) new VideoDX9(hwnd, vs);
if (!video) {
delete video;
@@ -60,7 +59,7 @@ SoundCard*
VideoFactory::CreateSoundCard()
{
if (!audio) {
- audio = new(__FILE__,__LINE__) SoundCardD3D(hwnd);
+ audio = new SoundCardD3D(hwnd);
Sound::UseSoundCard(audio);
}
diff --git a/Stars45/VideoSettings.cpp b/Stars45/VideoSettings.cpp
index c56dddb..9ef43b9 100644
--- a/Stars45/VideoSettings.cpp
+++ b/Stars45/VideoSettings.cpp
@@ -11,7 +11,6 @@
Video Settings class implementation
*/
-#include "MemDebug.h"
#include "VideoSettings.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/Water.cpp b/Stars45/Water.cpp
index b35b2c2..5509938 100644
--- a/Stars45/Water.cpp
+++ b/Stars45/Water.cpp
@@ -11,7 +11,6 @@
Water surface effect w/ reflection and caustics
*/
-#include "MemDebug.h"
#include "Water.h"
#include "Random.h"
@@ -115,13 +114,13 @@ Water::Init(int n, float s, float d)
if (surface)
delete [] surface;
- surface = new(__FILE__,__LINE__) WATER_SURFACE[n*n];
+ surface = new WATER_SURFACE[n*n];
ZeroMemory(surface, n*n * sizeof(WATER_SURFACE));
if (waves)
delete [] waves;
- waves = new(__FILE__,__LINE__) float[WAVE_SIZE*4];
+ waves = new float[WAVE_SIZE*4];
double f = 1.0 / (double) WAVE_SIZE;
for (int i = 0; i < WAVE_SIZE; i++) {
diff --git a/Stars45/Weapon.cpp b/Stars45/Weapon.cpp
index 33a3238..b5a0fd3 100644
--- a/Stars45/Weapon.cpp
+++ b/Stars45/Weapon.cpp
@@ -11,7 +11,6 @@
Weapon class
*/
-#include "MemDebug.h"
#include "Weapon.h"
#include "Shot.h"
#include "Drone.h"
@@ -126,7 +125,7 @@ Weapon::Weapon(const Weapon& w)
active_barrel = -1;
if (design->beam) {
- beams = new(__FILE__,__LINE__) Shot* [nbarrels];
+ beams = new Shot* [nbarrels];
ZeroMemory(beams, sizeof(Shot*) * nbarrels);
}
@@ -217,13 +216,13 @@ Weapon::SetOwner(Ship* s)
ship = s;
if (design->turret_model) {
- Solid* t = new(__FILE__,__LINE__) Solid;
+ Solid* t = new Solid;
t->UseModel(design->turret_model);
turret = t;
}
if (design->turret_base_model) {
- Solid* t = new(__FILE__,__LINE__) Solid;
+ Solid* t = new Solid;
t->UseModel(design->turret_base_model);
turret_base = t;
}
@@ -234,7 +233,7 @@ Weapon::SetOwner(Ship* s)
design->shot_model != 0)
{
for (int i = 0; i < nbarrels; i++) {
- Solid* s = new(__FILE__,__LINE__) Solid;
+ Solid* s = new Solid;
s->UseModel(design->shot_model);
visible_stores[i] = s;
@@ -832,10 +831,10 @@ Shot*
Weapon::CreateShot(const Point& loc, const Camera& cam, WeaponDesign* dsn, const Ship* own)
{
if (dsn->drone)
- return new(__FILE__,__LINE__) Drone(loc, cam, dsn, own);
+ return new Drone(loc, cam, dsn, own);
else
- return new(__FILE__,__LINE__) Shot(loc, cam, dsn, own);
+ return new Shot(loc, cam, dsn, own);
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/WeaponDesign.cpp b/Stars45/WeaponDesign.cpp
index b658c25..aa116b0 100644
--- a/Stars45/WeaponDesign.cpp
+++ b/Stars45/WeaponDesign.cpp
@@ -11,7 +11,6 @@
Weapon Design parameters class
*/
-#include "MemDebug.h"
#include "WeaponDesign.h"
#include "ShipDesign.h"
#include "Weapon.h"
@@ -187,7 +186,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
BYTE* block;
int blocklen = loader->LoadBuffer(filename, block, true);
- Parser parser(new(__FILE__,__LINE__) BlockReader((const char*) block, blocklen));
+ Parser parser(new BlockReader((const char*) block, blocklen));
Term* term = parser.ParseTerm();
if (!term) {
@@ -226,7 +225,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
}
else {
TermStruct* val = def->term()->isStruct();
- WeaponDesign* design = new(__FILE__,__LINE__) WeaponDesign;
+ WeaponDesign* design = new WeaponDesign;
design->type = type++;
if (defname == "primary") {
@@ -471,7 +470,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
}
if (design->anim_length > 0) {
- design->animation = new(__FILE__,__LINE__) Bitmap[design->anim_length];
+ design->animation = new Bitmap[design->anim_length];
for (int i = 0; i < design->anim_length; i++) {
Bitmap* p = design->animation + i;
loader->LoadBitmap(design->anim_frames[i], *p, Bitmap::BMP_TRANSLUCENT);
@@ -508,7 +507,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
if (p.length())
loader->SetDataPath(p);
- design->turret_model = new(__FILE__,__LINE__) Model;
+ design->turret_model = new Model;
design->turret_model->Load(t, design->scale);
if (design->turret_base.length()) {
@@ -531,7 +530,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
if (p.length())
loader->SetDataPath(p);
- design->turret_base_model = new(__FILE__,__LINE__) Model;
+ design->turret_base_model = new Model;
design->turret_base_model->Load(t, design->scale);
}
@@ -559,7 +558,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
if (p.length())
loader->SetDataPath(p);
- design->shot_model = new(__FILE__,__LINE__) Model;
+ design->shot_model = new Model;
design->shot_model->Load(t, design->scale);
loader->SetDataPath(path);
diff --git a/Stars45/WeaponGroup.cpp b/Stars45/WeaponGroup.cpp
index e21479a..5519c68 100644
--- a/Stars45/WeaponGroup.cpp
+++ b/Stars45/WeaponGroup.cpp
@@ -11,7 +11,6 @@
Weapon Control Category (Group) class
*/
-#include "MemDebug.h"
#include "WeaponGroup.h"
#include "Ship.h"
diff --git a/Stars45/Weather.cpp b/Stars45/Weather.cpp
index 9c2b170..b894b3e 100644
--- a/Stars45/Weather.cpp
+++ b/Stars45/Weather.cpp
@@ -11,7 +11,6 @@
Manages local weather conditions according to the system stardate
*/
-#include "MemDebug.h"
#include "Weather.h"
#include "StarSystem.h"
#include "Game.h"
diff --git a/Stars45/WebBrowser.cpp b/Stars45/WebBrowser.cpp
index 2e22c74..fba3d71 100644
--- a/Stars45/WebBrowser.cpp
+++ b/Stars45/WebBrowser.cpp
@@ -11,7 +11,6 @@
Helper class to find and launch user's default web browser
*/
-#include "MemDebug.h"
#include "WebBrowser.h"
// +--------------------------------------------------------------------+
diff --git a/Stars45/WepView.cpp b/Stars45/WepView.cpp
index bd9a1cb..2da3b61 100644
--- a/Stars45/WepView.cpp
+++ b/Stars45/WepView.cpp
@@ -11,7 +11,6 @@
View class for Tactical HUD Overlay
*/
-#include "MemDebug.h"
#include "WepView.h"
#include "HUDView.h"
#include "HUDSounds.h"
diff --git a/Stars45/Window.cpp b/Stars45/Window.cpp
index d1286c0..c04d45b 100644
--- a/Stars45/Window.cpp
+++ b/Stars45/Window.cpp
@@ -11,7 +11,6 @@
Window class
*/
-#include "MemDebug.h"
#include "Window.h"
#include "Bitmap.h"
#include "Color.h"