Skip to content

Commit

Permalink
xrCore mk_pair replaced by std::make_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 4, 2017
1 parent 8bc6bf8 commit fa081b4
Show file tree
Hide file tree
Showing 50 changed files with 101 additions and 101 deletions.
6 changes: 3 additions & 3 deletions src/Layers/xrRender/Blender_Recorder_R2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#pragma hdrstop

#include "ResourceManager.h"
#include "blenders\Blender_Recorder.h"
#include "blenders\Blender.h"
#include "blenders/Blender_Recorder.h"
#include "blenders/Blender.h"

void fix_texture_name(LPSTR fn);

Expand Down Expand Up @@ -93,7 +93,7 @@ u32 CBlender_Compile::i_Sampler(LPCSTR _name)
void CBlender_Compile::i_Texture(u32 s, LPCSTR name)
{
if (name)
passTextures.push_back(mk_pair(s, ref_texture(RImplementation.Resources->_CreateTexture(name))));
passTextures.push_back(std::make_pair(s, ref_texture(RImplementation.Resources->_CreateTexture(name))));
}
void CBlender_Compile::i_Projective(u32 s, bool b)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/ColorMapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void ColorMapManager::UpdateTexture(const shared_str& strTexName, int iTex)
ref_texture tmp;
tmp.create(strTexName.c_str());

m_TexCache.insert(mk_pair(strTexName, tmp));
m_TexCache.insert(std::make_pair(strTexName, tmp));

ID3DBaseTexture* e0 = tmp->surface_get();
m_CMap[iTex]->surface_set(e0);
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/ModelPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ dxRender_Visual* CModelPool::Create(const char* name, IReader* data)
}
// 3. If found - return (cloned) reference
dxRender_Visual* Model = Instance_Duplicate(Base);
Registry.insert(mk_pair(Model, low_name));
Registry.insert(std::make_pair(Model, low_name));
return Model;
}
}
Expand Down Expand Up @@ -303,7 +303,7 @@ void CModelPool::DeleteInternal(dxRender_Visual*& V, BOOL bDiscard)
if (it != Registry.end())
{
// Registry entry found - move it to pool
Pool.insert(mk_pair(it->second, V));
Pool.insert(std::make_pair(it->second, V));
}
else
{
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 @@ -98,7 +98,7 @@ void CResourceManager::ED_UpdateBlender(LPCSTR Name, IBlender* data)
}
else
{
m_blenders.insert(mk_pair(xr_strdup(Name), data));
m_blenders.insert(std::make_pair(xr_strdup(Name), data));
}
}

Expand Down Expand Up @@ -441,7 +441,7 @@ void CResourceManager::_DumpMemoryUsage()
{
u32 m = I->second->flags.MemoryUsage;
shared_str n = I->second->cName;
mtex.insert(mk_pair(m, mk_pair(I->second->dwReference, n)));
mtex.insert(std::make_pair(m, std::make_pair(I->second->dwReference, n)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/ResourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class ECORE_API CResourceManager
void Delete(const Shader* S);
void RegisterConstantSetup(LPCSTR name, R_constant_setup* s)
{
v_constant_setup.push_back(mk_pair(shared_str(name), s));
v_constant_setup.push_back(std::make_pair(shared_str(name), s));
}

SGeometry* CreateGeom(D3DVERTEXELEMENT9* decl, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/ResourceManager_Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void CResourceManager::OnDeviceCreate(IReader* F)
chunk->seek(0);
B->Load(*chunk, desc.version);

std::pair<map_BlenderIt, bool> I = m_blenders.insert(mk_pair(xr_strdup(desc.cName), B));
std::pair<map_BlenderIt, bool> I = m_blenders.insert(std::make_pair(xr_strdup(desc.cName), B));
R_ASSERT2(I.second, "shader.xr - found duplicate name!!!");
}
chunk->close();
Expand Down
12 changes: 6 additions & 6 deletions src/Layers/xrRender/ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
{
SVS* _vs = new SVS();
_vs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_vs.insert(mk_pair(_vs->set_name(name), _vs));
m_vs.insert(std::make_pair(_vs->set_name(name), _vs));
if (0 == stricmp(_name, "null"))
{
_vs->vs = NULL;
Expand Down Expand Up @@ -265,7 +265,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR name)
{
SPS* _ps = new SPS();
_ps->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_ps.insert(mk_pair(_ps->set_name(name), _ps));
m_ps.insert(std::make_pair(_ps->set_name(name), _ps));
if (0 == stricmp(name, "null"))
{
_ps->ps = NULL;
Expand Down Expand Up @@ -381,7 +381,7 @@ CRT* CResourceManager::_CreateRT(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 Sam
{
CRT* RT = new CRT();
RT->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_rtargets.insert(mk_pair(RT->set_name(Name), RT));
m_rtargets.insert(std::make_pair(RT->set_name(Name), RT));
if (RDEVICE.b_is_Ready)
RT->create(Name, w, h, f);
return RT;
Expand Down Expand Up @@ -516,7 +516,7 @@ CTexture* CResourceManager::_CreateTexture(LPCSTR _Name)
{
CTexture* T = new CTexture();
T->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_textures.insert(mk_pair(T->set_name(Name), T));
m_textures.insert(std::make_pair(T->set_name(Name), T));
T->Preload();
if (RDEVICE.b_is_Ready && !bDeferredLoad)
T->Load();
Expand Down Expand Up @@ -570,7 +570,7 @@ CMatrix* CResourceManager::_CreateMatrix(LPCSTR Name)
CMatrix* M = new CMatrix();
M->dwFlags |= xr_resource_flagged::RF_REGISTERED;
M->dwReference = 1;
m_matrices.insert(mk_pair(M->set_name(Name), M));
m_matrices.insert(std::make_pair(M->set_name(Name), M));
return M;
}
}
Expand Down Expand Up @@ -608,7 +608,7 @@ CConstant* CResourceManager::_CreateConstant(LPCSTR Name)
CConstant* C = new CConstant();
C->dwFlags |= xr_resource_flagged::RF_REGISTERED;
C->dwReference = 1;
m_constants.insert(mk_pair(C->set_name(Name), C));
m_constants.insert(std::make_pair(C->set_name(Name), C));
return C;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/ShaderResourceTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ inline T* CResourceManager::CreateShader(const char* name)
T* sh = new T();

sh->dwFlags |= xr_resource_flagged::RF_REGISTERED;
sh_map.insert(mk_pair(sh->set_name(name), sh));
sh_map.insert(std::make_pair(sh->set_name(name), sh));
if (0 == stricmp(name, "null"))
{
sh->sh = NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/SkeletonCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ void CKinematics::Load(const char* N, IReader* data, u32 dwFlags)
pBone->name = shared_str(buf);
pBone->child_faces.resize(children.size());
bones->push_back(pBone);
bone_map_N->push_back(mk_pair(pBone->name, ID));
bone_map_P->push_back(mk_pair(pBone->name, ID));
bone_map_N->push_back(std::make_pair(pBone->name, ID));
bone_map_P->push_back(std::make_pair(pBone->name, ID));

// It's parent
data->r_stringZ(buf, sizeof(buf));
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/blenders/Blender_Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void CBlender_Compile::Stage_Texture(LPCSTR name, u32, u32 fmin, u32 fmip, u32 f
xrDebug::Fatal(DEBUG_INFO, "Not enought textures for shader. Base texture: '%s'.", *lst[0]);
N = *lst[id];
}
passTextures.push_back(mk_pair(Stage(), ref_texture(RImplementation.Resources->_CreateTexture(N))));
passTextures.push_back(std::make_pair(Stage(), ref_texture(RImplementation.Resources->_CreateTexture(N))));
// i_Address (Stage(),address);
i_Filter(Stage(), fmin, fmip, fmag);
}
Expand Down
26 changes: 13 additions & 13 deletions src/Layers/xrRender/dxEnvironmentRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void dxEnvDescriptorMixerRender::Destroy()

void dxEnvDescriptorMixerRender::Clear()
{
std::pair<u32, ref_texture> zero = mk_pair(u32(0), ref_texture(0));
std::pair<u32, ref_texture> zero = std::make_pair(u32(0), ref_texture(0));
sky_r_textures.clear();
sky_r_textures.push_back(zero);
sky_r_textures.push_back(zero);
Expand All @@ -95,17 +95,17 @@ void dxEnvDescriptorMixerRender::lerp(IEnvDescriptorRender* inA, IEnvDescriptorR
dxEnvDescriptorRender* pB = (dxEnvDescriptorRender*)inB;

sky_r_textures.clear();
sky_r_textures.push_back(mk_pair(0, pA->sky_texture));
sky_r_textures.push_back(mk_pair(1, pB->sky_texture));
sky_r_textures.push_back(std::make_pair(0, pA->sky_texture));
sky_r_textures.push_back(std::make_pair(1, pB->sky_texture));

sky_r_textures_env.clear();

sky_r_textures_env.push_back(mk_pair(0, pA->sky_texture_env));
sky_r_textures_env.push_back(mk_pair(1, pB->sky_texture_env));
sky_r_textures_env.push_back(std::make_pair(0, pA->sky_texture_env));
sky_r_textures_env.push_back(std::make_pair(1, pB->sky_texture_env));

clouds_r_textures.clear();
clouds_r_textures.push_back(mk_pair(0, pA->clouds_texture));
clouds_r_textures.push_back(mk_pair(1, pB->clouds_texture));
clouds_r_textures.push_back(std::make_pair(0, pA->clouds_texture));
clouds_r_textures.push_back(std::make_pair(1, pB->clouds_texture));
}

void dxEnvDescriptorRender::OnDeviceCreate(CEnvDescriptor& owner)
Expand Down Expand Up @@ -143,16 +143,16 @@ void dxEnvironmentRender::OnFrame(CEnvironment& env)
if (HW.Caps.raster_major >= 3 && HW.Caps.geometry.bVTF)
{
// tonemapping in VS
mixRen.sky_r_textures.push_back(mk_pair(u32(CTexture::rstVertex), tonemap)); //. hack
mixRen.sky_r_textures_env.push_back(mk_pair(u32(CTexture::rstVertex), tonemap)); //. hack
mixRen.clouds_r_textures.push_back(mk_pair(u32(CTexture::rstVertex), tonemap)); //. hack
mixRen.sky_r_textures.push_back(std::make_pair(u32(CTexture::rstVertex), tonemap)); //. hack
mixRen.sky_r_textures_env.push_back(std::make_pair(u32(CTexture::rstVertex), tonemap)); //. hack
mixRen.clouds_r_textures.push_back(std::make_pair(u32(CTexture::rstVertex), tonemap)); //. hack
}
else
{
// tonemapping in PS
mixRen.sky_r_textures.push_back(mk_pair(2, tonemap)); //. hack
mixRen.sky_r_textures_env.push_back(mk_pair(2, tonemap)); //. hack
mixRen.clouds_r_textures.push_back(mk_pair(2, tonemap)); //. hack
mixRen.sky_r_textures.push_back(std::make_pair(2, tonemap)); //. hack
mixRen.sky_r_textures_env.push_back(std::make_pair(2, tonemap)); //. hack
mixRen.clouds_r_textures.push_back(std::make_pair(2, tonemap)); //. hack
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/r__dsgraph_render_lods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void D3DXRenderBase::r_dsgraph_render_lods(bool _setup_zb, bool _clear)
FLOD::_face* facets = lodV->facets;
svector<std::pair<float, u32>, 8> selector;
for (u32 s = 0; s < 8; s++)
selector.push_back(mk_pair(Ldir.dotproduct(facets[s].N), s));
selector.push_back(std::make_pair(Ldir.dotproduct(facets[s].N), s));
std::sort(selector.begin(), selector.end(), pred_dot);

float dot_best = selector[selector.size() - 1].first;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/r__sector_traversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void CPortalTraverser::traverse(IRender_Sector* start, CFrustum& F, Fvector& vBa
}
}

void CPortalTraverser::fade_portal(CPortal* _p, float ssa) { f_portals.push_back(mk_pair(_p, ssa)); }
void CPortalTraverser::fade_portal(CPortal* _p, float ssa) { f_portals.push_back(std::make_pair(_p, ssa)); }
void CPortalTraverser::initialize()
{
f_shader.create("portal");
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderDX10/Blender_Recorder_R3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void CBlender_Compile::r_dx10Texture(LPCSTR ResourceName, LPCSTR texture)
R_ASSERT(C->type == RC_dx10texture);
u32 stage = C->samp.index;

passTextures.push_back(mk_pair(stage, ref_texture(RImplementation.Resources->_CreateTexture(TexName))));
passTextures.push_back(std::make_pair(stage, ref_texture(RImplementation.Resources->_CreateTexture(TexName))));
}

void CBlender_Compile::i_dx10Address(u32 s, u32 address)
Expand Down
14 changes: 7 additions & 7 deletions src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
{
SVS* _vs = new SVS();
_vs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_vs.insert(mk_pair(_vs->set_name(name), _vs));
m_vs.insert(std::make_pair(_vs->set_name(name), _vs));
//_vs->vs = NULL;
//_vs->signature = NULL;
if (0 == stricmp(_name, "null"))
Expand Down Expand Up @@ -264,7 +264,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)
{
SPS* _ps = new SPS();
_ps->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_ps.insert(mk_pair(_ps->set_name(name), _ps));
m_ps.insert(std::make_pair(_ps->set_name(name), _ps));
if (0 == stricmp(_name, "null"))
{
_ps->ps = NULL;
Expand Down Expand Up @@ -369,7 +369,7 @@ SGS* CResourceManager::_CreateGS(LPCSTR name)
{
SGS* _gs = new SGS();
_gs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_gs.insert(mk_pair(_gs->set_name(name), _gs));
m_gs.insert(std::make_pair(_gs->set_name(name), _gs));
if (0 == stricmp(name, "null"))
{
_gs->gs = NULL;
Expand Down Expand Up @@ -512,7 +512,7 @@ CRT* CResourceManager::_CreateRT(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 Sam
{
CRT* RT = new CRT();
RT->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_rtargets.insert(mk_pair(RT->set_name(Name), RT));
m_rtargets.insert(std::make_pair(RT->set_name(Name), RT));
#ifdef USE_DX11
if (Device.b_is_Ready)
RT->create(Name, w, h, f, SampleCount, useUAV);
Expand Down Expand Up @@ -645,7 +645,7 @@ CTexture* CResourceManager::_CreateTexture(LPCSTR _Name)
{
CTexture* T = new CTexture();
T->dwFlags |= xr_resource_flagged::RF_REGISTERED;
m_textures.insert(mk_pair(T->set_name(Name), T));
m_textures.insert(std::make_pair(T->set_name(Name), T));
T->Preload();
if (Device.b_is_Ready && !bDeferredLoad)
T->Load();
Expand Down Expand Up @@ -699,7 +699,7 @@ CMatrix* CResourceManager::_CreateMatrix(LPCSTR Name)
CMatrix* M = new CMatrix();
M->dwFlags |= xr_resource_flagged::RF_REGISTERED;
M->dwReference = 1;
m_matrices.insert(mk_pair(M->set_name(Name), M));
m_matrices.insert(std::make_pair(M->set_name(Name), M));
return M;
}
}
Expand Down Expand Up @@ -737,7 +737,7 @@ CConstant* CResourceManager::_CreateConstant(LPCSTR Name)
CConstant* C = new CConstant();
C->dwFlags |= xr_resource_flagged::RF_REGISTERED;
C->dwReference = 1;
m_constants.insert(mk_pair(C->set_name(Name), C));
m_constants.insert(std::make_pair(C->set_name(Name), C));
return C;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrAI/xr_graph_merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class CLevelGameGraph

if (ok)
{
m_tVertexMap.insert(mk_pair(S, T));
m_tVertexMap.insert(std::make_pair(S, T));
vertexId++;
}
}
Expand Down Expand Up @@ -613,7 +613,7 @@ CGraphMerger::CGraphMerger(LPCSTR game_graph_id, LPCSTR name, bool rebuild)
new ::CLevelGameGraph(_0, _1, &tLevel, level_folder, dwOffset, tLevel.id(), Ini);
dwOffset += tpLevelGraph->m_tpGraph->header().vertex_count();
R_ASSERT2(tpGraphs.find(tLevel.id()) == tpGraphs.end(), "Level ids _MUST_ be different!");
tpGraphs.insert(mk_pair(tLevel.id(), tpLevelGraph));
tpGraphs.insert(std::make_pair(tLevel.id(), tpLevelGraph));
tGraphHeader.m_levels.insert(std::make_pair(tLevel.id(), tLevel));
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrCompress/xrCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void xrCompressor::CompressOne(LPCSTR path)
R.c_ptr = c_ptr;
R.c_size_real = c_size_real;
R.c_size_compressed = c_size_compressed;
aliases.insert(mk_pair(R.c_size_real, R));
aliases.insert(std::make_pair(R.c_size_real, R));
}

FS.r_close(src);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrLC/OGF_Face_Save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ std::pair<s16, u8> s24_tc_base(float uv) // [-32 .. +32]
clamp(_primary, -32768, 32767);
s32 _secondary = iFloor(255.5f * (rebased - float(_primary)));
clamp(_secondary, 0, 255);
return mk_pair(s16(_primary), u8(_secondary));
return std::make_pair(s16(_primary), u8(_secondary));
}

s16 s16_tc_lmap(float uv) // [-1 .. +1]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrLC/xrPhase_UVmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Detach(vecFace* S)
if (W == verts.end())
{ // where is no such-vertex
VC = V->CreateCopy_NOADJ(lc_global_data()->g_vertices()); // make copy
verts.insert(mk_pair(V, VC));
verts.insert(std::make_pair(V, VC));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrLC_Light/xrLightVertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void g_trans_register_internal(Vertex* V)
}

// Register
mapVertIt ins = g_trans->insert(mk_pair(key, vecVertex()));
mapVertIt ins = g_trans->insert(std::make_pair(key, vecVertex()));
ins->second.reserve(32);
ins->second.push_back(V);
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrLC_Light/xrLight_Implicit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void ImplicitLightingExec(BOOL b_net)
ImplicitDeflector ImpD;
ImpD.texture = T;
ImpD.faces.push_back(F);
calculator.insert(mk_pair(Tid, ImpD));
calculator.insert(std::make_pair(Tid, ImpD));
not_clear.push_back(Tid);
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrLC_Light/xrMU_Model_Calc_lighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void xrMU_Model::calc_lighting(
// Register
if (!found)
{
mapVertIt ins = g_trans.insert(mk_pair(key, v_vertices()));
mapVertIt ins = g_trans.insert(std::make_pair(key, v_vertices()));
ins->second.reserve(32);
ins->second.push_back(V);
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrAICore/Navigation/game_graph_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ IC void GameGraph::CHeader::load(IReader* reader)
{
SLevel l_tLevel;
l_tLevel.load(reader);
m_levels.insert(mk_pair(l_tLevel.id(), l_tLevel));
m_levels.insert(std::make_pair(l_tLevel.id(), l_tLevel));
}
}

Expand Down
Loading

0 comments on commit fa081b4

Please sign in to comment.