Skip to content

Commit

Permalink
VOXEDIT: disable normal rendering in non-c&c mode
Browse files Browse the repository at this point in the history
also ensure that the 6bit palettes are loading in c&c mode

should fix the last issue for #519
  • Loading branch information
mgerhardy committed Oct 22, 2024
1 parent 2af7c05 commit 7d9af31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/tools/voxedit/modules/voxedit-ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ bool MainWindow::init() {
_modelNodeSettings.reset();
region = _modelNodeSettings.region();
}

updateViewMode();

if (!_sceneMgr->newScene(true, _modelNodeSettings.name, region)) {
return false;
}
Expand Down Expand Up @@ -957,15 +960,21 @@ QuitDisallowReason MainWindow::allowToQuit() {
return QuitDisallowReason::None;
}

void MainWindow::updateViewMode() {
if (_viewMode->intVal() == (int)ViewMode::CommandAndConquer) {
core::Var::getSafe(cfg::PalformatRGB6Bit)->setVal(true);
} else {
core::Var::getSafe(cfg::RenderNormals)->setVal(false);
}
}

void MainWindow::update() {
core_trace_scoped(MainWindow);
if (_viewMode->isDirty() || _numViewports->isDirty()) {
if (!initScenes()) {
Log::error("Failed to update scenes");
}
if (_viewMode->intVal() != (int)ViewMode::CommandAndConquer) {
core::Var::getSafe(cfg::RenderNormals)->setVal(false);
}
updateViewMode();
}

ImGuiViewport *viewport = ImGui::GetMainViewport();
Expand Down
1 change: 1 addition & 0 deletions src/tools/voxedit/modules/voxedit-ui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class MainWindow : public ui::Panel {
void popupVolumeSplit();
void registerPopups();
void addTemplate(const TemplateModel &model);
void updateViewMode();
public:
MainWindow(ui::IMGUIApp *app, const SceneManagerPtr &sceneMgr, const video::TexturePoolPtr &texturePool,
const voxelcollection::CollectionManagerPtr &collectionMgr, const io::FilesystemPtr &filesystem);
Expand Down

0 comments on commit 7d9af31

Please sign in to comment.