Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-chailove
Commits
147aaeec
Unverified
Commit
147aaeec
authored
Oct 07, 2018
by
RobLoach
Browse files
Fix save_dir mounting
parent
bcbe88c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
147aaeec
...
...
@@ -4,6 +4,10 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
The format is based on
[
Keep a Changelog
](
http://keepachangelog.com/en/1.0.0/
)
and this project adheres to
[
Semantic Versioning
](
http://semver.org/spec/v2.0.0.html
)
.
## 0.28.1 - Unreleased
### Fixes
-
Fixed save_dir mounting
## 0.28.0 - 2018-10-07
### Features
-
`love.timer.step()`
now returns
`dt`
...
...
src/love/filesystem.cpp
View file @
147aaeec
...
...
@@ -72,8 +72,12 @@ void filesystem::mountlibretro() {
if
(
ChaiLove
::
environ_cb
(
RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY
,
&
save_dir
)
&&
save_dir
)
{
save_dir
=
*
save_dir
?
save_dir
:
system_dir
;
mount
(
save_dir
,
"/libretro/saves"
,
false
);
}
else
{
}
else
if
(
system_dir
)
{
// Have the system directory be the save directory if available.
mount
(
save_dir
=
system_dir
,
"/libretro/saves"
,
false
);
}
else
{
// Save directory becomes the current working directory.
mount
(
save_dir
=
"."
,
"/libretro/saves"
,
false
);
}
// Ensure the write directory is set to the Save Directory.
...
...
@@ -171,10 +175,11 @@ char* filesystem::readChar(const std::string& filename) {
std
::
string
filesystem
::
read
(
const
std
::
string
&
filename
)
{
// Retrieve a character buffer.
char
*
myBuf
=
readChar
(
filename
);
if
(
myBuf
==
NULL
)
{
return
std
::
string
(
""
);
std
::
string
output
;
if
(
myBuf
!=
NULL
)
{
output
=
std
::
string
(
myBuf
);
}
return
std
::
string
(
myBuf
)
;
return
output
;
}
void
*
filesystem
::
readBuffer
(
const
std
::
string
&
filename
,
int
&
size
)
{
...
...
@@ -222,6 +227,9 @@ bool filesystem::unmount(const std::string& archive) {
}
bool
filesystem
::
mount
(
const
char
*
archive
,
const
std
::
string
&
mountpoint
)
{
if
(
strlen
(
archive
)
==
0
)
{
return
false
;
}
return
mount
(
std
::
string
(
archive
),
mountpoint
);
}
...
...
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