Use SDL3 functions in more locations (#44)

* Use strcasecmp, strncasecmp, strlwr, strupr and itoa from SDL

* Use SDL_GetTicks instead of timeGetTime

* Use MxDSFile::OPEN_READ instead of OF_READ

* Use SDL_IOStream to read bitmaps

* Use SDL_LogXXX instead of OutputDebugString

* Undo mxvideoparam.h change

* Revert "Undo mxvideoparam.h change"

This reverts commit 4a20cf6c46.

* Fix _MxTrace

* Reapply "Undo mxvideoparam.h change"

This reverts commit b3a09dc520.

* fix _MxTrace

* Use __declspec(dllexport) for exporting symbols from dll

Refactored CMake script such that all objects are passed to the lego1 library.

* clang-format

* fix msvc build

* MSVC fixed for real now?

* Forgot about d3drm_guid

* Fix naming issue

* Use Uint64 in LegoCarBuild::Tickle for dTime
This commit is contained in:
Anonymous Maarten 2024-12-25 02:04:46 +01:00 committed by GitHub
parent 9db0e795f4
commit bb4db6caac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
86 changed files with 418 additions and 763 deletions

View File

@ -60,19 +60,6 @@ if (ENABLE_CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_BIN}") set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_BIN}")
endif() endif()
set(MSVC_FOR_DECOMP FALSE)
if (MSVC)
# Visual C++ 4.2 -> cl version 10.2.0
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0")
set(MSVC_FOR_DECOMP TRUE)
endif()
endif()
set(lego1_targets)
macro(register_lego1_target __target)
list(APPEND lego1_targets ${__target})
endmacro()
function(add_cxx_warning WARNING) function(add_cxx_warning WARNING)
if(ISLE_WERROR) if(ISLE_WERROR)
set(compiler_option "-Werror=${WARNING}") set(compiler_option "-Werror=${WARNING}")
@ -104,14 +91,11 @@ endif()
add_subdirectory(3rdparty EXCLUDE_FROM_ALL SYSTEM) add_subdirectory(3rdparty EXCLUDE_FROM_ALL SYSTEM)
message(STATUS "MSVC for decompilation: ${MSVC_FOR_DECOMP}")
option(ISLE_WERROR "Treat warnings as errors" OFF) option(ISLE_WERROR "Treat warnings as errors" OFF)
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON) option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "NOT MINGW" OFF) cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "NOT MINGW" OFF)
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ${NOT_MINGW}) option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ${NOT_MINGW})
cmake_dependent_option(ISLE_D3DRM_FROM_WINE "Use d3drm from wine" "${MINGW}" "NOT ISLE_USE_DX5" OFF) cmake_dependent_option(ISLE_D3DRM_FROM_WINE "Use d3drm from wine" "${MINGW}" "NOT ISLE_USE_DX5" OFF)
option(ISLE_DECOMP_ASSERT "Assert struct size" ${MSVC_FOR_DECOMP})
message(STATUS "Using internal DirectX5 SDK: ${ISLE_USE_DX5}") message(STATUS "Using internal DirectX5 SDK: ${ISLE_USE_DX5}")
message(STATUS "Using d3drm from wine: ${ISLE_D3DRM_FROM_WINE}") message(STATUS "Using d3drm from wine: ${ISLE_D3DRM_FROM_WINE}")
@ -127,8 +111,22 @@ add_subdirectory(3rdparty/d3drm EXCLUDE_FROM_ALL)
add_library(Vec::Vec INTERFACE IMPORTED) add_library(Vec::Vec INTERFACE IMPORTED)
target_include_directories(Vec::Vec INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/vec") target_include_directories(Vec::Vec INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/vec")
set(lego1_targets)
set(lego1_interface_targets)
macro(add_lego1_static_library NAME)
list(APPEND lego1_targets ${NAME})
list(APPEND lego1_interface_targets ${NAME}-interface)
add_library(${NAME}-interface INTERFACE)
add_library(${NAME}-objects STATIC ${ARGN})
target_link_libraries(${NAME}-objects PRIVATE ${NAME}-interface)
add_library(tglrl STATIC target_include_directories(${NAME}-objects PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:$<TARGET_PROPERTY:d3drm-wine,INTERFACE_INCLUDE_DIRECTORIES>>)
target_link_libraries(${NAME}-interface INTERFACE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5> SDL3::SDL3)
target_compile_definitions(${NAME}-objects PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DIRECTX5_SDK>)
target_compile_definitions(${NAME}-objects PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:D3DRM_WINE>)
endmacro()
add_lego1_static_library(tglrl
LEGO1/tgl/d3drm/camera.cpp LEGO1/tgl/d3drm/camera.cpp
LEGO1/tgl/d3drm/device.cpp LEGO1/tgl/d3drm/device.cpp
LEGO1/tgl/d3drm/group.cpp LEGO1/tgl/d3drm/group.cpp
@ -139,90 +137,74 @@ add_library(tglrl STATIC
LEGO1/tgl/d3drm/texture.cpp LEGO1/tgl/d3drm/texture.cpp
LEGO1/tgl/d3drm/view.cpp LEGO1/tgl/d3drm/view.cpp
) )
register_lego1_target(tglrl) target_include_directories(tglrl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET tglrl PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$<CONFIG:Debug>:d>")
target_include_directories(tglrl PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
if(ISLE_D3DRM_FROM_WINE) if(ISLE_D3DRM_FROM_WINE)
target_link_libraries(tglrl PRIVATE d3drm-wine) target_link_libraries(tglrl-interface INTERFACE d3drm-wine)
else() else()
target_link_libraries(tglrl PRIVATE d3drm) target_link_libraries(tglrl-interface INTERFACE d3drm)
endif() endif()
add_library(realtime STATIC add_lego1_static_library(realtime
LEGO1/realtime/matrix.cpp LEGO1/realtime/matrix.cpp
LEGO1/realtime/orientableroi.cpp LEGO1/realtime/orientableroi.cpp
LEGO1/realtime/realtime.cpp LEGO1/realtime/realtime.cpp
LEGO1/realtime/realtimeview.cpp LEGO1/realtime/realtimeview.cpp
LEGO1/realtime/vector.cpp LEGO1/realtime/vector.cpp
) )
register_lego1_target(realtime) target_include_directories(realtime-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET realtime PROPERTY ARCHIVE_OUTPUT_NAME "realtime$<$<CONFIG:Debug>:d>") target_link_libraries(realtime-interface INTERFACE Vec::Vec)
target_include_directories(realtime PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(realtime PRIVATE Vec::Vec)
add_library(viewmanager STATIC add_lego1_static_library(viewmanager
LEGO1/viewmanager/viewlod.cpp LEGO1/viewmanager/viewlod.cpp
LEGO1/viewmanager/viewlodlist.cpp LEGO1/viewmanager/viewlodlist.cpp
LEGO1/viewmanager/viewmanager.cpp LEGO1/viewmanager/viewmanager.cpp
LEGO1/viewmanager/viewroi.cpp LEGO1/viewmanager/viewroi.cpp
) )
register_lego1_target(viewmanager) target_include_directories(viewmanager-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET viewmanager PROPERTY ARCHIVE_OUTPUT_NAME "viewmanager$<$<CONFIG:Debug>:d>") target_link_libraries(viewmanager-interface INTERFACE Vec::Vec)
target_include_directories(viewmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(viewmanager PRIVATE Vec::Vec)
add_library(mxdirectx STATIC add_lego1_static_library(mxdirectx
LEGO1/mxdirectx/mxdirect3d.cpp LEGO1/mxdirectx/mxdirect3d.cpp
LEGO1/mxdirectx/mxdirectdraw.cpp LEGO1/mxdirectx/mxdirectdraw.cpp
LEGO1/mxdirectx/mxdirectxinfo.cpp LEGO1/mxdirectx/mxdirectxinfo.cpp
LEGO1/mxdirectx/legodxinfo.cpp LEGO1/mxdirectx/legodxinfo.cpp
) )
register_lego1_target(mxdirectx) target_include_directories(mxdirectx-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET mxdirectx PROPERTY ARCHIVE_OUTPUT_NAME "MxDirectX$<$<CONFIG:Debug>:d>") target_link_libraries(mxdirectx-interface INTERFACE ddraw)
target_include_directories(mxdirectx PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(mxdirectx PRIVATE ddraw)
add_library(roi STATIC add_lego1_static_library(roi
LEGO1/lego/sources/roi/legolod.cpp LEGO1/lego/sources/roi/legolod.cpp
LEGO1/lego/sources/roi/legoroi.cpp LEGO1/lego/sources/roi/legoroi.cpp
) )
register_lego1_target(roi) target_include_directories(roi-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET roi PROPERTY ARCHIVE_OUTPUT_NAME "roi$<$<CONFIG:Debug>:d>") target_link_libraries(roi-interface INTERFACE viewmanager-interface Vec::Vec)
target_include_directories(roi PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(roi PRIVATE viewmanager Vec::Vec)
add_library(geom STATIC add_lego1_static_library(geom
LEGO1/lego/sources/geom/legoedge.cpp LEGO1/lego/sources/geom/legoedge.cpp
LEGO1/lego/sources/geom/legounkown100db7f4.cpp LEGO1/lego/sources/geom/legounkown100db7f4.cpp
LEGO1/lego/sources/geom/legoweedge.cpp LEGO1/lego/sources/geom/legoweedge.cpp
LEGO1/lego/sources/geom/legowegedge.cpp LEGO1/lego/sources/geom/legowegedge.cpp
) )
register_lego1_target(geom) target_include_directories(geom-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET geom PROPERTY ARCHIVE_OUTPUT_NAME "geom$<$<CONFIG:Debug>:d>") target_link_libraries(geom-interface INTERFACE)
target_include_directories(geom PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(geom PRIVATE)
add_library(shape STATIC add_lego1_static_library(shape
LEGO1/lego/sources/shape/legocolor.cpp LEGO1/lego/sources/shape/legocolor.cpp
LEGO1/lego/sources/shape/legobox.cpp LEGO1/lego/sources/shape/legobox.cpp
LEGO1/lego/sources/shape/legomesh.cpp LEGO1/lego/sources/shape/legomesh.cpp
LEGO1/lego/sources/shape/legosphere.cpp LEGO1/lego/sources/shape/legosphere.cpp
LEGO1/lego/sources/shape/legovertex.cpp LEGO1/lego/sources/shape/legovertex.cpp
) )
register_lego1_target(shape) target_include_directories(shape-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET shape PROPERTY ARCHIVE_OUTPUT_NAME "shape$<$<CONFIG:Debug>:d>") target_link_libraries(shape-interface INTERFACE)
target_include_directories(shape PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(shape PRIVATE)
add_library(anim STATIC add_lego1_static_library(anim
LEGO1/lego/sources/anim/legoanim.cpp LEGO1/lego/sources/anim/legoanim.cpp
) )
register_lego1_target(anim) target_include_directories(anim-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET anim PROPERTY ARCHIVE_OUTPUT_NAME "anim$<$<CONFIG:Debug>:d>") target_link_libraries(anim-interface INTERFACE)
target_include_directories(anim PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(anim PRIVATE)
add_library(misc STATIC add_lego1_static_library(misc
LEGO1/lego/sources/misc/legocontainer.cpp LEGO1/lego/sources/misc/legocontainer.cpp
LEGO1/lego/sources/misc/legoimage.cpp LEGO1/lego/sources/misc/legoimage.cpp
LEGO1/lego/sources/misc/legostorage.cpp LEGO1/lego/sources/misc/legostorage.cpp
@ -230,23 +212,19 @@ add_library(misc STATIC
LEGO1/lego/sources/misc/legotree.cpp LEGO1/lego/sources/misc/legotree.cpp
LEGO1/lego/sources/misc/legounknown.cpp LEGO1/lego/sources/misc/legounknown.cpp
) )
register_lego1_target(misc) target_include_directories(misc-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET misc PROPERTY ARCHIVE_OUTPUT_NAME "misc$<$<CONFIG:Debug>:d>") target_link_libraries(misc-interface INTERFACE)
target_include_directories(misc PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(misc PRIVATE)
add_library(3dmanager STATIC add_lego1_static_library(3dmanager
LEGO1/lego/sources/3dmanager/lego3dmanager.cpp LEGO1/lego/sources/3dmanager/lego3dmanager.cpp
LEGO1/lego/sources/3dmanager/lego3dview.cpp LEGO1/lego/sources/3dmanager/lego3dview.cpp
LEGO1/lego/sources/3dmanager/legoview1.cpp LEGO1/lego/sources/3dmanager/legoview1.cpp
LEGO1/lego/sources/3dmanager/tglsurface.cpp LEGO1/lego/sources/3dmanager/tglsurface.cpp
) )
register_lego1_target(3dmanager) target_include_directories(3dmanager-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET 3dmanager PROPERTY ARCHIVE_OUTPUT_NAME "3dmanager$<$<CONFIG:Debug>:d>") target_link_libraries(3dmanager-interface INTERFACE Vec::Vec)
target_include_directories(3dmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(3dmanager PRIVATE Vec::Vec)
add_library(omni STATIC add_lego1_static_library(omni
LEGO1/omni/src/action/mxdsaction.cpp LEGO1/omni/src/action/mxdsaction.cpp
LEGO1/omni/src/action/mxdsanim.cpp LEGO1/omni/src/action/mxdsanim.cpp
LEGO1/omni/src/action/mxdsevent.cpp LEGO1/omni/src/action/mxdsevent.cpp
@ -324,12 +302,10 @@ add_library(omni STATIC
LEGO1/omni/src/video/mxvideoparamflags.cpp LEGO1/omni/src/video/mxvideoparamflags.cpp
LEGO1/omni/src/video/mxvideopresenter.cpp LEGO1/omni/src/video/mxvideopresenter.cpp
) )
register_lego1_target(omni) target_include_directories(omni-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
set_property(TARGET omni PROPERTY ARCHIVE_OUTPUT_NAME "omni$<$<CONFIG:Debug>:d>") target_link_libraries(omni-interface INTERFACE winmm libsmacker miniaudio)
target_include_directories(omni PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(omni PRIVATE winmm libsmacker miniaudio)
add_library(lego1 SHARED add_lego1_static_library(lego1_impl
LEGO1/define.cpp LEGO1/define.cpp
LEGO1/lego/legoomni/src/actors/act2actor.cpp LEGO1/lego/legoomni/src/actors/act2actor.cpp
LEGO1/lego/legoomni/src/actors/act2genactor.cpp LEGO1/lego/legoomni/src/actors/act2genactor.cpp
@ -442,41 +418,33 @@ add_library(lego1 SHARED
LEGO1/lego/legoomni/src/worlds/police.cpp LEGO1/lego/legoomni/src/worlds/police.cpp
LEGO1/lego/legoomni/src/worlds/registrationbook.cpp LEGO1/lego/legoomni/src/worlds/registrationbook.cpp
LEGO1/lego/legoomni/src/worlds/score.cpp LEGO1/lego/legoomni/src/worlds/score.cpp
LEGO1/main.cpp
LEGO1/modeldb/modeldb.cpp LEGO1/modeldb/modeldb.cpp
) )
register_lego1_target(lego1) target_include_directories(lego1_impl-interface INTERFACE "${CMAKE_SOURCE_DIR}/util")
target_include_directories(lego1_impl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1")
target_include_directories(lego1_impl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include")
target_include_directories(lego1_impl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources")
target_include_directories(lego1_impl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include")
target_include_directories(lego1_impl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include/actions")
target_link_libraries(lego1_impl-interface INTERFACE omni-interface Vec::Vec)
if(MINGW) if(MINGW)
target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500) target_compile_definitions(lego1_impl-interface INTERFACE DIRECTINPUT_VERSION=0x0500)
endif() endif()
if (MSVC) set(lego1_objects)
if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(lego1_link_libraries dxguid d3drm_guid)
target_sources(lego1 PRIVATE LEGO1/LegoOmni.def) foreach(lego1_library IN LISTS lego1_targets)
else() message("lego1_library:${lego1_library}")
target_sources(lego1 PRIVATE LEGO1/LegoOmni64.def) target_compile_definitions(${lego1_library}-objects PRIVATE LEGO1_DLL)
endif() list(APPEND lego1_objects $<TARGET_OBJECTS:${lego1_library}-objects>)
else() list(APPEND lego1_link_libraries ${lego1_library}-interface)
target_sources(lego1 PRIVATE LEGO1/LegoOmni.mingw.def)
endif()
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/util")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/omni/include")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include/actions")
# Link libraries
target_link_libraries(lego1 PRIVATE tglrl viewmanager realtime mxdirectx roi geom anim Vec::Vec dxguid d3drm_guid misc 3dmanager miniaudio omni shape)
foreach(tgt IN LISTS lego1_targets)
target_include_directories(${tgt} PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:$<TARGET_PROPERTY:d3drm-wine,INTERFACE_INCLUDE_DIRECTORIES>>)
target_link_libraries(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5> SDL3::SDL3)
target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DIRECTX5_SDK>)
target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:D3DRM_WINE>)
endforeach() endforeach()
add_library(lego1 SHARED
LEGO1/main.cpp
${lego1_objects}
)
target_link_libraries(lego1 PUBLIC ${lego1_link_libraries})
# Make sure filenames are ALL CAPS # Make sure filenames are ALL CAPS
set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1) set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1)
@ -538,7 +506,7 @@ endif()
if (MSVC) if (MSVC)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
set_property(TARGET ${lego1_targets} APPEND PROPERTY COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS") set_property(TARGET ${lego1_interface_targets} APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS")
if (TARGET isle) if (TARGET isle)
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif() endif()
@ -548,8 +516,8 @@ if (MSVC)
endif() endif()
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus # Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428")
foreach(tgt IN LISTS lego1_targets) foreach(tgt IN LISTS lego1_interface_targets)
target_compile_options(${tgt} PRIVATE "-Zc:__cplusplus") target_compile_options(${tgt} INTERFACE "-Zc:__cplusplus")
endforeach() endforeach()
if (TARGET isle) if (TARGET isle)
target_compile_options(isle PRIVATE "-Zc:__cplusplus") target_compile_options(isle PRIVATE "-Zc:__cplusplus")
@ -565,73 +533,6 @@ if(MSVC)
target_link_options(lego1 PRIVATE "/SAFESEH:NO") target_link_options(lego1 PRIVATE "/SAFESEH:NO")
endif() endif()
if (ISLE_DECOMP_ASSERT)
message(STATUS "Decomp asserts enabled")
foreach(tgt IN LISTS lego1_targets)
target_compile_definitions(${tgt} PRIVATE "ENABLE_DECOMP_ASSERTS")
endforeach()
if (TARGET isle)
target_compile_definitions(isle PRIVATE "ENABLE_DECOMP_ASSERTS")
endif()
if (TARGET config)
target_compile_definitions(config PRIVATE "ENABLE_DECOMP_ASSERTS")
endif()
endif()
if (MSVC_FOR_DECOMP)
# These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the
# game was originally built with) and tweaked slightly to produce more debugging info for reccmp.
# They ensure a recompilation that can be byte/instruction accurate to the original binaries.
if (ISLE_BUILD_APP)
target_link_options(isle PRIVATE "/OPT:REF")
set_property(TARGET isle ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
# Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>")
set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"")
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"")
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /D \"NDEBUG\"")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /D \"NDEBUG\"")
set(CMAKE_CXX_FLAGS_MINSIZEREL "/Os /D \"NDEBUG\"")
set(CMAKE_EXE_LINKER_FLAGS "/machine:I386")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/incremental:yes /debug")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/incremental:no")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/incremental:no")
set(CMAKE_STATIC_LINKER_FLAGS "/machine:I386")
set(CMAKE_SHARED_LINKER_FLAGS "/machine:I386")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/incremental:yes /debug")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/incremental:no")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "/incremental:no")
# Older MSVC versions don't support building in parallel.
# Force non-parallel builds of isle and lego1 by putting them in a pool with 1 available job.
if (CMAKE_CXX_COMPILER_ID VERSION_LESS 12)
foreach(tgt IN LISTS lego1_targets)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1")
set_property(TARGET ${tgt} PROPERTY JOB_POOL_COMPILE "msvc_${tgt}")
set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK "msvc_${tgt}")
endforeach()
if (TARGET isle)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_isle=1")
set_property(TARGET isle PROPERTY JOB_POOL_COMPILE "msvc_isle")
set_property(TARGET isle PROPERTY JOB_POOL_LINK "msvc_isle")
endif()
if (TARGET config)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_config=1")
set_property(TARGET config PROPERTY JOB_POOL_COMPILE "msvc_config")
set_property(TARGET config PROPERTY JOB_POOL_LINK "msvc_config")
endif()
endif()
endif()
find_program(CLANGFORMAT_BIN NAMES clang-format) find_program(CLANGFORMAT_BIN NAMES clang-format)
if(EXISTS "${CLANGFORMAT_BIN}") if(EXISTS "${CLANGFORMAT_BIN}")
execute_process(COMMAND "${CLANGFORMAT_BIN}" --version execute_process(COMMAND "${CLANGFORMAT_BIN}" --version

View File

@ -185,13 +185,11 @@ MxS32 IsleApp::SetupLegoOmni()
#ifdef COMPAT_MODE #ifdef COMPAT_MODE
MxS32 failure; MxS32 failure;
{ {
MxOmniCreateParam param(mediaPath, (struct HWND__*) hwnd, m_videoParam, MxOmniCreateFlags()); MxOmniCreateParam param(mediaPath, hwnd, m_videoParam, MxOmniCreateFlags());
failure = Lego()->Create(param) == FAILURE; failure = Lego()->Create(param) == FAILURE;
} }
#else #else
MxS32 failure = MxS32 failure = Lego()->Create(MxOmniCreateParam(mediaPath, hwnd, m_videoParam, MxOmniCreateFlags())) == FAILURE;
Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__*) hwnd, m_videoParam, MxOmniCreateFlags())) ==
FAILURE;
#endif #endif
if (!failure) { if (!failure) {

View File

@ -1,6 +1,7 @@
#ifndef ISLEAPP_H #ifndef ISLEAPP_H
#define ISLEAPP_H #define ISLEAPP_H
#include "lego1_export.h"
#include "legoutils.h" #include "legoutils.h"
#include "mxtypes.h" #include "mxtypes.h"
#include "mxvideoparam.h" #include "mxvideoparam.h"

View File

@ -1,136 +0,0 @@
; LegoOmni.def : Declares the module paarameters for the LEGO1.DLL.
; DESCRIPTION "Lego OMNI Windows Dynamic Link Library"
EXPORTS
; EXPORTs really required only.
??0LegoBackgroundColor@@QAE@PBD0@Z
??0LegoGameState@@QAE@XZ
??0LegoWorld@@QAE@XZ
??0MxAtomId@@QAE@PBDW4LookupMode@@@Z
??0MxBitmap@@QAE@XZ
??0MxCore@@QAE@XZ
??0MxCriticalSection@@QAE@XZ
??0MxDSAction@@QAE@XZ
??0MxDSFile@@QAE@PBDK@Z
??0MxOmniCreateFlags@@QAE@XZ
??0MxOmniCreateParam@@QAE@PBDPAUHWND__@@AAVMxVideoParam@@VMxOmniCreateFlags@@@Z
??0MxString@@QAE@ABV0@@Z
??0MxVideoParam@@QAE@AAV0@@Z
??0MxVideoParam@@QAE@AAVMxRect32@@PAVMxPalette@@KAAVMxVideoParamFlags@@@Z
??0MxVideoParam@@QAE@XZ
??0MxVideoParamFlags@@QAE@XZ
??1LegoEntity@@UAE@XZ
??1LegoGameState@@QAE@XZ
??1LegoWorld@@UAE@XZ
??1MXIOINFO@@QAE@XZ
??1MxAtomId@@QAE@XZ
??1MxBitmap@@UAE@XZ
??1MxCore@@UAE@XZ
??1MxCriticalSection@@QAE@XZ
??1MxDSAction@@UAE@XZ
??1MxDSFile@@UAE@XZ
??1MxPresenter@@UAE@XZ
??1MxString@@UAE@XZ
??1MxVideoParam@@QAE@XZ
??4MxAtomId@@QAEAAV0@ABV0@@Z
??4MxString@@QAEABV0@PBD@Z
??4MxVideoParam@@QAEAAV0@ABV0@@Z
??8MxPalette@@QAEEAAV0@@Z
?BackgroundAudioManager@@YAPAVMxBackgroundAudioManager@@XZ
?Close@MxDSFile@@UAEJXZ
?Close@MxStreamer@@QAEJPBD@Z
?CreateBackgroundAudio@LegoOmni@@QAEXXZ
?CreateInstance@LegoOmni@@SAXXZ
?CreatePalette@MxBitmap@@UAEPAVMxPalette@@XZ
?CreateStreamObject@@YAPAVMxDSObject@@PAVMxDSFile@@F@Z
?DestroyInstance@MxOmni@@SAXXZ
?Detach@MxPalette@@QAEXXZ
?DisableRMDevice@LegoVideoManager@@QAEHXZ
?DoneTickle@MxPresenter@@MAEXXZ
?Enable@MxBackgroundAudioManager@@QAEXE@Z
?Enable@MxPresenter@@UAEXE@Z
?EnableFullScreenMovie@LegoVideoManager@@QAEXEE@Z
?EnableRMDevice@LegoVideoManager@@QAEHXZ
?EndAction@MxPresenter@@UAEXXZ
?EventManager@@YAPAVMxEventManager@@XZ
?FlipToGDISurface@MxDirectDraw@@QAEHXZ
?GameState@@YAPAVLegoGameState@@XZ
?GetBufferSize@MxDSFile@@UAEKXZ
?GetCD@MxOmni@@SAPBDXZ
?GetCurrPathInfo@LegoOmni@@SAHPAPAVLegoPathBoundary@@AAH@Z
?GetDefaults@LegoNavController@@SAXPAHPAM11111111PAE@Z
?GetHD@MxOmni@@SAPBDXZ
?GetInstance@LegoOmni@@SAPAV1@XZ
?GetInstance@MxOmni@@SAPAV1@XZ
?GetInstance@MxScheduler@@SAPAV1@XZ
?GetNoCD_SourceName@@YAPBDXZ
?GetPartsThreshold@RealtimeView@@SAMXZ
?GetPrimaryBitDepth@MxDirectDraw@@SAHXZ
?GetRealTime@MxTimer@@QAEJXZ
?GetStreamBuffersNum@MxDSFile@@UAEKXZ
?GetUserMaxLOD@RealtimeView@@SAMXZ
?GetVariable@MxVariableTable@@QAEPBDPBD@Z
?Init@MxPresenter@@IAEXXZ
?InputManager@@YAPAVLegoInputManager@@XZ
?InvalidateRect@MxVideoManager@@QAEXAAVMxRect32@@@Z
?IsSound3D@MxOmni@@SAEXZ
?Lego@@YAPAVLegoOmni@@XZ
?Load@LegoGameState@@QAEJK@Z
?MSoundManager@@YAPAVMxSoundManager@@XZ
?MakeSourceName@@YAXPADPBD@Z
?MoveCursor@LegoVideoManager@@QAEXHH@Z
?NotificationManager@@YAPAVMxNotificationManager@@XZ
?Notify@MxCore@@UAEJAAVMxParam@@@Z
?Open@MxDSFile@@UAEJK@Z
?Open@MxStreamer@@QAEPAVMxStreamController@@PBDG@Z
?ParseExtra@MxPresenter@@MAEXXZ
?Pause@MxDirectDraw@@QAEHH@Z
?PickEntity@@YAPAVLegoEntity@@JJ@Z
?PickROI@@YAPAVLegoROI@@JJ@Z
?QueueEvent@LegoInputManager@@QAEXW4NotificationId@@EJJE@Z
?Read@MxBitmap@@UAEJPBD@Z
?Read@MxDSFile@@UAEJPAEK@Z
?RealizePalette@MxVideoManager@@UAEJPAVMxPalette@@@Z
?Register@LegoInputManager@@QAEXPAVMxCore@@@Z
?RemoveAll@ViewManager@@QAEXPAVViewROI@@@Z
?RemoveWorld@LegoOmni@@QAEXABVMxAtomId@@J@Z
?Save@LegoGameState@@QAEJK@Z
?SerializePlayersInfo@LegoGameState@@QAEXF@Z
?SerializeScoreHistory@LegoGameState@@QAEXF@Z
?SetCD@MxOmni@@SAXPBD@Z
?SetDefaults@LegoNavController@@SAXHMMMMMMMMME@Z
?SetDeviceName@MxVideoParam@@QAEXPAD@Z
?SetDisplayBB@LegoROI@@QAEXH@Z
?SetDoMutex@MxCriticalSection@@SAXXZ
?SetHD@MxOmni@@SAXPBD@Z
?SetObjectName@MxDSObject@@QAEXPBD@Z
?SetOmniUserMessage@@YAXP6AXPBDH@Z@Z
?SetPartsThreshold@RealtimeView@@SAXM@Z
?SetSavePath@LegoGameState@@QAEXPAD@Z
?SetSound3D@MxOmni@@SAXE@Z
?SetUserMaxLOD@RealtimeView@@SAXM@Z
?SetVariable@MxVariableTable@@QAEXPAVMxVariable@@@Z
?SetVariable@MxVariableTable@@QAEXPBD0@Z
?SetWaitIndicator@MxTransitionManager@@QAEXPAVMxVideoPresenter@@@Z
?SoundManager@@YAPAVLegoSoundManager@@XZ
?Start@@YAJPAVMxDSAction@@@Z
?StartAction@MxPresenter@@UAEJPAVMxStreamController@@PAVMxDSAction@@@Z
?StartMultiTasking@MxScheduler@@QAEXK@Z
?Streamer@@YAPAVMxStreamer@@XZ
?Tickle@MxPresenter@@UAEJXZ
?TickleManager@@YAPAVMxTickleManager@@XZ
?Timer@@YAPAVMxTimer@@XZ
?TransitionManager@@YAPAVMxTransitionManager@@XZ
?UnRegister@LegoInputManager@@QAEXPAVMxCore@@@Z
?VariableTable@@YAPAVMxVariableTable@@XZ
?VideoManager@@YAPAVLegoVideoManager@@XZ
?configureLegoAnimationManager@LegoAnimationManager@@SAXH@Z
?configureLegoBuildingManager@LegoBuildingManager@@SAXH@Z
?configureLegoModelPresenter@LegoModelPresenter@@SAXH@Z
?configureLegoPartPresenter@LegoPartPresenter@@SAXHH@Z
?configureLegoROI@LegoROI@@SAXH@Z
?configureLegoWorldPresenter@LegoWorldPresenter@@SAXH@Z
_DllMain@12

View File

@ -1,162 +0,0 @@
; LegoOmni.def : Declares the module paarameters for the LEGO1.DLL.
; DESCRIPTION " Lego OMNI Windows Dynamic Link Library"
EXPORTS
; EXPORTs really required only.
_ZN13LegoGameState11SetSavePathEPc
_ZN13LegoGameState20SerializePlayersInfoEs
_ZN13LegoGameState21SerializeScoreHistoryEs
_ZN13LegoGameState4SaveEj
_ZN13LegoGameStateC1Ev
_ZN13LegoGameStateC2Ev
_ZN13LegoGameStateD1Ev
_ZN13LegoGameStateD2Ev
_ZN9LegoWorldC1Ev
_ZN9LegoWorldC2Ev
_ZN9LegoWorldD0Ev
_ZN9LegoWorldD1Ev
_ZN9LegoWorldD2Ev
DllMain@12
_Z10PickEntityii
_Z12EventManagerv
_Z12InputManagerv
_Z12SoundManagerv
_Z12VideoManagerv
_Z13MSoundManagerv
_Z13TickleManagerv
_Z13VariableTablev
_Z14MakeSourceNamePcPKc
_Z17TransitionManagerv
_Z18CreateStreamObjectP8MxDSFiles
_Z18GetNoCD_SourceNamev
_Z18SetOmniUserMessagePFvPKciE
_Z19NotificationManagerv
_Z22BackgroundAudioManagerv
_Z4Legov
_Z5StartP10MxDSAction
_Z5Timerv
_Z7PickROIii
_Z8Streamerv
_Z9GameStatev
_ZN10MxDSActionC1Ev
_ZN10MxDSActionC2Ev
_ZN10MxDSActionD0Ev
_ZN10MxDSActionD1Ev
_ZN10MxDSActionD2Ev
_ZN10MxDSObject13SetObjectNameEPKc
_ZN10MxStreamer4OpenEPKct
_ZN10MxStreamer5CloseEPKc
_ZN11MxPresenter10DoneTickleEv
_ZN11MxPresenter10ParseExtraEv
_ZN11MxPresenter11StartActionEP18MxStreamControllerP10MxDSAction
_ZN11MxPresenter4InitEv
_ZN11MxPresenter6EnableEh
_ZN11MxPresenter6TickleEv
_ZN11MxPresenter9EndActionEv
_ZN11MxScheduler11GetInstanceEv
_ZN11MxScheduler17StartMultiTaskingEj
_ZN11ViewManager9RemoveAllEP7ViewROI
_ZN12MxDirectDraw16FlipToGDISurfaceEv
_ZN12MxDirectDraw18GetPrimaryBitDepthEv
_ZN12MxDirectDraw5PauseEi
_ZN12MxVideoParam13SetDeviceNameEPc
_ZN12MxVideoParamC1ERS_
_ZN12MxVideoParamC1Ev
_ZN12MxVideoParamC2ERS_
_ZN12MxVideoParamC2Ev
_ZN12MxVideoParamD1Ev
_ZN12MxVideoParamD2Ev
_ZN12MxVideoParamaSERKS_
_ZN12RealtimeView13GetUserMaxLODEv
_ZN12RealtimeView13SetUserMaxLODEf
_ZN12RealtimeView17GetPartsThresholdEv
_ZN12RealtimeView17SetPartsThresholdEf
_ZN14MxVideoManager14InvalidateRectER8MxRect32
_ZN14MxVideoManager14RealizePaletteEP9MxPalette
_ZN15MxVariableTable11GetVariableEPKc
_ZN15MxVariableTable11SetVariableEP10MxVariable
_ZN15MxVariableTable11SetVariableEPKcS1_ = _ZN15MxVariableTable11SetVariableEPKcS1_
;_ZN16LegoInputManager10QueueEventE14NotificationIdhiih
_ZN16LegoInputManager10QueueEventE14NotificationIdhiih
_ZN16LegoInputManager10UnRegisterEP6MxCore
_ZN16LegoInputManager8RegisterEP6MxCore
_ZN16LegoVideoManager10MoveCursorEii
_ZN16LegoVideoManager14EnableRMDeviceEv
_ZN16LegoVideoManager15DisableRMDeviceEv
_ZN16LegoVideoManager21EnableFullScreenMovieEhh
_ZN17LegoNavController11GetDefaultsEPiPfS1_S1_S1_S1_S1_S1_S1_S1_Ph
_ZN17LegoNavController11SetDefaultsEifffffffffh
_ZN17LegoPartPresenter26configureLegoPartPresenterEii
_ZN17MxCriticalSection10SetDoMutexEv
_ZN17MxCriticalSectionC1Ev
_ZN17MxCriticalSectionC2Ev
_ZN17MxCriticalSectionD1Ev
_ZN17MxCriticalSectionD2Ev
_ZN17MxOmniCreateFlagsC1Ev
_ZN17MxOmniCreateFlagsC2Ev
_ZN17MxOmniCreateParamC1EPKcP6HWND__R12MxVideoParam17MxOmniCreateFlags
_ZN17MxVideoParamFlagsC1Ev
_ZN17MxVideoParamFlagsC2Ev
_ZN18LegoModelPresenter27configureLegoModelPresenterEi
_ZN18LegoWorldPresenter27configureLegoWorldPresenterEi
_ZN19LegoBuildingManager28configureLegoBuildingManagerEi
_ZN19MxTransitionManager16SetWaitIndicatorEP16MxVideoPresenter
_ZN20LegoAnimationManager29configureLegoAnimationManagerEi
_ZN24MxBackgroundAudioManager6EnableEh
_ZN6MxCore6NotifyER7MxParam
_ZN6MxCoreC1Ev
_ZN6MxCoreC2Ev
_ZN6MxCoreD0Ev
_ZN6MxCoreD1Ev
_ZN6MxCoreD2Ev
_ZN6MxOmni10SetSound3DEh
_ZN6MxOmni11GetInstanceEv
_ZN6MxOmni15DestroyInstanceEv
_ZN6MxOmni5GetCDEv
_ZN6MxOmni5GetHDEv
_ZN6MxOmni5SetCDEPKc
_ZN6MxOmni5SetHDEPKc
_ZN6MxOmni9IsSound3DEv
_ZN7LegoROI12SetDisplayBBEi
_ZN7LegoROI16configureLegoROIEi
_ZN7MxTimer11GetRealTimeEv
_ZN8LegoOmni11GetInstanceEv
_ZN8LegoOmni11RemoveWorldERK8MxAtomIdi
_ZN8LegoOmni14CreateInstanceEv
_ZN8LegoOmni15GetCurrPathInfoEPP16LegoPathBoundaryRi
_ZN8LegoOmni21CreateBackgroundAudioEv
_ZN8MXIOINFOD1Ev
_ZN8MXIOINFOD2Ev
_ZN8MxAtomIdC1EPKc10LookupMode
_ZN8MxAtomIdC2EPKc10LookupMode
_ZN8MxAtomIdD1Ev
_ZN8MxAtomIdD2Ev
_ZN8MxAtomIdaSERKS_
_ZN8MxBitmap13CreatePaletteEv
_ZN8MxBitmap4ReadEPKc
_ZN8MxBitmapC1Ev
_ZN8MxBitmapC2Ev
_ZN8MxBitmapD0Ev
_ZN8MxBitmapD1Ev
_ZN8MxBitmapD2Ev
_ZN8MxDSFile13GetBufferSizeEv
_ZN8MxDSFile19GetStreamBuffersNumEv
_ZN8MxDSFile4OpenEj
_ZN8MxDSFile4ReadEPhj
_ZN8MxDSFile5CloseEv
_ZN8MxDSFileC1EPKcj
_ZN8MxDSFileC2EPKcj
_ZN8MxDSFileD0Ev
_ZN8MxDSFileD1Ev
_ZN8MxDSFileD2Ev
_ZN8MxStringC1ERKS_
_ZN8MxStringC2ERKS_
_ZN8MxStringD0Ev
_ZN8MxStringD1Ev
_ZN8MxStringD2Ev
_ZN8MxStringaSEPKc
_ZN9MxPalette6DetachEv
_ZN9MxPaletteeqERS_

View File

@ -1,64 +0,0 @@
; LegoOmni64.def : Declares the module paarameters for the LEGO1.DLL.
; DESCRIPTION "Lego OMNI Windows Dynamic Link Library"
EXPORTS
; EXPORTs really required only.
?SetCD@MxOmni@@SAXPEBD@Z
?VariableTable@@YAPEAVMxVariableTable@@XZ
?SetVariable@MxVariableTable@@QEAAXPEBD0@Z
?CreateInstance@LegoOmni@@SAXXZ
?TickleManager@@YAPEAVMxTickleManager@@XZ
??1MxVideoParam@@QEAA@XZ
?configureLegoModelPresenter@LegoModelPresenter@@SAXH@Z
?SetHD@MxOmni@@SAXPEBD@Z
?QueueEvent@LegoInputManager@@QEAAXW4NotificationId@@EJJE@Z
?TransitionManager@@YAPEAVMxTransitionManager@@XZ
??1MxString@@UEAA@XZ
??0MxOmniCreateParam@@QEAA@PEBDPEAUHWND__@@AEAVMxVideoParam@@VMxOmniCreateFlags@@@Z
?configureLegoAnimationManager@LegoAnimationManager@@SAXH@Z
?GetCD@MxOmni@@SAPEBDXZ
?configureLegoWorldPresenter@LegoWorldPresenter@@SAXH@Z
?GameState@@YAPEAVLegoGameState@@XZ
?Streamer@@YAPEAVMxStreamer@@XZ
??1MxOmniCreateParam@@UEAA@XZ
?configureLegoROI@LegoROI@@SAXH@Z
?Lego@@YAPEAVLegoOmni@@XZ
??0MxVideoParamFlags@@QEAA@XZ
??0MxDSAction@@QEAA@XZ
?VideoManager@@YAPEAVLegoVideoManager@@XZ
?Timer@@YAPEAVMxTimer@@XZ
?RemoveAll@ViewManager@@QEAAXPEAVViewROI@@@Z
??4MxAtomId@@QEAAAEAV0@AEBV0@@Z
?Enable@MxBackgroundAudioManager@@QEAAXE@Z
?SetDeviceName@MxVideoParam@@QEAAXPEAD@Z
??0MxVideoParam@@QEAA@XZ
?SetSavePath@LegoGameState@@QEAAXPEAD@Z
?MoveCursor@LegoVideoManager@@QEAAXHH@Z
?SetWaitIndicator@MxTransitionManager@@QEAAXPEAVMxVideoPresenter@@@Z
?Save@LegoGameState@@QEAAJK@Z
??1MxDSAction@@UEAA@XZ
?RemoveWorld@LegoOmni@@QEAAXAEBVMxAtomId@@J@Z
?GetPrimaryBitDepth@MxDirectDraw@@SAHXZ
?CreateBackgroundAudio@LegoOmni@@QEAAXXZ
?SerializePlayersInfo@LegoGameState@@QEAAXF@Z
?GetInstance@LegoOmni@@SAPEAV1@XZ
?BackgroundAudioManager@@YAPEAVMxBackgroundAudioManager@@XZ
?configureLegoPartPresenter@LegoPartPresenter@@SAXHH@Z
?EnableRMDevice@LegoVideoManager@@QEAAHXZ
?GetRealTime@MxTimer@@QEAAJXZ
?SetAtomId@MxDSObject@@UEAAXVMxAtomId@@@Z
?DestroyInstance@MxOmni@@SAXXZ
?InputManager@@YAPEAVLegoInputManager@@XZ
?Open@MxStreamer@@QEAAPEAVMxStreamController@@PEBDG@Z
?Start@@YAJPEAVMxDSAction@@@Z
??4MxVideoParam@@QEAAAEAV0@AEBV0@@Z
?EnableFullScreenMovie@LegoVideoManager@@QEAAXEE@Z
?configureLegoBuildingManager@LegoBuildingManager@@SAXH@Z
?SerializeScoreHistory@LegoGameState@@QEAAXF@Z
?Close@MxStreamer@@QEAAJPEBD@Z
??0MxOmniCreateFlags@@QEAA@XZ
??1MxAtomId@@QEAA@XZ
?SetSound3D@MxOmni@@SAXE@Z

View File

@ -2,6 +2,7 @@
#define LEGOANIMATIONMANAGER_H #define LEGOANIMATIONMANAGER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "legolocations.h" #include "legolocations.h"
#include "legomain.h" #include "legomain.h"
#include "legostate.h" #include "legostate.h"
@ -196,7 +197,7 @@ class LegoAnimationManager : public MxCore {
MxResult FUN_10064880(const char* p_name, MxS32 p_unk0x0c, MxS32 p_unk0x10); MxResult FUN_10064880(const char* p_name, MxS32 p_unk0x0c, MxS32 p_unk0x10);
MxBool FUN_10064ee0(MxU32 p_objectId); MxBool FUN_10064ee0(MxU32 p_objectId);
static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); LEGO1_EXPORT static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig);
// SYNTHETIC: LEGO1 0x1005ed10 // SYNTHETIC: LEGO1 0x1005ed10
// LegoAnimationManager::`scalar deleting destructor' // LegoAnimationManager::`scalar deleting destructor'

View File

@ -2,6 +2,7 @@
#define LEGOBUILDINGMANAGER_H #define LEGOBUILDINGMANAGER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "misc/legotypes.h" #include "misc/legotypes.h"
#include "mxcore.h" #include "mxcore.h"
@ -63,7 +64,7 @@ class LegoBuildingManager : public MxCore {
return "LegoBuildingManager"; return "LegoBuildingManager";
} }
static void configureLegoBuildingManager(MxS32); LEGO1_EXPORT static void configureLegoBuildingManager(MxS32);
static void SetCustomizeAnimFile(const char* p_value); static void SetCustomizeAnimFile(const char* p_value);
void Init(); void Init();

View File

@ -6,6 +6,8 @@
#include "mxstl/stlcompat.h" #include "mxstl/stlcompat.h"
#include "mxtypes.h" #include "mxtypes.h"
#include <SDL3/SDL_stdinc.h>
#pragma warning(disable : 4237) #pragma warning(disable : 4237)
// SIZE 0x08 // SIZE 0x08
@ -38,7 +40,7 @@ struct LegoCacheSoundEntry {
struct Set100d6b4cComparator { struct Set100d6b4cComparator {
bool operator()(const LegoCacheSoundEntry& p_a, const LegoCacheSoundEntry& p_b) const bool operator()(const LegoCacheSoundEntry& p_a, const LegoCacheSoundEntry& p_b) const
{ {
return strcmpi(p_a.m_name, p_b.m_name) > 0; return SDL_strcasecmp(p_a.m_name, p_b.m_name) > 0;
} }
}; };

View File

@ -5,6 +5,8 @@
#include "legostate.h" #include "legostate.h"
#include "legoworld.h" #include "legoworld.h"
#include <SDL3/SDL_stdinc.h>
class LegoCarBuildAnimPresenter; class LegoCarBuildAnimPresenter;
class LegoControlManagerNotificationParam; class LegoControlManagerNotificationParam;
class LegoEventNotificationParam; class LegoEventNotificationParam;
@ -176,7 +178,7 @@ class LegoCarBuild : public LegoWorld {
MxU8 m_unk0x109; // 0x109 MxU8 m_unk0x109; // 0x109
MxU16 m_unk0x10a; // 0x10a MxU16 m_unk0x10a; // 0x10a
DWORD m_unk0x10c; // 0x10c Uint64 m_unk0x10c; // 0x10c
LegoROI* m_unk0x110; // 0x110 LegoROI* m_unk0x110; // 0x110
BoundingSphere m_unk0x114; // 0x114 BoundingSphere m_unk0x114; // 0x114
MxMatrix m_unk0x12c; // 0x12c MxMatrix m_unk0x12c; // 0x12c

View File

@ -6,6 +6,8 @@
#include "mxtypes.h" #include "mxtypes.h"
#include "roi/legoroi.h" #include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
class CustomizeAnimFileVariable; class CustomizeAnimFileVariable;
class LegoActor; class LegoActor;
class LegoExtraActor; class LegoExtraActor;
@ -15,7 +17,7 @@ class LegoROI;
#pragma warning(disable : 4237) #pragma warning(disable : 4237)
struct LegoCharacterComparator { struct LegoCharacterComparator {
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmpi(p_a, p_b) < 0; } MxBool operator()(const char* const& p_a, const char* const& p_b) const { return SDL_strcasecmp(p_a, p_b) < 0; }
}; };
// SIZE 0x08 // SIZE 0x08

View File

@ -3,6 +3,7 @@
#include "actionsfwd.h" #include "actionsfwd.h"
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "mxtypes.h" #include "mxtypes.h"
#include <string.h> #include <string.h>
@ -144,24 +145,24 @@ class LegoGameState {
undefined2 m_unk0x372; // 0x372 undefined2 m_unk0x372; // 0x372
}; };
LegoGameState(); LEGO1_EXPORT LegoGameState();
~LegoGameState(); ~LegoGameState();
void SetActor(MxU8 p_actorId); void SetActor(MxU8 p_actorId);
void RemoveActor(); void RemoveActor();
void ResetROI(); void ResetROI();
MxResult Save(MxULong); LEGO1_EXPORT MxResult Save(MxULong);
MxResult DeleteState(); MxResult DeleteState();
MxResult Load(MxULong); MxResult Load(MxULong);
void SerializePlayersInfo(MxS16 p_flags); LEGO1_EXPORT void SerializePlayersInfo(MxS16 p_flags);
MxResult AddPlayer(Username& p_player); MxResult AddPlayer(Username& p_player);
void SwitchPlayer(MxS16 p_playerId); void SwitchPlayer(MxS16 p_playerId);
MxS16 FindPlayer(Username& p_player); MxS16 FindPlayer(Username& p_player);
void SerializeScoreHistory(MxS16 p_flags); LEGO1_EXPORT void SerializeScoreHistory(MxS16 p_flags);
void SetSavePath(char*); LEGO1_EXPORT void SetSavePath(char*);
LegoState* GetState(const char* p_stateName); LegoState* GetState(const char* p_stateName);
LegoState* CreateState(const char* p_stateName); LegoState* CreateState(const char* p_stateName);

View File

@ -2,6 +2,7 @@
#define LEGOINPUTMANAGER_H #define LEGOINPUTMANAGER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "legoeventnotificationparam.h" #include "legoeventnotificationparam.h"
#include "mxlist.h" #include "mxlist.h"
#include "mxpresenter.h" #include "mxpresenter.h"
@ -85,7 +86,7 @@ class LegoInputManager : public MxPresenter {
LegoInputManager(); LegoInputManager();
~LegoInputManager() override; ~LegoInputManager() override;
void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key); LEGO1_EXPORT void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key);
void Register(MxCore*); void Register(MxCore*);
void UnRegister(MxCore*); void UnRegister(MxCore*);

View File

@ -2,6 +2,7 @@
#define LEGOMAIN_H #define LEGOMAIN_H
#include "compat.h" #include "compat.h"
#include "lego1_export.h"
#include "mxdsaction.h" #include "mxdsaction.h"
#include "mxomni.h" #include "mxomni.h"
@ -133,8 +134,8 @@ class LegoOmni : public MxOmni {
void AddWorld(LegoWorld* p_world); void AddWorld(LegoWorld* p_world);
void DeleteWorld(LegoWorld* p_world); void DeleteWorld(LegoWorld* p_world);
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags); void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
void CreateBackgroundAudio(); LEGO1_EXPORT void CreateBackgroundAudio();
void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId); LEGO1_EXPORT void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId);
MxResult RegisterWorlds(); MxResult RegisterWorlds();
const char* GetWorldName(LegoOmni::World p_id); const char* GetWorldName(LegoOmni::World p_id);
MxAtomId* GetWorldAtom(LegoOmni::World p_id); MxAtomId* GetWorldAtom(LegoOmni::World p_id);
@ -142,8 +143,8 @@ class LegoOmni : public MxOmni {
void DeleteAction(); void DeleteAction();
static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&); static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&);
static void CreateInstance(); LEGO1_EXPORT static void CreateInstance();
static LegoOmni* GetInstance(); LEGO1_EXPORT static LegoOmni* GetInstance();
LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; } LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; }
LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; } LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; }

View File

@ -1,6 +1,7 @@
#ifndef LEGOMODELPRESENTER_H #ifndef LEGOMODELPRESENTER_H
#define LEGOMODELPRESENTER_H #define LEGOMODELPRESENTER_H
#include "lego1_export.h"
#include "mxvideopresenter.h" #include "mxvideopresenter.h"
class LegoROI; class LegoROI;
@ -18,7 +19,7 @@ class LegoModelPresenter : public MxVideoPresenter {
// FUNCTION: LEGO1 0x10067a10 // FUNCTION: LEGO1 0x10067a10
~LegoModelPresenter() override { Destroy(TRUE); } ~LegoModelPresenter() override { Destroy(TRUE); }
static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig); LEGO1_EXPORT static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig);
// FUNCTION: BETA10 0x100a7180 // FUNCTION: BETA10 0x100a7180
static const char* HandlerClassName() static const char* HandlerClassName()

View File

@ -1,6 +1,7 @@
#ifndef LEGOPARTPRESENTER_H #ifndef LEGOPARTPRESENTER_H
#define LEGOPARTPRESENTER_H #define LEGOPARTPRESENTER_H
#include "lego1_export.h"
#include "legonamedpartlist.h" #include "legonamedpartlist.h"
#include "mxmediapresenter.h" #include "mxmediapresenter.h"
@ -37,7 +38,7 @@ class LegoPartPresenter : public MxMediaPresenter {
MxResult AddToManager() override; // vtable+0x34 MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38 void Destroy() override; // vtable+0x38
static void configureLegoPartPresenter(MxS32, MxS32); LEGO1_EXPORT static void configureLegoPartPresenter(MxS32, MxS32);
// SYNTHETIC: LEGO1 0x1000d060 // SYNTHETIC: LEGO1 0x1000d060
// LegoPartPresenter::`scalar deleting destructor' // LegoPartPresenter::`scalar deleting destructor'

View File

@ -2,6 +2,7 @@
#define LEGOVIDEOMANAGER_H #define LEGOVIDEOMANAGER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "legophonemelist.h" #include "legophonemelist.h"
#include "mxvideomanager.h" #include "mxvideomanager.h"
@ -26,11 +27,11 @@ class LegoVideoManager : public MxVideoManager {
LegoVideoManager(); LegoVideoManager();
~LegoVideoManager() override; ~LegoVideoManager() override;
int EnableRMDevice(); LEGO1_EXPORT int EnableRMDevice();
int DisableRMDevice(); int DisableRMDevice();
void EnableFullScreenMovie(MxBool p_enable); void EnableFullScreenMovie(MxBool p_enable);
void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale); LEGO1_EXPORT void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale);
void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY); LEGO1_EXPORT void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY);
void ToggleFPS(MxBool p_visible); void ToggleFPS(MxBool p_visible);
MxResult Tickle() override; // vtable+0x08 MxResult Tickle() override; // vtable+0x08

View File

@ -1,6 +1,7 @@
#ifndef LEGOWORLDPRESENTER_H #ifndef LEGOWORLDPRESENTER_H
#define LEGOWORLDPRESENTER_H #define LEGOWORLDPRESENTER_H
#include "lego1_export.h"
#include "legoentitypresenter.h" #include "legoentitypresenter.h"
#include <SDL3/SDL_iostream.h> #include <SDL3/SDL_iostream.h>
@ -16,7 +17,7 @@ class LegoWorldPresenter : public LegoEntityPresenter {
LegoWorldPresenter(); LegoWorldPresenter();
~LegoWorldPresenter() override; // vtable+0x00 ~LegoWorldPresenter() override; // vtable+0x00
static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality); LEGO1_EXPORT static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality);
// FUNCTION: BETA10 0x100e41c0 // FUNCTION: BETA10 0x100e41c0
static const char* HandlerClassName() static const char* HandlerClassName()

View File

@ -5,6 +5,7 @@
#include "decomp.h" #include "decomp.h"
// Long include path due to dependency of misc library on LegoOmni // Long include path due to dependency of misc library on LegoOmni
#include "lego/legoomni/include/actions/actionsfwd.h" #include "lego/legoomni/include/actions/actionsfwd.h"
#include "lego1_export.h"
#include "mxtypes.h" #include "mxtypes.h"
class LegoAnimationManager; class LegoAnimationManager;
@ -31,13 +32,13 @@ class ViewManager;
extern MxBool g_isWorldActive; extern MxBool g_isWorldActive;
LegoOmni* Lego(); LEGO1_EXPORT LegoOmni* Lego();
LegoSoundManager* SoundManager(); LegoSoundManager* SoundManager();
LegoVideoManager* VideoManager(); LEGO1_EXPORT LegoVideoManager* VideoManager();
MxBackgroundAudioManager* BackgroundAudioManager(); LEGO1_EXPORT MxBackgroundAudioManager* BackgroundAudioManager();
LegoInputManager* InputManager(); LEGO1_EXPORT LegoInputManager* InputManager();
LegoControlManager* ControlManager(); LegoControlManager* ControlManager();
LegoGameState* GameState(); LEGO1_EXPORT LegoGameState* GameState();
LegoAnimationManager* AnimationManager(); LegoAnimationManager* AnimationManager();
LegoNavController* NavController(); LegoNavController* NavController();
LegoPathActor* UserActor(); LegoPathActor* UserActor();
@ -57,7 +58,7 @@ void DeleteAction();
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid); LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
MxDSAction& GetCurrentAction(); MxDSAction& GetCurrentAction();
void SetCurrentWorld(LegoWorld* p_world); void SetCurrentWorld(LegoWorld* p_world);
MxTransitionManager* TransitionManager(); LEGO1_EXPORT MxTransitionManager* TransitionManager();
void PlayMusic(JukeboxScript::Script p_objectId); void PlayMusic(JukeboxScript::Script p_objectId);
void SetIsWorldActive(MxBool p_isWorldActive); void SetIsWorldActive(MxBool p_isWorldActive);
void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last); void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last);

View File

@ -1,6 +1,7 @@
#ifndef MXBACKGROUNDAUDIOMANAGER_H #ifndef MXBACKGROUNDAUDIOMANAGER_H
#define MXBACKGROUNDAUDIOMANAGER_H #define MXBACKGROUNDAUDIOMANAGER_H
#include "lego1_export.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxdsaction.h" #include "mxdsaction.h"
#include "mxpresenter.h" #include "mxpresenter.h"
@ -43,7 +44,7 @@ class MxBackgroundAudioManager : public MxCore {
void FUN_1007ef40(); void FUN_1007ef40();
void FadeInOrFadeOut(); void FadeInOrFadeOut();
void Enable(MxBool p_enable); LEGO1_EXPORT void Enable(MxBool p_enable);
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS); virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
void Init(); void Init();

View File

@ -2,8 +2,10 @@
#define MXTRANSITIONMANAGER_H #define MXTRANSITIONMANAGER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "mxcore.h" #include "mxcore.h"
#include <SDL3/SDL_stdinc.h>
#include <ddraw.h> #include <ddraw.h>
class MxVideoPresenter; class MxVideoPresenter;
@ -16,7 +18,7 @@ class MxTransitionManager : public MxCore {
MxTransitionManager(); MxTransitionManager();
~MxTransitionManager() override; // vtable+0x00 ~MxTransitionManager() override; // vtable+0x00
void SetWaitIndicator(MxVideoPresenter* p_waitIndicator); LEGO1_EXPORT void SetWaitIndicator(MxVideoPresenter* p_waitIndicator);
MxResult Tickle() override; // vtable+0x08 MxResult Tickle() override; // vtable+0x08
@ -78,7 +80,7 @@ class MxTransitionManager : public MxCore {
MxU16 m_animationTimer; // 0x34 MxU16 m_animationTimer; // 0x34
MxU16 m_columnOrder[640]; // 0x36 MxU16 m_columnOrder[640]; // 0x36
MxU16 m_randomShift[480]; // 0x536 MxU16 m_randomShift[480]; // 0x536
MxULong m_systemTime; // 0x8f8 Uint64 m_systemTime; // 0x8f8
MxS32 m_animationSpeed; // 0x8fc MxS32 m_animationSpeed; // 0x8fc
}; };

View File

@ -23,6 +23,7 @@
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include "scripts.h" #include "scripts.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
DECOMP_SIZE_ASSERT(Ambulance, 0x184) DECOMP_SIZE_ASSERT(Ambulance, 0x184)
@ -251,14 +252,14 @@ MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
if (m_unk0x170 == 1) { if (m_unk0x170 == 1) {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY()); LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !strcmpi(roi->GetName(), "ps-gate")) { if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "ps-gate")) {
m_unk0x170 = 3; m_unk0x170 = 3;
return 1; return 1;
} }
roi = PickRootROI(p_param.GetX(), p_param.GetY()); roi = PickRootROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !strcmpi(roi->GetName(), "gd")) { if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "gd")) {
m_unk0x170 = 3; m_unk0x170 = 3;
return 1; return 1;
} }

View File

@ -6,6 +6,7 @@
#include "roi/legoroi.h" #include "roi/legoroi.h"
#include "tgl/tglvector.h" #include "tgl/tglvector.h"
#include <SDL3/SDL_stdinc.h>
#include <assert.h> #include <assert.h>
DECOMP_SIZE_ASSERT(Doors, 0x1f8) DECOMP_SIZE_ASSERT(Doors, 0x1f8)
@ -129,10 +130,10 @@ void Doors::ParseAction(char* p_extra)
for (CompoundObject::const_iterator it = comp->begin(); it != comp->end(); it++) { for (CompoundObject::const_iterator it = comp->begin(); it != comp->end(); it++) {
LegoROI* roi = (LegoROI*) *it; LegoROI* roi = (LegoROI*) *it;
if (roi && (!strnicmp(roi->GetName(), "dor-lt", 6) || !strnicmp(roi->GetName(), "dor-sl", 6))) { if (roi && (!SDL_strncasecmp(roi->GetName(), "dor-lt", 6) || !SDL_strncasecmp(roi->GetName(), "dor-sl", 6))) {
m_ltDoor = roi; m_ltDoor = roi;
} }
else if (roi && (!strnicmp(roi->GetName(), "dor-rt", 6) || !strnicmp(roi->GetName(), "dor-sr", 6))) { else if (roi && (!SDL_strncasecmp(roi->GetName(), "dor-rt", 6) || !SDL_strncasecmp(roi->GetName(), "dor-sr", 6))) {
m_rtDoor = roi; m_rtDoor = roi;
} }
} }

View File

@ -18,6 +18,7 @@
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c) DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c)
@ -164,20 +165,20 @@ MxS32 DuneBuggy::GetColorOffset(const char* p_variable)
MxS32 offset = 1; MxS32 offset = 1;
const char* colorName = VariableTable()->GetVariable(p_variable); const char* colorName = VariableTable()->GetVariable(p_variable);
if (strcmpi(colorName, "lego green")) { if (SDL_strcasecmp(colorName, "lego green")) {
if (!strcmpi(colorName, "lego red")) { if (!SDL_strcasecmp(colorName, "lego red")) {
offset = 2; offset = 2;
} }
else if (!strcmpi(colorName, "lego yellow")) { else if (!SDL_strcasecmp(colorName, "lego yellow")) {
offset = 3; offset = 3;
} }
else if (!strcmpi(colorName, "lego black")) { else if (!SDL_strcasecmp(colorName, "lego black")) {
offset = 4; offset = 4;
} }
else if (!strcmpi(colorName, "lego blue")) { else if (!SDL_strcasecmp(colorName, "lego blue")) {
offset = 5; offset = 5;
} }
else if (!strcmpi(colorName, "lego white")) { else if (!SDL_strcasecmp(colorName, "lego white")) {
offset = 6; offset = 6;
} }
} }

View File

@ -30,6 +30,8 @@
#include "racecar_actions.h" #include "racecar_actions.h"
#include "scripts.h" #include "scripts.h"
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_timer.h>
#include <isle.h> #include <isle.h>
#include <stdio.h> #include <stdio.h>
#include <vec.h> #include <vec.h>
@ -559,8 +561,8 @@ MxResult LegoCarBuild::Tickle()
} }
if (m_unk0x10a) { if (m_unk0x10a) {
DWORD time = timeGetTime(); Uint64 time = SDL_GetTicks();
DWORD dTime = (time - m_unk0x10c) / 100; Uint64 dTime = (time - m_unk0x10c) / 100;
if (m_carId == RaceCar_Actor) { if (m_carId == RaceCar_Actor) {
switch (m_unk0x10a) { switch (m_unk0x10a) {
@ -1316,30 +1318,30 @@ void LegoCarBuild::TogglePresentersEnabled()
void LegoCarBuild::FUN_100250e0(MxBool p_enabled) void LegoCarBuild::FUN_100250e0(MxBool p_enabled)
{ {
if (m_unk0x258->StringDoesNotEndOnZero(m_unk0x110->GetName()) && m_Decals_Ctl) { if (m_unk0x258->StringDoesNotEndOnZero(m_unk0x110->GetName()) && m_Decals_Ctl) {
if (strnicmp(m_unk0x110->GetName(), "JSFRNT", strlen("JSFRNT")) == 0) { if (SDL_strncasecmp(m_unk0x110->GetName(), "JSFRNT", strlen("JSFRNT")) == 0) {
m_Decal_Bitmap->Enable(p_enabled); m_Decal_Bitmap->Enable(p_enabled);
m_Decals_Ctl->Enable(p_enabled); m_Decals_Ctl->Enable(p_enabled);
m_Decals_Ctl1->Enable(p_enabled); m_Decals_Ctl1->Enable(p_enabled);
m_Decals_Ctl2->Enable(p_enabled); m_Decals_Ctl2->Enable(p_enabled);
m_Decals_Ctl3->Enable(p_enabled); m_Decals_Ctl3->Enable(p_enabled);
} }
else if (strnicmp(m_unk0x110->GetName(), "JSWNSH", strlen("JSWNSH")) == 0) { else if (SDL_strncasecmp(m_unk0x110->GetName(), "JSWNSH", strlen("JSWNSH")) == 0) {
m_Decal_Bitmap->Enable(p_enabled); m_Decal_Bitmap->Enable(p_enabled);
m_Decals_Ctl4->Enable(p_enabled); m_Decals_Ctl4->Enable(p_enabled);
m_Decals_Ctl5->Enable(p_enabled); m_Decals_Ctl5->Enable(p_enabled);
m_Decals_Ctl6->Enable(p_enabled); m_Decals_Ctl6->Enable(p_enabled);
m_Decals_Ctl7->Enable(p_enabled); m_Decals_Ctl7->Enable(p_enabled);
} }
else if (strnicmp(m_unk0x110->GetName(), "RCBACK", strlen("RCBACK")) == 0) { else if (SDL_strncasecmp(m_unk0x110->GetName(), "RCBACK", strlen("RCBACK")) == 0) {
m_Decals_Ctl1->Enable(p_enabled); m_Decals_Ctl1->Enable(p_enabled);
} }
else if (strnicmp(m_unk0x110->GetName(), "RCTAIL", strlen("RCTAIL")) == 0) { else if (SDL_strncasecmp(m_unk0x110->GetName(), "RCTAIL", strlen("RCTAIL")) == 0) {
m_Decals_Ctl2->Enable(p_enabled); m_Decals_Ctl2->Enable(p_enabled);
} }
else if (m_Decals_Ctl1 && strnicmp(m_unk0x110->GetName(), "chljety", strlen("chljety")) == 0) { else if (m_Decals_Ctl1 && SDL_strncasecmp(m_unk0x110->GetName(), "chljety", strlen("chljety")) == 0) {
m_Decals_Ctl1->Enable(p_enabled); m_Decals_Ctl1->Enable(p_enabled);
} }
else if (m_Decals_Ctl2 && strnicmp(m_unk0x110->GetName(), "chrjety", strlen("chrjety")) == 0) { else if (m_Decals_Ctl2 && SDL_strncasecmp(m_unk0x110->GetName(), "chrjety", strlen("chrjety")) == 0) {
m_Decals_Ctl2->Enable(p_enabled); m_Decals_Ctl2->Enable(p_enabled);
} }
else if (m_Decals_Ctl) { else if (m_Decals_Ctl) {
@ -1603,7 +1605,7 @@ void LegoCarBuild::FUN_10025720(undefined4 p_param)
#endif #endif
if (m_unk0x10a != 0) { if (m_unk0x10a != 0) {
m_unk0x10c = timeGetTime(); m_unk0x10c = SDL_GetTicks();
} }
} }

View File

@ -16,6 +16,8 @@
#include "mxtimer.h" #include "mxtimer.h"
#include "realtime/realtime.h" #include "realtime/realtime.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c) DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c)
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150) DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150)
@ -225,7 +227,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
for (MxS32 j = 0; j <= m_roiMapSize; j++) { for (MxS32 j = 0; j <= m_roiMapSize; j++) {
LegoROI* roi = m_roiMap[j]; LegoROI* roi = m_roiMap[j];
if (roi && roi->GetName() && (strcmpi(name, roi->GetName()) == 0)) { if (roi && roi->GetName() && (SDL_strcasecmp(name, roi->GetName()) == 0)) {
roi->FUN_100a9dd0(); roi->FUN_100a9dd0();
roi->FUN_100a9350("lego red"); roi->FUN_100a9350("lego red");
} }
@ -247,7 +249,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
for (i = 0; i < totalNodes; i++) { for (i = 0; i < totalNodes; i++) {
LegoAnimNodeData* animNodeData = (LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData(); LegoAnimNodeData* animNodeData = (LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData();
if (strnicmp(animNodeData->GetName(), "CAM", strlen("CAM")) == 0) { if (SDL_strncasecmp(animNodeData->GetName(), "CAM", strlen("CAM")) == 0) {
camera = local60->FindChildROI(animNodeData->GetName(), local60); camera = local60->FindChildROI(animNodeData->GetName(), local60);
fov = atof(&animNodeData->GetName()[strlen(animNodeData->GetName()) - 2]); fov = atof(&animNodeData->GetName()[strlen(animNodeData->GetName()) - 2]);
break; break;
@ -367,7 +369,7 @@ void LegoCarBuildAnimPresenter::FUN_10079160()
for (i = 0; i < totalNodes; i++) { for (i = 0; i < totalNodes; i++) {
name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName(); name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName();
strupr(name); SDL_strupr(name);
if (StringEndsOnW(name)) { if (StringEndsOnW(name)) {
m_parts[name[strlen(name) - 1] - 'A'].m_wiredName = new LegoChar[strlen(name) + 1]; m_parts[name[strlen(name) - 1] - 'A'].m_wiredName = new LegoChar[strlen(name) + 1];
@ -386,7 +388,7 @@ void LegoCarBuildAnimPresenter::FUN_10079160()
name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName(); name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName();
if (StringEndsOnYOrN(name)) { if (StringEndsOnYOrN(name)) {
for (MxS16 ii = 0; ii < m_numberOfParts; ii++) { for (MxS16 ii = 0; ii < m_numberOfParts; ii++) {
if (strnicmp(m_parts[ii].m_wiredName, name, strlen(name) - 2) == 0) { if (SDL_strncasecmp(m_parts[ii].m_wiredName, name, strlen(name) - 2) == 0) {
m_parts[ii].m_name = new LegoChar[strlen(name) + 1]; m_parts[ii].m_name = new LegoChar[strlen(name) + 1];
assert(m_parts[ii].m_name); assert(m_parts[ii].m_name);
strcpy(m_parts[ii].m_name, name); strcpy(m_parts[ii].m_name, name);
@ -515,7 +517,7 @@ void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name)
MxS16 i; MxS16 i;
LegoChar buffer[40]; LegoChar buffer[40];
if (strcmpi(m_parts[m_placedPartCount].m_name, p_name) != 0) { if (SDL_strcasecmp(m_parts[m_placedPartCount].m_name, p_name) != 0) {
for (i = m_placedPartCount + 1; i < m_numberOfParts; i++) { for (i = m_placedPartCount + 1; i < m_numberOfParts; i++) {
if (stricmp(m_parts[i].m_name, p_name) == 0) { if (stricmp(m_parts[i].m_name, p_name) == 0) {
break; break;
@ -615,7 +617,7 @@ MxBool LegoCarBuildAnimPresenter::StringEndsOnYOrN(const LegoChar* p_string)
// FUNCTION: BETA10 0x10072624 // FUNCTION: BETA10 0x10072624
MxBool LegoCarBuildAnimPresenter::StringEqualsShelf(const LegoChar* p_string) MxBool LegoCarBuildAnimPresenter::StringEqualsShelf(const LegoChar* p_string)
{ {
return strnicmp(p_string, "SHELF", strlen("SHELF")) == 0; return SDL_strncasecmp(p_string, "SHELF", strlen("SHELF")) == 0;
} }
// FUNCTION: LEGO1 0x10079c30 // FUNCTION: LEGO1 0x10079c30
@ -627,7 +629,7 @@ MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name)
} }
return m_placedPartCount < m_numberOfParts && return m_placedPartCount < m_numberOfParts &&
strnicmp(p_name, m_parts[m_placedPartCount].m_name, strlen(p_name) - 3) == 0; SDL_strncasecmp(p_name, m_parts[m_placedPartCount].m_name, strlen(p_name) - 3) == 0;
} }
// FUNCTION: LEGO1 0x10079ca0 // FUNCTION: LEGO1 0x10079ca0
@ -635,7 +637,7 @@ MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name)
MxBool LegoCarBuildAnimPresenter::PartIsPlaced(const LegoChar* p_name) MxBool LegoCarBuildAnimPresenter::PartIsPlaced(const LegoChar* p_name)
{ {
for (MxS16 i = 0; i < m_placedPartCount; i++) { for (MxS16 i = 0; i < m_placedPartCount; i++) {
if (strcmpi(p_name, m_parts[i].m_name) == 0) { if (SDL_strcasecmp(p_name, m_parts[i].m_name) == 0) {
return TRUE; return TRUE;
} }
} }
@ -662,7 +664,7 @@ MxBool LegoCarBuildAnimPresenter::StringDoesNotEndOnZero(const LegoChar* p_strin
const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar* p_name) const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar* p_name)
{ {
for (MxS16 i = 0; i < m_numberOfParts; i++) { for (MxS16 i = 0; i < m_numberOfParts; i++) {
if (strcmpi(p_name, m_parts[i].m_name) == 0) { if (SDL_strcasecmp(p_name, m_parts[i].m_name) == 0) {
return m_parts[i].m_wiredName; return m_parts[i].m_wiredName;
} }
} }
@ -675,7 +677,7 @@ const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar
void LegoCarBuildAnimPresenter::SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId) void LegoCarBuildAnimPresenter::SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId)
{ {
for (MxS16 i = 0; i < m_numberOfParts; i++) { for (MxS16 i = 0; i < m_numberOfParts; i++) {
if (strcmpi(p_name, m_parts[i].m_name) == 0) { if (SDL_strcasecmp(p_name, m_parts[i].m_name) == 0) {
m_parts[i].m_objectId = p_objectId; m_parts[i].m_objectId = p_objectId;
return; return;
} }

View File

@ -28,6 +28,7 @@
#include "realtime/realtime.h" #include "realtime/realtime.h"
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
#include <io.h> #include <io.h>
#include <stdio.h> #include <stdio.h>
#include <vec.h> #include <vec.h>
@ -745,7 +746,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId)
MxBool LegoAnimationManager::FindVehicle(const char* p_name, MxU32& p_index) MxBool LegoAnimationManager::FindVehicle(const char* p_name, MxU32& p_index)
{ {
for (MxS32 i = 0; i < sizeOfArray(g_vehicles); i++) { for (MxS32 i = 0; i < sizeOfArray(g_vehicles); i++) {
if (!strcmpi(p_name, g_vehicles[i].m_name)) { if (!SDL_strcasecmp(p_name, g_vehicles[i].m_name)) {
p_index = i; p_index = i;
return TRUE; return TRUE;
} }
@ -1662,7 +1663,7 @@ MxS8 LegoAnimationManager::GetCharacterIndex(const char* p_name)
MxS8 i; MxS8 i;
for (i = 0; i < sizeOfArray(g_characters); i++) { for (i = 0; i < sizeOfArray(g_characters); i++) {
if (!strnicmp(p_name, g_characters[i].m_name, 2)) { if (!SDL_strncasecmp(p_name, g_characters[i].m_name, 2)) {
return i; return i;
} }
} }
@ -1713,7 +1714,7 @@ MxBool LegoAnimationManager::ModelExists(AnimInfo& p_info, const char* p_name)
if (models != NULL && modelCount) { if (models != NULL && modelCount) {
for (MxU8 i = 0; i < modelCount; i++) { for (MxU8 i = 0; i < modelCount; i++) {
if (!strcmpi(models[i].m_name, p_name)) { if (!SDL_strcasecmp(models[i].m_name, p_name)) {
return TRUE; return TRUE;
} }
} }
@ -2076,7 +2077,7 @@ MxBool LegoAnimationManager::FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_p
MxS32 i; MxS32 i;
for (i = 0; i < (MxS32) sizeOfArray(g_characters); i++) { for (i = 0; i < (MxS32) sizeOfArray(g_characters); i++) {
if (!strcmpi(name, g_characters[i].m_name)) { if (!SDL_strcasecmp(name, g_characters[i].m_name)) {
characterId = i; characterId = i;
break; break;
} }
@ -2621,7 +2622,7 @@ MxResult LegoAnimationManager::FUN_10064380(
extraIndex = i; extraIndex = i;
} }
if (roi != NULL && !strcmpi(roi->GetName(), p_name)) { if (roi != NULL && !SDL_strcasecmp(roi->GetName(), p_name)) {
actor = CharacterManager()->GetExtraActor(p_name); actor = CharacterManager()->GetExtraActor(p_name);
if (actor != NULL && actor->GetController() != NULL) { if (actor != NULL && actor->GetController() != NULL) {
@ -2639,7 +2640,7 @@ MxResult LegoAnimationManager::FUN_10064380(
MxS32 characterId; MxS32 characterId;
for (characterId = 0; characterId < (MxS32) sizeOfArray(g_characters); characterId++) { for (characterId = 0; characterId < (MxS32) sizeOfArray(g_characters); characterId++) {
if (!strcmpi(g_characters[characterId].m_name, p_name)) { if (!SDL_strcasecmp(g_characters[characterId].m_name, p_name)) {
break; break;
} }
} }
@ -2759,7 +2760,7 @@ MxResult LegoAnimationManager::FUN_10064880(const char* p_name, MxS32 p_unk0x0c,
LegoROI* roi = m_extras[i].m_roi; LegoROI* roi = m_extras[i].m_roi;
if (roi != NULL) { if (roi != NULL) {
if (!strcmpi(roi->GetName(), p_name)) { if (!SDL_strcasecmp(roi->GetName(), p_name)) {
g_characters[m_extras[i].m_characterId].m_unk0x0c = p_unk0x0c; g_characters[m_extras[i].m_characterId].m_unk0x0c = p_unk0x0c;
g_characters[m_extras[i].m_characterId].m_unk0x10 = p_unk0x10; g_characters[m_extras[i].m_characterId].m_unk0x10 = p_unk0x10;
return SUCCESS; return SUCCESS;

View File

@ -16,6 +16,7 @@
#include "roi/legolod.h" #include "roi/legolod.h"
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
#include <vec.h> #include <vec.h>
@ -474,7 +475,7 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
goto done; goto done;
} }
if (!strcmpi(p_key, "pep")) { if (!SDL_strcasecmp(p_key, "pep")) {
LegoActorInfo* pepper = GetActorInfo("pepper"); LegoActorInfo* pepper = GetActorInfo("pepper");
info->m_sound = pepper->m_sound; info->m_sound = pepper->m_sound;
@ -652,7 +653,7 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex
MxBool LegoCharacterManager::IsActor(const char* p_name) MxBool LegoCharacterManager::IsActor(const char* p_name)
{ {
for (MxU32 i = 0; i < sizeOfArray(g_actorInfo); i++) { for (MxU32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
if (!strcmpi(g_actorInfo[i].m_name, p_name)) { if (!SDL_strcasecmp(g_actorInfo[i].m_name, p_name)) {
return TRUE; return TRUE;
} }
} }
@ -678,7 +679,7 @@ LegoActorInfo* LegoCharacterManager::GetActorInfo(const char* p_name)
MxU32 i; MxU32 i;
for (i = 0; i < sizeOfArray(g_actorInfo); i++) { for (i = 0; i < sizeOfArray(g_actorInfo); i++) {
if (!strcmpi(g_actorInfo[i].m_name, p_name)) { if (!SDL_strcasecmp(g_actorInfo[i].m_name, p_name)) {
break; break;
} }
} }
@ -721,7 +722,7 @@ LegoROI* LegoCharacterManager::FindChildROI(LegoROI* p_roi, const char* p_name)
#endif #endif
LegoROI* roi = (LegoROI*) *it; LegoROI* roi = (LegoROI*) *it;
if (!strcmpi(p_name, roi->GetName())) { if (!SDL_strcasecmp(p_name, roi->GetName())) {
return roi; return roi;
} }
} }

View File

@ -61,6 +61,7 @@
#include "sndanim_actions.h" #include "sndanim_actions.h"
#include "towtrack.h" #include "towtrack.h"
#include <SDL3/SDL_stdinc.h>
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@ -1022,8 +1023,8 @@ void LegoGameState::SetROIHandlerFunction()
MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen) MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen)
{ {
if (p_output != NULL && p_copyLen != 0 && if (p_output != NULL && p_copyLen != 0 &&
(strnicmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 || (SDL_strncasecmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 ||
strnicmp(p_input, "INDIR-G-", strlen("INDIR-F-")) == 0)) { SDL_strncasecmp(p_input, "INDIR-G-", strlen("INDIR-F-")) == 0)) {
char buf[256]; char buf[256];
sprintf(buf, "c_%s", &p_input[strlen("INDIR-F-")]); sprintf(buf, "c_%s", &p_input[strlen("INDIR-F-")]);

View File

@ -31,6 +31,7 @@
#include "scripts.h" #include "scripts.h"
#include <SDL3/SDL_events.h> #include <SDL3/SDL_events.h>
#include <SDL3/SDL_stdinc.h>
#include <process.h> #include <process.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -191,11 +192,11 @@ void FUN_1003e050(LegoAnimPresenter* p_presenter)
LegoAnimNodeData* data = (LegoAnimNodeData*) GetTreeNode(rootNode, i)->GetData(); LegoAnimNodeData* data = (LegoAnimNodeData*) GetTreeNode(rootNode, i)->GetData();
if (!strnicmp(data->GetName(), "CAM", strlen("CAM"))) { if (!SDL_strncasecmp(data->GetName(), "CAM", strlen("CAM"))) {
camData = data; camData = data;
cam = atof(&data->GetName()[strlen(data->GetName()) - 2]); cam = atof(&data->GetName()[strlen(data->GetName()) - 2]);
} }
else if (!strcmpi(data->GetName(), "TARGET")) { else if (!SDL_strcasecmp(data->GetName(), "TARGET")) {
targetData = data; targetData = data;
} }
} }
@ -231,34 +232,34 @@ Extra::ActionType MatchActionString(const char* p_str)
{ {
Extra::ActionType result = Extra::ActionType::e_unknown; Extra::ActionType result = Extra::ActionType::e_unknown;
if (!strcmpi("openram", p_str)) { if (!SDL_strcasecmp("openram", p_str)) {
result = Extra::ActionType::e_openram; result = Extra::ActionType::e_openram;
} }
else if (!strcmpi("opendisk", p_str)) { else if (!SDL_strcasecmp("opendisk", p_str)) {
result = Extra::ActionType::e_opendisk; result = Extra::ActionType::e_opendisk;
} }
else if (!strcmpi("close", p_str)) { else if (!SDL_strcasecmp("close", p_str)) {
result = Extra::ActionType::e_close; result = Extra::ActionType::e_close;
} }
else if (!strcmpi("start", p_str)) { else if (!SDL_strcasecmp("start", p_str)) {
result = Extra::ActionType::e_start; result = Extra::ActionType::e_start;
} }
else if (!strcmpi("stop", p_str)) { else if (!SDL_strcasecmp("stop", p_str)) {
result = Extra::ActionType::e_stop; result = Extra::ActionType::e_stop;
} }
else if (!strcmpi("run", p_str)) { else if (!SDL_strcasecmp("run", p_str)) {
result = Extra::ActionType::e_run; result = Extra::ActionType::e_run;
} }
else if (!strcmpi("exit", p_str)) { else if (!SDL_strcasecmp("exit", p_str)) {
result = Extra::ActionType::e_exit; result = Extra::ActionType::e_exit;
} }
else if (!strcmpi("enable", p_str)) { else if (!SDL_strcasecmp("enable", p_str)) {
result = Extra::ActionType::e_enable; result = Extra::ActionType::e_enable;
} }
else if (!strcmpi("disable", p_str)) { else if (!SDL_strcasecmp("disable", p_str)) {
result = Extra::ActionType::e_disable; result = Extra::ActionType::e_disable;
} }
else if (!strcmpi("notify", p_str)) { else if (!SDL_strcasecmp("notify", p_str)) {
result = Extra::ActionType::e_notify; result = Extra::ActionType::e_notify;
} }

View File

@ -10,6 +10,8 @@
#include "misc.h" #include "misc.h"
#include "roi/legoroi.h" #include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(VisibilityVariable, 0x24) DECOMP_SIZE_ASSERT(VisibilityVariable, 0x24)
DECOMP_SIZE_ASSERT(CameraLocationVariable, 0x24) DECOMP_SIZE_ASSERT(CameraLocationVariable, 0x24)
DECOMP_SIZE_ASSERT(CursorVariable, 0x24) DECOMP_SIZE_ASSERT(CursorVariable, 0x24)
@ -115,10 +117,10 @@ void VisibilityVariable::SetValue(const char* p_value)
char* name = strtok(NULL, g_delimiter2); char* name = strtok(NULL, g_delimiter2);
MxBool show; MxBool show;
if (!strcmpi(instruction, g_varHIDE)) { if (!SDL_strcasecmp(instruction, g_varHIDE)) {
show = FALSE; show = FALSE;
} }
else if (!strcmpi(instruction, g_varSHOW)) { else if (!SDL_strcasecmp(instruction, g_varSHOW)) {
show = TRUE; show = TRUE;
} }
else { else {
@ -160,19 +162,19 @@ void WhoAmIVariable::SetValue(const char* p_value)
{ {
MxVariable::SetValue(p_value); MxVariable::SetValue(p_value);
if (!strcmpi(p_value, g_papa)) { if (!SDL_strcasecmp(p_value, g_papa)) {
GameState()->SetActorId(3); GameState()->SetActorId(3);
} }
else if (!strcmpi(p_value, g_mama)) { else if (!SDL_strcasecmp(p_value, g_mama)) {
GameState()->SetActorId(2); GameState()->SetActorId(2);
} }
else if (!strcmpi(p_value, g_pepper)) { else if (!SDL_strcasecmp(p_value, g_pepper)) {
GameState()->SetActorId(1); GameState()->SetActorId(1);
} }
else if (!strcmpi(p_value, g_nick)) { else if (!SDL_strcasecmp(p_value, g_nick)) {
GameState()->SetActorId(4); GameState()->SetActorId(4);
} }
else if (!strcmpi(p_value, g_laura)) { else if (!SDL_strcasecmp(p_value, g_laura)) {
GameState()->SetActorId(5); GameState()->SetActorId(5);
} }
} }

View File

@ -9,6 +9,8 @@
#include "mxutilities.h" #include "mxutilities.h"
#include "mxvideopresenter.h" #include "mxvideopresenter.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c) DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
// FUNCTION: LEGO1 0x10043f50 // FUNCTION: LEGO1 0x10043f50
@ -253,15 +255,15 @@ void MxControlPresenter::ParseExtra()
if (KeyValueStringParse(output, g_strSTYLE, extraCopy)) { if (KeyValueStringParse(output, g_strSTYLE, extraCopy)) {
char* str = strtok(output, g_parseExtraTokens); char* str = strtok(output, g_parseExtraTokens);
if (!strcmpi(str, g_strTOGGLE)) { if (!SDL_strcasecmp(str, g_strTOGGLE)) {
m_unk0x4c = 1; m_unk0x4c = 1;
} }
else if (!strcmpi(str, g_strGRID)) { else if (!SDL_strcasecmp(str, g_strGRID)) {
m_unk0x4c = 2; m_unk0x4c = 2;
m_unk0x52 = atoi(strtok(NULL, g_parseExtraTokens)); m_unk0x52 = atoi(strtok(NULL, g_parseExtraTokens));
m_unk0x54 = atoi(strtok(NULL, g_parseExtraTokens)); m_unk0x54 = atoi(strtok(NULL, g_parseExtraTokens));
} }
else if (!strcmpi(str, g_strMAP)) { else if (!SDL_strcasecmp(str, g_strMAP)) {
m_unk0x4c = 3; m_unk0x4c = 3;
str = strtok(NULL, g_parseExtraTokens); str = strtok(NULL, g_parseExtraTokens);
@ -281,7 +283,7 @@ void MxControlPresenter::ParseExtra()
} }
if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) { if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) {
if (!strcmpi(output, "FALSE")) { if (!SDL_strcasecmp(output, "FALSE")) {
Enable(FALSE); Enable(FALSE);
} }
} }

View File

@ -12,6 +12,8 @@
#include "mxticklemanager.h" #include "mxticklemanager.h"
#include "mxvideopresenter.h" #include "mxvideopresenter.h"
#include <SDL3/SDL_timer.h>
DECOMP_SIZE_ASSERT(MxTransitionManager, 0x900) DECOMP_SIZE_ASSERT(MxTransitionManager, 0x900)
// GLOBAL: LEGO1 0x100f4378 // GLOBAL: LEGO1 0x100f4378
@ -54,11 +56,11 @@ MxResult MxTransitionManager::GetDDrawSurfaceFromVideoManager() // vtable+0x14
// FUNCTION: LEGO1 0x1004bac0 // FUNCTION: LEGO1 0x1004bac0
MxResult MxTransitionManager::Tickle() MxResult MxTransitionManager::Tickle()
{ {
if (m_animationSpeed + m_systemTime > timeGetTime()) { if (m_animationSpeed + m_systemTime > SDL_GetTicks()) {
return SUCCESS; return SUCCESS;
} }
m_systemTime = timeGetTime(); m_systemTime = SDL_GetTicks();
switch (m_mode) { switch (m_mode) {
case e_noAnimation: case e_noAnimation:
@ -112,7 +114,7 @@ MxResult MxTransitionManager::StartTransition(
action->SetFlags(action->GetFlags() | MxDSAction::c_bit10); action->SetFlags(action->GetFlags() | MxDSAction::c_bit10);
} }
MxU32 time = timeGetTime(); Uint64 time = SDL_GetTicks();
m_systemTime = time; m_systemTime = time;
m_animationSpeed = p_speed; m_animationSpeed = p_speed;

View File

@ -8,6 +8,7 @@
#include "mxutilities.h" #include "mxutilities.h"
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include <SDL3/SDL_stdinc.h>
#include <assert.h> #include <assert.h>
DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94) DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94)
@ -47,16 +48,16 @@ void LegoMeterPresenter::ParseExtra()
char output[256]; char output[256];
if (KeyValueStringParse(output, g_strTYPE, extraCopy)) { if (KeyValueStringParse(output, g_strTYPE, extraCopy)) {
if (!strcmpi(output, g_strLEFT_TO_RIGHT)) { if (!SDL_strcasecmp(output, g_strLEFT_TO_RIGHT)) {
m_layout = e_leftToRight; m_layout = e_leftToRight;
} }
else if (!strcmpi(output, g_strRIGHT_TO_LEFT)) { else if (!SDL_strcasecmp(output, g_strRIGHT_TO_LEFT)) {
m_layout = e_rightToLeft; m_layout = e_rightToLeft;
} }
else if (!strcmpi(output, g_strBOTTOM_TO_TOP)) { else if (!SDL_strcasecmp(output, g_strBOTTOM_TO_TOP)) {
m_layout = e_bottomToTop; m_layout = e_bottomToTop;
} }
else if (!strcmpi(output, g_strTOP_TO_BOTTOM)) { else if (!SDL_strcasecmp(output, g_strTOP_TO_BOTTOM)) {
m_layout = e_topToBottom; m_layout = e_topToBottom;
} }
} }

View File

@ -7,6 +7,8 @@
#include "mxutilities.h" #include "mxutilities.h"
#include "roi/legoroi.h" #include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoActor, 0x78) DECOMP_SIZE_ASSERT(LegoActor, 0x78)
// GLOBAL: LEGO1 0x100f32d0 // GLOBAL: LEGO1 0x100f32d0
@ -111,7 +113,7 @@ void LegoActor::ParseAction(char* p_extra)
} }
if (KeyValueStringParse(value, g_strVISIBILITY, p_extra)) { if (KeyValueStringParse(value, g_strVISIBILITY, p_extra)) {
GetROI()->SetVisibility(strcmpi(value, "FALSE") != 0); GetROI()->SetVisibility(SDL_strcasecmp(value, "FALSE") != 0);
} }
} }
@ -128,7 +130,7 @@ void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
const char* name = p_roi->GetName(); const char* name = p_roi->GetName();
for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 1; i++) { for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 1; i++) {
if (!strcmpi(name, g_actorNames[i])) { if (!SDL_strcasecmp(name, g_actorNames[i])) {
m_type = e_actor; m_type = e_actor;
m_actorId = i; m_actorId = i;
break; break;

View File

@ -26,6 +26,7 @@
#include "realtime/realtimeview.h" #include "realtime/realtimeview.h"
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
#include <vec.h> #include <vec.h>
DECOMP_SIZE_ASSERT(LegoNavController, 0x70) DECOMP_SIZE_ASSERT(LegoNavController, 0x70)
@ -427,7 +428,7 @@ MxResult LegoNavController::UpdateLocation(const char* p_location)
MxResult result = FAILURE; MxResult result = FAILURE;
for (MxS32 i = 0; i < (MxS32) sizeOfArray(g_locations); i++) { for (MxS32 i = 0; i < (MxS32) sizeOfArray(g_locations); i++) {
if (!strcmpi(p_location, g_locations[i].m_name)) { if (!SDL_strcasecmp(p_location, g_locations[i].m_name)) {
MxMatrix mat; MxMatrix mat;
LegoROI* viewROI = VideoManager()->GetViewROI(); LegoROI* viewROI = VideoManager()->GetViewROI();

View File

@ -27,6 +27,8 @@
#include "mxutilities.h" #include "mxutilities.h"
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoWorld, 0xf8) DECOMP_SIZE_ASSERT(LegoWorld, 0xf8)
DECOMP_SIZE_ASSERT(LegoEntityList, 0x18) DECOMP_SIZE_ASSERT(LegoEntityList, 0x18)
DECOMP_SIZE_ASSERT(LegoEntityListCursor, 0x10) DECOMP_SIZE_ASSERT(LegoEntityListCursor, 0x10)
@ -422,7 +424,7 @@ void LegoWorld::Add(MxCore* p_object)
if (p_object->IsA("LegoAnimPresenter")) { if (p_object->IsA("LegoAnimPresenter")) {
LegoAnimPresenter* animPresenter = (LegoAnimPresenter*) p_object; LegoAnimPresenter* animPresenter = (LegoAnimPresenter*) p_object;
if (!strcmpi(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) { if (!SDL_strcasecmp(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) {
FUN_1003e050(animPresenter); FUN_1003e050(animPresenter);
animPresenter->GetAction()->SetDuration(animPresenter->GetAnimation()->GetDuration()); animPresenter->GetAction()->SetDuration(animPresenter->GetAnimation()->GetDuration());
} }
@ -572,7 +574,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
} }
LegoROI* roi = entity->GetROI(); LegoROI* roi = entity->GetROI();
if (roi && !strcmpi(roi->GetName(), p_name)) { if (roi && !SDL_strcasecmp(roi->GetName(), p_name)) {
return entity; return entity;
} }
} }
@ -584,7 +586,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
MxPresenter* presenter; MxPresenter* presenter;
while (cursor.Next(presenter)) { while (cursor.Next(presenter)) {
if (!strcmpi(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) { if (!SDL_strcasecmp(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) {
return presenter; return presenter;
} }
} }

View File

@ -27,6 +27,7 @@
#include "mxstl/stlcompat.h" #include "mxstl/stlcompat.h"
#include "mxutilities.h" #include "mxutilities.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
DECOMP_SIZE_ASSERT(LegoWorldPresenter, 0x54) DECOMP_SIZE_ASSERT(LegoWorldPresenter, 0x54)
@ -198,7 +199,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
ReadModelDbWorlds(wdbFile, worlds, numWorlds); ReadModelDbWorlds(wdbFile, worlds, numWorlds);
for (i = 0; i < numWorlds; i++) { for (i = 0; i < numWorlds; i++) {
if (!strcmpi(worlds[i].m_worldName, p_worldName)) { if (!SDL_strcasecmp(worlds[i].m_worldName, p_worldName)) {
break; break;
} }
} }
@ -266,25 +267,25 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
} }
for (j = 0; j < worlds[i].m_numModels; j++) { for (j = 0; j < worlds[i].m_numModels; j++) {
if (!strnicmp(worlds[i].m_models[j].m_modelName, "isle", 4)) { if (!SDL_strncasecmp(worlds[i].m_models[j].m_modelName, "isle", 4)) {
switch (g_legoWorldPresenterQuality) { switch (g_legoWorldPresenterQuality) {
case 0: case 0:
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_lo")) { if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle_lo")) {
continue; continue;
} }
break; break;
case 1: case 1:
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle")) { if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle")) {
continue; continue;
} }
break; break;
case 2: case 2:
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_hi")) { if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle_hi")) {
continue; continue;
} }
} }
} }
else if (g_legoWorldPresenterQuality <= 1 && !strnicmp(worlds[i].m_models[j].m_modelName, "haus", 4)) { else if (g_legoWorldPresenterQuality <= 1 && !SDL_strncasecmp(worlds[i].m_models[j].m_modelName, "haus", 4)) {
if (worlds[i].m_models[j].m_modelName[4] == '3') { if (worlds[i].m_models[j].m_modelName[4] == '3') {
if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) { if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
return FAILURE; return FAILURE;

View File

@ -33,6 +33,8 @@
#include "scripts.h" #include "scripts.h"
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoOmni, 0x140) DECOMP_SIZE_ASSERT(LegoOmni, 0x140)
DECOMP_SIZE_ASSERT(LegoOmni::WorldContainer, 0x1c) DECOMP_SIZE_ASSERT(LegoOmni::WorldContainer, 0x1c)
DECOMP_SIZE_ASSERT(LegoWorldList, 0x18) DECOMP_SIZE_ASSERT(LegoWorldList, 0x18)
@ -417,7 +419,7 @@ LegoROI* LegoOmni::FindROI(const char* p_name)
const char* name = roi->GetName(); const char* name = roi->GetName();
if (name != NULL) { if (name != NULL) {
if (!strcmpi(name, p_name)) { if (!SDL_strcasecmp(name, p_name)) {
return roi; return roi;
} }
} }
@ -432,7 +434,7 @@ MxEntity* LegoOmni::AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter*
{ {
LegoWorld* world = NULL; LegoWorld* world = NULL;
if (strcmpi(p_id, g_current)) { if (SDL_strcasecmp(p_id, g_current)) {
world = FindWorld(MxAtomId(p_id, e_lowerCase2), p_entityId); world = FindWorld(MxAtomId(p_id, e_lowerCase2), p_entityId);
} }
else { else {
@ -507,7 +509,7 @@ LegoOmni::World LegoOmni::GetWorldId(const char* p_key)
{ {
for (MxS32 i = 0; i < e_numWorlds; i++) { for (MxS32 i = 0; i < e_numWorlds; i++) {
// FIXME: this looks very fishy. Is this guarding against out-of-bounds access? // FIXME: this looks very fishy. Is this guarding against out-of-bounds access?
if ((MxS32*) &m_worlds[i] != (MxS32*) -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) { if ((MxS32*) &m_worlds[i] != (MxS32*) -4 && !SDL_strcasecmp(m_worlds[i].GetKey(), p_key)) {
return m_worlds[i].GetId(); return m_worlds[i].GetId();
} }
} }

View File

@ -7,6 +7,8 @@
#include "mxticklemanager.h" #include "mxticklemanager.h"
#include "mxtimer.h" #include "mxtimer.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoPathController, 0x40) DECOMP_SIZE_ASSERT(LegoPathController, 0x40)
DECOMP_SIZE_ASSERT(LegoPathCtrlEdge, 0x40) DECOMP_SIZE_ASSERT(LegoPathCtrlEdge, 0x40)
DECOMP_SIZE_ASSERT(LegoPathController::CtrlBoundary, 0x08) DECOMP_SIZE_ASSERT(LegoPathController::CtrlBoundary, 0x08)
@ -103,7 +105,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con
MxS32 j; MxS32 j;
for (j = 0; j < sizeOfArray(g_unk0x100f42f0); j++) { for (j = 0; j < sizeOfArray(g_unk0x100f42f0); j++) {
if (!strcmpi(g_unk0x100f42f0[j], boundary.GetName())) { if (!SDL_strcasecmp(g_unk0x100f42f0[j], boundary.GetName())) {
g_ctrlBoundariesA[j].m_controller = this; g_ctrlBoundariesA[j].m_controller = this;
g_ctrlBoundariesA[j].m_boundary = &boundary; g_ctrlBoundariesA[j].m_boundary = &boundary;
@ -114,7 +116,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con
} }
for (j = 0; j < sizeOfArray(g_unk0x100f4330); j++) { for (j = 0; j < sizeOfArray(g_unk0x100f4330); j++) {
if (!strcmpi(g_unk0x100f4330[j], boundary.GetName())) { if (!SDL_strcasecmp(g_unk0x100f4330[j], boundary.GetName())) {
g_ctrlBoundariesB[j].m_controller = this; g_ctrlBoundariesB[j].m_controller = this;
g_ctrlBoundariesB[j].m_boundary = &boundary; g_ctrlBoundariesB[j].m_boundary = &boundary;
g_ctrlEdgesB[j].m_controller = this; g_ctrlEdgesB[j].m_controller = this;
@ -386,7 +388,7 @@ MxResult LegoPathController::FUN_10046b30(LegoPathBoundary*& p_boundaries, MxS32
LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name) LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name)
{ {
for (MxS32 i = 0; i < m_numL; i++) { for (MxS32 i = 0; i < m_numL; i++) {
if (!strcmpi(m_boundaries[i].GetName(), p_name)) { if (!SDL_strcasecmp(m_boundaries[i].GetName(), p_name)) {
return &m_boundaries[i]; return &m_boundaries[i];
} }
} }

View File

@ -127,7 +127,7 @@ void LegoPathPresenter::ParseExtra()
memcpy(extraCopy, extraData, extraLength); memcpy(extraCopy, extraData, extraLength);
extraCopy[extraLength] = '\0'; extraCopy[extraLength] = '\0';
strupr(extraCopy); SDL_strupr(extraCopy);
if (KeyValueStringParse(output, g_strTRIGGERS_SOURCE, extraCopy) != FALSE) { if (KeyValueStringParse(output, g_strTRIGGERS_SOURCE, extraCopy) != FALSE) {
m_trigger = MxAtomId(output, e_lowerCase2); m_trigger = MxAtomId(output, e_lowerCase2);

View File

@ -19,6 +19,7 @@
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include "raceskel.h" #include "raceskel.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
DECOMP_SIZE_ASSERT(EdgeReference, 0x08) DECOMP_SIZE_ASSERT(EdgeReference, 0x08)
@ -476,8 +477,8 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
} }
if (m_userNavFlag) { if (m_userNavFlag) {
MxBool actorIsStuds = strcmpi(p_actor->GetROI()->GetName(), "studs") == 0; MxBool actorIsStuds = SDL_strcasecmp(p_actor->GetROI()->GetName(), "studs") == 0;
MxBool actorIsRhoda = strcmpi(p_actor->GetROI()->GetName(), "rhoda") == 0; MxBool actorIsRhoda = SDL_strcasecmp(p_actor->GetROI()->GetName(), "rhoda") == 0;
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
const char* soundKey = NULL; const char* soundKey = NULL;
@ -692,8 +693,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
} }
if (m_userNavFlag) { if (m_userNavFlag) {
MxBool actorIsSnap = strcmpi(p_actor->GetROI()->GetName(), "snap") == 0; MxBool actorIsSnap = SDL_strcasecmp(p_actor->GetROI()->GetName(), "snap") == 0;
MxBool actorIsValerie = strcmpi(p_actor->GetROI()->GetName(), "valerie") == 0; MxBool actorIsValerie = SDL_strcasecmp(p_actor->GetROI()->GetName(), "valerie") == 0;
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
const char* soundKey = NULL; const char* soundKey = NULL;

View File

@ -8,6 +8,7 @@
#include "mxmisc.h" #include "mxmisc.h"
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include <SDL3/SDL_stdinc.h>
#include <vec.h> #include <vec.h>
// File name verified by BETA10 0x100cedf7 // File name verified by BETA10 0x100cedf7
@ -220,7 +221,7 @@ void LegoCarRaceActor::Animate(float p_time)
if (m_unk0x0c == 0) { if (m_unk0x0c == 0) {
const char* value = VariableTable()->GetVariable(g_raceState); const char* value = VariableTable()->GetVariable(g_raceState);
if (strcmpi(value, g_racing) == 0) { if (SDL_strcasecmp(value, g_racing) == 0) {
m_unk0x0c = 1; m_unk0x0c = 1;
m_lastTime = p_time - 1.0f; m_lastTime = p_time - 1.0f;
m_unk0x1c = p_time; m_unk0x1c = p_time;

View File

@ -26,6 +26,7 @@
#include "realtime/realtime.h" #include "realtime/realtime.h"
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc) DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc)
@ -244,7 +245,7 @@ void LegoAnimPresenter::FUN_100692b0()
else if (unk0x04 == 4) { else if (unk0x04 == 4) {
LegoChar* baseName = new LegoChar[strlen(str)]; LegoChar* baseName = new LegoChar[strlen(str)];
strcpy(baseName, str + 1); strcpy(baseName, str + 1);
strlwr(baseName); SDL_strlwr(baseName);
LegoChar* und = FUN_10069150(str); LegoChar* und = FUN_10069150(str);
roi = CharacterManager()->FUN_10085a80(und, baseName, TRUE); roi = CharacterManager()->FUN_10085a80(und, baseName, TRUE);
@ -268,7 +269,7 @@ void LegoAnimPresenter::FUN_100692b0()
*i = '\0'; *i = '\0';
} }
strlwr(lodName); SDL_strlwr(lodName);
LegoChar* und = FUN_10069150(str); LegoChar* und = FUN_10069150(str);
roi = CharacterManager()->CreateAutoROI(und, lodName, TRUE); roi = CharacterManager()->CreateAutoROI(und, lodName, TRUE);
@ -315,7 +316,7 @@ void LegoAnimPresenter::FUN_100695c0()
*i = '\0'; *i = '\0';
} }
strlwr(lodName); SDL_strlwr(lodName);
CharacterManager()->CreateAutoROI(actorName, lodName, FALSE); CharacterManager()->CreateAutoROI(actorName, lodName, FALSE);
FUN_100698b0(rois, actorName); FUN_100698b0(rois, actorName);
@ -370,7 +371,7 @@ LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_rois, const Leg
const char* name = roi->GetName(); const char* name = roi->GetName();
if (name != NULL) { if (name != NULL) {
if (!strcmpi(name, str)) { if (!SDL_strcasecmp(name, str)) {
m_unk0x70->Append(roi); m_unk0x70->Append(roi);
result = TRUE; result = TRUE;
break; break;
@ -392,7 +393,7 @@ LegoROI* LegoAnimPresenter::FUN_100699e0(const LegoChar* p_und)
while (cursor.Next(roi)) { while (cursor.Next(roi)) {
LegoChar* und = FUN_100697c0(roi->GetName(), NULL); LegoChar* und = FUN_100697c0(roi->GetName(), NULL);
if (und != NULL && !strcmpi(und, p_und)) { if (und != NULL && !SDL_strcasecmp(und, p_und)) {
delete[] und; delete[] und;
return roi; return roi;
} }
@ -430,7 +431,7 @@ void LegoAnimPresenter::FUN_10069b10()
if (m_roiMap[index]->GetName() != NULL) { if (m_roiMap[index]->GetName() != NULL) {
for (MxS32 i = 0; i < m_unk0x94; i++) { for (MxS32 i = 0; i < m_unk0x94; i++) {
if (m_unk0x8c[i] == NULL && m_unk0x90[i] != NULL) { if (m_unk0x8c[i] == NULL && m_unk0x90[i] != NULL) {
if (!strcmpi(m_unk0x90[i], m_roiMap[index]->GetName())) { if (!SDL_strcasecmp(m_unk0x90[i], m_roiMap[index]->GetName())) {
m_unk0x8c[i] = m_roiMap[index]; m_unk0x8c[i] = m_roiMap[index];
break; break;
} }

View File

@ -19,6 +19,8 @@
#include "realtime/realtime.h" #include "realtime/realtime.h"
#include "roi/legoroi.h" #include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoModelPresenter, 0x6c) DECOMP_SIZE_ASSERT(LegoModelPresenter, 0x6c)
// GLOBAL: LEGO1 0x100f7ae0 // GLOBAL: LEGO1 0x100f7ae0
@ -98,7 +100,7 @@ MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk)
storage.Read(textureName, textureNameLength); storage.Read(textureName, textureNameLength);
textureName[textureNameLength] = '\0'; textureName[textureNameLength] = '\0';
strlwr(textureName); SDL_strlwr(textureName);
if (textureName[0] == '^') { if (textureName[0] == '^') {
strcpy(textureName, textureName + 1); strcpy(textureName, textureName + 1);
@ -316,7 +318,7 @@ void LegoModelPresenter::ParseExtra()
list<LegoROI*>& roiList = currentWorld->GetROIList(); list<LegoROI*>& roiList = currentWorld->GetROIList();
for (list<LegoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) { for (list<LegoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) {
if (!strcmpi((*it)->GetName(), output)) { if (!SDL_strcasecmp((*it)->GetName(), output)) {
m_roi = *it; m_roi = *it;
roiList.erase(it); roiList.erase(it);

View File

@ -10,6 +10,8 @@
#include "mxdssubscriber.h" #include "mxdssubscriber.h"
#include "viewmanager/viewlodlist.h" #include "viewmanager/viewlodlist.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoLODList, 0x18) DECOMP_SIZE_ASSERT(LegoLODList, 0x18)
DECOMP_SIZE_ASSERT(LegoNamedPart, 0x14) DECOMP_SIZE_ASSERT(LegoNamedPart, 0x14)
DECOMP_SIZE_ASSERT(LegoNamedPartList, 0x18) DECOMP_SIZE_ASSERT(LegoNamedPartList, 0x18)
@ -92,7 +94,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk)
storage.Read(textureName, textureNameLength); storage.Read(textureName, textureNameLength);
textureName[textureNameLength] = '\0'; textureName[textureNameLength] = '\0';
strlwr(textureName); SDL_strlwr(textureName);
if (textureName[0] == '^') { if (textureName[0] == '^') {
strcpy(textureName, textureName + 1); strcpy(textureName, textureName + 1);
@ -166,7 +168,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk)
} }
roiName[roiNameLength] = '\0'; roiName[roiNameLength] = '\0';
strlwr(roiName); SDL_strlwr(roiName);
if (storage.Read(&numLODs, sizeof(numLODs)) != SUCCESS) { if (storage.Read(&numLODs, sizeof(numLODs)) != SUCCESS) {
goto done; goto done;

View File

@ -9,6 +9,8 @@
#include "mxdirectx/mxdirect3d.h" #include "mxdirectx/mxdirect3d.h"
#include "mxdssubscriber.h" #include "mxdssubscriber.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoTexturePresenter, 0x54) DECOMP_SIZE_ASSERT(LegoTexturePresenter, 0x54)
DECOMP_SIZE_ASSERT(LegoNamedTexture, 0x14) DECOMP_SIZE_ASSERT(LegoNamedTexture, 0x14)
DECOMP_SIZE_ASSERT(LegoNamedTextureList, 0x18) DECOMP_SIZE_ASSERT(LegoNamedTextureList, 0x18)
@ -57,7 +59,7 @@ MxResult LegoTexturePresenter::Read(MxDSChunk& p_chunk)
} }
textureName[textureNameLength] = '\0'; textureName[textureNameLength] = '\0';
strlwr(textureName); SDL_strlwr(textureName);
texture = new LegoTexture(); texture = new LegoTexture();
if (texture->Read(&storage, hardwareMode) != SUCCESS) { if (texture->Read(&storage, hardwareMode) != SUCCESS) {

View File

@ -19,6 +19,7 @@
#include "tgl/d3drm/impl.h" #include "tgl/d3drm/impl.h"
#include "viewmanager/viewroi.h" #include "viewmanager/viewroi.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590) DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590)
@ -544,7 +545,7 @@ MxPresenter* LegoVideoManager::GetPresenterByActionObjectName(const char* p_acti
continue; continue;
} }
if (strcmpi(presenter->GetAction()->GetObjectName(), p_actionObjectName) == 0) { if (SDL_strcasecmp(presenter->GetAction()->GetObjectName(), p_actionObjectName) == 0) {
return presenter; return presenter;
} }
} }

View File

@ -22,6 +22,8 @@
#include "radio.h" #include "radio.h"
#include "scripts.h" #include "scripts.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(GasStation, 0x128) DECOMP_SIZE_ASSERT(GasStation, 0x128)
DECOMP_SIZE_ASSERT(GasStationState, 0x24) DECOMP_SIZE_ASSERT(GasStationState, 0x24)
@ -374,7 +376,7 @@ MxLong GasStation::HandleButtonDown(LegoControlManagerNotificationParam& p_param
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY()); LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi != NULL) { if (roi != NULL) {
if (!strnicmp(roi->GetName(), "capdb", 5) || !strnicmp(roi->GetName(), "*capdb", 6)) { if (!SDL_strncasecmp(roi->GetName(), "capdb", 5) || !SDL_strncasecmp(roi->GetName(), "*capdb", 6)) {
m_unk0x104 = 3; m_unk0x104 = 3;
m_unk0x114 = FALSE; m_unk0x114 = FALSE;

View File

@ -20,6 +20,8 @@
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
#include "scripts.h" #include "scripts.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(Hospital, 0x12c) DECOMP_SIZE_ASSERT(Hospital, 0x12c)
DECOMP_SIZE_ASSERT(HospitalState, 0x18) DECOMP_SIZE_ASSERT(HospitalState, 0x18)
@ -409,7 +411,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
roiName += 1; roiName += 1;
} }
if (!strcmpi("actor_ha", roiName)) { if (!SDL_strcasecmp("actor_ha", roiName)) {
LegoInputManager* inputManager = InputManager(); LegoInputManager* inputManager = InputManager();
inputManager->SetUnknown88(TRUE); inputManager->SetUnknown88(TRUE);
inputManager->SetUnknown336(FALSE); inputManager->SetUnknown336(FALSE);

View File

@ -7,6 +7,8 @@
#include "shape/legomesh.h" #include "shape/legomesh.h"
#include "tgl/d3drm/impl.h" #include "tgl/d3drm/impl.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LODObject, 0x04) DECOMP_SIZE_ASSERT(LODObject, 0x04)
DECOMP_SIZE_ASSERT(ViewLOD, 0x0c) DECOMP_SIZE_ASSERT(ViewLOD, 0x0c)
DECOMP_SIZE_ASSERT(LegoLOD, 0x20) DECOMP_SIZE_ASSERT(LegoLOD, 0x20)
@ -380,7 +382,7 @@ LegoResult LegoLOD::GetTexture(LegoTextureInfo*& p_textureInfo)
LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name) LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name)
{ {
if (p_name != NULL) { if (p_name != NULL) {
if (!strnicmp(p_name, g_unk0x101013dc, strlen(g_unk0x101013dc))) { if (!SDL_strncasecmp(p_name, g_unk0x101013dc, strlen(g_unk0x101013dc))) {
return TRUE; return TRUE;
} }
} }

View File

@ -8,6 +8,7 @@
#include "shape/legobox.h" #include "shape/legobox.h"
#include "shape/legosphere.h" #include "shape/legosphere.h"
#include <SDL3/SDL_stdinc.h>
#include <string.h> #include <string.h>
#include <vec.h> #include <vec.h>
@ -135,7 +136,7 @@ LegoResult LegoROI::Read(
goto done; goto done;
} }
m_name[length] = '\0'; m_name[length] = '\0';
strlwr(m_name); SDL_strlwr(m_name);
if (sphere.Read(p_storage) != SUCCESS) { if (sphere.Read(p_storage) != SUCCESS) {
goto done; goto done;
@ -162,7 +163,7 @@ LegoResult LegoROI::Read(
goto done; goto done;
} }
textureName[length] = '\0'; textureName[length] = '\0';
strlwr(textureName); SDL_strlwr(textureName);
} }
else { else {
textureName = NULL; textureName = NULL;
@ -216,7 +217,7 @@ LegoResult LegoROI::Read(
if (g_roiConfig <= 2) { if (g_roiConfig <= 2) {
for (i = 0; g_unk0x10101380[i] != NULL; i++) { for (i = 0; g_unk0x10101380[i] != NULL; i++) {
if (!strnicmp(m_name, g_unk0x10101380[i], 4)) { if (!SDL_strncasecmp(m_name, g_unk0x10101380[i], 4)) {
roiName = g_unk0x10101380[i]; roiName = g_unk0x10101380[i];
break; break;
} }
@ -224,7 +225,7 @@ LegoResult LegoROI::Read(
} }
else { else {
for (i = 0; g_unk0x10101370[i] != NULL; i++) { for (i = 0; g_unk0x10101370[i] != NULL; i++) {
if (!strnicmp(m_name, g_unk0x10101370[i], 4)) { if (!SDL_strncasecmp(m_name, g_unk0x10101370[i], 4)) {
roiName = g_unk0x10101370[i]; roiName = g_unk0x10101370[i];
break; break;
} }
@ -233,7 +234,7 @@ LegoResult LegoROI::Read(
if ((lodList = p_viewLODListManager->Lookup(roiName))) { if ((lodList = p_viewLODListManager->Lookup(roiName))) {
for (j = 0; g_unk0x10101390[j] != NULL; j++) { for (j = 0; g_unk0x10101390[j] != NULL; j++) {
if (!strcmpi(g_unk0x10101390[j], roiName)) { if (!SDL_strcasecmp(g_unk0x10101390[j], roiName)) {
break; break;
} }
} }
@ -291,7 +292,7 @@ LegoResult LegoROI::Read(
} }
if (textureName != NULL) { if (textureName != NULL) {
if (!strnicmp(textureName, "t_", 2)) { if (!SDL_strncasecmp(textureName, "t_", 2)) {
textureInfo = p_textureContainer->Get(textureName + 2); textureInfo = p_textureContainer->Get(textureName + 2);
if (textureInfo == NULL) { if (textureInfo == NULL) {
@ -350,7 +351,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi)
CompoundObject::iterator it; CompoundObject::iterator it;
const LegoChar* name = p_roi->GetName(); const LegoChar* name = p_roi->GetName();
if (name != NULL && *name != '\0' && !strcmpi(name, p_name)) { if (name != NULL && *name != '\0' && !SDL_strcasecmp(name, p_name)) {
return p_roi; return p_roi;
} }
@ -360,7 +361,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi)
LegoROI* roi = (LegoROI*) *it; LegoROI* roi = (LegoROI*) *it;
name = roi->GetName(); name = roi->GetName();
if (name != NULL && *name != '\0' && !strcmpi(name, p_name)) { if (name != NULL && *name != '\0' && !SDL_strcasecmp(name, p_name)) {
return roi; return roi;
} }
} }
@ -774,7 +775,7 @@ LegoBool LegoROI::FUN_100a9bf0(const LegoChar* p_param, float& p_red, float& p_g
LegoBool LegoROI::ColorAliasLookup(const LegoChar* p_param, float& p_red, float& p_green, float& p_blue, float& p_alpha) LegoBool LegoROI::ColorAliasLookup(const LegoChar* p_param, float& p_red, float& p_green, float& p_blue, float& p_alpha)
{ {
for (LegoU32 i = 0; i < sizeOfArray(g_roiColorAliases); i++) { for (LegoU32 i = 0; i < sizeOfArray(g_roiColorAliases); i++) {
if (strcmpi(g_roiColorAliases[i].m_name, p_param) == 0) { if (SDL_strcasecmp(g_roiColorAliases[i].m_name, p_param) == 0) {
p_red = g_roiColorAliases[i].m_red / 255.0; p_red = g_roiColorAliases[i].m_red / 255.0;
p_green = g_roiColorAliases[i].m_green / 255.0; p_green = g_roiColorAliases[i].m_green / 255.0;
p_blue = g_roiColorAliases[i].m_blue / 255.0; p_blue = g_roiColorAliases[i].m_blue / 255.0;
@ -817,7 +818,7 @@ void LegoROI::SetName(const LegoChar* p_name)
if (p_name != NULL) { if (p_name != NULL) {
m_name = new LegoChar[strlen(p_name) + 1]; m_name = new LegoChar[strlen(p_name) + 1];
strcpy(m_name, p_name); strcpy(m_name, p_name);
strlwr(m_name); SDL_strlwr(m_name);
} }
else { else {
m_name = NULL; m_name = NULL;

View File

@ -1,6 +1,7 @@
#ifndef LEGOROI_H #ifndef LEGOROI_H
#define LEGOROI_H #define LEGOROI_H
#include "lego1_export.h"
#include "misc/legotypes.h" #include "misc/legotypes.h"
#include "viewmanager/viewroi.h" #include "viewmanager/viewroi.h"
@ -53,7 +54,7 @@ class LegoROI : public ViewROI {
static LegoResult FUN_100a8cb0(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix); static LegoResult FUN_100a8cb0(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix);
static void FUN_100a81b0(const LegoChar* p_error, const LegoChar* p_name); static void FUN_100a81b0(const LegoChar* p_error, const LegoChar* p_name);
static void configureLegoROI(int p_roi); LEGO1_EXPORT static void configureLegoROI(int p_roi);
static void FUN_100a9d30(ROIHandler p_func); static void FUN_100a9d30(ROIHandler p_func);
static LegoBool FUN_100a9bf0(const LegoChar* p_param, float& p_red, float& p_green, float& p_blue, float& p_alpha); static LegoBool FUN_100a9bf0(const LegoChar* p_param, float& p_red, float& p_green, float& p_blue, float& p_alpha);
static LegoBool ColorAliasLookup( static LegoBool ColorAliasLookup(

View File

@ -2,6 +2,8 @@
#include "misc/legostorage.h" #include "misc/legostorage.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoMeshUnkComponent, 0x1c) DECOMP_SIZE_ASSERT(LegoMeshUnkComponent, 0x1c)
DECOMP_SIZE_ASSERT(LegoMesh, 0x24) DECOMP_SIZE_ASSERT(LegoMesh, 0x24)
@ -70,7 +72,7 @@ LegoResult LegoMesh::Read(LegoStorage* p_storage)
} }
m_textureName[textureLength] = '\0'; m_textureName[textureLength] = '\0';
strlwr(m_textureName); SDL_strlwr(m_textureName);
} }
if ((result = p_storage->Read(&materialLength, sizeof(materialLength))) != SUCCESS) { if ((result = p_storage->Read(&materialLength, sizeof(materialLength))) != SUCCESS) {
@ -84,7 +86,7 @@ LegoResult LegoMesh::Read(LegoStorage* p_storage)
} }
m_materialName[materialLength] = '\0'; m_materialName[materialLength] = '\0';
strlwr(m_materialName); SDL_strlwr(m_materialName);
} }
return SUCCESS; return SUCCESS;

20
LEGO1/lego1_export.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef LEGO1_EXPORT_H
#define LEGO1_EXPORT_H
#ifdef LEGO1_STATIC
#define LEGO1_EXPORT
#elif defined(LEGO1_DLL)
#ifdef _WIN32
#define LEGO1_EXPORT __declspec(dllexport)
#else
#define LEGO1_EXPORT __attribute__((visibility("default")))
#endif
#else
#ifdef _WIN32
#define LEGO1_EXPORT __declspec(dllimport)
#else
#define LEGO1_EXPORT
#endif
#endif
#endif

View File

@ -7,6 +7,7 @@
#include "mxtypes.h" #include "mxtypes.h"
#include <SDL3/SDL_iostream.h> #include <SDL3/SDL_iostream.h>
#include <SDL3/SDL_stdinc.h>
// SIZE 0x18 // SIZE 0x18
struct ModelDbPart { struct ModelDbPart {
@ -32,7 +33,7 @@ class ModelDbPartList : public MxList<ModelDbPart*> {
// FUNCTION: LEGO1 0x10027c40 // FUNCTION: LEGO1 0x10027c40
MxS8 Compare(ModelDbPart* p_a, ModelDbPart* p_b) override MxS8 Compare(ModelDbPart* p_a, ModelDbPart* p_b) override
{ {
MxS32 compare = strcmpi(p_a->m_roiName.GetData(), p_b->m_roiName.GetData()); MxS32 compare = SDL_strcasecmp(p_a->m_roiName.GetData(), p_b->m_roiName.GetData());
if (compare == 0) { if (compare == 0) {
p_b->m_partDataLength = p_a->m_partDataLength; p_b->m_partDataLength = p_a->m_partDataLength;

View File

@ -1,6 +1,7 @@
#ifndef MXDIRECTDRAW_H #ifndef MXDIRECTDRAW_H
#define MXDIRECTDRAW_H #define MXDIRECTDRAW_H
#include "lego1_export.h"
#include "mxdirectxinfo.h" #include "mxdirectxinfo.h"
#include <ddraw.h> #include <ddraw.h>
@ -12,7 +13,7 @@ class MxDirectDraw {
public: public:
typedef void (*ErrorHandler)(const char*, HRESULT, void*); typedef void (*ErrorHandler)(const char*, HRESULT, void*);
static int GetPrimaryBitDepth(); LEGO1_EXPORT static int GetPrimaryBitDepth();
MxDirectDraw(); MxDirectDraw();
virtual ~MxDirectDraw(); virtual ~MxDirectDraw();

View File

@ -1,5 +1,6 @@
#include "mxdirectxinfo.h" #include "mxdirectxinfo.h"
#include <SDL3/SDL_log.h>
#include <assert.h> #include <assert.h>
#include <stdio.h> // for vsprintf #include <stdio.h> // for vsprintf
@ -260,13 +261,10 @@ BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc
void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...) void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...)
{ {
va_list args; va_list args;
char buf[512];
va_start(args, p_format); va_start(args, p_format);
vsprintf(buf, p_format, args); SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, p_format, args);
va_end(args); va_end(args);
OutputDebugString(buf);
} }
// FUNCTION: CONFIG 0x00401bf0 // FUNCTION: CONFIG 0x00401bf0

View File

@ -1,6 +1,7 @@
#ifndef MXATOM_H #ifndef MXATOM_H
#define MXATOM_H #define MXATOM_H
#include "lego1_export.h"
#include "mxstl/stlcompat.h" #include "mxstl/stlcompat.h"
#include "mxstring.h" #include "mxstring.h"
#include "mxtypes.h" #include "mxtypes.h"
@ -61,9 +62,9 @@ enum LookupMode {
class MxAtomId { class MxAtomId {
public: public:
MxAtomId(const char*, LookupMode); MxAtomId(const char*, LookupMode);
~MxAtomId(); LEGO1_EXPORT ~MxAtomId();
MxAtomId& operator=(const MxAtomId& p_atomId); LEGO1_EXPORT MxAtomId& operator=(const MxAtomId& p_atomId);
// FUNCTION: BETA10 0x100178d0 // FUNCTION: BETA10 0x100178d0
MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; } MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; }

View File

@ -4,6 +4,7 @@
#include "mxcore.h" #include "mxcore.h"
#include "mxtypes.h" #include "mxtypes.h"
#include <SDL3/SDL_iostream.h>
#include <ddraw.h> #include <ddraw.h>
#include <stdlib.h> #include <stdlib.h>
@ -43,7 +44,7 @@ class MxBitmap : public MxCore {
virtual MxResult ImportBitmap(MxBitmap* p_bitmap); // vtable+14 virtual MxResult ImportBitmap(MxBitmap* p_bitmap); // vtable+14
virtual MxResult ImportBitmapInfo(MxBITMAPINFO* p_info); // vtable+18 virtual MxResult ImportBitmapInfo(MxBITMAPINFO* p_info); // vtable+18
virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool); // vtable+1c virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool); // vtable+1c
virtual MxResult LoadFile(HANDLE p_handle); // vtable+20 virtual MxResult LoadFile(SDL_IOStream* p_handle); // vtable+20
virtual MxLong Read(const char* p_filename); // vtable+24 virtual MxLong Read(const char* p_filename); // vtable+24
// FUNCTION: LEGO1 0x1004e0d0 // FUNCTION: LEGO1 0x1004e0d0

View File

@ -1,6 +1,7 @@
#ifndef MXDSACTION_H #ifndef MXDSACTION_H
#define MXDSACTION_H #define MXDSACTION_H
#include "lego1_export.h"
#include "mxdsobject.h" #include "mxdsobject.h"
#include "mxgeometry/mxgeometry3d.h" #include "mxgeometry/mxgeometry3d.h"
#include "mxtypes.h" #include "mxtypes.h"
@ -25,8 +26,8 @@ class MxDSAction : public MxDSObject {
c_bit11 = 0x400, c_bit11 = 0x400,
}; };
MxDSAction(); LEGO1_EXPORT MxDSAction();
~MxDSAction() override; LEGO1_EXPORT ~MxDSAction() override;
MxDSAction(MxDSAction& p_dsAction); MxDSAction(MxDSAction& p_dsAction);
void CopyFrom(MxDSAction& p_dsAction); void CopyFrom(MxDSAction& p_dsAction);

View File

@ -1,6 +1,7 @@
#ifndef MXDSFILE_H #ifndef MXDSFILE_H
#define MXDSFILE_H #define MXDSFILE_H
#include "lego1_export.h"
#include "mxdssource.h" #include "mxdssource.h"
#include "mxio.h" #include "mxio.h"
#include "mxstring.h" #include "mxstring.h"
@ -13,6 +14,10 @@ class MxDSFile : public MxDSSource {
public: public:
MxDSFile(const char* p_filename, MxULong p_skipReadingChunks); MxDSFile(const char* p_filename, MxULong p_skipReadingChunks);
enum {
e_openRead = 0,
};
#ifdef ISLE_APP #ifdef ISLE_APP
~MxDSFile() override { Close(); } ~MxDSFile() override { Close(); }
#else #else
@ -20,7 +25,7 @@ class MxDSFile : public MxDSSource {
// since it is inlined everywhere in LEGO1.DLL // since it is inlined everywhere in LEGO1.DLL
// FUNCTION: LEGO1 0x100bfed0 // FUNCTION: LEGO1 0x100bfed0
// FUNCTION: BETA10 0x10148ac0 // FUNCTION: BETA10 0x10148ac0
__declspec(dllexport) ~MxDSFile() override { Close(); } LEGO1_EXPORT ~MxDSFile() override { Close(); }
#endif #endif
// FUNCTION: LEGO1 0x100c0120 // FUNCTION: LEGO1 0x100c0120

View File

@ -1,6 +1,7 @@
#ifndef MXMISC_H #ifndef MXMISC_H
#define MXMISC_H #define MXMISC_H
#include "lego1_export.h"
#include "mxtypes.h" #include "mxtypes.h"
class MxAtomSet; class MxAtomSet;
@ -15,13 +16,13 @@ class MxTimer;
class MxVariableTable; class MxVariableTable;
class MxVideoManager; class MxVideoManager;
MxTickleManager* TickleManager(); LEGO1_EXPORT MxTickleManager* TickleManager();
MxTimer* Timer(); LEGO1_EXPORT MxTimer* Timer();
MxStreamer* Streamer(); LEGO1_EXPORT MxStreamer* Streamer();
MxSoundManager* MSoundManager(); MxSoundManager* MSoundManager();
MxVariableTable* VariableTable(); LEGO1_EXPORT MxVariableTable* VariableTable();
MxEventManager* EventManager(); MxEventManager* EventManager();
MxResult Start(MxDSAction*); LEGO1_EXPORT MxResult Start(MxDSAction*);
MxNotificationManager* NotificationManager(); MxNotificationManager* NotificationManager();
MxVideoManager* MVideoManager(); MxVideoManager* MVideoManager();
MxAtomSet* AtomSet(); MxAtomSet* AtomSet();

View File

@ -1,6 +1,7 @@
#ifndef MXOMNI_H #ifndef MXOMNI_H
#define MXOMNI_H #define MXOMNI_H
#include "lego1_export.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxcriticalsection.h" #include "mxcriticalsection.h"
#include "mxstring.h" #include "mxstring.h"
@ -28,14 +29,14 @@ class MxVideoManager;
// SIZE 0x68 // SIZE 0x68
class MxOmni : public MxCore { class MxOmni : public MxCore {
public: public:
static void DestroyInstance(); LEGO1_EXPORT static void DestroyInstance();
static const char* GetCD(); LEGO1_EXPORT static const char* GetCD();
static const char* GetHD(); static const char* GetHD();
static MxOmni* GetInstance(); static MxOmni* GetInstance();
static MxBool IsSound3D(); static MxBool IsSound3D();
static void SetCD(const char* p_cd); LEGO1_EXPORT static void SetCD(const char* p_cd);
static void SetHD(const char* p_hd); LEGO1_EXPORT static void SetHD(const char* p_hd);
static void SetSound3D(MxBool p_use3dSound); LEGO1_EXPORT static void SetSound3D(MxBool p_use3dSound);
static void NormalizePath(char* p_path); static void NormalizePath(char* p_path);
MxOmni(); MxOmni();

View File

@ -1,12 +1,13 @@
#ifndef MXOMNICREATEFLAGS_H #ifndef MXOMNICREATEFLAGS_H
#define MXOMNICREATEFLAGS_H #define MXOMNICREATEFLAGS_H
#include "lego1_export.h"
#include "mxtypes.h" #include "mxtypes.h"
// SIZE 0x02 // SIZE 0x02
class MxOmniCreateFlags { class MxOmniCreateFlags {
public: public:
MxOmniCreateFlags(); LEGO1_EXPORT MxOmniCreateFlags();
// FUNCTION: BETA10 0x10092b50 // FUNCTION: BETA10 0x10092b50
void CreateObjectFactory(MxBool p_enable) { m_flags1.m_bit0 = p_enable; } void CreateObjectFactory(MxBool p_enable) { m_flags1.m_bit0 = p_enable; }

View File

@ -1,6 +1,7 @@
#ifndef MXOMNICREATEPARAM_H #ifndef MXOMNICREATEPARAM_H
#define MXOMNICREATEPARAM_H #define MXOMNICREATEPARAM_H
#include "lego1_export.h"
#include "mxomnicreateflags.h" #include "mxomnicreateflags.h"
#include "mxparam.h" #include "mxparam.h"
#include "mxstring.h" #include "mxstring.h"
@ -12,9 +13,9 @@
// VTABLE: BETA10 0x101c1ca8 // VTABLE: BETA10 0x101c1ca8
class MxOmniCreateParam : public MxParam { class MxOmniCreateParam : public MxParam {
public: public:
MxOmniCreateParam( LEGO1_EXPORT MxOmniCreateParam(
const char* p_mediaPath, const char* p_mediaPath,
struct HWND__* p_windowHandle, HWND p_windowHandle,
MxVideoParam& p_vparam, MxVideoParam& p_vparam,
MxOmniCreateFlags p_flags MxOmniCreateFlags p_flags
); );

View File

@ -2,6 +2,7 @@
#define MXSTREAMER_H #define MXSTREAMER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxmemorypool.h" #include "mxmemorypool.h"
#include "mxnotificationparam.h" #include "mxnotificationparam.h"
@ -50,8 +51,8 @@ class MxStreamer : public MxCore {
MxStreamer(); MxStreamer();
~MxStreamer() override; // vtable+0x00 ~MxStreamer() override; // vtable+0x00
MxStreamController* Open(const char* p_name, MxU16 p_openMode); LEGO1_EXPORT MxStreamController* Open(const char* p_name, MxU16 p_openMode);
MxLong Close(const char* p_name); LEGO1_EXPORT MxLong Close(const char* p_name);
MxLong Notify(MxParam& p_param) override; // vtable+0x04 MxLong Notify(MxParam& p_param) override; // vtable+0x04

View File

@ -1,6 +1,7 @@
#ifndef MXSTRING_H #ifndef MXSTRING_H
#define MXSTRING_H #define MXSTRING_H
#include "lego1_export.h"
#include "mxcore.h" #include "mxcore.h"
// VTABLE: LEGO1 0x100dc110 // VTABLE: LEGO1 0x100dc110
@ -12,7 +13,7 @@ class MxString : public MxCore {
MxString(const MxString& p_str); MxString(const MxString& p_str);
MxString(const char* p_str); MxString(const char* p_str);
MxString(const char* p_str, MxU16 p_maxlen); MxString(const char* p_str, MxU16 p_maxlen);
~MxString() override; LEGO1_EXPORT ~MxString() override;
void Reverse(); void Reverse();
void ToUpperCase(); void ToUpperCase();

View File

@ -1,8 +1,11 @@
#ifndef MXTIMER_H #ifndef MXTIMER_H
#define MXTIMER_H #define MXTIMER_H
#include "lego1_export.h"
#include "mxcore.h" #include "mxcore.h"
#include <SDL3/SDL_stdinc.h>
// VTABLE: LEGO1 0x100dc0e0 // VTABLE: LEGO1 0x100dc0e0
// VTABLE: BETA10 0x101c1bb0 // VTABLE: BETA10 0x101c1bb0
// SIZE 0x10 // SIZE 0x10
@ -13,7 +16,7 @@ class MxTimer : public MxCore {
void Start(); void Start();
void Stop(); void Stop();
MxLong GetRealTime(); LEGO1_EXPORT MxLong GetRealTime();
// FUNCTION: BETA10 0x1012bf50 // FUNCTION: BETA10 0x1012bf50
void InitLastTimeCalculated() { g_lastTimeCalculated = m_startTime; } void InitLastTimeCalculated() { g_lastTimeCalculated = m_startTime; }
@ -35,7 +38,7 @@ class MxTimer : public MxCore {
// MxTimer::`scalar deleting destructor' // MxTimer::`scalar deleting destructor'
private: private:
MxLong m_startTime; // 0x08 Uint64 m_startTime; // 0x08
MxBool m_isRunning; // 0x0c MxBool m_isRunning; // 0x0c
static MxLong g_lastTimeCalculated; static MxLong g_lastTimeCalculated;

View File

@ -1,6 +1,7 @@
#ifndef MXVARIABLETABLE_H #ifndef MXVARIABLETABLE_H
#define MXVARIABLETABLE_H #define MXVARIABLETABLE_H
#include "lego1_export.h"
#include "mxhashtable.h" #include "mxhashtable.h"
#include "mxtypes.h" #include "mxtypes.h"
#include "mxvariable.h" #include "mxvariable.h"
@ -12,7 +13,7 @@ class MxVariableTable : public MxHashTable<MxVariable*> {
public: public:
// FUNCTION: BETA10 0x10130e50 // FUNCTION: BETA10 0x10130e50
MxVariableTable() { SetDestroy(Destroy); } MxVariableTable() { SetDestroy(Destroy); }
void SetVariable(const char* p_key, const char* p_value); LEGO1_EXPORT void SetVariable(const char* p_key, const char* p_value);
void SetVariable(MxVariable* p_var); void SetVariable(MxVariable* p_var);
const char* GetVariable(const char* p_key); const char* GetVariable(const char* p_key);

View File

@ -2,6 +2,7 @@
#define MXVIDEOPARAM_H #define MXVIDEOPARAM_H
#include "compat.h" #include "compat.h"
#include "lego1_export.h"
#include "mxrect32.h" #include "mxrect32.h"
#include "mxtypes.h" #include "mxtypes.h"
#include "mxvideoparamflags.h" #include "mxvideoparamflags.h"
@ -13,13 +14,17 @@ class MxPalette;
// SIZE 0x24 // SIZE 0x24
class MxVideoParam { class MxVideoParam {
public: public:
MxVideoParam(); LEGO1_EXPORT MxVideoParam();
__declspec(dllexport) LEGO1_EXPORT MxVideoParam(
MxVideoParam(MxRect32& p_rect, MxPalette* p_palette, MxULong p_backBuffers, MxVideoParamFlags& p_flags); MxRect32& p_rect,
MxPalette* p_palette,
MxULong p_backBuffers,
MxVideoParamFlags& p_flags
);
MxVideoParam(MxVideoParam& p_videoParam); MxVideoParam(MxVideoParam& p_videoParam);
~MxVideoParam(); LEGO1_EXPORT ~MxVideoParam();
void SetDeviceName(char* p_deviceId); LEGO1_EXPORT void SetDeviceName(char* p_deviceId);
MxVideoParam& operator=(const MxVideoParam& p_videoParam); LEGO1_EXPORT MxVideoParam& operator=(const MxVideoParam& p_videoParam);
// FUNCTION: BETA10 0x100886e0 // FUNCTION: BETA10 0x100886e0
MxVideoParamFlags& Flags() { return m_flags; } MxVideoParamFlags& Flags() { return m_flags; }

View File

@ -1,13 +1,14 @@
#ifndef MXVIDEOPARAMFLAGS_H #ifndef MXVIDEOPARAMFLAGS_H
#define MXVIDEOPARAMFLAGS_H #define MXVIDEOPARAMFLAGS_H
#include "lego1_export.h"
#include "mxtypes.h" #include "mxtypes.h"
#include <windows.h> #include <windows.h>
class MxVideoParamFlags { class MxVideoParamFlags {
public: public:
MxVideoParamFlags(); LEGO1_EXPORT MxVideoParamFlags();
// inlined in ISLE // inlined in ISLE
void SetFullScreen(MxBool p_e) { m_flags1.m_bit0 = p_e; } void SetFullScreen(MxBool p_e) { m_flags1.m_bit0 = p_e; }

View File

@ -4,6 +4,8 @@
#include "mxtimer.h" #include "mxtimer.h"
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxDSSelectAction, 0xb0) DECOMP_SIZE_ASSERT(MxDSSelectAction, 0xb0)
DECOMP_SIZE_ASSERT(MxStringList, 0x18) DECOMP_SIZE_ASSERT(MxStringList, 0x18)
DECOMP_SIZE_ASSERT(MxStringListCursor, 0x10) DECOMP_SIZE_ASSERT(MxStringListCursor, 0x10)
@ -94,13 +96,13 @@ void MxDSSelectAction::Deserialize(MxU8*& p_source, MxS16 p_unk0x24)
this->m_unk0x9c = (char*) p_source; this->m_unk0x9c = (char*) p_source;
if (!strnicmp(this->m_unk0x9c.GetData(), "RANDOM_", strlen("RANDOM_"))) { if (!SDL_strncasecmp(this->m_unk0x9c.GetData(), "RANDOM_", strlen("RANDOM_"))) {
char buffer[10]; char buffer[10];
MxS16 value = atoi(&this->m_unk0x9c.GetData()[strlen("RANDOM_")]); MxS16 value = atoi(&this->m_unk0x9c.GetData()[strlen("RANDOM_")]);
srand(Timer()->GetTime()); srand(Timer()->GetTime());
MxS32 random = rand() % value; MxS32 random = rand() % value;
string = itoa((MxS16) random, buffer, 10); string = SDL_itoa((MxS16) random, buffer, 10);
} }
else { else {
string = VariableTable()->GetVariable((char*) p_source); string = VariableTable()->GetVariable((char*) p_source);

View File

@ -10,6 +10,7 @@
#include "mxsoundmanager.h" #include "mxsoundmanager.h"
#include "mxutilities.h" #include "mxutilities.h"
#include <SDL3/SDL_stdinc.h>
#include <assert.h> #include <assert.h>
DECOMP_SIZE_ASSERT(MxWavePresenter, 0x6c); DECOMP_SIZE_ASSERT(MxWavePresenter, 0x6c);
@ -326,7 +327,7 @@ void MxWavePresenter::ParseExtra()
char soundValue[512]; char soundValue[512];
if (KeyValueStringParse(soundValue, g_strSOUND, extraCopy)) { if (KeyValueStringParse(soundValue, g_strSOUND, extraCopy)) {
if (!strcmpi(soundValue, "FALSE")) { if (!SDL_strcasecmp(soundValue, "FALSE")) {
Enable(FALSE); Enable(FALSE);
} }
} }

View File

@ -6,8 +6,8 @@
// Identical functions at BETA10 0x100ec9fe and 0x101741b5 are more limited in scope. // Identical functions at BETA10 0x100ec9fe and 0x101741b5 are more limited in scope.
// This is the most widely used version. // This is the most widely used version.
#include <SDL3/SDL_log.h>
#include <stdio.h> #include <stdio.h>
#include <windows.h>
// FUNCTION: BETA10 0x10124cb9 // FUNCTION: BETA10 0x10124cb9
int DebugHeapState() int DebugHeapState()
@ -19,11 +19,9 @@ int DebugHeapState()
void _MxTrace(const char* format, ...) void _MxTrace(const char* format, ...)
{ {
va_list args; va_list args;
char buffer[256];
va_start(args, format); va_start(args, format);
_vsnprintf(buffer, 256, format, args); SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_TRACE, format, args);
OutputDebugString(buffer);
va_end(args); va_end(args);
} }

View File

@ -3,6 +3,7 @@
#include "decomp.h" #include "decomp.h"
#include <SDL3/SDL_platform_defines.h> #include <SDL3/SDL_platform_defines.h>
#include <SDL3/SDL_stdinc.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -90,14 +91,14 @@ void MxString::Reverse()
// FUNCTION: BETA10 0x1012c537 // FUNCTION: BETA10 0x1012c537
void MxString::ToUpperCase() void MxString::ToUpperCase()
{ {
strupr(this->m_data); SDL_strupr(this->m_data);
} }
// FUNCTION: LEGO1 0x100ae4a0 // FUNCTION: LEGO1 0x100ae4a0
// FUNCTION: BETA10 0x1012c55c // FUNCTION: BETA10 0x1012c55c
void MxString::ToLowerCase() void MxString::ToLowerCase()
{ {
strlwr(this->m_data); SDL_strlwr(this->m_data);
} }
// FUNCTION: LEGO1 0x100ae4b0 // FUNCTION: LEGO1 0x100ae4b0

View File

@ -1,6 +1,6 @@
#include "mxtimer.h" #include "mxtimer.h"
#include <windows.h> #include <SDL3/SDL_timer.h>
// GLOBAL: LEGO1 0x10101414 // GLOBAL: LEGO1 0x10101414
// GLOBAL: BETA10 0x10201f84 // GLOBAL: BETA10 0x10201f84
@ -14,7 +14,7 @@ MxLong MxTimer::g_lastTimeTimerStarted = 0;
MxTimer::MxTimer() MxTimer::MxTimer()
{ {
m_isRunning = FALSE; m_isRunning = FALSE;
m_startTime = timeGetTime(); m_startTime = SDL_GetTicks();
InitLastTimeCalculated(); InitLastTimeCalculated();
} }
@ -22,7 +22,7 @@ MxTimer::MxTimer()
// FUNCTION: BETA10 0x1012bf23 // FUNCTION: BETA10 0x1012bf23
MxLong MxTimer::GetRealTime() MxLong MxTimer::GetRealTime()
{ {
MxTimer::g_lastTimeCalculated = timeGetTime(); MxTimer::g_lastTimeCalculated = SDL_GetTicks();
return MxTimer::g_lastTimeCalculated - m_startTime; return MxTimer::g_lastTimeCalculated - m_startTime;
} }

View File

@ -9,6 +9,7 @@
#include "mxpresenterlist.h" #include "mxpresenterlist.h"
#include "mxrect32.h" #include "mxrect32.h"
#include <SDL3/SDL_stdinc.h>
#include <assert.h> #include <assert.h>
// GLOBAL: LEGO1 0x101020e8 // GLOBAL: LEGO1 0x101020e8
@ -71,7 +72,7 @@ void MakeSourceName(char* p_output, const char* p_input)
strcpy(p_output, p_input); strcpy(p_output, p_input);
strlwr(p_output); SDL_strlwr(p_output);
char* extLoc = strstr(p_output, ".si"); char* extLoc = strstr(p_output, ".si");
if (extLoc) { if (extLoc) {
@ -94,7 +95,7 @@ MxBool KeyValueStringParse(char* p_output, const char* p_command, const char* p_
for (char* token = strtok(string, ", \t\r\n:"); token; token = strtok(NULL, ", \t\r\n:")) { for (char* token = strtok(string, ", \t\r\n:"); token; token = strtok(NULL, ", \t\r\n:")) {
len -= (strlen(token) + 1); len -= (strlen(token) + 1);
if (strcmpi(token, p_command) == 0) { if (SDL_strcasecmp(token, p_command) == 0) {
if (p_output && len > 0) { if (p_output && len > 0) {
char* output = p_output; char* output = p_output;
char* cur = &token[strlen(p_command)]; char* cur = &token[strlen(p_command)];

View File

@ -3,7 +3,7 @@
#include "decomp.h" #include "decomp.h"
DECOMP_SIZE_ASSERT(MxOmniCreateFlags, 0x02) DECOMP_SIZE_ASSERT(MxOmniCreateFlags, 0x02)
//
// FUNCTION: LEGO1 0x100b0a30 // FUNCTION: LEGO1 0x100b0a30
// FUNCTION: BETA10 0x10130a1c // FUNCTION: BETA10 0x10130a1c
MxOmniCreateFlags::MxOmniCreateFlags() MxOmniCreateFlags::MxOmniCreateFlags()

View File

@ -8,13 +8,13 @@ DECOMP_SIZE_ASSERT(MxOmniCreateParam, 0x40)
// FUNCTION: BETA10 0x10130b6b // FUNCTION: BETA10 0x10130b6b
MxOmniCreateParam::MxOmniCreateParam( MxOmniCreateParam::MxOmniCreateParam(
const char* p_mediaPath, const char* p_mediaPath,
struct HWND__* p_windowHandle, HWND p_windowHandle,
MxVideoParam& p_vparam, MxVideoParam& p_vparam,
MxOmniCreateFlags p_flags MxOmniCreateFlags p_flags
) )
{ {
this->m_mediaPath = p_mediaPath; this->m_mediaPath = p_mediaPath;
this->m_windowHandle = (HWND) p_windowHandle; this->m_windowHandle = p_windowHandle;
this->m_videoParam = p_vparam; this->m_videoParam = p_vparam;
this->m_createFlags = p_flags; this->m_createFlags = p_flags;
} }

View File

@ -92,11 +92,11 @@ MxResult MxDiskStreamProvider::SetResourceToGet(MxStreamController* p_resource)
m_pFile = new MxDSFile(path.GetData(), 0); m_pFile = new MxDSFile(path.GetData(), 0);
if (m_pFile != NULL) { if (m_pFile != NULL) {
if (m_pFile->Open(OF_READ) != 0) { if (m_pFile->Open(MxDSFile::e_openRead) != 0) {
path = MxString(MxOmni::GetCD()) + p_resource->GetAtom().GetInternal() + ".si"; path = MxString(MxOmni::GetCD()) + p_resource->GetAtom().GetInternal() + ".si";
m_pFile->SetFileName(path.GetData()); m_pFile->SetFileName(path.GetData());
if (m_pFile->Open(OF_READ) != 0) { if (m_pFile->Open(MxDSFile::e_openRead) != 0) {
goto done; goto done;
} }
} }

View File

@ -69,11 +69,11 @@ MxResult MxRAMStreamProvider::SetResourceToGet(MxStreamController* p_resource)
m_pFile = new MxDSFile(path.GetData(), 0); m_pFile = new MxDSFile(path.GetData(), 0);
if (m_pFile != NULL) { if (m_pFile != NULL) {
if (m_pFile->Open(OF_READ) != 0) { if (m_pFile->Open(MxDSFile::e_openRead) != 0) {
path = MxString(MxOmni::GetCD()) + p_resource->GetAtom().GetInternal() + ".si"; path = MxString(MxOmni::GetCD()) + p_resource->GetAtom().GetInternal() + ".si";
m_pFile->SetFileName(path.GetData()); m_pFile->SetFileName(path.GetData());
if (m_pFile->Open(OF_READ) != 0) { if (m_pFile->Open(MxDSFile::e_openRead) != 0) {
goto done; goto done;
} }
} }

View File

@ -175,11 +175,11 @@ MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap)
MxLong MxBitmap::Read(const char* p_filename) MxLong MxBitmap::Read(const char* p_filename)
{ {
MxResult result = FAILURE; MxResult result = FAILURE;
HANDLE handle = 0; SDL_IOStream* handle;
handle = CreateFileA(p_filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); handle = SDL_IOFromFile(p_filename, "rb");
if (handle == INVALID_HANDLE_VALUE) { if (handle == NULL) {
goto done; goto done;
} }
@ -191,7 +191,7 @@ MxLong MxBitmap::Read(const char* p_filename)
done: done:
if (handle) { if (handle) {
CloseHandle(handle); SDL_CloseIO(handle);
} }
return result; return result;
@ -199,15 +199,14 @@ MxLong MxBitmap::Read(const char* p_filename)
// FUNCTION: LEGO1 0x100bcd60 // FUNCTION: LEGO1 0x100bcd60
// FUNCTION: BETA10 0x1013d169 // FUNCTION: BETA10 0x1013d169
MxResult MxBitmap::LoadFile(HANDLE p_handle) MxResult MxBitmap::LoadFile(SDL_IOStream* p_handle)
{ {
MxResult result = FAILURE; MxResult result = FAILURE;
MxLong unused = 0; MxLong unused = 0;
MxLong size; MxLong size;
DWORD bytesRead;
BITMAPFILEHEADER hdr; BITMAPFILEHEADER hdr;
if (!ReadFile(p_handle, &hdr, sizeof(hdr), &bytesRead, NULL)) { if (!SDL_ReadIO(p_handle, &hdr, sizeof(hdr))) {
goto done; goto done;
} }
@ -220,7 +219,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle)
goto done; goto done;
} }
if (!ReadFile(p_handle, m_info, MxBitmapInfoSize(), &bytesRead, NULL)) { if (!SDL_ReadIO(p_handle, m_info, MxBitmapInfoSize())) {
goto done; goto done;
} }
@ -234,7 +233,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle)
goto done; goto done;
} }
if (!ReadFile(p_handle, m_data, size, &bytesRead, NULL)) { if (!SDL_ReadIO(p_handle, m_data, size)) {
goto done; goto done;
} }

View File

@ -8,6 +8,7 @@
#include "mxutilities.h" #include "mxutilities.h"
#include "mxvideomanager.h" #include "mxvideomanager.h"
#include <SDL3/SDL_log.h>
#include <assert.h> #include <assert.h>
#include <windows.h> #include <windows.h>
@ -834,7 +835,7 @@ void MxDisplaySurface::Display(MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p
m_ddSurface2->Unlock(ddsd.lpSurface); m_ddSurface2->Unlock(ddsd.lpSurface);
} }
else { else {
OutputDebugString("MxDisplaySurface::Display error\n"); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "MxDisplaySurface::Display error\n");
} }
} }
m_ddSurface1->Flip(NULL, DDFLIP_WAIT); m_ddSurface1->Flip(NULL, DDFLIP_WAIT);

View File

@ -12,6 +12,8 @@
#include "mxutilities.h" #include "mxutilities.h"
#include "mxvideomanager.h" #include "mxvideomanager.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c); DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c);
// FUNCTION: LEGO1 0x100b9c70 // FUNCTION: LEGO1 0x100b9c70
@ -209,7 +211,7 @@ void MxStillPresenter::ParseExtra()
char output[512]; char output[512];
if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) { if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) {
if (strcmpi(output, "FALSE") == 0) { if (SDL_strcasecmp(output, "FALSE") == 0) {
Enable(FALSE); Enable(FALSE);
} }
} }

View File

@ -2,6 +2,7 @@
#define VIEWMANAGER_H #define VIEWMANAGER_H
#include "decomp.h" #include "decomp.h"
#include "lego1_export.h"
#include "realtime/realtimeview.h" #include "realtime/realtimeview.h"
#include "viewroi.h" #include "viewroi.h"
@ -22,7 +23,7 @@ class ViewManager {
virtual ~ViewManager(); virtual ~ViewManager();
void Remove(ViewROI* p_roi); void Remove(ViewROI* p_roi);
void RemoveAll(ViewROI* p_roi); LEGO1_EXPORT void RemoveAll(ViewROI* p_roi);
unsigned int IsBoundingBoxInFrustum(const BoundingBox& p_bounding_box); unsigned int IsBoundingBoxInFrustum(const BoundingBox& p_bounding_box);
void UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und); void UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und);
void RemoveROIDetailFromScene(ViewROI* p_roi); void RemoveROIDetailFromScene(ViewROI* p_roi);