Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions engine/src/components/spriterender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ SpriteRender::SpriteRender() :
m_mesh(PipelineContext::defaultPlane()),
m_customMesh(Engine::objectCreate<Mesh>()),
m_drawMode(Simple),
m_priority(0),
m_useCustom(false),
m_dirtyMesh(true),
m_dirtyMaterial(true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ CreateComponent::CreateComponent(const TString &type, Object *object, ObjectCont
UndoCommand(QObject::tr("Create %1").arg(type.data()).toStdString(), group),
m_type(type),
m_controller(ctrl),
m_object(object->uuid()) {
m_object(object->uuid()),
m_component(0) {

}

void CreateComponent::undo() {
for(auto uuid : m_objects) {
Object *object = Engine::findObject(uuid);
if(m_component) {
Object *object = Engine::findObject(m_component);
if(object) {
delete object;

Expand All @@ -28,7 +29,7 @@ void CreateComponent::redo() {
Component *component = dynamic_cast<Component *>(Engine::objectCreate(m_type, m_type, parent));
if(component) {
component->composeComponent();
m_objects.push_back(component->uuid());
m_component = component->uuid();

emit m_controller->objectsSelected({Engine::findObject(m_object)});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ class CreateComponent : public UndoCommand {
void redo() override;

protected:
std::list<uint32_t> m_objects;

TString m_type;

ObjectController *m_controller;

uint32_t m_object;
uint32_t m_component;

};

Expand Down
Loading