Skip to content

Commit

Permalink
Generate Missing Texture Texture (#116)
Browse files Browse the repository at this point in the history
* Generate Missing Texture Texture

* Only Generate Missing Texture For Required Textures
  • Loading branch information
TheBrokenRail authored Apr 19, 2024
1 parent 38db7bb commit fefcf95
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions source/client/renderer/Textures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@ int Textures::loadTexture(const std::string& name, bool bIsRequired)

Texture t = m_pPlatform->loadTexture(name, bIsRequired);

int result = -1;
if (t.m_pixels)
result = assignTexture(name, t);
if (!t.m_pixels && bIsRequired) {
t.field_C = 1;
t.field_D = 0;
t.m_width = 2;
t.m_height = 2;
t.m_pixels = new uint32_t[4];
t.m_pixels[0] = 0xfff800f8;
t.m_pixels[1] = 0xff000000;
t.m_pixels[3] = 0xfff800f8;
t.m_pixels[2] = 0xff000000;
}

return result;
if (t.m_pixels) {
return assignTexture(name, t);
} else {
return -1;
}
}

int Textures::assignTexture(const std::string& name, Texture& texture)
Expand Down

0 comments on commit fefcf95

Please sign in to comment.