Skip to content

Commit

Permalink
Small fixes auto create textures missing
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 24, 2024
1 parent 37cbdb9 commit 708fc9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13764,6 +13764,7 @@ int Bsp::getEmbeddedTexCount()
bool Bsp::ExportEmbeddedWad(const std::string& path)
{
bool retval = true;
update_lump_pointers();
if (textureCount > 0)
{
if (fileExists(path))
Expand Down
10 changes: 8 additions & 2 deletions src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12050,7 +12050,7 @@ void Gui::drawFaceEditorWidget()
static bool lockRotate = true;
static int bestplane;
static bool isSpecial;
static int width, height;
static int width = 256, height = 256;
static std::vector<vec3> edgeVerts;
static ImTextureID textureId = NULL; // OpenGL ID
static char textureName[MAXTEXTURENAME];
Expand Down Expand Up @@ -12520,8 +12520,14 @@ void Gui::drawFaceEditorWidget()
rndColor.r = 50 + rand() % 206;
rndColor.g = 50 + rand() % 206;
rndColor.b = 50 + rand() % 206;

width = 256;
height = 256;

std::vector<COLOR3> img(width * height, rndColor);
newMiptex = map->add_texture(textureName, (unsigned char*)img.data(), width, height);

newMiptex = map->add_texture(textureName, (unsigned char*)&img[0], width, height);

mapRenderer->reuploadTextures();
mapRenderer->preRenderFaces();
}
Expand Down

0 comments on commit 708fc9b

Please sign in to comment.