mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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
|
|
@ -42,6 +42,7 @@
|
|||
#include <glm/glm.hpp>
|
||||
#include <unordered_set>
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
static debug::Logger logger("engine");
|
||||
|
||||
|
|
@ -347,11 +348,11 @@ double Engine::getDelta() const {
|
|||
void Engine::setScreen(std::shared_ptr<Screen> screen) {
|
||||
audio::reset_channel(audio::get_channel_index("regular"));
|
||||
audio::reset_channel(audio::get_channel_index("ambient"));
|
||||
this->screen = screen;
|
||||
this->screen = std::move(screen);
|
||||
}
|
||||
|
||||
void Engine::setLanguage(std::string locale) {
|
||||
langs::setup(paths->getResources(), locale, contentPacks);
|
||||
langs::setup(paths->getResources(), std::move(locale), contentPacks);
|
||||
gui->getMenu()->setPageLoader(menus::create_page_loader(this));
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +392,7 @@ std::shared_ptr<Screen> Engine::getScreen() {
|
|||
return screen;
|
||||
}
|
||||
|
||||
void Engine::postRunnable(runnable callback) {
|
||||
void Engine::postRunnable(const runnable& callback) {
|
||||
std::lock_guard<std::recursive_mutex> lock(postRunnablesMutex);
|
||||
postRunnables.push(callback);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue