D3D: Use std::strings for Compile[x]Shader and CompileAndCreate[x]Shader

With strings, we don't need to care about passing in a length, since it internally stores it. So now, we don't even need a length parameter for these functions anymore as well.
This also kills off some sprintf_s calls.
This commit is contained in:
Lioncash
2014-07-07 19:28:12 -04:00
parent cc3dda5b22
commit a523a6d1bf
10 changed files with 85 additions and 75 deletions

View File

@ -253,12 +253,12 @@ int CD3DFont::Init()
DeleteObject(hFont);
// setup device objects for drawing
m_pshader = D3D::CompileAndCreatePixelShader(fontpixshader, sizeof(fontpixshader));
m_pshader = D3D::CompileAndCreatePixelShader(fontpixshader);
if (m_pshader == nullptr) PanicAlert("Failed to create pixel shader, %s %d\n", __FILE__, __LINE__);
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_pshader, "pixel shader of a CD3DFont object");
D3DBlob* vsbytecode;
D3D::CompileVertexShader(fontvertshader, sizeof(fontvertshader), &vsbytecode);
D3D::CompileVertexShader(fontvertshader, &vsbytecode);
if (vsbytecode == nullptr) PanicAlert("Failed to compile vertex shader, %s %d\n", __FILE__, __LINE__);
m_vshader = D3D::CreateVertexShaderFromByteCode(vsbytecode);
if (m_vshader == nullptr) PanicAlert("Failed to create vertex shader, %s %d\n", __FILE__, __LINE__);