update xcode

This commit is contained in:
2019-06-19 10:58:34 +02:00
parent 41ece63aa7
commit 6058f05d3f
5 changed files with 38 additions and 22 deletions

View File

@@ -45,3 +45,17 @@ void Layer::Snapshot::optimize()
//glm::vec2 bbsz = bbmax - bbmin;
}
}
int Layer::Snapshot::memsize() const
{
int ret = 0;
for (int i = 0; i < 6; i++)
{
if (m_dirty_face[i])
{
glm::vec2 sz = zw(m_dirty_box[i]) - xy(m_dirty_box[i]);
ret += sz.x * sz.y * 4;
}
}
return ret;
}

View File

@@ -36,6 +36,7 @@ public:
void create(int w, int h);
void clear();
void optimize();
int memsize() const;
};
void resize(int width, int height);
bool create(int width, int height, std::string name);

View File

@@ -409,11 +409,6 @@ void ActionLayerAdd::undo()
m_panel->remove_layer((NodeLayer*)m_layer_node.get(), false);
}
size_t ActionLayerAdd::memory()
{
return 0;
}
///////////////////////////////////////////////////////////////////////////////
Action* ActionLayerRemove::get_redo()
@@ -435,11 +430,6 @@ void ActionLayerRemove::undo()
LOG("ActionLayerRemove::undo %s", name.c_str());
}
size_t ActionLayerRemove::memory()
{
return 0;
}
///////////////////////////////////////////////////////////////////////////////
Action* ActionLayerMove::get_redo()
@@ -462,11 +452,6 @@ void ActionLayerMove::undo()
}
}
size_t ActionLayerMove::memory()
{
return 0;
}
///////////////////////////////////////////////////////////////////////////////
void ActionLayerMerge::undo()

View File

@@ -88,7 +88,7 @@ public:
virtual void run() override { }
virtual Action* get_redo() override;
virtual void undo() override;
virtual size_t memory() override;
virtual size_t memory() override { return 0; }
};
class ActionLayerRemove : public Action
@@ -96,12 +96,12 @@ class ActionLayerRemove : public Action
public:
NodePanelLayer* m_panel;
std::shared_ptr<Node> m_layer_node;
std::shared_ptr<class Layer> m_layer;
std::shared_ptr<Layer> m_layer;
int m_layer_order;
virtual void run() override { }
virtual Action* get_redo() override;
virtual void undo() override;
virtual size_t memory() override;
virtual size_t memory() override { return 0; }
};
class ActionLayerMove : public Action
@@ -113,7 +113,7 @@ public:
virtual void run() override { }
virtual Action* get_redo() override;
virtual void undo() override;
virtual size_t memory() override;
virtual size_t memory() override { return 0; }
};
struct ActionLayerMerge : public Action
@@ -128,7 +128,7 @@ struct ActionLayerMerge : public Action
std::array<glm::vec4, 6> m_dirty_box;
std::array<bool, 6> m_dirty_face;
virtual void run() override { }
virtual size_t memory() override { return 0; }
virtual size_t memory() override { return m_snap->memsize(); }
virtual void undo() override;
virtual Action* get_redo() override;
};