Skip to content

Commit

Permalink
Fix model export / import critical error!
Browse files Browse the repository at this point in the history
Preparing to add skybox generator.
  • Loading branch information
UnrealKaraulov committed Feb 15, 2024
1 parent 05d28d1 commit 3cb4057
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 187 deletions.
10 changes: 9 additions & 1 deletion src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ Bsp::Bsp(std::string fpath)
}
}

if (ents.size())
{
ents[0]->setOrAddKeyvalue("_editor", g_version_string);
}

save_undo_lightmaps();
}

Expand Down Expand Up @@ -6653,6 +6658,9 @@ void Bsp::copy_bsp_model(int modelIdx, Bsp* targetMap, STRUCTREMAP& remap, std::
STRUCTUSAGE usage(this);
mark_model_structures(modelIdx, &usage, skipLeafs);

if (leafCount > 0)
usage.leaves[0] = false;

for (unsigned int i = 0; i < usage.count.planes; i++)
{
if (usage.planes[i])
Expand Down Expand Up @@ -8724,7 +8732,7 @@ void Bsp::ExportExtFile(const std::string& path, std::string& out_map_path)

Wad* tmpWad = new Wad(targetMapFileName + "_nolight.wa_");



std::vector<std::string> addedTextures;
std::vector<WADTEX*> outTextures;
Expand Down
4 changes: 1 addition & 3 deletions src/editor/BspRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2122,8 +2122,6 @@ void BspRenderer::reuploadTextures()

texturesLoaded = true;

preRenderFaces();

needReloadDebugTextures = true;
}

Expand All @@ -2138,13 +2136,13 @@ void BspRenderer::delayLoadData()
}

preRenderFaces();

lightmapsUploaded = true;
}

if (!texturesLoaded && texturesFuture.wait_for(std::chrono::milliseconds(0)) == std::future_status::ready)
{
reuploadTextures();
preRenderFaces();
}

if (!clipnodesLoaded && clipnodesFuture.wait_for(std::chrono::milliseconds(0)) == std::future_status::ready)
Expand Down
Loading

0 comments on commit 3cb4057

Please sign in to comment.