Skip to content

Commit 8dfdc4d

Browse files
author
nitrocaster
committed
Replace xr_new<T> to new T.
1 parent b287444 commit 8dfdc4d

File tree

775 files changed

+3239
-3240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

775 files changed

+3239
-3240
lines changed

src/Common/object_cloner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct CCloner {
2020
template <>
2121
IC static void clone<true>(const T &_1, T &_2)
2222
{
23-
_2 = xr_new<object_type_traits::remove_pointer<T>::type>(*_1);
23+
_2 = new object_type_traits::remove_pointer<T>::type(*_1);
2424
CCloner::clone (*_1,*_2);
2525
}
2626
};

src/Common/object_loader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct CLoader {
4646
template <>
4747
IC static void load_data<true>(T &data, M &stream, const P &p)
4848
{
49-
CLoader<M,P>::load_data (*(data = xr_new<object_type_traits::remove_pointer<T>::type>()),stream,p);
49+
CLoader<M,P>::load_data (*(data = new object_type_traits::remove_pointer<T>::type()),stream,p);
5050
}
5151
};
5252

src/Layers/xrRender/D3DUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void CDrawUtilities::OnDeviceCreate()
233233
vs_TL.create (FVF::F_TL,RCache.Vertex.Buffer(),RCache.Index.Buffer());
234234
vs_LIT.create (FVF::F_LIT,RCache.Vertex.Buffer(),RCache.Index.Buffer());
235235

236-
m_Font = xr_new<CGameFont>("stat_font");
236+
m_Font = new CGameFont("stat_font");
237237
}
238238

239239
void CDrawUtilities::OnDeviceDestroy()

src/Layers/xrRender/DetailManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void CDetailManager::Load ()
128128
IReader* m_fs = dtFS->open_chunk(1);
129129
for (u32 m_id = 0; m_id < m_count; m_id++)
130130
{
131-
CDetail* dt = xr_new<CDetail> ();
131+
CDetail* dt = new CDetail ();
132132
IReader* S = m_fs->open_chunk(m_id);
133133
dt->Load (S);
134134
objects.push_back (dt);

src/Layers/xrRender/FProgressive.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void FProgressive::Load (const char* N, IReader *data, u32 dwFlags)
5454
destructor<IReader> geomdef (data->open_chunk (OGF_FASTPATH));
5555
destructor<IReader> def (geomdef().open_chunk (OGF_SWIDATA));
5656

57-
xSWI = xr_new<FSlideWindowItem>();
57+
xSWI = new FSlideWindowItem();
5858
xSWI->reserved[0] = def().r_u32(); // reserved 16 bytes
5959
xSWI->reserved[1] = def().r_u32();
6060
xSWI->reserved[2] = def().r_u32();

src/Layers/xrRender/FVisual.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void Fvisual::Load (const char* N, IReader *data, u32 dwFlags)
7373
destructor<IReader> def (geomdef().open_chunk (OGF_GCONTAINER));
7474

7575
// we have fast-mesh
76-
m_fast = xr_new<IRender_Mesh> ();
76+
m_fast = new IRender_Mesh ();
7777

7878
// verts
7979
D3DVERTEXELEMENT9* fmt = 0;

src/Layers/xrRender/HOM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void CHOM::Load ()
114114
}
115115

116116
// Create AABB-tree
117-
m_pModel = xr_new<CDB::MODEL> ();
117+
m_pModel = new CDB::MODEL ();
118118
m_pModel->build (CL.getV(),int(CL.getVS()),CL.getT(),int(CL.getTS()));
119119
bEnabled = TRUE;
120120
S->close ();

src/Layers/xrRender/Light_DB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void CLight_DB::Unload ()
166166

167167
light* CLight_DB::Create ()
168168
{
169-
light* L = xr_new<light> ();
169+
light* L = new light ();
170170
L->flags.bStatic = false;
171171
L->flags.bActive = false;
172172
L->flags.bShadow = true;

src/Layers/xrRender/ModelPool.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,41 +34,41 @@ dxRender_Visual* CModelPool::Instance_Create(u32 type)
3434
// Check types
3535
switch (type) {
3636
case MT_NORMAL: // our base visual
37-
V = xr_new<Fvisual> ();
37+
V = new Fvisual ();
3838
break;
3939
case MT_HIERRARHY:
40-
V = xr_new<FHierrarhyVisual> ();
40+
V = new FHierrarhyVisual ();
4141
break;
4242
case MT_PROGRESSIVE: // dynamic-resolution visual
43-
V = xr_new<FProgressive> ();
43+
V = new FProgressive ();
4444
break;
4545
case MT_SKELETON_ANIM:
46-
V = xr_new<CKinematicsAnimated> ();
46+
V = new CKinematicsAnimated ();
4747
break;
4848
case MT_SKELETON_RIGID:
49-
V = xr_new<CKinematics> ();
49+
V = new CKinematics ();
5050
break;
5151
case MT_SKELETON_GEOMDEF_PM:
52-
V = xr_new<CSkeletonX_PM> ();
52+
V = new CSkeletonX_PM ();
5353
break;
5454
case MT_SKELETON_GEOMDEF_ST:
55-
V = xr_new<CSkeletonX_ST> ();
55+
V = new CSkeletonX_ST ();
5656
break;
5757
case MT_PARTICLE_EFFECT:
58-
V = xr_new<PS::CParticleEffect> ();
58+
V = new PS::CParticleEffect ();
5959
break;
6060
case MT_PARTICLE_GROUP:
61-
V = xr_new<PS::CParticleGroup> ();
61+
V = new PS::CParticleGroup ();
6262
break;
6363
#ifndef _EDITOR
6464
case MT_LOD:
65-
V = xr_new<FLOD> ();
65+
V = new FLOD ();
6666
break;
6767
case MT_TREE_ST:
68-
V = xr_new<FTreeVisual_ST> ();
68+
V = new FTreeVisual_ST ();
6969
break;
7070
case MT_TREE_PM:
71-
V = xr_new<FTreeVisual_PM> ();
71+
V = new FTreeVisual_PM ();
7272
break;
7373
#endif
7474
default:
@@ -199,7 +199,7 @@ CModelPool::CModelPool()
199199
bLogging = TRUE;
200200
bForceDiscard = FALSE;
201201
bAllowChildrenDuplicate = TRUE;
202-
g_pMotionsContainer = xr_new<motions_container>();
202+
g_pMotionsContainer = new motions_container();
203203
}
204204

205205
CModelPool::~CModelPool()

src/Layers/xrRender/NvTriStripObjects.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed
104104

105105
// create the face info and add it to the list of faces, but only if this exact face doesn't already
106106
// exist in the list
107-
NvFaceInfo *faceInfo = xr_new<NvFaceInfo>(v0, v1, v2);
107+
NvFaceInfo *faceInfo = new NvFaceInfo(v0, v1, v2);
108108
if(!AlreadyExists(faceInfo, faceInfos))
109109
{
110110
faceInfos.push_back(faceInfo);
@@ -114,7 +114,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed
114114
if (edgeInfo01 == NULL){
115115

116116
// create the info
117-
edgeInfo01 = xr_new<NvEdgeInfo>(v0, v1);
117+
edgeInfo01 = new NvEdgeInfo(v0, v1);
118118

119119
// update the linked list on both
120120
edgeInfo01->m_nextV0 = edgeInfos[v0];
@@ -137,7 +137,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed
137137
if (edgeInfo12 == NULL){
138138

139139
// create the info
140-
edgeInfo12 = xr_new<NvEdgeInfo> (v1, v2);
140+
edgeInfo12 = new NvEdgeInfo (v1, v2);
141141

142142
// update the linked list on both
143143
edgeInfo12->m_nextV0 = edgeInfos[v1];
@@ -160,7 +160,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed
160160
if (edgeInfo20 == NULL){
161161

162162
// create the info
163-
edgeInfo20 = xr_new<NvEdgeInfo>(v2, v0);
163+
edgeInfo20 = new NvEdgeInfo(v2, v0);
164164

165165
// update the linked list on both
166166
edgeInfo20->m_nextV0 = edgeInfos[v2];
@@ -698,7 +698,7 @@ void NvStripifier::RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec&
698698
bool *bVisitedList = xr_alloc<bool> (tempFaceList.size());
699699
ZeroMemory (bVisitedList, tempFaceList.size()*sizeof(bool));
700700

701-
VertexCache* vcache = xr_new<VertexCache> (cacheSize);
701+
VertexCache* vcache = new VertexCache (cacheSize);
702702

703703
int bestNumHits = -1;
704704
int numHits = 0;
@@ -966,7 +966,7 @@ void NvStripifier::SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripIn
966966
int j;
967967
for(j = 0; j < numTimes; j++)
968968
{
969-
currentStrip = xr_new<NvStripInfo> (startInfo, 0, -1);
969+
currentStrip = new NvStripInfo (startInfo, 0, -1);
970970

971971
for(int faceCtr = j*threshold; faceCtr < threshold+(j*threshold); faceCtr++) {
972972
currentStrip->m_faces.push_back(allStrips[i]->m_faces[faceCtr]);
@@ -979,7 +979,7 @@ void NvStripifier::SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripIn
979979

980980
if(numLeftover != 0)
981981
{
982-
currentStrip = xr_new<NvStripInfo> (startInfo, 0, -1);
982+
currentStrip = new NvStripInfo (startInfo, 0, -1);
983983

984984
for(int k = 0; k < numLeftover; k++)
985985
{
@@ -993,7 +993,7 @@ void NvStripifier::SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripIn
993993
{
994994
//we're not just doing a tempStrips.push_back(allBigStrips[i]) because
995995
// this way we can _delete allBigStrips later to xr_free the memory
996-
currentStrip = xr_new<NvStripInfo> (startInfo, 0, -1);
996+
currentStrip = new NvStripInfo (startInfo, 0, -1);
997997

998998
for(int j = 0; j < allStrips[i]->m_faces.size(); j++)
999999
currentStrip->m_faces.push_back(allStrips[i]->m_faces[j]);
@@ -1010,7 +1010,7 @@ void NvStripifier::SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripIn
10101010
if(tempStrips2.size() != 0)
10111011
{
10121012
//Optimize for the vertex cache
1013-
VertexCache* vcache = xr_new<VertexCache> (cacheSize);
1013+
VertexCache* vcache = new VertexCache (cacheSize);
10141014

10151015
float bestNumHits = -1.0f;
10161016
float numHits = 0;
@@ -1264,32 +1264,32 @@ void NvStripifier::FindAllStrips(NvStripInfoVec &allStrips,
12641264

12651265
// build the strip off of this face's 0-1 edge
12661266
NvEdgeInfo *edge01 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1);
1267-
NvStripInfo *strip01 = xr_new<NvStripInfo> (NvStripStartInfo(nextFace, edge01, true), stripId++, experimentId++);
1267+
NvStripInfo *strip01 = new NvStripInfo (NvStripStartInfo(nextFace, edge01, true), stripId++, experimentId++);
12681268
experiments[experimentIndex++].push_back(strip01);
12691269

12701270
// build the strip off of this face's 1-0 edge
12711271
NvEdgeInfo *edge10 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1);
1272-
NvStripInfo *strip10 = xr_new<NvStripInfo> (NvStripStartInfo(nextFace, edge10, false), stripId++, experimentId++);
1272+
NvStripInfo *strip10 = new NvStripInfo (NvStripStartInfo(nextFace, edge10, false), stripId++, experimentId++);
12731273
experiments[experimentIndex++].push_back(strip10);
12741274

12751275
// build the strip off of this face's 1-2 edge
12761276
NvEdgeInfo *edge12 = FindEdgeInfo(allEdgeInfos, nextFace->m_v1, nextFace->m_v2);
1277-
NvStripInfo *strip12 = xr_new<NvStripInfo> (NvStripStartInfo(nextFace, edge12, true), stripId++, experimentId++);
1277+
NvStripInfo *strip12 = new NvStripInfo (NvStripStartInfo(nextFace, edge12, true), stripId++, experimentId++);
12781278
experiments[experimentIndex++].push_back(strip12);
12791279

12801280
// build the strip off of this face's 2-1 edge
12811281
NvEdgeInfo *edge21 = FindEdgeInfo(allEdgeInfos, nextFace->m_v1, nextFace->m_v2);
1282-
NvStripInfo *strip21 = xr_new<NvStripInfo> (NvStripStartInfo(nextFace, edge21, false), stripId++, experimentId++);
1282+
NvStripInfo *strip21 = new NvStripInfo (NvStripStartInfo(nextFace, edge21, false), stripId++, experimentId++);
12831283
experiments[experimentIndex++].push_back(strip21);
12841284

12851285
// build the strip off of this face's 2-0 edge
12861286
NvEdgeInfo *edge20 = FindEdgeInfo(allEdgeInfos, nextFace->m_v2, nextFace->m_v0);
1287-
NvStripInfo *strip20 = xr_new<NvStripInfo> (NvStripStartInfo(nextFace, edge20, true), stripId++, experimentId++);
1287+
NvStripInfo *strip20 = new NvStripInfo (NvStripStartInfo(nextFace, edge20, true), stripId++, experimentId++);
12881288
experiments[experimentIndex++].push_back(strip20);
12891289

12901290
// build the strip off of this face's 0-2 edge
12911291
NvEdgeInfo *edge02 = FindEdgeInfo(allEdgeInfos, nextFace->m_v2, nextFace->m_v0);
1292-
NvStripInfo *strip02 = xr_new<NvStripInfo> (NvStripStartInfo(nextFace, edge02, false), stripId++, experimentId++);
1292+
NvStripInfo *strip02 = new NvStripInfo (NvStripStartInfo(nextFace, edge02, false), stripId++, experimentId++);
12931293
experiments[experimentIndex++].push_back(strip02);
12941294
}
12951295

@@ -1312,7 +1312,7 @@ void NvStripifier::FindAllStrips(NvStripInfoVec &allStrips,
13121312
while (FindTraversal(allFaceInfos, allEdgeInfos, stripIter, startInfo)){
13131313

13141314
// create the _new strip info
1315-
stripIter = xr_new<NvStripInfo> (startInfo, stripId++, experimentId);
1315+
stripIter = new NvStripInfo (startInfo, stripId++, experimentId);
13161316

13171317
// build the next strip
13181318
stripIter->Build(allEdgeInfos, allFaceInfos);

0 commit comments

Comments
 (0)