diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index 2f49d9ee..04b1dc34 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -354,6 +354,9 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param) else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to create MxTransitionManager"); } + + Extension::Call(Load); + done: return result; // LINE: BETA10 0x1008e35d diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index 38662f05..cd804de1 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -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) { diff --git a/assets/main.cpp b/assets/main.cpp index f31279ef..b03187e0 100644 --- a/assets/main.cpp +++ b/assets/main.cpp @@ -6,7 +6,7 @@ #include si::Interleaf::Version version = si::Interleaf::Version2_2; -uint32_t bufferSize = 65535; +uint32_t bufferSize = 65536; uint32_t bufferCount = 8; std::string out; diff --git a/extensions/include/extensions/siloader.h b/extensions/include/extensions/siloader.h index 798286cd..92cc3bfe 100644 --- a/extensions/include/extensions/siloader.h +++ b/extensions/include/extensions/siloader.h @@ -14,6 +14,7 @@ class SiLoader { typedef std::pair 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 diff --git a/extensions/src/siloader.cpp b/extensions/src/siloader.cpp index 68cb1317..7aadcf63 100644 --- a/extensions/src/siloader.cpp +++ b/extensions/src/siloader.cpp @@ -15,6 +15,10 @@ std::vector> 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; }