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