diff --git a/CMakeLists.txt b/CMakeLists.txt index 616fe607..bab744f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,19 +60,6 @@ if (ENABLE_CLANG_TIDY) set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_BIN}") 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) if(ISLE_WERROR) set(compiler_option "-Werror=${WARNING}") @@ -104,14 +91,11 @@ endif() 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_BUILD_APP "Build ISLE.EXE application" ON) 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}) 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 d3drm from wine: ${ISLE_D3DRM_FROM_WINE}") @@ -127,8 +111,22 @@ add_subdirectory(3rdparty/d3drm EXCLUDE_FROM_ALL) add_library(Vec::Vec INTERFACE IMPORTED) 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 $<$:$>) + target_link_libraries(${NAME}-interface INTERFACE $<$:DirectX5::DirectX5> SDL3::SDL3) + target_compile_definitions(${NAME}-objects PRIVATE $<$:DIRECTX5_SDK>) + target_compile_definitions(${NAME}-objects PRIVATE $<$:D3DRM_WINE>) +endmacro() + +add_lego1_static_library(tglrl LEGO1/tgl/d3drm/camera.cpp LEGO1/tgl/d3drm/device.cpp LEGO1/tgl/d3drm/group.cpp @@ -139,90 +137,74 @@ add_library(tglrl STATIC LEGO1/tgl/d3drm/texture.cpp LEGO1/tgl/d3drm/view.cpp ) -register_lego1_target(tglrl) -set_property(TARGET tglrl PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$:d>") -target_include_directories(tglrl PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") +target_include_directories(tglrl-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") if(ISLE_D3DRM_FROM_WINE) - target_link_libraries(tglrl PRIVATE d3drm-wine) + target_link_libraries(tglrl-interface INTERFACE d3drm-wine) else() - target_link_libraries(tglrl PRIVATE d3drm) + target_link_libraries(tglrl-interface INTERFACE d3drm) endif() -add_library(realtime STATIC +add_lego1_static_library(realtime LEGO1/realtime/matrix.cpp LEGO1/realtime/orientableroi.cpp LEGO1/realtime/realtime.cpp LEGO1/realtime/realtimeview.cpp LEGO1/realtime/vector.cpp ) -register_lego1_target(realtime) -set_property(TARGET realtime PROPERTY ARCHIVE_OUTPUT_NAME "realtime$<$:d>") -target_include_directories(realtime PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") -target_link_libraries(realtime PRIVATE Vec::Vec) +target_include_directories(realtime-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(realtime-interface INTERFACE Vec::Vec) -add_library(viewmanager STATIC +add_lego1_static_library(viewmanager LEGO1/viewmanager/viewlod.cpp LEGO1/viewmanager/viewlodlist.cpp LEGO1/viewmanager/viewmanager.cpp LEGO1/viewmanager/viewroi.cpp ) -register_lego1_target(viewmanager) -set_property(TARGET viewmanager PROPERTY ARCHIVE_OUTPUT_NAME "viewmanager$<$:d>") -target_include_directories(viewmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") -target_link_libraries(viewmanager PRIVATE Vec::Vec) +target_include_directories(viewmanager-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(viewmanager-interface INTERFACE Vec::Vec) -add_library(mxdirectx STATIC +add_lego1_static_library(mxdirectx LEGO1/mxdirectx/mxdirect3d.cpp LEGO1/mxdirectx/mxdirectdraw.cpp LEGO1/mxdirectx/mxdirectxinfo.cpp LEGO1/mxdirectx/legodxinfo.cpp ) -register_lego1_target(mxdirectx) -set_property(TARGET mxdirectx PROPERTY ARCHIVE_OUTPUT_NAME "MxDirectX$<$:d>") -target_include_directories(mxdirectx PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") -target_link_libraries(mxdirectx PRIVATE ddraw) +target_include_directories(mxdirectx-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(mxdirectx-interface INTERFACE ddraw) -add_library(roi STATIC +add_lego1_static_library(roi LEGO1/lego/sources/roi/legolod.cpp LEGO1/lego/sources/roi/legoroi.cpp ) -register_lego1_target(roi) -set_property(TARGET roi PROPERTY ARCHIVE_OUTPUT_NAME "roi$<$:d>") -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) +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") +target_link_libraries(roi-interface INTERFACE viewmanager-interface Vec::Vec) -add_library(geom STATIC +add_lego1_static_library(geom LEGO1/lego/sources/geom/legoedge.cpp LEGO1/lego/sources/geom/legounkown100db7f4.cpp LEGO1/lego/sources/geom/legoweedge.cpp LEGO1/lego/sources/geom/legowegedge.cpp ) -register_lego1_target(geom) -set_property(TARGET geom PROPERTY ARCHIVE_OUTPUT_NAME "geom$<$:d>") -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) +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") +target_link_libraries(geom-interface INTERFACE) -add_library(shape STATIC +add_lego1_static_library(shape LEGO1/lego/sources/shape/legocolor.cpp LEGO1/lego/sources/shape/legobox.cpp LEGO1/lego/sources/shape/legomesh.cpp LEGO1/lego/sources/shape/legosphere.cpp LEGO1/lego/sources/shape/legovertex.cpp ) -register_lego1_target(shape) -set_property(TARGET shape PROPERTY ARCHIVE_OUTPUT_NAME "shape$<$:d>") -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) +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") +target_link_libraries(shape-interface INTERFACE) -add_library(anim STATIC +add_lego1_static_library(anim LEGO1/lego/sources/anim/legoanim.cpp ) -register_lego1_target(anim) -set_property(TARGET anim PROPERTY ARCHIVE_OUTPUT_NAME "anim$<$:d>") -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) +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") +target_link_libraries(anim-interface INTERFACE) -add_library(misc STATIC +add_lego1_static_library(misc LEGO1/lego/sources/misc/legocontainer.cpp LEGO1/lego/sources/misc/legoimage.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/legounknown.cpp ) -register_lego1_target(misc) -set_property(TARGET misc PROPERTY ARCHIVE_OUTPUT_NAME "misc$<$:d>") -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) +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") +target_link_libraries(misc-interface INTERFACE) -add_library(3dmanager STATIC +add_lego1_static_library(3dmanager LEGO1/lego/sources/3dmanager/lego3dmanager.cpp LEGO1/lego/sources/3dmanager/lego3dview.cpp LEGO1/lego/sources/3dmanager/legoview1.cpp LEGO1/lego/sources/3dmanager/tglsurface.cpp ) -register_lego1_target(3dmanager) -set_property(TARGET 3dmanager PROPERTY ARCHIVE_OUTPUT_NAME "3dmanager$<$:d>") -target_include_directories(3dmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") -target_link_libraries(3dmanager PRIVATE Vec::Vec) +target_include_directories(3dmanager-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(3dmanager-interface INTERFACE Vec::Vec) -add_library(omni STATIC +add_lego1_static_library(omni LEGO1/omni/src/action/mxdsaction.cpp LEGO1/omni/src/action/mxdsanim.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/mxvideopresenter.cpp ) -register_lego1_target(omni) -set_property(TARGET omni PROPERTY ARCHIVE_OUTPUT_NAME "omni$<$:d>") -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) +target_include_directories(omni-interface INTERFACE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(omni-interface INTERFACE winmm libsmacker miniaudio) -add_library(lego1 SHARED +add_lego1_static_library(lego1_impl LEGO1/define.cpp LEGO1/lego/legoomni/src/actors/act2actor.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/registrationbook.cpp LEGO1/lego/legoomni/src/worlds/score.cpp - LEGO1/main.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) - target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500) +if(MINGW) + target_compile_definitions(lego1_impl-interface INTERFACE DIRECTINPUT_VERSION=0x0500) endif() -if (MSVC) - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_sources(lego1 PRIVATE LEGO1/LegoOmni.def) - else() - target_sources(lego1 PRIVATE LEGO1/LegoOmni64.def) - endif() -else() - 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 $<$:$>) - target_link_libraries(${tgt} PRIVATE $<$:DirectX5::DirectX5> SDL3::SDL3) - target_compile_definitions(${tgt} PRIVATE $<$:DIRECTX5_SDK>) - target_compile_definitions(${tgt} PRIVATE $<$:D3DRM_WINE>) +set(lego1_objects) +set(lego1_link_libraries dxguid d3drm_guid) +foreach(lego1_library IN LISTS lego1_targets) + message("lego1_library:${lego1_library}") + target_compile_definitions(${lego1_library}-objects PRIVATE LEGO1_DLL) + list(APPEND lego1_objects $) + list(APPEND lego1_link_libraries ${lego1_library}-interface) endforeach() +add_library(lego1 SHARED + LEGO1/main.cpp + ${lego1_objects} +) +target_link_libraries(lego1 PUBLIC ${lego1_link_libraries}) # Make sure filenames are ALL CAPS set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1) @@ -538,7 +506,7 @@ endif() if (MSVC) 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) target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS") endif() @@ -548,8 +516,8 @@ if (MSVC) endif() # Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428") - foreach(tgt IN LISTS lego1_targets) - target_compile_options(${tgt} PRIVATE "-Zc:__cplusplus") + foreach(tgt IN LISTS lego1_interface_targets) + target_compile_options(${tgt} INTERFACE "-Zc:__cplusplus") endforeach() if (TARGET isle) target_compile_options(isle PRIVATE "-Zc:__cplusplus") @@ -565,73 +533,6 @@ if(MSVC) target_link_options(lego1 PRIVATE "/SAFESEH:NO") 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$<$:Debug>") - endif() - - # Equivalent to target_compile_options(... PRIVATE "/MT$<$:d>") - set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$: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) if(EXISTS "${CLANGFORMAT_BIN}") execute_process(COMMAND "${CLANGFORMAT_BIN}" --version diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index ed235783..10a06a6a 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -185,13 +185,11 @@ MxS32 IsleApp::SetupLegoOmni() #ifdef COMPAT_MODE MxS32 failure; { - MxOmniCreateParam param(mediaPath, (struct HWND__*) hwnd, m_videoParam, MxOmniCreateFlags()); + MxOmniCreateParam param(mediaPath, hwnd, m_videoParam, MxOmniCreateFlags()); failure = Lego()->Create(param) == FAILURE; } #else - MxS32 failure = - Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__*) hwnd, m_videoParam, MxOmniCreateFlags())) == - FAILURE; + MxS32 failure = Lego()->Create(MxOmniCreateParam(mediaPath, hwnd, m_videoParam, MxOmniCreateFlags())) == FAILURE; #endif if (!failure) { diff --git a/ISLE/isleapp.h b/ISLE/isleapp.h index f197b806..a45c9949 100644 --- a/ISLE/isleapp.h +++ b/ISLE/isleapp.h @@ -1,6 +1,7 @@ #ifndef ISLEAPP_H #define ISLEAPP_H +#include "lego1_export.h" #include "legoutils.h" #include "mxtypes.h" #include "mxvideoparam.h" diff --git a/LEGO1/LegoOmni.def b/LEGO1/LegoOmni.def deleted file mode 100644 index 238bb6f2..00000000 --- a/LEGO1/LegoOmni.def +++ /dev/null @@ -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 diff --git a/LEGO1/LegoOmni.mingw.def b/LEGO1/LegoOmni.mingw.def deleted file mode 100644 index dbd07f3e..00000000 --- a/LEGO1/LegoOmni.mingw.def +++ /dev/null @@ -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_ diff --git a/LEGO1/LegoOmni64.def b/LEGO1/LegoOmni64.def deleted file mode 100644 index e0717e35..00000000 --- a/LEGO1/LegoOmni64.def +++ /dev/null @@ -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 diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 49fd4155..70ffc7f6 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -2,6 +2,7 @@ #define LEGOANIMATIONMANAGER_H #include "decomp.h" +#include "lego1_export.h" #include "legolocations.h" #include "legomain.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); MxBool FUN_10064ee0(MxU32 p_objectId); - static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); + LEGO1_EXPORT static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); // SYNTHETIC: LEGO1 0x1005ed10 // LegoAnimationManager::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/legobuildingmanager.h b/LEGO1/lego/legoomni/include/legobuildingmanager.h index bac64396..a529a8d3 100644 --- a/LEGO1/lego/legoomni/include/legobuildingmanager.h +++ b/LEGO1/lego/legoomni/include/legobuildingmanager.h @@ -2,6 +2,7 @@ #define LEGOBUILDINGMANAGER_H #include "decomp.h" +#include "lego1_export.h" #include "misc/legotypes.h" #include "mxcore.h" @@ -63,7 +64,7 @@ class LegoBuildingManager : public MxCore { return "LegoBuildingManager"; } - static void configureLegoBuildingManager(MxS32); + LEGO1_EXPORT static void configureLegoBuildingManager(MxS32); static void SetCustomizeAnimFile(const char* p_value); void Init(); diff --git a/LEGO1/lego/legoomni/include/legocachesoundmanager.h b/LEGO1/lego/legoomni/include/legocachesoundmanager.h index dd9df741..2f9f851b 100644 --- a/LEGO1/lego/legoomni/include/legocachesoundmanager.h +++ b/LEGO1/lego/legoomni/include/legocachesoundmanager.h @@ -6,6 +6,8 @@ #include "mxstl/stlcompat.h" #include "mxtypes.h" +#include + #pragma warning(disable : 4237) // SIZE 0x08 @@ -38,7 +40,7 @@ struct LegoCacheSoundEntry { struct Set100d6b4cComparator { 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; } }; diff --git a/LEGO1/lego/legoomni/include/legocarbuild.h b/LEGO1/lego/legoomni/include/legocarbuild.h index 336f67de..81e63150 100644 --- a/LEGO1/lego/legoomni/include/legocarbuild.h +++ b/LEGO1/lego/legoomni/include/legocarbuild.h @@ -5,6 +5,8 @@ #include "legostate.h" #include "legoworld.h" +#include + class LegoCarBuildAnimPresenter; class LegoControlManagerNotificationParam; class LegoEventNotificationParam; @@ -176,7 +178,7 @@ class LegoCarBuild : public LegoWorld { MxU8 m_unk0x109; // 0x109 MxU16 m_unk0x10a; // 0x10a - DWORD m_unk0x10c; // 0x10c + Uint64 m_unk0x10c; // 0x10c LegoROI* m_unk0x110; // 0x110 BoundingSphere m_unk0x114; // 0x114 MxMatrix m_unk0x12c; // 0x12c diff --git a/LEGO1/lego/legoomni/include/legocharactermanager.h b/LEGO1/lego/legoomni/include/legocharactermanager.h index b96f2e66..3b04e6e0 100644 --- a/LEGO1/lego/legoomni/include/legocharactermanager.h +++ b/LEGO1/lego/legoomni/include/legocharactermanager.h @@ -6,6 +6,8 @@ #include "mxtypes.h" #include "roi/legoroi.h" +#include + class CustomizeAnimFileVariable; class LegoActor; class LegoExtraActor; @@ -15,7 +17,7 @@ class LegoROI; #pragma warning(disable : 4237) 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 diff --git a/LEGO1/lego/legoomni/include/legogamestate.h b/LEGO1/lego/legoomni/include/legogamestate.h index b7eb47d9..8051f6c6 100644 --- a/LEGO1/lego/legoomni/include/legogamestate.h +++ b/LEGO1/lego/legoomni/include/legogamestate.h @@ -3,6 +3,7 @@ #include "actionsfwd.h" #include "decomp.h" +#include "lego1_export.h" #include "mxtypes.h" #include @@ -144,24 +145,24 @@ class LegoGameState { undefined2 m_unk0x372; // 0x372 }; - LegoGameState(); + LEGO1_EXPORT LegoGameState(); ~LegoGameState(); void SetActor(MxU8 p_actorId); void RemoveActor(); void ResetROI(); - MxResult Save(MxULong); + LEGO1_EXPORT MxResult Save(MxULong); MxResult DeleteState(); MxResult Load(MxULong); - void SerializePlayersInfo(MxS16 p_flags); + LEGO1_EXPORT void SerializePlayersInfo(MxS16 p_flags); MxResult AddPlayer(Username& p_player); void SwitchPlayer(MxS16 p_playerId); MxS16 FindPlayer(Username& p_player); - void SerializeScoreHistory(MxS16 p_flags); - void SetSavePath(char*); + LEGO1_EXPORT void SerializeScoreHistory(MxS16 p_flags); + LEGO1_EXPORT void SetSavePath(char*); LegoState* GetState(const char* p_stateName); LegoState* CreateState(const char* p_stateName); diff --git a/LEGO1/lego/legoomni/include/legoinputmanager.h b/LEGO1/lego/legoomni/include/legoinputmanager.h index b1739110..f0d1d473 100644 --- a/LEGO1/lego/legoomni/include/legoinputmanager.h +++ b/LEGO1/lego/legoomni/include/legoinputmanager.h @@ -2,6 +2,7 @@ #define LEGOINPUTMANAGER_H #include "decomp.h" +#include "lego1_export.h" #include "legoeventnotificationparam.h" #include "mxlist.h" #include "mxpresenter.h" @@ -85,7 +86,7 @@ class LegoInputManager : public MxPresenter { LegoInputManager(); ~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 UnRegister(MxCore*); diff --git a/LEGO1/lego/legoomni/include/legomain.h b/LEGO1/lego/legoomni/include/legomain.h index 1ab6c2ee..c7126f85 100644 --- a/LEGO1/lego/legoomni/include/legomain.h +++ b/LEGO1/lego/legoomni/include/legomain.h @@ -2,6 +2,7 @@ #define LEGOMAIN_H #include "compat.h" +#include "lego1_export.h" #include "mxdsaction.h" #include "mxomni.h" @@ -133,8 +134,8 @@ class LegoOmni : public MxOmni { void AddWorld(LegoWorld* p_world); void DeleteWorld(LegoWorld* p_world); void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags); - void CreateBackgroundAudio(); - void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId); + LEGO1_EXPORT void CreateBackgroundAudio(); + LEGO1_EXPORT void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId); MxResult RegisterWorlds(); const char* GetWorldName(LegoOmni::World p_id); MxAtomId* GetWorldAtom(LegoOmni::World p_id); @@ -142,8 +143,8 @@ class LegoOmni : public MxOmni { void DeleteAction(); static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&); - static void CreateInstance(); - static LegoOmni* GetInstance(); + LEGO1_EXPORT static void CreateInstance(); + LEGO1_EXPORT static LegoOmni* GetInstance(); LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; } LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; } diff --git a/LEGO1/lego/legoomni/include/legomodelpresenter.h b/LEGO1/lego/legoomni/include/legomodelpresenter.h index 7f9886a9..3b754872 100644 --- a/LEGO1/lego/legoomni/include/legomodelpresenter.h +++ b/LEGO1/lego/legoomni/include/legomodelpresenter.h @@ -1,6 +1,7 @@ #ifndef LEGOMODELPRESENTER_H #define LEGOMODELPRESENTER_H +#include "lego1_export.h" #include "mxvideopresenter.h" class LegoROI; @@ -18,7 +19,7 @@ class LegoModelPresenter : public MxVideoPresenter { // FUNCTION: LEGO1 0x10067a10 ~LegoModelPresenter() override { Destroy(TRUE); } - static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig); + LEGO1_EXPORT static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig); // FUNCTION: BETA10 0x100a7180 static const char* HandlerClassName() diff --git a/LEGO1/lego/legoomni/include/legopartpresenter.h b/LEGO1/lego/legoomni/include/legopartpresenter.h index 76285f49..bf0bed16 100644 --- a/LEGO1/lego/legoomni/include/legopartpresenter.h +++ b/LEGO1/lego/legoomni/include/legopartpresenter.h @@ -1,6 +1,7 @@ #ifndef LEGOPARTPRESENTER_H #define LEGOPARTPRESENTER_H +#include "lego1_export.h" #include "legonamedpartlist.h" #include "mxmediapresenter.h" @@ -37,7 +38,7 @@ class LegoPartPresenter : public MxMediaPresenter { MxResult AddToManager() override; // vtable+0x34 void Destroy() override; // vtable+0x38 - static void configureLegoPartPresenter(MxS32, MxS32); + LEGO1_EXPORT static void configureLegoPartPresenter(MxS32, MxS32); // SYNTHETIC: LEGO1 0x1000d060 // LegoPartPresenter::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/legovideomanager.h b/LEGO1/lego/legoomni/include/legovideomanager.h index e7848c02..2f74bf56 100644 --- a/LEGO1/lego/legoomni/include/legovideomanager.h +++ b/LEGO1/lego/legoomni/include/legovideomanager.h @@ -2,6 +2,7 @@ #define LEGOVIDEOMANAGER_H #include "decomp.h" +#include "lego1_export.h" #include "legophonemelist.h" #include "mxvideomanager.h" @@ -26,11 +27,11 @@ class LegoVideoManager : public MxVideoManager { LegoVideoManager(); ~LegoVideoManager() override; - int EnableRMDevice(); + LEGO1_EXPORT int EnableRMDevice(); int DisableRMDevice(); void EnableFullScreenMovie(MxBool p_enable); - void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale); - void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY); + LEGO1_EXPORT void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale); + LEGO1_EXPORT void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY); void ToggleFPS(MxBool p_visible); MxResult Tickle() override; // vtable+0x08 diff --git a/LEGO1/lego/legoomni/include/legoworldpresenter.h b/LEGO1/lego/legoomni/include/legoworldpresenter.h index f0657f7c..94dd03cf 100644 --- a/LEGO1/lego/legoomni/include/legoworldpresenter.h +++ b/LEGO1/lego/legoomni/include/legoworldpresenter.h @@ -1,6 +1,7 @@ #ifndef LEGOWORLDPRESENTER_H #define LEGOWORLDPRESENTER_H +#include "lego1_export.h" #include "legoentitypresenter.h" #include @@ -16,7 +17,7 @@ class LegoWorldPresenter : public LegoEntityPresenter { LegoWorldPresenter(); ~LegoWorldPresenter() override; // vtable+0x00 - static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality); + LEGO1_EXPORT static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality); // FUNCTION: BETA10 0x100e41c0 static const char* HandlerClassName() diff --git a/LEGO1/lego/legoomni/include/misc.h b/LEGO1/lego/legoomni/include/misc.h index 374b83f2..b9f0fb5f 100644 --- a/LEGO1/lego/legoomni/include/misc.h +++ b/LEGO1/lego/legoomni/include/misc.h @@ -5,6 +5,7 @@ #include "decomp.h" // Long include path due to dependency of misc library on LegoOmni #include "lego/legoomni/include/actions/actionsfwd.h" +#include "lego1_export.h" #include "mxtypes.h" class LegoAnimationManager; @@ -31,13 +32,13 @@ class ViewManager; extern MxBool g_isWorldActive; -LegoOmni* Lego(); +LEGO1_EXPORT LegoOmni* Lego(); LegoSoundManager* SoundManager(); -LegoVideoManager* VideoManager(); -MxBackgroundAudioManager* BackgroundAudioManager(); -LegoInputManager* InputManager(); +LEGO1_EXPORT LegoVideoManager* VideoManager(); +LEGO1_EXPORT MxBackgroundAudioManager* BackgroundAudioManager(); +LEGO1_EXPORT LegoInputManager* InputManager(); LegoControlManager* ControlManager(); -LegoGameState* GameState(); +LEGO1_EXPORT LegoGameState* GameState(); LegoAnimationManager* AnimationManager(); LegoNavController* NavController(); LegoPathActor* UserActor(); @@ -57,7 +58,7 @@ void DeleteAction(); LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid); MxDSAction& GetCurrentAction(); void SetCurrentWorld(LegoWorld* p_world); -MxTransitionManager* TransitionManager(); +LEGO1_EXPORT MxTransitionManager* TransitionManager(); void PlayMusic(JukeboxScript::Script p_objectId); void SetIsWorldActive(MxBool p_isWorldActive); void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last); diff --git a/LEGO1/lego/legoomni/include/mxbackgroundaudiomanager.h b/LEGO1/lego/legoomni/include/mxbackgroundaudiomanager.h index 8cf18412..cbfdaedf 100644 --- a/LEGO1/lego/legoomni/include/mxbackgroundaudiomanager.h +++ b/LEGO1/lego/legoomni/include/mxbackgroundaudiomanager.h @@ -1,6 +1,7 @@ #ifndef MXBACKGROUNDAUDIOMANAGER_H #define MXBACKGROUNDAUDIOMANAGER_H +#include "lego1_export.h" #include "mxcore.h" #include "mxdsaction.h" #include "mxpresenter.h" @@ -43,7 +44,7 @@ class MxBackgroundAudioManager : public MxCore { void FUN_1007ef40(); void FadeInOrFadeOut(); - void Enable(MxBool p_enable); + LEGO1_EXPORT void Enable(MxBool p_enable); virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS); void Init(); diff --git a/LEGO1/lego/legoomni/include/mxtransitionmanager.h b/LEGO1/lego/legoomni/include/mxtransitionmanager.h index 2019430c..492f28a3 100644 --- a/LEGO1/lego/legoomni/include/mxtransitionmanager.h +++ b/LEGO1/lego/legoomni/include/mxtransitionmanager.h @@ -2,8 +2,10 @@ #define MXTRANSITIONMANAGER_H #include "decomp.h" +#include "lego1_export.h" #include "mxcore.h" +#include #include class MxVideoPresenter; @@ -16,7 +18,7 @@ class MxTransitionManager : public MxCore { MxTransitionManager(); ~MxTransitionManager() override; // vtable+0x00 - void SetWaitIndicator(MxVideoPresenter* p_waitIndicator); + LEGO1_EXPORT void SetWaitIndicator(MxVideoPresenter* p_waitIndicator); MxResult Tickle() override; // vtable+0x08 @@ -78,7 +80,7 @@ class MxTransitionManager : public MxCore { MxU16 m_animationTimer; // 0x34 MxU16 m_columnOrder[640]; // 0x36 MxU16 m_randomShift[480]; // 0x536 - MxULong m_systemTime; // 0x8f8 + Uint64 m_systemTime; // 0x8f8 MxS32 m_animationSpeed; // 0x8fc }; diff --git a/LEGO1/lego/legoomni/src/actors/ambulance.cpp b/LEGO1/lego/legoomni/src/actors/ambulance.cpp index cbc26dce..0244485d 100644 --- a/LEGO1/lego/legoomni/src/actors/ambulance.cpp +++ b/LEGO1/lego/legoomni/src/actors/ambulance.cpp @@ -23,6 +23,7 @@ #include "mxvariabletable.h" #include "scripts.h" +#include #include DECOMP_SIZE_ASSERT(Ambulance, 0x184) @@ -251,14 +252,14 @@ MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param) if (m_unk0x170 == 1) { 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; return 1; } 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; return 1; } diff --git a/LEGO1/lego/legoomni/src/actors/doors.cpp b/LEGO1/lego/legoomni/src/actors/doors.cpp index 1f36f91b..76e3ee97 100644 --- a/LEGO1/lego/legoomni/src/actors/doors.cpp +++ b/LEGO1/lego/legoomni/src/actors/doors.cpp @@ -6,6 +6,7 @@ #include "roi/legoroi.h" #include "tgl/tglvector.h" +#include #include 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++) { 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; } - 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; } } diff --git a/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp b/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp index cc3dec9e..8dfca16f 100644 --- a/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp +++ b/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp @@ -18,6 +18,7 @@ #include "mxtransitionmanager.h" #include "mxvariabletable.h" +#include #include DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c) @@ -164,20 +165,20 @@ MxS32 DuneBuggy::GetColorOffset(const char* p_variable) MxS32 offset = 1; const char* colorName = VariableTable()->GetVariable(p_variable); - if (strcmpi(colorName, "lego green")) { - if (!strcmpi(colorName, "lego red")) { + if (SDL_strcasecmp(colorName, "lego green")) { + if (!SDL_strcasecmp(colorName, "lego red")) { offset = 2; } - else if (!strcmpi(colorName, "lego yellow")) { + else if (!SDL_strcasecmp(colorName, "lego yellow")) { offset = 3; } - else if (!strcmpi(colorName, "lego black")) { + else if (!SDL_strcasecmp(colorName, "lego black")) { offset = 4; } - else if (!strcmpi(colorName, "lego blue")) { + else if (!SDL_strcasecmp(colorName, "lego blue")) { offset = 5; } - else if (!strcmpi(colorName, "lego white")) { + else if (!SDL_strcasecmp(colorName, "lego white")) { offset = 6; } } diff --git a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp index 4f126f2e..c483be2d 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp @@ -30,6 +30,8 @@ #include "racecar_actions.h" #include "scripts.h" +#include +#include #include #include #include @@ -559,8 +561,8 @@ MxResult LegoCarBuild::Tickle() } if (m_unk0x10a) { - DWORD time = timeGetTime(); - DWORD dTime = (time - m_unk0x10c) / 100; + Uint64 time = SDL_GetTicks(); + Uint64 dTime = (time - m_unk0x10c) / 100; if (m_carId == RaceCar_Actor) { switch (m_unk0x10a) { @@ -1316,30 +1318,30 @@ void LegoCarBuild::TogglePresentersEnabled() void LegoCarBuild::FUN_100250e0(MxBool p_enabled) { 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_Decals_Ctl->Enable(p_enabled); m_Decals_Ctl1->Enable(p_enabled); m_Decals_Ctl2->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_Decals_Ctl4->Enable(p_enabled); m_Decals_Ctl5->Enable(p_enabled); m_Decals_Ctl6->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); } - 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); } - 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); } - 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); } else if (m_Decals_Ctl) { @@ -1603,7 +1605,7 @@ void LegoCarBuild::FUN_10025720(undefined4 p_param) #endif if (m_unk0x10a != 0) { - m_unk0x10c = timeGetTime(); + m_unk0x10c = SDL_GetTicks(); } } diff --git a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp index e3729cf4..71efd0e9 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp @@ -16,6 +16,8 @@ #include "mxtimer.h" #include "realtime/realtime.h" +#include + DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c) DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150) @@ -225,7 +227,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle() for (MxS32 j = 0; j <= m_roiMapSize; 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_100a9350("lego red"); } @@ -247,7 +249,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle() for (i = 0; i < totalNodes; i++) { 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); fov = atof(&animNodeData->GetName()[strlen(animNodeData->GetName()) - 2]); break; @@ -367,7 +369,7 @@ void LegoCarBuildAnimPresenter::FUN_10079160() for (i = 0; i < totalNodes; i++) { name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName(); - strupr(name); + SDL_strupr(name); if (StringEndsOnW(name)) { 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(); if (StringEndsOnYOrN(name)) { 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]; assert(m_parts[ii].m_name); strcpy(m_parts[ii].m_name, name); @@ -515,7 +517,7 @@ void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name) MxS16 i; 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++) { if (stricmp(m_parts[i].m_name, p_name) == 0) { break; @@ -615,7 +617,7 @@ MxBool LegoCarBuildAnimPresenter::StringEndsOnYOrN(const LegoChar* p_string) // FUNCTION: BETA10 0x10072624 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 @@ -627,7 +629,7 @@ MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name) } 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 @@ -635,7 +637,7 @@ MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name) MxBool LegoCarBuildAnimPresenter::PartIsPlaced(const LegoChar* p_name) { 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; } } @@ -662,7 +664,7 @@ MxBool LegoCarBuildAnimPresenter::StringDoesNotEndOnZero(const LegoChar* p_strin const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar* p_name) { 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; } } @@ -675,7 +677,7 @@ const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar void LegoCarBuildAnimPresenter::SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId) { 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; return; } diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 00b46a31..586d1236 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -28,6 +28,7 @@ #include "realtime/realtime.h" #include "viewmanager/viewmanager.h" +#include #include #include #include @@ -745,7 +746,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId) MxBool LegoAnimationManager::FindVehicle(const char* p_name, MxU32& p_index) { 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; return TRUE; } @@ -1662,7 +1663,7 @@ MxS8 LegoAnimationManager::GetCharacterIndex(const char* p_name) MxS8 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; } } @@ -1713,7 +1714,7 @@ MxBool LegoAnimationManager::ModelExists(AnimInfo& p_info, const char* p_name) if (models != NULL && modelCount) { 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; } } @@ -2076,7 +2077,7 @@ MxBool LegoAnimationManager::FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_p MxS32 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; break; } @@ -2621,7 +2622,7 @@ MxResult LegoAnimationManager::FUN_10064380( extraIndex = i; } - if (roi != NULL && !strcmpi(roi->GetName(), p_name)) { + if (roi != NULL && !SDL_strcasecmp(roi->GetName(), p_name)) { actor = CharacterManager()->GetExtraActor(p_name); if (actor != NULL && actor->GetController() != NULL) { @@ -2639,7 +2640,7 @@ MxResult LegoAnimationManager::FUN_10064380( MxS32 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; } } @@ -2759,7 +2760,7 @@ MxResult LegoAnimationManager::FUN_10064880(const char* p_name, MxS32 p_unk0x0c, LegoROI* roi = m_extras[i].m_roi; 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_unk0x10 = p_unk0x10; return SUCCESS; diff --git a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp index 77d6f8df..53041cde 100644 --- a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp @@ -16,6 +16,7 @@ #include "roi/legolod.h" #include "viewmanager/viewmanager.h" +#include #include #include @@ -474,7 +475,7 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key) goto done; } - if (!strcmpi(p_key, "pep")) { + if (!SDL_strcasecmp(p_key, "pep")) { LegoActorInfo* pepper = GetActorInfo("pepper"); 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) { 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; } } @@ -678,7 +679,7 @@ LegoActorInfo* LegoCharacterManager::GetActorInfo(const char* p_name) MxU32 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; } } @@ -721,7 +722,7 @@ LegoROI* LegoCharacterManager::FindChildROI(LegoROI* p_roi, const char* p_name) #endif LegoROI* roi = (LegoROI*) *it; - if (!strcmpi(p_name, roi->GetName())) { + if (!SDL_strcasecmp(p_name, roi->GetName())) { return roi; } } diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 0db04109..21e12a45 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -61,6 +61,7 @@ #include "sndanim_actions.h" #include "towtrack.h" +#include #include #include @@ -1022,8 +1023,8 @@ void LegoGameState::SetROIHandlerFunction() MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen) { if (p_output != NULL && p_copyLen != 0 && - (strnicmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 || - strnicmp(p_input, "INDIR-G-", strlen("INDIR-F-")) == 0)) { + (SDL_strncasecmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 || + SDL_strncasecmp(p_input, "INDIR-G-", strlen("INDIR-F-")) == 0)) { char buf[256]; sprintf(buf, "c_%s", &p_input[strlen("INDIR-F-")]); diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index 4f9deefc..8230f4e2 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -31,6 +31,7 @@ #include "scripts.h" #include +#include #include #include #include @@ -191,11 +192,11 @@ void FUN_1003e050(LegoAnimPresenter* p_presenter) LegoAnimNodeData* data = (LegoAnimNodeData*) GetTreeNode(rootNode, i)->GetData(); - if (!strnicmp(data->GetName(), "CAM", strlen("CAM"))) { + if (!SDL_strncasecmp(data->GetName(), "CAM", strlen("CAM"))) { camData = data; cam = atof(&data->GetName()[strlen(data->GetName()) - 2]); } - else if (!strcmpi(data->GetName(), "TARGET")) { + else if (!SDL_strcasecmp(data->GetName(), "TARGET")) { targetData = data; } } @@ -231,34 +232,34 @@ Extra::ActionType MatchActionString(const char* p_str) { Extra::ActionType result = Extra::ActionType::e_unknown; - if (!strcmpi("openram", p_str)) { + if (!SDL_strcasecmp("openram", p_str)) { result = Extra::ActionType::e_openram; } - else if (!strcmpi("opendisk", p_str)) { + else if (!SDL_strcasecmp("opendisk", p_str)) { result = Extra::ActionType::e_opendisk; } - else if (!strcmpi("close", p_str)) { + else if (!SDL_strcasecmp("close", p_str)) { result = Extra::ActionType::e_close; } - else if (!strcmpi("start", p_str)) { + else if (!SDL_strcasecmp("start", p_str)) { result = Extra::ActionType::e_start; } - else if (!strcmpi("stop", p_str)) { + else if (!SDL_strcasecmp("stop", p_str)) { result = Extra::ActionType::e_stop; } - else if (!strcmpi("run", p_str)) { + else if (!SDL_strcasecmp("run", p_str)) { result = Extra::ActionType::e_run; } - else if (!strcmpi("exit", p_str)) { + else if (!SDL_strcasecmp("exit", p_str)) { result = Extra::ActionType::e_exit; } - else if (!strcmpi("enable", p_str)) { + else if (!SDL_strcasecmp("enable", p_str)) { result = Extra::ActionType::e_enable; } - else if (!strcmpi("disable", p_str)) { + else if (!SDL_strcasecmp("disable", p_str)) { result = Extra::ActionType::e_disable; } - else if (!strcmpi("notify", p_str)) { + else if (!SDL_strcasecmp("notify", p_str)) { result = Extra::ActionType::e_notify; } diff --git a/LEGO1/lego/legoomni/src/common/legovariables.cpp b/LEGO1/lego/legoomni/src/common/legovariables.cpp index 539983bf..8c5563e3 100644 --- a/LEGO1/lego/legoomni/src/common/legovariables.cpp +++ b/LEGO1/lego/legoomni/src/common/legovariables.cpp @@ -10,6 +10,8 @@ #include "misc.h" #include "roi/legoroi.h" +#include + DECOMP_SIZE_ASSERT(VisibilityVariable, 0x24) DECOMP_SIZE_ASSERT(CameraLocationVariable, 0x24) DECOMP_SIZE_ASSERT(CursorVariable, 0x24) @@ -115,10 +117,10 @@ void VisibilityVariable::SetValue(const char* p_value) char* name = strtok(NULL, g_delimiter2); MxBool show; - if (!strcmpi(instruction, g_varHIDE)) { + if (!SDL_strcasecmp(instruction, g_varHIDE)) { show = FALSE; } - else if (!strcmpi(instruction, g_varSHOW)) { + else if (!SDL_strcasecmp(instruction, g_varSHOW)) { show = TRUE; } else { @@ -160,19 +162,19 @@ void WhoAmIVariable::SetValue(const char* p_value) { MxVariable::SetValue(p_value); - if (!strcmpi(p_value, g_papa)) { + if (!SDL_strcasecmp(p_value, g_papa)) { GameState()->SetActorId(3); } - else if (!strcmpi(p_value, g_mama)) { + else if (!SDL_strcasecmp(p_value, g_mama)) { GameState()->SetActorId(2); } - else if (!strcmpi(p_value, g_pepper)) { + else if (!SDL_strcasecmp(p_value, g_pepper)) { GameState()->SetActorId(1); } - else if (!strcmpi(p_value, g_nick)) { + else if (!SDL_strcasecmp(p_value, g_nick)) { GameState()->SetActorId(4); } - else if (!strcmpi(p_value, g_laura)) { + else if (!SDL_strcasecmp(p_value, g_laura)) { GameState()->SetActorId(5); } } diff --git a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp index db96f60a..57580a67 100644 --- a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp @@ -9,6 +9,8 @@ #include "mxutilities.h" #include "mxvideopresenter.h" +#include + DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c) // FUNCTION: LEGO1 0x10043f50 @@ -253,15 +255,15 @@ void MxControlPresenter::ParseExtra() if (KeyValueStringParse(output, g_strSTYLE, extraCopy)) { char* str = strtok(output, g_parseExtraTokens); - if (!strcmpi(str, g_strTOGGLE)) { + if (!SDL_strcasecmp(str, g_strTOGGLE)) { m_unk0x4c = 1; } - else if (!strcmpi(str, g_strGRID)) { + else if (!SDL_strcasecmp(str, g_strGRID)) { m_unk0x4c = 2; m_unk0x52 = 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; str = strtok(NULL, g_parseExtraTokens); @@ -281,7 +283,7 @@ void MxControlPresenter::ParseExtra() } if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) { - if (!strcmpi(output, "FALSE")) { + if (!SDL_strcasecmp(output, "FALSE")) { Enable(FALSE); } } diff --git a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp index 566468e5..1a8dada3 100644 --- a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp @@ -12,6 +12,8 @@ #include "mxticklemanager.h" #include "mxvideopresenter.h" +#include + DECOMP_SIZE_ASSERT(MxTransitionManager, 0x900) // GLOBAL: LEGO1 0x100f4378 @@ -54,11 +56,11 @@ MxResult MxTransitionManager::GetDDrawSurfaceFromVideoManager() // vtable+0x14 // FUNCTION: LEGO1 0x1004bac0 MxResult MxTransitionManager::Tickle() { - if (m_animationSpeed + m_systemTime > timeGetTime()) { + if (m_animationSpeed + m_systemTime > SDL_GetTicks()) { return SUCCESS; } - m_systemTime = timeGetTime(); + m_systemTime = SDL_GetTicks(); switch (m_mode) { case e_noAnimation: @@ -112,7 +114,7 @@ MxResult MxTransitionManager::StartTransition( action->SetFlags(action->GetFlags() | MxDSAction::c_bit10); } - MxU32 time = timeGetTime(); + Uint64 time = SDL_GetTicks(); m_systemTime = time; m_animationSpeed = p_speed; diff --git a/LEGO1/lego/legoomni/src/control/legometerpresenter.cpp b/LEGO1/lego/legoomni/src/control/legometerpresenter.cpp index 0f45b60c..380cb7fc 100644 --- a/LEGO1/lego/legoomni/src/control/legometerpresenter.cpp +++ b/LEGO1/lego/legoomni/src/control/legometerpresenter.cpp @@ -8,6 +8,7 @@ #include "mxutilities.h" #include "mxvariabletable.h" +#include #include DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94) @@ -47,16 +48,16 @@ void LegoMeterPresenter::ParseExtra() char output[256]; 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; } - else if (!strcmpi(output, g_strRIGHT_TO_LEFT)) { + else if (!SDL_strcasecmp(output, g_strRIGHT_TO_LEFT)) { 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; } - else if (!strcmpi(output, g_strTOP_TO_BOTTOM)) { + else if (!SDL_strcasecmp(output, g_strTOP_TO_BOTTOM)) { m_layout = e_topToBottom; } } diff --git a/LEGO1/lego/legoomni/src/entity/legoactor.cpp b/LEGO1/lego/legoomni/src/entity/legoactor.cpp index 413b5171..8d7bd5de 100644 --- a/LEGO1/lego/legoomni/src/entity/legoactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoactor.cpp @@ -7,6 +7,8 @@ #include "mxutilities.h" #include "roi/legoroi.h" +#include + DECOMP_SIZE_ASSERT(LegoActor, 0x78) // GLOBAL: LEGO1 0x100f32d0 @@ -111,7 +113,7 @@ void LegoActor::ParseAction(char* 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(); 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_actorId = i; break; diff --git a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp index 3c3cd659..54113b6d 100644 --- a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp @@ -26,6 +26,7 @@ #include "realtime/realtimeview.h" #include "viewmanager/viewmanager.h" +#include #include DECOMP_SIZE_ASSERT(LegoNavController, 0x70) @@ -427,7 +428,7 @@ MxResult LegoNavController::UpdateLocation(const char* p_location) MxResult result = FAILURE; 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; LegoROI* viewROI = VideoManager()->GetViewROI(); diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index ee144513..bd0e08e3 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -27,6 +27,8 @@ #include "mxutilities.h" #include "viewmanager/viewmanager.h" +#include + DECOMP_SIZE_ASSERT(LegoWorld, 0xf8) DECOMP_SIZE_ASSERT(LegoEntityList, 0x18) DECOMP_SIZE_ASSERT(LegoEntityListCursor, 0x10) @@ -422,7 +424,7 @@ void LegoWorld::Add(MxCore* p_object) if (p_object->IsA("LegoAnimPresenter")) { LegoAnimPresenter* animPresenter = (LegoAnimPresenter*) p_object; - if (!strcmpi(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) { + if (!SDL_strcasecmp(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) { FUN_1003e050(animPresenter); 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(); - if (roi && !strcmpi(roi->GetName(), p_name)) { + if (roi && !SDL_strcasecmp(roi->GetName(), p_name)) { return entity; } } @@ -584,7 +586,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name) MxPresenter* presenter; while (cursor.Next(presenter)) { - if (!strcmpi(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) { + if (!SDL_strcasecmp(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) { return presenter; } } diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index beb4a5d2..87087a04 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -27,6 +27,7 @@ #include "mxstl/stlcompat.h" #include "mxutilities.h" +#include #include DECOMP_SIZE_ASSERT(LegoWorldPresenter, 0x54) @@ -198,7 +199,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) ReadModelDbWorlds(wdbFile, worlds, numWorlds); for (i = 0; i < numWorlds; i++) { - if (!strcmpi(worlds[i].m_worldName, p_worldName)) { + if (!SDL_strcasecmp(worlds[i].m_worldName, p_worldName)) { break; } } @@ -266,25 +267,25 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) } 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) { 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; } break; case 1: - if (strcmpi(worlds[i].m_models[j].m_modelName, "isle")) { + if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle")) { continue; } break; 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; } } } - 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 (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) { return FAILURE; diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index 1c19cd6f..fe7fc015 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -33,6 +33,8 @@ #include "scripts.h" #include "viewmanager/viewmanager.h" +#include + DECOMP_SIZE_ASSERT(LegoOmni, 0x140) DECOMP_SIZE_ASSERT(LegoOmni::WorldContainer, 0x1c) DECOMP_SIZE_ASSERT(LegoWorldList, 0x18) @@ -417,7 +419,7 @@ LegoROI* LegoOmni::FindROI(const char* p_name) const char* name = roi->GetName(); if (name != NULL) { - if (!strcmpi(name, p_name)) { + if (!SDL_strcasecmp(name, p_name)) { return roi; } } @@ -432,7 +434,7 @@ MxEntity* LegoOmni::AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter* { 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); } else { @@ -507,7 +509,7 @@ LegoOmni::World LegoOmni::GetWorldId(const char* p_key) { for (MxS32 i = 0; i < e_numWorlds; i++) { // 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(); } } diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index a36a9a53..b9c52da4 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -7,6 +7,8 @@ #include "mxticklemanager.h" #include "mxtimer.h" +#include + DECOMP_SIZE_ASSERT(LegoPathController, 0x40) DECOMP_SIZE_ASSERT(LegoPathCtrlEdge, 0x40) DECOMP_SIZE_ASSERT(LegoPathController::CtrlBoundary, 0x08) @@ -103,7 +105,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con MxS32 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_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++) { - 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_boundary = &boundary; 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) { 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]; } } diff --git a/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp b/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp index 55f6d30c..da57b366 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp @@ -127,7 +127,7 @@ void LegoPathPresenter::ParseExtra() memcpy(extraCopy, extraData, extraLength); extraCopy[extraLength] = '\0'; - strupr(extraCopy); + SDL_strupr(extraCopy); if (KeyValueStringParse(output, g_strTRIGGERS_SOURCE, extraCopy) != FALSE) { m_trigger = MxAtomId(output, e_lowerCase2); diff --git a/LEGO1/lego/legoomni/src/race/legoracers.cpp b/LEGO1/lego/legoomni/src/race/legoracers.cpp index 19706d9e..ee5e48d5 100644 --- a/LEGO1/lego/legoomni/src/race/legoracers.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracers.cpp @@ -19,6 +19,7 @@ #include "mxvariabletable.h" #include "raceskel.h" +#include #include DECOMP_SIZE_ASSERT(EdgeReference, 0x08) @@ -476,8 +477,8 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool) } if (m_userNavFlag) { - MxBool actorIsStuds = strcmpi(p_actor->GetROI()->GetName(), "studs") == 0; - MxBool actorIsRhoda = strcmpi(p_actor->GetROI()->GetName(), "rhoda") == 0; + MxBool actorIsStuds = SDL_strcasecmp(p_actor->GetROI()->GetName(), "studs") == 0; + MxBool actorIsRhoda = SDL_strcasecmp(p_actor->GetROI()->GetName(), "rhoda") == 0; MxLong time = Timer()->GetTime(); const char* soundKey = NULL; @@ -692,8 +693,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool) } if (m_userNavFlag) { - MxBool actorIsSnap = strcmpi(p_actor->GetROI()->GetName(), "snap") == 0; - MxBool actorIsValerie = strcmpi(p_actor->GetROI()->GetName(), "valerie") == 0; + MxBool actorIsSnap = SDL_strcasecmp(p_actor->GetROI()->GetName(), "snap") == 0; + MxBool actorIsValerie = SDL_strcasecmp(p_actor->GetROI()->GetName(), "valerie") == 0; MxLong time = Timer()->GetTime(); const char* soundKey = NULL; diff --git a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp index a5696b08..4d29e2dc 100644 --- a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp @@ -8,6 +8,7 @@ #include "mxmisc.h" #include "mxvariabletable.h" +#include #include // File name verified by BETA10 0x100cedf7 @@ -220,7 +221,7 @@ void LegoCarRaceActor::Animate(float p_time) if (m_unk0x0c == 0) { const char* value = VariableTable()->GetVariable(g_raceState); - if (strcmpi(value, g_racing) == 0) { + if (SDL_strcasecmp(value, g_racing) == 0) { m_unk0x0c = 1; m_lastTime = p_time - 1.0f; m_unk0x1c = p_time; diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 83572ed9..a54bc6c5 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -26,6 +26,7 @@ #include "realtime/realtime.h" #include "viewmanager/viewmanager.h" +#include #include DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc) @@ -244,7 +245,7 @@ void LegoAnimPresenter::FUN_100692b0() else if (unk0x04 == 4) { LegoChar* baseName = new LegoChar[strlen(str)]; strcpy(baseName, str + 1); - strlwr(baseName); + SDL_strlwr(baseName); LegoChar* und = FUN_10069150(str); roi = CharacterManager()->FUN_10085a80(und, baseName, TRUE); @@ -268,7 +269,7 @@ void LegoAnimPresenter::FUN_100692b0() *i = '\0'; } - strlwr(lodName); + SDL_strlwr(lodName); LegoChar* und = FUN_10069150(str); roi = CharacterManager()->CreateAutoROI(und, lodName, TRUE); @@ -315,7 +316,7 @@ void LegoAnimPresenter::FUN_100695c0() *i = '\0'; } - strlwr(lodName); + SDL_strlwr(lodName); CharacterManager()->CreateAutoROI(actorName, lodName, FALSE); FUN_100698b0(rois, actorName); @@ -370,7 +371,7 @@ LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_rois, const Leg const char* name = roi->GetName(); if (name != NULL) { - if (!strcmpi(name, str)) { + if (!SDL_strcasecmp(name, str)) { m_unk0x70->Append(roi); result = TRUE; break; @@ -392,7 +393,7 @@ LegoROI* LegoAnimPresenter::FUN_100699e0(const LegoChar* p_und) while (cursor.Next(roi)) { LegoChar* und = FUN_100697c0(roi->GetName(), NULL); - if (und != NULL && !strcmpi(und, p_und)) { + if (und != NULL && !SDL_strcasecmp(und, p_und)) { delete[] und; return roi; } @@ -430,7 +431,7 @@ void LegoAnimPresenter::FUN_10069b10() if (m_roiMap[index]->GetName() != NULL) { for (MxS32 i = 0; i < m_unk0x94; i++) { 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]; break; } diff --git a/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp b/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp index f1525a63..f85c2197 100644 --- a/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp @@ -19,6 +19,8 @@ #include "realtime/realtime.h" #include "roi/legoroi.h" +#include + DECOMP_SIZE_ASSERT(LegoModelPresenter, 0x6c) // GLOBAL: LEGO1 0x100f7ae0 @@ -98,7 +100,7 @@ MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk) storage.Read(textureName, textureNameLength); textureName[textureNameLength] = '\0'; - strlwr(textureName); + SDL_strlwr(textureName); if (textureName[0] == '^') { strcpy(textureName, textureName + 1); @@ -316,7 +318,7 @@ void LegoModelPresenter::ParseExtra() list& roiList = currentWorld->GetROIList(); for (list::iterator it = roiList.begin(); it != roiList.end(); it++) { - if (!strcmpi((*it)->GetName(), output)) { + if (!SDL_strcasecmp((*it)->GetName(), output)) { m_roi = *it; roiList.erase(it); diff --git a/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp b/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp index 87e15745..9a70c5e6 100644 --- a/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp @@ -10,6 +10,8 @@ #include "mxdssubscriber.h" #include "viewmanager/viewlodlist.h" +#include + DECOMP_SIZE_ASSERT(LegoLODList, 0x18) DECOMP_SIZE_ASSERT(LegoNamedPart, 0x14) DECOMP_SIZE_ASSERT(LegoNamedPartList, 0x18) @@ -92,7 +94,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk) storage.Read(textureName, textureNameLength); textureName[textureNameLength] = '\0'; - strlwr(textureName); + SDL_strlwr(textureName); if (textureName[0] == '^') { strcpy(textureName, textureName + 1); @@ -166,7 +168,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk) } roiName[roiNameLength] = '\0'; - strlwr(roiName); + SDL_strlwr(roiName); if (storage.Read(&numLODs, sizeof(numLODs)) != SUCCESS) { goto done; diff --git a/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp b/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp index 0c76b447..6d4fe81e 100644 --- a/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp @@ -9,6 +9,8 @@ #include "mxdirectx/mxdirect3d.h" #include "mxdssubscriber.h" +#include + DECOMP_SIZE_ASSERT(LegoTexturePresenter, 0x54) DECOMP_SIZE_ASSERT(LegoNamedTexture, 0x14) DECOMP_SIZE_ASSERT(LegoNamedTextureList, 0x18) @@ -57,7 +59,7 @@ MxResult LegoTexturePresenter::Read(MxDSChunk& p_chunk) } textureName[textureNameLength] = '\0'; - strlwr(textureName); + SDL_strlwr(textureName); texture = new LegoTexture(); if (texture->Read(&storage, hardwareMode) != SUCCESS) { diff --git a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp index 2fc82456..fb7bd950 100644 --- a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp @@ -19,6 +19,7 @@ #include "tgl/d3drm/impl.h" #include "viewmanager/viewroi.h" +#include #include DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590) @@ -544,7 +545,7 @@ MxPresenter* LegoVideoManager::GetPresenterByActionObjectName(const char* p_acti continue; } - if (strcmpi(presenter->GetAction()->GetObjectName(), p_actionObjectName) == 0) { + if (SDL_strcasecmp(presenter->GetAction()->GetObjectName(), p_actionObjectName) == 0) { return presenter; } } diff --git a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp index 43d03cc7..b78ef473 100644 --- a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp +++ b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp @@ -22,6 +22,8 @@ #include "radio.h" #include "scripts.h" +#include + DECOMP_SIZE_ASSERT(GasStation, 0x128) DECOMP_SIZE_ASSERT(GasStationState, 0x24) @@ -374,7 +376,7 @@ MxLong GasStation::HandleButtonDown(LegoControlManagerNotificationParam& p_param LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY()); 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_unk0x114 = FALSE; diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index cfec6955..0a9cec10 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -20,6 +20,8 @@ #include "mxtransitionmanager.h" #include "scripts.h" +#include + DECOMP_SIZE_ASSERT(Hospital, 0x12c) DECOMP_SIZE_ASSERT(HospitalState, 0x18) @@ -409,7 +411,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) roiName += 1; } - if (!strcmpi("actor_ha", roiName)) { + if (!SDL_strcasecmp("actor_ha", roiName)) { LegoInputManager* inputManager = InputManager(); inputManager->SetUnknown88(TRUE); inputManager->SetUnknown336(FALSE); diff --git a/LEGO1/lego/sources/roi/legolod.cpp b/LEGO1/lego/sources/roi/legolod.cpp index 7db2a0a9..388373f0 100644 --- a/LEGO1/lego/sources/roi/legolod.cpp +++ b/LEGO1/lego/sources/roi/legolod.cpp @@ -7,6 +7,8 @@ #include "shape/legomesh.h" #include "tgl/d3drm/impl.h" +#include + DECOMP_SIZE_ASSERT(LODObject, 0x04) DECOMP_SIZE_ASSERT(ViewLOD, 0x0c) DECOMP_SIZE_ASSERT(LegoLOD, 0x20) @@ -380,7 +382,7 @@ LegoResult LegoLOD::GetTexture(LegoTextureInfo*& p_textureInfo) LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name) { 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; } } diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 50a26113..0724042f 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -8,6 +8,7 @@ #include "shape/legobox.h" #include "shape/legosphere.h" +#include #include #include @@ -135,7 +136,7 @@ LegoResult LegoROI::Read( goto done; } m_name[length] = '\0'; - strlwr(m_name); + SDL_strlwr(m_name); if (sphere.Read(p_storage) != SUCCESS) { goto done; @@ -162,7 +163,7 @@ LegoResult LegoROI::Read( goto done; } textureName[length] = '\0'; - strlwr(textureName); + SDL_strlwr(textureName); } else { textureName = NULL; @@ -216,7 +217,7 @@ LegoResult LegoROI::Read( if (g_roiConfig <= 2) { 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]; break; } @@ -224,7 +225,7 @@ LegoResult LegoROI::Read( } else { 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]; break; } @@ -233,7 +234,7 @@ LegoResult LegoROI::Read( if ((lodList = p_viewLODListManager->Lookup(roiName))) { for (j = 0; g_unk0x10101390[j] != NULL; j++) { - if (!strcmpi(g_unk0x10101390[j], roiName)) { + if (!SDL_strcasecmp(g_unk0x10101390[j], roiName)) { break; } } @@ -291,7 +292,7 @@ LegoResult LegoROI::Read( } if (textureName != NULL) { - if (!strnicmp(textureName, "t_", 2)) { + if (!SDL_strncasecmp(textureName, "t_", 2)) { textureInfo = p_textureContainer->Get(textureName + 2); if (textureInfo == NULL) { @@ -350,7 +351,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi) CompoundObject::iterator it; 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; } @@ -360,7 +361,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi) LegoROI* roi = (LegoROI*) *it; name = roi->GetName(); - if (name != NULL && *name != '\0' && !strcmpi(name, p_name)) { + if (name != NULL && *name != '\0' && !SDL_strcasecmp(name, p_name)) { 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) { 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_green = g_roiColorAliases[i].m_green / 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) { m_name = new LegoChar[strlen(p_name) + 1]; strcpy(m_name, p_name); - strlwr(m_name); + SDL_strlwr(m_name); } else { m_name = NULL; diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 3e5d4b12..42112e55 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -1,6 +1,7 @@ #ifndef LEGOROI_H #define LEGOROI_H +#include "lego1_export.h" #include "misc/legotypes.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 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 LegoBool FUN_100a9bf0(const LegoChar* p_param, float& p_red, float& p_green, float& p_blue, float& p_alpha); static LegoBool ColorAliasLookup( diff --git a/LEGO1/lego/sources/shape/legomesh.cpp b/LEGO1/lego/sources/shape/legomesh.cpp index 51b61fb0..df293fc6 100644 --- a/LEGO1/lego/sources/shape/legomesh.cpp +++ b/LEGO1/lego/sources/shape/legomesh.cpp @@ -2,6 +2,8 @@ #include "misc/legostorage.h" +#include + DECOMP_SIZE_ASSERT(LegoMeshUnkComponent, 0x1c) DECOMP_SIZE_ASSERT(LegoMesh, 0x24) @@ -70,7 +72,7 @@ LegoResult LegoMesh::Read(LegoStorage* p_storage) } m_textureName[textureLength] = '\0'; - strlwr(m_textureName); + SDL_strlwr(m_textureName); } if ((result = p_storage->Read(&materialLength, sizeof(materialLength))) != SUCCESS) { @@ -84,7 +86,7 @@ LegoResult LegoMesh::Read(LegoStorage* p_storage) } m_materialName[materialLength] = '\0'; - strlwr(m_materialName); + SDL_strlwr(m_materialName); } return SUCCESS; diff --git a/LEGO1/lego1_export.h b/LEGO1/lego1_export.h new file mode 100644 index 00000000..dc248084 --- /dev/null +++ b/LEGO1/lego1_export.h @@ -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 diff --git a/LEGO1/modeldb/modeldb.h b/LEGO1/modeldb/modeldb.h index 979a5249..b1a0f592 100644 --- a/LEGO1/modeldb/modeldb.h +++ b/LEGO1/modeldb/modeldb.h @@ -7,6 +7,7 @@ #include "mxtypes.h" #include +#include // SIZE 0x18 struct ModelDbPart { @@ -32,7 +33,7 @@ class ModelDbPartList : public MxList { // FUNCTION: LEGO1 0x10027c40 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) { p_b->m_partDataLength = p_a->m_partDataLength; diff --git a/LEGO1/mxdirectx/mxdirectdraw.h b/LEGO1/mxdirectx/mxdirectdraw.h index 975204a7..f346744d 100644 --- a/LEGO1/mxdirectx/mxdirectdraw.h +++ b/LEGO1/mxdirectx/mxdirectdraw.h @@ -1,6 +1,7 @@ #ifndef MXDIRECTDRAW_H #define MXDIRECTDRAW_H +#include "lego1_export.h" #include "mxdirectxinfo.h" #include @@ -12,7 +13,7 @@ class MxDirectDraw { public: typedef void (*ErrorHandler)(const char*, HRESULT, void*); - static int GetPrimaryBitDepth(); + LEGO1_EXPORT static int GetPrimaryBitDepth(); MxDirectDraw(); virtual ~MxDirectDraw(); diff --git a/LEGO1/mxdirectx/mxdirectxinfo.cpp b/LEGO1/mxdirectx/mxdirectxinfo.cpp index 4d2950e3..d41e195a 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.cpp +++ b/LEGO1/mxdirectx/mxdirectxinfo.cpp @@ -1,5 +1,6 @@ #include "mxdirectxinfo.h" +#include #include #include // for vsprintf @@ -260,13 +261,10 @@ BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...) { va_list args; - char buf[512]; 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); - - OutputDebugString(buf); } // FUNCTION: CONFIG 0x00401bf0 diff --git a/LEGO1/omni/include/mxatom.h b/LEGO1/omni/include/mxatom.h index d7650bb7..3b8ba95d 100644 --- a/LEGO1/omni/include/mxatom.h +++ b/LEGO1/omni/include/mxatom.h @@ -1,6 +1,7 @@ #ifndef MXATOM_H #define MXATOM_H +#include "lego1_export.h" #include "mxstl/stlcompat.h" #include "mxstring.h" #include "mxtypes.h" @@ -61,9 +62,9 @@ enum LookupMode { class MxAtomId { public: 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 MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; } diff --git a/LEGO1/omni/include/mxbitmap.h b/LEGO1/omni/include/mxbitmap.h index 5df4c8ba..68e9ebf8 100644 --- a/LEGO1/omni/include/mxbitmap.h +++ b/LEGO1/omni/include/mxbitmap.h @@ -4,6 +4,7 @@ #include "mxcore.h" #include "mxtypes.h" +#include #include #include @@ -43,7 +44,7 @@ class MxBitmap : public MxCore { virtual MxResult ImportBitmap(MxBitmap* p_bitmap); // vtable+14 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 LoadFile(HANDLE p_handle); // vtable+20 + virtual MxResult LoadFile(SDL_IOStream* p_handle); // vtable+20 virtual MxLong Read(const char* p_filename); // vtable+24 // FUNCTION: LEGO1 0x1004e0d0 diff --git a/LEGO1/omni/include/mxdsaction.h b/LEGO1/omni/include/mxdsaction.h index 807700c5..b7677e92 100644 --- a/LEGO1/omni/include/mxdsaction.h +++ b/LEGO1/omni/include/mxdsaction.h @@ -1,6 +1,7 @@ #ifndef MXDSACTION_H #define MXDSACTION_H +#include "lego1_export.h" #include "mxdsobject.h" #include "mxgeometry/mxgeometry3d.h" #include "mxtypes.h" @@ -25,8 +26,8 @@ class MxDSAction : public MxDSObject { c_bit11 = 0x400, }; - MxDSAction(); - ~MxDSAction() override; + LEGO1_EXPORT MxDSAction(); + LEGO1_EXPORT ~MxDSAction() override; MxDSAction(MxDSAction& p_dsAction); void CopyFrom(MxDSAction& p_dsAction); diff --git a/LEGO1/omni/include/mxdsfile.h b/LEGO1/omni/include/mxdsfile.h index 4ddfaf3c..6bb537e9 100644 --- a/LEGO1/omni/include/mxdsfile.h +++ b/LEGO1/omni/include/mxdsfile.h @@ -1,6 +1,7 @@ #ifndef MXDSFILE_H #define MXDSFILE_H +#include "lego1_export.h" #include "mxdssource.h" #include "mxio.h" #include "mxstring.h" @@ -13,6 +14,10 @@ class MxDSFile : public MxDSSource { public: MxDSFile(const char* p_filename, MxULong p_skipReadingChunks); + enum { + e_openRead = 0, + }; + #ifdef ISLE_APP ~MxDSFile() override { Close(); } #else @@ -20,7 +25,7 @@ class MxDSFile : public MxDSSource { // since it is inlined everywhere in LEGO1.DLL // FUNCTION: LEGO1 0x100bfed0 // FUNCTION: BETA10 0x10148ac0 - __declspec(dllexport) ~MxDSFile() override { Close(); } + LEGO1_EXPORT ~MxDSFile() override { Close(); } #endif // FUNCTION: LEGO1 0x100c0120 diff --git a/LEGO1/omni/include/mxmisc.h b/LEGO1/omni/include/mxmisc.h index 09928ae2..3e8000e4 100644 --- a/LEGO1/omni/include/mxmisc.h +++ b/LEGO1/omni/include/mxmisc.h @@ -1,6 +1,7 @@ #ifndef MXMISC_H #define MXMISC_H +#include "lego1_export.h" #include "mxtypes.h" class MxAtomSet; @@ -15,13 +16,13 @@ class MxTimer; class MxVariableTable; class MxVideoManager; -MxTickleManager* TickleManager(); -MxTimer* Timer(); -MxStreamer* Streamer(); +LEGO1_EXPORT MxTickleManager* TickleManager(); +LEGO1_EXPORT MxTimer* Timer(); +LEGO1_EXPORT MxStreamer* Streamer(); MxSoundManager* MSoundManager(); -MxVariableTable* VariableTable(); +LEGO1_EXPORT MxVariableTable* VariableTable(); MxEventManager* EventManager(); -MxResult Start(MxDSAction*); +LEGO1_EXPORT MxResult Start(MxDSAction*); MxNotificationManager* NotificationManager(); MxVideoManager* MVideoManager(); MxAtomSet* AtomSet(); diff --git a/LEGO1/omni/include/mxomni.h b/LEGO1/omni/include/mxomni.h index 6b2a7537..55fb4e21 100644 --- a/LEGO1/omni/include/mxomni.h +++ b/LEGO1/omni/include/mxomni.h @@ -1,6 +1,7 @@ #ifndef MXOMNI_H #define MXOMNI_H +#include "lego1_export.h" #include "mxcore.h" #include "mxcriticalsection.h" #include "mxstring.h" @@ -28,14 +29,14 @@ class MxVideoManager; // SIZE 0x68 class MxOmni : public MxCore { public: - static void DestroyInstance(); - static const char* GetCD(); + LEGO1_EXPORT static void DestroyInstance(); + LEGO1_EXPORT static const char* GetCD(); static const char* GetHD(); static MxOmni* GetInstance(); static MxBool IsSound3D(); - static void SetCD(const char* p_cd); - static void SetHD(const char* p_hd); - static void SetSound3D(MxBool p_use3dSound); + LEGO1_EXPORT static void SetCD(const char* p_cd); + LEGO1_EXPORT static void SetHD(const char* p_hd); + LEGO1_EXPORT static void SetSound3D(MxBool p_use3dSound); static void NormalizePath(char* p_path); MxOmni(); diff --git a/LEGO1/omni/include/mxomnicreateflags.h b/LEGO1/omni/include/mxomnicreateflags.h index e28dd4ec..dda95aae 100644 --- a/LEGO1/omni/include/mxomnicreateflags.h +++ b/LEGO1/omni/include/mxomnicreateflags.h @@ -1,12 +1,13 @@ #ifndef MXOMNICREATEFLAGS_H #define MXOMNICREATEFLAGS_H +#include "lego1_export.h" #include "mxtypes.h" // SIZE 0x02 class MxOmniCreateFlags { public: - MxOmniCreateFlags(); + LEGO1_EXPORT MxOmniCreateFlags(); // FUNCTION: BETA10 0x10092b50 void CreateObjectFactory(MxBool p_enable) { m_flags1.m_bit0 = p_enable; } diff --git a/LEGO1/omni/include/mxomnicreateparam.h b/LEGO1/omni/include/mxomnicreateparam.h index 338767bb..65a19fd6 100644 --- a/LEGO1/omni/include/mxomnicreateparam.h +++ b/LEGO1/omni/include/mxomnicreateparam.h @@ -1,6 +1,7 @@ #ifndef MXOMNICREATEPARAM_H #define MXOMNICREATEPARAM_H +#include "lego1_export.h" #include "mxomnicreateflags.h" #include "mxparam.h" #include "mxstring.h" @@ -12,9 +13,9 @@ // VTABLE: BETA10 0x101c1ca8 class MxOmniCreateParam : public MxParam { public: - MxOmniCreateParam( + LEGO1_EXPORT MxOmniCreateParam( const char* p_mediaPath, - struct HWND__* p_windowHandle, + HWND p_windowHandle, MxVideoParam& p_vparam, MxOmniCreateFlags p_flags ); diff --git a/LEGO1/omni/include/mxstreamer.h b/LEGO1/omni/include/mxstreamer.h index 208f3ce1..95c825f0 100644 --- a/LEGO1/omni/include/mxstreamer.h +++ b/LEGO1/omni/include/mxstreamer.h @@ -2,6 +2,7 @@ #define MXSTREAMER_H #include "decomp.h" +#include "lego1_export.h" #include "mxcore.h" #include "mxmemorypool.h" #include "mxnotificationparam.h" @@ -50,8 +51,8 @@ class MxStreamer : public MxCore { MxStreamer(); ~MxStreamer() override; // vtable+0x00 - MxStreamController* Open(const char* p_name, MxU16 p_openMode); - MxLong Close(const char* p_name); + LEGO1_EXPORT MxStreamController* Open(const char* p_name, MxU16 p_openMode); + LEGO1_EXPORT MxLong Close(const char* p_name); MxLong Notify(MxParam& p_param) override; // vtable+0x04 diff --git a/LEGO1/omni/include/mxstring.h b/LEGO1/omni/include/mxstring.h index ccaafbed..7393d534 100644 --- a/LEGO1/omni/include/mxstring.h +++ b/LEGO1/omni/include/mxstring.h @@ -1,6 +1,7 @@ #ifndef MXSTRING_H #define MXSTRING_H +#include "lego1_export.h" #include "mxcore.h" // VTABLE: LEGO1 0x100dc110 @@ -12,7 +13,7 @@ class MxString : public MxCore { MxString(const MxString& p_str); MxString(const char* p_str); MxString(const char* p_str, MxU16 p_maxlen); - ~MxString() override; + LEGO1_EXPORT ~MxString() override; void Reverse(); void ToUpperCase(); diff --git a/LEGO1/omni/include/mxtimer.h b/LEGO1/omni/include/mxtimer.h index 02e55146..f345cad3 100644 --- a/LEGO1/omni/include/mxtimer.h +++ b/LEGO1/omni/include/mxtimer.h @@ -1,8 +1,11 @@ #ifndef MXTIMER_H #define MXTIMER_H +#include "lego1_export.h" #include "mxcore.h" +#include + // VTABLE: LEGO1 0x100dc0e0 // VTABLE: BETA10 0x101c1bb0 // SIZE 0x10 @@ -13,7 +16,7 @@ class MxTimer : public MxCore { void Start(); void Stop(); - MxLong GetRealTime(); + LEGO1_EXPORT MxLong GetRealTime(); // FUNCTION: BETA10 0x1012bf50 void InitLastTimeCalculated() { g_lastTimeCalculated = m_startTime; } @@ -35,7 +38,7 @@ class MxTimer : public MxCore { // MxTimer::`scalar deleting destructor' private: - MxLong m_startTime; // 0x08 + Uint64 m_startTime; // 0x08 MxBool m_isRunning; // 0x0c static MxLong g_lastTimeCalculated; diff --git a/LEGO1/omni/include/mxvariabletable.h b/LEGO1/omni/include/mxvariabletable.h index a9dab29e..49d5cdda 100644 --- a/LEGO1/omni/include/mxvariabletable.h +++ b/LEGO1/omni/include/mxvariabletable.h @@ -1,6 +1,7 @@ #ifndef MXVARIABLETABLE_H #define MXVARIABLETABLE_H +#include "lego1_export.h" #include "mxhashtable.h" #include "mxtypes.h" #include "mxvariable.h" @@ -12,7 +13,7 @@ class MxVariableTable : public MxHashTable { public: // FUNCTION: BETA10 0x10130e50 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); const char* GetVariable(const char* p_key); diff --git a/LEGO1/omni/include/mxvideoparam.h b/LEGO1/omni/include/mxvideoparam.h index e85ead69..b9bf0202 100644 --- a/LEGO1/omni/include/mxvideoparam.h +++ b/LEGO1/omni/include/mxvideoparam.h @@ -2,6 +2,7 @@ #define MXVIDEOPARAM_H #include "compat.h" +#include "lego1_export.h" #include "mxrect32.h" #include "mxtypes.h" #include "mxvideoparamflags.h" @@ -13,13 +14,17 @@ class MxPalette; // SIZE 0x24 class MxVideoParam { public: - MxVideoParam(); - __declspec(dllexport) - MxVideoParam(MxRect32& p_rect, MxPalette* p_palette, MxULong p_backBuffers, MxVideoParamFlags& p_flags); + LEGO1_EXPORT MxVideoParam(); + LEGO1_EXPORT MxVideoParam( + MxRect32& p_rect, + MxPalette* p_palette, + MxULong p_backBuffers, + MxVideoParamFlags& p_flags + ); MxVideoParam(MxVideoParam& p_videoParam); - ~MxVideoParam(); - void SetDeviceName(char* p_deviceId); - MxVideoParam& operator=(const MxVideoParam& p_videoParam); + LEGO1_EXPORT ~MxVideoParam(); + LEGO1_EXPORT void SetDeviceName(char* p_deviceId); + LEGO1_EXPORT MxVideoParam& operator=(const MxVideoParam& p_videoParam); // FUNCTION: BETA10 0x100886e0 MxVideoParamFlags& Flags() { return m_flags; } diff --git a/LEGO1/omni/include/mxvideoparamflags.h b/LEGO1/omni/include/mxvideoparamflags.h index 4ed414d6..406b05a7 100644 --- a/LEGO1/omni/include/mxvideoparamflags.h +++ b/LEGO1/omni/include/mxvideoparamflags.h @@ -1,13 +1,14 @@ #ifndef MXVIDEOPARAMFLAGS_H #define MXVIDEOPARAMFLAGS_H +#include "lego1_export.h" #include "mxtypes.h" #include class MxVideoParamFlags { public: - MxVideoParamFlags(); + LEGO1_EXPORT MxVideoParamFlags(); // inlined in ISLE void SetFullScreen(MxBool p_e) { m_flags1.m_bit0 = p_e; } diff --git a/LEGO1/omni/src/action/mxdsselectaction.cpp b/LEGO1/omni/src/action/mxdsselectaction.cpp index 89eb4e9a..44395767 100644 --- a/LEGO1/omni/src/action/mxdsselectaction.cpp +++ b/LEGO1/omni/src/action/mxdsselectaction.cpp @@ -4,6 +4,8 @@ #include "mxtimer.h" #include "mxvariabletable.h" +#include + DECOMP_SIZE_ASSERT(MxDSSelectAction, 0xb0) DECOMP_SIZE_ASSERT(MxStringList, 0x18) DECOMP_SIZE_ASSERT(MxStringListCursor, 0x10) @@ -94,13 +96,13 @@ void MxDSSelectAction::Deserialize(MxU8*& p_source, MxS16 p_unk0x24) 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]; MxS16 value = atoi(&this->m_unk0x9c.GetData()[strlen("RANDOM_")]); srand(Timer()->GetTime()); MxS32 random = rand() % value; - string = itoa((MxS16) random, buffer, 10); + string = SDL_itoa((MxS16) random, buffer, 10); } else { string = VariableTable()->GetVariable((char*) p_source); diff --git a/LEGO1/omni/src/audio/mxwavepresenter.cpp b/LEGO1/omni/src/audio/mxwavepresenter.cpp index a487c690..e7a078ef 100644 --- a/LEGO1/omni/src/audio/mxwavepresenter.cpp +++ b/LEGO1/omni/src/audio/mxwavepresenter.cpp @@ -10,6 +10,7 @@ #include "mxsoundmanager.h" #include "mxutilities.h" +#include #include DECOMP_SIZE_ASSERT(MxWavePresenter, 0x6c); @@ -326,7 +327,7 @@ void MxWavePresenter::ParseExtra() char soundValue[512]; if (KeyValueStringParse(soundValue, g_strSOUND, extraCopy)) { - if (!strcmpi(soundValue, "FALSE")) { + if (!SDL_strcasecmp(soundValue, "FALSE")) { Enable(FALSE); } } diff --git a/LEGO1/omni/src/common/mxdebug.cpp b/LEGO1/omni/src/common/mxdebug.cpp index f372635c..edb7865f 100644 --- a/LEGO1/omni/src/common/mxdebug.cpp +++ b/LEGO1/omni/src/common/mxdebug.cpp @@ -6,8 +6,8 @@ // Identical functions at BETA10 0x100ec9fe and 0x101741b5 are more limited in scope. // This is the most widely used version. +#include #include -#include // FUNCTION: BETA10 0x10124cb9 int DebugHeapState() @@ -19,11 +19,9 @@ int DebugHeapState() void _MxTrace(const char* format, ...) { va_list args; - char buffer[256]; va_start(args, format); - _vsnprintf(buffer, 256, format, args); - OutputDebugString(buffer); + SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_TRACE, format, args); va_end(args); } diff --git a/LEGO1/omni/src/common/mxstring.cpp b/LEGO1/omni/src/common/mxstring.cpp index d7f8093c..fe75c36f 100644 --- a/LEGO1/omni/src/common/mxstring.cpp +++ b/LEGO1/omni/src/common/mxstring.cpp @@ -3,6 +3,7 @@ #include "decomp.h" #include +#include #include #include @@ -90,14 +91,14 @@ void MxString::Reverse() // FUNCTION: BETA10 0x1012c537 void MxString::ToUpperCase() { - strupr(this->m_data); + SDL_strupr(this->m_data); } // FUNCTION: LEGO1 0x100ae4a0 // FUNCTION: BETA10 0x1012c55c void MxString::ToLowerCase() { - strlwr(this->m_data); + SDL_strlwr(this->m_data); } // FUNCTION: LEGO1 0x100ae4b0 diff --git a/LEGO1/omni/src/common/mxtimer.cpp b/LEGO1/omni/src/common/mxtimer.cpp index 98111b50..5a318c54 100644 --- a/LEGO1/omni/src/common/mxtimer.cpp +++ b/LEGO1/omni/src/common/mxtimer.cpp @@ -1,6 +1,6 @@ #include "mxtimer.h" -#include +#include // GLOBAL: LEGO1 0x10101414 // GLOBAL: BETA10 0x10201f84 @@ -14,7 +14,7 @@ MxLong MxTimer::g_lastTimeTimerStarted = 0; MxTimer::MxTimer() { m_isRunning = FALSE; - m_startTime = timeGetTime(); + m_startTime = SDL_GetTicks(); InitLastTimeCalculated(); } @@ -22,7 +22,7 @@ MxTimer::MxTimer() // FUNCTION: BETA10 0x1012bf23 MxLong MxTimer::GetRealTime() { - MxTimer::g_lastTimeCalculated = timeGetTime(); + MxTimer::g_lastTimeCalculated = SDL_GetTicks(); return MxTimer::g_lastTimeCalculated - m_startTime; } diff --git a/LEGO1/omni/src/common/mxutilities.cpp b/LEGO1/omni/src/common/mxutilities.cpp index c1a102f5..e659c0f1 100644 --- a/LEGO1/omni/src/common/mxutilities.cpp +++ b/LEGO1/omni/src/common/mxutilities.cpp @@ -9,6 +9,7 @@ #include "mxpresenterlist.h" #include "mxrect32.h" +#include #include // GLOBAL: LEGO1 0x101020e8 @@ -71,7 +72,7 @@ void MakeSourceName(char* p_output, const char* p_input) strcpy(p_output, p_input); - strlwr(p_output); + SDL_strlwr(p_output); char* extLoc = strstr(p_output, ".si"); 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:")) { len -= (strlen(token) + 1); - if (strcmpi(token, p_command) == 0) { + if (SDL_strcasecmp(token, p_command) == 0) { if (p_output && len > 0) { char* output = p_output; char* cur = &token[strlen(p_command)]; diff --git a/LEGO1/omni/src/main/mxomnicreateflags.cpp b/LEGO1/omni/src/main/mxomnicreateflags.cpp index 2edaaf17..1c3e9c9d 100644 --- a/LEGO1/omni/src/main/mxomnicreateflags.cpp +++ b/LEGO1/omni/src/main/mxomnicreateflags.cpp @@ -3,7 +3,7 @@ #include "decomp.h" DECOMP_SIZE_ASSERT(MxOmniCreateFlags, 0x02) - +// // FUNCTION: LEGO1 0x100b0a30 // FUNCTION: BETA10 0x10130a1c MxOmniCreateFlags::MxOmniCreateFlags() diff --git a/LEGO1/omni/src/main/mxomnicreateparam.cpp b/LEGO1/omni/src/main/mxomnicreateparam.cpp index 7f84fbc1..88235330 100644 --- a/LEGO1/omni/src/main/mxomnicreateparam.cpp +++ b/LEGO1/omni/src/main/mxomnicreateparam.cpp @@ -8,13 +8,13 @@ DECOMP_SIZE_ASSERT(MxOmniCreateParam, 0x40) // FUNCTION: BETA10 0x10130b6b MxOmniCreateParam::MxOmniCreateParam( const char* p_mediaPath, - struct HWND__* p_windowHandle, + HWND p_windowHandle, MxVideoParam& p_vparam, MxOmniCreateFlags p_flags ) { this->m_mediaPath = p_mediaPath; - this->m_windowHandle = (HWND) p_windowHandle; + this->m_windowHandle = p_windowHandle; this->m_videoParam = p_vparam; this->m_createFlags = p_flags; } diff --git a/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp b/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp index 375e38d3..c861403d 100644 --- a/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp +++ b/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp @@ -92,11 +92,11 @@ MxResult MxDiskStreamProvider::SetResourceToGet(MxStreamController* p_resource) m_pFile = new MxDSFile(path.GetData(), 0); 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"; m_pFile->SetFileName(path.GetData()); - if (m_pFile->Open(OF_READ) != 0) { + if (m_pFile->Open(MxDSFile::e_openRead) != 0) { goto done; } } diff --git a/LEGO1/omni/src/stream/mxramstreamprovider.cpp b/LEGO1/omni/src/stream/mxramstreamprovider.cpp index 2b062504..8282a785 100644 --- a/LEGO1/omni/src/stream/mxramstreamprovider.cpp +++ b/LEGO1/omni/src/stream/mxramstreamprovider.cpp @@ -69,11 +69,11 @@ MxResult MxRAMStreamProvider::SetResourceToGet(MxStreamController* p_resource) m_pFile = new MxDSFile(path.GetData(), 0); 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"; m_pFile->SetFileName(path.GetData()); - if (m_pFile->Open(OF_READ) != 0) { + if (m_pFile->Open(MxDSFile::e_openRead) != 0) { goto done; } } diff --git a/LEGO1/omni/src/video/mxbitmap.cpp b/LEGO1/omni/src/video/mxbitmap.cpp index d914d7fa..07f98949 100644 --- a/LEGO1/omni/src/video/mxbitmap.cpp +++ b/LEGO1/omni/src/video/mxbitmap.cpp @@ -175,11 +175,11 @@ MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap) MxLong MxBitmap::Read(const char* p_filename) { 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; } @@ -191,7 +191,7 @@ MxLong MxBitmap::Read(const char* p_filename) done: if (handle) { - CloseHandle(handle); + SDL_CloseIO(handle); } return result; @@ -199,15 +199,14 @@ MxLong MxBitmap::Read(const char* p_filename) // FUNCTION: LEGO1 0x100bcd60 // FUNCTION: BETA10 0x1013d169 -MxResult MxBitmap::LoadFile(HANDLE p_handle) +MxResult MxBitmap::LoadFile(SDL_IOStream* p_handle) { MxResult result = FAILURE; MxLong unused = 0; MxLong size; - DWORD bytesRead; BITMAPFILEHEADER hdr; - if (!ReadFile(p_handle, &hdr, sizeof(hdr), &bytesRead, NULL)) { + if (!SDL_ReadIO(p_handle, &hdr, sizeof(hdr))) { goto done; } @@ -220,7 +219,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle) goto done; } - if (!ReadFile(p_handle, m_info, MxBitmapInfoSize(), &bytesRead, NULL)) { + if (!SDL_ReadIO(p_handle, m_info, MxBitmapInfoSize())) { goto done; } @@ -234,7 +233,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle) goto done; } - if (!ReadFile(p_handle, m_data, size, &bytesRead, NULL)) { + if (!SDL_ReadIO(p_handle, m_data, size)) { goto done; } diff --git a/LEGO1/omni/src/video/mxdisplaysurface.cpp b/LEGO1/omni/src/video/mxdisplaysurface.cpp index d08322ce..6a2baddf 100644 --- a/LEGO1/omni/src/video/mxdisplaysurface.cpp +++ b/LEGO1/omni/src/video/mxdisplaysurface.cpp @@ -8,6 +8,7 @@ #include "mxutilities.h" #include "mxvideomanager.h" +#include #include #include @@ -834,7 +835,7 @@ void MxDisplaySurface::Display(MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p m_ddSurface2->Unlock(ddsd.lpSurface); } else { - OutputDebugString("MxDisplaySurface::Display error\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "MxDisplaySurface::Display error\n"); } } m_ddSurface1->Flip(NULL, DDFLIP_WAIT); diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index 7074ae26..df55142b 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -12,6 +12,8 @@ #include "mxutilities.h" #include "mxvideomanager.h" +#include + DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c); // FUNCTION: LEGO1 0x100b9c70 @@ -209,7 +211,7 @@ void MxStillPresenter::ParseExtra() char output[512]; if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) { - if (strcmpi(output, "FALSE") == 0) { + if (SDL_strcasecmp(output, "FALSE") == 0) { Enable(FALSE); } } diff --git a/LEGO1/viewmanager/viewmanager.h b/LEGO1/viewmanager/viewmanager.h index 051fe0fa..cfc819f3 100644 --- a/LEGO1/viewmanager/viewmanager.h +++ b/LEGO1/viewmanager/viewmanager.h @@ -2,6 +2,7 @@ #define VIEWMANAGER_H #include "decomp.h" +#include "lego1_export.h" #include "realtime/realtimeview.h" #include "viewroi.h" @@ -22,7 +23,7 @@ class ViewManager { virtual ~ViewManager(); 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); void UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und); void RemoveROIDetailFromScene(ViewROI* p_roi);