History

More work on editVoxel.js

Clement committed 12 years ago

Commit dcaef451 parent ca0cd2d9 files · +273 −138Browse files

Showing the changes to interface/src/Application.cpp (1 of 9 files). Show all

Unified · Split

interface/src/Application.cpp+9−5
@@ -140,9 +140,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 139 unmodified lines
140140 _fps(120.0f),
141141 _justStarted(true),
142142 _voxelImporter(NULL),
143+ _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard),
143144 _wantToKillLocalVoxels(false),
144145 _audioScope(256, 200, true),
145− _myAvatar(),
146146 _mirrorViewRect(QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT)),
147147 _mouseX(0),
148148 _mouseY(0),
@@ -1387,6 +1387,8 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) { · 1238 unmodified lines
13871387 }
13881388
13891389 void Application::importVoxels() {
1390+ int result = 1;
1391+
13901392 if (!_voxelImporter) {
13911393 _voxelImporter = new VoxelImporter(_window);
13921394 _voxelImporter->loadSettings(_settings);
@@ -1394,6 +1396,7 @@ void Application::importVoxels() { · 1 unmodified line
13941396
13951397 if (!_voxelImporter->exec()) {
13961398 qDebug() << "[DEBUG] Import succeeded." << endl;
1399+ result = 0;
13971400 } else {
13981401 qDebug() << "[DEBUG] Import failed." << endl;
13991402 if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) {
@@ -1404,6 +1407,8 @@ void Application::importVoxels() { · 4 unmodified lines
14041407
14051408 // restore the main window's active state
14061409 _window->activateWindow();
1410+
1411+ emit importDone(result);
14071412 }
14081413
14091414 void Application::cutVoxels(const VoxelDetail& sourceVoxel) {
@@ -1495,10 +1500,9 @@ void Application::init() { · 85 unmodified lines
14951500
14961501 // Cleanup of the original shared tree
14971502 _sharedVoxelSystem.init();
1498− VoxelTree* tmpTree = _sharedVoxelSystem.getTree();
1499− _sharedVoxelSystem.changeTree(&_clipboard);
1500− delete tmpTree;
1501−
1503+
1504+ _voxelImporter = new VoxelImporter(_window);
1505+
15021506 _environment.init();
15031507
15041508 _glowEffect.init();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t