mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
Add widescreen.si to web port
This commit is contained in:
parent
841db2a577
commit
74b9a425df
@ -1,6 +1,7 @@
|
||||
#include "filesystem.h"
|
||||
|
||||
#include "events.h"
|
||||
#include "extensions/siloader.h"
|
||||
#include "extensions/textureloader.h"
|
||||
#include "legogamestate.h"
|
||||
#include "misc.h"
|
||||
@ -107,6 +108,14 @@ void Emscripten_SetupFilesystem()
|
||||
Emscripten_SendExtensionProgress("HD Textures", (++i * 100) / sizeOfArray(g_textures));
|
||||
}
|
||||
}
|
||||
|
||||
if (Extensions::SiLoader::enabled) {
|
||||
wasmfs_create_directory("/LEGO/extra", 0644, fetchfs);
|
||||
|
||||
for (const auto& file : Extensions::SiLoader::files) {
|
||||
registerFile(file.c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GameState()->GetSavePath() && *GameState()->GetSavePath() && !Emscripten_OPFSDisabled()) {
|
||||
|
||||
@ -963,16 +963,16 @@ MxResult IsleApp::SetupWindow()
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to open SDL_IOStream for icon: %s", SDL_GetError());
|
||||
}
|
||||
|
||||
if (!SetupLegoOmni()) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
GameState()->SetSavePath(m_savePath);
|
||||
|
||||
if (VerifyFilesystem() != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!SetupLegoOmni()) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
DetectGameVersion();
|
||||
GameState()->SerializePlayersInfo(LegoStorage::c_read);
|
||||
GameState()->SerializeScoreHistory(LegoStorage::c_read);
|
||||
|
||||
@ -19,10 +19,10 @@ class SiLoader {
|
||||
static bool RemoveWith(StreamObject p_object, LegoWorld* world);
|
||||
|
||||
static std::map<std::string, std::string> options;
|
||||
static std::vector<std::string> files;
|
||||
static bool enabled;
|
||||
|
||||
private:
|
||||
static std::vector<std::string> files;
|
||||
static std::vector<std::pair<StreamObject, StreamObject>> startWith;
|
||||
static std::vector<std::pair<StreamObject, StreamObject>> removeWith;
|
||||
|
||||
|
||||
@ -10,24 +10,29 @@
|
||||
using namespace Extensions;
|
||||
|
||||
std::map<std::string, std::string> SiLoader::options;
|
||||
std::vector<std::string> SiLoader::files;
|
||||
std::vector<std::pair<SiLoader::StreamObject, SiLoader::StreamObject>> SiLoader::startWith;
|
||||
std::vector<std::pair<SiLoader::StreamObject, SiLoader::StreamObject>> SiLoader::removeWith;
|
||||
bool SiLoader::enabled = false;
|
||||
|
||||
void SiLoader::Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
bool SiLoader::Load()
|
||||
{
|
||||
char* files = SDL_strdup(options["si loader:files"].c_str());
|
||||
char* saveptr;
|
||||
|
||||
for (char* file = SDL_strtok_r(files, ",\n", &saveptr); file; file = SDL_strtok_r(NULL, ",\n", &saveptr)) {
|
||||
LoadFile(file);
|
||||
SiLoader::files.emplace_back(file);
|
||||
}
|
||||
|
||||
SDL_free(files);
|
||||
}
|
||||
|
||||
bool SiLoader::Load()
|
||||
{
|
||||
for (const auto& file : files) {
|
||||
LoadFile(file.c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user