Skip to content
Snippets Groups Projects
Verified Commit 796453fe authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#26] Hacked the hack again to hack into the texture DEEP

parent bc745f49
No related branches found
No related tags found
1 merge request!19Resolve "Asset Loading"
Pipeline #25189 failed
...@@ -192,7 +192,11 @@ int loadMesh(const std::string &path, Mesh &mesh) { ...@@ -192,7 +192,11 @@ int loadMesh(const std::string &path, Mesh &mesh) {
printf("image name=%s uri=%s mime=%s\n", img.name.c_str(), printf("image name=%s uri=%s mime=%s\n", img.name.c_str(),
img.uri.c_str(), img.mimeType.c_str()); img.uri.c_str(), img.mimeType.c_str());
#endif #endif
mesh.texture_hack.img = stbi_load(img.uri.c_str(),
size_t pos = path.find_last_of("/");
auto dir = path.substr(0, pos);
mesh.texture_hack.img = stbi_load((dir + "/" + img.uri).c_str(),
&mesh.texture_hack.w, &mesh.texture_hack.h, &mesh.texture_hack.w, &mesh.texture_hack.h,
&mesh.texture_hack.ch, 4); &mesh.texture_hack.ch, 4);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment