mirror of
https://github.com/JesseTG/melonds-ds.git
synced 2024-11-23 22:49:53 +00:00
Add some directories to environment
This commit is contained in:
parent
65f753b84d
commit
1e715272b6
@ -5,6 +5,8 @@
|
||||
#ifndef MELONDS_DS_ENVIRONMENT_HPP
|
||||
#define MELONDS_DS_ENVIRONMENT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace retro {
|
||||
/// For use by other parts of the core
|
||||
bool environment(unsigned cmd, void *data);
|
||||
@ -12,6 +14,9 @@ namespace retro {
|
||||
void log(enum retro_log_level level, const char *fmt, ...);
|
||||
|
||||
bool supports_bitmasks();
|
||||
|
||||
const std::string& base_directory();
|
||||
const std::string& save_directory();
|
||||
}
|
||||
|
||||
#endif //MELONDS_DS_ENVIRONMENT_HPP
|
||||
|
@ -1,9 +1,24 @@
|
||||
#include <libretro.h>
|
||||
|
||||
#include "environment.hpp"
|
||||
#include "libretro.hpp"
|
||||
|
||||
PUBLIC_SYMBOL void retro_init(void) {
|
||||
namespace retro {
|
||||
|
||||
static std::string _base_directory;
|
||||
static std::string _save_directory;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC_SYMBOL void retro_init(void) {
|
||||
const char *dir = nullptr;
|
||||
|
||||
srand(time(nullptr));
|
||||
if (retro::environment(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir)
|
||||
retro::_base_directory = dir;
|
||||
|
||||
if (retro::environment(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir) && dir)
|
||||
retro::_save_directory = dir;
|
||||
}
|
||||
|
||||
PUBLIC_SYMBOL void retro_deinit(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user