Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Game Development
Game Library
Commits
9c70be8c
Commit
9c70be8c
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
only run asset discovery for viewer when viewer is loaded
parent
0e3c14ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
demo/demo/main.cpp
+0
-1
0 additions, 1 deletion
demo/demo/main.cpp
demo/demo/models/viewer.cpp
+3
-0
3 additions, 0 deletions
demo/demo/models/viewer.cpp
include/fggl/assets/packed/adapter.hpp
+4
-0
4 additions, 0 deletions
include/fggl/assets/packed/adapter.hpp
with
7 additions
and
1 deletion
demo/demo/main.cpp
+
0
−
1
View file @
9c70be8c
...
@@ -108,7 +108,6 @@ int main(int argc, const char* argv[]) {
...
@@ -108,7 +108,6 @@ int main(int argc, const char* argv[]) {
auto
*
assetFinder
=
app
.
service
<
fggl
::
assets
::
CheckinAdapted
>
();
auto
*
assetFinder
=
app
.
service
<
fggl
::
assets
::
CheckinAdapted
>
();
assetFinder
->
discover
(
"core"
);
assetFinder
->
discover
(
"core"
);
assetFinder
->
discover
(
"viewer"
);
// force asset loading
// force asset loading
{
{
...
...
This diff is collapsed.
Click to expand it.
demo/demo/models/viewer.cpp
+
3
−
0
View file @
9c70be8c
...
@@ -109,6 +109,9 @@ namespace demo {
...
@@ -109,6 +109,9 @@ namespace demo {
void
Viewer
::
activate
()
{
void
Viewer
::
activate
()
{
Game
::
activate
();
Game
::
activate
();
auto
*
assetFinder
=
m_owner
.
service
<
fggl
::
assets
::
CheckinAdapted
>
();
assetFinder
->
discover
(
"viewer"
);
// setup the assets we can select between
// setup the assets we can select between
// TODO some form of introspection to automatically find declared/discovered assets of a given type
// TODO some form of introspection to automatically find declared/discovered assets of a given type
m_assets
.
clear
();
m_assets
.
clear
();
...
...
This diff is collapsed.
Click to expand it.
include/fggl/assets/packed/adapter.hpp
+
4
−
0
View file @
9c70be8c
...
@@ -96,6 +96,10 @@ namespace fggl::assets {
...
@@ -96,6 +96,10 @@ namespace fggl::assets {
}
}
void
discover
(
const
char
*
packName
,
bool
useCache
=
false
,
bool
updateCache
=
true
)
{
void
discover
(
const
char
*
packName
,
bool
useCache
=
false
,
bool
updateCache
=
true
)
{
if
(
m_packs
.
contains
(
packName
)
)
{
return
;
}
std
::
string
packRoot
=
"packs/"
;
std
::
string
packRoot
=
"packs/"
;
auto
packDir
=
m_storage
->
resolvePath
(
data
::
StorageType
::
Data
,
packRoot
+
packName
);
auto
packDir
=
m_storage
->
resolvePath
(
data
::
StorageType
::
Data
,
packRoot
+
packName
);
discover
(
packDir
,
useCache
,
updateCache
);
discover
(
packDir
,
useCache
,
updateCache
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment