Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mirrage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
GameDevWeek
D
Dependencies
Cpp
mirrage
Commits
337cdf74
Commit
337cdf74
authored
Mar 29, 2019
by
Florian Oetke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed asset manager load order
parent
c307816e
Pipeline
#2953
passed with stage
in 13 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
src/mirrage/asset/src/asset_manager.cpp
src/mirrage/asset/src/asset_manager.cpp
+17
-17
No files found.
src/mirrage/asset/src/asset_manager.cpp
View file @
337cdf74
...
...
@@ -209,23 +209,6 @@ namespace mirrage::asset {
throw
std
::
system_error
(
static_cast
<
Asset_error
>
(
PHYSFS_getLastErrorCode
()),
"Unable to set write-dir: "
s
+
write_dir
);
for
(
auto
ea
:
Embedded_asset
::
instances
())
{
LOG
(
plog
::
info
)
<<
"Include embedded asset
\"
"
<<
ea
->
name
()
<<
"
\"
: "
<<
ea
->
data
().
size
()
<<
" bytes MD5: "
<<
util
::
md5
(
std
::
string
(
reinterpret_cast
<
const
char
*>
(
ea
->
data
().
data
()),
std
::
size_t
(
ea
->
data
().
size_bytes
())));
auto
name
=
"embedded_"
+
ea
->
name
()
+
".zip"
;
if
(
!
PHYSFS_mountMemory
(
ea
->
data
().
data
(),
static_cast
<
PHYSFS_uint64
>
(
ea
->
data
().
size_bytes
()),
nullptr
,
name
.
c_str
(),
nullptr
,
1
))
{
throw
std
::
system_error
(
static_cast
<
Asset_error
>
(
PHYSFS_getLastErrorCode
()),
"Unable to add embedded archive: "
s
+
ea
->
name
());
}
}
auto
add_source
=
[](
std
::
string
path
)
{
auto
apath
=
PHYSFS_getRealDir
(
path
.
c_str
());
if
(
apath
)
{
...
...
@@ -276,6 +259,23 @@ namespace mirrage::asset {
}
}
for
(
auto
ea
:
Embedded_asset
::
instances
())
{
LOG
(
plog
::
info
)
<<
"Include embedded asset
\"
"
<<
ea
->
name
()
<<
"
\"
: "
<<
ea
->
data
().
size
()
<<
" bytes MD5: "
<<
util
::
md5
(
std
::
string
(
reinterpret_cast
<
const
char
*>
(
ea
->
data
().
data
()),
std
::
size_t
(
ea
->
data
().
size_bytes
())));
auto
name
=
"embedded_"
+
ea
->
name
()
+
".zip"
;
if
(
!
PHYSFS_mountMemory
(
ea
->
data
().
data
(),
static_cast
<
PHYSFS_uint64
>
(
ea
->
data
().
size_bytes
()),
nullptr
,
name
.
c_str
(),
nullptr
,
1
))
{
throw
std
::
system_error
(
static_cast
<
Asset_error
>
(
PHYSFS_getLastErrorCode
()),
"Unable to add embedded archive: "
s
+
ea
->
name
());
}
}
// unmount default search-path
PHYSFS_unmount
(
PHYSFS_getBaseDir
());
PHYSFS_unmount
(
append_file
(
PHYSFS_getBaseDir
(),
".."
).
c_str
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment