SimpleTexturedDirectx11: embedded texture loading fixes

- remove assumption that embedded texture names start with "*0", etc.
- rename ModelLoader::getTextureFromModel() to loadEmbeddedTexture()
- support loading uncompressed embedded textures

Fixes display of bullsquid.mdl from Half-Life (which has an
embdedded texture named "bottommap.bmp")
This commit is contained in:
Eric Wasylishen
2021-04-24 14:13:51 -06:00
parent 21d7085be6
commit ee8d1b0417
2 changed files with 42 additions and 45 deletions
@@ -35,9 +35,7 @@ private:
void processNode(aiNode* node, const aiScene* scene);
Mesh processMesh(aiMesh* mesh, const aiScene* scene);
std::vector<Texture> loadMaterialTextures(aiMaterial* mat, aiTextureType type, std::string typeName, const aiScene* scene);
std::string determineTextureType(const aiScene* scene, aiMaterial* mat);
int getTextureIndex(aiString* str);
ID3D11ShaderResourceView* getTextureFromModel(const aiScene* scene, int textureindex);
ID3D11ShaderResourceView* loadEmbeddedTexture(const aiTexture* embeddedTexture);
};
#endif // !MODEL_LOADER_H