-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make games launch faster by loading resources in the background (#5572)
* Only the first scene and global objects resources (images, sounds, 3D models etc...) will be downloaded during launch of the game. This usually allows for a very fast loading time. * Other scenes resources will continue to load in the background. It has no impact on the game performance as this is done on other threads by the browser or the engine running the game. * Scenes are loaded in the order they are listed in the project manager. * You can also use actions and expressions to prioritize a scene (if it's known that a level will be needed soon for example) or read the current loading progress. This allows to create lightweight scenes that can act as custom loading screens. Otherwise, the launch loading screen will be shown if a scene is still loading when launched. * Read more about this on https://wiki.gdevelop.io/gdevelop5/all-features/resources-loading/.
- Loading branch information
Showing
56 changed files
with
3,342 additions
and
1,320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* GDevelop JS Platform | ||
* Copyright 2008-2023 Florian Rival ([email protected]). All rights | ||
* reserved. This project is released under the MIT License. | ||
*/ | ||
#include "SceneResourcesFinder.h" | ||
|
||
#include "GDCore/IDE/ResourceExposer.h" | ||
#include "GDCore/Project/Layout.h" | ||
#include "GDCore/Project/Project.h" | ||
#include "GDCore/Serialization/SerializerElement.h" | ||
|
||
namespace gd { | ||
|
||
std::set<gd::String> SceneResourcesFinder::FindProjectResources(gd::Project &project) { | ||
gd::SceneResourcesFinder resourceWorker; | ||
gd::ResourceExposer::ExposeProjectResources(project, resourceWorker); | ||
return resourceWorker.resourceNames; | ||
} | ||
|
||
std::set<gd::String> SceneResourcesFinder::FindSceneResources(gd::Project &project, | ||
gd::Layout &layout) { | ||
gd::SceneResourcesFinder resourceWorker; | ||
gd::ResourceExposer::ExposeLayoutResources(project, layout, resourceWorker); | ||
return resourceWorker.resourceNames; | ||
} | ||
|
||
void SceneResourcesFinder::AddUsedResource(gd::String &resourceName) { | ||
if (resourceName.empty()) { | ||
return; | ||
} | ||
resourceNames.insert(resourceName); | ||
} | ||
|
||
} // namespace gd |
Oops, something went wrong.