This commit is contained in:
Christian Semmler 2025-08-10 12:21:56 -07:00
parent 602c3eafc8
commit 9e42ee1236
5 changed files with 29 additions and 23 deletions

View File

@ -354,6 +354,9 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param)
else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to create MxTransitionManager");
}
Extension<SiLoader>::Call(Load);
done:
return result;
// LINE: BETA10 0x1008e35d

View File

@ -200,22 +200,6 @@ inline MxS32 MxVideoPresenter::PrepareRects(RECT& p_rectDest, RECT& p_rectSrc)
return -1;
}
if (p_rectDest.bottom > 480) {
p_rectDest.bottom = 480;
}
if (p_rectDest.right > 640) {
p_rectDest.right = 640;
}
if (p_rectSrc.bottom > 480) {
p_rectSrc.bottom = 480;
}
if (p_rectSrc.right > 640) {
p_rectSrc.right = 640;
}
int height, width;
if ((height = (p_rectDest.bottom - p_rectDest.top) + 1) <= 1 ||
(width = (p_rectDest.right - p_rectDest.left) + 1) <= 1) {

View File

@ -6,7 +6,7 @@
#include <object.h>
si::Interleaf::Version version = si::Interleaf::Version2_2;
uint32_t bufferSize = 65535;
uint32_t bufferSize = 65536;
uint32_t bufferCount = 8;
std::string out;

View File

@ -14,6 +14,7 @@ class SiLoader {
typedef std::pair<MxAtomId, MxU32> StreamObject;
static void Initialize();
static bool Load();
static bool StartWith(StreamObject p_object);
static bool RemoveWith(StreamObject p_object, LegoWorld* world);
@ -29,9 +30,11 @@ class SiLoader {
};
#ifdef EXTENSIONS
constexpr auto Load = &SiLoader::Load;
constexpr auto StartWith = &SiLoader::StartWith;
constexpr auto RemoveWith = &SiLoader::RemoveWith;
#else
constexpr decltype(&SiLoader::Load) Load = nullptr;
constexpr decltype(&SiLoader::StartWith) StartWith = nullptr;
constexpr decltype(&SiLoader::RemoveWith) RemoveWith = nullptr;
#endif

View File

@ -15,6 +15,10 @@ std::vector<std::pair<SiLoader::StreamObject, SiLoader::StreamObject>> SiLoader:
bool SiLoader::enabled = false;
void SiLoader::Initialize()
{
}
bool SiLoader::Load()
{
char* files = SDL_strdup(options["si loader:files"].c_str());
char* saveptr;
@ -24,6 +28,7 @@ void SiLoader::Initialize()
}
SDL_free(files);
return true;
}
bool SiLoader::StartWith(StreamObject p_object)
@ -56,12 +61,18 @@ bool SiLoader::LoadFile(const char* p_file)
si::Interleaf si;
MxStreamController* controller;
if (si.Read(p_file) != si::Interleaf::ERROR_SUCCESS) {
SDL_Log("Could not parse SI file %s", p_file);
return false;
MxString path = MxString(MxOmni::GetHD()) + p_file;
path.MapPathToFilesystem();
if (si.Read(path.GetData()) != si::Interleaf::ERROR_SUCCESS) {
path = MxString(MxOmni::GetCD()) + p_file;
path.MapPathToFilesystem();
if (si.Read(path.GetData()) != si::Interleaf::ERROR_SUCCESS) {
SDL_Log("Could not parse SI file %s", p_file);
return false;
}
}
if ((controller = Streamer()->Open(p_file, MxStreamer::e_diskStream)) != SUCCESS) {
if (!(controller = Streamer()->Open(p_file, MxStreamer::e_diskStream))) {
SDL_Log("Could not load SI file %s", p_file);
return false;
}
@ -75,7 +86,7 @@ bool SiLoader::LoadFile(const char* p_file)
uint32_t id;
if ((directive = SDL_strstr(extra.c_str(), "StartWith:"))) {
if (SDL_sscanf(extra.c_str(), "StartWith:%255[^;];%d", atom, &id) == 2) {
if (SDL_sscanf(directive, "StartWith:%255[^;];%d", atom, &id) == 2) {
startWith.emplace_back(
StreamObject{MxAtomId{atom, e_lowerCase2}, id},
StreamObject{controller->GetAtom(), object->id_}
@ -84,7 +95,7 @@ bool SiLoader::LoadFile(const char* p_file)
}
if ((directive = SDL_strstr(extra.c_str(), "RemoveWith:"))) {
if (SDL_sscanf(extra.c_str(), "RemoveWith:%255[^;];%d", atom, &id) == 2) {
if (SDL_sscanf(directive, "RemoveWith:%255[^;];%d", atom, &id) == 2) {
removeWith.emplace_back(
StreamObject{MxAtomId{atom, e_lowerCase2}, id},
StreamObject{controller->GetAtom(), object->id_}
@ -95,5 +106,10 @@ bool SiLoader::LoadFile(const char* p_file)
}
}
const auto& x = startWith;
const auto& y = removeWith;
assert(false);
return true;
}