Gast fix
This commit is contained in:
parent
501ff1b02b
commit
228a698839
|
|
@ -329,11 +329,7 @@ else()
|
||||||
-frename-registers
|
-frename-registers
|
||||||
-ffunction-sections
|
-ffunction-sections
|
||||||
-fdata-sections
|
-fdata-sections
|
||||||
-fvisibility=hidden
|
-fvisibility=hidden)
|
||||||
-finline-functions #-fno-rtti
|
|
||||||
-fno-asynchronous-unwind-tables
|
|
||||||
-fno-unwind-tables
|
|
||||||
-s)
|
|
||||||
|
|
||||||
add_link_options(-Wl,-O2
|
add_link_options(-Wl,-O2
|
||||||
-Wl,--gc-sections
|
-Wl,--gc-sections
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ Target of sunshine mod - improve original game.
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
1. Install required packages
|
1. Install required packages
|
||||||
|
* GCC 14+
|
||||||
* Cmake
|
* Cmake
|
||||||
* C/C++ compiler
|
* C/C++ compiler
|
||||||
* xxd
|
* xxd
|
||||||
|
|
@ -24,9 +25,10 @@ Target of sunshine mod - improve original game.
|
||||||
* PhysFS
|
* PhysFS
|
||||||
* sigc++-2.0
|
* sigc++-2.0
|
||||||
* OpenSSL
|
* OpenSSL
|
||||||
* libzip
|
* GTK3(*NIX only!)
|
||||||
* GTK3(Linux only!)
|
* libxfconf(*NIX only!)
|
||||||
* libxfconf(Linux only!)
|
|
||||||
|
(*NIX - Linux,FreeBSD and other UNIX and UNIX-like systems.)
|
||||||
|
|
||||||
2. build
|
2. build
|
||||||
* In project dir create build dir
|
* In project dir create build dir
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,18 @@ module RPG
|
||||||
module Cache
|
module Cache
|
||||||
@cache = {}
|
@cache = {}
|
||||||
def self.load_bitmap(folder_name, filename, hue = 0)
|
def self.load_bitmap(folder_name, filename, hue = 0)
|
||||||
path = Graphics.adapted_file(folder_name + filename)
|
if ModLoader::IS_ENABLED
|
||||||
|
if File.exist?("/mod-storage/" + folder_name + filename)
|
||||||
|
print "test"
|
||||||
|
path = Graphics.adapted_file("/mod-storage/" + folder_name + filename)
|
||||||
|
else
|
||||||
|
print "test2"
|
||||||
|
path = Graphics.adapted_file(folder_name + filename)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print "test3"
|
||||||
|
path = Graphics.adapted_file(folder_name + filename)
|
||||||
|
end
|
||||||
if not @cache.include?(path) or @cache[path].disposed?
|
if not @cache.include?(path) or @cache[path].disposed?
|
||||||
if filename != ""
|
if filename != ""
|
||||||
@cache[path] = Bitmap.new(path)
|
@cache[path] = Bitmap.new(path)
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,5 @@ Added help screen in Settings
|
||||||
Fixed language selection
|
Fixed language selection
|
||||||
Replaced Japanese font with pixel one
|
Replaced Japanese font with pixel one
|
||||||
Added SDL_HINT_INVALID_PARAM_CHECKS controller in Settings>Advanced
|
Added SDL_HINT_INVALID_PARAM_CHECKS controller in Settings>Advanced
|
||||||
|
Added "Stream Privacy"
|
||||||
|
Added a change to sub categories in the settings
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ begin
|
||||||
#debug shit
|
#debug shit
|
||||||
Input.set_led(255, 150, 30)
|
Input.set_led(255, 150, 30)
|
||||||
|
|
||||||
|
print Dir.entries(".")
|
||||||
|
|
||||||
# Load persistent data
|
# Load persistent data
|
||||||
Persistent.load
|
Persistent.load
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,12 +73,14 @@ std::string sha256_file(const std::string &fn) {
|
||||||
|
|
||||||
void ModLoader(){
|
void ModLoader(){
|
||||||
std::string path = "mods";
|
std::string path = "mods";
|
||||||
if (!fs::exists(path) || !std::filesystem::is_directory(path)) {
|
if (!fs::exists(path) || !fs::is_directory(path)) {
|
||||||
Debug() << "[MODLOADER] Mods directory not found, skip.";
|
Debug() << "[MODLOADER] Mods directory not found, skip.";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fs::is_empty(path)){
|
if (fs::is_empty(path)){
|
||||||
Debug() << "[MODLOADER] Mods directory empty, skip.";
|
Debug() << "[MODLOADER] Mods directory empty, skip.";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//buildID - unique ID of a certain combination of mods
|
//buildID - unique ID of a certain combination of mods
|
||||||
|
|
@ -87,14 +89,14 @@ void ModLoader(){
|
||||||
std::vector<std::string> mod_list = {};
|
std::vector<std::string> mod_list = {};
|
||||||
try{
|
try{
|
||||||
//1.check if any zip(mod) file, 2. calculate sha256 hash of zip(mod) files 3.mount mod via PhysFS
|
//1.check if any zip(mod) file, 2. calculate sha256 hash of zip(mod) files 3.mount mod via PhysFS
|
||||||
for (const auto &entry : std::filesystem::directory_iterator(path, std::filesystem::directory_options::skip_permission_denied)) {
|
for (const auto &entry : fs::directory_iterator(path, fs::directory_options::skip_permission_denied)) {
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
auto p = entry.path();
|
auto p = entry.path();
|
||||||
if (!std::filesystem::is_regular_file(p, ec) || ec) continue;
|
if (!fs::is_regular_file(p, ec) || ec) continue;
|
||||||
auto ext = p.extension().string();
|
auto ext = p.extension().string();
|
||||||
if (ext != ".zip") continue;
|
if (ext != ".zip") continue;
|
||||||
std::string full = p.string();
|
std::string full = p.string();
|
||||||
int ok = PHYSFS_mount(full.c_str(), "/", 0);
|
int ok = PHYSFS_mount(full.c_str(), "/mod-storage", 0);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
crash(Exception::ModLoaderError, "PhysFS_mount failed: %s", PHYSFS_getLastError());
|
crash(Exception::ModLoaderError, "PhysFS_mount failed: %s", PHYSFS_getLastError());
|
||||||
}
|
}
|
||||||
|
|
@ -108,7 +110,6 @@ void ModLoader(){
|
||||||
|
|
||||||
buildID = sha512(buildID_tmp);
|
buildID = sha512(buildID_tmp);
|
||||||
Debug() << "[MODLOADER] BuildID: " << buildID;
|
Debug() << "[MODLOADER] BuildID: " << buildID;
|
||||||
|
|
||||||
modloader_is_enabled = true;
|
modloader_is_enabled = true;
|
||||||
}catch(const std::exception& e){
|
}catch(const std::exception& e){
|
||||||
crash(Exception::ModLoaderError, "Something is wrong, Exception: %s ", e.what());
|
crash(Exception::ModLoaderError, "Something is wrong, Exception: %s ", e.what());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue