Skip to content

Commit

Permalink
Replace xr_new<T> to new T.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Jan 31, 2016
1 parent b287444 commit 8dfdc4d
Show file tree
Hide file tree
Showing 775 changed files with 3,239 additions and 3,240 deletions.
2 changes: 1 addition & 1 deletion src/Common/object_cloner.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct CCloner {
template <>
IC static void clone<true>(const T &_1, T &_2)
{
_2 = xr_new<object_type_traits::remove_pointer<T>::type>(*_1);
_2 = new object_type_traits::remove_pointer<T>::type(*_1);
CCloner::clone (*_1,*_2);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/Common/object_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct CLoader {
template <>
IC static void load_data<true>(T &data, M &stream, const P &p)
{
CLoader<M,P>::load_data (*(data = xr_new<object_type_traits::remove_pointer<T>::type>()),stream,p);
CLoader<M,P>::load_data (*(data = new object_type_traits::remove_pointer<T>::type()),stream,p);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/D3DUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void CDrawUtilities::OnDeviceCreate()
vs_TL.create (FVF::F_TL,RCache.Vertex.Buffer(),RCache.Index.Buffer());
vs_LIT.create (FVF::F_LIT,RCache.Vertex.Buffer(),RCache.Index.Buffer());

m_Font = xr_new<CGameFont>("stat_font");
m_Font = new CGameFont("stat_font");
}

void CDrawUtilities::OnDeviceDestroy()
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/DetailManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void CDetailManager::Load ()
IReader* m_fs = dtFS->open_chunk(1);
for (u32 m_id = 0; m_id < m_count; m_id++)
{
CDetail* dt = xr_new<CDetail> ();
CDetail* dt = new CDetail ();
IReader* S = m_fs->open_chunk(m_id);
dt->Load (S);
objects.push_back (dt);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/FProgressive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void FProgressive::Load (const char* N, IReader *data, u32 dwFlags)
destructor<IReader> geomdef (data->open_chunk (OGF_FASTPATH));
destructor<IReader> def (geomdef().open_chunk (OGF_SWIDATA));

xSWI = xr_new<FSlideWindowItem>();
xSWI = new FSlideWindowItem();
xSWI->reserved[0] = def().r_u32(); // reserved 16 bytes
xSWI->reserved[1] = def().r_u32();
xSWI->reserved[2] = def().r_u32();
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/FVisual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void Fvisual::Load (const char* N, IReader *data, u32 dwFlags)
destructor<IReader> def (geomdef().open_chunk (OGF_GCONTAINER));

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

// verts
D3DVERTEXELEMENT9* fmt = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/HOM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void CHOM::Load ()
}

// Create AABB-tree
m_pModel = xr_new<CDB::MODEL> ();
m_pModel = new CDB::MODEL ();
m_pModel->build (CL.getV(),int(CL.getVS()),CL.getT(),int(CL.getTS()));
bEnabled = TRUE;
S->close ();
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Light_DB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void CLight_DB::Unload ()

light* CLight_DB::Create ()
{
light* L = xr_new<light> ();
light* L = new light ();
L->flags.bStatic = false;
L->flags.bActive = false;
L->flags.bShadow = true;
Expand Down
26 changes: 13 additions & 13 deletions src/Layers/xrRender/ModelPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,41 @@ dxRender_Visual* CModelPool::Instance_Create(u32 type)
// Check types
switch (type) {
case MT_NORMAL: // our base visual
V = xr_new<Fvisual> ();
V = new Fvisual ();
break;
case MT_HIERRARHY:
V = xr_new<FHierrarhyVisual> ();
V = new FHierrarhyVisual ();
break;
case MT_PROGRESSIVE: // dynamic-resolution visual
V = xr_new<FProgressive> ();
V = new FProgressive ();
break;
case MT_SKELETON_ANIM:
V = xr_new<CKinematicsAnimated> ();
V = new CKinematicsAnimated ();
break;
case MT_SKELETON_RIGID:
V = xr_new<CKinematics> ();
V = new CKinematics ();
break;
case MT_SKELETON_GEOMDEF_PM:
V = xr_new<CSkeletonX_PM> ();
V = new CSkeletonX_PM ();
break;
case MT_SKELETON_GEOMDEF_ST:
V = xr_new<CSkeletonX_ST> ();
V = new CSkeletonX_ST ();
break;
case MT_PARTICLE_EFFECT:
V = xr_new<PS::CParticleEffect> ();
V = new PS::CParticleEffect ();
break;
case MT_PARTICLE_GROUP:
V = xr_new<PS::CParticleGroup> ();
V = new PS::CParticleGroup ();
break;
#ifndef _EDITOR
case MT_LOD:
V = xr_new<FLOD> ();
V = new FLOD ();
break;
case MT_TREE_ST:
V = xr_new<FTreeVisual_ST> ();
V = new FTreeVisual_ST ();
break;
case MT_TREE_PM:
V = xr_new<FTreeVisual_PM> ();
V = new FTreeVisual_PM ();
break;
#endif
default:
Expand Down Expand Up @@ -199,7 +199,7 @@ CModelPool::CModelPool()
bLogging = TRUE;
bForceDiscard = FALSE;
bAllowChildrenDuplicate = TRUE;
g_pMotionsContainer = xr_new<motions_container>();
g_pMotionsContainer = new motions_container();
}

CModelPool::~CModelPool()
Expand Down
32 changes: 16 additions & 16 deletions src/Layers/xrRender/NvTriStripObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed

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

// create the info
edgeInfo01 = xr_new<NvEdgeInfo>(v0, v1);
edgeInfo01 = new NvEdgeInfo(v0, v1);

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

// create the info
edgeInfo12 = xr_new<NvEdgeInfo> (v1, v2);
edgeInfo12 = new NvEdgeInfo (v1, v2);

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

// create the info
edgeInfo20 = xr_new<NvEdgeInfo>(v2, v0);
edgeInfo20 = new NvEdgeInfo(v2, v0);

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

VertexCache* vcache = xr_new<VertexCache> (cacheSize);
VertexCache* vcache = new VertexCache (cacheSize);

int bestNumHits = -1;
int numHits = 0;
Expand Down Expand Up @@ -966,7 +966,7 @@ void NvStripifier::SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripIn
int j;
for(j = 0; j < numTimes; j++)
{
currentStrip = xr_new<NvStripInfo> (startInfo, 0, -1);
currentStrip = new NvStripInfo (startInfo, 0, -1);

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

if(numLeftover != 0)
{
currentStrip = xr_new<NvStripInfo> (startInfo, 0, -1);
currentStrip = new NvStripInfo (startInfo, 0, -1);

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

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

float bestNumHits = -1.0f;
float numHits = 0;
Expand Down Expand Up @@ -1264,32 +1264,32 @@ void NvStripifier::FindAllStrips(NvStripInfoVec &allStrips,

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

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

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

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

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

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

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

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

// build the next strip
stripIter->Build(allEdgeInfos, allFaceInfos);
Expand Down
8 changes: 4 additions & 4 deletions src/Layers/xrRender/PSLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool CPSLibrary::Load2()
xr_sprintf (_path, sizeof(_path),"%s%s",p_path, p_name);
if(0==stricmp(p_ext,".pe"))
{
PS::CPEDef* def = xr_new<PS::CPEDef>();
PS::CPEDef* def = new PS::CPEDef();
def->m_Name = _path;
if (def->Load2(ini))
m_PEDs.push_back(def);
Expand All @@ -156,7 +156,7 @@ bool CPSLibrary::Load2()
}else
if(0==stricmp(p_ext,".pg"))
{
PS::CPGDef* def = xr_new<PS::CPGDef>();
PS::CPGDef* def = new PS::CPGDef();
def->m_Name = _path;
if (def->Load2(ini))
m_PGDs.push_back(def);
Expand Down Expand Up @@ -201,7 +201,7 @@ bool CPSLibrary::Load(const char* nm)
if (OBJ){
IReader* O = OBJ->open_chunk(0);
for (int count=1; O; count++) {
PS::CPEDef* def = xr_new<PS::CPEDef>();
PS::CPEDef* def = new PS::CPEDef();
if (def->Load(*O)) m_PEDs.push_back(def);
else{ bRes = false; xr_delete(def); }
O->close();
Expand All @@ -215,7 +215,7 @@ bool CPSLibrary::Load(const char* nm)
if (OBJ){
IReader* O = OBJ->open_chunk(0);
for (int count=1; O; count++) {
PS::CPGDef* def = xr_new<PS::CPGDef>();
PS::CPGDef* def = new PS::CPGDef();
if (def->Load(*O)) m_PGDs.push_back(def);
else{ bRes = false; xr_delete(def); }
O->close();
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRender/ParticleGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void CPGDef::Clone (CPGDef* source)

m_Effects.resize(source->m_Effects.size(),0);
for (EffectIt d_it=m_Effects.begin(),s_it=source->m_Effects.begin(); s_it!=source->m_Effects.end(); s_it++,d_it++)
*d_it = xr_new<SEffect>(**s_it);
*d_it = new SEffect(**s_it);
}
#endif

Expand Down Expand Up @@ -73,7 +73,7 @@ BOOL CPGDef::Load(IReader& F)
{
m_Effects.resize(F.r_u32());
for (EffectIt it=m_Effects.begin(); it!=m_Effects.end(); it++){
*it = xr_new<SEffect>();
*it = new SEffect();
F.r_stringZ ((*it)->m_EffectName);
F.r_stringZ ((*it)->m_OnPlayChildName);
F.r_stringZ ((*it)->m_OnBirthChildName);
Expand Down Expand Up @@ -101,7 +101,7 @@ BOOL CPGDef::Load2(CInifile& ini)
string256 buff;
for (EffectIt it=m_Effects.begin(); it!=m_Effects.end(); ++it,++counter)
{
*it = xr_new<SEffect>();
*it = new SEffect();

xr_sprintf (buff, sizeof(buff), "effect_%04d", counter);

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ShaderElement* CResourceManager::_CreateElement (ShaderElement& S)
if (S.equal(*(v_elements[it]))) return v_elements[it];

// Create _new_ entry
ShaderElement* N = xr_new<ShaderElement>(S);
ShaderElement* N = new ShaderElement(S);
N->dwFlags |= xr_resource_flagged::RF_REGISTERED;
v_elements.push_back (N);
return N;
Expand Down Expand Up @@ -230,7 +230,7 @@ Shader* CResourceManager::_cpp_Create (IBlender* B, LPCSTR s_shader, LPCSTR s_te
if (S.equal(v_shaders[it])) return v_shaders[it];

// Create _new_ entry
Shader* N = xr_new<Shader>(S);
Shader* N = new Shader(S);
N->dwFlags |= xr_resource_flagged::RF_REGISTERED;
v_shaders.push_back (N);
return N;
Expand Down
Loading

0 comments on commit 8dfdc4d

Please sign in to comment.