Skip to content

Commit

Permalink
VOXEDIT: fixed restoring of previously selected palette for a new scene
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhardy committed Feb 23, 2025
1 parent 918e591 commit fa32347
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/tools/voxedit/modules/voxedit-ui/ViewMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* @file
*/

#pragma once

namespace voxedit {

enum class ViewMode { Default, Simple, All, CommandAndConquer, Max };
Expand Down
9 changes: 5 additions & 4 deletions src/tools/voxedit/modules/voxedit-util/SceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,11 @@ bool SceneManager::newScene(bool force, const core::String &name, voxel::RawVolu
} else {
newNode.setName(name);
}
palette::Palette palette;
if (!palette.load(core::Var::getSafe(cfg::VoxEditLastPalette)->strVal().c_str())) {
palette = voxel::getPalette();
}
newNode.setPalette(palette);
const int nodeId = scenegraph::moveNodeToSceneGraph(_sceneGraph, newNode, 0);
if (nodeId == InvalidNodeId) {
Log::error("Failed to add empty volume to new scene graph");
Expand Down Expand Up @@ -2328,10 +2333,6 @@ bool SceneManager::init() {
return true;
}

palette::Palette palette;
if (!palette.load(core::Var::getSafe(cfg::VoxEditLastPalette)->strVal().c_str())) {
palette = voxel::getPalette();
}
if (!_mementoHandler.init()) {
Log::error("Failed to initialize the memento handler");
return false;
Expand Down

0 comments on commit fa32347

Please sign in to comment.