Add widescreen.si to web port

This commit is contained in:
Christian Semmler 2025-08-10 19:17:41 -07:00
parent 841db2a577
commit 74b9a425df
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
4 changed files with 24 additions and 10 deletions

View File

@ -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()) {

View File

@ -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);

View File

@ -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;

View File

@ -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;
}