mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Optimize parameter passing to avoid unnecessary copying
This commit is contained in:
parent
46ca1bb04a
commit
f25a425cb9
123 changed files with 578 additions and 522 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "CheckBox.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "../../core/DrawContext.hpp"
|
||||
#include "../../core/Batch2D.hpp"
|
||||
#include "Label.hpp"
|
||||
|
|
@ -30,11 +32,11 @@ void CheckBox::mouseRelease(GUI*, int, int) {
|
|||
}
|
||||
|
||||
void CheckBox::setSupplier(boolsupplier supplier) {
|
||||
this->supplier = supplier;
|
||||
this->supplier = std::move(supplier);
|
||||
}
|
||||
|
||||
void CheckBox::setConsumer(boolconsumer consumer) {
|
||||
this->consumer = consumer;
|
||||
this->consumer = std::move(consumer);
|
||||
}
|
||||
|
||||
CheckBox* CheckBox::setChecked(bool flag) {
|
||||
|
|
@ -42,7 +44,7 @@ CheckBox* CheckBox::setChecked(bool flag) {
|
|||
return this;
|
||||
}
|
||||
|
||||
FullCheckBox::FullCheckBox(std::wstring text, glm::vec2 size, bool checked)
|
||||
FullCheckBox::FullCheckBox(const std::wstring& text, glm::vec2 size, bool checked)
|
||||
: Panel(size),
|
||||
checkbox(std::make_shared<CheckBox>(checked)){
|
||||
setColor(glm::vec4(0.0f));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue