Skip to content

Commit

Permalink
Added some missing D3D error codes that D3DXCreateTextureFromFile ret…
Browse files Browse the repository at this point in the history
…urns.
  • Loading branch information
michael-fadely committed Aug 24, 2015
1 parent 0301054 commit 3b5af1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions SADXModLoader/TextureReplacement.cpp
Expand Up @@ -27,14 +27,18 @@ FunctionPointer(void, UnloadTextures, (NJS_TEXNAME** texName_pp), 0x00403290);

#define TOMAPSTRING(a) { a, #a }

static const std::unordered_map<HRESULT, const char*> D3DXERR = {
static const std::unordered_map<HRESULT, const char*> D3DErrors = {
TOMAPSTRING(D3DXERR_CANNOTMODIFYINDEXBUFFER),
TOMAPSTRING(D3DXERR_INVALIDMESH),
TOMAPSTRING(D3DXERR_CANNOTATTRSORT),
TOMAPSTRING(D3DXERR_SKINNINGNOTSUPPORTED),
TOMAPSTRING(D3DXERR_TOOMANYINFLUENCES),
TOMAPSTRING(D3DXERR_INVALIDDATA),
TOMAPSTRING(D3DXERR_LOADEDMESHASNODATA)
TOMAPSTRING(D3DXERR_LOADEDMESHASNODATA),
TOMAPSTRING(D3DERR_NOTAVAILABLE),
TOMAPSTRING(D3DERR_OUTOFVIDEOMEMORY),
TOMAPSTRING(D3DERR_INVALIDCALL),
TOMAPSTRING(E_OUTOFMEMORY)
};

#pragma region Filesystem stuff
Expand Down Expand Up @@ -234,7 +238,7 @@ NJS_TEXMEMLIST* LoadTexture(const std::wstring& _path, uint32_t globalIndex, con

if (result != D3D_OK)
{
PrintDebug("Failed to load texture %s: %s (%u)\n", name.c_str(), D3DXERR.at(result), result);
PrintDebug("Failed to load texture %s: %s (%u)\n", name.c_str(), D3DErrors.at(result), result);
return nullptr;
}

Expand Down

0 comments on commit 3b5af1e

Please sign in to comment.