mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 21:39:57 +00:00
Gast fix
This commit is contained in:
parent
501ff1b02b
commit
228a698839
6 changed files with 28 additions and 14 deletions
|
|
@ -329,11 +329,7 @@ else()
|
|||
-frename-registers
|
||||
-ffunction-sections
|
||||
-fdata-sections
|
||||
-fvisibility=hidden
|
||||
-finline-functions #-fno-rtti
|
||||
-fno-asynchronous-unwind-tables
|
||||
-fno-unwind-tables
|
||||
-s)
|
||||
-fvisibility=hidden)
|
||||
|
||||
add_link_options(-Wl,-O2
|
||||
-Wl,--gc-sections
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ Target of sunshine mod - improve original game.
|
|||
## Build
|
||||
|
||||
1. Install required packages
|
||||
* GCC 14+
|
||||
* Cmake
|
||||
* C/C++ compiler
|
||||
* xxd
|
||||
|
|
@ -24,9 +25,10 @@ Target of sunshine mod - improve original game.
|
|||
* PhysFS
|
||||
* sigc++-2.0
|
||||
* OpenSSL
|
||||
* libzip
|
||||
* GTK3(Linux only!)
|
||||
* libxfconf(Linux only!)
|
||||
* GTK3(*NIX only!)
|
||||
* libxfconf(*NIX only!)
|
||||
|
||||
(*NIX - Linux,FreeBSD and other UNIX and UNIX-like systems.)
|
||||
|
||||
2. build
|
||||
* In project dir create build dir
|
||||
|
|
|
|||
|
|
@ -17,7 +17,18 @@ module RPG
|
|||
module Cache
|
||||
@cache = {}
|
||||
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 filename != ""
|
||||
@cache[path] = Bitmap.new(path)
|
||||
|
|
|
|||
|
|
@ -11,3 +11,5 @@ Added help screen in Settings
|
|||
Fixed language selection
|
||||
Replaced Japanese font with pixel one
|
||||
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
|
||||
Input.set_led(255, 150, 30)
|
||||
|
||||
print Dir.entries(".")
|
||||
|
||||
# Load persistent data
|
||||
Persistent.load
|
||||
|
||||
|
|
|
|||
|
|
@ -73,12 +73,14 @@ std::string sha256_file(const std::string &fn) {
|
|||
|
||||
void ModLoader(){
|
||||
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.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (fs::is_empty(path)){
|
||||
Debug() << "[MODLOADER] Mods directory empty, skip.";
|
||||
return;
|
||||
}
|
||||
|
||||
//buildID - unique ID of a certain combination of mods
|
||||
|
|
@ -87,14 +89,14 @@ void ModLoader(){
|
|||
std::vector<std::string> mod_list = {};
|
||||
try{
|
||||
//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;
|
||||
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();
|
||||
if (ext != ".zip") continue;
|
||||
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) {
|
||||
crash(Exception::ModLoaderError, "PhysFS_mount failed: %s", PHYSFS_getLastError());
|
||||
}
|
||||
|
|
@ -108,7 +110,6 @@ void ModLoader(){
|
|||
|
||||
buildID = sha512(buildID_tmp);
|
||||
Debug() << "[MODLOADER] BuildID: " << buildID;
|
||||
|
||||
modloader_is_enabled = true;
|
||||
}catch(const std::exception& e){
|
||||
crash(Exception::ModLoaderError, "Something is wrong, Exception: %s ", e.what());
|
||||
|
|
|
|||
Loading…
Reference in a new issue