Skip to content

Commit

Permalink
Replaced strcpy, strcat and sprintf with xr_* analogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jul 24, 2018
1 parent aed5f01 commit dcf2a0e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)
{
string_path name;
strcpy_s(name, _name);
if (0 == GEnv.Render->m_MSAASample) strcat(name, "_0");
if (1 == GEnv.Render->m_MSAASample) strcat(name, "_1");
if (2 == GEnv.Render->m_MSAASample) strcat(name, "_2");
if (3 == GEnv.Render->m_MSAASample) strcat(name, "_3");
if (4 == GEnv.Render->m_MSAASample) strcat(name, "_4");
if (5 == GEnv.Render->m_MSAASample) strcat(name, "_5");
if (6 == GEnv.Render->m_MSAASample) strcat(name, "_6");
if (7 == GEnv.Render->m_MSAASample) strcat(name, "_7");
if (0 == GEnv.Render->m_MSAASample) xr_strcat(name, "_0");
if (1 == GEnv.Render->m_MSAASample) xr_strcat(name, "_1");
if (2 == GEnv.Render->m_MSAASample) xr_strcat(name, "_2");
if (3 == GEnv.Render->m_MSAASample) xr_strcat(name, "_3");
if (4 == GEnv.Render->m_MSAASample) xr_strcat(name, "_4");
if (5 == GEnv.Render->m_MSAASample) xr_strcat(name, "_5");
if (6 == GEnv.Render->m_MSAASample) xr_strcat(name, "_6");
if (7 == GEnv.Render->m_MSAASample) xr_strcat(name, "_7");
LPSTR N = LPSTR(name);
map_PS::iterator I = m_ps.find(N);
if (I != m_ps.end()) return I->second;
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_GL/gl_rendertarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ CRenderTarget::CRenderTarget()
for (int it1 = 0; it1 < TEX_jitter_count - 1; it1++)
{
string_path name;
sprintf(name, "%s%d",r2_jitter, it1);
xr_sprintf(name, "%s%d", r2_jitter, it1);
CHK_GL (glBindTexture(GL_TEXTURE_2D, t_noise_surf[it1]));
CHK_GL (glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, TEX_jitter, TEX_jitter));
t_noise[it1] = RImplementation.Resources->_CreateTexture(name);
Expand Down Expand Up @@ -821,7 +821,7 @@ CRenderTarget::CRenderTarget()
// generate HBAO jitter texture (last)
int it = TEX_jitter_count - 1;
string_path name;
sprintf(name, "%s%d",r2_jitter, it);
xr_sprintf(name, "%s%d", r2_jitter, it);
CHK_GL (glBindTexture(GL_TEXTURE_2D, t_noise_surf[it]));
CHK_GL (glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA32F, TEX_jitter, TEX_jitter));
t_noise[it] = RImplementation.Resources->_CreateTexture(name);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrDXT/NormalMapGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,12 @@ int DXTCompressBump(
fmt0.type = STextureParams::ttImage;
fmt0.fmt = STextureParams::tfDXT5;
string256 out_name1;
strcpy(out_name1, out_name);
xr_strcpy(out_name1, out_name);
if (strext(out_name1))
{
*strext(out_name1) = 0;
}
strcat(out_name1, "#.dds");
xr_strcat(out_name1, "#.dds");
res |= DXTCompressImage(out_name1, T_normal_1D, w, h, pitch, &fmt0, depth);
free(T_height_pf);
free(T_normal_1D);
Expand Down

0 comments on commit dcf2a0e

Please sign in to comment.