diff --git a/examples/rockPaperScissorsCells.js b/examples/rockPaperScissorsCells.js index 9227278455..4f6de888a1 100644 --- a/examples/rockPaperScissorsCells.js +++ b/examples/rockPaperScissorsCells.js @@ -29,9 +29,7 @@ var cellTypes = []; cellTypes[0] = { r: 255, g: 0, b: 0 }; cellTypes[1] = { r: 0, g: 255, b: 0 }; cellTypes[2] = { r: 0, g:0, b: 255 }; -cellTypes[3] = { r: 255, g: 255, b: 255 }; -cellTypes[4] = { r: 255, g: 0, b: 255 }; -cellTypes[5] = { r: 0, g: 255, b: 255 }; + //Check for free region for AC var regionMarkerX = -1; @@ -152,11 +150,11 @@ function updateCells() { } else { if (currentCells[y][x].type == ((cell.type + 1) % cellTypes.length)) { - nextCells[i][j] = currentCells[y][x]; + nextCells[i][j].type = currentCells[y][x].type; nextCells[i][j].changed = true; } else { //indicate no update - nextCells[i][j].changed = true; + nextCells[i][j].changed = false; } } } @@ -192,7 +190,7 @@ function sendNextCells() { var sentFirstBoard = false; -var UPDATES_PER_SECOND = 3.0; +var UPDATES_PER_SECOND = 6.0; var frameIndex = 1.0; var oldFrameIndex = 0; diff --git a/libraries/voxels/src/VoxelsScriptingInterface.cpp b/libraries/voxels/src/VoxelsScriptingInterface.cpp index e877f99760..ba1c3d72de 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.cpp +++ b/libraries/voxels/src/VoxelsScriptingInterface.cpp @@ -81,11 +81,17 @@ void VoxelsScriptingInterface::setVoxel(float x, float y, float z, float scale, DeleteVoxelCommand* deleteCommand = new DeleteVoxelCommand(_tree, addVoxelDetail, getVoxelPacketSender()); + static QMutex mutex; + mutex.lock(); + _undoStack->beginMacro(addCommand->text()); // As QUndoStack automatically executes redo() on push, we don't need to execute the command ourselves. _undoStack->push(deleteCommand); _undoStack->push(addCommand); _undoStack->endMacro(); + + //Unlock the mutex + mutex.unlock(); } else { // queue the destructive add queueVoxelAdd(PacketTypeVoxelSetDestructive, addVoxelDetail);