diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d576f03f5..2ab80c0c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,8 @@ jobs: sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" sudo apt-get -y install ninja-build clang lld libcurl4-openssl-dev intel-oneapi-ipp-devel \ zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \ - libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev qt5-default libfreetype-dev + libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev qt5-default libfreetype-dev \ + libxinerama-dev libxcursor-dev python3-markupsafe yarn global add @sentry/cli echo "$(yarn global bin)" >> $GITHUB_PATH @@ -105,6 +106,7 @@ jobs: brew upgrade --formula brew install ninja graphicsmagick imagemagick freetype yarn global add create-dmg + pip3 install markupsafe==2.0.1 # universal qt5 from macports curl -LSfs https://axiodl.com/files/qt-$Qt_VERSION.mpkg -o /tmp/qt-$Qt_VERSION.mpkg @@ -158,9 +160,8 @@ jobs: fail-fast: false matrix: include: - # Disabled due to memory constraints -# - name: MSVC -# preset: msvc + - name: MSVC + preset: msvc - name: Clang preset: clang @@ -191,6 +192,7 @@ jobs: - name: Install dependencies run: | choco install ninja vulkan-sdk + pip install markupsafe==2.0.1 # set up buildcache $TempDir = "$env:RUNNER_WORKSPACE\temp" diff --git a/CMakeLists.txt b/CMakeLists.txt index f5117c7ad..c89e4e6a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -441,36 +441,6 @@ set(HECL_DATASPEC_PUSHES add_subdirectory(extern/nod EXCLUDE_FROM_ALL) add_subdirectory(extern/boo EXCLUDE_FROM_ALL) -include(ExternalProject) -ExternalProject_Add(shaderc - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/hecl/shaderc" - CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH= - INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config Release --target install) - -function(shaderc out) - if(IS_ABSOLUTE ${out}) - set(theOut ${out}) - else() - set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out}) - endif() - unset(theInsList) - foreach(in ${ARGN}) - if(IS_ABSOLUTE ${in}) - list(APPEND theInsList ${in}) - else() - list(APPEND theInsList ${CMAKE_CURRENT_SOURCE_DIR}/${in}) - endif() - endforeach() - get_filename_component(outDir ${theOut} DIRECTORY) - file(MAKE_DIRECTORY ${outDir}) - file(RELATIVE_PATH outRel ${CMAKE_BINARY_DIR} ${theOut}) - ExternalProject_Get_Property(shaderc INSTALL_DIR) - add_custom_command(OUTPUT ${theOut}.cpp ${theOut}.hpp - COMMAND "${INSTALL_DIR}/bin/shaderc" ARGS -o ${theOut} ${theInsList} - DEPENDS ${theInsList} shaderc - COMMENT "Compiling shader ${outRel}.shader") -endfunction() - include(hecl/ApplicationTools.cmake) add_subdirectory(extern/xxhash EXCLUDE_FROM_ALL) add_subdirectory(imgui) @@ -497,7 +467,7 @@ if (NOT CMAKE_CROSSCOMPILING) add_subdirectory(assetnameparser EXCLUDE_FROM_ALL) endif () add_compile_definitions(URDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known -add_subdirectory(DataSpec) +add_subdirectory(DataSpec EXCLUDE_FROM_ALL) add_subdirectory(extern/kabufuda EXCLUDE_FROM_ALL) add_subdirectory(extern/jbus EXCLUDE_FROM_ALL) @@ -508,9 +478,6 @@ add_subdirectory(aurora) add_subdirectory(Runtime) add_subdirectory(mpcksum EXCLUDE_FROM_ALL) add_subdirectory(gbalink EXCLUDE_FROM_ALL) -#add_subdirectory(visigen) - -#add_dependencies(hecl visigen) if (NOT WINDOWS_STORE AND NOT NX) if (APPLE AND EXISTS /opt/local/libexec/qt5) @@ -528,10 +495,10 @@ if (NOT WINDOWS_STORE AND NOT NX) find_package(Qt5Widgets QUIET PATHS ${QT_HOMEBREW_PATH}) if (Qt6Widgets_FOUND) message(STATUS "Qt6 found, metaforce-gui will be built") - add_subdirectory(metaforce-gui) + add_subdirectory(metaforce-gui EXCLUDE_FROM_ALL) elseif(Qt5Widgets_FOUND) message(STATUS "Qt5 found, metaforce-gui will be built") - add_subdirectory(metaforce-gui) + add_subdirectory(metaforce-gui EXCLUDE_FROM_ALL) else() message(STATUS "Qt5-6 not found, metaforce-gui will not be built") endif() @@ -540,25 +507,25 @@ endif() configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h) # Packaging logic -list(APPEND BINARY_TARGETS metaforce hecl) # visigen +list(APPEND BINARY_TARGETS metaforce) # hecl visigen set(DSYM_ONLY_TARGETS "") if (TARGET crashpad_handler) list(APPEND BINARY_TARGETS crashpad_handler) endif () set(BIN_PREFIX "${CMAKE_INSTALL_PREFIX}") -if (TARGET metaforce-gui) - if (APPLE) - # app bundle already has all needed binaries - install(TARGETS metaforce-gui DESTINATION ${BIN_PREFIX}) - list(APPEND DSYM_ONLY_TARGETS metaforce-gui) - # we have to rename here, cmake is inflexible about bundle naming - install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND rm -fr Metaforce.app)") - install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND mv metaforce-gui.app Metaforce.app)") - set(BIN_PREFIX "${BIN_PREFIX}/Metaforce.app/Contents/MacOS") - else() - list(APPEND BINARY_TARGETS metaforce-gui) - endif () -endif () +#if (TARGET metaforce-gui) +# if (APPLE) +# # app bundle already has all needed binaries +# install(TARGETS metaforce-gui DESTINATION ${BIN_PREFIX}) +# list(APPEND DSYM_ONLY_TARGETS metaforce-gui) +# # we have to rename here, cmake is inflexible about bundle naming +# install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND rm -fr Metaforce.app)") +# install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND mv metaforce-gui.app Metaforce.app)") +# set(BIN_PREFIX "${BIN_PREFIX}/Metaforce.app/Contents/MacOS") +# else() +# list(APPEND BINARY_TARGETS metaforce-gui) +# endif () +#endif () install(TARGETS ${BINARY_TARGETS} DESTINATION ${BIN_PREFIX}) if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo) foreach (target IN LISTS BINARY_TARGETS DSYM_ONLY_TARGETS) diff --git a/DataSpec/DNACommon/AROTBuilder.hpp b/DataSpec/DNACommon/AROTBuilder.hpp index 9e32b23b9..df42876a7 100644 --- a/DataSpec/DNACommon/AROTBuilder.hpp +++ b/DataSpec/DNACommon/AROTBuilder.hpp @@ -4,7 +4,7 @@ #include "DeafBabe.hpp" #include "zeus/CAABox.hpp" #include "CMDL.hpp" -#include "IOStreams.hpp" +#include #include namespace DataSpec { diff --git a/DataSpec/DNACommon/CMDL.cpp b/DataSpec/DNACommon/CMDL.cpp index 2af280e61..1baa4d90b 100644 --- a/DataSpec/DNACommon/CMDL.cpp +++ b/DataSpec/DNACommon/CMDL.cpp @@ -9,8 +9,9 @@ #include "DataSpec/DNAMP2/CSKR.hpp" #include "DataSpec/DNAMP3/CMDLMaterials.hpp" #include "DataSpec/DNAMP3/CSKR.hpp" -#include "IOStreams.hpp" +#include +#include #include #include #include diff --git a/DataSpec/DNACommon/PATH.cpp b/DataSpec/DNACommon/PATH.cpp index dff277911..9ef5325fb 100644 --- a/DataSpec/DNACommon/PATH.cpp +++ b/DataSpec/DNACommon/PATH.cpp @@ -2,6 +2,7 @@ #include "hecl/Blender/Connection.hpp" #include "zeus/CAABox.hpp" #include "DataSpec/DNACommon/AROTBuilder.hpp" +#include namespace DataSpec::DNAPATH { diff --git a/DataSpec/DNACommon/Tweaks/ITweak.hpp b/DataSpec/DNACommon/Tweaks/ITweak.hpp index 7a3f04709..fb732c492 100644 --- a/DataSpec/DNACommon/Tweaks/ITweak.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweak.hpp @@ -2,12 +2,6 @@ #include "DataSpec/DNACommon/DNACommon.hpp" -namespace hecl { -class CVarManager; -} namespace DataSpec { -struct ITweak : BigDNA { - - virtual void initCVars(hecl::CVarManager*) {} -}; +struct ITweak : BigDNA {}; } // namespace DataSpec diff --git a/DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp b/DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp index eaf9397a6..0f38c8b7f 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp @@ -4,60 +4,5 @@ namespace DataSpec { struct ITweakAutoMapper : public ITweak { - virtual bool GetShowOneMiniMapArea() const = 0; - virtual bool GetScaleMoveSpeedWithCamDist() const = 0; - virtual float GetCamDist() const = 0; - virtual float GetMinCamDist() const = 0; - virtual float GetMaxCamDist() const = 0; - virtual float GetMinCamRotateX() const = 0; - virtual float GetMaxCamRotateX() const = 0; - virtual float GetCamAngle() const = 0; - virtual const zeus::CColor& GetAutomapperWidgetColor() const = 0; - virtual float GetMiniCamDist() const = 0; - virtual float GetMiniCamXAngle() const = 0; - virtual float GetMiniCamAngle() const = 0; - virtual const zeus::CColor& GetAutomapperWidgetMiniColor() const = 0; - virtual const zeus::CColor& GetSurfaceVisitedColor() const = 0; - virtual const zeus::CColor& GetOutlineVisitedColor() const = 0; - virtual const zeus::CColor& GetSurfaceUnvisitedColor() const = 0; - virtual const zeus::CColor& GetOutlineUnvisitedColor() const = 0; - virtual const zeus::CColor& GetSurfaceSelectVisitedColor() const = 0; - virtual const zeus::CColor& GetOutlineSelectVisitedColor() const = 0; - virtual float GetMapSurfaceNormColorLinear() const = 0; - virtual float GetMapSurfaceNormColorConstant() const = 0; - virtual float GetOpenMapScreenTime() const = 0; - virtual float GetCloseMapScreenTime() const = 0; - virtual float GetHintPanTime() const = 0; - virtual float GetCamZoomUnitsPerFrame() const = 0; - virtual float GetCamRotateDegreesPerFrame() const = 0; - virtual float GetBaseMapScreenCameraMoveSpeed() const = 0; - virtual const zeus::CColor& GetSurfaceSelectUnvisitedColor() const = 0; - virtual const zeus::CColor& GetOutlineSelectUnvisitedColor() const = 0; - virtual float GetMiniAlphaSurfaceVisited() const = 0; - virtual float GetAlphaSurfaceVisited() const = 0; - virtual float GetMiniAlphaOutlineVisited() const = 0; - virtual float GetAlphaOutlineVisited() const = 0; - virtual float GetMiniAlphaSurfaceUnvisited() const = 0; - virtual float GetAlphaSurfaceUnvisited() const = 0; - virtual float GetMiniAlphaOutlineUnvisited() const = 0; - virtual float GetAlphaOutlineUnvisited() const = 0; - virtual const zeus::CVector3f& GetDoorCenter() const = 0; - virtual float GetMiniMapViewportWidth() const = 0; - virtual float GetMiniMapViewportHeight() const = 0; - virtual float GetMiniMapCamDistScale() const = 0; - virtual float GetMapPlaneScaleX() const = 0; - virtual float GetMapPlaneScaleZ() const = 0; - virtual float GetUniverseCamDist() const = 0; - virtual float GetMinUniverseCamDist() const = 0; - virtual float GetMaxUniverseCamDist() const = 0; - virtual float GetSwitchToFromUniverseTime() const = 0; - virtual float GetCamPanUnitsPerFrame() const = 0; - virtual float GetAutomapperScaleX() const = 0; - virtual float GetAutomapperScaleZ() const = 0; - virtual float GetCamVerticalOffset() const = 0; - virtual const zeus::CColor& GetMiniMapSamusModColor() const = 0; - virtual const zeus::CColor& GetAreaFlashPulseColor() const = 0; - virtual const zeus::CColor& GetDoorColor(int idx) const = 0; - virtual const zeus::CColor& GetOpenDoorColor() const = 0; }; } // namespace DataSpec diff --git a/DataSpec/DNACommon/Tweaks/ITweakGame.hpp b/DataSpec/DNACommon/Tweaks/ITweakGame.hpp index 75364b2e8..494f92043 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakGame.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakGame.hpp @@ -4,23 +4,5 @@ namespace DataSpec { -struct ITweakGame : ITweak { - virtual std::string_view GetWorldPrefix() const = 0; - virtual bool GetSplashScreensDisabled() const = 0; - virtual float GetFirstPersonFOV() const = 0; - virtual float GetPressStartDelay() const = 0; - virtual float GetWavecapIntensityNormal() const = 0; - virtual float GetWavecapIntensityPoison() const = 0; - virtual float GetWavecapIntensityLava() const = 0; - virtual float GetRippleIntensityNormal() const = 0; - virtual float GetRippleIntensityPoison() const = 0; - virtual float GetRippleIntensityLava() const = 0; - virtual float GetFluidEnvBumpScale() const = 0; - virtual float GetWaterFogDistanceBase() const = 0; - virtual float GetWaterFogDistanceRange() const = 0; - virtual float GetGravityWaterFogDistanceBase() const = 0; - virtual float GetGravityWaterFogDistanceRange() const = 0; - virtual float GetHardModeDamageMultiplier() const = 0; - virtual float GetHardModeWeaponMultiplier() const = 0; -}; +struct ITweakGame : ITweak {}; } // namespace DataSpec diff --git a/DataSpec/DNACommon/Tweaks/ITweakGui.hpp b/DataSpec/DNACommon/Tweaks/ITweakGui.hpp index 9ea42cd27..5f3b260e7 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakGui.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakGui.hpp @@ -7,135 +7,7 @@ namespace DataSpec { struct ITweakGui : ITweak { enum class EHudVisMode : atUint32 { Zero, One, Two, Three }; - enum class EHelmetVisMode : atUint32 { ReducedUpdate, NotVisible, Deco, HelmetDeco, GlowHelmetDeco, HelmetOnly }; - - virtual float GetMapAlphaInterpolant() const = 0; - virtual float GetPauseBlurFactor() const = 0; - virtual float GetRadarXYRadius() const = 0; - virtual float GetRadarZRadius() const = 0; - virtual float GetRadarZCloseRadius() const = 0; - virtual float GetEnergyBarFilledSpeed() const = 0; - virtual float GetEnergyBarShadowSpeed() const = 0; - virtual float GetEnergyBarDrainDelay() const = 0; - virtual bool GetEnergyBarAlwaysResetDelay() const = 0; - virtual float GetHudDamagePracticalsGainConstant() const = 0; - virtual float GetHudDamagePracticalsGainLinear() const = 0; - virtual float GetHudDamagePracticalsInitConstant() const = 0; - virtual float GetHudDamagePracticalsInitLinear() const = 0; - virtual float GetHudDamageLightSpotAngle() const = 0; - virtual float GetDamageLightAngleC() const = 0; - virtual float GetDamageLightAngleL() const = 0; - virtual float GetDamageLightAngleQ() const = 0; - virtual atVec3f GetDamageLightPreTranslate() const = 0; - virtual atVec3f GetDamageLightCenterTranslate() const = 0; - virtual float GetDamageLightXfXAngle() const = 0; - virtual float GetDamageLightXfZAngle() const = 0; - virtual float GetHudDecoShakeTranslateVelConstant() const = 0; - virtual float GetHudDecoShakeTranslateVelLinear() const = 0; - virtual float GetMaxDecoDamageShakeTranslate() const = 0; - virtual float GetDecoDamageShakeDeceleration() const = 0; - virtual float GetDecoShakeGainConstant() const = 0; - virtual float GetDecoShakeGainLinear() const = 0; - virtual float GetDecoShakeInitConstant() const = 0; - virtual float GetDecoShakeInitLinear() const = 0; - virtual float GetMaxDecoDamageShakeRotate() const = 0; - virtual atUint32 GetHudCamFovTweak() const = 0; - virtual atUint32 GetHudCamYTweak() const = 0; - virtual atUint32 GetHudCamZTweak() const = 0; - virtual float GetBeamVisorMenuAnimTime() const = 0; - virtual float GetVisorBeamMenuItemActiveScale() const = 0; - virtual float GetVisorBeamMenuItemInactiveScale() const = 0; - virtual float GetVisorBeamMenuItemTranslate() const = 0; - virtual float GetThreatRange() const = 0; - virtual float GetRadarScopeCoordRadius() const = 0; - virtual float GetRadarPlayerPaintRadius() const = 0; - virtual float GetRadarEnemyPaintRadius() const = 0; - virtual float GetMissileArrowVisTime() const = 0; - virtual EHudVisMode GetHudVisMode() const = 0; - virtual EHelmetVisMode GetHelmetVisMode() const = 0; - virtual atUint32 GetEnableAutoMapper() const = 0; - virtual atUint32 GetEnableTargetingManager() const = 0; - virtual atUint32 GetEnablePlayerVisor() const = 0; - virtual float GetThreatWarningFraction() const = 0; - virtual float GetMissileWarningFraction() const = 0; - virtual float GetFreeLookFadeTime() const = 0; - virtual float GetFreeLookSfxPitchScale() const = 0; - virtual bool GetNoAbsoluteFreeLookSfxPitch() const = 0; - virtual float GetFaceReflectionOrthoWidth() const = 0; - virtual float GetFaceReflectionOrthoHeight() const = 0; - virtual float GetFaceReflectionDistance() const = 0; - virtual float GetFaceReflectionHeight() const = 0; - virtual float GetFaceReflectionAspect() const = 0; - virtual float GetMissileWarningPulseTime() const = 0; - virtual float GetExplosionLightFalloffMultConstant() const = 0; - virtual float GetExplosionLightFalloffMultLinear() const = 0; - virtual float GetExplosionLightFalloffMultQuadratic() const = 0; - virtual float GetHudDamagePeakFactor() const = 0; - virtual float GetHudDamageFilterGainConstant() const = 0; - virtual float GetHudDamageFilterGainLinear() const = 0; - virtual float GetHudDamageFilterInitConstant() const = 0; - virtual float GetHudDamageFilterInitLinear() const = 0; - virtual float GetEnergyDrainModPeriod() const = 0; - virtual bool GetEnergyDrainSinusoidalPulse() const = 0; - virtual bool GetEnergyDrainFilterAdditive() const = 0; - virtual float GetHudDamagePulseDuration() const = 0; - virtual float GetHudDamageColorGain() const = 0; - virtual float GetHudDecoShakeTranslateGain() const = 0; - virtual float GetHudLagOffsetScale() const = 0; - virtual float GetScanAppearanceDuration() const = 0; - virtual float GetScanPaneFlashFactor() const = 0; - virtual float GetScanPaneFadeInTime() const = 0; - virtual float GetScanPaneFadeOutTime() const = 0; - virtual float GetBallViewportYReduction() const = 0; - virtual float GetScanWindowIdleWidth() const = 0; - virtual float GetScanWindowIdleHeight() const = 0; - virtual float GetScanWindowActiveWidth() const = 0; - virtual float GetScanWindowActiveHeight() const = 0; - virtual float GetScanWindowMagnification() const = 0; - virtual float GetScanWindowScanningAspect() const = 0; - virtual float GetScanSpeed(int idx) const = 0; - virtual float GetXrayBlurScaleLinear() const = 0; - virtual float GetXrayBlurScaleQuadratic() const = 0; - virtual float GetScanSidesAngle() const = 0; - virtual float GetScanSidesXScale() const = 0; - virtual float GetScanSidesPositionEnd() const = 0; - virtual float GetScanSidesDuration() const = 0; - virtual float GetScanSidesStartTime() const = 0; - virtual float GetScanSidesEndTime() const = 0; - virtual float GetScanDataDotRadius() const = 0; - virtual float GetScanDataDotPosRandMagnitude() const = 0; - virtual float GetScanDataDotSeekDurationMin() const = 0; - virtual float GetScanDataDotSeekDurationMax() const = 0; - virtual float GetScanDataDotHoldDurationMin() const = 0; - virtual float GetScanDataDotHoldDurationMax() const = 0; - virtual float GetScanSidesPositionStart() const = 0; - virtual bool GetShowAutomapperInMorphball() const = 0; - virtual bool GetLatchArticleText() const = 0; - virtual float GetWorldTransManagerCharsPerSfx() const = 0; - virtual atUint32 GetXRayFogMode() const = 0; - virtual float GetXRayFogNearZ() const = 0; - virtual float GetXRayFogFarZ() const = 0; - virtual const zeus::CColor& GetXRayFogColor() const = 0; - virtual float GetThermalVisorLevel() const = 0; - virtual const zeus::CColor& GetThermalVisorColor() const = 0; - virtual const zeus::CColor& GetVisorHudLightAdd(int v) const = 0; - virtual const zeus::CColor& GetVisorHudLightMultiply(int v) const = 0; - virtual const zeus::CColor& GetHudReflectivityLightColor() const = 0; - virtual float GetHudLightAttMulConstant() const = 0; - virtual float GetHudLightAttMulLinear() const = 0; - virtual float GetHudLightAttMulQuadratic() const = 0; - virtual std::string_view GetCreditsTable() const = 0; - virtual std::string_view GetCreditsFont() const = 0; - virtual std::string_view GetJapaneseCreditsFont() const = 0; - virtual const zeus::CColor& GetCreditsTextFontColor() const = 0; - virtual const zeus::CColor& GetCreditsTextBorderColor() const = 0; - - static float FaceReflectionDistanceDebugValueToActualValue(float v) { return 0.015f * v + 0.2f; } - static float FaceReflectionHeightDebugValueToActualValue(float v) { return 0.005f * v - 0.05f; } - static float FaceReflectionAspectDebugValueToActualValue(float v) { return 0.05f * v + 1.f; } - static float FaceReflectionOrthoWidthDebugValueToActualValue(float v) { return 0.007f * v + 0.02f; } - static float FaceReflectionOrthoHeightDebugValueToActualValue(float v) { return 0.007f * v + 0.02f; } }; } // namespace DataSpec diff --git a/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp b/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp index ca5592846..220cb5e8e 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp @@ -5,140 +5,6 @@ namespace DataSpec { -struct ITweakPlayer : ITweak { - virtual float GetMaxTranslationalAcceleration(int s) const = 0; - virtual float GetMaxRotationalAcceleration(int s) const = 0; - virtual float GetPlayerTranslationFriction(int s) const = 0; - virtual float GetPlayerRotationFriction(int s) const = 0; - virtual float GetPlayerRotationMaxSpeed(int s) const = 0; - virtual float GetPlayerTranslationMaxSpeed(int s) const = 0; - virtual float GetNormalGravAccel() const = 0; - virtual float GetFluidGravAccel() const = 0; - virtual float GetVerticalJumpAccel() const = 0; - virtual float GetHorizontalJumpAccel() const = 0; - virtual float GetVerticalDoubleJumpAccel() const = 0; - virtual float GetHorizontalDoubleJumpAccel() const = 0; - virtual float GetWaterJumpFactor() const = 0; - virtual float GetWaterBallJumpFactor() const = 0; - virtual float GetLavaJumpFactor() const = 0; - virtual float GetLavaBallJumpFactor() const = 0; - virtual float GetPhazonJumpFactor() const = 0; - virtual float GetPhazonBallJumpFactor() const = 0; - virtual float GetAllowedJumpTime() const = 0; - virtual float GetAllowedDoubleJumpTime() const = 0; - virtual float GetMinDoubleJumpWindow() const = 0; - virtual float GetMaxDoubleJumpWindow() const = 0; - virtual float GetMinJumpTime() const = 0; - virtual float GetMinDoubleJumpTime() const = 0; - virtual float GetAllowedLedgeTime() const = 0; - virtual float GetDoubleJumpImpulse() const = 0; - virtual float GetBackwardsForceMultiplier() const = 0; - virtual float GetBombJumpRadius() const = 0; - virtual float GetBombJumpHeight() const = 0; - virtual float GetEyeOffset() const = 0; - virtual float GetTurnSpeedMultiplier() const = 0; - virtual float GetFreeLookTurnSpeedMultiplier() const = 0; - virtual float GetFreeLookSpeed() const = 0; - virtual float GetFreeLookSnapSpeed() const = 0; - virtual float GetFreeLookCenteredThresholdAngle() const = 0; - virtual float GetFreeLookCenteredTime() const = 0; - virtual float GetOrbitModeTimer() const = 0; - virtual float GetOrbitUpperAngle() const = 0; - virtual float GetOrbitLowerAngle() const = 0; - virtual float GetOrbitHorizAngle() const = 0; - virtual float GetOrbitMaxTargetDistance() const = 0; - virtual float GetOrbitMaxLockDistance() const = 0; - virtual float GetOrbitDistanceThreshold() const = 0; - virtual uint32_t GetOrbitScreenBoxHalfExtentX(int zone) const = 0; - virtual uint32_t GetOrbitScreenBoxHalfExtentY(int zone) const = 0; - virtual uint32_t GetOrbitScreenBoxCenterX(int zone) const = 0; - virtual uint32_t GetOrbitScreenBoxCenterY(int zone) const = 0; - virtual uint32_t GetOrbitZoneIdealX(int zone) const = 0; - virtual uint32_t GetOrbitZoneIdealY(int zone) const = 0; - virtual float GetOrbitNearX() const = 0; - virtual float GetOrbitNearZ() const = 0; - virtual float GetOrbitFixedOffsetZDiff() const = 0; - virtual float GetOrbitZRange() const = 0; - virtual bool GetDashEnabled() const = 0; - virtual bool GetDashOnButtonRelease() const = 0; - virtual float GetDashButtonHoldCancelTime() const = 0; - virtual float GetDashStrafeInputThreshold() const = 0; - virtual float GetSidewaysDoubleJumpImpulse() const = 0; - virtual float GetSidewaysVerticalDoubleJumpAccel() const = 0; - virtual float GetSidewaysHorizontalDoubleJumpAccel() const = 0; - virtual float GetScanningRange() const = 0; // x218 - virtual bool GetScanRetention() const = 0; - virtual bool GetScanFreezesGame() const = 0; // x21c_25 - virtual bool GetOrbitWhileScanning() const = 0; - virtual bool GetFallingDoubleJump() const = 0; - virtual bool GetImpulseDoubleJump() const = 0; - virtual bool GetFiringCancelsCameraPitch() const = 0; - virtual bool GetAssistedAimingIgnoreHorizontal() const = 0; - virtual bool GetAssistedAimingIgnoreVertical() const = 0; - virtual float GetAimMaxDistance() const = 0; - virtual float GetAimThresholdDistance() const = 0; - virtual float GetAimBoxWidth() const = 0; - virtual float GetAimBoxHeight() const = 0; - virtual float GetAimTargetTimer() const = 0; - virtual float GetAimAssistHorizontalAngle() const = 0; - virtual float GetAimAssistVerticalAngle() const = 0; - virtual float GetScanMaxTargetDistance() const = 0; - virtual float GetScanMaxLockDistance() const = 0; - virtual bool GetMoveDuringFreeLook() const = 0; - virtual bool GetHoldButtonsForFreeLook() const = 0; - virtual bool GetTwoButtonsForFreeLook() const = 0; - virtual bool GetAimWhenOrbitingPoint() const = 0; - virtual bool GetStayInFreeLookWhileFiring() const = 0; - virtual bool GetOrbitFixedOffset() const = 0; - virtual bool GetGunButtonTogglesHolster() const = 0; - virtual bool GetGunNotFiringHolstersGun() const = 0; - virtual float GetPlayerHeight() const = 0; // x26c - virtual float GetPlayerXYHalfExtent() const = 0; // x270 - virtual bool GetFreeLookTurnsPlayer() const = 0; // x228_24 - virtual float GetStepUpHeight() const = 0; // x274 - virtual float GetStepDownHeight() const = 0; // x278 - virtual float GetPlayerBallHalfExtent() const = 0; // x27c - virtual float GetOrbitDistanceMax() const = 0; - virtual float GetGrappleSwingLength() const = 0; - virtual float GetGrappleSwingPeriod() const = 0; - virtual float GetGrapplePullSpeedMin() const = 0; - virtual float GetMaxGrappleLockedTurnAlignDistance() const = 0; - virtual float GetGrapplePullSpeedProportion() const = 0; - virtual float GetGrapplePullSpeedMax() const = 0; - virtual float GetGrappleLookCenterSpeed() const = 0; - virtual float GetMaxGrappleTurnSpeed() const = 0; - virtual float GetGrappleJumpForce() const = 0; - virtual float GetGrappleReleaseTime() const = 0; - virtual uint32_t GetGrappleJumpMode() const = 0; - virtual bool GetOrbitReleaseBreaksGrapple() const = 0; - virtual bool GetInvertGrappleTurn() const = 0; - virtual float GetGrappleBeamSpeed() const = 0; - virtual float GetGrappleBeamXWaveAmplitude() const = 0; - virtual float GetGrappleBeamZWaveAmplitude() const = 0; - virtual float GetGrappleBeamAnglePhaseDelta() const = 0; - virtual float GetHorizontalFreeLookAngleVel() const = 0; - virtual float GetVerticalFreeLookAngleVel() const = 0; // x134 - virtual float GetOrbitCameraSpeed() const = 0; // x184 - virtual float GetOrbitPreventionTime() const = 0; - virtual float GetJumpCameraPitchDownStart() const = 0; // x288 - virtual float GetJumpCameraPitchDownFull() const = 0; // x28c - virtual float GetJumpCameraPitchDownAngle() const = 0; // x290 - virtual float GetFallCameraPitchDownStart() const = 0; // x294 - virtual float GetFallCameraPitchDownFull() const = 0; // x298 - virtual float GetFallCameraPitchDownAngle() const = 0; // x29c - virtual float GetFirstPersonCameraSpeed() const = 0; // x280 - virtual float GetGrappleCameraSpeed() const = 0; // x2b0 - virtual float GetFreeLookDampenFactor() const = 0; // x14c - virtual float GetLeftLogicalThreshold() const = 0; - virtual float GetRightLogicalThreshold() const = 0; - virtual float GetOrbitMinDistance(int type) const = 0; - virtual float GetOrbitNormalDistance(int type) const = 0; - virtual float GetOrbitMaxDistance(int type) const = 0; - virtual float GetFrozenTimeout() const = 0; - virtual uint32_t GetIceBreakJumpCount() const = 0; - virtual float GetVariaDamageReduction() const = 0; - virtual float GetGravityDamageReduction() const = 0; - virtual float GetPhazonDamageReduction() const = 0; -}; +struct ITweakPlayer : ITweak {}; } // namespace DataSpec diff --git a/DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp b/DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp index 6f523e10c..58b9c5c39 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp @@ -4,8 +4,6 @@ namespace DataSpec { -struct ITweakPlayerControl : ITweak { - virtual atUint32 GetMapping(atUint32) const = 0; -}; +struct ITweakPlayerControl : ITweak {}; } // namespace DataSpec diff --git a/DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp b/DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp index 9f9ffa00f..1a4c3fbca 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp @@ -43,30 +43,5 @@ struct SWeaponInfo : BigDNA { struct ITweakPlayerGun : ITweak { AT_DECL_DNA_YAML - virtual float GetUpLookAngle() const = 0; - virtual float GetDownLookAngle() const = 0; - virtual float GetVerticalSpread() const = 0; - virtual float GetHorizontalSpread() const = 0; - virtual float GetHighVerticalSpread() const = 0; - virtual float GetHighHorizontalSpread() const = 0; - virtual float GetLowVerticalSpread() const = 0; - virtual float GetLowHorizontalSpread() const = 0; - virtual float GetAimVerticalSpeed() const = 0; // x24 - virtual float GetAimHorizontalSpeed() const = 0; // x28 - virtual float GetBombFuseTime() const = 0; // x2c - virtual float GetBombDropDelayTime() const = 0; // x30 - virtual float GetHoloHoldTime() const = 0; // x34 - virtual float GetGunTransformTime() const = 0; // x38 - virtual float GetGunHolsterTime() const = 0; - virtual float GetGunNotFiringTime() const = 0; - virtual float GetFixedVerticalAim() const = 0; - virtual float GetGunExtendDistance() const = 0; - virtual const zeus::CVector3f& GetGunPosition() const = 0; - virtual const zeus::CVector3f& GetGrapplingArmPosition() const = 0; - virtual float GetRichochetDamage(atUint32) const = 0; - virtual const SWeaponInfo& GetBeamInfo(atInt32 beam) const = 0; - virtual const SComboShotParam& GetComboShotInfo(atInt32 beam) const = 0; - virtual const SShotParam& GetBombInfo() const = 0; - virtual const SShotParam& GetPowerBombInfo() const = 0; }; } // namespace DataSpec diff --git a/DataSpec/DNAMP1/CMakeLists.txt b/DataSpec/DNAMP1/CMakeLists.txt index 4b16eaaca..9c28078fc 100644 --- a/DataSpec/DNAMP1/CMakeLists.txt +++ b/DataSpec/DNAMP1/CMakeLists.txt @@ -60,10 +60,9 @@ set(DNAMP1_SOURCES FRME.cpp SCAN.cpp DeafBabe.cpp - Tweaks/CTweakAutoMapper.cpp Tweaks/CTweakPlayer.cpp Tweaks/CTweakTargeting.cpp Tweaks/CTweakBall.cpp - Tweaks/CTweakGame.cpp) + ) dataspec_add_list(DNAMP1 DNAMP1_SOURCES) diff --git a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp deleted file mode 100644 index ae93c7c1e..000000000 --- a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include "DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp" - -#include -#include - -#define PREFIX(v) std::string_view("tweak.automap." #v) -namespace DataSpec::DNAMP1 { -namespace { -constexpr std::string_view skShowOneMiniMapArea = PREFIX(ShowOneMiniMapArea); -constexpr std::string_view skScaleMoveSpeedWithCamDist = PREFIX(ScaleMoveSpeedWithCamDist); -constexpr std::string_view skCamDist = PREFIX(CamDist); -constexpr std::string_view skMinCameraDist = PREFIX(MinCamDist); -constexpr std::string_view skMaxCamDist = PREFIX(MaxCamDist); -constexpr std::string_view skMinCamRotX = PREFIX(MinCamRotX); -constexpr std::string_view skMaxCamRotX = PREFIX(MaxCamRotX); -constexpr std::string_view skCamAngle = PREFIX(CamAngle); -constexpr std::string_view skWidgetColor = PREFIX(WidgetColor); -constexpr std::string_view skMiniCamDist = PREFIX(MiniCamDist); -constexpr std::string_view skMiniCamXAngle = PREFIX(MiniCamXAngle); -constexpr std::string_view skMiniCamAngle = PREFIX(MiniCamAngle); -constexpr std::string_view skVisitedSurfaceColor = PREFIX(VisitedSurfaceColor); -constexpr std::string_view skVisitedOutlineColor = PREFIX(VisitedOutlineColor); -constexpr std::string_view skUnvisitedSurfaceColor = PREFIX(UnvisitedSurfaceColor); -constexpr std::string_view skUnvisitedOutlineColor = PREFIX(UnvisitedOutlineColor); -constexpr std::string_view skSelectedVisitedSurfaceColor = PREFIX(SelectedVisitedSurfaceColor); -constexpr std::string_view skSelectedVisitedOutlineColor = PREFIX(SelectedVisitedOutlineColor); -constexpr std::string_view skMapSurfaceNormalColorLinear = PREFIX(MapSurfaceNormalColorLinear); -constexpr std::string_view skMapSurfaceNormalColorConstant = PREFIX(MapSurfaceNormalColorConstant); -hecl::CVar* tw_showOneMiniMapArea = nullptr; -hecl::CVar* tw_scaleMoveSpeedWithCamDist = nullptr; -hecl::CVar* tw_camDist = nullptr; -hecl::CVar* tw_minCamDist = nullptr; -hecl::CVar* tw_maxCamDist = nullptr; -hecl::CVar* tw_minCamRotX = nullptr; -hecl::CVar* tw_maxCamRotX = nullptr; -hecl::CVar* tw_camAngle = nullptr; -hecl::CVar* tw_widgetColor = nullptr; -hecl::CVar* tw_miniCamDist = nullptr; -hecl::CVar* tw_miniCamXAngle = nullptr; -hecl::CVar* tw_miniCamAngle = nullptr; -hecl::CVar* tw_visitedsurfaceColor = nullptr; -hecl::CVar* tw_visitedOutlineColor = nullptr; -hecl::CVar* tw_unvisitedSurfaceColor = nullptr; -hecl::CVar* tw_unvisitedOutlineColor = nullptr; -hecl::CVar* tw_selectedVisitedSurfaceColor = nullptr; -hecl::CVar* tw_selectedVisitedOutlineColor = nullptr; -hecl::CVar* tw_mapSurfaceNormColorLinear = nullptr; -hecl::CVar* tw_mapSurfaceNormColorConstant = nullptr; -} // namespace - -void CTweakAutoMapper::_tweakListener(hecl::CVar* cv) { - if (cv == tw_showOneMiniMapArea) { - x4_24_showOneMiniMapArea = cv->toBoolean(); - } else if (cv == tw_scaleMoveSpeedWithCamDist) { - x4_26_scaleMoveSpeedWithCamDist = cv->toBoolean(); - } else if (cv == tw_camDist) { - x8_camDist = cv->toReal(); - } else if (cv == tw_minCamDist) { - xc_minCamDist = cv->toReal(); - } else if (cv == tw_maxCamDist) { - x10_maxCamDist = cv->toReal(); - } else if (cv == tw_minCamRotX) { - x14_minCamRotateX = cv->toReal(); - } else if (cv == tw_maxCamRotX) { - x18_maxCamRotateX = cv->toReal(); - } else if (cv == tw_camAngle) { - x1c_camAngle = cv->toReal(); - } else if (cv == tw_widgetColor) { - x24_automapperWidgetColor = zeus::CColor(cv->toVec4f()); - } else if (cv == tw_miniCamDist) { - x28_miniCamDist = cv->toReal(); - } else if (cv == tw_miniCamXAngle) { - x2c_miniCamXAngle = tw_miniCamXAngle->toReal(); - } else if (cv == tw_miniCamAngle) { - x30_miniCamAngle = tw_miniCamAngle->toReal(); - } else if (cv == tw_visitedsurfaceColor) { - x3c_surfColorVisited = zeus::CColor(tw_visitedsurfaceColor->toVec4f()); - } else if (cv == tw_visitedOutlineColor) { - x40_outlineColorVisited = zeus::CColor(tw_visitedOutlineColor->toVec4f()); - } else if (cv == tw_unvisitedSurfaceColor) { - x44_surfColorUnvisited = zeus::CColor(tw_unvisitedSurfaceColor->toVec4f()); - } else if (cv == tw_unvisitedOutlineColor) { - x48_outlineColorUnvisited = zeus::CColor(tw_unvisitedOutlineColor->toVec4f()); - } else if (cv == tw_selectedVisitedSurfaceColor) { - x4c_surfaceSelectColorVisited = zeus::CColor(tw_selectedVisitedSurfaceColor->toVec4f()); - } else if (cv == tw_selectedVisitedOutlineColor) { - x50_outlineSelectColorVisited = zeus::CColor(tw_selectedVisitedOutlineColor->toVec4f()); - } else if (cv == tw_mapSurfaceNormColorLinear) { - x54_mapSurfaceNormColorLinear = tw_mapSurfaceNormColorLinear->toReal(); - } else if (cv == tw_mapSurfaceNormColorConstant) { - x58_mapSurfaceNormColorConstant = tw_mapSurfaceNormColorConstant->toReal(); - } -} - -void CTweakAutoMapper::initCVars(hecl::CVarManager* mgr) { - auto assignBool = [this, mgr](std::string_view name, std::string_view desc, bool& v, hecl::CVar::EFlags flags) { - hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags); - // Check if the CVar was deserialized, this avoid an unnecessary conversion - if (cv->wasDeserialized()) - v = cv->toBoolean(); - cv->addListener([this](hecl::CVar* cv) { _tweakListener(cv); }); - return cv; - }; - - auto assignRealValue = [this, mgr](std::string_view name, std::string_view desc, float& v, hecl::CVar::EFlags flags) { - hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags); - // Check if the CVar was deserialized, this avoid an unnecessary conversion - if (cv->wasDeserialized()) - v = cv->toReal(); - cv->addListener([this](hecl::CVar* cv) { _tweakListener(cv); }); - return cv; - }; - - auto assignColorValue = [this, mgr](std::string_view name, std::string_view desc, zeus::CColor& v, - hecl::CVar::EFlags flags) { - atVec4f vec{v.mSimd}; - hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, vec, flags | hecl::CVar::EFlags::Color); - // Check if the CVar was deserialized, this avoid an unnecessary conversion - if (cv->wasDeserialized()) - v = zeus::CColor(cv->toVec4f()); - cv->addListener([this](hecl::CVar* cv) { _tweakListener(cv); }); - return cv; - }; - - tw_showOneMiniMapArea = assignBool(skShowOneMiniMapArea, "", x4_24_showOneMiniMapArea, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_scaleMoveSpeedWithCamDist = - assignBool(skScaleMoveSpeedWithCamDist, "", x4_26_scaleMoveSpeedWithCamDist, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_camDist = assignRealValue(skCamDist, "", x8_camDist, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_minCamDist = assignRealValue(skMinCameraDist, "", xc_minCamDist, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_maxCamDist = assignRealValue(skMaxCamDist, "", x10_maxCamDist, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_minCamRotX = assignRealValue(skMinCamRotX, "", x14_minCamRotateX, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_maxCamRotX = assignRealValue(skMaxCamRotX, "", x18_maxCamRotateX, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_camAngle = assignRealValue(skCamAngle, "", x1c_camAngle, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_widgetColor = assignColorValue(skWidgetColor, "", x24_automapperWidgetColor, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_miniCamDist = assignRealValue(skMiniCamDist, "", x28_miniCamDist, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_miniCamXAngle = assignRealValue(skMiniCamXAngle, "", x2c_miniCamXAngle, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_miniCamAngle = assignRealValue(skMiniCamAngle, "", x30_miniCamAngle, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_widgetColor = assignColorValue(skWidgetColor, "", x38_automapperWidgetMiniColor, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_visitedsurfaceColor = assignColorValue(skVisitedSurfaceColor, "", x3c_surfColorVisited, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_visitedOutlineColor = assignColorValue(skVisitedOutlineColor, "", x40_outlineColorVisited, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_unvisitedSurfaceColor = assignColorValue(skUnvisitedSurfaceColor, "", x44_surfColorUnvisited, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_unvisitedOutlineColor = - assignColorValue(skUnvisitedOutlineColor, "", x48_outlineColorUnvisited, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_selectedVisitedSurfaceColor = assignColorValue(skSelectedVisitedSurfaceColor, "", x4c_surfaceSelectColorVisited, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_selectedVisitedOutlineColor = assignColorValue(skSelectedVisitedOutlineColor, "", x50_outlineSelectColorVisited, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_mapSurfaceNormColorLinear = assignRealValue(skMapSurfaceNormalColorLinear, "", x54_mapSurfaceNormColorLinear, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); - tw_mapSurfaceNormColorConstant = assignRealValue(skMapSurfaceNormalColorConstant, "", x58_mapSurfaceNormColorConstant, - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Color | - hecl::CVar::EFlags::Gui | hecl::CVar::EFlags::Archive); -} -} // namespace DataSpec::DNAMP1 \ No newline at end of file diff --git a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp index 291e237ed..a0f9e6609 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp @@ -79,67 +79,5 @@ struct CTweakAutoMapper final : public ITweakAutoMapper { Vector x104_doorColors; DNAColor x118_doorBorderColor; DNAColor x11c_openDoorColor; - - CTweakAutoMapper() = default; - CTweakAutoMapper(athena::io::IStreamReader& r) { this->read(r); } - bool GetShowOneMiniMapArea() const override { return x4_24_showOneMiniMapArea; } - bool GetScaleMoveSpeedWithCamDist() const override { return x4_26_scaleMoveSpeedWithCamDist; } - float GetCamDist() const override { return x8_camDist; } - float GetMinCamDist() const override { return xc_minCamDist; } - float GetMaxCamDist() const override { return x10_maxCamDist; } - float GetMinCamRotateX() const override { return x14_minCamRotateX; } - float GetMaxCamRotateX() const override { return x18_maxCamRotateX; } - float GetCamAngle() const override { return x1c_camAngle; } - const zeus::CColor& GetAutomapperWidgetColor() const override { return x24_automapperWidgetColor; } - float GetMiniCamDist() const override { return x28_miniCamDist; } - float GetMiniCamXAngle() const override { return x2c_miniCamXAngle; } - float GetMiniCamAngle() const override { return x30_miniCamAngle; } - const zeus::CColor& GetAutomapperWidgetMiniColor() const override { return x38_automapperWidgetMiniColor; } - const zeus::CColor& GetSurfaceVisitedColor() const override { return x3c_surfColorVisited; } - const zeus::CColor& GetOutlineVisitedColor() const override { return x40_outlineColorVisited; } - const zeus::CColor& GetSurfaceUnvisitedColor() const override { return x44_surfColorUnvisited; } - const zeus::CColor& GetOutlineUnvisitedColor() const override { return x48_outlineColorUnvisited; } - const zeus::CColor& GetSurfaceSelectVisitedColor() const override { return x4c_surfaceSelectColorVisited; } - const zeus::CColor& GetOutlineSelectVisitedColor() const override { return x50_outlineSelectColorVisited; } - float GetMapSurfaceNormColorLinear() const override { return x54_mapSurfaceNormColorLinear; } - float GetMapSurfaceNormColorConstant() const override { return x58_mapSurfaceNormColorConstant; } - float GetOpenMapScreenTime() const override { return x64_openMapScreenTime; } - float GetCloseMapScreenTime() const override { return x68_closeMapScreenTime; } - float GetHintPanTime() const override { return x6c_hintPanTime; } - float GetCamZoomUnitsPerFrame() const override { return x70_zoomUnitsPerFrame; } - float GetCamRotateDegreesPerFrame() const override { return x74_rotateDegPerFrame; } - float GetBaseMapScreenCameraMoveSpeed() const override { return x78_baseMapScreenCameraMoveSpeed; } - const zeus::CColor& GetSurfaceSelectUnvisitedColor() const override { return x7c_surfaceSelectColorUnvisited; } - const zeus::CColor& GetOutlineSelectUnvisitedColor() const override { return x80_outlineSelectColorUnvisited; } - float GetMiniAlphaSurfaceVisited() const override { return x84_miniAlphaSurfaceVisited; } - float GetAlphaSurfaceVisited() const override { return x88_alphaSurfaceVisited; } - float GetMiniAlphaOutlineVisited() const override { return x8c_miniAlphaOutlineVisited; } - float GetAlphaOutlineVisited() const override { return x90_alphaOutlineVisited; } - float GetMiniAlphaSurfaceUnvisited() const override { return x94_miniAlphaSurfaceUnvisited; } - float GetAlphaSurfaceUnvisited() const override { return x98_alphaSurfaceUnvisited; } - float GetMiniAlphaOutlineUnvisited() const override { return x9c_miniAlphaOutlineUnvisited; } - float GetAlphaOutlineUnvisited() const override { return xa0_alphaOutlineUnvisited; } - const zeus::CVector3f& GetDoorCenter() const override { return xa4_doorCenter; } - float GetMiniMapViewportWidth() const override { return xb8_miniMapViewportWidth; } - float GetMiniMapViewportHeight() const override { return xbc_miniMapViewportHeight; } - float GetMiniMapCamDistScale() const override { return xc0_miniMapCamDistScale; } - float GetMapPlaneScaleX() const override { return xc4_mapPlaneScaleX; } - float GetMapPlaneScaleZ() const override { return xc8_mapPlaneScaleZ; } - float GetUniverseCamDist() const override { return xd0_universeCamDist; } - float GetMinUniverseCamDist() const override { return xd4_minUniverseCamDist; } - float GetMaxUniverseCamDist() const override { return xd8_maxUniverseCamDist; } - float GetSwitchToFromUniverseTime() const override { return xdc_switchToFromUniverseTime; } - float GetCamPanUnitsPerFrame() const override { return xe0_camPanUnitsPerFrame; } - float GetAutomapperScaleX() const override { return xe4_automapperScaleX; } - float GetAutomapperScaleZ() const override { return xe8_automapperScaleZ; } - float GetCamVerticalOffset() const override { return xec_camVerticalOffset; } - const zeus::CColor& GetMiniMapSamusModColor() const override { return xf0_miniMapSamusModColor; } - const zeus::CColor& GetAreaFlashPulseColor() const override { return xf4_areaFlashPulseColor; } - const zeus::CColor& GetDoorColor(int idx) const override { return x104_doorColors[idx]; } - const zeus::CColor& GetOpenDoorColor() const override { return x11c_openDoorColor; } - void initCVars(hecl::CVarManager*) override; - -private: - void _tweakListener(hecl::CVar* cv); }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp index af30301ef..da813167b 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp @@ -54,36 +54,5 @@ struct CTweakGame final : ITweakGame { Value x5c_gravityWaterFogDistanceRange; Value x60_hardmodeDamageMult; Value x64_hardmodeWeaponMult; - - std::string_view GetWorldPrefix() const override { return x4_worldPrefix; } - std::string_view GetDefaultRoom() const { return x14_defaultRoom; } - bool GetSplashScreensDisabled() const override { return x2b_splashScreensDisabled; } - float GetFirstPersonFOV() const override { return x24_fov; } - float GetPressStartDelay() const override { return x30_pressStartDelay; } - float GetWavecapIntensityNormal() const override { return x34_wavecapIntensityNormal; } - float GetWavecapIntensityPoison() const override { return x38_wavecapIntensityPoison; } - float GetWavecapIntensityLava() const override { return x3c_wavecapIntensityLava; } - float GetRippleIntensityNormal() const override { return x40_rippleIntensityNormal; } - float GetRippleIntensityPoison() const override { return x44_rippleIntensityPoison; } - float GetRippleIntensityLava() const override { return x48_rippleIntensityLava; } - float GetFluidEnvBumpScale() const override { return x4c_fluidEnvBumpScale; } - float GetWaterFogDistanceBase() const override { return x50_waterFogDistanceBase; } - float GetWaterFogDistanceRange() const override { return x54_waterFogDistanceRange; } - float GetGravityWaterFogDistanceBase() const override { return x58_gravityWaterFogDistanceBase; } - float GetGravityWaterFogDistanceRange() const override { return x5c_gravityWaterFogDistanceRange; } - float GetHardModeDamageMultiplier() const override { return x60_hardmodeDamageMult; } - float GetHardModeWeaponMultiplier() const override { return x64_hardmodeWeaponMult; } - CTweakGame() = default; - CTweakGame(athena::io::IStreamReader& in) { - this->read(in); -#ifdef NDEBUG - x2b_splashScreensDisabled = false; -#endif - } - - void initCVars(hecl::CVarManager* mgr) override; - -private: - void _tweakListener(hecl::CVar* cv); }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGui.hpp b/DataSpec/DNAMP1/Tweaks/CTweakGui.hpp index 557b97527..e6d6eac15 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGui.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGui.hpp @@ -1,6 +1,6 @@ #pragma once -#include "../../DNACommon/Tweaks/ITweakGui.hpp" +#include "DataSpec/DNACommon/Tweaks/ITweakGui.hpp" namespace DataSpec::DNAMP1 { struct CTweakGui final : ITweakGui { @@ -182,157 +182,6 @@ struct CTweakGui final : ITweakGui { Value x364_; CTweakGui() = default; - CTweakGui(athena::io::IStreamReader& r) { - this->read(r); - FixupValues(); - } - - float GetMapAlphaInterpolant() const override { return x8_mapAlphaInterp; } - float GetPauseBlurFactor() const override { return xc_pauseBlurFactor; } - float GetRadarXYRadius() const override { return x10_radarXYRadius; } - float GetRadarZRadius() const override { return x24_radarZRadius; } - float GetRadarZCloseRadius() const override { return x28_radarZCloseRadius; } - float GetEnergyBarFilledSpeed() const override { return x34_energyBarFilledSpeed; } - float GetEnergyBarShadowSpeed() const override { return x38_energyBarShadowSpeed; } - float GetEnergyBarDrainDelay() const override { return x3c_energyBarDrainDelay; } - bool GetEnergyBarAlwaysResetDelay() const override { return x40_energyBarAlwaysResetDelay; } - float GetHudDamagePracticalsGainConstant() const override { return x44_hudDamagePracticalsGainConstant; } - float GetHudDamagePracticalsGainLinear() const override { return x48_hudDamagePracticalsGainLinear; } - float GetHudDamagePracticalsInitConstant() const override { return x4c_hudDamagePracticalsInitConstant; } - float GetHudDamagePracticalsInitLinear() const override { return x50_hudDamagePracticalsInitLinear; } - float GetHudDamageLightSpotAngle() const override { return x54_hudDamageLightSpotAngle; } - float GetDamageLightAngleC() const override { return x58_damageLightAngleC; } - float GetDamageLightAngleL() const override { return x5c_damageLightAngleL; } - float GetDamageLightAngleQ() const override { return x60_damageLightAngleQ; } - atVec3f GetDamageLightPreTranslate() const override { return x64_damageLightPreTranslate; } - atVec3f GetDamageLightCenterTranslate() const override { return x70_damageLightCenterTranslate; } - float GetDamageLightXfXAngle() const override { return x7c_damageLightXfXAngle; } - float GetDamageLightXfZAngle() const override { return x80_damageLightXfZAngle; } - float GetHudDecoShakeTranslateVelConstant() const override { return x84_hudDecoShakeTranslateVelConstant; } - float GetHudDecoShakeTranslateVelLinear() const override { return x88_hudDecoShakeTranslateVelLinear; } - float GetMaxDecoDamageShakeTranslate() const override { return x8c_maxDecoDamageShakeTranslate; } - float GetDecoDamageShakeDeceleration() const override { return x90_decoDamageShakeDeceleration; } - float GetDecoShakeGainConstant() const override { return x94_decoShakeGainConstant; } - float GetDecoShakeGainLinear() const override { return x98_decoShakeGainLinear; } - float GetDecoShakeInitConstant() const override { return x9c_decoShakeInitConstant; } - float GetDecoShakeInitLinear() const override { return xa0_decoShakeInitLinear; } - float GetMaxDecoDamageShakeRotate() const override { return xa4_maxDecoDamageShakeRotate; } - atUint32 GetHudCamFovTweak() const override { return xa8_hudCamFovTweak; } - atUint32 GetHudCamYTweak() const override { return xac_hudCamYTweak; } - atUint32 GetHudCamZTweak() const override { return xb0_hudCamZTweak; } - float GetBeamVisorMenuAnimTime() const override { return xc0_beamVisorMenuAnimTime; } - float GetVisorBeamMenuItemActiveScale() const override { return xc4_visorBeamMenuItemActiveScale; } - float GetVisorBeamMenuItemInactiveScale() const override { return xc8_visorBeamMenuItemInactiveScale; } - float GetVisorBeamMenuItemTranslate() const override { return xcc_visorBeamMenuItemTranslate; } - float GetThreatRange() const override { return xe4_threatRange; } - float GetRadarScopeCoordRadius() const override { return xe8_radarScopeCoordRadius; } - float GetRadarPlayerPaintRadius() const override { return xec_radarPlayerPaintRadius; } - float GetRadarEnemyPaintRadius() const override { return xf0_radarEnemyPaintRadius; } - float GetMissileArrowVisTime() const override { return xf4_missileArrowVisTime; } - EHudVisMode GetHudVisMode() const override { return xf8_hudVisMode; } - EHelmetVisMode GetHelmetVisMode() const override { return xfc_helmetVisMode; } - atUint32 GetEnableAutoMapper() const override { return x100_enableAutoMapper; } - atUint32 GetEnableTargetingManager() const override { return x108_enableTargetingManager; } - atUint32 GetEnablePlayerVisor() const override { return x10c_enablePlayerVisor; } - float GetThreatWarningFraction() const override { return x110_threatWarningFraction; } - float GetMissileWarningFraction() const override { return x114_missileWarningFraction; } - float GetFreeLookFadeTime() const override { return x118_freeLookFadeTime; } - float GetFreeLookSfxPitchScale() const override { return x12c_freeLookSfxPitchScale; } - bool GetNoAbsoluteFreeLookSfxPitch() const override { return x130_noAbsoluteFreeLookSfxPitch; } - float GetFaceReflectionOrthoWidth() const override { return x13c_faceReflectionOrthoWidth; } - float GetFaceReflectionOrthoHeight() const override { return x140_faceReflectionOrthoHeight; } - float GetFaceReflectionDistance() const override { return x144_faceReflectionDistance; } - float GetFaceReflectionHeight() const override { return x148_faceReflectionHeight; } - float GetFaceReflectionAspect() const override { return x14c_faceReflectionAspect; } - float GetMissileWarningPulseTime() const override { return x1a0_missileWarningPulseTime; } - float GetExplosionLightFalloffMultConstant() const override { return x1a4_explosionLightFalloffMultConstant; } - float GetExplosionLightFalloffMultLinear() const override { return x1a8_explosionLightFalloffMultLinear; } - float GetExplosionLightFalloffMultQuadratic() const override { return x1ac_explosionLightFalloffMultQuadratic; } - float GetHudDamagePeakFactor() const override { return x1b4_hudDamagePeakFactor; } - float GetHudDamageFilterGainConstant() const override { return x1b8_hudDamageFilterGainConstant; } - float GetHudDamageFilterGainLinear() const override { return x1bc_hudDamageFilterGainLinear; } - float GetHudDamageFilterInitConstant() const override { return x1c0_hudDamageFilterInitConstant; } - float GetHudDamageFilterInitLinear() const override { return x1c4_hudDamageFilterInitLinear; } - float GetEnergyDrainModPeriod() const override { return x1c8_energyDrainModPeriod; } - bool GetEnergyDrainSinusoidalPulse() const override { return x1cc_energyDrainSinusoidalPulse; } - bool GetEnergyDrainFilterAdditive() const override { return x1cd_energyDrainFilterAdditive; } - float GetHudDamagePulseDuration() const override { return x1d0_hudDamagePulseDuration; } - float GetHudDamageColorGain() const override { return x1d4_hudDamageColorGain; } - float GetHudDecoShakeTranslateGain() const override { return x1d8_hudDecoShakeTranslateGain; } - float GetHudLagOffsetScale() const override { return x1dc_hudLagOffsetScale; } - float GetXrayBlurScaleLinear() const override { return x204_xrayBlurScaleLinear; } - float GetXrayBlurScaleQuadratic() const override { return x208_xrayBlurScaleQuadratic; } - float GetScanSidesAngle() const override { return x210_scanSidesAngle; } - float GetScanSidesXScale() const override { return x214_scanSidesXScale; } - float GetScanSidesPositionEnd() const override { return x218_scanSidesPositionEnd; } - float GetScanSidesDuration() const override { return x220_scanSidesDuration; } - float GetScanSidesStartTime() const override { return x224_scanSidesStartTime; } - float GetScanSidesEndTime() const override { return x228_scanSidesEndTime; } - float GetScanDataDotRadius() const override { return x22c_scanDataDotRadius; } - float GetScanDataDotPosRandMagnitude() const override { return x230_scanDataDotPosRandMag; } - float GetScanDataDotSeekDurationMin() const override { return x234_scanDataDotSeekDurationMin; } - float GetScanDataDotSeekDurationMax() const override { return x238_scanDataDotSeekDurationMax; } - float GetScanDataDotHoldDurationMin() const override { return x23c_scanDataDotHoldDurationMin; } - float GetScanDataDotHoldDurationMax() const override { return x240_scanDataDotHoldDurationMax; } - float GetScanAppearanceDuration() const override { return x244_scanAppearanceDuration; } - float GetScanPaneFlashFactor() const override { return x248_scanPaneFlashFactor; } - float GetScanPaneFadeInTime() const override { return x24c_scanPaneFadeInTime; } - float GetScanPaneFadeOutTime() const override { return x250_scanPaneFadeOutTime; } - float GetBallViewportYReduction() const override { return x254_ballViewportYReduction; } - float GetScanWindowIdleWidth() const override { return x258_scanWindowIdleW; } - float GetScanWindowIdleHeight() const override { return x25c_scanWindowIdleH; } - float GetScanWindowActiveWidth() const override { return x260_scanWindowActiveW; } - float GetScanWindowActiveHeight() const override { return x264_scanWindowActiveH; } - float GetScanWindowMagnification() const override { return x268_scanWindowMagnification; } - float GetScanWindowScanningAspect() const override { return x26c_scanWindowScanningAspect; } - float GetScanSidesPositionStart() const override { return x270_scanSidesPositionStart; } - bool GetShowAutomapperInMorphball() const override { return x274_showAutomapperInMorphball; } - bool GetLatchArticleText() const override { return x275_latchArticleText; } - float GetWorldTransManagerCharsPerSfx() const override { return x278_wtMgrCharsPerSfx; } - atUint32 GetXRayFogMode() const override { return x27c_xrayFogMode; } - float GetXRayFogNearZ() const override { return x280_xrayFogNearZ; } - float GetXRayFogFarZ() const override { return x284_xrayFogFarZ; } - const zeus::CColor& GetXRayFogColor() const override { return x288_xrayFogColor; } - float GetThermalVisorLevel() const override { return x28c_thermalVisorLevel; } - const zeus::CColor& GetThermalVisorColor() const override { return x290_thermalVisorColor; } - const zeus::CColor& GetVisorHudLightAdd(int v) const override { return x294_hudLightAddPerVisor[v]; } - const zeus::CColor& GetVisorHudLightMultiply(int v) const override { return x2a4_hudLightMultiplyPerVisor[v]; } - const zeus::CColor& GetHudReflectivityLightColor() const override { return x2b4_hudReflectivityLightColor; } - float GetHudLightAttMulConstant() const override { return x2b8_hudLightAttMulConstant; } - float GetHudLightAttMulLinear() const override { return x2bc_hudLightAttMulLinear; } - float GetHudLightAttMulQuadratic() const override { return x2c0_hudLightAttMulQuadratic; } - std::string_view GetCreditsTable() const override { return x2d0_creditsTable; } - std::string_view GetCreditsFont() const override { return x2e0_creditsFont; } - std::string_view GetJapaneseCreditsFont() const override { return x2f0_japaneseCreditsFont; } - const zeus::CColor& GetCreditsTextFontColor() const override { return x300_; } - const zeus::CColor& GetCreditsTextBorderColor() const override { return x304_; } - - float GetScanSpeed(int idx) const override { - if (idx < 0 || size_t(idx) >= x2c4_scanSpeeds.size()) - return 0.f; - return x2c4_scanSpeeds[idx]; - } - - void FixupValues() { - xd8_ = zeus::degToRad(xd8_); - xdc_ = zeus::degToRad(xdc_); - - x200_ = zeus::CColor(x1f4_ * 0.25f, x1f8_ * 0.25f, x1fc_ * 0.25f, 1.f); - - x210_scanSidesAngle = zeus::degToRad(x210_scanSidesAngle); - x228_scanSidesEndTime = x220_scanSidesDuration + x224_scanSidesStartTime; - - if (x27c_xrayFogMode == 1) - x27c_xrayFogMode = 2; - else if (x27c_xrayFogMode == 2) - x27c_xrayFogMode = 4; - else if (x27c_xrayFogMode == 3) - x27c_xrayFogMode = 5; - else - x27c_xrayFogMode = 0; - - x84_hudDecoShakeTranslateVelConstant *= 2.0f; - } }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp index e3fbea5c7..d16e5edaf 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp @@ -1,261 +1,7 @@ -#include "CTweakPlayer.hpp" +#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp" #include "zeus/Math.hpp" -#include -#include - -#define DEFINE_CVAR_GLOBAL(name) \ - constexpr std::string_view sk##name = std::string_view("tweak.player." #name); \ - hecl::CVar* tw_##name = nullptr; - -#define CREATE_CVAR(name, help, value, flags) \ - tw_##name = mgr->findOrMakeCVar(sk##name, help, value, flags); \ - if (tw_##name->wasDeserialized()) { \ - tw_##name->toValue(value); \ - } \ - tw_##name->addListener([this](hecl::CVar* cv) { _tweakListener(cv); }); - -#define CREATE_CVAR_BITFIELD(name, help, value, flags) \ - { \ - bool tmp = value; \ - CREATE_CVAR(name, help, tmp, flags) \ - } - -#define UPDATE_CVAR(name, cv, value) \ - if ((cv) == tw_##name) { \ - (cv)->toValue(value); \ - return; \ - } - -#define UPDATE_CVAR_BITFIELD(name, cv, value) \ - { \ - bool tmp = value; \ - UPDATE_CVAR(name, cv, tmp) \ - (value) = tmp; \ - } - namespace DataSpec::DNAMP1 { -namespace { -static constexpr hecl::CVar::EFlags skDefaultFlags = - hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Cheat | hecl::CVar::EFlags::Archive; -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationNormal); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationAir); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationIce); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationOrganic); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationWater); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationLava); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationPhazon); -DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationShrubbery); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationNormal); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationAir); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationIce); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationOrganic); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationWater); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationLava); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationPhazon); -DEFINE_CVAR_GLOBAL(MaxRotationAccelerationShrubbery); -DEFINE_CVAR_GLOBAL(TranslationFrictionNormal); -DEFINE_CVAR_GLOBAL(TranslationFrictionAir); -DEFINE_CVAR_GLOBAL(TranslationFrictionIce); -DEFINE_CVAR_GLOBAL(TranslationFrictionOrganic); -DEFINE_CVAR_GLOBAL(TranslationFrictionWater); -DEFINE_CVAR_GLOBAL(TranslationFrictionLava); -DEFINE_CVAR_GLOBAL(TranslationFrictionPhazon); -DEFINE_CVAR_GLOBAL(TranslationFrictionShrubbery); -DEFINE_CVAR_GLOBAL(RotationFrictionNormal); -DEFINE_CVAR_GLOBAL(RotationFrictionAir); -DEFINE_CVAR_GLOBAL(RotationFrictionIce); -DEFINE_CVAR_GLOBAL(RotationFrictionOrganic); -DEFINE_CVAR_GLOBAL(RotationFrictionWater); -DEFINE_CVAR_GLOBAL(RotationFrictionLava); -DEFINE_CVAR_GLOBAL(RotationFrictionPhazon); -DEFINE_CVAR_GLOBAL(RotationFrictionShrubbery); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedNormal); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedAir); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedIce); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedOrganic); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedWater); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedLava); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedPhazon); -DEFINE_CVAR_GLOBAL(RotationMaxSpeedShrubbery); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedNormal); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedAir); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedIce); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedOrganic); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedWater); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedLava); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedPhazon); -DEFINE_CVAR_GLOBAL(TranslationMaxSpeedShrubbery); -DEFINE_CVAR_GLOBAL(NormalGravityAcceleration); -DEFINE_CVAR_GLOBAL(FluidGravityAcceleration); -DEFINE_CVAR_GLOBAL(VerticalJumpAcceleration); -DEFINE_CVAR_GLOBAL(HorizontalJumpAcceleration); -DEFINE_CVAR_GLOBAL(VerticalDoubleJumpAcceleration); -DEFINE_CVAR_GLOBAL(HorizontalDoubleJumpAcceleration); -DEFINE_CVAR_GLOBAL(WaterJumpFactor); -DEFINE_CVAR_GLOBAL(WaterBallJumpFactor); -DEFINE_CVAR_GLOBAL(LavaJumpFactor); -DEFINE_CVAR_GLOBAL(LavaBallJumpFactor); -DEFINE_CVAR_GLOBAL(PhazonJumpFactor); -DEFINE_CVAR_GLOBAL(PhazonBallJumpFactor); -DEFINE_CVAR_GLOBAL(AllowedJumpTime); -DEFINE_CVAR_GLOBAL(AllowedDoubleJumpTime); -DEFINE_CVAR_GLOBAL(MinDoubleJumpWindow); -DEFINE_CVAR_GLOBAL(MaxDoubleJumpWindow) -// DEFINE_CVAR_GLOBAL(); // x104_ -DEFINE_CVAR_GLOBAL(MinJumpTime); -DEFINE_CVAR_GLOBAL(MinDoubleJumpTime); -DEFINE_CVAR_GLOBAL(AllowedLedgeTime); -DEFINE_CVAR_GLOBAL(DoubleJumpImpulse); -DEFINE_CVAR_GLOBAL(BackwardsForceMultiplier); -DEFINE_CVAR_GLOBAL(BombJumpRadius); -DEFINE_CVAR_GLOBAL(BombJumpHeight); -DEFINE_CVAR_GLOBAL(EyeOffset); -DEFINE_CVAR_GLOBAL(TurnSpeedMultiplier); -DEFINE_CVAR_GLOBAL(FreeLookTurnSpeedMultiplier); -DEFINE_CVAR_GLOBAL(HorizontalFreeLookAngleVelocity); -DEFINE_CVAR_GLOBAL(VerticalFreeLookAngleVelocity); -DEFINE_CVAR_GLOBAL(FreeLookSpeed); -DEFINE_CVAR_GLOBAL(FreeLookSnapSpeed); -// DEFINE_CVAR_GLOBAL(); // x140_ -DEFINE_CVAR_GLOBAL(FreeLookCenteredThresholdAngle); -DEFINE_CVAR_GLOBAL(FreeLookCenteredTime); -DEFINE_CVAR_GLOBAL(FreeLookDampenFactor); -DEFINE_CVAR_GLOBAL(LeftDivisor); -DEFINE_CVAR_GLOBAL(RightDivisor); -DEFINE_CVAR_GLOBAL(OrbitMinDistanceClose); -DEFINE_CVAR_GLOBAL(OrbitMinDistanceFar); -DEFINE_CVAR_GLOBAL(OrbitMinDistanceDefault); -DEFINE_CVAR_GLOBAL(OrbitNormalDistanceClose); -DEFINE_CVAR_GLOBAL(OrbitNormalDistanceFar); -DEFINE_CVAR_GLOBAL(OrbitNormalDistanceDefault); -DEFINE_CVAR_GLOBAL(OrbitMaxDistanceClose); -DEFINE_CVAR_GLOBAL(OrbitMaxDistanceFar); -DEFINE_CVAR_GLOBAL(OrbitMaxDistanceDefault); -// DEFINE_CVAR_GLOBAL(); // x17c_ -DEFINE_CVAR_GLOBAL(OrbitmodeTimer); -DEFINE_CVAR_GLOBAL(OrbitCameraSpeed); -DEFINE_CVAR_GLOBAL(OrbitUpperAngle); -DEFINE_CVAR_GLOBAL(OrbitLowerAngle); -DEFINE_CVAR_GLOBAL(OrbitHorizontalAngle); -// DEFINE_CVAR_GLOBAL(); // x194_ -// DEFINE_CVAR_GLOBAL(); // x198_ -DEFINE_CVAR_GLOBAL(OrbitMaxTargetDistance); -DEFINE_CVAR_GLOBAL(OrbitMaxLockDistance); -DEFINE_CVAR_GLOBAL(OrbitDistanceThreshold); -DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxHalfExtentX); -DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxHalfExtentX); -DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxHalfExtentY); -DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxHalfExtentY); -DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxCenterX); -DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxCenterX); -DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxCenterY); -DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxCenterY); -DEFINE_CVAR_GLOBAL(OrbitZoneTargetingIdealX); -DEFINE_CVAR_GLOBAL(OrbitZoneScanIdealX); -DEFINE_CVAR_GLOBAL(OrbitZoneTargetingIdealY); -DEFINE_CVAR_GLOBAL(OrbitZoneScanIdealY); -DEFINE_CVAR_GLOBAL(OrbitNearX); -DEFINE_CVAR_GLOBAL(OrbitNearZ); -// DEFINE_CVAR_GLOBAL(); // x1e0_ -// DEFINE_CVAR_GLOBAL(); // x1e4_ -DEFINE_CVAR_GLOBAL(OrbitFixedOffsetZDiff); -DEFINE_CVAR_GLOBAL(OrbitZRange); -// DEFINE_CVAR_GLOBAL(); // x1f0_ -// DEFINE_CVAR_GLOBAL(); // x1f4_ -// DEFINE_CVAR_GLOBAL(); // x1f8_ -DEFINE_CVAR_GLOBAL(OrbitPreventionTime); -DEFINE_CVAR_GLOBAL(DashEnabled); -DEFINE_CVAR_GLOBAL(DashOnButtonRelease); -DEFINE_CVAR_GLOBAL(DashButtonHoldCancelTime); -DEFINE_CVAR_GLOBAL(DashStrafeInputThreshold); -DEFINE_CVAR_GLOBAL(SidewaysDoubleJumpImpulse); -DEFINE_CVAR_GLOBAL(SidewaysVerticalDoubleJumpAccel); -DEFINE_CVAR_GLOBAL(SidewaysHorizontalDoubleJumpAccel); -DEFINE_CVAR_GLOBAL(ScanningRange); -DEFINE_CVAR_GLOBAL(ScanRetention); -DEFINE_CVAR_GLOBAL(ScanFreezesGame); -DEFINE_CVAR_GLOBAL(OrbitWhileScanning); -DEFINE_CVAR_GLOBAL(ScanMaxTargetDistance); -DEFINE_CVAR_GLOBAL(ScanMaxLockDistance) -DEFINE_CVAR_GLOBAL(FreeLookTurnsPlayer); -// DEFINE_CVAR_GLOBAL(); // x228_25_ -// DEFINE_CVAR_GLOBAL(); // x228_26_ -DEFINE_CVAR_GLOBAL(MoveDuringFreelook); -DEFINE_CVAR_GLOBAL(HoldButtonsForFreeLook); -// DEFINE_CVAR_GLOBAL(); // x228_30_ -// DEFINE_CVAR_GLOBAL(); // x228_31_ -// DEFINE_CVAR_GLOBAL(); // x229_24_ -DEFINE_CVAR_GLOBAL(AimWhenOrbitingPoint); -DEFINE_CVAR_GLOBAL(StayInFreeLookWhileFiring); -// DEFINE_CVAR_GLOBAL(); // x229_27_ -// DEFINE_CVAR_GLOBAL(); // x229_28_ -DEFINE_CVAR_GLOBAL(OrbitFixedOffset); -DEFINE_CVAR_GLOBAL(GunButtonTogglesHolster); -DEFINE_CVAR_GLOBAL(GunNotFiringHolstersGun); -DEFINE_CVAR_GLOBAL(FallingDoubleJump); -DEFINE_CVAR_GLOBAL(ImpulseDoubleJump); -DEFINE_CVAR_GLOBAL(FiringCancelsCameraPitch); -DEFINE_CVAR_GLOBAL(AssistedAimingIgnoreHorizontal); -DEFINE_CVAR_GLOBAL(AssistedAimingIgnoreVertical); -// DEFINE_CVAR_GLOBAL(); // x22c -// DEFINE_CVAR_GLOBAL(); // x230_ -DEFINE_CVAR_GLOBAL(AimMaxDistance); -// DEFINE_CVAR_GLOBAL(); // x238_ -// DEFINE_CVAR_GLOBAL(); // x23c_ -// DEFINE_CVAR_GLOBAL(); // x240_ -// DEFINE_CVAR_GLOBAL(); // x244_ -// DEFINE_CVAR_GLOBAL(); // x248_ -DEFINE_CVAR_GLOBAL(AimThresholdDistance); -// DEFINE_CVAR_GLOBAL(); // x250_ -// DEFINE_CVAR_GLOBAL(); // x254_ -DEFINE_CVAR_GLOBAL(AimBoxWidth); -DEFINE_CVAR_GLOBAL(AimBoxHeight); -DEFINE_CVAR_GLOBAL(AimTargetTimer); -DEFINE_CVAR_GLOBAL(AimAssistHorizontalAngle); -DEFINE_CVAR_GLOBAL(AimAssistVerticalAngle); -DEFINE_CVAR_GLOBAL(PlayerHeight); -DEFINE_CVAR_GLOBAL(PlayerXYHalfExtent); -DEFINE_CVAR_GLOBAL(StepUpHeight); -DEFINE_CVAR_GLOBAL(StepDownHeight); -DEFINE_CVAR_GLOBAL(PlayerBallHalfExtent); -DEFINE_CVAR_GLOBAL(FirstPersonCameraSpeed); -// DEFINE_CVAR_GLOBAL(); // x284_ -DEFINE_CVAR_GLOBAL(JumpCameraPitchDownStart); -DEFINE_CVAR_GLOBAL(JumpCameraPitchDownFull); -DEFINE_CVAR_GLOBAL(JumpCameraPitchDownAngle); -DEFINE_CVAR_GLOBAL(FallCameraPitchDownStart); -DEFINE_CVAR_GLOBAL(FallCameraPitchDownFull); -DEFINE_CVAR_GLOBAL(FallCameraPitchDownAngle); -DEFINE_CVAR_GLOBAL(OrbitDistanceMax); -DEFINE_CVAR_GLOBAL(GrappleSwingLength); -DEFINE_CVAR_GLOBAL(GrappleSwingPeriod); -DEFINE_CVAR_GLOBAL(GrapplePullSpeedMin); -DEFINE_CVAR_GLOBAL(GrappleCameraSpeed); -DEFINE_CVAR_GLOBAL(MaxGrappleLockedTurnAlignDistance); -DEFINE_CVAR_GLOBAL(GrapplePullSpeedProportion); -DEFINE_CVAR_GLOBAL(GrapplePullSpeedMax); -DEFINE_CVAR_GLOBAL(GrappleLookCenterSpeed); -DEFINE_CVAR_GLOBAL(MaxGrappleTurnSpeed); -DEFINE_CVAR_GLOBAL(GrappleJumpForce); -DEFINE_CVAR_GLOBAL(GrappleReleaseTime); -DEFINE_CVAR_GLOBAL(GrappleJumpMode); -DEFINE_CVAR_GLOBAL(OrbitReleaseBreaksGrapple); -DEFINE_CVAR_GLOBAL(InvertGrappleTurn); -DEFINE_CVAR_GLOBAL(GrappleBeamSpeed); -DEFINE_CVAR_GLOBAL(GrappleBeamXWaveAmplitude); -DEFINE_CVAR_GLOBAL(GrappleBeamZWaveAmplitude); -DEFINE_CVAR_GLOBAL(GrappleBeamAnglePhaseDelta); -// DEFINE_CVAR_GLOBAL(); // x2e8_ -// DEFINE_CVAR_GLOBAL(); // x2ec_ -// DEFINE_CVAR_GLOBAL(); // x2f0_ -// DEFINE_CVAR_GLOBAL(); // x2f4_ -DEFINE_CVAR_GLOBAL(FrozenTimeout); -DEFINE_CVAR_GLOBAL(IceBreakJumpCount); -DEFINE_CVAR_GLOBAL(VariaDamageReduction); -DEFINE_CVAR_GLOBAL(GravityDamageReduction); -DEFINE_CVAR_GLOBAL(PhazonDamageReduction); -} // namespace template <> void CTweakPlayer::Enumerate(athena::io::IStreamReader& __dna_reader) { /* x4_maxTranslationalAcceleration[0] */ @@ -2121,536 +1867,9 @@ void CTweakPlayer::Enumerate(athena::io::YAMLDocWriter& __dna __dna_docout.writeFloat("x308_phazonDamageReduction", x308_phazonDamageReduction); } -void CTweakPlayer::FixupValues() { - x130_horizontalFreeLookAngleVel = zeus::degToRad(x130_horizontalFreeLookAngleVel); - x134_verticalFreeLookAngleVel = zeus::degToRad(x134_verticalFreeLookAngleVel); - x138_freeLookSpeed = zeus::degToRad(x138_freeLookSpeed); - x13c_freeLookSnapSpeed = zeus::degToRad(x13c_freeLookSnapSpeed); - x140_ = zeus::degToRad(x140_); - x144_freeLookCenteredThresholdAngle = zeus::degToRad(x144_freeLookCenteredThresholdAngle); - x23c_ = zeus::degToRad(x23c_); - x240_ = zeus::degToRad(x240_); - x244_ = zeus::degToRad(x244_); - x248_ = zeus::degToRad(x248_); - x250_ = zeus::degToRad(x250_); - x264_aimAssistHorizontalAngle = zeus::degToRad(x264_aimAssistHorizontalAngle); - x268_aimAssistVerticalAngle = zeus::degToRad(x268_aimAssistVerticalAngle); - x17c_ = zeus::degToRad(x17c_); - x184_orbitCameraSpeed = zeus::degToRad(x184_orbitCameraSpeed); - x188_orbitUpperAngle = zeus::degToRad(x188_orbitUpperAngle); - x18c_orbitLowerAngle = zeus::degToRad(x18c_orbitLowerAngle); - x190_orbitHorizAngle = zeus::degToRad(x190_orbitHorizAngle); - x194_ = zeus::degToRad(x194_); - x198_ = zeus::degToRad(x198_); - x1f0_ = zeus::degToRad(x1f0_); - x1f4_ = zeus::degToRad(x1f4_); - x2b0_grappleCameraSpeed = zeus::degToRad(x2b0_grappleCameraSpeed); - x2c0_grappleLookCenterSpeed = zeus::degToRad(x2c0_grappleLookCenterSpeed); - x280_firstPersonCameraSpeed = zeus::degToRad(x280_firstPersonCameraSpeed); - x284_ = zeus::degToRad(x284_); - x290_jumpCameraPitchDownAngle = zeus::degToRad(x290_jumpCameraPitchDownAngle); - x29c_fallCameraPitchDownAngle = zeus::degToRad(x29c_fallCameraPitchDownAngle); -} - std::string_view CTweakPlayer::DNAType() { return "DataSpec::DNAMP1::CTweakPlayer"sv; } template <> void CTweakPlayer::Enumerate(size_t& __isz) { __isz += 785; } - -void CTweakPlayer::_tweakListener(hecl::CVar* cv) { - UPDATE_CVAR(MaxTranslationAccelerationNormal, cv, x4_maxTranslationalAcceleration[0]); - UPDATE_CVAR(MaxTranslationAccelerationAir, cv, x4_maxTranslationalAcceleration[1]); - UPDATE_CVAR(MaxTranslationAccelerationIce, cv, x4_maxTranslationalAcceleration[2]); - UPDATE_CVAR(MaxTranslationAccelerationOrganic, cv, x4_maxTranslationalAcceleration[3]); - UPDATE_CVAR(MaxTranslationAccelerationWater, cv, x4_maxTranslationalAcceleration[4]); - UPDATE_CVAR(MaxTranslationAccelerationLava, cv, x4_maxTranslationalAcceleration[5]); - UPDATE_CVAR(MaxTranslationAccelerationPhazon, cv, x4_maxTranslationalAcceleration[6]); - UPDATE_CVAR(MaxRotationAccelerationShrubbery, cv, x24_maxRotationalAcceleration[7]); - UPDATE_CVAR(MaxRotationAccelerationNormal, cv, x24_maxRotationalAcceleration[0]); - UPDATE_CVAR(MaxRotationAccelerationAir, cv, x24_maxRotationalAcceleration[1]); - UPDATE_CVAR(MaxRotationAccelerationIce, cv, x24_maxRotationalAcceleration[2]); - UPDATE_CVAR(MaxRotationAccelerationOrganic, cv, x24_maxRotationalAcceleration[3]); - UPDATE_CVAR(MaxRotationAccelerationWater, cv, x24_maxRotationalAcceleration[4]); - UPDATE_CVAR(MaxRotationAccelerationLava, cv, x24_maxRotationalAcceleration[5]); - UPDATE_CVAR(MaxRotationAccelerationPhazon, cv, x24_maxRotationalAcceleration[6]); - UPDATE_CVAR(MaxRotationAccelerationShrubbery, cv, x24_maxRotationalAcceleration[7]); - UPDATE_CVAR(TranslationFrictionNormal, cv, x44_translationFriction[0]); - UPDATE_CVAR(TranslationFrictionAir, cv, x44_translationFriction[1]); - UPDATE_CVAR(TranslationFrictionIce, cv, x44_translationFriction[2]); - UPDATE_CVAR(TranslationFrictionOrganic, cv, x44_translationFriction[3]); - UPDATE_CVAR(TranslationFrictionWater, cv, x44_translationFriction[4]); - UPDATE_CVAR(TranslationFrictionLava, cv, x44_translationFriction[5]); - UPDATE_CVAR(TranslationFrictionPhazon, cv, x44_translationFriction[6]); - UPDATE_CVAR(TranslationFrictionShrubbery, cv, x44_translationFriction[7]); - UPDATE_CVAR(RotationFrictionNormal, cv, x44_translationFriction[2]); - UPDATE_CVAR(RotationFrictionIce, cv, x44_translationFriction[2]); - UPDATE_CVAR(RotationFrictionOrganic, cv, x44_translationFriction[3]); - UPDATE_CVAR(RotationFrictionWater, cv, x44_translationFriction[4]); - UPDATE_CVAR(RotationFrictionLava, cv, x44_translationFriction[5]); - UPDATE_CVAR(RotationFrictionPhazon, cv, x44_translationFriction[6]); - UPDATE_CVAR(RotationFrictionShrubbery, cv, x44_translationFriction[7]); - UPDATE_CVAR(RotationMaxSpeedNormal, cv, x84_rotationMaxSpeed[2]); - UPDATE_CVAR(RotationMaxSpeedIce, cv, x84_rotationMaxSpeed[2]); - UPDATE_CVAR(RotationMaxSpeedOrganic, cv, x84_rotationMaxSpeed[3]); - UPDATE_CVAR(RotationMaxSpeedWater, cv, x84_rotationMaxSpeed[4]); - UPDATE_CVAR(RotationMaxSpeedLava, cv, x84_rotationMaxSpeed[5]); - UPDATE_CVAR(RotationMaxSpeedPhazon, cv, x84_rotationMaxSpeed[6]); - UPDATE_CVAR(RotationMaxSpeedShrubbery, cv, x84_rotationMaxSpeed[7]); - UPDATE_CVAR(TranslationMaxSpeedNormal, cv, xa4_translationMaxSpeed[2]); - UPDATE_CVAR(TranslationMaxSpeedIce, cv, xa4_translationMaxSpeed[2]); - UPDATE_CVAR(TranslationMaxSpeedOrganic, cv, xa4_translationMaxSpeed[3]); - UPDATE_CVAR(TranslationMaxSpeedWater, cv, xa4_translationMaxSpeed[4]); - UPDATE_CVAR(TranslationMaxSpeedLava, cv, xa4_translationMaxSpeed[5]); - UPDATE_CVAR(TranslationMaxSpeedPhazon, cv, xa4_translationMaxSpeed[6]); - UPDATE_CVAR(TranslationMaxSpeedShrubbery, cv, xa4_translationMaxSpeed[7]); - UPDATE_CVAR(NormalGravityAcceleration, cv, xc4_normalGravAccel); - UPDATE_CVAR(FluidGravityAcceleration, cv, xc8_fluidGravAccel); - UPDATE_CVAR(VerticalJumpAcceleration, cv, xcc_verticalJumpAccel); - UPDATE_CVAR(HorizontalJumpAcceleration, cv, xd0_horizontalJumpAccel); - UPDATE_CVAR(VerticalDoubleJumpAcceleration, cv, xd4_verticalDoubleJumpAccel); - UPDATE_CVAR(HorizontalDoubleJumpAcceleration, cv, xd8_horizontalDoubleJumpAccel); - UPDATE_CVAR(WaterJumpFactor, cv, xdc_waterJumpFactor); - UPDATE_CVAR(WaterBallJumpFactor, cv, xe0_waterBallJumpFactor); - UPDATE_CVAR(LavaJumpFactor, cv, xe4_lavaJumpFactor); - UPDATE_CVAR(LavaBallJumpFactor, cv, xe8_lavaBallJumpFactor); - UPDATE_CVAR(PhazonJumpFactor, cv, xec_phazonJumpFactor); - UPDATE_CVAR(PhazonBallJumpFactor, cv, xf0_phazonBallJumpFactor); - UPDATE_CVAR(AllowedJumpTime, cv, xf4_allowedJumpTime); - UPDATE_CVAR(AllowedDoubleJumpTime, cv, xf8_allowedDoubleJumpTime); - UPDATE_CVAR(MinDoubleJumpWindow, cv, xfc_minDoubleJumpWindow); - UPDATE_CVAR(MaxDoubleJumpWindow, cv, x100_maxDoubleJumpWindow); - // UPDATE_CVAR(); // x104_ - UPDATE_CVAR(MinJumpTime, cv, x108_minJumpTime); - UPDATE_CVAR(MinDoubleJumpTime, cv, x10c_minDoubleJumpTime); - UPDATE_CVAR(AllowedLedgeTime, cv, x110_allowedLedgeTime); - UPDATE_CVAR(DoubleJumpImpulse, cv, x114_doubleJumpImpulse); - UPDATE_CVAR(BackwardsForceMultiplier, cv, x118_backwardsForceMultiplier); - UPDATE_CVAR(BombJumpRadius, cv, x11c_bombJumpRadius); - UPDATE_CVAR(BombJumpHeight, cv, x120_bombJumpHeight); - UPDATE_CVAR(EyeOffset, cv, x124_eyeOffset); - UPDATE_CVAR(TurnSpeedMultiplier, cv, x128_turnSpeedMultiplier); - UPDATE_CVAR(FreeLookTurnSpeedMultiplier, cv, x12c_freeLookTurnSpeedMultiplier); - UPDATE_CVAR(HorizontalFreeLookAngleVelocity, cv, x130_horizontalFreeLookAngleVel); - UPDATE_CVAR(VerticalFreeLookAngleVelocity, cv, x134_verticalFreeLookAngleVel); - UPDATE_CVAR(FreeLookSpeed, cv, x138_freeLookSpeed); - UPDATE_CVAR(FreeLookSnapSpeed, cv, x13c_freeLookSnapSpeed); - // UPDATE_CVAR(); // x140_ - UPDATE_CVAR(FreeLookCenteredThresholdAngle, cv, x144_freeLookCenteredThresholdAngle); - UPDATE_CVAR(FreeLookCenteredTime, cv, x148_freeLookCenteredTime); - UPDATE_CVAR(FreeLookDampenFactor, cv, x14c_freeLookDampenFactor); - UPDATE_CVAR(LeftDivisor, cv, x150_leftDiv); - UPDATE_CVAR(RightDivisor, cv, x154_rightDiv); - UPDATE_CVAR(OrbitMinDistanceClose, cv, x158_orbitMinDistance[0]); - UPDATE_CVAR(OrbitMinDistanceFar, cv, x158_orbitMinDistance[1]); - UPDATE_CVAR(OrbitMinDistanceDefault, cv, x158_orbitMinDistance[2]); - UPDATE_CVAR(OrbitNormalDistanceClose, cv, x164_orbitNormalDistance[0]); - UPDATE_CVAR(OrbitNormalDistanceFar, cv, x164_orbitNormalDistance[1]); - UPDATE_CVAR(OrbitNormalDistanceDefault, cv, x164_orbitNormalDistance[2]); - UPDATE_CVAR(OrbitMaxDistanceClose, cv, x170_orbitMaxDistance[0]); - UPDATE_CVAR(OrbitMaxDistanceFar, cv, x170_orbitMaxDistance[1]); - UPDATE_CVAR(OrbitMaxDistanceDefault, cv, x170_orbitMaxDistance[2]); - // UPDATE_CVAR(); // x17c_ - UPDATE_CVAR(OrbitmodeTimer, cv, x180_orbitModeTimer); - UPDATE_CVAR(OrbitCameraSpeed, cv, x184_orbitCameraSpeed); - UPDATE_CVAR(OrbitUpperAngle, cv, x188_orbitUpperAngle); - UPDATE_CVAR(OrbitLowerAngle, cv, x18c_orbitLowerAngle); - UPDATE_CVAR(OrbitHorizontalAngle, cv, x190_orbitHorizAngle); - // UPDATE_CVAR(); // x194_ - // UPDATE_CVAR(); // x198_ - UPDATE_CVAR(OrbitMaxTargetDistance, cv, x19c_orbitMaxTargetDistance); - UPDATE_CVAR(OrbitMaxLockDistance, cv, x1a0_orbitMaxLockDistance); - UPDATE_CVAR(OrbitDistanceThreshold, cv, x1a4_orbitDistanceThreshold); - UPDATE_CVAR(OrbitScreenTargetingBoxHalfExtentX, cv, x1a8_orbitScreenBoxHalfExtentX[0]); - UPDATE_CVAR(OrbitScreenScanBoxHalfExtentX, cv, x1a8_orbitScreenBoxHalfExtentX[1]); - UPDATE_CVAR(OrbitScreenTargetingBoxHalfExtentY, cv, x1b0_orbitScreenBoxHalfExtentY[0]); - UPDATE_CVAR(OrbitScreenScanBoxHalfExtentY, cv, x1b0_orbitScreenBoxHalfExtentY[1]); - UPDATE_CVAR(OrbitScreenTargetingBoxCenterX, cv, x1b8_orbitScreenBoxCenterX[0]); - UPDATE_CVAR(OrbitScreenScanBoxCenterX, cv, x1b8_orbitScreenBoxCenterX[1]); - UPDATE_CVAR(OrbitScreenTargetingBoxCenterY, cv, x1c0_orbitScreenBoxCenterY[0]); - UPDATE_CVAR(OrbitScreenScanBoxCenterY, cv, x1c0_orbitScreenBoxCenterY[1]); - UPDATE_CVAR(OrbitZoneTargetingIdealX, cv, x1c8_orbitZoneIdealX[0]); - UPDATE_CVAR(OrbitZoneScanIdealX, cv, x1c8_orbitZoneIdealX[1]); - UPDATE_CVAR(OrbitZoneTargetingIdealY, cv, x1d0_orbitZoneIdealY[0]); - UPDATE_CVAR(OrbitZoneScanIdealY, cv, x1d0_orbitZoneIdealY[1]); - UPDATE_CVAR(OrbitNearX, cv, x1d8_orbitNearX); - UPDATE_CVAR(OrbitNearZ, cv, x1dc_orbitNearZ); - // UPDATE_CVAR(); // x1e0_ - // UPDATE_CVAR(); // x1e4_ - UPDATE_CVAR(OrbitFixedOffsetZDiff, cv, x1e8_orbitFixedOffsetZDiff); - UPDATE_CVAR(OrbitZRange, cv, x1ec_orbitZRange); - // UPDATE_CVAR(); // x1f0_ - // UPDATE_CVAR(); // x1f4_ - // UPDATE_CVAR(); // x1f8_ - UPDATE_CVAR(OrbitPreventionTime, cv, x1fc_orbitPreventionTime); - UPDATE_CVAR_BITFIELD(DashEnabled, cv, x200_24_dashEnabled); - UPDATE_CVAR_BITFIELD(DashOnButtonRelease, cv, x200_25_dashOnButtonRelease); - UPDATE_CVAR(DashButtonHoldCancelTime, cv, x204_dashButtonHoldCancelTime); - UPDATE_CVAR(DashStrafeInputThreshold, cv, x208_dashStrafeInputThreshold); - UPDATE_CVAR(SidewaysDoubleJumpImpulse, cv, x20c_sidewaysDoubleJumpImpulse); - UPDATE_CVAR(SidewaysVerticalDoubleJumpAccel, cv, x210_sidewaysVerticalDoubleJumpAccel); - UPDATE_CVAR(SidewaysHorizontalDoubleJumpAccel, cv, x214_sidewaysHorizontalDoubleJumpAccel); - UPDATE_CVAR(ScanningRange, cv, x218_scanningRange); - UPDATE_CVAR_BITFIELD(ScanRetention, cv, x21c_24_scanRetention); - UPDATE_CVAR_BITFIELD(ScanFreezesGame, cv, x21c_25_scanFreezesGame); - UPDATE_CVAR_BITFIELD(OrbitWhileScanning, cv, x21c_26_orbitWhileScanning); - UPDATE_CVAR(ScanMaxTargetDistance, cv, x220_scanMaxTargetDistance); - UPDATE_CVAR(ScanMaxLockDistance, cv, x224_scanMaxLockDistance); - UPDATE_CVAR_BITFIELD(FreeLookTurnsPlayer, cv, x228_24_freelookTurnsPlayer); - // UPDATE_CVAR_BITFIELD(); // x228_25_ - // UPDATE_CVAR_BITFIELD(); // x228_26_ - UPDATE_CVAR_BITFIELD(MoveDuringFreelook, cv, x228_27_moveDuringFreeLook); - UPDATE_CVAR_BITFIELD(HoldButtonsForFreeLook, cv, x228_28_holdButtonsForFreeLook); - // UPDATE_CVAR_BITFIELD(); // x228_30_ - // UPDATE_CVAR_BITFIELD(); // x228_31_ - // UPDATE_CVAR_BITFIELD(); // x229_24_ - UPDATE_CVAR_BITFIELD(AimWhenOrbitingPoint, cv, x229_25_aimWhenOrbitingPoint); - UPDATE_CVAR_BITFIELD(StayInFreeLookWhileFiring, cv, x229_26_stayInFreeLookWhileFiring); - // UPDATE_CVAR_BITFIELD(); // x229_27_ - // UPDATE_CVAR_BITFIELD(); // x229_28_ - UPDATE_CVAR_BITFIELD(OrbitFixedOffset, cv, x229_29_orbitFixedOffset); - UPDATE_CVAR_BITFIELD(GunButtonTogglesHolster, cv, x229_30_gunButtonTogglesHolster); - UPDATE_CVAR_BITFIELD(GunNotFiringHolstersGun, cv, x229_31_gunNotFiringHolstersGun); - UPDATE_CVAR_BITFIELD(FallingDoubleJump, cv, x22a_24_fallingDoubleJump); - UPDATE_CVAR_BITFIELD(ImpulseDoubleJump, cv, x22a_25_impulseDoubleJump); - UPDATE_CVAR_BITFIELD(FiringCancelsCameraPitch, cv, x22a_26_firingCancelsCameraPitch); - UPDATE_CVAR_BITFIELD(AssistedAimingIgnoreHorizontal, cv, x22a_27_assistedAimingIgnoreHorizontal); - UPDATE_CVAR_BITFIELD(AssistedAimingIgnoreVertical, cv, x22a_28_assistedAimingIgnoreVertical); - // UPDATE_CVAR(); // x22c - // UPDATE_CVAR(); // x230_ - UPDATE_CVAR(AimMaxDistance, cv, x234_aimMaxDistance); - // UPDATE_CVAR(); // x238_ - // UPDATE_CVAR(); // x23c_ - // UPDATE_CVAR(); // x240_ - // UPDATE_CVAR(); // x244_ - // UPDATE_CVAR(); // x248_ - UPDATE_CVAR(AimThresholdDistance, cv, x24c_aimThresholdDistance); - // UPDATE_CVAR(); // x250_ - // UPDATE_CVAR(); // x254_ - UPDATE_CVAR(AimBoxWidth, cv, x258_aimBoxWidth); - UPDATE_CVAR(AimBoxHeight, cv, x25c_aimBoxHeight); - UPDATE_CVAR(AimTargetTimer, cv, x260_aimTargetTimer); - UPDATE_CVAR(AimAssistHorizontalAngle, cv, x264_aimAssistHorizontalAngle); - UPDATE_CVAR(AimAssistVerticalAngle, cv, x268_aimAssistVerticalAngle); - UPDATE_CVAR(PlayerHeight, cv, x26c_playerHeight); - UPDATE_CVAR(PlayerXYHalfExtent, cv, x270_playerXYHalfExtent); - UPDATE_CVAR(StepUpHeight, cv, x274_stepUpHeight); - UPDATE_CVAR(StepDownHeight, cv, x278_stepDownHeight); - UPDATE_CVAR(PlayerBallHalfExtent, cv, x27c_playerBallHalfExtent); - UPDATE_CVAR(FirstPersonCameraSpeed, cv, x280_firstPersonCameraSpeed); - // UPDATE_CVAR(); // x284_ - UPDATE_CVAR(JumpCameraPitchDownStart, cv, x288_jumpCameraPitchDownStart); - UPDATE_CVAR(JumpCameraPitchDownFull, cv, x28c_jumpCameraPitchDownFull); - UPDATE_CVAR(JumpCameraPitchDownAngle, cv, x290_jumpCameraPitchDownAngle); - UPDATE_CVAR(FallCameraPitchDownStart, cv, x294_fallCameraPitchDownStart); - UPDATE_CVAR(FallCameraPitchDownFull, cv, x298_fallCameraPitchDownFull); - UPDATE_CVAR(FallCameraPitchDownAngle, cv, x29c_fallCameraPitchDownAngle); - UPDATE_CVAR(OrbitDistanceMax, cv, x2a0_orbitDistanceMax); - UPDATE_CVAR(GrappleSwingLength, cv, x2a4_grappleSwingLength); - UPDATE_CVAR(GrappleSwingPeriod, cv, x2a8_grappleSwingPeriod); - UPDATE_CVAR(GrapplePullSpeedMin, cv, x2ac_grapplePullSpeedMin); - UPDATE_CVAR(GrappleCameraSpeed, cv, x2b0_grappleCameraSpeed); - UPDATE_CVAR(MaxGrappleLockedTurnAlignDistance, cv, x2b4_maxGrappleLockedTurnAlignDistance); - UPDATE_CVAR(GrapplePullSpeedProportion, cv, x2b8_grapplePullSpeedProportion); - UPDATE_CVAR(GrapplePullSpeedMax, cv, x2bc_grapplePullSpeedMax); - UPDATE_CVAR(GrappleLookCenterSpeed, cv, x2c0_grappleLookCenterSpeed); - UPDATE_CVAR(MaxGrappleTurnSpeed, cv, x2c4_maxGrappleTurnSpeed); - UPDATE_CVAR(GrappleJumpForce, cv, x2c8_grappleJumpForce); - UPDATE_CVAR(GrappleReleaseTime, cv, x2cc_grappleReleaseTime); - UPDATE_CVAR(GrappleJumpMode, cv, x2d0_grappleJumpMode); - UPDATE_CVAR(OrbitReleaseBreaksGrapple, cv, x2d4_orbitReleaseBreaksGrapple); - UPDATE_CVAR(InvertGrappleTurn, cv, x2d5_invertGrappleTurn); - UPDATE_CVAR(GrappleBeamSpeed, cv, x2d8_grappleBeamSpeed); - UPDATE_CVAR(GrappleBeamXWaveAmplitude, cv, x2dc_grappleBeamXWaveAmplitude); - UPDATE_CVAR(GrappleBeamZWaveAmplitude, cv, x2e0_grappleBeamZWaveAmplitude); - UPDATE_CVAR(GrappleBeamAnglePhaseDelta, cv, x2e4_grappleBeamAnglePhaseDelta); - // UPDATE_CVAR(); // x2e8_ - // UPDATE_CVAR(); // x2ec_ - // UPDATE_CVAR(); // x2f0_ - // UPDATE_CVAR(); // x2f4_ - UPDATE_CVAR(FrozenTimeout, cv, x2f8_frozenTimeout); - UPDATE_CVAR(IceBreakJumpCount, cv, x2fc_iceBreakJumpCount); - UPDATE_CVAR(VariaDamageReduction, cv, x300_variaDamageReduction); - UPDATE_CVAR(GravityDamageReduction, cv, x304_gravityDamageReduction); - UPDATE_CVAR(PhazonDamageReduction, cv, x308_phazonDamageReduction); -} - -void CTweakPlayer::initCVars(hecl::CVarManager* mgr) { - CREATE_CVAR(MaxTranslationAccelerationNormal, - "Max translation acceleration allowed to the player under normal circumstances", - x4_maxTranslationalAcceleration[0], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationAir, "Max translation acceleration allowed to the player while in air", - x4_maxTranslationalAcceleration[1], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationIce, "Max translation acceleration allowed to the player while on ice surfaces", - x4_maxTranslationalAcceleration[2], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationOrganic, - "Max translation acceleration allowed to the player while on organic surfaces", - x4_maxTranslationalAcceleration[3], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationWater, "Max translation acceleration allowed to the player while in water", - x4_maxTranslationalAcceleration[4], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationLava, "Max translation acceleration allowed to the player while in lava", - x4_maxTranslationalAcceleration[5], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationPhazon, "Max translation acceleration allowed to the player while in phazon", - x4_maxTranslationalAcceleration[6], skDefaultFlags); - CREATE_CVAR(MaxTranslationAccelerationShrubbery, - "Max translation acceleration allowed to the player while in shrubbery", - x4_maxTranslationalAcceleration[7], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationNormal, - "Max rotation acceleration allowed to the player under normal circumstances", - x24_maxRotationalAcceleration[0], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationAir, "Max rotation acceleration allowed to the player while in air", - x24_maxRotationalAcceleration[1], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationIce, "Max rotation acceleration allowed to the player while on ice surfaces", - x24_maxRotationalAcceleration[2], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationOrganic, - "Max rotation acceleration allowed to the player while on organic surfaces", - x24_maxRotationalAcceleration[3], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationWater, "Max rotation acceleration allowed to the player while in water", - x24_maxRotationalAcceleration[4], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationLava, "Max rotation acceleration allowed to the player while in lava", - x24_maxRotationalAcceleration[5], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationPhazon, "Max rotation acceleration allowed to the player while in phazon", - x24_maxRotationalAcceleration[6], skDefaultFlags); - CREATE_CVAR(MaxRotationAccelerationShrubbery, "Max rotation acceleration allowed to the player while in shrubbery", - x24_maxRotationalAcceleration[7], skDefaultFlags); - CREATE_CVAR(TranslationFrictionNormal, "Translation friction allowed to the player under normal circumstances", - x44_translationFriction[0], skDefaultFlags); - CREATE_CVAR(TranslationFrictionAir, "Translation friction allowed to the player while in air", - x44_translationFriction[1], skDefaultFlags); - CREATE_CVAR(TranslationFrictionIce, "Translation friction allowed to the player while on ice surfaces", - x44_translationFriction[2], skDefaultFlags); - CREATE_CVAR(TranslationFrictionOrganic, "Translation friction allowed to the player while on organic surfaces", - x44_translationFriction[3], skDefaultFlags); - CREATE_CVAR(TranslationFrictionWater, "Translation friction allowed to the player while in water", - x44_translationFriction[4], skDefaultFlags); - CREATE_CVAR(TranslationFrictionLava, "Translation friction allowed to the player while in lava", - x44_translationFriction[5], skDefaultFlags); - CREATE_CVAR(TranslationFrictionPhazon, "Translation friction allowed to the player while in phazon", - x44_translationFriction[6], skDefaultFlags); - CREATE_CVAR(TranslationFrictionShrubbery, "Translation friction allowed to the player while in shrubbery", - x44_translationFriction[7], skDefaultFlags); - CREATE_CVAR(RotationFrictionNormal, "Rotation friction allowed to the player under normal circumstances", - x44_translationFriction[0], skDefaultFlags); - CREATE_CVAR(RotationFrictionAir, "Rotation friction allowed to the player while in air", x44_translationFriction[1], - skDefaultFlags); - CREATE_CVAR(RotationFrictionIce, "Rotation friction allowed to the player while on ice surfaces", - x44_translationFriction[2], skDefaultFlags); - CREATE_CVAR(RotationFrictionOrganic, "Rotation friction allowed to the player while on organic surfaces", - x44_translationFriction[3], skDefaultFlags); - CREATE_CVAR(RotationFrictionWater, "Rotation friction allowed to the player while in water", - x44_translationFriction[4], skDefaultFlags); - CREATE_CVAR(RotationFrictionLava, "Rotation friction allowed to the player while in lava", x44_translationFriction[5], - skDefaultFlags); - CREATE_CVAR(RotationFrictionPhazon, "Rotation friction allowed to the player while in phazon", - x44_translationFriction[6], skDefaultFlags); - CREATE_CVAR(RotationFrictionShrubbery, "Rotation friction allowed to the player while in shrubbery", - x44_translationFriction[7], skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedNormal, "Rotation max speed allowed to the player under normal circumstances", - x84_rotationMaxSpeed[0], skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedAir, "Rotation max speed allowed to the player while in air", x84_rotationMaxSpeed[1], - skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedIce, "Rotation max speed allowed to the player while on ice surfaces", - x84_rotationMaxSpeed[2], skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedOrganic, "Rotation max speed allowed to the player while on organic surfaces", - x84_rotationMaxSpeed[3], skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedWater, "Rotation max speed allowed to the player while in water", x84_rotationMaxSpeed[4], - skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedLava, "Rotation max speed allowed to the player while in lava", x84_rotationMaxSpeed[5], - skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedPhazon, "Rotation max speed allowed to the player while in phazon", - x84_rotationMaxSpeed[6], skDefaultFlags); - CREATE_CVAR(RotationMaxSpeedShrubbery, "Rotation max speed allowed to the player while in shrubbery", - x84_rotationMaxSpeed[7], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedNormal, "Translation max speed allowed to the player under normal circumstances", - xa4_translationMaxSpeed[0], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedNormal, "Translation max speed allowed to the player under normal circumstances", - xa4_translationMaxSpeed[1], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedIce, "Translation max speed allowed to the player while on ice surfaces", - xa4_translationMaxSpeed[2], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedOrganic, "Translation max speed allowed to the player while on organic surfaces", - xa4_translationMaxSpeed[3], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedWater, "Translation max speed allowed to the player while in water", - xa4_translationMaxSpeed[4], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedLava, "Translation max speed allowed to the player while in lava", - xa4_translationMaxSpeed[5], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedPhazon, "Translation max speed allowed to the player while in phazon", - xa4_translationMaxSpeed[6], skDefaultFlags); - CREATE_CVAR(TranslationMaxSpeedShrubbery, "Translation max speed allowed to the player while in shrubbery", - xa4_translationMaxSpeed[7], skDefaultFlags); - CREATE_CVAR(NormalGravityAcceleration, "Gravity applied to the player under normal circumstances", - xc4_normalGravAccel, skDefaultFlags); - CREATE_CVAR(FluidGravityAcceleration, "Gravity applied to the player while in water", xc8_fluidGravAccel, - skDefaultFlags); - CREATE_CVAR(VerticalJumpAcceleration, "Vertical acceleration applied while jumping", xcc_verticalJumpAccel, - skDefaultFlags); - CREATE_CVAR(HorizontalJumpAcceleration, "Horizontal acceleration while jumping", xd0_horizontalJumpAccel, - skDefaultFlags); - CREATE_CVAR(VerticalDoubleJumpAcceleration, "Vertical acceleration while double jumping", xd4_verticalDoubleJumpAccel, - skDefaultFlags); - CREATE_CVAR(HorizontalDoubleJumpAcceleration, "Horizontal acceleration while double jumping", - xd8_horizontalDoubleJumpAccel, skDefaultFlags); - CREATE_CVAR(WaterJumpFactor, "Jump Factor while in water", xdc_waterJumpFactor, skDefaultFlags); - CREATE_CVAR(WaterBallJumpFactor, "Jump Factor while morphed in water", xe0_waterBallJumpFactor, skDefaultFlags); - CREATE_CVAR(LavaJumpFactor, "Jump Factor while in lava", xe4_lavaJumpFactor, skDefaultFlags); - CREATE_CVAR(LavaBallJumpFactor, "Jump Factor while morphed in lava", xe8_lavaBallJumpFactor, skDefaultFlags); - CREATE_CVAR(PhazonJumpFactor, "Jump Factor while in phazon", xec_phazonJumpFactor, skDefaultFlags); - CREATE_CVAR(PhazonBallJumpFactor, "Jump Factor while morphed in phazon", xf0_phazonBallJumpFactor, skDefaultFlags); - CREATE_CVAR(AllowedJumpTime, "", xf4_allowedJumpTime, skDefaultFlags); - CREATE_CVAR(AllowedDoubleJumpTime, "", xf8_allowedDoubleJumpTime, skDefaultFlags); - CREATE_CVAR(MinDoubleJumpWindow, "", xfc_minDoubleJumpWindow, skDefaultFlags); - CREATE_CVAR(MaxDoubleJumpWindow, "", x100_maxDoubleJumpWindow, skDefaultFlags); - // CREATE_CVAR(); // x104_ - CREATE_CVAR(MinJumpTime, "", x108_minJumpTime, skDefaultFlags); - CREATE_CVAR(MinDoubleJumpTime, "", x10c_minDoubleJumpTime, skDefaultFlags); - CREATE_CVAR(AllowedLedgeTime, "", x110_allowedLedgeTime, skDefaultFlags); - CREATE_CVAR(DoubleJumpImpulse, "", x114_doubleJumpImpulse, skDefaultFlags); - CREATE_CVAR(BackwardsForceMultiplier, "", x118_backwardsForceMultiplier, skDefaultFlags); - CREATE_CVAR(BombJumpRadius, "", x11c_bombJumpRadius, skDefaultFlags); - CREATE_CVAR(BombJumpHeight, "", x120_bombJumpHeight, skDefaultFlags); - CREATE_CVAR(EyeOffset, "", x124_eyeOffset, skDefaultFlags); - CREATE_CVAR(TurnSpeedMultiplier, "", x128_turnSpeedMultiplier, skDefaultFlags); - CREATE_CVAR(FreeLookTurnSpeedMultiplier, "", x12c_freeLookTurnSpeedMultiplier, skDefaultFlags); - CREATE_CVAR(HorizontalFreeLookAngleVelocity, "", x130_horizontalFreeLookAngleVel, skDefaultFlags); - CREATE_CVAR(VerticalFreeLookAngleVelocity, "", x134_verticalFreeLookAngleVel, skDefaultFlags); - CREATE_CVAR(FreeLookSpeed, "", x138_freeLookSpeed, skDefaultFlags); - CREATE_CVAR(FreeLookSnapSpeed, "", x13c_freeLookSnapSpeed, skDefaultFlags); - // CREATE_CVAR(); // x140_ - CREATE_CVAR(FreeLookCenteredThresholdAngle, "", x144_freeLookCenteredThresholdAngle, skDefaultFlags); - CREATE_CVAR(FreeLookCenteredTime, "", x148_freeLookCenteredTime, skDefaultFlags); - CREATE_CVAR(FreeLookDampenFactor, "", x14c_freeLookDampenFactor, skDefaultFlags); - CREATE_CVAR(LeftDivisor, "", x150_leftDiv, skDefaultFlags); - CREATE_CVAR(RightDivisor, "", x154_rightDiv, skDefaultFlags); - CREATE_CVAR(OrbitMinDistanceClose, "", x158_orbitMinDistance[0], skDefaultFlags); - CREATE_CVAR(OrbitMinDistanceFar, "", x158_orbitMinDistance[1], skDefaultFlags); - CREATE_CVAR(OrbitMinDistanceDefault, "", x158_orbitMinDistance[2], skDefaultFlags); - CREATE_CVAR(OrbitNormalDistanceClose, "", x164_orbitNormalDistance[0], skDefaultFlags); - CREATE_CVAR(OrbitNormalDistanceFar, "", x164_orbitNormalDistance[1], skDefaultFlags); - CREATE_CVAR(OrbitNormalDistanceDefault, "", x164_orbitNormalDistance[2], skDefaultFlags); - CREATE_CVAR(OrbitMaxDistanceClose, "", x170_orbitMaxDistance[0], skDefaultFlags); - CREATE_CVAR(OrbitMaxDistanceFar, "", x170_orbitMaxDistance[1], skDefaultFlags); - CREATE_CVAR(OrbitMaxDistanceDefault, "", x170_orbitMaxDistance[2], skDefaultFlags); - // CREATE_CVAR(); // x17c_ - CREATE_CVAR(OrbitmodeTimer, "", x180_orbitModeTimer, skDefaultFlags); - CREATE_CVAR(OrbitCameraSpeed, "", x184_orbitCameraSpeed, skDefaultFlags); - CREATE_CVAR(OrbitUpperAngle, "", x184_orbitCameraSpeed, skDefaultFlags); - CREATE_CVAR(OrbitLowerAngle, "", x184_orbitCameraSpeed, skDefaultFlags); - CREATE_CVAR(OrbitHorizontalAngle, "", x184_orbitCameraSpeed, skDefaultFlags); - // CREATE_CVAR(); // x194_ - // CREATE_CVAR(); // x198_ - CREATE_CVAR(OrbitMaxTargetDistance, "", x19c_orbitMaxTargetDistance, skDefaultFlags); - CREATE_CVAR(OrbitMaxLockDistance, "", x1a0_orbitMaxLockDistance, skDefaultFlags); - CREATE_CVAR(OrbitDistanceThreshold, "", x1a4_orbitDistanceThreshold, skDefaultFlags); - CREATE_CVAR(OrbitScreenTargetingBoxHalfExtentX, "", x1a8_orbitScreenBoxHalfExtentX[0], skDefaultFlags); - CREATE_CVAR(OrbitScreenScanBoxHalfExtentX, "", x1a8_orbitScreenBoxHalfExtentX[1], skDefaultFlags); - CREATE_CVAR(OrbitScreenTargetingBoxHalfExtentY, "", x1b0_orbitScreenBoxHalfExtentY[0], skDefaultFlags); - CREATE_CVAR(OrbitScreenScanBoxHalfExtentY, "", x1b0_orbitScreenBoxHalfExtentY[1], skDefaultFlags); - CREATE_CVAR(OrbitScreenTargetingBoxCenterX, "", x1b8_orbitScreenBoxCenterX[0], skDefaultFlags); - CREATE_CVAR(OrbitScreenScanBoxCenterX, "", x1b8_orbitScreenBoxCenterX[1], skDefaultFlags); - CREATE_CVAR(OrbitScreenTargetingBoxCenterY, "", x1c0_orbitScreenBoxCenterY[0], skDefaultFlags); - CREATE_CVAR(OrbitScreenScanBoxCenterY, "", x1c0_orbitScreenBoxCenterY[1], skDefaultFlags); - CREATE_CVAR(OrbitZoneTargetingIdealX, "", x1c8_orbitZoneIdealX[0], skDefaultFlags); - CREATE_CVAR(OrbitZoneScanIdealX, "", x1c8_orbitZoneIdealX[1], skDefaultFlags); - CREATE_CVAR(OrbitZoneTargetingIdealY, "", x1d0_orbitZoneIdealY[0], skDefaultFlags); - CREATE_CVAR(OrbitZoneScanIdealY, "", x1d0_orbitZoneIdealY[1], skDefaultFlags); - CREATE_CVAR(OrbitNearX, "", x1d8_orbitNearX, skDefaultFlags); - CREATE_CVAR(OrbitNearZ, "", x1dc_orbitNearZ, skDefaultFlags); - // CREATE_CVAR(); // x1e0_ - // CREATE_CVAR(); // x1e4_ - CREATE_CVAR(OrbitFixedOffsetZDiff, "", x1e8_orbitFixedOffsetZDiff, skDefaultFlags); - CREATE_CVAR(OrbitZRange, "", x1ec_orbitZRange, skDefaultFlags); - // CREATE_CVAR(); // x1f0_ - // CREATE_CVAR(); // x1f4_ - // CREATE_CVAR(); // x1f8_ - CREATE_CVAR(OrbitPreventionTime, "", x1fc_orbitPreventionTime, skDefaultFlags); - CREATE_CVAR_BITFIELD(DashEnabled, "", x200_24_dashEnabled, skDefaultFlags); - CREATE_CVAR_BITFIELD(DashOnButtonRelease, "", x200_25_dashOnButtonRelease, skDefaultFlags); - CREATE_CVAR(DashButtonHoldCancelTime, "", x204_dashButtonHoldCancelTime, skDefaultFlags); - CREATE_CVAR(DashStrafeInputThreshold, "", x208_dashStrafeInputThreshold, skDefaultFlags); - CREATE_CVAR(SidewaysDoubleJumpImpulse, "", x20c_sidewaysDoubleJumpImpulse, skDefaultFlags); - CREATE_CVAR(SidewaysVerticalDoubleJumpAccel, "", x210_sidewaysVerticalDoubleJumpAccel, skDefaultFlags); - CREATE_CVAR(SidewaysHorizontalDoubleJumpAccel, "", x214_sidewaysHorizontalDoubleJumpAccel, skDefaultFlags); - CREATE_CVAR(ScanningRange, "", x218_scanningRange, skDefaultFlags); - CREATE_CVAR_BITFIELD(ScanRetention, "", x21c_24_scanRetention, skDefaultFlags); - CREATE_CVAR_BITFIELD(ScanFreezesGame, "", x21c_25_scanFreezesGame, skDefaultFlags); - CREATE_CVAR_BITFIELD(OrbitWhileScanning, "", x21c_26_orbitWhileScanning, skDefaultFlags); - CREATE_CVAR(ScanMaxTargetDistance, "", x220_scanMaxTargetDistance, skDefaultFlags); - CREATE_CVAR(ScanMaxLockDistance, "", x224_scanMaxLockDistance, skDefaultFlags); - CREATE_CVAR_BITFIELD(FreeLookTurnsPlayer, "", x228_24_freelookTurnsPlayer, skDefaultFlags); - // CREATE_CVAR_BITFIELD(); // x228_25_ - // CREATE_CVAR_BITFIELD(); // x228_26_ - CREATE_CVAR_BITFIELD(MoveDuringFreelook, "", x228_27_moveDuringFreeLook, skDefaultFlags); - CREATE_CVAR_BITFIELD(HoldButtonsForFreeLook, "", x228_28_holdButtonsForFreeLook, skDefaultFlags); - // CREATE_CVAR_BITFIELD(); // x228_30_ - // CREATE_CVAR_BITFIELD(); // x228_31_ - // CREATE_CVAR(); // x229_24_ - CREATE_CVAR_BITFIELD(AimWhenOrbitingPoint, "", x229_25_aimWhenOrbitingPoint, skDefaultFlags); - CREATE_CVAR_BITFIELD(StayInFreeLookWhileFiring, "", x229_26_stayInFreeLookWhileFiring, skDefaultFlags); - // CREATE_CVAR_BITFIELD(); // x229_27_ - // CREATE_CVAR_BITFIELD(); // x229_28_ - CREATE_CVAR_BITFIELD(OrbitFixedOffset, "", x229_29_orbitFixedOffset, skDefaultFlags); - CREATE_CVAR_BITFIELD(GunButtonTogglesHolster, "", x229_30_gunButtonTogglesHolster, skDefaultFlags); - CREATE_CVAR_BITFIELD(GunNotFiringHolstersGun, "", x229_31_gunNotFiringHolstersGun, skDefaultFlags); - CREATE_CVAR_BITFIELD(FallingDoubleJump, "", x22a_24_fallingDoubleJump, skDefaultFlags); - CREATE_CVAR_BITFIELD(ImpulseDoubleJump, "", x22a_25_impulseDoubleJump, skDefaultFlags); - CREATE_CVAR_BITFIELD(FiringCancelsCameraPitch, "", x22a_26_firingCancelsCameraPitch, skDefaultFlags); - CREATE_CVAR_BITFIELD(AssistedAimingIgnoreHorizontal, "", x22a_27_assistedAimingIgnoreHorizontal, skDefaultFlags); - CREATE_CVAR_BITFIELD(AssistedAimingIgnoreVertical, "", x22a_28_assistedAimingIgnoreVertical, skDefaultFlags); - // CREATE_CVAR(); // x22c - // CREATE_CVAR(); // x230_ - CREATE_CVAR(AimMaxDistance, "", x234_aimMaxDistance, skDefaultFlags); - // CREATE_CVAR(); // x238_ - // CREATE_CVAR(); // x23c_ - // CREATE_CVAR(); // x240_ - // CREATE_CVAR(); // x244_ - // CREATE_CVAR(); // x248_ - CREATE_CVAR(AimThresholdDistance, "", x24c_aimThresholdDistance, skDefaultFlags); - // CREATE_CVAR(); // x250_ - // CREATE_CVAR(); // x254_ - CREATE_CVAR(AimBoxWidth, "", x258_aimBoxWidth, skDefaultFlags); - CREATE_CVAR(AimBoxHeight, "", x25c_aimBoxHeight, skDefaultFlags); - CREATE_CVAR(AimTargetTimer, "", x260_aimTargetTimer, skDefaultFlags); - CREATE_CVAR(AimAssistHorizontalAngle, "", x264_aimAssistHorizontalAngle, skDefaultFlags); - CREATE_CVAR(AimAssistVerticalAngle, "", x268_aimAssistVerticalAngle, skDefaultFlags); - CREATE_CVAR(PlayerHeight, "", x26c_playerHeight, skDefaultFlags); - CREATE_CVAR(PlayerXYHalfExtent, "", x270_playerXYHalfExtent, skDefaultFlags); - CREATE_CVAR(StepUpHeight, "", x274_stepUpHeight, skDefaultFlags); - CREATE_CVAR(StepDownHeight, "", x278_stepDownHeight, skDefaultFlags); - CREATE_CVAR(PlayerBallHalfExtent, "", x27c_playerBallHalfExtent, skDefaultFlags); - CREATE_CVAR(FirstPersonCameraSpeed, "", x280_firstPersonCameraSpeed, skDefaultFlags); - // CREATE_CVAR(); // x284_ - CREATE_CVAR(JumpCameraPitchDownStart, "", x288_jumpCameraPitchDownStart, skDefaultFlags); - CREATE_CVAR(JumpCameraPitchDownFull, "", x28c_jumpCameraPitchDownFull, skDefaultFlags); - CREATE_CVAR(JumpCameraPitchDownAngle, "", x290_jumpCameraPitchDownAngle, skDefaultFlags); - CREATE_CVAR(FallCameraPitchDownStart, "", x294_fallCameraPitchDownStart, skDefaultFlags); - CREATE_CVAR(FallCameraPitchDownFull, "", x298_fallCameraPitchDownFull, skDefaultFlags); - CREATE_CVAR(FallCameraPitchDownAngle, "", x29c_fallCameraPitchDownAngle, skDefaultFlags); - CREATE_CVAR(OrbitDistanceMax, "", x2a0_orbitDistanceMax, skDefaultFlags); - CREATE_CVAR(GrappleSwingLength, "", x2a4_grappleSwingLength, skDefaultFlags); - CREATE_CVAR(GrappleSwingPeriod, "", x2a8_grappleSwingPeriod, skDefaultFlags); - CREATE_CVAR(GrapplePullSpeedMin, "", x2ac_grapplePullSpeedMin, skDefaultFlags); - CREATE_CVAR(GrappleCameraSpeed, "", x2b0_grappleCameraSpeed, skDefaultFlags); - CREATE_CVAR(MaxGrappleLockedTurnAlignDistance, "", x2b4_maxGrappleLockedTurnAlignDistance, skDefaultFlags); - CREATE_CVAR(GrapplePullSpeedProportion, "", x2b8_grapplePullSpeedProportion, skDefaultFlags); - CREATE_CVAR(GrapplePullSpeedMax, "", x2bc_grapplePullSpeedMax, skDefaultFlags); - CREATE_CVAR(GrappleLookCenterSpeed, "", x2c0_grappleLookCenterSpeed, skDefaultFlags); - CREATE_CVAR(MaxGrappleTurnSpeed, "", x2c4_maxGrappleTurnSpeed, skDefaultFlags); - CREATE_CVAR(GrappleJumpForce, "", x2c8_grappleJumpForce, skDefaultFlags); - CREATE_CVAR(GrappleReleaseTime, "", x2cc_grappleReleaseTime, skDefaultFlags); - CREATE_CVAR(GrappleJumpMode, "", x2d0_grappleJumpMode, skDefaultFlags); - CREATE_CVAR(OrbitReleaseBreaksGrapple, "", x2d4_orbitReleaseBreaksGrapple, skDefaultFlags); - CREATE_CVAR(InvertGrappleTurn, "", x2d5_invertGrappleTurn, skDefaultFlags); - CREATE_CVAR(GrappleBeamSpeed, "", x2d8_grappleBeamSpeed, skDefaultFlags); - CREATE_CVAR(GrappleBeamXWaveAmplitude, "", x2dc_grappleBeamXWaveAmplitude, skDefaultFlags); - CREATE_CVAR(GrappleBeamZWaveAmplitude, "", x2e0_grappleBeamZWaveAmplitude, skDefaultFlags); - CREATE_CVAR(GrappleBeamAnglePhaseDelta, "", x2e4_grappleBeamAnglePhaseDelta, skDefaultFlags); - // CREATE_CVAR(); // x2e8_ - // CREATE_CVAR(); // x2ec_ - // CREATE_CVAR(); // x2f0_ - // CREATE_CVAR(); // x2f4_ - CREATE_CVAR(FrozenTimeout, "", x2f8_frozenTimeout, skDefaultFlags); - CREATE_CVAR(IceBreakJumpCount, "", x2fc_iceBreakJumpCount, skDefaultFlags); - CREATE_CVAR(VariaDamageReduction, "", x300_variaDamageReduction, skDefaultFlags); - CREATE_CVAR(GravityDamageReduction, "", x304_gravityDamageReduction, skDefaultFlags); - CREATE_CVAR(PhazonDamageReduction, "", x308_phazonDamageReduction, skDefaultFlags); -} } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp index a68a1c9af..e5983db64 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp @@ -174,148 +174,6 @@ struct CTweakPlayer final : ITweakPlayer { Value x300_variaDamageReduction; Value x304_gravityDamageReduction; Value x308_phazonDamageReduction; - float GetMaxTranslationalAcceleration(int s) const override { return x4_maxTranslationalAcceleration[s]; } - float GetMaxRotationalAcceleration(int s) const override { return x24_maxRotationalAcceleration[s]; } - float GetPlayerTranslationFriction(int s) const override { return x44_translationFriction[s]; } - float GetPlayerRotationFriction(int s) const override { return x64_rotationFriction[s]; } - float GetPlayerRotationMaxSpeed(int s) const override { return x84_rotationMaxSpeed[s]; } - float GetPlayerTranslationMaxSpeed(int s) const override { return xa4_translationMaxSpeed[s]; } - float GetNormalGravAccel() const override { return xc4_normalGravAccel; } - float GetFluidGravAccel() const override { return xc8_fluidGravAccel; } - float GetVerticalJumpAccel() const override { return xcc_verticalJumpAccel; } - float GetHorizontalJumpAccel() const override { return xd0_horizontalJumpAccel; } - float GetVerticalDoubleJumpAccel() const override { return xd4_verticalDoubleJumpAccel; } - float GetHorizontalDoubleJumpAccel() const override { return xd8_horizontalDoubleJumpAccel; } - float GetWaterJumpFactor() const override { return xdc_waterJumpFactor; } - float GetWaterBallJumpFactor() const override { return xe0_waterBallJumpFactor; } - float GetLavaJumpFactor() const override { return xe4_lavaJumpFactor; } - float GetLavaBallJumpFactor() const override { return xe8_lavaBallJumpFactor; } - float GetPhazonJumpFactor() const override { return xec_phazonJumpFactor; } - float GetPhazonBallJumpFactor() const override { return xf0_phazonBallJumpFactor; } - float GetAllowedJumpTime() const override { return xf4_allowedJumpTime; } - float GetAllowedDoubleJumpTime() const override { return xf8_allowedDoubleJumpTime; } - float GetMinDoubleJumpWindow() const override { return xfc_minDoubleJumpWindow; } - float GetMaxDoubleJumpWindow() const override { return x100_maxDoubleJumpWindow; } - float GetMinJumpTime() const override { return x108_minJumpTime; } - float GetMinDoubleJumpTime() const override { return x10c_minDoubleJumpTime; } - float GetAllowedLedgeTime() const override { return x110_allowedLedgeTime; } - float GetDoubleJumpImpulse() const override { return x114_doubleJumpImpulse; } - float GetBackwardsForceMultiplier() const override { return x118_backwardsForceMultiplier; } - float GetBombJumpRadius() const override { return x11c_bombJumpRadius; } - float GetBombJumpHeight() const override { return x120_bombJumpHeight; } - float GetEyeOffset() const override { return x124_eyeOffset; } - float GetTurnSpeedMultiplier() const override { return x128_turnSpeedMultiplier; } - float GetFreeLookTurnSpeedMultiplier() const override { return x12c_freeLookTurnSpeedMultiplier; } - float GetFreeLookSpeed() const override { return x138_freeLookSpeed; } - float GetFreeLookSnapSpeed() const override { return x13c_freeLookSnapSpeed; } - float GetFreeLookCenteredThresholdAngle() const override { return x144_freeLookCenteredThresholdAngle; } - float GetFreeLookCenteredTime() const override { return x148_freeLookCenteredTime; } - float GetOrbitModeTimer() const override { return x180_orbitModeTimer; } - float GetOrbitUpperAngle() const override { return x188_orbitUpperAngle; } - float GetOrbitLowerAngle() const override { return x18c_orbitLowerAngle; } - float GetOrbitHorizAngle() const override { return x190_orbitHorizAngle; } - float GetOrbitMaxTargetDistance() const override { return x19c_orbitMaxTargetDistance; } - float GetOrbitMaxLockDistance() const override { return x1a0_orbitMaxLockDistance; } - float GetOrbitDistanceThreshold() const override { return x1a4_orbitDistanceThreshold; } - uint32_t GetOrbitScreenBoxHalfExtentX(int zone) const override { return x1a8_orbitScreenBoxHalfExtentX[zone]; } - uint32_t GetOrbitScreenBoxHalfExtentY(int zone) const override { return x1b0_orbitScreenBoxHalfExtentY[zone]; } - uint32_t GetOrbitScreenBoxCenterX(int zone) const override { return x1b8_orbitScreenBoxCenterX[zone]; } - uint32_t GetOrbitScreenBoxCenterY(int zone) const override { return x1c0_orbitScreenBoxCenterY[zone]; } - uint32_t GetOrbitZoneIdealX(int zone) const override { return x1c8_orbitZoneIdealX[zone]; } - uint32_t GetOrbitZoneIdealY(int zone) const override { return x1d0_orbitZoneIdealY[zone]; } - float GetOrbitNearX() const override { return x1d8_orbitNearX; } - float GetOrbitNearZ() const override { return x1dc_orbitNearZ; } - float GetOrbitFixedOffsetZDiff() const override { return x1e8_orbitFixedOffsetZDiff; } - float GetOrbitZRange() const override { return x1ec_orbitZRange; } - bool GetDashEnabled() const override { return x200_24_dashEnabled; } - bool GetDashOnButtonRelease() const override { return x200_25_dashOnButtonRelease; } - float GetDashButtonHoldCancelTime() const override { return x204_dashButtonHoldCancelTime; } - float GetDashStrafeInputThreshold() const override { return x208_dashStrafeInputThreshold; } - float GetSidewaysDoubleJumpImpulse() const override { return x20c_sidewaysDoubleJumpImpulse; } - float GetSidewaysVerticalDoubleJumpAccel() const override { return x210_sidewaysVerticalDoubleJumpAccel; } - float GetSidewaysHorizontalDoubleJumpAccel() const override { return x214_sidewaysHorizontalDoubleJumpAccel; } - float GetScanningRange() const override { return x218_scanningRange; } - bool GetScanRetention() const override { return x21c_24_scanRetention; } - bool GetScanFreezesGame() const override { return x21c_25_scanFreezesGame; } - bool GetOrbitWhileScanning() const override { return x21c_26_orbitWhileScanning; } - float GetScanMaxTargetDistance() const override { return x220_scanMaxTargetDistance; } - float GetScanMaxLockDistance() const override { return x224_scanMaxLockDistance; } - bool GetMoveDuringFreeLook() const override { return x228_27_moveDuringFreeLook; } - bool GetHoldButtonsForFreeLook() const override { return x228_28_holdButtonsForFreeLook; } - bool GetTwoButtonsForFreeLook() const override { return x228_29_twoButtonsForFreeLook; } - bool GetAimWhenOrbitingPoint() const override { return x229_25_aimWhenOrbitingPoint; } - bool GetStayInFreeLookWhileFiring() const override { return x229_26_stayInFreeLookWhileFiring; } - bool GetOrbitFixedOffset() const override { return x229_29_orbitFixedOffset; } - bool GetGunButtonTogglesHolster() const override { return x229_30_gunButtonTogglesHolster; } - bool GetGunNotFiringHolstersGun() const override { return x229_31_gunNotFiringHolstersGun; } - bool GetFallingDoubleJump() const override { return x22a_24_fallingDoubleJump; } - bool GetImpulseDoubleJump() const override { return x22a_25_impulseDoubleJump; } - bool GetFiringCancelsCameraPitch() const override { return x22a_26_firingCancelsCameraPitch; } - bool GetAssistedAimingIgnoreHorizontal() const override { return x22a_27_assistedAimingIgnoreHorizontal; } - bool GetAssistedAimingIgnoreVertical() const override { return x22a_28_assistedAimingIgnoreVertical; } - float GetAimMaxDistance() const override { return x234_aimMaxDistance; } - float GetAimThresholdDistance() const override { return x24c_aimThresholdDistance; } - float GetAimBoxWidth() const override { return x258_aimBoxWidth; } - float GetAimBoxHeight() const override { return x25c_aimBoxHeight; } - float GetAimTargetTimer() const override { return x260_aimTargetTimer; } - float GetAimAssistHorizontalAngle() const override { return x264_aimAssistHorizontalAngle; } - float GetAimAssistVerticalAngle() const override { return x268_aimAssistVerticalAngle; } - float GetPlayerHeight() const override { return x26c_playerHeight; } - float GetPlayerXYHalfExtent() const override { return x270_playerXYHalfExtent; } - float GetStepUpHeight() const override { return x274_stepUpHeight; } - float GetStepDownHeight() const override { return x278_stepDownHeight; } - float GetPlayerBallHalfExtent() const override { return x27c_playerBallHalfExtent; } - float GetOrbitDistanceMax() const override { return x2a0_orbitDistanceMax; } - float GetGrappleSwingLength() const override { return x2a4_grappleSwingLength; } - float GetGrappleSwingPeriod() const override { return x2a8_grappleSwingPeriod; } - float GetGrapplePullSpeedMin() const override { return x2ac_grapplePullSpeedMin; } - float GetMaxGrappleLockedTurnAlignDistance() const override { return x2b4_maxGrappleLockedTurnAlignDistance; } - float GetGrapplePullSpeedProportion() const override { return x2b8_grapplePullSpeedProportion; } - float GetGrapplePullSpeedMax() const override { return x2bc_grapplePullSpeedMax; } - float GetGrappleLookCenterSpeed() const override { return x2c0_grappleLookCenterSpeed; } - float GetMaxGrappleTurnSpeed() const override { return x2c4_maxGrappleTurnSpeed; } - float GetGrappleJumpForce() const override { return x2c8_grappleJumpForce; } - float GetGrappleReleaseTime() const override { return x2cc_grappleReleaseTime; } - uint32_t GetGrappleJumpMode() const override { return x2d0_grappleJumpMode; } - bool GetOrbitReleaseBreaksGrapple() const override { return x2d4_orbitReleaseBreaksGrapple; } - bool GetInvertGrappleTurn() const override { return x2d5_invertGrappleTurn; } - float GetGrappleBeamSpeed() const override { return x2d8_grappleBeamSpeed; } - float GetGrappleBeamXWaveAmplitude() const override { return x2dc_grappleBeamXWaveAmplitude; } - float GetGrappleBeamZWaveAmplitude() const override { return x2e0_grappleBeamZWaveAmplitude; } - float GetGrappleBeamAnglePhaseDelta() const override { return x2e4_grappleBeamAnglePhaseDelta; } - float GetHorizontalFreeLookAngleVel() const override { return x130_horizontalFreeLookAngleVel; } - float GetVerticalFreeLookAngleVel() const override { return x134_verticalFreeLookAngleVel; } - float GetOrbitCameraSpeed() const override { return x184_orbitCameraSpeed; } - float GetOrbitPreventionTime() const override { return x1fc_orbitPreventionTime; } - bool GetFreeLookTurnsPlayer() const override { return x228_24_freelookTurnsPlayer; } - float GetJumpCameraPitchDownStart() const override { return x288_jumpCameraPitchDownStart; } - float GetJumpCameraPitchDownFull() const override { return x28c_jumpCameraPitchDownFull; } - float GetJumpCameraPitchDownAngle() const override { return x290_jumpCameraPitchDownAngle; } - float GetFallCameraPitchDownStart() const override { return x294_fallCameraPitchDownStart; } - float GetFallCameraPitchDownFull() const override { return x298_fallCameraPitchDownFull; } - float GetFallCameraPitchDownAngle() const override { return x29c_fallCameraPitchDownAngle; } - float GetFirstPersonCameraSpeed() const override { return x280_firstPersonCameraSpeed; } - float GetGrappleCameraSpeed() const override { return x2b0_grappleCameraSpeed; } - float GetFreeLookDampenFactor() const override { return x14c_freeLookDampenFactor; } - float GetLeftLogicalThreshold() const override { return x150_leftDiv; } - float GetRightLogicalThreshold() const override { return x154_rightDiv; } - float GetOrbitMinDistance(int type) const override { return x158_orbitMinDistance[type]; } - float GetOrbitNormalDistance(int type) const override { return x164_orbitNormalDistance[type]; } - float GetOrbitMaxDistance(int type) const override { return x170_orbitMaxDistance[type]; } - float GetFrozenTimeout() const override { return x2f8_frozenTimeout; } - uint32_t GetIceBreakJumpCount() const override { return x2fc_iceBreakJumpCount; } - float GetVariaDamageReduction() const override { return x300_variaDamageReduction; } - float GetGravityDamageReduction() const override { return x304_gravityDamageReduction; } - float GetPhazonDamageReduction() const override { return x308_phazonDamageReduction; } - CTweakPlayer() = default; - CTweakPlayer(athena::io::IStreamReader& reader) { - read(reader); - FixupValues(); - } - - void FixupValues(); - void initCVars(hecl::CVarManager* mgr) override; - void _tweakListener(hecl::CVar* cv); }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp index 8488bcaaf..44968f908 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp @@ -7,9 +7,6 @@ namespace DataSpec::DNAMP1 { struct CTweakPlayerControl final : ITweakPlayerControl { AT_DECL_DNA_YAML Vector m_mappings; - atUint32 GetMapping(atUint32 command) const override { return m_mappings[command]; } - CTweakPlayerControl() = default; - CTweakPlayerControl(athena::io::IStreamReader& reader) { this->read(reader); } }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp index e9f821187..937fbde1d 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp @@ -33,77 +33,5 @@ struct CTweakPlayerGun final : ITweakPlayerGun { SWeaponInfo xa8_beams[5]; SComboShotParam x1f0_combos[5]; // Originally rstl::prereserved_vector Value x280_ricochetData[6]; // Originally rstl::prereserved_vector, extended to 6 to capture - // PhazonBeam's value - CTweakPlayerGun() = default; - CTweakPlayerGun(athena::io::IStreamReader& r) { - this->read(r); - x44_fixedVerticalAim = zeus::degToRad(x44_fixedVerticalAim); - } - - float GetUpLookAngle() const override { return x4_upLookAngle; } - float GetDownLookAngle() const override { return x8_downLookAngle; } - float GetVerticalSpread() const override { return xc_verticalSpread; } - float GetHorizontalSpread() const override { return x10_horizontalSpread; } - float GetHighVerticalSpread() const override { return x14_highVerticalSpread; } - float GetHighHorizontalSpread() const override { return x18_highHorizontalSpread; } - float GetLowVerticalSpread() const override { return x1c_lowVerticalSpread; } - float GetLowHorizontalSpread() const override { return x20_lowHorizontalSpread; } - float GetAimVerticalSpeed() const override { return x24_aimVerticalSpeed; } - float GetAimHorizontalSpeed() const override { return x28_aimHorizontalSpeed; } - float GetBombFuseTime() const override { return x2c_bombFuseTime; } - float GetBombDropDelayTime() const override { return x30_bombDropDelayTime; } - float GetHoloHoldTime() const override { return x34_holoHoldTime; } - float GetGunTransformTime() const override { return x38_gunTransformTime; } - float GetGunHolsterTime() const override { return x3c_gunHolsterTime; } - float GetGunNotFiringTime() const override { return x40_gunNotFiringTime; } - float GetFixedVerticalAim() const override { return x44_fixedVerticalAim; } - float GetGunExtendDistance() const override { return x48_gunExtendDistance; } - const zeus::CVector3f& GetGunPosition() const override { return x4c_gunPosition; } - const zeus::CVector3f& GetGrapplingArmPosition() const override { return x64_grapplingArmPosition; } - float GetRichochetDamage(atUint32 type) const override { - switch (type) { - case 0: // Power - return x280_ricochetData[0]; - case 1: // Ice - return x280_ricochetData[1]; - case 2: // Wave - return x280_ricochetData[2]; - case 3: // Plasma - return x280_ricochetData[3]; - case 6: // Missile - return x280_ricochetData[4]; - case 8: // Phazon - /* Note: In order to return the same value as retail we have to do a bit of a hack - * Retro accidentally forgot to load in PhazonBeam's richochet value, as a result, it loads the - * pointer to CTweakParticle's vtable. - */ -#if MP_v1088 - - return float(0x803D9CC4); -#else - return x280_ricochetData[5]; -#endif - default: - return 1.f; - } - } - - const SWeaponInfo& GetBeamInfo(atInt32 beam) const override { - if (beam < 0 || beam >= 5) { - return xa8_beams[0]; - } - return xa8_beams[beam]; - } - - const SComboShotParam& GetComboShotInfo(atInt32 beam) const override { - if (beam < 0 || beam >= 5) { - return x1f0_combos[0]; - } - return x1f0_combos[beam]; - } - - const SShotParam& GetBombInfo() const override { return x70_bomb; } - const SShotParam& GetPowerBombInfo() const override { return x8c_powerBomb; } - const SShotParam& GetMissileInfo() const { return x1d4_missile; } }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp b/DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp index ed0fc2963..fd3bafce8 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp @@ -56,12 +56,12 @@ struct AT_SPECIALIZE_PARMS(true, false) CTweakTargeting final : public ITweakTar Value xf0_outerBeamSquaresScale; DNAColor xf4_outerBeamSquareColor; Value xf8_outerBeamSquareAngleCount; - struct UnkVec : BigDNA { + struct SSquareAngles : BigDNA { AT_DECL_DNA Value count; - Vector floats; + Vector angles; }; - Vector xf8_outerBeamSquareAngles; + Vector xf8_outerBeamSquareAngles; Value x108_chargeGaugeAngleCount; Vector x108_chargeGaugeAngles; Value x118_chargeGaugeScale; @@ -243,7 +243,7 @@ struct AT_SPECIALIZE_PARMS(true, false) CTweakTargeting final : public ITweakTar const zeus::CColor& GetInnerBeamColorIce() const override { return xdc_innerBeamColorIce; } const zeus::CColor& GetInnerBeamColorWave() const override { return xe0_innerBeamColorWave; } const zeus::CColor& GetInnerBeamColorPlasma() const override { return xe4_innerBeamColorPlasma; } - const float* GetOuterBeamSquareAngles(int i) const override { return xf8_outerBeamSquareAngles[i].floats.data(); } + const float* GetOuterBeamSquareAngles(int i) const override { return xf8_outerBeamSquareAngles[i].angles.data(); } float GetChargeGaugeAngle(int i) const override { return x108_chargeGaugeAngles[i]; } float GetChargeGaugeScale() const override { return x118_chargeGaugeScale; } const zeus::CColor& GetChargeGaugeNonFullColor() const override { return x11c_chargeGaugeNonFullColor; } diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index a6a7fa1f1..8fa336584 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -52,6 +52,8 @@ #include "hecl/Blender/Connection.hpp" #include "hecl/Blender/SDNARead.hpp" #include "nod/nod.hpp" +#include +#include namespace DataSpec { diff --git a/NESEmulator/CMakeLists.txt b/NESEmulator/CMakeLists.txt index c7e17ef23..7f04a9d94 100644 --- a/NESEmulator/CMakeLists.txt +++ b/NESEmulator/CMakeLists.txt @@ -10,8 +10,8 @@ target_include_directories(NESEmulator PRIVATE ${CMAKE_SOURCE_DIR}/extern PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_compile_definitions(NESEmulator PRIVATE COL_32BIT=1 COL_TEX_BSWAP=1) -target_link_libraries(NESEmulator boo hecl-full RuntimeCommon ${HECL_APPLICATION_REPS_TARGETS_LIST}) +target_link_libraries(NESEmulator RuntimeCommon) if (NOT MSVC) target_compile_options(NESEmulator PRIVATE -Wno-implicit-fallthrough -Wno-format -Wno-pointer-compare -Wno-memset-elt-size) -endif () \ No newline at end of file +endif () diff --git a/NESEmulator/CNESEmulator.cpp b/NESEmulator/CNESEmulator.cpp index 2fd0909c3..27128fa5d 100644 --- a/NESEmulator/CNESEmulator.cpp +++ b/NESEmulator/CNESEmulator.cpp @@ -605,12 +605,12 @@ void CNESEmulator::ProcessUserInput(const CFinalInput& input, int) { if (GetPasswordEntryState() != EPasswordEntryState::NotPasswordScreen) { // Don't swap A/B - inValReads[BUTTON_A] = input.DA() || input.DSpecialKey(boo::ESpecialKey::Enter) || - input.DMouseButton(boo::EMouseButton::Primary); - inValReads[BUTTON_B] = input.DB() || input.DSpecialKey(boo::ESpecialKey::Esc); + inValReads[BUTTON_A] = input.DA() || input.DSpecialKey(aurora::SpecialKey::Enter) || + input.DMouseButton(EMouseButton::Primary); + inValReads[BUTTON_B] = input.DB() || input.DSpecialKey(aurora::SpecialKey::Esc); } else { // Prime controls (B jumps, A shoots) - inValReads[BUTTON_B] = input.DA() || input.DY() || input.DMouseButton(boo::EMouseButton::Primary); + inValReads[BUTTON_B] = input.DA() || input.DY() || input.DMouseButton(EMouseButton::Primary); inValReads[BUTTON_A] = input.DB() || input.DX() || input.DKey(' '); } @@ -619,7 +619,7 @@ void CNESEmulator::ProcessUserInput(const CFinalInput& input, int) { inValReads[BUTTON_LEFT] = input.DDPLeft() || input.DLALeft(); inValReads[BUTTON_RIGHT] = input.DDPRight() || input.DLARight(); inValReads[BUTTON_SELECT] = input.DZ() || input.DKey('\t'); - inValReads[BUTTON_START] = input.DStart() || input.DSpecialKey(boo::ESpecialKey::Esc); + inValReads[BUTTON_START] = input.DStart() || input.DSpecialKey(aurora::SpecialKey::Esc); } bool CNESEmulator::CheckForGameOver(const u8* vram, u8* passwordOut) { diff --git a/Runtime/Audio/CAudioGroupSet.cpp b/Runtime/Audio/CAudioGroupSet.cpp index d24e2c62f..1249e9a42 100644 --- a/Runtime/Audio/CAudioGroupSet.cpp +++ b/Runtime/Audio/CAudioGroupSet.cpp @@ -11,11 +11,11 @@ amuse::AudioGroupData CAudioGroupSet::LoadData() { return SBig(value); }; - athena::io::MemoryReader r(m_buffer.get(), INT32_MAX); - x10_baseName = r.readString(); - x20_name = r.readString(); + CMemoryInStream r(m_buffer.get(), INT32_MAX, CMemoryInStream::EOwnerShip::NotOwned); + x10_baseName = r.Get(); + x20_name = r.Get(); - u8* buf = m_buffer.get() + r.position(); + u8* buf = m_buffer.get() + r.GetReadPosition(); const uint32_t poolLen = readU32(buf); unsigned char* pool = buf + 4; buf += poolLen + 4; diff --git a/Runtime/Audio/CAudioGroupSet.hpp b/Runtime/Audio/CAudioGroupSet.hpp index 4bbaf333e..444b547c7 100644 --- a/Runtime/Audio/CAudioGroupSet.hpp +++ b/Runtime/Audio/CAudioGroupSet.hpp @@ -5,7 +5,7 @@ #include "Runtime/CFactoryMgr.hpp" #include "Runtime/CToken.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/IObj.hpp" #include "Runtime/RetroTypes.hpp" diff --git a/Runtime/Audio/CMidiManager.cpp b/Runtime/Audio/CMidiManager.cpp index 14332d621..4ec45837a 100644 --- a/Runtime/Audio/CMidiManager.cpp +++ b/Runtime/Audio/CMidiManager.cpp @@ -1,5 +1,7 @@ #include "Runtime/Audio/CMidiManager.hpp" +#include "Runtime/Streams/CInputStream.hpp" + namespace metaforce { std::unordered_set CMidiManager::m_MidiWrappers = {}; @@ -35,13 +37,13 @@ CMidiHandle CMidiManager::Play(const CMidiData& data, float fadeTime, bool stopE } CMidiManager::CMidiData::CMidiData(CInputStream& in) { - in.readUint32Big(); - x0_setupId = in.readUint32Big(); - x2_groupId = in.readUint32Big(); - x4_agscId = in.readUint32Big(); - u32 length = in.readUint32Big(); + in.ReadLong(); + x0_setupId = in.ReadLong(); + x2_groupId = in.ReadLong(); + x4_agscId = in.Get(); + u32 length = in.ReadLong(); x8_arrData.reset(new u8[length]); - in.readUBytesToBuf(x8_arrData.get(), length); + in.ReadBytes(reinterpret_cast(x8_arrData.get()), length); } CFactoryFnReturn FMidiDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& parms, diff --git a/Runtime/Audio/CSfxManager.cpp b/Runtime/Audio/CSfxManager.cpp index 8394782d4..f3d3f5d7c 100644 --- a/Runtime/Audio/CSfxManager.cpp +++ b/Runtime/Audio/CSfxManager.cpp @@ -1,4 +1,5 @@ #include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Streams/CInputStream.hpp" #include "Runtime/CSimplePool.hpp" @@ -19,10 +20,10 @@ static amuse::EffectDelay* s_DelayState = nullptr; CFactoryFnReturn FAudioTranslationTableFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms, CObjectReference* selfRef) { std::unique_ptr> obj = std::make_unique>(); - u32 count = in.readUint32Big(); + u32 count = in.ReadLong(); obj->reserve(count); for (u32 i = 0; i < count; ++i) - obj->push_back(in.readUint16Big()); + obj->push_back(in.ReadShort()); return TToken>::GetIObjObjectFor(std::move(obj)); } diff --git a/Runtime/Audio/CSfxManager.hpp b/Runtime/Audio/CSfxManager.hpp index 9c237c302..5da3a371f 100644 --- a/Runtime/Audio/CSfxManager.hpp +++ b/Runtime/Audio/CSfxManager.hpp @@ -5,7 +5,7 @@ #include #include -#include "DNAMP1/SFX/SFX.h" +#include "SFX/SFX.h" #include "Runtime/RetroTypes.hpp" #include "Runtime/Audio/CAudioSys.hpp" diff --git a/Runtime/Audio/SFX/Atomic.h b/Runtime/Audio/SFX/Atomic.h new file mode 100644 index 000000000..055d91c43 --- /dev/null +++ b/Runtime/Audio/SFX/Atomic.h @@ -0,0 +1,27 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Atomic + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPAtomic 1 + +#define SFXelu_a_elec_lp_00 42 +#define SFXat2_b_fly_lp_00 43 +#define SFXatm_b_fly_lp_00 44 +#define SFXatm_b_fly_lp_01 45 +#define SFXatm_a_bombdrp_00 46 +#define SFXsfx002F 47 +#define SFXsfx0030 48 +#define SFXsfx0031 49 +#define SFXsfx0032 50 +#define SFXsfx0033 51 +#define SFXsfx0034 52 +#define SFXsfx0035 53 +#define SFXsfx0036 54 +#define SFXsfx0037 55 +#define SFXsfx0038 56 +#define SFXsfx0039 57 +#define SFXsfx003A 58 +#define SFXsfx003B 59 diff --git a/Runtime/Audio/SFX/BetaBeetle.h b/Runtime/Audio/SFX/BetaBeetle.h new file mode 100644 index 000000000..5bc2728cf --- /dev/null +++ b/Runtime/Audio/SFX/BetaBeetle.h @@ -0,0 +1,41 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: BetaBeetle + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPBetaBeetle 2 + +#define SFXsfx003C 60 +#define SFXsfx003D 61 +#define SFXsfx003E 62 +#define SFXsfx003F 63 +#define SFXsfx0040 64 +#define SFXsfx0041 65 +#define SFXsfx0042 66 +#define SFXsfx0043 67 +#define SFXsfx0044 68 +#define SFXsfx0045 69 +#define SFXsfx0046 70 +#define SFXsfx0047 71 +#define SFXsfx0048 72 +#define SFXsfx0049 73 +#define SFXsfx004A 74 +#define SFXsfx004B 75 +#define SFXsfx004C 76 +#define SFXsfx004D 77 +#define SFXsfx004E 78 +#define SFXsfx004F 79 +#define SFXsfx0050 80 +#define SFXsfx0051 81 +#define SFXsfx0052 82 +#define SFXsfx0053 83 +#define SFXsfx0054 84 +#define SFXsfx0055 85 +#define SFXsfx0056 86 +#define SFXsfx0057 87 +#define SFXsfx0058 88 +#define SFXsfx0059 89 +#define SFXsfx005A 90 +#define SFXsfx005B 91 diff --git a/Runtime/Audio/SFX/Bird.h b/Runtime/Audio/SFX/Bird.h new file mode 100644 index 000000000..c58f7c470 --- /dev/null +++ b/Runtime/Audio/SFX/Bird.h @@ -0,0 +1,16 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Bird + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPBird 3 + +#define SFXsfx005C 92 +#define SFXsfx005D 93 +#define SFXsfx005E 94 +#define SFXsfx005F 95 +#define SFXsfx0060 96 +#define SFXsfx0061 97 +#define SFXsfx0062 98 diff --git a/Runtime/Audio/SFX/BloodFlower.h b/Runtime/Audio/SFX/BloodFlower.h new file mode 100644 index 000000000..3fa8e974c --- /dev/null +++ b/Runtime/Audio/SFX/BloodFlower.h @@ -0,0 +1,30 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: BloodFlower + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPBloodFlower 4 + +#define SFXblf_a_btmspit_00 99 +#define SFXblf_a_bulb_00 100 +#define SFXsfx0065 101 +#define SFXsfx0066 102 +#define SFXsfx0067 103 +#define SFXblf_b_active_00 104 +#define SFXblf_b_active_01 105 +#define SFXsfx006A 106 +#define SFXblf_b_breathe_00 107 +#define SFXsfx006C 108 +#define SFXsfx006D 109 +#define SFXsfx006E 110 +#define SFXsfx006F 111 +#define SFXblf_r_death_00 112 +#define SFXblf_r_death_01 113 +#define SFXblf_r_impact_00 114 +#define SFXfir_x_crispfire6voice_lp_00 115 +#define SFXsfx0074 116 +#define SFXsfx0075 117 +#define SFXsfx0076 118 +#define SFXsfx0077 119 diff --git a/Runtime/Audio/SFX/Burrower.h b/Runtime/Audio/SFX/Burrower.h new file mode 100644 index 000000000..b7cb10005 --- /dev/null +++ b/Runtime/Audio/SFX/Burrower.h @@ -0,0 +1,29 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Burrower + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPBurrower 5 + +#define SFXbur_a_attack_00 120 +#define SFXbur_b_burrow_lp_00 121 +#define SFXbur_b_idle_00 122 +#define SFXbur_b_idle_01 123 +#define SFXbur_b_walk_00 124 +#define SFXbur_b_walk_01 125 +#define SFXbur_b_walk_02 126 +#define SFXbur_r_death_00 127 +#define SFXsfx0080 128 +#define SFXsfx0081 129 +#define SFXsfx0082 130 +#define SFXsfx0083 131 +#define SFXsfx0084 132 +#define SFXsfx0085 133 +#define SFXsfx0086 134 +#define SFXsfx0087 135 +#define SFXsfx0088 136 +#define SFXsfx0089 137 +#define SFXsfx008A 138 +#define SFXsfx008B 139 diff --git a/Runtime/Audio/SFX/ChozoGhost.h b/Runtime/Audio/SFX/ChozoGhost.h new file mode 100644 index 000000000..33bddf359 --- /dev/null +++ b/Runtime/Audio/SFX/ChozoGhost.h @@ -0,0 +1,61 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: ChozoGhost + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPChozoGhost 6 + +#define SFXchg_a_dball_00 140 +#define SFXchg_a_dcharge_00 141 +#define SFXchg_a_dfire_00 142 +#define SFXsfx008F 143 +#define SFXsfx0090 144 +#define SFXsfx0091 145 +#define SFXsfx0092 146 +#define SFXsfx0093 147 +#define SFXsfx0094 148 +#define SFXchg_a_pball_00 149 +#define SFXchg_a_pfire_00 150 +#define SFXsfx0097 151 +#define SFXsfx0098 152 +#define SFXsfx0099 153 +#define SFXsfx009A 154 +#define SFXchg_b_fadein_00 155 +#define SFXsfx009C 156 +#define SFXchg_b_float_00 157 +#define SFXchg_b_growl_00 158 +#define SFXchg_b_jump_00 159 +#define SFXsfx00A0 160 +#define SFXsfx00A1 161 +#define SFXsfx00A2 162 +#define SFXsfx00A3 163 +#define SFXsfx00A4 164 +#define SFXchg_r_death_00 165 +#define SFXchg_r_hit_00 166 +#define SFXchg_a_pcharge_00 167 +#define SFXsfx00A8 168 +#define SFXsfx00A9 169 +#define SFXchg_b_growl_01 170 +#define SFXchg_b_scrape_00 171 +#define SFXchg_r_death_01 172 +#define SFXsfx00AD 173 +#define SFXchg_b_growl_03 174 +#define SFXchg_b_growl_04 175 +#define SFXsfx00B0 176 +#define SFXchg_b_voxalert_00 177 +#define SFXsfx00B2 178 +#define SFXchg_b_warpin_00 179 +#define SFXsfx00B4 180 +#define SFXsfx00B5 181 +#define SFXsfx00B6 182 +#define SFXsfx00B7 183 +#define SFXsfx00B8 184 +#define SFXsfx00B9 185 +#define SFXsfx00BA 186 +#define SFXsfx00BB 187 +#define SFXsfx00BC 188 +#define SFXsfx00BD 189 +#define SFXsfx00BE 190 +#define SFXsfx00BF 191 diff --git a/Runtime/Audio/SFX/ChubbWeed.h b/Runtime/Audio/SFX/ChubbWeed.h new file mode 100644 index 000000000..3f33f7989 --- /dev/null +++ b/Runtime/Audio/SFX/ChubbWeed.h @@ -0,0 +1,16 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: ChubbWeed + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPChubbWeed 7 + +#define SFXchb_r_scream_00 192 +#define SFXchb_r_alert_00_lp 193 +#define SFXsfx00C2 194 +#define SFXsfx00C3 195 +#define SFXsfx00C4 196 +#define SFXsfx00C5 197 +#define SFXsfx00C6 198 diff --git a/Runtime/Audio/SFX/CineBoots.h b/Runtime/Audio/SFX/CineBoots.h new file mode 100644 index 000000000..5109d62ad --- /dev/null +++ b/Runtime/Audio/SFX/CineBoots.h @@ -0,0 +1,29 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: CineBoots + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCineBoots 59 + +#define SFXci7_x_jump_00 2972 +#define SFXsja_c_electric_lp_00 2973 +#define SFXsfx0B9E 2974 +#define SFXsfx0B9F 2975 +#define SFXsfx0BA0 2976 +#define SFXsfx0BA1 2977 +#define SFXsfx0BA2 2978 +#define SFXsfx0BA3 2979 +#define SFXsfx0BA4 2980 +#define SFXsfx0BA5 2981 +#define SFXsfx0BA6 2982 +#define SFXsfx0BA7 2983 +#define SFXsfx0BA8 2984 +#define SFXsfx0BA9 2985 +#define SFXsfx0BAA 2986 +#define SFXsfx0BAB 2987 +#define SFXsfx0BAC 2988 +#define SFXsfx0BAD 2989 +#define SFXsfx0BAE 2990 +#define SFXsfx0BAF 2991 diff --git a/Runtime/Audio/SFX/CineGeneral.h b/Runtime/Audio/SFX/CineGeneral.h new file mode 100644 index 000000000..6edef7c24 --- /dev/null +++ b/Runtime/Audio/SFX/CineGeneral.h @@ -0,0 +1,50 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: CineGeneral + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCineGeneral 60 + +#define SFXsfx0BB0 2992 +#define SFXsfx0BB1 2993 +#define SFXci5_x_mapdown_00 2994 +#define SFXci5_x_mapload_lp_00 2995 +#define SFXci5_x_mapspin_lp_00 2996 +#define SFXci5_x_mapup_00 2997 +#define SFXepr_b_grenup_00 2998 +#define SFXpi2_x_missile_00 2999 +#define SFXpi2_x_healthsm_00 3000 +#define SFXpi2_x_smissile_00 3001 +#define SFXsfx0BBA 3002 +#define SFXsfx0BBB 3003 +#define SFXsfx0BBC 3004 +#define SFXsfx0BBD 3005 +#define SFXci9_x_nrg_lp_00 3006 +#define SFXsfx0BBF 3007 +#define SFXci9_x_insert_00 3008 +#define SFXsfx0BC1 3009 +#define SFXsfx0BC2 3010 +#define SFXsfx0BC3 3011 +#define SFXsfx0BC4 3012 +#define SFXsfx0BC5 3013 +#define SFXsfx0BC6 3014 +#define SFXsfx0BC7 3015 +#define SFXsfx0BC8 3016 +#define SFXsfx0BC9 3017 +#define SFXsfx0BCA 3018 +#define SFXsfx0BCB 3019 +#define SFXsfx0BCC 3020 +#define SFXsfx0BCD 3021 +#define SFXsfx0BCE 3022 +#define SFXsfx0BCF 3023 +#define SFXsfx0BD0 3024 +#define SFXsfx0BD1 3025 +#define SFXsfx0BD2 3026 +#define SFXsfx0BD3 3027 +#define SFXsfx0BD4 3028 +#define SFXsfx0BD5 3029 +#define SFXsfx0BD6 3030 +#define SFXsfx0BD7 3031 +#define SFXsfx0BD8 3032 diff --git a/Runtime/Audio/SFX/CineGun.h b/Runtime/Audio/SFX/CineGun.h new file mode 100644 index 000000000..37e176a80 --- /dev/null +++ b/Runtime/Audio/SFX/CineGun.h @@ -0,0 +1,23 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: CineGun + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCineGun 62 + +#define SFXsfx0BE5 3045 +#define SFXci3_x_clank_00 3046 +#define SFXci4_x_clank_00 3047 +#define SFXsfx0BE8 3048 +#define SFXci3_c_ridiclaw_00 3049 +#define SFXsfx0BEA 3050 +#define SFXsfx0BEB 3051 +#define SFXsfx0BEC 3052 +#define SFXsfx0BED 3053 +#define SFXsfx0BEE 3054 +#define SFXsfx0BEF 3055 +#define SFXsfx0BF0 3056 +#define SFXsfx0BF1 3057 +#define SFXsfx0BF2 3058 diff --git a/Runtime/Audio/SFX/CineMorphball.h b/Runtime/Audio/SFX/CineMorphball.h new file mode 100644 index 000000000..862a9be10 --- /dev/null +++ b/Runtime/Audio/SFX/CineMorphball.h @@ -0,0 +1,19 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: CineMorphball + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCineMorphball 63 + +#define SFXsfx0BF3 3059 +#define SFXsfx0BF4 3060 +#define SFXsfx0BF5 3061 +#define SFXsfx0BF6 3062 +#define SFXsfx0BF7 3063 +#define SFXsfx0BF8 3064 +#define SFXsfx0BF9 3065 +#define SFXsfx0BFA 3066 +#define SFXsfx0BFB 3067 +#define SFXsfx0BFC 3068 diff --git a/Runtime/Audio/SFX/CineSuit.h b/Runtime/Audio/SFX/CineSuit.h new file mode 100644 index 000000000..fda09dc9c --- /dev/null +++ b/Runtime/Audio/SFX/CineSuit.h @@ -0,0 +1,34 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: CineSuit + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCineSuit 64 + +#define SFXci2_x_energy_lp_00 3069 +#define SFXci2_x_energy_lp_01 3070 +#define SFXsfx0BFF 3071 +#define SFXsfx0C00 3072 +#define SFXci2_x_jump_00 3073 +#define SFXsfx0C02 3074 +#define SFXci2_x_lights_lp_00 3075 +#define SFXci2_x_pad_lp_00 3076 +#define SFXsfx0C05 3077 +#define SFXsfx0C06 3078 +#define SFXci3_x_energy_02 3079 +#define SFXsfx0C08 3080 +#define SFXsfx0C09 3081 +#define SFXci3_x_whoosh_00 3082 +#define SFXsfx0C0B 3083 +#define SFXsfx0C0C 3084 +#define SFXsfx0C0D 3085 +#define SFXsfx0C0E 3086 +#define SFXsfx0C0F 3087 +#define SFXsfx0C10 3088 +#define SFXsfx0C11 3089 +#define SFXsfx0C12 3090 +#define SFXsfx0C13 3091 +#define SFXsfx0C14 3092 +#define SFXsfx0C15 3093 diff --git a/Runtime/Audio/SFX/CineVisor.h b/Runtime/Audio/SFX/CineVisor.h new file mode 100644 index 000000000..ad8fe85ac --- /dev/null +++ b/Runtime/Audio/SFX/CineVisor.h @@ -0,0 +1,21 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: CineVisor + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCineVisor 61 + +#define SFXcin_x_visor_00 3033 +#define SFXsfx0BDA 3034 +#define SFXsfx0BDB 3035 +#define SFXsfx0BDC 3036 +#define SFXsfx0BDD 3037 +#define SFXsfx0BDE 3038 +#define SFXsfx0BDF 3039 +#define SFXsfx0BE0 3040 +#define SFXsfx0BE1 3041 +#define SFXsfx0BE2 3042 +#define SFXsfx0BE3 3043 +#define SFXsfx0BE4 3044 diff --git a/Runtime/Audio/SFX/Crater.h b/Runtime/Audio/SFX/Crater.h new file mode 100644 index 000000000..c7d0d97d5 --- /dev/null +++ b/Runtime/Audio/SFX/Crater.h @@ -0,0 +1,39 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Crater + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCrater 44 + +#define SFXsfx0764 1892 +#define SFXsfx0765 1893 +#define SFXsfx0766 1894 +#define SFXsfx0767 1895 +#define SFXsfx0768 1896 +#define SFXsfx0769 1897 +#define SFXsfx076A 1898 +#define SFXsfx076B 1899 +#define SFXsfx076C 1900 +#define SFXsfx076D 1901 +#define SFXsfx076E 1902 +#define SFXsfx076F 1903 +#define SFXsfx0770 1904 +#define SFXsfx0771 1905 +#define SFXsfx0772 1906 +#define SFXsfx0773 1907 +#define SFXsfx0774 1908 +#define SFXsfx0775 1909 +#define SFXsfx0776 1910 +#define SFXsfx0777 1911 +#define SFXsfx0778 1912 +#define SFXsfx0779 1913 +#define SFXsfx077A 1914 +#define SFXsfx077B 1915 +#define SFXsfx077C 1916 +#define SFXsfx077D 1917 +#define SFXsfx077E 1918 +#define SFXsfx077F 1919 +#define SFXsfx0780 1920 +#define SFXsfx0781 1921 diff --git a/Runtime/Audio/SFX/Crystallite.h b/Runtime/Audio/SFX/Crystallite.h new file mode 100644 index 000000000..f142471ce --- /dev/null +++ b/Runtime/Audio/SFX/Crystallite.h @@ -0,0 +1,19 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Crystallite + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPCrystallite 8 + +#define SFXcry_b_idle_00 199 +#define SFXsfx00C8 200 +#define SFXsfx00C9 201 +#define SFXsfx00CA 202 +#define SFXsfx00CB 203 +#define SFXsfx00CC 204 +#define SFXsfx00CD 205 +#define SFXsfx00CE 206 +#define SFXsfx00CF 207 +#define SFXsfx00D0 208 diff --git a/Runtime/Audio/SFX/Drones.h b/Runtime/Audio/SFX/Drones.h new file mode 100644 index 000000000..8f05c4963 --- /dev/null +++ b/Runtime/Audio/SFX/Drones.h @@ -0,0 +1,69 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Drones + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPDrones 9 + +#define SFXepr_a_shockhit_00 209 +#define SFXsfx00D2 210 +#define SFXdrn_b_burst_00 211 +#define SFXsfx00D4 212 +#define SFXsfx00D5 213 +#define SFXsfx00D6 214 +#define SFXsfx00D7 215 +#define SFXdrn_b_patrol_lp_00 216 +#define SFXdrn_b_henshin_00 217 +#define SFXdrn_b_rocket_lp_00 218 +#define SFXdrn_b_rocket_lp_01 219 +#define SFXdrn_b_rocket_lp_02 220 +#define SFXsfx00DD 221 +#define SFXdrn_r_death_00 222 +#define SFXsfx00DF 223 +#define SFXsfx00E0 224 +#define SFXdrn_r_impact_00 225 +#define SFXsfx00E2 226 +#define SFXdrn_a_blast_00 227 +#define SFXsfx00E4 228 +#define SFXdrn_r_death_lp_00 229 +#define SFXsfx00E6 230 +#define SFXdrn_b_alert_00 231 +#define SFXsfx00E8 232 +#define SFXdrn_a_laser_00 233 +#define SFXsfx00EA 234 +#define SFXsfx00EB 235 +#define SFXsfx00EC 236 +#define SFXsfx00ED 237 +#define SFXdrn_r_impact_01 238 +#define SFXsfx00EF 239 +#define SFXdrn_a_blast_01 240 +#define SFXsfx00F1 241 +#define SFXsfx00F2 242 +#define SFXdrn_b_henshin_01 243 +#define SFXdrn_b_talk_00 244 +#define SFXsfx00F5 245 +#define SFXdrn_r_death_lp_01 246 +#define SFXdrn_a_charge_00 247 +#define SFXdrn_b_beep_03 248 +#define SFXsfx00F9 249 +#define SFXdrn_r_empblast_01 250 +#define SFXsfx00FB 251 +#define SFXsfx00FC 252 +#define SFXdrn_b_patrolun_lp_00 253 +#define SFXdrn_a_laserun_00 254 +#define SFXopr_a_shockhit_00 255 +#define SFXsfx0100 256 +#define SFXsfx0101 257 +#define SFXsfx0102 258 +#define SFXsfx0103 259 +#define SFXsfx0104 260 +#define SFXsfx0105 261 +#define SFXsfx0106 262 +#define SFXsfx0107 263 +#define SFXsfx0108 264 +#define SFXsfx0109 265 +#define SFXsfx010A 266 +#define SFXsfx010B 267 +#define SFXsfx010C 268 diff --git a/Runtime/Audio/SFX/EliteSpacePirate.h b/Runtime/Audio/SFX/EliteSpacePirate.h new file mode 100644 index 000000000..41e0e69aa --- /dev/null +++ b/Runtime/Audio/SFX/EliteSpacePirate.h @@ -0,0 +1,63 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: EliteSpacePirate + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPEliteSpacePirate 10 + +#define SFXepr_a_grenade_00 269 +#define SFXsfx010E 270 +#define SFXsfx010F 271 +#define SFXepr_b_hitglass_00 272 +#define SFXepr_a_swoosh_00 273 +#define SFXepr_b_run_00 274 +#define SFXepr_b_run_01 275 +#define SFXepr_a_shokwave_00 276 +#define SFXsfx0115 277 +#define SFXepr_a_attack_00 278 +#define SFXepr_a_attack_01 279 +#define SFXepr_b_land_00 280 +#define SFXepr_b_alert_00 281 +#define SFXepr_b_walk_00 282 +#define SFXepr_b_walk_01 283 +#define SFXepr_b_alert_01 284 +#define SFXepr_b_absorb_lp_00 285 +#define SFXepr_b_idle_00 286 +#define SFXepr_b_idle_01 287 +#define SFXepr_a_hitgrnd_00 288 +#define SFXepr_b_walklite_00 289 +#define SFXepr_b_walklite_01 290 +#define SFXepr_r_pissed_00 291 +#define SFXsfx0124 292 +#define SFXsfx0125 293 +#define SFXepr_a_swoosh_01 294 +#define SFXepr_b_taunt_00 295 +#define SFXopr_a_swoosh_00 296 +#define SFXopr_a_swoosh_01 297 +#define SFXepr_b_blokvox_00 298 +#define SFXsfx012B 299 +#define SFXopr_a_shokwave_00 300 +#define SFXsfx012D 301 +#define SFXopr_b_absorb_lp_00 302 +#define SFXsfx012F 303 +#define SFXsfx0130 304 +#define SFXsfx0131 305 +#define SFXsfx0132 306 +#define SFXsfx0133 307 +#define SFXsfx0134 308 +#define SFXsfx0135 309 +#define SFXsfx0136 310 +#define SFXsfx0137 311 +#define SFXsfx0138 312 +#define SFXsfx0139 313 +#define SFXsfx013A 314 +#define SFXsfx013B 315 +#define SFXsfx013C 316 +#define SFXsfx013D 317 +#define SFXsfx013E 318 +#define SFXsfx013F 319 +#define SFXsfx0140 320 +#define SFXsfx0141 321 +#define SFXsfx0142 322 diff --git a/Runtime/Audio/SFX/FireFlea.h b/Runtime/Audio/SFX/FireFlea.h new file mode 100644 index 000000000..9657afe45 --- /dev/null +++ b/Runtime/Audio/SFX/FireFlea.h @@ -0,0 +1,22 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: FireFlea + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPFireFlea 11 + +#define SFXfif_b_idle_lp_00 323 +#define SFXsfx0144 324 +#define SFXfif_b_light_00 325 +#define SFXfif_r_death_00 326 +#define SFXfif_r_death_01 327 +#define SFXfif_r_explode_00 328 +#define SFXfif_r_impact_00 329 +#define SFXsfx014A 330 +#define SFXsfx014B 331 +#define SFXsfx014C 332 +#define SFXsfx014D 333 +#define SFXsfx014E 334 +#define SFXsfx014F 335 diff --git a/Runtime/Audio/SFX/Flaaghra.h b/Runtime/Audio/SFX/Flaaghra.h new file mode 100644 index 000000000..c7d328a51 --- /dev/null +++ b/Runtime/Audio/SFX/Flaaghra.h @@ -0,0 +1,90 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Flaaghra + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPFlaaghra 52 + +#define SFXfla_a_hitgrnd_00 2600 +#define SFXfla_a_swoosh_00 2601 +#define SFXfla_a_swoosh_01 2602 +#define SFXfla_a_voxattak_00 2603 +#define SFXfla_a_voxattak_01 2604 +#define SFXfla_b_grow_00 2605 +#define SFXfla_b_idle_00 2606 +#define SFXsfx0A2F 2607 +#define SFXfla_b_voxangry_00 2608 +#define SFXfla_b_voxangry_01 2609 +#define SFXfla_r_death_00 2610 +#define SFXfla_r_death_01 2611 +#define SFXfla_r_death_02 2612 +#define SFXsfx0A35 2613 +#define SFXfla_r_faint_01 2614 +#define SFXfla_r_pain_00 2615 +#define SFXsfx0A38 2616 +#define SFXfla_a_shoot_00 2617 +#define SFXfla_a_spit_00 2618 +#define SFXfla_a_spit_01 2619 +#define SFXsfx0A3C 2620 +#define SFXsfx0A3D 2621 +#define SFXfla_a_charge_00 2622 +#define SFXsfx0A3F 2623 +#define SFXsfx0A40 2624 +#define SFXfla_b_idlesm_00 2625 +#define SFXfla_a_chargevox_00 2626 +#define SFXsfx0A43 2627 +#define SFXsfx0A44 2628 +#define SFXsfx0A45 2629 +#define SFXfla_a_shootvox_00 2630 +#define SFXsfx0A47 2631 +#define SFXsfx0A48 2632 +#define SFXsfx0A49 2633 +#define SFXsfx0A4A 2634 +#define SFXsfx0A4B 2635 +#define SFXfla_a_spitvox_00 2636 +#define SFXfla_a_spitvox_01 2637 +#define SFXsfx0A4E 2638 +#define SFXsfx0A4F 2639 +#define SFXsfx0A50 2640 +#define SFXsfx0A51 2641 +#define SFXsfx0A52 2642 +#define SFXfla_a_sporevox_01 2643 +#define SFXfla_a_hitgrnd_01 2644 +#define SFXsfx0A55 2645 +#define SFXfla_r_landgrnd_00 2646 +#define SFXsfx0A57 2647 +#define SFXsfx0A58 2648 +#define SFXfla_b_grow_01 2649 +#define SFXfla_b_rise_lp_00 2650 +#define SFXsfx0A5B 2651 +#define SFXfla_b_dizzy_00 2652 +#define SFXsfx0A5D 2653 +#define SFXsfx0A5E 2654 +#define SFXfla_r_painsh_00 2655 +#define SFXsfx0A60 2656 +#define SFXfla_b_humor_00 2657 +#define SFXfla_r_painbig_00 2658 +#define SFXfla_b_dizzyout_00 2659 +#define SFXfla_b_faintout_00 2660 +#define SFXsfx0A65 2661 +#define SFXfla_b_dizzy_lp_01 2662 +#define SFXsfx0A67 2663 +#define SFXsfx0A68 2664 +#define SFXsfx0A69 2665 +#define SFXsfx0A6A 2666 +#define SFXfla_b_voxshrnk_00 2667 +#define SFXsfx0A6C 2668 +#define SFXsfx0A6D 2669 +#define SFXfla_b_voxshrnk_03 2670 +#define SFXsfx0A6F 2671 +#define SFXsfx0A70 2672 +#define SFXsfx0A71 2673 +#define SFXsfx0A72 2674 +#define SFXsfx0A73 2675 +#define SFXsfx0A74 2676 +#define SFXsfx0A75 2677 +#define SFXsfx0A76 2678 +#define SFXsfx0A77 2679 +#define SFXsfx0A78 2680 diff --git a/Runtime/Audio/SFX/FlickerBat.h b/Runtime/Audio/SFX/FlickerBat.h new file mode 100644 index 000000000..cd0b38c6e --- /dev/null +++ b/Runtime/Audio/SFX/FlickerBat.h @@ -0,0 +1,21 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: FlickerBat + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPFlickerBat 12 + +#define SFXflk_b_flicker_00 336 +#define SFXflk_b_talk_00 337 +#define SFXflk_b_talk_01 338 +#define SFXsfx0153 339 +#define SFXsfx0154 340 +#define SFXflk_r_impact_00 341 +#define SFXsfx0156 342 +#define SFXsfx0157 343 +#define SFXsfx0158 344 +#define SFXsfx0159 345 +#define SFXsfx015A 346 +#define SFXsfx015B 347 diff --git a/Runtime/Audio/SFX/FlyingPirate.h b/Runtime/Audio/SFX/FlyingPirate.h new file mode 100644 index 000000000..183c0f297 --- /dev/null +++ b/Runtime/Audio/SFX/FlyingPirate.h @@ -0,0 +1,68 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: FlyingPirate + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPFlyingPirate 13 + +#define SFXsfx015C 348 +#define SFXfpr_a_chaff_00 349 +#define SFXsfx015E 350 +#define SFXupr_a_mislfire_00 351 +#define SFXsfx0160 352 +#define SFXsfx0161 353 +#define SFXfpr_a_mislfire_00 354 +#define SFXfpr_b_thrust_01 355 +#define SFXsfx0164 356 +#define SFXfpr_b_engine_lp_00 357 +#define SFXfpr_b_engine_lp_01 358 +#define SFXfpr_b_engine_lp_02 359 +#define SFXfpr_b_voxangry_02 360 +#define SFXfpr_b_thrust_00 361 +#define SFXsfx016A 362 +#define SFXfpr_r_die_00 363 +#define SFXfpr_b_intruder_00 364 +#define SFXfpr_b_voxalert_00 365 +#define SFXfpr_a_mislload_00 366 +#define SFXfpr_b_voxangry_00 367 +#define SFXsfx0170 368 +#define SFXfpr_r_impact_00 369 +#define SFXsfx0172 370 +#define SFXsfx0173 371 +#define SFXsfx0174 372 +#define SFXfpr_b_engidle_lp_00 373 +#define SFXsfx0176 374 +#define SFXfpr_b_blastoff_lp_00 375 +#define SFXfpr_b_blastoff_01 376 +#define SFXupr_a_mislload_00 377 +#define SFXupr_b_engidle_lp_00 378 +#define SFXupr_b_engine_lp_00 379 +#define SFXupr_b_engine_lp_01 380 +#define SFXupr_b_engine_lp_02 381 +#define SFXsfx017E 382 +#define SFXsfx017F 383 +#define SFXupr_b_voxalert_00 384 +#define SFXsfx0181 385 +#define SFXupr_b_voxangry_00 386 +#define SFXsfx0183 387 +#define SFXupr_b_voxangry_02 388 +#define SFXupr_r_die_00 389 +#define SFXupr_r_impact_00 390 +#define SFXsfx0187 391 +#define SFXsfx0188 392 +#define SFXsfx0189 393 +#define SFXsfx018A 394 +#define SFXsfx018B 395 +#define SFXsfx018C 396 +#define SFXsfx018D 397 +#define SFXsfx018E 398 +#define SFXsfx018F 399 +#define SFXsfx0190 400 +#define SFXsfx0191 401 +#define SFXsfx0192 402 +#define SFXsfx0193 403 +#define SFXsfx0194 404 +#define SFXsfx0195 405 +#define SFXsfx0196 406 diff --git a/Runtime/Audio/SFX/FrontEnd.h b/Runtime/Audio/SFX/FrontEnd.h new file mode 100644 index 000000000..7aa483660 --- /dev/null +++ b/Runtime/Audio/SFX/FrontEnd.h @@ -0,0 +1,47 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: FrontEnd + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPFrontEnd 38 + +#define SFXfnt_transfore_00L 1090 +#define SFXfnt_advance_R 1091 +#define SFXsfx0444 1092 +#define SFXfnt_selection_change 1093 +#define SFXfnt_back 1094 +#define SFXfnt_enum_change 1095 +#define SFXfnt_advance_L 1096 +#define SFXfnt_transfore_00R 1097 +#define SFXfnt_transfore_01L 1098 +#define SFXfnt_transfore_01R 1099 +#define SFXfnt_transfore_02L 1100 +#define SFXfnt_transfore_02R 1101 +#define SFXfnt_transback_00L 1102 +#define SFXfnt_transback_00R 1103 +#define SFXfnt_transback_01L 1104 +#define SFXfnt_transback_01R 1105 +#define SFXfnt_transback_02L 1106 +#define SFXfnt_transback_02R 1107 +#define SFXfnt_tofusion_L 1108 +#define SFXfnt_tofusion_R 1109 +#define SFXfnt_fromfusion_L 1110 +#define SFXfnt_fromfusion_R 1111 +#define SFXsfx0458 1112 +#define SFXsfx0459 1113 +#define SFXsfx045A 1114 +#define SFXsfx045B 1115 +#define SFXsfx045C 1116 +#define SFXsfx045D 1117 +#define SFXsfx045E 1118 +#define SFXsfx045F 1119 +#define SFXsfx0460 1120 +#define SFXsfx0461 1121 +#define SFXsfx0462 1122 +#define SFXsfx0463 1123 +#define SFXsfx0464 1124 +#define SFXsfx0465 1125 +#define SFXsfx0466 1126 +#define SFXsfx0467 1127 diff --git a/Runtime/Audio/SFX/GagantuanBeatle.h b/Runtime/Audio/SFX/GagantuanBeatle.h new file mode 100644 index 000000000..3c29321d1 --- /dev/null +++ b/Runtime/Audio/SFX/GagantuanBeatle.h @@ -0,0 +1,61 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: GagantuanBeatle + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPGagantuanBeatle 14 + +#define SFXgab_r_hitlight_01 407 +#define SFXga2_b_digexplod_00 408 +#define SFXga2_b_digscream_00 409 +#define SFXga2_b_idle_01 410 +#define SFXga2_b_scrapedirt_00 411 +#define SFXgab_b_walkdirt_02 412 +#define SFXgab_b_rundirt_00 413 +#define SFXgab_b_rundirt_01 414 +#define SFXsfx019F 415 +#define SFXgab_a_attack_00 416 +#define SFXgab_a_attack_01 417 +#define SFXgab_b_idle_03 418 +#define SFXgab_b_digexplod_00 419 +#define SFXfla_b_scrapedirt_00 420 +#define SFXgab_b_idle_02 421 +#define SFXgab_b_idle_00 422 +#define SFXgab_b_idle_01 423 +#define SFXgab_b_walkdirt_00 424 +#define SFXgab_b_walkdirt_01 425 +#define SFXgab_r_collide_00 426 +#define SFXsfx01AB 427 +#define SFXgab_r_death_01 428 +#define SFXgab_r_detect_00 429 +#define SFXgab_r_hitlight_00 430 +#define SFXgab_b_digscream_00 431 +#define SFXgab_b_scrapedirt_00 432 +#define SFXga2_b_dig_lp_00 433 +#define SFXga2_b_rundirt_00 434 +#define SFXgab_b_dig_lp_00 435 +#define SFXga2_b_rundirt_01 436 +#define SFXga2_b_rundirt_02 437 +#define SFXga2_b_walkdirt_00 438 +#define SFXga2_b_walkdirt_01 439 +#define SFXga2_b_walkdirt_02 440 +#define SFXga2_r_collide_00 441 +#define SFXga2_a_attack_00 442 +#define SFXsfx01BB 443 +#define SFXsfx01BC 444 +#define SFXsfx01BD 445 +#define SFXsfx01BE 446 +#define SFXsfx01BF 447 +#define SFXsfx01C0 448 +#define SFXsfx01C1 449 +#define SFXsfx01C2 450 +#define SFXsfx01C3 451 +#define SFXsfx01C4 452 +#define SFXsfx01C5 453 +#define SFXsfx01C6 454 +#define SFXsfx01C7 455 +#define SFXsfx01C8 456 +#define SFXsfx01C9 457 +#define SFXsfx01CA 458 diff --git a/Runtime/Audio/SFX/Gnats.h b/Runtime/Audio/SFX/Gnats.h new file mode 100644 index 000000000..a704da839 --- /dev/null +++ b/Runtime/Audio/SFX/Gnats.h @@ -0,0 +1,16 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Gnats + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPGnats 15 + +#define SFXsfx01CB 459 +#define SFXsfx01CC 460 +#define SFXsfx01CD 461 +#define SFXsfx01CE 462 +#define SFXsfx01CF 463 +#define SFXsfx01D0 464 +#define SFXsfx01D1 465 diff --git a/Runtime/Audio/SFX/Gryzbee.h b/Runtime/Audio/SFX/Gryzbee.h new file mode 100644 index 000000000..f525e1a01 --- /dev/null +++ b/Runtime/Audio/SFX/Gryzbee.h @@ -0,0 +1,21 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Gryzbee + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPGryzbee 16 + +#define SFXgrz_b_idle_00 466 +#define SFXsfx01D3 467 +#define SFXsfx01D4 468 +#define SFXsfx01D5 469 +#define SFXsfx01D6 470 +#define SFXsfx01D7 471 +#define SFXsfx01D8 472 +#define SFXsfx01D9 473 +#define SFXsfx01DA 474 +#define SFXsfx01DB 475 +#define SFXsfx01DC 476 +#define SFXsfx01DD 477 diff --git a/Runtime/Audio/SFX/IceCrack.h b/Runtime/Audio/SFX/IceCrack.h new file mode 100644 index 000000000..8ba2aef58 --- /dev/null +++ b/Runtime/Audio/SFX/IceCrack.h @@ -0,0 +1,29 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: IceCrack + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPIceCrack 67 + +#define SFXsfx0C31 3121 +#define SFXsfx0C32 3122 +#define SFXsfx0C33 3123 +#define SFXsfx0C34 3124 +#define SFXsfx0C35 3125 +#define SFXsfx0C36 3126 +#define SFXcrk_break_subsequent 3127 +#define SFXcrk_break_initial 3128 +#define SFXcrk_break_final 3129 +#define SFXsfx0C3A 3130 +#define SFXsfx0C3B 3131 +#define SFXsfx0C3C 3132 +#define SFXsfx0C3D 3133 +#define SFXsfx0C3E 3134 +#define SFXsfx0C3F 3135 +#define SFXsfx0C40 3136 +#define SFXsfx0C41 3137 +#define SFXsfx0C42 3138 +#define SFXsfx0C43 3139 +#define SFXsfx0C44 3140 diff --git a/Runtime/Audio/SFX/IceWorld.h b/Runtime/Audio/SFX/IceWorld.h new file mode 100644 index 000000000..138ec27c6 --- /dev/null +++ b/Runtime/Audio/SFX/IceWorld.h @@ -0,0 +1,129 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: IceWorld + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPIceWorld 45 + +#define SFXice_x_gateopen_lp_00 1922 +#define SFXice_x_gatestop_00 1923 +#define SFXsfx0784 1924 +#define SFXice_x_towercrk_00 1925 +#define SFXice_ballroll_ice 1926 +#define SFXice_ballroll_snow 1927 +#define SFXsfx0788 1928 +#define SFXice_x_towerlnd_00 1929 +#define SFXsfx078A 1930 +#define SFXice_x_towerlnd_01 1931 +#define SFXice_x_towercrk_01 1932 +#define SFXice_x_towercrk_02 1933 +#define SFXsfx078E 1934 +#define SFXsfx078F 1935 +#define SFXsfx0790 1936 +#define SFXsfx0791 1937 +#define SFXsfx0792 1938 +#define SFXsfx0793 1939 +#define SFXsfx0794 1940 +#define SFXsfx0795 1941 +#define SFXsfx0796 1942 +#define SFXsfx0797 1943 +#define SFXsfx0798 1944 +#define SFXsfx0799 1945 +#define SFXsfx079A 1946 +#define SFXsfx079B 1947 +#define SFXsfx079C 1948 +#define SFXsfx079D 1949 +#define SFXsfx079E 1950 +#define SFXsfx079F 1951 +#define SFXsfx07A0 1952 +#define SFXsfx07A1 1953 +#define SFXsfx07A2 1954 +#define SFXsfx07A3 1955 +#define SFXsfx07A4 1956 +#define SFXsfx07A5 1957 +#define SFXsfx07A6 1958 +#define SFXsfx07A7 1959 +#define SFXsfx07A8 1960 +#define SFXsfx07A9 1961 +#define SFXsfx07AA 1962 +#define SFXsfx07AB 1963 +#define SFXsfx07AC 1964 +#define SFXsfx07AD 1965 +#define SFXsfx07AE 1966 +#define SFXsfx07AF 1967 +#define SFXtha_b_rockup_lp_00 1968 +#define SFXsfx07B1 1969 +#define SFXsfx07B2 1970 +#define SFXice_x_ridflap_00 1971 +#define SFXsfx07B4 1972 +#define SFXsfx07B5 1973 +#define SFXsfx07B6 1974 +#define SFXice_x_pump_00 1975 +#define SFXsfx07B8 1976 +#define SFXsfx07B9 1977 +#define SFXsfx07BA 1978 +#define SFXsfx07BB 1979 +#define SFXsfx07BC 1980 +#define SFXsfx07BD 1981 +#define SFXice_x_piston_00 1982 +#define SFXice_x_piston_lp_00 1983 +#define SFXsfx07C0 1984 +#define SFXsfx07C1 1985 +#define SFXsfx07C2 1986 +#define SFXsfx07C3 1987 +#define SFXsfx07C4 1988 +#define SFXsfx07C5 1989 +#define SFXsfx07C6 1990 +#define SFXsfx07C7 1991 +#define SFXsfx07C8 1992 +#define SFXsfx07C9 1993 +#define SFXtha_b_debris_00 1994 +#define SFXtha_b_debris_01 1995 +#define SFXsfx07CC 1996 +#define SFXsfx07CD 1997 +#define SFXsfx07CE 1998 +#define SFXsfx07CF 1999 +#define SFXsfx07D0 2000 +#define SFXsfx07D1 2001 +#define SFXsfx07D2 2002 +#define SFXsfx07D3 2003 +#define SFXsfx07D4 2004 +#define SFXsfx07D5 2005 +#define SFXsfx07D6 2006 +#define SFXsfx07D7 2007 +#define SFXsfx07D8 2008 +#define SFXsfx07D9 2009 +#define SFXsfx07DA 2010 +#define SFXsfx07DB 2011 +#define SFXsfx07DC 2012 +#define SFXsfx07DD 2013 +#define SFXsfx07DE 2014 +#define SFXsfx07DF 2015 +#define SFXsfx07E0 2016 +#define SFXsfx07E1 2017 +#define SFXsfx07E2 2018 +#define SFXsfx07E3 2019 +#define SFXsfx07E4 2020 +#define SFXsfx07E5 2021 +#define SFXsfx07E6 2022 +#define SFXsfx07E7 2023 +#define SFXsfx07E8 2024 +#define SFXsfx07E9 2025 +#define SFXsfx07EA 2026 +#define SFXsfx07EB 2027 +#define SFXsfx07EC 2028 +#define SFXsfx07ED 2029 +#define SFXsfx07EE 2030 +#define SFXsfx07EF 2031 +#define SFXsfx07F0 2032 +#define SFXsfx07F1 2033 +#define SFXsfx07F2 2034 +#define SFXsfx07F3 2035 +#define SFXsfx07F4 2036 +#define SFXsfx07F5 2037 +#define SFXsfx07F6 2038 +#define SFXsfx07F7 2039 +#define SFXsfx07F8 2040 +#define SFXsfx07F9 2041 diff --git a/Runtime/Audio/SFX/InjuredPirates.h b/Runtime/Audio/SFX/InjuredPirates.h new file mode 100644 index 000000000..3ffa19559 --- /dev/null +++ b/Runtime/Audio/SFX/InjuredPirates.h @@ -0,0 +1,39 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: InjuredPirates + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPInjuredPirates 17 + +#define SFXsfx01DE 478 +#define SFXsfx01DF 479 +#define SFXspr_b_exhale_00 480 +#define SFXsfx01E1 481 +#define SFXspr_b_moan_00 482 +#define SFXsfx01E3 483 +#define SFXsfx01E4 484 +#define SFXsfx01E5 485 +#define SFXsfx01E6 486 +#define SFXsfx01E7 487 +#define SFXsfx01E8 488 +#define SFXsfx01E9 489 +#define SFXsfx01EA 490 +#define SFXsfx01EB 491 +#define SFXsfx01EC 492 +#define SFXsfx01ED 493 +#define SFXsfx01EE 494 +#define SFXsfx01EF 495 +#define SFXsfx01F0 496 +#define SFXsfx01F1 497 +#define SFXsfx01F2 498 +#define SFXsfx01F3 499 +#define SFXsfx01F4 500 +#define SFXsfx01F5 501 +#define SFXsfx01F6 502 +#define SFXsfx01F7 503 +#define SFXsfx01F8 504 +#define SFXsfx01F9 505 +#define SFXsfx01FA 506 +#define SFXsfx01FB 507 diff --git a/Runtime/Audio/SFX/IntroBoss.h b/Runtime/Audio/SFX/IntroBoss.h new file mode 100644 index 000000000..2f52833bd --- /dev/null +++ b/Runtime/Audio/SFX/IntroBoss.h @@ -0,0 +1,51 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: IntroBoss + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPIntroBoss 0 + +#define SFXsfx0000 0 +#define SFXsfx0001 1 +#define SFXsfx0002 2 +#define SFXpaq_a_spit_lp_00 3 +#define SFXpaq_b_squawk_00 4 +#define SFXpaq_b_creak_00 5 +#define SFXpaq_b_creak_01 6 +#define SFXpaq_b_growl_00 7 +#define SFXpaq_b_growl_01 8 +#define SFXpaq_b_land_00 9 +#define SFXpaq_b_roar_00 10 +#define SFXpaq_b_roar_01 11 +#define SFXsfx000C 12 +#define SFXpaq_b_walk_00 13 +#define SFXpaq_b_walk_01 14 +#define SFXpaq_r_impact_00 15 +#define SFXpaq_r_impact_01 16 +#define SFXpaq_r_ldeath_00 17 +#define SFXpaq_r_sdeath_01 18 +#define SFXpaq_b_swish_00 19 +#define SFXsfx0014 20 +#define SFXsfx0015 21 +#define SFXsfx0016 22 +#define SFXpaq_b_land_01 23 +#define SFXpaq_b_run_00 24 +#define SFXpaq_b_run_01 25 +#define SFXsfx001A 26 +#define SFXsfx001B 27 +#define SFXsfx001C 28 +#define SFXsfx001D 29 +#define SFXsfx001E 30 +#define SFXsfx001F 31 +#define SFXsfx0020 32 +#define SFXsfx0021 33 +#define SFXsfx0022 34 +#define SFXsfx0023 35 +#define SFXsfx0024 36 +#define SFXsfx0025 37 +#define SFXsfx0026 38 +#define SFXsfx0027 39 +#define SFXsfx0028 40 +#define SFXsfx0029 41 diff --git a/Runtime/Audio/SFX/IntroWorld.h b/Runtime/Audio/SFX/IntroWorld.h new file mode 100644 index 000000000..02121538d --- /dev/null +++ b/Runtime/Audio/SFX/IntroWorld.h @@ -0,0 +1,148 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: IntroWorld + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPIntroWorld 46 + +#define SFXsfx07FA 2042 +#define SFXsfx07FB 2043 +#define SFXsfx07FC 2044 +#define SFXsfx07FD 2045 +#define SFXsfx07FE 2046 +#define SFXint_c_suitsprk_lp_01 2047 +#define SFXsfx0800 2048 +#define SFXsfx0801 2049 +#define SFXsfx0802 2050 +#define SFXsfx0803 2051 +#define SFXsfx0804 2052 +#define SFXsfx0805 2053 +#define SFXsfx0806 2054 +#define SFXsfx0807 2055 +#define SFXsfx0808 2056 +#define SFXsfx0809 2057 +#define SFXsfx080A 2058 +#define SFXsfx080B 2059 +#define SFXsfx080C 2060 +#define SFXsfx080D 2061 +#define SFXsfx080E 2062 +#define SFXsfx080F 2063 +#define SFXsfx0810 2064 +#define SFXsfx0811 2065 +#define SFXsfx0812 2066 +#define SFXsfx0813 2067 +#define SFXsfx0814 2068 +#define SFXsfx0815 2069 +#define SFXsfx0816 2070 +#define SFXsfx0817 2071 +#define SFXsfx0818 2072 +#define SFXsfx0819 2073 +#define SFXsfx081A 2074 +#define SFXsfx081B 2075 +#define SFXsfx081C 2076 +#define SFXsfx081D 2077 +#define SFXsfx081E 2078 +#define SFXsfx081F 2079 +#define SFXsfx0820 2080 +#define SFXsfx0821 2081 +#define SFXsfx0822 2082 +#define SFXsfx0823 2083 +#define SFXsfx0824 2084 +#define SFXsfx0825 2085 +#define SFXsfx0826 2086 +#define SFXsfx0827 2087 +#define SFXsfx0828 2088 +#define SFXsfx0829 2089 +#define SFXsfx082A 2090 +#define SFXsfx082B 2091 +#define SFXsfx082C 2092 +#define SFXsfx082D 2093 +#define SFXsfx082E 2094 +#define SFXsfx082F 2095 +#define SFXsfx0830 2096 +#define SFXsfx0831 2097 +#define SFXsfx0832 2098 +#define SFXsfx0833 2099 +#define SFXsfx0834 2100 +#define SFXsfx0835 2101 +#define SFXsfx0836 2102 +#define SFXsfx0837 2103 +#define SFXsfx0838 2104 +#define SFXsfx0839 2105 +#define SFXsfx083A 2106 +#define SFXsfx083B 2107 +#define SFXsfx083C 2108 +#define SFXint_x_frtdoor_00 2109 +#define SFXint_x_frtdoor_01 2110 +#define SFXsfx083F 2111 +#define SFXsfx0840 2112 +#define SFXsfx0841 2113 +#define SFXsfx0842 2114 +#define SFXsfx0843 2115 +#define SFXsfx0844 2116 +#define SFXsfx0845 2117 +#define SFXsfx0846 2118 +#define SFXsfx0847 2119 +#define SFXsfx0848 2120 +#define SFXsfx0849 2121 +#define SFXsfx084A 2122 +#define SFXsfx084B 2123 +#define SFXsfx084C 2124 +#define SFXsfx084D 2125 +#define SFXint_c_suitbrst_01 2126 +#define SFXsfx084F 2127 +#define SFXsfx0850 2128 +#define SFXsfx0851 2129 +#define SFXint_c_shipthst_00 2130 +#define SFXsfx0853 2131 +#define SFXsfx0854 2132 +#define SFXsfx0855 2133 +#define SFXsfx0856 2134 +#define SFXsfx0857 2135 +#define SFXsfx0858 2136 +#define SFXsfx0859 2137 +#define SFXsfx085A 2138 +#define SFXsfx085B 2139 +#define SFXsfx085C 2140 +#define SFXsfx085D 2141 +#define SFXsfx085E 2142 +#define SFXsfx085F 2143 +#define SFXsfx0860 2144 +#define SFXsfx0861 2145 +#define SFXsfx0862 2146 +#define SFXsfx0863 2147 +#define SFXsfx0864 2148 +#define SFXsfx0865 2149 +#define SFXsfx0866 2150 +#define SFXsfx0867 2151 +#define SFXsfx0868 2152 +#define SFXsfx0869 2153 +#define SFXsfx086A 2154 +#define SFXsfx086B 2155 +#define SFXsfx086C 2156 +#define SFXsfx086D 2157 +#define SFXsfx086E 2158 +#define SFXsfx086F 2159 +#define SFXsfx0870 2160 +#define SFXint_x_clampstp_00 2161 +#define SFXint_x_clamp_00 2162 +#define SFXint_x_clamp_01 2163 +#define SFXsfx0874 2164 +#define SFXsfx0875 2165 +#define SFXsfx0876 2166 +#define SFXsfx0877 2167 +#define SFXsfx0878 2168 +#define SFXsfx0879 2169 +#define SFXsfx087A 2170 +#define SFXsfx087B 2171 +#define SFXsfx087C 2172 +#define SFXsfx087D 2173 +#define SFXsfx087E 2174 +#define SFXsfx087F 2175 +#define SFXsfx0880 2176 +#define SFXsfx0881 2177 +#define SFXsfx0882 2178 +#define SFXsfx0883 2179 +#define SFXsfx0884 2180 diff --git a/Runtime/Audio/SFX/JellyZap.h b/Runtime/Audio/SFX/JellyZap.h new file mode 100644 index 000000000..7d89c7bec --- /dev/null +++ b/Runtime/Audio/SFX/JellyZap.h @@ -0,0 +1,19 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: JellyZap + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPJellyZap 18 + +#define SFXjzp_a_shock_00 508 +#define SFXjzp_a_suck_lp_00 509 +#define SFXjzp_b_bubbles_00 510 +#define SFXjzp_b_growl_00 511 +#define SFXsfx0200 512 +#define SFXsfx0201 513 +#define SFXsfx0202 514 +#define SFXsfx0203 515 +#define SFXsfx0204 516 +#define SFXsfx0205 517 diff --git a/Runtime/Audio/SFX/LavaWorld.h b/Runtime/Audio/SFX/LavaWorld.h new file mode 100644 index 000000000..c8acf9d9d --- /dev/null +++ b/Runtime/Audio/SFX/LavaWorld.h @@ -0,0 +1,112 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: LavaWorld + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPLavaWorld 47 + +#define SFXsfx0885 2181 +#define SFXsfx0886 2182 +#define SFXlav_wlklava_00 2183 +#define SFXlav_wlklava_01 2184 +#define SFXsfx0889 2185 +#define SFXlav_ballroll_lava 2186 +#define SFXsfx088B 2187 +#define SFXsfx088C 2188 +#define SFXsfx088D 2189 +#define SFXlav_landlava_00 2190 +#define SFXsfx088F 2191 +#define SFXsfx0890 2192 +#define SFXsfx0891 2193 +#define SFXsfx0892 2194 +#define SFXsfx0893 2195 +#define SFXsfx0894 2196 +#define SFXsfx0895 2197 +#define SFXsfx0896 2198 +#define SFXsfx0897 2199 +#define SFXsfx0898 2200 +#define SFXsfx0899 2201 +#define SFXsfx089A 2202 +#define SFXsfx089B 2203 +#define SFXsfx089C 2204 +#define SFXsfx089D 2205 +#define SFXsfx089E 2206 +#define SFXsfx089F 2207 +#define SFXsfx08A0 2208 +#define SFXsfx08A1 2209 +#define SFXsfx08A2 2210 +#define SFXsfx08A3 2211 +#define SFXsfx08A4 2212 +#define SFXsfx08A5 2213 +#define SFXsfx08A6 2214 +#define SFXsfx08A7 2215 +#define SFXlav_x_piston_lp_00 2216 +#define SFXsfx08A9 2217 +#define SFXlav_x_piststop_00 2218 +#define SFXlav_x_piststop_01 2219 +#define SFXsfx08AC 2220 +#define SFXsfx08AD 2221 +#define SFXswp_x_03bridgestop_00 2222 +#define SFXsfx08AF 2223 +#define SFXsfx08B0 2224 +#define SFXsfx08B1 2225 +#define SFXsfx08B2 2226 +#define SFXsfx08B3 2227 +#define SFXsfx08B4 2228 +#define SFXsfx08B5 2229 +#define SFXsfx08B6 2230 +#define SFXsfx08B7 2231 +#define SFXsfx08B8 2232 +#define SFXsfx08B9 2233 +#define SFXsfx08BA 2234 +#define SFXsfx08BB 2235 +#define SFXsfx08BC 2236 +#define SFXsfx08BD 2237 +#define SFXsfx08BE 2238 +#define SFXmag_b_rise_00 2239 +#define SFXsfx08C0 2240 +#define SFXsfx08C1 2241 +#define SFXsfx08C2 2242 +#define SFXsfx08C3 2243 +#define SFXsfx08C4 2244 +#define SFXsfx08C5 2245 +#define SFXsfx08C6 2246 +#define SFXsfx08C7 2247 +#define SFXsfx08C8 2248 +#define SFXsfx08C9 2249 +#define SFXsfx08CA 2250 +#define SFXsfx08CB 2251 +#define SFXsfx08CC 2252 +#define SFXlav_x_gateup_lp_00 2253 +#define SFXsfx08CE 2254 +#define SFXlav_x_refrig_00 2255 +#define SFXlav_x_gatestop_00 2256 +#define SFXsfx08D1 2257 +#define SFXsfx08D2 2258 +#define SFXsfx08D3 2259 +#define SFXsfx08D4 2260 +#define SFXsfx08D5 2261 +#define SFXsfx08D6 2262 +#define SFXlav_landlava_02 2263 +#define SFXsfx08D8 2264 +#define SFXsfx08D9 2265 +#define SFXsfx08DA 2266 +#define SFXsfx08DB 2267 +#define SFXsfx08DC 2268 +#define SFXsfx08DD 2269 +#define SFXsfx08DE 2270 +#define SFXsfx08DF 2271 +#define SFXsfx08E0 2272 +#define SFXsfx08E1 2273 +#define SFXsfx08E2 2274 +#define SFXsfx08E3 2275 +#define SFXsfx08E4 2276 +#define SFXsfx08E5 2277 +#define SFXsfx08E6 2278 +#define SFXsfx08E7 2279 +#define SFXsfx08E8 2280 +#define SFXsfx08E9 2281 +#define SFXsfx08EA 2282 +#define SFXsfx08EB 2283 diff --git a/Runtime/Audio/SFX/Magdolite.h b/Runtime/Audio/SFX/Magdolite.h new file mode 100644 index 000000000..e038dac11 --- /dev/null +++ b/Runtime/Audio/SFX/Magdolite.h @@ -0,0 +1,39 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Magdolite + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMagdolite 19 + +#define SFXmag_b_alert_00 518 +#define SFXmag_b_idle_00 519 +#define SFXsfx0208 520 +#define SFXmag_r_pain_00 521 +#define SFXmag_a_bite_00 522 +#define SFXmag_r_death_00 523 +#define SFXmag_a_breath_00 524 +#define SFXmag_a_flame_lp_00 525 +#define SFXmag_r_yelp_00 526 +#define SFXsfx020F 527 +#define SFXsfx0210 528 +#define SFXsfx0211 529 +#define SFXsfx0212 530 +#define SFXsfx0213 531 +#define SFXsfx0214 532 +#define SFXsfx0215 533 +#define SFXsfx0216 534 +#define SFXsfx0217 535 +#define SFXsfx0218 536 +#define SFXsfx0219 537 +#define SFXsfx021A 538 +#define SFXsfx021B 539 +#define SFXsfx021C 540 +#define SFXsfx021D 541 +#define SFXsfx021E 542 +#define SFXsfx021F 543 +#define SFXsfx0220 544 +#define SFXsfx0221 545 +#define SFXsfx0222 546 +#define SFXsfx0223 547 diff --git a/Runtime/Audio/SFX/Metaree.h b/Runtime/Audio/SFX/Metaree.h new file mode 100644 index 000000000..96d6964a9 --- /dev/null +++ b/Runtime/Audio/SFX/Metaree.h @@ -0,0 +1,20 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Metaree + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMetaree 20 + +#define SFXmtr_a_scream_00 548 +#define SFXsfx0225 549 +#define SFXmtr_b_spin_lp_06 550 +#define SFXmtr_b_spin_lp_07 551 +#define SFXsfx0228 552 +#define SFXsfx0229 553 +#define SFXsfx022A 554 +#define SFXsfx022B 555 +#define SFXsfx022C 556 +#define SFXsfx022D 557 +#define SFXsfx022E 558 diff --git a/Runtime/Audio/SFX/Metroid.h b/Runtime/Audio/SFX/Metroid.h new file mode 100644 index 000000000..0810b54f3 --- /dev/null +++ b/Runtime/Audio/SFX/Metroid.h @@ -0,0 +1,74 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Metroid + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMetroid 21 + +#define SFXsfx022F 559 +#define SFXsfx0230 560 +#define SFXmtd_a_facehug_02 561 +#define SFXmtd_a_swoosh_00 562 +#define SFXmtd_a_swoosh_01 563 +#define SFXmtd_a_thunk_00 564 +#define SFXmtd_b_fadein_00 565 +#define SFXmtd_b_fadeout_00 566 +#define SFXmtd_b_float_lp_00 567 +#define SFXmtd_b_float_lp_01 568 +#define SFXmtd_b_idle_00 569 +#define SFXmtd_b_idle_01 570 +#define SFXsfx023B 571 +#define SFXsfx023C 572 +#define SFXsfx023D 573 +#define SFXsfx023E 574 +#define SFXsfx023F 575 +#define SFXmtd_b_squish_00 576 +#define SFXmtd_b_squish_01 577 +#define SFXsfx0242 578 +#define SFXmtd_b_voxangry_00 579 +#define SFXsfx0244 580 +#define SFXsfx0245 581 +#define SFXmtd_r_impact_00 582 +#define SFXsfx0247 583 +#define SFXsfx0248 584 +#define SFXmt2_a_facehug_02 585 +#define SFXsfx024A 586 +#define SFXsfx024B 587 +#define SFXsfx024C 588 +#define SFXsfx024D 589 +#define SFXmt2_b_float_lp_00 590 +#define SFXmt2_b_float_lp_01 591 +#define SFXsfx0250 592 +#define SFXsfx0251 593 +#define SFXsfx0252 594 +#define SFXmt2_b_idle_02 595 +#define SFXsfx0254 596 +#define SFXsfx0255 597 +#define SFXmt2_b_leech_lp_00 598 +#define SFXsfx0257 599 +#define SFXsfx0258 600 +#define SFXmt2_b_voxangry_00 601 +#define SFXmt2_b_voxangry_01 602 +#define SFXsfx025B 603 +#define SFXmt2_r_impact_00 604 +#define SFXmtd_b_grow_00 605 +#define SFXmtd_b_suck_lp_00 606 +#define SFXmtd_r_death_00 607 +#define SFXmt2_b_float_lp_02 608 +#define SFXsfx0261 609 +#define SFXmtd_b_voxcalm_00 610 +#define SFXsfx0263 611 +#define SFXsfx0264 612 +#define SFXsfx0265 613 +#define SFXsfx0266 614 +#define SFXsfx0267 615 +#define SFXsfx0268 616 +#define SFXsfx0269 617 +#define SFXsfx026A 618 +#define SFXsfx026B 619 +#define SFXsfx026C 620 +#define SFXsfx026D 621 +#define SFXsfx026E 622 +#define SFXsfx026F 623 diff --git a/Runtime/Audio/SFX/MetroidPrime.h b/Runtime/Audio/SFX/MetroidPrime.h new file mode 100644 index 000000000..8542b06d3 --- /dev/null +++ b/Runtime/Audio/SFX/MetroidPrime.h @@ -0,0 +1,90 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: MetroidPrime + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMetroidPrime 58 + +#define SFXmtb_b_voxtaunt_00 2891 +#define SFXsfx0B4C 2892 +#define SFXmtb_a_claw_00 2893 +#define SFXmtb_a_swoosh 2894 +#define SFXmtb_b_voxattak_00 2895 +#define SFXmtb_b_walk_00 2896 +#define SFXmtb_b_walk_01 2897 +#define SFXmtb_b_walk_02 2898 +#define SFXmtb_b_voxidle_00 2899 +#define SFXsfx0B54 2900 +#define SFXmtb_r_painbig_00 2901 +#define SFXmtb_r_painsm_00 2902 +#define SFXmtb_b_voxattak_01 2903 +#define SFXmtb_a_icewave_lp_00 2904 +#define SFXsfx0B59 2905 +#define SFXsfx0B5A 2906 +#define SFXmtb_b_voxangry_00 2907 +#define SFXmtb_b_voxangry_01 2908 +#define SFXmtb_a_flame_lp_00 2909 +#define SFXmtb_a_mirv_00 2910 +#define SFXsfx0B5F 2911 +#define SFXsfx0B60 2912 +#define SFXmth_b_dash_00 2913 +#define SFXmth_c_painbig_00 2914 +#define SFXmth_b_voxcall_00 2915 +#define SFXmth_b_voxidle_00 2916 +#define SFXmth_b_voxidle_01 2917 +#define SFXmth_b_voxtaunt_00 2918 +#define SFXsfx0B67 2919 +#define SFXmtb_a_hitwall_00 2920 +#define SFXmth_c_painsm_00 2921 +#define SFXsfx0B6A 2922 +#define SFXsfx0B6B 2923 +#define SFXmtb_a_flameup_lp_00 2924 +#define SFXsfx0B6D 2925 +#define SFXsfx0B6E 2926 +#define SFXsfx0B6F 2927 +#define SFXsfx0B70 2928 +#define SFXsfx0B71 2929 +#define SFXmth_b_emerge_00 2930 +#define SFXsfx0B73 2931 +#define SFXmth_b_voxattak_01 2932 +#define SFXsfx0B75 2933 +#define SFXmth_b_float_lp_00 2934 +#define SFXsfx0B77 2935 +#define SFXmth_a_blast_lp_00 2936 +#define SFXsfx0B79 2937 +#define SFXsfx0B7A 2938 +#define SFXsfx0B7B 2939 +#define SFXmth_a_blasthit_00 2940 +#define SFXsfx0B7D 2941 +#define SFXsfx0B7E 2942 +#define SFXmtb_c_cinemove_00 2943 +#define SFXsfx0B80 2944 +#define SFXmtb_c_land_00 2945 +#define SFXmtb_c_wakeup_00 2946 +#define SFXsfx0B83 2947 +#define SFXsfx0B84 2948 +#define SFXsfx0B85 2949 +#define SFXsfx0B86 2950 +#define SFXsfx0B87 2951 +#define SFXmtb_a_tractor_lp_00 2952 +#define SFXmth_a_swing_00 2953 +#define SFXsfx0B8A 2954 +#define SFXsfx0B8B 2955 +#define SFXsfx0B8C 2956 +#define SFXsfx0B8D 2957 +#define SFXsfx0B8E 2958 +#define SFXmtb_b_land_00 2959 +#define SFXmth_c_blur_00 2960 +#define SFXsfx0B91 2961 +#define SFXsfx0B92 2962 +#define SFXsfx0B93 2963 +#define SFXsfx0B94 2964 +#define SFXsfx0B95 2965 +#define SFXsfx0B96 2966 +#define SFXmtb_a_nrgchg_00 2967 +#define SFXsfx0B98 2968 +#define SFXmtb_a_nrgfire_lp_00 2969 +#define SFXsfx0B9A 2970 +#define SFXsfx0B9B 2971 diff --git a/Runtime/Audio/SFX/MinesWorld.h b/Runtime/Audio/SFX/MinesWorld.h new file mode 100644 index 000000000..d10721cc0 --- /dev/null +++ b/Runtime/Audio/SFX/MinesWorld.h @@ -0,0 +1,90 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: MinesWorld + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMinesWorld 48 + +#define SFXsfx08EC 2284 +#define SFXsfx08ED 2285 +#define SFXsfx08EE 2286 +#define SFXsfx08EF 2287 +#define SFXsfx08F0 2288 +#define SFXsfx08F1 2289 +#define SFXmin_x_cranestop_00 2290 +#define SFXsfx08F3 2291 +#define SFXmin_x_piston_00 2292 +#define SFXsfx08F5 2293 +#define SFXsfx08F6 2294 +#define SFXsfx08F7 2295 +#define SFXsfx08F8 2296 +#define SFXmin_x_crane_lp_00 2297 +#define SFXsfx08FA 2298 +#define SFXsfx08FB 2299 +#define SFXsfx08FC 2300 +#define SFXsfx08FD 2301 +#define SFXsfx08FE 2302 +#define SFXsfx08FF 2303 +#define SFXsfx0900 2304 +#define SFXsfx0901 2305 +#define SFXsfx0902 2306 +#define SFXopr_c_land_00 2307 +#define SFXsfx0904 2308 +#define SFXsfx0905 2309 +#define SFXsfx0906 2310 +#define SFXsfx0907 2311 +#define SFXsfx0908 2312 +#define SFXmin_x_gears_lp_01 2313 +#define SFXsfx090A 2314 +#define SFXsfx090B 2315 +#define SFXsfx090C 2316 +#define SFXsfx090D 2317 +#define SFXsfx090E 2318 +#define SFXsfx090F 2319 +#define SFXsfx0910 2320 +#define SFXsfx0911 2321 +#define SFXsfx0912 2322 +#define SFXsfx0913 2323 +#define SFXsfx0914 2324 +#define SFXsfx0915 2325 +#define SFXsfx0916 2326 +#define SFXmin_x_turbine_lp_00 2327 +#define SFXsfx0918 2328 +#define SFXsfx0919 2329 +#define SFXsfx091A 2330 +#define SFXsfx091B 2331 +#define SFXsfx091C 2332 +#define SFXsfx091D 2333 +#define SFXsfx091E 2334 +#define SFXsfx091F 2335 +#define SFXsfx0920 2336 +#define SFXsfx0921 2337 +#define SFXsfx0922 2338 +#define SFXsfx0923 2339 +#define SFXsfx0924 2340 +#define SFXsfx0925 2341 +#define SFXsfx0926 2342 +#define SFXsfx0927 2343 +#define SFXsfx0928 2344 +#define SFXsfx0929 2345 +#define SFXsfx092A 2346 +#define SFXsfx092B 2347 +#define SFXsfx092C 2348 +#define SFXsfx092D 2349 +#define SFXsfx092E 2350 +#define SFXsfx092F 2351 +#define SFXsfx0930 2352 +#define SFXsfx0931 2353 +#define SFXsfx0932 2354 +#define SFXsfx0933 2355 +#define SFXsfx0934 2356 +#define SFXsfx0935 2357 +#define SFXsfx0936 2358 +#define SFXsfx0937 2359 +#define SFXsfx0938 2360 +#define SFXsfx0939 2361 +#define SFXsfx093A 2362 +#define SFXsfx093B 2363 +#define SFXsfx093C 2364 diff --git a/Runtime/Audio/SFX/Misc.h b/Runtime/Audio/SFX/Misc.h new file mode 100644 index 000000000..eb07c5fa8 --- /dev/null +++ b/Runtime/Audio/SFX/Misc.h @@ -0,0 +1,256 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Misc + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMisc 39 + +#define SFXdor_x_close_00 1128 +#define SFXdor_x_open_00 1129 +#define SFXsfx046A 1130 +#define SFXpik_x_idle_00 1131 +#define SFXsfx046C 1132 +#define SFXamb_x_rumble_lp_00 1133 +#define SFXsfx046E 1134 +#define SFXpik_x_morphamb_lp_00 1135 +#define SFXpik_x_powerup_00 1136 +#define SFXsfx0471 1137 +#define SFXsfx0472 1138 +#define SFXsfx0473 1139 +#define SFXsfx0474 1140 +#define SFXamb_x_splash_02 1141 +#define SFXsfx0476 1142 +#define SFXsfx0477 1143 +#define SFXsfx0478 1144 +#define SFXsfx0479 1145 +#define SFXsfx047A 1146 +#define SFXpik_x_elevamb_lp_00 1147 +#define SFXsfx047C 1148 +#define SFXeff_x_largeburndeath_lp_00 1149 +#define SFXeff_x_smallburndeath_lp_00 1150 +#define SFXeff_x_fire_lp_00 1151 +#define SFXsfx0480 1152 +#define SFXsfx0481 1153 +#define SFXci2_x_eletric_00 1154 +#define SFXci3_x_electric_lp_00 1155 +#define SFXmac_x_fire_lp_00 1156 +#define SFXsfx0485 1157 +#define SFXci4_x_electric_lp_00 1158 +#define SFXsfx0487 1159 +#define SFXsfx0488 1160 +#define SFXsfx0489 1161 +#define SFXsfx048A 1162 +#define SFXsfx048B 1163 +#define SFXdrn_b_smoke_lp_00 1164 +#define SFXga2_r_explode_00 1165 +#define SFXsfx048E 1166 +#define SFXsfx048F 1167 +#define SFXsfx0490 1168 +#define SFXsfx0491 1169 +#define SFXmag_r_explode_00 1170 +#define SFXsfx0493 1171 +#define SFXsfx0494 1172 +#define SFXsfx0495 1173 +#define SFXsfx0496 1174 +#define SFXsfx0497 1175 +#define SFXeff_x_icebrk_00 1176 +#define SFXeff_x_icebrk_01 1177 +#define SFXsfx049A 1178 +#define SFXsfx049B 1179 +#define SFXsfx049C 1180 +#define SFXsfx049D 1181 +#define SFXsfx049E 1182 +#define SFXsfx049F 1183 +#define SFXsfx04A0 1184 +#define SFXsfx04A1 1185 +#define SFXmac_x_fireup_00 1186 +#define SFXsfx04A3 1187 +#define SFXsfx04A4 1188 +#define SFXsfx04A5 1189 +#define SFXsfx04A6 1190 +#define SFXsfx04A7 1191 +#define SFXsfx04A8 1192 +#define SFXsfx04A9 1193 +#define SFXsfx04AA 1194 +#define SFXsfx04AB 1195 +#define SFXsfx04AC 1196 +#define SFXeff_x_electro_lp_00 1197 +#define SFXeff_x_electro_lp_01 1198 +#define SFXsfx04AF 1199 +#define SFXsfx04B0 1200 +#define SFXsfx04B1 1201 +#define SFXsfx04B2 1202 +#define SFXsfx04B3 1203 +#define SFXsfx04B4 1204 +#define SFXsfx04B5 1205 +#define SFXsfx04B6 1206 +#define SFXsfx04B7 1207 +#define SFXsfx04B8 1208 +#define SFXsfx04B9 1209 +#define SFXsfx04BA 1210 +#define SFXsfx04BB 1211 +#define SFXsfx04BC 1212 +#define SFXsfx04BD 1213 +#define SFXsfx04BE 1214 +#define SFXsfx04BF 1215 +#define SFXsfx04C0 1216 +#define SFXsfx04C1 1217 +#define SFXsfx04C2 1218 +#define SFXocu_b_gas_lp_00 1219 +#define SFXsfx04C4 1220 +#define SFXsfx04C5 1221 +#define SFXsfx04C6 1222 +#define SFXtha_a_electric_00 1223 +#define SFXsfx04C8 1224 +#define SFXdrn_r_empelec_00 1225 +#define SFXeff_x_frozen_00 1226 +#define SFXeff_x_frozen_01 1227 +#define SFXsfx04CC 1228 +#define SFXsfx04CD 1229 +#define SFXsfx04CE 1230 +#define SFXsfx04CF 1231 +#define SFXsfx04D0 1232 +#define SFXsfx04D1 1233 +#define SFXepr_b_elec_lp_00 1234 +#define SFXsfx04D3 1235 +#define SFXsfx04D4 1236 +#define SFXsfx04D5 1237 +#define SFXsfx04D6 1238 +#define SFXsfx04D7 1239 +#define SFXamb_x_gatestop_00 1240 +#define SFXsfx04D9 1241 +#define SFXsfx04DA 1242 +#define SFXsfx04DB 1243 +#define SFXsfx04DC 1244 +#define SFXsfx04DD 1245 +#define SFXsfx04DE 1246 +#define SFXsfx04DF 1247 +#define SFXsfx04E0 1248 +#define SFXsfx04E1 1249 +#define SFXsfx04E2 1250 +#define SFXsfx04E3 1251 +#define SFXsfx04E4 1252 +#define SFXsfx04E5 1253 +#define SFXsfx04E6 1254 +#define SFXsfx04E7 1255 +#define SFXsfx04E8 1256 +#define SFXsfx04E9 1257 +#define SFXsfx04EA 1258 +#define SFXsfx04EB 1259 +#define SFXsfx04EC 1260 +#define SFXsfx04ED 1261 +#define SFXsfx04EE 1262 +#define SFXsfx04EF 1263 +#define SFXsfx04F0 1264 +#define SFXsfx04F1 1265 +#define SFXsfx04F2 1266 +#define SFXsfx04F3 1267 +#define SFXsfx04F4 1268 +#define SFXamb_x_gateup_00 1269 +#define SFXsfx04F6 1270 +#define SFXsfx04F7 1271 +#define SFXsfx04F8 1272 +#define SFXsfx04F9 1273 +#define SFXsfx04FA 1274 +#define SFXrid_r_explode_00 1275 +#define SFXsfx04FC 1276 +#define SFXsfx04FD 1277 +#define SFXsfx04FE 1278 +#define SFXsfx04FF 1279 +#define SFXsfx0500 1280 +#define SFXsfx0501 1281 +#define SFXsfx0502 1282 +#define SFXsfx0503 1283 +#define SFXsfx0504 1284 +#define SFXsfx0505 1285 +#define SFXamb_x_steamsml_lp_00 1286 +#define SFXsfx0507 1287 +#define SFXsfx0508 1288 +#define SFXsfx0509 1289 +#define SFXamb_c_suitlose_lp_00 1290 +#define SFXsfx050B 1291 +#define SFXsfx050C 1292 +#define SFXsfx050D 1293 +#define SFXsfx050E 1294 +#define SFXsfx050F 1295 +#define SFXsfx0510 1296 +#define SFXsfx0511 1297 +#define SFXsfx0512 1298 +#define SFXsfx0513 1299 +#define SFXsfx0514 1300 +#define SFXsfx0515 1301 +#define SFXsfx0516 1302 +#define SFXsfx0517 1303 +#define SFXsfx0518 1304 +#define SFXsfx0519 1305 +#define SFXsfx051A 1306 +#define SFXsfx051B 1307 +#define SFXsfx051C 1308 +#define SFXsfx051D 1309 +#define SFXsfx051E 1310 +#define SFXsfx051F 1311 +#define SFXsfx0520 1312 +#define SFXsfx0521 1313 +#define SFXsfx0522 1314 +#define SFXsfx0523 1315 +#define SFXsfx0524 1316 +#define SFXsfx0525 1317 +#define SFXsfx0526 1318 +#define SFXsfx0527 1319 +#define SFXsfx0528 1320 +#define SFXsfx0529 1321 +#define SFXsfx052A 1322 +#define SFXsfx052B 1323 +#define SFXrid_c_elec_lp_00 1324 +#define SFXsfx052D 1325 +#define SFXsfx052E 1326 +#define SFXsfx052F 1327 +#define SFXsfx0530 1328 +#define SFXsfx0531 1329 +#define SFXsfx0532 1330 +#define SFXsfx0533 1331 +#define SFXsfx0534 1332 +#define SFXsfx0535 1333 +#define SFXsfx0536 1334 +#define SFXsfx0537 1335 +#define SFXsfx0538 1336 +#define SFXsfx0539 1337 +#define SFXsfx053A 1338 +#define SFXsfx053B 1339 +#define SFXsfx053C 1340 +#define SFXsfx053D 1341 +#define SFXsfx053E 1342 +#define SFXsfx053F 1343 +#define SFXsfx0540 1344 +#define SFXsfx0541 1345 +#define SFXsfx0542 1346 +#define SFXsfx0543 1347 +#define SFXsfx0544 1348 +#define SFXsfx0545 1349 +#define SFXsfx0546 1350 +#define SFXsfx0547 1351 +#define SFXsfx0548 1352 +#define SFXsfx0549 1353 +#define SFXsfx054A 1354 +#define SFXsfx054B 1355 +#define SFXsfx054C 1356 +#define SFXsfx054D 1357 +#define SFXsfx054E 1358 +#define SFXsfx054F 1359 +#define SFXsfx0550 1360 +#define SFXsfx0551 1361 +#define SFXsfx0552 1362 +#define SFXsfx0553 1363 +#define SFXsfx0554 1364 +#define SFXsfx0555 1365 +#define SFXsfx0556 1366 +#define SFXsfx0557 1367 +#define SFXsfx0558 1368 +#define SFXsfx0559 1369 +#define SFXsfx055A 1370 +#define SFXsfx055B 1371 +#define SFXsfx055C 1372 +#define SFXsfx055D 1373 +#define SFXsfx055E 1374 diff --git a/Runtime/Audio/SFX/MiscSamus.h b/Runtime/Audio/SFX/MiscSamus.h new file mode 100644 index 000000000..c40e3871b --- /dev/null +++ b/Runtime/Audio/SFX/MiscSamus.h @@ -0,0 +1,268 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: MiscSamus + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPMiscSamus 41 + +#define SFXsam_wlkstone_00 1465 +#define SFXsam_wlkstone_01 1466 +#define SFXsam_suit_damage 1467 +#define SFXsam_ball_jump 1468 +#define SFXsam_b_highland_00 1469 +#define SFXsam_b_jump_00 1470 +#define SFXsam_firstjump 1471 +#define SFXsam_landdirt_00 1472 +#define SFXsfx05C1 1473 +#define SFXsfx05C2 1474 +#define SFXsam_ballland_stone 1475 +#define SFXsam_ball_boost 1476 +#define SFXsam_ball_charge_lp 1477 +#define SFXsam_b_morphin_00 1478 +#define SFXsam_b_morphout_00 1479 +#define SFXsam_ballroll_dirt 1480 +#define SFXsfx05C9 1481 +#define SFXsfx05CA 1482 +#define SFXsfx05CB 1483 +#define SFXsam_wlkwater_00 1484 +#define SFXsam_wlkwater_01 1485 +#define SFXsam_damage_poison_lp 1486 +#define SFXsfx05CF 1487 +#define SFXsfx05D0 1488 +#define SFXsam_vox_damage 1489 +#define SFXsam_landmetl_00 1490 +#define SFXsam_ball_damage 1491 +#define SFXsam_b_movearm_00 1492 +#define SFXsam_wlkgrate_00 1493 +#define SFXsam_wlkgrate_01 1494 +#define SFXsam_wlkmetal_00 1495 +#define SFXsam_wlkmetal_01 1496 +#define SFXsam_wlkdirt_00 1497 +#define SFXsam_ballland_grate 1498 +#define SFXsam_wlkdirt_01 1499 +#define SFXsam_ballroll_grate 1500 +#define SFXsam_ballroll_metal 1501 +#define SFXsam_ballroll_stone 1502 +#define SFXsfx05DF 1503 +#define SFXsam_ballland_metal 1504 +#define SFXsam_b_movearm_01 1505 +#define SFXsfx05E2 1506 +#define SFXsam_landgrate_00 1507 +#define SFXsam_landstone_00 1508 +#define SFXsfx05E5 1509 +#define SFXsfx05E6 1510 +#define SFXsam_vox_damage15 1511 +#define SFXsam_vox_damage30 1512 +#define SFXsam_ball_damage15 1513 +#define SFXsam_ball_damage30 1514 +#define SFXsfx05EB 1515 +#define SFXsam_death 1516 +#define SFXsfx05ED 1517 +#define SFXsfx05EE 1518 +#define SFXsam_b_landmetl_01 1519 +#define SFXsfx05F0 1520 +#define SFXsfx05F1 1521 +#define SFXsfx05F2 1522 +#define SFXsam_spider_lp 1523 +#define SFXsfx05F4 1524 +#define SFXsam_ball_wallhit 1525 +#define SFXsam_grapple_fire 1526 +#define SFXsam_grapple_lp 1527 +#define SFXsam_grapple_swoosh 1528 +#define SFXsam_wlkwood_00 1529 +#define SFXsam_wlkwood_01 1530 +#define SFXsam_landwood_00 1531 +#define SFXsam_b_movefla_00 1532 +#define SFXsam_ballland_wood 1533 +#define SFXsam_ballroll_wood 1534 +#define SFXsfx05FF 1535 +#define SFXsfx0600 1536 +#define SFXsfx0601 1537 +#define SFXsfx0602 1538 +#define SFXsfx0603 1539 +#define SFXsfx0604 1540 +#define SFXsam_b_jumpcine_00 1541 +#define SFXsam_landphazon_00 1542 +#define SFXsfx0607 1543 +#define SFXsfx0608 1544 +#define SFXsam_ballland_phazon 1545 +#define SFXsfx060A 1546 +#define SFXsam_ballroll_phazon 1547 +#define SFXsam_b_voxland_00 1548 +#define SFXsfx060D 1549 +#define SFXsam_voxland_02 1550 +#define SFXsfx060F 1551 +#define SFXsfx0610 1552 +#define SFXsam_wlkphazon_00 1553 +#define SFXsam_wlkphazon_01 1554 +#define SFXpds_b_water_03 1555 +#define SFXsam_b_butpress_00 1556 +#define SFXsam_b_butpress_01 1557 +#define SFXsam_b_panlclos_00 1558 +#define SFXsam_b_panlopen_00 1559 +#define SFXsam_dash 1560 +#define SFXsam_b_move_00 1561 +#define SFXsam_b_move_01 1562 +#define SFXsam_b_voxjump_00 1563 +#define SFXsfx061C 1564 +#define SFXsfx061D 1565 +#define SFXsfx061E 1566 +#define SFXsam_b_wlkmetal_02 1567 +#define SFXsam_b_wlkmetal_03 1568 +#define SFXsam_landgrass_00 1569 +#define SFXsam_b_wlkgrass_00 1570 +#define SFXsam_b_wlkgrass_01 1571 +#define SFXsam_b_spin_lp_00 1572 +#define SFXsam_b_landorg_00 1573 +#define SFXsfx0626 1574 +#define SFXsam_ballland_org 1575 +#define SFXsam_ballroll_org 1576 +#define SFXsam_b_wlkorg_00 1577 +#define SFXsam_b_wlkorg_01 1578 +#define SFXsam_landmud_00 1579 +#define SFXsam_ballland_grass 1580 +#define SFXsam_ballland_mud 1581 +#define SFXsfx062E 1582 +#define SFXsam_ballroll_grass 1583 +#define SFXsam_ballroll_mud 1584 +#define SFXsam_wlkmud_00 1585 +#define SFXsam_wlkmud_01 1586 +#define SFXsam_b_landcine_01 1587 +#define SFXsfx0634 1588 +#define SFXsfx0635 1589 +#define SFXsfx0636 1590 +#define SFXsam_vox_exhausted 1591 +#define SFXsam_landsnow_00 1592 +#define SFXsam_b_landsnow_01 1593 +#define SFXsam_wlksnow_00 1594 +#define SFXsam_wlksnow_01 1595 +#define SFXsam_b_wlksnow_02 1596 +#define SFXsam_b_wlksnow_03 1597 +#define SFXsfx063E 1598 +#define SFXsfx063F 1599 +#define SFXsam_b_landcine_00 1600 +#define SFXgab_b_wlksnow_00 1601 +#define SFXgab_b_wlksnow_01 1602 +#define SFXsfx0643 1603 +#define SFXsam_r_hithelm_00 1604 +#define SFXsfx0645 1605 +#define SFXsfx0646 1606 +#define SFXsam_landgrass_02 1607 +#define SFXsam_landgrate_02 1608 +#define SFXsfx0649 1609 +#define SFXsfx064A 1610 +#define SFXsam_b_landmetl_02 1611 +#define SFXsam_landmud_02 1612 +#define SFXsam_landorg_02 1613 +#define SFXsam_landphazon_02 1614 +#define SFXsam_landdirt_02 1615 +#define SFXsam_landsnow_02 1616 +#define SFXsam_landstone_02 1617 +#define SFXsam_landwood_02 1618 +#define SFXsam_wlkice_00 1619 +#define SFXsam_wlkice_01 1620 +#define SFXsfx0655 1621 +#define SFXsfx0656 1622 +#define SFXsam_b_landgras_01 1623 +#define SFXsam_landice_00 1624 +#define SFXsfx0659 1625 +#define SFXsam_landice_02 1626 +#define SFXsam_ballland_ice 1627 +#define SFXsam_ballland_snow 1628 +#define SFXpar_b_wlksnow_00 1629 +#define SFXpar_b_wlksnow_01 1630 +#define SFXsfx065F 1631 +#define SFXsfx0660 1632 +#define SFXsam_vox_damage_poison 1633 +#define SFXsfx0662 1634 +#define SFXsfx0663 1635 +#define SFXsam_c_suithit_00 1636 +#define SFXsam_c_suithit_01 1637 +#define SFXsam_c_suithitv_00 1638 +#define SFXsam_c_suitmov1_00 1639 +#define SFXsam_r_phazhit_lp_00 1640 +#define SFXsam_c_suitfall_00 1641 +#define SFXsam_c_suitfall_01 1642 +#define SFXsam_c_suitmov2_00 1643 +#define SFXsam_c_suitmov2_01 1644 +#define SFXsfx066D 1645 +#define SFXsfx066E 1646 +#define SFXfpr_b_land_00 1647 +#define SFXfpr_b_land_01 1648 +#define SFXsfx0671 1649 +#define SFXspr_b_land_00 1650 +#define SFXspr_b_land_01 1651 +#define SFXsfx0674 1652 +#define SFXsam_vox_damage_phazon 1653 +#define SFXsfx0676 1654 +#define SFXsfx0677 1655 +#define SFXsam_vox_damage_heat 1656 +#define SFXsfx0679 1657 +#define SFXsfx067A 1658 +#define SFXsfx067B 1659 +#define SFXsam_b_wlkstone_02 1660 +#define SFXsam_b_wlkstone_03 1661 +#define SFXsam_b_wlkdirt_02 1662 +#define SFXsam_b_wlkdirt_03 1663 +#define SFXsam_b_move_02 1664 +#define SFXsam_b_move_03 1665 +#define SFXsfx0682 1666 +#define SFXsam_c_mpwlkorg_00 1667 +#define SFXsam_c_mpwlkorg_01 1668 +#define SFXci7_x_spin_lp_00 1669 +#define SFXsfx0686 1670 +#define SFXsam_c_butpress_00 1671 +#define SFXsam_c_butpress_01 1672 +#define SFXsam_c_intrmove_02 1673 +#define SFXsam_c_intrmove_03 1674 +#define SFXsam_c_intrspin_lp_00 1675 +#define SFXsam_c_iwlkmetal_02 1676 +#define SFXsam_c_iwlkmetal_03 1677 +#define SFXsam_c_movearm_00 1678 +#define SFXsam_c_movearm_01 1679 +#define SFXsam_c_moveend_00 1680 +#define SFXsam_c_moveend_01 1681 +#define SFXsam_c_spinend_lp_00 1682 +#define SFXsfx0693 1683 +#define SFXsam_landlavastone_00 1684 +#define SFXsfx0695 1685 +#define SFXsam_landlavastone_02 1686 +#define SFXsam_ballland_lava 1687 +#define SFXsam_ballroll_lavastone 1688 +#define SFXsam_wlklavastone_00 1689 +#define SFXsam_wlklavastone_01 1690 +#define SFXsfx069B 1691 +#define SFXsfx069C 1692 +#define SFXsfx069D 1693 +#define SFXsfx069E 1694 +#define SFXsfx069F 1695 +#define SFXsfx06A0 1696 +#define SFXsfx06A1 1697 +#define SFXsfx06A2 1698 +#define SFXsfx06A3 1699 +#define SFXsfx06A4 1700 +#define SFXsfx06A5 1701 +#define SFXsfx06A6 1702 +#define SFXsfx06A7 1703 +#define SFXsfx06A8 1704 +#define SFXsfx06A9 1705 +#define SFXsfx06AA 1706 +#define SFXsfx06AB 1707 +#define SFXsfx06AC 1708 +#define SFXsfx06AD 1709 +#define SFXsfx06AE 1710 +#define SFXsfx06AF 1711 +#define SFXsfx06B0 1712 +#define SFXsfx06B1 1713 +#define SFXsfx06B2 1714 +#define SFXsfx06B3 1715 +#define SFXsfx06B4 1716 +#define SFXsfx06B5 1717 +#define SFXsfx06B6 1718 +#define SFXsfx06B7 1719 +#define SFXsfx06B8 1720 +#define SFXsfx06B9 1721 +#define SFXsfx06BA 1722 +#define SFXsfx06BB 1723 diff --git a/Runtime/Audio/SFX/OmegaPirate.h b/Runtime/Audio/SFX/OmegaPirate.h new file mode 100644 index 000000000..e21222ce1 --- /dev/null +++ b/Runtime/Audio/SFX/OmegaPirate.h @@ -0,0 +1,69 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: OmegaPirate + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPOmegaPirate 57 + +#define SFXsfx0B0F 2831 +#define SFXsfx0B10 2832 +#define SFXopr_b_voxcall_00 2833 +#define SFXopr_b_voxcall_01 2834 +#define SFXopr_b_voxlaugh_00 2835 +#define SFXopr_r_moan_00 2836 +#define SFXsfx0B15 2837 +#define SFXsfx0B16 2838 +#define SFXopr_b_run_01 2839 +#define SFXsfx0B18 2840 +#define SFXopr_b_voxalert_00 2841 +#define SFXopr_b_voxalert_01 2842 +#define SFXopr_b_voxattak_00 2843 +#define SFXopr_b_voxattak_01 2844 +#define SFXopr_b_voxblok_00 2845 +#define SFXopr_b_voxidle_00 2846 +#define SFXopr_b_voxidle_01 2847 +#define SFXopr_b_voxpiss_00 2848 +#define SFXopr_b_voxtaunt_00 2849 +#define SFXopr_b_walklite_00 2850 +#define SFXopr_b_walklite_01 2851 +#define SFXopr_b_walk_00 2852 +#define SFXopr_b_walk_01 2853 +#define SFXopr_b_healnrg_lp_00 2854 +#define SFXsfx0B27 2855 +#define SFXsfx0B28 2856 +#define SFXsfx0B29 2857 +#define SFXopr_r_pain_00 2858 +#define SFXopr_r_pain_01 2859 +#define SFXsfx0B2C 2860 +#define SFXopr_b_invis_00 2861 +#define SFXopr_b_voxready_00 2862 +#define SFXsfx0B2F 2863 +#define SFXsfx0B30 2864 +#define SFXopr_r_pain_02 2865 +#define SFXsfx0B32 2866 +#define SFXopr_a_grenchrg_00 2867 +#define SFXsfx0B34 2868 +#define SFXopr_a_grenade_00 2869 +#define SFXsfx0B36 2870 +#define SFXsfx0B37 2871 +#define SFXsfx0B38 2872 +#define SFXsfx0B39 2873 +#define SFXsfx0B3A 2874 +#define SFXsfx0B3B 2875 +#define SFXsfx0B3C 2876 +#define SFXsfx0B3D 2877 +#define SFXopr_r_death_01 2878 +#define SFXsfx0B3F 2879 +#define SFXopr_c_samswoosh_00 2880 +#define SFXsfx0B41 2881 +#define SFXsfx0B42 2882 +#define SFXsfx0B43 2883 +#define SFXsfx0B44 2884 +#define SFXsfx0B45 2885 +#define SFXsfx0B46 2886 +#define SFXsfx0B47 2887 +#define SFXsfx0B48 2888 +#define SFXsfx0B49 2889 +#define SFXsfx0B4A 2890 diff --git a/Runtime/Audio/SFX/OverWorld.h b/Runtime/Audio/SFX/OverWorld.h new file mode 100644 index 000000000..f39633383 --- /dev/null +++ b/Runtime/Audio/SFX/OverWorld.h @@ -0,0 +1,81 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: OverWorld + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPOverWorld 51 + +#define SFXsfx09E0 2528 +#define SFXsfx09E1 2529 +#define SFXsfx09E2 2530 +#define SFXsfx09E3 2531 +#define SFXsfx09E4 2532 +#define SFXsfx09E5 2533 +#define SFXsfx09E6 2534 +#define SFXsfx09E7 2535 +#define SFXsfx09E8 2536 +#define SFXsfx09E9 2537 +#define SFXsfx09EA 2538 +#define SFXsfx09EB 2539 +#define SFXsfx09EC 2540 +#define SFXsfx09ED 2541 +#define SFXsfx09EE 2542 +#define SFXsfx09EF 2543 +#define SFXsfx09F0 2544 +#define SFXsfx09F1 2545 +#define SFXcrb_b_hiss_00 2546 +#define SFXcrb_b_idle_00 2547 +#define SFXsfx09F4 2548 +#define SFXsfx09F5 2549 +#define SFXsfx09F6 2550 +#define SFXsfx09F7 2551 +#define SFXsfx09F8 2552 +#define SFXove_x_spinbars_lp 2553 +#define SFXsfx09FA 2554 +#define SFXsfx09FB 2555 +#define SFXsfx09FC 2556 +#define SFXsfx09FD 2557 +#define SFXsfx09FE 2558 +#define SFXsfx09FF 2559 +#define SFXsfx0A00 2560 +#define SFXsfx0A01 2561 +#define SFXsfx0A02 2562 +#define SFXsfx0A03 2563 +#define SFXsfx0A04 2564 +#define SFXsfx0A05 2565 +#define SFXsfx0A06 2566 +#define SFXsfx0A07 2567 +#define SFXsfx0A08 2568 +#define SFXsfx0A09 2569 +#define SFXsfx0A0A 2570 +#define SFXsfx0A0B 2571 +#define SFXsfx0A0C 2572 +#define SFXsfx0A0D 2573 +#define SFXsfx0A0E 2574 +#define SFXsfx0A0F 2575 +#define SFXsfx0A10 2576 +#define SFXsfx0A11 2577 +#define SFXsfx0A12 2578 +#define SFXsfx0A13 2579 +#define SFXsfx0A14 2580 +#define SFXlbm_c_beam_lp_01 2581 +#define SFXsfx0A16 2582 +#define SFXsfx0A17 2583 +#define SFXsfx0A18 2584 +#define SFXsfx0A19 2585 +#define SFXsfx0A1A 2586 +#define SFXsfx0A1B 2587 +#define SFXsfx0A1C 2588 +#define SFXsfx0A1D 2589 +#define SFXsfx0A1E 2590 +#define SFXsfx0A1F 2591 +#define SFXsfx0A20 2592 +#define SFXsfx0A21 2593 +#define SFXsfx0A22 2594 +#define SFXsfx0A23 2595 +#define SFXsfx0A24 2596 +#define SFXsfx0A25 2597 +#define SFXsfx0A26 2598 +#define SFXsfx0A27 2599 diff --git a/Runtime/Audio/SFX/Parasite.h b/Runtime/Audio/SFX/Parasite.h new file mode 100644 index 000000000..5769165f0 --- /dev/null +++ b/Runtime/Audio/SFX/Parasite.h @@ -0,0 +1,33 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Parasite + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPParasite 22 + +#define SFXpar_a_voxangry_00 624 +#define SFXsfx0271 625 +#define SFXsfx0272 626 +#define SFXsfx0273 627 +#define SFXsfx0274 628 +#define SFXpar_b_idle_02 629 +#define SFXpar_b_munch_00 630 +#define SFXsfx0277 631 +#define SFXpar_b_run_00 632 +#define SFXpar_b_run_01 633 +#define SFXsfx027A 634 +#define SFXpar_b_walk_00 635 +#define SFXpar_b_walk_01 636 +#define SFXsfx027D 637 +#define SFXpar_b_idlelone_02 638 +#define SFXpar_r_impact_00 639 +#define SFXsfx0280 640 +#define SFXsfx0281 641 +#define SFXsfx0282 642 +#define SFXsfx0283 643 +#define SFXsfx0284 644 +#define SFXsfx0285 645 +#define SFXsfx0286 646 +#define SFXsfx0287 647 diff --git a/Runtime/Audio/SFX/Phazon.h b/Runtime/Audio/SFX/Phazon.h new file mode 100644 index 000000000..3c85f44b5 --- /dev/null +++ b/Runtime/Audio/SFX/Phazon.h @@ -0,0 +1,16 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Phazon + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPPhazon 66 + +#define SFXphz_damage_lp 3114 +#define SFXsfx0C2B 3115 +#define SFXsfx0C2C 3116 +#define SFXsfx0C2D 3117 +#define SFXsfx0C2E 3118 +#define SFXsfx0C2F 3119 +#define SFXsfx0C30 3120 diff --git a/Runtime/Audio/SFX/PhazonGun.h b/Runtime/Audio/SFX/PhazonGun.h new file mode 100644 index 000000000..a916967dd --- /dev/null +++ b/Runtime/Audio/SFX/PhazonGun.h @@ -0,0 +1,11 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: PhazonGun + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPPhazonGun 68 + +#define SFXphg_charge_lp 3141 +#define SFXsfx0C46 3142 diff --git a/Runtime/Audio/SFX/PuddleSpore.h b/Runtime/Audio/SFX/PuddleSpore.h new file mode 100644 index 000000000..e949065fd --- /dev/null +++ b/Runtime/Audio/SFX/PuddleSpore.h @@ -0,0 +1,36 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: PuddleSpore + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPPuddleSpore 23 + +#define SFXsfx0288 648 +#define SFXpds_a_voxactive_00 649 +#define SFXpds_b_bubbles_00 650 +#define SFXpds_b_open_00 651 +#define SFXpds_b_slam_00 652 +#define SFXpds_b_voxopen_lp_00 653 +#define SFXpds_b_voxslam_00 654 +#define SFXpds_b_water_00 655 +#define SFXpds_b_water_01 656 +#define SFXpds_lava_damage_lp 657 +#define SFXsfx0292 658 +#define SFXpds_r_voxpain_02 659 +#define SFXsfx0294 660 +#define SFXsfx0295 661 +#define SFXsfx0296 662 +#define SFXsfx0297 663 +#define SFXsfx0298 664 +#define SFXsfx0299 665 +#define SFXsfx029A 666 +#define SFXsfx029B 667 +#define SFXsfx029C 668 +#define SFXsfx029D 669 +#define SFXsfx029E 670 +#define SFXsfx029F 671 +#define SFXsfx02A0 672 +#define SFXsfx02A1 673 +#define SFXsfx02A2 674 diff --git a/Runtime/Audio/SFX/PuddleToad.h b/Runtime/Audio/SFX/PuddleToad.h new file mode 100644 index 000000000..e18b320db --- /dev/null +++ b/Runtime/Audio/SFX/PuddleToad.h @@ -0,0 +1,38 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: PuddleToad + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPPuddleToad 24 + +#define SFXpud_a_suckin_00 675 +#define SFXpud_a_spitout_00 676 +#define SFXsfx02A5 677 +#define SFXpud_b_close_00 678 +#define SFXpud_b_splat_00 679 +#define SFXsfx02A8 680 +#define SFXsfx02A9 681 +#define SFXsfx02AA 682 +#define SFXpud_b_voxclose_00 683 +#define SFXpud_a_suckin_lp_01 684 +#define SFXsfx02AD 685 +#define SFXsfx02AE 686 +#define SFXpud_b_growl_00 687 +#define SFXpud_b_squish_lp_00 688 +#define SFXsfx02B1 689 +#define SFXsfx02B2 690 +#define SFXsfx02B3 691 +#define SFXsfx02B4 692 +#define SFXsfx02B5 693 +#define SFXsfx02B6 694 +#define SFXsfx02B7 695 +#define SFXsfx02B8 696 +#define SFXsfx02B9 697 +#define SFXsfx02BA 698 +#define SFXsfx02BB 699 +#define SFXsfx02BC 700 +#define SFXsfx02BD 701 +#define SFXsfx02BE 702 +#define SFXsfx02BF 703 diff --git a/Runtime/Audio/SFX/Puffer.h b/Runtime/Audio/SFX/Puffer.h new file mode 100644 index 000000000..b34e47e21 --- /dev/null +++ b/Runtime/Audio/SFX/Puffer.h @@ -0,0 +1,16 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Puffer + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPPuffer 25 + +#define SFXpuf_b_fly_lp_00 704 +#define SFXsfx02C1 705 +#define SFXsfx02C2 706 +#define SFXsfx02C3 707 +#define SFXsfx02C4 708 +#define SFXsfx02C5 709 +#define SFXsfx02C6 710 diff --git a/Runtime/Audio/SFX/ReactorDoor.h b/Runtime/Audio/SFX/ReactorDoor.h new file mode 100644 index 000000000..edc49bd02 --- /dev/null +++ b/Runtime/Audio/SFX/ReactorDoor.h @@ -0,0 +1,22 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: ReactorDoor + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPReactorDoor 49 + +#define SFXdor_x_close_01 2365 +#define SFXdor_x_open_01 2366 +#define SFXsfx093F 2367 +#define SFXint_x_reacdoor_01 2368 +#define SFXint_x_reacdoor_02 2369 +#define SFXint_x_reacdoor_03 2370 +#define SFXint_x_reacdoor_04 2371 +#define SFXint_x_reacdoor_lp_00 2372 +#define SFXsfx0945 2373 +#define SFXsfx0946 2374 +#define SFXsfx0947 2375 +#define SFXsfx0948 2376 +#define SFXsfx0949 2377 diff --git a/Runtime/Audio/SFX/Ridley.h b/Runtime/Audio/SFX/Ridley.h new file mode 100644 index 000000000..f51f875e5 --- /dev/null +++ b/Runtime/Audio/SFX/Ridley.h @@ -0,0 +1,69 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Ridley + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPRidley 56 + +#define SFXrid_a_flamerake_00 2771 +#define SFXrid_a_flame_lp_00 2772 +#define SFXsfx0AD5 2773 +#define SFXrid_b_flap_00 2774 +#define SFXrid_b_land_00 2775 +#define SFXrid_b_passby_00 2776 +#define SFXrid_b_popup_00 2777 +#define SFXrid_b_voxangry_00 2778 +#define SFXrid_b_voxangry_01 2779 +#define SFXrid_b_voxattack_00 2780 +#define SFXrid_b_voxattack_01 2781 +#define SFXrid_b_voxidle_00 2782 +#define SFXsfx0ADF 2783 +#define SFXrid_b_voxtaunt_00 2784 +#define SFXrid_b_voxtaunt_01 2785 +#define SFXrid_b_walk_00 2786 +#define SFXrid_b_walk_01 2787 +#define SFXsfx0AE4 2788 +#define SFXrid_b_walksm_00 2789 +#define SFXrid_b_walksm_01 2790 +#define SFXrid_r_chestexp_00 2791 +#define SFXrid_r_death_00 2792 +#define SFXrid_r_painbig_00 2793 +#define SFXrid_r_pain_00 2794 +#define SFXsfx0AEB 2795 +#define SFXrid_a_chestglo_00 2796 +#define SFXrid_a_claw_00 2797 +#define SFXsfx0AEE 2798 +#define SFXrid_a_mirv_00 2799 +#define SFXsfx0AF0 2800 +#define SFXrid_a_tail_00 2801 +#define SFXsfx0AF2 2802 +#define SFXsfx0AF3 2803 +#define SFXsfx0AF4 2804 +#define SFXrid_r_pain_lp_00 2805 +#define SFXsfx0AF6 2806 +#define SFXsfx0AF7 2807 +#define SFXsfx0AF8 2808 +#define SFXrid_c_smallexp_00 2809 +#define SFXrid_c_painbig_00 2810 +#define SFXsfx0AFB 2811 +#define SFXsfx0AFC 2812 +#define SFXsfx0AFD 2813 +#define SFXsfx0AFE 2814 +#define SFXsfx0AFF 2815 +#define SFXsfx0B00 2816 +#define SFXsfx0B01 2817 +#define SFXsfx0B02 2818 +#define SFXsfx0B03 2819 +#define SFXsfx0B04 2820 +#define SFXsfx0B05 2821 +#define SFXsfx0B06 2822 +#define SFXsfx0B07 2823 +#define SFXsfx0B08 2824 +#define SFXsfx0B09 2825 +#define SFXsfx0B0A 2826 +#define SFXsfx0B0B 2827 +#define SFXsfx0B0C 2828 +#define SFXsfx0B0D 2829 +#define SFXsfx0B0E 2830 diff --git a/Runtime/Audio/SFX/Ripper.h b/Runtime/Audio/SFX/Ripper.h new file mode 100644 index 000000000..7bc667f86 --- /dev/null +++ b/Runtime/Audio/SFX/Ripper.h @@ -0,0 +1,19 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Ripper + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPRipper 26 + +#define SFXrip_b_float_lp_00 711 +#define SFXrip_b_scream_00 712 +#define SFXsfx02C9 713 +#define SFXsfx02CA 714 +#define SFXrip_r_impact_00 715 +#define SFXsfx02CC 716 +#define SFXsfx02CD 717 +#define SFXsfx02CE 718 +#define SFXsfx02CF 719 +#define SFXsfx02D0 720 diff --git a/Runtime/Audio/SFX/RuinsWorld.h b/Runtime/Audio/SFX/RuinsWorld.h new file mode 100644 index 000000000..9240cf6bc --- /dev/null +++ b/Runtime/Audio/SFX/RuinsWorld.h @@ -0,0 +1,159 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: RuinsWorld + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPRuinsWorld 50 + +#define SFXsfx094A 2378 +#define SFXsfx094B 2379 +#define SFXsfx094C 2380 +#define SFXsfx094D 2381 +#define SFXeye_b_blink_00 2382 +#define SFXeye_b_impact_00 2383 +#define SFXsfx0950 2384 +#define SFXsfx0951 2385 +#define SFXsfx0952 2386 +#define SFXsfx0953 2387 +#define SFXsfx0954 2388 +#define SFXsfx0955 2389 +#define SFXsfx0956 2390 +#define SFXsfx0957 2391 +#define SFXsfx0958 2392 +#define SFXsfx0959 2393 +#define SFXsfx095A 2394 +#define SFXrui_x_leaves_00 2395 +#define SFXsfx095C 2396 +#define SFXsfx095D 2397 +#define SFXsfx095E 2398 +#define SFXsfx095F 2399 +#define SFXsfx0960 2400 +#define SFXmac_x_stop_00 2401 +#define SFXsfx0962 2402 +#define SFXsfx0963 2403 +#define SFXsfx0964 2404 +#define SFXsfx0965 2405 +#define SFXsfx0966 2406 +#define SFXsfx0967 2407 +#define SFXsfx0968 2408 +#define SFXsfx0969 2409 +#define SFXsfx096A 2410 +#define SFXsfx096B 2411 +#define SFXsfx096C 2412 +#define SFXsfx096D 2413 +#define SFXsfx096E 2414 +#define SFXsfx096F 2415 +#define SFXenc_x_genmove_lp_00 2416 +#define SFXsfx0971 2417 +#define SFXsfx0972 2418 +#define SFXsfx0973 2419 +#define SFXsfx0974 2420 +#define SFXhiv_x_fall_lp_00 2421 +#define SFXsfx0976 2422 +#define SFXsfx0977 2423 +#define SFXhiv_x_open_00 2424 +#define SFXsfx0979 2425 +#define SFXhiv_x_rotate_00 2426 +#define SFXhiv_x_stop_00 2427 +#define SFXsfx097C 2428 +#define SFXsfx097D 2429 +#define SFXrui_x_mapmove_lp_01 2430 +#define SFXsfx097F 2431 +#define SFXsfx0980 2432 +#define SFXsfx0981 2433 +#define SFXsfx0982 2434 +#define SFXsfx0983 2435 +#define SFXhiv_x_closered_lp_00 2436 +#define SFXhiv_x_openred_lp_00 2437 +#define SFXsfx0986 2438 +#define SFXsfx0987 2439 +#define SFXchz_b_balldrop_00 2440 +#define SFXchz_b_balldrop_01 2441 +#define SFXchz_b_release_00 2442 +#define SFXchz_x_down_lp_00 2443 +#define SFXsfx098C 2444 +#define SFXsfx098D 2445 +#define SFXsfx098E 2446 +#define SFXsfx098F 2447 +#define SFXsfx0990 2448 +#define SFXsfx0991 2449 +#define SFXsfx0992 2450 +#define SFXsfx0993 2451 +#define SFXsfx0994 2452 +#define SFXsfx0995 2453 +#define SFXsfx0996 2454 +#define SFXsfx0997 2455 +#define SFXsfx0998 2456 +#define SFXrui_x_mirstop_00 2457 +#define SFXsfx099A 2458 +#define SFXrui_x_slotstop_00 2459 +#define SFXfla_b_bulbopen_00 2460 +#define SFXsfx099D 2461 +#define SFXsfx099E 2462 +#define SFXsfx099F 2463 +#define SFXsfx09A0 2464 +#define SFXsfx09A1 2465 +#define SFXsfx09A2 2466 +#define SFXsfx09A3 2467 +#define SFXsfx09A4 2468 +#define SFXrui_x_flamarmr_00 2469 +#define SFXrui_x_flamarmr_01 2470 +#define SFXrui_x_flamarm_00 2471 +#define SFXrui_x_flamarm_01 2472 +#define SFXrui_x_flamarm_02 2473 +#define SFXrui_x_flamrise_00 2474 +#define SFXrui_x_flamrise_lp_00 2475 +#define SFXrui_x_flamhead_00 2476 +#define SFXrui_x_flamhead_lp_00 2477 +#define SFXrui_x_flamhead_lp_01 2478 +#define SFXsfx09AF 2479 +#define SFXsfx09B0 2480 +#define SFXsfx09B1 2481 +#define SFXsfx09B2 2482 +#define SFXsfx09B3 2483 +#define SFXsfx09B4 2484 +#define SFXsfx09B5 2485 +#define SFXsfx09B6 2486 +#define SFXsfx09B7 2487 +#define SFXsfx09B8 2488 +#define SFXrui_x_mapmove_lp_00 2489 +#define SFXsfx09BA 2490 +#define SFXrui_x_maparm_00 2491 +#define SFXrui_x_mapcover_00 2492 +#define SFXsfx09BD 2493 +#define SFXsfx09BE 2494 +#define SFXsfx09BF 2495 +#define SFXsfx09C0 2496 +#define SFXsfx09C1 2497 +#define SFXsfx09C2 2498 +#define SFXsfx09C3 2499 +#define SFXsfx09C4 2500 +#define SFXmac_x_changed_00 2501 +#define SFXsfx09C6 2502 +#define SFXrui_x_mapstop_00 2503 +#define SFXsfx09C8 2504 +#define SFXrui_x_gatedown_lp_00 2505 +#define SFXsfx09CA 2506 +#define SFXrui_x_gatestop_00 2507 +#define SFXrui_x_gateturn_lp_00 2508 +#define SFXsfx09CD 2509 +#define SFXrui_x_halftrk_00 2510 +#define SFXrui_x_halftrk_lp_00 2511 +#define SFXsfx09D0 2512 +#define SFXsfx09D1 2513 +#define SFXsfx09D2 2514 +#define SFXsfx09D3 2515 +#define SFXdob_x_moveup_lp_00 2516 +#define SFXsfx09D5 2517 +#define SFXsfx09D6 2518 +#define SFXsfx09D7 2519 +#define SFXsfx09D8 2520 +#define SFXsfx09D9 2521 +#define SFXsfx09DA 2522 +#define SFXsfx09DB 2523 +#define SFXsfx09DC 2524 +#define SFXsfx09DD 2525 +#define SFXsfx09DE 2526 +#define SFXsfx09DF 2527 diff --git a/Runtime/Audio/SFX/SFX.h b/Runtime/Audio/SFX/SFX.h new file mode 100644 index 000000000..4bf0e640b --- /dev/null +++ b/Runtime/Audio/SFX/SFX.h @@ -0,0 +1,77 @@ +#ifndef DNAMP1_SFX_H +#define DNAMP1_SFX_H + +#include "Atomic.h" +#include "BetaBeetle.h" +#include "Bird.h" +#include "BloodFlower.h" +#include "Burrower.h" +#include "ChozoGhost.h" +#include "ChubbWeed.h" +#include "CineBoots.h" +#include "CineGeneral.h" +#include "CineGun.h" +#include "CineMorphball.h" +#include "CineSuit.h" +#include "CineVisor.h" +#include "Crater.h" +#include "Crystallite.h" +#include "Drones.h" +#include "EliteSpacePirate.h" +#include "FireFlea.h" +#include "Flaaghra.h" +#include "FlickerBat.h" +#include "FlyingPirate.h" +#include "FrontEnd.h" +#include "GagantuanBeatle.h" +#include "Gnats.h" +#include "Gryzbee.h" +#include "IceCrack.h" +#include "IceWorld.h" +#include "InjuredPirates.h" +#include "IntroBoss.h" +#include "IntroWorld.h" +#include "JellyZap.h" +#include "LavaWorld.h" +#include "Magdolite.h" +#include "Metaree.h" +#include "MetroidPrime.h" +#include "Metroid.h" +#include "MinesWorld.h" +#include "MiscSamus.h" +#include "Misc.h" +#include "OmegaPirate.h" +#include "OverWorld.h" +#include "Parasite.h" +#include "PhazonGun.h" +#include "Phazon.h" +#include "PuddleSpore.h" +#include "PuddleToad.h" +#include "Puffer.h" +#include "ReactorDoor.h" +#include "Ridley.h" +#include "Ripper.h" +#include "RuinsWorld.h" +#include "SFX.h" +#include "SamusShip.h" +#include "Scarab.h" +#include "Seedling.h" +#include "SheeGoth.h" +#include "SnakeWeed.h" +#include "Sova.h" +#include "SpacePirate.h" +#include "SpankWeed.h" +#include "Thardus.h" +#include "TheEnd.h" +#include "Torobyte.h" +#include "Triclops.h" +#include "Turret.h" +#include "UI.h" +#include "WarWasp.h" +#include "Weapons.h" +#include "ZZZ.h" +#include "Zoomer.h" +#include "lumigek.h" +#include "test.h" + +#endif // DNAMP1_SFX_H diff --git a/Runtime/Audio/SFX/SamusShip.h b/Runtime/Audio/SFX/SamusShip.h new file mode 100644 index 000000000..a726becf4 --- /dev/null +++ b/Runtime/Audio/SFX/SamusShip.h @@ -0,0 +1,41 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: SamusShip + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSamusShip 42 + +#define SFXsas_x_dooropen_00 1724 +#define SFXsas_x_dooropen_01 1725 +#define SFXsas_x_dooropen_02 1726 +#define SFXsas_x_dooropen_03 1727 +#define SFXsas_x_dooropen_04 1728 +#define SFXsas_x_dooropen_05 1729 +#define SFXsfx06C2 1730 +#define SFXsas_x_platrise_lp_01 1731 +#define SFXsas_x_thrusmov_00 1732 +#define SFXsfx06C5 1733 +#define SFXsas_x_thrusmov_02 1734 +#define SFXsas_x_thrusmov_03 1735 +#define SFXsas_x_hover_lp_00 1736 +#define SFXsas_x_thrusfir_lp_01 1737 +#define SFXsas_x_hover_lp_01 1738 +#define SFXsfx06CB 1739 +#define SFXsas_x_thrusfir_lp_04 1740 +#define SFXsfx06CD 1741 +#define SFXsfx06CE 1742 +#define SFXsfx06CF 1743 +#define SFXsfx06D0 1744 +#define SFXsfx06D1 1745 +#define SFXsfx06D2 1746 +#define SFXsfx06D3 1747 +#define SFXsfx06D4 1748 +#define SFXsfx06D5 1749 +#define SFXsfx06D6 1750 +#define SFXsfx06D7 1751 +#define SFXsfx06D8 1752 +#define SFXsfx06D9 1753 +#define SFXsfx06DA 1754 +#define SFXsfx06DB 1755 diff --git a/Runtime/Audio/SFX/Scarab.h b/Runtime/Audio/SFX/Scarab.h new file mode 100644 index 000000000..414bc5194 --- /dev/null +++ b/Runtime/Audio/SFX/Scarab.h @@ -0,0 +1,17 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Scarab + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPScarab 27 + +#define SFXsfx02D1 721 +#define SFXsfx02D2 722 +#define SFXsfx02D3 723 +#define SFXsfx02D4 724 +#define SFXsfx02D5 725 +#define SFXsfx02D6 726 +#define SFXsfx02D7 727 +#define SFXsfx02D8 728 diff --git a/Runtime/Audio/SFX/Seedling.h b/Runtime/Audio/SFX/Seedling.h new file mode 100644 index 000000000..6ce1a1f34 --- /dev/null +++ b/Runtime/Audio/SFX/Seedling.h @@ -0,0 +1,29 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Seedling + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSeedling 28 + +#define SFXsed_a_spine_00 729 +#define SFXsed_b_idle_lp_00 730 +#define SFXsfx02DB 731 +#define SFXsfx02DC 732 +#define SFXsed_b_alert_00 733 +#define SFXsfx02DE 734 +#define SFXsfx02DF 735 +#define SFXsfx02E0 736 +#define SFXsfx02E1 737 +#define SFXsfx02E2 738 +#define SFXsfx02E3 739 +#define SFXsfx02E4 740 +#define SFXsfx02E5 741 +#define SFXsfx02E6 742 +#define SFXsfx02E7 743 +#define SFXsfx02E8 744 +#define SFXsfx02E9 745 +#define SFXsfx02EA 746 +#define SFXsfx02EB 747 +#define SFXsfx02EC 748 diff --git a/Runtime/Audio/SFX/SheeGoth.h b/Runtime/Audio/SFX/SheeGoth.h new file mode 100644 index 000000000..0445d9ed5 --- /dev/null +++ b/Runtime/Audio/SFX/SheeGoth.h @@ -0,0 +1,66 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: SheeGoth + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSheeGoth 29 + +#define SFXshe_a_fireball_00 749 +#define SFXshe_b_shake_lp_00 750 +#define SFXsfx02EF 751 +#define SFXshe_a_flame_lp_00 752 +#define SFXshe_a_snap_00 753 +#define SFXshe_a_snap_01 754 +#define SFXshe_a_stomp_00 755 +#define SFXshe_a_stomp_01 756 +#define SFXshe_a_voxangry_00 757 +#define SFXshe_a_voxangry_01 758 +#define SFXshe_a_voxangry_03 759 +#define SFXshe_a_voxangry_04 760 +#define SFXsh2_a_voxangry_00 761 +#define SFXsfx02FA 762 +#define SFXsfx02FB 763 +#define SFXshe_b_idle_02 764 +#define SFXsh2_a_voxangry_01 765 +#define SFXshe_b_land_00 766 +#define SFXsh2_a_flame_lp_00 767 +#define SFXshe_b_roar_00 768 +#define SFXsh2_a_snap_00 769 +#define SFXsh2_a_voxangry_03 770 +#define SFXsh2_a_snap_01 771 +#define SFXshe_b_walk_00 772 +#define SFXshe_b_walk_01 773 +#define SFXshe_r_death_00 774 +#define SFXshe_r_death_01 775 +#define SFXshe_r_pain_00 776 +#define SFXsfx0309 777 +#define SFXsh2_a_voxangry_04 778 +#define SFXsfx030B 779 +#define SFXsfx030C 780 +#define SFXsh2_b_idle_02 781 +#define SFXsh2_b_land_00 782 +#define SFXsh2_b_roar_00 783 +#define SFXsh2_b_shake_lp_00 784 +#define SFXsh2_b_walk_00 785 +#define SFXsh2_b_walk_01 786 +#define SFXsh2_r_death_00 787 +#define SFXsh2_r_death_01 788 +#define SFXsh2_r_pain_00 789 +#define SFXsfx0316 790 +#define SFXsfx0317 791 +#define SFXsh2_b_run_00 792 +#define SFXsh2_b_run_01 793 +#define SFXsfx031A 794 +#define SFXsfx031B 795 +#define SFXsfx031C 796 +#define SFXsfx031D 797 +#define SFXsfx031E 798 +#define SFXsfx031F 799 +#define SFXsfx0320 800 +#define SFXsfx0321 801 +#define SFXsfx0322 802 +#define SFXsfx0323 803 +#define SFXsfx0324 804 +#define SFXsfx0325 805 diff --git a/Runtime/Audio/SFX/SnakeWeed.h b/Runtime/Audio/SFX/SnakeWeed.h new file mode 100644 index 000000000..091564e47 --- /dev/null +++ b/Runtime/Audio/SFX/SnakeWeed.h @@ -0,0 +1,15 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: SnakeWeed + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSnakeWeed 30 + +#define SFXsfx0326 806 +#define SFXsnk_b_in_00 807 +#define SFXsnk_b_out_00 808 +#define SFXsfx0329 809 +#define SFXsfx032A 810 +#define SFXsfx032B 811 diff --git a/Runtime/Audio/SFX/Sova.h b/Runtime/Audio/SFX/Sova.h new file mode 100644 index 000000000..d293ff7f7 --- /dev/null +++ b/Runtime/Audio/SFX/Sova.h @@ -0,0 +1,28 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Sova + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSova 31 + +#define SFXfpr_b_walk_00 812 +#define SFXfpr_b_walk_01 813 +#define SFXspr_a_gun_00 814 +#define SFXsfx032F 815 +#define SFXsfx0330 816 +#define SFXspr_b_walk_00 817 +#define SFXspr_b_walk_01 818 +#define SFXspr_b_walk_02 819 +#define SFXspr_b_walk_03 820 +#define SFXsfx0335 821 +#define SFXsfx0336 822 +#define SFXsfx0337 823 +#define SFXsfx0338 824 +#define SFXsfx0339 825 +#define SFXsfx033A 826 +#define SFXsfx033B 827 +#define SFXsfx033C 828 +#define SFXsfx033D 829 +#define SFXsfx033E 830 diff --git a/Runtime/Audio/SFX/SpacePirate.h b/Runtime/Audio/SFX/SpacePirate.h new file mode 100644 index 000000000..d63dc5f22 --- /dev/null +++ b/Runtime/Audio/SFX/SpacePirate.h @@ -0,0 +1,93 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: SpacePirate + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSpacePirate 32 + +#define SFXsfx033F 831 +#define SFXepr_b_swordin_00 832 +#define SFXepr_b_swordout_00 833 +#define SFXopr_c_movement_00 834 +#define SFXsfx0343 835 +#define SFXsfx0344 836 +#define SFXsfx0345 837 +#define SFXsfx0346 838 +#define SFXsfx0347 839 +#define SFXspr_b_movement_00 840 +#define SFXspr_b_movement_01 841 +#define SFXsfx034A 842 +#define SFXsfx034B 843 +#define SFXsfx034C 844 +#define SFXsfx034D 845 +#define SFXspr_b_voxalert_01 846 +#define SFXsfx034F 847 +#define SFXsfx0350 848 +#define SFXsfx0351 849 +#define SFXsfx0352 850 +#define SFXsfx0353 851 +#define SFXsfx0354 852 +#define SFXsfx0355 853 +#define SFXsfx0356 854 +#define SFXspr_r_impact_02 855 +#define SFXopr_b_swordin_00 856 +#define SFXsfx0359 857 +#define SFXsfx035A 858 +#define SFXsfx035B 859 +#define SFXspr_b_idle_02 860 +#define SFXspr_b_intruder_00 861 +#define SFXsfx035E 862 +#define SFXsfx035F 863 +#define SFXsfx0360 864 +#define SFXsfx0361 865 +#define SFXopr_b_swordout_00 866 +#define SFXspr_r_himpact_00 867 +#define SFXsfx0364 868 +#define SFXspr_b_jump_00 869 +#define SFXsfx0366 870 +#define SFXsfx0367 871 +#define SFXsfx0368 872 +#define SFXspr_b_voxangry_02 873 +#define SFXsfx036A 874 +#define SFXsfx036B 875 +#define SFXsfx036C 876 +#define SFXsfx036D 877 +#define SFXsfx036E 878 +#define SFXsfx036F 879 +#define SFXsfx0370 880 +#define SFXsfx0371 881 +#define SFXsfx0372 882 +#define SFXsfx0373 883 +#define SFXepr_b_movement_00 884 +#define SFXepr_b_movement_01 885 +#define SFXsfx0376 886 +#define SFXsfx0377 887 +#define SFXsfx0378 888 +#define SFXsfx0379 889 +#define SFXsfx037A 890 +#define SFXsfx037B 891 +#define SFXepr_r_die_00 892 +#define SFXsfx037D 893 +#define SFXepr_r_pain_00 894 +#define SFXsfx037F 895 +#define SFXsfx0380 896 +#define SFXsfx0381 897 +#define SFXsfx0382 898 +#define SFXsfx0383 899 +#define SFXsfx0384 900 +#define SFXsfx0385 901 +#define SFXsfx0386 902 +#define SFXsfx0387 903 +#define SFXsfx0388 904 +#define SFXsfx0389 905 +#define SFXsfx038A 906 +#define SFXsfx038B 907 +#define SFXsfx038C 908 +#define SFXsfx038D 909 +#define SFXsfx038E 910 +#define SFXsfx038F 911 +#define SFXsfx0390 912 +#define SFXsfx0391 913 +#define SFXsfx0392 914 diff --git a/Runtime/Audio/SFX/SpankWeed.h b/Runtime/Audio/SFX/SpankWeed.h new file mode 100644 index 000000000..d48e60e36 --- /dev/null +++ b/Runtime/Audio/SFX/SpankWeed.h @@ -0,0 +1,54 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: SpankWeed + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPSpankWeed 33 + +#define SFXspw_a_spank_00 915 +#define SFXsfx0394 916 +#define SFXspw_b_out_00 917 +#define SFXspw_b_swish_02 918 +#define SFXspw_b_swoosh_00 919 +#define SFXsfx0398 920 +#define SFXspw_r_impact_00 921 +#define SFXsfx039A 922 +#define SFXfla_a_tentatak_00 923 +#define SFXsfx039C 924 +#define SFXsfx039D 925 +#define SFXsfx039E 926 +#define SFXsfx039F 927 +#define SFXsfx03A0 928 +#define SFXsfx03A1 929 +#define SFXsfx03A2 930 +#define SFXfla_b_tentmove_01 931 +#define SFXfla_b_tentslid_00 932 +#define SFXfla_b_tentslid_01 933 +#define SFXsfx03A6 934 +#define SFXsfx03A7 935 +#define SFXsfx03A8 936 +#define SFXsfx03A9 937 +#define SFXsfx03AA 938 +#define SFXsfx03AB 939 +#define SFXsfx03AC 940 +#define SFXsfx03AD 941 +#define SFXsfx03AE 942 +#define SFXsfx03AF 943 +#define SFXsfx03B0 944 +#define SFXsfx03B1 945 +#define SFXsfx03B2 946 +#define SFXsfx03B3 947 +#define SFXsfx03B4 948 +#define SFXsfx03B5 949 +#define SFXsfx03B6 950 +#define SFXsfx03B7 951 +#define SFXsfx03B8 952 +#define SFXsfx03B9 953 +#define SFXsfx03BA 954 +#define SFXsfx03BB 955 +#define SFXsfx03BC 956 +#define SFXsfx03BD 957 +#define SFXsfx03BE 958 +#define SFXsfx03BF 959 diff --git a/Runtime/Audio/SFX/Thardus.h b/Runtime/Audio/SFX/Thardus.h new file mode 100644 index 000000000..781b57ef6 --- /dev/null +++ b/Runtime/Audio/SFX/Thardus.h @@ -0,0 +1,77 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Thardus + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPThardus 55 + +#define SFXtha_b_voxangry_02 2703 +#define SFXtha_b_move_00 2704 +#define SFXsfx0A91 2705 +#define SFXtha_b_rocks_00 2706 +#define SFXtha_a_stoneup_lp_00 2707 +#define SFXtha_a_swoosh_00 2708 +#define SFXsfx0A95 2709 +#define SFXtha_a_voxattak_00 2710 +#define SFXtha_a_voxattak_01 2711 +#define SFXtha_b_henshin_lp_00 2712 +#define SFXtha_b_hitgrnd_00 2713 +#define SFXtha_b_hitgrnd_01 2714 +#define SFXtha_b_hitgrnd_02 2715 +#define SFXtha_b_charge_00 2716 +#define SFXtha_a_thunder_00 2717 +#define SFXtha_b_rocks_lp_00 2718 +#define SFXsfx0A9F 2719 +#define SFXtha_b_roll_lp_00 2720 +#define SFXsfx0AA1 2721 +#define SFXtha_b_voxangry_00 2722 +#define SFXtha_b_voxangry_01 2723 +#define SFXtha_b_walk_00 2724 +#define SFXtha_b_walk_01 2725 +#define SFXsfx0AA6 2726 +#define SFXtha_r_pain_00 2727 +#define SFXtha_b_boulder_00 2728 +#define SFXtha_b_boulder_01 2729 +#define SFXsfx0AAA 2730 +#define SFXtha_b_henshin_00 2731 +#define SFXtha_b_henshin_01 2732 +#define SFXsfx0AAD 2733 +#define SFXtha_a_icewave_lp_00 2734 +#define SFXtha_b_chant_00 2735 +#define SFXtha_b_enraged_00 2736 +#define SFXtha_b_charge_01 2737 +#define SFXtha_b_charge_02 2738 +#define SFXtha_b_walk_02 2739 +#define SFXtha_b_walk_03 2740 +#define SFXtha_a_thunder_01 2741 +#define SFXsfx0AB6 2742 +#define SFXsfx0AB7 2743 +#define SFXsfx0AB8 2744 +#define SFXtha_a_icestorm_lp_02 2745 +#define SFXsfx0ABA 2746 +#define SFXsfx0ABB 2747 +#define SFXsfx0ABC 2748 +#define SFXtha_b_idle_00 2749 +#define SFXsfx0ABE 2750 +#define SFXsfx0ABF 2751 +#define SFXsfx0AC0 2752 +#define SFXtha_b_charge_03 2753 +#define SFXtha_r_smpain_00 2754 +#define SFXsfx0AC3 2755 +#define SFXtha_r_pissed_00 2756 +#define SFXsfx0AC5 2757 +#define SFXsfx0AC6 2758 +#define SFXsfx0AC7 2759 +#define SFXsfx0AC8 2760 +#define SFXsfx0AC9 2761 +#define SFXsfx0ACA 2762 +#define SFXsfx0ACB 2763 +#define SFXsfx0ACC 2764 +#define SFXsfx0ACD 2765 +#define SFXsfx0ACE 2766 +#define SFXsfx0ACF 2767 +#define SFXsfx0AD0 2768 +#define SFXsfx0AD1 2769 +#define SFXsfx0AD2 2770 diff --git a/Runtime/Audio/SFX/TheEnd.h b/Runtime/Audio/SFX/TheEnd.h new file mode 100644 index 000000000..3df4c24ae --- /dev/null +++ b/Runtime/Audio/SFX/TheEnd.h @@ -0,0 +1,27 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: TheEnd + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPTheEnd 70 + +#define SFXsfx0C4D 3149 +#define SFXsh2_a_fireball_lp_00 3150 +#define SFXshe_a_fireball_lp_00 3151 +#define SFXend_c_shipthst_00 3152 +#define SFXsfx0C51 3153 +#define SFXsfx0C52 3154 +#define SFXsfx0C53 3155 +#define SFXsfx0C54 3156 +#define SFXsfx0C55 3157 +#define SFXsfx0C56 3158 +#define SFXsfx0C57 3159 +#define SFXsfx0C58 3160 +#define SFXsfx0C59 3161 +#define SFXsfx0C5A 3162 +#define SFXsfx0C5B 3163 +#define SFXsfx0C5C 3164 +#define SFXsfx0C5D 3165 +#define SFXsfx0C5E 3166 diff --git a/Runtime/Audio/SFX/Torobyte.h b/Runtime/Audio/SFX/Torobyte.h new file mode 100644 index 000000000..cea96f914 --- /dev/null +++ b/Runtime/Audio/SFX/Torobyte.h @@ -0,0 +1,28 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Torobyte + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPToroByte 35 + +#define SFXocu_b_idle_00 981 +#define SFXsfx03D6 982 +#define SFXocu_b_blink_00 983 +#define SFXsfx03D8 984 +#define SFXbat_r_voxdeath_00 985 +#define SFXsfx03DA 986 +#define SFXsfx03DB 987 +#define SFXsfx03DC 988 +#define SFXsfx03DD 989 +#define SFXsfx03DE 990 +#define SFXsfx03DF 991 +#define SFXsfx03E0 992 +#define SFXsfx03E1 993 +#define SFXsfx03E2 994 +#define SFXsfx03E3 995 +#define SFXsfx03E4 996 +#define SFXsfx03E5 997 +#define SFXsfx03E6 998 +#define SFXsfx03E7 999 diff --git a/Runtime/Audio/SFX/Triclops.h b/Runtime/Audio/SFX/Triclops.h new file mode 100644 index 000000000..c36824ccc --- /dev/null +++ b/Runtime/Audio/SFX/Triclops.h @@ -0,0 +1,30 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Triclops + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPTriclops 34 + +#define SFXtri_a_attack_00 960 +#define SFXtri_a_attract_00 961 +#define SFXtri_b_idle_00 962 +#define SFXsfx03C3 963 +#define SFXtri_b_walk_00 964 +#define SFXsfx03C5 965 +#define SFXsfx03C6 966 +#define SFXtri_r_impact_00 967 +#define SFXtri_r_impact_01 968 +#define SFXtri_b_run_00 969 +#define SFXsfx03CA 970 +#define SFXsfx03CB 971 +#define SFXsfx03CC 972 +#define SFXsfx03CD 973 +#define SFXsfx03CE 974 +#define SFXsfx03CF 975 +#define SFXsfx03D0 976 +#define SFXsfx03D1 977 +#define SFXsfx03D2 978 +#define SFXsfx03D3 979 +#define SFXsfx03D4 980 diff --git a/Runtime/Audio/SFX/Turret.h b/Runtime/Audio/SFX/Turret.h new file mode 100644 index 000000000..d0fedfb4f --- /dev/null +++ b/Runtime/Audio/SFX/Turret.h @@ -0,0 +1,36 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Turret + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPTurret 36 + +#define SFXsfx03E8 1000 +#define SFXtur_a_laser_00 1001 +#define SFXsfx03EA 1002 +#define SFXsfx03EB 1003 +#define SFXsfx03EC 1004 +#define SFXsfx03ED 1005 +#define SFXsfx03EE 1006 +#define SFXsfx03EF 1007 +#define SFXtur_b_lower_00 1008 +#define SFXsfx03F1 1009 +#define SFXsfx03F2 1010 +#define SFXtur_b_raise_lp_00 1011 +#define SFXtur_b_stop_00 1012 +#define SFXsfx03F5 1013 +#define SFXtur_b_sweep_lp_00 1014 +#define SFXsfx03F7 1015 +#define SFXsfx03F8 1016 +#define SFXsfx03F9 1017 +#define SFXsfx03FA 1018 +#define SFXtur_r_powrdown_lp_00 1019 +#define SFXsfx03FC 1020 +#define SFXsfx03FD 1021 +#define SFXsfx03FE 1022 +#define SFXsfx03FF 1023 +#define SFXsfx0400 1024 +#define SFXsfx0401 1025 +#define SFXsfx0402 1026 diff --git a/Runtime/Audio/SFX/UI.h b/Runtime/Audio/SFX/UI.h new file mode 100644 index 000000000..a2a680eb2 --- /dev/null +++ b/Runtime/Audio/SFX/UI.h @@ -0,0 +1,99 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: UI + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPUI 40 + +#define SFXui_map_rotate 1375 +#define SFXui_map_zoom 1376 +#define SFXui_lockon_poi 1377 +#define SFXui_into_map_screen 1378 +#define SFXsfx0563 1379 +#define SFXui_outof_map_screen 1380 +#define SFXsfx0565 1381 +#define SFXui_outof_visor 1382 +#define SFXui_into_visor 1383 +#define SFXui_visor_xray_lp 1384 +#define SFXui_damage_lp 1385 +#define SFXui_show_local_beacon 1386 +#define SFXui_show_remote_beacon 1387 +#define SFXui_visor_thermal_lp 1388 +#define SFXsfx056D 1389 +#define SFXui_outof_freelook 1390 +#define SFXsfx056F 1391 +#define SFXui_into_freelook 1392 +#define SFXui_lockon_grapple 1393 +#define SFXui_freelook_move_lp 1394 +#define SFXui_select_visor 1395 +#define SFXui_threat_warning 1396 +#define SFXui_missile_warning 1397 +#define SFXui_select_beam 1398 +#define SFXui_threat_damage 1399 +#define SFXui_hud_shutdown 1400 +#define SFXui_hud_reboot 1401 +#define SFXui_static_hi 1402 +#define SFXui_static_lo 1403 +#define SFXui_visor_scan_lp 1404 +#define SFXui_energy_low 1405 +#define SFXui_map_pan 1406 +#define SFXui_scanning_lp 1407 +#define SFXsfx0580 1408 +#define SFXui_outof_scan_window 1409 +#define SFXsfx0582 1410 +#define SFXui_into_scan_window 1411 +#define SFXsfx0584 1412 +#define SFXsfx0585 1413 +#define SFXui_scan_pane_reveal 1414 +#define SFXui_into_hud_message 1415 +#define SFXui_outof_hud_message 1416 +#define SFXui_scan_complete 1417 +#define SFXui_hud_memo_type 1418 +#define SFXsfx058B 1419 +#define SFXsfx058C 1420 +#define SFXui_message_screen_key 1421 +#define SFXui_options_quit_accept 1422 +#define SFXui_options_quit_reject 1423 +#define SFXui_quit_change 1424 +#define SFXui_new_scan_complete 1425 +#define SFXui_map_to_universe 1426 +#define SFXui_map_from_universe 1427 +#define SFXsfx0594 1428 +#define SFXsfx0595 1429 +#define SFXsfx0596 1430 +#define SFXui_table_change_mode 1431 +#define SFXui_advance 1432 +#define SFXui_pause_screen_change 1433 +#define SFXui_pause_screen_exit 1434 +#define SFXui_pause_screen_enter 1435 +#define SFXui_table_selection_change 1436 +#define SFXui_option_enum_change 1437 +#define SFXsfx059E 1438 +#define SFXui_scan_next_page 1439 +#define SFXui_samus_doll_enter 1440 +#define SFXui_samus_doll_exit 1441 +#define SFXui_hud_memo_a_pulse 1442 +#define SFXui_show_hint_memo 1443 +#define SFXui_pause_screen_next_page 1444 +#define SFXsfx05A5 1445 +#define SFXui_map_screen_key2 1446 +#define SFXsfx05A7 1447 +#define SFXsfx05A8 1448 +#define SFXui_hide_hint_memo 1449 +#define SFXsfx05AA 1450 +#define SFXui_options_slider_change_lp 1451 +#define SFXui_map_screen_key1 1452 +#define SFXui_map_screen_key0 1453 +#define SFXsfx05AE 1454 +#define SFXsfx05AF 1455 +#define SFXsfx05B0 1456 +#define SFXsfx05B1 1457 +#define SFXui_frontend_options_slider_change_lp 1458 +#define SFXui_frontend_save_back 1459 +#define SFXui_frontend_save_confirm 1460 +#define SFXui_frontend_save_move 1461 +#define SFXsfx05B6 1462 +#define SFXsfx05B7 1463 +#define SFXsfx05B8 1464 diff --git a/Runtime/Audio/SFX/WarWasp.h b/Runtime/Audio/SFX/WarWasp.h new file mode 100644 index 000000000..138619f46 --- /dev/null +++ b/Runtime/Audio/SFX/WarWasp.h @@ -0,0 +1,72 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: WarWasp + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPWarWasp 37 + +#define SFXwar_b_idle_lp_00 1027 +#define SFXwa2_a_stinger_00 1028 +#define SFXwa2_b_idle_lp_00 1029 +#define SFXwa2_r_diescream_00 1030 +#define SFXwa2_r_hitlight_00 1031 +#define SFXwa2_r_wingbuzz_00 1032 +#define SFXwar_r_diescream_00 1033 +#define SFXwar_r_diescream_01 1034 +#define SFXwar_r_diescream_02 1035 +#define SFXwar_r_diescream_03 1036 +#define SFXwar_r_hitdirt_00 1037 +#define SFXwar_r_hitdirt_01 1038 +#define SFXwar_r_hitlight_00 1039 +#define SFXwar_r_hitlight_01 1040 +#define SFXwar_r_wingbuzz_00 1041 +#define SFXwar_r_wingbuzz_01 1042 +#define SFXwar_r_wingbuzz_02 1043 +#define SFXwar_r_wingbuzz_03 1044 +#define SFXsfx0415 1045 +#define SFXwa2_r_wingbuzz_01 1046 +#define SFXwar_a_stab_00 1047 +#define SFXwar_b_noise_00 1048 +#define SFXwar_b_noise_01 1049 +#define SFXwa3_a_stab_00 1050 +#define SFXwa3_a_stab_01 1051 +#define SFXwa2_b_noise_00 1052 +#define SFXwa2_b_noise_01 1053 +#define SFXwar_a_stab_01 1054 +#define SFXwar_a_stinger_00 1055 +#define SFXwar_r_wingbuzz_04 1056 +#define SFXsfx0421 1057 +#define SFXsfx0422 1058 +#define SFXwa2_b_agitated_lp_00 1059 +#define SFXsfx0424 1060 +#define SFXwa2_b_noise_02 1061 +#define SFXwar_b_agitated_lp_00 1062 +#define SFXwa3_a_voxattak_00 1063 +#define SFXwar_b_noise_02 1064 +#define SFXwa3_b_agitated_lp_00 1065 +#define SFXwa3_b_idle_lp_00 1066 +#define SFXsfx042B 1067 +#define SFXwa3_b_noise_00 1068 +#define SFXsfx042D 1069 +#define SFXwa3_b_noise_02 1070 +#define SFXwa3_r_hitlight_00 1071 +#define SFXwa3_r_wingbuzz_00 1072 +#define SFXglo_b_fly_lp_00 1073 +#define SFXwa3_r_wingbuzz_02 1074 +#define SFXsfx0433 1075 +#define SFXsfx0434 1076 +#define SFXsfx0435 1077 +#define SFXsfx0436 1078 +#define SFXsfx0437 1079 +#define SFXsfx0438 1080 +#define SFXsfx0439 1081 +#define SFXsfx043A 1082 +#define SFXsfx043B 1083 +#define SFXsfx043C 1084 +#define SFXsfx043D 1085 +#define SFXsfx043E 1086 +#define SFXsfx043F 1087 +#define SFXsfx0440 1088 +#define SFXsfx0441 1089 diff --git a/Runtime/Audio/SFX/Weapons.h b/Runtime/Audio/SFX/Weapons.h new file mode 100644 index 000000000..bd30784e0 --- /dev/null +++ b/Runtime/Audio/SFX/Weapons.h @@ -0,0 +1,145 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Weapons + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPWeapons 43 + +#define SFXwpn_bomb_drop 1756 +#define SFXsfx06DD 1757 +#define SFXwpn_bomb_explo 1758 +#define SFXwpn_chargeup_ice 1759 +#define SFXsfx06E0 1760 +#define SFXsfx06E1 1761 +#define SFXwpn_combo_xfer 1762 +#define SFXwpn_empty_action 1763 +#define SFXsfx06E4 1764 +#define SFXsfx06E5 1765 +#define SFXwpn_chargeup_power 1766 +#define SFXwpn_fire_power_charged 1767 +#define SFXwpn_fire_missile 1768 +#define SFXwpn_reload_missile 1769 +#define SFXwpn_fire_power_normal 1770 +#define SFXsfx06EB 1771 +#define SFXsfx06EC 1772 +#define SFXsfx06ED 1773 +#define SFXwpn_morph_out_wipe 1774 +#define SFXwpn_morph_in_wipe_done 1775 +#define SFXwpn_fire_ice_charged 1776 +#define SFXsfx06F1 1777 +#define SFXsfx06F2 1778 +#define SFXsfx06F3 1779 +#define SFXsfx06F4 1780 +#define SFXwpn_invalid_action 1781 +#define SFXsfx06F6 1782 +#define SFXsfx06F7 1783 +#define SFXsfx06F8 1784 +#define SFXsfx06F9 1785 +#define SFXsfx06FA 1786 +#define SFXsfx06FB 1787 +#define SFXsfx06FC 1788 +#define SFXsfx06FD 1789 +#define SFXsfx06FE 1790 +#define SFXsfx06FF 1791 +#define SFXsfx0700 1792 +#define SFXsfx0701 1793 +#define SFXsfx0702 1794 +#define SFXsfx0703 1795 +#define SFXsfx0704 1796 +#define SFXwpn_fire_ice_normal 1797 +#define SFXsfx0706 1798 +#define SFXsfx0707 1799 +#define SFXsfx0708 1800 +#define SFXwpn_fire_wave_normal 1801 +#define SFXsfx070A 1802 +#define SFXwpn_fire_plasma_normal 1803 +#define SFXsfx070C 1804 +#define SFXwpn_fire_phazon_normal 1805 +#define SFXsfx070E 1806 +#define SFXsfx070F 1807 +#define SFXsfx0710 1808 +#define SFXsfx0711 1809 +#define SFXsfx0712 1810 +#define SFXsfx0713 1811 +#define SFXsfx0714 1812 +#define SFXsfx0715 1813 +#define SFXsfx0716 1814 +#define SFXsfx0717 1815 +#define SFXsfx0718 1816 +#define SFXsfx0719 1817 +#define SFXsfx071A 1818 +#define SFXsfx071B 1819 +#define SFXsfx071C 1820 +#define SFXwpn_into_beam_ice 1821 +#define SFXwpn_from_beam_ice 1822 +#define SFXwpn_to_missile_power 1823 +#define SFXwpn_from_missile_power 1824 +#define SFXwpn_into_beam_plasma 1825 +#define SFXwpn_from_beam_plasma 1826 +#define SFXwpn_into_beam_wave 1827 +#define SFXwpn_from_beam_wave 1828 +#define SFXwpn_to_missile_ice 1829 +#define SFXsfx0726 1830 +#define SFXsfx0727 1831 +#define SFXsfx0728 1832 +#define SFXsfx0729 1833 +#define SFXsfx072A 1834 +#define SFXsfx072B 1835 +#define SFXsfx072C 1836 +#define SFXsfx072D 1837 +#define SFXsfx072E 1838 +#define SFXwpn_chargeup_plasma 1839 +#define SFXwpn_fire_plasma_charged 1840 +#define SFXsfx0731 1841 +#define SFXwpn_combo_flamethrower 1842 +#define SFXsfx0733 1843 +#define SFXwpn_chargeup_wave 1844 +#define SFXwpn_fire_wave_charged 1845 +#define SFXsfx0736 1846 +#define SFXwpn_combo_wavebuster 1847 +#define SFXsfx0738 1848 +#define SFXwpn_from_missile_ice 1849 +#define SFXwpn_to_missile_wave 1850 +#define SFXwpn_from_missile_wave 1851 +#define SFXwpn_to_missile_plasma 1852 +#define SFXwpn_from_missile_plasma 1853 +#define SFXsfx073E 1854 +#define SFXsfx073F 1855 +#define SFXsfx0740 1856 +#define SFXsfx0741 1857 +#define SFXsfx0742 1858 +#define SFXsfx0743 1859 +#define SFXsfx0744 1860 +#define SFXsfx0745 1861 +#define SFXsfx0746 1862 +#define SFXsfx0747 1863 +#define SFXsfx0748 1864 +#define SFXsfx0749 1865 +#define SFXsfx074A 1866 +#define SFXsfx074B 1867 +#define SFXsfx074C 1868 +#define SFXsfx074D 1869 +#define SFXsfx074E 1870 +#define SFXsfx074F 1871 +#define SFXsfx0750 1872 +#define SFXsfx0751 1873 +#define SFXsfx0752 1874 +#define SFXsfx0753 1875 +#define SFXsfx0754 1876 +#define SFXsfx0755 1877 +#define SFXsfx0756 1878 +#define SFXsfx0757 1879 +#define SFXsfx0758 1880 +#define SFXsfx0759 1881 +#define SFXsfx075A 1882 +#define SFXsfx075B 1883 +#define SFXsfx075C 1884 +#define SFXsfx075D 1885 +#define SFXsfx075E 1886 +#define SFXsfx075F 1887 +#define SFXsfx0760 1888 +#define SFXsfx0761 1889 +#define SFXsfx0762 1890 +#define SFXsfx0763 1891 diff --git a/Runtime/Audio/SFX/ZZZ.h b/Runtime/Audio/SFX/ZZZ.h new file mode 100644 index 000000000..1b7c2b7fa --- /dev/null +++ b/Runtime/Audio/SFX/ZZZ.h @@ -0,0 +1,29 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: ZZZ + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPZZZ 65 + +#define SFXsfx0C16 3094 +#define SFXsfx0C17 3095 +#define SFXsfx0C18 3096 +#define SFXsfx0C19 3097 +#define SFXsfx0C1A 3098 +#define SFXsfx0C1B 3099 +#define SFXsfx0C1C 3100 +#define SFXsfx0C1D 3101 +#define SFXsfx0C1E 3102 +#define SFXsfx0C1F 3103 +#define SFXsfx0C20 3104 +#define SFXsfx0C21 3105 +#define SFXsfx0C22 3106 +#define SFXsfx0C23 3107 +#define SFXsfx0C24 3108 +#define SFXsfx0C25 3109 +#define SFXsfx0C26 3110 +#define SFXsfx0C27 3111 +#define SFXsfx0C28 3112 +#define SFXsfx0C29 3113 diff --git a/Runtime/Audio/SFX/Zoomer.h b/Runtime/Audio/SFX/Zoomer.h new file mode 100644 index 000000000..99269f336 --- /dev/null +++ b/Runtime/Audio/SFX/Zoomer.h @@ -0,0 +1,31 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: Zoomer + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPZoomer 54 + +#define SFXzom_b_idle_00 2681 +#define SFXsfx0A7A 2682 +#define SFXsfx0A7B 2683 +#define SFXsfx0A7C 2684 +#define SFXsfx0A7D 2685 +#define SFXgem_b_idle_00 2686 +#define SFXsfx0A7F 2687 +#define SFXsfx0A80 2688 +#define SFXsfx0A81 2689 +#define SFXsfx0A82 2690 +#define SFXsfx0A83 2691 +#define SFXsfx0A84 2692 +#define SFXsfx0A85 2693 +#define SFXsfx0A86 2694 +#define SFXsfx0A87 2695 +#define SFXsfx0A88 2696 +#define SFXsfx0A89 2697 +#define SFXsfx0A8A 2698 +#define SFXsfx0A8B 2699 +#define SFXsfx0A8C 2700 +#define SFXsfx0A8D 2701 +#define SFXsfx0A8E 2702 diff --git a/Runtime/Audio/SFX/lumigek.h b/Runtime/Audio/SFX/lumigek.h new file mode 100644 index 000000000..86dc69a74 --- /dev/null +++ b/Runtime/Audio/SFX/lumigek.h @@ -0,0 +1,15 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: lumigek + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPLumigek 69 + +#define SFXlum_b_idle_00 3143 +#define SFXsfx0C48 3144 +#define SFXsfx0C49 3145 +#define SFXsfx0C4A 3146 +#define SFXsfx0C4B 3147 +#define SFXsfx0C4C 3148 diff --git a/Runtime/Audio/SFX/test.h b/Runtime/Audio/SFX/test.h new file mode 100644 index 000000000..0028de793 --- /dev/null +++ b/Runtime/Audio/SFX/test.h @@ -0,0 +1,13 @@ +/* Auto-generated Amuse Defines + * + * Project: Audio + * Subproject: test + * Date: Sat Sep 1 12:32:04 2018 + */ + +#define GRPtest 53 + +#define SNGIntro_Cinema 0 +#define SNGMain_Plaza 1 +#define SNGIntro_Exit 2 +#define SNGEndGame 3 diff --git a/Runtime/AutoMapper/CAutoMapper.cpp b/Runtime/AutoMapper/CAutoMapper.cpp index f863f1806..f93c07cc5 100644 --- a/Runtime/AutoMapper/CAutoMapper.cpp +++ b/Runtime/AutoMapper/CAutoMapper.cpp @@ -490,7 +490,7 @@ void CAutoMapper::ProcessMapRotateInput(const CFinalInput& input, const CStateMa std::array dirs{}; bool mouseHeld = false; if (const auto& kbm = input.GetKBM()) { - if (kbm->m_mouseButtons[size_t(boo::EMouseButton::Primary)]) { + if (kbm->m_mouseButtons[size_t(EMouseButton::Primary)]) { mouseHeld = true; if (float(m_mouseDelta.x()) < 0.f) dirs[3] = -m_mouseDelta.x(); @@ -662,8 +662,8 @@ void CAutoMapper::ProcessMapPanInput(const CFinalInput& input, const CStateManag bool mouseHeld = false; if (const auto& kbm = input.GetKBM()) { - if (kbm->m_mouseButtons[size_t(boo::EMouseButton::Middle)] || - kbm->m_mouseButtons[size_t(boo::EMouseButton::Secondary)]) { + if (kbm->m_mouseButtons[size_t(EMouseButton::Middle)] || + kbm->m_mouseButtons[size_t(EMouseButton::Secondary)]) { mouseHeld = true; if (float(m_mouseDelta.x()) < 0.f) right += -m_mouseDelta.x(); @@ -789,10 +789,10 @@ void CAutoMapper::SetShouldRotatingSoundBePlaying(bool shouldBePlaying) { void CAutoMapper::ProcessMapScreenInput(const CFinalInput& input, CStateManager& mgr) { zeus::CMatrix3f camRot = xa8_renderStates[0].x8_camOrientation.toTransform().buildMatrix3f(); if (x1bc_state == EAutoMapperState::MapScreen) { - if ((input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter)) && x328_ == 0 && HasCurrentMapUniverseWorld()) + if ((input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter)) && x328_ == 0 && HasCurrentMapUniverseWorld()) BeginMapperStateTransition(EAutoMapperState::MapScreenUniverse, mgr); } else if (x1bc_state == EAutoMapperState::MapScreenUniverse && - (input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter))) { + (input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter))) { const CMapUniverse::CMapWorldData& mapuWld = x8_mapu->GetMapWorldData(x9c_worldIdx); zeus::CVector3f pointLocal = mapuWld.GetWorldTransform().inverse() * xa8_renderStates[0].x20_areaPoint; if (mapuWld.GetWorldAssetId() != g_GameState->CurrentWorldAssetId()) { @@ -807,7 +807,7 @@ void CAutoMapper::ProcessMapScreenInput(const CFinalInput& input, CStateManager& } x2f4_aButtonPos = 0; - if (input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter)) + if (input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter)) x2f4_aButtonPos = 1; if (IsInPlayerControlState()) { @@ -1084,7 +1084,7 @@ void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager } } - if (input.PZ() || input.PKey('\t') || input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc)) { + if (input.PZ() || input.PKey('\t') || input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc)) { if (x328_ == 0) { if (CanLeaveMapScreenInternal(mgr)) { LeaveMapScreen(mgr); @@ -1604,7 +1604,7 @@ CAssetId CAutoMapper::GetAreaHintDescriptionString(CAssetId mreaId) { } } } - return -1; + return {}; } void CAutoMapper::OnNewInGameGuiState(EInGameGuiState state, CStateManager& mgr) { diff --git a/Runtime/AutoMapper/CAutoMapper.hpp b/Runtime/AutoMapper/CAutoMapper.hpp index c564518a2..e356f6059 100644 --- a/Runtime/AutoMapper/CAutoMapper.hpp +++ b/Runtime/AutoMapper/CAutoMapper.hpp @@ -108,11 +108,11 @@ public: SAutoMapperHintStep(PanToArea, TAreaId areaId) : x0_type(Type::PanToArea), x4_areaId(areaId) {} SAutoMapperHintStep(PanToWorld, CAssetId worldId) : x0_type(Type::PanToWorld), x4_worldId(worldId) {} - SAutoMapperHintStep(SwitchToUniverse) : x0_type(Type::SwitchToUniverse), x4_worldId(0) {} + SAutoMapperHintStep(SwitchToUniverse) : x0_type(Type::SwitchToUniverse), x4_worldId(CAssetId()) {} SAutoMapperHintStep(SwitchToWorld, CAssetId worldId) : x0_type(Type::SwitchToWorld), x4_worldId(worldId) {} SAutoMapperHintStep(ShowBeacon, float val) : x0_type(Type::ShowBeacon), x4_float(val) {} - SAutoMapperHintStep(ZoomIn) : x0_type(Type::ZoomIn), x4_worldId(0) {} - SAutoMapperHintStep(ZoomOut) : x0_type(Type::ZoomOut), x4_worldId(0) {} + SAutoMapperHintStep(ZoomIn) : x0_type(Type::ZoomIn), x4_worldId(CAssetId()) {} + SAutoMapperHintStep(ZoomOut) : x0_type(Type::ZoomOut), x4_worldId(CAssetId()) {} }; struct SAutoMapperHintLocation { @@ -181,8 +181,8 @@ private: std::optional m_lastMouseCoord; zeus::CVector2f m_mouseDelta; - boo::SScrollDelta m_lastAccumScroll; - boo::SScrollDelta m_mapScroll; + SScrollDelta m_lastAccumScroll; + SScrollDelta m_mapScroll; template static void SetResLockState(T& list, bool lock) { diff --git a/Runtime/AutoMapper/CMapArea.cpp b/Runtime/AutoMapper/CMapArea.cpp index f434a189d..0b99daf0e 100644 --- a/Runtime/AutoMapper/CMapArea.cpp +++ b/Runtime/AutoMapper/CMapArea.cpp @@ -3,10 +3,11 @@ #include #include +#include "Runtime/AutoMapper/CMappableObject.hpp" #include "Runtime/CToken.hpp" #include "Runtime/GameGlobalObjects.hpp" -#include "Runtime/AutoMapper/CMappableObject.hpp" #include "Runtime/World/CWorld.hpp" +#include "Runtime/CBasics.hpp" namespace metaforce { constexpr std::array MinesPostTransforms{{ @@ -61,17 +62,17 @@ constexpr std::array MinesPostTransformIndices{ }; CMapArea::CMapArea(CInputStream& in, u32 size) -: x0_magic(in.readUint32()) -, x4_version(in.readUint32Big()) -, x8_(in.readUint32Big()) -, xc_visibilityMode(EVisMode(in.readUint32Big())) -, x10_box(zeus::CAABox::ReadBoundingBoxBig(in)) -, x28_mappableObjCount(in.readUint32Big()) -, x2c_vertexCount(in.readUint32Big()) -, x30_surfaceCount(in.readUint32Big()) +: x0_magic(in.ReadLong()) +, x4_version(in.ReadLong()) +, x8_(in.ReadLong()) +, xc_visibilityMode(EVisMode(in.ReadLong())) +, x10_box(in.Get()) +, x28_mappableObjCount(in.ReadLong()) +, x2c_vertexCount(in.ReadLong()) +, x30_surfaceCount(in.ReadLong()) , x34_size(size - 52) { x44_buf.reset(new u8[x34_size]); - in.readUBytesToBuf(x44_buf.get(), x34_size); + in.ReadBytes(x44_buf.get(), x34_size); PostConstruct(); } @@ -96,7 +97,7 @@ void CMapArea::PostConstruct() { float z; std::memcpy(&z, tmp + 8, sizeof(float)); - m_verts.emplace_back(hecl::SBig(x), hecl::SBig(y), hecl::SBig(z)); + m_verts.emplace_back(CBasics::SwapBytes(x), CBasics::SwapBytes(y), CBasics::SwapBytes(z)); tmp += 12; } @@ -120,14 +121,14 @@ void CMapArea::PostConstruct() { // CMapAreaSurface::Instance& instance = surf.m_instances.emplace_back(ctx, m_vbo, m_ibo); // // athena::io::MemoryReader r(surf.x1c_outlineOffset, INT_MAX); -// u32 outlineCount = r.readUint32Big(); +// u32 outlineCount = r.ReadLong(); // // std::vector& linePrims = instance.m_linePrims; // linePrims.reserve(outlineCount * 2); // for (u32 j = 0; j < 2; ++j) { // r.seek(4, athena::SeekOrigin::Begin); // for (u32 k = 0; k < outlineCount; ++k) { -// const u32 count = r.readUint32Big(); +// const u32 count = r.ReadLong(); // r.seek(count); // r.seekAlign4(); // linePrims.emplace_back(ctx, CLineRenderer::EPrimitiveMode::LineStrip, count, nullptr, false, false, true); @@ -179,11 +180,11 @@ const zeus::CVector3f& CMapArea::GetAreaPostTranslate(const IWorld& world, TArea } CMapArea::CMapAreaSurface::CMapAreaSurface(const void* surfBuf) { - athena::io::MemoryReader r(surfBuf, 32); - x0_normal = r.readVec3fBig(); - xc_centroid = r.readVec3fBig(); - x18_surfOffset = reinterpret_cast(uintptr_t(r.readUint32Big())); - x1c_outlineOffset = reinterpret_cast(uintptr_t(r.readUint32Big())); + CMemoryInStream r(surfBuf, 32, CMemoryInStream::EOwnerShip::NotOwned); + x0_normal = r.Get(); + xc_centroid = r.Get(); + x18_surfOffset = reinterpret_cast(uintptr_t(r.ReadLong())); + x1c_outlineOffset = reinterpret_cast(uintptr_t(r.ReadLong())); } void CMapArea::CMapAreaSurface::PostConstruct(const u8* buf, std::vector& index) { @@ -193,24 +194,24 @@ void CMapArea::CMapAreaSurface::PostConstruct(const u8* buf, std::vector& i m_primStart = index.size(); bool start = true; { - athena::io::MemoryReader r(x18_surfOffset, INT_MAX); - u32 primCount = r.readUint32Big(); + CMemoryInStream r(x18_surfOffset, INT_MAX, CMemoryInStream::EOwnerShip::NotOwned); + u32 primCount = r.ReadLong(); for (u32 i = 0; i < primCount; ++i) { - GX::Primitive prim = GX::Primitive(r.readUint32Big()); - u32 count = r.readUint32Big(); + GX::Primitive prim = GX::Primitive(r.ReadLong()); + u32 count = r.ReadLong(); switch (prim) { case GX::Primitive::TRIANGLES: { for (u32 v = 0; v < count; v += 3) { if (!start) { index.push_back(index.back()); - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); index.push_back(index.back()); } else { - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); start = false; } - index.push_back(r.readUByte()); - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); + index.push_back(r.ReadUint8()); index.push_back(index.back()); } break; @@ -218,38 +219,41 @@ void CMapArea::CMapAreaSurface::PostConstruct(const u8* buf, std::vector& i case GX::Primitive::TRIANGLESTRIP: { if (!start) { index.push_back(index.back()); - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); index.push_back(index.back()); } else { - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); start = false; } for (u32 v = 1; v < count; ++v) - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); if (count & 1) index.push_back(index.back()); break; } case GX::Primitive::TRIANGLEFAN: { - u8 firstVert = r.readUByte(); + u8 firstVert = r.ReadUint8(); if (!start) { index.push_back(index.back()); - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); } else { - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); index.push_back(index.back()); start = false; } for (u32 v = 1; v < count; ++v) { index.push_back(firstVert); - index.push_back(r.readUByte()); + index.push_back(r.ReadUint8()); } break; } default: break; } - r.seekAlign4(); + u32 pos = r.GetReadPosition(); + while (r.GetReadPosition() != ROUND_UP_4(pos)) { + r.ReadUint8(); + } } } m_primCount = index.size() - m_primStart; @@ -269,8 +273,11 @@ void CMapArea::CMapAreaSurface::Draw(const zeus::CVector3f* verts, const zeus::C if (lineColor.a()) { bool draw2 = lineWidth > 1.f; - athena::io::MemoryReader r(x1c_outlineOffset, INT_MAX); - u32 outlineCount = r.readUint32Big(); + u32 outlineCount = *reinterpret_cast(&x1c_outlineOffset); +#if METAFORCE_TARGET_BYTE_ORDER == __ORDER_LITTLE_ENDIAN__ + outlineCount = CBasics::SwapBytes(outlineCount); +#endif + std::vector& linePrims = instance.m_linePrims; zeus::CColor color = lineColor; @@ -280,16 +287,21 @@ void CMapArea::CMapAreaSurface::Draw(const zeus::CVector3f* verts, const zeus::C auto primIt = linePrims.begin(); for (u32 j = 0; j <= u32(draw2); ++j) { - r.seek(4, athena::SeekOrigin::Begin); + CMemoryInStream r(x1c_outlineOffset, INT_MAX, CMemoryInStream::EOwnerShip::NotOwned); + r.ReadLong(); for (u32 i = 0; i < outlineCount; ++i) { CLineRenderer& prim = *primIt++; prim.Reset(); - u32 count = r.readUint32Big(); + u32 count = r.ReadLong(); for (u32 v = 0; v < count; ++v) { - u8 idx = r.readUByte(); + u8 idx = r.ReadUint8(); prim.AddVertex(verts[idx], color, width); } - r.seekAlign4(); + + u32 pos = r.GetReadPosition(); + while (r.GetReadPosition() != ROUND_UP_4(pos)) { + r.ReadUint8(); + } prim.Render(); } width -= 1.f; diff --git a/Runtime/AutoMapper/CMapArea.hpp b/Runtime/AutoMapper/CMapArea.hpp index 45e03bb95..703b2da15 100644 --- a/Runtime/AutoMapper/CMapArea.hpp +++ b/Runtime/AutoMapper/CMapArea.hpp @@ -9,8 +9,6 @@ #include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp" #include "Runtime/RetroTypes.hpp" -//#include - #include #include diff --git a/Runtime/AutoMapper/CMapUniverse.cpp b/Runtime/AutoMapper/CMapUniverse.cpp index 84f68f034..329738b06 100644 --- a/Runtime/AutoMapper/CMapUniverse.cpp +++ b/Runtime/AutoMapper/CMapUniverse.cpp @@ -6,25 +6,25 @@ namespace metaforce { -CMapUniverse::CMapUniverse(CInputStream& in, u32 version) : x0_hexagonId(in.readUint32Big()) { +CMapUniverse::CMapUniverse(CInputStream& in, u32 version) : x0_hexagonId(in.Get()) { x4_hexagonToken = g_SimplePool->GetObj({FOURCC('MAPA'), x0_hexagonId}); - u32 count = in.readUint32Big(); + u32 count = in.ReadLong(); x10_worldDatas.reserve(count); for (u32 i = 0; i < count; ++i) x10_worldDatas.emplace_back(in, version); } CMapUniverse::CMapWorldData::CMapWorldData(CInputStream& in, u32 version) -: x0_label(in.readString()), x10_worldAssetId(in.readUint32Big()) { - x14_transform.read34RowMajor(in); - const u32 worldCount = in.readUint32Big(); +: x0_label(in.Get()), x10_worldAssetId(in) { + x14_transform = in.Get(); + const u32 worldCount = in.ReadLong(); x44_hexagonXfs.reserve(worldCount); for (u32 i = 0; i < worldCount; ++i) { - x44_hexagonXfs.emplace_back().read34RowMajor(in); + x44_hexagonXfs.emplace_back() = in.Get(); } if (version != 0) - x54_surfColorSelected.readRGBABig(in); + x54_surfColorSelected = in.Get(); else x54_surfColorSelected.fromRGBA32(255 | (u32(x10_worldAssetId.Value()) & 0xFFFFFF00)); @@ -115,8 +115,8 @@ void CMapUniverse::Draw(const CMapUniverseDrawParms& parms, const zeus::CVector3 } CFactoryFnReturn FMapUniverseFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer&, CObjectReference*) { - in.readUint32Big(); - u32 version = in.readUint32Big(); + in.ReadLong(); + u32 version = in.ReadLong(); return TToken::GetIObjObjectFor(std::make_unique(in, version)); } diff --git a/Runtime/AutoMapper/CMapWorld.cpp b/Runtime/AutoMapper/CMapWorld.cpp index 2b3711bcd..612e15fd0 100644 --- a/Runtime/AutoMapper/CMapWorld.cpp +++ b/Runtime/AutoMapper/CMapWorld.cpp @@ -274,13 +274,13 @@ CMapWorld::CMapAreaData::CMapAreaData(CAssetId areaRes, EMapAreaList list, CMapA CMapWorld::CMapWorld(CInputStream& in) { x10_listHeads.resize(3); - in.readUint32Big(); - in.readUint32Big(); - u32 areaCount = in.readUint32Big(); + in.ReadLong(); + in.ReadLong(); + u32 areaCount = in.ReadLong(); x0_areas.reserve(areaCount); x20_traversed.resize(areaCount); for (u32 i = 0; i < areaCount; ++i) { - CAssetId mapaId = in.readUint32Big(); + CAssetId mapaId = in.Get(); x0_areas.emplace_back(mapaId, EMapAreaList::Unloaded, x0_areas.empty() ? nullptr : &x0_areas.back()); } x10_listHeads[2] = &x0_areas.back(); diff --git a/Runtime/AutoMapper/CMapWorldInfo.cpp b/Runtime/AutoMapper/CMapWorldInfo.cpp index 926259c6a..dfc4b5b2f 100644 --- a/Runtime/AutoMapper/CMapWorldInfo.cpp +++ b/Runtime/AutoMapper/CMapWorldInfo.cpp @@ -5,52 +5,52 @@ namespace metaforce { -CMapWorldInfo::CMapWorldInfo(CBitStreamReader& reader, const CWorldSaveGameInfo& savw, CAssetId mlvlId) { +CMapWorldInfo::CMapWorldInfo(CInputStream& reader, const CWorldSaveGameInfo& savw, CAssetId mlvlId) { const CSaveWorldMemory& worldMem = g_MemoryCardSys->GetSaveWorldMemory(mlvlId); x4_visitedAreas.reserve((worldMem.GetAreaCount() + 31) / 32); for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) { - const bool visited = reader.ReadEncoded(1) != 0; + const bool visited = reader.ReadBits(1) != 0; SetAreaVisited(i, visited); } x18_mappedAreas.reserve((worldMem.GetAreaCount() + 31) / 32); for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) { - const bool mapped = reader.ReadEncoded(1) != 0; + const bool mapped = reader.ReadBits(1) != 0; SetIsMapped(i, mapped); } for (const auto& doorId : savw.GetDoors()) { - SetDoorVisited(doorId, reader.ReadEncoded(1) != 0); + SetDoorVisited(doorId, reader.ReadBits(1) != 0); } - x38_mapStationUsed = reader.ReadEncoded(1) != 0; + x38_mapStationUsed = reader.ReadBits(1) != 0; } -void CMapWorldInfo::PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw, CAssetId mlvlId) const { +void CMapWorldInfo::PutTo(COutputStream& writer, const CWorldSaveGameInfo& savw, CAssetId mlvlId) const { const CSaveWorldMemory& worldMem = g_MemoryCardSys->GetSaveWorldMemory(mlvlId); for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) { if (i < x0_visitedAreasAllocated) { - writer.WriteEncoded(u32(IsAreaVisited(i)), 1); + writer.WriteBits(u32(IsAreaVisited(i)), 1); } else { - writer.WriteEncoded(0, 1); + writer.WriteBits(0, 1); } } for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) { if (i < x14_mappedAreasAllocated) { - writer.WriteEncoded(u32(IsMapped(i)), 1); + writer.WriteBits(u32(IsMapped(i)), 1); } else { - writer.WriteEncoded(0, 1); + writer.WriteBits(0, 1); } } for (const auto& doorId : savw.GetDoors()) { - writer.WriteEncoded(u32(IsDoorVisited(doorId)), 1); + writer.WriteBits(u32(IsDoorVisited(doorId)), 1); } - writer.WriteEncoded(u32(x38_mapStationUsed), 1); + writer.WriteBits(u32(x38_mapStationUsed), 1); } void CMapWorldInfo::SetDoorVisited(TEditorId eid, bool visited) { x28_visitedDoors[eid] = visited; } diff --git a/Runtime/AutoMapper/CMapWorldInfo.hpp b/Runtime/AutoMapper/CMapWorldInfo.hpp index 14474e8fc..7e6fdf614 100644 --- a/Runtime/AutoMapper/CMapWorldInfo.hpp +++ b/Runtime/AutoMapper/CMapWorldInfo.hpp @@ -4,7 +4,7 @@ #include #include "RetroTypes.hpp" -#include "IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" namespace metaforce { class CWorldSaveGameInfo; @@ -19,8 +19,8 @@ class CMapWorldInfo { public: CMapWorldInfo() = default; - explicit CMapWorldInfo(CBitStreamReader& reader, const CWorldSaveGameInfo& saveWorld, CAssetId mlvlId); - void PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw, CAssetId mlvlId) const; + explicit CMapWorldInfo(CInputStream& reader, const CWorldSaveGameInfo& saveWorld, CAssetId mlvlId); + void PutTo(COutputStream& writer, const CWorldSaveGameInfo& savw, CAssetId mlvlId) const; bool IsMapped(TAreaId aid) const; void SetIsMapped(TAreaId aid, bool mapped); void SetDoorVisited(TEditorId eid, bool val); diff --git a/Runtime/AutoMapper/CMappableObject.cpp b/Runtime/AutoMapper/CMappableObject.cpp index 5c57d7530..f4edeafd9 100644 --- a/Runtime/AutoMapper/CMappableObject.cpp +++ b/Runtime/AutoMapper/CMappableObject.cpp @@ -15,12 +15,12 @@ std::array CMappableObject::skDoorIndices{ }; CMappableObject::CMappableObject(const void* buf) { - athena::io::MemoryReader r(buf, 64); - x0_type = EMappableObjectType(r.readUint32Big()); - x4_visibilityMode = EVisMode(r.readUint32Big()); - x8_objId = r.readUint32Big(); - xc_ = r.readUint32Big(); - x10_transform.read34RowMajor(r); + CMemoryInStream r(buf, 64); + x0_type = EMappableObjectType(r.ReadLong()); + x4_visibilityMode = EVisMode(r.ReadLong()); + x8_objId = r.ReadLong(); + xc_ = r.ReadLong(); + x10_transform = r.Get(); } zeus::CTransform CMappableObject::AdjustTransformForType() const { diff --git a/Runtime/CBasics.hpp b/Runtime/CBasics.hpp index 7e761fea0..91efe2819 100644 --- a/Runtime/CBasics.hpp +++ b/Runtime/CBasics.hpp @@ -1,8 +1,14 @@ #pragma once +#include #include #include -#include +#include +#ifndef _WIN32 +#include +#else +struct _stat64; +#endif #include "Runtime/GCNTypes.hpp" @@ -26,6 +32,12 @@ struct OSCalendarTime { class CBasics { public: +#if _WIN32 + using Sstat = struct ::_stat64; +#else + using Sstat = struct stat; +#endif + static void Initialize(); static const u64 SECONDS_TO_2000; @@ -40,6 +52,18 @@ public: static OSCalendarTime ToCalendarTime(OSTime time) { return ToCalendarTime(FromWiiTime(time)); } static OSCalendarTime ToCalendarTime(std::chrono::system_clock::time_point time); + static u16 SwapBytes(u16 v); + static u32 SwapBytes(u32 v); + static u64 SwapBytes(u64 v); + static float SwapBytes(float v); + static double SwapBytes(double s); + static void Swap2Bytes(u8* v); + static void Swap4Bytes(u8* v); + static void Swap8Bytes(u8* v); + static int RecursiveMakeDir(const char* dir); + static void MakeDir(const char* dir); + static int Stat(const char* path, Sstat* statOut); + static inline void ToLower(std::string& str) { std::transform(str.begin(), str.end(), str.begin(), ::tolower); } }; } // namespace metaforce diff --git a/Runtime/CBasicsPC.cpp b/Runtime/CBasicsPC.cpp index 36262e260..7aee8c698 100644 --- a/Runtime/CBasicsPC.cpp +++ b/Runtime/CBasicsPC.cpp @@ -1,21 +1,36 @@ #ifndef _WIN32 -#include #include +#include #if __APPLE__ #include #endif -#else +#endif + +#include +#include +#include +#include +#include +#ifdef WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif -#include +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include +#include +#ifndef _WIN32_IE +#define _WIN32_IE 0x0400 +#endif +#include +#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR) +#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) +#endif #endif -#include -#include -#include - #include "Runtime/CBasics.hpp" +#include #if __APPLE__ static u64 MachToDolphinNum; @@ -25,7 +40,7 @@ static LARGE_INTEGER PerfFrequency; #endif namespace metaforce { - +static logvisor::Module LogModule("metaforce::CBasics"); void CBasics::Initialize() { #if __APPLE__ mach_timebase_info_data_t timebase; @@ -136,4 +151,191 @@ OSCalendarTime CBasics::ToCalendarTime(std::chrono::system_clock::time_point tim return ret; } +u16 CBasics::SwapBytes(u16 v) { + Swap2Bytes(reinterpret_cast(&v)); + return v; +} +u32 CBasics::SwapBytes(u32 v) { + Swap4Bytes(reinterpret_cast(&v)); + return v; +} + +u64 CBasics::SwapBytes(u64 v) { + Swap8Bytes(reinterpret_cast(&v)); + return v; +} +float CBasics::SwapBytes(float v) { + Swap4Bytes(reinterpret_cast(&v)); + return v; +} +double CBasics::SwapBytes(double v) { + Swap8Bytes(reinterpret_cast(&v)); + return v; +} + +void CBasics::Swap2Bytes(u8* v) { + u16* val = reinterpret_cast(v); +#if __GNUC__ + *val = __builtin_bswap16(*val); +#elif _WIN32 + *val = _byteswap_ushort(*val); +#else + *val = (*val << 8) | ((*val >> 8) & 0xFF); +#endif +} + +void CBasics::Swap4Bytes(u8* v) { + u32* val = reinterpret_cast(v); +#if __GNUC__ + *val = __builtin_bswap32(*val); +#elif _WIN32 + *val = _byteswap_ulong(*val); +#else + *val = ((*val & 0x0000FFFF) << 16) | ((*val & 0xFFFF0000) >> 16) | ((*val & 0x00FF00FF) << 8) | + ((*val & 0xFF00FF00) >> 8); +#endif +} + +void CBasics::Swap8Bytes(u8* v) { + u64* val = reinterpret_cast(v); +#if __GNUC__ + *val = __builtin_bswap64(*val); +#elif _WIN32 + *val = _byteswap_uint64(*val); +#else + *val = ((val & 0xFF00000000000000ULL) >> 56) | ((val & 0x00FF000000000000ULL) >> 40) | + ((val & 0x0000FF0000000000ULL) >> 24) | ((val & 0x000000FF00000000ULL) >> 8) | + ((val & 0x00000000FF000000ULL) << 8) | ((val & 0x0000000000FF0000ULL) << 24) | + ((val & 0x000000000000FF00ULL) << 40) | ((val & 0x00000000000000FFULL) << 56); +#endif +} + +int CBasics::Stat(const char* path, Sstat* statOut) { +#if _WIN32 + size_t pos; + const nowide::wstackstring wpath(path); + const wchar_t* wpathP = wpath.get(); + for (pos = 0; pos < 3 && wpathP[pos] != L'\0'; ++pos) {} + if (pos == 2 && wpathP[1] == L':') { + wchar_t fixPath[4] = {wpathP[0], L':', L'/', L'\0'}; + return _wstat64(fixPath, statOut); + } + return _wstat64(wpath.get(), statOut); +#else + return stat(path, statOut); +#endif +} + +/* recursive mkdir */ +int CBasics::RecursiveMakeDir(const char* dir) { +#if _WIN32 + char tmp[1024]; + + /* copy path */ + std::strncpy(tmp, dir, std::size(tmp)); + const size_t len = std::strlen(tmp); + if (len >= std::size(tmp)) { + return -1; + } + + /* remove trailing slash */ + if (tmp[len - 1] == '/' || tmp[len - 1] == '\\') { + tmp[len - 1] = 0; + } + + /* recursive mkdir */ + char* p = nullptr; + Sstat sb; + for (p = tmp + 1; *p; p++) { + if (*p == '/' || *p == '\\') { + *p = 0; + /* test path */ + if (Stat(tmp, &sb) != 0) { + /* path does not exist - create directory */ + const nowide::wstackstring wtmp(tmp); + if (!CreateDirectoryW(wtmp.get(), nullptr)) { + return -1; + } + } else if (!S_ISDIR(sb.st_mode)) { + /* not a directory */ + return -1; + } + *p = '/'; + } + } + /* test path */ + if (Stat(tmp, &sb) != 0) { + /* path does not exist - create directory */ + const nowide::wstackstring wtmp(tmp); + if (!CreateDirectoryW(wtmp.get(), nullptr)) { + return -1; + } + } else if (!S_ISDIR(sb.st_mode)) { + /* not a directory */ + return -1; + } + return 0; +#else + char tmp[1024]; + + /* copy path */ + std::memset(tmp, 0, std::size(tmp)); + std::strncpy(tmp, dir, std::size(tmp) - 1); + const size_t len = std::strlen(tmp); + if (len >= std::size(tmp)) { + return -1; + } + + /* remove trailing slash */ + if (tmp[len - 1] == '/') { + tmp[len - 1] = 0; + } + + /* recursive mkdir */ + char* p = nullptr; + Sstat sb; + for (p = tmp + 1; *p; p++) { + if (*p == '/') { + *p = 0; + /* test path */ + if (Stat(tmp, &sb) != 0) { + /* path does not exist - create directory */ + if (mkdir(tmp, 0755) < 0) { + return -1; + } + } else if (!S_ISDIR(sb.st_mode)) { + /* not a directory */ + return -1; + } + *p = '/'; + } + } + /* test path */ + if (Stat(tmp, &sb) != 0) { + /* path does not exist - create directory */ + if (mkdir(tmp, 0755) < 0) { + return -1; + } + } else if (!S_ISDIR(sb.st_mode)) { + /* not a directory */ + return -1; + } + return 0; +#endif +} + +void CBasics::MakeDir(const char* dir) { +#if _WIN32 + HRESULT err; + const nowide::wstackstring wdir(dir); + if (!CreateDirectoryW(wdir.get(), NULL)) + if ((err = GetLastError()) != ERROR_ALREADY_EXISTS) + LogModule.report(logvisor::Fatal, FMT_STRING("MakeDir({})"), dir); +#else + if (mkdir(dir, 0755)) + if (errno != EEXIST) + LogModule.report(logvisor::Fatal, FMT_STRING("MakeDir({}): {}"), dir, strerror(errno)); +#endif +} + } // namespace metaforce diff --git a/Runtime/CDependencyGroup.cpp b/Runtime/CDependencyGroup.cpp index bc6064eae..ae1391b86 100644 --- a/Runtime/CDependencyGroup.cpp +++ b/Runtime/CDependencyGroup.cpp @@ -5,7 +5,7 @@ namespace metaforce { CDependencyGroup::CDependencyGroup(CInputStream& in) { ReadFromStream(in); } void CDependencyGroup::ReadFromStream(CInputStream& in) { - u32 depCount = in.readUint32Big(); + u32 depCount = in.ReadLong(); x0_objectTags.reserve(depCount); for (u32 i = 0; i < depCount; i++) x0_objectTags.emplace_back(in); diff --git a/Runtime/CDvdFile.hpp b/Runtime/CDvdFile.hpp index 696b5908e..f4f72c4ee 100644 --- a/Runtime/CDvdFile.hpp +++ b/Runtime/CDvdFile.hpp @@ -11,7 +11,7 @@ #include "Runtime/GCNTypes.hpp" #include "Runtime/RetroTypes.hpp" -#include +//#include #include #include diff --git a/Runtime/CFactoryMgr.cpp b/Runtime/CFactoryMgr.cpp index 72fda9658..c140a039c 100644 --- a/Runtime/CFactoryMgr.cpp +++ b/Runtime/CFactoryMgr.cpp @@ -21,16 +21,16 @@ constexpr std::array TypeTable{ CFactoryFnReturn CFactoryMgr::MakeObject(const SObjectTag& tag, metaforce::CInputStream& in, const CVParamTransfer& paramXfer, CObjectReference* selfRef) { - auto search = m_factories.find(tag.type); - if (search == m_factories.end()) + auto search = x10_factories.find(tag.type); + if (search == x10_factories.end()) return {}; return search->second(tag, in, paramXfer, selfRef); } bool CFactoryMgr::CanMakeMemory(const metaforce::SObjectTag& tag) const { - auto search = m_memFactories.find(tag.type); - return search != m_memFactories.cend(); + auto search = x24_memFactories.find(tag.type); + return search != x24_memFactories.cend(); } CFactoryFnReturn CFactoryMgr::MakeObjectFromMemory(const SObjectTag& tag, std::unique_ptr&& buf, int size, @@ -39,30 +39,34 @@ CFactoryFnReturn CFactoryMgr::MakeObjectFromMemory(const SObjectTag& tag, std::u OPTICK_EVENT(); std::unique_ptr localBuf = std::move(buf); - const auto memFactoryIter = m_memFactories.find(tag.type); - if (memFactoryIter != m_memFactories.cend()) { + const auto memFactoryIter = x24_memFactories.find(tag.type); + if (memFactoryIter != x24_memFactories.cend()) { if (compressed) { - std::unique_ptr compRead = std::make_unique(localBuf.get(), size); - const u32 decompLen = compRead->readUint32Big(); + std::unique_ptr compRead = + std::make_unique(localBuf.get(), size, CMemoryInStream::EOwnerShip::NotOwned); + const u32 decompLen = compRead->ReadLong(); CZipInputStream r(std::move(compRead)); - std::unique_ptr decompBuf = r.readUBytes(decompLen); + std::unique_ptr decompBuf(new u8[decompLen]); + r.Get(decompBuf.get(), decompLen); return memFactoryIter->second(tag, std::move(decompBuf), decompLen, paramXfer, selfRef); } else { return memFactoryIter->second(tag, std::move(localBuf), size, paramXfer, selfRef); } } else { - const auto factoryIter = m_factories.find(tag.type); - if (factoryIter == m_factories.end()) { + const auto factoryIter = x10_factories.find(tag.type); + if (factoryIter == x10_factories.end()) { return {}; } if (compressed) { - std::unique_ptr compRead = std::make_unique(localBuf.get(), size); - compRead->readUint32Big(); + std::unique_ptr compRead = + std::make_unique(localBuf.get(), size, CMemoryInStream::EOwnerShip::NotOwned); + + compRead->ReadLong(); CZipInputStream r(std::move(compRead)); return factoryIter->second(tag, r, paramXfer, selfRef); } else { - CMemoryInStream r(localBuf.get(), size); + CMemoryInStream r(localBuf.get(), size, CMemoryInStream::EOwnerShip::NotOwned); return factoryIter->second(tag, r, paramXfer, selfRef); } } diff --git a/Runtime/CFactoryMgr.hpp b/Runtime/CFactoryMgr.hpp index 0f5b3e8b3..058203051 100644 --- a/Runtime/CFactoryMgr.hpp +++ b/Runtime/CFactoryMgr.hpp @@ -3,7 +3,7 @@ #include #include "Runtime/IFactory.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" namespace metaforce { @@ -12,8 +12,8 @@ class CVParamTransfer; class IObj; class CFactoryMgr { - std::unordered_map m_factories; - std::unordered_map m_memFactories; + std::unordered_map x10_factories; + std::unordered_map x24_memFactories; public: CFactoryFnReturn MakeObject(const SObjectTag& tag, metaforce::CInputStream& in, const CVParamTransfer& paramXfer, @@ -21,8 +21,8 @@ public: bool CanMakeMemory(const metaforce::SObjectTag& tag) const; CFactoryFnReturn MakeObjectFromMemory(const SObjectTag& tag, std::unique_ptr&& buf, int size, bool compressed, const CVParamTransfer& paramXfer, CObjectReference* selfRef); - void AddFactory(FourCC key, FFactoryFunc func) { m_factories.insert_or_assign(key, std::move(func)); } - void AddFactory(FourCC key, FMemFactoryFunc func) { m_memFactories.insert_or_assign(key, std::move(func)); } + void AddFactory(FourCC key, FFactoryFunc func) { x10_factories.insert_or_assign(key, std::move(func)); } + void AddFactory(FourCC key, FMemFactoryFunc func) { x24_memFactories.insert_or_assign(key, std::move(func)); } enum class ETypeTable : u8 { CLSN, diff --git a/Runtime/CGameHintInfo.cpp b/Runtime/CGameHintInfo.cpp index be625c576..822c183de 100644 --- a/Runtime/CGameHintInfo.cpp +++ b/Runtime/CGameHintInfo.cpp @@ -7,29 +7,29 @@ namespace metaforce { CGameHintInfo::CGameHintInfo(CInputStream& in, s32 version) { - u32 hintCount = in.readUint32Big(); + u32 hintCount = in.ReadLong(); x0_hints.reserve(hintCount); for (u32 i = 0; i < hintCount; ++i) x0_hints.emplace_back(in, version); } CGameHintInfo::CGameHint::CGameHint(CInputStream& in, s32 version) -: x0_name(in.readString()) -, x10_immediateTime(in.readFloatBig()) -, x14_normalTime(in.readFloatBig()) -, x18_stringId(in.readUint32Big()) -, x1c_textTime(3.f * float(version <= 0 ? 1 : in.readUint32Big())) { - u32 locationCount = in.readUint32Big(); +: x0_name(in.Get()) +, x10_immediateTime(in.ReadFloat()) +, x14_normalTime(in.ReadFloat()) +, x18_stringId(in.Get()) +, x1c_textTime(3.f * float(version <= 0 ? 1 : in.ReadLong())) { + u32 locationCount = in.ReadLong(); x20_locations.reserve(locationCount); for (u32 i = 0; i < locationCount; ++i) x20_locations.emplace_back(in, version); } CGameHintInfo::SHintLocation::SHintLocation(CInputStream& in, s32) -: x0_mlvlId(in.readUint32Big()) -, x4_mreaId(in.readUint32Big()) -, x8_areaId(in.readUint32Big()) -, xc_stringId(in.readUint32Big()) {} +: x0_mlvlId(in.Get()) +, x4_mreaId(in.Get()) +, x8_areaId(in.ReadLong()) +, xc_stringId(in.Get()) {} int CGameHintInfo::FindHintIndex(std::string_view str) { const std::vector& gameHints = g_MemoryCardSys->GetHints(); @@ -40,8 +40,8 @@ int CGameHintInfo::FindHintIndex(std::string_view str) { } CFactoryFnReturn FHintFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer&, CObjectReference*) { - in.readUint32Big(); - s32 version = in.readInt32Big(); + in.ReadLong(); + s32 version = in.ReadInt32(); return TToken::GetIObjObjectFor(std::make_unique(in, version)); } diff --git a/Runtime/CGameOptions.cpp b/Runtime/CGameOptions.cpp index d03ef368b..3f3db333d 100644 --- a/Runtime/CGameOptions.cpp +++ b/Runtime/CGameOptions.cpp @@ -14,7 +14,7 @@ #include "Runtime/Graphics/CMoviePlayer.hpp" #include "Runtime/Input/CFinalInput.hpp" -#include +#include "ConsoleVariables/CVarManager.hpp" namespace metaforce { @@ -96,26 +96,26 @@ constexpr std::array, 5> GameOptionsRegist {0, nullptr}, }}; -CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) { +CPersistentOptions::CPersistentOptions(CInputStream& stream) { for (u8& entry : x0_nesState) { - entry = stream.ReadEncoded(8); + entry = stream.ReadBits(8); } for (bool& entry : x68_) { - entry = stream.ReadEncoded(8) != 0; + entry = stream.ReadBits(8) != 0; } - xc0_frozenFpsCount = stream.ReadEncoded(2); - xc4_frozenBallCount = stream.ReadEncoded(2); - xc8_powerBombAmmoCount = stream.ReadEncoded(1); - xcc_logScanPercent = stream.ReadEncoded(7); - xd0_24_fusionLinked = stream.ReadEncoded(1) != 0; - xd0_25_normalModeBeat = stream.ReadEncoded(1) != 0; - xd0_26_hardModeBeat = stream.ReadEncoded(1) != 0; - xd0_27_fusionBeat = stream.ReadEncoded(1) != 0; + xc0_frozenFpsCount = stream.ReadBits(2); + xc4_frozenBallCount = stream.ReadBits(2); + xc8_powerBombAmmoCount = stream.ReadBits(1); + xcc_logScanPercent = stream.ReadBits(7); + xd0_24_fusionLinked = stream.ReadBits(1) != 0; + xd0_25_normalModeBeat = stream.ReadBits(1) != 0; + xd0_26_hardModeBeat = stream.ReadBits(1) != 0; + xd0_27_fusionBeat = stream.ReadBits(1) != 0; xd0_28_fusionSuitActive = false; - xd0_29_allItemsCollected = stream.ReadEncoded(1) != 0; - xbc_autoMapperKeyState = stream.ReadEncoded(2); + xd0_29_allItemsCollected = stream.ReadBits(1) != 0; + xbc_autoMapperKeyState = stream.ReadBits(2); const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds(); size_t cinematicCount = 0; @@ -128,7 +128,7 @@ CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) { std::vector cinematicStates; cinematicStates.reserve(cinematicCount); for (size_t i = 0; i < cinematicCount; ++i) { - cinematicStates.push_back(stream.ReadEncoded(1) != 0); + cinematicStates.push_back(stream.ReadBits(1) != 0); } for (const auto& world : memWorlds) { @@ -142,25 +142,25 @@ CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) { } } -void CPersistentOptions::PutTo(CBitStreamWriter& w) const { +void CPersistentOptions::PutTo(COutputStream& w) const { for (const u8 entry : x0_nesState) { - w.WriteEncoded(entry, 8); + w.WriteBits(entry, 8); } for (const bool entry : x68_) { - w.WriteEncoded(u32(entry), 8); + w.WriteBits(u32(entry), 8); } - w.WriteEncoded(xc0_frozenFpsCount, 2); - w.WriteEncoded(xc4_frozenBallCount, 2); - w.WriteEncoded(xc8_powerBombAmmoCount, 1); - w.WriteEncoded(xcc_logScanPercent, 7); - w.WriteEncoded(xd0_24_fusionLinked, 1); - w.WriteEncoded(xd0_25_normalModeBeat, 1); - w.WriteEncoded(xd0_26_hardModeBeat, 1); - w.WriteEncoded(xd0_27_fusionBeat, 1); - w.WriteEncoded(xd0_29_allItemsCollected, 1); - w.WriteEncoded(xbc_autoMapperKeyState, 2); + w.WriteBits(xc0_frozenFpsCount, 2); + w.WriteBits(xc4_frozenBallCount, 2); + w.WriteBits(xc8_powerBombAmmoCount, 1); + w.WriteBits(xcc_logScanPercent, 7); + w.WriteBits(xd0_24_fusionLinked, 1); + w.WriteBits(xd0_25_normalModeBeat, 1); + w.WriteBits(xd0_26_hardModeBeat, 1); + w.WriteBits(xd0_27_fusionBeat, 1); + w.WriteBits(xd0_29_allItemsCollected, 1); + w.WriteBits(xbc_autoMapperKeyState, 2); const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds(); for (const auto& world : memWorlds) { @@ -168,7 +168,7 @@ void CPersistentOptions::PutTo(CBitStreamWriter& w) const { g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), world.second.GetSaveWorldAssetId()}); for (const auto& cineId : saveWorld->GetCinematics()) { - w.WriteEncoded(u32(GetCinematicState(world.first, cineId)), 1); + w.WriteBits(u32(GetCinematicState(world.first, cineId)), 1); } } } @@ -194,26 +194,26 @@ void CPersistentOptions::SetCinematicState(CAssetId mlvlId, TEditorId cineId, bo xac_cinematicStates.erase(existing); } -CGameOptions::CGameOptions(CBitStreamReader& stream) { +CGameOptions::CGameOptions(CInputStream& stream) { for (u8& entry : x0_) - entry = stream.ReadEncoded(8); + entry = stream.ReadBits(8); - x44_soundMode = CAudioSys::ESurroundModes(stream.ReadEncoded(2)); - x48_screenBrightness = stream.ReadEncoded(4); + x44_soundMode = CAudioSys::ESurroundModes(stream.ReadBits(2)); + x48_screenBrightness = stream.ReadBits(4); - x4c_screenXOffset = stream.ReadEncoded(6) - 30; - x50_screenYOffset = stream.ReadEncoded(6) - 30; - x54_screenStretch = stream.ReadEncoded(5) - 10; - x58_sfxVol = stream.ReadEncoded(7); - x5c_musicVol = stream.ReadEncoded(7); - x60_hudAlpha = stream.ReadEncoded(8); - x64_helmetAlpha = stream.ReadEncoded(8); + x4c_screenXOffset = stream.ReadBits(6) - 30; + x50_screenYOffset = stream.ReadBits(6) - 30; + x54_screenStretch = stream.ReadBits(5) - 10; + x58_sfxVol = stream.ReadBits(7); + x5c_musicVol = stream.ReadBits(7); + x60_hudAlpha = stream.ReadBits(8); + x64_helmetAlpha = stream.ReadBits(8); - x68_24_hudLag = stream.ReadEncoded(1) != 0; - x68_28_hintSystem = stream.ReadEncoded(1) != 0; - x68_25_invertY = stream.ReadEncoded(1) != 0; - x68_26_rumble = stream.ReadEncoded(1) != 0; - x68_27_swapBeamsControls = stream.ReadEncoded(1) != 0; + x68_24_hudLag = stream.ReadBits(1) != 0; + x68_28_hintSystem = stream.ReadBits(1) != 0; + x68_25_invertY = stream.ReadBits(1) != 0; + x68_26_rumble = stream.ReadBits(1) != 0; + x68_27_swapBeamsControls = stream.ReadBits(1) != 0; } void CGameOptions::ResetToDefaults() { @@ -235,26 +235,26 @@ void CGameOptions::ResetToDefaults() { EnsureSettings(); } -void CGameOptions::PutTo(CBitStreamWriter& writer) const { +void CGameOptions::PutTo(COutputStream& writer) const { for (const u8 entry : x0_) - writer.WriteEncoded(entry, 8); + writer.WriteBits(entry, 8); - writer.WriteEncoded(u32(x44_soundMode), 2); - writer.WriteEncoded(x48_screenBrightness, 4); + writer.WriteBits(u32(x44_soundMode), 2); + writer.WriteBits(x48_screenBrightness, 4); - writer.WriteEncoded(x4c_screenXOffset + 30, 6); - writer.WriteEncoded(x50_screenYOffset + 30, 6); - writer.WriteEncoded(x54_screenStretch + 10, 5); - writer.WriteEncoded(x58_sfxVol, 7); - writer.WriteEncoded(x5c_musicVol, 7); - writer.WriteEncoded(x60_hudAlpha, 8); - writer.WriteEncoded(x64_helmetAlpha, 8); + writer.WriteBits(x4c_screenXOffset + 30, 6); + writer.WriteBits(x50_screenYOffset + 30, 6); + writer.WriteBits(x54_screenStretch + 10, 5); + writer.WriteBits(x58_sfxVol, 7); + writer.WriteBits(x5c_musicVol, 7); + writer.WriteBits(x60_hudAlpha, 8); + writer.WriteBits(x64_helmetAlpha, 8); - writer.WriteEncoded(x68_24_hudLag, 1); - writer.WriteEncoded(x68_28_hintSystem, 1); - writer.WriteEncoded(x68_25_invertY, 1); - writer.WriteEncoded(x68_26_rumble, 1); - writer.WriteEncoded(x68_27_swapBeamsControls, 1); + writer.WriteBits(x68_24_hudLag, 1); + writer.WriteBits(x68_28_hintSystem, 1); + writer.WriteBits(x68_25_invertY, 1); + writer.WriteBits(x68_26_rumble, 1); + writer.WriteBits(x68_27_swapBeamsControls, 1); } CGameOptions::CGameOptions() @@ -384,19 +384,19 @@ void CGameOptions::SetControls(int controls) { } constexpr std::array, 5> CStickToDPadRemap{{ - {0x2A13C23E, 0xF13452F8}, - {0xA91A7703, 0xC042EC91}, - {0x12A12131, 0x5F556002}, - {0xA9798329, 0xB306E26F}, - {0xCD7B1ACA, 0x8ADA8184}, + {0x2A13C23Eu, 0xF13452F8u}, + {0xA91A7703u, 0xC042EC91u}, + {0x12A12131u, 0x5F556002u}, + {0xA9798329u, 0xB306E26Fu}, + {0xCD7B1ACAu, 0x8ADA8184u}, }}; constexpr std::array, 5> CStickOutlineToDPadRemap{{ - {0x1A29C0E6, 0xF13452F8}, - {0x5D9F9796, 0xC042EC91}, - {0x951546A8, 0x5F556002}, - {0x7946C4C5, 0xB306E26F}, - {0x409AA72E, 0x8ADA8184}, + {0x1A29C0E6u, 0xF13452F8u}, + {0x5D9F9796u, 0xC042EC91u}, + {0x951546A8u, 0x5F556002u}, + {0x7946C4C5u, 0xB306E26Fu}, + {0x409AA72Eu, 0x8ADA8184u}, }}; void CGameOptions::ResetControllerAssets(int controls) { @@ -446,7 +446,7 @@ void CGameOptions::TryRestoreDefaults(const CFinalInput& input, int category, in if (options.second[option].option != EGameOption::RestoreDefaults) return; - if (!forceRestore && !input.PA() && !input.PSpecialKey(boo::ESpecialKey::Enter)) + if (!forceRestore && !input.PA() && !input.PSpecialKey(aurora::SpecialKey::Enter)) return; if (frontend) { @@ -579,14 +579,14 @@ int CGameOptions::GetOption(EGameOption option) { return 0; } -CHintOptions::CHintOptions(CBitStreamReader& stream) { +CHintOptions::CHintOptions(CInputStream& stream) { const auto& hints = g_MemoryCardSys->GetHints(); x0_hintStates.reserve(hints.size()); u32 hintIdx = 0; for ([[maybe_unused]] const auto& hint : hints) { - const auto state = EHintState(stream.ReadEncoded(2)); - const s32 timeBits = stream.ReadEncoded(32); + const auto state = EHintState(stream.ReadBits(2)); + const s32 timeBits = stream.ReadBits(32); float time; std::memcpy(&time, &timeBits, sizeof(s32)); if (state == EHintState::Zero) { @@ -602,14 +602,14 @@ CHintOptions::CHintOptions(CBitStreamReader& stream) { } } -void CHintOptions::PutTo(CBitStreamWriter& writer) const { +void CHintOptions::PutTo(COutputStream& writer) const { for (const SHintState& hint : x0_hintStates) { - writer.WriteEncoded(u32(hint.x0_state), 2); + writer.WriteBits(u32(hint.x0_state), 2); u32 timeBits; std::memcpy(&timeBits, &hint.x4_time, sizeof(timeBits)); - writer.WriteEncoded(timeBits, 32); + writer.WriteBits(timeBits, 32); } } diff --git a/Runtime/CGameOptions.hpp b/Runtime/CGameOptions.hpp index 84b7b2b07..c30ce87d3 100644 --- a/Runtime/CGameOptions.hpp +++ b/Runtime/CGameOptions.hpp @@ -66,7 +66,7 @@ class CPersistentOptions { public: CPersistentOptions() = default; - explicit CPersistentOptions(CBitStreamReader& stream); + explicit CPersistentOptions(CInputStream& stream); bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const; void SetCinematicState(CAssetId mlvlId, TEditorId cineId, bool state); @@ -93,7 +93,7 @@ public: bool GetShowPowerBombAmmoMessage() const { return xc8_powerBombAmmoCount != 1; } void IncrementPowerBombAmmoCount() { xc8_powerBombAmmoCount = std::min(1, xc8_powerBombAmmoCount + 1); } - void PutTo(CBitStreamWriter& w) const; + void PutTo(COutputStream& w) const; u8* GetNESState() { return x0_nesState.data(); } const u8* GetNESState() const { return x0_nesState.data(); } @@ -122,11 +122,11 @@ class CGameOptions { public: CGameOptions(); - explicit CGameOptions(CBitStreamReader& stream); + explicit CGameOptions(CInputStream& stream); void ResetToDefaults(); void InitSoundMode(); void EnsureSettings(); - void PutTo(CBitStreamWriter& writer) const; + void PutTo(COutputStream& writer) const; float TuneScreenBrightness() const; void SetScreenBrightness(s32 value, bool apply); @@ -189,8 +189,8 @@ private: public: CHintOptions() = default; - explicit CHintOptions(CBitStreamReader& stream); - void PutTo(CBitStreamWriter& writer) const; + explicit CHintOptions(CInputStream& stream); + void PutTo(COutputStream& writer) const; void SetNextHintTime(); void InitializeMemoryState(); const SHintState* GetCurrentDisplayedHint() const; diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp index ccfbc9a6c..2da53fce2 100644 --- a/Runtime/CGameState.cpp +++ b/Runtime/CGameState.cpp @@ -4,7 +4,7 @@ #include "Runtime/CWorldSaveGameInfo.hpp" #include "Runtime/CSimplePool.hpp" #include "Runtime/GameGlobalObjects.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/MP1/MP1.hpp" #include @@ -23,32 +23,32 @@ union BitsToDouble { double doub; }; -CScriptLayerManager::CScriptLayerManager(CBitStreamReader& reader, const CWorldSaveGameInfo& saveWorld) { - const u32 bitCount = reader.ReadEncoded(10); - x10_saveLayers.reserve(bitCount); +CScriptLayerManager::CScriptLayerManager(CInputStream& reader, const CWorldSaveGameInfo& saveWorld) { + const u32 bitCount = reader.ReadBits(10); + x10_saveLayers.Reserve(bitCount); for (u32 i = 0; i < bitCount; ++i) { - const bool bit = reader.ReadEncoded(1) != 0; + const bool bit = reader.ReadBits(1) != 0; if (bit) { - x10_saveLayers.setBit(i); + x10_saveLayers.SetBit(i); } else { - x10_saveLayers.unsetBit(i); + x10_saveLayers.UnsetBit(i); } } } -void CScriptLayerManager::PutTo(CBitStreamWriter& writer) const { +void CScriptLayerManager::PutTo(COutputStream& writer) const { u32 totalLayerCount = 0; for (size_t i = 0; i < x0_areaLayers.size(); ++i) { totalLayerCount += GetAreaLayerCount(s32(i)) - 1; } - writer.WriteEncoded(totalLayerCount, 10); + writer.WriteBits(totalLayerCount, 10); for (size_t i = 0; i < x0_areaLayers.size(); ++i) { const u32 count = GetAreaLayerCount(s32(i)); for (u32 l = 1; l < count; ++l) { - writer.WriteEncoded(IsLayerActive(s32(i), s32(l)), 1); + writer.WriteBits(static_cast(IsLayerActive(s32(i), s32(l))), 1); } } } @@ -59,19 +59,20 @@ void CScriptLayerManager::InitializeWorldLayers(const std::vector(); } -CWorldState::CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CWorldSaveGameInfo& saveWorld) -: x0_mlvlId(mlvlId) { - x4_areaId = TAreaId(reader.ReadEncoded(32)); - x10_desiredAreaAssetId = u32(reader.ReadEncoded(32)); +CWorldState::CWorldState(CInputStream& reader, CAssetId mlvlId, const CWorldSaveGameInfo& saveWorld) +: x0_mlvlId(mlvlId), x4_areaId(TAreaId(reader.ReadBits(32))), x10_desiredAreaAssetId(reader.ReadBits(32)) { x8_mailbox = std::make_shared(reader, saveWorld); xc_mapWorldInfo = std::make_shared(reader, saveWorld, mlvlId); x14_layerState = std::make_shared(reader, saveWorld); } -void CWorldState::PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw) const { - writer.WriteEncoded(x4_areaId, 32); - writer.WriteEncoded(u32(x10_desiredAreaAssetId.Value()), 32); +void CWorldState::PutTo(COutputStream& writer, const CWorldSaveGameInfo& savw) const { + writer.WriteBits(x4_areaId, 32); + writer.WriteBits(u32(x10_desiredAreaAssetId.Value()), 32); x8_mailbox->PutTo(writer, savw); xc_mapWorldInfo->PutTo(writer, savw, x0_mlvlId); x14_layerState->PutTo(writer); } CGameState::GameFileStateInfo CGameState::LoadGameFileState(const u8* data) { - CBitStreamReader stream(data, 4096); + CMemoryInStream stream(data, 4096, CMemoryInStream::EOwnerShip::NotOwned); GameFileStateInfo ret; for (u32 i = 0; i < 128; i++) { - stream.ReadEncoded(8); + stream.ReadBits(8); } - ret.x14_timestamp = stream.ReadEncoded(32); + ret.x14_timestamp = stream.ReadBits(32); - ret.x20_hardMode = stream.ReadEncoded(1) != 0; - stream.ReadEncoded(1); - const CAssetId origMLVL = u32(stream.ReadEncoded(32)); + ret.x20_hardMode = stream.ReadBits(1) != 0; + stream.ReadBits(1); + const CAssetId origMLVL = u32(stream.ReadBits(32)); ret.x8_mlvlId = origMLVL; BitsToDouble conv; - conv.low = stream.ReadEncoded(32); - conv.high = stream.ReadEncoded(32); + conv.low = stream.ReadBits(32); + conv.high = stream.ReadBits(32); ret.x0_playTime = conv.doub; CPlayerState playerState(stream); @@ -122,7 +121,7 @@ CGameState::GameFileStateInfo CGameState::LoadGameFileState(const u8* data) { ret.xc_health = playerState.GetHealthInfo().GetHP(); u32 itemPercent; - if (origMLVL == 0x158EFE17) + if (origMLVL == 0x158EFE17u) itemPercent = 0; else itemPercent = playerState.CalculateItemCollectionRate() * 100 / playerState.GetPickupTotal(); @@ -148,24 +147,24 @@ CGameState::CGameState() { } } -CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx(saveIdx) { +CGameState::CGameState(CInputStream& stream, u32 saveIdx) : x20c_saveFileIdx(saveIdx) { x9c_transManager = std::make_shared(); x228_24_hardMode = false; x228_25_initPowerupsAtFirstSpawn = true; for (bool& value : x0_) { - value = stream.ReadEncoded(8) != 0; + value = stream.ReadBits(8) != 0; } - stream.ReadEncoded(32); + stream.ReadBits(32); - x228_24_hardMode = stream.ReadEncoded(1) != 0; - x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1) != 0; - x84_mlvlId = u32(stream.ReadEncoded(32)); + x228_24_hardMode = stream.ReadBits(1) != 0; + x228_25_initPowerupsAtFirstSpawn = stream.ReadBits(1) != 0; + x84_mlvlId = u32(stream.ReadBits(32)); MP1::CMain::EnsureWorldPakReady(x84_mlvlId); BitsToDouble conv; - conv.low = stream.ReadEncoded(32); - conv.high = stream.ReadEncoded(32); + conv.low = stream.ReadBits(32); + conv.high = stream.ReadBits(32); xa0_playTime = conv.doub; x98_playerState = std::make_shared(stream); @@ -185,7 +184,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx WriteBackupBuf(); } -void CGameState::ReadPersistentOptions(CBitStreamReader& r) { xa8_systemOptions = CPersistentOptions(r); } +void CGameState::ReadPersistentOptions(CInputStream& r) { xa8_systemOptions = r.Get(); } void CGameState::ImportPersistentOptions(const CPersistentOptions& opts) { if (opts.xd0_24_fusionLinked) @@ -212,24 +211,24 @@ void CGameState::ExportPersistentOptions(CPersistentOptions& opts) const { void CGameState::WriteBackupBuf() { x218_backupBuf.resize(940); - CBitStreamWriter w(x218_backupBuf.data(), 940); + CMemoryStreamOut w(x218_backupBuf.data(), 940); PutTo(w); } -void CGameState::PutTo(CBitStreamWriter& writer) { +void CGameState::PutTo(COutputStream& writer) { for (const bool value : x0_) { - writer.WriteEncoded(u32(value), 8); + writer.WriteBits(u32(value), 8); } - writer.WriteEncoded(CBasics::GetTime() / CBasics::TICKS_PER_SECOND, 32); - writer.WriteEncoded(x228_24_hardMode, 1); - writer.WriteEncoded(x228_25_initPowerupsAtFirstSpawn, 1); - writer.WriteEncoded(u32(x84_mlvlId.Value()), 32); + writer.WriteBits(CBasics::GetTime() / CBasics::TICKS_PER_SECOND, 32); + writer.WriteBits(x228_24_hardMode, 1); + writer.WriteBits(x228_25_initPowerupsAtFirstSpawn, 1); + writer.WriteBits(u32(x84_mlvlId.Value()), 32); BitsToDouble conv; conv.doub = xa0_playTime; - writer.WriteEncoded(conv.low, 32); - writer.WriteEncoded(conv.high, 32); + writer.WriteBits(conv.low, 32); + writer.WriteBits(conv.high, 32); x98_playerState->PutTo(writer); x17c_gameOptions.PutTo(writer); diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index 86bf1df80..a28719484 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -4,43 +4,106 @@ #include #include -#include "DataSpec/DNACommon/DNACommon.hpp" - +#include "Runtime/AutoMapper/CMapWorldInfo.hpp" #include "Runtime/CBasics.hpp" #include "Runtime/CGameOptions.hpp" #include "Runtime/CPlayerState.hpp" #include "Runtime/CScriptMailbox.hpp" -#include "Runtime/AutoMapper/CMapWorldInfo.hpp" #include "Runtime/World/CWorld.hpp" #include "Runtime/World/CWorldTransManager.hpp" namespace metaforce { class CSaveWorldMemory; +class WordBitmap { + std::vector x0_words; + size_t x10_bitCount = 0; + +public: + void Reserve(size_t bitCount) { x0_words.reserve((bitCount + 31) / 32); } + [[nodiscard]] size_t GetBitCount() const { return x10_bitCount; } + [[nodiscard]] bool GetBit(size_t idx) const { + size_t wordIdx = idx / 32; + if (wordIdx >= x0_words.size()) { + return false; + } + size_t wordCur = idx % 32; + return ((x0_words[wordIdx] >> wordCur) & 0x1) != 0u; + } + void SetBit(size_t idx) { + size_t wordIdx = idx / 32; + while (wordIdx >= x0_words.size()) { + x0_words.push_back(0); + } + size_t wordCur = idx % 32; + x0_words[wordIdx] |= (1 << wordCur); + x10_bitCount = std::max(x10_bitCount, idx + 1); + } + void UnsetBit(size_t idx) { + size_t wordIdx = idx / 32; + while (wordIdx >= x0_words.size()) { + x0_words.push_back(0); + } + size_t wordCur = idx % 32; + x0_words[wordIdx] &= ~(1 << wordCur); + x10_bitCount = std::max(x10_bitCount, idx + 1); + } + void Clear() { + x0_words.clear(); + x10_bitCount = 0; + } + + class Iterator { + friend class WordBitmap; + const WordBitmap& m_bmp; + size_t m_idx = 0; + Iterator(const WordBitmap& bmp, size_t idx) : m_bmp(bmp), m_idx(idx) {} + + public: + using iterator_category = std::forward_iterator_tag; + using value_type = bool; + using difference_type = std::ptrdiff_t; + using pointer = bool*; + using reference = bool&; + + Iterator& operator++() { + ++m_idx; + return *this; + } + bool operator*() const { return m_bmp.GetBit(m_idx); } + bool operator!=(const Iterator& other) const { return m_idx != other.m_idx; } + }; + [[nodiscard]] Iterator begin() const { return Iterator(*this, 0); } + [[nodiscard]] Iterator end() const { return Iterator(*this, x10_bitCount); } +}; + class CScriptLayerManager { friend class CSaveWorldIntermediate; std::vector x0_areaLayers; - DataSpec::WordBitmap x10_saveLayers; + WordBitmap x10_saveLayers; public: CScriptLayerManager() = default; - CScriptLayerManager(CBitStreamReader& reader, const CWorldSaveGameInfo& saveWorld); + CScriptLayerManager(CInputStream& reader, const CWorldSaveGameInfo& saveWorld); - bool IsLayerActive(int areaIdx, int layerIdx) const { return ((x0_areaLayers[areaIdx].m_layerBits >> layerIdx) & 1); } + [[nodiscard]] bool IsLayerActive(int areaIdx, int layerIdx) const { + return ((x0_areaLayers[areaIdx].m_layerBits >> layerIdx) & 1) != 0u; + } void SetLayerActive(int areaIdx, int layerIdx, bool active) { - if (active) + if (active) { x0_areaLayers[areaIdx].m_layerBits |= uint64_t(1) << layerIdx; - else + } else { x0_areaLayers[areaIdx].m_layerBits &= ~(uint64_t(1) << layerIdx); + } } void InitializeWorldLayers(const std::vector& layers); - u32 GetAreaLayerCount(int areaIdx) const { return x0_areaLayers[areaIdx].m_layerCount; } - u32 GetAreaCount() const { return x0_areaLayers.size(); } + [[nodiscard]] u32 GetAreaLayerCount(int areaIdx) const { return x0_areaLayers[areaIdx].m_layerCount; } + [[nodiscard]] u32 GetAreaCount() const { return x0_areaLayers.size(); } - void PutTo(CBitStreamWriter& writer) const; + void PutTo(COutputStream& writer) const; }; class CWorldState { @@ -53,7 +116,7 @@ class CWorldState { public: explicit CWorldState(CAssetId id); - CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CWorldSaveGameInfo& saveWorld); + CWorldState(CInputStream& reader, CAssetId mlvlId, const CWorldSaveGameInfo& saveWorld); CAssetId GetWorldAssetId() const { return x0_mlvlId; } void SetAreaId(TAreaId aid) { x4_areaId = aid; } TAreaId GetCurrentAreaId() const { return x4_areaId; } @@ -62,7 +125,7 @@ public: const std::shared_ptr& Mailbox() const { return x8_mailbox; } const std::shared_ptr& MapWorldInfo() const { return xc_mapWorldInfo; } const std::shared_ptr& GetLayerState() const { return x14_layerState; } - void PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw) const; + void PutTo(COutputStream& writer, const CWorldSaveGameInfo& savw) const; }; class CGameState { @@ -86,7 +149,7 @@ class CGameState { public: CGameState(); - CGameState(CBitStreamReader& stream, u32 saveIdx); + CGameState(CInputStream& stream, u32 saveIdx); void SetCurrentWorldId(CAssetId id); std::shared_ptr GetPlayerState() const { return x98_playerState; } std::shared_ptr GetWorldTransitionManager() const { return x9c_transManager; } @@ -100,7 +163,7 @@ public: CAssetId CurrentWorldAssetId() const { return x84_mlvlId; } void SetHardMode(bool v) { x228_24_hardMode = v; } bool GetHardMode() const { return x228_24_hardMode; } - void ReadPersistentOptions(CBitStreamReader& r); + void ReadPersistentOptions(CInputStream& r); void SetPersistentOptions(const CPersistentOptions& opts) { xa8_systemOptions = opts; } void ImportPersistentOptions(const CPersistentOptions& opts); void ExportPersistentOptions(CPersistentOptions& opts) const; @@ -111,7 +174,7 @@ public: void SetFileIdx(u32 idx) { x20c_saveFileIdx = idx; } void SetCardSerial(u64 serial) { x210_cardSerial = serial; } u64 GetCardSerial() const { return x210_cardSerial; } - void PutTo(CBitStreamWriter& writer); + void PutTo(COutputStream& writer); float GetHardModeDamageMultiplier() const; float GetHardModeWeaponMultiplier() const; void InitializeMemoryWorlds(); diff --git a/Runtime/CMain.cpp b/Runtime/CMain.cpp index 3a605cfd9..67b358741 100644 --- a/Runtime/CMain.cpp +++ b/Runtime/CMain.cpp @@ -3,11 +3,23 @@ #include #include +#ifdef WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include +#endif + #include "logvisor/logvisor.hpp" #include "ImGuiEngine.hpp" #include "Runtime/Graphics/CGraphics.hpp" #include "Runtime/MP1/MP1.hpp" +#include "Runtime/ConsoleVariables/FileStoreManager.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" #include "amuse/BooBackend.hpp" #include "../version.h" @@ -15,20 +27,10 @@ //#include //#pragma STDC FENV_ACCESS ON -/* Static reference to dataspec additions - * (used by MSVC to definitively link DataSpecs) */ -#include "DataSpecRegistry.hpp" - #include using namespace std::literals; -static logvisor::Module AthenaLog("Athena"); -static void AthenaExc(athena::error::Level level, const char* file, const char*, int line, fmt::string_view fmt, - fmt::format_args args) { - AthenaLog.vreport(logvisor::Level(level), fmt, args); -} - class Limiter { using delta_clock = std::chrono::high_resolution_clock; using duration_t = std::chrono::nanoseconds; @@ -158,7 +160,7 @@ private: // m_imguiCallback.resized(rect, sync); } - void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) override { + void mouseDown(const boo::SWindowCoord& coord, EMouseButton button, boo::EModifierKey mods) override { // if (!ImGuiWindowCallback::m_mouseCaptured && g_mainMP1) { // if (MP1::CGameArchitectureSupport* as = g_mainMP1->GetArchSupport()) { // as->mouseDown(coord, button, mods); @@ -167,7 +169,7 @@ private: // m_imguiCallback.mouseDown(coord, button, mods); } - void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) override { + void mouseUp(const boo::SWindowCoord& coord, EMouseButton button, boo::EModifierKey mods) override { if (g_mainMP1) { if (MP1::CGameArchitectureSupport* as = g_mainMP1->GetArchSupport()) { as->mouseUp(coord, button, mods); @@ -216,23 +218,23 @@ private: // m_imguiCallback.charKeyUp(charCode, mods); } - void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat) override { + void specialKeyDown(aurora::SpecialKey key, boo::EModifierKey mods, bool isRepeat) override { // if (!ImGuiWindowCallback::m_keyboardCaptured && g_mainMP1) { // if (MP1::CGameArchitectureSupport* as = g_mainMP1->GetArchSupport()) { // as->specialKeyDown(key, mods, isRepeat); // } // } // if (True(mods & boo::EModifierKey::Alt)) { - // if (key == boo::ESpecialKey::Enter) { + // if (key == aurora::SpecialKey::Enter) { // m_fullscreenToggleRequested = true; - // } else if (key == boo::ESpecialKey::F4) { + // } else if (key == aurora::SpecialKey::F4) { // m_windowInvalid = true; // } // } // m_imguiCallback.specialKeyDown(key, mods, isRepeat); } - void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods) override { + void specialKeyUp(aurora::SpecialKey key, boo::EModifierKey mods) override { // if (g_mainMP1) { // if (MP1::CGameArchitectureSupport* as = g_mainMP1->GetArchSupport()) { // as->specialKeyUp(key, mods); @@ -247,9 +249,9 @@ private: struct Application : aurora::AppDelegate { private: - hecl::Runtime::FileStoreManager& m_fileMgr; - hecl::CVarManager& m_cvarManager; - hecl::CVarCommons& m_cvarCommons; + FileStoreManager& m_fileMgr; + CVarManager& m_cvarManager; + CVarCommons& m_cvarCommons; ImGuiConsole m_imGuiConsole; std::string m_errorString; @@ -271,10 +273,10 @@ private: // is built, i.e during initialization public: - Application(hecl::Runtime::FileStoreManager& fileMgr, hecl::CVarManager& cvarMgr, hecl::CVarCommons& cvarCmns) + Application(FileStoreManager& fileMgr, CVarManager& cvarMgr, CVarCommons& cvarCmns) : m_fileMgr(fileMgr), m_cvarManager(cvarMgr), m_cvarCommons(cvarCmns), m_imGuiConsole(cvarMgr, cvarCmns) {} - void onAppLaunched() override { + void onAppLaunched() noexcept override { initialize(); auto backend = static_cast(aurora::get_backend_string()); @@ -300,10 +302,6 @@ public: for (const auto& str : aurora::get_args()) { auto arg = static_cast(str); - if (arg.starts_with("--verbosity=") || arg.starts_with("-v=")) { - hecl::VerbosityLevel = atoi(arg.substr(arg.find_last_of('=') + 1).c_str()); - hecl::LogModule.report(logvisor::Info, FMT_STRING("Set verbosity level to {}"), hecl::VerbosityLevel); - } } const zeus::CPUInfo& cpuInf = zeus::cpuFeatures(); @@ -545,9 +543,6 @@ public: } // namespace metaforce -static char CwdBuf[1024]; -std::string ExeDir; - static void SetupBasics(bool logging) { auto result = zeus::validateCPU(); if (!result.first) { @@ -566,19 +561,20 @@ static void SetupBasics(bool logging) { logvisor::RegisterStandardExceptions(); if (logging) logvisor::RegisterConsoleLogger(); - atSetExceptionHandler(AthenaExc); #if SENTRY_ENABLED - hecl::Runtime::FileStoreManager fileMgr{"sentry-native-metaforce"}; + FileStoreManager fileMgr{"sentry-native-metaforce"}; std::string cacheDir{fileMgr.getStoreRoot()}; logvisor::RegisterSentry("metaforce", METAFORCE_WC_DESCRIBE, cacheDir.c_str()); #endif } static bool IsClientLoggingEnabled(int argc, char** argv) { - for (int i = 1; i < argc; ++i) - if (!hecl::StrNCmp(argv[i], "-l", 2)) + for (int i = 1; i < argc; ++i) { + if (!strncmp(argv[i], "-l", 2)) { return true; + } + } return false; } @@ -588,15 +584,15 @@ int main(int argc, char** argv) { // but breaks animations, need to research why this is the case // for now it's disabled // fesetround(FE_TOWARDZERO); - if (argc > 1 && !hecl::StrCmp(argv[1], "--dlpackage")) { + if (argc > 1 && !strcmp(argv[1], "--dlpackage")) { fmt::print(FMT_STRING("{}\n"), METAFORCE_DLPACKAGE); return 100; } SetupBasics(IsClientLoggingEnabled(argc, argv)); - hecl::Runtime::FileStoreManager fileMgr{"metaforce"}; - hecl::CVarManager cvarMgr{fileMgr}; - hecl::CVarCommons cvarCmns{cvarMgr}; + metaforce::FileStoreManager fileMgr{"metaforce"}; + metaforce::CVarManager cvarMgr{fileMgr}; + metaforce::CVarCommons cvarCmns{cvarMgr}; std::vector args; for (int i = 1; i < argc; ++i) @@ -613,18 +609,6 @@ int main(int argc, char** argv) { logvisor::RegisterFileLogger(logFilePath.c_str()); } - if (char* cwd = hecl::Getcwd(CwdBuf, 1024)) { - if (hecl::PathRelative(argv[0])) - ExeDir = std::string(cwd) + '/'; - std::string Argv0(argv[0]); - std::string::size_type lastIdx = Argv0.find_last_of("/\\"); - if (lastIdx != std::string::npos) - ExeDir.insert(ExeDir.end(), Argv0.begin(), Argv0.begin() + lastIdx); - } - - /* Handle -j argument */ - hecl::SetCpuCountOverride(argc, argv); - auto app = std::make_unique(fileMgr, cvarMgr, cvarCmns); auto icon = metaforce::GetIcon(); auto data = aurora::Icon{ diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index 7c3042c65..3b09a7552 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -70,9 +70,33 @@ set(RUNTIME_SOURCES_B ${PARTICLE_SOURCES} ${WORLD_SOURCES} ${WEAPON_SOURCES} - ITweak.hpp + ConsoleVariables/FileStoreManager.hpp ConsoleVariables/FileStoreManager.cpp + ConsoleVariables/CVar.hpp ConsoleVariables/CVar.cpp + ConsoleVariables/CVarManager.hpp ConsoleVariables/CVarManager.cpp + ConsoleVariables/CVarCommons.hpp ConsoleVariables/CVarCommons.cpp + Tweaks/ITweak.hpp + Tweaks/ITweakAutoMapper.hpp + Tweaks/ITweakBall.hpp + Tweaks/ITweakGame.hpp + Tweaks/ITweakGui.hpp + Tweaks/ITweakGuiColors.hpp + Tweaks/ITweakGunRes.hpp + Tweaks/ITweakParticle.hpp + Tweaks/ITweakPlayer.hpp + Tweaks/ITweakPlayerControl.hpp + Tweaks/ITweakPlayerGun.hpp Tweaks/ITweakPlayerGun.cpp + Tweaks/ITweakPlayerRes.hpp + Tweaks/ITweakSlideShow.hpp + Tweaks/ITweakTargeting.hpp IMain.hpp CStopwatch.hpp + Streams/IOStreams.hpp Streams/IOStreams.cpp + Streams/CMemoryStreamOut.hpp Streams/CMemoryStreamOut.cpp + Streams/CInputStream.hpp Streams/CInputStream.cpp + Streams/COutputStream.hpp Streams/COutputStream.cpp + Streams/CMemoryInStream.hpp + Streams/CZipInputStream.hpp Streams/CZipInputStream.cpp + Streams/ContainerReaders.hpp CGameAllocator.hpp CGameAllocator.cpp CMemoryCardSys.hpp CMemoryCardSys.cpp CScannableObjectInfo.hpp CScannableObjectInfo.cpp @@ -109,8 +133,7 @@ set(RUNTIME_SOURCES_B CToken.hpp CToken.cpp CFactoryMgr.hpp CFactoryMgr.cpp CPakFile.hpp CPakFile.cpp - CStringExtras.hpp - IOStreams.hpp IOStreams.cpp + CStringExtras.hpp CStringExtras.cpp CMainFlowBase.hpp CMainFlowBase.cpp CMFGameBase.hpp CInGameTweakManagerBase.hpp @@ -125,6 +148,7 @@ set(RUNTIME_SOURCES_B function(add_runtime_common_library name) add_library(${name} ${ARGN}) + target_compile_definitions(${name} PUBLIC "-DMETAFORCE_TARGET_BYTE_ORDER=__BYTE_ORDER__") if (COMMAND add_sanitizers) add_sanitizers(${name}) endif () @@ -134,9 +158,8 @@ function(add_runtime_common_library name) endif () endfunction() -set(RUNTIME_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -set(RUNTIME_LIBRARIES ${HECL_APPLICATION_REPS_TARGETS_LIST} RetroDataSpec AssetNameMapNull NESEmulator - libjpeg-turbo jbus kabufuda discord-rpc logvisor OptickCore imgui aurora SDL2-static) +set(RUNTIME_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) +set(RUNTIME_LIBRARIES amuse zeus nod NESEmulator libjpeg-turbo jbus kabufuda discord-rpc logvisor OptickCore imgui aurora SDL2-static) add_runtime_common_library(RuntimeCommon ${RUNTIME_SOURCES_A}) target_include_directories(RuntimeCommon PUBLIC ${RUNTIME_INCLUDES}) @@ -209,13 +232,14 @@ add_executable(metaforce CMain.cpp ${PLAT_SRCS} ImGuiConsole.hpp ImGuiConsole.cp # target_atdna(metaforce atdna_ImGuiPlayerLoadouts.cpp ImGuiPlayerLoadouts.hpp) # RUNTIME_LIBRARIES repeated here for link ordering target_link_libraries(metaforce PUBLIC RuntimeCommon RuntimeCommonB ${RUNTIME_LIBRARIES} ${PLAT_LIBS}) +target_compile_definitions(metaforce PUBLIC "-DMETAFORCE_TARGET_BYTE_ORDER=__BYTE_ORDER__") if (COMMAND add_sanitizers) add_sanitizers(metaforce) endif () if (NOT WINDOWS_STORE) - add_dependencies(metaforce hecl) # visigen + #add_dependencies(metaforce hecl) # visigen else () set_property(TARGET metaforce PROPERTY VS_WINRT_COMPONENT TRUE) # This should match the Package.appxmanifest diff --git a/Runtime/CMayaSpline.cpp b/Runtime/CMayaSpline.cpp index 1802c2edc..583877a01 100644 --- a/Runtime/CMayaSpline.cpp +++ b/Runtime/CMayaSpline.cpp @@ -1,6 +1,6 @@ -#include "CMayaSpline.hpp" +#include "Runtime/CMayaSpline.hpp" -namespace rstl {} // namespace rstl +#include "Runtime/Streams/CInputStream.hpp" namespace metaforce { void ValidateTangent(zeus::CVector2f& tangent) { @@ -21,19 +21,19 @@ void ValidateTangent(zeus::CVector2f& tangent) { } CMayaSplineKnot::CMayaSplineKnot(CInputStream& in) { - x0_time = in.readFloatBig(); - x4_amplitude = in.readFloatBig(); - x8_ = in.readByte(); - x9_ = in.readByte(); + x0_time = in.ReadFloat(); + x4_amplitude = in.ReadFloat(); + x8_ = in.ReadInt8(); + x9_ = in.ReadInt8(); if (x8_ == 5) { - float x = in.readFloatBig(); - float y = in.readFloatBig(); + float x = in.ReadFloat(); + float y = in.ReadFloat(); xc_cachedTangentA = {x, y}; } if (x9_ == 5) { - float x = in.readFloatBig(); - float y = in.readFloatBig(); + float x = in.ReadFloat(); + float y = in.ReadFloat(); x14_cachedTangentB = {x, y}; } } @@ -166,17 +166,16 @@ void CMayaSplineKnot::CalculateTangents(CMayaSplineKnot* prev, CMayaSplineKnot* ValidateTangent(x14_cachedTangentB); } -CMayaSpline::CMayaSpline(CInputStream& in, s32 count) { - x0_preInfinity = in.readByte(); - x4_postInfinity = in.readByte(); - u32 knotCount = in.readUint32Big(); +CMayaSpline::CMayaSpline(CInputStream& in, s32 count) : x0_preInfinity(in.ReadInt8()), x4_postInfinity(in.ReadInt8()) { + + u32 knotCount = in.ReadLong(); x8_knots.reserve(knotCount); for (size_t i = 0; i < knotCount; ++i) { x8_knots.emplace_back(in); } - x18_clampMode = in.readByte(); - x1c_minAmplitudeTime = in.readFloatBig(); - x20_maxAmplitudeTime = in.readFloatBig(); + x18_clampMode = in.ReadInt8(); + x1c_minAmplitudeTime = in.ReadFloat(); + x20_maxAmplitudeTime = in.ReadFloat(); } float CMayaSpline::GetMinTime() const { return x8_knots.empty() ? 0.f : x8_knots[0].GetTime(); } diff --git a/Runtime/CMemoryCardSys.cpp b/Runtime/CMemoryCardSys.cpp index 9ae7656d1..6b29b12cf 100644 --- a/Runtime/CMemoryCardSys.cpp +++ b/Runtime/CMemoryCardSys.cpp @@ -6,8 +6,8 @@ #include "Runtime/GameGlobalObjects.hpp" #include "Runtime/Graphics/CTexture.hpp" #include "Runtime/GuiSys/CStringTable.hpp" -#include -#include +#include "ConsoleVariables/CVar.hpp" +#include "ConsoleVariables/CVarManager.hpp" namespace metaforce { namespace { @@ -16,8 +16,8 @@ using ECardResult = kabufuda::ECardResult; static std::string g_CardImagePaths[2] = {}; static kabufuda::Card g_CardStates[2] = {kabufuda::Card{"GM8E", "01"}, kabufuda::Card{"GM8E", "01"}}; // static kabufuda::ECardResult g_OpResults[2] = {}; -hecl::CVar* mc_dolphinAPath = nullptr; -hecl::CVar* mc_dolphinBPath = nullptr; +CVar* mc_dolphinAPath = nullptr; +CVar* mc_dolphinBPath = nullptr; } // namespace CSaveWorldIntermediate::CSaveWorldIntermediate(CAssetId mlvl, CAssetId savw) : x0_mlvlId(mlvl), x8_savwId(savw) { if (!savw.IsValid()) @@ -71,12 +71,12 @@ const CSaveWorldMemory& CMemoryCardSys::GetSaveWorldMemory(CAssetId wldId) const } CMemoryCardSys::CMemoryCardSys() { - mc_dolphinAPath = hecl::CVarManager::instance()->findOrMakeCVar( + mc_dolphinAPath = CVarManager::instance()->findOrMakeCVar( "memcard.PathA"sv, "Path to the memory card image for SlotA"sv, ""sv, - (hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::System | hecl::CVar::EFlags::ModifyRestart)); - mc_dolphinBPath = hecl::CVarManager::instance()->findOrMakeCVar( + (CVar::EFlags::Archive | CVar::EFlags::System | CVar::EFlags::ModifyRestart)); + mc_dolphinBPath = CVarManager::instance()->findOrMakeCVar( "memcard.PathB"sv, "Path to the memory card image for SlotB"sv, ""sv, - (hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::System | hecl::CVar::EFlags::ModifyRestart)); + (CVar::EFlags::Archive | CVar::EFlags::System | CVar::EFlags::ModifyRestart)); x0_hints = g_SimplePool->GetObj("HINT_Hints"); xc_memoryWorlds.reserve(16); x1c_worldInter.emplace(); @@ -215,22 +215,22 @@ void CMemoryCardSys::CCardFileInfo::BuildCardBuffer() { u32 bannerSz = CalculateBannerDataSize(); x104_cardBuffer.resize((bannerSz + xf4_saveBuffer.size() + 8191) & ~8191); - CMemoryOutStream w(x104_cardBuffer.data(), x104_cardBuffer.size()); - w.writeUint32Big(0); + CMemoryStreamOut w(x104_cardBuffer.data(), x104_cardBuffer.size(), CMemoryStreamOut::EOwnerShip::NotOwned); + w.WriteLong(0); char comment[64]; std::memset(comment, 0, std::size(comment)); std::strncpy(comment, x28_comment.data(), std::size(comment) - 1); - w.writeBytes(comment, 64); + w.Write(reinterpret_cast(comment), 64); WriteBannerData(w); WriteIconData(w); memmove(x104_cardBuffer.data() + bannerSz, xf4_saveBuffer.data(), xf4_saveBuffer.size()); reinterpret_cast(*x104_cardBuffer.data()) = - hecl::SBig(CCRC32::Calculate(x104_cardBuffer.data() + 4, x104_cardBuffer.size() - 4)); + CBasics::SwapBytes(CCRC32::Calculate(x104_cardBuffer.data() + 4, x104_cardBuffer.size() - 4)); xf4_saveBuffer.clear(); } -void CMemoryCardSys::CCardFileInfo::WriteBannerData(CMemoryOutStream& out) const { +void CMemoryCardSys::CCardFileInfo::WriteBannerData(COutputStream& out) const { if (x3c_bannerTex.IsValid()) { const TLockedToken& tex = *x40_bannerTok; u32 bufSz; @@ -239,16 +239,16 @@ void CMemoryCardSys::CCardFileInfo::WriteBannerData(CMemoryOutStream& out) const std::unique_ptr texels = tex->BuildMemoryCardTex(bufSz, fmt, palette); if (fmt == ETexelFormat::RGB5A3) - out.writeBytes(texels.get(), 6144); + out.Write(texels.get(), 6144); else - out.writeBytes(texels.get(), 3072); + out.Write(texels.get(), 3072); if (fmt == ETexelFormat::C8) - out.writeBytes(palette.get(), 512); + out.Write(palette.get(), 512); } } -void CMemoryCardSys::CCardFileInfo::WriteIconData(CMemoryOutStream& out) const { +void CMemoryCardSys::CCardFileInfo::WriteIconData(COutputStream& out) const { std::unique_ptr palette; for (const Icon& icon : x50_iconToks) { u32 bufSz; @@ -256,12 +256,12 @@ void CMemoryCardSys::CCardFileInfo::WriteIconData(CMemoryOutStream& out) const { std::unique_ptr texels = icon.x8_tex->BuildMemoryCardTex(bufSz, fmt, palette); if (fmt == ETexelFormat::RGB5A3) - out.writeBytes(texels.get(), 2048); + out.Write(texels.get(), 2048); else - out.writeBytes(texels.get(), 1024); + out.Write(texels.get(), 1024); } if (palette) - out.writeBytes(palette.get(), 512); + out.Write(palette.get(), 512); } ECardResult CMemoryCardSys::CCardFileInfo::PumpCardTransfer() { @@ -340,7 +340,7 @@ std::string CMemoryCardSys::_GetDolphinCardPath(kabufuda::ECardSlot slot) { return g_CardImagePaths[static_cast(slot)]; } -void CMemoryCardSys::_ResolveDolphinCardPath(const hecl::CVar* cv, kabufuda::ECardSlot slot) { +void CMemoryCardSys::_ResolveDolphinCardPath(const CVar* cv, kabufuda::ECardSlot slot) { if (cv != nullptr && cv->toLiteral().empty()) { g_CardImagePaths[int(slot)] = ResolveDolphinCardPath(slot); } else if (cv != nullptr) { diff --git a/Runtime/CMemoryCardSys.hpp b/Runtime/CMemoryCardSys.hpp index 6c99bf540..8be8ddba1 100644 --- a/Runtime/CMemoryCardSys.hpp +++ b/Runtime/CMemoryCardSys.hpp @@ -6,11 +6,12 @@ #include #include "Runtime/CGameHintInfo.hpp" -#include "Runtime/CWorldSaveGameInfo.hpp" +#include "Runtime/Streams/CMemoryStreamOut.hpp" #include "Runtime/CToken.hpp" -#include "Runtime/rstl.hpp" +#include "Runtime/CWorldSaveGameInfo.hpp" #include "Runtime/GuiSys/CStringTable.hpp" #include "Runtime/World/CWorld.hpp" +#include "Runtime/rstl.hpp" #include @@ -68,7 +69,7 @@ class CMemoryCardSys { public: static void _ResetCVar(kabufuda::ECardSlot slot); - static void _ResolveDolphinCardPath(const hecl::CVar* cv, kabufuda::ECardSlot slot); + static void _ResolveDolphinCardPath(const CVar* cv, kabufuda::ECardSlot slot); static std::string ResolveDolphinCardPath(kabufuda::ECardSlot slot); static bool CreateDolphinCard(kabufuda::ECardSlot slot); static std::string _GetDolphinCardPath(kabufuda::ECardSlot slot); @@ -137,13 +138,13 @@ public: void LockBannerToken(CAssetId bannerTxtr, CSimplePool& sp); void LockIconToken(CAssetId iconTxtr, kabufuda::EAnimationSpeed speed, CSimplePool& sp); - kabufuda::ECardSlot GetCardPort() const { return m_handle.slot; } - int GetFileNo() const { return m_handle.getFileNo(); } - u32 CalculateBannerDataSize() const; - u32 CalculateTotalDataSize() const; + [[nodiscard]] kabufuda::ECardSlot GetCardPort() const { return m_handle.slot; } + [[nodiscard]] int GetFileNo() const { return m_handle.getFileNo(); } + [[nodiscard]] u32 CalculateBannerDataSize() const; + [[nodiscard]] u32 CalculateTotalDataSize() const; void BuildCardBuffer(); - void WriteBannerData(CMemoryOutStream& out) const; - void WriteIconData(CMemoryOutStream& out) const; + void WriteBannerData(COutputStream& out) const; + void WriteIconData(COutputStream& out) const; void SetComment(const std::string& c) { x28_comment = c; } ECardResult PumpCardTransfer(); ECardResult GetStatus(CardStat& stat) const; @@ -151,9 +152,9 @@ public: ECardResult WriteFile(); ECardResult CloseFile(); - CMemoryOutStream BeginMemoryOut(u32 sz) { + CMemoryStreamOut BeginMemoryOut(u32 sz) { xf4_saveBuffer.resize(sz); - return CMemoryOutStream(xf4_saveBuffer.data(), sz); + return CMemoryStreamOut(xf4_saveBuffer.data(), sz, CMemoryStreamOut::EOwnerShip::NotOwned, sz); } }; diff --git a/Runtime/CMemoryCardSysNix.cpp b/Runtime/CMemoryCardSysNix.cpp index c7ff75db6..6e0e26a9c 100644 --- a/Runtime/CMemoryCardSysNix.cpp +++ b/Runtime/CMemoryCardSysNix.cpp @@ -2,28 +2,43 @@ #include "Runtime/GameGlobalObjects.hpp" #include "Runtime/IMain.hpp" +#include + namespace metaforce { +static std::optional GetPrefPath(const char* app) { + char* path = SDL_GetPrefPath(nullptr, app); + if (path == nullptr) { + return {}; + } + std::string str{path}; + SDL_free(path); + return str; +} + std::string CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot) { if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { - const char* home = getenv("HOME"); - if (!home || home[0] != '/') + const auto dolphinPath = GetPrefPath("dolphin-emu"); + if (!dolphinPath) { return {}; - const char* dataHome = getenv("XDG_DATA_HOME"); + } + auto path = *dolphinPath; + path += fmt::format(FMT_STRING("GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B'); - /* XDG-selected data path */ - std::string path = - ((dataHome && dataHome[0] == '/') ? dataHome : std::string(home)) + "/.local/share/dolphin-emu"; - path += fmt::format(FMT_STRING("/GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B'); - - hecl::Sstat theStat; - if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode)) { + struct stat64 theStat {}; + if (stat64(path.c_str(), &theStat) != 0 || !S_ISREG(theStat.st_mode)) { /* legacy case for older dolphin versions */ + const char* home = getenv("HOME"); + if (home == nullptr || home[0] != '/') { + return {}; + } + path = home; path += fmt::format(FMT_STRING("/.dolphin-emu/GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B'); - if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode)) + if (stat64(path.c_str(), &theStat) != 0 || !S_ISREG(theStat.st_mode)) { return {}; + } } return path; @@ -34,33 +49,39 @@ std::string CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot) { std::string CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot slot, bool dolphin) { if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { if (dolphin) { - const char* home = getenv("HOME"); - if (!home || home[0] != '/') + const auto dolphinPath = GetPrefPath("dolphin-emu"); + if (!dolphinPath) { return {}; - const char* dataHome = getenv("XDG_DATA_HOME"); - - /* XDG-selected data path */ - std::string path = - ((dataHome && dataHome[0] == '/') ? dataHome : std::string(home)) + "/.local/share/dolphin-emu/GC"; - - if (hecl::RecursiveMakeDir(path.c_str()) < 0) + } + auto path = *dolphinPath + "GC"; + int ret = mkdir(path.c_str(), 0755); + if (ret != 0 && ret != EEXIST) { return {}; + } path += fmt::format(FMT_STRING("/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B'); - const auto fp = hecl::FopenUnique(path.c_str(), "wb"); - if (fp != nullptr) { + auto* file = fopen(path.c_str(), "wbe"); + if (file != nullptr) { + fclose(file); return path; } } else { std::string path = _GetDolphinCardPath(slot); - hecl::SanitizePath(path); if (path.find('/') == std::string::npos) { - path = hecl::GetcwdStr() + "/" + _GetDolphinCardPath(slot); + auto basePath = GetPrefPath("metaforce"); + if (!basePath) { + return {}; + } + path = *basePath + _GetDolphinCardPath(slot); } - std::string tmpPath = path.substr(0, path.find_last_of("/")); - hecl::RecursiveMakeDir(tmpPath.c_str()); - const auto fp = hecl::FopenUnique(path.c_str(), "wb"); - if (fp) { + std::string tmpPath = path.substr(0, path.find_last_of('/')); + int ret = mkdir(tmpPath.c_str(), 0755); + if (ret != 0 && ret != EEXIST) { + return {}; + } + auto* file = fopen(path.c_str(), "wbe"); + if (file != nullptr) { + fclose(file); return path; } } diff --git a/Runtime/CMemoryCardSysWin.cpp b/Runtime/CMemoryCardSysWin.cpp index 3fba93526..fc5d68191 100644 --- a/Runtime/CMemoryCardSysWin.cpp +++ b/Runtime/CMemoryCardSysWin.cpp @@ -2,11 +2,23 @@ #include "Runtime/GameGlobalObjects.hpp" #include "Runtime/IMain.hpp" +#include "Runtime/CBasics.hpp" -#include +#include +#include namespace metaforce { +static std::optional GetPrefPath(const char* app) { + char* path = SDL_GetPrefPath(nullptr, app); + if (path == nullptr) { + return {}; + } + std::string str{path}; + SDL_free(path); + return str; +} + #if WINDOWS_STORE using namespace Windows::Storage; #endif @@ -53,8 +65,8 @@ std::string CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot) { path += fmt::format(FMT_STRING("/GC/MemoryCard{}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B'); - hecl::Sstat theStat; - if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode)) + struct _stat64 theStat{}; + if (_stat64(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode)) return {}; return path; @@ -101,26 +113,33 @@ std::string CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot slot, bool do #endif path += "/GC"; - if (hecl::RecursiveMakeDir(path.c_str()) < 0) + if (CBasics::RecursiveMakeDir(path.c_str()) < 0) return {}; path += fmt::format(FMT_STRING("/MemoryCard{}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B'); - const auto fp = hecl::FopenUnique(path.c_str(), "wb"); + const nowide::wstackstring wpath(path); + FILE* fp = _wfopen(wpath.get(), L"wb"); if (fp == nullptr) { return {}; } + fclose(fp); return path; } else { std::string path = _GetDolphinCardPath(slot); - hecl::SanitizePath(path); if (path.find('/') == std::string::npos) { - path = hecl::GetcwdStr() + "/" + _GetDolphinCardPath(slot); + auto prefPath = GetPrefPath("Metaforce"); + if (!prefPath) { + return {}; + } + path = *prefPath + _GetDolphinCardPath(slot); } - std::string tmpPath = path.substr(0, path.find_last_of("/")); - hecl::RecursiveMakeDir(tmpPath.c_str()); - const auto fp = hecl::FopenUnique(path.c_str(), "wb"); + std::string tmpPath = path.substr(0, path.find_last_of('/')); + CBasics::RecursiveMakeDir(tmpPath.c_str()); + const nowide::wstackstring wpath(path); + FILE* fp = _wfopen(wpath.get(), L"wb"); if (fp) { + fclose(fp); return path; } } diff --git a/Runtime/CPakFile.cpp b/Runtime/CPakFile.cpp index 3555ceffa..ba921a4b6 100644 --- a/Runtime/CPakFile.cpp +++ b/Runtime/CPakFile.cpp @@ -26,19 +26,19 @@ const SObjectTag* CPakFile::GetResIdByName(std::string_view name) const { return nullptr; } -void CPakFile::LoadResourceTable(athena::io::MemoryReader& r) { +void CPakFile::LoadResourceTable(CInputStream& r) { x74_resList.reserve( std::max(size_t(64), size_t(ROUND_UP_32(x4c_resTableCount * sizeof(SResInfo)) + sizeof(SResInfo) - 1)) / sizeof(SResInfo)); if (x28_24_buildDepList) x64_depList.reserve(x4c_resTableCount); for (u32 i = 0; i < x4c_resTableCount; ++i) { - u32 flags = r.readUint32Big(); + u32 flags = r.ReadLong(); FourCC fcc; - r.readBytesToBuf(&fcc, 4); - CAssetId id = r.readUint32Big(); - u32 size = r.readUint32Big(); - u32 offset = r.readUint32Big(); + r.ReadBytes(reinterpret_cast(&fcc), 4); + CAssetId id = r.Get(); + u32 size = r.ReadLong(); + u32 offset = r.ReadLong(); if (fcc == FOURCC('MLVL')) m_mlvlId = id; x74_resList.emplace_back(id, fcc, offset, size, flags); @@ -50,7 +50,8 @@ void CPakFile::LoadResourceTable(athena::io::MemoryReader& r) { void CPakFile::DataLoad() { x30_dvdReq.reset(); - athena::io::MemoryReader r(x38_headerData.data() + x48_resTableOffset, x38_headerData.size() - x48_resTableOffset); + CMemoryInStream r(x38_headerData.data() + x48_resTableOffset, x38_headerData.size() - x48_resTableOffset, + CMemoryInStream::EOwnerShip::NotOwned); LoadResourceTable(r); x2c_asyncLoadPhase = EAsyncPhase::Loaded; if (x28_26_worldPak) { @@ -60,9 +61,9 @@ void CPakFile::DataLoad() { } void CPakFile::InitialHeaderLoad() { - athena::io::MemoryReader r(x38_headerData.data(), x38_headerData.size()); + CMemoryInStream r(x38_headerData.data(), x38_headerData.size(), CMemoryInStream::EOwnerShip::NotOwned); x30_dvdReq.reset(); - u32 version = r.readUint32Big(); + u32 version = r.ReadLong(); if (version != 0x00030005) { Log.report(logvisor::Fatal, FMT_STRING("{}: Incompatible pak file version -- Current version is {:08X}, you're using {:08X}"), @@ -70,18 +71,17 @@ void CPakFile::InitialHeaderLoad() { return; } - r.readUint32Big(); - u32 nameCount = r.readUint32Big(); + r.ReadLong(); + u32 nameCount = r.ReadLong(); x54_nameList.reserve(nameCount); for (u32 i = 0; i < nameCount; ++i) { SObjectTag tag(r); - u32 nameLen = r.readUint32Big(); - auto name = r.readString(nameLen); + auto name = CStringExtras::ReadString(r); x54_nameList.emplace_back(name, tag); } - x4c_resTableCount = r.readUint32Big(); - x48_resTableOffset = u32(r.position()); + x4c_resTableCount = r.ReadLong(); + x48_resTableOffset = u32(r.GetReadPosition()); x2c_asyncLoadPhase = EAsyncPhase::DataLoad; u32 newSize = ROUND_UP_32(x4c_resTableCount * 20 + x48_resTableOffset); u32 origSize = u32(x38_headerData.size()); diff --git a/Runtime/CPakFile.hpp b/Runtime/CPakFile.hpp index a0804e076..01119b1d7 100644 --- a/Runtime/CPakFile.hpp +++ b/Runtime/CPakFile.hpp @@ -57,7 +57,7 @@ private: std::vector x74_resList; mutable s32 x84_currentSeek = -1; CAssetId m_mlvlId; - void LoadResourceTable(athena::io::MemoryReader& r); + void LoadResourceTable(CInputStream& r); void DataLoad(); void InitialHeaderLoad(); void Warmup(); diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index 2f263e1d6..e19fd9d1d 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -7,7 +7,7 @@ #include "Runtime/CMemoryCardSys.hpp" #include "Runtime/CStateManager.hpp" #include "Runtime/GameGlobalObjects.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Camera/CCameraManager.hpp" #include "Runtime/Camera/CFirstPersonCamera.hpp" #include "TCastTo.hpp" // Generated file, do not modify include path @@ -76,63 +76,63 @@ constexpr std::array ComboAmmoPeriods{ CPlayerState::CPlayerState() { x24_powerups.resize(41); } -CPlayerState::CPlayerState(CBitStreamReader& stream) { - x4_enabledItems = u32(stream.ReadEncoded(32)); +CPlayerState::CPlayerState(CInputStream& stream) { + x4_enabledItems = u32(stream.ReadBits(32)); - const u32 integralHP = u32(stream.ReadEncoded(32)); + const u32 integralHP = u32(stream.ReadBits(32)); float realHP; std::memcpy(&realHP, &integralHP, sizeof(float)); xc_health.SetHP(realHP); - x8_currentBeam = EBeamId(stream.ReadEncoded(CBitStreamReader::GetBitCount(5))); - x20_currentSuit = EPlayerSuit(stream.ReadEncoded(CBitStreamReader::GetBitCount(4))); + x8_currentBeam = EBeamId(stream.ReadBits(CInputStream::GetBitCount(5))); + x20_currentSuit = EPlayerSuit(stream.ReadBits(CInputStream::GetBitCount(4))); x24_powerups.resize(41); for (size_t i = 0; i < x24_powerups.size(); ++i) { if (PowerUpMaxValues[i] == 0) { continue; } - const u32 a = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(PowerUpMaxValues[i]))); - const u32 b = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(PowerUpMaxValues[i]))); + const u32 a = u32(stream.ReadBits(CInputStream::GetBitCount(PowerUpMaxValues[i]))); + const u32 b = u32(stream.ReadBits(CInputStream::GetBitCount(PowerUpMaxValues[i]))); x24_powerups[i] = CPowerUp(a, b); } const auto& scanStates = g_MemoryCardSys->GetScanStates(); x170_scanTimes.reserve(scanStates.size()); for (const auto& state : scanStates) { - float time = stream.ReadEncoded(1) ? 1.f : 0.f; + float time = stream.ReadBits(1) ? 1.f : 0.f; x170_scanTimes.emplace_back(state.first, time); } - x180_scanCompletionRate.first = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(0x100u))); - x180_scanCompletionRate.second = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(0x100u))); + x180_scanCompletionRate.first = u32(stream.ReadBits(CInputStream::GetBitCount(0x100u))); + x180_scanCompletionRate.second = u32(stream.ReadBits(CInputStream::GetBitCount(0x100u))); } -void CPlayerState::PutTo(CBitStreamWriter& stream) { - stream.WriteEncoded(x4_enabledItems, 32); +void CPlayerState::PutTo(COutputStream& stream) { + stream.WriteBits(x4_enabledItems, 32); const float realHP = xc_health.GetHP(); u32 integralHP; std::memcpy(&integralHP, &realHP, sizeof(u32)); - stream.WriteEncoded(integralHP, 32); - stream.WriteEncoded(u32(x8_currentBeam), CBitStreamWriter::GetBitCount(5)); - stream.WriteEncoded(u32(x20_currentSuit), CBitStreamWriter::GetBitCount(4)); + stream.WriteBits(integralHP, 32); + stream.WriteBits(u32(x8_currentBeam), COutputStream::GetBitCount(5)); + stream.WriteBits(u32(x20_currentSuit), COutputStream::GetBitCount(4)); for (size_t i = 0; i < x24_powerups.size(); ++i) { const CPowerUp& pup = x24_powerups[i]; - stream.WriteEncoded(pup.x0_amount, CBitStreamWriter::GetBitCount(PowerUpMaxValues[i])); - stream.WriteEncoded(pup.x4_capacity, CBitStreamWriter::GetBitCount(PowerUpMaxValues[i])); + stream.WriteBits(pup.x0_amount, COutputStream::GetBitCount(PowerUpMaxValues[i])); + stream.WriteBits(pup.x4_capacity, COutputStream::GetBitCount(PowerUpMaxValues[i])); } for (const auto& scanTime : x170_scanTimes) { if (scanTime.second >= 1.f) - stream.WriteEncoded(true, 1); + stream.WriteBits(true, 1); else - stream.WriteEncoded(false, 1); + stream.WriteBits(false, 1); } - stream.WriteEncoded(x180_scanCompletionRate.first, CBitStreamWriter::GetBitCount(0x100)); - stream.WriteEncoded(x180_scanCompletionRate.second, CBitStreamWriter::GetBitCount(0x100)); + stream.WriteBits(x180_scanCompletionRate.first, COutputStream::GetBitCount(0x100)); + stream.WriteBits(x180_scanCompletionRate.second, COutputStream::GetBitCount(0x100)); } u32 CPlayerState::GetMissileCostForAltAttack() const { return costs[size_t(x8_currentBeam)]; } @@ -437,7 +437,7 @@ CPlayerState::EItemType CPlayerState::ItemNameToType(std::string_view name) { }}; std::string lowName{name}; - athena::utility::tolower(lowName); + CBasics::ToLower(lowName); const auto iter = std::find_if(typeNameMap.cbegin(), typeNameMap.cend(), [&lowName](const auto& entry) { return entry.first == lowName; }); diff --git a/Runtime/CPlayerState.hpp b/Runtime/CPlayerState.hpp index 72ae5b136..adc268e0d 100644 --- a/Runtime/CPlayerState.hpp +++ b/Runtime/CPlayerState.hpp @@ -4,7 +4,7 @@ #include #include "Runtime/CStaticInterference.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/rstl.hpp" #include "Runtime/World/CHealthInfo.hpp" @@ -164,8 +164,8 @@ public: CStaticInterference& GetStaticInterference() { return x188_staticIntf; } const std::vector>& GetScanTimes() const { return x170_scanTimes; } CPlayerState(); - explicit CPlayerState(CBitStreamReader& stream); - void PutTo(CBitStreamWriter& stream); + explicit CPlayerState(CInputStream& stream); + void PutTo(COutputStream& stream); static u32 GetPowerUpMaxValue(EItemType type); static EItemType ItemNameToType(std::string_view name); static std::string_view ItemTypeToName(EItemType type); diff --git a/Runtime/CResFactory.cpp b/Runtime/CResFactory.cpp index e0d446f36..459988fde 100644 --- a/Runtime/CResFactory.cpp +++ b/Runtime/CResFactory.cpp @@ -65,7 +65,7 @@ void CResFactory::BuildAsync(const SObjectTag& tag, const CVParamTransfer& xfer, if (search == m_loadMap.end()) { SLoadingData data(tag, target, xfer, x4_loader.GetResourceCompression(tag), selfRef); data.x14_resSize = x4_loader.ResourceSize(tag); - if (data.x14_resSize) { + if (data.x14_resSize != 0) { data.x10_loadBuffer = std::unique_ptr(new u8[data.x14_resSize]); data.x8_dvdReq = x4_loader.LoadResourceAsync(tag, data.x10_loadBuffer.get()); AddToLoadList(std::move(data)); @@ -107,9 +107,9 @@ void CResFactory::CancelBuild(const SObjectTag& tag) { void CResFactory::LoadPersistentResources(CSimplePool& sp) { const auto& paks = x4_loader.GetPaks(); - for (auto it = paks.begin(); it != paks.end(); ++it) { - if (!(*it)->IsWorldPak()) { - for (const CAssetId& id : (*it)->GetDepList()) { + for (const auto & pak : paks) { + if (!pak->IsWorldPak()) { + for (const CAssetId& id : pak->GetDepList()) { SObjectTag tag(GetResourceTypeById(id), id); m_nonWorldTokens.push_back(sp.GetObj(tag)); m_nonWorldTokens.back().Lock(); diff --git a/Runtime/CResLoader.cpp b/Runtime/CResLoader.cpp index 3a30bee4a..99a1b1d9d 100644 --- a/Runtime/CResLoader.cpp +++ b/Runtime/CResLoader.cpp @@ -44,7 +44,8 @@ std::unique_ptr CResLoader::LoadNewResourcePartSync(const SObjectT CPakFile* const file = FindResourceForLoad(tag); file->SyncSeekRead(buf, length, ESeekOrigin::Begin, x50_cachedResInfo->GetOffset() + offset); - return std::make_unique(buf, length, !extBuf); + return std::make_unique( + buf, length, extBuf == nullptr ? CMemoryInStream::EOwnerShip::Owned : CMemoryInStream::EOwnerShip::NotOwned); } void CResLoader::LoadMemResourceSync(const SObjectTag& tag, std::unique_ptr& bufOut, int* sizeOut) { @@ -57,9 +58,10 @@ void CResLoader::LoadMemResourceSync(const SObjectTag& tag, std::unique_ptr CResLoader::LoadResourceFromMemorySync(const SObjectTag& tag, const void* buf) { FindResourceForLoad(tag); - std::unique_ptr newStrm = std::make_unique(buf, x50_cachedResInfo->GetSize()); + std::unique_ptr newStrm = + std::make_unique(buf, x50_cachedResInfo->GetSize(), CMemoryInStream::EOwnerShip::NotOwned); if (x50_cachedResInfo->IsCompressed()) { - newStrm->readUint32Big(); + newStrm->ReadLong(); newStrm = std::make_unique(std::move(newStrm)); } return newStrm; @@ -77,9 +79,10 @@ std::unique_ptr CResLoader::LoadNewResourceSync(const SObjectTag& file->SyncSeekRead(buf, resSz, ESeekOrigin::Begin, x50_cachedResInfo->GetOffset()); const bool takeOwnership = extBuf == nullptr; - std::unique_ptr newStrm = std::make_unique(buf, resSz, takeOwnership); + std::unique_ptr newStrm = std::make_unique( + buf, resSz, takeOwnership ? CMemoryInStream::EOwnerShip::Owned : CMemoryInStream::EOwnerShip::NotOwned); if (x50_cachedResInfo->IsCompressed()) { - newStrm->readUint32Big(); + newStrm->ReadLong(); newStrm = std::make_unique(std::move(newStrm)); } diff --git a/Runtime/CResLoader.hpp b/Runtime/CResLoader.hpp index 17fdc0e0d..b9cc41d82 100644 --- a/Runtime/CResLoader.hpp +++ b/Runtime/CResLoader.hpp @@ -7,7 +7,7 @@ #include #include "Runtime/CPakFile.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" namespace metaforce { diff --git a/Runtime/CScannableObjectInfo.cpp b/Runtime/CScannableObjectInfo.cpp index d950522fc..9cdbb1928 100644 --- a/Runtime/CScannableObjectInfo.cpp +++ b/Runtime/CScannableObjectInfo.cpp @@ -4,7 +4,7 @@ namespace metaforce { CScannableObjectInfo::CScannableObjectInfo(CInputStream& in, CAssetId resId) : x0_scannableObjectId(resId) { - const u32 version = in.readUint32Big(); + const u32 version = in.ReadLong(); Load(in, version); for (auto& bucket : x14_buckets) { @@ -33,18 +33,18 @@ CScannableObjectInfo::CScannableObjectInfo(CInputStream& in, CAssetId resId) : x } void CScannableObjectInfo::Load(CInputStream& in, u32 version) { - in.readUint32Big(); - in.readUint32Big(); - x4_stringId = in.readUint32Big(); + in.ReadLong(); + in.ReadLong(); + x4_stringId = in.Get(); if (version < 4) { - x8_totalDownloadTime = in.readFloatBig(); + x8_totalDownloadTime = in.ReadFloat(); } else { - const u32 scanSpeed = in.readUint32Big(); + const u32 scanSpeed = in.ReadLong(); x8_totalDownloadTime = g_tweakGui->GetScanSpeed(scanSpeed); } - xc_category = in.readUint32Big(); + xc_category = in.ReadLong(); if (version > 4) { - x10_important = in.readBool(); + x10_important = in.ReadBool(); } for (size_t i = 0; i < x14_buckets.capacity(); i++) { @@ -53,15 +53,15 @@ void CScannableObjectInfo::Load(CInputStream& in, u32 version) { } CScannableObjectInfo::SBucket::SBucket(CInputStream& in, u32 version) { - x0_texture = in.readUint32Big(); - x4_appearanceRange = in.readFloatBig(); - x8_imagePos = in.readUint32Big(); + x0_texture = in.Get(); + x4_appearanceRange = in.ReadFloat(); + x8_imagePos = in.ReadLong(); if (version > 1) { - xc_size.x = in.readUint32Big(); - xc_size.y = in.readUint32Big(); - x14_interval = in.readFloatBig(); + xc_size.x = in.ReadLong(); + xc_size.y = in.ReadLong(); + x14_interval = in.ReadFloat(); if (version >= 3) - x18_fadeDuration = in.readFloatBig(); + x18_fadeDuration = in.ReadFloat(); } } diff --git a/Runtime/CScriptMailbox.cpp b/Runtime/CScriptMailbox.cpp index 2f6b10dde..a6b64edb8 100644 --- a/Runtime/CScriptMailbox.cpp +++ b/Runtime/CScriptMailbox.cpp @@ -8,12 +8,12 @@ namespace metaforce { -CScriptMailbox::CScriptMailbox(CBitStreamReader& in, const CWorldSaveGameInfo& saveWorld) { +CScriptMailbox::CScriptMailbox(CInputStream& in, const CWorldSaveGameInfo& saveWorld) { const u32 relayCount = saveWorld.GetRelayCount(); if (saveWorld.GetRelayCount()) { std::vector relayStates(saveWorld.GetRelayCount()); for (u32 i = 0; i < relayCount; ++i) { - relayStates[i] = in.ReadEncoded(1); + relayStates[i] = in.ReadBits(1); } for (u32 i = 0; i < relayCount; ++i) { @@ -79,7 +79,7 @@ void CScriptMailbox::SendMsgs(TAreaId areaId, CStateManager& stateMgr) { } } -void CScriptMailbox::PutTo(CBitStreamWriter& out, const CWorldSaveGameInfo& saveWorld) { +void CScriptMailbox::PutTo(COutputStream& out, const CWorldSaveGameInfo& saveWorld) { const u32 relayCount = saveWorld.GetRelayCount(); std::vector relays(relayCount); @@ -91,7 +91,7 @@ void CScriptMailbox::PutTo(CBitStreamWriter& out, const CWorldSaveGameInfo& save } for (u32 i = 0; i < relayCount; ++i) { - out.WriteEncoded(u32(relays[i]), 1); + out.WriteBits(u32(relays[i]), 1); } } diff --git a/Runtime/CScriptMailbox.hpp b/Runtime/CScriptMailbox.hpp index a8fac0dbc..658a1b100 100644 --- a/Runtime/CScriptMailbox.hpp +++ b/Runtime/CScriptMailbox.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/World/ScriptObjectSupport.hpp" @@ -29,13 +29,13 @@ class CScriptMailbox { public: CScriptMailbox() = default; - CScriptMailbox(CBitStreamReader& in, const CWorldSaveGameInfo& saveWorld); + CScriptMailbox(CInputStream& in, const CWorldSaveGameInfo& saveWorld); bool HasMsg(TEditorId id) const; void AddMsg(TEditorId id); void RemoveMsg(TEditorId id); void SendMsgs(TAreaId areaId, CStateManager& stateMgr); - void PutTo(CBitStreamWriter& out, const CWorldSaveGameInfo& saveWorld); + void PutTo(COutputStream& out, const CWorldSaveGameInfo& saveWorld); }; } // namespace metaforce diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 56ab6ec29..1d6012bb5 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -47,19 +47,19 @@ #include "Runtime/World/CSnakeWeedSwarm.hpp" #include "Runtime/World/CWallCrawlerSwarm.hpp" #include "Runtime/World/CWorld.hpp" -#include "TCastTo.hpp" // Generated file, do not modify include path +#include "Runtime/ConsoleVariables/CVarManager.hpp" -#include +#include "TCastTo.hpp" // Generated file, do not modify include path #include namespace metaforce { namespace { -hecl::CVar* debugToolDrawAiPath = nullptr; -hecl::CVar* debugToolDrawLighting = nullptr; -hecl::CVar* debugToolDrawCollisionActors = nullptr; -hecl::CVar* debugToolDrawMazePath = nullptr; -hecl::CVar* debugToolDrawPlatformCollision = nullptr; -hecl::CVar* sm_logScripting = nullptr; +CVar* debugToolDrawAiPath = nullptr; +CVar* debugToolDrawLighting = nullptr; +CVar* debugToolDrawCollisionActors = nullptr; +CVar* debugToolDrawMazePath = nullptr; +CVar* debugToolDrawPlatformCollision = nullptr; +CVar* sm_logScripting = nullptr; } // namespace logvisor::Module LogModule("metaforce::CStateManager"); CStateManager::CStateManager(const std::weak_ptr& mailbox, const std::weak_ptr& mwInfo, @@ -217,9 +217,9 @@ CStateManager::CStateManager(const std::weak_ptr& mailbox, const g_StateManager = this; if (sm_logScripting == nullptr) { - sm_logScripting = hecl::CVarManager::instance()->findOrMakeCVar( + sm_logScripting = CVarManager::instance()->findOrMakeCVar( "stateManager.logScripting"sv, "Prints object communication to the console", false, - hecl::CVar::EFlags::ReadOnly | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Game); + CVar::EFlags::ReadOnly | CVar::EFlags::Archive | CVar::EFlags::Game); } m_logScriptingReference.emplace(&m_logScripting, sm_logScripting); } @@ -439,7 +439,7 @@ void CStateManager::SetupParticleHook(const CActor& actor) const { void CStateManager::MurderScriptInstanceNames() { xb40_uniqueInstanceNames.clear(); } -std::string CStateManager::HashInstanceName(CInputStream& in) { return in.readString(); } +std::string CStateManager::HashInstanceName(CInputStream& in) { return in.Get(); } void CStateManager::SetActorAreaId(CActor& actor, TAreaId aid) { const TAreaId actorAid = actor.GetAreaIdAlways(); @@ -545,18 +545,18 @@ void CStateManager::BuildDynamicLightListForWorld() { } } void CStateManager::DrawDebugStuff() const { - if (hecl::com_developer != nullptr && !hecl::com_developer->toBoolean()) { + if (com_developer != nullptr && !com_developer->toBoolean()) { return; } // FIXME: Add proper globals for CVars if (debugToolDrawAiPath == nullptr || debugToolDrawCollisionActors == nullptr || debugToolDrawLighting == nullptr || debugToolDrawMazePath == nullptr || debugToolDrawPlatformCollision == nullptr) { - debugToolDrawAiPath = hecl::CVarManager::instance()->findCVar("debugTool.drawAiPath"); - debugToolDrawMazePath = hecl::CVarManager::instance()->findCVar("debugTool.drawMazePath"); - debugToolDrawCollisionActors = hecl::CVarManager::instance()->findCVar("debugTool.drawCollisionActors"); - debugToolDrawLighting = hecl::CVarManager::instance()->findCVar("debugTool.drawLighting"); - debugToolDrawPlatformCollision = hecl::CVarManager::instance()->findCVar("debugTool.drawPlatformCollision"); + debugToolDrawAiPath = CVarManager::instance()->findCVar("debugTool.drawAiPath"); + debugToolDrawMazePath = CVarManager::instance()->findCVar("debugTool.drawMazePath"); + debugToolDrawCollisionActors = CVarManager::instance()->findCVar("debugTool.drawCollisionActors"); + debugToolDrawLighting = CVarManager::instance()->findCVar("debugTool.drawLighting"); + debugToolDrawPlatformCollision = CVarManager::instance()->findCVar("debugTool.drawPlatformCollision"); return; } @@ -985,90 +985,90 @@ void CStateManager::DrawWorld() { } void CStateManager::DrawActorCubeFaces(CActor& actor, int& cubeInst) const { -// if (!actor.m_reflectionCube || -// (!TCastToPtr(actor) && (!actor.GetActive() || !actor.IsDrawEnabled() || actor.xe4_30_outOfFrustum))) -// return; -// -// const TAreaId visAreaId = actor.GetAreaIdAlways(); -// const SViewport backupVp = g_Viewport; -// -// int areaCount = 0; -// std::array areaArr; -// for (const CGameArea& area : *x850_world) { -// if (areaCount == 10) { -// break; -// } -// auto occState = CGameArea::EOcclusionState::Occluded; -// if (area.IsPostConstructed()) { -// occState = area.GetOcclusionState(); -// } -// if (occState == CGameArea::EOcclusionState::Visible) { -// areaArr[areaCount++] = &area; -// } -// } -// -// for (int f = 0; f < 6; ++f) { -// SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CStateManager::DrawActorCubeFaces [{}] {} {} {}"), f, -// actor.GetUniqueId(), actor.GetEditorId(), actor.GetName()) -// .c_str(), -// zeus::skOrange); -// CGraphics::g_BooMainCommandQueue->setRenderTarget(actor.m_reflectionCube, f); -// SetupViewForCubeFaceDraw(actor.GetRenderBounds().center(), f); -// CGraphics::g_BooMainCommandQueue->clearTarget(); -// -// std::sort(areaArr.begin(), areaArr.begin() + areaCount, [visAreaId](const CGameArea* a, const CGameArea* b) { -// if (a->x4_selfIdx == b->x4_selfIdx) { -// return false; -// } -// if (visAreaId == a->x4_selfIdx) { -// return false; -// } -// if (visAreaId == b->x4_selfIdx) { -// return true; -// } -// return CGraphics::g_ViewPoint.dot(a->GetAABB().center()) > CGraphics::g_ViewPoint.dot(b->GetAABB().center()); -// }); -// -// int pvsCount = 0; -// std::array pvsArr; -// for (auto area = areaArr.cbegin(); area != areaArr.cbegin() + areaCount; ++area) { -// const CGameArea* areaPtr = *area; -// CPVSVisSet& pvsSet = pvsArr[pvsCount++]; -// pvsSet.Reset(EPVSVisSetState::OutOfBounds); -// GetVisSetForArea(areaPtr->x4_selfIdx, visAreaId, pvsSet); -// } -// -// for (int i = areaCount - 1; i >= 0; --i) { -// const CGameArea& area = *areaArr[i]; -// SetupFogForArea(area); -// g_Renderer->EnablePVS(pvsArr[i], area.x4_selfIdx); -// g_Renderer->SetWorldLightFadeLevel(area.GetPostConstructed()->x1128_worldLightingLevel); -// g_Renderer->UpdateAreaUniforms(area.x4_selfIdx, EWorldShadowMode::None, true, cubeInst * 6 + f); -// g_Renderer->DrawUnsortedGeometry(area.x4_selfIdx, 0x2, 0x0); -// } -// -// if (!SetupFogForDraw()) { -// g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::skBlack); -// } -// -// x850_world->DrawSky(zeus::CTransform::Translate(CGraphics::g_ViewPoint)); -// -// for (int i = 0; i < areaCount; ++i) { -// const CGameArea& area = *areaArr[i]; -// CPVSVisSet& pvs = pvsArr[i]; -// SetupFogForArea(area); -// g_Renderer->SetWorldLightFadeLevel(area.GetPostConstructed()->x1128_worldLightingLevel); -// g_Renderer->EnablePVS(pvs, area.x4_selfIdx); -// g_Renderer->DrawSortedGeometry(area.x4_selfIdx, 0x2, 0x0); -// } -// } -// -// CGraphics::g_BooMainCommandQueue->generateMipmaps(actor.m_reflectionCube); -// -// CBooRenderer::BindMainDrawTarget(); -// g_Renderer->SetViewport(backupVp.x0_left, backupVp.x4_top, backupVp.x8_width, backupVp.xc_height); -// -// ++cubeInst; + // if (!actor.m_reflectionCube || + // (!TCastToPtr(actor) && (!actor.GetActive() || !actor.IsDrawEnabled() || actor.xe4_30_outOfFrustum))) + // return; + // + // const TAreaId visAreaId = actor.GetAreaIdAlways(); + // const SViewport backupVp = g_Viewport; + // + // int areaCount = 0; + // std::array areaArr; + // for (const CGameArea& area : *x850_world) { + // if (areaCount == 10) { + // break; + // } + // auto occState = CGameArea::EOcclusionState::Occluded; + // if (area.IsPostConstructed()) { + // occState = area.GetOcclusionState(); + // } + // if (occState == CGameArea::EOcclusionState::Visible) { + // areaArr[areaCount++] = &area; + // } + // } + // + // for (int f = 0; f < 6; ++f) { + // SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CStateManager::DrawActorCubeFaces [{}] {} {} {}"), f, + // actor.GetUniqueId(), actor.GetEditorId(), actor.GetName()) + // .c_str(), + // zeus::skOrange); + // CGraphics::g_BooMainCommandQueue->setRenderTarget(actor.m_reflectionCube, f); + // SetupViewForCubeFaceDraw(actor.GetRenderBounds().center(), f); + // CGraphics::g_BooMainCommandQueue->clearTarget(); + // + // std::sort(areaArr.begin(), areaArr.begin() + areaCount, [visAreaId](const CGameArea* a, const CGameArea* b) { + // if (a->x4_selfIdx == b->x4_selfIdx) { + // return false; + // } + // if (visAreaId == a->x4_selfIdx) { + // return false; + // } + // if (visAreaId == b->x4_selfIdx) { + // return true; + // } + // return CGraphics::g_ViewPoint.dot(a->GetAABB().center()) > CGraphics::g_ViewPoint.dot(b->GetAABB().center()); + // }); + // + // int pvsCount = 0; + // std::array pvsArr; + // for (auto area = areaArr.cbegin(); area != areaArr.cbegin() + areaCount; ++area) { + // const CGameArea* areaPtr = *area; + // CPVSVisSet& pvsSet = pvsArr[pvsCount++]; + // pvsSet.Reset(EPVSVisSetState::OutOfBounds); + // GetVisSetForArea(areaPtr->x4_selfIdx, visAreaId, pvsSet); + // } + // + // for (int i = areaCount - 1; i >= 0; --i) { + // const CGameArea& area = *areaArr[i]; + // SetupFogForArea(area); + // g_Renderer->EnablePVS(pvsArr[i], area.x4_selfIdx); + // g_Renderer->SetWorldLightFadeLevel(area.GetPostConstructed()->x1128_worldLightingLevel); + // g_Renderer->UpdateAreaUniforms(area.x4_selfIdx, EWorldShadowMode::None, true, cubeInst * 6 + f); + // g_Renderer->DrawUnsortedGeometry(area.x4_selfIdx, 0x2, 0x0); + // } + // + // if (!SetupFogForDraw()) { + // g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::skBlack); + // } + // + // x850_world->DrawSky(zeus::CTransform::Translate(CGraphics::g_ViewPoint)); + // + // for (int i = 0; i < areaCount; ++i) { + // const CGameArea& area = *areaArr[i]; + // CPVSVisSet& pvs = pvsArr[i]; + // SetupFogForArea(area); + // g_Renderer->SetWorldLightFadeLevel(area.GetPostConstructed()->x1128_worldLightingLevel); + // g_Renderer->EnablePVS(pvs, area.x4_selfIdx); + // g_Renderer->DrawSortedGeometry(area.x4_selfIdx, 0x2, 0x0); + // } + // } + // + // CGraphics::g_BooMainCommandQueue->generateMipmaps(actor.m_reflectionCube); + // + // CBooRenderer::BindMainDrawTarget(); + // g_Renderer->SetViewport(backupVp.x0_left, backupVp.x4_top, backupVp.x8_width, backupVp.xc_height); + // + // ++cubeInst; } void CStateManager::DrawWorldCubeFaces() const { @@ -1470,14 +1470,14 @@ CStateManager::GetIdListForScript(TEditorId id) const { } void CStateManager::LoadScriptObjects(TAreaId aid, CInputStream& in, std::vector& idsOut) { - in.readUByte(); + in.ReadUint8(); - const u32 objCount = in.readUint32Big(); + const u32 objCount = in.ReadLong(); idsOut.reserve(idsOut.size() + objCount); for (u32 i = 0; i < objCount; ++i) { - const auto objType = static_cast(in.readUByte()); - const u32 objSize = in.readUint32Big(); - const u32 pos = static_cast(in.position()); + const auto objType = static_cast(in.ReadUint8()); + const u32 objSize = in.ReadLong(); + const u32 pos = static_cast(in.GetReadPosition()); const auto id = LoadScriptObject(aid, objType, objSize, in); if (id.first == kInvalidEditorId) { continue; @@ -1502,15 +1502,15 @@ void CStateManager::LoadScriptObjects(TAreaId aid, CInputStream& in, std::vector std::pair CStateManager::LoadScriptObject(TAreaId aid, EScriptObjectType type, u32 length, CInputStream& in) { OPTICK_EVENT(); - const TEditorId id = in.readUint32Big(); - const u32 connCount = in.readUint32Big(); + const TEditorId id = in.ReadLong(); + const u32 connCount = in.ReadLong(); length -= 8; std::vector conns; conns.reserve(connCount); for (u32 i = 0; i < connCount; ++i) { - const auto state = EScriptObjectState(in.readUint32Big()); - const auto msg = EScriptObjectMessage(in.readUint32Big()); - const TEditorId target = in.readUint32Big(); + const auto state = EScriptObjectState(in.ReadLong()); + const auto msg = EScriptObjectMessage(in.ReadLong()); + const TEditorId target = in.ReadLong(); // Metaforce Addition if (m_incomingConnections.find(target) == m_incomingConnections.cend()) { m_incomingConnections.emplace(target, std::set()); @@ -1521,9 +1521,9 @@ std::pair CStateManager::LoadScriptObject(TAreaId aid, ESc length -= 12; conns.push_back(SConnection{state, msg, target}); } - const u32 propCount = in.readUint32Big(); + const u32 propCount = in.ReadLong(); length -= 4; - const auto startPos = in.position(); + const auto startPos = in.GetReadPosition(); bool error = false; FScriptLoader loader = {}; @@ -1545,7 +1545,7 @@ std::pair CStateManager::LoadScriptObject(TAreaId aid, ESc error = true; } - const u32 readAmt = in.position() - startPos; + const u32 readAmt = in.GetReadPosition() - startPos; if (readAmt > length) { LogModule.report(logvisor::Fatal, FMT_STRING("Script object overread while reading {}"), ScriptObjectTypeToStr(type)); @@ -1553,13 +1553,17 @@ std::pair CStateManager::LoadScriptObject(TAreaId aid, ESc const u32 leftover = length - readAmt; for (u32 i = 0; i < leftover; ++i) { - in.readByte(); + in.ReadChar(); } if (error || ent == nullptr) { - in.seek(startPos, athena::SeekOrigin::Begin); + while (in.GetReadPosition() != startPos) { + in.ReadChar(); + } const std::string name = HashInstanceName(in); - in.seek(startPos + length, athena::SeekOrigin::Begin); + while (in.GetReadPosition() != startPos + length) { + in.ReadChar(); + } LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {}, name: {}"), ScriptObjectTypeToStr(type), name); return {kInvalidEditorId, kInvalidUniqueId}; diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index 01da8f29d..bf4f0de47 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -217,7 +217,7 @@ private: std::map> m_incomingConnections; bool m_logScripting = false; - std::optional> m_logScriptingReference; + std::optional> m_logScriptingReference; void UpdateThermalVisor(); static void RendererDrawCallback(void*, void*, int); diff --git a/Runtime/CStringExtras.cpp b/Runtime/CStringExtras.cpp new file mode 100644 index 000000000..0fb2c9620 --- /dev/null +++ b/Runtime/CStringExtras.cpp @@ -0,0 +1,97 @@ +#include "Runtime/CStringExtras.hpp" +#include "Runtime/Streams/CInputStream.hpp" + +#include + +namespace metaforce { +std::string CStringExtras::ReadString(CInputStream& in) { + u32 strLen = in.ReadLong(); + std::string ret; + u32 readLen = 512; + char tmp[512] = {}; + for (; strLen > 0; strLen -= readLen) { + readLen = 512; + if (strLen <= 512) { + readLen = strLen; + } + in.ReadBytes(tmp, readLen); + ret.append(tmp, readLen); + } + + return ret; +} + +std::string CStringExtras::ConvertToANSI(std::u16string_view sv) { + std::string out; + out.reserve(sv.size()); + for (const char16_t c : sv) { + out.push_back(static_cast(c)); + } + return out; +} + +std::u16string CStringExtras::ConvertToUNICODE(std::string_view sv) { + std::u16string out; + out.reserve(sv.size()); + for (const char c : sv) { + out.push_back(static_cast(c)); + } + return out; +} + +std::string CStringExtras::ConvertToUTF8(std::u16string_view sv) { + std::string out; + const auto* in = sv.data(); + const auto* end = in + sv.size(); + while (in < end) { + char32_t utf32 = 0; + const char16_t* next = OSUTF16To32(in, &utf32); + // TODO: bug in OSUTF + if (next == nullptr) { + utf32 = *in; + in++; + } else { + in = next; + } + std::array chars8{}; + char8_t* end8 = OSUTF32To8(utf32, chars8.data()); + if (end8 == nullptr) { + continue; + } + const auto* c = chars8.data(); + while (c < end8) { + out.push_back(static_cast(*c)); + c++; + } + } + return out; +} + +std::u16string CStringExtras::ConvertToUTF16(std::string_view sv) { + std::u16string out; + const auto* in = reinterpret_cast(sv.data()); + const auto* end = in + sv.size(); + while (in < end) { + char32_t utf32 = 0; + const char8_t* next = OSUTF8To32(in, &utf32); + // TODO: bug in OSUTF + if (next == nullptr) { + utf32 = *in; + in++; + } else { + in = next; + } + std::array chars16{}; + char16_t* end16 = OSUTF32To16(utf32, chars16.data()); + if (end16 == nullptr) { + continue; + } + const auto* c = chars16.data(); + while (c < end16) { + out.push_back(*c); + c++; + } + } + return out; +} +} // namespace metaforce diff --git a/Runtime/CStringExtras.hpp b/Runtime/CStringExtras.hpp index 96bb9ba3a..ef6a69090 100644 --- a/Runtime/CStringExtras.hpp +++ b/Runtime/CStringExtras.hpp @@ -5,9 +5,15 @@ #include namespace metaforce { - +class CInputStream; class CStringExtras { public: + static std::string ConvertToANSI(std::u16string_view sv); + static std::u16string ConvertToUNICODE(std::string_view sv); + // Metaforce addition: UTF-8/16 compatible versions of the above + static std::string ConvertToUTF8(std::u16string_view sv); + static std::u16string ConvertToUTF16(std::string_view sv); + // Checks if the provided views into string data can be considered equal or not based on // whether or not all their characters are equal to one another in a character insensitive manner. // @@ -35,6 +41,8 @@ public: } return s; } + + static std::string ReadString(CInputStream& in); }; } // namespace metaforce diff --git a/Runtime/CTextureCache.cpp b/Runtime/CTextureCache.cpp index 3311e857b..2c4bee3b3 100644 --- a/Runtime/CTextureCache.cpp +++ b/Runtime/CTextureCache.cpp @@ -3,11 +3,11 @@ namespace metaforce { CTextureCache::CTextureCache(CInputStream& in) { - u32 textureCount = in.readUint32Big(); + u32 textureCount = in.ReadLong(); for (u32 i = 0; i < textureCount; ++i) { CAssetId uid(in); if (m_textureInfo.find(uid) == m_textureInfo.end()) - m_textureInfo.emplace(uid, CTextureInfo(in)); + m_textureInfo.emplace(uid, in.Get()); } } diff --git a/Runtime/CTextureCache.hpp b/Runtime/CTextureCache.hpp index 3dc558331..258965014 100644 --- a/Runtime/CTextureCache.hpp +++ b/Runtime/CTextureCache.hpp @@ -13,7 +13,7 @@ class CPaletteInfo { public: explicit CPaletteInfo(CInputStream& in) - : m_format(in.readUint32Big()), m_elementCount(in.readUint32Big()), m_dolphinHash(in.readUint64Big()) {} + : m_format(in.ReadLong()), m_elementCount(in.ReadLong()), m_dolphinHash(in.ReadLongLong()) {} }; class CTextureInfo { ETexelFormat m_format; @@ -25,12 +25,12 @@ class CTextureInfo { public: explicit CTextureInfo(CInputStream& in) - : m_format(ETexelFormat(in.readUint32Big())) - , m_mipCount(in.readUint32Big()) - , m_width(in.readUint16Big()) - , m_height(in.readUint16Big()) - , m_dolphinHash(in.readUint64Big()) { - bool hasPal = in.readBool(); + : m_format(ETexelFormat(in.ReadLong())) + , m_mipCount(in.ReadLong()) + , m_width(in.ReadShort()) + , m_height(in.ReadShort()) + , m_dolphinHash(in.ReadLongLong()) { + bool hasPal = in.ReadBool(); if (hasPal) m_paletteInfo.emplace(in); } diff --git a/Runtime/CWorldSaveGameInfo.cpp b/Runtime/CWorldSaveGameInfo.cpp index dd0829d03..43200231c 100644 --- a/Runtime/CWorldSaveGameInfo.cpp +++ b/Runtime/CWorldSaveGameInfo.cpp @@ -4,50 +4,50 @@ namespace metaforce { CWorldSaveGameInfo::CWorldSaveGameInfo(CInputStream& in) { - in.readUint32Big(); - const u32 version = in.readUint32Big(); + in.ReadLong(); + const u32 version = in.ReadLong(); if (version > 1) { - x0_areaCount = in.readUint32Big(); + x0_areaCount = in.ReadLong(); } if (version > 2) { - const u32 cinematicCount = in.readUint32Big(); + const u32 cinematicCount = in.ReadLong(); x4_cinematics.reserve(cinematicCount); for (u32 i = 0; i < cinematicCount; ++i) { - x4_cinematics.emplace_back(in.readUint32Big()); + x4_cinematics.emplace_back(in.ReadLong()); } - const u32 relayCount = in.readUint32Big(); + const u32 relayCount = in.ReadLong(); x14_relays.reserve(relayCount); for (u32 i = 0; i < relayCount; ++i) { - x14_relays.emplace_back(in.readUint32Big()); + x14_relays.emplace_back(in.ReadLong()); } } - const u32 layerCount = in.readUint32Big(); + const u32 layerCount = in.ReadLong(); x24_layers.reserve(layerCount); for (u32 i = 0; i < layerCount; ++i) { SLayerState& st = x24_layers.emplace_back(); - st.x0_area = in.readUint32Big(); - st.x4_layer = in.readUint32Big(); + st.x0_area = in.ReadLong(); + st.x4_layer = in.ReadLong(); } - const u32 doorCount = in.readUint32Big(); + const u32 doorCount = in.ReadLong(); x34_doors.reserve(doorCount); for (u32 i = 0; i < doorCount; ++i) { - x34_doors.emplace_back(in.readUint32Big()); + x34_doors.emplace_back(in.ReadLong()); } if (version <= 0) { return; } - const u32 scanCount = in.readUint32Big(); + const u32 scanCount = in.ReadLong(); x44_scans.reserve(scanCount); for (u32 i = 0; i < scanCount; ++i) { SScanState& st = x44_scans.emplace_back(); - st.x0_id = in.readUint32Big(); - st.x4_category = EScanCategory(in.readUint32Big()); + st.x0_id = in.Get(); + st.x4_category = EScanCategory(in.ReadLong()); } } diff --git a/Runtime/CWorldSaveGameInfo.hpp b/Runtime/CWorldSaveGameInfo.hpp index e8f31f9d0..91f393da8 100644 --- a/Runtime/CWorldSaveGameInfo.hpp +++ b/Runtime/CWorldSaveGameInfo.hpp @@ -2,8 +2,6 @@ #include -#include "DNACommon/SAVWCommon.hpp" - #include "Runtime/CFactoryMgr.hpp" #include "Runtime/RetroTypes.hpp" @@ -11,7 +9,8 @@ namespace metaforce { class CWorldSaveGameInfo { public: - using EScanCategory = DataSpec::SAVWCommon::EScanCategory; + enum class EScanCategory { None, Data, Lore, Creature, Research, Artifact }; + struct SScanState { CAssetId x0_id; EScanCategory x4_category; diff --git a/Runtime/Camera/CCameraFilter.cpp b/Runtime/Camera/CCameraFilter.cpp index f6028b113..e77d87b51 100644 --- a/Runtime/Camera/CCameraFilter.cpp +++ b/Runtime/Camera/CCameraFilter.cpp @@ -100,7 +100,7 @@ void CCameraFilterPass::SetFilter(EFilterType type, EFilterShape shape, float template void CCameraFilterPass::DisableFilter(float time) { - SetFilter(EFilterType::Passthru, x8_shape, time, zeus::skWhite, -1); + SetFilter(EFilterType::Passthru, x8_shape, time, zeus::skWhite, {}); } template diff --git a/Runtime/Camera/CCameraShakeData.cpp b/Runtime/Camera/CCameraShakeData.cpp index 28a25d3ed..8d97d0dea 100644 --- a/Runtime/Camera/CCameraShakeData.cpp +++ b/Runtime/Camera/CCameraShakeData.cpp @@ -13,10 +13,10 @@ namespace metaforce { SCameraShakePoint SCameraShakePoint::LoadCameraShakePoint(CInputStream& in) { u32 useEnvelope = ScriptLoader::LoadParameterFlags(in); - float attackTime = in.readFloatBig(); - float sustainTime = in.readFloatBig(); - float duration = in.readFloatBig(); - float magnitude = in.readFloatBig(); + float attackTime = in.ReadFloat(); + float sustainTime = in.ReadFloat(); + float duration = in.ReadFloat(); + float magnitude = in.ReadFloat(); return {useEnvelope != 0, attackTime, sustainTime, duration, magnitude}; } @@ -28,15 +28,15 @@ CCameraShakerComponent CCameraShakerComponent::LoadNewCameraShakerComponent(CInp } CCameraShakeData::CCameraShakeData(CInputStream& in) { - in.readUint32Big(); - in.readFloatBig(); - in.readFloatBig(); - in.readFloatBig(); - in.readFloatBig(); - in.readFloatBig(); - in.readFloatBig(); - in.readFloatBig(); - in.readBool(); + in.ReadLong(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadBool(); BuildProjectileCameraShake(0.5f, 0.75f); } @@ -100,13 +100,13 @@ float CCameraShakeData::GetMaxFMComponent() const { } CCameraShakeData CCameraShakeData::LoadCameraShakeData(CInputStream& in) { - const float xMag = in.readFloatBig(); - in.readFloatBig(); - const float yMag = in.readFloatBig(); - in.readFloatBig(); - const float zMag = in.readFloatBig(); - in.readFloatBig(); - const float duration = in.readFloatBig(); + const float xMag = in.ReadFloat(); + in.ReadFloat(); + const float yMag = in.ReadFloat(); + in.ReadFloat(); + const float zMag = in.ReadFloat(); + in.ReadFloat(); + const float duration = in.ReadFloat(); const SCameraShakePoint xAM(false, 0.f, 0.f, duration, 2.f * xMag); const SCameraShakePoint yAM(false, 0.f, 0.f, duration, 2.f * yMag); diff --git a/Runtime/Camera/CCameraShakeData.hpp b/Runtime/Camera/CCameraShakeData.hpp index b1a4de181..e5389d487 100644 --- a/Runtime/Camera/CCameraShakeData.hpp +++ b/Runtime/Camera/CCameraShakeData.hpp @@ -60,6 +60,7 @@ class CCameraShakeData { public: static const CCameraShakeData skChargedShotCameraShakeData; + constexpr CCameraShakeData() = default; constexpr CCameraShakeData(float duration, float sfxDist, u32 flags, const zeus::CVector3f& sfxPos, const CCameraShakerComponent& shaker1, const CCameraShakerComponent& shaker2, const CCameraShakerComponent& shaker3) noexcept diff --git a/Runtime/Camera/CFirstPersonCamera.cpp b/Runtime/Camera/CFirstPersonCamera.cpp index 70eec0884..2c3e26dbf 100644 --- a/Runtime/Camera/CFirstPersonCamera.cpp +++ b/Runtime/Camera/CFirstPersonCamera.cpp @@ -16,7 +16,7 @@ CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf nearz, farz, aspect, watchedObj, false, 0) , x188_orbitCameraSpeed(orbitCameraSpeed) , x190_gunFollowXf(xf) { - DataSpec::DNAMP1::tw_FieldOfView->addListener([this](hecl::CVar* cv) { _fovListener(cv); }); + MP1::tw_FieldOfView->addListener([this](CVar* cv) { _fovListener(cv); }); } void CFirstPersonCamera::Accept(IVisitor& visitor) { visitor.Visit(this); } @@ -328,7 +328,7 @@ void CFirstPersonCamera::UpdateElevation(CStateManager& mgr) { } } -void CFirstPersonCamera::_fovListener(hecl::CVar* cv) { +void CFirstPersonCamera::_fovListener(CVar* cv) { x15c_currentFov = x180_perspInterpStartFov = x184_perspInterpEndFov = cv->toReal(); x170_24_perspDirty = true; } diff --git a/Runtime/Camera/CFirstPersonCamera.hpp b/Runtime/Camera/CFirstPersonCamera.hpp index 4493ff24e..3d0910953 100644 --- a/Runtime/Camera/CFirstPersonCamera.hpp +++ b/Runtime/Camera/CFirstPersonCamera.hpp @@ -17,7 +17,7 @@ class CFirstPersonCamera : public CGameCamera { bool x1c6_24_deferBallTransitionProcessing : 1 = false; zeus::CVector3f x1c8_closeInVec; float x1d4_closeInTimer = 0.f; - void _fovListener(hecl::CVar* cv); + void _fovListener(CVar* cv); public: DEFINE_ENTITY diff --git a/Runtime/Character/CAdditiveAnimPlayback.hpp b/Runtime/Character/CAdditiveAnimPlayback.hpp index c85ac976d..27fb1ae68 100644 --- a/Runtime/Character/CAdditiveAnimPlayback.hpp +++ b/Runtime/Character/CAdditiveAnimPlayback.hpp @@ -2,6 +2,7 @@ #include #include "Runtime/RetroTypes.hpp" +#include "Runtime/Streams/CInputStream.hpp" namespace metaforce { class CAdditiveAnimationInfo; @@ -16,8 +17,8 @@ class CAdditiveAnimationInfo { public: void read(CInputStream& in) { - x0_fadeInDur = in.readFloatBig(); - x4_fadeOutDur = in.readFloatBig(); + x0_fadeInDur = in.ReadFloat(); + x4_fadeOutDur = in.ReadFloat(); } CAdditiveAnimationInfo() = default; explicit CAdditiveAnimationInfo(CInputStream& in) { read(in); } diff --git a/Runtime/Character/CAllFormatsAnimSource.cpp b/Runtime/Character/CAllFormatsAnimSource.cpp index 7e852ede9..e3c01f9cc 100644 --- a/Runtime/Character/CAllFormatsAnimSource.cpp +++ b/Runtime/Character/CAllFormatsAnimSource.cpp @@ -26,7 +26,7 @@ void CAnimFormatUnion::SubConstruct(u8* storage, EAnimFormat fmt, CInputStream& } CAnimFormatUnion::CAnimFormatUnion(CInputStream& in, IObjectStore& store) { - x0_format = EAnimFormat(in.readUint32Big()); + x0_format = EAnimFormat(in.ReadLong()); SubConstruct(x4_storage, x0_format, in, store); } diff --git a/Runtime/Character/CAnimCharacterSet.cpp b/Runtime/Character/CAnimCharacterSet.cpp index a85150f8f..bced78e93 100644 --- a/Runtime/Character/CAnimCharacterSet.cpp +++ b/Runtime/Character/CAnimCharacterSet.cpp @@ -5,7 +5,7 @@ namespace metaforce { CAnimCharacterSet::CAnimCharacterSet(CInputStream& in) -: x0_version(in.readUint16Big()), x4_characterSet(in), x1c_animationSet(in) {} +: x0_version(in.ReadShort()), x4_characterSet(in), x1c_animationSet(in) {} CFactoryFnReturn FAnimCharacterSet(const SObjectTag&, CInputStream& in, const CVParamTransfer&, CObjectReference* selfRef) { diff --git a/Runtime/Character/CAnimData.cpp b/Runtime/Character/CAnimData.cpp index 151744995..c598a3f77 100644 --- a/Runtime/Character/CAnimData.cpp +++ b/Runtime/Character/CAnimData.cpp @@ -483,7 +483,7 @@ float CAnimData::GetAnimationDuration(int animIn) const { std::set prims; anim->GetUniquePrimitives(prims); - SObjectTag tag{FOURCC('ANIM'), 0}; + SObjectTag tag{FOURCC('ANIM'), {}}; float durAccum = 0.f; for (const CPrimitive& prim : prims) { tag.id = prim.GetAnimResId(); @@ -586,7 +586,7 @@ void CAnimData::PrimitiveSetToTokenVector(const std::set& primSet, s bool preLock) { tokensOut.reserve(primSet.size()); - SObjectTag tag{FOURCC('ANIM'), 0}; + SObjectTag tag{FOURCC('ANIM'), {}}; for (const CPrimitive& prim : primSet) { tag.id = prim.GetAnimResId(); tokensOut.push_back(g_SimplePool->GetObj(tag)); @@ -817,7 +817,7 @@ float CAnimData::GetAverageVelocity(int animIn) const { std::set prims; anim->GetUniquePrimitives(prims); - SObjectTag tag{FOURCC('ANIM'), 0}; + SObjectTag tag{FOURCC('ANIM'), {}}; float velAccum = 0.f; float durAccum = 0.f; for (const CPrimitive& prim : prims) { diff --git a/Runtime/Character/CAnimPOIData.cpp b/Runtime/Character/CAnimPOIData.cpp index 0f9328307..600044fba 100644 --- a/Runtime/Character/CAnimPOIData.cpp +++ b/Runtime/Character/CAnimPOIData.cpp @@ -4,24 +4,24 @@ namespace metaforce { -CAnimPOIData::CAnimPOIData(CInputStream& in) : x0_version(in.readUint32Big()) { - u32 boolCount = in.readUint32Big(); +CAnimPOIData::CAnimPOIData(CInputStream& in) : x0_version(in.ReadLong()) { + u32 boolCount = in.ReadLong(); x4_boolNodes.reserve(boolCount); for (u32 i = 0; i < boolCount; ++i) x4_boolNodes.emplace_back(in); - u32 int32Count = in.readUint32Big(); + u32 int32Count = in.ReadLong(); x14_int32Nodes.reserve(int32Count); for (u32 i = 0; i < int32Count; ++i) x14_int32Nodes.emplace_back(in); - u32 particleCount = in.readUint32Big(); + u32 particleCount = in.ReadLong(); x24_particleNodes.reserve(particleCount); for (u32 i = 0; i < particleCount; ++i) x24_particleNodes.emplace_back(in); if (x0_version >= 2) { - u32 soundCount = in.readUint32Big(); + u32 soundCount = in.ReadLong(); x34_soundNodes.reserve(soundCount); for (u32 i = 0; i < soundCount; ++i) x34_soundNodes.emplace_back(in); diff --git a/Runtime/Character/CAnimSource.cpp b/Runtime/Character/CAnimSource.cpp index 7ab35115e..689bf6380 100644 --- a/Runtime/Character/CAnimSource.cpp +++ b/Runtime/Character/CAnimSource.cpp @@ -51,16 +51,16 @@ std::unique_ptr RotationAndOffsetStorage::GetRotationsAndOffsets(const } RotationAndOffsetStorage::CRotationAndOffsetVectors::CRotationAndOffsetVectors(CInputStream& in) { - const u32 quatCount = in.readUint32Big(); + const u32 quatCount = in.ReadLong(); x0_rotations.reserve(quatCount); for (u32 i = 0; i < quatCount; ++i) { - x0_rotations.emplace_back().readBig(in); + x0_rotations.emplace_back() = in.Get(); } - const u32 vecCount = in.readUint32Big(); + const u32 vecCount = in.ReadLong(); x10_offsets.reserve(vecCount); for (u32 i = 0; i < vecCount; ++i) { - x10_offsets.emplace_back().readBig(in); + x10_offsets.emplace_back() = in.Get(); } } @@ -75,10 +75,10 @@ RotationAndOffsetStorage::RotationAndOffsetStorage(const CRotationAndOffsetVecto static std::vector ReadIndexTable(CInputStream& in) { std::vector ret; - u32 count = in.readUint32Big(); + u32 count = in.ReadLong(); ret.reserve(count); for (u32 i = 0; i < count; ++i) - ret.push_back(in.readUByte()); + ret.push_back(in.ReadUint8()); return ret; } @@ -103,12 +103,12 @@ void CAnimSource::CalcAverageVelocity() { CAnimSource::CAnimSource(CInputStream& in, IObjectStore& store) : x0_duration(in) , x8_interval(in) -, x10_frameCount(in.readUint32Big()) +, x10_frameCount(in.ReadLong()) , x1c_rootBone(in) , x20_rotationChannels(ReadIndexTable(in)) , x30_translationChannels(ReadIndexTable(in)) , x40_data(RotationAndOffsetStorage::CRotationAndOffsetVectors(in), x10_frameCount) -, x54_evntId(in.readUint32Big()) { +, x54_evntId(in) { if (x54_evntId.IsValid()) { x58_evntData = store.GetObj({SBIG('EVNT'), x54_evntId}); x58_evntData.GetObj(); diff --git a/Runtime/Character/CAnimation.cpp b/Runtime/Character/CAnimation.cpp index d7de743bb..eb216e020 100644 --- a/Runtime/Character/CAnimation.cpp +++ b/Runtime/Character/CAnimation.cpp @@ -5,7 +5,7 @@ namespace metaforce { CAnimation::CAnimation(CInputStream& in) { - x0_name = in.readString(); + x0_name = in.Get(); x10_anim = CMetaAnimFactory::CreateMetaAnim(in); } diff --git a/Runtime/Character/CAnimation.hpp b/Runtime/Character/CAnimation.hpp index 696d7e1cb..1c04f40e6 100644 --- a/Runtime/Character/CAnimation.hpp +++ b/Runtime/Character/CAnimation.hpp @@ -3,7 +3,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CMetaAnimFactory.hpp" namespace metaforce { diff --git a/Runtime/Character/CAnimationSet.cpp b/Runtime/Character/CAnimationSet.cpp index 690b1a3c7..135658004 100644 --- a/Runtime/Character/CAnimationSet.cpp +++ b/Runtime/Character/CAnimationSet.cpp @@ -4,13 +4,13 @@ namespace metaforce { -CAnimationSet::CAnimationSet(CInputStream& in) : x0_tableCount(in.readUint16Big()) { - u32 animationCount = in.readUint32Big(); +CAnimationSet::CAnimationSet(CInputStream& in) : x0_tableCount(in.ReadShort()) { + u32 animationCount = in.ReadLong(); x4_animations.reserve(animationCount); for (u32 i = 0; i < animationCount; ++i) x4_animations.emplace_back(in); - u32 transitionCount = in.readUint32Big(); + u32 transitionCount = in.ReadLong(); x14_transitions.reserve(transitionCount); for (u32 i = 0; i < transitionCount; ++i) x14_transitions.emplace_back(in); @@ -18,28 +18,28 @@ CAnimationSet::CAnimationSet(CInputStream& in) : x0_tableCount(in.readUint16Big( x24_defaultTransition = CMetaTransFactory::CreateMetaTrans(in); if (x0_tableCount > 1) { - u32 additiveAnimCount = in.readUint32Big(); + u32 additiveAnimCount = in.ReadLong(); x28_additiveInfo.reserve(additiveAnimCount); for (u32 i = 0; i < additiveAnimCount; ++i) { - u32 id = in.readUint32Big(); + u32 id = in.ReadLong(); x28_additiveInfo.emplace_back(id, in); } x38_defaultAdditiveInfo.read(in); } if (x0_tableCount > 2) { - u32 halfTransitionCount = in.readUint32Big(); + u32 halfTransitionCount = in.ReadLong(); x40_halfTransitions.reserve(halfTransitionCount); for (u32 i = 0; i < halfTransitionCount; ++i) x40_halfTransitions.emplace_back(in); } if (x0_tableCount > 3) { - u32 animResourcesCount = in.readUint32Big(); + u32 animResourcesCount = in.ReadLong(); x50_animRes.reserve(animResourcesCount); for (u32 i = 0; i < animResourcesCount; ++i) { - CAssetId anim = in.readUint32Big(); - CAssetId evnt = in.readUint32Big(); + CAssetId anim = in.Get(); + CAssetId evnt = in.Get(); x50_animRes.emplace_back(anim, evnt); } } diff --git a/Runtime/Character/CAnimationSet.hpp b/Runtime/Character/CAnimationSet.hpp index 18cdd5e0a..10688dcc0 100644 --- a/Runtime/Character/CAnimationSet.hpp +++ b/Runtime/Character/CAnimationSet.hpp @@ -4,7 +4,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/Character/CAdditiveAnimPlayback.hpp" #include "Runtime/Character/CAnimation.hpp" diff --git a/Runtime/Character/CBoolPOINode.cpp b/Runtime/Character/CBoolPOINode.cpp index 50e847dfe..f65ae2f94 100644 --- a/Runtime/Character/CBoolPOINode.cpp +++ b/Runtime/Character/CBoolPOINode.cpp @@ -6,7 +6,7 @@ namespace metaforce { CBoolPOINode::CBoolPOINode() : CPOINode("root", EPOIType::EmptyBool, CCharAnimTime(), -1, false, 1.f, -1, 0) {} -CBoolPOINode::CBoolPOINode(CInputStream& in) : CPOINode(in), x38_val(in.readBool()) {} +CBoolPOINode::CBoolPOINode(CInputStream& in) : CPOINode(in), x38_val(in.ReadBool()) {} CBoolPOINode CBoolPOINode::CopyNodeMinusStartTime(const CBoolPOINode& node, const CCharAnimTime& startTime) { CBoolPOINode ret = node; diff --git a/Runtime/Character/CCharAnimTime.hpp b/Runtime/Character/CCharAnimTime.hpp index e2aa45e3b..e1ec7991f 100644 --- a/Runtime/Character/CCharAnimTime.hpp +++ b/Runtime/Character/CCharAnimTime.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #undef min #undef max @@ -19,7 +19,7 @@ public: constexpr CCharAnimTime() = default; constexpr CCharAnimTime(float time) : x0_time(time), x4_type(x0_time != 0.f ? EType::NonZero : EType::ZeroSteady) {} constexpr CCharAnimTime(EType type, float t) : x0_time(t), x4_type(type) {} - explicit CCharAnimTime(CInputStream& in) : x0_time(in.readFloatBig()), x4_type(EType(in.readUint32Big())) {} + explicit CCharAnimTime(CInputStream& in) : x0_time(in.ReadFloat()), x4_type(EType(in.ReadLong())) {} static constexpr CCharAnimTime Infinity() { return {EType::Infinity, 1.0f}; } float GetSeconds() const { return x0_time; } diff --git a/Runtime/Character/CCharLayoutInfo.cpp b/Runtime/Character/CCharLayoutInfo.cpp index 64b1941d5..65163c595 100644 --- a/Runtime/Character/CCharLayoutInfo.cpp +++ b/Runtime/Character/CCharLayoutInfo.cpp @@ -32,30 +32,30 @@ CSegId CCharLayoutInfo::GetSegIdFromString(std::string_view name) const { void CCharLayoutNode::Bone::read(CInputStream& in) { x0_parentId = CSegId(in); - x4_origin.readBig(in); + x4_origin = in.Get(); - const u32 chCount = in.readUint32Big(); + const u32 chCount = in.ReadLong(); x10_children.reserve(chCount); for (u32 i = 0; i < chCount; ++i) { x10_children.emplace_back(in); } } -CCharLayoutNode::CCharLayoutNode(CInputStream& in) : x0_boneMap(in.readUint32Big()) { +CCharLayoutNode::CCharLayoutNode(CInputStream& in) : x0_boneMap(in.ReadLong()) { const u32 cap = x0_boneMap.GetCapacity(); for (u32 i = 0; i < cap; ++i) { - const u32 thisId = in.readUint32Big(); + const u32 thisId = in.ReadLong(); Bone& bone = x0_boneMap[thisId]; bone.read(in); } } CCharLayoutInfo::CCharLayoutInfo(CInputStream& in) : x0_node(std::make_shared(in)), x8_segIdList(in) { - const atUint32 mapCount = in.readUint32Big(); + const u32 mapCount = in.ReadLong(); - for (atUint32 i = 0; i < mapCount; ++i) { - std::string key = in.readString(); + for (u32 i = 0; i < mapCount; ++i) { + std::string key = in.Get(); x18_segIdMap.emplace(std::move(key), in); } } diff --git a/Runtime/Character/CCharLayoutInfo.hpp b/Runtime/Character/CCharLayoutInfo.hpp index 1678f3281..70641e8b8 100644 --- a/Runtime/Character/CCharLayoutInfo.hpp +++ b/Runtime/Character/CCharLayoutInfo.hpp @@ -6,7 +6,7 @@ #include #include "Runtime/CFactoryMgr.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CSegId.hpp" #include "Runtime/Character/CSegIdList.hpp" #include "Runtime/Character/TSegIdMap.hpp" diff --git a/Runtime/Character/CCharacterInfo.cpp b/Runtime/Character/CCharacterInfo.cpp index 7dec11562..02b965a0e 100644 --- a/Runtime/Character/CCharacterInfo.cpp +++ b/Runtime/Character/CCharacterInfo.cpp @@ -1,76 +1,77 @@ #include "Runtime/Character/CCharacterInfo.hpp" +#include "Runtime/Streams/IOStreams.hpp" namespace metaforce { CCharacterInfo::CParticleResData::CParticleResData(CInputStream& in, u16 tableCount) { - const u32 partCount = in.readUint32Big(); + const u32 partCount = in.ReadLong(); x0_part.reserve(partCount); for (u32 i = 0; i < partCount; ++i) { - x0_part.emplace_back(in.readUint32Big()); + x0_part.emplace_back(in.Get()); } - const u32 swhcCount = in.readUint32Big(); + const u32 swhcCount = in.ReadLong(); x10_swhc.reserve(swhcCount); for (u32 i = 0; i < swhcCount; ++i) { - x10_swhc.emplace_back(in.readUint32Big()); + x10_swhc.emplace_back(in.Get()); } - const u32 unkCount = in.readUint32Big(); + const u32 unkCount = in.ReadLong(); x20_elsc.reserve(unkCount); for (u32 i = 0; i < unkCount; ++i) { - x20_elsc.emplace_back(in.readUint32Big()); + x20_elsc.emplace_back(in.Get()); } if (tableCount > 5) { - const u32 elscCount = in.readUint32Big(); + const u32 elscCount = in.ReadLong(); x30_elsc.reserve(elscCount); for (u32 i = 0; i < elscCount; ++i) { - x30_elsc.emplace_back(in.readUint32Big()); + x30_elsc.emplace_back(in.Get()); } } } static std::vector>> MakeAnimInfoVector(CInputStream& in) { std::vector>> ret; - const u32 animInfoCount = in.readUint32Big(); + const u32 animInfoCount = in.ReadLong(); ret.reserve(animInfoCount); for (u32 i = 0; i < animInfoCount; ++i) { - const s32 idx = in.readInt32Big(); - std::string a = in.readString(); - std::string b = in.readString(); + const s32 idx = in.ReadLong(); + std::string a = in.Get(); + std::string b = in.Get(); ret.emplace_back(idx, std::make_pair(std::move(a), std::move(b))); } return ret; } CCharacterInfo::CCharacterInfo(CInputStream& in) -: x0_tableCount(in.readUint16Big()) -, x4_name(in.readString()) -, x14_cmdl(in.readUint32Big()) -, x18_cskr(in.readUint32Big()) -, x1c_cinf(in.readUint32Big()) +: x0_tableCount(in.ReadShort()) +, x4_name(in.Get()) +, x14_cmdl(in) +, x18_cskr(in) +, x1c_cinf(in) , x20_animInfo(MakeAnimInfoVector(in)) , x30_pasDatabase(in) , x44_partRes(in, x0_tableCount) -, x84_unk(in.readUint32Big()) { +, x84_unk(in.ReadLong()) { if (x0_tableCount > 1) { - const u32 aabbCount = in.readUint32Big(); + const u32 aabbCount = in.ReadLong(); x88_aabbs.reserve(aabbCount); for (u32 i = 0; i < aabbCount; ++i) { - std::string name = in.readString(); + std::string name = in.Get(); x88_aabbs.emplace_back(std::move(name), zeus::CAABox()); - x88_aabbs.back().second.readBoundingBoxBig(in); + x88_aabbs.back().second = in.Get(); } } if (x0_tableCount > 2) { - const u32 effectCount = in.readUint32Big(); + const u32 effectCount = in.ReadLong(); x98_effects.reserve(effectCount); for (u32 i = 0; i < effectCount; ++i) { - std::string name = in.readString(); + std::string name = in.Get(); x98_effects.emplace_back(std::move(name), std::vector()); std::vector& comps = x98_effects.back().second; - const u32 compCount = in.readUint32Big(); + const u32 compCount = in.ReadLong(); comps.reserve(compCount); for (u32 j = 0; j < compCount; ++j) { comps.emplace_back(in); @@ -79,15 +80,15 @@ CCharacterInfo::CCharacterInfo(CInputStream& in) } if (x0_tableCount > 3) { - xa8_cmdlOverlay = in.readUint32Big(); - xac_cskrOverlay = in.readUint32Big(); + xa8_cmdlOverlay = in.Get(); + xac_cskrOverlay = in.Get(); } if (x0_tableCount > 4) { - const u32 aidxCount = in.readUint32Big(); + const u32 aidxCount = in.ReadLong(); xb0_animIdxs.reserve(aidxCount); for (u32 i = 0; i < aidxCount; ++i) { - xb0_animIdxs.push_back(in.readInt32Big()); + xb0_animIdxs.push_back(in.ReadLong()); } } } diff --git a/Runtime/Character/CCharacterInfo.hpp b/Runtime/Character/CCharacterInfo.hpp index 81dd92902..0ba54758c 100644 --- a/Runtime/Character/CCharacterInfo.hpp +++ b/Runtime/Character/CCharacterInfo.hpp @@ -4,7 +4,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/Character/CEffectComponent.hpp" #include "Runtime/Character/CPASDatabase.hpp" @@ -41,8 +41,8 @@ private: std::vector> x88_aabbs; std::vector>> x98_effects; - CAssetId xa8_cmdlOverlay = 0; - CAssetId xac_cskrOverlay = 0; + CAssetId xa8_cmdlOverlay; + CAssetId xac_cskrOverlay; std::vector xb0_animIdxs; diff --git a/Runtime/Character/CCharacterSet.cpp b/Runtime/Character/CCharacterSet.cpp index a0bc9bbdc..4cc652b4d 100644 --- a/Runtime/Character/CCharacterSet.cpp +++ b/Runtime/Character/CCharacterSet.cpp @@ -2,10 +2,10 @@ namespace metaforce { -CCharacterSet::CCharacterSet(CInputStream& in) : x0_version(in.readUint16Big()) { - u32 charCount = in.readUint32Big(); +CCharacterSet::CCharacterSet(CInputStream& in) : x0_version(in.ReadShort()) { + u32 charCount = in.ReadLong(); for (u32 i = 0; i < charCount; ++i) { - u32 id = in.readUint32Big(); + u32 id = in.ReadLong(); x4_characters.emplace(id, in); } } diff --git a/Runtime/Character/CCharacterSet.hpp b/Runtime/Character/CCharacterSet.hpp index 2addb1bc7..fc1fc4ec3 100644 --- a/Runtime/Character/CCharacterSet.hpp +++ b/Runtime/Character/CCharacterSet.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/GCNTypes.hpp" #include "Runtime/Character/CCharacterInfo.hpp" diff --git a/Runtime/Character/CEffectComponent.cpp b/Runtime/Character/CEffectComponent.cpp index 050a960d9..17f79d617 100644 --- a/Runtime/Character/CEffectComponent.cpp +++ b/Runtime/Character/CEffectComponent.cpp @@ -2,15 +2,15 @@ namespace metaforce { -SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in) { return SObjectTag(in); } +SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in) { return in.Get(); } CEffectComponent::CEffectComponent(CInputStream& in) { - x0_name = in.readString(); + x0_name = in.Get(); x10_tag = GetSObjectTagFromStream(in); - x18_boneName = in.readString(); - x28_scale = in.readFloatBig(); - x2c_parentedMode = CParticleData::EParentedMode(in.readUint32Big()); - x30_flags = in.readUint32Big(); + x18_boneName = in.Get(); + x28_scale = in.ReadFloat(); + x2c_parentedMode = CParticleData::EParentedMode(in.ReadLong()); + x30_flags = in.ReadLong(); } } // namespace metaforce diff --git a/Runtime/Character/CEffectComponent.hpp b/Runtime/Character/CEffectComponent.hpp index 856d33ab1..b691680ed 100644 --- a/Runtime/Character/CEffectComponent.hpp +++ b/Runtime/Character/CEffectComponent.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/Character/CParticleData.hpp" diff --git a/Runtime/Character/CFBStreamedCompression.cpp b/Runtime/Character/CFBStreamedCompression.cpp index a2be29412..f1aaade56 100644 --- a/Runtime/Character/CFBStreamedCompression.cpp +++ b/Runtime/Character/CFBStreamedCompression.cpp @@ -23,8 +23,8 @@ void WriteValue(u8* data, T value) { } // Anonymous namespace CFBStreamedCompression::CFBStreamedCompression(CInputStream& in, IObjectStore& objStore, bool pc) : m_pc(pc) { - x0_scratchSize = in.readUint32Big(); - x4_evnt = in.readUint32Big(); + x0_scratchSize = in.ReadLong(); + x4_evnt = in.Get(); xc_rotsAndOffs = GetRotationsAndOffsets(x0_scratchSize / 4 + 1, in); @@ -86,78 +86,78 @@ std::unique_ptr CFBStreamedCompression::GetRotationsAndOffsets(u32 words, std::memcpy(ret.get(), &head, sizeof(head)); u32* bitmapOut = &ret[9]; - const u32 bitmapBitCount = in.readUint32Big(); + const u32 bitmapBitCount = in.ReadLong(); bitmapOut[0] = bitmapBitCount; const u32 bitmapWordCount = (bitmapBitCount + 31) / 32; for (u32 i = 0; i < bitmapWordCount; ++i) { - bitmapOut[i + 1] = in.readUint32Big(); + bitmapOut[i + 1] = in.ReadLong(); } - in.readUint32Big(); + in.ReadLong(); u8* chans = reinterpret_cast(bitmapOut + bitmapWordCount + 1); u8* bs = ReadBoneChannelDescriptors(chans, in); const u32 bsWords = ComputeBitstreamWords(chans); u32* bsPtr = reinterpret_cast(bs); for (u32 w = 0; w < bsWords; ++w) - bsPtr[w] = in.readUint32Big(); + bsPtr[w] = in.ReadLong(); return ret; } u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in) const { - const u32 boneChanCount = in.readUint32Big(); + const u32 boneChanCount = in.ReadLong(); WriteValue(out, boneChanCount); out += 4; if (m_pc) { for (u32 b = 0; b < boneChanCount; ++b) { - WriteValue(out, in.readUint32Big()); + WriteValue(out, in.ReadLong()); out += 4; - WriteValue(out, in.readUint32Big()); + WriteValue(out, in.ReadLong()); out += 4; for (int i = 0; i < 3; ++i) { - WriteValue(out, in.readUint32Big()); + WriteValue(out, in.ReadLong()); out += 4; } - const u32 tCount = in.readUint32Big(); + const u32 tCount = in.ReadLong(); WriteValue(out, tCount); out += 4; if (tCount != 0) { for (int i = 0; i < 3; ++i) { - WriteValue(out, in.readUint32Big()); + WriteValue(out, in.ReadLong()); out += 4; } } } } else { for (u32 b = 0; b < boneChanCount; ++b) { - WriteValue(out, in.readUint32Big()); + WriteValue(out, in.ReadLong()); out += 4; - WriteValue(out, in.readUint16Big()); + WriteValue(out, in.ReadShort()); out += 2; for (int i = 0; i < 3; ++i) { - WriteValue(out, in.readInt16Big()); + WriteValue(out, in.ReadShort()); out += 2; - WriteValue(out, in.readUByte()); + WriteValue(out, in.ReadUint8()); out += 1; } - const u16 tCount = in.readUint16Big(); + const u16 tCount = in.ReadShort(); WriteValue(out, tCount); out += 2; if (tCount != 0) { for (int i = 0; i < 3; ++i) { - WriteValue(out, in.readInt16Big()); + WriteValue(out, in.ReadShort()); out += 2; - WriteValue(out, in.readUByte()); + WriteValue(out, in.ReadUint8()); out += 1; } } diff --git a/Runtime/Character/CFBStreamedCompression.hpp b/Runtime/Character/CFBStreamedCompression.hpp index 2d06cd1cc..a6aca4390 100644 --- a/Runtime/Character/CFBStreamedCompression.hpp +++ b/Runtime/Character/CFBStreamedCompression.hpp @@ -31,23 +31,23 @@ public: void read(CInputStream& in) { /* unk0 */ - unk0 = in.readUint32Big(); + unk0 = in.ReadLong(); /* duration */ - duration = in.readFloatBig(); + duration = in.ReadFloat(); /* interval */ - interval = in.readFloatBig(); + interval = in.ReadFloat(); /* rootBoneId */ - rootBoneId = in.readUint32Big(); + rootBoneId = in.ReadLong(); /* looping */ - looping = in.readUint32Big(); + looping = in.ReadLong(); /* rotDiv */ - rotDiv = in.readUint32Big(); + rotDiv = in.ReadLong(); /* translationMult */ - translationMult = in.readFloatBig(); + translationMult = in.ReadFloat(); /* boneChannelCount */ - boneChannelCount = in.readUint32Big(); + boneChannelCount = in.ReadLong(); /* unk3 */ - unk3 = in.readUint32Big(); + unk3 = in.ReadLong(); } }; diff --git a/Runtime/Character/CHalfTransition.cpp b/Runtime/Character/CHalfTransition.cpp index 36a00f1e3..43025512f 100644 --- a/Runtime/Character/CHalfTransition.cpp +++ b/Runtime/Character/CHalfTransition.cpp @@ -5,7 +5,7 @@ namespace metaforce { CHalfTransition::CHalfTransition(CInputStream& in) { - x0_id = in.readUint32Big(); + x0_id = in.ReadLong(); x4_trans = CMetaTransFactory::CreateMetaTrans(in); } diff --git a/Runtime/Character/CHalfTransition.hpp b/Runtime/Character/CHalfTransition.hpp index 6d6150fb3..f653ff1cf 100644 --- a/Runtime/Character/CHalfTransition.hpp +++ b/Runtime/Character/CHalfTransition.hpp @@ -3,7 +3,7 @@ #include #include "Runtime/GCNTypes.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaTrans.hpp" namespace metaforce { diff --git a/Runtime/Character/CInt32POINode.cpp b/Runtime/Character/CInt32POINode.cpp index 324ff54f4..3e0cd218b 100644 --- a/Runtime/Character/CInt32POINode.cpp +++ b/Runtime/Character/CInt32POINode.cpp @@ -11,7 +11,7 @@ CInt32POINode::CInt32POINode(std::string_view name, EPOIType type, const CCharAn : CPOINode(name, type, time, index, unique, weight, charIndex, flags), x38_val(val), x3c_locatorName(locator) {} CInt32POINode::CInt32POINode(CInputStream& in) -: CPOINode(in), x38_val(in.readUint32Big()), x3c_locatorName(in.readString()) {} +: CPOINode(in), x38_val(in.ReadLong()), x3c_locatorName(in.Get()) {} CInt32POINode CInt32POINode::CopyNodeMinusStartTime(const CInt32POINode& node, const CCharAnimTime& startTime) { CInt32POINode ret = node; diff --git a/Runtime/Character/CMetaAnimBlend.cpp b/Runtime/Character/CMetaAnimBlend.cpp index 67d81f3d2..30c988ec2 100644 --- a/Runtime/Character/CMetaAnimBlend.cpp +++ b/Runtime/Character/CMetaAnimBlend.cpp @@ -8,8 +8,8 @@ namespace metaforce { CMetaAnimBlend::CMetaAnimBlend(CInputStream& in) { x4_animA = CMetaAnimFactory::CreateMetaAnim(in); x8_animB = CMetaAnimFactory::CreateMetaAnim(in); - xc_blend = in.readFloatBig(); - x10_ = in.readBool(); + xc_blend = in.ReadFloat(); + x10_ = in.ReadBool(); } void CMetaAnimBlend::GetUniquePrimitives(std::set& primsOut) const { diff --git a/Runtime/Character/CMetaAnimBlend.hpp b/Runtime/Character/CMetaAnimBlend.hpp index 8b9997465..ef1d7de9b 100644 --- a/Runtime/Character/CMetaAnimBlend.hpp +++ b/Runtime/Character/CMetaAnimBlend.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaAnim.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaAnimFactory.cpp b/Runtime/Character/CMetaAnimFactory.cpp index daf92802e..b41bc3c11 100644 --- a/Runtime/Character/CMetaAnimFactory.cpp +++ b/Runtime/Character/CMetaAnimFactory.cpp @@ -9,7 +9,7 @@ namespace metaforce { std::shared_ptr CMetaAnimFactory::CreateMetaAnim(CInputStream& in) { - EMetaAnimType type = EMetaAnimType(in.readUint32Big()); + EMetaAnimType type = EMetaAnimType(in.ReadLong()); switch (type) { case EMetaAnimType::Play: diff --git a/Runtime/Character/CMetaAnimFactory.hpp b/Runtime/Character/CMetaAnimFactory.hpp index 8f2d423ee..ea43d0683 100644 --- a/Runtime/Character/CMetaAnimFactory.hpp +++ b/Runtime/Character/CMetaAnimFactory.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaAnim.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaAnimPhaseBlend.cpp b/Runtime/Character/CMetaAnimPhaseBlend.cpp index da9d00cde..42095d332 100644 --- a/Runtime/Character/CMetaAnimPhaseBlend.cpp +++ b/Runtime/Character/CMetaAnimPhaseBlend.cpp @@ -9,8 +9,8 @@ namespace metaforce { CMetaAnimPhaseBlend::CMetaAnimPhaseBlend(CInputStream& in) { x4_animA = CMetaAnimFactory::CreateMetaAnim(in); x8_animB = CMetaAnimFactory::CreateMetaAnim(in); - xc_blend = in.readFloatBig(); - x10_ = in.readBool(); + xc_blend = in.ReadFloat(); + x10_ = in.ReadBool(); } void CMetaAnimPhaseBlend::GetUniquePrimitives(std::set& primsOut) const { diff --git a/Runtime/Character/CMetaAnimPhaseBlend.hpp b/Runtime/Character/CMetaAnimPhaseBlend.hpp index df612b3c2..d798f745d 100644 --- a/Runtime/Character/CMetaAnimPhaseBlend.hpp +++ b/Runtime/Character/CMetaAnimPhaseBlend.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaAnim.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaAnimPlay.hpp b/Runtime/Character/CMetaAnimPlay.hpp index 0508ea1ee..2134bdfc4 100644 --- a/Runtime/Character/CMetaAnimPlay.hpp +++ b/Runtime/Character/CMetaAnimPlay.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CPrimitive.hpp" #include "Runtime/Character/IMetaAnim.hpp" diff --git a/Runtime/Character/CMetaAnimRandom.cpp b/Runtime/Character/CMetaAnimRandom.cpp index 02f1f1342..74cdac9c1 100644 --- a/Runtime/Character/CMetaAnimRandom.cpp +++ b/Runtime/Character/CMetaAnimRandom.cpp @@ -7,12 +7,12 @@ namespace metaforce { CMetaAnimRandom::RandomData CMetaAnimRandom::CreateRandomData(CInputStream& in) { CMetaAnimRandom::RandomData ret; - u32 randCount = in.readUint32Big(); + u32 randCount = in.ReadLong(); ret.reserve(randCount); for (u32 i = 0; i < randCount; ++i) { std::shared_ptr metaAnim = CMetaAnimFactory::CreateMetaAnim(in); - ret.emplace_back(std::move(metaAnim), in.readUint32Big()); + ret.emplace_back(std::move(metaAnim), in.ReadLong()); } return ret; diff --git a/Runtime/Character/CMetaAnimRandom.hpp b/Runtime/Character/CMetaAnimRandom.hpp index 272c01bb6..cf59ebfdc 100644 --- a/Runtime/Character/CMetaAnimRandom.hpp +++ b/Runtime/Character/CMetaAnimRandom.hpp @@ -4,7 +4,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaAnim.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaAnimSequence.cpp b/Runtime/Character/CMetaAnimSequence.cpp index a96539731..ffa717670 100644 --- a/Runtime/Character/CMetaAnimSequence.cpp +++ b/Runtime/Character/CMetaAnimSequence.cpp @@ -7,7 +7,7 @@ namespace metaforce { std::vector> CMetaAnimSequence::CreateSequence(CInputStream& in) { std::vector> ret; - u32 seqCount = in.readUint32Big(); + u32 seqCount = in.ReadLong(); ret.reserve(seqCount); for (u32 i = 0; i < seqCount; ++i) diff --git a/Runtime/Character/CMetaAnimSequence.hpp b/Runtime/Character/CMetaAnimSequence.hpp index f937cce8c..a4d176b9c 100644 --- a/Runtime/Character/CMetaAnimSequence.hpp +++ b/Runtime/Character/CMetaAnimSequence.hpp @@ -3,7 +3,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaAnim.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaTransFactory.cpp b/Runtime/Character/CMetaTransFactory.cpp index 1ae7d87fd..b408d00f1 100644 --- a/Runtime/Character/CMetaTransFactory.cpp +++ b/Runtime/Character/CMetaTransFactory.cpp @@ -8,7 +8,7 @@ namespace metaforce { std::shared_ptr CMetaTransFactory::CreateMetaTrans(CInputStream& in) { - EMetaTransType type = EMetaTransType(in.readUint32Big()); + EMetaTransType type = EMetaTransType(in.ReadLong()); switch (type) { case EMetaTransType::MetaAnim: diff --git a/Runtime/Character/CMetaTransFactory.hpp b/Runtime/Character/CMetaTransFactory.hpp index 503c8331f..b3a80159c 100644 --- a/Runtime/Character/CMetaTransFactory.hpp +++ b/Runtime/Character/CMetaTransFactory.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaTrans.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaTransMetaAnim.hpp b/Runtime/Character/CMetaTransMetaAnim.hpp index 55400a798..201bef08f 100644 --- a/Runtime/Character/CMetaTransMetaAnim.hpp +++ b/Runtime/Character/CMetaTransMetaAnim.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaAnim.hpp" #include "Runtime/Character/IMetaTrans.hpp" diff --git a/Runtime/Character/CMetaTransPhaseTrans.cpp b/Runtime/Character/CMetaTransPhaseTrans.cpp index f158da0aa..7a09cee6b 100644 --- a/Runtime/Character/CMetaTransPhaseTrans.cpp +++ b/Runtime/Character/CMetaTransPhaseTrans.cpp @@ -9,9 +9,9 @@ namespace metaforce { CMetaTransPhaseTrans::CMetaTransPhaseTrans(CInputStream& in) { x4_transDur = CCharAnimTime(in); - xc_ = in.readBool(); - xd_runA = in.readBool(); - x10_flags = in.readUint32Big(); + xc_ = in.ReadBool(); + xd_runA = in.ReadBool(); + x10_flags = in.ReadLong(); } std::shared_ptr CMetaTransPhaseTrans::VGetTransitionTree(const std::weak_ptr& a, diff --git a/Runtime/Character/CMetaTransPhaseTrans.hpp b/Runtime/Character/CMetaTransPhaseTrans.hpp index 08fd2ba98..695824d0a 100644 --- a/Runtime/Character/CMetaTransPhaseTrans.hpp +++ b/Runtime/Character/CMetaTransPhaseTrans.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CCharAnimTime.hpp" #include "Runtime/Character/IMetaTrans.hpp" diff --git a/Runtime/Character/CMetaTransSnap.hpp b/Runtime/Character/CMetaTransSnap.hpp index 091b73f68..5a000bae4 100644 --- a/Runtime/Character/CMetaTransSnap.hpp +++ b/Runtime/Character/CMetaTransSnap.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/IMetaTrans.hpp" namespace metaforce { diff --git a/Runtime/Character/CMetaTransTrans.cpp b/Runtime/Character/CMetaTransTrans.cpp index a64b86b30..914d1755c 100644 --- a/Runtime/Character/CMetaTransTrans.cpp +++ b/Runtime/Character/CMetaTransTrans.cpp @@ -5,10 +5,10 @@ namespace metaforce { CMetaTransTrans::CMetaTransTrans(CInputStream& in) { - x4_transDur = CCharAnimTime(in); - xc_ = in.readBool(); - xd_runA = in.readBool(); - x10_flags = in.readUint32Big(); + x4_transDur = in.Get(); + xc_ = in.ReadBool(); + xd_runA = in.ReadBool(); + x10_flags = in.ReadLong(); } std::shared_ptr CMetaTransTrans::VGetTransitionTree(const std::weak_ptr& a, diff --git a/Runtime/Character/CMetaTransTrans.hpp b/Runtime/Character/CMetaTransTrans.hpp index 5a0b0f2a7..a2e5def1c 100644 --- a/Runtime/Character/CMetaTransTrans.hpp +++ b/Runtime/Character/CMetaTransTrans.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CCharAnimTime.hpp" #include "Runtime/Character/IMetaTrans.hpp" diff --git a/Runtime/Character/CModelData.hpp b/Runtime/Character/CModelData.hpp index 304dbfe82..54b1060b0 100644 --- a/Runtime/Character/CModelData.hpp +++ b/Runtime/Character/CModelData.hpp @@ -23,7 +23,7 @@ struct CModelFlags; struct SAdvancementDeltas; class CStaticRes { - CAssetId x0_cmdlId = 0; + CAssetId x0_cmdlId; zeus::CVector3f x4_scale; public: diff --git a/Runtime/Character/CPASAnimInfo.hpp b/Runtime/Character/CPASAnimInfo.hpp index bcf3f17fd..ff10e4edd 100644 --- a/Runtime/Character/CPASAnimInfo.hpp +++ b/Runtime/Character/CPASAnimInfo.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/rstl.hpp" #include "Runtime/Character/CPASAnimParm.hpp" diff --git a/Runtime/Character/CPASAnimState.cpp b/Runtime/Character/CPASAnimState.cpp index 1c02ffd78..8781f94e2 100644 --- a/Runtime/Character/CPASAnimState.cpp +++ b/Runtime/Character/CPASAnimState.cpp @@ -14,9 +14,9 @@ namespace metaforce { CPASAnimState::CPASAnimState(CInputStream& in) { - x0_id = static_cast(in.readUint32Big()); - u32 parmCount = in.readUint32Big(); - u32 animCount = in.readUint32Big(); + x0_id = static_cast(in.ReadLong()); + u32 parmCount = in.ReadLong(); + u32 animCount = in.ReadLong(); x4_parms.reserve(parmCount); x14_anims.reserve(animCount); @@ -26,25 +26,25 @@ CPASAnimState::CPASAnimState(CInputStream& in) { x4_parms.emplace_back(in); for (u32 i = 0; i < animCount; ++i) { - s32 id = in.readUint32Big(); + s32 id = in.ReadLong(); rstl::reserved_vector parms; for (const CPASParmInfo& parm : x4_parms) { CPASAnimParm::UParmValue val = {}; switch (parm.GetParameterType()) { case CPASAnimParm::EParmType::Int32: - val.m_int = in.readInt32Big(); + val.m_int = in.ReadInt32(); break; case CPASAnimParm::EParmType::UInt32: - val.m_uint = in.readUint32Big(); + val.m_uint = in.ReadLong(); break; case CPASAnimParm::EParmType::Float: - val.m_float = in.readFloatBig(); + val.m_float = in.ReadFloat(); break; case CPASAnimParm::EParmType::Bool: - val.m_bool = in.readBool(); + val.m_bool = in.ReadBool(); break; case CPASAnimParm::EParmType::Enum: - val.m_int = in.readInt32Big(); + val.m_int = in.ReadInt32(); break; default: break; diff --git a/Runtime/Character/CPASAnimState.hpp b/Runtime/Character/CPASAnimState.hpp index 98c258acc..c32329f14 100644 --- a/Runtime/Character/CPASAnimState.hpp +++ b/Runtime/Character/CPASAnimState.hpp @@ -3,7 +3,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CharacterCommon.hpp" #include "Runtime/Character/CPASAnimInfo.hpp" #include "Runtime/Character/CPASParmInfo.hpp" diff --git a/Runtime/Character/CPASDatabase.cpp b/Runtime/Character/CPASDatabase.cpp index d6d922684..d661116e0 100644 --- a/Runtime/Character/CPASDatabase.cpp +++ b/Runtime/Character/CPASDatabase.cpp @@ -17,9 +17,9 @@ void CPASDatabase::AddAnimState(CPASAnimState&& state) { } CPASDatabase::CPASDatabase(CInputStream& in) { - in.readUint32Big(); - u32 animStateCount = in.readUint32Big(); - u32 defaultState = in.readUint32Big(); + in.ReadLong(); + u32 animStateCount = in.ReadLong(); + u32 defaultState = in.ReadLong(); x0_states.reserve(animStateCount); for (u32 i = 0; i < animStateCount; ++i) { diff --git a/Runtime/Character/CPASDatabase.hpp b/Runtime/Character/CPASDatabase.hpp index ddd7d786d..377de5fab 100644 --- a/Runtime/Character/CPASDatabase.hpp +++ b/Runtime/Character/CPASDatabase.hpp @@ -4,7 +4,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CPASAnimState.hpp" namespace metaforce { diff --git a/Runtime/Character/CPASParmInfo.cpp b/Runtime/Character/CPASParmInfo.cpp index 80920c0b4..919f1ff5f 100644 --- a/Runtime/Character/CPASParmInfo.cpp +++ b/Runtime/Character/CPASParmInfo.cpp @@ -2,33 +2,33 @@ namespace metaforce { -CPASParmInfo::CPASParmInfo(CInputStream& in) { +CPASParmInfo::CPASParmInfo(CInputStream& in) +: x0_type(CPASAnimParm::EParmType(in.ReadLong())), x4_weightFunction(EWeightFunction(in.ReadLong())) { xc_min.m_int = 0; x10_max.m_int = 0; - x0_type = CPASAnimParm::EParmType(in.readUint32Big()); - x4_weightFunction = EWeightFunction(in.readUint32Big()); - x8_weight = in.readFloatBig(); + + x8_weight = in.ReadFloat(); switch (x0_type) { case CPASAnimParm::EParmType::Int32: - xc_min.m_int = in.readInt32Big(); - x10_max.m_int = in.readInt32Big(); + xc_min.m_int = in.ReadInt32(); + x10_max.m_int = in.ReadInt32(); break; case CPASAnimParm::EParmType::UInt32: - xc_min.m_uint = in.readUint32Big(); - x10_max.m_uint = in.readUint32Big(); + xc_min.m_uint = in.ReadLong(); + x10_max.m_uint = in.ReadLong(); break; case CPASAnimParm::EParmType::Float: - xc_min.m_float = in.readFloatBig(); - x10_max.m_float = in.readFloatBig(); + xc_min.m_float = in.ReadFloat(); + x10_max.m_float = in.ReadFloat(); break; case CPASAnimParm::EParmType::Bool: - xc_min.m_bool = in.readBool(); - x10_max.m_bool = in.readBool(); + xc_min.m_bool = in.ReadBool(); + x10_max.m_bool = in.ReadBool(); break; case CPASAnimParm::EParmType::Enum: - xc_min.m_int = in.readInt32Big(); - x10_max.m_int = in.readInt32Big(); + xc_min.m_int = in.ReadInt32(); + x10_max.m_int = in.ReadInt32(); break; default: break; diff --git a/Runtime/Character/CPASParmInfo.hpp b/Runtime/Character/CPASParmInfo.hpp index 6b10b5dd0..2254be364 100644 --- a/Runtime/Character/CPASParmInfo.hpp +++ b/Runtime/Character/CPASParmInfo.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CPASAnimParm.hpp" namespace metaforce { diff --git a/Runtime/Character/CPOINode.cpp b/Runtime/Character/CPOINode.cpp index 9e3ece784..911c1c107 100644 --- a/Runtime/Character/CPOINode.cpp +++ b/Runtime/Character/CPOINode.cpp @@ -21,15 +21,15 @@ CPOINode::CPOINode(std::string_view name, EPOIType type, const CCharAnimTime& ti , x34_flags(f) {} CPOINode::CPOINode(CInputStream& in) -: x4_(in.readUint16Big()) -, x8_name(in.readString()) -, x18_type(EPOIType(in.readUint16Big())) +: x4_(in.ReadShort()) +, x8_name(in.Get()) +, x18_type(EPOIType(in.ReadShort())) , x1c_time(in) -, x24_index(in.readInt32Big()) -, x28_unique(in.readBool()) -, x2c_weight(in.readFloatBig()) -, x30_charIdx(in.readInt32Big()) -, x34_flags(in.readInt32Big()) {} +, x24_index(in.ReadInt32()) +, x28_unique(in.ReadBool()) +, x2c_weight(in.ReadFloat()) +, x30_charIdx(in.ReadInt32()) +, x34_flags(in.ReadInt32()) {} bool CPOINode::operator>(const CPOINode& other) const { return x1c_time > other.x1c_time; } diff --git a/Runtime/Character/CPOINode.hpp b/Runtime/Character/CPOINode.hpp index c7e2bdbff..1ff7dd796 100644 --- a/Runtime/Character/CPOINode.hpp +++ b/Runtime/Character/CPOINode.hpp @@ -3,7 +3,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CCharAnimTime.hpp" namespace metaforce { diff --git a/Runtime/Character/CParticleData.cpp b/Runtime/Character/CParticleData.cpp index c54b8bc26..3b0b11905 100644 --- a/Runtime/Character/CParticleData.cpp +++ b/Runtime/Character/CParticleData.cpp @@ -3,10 +3,10 @@ namespace metaforce { CParticleData::CParticleData(CInputStream& in) -: x0_duration(in.readUint32Big()) +: x0_duration(in.ReadLong()) , x4_particle(in) -, xc_boneName(in.readString()) -, x1c_scale(in.readFloatBig()) -, x20_parentMode(EParentedMode(in.readUint32Big())) {} +, xc_boneName(in.Get()) +, x1c_scale(in.ReadFloat()) +, x20_parentMode(EParentedMode(in.ReadLong())) {} } // namespace metaforce diff --git a/Runtime/Character/CParticleData.hpp b/Runtime/Character/CParticleData.hpp index 80f14dbd7..c74836b2e 100644 --- a/Runtime/Character/CParticleData.hpp +++ b/Runtime/Character/CParticleData.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" #include diff --git a/Runtime/Character/CPrimitive.cpp b/Runtime/Character/CPrimitive.cpp index 3857528c0..8963e19f4 100644 --- a/Runtime/Character/CPrimitive.cpp +++ b/Runtime/Character/CPrimitive.cpp @@ -3,9 +3,9 @@ namespace metaforce { CPrimitive::CPrimitive(CInputStream& in) { - x0_animId = in.readUint32Big(); - x4_animIdx = in.readUint32Big(); - x8_animName = in.readString(); + x0_animId = in.Get(); + x4_animIdx = in.ReadLong(); + x8_animName = in.Get(); } } // namespace metaforce diff --git a/Runtime/Character/CPrimitive.hpp b/Runtime/Character/CPrimitive.hpp index 0fcf01c49..4ea7eefda 100644 --- a/Runtime/Character/CPrimitive.hpp +++ b/Runtime/Character/CPrimitive.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" namespace metaforce { diff --git a/Runtime/Character/CSegId.hpp b/Runtime/Character/CSegId.hpp index 3bcaa78d2..2721df78d 100644 --- a/Runtime/Character/CSegId.hpp +++ b/Runtime/Character/CSegId.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/RetroTypes.hpp" namespace metaforce { @@ -11,7 +11,7 @@ class CSegId { public: constexpr CSegId() noexcept = default; constexpr CSegId(u8 id) noexcept : x0_segId(id) {} - explicit CSegId(CInputStream& in) : x0_segId(in.readUint32Big()) {} + explicit CSegId(CInputStream& in) : x0_segId(in.ReadLong()) {} constexpr CSegId& operator++() noexcept { ++x0_segId; return *this; diff --git a/Runtime/Character/CSegIdList.cpp b/Runtime/Character/CSegIdList.cpp index aecb44d48..9ece5f11d 100644 --- a/Runtime/Character/CSegIdList.cpp +++ b/Runtime/Character/CSegIdList.cpp @@ -3,7 +3,7 @@ namespace metaforce { CSegIdList::CSegIdList(CInputStream& in) { - u32 count = in.readUint32Big(); + u32 count = in.ReadLong(); x0_list.reserve(count); for (u32 i = 0; i < count; ++i) x0_list.emplace_back(in); diff --git a/Runtime/Character/CSegIdList.hpp b/Runtime/Character/CSegIdList.hpp index 8ff76daa3..079973e6d 100644 --- a/Runtime/Character/CSegIdList.hpp +++ b/Runtime/Character/CSegIdList.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CSegId.hpp" namespace metaforce { diff --git a/Runtime/Character/CSkinBank.cpp b/Runtime/Character/CSkinBank.cpp index 487a58875..ca9f42406 100644 --- a/Runtime/Character/CSkinBank.cpp +++ b/Runtime/Character/CSkinBank.cpp @@ -5,7 +5,7 @@ namespace metaforce { CSkinBank::CSkinBank(CInputStream& in) { - u32 boneCount = in.readUint32Big(); + u32 boneCount = in.ReadLong(); x0_segments.reserve(boneCount); for (u32 i = 0; i < boneCount; ++i) x0_segments.emplace_back(in); diff --git a/Runtime/Character/CSkinBank.hpp b/Runtime/Character/CSkinBank.hpp index 843a12c1e..8d0236cd7 100644 --- a/Runtime/Character/CSkinBank.hpp +++ b/Runtime/Character/CSkinBank.hpp @@ -2,7 +2,7 @@ #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CSegId.hpp" namespace metaforce { diff --git a/Runtime/Character/CSkinRules.cpp b/Runtime/Character/CSkinRules.cpp index dce9d3b2e..c2ae2c722 100644 --- a/Runtime/Character/CSkinRules.cpp +++ b/Runtime/Character/CSkinRules.cpp @@ -7,16 +7,21 @@ namespace metaforce { static u32 ReadCount(CInputStream& in) { - u32 result = in.readUint32Big(); - if (result == UINT32_MAX) { - return in.readUint32Big(); + s32 result = in.ReadLong(); + if (result == -1) { + return in.ReadLong(); + } + u8 junk[784]; + for (u32 i = 0; i < (result * 3); ++i) { + u32 iVar2 = ((result * 3) - i); + iVar2 = 192 < iVar2 ? 192 : iVar2; + in.Get(junk, iVar2 * 4); } - in.seek(s64(result) * 3); return result; } CSkinRules::CSkinRules(CInputStream& in) { - u32 weightCount = in.readUint32Big(); + u32 weightCount = in.ReadLong(); x0_bones.reserve(weightCount); for (int i = 0; i < weightCount; ++i) { x0_bones.emplace_back(in); @@ -51,7 +56,7 @@ CFactoryFnReturn FSkinRulesFactory(const SObjectTag& tag, CInputStream& in, cons auto StreamInSkinWeighting(CInputStream& in) { rstl::reserved_vector weights; - u32 weightCount = in.readUint32Big(); + u32 weightCount = in.ReadLong(); for (int i = 0; i < std::min(3u, weightCount); ++i) { weights.emplace_back(in); } @@ -62,5 +67,5 @@ auto StreamInSkinWeighting(CInputStream& in) { } CVirtualBone::CVirtualBone(CInputStream& in) -: x0_weights(StreamInSkinWeighting(in)), x1c_vertexCount(in.readUint32Big()) {} +: x0_weights(StreamInSkinWeighting(in)), x1c_vertexCount(in.ReadLong()) {} } // namespace metaforce diff --git a/Runtime/Character/CSkinRules.hpp b/Runtime/Character/CSkinRules.hpp index 109c9a783..817c68df6 100644 --- a/Runtime/Character/CSkinRules.hpp +++ b/Runtime/Character/CSkinRules.hpp @@ -15,7 +15,7 @@ class CModel; struct SSkinWeighting { CSegId x0_id; float x4_weight; - explicit SSkinWeighting(CInputStream& in) : x0_id(in), x4_weight(in.readFloatBig()) {} + explicit SSkinWeighting(CInputStream& in) : x0_id(in), x4_weight(in.ReadFloat()) {} }; class CVirtualBone { @@ -32,8 +32,8 @@ public: class CSkinRules { std::vector x0_bones; - u32 x10_vertexCount; - u32 x14_normalCount; + u32 x10_vertexCount = 0; + u32 x14_normalCount = 0; public: explicit CSkinRules(CInputStream& in); diff --git a/Runtime/Character/CSoundPOINode.cpp b/Runtime/Character/CSoundPOINode.cpp index 53a2b3c1f..3f65d7c4b 100644 --- a/Runtime/Character/CSoundPOINode.cpp +++ b/Runtime/Character/CSoundPOINode.cpp @@ -11,7 +11,7 @@ CSoundPOINode::CSoundPOINode() , x40_maxDist(0.f) {} CSoundPOINode::CSoundPOINode(CInputStream& in) -: CPOINode(in), x38_sfxId(in.readUint32Big()), x3c_falloff(in.readFloatBig()), x40_maxDist(in.readFloatBig()) {} +: CPOINode(in), x38_sfxId(in.ReadLong()), x3c_falloff(in.ReadFloat()), x40_maxDist(in.ReadFloat()) {} CSoundPOINode::CSoundPOINode(std::string_view name, EPOIType a, const CCharAnimTime& time, u32 b, bool c, float d, u32 e, u32 f, u32 sfxId, float falloff, float maxDist) diff --git a/Runtime/Character/CTransition.cpp b/Runtime/Character/CTransition.cpp index db98cd867..358fb1745 100644 --- a/Runtime/Character/CTransition.cpp +++ b/Runtime/Character/CTransition.cpp @@ -3,9 +3,9 @@ namespace metaforce { CTransition::CTransition(CInputStream& in) -: x0_id(in.readUint32Big()) -, x4_animA(in.readUint32Big()) -, x8_animB(in.readUint32Big()) +: x0_id(in.ReadLong()) +, x4_animA(in.ReadLong()) +, x8_animB(in.ReadLong()) , xc_trans(CMetaTransFactory::CreateMetaTrans(in)) {} } // namespace metaforce diff --git a/Runtime/Character/CTransition.hpp b/Runtime/Character/CTransition.hpp index 8a062f03f..c79209a1b 100644 --- a/Runtime/Character/CTransition.hpp +++ b/Runtime/Character/CTransition.hpp @@ -3,7 +3,7 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Character/CMetaTransFactory.hpp" namespace metaforce { diff --git a/Runtime/Collision/CAreaOctTree.cpp b/Runtime/Collision/CAreaOctTree.cpp index 5cf30f2a3..b9d29297a 100644 --- a/Runtime/Collision/CAreaOctTree.cpp +++ b/Runtime/Collision/CAreaOctTree.cpp @@ -1,14 +1,14 @@ #include "Runtime/Collision/CAreaOctTree.hpp" +#include "Runtime/CBasics.hpp" #include "Runtime/Collision/CMaterialFilter.hpp" -#include "IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include #include #include #include -#include #include namespace metaforce { @@ -479,27 +479,27 @@ CAreaOctTree::Node CAreaOctTree::Node::GetChild(int idx) const { void CAreaOctTree::SwapTreeNode(u8* ptr, Node::ETreeType type) { if (type == Node::ETreeType::Branch) { u16* typeBits = reinterpret_cast(ptr); - *typeBits = hecl::SBig(*typeBits); + *typeBits = CBasics::SwapBytes(*typeBits); u32* offsets = reinterpret_cast(ptr + 4); for (int i = 0; i < 8; ++i) { Node::ETreeType ctype = Node::ETreeType((*typeBits >> (2 * i)) & 0x3); - offsets[i] = hecl::SBig(offsets[i]); + offsets[i] = CBasics::SwapBytes(offsets[i]); SwapTreeNode(ptr + offsets[i] + 36, ctype); } } else if (type == Node::ETreeType::Leaf) { float* aabb = reinterpret_cast(ptr); - aabb[0] = hecl::SBig(aabb[0]); - aabb[1] = hecl::SBig(aabb[1]); - aabb[2] = hecl::SBig(aabb[2]); - aabb[3] = hecl::SBig(aabb[3]); - aabb[4] = hecl::SBig(aabb[4]); - aabb[5] = hecl::SBig(aabb[5]); + aabb[0] = CBasics::SwapBytes(aabb[0]); + aabb[1] = CBasics::SwapBytes(aabb[1]); + aabb[2] = CBasics::SwapBytes(aabb[2]); + aabb[3] = CBasics::SwapBytes(aabb[3]); + aabb[4] = CBasics::SwapBytes(aabb[4]); + aabb[5] = CBasics::SwapBytes(aabb[5]); u16* countIdxs = reinterpret_cast(ptr + 24); - *countIdxs = hecl::SBig(*countIdxs); + *countIdxs = CBasics::SwapBytes(*countIdxs); for (u16 i = 0; i < *countIdxs; ++i) - countIdxs[i + 1] = hecl::SBig(countIdxs[i + 1]); + countIdxs[i + 1] = CBasics::SwapBytes(countIdxs[i + 1]); } } @@ -525,62 +525,61 @@ CAreaOctTree::CAreaOctTree(const zeus::CAABox& aabb, Node::ETreeType treeType, c SwapTreeNode(const_cast(x20_treeBuf), treeType); for (u32 i = 0; i < matCount; ++i) - const_cast(x28_materials)[i] = hecl::SBig(x28_materials[i]); + const_cast(x28_materials)[i] = CBasics::SwapBytes(x28_materials[i]); for (u32 i = 0; i < edgeCount; ++i) const_cast(x3c_edges)[i].swapBig(); for (u32 i = 0; i < polyCount; ++i) - const_cast(x44_polyEdges)[i] = hecl::SBig(x44_polyEdges[i]); + const_cast(x44_polyEdges)[i] = CBasics::SwapBytes(x44_polyEdges[i]); for (u32 i = 0; i < vertCount * 3; ++i) - const_cast(x4c_verts)[i] = hecl::SBig(x4c_verts[i]); + const_cast(x4c_verts)[i] = CBasics::SwapBytes(x4c_verts[i]); } std::unique_ptr CAreaOctTree::MakeFromMemory(const u8* buf, unsigned int size) { - athena::io::MemoryReader r(buf + 8, size - 8); - r.readUint32Big(); - r.readUint32Big(); - zeus::CAABox aabb; - aabb.readBoundingBoxBig(r); - Node::ETreeType nodeType = Node::ETreeType(r.readUint32Big()); - u32 treeSize = r.readUint32Big(); - const u8* cur = reinterpret_cast(buf) + 8 + r.position(); + CMemoryInStream r(buf + 8, size - 8, CMemoryInStream::EOwnerShip::NotOwned); + r.ReadLong(); + r.ReadLong(); + zeus::CAABox aabb = r.Get(); + Node::ETreeType nodeType = Node::ETreeType(r.ReadLong()); + u32 treeSize = r.ReadLong(); + const u8* cur = reinterpret_cast(buf) + 8 + r.GetReadPosition(); const u8* treeBuf = cur; cur += treeSize; - u32 matCount = hecl::SBig(*reinterpret_cast(cur)); + u32 matCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const u32* matBuf = reinterpret_cast(cur); cur += 4 * matCount; - u32 vertMatsCount = hecl::SBig(*reinterpret_cast(cur)); + u32 vertMatsCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const u8* vertMatsBuf = cur; cur += vertMatsCount; - u32 edgeMatsCount = hecl::SBig(*reinterpret_cast(cur)); + u32 edgeMatsCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const u8* edgeMatsBuf = cur; cur += edgeMatsCount; - u32 polyMatsCount = hecl::SBig(*reinterpret_cast(cur)); + u32 polyMatsCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const u8* polyMatsBuf = cur; cur += polyMatsCount; - u32 edgeCount = hecl::SBig(*reinterpret_cast(cur)); + u32 edgeCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const CCollisionEdge* edgeBuf = reinterpret_cast(cur); cur += edgeCount * sizeof(edgeCount); - u32 polyCount = hecl::SBig(*reinterpret_cast(cur)); + u32 polyCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const u16* polyBuf = reinterpret_cast(cur); cur += polyCount * 2; - u32 vertCount = hecl::SBig(*reinterpret_cast(cur)); + u32 vertCount = CBasics::SwapBytes(*reinterpret_cast(cur)); cur += 4; const float* vertBuf = reinterpret_cast(cur); diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.cpp b/Runtime/Collision/CCollidableOBBTreeGroup.cpp index fcedbe3c4..8d59ccc5b 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.cpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.cpp @@ -11,7 +11,7 @@ namespace metaforce { constexpr CCollisionPrimitive::Type sType(CCollidableOBBTreeGroup::SetStaticTableIndex, "CCollidableOBBTreeGroup"); CCollidableOBBTreeGroupContainer::CCollidableOBBTreeGroupContainer(CInputStream& in) { - const u32 treeCount = in.readUint32Big(); + const u32 treeCount = in.ReadLong(); x0_trees.reserve(treeCount); for (u32 i = 0; i < treeCount; i++) { diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.hpp b/Runtime/Collision/CCollidableOBBTreeGroup.hpp index 27e43045b..8b445d69f 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.hpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.hpp @@ -4,7 +4,7 @@ #include #include "Runtime/CFactoryMgr.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Collision/COBBTree.hpp" #include "Runtime/Collision/CCollisionPrimitive.hpp" diff --git a/Runtime/Collision/CCollisionEdge.cpp b/Runtime/Collision/CCollisionEdge.cpp index d7733136b..aa107b558 100644 --- a/Runtime/Collision/CCollisionEdge.cpp +++ b/Runtime/Collision/CCollisionEdge.cpp @@ -1,8 +1,9 @@ #include "Runtime/Collision/CCollisionEdge.hpp" +#include "Runtime/Streams/CInputStream.hpp" namespace metaforce { CCollisionEdge::CCollisionEdge(CInputStream& in) { - x0_index1 = in.readUint16Big(); - x2_index2 = in.readUint16Big(); + x0_index1 = in.ReadShort(); + x2_index2 = in.ReadShort(); } } // namespace metaforce diff --git a/Runtime/Collision/CCollisionResponseData.cpp b/Runtime/Collision/CCollisionResponseData.cpp index e99c8fbc1..cff473279 100644 --- a/Runtime/Collision/CCollisionResponseData.cpp +++ b/Runtime/Collision/CCollisionResponseData.cpp @@ -100,7 +100,7 @@ bool CCollisionResponseData::CheckAndAddDecalToResponse(FourCC clsId, CInputStre return true; } - const CAssetId id{u64(in.readUint32Big())}; + const CAssetId id = in.Get(); if (!id.IsValid()) { return true; } diff --git a/Runtime/Collision/CCollisionResponseData.hpp b/Runtime/Collision/CCollisionResponseData.hpp index 351f367c4..4901e0c69 100644 --- a/Runtime/Collision/CCollisionResponseData.hpp +++ b/Runtime/Collision/CCollisionResponseData.hpp @@ -5,7 +5,7 @@ #include "Runtime/CFactoryMgr.hpp" #include "Runtime/CToken.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/IObj.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/Collision/CMaterialList.hpp" diff --git a/Runtime/Collision/COBBTree.cpp b/Runtime/Collision/COBBTree.cpp index fec3facd0..aa54e57b9 100644 --- a/Runtime/Collision/COBBTree.cpp +++ b/Runtime/Collision/COBBTree.cpp @@ -41,16 +41,16 @@ constexpr std::array DefaultSurfaceIndices{ }; /* This is exactly what retro did >.< */ -u32 verify_deaf_babe(CInputStream& in) { return in.readUint32Big(); } +u32 verify_deaf_babe(CInputStream& in) { return in.ReadLong(); } /* This is exactly what retro did >.< */ -u32 verify_version(CInputStream& in) { return in.readUint32Big(); } +u32 verify_version(CInputStream& in) { return in.ReadLong(); } } // Anonymous namespace COBBTree::COBBTree(CInputStream& in) : x0_magic(verify_deaf_babe(in)) , x4_version(verify_version(in)) -, x8_memsize(in.readUint32()) +, x8_memsize(in.ReadLong()) , x18_indexData(in) , x88_root(std::make_unique(in)) {} @@ -158,38 +158,38 @@ zeus::CAABox COBBTree::CalculateAABox(const zeus::CTransform& xf) const { } COBBTree::SIndexData::SIndexData(CInputStream& in) { - u32 count = in.readUint32Big(); + u32 count = in.ReadLong(); x0_materials.reserve(count); for (u32 i = 0; i < count; i++) { - x0_materials.emplace_back(in.readUint32Big()); + x0_materials.emplace_back(in.ReadLong()); } - count = in.readUint32Big(); + count = in.ReadLong(); for (u32 i = 0; i < count; i++) { - x10_vertMaterials.emplace_back(in.readUByte()); + x10_vertMaterials.emplace_back(in.ReadUint8()); } - count = in.readUint32Big(); + count = in.ReadLong(); for (u32 i = 0; i < count; i++) { - x20_edgeMaterials.emplace_back(in.readUByte()); + x20_edgeMaterials.emplace_back(in.ReadUint8()); } - count = in.readUint32Big(); + count = in.ReadLong(); for (u32 i = 0; i < count; i++) { - x30_surfaceMaterials.emplace_back(in.readUByte()); + x30_surfaceMaterials.emplace_back(in.ReadUint8()); } - count = in.readUint32Big(); + count = in.ReadLong(); for (u32 i = 0; i < count; i++) { x40_edges.emplace_back(in); } - count = in.readUint32Big(); + count = in.ReadLong(); for (u32 i = 0; i < count; i++) { - x50_surfaceIndices.emplace_back(in.readUint16Big()); + x50_surfaceIndices.emplace_back(in.ReadShort()); } - count = in.readUint32Big(); + count = in.ReadLong(); for (u32 i = 0; i < count; i++) { - x60_vertices.emplace_back(zeus::CVector3f::ReadBig(in)); + x60_vertices.emplace_back(in.Get()); } } @@ -202,8 +202,8 @@ COBBTree::CNode::CNode(const zeus::CTransform& xf, const zeus::CVector3f& point, , x48_leaf(std::move(leaf)) {} COBBTree::CNode::CNode(CInputStream& in) { - x0_obb = zeus::COBBox::ReadBig(in); - x3c_isLeaf = in.readBool(); + x0_obb = in.Get(); + x3c_isLeaf = in.ReadBool(); if (x3c_isLeaf) x48_leaf = std::make_unique(in); else { @@ -236,9 +236,9 @@ size_t COBBTree::CLeafData::GetMemoryUsage() const { } COBBTree::CLeafData::CLeafData(CInputStream& in) { - const u32 edgeCount = in.readUint32Big(); + const u32 edgeCount = in.ReadLong(); for (u32 i = 0; i < edgeCount; i++) { - x0_surface.emplace_back(in.readUint16Big()); + x0_surface.emplace_back(in.ReadShort()); } } diff --git a/hecl/lib/CVar.cpp b/Runtime/ConsoleVariables/CVar.cpp similarity index 74% rename from hecl/lib/CVar.cpp rename to Runtime/ConsoleVariables/CVar.cpp index 6c7934285..2125174cf 100644 --- a/hecl/lib/CVar.cpp +++ b/Runtime/ConsoleVariables/CVar.cpp @@ -1,13 +1,63 @@ -#include "hecl/CVar.hpp" +#include "Runtime/ConsoleVariables/CVar.hpp" +#include "Runtime/CBasics.hpp" + +#include #include -#include "hecl/CVarManager.hpp" -#include "hecl/hecl.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" -#include +namespace metaforce { +namespace { +// TODO: Move these to CBasics? +inline bool parseBool(std::string_view boolean, bool* valid) { + std::string val(boolean); + // compare must be case insensitive + // This is the cleanest solution since I only need to do it once + CBasics::ToLower(val); -namespace hecl { + // Check for true first + if (val == "true" || val == "1" || val == "yes" || val == "on") { + if (valid) + *valid = true; + + return true; + } + + // Now false + if (val == "false" || val == "0" || val == "no" || val == "off") { + if (valid) + *valid = true; + + return false; + } + + // Well that could've gone better + + if (valid) + *valid = false; + + return false; +} + +static std::vector& split(std::string_view s, char delim, std::vector& elems) { + std::string tmps(s); + std::stringstream ss(tmps); + std::string item; + + while (std::getline(ss, item, delim)) { + elems.push_back(item); + } + + return elems; +} + +std::vector split(std::string_view s, char delim) { + std::vector elems; + split(s, delim, elems); + return elems; +} +} extern CVar* com_developer; extern CVar* com_enableCheats; @@ -19,38 +69,38 @@ CVar::CVar(std::string_view name, std::string_view value, std::string_view help, init(flags); } -CVar::CVar(std::string_view name, const atVec2f& value, std::string_view help, EFlags flags) +CVar::CVar(std::string_view name, const zeus::CVector2f& value, std::string_view help, EFlags flags) : CVar(name, help, EType::Vec2f) { fromVec2f(value); init(flags); } -CVar::CVar(std::string_view name, const atVec2d& value, std::string_view help, EFlags flags) +CVar::CVar(std::string_view name, const zeus::CVector2d& value, std::string_view help, EFlags flags) : CVar(name, help, EType::Vec2d) { fromVec2d(value); init(flags); } -CVar::CVar(std::string_view name, const atVec3f& value, std::string_view help, EFlags flags) +CVar::CVar(std::string_view name, const zeus::CVector3f& value, std::string_view help, EFlags flags) : CVar(name, help, EType::Vec3f) { fromVec3f(value); init(flags, false); } -CVar::CVar(std::string_view name, const atVec3d& value, std::string_view help, EFlags flags) +CVar::CVar(std::string_view name, const zeus::CVector3d& value, std::string_view help, EFlags flags) : CVar(name, help, EType::Vec3d) { fromVec3d(value); init(flags, false); } -CVar::CVar(std::string_view name, const atVec4f& value, std::string_view help, EFlags flags) +CVar::CVar(std::string_view name, const zeus::CVector4f& value, std::string_view help, EFlags flags) : CVar(name, help, EType::Vec4f) { fromVec4f(value); init(flags, false); } -CVar::CVar(std::string_view name, const atVec4d& value, std::string_view help, EFlags flags) +CVar::CVar(std::string_view name, const zeus::CVector4d& value, std::string_view help, EFlags flags) : CVar(name, help, EType::Vec4d) { fromVec4d(value); init(flags, false); @@ -83,118 +133,100 @@ std::string CVar::help() const { return m_help + (m_defaultValue.empty() ? "" : "\ndefault: " + m_defaultValue) + (isReadOnly() ? " [ReadOnly]" : ""); } -atVec2f CVar::toVec2f(bool* isValid) const { +zeus::CVector2f CVar::toVec2f(bool* isValid) const { if (m_type != EType::Vec2f) { if (isValid != nullptr) *isValid = false; - return atVec2f{}; + return {}; } if (isValid != nullptr) *isValid = true; - atVec2f vec{}; - athena::simd_floats f; + std::array f; std::sscanf(m_value.c_str(), "%g %g", &f[0], &f[1]); - vec.simd.copy_from(f); - - return vec; + return {f[0], f[1]}; } -atVec2d CVar::toVec2d(bool* isValid) const { +zeus::CVector2d CVar::toVec2d(bool* isValid) const { if (m_type != EType::Vec2d) { if (isValid != nullptr) *isValid = false; - return atVec2d{}; + return {}; } if (isValid != nullptr) *isValid = true; - atVec2d vec{}; - athena::simd_doubles f; + std::array f; std::sscanf(m_value.c_str(), "%lg %lg", &f[0], &f[1]); - vec.simd.copy_from(f); - - return vec; + return {f[0], f[1]}; } -atVec3f CVar::toVec3f(bool* isValid) const { +zeus::CVector3f CVar::toVec3f(bool* isValid) const { if (m_type != EType::Vec3f) { if (isValid != nullptr) *isValid = false; - return atVec3f{}; + return {}; } if (isValid != nullptr) *isValid = true; - atVec3f vec{}; - athena::simd_floats f; + std::array f; std::sscanf(m_value.c_str(), "%g %g %g", &f[0], &f[1], &f[2]); - vec.simd.copy_from(f); - - return vec; + return {f[0], f[1], f[2]}; } -atVec3d CVar::toVec3d(bool* isValid) const { +zeus::CVector3d CVar::toVec3d(bool* isValid) const { if (m_type != EType::Vec3d) { if (isValid != nullptr) *isValid = false; - return atVec3d{}; + return {}; } if (isValid != nullptr) *isValid = true; - atVec3d vec{}; - athena::simd_doubles f; + std::array f; std::sscanf(m_value.c_str(), "%lg %lg %lg", &f[0], &f[1], &f[2]); - vec.simd.copy_from(f); - - return vec; + return {f[0], f[1], f[2]}; } -atVec4f CVar::toVec4f(bool* isValid) const { +zeus::CVector4f CVar::toVec4f(bool* isValid) const { if (m_type != EType::Vec4f) { if (isValid != nullptr) *isValid = false; - return atVec4f{}; + return {}; } if (isValid != nullptr) *isValid = true; - atVec4f vec{}; - athena::simd_floats f; + std::array f; std::sscanf(m_value.c_str(), "%g %g %g %g", &f[0], &f[1], &f[2], &f[3]); - vec.simd.copy_from(f); - - return vec; + return {f[0], f[1], f[2], f[3]}; } -atVec4d CVar::toVec4d(bool* isValid) const { +zeus::CVector4d CVar::toVec4d(bool* isValid) const { if (m_type != EType::Vec4d) { if (isValid != nullptr) *isValid = false; - return atVec4d{}; + return {}; } if (isValid != nullptr) *isValid = true; - atVec4d vec{}; - athena::simd_doubles f; + std::array f{}; std::sscanf(m_value.c_str(), "%lg %lg %lg %lg", &f[0], &f[1], &f[2], &f[3]); - vec.simd.copy_from(f); - - return vec; + return {f[0], f[1], f[2], f[3]}; } double CVar::toReal(bool* isValid) const { @@ -218,7 +250,7 @@ bool CVar::toBoolean(bool* isValid) const { return false; } - return athena::utility::parseBool(m_value, isValid); + return parseBool(m_value, isValid); } int32_t CVar::toSigned(bool* isValid) const { @@ -259,62 +291,56 @@ std::string CVar::toLiteral(bool* isValid) const { return m_value; } -bool CVar::fromVec2f(const atVec2f& val) { +bool CVar::fromVec2f(const zeus::CVector2f& val) { if (!safeToModify(EType::Vec2f)) return false; - athena::simd_floats f(val.simd); - m_value.assign(fmt::format(FMT_STRING("{} {}"), f[0], f[1])); + m_value.assign(fmt::format(FMT_STRING("{} {}"), val.x(), val.y())); m_flags |= EFlags::Modified; return true; } -bool CVar::fromVec2d(const atVec2d& val) { +bool CVar::fromVec2d(const zeus::CVector2d& val) { if (!safeToModify(EType::Vec2d)) return false; - athena::simd_doubles f(val.simd); - m_value.assign(fmt::format(FMT_STRING("{} {}"), f[0], f[1])); + m_value.assign(fmt::format(FMT_STRING("{} {}"), val.x(), val.y())); m_flags |= EFlags::Modified; return true; } -bool CVar::fromVec3f(const atVec3f& val) { +bool CVar::fromVec3f(const zeus::CVector3f& val) { if (!safeToModify(EType::Vec3f)) return false; - athena::simd_floats f(val.simd); - m_value.assign(fmt::format(FMT_STRING("{} {} {}"), f[0], f[1], f[2])); + m_value.assign(fmt::format(FMT_STRING("{} {} {}"), val.x(), val.y(), val.z())); m_flags |= EFlags::Modified; return true; } -bool CVar::fromVec3d(const atVec3d& val) { +bool CVar::fromVec3d(const zeus::CVector3d& val) { if (!safeToModify(EType::Vec3d)) return false; - athena::simd_doubles f(val.simd); - m_value.assign(fmt::format(FMT_STRING("{} {} {}"), f[0], f[1], f[2])); + m_value.assign(fmt::format(FMT_STRING("{} {} {}"), val.x(), val.y(), val.z())); m_flags |= EFlags::Modified; return true; } -bool CVar::fromVec4f(const atVec4f& val) { +bool CVar::fromVec4f(const zeus::CVector4f& val) { if (!safeToModify(EType::Vec4f)) return false; - athena::simd_floats f(val.simd); - m_value.assign(fmt::format(FMT_STRING("{} {} {} {}"), f[0], f[1], f[2], f[3])); + m_value.assign(fmt::format(FMT_STRING("{} {} {} {}"), val.x(), val.y(), val.z(), val.w())); m_flags |= EFlags::Modified; return true; } -bool CVar::fromVec4d(const atVec4d& val) { +bool CVar::fromVec4d(const zeus::CVector4d& val) { if (!safeToModify(EType::Vec4d)) return false; - athena::simd_doubles f(val.simd); - m_value.assign(fmt::format(FMT_STRING("{} {} {} {}"), f[0], f[1], f[2], f[3])); + m_value.assign(fmt::format(FMT_STRING("{} {} {} {}"), val.x(), val.y(), val.z(), val.w())); m_flags |= EFlags::Modified; return true; } @@ -468,12 +494,12 @@ bool isReal(const std::vector& v) { } bool CVar::isValidInput(std::string_view input) const { - std::vector parts = athena::utility::split(input, ' '); + std::vector parts = split(input, ' '); char* p; switch (m_type) { case EType::Boolean: { bool valid = false; - athena::utility::parseBool(input, &valid); + parseBool(input, &valid); return valid; } case EType::Signed: diff --git a/hecl/include/hecl/CVar.hpp b/Runtime/ConsoleVariables/CVar.hpp similarity index 76% rename from hecl/include/hecl/CVar.hpp rename to Runtime/ConsoleVariables/CVar.hpp index a47b584fd..215afd1a0 100644 --- a/hecl/include/hecl/CVar.hpp +++ b/Runtime/ConsoleVariables/CVar.hpp @@ -1,16 +1,14 @@ #pragma once +#include "Runtime/GCNTypes.hpp" +#include "zeus/zeus.hpp" + #include #include #include - -#include -#include -#include - -namespace hecl { -namespace DNACVAR { -enum class EType : atUint8 { Boolean, Signed, Unsigned, Real, Literal, Vec2f, Vec2d, Vec3f, Vec3d, Vec4f, Vec4d }; +namespace metaforce { +namespace StoreCVar { +enum class EType : uint32_t { Boolean, Signed, Unsigned, Real, Literal, Vec2f, Vec2d, Vec3f, Vec3d, Vec4f, Vec4d }; enum class EFlags { None = 0, System = (1 << 0), @@ -30,41 +28,37 @@ enum class EFlags { }; ENABLE_BITWISE_ENUM(EFlags) -class CVar : public athena::io::DNA { +class CVar { public: - AT_DECL_DNA - String<-1> m_name; - String<-1> m_value; + std::string m_name; + std::string m_value; }; -struct CVarContainer : public athena::io::DNA { - AT_DECL_DNA - Value magic = 'CVAR'; - Value cvarCount; - Vector cvars; +struct CVarContainer { + u32 magic = 'CVAR'; + std::vector cvars; }; -} // namespace DNACVAR +} // namespace StoreCVar class CVarManager; class ICVarValueReference; -class CVar : protected DNACVAR::CVar { +class CVar : protected StoreCVar::CVar { friend class CVarManager; - Delete _d; public: typedef std::function ListenerFunc; - using EType = DNACVAR::EType; - using EFlags = DNACVAR::EFlags; + using EType = StoreCVar::EType; + using EFlags = StoreCVar::EFlags; CVar(std::string_view name, std::string_view value, std::string_view help, EFlags flags); - CVar(std::string_view name, const atVec2f& value, std::string_view help, EFlags flags); - CVar(std::string_view name, const atVec2d& value, std::string_view help, EFlags flags); - CVar(std::string_view name, const atVec3f& value, std::string_view help, EFlags flags); - CVar(std::string_view name, const atVec3d& value, std::string_view help, EFlags flags); - CVar(std::string_view name, const atVec4f& value, std::string_view help, EFlags flags); - CVar(std::string_view name, const atVec4d& value, std::string_view help, EFlags flags); + CVar(std::string_view name, const zeus::CVector2f& value, std::string_view help, EFlags flags); + CVar(std::string_view name, const zeus::CVector2d& value, std::string_view help, EFlags flags); + CVar(std::string_view name, const zeus::CVector3f& value, std::string_view help, EFlags flags); + CVar(std::string_view name, const zeus::CVector3d& value, std::string_view help, EFlags flags); + CVar(std::string_view name, const zeus::CVector4f& value, std::string_view help, EFlags flags); + CVar(std::string_view name, const zeus::CVector4d& value, std::string_view help, EFlags flags); CVar(std::string_view name, double value, std::string_view help, EFlags flags); CVar(std::string_view name, bool value, std::string_view help, EFlags flags); CVar(std::string_view name, int32_t value, std::string_view help, EFlags flags); @@ -78,12 +72,12 @@ public: template inline bool toValue(T& value) const; - atVec2f toVec2f(bool* isValid = nullptr) const; - atVec2d toVec2d(bool* isValid = nullptr) const; - atVec3f toVec3f(bool* isValid = nullptr) const; - atVec3d toVec3d(bool* isValid = nullptr) const; - atVec4f toVec4f(bool* isValid = nullptr) const; - atVec4d toVec4d(bool* isValid = nullptr) const; + zeus::CVector2f toVec2f(bool* isValid = nullptr) const; + zeus::CVector2d toVec2d(bool* isValid = nullptr) const; + zeus::CVector3f toVec3f(bool* isValid = nullptr) const; + zeus::CVector3d toVec3d(bool* isValid = nullptr) const; + zeus::CVector4f toVec4f(bool* isValid = nullptr) const; + zeus::CVector4d toVec4d(bool* isValid = nullptr) const; double toReal(bool* isValid = nullptr) const; bool toBoolean(bool* isValid = nullptr) const; int32_t toSigned(bool* isValid = nullptr) const; @@ -94,12 +88,12 @@ public: inline bool fromValue(T value) { return false; } - bool fromVec2f(const atVec2f& val); - bool fromVec2d(const atVec2d& val); - bool fromVec3f(const atVec3f& val); - bool fromVec3d(const atVec3d& val); - bool fromVec4f(const atVec4f& val); - bool fromVec4d(const atVec4d& val); + bool fromVec2f(const zeus::CVector2f& val); + bool fromVec2d(const zeus::CVector2d& val); + bool fromVec3f(const zeus::CVector3f& val); + bool fromVec3d(const zeus::CVector3d& val); + bool fromVec4f(const zeus::CVector4f& val); + bool fromVec4d(const zeus::CVector4d& val); bool fromReal(double val); bool fromBoolean(bool val); bool fromInteger(int32_t val); @@ -177,37 +171,37 @@ private: }; template <> -inline bool CVar::toValue(atVec2f& value) const { +inline bool CVar::toValue(zeus::CVector2f& value) const { bool isValid = false; value = toVec2f(&isValid); return isValid; } template <> -inline bool CVar::toValue(atVec2d& value) const { +inline bool CVar::toValue(zeus::CVector2d& value) const { bool isValid = false; value = toVec2d(&isValid); return isValid; } template <> -inline bool CVar::toValue(atVec3f& value) const { +inline bool CVar::toValue(zeus::CVector3f& value) const { bool isValid = false; value = toVec3f(&isValid); return isValid; } template <> -inline bool CVar::toValue(atVec3d& value) const { +inline bool CVar::toValue(zeus::CVector3d& value) const { bool isValid = false; value = toVec3d(&isValid); return isValid; } template <> -inline bool CVar::toValue(atVec4f& value) const { +inline bool CVar::toValue(zeus::CVector4f& value) const { bool isValid = false; value = toVec4f(&isValid); return isValid; } template <> -inline bool CVar::toValue(atVec4d& value) const { +inline bool CVar::toValue(zeus::CVector4d& value) const { bool isValid = false; value = toVec4d(&isValid); return isValid; @@ -250,27 +244,27 @@ inline bool CVar::toValue(std::string& value) const { } template <> -inline bool CVar::fromValue(const atVec2f& val) { +inline bool CVar::fromValue(const zeus::CVector2f& val) { return fromVec2f(val); } template <> -inline bool CVar::fromValue(const atVec2d& val) { +inline bool CVar::fromValue(const zeus::CVector2d& val) { return fromVec2d(val); } template <> -inline bool CVar::fromValue(const atVec3f& val) { +inline bool CVar::fromValue(const zeus::CVector3f& val) { return fromVec3f(val); } template <> -inline bool CVar::fromValue(const atVec3d& val) { +inline bool CVar::fromValue(const zeus::CVector3d& val) { return fromVec3d(val); } template <> -inline bool CVar::fromValue(const atVec4f& val) { +inline bool CVar::fromValue(const zeus::CVector4f& val) { return fromVec4f(val); } template <> -inline bool CVar::fromValue(const atVec4d& val) { +inline bool CVar::fromValue(const zeus::CVector4d& val) { return fromVec4d(val); } template <> @@ -350,4 +344,4 @@ public: } } }; -} // namespace hecl +} // namespace metaforce diff --git a/Runtime/ConsoleVariables/CVarCommons.cpp b/Runtime/ConsoleVariables/CVarCommons.cpp new file mode 100644 index 000000000..df37061c7 --- /dev/null +++ b/Runtime/ConsoleVariables/CVarCommons.cpp @@ -0,0 +1,78 @@ +#include "Runtime/ConsoleVariables/CVarCommons.hpp" + +namespace metaforce { +namespace { +CVarCommons* m_instance = nullptr; +} + +CVarCommons::CVarCommons(CVarManager& manager) : m_mgr(manager) { + m_fullscreen = m_mgr.findOrMakeCVar("fullscreen"sv, "Start in fullscreen"sv, false, + CVar::EFlags::System | CVar::EFlags::Archive); + m_graphicsApi = m_mgr.findOrMakeCVar("graphicsApi"sv, "API to use for rendering graphics"sv, DEFAULT_GRAPHICS_API, + CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart); + m_drawSamples = m_mgr.findOrMakeCVar("drawSamples"sv, "Number of MSAA samples to use for render targets"sv, 1, + CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart); + m_texAnisotropy = + m_mgr.findOrMakeCVar("texAnisotropy"sv, "Number of anisotropic samples to use for sampling textures"sv, 1, + CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart); + m_deepColor = m_mgr.findOrMakeCVar("deepColor"sv, "Allow framebuffer with color depth greater-then 24-bits"sv, false, + CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart); + m_variableDt = m_mgr.findOrMakeCVar("variableDt", "Enable variable delta time (experimental)", false, + (CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart)); + m_lazyCommitResources = m_mgr.findOrMakeCVar("lazyCommitResources"sv, "Enable lazy commiting resources to GPU", true, + (CVar::EFlags::System | CVar::EFlags::Archive)); + + m_debugOverlayPlayerInfo = m_mgr.findOrMakeCVar( + "debugOverlay.playerInfo"sv, "Displays information about the player, such as location and orientation"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayWorldInfo = m_mgr.findOrMakeCVar( + "debugOverlay.worldInfo"sv, "Displays information about the current world, such as world asset ID, and areaId"sv, + false, CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayAreaInfo = m_mgr.findOrMakeCVar( + "debugOverlay.areaInfo"sv, + "Displays information about the current area, such as asset ID, object/layer counts, and active layer bits"sv, + false, CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayLayerInfo = + m_mgr.findOrMakeCVar("debugOverlay.layerInfo"sv, "Displays information about the currently active area layers"sv, + false, CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowFrameCounter = + m_mgr.findOrMakeCVar("debugOverlay.showFrameCounter"sv, "Displays the current frame index"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowFramerate = + m_mgr.findOrMakeCVar("debugOverlay.showFramerate"sv, "Displays the current framerate"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowInGameTime = + m_mgr.findOrMakeCVar("debugOverlay.showInGameTime"sv, "Displays the current in game time"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowRoomTimer = m_mgr.findOrMakeCVar( + "debugOverlay.showRoomTimer", "Displays the current/last room timers in seconds and frames"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowResourceStats = m_mgr.findOrMakeCVar( + "debugOverlay.showResourceStats"sv, "Displays the current live resource object and token counts"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowRandomStats = + m_mgr.findOrMakeCVar("debugOverlay.showRandomStats", "Displays the current number of random calls per frame"sv, + false, CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugOverlayShowInput = m_mgr.findOrMakeCVar("debugOverlay.showInput"sv, "Displays user input"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugToolDrawAiPath = + m_mgr.findOrMakeCVar("debugTool.drawAiPath", "Draws the selected paths of any AI in the room"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugToolDrawLighting = m_mgr.findOrMakeCVar("debugTool.drawLighting", "Draws the lighting setup in a room"sv, + false, CVar::EFlags::Game | CVar::EFlags::ReadOnly); + m_debugToolDrawCollisionActors = + m_mgr.findOrMakeCVar("debugTool.drawCollisionActors", "Draws the collision actors for enemies and objects"sv, + false, CVar::EFlags::Game | CVar::EFlags::ReadOnly); + m_debugToolDrawMazePath = m_mgr.findOrMakeCVar("debugTool.drawMazePath", "Draws the maze path in Dynamo"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_debugToolDrawPlatformCollision = + m_mgr.findOrMakeCVar("debugTool.drawPlatformCollision", "Draws the bounding boxes of platforms"sv, false, + CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly); + m_logFile = m_mgr.findOrMakeCVar("logFile"sv, "Any log prints will be stored to this file upon exit"sv, "app.log"sv, + CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart); + + m_instance = this; +} + +CVarCommons* CVarCommons::instance() { return m_instance; } +} // namespace metaforce diff --git a/hecl/include/hecl/CVarCommons.hpp b/Runtime/ConsoleVariables/CVarCommons.hpp similarity index 97% rename from hecl/include/hecl/CVarCommons.hpp rename to Runtime/ConsoleVariables/CVarCommons.hpp index 5dc39170c..4a224ffc3 100644 --- a/hecl/include/hecl/CVarCommons.hpp +++ b/Runtime/ConsoleVariables/CVarCommons.hpp @@ -4,12 +4,12 @@ #include #include -#include "hecl/CVarManager.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" #undef min #undef max -namespace hecl { +namespace metaforce { using namespace std::literals; diff --git a/hecl/lib/CVarManager.cpp b/Runtime/ConsoleVariables/CVarManager.cpp similarity index 92% rename from hecl/lib/CVarManager.cpp rename to Runtime/ConsoleVariables/CVarManager.cpp index de5cd6a73..a20daa10c 100644 --- a/hecl/lib/CVarManager.cpp +++ b/Runtime/ConsoleVariables/CVarManager.cpp @@ -1,16 +1,14 @@ -#include "hecl/CVarManager.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" +#include "Runtime/ConsoleVariables/FileStoreManager.hpp" +#include "Runtime/CBasics.hpp" + +#include #include #include #include -#include "hecl/hecl.hpp" -#include "hecl/Runtime.hpp" - -#include -#include - -namespace hecl { +namespace metaforce { CVar* com_developer = nullptr; CVar* com_configfile = nullptr; @@ -21,7 +19,7 @@ static const std::regex cmdLineRegex(R"(\+([\w\.]+)([=])?([\/\\\s\w\.\-]+)?)"); CVarManager* CVarManager::m_instance = nullptr; static logvisor::Module CVarLog("CVarManager"); -CVarManager::CVarManager(hecl::Runtime::FileStoreManager& store, bool useBinary) +CVarManager::CVarManager(FileStoreManager& store, bool useBinary) : m_store(store), m_useBinary(useBinary) { m_instance = this; com_configfile = @@ -40,7 +38,7 @@ CVarManager::~CVarManager() {} CVar* CVarManager::registerCVar(std::unique_ptr&& cvar) { std::string tmp(cvar->name()); - athena::utility::tolower(tmp); + CBasics::ToLower(tmp); if (m_cvars.find(tmp) != m_cvars.end()) { return nullptr; @@ -53,7 +51,7 @@ CVar* CVarManager::registerCVar(std::unique_ptr&& cvar) { CVar* CVarManager::findCVar(std::string_view name) { std::string lower(name); - athena::utility::tolower(lower); + CBasics::ToLower(lower); auto search = m_cvars.find(lower); if (search == m_cvars.end()) return nullptr; @@ -88,7 +86,7 @@ void CVarManager::deserialize(CVar* cvar) { /* First let's check for a deferred value */ std::string lowName = cvar->name().data(); - athena::utility::tolower(lowName); + CBasics::ToLower(lowName); if (const auto iter = m_deferedCVars.find(lowName); iter != m_deferedCVars.end()) { std::string val = std::move(iter->second); m_deferedCVars.erase(lowName); @@ -108,16 +106,16 @@ void CVarManager::deserialize(CVar* cvar) { if (!cvar->isArchive() && !cvar->isInternalArchivable()) { return; } - +#if 0 // TODO: Reimplement this /* We were either unable to find a deferred value or got an invalid value */ std::string filename = std::string(m_store.getStoreRoot()) + '/' + com_configfile->toLiteral(); - hecl::Sstat st; + CBascis::Sstat st; if (m_useBinary) { CVarContainer container; filename += ".bin"; - if (hecl::Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode)) + if (CBascis::Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode)) return; athena::io::FileReader reader(filename); if (reader.isOpen()) @@ -139,7 +137,7 @@ void CVarManager::deserialize(CVar* cvar) { } } else { filename += ".yaml"; - if (hecl::Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode)) + if (Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode)) return; athena::io::FileReader reader(filename); if (reader.isOpen()) { @@ -161,9 +159,11 @@ void CVarManager::deserialize(CVar* cvar) { } } } +#endif } void CVarManager::serialize() { +#if 0 // TODO: reimplement this std::string filename = std::string(m_store.getStoreRoot()) + '/' + com_configfile->toLiteral(); @@ -176,7 +176,7 @@ void CVarManager::serialize() { container.cvars.push_back(*cvar); } } - container.cvarCount = atUint32(container.cvars.size()); + container.cvarCount = u32(container.cvars.size()); filename += ".bin"; athena::io::FileWriter writer(filename); @@ -202,6 +202,7 @@ void CVarManager::serialize() { if (w.isOpen()) docWriter.finish(&w); } +#endif } CVarManager* CVarManager::instance() { return m_instance; } @@ -233,7 +234,7 @@ bool CVarManager::restartRequired() const { void CVarManager::parseCommandLine(const std::vector& args) { bool oldDeveloper = suppressDeveloper(); std::string developerName(com_developer->name()); - athena::utility::tolower(developerName); + CBasics::ToLower(developerName); for (const std::string& arg : args) { if (arg[0] != '+') { continue; @@ -266,13 +267,13 @@ void CVarManager::parseCommandLine(const std::vector& args) { cv->fromLiteralToType(cvarValue); } cv->m_wasDeserialized = true; - athena::utility::tolower(cvarName); + CBasics::ToLower(cvarName); if (developerName == cvarName) /* Make sure we're not overriding developer mode when we restore */ oldDeveloper = com_developer->toBoolean(); } else { /* Unable to find an existing CVar, let's defer for the time being 8 */ - athena::utility::tolower(cvarName); + CBasics::ToLower(cvarName); m_deferedCVars.insert_or_assign(std::move(cvarName), std::move(cvarValue)); } } diff --git a/hecl/include/hecl/CVarManager.hpp b/Runtime/ConsoleVariables/CVarManager.hpp similarity index 78% rename from hecl/include/hecl/CVarManager.hpp rename to Runtime/ConsoleVariables/CVarManager.hpp index cc72f68ed..d2fad8599 100644 --- a/hecl/include/hecl/CVarManager.hpp +++ b/Runtime/ConsoleVariables/CVarManager.hpp @@ -5,18 +5,16 @@ #include #include -#include "hecl/CVar.hpp" +#include "Runtime/ConsoleVariables/CVar.hpp" -namespace hecl { -namespace Runtime { +namespace metaforce { class FileStoreManager; -} extern CVar* com_developer; extern CVar* com_configfile; extern CVar* com_enableCheats; extern CVar* com_cubemaps; class CVarManager final { - using CVarContainer = DNACVAR::CVarContainer; + using CVarContainer = StoreCVar::CVarContainer; template CVar* _newCVar(std::string_view name, std::string_view help, const T& value, CVar::EFlags flags) { if (CVar* ret = registerCVar(std::make_unique(name, value, help, flags))) { @@ -26,7 +24,7 @@ class CVarManager final { return nullptr; } - hecl::Runtime::FileStoreManager& m_store; + FileStoreManager& m_store; bool m_useBinary; static CVarManager* m_instance; @@ -35,26 +33,26 @@ public: CVarManager(const CVarManager&) = delete; CVarManager& operator=(const CVarManager&) = delete; CVarManager& operator=(const CVarManager&&) = delete; - CVarManager(hecl::Runtime::FileStoreManager& store, bool useBinary = false); + CVarManager(FileStoreManager& store, bool useBinary = false); ~CVarManager(); - CVar* newCVar(std::string_view name, std::string_view help, const atVec2f& value, CVar::EFlags flags) { - return _newCVar(name, help, value, flags); + CVar* newCVar(std::string_view name, std::string_view help, const zeus::CVector2f& value, CVar::EFlags flags) { + return _newCVar(name, help, value, flags); } - CVar* newCVar(std::string_view name, std::string_view help, const atVec2d& value, CVar::EFlags flags) { - return _newCVar(name, help, value, flags); + CVar* newCVar(std::string_view name, std::string_view help, const zeus::CVector2d& value, CVar::EFlags flags) { + return _newCVar(name, help, value, flags); } - CVar* newCVar(std::string_view name, std::string_view help, const atVec3f& value, CVar::EFlags flags) { - return _newCVar(name, help, value, flags); + CVar* newCVar(std::string_view name, std::string_view help, const zeus::CVector3f& value, CVar::EFlags flags) { + return _newCVar(name, help, value, flags); } - CVar* newCVar(std::string_view name, std::string_view help, const atVec3d& value, CVar::EFlags flags) { - return _newCVar(name, help, value, flags); + CVar* newCVar(std::string_view name, std::string_view help, const zeus::CVector3d& value, CVar::EFlags flags) { + return _newCVar(name, help, value, flags); } - CVar* newCVar(std::string_view name, std::string_view help, const atVec4f& value, CVar::EFlags flags) { - return _newCVar(name, help, value, flags); + CVar* newCVar(std::string_view name, std::string_view help, const zeus::CVector4f& value, CVar::EFlags flags) { + return _newCVar(name, help, value, flags); } - CVar* newCVar(std::string_view name, std::string_view help, const atVec4d& value, CVar::EFlags flags) { - return _newCVar(name, help, value, flags); + CVar* newCVar(std::string_view name, std::string_view help, const zeus::CVector4d& value, CVar::EFlags flags) { + return _newCVar(name, help, value, flags); } CVar* newCVar(std::string_view name, std::string_view help, std::string_view value, CVar::EFlags flags) { return _newCVar(name, help, value, flags); diff --git a/hecl/lib/Runtime/FileStoreManager.cpp b/Runtime/ConsoleVariables/FileStoreManager.cpp similarity index 83% rename from hecl/lib/Runtime/FileStoreManager.cpp rename to Runtime/ConsoleVariables/FileStoreManager.cpp index 91c585e0d..167bf4844 100644 --- a/hecl/lib/Runtime/FileStoreManager.cpp +++ b/Runtime/ConsoleVariables/FileStoreManager.cpp @@ -1,8 +1,11 @@ -#include "hecl/Runtime.hpp" +#include "Runtime/ConsoleVariables/FileStoreManager.hpp" -#include "hecl/hecl.hpp" +#include "Runtime/CBasics.hpp" #include +#if _WIN32 +#include +#endif #if _WIN32 #include @@ -12,7 +15,7 @@ using namespace Windows::Storage; #endif -namespace hecl::Runtime { +namespace metaforce { static logvisor::Module Log("FileStoreManager"); FileStoreManager::FileStoreManager(std::string_view domain) : m_domain(domain) { @@ -29,11 +32,11 @@ FileStoreManager::FileStoreManager(std::string_view domain) : m_domain(domain) { #endif path += "/.heclrun"; - hecl::MakeDir(path.c_str()); + CBasics::MakeDir(path.c_str()); path += '/'; path += domain.data(); - hecl::MakeDir(path.c_str()); + CBasics::MakeDir(path.c_str()); m_storeRoot = path; #else const char* xdg_data_home = getenv("XDG_DATA_HOME"); @@ -51,7 +54,7 @@ FileStoreManager::FileStoreManager(std::string_view domain) : m_domain(domain) { } path += "/hecl/"; path += domain.data(); - if (RecursiveMakeDir(path.c_str()) != 0) + if (CBasics::RecursiveMakeDir(path.c_str()) != 0) Log.report(logvisor::Fatal, FMT_STRING("unable to mkdir at {}"), path); m_storeRoot = path; #endif diff --git a/Runtime/ConsoleVariables/FileStoreManager.hpp b/Runtime/ConsoleVariables/FileStoreManager.hpp new file mode 100644 index 000000000..20dcf150c --- /dev/null +++ b/Runtime/ConsoleVariables/FileStoreManager.hpp @@ -0,0 +1,22 @@ +#pragma once +#include +#include + +namespace metaforce { +/** + * @brief Per-platform file store resolution + */ +class FileStoreManager { + std::string m_domain; + std::string m_storeRoot; + +public: + FileStoreManager(std::string_view domain); + std::string_view getDomain() const { return m_domain; } + /** + * @brief Returns the full path to the file store, including domain + * @return Full path to store e.g /home/foo/.hecl/bar + */ + std::string_view getStoreRoot() const { return m_storeRoot; } +}; +} \ No newline at end of file diff --git a/Runtime/GCNTypes.hpp b/Runtime/GCNTypes.hpp index 42233d831..b5cd945a9 100644 --- a/Runtime/GCNTypes.hpp +++ b/Runtime/GCNTypes.hpp @@ -11,3 +11,56 @@ using s32 = int32_t; using u32 = uint32_t; using s64 = int64_t; using u64 = uint64_t; + +#ifndef ROUND_UP_256 +#define ROUND_UP_256(val) (((val) + 255) & ~255) +#endif +#ifndef ROUND_UP_64 +#define ROUND_UP_64(val) (((val) + 63) & ~63) +#endif +#ifndef ROUND_UP_32 +#define ROUND_UP_32(val) (((val) + 31) & ~31) +#endif +#ifndef ROUND_UP_16 +#define ROUND_UP_16(val) (((val) + 15) & ~15) +#endif +#ifndef ROUND_UP_8 +#define ROUND_UP_8(val) (((val) + 7) & ~7) +#endif +#ifndef ROUND_UP_4 +#define ROUND_UP_4(val) (((val) + 3) & ~3) +#endif + +#ifndef ENABLE_BITWISE_ENUM +#define ENABLE_BITWISE_ENUM(type) \ + constexpr type operator|(type a, type b) noexcept { \ + using T = std::underlying_type_t; \ + return type(static_cast(a) | static_cast(b)); \ + } \ + constexpr type operator&(type a, type b) noexcept { \ + using T = std::underlying_type_t; \ + return type(static_cast(a) & static_cast(b)); \ + } \ + constexpr type& operator|=(type& a, type b) noexcept { \ + using T = std::underlying_type_t; \ + a = type(static_cast(a) | static_cast(b)); \ + return a; \ + } \ + constexpr type& operator&=(type& a, type b) noexcept { \ + using T = std::underlying_type_t; \ + a = type(static_cast(a) & static_cast(b)); \ + return a; \ + } \ + constexpr type operator~(type key) noexcept { \ + using T = std::underlying_type_t; \ + return type(~static_cast(key)); \ + } \ + constexpr bool True(type key) noexcept { \ + using T = std::underlying_type_t; \ + return static_cast(key) != 0; \ + } \ + constexpr bool False(type key) noexcept { \ + using T = std::underlying_type_t; \ + return static_cast(key) == 0; \ + } +#endif \ No newline at end of file diff --git a/Runtime/GameGlobalObjects.hpp b/Runtime/GameGlobalObjects.hpp index 7902647aa..d2774abbe 100644 --- a/Runtime/GameGlobalObjects.hpp +++ b/Runtime/GameGlobalObjects.hpp @@ -3,35 +3,37 @@ #define USE_DOWNCAST_TWEAKS 1 #if USE_DOWNCAST_TWEAKS -#include "../DataSpec/DNAMP1/Tweaks/CTweakGame.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakGunRes.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakPlayerRes.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakGui.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakSlideShow.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakGui.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakBall.hpp" -#include "../DataSpec/DNAMP1/Tweaks/CTweakGuiColors.hpp" +#include "Runtime/MP1/Tweaks/CTweakAutoMapper.hpp" +#include "Runtime/MP1/Tweaks/CTweakBall.hpp" +#include "Runtime/MP1/Tweaks/CTweakGame.hpp" +#include "Runtime/MP1/Tweaks/CTweakGui.hpp" +#include "Runtime/MP1/Tweaks/CTweakGui.hpp" +#include "Runtime/MP1/Tweaks/CTweakGuiColors.hpp" +#include "Runtime/MP1/Tweaks/CTweakGunRes.hpp" +#include "Runtime/MP1/Tweaks/CTweakParticle.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayer.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayerControl.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayerGun.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayerRes.hpp" +#include "Runtime/MP1/Tweaks/CTweakSlideShow.hpp" +#include "Runtime/MP1/Tweaks/CTweakTargeting.hpp" +#include "Runtime/MP1/Tweaks/CTweakGuiColors.hpp" +#include "Runtime/MP1/Tweaks/CTweakTargeting.hpp" #else -#include "../DataSpec/DNACommon/Tweaks/ITweakGame.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakGunRes.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakPlayerRes.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakGui.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakSlideShow.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakGui.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakTargeting.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakParticle.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakBall.hpp" -#include "../DataSpec/DNACommon/Tweaks/ITweakGuiColors.hpp" +#include "Runtime/Tweaks/ITweakAutoMapper.hpp" +#include "Runtime/Tweaks/ITweakBall.hpp" +#include "Runtime/Tweaks/ITweakGame.hpp" +#include "Runtime/Tweaks/ITweakGui.hpp" +#include "Runtime/Tweaks/ITweakGui.hpp" +#include "Runtime/Tweaks/ITweakGuiColors.hpp" +#include "Runtime/Tweaks/ITweakGunRes.hpp" +#include "Runtime/Tweaks/ITweakParticle.hpp" +#include "Runtime/Tweaks/ITweakPlayer.hpp" +#include "Runtime/Tweaks/ITweakPlayerControl.hpp" +#include "Runtime/Tweaks/ITweakPlayerGun.hpp" +#include "Runtime/Tweaks/ITweakPlayerRes.hpp" +#include "Runtime/Tweaks/ITweakSlideShow.hpp" +#include "Runtime/Tweaks/ITweakTargeting.hpp" #endif #include "Runtime/CTextureCache.hpp" @@ -55,32 +57,34 @@ extern class CInputGenerator* g_InputGenerator; extern class CStateManager* g_StateManager; #if USE_DOWNCAST_TWEAKS -using ITweakGame = DataSpec::DNAMP1::CTweakGame; -using ITweakPlayer = DataSpec::DNAMP1::CTweakPlayer; -using ITweakPlayerControl = DataSpec::DNAMP1::CTweakPlayerControl; -using ITweakPlayerGun = DataSpec::DNAMP1::CTweakPlayerGun; -using ITweakGunRes = DataSpec::DNAMP1::CTweakGunRes; -using ITweakAutoMapper = DataSpec::DNAMP1::CTweakAutoMapper; -using ITweakGui = DataSpec::DNAMP1::CTweakGui; -using ITweakSlideShow = DataSpec::DNAMP1::CTweakSlideShow; -using ITweakParticle = DataSpec::DNAMP1::CTweakParticle; -using ITweakBall = DataSpec::DNAMP1::CTweakBall; -using ITweakGuiColors = DataSpec::DNAMP1::CTweakGuiColors; +using ITweakGame = metaforce::MP1::CTweakGame; +using ITweakPlayer = metaforce::MP1::CTweakPlayer; +using ITweakPlayerControl = metaforce::MP1::CTweakPlayerControl; +using ITweakPlayerGun = metaforce::MP1::CTweakPlayerGun; +using ITweakGunRes = metaforce::MP1::CTweakGunRes; +using ITweakAutoMapper = metaforce::MP1::CTweakAutoMapper; +using ITweakGui = metaforce::MP1::CTweakGui; +using ITweakSlideShow = metaforce::MP1::CTweakSlideShow; +using ITweakParticle = metaforce::MP1::CTweakParticle; +using ITweakBall = metaforce::MP1::CTweakBall; +using ITweakGuiColors = metaforce::MP1::CTweakGuiColors; +using ITweakPlayerRes = metaforce::MP1::CTweakPlayerRes; +using ITweakTargeting = metaforce::MP1::CTweakTargeting; #else -using ITweakGame = DataSpec::ITweakGame; -using ITweakPlayer = DataSpec::ITweakPlayer; -using ITweakPlayerControl = DataSpec::ITweakPlayerControl; -using ITweakPlayerGun = DataSpec::ITweakPlayerGun; -using ITweakGunRes = DataSpec::ITweakGunRes; -using ITweakAutoMapper = DataSpec::ITweakAutoMapper; -using ITweakGui = DataSpec::ITweakGui; -using ITweakSlideShow = DataSpec::ITweakSlideShow; -using ITweakParticle = DataSpec::ITweakParticle; -using ITweakBall = DataSpec::ITweakBall; -using ITweakGuiColors = DataSpec::ITweakGuiColors; +using ITweakGame = metaforce::Tweaks::ITweakGame; +using ITweakPlayer = metaforce::Tweaks::ITweakPlayer; +using ITweakPlayerControl = metaforce::Tweaks::ITweakPlayerControl; +using ITweakPlayerGun = metaforce::Tweaks::ITweakPlayerGun; +using ITweakGunRes = metaforce::Tweaks::ITweakGunRes; +using ITweakAutoMapper = metaforce::Tweaks::ITweakAutoMapper; +using ITweakGui = metaforce::Tweaks::ITweakGui; +using ITweakSlideShow = metaforce::Tweaks::ITweakSlideShow; +using ITweakParticle = metaforce::Tweaks::ITweakParticle; +using ITweakBall = metaforce::Tweaks::ITweakBall; +using ITweakGuiColors = metaforce::Tweaks::ITweakGuiColors; +using ITweakPlayerRes = metaforce::Tweaks::ITweakPlayerRes; +using ITweakTargeting = metaforce::Tweaks::ITweakTargeting; #endif -using ITweakPlayerRes = DataSpec::ITweakPlayerRes; -using ITweakTargeting = DataSpec::ITweakTargeting; extern ITweakGame* g_tweakGame; extern ITweakPlayer* g_tweakPlayer; diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 2c6201f5e..f5a41d77d 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -712,11 +711,11 @@ CBooRenderer::~CBooRenderer() { g_Renderer = nullptr; } void CBooRenderer::AddWorldSurfaces(CBooModel& model) { CBooSurface* surf = model.x3c_firstSortedSurface; while (surf) { - const MaterialSet::Material& mat = model.GetMaterialByIndex(surf->m_data.matIdx); +// const MaterialSet::Material& mat = model.GetMaterialByIndex(surf->m_data.matIdx); zeus::CAABox aabb = surf->GetBounds(); zeus::CVector3f pt = aabb.closestPointAlongVector(xb0_viewPlane.normal()); Buckets::Insert(pt, aabb, EDrawableType::WorldSurface, surf, xb0_viewPlane, - mat.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Alpha); + /*mat.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Alpha*/ false); surf = surf->m_next; } } diff --git a/Runtime/Graphics/CCubeModel.cpp b/Runtime/Graphics/CCubeModel.cpp index 184eba72d..dc151c453 100644 --- a/Runtime/Graphics/CCubeModel.cpp +++ b/Runtime/Graphics/CCubeModel.cpp @@ -253,16 +253,16 @@ void CCubeModel::MakeTexturesFromMats(const u8* ptr, std::vector(mem.readUint32Big()); - x18_nextSurface = reinterpret_cast(mem.readUint32Big()); - x1c_extraSize = mem.readUint32Big(); - x20_normal.readBig(mem); + CMemoryInStream mem(ptr, 10000, CMemoryInStream::EOwnerShip::NotOwned); // Oversized so we can read everything in + x0_center = mem.Get(); + xc_materialIndex = mem.ReadLong(); + x10_displayListSize = mem.ReadLong(); + x14_parent = reinterpret_cast(mem.ReadLong()); + x18_nextSurface = reinterpret_cast(mem.ReadLong()); + x1c_extraSize = mem.ReadLong(); + x20_normal = mem.Get(); if (x1c_extraSize > 0) { - x2c_bounds = zeus::CAABox::ReadBoundingBoxBig(mem); + x2c_bounds = mem.Get(); } } diff --git a/Runtime/Graphics/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp index 2791af843..e21b0c6e4 100644 --- a/Runtime/Graphics/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -7,13 +7,9 @@ #include "Runtime/RetroTypes.hpp" -#include "DataSpec/DNACommon/GX.hpp" +#include "GX.hpp" -//#include -//#include - -#include -#include +#include "ConsoleVariables/CVar.hpp" #include #include @@ -25,7 +21,7 @@ using frame_clock = std::chrono::high_resolution_clock; namespace metaforce { -extern hecl::CVar* g_disableLighting; +extern CVar* g_disableLighting; class CLight; class CTimeProvider; diff --git a/Runtime/Graphics/CGraphicsPalette.hpp b/Runtime/Graphics/CGraphicsPalette.hpp index 3c83d78b7..cdf2436cb 100644 --- a/Runtime/Graphics/CGraphicsPalette.hpp +++ b/Runtime/Graphics/CGraphicsPalette.hpp @@ -23,9 +23,9 @@ class CGraphicsPalette { public: explicit CGraphicsPalette(EPaletteFormat fmt, int count) : x0_fmt(fmt), x8_entryCount(count), xc_entries(new u16[count]) {} - explicit CGraphicsPalette(CInputStream& in) : x0_fmt(EPaletteFormat(in.readUint32Big())) { - u16 w = in.readUint16Big(); - u16 h = in.readUint16Big(); + explicit CGraphicsPalette(CInputStream& in) : x0_fmt(EPaletteFormat(in.ReadLong())) { + u16 w = in.ReadShort(); + u16 h = in.ReadShort(); x8_entryCount = w * h; /* GX Tlut init here */ diff --git a/Runtime/Graphics/CLineRenderer.hpp b/Runtime/Graphics/CLineRenderer.hpp index 6a4cdfe48..015ee205d 100644 --- a/Runtime/Graphics/CLineRenderer.hpp +++ b/Runtime/Graphics/CLineRenderer.hpp @@ -6,11 +6,6 @@ #include "Runtime/rstl.hpp" #include "Runtime/Graphics/CGraphics.hpp" -//#include - -//#include -//#include - #include #include #include diff --git a/Runtime/Graphics/CMetroidModelInstance.hpp b/Runtime/Graphics/CMetroidModelInstance.hpp index cf0a52f30..a45d835be 100644 --- a/Runtime/Graphics/CMetroidModelInstance.hpp +++ b/Runtime/Graphics/CMetroidModelInstance.hpp @@ -8,7 +8,7 @@ #include "Shaders/CModelShaders.hpp" -#include +//#include #include #include @@ -26,7 +26,7 @@ class CMetroidModelInstance { zeus::CAABox x34_aabb; std::vector m_surfaces; std::unique_ptr m_instance; - hecl::HMDLMeta m_hmdlMeta; +// hecl::HMDLMeta m_hmdlMeta; // std::unordered_map m_shaders; public: @@ -38,7 +38,7 @@ public: x34_aabb = {}; m_surfaces.clear(); m_instance.reset(); - m_hmdlMeta = {}; +// m_hmdlMeta = {}; // m_shaders.clear(); } }; diff --git a/Runtime/Graphics/CModel.hpp b/Runtime/Graphics/CModel.hpp index da99d426a..44b8bffe8 100644 --- a/Runtime/Graphics/CModel.hpp +++ b/Runtime/Graphics/CModel.hpp @@ -5,15 +5,15 @@ #include #include -#include "DataSpec/DNACommon/CMDL.hpp" -#include "DataSpec/DNAMP1/CMDLMaterials.hpp" +//#include "DataSpec/DNACommon/CMDL.hpp" +//#include "DataSpec/DNAMP1/CMDLMaterials.hpp" #include "Runtime/CFactoryMgr.hpp" #include "Runtime/CToken.hpp" #include "Runtime/Graphics/CTexture.hpp" #include "Runtime/Graphics/Shaders/CModelShaders.hpp" #include "Runtime/RetroTypes.hpp" -#include +//#include #include #include @@ -64,20 +64,21 @@ struct CModelFlags { /* metaforce addition: doesn't require hacky stashing of * pointers within loaded CMDL buffer */ struct CBooSurface { - DataSpec::DNACMDL::SurfaceHeader_2 m_data; +// DataSpec::DNACMDL::SurfaceHeader_2 m_data; size_t selfIdx; class CBooModel* m_parent = nullptr; CBooSurface* m_next = nullptr; zeus::CAABox GetBounds() const { - if (!m_data.aabbSz) - return zeus::CAABox(m_data.centroid, m_data.centroid); - else - return zeus::CAABox(m_data.aabb[0], m_data.aabb[1]); +// if (!m_data.aabbSz) +// return zeus::CAABox(m_data.centroid, m_data.centroid); +// else +// return zeus::CAABox(m_data.aabb[0], m_data.aabb[1]); + return {}; } }; -using MaterialSet = DataSpec::DNAMP1::HMDLMaterialSet; +//using MaterialSet = DataSpec::DNAMP1::HMDLMaterialSet; //struct GeometryUniformLayout { // mutable std::vector> m_sharedBuffer; @@ -103,7 +104,7 @@ using MaterialSet = DataSpec::DNAMP1::HMDLMaterialSet; struct SShader { std::unordered_map> x0_textures; // std::unordered_map m_shaders; - MaterialSet m_matSet; +// MaterialSet m_matSet; // std::optional m_geomLayout; int m_matSetIdx; explicit SShader(int idx) : m_matSetIdx(idx) { @@ -135,7 +136,7 @@ private: TToken m_modelTok; CModel* m_model; std::vector* x0_surfaces; - const MaterialSet* x4_matSet; +// const MaterialSet* x4_matSet; // const GeometryUniformLayout* m_geomLayout; int m_matSetIdx = -1; // const std::unordered_map* m_pipelines; @@ -148,11 +149,11 @@ private: u8 x41_mask; u32 x44_areaInstanceIdx = UINT32_MAX; - struct UVAnimationBuffer { - static void ProcessAnimation(u8*& bufOut, const MaterialSet::Material::PASS& anim); - static void PadOutBuffer(u8*& bufStart, u8*& bufOut); - static void Update(u8*& bufOut, const MaterialSet* matSet, const CModelFlags& flags, const CBooModel* parent); - }; +// struct UVAnimationBuffer { +// static void ProcessAnimation(u8*& bufOut, const MaterialSet::Material::PASS& anim); +// static void PadOutBuffer(u8*& bufStart, u8*& bufOut); +// static void Update(u8*& bufOut, const MaterialSet* matSet, const CModelFlags& flags, const CBooModel* parent); +// }; CModelShaders::LightingUniform m_lightingData; @@ -200,8 +201,8 @@ public: // boo::ObjToken vbo, boo::ObjToken ibo, const zeus::CAABox& aabb, u8 renderMask); - static void MakeTexturesFromMats(const MaterialSet& matSet, - std::unordered_map>& toksOut, IObjectStore& store); +// static void MakeTexturesFromMats(const MaterialSet& matSet, +// std::unordered_map>& toksOut, IObjectStore& store); void MakeTexturesFromMats(std::unordered_map>& toksOut, IObjectStore& store); bool IsOpaque() const { return x3c_firstSortedSurface == nullptr; } @@ -224,7 +225,7 @@ public: void LockParent() { m_modelTok.Lock(); } void UnlockParent() { m_modelTok.Unlock(); } - const MaterialSet::Material& GetMaterialByIndex(int idx) const { return x4_matSet->materials.at(idx); } +// const MaterialSet::Material& GetMaterialByIndex(int idx) const { return x4_matSet->materials.at(idx); } void ClearUniformCounter() { m_uniUpdateCount = 0; } static void ClearModelUniformCounters(); @@ -275,12 +276,12 @@ class CModel { /* metaforce addition: boo! */ // boo::ObjToken m_staticVbo; - hecl::HMDLMeta m_hmdlMeta; +// hecl::HMDLMeta m_hmdlMeta; std::unique_ptr m_dynamicVertexData; // boo::ObjToken m_ibo; public: - using MaterialSet = DataSpec::DNAMP1::HMDLMaterialSet; +// using MaterialSet = DataSpec::DNAMP1::HMDLMaterialSet; CModel(std::unique_ptr&& in, u32 dataLen, IObjectStore* store, CObjectReference* selfRef); void DrawSortedParts(const CModelFlags& flags) const; diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index 39afbb727..0cf0e6b51 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -1,5 +1,6 @@ #include "Runtime/Graphics/CModel.hpp" +#include "Runtime/CBasics.hpp" #include "Runtime/CSimplePool.hpp" #include "Runtime/GameGlobalObjects.hpp" #include "Runtime/Character/CSkinRules.hpp" @@ -11,9 +12,8 @@ #include -#include -#include -#include +#include "ConsoleVariables/CVarManager.hpp" +//#include #include #include @@ -78,10 +78,10 @@ void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurfa zeus::CVector3f surfPos; float surfSize = 0.f; if (surf) { - zeus::CVector3f surfCenter(surf->m_data.centroid); - zeus::CVector3f surfNormal(surf->m_data.reflectionNormal); - float dotDelta = surfNormal.dot(modelToPlayerLocal) - surfCenter.dot(surfNormal); - surfPos = modelToPlayerLocal - surfNormal * dotDelta; +// zeus::CVector3f surfCenter(surf->m_data.centroid); +// zeus::CVector3f surfNormal(surf->m_data.reflectionNormal); +// float dotDelta = surfNormal.dot(modelToPlayerLocal) - surfCenter.dot(surfNormal); +// surfPos = modelToPlayerLocal - surfNormal * dotDelta; } else { surfPos = model.x20_aabb.center(); surfSize = @@ -156,7 +156,7 @@ CBooModel::CBooModel(TToken& token, CModel* parent, std::vector& token, CModel* parent, std::vectorrbegin(); it != x0_surfaces->rend(); ++it) { - u32 matId = it->m_data.matIdx; - const MaterialSet::Material& matData = GetMaterialByIndex(matId); - if (matData.flags.depthSorting()) { - it->m_next = x3c_firstSortedSurface; - x3c_firstSortedSurface = &*it; - } else { - it->m_next = x38_firstUnsortedSurface; - x38_firstUnsortedSurface = &*it; - } +// u32 matId = it->m_data.matIdx; +// const MaterialSet::Material& matData = GetMaterialByIndex(matId); +// if (matData.flags.depthSorting()) { +// it->m_next = x3c_firstSortedSurface; +// x3c_firstSortedSurface = &*it; +// } else { +// it->m_next = x38_firstUnsortedSurface; +// x38_firstUnsortedSurface = &*it; +// } } // m_instances.reserve(numInsts); @@ -405,21 +405,21 @@ CBooModel::CBooModel(TToken& token, CModel* parent, std::vector>& toksOut, - IObjectStore& store) { - for (const auto& mat : matSet.materials) { - for (const auto& chunk : mat.chunks) { - if (const auto* const pass = chunk.get_if()) { - toksOut.emplace(std::make_pair(pass->texId.toUint32(), store.GetObj({SBIG('TXTR'), pass->texId.toUint32()}))); - } - } - } -} +//void CBooModel::MakeTexturesFromMats(const MaterialSet& matSet, +// std::unordered_map>& toksOut, +// IObjectStore& store) { +// for (const auto& mat : matSet.materials) { +// for (const auto& chunk : mat.chunks) { +// if (const auto* const pass = chunk.get_if()) { +// toksOut.emplace(std::make_pair(pass->texId.toUint32(), store.GetObj({SBIG('TXTR'), pass->texId.toUint32()}))); +// } +// } +// } +//} void CBooModel::MakeTexturesFromMats(std::unordered_map>& toksOut, IObjectStore& store) { - MakeTexturesFromMats(*x4_matSet, toksOut, store); +// MakeTexturesFromMats(*x4_matSet, toksOut, store); } void CBooModel::ActivateLights(const std::vector& lights) { m_lightingData.ActivateLights(lights); } @@ -439,7 +439,7 @@ void CBooModel::RemapMaterialData(SShader& shader) { // TODO what is this checking? // if (!shader.m_geomLayout) // return; - x4_matSet = &shader.m_matSet; +// x4_matSet = &shader.m_matSet; x1c_textures = shader.x0_textures; x40_24_texturesLoaded = false; } @@ -549,74 +549,74 @@ void CBooModel::DrawSurfaces(const CModelFlags& flags) const { } } -static EExtendedShader ResolveExtendedShader(const MaterialSet::Material& data, const CModelFlags& flags) { - bool noZWrite = flags.m_noZWrite || !data.flags.depthWrite(); - - /* Ensure cubemap extension shaders fall back to non-cubemap equivalents if necessary */ - EExtendedShader intermediateExtended = flags.m_extendedShader; - if (!hecl::com_cubemaps->toBoolean() || g_Renderer->IsThermalVisorHotPass() || g_Renderer->IsThermalVisorActive()) { - if (intermediateExtended == EExtendedShader::LightingCubeReflection) - intermediateExtended = EExtendedShader::Lighting; - else if (intermediateExtended == EExtendedShader::LightingCubeReflectionWorldShadow) - intermediateExtended = EExtendedShader::WorldShadow; - } - - EExtendedShader extended = EExtendedShader::Flat; - if (intermediateExtended == EExtendedShader::Lighting) { - /* Transform lighting into thermal if the thermal visor is active */ - if (g_Renderer->IsThermalVisorHotPass()) - return flags.m_noZTest ? EExtendedShader::LightingAlphaWriteNoZTestNoZWrite - : (noZWrite ? EExtendedShader::ThermalStaticNoZWrite : EExtendedShader::ThermalStatic); - else if (g_Renderer->IsThermalVisorActive()) - return EExtendedShader::ThermalCold; - if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Opaque) { - /* Override shader if originally opaque (typical for FRME models) */ - if (flags.x0_blendMode > 6) { - if (flags.m_depthGreater) - extended = EExtendedShader::ForcedAdditiveNoZWriteDepthGreater; - else - extended = - flags.m_noCull - ? (noZWrite ? EExtendedShader::ForcedAdditiveNoCullNoZWrite : EExtendedShader::ForcedAdditiveNoCull) - : (noZWrite ? EExtendedShader::ForcedAdditiveNoZWrite : EExtendedShader::ForcedAdditive); - } else if (flags.x0_blendMode > 4) { - extended = flags.m_noCull - ? (noZWrite ? EExtendedShader::ForcedAlphaNoCullNoZWrite : EExtendedShader::ForcedAlphaNoCull) - : (noZWrite ? EExtendedShader::ForcedAlphaNoZWrite : EExtendedShader::ForcedAlpha); - } else { - extended = flags.m_noCull - ? (noZWrite ? EExtendedShader::ForcedAlphaNoCullNoZWrite : EExtendedShader::ForcedAlphaNoCull) - : (noZWrite ? EExtendedShader::ForcedAlphaNoZWrite : EExtendedShader::Lighting); - } - } else if (flags.m_noCull && noZWrite) { - /* Substitute no-cull,no-zwrite pipeline if available */ - if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Additive) - extended = EExtendedShader::ForcedAdditiveNoCullNoZWrite; - else - extended = EExtendedShader::ForcedAlphaNoCullNoZWrite; - } else if (flags.m_noCull) { - /* Substitute no-cull pipeline if available */ - if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Additive) - extended = EExtendedShader::ForcedAdditiveNoCull; - else - extended = EExtendedShader::ForcedAlphaNoCull; - } else if (noZWrite) { - /* Substitute no-zwrite pipeline if available */ - if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Additive) - extended = EExtendedShader::ForcedAdditiveNoZWrite; - else - extended = EExtendedShader::ForcedAlphaNoZWrite; - } else { - extended = EExtendedShader::Lighting; - } - } else if (intermediateExtended == EExtendedShader::ThermalModel) { - extended = flags.m_noZTest ? EExtendedShader::ThermalModelNoZTestNoZWrite : EExtendedShader::ThermalModel; - } else if (intermediateExtended < EExtendedShader::MAX) { - extended = intermediateExtended; - } - - return extended; -} +//static EExtendedShader ResolveExtendedShader(const MaterialSet::Material& data, const CModelFlags& flags) { +// bool noZWrite = flags.m_noZWrite || !data.flags.depthWrite(); +// +// /* Ensure cubemap extension shaders fall back to non-cubemap equivalents if necessary */ +// EExtendedShader intermediateExtended = flags.m_extendedShader; +// if (!com_cubemaps->toBoolean() || g_Renderer->IsThermalVisorHotPass() || g_Renderer->IsThermalVisorActive()) { +// if (intermediateExtended == EExtendedShader::LightingCubeReflection) +// intermediateExtended = EExtendedShader::Lighting; +// else if (intermediateExtended == EExtendedShader::LightingCubeReflectionWorldShadow) +// intermediateExtended = EExtendedShader::WorldShadow; +// } +// +// EExtendedShader extended = EExtendedShader::Flat; +// if (intermediateExtended == EExtendedShader::Lighting) { +// /* Transform lighting into thermal if the thermal visor is active */ +// if (g_Renderer->IsThermalVisorHotPass()) +// return flags.m_noZTest ? EExtendedShader::LightingAlphaWriteNoZTestNoZWrite +// : (noZWrite ? EExtendedShader::ThermalStaticNoZWrite : EExtendedShader::ThermalStatic); +// else if (g_Renderer->IsThermalVisorActive()) +// return EExtendedShader::ThermalCold; +// if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Opaque) { +// /* Override shader if originally opaque (typical for FRME models) */ +// if (flags.x0_blendMode > 6) { +// if (flags.m_depthGreater) +// extended = EExtendedShader::ForcedAdditiveNoZWriteDepthGreater; +// else +// extended = +// flags.m_noCull +// ? (noZWrite ? EExtendedShader::ForcedAdditiveNoCullNoZWrite : EExtendedShader::ForcedAdditiveNoCull) +// : (noZWrite ? EExtendedShader::ForcedAdditiveNoZWrite : EExtendedShader::ForcedAdditive); +// } else if (flags.x0_blendMode > 4) { +// extended = flags.m_noCull +// ? (noZWrite ? EExtendedShader::ForcedAlphaNoCullNoZWrite : EExtendedShader::ForcedAlphaNoCull) +// : (noZWrite ? EExtendedShader::ForcedAlphaNoZWrite : EExtendedShader::ForcedAlpha); +// } else { +// extended = flags.m_noCull +// ? (noZWrite ? EExtendedShader::ForcedAlphaNoCullNoZWrite : EExtendedShader::ForcedAlphaNoCull) +// : (noZWrite ? EExtendedShader::ForcedAlphaNoZWrite : EExtendedShader::Lighting); +// } +// } else if (flags.m_noCull && noZWrite) { +// /* Substitute no-cull,no-zwrite pipeline if available */ +// if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Additive) +// extended = EExtendedShader::ForcedAdditiveNoCullNoZWrite; +// else +// extended = EExtendedShader::ForcedAlphaNoCullNoZWrite; +// } else if (flags.m_noCull) { +// /* Substitute no-cull pipeline if available */ +// if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Additive) +// extended = EExtendedShader::ForcedAdditiveNoCull; +// else +// extended = EExtendedShader::ForcedAlphaNoCull; +// } else if (noZWrite) { +// /* Substitute no-zwrite pipeline if available */ +// if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Additive) +// extended = EExtendedShader::ForcedAdditiveNoZWrite; +// else +// extended = EExtendedShader::ForcedAlphaNoZWrite; +// } else { +// extended = EExtendedShader::Lighting; +// } +// } else if (intermediateExtended == EExtendedShader::ThermalModel) { +// extended = flags.m_noZTest ? EExtendedShader::ThermalModelNoZTestNoZWrite : EExtendedShader::ThermalModel; +// } else if (intermediateExtended < EExtendedShader::MAX) { +// extended = intermediateExtended; +// } +// +// return extended; +//} void CBooModel::DrawSurface(const CBooSurface& surf, const CModelFlags& flags) const { // if (m_uniUpdateCount == 0 || m_uniUpdateCount > m_instances.size()) @@ -660,194 +660,194 @@ void CBooModel::WarmupDrawSurface(const CBooSurface& surf) const { // } } -void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const MaterialSet::Material::PASS& anim) { - using UVAnimType = MaterialSet::Material::BlendMaterial::UVAnimType; - if (anim.uvAnimType == UVAnimType::Invalid) - return; - zeus::CMatrix4f& texMtxOut = reinterpret_cast(*bufOut); - zeus::CMatrix4f& postMtxOut = reinterpret_cast(*(bufOut + sizeof(zeus::CMatrix4f))); - texMtxOut = zeus::CMatrix4f(); - postMtxOut = zeus::CMatrix4f(); - switch (anim.uvAnimType) { - case UVAnimType::MvInvNoTranslation: { - texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); - texMtxOut[3].w() = 1.f; - postMtxOut[0].x() = 0.5f; - postMtxOut[1].y() = 0.5f; - postMtxOut[3].x() = 0.5f; - postMtxOut[3].y() = 0.5f; - break; - } - case UVAnimType::MvInv: { - texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); - texMtxOut[3] = CGraphics::g_ViewMatrix.inverse() * CGraphics::g_GXModelMatrix.origin; - texMtxOut[3].w() = 1.f; - postMtxOut[0].x() = 0.5f; - postMtxOut[1].y() = 0.5f; - postMtxOut[3].x() = 0.5f; - postMtxOut[3].y() = 0.5f; - break; - } - case UVAnimType::Scroll: { - texMtxOut[3].x() = CGraphics::GetSecondsMod900() * anim.uvAnimParms[2] + anim.uvAnimParms[0]; - texMtxOut[3].y() = CGraphics::GetSecondsMod900() * anim.uvAnimParms[3] + anim.uvAnimParms[1]; - break; - } - case UVAnimType::Rotation: { - float angle = CGraphics::GetSecondsMod900() * anim.uvAnimParms[1] + anim.uvAnimParms[0]; - float acos = std::cos(angle); - float asin = std::sin(angle); - texMtxOut[0].x() = acos; - texMtxOut[0].y() = asin; - texMtxOut[1].x() = -asin; - texMtxOut[1].y() = acos; - texMtxOut[3].x() = (1.0f - (acos - asin)) * 0.5f; - texMtxOut[3].y() = (1.0f - (asin + acos)) * 0.5f; - break; - } - case UVAnimType::HStrip: { - float value = anim.uvAnimParms[0] * anim.uvAnimParms[2] * (anim.uvAnimParms[3] + CGraphics::GetSecondsMod900()); - texMtxOut[3].x() = std::trunc(anim.uvAnimParms[1] * fmod(value, 1.0f)) * anim.uvAnimParms[2]; - break; - } - case UVAnimType::VStrip: { - float value = anim.uvAnimParms[0] * anim.uvAnimParms[2] * (anim.uvAnimParms[3] + CGraphics::GetSecondsMod900()); - texMtxOut[3].y() = std::trunc(anim.uvAnimParms[1] * fmod(value, 1.0f)) * anim.uvAnimParms[2]; - break; - } - case UVAnimType::Model: { - texMtxOut = CGraphics::g_GXModelMatrix.toMatrix4f(); - texMtxOut[3] = zeus::CVector4f(0.f, 0.f, 0.f, 1.f); - postMtxOut[0].x() = 0.5f; - postMtxOut[1].y() = 0.f; - postMtxOut[2].y() = 0.5f; - postMtxOut[3].x() = CGraphics::g_GXModelMatrix.origin.x() * 0.05f; - postMtxOut[3].y() = CGraphics::g_GXModelMatrix.origin.y() * 0.05f; - break; - } - case UVAnimType::CylinderEnvironment: { - texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); - - const zeus::CVector3f& viewOrigin = CGraphics::g_ViewMatrix.origin; - float xy = (viewOrigin.x() + viewOrigin.y()) * 0.025f * anim.uvAnimParms[1]; - xy = (xy - std::trunc(xy)); - float z = (viewOrigin.z()) * 0.05f * anim.uvAnimParms[1]; - z = (z - std::trunc(z)); - - float halfA = anim.uvAnimParms[0] * 0.5f; - - postMtxOut = - zeus::CTransform(zeus::CMatrix3f(halfA, 0.0, 0.0, 0.0, 0.0, halfA, 0.0, 0.0, 0.0), zeus::CVector3f(xy, z, 1.0)) - .toMatrix4f(); - break; - } - default: - break; - } - bufOut += sizeof(zeus::CMatrix4f) * 2; -} - -void CBooModel::UVAnimationBuffer::PadOutBuffer(u8*& bufStart, u8*& bufOut) { - bufOut = bufStart + ROUND_UP_256(bufOut - bufStart); -} - -void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet, const CModelFlags& flags, - const CBooModel* parent) { - u8* start = bufOut; - - if (flags.m_extendedShader == EExtendedShader::MorphBallShadow) { - /* Special matrices for MorphBall shadow rendering */ - zeus::CMatrix4f texMtx = (zeus::CTransform::Scale(1.f / (flags.mbShadowBox.max - flags.mbShadowBox.min)) * - zeus::CTransform::Translate(-flags.mbShadowBox.min) * CGraphics::g_GXModelMatrix) - .toMatrix4f(); - for (const MaterialSet::Material& mat : matSet->materials) { - (void)mat; - std::array* mtxs = reinterpret_cast*>(bufOut); - mtxs[0][0] = texMtx; - mtxs[0][1] = MBShadowPost0; - mtxs[1][0] = texMtx; - mtxs[1][1] = MBShadowPost1; - bufOut += sizeof(zeus::CMatrix4f) * 2 * 8; - PadOutBuffer(start, bufOut); - } - return; - } else if (flags.m_extendedShader == EExtendedShader::Disintegrate) { - assert(parent != nullptr && "Parent CBooModel not set"); - zeus::CTransform xf = zeus::CTransform::RotateX(-zeus::degToRad(45.f)); - zeus::CAABox aabb = parent->GetAABB().getTransformedAABox(xf); - xf = zeus::CTransform::Scale(5.f / (aabb.max - aabb.min)) * zeus::CTransform::Translate(-aabb.min) * xf; - zeus::CMatrix4f texMtx = xf.toMatrix4f(); - zeus::CMatrix4f post0 = DisintegratePost; - post0[3].x() = flags.addColor.a(); - post0[3].y() = 6.f * -(1.f - flags.addColor.a()) + 1.f; - zeus::CMatrix4f post1 = DisintegratePost; - post1[3].x() = -0.85f * flags.addColor.a() - 0.15f; - post1[3].y() = float(post0[3].y()); - /* Special matrices for disintegration rendering */ - for (const MaterialSet::Material& mat : matSet->materials) { - (void)mat; - std::array* mtxs = reinterpret_cast*>(bufOut); - mtxs[0][0] = texMtx; - mtxs[0][1] = post0; - mtxs[1][0] = texMtx; - mtxs[1][1] = post1; - bufOut += sizeof(zeus::CMatrix4f) * 2 * 8; - PadOutBuffer(start, bufOut); - } - return; - } - - std::optional> specialMtxOut; - if (flags.m_extendedShader == EExtendedShader::ThermalModel || - flags.m_extendedShader == EExtendedShader::ThermalModelNoZTestNoZWrite || - flags.m_extendedShader == EExtendedShader::ThermalStatic || - flags.m_extendedShader == EExtendedShader::ThermalStaticNoZWrite) { - /* Special Mode0 matrix for exclusive Thermal Visor use */ - specialMtxOut.emplace(); - - zeus::CMatrix4f& texMtxOut = (*specialMtxOut)[0]; - texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); - texMtxOut[3].zeroOut(); - texMtxOut[3].w() = 1.f; - - zeus::CMatrix4f& postMtxOut = (*specialMtxOut)[1]; - postMtxOut[0].x() = 0.5f; - postMtxOut[1].y() = 0.5f; - postMtxOut[3].x() = 0.5f; - postMtxOut[3].y() = 0.5f; - } else if (flags.m_extendedShader == EExtendedShader::WorldShadow || - flags.m_extendedShader == EExtendedShader::LightingCubeReflectionWorldShadow) { - /* Special matrix for mapping world shadow */ - specialMtxOut.emplace(); - - zeus::CMatrix4f mat = g_shadowTexXf.toMatrix4f(); - zeus::CMatrix4f& texMtxOut = (*specialMtxOut)[0]; - texMtxOut[0][0] = float(mat[0][0]); - texMtxOut[1][0] = float(mat[1][0]); - texMtxOut[2][0] = float(mat[2][0]); - texMtxOut[3][0] = float(mat[3][0]); - texMtxOut[0][1] = float(mat[0][2]); - texMtxOut[1][1] = float(mat[1][2]); - texMtxOut[2][1] = float(mat[2][2]); - texMtxOut[3][1] = float(mat[3][2]); - } - - for (const MaterialSet::Material& mat : matSet->materials) { - if (specialMtxOut) { - std::array* mtxs = reinterpret_cast*>(bufOut); - mtxs[7][0] = (*specialMtxOut)[0]; - mtxs[7][1] = (*specialMtxOut)[1]; - } - u8* bufOrig = bufOut; - for (const auto& chunk : mat.chunks) { - if (const auto* const pass = chunk.get_if()) { - ProcessAnimation(bufOut, *pass); - } - } - bufOut = bufOrig + sizeof(zeus::CMatrix4f) * 2 * 8; - PadOutBuffer(start, bufOut); - } -} +//void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const MaterialSet::Material::PASS& anim) { +// using UVAnimType = MaterialSet::Material::BlendMaterial::UVAnimType; +// if (anim.uvAnimType == UVAnimType::Invalid) +// return; +// zeus::CMatrix4f& texMtxOut = reinterpret_cast(*bufOut); +// zeus::CMatrix4f& postMtxOut = reinterpret_cast(*(bufOut + sizeof(zeus::CMatrix4f))); +// texMtxOut = zeus::CMatrix4f(); +// postMtxOut = zeus::CMatrix4f(); +// switch (anim.uvAnimType) { +// case UVAnimType::MvInvNoTranslation: { +// texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); +// texMtxOut[3].w() = 1.f; +// postMtxOut[0].x() = 0.5f; +// postMtxOut[1].y() = 0.5f; +// postMtxOut[3].x() = 0.5f; +// postMtxOut[3].y() = 0.5f; +// break; +// } +// case UVAnimType::MvInv: { +// texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); +// texMtxOut[3] = CGraphics::g_ViewMatrix.inverse() * CGraphics::g_GXModelMatrix.origin; +// texMtxOut[3].w() = 1.f; +// postMtxOut[0].x() = 0.5f; +// postMtxOut[1].y() = 0.5f; +// postMtxOut[3].x() = 0.5f; +// postMtxOut[3].y() = 0.5f; +// break; +// } +// case UVAnimType::Scroll: { +// texMtxOut[3].x() = CGraphics::GetSecondsMod900() * anim.uvAnimParms[2] + anim.uvAnimParms[0]; +// texMtxOut[3].y() = CGraphics::GetSecondsMod900() * anim.uvAnimParms[3] + anim.uvAnimParms[1]; +// break; +// } +// case UVAnimType::Rotation: { +// float angle = CGraphics::GetSecondsMod900() * anim.uvAnimParms[1] + anim.uvAnimParms[0]; +// float acos = std::cos(angle); +// float asin = std::sin(angle); +// texMtxOut[0].x() = acos; +// texMtxOut[0].y() = asin; +// texMtxOut[1].x() = -asin; +// texMtxOut[1].y() = acos; +// texMtxOut[3].x() = (1.0f - (acos - asin)) * 0.5f; +// texMtxOut[3].y() = (1.0f - (asin + acos)) * 0.5f; +// break; +// } +// case UVAnimType::HStrip: { +// float value = anim.uvAnimParms[0] * anim.uvAnimParms[2] * (anim.uvAnimParms[3] + CGraphics::GetSecondsMod900()); +// texMtxOut[3].x() = std::trunc(anim.uvAnimParms[1] * fmod(value, 1.0f)) * anim.uvAnimParms[2]; +// break; +// } +// case UVAnimType::VStrip: { +// float value = anim.uvAnimParms[0] * anim.uvAnimParms[2] * (anim.uvAnimParms[3] + CGraphics::GetSecondsMod900()); +// texMtxOut[3].y() = std::trunc(anim.uvAnimParms[1] * fmod(value, 1.0f)) * anim.uvAnimParms[2]; +// break; +// } +// case UVAnimType::Model: { +// texMtxOut = CGraphics::g_GXModelMatrix.toMatrix4f(); +// texMtxOut[3] = zeus::CVector4f(0.f, 0.f, 0.f, 1.f); +// postMtxOut[0].x() = 0.5f; +// postMtxOut[1].y() = 0.f; +// postMtxOut[2].y() = 0.5f; +// postMtxOut[3].x() = CGraphics::g_GXModelMatrix.origin.x() * 0.05f; +// postMtxOut[3].y() = CGraphics::g_GXModelMatrix.origin.y() * 0.05f; +// break; +// } +// case UVAnimType::CylinderEnvironment: { +// texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); +// +// const zeus::CVector3f& viewOrigin = CGraphics::g_ViewMatrix.origin; +// float xy = (viewOrigin.x() + viewOrigin.y()) * 0.025f * anim.uvAnimParms[1]; +// xy = (xy - std::trunc(xy)); +// float z = (viewOrigin.z()) * 0.05f * anim.uvAnimParms[1]; +// z = (z - std::trunc(z)); +// +// float halfA = anim.uvAnimParms[0] * 0.5f; +// +// postMtxOut = +// zeus::CTransform(zeus::CMatrix3f(halfA, 0.0, 0.0, 0.0, 0.0, halfA, 0.0, 0.0, 0.0), zeus::CVector3f(xy, z, 1.0)) +// .toMatrix4f(); +// break; +// } +// default: +// break; +// } +// bufOut += sizeof(zeus::CMatrix4f) * 2; +//} +// +//void CBooModel::UVAnimationBuffer::PadOutBuffer(u8*& bufStart, u8*& bufOut) { +// bufOut = bufStart + ROUND_UP_256(bufOut - bufStart); +//} +// +//void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet, const CModelFlags& flags, +// const CBooModel* parent) { +// u8* start = bufOut; +// +// if (flags.m_extendedShader == EExtendedShader::MorphBallShadow) { +// /* Special matrices for MorphBall shadow rendering */ +// zeus::CMatrix4f texMtx = (zeus::CTransform::Scale(1.f / (flags.mbShadowBox.max - flags.mbShadowBox.min)) * +// zeus::CTransform::Translate(-flags.mbShadowBox.min) * CGraphics::g_GXModelMatrix) +// .toMatrix4f(); +// for (const MaterialSet::Material& mat : matSet->materials) { +// (void)mat; +// std::array* mtxs = reinterpret_cast*>(bufOut); +// mtxs[0][0] = texMtx; +// mtxs[0][1] = MBShadowPost0; +// mtxs[1][0] = texMtx; +// mtxs[1][1] = MBShadowPost1; +// bufOut += sizeof(zeus::CMatrix4f) * 2 * 8; +// PadOutBuffer(start, bufOut); +// } +// return; +// } else if (flags.m_extendedShader == EExtendedShader::Disintegrate) { +// assert(parent != nullptr && "Parent CBooModel not set"); +// zeus::CTransform xf = zeus::CTransform::RotateX(-zeus::degToRad(45.f)); +// zeus::CAABox aabb = parent->GetAABB().getTransformedAABox(xf); +// xf = zeus::CTransform::Scale(5.f / (aabb.max - aabb.min)) * zeus::CTransform::Translate(-aabb.min) * xf; +// zeus::CMatrix4f texMtx = xf.toMatrix4f(); +// zeus::CMatrix4f post0 = DisintegratePost; +// post0[3].x() = flags.addColor.a(); +// post0[3].y() = 6.f * -(1.f - flags.addColor.a()) + 1.f; +// zeus::CMatrix4f post1 = DisintegratePost; +// post1[3].x() = -0.85f * flags.addColor.a() - 0.15f; +// post1[3].y() = float(post0[3].y()); +// /* Special matrices for disintegration rendering */ +// for (const MaterialSet::Material& mat : matSet->materials) { +// (void)mat; +// std::array* mtxs = reinterpret_cast*>(bufOut); +// mtxs[0][0] = texMtx; +// mtxs[0][1] = post0; +// mtxs[1][0] = texMtx; +// mtxs[1][1] = post1; +// bufOut += sizeof(zeus::CMatrix4f) * 2 * 8; +// PadOutBuffer(start, bufOut); +// } +// return; +// } +// +// std::optional> specialMtxOut; +// if (flags.m_extendedShader == EExtendedShader::ThermalModel || +// flags.m_extendedShader == EExtendedShader::ThermalModelNoZTestNoZWrite || +// flags.m_extendedShader == EExtendedShader::ThermalStatic || +// flags.m_extendedShader == EExtendedShader::ThermalStaticNoZWrite) { +// /* Special Mode0 matrix for exclusive Thermal Visor use */ +// specialMtxOut.emplace(); +// +// zeus::CMatrix4f& texMtxOut = (*specialMtxOut)[0]; +// texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f(); +// texMtxOut[3].zeroOut(); +// texMtxOut[3].w() = 1.f; +// +// zeus::CMatrix4f& postMtxOut = (*specialMtxOut)[1]; +// postMtxOut[0].x() = 0.5f; +// postMtxOut[1].y() = 0.5f; +// postMtxOut[3].x() = 0.5f; +// postMtxOut[3].y() = 0.5f; +// } else if (flags.m_extendedShader == EExtendedShader::WorldShadow || +// flags.m_extendedShader == EExtendedShader::LightingCubeReflectionWorldShadow) { +// /* Special matrix for mapping world shadow */ +// specialMtxOut.emplace(); +// +// zeus::CMatrix4f mat = g_shadowTexXf.toMatrix4f(); +// zeus::CMatrix4f& texMtxOut = (*specialMtxOut)[0]; +// texMtxOut[0][0] = float(mat[0][0]); +// texMtxOut[1][0] = float(mat[1][0]); +// texMtxOut[2][0] = float(mat[2][0]); +// texMtxOut[3][0] = float(mat[3][0]); +// texMtxOut[0][1] = float(mat[0][2]); +// texMtxOut[1][1] = float(mat[1][2]); +// texMtxOut[2][1] = float(mat[2][2]); +// texMtxOut[3][1] = float(mat[3][2]); +// } +// +// for (const MaterialSet::Material& mat : matSet->materials) { +// if (specialMtxOut) { +// std::array* mtxs = reinterpret_cast*>(bufOut); +// mtxs[7][0] = (*specialMtxOut)[0]; +// mtxs[7][1] = (*specialMtxOut)[1]; +// } +// u8* bufOrig = bufOut; +// for (const auto& chunk : mat.chunks) { +// if (const auto* const pass = chunk.get_if()) { +// ProcessAnimation(bufOut, *pass); +// } +// } +// bufOut = bufOrig + sizeof(zeus::CMatrix4f) * 2 * 8; +// PadOutBuffer(start, bufOut); +// } +//} //void GeometryUniformLayout::Update(const CModelFlags& flags, const CSkinRules* cskr, const CPoseAsTransforms* pose, // const MaterialSet* matSet, const boo::ObjToken& buf, @@ -1118,7 +1118,7 @@ static const u8* MemoryFromPartData(const u8*& dataCur, const u32*& secSizeCur) else ret = nullptr; - dataCur += hecl::SBig(*secSizeCur); + dataCur += CBasics::SwapBytes(*secSizeCur); ++secSizeCur; return ret; } @@ -1160,32 +1160,32 @@ CModel::CModel(std::unique_ptr&& in, u32 /* dataLen */, IObjectStore* stor x38_lastFrame = CGraphics::GetFrameCounter() - 2; std::unique_ptr data = std::move(in); - u32 version = hecl::SBig(*reinterpret_cast(data.get() + 0x4)); - m_flags = hecl::SBig(*reinterpret_cast(data.get() + 0x8)); + u32 version = CBasics::SwapBytes(*reinterpret_cast(data.get() + 0x4)); + m_flags = CBasics::SwapBytes(*reinterpret_cast(data.get() + 0x8)); if (version != 0x10002) { Log.report(logvisor::Error, FMT_STRING("invalid CMDL for loading with boo")); return; } - u32 secCount = hecl::SBig(*reinterpret_cast(data.get() + 0x24)); - u32 matSetCount = hecl::SBig(*reinterpret_cast(data.get() + 0x28)); + u32 secCount = CBasics::SwapBytes(*reinterpret_cast(data.get() + 0x24)); + u32 matSetCount = CBasics::SwapBytes(*reinterpret_cast(data.get() + 0x28)); x18_matSets.reserve(matSetCount); const u8* dataCur = data.get() + ROUND_UP_32(0x2c + secCount * 4); const u32* secSizeCur = reinterpret_cast(data.get() + 0x2c); for (u32 i = 0; i < matSetCount; ++i) { - const u32 matSetSz = hecl::SBig(*secSizeCur); + const u32 matSetSz = CBasics::SwapBytes(*secSizeCur); const u8* sec = MemoryFromPartData(dataCur, secSizeCur); SShader& shader = x18_matSets.emplace_back(i); - athena::io::MemoryReader r(sec, matSetSz); - shader.m_matSet.read(r); - CBooModel::MakeTexturesFromMats(shader.m_matSet, shader.x0_textures, *store); +// athena::io::MemoryReader r(sec, matSetSz); +// shader.m_matSet.read(r); +// CBooModel::MakeTexturesFromMats(shader.m_matSet, shader.x0_textures, *store); } { - u32 hmdlSz = hecl::SBig(*secSizeCur); + u32 hmdlSz = CBasics::SwapBytes(*secSizeCur); const u8* hmdlMetadata = MemoryFromPartData(dataCur, secSizeCur); - athena::io::MemoryReader r(hmdlMetadata, hmdlSz); - m_hmdlMeta.read(r); +// athena::io::MemoryReader r(hmdlMetadata, hmdlSz); +// m_hmdlMeta.read(r); } const u8* vboData = MemoryFromPartData(dataCur, secSizeCur); @@ -1218,20 +1218,20 @@ CModel::CModel(std::unique_ptr&& in, u32 /* dataLen */, IObjectStore* stor // return true; // } BooTrace); - const u32 surfCount = hecl::SBig(*reinterpret_cast(surfInfo)); + const u32 surfCount = CBasics::SwapBytes(*reinterpret_cast(surfInfo)); x8_surfaces.reserve(surfCount); for (u32 i = 0; i < surfCount; ++i) { - const u32 surfSz = hecl::SBig(*secSizeCur); + const u32 surfSz = CBasics::SwapBytes(*secSizeCur); const u8* sec = MemoryFromPartData(dataCur, secSizeCur); CBooSurface& surf = x8_surfaces.emplace_back(); surf.selfIdx = i; - athena::io::MemoryReader r(sec, surfSz); - surf.m_data.read(r); +// athena::io::MemoryReader r(sec, surfSz); +// surf.m_data.read(r); } const float* aabbPtr = reinterpret_cast(data.get() + 0xc); - m_aabb = zeus::CAABox(hecl::SBig(aabbPtr[0]), hecl::SBig(aabbPtr[1]), hecl::SBig(aabbPtr[2]), hecl::SBig(aabbPtr[3]), - hecl::SBig(aabbPtr[4]), hecl::SBig(aabbPtr[5])); + m_aabb = zeus::CAABox(CBasics::SwapBytes(aabbPtr[0]), CBasics::SwapBytes(aabbPtr[1]), CBasics::SwapBytes(aabbPtr[2]), CBasics::SwapBytes(aabbPtr[3]), + CBasics::SwapBytes(aabbPtr[4]), CBasics::SwapBytes(aabbPtr[5])); x28_modelInst = MakeNewInstance(0, false); } @@ -1270,14 +1270,20 @@ bool CModel::IsLoaded(int shaderIdx) const { return x28_modelInst->TryLockTextures(); } -size_t CModel::GetPoolVertexOffset(size_t idx) const { return m_hmdlMeta.vertStride * idx; } +size_t CModel::GetPoolVertexOffset(size_t idx) const { +// return m_hmdlMeta.vertStride * idx; + return 0; +} zeus::CVector3f CModel::GetPoolVertex(size_t idx) const { const auto* floats = reinterpret_cast(m_dynamicVertexData.get() + GetPoolVertexOffset(idx)); return {floats}; } -size_t CModel::GetPoolNormalOffset(size_t idx) const { return m_hmdlMeta.vertStride * idx + 12; } +size_t CModel::GetPoolNormalOffset(size_t idx) const { +// return m_hmdlMeta.vertStride * idx + 12; + return 0; +} zeus::CVector3f CModel::GetPoolNormal(size_t idx) const { const auto* floats = reinterpret_cast(m_dynamicVertexData.get() + GetPoolNormalOffset(idx)); diff --git a/Runtime/Graphics/CPVSAreaSet.cpp b/Runtime/Graphics/CPVSAreaSet.cpp index 085d0c8d5..fd5bfc4bf 100644 --- a/Runtime/Graphics/CPVSAreaSet.cpp +++ b/Runtime/Graphics/CPVSAreaSet.cpp @@ -1,20 +1,20 @@ #include "Runtime/Graphics/CPVSAreaSet.hpp" -#include "IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" namespace metaforce { CPVSAreaSet::CPVSAreaSet(const u8* data, u32 len) { CMemoryInStream r(data, len); - x0_numFeatures = r.readUint32Big(); - x4_numLights = r.readUint32Big(); - x8_num2ndLights = r.readUint32Big(); - xc_numActors = r.readUint32Big(); - x10_leafSize = r.readUint32Big(); - x14_lightIndexCount = r.readUint32Big(); + x0_numFeatures = r.ReadLong(); + x4_numLights = r.ReadLong(); + x8_num2ndLights = r.ReadLong(); + xc_numActors = r.ReadLong(); + x10_leafSize = r.ReadLong(); + x14_lightIndexCount = r.ReadLong(); x18_entityIndex.reserve(xc_numActors); for (u32 i = 0; i < xc_numActors; ++i) - x18_entityIndex.push_back(r.readUint32Big()); - x1c_lightLeaves = data + r.position(); + x18_entityIndex.push_back(r.ReadLong()); + x1c_lightLeaves = data + r.GetReadPosition(); const u8* octreeData = x1c_lightLeaves + x14_lightIndexCount * x10_leafSize; x20_octree = CPVSVisOctree::MakePVSVisOctree(octreeData); } diff --git a/Runtime/Graphics/CPVSVisOctree.cpp b/Runtime/Graphics/CPVSVisOctree.cpp index 5f58e334a..5f04fa6e4 100644 --- a/Runtime/Graphics/CPVSVisOctree.cpp +++ b/Runtime/Graphics/CPVSVisOctree.cpp @@ -1,5 +1,5 @@ #include "Runtime/Graphics/CPVSVisOctree.hpp" -#include "IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include @@ -7,11 +7,11 @@ namespace metaforce { CPVSVisOctree CPVSVisOctree::MakePVSVisOctree(const u8* data) { CMemoryInStream r(data, 68); - const zeus::CAABox aabb = zeus::CAABox::ReadBoundingBoxBig(r); - const u32 numObjects = r.readUint32Big(); - const u32 numLights = r.readUint32Big(); - r.readUint32Big(); - return CPVSVisOctree(aabb, numObjects, numLights, data + r.position()); + const zeus::CAABox aabb = r.Get(); + const u32 numObjects = r.ReadLong(); + const u32 numLights = r.ReadLong(); + r.ReadLong(); + return CPVSVisOctree(aabb, numObjects, numLights, data + r.GetReadPosition()); } CPVSVisOctree::CPVSVisOctree(const zeus::CAABox& aabb, u32 numObjects, u32 numLights, const u8* c) diff --git a/Runtime/Graphics/CTexture.hpp b/Runtime/Graphics/CTexture.hpp index 7c2a87a02..0cbf56442 100644 --- a/Runtime/Graphics/CTexture.hpp +++ b/Runtime/Graphics/CTexture.hpp @@ -6,11 +6,9 @@ #include "Runtime/CFactoryMgr.hpp" #include "Runtime/GCNTypes.hpp" #include "Runtime/IObj.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Graphics/CGraphics.hpp" -//#include - namespace metaforce { class CVParamTransfer; class CTextureInfo; diff --git a/Runtime/Graphics/CTextureBoo.cpp b/Runtime/Graphics/CTextureBoo.cpp index 40832a6d1..1924e4790 100644 --- a/Runtime/Graphics/CTextureBoo.cpp +++ b/Runtime/Graphics/CTextureBoo.cpp @@ -2,11 +2,14 @@ #include +#include "Runtime/CBasics.hpp" #include "Runtime/CSimplePool.hpp" -#include "Runtime/CToken.hpp" -#include "Runtime/Graphics/CGraphics.hpp" #include "Runtime/CTextureCache.hpp" +#include "Runtime/CToken.hpp" #include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/Graphics/CGraphics.hpp" + +#include namespace metaforce { namespace { @@ -92,7 +95,7 @@ void CTexture::BuildI4FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < std::min(h, 8); ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), std::min(size_t(w) / 4, source.size())); + in.Get(source.data(), std::min(size_t(w) / 4, source.size())); for (size_t x = 0; x < std::min(w, 8); ++x) { target[x].r = Convert4To8(source[x / 2] >> ((x & 1) ? 0 : 4) & 0xf); target[x].g = target[x].r; @@ -132,7 +135,7 @@ void CTexture::BuildI8FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), source.size()); + in.Get(source.data(), source.size()); for (size_t x = 0; x < source.size(); ++x) { target[x].r = source[x]; target[x].g = source[x]; @@ -172,7 +175,7 @@ void CTexture::BuildIA4FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), source.size()); + in.Get(source.data(), source.size()); for (size_t x = 0; x < source.size(); ++x) { const u8 intensity = Convert4To8(source[x] >> 4 & 0xf); target[x].r = intensity; @@ -213,7 +216,7 @@ void CTexture::BuildIA8FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), sizeof(source)); + in.Get(reinterpret_cast(source.data()), sizeof(source)); for (size_t x = 0; x < source.size(); ++x) { const u8 intensity = source[x] >> 8; target[x].r = intensity; @@ -243,27 +246,27 @@ static std::vector DecodePalette(int numEntries, CInputStream& in) { enum class EPaletteType { IA8, RGB565, RGB5A3 }; - EPaletteType format = EPaletteType(in.readUint32Big()); - in.readUint32Big(); + EPaletteType format = EPaletteType(in.ReadLong()); + in.ReadLong(); switch (format) { case EPaletteType::IA8: { for (int e = 0; e < numEntries; ++e) { - u8 intensity = in.readUByte(); - u8 alpha = in.readUByte(); + u8 intensity = in.ReadUint8(); + u8 alpha = in.ReadUint8(); ret.push_back({intensity, intensity, intensity, alpha}); } break; } case EPaletteType::RGB565: { for (int e = 0; e < numEntries; ++e) { - u16 texel = in.readUint16Big(); + u16 texel = in.ReadShort(); ret.push_back({Convert5To8(texel >> 11 & 0x1f), Convert6To8(texel >> 5 & 0x3f), Convert5To8(texel & 0x1f), 0xff}); } break; } case EPaletteType::RGB5A3: { for (int e = 0; e < numEntries; ++e) { - u16 texel = in.readUint16Big(); + u16 texel = in.ReadShort(); if (texel & 0x8000) { ret.push_back( {Convert5To8(texel >> 10 & 0x1f), Convert5To8(texel >> 5 & 0x1f), Convert5To8(texel & 0x1f), 0xff}); @@ -296,7 +299,7 @@ void CTexture::BuildC4FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 8; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), source.size()); + in.Get(source.data(), source.size()); for (size_t x = 0; x < 8; ++x) { target[x] = palette[source[x / 2] >> ((x & 1) ? 0 : 4) & 0xf]; } @@ -334,7 +337,7 @@ void CTexture::BuildC8FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), source.size()); + in.Get(source.data(), source.size()); for (size_t x = 0; x < source.size(); ++x) { target[x] = palette[source[x]]; } @@ -375,7 +378,7 @@ void CTexture::BuildRGB565FromGCN(CInputStream& in, aurora::zstring_view label) for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; for (size_t x = 0; x < 4; ++x) { - const u16 texel = in.readUint16Big(); + const u16 texel = in.ReadShort(); target[x].r = Convert5To8(texel >> 11 & 0x1f); target[x].g = Convert6To8(texel >> 5 & 0x3f); target[x].b = Convert5To8(texel & 0x1f); @@ -414,7 +417,7 @@ void CTexture::BuildRGB5A3FromGCN(CInputStream& in, aurora::zstring_view label) for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; for (size_t x = 0; x < 4; ++x) { - const u16 texel = in.readUint16Big(); + const u16 texel = in.ReadShort(); if ((texel & 0x8000) != 0) { target[x].r = Convert5To8(texel >> 10 & 0x1f); target[x].g = Convert5To8(texel >> 5 & 0x1f); @@ -461,7 +464,7 @@ void CTexture::BuildRGBA8FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 4; ++y) { RGBA8* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), source.size()); + in.Get(source.data(), source.size()); for (size_t x = 0; x < 4; ++x) { if (c != 0) { target[x].g = source[x * 2]; @@ -505,10 +508,10 @@ void CTexture::BuildDXT1FromGCN(CInputStream& in, aurora::zstring_view label) { for (int y = 0; y < 2; ++y) { DXT1Block* target = targetMip + (baseY + y) * w + baseX; std::array source; - in.readBytesToBuf(source.data(), sizeof(source)); + in.Get(reinterpret_cast(source.data()), sizeof(source)); for (size_t x = 0; x < source.size(); ++x) { - target[x].color1 = hecl::SBig(source[x].color1); - target[x].color2 = hecl::SBig(source[x].color2); + target[x].color1 = CBasics::SwapBytes(source[x].color1); + target[x].color2 = CBasics::SwapBytes(source[x].color2); for (size_t i = 0; i < 4; ++i) { std::array ind; const u8 packed = source[x].lines[i]; @@ -551,7 +554,7 @@ void CTexture::BuildC8(const void* data, size_t length, aurora::zstring_view lab if (texelCount > length) Log.report(logvisor::Fatal, FMT_STRING("insufficient TXTR length ({}/{})"), length, texelCount); - uint32_t nentries = hecl::SBig(*reinterpret_cast(data)); + uint32_t nentries = CBasics::SwapBytes(*reinterpret_cast(data)); const u8* paletteTexels = reinterpret_cast(data) + 4; const u8* texels = reinterpret_cast(data) + 4 + nentries * 4; m_paletteTex = aurora::gfx::new_static_texture_2d(nentries, 1, 1, aurora::gfx::TextureFormat::RGBA8, @@ -581,7 +584,7 @@ void CTexture::BuildC8Font(const void* data, EFontType ftype, aurora::zstring_vi break; } - const uint32_t nentries = hecl::SBig(*reinterpret_cast(data)); + const uint32_t nentries = CBasics::SwapBytes(*reinterpret_cast(data)); const u8* texels = reinterpret_cast(data) + 4 + nentries * 4; auto buf = std::make_unique(texelCount * layerCount); @@ -715,11 +718,11 @@ CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips) : x0_fmt(fmt), x4_w CTexture::CTexture(std::unique_ptr&& in, u32 length, bool otex, const CTextureInfo* inf, CAssetId id) : m_textureInfo(inf) { std::unique_ptr owned = std::move(in); - athena::io::MemoryReader r(owned.get(), length); - x0_fmt = ETexelFormat(r.readUint32Big()); - x4_w = r.readUint16Big(); - x6_h = r.readUint16Big(); - x8_mips = r.readUint32Big(); + CMemoryInStream r(owned.get(), length, CMemoryInStream::EOwnerShip::NotOwned); + x0_fmt = ETexelFormat(r.ReadLong()); + x4_w = r.ReadShort(); + x6_h = r.ReadShort(); + x8_mips = r.ReadLong(); auto label = fmt::format(FMT_STRING("TXTR {:08X} ({})"), id.Value(), TextureFormatString(x0_fmt)); switch (x0_fmt) { @@ -823,9 +826,9 @@ std::unique_ptr CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& f const RGBA8* source = sourceMip + (x6_h - (baseY + y) - 1) * w + baseX; for (int x = 0; x < 4; ++x) { if (source[x].a == 0xff) { - *texel++ = hecl::SBig(u16((source[x].r >> 3 << 10) | (source[x].g >> 3 << 5) | (source[x].b >> 3))); + *texel++ = CBasics::SwapBytes(u16((source[x].r >> 3 << 10) | (source[x].g >> 3 << 5) | (source[x].b >> 3))); } else { - *texel++ = hecl::SBig(u16((source[x].r >> 4 << 8) | (source[x].g >> 4 << 4) | (source[x].b >> 4) | + *texel++ = CBasics::SwapBytes(u16((source[x].r >> 4 << 8) | (source[x].g >> 4 << 4) | (source[x].b >> 4) | (source[x].a >> 5 << 12))); } } @@ -843,7 +846,7 @@ std::unique_ptr CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& f int w = x4_w; int h = x6_h; const u8* data = m_otex.get() + 12; - u32 nentries = hecl::SBig(*reinterpret_cast(data)); + u32 nentries = CBasics::SwapBytes(*reinterpret_cast(data)); const RGBA8* paletteTexels = reinterpret_cast(data + 4); const u8* sourceMip = data + 4 + nentries * 4; @@ -854,9 +857,9 @@ std::unique_ptr CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& f } else { const RGBA8& colorIn = paletteTexels[i]; if (colorIn.a == 0xff) { - color = hecl::SBig(u16((colorIn.r >> 3 << 10) | (colorIn.g >> 3 << 5) | (colorIn.b >> 3) | 0x8000)); + color = CBasics::SwapBytes(u16((colorIn.r >> 3 << 10) | (colorIn.g >> 3 << 5) | (colorIn.b >> 3) | 0x8000)); } else { - color = hecl::SBig( + color = CBasics::SwapBytes( u16((colorIn.r >> 4 << 8) | (colorIn.g >> 4 << 4) | (colorIn.b >> 4) | (colorIn.a >> 5 << 12))); } } diff --git a/Runtime/Graphics/GX.hpp b/Runtime/Graphics/GX.hpp new file mode 100644 index 000000000..00cb2e0b5 --- /dev/null +++ b/Runtime/Graphics/GX.hpp @@ -0,0 +1,296 @@ +#pragma once + +#include + +namespace GX { +enum AttrType { NONE, DIRECT, INDEX8, INDEX16 }; + +enum TevColorArg { + CC_CPREV = 0, + CC_APREV = 1, + CC_C0 = 2, + CC_A0 = 3, + CC_C1 = 4, + CC_A1 = 5, + CC_C2 = 6, + CC_A2 = 7, + CC_TEXC = 8, + CC_TEXA = 9, + CC_RASC = 10, + CC_RASA = 11, + CC_ONE = 12, + CC_HALF = 13, + CC_KONST = 14, + CC_ZERO = 15, +}; + +enum TevAlphaArg { + CA_APREV = 0, + CA_A0 = 1, + CA_A1 = 2, + CA_A2 = 3, + CA_TEXA = 4, + CA_RASA = 5, + CA_KONST = 6, + CA_ZERO = 7, +}; + +enum TevKColorSel { + TEV_KCSEL_8_8 = 0x00, + TEV_KCSEL_7_8 = 0x01, + TEV_KCSEL_6_8 = 0x02, + TEV_KCSEL_5_8 = 0x03, + TEV_KCSEL_4_8 = 0x04, + TEV_KCSEL_3_8 = 0x05, + TEV_KCSEL_2_8 = 0x06, + TEV_KCSEL_1_8 = 0x07, + + TEV_KCSEL_1 = TEV_KCSEL_8_8, + TEV_KCSEL_3_4 = TEV_KCSEL_6_8, + TEV_KCSEL_1_2 = TEV_KCSEL_4_8, + TEV_KCSEL_1_4 = TEV_KCSEL_2_8, + + TEV_KCSEL_K0 = 0x0C, + TEV_KCSEL_K1 = 0x0D, + TEV_KCSEL_K2 = 0x0E, + TEV_KCSEL_K3 = 0x0F, + TEV_KCSEL_K0_R = 0x10, + TEV_KCSEL_K1_R = 0x11, + TEV_KCSEL_K2_R = 0x12, + TEV_KCSEL_K3_R = 0x13, + TEV_KCSEL_K0_G = 0x14, + TEV_KCSEL_K1_G = 0x15, + TEV_KCSEL_K2_G = 0x16, + TEV_KCSEL_K3_G = 0x17, + TEV_KCSEL_K0_B = 0x18, + TEV_KCSEL_K1_B = 0x19, + TEV_KCSEL_K2_B = 0x1A, + TEV_KCSEL_K3_B = 0x1B, + TEV_KCSEL_K0_A = 0x1C, + TEV_KCSEL_K1_A = 0x1D, + TEV_KCSEL_K2_A = 0x1E, + TEV_KCSEL_K3_A = 0x1F +}; + +enum TevKAlphaSel { + TEV_KASEL_8_8 = 0x00, + TEV_KASEL_7_8 = 0x01, + TEV_KASEL_6_8 = 0x02, + TEV_KASEL_5_8 = 0x03, + TEV_KASEL_4_8 = 0x04, + TEV_KASEL_3_8 = 0x05, + TEV_KASEL_2_8 = 0x06, + TEV_KASEL_1_8 = 0x07, + + TEV_KASEL_1 = TEV_KASEL_8_8, + TEV_KASEL_3_4 = TEV_KASEL_6_8, + TEV_KASEL_1_2 = TEV_KASEL_4_8, + TEV_KASEL_1_4 = TEV_KASEL_2_8, + + TEV_KASEL_K0_R = 0x10, + TEV_KASEL_K1_R = 0x11, + TEV_KASEL_K2_R = 0x12, + TEV_KASEL_K3_R = 0x13, + TEV_KASEL_K0_G = 0x14, + TEV_KASEL_K1_G = 0x15, + TEV_KASEL_K2_G = 0x16, + TEV_KASEL_K3_G = 0x17, + TEV_KASEL_K0_B = 0x18, + TEV_KASEL_K1_B = 0x19, + TEV_KASEL_K2_B = 0x1A, + TEV_KASEL_K3_B = 0x1B, + TEV_KASEL_K0_A = 0x1C, + TEV_KASEL_K1_A = 0x1D, + TEV_KASEL_K2_A = 0x1E, + TEV_KASEL_K3_A = 0x1F +}; + +enum TevOp { + TEV_ADD = 0, + TEV_SUB = 1, + TEV_COMP_R8_GT = 8, + TEV_COMP_R8_EQ = 9, + TEV_COMP_GR16_GT = 10, + TEV_COMP_GR16_EQ = 11, + TEV_COMP_BGR24_GT = 12, + TEV_COMP_BGR24_EQ = 13, + TEV_COMP_RGB8_GT = 14, + TEV_COMP_RGB8_EQ = 15, + TEV_COMP_A8_GT = TEV_COMP_RGB8_GT, + TEV_COMP_A8_EQ = TEV_COMP_RGB8_EQ +}; + +enum TevBias { + TB_ZERO = 0, + TB_ADDHALF = 1, + TB_SUBHALF = 2, +}; + +enum TevScale { CS_SCALE_1 = 0, CS_SCALE_2 = 1, CS_SCALE_4 = 2, CS_DIVIDE_2 = 3 }; + +enum TexGenType { + TG_MTX3x4 = 0, + TG_MTX2x4, + TG_BUMP0, + TG_BUMP1, + TG_BUMP2, + TG_BUMP3, + TG_BUMP4, + TG_BUMP5, + TG_BUMP6, + TG_BUMP7, + TG_SRTG +}; + +enum TexGenSrc { + TG_POS = 0, + TG_NRM, + TG_BINRM, + TG_TANGENT, + TG_TEX0, + TG_TEX1, + TG_TEX2, + TG_TEX3, + TG_TEX4, + TG_TEX5, + TG_TEX6, + TG_TEX7, + TG_TEXCOORD0, + TG_TEXCOORD1, + TG_TEXCOORD2, + TG_TEXCOORD3, + TG_TEXCOORD4, + TG_TEXCOORD5, + TG_TEXCOORD6, + TG_COLOR0, + TG_COLOR1 +}; + +enum TexMtx { + TEXMTX0 = 30, + TEXMTX1 = 33, + TEXMTX2 = 36, + TEXMTX3 = 39, + TEXMTX4 = 42, + TEXMTX5 = 45, + TEXMTX6 = 48, + TEXMTX7 = 51, + TEXMTX8 = 54, + TEXMTX9 = 57, + IDENTITY = 60 +}; + +enum PTTexMtx { + PTTEXMTX0 = 64, + PTTEXMTX1 = 67, + PTTEXMTX2 = 70, + PTTEXMTX3 = 73, + PTTEXMTX4 = 76, + PTTEXMTX5 = 79, + PTTEXMTX6 = 82, + PTTEXMTX7 = 85, + PTTEXMTX8 = 88, + PTTEXMTX9 = 91, + PTTEXMTX10 = 94, + PTTEXMTX11 = 97, + PTTEXMTX12 = 100, + PTTEXMTX13 = 103, + PTTEXMTX14 = 106, + PTTEXMTX15 = 109, + PTTEXMTX16 = 112, + PTTEXMTX17 = 115, + PTTEXMTX18 = 118, + PTTEXMTX19 = 121, + PTIDENTITY = 125 +}; + +enum TevRegID { TEVPREV = 0, TEVREG0 = 1, TEVREG1 = 2, TEVREG2 = 3, TEVLAZY = 5 }; + +enum DiffuseFn { DF_NONE = 0, DF_SIGN, DF_CLAMP }; + +enum AttnFn { AF_SPEC = 0, AF_SPOT = 1, AF_NONE }; + +enum Primitive { + POINTS = 0xb8, + LINES = 0xa8, + LINESTRIP = 0xb0, + TRIANGLES = 0x90, + TRIANGLESTRIP = 0x98, + TRIANGLEFAN = 0xa0, + QUADS = 0x80 +}; + +enum ChannelID { + GX_COLOR0, + GX_COLOR1, + GX_ALPHA0, + GX_ALPHA1, + GX_COLOR0A0, + GX_COLOR1A1, + GX_COLOR_ZERO, + GX_ALPHA_BUMP, + GX_ALPHA_BUMPN, + GX_COLOR_NULL = 0xff +}; + +enum BlendFactor : uint16_t { + BL_ZERO, + BL_ONE, + BL_SRCCLR, + BL_INVSRCCLR, + BL_SRCALPHA, + BL_INVSRCALPHA, + BL_DSTALPHA, + BL_INVDSTALPHA +}; + +//struct Color : athena::io::DNA { +// union { +// uint8_t color[4]; +// uint32_t num = 0; +// }; +// Color() = default; +// Color& operator=(const atVec4f& vec) { +// athena::simd_floats f(vec.simd); +// color[0] = uint8_t(std::min(std::max(f[0] * 255.f, 0.f), 255.f)); +// color[1] = uint8_t(std::min(std::max(f[1] * 255.f, 0.f), 255.f)); +// color[2] = uint8_t(std::min(std::max(f[2] * 255.f, 0.f), 255.f)); +// color[3] = uint8_t(std::min(std::max(f[3] * 255.f, 0.f), 255.f)); +// return *this; +// } +// Color& operator=(const atVec3f& vec) { +// athena::simd_floats f(vec.simd); +// color[0] = uint8_t(std::min(std::max(f[0] * 255.f, 0.f), 255.f)); +// color[1] = uint8_t(std::min(std::max(f[1] * 255.f, 0.f), 255.f)); +// color[2] = uint8_t(std::min(std::max(f[2] * 255.f, 0.f), 255.f)); +// color[3] = 0xff; +// return *this; +// } +// Color& operator=(uint8_t val) { +// color[0] = val; +// color[1] = val; +// color[2] = val; +// color[3] = val; +// return *this; +// } +// atVec4f toVec4f() const { +// atVec4f out; +// athena::simd_floats f; +// f[0] = color[0] / 255.f; +// f[1] = color[1] / 255.f; +// f[2] = color[2] / 255.f; +// f[3] = color[3] / 255.f; +// out.simd.copy_from(f); +// return out; +// } +// Color(const atVec4f& vec) { *this = vec; } +// Color(const atVec3f& vec) { *this = vec; } +// Color(uint8_t val) { *this = val; } +// bool operator==(const Color& other) const { return num == other.num; } +// bool operator!=(const Color& other) const { return num != other.num; } +// uint8_t operator[](size_t idx) const { return color[idx]; } +// uint8_t& operator[](size_t idx) { return color[idx]; } +// AT_DECL_EXPLICIT_DNA +//}; + +} // namespace GX diff --git a/Runtime/Graphics/Shaders/CModelShaders.cpp b/Runtime/Graphics/Shaders/CModelShaders.cpp index 2fc2e2a16..b1d44a829 100644 --- a/Runtime/Graphics/Shaders/CModelShaders.cpp +++ b/Runtime/Graphics/Shaders/CModelShaders.cpp @@ -3,7 +3,7 @@ #include "Runtime/CStopwatch.hpp" #include "Runtime/Graphics/CLight.hpp" -#include +//#include //#include namespace metaforce { @@ -59,26 +59,26 @@ void CModelShaders::LightingUniform::ActivateLights(const std::vector& l } } -using TexCoordSource = hecl::Backend::TexCoordSource; - -constexpr std::array ThermalTextures{{ - {TexCoordSource::Normal, 7, true}, -}}; - -constexpr std::array BallFadeTextures{{ - {TexCoordSource::Position, 0, false}, // ID tex - {TexCoordSource::Position, 0, false}, // Sphere ramp - {TexCoordSource::Position, 1, false}, // TXTR_BallFade -}}; - -constexpr std::array WorldShadowTextures{{ - {TexCoordSource::Position, 7, false}, // Shadow tex -}}; - -constexpr std::array DisintegrateTextures{{ - {TexCoordSource::Position, 0, false}, // Ashy tex - {TexCoordSource::Position, 1, false}, // Ashy tex -}}; +//using TexCoordSource = hecl::Backend::TexCoordSource; +// +//constexpr std::array ThermalTextures{{ +// {TexCoordSource::Normal, 7, true}, +//}}; +// +//constexpr std::array BallFadeTextures{{ +// {TexCoordSource::Position, 0, false}, // ID tex +// {TexCoordSource::Position, 0, false}, // Sphere ramp +// {TexCoordSource::Position, 1, false}, // TXTR_BallFade +//}}; +// +//constexpr std::array WorldShadowTextures{{ +// {TexCoordSource::Position, 7, false}, // Shadow tex +//}}; +// +//constexpr std::array DisintegrateTextures{{ +// {TexCoordSource::Position, 0, false}, // Ashy tex +// {TexCoordSource::Position, 1, false}, // Ashy tex +//}}; //static std::array g_ExtensionSlots{{ // /* Default solid shading */ diff --git a/Runtime/GuiSys/CAuiEnergyBarT01.cpp b/Runtime/GuiSys/CAuiEnergyBarT01.cpp index e01285c93..10e474b98 100644 --- a/Runtime/GuiSys/CAuiEnergyBarT01.cpp +++ b/Runtime/GuiSys/CAuiEnergyBarT01.cpp @@ -142,7 +142,7 @@ void CAuiEnergyBarT01::SetMaxEnergy(float maxEnergy) { std::shared_ptr CAuiEnergyBarT01::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - CAssetId tex = in.readUint32Big(); + CAssetId tex = in.Get(); std::shared_ptr ret = std::make_shared(parms, sp, tex); ret->ParseBaseInfo(frame, in, parms); return ret; diff --git a/Runtime/GuiSys/CAuiImagePane.cpp b/Runtime/GuiSys/CAuiImagePane.cpp index 5c86d1bc7..f823d1846 100644 --- a/Runtime/GuiSys/CAuiImagePane.cpp +++ b/Runtime/GuiSys/CAuiImagePane.cpp @@ -17,19 +17,19 @@ CAuiImagePane::CAuiImagePane(const CGuiWidgetParms& parms, CSimplePool* sp, CAss std::shared_ptr CAuiImagePane::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - in.readUint32Big(); - in.readUint32Big(); - in.readUint32Big(); - u32 coordCount = in.readUint32Big(); + in.ReadLong(); + in.ReadLong(); + in.ReadLong(); + u32 coordCount = in.ReadLong(); rstl::reserved_vector coords; for (u32 i = 0; i < coordCount; ++i) - coords.push_back(zeus::CVector3f::ReadBig(in)); - u32 uvCount = in.readUint32Big(); + coords.push_back(in.Get()); + u32 uvCount = in.ReadLong(); rstl::reserved_vector uvs; for (u32 i = 0; i < uvCount; ++i) - uvs.push_back(zeus::CVector2f::ReadBig(in)); + uvs.push_back(in.Get()); std::shared_ptr ret = - std::make_shared(parms, sp, -1, -1, std::move(coords), std::move(uvs), true); + std::make_shared(parms, sp, CAssetId(), CAssetId(), std::move(coords), std::move(uvs), true); ret->ParseBaseInfo(frame, in, parms); return ret; } diff --git a/Runtime/GuiSys/CAuiMeter.cpp b/Runtime/GuiSys/CAuiMeter.cpp index 5addf96dd..68e4c08d8 100644 --- a/Runtime/GuiSys/CAuiMeter.cpp +++ b/Runtime/GuiSys/CAuiMeter.cpp @@ -89,10 +89,10 @@ bool CAuiMeter::AddWorkerWidget(CGuiWidget* worker) { std::shared_ptr CAuiMeter::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - in.readBool(); - bool noRoundUp = in.readBool(); - u32 maxCapacity = in.readUint32Big(); - u32 workerCount = in.readUint32Big(); + in.ReadBool(); + bool noRoundUp = in.ReadBool(); + u32 maxCapacity = in.ReadLong(); + u32 workerCount = in.ReadLong(); std::shared_ptr ret = std::make_shared(parms, noRoundUp, maxCapacity, workerCount); ret->ParseBaseInfo(frame, in, parms); return ret; diff --git a/Runtime/GuiSys/CGuiCamera.cpp b/Runtime/GuiSys/CGuiCamera.cpp index b5ade0c7f..b173456df 100644 --- a/Runtime/GuiSys/CGuiCamera.cpp +++ b/Runtime/GuiSys/CGuiCamera.cpp @@ -38,24 +38,24 @@ void CGuiCamera::Draw(const CGuiWidgetDrawParms& parms) { std::shared_ptr CGuiCamera::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - EProjection proj = EProjection(in.readUint32Big()); + EProjection proj = EProjection(in.ReadLong()); std::shared_ptr ret = {}; switch (proj) { case EProjection::Perspective: { - float fov = in.readFloatBig(); - float aspect = in.readFloatBig(); - float znear = in.readFloatBig(); - float zfar = in.readFloatBig(); + float fov = in.ReadFloat(); + float aspect = in.ReadFloat(); + float znear = in.ReadFloat(); + float zfar = in.ReadFloat(); ret = std::make_shared(parms, fov, aspect, znear, zfar); break; } case EProjection::Orthographic: { - float left = in.readFloatBig(); - float right = in.readFloatBig(); - float top = in.readFloatBig(); - float bottom = in.readFloatBig(); - float znear = in.readFloatBig(); - float zfar = in.readFloatBig(); + float left = in.ReadFloat(); + float right = in.ReadFloat(); + float top = in.ReadFloat(); + float bottom = in.ReadFloat(); + float znear = in.ReadFloat(); + float zfar = in.ReadFloat(); ret = std::make_shared(parms, left, right, top, bottom, znear, zfar); break; } diff --git a/Runtime/GuiSys/CGuiFrame.cpp b/Runtime/GuiSys/CGuiFrame.cpp index fb93c4887..a74136f40 100644 --- a/Runtime/GuiSys/CGuiFrame.cpp +++ b/Runtime/GuiSys/CGuiFrame.cpp @@ -164,11 +164,11 @@ void CGuiFrame::Initialize() { } void CGuiFrame::LoadWidgetsInGame(CInputStream& in, CSimplePool* sp) { - u32 count = in.readUint32Big(); + u32 count = in.ReadLong(); x2c_widgets.reserve(count); for (u32 i = 0; i < count; ++i) { - DataSpec::DNAFourCC type; - type.read(in); + FourCC type; + in.Get(reinterpret_cast(&type), 4); std::shared_ptr widget = CGuiSys::CreateWidgetInGame(type.toUint32(), in, this, sp); switch (widget->GetWidgetTypeID().toUint32()) { case SBIG('CAMR'): @@ -216,7 +216,7 @@ bool CGuiFrame::ProcessMouseInput(const CFinalInput& input, const CGuiWidgetDraw m_lastMouseOverWidget = hit; } if (hit && hit->m_lastScroll) { - boo::SScrollDelta delta = kbm->m_accumScroll - *hit->m_lastScroll; + SScrollDelta delta = kbm->m_accumScroll - *hit->m_lastScroll; hit->m_lastScroll.emplace(kbm->m_accumScroll); if (!delta.isZero()) { hit->m_integerScroll += delta; @@ -226,7 +226,7 @@ bool CGuiFrame::ProcessMouseInput(const CFinalInput& input, const CGuiWidgetDraw hit->m_integerScroll.delta[1] -= std::trunc(hit->m_integerScroll.delta[1]); } } - if (!m_inMouseDown && kbm->m_mouseButtons[size_t(boo::EMouseButton::Primary)]) { + if (!m_inMouseDown && kbm->m_mouseButtons[size_t(EMouseButton::Primary)]) { m_inMouseDown = true; m_inCancel = false; m_mouseDownWidget = hit; @@ -234,7 +234,7 @@ bool CGuiFrame::ProcessMouseInput(const CFinalInput& input, const CGuiWidgetDraw m_mouseDownCb(hit, false); if (hit) return true; - } else if (m_inMouseDown && !kbm->m_mouseButtons[size_t(boo::EMouseButton::Primary)]) { + } else if (m_inMouseDown && !kbm->m_mouseButtons[size_t(EMouseButton::Primary)]) { m_inMouseDown = false; m_inCancel = false; if (m_mouseDownWidget == m_lastMouseOverWidget) { @@ -263,10 +263,10 @@ void CGuiFrame::ResetMouseState() { } std::unique_ptr CGuiFrame::CreateFrame(CAssetId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp) { - in.readInt32Big(); - int a = in.readInt32Big(); - int b = in.readInt32Big(); - int c = in.readInt32Big(); + in.ReadLong(); + int a = in.ReadLong(); + int b = in.ReadLong(); + int c = in.ReadLong(); std::unique_ptr ret = std::make_unique(frmeId, sys, a, b, c, sp); ret->LoadWidgetsInGame(in, sp); diff --git a/Runtime/GuiSys/CGuiFrame.hpp b/Runtime/GuiSys/CGuiFrame.hpp index 12c32bce7..eca6e83f7 100644 --- a/Runtime/GuiSys/CGuiFrame.hpp +++ b/Runtime/GuiSys/CGuiFrame.hpp @@ -10,8 +10,6 @@ #include "Runtime/GuiSys/CGuiWidgetIdDB.hpp" #include "Runtime/GuiSys/CGuiWidget.hpp" -#include - namespace metaforce { class CBooModel; class CGuiCamera; @@ -54,7 +52,7 @@ private: std::function m_mouseOverChangeCb; std::function m_mouseDownCb; std::function m_mouseUpCb; - std::function m_mouseScrollCb; + std::function m_mouseScrollCb; public: CGuiFrame(CAssetId id, CGuiSys& sys, int a, int b, int c, CSimplePool* sp); @@ -87,7 +85,7 @@ public: } void SetMouseDownCallback(std::function&& cb) { m_mouseDownCb = std::move(cb); } void SetMouseUpCallback(std::function&& cb) { m_mouseUpCb = std::move(cb); } - void SetMouseScrollCallback(std::function&& cb) { + void SetMouseScrollCallback(std::function&& cb) { m_mouseScrollCb = std::move(cb); } diff --git a/Runtime/GuiSys/CGuiGroup.cpp b/Runtime/GuiSys/CGuiGroup.cpp index 105387c3d..ac8e31d8a 100644 --- a/Runtime/GuiSys/CGuiGroup.cpp +++ b/Runtime/GuiSys/CGuiGroup.cpp @@ -43,8 +43,8 @@ void CGuiGroup::OnActiveChange() { std::shared_ptr CGuiGroup::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - s16 defaultWorker = in.readInt16Big(); - bool b = in.readBool(); + s16 defaultWorker = in.ReadInt16(); + bool b = in.ReadBool(); std::shared_ptr ret = std::make_shared(parms, defaultWorker, b); ret->ParseBaseInfo(frame, in, parms); return ret; diff --git a/Runtime/GuiSys/CGuiLight.cpp b/Runtime/GuiSys/CGuiLight.cpp index c65166b55..d326f027e 100644 --- a/Runtime/GuiSys/CGuiLight.cpp +++ b/Runtime/GuiSys/CGuiLight.cpp @@ -50,19 +50,19 @@ void CGuiLight::SetIsVisible(bool vis) { std::shared_ptr CGuiLight::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - ELightType tp = ELightType(in.readUint32Big()); - float distC = in.readFloatBig(); - float distL = in.readFloatBig(); - float distQ = in.readFloatBig(); - float angC = in.readFloatBig(); - float angL = in.readFloatBig(); - float angQ = in.readFloatBig(); - u32 lightId = in.readUint32Big(); + ELightType tp = ELightType(in.ReadLong()); + float distC = in.ReadFloat(); + float distL = in.ReadFloat(); + float distQ = in.ReadFloat(); + float angC = in.ReadFloat(); + float angL = in.ReadFloat(); + float angQ = in.ReadFloat(); + u32 lightId = in.ReadLong(); std::shared_ptr ret = {}; switch (tp) { case ELightType::Spot: { - float cutoff = in.readFloatBig(); + float cutoff = in.ReadFloat(); CLight lt = CLight::BuildSpot(zeus::skZero3f, zeus::skZero3f, parms.x10_color, cutoff); lt.SetAttenuation(distC, distL, distQ); lt.SetAngleAttenuation(angC, angL, angQ); diff --git a/Runtime/GuiSys/CGuiModel.cpp b/Runtime/GuiSys/CGuiModel.cpp index a397356bf..a2b67640e 100644 --- a/Runtime/GuiSys/CGuiModel.cpp +++ b/Runtime/GuiSys/CGuiModel.cpp @@ -123,9 +123,9 @@ bool CGuiModel::TestCursorHit(const zeus::CMatrix4f& vp, const zeus::CVector2f& std::shared_ptr CGuiModel::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - CAssetId model = in.readUint32Big(); - in.readUint32Big(); - u32 lightMask = in.readUint32Big(); + CAssetId model = in.Get(); + in.ReadLong(); + u32 lightMask = in.ReadLong(); std::shared_ptr ret = std::make_shared(parms, sp, model, lightMask, true); ret->ParseBaseInfo(frame, in, parms); diff --git a/Runtime/GuiSys/CGuiPane.cpp b/Runtime/GuiSys/CGuiPane.cpp index 09b683af7..446d78002 100644 --- a/Runtime/GuiSys/CGuiPane.cpp +++ b/Runtime/GuiSys/CGuiPane.cpp @@ -54,8 +54,8 @@ void CGuiPane::WriteData(COutputStream& out, bool flag) const {} std::shared_ptr CGuiPane::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - zeus::CVector2f dim = zeus::CVector2f::ReadBig(in); - zeus::CVector3f scaleCenter = zeus::CVector3f::ReadBig(in); + zeus::CVector2f dim = in.Get(); + zeus::CVector3f scaleCenter = in.Get(); std::shared_ptr ret = std::make_shared(parms, dim, scaleCenter); ret->ParseBaseInfo(frame, in, parms); return ret; diff --git a/Runtime/GuiSys/CGuiSliderGroup.cpp b/Runtime/GuiSys/CGuiSliderGroup.cpp index df7aef83c..19893e594 100644 --- a/Runtime/GuiSys/CGuiSliderGroup.cpp +++ b/Runtime/GuiSys/CGuiSliderGroup.cpp @@ -67,9 +67,9 @@ bool CGuiSliderGroup::TestCursorHit(const zeus::CMatrix4f& vp, const zeus::CVect } void CGuiSliderGroup::ProcessUserInput(const CFinalInput& input) { - if (input.DMouseButton(boo::EMouseButton::Primary) && m_mouseInside) + if (input.DMouseButton(EMouseButton::Primary) && m_mouseInside) m_mouseDown = true; - else if (!input.DMouseButton(boo::EMouseButton::Primary)) + else if (!input.DMouseButton(EMouseButton::Primary)) m_mouseDown = false; if (input.DLALeft()) { StartDecreasing(); @@ -158,10 +158,10 @@ CGuiWidget* CGuiSliderGroup::GetWorkerWidget(int id) const { std::shared_ptr CGuiSliderGroup::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - float min = in.readFloatBig(); - float max = in.readFloatBig(); - float cur = in.readFloatBig(); - float increment = in.readFloatBig(); + float min = in.ReadFloat(); + float max = in.ReadFloat(); + float cur = in.ReadFloat(); + float increment = in.ReadFloat(); std::shared_ptr ret = std::make_shared(parms, min, max, cur, increment); ret->ParseBaseInfo(frame, in, parms); diff --git a/Runtime/GuiSys/CGuiSys.hpp b/Runtime/GuiSys/CGuiSys.hpp index 5ce5036d8..d14e50246 100644 --- a/Runtime/GuiSys/CGuiSys.hpp +++ b/Runtime/GuiSys/CGuiSys.hpp @@ -5,11 +5,9 @@ #include #include -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/GuiSys/CSaveableState.hpp" -#include - namespace metaforce { class CGuiFrame; class CGuiObject; diff --git a/Runtime/GuiSys/CGuiTableGroup.cpp b/Runtime/GuiSys/CGuiTableGroup.cpp index 671188df9..d35d0626b 100644 --- a/Runtime/GuiSys/CGuiTableGroup.cpp +++ b/Runtime/GuiSys/CGuiTableGroup.cpp @@ -32,9 +32,9 @@ CGuiTableGroup::CGuiTableGroup(const CGuiWidgetParms& parms, int elementCount, i , xd0_selectWraparound(selectWraparound) {} void CGuiTableGroup::ProcessUserInput(const CFinalInput& input) { - if (input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter)) { + if (input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter)) { DoAdvance(); - } else if (input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc)) { + } else if (input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc)) { DoCancel(); } else { bool decrement; @@ -207,21 +207,21 @@ void CGuiTableGroup::DoIncrement() { std::shared_ptr CGuiTableGroup::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - int elementCount = in.readInt16Big(); - in.readInt16Big(); - in.readUint32Big(); - int defaultSel = in.readInt16Big(); - in.readInt16Big(); - bool selectWraparound = in.readBool(); - in.readBool(); - in.readFloatBig(); - in.readFloatBig(); - in.readBool(); - in.readFloatBig(); - in.readInt16Big(); - in.readInt16Big(); - in.readInt16Big(); - in.readInt16Big(); + int elementCount = in.ReadInt16(); + in.ReadInt16(); + in.ReadLong(); + int defaultSel = in.ReadInt16(); + in.ReadInt16(); + bool selectWraparound = in.ReadBool(); + in.ReadBool(); + in.ReadFloat(); + in.ReadFloat(); + in.ReadBool(); + in.ReadFloat(); + in.ReadInt16(); + in.ReadInt16(); + in.ReadInt16(); + in.ReadInt16(); std::shared_ptr ret = std::make_shared(parms, elementCount, defaultSel, selectWraparound); ret->ParseBaseInfo(frame, in, parms); diff --git a/Runtime/GuiSys/CGuiTextPane.cpp b/Runtime/GuiSys/CGuiTextPane.cpp index 4a5c6ebaa..9667c6395 100644 --- a/Runtime/GuiSys/CGuiTextPane.cpp +++ b/Runtime/GuiSys/CGuiTextPane.cpp @@ -135,20 +135,18 @@ bool CGuiTextPane::TestCursorHit(const zeus::CMatrix4f& vp, const zeus::CVector2 std::shared_ptr CGuiTextPane::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) { const CGuiWidgetParms parms = ReadWidgetHeader(frame, in); - const zeus::CVector2f dim = zeus::CVector2f::ReadBig(in); - const zeus::CVector3f vec = zeus::CVector3f::ReadBig(in); - const u32 fontId = in.readUint32Big(); - const bool wordWrap = in.readBool(); - const bool horizontal = in.readBool(); - const auto justification = EJustification(in.readUint32Big()); - const auto vJustification = EVerticalJustification(in.readUint32Big()); + const zeus::CVector2f dim = in.Get(); + const zeus::CVector3f vec = in.Get(); + const CAssetId fontId = in.Get(); + const bool wordWrap = in.ReadBool(); + const bool horizontal = in.ReadBool(); + const auto justification = EJustification(in.ReadLong()); + const auto vJustification = EVerticalJustification(in.ReadLong()); const CGuiTextProperties props(wordWrap, horizontal, justification, vJustification); - zeus::CColor fontCol; - fontCol.readRGBABig(in); - zeus::CColor outlineCol; - outlineCol.readRGBABig(in); - const int extentX = static_cast(in.readFloatBig()); - const int extentY = static_cast(in.readFloatBig()); + const zeus::CColor fontCol = in.Get(); + const zeus::CColor outlineCol = in.Get(); + const int extentX = static_cast(in.ReadFloat()); + const int extentY = static_cast(in.ReadFloat()); auto ret = std::make_shared(parms, sp, dim, vec, fontId, props, fontCol, outlineCol, extentX, extentY); ret->ParseBaseInfo(frame, in, parms); ret->InitializeBuffers(); diff --git a/Runtime/GuiSys/CGuiTextSupport.cpp b/Runtime/GuiSys/CGuiTextSupport.cpp index e72cc7a93..7013e1b94 100644 --- a/Runtime/GuiSys/CGuiTextSupport.cpp +++ b/Runtime/GuiSys/CGuiTextSupport.cpp @@ -10,6 +10,7 @@ #include "Runtime/GuiSys/CRasterFont.hpp" #include "Runtime/GuiSys/CTextExecuteBuffer.hpp" #include "Runtime/GuiSys/CTextParser.hpp" +#include "Runtime/CStringExtras.hpp" namespace metaforce { @@ -271,7 +272,9 @@ void CGuiTextSupport::SetText(std::u16string_view str, bool multipage) { x304_pageCounter = 0; } -void CGuiTextSupport::SetText(std::string_view str, bool multipage) { SetText(hecl::UTF8ToChar16(str), multipage); } +void CGuiTextSupport::SetText(std::string_view str, bool multipage) { + SetText(CStringExtras::ConvertToUNICODE(str), multipage); +} bool CGuiTextSupport::_GetIsTextSupportFinishedLoading() { for (CToken& tok : x2bc_assets) { diff --git a/Runtime/GuiSys/CGuiWidget.cpp b/Runtime/GuiSys/CGuiWidget.cpp index 775be6e3b..b13a9d33e 100644 --- a/Runtime/GuiSys/CGuiWidget.cpp +++ b/Runtime/GuiSys/CGuiWidget.cpp @@ -24,18 +24,17 @@ CGuiWidget::CGuiWidget(const CGuiWidgetParms& parms) } CGuiWidget::CGuiWidgetParms CGuiWidget::ReadWidgetHeader(CGuiFrame* frame, CInputStream& in) { - std::string name = in.readString(-1); + std::string name = in.Get(); s16 selfId = frame->GetWidgetIdDB().AddWidget(name); - std::string parent = in.readString(-1); + std::string parent = in.Get(); s16 parentId = frame->GetWidgetIdDB().AddWidget(parent); - bool useAnimController = in.readBool(); - bool defaultVis = in.readBool(); - bool defaultActive = in.readBool(); - bool cullFaces = in.readBool(); - zeus::CColor color; - color.readRGBABig(in); - EGuiModelDrawFlags df = EGuiModelDrawFlags(in.readUint32Big()); + bool useAnimController = in.ReadBool(); + bool defaultVis = in.ReadBool(); + bool defaultActive = in.ReadBool(); + bool cullFaces = in.ReadBool(); + zeus::CColor color = in.Get(); + EGuiModelDrawFlags df = EGuiModelDrawFlags(in.ReadLong()); return CGuiWidget::CGuiWidgetParms(frame, useAnimController, selfId, parentId, defaultVis, defaultActive, cullFaces, color, df, true, false, std::move(name)); @@ -52,17 +51,17 @@ void CGuiWidget::Initialize() {} void CGuiWidget::ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms) { CGuiWidget* parent = frame->FindWidget(parms.x8_parentId); - bool isWorker = in.readBool(); + bool isWorker = in.ReadBool(); if (isWorker) - xb4_workerId = in.readInt16Big(); - zeus::CVector3f trans = zeus::CVector3f::ReadBig(in); - zeus::CMatrix3f orient = zeus::CMatrix3f::ReadBig(in); + xb4_workerId = in.ReadInt16(); + zeus::CVector3f trans = in.Get(); + zeus::CMatrix3f orient = in.Get(); x74_transform = zeus::CTransform(orient, trans); m_initTransform = x74_transform; ReapplyXform(); - (void)zeus::CVector3f::ReadBig(in); // Unused - in.readUint32Big(); - in.readUint16Big(); + in.Get(); // Unused + in.ReadLong(); + in.ReadShort(); if (isWorker) { if (!parent->AddWorkerWidget(this)) { Log.report(logvisor::Warning, diff --git a/Runtime/GuiSys/CGuiWidget.hpp b/Runtime/GuiSys/CGuiWidget.hpp index add4c810a..f7e07e812 100644 --- a/Runtime/GuiSys/CGuiWidget.hpp +++ b/Runtime/GuiSys/CGuiWidget.hpp @@ -5,10 +5,9 @@ #include #include "Runtime/GCNTypes.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/GuiSys/CGuiObject.hpp" - -#include +#include "Runtime/Input/CKeyboardMouseController.hpp" #include #include @@ -84,8 +83,8 @@ protected: bool xb7_25_ : 1 = true; bool m_mouseActive : 1 = false; - std::optional m_lastScroll; - boo::SScrollDelta m_integerScroll; + std::optional m_lastScroll; + SScrollDelta m_integerScroll; std::string m_name; diff --git a/Runtime/GuiSys/CHudEnergyInterface.cpp b/Runtime/GuiSys/CHudEnergyInterface.cpp index abfeab6bd..f1587be8f 100644 --- a/Runtime/GuiSys/CHudEnergyInterface.cpp +++ b/Runtime/GuiSys/CHudEnergyInterface.cpp @@ -37,8 +37,8 @@ CHudEnergyInterface::CHudEnergyInterface(CGuiFrame& selHud, float tankEnergy, in x2c_energybart01_energybar->SetCoordFunc(CoordFuncs[size_t(hudType)]); x2c_energybart01_energybar->SetTesselation(Tesselations[size_t(hudType)]); - ITweakGuiColors::VisorEnergyBarColors barColors = g_tweakGuiColors->GetVisorEnergyBarColors(int(hudType)); - ITweakGuiColors::VisorEnergyInitColors initColors = g_tweakGuiColors->GetVisorEnergyInitColors(int(hudType)); + ITweakGuiColors::SVisorEnergyBarColors barColors = g_tweakGuiColors->GetVisorEnergyBarColors(int(hudType)); + ITweakGuiColors::SVisorEnergyInitColors initColors = g_tweakGuiColors->GetVisorEnergyInitColors(int(hudType)); x20_textpane_energydigits->TextSupport().SetFontColor(initColors.digitsFont); x20_textpane_energydigits->TextSupport().SetOutlineColor(initColors.digitsOutline); @@ -100,7 +100,7 @@ void CHudEnergyInterface::Update(float dt, float energyLowPulse) { x20_textpane_energydigits->TextSupport().SetText(string); } - ITweakGuiColors::VisorEnergyBarColors barColors = g_tweakGuiColors->GetVisorEnergyBarColors(int(x0_hudType)); + ITweakGuiColors::SVisorEnergyBarColors barColors = g_tweakGuiColors->GetVisorEnergyBarColors(int(x0_hudType)); zeus::CColor emptyColor = x1c_27_energyLow ? g_tweakGuiColors->GetEnergyBarEmptyLowEnergy() : barColors.empty; zeus::CColor filledColor = x1c_27_energyLow ? g_tweakGuiColors->GetEnergyBarFilledLowEnergy() : barColors.filled; zeus::CColor shadowColor = x1c_27_energyLow ? g_tweakGuiColors->GetEnergyBarShadowLowEnergy() : barColors.shadow; diff --git a/Runtime/GuiSys/CRasterFont.cpp b/Runtime/GuiSys/CRasterFont.cpp index 53e1d46b4..e04114745 100644 --- a/Runtime/GuiSys/CRasterFont.cpp +++ b/Runtime/GuiSys/CRasterFont.cpp @@ -10,61 +10,61 @@ namespace metaforce { CRasterFont::CRasterFont(metaforce::CInputStream& in, metaforce::IObjectStore& store) { u32 magic = 0; - in.readBytesToBuf(&magic, 4); + in.Get(reinterpret_cast(&magic), 4); if (magic != SBIG('FONT')) return; - u32 version = in.readUint32Big(); - x4_monoWidth = in.readUint32Big(); - x8_monoHeight = in.readUint32Big(); + u32 version = in.ReadLong(); + x4_monoWidth = in.ReadLong(); + x8_monoHeight = in.ReadLong(); if (version >= 1) - x8c_baseline = in.readUint32Big(); + x8c_baseline = in.ReadLong(); else x8c_baseline = x8_monoHeight; if (version >= 2) - x90_lineMargin = in.readUint32Big(); + x90_lineMargin = in.ReadLong(); - bool tmp1 = in.readBool(); - bool tmp2 = in.readBool(); + bool tmp1 = in.ReadBool(); + bool tmp2 = in.ReadBool(); - u32 tmp3 = in.readUint32Big(); - u32 tmp4 = in.readUint32Big(); - std::string name = in.readString(); - u32 txtrId = (version == 5 ? in.readUint64Big() : in.readUint32Big()); + u32 tmp3 = in.ReadLong(); + u32 tmp4 = in.ReadLong(); + std::string name = in.Get(); + u32 txtrId = (version == 5 ? in.ReadLongLong() : in.ReadLong()); x30_fontInfo = CFontInfo(tmp1, tmp2, tmp3, tmp4, name.c_str()); x80_texture = store.GetObj({FOURCC('TXTR'), txtrId}); - x2c_mode = CTexture::EFontType(in.readUint32Big()); + x2c_mode = CTexture::EFontType(in.ReadLong()); - u32 glyphCount = in.readUint32Big(); + u32 glyphCount = in.ReadLong(); xc_glyphs.reserve(glyphCount); for (u32 i = 0; i < glyphCount; ++i) { - char16_t chr = in.readUint16Big(); - float startU = in.readFloatBig(); - float startV = in.readFloatBig(); - float endU = in.readFloatBig(); - float endV = in.readFloatBig(); + char16_t chr = in.ReadShort(); + float startU = in.ReadFloat(); + float startV = in.ReadFloat(); + float endU = in.ReadFloat(); + float endV = in.ReadFloat(); s32 layer = 0; s32 a, b, c, cellWidth, cellHeight, baseline, kernStart; if (version < 4) { - a = in.readInt32Big(); - b = in.readInt32Big(); - c = in.readInt32Big(); - cellWidth = in.readInt32Big(); - cellHeight = in.readInt32Big(); - baseline = in.readInt32Big(); - kernStart = in.readInt32Big(); + a = in.ReadInt32(); + b = in.ReadInt32(); + c = in.ReadInt32(); + cellWidth = in.ReadInt32(); + cellHeight = in.ReadInt32(); + baseline = in.ReadInt32(); + kernStart = in.ReadInt32(); } else { - layer = in.readByte(); - a = in.readByte(); - b = in.readByte(); - c = in.readByte(); - cellWidth = in.readByte(); - cellHeight = in.readByte(); - baseline = in.readByte(); - kernStart = in.readInt16Big(); + layer = in.ReadInt8(); + a = in.ReadInt8(); + b = in.ReadInt8(); + c = in.ReadInt8(); + cellWidth = in.ReadInt8(); + cellHeight = in.ReadInt8(); + baseline = in.ReadInt8(); + kernStart = in.ReadInt16(); } xc_glyphs.emplace_back( chr, CGlyph(a, b, c, startU, startV, endU, endV, cellWidth, cellHeight, baseline, kernStart, layer)); @@ -72,13 +72,13 @@ CRasterFont::CRasterFont(metaforce::CInputStream& in, metaforce::IObjectStore& s std::sort(xc_glyphs.begin(), xc_glyphs.end(), [=](auto& a, auto& b) -> bool { return a.first < b.first; }); - u32 kernCount = in.readUint32Big(); + u32 kernCount = in.ReadLong(); x1c_kerning.reserve(kernCount); for (u32 i = 0; i < kernCount; ++i) { - char16_t first = in.readUint16Big(); - char16_t second = in.readUint16Big(); - s32 howMuch = in.readInt32Big(); + char16_t first = in.ReadShort(); + char16_t second = in.ReadShort(); + s32 howMuch = in.ReadInt32(); x1c_kerning.emplace_back(first, second, howMuch); } diff --git a/Runtime/GuiSys/CRasterFont.hpp b/Runtime/GuiSys/CRasterFont.hpp index 23c71fd32..cd848d533 100644 --- a/Runtime/GuiSys/CRasterFont.hpp +++ b/Runtime/GuiSys/CRasterFont.hpp @@ -6,7 +6,7 @@ #include "Runtime/CToken.hpp" #include "Runtime/GCNTypes.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/Graphics/CTexture.hpp" #include diff --git a/Runtime/GuiSys/CScanDisplay.cpp b/Runtime/GuiSys/CScanDisplay.cpp index 2be7f62c0..9a5c25547 100644 --- a/Runtime/GuiSys/CScanDisplay.cpp +++ b/Runtime/GuiSys/CScanDisplay.cpp @@ -82,7 +82,7 @@ void CScanDisplay::ProcessInput(const CFinalInput& input) { return; if (xc_state == EScanState::DownloadComplete && x1a4_xAlpha == 0.f) { - if (input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary)) { + if (input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary)) { if (xa8_message->TextSupport().GetCurTime() < xa8_message->TextSupport().GetTotalAnimationTime()) { xa8_message->TextSupport().SetCurTime(xa8_message->TextSupport().GetTotalAnimationTime()); } else { @@ -94,7 +94,7 @@ void CScanDisplay::ProcessInput(const CFinalInput& input) { } else if (xc_state == EScanState::ViewingScan) { int oldCounter = x1ac_pageCounter; int totalPages = xac_scrollMessage->TextSupport().GetTotalPageCount(); - if ((input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary)) && + if ((input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary)) && totalPages != -1) { CGuiTextSupport& supp = !x1ac_pageCounter ? xa8_message->TextSupport() : xac_scrollMessage->TextSupport(); if (supp.GetCurTime() < supp.GetTotalAnimationTime()) diff --git a/Runtime/GuiSys/CStringTable.cpp b/Runtime/GuiSys/CStringTable.cpp index c35914d73..8857670ba 100644 --- a/Runtime/GuiSys/CStringTable.cpp +++ b/Runtime/GuiSys/CStringTable.cpp @@ -1,9 +1,11 @@ #include "Runtime/GuiSys/CStringTable.hpp" -#include - +#include "Runtime/CBasics.hpp" +#include "Runtime/Streams/CInputStream.hpp" #include "Runtime/CToken.hpp" +#include + namespace metaforce { namespace { constexpr std::array languages{ @@ -16,14 +18,15 @@ FourCC CStringTable::mCurrentLanguage = languages[0]; CStringTable::CStringTable(CInputStream& in) { LoadStringTable(in); } void CStringTable::LoadStringTable(CInputStream& in) { - in.readUint32Big(); - in.readUint32Big(); - u32 langCount = in.readUint32Big(); - x0_stringCount = in.readUint32Big(); + in.ReadLong(); + in.ReadLong(); + u32 langCount = in.ReadLong(); + x0_stringCount = in.ReadLong(); std::vector> langOffsets; for (u32 i = 0; i < langCount; ++i) { - FourCC fcc(in.readUint32()); - u32 off = in.readUint32Big(); + FourCC fcc; + in.Get(reinterpret_cast(&fcc), 4); + u32 off = in.ReadLong(); langOffsets.emplace_back(fcc, off); } @@ -45,21 +48,26 @@ void CStringTable::LoadStringTable(CInputStream& in) { if (offset == UINT32_MAX) offset = langOffsets[0].second; - in.seek(offset); + for (u32 i = 0; i < offset; ++i) { + in.ReadChar(); + } - u32 dataLen = in.readUint32Big(); + u32 dataLen = in.ReadLong(); m_bufLen = dataLen; x4_data.reset(new u8[dataLen]); - in.readUBytesToBuf(x4_data.get(), dataLen); + in.Get(x4_data.get(), dataLen); +#if METAFORCE_TARGET_BYTE_ORDER == __ORDER_LITTLE_ENDIAN__ u32* off = reinterpret_cast(x4_data.get()); - for (u32 i = 0; i < x0_stringCount; ++i, ++off) - *off = SBig(*off); + for (u32 i = 0; i < x0_stringCount; ++i, ++off) { + *off = CBasics::SwapBytes(*off); + } for (u32 i = x0_stringCount * 4; i < dataLen; i += 2) { u16* chr = reinterpret_cast(x4_data.get() + i); - *chr = SBig(*chr); + *chr = CBasics::SwapBytes(*chr); } +#endif } const char16_t* CStringTable::GetString(s32 str) const { diff --git a/Runtime/GuiSys/CStringTable.hpp b/Runtime/GuiSys/CStringTable.hpp index d122958d3..d500270da 100644 --- a/Runtime/GuiSys/CStringTable.hpp +++ b/Runtime/GuiSys/CStringTable.hpp @@ -10,7 +10,7 @@ class CStringTable { static FourCC mCurrentLanguage; u32 x0_stringCount = 0; std::unique_ptr x4_data; - u32 m_bufLen; + u32 m_bufLen = 0; public: explicit CStringTable(CInputStream& in); diff --git a/Runtime/GuiSys/CTextRenderBuffer.hpp b/Runtime/GuiSys/CTextRenderBuffer.hpp index 8d24f6a3f..d624a6536 100644 --- a/Runtime/GuiSys/CTextRenderBuffer.hpp +++ b/Runtime/GuiSys/CTextRenderBuffer.hpp @@ -9,11 +9,6 @@ #include "Runtime/GuiSys/CFontImageDef.hpp" #include "Runtime/GuiSys/CGuiWidget.hpp" -//#include -// -//#include -//#include - #include #include #include diff --git a/Runtime/IMain.hpp b/Runtime/IMain.hpp index 3f99762b4..a56725873 100644 --- a/Runtime/IMain.hpp +++ b/Runtime/IMain.hpp @@ -1,22 +1,29 @@ #pragma once #include "Runtime/RetroTypes.hpp" - -#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp" #include "Runtime/CMainFlowBase.hpp" +#include "Runtime/ConsoleVariables/FileStoreManager.hpp" + #include #include -#include -#include - -namespace hecl { -class Console; -class CVarManager; -} // namespace hecl namespace metaforce { -using ERegion = DataSpec::ERegion; -using EGame = DataSpec::EGame; +class Console; +class CVarManager; +enum class ERegion { Invalid = -1, NTSC_U = 'E', PAL = 'P', NTSC_J = 'J' }; +enum class EGame { + Invalid = 0, + MetroidPrime1, + MetroidPrime2, + MetroidPrime3, +}; + +struct MetaforceVersionInfo { + std::string version; + ERegion region; + EGame game; + bool isTrilogy; +}; class CStopwatch; enum class EGameplayResult { None, Win, Lose, Playing }; @@ -24,7 +31,7 @@ enum class EGameplayResult { None, Win, Lose, Playing }; class IMain { public: virtual ~IMain() = default; - virtual void Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarManager* cvarMgr, + virtual void Init(const FileStoreManager& storeMgr, CVarManager* cvarMgr, boo::IAudioVoiceEngine* voiceEngine, amuse::IBackendVoiceAllocator& backend) = 0; virtual void Draw() = 0; virtual bool Proc(float dt) = 0; diff --git a/Runtime/IOStreams.cpp b/Runtime/IOStreams.cpp deleted file mode 100644 index da890cd47..000000000 --- a/Runtime/IOStreams.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "Runtime/IOStreams.hpp" -#include - -namespace metaforce { - -#define DUMP_BITS 0 - -#if DUMP_BITS -static void PrintBinary(u32 val, u32 count) { - for (u32 i = 0; i < count; ++i) { - fmt::print(FMT_STRING("{}"), (val >> (count - i - 1)) & 0x1); - } -} -#endif - -/*! - * \brief CBitStreamReader::ReadBit - * Reads and decodes an encoded value from a bitstream. - * \param bitCount How many bits to read - * \return s32 The encoded value - */ -s32 CBitStreamReader::ReadEncoded(u32 bitCount) { -#if DUMP_BITS - const auto pos = position(); - const auto boff = x20_bitOffset; -#endif - - u32 ret = 0; - const s32 shiftAmt = x20_bitOffset - s32(bitCount); - if (shiftAmt < 0) { - /* OR in remaining bits of cached value */ - u32 mask = bitCount == 32 ? UINT32_MAX : ((1U << bitCount) - 1); - ret |= (x1c_val << u32(-shiftAmt)) & mask; - - /* Load in exact number of bytes remaining */ - auto loadDiv = std::div(-shiftAmt, 8); - if (loadDiv.rem) - ++loadDiv.quot; - readUBytesToBuf(reinterpret_cast(&x1c_val) + 4 - loadDiv.quot, loadDiv.quot); - x1c_val = hecl::SBig(x1c_val); - - /* New bit offset */ - x20_bitOffset = loadDiv.quot * 8 + shiftAmt; - - /* OR in next bits */ - mask = (1U << u32(-shiftAmt)) - 1; - ret |= (x1c_val >> x20_bitOffset) & mask; - } else { - /* OR in bits of cached value */ - const u32 mask = bitCount == 32 ? UINT32_MAX : ((1U << bitCount) - 1); - ret |= (x1c_val >> u32(shiftAmt)) & mask; - - /* New bit offset */ - x20_bitOffset -= bitCount; - } - -#if DUMP_BITS - std::fputs("READ ", stdout); - PrintBinary(ret, bitCount); - fmt::print(FMT_STRING(" {} {}\n"), pos, boff); -#endif - - return ret; -} - -void CBitStreamWriter::WriteEncoded(u32 val, u32 bitCount) { -#if DUMP_BITS - std::fputs("WRITE ", stdout); - PrintBinary(val, bitCount); - fmt::print(FMT_STRING(" {} {}\n"), position(), x18_bitOffset); -#endif - - const s32 shiftAmt = x18_bitOffset - s32(bitCount); - if (shiftAmt < 0) { - /* OR remaining bits to cached value */ - const u32 mask = (1U << x18_bitOffset) - 1; - x14_val |= (val >> u32(-shiftAmt)) & mask; - - /* Write out 32-bits */ - x14_val = hecl::SBig(x14_val); - writeBytes(&x14_val, sizeof(x14_val)); - - /* Cache remaining bits */ - x18_bitOffset = 0x20 + shiftAmt; - x14_val = val << x18_bitOffset; - } else { - /* OR bits to cached value */ - const u32 mask = bitCount == 32 ? UINT32_MAX : ((1U << bitCount) - 1); - x14_val |= (val & mask) << u32(shiftAmt); - - /* New bit offset */ - x18_bitOffset -= bitCount; - } -} - -void CBitStreamWriter::Flush() { - if (x18_bitOffset >= 0x20) { - return; - } - - auto pos = std::div(0x20 - s32(x18_bitOffset), 8); - if (pos.rem != 0) { - ++pos.quot; - } - - x14_val = hecl::SBig(x14_val); - writeBytes(&x14_val, pos.quot); - x18_bitOffset = 0x20; - x14_val = 0; -} - -CZipInputStream::CZipInputStream(std::unique_ptr&& strm) -: x24_compBuf(new u8[4096]), x28_strm(std::move(strm)) { - x30_zstrm.next_in = x24_compBuf.get(); - x30_zstrm.avail_in = 0; - x30_zstrm.zalloc = [](void*, u32 c, u32 n) -> void* { return new u8[size_t{c} * size_t{n}]; }; - x30_zstrm.zfree = [](void*, void* buf) { delete[] static_cast(buf); }; - inflateInit(&x30_zstrm); -} - -CZipInputStream::~CZipInputStream() { inflateEnd(&x30_zstrm); } - -atUint64 CZipInputStream::readUBytesToBuf(void* buf, atUint64 len) { - x30_zstrm.next_out = static_cast(buf); - x30_zstrm.avail_out = len; - x30_zstrm.total_out = 0; - while (x30_zstrm.avail_out != 0) { - if (x30_zstrm.avail_in == 0) { - atUint64 readSz = x28_strm->readUBytesToBuf(x24_compBuf.get(), 4096); - x30_zstrm.avail_in = readSz; - x30_zstrm.next_in = x24_compBuf.get(); - } - int inflateRet = inflate(&x30_zstrm, Z_NO_FLUSH); - if (inflateRet != Z_OK) - break; - } - return x30_zstrm.total_out; -} - -} // namespace metaforce diff --git a/Runtime/IOStreams.hpp b/Runtime/IOStreams.hpp deleted file mode 100644 index 6aef9d55c..000000000 --- a/Runtime/IOStreams.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include - -#include "Runtime/GCNTypes.hpp" - -#include -#include -#include -#include -#ifdef URDE_ZIP_INPUT_STREAM -#include -#endif - -namespace metaforce { -using CInputStream = athena::io::IStreamReader; -using COutputStream = athena::io::IStreamWriter; - -struct CBitStreamReader : athena::io::MemoryReader { - u32 x1c_val = 0; - u32 x20_bitOffset = 0; - -public: - static constexpr u32 GetBitCount(u32 maxVal) { - u32 ret = 0; - while (maxVal != 0) { - maxVal /= 2; - ret++; - } - - return ret; - } - - CBitStreamReader(const void* data, atUint64 length) : MemoryReader(data, length) {} - - s32 ReadEncoded(u32 key); -}; - -class CBitStreamWriter : public athena::io::MemoryWriter { - u32 x14_val = 0; - u32 x18_bitOffset = 0x20; - -public: - static constexpr u32 GetBitCount(u32 maxVal) { return CBitStreamReader::GetBitCount(maxVal); } - - explicit CBitStreamWriter(atUint8* data = nullptr, atUint64 length = 0x10) : MemoryWriter(data, length) {} - - void WriteEncoded(u32 val, u32 bitCount); - - void Flush(); - - ~CBitStreamWriter() override { Flush(); } -}; - -using CMemoryInStream = athena::io::MemoryReader; -using CMemoryOutStream = athena::io::MemoryWriter; - -#ifdef URDE_ZIP_INPUT_STREAM -class CZipInputStream : public CInputStream { - std::unique_ptr x24_compBuf; - std::unique_ptr x28_strm; - z_stream x30_zstrm = {}; - -public: - explicit CZipInputStream(std::unique_ptr&& strm); - ~CZipInputStream() override; - atUint64 readUBytesToBuf(void* buf, atUint64 len) override; - void seek(atInt64, athena::SeekOrigin) override {} - atUint64 position() const override { return 0; } - atUint64 length() const override { return 0; } -}; -#endif - -} // namespace metaforce diff --git a/Runtime/ITweak.hpp b/Runtime/ITweak.hpp deleted file mode 100644 index 160d9a046..000000000 --- a/Runtime/ITweak.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -namespace metaforce { -class ITweak { -public: - virtual ~ITweak() = default; -}; -} // namespace metaforce diff --git a/Runtime/ImGuiConsole.cpp b/Runtime/ImGuiConsole.cpp index 93abfcc40..20a2b87f6 100644 --- a/Runtime/ImGuiConsole.cpp +++ b/Runtime/ImGuiConsole.cpp @@ -54,7 +54,7 @@ std::string ImGuiLoadStringTable(CAssetId stringId, int idx) { if (!stringTables.contains(stringId)) { stringTables[stringId] = g_SimplePool->GetObj(SObjectTag{SBIG('STRG'), stringId}); } - return hecl::Char16ToUTF8(stringTables[stringId].GetObj()->GetString(idx)); + return CStringExtras::ConvertToUTF8(stringTables[stringId].GetObj()->GetString(idx)); } static bool ContainsCaseInsensitive(std::string_view str, std::string_view val) { @@ -379,14 +379,14 @@ void ImGuiConsole::ShowConsoleVariablesWindow() { } ImGui::SameLine(); ImGui::InputText("Filter", &m_cvarFiltersText); - auto cvars = m_cvarMgr.cvars(hecl::CVar::EFlags::Any & ~hecl::CVar::EFlags::Hidden); + auto cvars = m_cvarMgr.cvars(CVar::EFlags::Any & ~CVar::EFlags::Hidden); if (ImGui::Button("Reset to defaults")) { for (auto* cv : cvars) { if (cv->name() == "developer" || cv->name() == "cheats") { // don't reset developer or cheats to default continue; } - hecl::CVarUnlocker l(cv); + CVarUnlocker l(cv); cv->fromLiteralToType(cv->defaultValue()); } } @@ -405,7 +405,7 @@ void ImGuiConsole::ShowConsoleVariablesWindow() { bool hasSortSpec = sortSpecs != nullptr && // no multi-sort sortSpecs->SpecsCount == 1; - std::vector sortedList; + std::vector sortedList; sortedList.reserve(cvars.size()); for (auto* cvar : cvars) { @@ -422,12 +422,12 @@ void ImGuiConsole::ShowConsoleVariablesWindow() { if (hasSortSpec) { const auto& spec = sortSpecs->Specs[0]; if (spec.ColumnUserID == 'name') { - std::sort(sortedList.begin(), sortedList.end(), [&](hecl::CVar* a, hecl::CVar* b) { + std::sort(sortedList.begin(), sortedList.end(), [&](CVar* a, CVar* b) { int compare = a->name().compare(b->name()); return spec.SortDirection == ImGuiSortDirection_Ascending ? compare < 0 : compare > 0; }); } else if (spec.ColumnUserID == 'val') { - std::sort(sortedList.begin(), sortedList.end(), [&](hecl::CVar* a, hecl::CVar* b) { + std::sort(sortedList.begin(), sortedList.end(), [&](CVar* a, CVar* b) { int compare = a->value().compare(b->value()); return spec.SortDirection == ImGuiSortDirection_Ascending ? compare < 0 : compare > 0; }); @@ -447,35 +447,35 @@ void ImGuiConsole::ShowConsoleVariablesWindow() { // Value if (ImGui::TableNextColumn()) { switch (cv->type()) { - case hecl::CVar::EType::Boolean: { + case CVar::EType::Boolean: { bool b = cv->toBoolean(); if (ImGui::Checkbox("", &b)) { cv->fromBoolean(b); } break; } - case hecl::CVar::EType::Real: { + case CVar::EType::Real: { float f = cv->toReal(); if (ImGui::DragFloat("", &f)) { cv->fromReal(f); } break; } - case hecl::CVar::EType::Signed: { + case CVar::EType::Signed: { std::array i{cv->toSigned()}; if (ImGui::DragScalar("", ImGuiDataType_S32, i.data(), i.size())) { cv->fromInteger(i[0]); } break; } - case hecl::CVar::EType::Unsigned: { + case CVar::EType::Unsigned: { std::array i{cv->toUnsigned()}; if (ImGui::DragScalar("", ImGuiDataType_U32, i.data(), i.size())) { cv->fromInteger(i[0]); } break; } - case hecl::CVar::EType::Literal: { + case CVar::EType::Literal: { char buf[4096]; strcpy(buf, cv->value().c_str()); if (ImGui::InputText("", buf, 4096, ImGuiInputTextFlags_EnterReturnsTrue)) { @@ -483,102 +483,102 @@ void ImGuiConsole::ShowConsoleVariablesWindow() { } break; } - case hecl::CVar::EType::Vec2f: { + case CVar::EType::Vec2f: { auto vec = cv->toVec2f(); - std::array scalars = {vec.simd[0], vec.simd[1]}; + std::array scalars = {vec.x(), vec.y()}; if (ImGui::DragScalarN("", ImGuiDataType_Float, scalars.data(), scalars.size(), 0.1f)) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; cv->fromVec2f(vec); } break; } - case hecl::CVar::EType::Vec2d: { + case CVar::EType::Vec2d: { auto vec = cv->toVec2d(); - std::array scalars = {vec.simd[0], vec.simd[1]}; + std::array scalars = {vec.x(), vec.y()}; if (ImGui::DragScalarN("", ImGuiDataType_Double, scalars.data(), scalars.size(), 0.1f)) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; cv->fromVec2d(vec); } break; } - case hecl::CVar::EType::Vec3f: { + case CVar::EType::Vec3f: { auto vec = cv->toVec3f(); - std::array scalars = {vec.simd[0], vec.simd[1]}; + std::array scalars = {vec.x(), vec.y(), vec.z()}; if (cv->isColor()) { if (ImGui::ColorEdit3("", scalars.data())) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; - vec.simd[2] = scalars[2]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; cv->fromVec3f(vec); } } else if (ImGui::DragScalarN("", ImGuiDataType_Float, scalars.data(), scalars.size(), 0.1f)) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; - vec.simd[2] = scalars[2]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; cv->fromVec3f(vec); } break; } - case hecl::CVar::EType::Vec3d: { + case CVar::EType::Vec3d: { auto vec = cv->toVec3d(); - std::array scalars = {vec.simd[0], vec.simd[1], vec.simd[2]}; + std::array scalars = {vec.x(), vec.y(), vec.z()}; if (cv->isColor()) { std::array color{static_cast(scalars[0]), static_cast(scalars[1]), static_cast(scalars[2])}; if (ImGui::ColorEdit3("", color.data())) { - vec.simd[0] = color[0]; - vec.simd[1] = color[1]; - vec.simd[2] = color[2]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; cv->fromVec3d(vec); } } else if (ImGui::DragScalarN("", ImGuiDataType_Double, scalars.data(), scalars.size(), 0.1f)) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; - vec.simd[2] = scalars[2]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; cv->fromVec3d(vec); } break; } - case hecl::CVar::EType::Vec4f: { + case CVar::EType::Vec4f: { auto vec = cv->toVec4f(); - std::array scalars = {vec.simd[0], vec.simd[1], vec.simd[2], vec.simd[3]}; + std::array scalars = {vec.x(), vec.y(), vec.z(), vec.w()}; if (cv->isColor()) { if (ImGui::ColorEdit4("", scalars.data())) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; - vec.simd[2] = scalars[2]; - vec.simd[3] = scalars[3]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; + vec.w() = scalars[2]; cv->fromVec4f(vec); } } else if (ImGui::DragScalarN("", ImGuiDataType_Float, scalars.data(), scalars.size(), 0.1f)) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; - vec.simd[2] = scalars[2]; - vec.simd[3] = scalars[3]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; + vec.w() = scalars[2]; cv->fromVec4f(vec); } break; } - case hecl::CVar::EType::Vec4d: { + case CVar::EType::Vec4d: { auto vec = cv->toVec4d(); - std::array scalars = {vec.simd[0], vec.simd[1], vec.simd[2], vec.simd[3]}; + std::array scalars = {vec.x(), vec.y(), vec.z(), vec.w()}; if (cv->isColor()) { std::array color{static_cast(scalars[0]), static_cast(scalars[1]), static_cast(scalars[2]), static_cast(scalars[3])}; if (ImGui::ColorEdit4("", color.data())) { - vec.simd[0] = color[0]; - vec.simd[1] = color[1]; - vec.simd[2] = color[2]; - vec.simd[3] = color[3]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; + vec.w() = scalars[2]; cv->fromVec4d(vec); } } else if (ImGui::DragScalarN("", ImGuiDataType_Double, scalars.data(), scalars.size(), 0.1f)) { - vec.simd[0] = scalars[0]; - vec.simd[1] = scalars[1]; - vec.simd[2] = scalars[2]; - vec.simd[3] = scalars[3]; + vec.x() = scalars[0]; + vec.y() = scalars[1]; + vec.z() = scalars[2]; + vec.w() = scalars[2]; cv->fromVec4d(vec); } break; @@ -1156,21 +1156,19 @@ void ImGuiConsole::PreUpdate() { OPTICK_EVENT(); if (!m_isInitialized) { m_isInitialized = true; - m_cvarCommons.m_debugOverlayShowFrameCounter->addListener( - [this](hecl::CVar* c) { m_frameCounter = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayShowFramerate->addListener([this](hecl::CVar* c) { m_frameRate = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayShowInGameTime->addListener([this](hecl::CVar* c) { m_inGameTime = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayShowRoomTimer->addListener([this](hecl::CVar* c) { m_roomTimer = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayPlayerInfo->addListener([this](hecl::CVar* c) { m_playerInfo = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayWorldInfo->addListener([this](hecl::CVar* c) { m_worldInfo = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayAreaInfo->addListener([this](hecl::CVar* c) { m_areaInfo = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayLayerInfo->addListener([this](hecl::CVar* c) { m_layerInfo = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayShowRandomStats->addListener([this](hecl::CVar* c) { m_randomStats = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayShowResourceStats->addListener( - [this](hecl::CVar* c) { m_resourceStats = c->toBoolean(); }); - m_cvarCommons.m_debugOverlayShowInput->addListener([this](hecl::CVar* c) { m_showInput = c->toBoolean(); }); - m_cvarMgr.findCVar("developer")->addListener([this](hecl::CVar* c) { m_developer = c->toBoolean(); }); - m_cvarMgr.findCVar("cheats")->addListener([this](hecl::CVar* c) { m_cheats = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowFrameCounter->addListener([this](CVar* c) { m_frameCounter = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowFramerate->addListener([this](CVar* c) { m_frameRate = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowInGameTime->addListener([this](CVar* c) { m_inGameTime = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowRoomTimer->addListener([this](CVar* c) { m_roomTimer = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayPlayerInfo->addListener([this](CVar* c) { m_playerInfo = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayWorldInfo->addListener([this](CVar* c) { m_worldInfo = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayAreaInfo->addListener([this](CVar* c) { m_areaInfo = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayLayerInfo->addListener([this](CVar* c) { m_layerInfo = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowRandomStats->addListener([this](CVar* c) { m_randomStats = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowResourceStats->addListener([this](CVar* c) { m_resourceStats = c->toBoolean(); }); + m_cvarCommons.m_debugOverlayShowInput->addListener([this](CVar* c) { m_showInput = c->toBoolean(); }); + m_cvarMgr.findCVar("developer")->addListener([this](CVar* c) { m_developer = c->toBoolean(); }); + m_cvarMgr.findCVar("cheats")->addListener([this](CVar* c) { m_cheats = c->toBoolean(); }); } // We ned to make sure we have a valid CRandom16 at all times, so lets do that here if (g_StateManager != nullptr && g_StateManager->GetActiveRandom() == nullptr) { diff --git a/Runtime/ImGuiConsole.hpp b/Runtime/ImGuiConsole.hpp index a34de864c..1df6321ea 100644 --- a/Runtime/ImGuiConsole.hpp +++ b/Runtime/ImGuiConsole.hpp @@ -3,13 +3,13 @@ #include #include -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" #include "Runtime/World/CActor.hpp" #include "Runtime/World/CEntity.hpp" #include "Runtime/ImGuiPlayerLoadouts.hpp" -#include "hecl/CVarCommons.hpp" -#include "hecl/CVarManager.hpp" +#include "Runtime/ConsoleVariables/CVarCommons.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" #include @@ -39,7 +39,7 @@ public: static std::array entities; static ImGuiPlayerLoadouts loadouts; - ImGuiConsole(hecl::CVarManager& cvarMgr, hecl::CVarCommons& cvarCommons) + ImGuiConsole(CVarManager& cvarMgr, CVarCommons& cvarCommons) : m_cvarMgr(cvarMgr), m_cvarCommons(cvarCommons) {} void PreUpdate(); void PostUpdate(); @@ -50,8 +50,8 @@ public: static void EndEntityRow(const ImGuiEntityEntry& entry); private: - hecl::CVarManager& m_cvarMgr; - hecl::CVarCommons& m_cvarCommons; + CVarManager& m_cvarMgr; + CVarCommons& m_cvarCommons; bool m_showInspectWindow = false; bool m_showDemoWindow = false; diff --git a/Runtime/ImGuiPlayerLoadouts.hpp b/Runtime/ImGuiPlayerLoadouts.hpp index 11e43d043..d76de2c58 100644 --- a/Runtime/ImGuiPlayerLoadouts.hpp +++ b/Runtime/ImGuiPlayerLoadouts.hpp @@ -9,15 +9,15 @@ struct ImGuiPlayerLoadouts : athena::io::DNA { struct Item : athena::io::DNA { AT_DECL_DNA_YAML String<-1> type; - Value amount; + Value amount; }; struct LoadOut : athena::io::DNA { AT_DECL_DNA_YAML String<-1> name; - Value itemCount; + Value itemCount; Vector items; }; - Value loadoutCount; + Value loadoutCount; Vector loadouts; }; } // namespace metaforce diff --git a/Runtime/Input/CFinalInput.hpp b/Runtime/Input/CFinalInput.hpp index dc4e32d09..09587fc6e 100644 --- a/Runtime/Input/CFinalInput.hpp +++ b/Runtime/Input/CFinalInput.hpp @@ -76,7 +76,7 @@ struct CFinalInput { std::optional m_kbm; std::array m_PCharKeys{}; - std::array m_PSpecialKeys{}; + std::array m_PSpecialKeys{}; std::array m_PMouseButtons{}; float m_leftMul = 1.f; @@ -176,14 +176,14 @@ struct CFinalInput { CFinalInput ScaleAnalogueSticks(float leftDiv, float rightDiv) const; bool PKey(char k) const { return m_kbm && m_PCharKeys[size_t(k)]; } - bool PSpecialKey(boo::ESpecialKey k) const { return m_kbm && m_PSpecialKeys[size_t(k)]; } - bool PMouseButton(boo::EMouseButton k) const { return m_kbm && m_PMouseButtons[size_t(k)]; } + bool PSpecialKey(aurora::SpecialKey k) const { return m_kbm && m_PSpecialKeys[size_t(k)]; } + bool PMouseButton(EMouseButton k) const { return m_kbm && m_PMouseButtons[size_t(k)]; } bool DKey(char k) const { return m_kbm && m_kbm->m_charKeys[size_t(k)]; } - bool DSpecialKey(boo::ESpecialKey k) const { return m_kbm && m_kbm->m_specialKeys[size_t(k)]; } - bool DMouseButton(boo::EMouseButton k) const { return m_kbm && m_kbm->m_mouseButtons[size_t(k)]; } + bool DSpecialKey(aurora::SpecialKey k) const { return m_kbm && m_kbm->m_specialKeys[size_t(k)]; } + bool DMouseButton(EMouseButton k) const { return m_kbm && m_kbm->m_mouseButtons[size_t(k)]; } float AKey(char k) const { return DKey(k) ? 1.f : 0.f; } - float ASpecialKey(boo::ESpecialKey k) const { return DSpecialKey(k) ? 1.f : 0.f; } - float AMouseButton(boo::EMouseButton k) const { return DMouseButton(k) ? 1.f : 0.f; } + float ASpecialKey(aurora::SpecialKey k) const { return DSpecialKey(k) ? 1.f : 0.f; } + float AMouseButton(EMouseButton k) const { return DMouseButton(k) ? 1.f : 0.f; } const std::optional& GetKBM() const { return m_kbm; } }; diff --git a/Runtime/Input/CInputGenerator.cpp b/Runtime/Input/CInputGenerator.cpp index 0dea298c7..bdddd8ad5 100644 --- a/Runtime/Input/CInputGenerator.cpp +++ b/Runtime/Input/CInputGenerator.cpp @@ -2,7 +2,9 @@ #include "Runtime/CArchitectureMessage.hpp" #include "Runtime/CArchitectureQueue.hpp" -#include "imgui/magic_enum.hpp" + +#include + namespace metaforce { void CInputGenerator::Update(float dt, CArchitectureQueue& queue) { @@ -50,8 +52,7 @@ void CInputGenerator::controllerAdded(uint32_t which) noexcept { } void CInputGenerator::controllerRemoved(uint32_t which) noexcept { - auto* it = - std::find_if(m_state.begin(), m_state.end(), [&which](const auto& s) { return s.m_which == which; }); + auto it = std::find_if(m_state.begin(), m_state.end(), [&which](const auto& s) { return s.m_which == which; }); if (it == m_state.end()) { return; } diff --git a/Runtime/Input/CInputGenerator.hpp b/Runtime/Input/CInputGenerator.hpp index 651ed6da9..0e9438f38 100644 --- a/Runtime/Input/CInputGenerator.hpp +++ b/Runtime/Input/CInputGenerator.hpp @@ -7,8 +7,6 @@ #include "Runtime/Input/CFinalInput.hpp" #include "Runtime/Input/CKeyboardMouseController.hpp" -#include - namespace metaforce { class CArchitectureQueue; @@ -58,14 +56,14 @@ public: * at the start of each frame, invoking these methods. No atomic locking * is necessary, only absolute state tracking. */ - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton button, boo::EModifierKey) { + void mouseDown(const SWindowCoord&, EMouseButton button, EModifierKey) { m_data.m_mouseButtons[size_t(button)] = true; } - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton button, boo::EModifierKey) { + void mouseUp(const SWindowCoord&, EMouseButton button, EModifierKey) { m_data.m_mouseButtons[size_t(button)] = false; } - void mouseMove(const boo::SWindowCoord& coord) { m_data.m_mouseCoord = coord; } - void scroll(const boo::SWindowCoord&, const boo::SScrollDelta& scroll) { m_data.m_accumScroll += scroll; } + void mouseMove(const SWindowCoord& coord) { m_data.m_mouseCoord = coord; } + void scroll(const SWindowCoord&, const SScrollDelta& scroll) { m_data.m_accumScroll += scroll; } void charKeyDown(uint8_t charCode, aurora::ModifierKey, bool) { charCode = tolower(charCode); diff --git a/Runtime/Input/CKeyboardMouseController.hpp b/Runtime/Input/CKeyboardMouseController.hpp index e7da7c6b3..cd06ce18c 100644 --- a/Runtime/Input/CKeyboardMouseController.hpp +++ b/Runtime/Input/CKeyboardMouseController.hpp @@ -3,17 +3,64 @@ #include #include -#include namespace metaforce { +// TODO: copied from boo; should be rewritten and included from from aurora +enum class EMouseButton { None = 0, Primary = 1, Secondary = 2, Middle = 3, Aux1 = 4, Aux2 = 5 }; +enum class EModifierKey { + None = 0, + Ctrl = 1 << 0, + Alt = 1 << 2, + Shift = 1 << 3, + Command = 1 << 4, + CtrlCommand = EModifierKey::Ctrl | EModifierKey::Command +}; +ENABLE_BITWISE_ENUM(EModifierKey) +struct SWindowCoord { + std::array pixel; + std::array virtualPixel; + std::array norm; +}; +struct SScrollDelta { + std::array delta{}; + bool isFine = false; /* Use system-scale fine-scroll (for scrollable-trackpads) */ + bool isAccelerated = false; /* System performs acceleration computation */ + + constexpr SScrollDelta operator+(const SScrollDelta& other) const noexcept { + SScrollDelta ret; + ret.delta[0] = delta[0] + other.delta[0]; + ret.delta[1] = delta[1] + other.delta[1]; + ret.isFine = isFine || other.isFine; + ret.isAccelerated = isAccelerated || other.isAccelerated; + return ret; + } + constexpr SScrollDelta operator-(const SScrollDelta& other) const noexcept { + SScrollDelta ret; + ret.delta[0] = delta[0] - other.delta[0]; + ret.delta[1] = delta[1] - other.delta[1]; + ret.isFine = isFine || other.isFine; + ret.isAccelerated = isAccelerated || other.isAccelerated; + return ret; + } + constexpr SScrollDelta& operator+=(const SScrollDelta& other) noexcept { + delta[0] += other.delta[0]; + delta[1] += other.delta[1]; + isFine |= other.isFine; + isAccelerated |= other.isAccelerated; + return *this; + } + constexpr void zeroOut() noexcept { delta = {}; } + constexpr bool isZero() const noexcept { return delta[0] == 0.0 && delta[1] == 0.0; } +}; + struct CKeyboardMouseControllerData { std::array m_charKeys{}; std::array(aurora::SpecialKey::MAX)> m_specialKeys{}; std::array m_mouseButtons{}; aurora::ModifierKey m_modMask = aurora::ModifierKey::None; - boo::SWindowCoord m_mouseCoord; - boo::SScrollDelta m_accumScroll; + SWindowCoord m_mouseCoord; + SScrollDelta m_accumScroll; }; } // namespace metaforce diff --git a/Runtime/Input/ControlMapper.cpp b/Runtime/Input/ControlMapper.cpp index 167da4991..232612288 100644 --- a/Runtime/Input/ControlMapper.cpp +++ b/Runtime/Input/ControlMapper.cpp @@ -2,8 +2,6 @@ #include -#include "DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp" - #include "Runtime/GameGlobalObjects.hpp" #include "Runtime/RetroTypes.hpp" #include "Runtime/Input/CFinalInput.hpp" @@ -147,75 +145,75 @@ constexpr std::array skAnalogFuncs{ }; constexpr std::array skKBMMapping{ - ControlMapper::EKBMFunctionList::KeyPress + 'w', // Forward, - ControlMapper::EKBMFunctionList::KeyPress + 's', // Backward, - ControlMapper::EKBMFunctionList::KeyPress + 'a', // TurnLeft, - ControlMapper::EKBMFunctionList::KeyPress + 'd', // TurnRight, - ControlMapper::EKBMFunctionList::KeyPress + 'a', // StrafeLeft, - ControlMapper::EKBMFunctionList::KeyPress + 'd', // StrafeRight, - ControlMapper::EKBMFunctionList::KeyPress + 'a', // LookLeft, - ControlMapper::EKBMFunctionList::KeyPress + 'd', // LookRight, - ControlMapper::EKBMFunctionList::KeyPress + 's', // LookUp, - ControlMapper::EKBMFunctionList::KeyPress + 'w', // LookDown, - ControlMapper::EKBMFunctionList::KeyPress + ' ', // JumpOrBoost = 10, - ControlMapper::EKBMFunctionList::MousePress + boo::EMouseButton::Primary, // FireOrBomb = 11, - ControlMapper::EKBMFunctionList::MousePress + boo::EMouseButton::Secondary, // MissileOrPowerBomb = 12, - ControlMapper::EKBMFunctionList::KeyPress + 'c', // Morph, - ControlMapper::EKBMFunctionList::None, // AimUp, - ControlMapper::EKBMFunctionList::None, // AimDown, - ControlMapper::EKBMFunctionList::None, // CycleBeamUp, - ControlMapper::EKBMFunctionList::None, // CycleBeamDown, - ControlMapper::EKBMFunctionList::None, // CycleItem, - ControlMapper::EKBMFunctionList::KeyPress + '1', // PowerBeam, - ControlMapper::EKBMFunctionList::KeyPress + '3', // IceBeam, - ControlMapper::EKBMFunctionList::KeyPress + '2', // WaveBeam, - ControlMapper::EKBMFunctionList::KeyPress + '4', // PlasmaBeam, - ControlMapper::EKBMFunctionList::None, // ToggleHolster = 23, - ControlMapper::EKBMFunctionList::None, // OrbitClose, - ControlMapper::EKBMFunctionList::KeyPress + 'q', // OrbitFar, - ControlMapper::EKBMFunctionList::KeyPress + 'q', // OrbitObject, - ControlMapper::EKBMFunctionList::None, // OrbitSelect, - ControlMapper::EKBMFunctionList::None, // OrbitConfirm, - ControlMapper::EKBMFunctionList::KeyPress + 'a', // OrbitLeft, - ControlMapper::EKBMFunctionList::KeyPress + 'd', // OrbitRight, - ControlMapper::EKBMFunctionList::KeyPress + 'w', // OrbitUp, - ControlMapper::EKBMFunctionList::KeyPress + 's', // OrbitDown, - ControlMapper::EKBMFunctionList::KeyPress + 'e', // LookHold1, - ControlMapper::EKBMFunctionList::None, // LookHold2, - ControlMapper::EKBMFunctionList::None, // LookZoomIn, - ControlMapper::EKBMFunctionList::None, // LookZoomOut, - ControlMapper::EKBMFunctionList::None, // AimHold, - ControlMapper::EKBMFunctionList::KeyPress + 's', // MapCircleUp, - ControlMapper::EKBMFunctionList::KeyPress + 'w', // MapCircleDown, - ControlMapper::EKBMFunctionList::KeyPress + 'a', // MapCircleLeft, - ControlMapper::EKBMFunctionList::KeyPress + 'd', // MapCircleRight, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Up, // MapMoveForward, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Down, // MapMoveBack, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Left, // MapMoveLeft, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Right, // MapMoveRight, - ControlMapper::EKBMFunctionList::KeyPress + 'e', // MapZoomIn, - ControlMapper::EKBMFunctionList::KeyPress + 'q', // MapZoomOut, - ControlMapper::EKBMFunctionList::KeyPress + 'e', // SpiderBall, - ControlMapper::EKBMFunctionList::KeyPress + 'q', // ChaseCamera, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Right, // XrayVisor = 50, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Down, // ThermoVisor = 51, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Left, // InviroVisor = 52, - ControlMapper::EKBMFunctionList::SpecialKeyPress + boo::ESpecialKey::Up, // NoVisor = 53, - ControlMapper::EKBMFunctionList::None, // VisorMenu, - ControlMapper::EKBMFunctionList::None, // VisorUp, - ControlMapper::EKBMFunctionList::None, // VisorDown, - ControlMapper::EKBMFunctionList::KeyPress + 'e', // ShowCrosshairs, - ControlMapper::EKBMFunctionList::None, // UNKNOWN - ControlMapper::EKBMFunctionList::None, // UseSheild = 0x3B, - ControlMapper::EKBMFunctionList::KeyPress + 'q', // ScanItem = 0x3C, - ControlMapper::EKBMFunctionList::None, // UNKNOWN - ControlMapper::EKBMFunctionList::None, // UNKNOWN - ControlMapper::EKBMFunctionList::None, // UNKNOWN - ControlMapper::EKBMFunctionList::None, // UNKNOWN - ControlMapper::EKBMFunctionList::KeyPress + 'q', // PreviousPauseScreen = 0x41, - ControlMapper::EKBMFunctionList::KeyPress + 'e', // NextPauseScreen = 0x42, - ControlMapper::EKBMFunctionList::None, // UNKNOWN, - ControlMapper::EKBMFunctionList::None, // None, + ControlMapper::EKBMFunctionList::KeyPress + 'w', // Forward, + ControlMapper::EKBMFunctionList::KeyPress + 's', // Backward, + ControlMapper::EKBMFunctionList::KeyPress + 'a', // TurnLeft, + ControlMapper::EKBMFunctionList::KeyPress + 'd', // TurnRight, + ControlMapper::EKBMFunctionList::KeyPress + 'a', // StrafeLeft, + ControlMapper::EKBMFunctionList::KeyPress + 'd', // StrafeRight, + ControlMapper::EKBMFunctionList::KeyPress + 'a', // LookLeft, + ControlMapper::EKBMFunctionList::KeyPress + 'd', // LookRight, + ControlMapper::EKBMFunctionList::KeyPress + 's', // LookUp, + ControlMapper::EKBMFunctionList::KeyPress + 'w', // LookDown, + ControlMapper::EKBMFunctionList::KeyPress + ' ', // JumpOrBoost = 10, + ControlMapper::EKBMFunctionList::MousePress + EMouseButton::Primary, // FireOrBomb = 11, + ControlMapper::EKBMFunctionList::MousePress + EMouseButton::Secondary, // MissileOrPowerBomb = 12, + ControlMapper::EKBMFunctionList::KeyPress + 'c', // Morph, + ControlMapper::EKBMFunctionList::None, // AimUp, + ControlMapper::EKBMFunctionList::None, // AimDown, + ControlMapper::EKBMFunctionList::None, // CycleBeamUp, + ControlMapper::EKBMFunctionList::None, // CycleBeamDown, + ControlMapper::EKBMFunctionList::None, // CycleItem, + ControlMapper::EKBMFunctionList::KeyPress + '1', // PowerBeam, + ControlMapper::EKBMFunctionList::KeyPress + '3', // IceBeam, + ControlMapper::EKBMFunctionList::KeyPress + '2', // WaveBeam, + ControlMapper::EKBMFunctionList::KeyPress + '4', // PlasmaBeam, + ControlMapper::EKBMFunctionList::None, // ToggleHolster = 23, + ControlMapper::EKBMFunctionList::None, // OrbitClose, + ControlMapper::EKBMFunctionList::KeyPress + 'q', // OrbitFar, + ControlMapper::EKBMFunctionList::KeyPress + 'q', // OrbitObject, + ControlMapper::EKBMFunctionList::None, // OrbitSelect, + ControlMapper::EKBMFunctionList::None, // OrbitConfirm, + ControlMapper::EKBMFunctionList::KeyPress + 'a', // OrbitLeft, + ControlMapper::EKBMFunctionList::KeyPress + 'd', // OrbitRight, + ControlMapper::EKBMFunctionList::KeyPress + 'w', // OrbitUp, + ControlMapper::EKBMFunctionList::KeyPress + 's', // OrbitDown, + ControlMapper::EKBMFunctionList::KeyPress + 'e', // LookHold1, + ControlMapper::EKBMFunctionList::None, // LookHold2, + ControlMapper::EKBMFunctionList::None, // LookZoomIn, + ControlMapper::EKBMFunctionList::None, // LookZoomOut, + ControlMapper::EKBMFunctionList::None, // AimHold, + ControlMapper::EKBMFunctionList::KeyPress + 's', // MapCircleUp, + ControlMapper::EKBMFunctionList::KeyPress + 'w', // MapCircleDown, + ControlMapper::EKBMFunctionList::KeyPress + 'a', // MapCircleLeft, + ControlMapper::EKBMFunctionList::KeyPress + 'd', // MapCircleRight, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Up, // MapMoveForward, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Down, // MapMoveBack, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Left, // MapMoveLeft, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Right, // MapMoveRight, + ControlMapper::EKBMFunctionList::KeyPress + 'e', // MapZoomIn, + ControlMapper::EKBMFunctionList::KeyPress + 'q', // MapZoomOut, + ControlMapper::EKBMFunctionList::KeyPress + 'e', // SpiderBall, + ControlMapper::EKBMFunctionList::KeyPress + 'q', // ChaseCamera, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Right, // XrayVisor = 50, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Down, // ThermoVisor = 51, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Left, // InviroVisor = 52, + ControlMapper::EKBMFunctionList::SpecialKeyPress + aurora::SpecialKey::Up, // NoVisor = 53, + ControlMapper::EKBMFunctionList::None, // VisorMenu, + ControlMapper::EKBMFunctionList::None, // VisorUp, + ControlMapper::EKBMFunctionList::None, // VisorDown, + ControlMapper::EKBMFunctionList::KeyPress + 'e', // ShowCrosshairs, + ControlMapper::EKBMFunctionList::None, // UNKNOWN + ControlMapper::EKBMFunctionList::None, // UseSheild = 0x3B, + ControlMapper::EKBMFunctionList::KeyPress + 'q', // ScanItem = 0x3C, + ControlMapper::EKBMFunctionList::None, // UNKNOWN + ControlMapper::EKBMFunctionList::None, // UNKNOWN + ControlMapper::EKBMFunctionList::None, // UNKNOWN + ControlMapper::EKBMFunctionList::None, // UNKNOWN + ControlMapper::EKBMFunctionList::KeyPress + 'q', // PreviousPauseScreen = 0x41, + ControlMapper::EKBMFunctionList::KeyPress + 'e', // NextPauseScreen = 0x42, + ControlMapper::EKBMFunctionList::None, // UNKNOWN, + ControlMapper::EKBMFunctionList::None, // None, ControlMapper::EKBMFunctionList::None, }; @@ -232,7 +230,7 @@ bool ControlMapper::GetPressInput(ECommands cmd, const CFinalInput& input) { } bool ret = false; - const auto func = EFunctionList(g_currentPlayerControl->GetMapping(atUint32(cmd))); + const auto func = EFunctionList(g_currentPlayerControl->GetMapping(u32(cmd))); if (func < EFunctionList::MAX) { if (BoolReturnFn fn = skPressFuncs[size_t(func)]) { ret = (input.*fn)(); @@ -259,7 +257,7 @@ bool ControlMapper::GetDigitalInput(ECommands cmd, const CFinalInput& input) { } bool ret = false; - const auto func = EFunctionList(g_currentPlayerControl->GetMapping(atUint32(cmd))); + const auto func = EFunctionList(g_currentPlayerControl->GetMapping(u32(cmd))); if (func < EFunctionList::MAX) { if (BoolReturnFn fn = skDigitalFuncs[size_t(func)]) ret = (input.*fn)(); @@ -309,10 +307,10 @@ static float KBToWASDY(const CKeyboardMouseControllerData& data) { static float KBToArrowsX(const CKeyboardMouseControllerData& data) { float retval = 0.0; - if (data.m_specialKeys[size_t(boo::ESpecialKey::Left)]) { + if (data.m_specialKeys[size_t(aurora::SpecialKey::Left)]) { retval -= 1.0; } - if (data.m_specialKeys[size_t(boo::ESpecialKey::Right)]) { + if (data.m_specialKeys[size_t(aurora::SpecialKey::Right)]) { retval += 1.0; } return retval; @@ -320,10 +318,10 @@ static float KBToArrowsX(const CKeyboardMouseControllerData& data) { static float KBToArrowsY(const CKeyboardMouseControllerData& data) { float retval = 0.0; - if (data.m_specialKeys[size_t(boo::ESpecialKey::Down)]) { + if (data.m_specialKeys[size_t(aurora::SpecialKey::Down)]) { retval -= 1.0; } - if (data.m_specialKeys[size_t(boo::ESpecialKey::Up)]) { + if (data.m_specialKeys[size_t(aurora::SpecialKey::Up)]) { retval += 1.0; } return retval; @@ -335,7 +333,7 @@ float ControlMapper::GetAnalogInput(ECommands cmd, const CFinalInput& input) { } float ret = 0.f; - const auto func = EFunctionList(g_currentPlayerControl->GetMapping(atUint32(cmd))); + const auto func = EFunctionList(g_currentPlayerControl->GetMapping(u32(cmd))); if (func < EFunctionList::MAX) { if (FloatReturnFn fn = skAnalogFuncs[size_t(func)]) { ret = (input.*fn)(); diff --git a/Runtime/Input/ControlMapper.hpp b/Runtime/Input/ControlMapper.hpp index 952fcdeaf..30f81bbab 100644 --- a/Runtime/Input/ControlMapper.hpp +++ b/Runtime/Input/ControlMapper.hpp @@ -2,7 +2,7 @@ #include -#include +#include "Input/CKeyboardMouseController.hpp" namespace metaforce { struct CFinalInput; @@ -126,12 +126,12 @@ constexpr ControlMapper::EKBMFunctionList operator+(ControlMapper::EKBMFunctionL return ControlMapper::EKBMFunctionList(static_cast(a) + static_cast(b)); } -constexpr ControlMapper::EKBMFunctionList operator+(ControlMapper::EKBMFunctionList a, boo::ESpecialKey b) { +constexpr ControlMapper::EKBMFunctionList operator+(ControlMapper::EKBMFunctionList a, aurora::SpecialKey b) { using T = std::underlying_type_t; return ControlMapper::EKBMFunctionList(static_cast(a) + static_cast(b)); } -constexpr ControlMapper::EKBMFunctionList operator+(ControlMapper::EKBMFunctionList a, boo::EMouseButton b) { +constexpr ControlMapper::EKBMFunctionList operator+(ControlMapper::EKBMFunctionList a, EMouseButton b) { using T = std::underlying_type_t; return ControlMapper::EKBMFunctionList(static_cast(a) + static_cast(b)); } diff --git a/Runtime/MP1/CArtifactDoll.cpp b/Runtime/MP1/CArtifactDoll.cpp index 8107a458b..2e013a848 100644 --- a/Runtime/MP1/CArtifactDoll.cpp +++ b/Runtime/MP1/CArtifactDoll.cpp @@ -31,18 +31,18 @@ constexpr std::array ArtifactPieceModels{ }; constexpr std::array ArtifactHeadScans{ - 0x32C9DDCE, // Truth - 0xB45DAF60, // Strength - 0x7F017CC5, // Elder - 0x62044C7D, // Wild - 0xA9589FD8, // Lifegiver - 0x2FCCED76, // Warrior - 0xE4903ED3, // Chozo - 0x15C68C06, // Nature - 0xDE9A5FA3, // Sun - 0xFBBE9D9A, // World - 0x30E24E3F, // Spirit - 0xB6763C91 // Newborn + 0x32C9DDCEu, // Truth + 0xB45DAF60u, // Strength + 0x7F017CC5u, // Elder + 0x62044C7Du, // Wild + 0xA9589FD8u, // Lifegiver + 0x2FCCED76u, // Warrior + 0xE4903ED3u, // Chozo + 0x15C68C06u, // Nature + 0xDE9A5FA3u, // Sun + 0xFBBE9D9Au, // World + 0x30E24E3Fu, // Spirit + 0xB6763C91u // Newborn }; constexpr zeus::CColor ArtifactPreColor{0.4f, 0.68f, 0.88f, 0.8f}; @@ -70,7 +70,7 @@ int CArtifactDoll::GetArtifactHeadScanIndex(CAssetId scanId) { CAssetId CArtifactDoll::GetArtifactHeadScanFromItemType(CPlayerState::EItemType item) { if (item < CPlayerState::EItemType::Truth || item > CPlayerState::EItemType::Newborn) { - return -1; + return {}; } return ArtifactHeadScans[size_t(item) - 29]; diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 094d49125..60032e524 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -67,7 +67,7 @@ constexpr std::array FEMovies{{ {"Video/08_GBA_fileselect.thp", false}, }}; -constexpr SObjectTag g_DefaultWorldTag = {FOURCC('MLVL'), 0x158efe17}; +constexpr SObjectTag g_DefaultWorldTag = {FOURCC('MLVL'), 0x158efe17u}; constexpr std::array AudioFadeTimeA{ 0.44f, @@ -843,11 +843,11 @@ CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::ProcessUserInput(const CFinalInpu case EUIType::LinkFailed: case EUIType::LinkCompleteOrLinking: case EUIType::TurnOffGBA: - if (input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || + if (input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary) || tbAction == CFrontEndUITouchBar::EAction::Confirm) { PlayAdvanceSfx(); SetUIText(NextLinkUI[size_t(x0_uiType)]); - } else if (input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc) || + } else if (input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc) || tbAction == CFrontEndUITouchBar::EAction::Back) { const EUIType prevUi = PrevLinkUI[size_t(x0_uiType)]; if (prevUi == EUIType::Empty) { @@ -1375,7 +1375,7 @@ void CFrontEndUI::SNesEmulatorFrame::ProcessUserInput(const CFinalInput& input, switch (x0_mode) { case EMode::Emulator: x4_nesEmu->ProcessUserInput(input, 4); - if ((input.ControllerIdx() == 0 && input.PL()) || input.PSpecialKey(boo::ESpecialKey::Esc)) + if ((input.ControllerIdx() == 0 && input.PL()) || input.PSpecialKey(aurora::SpecialKey::Esc)) SetMode(EMode::QuitNESMetroid); break; case EMode::SaveProgress: @@ -1717,7 +1717,7 @@ bool CFrontEndUI::SOptionsFrontEndFrame::ProcessUserInput(const CFinalInput& inp if (sui) sui->ProcessUserInput(input); if (x1c_loadedFrame && x134_24_visible) { - if ((input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc)) && x24_tablegroup_leftmenu->GetIsActive()) { + if ((input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc)) && x24_tablegroup_leftmenu->GetIsActive()) { x134_25_exitOptions = true; CSfxManager::SfxStart(SFXfnt_back, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); } else { @@ -2186,8 +2186,8 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& if (x50_curScreen != x54_nextScreen) { if (x54_nextScreen == EScreen::AttractMovie && - (input.PStart() || input.PA() || input.PSpecialKey(boo::ESpecialKey::Esc) || - input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || + (input.PStart() || input.PA() || input.PSpecialKey(aurora::SpecialKey::Esc) || + input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary) || touchBarAction == CFrontEndUITouchBar::EAction::Start)) { /* Player wants to return to opening credits from attract movie */ SetFadeBlackTimer(std::min(1.f, x58_fadeBlackTimer)); @@ -2195,8 +2195,8 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& return; } - if (input.PA() || input.PStart() || input.PSpecialKey(boo::ESpecialKey::Esc) || - input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || + if (input.PA() || input.PStart() || input.PSpecialKey(aurora::SpecialKey::Esc) || + input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary) || touchBarAction == CFrontEndUITouchBar::EAction::Start) { if (x50_curScreen == EScreen::OpenCredits && x54_nextScreen == EScreen::Title && x58_fadeBlackTimer > 1.f) { /* Player is too impatient to view opening credits */ @@ -2207,8 +2207,8 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& } } else { if (x50_curScreen == EScreen::Title) { - if (input.PStart() || input.PA() || input.PSpecialKey(boo::ESpecialKey::Esc) || - input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || + if (input.PStart() || input.PA() || input.PSpecialKey(aurora::SpecialKey::Esc) || + input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary) || touchBarAction == CFrontEndUITouchBar::EAction::Start) { if (x58_fadeBlackTimer < 30.f - g_tweakGame->GetPressStartDelay()) { /* Proceed to file select UI */ diff --git a/Runtime/MP1/CInGameGuiManager.cpp b/Runtime/MP1/CInGameGuiManager.cpp index 546c1934e..2245b5f75 100644 --- a/Runtime/MP1/CInGameGuiManager.cpp +++ b/Runtime/MP1/CInGameGuiManager.cpp @@ -631,7 +631,7 @@ void CInGameGuiManager::PauseGame(CStateManager& stateMgr, EInGameGuiState state } void CInGameGuiManager::StartFadeIn() { - xf8_camFilter.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, zeus::skBlack, -1); + xf8_camFilter.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, zeus::skBlack, {}); xf8_camFilter.DisableFilter(0.5f); } diff --git a/Runtime/MP1/CInGameGuiManager.hpp b/Runtime/MP1/CInGameGuiManager.hpp index 2173ee038..5fd86f9f4 100644 --- a/Runtime/MP1/CInGameGuiManager.hpp +++ b/Runtime/MP1/CInGameGuiManager.hpp @@ -5,7 +5,7 @@ #include #include -#include "DataSpec/DNACommon/Tweaks/ITweakGui.hpp" +#include "Runtime/Tweaks/ITweakGui.hpp" #include "Runtime/CDependencyGroup.hpp" #include "Runtime/CRandom16.hpp" @@ -43,8 +43,8 @@ class CSamusHud; class CInGameGuiManager { public: - using EHelmetVisMode = DataSpec::ITweakGui::EHelmetVisMode; - using EHudVisMode = DataSpec::ITweakGui::EHudVisMode; + using EHelmetVisMode = Tweaks::ITweakGui::EHelmetVisMode; + using EHudVisMode = Tweaks::ITweakGui::EHudVisMode; private: enum class ELoadPhase { LoadDepsGroup = 0, PreLoadDeps, LoadDeps, Done }; diff --git a/Runtime/MP1/CInventoryScreen.cpp b/Runtime/MP1/CInventoryScreen.cpp index 8765a1833..f4e328314 100644 --- a/Runtime/MP1/CInventoryScreen.cpp +++ b/Runtime/MP1/CInventoryScreen.cpp @@ -132,7 +132,7 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input) { if (const auto& kbm = input.GetKBM()) { m_lastMouseCoord = zeus::CVector2f(kbm->m_mouseCoord.norm[0], kbm->m_mouseCoord.norm[1]); m_lastAccumScroll = kbm->m_accumScroll; - m_dollScroll = boo::SScrollDelta(); + m_dollScroll = SScrollDelta(); } } } @@ -141,7 +141,7 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input) { if (input.PStart()) { x19c_samusDoll->BeginViewInterpolate(false); x198_26_exitPauseScreen = true; - } else if (input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc)) { + } else if (input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc)) { x19c_samusDoll->BeginViewInterpolate(false); } } @@ -167,8 +167,8 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input) { m_lastMouseCoord = mouseCoord; mouseDelta.x() *= g_Viewport.aspect; mouseDelta *= 100.f; - if (kbm->m_mouseButtons[size_t(boo::EMouseButton::Middle)] || - kbm->m_mouseButtons[size_t(boo::EMouseButton::Secondary)]) { + if (kbm->m_mouseButtons[size_t(EMouseButton::Middle)] || + kbm->m_mouseButtons[size_t(EMouseButton::Secondary)]) { if (float(mouseDelta.x()) < 0.f) moveRight += -mouseDelta.x(); else if (float(mouseDelta.x()) > 0.f) @@ -178,7 +178,7 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input) { else if (float(mouseDelta.y()) > 0.f) moveBack += mouseDelta.y(); } - if (kbm->m_mouseButtons[size_t(boo::EMouseButton::Primary)]) { + if (kbm->m_mouseButtons[size_t(EMouseButton::Primary)]) { if (float(mouseDelta.x()) < 0.f) circleRight += -mouseDelta.x(); else if (float(mouseDelta.x()) > 0.f) @@ -220,7 +220,7 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input) { if (input.PLAUp() || m_bodyUpClicked) newPage = std::max(oldPage - 1, 0); else if (input.PLADown() || m_bodyDownClicked || - ((input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || m_bodyClicked) && !lastPage)) + ((input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || m_bodyClicked) && !lastPage)) newPage = std::min(oldPage + 1, totalCount - 1); x174_textpane_body->TextSupport().SetPage(newPage); if (oldPage != newPage) @@ -233,8 +233,8 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input) { } if (!x1ac_textLeaveRequested) x1ac_textLeaveRequested = - input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc) || - ((input.PA() || m_bodyClicked || input.PSpecialKey(boo::ESpecialKey::Enter)) && lastPage); + input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc) || + ((input.PA() || m_bodyClicked || input.PSpecialKey(aurora::SpecialKey::Enter)) && lastPage); x1ad_textViewing = !x1ac_textLeaveRequested; } else { x198_29_pulseTextArrowBottom = false; diff --git a/Runtime/MP1/CInventoryScreen.hpp b/Runtime/MP1/CInventoryScreen.hpp index bd4b4f65e..e91a854f4 100644 --- a/Runtime/MP1/CInventoryScreen.hpp +++ b/Runtime/MP1/CInventoryScreen.hpp @@ -24,8 +24,8 @@ class CInventoryScreen : public CPauseScreenBase { bool x1ad_textViewing; zeus::CVector2f m_lastMouseCoord; - boo::SScrollDelta m_lastAccumScroll; - boo::SScrollDelta m_dollScroll; + SScrollDelta m_lastAccumScroll; + SScrollDelta m_dollScroll; void UpdateSamusDollPulses(); bool HasLeftInventoryItem(int idx) const; diff --git a/Runtime/MP1/CLogBookScreen.cpp b/Runtime/MP1/CLogBookScreen.cpp index 88c2b63aa..8de7c2c04 100644 --- a/Runtime/MP1/CLogBookScreen.cpp +++ b/Runtime/MP1/CLogBookScreen.cpp @@ -212,7 +212,7 @@ void CLogBookScreen::UpdateBodyText() { void CLogBookScreen::UpdateBodyImagesAndText() { const CScannableObjectInfo* scan = x1f0_curViewScans[x1c_rightSel].first.GetObj(); for (CAuiImagePane* pane : xf0_imagePanes) { - pane->SetTextureID0(-1, g_SimplePool); + pane->SetTextureID0({}, g_SimplePool); pane->SetAnimationParms(zeus::skZero2f, 0.f, 0.f); } @@ -338,7 +338,7 @@ void CLogBookScreen::ProcessControllerInput(const CFinalInput& input) { if (input.PLAUp() || m_bodyUpClicked) newPage = std::max(oldPage - 1, 0); else if (input.PLADown() || m_bodyDownClicked || - ((input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || m_bodyClicked) && !lastPage)) + ((input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || m_bodyClicked) && !lastPage)) newPage = std::min(oldPage + 1, pageCount - 1); x174_textpane_body->TextSupport().SetPage(newPage); if (oldPage != newPage) @@ -352,8 +352,8 @@ void CLogBookScreen::ProcessControllerInput(const CFinalInput& input) { if (!x260_26_exitTextScroll) x260_26_exitTextScroll = - input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc) || - ((input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || m_bodyClicked) && lastPage); + input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc) || + ((input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || m_bodyClicked) && lastPage); if (g_tweakGui->GetLatchArticleText()) x260_25_inTextScroll = !x260_26_exitTextScroll; diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index 7fe8de7b0..d7dd43277 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -125,7 +125,7 @@ CIOWin::EMessageReturn CMFGame::OnMessage(const CArchitectureMessage& msg, CArch if (input.ControllerIdx() == 0) { const CEntity* cam = x14_stateManager->GetCameraManager()->GetCurrentCamera(*x14_stateManager); TCastToConstPtr cineCam = cam; - if (input.PStart() || input.PSpecialKey(boo::ESpecialKey::Esc)) { + if (input.PStart() || input.PSpecialKey(aurora::SpecialKey::Esc)) { if (cineCam && x14_stateManager->GetSkipCinematicSpecialFunction() != kInvalidUniqueId) { CMidiManager::StopAll(); x28_skippedCineCam = cineCam->GetUniqueId(); @@ -273,10 +273,10 @@ CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader") { break; } - if (g_GameState->CurrentWorldAssetId() == 0x158EFE17 && g_GameState->CurrentWorldState().GetCurrentAreaId() == 0) { + if (g_GameState->CurrentWorldAssetId() == 0x158EFE17u && g_GameState->CurrentWorldState().GetCurrentAreaId() == 0) { const SObjectTag* strgTag = g_ResFactory->GetResourceIdByName("STRG_IntroLevelLoad"); if (strgTag) - g_GameState->GetWorldTransitionManager()->EnableTransition(-1, strgTag->id, 0, false, 0.1f, 16.f, 1.f); + g_GameState->GetWorldTransitionManager()->EnableTransition({}, strgTag->id, 0, false, 0.1f, 16.f, 1.f); } } diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index 910dd755f..e43c01e42 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -7,6 +7,19 @@ add_subdirectory(World) #endif () set(MP1_SOURCES + Tweaks/CTweakAutoMapper.hpp Tweaks/CTweakAutoMapper.cpp + Tweaks/CTweakBall.hpp Tweaks/CTweakBall.cpp + Tweaks/CTweakGame.hpp Tweaks/CTweakGame.cpp + Tweaks/CTweakGui.hpp Tweaks/CTweakGui.cpp + Tweaks/CTweakGuiColors.hpp Tweaks/CTweakGuiColors.cpp + Tweaks/CTweakGunRes.hpp Tweaks/CTweakGunRes.cpp + Tweaks/CTweakParticle.hpp Tweaks/CTweakParticle.cpp + Tweaks/CTweakPlayer.hpp Tweaks/CTweakPlayer.cpp + Tweaks/CTweakPlayerControl.hpp Tweaks/CTweakPlayerControl.cpp + Tweaks/CTweakPlayerGun.hpp Tweaks/CTweakPlayerGun.cpp + Tweaks/CTweakPlayerRes.hpp Tweaks/CTweakPlayerRes.cpp + Tweaks/CTweakSlideShow.hpp Tweaks/CTweakSlideShow.cpp + Tweaks/CTweakTargeting.hpp Tweaks/CTweakTargeting.cpp CTweaks.hpp CTweaks.cpp CInGameTweakManager.hpp CGBASupport.hpp CGBASupport.cpp diff --git a/Runtime/MP1/CMemoryCardDriver.cpp b/Runtime/MP1/CMemoryCardDriver.cpp index eee2a05ea..fbcc9675b 100644 --- a/Runtime/MP1/CMemoryCardDriver.cpp +++ b/Runtime/MP1/CMemoryCardDriver.cpp @@ -43,7 +43,7 @@ ECardResult CMemoryCardDriver::SFileInfo::FileRead() { if (x24_saveFileData.empty()) { return ECardResult::CRC_MISMATCH; } - u32 existingCrc = hecl::SBig(*reinterpret_cast(x24_saveFileData.data())); + u32 existingCrc = CBasics::SwapBytes(*reinterpret_cast(x24_saveFileData.data())); u32 newCrc = CCRC32::Calculate(x24_saveFileData.data() + 4, x24_saveFileData.size() - 4); if (existingCrc == newCrc) { u32 saveDataOff; @@ -106,19 +106,19 @@ ECardResult CMemoryCardDriver::SFileInfo::GetSaveDataOffset(u32& offOut) const { CMemoryCardDriver::SGameFileSlot::SGameFileSlot() { InitializeFromGameState(); } CMemoryCardDriver::SGameFileSlot::SGameFileSlot(CMemoryInStream& in) { - in.readBytesToBuf(x0_saveBuffer.data(), x0_saveBuffer.size()); + in.ReadBytes(reinterpret_cast(x0_saveBuffer.data()), x0_saveBuffer.size()); x944_fileInfo = CGameState::LoadGameFileState(x0_saveBuffer.data()); } void CMemoryCardDriver::SGameFileSlot::InitializeFromGameState() { - CBitStreamWriter w(x0_saveBuffer.data(), x0_saveBuffer.size()); + CMemoryStreamOut w(x0_saveBuffer.data(), x0_saveBuffer.size()); g_GameState->PutTo(w); w.Flush(); x944_fileInfo = CGameState::LoadGameFileState(x0_saveBuffer.data()); } void CMemoryCardDriver::SGameFileSlot::LoadGameState(u32 idx) { - CBitStreamReader r(x0_saveBuffer.data(), x0_saveBuffer.size()); + CMemoryInStream r(x0_saveBuffer.data(), x0_saveBuffer.size(), CMemoryInStream::EOwnerShip::NotOwned); static_cast(g_Main)->StreamNewGameState(r, idx); } @@ -151,9 +151,9 @@ const CGameState::GameFileStateInfo* CMemoryCardDriver::GetGameFileStateInfo(int CMemoryCardDriver::SSaveHeader CMemoryCardDriver::LoadSaveHeader(CMemoryInStream& in) { SSaveHeader ret; - ret.x0_version = in.readUint32Big(); + ret.x0_version = in.ReadLong(); for (bool& present : ret.x4_savePresent) { - present = in.readBool(); + present = in.ReadBool(); } return ret; } @@ -174,7 +174,7 @@ void CMemoryCardDriver::ReadFinished() { x20_fileTime = stat.GetTime(); CMemoryInStream r(fileInfo.x34_saveData.data(), 3004); SSaveHeader header = LoadSaveHeader(r); - r.readBytesToBuf(x30_systemData.data(), x30_systemData.size()); + r.ReadBytes(reinterpret_cast(x30_systemData.data()), x30_systemData.size()); for (size_t i = 0; i < xe4_fileSlots.size(); ++i) { if (header.x4_savePresent[i]) { @@ -188,17 +188,17 @@ void CMemoryCardDriver::ReadFinished() { } void CMemoryCardDriver::ImportPersistentOptions() { - CBitStreamReader r(x30_systemData.data(), x30_systemData.size()); + CMemoryInStream r(x30_systemData.data(), x30_systemData.size(), CMemoryInStream::EOwnerShip::NotOwned); CPersistentOptions opts(r); g_GameState->ImportPersistentOptions(opts); } void CMemoryCardDriver::ExportPersistentOptions() { - CBitStreamReader r(x30_systemData.data(), x30_systemData.size()); + CMemoryInStream r(x30_systemData.data(), x30_systemData.size(), CMemoryInStream::EOwnerShip::NotOwned); CPersistentOptions opts(r); g_GameState->ExportPersistentOptions(opts); - CBitStreamWriter w(x30_systemData.data(), x30_systemData.size()); - opts.PutTo(w); + CMemoryStreamOut w(x30_systemData.data(), x30_systemData.size()); + w.Put(opts); } void CMemoryCardDriver::CheckCardCapacity() { @@ -645,7 +645,7 @@ void CMemoryCardDriver::BuildNewFileSlot(u32 saveIdx) { slot = std::make_unique(); slot->LoadGameState(saveIdx); - CBitStreamReader r(x30_systemData.data(), x30_systemData.size()); + CMemoryInStream r(x30_systemData.data(), x30_systemData.size()); g_GameState->ReadPersistentOptions(r); ImportPersistentOptions(); g_GameState->SetCardSerial(x28_cardSerial); @@ -663,7 +663,7 @@ void CMemoryCardDriver::BuildExistingFileSlot(u32 saveIdx) { else slot->InitializeFromGameState(); - CBitStreamWriter w(x30_systemData.data(), x30_systemData.size()); + CMemoryStreamOut w(x30_systemData.data(), x30_systemData.size()); g_GameState->PutTo(w); } @@ -680,7 +680,7 @@ void CMemoryCardDriver::InitializeFileInfo() { x198_fileInfo->LockBannerToken(x4_saveBanner, *g_SimplePool); x198_fileInfo->LockIconToken(x8_saveIcon0, kabufuda::EAnimationSpeed::Middle, *g_SimplePool); - CMemoryOutStream w = x198_fileInfo->BeginMemoryOut(3004); + CMemoryStreamOut w = x198_fileInfo->BeginMemoryOut(3004); SSaveHeader header; for (size_t i = 0; i < xe4_fileSlots.size(); ++i) { @@ -688,7 +688,7 @@ void CMemoryCardDriver::InitializeFileInfo() { } header.DoPut(w); - w.writeBytes(x30_systemData.data(), x30_systemData.size()); + w.Put(x30_systemData.data(), x30_systemData.size()); for (auto& fileSlot : xe4_fileSlots) { if (fileSlot) { diff --git a/Runtime/MP1/CMemoryCardDriver.hpp b/Runtime/MP1/CMemoryCardDriver.hpp index fec06aa25..c68ba45c9 100644 --- a/Runtime/MP1/CMemoryCardDriver.hpp +++ b/Runtime/MP1/CMemoryCardDriver.hpp @@ -90,10 +90,10 @@ private: u32 x0_version = 0; std::array x4_savePresent{}; - void DoPut(CMemoryOutStream& out) const { - out.writeUint32Big(x0_version); + void DoPut(CMemoryStreamOut& out) const { + out.WriteLong(x0_version); for (const bool savePresent : x4_savePresent) { - out.writeBool(savePresent); + out.Put(savePresent); } } }; @@ -106,7 +106,7 @@ private: explicit SGameFileSlot(CMemoryInStream& in); void InitializeFromGameState(); void LoadGameState(u32 idx); - void DoPut(CMemoryOutStream& w) const { w.writeBytes(x0_saveBuffer.data(), x0_saveBuffer.size()); } + void DoPut(CMemoryStreamOut& w) const { w.Put(x0_saveBuffer.data(), x0_saveBuffer.size()); } }; enum class EFileState { Unknown, NoFile, File, BadFile }; diff --git a/Runtime/MP1/CMessageScreen.cpp b/Runtime/MP1/CMessageScreen.cpp index 2a63a3002..459ce2c92 100644 --- a/Runtime/MP1/CMessageScreen.cpp +++ b/Runtime/MP1/CMessageScreen.cpp @@ -18,7 +18,7 @@ CMessageScreen::CMessageScreen(CAssetId msg, float delayTime) : x74_delayTime(de void CMessageScreen::ProcessControllerInput(const CFinalInput& input) { if (!x18_loadedMsgScreen || x74_delayTime > 0.f || - !(input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary))) + !(input.PA() || input.PSpecialKey(aurora::SpecialKey::Enter) || input.PMouseButton(EMouseButton::Primary))) return; if (x1c_textpane_message->TextSupport().GetCurTime() < x1c_textpane_message->TextSupport().GetTotalAnimationTime()) { diff --git a/Runtime/MP1/COptionsScreen.cpp b/Runtime/MP1/COptionsScreen.cpp index f05120a48..60ecff760 100644 --- a/Runtime/MP1/COptionsScreen.cpp +++ b/Runtime/MP1/COptionsScreen.cpp @@ -153,7 +153,7 @@ void COptionsScreen::ProcessControllerInput(const CFinalInput& input) { CGameOptions::TryRestoreDefaults(input, x70_tablegroup_leftlog->GetUserSelection(), x1c_rightSel, false, rightClicked); if (x70_tablegroup_leftlog->GetUserSelection() == 4 && - (input.PA() || leftClicked || input.PSpecialKey(boo::ESpecialKey::Enter))) + (input.PA() || leftClicked || input.PSpecialKey(aurora::SpecialKey::Enter))) x19c_quitGame = std::make_unique(EQuitType::QuitGame); } else { CPauseScreenBase::ResetMouseState(); diff --git a/Runtime/MP1/CPauseScreen.cpp b/Runtime/MP1/CPauseScreen.cpp index 44ced8985..a09a572d4 100644 --- a/Runtime/MP1/CPauseScreen.cpp +++ b/Runtime/MP1/CPauseScreen.cpp @@ -202,7 +202,7 @@ void CPauseScreen::ProcessControllerInput(const CStateManager& mgr, const CFinal if (InputEnabled()) { bool invalid = x8_curSubscreen == ESubScreen::ToGame; - if (useInput.PStart() || ((useInput.PB() || useInput.PSpecialKey(boo::ESpecialKey::Esc)) && bExits) || + if (useInput.PStart() || ((useInput.PB() || useInput.PSpecialKey(aurora::SpecialKey::Esc)) && bExits) || (x7c_screens[x78_activeIdx] && x7c_screens[x78_activeIdx]->ShouldExitPauseScreen())) { CSfxManager::SfxStart(SFXui_pause_screen_exit, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); StartTransition(0.5f, mgr, ESubScreen::ToGame, 2); diff --git a/Runtime/MP1/CPauseScreenBase.cpp b/Runtime/MP1/CPauseScreenBase.cpp index 0115c5c6d..0f8c6aad6 100644 --- a/Runtime/MP1/CPauseScreenBase.cpp +++ b/Runtime/MP1/CPauseScreenBase.cpp @@ -169,7 +169,7 @@ void CPauseScreenBase::InitializeFrameGlue() { x194_tablegroup_triple->SetMenuSelectionChangeCallback({}); x8_frame.SetMouseUpCallback([this](CGuiWidget* widget, bool cancel) { OnWidgetMouseUp(widget, cancel); }); - x8_frame.SetMouseScrollCallback([this](CGuiWidget* widget, const boo::SScrollDelta& delta, int accumX, int accumY) { + x8_frame.SetMouseScrollCallback([this](CGuiWidget* widget, const SScrollDelta& delta, int accumX, int accumY) { OnWidgetScroll(widget, delta, accumX, accumY); }); } @@ -493,7 +493,7 @@ void CPauseScreenBase::OnWidgetMouseUp(CGuiWidget* widget, bool cancel) { } } -void CPauseScreenBase::OnWidgetScroll(CGuiWidget* widget, const boo::SScrollDelta& delta, int accumX, int accumY) { +void CPauseScreenBase::OnWidgetScroll(CGuiWidget* widget, const SScrollDelta& delta, int accumX, int accumY) { if (!widget || accumY == 0) return; if (widget->GetParent() == x84_tablegroup_rightlog) { diff --git a/Runtime/MP1/CPauseScreenBase.hpp b/Runtime/MP1/CPauseScreenBase.hpp index 085b10c02..508f910d7 100644 --- a/Runtime/MP1/CPauseScreenBase.hpp +++ b/Runtime/MP1/CPauseScreenBase.hpp @@ -99,7 +99,7 @@ protected: void OnRightTableCancel(CGuiTableGroup* caller); void OnWidgetMouseUp(CGuiWidget* widget, bool cancel); - void OnWidgetScroll(CGuiWidget* widget, const boo::SScrollDelta& delta, int accumX, int accumY); + void OnWidgetScroll(CGuiWidget* widget, const SScrollDelta& delta, int accumX, int accumY); public: static std::string GetImagePaneName(size_t i); diff --git a/Runtime/MP1/CPlayerVisor.cpp b/Runtime/MP1/CPlayerVisor.cpp index 97d43b57f..bd0e18671 100644 --- a/Runtime/MP1/CPlayerVisor.cpp +++ b/Runtime/MP1/CPlayerVisor.cpp @@ -479,7 +479,7 @@ void CPlayerVisor::UpdateCurrentVisor(float transFactor) { case CPlayerState::EPlayerVisor::Scan: { zeus::CColor dimColor = zeus::CColor::lerp(g_tweakGuiColors->GetScanVisorHudLightMultiply(), zeus::skWhite, 1.f - transFactor); - x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, dimColor, -1); + x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, dimColor, CAssetId()); break; } default: @@ -501,7 +501,7 @@ void CPlayerVisor::FinishTransitionIn() { case CPlayerState::EPlayerVisor::Scan: { zeus::CColor dimColor = zeus::CColor::lerp(g_tweakGuiColors->GetScanVisorScreenDimColor(), g_tweakGuiColors->GetScanVisorHudLightMultiply(), x2c_scanDimInterp); - x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, dimColor, -1); + x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, dimColor, {}); if (!x5c_visorLoopSfx) x5c_visorLoopSfx = CSfxManager::SfxStart(SFXui_visor_scan_lp, x24_visorSfxVol, 0.f, false, 0x7f, true, kInvalidAreaId); @@ -527,7 +527,7 @@ void CPlayerVisor::BeginTransitionIn(const CStateManager&) { break; case CPlayerState::EPlayerVisor::Scan: CSfxManager::SfxStart(SFXui_into_visor, x24_visorSfxVol, 0.f, false, 0x7f, false, kInvalidAreaId); - x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, zeus::skWhite, -1); + x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, zeus::skWhite, {}); break; case CPlayerState::EPlayerVisor::Thermal: CSfxManager::SfxStart(SFXui_into_visor, x24_visorSfxVol, 0.f, false, 0x7f, false, kInvalidAreaId); @@ -618,7 +618,7 @@ void CPlayerVisor::Update(float dt, const CStateManager& mgr) { } else if (curVisor == CPlayerState::EPlayerVisor::Scan) { zeus::CColor dimColor = zeus::CColor::lerp(g_tweakGuiColors->GetScanVisorScreenDimColor(), g_tweakGuiColors->GetScanVisorHudLightMultiply(), x2c_scanDimInterp); - x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, dimColor, -1); + x64_scanDim.SetFilter(EFilterType::Multiply, EFilterShape::Fullscreen, 0.f, dimColor, {}); } } diff --git a/Runtime/MP1/CQuitGameScreen.cpp b/Runtime/MP1/CQuitGameScreen.cpp index d96b72254..ac8dcce4f 100644 --- a/Runtime/MP1/CQuitGameScreen.cpp +++ b/Runtime/MP1/CQuitGameScreen.cpp @@ -106,7 +106,7 @@ void CQuitGameScreen::ProcessUserInput(const CFinalInput& input) { x10_loadedFrame->ProcessMouseInput( input, CGuiWidgetDrawParms{1.f, zeus::CVector3f{0.f, 0.f, VerticalOffsets[size_t(x0_type)]}}); x10_loadedFrame->ProcessUserInput(input); - if ((input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc)) && x0_type != EQuitType::ContinueFromLastSave) { + if ((input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc)) && x0_type != EQuitType::ContinueFromLastSave) { x18_action = EQuitAction::No; } } diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index f331b89f7..66a90b85e 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -865,7 +865,7 @@ void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr) { } } -void CSamusHud::UpdateHudDamage(float dt, const CStateManager& mgr, DataSpec::ITweakGui::EHelmetVisMode helmetVis) { +void CSamusHud::UpdateHudDamage(float dt, const CStateManager& mgr, Tweaks::ITweakGui::EHelmetVisMode helmetVis) { CPlayer& player = mgr.GetPlayer(); if (player.WasDamaged() && mgr.GetGameState() == CStateManager::EGameState::Running) x3e8_damageTIme += dt; @@ -1008,7 +1008,7 @@ void CSamusHud::UpdateStaticInterference(float dt, const CStateManager& mgr) { if (x510_staticInterp > 0.f) { zeus::CColor color = zeus::skWhite; color.a() = x510_staticInterp; - x51c_camFilter2.SetFilter(EFilterType::Blend, EFilterShape::RandomStatic, 0.f, color, -1); + x51c_camFilter2.SetFilter(EFilterType::Blend, EFilterShape::RandomStatic, 0.f, color, {}); } else { x51c_camFilter2.DisableFilter(0.f); } @@ -1191,7 +1191,7 @@ void CSamusHud::Update(float dt, const CStateManager& mgr, CInGameGuiManager::EH UpdateStaticInterference(dt, mgr); - if (helmetVis != DataSpec::ITweakGui::EHelmetVisMode::ReducedUpdate) { + if (helmetVis != Tweaks::ITweakGui::EHelmetVisMode::ReducedUpdate) { if (x2bc_nextState != EHudState::None) { UpdateEnergy(dt, mgr, false); UpdateFreeLook(dt, mgr); diff --git a/Runtime/MP1/CSamusHud.hpp b/Runtime/MP1/CSamusHud.hpp index f8ca033bb..70350a87c 100644 --- a/Runtime/MP1/CSamusHud.hpp +++ b/Runtime/MP1/CSamusHud.hpp @@ -193,7 +193,7 @@ class CSamusHud { int FindEmptyHudLightSlot(const CLight& light) const; zeus::CColor GetVisorHudLightColor(const zeus::CColor& color, const CStateManager& mgr) const; void UpdateHudDynamicLights(float dt, const CStateManager& mgr); - void UpdateHudDamage(float dt, const CStateManager& mgr, DataSpec::ITweakGui::EHelmetVisMode helmetVis); + void UpdateHudDamage(float dt, const CStateManager& mgr, Tweaks::ITweakGui::EHelmetVisMode helmetVis); void UpdateStaticSfx(CSfxHandle& handle, float& cycleTimer, u16 sfxId, float dt, float oldStaticInterp, float staticThreshold); void UpdateStaticInterference(float dt, const CStateManager& mgr); diff --git a/Runtime/MP1/CSlideShow.cpp b/Runtime/MP1/CSlideShow.cpp index 0e39f11a3..f827c7d7d 100644 --- a/Runtime/MP1/CSlideShow.cpp +++ b/Runtime/MP1/CSlideShow.cpp @@ -30,7 +30,7 @@ CSlideShow::CSlideShow() : CIOWin("SlideShow"), x130_(g_tweakSlideShow->GetX54() xf8_stickTextures.reserve(18); x108_buttonTextures.reserve(8); - SObjectTag txtrTag(FOURCC('TXTR'), 0); + SObjectTag txtrTag(FOURCC('TXTR'), CAssetId()); for (const auto& lStickId : g_tweakPlayerRes->x24_lStick) { txtrTag.id = lStickId; xf8_stickTextures.emplace_back(g_SimplePool->GetObj(txtrTag)); diff --git a/Runtime/MP1/CTweaks.cpp b/Runtime/MP1/CTweaks.cpp index d7767c3be..7a8485c5e 100644 --- a/Runtime/MP1/CTweaks.cpp +++ b/Runtime/MP1/CTweaks.cpp @@ -1,18 +1,18 @@ #include "Runtime/MP1/CTweaks.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakGunRes.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerRes.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakSlideShow.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakGui.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakBall.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakGuiColors.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp" +#include "Runtime/MP1/Tweaks/CTweakGame.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayer.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayerControl.hpp" +#include "Runtime/MP1/Tweaks/CTweakGunRes.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayerRes.hpp" +#include "Runtime/MP1/Tweaks/CTweakSlideShow.hpp" +#include "Runtime/MP1/Tweaks/CTweakAutoMapper.hpp" +#include "Runtime/MP1/Tweaks/CTweakTargeting.hpp" +#include "Runtime/MP1/Tweaks/CTweakGui.hpp" +#include "Runtime/MP1/Tweaks/CTweakParticle.hpp" +#include "Runtime/MP1/Tweaks/CTweakBall.hpp" +#include "Runtime/MP1/Tweaks/CTweakGuiColors.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayerGun.hpp" #include "Runtime/IMain.hpp" #include "Runtime/GameGlobalObjects.hpp" @@ -25,113 +25,116 @@ namespace metaforce::MP1 { static logvisor::Module Log("MP1::CTweaks"); -void CTweaks::RegisterTweaks(hecl::CVarManager* cvarMgr) { +void CTweaks::RegisterTweaks(CVarManager* cvarMgr) { std::optional strm; const SObjectTag* tag; /* Particle */ tag = g_ResFactory->GetResourceIdByName("Particle"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakParticle = new DataSpec::DNAMP1::CTweakParticle(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakParticle = new MP1::CTweakParticle(*strm); g_tweakParticle->initCVars(cvarMgr); /* Player */ tag = g_ResFactory->GetResourceIdByName("Player"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakPlayer = new DataSpec::DNAMP1::CTweakPlayer(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakPlayer = new MP1::CTweakPlayer(*strm); g_tweakPlayer->initCVars(cvarMgr); /* CameraBob */ tag = g_ResFactory->GetResourceIdByName("CameraBob"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); CPlayerCameraBob::ReadTweaks(*strm); /* Ball */ tag = g_ResFactory->GetResourceIdByName("Ball"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakBall = new DataSpec::DNAMP1::CTweakBall(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakBall = new MP1::CTweakBall(*strm); g_tweakBall->initCVars(cvarMgr); /* PlayerGun */ tag = g_ResFactory->GetResourceIdByName("PlayerGun"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakPlayerGun = new DataSpec::DNAMP1::CTweakPlayerGun(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakPlayerGun = new MP1::CTweakPlayerGun(*strm); g_tweakPlayerGun->initCVars(cvarMgr); /* Targeting */ tag = g_ResFactory->GetResourceIdByName("Targeting"); u8* Args = g_ResFactory->LoadResourceSync(*tag).release(); u32 size = g_ResFactory->ResourceSize(*tag); - strm.emplace(Args, size, true); - if (g_Main->IsTrilogy() || g_Main->IsPAL() || g_Main->IsJapanese()) { - g_tweakTargeting = new DataSpec::DNAMP1::CTweakTargeting(*strm); - g_tweakTargeting->initCVars(cvarMgr); - } else { - g_tweakTargeting = new DataSpec::DNAMP1::CTweakTargeting(*strm); - g_tweakTargeting->initCVars(cvarMgr); - } - + strm.emplace(Args, size, CMemoryInStream::EOwnerShip::Owned); + g_tweakTargeting = new MP1::CTweakTargeting(*strm, g_Main->IsTrilogy() || g_Main->IsPAL() || g_Main->IsJapanese()); + g_tweakTargeting->initCVars(cvarMgr); /* Game */ tag = g_ResFactory->GetResourceIdByName("Game"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakGame = new DataSpec::DNAMP1::CTweakGame(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakGame = new MP1::CTweakGame(*strm); g_tweakGame->initCVars(cvarMgr); /* GuiColors */ tag = g_ResFactory->GetResourceIdByName("GuiColors"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakGuiColors = new DataSpec::DNAMP1::CTweakGuiColors(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakGuiColors = new MP1::CTweakGuiColors(*strm); g_tweakGuiColors->initCVars(cvarMgr); /* AutoMapper */ tag = g_ResFactory->GetResourceIdByName("AutoMapper"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakAutoMapper = new DataSpec::DNAMP1::CTweakAutoMapper(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakAutoMapper = new MP1::CTweakAutoMapper(*strm); CMappableObject::ReadAutoMapperTweaks(*g_tweakAutoMapper); g_tweakAutoMapper->initCVars(cvarMgr); /* Gui */ tag = g_ResFactory->GetResourceIdByName("Gui"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakGui = new DataSpec::DNAMP1::CTweakGui(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakGui = new MP1::CTweakGui(*strm); g_tweakPlayerGun->initCVars(cvarMgr); /* PlayerControls */ tag = g_ResFactory->GetResourceIdByName("PlayerControls"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakPlayerControl = new DataSpec::DNAMP1::CTweakPlayerControl(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakPlayerControl = new MP1::CTweakPlayerControl(*strm); /* PlayerControls2 */ tag = g_ResFactory->GetResourceIdByName("PlayerControls2"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakPlayerControlAlt = new DataSpec::DNAMP1::CTweakPlayerControl(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakPlayerControlAlt = new MP1::CTweakPlayerControl(*strm); g_currentPlayerControl = g_tweakPlayerControl; /* SlideShow */ tag = g_ResFactory->GetResourceIdByName("SlideShow"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakSlideShow = new DataSpec::DNAMP1::CTweakSlideShow(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakSlideShow = new MP1::CTweakSlideShow(*strm); g_tweakSlideShow->initCVars(cvarMgr); } -void CTweaks::RegisterResourceTweaks(hecl::CVarManager* cvarMgr) { +void CTweaks::RegisterResourceTweaks(CVarManager* cvarMgr) { std::optional strm; const SObjectTag* tag = g_ResFactory->GetResourceIdByName("GunRes"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - g_tweakGunRes = new DataSpec::DNAMP1::CTweakGunRes(*strm); + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakGunRes = new MP1::CTweakGunRes(*strm); g_tweakGunRes->ResolveResources(*g_ResFactory); g_tweakGunRes->initCVars(cvarMgr); tag = g_ResFactory->GetResourceIdByName("PlayerRes"); - strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true); - if (g_Main->IsTrilogy() || g_Main->IsPAL() || g_Main->IsJapanese()) { - g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm); - } else { - g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm); - } - + strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), + CMemoryInStream::EOwnerShip::Owned); + g_tweakPlayerRes = new MP1::CTweakPlayerRes(*strm, g_Main->IsTrilogy() || g_Main->IsPAL() || g_Main->IsJapanese()); g_tweakPlayerRes->ResolveResources(*g_ResFactory); g_tweakPlayerRes->initCVars(cvarMgr); } diff --git a/Runtime/MP1/CTweaks.hpp b/Runtime/MP1/CTweaks.hpp index 0a0770fa9..7bd4d3ca1 100644 --- a/Runtime/MP1/CTweaks.hpp +++ b/Runtime/MP1/CTweaks.hpp @@ -2,18 +2,15 @@ #include "Runtime/RetroTypes.hpp" -namespace hecl { -class CVarManager; -} - namespace metaforce { +class CVarManager; namespace MP1 { class CTweaks { public: - void RegisterTweaks(hecl::CVarManager* cvarMgr); - void RegisterResourceTweaks(hecl::CVarManager* cvarMgr); + void RegisterTweaks(CVarManager* cvarMgr); + void RegisterResourceTweaks(CVarManager* cvarMgr); }; } // namespace MP1 diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 8a4894d2b..e6179f152 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -64,11 +64,11 @@ #include "Runtime/World/CStateMachine.hpp" #include "Runtime/World/CScriptMazeNode.hpp" -#include -#include -#include -#include -#include +#include "Audio/SFX/Misc.h" +#include "Audio/SFX/MiscSamus.h" +#include "Audio/SFX/UI.h" +#include "Audio/SFX/Weapons.h" +#include "Audio/SFX/ZZZ.h" #include "Runtime/MP1/CCredits.hpp" @@ -76,6 +76,29 @@ #include #endif +#if _WIN32 +inline void* memmem(const void* haystack, size_t hlen, const void* needle, size_t nlen) { + int needle_first; + const uint8_t* p = static_cast(haystack); + size_t plen = hlen; + + if (!nlen) + return NULL; + + needle_first = *(unsigned char*)needle; + + while (plen >= nlen && (p = static_cast(memchr(p, needle_first, plen - nlen + 1)))) { + if (!memcmp(p, needle, nlen)) + return (void*)p; + + p++; + plen = hlen - (p - static_cast(haystack)); + } + + return NULL; +} +#endif + namespace metaforce::MP1 { namespace { struct AudioGroupInfo { @@ -452,7 +475,7 @@ void CMain::EnsureWorldPaksReady() {} void CMain::EnsureWorldPakReady(CAssetId mlvl) { /* TODO: Schedule resource list load for World Pak containing mlvl */ } -void CMain::StreamNewGameState(CBitStreamReader& r, u32 idx) { +void CMain::StreamNewGameState(CInputStream& r, u32 idx) { bool fusionBackup = g_GameState->SystemOptions().GetPlayerFusionSuitActive(); x128_globalObjects->x134_gameState = std::make_unique(r, idx); g_GameState = x128_globalObjects->x134_gameState.get(); @@ -466,7 +489,7 @@ void CMain::RefreshGameState() { u64 cardSerial = g_GameState->GetCardSerial(); std::vector saveData = g_GameState->BackupBuf(); CGameOptions gameOpts = g_GameState->GameOptions(); - CBitStreamReader r(saveData.data(), saveData.size()); + CMemoryInStream r(saveData.data(), saveData.size(), CMemoryInStream::EOwnerShip::NotOwned); x128_globalObjects->StreamInGameState(r, g_GameState->GetFileIdx()); g_GameState->SetPersistentOptions(sysOpts); g_GameState->SetGameOptions(gameOpts); @@ -551,13 +574,14 @@ void CMain::HandleDiscordErrored(int errorCode, const char* message) { DiscordLog.report(logvisor::Error, FMT_STRING("Discord Error: {}"), message); } -void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarManager* cvarMgr, +void CMain::Init(const FileStoreManager& storeMgr, CVarManager* cvarMgr, boo::IAudioVoiceEngine* voiceEngine, amuse::IBackendVoiceAllocator& backend) { InitializeDiscord(); m_cvarMgr = cvarMgr; - m_cvarCommons = std::make_unique(*m_cvarMgr); + m_cvarCommons = std::make_unique(*m_cvarMgr); bool loadedVersion = false; +#if 0 if (CDvdFile::FileExists("version.yaml")) { CDvdFile file("version.yaml"); if (file) { @@ -570,7 +594,9 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana MainLog.report(logvisor::Level::Info, FMT_STRING("Loaded version info")); } } - } else if (CDvdFile::FileExists("default.dol")) { + } else +#endif + if (CDvdFile::FileExists("default.dol")) { CDvdFile file("default.dol"); if (file) { std::unique_ptr buf = std::make_unique(file.Length()); @@ -579,10 +605,10 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana static_cast(memmem(buf.get(), readLen, "MetroidBuildInfo", 16)) + 19; if (buildInfo != nullptr) { // TODO - m_version = DataSpec::MetaforceVersionInfo{ + m_version = MetaforceVersionInfo{ .version = std::string(buildInfo), - .region = DataSpec::ERegion::NTSC_U, - .game = DataSpec::EGame::MetroidPrime1, + .region = ERegion::NTSC_U, + .game = EGame::MetroidPrime1, .isTrilogy = false, }; loadedVersion = true; @@ -616,11 +642,11 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana const char* areaIdxStr = (*(it + 2)).c_str(); char* endptr = nullptr; - m_warpWorldIdx = TAreaId(hecl::StrToUl(worldIdxStr, &endptr, 0)); + m_warpWorldIdx = TAreaId(strtoul(worldIdxStr, &endptr, 0)); if (endptr == worldIdxStr) { m_warpWorldIdx = 0; } - m_warpAreaId = TAreaId(hecl::StrToUl(areaIdxStr, &endptr, 0)); + m_warpAreaId = TAreaId(strtoul(areaIdxStr, &endptr, 0)); if (endptr == areaIdxStr) { m_warpAreaId = 0; } @@ -646,7 +672,7 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana if (*cur == '1') m_warpLayerBits |= u64(1) << (cur - layerStr); } else if (layerStr[0] == '0' && layerStr[1] == 'x') { - m_warpMemoryRelays.emplace_back(TAreaId(hecl::StrToUl(layerStr + 2, nullptr, 16))); + m_warpMemoryRelays.emplace_back(TAreaId(strtoul(layerStr + 2, nullptr, 16))); } ++it; } @@ -660,7 +686,7 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana x164_archSupport = std::make_unique(*this, voiceEngine, backend); g_archSupport = x164_archSupport.get(); x164_archSupport->PreloadAudio(); - std::srand(static_cast(std::time(nullptr))); + std::srand(static_cast(CBasics::GetTime())); // g_TweakManager->ReadFromMemoryCard("AudioTweaks"); } diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index 9edeb4ba9..49a397ae2 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -1,13 +1,9 @@ #pragma once -#ifndef MP1_USE_BOO -#define MP1_USE_BOO 0 -#endif - #include "Runtime/IMain.hpp" #include "Runtime/MP1/CTweaks.hpp" #include "Runtime/MP1/CPlayMovie.hpp" -#include "Runtime/IOStreams.hpp" +#include "Runtime/Streams/IOStreams.hpp" #include "Runtime/CBasics.hpp" #include "Runtime/CMemoryCardSys.hpp" #include "Runtime/CResFactory.hpp" @@ -36,9 +32,9 @@ #include "Runtime/CArchitectureQueue.hpp" #include "Runtime/CTimeProvider.hpp" #include "Runtime/GuiSys/CTextExecuteBuffer.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp" -#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp" -#include "hecl/CVarCommons.hpp" +#include "Runtime/MP1/Tweaks/CTweakPlayer.hpp" +#include "Runtime/MP1/Tweaks/CTweakGame.hpp" +#include "Runtime/ConsoleVariables/CVarCommons.hpp" struct DiscordUser; @@ -108,18 +104,13 @@ public: g_GameState = x134_gameState.get(); } - void StreamInGameState(CBitStreamReader& stream, u32 saveIdx) { + void StreamInGameState(CInputStream& stream, u32 saveIdx) { x134_gameState = std::make_unique(stream, saveIdx); g_GameState = x134_gameState.get(); } }; -#if MP1_USE_BOO -class CGameArchitectureSupport : public boo::IWindowCallback -#else -class CGameArchitectureSupport -#endif -{ +class CGameArchitectureSupport { friend class CMain; CMain& m_parent; CArchitectureQueue x4_archQueue; @@ -133,12 +124,12 @@ class CGameArchitectureSupport EAudioLoadStatus x88_audioLoadStatus = EAudioLoadStatus::Uninitialized; std::vector> x8c_pendingAudioGroups; - boo::SWindowRect m_windowRect; + aurora::WindowSize m_windowRect; bool m_rectIsDirty = false; void destroyed() { x4_archQueue.Push(MakeMsg::CreateRemoveAllIOWins(EArchMsgTarget::IOWinManager)); } - void resized(const boo::SWindowRect& rect) { + void resized(const aurora::WindowSize& rect) { m_windowRect = rect; m_rectIsDirty = true; } @@ -147,17 +138,15 @@ public: CGameArchitectureSupport(CMain& parent, boo::IAudioVoiceEngine* voiceEngine, amuse::IBackendVoiceAllocator& backend); ~CGameArchitectureSupport(); - void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) { + void mouseDown(const SWindowCoord& coord, EMouseButton button, EModifierKey mods) { x30_inputGenerator.mouseDown(coord, button, mods); } - void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) { + void mouseUp(const SWindowCoord& coord, EMouseButton button, EModifierKey mods) { x30_inputGenerator.mouseUp(coord, button, mods); } - void mouseMove(const boo::SWindowCoord& coord) { x30_inputGenerator.mouseMove(coord); } - void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll) { - x30_inputGenerator.scroll(coord, scroll); - } - void charKeyDown(uint8_t charCode, aurora::ModifierKey mods, bool isRepeat); + void mouseMove(const SWindowCoord& coord) { x30_inputGenerator.mouseMove(coord); } + void scroll(const SWindowCoord& coord, const SScrollDelta& scroll) { x30_inputGenerator.scroll(coord, scroll); } + void charKeyDown(uint8_t charCode, aurora::ModifierKey mods, bool isRepeat); void charKeyUp(uint8_t charCode, aurora::ModifierKey mods) { x30_inputGenerator.charKeyUp(charCode, mods); } void specialKeyDown(aurora::SpecialKey key, aurora::ModifierKey mods, bool isRepeat); @@ -173,7 +162,7 @@ public: void Draw(); bool isRectDirty() const { return m_rectIsDirty; } - const boo::SWindowRect& getWindowRect() { + const aurora::WindowSize& getWindowRect() { m_rectIsDirty = false; return m_windowRect; } @@ -181,25 +170,9 @@ public: CIOWinManager& GetIOWinManager() { return x58_ioWinManager; } }; -#if MP1_USE_BOO -class CMain : public boo::IApplicationCallback, - public IMain -#else -class CMain : public IMain -#endif -{ +class CMain : public IMain { friend class CGameArchitectureSupport; -#if MP1_USE_BOO - boo::IWindow* mainWindow; - int appMain(boo::IApplication* app); - void appQuitting(boo::IApplication*) { xe8_b24_finished = true; } - void appFilesOpen(boo::IApplication*, const std::vector& paths) { - fmt::print(stderr, FMT_STRING("OPENING: ")); - for (const std::string& path : paths) - fprintf(stderr, "%s ", path.c_str()); - fprintf(stderr, "\n"); - } -#endif + private: struct BooSetter { BooSetter(); @@ -243,9 +216,9 @@ private: std::unique_ptr x164_archSupport; // boo::IWindow* m_mainWindow = nullptr; - hecl::CVarManager* m_cvarMgr = nullptr; - std::unique_ptr m_cvarCommons; -// std::unique_ptr m_console; + CVarManager* m_cvarMgr = nullptr; + std::unique_ptr m_cvarCommons; +// std::unique_ptr m_console; // Warmup state std::vector m_warmupTags; std::vector::iterator m_warmupIt; @@ -253,7 +226,7 @@ private: bool m_loadedPersistentResources = false; bool m_doQuit = false; bool m_paused = false; - DataSpec::MetaforceVersionInfo m_version; + MetaforceVersionInfo m_version; void InitializeSubsystems(); static void InitializeDiscord(); @@ -268,7 +241,7 @@ public: void AddWorldPaks(); void AddOverridePaks(); void ResetGameState(); - void StreamNewGameState(CBitStreamReader&, u32 idx); + void StreamNewGameState(CInputStream&, u32 idx); void RefreshGameState(); void CheckTweakManagerDebugOptions() {} void SetMFGameBuilt(bool b) { x160_25_mfGameBuilt = b; } @@ -279,8 +252,8 @@ public: // int RsMain(int argc, char** argv, boo::IAudioVoiceEngine* voiceEngine, amuse::IBackendVoiceAllocator& // backend); - void Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarManager* cvarManager, - boo::IAudioVoiceEngine* voiceEngine, amuse::IBackendVoiceAllocator& backend) override; + void Init(const FileStoreManager& storeMgr, CVarManager* cvarManager, boo::IAudioVoiceEngine* voiceEngine, + amuse::IBackendVoiceAllocator& backend) override; void WarmupShaders() override; bool Proc(float dt) override; void Draw() override; diff --git a/Runtime/MP1/Tweaks/CTweakAutoMapper.cpp b/Runtime/MP1/Tweaks/CTweakAutoMapper.cpp new file mode 100644 index 000000000..d8d52890c --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakAutoMapper.cpp @@ -0,0 +1,243 @@ +#include "Runtime/MP1/Tweaks/CTweakAutoMapper.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +#include "Runtime/ConsoleVariables/CVar.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" + +#define PREFIX(v) std::string_view("tweak.automap." #v) +namespace metaforce::MP1 { +namespace { +constexpr std::string_view skShowOneMiniMapArea = PREFIX(ShowOneMiniMapArea); +constexpr std::string_view skScaleMoveSpeedWithCamDist = PREFIX(ScaleMoveSpeedWithCamDist); +constexpr std::string_view skCamDist = PREFIX(CamDist); +constexpr std::string_view skMinCameraDist = PREFIX(MinCamDist); +constexpr std::string_view skMaxCamDist = PREFIX(MaxCamDist); +constexpr std::string_view skMinCamRotX = PREFIX(MinCamRotX); +constexpr std::string_view skMaxCamRotX = PREFIX(MaxCamRotX); +constexpr std::string_view skCamAngle = PREFIX(CamAngle); +constexpr std::string_view skWidgetColor = PREFIX(WidgetColor); +constexpr std::string_view skMiniCamDist = PREFIX(MiniCamDist); +constexpr std::string_view skMiniCamXAngle = PREFIX(MiniCamXAngle); +constexpr std::string_view skMiniCamAngle = PREFIX(MiniCamAngle); +constexpr std::string_view skVisitedSurfaceColor = PREFIX(VisitedSurfaceColor); +constexpr std::string_view skVisitedOutlineColor = PREFIX(VisitedOutlineColor); +constexpr std::string_view skUnvisitedSurfaceColor = PREFIX(UnvisitedSurfaceColor); +constexpr std::string_view skUnvisitedOutlineColor = PREFIX(UnvisitedOutlineColor); +constexpr std::string_view skSelectedVisitedSurfaceColor = PREFIX(SelectedVisitedSurfaceColor); +constexpr std::string_view skSelectedVisitedOutlineColor = PREFIX(SelectedVisitedOutlineColor); +constexpr std::string_view skMapSurfaceNormalColorLinear = PREFIX(MapSurfaceNormalColorLinear); +constexpr std::string_view skMapSurfaceNormalColorConstant = PREFIX(MapSurfaceNormalColorConstant); +CVar* tw_showOneMiniMapArea = nullptr; +CVar* tw_scaleMoveSpeedWithCamDist = nullptr; +CVar* tw_camDist = nullptr; +CVar* tw_minCamDist = nullptr; +CVar* tw_maxCamDist = nullptr; +CVar* tw_minCamRotX = nullptr; +CVar* tw_maxCamRotX = nullptr; +CVar* tw_camAngle = nullptr; +CVar* tw_widgetColor = nullptr; +CVar* tw_miniCamDist = nullptr; +CVar* tw_miniCamXAngle = nullptr; +CVar* tw_miniCamAngle = nullptr; +CVar* tw_visitedsurfaceColor = nullptr; +CVar* tw_visitedOutlineColor = nullptr; +CVar* tw_unvisitedSurfaceColor = nullptr; +CVar* tw_unvisitedOutlineColor = nullptr; +CVar* tw_selectedVisitedSurfaceColor = nullptr; +CVar* tw_selectedVisitedOutlineColor = nullptr; +CVar* tw_mapSurfaceNormColorLinear = nullptr; +CVar* tw_mapSurfaceNormColorConstant = nullptr; +} // namespace + +CTweakAutoMapper::CTweakAutoMapper(CInputStream& in) { + x4_24_showOneMiniMapArea = in.ReadBool(); + x4_25_ = in.ReadBool(); + x4_26_scaleMoveSpeedWithCamDist = in.ReadBool(); + x8_camDist = in.ReadFloat(); + xc_minCamDist = in.ReadFloat(); + x10_maxCamDist = in.ReadFloat(); + x14_minCamRotateX = in.ReadFloat(); + x18_maxCamRotateX = in.ReadFloat(); + x1c_camAngle = in.ReadFloat(); + x20_ = in.ReadFloat(); + x24_automapperWidgetColor = in.Get(); + x28_miniCamDist = in.ReadFloat(); + x2c_miniCamXAngle = in.ReadFloat(); + x30_miniCamAngle = in.ReadFloat(); + x34_ = in.ReadFloat(); + x38_automapperWidgetMiniColor = in.Get(); + x3c_surfColorVisited = in.Get(); + x40_outlineColorVisited = in.Get(); + x44_surfColorUnvisited = in.Get(); + x48_outlineColorUnvisited = in.Get(); + x4c_surfaceSelectColorVisited = in.Get(); + x50_outlineSelectColorVisited = in.Get(); + x54_mapSurfaceNormColorLinear = in.ReadFloat(); + x58_mapSurfaceNormColorConstant = in.ReadFloat(); + x5c_ = in.ReadFloat(); + x64_openMapScreenTime = in.ReadFloat(); + x68_closeMapScreenTime = in.ReadFloat(); + x6c_hintPanTime = in.ReadFloat(); + x70_zoomUnitsPerFrame = in.ReadFloat(); + x74_rotateDegPerFrame = in.ReadFloat(); + x78_baseMapScreenCameraMoveSpeed = in.ReadFloat(); + x7c_surfaceSelectColorUnvisited = in.Get(); + x80_outlineSelectColorUnvisited = in.Get(); + x84_miniAlphaSurfaceVisited = in.ReadFloat(); + x88_alphaSurfaceVisited = in.ReadFloat(); + x8c_miniAlphaOutlineVisited = in.ReadFloat(); + x90_alphaOutlineVisited = in.ReadFloat(); + x94_miniAlphaSurfaceUnvisited = in.ReadFloat(); + x98_alphaSurfaceUnvisited = in.ReadFloat(); + x9c_miniAlphaOutlineUnvisited = in.ReadFloat(); + xa0_alphaOutlineUnvisited = in.ReadFloat(); + xa4_doorCenter = in.Get(); + xb0_ = in.ReadFloat(); + xb4_ = in.ReadFloat(); + xb8_miniMapViewportWidth = in.ReadFloat(); + xbc_miniMapViewportHeight = in.ReadFloat(); + xc0_miniMapCamDistScale = in.ReadFloat(); + xc4_mapPlaneScaleX = in.ReadFloat(); + xc8_mapPlaneScaleZ = in.ReadFloat(); + xcc_ = in.ReadBool(); + xd0_universeCamDist = in.ReadFloat(); + xd4_minUniverseCamDist = in.ReadFloat(); + xd8_maxUniverseCamDist = in.ReadFloat(); + xdc_switchToFromUniverseTime = in.ReadFloat(); + xe0_camPanUnitsPerFrame = in.ReadFloat(); + xe4_automapperScaleX = in.ReadFloat(); + xe8_automapperScaleZ = in.ReadFloat(); + xec_camVerticalOffset = in.ReadFloat(); + xf0_miniMapSamusModColor = in.Get(); + xf4_areaFlashPulseColor = in.Get(); + xf8_ = in.Get(); + xfc_ = in.Get(); + read_reserved_vector(x100_doorColors, in); + x118_doorBorderColor = in.Get(); + x11c_openDoorColor = in.Get(); +} +void CTweakAutoMapper::_tweakListener(CVar* cv) { + if (cv == tw_showOneMiniMapArea) { + x4_24_showOneMiniMapArea = cv->toBoolean(); + } else if (cv == tw_scaleMoveSpeedWithCamDist) { + x4_26_scaleMoveSpeedWithCamDist = cv->toBoolean(); + } else if (cv == tw_camDist) { + x8_camDist = cv->toReal(); + } else if (cv == tw_minCamDist) { + xc_minCamDist = cv->toReal(); + } else if (cv == tw_maxCamDist) { + x10_maxCamDist = cv->toReal(); + } else if (cv == tw_minCamRotX) { + x14_minCamRotateX = cv->toReal(); + } else if (cv == tw_maxCamRotX) { + x18_maxCamRotateX = cv->toReal(); + } else if (cv == tw_camAngle) { + x1c_camAngle = cv->toReal(); + } else if (cv == tw_widgetColor) { + x24_automapperWidgetColor = zeus::CColor(cv->toVec4f()); + } else if (cv == tw_miniCamDist) { + x28_miniCamDist = cv->toReal(); + } else if (cv == tw_miniCamXAngle) { + x2c_miniCamXAngle = tw_miniCamXAngle->toReal(); + } else if (cv == tw_miniCamAngle) { + x30_miniCamAngle = tw_miniCamAngle->toReal(); + } else if (cv == tw_visitedsurfaceColor) { + x3c_surfColorVisited = zeus::CColor(tw_visitedsurfaceColor->toVec4f()); + } else if (cv == tw_visitedOutlineColor) { + x40_outlineColorVisited = zeus::CColor(tw_visitedOutlineColor->toVec4f()); + } else if (cv == tw_unvisitedSurfaceColor) { + x44_surfColorUnvisited = zeus::CColor(tw_unvisitedSurfaceColor->toVec4f()); + } else if (cv == tw_unvisitedOutlineColor) { + x48_outlineColorUnvisited = zeus::CColor(tw_unvisitedOutlineColor->toVec4f()); + } else if (cv == tw_selectedVisitedSurfaceColor) { + x4c_surfaceSelectColorVisited = zeus::CColor(tw_selectedVisitedSurfaceColor->toVec4f()); + } else if (cv == tw_selectedVisitedOutlineColor) { + x50_outlineSelectColorVisited = zeus::CColor(tw_selectedVisitedOutlineColor->toVec4f()); + } else if (cv == tw_mapSurfaceNormColorLinear) { + x54_mapSurfaceNormColorLinear = tw_mapSurfaceNormColorLinear->toReal(); + } else if (cv == tw_mapSurfaceNormColorConstant) { + x58_mapSurfaceNormColorConstant = tw_mapSurfaceNormColorConstant->toReal(); + } +} + +void CTweakAutoMapper::initCVars(CVarManager* mgr) { + auto assignBool = [this, mgr](std::string_view name, std::string_view desc, bool& v, CVar::EFlags flags) { + CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags); + // Check if the CVar was deserialized, this avoid an unnecessary conversion + if (cv->wasDeserialized()) + v = cv->toBoolean(); + cv->addListener([this](CVar* cv) { _tweakListener(cv); }); + return cv; + }; + + auto assignRealValue = [this, mgr](std::string_view name, std::string_view desc, float& v, CVar::EFlags flags) { + CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags); + // Check if the CVar was deserialized, this avoid an unnecessary conversion + if (cv->wasDeserialized()) + v = cv->toReal(); + cv->addListener([this](CVar* cv) { _tweakListener(cv); }); + return cv; + }; + + auto assignColorValue = [this, mgr](std::string_view name, std::string_view desc, zeus::CColor& v, + CVar::EFlags flags) { + zeus::CVector4f vec = v; + CVar* cv = mgr->findOrMakeCVar(name, desc, vec, flags | CVar::EFlags::Color); + // Check if the CVar was deserialized, this avoid an unnecessary conversion + if (cv->wasDeserialized()) + v = zeus::CColor(cv->toVec4f()); + cv->addListener([this](CVar* cv) { _tweakListener(cv); }); + return cv; + }; + + tw_showOneMiniMapArea = assignBool(skShowOneMiniMapArea, "", x4_24_showOneMiniMapArea, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_scaleMoveSpeedWithCamDist = assignBool(skScaleMoveSpeedWithCamDist, "", x4_26_scaleMoveSpeedWithCamDist, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_camDist = + assignRealValue(skCamDist, "", x8_camDist, CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_minCamDist = assignRealValue(skMinCameraDist, "", xc_minCamDist, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_maxCamDist = + assignRealValue(skMaxCamDist, "", x10_maxCamDist, CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_minCamRotX = assignRealValue(skMinCamRotX, "", x14_minCamRotateX, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_maxCamRotX = assignRealValue(skMaxCamRotX, "", x18_maxCamRotateX, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_camAngle = + assignRealValue(skCamAngle, "", x1c_camAngle, CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_widgetColor = assignColorValue(skWidgetColor, "", x24_automapperWidgetColor, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_miniCamDist = assignRealValue(skMiniCamDist, "", x28_miniCamDist, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_miniCamXAngle = assignRealValue(skMiniCamXAngle, "", x2c_miniCamXAngle, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_miniCamAngle = assignRealValue(skMiniCamAngle, "", x30_miniCamAngle, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_widgetColor = assignColorValue(skWidgetColor, "", x38_automapperWidgetMiniColor, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_visitedsurfaceColor = + assignColorValue(skVisitedSurfaceColor, "", x3c_surfColorVisited, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_visitedOutlineColor = + assignColorValue(skVisitedOutlineColor, "", x40_outlineColorVisited, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_unvisitedSurfaceColor = + assignColorValue(skUnvisitedSurfaceColor, "", x44_surfColorUnvisited, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_unvisitedOutlineColor = assignColorValue(skUnvisitedOutlineColor, "", x48_outlineColorUnvisited, + CVar::EFlags::Game | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_selectedVisitedSurfaceColor = + assignColorValue(skSelectedVisitedSurfaceColor, "", x4c_surfaceSelectColorVisited, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_selectedVisitedOutlineColor = + assignColorValue(skSelectedVisitedOutlineColor, "", x50_outlineSelectColorVisited, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_mapSurfaceNormColorLinear = + assignRealValue(skMapSurfaceNormalColorLinear, "", x54_mapSurfaceNormColorLinear, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); + tw_mapSurfaceNormColorConstant = + assignRealValue(skMapSurfaceNormalColorConstant, "", x58_mapSurfaceNormColorConstant, + CVar::EFlags::Game | CVar::EFlags::Color | CVar::EFlags::Gui | CVar::EFlags::Archive); +} +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakAutoMapper.hpp b/Runtime/MP1/Tweaks/CTweakAutoMapper.hpp new file mode 100644 index 000000000..1952aed91 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakAutoMapper.hpp @@ -0,0 +1,139 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakAutoMapper.hpp" + +#include "Runtime/rstl.hpp" + +namespace metaforce::MP1 { +struct CTweakAutoMapper final : public Tweaks::ITweakAutoMapper { + bool x4_24_showOneMiniMapArea; // : 1; + bool x4_25_; // : 1; + bool x4_26_scaleMoveSpeedWithCamDist; // : 1; + float x8_camDist; + float xc_minCamDist; + float x10_maxCamDist; + float x14_minCamRotateX; + float x18_maxCamRotateX; + float x1c_camAngle; + float x20_; + zeus::CColor x24_automapperWidgetColor; + float x28_miniCamDist; + float x2c_miniCamXAngle; + float x30_miniCamAngle; + float x34_; + zeus::CColor x38_automapperWidgetMiniColor; + zeus::CColor x3c_surfColorVisited; + zeus::CColor x40_outlineColorVisited; + zeus::CColor x44_surfColorUnvisited; + zeus::CColor x48_outlineColorUnvisited; + zeus::CColor x4c_surfaceSelectColorVisited; + zeus::CColor x50_outlineSelectColorVisited; + float x54_mapSurfaceNormColorLinear; + float x58_mapSurfaceNormColorConstant; + float x5c_; + float x60_ = 0.4f; + float x64_openMapScreenTime; + float x68_closeMapScreenTime; + float x6c_hintPanTime; + float x70_zoomUnitsPerFrame; + float x74_rotateDegPerFrame; + float x78_baseMapScreenCameraMoveSpeed; + zeus::CColor x7c_surfaceSelectColorUnvisited; + zeus::CColor x80_outlineSelectColorUnvisited; + float x84_miniAlphaSurfaceVisited; + float x88_alphaSurfaceVisited; + float x8c_miniAlphaOutlineVisited; + float x90_alphaOutlineVisited; + float x94_miniAlphaSurfaceUnvisited; + float x98_alphaSurfaceUnvisited; + float x9c_miniAlphaOutlineUnvisited; + float xa0_alphaOutlineUnvisited; + /* Originally 4 separate floats */ + zeus::CVector3f xa4_doorCenter; + float xb0_; + float xb4_; + float xb8_miniMapViewportWidth; + float xbc_miniMapViewportHeight; + float xc0_miniMapCamDistScale; + float xc4_mapPlaneScaleX; + float xc8_mapPlaneScaleZ; + bool xcc_; + float xd0_universeCamDist; + float xd4_minUniverseCamDist; + float xd8_maxUniverseCamDist; + float xdc_switchToFromUniverseTime; + float xe0_camPanUnitsPerFrame; + float xe4_automapperScaleX; + float xe8_automapperScaleZ; + float xec_camVerticalOffset; + zeus::CColor xf0_miniMapSamusModColor; + zeus::CColor xf4_areaFlashPulseColor; + zeus::CColor xf8_; + zeus::CColor xfc_; + rstl::reserved_vector x100_doorColors; + zeus::CColor x118_doorBorderColor; + zeus::CColor x11c_openDoorColor; + + CTweakAutoMapper() = default; + CTweakAutoMapper(CInputStream& r); + bool GetShowOneMiniMapArea() const override { return x4_24_showOneMiniMapArea; } + bool GetScaleMoveSpeedWithCamDist() const override { return x4_26_scaleMoveSpeedWithCamDist; } + float GetCamDist() const override { return x8_camDist; } + float GetMinCamDist() const override { return xc_minCamDist; } + float GetMaxCamDist() const override { return x10_maxCamDist; } + float GetMinCamRotateX() const override { return x14_minCamRotateX; } + float GetMaxCamRotateX() const override { return x18_maxCamRotateX; } + float GetCamAngle() const override { return x1c_camAngle; } + const zeus::CColor& GetAutomapperWidgetColor() const override { return x24_automapperWidgetColor; } + float GetMiniCamDist() const override { return x28_miniCamDist; } + float GetMiniCamXAngle() const override { return x2c_miniCamXAngle; } + float GetMiniCamAngle() const override { return x30_miniCamAngle; } + const zeus::CColor& GetAutomapperWidgetMiniColor() const override { return x38_automapperWidgetMiniColor; } + const zeus::CColor& GetSurfaceVisitedColor() const override { return x3c_surfColorVisited; } + const zeus::CColor& GetOutlineVisitedColor() const override { return x40_outlineColorVisited; } + const zeus::CColor& GetSurfaceUnvisitedColor() const override { return x44_surfColorUnvisited; } + const zeus::CColor& GetOutlineUnvisitedColor() const override { return x48_outlineColorUnvisited; } + const zeus::CColor& GetSurfaceSelectVisitedColor() const override { return x4c_surfaceSelectColorVisited; } + const zeus::CColor& GetOutlineSelectVisitedColor() const override { return x50_outlineSelectColorVisited; } + float GetMapSurfaceNormColorLinear() const override { return x54_mapSurfaceNormColorLinear; } + float GetMapSurfaceNormColorConstant() const override { return x58_mapSurfaceNormColorConstant; } + float GetOpenMapScreenTime() const override { return x64_openMapScreenTime; } + float GetCloseMapScreenTime() const override { return x68_closeMapScreenTime; } + float GetHintPanTime() const override { return x6c_hintPanTime; } + float GetCamZoomUnitsPerFrame() const override { return x70_zoomUnitsPerFrame; } + float GetCamRotateDegreesPerFrame() const override { return x74_rotateDegPerFrame; } + float GetBaseMapScreenCameraMoveSpeed() const override { return x78_baseMapScreenCameraMoveSpeed; } + const zeus::CColor& GetSurfaceSelectUnvisitedColor() const override { return x7c_surfaceSelectColorUnvisited; } + const zeus::CColor& GetOutlineSelectUnvisitedColor() const override { return x80_outlineSelectColorUnvisited; } + float GetMiniAlphaSurfaceVisited() const override { return x84_miniAlphaSurfaceVisited; } + float GetAlphaSurfaceVisited() const override { return x88_alphaSurfaceVisited; } + float GetMiniAlphaOutlineVisited() const override { return x8c_miniAlphaOutlineVisited; } + float GetAlphaOutlineVisited() const override { return x90_alphaOutlineVisited; } + float GetMiniAlphaSurfaceUnvisited() const override { return x94_miniAlphaSurfaceUnvisited; } + float GetAlphaSurfaceUnvisited() const override { return x98_alphaSurfaceUnvisited; } + float GetMiniAlphaOutlineUnvisited() const override { return x9c_miniAlphaOutlineUnvisited; } + float GetAlphaOutlineUnvisited() const override { return xa0_alphaOutlineUnvisited; } + const zeus::CVector3f& GetDoorCenter() const override { return xa4_doorCenter; } + float GetMiniMapViewportWidth() const override { return xb8_miniMapViewportWidth; } + float GetMiniMapViewportHeight() const override { return xbc_miniMapViewportHeight; } + float GetMiniMapCamDistScale() const override { return xc0_miniMapCamDistScale; } + float GetMapPlaneScaleX() const override { return xc4_mapPlaneScaleX; } + float GetMapPlaneScaleZ() const override { return xc8_mapPlaneScaleZ; } + float GetUniverseCamDist() const override { return xd0_universeCamDist; } + float GetMinUniverseCamDist() const override { return xd4_minUniverseCamDist; } + float GetMaxUniverseCamDist() const override { return xd8_maxUniverseCamDist; } + float GetSwitchToFromUniverseTime() const override { return xdc_switchToFromUniverseTime; } + float GetCamPanUnitsPerFrame() const override { return xe0_camPanUnitsPerFrame; } + float GetAutomapperScaleX() const override { return xe4_automapperScaleX; } + float GetAutomapperScaleZ() const override { return xe8_automapperScaleZ; } + float GetCamVerticalOffset() const override { return xec_camVerticalOffset; } + const zeus::CColor& GetMiniMapSamusModColor() const override { return xf0_miniMapSamusModColor; } + const zeus::CColor& GetAreaFlashPulseColor() const override { return xf4_areaFlashPulseColor; } + const zeus::CColor& GetDoorColor(int idx) const override { return x100_doorColors[idx]; } + const zeus::CColor& GetOpenDoorColor() const override { return x11c_openDoorColor; } + void initCVars(CVarManager*) override; + +private: + void _tweakListener(CVar* cv); +}; +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakBall.cpp b/Runtime/MP1/Tweaks/CTweakBall.cpp new file mode 100644 index 000000000..8c66ac43e --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakBall.cpp @@ -0,0 +1,462 @@ +#include "Runtime/MP1/Tweaks/CTweakBall.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakBall::CTweakBall(CInputStream& in) { + LoadTweaks(in); + x6c_ = -x6c_; + x70_ = -x70_; + x74_ballCameraAnglePerSecond = zeus::degToRad(x74_ballCameraAnglePerSecond); + x90_ = zeus::degToRad(x90_); + xe4_ballGravity = -xe4_ballGravity; + xe8_ballWaterGravity = -xe8_ballWaterGravity; + x15c_ = zeus::degToRad(x15c_); + x16c_ = zeus::degToRad(x16c_); + x174_ = zeus::degToRad(x174_); + x17c_ballCameraChaseDampenAngle = zeus::degToRad(x17c_ballCameraChaseDampenAngle); + x184_ballCameraChaseYawSpeed = zeus::degToRad(x184_ballCameraChaseYawSpeed); + x188_ballCameraChaseAnglePerSecond = zeus::degToRad(x188_ballCameraChaseAnglePerSecond); + x1a8_ballCameraBoostDampenAngle = zeus::degToRad(x1a8_ballCameraBoostDampenAngle); + x1b0_ballCameraBoostYawSpeed = zeus::degToRad(x1b0_ballCameraBoostYawSpeed); + x1b4_ballCameraBoostAnglePerSecond = zeus::degToRad(x1b4_ballCameraBoostAnglePerSecond); + x1ec_maxLeanAngle = zeus::degToRad(x1ec_maxLeanAngle); +} + +void CTweakBall::LoadTweaks(CInputStream& in) { + /* x4_maxTranslationAcceleration[0] */ + x4_maxTranslationAcceleration[0] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[1] */ + x4_maxTranslationAcceleration[1] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[2] */ + x4_maxTranslationAcceleration[2] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[3] */ + x4_maxTranslationAcceleration[3] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[4] */ + x4_maxTranslationAcceleration[4] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[5] */ + x4_maxTranslationAcceleration[5] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[6] */ + x4_maxTranslationAcceleration[6] = in.ReadFloat(); + /* x4_maxTranslationAcceleration[7] */ + x4_maxTranslationAcceleration[7] = in.ReadFloat(); + /* x24_translationFriction[0] */ + x24_translationFriction[0] = in.ReadFloat(); + /* x24_translationFriction[1] */ + x24_translationFriction[1] = in.ReadFloat(); + /* x24_translationFriction[2] */ + x24_translationFriction[2] = in.ReadFloat(); + /* x24_translationFriction[3] */ + x24_translationFriction[3] = in.ReadFloat(); + /* x24_translationFriction[4] */ + x24_translationFriction[4] = in.ReadFloat(); + /* x24_translationFriction[5] */ + x24_translationFriction[5] = in.ReadFloat(); + /* x24_translationFriction[6] */ + x24_translationFriction[6] = in.ReadFloat(); + /* x24_translationFriction[7] */ + x24_translationFriction[7] = in.ReadFloat(); + /* x44_translationMaxSpeed[0] */ + x44_translationMaxSpeed[0] = in.ReadFloat(); + /* x44_translationMaxSpeed[1] */ + x44_translationMaxSpeed[1] = in.ReadFloat(); + /* x44_translationMaxSpeed[2] */ + x44_translationMaxSpeed[2] = in.ReadFloat(); + /* x44_translationMaxSpeed[3] */ + x44_translationMaxSpeed[3] = in.ReadFloat(); + /* x44_translationMaxSpeed[4] */ + x44_translationMaxSpeed[4] = in.ReadFloat(); + /* x44_translationMaxSpeed[5] */ + x44_translationMaxSpeed[5] = in.ReadFloat(); + /* x44_translationMaxSpeed[6] */ + x44_translationMaxSpeed[6] = in.ReadFloat(); + /* x44_translationMaxSpeed[7] */ + x44_translationMaxSpeed[7] = in.ReadFloat(); + /* x64_ */ + x64_ = in.ReadFloat(); + /* x68_ */ + x68_ = in.ReadFloat(); + /* x6c_ */ + x6c_ = in.ReadFloat(); + /* x70_ */ + x70_ = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[0] */ + xc4_ballForwardBrakingAcceleration[0] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[1] */ + xc4_ballForwardBrakingAcceleration[1] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[2] */ + xc4_ballForwardBrakingAcceleration[2] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[3] */ + xc4_ballForwardBrakingAcceleration[3] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[4] */ + xc4_ballForwardBrakingAcceleration[4] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[5] */ + xc4_ballForwardBrakingAcceleration[5] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[6] */ + xc4_ballForwardBrakingAcceleration[6] = in.ReadFloat(); + /* xc4_ballForwardBrakingAcceleration[7] */ + xc4_ballForwardBrakingAcceleration[7] = in.ReadFloat(); + /* xe4_ballGravity */ + xe4_ballGravity = in.ReadFloat(); + /* xe8_ballWaterGravity */ + xe8_ballWaterGravity = in.ReadFloat(); + /* x14c_ */ + x14c_ = in.ReadFloat(); + /* x150_ */ + x150_ = in.ReadFloat(); + /* x158_ */ + x158_ = in.ReadFloat(); + /* x1dc_minimumAlignmentSpeed */ + x1dc_minimumAlignmentSpeed = in.ReadFloat(); + /* x1e0_tireness */ + x1e0_tireness = in.ReadFloat(); + /* x1ec_maxLeanAngle */ + x1ec_maxLeanAngle = in.ReadFloat(); + /* x1f0_tireToMarbleThresholdSpeed */ + x1f0_tireToMarbleThresholdSpeed = in.ReadFloat(); + /* x1f4_marbleToTireThresholdSpeed */ + x1f4_marbleToTireThresholdSpeed = in.ReadFloat(); + /* x1f8_forceToLeanGain */ + x1f8_forceToLeanGain = in.ReadFloat(); + /* x1fc_leanTrackingGain */ + x1fc_leanTrackingGain = in.ReadFloat(); + /* x74_ballCameraAnglePerSecond */ + x74_ballCameraAnglePerSecond = in.ReadFloat(); + /* x78_ballCameraOffset */ + x78_ballCameraOffset = in.Get(); + /* x84_ballCameraMinSpeedDistance */ + x84_ballCameraMinSpeedDistance = in.ReadFloat(); + /* x88_ballCameraMaxSpeedDistance */ + x88_ballCameraMaxSpeedDistance = in.ReadFloat(); + /* x8c_ballCameraBackwardsDistance */ + x8c_ballCameraBackwardsDistance = in.ReadFloat(); + /* x90_ */ + x90_ = in.ReadFloat(); + /* x94_ballCameraSpringConstant */ + x94_ballCameraSpringConstant = in.ReadFloat(); + /* x98_ballCameraSpringMax */ + x98_ballCameraSpringMax = in.ReadFloat(); + /* x9c_ballCameraSpringTardis */ + x9c_ballCameraSpringTardis = in.ReadFloat(); + /* xa0_ballCameraCentroidSpringConstant */ + xa0_ballCameraCentroidSpringConstant = in.ReadFloat(); + /* xa4_ballCameraCentroidSpringMax */ + xa4_ballCameraCentroidSpringMax = in.ReadFloat(); + /* xa8_ballCameraCentroidSpringTardis */ + xa8_ballCameraCentroidSpringTardis = in.ReadFloat(); + /* xac_ballCameraCentroidDistanceSpringConstant */ + xac_ballCameraCentroidDistanceSpringConstant = in.ReadFloat(); + /* xb0_ballCameraCentroidDistanceSpringMax */ + xb0_ballCameraCentroidDistanceSpringMax = in.ReadFloat(); + /* xb4_ballCameraCentroidDistanceSpringTardis */ + xb4_ballCameraCentroidDistanceSpringTardis = in.ReadFloat(); + /* xb8_ballCameraLookAtSpringConstant */ + xb8_ballCameraLookAtSpringConstant = in.ReadFloat(); + /* xbc_ballCameraLookAtSpringMax */ + xbc_ballCameraLookAtSpringMax = in.ReadFloat(); + /* xc0_ballCameraLookAtSpringTardis */ + xc0_ballCameraLookAtSpringTardis = in.ReadFloat(); + /* x154_ */ + x154_ = in.ReadFloat(); + /* x15c_ */ + x15c_ = in.ReadFloat(); + /* x160_ */ + x160_ = in.ReadFloat(); + /* x164_ */ + x164_ = in.ReadFloat(); + /* x168_ */ + x168_ = in.ReadFloat(); + /* x16c_ */ + x16c_ = in.ReadFloat(); + /* x170_conservativeDoorCamDistance */ + x170_conservativeDoorCamDistance = in.ReadFloat(); + /* x174_ */ + x174_ = in.ReadFloat(); + /* x178_ballCameraChaseElevation */ + x178_ballCameraChaseElevation = in.ReadFloat(); + /* x17c_ballCameraChaseDampenAngle */ + x17c_ballCameraChaseDampenAngle = in.ReadFloat(); + /* x180_ballCameraChaseDistance */ + x180_ballCameraChaseDistance = in.ReadFloat(); + /* x184_ballCameraChaseYawSpeed */ + x184_ballCameraChaseYawSpeed = in.ReadFloat(); + /* x188_ballCameraChaseAnglePerSecond */ + x188_ballCameraChaseAnglePerSecond = in.ReadFloat(); + /* x18c_ballCameraChaseLookAtOffset */ + x18c_ballCameraChaseLookAtOffset = in.Get(); + /* x198_ballCameraChaseSpringConstant */ + x198_ballCameraChaseSpringConstant = in.ReadFloat(); + /* x19c_ballCameraChaseSpringMax */ + x19c_ballCameraChaseSpringMax = in.ReadFloat(); + /* x1a0_ballCameraChaseSpringTardis */ + x1a0_ballCameraChaseSpringTardis = in.ReadFloat(); + /* x1a4_ballCameraBoostElevation */ + x1a4_ballCameraBoostElevation = in.ReadFloat(); + /* x1a8_ballCameraBoostDampenAngle */ + x1a8_ballCameraBoostDampenAngle = in.ReadFloat(); + /* x1ac_ballCameraBoostDistance */ + x1ac_ballCameraBoostDistance = in.ReadFloat(); + /* x1b0_ballCameraBoostYawSpeed */ + x1b0_ballCameraBoostYawSpeed = in.ReadFloat(); + /* x1b4_ballCameraBoostAnglePerSecond */ + x1b4_ballCameraBoostAnglePerSecond = in.ReadFloat(); + /* x1b8_ballCameraBoostLookAtOffset */ + x1b8_ballCameraBoostLookAtOffset = in.Get(); + /* x1c4_ballCameraBoostSpringConstant */ + x1c4_ballCameraBoostSpringConstant = in.ReadFloat(); + /* x1c8_ballCameraBoostSpringMax */ + x1c8_ballCameraBoostSpringMax = in.ReadFloat(); + /* x1cc_ballCameraBoostSpringTardis */ + x1cc_ballCameraBoostSpringTardis = in.ReadFloat(); + /* x1d0_ballCameraControlDistance */ + x1d0_ballCameraControlDistance = in.ReadFloat(); + /* x1d4_ */ + x1d4_ = in.ReadFloat(); + /* x1d8_ */ + x1d8_ = in.ReadFloat(); + /* x1e4_leftStickDivisor */ + x1e4_leftStickDivisor = in.ReadFloat(); + /* x1e8_rightStickDivisor */ + x1e8_rightStickDivisor = in.ReadFloat(); + /* x200_ */ + x200_ = in.ReadFloat(); + /* x204_ballTouchRadius */ + x204_ballTouchRadius = in.ReadFloat(); + /* x20c_boostBallDrainTime */ + x20c_boostBallDrainTime = in.ReadFloat(); + /* x218_boostBallMinChargeTime */ + x218_boostBallMinChargeTime = in.ReadFloat(); + /* x21c_boostBallMinRelativeSpeedForDamage */ + x21c_boostBallMinRelativeSpeedForDamage = in.ReadFloat(); + /* x220_boostBallChargeTime0 */ + x220_boostBallChargeTime0 = in.ReadFloat(); + /* x224_boostBallChargeTime1 */ + x224_boostBallChargeTime1 = in.ReadFloat(); + /* x210_boostBallMaxChargeTime */ + x228_boostBallChargeTime2 = x210_boostBallMaxChargeTime = in.ReadFloat(); + /* x22c_boostBallIncrementalSpeed0 */ + x22c_boostBallIncrementalSpeed0 = in.ReadFloat(); + /* x230_boostBallIncrementalSpeed1 */ + x230_boostBallIncrementalSpeed1 = in.ReadFloat(); + /* x234_boostBallIncrementalSpeed2 */ + x234_boostBallIncrementalSpeed2 = in.ReadFloat(); +} + +void CTweakBall::PutTo(COutputStream& out) { + /* x4_maxTranslationAcceleration[0] */ + out.Put(x4_maxTranslationAcceleration[0]); + /* x4_maxTranslationAcceleration[1] */ + out.Put(x4_maxTranslationAcceleration[1]); + /* x4_maxTranslationAcceleration[2] */ + out.Put(x4_maxTranslationAcceleration[2]); + /* x4_maxTranslationAcceleration[3] */ + out.Put(x4_maxTranslationAcceleration[3]); + /* x4_maxTranslationAcceleration[4] */ + out.Put(x4_maxTranslationAcceleration[4]); + /* x4_maxTranslationAcceleration[5] */ + out.Put(x4_maxTranslationAcceleration[5]); + /* x4_maxTranslationAcceleration[6] */ + out.Put(x4_maxTranslationAcceleration[6]); + /* x4_maxTranslationAcceleration[7] */ + out.Put(x4_maxTranslationAcceleration[7]); + /* x24_translationFriction[0] */ + out.Put(x24_translationFriction[0]); + /* x24_translationFriction[1] */ + out.Put(x24_translationFriction[1]); + /* x24_translationFriction[2] */ + out.Put(x24_translationFriction[2]); + /* x24_translationFriction[3] */ + out.Put(x24_translationFriction[3]); + /* x24_translationFriction[4] */ + out.Put(x24_translationFriction[4]); + /* x24_translationFriction[5] */ + out.Put(x24_translationFriction[5]); + /* x24_translationFriction[6] */ + out.Put(x24_translationFriction[6]); + /* x24_translationFriction[7] */ + out.Put(x24_translationFriction[7]); + /* x44_translationMaxSpeed[0] */ + out.Put(x44_translationMaxSpeed[0]); + /* x44_translationMaxSpeed[1] */ + out.Put(x44_translationMaxSpeed[1]); + /* x44_translationMaxSpeed[2] */ + out.Put(x44_translationMaxSpeed[2]); + /* x44_translationMaxSpeed[3] */ + out.Put(x44_translationMaxSpeed[3]); + /* x44_translationMaxSpeed[4] */ + out.Put(x44_translationMaxSpeed[4]); + /* x44_translationMaxSpeed[5] */ + out.Put(x44_translationMaxSpeed[5]); + /* x44_translationMaxSpeed[6] */ + out.Put(x44_translationMaxSpeed[6]); + /* x44_translationMaxSpeed[7] */ + out.Put(x44_translationMaxSpeed[7]); + /* x64_ */ + out.Put(x64_); + /* x68_ */ + out.Put(x68_); + /* x6c_ */ + out.Put(x6c_); + /* x70_ */ + out.Put(x70_); + /* xc4_ballForwardBrakingAcceleration[0] */ + out.Put(xc4_ballForwardBrakingAcceleration[0]); + /* xc4_ballForwardBrakingAcceleration[1] */ + out.Put(xc4_ballForwardBrakingAcceleration[1]); + /* xc4_ballForwardBrakingAcceleration[2] */ + out.Put(xc4_ballForwardBrakingAcceleration[2]); + /* xc4_ballForwardBrakingAcceleration[3] */ + out.Put(xc4_ballForwardBrakingAcceleration[3]); + /* xc4_ballForwardBrakingAcceleration[4] */ + out.Put(xc4_ballForwardBrakingAcceleration[4]); + /* xc4_ballForwardBrakingAcceleration[5] */ + out.Put(xc4_ballForwardBrakingAcceleration[5]); + /* xc4_ballForwardBrakingAcceleration[6] */ + out.Put(xc4_ballForwardBrakingAcceleration[6]); + /* xc4_ballForwardBrakingAcceleration[7] */ + out.Put(xc4_ballForwardBrakingAcceleration[7]); + /* xe4_ballGravity */ + out.Put(xe4_ballGravity); + /* xe8_ballWaterGravity */ + out.Put(xe8_ballWaterGravity); + /* x14c_ */ + out.Put(x14c_); + /* x150_ */ + out.Put(x150_); + /* x158_ */ + out.Put(x158_); + /* x1dc_minimumAlignmentSpeed */ + out.Put(x1dc_minimumAlignmentSpeed); + /* x1e0_tireness */ + out.Put(x1e0_tireness); + /* x1ec_maxLeanAngle */ + out.Put(x1ec_maxLeanAngle); + /* x1f0_tireToMarbleThresholdSpeed */ + out.Put(x1f0_tireToMarbleThresholdSpeed); + /* x1f4_marbleToTireThresholdSpeed */ + out.Put(x1f4_marbleToTireThresholdSpeed); + /* x1f8_forceToLeanGain */ + out.Put(x1f8_forceToLeanGain); + /* x1fc_leanTrackingGain */ + out.Put(x1fc_leanTrackingGain); + /* x74_ballCameraAnglePerSecond */ + out.Put(x74_ballCameraAnglePerSecond); + /* x78_ballCameraOffset */ + out.Put(x78_ballCameraOffset); + /* x84_ballCameraMinSpeedDistance */ + out.Put(x84_ballCameraMinSpeedDistance); + /* x88_ballCameraMaxSpeedDistance */ + out.Put(x88_ballCameraMaxSpeedDistance); + /* x8c_ballCameraBackwardsDistance */ + out.Put(x8c_ballCameraBackwardsDistance); + /* x90_ */ + out.Put(x90_); + /* x94_ballCameraSpringConstant */ + out.Put(x94_ballCameraSpringConstant); + /* x98_ballCameraSpringMax */ + out.Put(x98_ballCameraSpringMax); + /* x9c_ballCameraSpringTardis */ + out.Put(x9c_ballCameraSpringTardis); + /* xa0_ballCameraCentroidSpringConstant */ + out.Put(xa0_ballCameraCentroidSpringConstant); + /* xa4_ballCameraCentroidSpringMax */ + out.Put(xa4_ballCameraCentroidSpringMax); + /* xa8_ballCameraCentroidSpringTardis */ + out.Put(xa8_ballCameraCentroidSpringTardis); + /* xac_ballCameraCentroidDistanceSpringConstant */ + out.Put(xac_ballCameraCentroidDistanceSpringConstant); + /* xb0_ballCameraCentroidDistanceSpringMax */ + out.Put(xb0_ballCameraCentroidDistanceSpringMax); + /* xb4_ballCameraCentroidDistanceSpringTardis */ + out.Put(xb4_ballCameraCentroidDistanceSpringTardis); + /* xb8_ballCameraLookAtSpringConstant */ + out.Put(xb8_ballCameraLookAtSpringConstant); + /* xbc_ballCameraLookAtSpringMax */ + out.Put(xbc_ballCameraLookAtSpringMax); + /* xc0_ballCameraLookAtSpringTardis */ + out.Put(xc0_ballCameraLookAtSpringTardis); + /* x154_ */ + out.Put(x154_); + /* x15c_ */ + out.Put(x15c_); + /* x160_ */ + out.Put(x160_); + /* x164_ */ + out.Put(x164_); + /* x168_ */ + out.Put(x168_); + /* x16c_ */ + out.Put(x16c_); + /* x170_conservativeDoorCamDistance */ + out.Put(x170_conservativeDoorCamDistance); + /* x174_ */ + out.Put(x174_); + /* x178_ballCameraChaseElevation */ + out.Put(x178_ballCameraChaseElevation); + /* x17c_ballCameraChaseDampenAngle */ + out.Put(x17c_ballCameraChaseDampenAngle); + /* x180_ballCameraChaseDistance */ + out.Put(x180_ballCameraChaseDistance); + /* x184_ballCameraChaseYawSpeed */ + out.Put(x184_ballCameraChaseYawSpeed); + /* x188_ballCameraChaseAnglePerSecond */ + out.Put(x188_ballCameraChaseAnglePerSecond); + /* x18c_ballCameraChaseLookAtOffset */ + out.Put(x18c_ballCameraChaseLookAtOffset); + /* x198_ballCameraChaseSpringConstant */ + out.Put(x198_ballCameraChaseSpringConstant); + /* x19c_ballCameraChaseSpringMax */ + out.Put(x19c_ballCameraChaseSpringMax); + /* x1a0_ballCameraChaseSpringTardis */ + out.Put(x1a0_ballCameraChaseSpringTardis); + /* x1a4_ballCameraBoostElevation */ + out.Put(x1a4_ballCameraBoostElevation); + /* x1a8_ballCameraBoostDampenAngle */ + out.Put(x1a8_ballCameraBoostDampenAngle); + /* x1ac_ballCameraBoostDistance */ + out.Put(x1ac_ballCameraBoostDistance); + /* x1b0_ballCameraBoostYawSpeed */ + out.Put(x1b0_ballCameraBoostYawSpeed); + /* x1b4_ballCameraBoostAnglePerSecond */ + out.Put(x1b4_ballCameraBoostAnglePerSecond); + /* x1b8_ballCameraBoostLookAtOffset */ + out.Put(x1b8_ballCameraBoostLookAtOffset); + /* x1c4_ballCameraBoostSpringConstant */ + out.Put(x1c4_ballCameraBoostSpringConstant); + /* x1c8_ballCameraBoostSpringMax */ + out.Put(x1c8_ballCameraBoostSpringMax); + /* x1cc_ballCameraBoostSpringTardis */ + out.Put(x1cc_ballCameraBoostSpringTardis); + /* x1d0_ballCameraControlDistance */ + out.Put(x1d0_ballCameraControlDistance); + /* x1d4_ */ + out.Put(x1d4_); + /* x1d8_ */ + out.Put(x1d8_); + /* x1e4_leftStickDivisor */ + out.Put(x1e4_leftStickDivisor); + /* x1e8_rightStickDivisor */ + out.Put(x1e8_rightStickDivisor); + /* x200_ */ + out.Put(x200_); + /* x204_ballTouchRadius */ + out.Put(x204_ballTouchRadius); + /* x20c_boostBallDrainTime */ + out.Put(x20c_boostBallDrainTime); + /* x218_boostBallMinChargeTime */ + out.Put(x218_boostBallMinChargeTime); + /* x21c_boostBallMinRelativeSpeedForDamage */ + out.Put(x21c_boostBallMinRelativeSpeedForDamage); + /* x220_boostBallChargeTime0 */ + out.Put(x220_boostBallChargeTime0); + /* x224_boostBallChargeTime1 */ + out.Put(x224_boostBallChargeTime1); + /* x210_boostBallMaxChargeTime */ + out.Put(x210_boostBallMaxChargeTime); + /* x22c_boostBallIncrementalSpeed0 */ + out.Put(x22c_boostBallIncrementalSpeed0); + /* x230_boostBallIncrementalSpeed1 */ + out.Put(x230_boostBallIncrementalSpeed1); + /* x234_boostBallIncrementalSpeed2 */ + out.Put(x234_boostBallIncrementalSpeed2); +} +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakBall.hpp b/Runtime/MP1/Tweaks/CTweakBall.hpp new file mode 100644 index 000000000..6a9c0f092 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakBall.hpp @@ -0,0 +1,199 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakBall.hpp" +#include "zeus/CVector3f.hpp" + +namespace metaforce::MP1 { +struct CTweakBall final : public Tweaks::ITweakBall { + float x4_maxTranslationAcceleration[8]; + float x24_translationFriction[8]; + float x44_translationMaxSpeed[8]; + float x64_; + float x68_; + float x6c_; + float x70_; + float x74_ballCameraAnglePerSecond; + zeus::CVector3f x78_ballCameraOffset; + float x84_ballCameraMinSpeedDistance; + float x88_ballCameraMaxSpeedDistance; + float x8c_ballCameraBackwardsDistance; + float x90_; + float x94_ballCameraSpringConstant; + float x98_ballCameraSpringMax; + float x9c_ballCameraSpringTardis; + float xa0_ballCameraCentroidSpringConstant; + float xa4_ballCameraCentroidSpringMax; + float xa8_ballCameraCentroidSpringTardis; + float xac_ballCameraCentroidDistanceSpringConstant; + float xb0_ballCameraCentroidDistanceSpringMax; + float xb4_ballCameraCentroidDistanceSpringTardis; + float xb8_ballCameraLookAtSpringConstant; + float xbc_ballCameraLookAtSpringMax; + float xc0_ballCameraLookAtSpringTardis; + float xc4_ballForwardBrakingAcceleration[8]; + float xe4_ballGravity; + float xe8_ballWaterGravity; + float xec_ = 10000.f; + float xf0_ = 1000.f; + float xf4_ = 40000.f; + float xf8_ = 40000.f; + float xfc_ = 40000.f; + float x100_ = 40000.f; + float x104_ = 40000.f; + float x108_ = 40000.f; + float x10c_ = 10000.f; + float x110_ = 1000.f; + float x114_ = 40000.f; + float x118_ = 40000.f; + float x11c_ = 40000.f; + float x120_ = 40000.f; + float x124_ = 40000.f; + float x128_ = 40000.f; + float x12c_ballSlipFactor[8] = {10000.f, 10000.f, 1000.f, 10000.f, 2000.f, 2000.f, 2000.f, 2000.f}; + float x14c_; + float x150_; + float x158_; + float x154_; + float x15c_; + float x160_; + float x164_; + float x168_; + float x16c_; + float x170_conservativeDoorCamDistance; + float x174_; + float x178_ballCameraChaseElevation; + float x17c_ballCameraChaseDampenAngle; + float x180_ballCameraChaseDistance; + float x184_ballCameraChaseYawSpeed; + float x188_ballCameraChaseAnglePerSecond; + zeus::CVector3f x18c_ballCameraChaseLookAtOffset; + float x198_ballCameraChaseSpringConstant; + float x19c_ballCameraChaseSpringMax; + float x1a0_ballCameraChaseSpringTardis; + float x1a4_ballCameraBoostElevation; + float x1a8_ballCameraBoostDampenAngle; + float x1ac_ballCameraBoostDistance; + float x1b0_ballCameraBoostYawSpeed; + float x1b4_ballCameraBoostAnglePerSecond; + zeus::CVector3f x1b8_ballCameraBoostLookAtOffset; + float x1c4_ballCameraBoostSpringConstant; + float x1c8_ballCameraBoostSpringMax; + float x1cc_ballCameraBoostSpringTardis; + float x1d0_ballCameraControlDistance; + float x1d4_; + float x1d8_; + float x1dc_minimumAlignmentSpeed; + float x1e0_tireness; + float x1ec_maxLeanAngle; + float x1f0_tireToMarbleThresholdSpeed; + float x1f4_marbleToTireThresholdSpeed; + float x1f8_forceToLeanGain; + float x1fc_leanTrackingGain; + float x1e4_leftStickDivisor; + float x1e8_rightStickDivisor; + float x200_; + float x204_ballTouchRadius; + float x208_; + float x20c_boostBallDrainTime; + float x218_boostBallMinChargeTime; + float x21c_boostBallMinRelativeSpeedForDamage; + float x220_boostBallChargeTime0; + float x224_boostBallChargeTime1; + float x228_boostBallChargeTime2; + float x210_boostBallMaxChargeTime; + float x22c_boostBallIncrementalSpeed0; + float x230_boostBallIncrementalSpeed1; + float x234_boostBallIncrementalSpeed2; + + CTweakBall() = default; + CTweakBall(CInputStream& r); + float GetMaxBallTranslationAcceleration(int s) const override { return x4_maxTranslationAcceleration[s]; } + float GetBallTranslationFriction(int s) const override { return x24_translationFriction[s]; } + float GetBallTranslationMaxSpeed(int s) const override { return x44_translationMaxSpeed[s]; } + float GetBallCameraElevation() const override { return 2.736f; } + float GetBallCameraAnglePerSecond() const override { return x74_ballCameraAnglePerSecond; } + const zeus::CVector3f& GetBallCameraOffset() const override { return x78_ballCameraOffset; } + float GetBallCameraMinSpeedDistance() const override { return x84_ballCameraMinSpeedDistance; } + float GetBallCameraMaxSpeedDistance() const override { return x88_ballCameraMaxSpeedDistance; } + float GetBallCameraBackwardsDistance() const override { return x8c_ballCameraBackwardsDistance; } + float GetBallCameraSpringConstant() const override { return x94_ballCameraSpringConstant; } + float GetBallCameraSpringMax() const override { return x98_ballCameraSpringMax; } + float GetBallCameraSpringTardis() const override { return x9c_ballCameraSpringTardis; } + float GetBallCameraCentroidSpringConstant() const override { return xa0_ballCameraCentroidSpringConstant; } + float GetBallCameraCentroidSpringMax() const override { return xa4_ballCameraCentroidSpringMax; } + float GetBallCameraCentroidSpringTardis() const override { return xa8_ballCameraCentroidSpringTardis; } + float GetBallCameraCentroidDistanceSpringConstant() const override { + return xac_ballCameraCentroidDistanceSpringConstant; + } + float GetBallCameraCentroidDistanceSpringMax() const override { return xb0_ballCameraCentroidDistanceSpringMax; } + float GetBallCameraCentroidDistanceSpringTardis() const override { + return xb4_ballCameraCentroidDistanceSpringTardis; + } + float GetBallCameraLookAtSpringConstant() const override { return xb8_ballCameraLookAtSpringConstant; } + float GetBallCameraLookAtSpringMax() const override { return xbc_ballCameraLookAtSpringMax; } + float GetBallCameraLookAtSpringTardis() const override { return xc0_ballCameraLookAtSpringTardis; } + float GetBallForwardBrakingAcceleration(int s) const override { return xc4_ballForwardBrakingAcceleration[s]; } + float GetBallGravity() const override { return xe4_ballGravity; } + float GetBallWaterGravity() const override { return xe8_ballWaterGravity; } + float GetBallSlipFactor(int s) const override { return x12c_ballSlipFactor[s]; } + float GetConservativeDoorCameraDistance() const override { return x170_conservativeDoorCamDistance; } + float GetBallCameraChaseElevation() const override { return x178_ballCameraChaseElevation; } + float GetBallCameraChaseDampenAngle() const override { return x17c_ballCameraChaseDampenAngle; } + float GetBallCameraChaseDistance() const override { return x180_ballCameraChaseDistance; } + float GetBallCameraChaseYawSpeed() const override { return x184_ballCameraChaseYawSpeed; } + float GetBallCameraChaseAnglePerSecond() const override { return x188_ballCameraChaseAnglePerSecond; } + const zeus::CVector3f& GetBallCameraChaseLookAtOffset() const override { return x18c_ballCameraChaseLookAtOffset; } + float GetBallCameraChaseSpringConstant() const override { return x198_ballCameraChaseSpringConstant; } + float GetBallCameraChaseSpringMax() const override { return x19c_ballCameraChaseSpringMax; } + float GetBallCameraChaseSpringTardis() const override { return x1a0_ballCameraChaseSpringTardis; } + float GetBallCameraBoostElevation() const override { return x1a4_ballCameraBoostElevation; } + float GetBallCameraBoostDampenAngle() const override { return x1a8_ballCameraBoostDampenAngle; } + float GetBallCameraBoostDistance() const override { return x1ac_ballCameraBoostDistance; } + float GetBallCameraBoostYawSpeed() const override { return x1b0_ballCameraBoostYawSpeed; } + float GetBallCameraBoostAnglePerSecond() const override { return x1b4_ballCameraBoostAnglePerSecond; } + const zeus::CVector3f& GetBallCameraBoostLookAtOffset() const override { return x1b8_ballCameraBoostLookAtOffset; } + float GetBallCameraBoostSpringConstant() const override { return x1c4_ballCameraBoostSpringConstant; } + float GetBallCameraBoostSpringMax() const override { return x1c8_ballCameraBoostSpringMax; } + float GetBallCameraBoostSpringTardis() const override { return x1cc_ballCameraBoostSpringTardis; } + float GetBallCameraControlDistance() const override { return x1d0_ballCameraControlDistance; } + float GetMinimumAlignmentSpeed() const override { return x1dc_minimumAlignmentSpeed; } + float GetTireness() const override { return x1e0_tireness; } + float GetMaxLeanAngle() const override { return x1ec_maxLeanAngle; } + float GetTireToMarbleThresholdSpeed() const override { return x1f0_tireToMarbleThresholdSpeed; } + float GetMarbleToTireThresholdSpeed() const override { return x1f4_marbleToTireThresholdSpeed; } + float GetForceToLeanGain() const override { return x1f8_forceToLeanGain; } + float GetLeanTrackingGain() const override { return x1fc_leanTrackingGain; } + float GetLeftStickDivisor() const override { return x1e4_leftStickDivisor; } + float GetRightStickDivisor() const override { return x1e8_rightStickDivisor; } + float GetBallTouchRadius() const override { return x204_ballTouchRadius; } + float GetBoostBallDrainTime() const override { return x20c_boostBallDrainTime; } + float GetBoostBallMaxChargeTime() const override { return x210_boostBallMaxChargeTime; } + float GetBoostBallMinChargeTime() const override { return x218_boostBallMinChargeTime; } + float GetBoostBallMinRelativeSpeedForDamage() const override { return x21c_boostBallMinRelativeSpeedForDamage; } + float GetBoostBallChargeTimeTable(int i) const override { + switch (i) { + default: + case 0: + return x220_boostBallChargeTime0; + case 1: + return x224_boostBallChargeTime1; + case 2: + return x228_boostBallChargeTime2; + } + } + float GetBoostBallIncrementalSpeedTable(int i) const override { + switch (i) { + default: + case 0: + return x22c_boostBallIncrementalSpeed0; + case 1: + return x230_boostBallIncrementalSpeed1; + case 2: + return x234_boostBallIncrementalSpeed2; + } + } + + void LoadTweaks(CInputStream& in); + void PutTo(COutputStream& out); +}; +} // namespace metaforce::MP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.cpp b/Runtime/MP1/Tweaks/CTweakGame.cpp similarity index 78% rename from DataSpec/DNAMP1/Tweaks/CTweakGame.cpp rename to Runtime/MP1/Tweaks/CTweakGame.cpp index 8b30dbfa1..9fc2b778c 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.cpp +++ b/Runtime/MP1/Tweaks/CTweakGame.cpp @@ -1,19 +1,21 @@ -#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp" +#include "Runtime/MP1/Tweaks/CTweakGame.hpp" #include "Runtime/Camera/CCameraManager.hpp" -#include -#include +#include "Runtime/Streams/CInputStream.hpp" + +#include "ConsoleVariables/CVar.hpp" +#include "ConsoleVariables/CVarManager.hpp" #define DEFINE_CVAR_GLOBAL(name) \ constexpr std::string_view sk##name = std::string_view("tweak.game." #name); \ - hecl::CVar* tw_##name = nullptr; + CVar* tw_##name = nullptr; #define CREATE_CVAR(name, help, value, flags) \ tw_##name = mgr->findOrMakeCVar(sk##name, help, value, flags); \ if (tw_##name->wasDeserialized()) { \ tw_##name->toValue(value); \ } \ - tw_##name->addListener([this](hecl::CVar* cv) { _tweakListener(cv); }); + tw_##name->addListener([this](CVar* cv) { _tweakListener(cv); }); #define CREATE_CVAR_BITFIELD(name, help, value, flags) \ { \ @@ -34,7 +36,35 @@ (value) = tmp; \ } -namespace DataSpec::DNAMP1 { +namespace metaforce::MP1 { + +CTweakGame::CTweakGame(CInputStream& in) { + x4_worldPrefix = in.Get(); + x14_defaultRoom = in.Get(); + x24_fov = in.ReadFloat(); + x28_unknown1 = in.ReadBool(); + x29_unknown2 = in.ReadBool(); + x2a_unknown3 = in.ReadBool(); + x2b_splashScreensDisabled = in.ReadBool(); + x2c_unknown5 = in.ReadFloat(); + x30_pressStartDelay = in.ReadFloat(); + x34_wavecapIntensityNormal = in.ReadFloat(); + x38_wavecapIntensityPoison = in.ReadFloat(); + x3c_wavecapIntensityLava = in.ReadFloat(); + x40_rippleIntensityNormal = in.ReadFloat(); + x44_rippleIntensityPoison = in.ReadFloat(); + x48_rippleIntensityLava = in.ReadFloat(); + x4c_fluidEnvBumpScale = in.ReadFloat(); + x50_waterFogDistanceBase = in.ReadFloat(); + x54_waterFogDistanceRange = in.ReadFloat(); + x58_gravityWaterFogDistanceBase = in.ReadFloat(); + x5c_gravityWaterFogDistanceRange = in.ReadFloat(); + x60_hardmodeDamageMult = in.ReadFloat(); + x64_hardmodeWeaponMult = in.ReadFloat(); +#ifdef NDEBUG + x2b_splashScreensDisabled = false; +#endif +} DEFINE_CVAR_GLOBAL(WorldPrefix); DEFINE_CVAR_GLOBAL(FieldOfView); @@ -54,7 +84,7 @@ DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceRange); DEFINE_CVAR_GLOBAL(HardModeDamageMult); DEFINE_CVAR_GLOBAL(HardModeWeaponMult); -void CTweakGame::_tweakListener(hecl::CVar* cv) { +void CTweakGame::_tweakListener(CVar* cv) { UPDATE_CVAR(WorldPrefix, cv, x4_worldPrefix); UPDATE_CVAR(FieldOfView, cv, x24_fov); UPDATE_CVAR(SplashScreensDisabled, cv, x2b_splashScreensDisabled); @@ -74,8 +104,8 @@ void CTweakGame::_tweakListener(hecl::CVar* cv) { UPDATE_CVAR(HardModeWeaponMult, cv, x64_hardmodeWeaponMult); } -void CTweakGame::initCVars(hecl::CVarManager* mgr) { - constexpr hecl::CVar::EFlags skDefaultFlags = hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive; +void CTweakGame::initCVars(CVarManager* mgr) { + constexpr CVar::EFlags skDefaultFlags = CVar::EFlags::Game | CVar::EFlags::Archive; CREATE_CVAR(WorldPrefix, "", x4_worldPrefix, skDefaultFlags); CREATE_CVAR(FieldOfView, "", x24_fov, skDefaultFlags); CREATE_CVAR(SplashScreensDisabled, "", x2b_splashScreensDisabled, skDefaultFlags); @@ -94,4 +124,4 @@ void CTweakGame::initCVars(hecl::CVarManager* mgr) { CREATE_CVAR(HardModeDamageMult, "", x60_hardmodeDamageMult, skDefaultFlags); CREATE_CVAR(HardModeWeaponMult, "", x64_hardmodeWeaponMult, skDefaultFlags); } -} // namespace DataSpec::DNAMP1 +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakGame.hpp b/Runtime/MP1/Tweaks/CTweakGame.hpp new file mode 100644 index 000000000..44010f962 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGame.hpp @@ -0,0 +1,86 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakGame.hpp" + +namespace hecl { +class CVar; +} // namespace hecl + +namespace metaforce { +class CInputStream; +namespace MP1 { + +#define DEFINE_CVAR_GLOBAL(name) extern CVar* tw_##name; + +DEFINE_CVAR_GLOBAL(WorldPrefix); +DEFINE_CVAR_GLOBAL(FieldOfView); +DEFINE_CVAR_GLOBAL(SplashScreensDisabled); +DEFINE_CVAR_GLOBAL(PressStartDelay); +DEFINE_CVAR_GLOBAL(WavecapIntensityNormal); +DEFINE_CVAR_GLOBAL(WavecapIntensityPoison); +DEFINE_CVAR_GLOBAL(WavecapIntensityLava); +DEFINE_CVAR_GLOBAL(RippleIntensityNormal); +DEFINE_CVAR_GLOBAL(RippleIntensityPoison); +DEFINE_CVAR_GLOBAL(RippleIntensityLava); +DEFINE_CVAR_GLOBAL(FluidEnvBumpScale); +DEFINE_CVAR_GLOBAL(WaterFogDistanceBase); +DEFINE_CVAR_GLOBAL(WaterFogDistanceRange); +DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceBase); +DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceRange); +DEFINE_CVAR_GLOBAL(HardModeDamageMult); +DEFINE_CVAR_GLOBAL(HardModeWeaponMult); + +#undef DEFINE_CVAR_GLOBAL + +struct CTweakGame final : Tweaks::ITweakGame { + std::string x4_worldPrefix; + std::string x14_defaultRoom; + float x24_fov{}; + bool x28_unknown1{}; + bool x29_unknown2{}; + bool x2a_unknown3{}; + bool x2b_splashScreensDisabled{}; + float x2c_unknown5{}; + float x30_pressStartDelay{}; + float x34_wavecapIntensityNormal{}; + float x38_wavecapIntensityPoison{}; + float x3c_wavecapIntensityLava{}; + float x40_rippleIntensityNormal{}; + float x44_rippleIntensityPoison{}; + float x48_rippleIntensityLava{}; + float x4c_fluidEnvBumpScale{}; + float x50_waterFogDistanceBase{}; + float x54_waterFogDistanceRange{}; + float x58_gravityWaterFogDistanceBase{}; + float x5c_gravityWaterFogDistanceRange{}; + float x60_hardmodeDamageMult{}; + float x64_hardmodeWeaponMult{}; + + std::string_view GetWorldPrefix() const override { return x4_worldPrefix; } + std::string_view GetDefaultRoom() const { return x14_defaultRoom; } + bool GetSplashScreensDisabled() const override { return x2b_splashScreensDisabled; } + float GetFirstPersonFOV() const override { return x24_fov; } + float GetPressStartDelay() const override { return x30_pressStartDelay; } + float GetWavecapIntensityNormal() const override { return x34_wavecapIntensityNormal; } + float GetWavecapIntensityPoison() const override { return x38_wavecapIntensityPoison; } + float GetWavecapIntensityLava() const override { return x3c_wavecapIntensityLava; } + float GetRippleIntensityNormal() const override { return x40_rippleIntensityNormal; } + float GetRippleIntensityPoison() const override { return x44_rippleIntensityPoison; } + float GetRippleIntensityLava() const override { return x48_rippleIntensityLava; } + float GetFluidEnvBumpScale() const override { return x4c_fluidEnvBumpScale; } + float GetWaterFogDistanceBase() const override { return x50_waterFogDistanceBase; } + float GetWaterFogDistanceRange() const override { return x54_waterFogDistanceRange; } + float GetGravityWaterFogDistanceBase() const override { return x58_gravityWaterFogDistanceBase; } + float GetGravityWaterFogDistanceRange() const override { return x5c_gravityWaterFogDistanceRange; } + float GetHardModeDamageMultiplier() const override { return x60_hardmodeDamageMult; } + float GetHardModeWeaponMultiplier() const override { return x64_hardmodeWeaponMult; } + CTweakGame() = default; + CTweakGame(CInputStream& in); + + void initCVars(CVarManager* mgr) override; + +private: + void _tweakListener(CVar* cv); +}; +} // namespace MP1 +} // namespace metaforce diff --git a/Runtime/MP1/Tweaks/CTweakGui.cpp b/Runtime/MP1/Tweaks/CTweakGui.cpp new file mode 100644 index 000000000..3e47593af --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGui.cpp @@ -0,0 +1,183 @@ +#include "Runtime/MP1/Tweaks/CTweakGui.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakGui::CTweakGui(CInputStream& in) +: x4_(in.ReadBool()) +, x8_mapAlphaInterp(in.ReadFloat()) +, xc_pauseBlurFactor(in.ReadFloat()) +, x10_radarXYRadius(in.ReadFloat()) +, x14_(in.ReadFloat()) +, x18_(in.ReadFloat()) +, x1c_(in.ReadFloat()) +, x20_(in.ReadFloat()) +, x24_radarZRadius(in.ReadFloat()) +, x28_radarZCloseRadius(in.ReadFloat()) +, x30_(in.ReadFloat()) +, x34_energyBarFilledSpeed(in.ReadFloat()) +, x38_energyBarShadowSpeed(in.ReadFloat()) +, x3c_energyBarDrainDelay(in.ReadFloat()) +, x40_energyBarAlwaysResetDelay(in.ReadBool()) +, x44_hudDamagePracticalsGainConstant(in.ReadFloat()) +, x48_hudDamagePracticalsGainLinear(in.ReadFloat()) +, x4c_hudDamagePracticalsInitConstant(in.ReadFloat()) +, x50_hudDamagePracticalsInitLinear(in.ReadFloat()) +, x54_hudDamageLightSpotAngle(in.ReadFloat()) +, x58_damageLightAngleC(in.ReadFloat()) +, x5c_damageLightAngleL(in.ReadFloat()) +, x60_damageLightAngleQ(in.ReadFloat()) +, x64_damageLightPreTranslate(in.Get()) +, x70_damageLightCenterTranslate(in.Get()) +, x7c_damageLightXfXAngle(in.ReadFloat()) +, x80_damageLightXfZAngle(in.ReadFloat()) +, x84_hudDecoShakeTranslateVelConstant(in.ReadFloat()) +, x88_hudDecoShakeTranslateVelLinear(in.ReadFloat()) +, x8c_maxDecoDamageShakeTranslate(in.ReadFloat()) +, x90_decoDamageShakeDeceleration(in.ReadFloat()) +, x94_decoShakeGainConstant(in.ReadFloat()) +, x98_decoShakeGainLinear(in.ReadFloat()) +, x9c_decoShakeInitConstant(in.ReadFloat()) +, xa0_decoShakeInitLinear(in.ReadFloat()) +, xa4_maxDecoDamageShakeRotate(in.ReadFloat()) +, xa8_hudCamFovTweak(in.ReadLong()) +, xac_hudCamYTweak(in.ReadLong()) +, xb0_hudCamZTweak(in.ReadLong()) +, xb4_(in.ReadFloat()) +, xb8_(in.ReadFloat()) +, xbc_(in.ReadFloat()) +, xc0_beamVisorMenuAnimTime(in.ReadFloat()) +, xc4_visorBeamMenuItemActiveScale(in.ReadFloat()) +, xc8_visorBeamMenuItemInactiveScale(in.ReadFloat()) +, xcc_visorBeamMenuItemTranslate(in.ReadFloat()) +, xd0_(in.ReadFloat()) +, xd4_(in.ReadLong()) +, xd8_(in.ReadFloat()) +, xdc_(in.ReadFloat()) +, xe0_(in.ReadFloat()) +, xe4_threatRange(in.ReadFloat()) +, xe8_radarScopeCoordRadius(in.ReadFloat()) +, xec_radarPlayerPaintRadius(in.ReadFloat()) +, xf0_radarEnemyPaintRadius(in.ReadFloat()) +, xf4_missileArrowVisTime(in.ReadFloat()) +, xf8_hudVisMode(EHudVisMode(in.ReadLong())) +, xfc_helmetVisMode(EHelmetVisMode(in.ReadLong())) +, x100_enableAutoMapper(in.ReadLong()) +, x104_(in.ReadLong()) +, x108_enableTargetingManager(in.ReadLong()) +, x10c_enablePlayerVisor(in.ReadLong()) +, x110_threatWarningFraction(in.ReadFloat()) +, x114_missileWarningFraction(in.ReadFloat()) +, x118_freeLookFadeTime(in.ReadFloat()) +, x11c_(in.ReadFloat()) +, x120_(in.ReadFloat()) +, x124_(in.ReadFloat()) +, x128_(in.ReadFloat()) +, x12c_freeLookSfxPitchScale(in.ReadFloat()) +, x130_noAbsoluteFreeLookSfxPitch(in.ReadBool()) +, x134_(in.ReadFloat()) +, x138_(in.ReadFloat()) +, x13c_faceReflectionOrthoWidth(in.ReadLong()) +, x140_faceReflectionOrthoHeight(in.ReadLong()) +, x144_faceReflectionDistance(in.ReadLong()) +, x148_faceReflectionHeight(in.ReadLong()) +, x14c_faceReflectionAspect(in.ReadLong()) +, x150_(in.Get()) +, x160_(in.Get()) +, x170_(in.Get()) +, x180_(in.Get()) +, x190_(in.Get()) +, x1a0_missileWarningPulseTime(in.ReadFloat()) +, x1a4_explosionLightFalloffMultConstant(in.ReadFloat()) +, x1a8_explosionLightFalloffMultLinear(in.ReadFloat()) +, x1ac_explosionLightFalloffMultQuadratic(in.ReadFloat()) +, x1b0_(in.ReadFloat()) +, x1b4_hudDamagePeakFactor(in.ReadFloat()) +, x1b8_hudDamageFilterGainConstant(in.ReadFloat()) +, x1bc_hudDamageFilterGainLinear(in.ReadFloat()) +, x1c0_hudDamageFilterInitConstant(in.ReadFloat()) +, x1c4_hudDamageFilterInitLinear(in.ReadFloat()) +, x1c8_energyDrainModPeriod(in.ReadFloat()) +, x1cc_energyDrainSinusoidalPulse(in.ReadBool()) +, x1cd_energyDrainFilterAdditive(in.ReadBool()) +, x1d0_hudDamagePulseDuration(in.ReadFloat()) +, x1d4_hudDamageColorGain(in.ReadFloat()) +, x1d8_hudDecoShakeTranslateGain(in.ReadFloat()) +, x1dc_hudLagOffsetScale(in.ReadFloat()) +, x1e0_(in.ReadFloat()) +, x1e4_(in.ReadFloat()) +, x1e8_(in.ReadFloat()) +, x1ec_(in.ReadFloat()) +, x1f0_(in.ReadFloat()) +, x1f4_(in.ReadFloat()) +, x1f8_(in.ReadFloat()) +, x1fc_(in.ReadFloat()) +, x20c_(in.ReadFloat()) +, x210_scanSidesAngle(in.ReadFloat()) +, x214_scanSidesXScale(in.ReadFloat()) +, x218_scanSidesPositionEnd(in.ReadFloat()) +, x21c_(in.ReadFloat()) +, x220_scanSidesDuration(in.ReadFloat()) +, x224_scanSidesStartTime(in.ReadFloat()) +, x22c_scanDataDotRadius(in.ReadFloat()) +, x230_scanDataDotPosRandMag(in.ReadFloat()) +, x234_scanDataDotSeekDurationMin(in.ReadFloat()) +, x238_scanDataDotSeekDurationMax(in.ReadFloat()) +, x23c_scanDataDotHoldDurationMin(in.ReadFloat()) +, x240_scanDataDotHoldDurationMax(in.ReadFloat()) +, x244_scanAppearanceDuration(in.ReadFloat()) +, x248_scanPaneFlashFactor(in.ReadFloat()) +, x24c_scanPaneFadeInTime(in.ReadFloat()) +, x250_scanPaneFadeOutTime(in.ReadFloat()) +, x254_ballViewportYReduction(in.ReadFloat()) +, x258_scanWindowIdleW(in.ReadFloat()) +, x25c_scanWindowIdleH(in.ReadFloat()) +, x260_scanWindowActiveW(in.ReadFloat()) +, x264_scanWindowActiveH(in.ReadFloat()) +, x268_scanWindowMagnification(in.ReadFloat()) +, x26c_scanWindowScanningAspect(in.ReadFloat()) +, x270_scanSidesPositionStart(in.ReadFloat()) +, x274_showAutomapperInMorphball(in.ReadBool()) +, x278_wtMgrCharsPerSfx(in.ReadFloat()) +, x27c_xrayFogMode(in.ReadLong()) +, x280_xrayFogNearZ(in.ReadFloat()) +, x284_xrayFogFarZ(in.ReadFloat()) +, x288_xrayFogColor(in.Get()) +, x28c_thermalVisorLevel(in.ReadFloat()) +, x290_thermalVisorColor(in.Get()) { + for (u32 i = 0; i < 4; ++i) { + x294_hudLightAddPerVisor[i] = in.Get(); + } + for (u32 i = 0; i < 4; ++i) { + x2a4_hudLightMultiplyPerVisor[i] = in.Get(); + } + + x2b4_hudReflectivityLightColor = in.Get(); + x2b8_hudLightAttMulConstant = in.ReadFloat(); + x2bc_hudLightAttMulLinear = in.ReadFloat(); + x2c0_hudLightAttMulQuadratic = in.ReadFloat(); + read_reserved_vector(x2c4_scanSpeeds, in); + x2d0_creditsTable = in.Get(); + x2e0_creditsFont = in.Get(); + x2f0_japaneseCreditsFont = in.Get(); + x300_ = in.Get(); + x304_ = in.Get(); + x308_ = in.ReadFloat(); + x30c_ = in.ReadFloat(); + x310_ = in.ReadFloat(); + x314_ = in.Get(); + x324_ = in.Get(); + x334_ = in.Get(); + x344_ = in.Get(); + x348_ = in.Get(); + x34c_ = in.Get(); + x350_ = in.Get(); + x354_ = in.Get(); + x358_ = in.Get(); + x35c_ = in.ReadFloat(); + x360_ = in.ReadFloat(); + x364_ = in.ReadFloat(); + + FixupValues(); +} + +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakGui.hpp b/Runtime/MP1/Tweaks/CTweakGui.hpp new file mode 100644 index 000000000..c4a7df872 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGui.hpp @@ -0,0 +1,332 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakGui.hpp" +#include "rstl.hpp" + +namespace metaforce::MP1 { +struct CTweakGui final : Tweaks::ITweakGui { + bool x4_{}; + float x8_mapAlphaInterp{}; + float xc_pauseBlurFactor{}; + float x10_radarXYRadius{}; + float x14_{}; + float x18_{}; + float x1c_{}; + float x20_{}; + float x24_radarZRadius{}; + float x28_radarZCloseRadius{}; + u32 x2c_ = 0; + float x30_{}; + float x34_energyBarFilledSpeed{}; + float x38_energyBarShadowSpeed{}; + float x3c_energyBarDrainDelay{}; + bool x40_energyBarAlwaysResetDelay{}; + float x44_hudDamagePracticalsGainConstant{}; + float x48_hudDamagePracticalsGainLinear{}; + float x4c_hudDamagePracticalsInitConstant{}; + float x50_hudDamagePracticalsInitLinear{}; + float x54_hudDamageLightSpotAngle{}; + float x58_damageLightAngleC{}; + float x5c_damageLightAngleL{}; + float x60_damageLightAngleQ{}; + zeus::CVector3f x64_damageLightPreTranslate; + zeus::CVector3f x70_damageLightCenterTranslate; + float x7c_damageLightXfXAngle{}; + float x80_damageLightXfZAngle{}; + float x84_hudDecoShakeTranslateVelConstant{}; + float x88_hudDecoShakeTranslateVelLinear{}; + float x8c_maxDecoDamageShakeTranslate{}; + float x90_decoDamageShakeDeceleration{}; + float x94_decoShakeGainConstant{}; + float x98_decoShakeGainLinear{}; + float x9c_decoShakeInitConstant{}; + float xa0_decoShakeInitLinear{}; + float xa4_maxDecoDamageShakeRotate{}; + u32 xa8_hudCamFovTweak{}; + u32 xac_hudCamYTweak{}; + u32 xb0_hudCamZTweak{}; + float xb4_{}; + float xb8_{}; + float xbc_{}; + float xc0_beamVisorMenuAnimTime{}; + float xc4_visorBeamMenuItemActiveScale{}; + float xc8_visorBeamMenuItemInactiveScale{}; + float xcc_visorBeamMenuItemTranslate{}; + float xd0_{}; + u32 xd4_{}; + float xd8_{}; + float xdc_{}; + float xe0_{}; + float xe4_threatRange{}; + float xe8_radarScopeCoordRadius{}; + float xec_radarPlayerPaintRadius{}; + float xf0_radarEnemyPaintRadius{}; + float xf4_missileArrowVisTime{}; + EHudVisMode xf8_hudVisMode; + EHelmetVisMode xfc_helmetVisMode; + u32 x100_enableAutoMapper{}; + u32 x104_{}; + u32 x108_enableTargetingManager{}; + u32 x10c_enablePlayerVisor{}; + float x110_threatWarningFraction{}; + float x114_missileWarningFraction{}; + float x118_freeLookFadeTime{}; + float x11c_{}; + float x120_{}; + float x124_{}; + float x128_{}; + float x12c_freeLookSfxPitchScale{}; + bool x130_noAbsoluteFreeLookSfxPitch{}; + float x134_{}; + float x138_{}; + u32 x13c_faceReflectionOrthoWidth{}; + u32 x140_faceReflectionOrthoHeight{}; + u32 x144_faceReflectionDistance{}; + u32 x148_faceReflectionHeight{}; + u32 x14c_faceReflectionAspect{}; + std::string x150_; + std::string x160_; + std::string x170_; + std::string x180_; + std::string x190_; + float x1a0_missileWarningPulseTime{}; + float x1a4_explosionLightFalloffMultConstant{}; + float x1a8_explosionLightFalloffMultLinear{}; + float x1ac_explosionLightFalloffMultQuadratic{}; + float x1b0_{}; + float x1b4_hudDamagePeakFactor{}; + float x1b8_hudDamageFilterGainConstant{}; + float x1bc_hudDamageFilterGainLinear{}; + float x1c0_hudDamageFilterInitConstant{}; + float x1c4_hudDamageFilterInitLinear{}; + float x1c8_energyDrainModPeriod{}; + bool x1cc_energyDrainSinusoidalPulse{}; + bool x1cd_energyDrainFilterAdditive{}; + float x1d0_hudDamagePulseDuration{}; + float x1d4_hudDamageColorGain{}; + float x1d8_hudDecoShakeTranslateGain{}; + float x1dc_hudLagOffsetScale{}; + float x1e0_{}; + float x1e4_{}; + float x1e8_{}; + float x1ec_{}; + float x1f0_{}; + float x1f4_{}; + float x1f8_{}; + float x1fc_{}; + zeus::CColor x200_; + float x204_xrayBlurScaleLinear = 0.0014f; + float x208_xrayBlurScaleQuadratic = 0.0000525f; + float x20c_{}; + float x210_scanSidesAngle{}; + float x214_scanSidesXScale{}; + float x218_scanSidesPositionEnd{}; + float x21c_{}; + float x220_scanSidesDuration{}; + float x224_scanSidesStartTime{}; + float x228_scanSidesEndTime{}; + float x22c_scanDataDotRadius{}; + float x230_scanDataDotPosRandMag{}; + float x234_scanDataDotSeekDurationMin{}; + float x238_scanDataDotSeekDurationMax{}; + float x23c_scanDataDotHoldDurationMin{}; + float x240_scanDataDotHoldDurationMax{}; + float x244_scanAppearanceDuration{}; + float x248_scanPaneFlashFactor{}; + float x24c_scanPaneFadeInTime{}; + float x250_scanPaneFadeOutTime{}; + float x254_ballViewportYReduction{}; + float x258_scanWindowIdleW{}; + float x25c_scanWindowIdleH{}; + float x260_scanWindowActiveW{}; + float x264_scanWindowActiveH{}; + float x268_scanWindowMagnification{}; + float x26c_scanWindowScanningAspect{}; + float x270_scanSidesPositionStart{}; + bool x274_showAutomapperInMorphball{}; + bool x275_latchArticleText = true; + float x278_wtMgrCharsPerSfx{}; + u32 x27c_xrayFogMode{}; + float x280_xrayFogNearZ{}; + float x284_xrayFogFarZ{}; + zeus::CColor x288_xrayFogColor; + float x28c_thermalVisorLevel{}; + zeus::CColor x290_thermalVisorColor; + std::array x294_hudLightAddPerVisor; + std::array x2a4_hudLightMultiplyPerVisor; + zeus::CColor x2b4_hudReflectivityLightColor; + float x2b8_hudLightAttMulConstant{}; + float x2bc_hudLightAttMulLinear{}; + float x2c0_hudLightAttMulQuadratic{}; + rstl::reserved_vector x2c4_scanSpeeds; + std::string x2d0_creditsTable; + std::string x2e0_creditsFont; + std::string x2f0_japaneseCreditsFont; + zeus::CColor x300_; + zeus::CColor x304_; + float x308_{}; + float x30c_{}; + float x310_{}; + std::string x314_; + std::string x324_; + std::string x334_; + zeus::CColor x344_; + zeus::CColor x348_; + zeus::CColor x34c_; + zeus::CColor x350_; + zeus::CColor x354_; + zeus::CColor x358_; + float x35c_{}; + float x360_{}; + float x364_{}; + + CTweakGui() = default; + CTweakGui(CInputStream& r); + float GetMapAlphaInterpolant() const override { return x8_mapAlphaInterp; } + float GetPauseBlurFactor() const override { return xc_pauseBlurFactor; } + float GetRadarXYRadius() const override { return x10_radarXYRadius; } + float GetRadarZRadius() const override { return x24_radarZRadius; } + float GetRadarZCloseRadius() const override { return x28_radarZCloseRadius; } + float GetEnergyBarFilledSpeed() const override { return x34_energyBarFilledSpeed; } + float GetEnergyBarShadowSpeed() const override { return x38_energyBarShadowSpeed; } + float GetEnergyBarDrainDelay() const override { return x3c_energyBarDrainDelay; } + bool GetEnergyBarAlwaysResetDelay() const override { return x40_energyBarAlwaysResetDelay; } + float GetHudDamagePracticalsGainConstant() const override { return x44_hudDamagePracticalsGainConstant; } + float GetHudDamagePracticalsGainLinear() const override { return x48_hudDamagePracticalsGainLinear; } + float GetHudDamagePracticalsInitConstant() const override { return x4c_hudDamagePracticalsInitConstant; } + float GetHudDamagePracticalsInitLinear() const override { return x50_hudDamagePracticalsInitLinear; } + float GetHudDamageLightSpotAngle() const override { return x54_hudDamageLightSpotAngle; } + float GetDamageLightAngleC() const override { return x58_damageLightAngleC; } + float GetDamageLightAngleL() const override { return x5c_damageLightAngleL; } + float GetDamageLightAngleQ() const override { return x60_damageLightAngleQ; } + zeus::CVector3f GetDamageLightPreTranslate() const override { return x64_damageLightPreTranslate; } + zeus::CVector3f GetDamageLightCenterTranslate() const override { return x70_damageLightCenterTranslate; } + float GetDamageLightXfXAngle() const override { return x7c_damageLightXfXAngle; } + float GetDamageLightXfZAngle() const override { return x80_damageLightXfZAngle; } + float GetHudDecoShakeTranslateVelConstant() const override { return x84_hudDecoShakeTranslateVelConstant; } + float GetHudDecoShakeTranslateVelLinear() const override { return x88_hudDecoShakeTranslateVelLinear; } + float GetMaxDecoDamageShakeTranslate() const override { return x8c_maxDecoDamageShakeTranslate; } + float GetDecoDamageShakeDeceleration() const override { return x90_decoDamageShakeDeceleration; } + float GetDecoShakeGainConstant() const override { return x94_decoShakeGainConstant; } + float GetDecoShakeGainLinear() const override { return x98_decoShakeGainLinear; } + float GetDecoShakeInitConstant() const override { return x9c_decoShakeInitConstant; } + float GetDecoShakeInitLinear() const override { return xa0_decoShakeInitLinear; } + float GetMaxDecoDamageShakeRotate() const override { return xa4_maxDecoDamageShakeRotate; } + u32 GetHudCamFovTweak() const override { return xa8_hudCamFovTweak; } + u32 GetHudCamYTweak() const override { return xac_hudCamYTweak; } + u32 GetHudCamZTweak() const override { return xb0_hudCamZTweak; } + float GetBeamVisorMenuAnimTime() const override { return xc0_beamVisorMenuAnimTime; } + float GetVisorBeamMenuItemActiveScale() const override { return xc4_visorBeamMenuItemActiveScale; } + float GetVisorBeamMenuItemInactiveScale() const override { return xc8_visorBeamMenuItemInactiveScale; } + float GetVisorBeamMenuItemTranslate() const override { return xcc_visorBeamMenuItemTranslate; } + float GetThreatRange() const override { return xe4_threatRange; } + float GetRadarScopeCoordRadius() const override { return xe8_radarScopeCoordRadius; } + float GetRadarPlayerPaintRadius() const override { return xec_radarPlayerPaintRadius; } + float GetRadarEnemyPaintRadius() const override { return xf0_radarEnemyPaintRadius; } + float GetMissileArrowVisTime() const override { return xf4_missileArrowVisTime; } + EHudVisMode GetHudVisMode() const override { return xf8_hudVisMode; } + EHelmetVisMode GetHelmetVisMode() const override { return xfc_helmetVisMode; } + u32 GetEnableAutoMapper() const override { return x100_enableAutoMapper; } + u32 GetEnableTargetingManager() const override { return x108_enableTargetingManager; } + u32 GetEnablePlayerVisor() const override { return x10c_enablePlayerVisor; } + float GetThreatWarningFraction() const override { return x110_threatWarningFraction; } + float GetMissileWarningFraction() const override { return x114_missileWarningFraction; } + float GetFreeLookFadeTime() const override { return x118_freeLookFadeTime; } + float GetFreeLookSfxPitchScale() const override { return x12c_freeLookSfxPitchScale; } + bool GetNoAbsoluteFreeLookSfxPitch() const override { return x130_noAbsoluteFreeLookSfxPitch; } + float GetFaceReflectionOrthoWidth() const override { return x13c_faceReflectionOrthoWidth; } + float GetFaceReflectionOrthoHeight() const override { return x140_faceReflectionOrthoHeight; } + float GetFaceReflectionDistance() const override { return x144_faceReflectionDistance; } + float GetFaceReflectionHeight() const override { return x148_faceReflectionHeight; } + float GetFaceReflectionAspect() const override { return x14c_faceReflectionAspect; } + float GetMissileWarningPulseTime() const override { return x1a0_missileWarningPulseTime; } + float GetExplosionLightFalloffMultConstant() const override { return x1a4_explosionLightFalloffMultConstant; } + float GetExplosionLightFalloffMultLinear() const override { return x1a8_explosionLightFalloffMultLinear; } + float GetExplosionLightFalloffMultQuadratic() const override { return x1ac_explosionLightFalloffMultQuadratic; } + float GetHudDamagePeakFactor() const override { return x1b4_hudDamagePeakFactor; } + float GetHudDamageFilterGainConstant() const override { return x1b8_hudDamageFilterGainConstant; } + float GetHudDamageFilterGainLinear() const override { return x1bc_hudDamageFilterGainLinear; } + float GetHudDamageFilterInitConstant() const override { return x1c0_hudDamageFilterInitConstant; } + float GetHudDamageFilterInitLinear() const override { return x1c4_hudDamageFilterInitLinear; } + float GetEnergyDrainModPeriod() const override { return x1c8_energyDrainModPeriod; } + bool GetEnergyDrainSinusoidalPulse() const override { return x1cc_energyDrainSinusoidalPulse; } + bool GetEnergyDrainFilterAdditive() const override { return x1cd_energyDrainFilterAdditive; } + float GetHudDamagePulseDuration() const override { return x1d0_hudDamagePulseDuration; } + float GetHudDamageColorGain() const override { return x1d4_hudDamageColorGain; } + float GetHudDecoShakeTranslateGain() const override { return x1d8_hudDecoShakeTranslateGain; } + float GetHudLagOffsetScale() const override { return x1dc_hudLagOffsetScale; } + float GetXrayBlurScaleLinear() const override { return x204_xrayBlurScaleLinear; } + float GetXrayBlurScaleQuadratic() const override { return x208_xrayBlurScaleQuadratic; } + float GetScanSidesAngle() const override { return x210_scanSidesAngle; } + float GetScanSidesXScale() const override { return x214_scanSidesXScale; } + float GetScanSidesPositionEnd() const override { return x218_scanSidesPositionEnd; } + float GetScanSidesDuration() const override { return x220_scanSidesDuration; } + float GetScanSidesStartTime() const override { return x224_scanSidesStartTime; } + float GetScanSidesEndTime() const override { return x228_scanSidesEndTime; } + float GetScanDataDotRadius() const override { return x22c_scanDataDotRadius; } + float GetScanDataDotPosRandMagnitude() const override { return x230_scanDataDotPosRandMag; } + float GetScanDataDotSeekDurationMin() const override { return x234_scanDataDotSeekDurationMin; } + float GetScanDataDotSeekDurationMax() const override { return x238_scanDataDotSeekDurationMax; } + float GetScanDataDotHoldDurationMin() const override { return x23c_scanDataDotHoldDurationMin; } + float GetScanDataDotHoldDurationMax() const override { return x240_scanDataDotHoldDurationMax; } + float GetScanAppearanceDuration() const override { return x244_scanAppearanceDuration; } + float GetScanPaneFlashFactor() const override { return x248_scanPaneFlashFactor; } + float GetScanPaneFadeInTime() const override { return x24c_scanPaneFadeInTime; } + float GetScanPaneFadeOutTime() const override { return x250_scanPaneFadeOutTime; } + float GetBallViewportYReduction() const override { return x254_ballViewportYReduction; } + float GetScanWindowIdleWidth() const override { return x258_scanWindowIdleW; } + float GetScanWindowIdleHeight() const override { return x25c_scanWindowIdleH; } + float GetScanWindowActiveWidth() const override { return x260_scanWindowActiveW; } + float GetScanWindowActiveHeight() const override { return x264_scanWindowActiveH; } + float GetScanWindowMagnification() const override { return x268_scanWindowMagnification; } + float GetScanWindowScanningAspect() const override { return x26c_scanWindowScanningAspect; } + float GetScanSidesPositionStart() const override { return x270_scanSidesPositionStart; } + bool GetShowAutomapperInMorphball() const override { return x274_showAutomapperInMorphball; } + bool GetLatchArticleText() const override { return x275_latchArticleText; } + float GetWorldTransManagerCharsPerSfx() const override { return x278_wtMgrCharsPerSfx; } + u32 GetXRayFogMode() const override { return x27c_xrayFogMode; } + float GetXRayFogNearZ() const override { return x280_xrayFogNearZ; } + float GetXRayFogFarZ() const override { return x284_xrayFogFarZ; } + const zeus::CColor& GetXRayFogColor() const override { return x288_xrayFogColor; } + float GetThermalVisorLevel() const override { return x28c_thermalVisorLevel; } + const zeus::CColor& GetThermalVisorColor() const override { return x290_thermalVisorColor; } + const zeus::CColor& GetVisorHudLightAdd(int v) const override { return x294_hudLightAddPerVisor[v]; } + const zeus::CColor& GetVisorHudLightMultiply(int v) const override { return x2a4_hudLightMultiplyPerVisor[v]; } + const zeus::CColor& GetHudReflectivityLightColor() const override { return x2b4_hudReflectivityLightColor; } + float GetHudLightAttMulConstant() const override { return x2b8_hudLightAttMulConstant; } + float GetHudLightAttMulLinear() const override { return x2bc_hudLightAttMulLinear; } + float GetHudLightAttMulQuadratic() const override { return x2c0_hudLightAttMulQuadratic; } + std::string_view GetCreditsTable() const override { return x2d0_creditsTable; } + std::string_view GetCreditsFont() const override { return x2e0_creditsFont; } + std::string_view GetJapaneseCreditsFont() const override { return x2f0_japaneseCreditsFont; } + const zeus::CColor& GetCreditsTextFontColor() const override { return x300_; } + const zeus::CColor& GetCreditsTextBorderColor() const override { return x304_; } + + float GetScanSpeed(int idx) const override { + if (idx < 0 || size_t(idx) >= x2c4_scanSpeeds.size()) + return 0.f; + return x2c4_scanSpeeds[idx]; + } + + void FixupValues() { + xd8_ = zeus::degToRad(xd8_); + xdc_ = zeus::degToRad(xdc_); + + x200_ = zeus::CColor(x1f4_ * 0.25f, x1f8_ * 0.25f, x1fc_ * 0.25f, 1.f); + + x210_scanSidesAngle = zeus::degToRad(x210_scanSidesAngle); + x228_scanSidesEndTime = x220_scanSidesDuration + x224_scanSidesStartTime; + + if (x27c_xrayFogMode == 1) + x27c_xrayFogMode = 2; + else if (x27c_xrayFogMode == 2) + x27c_xrayFogMode = 4; + else if (x27c_xrayFogMode == 3) + x27c_xrayFogMode = 5; + else + x27c_xrayFogMode = 0; + + x84_hudDecoShakeTranslateVelConstant *= 2.0f; + } +}; +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakGuiColors.cpp b/Runtime/MP1/Tweaks/CTweakGuiColors.cpp new file mode 100644 index 000000000..6a06505ff --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGuiColors.cpp @@ -0,0 +1,132 @@ +#include "Runtime/MP1/Tweaks/CTweakGuiColors.hpp" +#include "Runtime/Streams/IOStreams.hpp" + + +namespace metaforce::MP1 { + +CTweakGuiColors::SPerVisorColors::SPerVisorColors(CInputStream& in) { + x0_energyBarFilled = in.Get(); + x4_energyBarEmpty = in.Get(); + x8_energyBarShadow = in.Get(); + xc_energyTankFilled = in.Get(); + x10_energyTankEmpty = in.Get(); + x14_energyDigitsFont = in.Get(); + x18_energyDigitsOutline = in.Get(); +} + +CTweakGuiColors::CTweakGuiColors(CInputStream& in) { + x4_pauseBlurFilterColor = in.Get(); + x8_radarStuffColor = in.Get(); + xc_radarPlayerPaintColor = in.Get(); + x10_radarEnemyPaintColor = in.Get(); + x14_hudMessageFill = in.Get(); + x18_hudMessageOutline = in.Get(); + x1c_hudFrameColor = in.Get(); + x20_ = in.Get(); + x24_ = in.Get(); + x28_missileIconColorActive = in.Get(); + x2c_visorBeamMenuItemActive = in.Get(); + x30_visorBeamMenuColorInactive = in.Get(); + x34_energyBarFilledLowEnergy = in.Get(); + x38_energyBarShadowLowEnergy = in.Get(); + x3c_energyBarEmptyLowEnergy = in.Get(); + x40_hudDamageLightColor = in.Get(); + x44_ = in.Get(); + x48_ = in.Get(); + x4c_visorMenuTextFont = in.Get(); + x50_visorMenuTextOutline = in.Get(); + x54_beamMenuTextFont = in.Get(); + x58_beamMenuTextOutline = in.Get(); + x5c_energyWarningFont = in.Get(); + x60_threatWarningFont = in.Get(); + x64_missileWarningFont = in.Get(); + x68_threatBarFilled = in.Get(); + x6c_threatBarShadow = in.Get(); + x70_threatBarEmpty = in.Get(); + x74_missileBarFilled = in.Get(); + x78_missileBarShadow = in.Get(); + x7c_missileBarEmpty = in.Get(); + x80_threatIconColor = in.Get(); + x84_ = in.Get(); + x88_tickDecoColor = in.Get(); + x8c_helmetLightColor = in.Get(); + x90_threatIconSafeColor = in.Get(); + x94_missileIconColorInactive = in.Get(); + x98_missileIconColorChargedCanAlt = in.Get(); + x9c_missileIconColorChargedNoAlt = in.Get(); + xa0_missileIconColorDepleteAlt = in.Get(); + xa4_ = in.Get(); + xa8_ = in.Get(); + xac_ = in.Get(); + xb0_visorBeamMenuLozColor = in.Get(); + xb4_energyWarningOutline = in.Get(); + xb8_threatWarningOutline = in.Get(); + xbc_missileWarningOutline = in.Get(); + xc0_ = in.Get(); + xc4_damageAmbientColor = in.Get(); + xc8_scanFrameInactiveColor = in.Get(); + xcc_scanFrameActiveColor = in.Get(); + xd0_scanFrameImpulseColor = in.Get(); + xd4_scanVisorHudLightMultiply = in.Get(); + xd8_scanVisorScreenDimColor = in.Get(); + xdc_thermalVisorHudLightMultiply = in.Get(); + xe0_energyDrainFilterColor = in.Get(); + xe4_damageAmbientPulseColor = in.Get(); + xe8_energyBarFlashColor = in.Get(); + xec_ = in.Get(); + xf0_ = in.Get(); + xf4_ = in.Get(); + xf8_ = in.Get(); + xfc_ = in.Get(); + x100_xrayEnergyDecoColor = in.Get(); + x104_ = in.Get(); + x108_ = in.Get(); + x10c_ = in.Get(); + x110_ = in.Get(); + x114_ = in.Get(); + x118_ = in.Get(); + x11c_ = in.Get(); + x120_ = in.Get(); + x124_ = in.Get(); + x128_ = in.Get(); + x12c_ = in.Get(); + x130_ = in.Get(); + x134_ = in.Get(); + x138_scanDataDotColor = in.Get(); + x13c_powerBombDigitAvailableFont = in.Get(); + x140_powerBombDigitAvailableOutline = in.Get(); + x144_ = in.Get(); + x148_ballBombFilled = in.Get(); + x14c_ballBombEmpty = in.Get(); + x150_powerBombIconAvailable = in.Get(); + x154_ = in.Get(); + x158_ballEnergyDeco = in.Get(); + x15c_ballBombDeco = in.Get(); + x160_powerBombDigitDepletedFont = in.Get(); + x164_powerBombDigitDepletedOutline = in.Get(); + x168_powerBombIconUnavailable = in.Get(); + x16c_ = in.Get(); + x170_ = in.Get(); + x174_scanDisplayImagePaneColor = in.Get(); + x178_ = in.Get(); + x17c_threatIconWarningColor = in.Get(); + x180_hudCounterFill = in.Get(); + x184_hudCounterOutline = in.Get(); + x188_scanIconCriticalColor = in.Get(); + x18c_scanIconCriticalDimColor = in.Get(); + x190_scanIconNoncriticalColor = in.Get(); + x194_scanIconNoncriticalDimColor = in.Get(); + x198_scanReticuleColor = in.Get(); + x19c_threatDigitsFont = in.Get(); + x1a0_threatDigitsOutline = in.Get(); + x1a4_missileDigitsFont = in.Get(); + x1a8_missileDigitsOutline = in.Get(); + x1ac_thermalDecoColor = in.Get(); + x1b0_thermalOutlinesColor = in.Get(); + x1b4_ = in.Get(); + x1b8_thermalLockColor = in.Get(); + x1bc_pauseItemAmber = in.Get(); + x1c0_pauseItemBlue = in.Get(); + read_reserved_vector(x1c4_perVisorColors, in); +} +} \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakGuiColors.hpp b/Runtime/MP1/Tweaks/CTweakGuiColors.hpp new file mode 100644 index 000000000..7f6d79a7e --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGuiColors.hpp @@ -0,0 +1,226 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakGuiColors.hpp" +#include "Runtime/rstl.hpp" + +namespace metaforce::MP1 { +struct CTweakGuiColors final : public Tweaks::ITweakGuiColors { + zeus::CColor x4_pauseBlurFilterColor; + zeus::CColor x8_radarStuffColor; + zeus::CColor xc_radarPlayerPaintColor; + zeus::CColor x10_radarEnemyPaintColor; + zeus::CColor x14_hudMessageFill; + zeus::CColor x18_hudMessageOutline; + zeus::CColor x1c_hudFrameColor; + zeus::CColor x20_; + zeus::CColor x24_; + zeus::CColor x28_missileIconColorActive; + zeus::CColor x2c_visorBeamMenuItemActive; + zeus::CColor x30_visorBeamMenuColorInactive; + zeus::CColor x34_energyBarFilledLowEnergy; + zeus::CColor x38_energyBarShadowLowEnergy; + zeus::CColor x3c_energyBarEmptyLowEnergy; + zeus::CColor x40_hudDamageLightColor; + zeus::CColor x44_; + zeus::CColor x48_; + zeus::CColor x4c_visorMenuTextFont; + zeus::CColor x50_visorMenuTextOutline; + zeus::CColor x54_beamMenuTextFont; + zeus::CColor x58_beamMenuTextOutline; + zeus::CColor x5c_energyWarningFont; + zeus::CColor x60_threatWarningFont; + zeus::CColor x64_missileWarningFont; + zeus::CColor x68_threatBarFilled; + zeus::CColor x6c_threatBarShadow; + zeus::CColor x70_threatBarEmpty; + zeus::CColor x74_missileBarFilled; + zeus::CColor x78_missileBarShadow; + zeus::CColor x7c_missileBarEmpty; + zeus::CColor x80_threatIconColor; + zeus::CColor x84_; + zeus::CColor x88_tickDecoColor; + zeus::CColor x8c_helmetLightColor; + zeus::CColor x90_threatIconSafeColor; + zeus::CColor x94_missileIconColorInactive; + zeus::CColor x98_missileIconColorChargedCanAlt; + zeus::CColor x9c_missileIconColorChargedNoAlt; + zeus::CColor xa0_missileIconColorDepleteAlt; + zeus::CColor xa4_; + zeus::CColor xa8_; + zeus::CColor xac_; + zeus::CColor xb0_visorBeamMenuLozColor; + zeus::CColor xb4_energyWarningOutline; + zeus::CColor xb8_threatWarningOutline; + zeus::CColor xbc_missileWarningOutline; + zeus::CColor xc0_; + zeus::CColor xc4_damageAmbientColor; + zeus::CColor xc8_scanFrameInactiveColor; + zeus::CColor xcc_scanFrameActiveColor; + zeus::CColor xd0_scanFrameImpulseColor; + zeus::CColor xd4_scanVisorHudLightMultiply; + zeus::CColor xd8_scanVisorScreenDimColor; + zeus::CColor xdc_thermalVisorHudLightMultiply; + zeus::CColor xe0_energyDrainFilterColor; + zeus::CColor xe4_damageAmbientPulseColor; + zeus::CColor xe8_energyBarFlashColor; + zeus::CColor xec_; + zeus::CColor xf0_; + zeus::CColor xf4_; + zeus::CColor xf8_; + zeus::CColor xfc_; + zeus::CColor x100_xrayEnergyDecoColor; + zeus::CColor x104_; + zeus::CColor x108_; + zeus::CColor x10c_; + zeus::CColor x110_; + zeus::CColor x114_; + zeus::CColor x118_; + zeus::CColor x11c_; + zeus::CColor x120_; + zeus::CColor x124_; + zeus::CColor x128_; + zeus::CColor x12c_; + zeus::CColor x130_; + zeus::CColor x134_; + zeus::CColor x138_scanDataDotColor; + zeus::CColor x13c_powerBombDigitAvailableFont; + zeus::CColor x140_powerBombDigitAvailableOutline; + zeus::CColor x144_; + zeus::CColor x148_ballBombFilled; + zeus::CColor x14c_ballBombEmpty; + zeus::CColor x150_powerBombIconAvailable; + zeus::CColor x154_; + zeus::CColor x158_ballEnergyDeco; + zeus::CColor x15c_ballBombDeco; + zeus::CColor x160_powerBombDigitDepletedFont; + zeus::CColor x164_powerBombDigitDepletedOutline; + zeus::CColor x168_powerBombIconUnavailable; + zeus::CColor x16c_; + zeus::CColor x170_; + zeus::CColor x174_scanDisplayImagePaneColor; + zeus::CColor x178_; + zeus::CColor x17c_threatIconWarningColor; + zeus::CColor x180_hudCounterFill; + zeus::CColor x184_hudCounterOutline; + zeus::CColor x188_scanIconCriticalColor; + zeus::CColor x18c_scanIconCriticalDimColor; + zeus::CColor x190_scanIconNoncriticalColor; + zeus::CColor x194_scanIconNoncriticalDimColor; + zeus::CColor x198_scanReticuleColor; + zeus::CColor x19c_threatDigitsFont; + zeus::CColor x1a0_threatDigitsOutline; + zeus::CColor x1a4_missileDigitsFont; + zeus::CColor x1a8_missileDigitsOutline; + zeus::CColor x1ac_thermalDecoColor; + zeus::CColor x1b0_thermalOutlinesColor; + zeus::CColor x1b4_; + zeus::CColor x1b8_thermalLockColor; + zeus::CColor x1bc_pauseItemAmber; + zeus::CColor x1c0_pauseItemBlue; + struct SPerVisorColors { + zeus::CColor x0_energyBarFilled; + zeus::CColor x4_energyBarEmpty; + zeus::CColor x8_energyBarShadow; + zeus::CColor xc_energyTankFilled; + zeus::CColor x10_energyTankEmpty; + zeus::CColor x14_energyDigitsFont; + zeus::CColor x18_energyDigitsOutline; + explicit SPerVisorColors() = default; + explicit SPerVisorColors(CInputStream& in); + }; + /* Combat, Scan, XRay, Thermal, Ball */ + rstl::reserved_vector x1c4_perVisorColors{}; + + CTweakGuiColors() = default; + CTweakGuiColors(CInputStream& r); + const zeus::CColor& GetPauseBlurFilterColor() const override { return x4_pauseBlurFilterColor; } + const zeus::CColor& GetRadarStuffColor() const override { return x8_radarStuffColor; } + const zeus::CColor& GetRadarPlayerPaintColor() const override { return xc_radarPlayerPaintColor; } + const zeus::CColor& GetRadarEnemyPaintColor() const override { return x10_radarEnemyPaintColor; } + const zeus::CColor& GetHudMessageFill() const override { return x14_hudMessageFill; } + const zeus::CColor& GetHudMessageOutline() const override { return x18_hudMessageOutline; } + const zeus::CColor& GetHudFrameColor() const override { return x1c_hudFrameColor; } + const zeus::CColor& GetMissileIconColorActive() const override { return x28_missileIconColorActive; } + const zeus::CColor& GetVisorBeamMenuItemActive() const override { return x2c_visorBeamMenuItemActive; } + const zeus::CColor& GetVisorBeamMenuItemInactive() const override { return x30_visorBeamMenuColorInactive; } + const zeus::CColor& GetEnergyBarFilledLowEnergy() const override { return x34_energyBarFilledLowEnergy; } + const zeus::CColor& GetEnergyBarShadowLowEnergy() const override { return x38_energyBarShadowLowEnergy; } + const zeus::CColor& GetEnergyBarEmptyLowEnergy() const override { return x3c_energyBarEmptyLowEnergy; } + const zeus::CColor& GetHudDamageLightColor() const override { return x40_hudDamageLightColor; } + const zeus::CColor& GetVisorMenuTextFont() const override { return x4c_visorMenuTextFont; } + const zeus::CColor& GetVisorMenuTextOutline() const override { return x50_visorMenuTextOutline; } + const zeus::CColor& GetBeamMenuTextFont() const override { return x54_beamMenuTextFont; } + const zeus::CColor& GetBeamMenuTextOutline() const override { return x58_beamMenuTextOutline; } + const zeus::CColor& GetEnergyWarningFont() const override { return x5c_energyWarningFont; } + const zeus::CColor& GetThreatWarningFont() const override { return x60_threatWarningFont; } + const zeus::CColor& GetMissileWarningFont() const override { return x64_missileWarningFont; } + const zeus::CColor& GetThreatBarFilled() const override { return x68_threatBarFilled; } + const zeus::CColor& GetThreatBarShadow() const override { return x6c_threatBarShadow; } + const zeus::CColor& GetThreatBarEmpty() const override { return x70_threatBarEmpty; } + const zeus::CColor& GetMissileBarFilled() const override { return x74_missileBarFilled; } + const zeus::CColor& GetMissileBarShadow() const override { return x78_missileBarShadow; } + const zeus::CColor& GetMissileBarEmpty() const override { return x7c_missileBarEmpty; } + const zeus::CColor& GetThreatIconColor() const override { return x80_threatIconColor; } + const zeus::CColor& GetTickDecoColor() const override { return x88_tickDecoColor; } + const zeus::CColor& GetHelmetLightColor() const override { return x8c_helmetLightColor; } + const zeus::CColor& GetThreatIconSafeColor() const override { return x90_threatIconSafeColor; } + const zeus::CColor& GetMissileIconColorInactive() const override { return x94_missileIconColorInactive; } + const zeus::CColor& GetMissileIconColorChargedCanAlt() const override { return x98_missileIconColorChargedCanAlt; } + const zeus::CColor& GetMissileIconColorChargedNoAlt() const override { return x9c_missileIconColorChargedNoAlt; } + const zeus::CColor& GetMissileIconColorDepleteAlt() const override { return xa0_missileIconColorDepleteAlt; } + const zeus::CColor& GetVisorBeamMenuLozColor() const override { return xb0_visorBeamMenuLozColor; } + const zeus::CColor& GetEnergyWarningOutline() const override { return xb4_energyWarningOutline; } + const zeus::CColor& GetThreatWarningOutline() const override { return xb8_threatWarningOutline; } + const zeus::CColor& GetMissileWarningOutline() const override { return xbc_missileWarningOutline; } + const zeus::CColor& GetDamageAmbientColor() const override { return xc4_damageAmbientColor; } + const zeus::CColor& GetScanFrameInactiveColor() const override { return xc8_scanFrameInactiveColor; } + const zeus::CColor& GetScanFrameActiveColor() const override { return xcc_scanFrameActiveColor; } + const zeus::CColor& GetScanFrameImpulseColor() const override { return xd0_scanFrameImpulseColor; } + const zeus::CColor& GetScanVisorHudLightMultiply() const override { return xd4_scanVisorHudLightMultiply; } + const zeus::CColor& GetScanVisorScreenDimColor() const override { return xd8_scanVisorScreenDimColor; } + const zeus::CColor& GetThermalVisorHudLightMultiply() const override { return xdc_thermalVisorHudLightMultiply; } + const zeus::CColor& GetEnergyDrainFilterColor() const override { return xe0_energyDrainFilterColor; } + const zeus::CColor& GetDamageAmbientPulseColor() const override { return xe4_damageAmbientPulseColor; } + const zeus::CColor& GetEnergyBarFlashColor() const override { return xe8_energyBarFlashColor; } + const zeus::CColor& GetXRayEnergyDecoColor() const override { return x100_xrayEnergyDecoColor; } + const zeus::CColor& GetScanDataDotColor() const override { return x138_scanDataDotColor; } + const zeus::CColor& GetPowerBombDigitAvailableFont() const override { return x13c_powerBombDigitAvailableFont; } + const zeus::CColor& GetPowerBombDigitAvailableOutline() const override { return x140_powerBombDigitAvailableOutline; } + const zeus::CColor& GetBallBombFilledColor() const override { return x148_ballBombFilled; } + const zeus::CColor& GetBallBombEmptyColor() const override { return x14c_ballBombEmpty; } + const zeus::CColor& GetPowerBombIconAvailableColor() const override { return x150_powerBombIconAvailable; } + const zeus::CColor& GetBallBombEnergyColor() const override { return x158_ballEnergyDeco; } + const zeus::CColor& GetBallBombDecoColor() const override { return x15c_ballBombDeco; } + const zeus::CColor& GetPowerBombDigitDelpetedFont() const override { return x160_powerBombDigitDepletedFont; } + const zeus::CColor& GetPowerBombDigitDelpetedOutline() const override { return x164_powerBombDigitDepletedOutline; } + const zeus::CColor& GetPowerBombIconDepletedColor() const override { return x168_powerBombIconUnavailable; } + const zeus::CColor& GetScanDisplayImagePaneColor() const override { return x174_scanDisplayImagePaneColor; } + const zeus::CColor& GetThreatIconWarningColor() const override { return x17c_threatIconWarningColor; } + const zeus::CColor& GetHudCounterFill() const override { return x180_hudCounterFill; } + const zeus::CColor& GetHudCounterOutline() const override { return x184_hudCounterOutline; } + const zeus::CColor& GetScanIconCriticalColor() const override { return x188_scanIconCriticalColor; } + const zeus::CColor& GetScanIconCriticalDimColor() const override { return x18c_scanIconCriticalDimColor; } + const zeus::CColor& GetScanIconNoncriticalColor() const override { return x190_scanIconNoncriticalColor; } + const zeus::CColor& GetScanIconNoncriticalDimColor() const override { return x194_scanIconNoncriticalDimColor; } + const zeus::CColor& GetScanReticuleColor() const override { return x198_scanReticuleColor; } + const zeus::CColor& GetThreatDigitsFont() const override { return x19c_threatDigitsFont; } + const zeus::CColor& GetThreatDigitsOutline() const override { return x1a0_threatDigitsOutline; } + const zeus::CColor& GetMissileDigitsFont() const override { return x1a4_missileDigitsFont; } + const zeus::CColor& GetMissileDigitsOutline() const override { return x1a8_missileDigitsOutline; } + const zeus::CColor& GetThermalDecoColor() const override { return x1ac_thermalDecoColor; } + const zeus::CColor& GetThermalOutlinesColor() const override { return x1b0_thermalOutlinesColor; } + const zeus::CColor& GetThermalLockColor() const override { return x1b8_thermalLockColor; } + const zeus::CColor& GetPauseItemAmberColor() const override { return x1bc_pauseItemAmber; } + const zeus::CColor& GetPauseItemBlueColor() const override { return x1c0_pauseItemBlue; } + + SVisorEnergyInitColors GetVisorEnergyInitColors(int idx) const override { + const SPerVisorColors& colors = x1c4_perVisorColors[idx]; + return {colors.xc_energyTankFilled, colors.x10_energyTankEmpty, colors.x14_energyDigitsFont, + colors.x18_energyDigitsOutline}; + } + SVisorEnergyBarColors GetVisorEnergyBarColors(int idx) const override { + const SPerVisorColors& colors = x1c4_perVisorColors[idx]; + return {colors.x0_energyBarFilled, colors.x4_energyBarEmpty, colors.x8_energyBarShadow}; + } +}; +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakGunRes.cpp b/Runtime/MP1/Tweaks/CTweakGunRes.cpp new file mode 100644 index 000000000..2a2453c0f --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGunRes.cpp @@ -0,0 +1,48 @@ +#include "Runtime/MP1/Tweaks/CTweakGunRes.hpp" + +namespace metaforce::MP1 { +CTweakGunRes::CTweakGunRes(CInputStream& in) { + m_gunMotion = in.Get(); + m_grappleArm = in.Get(); + m_rightHand = in.Get(); + m_powerBeam = in.Get(); + m_iceBeam = in.Get(); + m_waveBeam = in.Get(); + m_plasmaBeam = in.Get(); + m_phazonBeam = in.Get(); + m_holoTransition = in.Get(); + m_bombSet = in.Get(); + m_bombExplode = in.Get(); + m_powerBombExplode = in.Get(); + m_powerBeamWp = in.Get(); + m_powerBallWp = in.Get(); + m_iceBeamWp = in.Get(); + m_iceBallWp = in.Get(); + m_waveBeamWp = in.Get(); + m_waveBallWp = in.Get(); + m_plasmaBeamWp = in.Get(); + m_plasmaBallWp = in.Get(); + m_phazonBeamWp = in.Get(); + m_phazonBallWp = in.Get(); + m_powerMuzzle = in.Get(); + m_iceMuzzle = in.Get(); + m_waveMuzzle = in.Get(); + m_plasmaMuzzle = in.Get(); + m_phazonMuzzle = in.Get(); + m_powerCharge = in.Get(); + m_iceCharge = in.Get(); + m_waveCharge = in.Get(); + m_plasmaCharge = in.Get(); + m_phazonCharge = in.Get(); + m_powerAuxMuzzle = in.Get(); + m_iceAuxMuzzle = in.Get(); + m_waveAuxMuzzle = in.Get(); + m_plasmaAuxMuzzle = in.Get(); + m_phazonAuxMuzzle = in.Get(); + m_grappleSegment = in.Get(); + m_grappleClaw = in.Get(); + m_grappleHit = in.Get(); + m_grappleMuzzle = in.Get(); + m_grappleSwoosh = in.Get(); +} +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakGunRes.hpp b/Runtime/MP1/Tweaks/CTweakGunRes.hpp new file mode 100644 index 000000000..2b05be76f --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakGunRes.hpp @@ -0,0 +1,90 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakGunRes.hpp" + +namespace metaforce::MP1 { + +struct CTweakGunRes final : Tweaks::ITweakGunRes { + std::string m_gunMotion; + std::string m_grappleArm; + std::string m_rightHand; + + std::string m_powerBeam; + std::string m_iceBeam; + std::string m_waveBeam; + std::string m_plasmaBeam; + std::string m_phazonBeam; + + std::string m_holoTransition; + + std::string m_bombSet; + std::string m_bombExplode; + std::string m_powerBombExplode; + + std::string m_powerBeamWp; + std::string m_powerBallWp; + std::string m_iceBeamWp; + std::string m_iceBallWp; + std::string m_waveBeamWp; + std::string m_waveBallWp; + std::string m_plasmaBeamWp; + std::string m_plasmaBallWp; + std::string m_phazonBeamWp; + std::string m_phazonBallWp; + + std::string m_powerMuzzle; + std::string m_iceMuzzle; + std::string m_waveMuzzle; + std::string m_plasmaMuzzle; + std::string m_phazonMuzzle; + + std::string m_powerCharge; + std::string m_iceCharge; + std::string m_waveCharge; + std::string m_plasmaCharge; + std::string m_phazonCharge; + + std::string m_powerAuxMuzzle; + std::string m_iceAuxMuzzle; + std::string m_waveAuxMuzzle; + std::string m_plasmaAuxMuzzle; + std::string m_phazonAuxMuzzle; + + std::string m_grappleSegment; + std::string m_grappleClaw; + std::string m_grappleHit; + std::string m_grappleMuzzle; + std::string m_grappleSwoosh; + + const std::string& GetGunMotion() const override { return m_gunMotion; } + const std::string& GetGrappleArm() const override { return m_grappleArm; } + const std::string& GetRightHand() const override { return m_rightHand; } + + const std::string& GetPowerBeam() const override { return m_powerBeam; } + const std::string& GetIceBeam() const override { return m_iceBeam; } + const std::string& GetWaveBeam() const override { return m_waveBeam; } + const std::string& GetPlasmaBeam() const override { return m_plasmaBeam; } + const std::string& GetPhazonBeam() const override { return m_phazonBeam; } + + const std::string& GetHoloTransition() const override { return m_holoTransition; } + + const std::string& GetBombSet() const override { return m_bombSet; } + const std::string& GetBombExplode() const override { return m_bombExplode; } + const std::string& GetPowerBombExplode() const override { return m_powerBombExplode; } + + const std::string& GetWeapon(size_t idx, bool ball) const override { return (&m_powerBeamWp)[idx * 2 + ball]; } + const std::string& GetMuzzleParticle(size_t idx) const override { return (&m_powerMuzzle)[idx]; } + const std::string& GetChargeParticle(size_t idx) const override { return (&m_powerCharge)[idx]; } + const std::string& GetAuxMuzzleParticle(size_t idx) const override { return (&m_powerAuxMuzzle)[idx]; } + + const std::string& GetGrappleSegmentParticle() const override { return m_grappleSegment; } + const std::string& GetGrappleClawParticle() const override { return m_grappleClaw; } + const std::string& GetGrappleHitParticle() const override { return m_grappleHit; } + const std::string& GetGrappleMuzzleParticle() const override { return m_grappleMuzzle; } + const std::string& GetGrappleSwooshParticle() const override { return m_grappleSwoosh; } + + CTweakGunRes() = default; + CTweakGunRes(CInputStream& in); +}; + +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakParticle.cpp b/Runtime/MP1/Tweaks/CTweakParticle.cpp new file mode 100644 index 000000000..e86cb7b09 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakParticle.cpp @@ -0,0 +1,10 @@ +#include "Runtime/MP1/Tweaks/CTweakParticle.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakParticle::CTweakParticle(CInputStream& in) { + m_particle = in.Get(); + m_powerBeam = in.Get(); + m_genThrust = in.Get(); +} +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakParticle.hpp b/Runtime/MP1/Tweaks/CTweakParticle.hpp new file mode 100644 index 000000000..c6f86aea1 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakParticle.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakParticle.hpp" + +namespace metaforce::MP1 { + +struct CTweakParticle final : Tweaks::ITweakParticle { + std::string m_particle; + std::string m_powerBeam; + std::string m_genThrust; + + CTweakParticle() = default; + CTweakParticle(CInputStream& reader); +}; + +} // namespace DataSpec::DNAMP1 diff --git a/Runtime/MP1/Tweaks/CTweakPlayer.cpp b/Runtime/MP1/Tweaks/CTweakPlayer.cpp new file mode 100644 index 000000000..8af0e93c5 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayer.cpp @@ -0,0 +1,1666 @@ +#include "Runtime/MP1/Tweaks/CTweakPlayer.hpp" + +#include "Runtime/Streams/IOStreams.hpp" + +#include "zeus/Math.hpp" + +#include "Runtime/ConsoleVariables/CVar.hpp" +#include "Runtime/ConsoleVariables/CVarManager.hpp" + +#define DEFINE_CVAR_GLOBAL(name) \ + constexpr std::string_view sk##name = std::string_view("tweak.player." #name); \ + CVar* tw_##name = nullptr; + +#define CREATE_CVAR(name, help, value, flags) \ + tw_##name = mgr->findOrMakeCVar(sk##name, help, value, flags); \ + if (tw_##name->wasDeserialized()) { \ + tw_##name->toValue(value); \ + } \ + tw_##name->addListener([this](CVar* cv) { _tweakListener(cv); }); + +#define CREATE_CVAR_BITFIELD(name, help, value, flags) \ + { \ + bool tmp = value; \ + CREATE_CVAR(name, help, tmp, flags) \ + } + +#define UPDATE_CVAR(name, cv, value) \ + if ((cv) == tw_##name) { \ + (cv)->toValue(value); \ + return; \ + } + +#define UPDATE_CVAR_BITFIELD(name, cv, value) \ + { \ + bool tmp = value; \ + UPDATE_CVAR(name, cv, tmp) \ + (value) = tmp; \ + } + +namespace metaforce::MP1 { +namespace { +static constexpr CVar::EFlags skDefaultFlags = CVar::EFlags::Game | CVar::EFlags::Cheat | CVar::EFlags::Archive; +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationNormal); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationAir); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationIce); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationOrganic); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationWater); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationLava); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationPhazon); +DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationShrubbery); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationNormal); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationAir); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationIce); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationOrganic); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationWater); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationLava); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationPhazon); +DEFINE_CVAR_GLOBAL(MaxRotationAccelerationShrubbery); +DEFINE_CVAR_GLOBAL(TranslationFrictionNormal); +DEFINE_CVAR_GLOBAL(TranslationFrictionAir); +DEFINE_CVAR_GLOBAL(TranslationFrictionIce); +DEFINE_CVAR_GLOBAL(TranslationFrictionOrganic); +DEFINE_CVAR_GLOBAL(TranslationFrictionWater); +DEFINE_CVAR_GLOBAL(TranslationFrictionLava); +DEFINE_CVAR_GLOBAL(TranslationFrictionPhazon); +DEFINE_CVAR_GLOBAL(TranslationFrictionShrubbery); +DEFINE_CVAR_GLOBAL(RotationFrictionNormal); +DEFINE_CVAR_GLOBAL(RotationFrictionAir); +DEFINE_CVAR_GLOBAL(RotationFrictionIce); +DEFINE_CVAR_GLOBAL(RotationFrictionOrganic); +DEFINE_CVAR_GLOBAL(RotationFrictionWater); +DEFINE_CVAR_GLOBAL(RotationFrictionLava); +DEFINE_CVAR_GLOBAL(RotationFrictionPhazon); +DEFINE_CVAR_GLOBAL(RotationFrictionShrubbery); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedNormal); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedAir); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedIce); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedOrganic); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedWater); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedLava); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedPhazon); +DEFINE_CVAR_GLOBAL(RotationMaxSpeedShrubbery); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedNormal); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedAir); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedIce); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedOrganic); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedWater); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedLava); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedPhazon); +DEFINE_CVAR_GLOBAL(TranslationMaxSpeedShrubbery); +DEFINE_CVAR_GLOBAL(NormalGravityAcceleration); +DEFINE_CVAR_GLOBAL(FluidGravityAcceleration); +DEFINE_CVAR_GLOBAL(VerticalJumpAcceleration); +DEFINE_CVAR_GLOBAL(HorizontalJumpAcceleration); +DEFINE_CVAR_GLOBAL(VerticalDoubleJumpAcceleration); +DEFINE_CVAR_GLOBAL(HorizontalDoubleJumpAcceleration); +DEFINE_CVAR_GLOBAL(WaterJumpFactor); +DEFINE_CVAR_GLOBAL(WaterBallJumpFactor); +DEFINE_CVAR_GLOBAL(LavaJumpFactor); +DEFINE_CVAR_GLOBAL(LavaBallJumpFactor); +DEFINE_CVAR_GLOBAL(PhazonJumpFactor); +DEFINE_CVAR_GLOBAL(PhazonBallJumpFactor); +DEFINE_CVAR_GLOBAL(AllowedJumpTime); +DEFINE_CVAR_GLOBAL(AllowedDoubleJumpTime); +DEFINE_CVAR_GLOBAL(MinDoubleJumpWindow); +DEFINE_CVAR_GLOBAL(MaxDoubleJumpWindow) +// DEFINE_CVAR_GLOBAL(); // x104_ +DEFINE_CVAR_GLOBAL(MinJumpTime); +DEFINE_CVAR_GLOBAL(MinDoubleJumpTime); +DEFINE_CVAR_GLOBAL(AllowedLedgeTime); +DEFINE_CVAR_GLOBAL(DoubleJumpImpulse); +DEFINE_CVAR_GLOBAL(BackwardsForceMultiplier); +DEFINE_CVAR_GLOBAL(BombJumpRadius); +DEFINE_CVAR_GLOBAL(BombJumpHeight); +DEFINE_CVAR_GLOBAL(EyeOffset); +DEFINE_CVAR_GLOBAL(TurnSpeedMultiplier); +DEFINE_CVAR_GLOBAL(FreeLookTurnSpeedMultiplier); +DEFINE_CVAR_GLOBAL(HorizontalFreeLookAngleVelocity); +DEFINE_CVAR_GLOBAL(VerticalFreeLookAngleVelocity); +DEFINE_CVAR_GLOBAL(FreeLookSpeed); +DEFINE_CVAR_GLOBAL(FreeLookSnapSpeed); +// DEFINE_CVAR_GLOBAL(); // x140_ +DEFINE_CVAR_GLOBAL(FreeLookCenteredThresholdAngle); +DEFINE_CVAR_GLOBAL(FreeLookCenteredTime); +DEFINE_CVAR_GLOBAL(FreeLookDampenFactor); +DEFINE_CVAR_GLOBAL(LeftDivisor); +DEFINE_CVAR_GLOBAL(RightDivisor); +DEFINE_CVAR_GLOBAL(OrbitMinDistanceClose); +DEFINE_CVAR_GLOBAL(OrbitMinDistanceFar); +DEFINE_CVAR_GLOBAL(OrbitMinDistanceDefault); +DEFINE_CVAR_GLOBAL(OrbitNormalDistanceClose); +DEFINE_CVAR_GLOBAL(OrbitNormalDistanceFar); +DEFINE_CVAR_GLOBAL(OrbitNormalDistanceDefault); +DEFINE_CVAR_GLOBAL(OrbitMaxDistanceClose); +DEFINE_CVAR_GLOBAL(OrbitMaxDistanceFar); +DEFINE_CVAR_GLOBAL(OrbitMaxDistanceDefault); +// DEFINE_CVAR_GLOBAL(); // x17c_ +DEFINE_CVAR_GLOBAL(OrbitmodeTimer); +DEFINE_CVAR_GLOBAL(OrbitCameraSpeed); +DEFINE_CVAR_GLOBAL(OrbitUpperAngle); +DEFINE_CVAR_GLOBAL(OrbitLowerAngle); +DEFINE_CVAR_GLOBAL(OrbitHorizontalAngle); +// DEFINE_CVAR_GLOBAL(); // x194_ +// DEFINE_CVAR_GLOBAL(); // x198_ +DEFINE_CVAR_GLOBAL(OrbitMaxTargetDistance); +DEFINE_CVAR_GLOBAL(OrbitMaxLockDistance); +DEFINE_CVAR_GLOBAL(OrbitDistanceThreshold); +DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxHalfExtentX); +DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxHalfExtentX); +DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxHalfExtentY); +DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxHalfExtentY); +DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxCenterX); +DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxCenterX); +DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxCenterY); +DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxCenterY); +DEFINE_CVAR_GLOBAL(OrbitZoneTargetingIdealX); +DEFINE_CVAR_GLOBAL(OrbitZoneScanIdealX); +DEFINE_CVAR_GLOBAL(OrbitZoneTargetingIdealY); +DEFINE_CVAR_GLOBAL(OrbitZoneScanIdealY); +DEFINE_CVAR_GLOBAL(OrbitNearX); +DEFINE_CVAR_GLOBAL(OrbitNearZ); +// DEFINE_CVAR_GLOBAL(); // x1e0_ +// DEFINE_CVAR_GLOBAL(); // x1e4_ +DEFINE_CVAR_GLOBAL(OrbitFixedOffsetZDiff); +DEFINE_CVAR_GLOBAL(OrbitZRange); +// DEFINE_CVAR_GLOBAL(); // x1f0_ +// DEFINE_CVAR_GLOBAL(); // x1f4_ +// DEFINE_CVAR_GLOBAL(); // x1f8_ +DEFINE_CVAR_GLOBAL(OrbitPreventionTime); +DEFINE_CVAR_GLOBAL(DashEnabled); +DEFINE_CVAR_GLOBAL(DashOnButtonRelease); +DEFINE_CVAR_GLOBAL(DashButtonHoldCancelTime); +DEFINE_CVAR_GLOBAL(DashStrafeInputThreshold); +DEFINE_CVAR_GLOBAL(SidewaysDoubleJumpImpulse); +DEFINE_CVAR_GLOBAL(SidewaysVerticalDoubleJumpAccel); +DEFINE_CVAR_GLOBAL(SidewaysHorizontalDoubleJumpAccel); +DEFINE_CVAR_GLOBAL(ScanningRange); +DEFINE_CVAR_GLOBAL(ScanRetention); +DEFINE_CVAR_GLOBAL(ScanFreezesGame); +DEFINE_CVAR_GLOBAL(OrbitWhileScanning); +DEFINE_CVAR_GLOBAL(ScanMaxTargetDistance); +DEFINE_CVAR_GLOBAL(ScanMaxLockDistance) +DEFINE_CVAR_GLOBAL(FreeLookTurnsPlayer); +// DEFINE_CVAR_GLOBAL(); // x228_25_ +// DEFINE_CVAR_GLOBAL(); // x228_26_ +DEFINE_CVAR_GLOBAL(MoveDuringFreelook); +DEFINE_CVAR_GLOBAL(HoldButtonsForFreeLook); +// DEFINE_CVAR_GLOBAL(); // x228_30_ +// DEFINE_CVAR_GLOBAL(); // x228_31_ +// DEFINE_CVAR_GLOBAL(); // x229_24_ +DEFINE_CVAR_GLOBAL(AimWhenOrbitingPoint); +DEFINE_CVAR_GLOBAL(StayInFreeLookWhileFiring); +// DEFINE_CVAR_GLOBAL(); // x229_27_ +// DEFINE_CVAR_GLOBAL(); // x229_28_ +DEFINE_CVAR_GLOBAL(OrbitFixedOffset); +DEFINE_CVAR_GLOBAL(GunButtonTogglesHolster); +DEFINE_CVAR_GLOBAL(GunNotFiringHolstersGun); +DEFINE_CVAR_GLOBAL(FallingDoubleJump); +DEFINE_CVAR_GLOBAL(ImpulseDoubleJump); +DEFINE_CVAR_GLOBAL(FiringCancelsCameraPitch); +DEFINE_CVAR_GLOBAL(AssistedAimingIgnoreHorizontal); +DEFINE_CVAR_GLOBAL(AssistedAimingIgnoreVertical); +// DEFINE_CVAR_GLOBAL(); // x22c +// DEFINE_CVAR_GLOBAL(); // x230_ +DEFINE_CVAR_GLOBAL(AimMaxDistance); +// DEFINE_CVAR_GLOBAL(); // x238_ +// DEFINE_CVAR_GLOBAL(); // x23c_ +// DEFINE_CVAR_GLOBAL(); // x240_ +// DEFINE_CVAR_GLOBAL(); // x244_ +// DEFINE_CVAR_GLOBAL(); // x248_ +DEFINE_CVAR_GLOBAL(AimThresholdDistance); +// DEFINE_CVAR_GLOBAL(); // x250_ +// DEFINE_CVAR_GLOBAL(); // x254_ +DEFINE_CVAR_GLOBAL(AimBoxWidth); +DEFINE_CVAR_GLOBAL(AimBoxHeight); +DEFINE_CVAR_GLOBAL(AimTargetTimer); +DEFINE_CVAR_GLOBAL(AimAssistHorizontalAngle); +DEFINE_CVAR_GLOBAL(AimAssistVerticalAngle); +DEFINE_CVAR_GLOBAL(PlayerHeight); +DEFINE_CVAR_GLOBAL(PlayerXYHalfExtent); +DEFINE_CVAR_GLOBAL(StepUpHeight); +DEFINE_CVAR_GLOBAL(StepDownHeight); +DEFINE_CVAR_GLOBAL(PlayerBallHalfExtent); +DEFINE_CVAR_GLOBAL(FirstPersonCameraSpeed); +// DEFINE_CVAR_GLOBAL(); // x284_ +DEFINE_CVAR_GLOBAL(JumpCameraPitchDownStart); +DEFINE_CVAR_GLOBAL(JumpCameraPitchDownFull); +DEFINE_CVAR_GLOBAL(JumpCameraPitchDownAngle); +DEFINE_CVAR_GLOBAL(FallCameraPitchDownStart); +DEFINE_CVAR_GLOBAL(FallCameraPitchDownFull); +DEFINE_CVAR_GLOBAL(FallCameraPitchDownAngle); +DEFINE_CVAR_GLOBAL(OrbitDistanceMax); +DEFINE_CVAR_GLOBAL(GrappleSwingLength); +DEFINE_CVAR_GLOBAL(GrappleSwingPeriod); +DEFINE_CVAR_GLOBAL(GrapplePullSpeedMin); +DEFINE_CVAR_GLOBAL(GrappleCameraSpeed); +DEFINE_CVAR_GLOBAL(MaxGrappleLockedTurnAlignDistance); +DEFINE_CVAR_GLOBAL(GrapplePullSpeedProportion); +DEFINE_CVAR_GLOBAL(GrapplePullSpeedMax); +DEFINE_CVAR_GLOBAL(GrappleLookCenterSpeed); +DEFINE_CVAR_GLOBAL(MaxGrappleTurnSpeed); +DEFINE_CVAR_GLOBAL(GrappleJumpForce); +DEFINE_CVAR_GLOBAL(GrappleReleaseTime); +DEFINE_CVAR_GLOBAL(GrappleJumpMode); +DEFINE_CVAR_GLOBAL(OrbitReleaseBreaksGrapple); +DEFINE_CVAR_GLOBAL(InvertGrappleTurn); +DEFINE_CVAR_GLOBAL(GrappleBeamSpeed); +DEFINE_CVAR_GLOBAL(GrappleBeamXWaveAmplitude); +DEFINE_CVAR_GLOBAL(GrappleBeamZWaveAmplitude); +DEFINE_CVAR_GLOBAL(GrappleBeamAnglePhaseDelta); +// DEFINE_CVAR_GLOBAL(); // x2e8_ +// DEFINE_CVAR_GLOBAL(); // x2ec_ +// DEFINE_CVAR_GLOBAL(); // x2f0_ +// DEFINE_CVAR_GLOBAL(); // x2f4_ +DEFINE_CVAR_GLOBAL(FrozenTimeout); +DEFINE_CVAR_GLOBAL(IceBreakJumpCount); +DEFINE_CVAR_GLOBAL(VariaDamageReduction); +DEFINE_CVAR_GLOBAL(GravityDamageReduction); +DEFINE_CVAR_GLOBAL(PhazonDamageReduction); +} // namespace + +CTweakPlayer::CTweakPlayer(CInputStream& in) { + /* x4_maxTranslationalAcceleration[0] */ + x4_maxTranslationalAcceleration[0] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[1] */ + x4_maxTranslationalAcceleration[1] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[2] */ + x4_maxTranslationalAcceleration[2] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[3] */ + x4_maxTranslationalAcceleration[3] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[4] */ + x4_maxTranslationalAcceleration[4] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[5] */ + x4_maxTranslationalAcceleration[5] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[6] */ + x4_maxTranslationalAcceleration[6] = in.ReadFloat(); + /* x4_maxTranslationalAcceleration[7] */ + x4_maxTranslationalAcceleration[7] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[0] */ + x24_maxRotationalAcceleration[0] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[1] */ + x24_maxRotationalAcceleration[1] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[2] */ + x24_maxRotationalAcceleration[2] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[3] */ + x24_maxRotationalAcceleration[3] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[4] */ + x24_maxRotationalAcceleration[4] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[5] */ + x24_maxRotationalAcceleration[5] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[6] */ + x24_maxRotationalAcceleration[6] = in.ReadFloat(); + /* x24_maxRotationalAcceleration[7] */ + x24_maxRotationalAcceleration[7] = in.ReadFloat(); + /* x44_translationFriction[0] */ + x44_translationFriction[0] = in.ReadFloat(); + /* x44_translationFriction[1] */ + x44_translationFriction[1] = in.ReadFloat(); + /* x44_translationFriction[2] */ + x44_translationFriction[2] = in.ReadFloat(); + /* x44_translationFriction[3] */ + x44_translationFriction[3] = in.ReadFloat(); + /* x44_translationFriction[4] */ + x44_translationFriction[4] = in.ReadFloat(); + /* x44_translationFriction[5] */ + x44_translationFriction[5] = in.ReadFloat(); + /* x44_translationFriction[6] */ + x44_translationFriction[6] = in.ReadFloat(); + /* x44_translationFriction[7] */ + x44_translationFriction[7] = in.ReadFloat(); + /* x64_rotationFriction[0] */ + x64_rotationFriction[0] = in.ReadFloat(); + /* x64_rotationFriction[1] */ + x64_rotationFriction[1] = in.ReadFloat(); + /* x64_rotationFriction[2] */ + x64_rotationFriction[2] = in.ReadFloat(); + /* x64_rotationFriction[3] */ + x64_rotationFriction[3] = in.ReadFloat(); + /* x64_rotationFriction[4] */ + x64_rotationFriction[4] = in.ReadFloat(); + /* x64_rotationFriction[5] */ + x64_rotationFriction[5] = in.ReadFloat(); + /* x64_rotationFriction[6] */ + x64_rotationFriction[6] = in.ReadFloat(); + /* x64_rotationFriction[7] */ + x64_rotationFriction[7] = in.ReadFloat(); + /* x84_rotationMaxSpeed[0] */ + x84_rotationMaxSpeed[0] = in.ReadFloat(); + /* x84_rotationMaxSpeed[1] */ + x84_rotationMaxSpeed[1] = in.ReadFloat(); + /* x84_rotationMaxSpeed[2] */ + x84_rotationMaxSpeed[2] = in.ReadFloat(); + /* x84_rotationMaxSpeed[3] */ + x84_rotationMaxSpeed[3] = in.ReadFloat(); + /* x84_rotationMaxSpeed[4] */ + x84_rotationMaxSpeed[4] = in.ReadFloat(); + /* x84_rotationMaxSpeed[5] */ + x84_rotationMaxSpeed[5] = in.ReadFloat(); + /* x84_rotationMaxSpeed[6] */ + x84_rotationMaxSpeed[6] = in.ReadFloat(); + /* x84_rotationMaxSpeed[7] */ + x84_rotationMaxSpeed[7] = in.ReadFloat(); + /* xa4_translationMaxSpeed[0] */ + xa4_translationMaxSpeed[0] = in.ReadFloat(); + /* xa4_translationMaxSpeed[1] */ + xa4_translationMaxSpeed[1] = in.ReadFloat(); + /* xa4_translationMaxSpeed[2] */ + xa4_translationMaxSpeed[2] = in.ReadFloat(); + /* xa4_translationMaxSpeed[3] */ + xa4_translationMaxSpeed[3] = in.ReadFloat(); + /* xa4_translationMaxSpeed[4] */ + xa4_translationMaxSpeed[4] = in.ReadFloat(); + /* xa4_translationMaxSpeed[5] */ + xa4_translationMaxSpeed[5] = in.ReadFloat(); + /* xa4_translationMaxSpeed[6] */ + xa4_translationMaxSpeed[6] = in.ReadFloat(); + /* xa4_translationMaxSpeed[7] */ + xa4_translationMaxSpeed[7] = in.ReadFloat(); + /* xc4_normalGravAccel */ + xc4_normalGravAccel = in.ReadFloat(); + /* xc8_fluidGravAccel */ + xc8_fluidGravAccel = in.ReadFloat(); + /* xcc_verticalJumpAccel */ + xcc_verticalJumpAccel = in.ReadFloat(); + /* xd0_horizontalJumpAccel */ + xd0_horizontalJumpAccel = in.ReadFloat(); + /* xd4_verticalDoubleJumpAccel */ + xd4_verticalDoubleJumpAccel = in.ReadFloat(); + /* xd8_horizontalDoubleJumpAccel */ + xd8_horizontalDoubleJumpAccel = in.ReadFloat(); + /* xdc_waterJumpFactor */ + xdc_waterJumpFactor = in.ReadFloat(); + /* xe0_waterBallJumpFactor */ + xe0_waterBallJumpFactor = in.ReadFloat(); + /* xe4_lavaJumpFactor */ + xe4_lavaJumpFactor = in.ReadFloat(); + /* xe8_lavaBallJumpFactor */ + xe8_lavaBallJumpFactor = in.ReadFloat(); + /* xec_phazonJumpFactor */ + xec_phazonJumpFactor = in.ReadFloat(); + /* xf0_phazonBallJumpFactor */ + xf0_phazonBallJumpFactor = in.ReadFloat(); + /* xf4_allowedJumpTime */ + xf4_allowedJumpTime = in.ReadFloat(); + /* xf8_allowedDoubleJumpTime */ + xf8_allowedDoubleJumpTime = in.ReadFloat(); + /* xfc_minDoubleJumpWindow */ + xfc_minDoubleJumpWindow = in.ReadFloat(); + /* x100_maxDoubleJumpWindow */ + x100_maxDoubleJumpWindow = in.ReadFloat(); + /* x104_ */ + x104_ = in.ReadFloat(); + /* x108_minJumpTime */ + x108_minJumpTime = in.ReadFloat(); + /* x10c_minDoubleJumpTime */ + x10c_minDoubleJumpTime = in.ReadFloat(); + /* x110_allowedLedgeTime */ + x110_allowedLedgeTime = in.ReadFloat(); + /* x114_doubleJumpImpulse */ + x114_doubleJumpImpulse = in.ReadFloat(); + /* x118_backwardsForceMultiplier */ + x118_backwardsForceMultiplier = in.ReadFloat(); + /* x11c_bombJumpRadius */ + x11c_bombJumpRadius = in.ReadFloat(); + /* x120_bombJumpHeight */ + x120_bombJumpHeight = in.ReadFloat(); + /* x124_eyeOffset */ + x124_eyeOffset = in.ReadFloat(); + /* x128_turnSpeedMultiplier */ + x128_turnSpeedMultiplier = in.ReadFloat(); + /* x12c_freeLookTurnSpeedMultiplier */ + x12c_freeLookTurnSpeedMultiplier = in.ReadFloat(); + /* x130_horizontalFreeLookAngleVel */ + x130_horizontalFreeLookAngleVel = in.ReadFloat(); + /* x134_verticalFreeLookAngleVel */ + x134_verticalFreeLookAngleVel = in.ReadFloat(); + /* x138_freeLookSpeed */ + x138_freeLookSpeed = in.ReadFloat(); + /* x13c_freeLookSnapSpeed */ + x13c_freeLookSnapSpeed = in.ReadFloat(); + /* x140_ */ + x140_ = in.ReadFloat(); + /* x144_freeLookCenteredThresholdAngle */ + x144_freeLookCenteredThresholdAngle = in.ReadFloat(); + /* x148_freeLookCenteredTime */ + x148_freeLookCenteredTime = in.ReadFloat(); + /* x14c_freeLookDampenFactor */ + x14c_freeLookDampenFactor = in.ReadFloat(); + /* x150_leftDiv */ + x150_leftDiv = in.ReadFloat(); + /* x154_rightDiv */ + x154_rightDiv = in.ReadFloat(); + /* x228_24_freelookTurnsPlayer */ + x228_24_freelookTurnsPlayer = in.ReadBool(); + /* x228_25_ */ + x228_25_ = in.ReadBool(); + /* x228_26_ */ + x228_26_ = in.ReadBool(); + /* x228_27_moveDuringFreeLook */ + x228_27_moveDuringFreeLook = in.ReadBool(); + /* x228_28_holdButtonsForFreeLook */ + x228_28_holdButtonsForFreeLook = in.ReadBool(); + /* x228_29_twoButtonsForFreeLook */ + x228_29_twoButtonsForFreeLook = in.ReadBool(); + /* x228_30_ */ + x228_30_ = in.ReadBool(); + /* x228_31_ */ + x228_31_ = in.ReadBool(); + /* x229_24_ */ + x229_24_ = in.ReadBool(); + /* x229_25_aimWhenOrbitingPoint */ + x229_25_aimWhenOrbitingPoint = in.ReadBool(); + /* x229_26_stayInFreeLookWhileFiring */ + x229_26_stayInFreeLookWhileFiring = in.ReadBool(); + /* x229_27_ */ + x229_27_ = in.ReadBool(); + /* x229_28_ */ + x229_28_ = in.ReadBool(); + /* x229_29_orbitFixedOffset */ + x229_29_orbitFixedOffset = in.ReadBool(); + /* x229_30_gunButtonTogglesHolster */ + x229_30_gunButtonTogglesHolster = in.ReadBool(); + /* x229_31_gunNotFiringHolstersGun */ + x229_31_gunNotFiringHolstersGun = in.ReadBool(); + /* x22a_24_fallingDoubleJump */ + x22a_24_fallingDoubleJump = in.ReadBool(); + /* x22a_25_impulseDoubleJump */ + x22a_25_impulseDoubleJump = in.ReadBool(); + /* x22a_26_firingCancelsCameraPitch */ + x22a_26_firingCancelsCameraPitch = in.ReadBool(); + /* x22a_27_assistedAimingIgnoreHorizontal */ + x22a_27_assistedAimingIgnoreHorizontal = in.ReadBool(); + /* x22a_28_assistedAimingIgnoreVertical */ + x22a_28_assistedAimingIgnoreVertical = in.ReadBool(); + /* x22c_ */ + x22c_ = in.ReadFloat(); + /* x230_ */ + x230_ = in.ReadFloat(); + /* x234_aimMaxDistance */ + x234_aimMaxDistance = in.ReadFloat(); + /* x238_ */ + x238_ = in.ReadFloat(); + /* x23c_ */ + x23c_ = in.ReadFloat(); + /* x240_ */ + x240_ = in.ReadFloat(); + /* x244_ */ + x244_ = in.ReadFloat(); + /* x248_ */ + x248_ = in.ReadFloat(); + /* x24c_aimThresholdDistance */ + x24c_aimThresholdDistance = in.ReadFloat(); + /* x250_ */ + x250_ = in.ReadFloat(); + /* x254_ */ + x254_ = in.ReadFloat(); + /* x258_aimBoxWidth */ + x258_aimBoxWidth = in.ReadFloat(); + /* x25c_aimBoxHeight */ + x25c_aimBoxHeight = in.ReadFloat(); + /* x260_aimTargetTimer */ + x260_aimTargetTimer = in.ReadFloat(); + /* x264_aimAssistHorizontalAngle */ + x264_aimAssistHorizontalAngle = in.ReadFloat(); + /* x268_aimAssistVerticalAngle */ + x268_aimAssistVerticalAngle = in.ReadFloat(); + /* x158_orbitMinDistance[0] */ + x158_orbitMinDistance[0] = in.ReadFloat(); + /* x164_orbitNormalDistance[0] */ + x164_orbitNormalDistance[0] = in.ReadFloat(); + /* x170_orbitMaxDistance[0] */ + x170_orbitMaxDistance[0] = in.ReadFloat(); + /* x158_orbitMinDistance[1] */ + x158_orbitMinDistance[1] = in.ReadFloat(); + /* x164_orbitNormalDistance[1] */ + x164_orbitNormalDistance[1] = in.ReadFloat(); + /* x170_orbitMaxDistance[1] */ + x170_orbitMaxDistance[1] = in.ReadFloat(); + /* x158_orbitMinDistance[2] */ + x158_orbitMinDistance[2] = in.ReadFloat(); + /* x164_orbitNormalDistance[2] */ + x164_orbitNormalDistance[2] = in.ReadFloat(); + /* x170_orbitMaxDistance[2] */ + x170_orbitMaxDistance[2] = in.ReadFloat(); + /* x17c_ */ + x17c_ = in.ReadFloat(); + /* x180_orbitModeTimer */ + x180_orbitModeTimer = in.ReadFloat(); + /* x184_orbitCameraSpeed */ + x184_orbitCameraSpeed = in.ReadFloat(); + /* x188_orbitUpperAngle */ + x188_orbitUpperAngle = in.ReadFloat(); + /* x18c_orbitLowerAngle */ + x18c_orbitLowerAngle = in.ReadFloat(); + /* x190_orbitHorizAngle */ + x190_orbitHorizAngle = in.ReadFloat(); + /* x194_ */ + x194_ = in.ReadFloat(); + /* x198_ */ + x198_ = in.ReadFloat(); + /* x19c_orbitMaxTargetDistance */ + x19c_orbitMaxTargetDistance = in.ReadFloat(); + /* x1a0_orbitMaxLockDistance */ + x1a0_orbitMaxLockDistance = in.ReadFloat(); + /* x1a4_orbitDistanceThreshold */ + x1a4_orbitDistanceThreshold = in.ReadFloat(); + /* x1a8_orbitScreenBoxHalfExtentX[0] */ + x1a8_orbitScreenBoxHalfExtentX[0] = in.ReadLong(); + /* x1b0_orbitScreenBoxHalfExtentY[0] */ + x1b0_orbitScreenBoxHalfExtentY[0] = in.ReadLong(); + /* x1b8_orbitScreenBoxCenterX[0] */ + x1b8_orbitScreenBoxCenterX[0] = in.ReadLong(); + /* x1c0_orbitScreenBoxCenterY[0] */ + x1c0_orbitScreenBoxCenterY[0] = in.ReadLong(); + /* x1c8_orbitZoneIdealX[0] */ + x1c8_orbitZoneIdealX[0] = in.ReadLong(); + /* x1d0_orbitZoneIdealY[0] */ + x1d0_orbitZoneIdealY[0] = in.ReadLong(); + /* x1a8_orbitScreenBoxHalfExtentX[1] */ + x1a8_orbitScreenBoxHalfExtentX[1] = in.ReadLong(); + /* x1b0_orbitScreenBoxHalfExtentY[1] */ + x1b0_orbitScreenBoxHalfExtentY[1] = in.ReadLong(); + /* x1b8_orbitScreenBoxCenterX[1] */ + x1b8_orbitScreenBoxCenterX[1] = in.ReadLong(); + /* x1c0_orbitScreenBoxCenterY[1] */ + x1c0_orbitScreenBoxCenterY[1] = in.ReadLong(); + /* x1c8_orbitZoneIdealX[1] */ + x1c8_orbitZoneIdealX[1] = in.ReadLong(); + /* x1d0_orbitZoneIdealY[1] */ + x1d0_orbitZoneIdealY[1] = in.ReadLong(); + /* x1d8_orbitNearX */ + x1d8_orbitNearX = in.ReadFloat(); + /* x1dc_orbitNearZ */ + x1dc_orbitNearZ = in.ReadFloat(); + /* x1e0_ */ + x1e0_ = in.ReadFloat(); + /* x1e4_ */ + x1e4_ = in.ReadFloat(); + /* x1e8_orbitFixedOffsetZDiff */ + x1e8_orbitFixedOffsetZDiff = in.ReadFloat(); + /* x1ec_orbitZRange */ + x1ec_orbitZRange = in.ReadFloat(); + /* x1f0_ */ + x1f0_ = in.ReadFloat(); + /* x1f4_ */ + x1f4_ = in.ReadFloat(); + /* x1f8_ */ + x1f8_ = in.ReadFloat(); + /* x1fc_orbitPreventionTime */ + x1fc_orbitPreventionTime = in.ReadFloat(); + /* x200_24_dashEnabled */ + x200_24_dashEnabled = in.ReadBool(); + /* x200_25_dashOnButtonRelease */ + x200_25_dashOnButtonRelease = in.ReadBool(); + /* x204_dashButtonHoldCancelTime */ + x204_dashButtonHoldCancelTime = in.ReadFloat(); + /* x208_dashStrafeInputThreshold */ + x208_dashStrafeInputThreshold = in.ReadFloat(); + /* x20c_sidewaysDoubleJumpImpulse */ + x20c_sidewaysDoubleJumpImpulse = in.ReadFloat(); + /* x210_sidewaysVerticalDoubleJumpAccel */ + x210_sidewaysVerticalDoubleJumpAccel = in.ReadFloat(); + /* x214_sidewaysHorizontalDoubleJumpAccel */ + x214_sidewaysHorizontalDoubleJumpAccel = in.ReadFloat(); + /* x218_scanningRange */ + x218_scanningRange = in.ReadFloat(); + /* x21c_24_scanRetention */ + x21c_24_scanRetention = in.ReadBool(); + /* x21c_25_scanFreezesGame */ + x21c_25_scanFreezesGame = in.ReadBool(); + /* x21c_26_orbitWhileScanning */ + x21c_26_orbitWhileScanning = in.ReadBool(); + /* x220_scanMaxTargetDistance */ + x220_scanMaxTargetDistance = in.ReadFloat(); + /* x224_scanMaxLockDistance */ + x224_scanMaxLockDistance = in.ReadFloat(); + /* x2a0_orbitDistanceMax */ + x2a0_orbitDistanceMax = in.ReadFloat(); + /* x2a4_grappleSwingLength */ + x2a4_grappleSwingLength = in.ReadFloat(); + /* x2a8_grappleSwingPeriod */ + x2a8_grappleSwingPeriod = in.ReadFloat(); + /* x2ac_grapplePullSpeedMin */ + x2ac_grapplePullSpeedMin = in.ReadFloat(); + /* x2b0_grappleCameraSpeed */ + x2b0_grappleCameraSpeed = in.ReadFloat(); + /* x2b4_maxGrappleLockedTurnAlignDistance */ + x2b4_maxGrappleLockedTurnAlignDistance = in.ReadFloat(); + /* x2b8_grapplePullSpeedProportion */ + x2b8_grapplePullSpeedProportion = in.ReadFloat(); + /* x2bc_grapplePullSpeedMax */ + x2bc_grapplePullSpeedMax = in.ReadFloat(); + /* x2c0_grappleLookCenterSpeed */ + x2c0_grappleLookCenterSpeed = in.ReadFloat(); + /* x2c4_maxGrappleTurnSpeed */ + x2c4_maxGrappleTurnSpeed = in.ReadFloat(); + /* x2c8_grappleJumpForce */ + x2c8_grappleJumpForce = in.ReadFloat(); + /* x2cc_grappleReleaseTime */ + x2cc_grappleReleaseTime = in.ReadFloat(); + /* x2d0_grappleJumpMode */ + x2d0_grappleJumpMode = in.ReadLong(); + /* x2d4_orbitReleaseBreaksGrapple */ + x2d4_orbitReleaseBreaksGrapple = in.ReadBool(); + /* x2d5_invertGrappleTurn */ + x2d5_invertGrappleTurn = in.ReadBool(); + /* x2d8_grappleBeamSpeed */ + x2d8_grappleBeamSpeed = in.ReadFloat(); + /* x2dc_grappleBeamXWaveAmplitude */ + x2dc_grappleBeamXWaveAmplitude = in.ReadFloat(); + /* x2e0_grappleBeamZWaveAmplitude */ + x2e0_grappleBeamZWaveAmplitude = in.ReadFloat(); + /* x2e4_grappleBeamAnglePhaseDelta */ + x2e4_grappleBeamAnglePhaseDelta = in.ReadFloat(); + /* x26c_playerHeight */ + x26c_playerHeight = in.ReadFloat(); + /* x270_playerXYHalfExtent */ + x270_playerXYHalfExtent = in.ReadFloat(); + /* x274_stepUpHeight */ + x274_stepUpHeight = in.ReadFloat(); + /* x278_stepDownHeight */ + x278_stepDownHeight = in.ReadFloat(); + /* x27c_playerBallHalfExtent */ + x27c_playerBallHalfExtent = in.ReadFloat(); + /* x280_ */ + x280_firstPersonCameraSpeed = in.ReadFloat(); + /* x284_ */ + x284_ = in.ReadFloat(); + /* x288_jumpCameraPitchDownStart */ + x288_jumpCameraPitchDownStart = in.ReadFloat(); + /* x28c_jumpCameraPitchDownFull */ + x28c_jumpCameraPitchDownFull = in.ReadFloat(); + /* x290_jumpCameraPitchDownAngle */ + x290_jumpCameraPitchDownAngle = in.ReadFloat(); + /* x294_fallCameraPitchDownStart */ + x294_fallCameraPitchDownStart = in.ReadFloat(); + /* x298_fallCameraPitchDownFull */ + x298_fallCameraPitchDownFull = in.ReadFloat(); + /* x29c_fallCameraPitchDownAngle */ + x29c_fallCameraPitchDownAngle = in.ReadFloat(); + /* x2e8_ */ + x2e8_ = in.ReadFloat(); + /* x2ec_ */ + x2ec_ = in.ReadFloat(); + /* x2f0_ */ + x2f0_ = in.ReadFloat(); + /* x2f4_ */ + x2f4_ = in.ReadBool(); + /* x2f8_frozenTimeout */ + x2f8_frozenTimeout = in.ReadFloat(); + /* x2fc_iceBreakJumpCount */ + x2fc_iceBreakJumpCount = in.ReadLong(); + /* x300_variaDamageReduction */ + x300_variaDamageReduction = in.ReadFloat(); + /* x304_gravityDamageReduction */ + x304_gravityDamageReduction = in.ReadFloat(); + /* x308_phazonDamageReduction */ + x308_phazonDamageReduction = in.ReadFloat(); +} + +void CTweakPlayer::PutTo(COutputStream& out) { + /* x4_maxTranslationalAcceleration[0] */ + out.Put(x4_maxTranslationalAcceleration[0]); + /* x4_maxTranslationalAcceleration[1] */ + out.Put(x4_maxTranslationalAcceleration[1]); + /* x4_maxTranslationalAcceleration[2] */ + out.Put(x4_maxTranslationalAcceleration[2]); + /* x4_maxTranslationalAcceleration[3] */ + out.Put(x4_maxTranslationalAcceleration[3]); + /* x4_maxTranslationalAcceleration[4] */ + out.Put(x4_maxTranslationalAcceleration[4]); + /* x4_maxTranslationalAcceleration[5] */ + out.Put(x4_maxTranslationalAcceleration[5]); + /* x4_maxTranslationalAcceleration[6] */ + out.Put(x4_maxTranslationalAcceleration[6]); + /* x4_maxTranslationalAcceleration[7] */ + out.Put(x4_maxTranslationalAcceleration[7]); + /* x24_maxRotationalAcceleration[0] */ + out.Put(x24_maxRotationalAcceleration[0]); + /* x24_maxRotationalAcceleration[1] */ + out.Put(x24_maxRotationalAcceleration[1]); + /* x24_maxRotationalAcceleration[2] */ + out.Put(x24_maxRotationalAcceleration[2]); + /* x24_maxRotationalAcceleration[3] */ + out.Put(x24_maxRotationalAcceleration[3]); + /* x24_maxRotationalAcceleration[4] */ + out.Put(x24_maxRotationalAcceleration[4]); + /* x24_maxRotationalAcceleration[5] */ + out.Put(x24_maxRotationalAcceleration[5]); + /* x24_maxRotationalAcceleration[6] */ + out.Put(x24_maxRotationalAcceleration[6]); + /* x24_maxRotationalAcceleration[7] */ + out.Put(x24_maxRotationalAcceleration[7]); + /* x44_translationFriction[0] */ + out.Put(x44_translationFriction[0]); + /* x44_translationFriction[1] */ + out.Put(x44_translationFriction[1]); + /* x44_translationFriction[2] */ + out.Put(x44_translationFriction[2]); + /* x44_translationFriction[3] */ + out.Put(x44_translationFriction[3]); + /* x44_translationFriction[4] */ + out.Put(x44_translationFriction[4]); + /* x44_translationFriction[5] */ + out.Put(x44_translationFriction[5]); + /* x44_translationFriction[6] */ + out.Put(x44_translationFriction[6]); + /* x44_translationFriction[7] */ + out.Put(x44_translationFriction[7]); + /* x64_rotationFriction[0] */ + out.Put(x64_rotationFriction[0]); + /* x64_rotationFriction[1] */ + out.Put(x64_rotationFriction[1]); + /* x64_rotationFriction[2] */ + out.Put(x64_rotationFriction[2]); + /* x64_rotationFriction[3] */ + out.Put(x64_rotationFriction[3]); + /* x64_rotationFriction[4] */ + out.Put(x64_rotationFriction[4]); + /* x64_rotationFriction[5] */ + out.Put(x64_rotationFriction[5]); + /* x64_rotationFriction[6] */ + out.Put(x64_rotationFriction[6]); + /* x64_rotationFriction[7] */ + out.Put(x64_rotationFriction[7]); + /* x84_rotationMaxSpeed[0] */ + out.Put(x84_rotationMaxSpeed[0]); + /* x84_rotationMaxSpeed[1] */ + out.Put(x84_rotationMaxSpeed[1]); + /* x84_rotationMaxSpeed[2] */ + out.Put(x84_rotationMaxSpeed[2]); + /* x84_rotationMaxSpeed[3] */ + out.Put(x84_rotationMaxSpeed[3]); + /* x84_rotationMaxSpeed[4] */ + out.Put(x84_rotationMaxSpeed[4]); + /* x84_rotationMaxSpeed[5] */ + out.Put(x84_rotationMaxSpeed[5]); + /* x84_rotationMaxSpeed[6] */ + out.Put(x84_rotationMaxSpeed[6]); + /* x84_rotationMaxSpeed[7] */ + out.Put(x84_rotationMaxSpeed[7]); + /* xa4_translationMaxSpeed[0] */ + out.Put(xa4_translationMaxSpeed[0]); + /* xa4_translationMaxSpeed[1] */ + out.Put(xa4_translationMaxSpeed[1]); + /* xa4_translationMaxSpeed[2] */ + out.Put(xa4_translationMaxSpeed[2]); + /* xa4_translationMaxSpeed[3] */ + out.Put(xa4_translationMaxSpeed[3]); + /* xa4_translationMaxSpeed[4] */ + out.Put(xa4_translationMaxSpeed[4]); + /* xa4_translationMaxSpeed[5] */ + out.Put(xa4_translationMaxSpeed[5]); + /* xa4_translationMaxSpeed[6] */ + out.Put(xa4_translationMaxSpeed[6]); + /* xa4_translationMaxSpeed[7] */ + out.Put(xa4_translationMaxSpeed[7]); + /* xc4_normalGravAccel */ + out.Put(xc4_normalGravAccel); + /* xc8_fluidGravAccel */ + out.Put(xc8_fluidGravAccel); + /* xcc_verticalJumpAccel */ + out.Put(xcc_verticalJumpAccel); + /* xd0_horizontalJumpAccel */ + out.Put(xd0_horizontalJumpAccel); + /* xd4_verticalDoubleJumpAccel */ + out.Put(xd4_verticalDoubleJumpAccel); + /* xd8_horizontalDoubleJumpAccel */ + out.Put(xd8_horizontalDoubleJumpAccel); + /* xdc_waterJumpFactor */ + out.Put(xdc_waterJumpFactor); + /* xe0_waterBallJumpFactor */ + out.Put(xe0_waterBallJumpFactor); + /* xe4_lavaJumpFactor */ + out.Put(xe4_lavaJumpFactor); + /* xe8_lavaBallJumpFactor */ + out.Put(xe8_lavaBallJumpFactor); + /* xec_phazonJumpFactor */ + out.Put(xec_phazonJumpFactor); + /* xf0_phazonBallJumpFactor */ + out.Put(xf0_phazonBallJumpFactor); + /* xf4_allowedJumpTime */ + out.Put(xf4_allowedJumpTime); + /* xf8_allowedDoubleJumpTime */ + out.Put(xf8_allowedDoubleJumpTime); + /* xfc_minDoubleJumpWindow */ + out.Put(xfc_minDoubleJumpWindow); + /* x100_maxDoubleJumpWindow */ + out.Put(x100_maxDoubleJumpWindow); + /* x104_ */ + out.Put(x104_); + /* x108_minJumpTime */ + out.Put(x108_minJumpTime); + /* x10c_minDoubleJumpTime */ + out.Put(x10c_minDoubleJumpTime); + /* x110_allowedLedgeTime */ + out.Put(x110_allowedLedgeTime); + /* x114_doubleJumpImpulse */ + out.Put(x114_doubleJumpImpulse); + /* x118_backwardsForceMultiplier */ + out.Put(x118_backwardsForceMultiplier); + /* x11c_bombJumpRadius */ + out.Put(x11c_bombJumpRadius); + /* x120_bombJumpHeight */ + out.Put(x120_bombJumpHeight); + /* x124_eyeOffset */ + out.Put(x124_eyeOffset); + /* x128_turnSpeedMultiplier */ + out.Put(x128_turnSpeedMultiplier); + /* x12c_freeLookTurnSpeedMultiplier */ + out.Put(x12c_freeLookTurnSpeedMultiplier); + /* x130_horizontalFreeLookAngleVel */ + out.Put(x130_horizontalFreeLookAngleVel); + /* x134_verticalFreeLookAngleVel */ + out.Put(x134_verticalFreeLookAngleVel); + /* x138_freeLookSpeed */ + out.Put(x138_freeLookSpeed); + /* x13c_freeLookSnapSpeed */ + out.Put(x13c_freeLookSnapSpeed); + /* x140_ */ + out.Put(x140_); + /* x144_freeLookCenteredThresholdAngle */ + out.Put(x144_freeLookCenteredThresholdAngle); + /* x148_freeLookCenteredTime */ + out.Put(x148_freeLookCenteredTime); + /* x14c_freeLookDampenFactor */ + out.Put(x14c_freeLookDampenFactor); + /* x150_leftDiv */ + out.Put(x150_leftDiv); + /* x154_rightDiv */ + out.Put(x154_rightDiv); + /* x228_24_freelookTurnsPlayer */ + out.Put(x228_24_freelookTurnsPlayer); + /* x228_25_ */ + out.Put(x228_25_); + /* x228_26_ */ + out.Put(x228_26_); + /* x228_27_moveDuringFreeLook */ + out.Put(x228_27_moveDuringFreeLook); + /* x228_28_holdButtonsForFreeLook */ + out.Put(x228_28_holdButtonsForFreeLook); + /* x228_29_twoButtonsForFreeLook */ + out.Put(x228_29_twoButtonsForFreeLook); + /* x228_30_ */ + out.Put(x228_30_); + /* x228_31_ */ + out.Put(x228_31_); + /* x229_24_ */ + out.Put(x229_24_); + /* x229_25_aimWhenOrbitingPoint */ + out.Put(x229_25_aimWhenOrbitingPoint); + /* x229_26_stayInFreeLookWhileFiring */ + out.Put(x229_26_stayInFreeLookWhileFiring); + /* x229_27_ */ + out.Put(x229_27_); + /* x229_28_ */ + out.Put(x229_28_); + /* x229_29_orbitFixedOffset */ + out.Put(x229_29_orbitFixedOffset); + /* x229_30_gunButtonTogglesHolster */ + out.Put(x229_30_gunButtonTogglesHolster); + /* x229_31_gunNotFiringHolstersGun */ + out.Put(x229_31_gunNotFiringHolstersGun); + /* x22a_24_fallingDoubleJump */ + out.Put(x22a_24_fallingDoubleJump); + /* x22a_25_impulseDoubleJump */ + out.Put(x22a_25_impulseDoubleJump); + /* x22a_26_firingCancelsCameraPitch */ + out.Put(x22a_26_firingCancelsCameraPitch); + /* x22a_27_assistedAimingIgnoreHorizontal */ + out.Put(x22a_27_assistedAimingIgnoreHorizontal); + /* x22a_28_assistedAimingIgnoreVertical */ + out.Put(x22a_28_assistedAimingIgnoreVertical); + /* x22c_ */ + out.Put(x22c_); + /* x230_ */ + out.Put(x230_); + /* x234_aimMaxDistance */ + out.Put(x234_aimMaxDistance); + /* x238_ */ + out.Put(x238_); + /* x23c_ */ + out.Put(x23c_); + /* x240_ */ + out.Put(x240_); + /* x244_ */ + out.Put(x244_); + /* x248_ */ + out.Put(x248_); + /* x24c_aimThresholdDistance */ + out.Put(x24c_aimThresholdDistance); + /* x250_ */ + out.Put(x250_); + /* x254_ */ + out.Put(x254_); + /* x258_aimBoxWidth */ + out.Put(x258_aimBoxWidth); + /* x25c_aimBoxHeight */ + out.Put(x25c_aimBoxHeight); + /* x260_aimTargetTimer */ + out.Put(x260_aimTargetTimer); + /* x264_aimAssistHorizontalAngle */ + out.Put(x264_aimAssistHorizontalAngle); + /* x268_aimAssistVerticalAngle */ + out.Put(x268_aimAssistVerticalAngle); + /* x158_orbitMinDistance[0] */ + out.Put(x158_orbitMinDistance[0]); + /* x164_orbitNormalDistance[0] */ + out.Put(x164_orbitNormalDistance[0]); + /* x170_orbitMaxDistance[0] */ + out.Put(x170_orbitMaxDistance[0]); + /* x158_orbitMinDistance[1] */ + out.Put(x158_orbitMinDistance[1]); + /* x164_orbitNormalDistance[1] */ + out.Put(x164_orbitNormalDistance[1]); + /* x170_orbitMaxDistance[1] */ + out.Put(x170_orbitMaxDistance[1]); + /* x158_orbitMinDistance[2] */ + out.Put(x158_orbitMinDistance[2]); + /* x164_orbitNormalDistance[2] */ + out.Put(x164_orbitNormalDistance[2]); + /* x170_orbitMaxDistance[2] */ + out.Put(x170_orbitMaxDistance[2]); + /* x17c_ */ + out.Put(x17c_); + /* x180_orbitModeTimer */ + out.Put(x180_orbitModeTimer); + /* x184_orbitCameraSpeed */ + out.Put(x184_orbitCameraSpeed); + /* x188_orbitUpperAngle */ + out.Put(x188_orbitUpperAngle); + /* x18c_orbitLowerAngle */ + out.Put(x18c_orbitLowerAngle); + /* x190_orbitHorizAngle */ + out.Put(x190_orbitHorizAngle); + /* x194_ */ + out.Put(x194_); + /* x198_ */ + out.Put(x198_); + /* x19c_orbitMaxTargetDistance */ + out.Put(x19c_orbitMaxTargetDistance); + /* x1a0_orbitMaxLockDistance */ + out.Put(x1a0_orbitMaxLockDistance); + /* x1a4_orbitDistanceThreshold */ + out.Put(x1a4_orbitDistanceThreshold); + /* x1a8_orbitScreenBoxHalfExtentX[0] */ + out.Put(x1a8_orbitScreenBoxHalfExtentX[0]); + /* x1b0_orbitScreenBoxHalfExtentY[0] */ + out.Put(x1b0_orbitScreenBoxHalfExtentY[0]); + /* x1b8_orbitScreenBoxCenterX[0] */ + out.Put(x1b8_orbitScreenBoxCenterX[0]); + /* x1c0_orbitScreenBoxCenterY[0] */ + out.Put(x1c0_orbitScreenBoxCenterY[0]); + /* x1c8_orbitZoneIdealX[0] */ + out.Put(x1c8_orbitZoneIdealX[0]); + /* x1d0_orbitZoneIdealY[0] */ + out.Put(x1d0_orbitZoneIdealY[0]); + /* x1a8_orbitScreenBoxHalfExtentX[1] */ + out.Put(x1a8_orbitScreenBoxHalfExtentX[1]); + /* x1b0_orbitScreenBoxHalfExtentY[1] */ + out.Put(x1b0_orbitScreenBoxHalfExtentY[1]); + /* x1b8_orbitScreenBoxCenterX[1] */ + out.Put(x1b8_orbitScreenBoxCenterX[1]); + /* x1c0_orbitScreenBoxCenterY[1] */ + out.Put(x1c0_orbitScreenBoxCenterY[1]); + /* x1c8_orbitZoneIdealX[1] */ + out.Put(x1c8_orbitZoneIdealX[1]); + /* x1d0_orbitZoneIdealY[1] */ + out.Put(x1d0_orbitZoneIdealY[1]); + /* x1d8_orbitNearX */ + out.Put(x1d8_orbitNearX); + /* x1dc_orbitNearZ */ + out.Put(x1dc_orbitNearZ); + /* x1e0_ */ + out.Put(x1e0_); + /* x1e4_ */ + out.Put(x1e4_); + /* x1e8_orbitFixedOffsetZDiff */ + out.Put(x1e8_orbitFixedOffsetZDiff); + /* x1ec_orbitZRange */ + out.Put(x1ec_orbitZRange); + /* x1f0_ */ + out.Put(x1f0_); + /* x1f4_ */ + out.Put(x1f4_); + /* x1f8_ */ + out.Put(x1f8_); + /* x1fc_orbitPreventionTime */ + out.Put(x1fc_orbitPreventionTime); + /* x200_24_dashEnabled */ + out.Put(x200_24_dashEnabled); + /* x200_25_dashOnButtonRelease */ + out.Put(x200_25_dashOnButtonRelease); + /* x204_dashButtonHoldCancelTime */ + out.Put(x204_dashButtonHoldCancelTime); + /* x208_dashStrafeInputThreshold */ + out.Put(x208_dashStrafeInputThreshold); + /* x20c_sidewaysDoubleJumpImpulse */ + out.Put(x20c_sidewaysDoubleJumpImpulse); + /* x210_sidewaysVerticalDoubleJumpAccel */ + out.Put(x210_sidewaysVerticalDoubleJumpAccel); + /* x214_sidewaysHorizontalDoubleJumpAccel */ + out.Put(x214_sidewaysHorizontalDoubleJumpAccel); + /* x218_scanningRange */ + out.Put(x218_scanningRange); + /* x21c_24_scanRetention */ + out.Put(x21c_24_scanRetention); + /* x21c_25_scanFreezesGame */ + out.Put(x21c_25_scanFreezesGame); + /* x21c_26_orbitWhileScanning */ + out.Put(x21c_26_orbitWhileScanning); + /* x220_scanMaxTargetDistance */ + out.Put(x220_scanMaxTargetDistance); + /* x224_scanMaxLockDistance */ + out.Put(x224_scanMaxLockDistance); + /* x2a0_orbitDistanceMax */ + out.Put(x2a0_orbitDistanceMax); + /* x2a4_grappleSwingLength */ + out.Put(x2a4_grappleSwingLength); + /* x2a8_grappleSwingPeriod */ + out.Put(x2a8_grappleSwingPeriod); + /* x2ac_grapplePullSpeedMin */ + out.Put(x2ac_grapplePullSpeedMin); + /* x2b0_grappleCameraSpeed */ + out.Put(x2b0_grappleCameraSpeed); + /* x2b4_maxGrappleLockedTurnAlignDistance */ + out.Put(x2b4_maxGrappleLockedTurnAlignDistance); + /* x2b8_grapplePullSpeedProportion */ + out.Put(x2b8_grapplePullSpeedProportion); + /* x2bc_grapplePullSpeedMax */ + out.Put(x2bc_grapplePullSpeedMax); + /* x2c0_grappleLookCenterSpeed */ + out.Put(x2c0_grappleLookCenterSpeed); + /* x2c4_maxGrappleTurnSpeed */ + out.Put(x2c4_maxGrappleTurnSpeed); + /* x2c8_grappleJumpForce */ + out.Put(x2c8_grappleJumpForce); + /* x2cc_grappleReleaseTime */ + out.Put(x2cc_grappleReleaseTime); + /* x2d0_grappleJumpMode */ + out.Put(x2d0_grappleJumpMode); + /* x2d4_orbitReleaseBreaksGrapple */ + out.Put(x2d4_orbitReleaseBreaksGrapple); + /* x2d5_invertGrappleTurn */ + out.Put(x2d5_invertGrappleTurn); + /* x2d8_grappleBeamSpeed */ + out.Put(x2d8_grappleBeamSpeed); + /* x2dc_grappleBeamXWaveAmplitude */ + out.Put(x2dc_grappleBeamXWaveAmplitude); + /* x2e0_grappleBeamZWaveAmplitude */ + out.Put(x2e0_grappleBeamZWaveAmplitude); + /* x2e4_grappleBeamAnglePhaseDelta */ + out.Put(x2e4_grappleBeamAnglePhaseDelta); + /* x26c_playerHeight */ + out.Put(x26c_playerHeight); + /* x270_playerXYHalfExtent */ + out.Put(x270_playerXYHalfExtent); + /* x274_stepUpHeight */ + out.Put(x274_stepUpHeight); + /* x278_stepDownHeight */ + out.Put(x278_stepDownHeight); + /* x27c_playerBallHalfExtent */ + out.Put(x27c_playerBallHalfExtent); + /* x280_ */ + out.Put(x280_firstPersonCameraSpeed); + /* x284_ */ + out.Put(x284_); + /* x288_jumpCameraPitchDownStart */ + out.Put(x288_jumpCameraPitchDownStart); + /* x28c_jumpCameraPitchDownFull */ + out.Put(x28c_jumpCameraPitchDownFull); + /* x290_jumpCameraPitchDownAngle */ + out.Put(x290_jumpCameraPitchDownAngle); + /* x294_fallCameraPitchDownStart */ + out.Put(x294_fallCameraPitchDownStart); + /* x298_fallCameraPitchDownFull */ + out.Put(x298_fallCameraPitchDownFull); + /* x29c_fallCameraPitchDownAngle */ + out.Put(x29c_fallCameraPitchDownAngle); + /* x2e8_ */ + out.Put(x2e8_); + /* x2ec_ */ + out.Put(x2ec_); + /* x2f0_ */ + out.Put(x2f0_); + /* x2f4_ */ + out.Put(x2f4_); + /* x2f8_frozenTimeout */ + out.Put(x2f8_frozenTimeout); + /* x2fc_iceBreakJumpCount */ + out.Put(x2fc_iceBreakJumpCount); + /* x300_variaDamageReduction */ + out.Put(x300_variaDamageReduction); + /* x304_gravityDamageReduction */ + out.Put(x304_gravityDamageReduction); + /* x308_phazonDamageReduction */ + out.Put(x308_phazonDamageReduction); +} + +void CTweakPlayer::FixupValues() { + x130_horizontalFreeLookAngleVel = zeus::degToRad(x130_horizontalFreeLookAngleVel); + x134_verticalFreeLookAngleVel = zeus::degToRad(x134_verticalFreeLookAngleVel); + x138_freeLookSpeed = zeus::degToRad(x138_freeLookSpeed); + x13c_freeLookSnapSpeed = zeus::degToRad(x13c_freeLookSnapSpeed); + x140_ = zeus::degToRad(x140_); + x144_freeLookCenteredThresholdAngle = zeus::degToRad(x144_freeLookCenteredThresholdAngle); + x23c_ = zeus::degToRad(x23c_); + x240_ = zeus::degToRad(x240_); + x244_ = zeus::degToRad(x244_); + x248_ = zeus::degToRad(x248_); + x250_ = zeus::degToRad(x250_); + x264_aimAssistHorizontalAngle = zeus::degToRad(x264_aimAssistHorizontalAngle); + x268_aimAssistVerticalAngle = zeus::degToRad(x268_aimAssistVerticalAngle); + x17c_ = zeus::degToRad(x17c_); + x184_orbitCameraSpeed = zeus::degToRad(x184_orbitCameraSpeed); + x188_orbitUpperAngle = zeus::degToRad(x188_orbitUpperAngle); + x18c_orbitLowerAngle = zeus::degToRad(x18c_orbitLowerAngle); + x190_orbitHorizAngle = zeus::degToRad(x190_orbitHorizAngle); + x194_ = zeus::degToRad(x194_); + x198_ = zeus::degToRad(x198_); + x1f0_ = zeus::degToRad(x1f0_); + x1f4_ = zeus::degToRad(x1f4_); + x2b0_grappleCameraSpeed = zeus::degToRad(x2b0_grappleCameraSpeed); + x2c0_grappleLookCenterSpeed = zeus::degToRad(x2c0_grappleLookCenterSpeed); + x280_firstPersonCameraSpeed = zeus::degToRad(x280_firstPersonCameraSpeed); + x284_ = zeus::degToRad(x284_); + x290_jumpCameraPitchDownAngle = zeus::degToRad(x290_jumpCameraPitchDownAngle); + x29c_fallCameraPitchDownAngle = zeus::degToRad(x29c_fallCameraPitchDownAngle); +} + +void CTweakPlayer::_tweakListener(CVar* cv) { + UPDATE_CVAR(MaxTranslationAccelerationNormal, cv, x4_maxTranslationalAcceleration[0]); + UPDATE_CVAR(MaxTranslationAccelerationAir, cv, x4_maxTranslationalAcceleration[1]); + UPDATE_CVAR(MaxTranslationAccelerationIce, cv, x4_maxTranslationalAcceleration[2]); + UPDATE_CVAR(MaxTranslationAccelerationOrganic, cv, x4_maxTranslationalAcceleration[3]); + UPDATE_CVAR(MaxTranslationAccelerationWater, cv, x4_maxTranslationalAcceleration[4]); + UPDATE_CVAR(MaxTranslationAccelerationLava, cv, x4_maxTranslationalAcceleration[5]); + UPDATE_CVAR(MaxTranslationAccelerationPhazon, cv, x4_maxTranslationalAcceleration[6]); + UPDATE_CVAR(MaxRotationAccelerationShrubbery, cv, x24_maxRotationalAcceleration[7]); + UPDATE_CVAR(MaxRotationAccelerationNormal, cv, x24_maxRotationalAcceleration[0]); + UPDATE_CVAR(MaxRotationAccelerationAir, cv, x24_maxRotationalAcceleration[1]); + UPDATE_CVAR(MaxRotationAccelerationIce, cv, x24_maxRotationalAcceleration[2]); + UPDATE_CVAR(MaxRotationAccelerationOrganic, cv, x24_maxRotationalAcceleration[3]); + UPDATE_CVAR(MaxRotationAccelerationWater, cv, x24_maxRotationalAcceleration[4]); + UPDATE_CVAR(MaxRotationAccelerationLava, cv, x24_maxRotationalAcceleration[5]); + UPDATE_CVAR(MaxRotationAccelerationPhazon, cv, x24_maxRotationalAcceleration[6]); + UPDATE_CVAR(MaxRotationAccelerationShrubbery, cv, x24_maxRotationalAcceleration[7]); + UPDATE_CVAR(TranslationFrictionNormal, cv, x44_translationFriction[0]); + UPDATE_CVAR(TranslationFrictionAir, cv, x44_translationFriction[1]); + UPDATE_CVAR(TranslationFrictionIce, cv, x44_translationFriction[2]); + UPDATE_CVAR(TranslationFrictionOrganic, cv, x44_translationFriction[3]); + UPDATE_CVAR(TranslationFrictionWater, cv, x44_translationFriction[4]); + UPDATE_CVAR(TranslationFrictionLava, cv, x44_translationFriction[5]); + UPDATE_CVAR(TranslationFrictionPhazon, cv, x44_translationFriction[6]); + UPDATE_CVAR(TranslationFrictionShrubbery, cv, x44_translationFriction[7]); + UPDATE_CVAR(RotationFrictionNormal, cv, x44_translationFriction[2]); + UPDATE_CVAR(RotationFrictionIce, cv, x44_translationFriction[2]); + UPDATE_CVAR(RotationFrictionOrganic, cv, x44_translationFriction[3]); + UPDATE_CVAR(RotationFrictionWater, cv, x44_translationFriction[4]); + UPDATE_CVAR(RotationFrictionLava, cv, x44_translationFriction[5]); + UPDATE_CVAR(RotationFrictionPhazon, cv, x44_translationFriction[6]); + UPDATE_CVAR(RotationFrictionShrubbery, cv, x44_translationFriction[7]); + UPDATE_CVAR(RotationMaxSpeedNormal, cv, x84_rotationMaxSpeed[2]); + UPDATE_CVAR(RotationMaxSpeedIce, cv, x84_rotationMaxSpeed[2]); + UPDATE_CVAR(RotationMaxSpeedOrganic, cv, x84_rotationMaxSpeed[3]); + UPDATE_CVAR(RotationMaxSpeedWater, cv, x84_rotationMaxSpeed[4]); + UPDATE_CVAR(RotationMaxSpeedLava, cv, x84_rotationMaxSpeed[5]); + UPDATE_CVAR(RotationMaxSpeedPhazon, cv, x84_rotationMaxSpeed[6]); + UPDATE_CVAR(RotationMaxSpeedShrubbery, cv, x84_rotationMaxSpeed[7]); + UPDATE_CVAR(TranslationMaxSpeedNormal, cv, xa4_translationMaxSpeed[2]); + UPDATE_CVAR(TranslationMaxSpeedIce, cv, xa4_translationMaxSpeed[2]); + UPDATE_CVAR(TranslationMaxSpeedOrganic, cv, xa4_translationMaxSpeed[3]); + UPDATE_CVAR(TranslationMaxSpeedWater, cv, xa4_translationMaxSpeed[4]); + UPDATE_CVAR(TranslationMaxSpeedLava, cv, xa4_translationMaxSpeed[5]); + UPDATE_CVAR(TranslationMaxSpeedPhazon, cv, xa4_translationMaxSpeed[6]); + UPDATE_CVAR(TranslationMaxSpeedShrubbery, cv, xa4_translationMaxSpeed[7]); + UPDATE_CVAR(NormalGravityAcceleration, cv, xc4_normalGravAccel); + UPDATE_CVAR(FluidGravityAcceleration, cv, xc8_fluidGravAccel); + UPDATE_CVAR(VerticalJumpAcceleration, cv, xcc_verticalJumpAccel); + UPDATE_CVAR(HorizontalJumpAcceleration, cv, xd0_horizontalJumpAccel); + UPDATE_CVAR(VerticalDoubleJumpAcceleration, cv, xd4_verticalDoubleJumpAccel); + UPDATE_CVAR(HorizontalDoubleJumpAcceleration, cv, xd8_horizontalDoubleJumpAccel); + UPDATE_CVAR(WaterJumpFactor, cv, xdc_waterJumpFactor); + UPDATE_CVAR(WaterBallJumpFactor, cv, xe0_waterBallJumpFactor); + UPDATE_CVAR(LavaJumpFactor, cv, xe4_lavaJumpFactor); + UPDATE_CVAR(LavaBallJumpFactor, cv, xe8_lavaBallJumpFactor); + UPDATE_CVAR(PhazonJumpFactor, cv, xec_phazonJumpFactor); + UPDATE_CVAR(PhazonBallJumpFactor, cv, xf0_phazonBallJumpFactor); + UPDATE_CVAR(AllowedJumpTime, cv, xf4_allowedJumpTime); + UPDATE_CVAR(AllowedDoubleJumpTime, cv, xf8_allowedDoubleJumpTime); + UPDATE_CVAR(MinDoubleJumpWindow, cv, xfc_minDoubleJumpWindow); + UPDATE_CVAR(MaxDoubleJumpWindow, cv, x100_maxDoubleJumpWindow); + // UPDATE_CVAR(); // x104_ + UPDATE_CVAR(MinJumpTime, cv, x108_minJumpTime); + UPDATE_CVAR(MinDoubleJumpTime, cv, x10c_minDoubleJumpTime); + UPDATE_CVAR(AllowedLedgeTime, cv, x110_allowedLedgeTime); + UPDATE_CVAR(DoubleJumpImpulse, cv, x114_doubleJumpImpulse); + UPDATE_CVAR(BackwardsForceMultiplier, cv, x118_backwardsForceMultiplier); + UPDATE_CVAR(BombJumpRadius, cv, x11c_bombJumpRadius); + UPDATE_CVAR(BombJumpHeight, cv, x120_bombJumpHeight); + UPDATE_CVAR(EyeOffset, cv, x124_eyeOffset); + UPDATE_CVAR(TurnSpeedMultiplier, cv, x128_turnSpeedMultiplier); + UPDATE_CVAR(FreeLookTurnSpeedMultiplier, cv, x12c_freeLookTurnSpeedMultiplier); + UPDATE_CVAR(HorizontalFreeLookAngleVelocity, cv, x130_horizontalFreeLookAngleVel); + UPDATE_CVAR(VerticalFreeLookAngleVelocity, cv, x134_verticalFreeLookAngleVel); + UPDATE_CVAR(FreeLookSpeed, cv, x138_freeLookSpeed); + UPDATE_CVAR(FreeLookSnapSpeed, cv, x13c_freeLookSnapSpeed); + // UPDATE_CVAR(); // x140_ + UPDATE_CVAR(FreeLookCenteredThresholdAngle, cv, x144_freeLookCenteredThresholdAngle); + UPDATE_CVAR(FreeLookCenteredTime, cv, x148_freeLookCenteredTime); + UPDATE_CVAR(FreeLookDampenFactor, cv, x14c_freeLookDampenFactor); + UPDATE_CVAR(LeftDivisor, cv, x150_leftDiv); + UPDATE_CVAR(RightDivisor, cv, x154_rightDiv); + UPDATE_CVAR(OrbitMinDistanceClose, cv, x158_orbitMinDistance[0]); + UPDATE_CVAR(OrbitMinDistanceFar, cv, x158_orbitMinDistance[1]); + UPDATE_CVAR(OrbitMinDistanceDefault, cv, x158_orbitMinDistance[2]); + UPDATE_CVAR(OrbitNormalDistanceClose, cv, x164_orbitNormalDistance[0]); + UPDATE_CVAR(OrbitNormalDistanceFar, cv, x164_orbitNormalDistance[1]); + UPDATE_CVAR(OrbitNormalDistanceDefault, cv, x164_orbitNormalDistance[2]); + UPDATE_CVAR(OrbitMaxDistanceClose, cv, x170_orbitMaxDistance[0]); + UPDATE_CVAR(OrbitMaxDistanceFar, cv, x170_orbitMaxDistance[1]); + UPDATE_CVAR(OrbitMaxDistanceDefault, cv, x170_orbitMaxDistance[2]); + // UPDATE_CVAR(); // x17c_ + UPDATE_CVAR(OrbitmodeTimer, cv, x180_orbitModeTimer); + UPDATE_CVAR(OrbitCameraSpeed, cv, x184_orbitCameraSpeed); + UPDATE_CVAR(OrbitUpperAngle, cv, x188_orbitUpperAngle); + UPDATE_CVAR(OrbitLowerAngle, cv, x18c_orbitLowerAngle); + UPDATE_CVAR(OrbitHorizontalAngle, cv, x190_orbitHorizAngle); + // UPDATE_CVAR(); // x194_ + // UPDATE_CVAR(); // x198_ + UPDATE_CVAR(OrbitMaxTargetDistance, cv, x19c_orbitMaxTargetDistance); + UPDATE_CVAR(OrbitMaxLockDistance, cv, x1a0_orbitMaxLockDistance); + UPDATE_CVAR(OrbitDistanceThreshold, cv, x1a4_orbitDistanceThreshold); + UPDATE_CVAR(OrbitScreenTargetingBoxHalfExtentX, cv, x1a8_orbitScreenBoxHalfExtentX[0]); + UPDATE_CVAR(OrbitScreenScanBoxHalfExtentX, cv, x1a8_orbitScreenBoxHalfExtentX[1]); + UPDATE_CVAR(OrbitScreenTargetingBoxHalfExtentY, cv, x1b0_orbitScreenBoxHalfExtentY[0]); + UPDATE_CVAR(OrbitScreenScanBoxHalfExtentY, cv, x1b0_orbitScreenBoxHalfExtentY[1]); + UPDATE_CVAR(OrbitScreenTargetingBoxCenterX, cv, x1b8_orbitScreenBoxCenterX[0]); + UPDATE_CVAR(OrbitScreenScanBoxCenterX, cv, x1b8_orbitScreenBoxCenterX[1]); + UPDATE_CVAR(OrbitScreenTargetingBoxCenterY, cv, x1c0_orbitScreenBoxCenterY[0]); + UPDATE_CVAR(OrbitScreenScanBoxCenterY, cv, x1c0_orbitScreenBoxCenterY[1]); + UPDATE_CVAR(OrbitZoneTargetingIdealX, cv, x1c8_orbitZoneIdealX[0]); + UPDATE_CVAR(OrbitZoneScanIdealX, cv, x1c8_orbitZoneIdealX[1]); + UPDATE_CVAR(OrbitZoneTargetingIdealY, cv, x1d0_orbitZoneIdealY[0]); + UPDATE_CVAR(OrbitZoneScanIdealY, cv, x1d0_orbitZoneIdealY[1]); + UPDATE_CVAR(OrbitNearX, cv, x1d8_orbitNearX); + UPDATE_CVAR(OrbitNearZ, cv, x1dc_orbitNearZ); + // UPDATE_CVAR(); // x1e0_ + // UPDATE_CVAR(); // x1e4_ + UPDATE_CVAR(OrbitFixedOffsetZDiff, cv, x1e8_orbitFixedOffsetZDiff); + UPDATE_CVAR(OrbitZRange, cv, x1ec_orbitZRange); + // UPDATE_CVAR(); // x1f0_ + // UPDATE_CVAR(); // x1f4_ + // UPDATE_CVAR(); // x1f8_ + UPDATE_CVAR(OrbitPreventionTime, cv, x1fc_orbitPreventionTime); + UPDATE_CVAR_BITFIELD(DashEnabled, cv, x200_24_dashEnabled); + UPDATE_CVAR_BITFIELD(DashOnButtonRelease, cv, x200_25_dashOnButtonRelease); + UPDATE_CVAR(DashButtonHoldCancelTime, cv, x204_dashButtonHoldCancelTime); + UPDATE_CVAR(DashStrafeInputThreshold, cv, x208_dashStrafeInputThreshold); + UPDATE_CVAR(SidewaysDoubleJumpImpulse, cv, x20c_sidewaysDoubleJumpImpulse); + UPDATE_CVAR(SidewaysVerticalDoubleJumpAccel, cv, x210_sidewaysVerticalDoubleJumpAccel); + UPDATE_CVAR(SidewaysHorizontalDoubleJumpAccel, cv, x214_sidewaysHorizontalDoubleJumpAccel); + UPDATE_CVAR(ScanningRange, cv, x218_scanningRange); + UPDATE_CVAR_BITFIELD(ScanRetention, cv, x21c_24_scanRetention); + UPDATE_CVAR_BITFIELD(ScanFreezesGame, cv, x21c_25_scanFreezesGame); + UPDATE_CVAR_BITFIELD(OrbitWhileScanning, cv, x21c_26_orbitWhileScanning); + UPDATE_CVAR(ScanMaxTargetDistance, cv, x220_scanMaxTargetDistance); + UPDATE_CVAR(ScanMaxLockDistance, cv, x224_scanMaxLockDistance); + UPDATE_CVAR_BITFIELD(FreeLookTurnsPlayer, cv, x228_24_freelookTurnsPlayer); + // UPDATE_CVAR_BITFIELD(); // x228_25_ + // UPDATE_CVAR_BITFIELD(); // x228_26_ + UPDATE_CVAR_BITFIELD(MoveDuringFreelook, cv, x228_27_moveDuringFreeLook); + UPDATE_CVAR_BITFIELD(HoldButtonsForFreeLook, cv, x228_28_holdButtonsForFreeLook); + // UPDATE_CVAR_BITFIELD(); // x228_30_ + // UPDATE_CVAR_BITFIELD(); // x228_31_ + // UPDATE_CVAR_BITFIELD(); // x229_24_ + UPDATE_CVAR_BITFIELD(AimWhenOrbitingPoint, cv, x229_25_aimWhenOrbitingPoint); + UPDATE_CVAR_BITFIELD(StayInFreeLookWhileFiring, cv, x229_26_stayInFreeLookWhileFiring); + // UPDATE_CVAR_BITFIELD(); // x229_27_ + // UPDATE_CVAR_BITFIELD(); // x229_28_ + UPDATE_CVAR_BITFIELD(OrbitFixedOffset, cv, x229_29_orbitFixedOffset); + UPDATE_CVAR_BITFIELD(GunButtonTogglesHolster, cv, x229_30_gunButtonTogglesHolster); + UPDATE_CVAR_BITFIELD(GunNotFiringHolstersGun, cv, x229_31_gunNotFiringHolstersGun); + UPDATE_CVAR_BITFIELD(FallingDoubleJump, cv, x22a_24_fallingDoubleJump); + UPDATE_CVAR_BITFIELD(ImpulseDoubleJump, cv, x22a_25_impulseDoubleJump); + UPDATE_CVAR_BITFIELD(FiringCancelsCameraPitch, cv, x22a_26_firingCancelsCameraPitch); + UPDATE_CVAR_BITFIELD(AssistedAimingIgnoreHorizontal, cv, x22a_27_assistedAimingIgnoreHorizontal); + UPDATE_CVAR_BITFIELD(AssistedAimingIgnoreVertical, cv, x22a_28_assistedAimingIgnoreVertical); + // UPDATE_CVAR(); // x22c + // UPDATE_CVAR(); // x230_ + UPDATE_CVAR(AimMaxDistance, cv, x234_aimMaxDistance); + // UPDATE_CVAR(); // x238_ + // UPDATE_CVAR(); // x23c_ + // UPDATE_CVAR(); // x240_ + // UPDATE_CVAR(); // x244_ + // UPDATE_CVAR(); // x248_ + UPDATE_CVAR(AimThresholdDistance, cv, x24c_aimThresholdDistance); + // UPDATE_CVAR(); // x250_ + // UPDATE_CVAR(); // x254_ + UPDATE_CVAR(AimBoxWidth, cv, x258_aimBoxWidth); + UPDATE_CVAR(AimBoxHeight, cv, x25c_aimBoxHeight); + UPDATE_CVAR(AimTargetTimer, cv, x260_aimTargetTimer); + UPDATE_CVAR(AimAssistHorizontalAngle, cv, x264_aimAssistHorizontalAngle); + UPDATE_CVAR(AimAssistVerticalAngle, cv, x268_aimAssistVerticalAngle); + UPDATE_CVAR(PlayerHeight, cv, x26c_playerHeight); + UPDATE_CVAR(PlayerXYHalfExtent, cv, x270_playerXYHalfExtent); + UPDATE_CVAR(StepUpHeight, cv, x274_stepUpHeight); + UPDATE_CVAR(StepDownHeight, cv, x278_stepDownHeight); + UPDATE_CVAR(PlayerBallHalfExtent, cv, x27c_playerBallHalfExtent); + UPDATE_CVAR(FirstPersonCameraSpeed, cv, x280_firstPersonCameraSpeed); + // UPDATE_CVAR(); // x284_ + UPDATE_CVAR(JumpCameraPitchDownStart, cv, x288_jumpCameraPitchDownStart); + UPDATE_CVAR(JumpCameraPitchDownFull, cv, x28c_jumpCameraPitchDownFull); + UPDATE_CVAR(JumpCameraPitchDownAngle, cv, x290_jumpCameraPitchDownAngle); + UPDATE_CVAR(FallCameraPitchDownStart, cv, x294_fallCameraPitchDownStart); + UPDATE_CVAR(FallCameraPitchDownFull, cv, x298_fallCameraPitchDownFull); + UPDATE_CVAR(FallCameraPitchDownAngle, cv, x29c_fallCameraPitchDownAngle); + UPDATE_CVAR(OrbitDistanceMax, cv, x2a0_orbitDistanceMax); + UPDATE_CVAR(GrappleSwingLength, cv, x2a4_grappleSwingLength); + UPDATE_CVAR(GrappleSwingPeriod, cv, x2a8_grappleSwingPeriod); + UPDATE_CVAR(GrapplePullSpeedMin, cv, x2ac_grapplePullSpeedMin); + UPDATE_CVAR(GrappleCameraSpeed, cv, x2b0_grappleCameraSpeed); + UPDATE_CVAR(MaxGrappleLockedTurnAlignDistance, cv, x2b4_maxGrappleLockedTurnAlignDistance); + UPDATE_CVAR(GrapplePullSpeedProportion, cv, x2b8_grapplePullSpeedProportion); + UPDATE_CVAR(GrapplePullSpeedMax, cv, x2bc_grapplePullSpeedMax); + UPDATE_CVAR(GrappleLookCenterSpeed, cv, x2c0_grappleLookCenterSpeed); + UPDATE_CVAR(MaxGrappleTurnSpeed, cv, x2c4_maxGrappleTurnSpeed); + UPDATE_CVAR(GrappleJumpForce, cv, x2c8_grappleJumpForce); + UPDATE_CVAR(GrappleReleaseTime, cv, x2cc_grappleReleaseTime); + UPDATE_CVAR(GrappleJumpMode, cv, x2d0_grappleJumpMode); + UPDATE_CVAR(OrbitReleaseBreaksGrapple, cv, x2d4_orbitReleaseBreaksGrapple); + UPDATE_CVAR(InvertGrappleTurn, cv, x2d5_invertGrappleTurn); + UPDATE_CVAR(GrappleBeamSpeed, cv, x2d8_grappleBeamSpeed); + UPDATE_CVAR(GrappleBeamXWaveAmplitude, cv, x2dc_grappleBeamXWaveAmplitude); + UPDATE_CVAR(GrappleBeamZWaveAmplitude, cv, x2e0_grappleBeamZWaveAmplitude); + UPDATE_CVAR(GrappleBeamAnglePhaseDelta, cv, x2e4_grappleBeamAnglePhaseDelta); + // UPDATE_CVAR(); // x2e8_ + // UPDATE_CVAR(); // x2ec_ + // UPDATE_CVAR(); // x2f0_ + // UPDATE_CVAR(); // x2f4_ + UPDATE_CVAR(FrozenTimeout, cv, x2f8_frozenTimeout); + UPDATE_CVAR(IceBreakJumpCount, cv, x2fc_iceBreakJumpCount); + UPDATE_CVAR(VariaDamageReduction, cv, x300_variaDamageReduction); + UPDATE_CVAR(GravityDamageReduction, cv, x304_gravityDamageReduction); + UPDATE_CVAR(PhazonDamageReduction, cv, x308_phazonDamageReduction); +} + +void CTweakPlayer::initCVars(CVarManager* mgr) { + CREATE_CVAR(MaxTranslationAccelerationNormal, + "Max translation acceleration allowed to the player under normal circumstances", + x4_maxTranslationalAcceleration[0], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationAir, "Max translation acceleration allowed to the player while in air", + x4_maxTranslationalAcceleration[1], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationIce, "Max translation acceleration allowed to the player while on ice surfaces", + x4_maxTranslationalAcceleration[2], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationOrganic, + "Max translation acceleration allowed to the player while on organic surfaces", + x4_maxTranslationalAcceleration[3], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationWater, "Max translation acceleration allowed to the player while in water", + x4_maxTranslationalAcceleration[4], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationLava, "Max translation acceleration allowed to the player while in lava", + x4_maxTranslationalAcceleration[5], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationPhazon, "Max translation acceleration allowed to the player while in phazon", + x4_maxTranslationalAcceleration[6], skDefaultFlags); + CREATE_CVAR(MaxTranslationAccelerationShrubbery, + "Max translation acceleration allowed to the player while in shrubbery", + x4_maxTranslationalAcceleration[7], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationNormal, + "Max rotation acceleration allowed to the player under normal circumstances", + x24_maxRotationalAcceleration[0], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationAir, "Max rotation acceleration allowed to the player while in air", + x24_maxRotationalAcceleration[1], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationIce, "Max rotation acceleration allowed to the player while on ice surfaces", + x24_maxRotationalAcceleration[2], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationOrganic, + "Max rotation acceleration allowed to the player while on organic surfaces", + x24_maxRotationalAcceleration[3], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationWater, "Max rotation acceleration allowed to the player while in water", + x24_maxRotationalAcceleration[4], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationLava, "Max rotation acceleration allowed to the player while in lava", + x24_maxRotationalAcceleration[5], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationPhazon, "Max rotation acceleration allowed to the player while in phazon", + x24_maxRotationalAcceleration[6], skDefaultFlags); + CREATE_CVAR(MaxRotationAccelerationShrubbery, "Max rotation acceleration allowed to the player while in shrubbery", + x24_maxRotationalAcceleration[7], skDefaultFlags); + CREATE_CVAR(TranslationFrictionNormal, "Translation friction allowed to the player under normal circumstances", + x44_translationFriction[0], skDefaultFlags); + CREATE_CVAR(TranslationFrictionAir, "Translation friction allowed to the player while in air", + x44_translationFriction[1], skDefaultFlags); + CREATE_CVAR(TranslationFrictionIce, "Translation friction allowed to the player while on ice surfaces", + x44_translationFriction[2], skDefaultFlags); + CREATE_CVAR(TranslationFrictionOrganic, "Translation friction allowed to the player while on organic surfaces", + x44_translationFriction[3], skDefaultFlags); + CREATE_CVAR(TranslationFrictionWater, "Translation friction allowed to the player while in water", + x44_translationFriction[4], skDefaultFlags); + CREATE_CVAR(TranslationFrictionLava, "Translation friction allowed to the player while in lava", + x44_translationFriction[5], skDefaultFlags); + CREATE_CVAR(TranslationFrictionPhazon, "Translation friction allowed to the player while in phazon", + x44_translationFriction[6], skDefaultFlags); + CREATE_CVAR(TranslationFrictionShrubbery, "Translation friction allowed to the player while in shrubbery", + x44_translationFriction[7], skDefaultFlags); + CREATE_CVAR(RotationFrictionNormal, "Rotation friction allowed to the player under normal circumstances", + x44_translationFriction[0], skDefaultFlags); + CREATE_CVAR(RotationFrictionAir, "Rotation friction allowed to the player while in air", x44_translationFriction[1], + skDefaultFlags); + CREATE_CVAR(RotationFrictionIce, "Rotation friction allowed to the player while on ice surfaces", + x44_translationFriction[2], skDefaultFlags); + CREATE_CVAR(RotationFrictionOrganic, "Rotation friction allowed to the player while on organic surfaces", + x44_translationFriction[3], skDefaultFlags); + CREATE_CVAR(RotationFrictionWater, "Rotation friction allowed to the player while in water", + x44_translationFriction[4], skDefaultFlags); + CREATE_CVAR(RotationFrictionLava, "Rotation friction allowed to the player while in lava", x44_translationFriction[5], + skDefaultFlags); + CREATE_CVAR(RotationFrictionPhazon, "Rotation friction allowed to the player while in phazon", + x44_translationFriction[6], skDefaultFlags); + CREATE_CVAR(RotationFrictionShrubbery, "Rotation friction allowed to the player while in shrubbery", + x44_translationFriction[7], skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedNormal, "Rotation max speed allowed to the player under normal circumstances", + x84_rotationMaxSpeed[0], skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedAir, "Rotation max speed allowed to the player while in air", x84_rotationMaxSpeed[1], + skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedIce, "Rotation max speed allowed to the player while on ice surfaces", + x84_rotationMaxSpeed[2], skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedOrganic, "Rotation max speed allowed to the player while on organic surfaces", + x84_rotationMaxSpeed[3], skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedWater, "Rotation max speed allowed to the player while in water", x84_rotationMaxSpeed[4], + skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedLava, "Rotation max speed allowed to the player while in lava", x84_rotationMaxSpeed[5], + skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedPhazon, "Rotation max speed allowed to the player while in phazon", + x84_rotationMaxSpeed[6], skDefaultFlags); + CREATE_CVAR(RotationMaxSpeedShrubbery, "Rotation max speed allowed to the player while in shrubbery", + x84_rotationMaxSpeed[7], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedNormal, "Translation max speed allowed to the player under normal circumstances", + xa4_translationMaxSpeed[0], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedNormal, "Translation max speed allowed to the player under normal circumstances", + xa4_translationMaxSpeed[1], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedIce, "Translation max speed allowed to the player while on ice surfaces", + xa4_translationMaxSpeed[2], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedOrganic, "Translation max speed allowed to the player while on organic surfaces", + xa4_translationMaxSpeed[3], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedWater, "Translation max speed allowed to the player while in water", + xa4_translationMaxSpeed[4], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedLava, "Translation max speed allowed to the player while in lava", + xa4_translationMaxSpeed[5], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedPhazon, "Translation max speed allowed to the player while in phazon", + xa4_translationMaxSpeed[6], skDefaultFlags); + CREATE_CVAR(TranslationMaxSpeedShrubbery, "Translation max speed allowed to the player while in shrubbery", + xa4_translationMaxSpeed[7], skDefaultFlags); + CREATE_CVAR(NormalGravityAcceleration, "Gravity applied to the player under normal circumstances", + xc4_normalGravAccel, skDefaultFlags); + CREATE_CVAR(FluidGravityAcceleration, "Gravity applied to the player while in water", xc8_fluidGravAccel, + skDefaultFlags); + CREATE_CVAR(VerticalJumpAcceleration, "Vertical acceleration applied while jumping", xcc_verticalJumpAccel, + skDefaultFlags); + CREATE_CVAR(HorizontalJumpAcceleration, "Horizontal acceleration while jumping", xd0_horizontalJumpAccel, + skDefaultFlags); + CREATE_CVAR(VerticalDoubleJumpAcceleration, "Vertical acceleration while double jumping", xd4_verticalDoubleJumpAccel, + skDefaultFlags); + CREATE_CVAR(HorizontalDoubleJumpAcceleration, "Horizontal acceleration while double jumping", + xd8_horizontalDoubleJumpAccel, skDefaultFlags); + CREATE_CVAR(WaterJumpFactor, "Jump Factor while in water", xdc_waterJumpFactor, skDefaultFlags); + CREATE_CVAR(WaterBallJumpFactor, "Jump Factor while morphed in water", xe0_waterBallJumpFactor, skDefaultFlags); + CREATE_CVAR(LavaJumpFactor, "Jump Factor while in lava", xe4_lavaJumpFactor, skDefaultFlags); + CREATE_CVAR(LavaBallJumpFactor, "Jump Factor while morphed in lava", xe8_lavaBallJumpFactor, skDefaultFlags); + CREATE_CVAR(PhazonJumpFactor, "Jump Factor while in phazon", xec_phazonJumpFactor, skDefaultFlags); + CREATE_CVAR(PhazonBallJumpFactor, "Jump Factor while morphed in phazon", xf0_phazonBallJumpFactor, skDefaultFlags); + CREATE_CVAR(AllowedJumpTime, "", xf4_allowedJumpTime, skDefaultFlags); + CREATE_CVAR(AllowedDoubleJumpTime, "", xf8_allowedDoubleJumpTime, skDefaultFlags); + CREATE_CVAR(MinDoubleJumpWindow, "", xfc_minDoubleJumpWindow, skDefaultFlags); + CREATE_CVAR(MaxDoubleJumpWindow, "", x100_maxDoubleJumpWindow, skDefaultFlags); + // CREATE_CVAR(); // x104_ + CREATE_CVAR(MinJumpTime, "", x108_minJumpTime, skDefaultFlags); + CREATE_CVAR(MinDoubleJumpTime, "", x10c_minDoubleJumpTime, skDefaultFlags); + CREATE_CVAR(AllowedLedgeTime, "", x110_allowedLedgeTime, skDefaultFlags); + CREATE_CVAR(DoubleJumpImpulse, "", x114_doubleJumpImpulse, skDefaultFlags); + CREATE_CVAR(BackwardsForceMultiplier, "", x118_backwardsForceMultiplier, skDefaultFlags); + CREATE_CVAR(BombJumpRadius, "", x11c_bombJumpRadius, skDefaultFlags); + CREATE_CVAR(BombJumpHeight, "", x120_bombJumpHeight, skDefaultFlags); + CREATE_CVAR(EyeOffset, "", x124_eyeOffset, skDefaultFlags); + CREATE_CVAR(TurnSpeedMultiplier, "", x128_turnSpeedMultiplier, skDefaultFlags); + CREATE_CVAR(FreeLookTurnSpeedMultiplier, "", x12c_freeLookTurnSpeedMultiplier, skDefaultFlags); + CREATE_CVAR(HorizontalFreeLookAngleVelocity, "", x130_horizontalFreeLookAngleVel, skDefaultFlags); + CREATE_CVAR(VerticalFreeLookAngleVelocity, "", x134_verticalFreeLookAngleVel, skDefaultFlags); + CREATE_CVAR(FreeLookSpeed, "", x138_freeLookSpeed, skDefaultFlags); + CREATE_CVAR(FreeLookSnapSpeed, "", x13c_freeLookSnapSpeed, skDefaultFlags); + // CREATE_CVAR(); // x140_ + CREATE_CVAR(FreeLookCenteredThresholdAngle, "", x144_freeLookCenteredThresholdAngle, skDefaultFlags); + CREATE_CVAR(FreeLookCenteredTime, "", x148_freeLookCenteredTime, skDefaultFlags); + CREATE_CVAR(FreeLookDampenFactor, "", x14c_freeLookDampenFactor, skDefaultFlags); + CREATE_CVAR(LeftDivisor, "", x150_leftDiv, skDefaultFlags); + CREATE_CVAR(RightDivisor, "", x154_rightDiv, skDefaultFlags); + CREATE_CVAR(OrbitMinDistanceClose, "", x158_orbitMinDistance[0], skDefaultFlags); + CREATE_CVAR(OrbitMinDistanceFar, "", x158_orbitMinDistance[1], skDefaultFlags); + CREATE_CVAR(OrbitMinDistanceDefault, "", x158_orbitMinDistance[2], skDefaultFlags); + CREATE_CVAR(OrbitNormalDistanceClose, "", x164_orbitNormalDistance[0], skDefaultFlags); + CREATE_CVAR(OrbitNormalDistanceFar, "", x164_orbitNormalDistance[1], skDefaultFlags); + CREATE_CVAR(OrbitNormalDistanceDefault, "", x164_orbitNormalDistance[2], skDefaultFlags); + CREATE_CVAR(OrbitMaxDistanceClose, "", x170_orbitMaxDistance[0], skDefaultFlags); + CREATE_CVAR(OrbitMaxDistanceFar, "", x170_orbitMaxDistance[1], skDefaultFlags); + CREATE_CVAR(OrbitMaxDistanceDefault, "", x170_orbitMaxDistance[2], skDefaultFlags); + // CREATE_CVAR(); // x17c_ + CREATE_CVAR(OrbitmodeTimer, "", x180_orbitModeTimer, skDefaultFlags); + CREATE_CVAR(OrbitCameraSpeed, "", x184_orbitCameraSpeed, skDefaultFlags); + CREATE_CVAR(OrbitUpperAngle, "", x184_orbitCameraSpeed, skDefaultFlags); + CREATE_CVAR(OrbitLowerAngle, "", x184_orbitCameraSpeed, skDefaultFlags); + CREATE_CVAR(OrbitHorizontalAngle, "", x184_orbitCameraSpeed, skDefaultFlags); + // CREATE_CVAR(); // x194_ + // CREATE_CVAR(); // x198_ + CREATE_CVAR(OrbitMaxTargetDistance, "", x19c_orbitMaxTargetDistance, skDefaultFlags); + CREATE_CVAR(OrbitMaxLockDistance, "", x1a0_orbitMaxLockDistance, skDefaultFlags); + CREATE_CVAR(OrbitDistanceThreshold, "", x1a4_orbitDistanceThreshold, skDefaultFlags); + CREATE_CVAR(OrbitScreenTargetingBoxHalfExtentX, "", x1a8_orbitScreenBoxHalfExtentX[0], skDefaultFlags); + CREATE_CVAR(OrbitScreenScanBoxHalfExtentX, "", x1a8_orbitScreenBoxHalfExtentX[1], skDefaultFlags); + CREATE_CVAR(OrbitScreenTargetingBoxHalfExtentY, "", x1b0_orbitScreenBoxHalfExtentY[0], skDefaultFlags); + CREATE_CVAR(OrbitScreenScanBoxHalfExtentY, "", x1b0_orbitScreenBoxHalfExtentY[1], skDefaultFlags); + CREATE_CVAR(OrbitScreenTargetingBoxCenterX, "", x1b8_orbitScreenBoxCenterX[0], skDefaultFlags); + CREATE_CVAR(OrbitScreenScanBoxCenterX, "", x1b8_orbitScreenBoxCenterX[1], skDefaultFlags); + CREATE_CVAR(OrbitScreenTargetingBoxCenterY, "", x1c0_orbitScreenBoxCenterY[0], skDefaultFlags); + CREATE_CVAR(OrbitScreenScanBoxCenterY, "", x1c0_orbitScreenBoxCenterY[1], skDefaultFlags); + CREATE_CVAR(OrbitZoneTargetingIdealX, "", x1c8_orbitZoneIdealX[0], skDefaultFlags); + CREATE_CVAR(OrbitZoneScanIdealX, "", x1c8_orbitZoneIdealX[1], skDefaultFlags); + CREATE_CVAR(OrbitZoneTargetingIdealY, "", x1d0_orbitZoneIdealY[0], skDefaultFlags); + CREATE_CVAR(OrbitZoneScanIdealY, "", x1d0_orbitZoneIdealY[1], skDefaultFlags); + CREATE_CVAR(OrbitNearX, "", x1d8_orbitNearX, skDefaultFlags); + CREATE_CVAR(OrbitNearZ, "", x1dc_orbitNearZ, skDefaultFlags); + // CREATE_CVAR(); // x1e0_ + // CREATE_CVAR(); // x1e4_ + CREATE_CVAR(OrbitFixedOffsetZDiff, "", x1e8_orbitFixedOffsetZDiff, skDefaultFlags); + CREATE_CVAR(OrbitZRange, "", x1ec_orbitZRange, skDefaultFlags); + // CREATE_CVAR(); // x1f0_ + // CREATE_CVAR(); // x1f4_ + // CREATE_CVAR(); // x1f8_ + CREATE_CVAR(OrbitPreventionTime, "", x1fc_orbitPreventionTime, skDefaultFlags); + CREATE_CVAR_BITFIELD(DashEnabled, "", x200_24_dashEnabled, skDefaultFlags); + CREATE_CVAR_BITFIELD(DashOnButtonRelease, "", x200_25_dashOnButtonRelease, skDefaultFlags); + CREATE_CVAR(DashButtonHoldCancelTime, "", x204_dashButtonHoldCancelTime, skDefaultFlags); + CREATE_CVAR(DashStrafeInputThreshold, "", x208_dashStrafeInputThreshold, skDefaultFlags); + CREATE_CVAR(SidewaysDoubleJumpImpulse, "", x20c_sidewaysDoubleJumpImpulse, skDefaultFlags); + CREATE_CVAR(SidewaysVerticalDoubleJumpAccel, "", x210_sidewaysVerticalDoubleJumpAccel, skDefaultFlags); + CREATE_CVAR(SidewaysHorizontalDoubleJumpAccel, "", x214_sidewaysHorizontalDoubleJumpAccel, skDefaultFlags); + CREATE_CVAR(ScanningRange, "", x218_scanningRange, skDefaultFlags); + CREATE_CVAR_BITFIELD(ScanRetention, "", x21c_24_scanRetention, skDefaultFlags); + CREATE_CVAR_BITFIELD(ScanFreezesGame, "", x21c_25_scanFreezesGame, skDefaultFlags); + CREATE_CVAR_BITFIELD(OrbitWhileScanning, "", x21c_26_orbitWhileScanning, skDefaultFlags); + CREATE_CVAR(ScanMaxTargetDistance, "", x220_scanMaxTargetDistance, skDefaultFlags); + CREATE_CVAR(ScanMaxLockDistance, "", x224_scanMaxLockDistance, skDefaultFlags); + CREATE_CVAR_BITFIELD(FreeLookTurnsPlayer, "", x228_24_freelookTurnsPlayer, skDefaultFlags); + // CREATE_CVAR_BITFIELD(); // x228_25_ + // CREATE_CVAR_BITFIELD(); // x228_26_ + CREATE_CVAR_BITFIELD(MoveDuringFreelook, "", x228_27_moveDuringFreeLook, skDefaultFlags); + CREATE_CVAR_BITFIELD(HoldButtonsForFreeLook, "", x228_28_holdButtonsForFreeLook, skDefaultFlags); + // CREATE_CVAR_BITFIELD(); // x228_30_ + // CREATE_CVAR_BITFIELD(); // x228_31_ + // CREATE_CVAR(); // x229_24_ + CREATE_CVAR_BITFIELD(AimWhenOrbitingPoint, "", x229_25_aimWhenOrbitingPoint, skDefaultFlags); + CREATE_CVAR_BITFIELD(StayInFreeLookWhileFiring, "", x229_26_stayInFreeLookWhileFiring, skDefaultFlags); + // CREATE_CVAR_BITFIELD(); // x229_27_ + // CREATE_CVAR_BITFIELD(); // x229_28_ + CREATE_CVAR_BITFIELD(OrbitFixedOffset, "", x229_29_orbitFixedOffset, skDefaultFlags); + CREATE_CVAR_BITFIELD(GunButtonTogglesHolster, "", x229_30_gunButtonTogglesHolster, skDefaultFlags); + CREATE_CVAR_BITFIELD(GunNotFiringHolstersGun, "", x229_31_gunNotFiringHolstersGun, skDefaultFlags); + CREATE_CVAR_BITFIELD(FallingDoubleJump, "", x22a_24_fallingDoubleJump, skDefaultFlags); + CREATE_CVAR_BITFIELD(ImpulseDoubleJump, "", x22a_25_impulseDoubleJump, skDefaultFlags); + CREATE_CVAR_BITFIELD(FiringCancelsCameraPitch, "", x22a_26_firingCancelsCameraPitch, skDefaultFlags); + CREATE_CVAR_BITFIELD(AssistedAimingIgnoreHorizontal, "", x22a_27_assistedAimingIgnoreHorizontal, skDefaultFlags); + CREATE_CVAR_BITFIELD(AssistedAimingIgnoreVertical, "", x22a_28_assistedAimingIgnoreVertical, skDefaultFlags); + // CREATE_CVAR(); // x22c + // CREATE_CVAR(); // x230_ + CREATE_CVAR(AimMaxDistance, "", x234_aimMaxDistance, skDefaultFlags); + // CREATE_CVAR(); // x238_ + // CREATE_CVAR(); // x23c_ + // CREATE_CVAR(); // x240_ + // CREATE_CVAR(); // x244_ + // CREATE_CVAR(); // x248_ + CREATE_CVAR(AimThresholdDistance, "", x24c_aimThresholdDistance, skDefaultFlags); + // CREATE_CVAR(); // x250_ + // CREATE_CVAR(); // x254_ + CREATE_CVAR(AimBoxWidth, "", x258_aimBoxWidth, skDefaultFlags); + CREATE_CVAR(AimBoxHeight, "", x25c_aimBoxHeight, skDefaultFlags); + CREATE_CVAR(AimTargetTimer, "", x260_aimTargetTimer, skDefaultFlags); + CREATE_CVAR(AimAssistHorizontalAngle, "", x264_aimAssistHorizontalAngle, skDefaultFlags); + CREATE_CVAR(AimAssistVerticalAngle, "", x268_aimAssistVerticalAngle, skDefaultFlags); + CREATE_CVAR(PlayerHeight, "", x26c_playerHeight, skDefaultFlags); + CREATE_CVAR(PlayerXYHalfExtent, "", x270_playerXYHalfExtent, skDefaultFlags); + CREATE_CVAR(StepUpHeight, "", x274_stepUpHeight, skDefaultFlags); + CREATE_CVAR(StepDownHeight, "", x278_stepDownHeight, skDefaultFlags); + CREATE_CVAR(PlayerBallHalfExtent, "", x27c_playerBallHalfExtent, skDefaultFlags); + CREATE_CVAR(FirstPersonCameraSpeed, "", x280_firstPersonCameraSpeed, skDefaultFlags); + // CREATE_CVAR(); // x284_ + CREATE_CVAR(JumpCameraPitchDownStart, "", x288_jumpCameraPitchDownStart, skDefaultFlags); + CREATE_CVAR(JumpCameraPitchDownFull, "", x28c_jumpCameraPitchDownFull, skDefaultFlags); + CREATE_CVAR(JumpCameraPitchDownAngle, "", x290_jumpCameraPitchDownAngle, skDefaultFlags); + CREATE_CVAR(FallCameraPitchDownStart, "", x294_fallCameraPitchDownStart, skDefaultFlags); + CREATE_CVAR(FallCameraPitchDownFull, "", x298_fallCameraPitchDownFull, skDefaultFlags); + CREATE_CVAR(FallCameraPitchDownAngle, "", x29c_fallCameraPitchDownAngle, skDefaultFlags); + CREATE_CVAR(OrbitDistanceMax, "", x2a0_orbitDistanceMax, skDefaultFlags); + CREATE_CVAR(GrappleSwingLength, "", x2a4_grappleSwingLength, skDefaultFlags); + CREATE_CVAR(GrappleSwingPeriod, "", x2a8_grappleSwingPeriod, skDefaultFlags); + CREATE_CVAR(GrapplePullSpeedMin, "", x2ac_grapplePullSpeedMin, skDefaultFlags); + CREATE_CVAR(GrappleCameraSpeed, "", x2b0_grappleCameraSpeed, skDefaultFlags); + CREATE_CVAR(MaxGrappleLockedTurnAlignDistance, "", x2b4_maxGrappleLockedTurnAlignDistance, skDefaultFlags); + CREATE_CVAR(GrapplePullSpeedProportion, "", x2b8_grapplePullSpeedProportion, skDefaultFlags); + CREATE_CVAR(GrapplePullSpeedMax, "", x2bc_grapplePullSpeedMax, skDefaultFlags); + CREATE_CVAR(GrappleLookCenterSpeed, "", x2c0_grappleLookCenterSpeed, skDefaultFlags); + CREATE_CVAR(MaxGrappleTurnSpeed, "", x2c4_maxGrappleTurnSpeed, skDefaultFlags); + CREATE_CVAR(GrappleJumpForce, "", x2c8_grappleJumpForce, skDefaultFlags); + CREATE_CVAR(GrappleReleaseTime, "", x2cc_grappleReleaseTime, skDefaultFlags); + CREATE_CVAR(GrappleJumpMode, "", x2d0_grappleJumpMode, skDefaultFlags); + CREATE_CVAR(OrbitReleaseBreaksGrapple, "", x2d4_orbitReleaseBreaksGrapple, skDefaultFlags); + CREATE_CVAR(InvertGrappleTurn, "", x2d5_invertGrappleTurn, skDefaultFlags); + CREATE_CVAR(GrappleBeamSpeed, "", x2d8_grappleBeamSpeed, skDefaultFlags); + CREATE_CVAR(GrappleBeamXWaveAmplitude, "", x2dc_grappleBeamXWaveAmplitude, skDefaultFlags); + CREATE_CVAR(GrappleBeamZWaveAmplitude, "", x2e0_grappleBeamZWaveAmplitude, skDefaultFlags); + CREATE_CVAR(GrappleBeamAnglePhaseDelta, "", x2e4_grappleBeamAnglePhaseDelta, skDefaultFlags); + // CREATE_CVAR(); // x2e8_ + // CREATE_CVAR(); // x2ec_ + // CREATE_CVAR(); // x2f0_ + // CREATE_CVAR(); // x2f4_ + CREATE_CVAR(FrozenTimeout, "", x2f8_frozenTimeout, skDefaultFlags); + CREATE_CVAR(IceBreakJumpCount, "", x2fc_iceBreakJumpCount, skDefaultFlags); + CREATE_CVAR(VariaDamageReduction, "", x300_variaDamageReduction, skDefaultFlags); + CREATE_CVAR(GravityDamageReduction, "", x304_gravityDamageReduction, skDefaultFlags); + CREATE_CVAR(PhazonDamageReduction, "", x308_phazonDamageReduction, skDefaultFlags); +} +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakPlayer.hpp b/Runtime/MP1/Tweaks/CTweakPlayer.hpp new file mode 100644 index 000000000..f8e701d09 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayer.hpp @@ -0,0 +1,313 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakPlayer.hpp" + +namespace metaforce::MP1 { + +struct CTweakPlayer final : Tweaks::ITweakPlayer { + float x4_maxTranslationalAcceleration[8]{}; + float x24_maxRotationalAcceleration[8]{}; + float x44_translationFriction[8]{}; + float x64_rotationFriction[8]{}; + float x84_rotationMaxSpeed[8]{}; + float xa4_translationMaxSpeed[8]{}; + float xc4_normalGravAccel{}; + float xc8_fluidGravAccel{}; + float xcc_verticalJumpAccel{}; + float xd0_horizontalJumpAccel{}; + float xd4_verticalDoubleJumpAccel{}; + float xd8_horizontalDoubleJumpAccel{}; + float xdc_waterJumpFactor{}; + float xe0_waterBallJumpFactor{}; + float xe4_lavaJumpFactor{}; + float xe8_lavaBallJumpFactor{}; + float xec_phazonJumpFactor{}; + float xf0_phazonBallJumpFactor{}; + float xf4_allowedJumpTime{}; + float xf8_allowedDoubleJumpTime{}; + float xfc_minDoubleJumpWindow{}; + float x100_maxDoubleJumpWindow{}; + float x104_{}; + float x108_minJumpTime{}; + float x10c_minDoubleJumpTime{}; + float x110_allowedLedgeTime{}; + float x114_doubleJumpImpulse{}; + float x118_backwardsForceMultiplier{}; + float x11c_bombJumpRadius{}; + float x120_bombJumpHeight{}; + float x124_eyeOffset{}; + float x128_turnSpeedMultiplier{}; + float x12c_freeLookTurnSpeedMultiplier{}; + float x130_horizontalFreeLookAngleVel{}; + float x134_verticalFreeLookAngleVel{}; + float x138_freeLookSpeed{}; + float x13c_freeLookSnapSpeed{}; + float x140_{}; + float x144_freeLookCenteredThresholdAngle{}; + float x148_freeLookCenteredTime{}; + float x14c_freeLookDampenFactor{}; + float x150_leftDiv{}; + float x154_rightDiv{}; + float x158_orbitMinDistance[3]{}; + float x164_orbitNormalDistance[3]{}; + float x170_orbitMaxDistance[3]{}; + float x17c_{}; + float x180_orbitModeTimer{}; + float x184_orbitCameraSpeed{}; + float x188_orbitUpperAngle{}; + float x18c_orbitLowerAngle{}; + float x190_orbitHorizAngle{}; + float x194_{}; + float x198_{}; + float x19c_orbitMaxTargetDistance{}; + float x1a0_orbitMaxLockDistance{}; + float x1a4_orbitDistanceThreshold{}; + u32 x1a8_orbitScreenBoxHalfExtentX[2]{}; + u32 x1b0_orbitScreenBoxHalfExtentY[2]{}; + u32 x1b8_orbitScreenBoxCenterX[2]{}; + u32 x1c0_orbitScreenBoxCenterY[2]{}; + u32 x1c8_orbitZoneIdealX[2]{}; + u32 x1d0_orbitZoneIdealY[2]{}; + float x1d8_orbitNearX{}; + float x1dc_orbitNearZ{}; + float x1e0_{}; + float x1e4_{}; + float x1e8_orbitFixedOffsetZDiff{}; + float x1ec_orbitZRange{}; + float x1f0_{}; + float x1f4_{}; + float x1f8_{}; + float x1fc_orbitPreventionTime{}; + bool x200_24_dashEnabled : 1{}; + bool x200_25_dashOnButtonRelease : 1{}; + float x204_dashButtonHoldCancelTime{}; + float x208_dashStrafeInputThreshold{}; + float x20c_sidewaysDoubleJumpImpulse{}; + float x210_sidewaysVerticalDoubleJumpAccel{}; + float x214_sidewaysHorizontalDoubleJumpAccel{}; + float x218_scanningRange{}; + bool x21c_24_scanRetention : 1{}; + bool x21c_25_scanFreezesGame : 1{}; + bool x21c_26_orbitWhileScanning : 1{}; + float x220_scanMaxTargetDistance{}; + float x224_scanMaxLockDistance{}; + bool x228_24_freelookTurnsPlayer : 1{}; + bool x228_25_ : 1{}; + bool x228_26_ : 1{}; + bool x228_27_moveDuringFreeLook : 1{}; + bool x228_28_holdButtonsForFreeLook : 1{}; + bool x228_29_twoButtonsForFreeLook : 1{}; + bool x228_30_ : 1{}; + bool x228_31_ : 1{}; + bool x229_24_ : 1{}; + bool x229_25_aimWhenOrbitingPoint : 1{}; + bool x229_26_stayInFreeLookWhileFiring : 1{}; + bool x229_27_ : 1{}; + bool x229_28_ : 1{}; + bool x229_29_orbitFixedOffset : 1{}; + bool x229_30_gunButtonTogglesHolster : 1{}; + bool x229_31_gunNotFiringHolstersGun : 1{}; + bool x22a_24_fallingDoubleJump : 1{}; + bool x22a_25_impulseDoubleJump : 1{}; + bool x22a_26_firingCancelsCameraPitch : 1{}; + bool x22a_27_assistedAimingIgnoreHorizontal : 1{}; + bool x22a_28_assistedAimingIgnoreVertical : 1{}; + float x22c_{}; + float x230_{}; + float x234_aimMaxDistance{}; + float x238_{}; + float x23c_{}; + float x240_{}; + float x244_{}; + float x248_{}; + float x24c_aimThresholdDistance{}; + float x250_{}; + float x254_{}; + float x258_aimBoxWidth{}; + float x25c_aimBoxHeight{}; + float x260_aimTargetTimer{}; + float x264_aimAssistHorizontalAngle{}; + float x268_aimAssistVerticalAngle{}; + float x26c_playerHeight{}; + float x270_playerXYHalfExtent{}; + float x274_stepUpHeight{}; + float x278_stepDownHeight{}; + float x27c_playerBallHalfExtent{}; + float x280_firstPersonCameraSpeed{}; + float x284_{}; + float x288_jumpCameraPitchDownStart{}; + float x28c_jumpCameraPitchDownFull{}; + float x290_jumpCameraPitchDownAngle{}; + float x294_fallCameraPitchDownStart{}; + float x298_fallCameraPitchDownFull{}; + float x29c_fallCameraPitchDownAngle{}; + float x2a0_orbitDistanceMax{}; + float x2a4_grappleSwingLength{}; + float x2a8_grappleSwingPeriod{}; + float x2ac_grapplePullSpeedMin{}; + float x2b0_grappleCameraSpeed{}; + float x2b4_maxGrappleLockedTurnAlignDistance{}; + float x2b8_grapplePullSpeedProportion{}; + float x2bc_grapplePullSpeedMax{}; + float x2c0_grappleLookCenterSpeed{}; + float x2c4_maxGrappleTurnSpeed{}; + float x2c8_grappleJumpForce{}; + float x2cc_grappleReleaseTime{}; + u32 x2d0_grappleJumpMode{}; + bool x2d4_orbitReleaseBreaksGrapple{}; + bool x2d5_invertGrappleTurn{}; + float x2d8_grappleBeamSpeed{}; + float x2dc_grappleBeamXWaveAmplitude{}; + float x2e0_grappleBeamZWaveAmplitude{}; + float x2e4_grappleBeamAnglePhaseDelta{}; + float x2e8_{}; + float x2ec_{}; + float x2f0_{}; + bool x2f4_{}; + float x2f8_frozenTimeout{}; + u32 x2fc_iceBreakJumpCount{}; + float x300_variaDamageReduction{}; + float x304_gravityDamageReduction{}; + float x308_phazonDamageReduction{}; + float GetMaxTranslationalAcceleration(int s) const override { return x4_maxTranslationalAcceleration[s]; } + float GetMaxRotationalAcceleration(int s) const override { return x24_maxRotationalAcceleration[s]; } + float GetPlayerTranslationFriction(int s) const override { return x44_translationFriction[s]; } + float GetPlayerRotationFriction(int s) const override { return x64_rotationFriction[s]; } + float GetPlayerRotationMaxSpeed(int s) const override { return x84_rotationMaxSpeed[s]; } + float GetPlayerTranslationMaxSpeed(int s) const override { return xa4_translationMaxSpeed[s]; } + float GetNormalGravAccel() const override { return xc4_normalGravAccel; } + float GetFluidGravAccel() const override { return xc8_fluidGravAccel; } + float GetVerticalJumpAccel() const override { return xcc_verticalJumpAccel; } + float GetHorizontalJumpAccel() const override { return xd0_horizontalJumpAccel; } + float GetVerticalDoubleJumpAccel() const override { return xd4_verticalDoubleJumpAccel; } + float GetHorizontalDoubleJumpAccel() const override { return xd8_horizontalDoubleJumpAccel; } + float GetWaterJumpFactor() const override { return xdc_waterJumpFactor; } + float GetWaterBallJumpFactor() const override { return xe0_waterBallJumpFactor; } + float GetLavaJumpFactor() const override { return xe4_lavaJumpFactor; } + float GetLavaBallJumpFactor() const override { return xe8_lavaBallJumpFactor; } + float GetPhazonJumpFactor() const override { return xec_phazonJumpFactor; } + float GetPhazonBallJumpFactor() const override { return xf0_phazonBallJumpFactor; } + float GetAllowedJumpTime() const override { return xf4_allowedJumpTime; } + float GetAllowedDoubleJumpTime() const override { return xf8_allowedDoubleJumpTime; } + float GetMinDoubleJumpWindow() const override { return xfc_minDoubleJumpWindow; } + float GetMaxDoubleJumpWindow() const override { return x100_maxDoubleJumpWindow; } + float GetMinJumpTime() const override { return x108_minJumpTime; } + float GetMinDoubleJumpTime() const override { return x10c_minDoubleJumpTime; } + float GetAllowedLedgeTime() const override { return x110_allowedLedgeTime; } + float GetDoubleJumpImpulse() const override { return x114_doubleJumpImpulse; } + float GetBackwardsForceMultiplier() const override { return x118_backwardsForceMultiplier; } + float GetBombJumpRadius() const override { return x11c_bombJumpRadius; } + float GetBombJumpHeight() const override { return x120_bombJumpHeight; } + float GetEyeOffset() const override { return x124_eyeOffset; } + float GetTurnSpeedMultiplier() const override { return x128_turnSpeedMultiplier; } + float GetFreeLookTurnSpeedMultiplier() const override { return x12c_freeLookTurnSpeedMultiplier; } + float GetFreeLookSpeed() const override { return x138_freeLookSpeed; } + float GetFreeLookSnapSpeed() const override { return x13c_freeLookSnapSpeed; } + float GetFreeLookCenteredThresholdAngle() const override { return x144_freeLookCenteredThresholdAngle; } + float GetFreeLookCenteredTime() const override { return x148_freeLookCenteredTime; } + float GetOrbitModeTimer() const override { return x180_orbitModeTimer; } + float GetOrbitUpperAngle() const override { return x188_orbitUpperAngle; } + float GetOrbitLowerAngle() const override { return x18c_orbitLowerAngle; } + float GetOrbitHorizAngle() const override { return x190_orbitHorizAngle; } + float GetOrbitMaxTargetDistance() const override { return x19c_orbitMaxTargetDistance; } + float GetOrbitMaxLockDistance() const override { return x1a0_orbitMaxLockDistance; } + float GetOrbitDistanceThreshold() const override { return x1a4_orbitDistanceThreshold; } + uint32_t GetOrbitScreenBoxHalfExtentX(int zone) const override { return x1a8_orbitScreenBoxHalfExtentX[zone]; } + uint32_t GetOrbitScreenBoxHalfExtentY(int zone) const override { return x1b0_orbitScreenBoxHalfExtentY[zone]; } + uint32_t GetOrbitScreenBoxCenterX(int zone) const override { return x1b8_orbitScreenBoxCenterX[zone]; } + uint32_t GetOrbitScreenBoxCenterY(int zone) const override { return x1c0_orbitScreenBoxCenterY[zone]; } + uint32_t GetOrbitZoneIdealX(int zone) const override { return x1c8_orbitZoneIdealX[zone]; } + uint32_t GetOrbitZoneIdealY(int zone) const override { return x1d0_orbitZoneIdealY[zone]; } + float GetOrbitNearX() const override { return x1d8_orbitNearX; } + float GetOrbitNearZ() const override { return x1dc_orbitNearZ; } + float GetOrbitFixedOffsetZDiff() const override { return x1e8_orbitFixedOffsetZDiff; } + float GetOrbitZRange() const override { return x1ec_orbitZRange; } + bool GetDashEnabled() const override { return x200_24_dashEnabled; } + bool GetDashOnButtonRelease() const override { return x200_25_dashOnButtonRelease; } + float GetDashButtonHoldCancelTime() const override { return x204_dashButtonHoldCancelTime; } + float GetDashStrafeInputThreshold() const override { return x208_dashStrafeInputThreshold; } + float GetSidewaysDoubleJumpImpulse() const override { return x20c_sidewaysDoubleJumpImpulse; } + float GetSidewaysVerticalDoubleJumpAccel() const override { return x210_sidewaysVerticalDoubleJumpAccel; } + float GetSidewaysHorizontalDoubleJumpAccel() const override { return x214_sidewaysHorizontalDoubleJumpAccel; } + float GetScanningRange() const override { return x218_scanningRange; } + bool GetScanRetention() const override { return x21c_24_scanRetention; } + bool GetScanFreezesGame() const override { return x21c_25_scanFreezesGame; } + bool GetOrbitWhileScanning() const override { return x21c_26_orbitWhileScanning; } + float GetScanMaxTargetDistance() const override { return x220_scanMaxTargetDistance; } + float GetScanMaxLockDistance() const override { return x224_scanMaxLockDistance; } + bool GetMoveDuringFreeLook() const override { return x228_27_moveDuringFreeLook; } + bool GetHoldButtonsForFreeLook() const override { return x228_28_holdButtonsForFreeLook; } + bool GetTwoButtonsForFreeLook() const override { return x228_29_twoButtonsForFreeLook; } + bool GetAimWhenOrbitingPoint() const override { return x229_25_aimWhenOrbitingPoint; } + bool GetStayInFreeLookWhileFiring() const override { return x229_26_stayInFreeLookWhileFiring; } + bool GetOrbitFixedOffset() const override { return x229_29_orbitFixedOffset; } + bool GetGunButtonTogglesHolster() const override { return x229_30_gunButtonTogglesHolster; } + bool GetGunNotFiringHolstersGun() const override { return x229_31_gunNotFiringHolstersGun; } + bool GetFallingDoubleJump() const override { return x22a_24_fallingDoubleJump; } + bool GetImpulseDoubleJump() const override { return x22a_25_impulseDoubleJump; } + bool GetFiringCancelsCameraPitch() const override { return x22a_26_firingCancelsCameraPitch; } + bool GetAssistedAimingIgnoreHorizontal() const override { return x22a_27_assistedAimingIgnoreHorizontal; } + bool GetAssistedAimingIgnoreVertical() const override { return x22a_28_assistedAimingIgnoreVertical; } + float GetAimMaxDistance() const override { return x234_aimMaxDistance; } + float GetAimThresholdDistance() const override { return x24c_aimThresholdDistance; } + float GetAimBoxWidth() const override { return x258_aimBoxWidth; } + float GetAimBoxHeight() const override { return x25c_aimBoxHeight; } + float GetAimTargetTimer() const override { return x260_aimTargetTimer; } + float GetAimAssistHorizontalAngle() const override { return x264_aimAssistHorizontalAngle; } + float GetAimAssistVerticalAngle() const override { return x268_aimAssistVerticalAngle; } + float GetPlayerHeight() const override { return x26c_playerHeight; } + float GetPlayerXYHalfExtent() const override { return x270_playerXYHalfExtent; } + float GetStepUpHeight() const override { return x274_stepUpHeight; } + float GetStepDownHeight() const override { return x278_stepDownHeight; } + float GetPlayerBallHalfExtent() const override { return x27c_playerBallHalfExtent; } + float GetOrbitDistanceMax() const override { return x2a0_orbitDistanceMax; } + float GetGrappleSwingLength() const override { return x2a4_grappleSwingLength; } + float GetGrappleSwingPeriod() const override { return x2a8_grappleSwingPeriod; } + float GetGrapplePullSpeedMin() const override { return x2ac_grapplePullSpeedMin; } + float GetMaxGrappleLockedTurnAlignDistance() const override { return x2b4_maxGrappleLockedTurnAlignDistance; } + float GetGrapplePullSpeedProportion() const override { return x2b8_grapplePullSpeedProportion; } + float GetGrapplePullSpeedMax() const override { return x2bc_grapplePullSpeedMax; } + float GetGrappleLookCenterSpeed() const override { return x2c0_grappleLookCenterSpeed; } + float GetMaxGrappleTurnSpeed() const override { return x2c4_maxGrappleTurnSpeed; } + float GetGrappleJumpForce() const override { return x2c8_grappleJumpForce; } + float GetGrappleReleaseTime() const override { return x2cc_grappleReleaseTime; } + uint32_t GetGrappleJumpMode() const override { return x2d0_grappleJumpMode; } + bool GetOrbitReleaseBreaksGrapple() const override { return x2d4_orbitReleaseBreaksGrapple; } + bool GetInvertGrappleTurn() const override { return x2d5_invertGrappleTurn; } + float GetGrappleBeamSpeed() const override { return x2d8_grappleBeamSpeed; } + float GetGrappleBeamXWaveAmplitude() const override { return x2dc_grappleBeamXWaveAmplitude; } + float GetGrappleBeamZWaveAmplitude() const override { return x2e0_grappleBeamZWaveAmplitude; } + float GetGrappleBeamAnglePhaseDelta() const override { return x2e4_grappleBeamAnglePhaseDelta; } + float GetHorizontalFreeLookAngleVel() const override { return x130_horizontalFreeLookAngleVel; } + float GetVerticalFreeLookAngleVel() const override { return x134_verticalFreeLookAngleVel; } + float GetOrbitCameraSpeed() const override { return x184_orbitCameraSpeed; } + float GetOrbitPreventionTime() const override { return x1fc_orbitPreventionTime; } + bool GetFreeLookTurnsPlayer() const override { return x228_24_freelookTurnsPlayer; } + float GetJumpCameraPitchDownStart() const override { return x288_jumpCameraPitchDownStart; } + float GetJumpCameraPitchDownFull() const override { return x28c_jumpCameraPitchDownFull; } + float GetJumpCameraPitchDownAngle() const override { return x290_jumpCameraPitchDownAngle; } + float GetFallCameraPitchDownStart() const override { return x294_fallCameraPitchDownStart; } + float GetFallCameraPitchDownFull() const override { return x298_fallCameraPitchDownFull; } + float GetFallCameraPitchDownAngle() const override { return x29c_fallCameraPitchDownAngle; } + float GetFirstPersonCameraSpeed() const override { return x280_firstPersonCameraSpeed; } + float GetGrappleCameraSpeed() const override { return x2b0_grappleCameraSpeed; } + float GetFreeLookDampenFactor() const override { return x14c_freeLookDampenFactor; } + float GetLeftLogicalThreshold() const override { return x150_leftDiv; } + float GetRightLogicalThreshold() const override { return x154_rightDiv; } + float GetOrbitMinDistance(int type) const override { return x158_orbitMinDistance[type]; } + float GetOrbitNormalDistance(int type) const override { return x164_orbitNormalDistance[type]; } + float GetOrbitMaxDistance(int type) const override { return x170_orbitMaxDistance[type]; } + float GetFrozenTimeout() const override { return x2f8_frozenTimeout; } + uint32_t GetIceBreakJumpCount() const override { return x2fc_iceBreakJumpCount; } + float GetVariaDamageReduction() const override { return x300_variaDamageReduction; } + float GetGravityDamageReduction() const override { return x304_gravityDamageReduction; } + float GetPhazonDamageReduction() const override { return x308_phazonDamageReduction; } + CTweakPlayer() = default; + CTweakPlayer(CInputStream& in); + void PutTo(COutputStream& out); + void FixupValues(); + void initCVars(CVarManager* mgr) override; + void _tweakListener(CVar* cv); +}; + +} // namespace DataSpec::DNAMP1 diff --git a/Runtime/MP1/Tweaks/CTweakPlayerControl.cpp b/Runtime/MP1/Tweaks/CTweakPlayerControl.cpp new file mode 100644 index 000000000..95d901fbd --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayerControl.cpp @@ -0,0 +1,10 @@ +#include "Runtime/MP1/Tweaks/CTweakPlayerControl.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakPlayerControl::CTweakPlayerControl(CInputStream& in) { + for (u32 i = 0; i < m_mappings.size(); ++i) { + m_mappings[i] = ControlMapper::EFunctionList(in.ReadLong()); + } +} +} \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakPlayerControl.hpp b/Runtime/MP1/Tweaks/CTweakPlayerControl.hpp new file mode 100644 index 000000000..e08a12f6b --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayerControl.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakPlayerControl.hpp" + +namespace metaforce::MP1 { +struct CTweakPlayerControl final : Tweaks::ITweakPlayerControl { + std::array m_mappings; + [[nodiscard]] ControlMapper::EFunctionList GetMapping(u32 command) const override { return m_mappings[command]; } + CTweakPlayerControl() = default; + CTweakPlayerControl(CInputStream& reader); +}; + +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/Tweaks/CTweakPlayerGun.cpp b/Runtime/MP1/Tweaks/CTweakPlayerGun.cpp new file mode 100644 index 000000000..97a43ab5a --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayerGun.cpp @@ -0,0 +1,42 @@ +#include "Runtime/MP1/Tweaks/CTweakPlayerGun.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakPlayerGun::CTweakPlayerGun(CInputStream& in) { + x4_upLookAngle = in.ReadFloat(); + x8_downLookAngle = in.ReadFloat(); + xc_verticalSpread = in.ReadFloat(); + x10_horizontalSpread = in.ReadFloat(); + x14_highVerticalSpread = in.ReadFloat(); + x18_highHorizontalSpread = in.ReadFloat(); + x1c_lowVerticalSpread = in.ReadFloat(); + x20_lowHorizontalSpread = in.ReadFloat(); + x24_aimVerticalSpeed = in.ReadFloat(); + x28_aimHorizontalSpeed = in.ReadFloat(); + x2c_bombFuseTime = in.ReadFloat(); + x30_bombDropDelayTime = in.ReadFloat(); + x34_holoHoldTime = in.ReadFloat(); + x38_gunTransformTime = in.ReadFloat(); + x3c_gunHolsterTime = in.ReadFloat(); + x40_gunNotFiringTime = in.ReadFloat(); + x44_fixedVerticalAim = in.ReadFloat(); + x48_gunExtendDistance = in.ReadFloat(); + x4c_gunPosition = in.Get(); + x58_ = in.Get(); + x64_grapplingArmPosition = in.Get(); + x70_bomb = in.Get(); + x8c_powerBomb = in.Get(); + x1d4_missile = in.Get(); + for (auto& beam : xa8_beams) { + beam = in.Get(); + } + for (auto& combo : x1f0_combos) { + combo = in.Get(); + } + + for (float& r : x280_ricochetData) { + r = in.ReadFloat(); + } + x44_fixedVerticalAim = zeus::degToRad(x44_fixedVerticalAim); +} +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakPlayerGun.hpp b/Runtime/MP1/Tweaks/CTweakPlayerGun.hpp new file mode 100644 index 000000000..bafbd29d8 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayerGun.hpp @@ -0,0 +1,103 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakPlayerGun.hpp" + +namespace metaforce::MP1 { +struct CTweakPlayerGun final : Tweaks::ITweakPlayerGun { + float x4_upLookAngle; + float x8_downLookAngle; + float xc_verticalSpread; + float x10_horizontalSpread; + float x14_highVerticalSpread; + float x18_highHorizontalSpread; + float x1c_lowVerticalSpread; + float x20_lowHorizontalSpread; + float x24_aimVerticalSpeed; + float x28_aimHorizontalSpeed; + float x2c_bombFuseTime; + float x30_bombDropDelayTime; + float x34_holoHoldTime; + float x38_gunTransformTime; + float x3c_gunHolsterTime; + float x40_gunNotFiringTime; + float x44_fixedVerticalAim; + float x48_gunExtendDistance; + zeus::CVector3f x4c_gunPosition; + zeus::CVector3f x58_; + zeus::CVector3f x64_grapplingArmPosition; + SShotParam x70_bomb; + SShotParam x8c_powerBomb; + SShotParam x1d4_missile; + SWeaponInfo xa8_beams[5]; + SComboShotParam x1f0_combos[5]; // Originally rstl::reserved_vector + float x280_ricochetData[6]; // Originally rstl::reserved_vector, extended to 6 to capture + // PhazonBeam's value + CTweakPlayerGun() = default; + CTweakPlayerGun(CInputStream& in); + float GetUpLookAngle() const override { return x4_upLookAngle; } + float GetDownLookAngle() const override { return x8_downLookAngle; } + float GetVerticalSpread() const override { return xc_verticalSpread; } + float GetHorizontalSpread() const override { return x10_horizontalSpread; } + float GetHighVerticalSpread() const override { return x14_highVerticalSpread; } + float GetHighHorizontalSpread() const override { return x18_highHorizontalSpread; } + float GetLowVerticalSpread() const override { return x1c_lowVerticalSpread; } + float GetLowHorizontalSpread() const override { return x20_lowHorizontalSpread; } + float GetAimVerticalSpeed() const override { return x24_aimVerticalSpeed; } + float GetAimHorizontalSpeed() const override { return x28_aimHorizontalSpeed; } + float GetBombFuseTime() const override { return x2c_bombFuseTime; } + float GetBombDropDelayTime() const override { return x30_bombDropDelayTime; } + float GetHoloHoldTime() const override { return x34_holoHoldTime; } + float GetGunTransformTime() const override { return x38_gunTransformTime; } + float GetGunHolsterTime() const override { return x3c_gunHolsterTime; } + float GetGunNotFiringTime() const override { return x40_gunNotFiringTime; } + float GetFixedVerticalAim() const override { return x44_fixedVerticalAim; } + float GetGunExtendDistance() const override { return x48_gunExtendDistance; } + const zeus::CVector3f& GetGunPosition() const override { return x4c_gunPosition; } + const zeus::CVector3f& GetGrapplingArmPosition() const override { return x64_grapplingArmPosition; } + float GetRichochetDamage(u32 type) const override { + switch (type) { + case 0: // Power + return x280_ricochetData[0]; + case 1: // Ice + return x280_ricochetData[1]; + case 2: // Wave + return x280_ricochetData[2]; + case 3: // Plasma + return x280_ricochetData[3]; + case 6: // Missile + return x280_ricochetData[4]; + case 8: // Phazon + /* Note: In order to return the same value as retail we have to do a bit of a hack + * Retro accidentally forgot to load in PhazonBeam's richochet value, as a result, it loads the + * pointer to CTweakParticle's vtable. + */ +#if MP_v1088 + + return float(0x803D9CC4); +#else + return x280_ricochetData[5]; +#endif + default: + return 1.f; + } + } + + const SWeaponInfo& GetBeamInfo(s32 beam) const override { + if (beam < 0 || beam >= 5) { + return xa8_beams[0]; + } + return xa8_beams[beam]; + } + + const SComboShotParam& GetComboShotInfo(s32 beam) const override { + if (beam < 0 || beam >= 5) { + return x1f0_combos[0]; + } + return x1f0_combos[beam]; + } + + const SShotParam& GetBombInfo() const override { return x70_bomb; } + const SShotParam& GetPowerBombInfo() const override { return x8c_powerBomb; } + const SShotParam& GetMissileInfo() const { return x1d4_missile; } +}; +} // namespace DataSpec::DNAMP1 diff --git a/Runtime/MP1/Tweaks/CTweakPlayerRes.cpp b/Runtime/MP1/Tweaks/CTweakPlayerRes.cpp new file mode 100644 index 000000000..a019766ff --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayerRes.cpp @@ -0,0 +1,72 @@ +#include "Runtime/MP1/Tweaks/CTweakPlayerRes.hpp" + +namespace metaforce::MP1 { +CTweakPlayerRes::CTweakPlayerRes(CInputStream& in, bool hasNewFields) { + m_saveStationIcon = in.Get(); + m_missileStationIcon = in.Get(); + m_elevatorIcon = in.Get(); + + m_minesBreakFirstTopIcon = in.Get(); + m_minesBreakFirstBottomIcon = in.Get(); + m_minesBreakSecondTopIcon = in.Get(); + m_minesBreakSecondBottomIcon = in.Get(); + + /* ADDED IN JP/PAL/TRILOGY */ + if (hasNewFields) { + m_mapArrowDown = in.Get(); + m_mapArrowUp = in.Get(); + } + /* END */ + + m_lStickN = in.Get(); + m_lStickU = in.Get(); + m_lStickUL = in.Get(); + m_lStickL = in.Get(); + m_lStickDL = in.Get(); + m_lStickD = in.Get(); + m_lStickDR = in.Get(); + m_lStickR = in.Get(); + m_lStickUR = in.Get(); + + m_cStickN = in.Get(); + m_cStickU = in.Get(); + m_cStickUL = in.Get(); + m_cStickL = in.Get(); + m_cStickDL = in.Get(); + m_cStickD = in.Get(); + m_cStickDR = in.Get(); + m_cStickR = in.Get(); + m_cStickUR = in.Get(); + + m_lTriggerOut = in.Get(); + m_lTriggerIn = in.Get(); + m_rTriggerOut = in.Get(); + m_rTriggerIn = in.Get(); + + m_startButtonOut = in.Get(); + m_startButtonIn = in.Get(); + m_aButtonOut = in.Get(); + m_aButtonIn = in.Get(); + m_bButtonOut = in.Get(); + m_bButtonIn = in.Get(); + m_xButtonOut = in.Get(); + m_xButtonIn = in.Get(); + m_yButtonOut = in.Get(); + m_yButtonIn = in.Get(); + + m_ballTransitionsANCS = in.Get(); + m_ballTransitionsPower = in.Get(); + m_ballTransitionsIce = in.Get(); + m_ballTransitionsWave = in.Get(); + m_ballTransitionsPlasma = in.Get(); + m_ballTransitionsPhazon = in.Get(); + + m_cinePower = in.Get(); + m_cineIce = in.Get(); + m_cineWave = in.Get(); + m_cinePlasma = in.Get(); + m_cinePhazon = in.Get(); + + m_cinematicMoveOutofIntoPlayerDistance = in.ReadFloat(); +} +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakPlayerRes.hpp b/Runtime/MP1/Tweaks/CTweakPlayerRes.hpp new file mode 100644 index 000000000..806389a74 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayerRes.hpp @@ -0,0 +1,104 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakPlayerRes.hpp" + +namespace metaforce::MP1 { + +struct CTweakPlayerRes final : Tweaks::ITweakPlayerRes { + std::string m_saveStationIcon; + std::string m_missileStationIcon; + std::string m_elevatorIcon; + + std::string m_minesBreakFirstTopIcon; + std::string m_minesBreakFirstBottomIcon; + std::string m_minesBreakSecondTopIcon; + std::string m_minesBreakSecondBottomIcon; + + /* ADDED IN PAL/TRILOGY */ + std::string m_mapArrowDown; + std::string m_mapArrowUp; + /* END */ + + std::string m_lStickN; + std::string m_lStickU; + std::string m_lStickUL; + std::string m_lStickL; + std::string m_lStickDL; + std::string m_lStickD; + std::string m_lStickDR; + std::string m_lStickR; + std::string m_lStickUR; + + std::string m_cStickN; + std::string m_cStickU; + std::string m_cStickUL; + std::string m_cStickL; + std::string m_cStickDL; + std::string m_cStickD; + std::string m_cStickDR; + std::string m_cStickR; + std::string m_cStickUR; + + std::string m_lTriggerOut; + std::string m_lTriggerIn; + std::string m_rTriggerOut; + std::string m_rTriggerIn; + + std::string m_startButtonOut; + std::string m_startButtonIn; + std::string m_aButtonOut; + std::string m_aButtonIn; + std::string m_bButtonOut; + std::string m_bButtonIn; + std::string m_xButtonOut; + std::string m_xButtonIn; + std::string m_yButtonOut; + std::string m_yButtonIn; + + std::string m_ballTransitionsANCS; + std::string m_ballTransitionsPower; + std::string m_ballTransitionsIce; + std::string m_ballTransitionsWave; + std::string m_ballTransitionsPlasma; + std::string m_ballTransitionsPhazon; + + std::string m_cinePower; + std::string m_cineIce; + std::string m_cineWave; + std::string m_cinePlasma; + std::string m_cinePhazon; + + float m_cinematicMoveOutofIntoPlayerDistance; + + std::string_view _GetSaveStationIcon() const override { return m_saveStationIcon; } + std::string_view _GetMissileStationIcon() const override { return m_missileStationIcon; } + std::string_view _GetElevatorIcon() const override { return m_elevatorIcon; } + + std::string_view _GetMinesBreakFirstTopIcon() const override { return m_minesBreakFirstTopIcon; } + std::string_view _GetMinesBreakFirstBottomIcon() const override { return m_minesBreakFirstBottomIcon; } + std::string_view _GetMinesBreakSecondTopIcon() const override { return m_minesBreakSecondTopIcon; } + std::string_view _GetMinesBreakSecondBottomIcon() const override { return m_minesBreakSecondBottomIcon; } + + std::string_view _GetLStick(size_t idx) const override { return (&m_lStickN)[idx]; } + std::string_view _GetCStick(size_t idx) const override { return (&m_cStickN)[idx]; } + + std::string_view _GetLTrigger(size_t idx) const override { return (&m_lTriggerOut)[idx]; } + std::string_view _GetRTrigger(size_t idx) const override { return (&m_rTriggerOut)[idx]; } + std::string_view _GetStartButton(size_t idx) const override { return (&m_startButtonOut)[idx]; } + std::string_view _GetAButton(size_t idx) const override { return (&m_aButtonOut)[idx]; } + std::string_view _GetBButton(size_t idx) const override { return (&m_bButtonOut)[idx]; } + std::string_view _GetXButton(size_t idx) const override { return (&m_xButtonOut)[idx]; } + std::string_view _GetYButton(size_t idx) const override { return (&m_yButtonOut)[idx]; } + + std::string_view _GetBallTransitionsANCS() const override { return m_ballTransitionsANCS; } + + std::string_view _GetBallTransitionBeamRes(size_t idx) const override { return (&m_ballTransitionsPower)[idx]; } + std::string_view _GetBeamCineModel(size_t idx) const override { return (&m_cinePower)[idx]; } + + float _GetCinematicMoveOutofIntoPlayerDistance() const override { return m_cinematicMoveOutofIntoPlayerDistance; } + + CTweakPlayerRes() = default; + CTweakPlayerRes(CInputStream& in, bool hasNewFields); +}; + +} // namespace DataSpec::DNAMP1 diff --git a/Runtime/MP1/Tweaks/CTweakSlideShow.cpp b/Runtime/MP1/Tweaks/CTweakSlideShow.cpp new file mode 100644 index 000000000..9f4923d6d --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakSlideShow.cpp @@ -0,0 +1,23 @@ +#include "Runtime/MP1/Tweaks/CTweakSlideShow.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakSlideShow::CTweakSlideShow(CInputStream& in) { + x4_pakName = in.Get(); + x14_fontAssetName = in.Get(); + x24_fontColor = in.Get(); + x28_outlineColor = in.Get(); + x2c_scanPercentInterval = in.ReadFloat(); + x30_ = in.ReadFloat(); + x34_ = in.ReadFloat(); + x38_ = in.ReadFloat(); + x3c_ = in.ReadFloat(); + x40_ = in.Get(); + x44_ = in.ReadFloat(); + x48_ = in.ReadFloat(); + x4c_ = in.ReadFloat(); + x50_ = in.ReadFloat(); + x54_ = in.ReadFloat(); + x58_ = in.ReadFloat(); +} +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakSlideShow.hpp b/Runtime/MP1/Tweaks/CTweakSlideShow.hpp new file mode 100644 index 000000000..6960a7c27 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakSlideShow.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakSlideShow.hpp" +#include "zeus/CColor.hpp" + +namespace metaforce::MP1 { + +struct CTweakSlideShow final : Tweaks::ITweakSlideShow { + std::string x4_pakName; + std::string x14_fontAssetName; + zeus::CColor x24_fontColor; + zeus::CColor x28_outlineColor; + float x2c_scanPercentInterval; + float x30_; + float x34_; + float x38_; + float x3c_; + zeus::CColor x40_; + float x44_; + float x48_; + float x4c_; + float x50_; + float x54_; + float x58_; + + CTweakSlideShow() = default; + CTweakSlideShow(CInputStream& in); + + std::string_view GetFont() const override { return x14_fontAssetName; } + const zeus::CColor& GetFontColor() const override { return x24_fontColor; } + const zeus::CColor& GetOutlineColor() const override { return x28_outlineColor; } + float GetScanPercentInterval() const override { return x2c_scanPercentInterval; } + float GetX54() const override { return x54_; } +}; + +} // namespace DataSpec::DNAMP1 diff --git a/Runtime/MP1/Tweaks/CTweakTargeting.cpp b/Runtime/MP1/Tweaks/CTweakTargeting.cpp new file mode 100644 index 000000000..43c56a90f --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakTargeting.cpp @@ -0,0 +1,150 @@ +#include "Runtime/MP1/Tweaks/CTweakTargeting.hpp" +#include "Runtime/Streams/IOStreams.hpp" + +namespace metaforce::MP1 { +CTweakTargeting::CTweakTargeting(CInputStream& in, bool hasNewFields) { + x4_targetRadiusMode = in.ReadLong(); + x8_currLockOnExitDuration = in.ReadFloat(); + xc_currLockOnEnterDuration = in.ReadFloat(); + x10_currLockOnSwitchDuration = in.ReadFloat(); + x14_lockConfirmScale = in.ReadFloat(); + x18_nextLockOnEnterDuration = in.ReadFloat(); + x1c_nextLockOnExitDuration = in.ReadFloat(); + x20_nextLockOnSwitchDuration = in.ReadFloat(); + x24_seekerScale = in.ReadFloat(); + x28_seekerAngleSpeed = in.ReadFloat(); + x2c_xrayRetAngleSpeed = in.ReadFloat(); + x30_ = in.Get(); + x3c_ = in.Get(); + x48_ = in.ReadFloat(); + x4c_ = in.ReadFloat(); + x50_orbitPointZOffset = in.ReadFloat(); + x54_orbitPointInTime = in.ReadFloat(); + x58_orbitPointOutTime = in.ReadFloat(); + x5c_ = in.ReadFloat(); + x60_ = in.Get(); + x6c_ = in.Get(); + x78_ = in.Get(); + x84_ = in.Get(); + x90_ = in.ReadFloat(); + x94_ = in.ReadFloat(); + x98_ = in.ReadFloat(); + x9c_ = in.ReadFloat(); + xa0_ = in.ReadFloat(); + xa4_ = in.ReadFloat(); + xa8_ = in.ReadFloat(); + xac_ = in.ReadFloat(); + xb0_thermalReticuleColor = in.Get(); + xb4_targetFlowerScale = in.ReadFloat(); + xb8_targetFlowerColor = in.Get(); + xbc_missileBracketDuration = in.ReadFloat(); + xc0_missileBracketScaleStart = in.ReadFloat(); + xc4_missileBracketScaleEnd = in.ReadFloat(); + xc8_missileBracketScaleDuration = in.ReadFloat(); + xcc_missileBracketColor = in.Get(); + xd0_LockonDuration = in.ReadFloat(); + xd4_innerBeamScale = in.ReadFloat(); + xd8_innerBeamColorPower = in.Get(); + xdc_innerBeamColorIce = in.Get(); + xe0_innerBeamColorWave = in.Get(); + xe4_innerBeamColorPlasma = in.Get(); + xe8_chargeGaugeOvershootOffset = in.ReadFloat(); + xec_chargeGaugeOvershootDuration = in.ReadFloat(); + xf0_outerBeamSquaresScale = in.ReadFloat(); + xf4_outerBeamSquareColor = in.Get(); + u32 outerBeamCount = in.ReadLong(); + xf8_outerBeamSquareAngles.resize(outerBeamCount); + for (u32 i = 0; i < outerBeamCount; ++i) { + read_reserved_vector(xf8_outerBeamSquareAngles[i], in); + } + read_reserved_vector(x108_chargeGaugeAngles, in); + x118_chargeGaugeScale = in.ReadFloat(); + x11c_chargeGaugeNonFullColor = in.Get(); + x120_chargeTickCount = in.ReadLong(); + x124_chargeTickAnglePitch = in.ReadFloat(); + x128_lockFireScale = in.ReadFloat(); + x12c_lockFireDuration = in.ReadFloat(); + x130_lockFireColor = in.Get(); + x134_lockDaggerScaleStart = in.ReadFloat(); + x138_lockDaggerScaleEnd = in.ReadFloat(); + x13c_lockDaggerColor = in.Get(); + x140_lockDaggerAngle0 = in.ReadFloat(); + x144_lockDaggerAngle1 = in.ReadFloat(); + x148_lockDaggerAngle2 = in.ReadFloat(); + x14c_lockConfirmColor = in.Get(); + x150_seekerColor = in.Get(); + x154_lockConfirmClampMin = in.ReadFloat(); + x158_lockConfirmClampMax = in.ReadFloat(); + x15c_targetFlowerClampMin = in.ReadFloat(); + x160_targetFlowerClampMax = in.ReadFloat(); + x164_seekerClampMin = in.ReadFloat(); + x168_seekerClampMax = in.ReadFloat(); + x16c_missileBracketClampMin = in.ReadFloat(); + x170_missileBracketClampMax = in.ReadFloat(); + x174_innerBeamClampMin = in.ReadFloat(); + x178_innerBeamClampMax = in.ReadFloat(); + x17c_chargeGaugeClampMin = in.ReadFloat(); + x180_chargeGaugeClampMax = in.ReadFloat(); + x184_lockFireClampMin = in.ReadFloat(); + x188_lockFireClampMax = in.ReadFloat(); + x18c_lockDaggerClampMin = in.ReadFloat(); + x190_lockDaggerClampMax = in.ReadFloat(); + x194_grappleSelectScale = in.ReadFloat(); + x198_grappleScale = in.ReadFloat(); + x19c_grappleClampMin = in.ReadFloat(); + x1a0_grappleClampMax = in.ReadFloat(); + x1a4_grapplePointSelectColor = in.Get(); + x1a8_grapplePointColor = in.Get(); + x1ac_lockedGrapplePointSelectColor = in.Get(); + x1b0_grappleMinClampScale = in.ReadFloat(); + x1b4_chargeGaugePulseColorHigh = in.Get(); + x1b8_fullChargeFadeDuration = in.ReadFloat(); + x1bc_orbitPointColor = in.Get(); + x1c0_crosshairsColor = in.Get(); + x1c4_crosshairsScaleDur = in.ReadFloat(); + x1c8_drawOrbitPoint = in.ReadBool(); + x1cc_chargeGaugePulseColorLow = in.Get(); + x1d0_chargeGaugePulsePeriod = in.ReadFloat(); + x1d4_ = in.Get(); + x1d8_ = in.Get(); + x1dc_ = in.Get(); + x1e0_ = in.ReadFloat(); + x1e4_ = in.ReadFloat(); + x1e8_ = in.ReadFloat(); + x1ec_ = in.ReadFloat(); + x1f0_ = in.ReadFloat(); + x1f4_ = in.ReadFloat(); + x1f8_ = in.ReadFloat(); + x1fc_ = in.ReadFloat(); + x200_ = in.ReadFloat(); + x204_ = in.ReadFloat(); + x208_ = in.ReadFloat(); + x20c_reticuleClampMin = in.ReadFloat(); + x210_reticuleClampMax = in.ReadFloat(); + x214_xrayRetRingColor = in.Get(); + x218_reticuleScale = in.ReadFloat(); + x21c_scanTargetClampMin = in.ReadFloat(); + x220_scanTargetClampMax = in.ReadFloat(); + x224_angularLagSpeed = in.ReadFloat(); + + if (hasNewFields) { + x218_ = in.ReadFloat(); + x21c_ = in.ReadFloat(); + } + + x124_chargeTickAnglePitch = -zeus::degToRad(x124_chargeTickAnglePitch); + x140_lockDaggerAngle0 = zeus::degToRad(x140_lockDaggerAngle0); + x144_lockDaggerAngle1 = zeus::degToRad(x144_lockDaggerAngle1); + x148_lockDaggerAngle2 = zeus::degToRad(x148_lockDaggerAngle2); + x208_ = zeus::degToRad(x208_); + for (int i = 0; i < 4; ++i) { + for (float& f : xf8_outerBeamSquareAngles[i]) { + f = zeus::degToRad(f); + } + } + for (int i = 0; i < 4; ++i) { + x108_chargeGaugeAngles[i] = zeus::degToRad(x108_chargeGaugeAngles[i]); + } +} + +} // namespace metaforce::MP1 \ No newline at end of file diff --git a/Runtime/MP1/Tweaks/CTweakTargeting.hpp b/Runtime/MP1/Tweaks/CTweakTargeting.hpp new file mode 100644 index 000000000..b85df050e --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakTargeting.hpp @@ -0,0 +1,282 @@ +#pragma once + +#include "Runtime/Tweaks/ITweakTargeting.hpp" +#include "Runtime/rstl.hpp" + +namespace metaforce::MP1 { +struct CTweakTargeting final : public Tweaks::ITweakTargeting { + u32 x4_targetRadiusMode{}; + float x8_currLockOnExitDuration{}; + float xc_currLockOnEnterDuration{}; + float x10_currLockOnSwitchDuration{}; + float x14_lockConfirmScale{}; + float x18_nextLockOnEnterDuration{}; + float x1c_nextLockOnExitDuration{}; + float x20_nextLockOnSwitchDuration{}; + float x24_seekerScale{}; + float x28_seekerAngleSpeed{}; + float x2c_xrayRetAngleSpeed{}; + zeus::CVector3f x30_; + zeus::CVector3f x3c_; + float x48_{}; + float x4c_{}; + float x50_orbitPointZOffset{}; + float x54_orbitPointInTime{}; + float x58_orbitPointOutTime{}; + float x5c_{}; + zeus::CVector3f x60_; + zeus::CVector3f x6c_; + zeus::CVector3f x78_; + zeus::CVector3f x84_; + float x90_{}; + float x94_{}; + float x98_{}; + float x9c_{}; + float xa0_{}; + float xa4_{}; + float xa8_{}; + float xac_{}; + zeus::CColor xb0_thermalReticuleColor; + float xb4_targetFlowerScale{}; + zeus::CColor xb8_targetFlowerColor; + float xbc_missileBracketDuration{}; + float xc0_missileBracketScaleStart{}; + float xc4_missileBracketScaleEnd{}; + float xc8_missileBracketScaleDuration{}; + zeus::CColor xcc_missileBracketColor; + float xd0_LockonDuration{}; + float xd4_innerBeamScale{}; + zeus::CColor xd8_innerBeamColorPower; + zeus::CColor xdc_innerBeamColorIce; + zeus::CColor xe0_innerBeamColorWave; + zeus::CColor xe4_innerBeamColorPlasma; + float xe8_chargeGaugeOvershootOffset{}; + float xec_chargeGaugeOvershootDuration{}; + float xf0_outerBeamSquaresScale{}; + zeus::CColor xf4_outerBeamSquareColor; + rstl::reserved_vector, 4> xf8_outerBeamSquareAngles; + rstl::reserved_vector x108_chargeGaugeAngles{}; + float x118_chargeGaugeScale{}; + zeus::CColor x11c_chargeGaugeNonFullColor; + u32 x120_chargeTickCount{}; + float x124_chargeTickAnglePitch{}; + float x128_lockFireScale{}; + float x12c_lockFireDuration{}; + zeus::CColor x130_lockFireColor; + float x134_lockDaggerScaleStart{}; + float x138_lockDaggerScaleEnd{}; + zeus::CColor x13c_lockDaggerColor; + float x140_lockDaggerAngle0{}; + float x144_lockDaggerAngle1{}; + float x148_lockDaggerAngle2{}; + zeus::CColor x14c_lockConfirmColor; + zeus::CColor x150_seekerColor; + float x154_lockConfirmClampMin{}; + float x158_lockConfirmClampMax{}; + float x15c_targetFlowerClampMin{}; + float x160_targetFlowerClampMax{}; + float x164_seekerClampMin{}; + float x168_seekerClampMax{}; + float x16c_missileBracketClampMin{}; + float x170_missileBracketClampMax{}; + float x174_innerBeamClampMin{}; + float x178_innerBeamClampMax{}; + float x17c_chargeGaugeClampMin{}; + float x180_chargeGaugeClampMax{}; + float x184_lockFireClampMin{}; + float x188_lockFireClampMax{}; + float x18c_lockDaggerClampMin{}; + float x190_lockDaggerClampMax{}; + float x194_grappleSelectScale{}; + float x198_grappleScale{}; + float x19c_grappleClampMin{}; + float x1a0_grappleClampMax{}; + zeus::CColor x1a4_grapplePointSelectColor; + zeus::CColor x1a8_grapplePointColor; + zeus::CColor x1ac_lockedGrapplePointSelectColor; + float x1b0_grappleMinClampScale{}; + zeus::CColor x1b4_chargeGaugePulseColorHigh; + float x1b8_fullChargeFadeDuration{}; + zeus::CColor x1bc_orbitPointColor; + zeus::CColor x1c0_crosshairsColor; + float x1c4_crosshairsScaleDur{}; + bool x1c8_drawOrbitPoint{}; + zeus::CColor x1cc_chargeGaugePulseColorLow; + float x1d0_chargeGaugePulsePeriod{}; + zeus::CColor x1d4_; + zeus::CColor x1d8_; + zeus::CColor x1dc_; + float x1e0_{}; + float x1e4_{}; + float x1e8_{}; + float x1ec_{}; + float x1f0_{}; + float x1f4_{}; + float x1f8_{}; + float x1fc_{}; + float x200_{}; + float x204_{}; + float x208_{}; + float x20c_reticuleClampMin{}; + float x210_reticuleClampMax{}; + zeus::CColor x214_xrayRetRingColor; + float x218_reticuleScale{}; + float x21c_scanTargetClampMin{}; + float x220_scanTargetClampMax{}; + float x224_angularLagSpeed{}; + + // RS5 + float x218_{}; + float x21c_{}; + bool x224_ = true; + bool x225_ = false; + bool x226_ = true; + bool x227_ = true; + bool x22c_ = true; + bool x22d_ = false; + bool x22e_ = true; + bool x22f_ = true; + bool x234_ = true; + bool x235_ = false; + bool x236_ = true; + bool x237_ = true; + zeus::CVector3f x23c_ = zeus::skZero3f; + + float x2c8_ = 0.25f; + float x2cc_ = 0.35f; + zeus::CColor x2d0_ = (zeus::Comp32)0xb6e6ffff; + float x2d4_ = 0.39215687f; + zeus::CColor x2d8_ = (zeus::Comp32)0xa82a00ff; + float x2dc_ = 0.78431374f; + zeus::CVector3f x2e0_ = zeus::CVector3f(0.f, 0.f, 0.46f); + float x2ec_ = 0.25f; + float x2f0_ = 0.25f; + float x2f4_ = 120.f; + float x2f8_ = 0.25f; + float x2fc_ = 3.5f; + float x300_ = 0.35f; + zeus::CColor x304_ = (zeus::Comp32)0xa82a00ff; + float x308_ = 0.78431374f; + zeus::CColor x30c_ = (zeus::Comp32)0x89d6ffff; + float x310_ = 0.5019608f; + float x314_ = 11.25f; + float x318_ = 0.25f; + float x31c_ = 0.125f; + zeus::CColor x320_ = (zeus::Comp32)0xffca28ff; + float x324_ = 0.78431374f; + zeus::CColor x328_ = (zeus::Comp32)0x89d6ffff; + float x32c_ = 0.19607843f; + float x330_ = 0.f; + float x334_ = 0.25f; + float x338_ = 3.f; + float x33c_ = 0.25f; + float x340_ = 0.25f; + float x344_ = 0.25f; + float x348_ = 0.25f; + float x34c_ = 45.f; + float x350_ = 0.5f; + float x354_ = 0.65f; + float x358_ = 1.5f; + float x35c_ = 0.18f; + float x360_ = 0.15f; + float x364_ = 0.25f; + zeus::CColor x368_ = static_cast(0x56c1fb9f); + zeus::CColor x36c_ = static_cast(0x49c3f6a0); + zeus::CColor x370_ = static_cast(0x49c3f631); + zeus::CColor x374_ = static_cast(0xff8930ff); + zeus::CColor x378_ = static_cast(0xff2f28ff); + zeus::CColor x37c_ = static_cast(0x93e9ffff); + zeus::CColor x380_ = static_cast(0xff6b60ff); + + CTweakTargeting() = default; + CTweakTargeting(CInputStream& r, bool hasNewFields); + u32 GetTargetRadiusMode() const override { return x4_targetRadiusMode; } + float GetCurrLockOnExitDuration() const override { return x8_currLockOnExitDuration; } + float GetCurrLockOnEnterDuration() const override { return xc_currLockOnEnterDuration; } + float GetCurrLockOnSwitchDuration() const override { return x10_currLockOnSwitchDuration; } + float GetLockConfirmScale() const override { return x14_lockConfirmScale; } + float GetNextLockOnEnterDuration() const override { return x18_nextLockOnEnterDuration; } + float GetNextLockOnExitDuration() const override { return x1c_nextLockOnExitDuration; } + float GetNextLockOnSwitchDuration() const override { return x20_nextLockOnSwitchDuration; } + float GetSeekerScale() const override { return x24_seekerScale; } + float GetSeekerAngleSpeed() const override { return x28_seekerAngleSpeed; } + float GetXRayRetAngleSpeed() const override { return x2c_xrayRetAngleSpeed; } + float GetOrbitPointZOffset() const override { return x50_orbitPointZOffset; } + float GetOrbitPointInTime() const override { return x54_orbitPointInTime; } + float GetOrbitPointOutTime() const override { return x58_orbitPointOutTime; } + const zeus::CColor& GetThermalReticuleColor() const override { return xb0_thermalReticuleColor; } + float GetTargetFlowerScale() const override { return xb4_targetFlowerScale; } + const zeus::CColor& GetTargetFlowerColor() const override { return xb8_targetFlowerColor; } + float GetMissileBracketDuration() const override { return xbc_missileBracketDuration; } + float GetMissileBracketScaleStart() const override { return xc0_missileBracketScaleStart; } + float GetMissileBracketScaleEnd() const override { return xc4_missileBracketScaleEnd; } + float GetMissileBracketScaleDuration() const override { return xc8_missileBracketScaleDuration; } + const zeus::CColor& GetMissileBracketColor() const override { return xcc_missileBracketColor; } + float GetChargeGaugeOvershootOffset() const override { return xe8_chargeGaugeOvershootOffset; } + float GetChargeGaugeOvershootDuration() const override { return xec_chargeGaugeOvershootDuration; } + float GetOuterBeamSquaresScale() const override { return xf0_outerBeamSquaresScale; } + const zeus::CColor& GetOuterBeamSquareColor() const override { return xf4_outerBeamSquareColor; } + float GetLockonDuration() const override { return xd0_LockonDuration; } + float GetInnerBeamScale() const override { return xd4_innerBeamScale; } + const zeus::CColor& GetInnerBeamColorPower() const override { return xd8_innerBeamColorPower; } + const zeus::CColor& GetInnerBeamColorIce() const override { return xdc_innerBeamColorIce; } + const zeus::CColor& GetInnerBeamColorWave() const override { return xe0_innerBeamColorWave; } + const zeus::CColor& GetInnerBeamColorPlasma() const override { return xe4_innerBeamColorPlasma; } + const float* GetOuterBeamSquareAngles(int i) const override { return xf8_outerBeamSquareAngles[i].data(); } + float GetChargeGaugeAngle(int i) const override { return x108_chargeGaugeAngles[i]; } + float GetChargeGaugeScale() const override { return x118_chargeGaugeScale; } + const zeus::CColor& GetChargeGaugeNonFullColor() const override { return x11c_chargeGaugeNonFullColor; } + u32 GetChargeTickCount() const override { return x120_chargeTickCount; } + float GetChargeTickAnglePitch() const override { return x124_chargeTickAnglePitch; } + float GetLockFireScale() const override { return x128_lockFireScale; } + float GetLockFireDuration() const override { return x12c_lockFireDuration; } + const zeus::CColor& GetLockFireColor() const override { return x130_lockFireColor; } + float GetLockDaggerScaleStart() const override { return x134_lockDaggerScaleStart; } + float GetLockDaggerScaleEnd() const override { return x138_lockDaggerScaleEnd; } + const zeus::CColor& GetLockDaggerColor() const override { return x13c_lockDaggerColor; } + float GetLockDaggerAngle0() const override { return x140_lockDaggerAngle0; } + float GetLockDaggerAngle1() const override { return x144_lockDaggerAngle1; } + float GetLockDaggerAngle2() const override { return x148_lockDaggerAngle2; } + const zeus::CColor& GetLockConfirmColor() const override { return x14c_lockConfirmColor; } + const zeus::CColor& GetSeekerColor() const override { return x150_seekerColor; } + float GetLockConfirmClampMin() const override { return x154_lockConfirmClampMin; } + float GetLockConfirmClampMax() const override { return x158_lockConfirmClampMax; } + float GetTargetFlowerClampMin() const override { return x15c_targetFlowerClampMin; } + float GetTargetFlowerClampMax() const override { return x160_targetFlowerClampMax; } + float GetSeekerClampMin() const override { return x164_seekerClampMin; } + float GetSeekerClampMax() const override { return x168_seekerClampMax; } + float GetMissileBracketClampMin() const override { return x16c_missileBracketClampMin; } + float GetMissileBracketClampMax() const override { return x170_missileBracketClampMax; } + float GetInnerBeamClampMin() const override { return x174_innerBeamClampMin; } + float GetInnerBeamClampMax() const override { return x178_innerBeamClampMax; } + float GetChargeGaugeClampMin() const override { return x17c_chargeGaugeClampMin; } + float GetChargeGaugeClampMax() const override { return x180_chargeGaugeClampMax; } + float GetLockFireClampMin() const override { return x184_lockFireClampMin; } + float GetLockFireClampMax() const override { return x188_lockFireClampMax; } + float GetLockDaggerClampMin() const override { return x18c_lockDaggerClampMin; } + float GetLockDaggerClampMax() const override { return x190_lockDaggerClampMax; } + float GetGrappleSelectScale() const override { return x194_grappleSelectScale; } + float GetGrappleScale() const override { return x198_grappleScale; } + float GetGrappleClampMin() const override { return x19c_grappleClampMin; } + float GetGrappleClampMax() const override { return x1a0_grappleClampMax; } + const zeus::CColor& GetGrapplePointSelectColor() const override { return x1a4_grapplePointSelectColor; } + const zeus::CColor& GetGrapplePointColor() const override { return x1a8_grapplePointColor; } + const zeus::CColor& GetLockedGrapplePointSelectColor() const override { return x1ac_lockedGrapplePointSelectColor; } + float GetGrappleMinClampScale() const override { return x1b0_grappleMinClampScale; } + const zeus::CColor& GetChargeGaugePulseColorHigh() const override { return x1b4_chargeGaugePulseColorHigh; } + float GetFullChargeFadeDuration() const override { return x1b8_fullChargeFadeDuration; } + const zeus::CColor& GetOrbitPointColor() const override { return x1bc_orbitPointColor; } + const zeus::CColor& GetCrosshairsColor() const override { return x1c0_crosshairsColor; } + float GetCrosshairsScaleDuration() const override { return x1c4_crosshairsScaleDur; } + bool DrawOrbitPoint() const override { return x1c8_drawOrbitPoint; } + const zeus::CColor& GetChargeGaugePulseColorLow() const override { return x1cc_chargeGaugePulseColorLow; } + float GetChargeGaugePulsePeriod() const override { return x1d0_chargeGaugePulsePeriod; } + float GetReticuleClampMin() const override { return x20c_reticuleClampMin; } + float GetReticuleClampMax() const override { return x210_reticuleClampMax; } + const zeus::CColor& GetXRayRetRingColor() const override { return x214_xrayRetRingColor; } + float GetReticuleScale() const override { return x218_reticuleScale; } + float GetScanTargetClampMin() const override { return x21c_scanTargetClampMin; } + float GetScanTargetClampMax() const override { return x220_scanTargetClampMax; } + float GetAngularLagSpeed() const override { return x224_angularLagSpeed; } +}; +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/World/CActorContraption.cpp b/Runtime/MP1/World/CActorContraption.cpp index 56377156c..3edd42ab3 100644 --- a/Runtime/MP1/World/CActorContraption.cpp +++ b/Runtime/MP1/World/CActorContraption.cpp @@ -94,7 +94,7 @@ CFlameThrower* MP1::CActorContraption::CreateFlameThrower(std::string_view name, const CFlameInfo flameInfo(6, 6, x308_flameFxId, 20, 0.5f, 1.f, 1.f); auto* ret = new CFlameThrower(x300_flameThrowerGen, name, EWeaponType::Missile, flameInfo, zeus::CTransform(), EMaterialTypes::CollisionActor, x30c_dInfo, id, GetAreaId(), GetUniqueId(), - EProjectileAttrib::None, -1, -1, -1); + EProjectileAttrib::None, CAssetId(), -1, CAssetId()); x2e8_children.emplace_back(id, name); diff --git a/Runtime/MP1/World/CBabygoth.cpp b/Runtime/MP1/World/CBabygoth.cpp index f8a8edef1..3595aa3a8 100644 --- a/Runtime/MP1/World/CBabygoth.cpp +++ b/Runtime/MP1/World/CBabygoth.cpp @@ -34,8 +34,8 @@ constexpr std::array skSphereJointList{{ }}; CBabygothData::CBabygothData(CInputStream& in) -: x0_fireballAttackTime(in.readFloatBig()) -, x4_fireballAttackTimeVariance(in.readFloatBig()) +: x0_fireballAttackTime(in.ReadFloat()) +, x4_fireballAttackTimeVariance(in.ReadFloat()) , x8_fireballWeapon(in) , xc_fireballDamage(in) , x28_attackContactDamage(in) @@ -46,20 +46,20 @@ CBabygothData::CBabygothData(CInputStream& in) , xd0_shellVulnerabilities(in) , x138_noShellModel(in) , x13c_noShellSkin(in) -, x140_shellHitPoints(in.readFloatBig()) -, x144_shellCrackSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x140_shellHitPoints(in.ReadFloat()) +, x144_shellCrackSfx(CSfxManager::TranslateSFXID(in.ReadLong())) , x148_intermediateCrackParticle(in) , x14c_crackOneParticle(in) , x150_crackTwoParticle(in) , x154_destroyShellParticle(in) -, x158_crackOneSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) -, x15a_crackTwoSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) -, x15c_destroyShellSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) -, x160_timeUntilAttack(in.readFloatBig()) -, x164_attackCooldownTime(in.readFloatBig()) -, x168_interestTime(in.readFloatBig()) +, x158_crackOneSfx(CSfxManager::TranslateSFXID(in.ReadLong())) +, x15a_crackTwoSfx(CSfxManager::TranslateSFXID(in.ReadLong())) +, x15c_destroyShellSfx(CSfxManager::TranslateSFXID(in.ReadLong())) +, x160_timeUntilAttack(in.ReadFloat()) +, x164_attackCooldownTime(in.ReadFloat()) +, x168_interestTime(in.ReadFloat()) , x16c_flamePlayerSteamTxtr(in) -, x170_flamePlayerHitSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x170_flamePlayerHitSfx(CSfxManager::TranslateSFXID(in.ReadLong())) , x174_flamePlayerIceTxtr(in) {} CBabygoth::CBabygoth(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, diff --git a/Runtime/MP1/World/CBouncyGrenade.hpp b/Runtime/MP1/World/CBouncyGrenade.hpp index 0a4893ddd..73ca6e750 100644 --- a/Runtime/MP1/World/CBouncyGrenade.hpp +++ b/Runtime/MP1/World/CBouncyGrenade.hpp @@ -15,7 +15,7 @@ private: float x4_speed; public: - explicit SGrenadeVelocityInfo(CInputStream& in) : x0_mass(in.readFloatBig()), x4_speed(in.readFloatBig()) {} + explicit SGrenadeVelocityInfo(CInputStream& in) : x0_mass(in.ReadFloat()), x4_speed(in.ReadFloat()) {} [[nodiscard]] float GetMass() const { return x0_mass; } [[nodiscard]] float GetSpeed() const { return x4_speed; } diff --git a/Runtime/MP1/World/CChozoGhost.cpp b/Runtime/MP1/World/CChozoGhost.cpp index 26b6cc759..b611ee221 100644 --- a/Runtime/MP1/World/CChozoGhost.cpp +++ b/Runtime/MP1/World/CChozoGhost.cpp @@ -15,14 +15,14 @@ namespace metaforce::MP1 { CChozoGhost::CBehaveChance::CBehaveChance(CInputStream& in) -: x0_propertyCount(in.readUint32Big()) -, x4_lurk(in.readFloatBig()) -, x8_taunt(in.readFloatBig()) -, xc_attack(in.readFloatBig()) -, x10_move(in.readFloatBig()) -, x14_lurkTime(in.readFloatBig()) -, x18_chargeAttack(x0_propertyCount < 6 ? 0.5f : in.readFloatBig() * .01f) -, x1c_numBolts(x0_propertyCount < 7 ? 2 : in.readUint32Big()) { +: x0_propertyCount(in.ReadLong()) +, x4_lurk(in.ReadFloat()) +, x8_taunt(in.ReadFloat()) +, xc_attack(in.ReadFloat()) +, x10_move(in.ReadFloat()) +, x14_lurkTime(in.ReadFloat()) +, x18_chargeAttack(x0_propertyCount < 6 ? 0.5f : in.ReadFloat() * .01f) +, x1c_numBolts(x0_propertyCount < 7 ? 2 : in.ReadLong()) { float f2 = 1.f / (x10_move + xc_attack + x4_lurk + x8_taunt); x4_lurk *= f2; x8_taunt *= f2; diff --git a/Runtime/MP1/World/CDrone.cpp b/Runtime/MP1/World/CDrone.cpp index 9e25349a4..c6a396e1c 100644 --- a/Runtime/MP1/World/CDrone.cpp +++ b/Runtime/MP1/World/CDrone.cpp @@ -17,7 +17,7 @@ #include "Runtime/World/CTeamAiMgr.hpp" #include "Runtime/World/CWorld.hpp" -#include "DataSpec/DNAMP1/SFX/Drones.h" +#include "Audio/SFX/Drones.h" #include "TCastTo.hpp" // Generated file, do not modify include path diff --git a/Runtime/MP1/World/CElitePirate.cpp b/Runtime/MP1/World/CElitePirate.cpp index 98fde2c44..d0849ccc2 100644 --- a/Runtime/MP1/World/CElitePirate.cpp +++ b/Runtime/MP1/World/CElitePirate.cpp @@ -60,38 +60,38 @@ bool IsArmClawCollider(TUniqueId uid, const rstl::reserved_vector& } // Anonymous namespace CElitePirateData::CElitePirateData(CInputStream& in, u32 propCount) -: x0_tauntInterval(in.readFloatBig()) -, x4_tauntVariance(in.readFloatBig()) -, x8_(in.readFloatBig()) -, xc_(in.readFloatBig()) -, x10_attackChance(in.readFloatBig()) -, x14_shotAtTime(in.readFloatBig()) -, x18_shotAtTimeVariance(in.readFloatBig()) -, x1c_projectileAttractionRadius(in.readFloatBig()) +: x0_tauntInterval(in.ReadFloat()) +, x4_tauntVariance(in.ReadFloat()) +, x8_(in.ReadFloat()) +, xc_(in.ReadFloat()) +, x10_attackChance(in.ReadFloat()) +, x14_shotAtTime(in.ReadFloat()) +, x18_shotAtTimeVariance(in.ReadFloat()) +, x1c_projectileAttractionRadius(in.ReadFloat()) , x20_energyAbsorbParticleDescId(in) -, x24_energyAbsorbSfxId(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x24_energyAbsorbSfxId(CSfxManager::TranslateSFXID(in.ReadLong())) , x28_launcherActParams(ScriptLoader::LoadActorParameters(in)) , x90_launcherAnimParams(ScriptLoader::LoadAnimationParameters(in)) , x9c_launcherParticleGenDescId(in) -, xa0_launcherSfxId(CSfxManager::TranslateSFXID(in.readUint32Big())) +, xa0_launcherSfxId(CSfxManager::TranslateSFXID(in.ReadLong())) , xa4_grenadeModelId(in) , xa8_grenadeDamageInfo(in) -, xc4_launcherHp(in.readFloatBig()) +, xc4_launcherHp(in.ReadFloat()) , xc8_grenadeElementGenDescId1(in) , xcc_grenadeElementGenDescId2(in) , xd0_grenadeElementGenDescId3(in) , xd4_grenadeElementGenDescId4(in) , xd8_grenadeVelocityInfo(in) , xe0_grenadeTrajectoryInfo(in) -, xf0_grenadeNumBounces(in.readUint32Big()) -, xf4_grenadeBounceSfxId(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xf6_grenadeExplodeSfxId(CSfxManager::TranslateSFXID(in.readUint32Big())) +, xf0_grenadeNumBounces(in.ReadLong()) +, xf4_grenadeBounceSfxId(CSfxManager::TranslateSFXID(in.ReadLong())) +, xf6_grenadeExplodeSfxId(CSfxManager::TranslateSFXID(in.ReadLong())) , xf8_shockwaveParticleDescId(in) , xfc_shockwaveDamageInfo(in) , x118_shockwaveWeaponDescId(in) -, x11c_shockwaveElectrocuteSfxId(CSfxManager::TranslateSFXID(in.readUint32Big())) -, x11e_canCallForBackup(in.readBool()) -, x11f_fastWhenAttractingEnergy(propCount < 42 ? true : in.readBool()) {} +, x11c_shockwaveElectrocuteSfxId(CSfxManager::TranslateSFXID(in.ReadLong())) +, x11e_canCallForBackup(in.ReadBool()) +, x11f_fastWhenAttractingEnergy(propCount < 42 ? true : in.ReadBool()) {} CElitePirate::CElitePirate(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, diff --git a/Runtime/MP1/World/CFlaahgra.cpp b/Runtime/MP1/World/CFlaahgra.cpp index 2ec9fd1c7..63c65963d 100644 --- a/Runtime/MP1/World/CFlaahgra.cpp +++ b/Runtime/MP1/World/CFlaahgra.cpp @@ -45,10 +45,10 @@ constexpr std::array skSphereJointList{{ }}; CFlaahgraData::CFlaahgraData(CInputStream& in) -: x0_(in.readFloatBig()) -, x4_(in.readFloatBig()) -, x8_(in.readFloatBig()) -, xc_faintDuration(in.readFloatBig()) +: x0_(in.ReadFloat()) +, x4_(in.ReadFloat()) +, x8_(in.ReadFloat()) +, xc_faintDuration(in.ReadFloat()) , x10_(in) , x78_(in) , x7c_(in) @@ -57,9 +57,9 @@ CFlaahgraData::CFlaahgraData(CInputStream& in) , xb8_plantsParticleGenDescId(in) , xbc_(in) , xd8_(ScriptLoader::LoadActorParameters(in)) -, x140_(in.readFloatBig()) -, x144_(in.readFloatBig()) -, x148_(in.readFloatBig()) +, x140_(in.ReadFloat()) +, x144_(in.ReadFloat()) +, x148_(in.ReadFloat()) , x14c_animationParameters(ScriptLoader::LoadAnimationParameters(in)) , x158_(in) {} diff --git a/Runtime/MP1/World/CFlyingPirate.cpp b/Runtime/MP1/World/CFlyingPirate.cpp index 4842f2411..ba90fc9b2 100644 --- a/Runtime/MP1/World/CFlyingPirate.cpp +++ b/Runtime/MP1/World/CFlyingPirate.cpp @@ -74,34 +74,34 @@ constexpr std::array skRadii{ } // namespace CFlyingPirate::CFlyingPirateData::CFlyingPirateData(CInputStream& in, u32 propCount) -: x0_maxCoverDistance(in.readFloatBig()) -, x4_hearingDistance(in.readFloatBig()) -, x8_type(EFlyingPirateType(in.readUint32Big())) +: x0_maxCoverDistance(in.ReadFloat()) +, x4_hearingDistance(in.ReadFloat()) +, x8_type(EFlyingPirateType(in.ReadLong())) , xc_gunProjectileInfo(in) -, x34_gunSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x34_gunSfx(CSfxManager::TranslateSFXID(in.ReadLong())) , x38_altProjectileInfo1(in) , x60_altProjectileInfo2(CAssetId(in), {}) -, x88_knockBackDelay(in.readFloatBig()) -, x8c_flyingHeight(in.readFloatBig()) +, x88_knockBackDelay(in.ReadFloat()) +, x8c_flyingHeight(in.ReadFloat()) , x90_particleGenDesc(g_SimplePool->GetObj({SBIG('PART'), CAssetId(in)})) , x9c_dInfo(in) -, xb8_(in.readFloatBig()) -, xbc_(in.readFloatBig()) -, xc0_(in.readFloatBig()) -, xc4_(in.readFloatBig()) -, xc8_ragDollSfx1(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xca_ragDollSfx2(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xcc_coverCheckChance(in.readFloatBig()) -, xd0_(in.readFloatBig()) -, xd4_(in.readFloatBig()) +, xb8_(in.ReadFloat()) +, xbc_(in.ReadFloat()) +, xc0_(in.ReadFloat()) +, xc4_(in.ReadFloat()) +, xc8_ragDollSfx1(CSfxManager::TranslateSFXID(in.ReadLong())) +, xca_ragDollSfx2(CSfxManager::TranslateSFXID(in.ReadLong())) +, xcc_coverCheckChance(in.ReadFloat()) +, xd0_(in.ReadFloat()) +, xd4_(in.ReadFloat()) , xd8_particleGen1(in) , xdc_particleGen2(in) , xe0_particleGen3(in) -, xe4_knockBackSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xe6_deathSfx(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xe8_aggressionChance(in.readFloatBig()) -, xec_(in.readFloatBig()) -, xf0_projectileHomingDistance(propCount < 36 ? 0.f : in.readFloatBig()) { +, xe4_knockBackSfx(CSfxManager::TranslateSFXID(in.ReadLong())) +, xe6_deathSfx(CSfxManager::TranslateSFXID(in.ReadLong())) +, xe8_aggressionChance(in.ReadFloat()) +, xec_(in.ReadFloat()) +, xf0_projectileHomingDistance(propCount < 36 ? 0.f : in.ReadFloat()) { xc_gunProjectileInfo.Token().Lock(); x38_altProjectileInfo1.Token().Lock(); x60_altProjectileInfo2.Token().Lock(); diff --git a/Runtime/MP1/World/CGrenadeLauncher.hpp b/Runtime/MP1/World/CGrenadeLauncher.hpp index f3dc57e69..ed0e9050e 100644 --- a/Runtime/MP1/World/CGrenadeLauncher.hpp +++ b/Runtime/MP1/World/CGrenadeLauncher.hpp @@ -29,10 +29,10 @@ private: public: explicit SGrenadeTrajectoryInfo(CInputStream& in) - : x0_velocityMin(in.readFloatBig()) - , x4_velocityMax(in.readFloatBig()) - , x8_angleMin(zeus::degToRad(in.readFloatBig())) - , xc_angleMax(zeus::degToRad(in.readFloatBig())) {} + : x0_velocityMin(in.ReadFloat()) + , x4_velocityMax(in.ReadFloat()) + , x8_angleMin(zeus::degToRad(in.ReadFloat())) + , xc_angleMax(zeus::degToRad(in.ReadFloat())) {} [[nodiscard]] float GetVelocityMin() const { return x0_velocityMin; } [[nodiscard]] float GetVelocityMax() const { return x4_velocityMax; } diff --git a/Runtime/MP1/World/CIceSheegoth.cpp b/Runtime/MP1/World/CIceSheegoth.cpp index df5da2bee..bfebf602c 100644 --- a/Runtime/MP1/World/CIceSheegoth.cpp +++ b/Runtime/MP1/World/CIceSheegoth.cpp @@ -46,17 +46,17 @@ constexpr std::array skRightLegJointList = {{ } // namespace CIceSheegothData::CIceSheegothData(CInputStream& in, [[maybe_unused]] s32 propertyCount) -: x0_(zeus::degToRad(in.readFloatBig())) -, x4_(zeus::degToRad(in.readFloatBig())) -, x8_(zeus::CVector3f::ReadBig(in)) -, x14_(in.readFloatBig()) +: x0_(zeus::degToRad(in.ReadFloat())) +, x4_(zeus::degToRad(in.ReadFloat())) +, x8_(in.Get()) +, x14_(in.ReadFloat()) , x18_(in) , x80_(in) , xe8_(in) , x150_(in) , x154_(in) -, x170_(in.readFloatBig()) -, x174_(in.readFloatBig()) +, x170_(in.ReadFloat()) +, x174_(in.ReadFloat()) , x178_(in) , x17c_fireBreathResId(in) , x180_fireBreathDamage(in) @@ -65,18 +65,18 @@ CIceSheegothData::CIceSheegothData(CInputStream& in, [[maybe_unused]] s32 proper , x1a4_(in) , x1a8_(in) , x1ac_(in) -, x1b0_(in.readFloatBig()) -, x1b4_(in.readFloatBig()) +, x1b0_(in.ReadFloat()) +, x1b4_(in.ReadFloat()) , x1b8_(in) -, x1d4_(CSfxManager::TranslateSFXID(in.readUint32Big())) -, x1d8_(in.readFloatBig()) -, x1dc_(in.readFloatBig()) -, x1e0_maxInterestTime(in.readFloatBig()) +, x1d4_(CSfxManager::TranslateSFXID(in.ReadLong())) +, x1d8_(in.ReadFloat()) +, x1dc_(in.ReadFloat()) +, x1e0_maxInterestTime(in.ReadFloat()) , x1e4_(in) -, x1e8_(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x1e8_(CSfxManager::TranslateSFXID(in.ReadLong())) , x1ec_(in) -, x1f0_24_(in.readBool()) -, x1f0_25_(in.readBool()) {} +, x1f0_24_(in.ReadBool()) +, x1f0_25_(in.ReadBool()) {} CIceSheegoth::CIceSheegoth(TUniqueId uid, std::string_view name, const CEntityInfo& info, zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, diff --git a/Runtime/MP1/World/CMetaree.hpp b/Runtime/MP1/World/CMetaree.hpp index cb379eec9..fd1a0e46d 100644 --- a/Runtime/MP1/World/CMetaree.hpp +++ b/Runtime/MP1/World/CMetaree.hpp @@ -1,6 +1,6 @@ #pragma once -#include "DataSpec/DNAMP1/SFX/Metaree.h" +#include "Audio/SFX/Metaree.h" #include "Runtime/World/CDamageInfo.hpp" #include "Runtime/World/CPatterned.hpp" diff --git a/Runtime/MP1/World/CMetroid.cpp b/Runtime/MP1/World/CMetroid.cpp index 2ef82e5ca..d5705d041 100644 --- a/Runtime/MP1/World/CMetroid.cpp +++ b/Runtime/MP1/World/CMetroid.cpp @@ -61,17 +61,17 @@ constexpr std::array skJointNameList = { CMetroidData::CMetroidData(CInputStream& in) : x0_frozenVulnerability(in) , x68_energyDrainVulnerability(in) -, xd0_energyDrainPerSec(in.readFloatBig()) -, xd4_maxEnergyDrainAllowed(in.readFloatBig()) -, xd8_telegraphAttackTime(in.readFloatBig()) -, xdc_stage2GrowthScale(in.readFloatBig()) -, xe0_stage2GrowthEnergy(in.readFloatBig()) -, xe4_explosionGrowthEnergy(in.readFloatBig()) { +, xd0_energyDrainPerSec(in.ReadFloat()) +, xd4_maxEnergyDrainAllowed(in.ReadFloat()) +, xd8_telegraphAttackTime(in.ReadFloat()) +, xdc_stage2GrowthScale(in.ReadFloat()) +, xe0_stage2GrowthEnergy(in.ReadFloat()) +, xe4_explosionGrowthEnergy(in.ReadFloat()) { xe8_animParms1 = ScriptLoader::LoadAnimationParameters(in); xf8_animParms2 = ScriptLoader::LoadAnimationParameters(in); x108_animParms3 = ScriptLoader::LoadAnimationParameters(in); x118_animParms4 = ScriptLoader::LoadAnimationParameters(in); - x128_24_startsInWall = in.readBool(); + x128_24_startsInWall = in.ReadBool(); } CMetroid::CMetroid(TUniqueId uid, std::string_view name, EFlavorType flavor, const CEntityInfo& info, diff --git a/Runtime/MP1/World/CMetroidBeta.cpp b/Runtime/MP1/World/CMetroidBeta.cpp index 2a6425daa..bd9a3a7de 100644 --- a/Runtime/MP1/World/CMetroidBeta.cpp +++ b/Runtime/MP1/World/CMetroidBeta.cpp @@ -20,21 +20,21 @@ namespace metaforce::MP1 { CMetroidBetaData::CMetroidBetaData(CInputStream& in) : x0_(in) , x68_(in) -, xd0_(in.readFloatBig()) -, xd4_(in.readFloatBig()) -, xd8_(in.readFloatBig()) -, xdc_(in.readFloatBig()) -, xe0_(in.readFloatBig()) -, xe4_(in.readFloatBig()) -, xe8_(in.readFloatBig()) -, xec_(in.readFloatBig()) -, xf0_(in.readFloatBig()) +, xd0_(in.ReadFloat()) +, xd4_(in.ReadFloat()) +, xd8_(in.ReadFloat()) +, xdc_(in.ReadFloat()) +, xe0_(in.ReadFloat()) +, xe4_(in.ReadFloat()) +, xe8_(in.ReadFloat()) +, xec_(in.ReadFloat()) +, xf0_(in.ReadFloat()) , xf4_(in) , xf8_(in) , xfc_(in) , x100_(in) , x104_(in) -, x108_24_(in.readBool()) {} +, x108_24_(in.ReadBool()) {} CMetroidBeta::CMetroidBeta(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& aParms, diff --git a/Runtime/MP1/World/CMetroidPrimeEssence.cpp b/Runtime/MP1/World/CMetroidPrimeEssence.cpp index a6a83c692..78c8c8d0e 100644 --- a/Runtime/MP1/World/CMetroidPrimeEssence.cpp +++ b/Runtime/MP1/World/CMetroidPrimeEssence.cpp @@ -14,7 +14,7 @@ #include "Runtime/World/CScriptWaypoint.hpp" #include "Runtime/World/CWorld.hpp" -#include "DataSpec/DNAMP1/SFX/MetroidPrime.h" +#include "Audio/SFX/MetroidPrime.h" #include "TCastTo.hpp" // Generated file, do not modify include path @@ -721,4 +721,4 @@ void CMetroidPrimeEssence::SetupCollisionActorManager(CStateManager& mgr) { AddMaterial(EMaterialTypes::ProjectilePassthrough, mgr); } -} // namespace metaforce::MP1 \ No newline at end of file +} // namespace metaforce::MP1 diff --git a/Runtime/MP1/World/CMetroidPrimeExo.cpp b/Runtime/MP1/World/CMetroidPrimeExo.cpp index 4d4da58a5..55b0350db 100644 --- a/Runtime/MP1/World/CMetroidPrimeExo.cpp +++ b/Runtime/MP1/World/CMetroidPrimeExo.cpp @@ -1,7 +1,5 @@ #include "Runtime/MP1/World/CMetroidPrimeExo.hpp" -#include "DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage1.hpp" - #include "Runtime/CSimplePool.hpp" #include "Runtime/CStateManager.hpp" #include "Runtime/Collision/CCollisionActor.hpp" @@ -22,6 +20,8 @@ #include "Runtime/World/CWorld.hpp" #include "Runtime/World/ScriptLoader.hpp" +#include "Runtime/Streams/IOStreams.hpp" + #include "TCastTo.hpp" // Generated file, do not modify include path namespace metaforce::MP1 { @@ -144,29 +144,29 @@ std::array, 14> skSomeValues2{{ }}; } // namespace SPrimeStruct2B::SPrimeStruct2B(CInputStream& in) -: x0_propertyCount(in.readUint32Big()) -, x4_particle1(in.readUint32Big()) -, x8_particle2(in.readUint32Big()) -, xc_particle3(in.readUint32Big()) +: x0_propertyCount(in.ReadLong()) +, x4_particle1(in.Get()) +, x8_particle2(in.Get()) +, xc_particle3(in.Get()) , x10_dInfo(in) -, x2c_(in.readFloatBig()) -, x30_(in.readFloatBig()) -, x34_texture(in.readUint32Big()) -, x38_(CSfxManager::TranslateSFXID(u16(in.readUint32Big()))) -, x3a_(CSfxManager::TranslateSFXID(u16(in.readUint32Big()))) {} +, x2c_(in.ReadFloat()) +, x30_(in.ReadFloat()) +, x34_texture(in.Get()) +, x38_(CSfxManager::TranslateSFXID(u16(in.ReadLong()))) +, x3a_(CSfxManager::TranslateSFXID(u16(in.ReadLong()))) {} SPrimeStruct4::SPrimeStruct4(CInputStream& in) : x0_beamInfo(in) -, x44_(in.readUint32Big()) +, x44_(in.ReadLong()) , x48_dInfo1(in) , x64_struct5(CPlasmaProjectile::LoadPlayerEffectResources(in)) -, x88_(in.readFloatBig()) +, x88_(in.ReadFloat()) , x8c_dInfo2(in) {} SPrimeStruct6::SPrimeStruct6(CInputStream& in) -: x0_propertyCount(in.readUint32Big()), x4_damageVulnerability(in), x6c_color(zeus::CColor::ReadRGBABig(in)) { - x70_[0] = in.readUint32Big(); - x70_[1] = in.readUint32Big(); +: x0_propertyCount(in.ReadLong()), x4_damageVulnerability(in), x6c_color(in.Get()) { + x70_[0] = in.ReadLong(); + x70_[1] = in.ReadLong(); } static CPatternedInfo LoadPatternedInfo(CInputStream& in) { @@ -174,23 +174,59 @@ static CPatternedInfo LoadPatternedInfo(CInputStream& in) { return CPatternedInfo(in, pcount.second); } -using CameraShakeData = DataSpec::DNAMP1::MetroidPrimeStage1::MassivePrimeStruct::CameraShakeData; +struct SExoCameraShakePoint { + float x0_attackTime{}; + float x4_sustainTime{}; + float x8_duration{}; + float xc_magnitude{}; + SExoCameraShakePoint() = default; + SExoCameraShakePoint(CInputStream& in) + : x0_attackTime(in.ReadFloat()) + , x4_sustainTime(in.ReadFloat()) + , x8_duration(in.ReadFloat()) + , xc_magnitude(in.ReadFloat()) {} +}; -static SCameraShakePoint BuildCameraShakePoint(CameraShakeData::CameraShakerComponent::CameraShakePoint& sp) { - return SCameraShakePoint(false, sp.attackTime, sp.sustainTime, sp.duration, sp.magnitude); +struct SExoCameraShakerComponent { + bool x0_useModulation{}; + SExoCameraShakePoint x4_am{}; + SExoCameraShakePoint x14_fm{}; + SExoCameraShakerComponent() = default; + explicit SExoCameraShakerComponent(CInputStream& in) + : x0_useModulation(in.ReadBool()), x4_am(in.Get()), x14_fm(in.Get()) {} +}; + +struct SExoCameraShakeData { + bool x0_useSfx{}; + float x4_duration{}; + float x8_sfxDist{}; + std::array xc_components{}; + SExoCameraShakeData() = default; + explicit SExoCameraShakeData(CInputStream& in) + : x0_useSfx(in.ReadBool()), x4_duration(in.ReadFloat()), x8_sfxDist(in.ReadFloat()) { + for (auto& component : xc_components) { + component = in.Get(); + } + } +}; + +static SCameraShakePoint BuildCameraShakePoint(SExoCameraShakePoint& sp) { + return {false, sp.x0_attackTime, sp.x4_sustainTime, sp.x8_duration, sp.xc_magnitude}; } -static CCameraShakerComponent BuildCameraShakerComponent(CameraShakeData::CameraShakerComponent& comp) { - return CCameraShakerComponent(comp.useModulation, BuildCameraShakePoint(comp.am), BuildCameraShakePoint(comp.fm)); +static CCameraShakerComponent BuildCameraShakerComponent(SExoCameraShakerComponent& comp) { + return {comp.x0_useModulation, BuildCameraShakePoint(comp.x4_am), BuildCameraShakePoint(comp.x14_fm)}; } static CCameraShakeData LoadCameraShakeData(CInputStream& in) { - CameraShakeData shakeData; - shakeData.read(in); - return CCameraShakeData(shakeData.duration, shakeData.sfxDist, u32(shakeData.useSfx), zeus::skZero3f, - BuildCameraShakerComponent(shakeData.shakerComponents[0]), - BuildCameraShakerComponent(shakeData.shakerComponents[1]), - BuildCameraShakerComponent(shakeData.shakerComponents[2])); + auto shakeData = in.Get(); + return {shakeData.x4_duration, + shakeData.x8_sfxDist, + u32(shakeData.x0_useSfx), + zeus::skZero3f, + BuildCameraShakerComponent(shakeData.xc_components[0]), + BuildCameraShakerComponent(shakeData.xc_components[1]), + BuildCameraShakerComponent(shakeData.xc_components[2])}; } static rstl::reserved_vector LoadPrimeStruct4s(CInputStream& in) { @@ -203,41 +239,42 @@ static rstl::reserved_vector LoadPrimeStruct4s(CInputStream& i static rstl::reserved_vector LoadPrimeStruct6s(CInputStream& in) { rstl::reserved_vector ret; - for (int i = 0; i < 4; ++i) + for (int i = 0; i < 4; ++i) { ret.emplace_back(in); + } return ret; } SPrimeExoParameters::SPrimeExoParameters(CInputStream& in) -: x0_propertyCount(in.readUint32Big()) +: x0_propertyCount(in.ReadLong()) , x4_patternedInfo(LoadPatternedInfo(in)) , x13c_actorParms(ScriptLoader::LoadActorParameters(in)) -, x1a4_(in.readUint32Big()) +, x1a4_(in.ReadLong()) , x1a8_(LoadCameraShakeData(in)) , x27c_(LoadCameraShakeData(in)) , x350_(LoadCameraShakeData(in)) , x424_(in) -, x460_particle1(in.readUint32Big()) +, x460_particle1(in.Get()) , x464_(LoadPrimeStruct4s(in)) -, x708_wpsc1(in.readUint32Big()) +, x708_wpsc1(in.Get()) , x70c_dInfo1(in) , x728_shakeData1(LoadCameraShakeData(in)) -, x7fc_wpsc2(in.readUint32Big()) +, x7fc_wpsc2(in.Get()) , x800_dInfo2(in) , x81c_shakeData2(LoadCameraShakeData(in)) , x8f0_(in) , x92c_(in) , x948_(LoadCameraShakeData(in)) -, xa1c_particle2(in.readUint32Big()) -, xa20_swoosh(in.readUint32Big()) -, xa24_particle3(in.readUint32Big()) -, xa28_particle4(in.readUint32Big()) +, xa1c_particle2(in.Get()) +, xa20_swoosh(in.Get()) +, xa24_particle3(in.Get()) +, xa28_particle4(in.Get()) , xa2c_(LoadPrimeStruct6s(in)) {} SPrimeExoRoomParameters::SPrimeExoRoomParameters(CInputStream& in) { - u32 propCount = std::min(u32(14), in.readUint32Big()); + u32 propCount = std::min(14, in.ReadLong()); for (u32 i = 0; i < propCount; ++i) { - x0_.push_back(in.readFloatBig()); + x0_.push_back(in.ReadFloat()); } } @@ -1489,7 +1526,8 @@ TUniqueId CMetroidPrimeExo::GetNextAttackWaypoint(CStateManager& mgr, bool b1) { return lastUid; } -TUniqueId CMetroidPrimeExo::GetWaypointForBehavior(CStateManager& mgr, EScriptObjectState state, EScriptObjectMessage msg) { +TUniqueId CMetroidPrimeExo::GetWaypointForBehavior(CStateManager& mgr, EScriptObjectState state, + EScriptObjectMessage msg) { if (TCastToConstPtr relay = mgr.GetObjectById(x568_relayId)) { rstl::reserved_vector uids; for (const auto& conn : relay->GetConnectionList()) { diff --git a/Runtime/MP1/World/CMetroidPrimeProjectile.cpp b/Runtime/MP1/World/CMetroidPrimeProjectile.cpp index 6c7b1bf8d..3c96b62f0 100644 --- a/Runtime/MP1/World/CMetroidPrimeProjectile.cpp +++ b/Runtime/MP1/World/CMetroidPrimeProjectile.cpp @@ -6,17 +6,17 @@ namespace metaforce::MP1 { SPrimeProjectileInfo::SPrimeProjectileInfo(CInputStream& in) -: x0_propertyCount(in.readUint32Big()) -, x4_particle(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), in.readUint32Big()})) +: x0_propertyCount(in.ReadLong()) +, x4_particle(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), CAssetId(in)})) , xc_dInfo(in) -, x28_(in.readFloatBig()) -, x2c_(in.readFloatBig()) -, x30_(in.readFloatBig()) -, x34_texture(in.readUint32Big()) { - x38_24_ = in.readBool(); - x38_25_ = in.readBool(); - x38_26_ = in.readBool(); - x38_27_ = in.readBool(); +, x28_(in.ReadFloat()) +, x2c_(in.ReadFloat()) +, x30_(in.ReadFloat()) +, x34_texture(in) { + x38_24_ = in.ReadBool(); + x38_25_ = in.ReadBool(); + x38_26_ = in.ReadBool(); + x38_27_ = in.ReadBool(); } CMetroidPrimeProjectile::CMetroidPrimeProjectile(bool active, const TToken& desc, EWeaponType type, diff --git a/Runtime/MP1/World/CRidley.cpp b/Runtime/MP1/World/CRidley.cpp index 5114a3ab0..09f8f1ddd 100644 --- a/Runtime/MP1/World/CRidley.cpp +++ b/Runtime/MP1/World/CRidley.cpp @@ -208,34 +208,34 @@ CRidleyData::CRidleyData(CInputStream& in, u32 propCount) , x28_(in) , x2c_(in) , x30_(in) -, x34_(in.readFloatBig()) -, x38_(in.readFloatBig()) -, x3c_(in.readFloatBig()) -, x40_(in.readFloatBig()) +, x34_(in.ReadFloat()) +, x38_(in.ReadFloat()) +, x3c_(in.ReadFloat()) +, x40_(in.ReadFloat()) , x44_(in) , x48_(in) , x64_(in) -, xa8_(CSfxManager::TranslateSFXID(in.readUint32Big())) +, xa8_(CSfxManager::TranslateSFXID(in.ReadLong())) , xac_(in) , xb0_(in) , xcc_(in) , x1a0_(in) , x1a4_(in) , x1c0_(in) -, x294_(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x294_(CSfxManager::TranslateSFXID(in.ReadLong())) , x298_(in) , x2b4_(in) -, x388_(in.readFloatBig()) -, x38c_(in.readFloatBig()) +, x388_(in.ReadFloat()) +, x38c_(in.ReadFloat()) , x390_(in) -, x3ac_(in.readFloatBig()) +, x3ac_(in.ReadFloat()) , x3b0_(in) -, x3cc_(in.readFloatBig()) +, x3cc_(in.ReadFloat()) , x3d0_(in) -, x3ec_(in.readFloatBig()) +, x3ec_(in.ReadFloat()) , x3f0_(in) -, x3f4_(in.readFloatBig()) -, x3f8_(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x3f4_(in.ReadFloat()) +, x3f8_(CSfxManager::TranslateSFXID(in.ReadLong())) , x3fc_(propCount > 47 ? CDamageInfo(in) : x48_) {} CRidley::CRidley(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, diff --git a/Runtime/MP1/World/CSpacePirate.cpp b/Runtime/MP1/World/CSpacePirate.cpp index 24467e064..413c4c1aa 100644 --- a/Runtime/MP1/World/CSpacePirate.cpp +++ b/Runtime/MP1/World/CSpacePirate.cpp @@ -152,34 +152,34 @@ std::list mChargePlayerList; } // Anonymous namespace CSpacePirate::CSpacePirateData::CSpacePirateData(metaforce::CInputStream& in, u32 propCount) -: x0_AggressionCheck(in.readFloatBig()) -, x4_CoverCheck(in.readFloatBig()) -, x8_SearchRadius(in.readFloatBig()) -, xc_FallBackCheck(in.readFloatBig()) -, x10_FallBackRadius(in.readFloatBig()) -, x14_HearingRadius(in.readFloatBig()) -, x18_flags(in.readUint32Big()) -, x1c_(in.readBool()) +: x0_AggressionCheck(in.ReadFloat()) +, x4_CoverCheck(in.ReadFloat()) +, x8_SearchRadius(in.ReadFloat()) +, xc_FallBackCheck(in.ReadFloat()) +, x10_FallBackRadius(in.ReadFloat()) +, x14_HearingRadius(in.ReadFloat()) +, x18_flags(in.ReadLong()) +, x1c_(in.ReadBool()) , x20_Projectile(in) -, x48_Sound_Projectile(CSfxManager::TranslateSFXID(in.readUint32Big())) +, x48_Sound_Projectile(CSfxManager::TranslateSFXID(in.ReadLong())) , x4c_BladeDamage(in) -, x68_KneelAttackChance(in.readFloatBig()) +, x68_KneelAttackChance(in.ReadFloat()) , x6c_KneelAttackShot(in) -, x94_DodgeCheck(in.readFloatBig()) -, x98_Sound_Impact(CSfxManager::TranslateSFXID(in.readUint32Big())) -, x9c_averageNextShotTime(in.readFloatBig()) -, xa0_nextShotTimeVariation(in.readFloatBig()) -, xa4_Sound_Alert(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xa8_GunTrackDelay(in.readFloatBig()) -, xac_firstBurstCount(in.readUint32Big()) -, xb0_CloakOpacity(in.readFloatBig()) -, xb4_MaxCloakOpacity(in.readFloatBig()) -, xb8_dodgeDelayTimeMin(in.readFloatBig()) -, xbc_dodgeDelayTimeMax(in.readFloatBig()) -, xc0_Sound_Hurled(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xc2_Sound_Death(CSfxManager::TranslateSFXID(in.readUint32Big())) -, xc4_(propCount > 35 ? in.readFloatBig() : 0.2f) -, xc8_AvoidDistance(propCount > 36 ? in.readFloatBig() : 8.f) {} +, x94_DodgeCheck(in.ReadFloat()) +, x98_Sound_Impact(CSfxManager::TranslateSFXID(in.ReadLong())) +, x9c_averageNextShotTime(in.ReadFloat()) +, xa0_nextShotTimeVariation(in.ReadFloat()) +, xa4_Sound_Alert(CSfxManager::TranslateSFXID(in.ReadLong())) +, xa8_GunTrackDelay(in.ReadFloat()) +, xac_firstBurstCount(in.ReadLong()) +, xb0_CloakOpacity(in.ReadFloat()) +, xb4_MaxCloakOpacity(in.ReadFloat()) +, xb8_dodgeDelayTimeMin(in.ReadFloat()) +, xbc_dodgeDelayTimeMax(in.ReadFloat()) +, xc0_Sound_Hurled(CSfxManager::TranslateSFXID(in.ReadLong())) +, xc2_Sound_Death(CSfxManager::TranslateSFXID(in.ReadLong())) +, xc4_(propCount > 35 ? in.ReadFloat() : 0.2f) +, xc8_AvoidDistance(propCount > 36 ? in.ReadFloat() : 8.f) {} CPirateRagDoll::CPirateRagDoll(CStateManager& mgr, CSpacePirate* sp, u16 thudSfx, u32 flags) : CRagDoll(-sp->GetGravityConstant(), -3.f, 8.f, flags), x6c_spacePirate(sp), x70_thudSfx(thudSfx) { diff --git a/Runtime/MP1/World/CThardus.cpp b/Runtime/MP1/World/CThardus.cpp index d8ea69cbd..ec3c3f3c5 100644 --- a/Runtime/MP1/World/CThardus.cpp +++ b/Runtime/MP1/World/CThardus.cpp @@ -24,8 +24,8 @@ #include "TCastTo.hpp" // Generated file, do not modify include path -#include -#include +#include