mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-02 11:59:58 +00:00
Load preset palettes faster
Load all queued resources on each onTick() instead of one per tick.
This commit is contained in:
parent
f1454da7c2
commit
399314b407
@ -177,22 +177,20 @@ void ResourcesListBox::onTick()
|
||||
base::UniquePtr<Resource> resource;
|
||||
std::string name;
|
||||
|
||||
if (!m_resourcesLoader->next(resource)) {
|
||||
if (m_resourcesLoader->isDone()) {
|
||||
stop();
|
||||
}
|
||||
return;
|
||||
while (m_resourcesLoader->next(resource)) {
|
||||
base::UniquePtr<ResourceListItem> listItem(onCreateResourceItem(resource));
|
||||
insertChild(getItemsCount()-1, listItem);
|
||||
layout();
|
||||
|
||||
if (View* view = View::getView(this))
|
||||
view->updateView();
|
||||
|
||||
resource.release();
|
||||
listItem.release();
|
||||
}
|
||||
|
||||
base::UniquePtr<ResourceListItem> listItem(onCreateResourceItem(resource));
|
||||
insertChild(getItemsCount()-1, listItem);
|
||||
layout();
|
||||
|
||||
if (View* view = View::getView(this))
|
||||
view->updateView();
|
||||
|
||||
resource.release();
|
||||
listItem.release();
|
||||
if (m_resourcesLoader->isDone())
|
||||
stop();
|
||||
}
|
||||
|
||||
void ResourcesListBox::stop()
|
||||
|
Loading…
Reference in New Issue
Block a user