-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Traktor: Fixed generating new id of all pasted or cloned entities in …
…scene editor.
- Loading branch information
Showing
4 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* TRAKTOR | ||
* Copyright (c) 2024 Anders Pistol. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
#include "Scene/Editor/Traverser.h" | ||
#include "Scene/Editor/Utilities.h" | ||
#include "World/EntityData.h" | ||
|
||
namespace traktor::scene | ||
{ | ||
|
||
void generateEntityIds(world::EntityData* entityData) | ||
{ | ||
entityData->setId(Guid::create()); | ||
Traverser::visit(entityData, [](world::EntityData* ed) -> Traverser::Result | ||
{ | ||
ed->setId(Guid::create()); | ||
return Traverser::Result::Continue; | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* TRAKTOR | ||
* Copyright (c) 2024 Anders Pistol. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
#pragma once | ||
|
||
namespace traktor::world | ||
{ | ||
|
||
class EntityData; | ||
|
||
} | ||
|
||
namespace traktor::scene | ||
{ | ||
|
||
/*! Recursively generate entity IDs. | ||
* \ingroup Scene | ||
* | ||
* Using traversal to ensure all referenced entities | ||
* get ID properly generated. | ||
*/ | ||
void generateEntityIds(world::EntityData* entityData); | ||
|
||
} |