diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/animation/AnimManager.cpp | 344 | ||||
-rw-r--r-- | src/animation/AnimationId.h | 360 | ||||
-rw-r--r-- | src/audio/AudioLogic.cpp | 2 | ||||
-rw-r--r-- | src/audio/MusicManager.cpp | 281 | ||||
-rw-r--r-- | src/audio/MusicManager.h | 10 | ||||
-rw-r--r-- | src/audio/audio_enums.h | 5 | ||||
-rw-r--r-- | src/audio/oal/channel.cpp | 56 | ||||
-rw-r--r-- | src/audio/oal/channel.h | 6 | ||||
-rw-r--r-- | src/audio/oal/stream.cpp | 88 | ||||
-rw-r--r-- | src/audio/oal/stream.h | 5 | ||||
-rw-r--r-- | src/audio/sampman_miles.cpp | 10 | ||||
-rw-r--r-- | src/audio/sampman_oal.cpp | 93 | ||||
-rw-r--r-- | src/audio/soundlist.h | 2 | ||||
-rw-r--r-- | src/control/AutoPilot.cpp | 8 | ||||
-rw-r--r-- | src/control/AutoPilot.h | 4 | ||||
-rw-r--r-- | src/control/Phones.cpp | 10 | ||||
-rw-r--r-- | src/control/Replay.cpp | 10 | ||||
-rw-r--r-- | src/control/Script.cpp | 4 | ||||
-rw-r--r-- | src/control/Script2.cpp | 4 | ||||
-rw-r--r-- | src/control/Script3.cpp | 2 | ||||
-rw-r--r-- | src/control/Script4.cpp | 6 | ||||
-rw-r--r-- | src/control/Script5.cpp | 8 | ||||
-rw-r--r-- | src/core/AnimViewer.cpp | 8 | ||||
-rw-r--r-- | src/core/Cam.cpp | 10 | ||||
-rw-r--r-- | src/core/CdStream.cpp | 41 | ||||
-rw-r--r-- | src/core/ControllerConfig.cpp | 43 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 407 | ||||
-rw-r--r-- | src/core/Frontend.h | 22 | ||||
-rw-r--r-- | src/core/Game.cpp | 9 | ||||
-rw-r--r-- | src/core/MenuScreens.cpp | 11 | ||||
-rw-r--r-- | src/core/MenuScreensCustom.cpp | 119 | ||||
-rw-r--r-- | src/core/Pad.cpp | 122 | ||||
-rw-r--r-- | src/core/Pad.h | 2 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 4 | ||||
-rw-r--r-- | src/core/World.cpp | 2 | ||||
-rw-r--r-- | src/core/common.h | 2 | ||||
-rw-r--r-- | src/core/config.h | 26 | ||||
-rw-r--r-- | src/core/main.cpp | 69 | ||||
-rw-r--r-- | src/core/re3.cpp | 256 | ||||
-rw-r--r-- | src/extras/GitSHA1.cpp.in | 2 | ||||
-rw-r--r-- | src/extras/GitSHA1.h | 1 | ||||
-rw-r--r-- | src/extras/custompipes_d3d9.cpp | 31 | ||||
-rw-r--r-- | src/extras/custompipes_gl.cpp | 34 | ||||
-rw-r--r-- | src/extras/postfx.cpp | 12 | ||||
-rw-r--r-- | src/extras/screendroplets.cpp | 6 | ||||
-rw-r--r-- | src/extras/shaders/Makefile | 79 | ||||
-rw-r--r-- | src/extras/shaders/colourfilterIII.frag | 2 | ||||
-rw-r--r-- | src/extras/shaders/colourfilterIII_PS.hlsl | 2 | ||||
-rw-r--r-- | src/extras/shaders/contrast.frag | 2 | ||||
-rw-r--r-- | src/extras/shaders/make_glsl.sh | 9 | ||||
-rw-r--r-- | src/extras/shaders/make_hlsl.cmd (renamed from src/extras/shaders/make.cmd) | 4 | ||||
-rw-r--r-- | src/extras/shaders/makeinc_glsl.sh | 6 | ||||
-rw-r--r-- | src/extras/shaders/makeinc_hlsl.sh (renamed from src/extras/shaders/makeinc.sh) | 1 | ||||
-rw-r--r-- | src/extras/shaders/neoVehicle.vert | 2 | ||||
-rw-r--r-- | src/extras/shaders/neoVehicle_VS.hlsl | 2 | ||||
-rw-r--r-- | src/extras/shaders/obj/colourfilterIII_PS.cso (renamed from src/extras/shaders/colourfilterIII_PS.cso) | bin | 452 -> 452 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/colourfilterIII_PS.inc (renamed from src/extras/shaders/colourfilterIII_PS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/colourfilterIII_frag.inc (renamed from src/extras/shaders/colourfilterIII_fs_gl.inc) | 2 | ||||
-rw-r--r-- | src/extras/shaders/obj/contrastPS.cso (renamed from src/extras/shaders/contrastPS.cso) | bin | 344 -> 344 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/contrastPS.inc (renamed from src/extras/shaders/contrastPS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/contrast_frag.inc (renamed from src/extras/shaders/contrast_fs_gl.inc) | 2 | ||||
-rw-r--r-- | src/extras/shaders/obj/default_UV2_VS.cso (renamed from src/extras/shaders/default_UV2_VS.cso) | bin | 628 -> 628 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/default_UV2_VS.inc (renamed from src/extras/shaders/default_UV2_VS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/default_UV2_vert.inc (renamed from src/extras/shaders/default_UV2_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/im2d_UV2_vert.inc (renamed from src/extras/shaders/im2d_UV2_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/im2d_vert.inc (renamed from src/extras/shaders/im2d_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoGloss_PS.cso (renamed from src/extras/shaders/neoGloss_PS.cso) | bin | 444 -> 444 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoGloss_PS.inc (renamed from src/extras/shaders/neoGloss_PS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoGloss_VS.cso (renamed from src/extras/shaders/neoGloss_VS.cso) | bin | 764 -> 764 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoGloss_VS.inc (renamed from src/extras/shaders/neoGloss_VS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoGloss_frag.inc (renamed from src/extras/shaders/neoGloss_fs_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoGloss_vert.inc (renamed from src/extras/shaders/neoGloss_vs_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoRimSkin_VS.cso (renamed from src/extras/shaders/neoRimSkin_VS.cso) | bin | 2404 -> 2404 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoRimSkin_VS.inc (renamed from src/extras/shaders/neoRimSkin_VS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoRimSkin_vert.inc (renamed from src/extras/shaders/neoRimSkin_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoRim_VS.cso (renamed from src/extras/shaders/neoRim_VS.cso) | bin | 1384 -> 1384 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoRim_VS.inc (renamed from src/extras/shaders/neoRim_VS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoRim_vert.inc (renamed from src/extras/shaders/neoRim_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoVehicle_PS.cso (renamed from src/extras/shaders/neoVehicle_PS.cso) | bin | 476 -> 476 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoVehicle_PS.inc (renamed from src/extras/shaders/neoVehicle_PS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoVehicle_VS.cso (renamed from src/extras/shaders/neoVehicle_VS.cso) | bin | 1896 -> 1896 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoVehicle_VS.inc (renamed from src/extras/shaders/neoVehicle_VS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoVehicle_frag.inc (renamed from src/extras/shaders/neoVehicle_fs_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoVehicle_vert.inc (renamed from src/extras/shaders/neoVehicle_vs_gl.inc) | 2 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoWorldIII_PS.cso (renamed from src/extras/shaders/neoWorldIII_PS.cso) | bin | 528 -> 528 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/neoWorldIII_PS.inc (renamed from src/extras/shaders/neoWorldIII_PS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/neoWorldIII_frag.inc (renamed from src/extras/shaders/neoWorldIII_fs_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/screenDroplet_PS.cso (renamed from src/extras/shaders/screenDroplet_PS.cso) | bin | 324 -> 324 bytes | |||
-rw-r--r-- | src/extras/shaders/obj/screenDroplet_PS.inc (renamed from src/extras/shaders/screenDroplet_PS.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/screenDroplet_frag.inc (renamed from src/extras/shaders/screenDroplet_fs_gl.inc) | 0 | ||||
-rw-r--r-- | src/extras/shaders/obj/simple_frag.inc (renamed from src/extras/shaders/simple_fs_gl.inc) | 0 | ||||
-rw-r--r-- | src/fakerw/fake.cpp | 37 | ||||
-rw-r--r-- | src/fakerw/rtpng.h | 4 | ||||
-rw-r--r-- | src/peds/CopPed.cpp | 6 | ||||
-rw-r--r-- | src/peds/EmergencyPed.cpp | 2 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 383 | ||||
-rw-r--r-- | src/peds/PedAI.cpp | 352 | ||||
-rw-r--r-- | src/peds/PedFight.cpp | 358 | ||||
-rw-r--r-- | src/peds/PlayerPed.cpp | 74 | ||||
-rw-r--r-- | src/peds/Population.cpp | 2 | ||||
-rw-r--r-- | src/render/Clouds.cpp | 4 | ||||
-rw-r--r-- | src/render/Font.cpp | 32 | ||||
-rw-r--r-- | src/render/Font.h | 1 | ||||
-rw-r--r-- | src/render/Hud.cpp | 8 | ||||
-rw-r--r-- | src/render/Shadows.cpp | 4 | ||||
-rw-r--r-- | src/render/WaterCannon.cpp | 4 | ||||
-rw-r--r-- | src/skel/crossplatform.h | 9 | ||||
-rw-r--r-- | src/skel/glfw/glfw.cpp | 23 | ||||
-rw-r--r-- | src/skel/win/gta3.ico | bin | 2238 -> 161654 bytes | |||
-rw-r--r-- | src/skel/win/win.cpp | 9 | ||||
-rw-r--r-- | src/text/Text.cpp | 2 | ||||
-rw-r--r-- | src/vehicles/Automobile.cpp | 78 | ||||
-rw-r--r-- | src/vehicles/Vehicle.h | 4 | ||||
-rw-r--r-- | src/weapons/BulletInfo.cpp | 6 | ||||
-rw-r--r-- | src/weapons/Weapon.cpp | 20 | ||||
-rw-r--r-- | src/weapons/WeaponInfo.cpp | 6 |
117 files changed, 2545 insertions, 1562 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index df39c7c9..c81873fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ -set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +set(THREADS_PREFER_PTHREAD_FLAG ON) file(GLOB_RECURSE ${PROJECT}_SOURCES "*.cpp" "*.h" "*.rc") @@ -17,6 +17,9 @@ endfunction() header_directories(${PROJECT}_INCLUDES) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/extras/GitSHA1.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/extras/GitSHA1.cpp" @ONLY) +list(APPEND ${PROJECT}_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/extras/GitSHA1.cpp") + add_executable(${EXECUTABLE} WIN32 ${${PROJECT}_SOURCES} ) @@ -46,6 +49,8 @@ if(LIBRW_PLATFORM_D3D9) ) endif() +target_compile_definitions(${EXECUTABLE} PRIVATE CMAKE_BUILD) + if(${PROJECT}_AUDIO STREQUAL "OAL") find_package(OpenAL REQUIRED) target_include_directories(${EXECUTABLE} PRIVATE ${OPENAL_INCLUDE_DIR}) diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp index 557bd842..c66997ce 100644 --- a/src/animation/AnimManager.cpp +++ b/src/animation/AnimManager.cpp @@ -19,68 +19,68 @@ CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups; CLinkList<CAnimBlendHierarchy*> CAnimManager::ms_animCache; AnimAssocDesc aStdAnimDescs[] = { - { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, - { ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, - { ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, - { ANIM_IDLE_STANCE, ASSOC_REPEAT }, - { ANIM_WALK_START, ASSOC_HAS_TRANSLATION }, - { ANIM_RUN_STOP, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION }, - { ANIM_RUN_STOP_R, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION }, - { ANIM_IDLE_CAM, ASSOC_REPEAT | ASSOC_PARTIAL }, - { ANIM_IDLE_HBHB, ASSOC_REPEAT | ASSOC_PARTIAL }, - { ANIM_IDLE_TIRED, ASSOC_REPEAT }, - { ANIM_IDLE_ARMED, ASSOC_REPEAT | ASSOC_PARTIAL }, - { ANIM_IDLE_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL }, - { ANIM_IDLE_TAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_KO_SHOT_FRONT1, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_FRONT2, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_FRONT3, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_FRONT4, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_STOM, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_KO_SHOT_ARML, ASSOC_PARTIAL | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_ARMR, ASSOC_PARTIAL | ASSOC_FRONTAL }, - { ANIM_KO_SHOT_LEGL, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_KO_SHOT_LEGR, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_KD_LEFT, ASSOC_PARTIAL | ASSOC_FRONTAL }, - { ANIM_KD_RIGHT, ASSOC_PARTIAL | ASSOC_FRONTAL }, - { ANIM_KO_SKID_FRONT, ASSOC_PARTIAL }, - { ANIM_KO_SPIN_R, ASSOC_PARTIAL }, - { ANIM_KO_SKID_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL }, - { ANIM_KO_SPIN_L, ASSOC_PARTIAL }, - { ANIM_SHOT_FRONT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_SHOT_LEFT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_SHOT_BACK_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_SHOT_RIGHT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FLOOR_HIT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, + { ANIM_STD_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, + { ANIM_STD_RUNFAST, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, + { ANIM_STD_IDLE, ASSOC_REPEAT }, + { ANIM_STD_STARTWALK, ASSOC_HAS_TRANSLATION }, + { ANIM_STD_RUNSTOP1, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_RUNSTOP2, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_IDLE_CAM, ASSOC_REPEAT | ASSOC_PARTIAL }, + { ANIM_STD_IDLE_HBHB, ASSOC_REPEAT | ASSOC_PARTIAL }, + { ANIM_STD_IDLE_TIRED, ASSOC_REPEAT }, + { ANIM_STD_IDLE_BIGGUN, ASSOC_REPEAT | ASSOC_PARTIAL }, + { ANIM_STD_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL }, + { ANIM_STD_HAILTAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_KO_FRONT, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, + { ANIM_STD_KO_LEFT, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, + { ANIM_STD_KO_BACK, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, + { ANIM_STD_KO_RIGHT, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, + { ANIM_STD_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, + { ANIM_STD_KO_SHOT_STOMACH, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_KO_SHOT_ARM_L, ASSOC_PARTIAL | ASSOC_FRONTAL }, + { ANIM_STD_KO_SHOT_ARM_R, ASSOC_PARTIAL | ASSOC_FRONTAL }, + { ANIM_STD_KO_SHOT_LEG_L, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_KO_SHOT_LEG_R, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_SPINFORWARD_LEFT, ASSOC_PARTIAL | ASSOC_FRONTAL }, + { ANIM_STD_SPINFORWARD_RIGHT, ASSOC_PARTIAL | ASSOC_FRONTAL }, + { ANIM_STD_HIGHIMPACT_FRONT, ASSOC_PARTIAL }, + { ANIM_STD_HIGHIMPACT_LEFT, ASSOC_PARTIAL }, + { ANIM_STD_HIGHIMPACT_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL }, + { ANIM_STD_HIGHIMPACT_RIGHT, ASSOC_PARTIAL }, + { ANIM_STD_HITBYGUN_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_HITBYGUN_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_HITBYGUN_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_HITBYGUN_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_HIT_FLOOR, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, #if GTA_VERSION <= GTA3_PS2_160 - { ANIM_HIT_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_HIT_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, #endif - { ANIM_HIT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HIT_CHEST, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HIT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HIT_WALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FLOOR_HIT_F, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL }, - { ANIM_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_PUNCH_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_KICK_FLOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_BAT_H, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_BAT_V, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_HGUN_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_WEAPON_AK_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_PUMP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_SNIPER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_THROW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_START_THROW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_HGUN_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_AK_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_HIT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_CHEST, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_WALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HIT_FLOOR_FRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL }, + { ANIM_STD_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_KICKGROUND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_WEAPON_BAT_H, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_WEAPON_BAT_V, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_WEAPON_HGUN_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_WEAPON_AK_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_WEAPON_PUMP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_WEAPON_SNIPER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_WEAPON_THROW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_THROW_UNDER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_START_THROW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_DETONATE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_HGUN_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_AK_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, #ifdef PC_PLAYER_CONTROLS // maybe wrong define, but unused anyway { ANIM_FPS_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, @@ -91,121 +91,121 @@ AnimAssocDesc aStdAnimDescs[] = { { ANIM_FPS_M16, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_FPS_ROCKET, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, #endif - { ANIM_FIGHT_IDLE, ASSOC_REPEAT }, - { ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FIGHT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_KNEE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_LHOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_FIGHT_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FIGHT_LONGKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_CAR_JACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_CAR_LJACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_CAR_JACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_CAR_LJACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_CAR_QJACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_QJACKED, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_CAR_ALIGN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_ALIGNHI_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_OPEN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_DOORLOCKED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_PULLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_PULLOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETIN_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CLOSEDOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CLOSEDOOR_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_ROLLDOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_ROLLDOOR_LOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CLOSE_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_ALIGN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_ALIGNHI_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_OPEN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_DOORLOCKED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_PULLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_PULLOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETIN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETIN_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CLOSEDOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CLOSEDOOR_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_SHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_LSHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_SIT, ASSOC_DELETEFADEDOUT }, - { ANIM_CAR_LSIT, ASSOC_DELETEFADEDOUT }, - { ANIM_CAR_SITP, ASSOC_DELETEFADEDOUT }, - { ANIM_CAR_SITPLO, ASSOC_DELETEFADEDOUT }, - { ANIM_DRIVE_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DRIVE_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DRIVE_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT }, - { ANIM_CAR_GETOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_GETOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CLOSE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_HOOKERTALK, ASSOC_REPEAT | ASSOC_PARTIAL }, - { ANIM_COACH_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_COACH_OPEN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_COACH_IN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_COACH_IN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_COACH_OUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_TRAIN_GETIN, ASSOC_PARTIAL }, - { ANIM_TRAIN_GETOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_GETIN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_CLOSE_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_GETOUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_OPEN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_GETIN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_CLOSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_VAN_GETOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_GETUP1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_GETUP2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_GETUP3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_GETUP_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_JUMP_LAUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FALL_FALL, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FALL_COLLAPSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_EV_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, - { ANIM_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, - { ANIM_ROAD_CROSS, ASSOC_REPEAT | ASSOC_PARTIAL }, - { ANIM_TURN_180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_ARREST_GUN, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_DROWN, ASSOC_PARTIAL }, - { ANIM_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_RBLOCK_CSHOOT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, - { ANIM_WEAPON_THROWU2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, - { ANIM_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_PHONE_IN, ASSOC_PARTIAL }, - { ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_IDLE, ASSOC_REPEAT }, + { ANIM_STD_FIGHT_2IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_SHUFFLE_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_FIGHT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_KNEE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_LHOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_FIGHT_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_FIGHT_LONGKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_PARTIAL_PUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_JACKEDCAR_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_JACKEDCAR_LO_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_JACKEDCAR_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_JACKEDCAR_LO_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_QUICKJACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_QUICKJACKED, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_ALIGN_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_ALIGNHI_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_OPEN_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CARDOOR_LOCKED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_PULL_OUT_PED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_PULL_OUT_PED_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_GET_IN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_GET_IN_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_DOOR_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_GETOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_GETOUT_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_ALIGN_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_ALIGNHI_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_OPEN_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CARDOOR_LOCKED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_PULL_OUT_PED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_PULL_OUT_PED_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_GET_IN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_GET_IN_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_DOOR_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_SHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_SHUFFLE_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_SIT, ASSOC_DELETEFADEDOUT }, + { ANIM_STD_CAR_SIT_LO, ASSOC_DELETEFADEDOUT }, + { ANIM_STD_CAR_SIT_P, ASSOC_DELETEFADEDOUT }, + { ANIM_STD_CAR_SIT_P_LO, ASSOC_DELETEFADEDOUT }, + { ANIM_STD_CAR_DRIVE_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_DRIVE_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_DRIVE_LEFT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_DRIVE_RIGHT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_DRIVEBY_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_DRIVEBY_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_CAR_LOOKBEHIND, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_BOAT_DRIVE, ASSOC_DELETEFADEDOUT }, + { ANIM_STD_GETOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_GETOUT_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_CLOSE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CAR_HOOKERTALK, ASSOC_REPEAT | ASSOC_PARTIAL }, + { ANIM_STD_COACH_OPEN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_COACH_OPEN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_COACH_GET_IN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_COACH_GET_IN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_COACH_GET_OUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_TRAIN_GETIN, ASSOC_PARTIAL }, + { ANIM_STD_TRAIN_GETOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CRAWLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_OPEN_DOOR_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_GET_IN_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_GET_OUT_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_OPEN_DOOR_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_GET_IN_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_VAN_GET_OUT_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_GET_UP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_GET_UP_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_GET_UP_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_GET_UP_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_JUMP_LAUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_FALL, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_FALL_COLLAPSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_EVADE_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_EVADE_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, + { ANIM_STD_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, + { ANIM_STD_ROADCROSS, ASSOC_REPEAT | ASSOC_PARTIAL }, + { ANIM_STD_TURN180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_ARREST, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_DROWN, ASSOC_PARTIAL }, + { ANIM_MEDIC_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_RBLOCK_SHOOT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, + { ANIM_STD_THROW_UNDER2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, + { ANIM_STD_PARTIAL_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, + { ANIM_STD_PHONE_IN, ASSOC_PARTIAL }, + { ANIM_STD_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, + { ANIM_STD_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, }; #ifdef PC_PLAYER_CONTROLS AnimAssocDesc aStdAnimDescsSide[] = { - { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION }, - { ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION }, - { ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION }, - { ANIM_IDLE_STANCE, ASSOC_REPEAT }, - { ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION }, + { ANIM_STD_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION }, + { ANIM_STD_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION }, + { ANIM_STD_RUNFAST, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION }, + { ANIM_STD_IDLE, ASSOC_REPEAT }, + { ANIM_STD_STARTWALK, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION }, }; #endif char const *aStdAnimations[] = { diff --git a/src/animation/AnimationId.h b/src/animation/AnimationId.h index 4b3dd92d..baf6eb33 100644 --- a/src/animation/AnimationId.h +++ b/src/animation/AnimationId.h @@ -2,68 +2,82 @@ enum AnimationId { - ANIM_WALK, - ANIM_RUN, - ANIM_SPRINT, - ANIM_IDLE_STANCE, - ANIM_WALK_START, - ANIM_RUN_STOP, - ANIM_RUN_STOP_R, - ANIM_IDLE_CAM, - ANIM_IDLE_HBHB, - ANIM_IDLE_TIRED, - ANIM_IDLE_ARMED, - ANIM_IDLE_CHAT, - ANIM_IDLE_TAXI, - ANIM_KO_SHOT_FRONT1, - ANIM_KO_SHOT_FRONT2, - ANIM_KO_SHOT_FRONT3, - ANIM_KO_SHOT_FRONT4, - ANIM_KO_SHOT_FACE, - ANIM_KO_SHOT_STOM, - ANIM_KO_SHOT_ARML, - ANIM_KO_SHOT_ARMR, - ANIM_KO_SHOT_LEGL, - ANIM_KO_SHOT_LEGR, - ANIM_KD_LEFT, - ANIM_KD_RIGHT, - ANIM_KO_SKID_FRONT, - ANIM_KO_SPIN_R, // named left in VC - ANIM_KO_SKID_BACK, - ANIM_KO_SPIN_L, // named right in VC - ANIM_SHOT_FRONT_PARTIAL, - ANIM_SHOT_LEFT_PARTIAL, - ANIM_SHOT_BACK_PARTIAL, - ANIM_SHOT_RIGHT_PARTIAL, - ANIM_HIT_FRONT, - ANIM_HIT_LEFT, - ANIM_HIT_BACK, - ANIM_HIT_RIGHT, - ANIM_FLOOR_HIT, + ANIM_STD_WALK, + ANIM_STD_RUN, + ANIM_STD_RUNFAST, + ANIM_STD_IDLE, + ANIM_STD_STARTWALK, + ANIM_STD_RUNSTOP1, + ANIM_STD_RUNSTOP2, + ANIM_STD_IDLE_CAM, + ANIM_STD_IDLE_HBHB, + ANIM_STD_IDLE_TIRED, + ANIM_STD_IDLE_BIGGUN, + ANIM_STD_CHAT, + ANIM_STD_HAILTAXI, + ANIM_STD_KO_FRONT, + ANIM_STD_KO_LEFT, + ANIM_STD_KO_BACK, + ANIM_STD_KO_RIGHT, + ANIM_STD_KO_SHOT_FACE, + ANIM_STD_KO_SHOT_STOMACH, + ANIM_STD_KO_SHOT_ARM_L, + ANIM_STD_KO_SHOT_ARM_R, + ANIM_STD_KO_SHOT_LEG_L, + ANIM_STD_KO_SHOT_LEG_R, + ANIM_STD_SPINFORWARD_LEFT, + ANIM_STD_SPINFORWARD_RIGHT, + ANIM_STD_HIGHIMPACT_FRONT, + ANIM_STD_HIGHIMPACT_LEFT, + ANIM_STD_HIGHIMPACT_BACK, + ANIM_STD_HIGHIMPACT_RIGHT, + ANIM_STD_HITBYGUN_FRONT, + ANIM_STD_HITBYGUN_LEFT, + ANIM_STD_HITBYGUN_BACK, + ANIM_STD_HITBYGUN_RIGHT, + ANIM_STD_HIT_FRONT, + ANIM_STD_HIT_LEFT, + ANIM_STD_HIT_BACK, + ANIM_STD_HIT_RIGHT, + ANIM_STD_HIT_FLOOR, + + /* names made up */ #if GTA_VERSION <= GTA3_PS2_160 - ANIM_HIT_BODY, + ANIM_STD_HIT_BODY, #endif - ANIM_HIT_BODYBLOW, - ANIM_HIT_CHEST, - ANIM_HIT_HEAD, - ANIM_HIT_WALK, - ANIM_HIT_WALL, - ANIM_FLOOR_HIT_F, - ANIM_HIT_BEHIND, - ANIM_PUNCH_R, - ANIM_KICK_FLOOR, - ANIM_WEAPON_BAT_H, - ANIM_WEAPON_BAT_V, - ANIM_WEAPON_HGUN_BODY, - ANIM_WEAPON_AK_BODY, - ANIM_WEAPON_PUMP, - ANIM_WEAPON_SNIPER, - ANIM_WEAPON_THROW, - ANIM_WEAPON_THROWU, - ANIM_WEAPON_START_THROW, - ANIM_BOMBER, - ANIM_HGUN_RELOAD, - ANIM_AK_RELOAD, + ANIM_STD_HIT_BODYBLOW, + ANIM_STD_HIT_CHEST, + ANIM_STD_HIT_HEAD, + ANIM_STD_HIT_WALK, + /**/ + + ANIM_STD_HIT_WALL, + ANIM_STD_HIT_FLOOR_FRONT, + ANIM_STD_HIT_BEHIND, + ANIM_STD_PUNCH, + ANIM_STD_KICKGROUND, + + /* names made up */ + ANIM_STD_WEAPON_BAT_H, + ANIM_STD_WEAPON_BAT_V, + ANIM_STD_WEAPON_HGUN_BODY, + ANIM_STD_WEAPON_AK_BODY, + ANIM_STD_WEAPON_PUMP, + ANIM_STD_WEAPON_SNIPER, + ANIM_STD_WEAPON_THROW, + /**/ + + ANIM_STD_THROW_UNDER, + + /* names made up */ + ANIM_STD_START_THROW, + /**/ + + ANIM_STD_DETONATE, + + /* names made up */ + ANIM_STD_HGUN_RELOAD, + ANIM_STD_AK_RELOAD, #ifdef PC_PLAYER_CONTROLS // maybe wrong define, but unused anyway ANIM_FPS_PUNCH, @@ -74,113 +88,123 @@ enum AnimationId ANIM_FPS_M16, ANIM_FPS_ROCKET, #endif - ANIM_FIGHT_IDLE, - ANIM_FIGHT2_IDLE, - ANIM_FIGHT_SH_F, - ANIM_FIGHT_BODYBLOW, - ANIM_FIGHT_HEAD, - ANIM_FIGHT_KICK, - ANIM_FIGHT_KNEE, - ANIM_FIGHT_LHOOK, - ANIM_FIGHT_PUNCH, - ANIM_FIGHT_ROUNDHOUSE, - ANIM_FIGHT_LONGKICK, - ANIM_FIGHT_PPUNCH, - ANIM_CAR_JACKED_RHS, - ANIM_CAR_LJACKED_RHS, - ANIM_CAR_JACKED_LHS, - ANIM_CAR_LJACKED_LHS, - ANIM_CAR_QJACK, - ANIM_CAR_QJACKED, - ANIM_CAR_ALIGN_LHS, - ANIM_CAR_ALIGNHI_LHS, - ANIM_CAR_OPEN_LHS, - ANIM_CAR_DOORLOCKED_LHS, - ANIM_CAR_PULLOUT_LHS, - ANIM_CAR_PULLOUT_LOW_LHS, - ANIM_CAR_GETIN_LHS, - ANIM_CAR_GETIN_LOW_LHS, - ANIM_CAR_CLOSEDOOR_LHS, - ANIM_CAR_CLOSEDOOR_LOW_LHS, - ANIM_CAR_ROLLDOOR, - ANIM_CAR_ROLLDOOR_LOW, - ANIM_CAR_GETOUT_LHS, - ANIM_CAR_GETOUT_LOW_LHS, - ANIM_CAR_CLOSE_LHS, - ANIM_CAR_ALIGN_RHS, - ANIM_CAR_ALIGNHI_RHS, - ANIM_CAR_OPEN_RHS, - ANIM_CAR_DOORLOCKED_RHS, - ANIM_CAR_PULLOUT_RHS, - ANIM_CAR_PULLOUT_LOW_RHS, - ANIM_CAR_GETIN_RHS, - ANIM_CAR_GETIN_LOW_RHS, - ANIM_CAR_CLOSEDOOR_RHS, - ANIM_CAR_CLOSEDOOR_LOW_RHS, - ANIM_CAR_SHUFFLE_RHS, - ANIM_CAR_LSHUFFLE_RHS, - ANIM_CAR_SIT, - ANIM_CAR_LSIT, - ANIM_CAR_SITP, - ANIM_CAR_SITPLO, - ANIM_DRIVE_L, - ANIM_DRIVE_R, - ANIM_DRIVE_LOW_L, - ANIM_DRIVE_LOW_R, - ANIM_DRIVEBY_L, - ANIM_DRIVEBY_R, - ANIM_CAR_LB, - ANIM_DRIVE_BOAT, - ANIM_CAR_GETOUT_RHS, - ANIM_CAR_GETOUT_LOW_RHS, - ANIM_CAR_CLOSE_RHS, - ANIM_CAR_HOOKERTALK, - ANIM_COACH_OPEN_L, - ANIM_COACH_OPEN_R, - ANIM_COACH_IN_L, - ANIM_COACH_IN_R, - ANIM_COACH_OUT_L, - ANIM_TRAIN_GETIN, - ANIM_TRAIN_GETOUT, - ANIM_CAR_CRAWLOUT_RHS, - ANIM_CAR_CRAWLOUT_RHS2, - ANIM_VAN_OPEN_L, - ANIM_VAN_GETIN_L, - ANIM_VAN_CLOSE_L, - ANIM_VAN_GETOUT_L, - ANIM_VAN_OPEN, - ANIM_VAN_GETIN, - ANIM_VAN_CLOSE, - ANIM_VAN_GETOUT, - ANIM_GETUP1, - ANIM_GETUP2, - ANIM_GETUP3, - ANIM_GETUP_FRONT, - ANIM_JUMP_LAUNCH, - ANIM_JUMP_GLIDE, - ANIM_JUMP_LAND, - ANIM_FALL_FALL, - ANIM_FALL_GLIDE, - ANIM_FALL_LAND, - ANIM_FALL_COLLAPSE, - ANIM_EV_STEP, - ANIM_EV_DIVE, - ANIM_XPRESS_SCRATCH, - ANIM_ROAD_CROSS, - ANIM_TURN_180, - ANIM_ARREST_GUN, - ANIM_DROWN, - ANIM_CPR, - ANIM_DUCK_DOWN, - ANIM_DUCK_LOW, - ANIM_RBLOCK_CSHOOT, - ANIM_WEAPON_THROWU2, - ANIM_HANDSUP, - ANIM_HANDSCOWER, - ANIM_FUCKU, - ANIM_PHONE_IN, - ANIM_PHONE_OUT, - ANIM_PHONE_TALK, + /**/ + + ANIM_STD_FIGHT_IDLE, + ANIM_STD_FIGHT_2IDLE, + ANIM_STD_FIGHT_SHUFFLE_F, + + /* names made up */ + ANIM_STD_FIGHT_BODYBLOW, + ANIM_STD_FIGHT_HEAD, + ANIM_STD_FIGHT_KICK, + ANIM_STD_FIGHT_KNEE, + ANIM_STD_FIGHT_LHOOK, + ANIM_STD_FIGHT_PUNCH, + ANIM_STD_FIGHT_ROUNDHOUSE, + ANIM_STD_FIGHT_LONGKICK, + /**/ + + ANIM_STD_PARTIAL_PUNCH, + ANIM_STD_JACKEDCAR_RHS, + ANIM_STD_JACKEDCAR_LO_RHS, + ANIM_STD_JACKEDCAR_LHS, + ANIM_STD_JACKEDCAR_LO_LHS, + ANIM_STD_QUICKJACK, + ANIM_STD_QUICKJACKED, + ANIM_STD_CAR_ALIGN_DOOR_LHS, + ANIM_STD_CAR_ALIGNHI_DOOR_LHS, + ANIM_STD_CAR_OPEN_DOOR_LHS, + ANIM_STD_CARDOOR_LOCKED_LHS, + ANIM_STD_CAR_PULL_OUT_PED_LHS, + ANIM_STD_CAR_PULL_OUT_PED_LO_LHS, + ANIM_STD_CAR_GET_IN_LHS, + ANIM_STD_CAR_GET_IN_LO_LHS, + ANIM_STD_CAR_CLOSE_DOOR_LHS, + ANIM_STD_CAR_CLOSE_DOOR_LO_LHS, + ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, + ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS, + ANIM_STD_GETOUT_LHS, + ANIM_STD_GETOUT_LO_LHS, + ANIM_STD_CAR_CLOSE_LHS, + ANIM_STD_CAR_ALIGN_DOOR_RHS, + ANIM_STD_CAR_ALIGNHI_DOOR_RHS, + ANIM_STD_CAR_OPEN_DOOR_RHS, + ANIM_STD_CARDOOR_LOCKED_RHS, + ANIM_STD_CAR_PULL_OUT_PED_RHS, + ANIM_STD_CAR_PULL_OUT_PED_LO_RHS, + ANIM_STD_CAR_GET_IN_RHS, + ANIM_STD_CAR_GET_IN_LO_RHS, + ANIM_STD_CAR_CLOSE_DOOR_RHS, + ANIM_STD_CAR_CLOSE_DOOR_LO_RHS, + ANIM_STD_CAR_SHUFFLE_RHS, + ANIM_STD_CAR_SHUFFLE_LO_RHS, + ANIM_STD_CAR_SIT, + ANIM_STD_CAR_SIT_LO, + ANIM_STD_CAR_SIT_P, + ANIM_STD_CAR_SIT_P_LO, + ANIM_STD_CAR_DRIVE_LEFT, + ANIM_STD_CAR_DRIVE_RIGHT, + ANIM_STD_CAR_DRIVE_LEFT_LO, + ANIM_STD_CAR_DRIVE_RIGHT_LO, + ANIM_STD_CAR_DRIVEBY_LEFT, + ANIM_STD_CAR_DRIVEBY_RIGHT, + ANIM_STD_CAR_LOOKBEHIND, + ANIM_STD_BOAT_DRIVE, + ANIM_STD_GETOUT_RHS, + ANIM_STD_GETOUT_LO_RHS, + ANIM_STD_CAR_CLOSE_RHS, + ANIM_STD_CAR_HOOKERTALK, + ANIM_STD_COACH_OPEN_LHS, + ANIM_STD_COACH_OPEN_RHS, + ANIM_STD_COACH_GET_IN_LHS, + ANIM_STD_COACH_GET_IN_RHS, + ANIM_STD_COACH_GET_OUT_LHS, + ANIM_STD_TRAIN_GETIN, + ANIM_STD_TRAIN_GETOUT, + ANIM_STD_CRAWLOUT_LHS, + ANIM_STD_CRAWLOUT_RHS, + ANIM_STD_VAN_OPEN_DOOR_REAR_LHS, + ANIM_STD_VAN_GET_IN_REAR_LHS, + ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS, + ANIM_STD_VAN_GET_OUT_REAR_LHS, + ANIM_STD_VAN_OPEN_DOOR_REAR_RHS, + ANIM_STD_VAN_GET_IN_REAR_RHS, + ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS, + ANIM_STD_VAN_GET_OUT_REAR_RHS, + ANIM_STD_GET_UP, + ANIM_STD_GET_UP_LEFT, + ANIM_STD_GET_UP_RIGHT, + ANIM_STD_GET_UP_FRONT, + ANIM_STD_JUMP_LAUNCH, + ANIM_STD_JUMP_GLIDE, + ANIM_STD_JUMP_LAND, + ANIM_STD_FALL, + ANIM_STD_FALL_GLIDE, + ANIM_STD_FALL_LAND, + ANIM_STD_FALL_COLLAPSE, + ANIM_STD_EVADE_STEP, + ANIM_STD_EVADE_DIVE, + ANIM_STD_XPRESS_SCRATCH, + ANIM_STD_ROADCROSS, + ANIM_STD_TURN180, + ANIM_STD_ARREST, + ANIM_STD_DROWN, + ANIM_MEDIC_CPR, + ANIM_STD_DUCK_DOWN, + ANIM_STD_DUCK_LOW, + ANIM_STD_RBLOCK_SHOOT, + + /* names made up */ + ANIM_STD_THROW_UNDER2, + /**/ + + ANIM_STD_HANDSUP, + ANIM_STD_HANDSCOWER, + ANIM_STD_PARTIAL_FUCKU, + ANIM_STD_PHONE_IN, + ANIM_STD_PHONE_OUT, + ANIM_STD_PHONE_TALK, - NUM_ANIMS + ANIM_STD_NUM };
\ No newline at end of file diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index eab14ce6..ec364c27 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -7927,7 +7927,7 @@ cAudioManager::ProcessFrontEnd() frontendBank = true; stereo = true; break; - case SOUND_FRONTEND_NO_RADIO: + case SOUND_FRONTEND_RADIO_TURN_OFF: case SOUND_FRONTEND_RADIO_CHANGE: m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK; break; diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index 54c1b0bc..3e1a7384 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -15,6 +15,9 @@ #include "World.h" #include "sampman.h" +#if !defined FIX_BUGS && (defined RADIO_SCROLL_TO_PREV_STATION || defined RADIO_OFF_TEXT) +static_assert(false, "RADIO_SCROLL_TO_PREV_STATION and RADIO_OFF_TEXT won't work correctly without FIX_BUGS"); +#endif cMusicManager MusicManager; int32 gNumRetunePresses; @@ -26,8 +29,8 @@ cMusicManager::cMusicManager() m_bIsInitialised = false; m_bDisabled = false; m_nMusicMode = MUSICMODE_DISABLED; - m_nCurrentStreamedSound = NO_TRACK; - m_nPreviousStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; + m_nPlayingTrack = NO_TRACK; m_bFrontendTrackFinished = false; m_bPlayInFrontend = false; m_bSetNextStation = false; @@ -35,7 +38,7 @@ cMusicManager::cMusicManager() m_bPreviousPlayerInCar = false; m_bPlayerInCar = false; m_bAnnouncementInProgress = false; - m_bDontServiceAmbienceTrack = false; + m_bVerifyAmbienceTrackStartedToPlay = false; bHasStarted = false; } @@ -83,16 +86,15 @@ cMusicManager::DisplayRadioStationName() if(m_bPlayerInCar && !m_bPreviousPlayerInCar) pCurrentStation = nil; +#ifdef FIX_BUGS + const int curRadio = GetCarTuning(); +#else + const int curRadio = m_nNextTrack; +#endif + #ifdef RADIO_SCROLL_TO_PREV_STATION if(gNumRetunePresses < 0) { - gStreamedSound = m_nCurrentStreamedSound; - - if(gStreamedSound == STREAMED_SOUND_CITY_AMBIENT || - gStreamedSound == STREAMED_SOUND_WATER_AMBIENT) { - gStreamedSound = POLICE_RADIO; // which means OFF - - } else if(gStreamedSound > STREAMED_SOUND_RADIO_MP3_PLAYER) - return; + gStreamedSound = curRadio; gRetuneCounter = gNumRetunePresses; pRetune = gStreamedSound; @@ -100,7 +102,7 @@ cMusicManager::DisplayRadioStationName() while(gRetuneCounter < 0) { if(pRetune == HEAD_RADIO) { pRetune = RADIO_OFF; - } else if(pRetune == RADIO_OFF || pRetune == POLICE_RADIO) { + } else if(pRetune == RADIO_OFF || pRetune == NUM_RADIOS) { pRetune = SampleManager.IsMP3RadioChannelAvailable() ? USERTRACK : USERTRACK - 1; } else pRetune--; @@ -110,31 +112,38 @@ cMusicManager::DisplayRadioStationName() } else #endif if(SampleManager.IsMP3RadioChannelAvailable()) { - gStreamedSound = m_nCurrentStreamedSound; + gStreamedSound = curRadio; if(gStreamedSound == STREAMED_SOUND_CITY_AMBIENT || - gStreamedSound == STREAMED_SOUND_WATER_AMBIENT) { - gStreamedSound = POLICE_RADIO; // which means OFF + gStreamedSound == STREAMED_SOUND_WATER_AMBIENT) { // which means OFF + gStreamedSound = NUM_RADIOS; } else if(gStreamedSound > STREAMED_SOUND_RADIO_MP3_PLAYER) return; pRetune = gNumRetunePresses + gStreamedSound; - if(pRetune == POLICE_RADIO) { +#ifdef FIX_BUGS + while(pRetune > NUM_RADIOS) + pRetune -= (NUM_RADIOS + 1); +#endif + if(pRetune == NUM_RADIOS) { pRetune = RADIO_OFF; - } else if(pRetune > POLICE_RADIO) { - pRetune = pRetune - RADIO_OFF; } +#ifndef FIX_BUGS + else if(pRetune > NUM_RADIOS) { + pRetune = pRetune - (NUM_RADIOS + 1); + } +#endif } else { - gStreamedSound = m_nCurrentStreamedSound; + gStreamedSound = curRadio; pRetune = gNumRetunePresses + gStreamedSound; if(pRetune >= USERTRACK) { gRetuneCounter = gNumRetunePresses; - pRetune = m_nCurrentStreamedSound; + pRetune = curRadio; if(gStreamedSound == STREAMED_SOUND_WATER_AMBIENT) - pRetune = RADIO_OFF; + pRetune = STREAMED_SOUND_CITY_AMBIENT; // which is RADIO_OFF while(gRetuneCounter) { if(pRetune == RADIO_OFF) { @@ -149,7 +158,7 @@ cMusicManager::DisplayRadioStationName() } } - wchar *string = nil; + wchar *string; switch(pRetune) { case HEAD_RADIO: string = TheText.Get("FEA_FM0"); break; @@ -161,22 +170,27 @@ cMusicManager::DisplayRadioStationName() case MSX_FM: string = TheText.Get("FEA_FM6"); break; case FLASHBACK: string = TheText.Get("FEA_FM7"); break; case CHATTERBOX: string = TheText.Get("FEA_FM8"); break; - case USERTRACK: string = TheText.Get("FEA_FM9"); break; + case USERTRACK: + if (!SampleManager.IsMP3RadioChannelAvailable()) + return; + string = TheText.Get("FEA_FM9"); break; #ifdef RADIO_OFF_TEXT - case RADIO_OFF: case POLICE_RADIO: string = TheText.Get("FEM_OFF"); break; + case RADIO_OFF: { + extern wchar WideErrorString[]; + + string = TheText.Get("FEA_FMN"); + if(string == WideErrorString) { + pCurrentStation = nil; + return; + } + break; + } #endif default: return; }; -#ifdef RADIO_OFF_TEXT - if(pRetune == USERTRACK && !SampleManager.IsMP3RadioChannelAvailable()) { string = TheText.Get("FEM_OFF"); } -#else - if(pRetune > CHATTERBOX && !SampleManager.IsMP3RadioChannelAvailable()) { return; } -#endif - - if(string && pCurrentStation != string || - m_nCurrentStreamedSound == STREAMED_SOUND_RADIO_MP3_PLAYER && - m_nPreviousStreamedSound != STREAMED_SOUND_RADIO_MP3_PLAYER) { + if(pCurrentStation != string || + m_nNextTrack == STREAMED_SOUND_RADIO_MP3_PLAYER && m_nPlayingTrack != STREAMED_SOUND_RADIO_MP3_PLAYER) { pCurrentStation = string; cDisplay = 60; } else { @@ -257,7 +271,7 @@ cMusicManager::Initialise() m_bDoTrackService = false; m_bIgnoreTimeDelay = false; m_bRadioSetByScript = false; - m_nRadioStation = HEAD_RADIO; + m_nRadioStationScript = HEAD_RADIO; m_nRadioPosition = -1; m_nRadioInCar = NO_TRACK; gNumRetunePresses = 0; @@ -274,8 +288,8 @@ cMusicManager::Terminate() if (SampleManager.IsStreamPlaying(0)) { SampleManager.StopStreamedFile(0); - m_nCurrentStreamedSound = NO_TRACK; - m_nPreviousStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; + m_nPlayingTrack = NO_TRACK; } m_bIsInitialised = false; } @@ -303,14 +317,14 @@ cMusicManager::ChangeMusicMode(uint8 mode) case MUSICMODE_CUTSCENE: case MUSICMODE_DISABLED: if (SampleManager.IsStreamPlaying(0)) { - if (m_nCurrentStreamedSound < TOTAL_STREAMED_SOUNDS) { - m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + if (m_nNextTrack < TOTAL_STREAMED_SOUNDS) { + m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); } SampleManager.StopStreamedFile(0); } - m_nCurrentStreamedSound = NO_TRACK; - m_nPreviousStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; + m_nPlayingTrack = NO_TRACK; m_bFrontendTrackFinished = false; m_bPlayInFrontend = false; m_bSetNextStation = false; @@ -320,7 +334,7 @@ cMusicManager::ChangeMusicMode(uint8 mode) m_nTimer = m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_bDoTrackService = false; m_bIgnoreTimeDelay = true; - m_bDontServiceAmbienceTrack = false; + m_bVerifyAmbienceTrackStartedToPlay = false; m_nMusicMode = mode2; break; default: return; @@ -370,7 +384,7 @@ cMusicManager::SetRadioChannelByScript(uint8 station, int32 pos) { if (m_bIsInitialised && station < RADIO_OFF) { m_bRadioSetByScript = true; - m_nRadioStation = station; + m_nRadioStationScript = station; m_nRadioPosition = pos == -1 ? -1 : pos % m_aTracks[station].m_nLength; } } @@ -380,7 +394,7 @@ void cMusicManager::ResetMusicAfterReload() { m_bRadioSetByScript = false; - m_nRadioStation = 0; + m_nRadioStationScript = 0; m_nRadioPosition = -1; m_nAnnouncement = NO_TRACK; m_bAnnouncementInProgress = false; @@ -419,7 +433,7 @@ cMusicManager::Service() m_nLastTrackServiceTime = m_nTimer; } else m_bDoTrackService = false; - if (m_nCurrentStreamedSound == NO_TRACK && SampleManager.IsStreamPlaying(0)) + if (m_nNextTrack == NO_TRACK && SampleManager.IsStreamPlaying(0)) SampleManager.StopStreamedFile(0); else switch (m_nMusicMode) { case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break; @@ -430,10 +444,10 @@ cMusicManager::Service() void cMusicManager::ServiceFrontEndMode() { - if (m_nCurrentStreamedSound < TOTAL_STREAMED_SOUNDS) { + if (m_nNextTrack < TOTAL_STREAMED_SOUNDS) { if (m_bFrontendTrackFinished) { if (!SampleManager.IsStreamPlaying(0)) { - switch (m_nCurrentStreamedSound) + switch (m_nNextTrack) { case STREAMED_SOUND_MISSION_COMPLETED: if (!AudioManager.m_nUserPause) @@ -445,15 +459,15 @@ cMusicManager::ServiceFrontEndMode() default: break; } - m_nCurrentStreamedSound = NO_TRACK; - m_nPreviousStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; + m_nPlayingTrack = NO_TRACK; } } else if (bHasStarted) { if (!SampleManager.IsStreamPlaying(0)) - SampleManager.StartStreamedFile(m_nCurrentStreamedSound, 0, 0); + SampleManager.StartStreamedFile(m_nNextTrack, 0, 0); } else { SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); - if (!SampleManager.StartStreamedFile(m_nCurrentStreamedSound, m_nCurrentStreamedSound < STREAMED_SOUND_RADIO_POLICE ? GetTrackStartPos(m_nCurrentStreamedSound) : 0, 0)) + if (!SampleManager.StartStreamedFile(m_nNextTrack, m_nNextTrack < NUM_RADIOS ? GetTrackStartPos(m_nNextTrack) : 0, 0)) return; SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0); if (m_bPlayInFrontend) bHasStarted = true; @@ -473,7 +487,7 @@ cMusicManager::ServiceGameMode() m_bPreviousPlayerInCar = m_bPlayerInCar; m_bPlayerInCar = PlayerInCar(); - m_nPreviousStreamedSound = m_nCurrentStreamedSound; + m_nPlayingTrack = m_nNextTrack; if (m_bPlayerInCar) { if (FindPlayerPed() != nil && !FindPlayerPed()->DyingOrDead() @@ -485,10 +499,13 @@ cMusicManager::ServiceGameMode() gRetuneCounter = 30; gNumRetunePresses++; AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 1.0f); + // This needs loop, and this is not the right place. Now done elsewhere. +#ifndef FIX_BUGS if (SampleManager.IsMP3RadioChannelAvailable()) { if (gNumRetunePresses > RADIO_OFF) gNumRetunePresses -= RADIO_OFF; } +#endif } #ifdef RADIO_SCROLL_TO_PREV_STATION else if(CPad::GetPad(0)->GetMouseWheelDownJustDown() || CPad::GetPad(0)->GetMouseWheelUpJustDown()) { @@ -511,8 +528,8 @@ cMusicManager::ServiceGameMode() m_bPreviousPlayerInCar = false; if (!m_bPlayerInCar) { if (m_bPreviousPlayerInCar) { - if (m_nCurrentStreamedSound != STREAMED_SOUND_RADIO_POLICE) - m_nRadioInCar = m_nCurrentStreamedSound; + if (m_nNextTrack != STREAMED_SOUND_RADIO_POLICE) + m_nRadioInCar = m_nNextTrack; } ServiceAmbience(); return; @@ -520,22 +537,22 @@ cMusicManager::ServiceGameMode() if (m_bPreviousPlayerInCar) { if (m_nAnnouncement < TOTAL_STREAMED_SOUNDS - && (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT || m_bAnnouncementInProgress) + && (m_nNextTrack < RADIO_OFF || m_bAnnouncementInProgress) && ServiceAnnouncement()) { if (m_bAnnouncementInProgress) { m_bSetNextStation = false; return; } - m_nPreviousStreamedSound = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = GetCarTuning(); + m_nPlayingTrack = m_nNextTrack; + m_nNextTrack = GetCarTuning(); } if (SampleManager.IsMP3RadioChannelAvailable() - && m_nCurrentStreamedSound != STREAMED_SOUND_RADIO_MP3_PLAYER + && m_nNextTrack != STREAMED_SOUND_RADIO_MP3_PLAYER && ControlsManager.GetIsKeyboardKeyJustDown(rsF9)) { - m_nPreviousStreamedSound = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = STREAMED_SOUND_RADIO_MP3_PLAYER; + m_nPlayingTrack = m_nNextTrack; + m_nNextTrack = STREAMED_SOUND_RADIO_MP3_PLAYER; if (FindPlayerVehicle() != nil) FindPlayerVehicle()->m_nRadioStation = STREAMED_SOUND_RADIO_MP3_PLAYER; AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 1.0f); @@ -563,22 +580,22 @@ cMusicManager::ServiceGameMode() AudioManager.DoPoliceRadioCrackle(); if (m_bSetNextStation) { m_bSetNextStation = false; - m_nPreviousStreamedSound = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = GetNextCarTuning(); - if (m_nCurrentStreamedSound == STREAMED_SOUND_CITY_AMBIENT || m_nCurrentStreamedSound == STREAMED_SOUND_WATER_AMBIENT) + m_nPlayingTrack = m_nNextTrack; + m_nNextTrack = GetNextCarTuning(); + if (m_nNextTrack == STREAMED_SOUND_CITY_AMBIENT || m_nNextTrack == STREAMED_SOUND_WATER_AMBIENT) bRadioOff = true; - if (m_nPreviousStreamedSound == STREAMED_SOUND_CITY_AMBIENT || m_nPreviousStreamedSound == STREAMED_SOUND_WATER_AMBIENT) + if (m_nPlayingTrack == STREAMED_SOUND_CITY_AMBIENT || m_nPlayingTrack == STREAMED_SOUND_WATER_AMBIENT) AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 0.0f); } - if (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT) { + if (m_nNextTrack < RADIO_OFF) { if (ChangeRadioChannel()) { ServiceTrack(); } else { m_bPlayerInCar = false; if (FindPlayerVehicle()) - FindPlayerVehicle()->m_nRadioStation = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = NO_TRACK; + FindPlayerVehicle()->m_nRadioStation = m_nNextTrack; + m_nNextTrack = NO_TRACK; } if (CTimer::GetIsSlowMotionActive()) { if (TheCamera.pTargetEntity != nil) { @@ -631,56 +648,56 @@ cMusicManager::ServiceGameMode() return; } if (bRadioOff) { - m_nCurrentStreamedSound = m_nPreviousStreamedSound; + m_nNextTrack = m_nPlayingTrack; if (FindPlayerVehicle() != nil) FindPlayerVehicle()->m_nRadioStation = RADIO_OFF; - AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_NO_RADIO, 0.0f); + AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_TURN_OFF, 0.0f); } ServiceAmbience(); return; } if (m_bRadioSetByScript) { if (UsesPoliceRadio(FindPlayerVehicle())) { - m_nCurrentStreamedSound = STREAMED_SOUND_RADIO_POLICE; + m_nNextTrack = STREAMED_SOUND_RADIO_POLICE; } else { - m_nCurrentStreamedSound = m_nRadioStation; - if (FindPlayerVehicle()->m_nRadioStation == m_nCurrentStreamedSound) { - m_nPreviousStreamedSound = NO_TRACK; + m_nNextTrack = m_nRadioStationScript; + if (FindPlayerVehicle()->m_nRadioStation == m_nNextTrack) { + m_nPlayingTrack = NO_TRACK; SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.StopStreamedFile(0); } if (m_nRadioPosition != -1) { - m_aTracks[m_nCurrentStreamedSound].m_nPosition = m_nRadioPosition; - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + m_aTracks[m_nNextTrack].m_nPosition = m_nRadioPosition; + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); } } } else { - m_nCurrentStreamedSound = GetCarTuning(); + m_nNextTrack = GetCarTuning(); } - if (m_nCurrentStreamedSound >= RADIO_OFF) { + if (m_nNextTrack >= RADIO_OFF) { ServiceAmbience(); return; } if (ChangeRadioChannel()) { if (m_bRadioSetByScript) { m_bRadioSetByScript = false; - FindPlayerVehicle()->m_nRadioStation = m_nCurrentStreamedSound; + FindPlayerVehicle()->m_nRadioStation = m_nNextTrack; } } else { m_bPlayerInCar = false; - m_nCurrentStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; } } void cMusicManager::StopFrontEndTrack() { - if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_TRACK) { - m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nNextTrack != NO_TRACK) { + m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); SampleManager.StopStreamedFile(0); - m_nPreviousStreamedSound = NO_TRACK; - m_nCurrentStreamedSound = NO_TRACK; + m_nPlayingTrack = NO_TRACK; + m_nNextTrack = NO_TRACK; } } @@ -696,30 +713,30 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend) { if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) { if (m_nMusicMode == MUSICMODE_GAME) { - if (m_nCurrentStreamedSound != NO_TRACK) { + if (m_nNextTrack != NO_TRACK) { if (m_bAnnouncementInProgress) { m_nAnnouncement = NO_TRACK; m_bAnnouncementInProgress = false; } - m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); } SampleManager.StopStreamedFile(0); } else if (m_nMusicMode == MUSICMODE_FRONTEND) { - if (m_nCurrentStreamedSound != NO_TRACK) { - m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + if (m_nNextTrack != NO_TRACK) { + m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); } SampleManager.StopStreamedFile(0); } - m_nPreviousStreamedSound = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = track; + m_nPlayingTrack = m_nNextTrack; + m_nNextTrack = track; m_bPlayInFrontend = !!bPlayInFrontend; m_bFrontendTrackFinished = false; m_bDoTrackService = true; bHasStarted = false; - if (m_nCurrentStreamedSound < STREAMED_SOUND_RADIO_POLICE) { + if (m_nNextTrack < NUM_RADIOS) { gRetuneCounter = 0; gNumRetunePresses = 0; } @@ -735,7 +752,7 @@ cMusicManager::PreloadCutSceneMusic(uint8 track) SampleManager.StopStreamedFile(0); SampleManager.PreloadStreamedFile(track, 0); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 0); - m_nCurrentStreamedSound = track; + m_nNextTrack = track; } } @@ -751,7 +768,7 @@ cMusicManager::StopCutSceneMusic(void) { if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_CUTSCENE) { SampleManager.StopStreamedFile(0); - m_nCurrentStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; } } @@ -795,45 +812,45 @@ cMusicManager::ServiceAmbience() m_nAnnouncement = NO_TRACK; m_bAnnouncementInProgress = false; } - if (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT) { + if (m_nNextTrack < RADIO_OFF) { if (SampleManager.IsStreamPlaying(0)) { - m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); SampleManager.StopStreamedFile(0); - m_nCurrentStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; return; } - m_nCurrentStreamedSound = STREAMED_SOUND_CITY_AMBIENT; + m_nNextTrack = RADIO_OFF; } if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING && !SampleManager.IsStreamPlaying(0)) { - m_nCurrentStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; return; } - m_nPreviousStreamedSound = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = TheCamera.DistanceToWater <= 45.0f ? STREAMED_SOUND_WATER_AMBIENT : STREAMED_SOUND_CITY_AMBIENT; + m_nPlayingTrack = m_nNextTrack; + m_nNextTrack = TheCamera.DistanceToWater <= 45.0f ? STREAMED_SOUND_WATER_AMBIENT : STREAMED_SOUND_CITY_AMBIENT; - if (m_nCurrentStreamedSound == m_nPreviousStreamedSound) { + if (m_nNextTrack == m_nPlayingTrack) { ComputeAmbienceVol(false, volume); SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); - if (m_bDontServiceAmbienceTrack) { + if (m_bVerifyAmbienceTrackStartedToPlay) { if (SampleManager.IsStreamPlaying(0)) - m_bDontServiceAmbienceTrack = false; + m_bVerifyAmbienceTrackStartedToPlay = false; } else ServiceTrack(); } else { - if (m_nPreviousStreamedSound < TOTAL_STREAMED_SOUNDS) { - m_aTracks[m_nPreviousStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nPreviousStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + if (m_nPlayingTrack < TOTAL_STREAMED_SOUNDS) { + m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); SampleManager.StopStreamedFile(0); } - uint32 pos = GetTrackStartPos(m_nCurrentStreamedSound); + uint32 pos = GetTrackStartPos(m_nNextTrack); SampleManager.SetStreamedVolumeAndPan(0, 63, 1, 0); - if (SampleManager.StartStreamedFile(m_nCurrentStreamedSound, pos, 0)) { + if (SampleManager.StartStreamedFile(m_nNextTrack, pos, 0)) { ComputeAmbienceVol(true, volume); SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); - m_bDontServiceAmbienceTrack = true; + m_bVerifyAmbienceTrackStartedToPlay = true; } else - m_nCurrentStreamedSound = NO_TRACK; + m_nNextTrack = NO_TRACK; } } @@ -862,7 +879,7 @@ cMusicManager::ServiceTrack() { if (m_bDoTrackService) { if (!SampleManager.IsStreamPlaying(0)) - SampleManager.StartStreamedFile(m_nCurrentStreamedSound, 0, 0); + SampleManager.StartStreamedFile(m_nNextTrack, 0, 0); } } @@ -882,9 +899,9 @@ cMusicManager::ServiceAnnouncement() cCheck = 0; int pos = SampleManager.GetStreamedFilePosition(0); if (SampleManager.IsStreamPlaying(0)) { - if (m_nCurrentStreamedSound != NO_TRACK) { - m_aTracks[m_nCurrentStreamedSound].m_nPosition = pos; - m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + if (m_nNextTrack != NO_TRACK) { + m_aTracks[m_nNextTrack].m_nPosition = pos; + m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); SampleManager.StopStreamedFile(0); } } @@ -893,8 +910,8 @@ cMusicManager::ServiceAnnouncement() if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) { SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0); m_bAnnouncementInProgress = true; - m_nPreviousStreamedSound = m_nCurrentStreamedSound; - m_nCurrentStreamedSound = m_nAnnouncement; + m_nPlayingTrack = m_nNextTrack; + m_nNextTrack = m_nAnnouncement; return true; } @@ -929,7 +946,7 @@ cMusicManager::GetNextCarTuning() while (gNumRetunePresses < 0) { if(veh->m_nRadioStation == HEAD_RADIO) { veh->m_nRadioStation = RADIO_OFF; - } else if(veh->m_nRadioStation == RADIO_OFF || veh->m_nRadioStation == POLICE_RADIO) { + } else if(veh->m_nRadioStation == RADIO_OFF || veh->m_nRadioStation == NUM_RADIOS) { veh->m_nRadioStation = SampleManager.IsMP3RadioChannelAvailable() ? USERTRACK : USERTRACK - 1; } else veh->m_nRadioStation--; @@ -940,12 +957,18 @@ cMusicManager::GetNextCarTuning() #endif if (SampleManager.IsMP3RadioChannelAvailable()) { if (veh->m_nRadioStation == RADIO_OFF) - veh->m_nRadioStation = POLICE_RADIO; + veh->m_nRadioStation = NUM_RADIOS; veh->m_nRadioStation += gNumRetunePresses; - if (veh->m_nRadioStation == POLICE_RADIO) +#ifdef FIX_BUGS + while (veh->m_nRadioStation > NUM_RADIOS) + veh->m_nRadioStation -= (NUM_RADIOS + 1); +#endif + if (veh->m_nRadioStation == NUM_RADIOS) veh->m_nRadioStation = RADIO_OFF; - else if (veh->m_nRadioStation > POLICE_RADIO) - veh->m_nRadioStation -= RADIO_OFF; +#ifndef FIX_BUGS + else if (veh->m_nRadioStation > NUM_RADIOS) + veh->m_nRadioStation -= (NUM_RADIOS + 1); +#endif } else if (gNumRetunePresses + veh->m_nRadioStation >= USERTRACK) { while (gNumRetunePresses) { if (veh->m_nRadioStation == RADIO_OFF) @@ -967,16 +990,16 @@ cMusicManager::GetNextCarTuning() bool cMusicManager::ChangeRadioChannel() { - if (m_nCurrentStreamedSound != m_nPreviousStreamedSound) { - if (m_nPreviousStreamedSound < TOTAL_STREAMED_SOUNDS) { - m_aTracks[m_nPreviousStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0); - m_aTracks[m_nPreviousStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); + if (m_nNextTrack != m_nPlayingTrack) { + if (m_nPlayingTrack < TOTAL_STREAMED_SOUNDS) { + m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); + m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.StopStreamedFile(0); } if (SampleManager.IsStreamPlaying(0)) return false; - if (!SampleManager.StartStreamedFile(m_nCurrentStreamedSound, GetTrackStartPos(m_nCurrentStreamedSound), 0)) + if (!SampleManager.StartStreamedFile(m_nNextTrack, GetTrackStartPos(m_nNextTrack), 0)) return false; SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0); } diff --git a/src/audio/MusicManager.h b/src/audio/MusicManager.h index e8b94da6..5d277f0e 100644 --- a/src/audio/MusicManager.h +++ b/src/audio/MusicManager.h @@ -18,8 +18,8 @@ public: bool m_bIsInitialised; bool m_bDisabled; uint8 m_nMusicMode; - uint8 m_nCurrentStreamedSound; - uint8 m_nPreviousStreamedSound; + uint8 m_nNextTrack; + uint8 m_nPlayingTrack; bool m_bFrontendTrackFinished; bool m_bPlayInFrontend; bool m_bSetNextStation; @@ -34,9 +34,9 @@ public: uint32 m_nTimer; bool m_bDoTrackService; bool m_bIgnoreTimeDelay; - bool m_bDontServiceAmbienceTrack; + bool m_bVerifyAmbienceTrackStartedToPlay; bool m_bRadioSetByScript; - uint8 m_nRadioStation; + uint8 m_nRadioStationScript; int32 m_nRadioPosition; uint8 m_nRadioInCar; @@ -44,7 +44,7 @@ public: cMusicManager(); bool IsInitialised() { return m_bIsInitialised; } uint32 GetMusicMode() { return m_nMusicMode; } - uint8 GetCurrentTrack() { return m_nCurrentStreamedSound; } + uint8 GetNextTrack() { return m_nNextTrack; } bool Initialise(); void Terminate(); diff --git a/src/audio/audio_enums.h b/src/audio/audio_enums.h index 8c6d35aa..027042cb 100644 --- a/src/audio/audio_enums.h +++ b/src/audio/audio_enums.h @@ -12,8 +12,9 @@ enum eRadioStation FLASHBACK, CHATTERBOX, USERTRACK, - POLICE_RADIO, - RADIO_OFF, + POLICE_RADIO = 10, + NUM_RADIOS = 10, + RADIO_OFF = 11, }; enum eMusicMode diff --git a/src/audio/oal/channel.cpp b/src/audio/oal/channel.cpp index 673a4aed..d1fd0aea 100644 --- a/src/audio/oal/channel.cpp +++ b/src/audio/oal/channel.cpp @@ -15,6 +15,8 @@ ALuint alFilters[MAXCHANNELS+MAX2DCHANNELS]; ALuint alBuffers[MAXCHANNELS+MAX2DCHANNELS]; bool bChannelsCreated = false; +int32 CChannel::channelsThatNeedService = 0; + void CChannel::InitChannels() { @@ -59,7 +61,9 @@ void CChannel::SetDefault() Position[0] = 0.0f; Position[1] = 0.0f; Position[2] = 0.0f; Distances[0] = 0.0f; Distances[1] = FLT_MAX; - LoopCount = 1; + + LoopCount = 1; + LastProcessedOffset = UINT32_MAX; LoopPoints[0] = 0; LoopPoints[1] = -1; Frequency = MAX_FREQ; @@ -67,6 +71,10 @@ void CChannel::SetDefault() void CChannel::Reset() { + // Here is safe because ctor don't call this + if (LoopCount > 1) + channelsThatNeedService--; + ClearBuffer(); SetDefault(); } @@ -165,10 +173,51 @@ void CChannel::SetCurrentFreq(uint32 freq) SetPitch(ALfloat(freq) / Frequency); } -void CChannel::SetLoopCount(int32 loopCount) // fake. TODO: +void CChannel::SetLoopCount(int32 count) { if ( !HasSource() ) return; - alSourcei(alSources[id], AL_LOOPING, loopCount == 1 ? AL_FALSE : AL_TRUE); + + // 0: loop indefinitely, 1: play one time, 2: play two times etc... + // only > 1 needs manual processing + + if (LoopCount > 1 && count < 2) + channelsThatNeedService--; + else if (LoopCount < 2 && count > 1) + channelsThatNeedService++; + + alSourcei(alSources[id], AL_LOOPING, count == 1 ? AL_FALSE : AL_TRUE); + LoopCount = count; +} + +bool CChannel::Update() +{ + if (!HasSource()) return false; + if (LoopCount < 2) return false; + + ALint state; + alGetSourcei(alSources[id], AL_SOURCE_STATE, &state); + if (state == AL_STOPPED) { + debug("Looping channels(%d in this case) shouldn't report AL_STOPPED, but nvm\n", id); + SetLoopCount(1); + return true; + } + + assert(channelsThatNeedService > 0 && "Ref counting is broken"); + + ALint offset; + alGetSourcei(alSources[id], AL_SAMPLE_OFFSET, &offset); + + // Rewound + if (offset < LastProcessedOffset) { + LoopCount--; + if (LoopCount == 1) { + // Playing last tune... + channelsThatNeedService--; + alSourcei(alSources[id], AL_LOOPING, AL_FALSE); + } + } + LastProcessedOffset = offset; + return true; } void CChannel::SetLoopPoints(ALint start, ALint end) @@ -200,6 +249,7 @@ void CChannel::SetPan(int32 pan) void CChannel::ClearBuffer() { if ( !HasSource() ) return; + alSourcei(alSources[id], AL_LOOPING, AL_FALSE); alSourcei(alSources[id], AL_BUFFER, AL_NONE); Data = nil; DataSize = 0; diff --git a/src/audio/oal/channel.h b/src/audio/oal/channel.h index 81817a32..b081be25 100644 --- a/src/audio/oal/channel.h +++ b/src/audio/oal/channel.h @@ -19,7 +19,10 @@ class CChannel float Distances[2]; int32 LoopCount; ALint LoopPoints[2]; + ALint LastProcessedOffset; public: + static int32 channelsThatNeedService; + static void InitChannels(); static void DestroyChannels(); @@ -37,7 +40,7 @@ public: void SetVolume(int32 vol); void SetSampleData(void *_data, size_t _DataSize, int32 freq); void SetCurrentFreq(uint32 freq); - void SetLoopCount(int32 loopCount); // fake + void SetLoopCount(int32 count); void SetLoopPoints(ALint start, ALint end); void SetPosition(float x, float y, float z); void SetDistances(float max, float min); @@ -45,6 +48,7 @@ public: void ClearBuffer(); void SetReverbMix(ALuint slot, float mix); void UpdateReverb(ALuint slot); + bool Update(); }; #endif
\ No newline at end of file diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 74ed86f4..44cc1c93 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -492,6 +492,7 @@ public: m_bOpened = mpg123_open(m_pMH, path) == MPG123_OK && mpg123_getformat(m_pMH, &rate, &channels, &encoding) == MPG123_OK; + m_nRate = rate; m_nChannels = channels; @@ -925,7 +926,8 @@ CStream::CStream(char *filename, ALuint *sources, ALuint (&buffers)[NUM_STREAMBU m_bReset(false), m_nVolume(0), m_nPan(0), - m_nPosBeforeReset(0) + m_nPosBeforeReset(0), + m_nLoopCount(1) { // Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/) @@ -1021,7 +1023,7 @@ bool CStream::IsPlaying() ALint sourceState[2]; alGetSourcei(m_pAlSources[0], AL_SOURCE_STATE, &sourceState[0]); alGetSourcei(m_pAlSources[1], AL_SOURCE_STATE, &sourceState[1]); - if ( m_bActive || sourceState[0] == AL_PLAYING || sourceState[1] == AL_PLAYING) + if (sourceState[0] == AL_PLAYING || sourceState[1] == AL_PLAYING) return true; } @@ -1093,6 +1095,7 @@ void CStream::SetPan(uint8 nPan) m_nPan = nPan; } +// Should only be called if source is stopped void CStream::SetPosMS(uint32 nPos) { if ( !IsOpened() ) return; @@ -1175,10 +1178,16 @@ void CStream::ClearBuffers() alSourceUnqueueBuffers(m_pAlSources[1], 1, &value); } -bool CStream::Setup() +bool CStream::Setup(bool imSureQueueIsEmpty) { if ( IsOpened() ) { + alSourcei(m_pAlSources[0], AL_LOOPING, AL_FALSE); + alSourcei(m_pAlSources[1], AL_LOOPING, AL_FALSE); + if (!imSureQueueIsEmpty) { + SetPlay(false); + ClearBuffers(); + } m_pSoundFile->Seek(0); //SetPosition(0.0f, 0.0f, 0.0f); SetPitch(1.0f); @@ -1189,6 +1198,13 @@ bool CStream::Setup() return IsOpened(); } +void CStream::SetLoopCount(int32 count) +{ + if ( !HasSource() ) return; + + m_nLoopCount = count; +} + void CStream::SetPlay(bool state) { if ( !HasSource() ) return; @@ -1248,7 +1264,7 @@ void CStream::Update() if ( !m_bPaused ) { - ALint sourceState[2]; + ALint totalBuffers[2] = { 0, 0 }; ALint buffersProcessed[2] = { 0, 0 }; // Relying a lot on left buffer states in here @@ -1256,44 +1272,51 @@ void CStream::Update() do { //alSourcef(m_pAlSources[0], AL_ROLLOFF_FACTOR, 0.0f); - alGetSourcei(m_pAlSources[0], AL_SOURCE_STATE, &sourceState[0]); + alGetSourcei(m_pAlSources[0], AL_BUFFERS_QUEUED, &totalBuffers[0]); alGetSourcei(m_pAlSources[0], AL_BUFFERS_PROCESSED, &buffersProcessed[0]); //alSourcef(m_pAlSources[1], AL_ROLLOFF_FACTOR, 0.0f); - alGetSourcei(m_pAlSources[1], AL_SOURCE_STATE, &sourceState[1]); + alGetSourcei(m_pAlSources[1], AL_BUFFERS_QUEUED, &totalBuffers[1]); alGetSourcei(m_pAlSources[1], AL_BUFFERS_PROCESSED, &buffersProcessed[1]); } while (buffersProcessed[0] != buffersProcessed[1]); - ALint looping = AL_FALSE; - alGetSourcei(m_pAlSources[0], AL_LOOPING, &looping); - - if ( looping == AL_TRUE ) + assert(buffersProcessed[0] == buffersProcessed[1]); + + // Correcting OpenAL concepts here: + // AL_BUFFERS_QUEUED = Number of *all* buffers in queue, including processed, processing and pending + // AL_BUFFERS_PROCESSED = Index of the buffer being processing right now. Buffers coming after that(have greater index) are pending buffers. + // which means: totalBuffers[0] - buffersProcessed[0] = pending buffers + + bool buffersRefilled = false; + + // We should wait queue to be cleared to loop track, because position calculation relies on queue. + if (m_nLoopCount != 1 && m_bActive && totalBuffers[0] == 0) { - TRACE("stream set looping"); - alSourcei(m_pAlSources[0], AL_LOOPING, AL_TRUE); - alSourcei(m_pAlSources[1], AL_LOOPING, AL_TRUE); + Setup(true); + buffersRefilled = FillBuffers() != 0; + if (m_nLoopCount != 0) + m_nLoopCount--; } - - assert(buffersProcessed[0] == buffersProcessed[1]); - - while( buffersProcessed[0]-- ) + else { - ALuint buffer[2]; - - alSourceUnqueueBuffers(m_pAlSources[0], 1, &buffer[0]); - alSourceUnqueueBuffers(m_pAlSources[1], 1, &buffer[1]); - - if (m_bActive && FillBuffer(buffer)) + while( buffersProcessed[0]-- ) { - alSourceQueueBuffers(m_pAlSources[0], 1, &buffer[0]); - alSourceQueueBuffers(m_pAlSources[1], 1, &buffer[1]); + ALuint buffer[2]; + + alSourceUnqueueBuffers(m_pAlSources[0], 1, &buffer[0]); + alSourceUnqueueBuffers(m_pAlSources[1], 1, &buffer[1]); + + if (m_bActive && FillBuffer(buffer)) + { + buffersRefilled = true; + alSourceQueueBuffers(m_pAlSources[0], 1, &buffer[0]); + alSourceQueueBuffers(m_pAlSources[1], 1, &buffer[1]); + } } } - - if ( sourceState[0] != AL_PLAYING ) - { - alGetSourcei(m_pAlSources[0], AL_BUFFERS_PROCESSED, &buffersProcessed[0]); - SetPlay(buffersProcessed[0]!=0); - } + + // Two reasons: 1-Source may be starved to audio and stopped itself, 2- We're already waiting it to starve and die for looping track! + if (m_bActive && (buffersRefilled || (totalBuffers[1] - buffersProcessed[1] != 0))) + SetPlay(true); } } @@ -1301,10 +1324,11 @@ void CStream::ProviderInit() { if ( m_bReset ) { - if ( Setup() ) + if ( Setup(true) ) { SetPan(m_nPan); SetVolume(m_nVolume); + SetLoopCount(m_nLoopCount); SetPosMS(m_nPosBeforeReset); if (m_bActive) FillBuffers(); diff --git a/src/audio/oal/stream.h b/src/audio/oal/stream.h index bcbc5e54..9a2a2fbe 100644 --- a/src/audio/oal/stream.h +++ b/src/audio/oal/stream.h @@ -69,6 +69,7 @@ class CStream uint32 m_nVolume; uint8 m_nPan; uint32 m_nPosBeforeReset; + int32 m_nLoopCount; IDecoder *m_pSoundFile; @@ -99,10 +100,12 @@ public: uint32 GetPosMS(); uint32 GetLengthMS(); - bool Setup(); + bool Setup(bool imSureQueueIsEmpty = false); void Start(); void Stop(); void Update(void); + void SetLoopCount(int32); + void ProviderInit(); void ProviderTerm(); diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 11e2b0ff..9b601d52 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1514,7 +1514,7 @@ cSampleManager::LoadPedComment(uint32 nComment) case MUSICMODE_FRONTEND: { - if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_GAME_COMPLETED ) + if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED ) return false; break; @@ -1753,8 +1753,8 @@ cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume) // increase the volume for JB.MP3 and S4_BDBD.MP3 if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) + && MusicManager.GetNextTrack() != STREAMED_SOUND_NEWS_INTRO + && MusicManager.GetNextTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) { nChannelVolume[nChannel] >>= 2; } @@ -1792,8 +1792,8 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume) // increase the volume for JB.MP3 and S4_BDBD.MP3 if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) + && MusicManager.GetNextTrack() != STREAMED_SOUND_NEWS_INTRO + && MusicManager.GetNextTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) { nChannelVolume[nChannel] >>= 2; } diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 798ea287..d9adef5b 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -14,8 +14,6 @@ #include <AL/efx.h> #include <AL/efx-presets.h> -#pragma comment(lib, "OpenAL32.lib") - // for user MP3s #include <direct.h> #include <shlobj.h> @@ -24,6 +22,10 @@ #define _getcwd getcwd #endif +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK +#pragma comment( lib, "OpenAL32.lib" ) +#endif + #include "common.h" #include "crossplatform.h" @@ -44,7 +46,6 @@ //TODO: fix eax3 reverb //TODO: max channels -//TODO: loop count cSampleManager SampleManager; bool _bSampmanInitialised = false; @@ -117,7 +118,6 @@ char _mp3DirectoryPath[MAX_PATH]; CStream *aStream[MAX_STREAMS]; uint8 nStreamPan [MAX_STREAMS]; uint8 nStreamVolume[MAX_STREAMS]; -uint8 nStreamLoopedFlag[MAX_STREAMS]; uint32 _CurMP3Index; int32 _CurMP3Pos; bool _bIsMp3Active; @@ -1318,7 +1318,7 @@ cSampleManager::LoadPedComment(uint32 nComment) case MUSICMODE_FRONTEND: { - if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_GAME_COMPLETED ) + if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED ) return false; break; @@ -1533,8 +1533,8 @@ cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume) // reduce channel volume when JB.MP3 or S4_BDBD.MP3 playing if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) + && MusicManager.GetNextTrack() != STREAMED_SOUND_NEWS_INTRO + && MusicManager.GetNextTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) { nChannelVolume[nChannel] = vol / 4; } @@ -1575,8 +1575,8 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume) // reduce the volume for JB.MP3 and S4_BDBD.MP3 if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) + && MusicManager.GetNextTrack() != STREAMED_SOUND_NEWS_INTRO + && MusicManager.GetNextTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD ) { nChannelVolume[nChannel] = vol / 4; } @@ -1666,7 +1666,7 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream) ASSERT(stream != NULL); aStream[nStream] = stream; - if ( !stream->IsOpened() ) + if ( !stream->Setup() ) { delete stream; aStream[nStream] = NULL; @@ -1696,7 +1696,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream) if ( stream ) { - if ( stream->Setup() ) + if ( stream->IsOpened() ) { stream->Start(); } @@ -1742,13 +1742,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) aStream[nStream] = stream; - if (stream->IsOpened()) { - if (stream->Setup()) { - if (position != 0) - stream->SetPosMS(position); + if (stream->Setup()) { + if (position != 0) + stream->SetPosMS(position); - stream->Start(); - } + stream->Start(); return true; } else { @@ -1769,10 +1767,8 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); } - if (aStream[nStream]->IsOpened()) { - if (aStream[nStream]->Setup()) { - aStream[nStream]->Start(); - } + if (aStream[nStream]->Setup()) { + aStream[nStream]->Start(); return true; } else { @@ -1798,13 +1794,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) aStream[nStream] = stream; - if (stream->IsOpened()) { - if (stream->Setup()) { - if (position != 0) - stream->SetPosMS(position); + if (stream->Setup()) { + if (position != 0) + stream->SetPosMS(position); - stream->Start(); - } + stream->Start(); return true; } else { @@ -1825,13 +1819,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream]); } - if (aStream[nStream]->IsOpened()) { - if (aStream[nStream]->Setup()) { - if (position != 0) - aStream[nStream]->SetPosMS(position); + if (aStream[nStream]->Setup()) { + if (position != 0) + aStream[nStream]->SetPosMS(position); - aStream[nStream]->Start(); - } + aStream[nStream]->Start(); _bIsMp3Active = true; return true; @@ -1855,13 +1847,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) aStream[nStream] = stream; - if ( stream->IsOpened() ) { - if ( stream->Setup() ) { - if (position != 0) - stream->SetPosMS(position); + if ( stream->Setup() ) { + if (position != 0) + stream->SetPosMS(position); - stream->Start(); - } + stream->Start(); return true; } else { @@ -1884,6 +1874,9 @@ cSampleManager::StopStreamedFile(uint8 nStream) { delete stream; aStream[nStream] = NULL; + + if ( nStream == 0 ) + _bIsMp3Active = false; } } @@ -1896,7 +1889,21 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream) if ( stream ) { - return stream->GetPosMS(); + if ( _bIsMp3Active ) + { + tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index); + + if ( mp3 != NULL ) + { + return stream->GetPosMS() + mp3->nTrackStreamPos; + } + else + return 0; + } + else + { + return stream->GetPosMS(); + } } return 0; @@ -1963,6 +1970,12 @@ cSampleManager::Service(void) if ( stream ) stream->Update(); } + int refCount = CChannel::channelsThatNeedService; + for ( int32 i = 0; refCount && i < MAXCHANNELS+MAX2DCHANNELS; i++ ) + { + if ( aChannel[i].Update() ) + refCount--; + } } bool diff --git a/src/audio/soundlist.h b/src/audio/soundlist.h index 7c3b30a7..4bbc3dde 100644 --- a/src/audio/soundlist.h +++ b/src/audio/soundlist.h @@ -160,7 +160,7 @@ enum eSound SOUND_FRONTEND_MONO, SOUND_FRONTEND_AUDIO_TEST, SOUND_FRONTEND_FAIL, - SOUND_FRONTEND_NO_RADIO, + SOUND_FRONTEND_RADIO_TURN_OFF, SOUND_FRONTEND_RADIO_CHANGE, SOUND_HUD, SOUND_AMMUNATION_WELCOME_1, diff --git a/src/control/AutoPilot.cpp b/src/control/AutoPilot.cpp index 4038c93e..77cbd0b4 100644 --- a/src/control/AutoPilot.cpp +++ b/src/control/AutoPilot.cpp @@ -52,8 +52,8 @@ void CAutoPilot::Save(uint8*& buf) WriteSaveBuf<int32>(buf, m_nCurrentRouteNode); WriteSaveBuf<int32>(buf, m_nNextRouteNode); WriteSaveBuf<int32>(buf, m_nPrevRouteNode); - WriteSaveBuf<uint32>(buf, m_nTimeEnteredCurve); - WriteSaveBuf<uint32>(buf, m_nTimeToSpendOnCurrentCurve); + WriteSaveBuf<int32>(buf, m_nTimeEnteredCurve); + WriteSaveBuf<int32>(buf, m_nTimeToSpendOnCurrentCurve); WriteSaveBuf<uint32>(buf, m_nCurrentPathNodeInfo); WriteSaveBuf<uint32>(buf, m_nNextPathNodeInfo); WriteSaveBuf<uint32>(buf, m_nPreviousPathNodeInfo); @@ -91,8 +91,8 @@ void CAutoPilot::Load(uint8*& buf) m_nCurrentRouteNode = ReadSaveBuf<int32>(buf); m_nNextRouteNode = ReadSaveBuf<int32>(buf); m_nPrevRouteNode = ReadSaveBuf<int32>(buf); - m_nTimeEnteredCurve = ReadSaveBuf<uint32>(buf); - m_nTimeToSpendOnCurrentCurve = ReadSaveBuf<uint32>(buf); + m_nTimeEnteredCurve = ReadSaveBuf<int32>(buf); + m_nTimeToSpendOnCurrentCurve = ReadSaveBuf<int32>(buf); m_nCurrentPathNodeInfo = ReadSaveBuf<uint32>(buf); m_nNextPathNodeInfo = ReadSaveBuf<uint32>(buf); m_nPreviousPathNodeInfo = ReadSaveBuf<uint32>(buf); diff --git a/src/control/AutoPilot.h b/src/control/AutoPilot.h index 6349fce6..c7707ed6 100644 --- a/src/control/AutoPilot.h +++ b/src/control/AutoPilot.h @@ -57,8 +57,8 @@ public: int32 m_nCurrentRouteNode; int32 m_nNextRouteNode; int32 m_nPrevRouteNode; - uint32 m_nTimeEnteredCurve; - uint32 m_nTimeToSpendOnCurrentCurve; + int32 m_nTimeEnteredCurve; + int32 m_nTimeToSpendOnCurrentCurve; uint32 m_nCurrentPathNodeInfo; uint32 m_nNextPathNodeInfo; uint32 m_nPreviousPathNodeInfo; diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp index f649d435..ef7ecead 100644 --- a/src/control/Phones.cpp +++ b/src/control/Phones.cpp @@ -58,9 +58,9 @@ CPhoneInfo::Update(void) TheCamera.SetWideScreenOff(); pPhoneDisplayingMessages = nil; bDisplayingPhoneMessage = false; - CAnimBlendAssociation *talkAssoc = RpAnimBlendClumpGetAssociation(player->GetClump(), ANIM_PHONE_TALK); + CAnimBlendAssociation *talkAssoc = RpAnimBlendClumpGetAssociation(player->GetClump(), ANIM_STD_PHONE_TALK); if (talkAssoc && talkAssoc->blendAmount > 0.5f) { - CAnimBlendAssociation *endAssoc = CAnimManager::BlendAnimation(player->GetClump(), ASSOCGRP_STD, ANIM_PHONE_OUT, 8.0f); + CAnimBlendAssociation *endAssoc = CAnimManager::BlendAnimation(player->GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_OUT, 8.0f); endAssoc->flags &= ~ASSOC_DELETEFADEDOUT; endAssoc->SetFinishCallback(PhonePutDownCB, player); } else { @@ -117,7 +117,7 @@ CPhoneInfo::Update(void) CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE); TheCamera.SetWideScreenOn(); playerInfo->MakePlayerSafe(true); - CAnimBlendAssociation *phonePickAssoc = CAnimManager::BlendAnimation(player->GetClump(), ASSOCGRP_STD, ANIM_PHONE_IN, 4.0f); + CAnimBlendAssociation *phonePickAssoc = CAnimManager::BlendAnimation(player->GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_IN, 4.0f); phonePickAssoc->SetFinishCallback(PhonePickUpCB, &m_aPhones[phoneId]); bPickingUpPhone = true; pCallBackPed = player; @@ -442,10 +442,10 @@ PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg) CPed *ped = CPhoneInfo::pCallBackPed; ped->m_nMoveState = PEDMOVE_STILL; - CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_IDLE_STANCE, 8.0f); + CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE, 8.0f); if (assoc->blendAmount > 0.5f && ped) - CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_PHONE_TALK, 8.0f); + CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_TALK, 8.0f); CPhoneInfo::pCallBackPed = nil; } diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 2dd66333..d8b15385 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -457,7 +457,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState state->aFunctionCallbackID[i] = 0; } }else{ - state->aAnimId[i] = NUM_ANIMS; + state->aAnimId[i] = ANIM_STD_NUM; state->aCurTime[i] = 0; state->aSpeed[i] = 85; state->aFunctionCallbackID[i] = 0; @@ -484,7 +484,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState } } else { - state->aAnimId2[i] = NUM_ANIMS; + state->aAnimId2[i] = ANIM_STD_NUM; state->aCurTime2[i] = 0; state->aSpeed2[i] = 85; state->aFunctionCallbackID2[i] = 0; @@ -558,7 +558,7 @@ void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state) float time = state->partAnimTime * 4.0f / 255.0f; float speed = state->partAnimSpeed * 3.0f / 255.0f; float blend = state->partBlendAmount * 2.0f / 255.0f; - if (blend > 0.0f && state->partAnimId != ANIM_IDLE_STANCE){ + if (blend > 0.0f && state->partAnimId != ANIM_STD_IDLE){ CAnimBlendAssociation* anim3 = CAnimManager::BlendAnimation( (RpClump*)ped->m_rwObject, ASSOCGRP_STD, (AnimationId)state->partAnimId, 1000.0f); anim3->SetCurrentTime(time); @@ -578,7 +578,7 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt assoc->SetBlend(0.0f, -1.0f); #endif for (int i = 0; i < NUM_MAIN_ANIMS_IN_REPLAY; i++) { - if (state->aAnimId[i] == NUM_ANIMS) + if (state->aAnimId[i] == ANIM_STD_NUM) continue; #ifdef FIX_REPLAY_BUGS CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), @@ -607,7 +607,7 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt anim->SetDeleteCallback(FindCBFunction(callback & 0x7F), ped); } for (int i = 0; i < NUM_PARTIAL_ANIMS_IN_REPLAY; i++) { - if (state->aAnimId2[i] == NUM_ANIMS) + if (state->aAnimId2[i] == ANIM_STD_NUM) continue; #ifdef FIX_REPLAY_BUGS CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), diff --git a/src/control/Script.cpp b/src/control/Script.cpp index e70bd508..5598f3c9 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -4266,7 +4266,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) #ifdef FIX_BUGS AnimationId anim = pVehicle->GetDriverAnim(); #else - AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT; + AnimationId anim = pVehicle->bLowVehicle ? ANIM_STD_CAR_SIT_LO : ANIM_STD_CAR_SIT; #endif pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f); pPed->StopNonPartialAnims(); @@ -4309,7 +4309,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) pPlayer->m_pPed->m_pVehicleAnim->blendDelta = -1000.0f; pPlayer->m_pPed->m_pVehicleAnim = nil; pPlayer->m_pPed->SetMoveState(PEDMOVE_NONE); - CAnimManager::BlendAnimation(pPlayer->m_pPed->GetClump(), pPlayer->m_pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f); + CAnimManager::BlendAnimation(pPlayer->m_pPed->GetClump(), pPlayer->m_pPed->m_animGroup, ANIM_STD_IDLE, 100.0f); pPlayer->m_pPed->RestartNonPartialAnims(); AudioManager.PlayerJustLeftCar(); pos.z += pPlayer->m_pPed->GetDistanceFromCentreOfMassToBaseOfModel(); diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp index 9329b3bc..5c953011 100644 --- a/src/control/Script2.cpp +++ b/src/control/Script2.cpp @@ -913,7 +913,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) if (strcmp(m_abScriptName, "camera") == 0){ pPlayer->m_pPed->SetMoveSpeed(0.0f, 0.0f, 0.0f); pPlayer->m_pPed->SetTurnSpeed(0.0f, 0.0f, 0.0f); - CAnimManager::BlendAnimation((RpClump*)pPlayer->m_pPed->m_rwObject, pPlayer->m_pPed->m_animGroup, ANIM_IDLE_STANCE, 1000.0f); + CAnimManager::BlendAnimation((RpClump*)pPlayer->m_pPed->m_rwObject, pPlayer->m_pPed->m_animGroup, ANIM_STD_IDLE, 1000.0f); } } return 0; @@ -1156,7 +1156,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) #ifdef FIX_BUGS AnimationId anim = pVehicle->GetDriverAnim(); #else - AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT; + AnimationId anim = pVehicle->bLowVehicle ? ANIM_STD_CAR_SIT_LO : ANIM_STD_CAR_SIT; #endif pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f); pPed->StopNonPartialAnims(); diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp index f49835db..ac88347b 100644 --- a/src/control/Script3.cpp +++ b/src/control/Script3.cpp @@ -417,7 +417,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command) pPed->FlagToDestroyWhenNextProcessed(); } else { - pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + pPed->SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); } return 0; } diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp index 40f9f2f1..93956ea2 100644 --- a/src/control/Script4.cpp +++ b/src/control/Script4.cpp @@ -68,7 +68,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) pPed->ApplyHeadShot(WEAPONTYPE_SNIPERRIFLE, pPed->GetNodePosition(PED_HEAD), true); } else { - pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + pPed->SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); } return 0; } @@ -81,7 +81,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) pPed->ApplyHeadShot(WEAPONTYPE_SNIPERRIFLE, pPed->GetNodePosition(PED_HEAD), true); } else { - pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + pPed->SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); } return 0; } @@ -793,7 +793,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) pPed->m_pVehicleAnim = nil; pPed->RestartNonPartialAnims(); pPed->SetMoveState(PEDMOVE_NONE); - CAnimManager::BlendAnimation(pPed->GetClump(), pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f); + CAnimManager::BlendAnimation(pPed->GetClump(), pPed->m_animGroup, ANIM_STD_IDLE, 100.0f); pos.z += pPed->GetDistanceFromCentreOfMassToBaseOfModel(); pPed->Teleport(pos); CTheScripts::ClearSpaceForMissionEntity(pos, pPed); diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp index b54d425c..464a77d8 100644 --- a/src/control/Script5.cpp +++ b/src/control/Script5.cpp @@ -2450,10 +2450,10 @@ bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer) CPed* pPed = pPlayer->m_pPed; if (pPed->bInVehicle) return IsVehicleStopped(pPed->m_pMyVehicle); - if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP) || - RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP_R) || - RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) || - RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE)) + if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_RUNSTOP1) || + RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_RUNSTOP2) || + RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_JUMP_LAUNCH) || + RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_JUMP_GLIDE)) return false; return pPed->m_nMoveState == PEDMOVE_NONE || pPed->m_nMoveState == PEDMOVE_STILL; } diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp index a888d528..946693a7 100644 --- a/src/core/AnimViewer.cpp +++ b/src/core/AnimViewer.cpp @@ -230,7 +230,7 @@ CAnimViewer::Update(void) if (modelInfo->GetModelType() == MITYPE_PED) { int animGroup = ((CPedModelInfo*)modelInfo)->m_animGroup; - if (animId > ANIM_IDLE_STANCE) + if (animId > ANIM_STD_IDLE) animGroup = ASSOCGRP_STD; if (reloadIFP) { @@ -318,14 +318,14 @@ CAnimViewer::Update(void) CMessages::AddMessage(gUString, 1000, 0); } else if (pad->GetCircleJustDown()) { - PlayAnimation(pTarget->GetClump(), animGroup, ANIM_IDLE_STANCE); + PlayAnimation(pTarget->GetClump(), animGroup, ANIM_STD_IDLE); AsciiToUnicode("Idle animation playing", gUString); CMessages::AddMessage(gUString, 1000, 0); } else if (pad->GetDPadUpJustDown()) { animId--; if (animId < 0) { - animId = NUM_ANIMS - 1; + animId = ANIM_STD_NUM - 1; } PlayAnimation(pTarget->GetClump(), animGroup, (AnimationId)animId); @@ -334,7 +334,7 @@ CAnimViewer::Update(void) CMessages::AddMessage(gUString, 1000, 0); } else if (pad->GetDPadDownJustDown()) { - animId = (animId == (NUM_ANIMS - 1) ? 0 : animId + 1); + animId = (animId == (ANIM_STD_NUM - 1) ? 0 : animId + 1); PlayAnimation(pTarget->GetClump(), animGroup, (AnimationId)animId); sprintf(gString, "Current anim: %d", animId); diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index f43ff57a..e0497fe2 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -1644,10 +1644,10 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient if(CamTargetEntity->m_rwObject){ // what's going on here? - if(RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_WEAPON_PUMP) || - RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_WEAPON_THROW) || - RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_WEAPON_THROWU) || - RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_WEAPON_START_THROW)){ + if(RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_STD_WEAPON_PUMP) || + RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_STD_WEAPON_THROW) || + RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_STD_THROW_UNDER) || + RpAnimBlendClumpGetAssociation(CamTargetEntity->GetClump(), ANIM_STD_START_THROW)){ CPed *player = FindPlayerPed(); float PlayerDist = (Source - player->GetPosition()).Magnitude(); if(PlayerDist < 2.75f) @@ -4631,7 +4631,7 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient */ { LookLeftRight = -CPad::GetPad(0)->LookAroundLeftRight(); - LookUpDown = -CPad::GetPad(0)->LookAroundUpDown(); + LookUpDown = CPad::GetPad(0)->LookAroundUpDown(); } float AlphaOffset, BetaOffset; if(UseMouse){ diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp index da85a238..977f16c2 100644 --- a/src/core/CdStream.cpp +++ b/src/core/CdStream.cpp @@ -14,9 +14,9 @@ struct CdReadInfo void *pBuffer; char field_C; bool bLocked; - bool bInUse; + bool bReading; int32 nStatus; - HANDLE hSemaphore; // used for CdStreamSync + HANDLE pDoneSemaphore; // used for CdStreamSync HANDLE hFile; OVERLAPPED Overlapped; }; @@ -53,9 +53,9 @@ CdStreamInitThread(void) { for ( int32 i = 0; i < gNumChannels; i++ ) { - gpReadInfo[i].hSemaphore = CreateSemaphore(nil, 0, 2, nil); + gpReadInfo[i].pDoneSemaphore = CreateSemaphore(nil, 0, 2, nil); - if ( gpReadInfo[i].hSemaphore == nil ) + if ( gpReadInfo[i].pDoneSemaphore == nil ) { printf("%s: failed to create sync semaphore\n", "cdvd_stream"); ASSERT(0); @@ -183,7 +183,7 @@ CdStreamShutdown(void) CloseHandle(_gCdStreamThread); for ( int32 i = 0; i < gNumChannels; i++ ) - CloseHandle(gpReadInfo[i].hSemaphore); + CloseHandle(gpReadInfo[i].pDoneSemaphore); } LocalFree(gpReadInfo); @@ -213,7 +213,7 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size) if ( _gbCdStreamAsync ) { - if ( pChannel->nSectorsToRead != 0 || pChannel->bInUse ) + if ( pChannel->nSectorsToRead != 0 || pChannel->bReading ) return STREAM_NONE; pChannel->nStatus = STREAM_NONE; @@ -271,7 +271,7 @@ CdStreamGetStatus(int32 channel) if ( _gbCdStreamAsync ) { - if ( pChannel->bInUse ) + if ( pChannel->bReading ) return STREAM_READING; if ( pChannel->nSectorsToRead != 0 ) @@ -321,12 +321,21 @@ CdStreamSync(int32 channel) { pChannel->bLocked = true; - ASSERT( pChannel->hSemaphore != nil ); + ASSERT( pChannel->pDoneSemaphore != nil ); - WaitForSingleObject(pChannel->hSemaphore, INFINITE); + // Deadlock fix 1 +#ifdef FIX_BUGS + // This is while loop on Posix streamer, for spurious wakeups + if (pChannel->bLocked && pChannel->nSectorsToRead != 0){ + WaitForSingleObject(pChannel->pDoneSemaphore, INFINITE); + } + pChannel->bLocked = false; +#else + WaitForSingleObject(pChannel->pDoneSemaphore, INFINITE); +#endif } - pChannel->bInUse = false; + pChannel->bReading = false; return pChannel->nStatus; } @@ -398,7 +407,7 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter) CdReadInfo *pChannel = &gpReadInfo[channel]; ASSERT( pChannel != nil ); - pChannel->bInUse = true; + pChannel->bReading = true; if ( pChannel->nStatus == STREAM_NONE ) { @@ -455,11 +464,15 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter) if ( pChannel->bLocked ) { - ASSERT( pChannel->hSemaphore != nil ); - ReleaseSemaphore(pChannel->hSemaphore, 1, NULL); + ASSERT( pChannel->pDoneSemaphore != nil ); + // Deadlock fix 2 +#ifdef FIX_BUGS + pChannel->bLocked = 0; +#endif + ReleaseSemaphore(pChannel->pDoneSemaphore, 1, NULL); } - pChannel->bInUse = false; + pChannel->bReading = false; } } diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp index 4115cd38..e72af7e4 100644 --- a/src/core/ControllerConfig.cpp +++ b/src/core/ControllerConfig.cpp @@ -354,6 +354,11 @@ uint32 CControllerConfigManager::ms_padButtonsInited = 0; void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons) { +#ifdef XINPUT + // No manual bindings for you, honey. + return; +#endif + m_bFirstCapture = true; uint32 btn = buttons; @@ -2619,11 +2624,6 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O #define PS2_CIRCLE "|" #define PS2_CROSS "/" #define PS2_SQUARE "^" -#elif defined(BUTTON_ICONS) -#define PS2_TRIANGLE "~T~" -#define PS2_CIRCLE "~O~" -#define PS2_CROSS "~X~" -#define PS2_SQUARE "~Q~" #else #define PS2_TRIANGLE "TRIANGLE" #define PS2_CIRCLE "CIRCLE" @@ -2636,7 +2636,7 @@ const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] = #ifdef BUTTON_ICONS const char *PlayStationButtons[][MAX_CONTROLLERACTIONS] = - CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT"); + CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT"); #endif #undef PS2_TRIANGLE @@ -2653,11 +2653,36 @@ void CControllerConfigManager::GetWideStringOfCommandKeys(uint16 action, wchar * if (CPad::GetPad(0)->IsAffectedByController) { wchar wstr[16]; - // TODO: INI and/or menu setting for Xbox/PS switch + const char* (*Buttons)[MAX_CONTROLLERACTIONS]; + #ifdef BUTTON_ICONS - const char *(*Buttons)[MAX_CONTROLLERACTIONS] = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons; + #ifdef GAMEPAD_MENU + switch (FrontEndMenuManager.m_PrefsControllerType) + { + case CMenuManager::CONTROLLER_DUALSHOCK2: + case CMenuManager::CONTROLLER_DUALSHOCK3: + case CMenuManager::CONTROLLER_DUALSHOCK4: + Buttons = CFont::ButtonsSlot != -1 ? PlayStationButtons : PlayStationButtons_noIcons; + break; + default: + #endif + Buttons = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons; + #ifdef GAMEPAD_MENU + break; + } + #endif #else - const char *(*Buttons)[MAX_CONTROLLERACTIONS] = XboxButtons_noIcons; + switch (FrontEndMenuManager.m_PrefsControllerType) + { + case CMenuManager::CONTROLLER_DUALSHOCK2: + case CMenuManager::CONTROLLER_DUALSHOCK3: + case CMenuManager::CONTROLLER_DUALSHOCK4: + Buttons = PlayStationButtons_noIcons; + break; + default: + Buttons = XboxButtons_noIcons; + break; + } #endif assert(Buttons[CPad::GetPad(0)->Mode][action] != nil); // we cannot use these diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index bd72a15f..07b8f996 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -141,6 +141,10 @@ int8 CMenuManager::m_nDisplayMSAALevel = 0; int8 CMenuManager::m_PrefsIslandLoading = ISLAND_LOADING_LOW; #endif +#ifdef GAMEPAD_MENU +int8 CMenuManager::m_PrefsControllerType = CONTROLLER_XBOXONE; +#endif + int32 CMenuManager::OS_Language = LANG_ENGLISH; int8 CMenuManager::m_PrefsUseVibration; int8 CMenuManager::m_DisplayControllerOnFoot; @@ -1161,6 +1165,16 @@ CMenuManager::Draw() CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE)); CFont::SetCentreOn(); break; +#ifdef FIX_BUGS + case MENUPAGE_CONTROLLER_SETTINGS: + columnWidth = 50; + headerHeight = -50; + lineHeight = 20; + CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = MEDIUMTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = MEDIUMTEXT_Y_SCALE)); + CFont::SetRightJustifyOff(); + break; +#endif case MENUPAGE_SOUND_SETTINGS: case MENUPAGE_DISPLAY_SETTINGS: case MENUPAGE_MULTIPLAYER_CREATE: @@ -3622,6 +3636,10 @@ CMenuManager::LoadAllTextures() m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER); } +#ifdef GAMEPAD_MENU + LoadController(m_PrefsControllerType); +#endif + int menuTxdSlot = CTxdStore::FindTxdSlot("menu"); if (menuTxdSlot == -1) @@ -3637,7 +3655,13 @@ CMenuManager::LoadAllTextures() m_aMenuSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER); } #ifdef MENU_MAP + static bool menuOptionAdded = false; for (int i = 0; i < ARRAY_SIZE(MapFilenames); i++) { + if (!menuOptionAdded && RwTextureRead(MapFilenames[i][0], MapFilenames[i][1])) { + FrontendOptionSetCursor(MENUPAGE_PAUSE_MENU, 2, false); + FrontendOptionAddBuiltinAction("FEG_MAP", MENUACTION_CHANGEMENU, MENUPAGE_MAP, SAVESLOT_NONE); + menuOptionAdded = true; + } m_aMapSprites[i].SetTexture(MapFilenames[i][0], MapFilenames[i][1]); m_aMapSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER); } @@ -3653,6 +3677,71 @@ CMenuManager::LoadAllTextures() CTxdStore::PopCurrentTxd(); } +#ifdef GAMEPAD_MENU +const char* controllerTypesPaths[] = { + nil, + "MODELS/FRONTEND_DS3.TXD", + "MODELS/FRONTEND_DS4.TXD", + "MODELS/FRONTEND_X360.TXD", + "MODELS/FRONTEND_XONE.TXD", +}; + +void +CMenuManager::LoadController(int8 type) +{ + switch (type) + { + case CONTROLLER_DUALSHOCK2: + case CONTROLLER_DUALSHOCK3: + case CONTROLLER_DUALSHOCK4: + CFont::LoadButtons("MODELS/PS3BTNS.TXD"); + break; + default: + CFont::LoadButtons("MODELS/X360BTNS.TXD"); + break; + } + + // Unload current textures + for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++) + m_aFrontEndSprites[i].Delete(); + + // Unload txd + int frontend_controller = CTxdStore::FindTxdSlot("frontend_controller"); + if (frontend_controller != -1) + CTxdStore::RemoveTxd(frontend_controller); + + // Find the new txd to load + bool bTxdMissing = true; + if (controllerTypesPaths[type]) + if (int file = CFileMgr::OpenFile(controllerTypesPaths[type])) { + CFileMgr::CloseFile(file); + bTxdMissing = false; + } + + int txdSlot = -1; + + if (bTxdMissing) + // Not found, fall back to original textures + txdSlot = CTxdStore::FindTxdSlot("frontend"); + else { + // Found, load txd + txdSlot = frontend_controller; + if (txdSlot == -1) + txdSlot = CTxdStore::AddTxdSlot("frontend_controller"); + CTxdStore::LoadTxd(txdSlot, controllerTypesPaths[type]); + CTxdStore::AddRef(txdSlot); + } + + assert(txdSlot != -1); + // Load new textures + CTxdStore::SetCurrentTxd(txdSlot); + for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++) { + m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]); + m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER); + } +} +#endif // GAMEPAD_MENU + void CMenuManager::LoadSettings() { @@ -5262,6 +5351,17 @@ CMenuManager::ProcessButtonPresses(void) if (changeValueBy != 0) { switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) { +#ifdef FIX_BUGS + case MENUACTION_CTRLCONFIG: + CPad::GetPad(0)->Mode += changeValueBy; + if (CPad::GetPad(0)->Mode > 3) + CPad::GetPad(0)->Mode = 0; + else if (CPad::GetPad(0)->Mode < 0) + CPad::GetPad(0)->Mode = 3; + SaveSettings(); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); + break; +#endif case MENUACTION_RADIO: m_PrefsRadioStation += changeValueBy; DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); @@ -5400,13 +5500,18 @@ CMenuManager::ProcessOnOffMenuOptions() TimeToStopPadShaking = CTimer::GetTimeInMillisecondsPauseMode() + 500; } DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); +#ifdef FIX_BUGS + SaveSettings(); +#endif // !FIX_BUGS break; +#ifndef FIX_BUGS case MENUACTION_CTRLCONFIG: CPad::GetPad(0)->Mode++; if (CPad::GetPad(0)->Mode > 3) CPad::GetPad(0)->Mode = 0; DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); break; +#endif // !FIX_BUGS case MENUACTION_CTRLDISPLAY: m_DisplayControllerOnFoot = !m_DisplayControllerOnFoot; DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); @@ -5676,6 +5781,12 @@ CMenuManager::UnloadTextures() int frontend = CTxdStore::FindTxdSlot("frontend"); CTxdStore::RemoveTxd(frontend); +#ifdef GAMEPAD_MENU + int frontend_controllerTxdSlot = CTxdStore::FindTxdSlot("frontend_controller"); + if (frontend_controllerTxdSlot != -1) + CTxdStore::RemoveTxd(frontend_controllerTxdSlot); +#endif + printf("REMOVE menu textures\n"); for (int i = 0; i < ARRAY_SIZE(MenuFilenames); ++i) m_aMenuSprites[i].Delete(); @@ -5717,6 +5828,301 @@ CMenuManager::WaitForUserCD() } } +#ifdef GAMEPAD_MENU +void +CMenuManager::PrintController(void) +{ + const float scale = 0.9f; + const float CONTROLLER_SIZE_X = 235.2f; + const float CONTROLLER_SIZE_Y = 175.2f; + const float CONTROLLER_POS_X = (DEFAULT_SCREEN_WIDTH - CONTROLLER_SIZE_X) / 2.0f; + const float CONTROLLER_POS_Y = 160.0f; + + float centerX = CONTROLLER_POS_X + CONTROLLER_SIZE_X / 2; + float centerY = CONTROLLER_POS_Y + CONTROLLER_SIZE_Y / 2; + +#define X(f) ((f)*scale + centerX) +#define Y(f) ((f)*scale + centerY) + + m_aFrontEndSprites[FE_CONTROLLERSH].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X((CONTROLLER_SIZE_X + 4.8f) * scale), MENU_Y((CONTROLLER_SIZE_Y + 4.8f) * scale), CRGBA(0, 0, 0, 255)); + m_aFrontEndSprites[FE_CONTROLLER].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, 255)); + if (m_DisplayControllerOnFoot) { + if (CTimer::GetTimeInMillisecondsPauseMode() & 0x400) + m_aFrontEndSprites[FE_ARROWS1].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, 255)); + else + m_aFrontEndSprites[FE_ARROWS3].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, 255)); + } else { + if (CTimer::GetTimeInMillisecondsPauseMode() & 0x400) + m_aFrontEndSprites[FE_ARROWS2].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, 255)); + else + m_aFrontEndSprites[FE_ARROWS4].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, 255)); + } + + CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); + CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * scale), MENU_Y(SMALLESTTEXT_Y_SCALE * scale)); // X + + // CFont::SetColor(CRGBA(128, 128, 128, FadeIn(255))); + CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); + CFont::SetDropShadowPosition(1); + CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255))); + CFont::SetWrapx(SCREEN_WIDTH); + + float TEXT_L2_X = 50.0f + CONTROLLER_POS_X - centerX, TEXT_L2_Y = -14.0f + CONTROLLER_POS_Y - centerY; + float TEXT_L1_X = -4.0f + CONTROLLER_POS_X - centerX, TEXT_L1_Y = 25.0f + CONTROLLER_POS_Y - centerY, TEXT_L1_Y_VEH = 3.0f + TEXT_L1_Y; + float TEXT_DPAD_X = -4.0f + CONTROLLER_POS_X - centerX, TEXT_DPAD_Y = 65.0f + CONTROLLER_POS_Y - centerY; + float TEXT_LSTICK_X = -4.0f + CONTROLLER_POS_X - centerX, TEXT_LSTICK_Y = 97.0f + CONTROLLER_POS_Y - centerY; + float TEXT_SELECT_X = 103.0f + CONTROLLER_POS_X - centerX, TEXT_SELECT_Y = 141.0f + CONTROLLER_POS_Y - centerY; + float TEXT_START_X = 130.0f + CONTROLLER_POS_X - centerX, TEXT_START_Y = 128.0f + CONTROLLER_POS_Y - centerY; + float TEXT_R2_X = 184.0F + CONTROLLER_POS_X - centerX, TEXT_R2_Y = -14.0f + CONTROLLER_POS_Y - centerY; + float TEXT_R1_X = 238.0f + CONTROLLER_POS_X - centerX, TEXT_R1_Y = 25.0f + CONTROLLER_POS_Y - centerY; + + float TEXT_SQUARE_X = 144.0f + CONTROLLER_POS_X - centerX, TEXT_SQUARE_Y = 18.0f + CONTROLLER_POS_Y - centerY; + float TEXT_TRIANGLE_X = 238.0f + CONTROLLER_POS_X - centerX, TEXT_TRIANGLE_Y = 52.0f + CONTROLLER_POS_Y - centerY; + float TEXT_CIRCLE_X = 238.0f + CONTROLLER_POS_X - centerX, TEXT_CIRCLE_Y = 65.0f + CONTROLLER_POS_Y - centerY; + float TEXT_CROSS_X = 238.0f + CONTROLLER_POS_X - centerX, TEXT_CROSS_Y = 78.0f + CONTROLLER_POS_Y - centerY; + float TEXT_RSTICK_X = 238.0f + CONTROLLER_POS_X - centerX, TEXT_RSTICK_Y = 94.0f + CONTROLLER_POS_Y - centerY; + float TEXT_R3_X = 238.0f + CONTROLLER_POS_X - centerX, TEXT_R3_Y = 109.0f + CONTROLLER_POS_Y - centerY; + float TEXT_L3_X = 84.0f + CONTROLLER_POS_X - centerX, TEXT_L3_Y = 162.0f + CONTROLLER_POS_Y - centerY; + float TEXT_L2R2_X = 74.0f + CONTROLLER_POS_X - centerX, TEXT_L2R2_Y = -6.0f + CONTROLLER_POS_Y - centerY; + + switch (m_PrefsControllerType) + { + case CONTROLLER_DUALSHOCK4: + TEXT_L1_Y += 7.0f; + TEXT_L1_Y_VEH = TEXT_L1_Y; + TEXT_R1_Y += 7.0f; + TEXT_TRIANGLE_Y -= 1.0f; + TEXT_CIRCLE_Y -= 1.0f; + TEXT_CROSS_Y -= 1.0f; + TEXT_RSTICK_Y -= 4.0f; + TEXT_R3_Y -= 4.0f; + TEXT_DPAD_Y -= 1.0f; + TEXT_LSTICK_Y -= 6.0f; + TEXT_L3_X -= 2.0f; + break; + case CONTROLLER_XBOXONE: + TEXT_L2_X -= 2.0f; + TEXT_R2_X += 2.0f; + TEXT_L1_Y += 15.0f; + TEXT_L1_Y_VEH = TEXT_L1_Y; + TEXT_R1_Y += 15.0f; + TEXT_TRIANGLE_Y += 4.0f; + TEXT_CIRCLE_Y += 4.0f; + TEXT_CROSS_Y += 4.0f; + TEXT_RSTICK_Y += 1.0f; + TEXT_R3_Y += 1.0f; + TEXT_DPAD_Y += 29.0f; + TEXT_LSTICK_Y -= 22.0f; + TEXT_L3_X -= 36.0f; + TEXT_L2R2_Y += 5.0f; + TEXT_SELECT_X += 4.0f; + break; + case CONTROLLER_XBOX360: + TEXT_L2_X += 8.0f; + TEXT_R2_X -= 8.0f; + TEXT_L1_Y += 15.0f; + TEXT_L1_Y_VEH = TEXT_L1_Y; + TEXT_R1_Y += 15.0f; + TEXT_TRIANGLE_Y += 4.0f; + TEXT_CIRCLE_Y += 4.0f; + TEXT_CROSS_Y += 4.0f; + TEXT_RSTICK_Y += 4.0f; + TEXT_R3_Y += 4.0f; + TEXT_DPAD_Y += 30.0f; + TEXT_LSTICK_Y -= 21.0f; + TEXT_L3_X -= 36.0f; + TEXT_L2R2_Y += 5.0f; + TEXT_SELECT_X += 3.0f; + break; + }; + + if (m_DisplayControllerOnFoot) { + switch (CPad::GetPad(0)->Mode) { + case 0: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_LOF")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_MOV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_ENV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_ATT")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_RUN")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3")); + break; + case 1: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_LOF")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_NA")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_ENV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_ATT")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_RUN")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3")); + break; + case 2: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_ENV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_MOV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_LOF")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_RUN")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ATT")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3")); + break; + case 3: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_TAR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_NA")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_ATT")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_ENV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_LOF")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_RUN")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3")); + break; + default: + return; + } + } else { + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2R2_X)), MENU_Y(Y(TEXT_L2R2_Y)), TheText.Get("FEC_LB")); + switch (CPad::GetPad(0)->Mode) { + case 0: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_RSC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_VES")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_HO3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_HAB")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_BRA")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_EXV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_CAW")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ACC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_TUC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_SM3")); + break; + case 1: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_HOR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_NA")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_RSC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_HAB")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_BRA")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_EXV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_CAW")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ACC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_TUC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_SM3")); + break; + case 2: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_EXV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_VES")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_RS3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_HOR")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_BRA")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_HAB")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_CAW")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ACC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_TUC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_SM3")); + break; + case 3: + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_HAB")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_TUC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_HO3")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_CAW")); + CFont::SetRightJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_SMT")); + CFont::SetJustifyOn(); // X + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_EXV")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_RSC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_NA")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_ACC")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_BRA")); + break; + default: + return; + } + } + + CFont::SetDropShadowPosition(0); // X + +#undef X +#undef Y +} +#else void CMenuManager::PrintController(void) { @@ -5937,6 +6343,7 @@ CMenuManager::PrintController(void) CFont::SetDropShadowPosition(0); // X } +#endif #ifdef MENU_MAP diff --git a/src/core/Frontend.h b/src/core/Frontend.h index b0100fdc..5c3523ab 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -235,15 +235,15 @@ enum eMenuScreen MENUPAGE_KEYBOARD_CONTROLS = 55, MENUPAGE_MOUSE_CONTROLS = 56, MENUPAGE_MISSION_RETRY = 57, +#ifdef CUSTOM_FRONTEND_OPTIONS + #ifdef MENU_MAP MENUPAGE_MAP = 58, #endif -#ifdef CUSTOM_FRONTEND_OPTIONS - #ifdef GRAPHICS_MENU_OPTIONS MENUPAGE_GRAPHICS_SETTINGS, #endif -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU MENUPAGE_DETECT_JOYSTICK, #endif @@ -725,6 +725,19 @@ public: #define ISLAND_LOADING_ISNT(p) #endif +#ifdef GAMEPAD_MENU + enum + { + CONTROLLER_DUALSHOCK2 = 0, + CONTROLLER_DUALSHOCK3, + CONTROLLER_DUALSHOCK4, + CONTROLLER_XBOX360, + CONTROLLER_XBOXONE, + }; + + static int8 m_PrefsControllerType; +#endif + public: static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2); static void CentreMousePointer(); @@ -784,6 +797,9 @@ public: void PageDownList(bool); int8 GetPreviousPageOption(); void ProcessList(bool &goBack, bool &optionSelected); +#ifdef GAMEPAD_MENU + void LoadController(int8 type); +#endif }; #ifndef IMPROVED_VIDEOMODE diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 4fd30b53..2a6afa97 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -414,6 +414,11 @@ bool CGame::Initialise(const char* datFile) CTxdStore::Create(gameTxdSlot); CTxdStore::AddRef(gameTxdSlot); +#ifdef EXTENDED_PIPELINES + // for generic fallback + CustomPipes::SetTxdFindCallback(); +#endif + LoadingScreen("Loading the Game", "Loading particles", nil); int particleTxdSlot = CTxdStore::AddTxdSlot("particle"); CTxdStore::LoadTxd(particleTxdSlot, "MODELS/PARTICLE.TXD"); @@ -498,10 +503,6 @@ bool CGame::Initialise(const char* datFile) CFileLoader::LoadLevel("GTA3.DAT"); #endif -#ifdef EXTENDED_PIPELINES - // for generic fallback - CustomPipes::SetTxdFindCallback(); -#endif CWorld::AddParticles(); CVehicleModelInfo::LoadVehicleColours(); CVehicleModelInfo::LoadEnvironmentMaps(); diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp index 7c90ea12..3bd9adf4 100644 --- a/src/core/MenuScreens.cpp +++ b/src/core/MenuScreens.cpp @@ -394,9 +394,6 @@ CMenuScreen aScreens[MENUPAGES] = { { "FET_PAU", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, MENUACTION_RESUME, "FEM_RES", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_CHANGEMENU, "FEN_STA", SAVESLOT_NONE, MENUPAGE_NEW_GAME, -#ifdef MENU_MAP - MENUACTION_CHANGEMENU, "FEG_MAP", SAVESLOT_NONE, MENUPAGE_MAP, -#endif MENUACTION_CHANGEMENU, "FEP_STA", SAVESLOT_NONE, MENUPAGE_STATS, MENUACTION_CHANGEMENU, "FEP_BRI", SAVESLOT_NONE, MENUPAGE_BRIEFS, MENUACTION_CHANGEMENU, "FET_OPT", SAVESLOT_NONE, MENUPAGE_OPTIONS, @@ -441,14 +438,6 @@ CMenuScreen aScreens[MENUPAGES] = { }, #endif -#ifdef MENU_MAP - // MENUPAGE_MAP - { "FEG_MAP", 1, MENUPAGE_NONE, MENUPAGE_NONE, 2, 2, - MENUACTION_UNK110, "", SAVESLOT_NONE, MENUPAGE_NONE, // to prevent cross/enter to go back - MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, - }, -#endif - // MENUPAGE_UNK { "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0, diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp index 3eee8dd2..6e23f76a 100644 --- a/src/core/MenuScreensCustom.cpp +++ b/src/core/MenuScreensCustom.cpp @@ -1,4 +1,13 @@ #include "common.h" +#if defined DETECT_JOYSTICK_MENU && defined XINPUT +#include <windows.h> +#include <xinput.h> +#if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1) +#pragma comment( lib, "Xinput9_1_0.lib" ) +#else +#pragma comment( lib, "Xinput.lib" ) +#endif +#endif #include "platform.h" #include "crossplatform.h" #include "Renderer.h" @@ -74,6 +83,12 @@ #define INVERT_PAD_SELECTOR #endif +#ifdef GAMEPAD_MENU + #define SELECT_CONTROLLER_TYPE MENUACTION_CFO_SELECT, "FEC_TYP", { new CCFOSelect((int8*)&CMenuManager::m_PrefsControllerType, "Controller", "Type", controllerTypes, ARRAY_SIZE(controllerTypes), false, ControllerTypeAfterChange) }, +#else + #define SELECT_CONTROLLER_TYPE +#endif + const char *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" }; const char *off_on[] = { "FEM_OFF", "FEM_ON" }; @@ -180,38 +195,6 @@ void IslandLoadingAfterChange(int8 before, int8 after) { } #endif -#ifdef MORE_LANGUAGES -void LangPolSelect(int8 action) -{ - if (action == FEOPTION_ACTION_SELECT) { - FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH; - FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true; - FrontEndMenuManager.InitialiseChangedLanguageSettings(); - FrontEndMenuManager.SaveSettings(); - } -} - -void LangRusSelect(int8 action) -{ - if (action == FEOPTION_ACTION_SELECT) { - FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN; - FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true; - FrontEndMenuManager.InitialiseChangedLanguageSettings(); - FrontEndMenuManager.SaveSettings(); - } -} - -void LangJapSelect(int8 action) -{ - if (action == FEOPTION_ACTION_SELECT) { - FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE; - FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true; - FrontEndMenuManager.InitialiseChangedLanguageSettings(); - FrontEndMenuManager.SaveSettings(); - } -} -#endif - #ifndef MULTISAMPLING void GraphicsGoBack() { } @@ -291,11 +274,13 @@ void ScreenModeAfterChange(int8 before, int8 after) #endif -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU wchar selectedJoystickUnicode[128]; int cachedButtonNum = -1; wchar* DetectJoystickDraw(bool* disabled, bool userHovering) { + +#if defined RW_GL3 && !defined LIBRW_SDL2 int numButtons; int found = -1; const char *joyname; @@ -326,6 +311,37 @@ wchar* DetectJoystickDraw(bool* disabled, bool userHovering) { } } if (PSGLOBAL(joy1id) == -1) +#elif defined XINPUT + int found = -1; + XINPUT_STATE xstate; + memset(&xstate, 0, sizeof(XINPUT_STATE)); + if (userHovering) { + for (int i = 0; i <= 3; i++) { + if (XInputGetState(i, &xstate) == ERROR_SUCCESS) { + if (xstate.Gamepad.bLeftTrigger || xstate.Gamepad.bRightTrigger) { + found = i; + break; + } + for (int j = XINPUT_GAMEPAD_DPAD_UP; j != XINPUT_GAMEPAD_Y << 1; j = (j << 1)) { + if (xstate.Gamepad.wButtons & j) { + found = i; + break; + } + } + if (found != -1) + break; + } + } + if (found != -1 && CPad::XInputJoy1 != found) { + // We should never leave pads -1, so we can process them when they're connected and kinda support hotplug. + CPad::XInputJoy2 = (CPad::XInputJoy1 == -1 ? (found + 1) % 4 : CPad::XInputJoy1); + CPad::XInputJoy1 = found; + cachedButtonNum = 0; // fake too, because xinput bypass CControllerConfig + } + } + sprintf(gSelectedJoystickName, "%d", CPad::XInputJoy1); // fake, on xinput we only store gamepad ids(thanks MS) so this is a temp variable to be used below + if (CPad::XInputJoy1 == -1) +#endif AsciiToUnicode("Not found", selectedJoystickUnicode); else AsciiToUnicode(gSelectedJoystickName, selectedJoystickUnicode); @@ -346,6 +362,14 @@ void DetectJoystickGoBack() { } #endif +#ifdef GAMEPAD_MENU +const char* controllerTypes[] = { "FEC_DS2", "FEC_DS3", "FEC_DS4", "FEC_360", "FEC_ONE" }; +void ControllerTypeAfterChange(int8 before, int8 after) +{ + FrontEndMenuManager.LoadController(after); +} +#endif + CMenuScreenCustom aScreens[MENUPAGES] = { // MENUPAGE_NONE = 0 { "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, nil, nil, }, @@ -369,10 +393,16 @@ CMenuScreenCustom aScreens[MENUPAGES] = { }, // MENUPAGE_CONTROLLER_SETTINGS = 4 +#ifdef GAMEPAD_MENU + { "FET_AGS", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, nil, nil, +#else { "FET_CON", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, nil, nil, +#endif MENUACTION_CTRLCONFIG, "FEC_CCF", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, MENUACTION_CTRLDISPLAY, "FEC_CDP", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, + INVERT_PAD_SELECTOR MENUACTION_CTRLVIBRATION, "FEC_VIB", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, + SELECT_CONTROLLER_TYPE MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, }, @@ -432,11 +462,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { MENUACTION_LANG_GER, "FEL_GER", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS }, MENUACTION_LANG_ITA, "FEL_ITA", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS }, MENUACTION_LANG_SPA, "FEL_SPA", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS }, -#ifdef MORE_LANGUAGES - MENUACTION_CFO_DYNAMIC, "FEL_POL", { new CCFODynamic(nil, nil, nil, nil, LangPolSelect) }, - MENUACTION_CFO_DYNAMIC, "FEL_RUS", { new CCFODynamic(nil, nil, nil, nil, LangRusSelect) }, - MENUACTION_CFO_DYNAMIC, "FEL_JAP", { new CCFODynamic(nil, nil, nil, nil, LangJapSelect) }, -#endif + // CustomFrontendOptionsPopulate will add languages here, if files are found MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, }, @@ -643,7 +669,10 @@ CMenuScreenCustom aScreens[MENUPAGES] = { MENUACTION_CTRLMETHOD, "FET_CME", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC }, #endif MENUACTION_KEYBOARDCTRLS,"FET_RDK", { nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS }, -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef GAMEPAD_MENU + MENUACTION_CHANGEMENU, "FET_AGS", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, +#endif +#ifdef DETECT_JOYSTICK_MENU MENUACTION_CHANGEMENU, "FEC_JOD", { nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK }, #endif MENUACTION_CHANGEMENU, "FET_AMS", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS }, @@ -699,7 +728,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { MENUACTION_LOADRADIO, "FET_AUD", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, MENUACTION_CHANGEMENU, "FET_DIS", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS }, #ifdef GRAPHICS_MENU_OPTIONS - MENUACTION_CHANGEMENU, "FET_GRA", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, + MENUACTION_CHANGEMENU, "FET_GFX", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, #endif MENUACTION_CHANGEMENU, "FET_LAN", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS }, MENUACTION_PLAYERSETUP, "FET_PSU", { nil, SAVESLOT_NONE, MENUPAGE_SKIN_SELECT }, @@ -768,9 +797,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { { "FET_PAU", MENUPAGE_DISABLED, MENUPAGE_DISABLED, nil, nil, MENUACTION_RESUME, "FEM_RES", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, MENUACTION_CHANGEMENU, "FEN_STA", { nil, SAVESLOT_NONE, MENUPAGE_NEW_GAME }, -#ifdef MENU_MAP - MENUACTION_CHANGEMENU, "FEG_MAP", { nil, SAVESLOT_NONE, MENUPAGE_MAP }, -#endif + // CMenuManager::LoadAllTextures will add map here, if MENU_MAP enabled and map textures are found MENUACTION_CHANGEMENU, "FEP_STA", { nil, SAVESLOT_NONE, MENUPAGE_STATS }, MENUACTION_CHANGEMENU, "FEP_BRI", { nil, SAVESLOT_NONE, MENUPAGE_BRIEFS }, MENUACTION_CHANGEMENU, "FET_OPT", { nil, SAVESLOT_NONE, MENUPAGE_OPTIONS }, @@ -798,7 +825,9 @@ CMenuScreenCustom aScreens[MENUPAGES] = { { "FET_MTI", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, nil, nil, MENUACTION_MOUSESENS, "FEC_MSH", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS }, MENUACTION_INVVERT, "FEC_IVV", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS }, +#ifndef GAMEPAD_MENU INVERT_PAD_SELECTOR +#endif MENUACTION_MOUSESTEER, "FET_MST", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS }, MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, }, @@ -826,7 +855,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { #ifdef GRAPHICS_MENU_OPTIONS // MENUPAGE_GRAPHICS_SETTINGS - { "FET_GRA", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, + { "FET_GFX", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, new CCustomScreenLayout({MENUSPRITE_MAINMENU, 50, 0, 20, FONT_HEADING, FESCREEN_LEFT_ALIGN, true, MEDIUMTEXT_X_SCALE, MEDIUMTEXT_Y_SCALE}), GraphicsGoBack, MENUACTION_SCREENRES, "FED_RES", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, @@ -848,7 +877,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { }, #endif -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU // MENUPAGE_DETECT_JOYSTICK { "FEC_JOD", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, new CCustomScreenLayout({MENUSPRITE_MAINMENU, 40, 60, 20, FONT_BANK, FESCREEN_LEFT_ALIGN, false, MEDIUMTEXT_X_SCALE, MEDIUMTEXT_Y_SCALE}), DetectJoystickGoBack, diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 95a107ee..60bb7a76 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -1028,8 +1028,14 @@ void CPad::AddToPCCheatString(char c) } #ifdef XINPUT +int CPad::XInputJoy1 = 0; +int CPad::XInputJoy2 = 1; void CPad::AffectFromXinput(uint32 pad) { + pad = pad == 0 ? XInputJoy1 : XInputJoy2; + if (pad == -1) // LoadINIControllerSettings can set it to -1 + return; + XINPUT_STATE xstate; memset(&xstate, 0, sizeof(XINPUT_STATE)); if (XInputGetState(pad, &xstate) == ERROR_SUCCESS) @@ -2336,6 +2342,121 @@ bool CPad::ShiftTargetRightJustDown(void) return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); } +#ifdef FIX_BUGS +// FIX: fixes from VC for the bug of double switching the controller setup +bool CPad::GetAnaloguePadUp(void) +{ + static int16 oldfStickY = 0; + + int16 leftStickY = CPad::GetPad(0)->GetLeftStickY(); + + if ( leftStickY < -15 && oldfStickY >= -5 ) + { + oldfStickY = leftStickY; + return true; + } + else + { + oldfStickY = leftStickY; + return false; + } +} + +bool CPad::GetAnaloguePadDown(void) +{ + static int16 oldfStickY = 0; + + int16 leftStickY = CPad::GetPad(0)->GetLeftStickY(); + + if ( leftStickY > 15 && oldfStickY <= 5 ) + { + oldfStickY = leftStickY; + return true; + } + else + { + oldfStickY = leftStickY; + return false; + } +} + +bool CPad::GetAnaloguePadLeft(void) +{ + static int16 oldfStickX = 0; + + int16 leftStickX = CPad::GetPad(0)->GetLeftStickX(); + + if ( leftStickX < -15 && oldfStickX >= -5 ) + { + oldfStickX = leftStickX; + return true; + } + else + { + oldfStickX = leftStickX; + return false; + } +} + +bool CPad::GetAnaloguePadRight(void) +{ + static int16 oldfStickX = 0; + + int16 leftStickX = CPad::GetPad(0)->GetLeftStickX(); + + if ( leftStickX > 15 && oldfStickX <= 5 ) + { + oldfStickX = leftStickX; + return true; + } + else + { + oldfStickX = leftStickX; + return false; + } +} + +bool CPad::GetAnaloguePadLeftJustUp(void) +{ + static int16 oldfStickX = 0; + + int16 X = GetPad(0)->GetPedWalkLeftRight(); + + if ( X == 0 && oldfStickX < 0 ) + { + oldfStickX = 0; + + return true; + } + else + { + oldfStickX = X; + + return false; + } +} + +bool CPad::GetAnaloguePadRightJustUp(void) +{ + static int16 oldfStickX = 0; + + int16 X = GetPad(0)->GetPedWalkLeftRight(); + + if ( X == 0 && oldfStickX > 0 ) + { + oldfStickX = 0; + + return true; + } + else + { + oldfStickX = X; + + return false; + } +} + +#else bool CPad::GetAnaloguePadUp(void) { static int16 oldfStickY = 0; @@ -2447,6 +2568,7 @@ bool CPad::GetAnaloguePadRightJustUp(void) return false; } } +#endif bool CPad::ForceCameraBehindPlayer(void) { diff --git a/src/core/Pad.h b/src/core/Pad.h index 20a676ef..b37659cd 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -263,6 +263,8 @@ public: static int32 *EditCodesForControls(int32 *pRsKeys, int32 nSize); #ifdef XINPUT + static int XInputJoy1; + static int XInputJoy2; void AffectFromXinput(uint32 pad); #endif diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index 1af8f924..bd6feeed 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -155,8 +155,8 @@ CPlayerInfo::Process(void) m_pPed->SetPedState(PED_IDLE); m_pPed->SetMoveState(PEDMOVE_STILL); CPed::PedSetOutCarCB(0, m_pPed); - CAnimManager::BlendAnimation(m_pPed->GetClump(), m_pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f); - CAnimManager::BlendAnimation(m_pPed->GetClump(), ASSOCGRP_STD, ANIM_FALL_LAND, 100.0f); + CAnimManager::BlendAnimation(m_pPed->GetClump(), m_pPed->m_animGroup, ANIM_STD_IDLE, 100.0f); + CAnimManager::BlendAnimation(m_pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_LAND, 100.0f); m_pPed->SetPosition(sth); m_pPed->SetMoveState(PEDMOVE_STILL); m_pPed->m_vecMoveSpeed = veh->m_vecMoveSpeed; diff --git a/src/core/World.cpp b/src/core/World.cpp index 0874b680..90d73b09 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -2123,7 +2123,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa PEDPIECE_TORSO, direction); if(pPed->m_nPedState != PED_DIE) pPed->SetFall(2000, - (AnimationId)(direction + ANIM_KO_SKID_FRONT), 0); + (AnimationId)(direction + ANIM_STD_HIGHIMPACT_FRONT), 0); if(pCreator && pCreator->IsPed()) { eEventType eventType = EVENT_SHOOT_PED; if(pPed->m_nPedType == PEDTYPE_COP) eventType = EVENT_SHOOT_COP; diff --git a/src/core/common.h b/src/core/common.h index 33d8910d..a8f19158 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -354,7 +354,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function #ifndef MASTER #define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) #else -#define assert(_Expression) +#define assert(_Expression) (_Expression) #endif #define ASSERT assert diff --git a/src/core/config.h b/src/core/config.h index bb1ca5e3..6619be68 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -183,7 +183,11 @@ enum Config { // those infamous texts #define DRAW_GAME_VERSION_TEXT -#define DRAW_MENU_VERSION_TEXT +#ifdef DRAW_GAME_VERSION_TEXT + // unlike R* development builds, ours has runtime switch on debug menu & .ini, and disabled as default. + #define USE_OUR_VERSIONING // If you disable this then game will fetch version from peds.col, as R* did while in development +#endif +//#define DRAW_MENU_VERSION_TEXT // Memory allocation and compression // #define USE_CUSTOM_ALLOCATOR // use CMemoryHeap for allocation. use with care, not finished yet @@ -263,6 +267,10 @@ enum Config { #define PS2_ALPHA_TEST // emulate ps2 alpha test #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time +#ifdef DISABLE_LOADING_SCREEN +// enable the PC splash +#undef RANDOMSPLASH +#endif #define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync #define ANISOTROPIC_FILTERING // set all textures to max anisotropic filtering //#define USE_TEXTURE_POOL @@ -287,8 +295,8 @@ enum Config { #if !defined(RW_GL3) && defined(_WIN32) #define XINPUT #endif -#if !defined(_WIN32) && !defined(__SWITCH__) -#define DONT_TRUST_RECOGNIZED_JOYSTICKS // Then we'll only rely on GLFW gamepad DB, and expect user to enter Controller->Detect joysticks if his joystick isn't on that list. +#if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !defined __SWITCH__) +#define DETECT_JOYSTICK_MENU // Then we'll expect user to enter Controller->Detect joysticks if his joystick isn't detected at the start. #endif #define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m #define KANGAROO_CHEAT @@ -312,7 +320,11 @@ enum Config { # define PS2_MENU //# define PS2_MENU_USEALLPAGEICONS #else -# define MENU_MAP // VC-like menu map. Make sure you have new menu.txd + +# ifdef XINPUT +# define GAMEPAD_MENU // Add gamepad menu +# endif + # define SCROLLABLE_STATS_PAGE // only draggable by mouse atm # define TRIANGLE_BACK_BUTTON //# define CIRCLE_BACK_BUTTON @@ -321,6 +333,7 @@ enum Config { # define CUSTOM_FRONTEND_OPTIONS # ifdef CUSTOM_FRONTEND_OPTIONS +# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd # define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable # define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU # define CUTSCENE_BORDERS_SWITCH @@ -340,6 +353,10 @@ enum Config { #define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log +#if SCRIPT_LOG_FILE_LEVEL == 0 +#undef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT +#endif + #ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define USE_BASIC_SCRIPT_DEBUG_OUTPUT #endif @@ -468,6 +485,7 @@ enum Config { #undef RADIO_OFF_TEXT #undef MENU_MAP +#undef GAMEPAD_MENU #undef SCROLLABLE_STATS_PAGE #undef CUSTOM_FRONTEND_OPTIONS diff --git a/src/core/main.cpp b/src/core/main.cpp index af0d556a..b47f5d37 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,8 +1,10 @@ #include "common.h" +#include <time.h> #include "rpmatfx.h" #include "rphanim.h" #include "rpskin.h" #include "rtbmp.h" +#include "rtpng.h" #ifdef ANISOTROPIC_FILTERING #include "rpanisot.h" #endif @@ -70,6 +72,9 @@ #include "custompipes.h" #include "screendroplets.h" #include "MemoryHeap.h" +#ifdef USE_OUR_VERSIONING +#include "GitSHA1.h" +#endif GlobalScene Scene; @@ -86,6 +91,9 @@ bool gbModelViewer; #ifdef TIMEBARS bool gbShowTimebars; #endif +#ifdef DRAW_GAME_VERSION_TEXT +bool gDrawVersionText; // Our addition, we think it was always enabled on !MASTER builds +#endif volatile int32 frameCount; @@ -354,7 +362,11 @@ RwGrabScreen(RwCamera *camera, RwChar *filename) strcpy(temp, CFileMgr::GetRootDirName()); strcat(temp, filename); +#ifndef LIBRW if (RtBMPImageWrite(pImage, &temp[0]) == nil) +#else + if (RtPNGImageWrite(pImage, &temp[0]) == nil) +#endif result = false; RwImageDestroy(pImage); return result; @@ -373,6 +385,7 @@ DoRWStuffEndOfFrame(void) RsCameraShowRaster(Scene.camera); #ifndef MASTER char s[48]; +#ifdef THIS_IS_STUPID if (CPad::GetPad(1)->GetLeftShockJustDown()) { // try using both controllers for this thing... crazy bastards if (CPad::GetPad(0)->GetRightStickY() > 0) { @@ -384,6 +397,12 @@ DoRWStuffEndOfFrame(void) RwGrabScreen(Scene.camera, s); } } +#else + if (CPad::GetPad(1)->GetLeftShockJustDown() || CPad::GetPad(0)->GetFJustDown(11)) { + sprintf(s, "screen_%11lld.png", time(nil)); + RwGrabScreen(Scene.camera, s); + } +#endif #endif // !MASTER } @@ -1075,7 +1094,7 @@ DisplayGameDebugText() static bool bDisplayRate = false; #ifndef FINAL { - SETTWEAKPATH("GameDebugText"); + SETTWEAKPATH("Debug"); TWEAKBOOL(bDisplayPosn); TWEAKBOOL(bDisplayRate); } @@ -1089,13 +1108,56 @@ DisplayGameDebugText() #ifdef DRAW_GAME_VERSION_TEXT wchar ver[200]; - + + if(gDrawVersionText) // This realtime switch is our thing + { + +#ifdef USE_OUR_VERSIONING + char verA[200]; + sprintf(verA, +#if defined _WIN32 + "Win " +#elif defined __linux__ + "Linux " +#elif defined __APPLE__ + "Mac OS X " +#elif defined __FreeBSD__ + "FreeBSD " +#else + "Posix-compliant " +#endif +#if defined __LP64__ || defined _WIN64 + "64-bit " +#else + "32-bit " +#endif +#if defined RW_D3D9 + "D3D9 " +#elif defined RWLIBS + "D3D8 " +#elif defined RW_GL3 + "OpenGL " +#endif +#if defined AUDIO_OAL + "OAL " +#elif defined AUDIO_MSS + "MSS " +#endif +#if defined _DEBUG || defined DEBUG + "DEBUG " +#endif + "%.8s", + g_GIT_SHA1); + AsciiToUnicode(verA, ver); + CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.7f)); +#else AsciiToUnicode(version_name, ver); + CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f)); +#endif CFont::SetPropOn(); CFont::SetBackgroundOff(); CFont::SetFontStyle(FONT_BANK); - CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f)); CFont::SetCentreOff(); CFont::SetRightJustifyOff(); CFont::SetWrapx(SCREEN_WIDTH); @@ -1107,6 +1169,7 @@ DisplayGameDebugText() #else CFont::PrintString(10.0f, 10.0f, ver); #endif + } #endif // #ifdef DRAW_GAME_VERSION_TEXT FrameSamples++; diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 37b2cdf0..e0f9c5c2 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -1,6 +1,14 @@ #include <csignal> #define WITHWINDOWS #include "common.h" +#if defined DETECT_JOYSTICK_MENU && defined XINPUT +#include <xinput.h> +#if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1) +#pragma comment( lib, "Xinput9_1_0.lib" ) +#else +#pragma comment( lib, "Xinput.lib" ) +#endif +#endif #include "Renderer.h" #include "Credits.h" #include "Camera.h" @@ -34,7 +42,7 @@ #include "MBlur.h" #include "ControllerConfig.h" -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU #include "crossplatform.h" #endif @@ -77,16 +85,49 @@ mysrand(unsigned int seed) #ifdef CUSTOM_FRONTEND_OPTIONS #include "frontendoption.h" +#ifdef MORE_LANGUAGES +void LangPolSelect(int8 action) +{ + if (action == FEOPTION_ACTION_SELECT) { + FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH; + FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true; + FrontEndMenuManager.InitialiseChangedLanguageSettings(); + FrontEndMenuManager.SaveSettings(); + } +} + +void LangRusSelect(int8 action) +{ + if (action == FEOPTION_ACTION_SELECT) { + FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN; + FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true; + FrontEndMenuManager.InitialiseChangedLanguageSettings(); + FrontEndMenuManager.SaveSettings(); + } +} + +void LangJapSelect(int8 action) +{ + if (action == FEOPTION_ACTION_SELECT) { + FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE; + FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true; + FrontEndMenuManager.InitialiseChangedLanguageSettings(); + FrontEndMenuManager.SaveSettings(); + } +} +#endif + void CustomFrontendOptionsPopulate(void) { - // Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h + // Most of custom options are done statically in MenuScreensCustom.cpp, we add them here only if they're dependent to extra files - // These work only if we have neo folder, so they're dynamically added + // These work only if we have neo folder + int fd; #ifdef EXTENDED_PIPELINES const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" }; const char *off_on[] = { "FEM_OFF", "FEM_ON" }; - int fd = CFileMgr::OpenFile("neo/neo.txd","r"); + fd = CFileMgr::OpenFile("neo/neo.txd","r"); if (fd) { #ifdef GRAPHICS_MENU_OPTIONS FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false); @@ -105,6 +146,35 @@ CustomFrontendOptionsPopulate(void) } #endif + // Add outsourced language translations, if files are found +#ifdef MORE_LANGUAGES + int fd2; + FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, 5, false); + if (fd = CFileMgr::OpenFile("text/polish.gxt","r")) { + if (fd2 = CFileMgr::OpenFile("models/fonts_p.txd","r")) { + FrontendOptionAddDynamic("FEL_POL", nil, nil, LangPolSelect, nil, nil); + CFileMgr::CloseFile(fd2); + } + CFileMgr::CloseFile(fd); + } + + if (fd = CFileMgr::OpenFile("text/russian.gxt","r")) { + if (fd2 = CFileMgr::OpenFile("models/fonts_r.txd","r")) { + FrontendOptionAddDynamic("FEL_RUS", nil, nil, LangRusSelect, nil, nil); + CFileMgr::CloseFile(fd2); + } + CFileMgr::CloseFile(fd); + } + + if (fd = CFileMgr::OpenFile("text/japanese.gxt","r")) { + if (fd2 = CFileMgr::OpenFile("models/fonts_j.txd","r")) { + FrontendOptionAddDynamic("FEL_JAP", nil, nil, LangJapSelect, nil, nil); + CFileMgr::CloseFile(fd2); + } + CFileMgr::CloseFile(fd); + } +#endif + } #endif @@ -244,9 +314,41 @@ const char *iniKeyboardButtons[] = {"ESC","F1","F2","F3","F4","F5","F6","F7","F8 void LoadINIControllerSettings() { -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU +#ifdef XINPUT + int storedJoy1 = -1; + if (ReadIniIfExists("Controller", "JoystickName", &storedJoy1)) { + CPad::XInputJoy1 = -1; + CPad::XInputJoy2 = -1; + XINPUT_STATE xstate; + memset(&xstate, 0, sizeof(XINPUT_STATE)); + + // Firstly confirm & set joy 1 + if (XInputGetState(storedJoy1, &xstate) == ERROR_SUCCESS) { + CPad::XInputJoy1 = storedJoy1; + } + + for (int i = 0; i <= 3; i++) { + if (XInputGetState(i, &xstate) == ERROR_SUCCESS) { + if (CPad::XInputJoy1 == -1) + CPad::XInputJoy1 = i; + else if (CPad::XInputJoy2 == -1 && i != CPad::XInputJoy1) + CPad::XInputJoy2 = i; + } + } + + // There is no plug event on XInput, so let's leave XInputJoy1/2 as 0/1 respectively, and hotplug will be possible. + if (CPad::XInputJoy1 == -1) { + CPad::XInputJoy1 = 0; + CPad::XInputJoy2 = 1; + } else if (CPad::XInputJoy2 == -1) { + CPad::XInputJoy2 = (CPad::XInputJoy1 + 1) % 4; + } + } +#else ReadIniIfExists("Controller", "JoystickName", gSelectedJoystickName, 128); #endif +#endif // force to default GTA behaviour (never overwrite bindings on joy change/initialization) if user init'ed/set bindings before we introduced that if (!ReadIniIfExists("Controller", "PadButtonsInited", &ControlsManager.ms_padButtonsInited)) { ControlsManager.ms_padButtonsInited = cfg.category_size("Bindings") != 0 ? 16 : 0; @@ -343,9 +445,13 @@ void SaveINIControllerSettings() StoreIni("Bindings", iniControllerActions[i], value, 128); } -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU +#ifdef XINPUT + StoreIni("Controller", "JoystickName", CPad::XInputJoy1); +#else StoreIni("Controller", "JoystickName", gSelectedJoystickName, 128); #endif +#endif StoreIni("Controller", "PadButtonsInited", ControlsManager.ms_padButtonsInited); cfg.write_file("re3.ini"); } @@ -369,6 +475,7 @@ bool LoadINISettings() ReadIniIfExists("Controller", "HorizantalMouseSens", &TheCamera.m_fMouseAccelHorzntl); ReadIniIfExists("Controller", "InvertMouseVertically", &MousePointerStateHelper.bInvertVertically); ReadIniIfExists("Controller", "DisableMouseSteering", &CVehicle::m_bDisableMouseSteering); + ReadIniIfExists("Controller", "Vibration", &FrontEndMenuManager.m_PrefsUseVibration); ReadIniIfExists("Audio", "SfxVolume", &FrontEndMenuManager.m_PrefsSfxVolume); ReadIniIfExists("Audio", "MusicVolume", &FrontEndMenuManager.m_PrefsMusicVolume); ReadIniIfExists("Audio", "Radio", &FrontEndMenuManager.m_PrefsRadioStation); @@ -409,6 +516,10 @@ bool LoadINISettings() #ifdef FIX_SPRITES ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites); #endif +#ifdef DRAW_GAME_VERSION_TEXT + extern bool gDrawVersionText; + ReadIniIfExists("General", "DrawVersionText", &gDrawVersionText); +#endif #ifdef CUSTOM_FRONTEND_OPTIONS bool migrate = cfg.category_size("FrontendOptions") != 0; @@ -455,6 +566,7 @@ void SaveINISettings() StoreIni("Controller", "HorizantalMouseSens", TheCamera.m_fMouseAccelHorzntl); StoreIni("Controller", "InvertMouseVertically", MousePointerStateHelper.bInvertVertically); StoreIni("Controller", "DisableMouseSteering", CVehicle::m_bDisableMouseSteering); + StoreIni("Controller", "Vibration", FrontEndMenuManager.m_PrefsUseVibration); StoreIni("Audio", "SfxVolume", FrontEndMenuManager.m_PrefsSfxVolume); StoreIni("Audio", "MusicVolume", FrontEndMenuManager.m_PrefsMusicVolume); StoreIni("Audio", "Radio", FrontEndMenuManager.m_PrefsRadioStation); @@ -495,6 +607,10 @@ void SaveINISettings() #ifdef FIX_SPRITES StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites); #endif +#ifdef DRAW_GAME_VERSION_TEXT + extern bool gDrawVersionText; + StoreIni("General", "DrawVersionText", gDrawVersionText); +#endif #ifdef CUSTOM_FRONTEND_OPTIONS for (int i = 0; i < MENUPAGES; i++) { for (int j = 0; j < NUM_MENUROWS; j++) { @@ -617,18 +733,6 @@ SwitchCarCollision(void) FindPlayerVehicle()->bUsesCollision = !FindPlayerVehicle()->bUsesCollision; } -static int engineStatus; -static void -SetEngineStatus(void) -{ - CVehicle *veh = FindPlayerVehicle(); - if(veh == nil) - return; - if(!veh->IsCar()) - return; - ((CAutomobile*)veh)->Damage.SetEngineStatus(engineStatus); -} - static void ToggleComedy(void) { @@ -690,7 +794,7 @@ void CTweakVars::Add(CTweakVar *var) TweakVarsListSize = 0; } if(TweakVarsListSize > 63) - TweakVarsList = (CTweakVar**) realloc(TweakVarsList, (TweakVarsListSize + 1) * sizeof(*var)); + TweakVarsList = (CTweakVar**) realloc(TweakVarsList, (TweakVarsListSize + 1) * sizeof(CTweakVar*)); TweakVarsList[TweakVarsListSize++] = var; // TweakVarsList.push_back(var); @@ -811,12 +915,22 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); }); DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil); + +#ifdef PROPER_SCALING + DebugMenuAddVarBool8("Render", "Proper Scaling", &CDraw::ms_bProperScaling, nil); +#endif +#ifdef FIX_RADAR + DebugMenuAddVarBool8("Render", "Fix Radar", &CDraw::ms_bFixRadar, nil); +#endif +#ifdef FIX_SPRITES + DebugMenuAddVarBool8("Render", "Fix Sprites", &CDraw::ms_bFixSprites, nil); +#endif DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil); DebugMenuAddVarBool8("Render", "Frame limiter", &FrontEndMenuManager.m_PrefsFrameLimiter, nil); DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil); DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil); #ifdef NEW_RENDERER - DebugMenuAddVarBool8("Render", "new renderer", &gbNewRenderer, nil); + DebugMenuAddVarBool8("Render", "New Renderer", &gbNewRenderer, nil); extern bool gbRenderRoads; extern bool gbRenderEverythingBarRoads; //extern bool gbRenderFadingInUnderwaterEntities; @@ -827,16 +941,16 @@ extern bool gbRenderVehicles; extern bool gbRenderWorld0; extern bool gbRenderWorld1; extern bool gbRenderWorld2; - DebugMenuAddVarBool8("Render", "gbRenderRoads", &gbRenderRoads, nil); - DebugMenuAddVarBool8("Render", "gbRenderEverythingBarRoads", &gbRenderEverythingBarRoads, nil); -// DebugMenuAddVarBool8("Render", "gbRenderFadingInUnderwaterEntities", &gbRenderFadingInUnderwaterEntities, nil); - DebugMenuAddVarBool8("Render", "gbRenderFadingInEntities", &gbRenderFadingInEntities, nil); - DebugMenuAddVarBool8("Render", "gbRenderWater", &gbRenderWater, nil); - DebugMenuAddVarBool8("Render", "gbRenderBoats", &gbRenderBoats, nil); - DebugMenuAddVarBool8("Render", "gbRenderVehicles", &gbRenderVehicles, nil); - DebugMenuAddVarBool8("Render", "gbRenderWorld0", &gbRenderWorld0, nil); - DebugMenuAddVarBool8("Render", "gbRenderWorld1", &gbRenderWorld1, nil); - DebugMenuAddVarBool8("Render", "gbRenderWorld2", &gbRenderWorld2, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderRoads", &gbRenderRoads, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderEverythingBarRoads", &gbRenderEverythingBarRoads, nil); +// DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInUnderwaterEntities", &gbRenderFadingInUnderwaterEntities, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInEntities", &gbRenderFadingInEntities, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderWater", &gbRenderWater, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderBoats", &gbRenderBoats, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderVehicles", &gbRenderVehicles, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderWorld0", &gbRenderWorld0, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderWorld1", &gbRenderWorld1, nil); + DebugMenuAddVarBool8("Debug Render", "gbRenderWorld2", &gbRenderWorld2, nil); #endif #ifdef EXTENDED_COLOURFILTER @@ -860,32 +974,29 @@ extern bool gbRenderWorld2; DebugMenuAddVarBool8("Render", "Neo Road Gloss enable", &CustomPipes::GlossEnable, nil); DebugMenuAddVar("Render", "Mult", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f); #endif - DebugMenuAddVarBool8("Render", "Show Ped Paths", &gbShowPedPaths, nil); - DebugMenuAddVarBool8("Render", "Show Car Paths", &gbShowCarPaths, nil); - DebugMenuAddVarBool8("Render", "Show Car Path Links", &gbShowCarPathsLinks, nil); - DebugMenuAddVarBool8("Render", "Show Ped Road Groups", &gbShowPedRoadGroups, nil); - DebugMenuAddVarBool8("Render", "Show Car Road Groups", &gbShowCarRoadGroups, nil); - DebugMenuAddVarBool8("Render", "Show Collision Lines", &gbShowCollisionLines, nil); - DebugMenuAddVarBool8("Render", "Show Collision Polys", &gbShowCollisionPolys, nil); - DebugMenuAddVarBool8("Render", "Don't render Buildings", &gbDontRenderBuildings, nil); - DebugMenuAddVarBool8("Render", "Don't render Big Buildings", &gbDontRenderBigBuildings, nil); - DebugMenuAddVarBool8("Render", "Don't render Peds", &gbDontRenderPeds, nil); - DebugMenuAddVarBool8("Render", "Don't render Vehicles", &gbDontRenderVehicles, nil); - DebugMenuAddVarBool8("Render", "Don't render Objects", &gbDontRenderObjects, nil); - DebugMenuAddVarBool8("Render", "Don't Render Water", &gbDontRenderWater, nil); + DebugMenuAddVarBool8("Debug Render", "Show Ped Paths", &gbShowPedPaths, nil); + DebugMenuAddVarBool8("Debug Render", "Show Car Paths", &gbShowCarPaths, nil); + DebugMenuAddVarBool8("Debug Render", "Show Car Path Links", &gbShowCarPathsLinks, nil); + DebugMenuAddVarBool8("Debug Render", "Show Ped Road Groups", &gbShowPedRoadGroups, nil); + DebugMenuAddVarBool8("Debug Render", "Show Car Road Groups", &gbShowCarRoadGroups, nil); + DebugMenuAddVarBool8("Debug Render", "Show Collision Lines", &gbShowCollisionLines, nil); + DebugMenuAddVarBool8("Debug Render", "Show Collision Polys", &gbShowCollisionPolys, nil); + DebugMenuAddVarBool8("Debug Render", "Don't render Buildings", &gbDontRenderBuildings, nil); + DebugMenuAddVarBool8("Debug Render", "Don't render Big Buildings", &gbDontRenderBigBuildings, nil); + DebugMenuAddVarBool8("Debug Render", "Don't render Peds", &gbDontRenderPeds, nil); + DebugMenuAddVarBool8("Debug Render", "Don't render Vehicles", &gbDontRenderVehicles, nil); + DebugMenuAddVarBool8("Debug Render", "Don't render Objects", &gbDontRenderObjects, nil); + DebugMenuAddVarBool8("Debug Render", "Don't Render Water", &gbDontRenderWater, nil); + -#ifdef PROPER_SCALING - DebugMenuAddVarBool8("Draw", "Proper Scaling", &CDraw::ms_bProperScaling, nil); -#endif -#ifdef FIX_RADAR - DebugMenuAddVarBool8("Draw", "Fix Radar", &CDraw::ms_bFixRadar, nil); +#ifdef DRAW_GAME_VERSION_TEXT + extern bool gDrawVersionText; + DebugMenuAddVarBool8("Debug", "Version Text", &gDrawVersionText, nil); #endif -#ifdef FIX_SPRITES - DebugMenuAddVarBool8("Draw", "Fix Sprites", &CDraw::ms_bFixSprites, nil); + DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil); +#ifdef TIMEBARS + DebugMenuAddVarBool8("Debug", "Show Timebars", &gbShowTimebars, nil); #endif - - - #ifndef FINAL DebugMenuAddVarBool8("Debug", "Print Memory Usage", &gbPrintMemoryUsage, nil); #ifdef USE_CUSTOM_ALLOCATOR @@ -899,30 +1010,19 @@ extern bool gbRenderWorld2; #ifdef GTA_SCENE_EDIT DebugMenuAddVarBool8("Debug", "Edit on", &CSceneEdit::m_bEditOn, nil); #endif + //DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); + //DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); + #ifdef MENU_MAP - DebugMenuAddCmd("Debug", "Teleport to map waypoint", TeleportToWaypoint); + DebugMenuAddCmd("Game", "Teleport to map waypoint", TeleportToWaypoint); #endif - DebugMenuAddCmd("Debug", "Switch car collision", SwitchCarCollision); - DebugMenuAddVar("Debug", "Engine Status", &engineStatus, nil, 1, 0, 226, nil); - DebugMenuAddCmd("Debug", "Set Engine Status", SetEngineStatus); - DebugMenuAddCmd("Debug", "Fix Car", FixCar); - DebugMenuAddCmd("Debug", "Toggle Comedy Controls", ToggleComedy); - DebugMenuAddCmd("Debug", "Place Car on Road", PlaceOnRoad); - - DebugMenuAddVarBool8("Debug", "Catalina Heli On", &CHeli::CatalinaHeliOn, nil); - DebugMenuAddCmd("Debug", "Catalina Fly By", CHeli::StartCatalinaFlyBy); - DebugMenuAddCmd("Debug", "Catalina Take Off", CHeli::CatalinaTakeOff); - DebugMenuAddCmd("Debug", "Catalina Fly Away", CHeli::MakeCatalinaHeliFlyAway); - DebugMenuAddVarBool8("Debug", "Script Heli On", &CHeli::ScriptHeliOn, nil); + DebugMenuAddCmd("Game", "Fix Car", FixCar); + DebugMenuAddCmd("Game", "Place Car on Road", PlaceOnRoad); + DebugMenuAddCmd("Game", "Switch car collision", SwitchCarCollision); + DebugMenuAddCmd("Game", "Toggle Comedy Controls", ToggleComedy); - DebugMenuAddVarBool8("Debug", "Toggle popping heads on headshot", &CPed::bPopHeadsOnHeadshot, nil); - DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); - DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); + DebugMenuAddVarBool8("Game", "Toggle popping heads on headshot", &CPed::bPopHeadsOnHeadshot, nil); - DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil); -#ifdef TIMEBARS - DebugMenuAddVarBool8("Debug", "Show Timebars", &gbShowTimebars, nil); -#endif #ifdef MISSION_SWITCHER DebugMenuEntry *missionEntry; static const char* missions[] = { @@ -942,9 +1042,9 @@ extern bool gbRenderWorld2; "Uzi Money", "Toyminator", "Rigged To Blow", "Bullion Run", "Rumble", "The Exchange" }; - missionEntry = DebugMenuAddVar("Debug", "Select mission", &nextMissionToSwitch, nil, 1, 0, ARRAY_SIZE(missions) - 1, missions); + missionEntry = DebugMenuAddVar("Game", "Select mission", &nextMissionToSwitch, nil, 1, 0, ARRAY_SIZE(missions) - 1, missions); DebugMenuEntrySetWrap(missionEntry, true); - DebugMenuAddCmd("Debug", "Start selected mission ", SwitchToMission); + DebugMenuAddCmd("Game", "Start selected mission ", SwitchToMission); #endif extern bool PrintDebugCode; @@ -956,9 +1056,9 @@ extern bool gbRenderWorld2; DebugMenuAddVarBool8("Cam", "Print Debug Code", &PrintDebugCode, nil); DebugMenuAddVar("Cam", "Cam Mode", &DebugCamMode, nil, 1, 0, CCam::MODE_EDITOR, nil); DebugMenuAddCmd("Cam", "Normal", []() { DebugCamMode = 0; }); - DebugMenuAddCmd("Cam", "Follow Ped With Bind", []() { DebugCamMode = CCam::MODE_FOLLOW_PED_WITH_BIND; }); - DebugMenuAddCmd("Cam", "Reaction", []() { DebugCamMode = CCam::MODE_REACTION; }); - DebugMenuAddCmd("Cam", "Chris", []() { DebugCamMode = CCam::MODE_CHRIS; }); + // DebugMenuAddCmd("Cam", "Follow Ped With Bind", []() { DebugCamMode = CCam::MODE_FOLLOW_PED_WITH_BIND; }); + // DebugMenuAddCmd("Cam", "Reaction", []() { DebugCamMode = CCam::MODE_REACTION; }); + // DebugMenuAddCmd("Cam", "Chris", []() { DebugCamMode = CCam::MODE_CHRIS; }); DebugMenuAddCmd("Cam", "Reset Statics", ResetCamStatics); CTweakVars::AddDBG("Debug"); diff --git a/src/extras/GitSHA1.cpp.in b/src/extras/GitSHA1.cpp.in new file mode 100644 index 00000000..6168dc79 --- /dev/null +++ b/src/extras/GitSHA1.cpp.in @@ -0,0 +1,2 @@ +#define GIT_SHA1 "@GIT_SHA1@" +const char* g_GIT_SHA1 = GIT_SHA1; diff --git a/src/extras/GitSHA1.h b/src/extras/GitSHA1.h new file mode 100644 index 00000000..359bfaff --- /dev/null +++ b/src/extras/GitSHA1.h @@ -0,0 +1 @@ +extern const char* g_GIT_SHA1;
\ No newline at end of file diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp index 4242c630..dad42b33 100644 --- a/src/extras/custompipes_d3d9.cpp +++ b/src/extras/custompipes_d3d9.cpp @@ -89,6 +89,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) } int vsBits; + rw::uint32 flags = atomic->geometry->flags; setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride); setIndices(header->indexBuffer); setVertexDeclaration(header->vertexDeclaration); @@ -120,7 +121,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) reflProps[3] = m->surfaceProps.specular == 0.0f ? 0.0f : VehicleSpecularity; d3ddevice->SetVertexShaderConstantF(VSLOC_reflProps, reflProps, 1); - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(m->texture) d3d::setTexture(0, m->texture); @@ -149,11 +150,11 @@ CreateVehiclePipe(void) fp = ReadTweakValueTable(fp, SpecColor); } -#include "shaders/neoVehicle_VS.inc" +#include "shaders/obj/neoVehicle_VS.inc" neoVehicle_VS = rw::d3d::createVertexShader(neoVehicle_VS_cso); assert(neoVehicle_VS); -#include "shaders/neoVehicle_PS.inc" +#include "shaders/obj/neoVehicle_PS.inc" neoVehicle_PS = rw::d3d::createPixelShader(neoVehicle_PS_cso); assert(neoVehicle_PS); @@ -259,11 +260,11 @@ CreateWorldPipe(void) else ReadTweakValueTable((char*)work_buff, WorldLightmapBlend); -#include "shaders/default_UV2_VS.inc" +#include "shaders/obj/default_UV2_VS.inc" neoWorld_VS = rw::d3d::createVertexShader(default_UV2_VS_cso); assert(neoWorld_VS); -#include "shaders/neoWorldIII_PS.inc" +#include "shaders/obj/neoWorldIII_PS.inc" neoWorldIII_PS = rw::d3d::createPixelShader(neoWorldIII_PS_cso); assert(neoWorldIII_PS); @@ -346,11 +347,11 @@ glossRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) void CreateGlossPipe(void) { -#include "shaders/neoGloss_VS.inc" +#include "shaders/obj/neoGloss_VS.inc" neoGloss_VS = rw::d3d::createVertexShader(neoGloss_VS_cso); assert(neoGloss_VS); -#include "shaders/neoGloss_PS.inc" +#include "shaders/obj/neoGloss_PS.inc" neoGloss_PS = rw::d3d::createPixelShader(neoGloss_PS_cso); assert(neoGloss_PS); @@ -420,6 +421,7 @@ rimRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) } int vsBits; + rw::uint32 flags = atomic->geometry->flags; setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride); setIndices(header->indexBuffer); setVertexDeclaration(header->vertexDeclaration); @@ -437,7 +439,7 @@ rimRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255); - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(m->texture){ d3d::setTexture(0, m->texture); @@ -463,7 +465,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) } int vsBits; - + rw::uint32 flags = atomic->geometry->flags; setStreamSource(0, (IDirect3DVertexBuffer9*)header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride); setIndices((IDirect3DIndexBuffer9*)header->indexBuffer); @@ -484,7 +486,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255); - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(inst->material->texture){ d3d::setTexture(0, m->texture); @@ -512,11 +514,11 @@ CreateRimLightPipes(void) } -#include "shaders/neoRim_VS.inc" +#include "shaders/obj/neoRim_VS.inc" neoRim_VS = rw::d3d::createVertexShader(neoRim_VS_cso); assert(neoRim_VS); -#include "shaders/neoRimSkin_VS.inc" +#include "shaders/obj/neoRimSkin_VS.inc" neoRimSkin_VS = rw::d3d::createVertexShader(neoRimSkin_VS_cso); assert(neoRimSkin_VS); @@ -610,6 +612,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) assert(building->instHeader->platform == PLATFORM_D3D9); building->fadeAlpha = 255; building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT); + rw::uint32 flags = atomic->geometry->flags; bool setupDone = false; bool defer = false; @@ -639,7 +642,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) setupDone = true; } - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(m->texture){ d3d::setTexture(0, m->texture); @@ -702,7 +705,7 @@ RenderBlendPass(int pass) rw::RGBA color = m->color; color.alpha = (color.alpha * building->fadeAlpha)/255; - setMaterial(color, m->surfaceProps); + setMaterial(color, m->surfaceProps); // always modulate here if(m->texture){ d3d::setTexture(0, m->texture); diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp index caf9eb27..f1cbfc38 100644 --- a/src/extras/custompipes_gl.cpp +++ b/src/extras/custompipes_gl.cpp @@ -87,6 +87,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) Material *m; + rw::uint32 flags = atomic->geometry->flags; setWorldMatrix(atomic->getFrame()->getLTM()); lightingCB(atomic); @@ -119,7 +120,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) while(n--){ m = inst->material; - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -159,8 +160,8 @@ CreateVehiclePipe(void) { -#include "shaders/neoVehicle_fs_gl.inc" -#include "shaders/neoVehicle_vs_gl.inc" +#include "shaders/obj/neoVehicle_frag.inc" +#include "shaders/obj/neoVehicle_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoVehicle_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, neoVehicle_frag_src, nil }; neoVehicleShader = Shader::create(vs, fs); @@ -270,8 +271,8 @@ CreateWorldPipe(void) ReadTweakValueTable((char*)work_buff, WorldLightmapBlend); { -#include "shaders/neoWorldIII_fs_gl.inc" -#include "shaders/default_UV2_gl.inc" +#include "shaders/obj/neoWorldIII_frag.inc" +#include "shaders/obj/default_UV2_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, default_UV2_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, neoWorldIII_frag_src, nil }; neoWorldShader = Shader::create(vs, fs); @@ -378,8 +379,8 @@ CreateGlossPipe(void) using namespace rw::gl3; { -#include "shaders/neoGloss_fs_gl.inc" -#include "shaders/neoGloss_vs_gl.inc" +#include "shaders/obj/neoGloss_frag.inc" +#include "shaders/obj/neoGloss_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoGloss_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, neoGloss_frag_src, nil }; neoGlossShader = Shader::create(vs, fs); @@ -448,6 +449,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) Material *m; + rw::uint32 flags = atomic->geometry->flags; setWorldMatrix(atomic->getFrame()->getLTM()); lightingCB(atomic); @@ -471,7 +473,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) while(n--){ m = inst->material; - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -498,6 +500,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) Material *m; + rw::uint32 flags = atomic->geometry->flags; setWorldMatrix(atomic->getFrame()->getLTM()); lightingCB(atomic); @@ -519,7 +522,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) while(n--){ m = inst->material; - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -550,8 +553,8 @@ CreateRimLightPipes(void) } { -#include "shaders/simple_fs_gl.inc" -#include "shaders/neoRimSkin_gl.inc" +#include "shaders/obj/simple_frag.inc" +#include "shaders/obj/neoRimSkin_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoRimSkin_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil }; neoRimSkinShader = Shader::create(vs, fs); @@ -559,8 +562,8 @@ CreateRimLightPipes(void) } { -#include "shaders/simple_fs_gl.inc" -#include "shaders/neoRim_gl.inc" +#include "shaders/obj/simple_frag.inc" +#include "shaders/obj/neoRim_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoRim_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil }; neoRimShader = Shader::create(vs, fs); @@ -664,6 +667,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) assert(building->instHeader->platform == PLATFORM_GL3); building->fadeAlpha = 255; building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT); + rw::uint32 flags = atomic->geometry->flags; WorldLights lights; lights.numAmbients = 1; @@ -703,7 +707,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) setupDone = true; } - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -772,7 +776,7 @@ RenderBlendPass(int pass) rw::RGBA color = m->color; color.alpha = (color.alpha * building->fadeAlpha)/255; - setMaterial(color, m->surfaceProps); + setMaterial(color, m->surfaceProps); // always modulate here setTexture(0, m->texture); diff --git a/src/extras/postfx.cpp b/src/extras/postfx.cpp index 51b91060..b94d245d 100644 --- a/src/extras/postfx.cpp +++ b/src/extras/postfx.cpp @@ -141,16 +141,16 @@ CPostFX::Open(RwCamera *cam) #ifdef RW_D3D9 -#include "shaders/colourfilterIII_PS.inc" +#include "shaders/obj/colourfilterIII_PS.inc" colourfilterIII_PS = rw::d3d::createPixelShader(colourfilterIII_PS_cso); -#include "shaders/contrastPS.inc" +#include "shaders/obj/contrastPS.inc" contrast_PS = rw::d3d::createPixelShader(contrastPS_cso); #endif #ifdef RW_OPENGL using namespace rw::gl3; { -#include "shaders/im2d_gl.inc" -#include "shaders/colourfilterIII_fs_gl.inc" +#include "shaders/obj/im2d_vert.inc" +#include "shaders/obj/colourfilterIII_frag.inc" const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, colourfilterIII_frag_src, nil }; colourFilterIII = Shader::create(vs, fs); @@ -158,8 +158,8 @@ CPostFX::Open(RwCamera *cam) } { -#include "shaders/im2d_gl.inc" -#include "shaders/contrast_fs_gl.inc" +#include "shaders/obj/im2d_vert.inc" +#include "shaders/obj/contrast_frag.inc" const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, contrast_frag_src, nil }; contrast = Shader::create(vs, fs); diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp index 74c44da0..1412141e 100644 --- a/src/extras/screendroplets.cpp +++ b/src/extras/screendroplets.cpp @@ -112,14 +112,14 @@ ScreenDroplets::InitDraw(void) openim2d_uv2(); #ifdef RW_D3D9 -#include "shaders/screenDroplet_PS.inc" +#include "shaders/obj/screenDroplet_PS.inc" screenDroplet_PS = rw::d3d::createPixelShader(screenDroplet_PS_cso); #endif #ifdef RW_GL3 using namespace rw::gl3; { -#include "shaders/im2d_UV2_gl.inc" -#include "shaders/screenDroplet_fs_gl.inc" +#include "shaders/obj/im2d_UV2_vert.inc" +#include "shaders/obj/screenDroplet_frag.inc" const char *vs[] = { shaderDecl, header_vert_src, im2d_UV2_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, screenDroplet_frag_src, nil }; screenDroplet = Shader::create(vs, fs); diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile deleted file mode 100644 index 51e009d6..00000000 --- a/src/extras/shaders/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \ - colourfilterIII_fs_gl.inc contrast_fs_gl.inc \ - neoRim_gl.inc neoRimSkin_gl.inc \ - neoWorldIII_fs_gl.inc neoGloss_vs_gl.inc neoGloss_fs_gl.inc \ - neoVehicle_vs_gl.inc neoVehicle_fs_gl.inc \ - im2d_UV2_gl.inc screenDroplet_fs_gl.inc - -im2d_gl.inc: im2d.vert - (echo 'const char *im2d_vert_src =';\ - sed 's/..*/"&\\n"/' im2d.vert;\ - echo ';') >im2d_gl.inc - -simple_fs_gl.inc: simple.frag - (echo 'const char *simple_frag_src =';\ - sed 's/..*/"&\\n"/' simple.frag;\ - echo ';') >simple_fs_gl.inc - -default_UV2_gl.inc: default_UV2.vert - (echo 'const char *default_UV2_vert_src =';\ - sed 's/..*/"&\\n"/' default_UV2.vert;\ - echo ';') >default_UV2_gl.inc - - - -colourfilterIII_fs_gl.inc: colourfilterIII.frag - (echo 'const char *colourfilterIII_frag_src =';\ - sed 's/..*/"&\\n"/' colourfilterIII.frag;\ - echo ';') >colourfilterIII_fs_gl.inc - -contrast_fs_gl.inc: contrast.frag - (echo 'const char *contrast_frag_src =';\ - sed 's/..*/"&\\n"/' contrast.frag;\ - echo ';') >contrast_fs_gl.inc - - -neoRim_gl.inc: neoRim.vert - (echo 'const char *neoRim_vert_src =';\ - sed 's/..*/"&\\n"/' neoRim.vert;\ - echo ';') >neoRim_gl.inc - -neoRimSkin_gl.inc: neoRimSkin.vert - (echo 'const char *neoRimSkin_vert_src =';\ - sed 's/..*/"&\\n"/' neoRimSkin.vert;\ - echo ';') >neoRimSkin_gl.inc - -neoWorldIII_fs_gl.inc: neoWorldIII.frag - (echo 'const char *neoWorldIII_frag_src =';\ - sed 's/..*/"&\\n"/' neoWorldIII.frag;\ - echo ';') >neoWorldIII_fs_gl.inc - -neoGloss_fs_gl.inc: neoGloss.frag - (echo 'const char *neoGloss_frag_src =';\ - sed 's/..*/"&\\n"/' neoGloss.frag;\ - echo ';') >neoGloss_fs_gl.inc - -neoGloss_vs_gl.inc: neoGloss.vert - (echo 'const char *neoGloss_vert_src =';\ - sed 's/..*/"&\\n"/' neoGloss.vert;\ - echo ';') >neoGloss_vs_gl.inc - -neoVehicle_vs_gl.inc: neoVehicle.vert - (echo 'const char *neoVehicle_vert_src =';\ - sed 's/..*/"&\\n"/' neoVehicle.vert;\ - echo ';') >neoVehicle_vs_gl.inc - -neoVehicle_fs_gl.inc: neoVehicle.frag - (echo 'const char *neoVehicle_frag_src =';\ - sed 's/..*/"&\\n"/' neoVehicle.frag;\ - echo ';') >neoVehicle_fs_gl.inc - -im2d_UV2_gl.inc: im2d_UV2.vert - (echo 'const char *im2d_UV2_vert_src =';\ - sed 's/..*/"&\\n"/' im2d_UV2.vert;\ - echo ';') >im2d_UV2_gl.inc - -screenDroplet_fs_gl.inc: screenDroplet.frag - (echo 'const char *screenDroplet_frag_src =';\ - sed 's/..*/"&\\n"/' screenDroplet.frag;\ - echo ';') >screenDroplet_fs_gl.inc diff --git a/src/extras/shaders/colourfilterIII.frag b/src/extras/shaders/colourfilterIII.frag index b41cb94a..95e5d052 100644 --- a/src/extras/shaders/colourfilterIII.frag +++ b/src/extras/shaders/colourfilterIII.frag @@ -17,7 +17,7 @@ main(void) } vec4 color; color.rgb = prev.rgb; - color.a = 1.0f; + color.a = 1.0; FRAGCOLOR(color); } diff --git a/src/extras/shaders/colourfilterIII_PS.hlsl b/src/extras/shaders/colourfilterIII_PS.hlsl index 27f099ef..3d893c3c 100644 --- a/src/extras/shaders/colourfilterIII_PS.hlsl +++ b/src/extras/shaders/colourfilterIII_PS.hlsl @@ -10,6 +10,6 @@ float4 main(in float2 texcoord : TEXCOORD0) : COLOR0 float4 tmp = dst*(1-a) + prev*blurcol*a; prev = saturate(tmp); } - prev.a = 1.0f; + prev.a = 1.0; return prev; } diff --git a/src/extras/shaders/contrast.frag b/src/extras/shaders/contrast.frag index 1b93f6fe..2d394f66 100644 --- a/src/extras/shaders/contrast.frag +++ b/src/extras/shaders/contrast.frag @@ -12,7 +12,7 @@ main(void) vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y)); vec4 color; color.rgb = dst.rgb*u_contrastMult + u_contrastAdd; - color.a = 1.0f; + color.a = 1.0; FRAGCOLOR(color); } diff --git a/src/extras/shaders/make_glsl.sh b/src/extras/shaders/make_glsl.sh new file mode 100644 index 00000000..0af98961 --- /dev/null +++ b/src/extras/shaders/make_glsl.sh @@ -0,0 +1,9 @@ +#!sh +for i in *.vert; do + echo $i + ./makeinc_glsl.sh $i +done +for i in *.frag; do + echo $i + ./makeinc_glsl.sh $i +done diff --git a/src/extras/shaders/make.cmd b/src/extras/shaders/make_hlsl.cmd index 8404ac6c..dee95283 100644 --- a/src/extras/shaders/make.cmd +++ b/src/extras/shaders/make_hlsl.cmd @@ -1,3 +1,3 @@ @echo off -for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo %%~nf.cso %%f -for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo %%~nf.cso %%f +for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f +for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f diff --git a/src/extras/shaders/makeinc_glsl.sh b/src/extras/shaders/makeinc_glsl.sh new file mode 100644 index 00000000..2bc6a387 --- /dev/null +++ b/src/extras/shaders/makeinc_glsl.sh @@ -0,0 +1,6 @@ +#!sh +ext=${1##*.} +name=${1%.*} +(echo "const char *${name}_${ext}_src =";\ +sed 's/..*/"&\\n"/' $1;\ +echo ';') > obj/${name}_${ext}.inc diff --git a/src/extras/shaders/makeinc.sh b/src/extras/shaders/makeinc_hlsl.sh index a649af33..a5b12867 100644 --- a/src/extras/shaders/makeinc.sh +++ b/src/extras/shaders/makeinc_hlsl.sh @@ -1,4 +1,5 @@ #!sh +cd obj for i in *cso; do (echo -n 'static ' xxd -i $i | grep -v '_len = ') > ${i%cso}inc diff --git a/src/extras/shaders/neoVehicle.vert b/src/extras/shaders/neoVehicle.vert index f0224ddb..6985a689 100644 --- a/src/extras/shaders/neoVehicle.vert +++ b/src/extras/shaders/neoVehicle.vert @@ -42,7 +42,7 @@ main(void) v_tex1 = uv2.xy*0.5 + 0.5; float b = 1.0 - clamp(dot(viewVec, Normal), 0.0, 1.0); v_reflcolor = vec4(0.0, 0.0, 0.0, 1.0); - v_reflcolor.a = mix(b*b*b*b*b, 1.0f, fresnel)*shininess; + v_reflcolor.a = mix(b*b*b*b*b, 1.0, fresnel)*shininess; for(int i = 0; i < 5; i++) v_reflcolor.rgb += DoDirLightSpec(u_specDir[i].xyz, u_specColor[i].rgb, Normal, viewVec, u_specDir[i].w)*specularity*lightStrength; diff --git a/src/extras/shaders/neoVehicle_VS.hlsl b/src/extras/shaders/neoVehicle_VS.hlsl index de75e745..fb730092 100644 --- a/src/extras/shaders/neoVehicle_VS.hlsl +++ b/src/extras/shaders/neoVehicle_VS.hlsl @@ -52,7 +52,7 @@ VS_out main(in VS_in input) output.TexCoord1 = uv2.xy*0.5 + 0.5; float b = 1.0 - saturate(dot(viewVec, Normal)); output.ReflColor = float4(0.0, 0.0, 0.0, 1.0); - output.ReflColor.a = lerp(b*b*b*b*b, 1.0f, fresnel)*shininess; + output.ReflColor.a = lerp(b*b*b*b*b, 1.0, fresnel)*shininess; //Light mainLight = lights[0]; for(i = 0; i < 5; i++) diff --git a/src/extras/shaders/colourfilterIII_PS.cso b/src/extras/shaders/obj/colourfilterIII_PS.cso Binary files differindex cc41bcec..cc41bcec 100644 --- a/src/extras/shaders/colourfilterIII_PS.cso +++ b/src/extras/shaders/obj/colourfilterIII_PS.cso diff --git a/src/extras/shaders/colourfilterIII_PS.inc b/src/extras/shaders/obj/colourfilterIII_PS.inc index db49de6c..db49de6c 100644 --- a/src/extras/shaders/colourfilterIII_PS.inc +++ b/src/extras/shaders/obj/colourfilterIII_PS.inc diff --git a/src/extras/shaders/colourfilterIII_fs_gl.inc b/src/extras/shaders/obj/colourfilterIII_frag.inc index 6fd1935b..05f92785 100644 --- a/src/extras/shaders/colourfilterIII_fs_gl.inc +++ b/src/extras/shaders/obj/colourfilterIII_frag.inc @@ -18,7 +18,7 @@ const char *colourfilterIII_frag_src = " }\n" " vec4 color;\n" " color.rgb = prev.rgb;\n" -" color.a = 1.0f;\n" +" color.a = 1.0;\n" " FRAGCOLOR(color);\n" "}\n" diff --git a/src/extras/shaders/contrastPS.cso b/src/extras/shaders/obj/contrastPS.cso Binary files differindex a87c48d7..a87c48d7 100644 --- a/src/extras/shaders/contrastPS.cso +++ b/src/extras/shaders/obj/contrastPS.cso diff --git a/src/extras/shaders/contrastPS.inc b/src/extras/shaders/obj/contrastPS.inc index 5386792f..5386792f 100644 --- a/src/extras/shaders/contrastPS.inc +++ b/src/extras/shaders/obj/contrastPS.inc diff --git a/src/extras/shaders/contrast_fs_gl.inc b/src/extras/shaders/obj/contrast_frag.inc index 97f78194..a1ad479f 100644 --- a/src/extras/shaders/contrast_fs_gl.inc +++ b/src/extras/shaders/obj/contrast_frag.inc @@ -13,7 +13,7 @@ const char *contrast_frag_src = " vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n" " vec4 color;\n" " color.rgb = dst.rgb*u_contrastMult + u_contrastAdd;\n" -" color.a = 1.0f;\n" +" color.a = 1.0;\n" " FRAGCOLOR(color);\n" "}\n" diff --git a/src/extras/shaders/default_UV2_VS.cso b/src/extras/shaders/obj/default_UV2_VS.cso Binary files differindex 5a48c663..5a48c663 100644 --- a/src/extras/shaders/default_UV2_VS.cso +++ b/src/extras/shaders/obj/default_UV2_VS.cso diff --git a/src/extras/shaders/default_UV2_VS.inc b/src/extras/shaders/obj/default_UV2_VS.inc index de832107..de832107 100644 --- a/src/extras/shaders/default_UV2_VS.inc +++ b/src/extras/shaders/obj/default_UV2_VS.inc diff --git a/src/extras/shaders/default_UV2_gl.inc b/src/extras/shaders/obj/default_UV2_vert.inc index 450f3d9a..450f3d9a 100644 --- a/src/extras/shaders/default_UV2_gl.inc +++ b/src/extras/shaders/obj/default_UV2_vert.inc diff --git a/src/extras/shaders/im2d_UV2_gl.inc b/src/extras/shaders/obj/im2d_UV2_vert.inc index 3feb2bc1..3feb2bc1 100644 --- a/src/extras/shaders/im2d_UV2_gl.inc +++ b/src/extras/shaders/obj/im2d_UV2_vert.inc diff --git a/src/extras/shaders/im2d_gl.inc b/src/extras/shaders/obj/im2d_vert.inc index d11f5d33..d11f5d33 100644 --- a/src/extras/shaders/im2d_gl.inc +++ b/src/extras/shaders/obj/im2d_vert.inc diff --git a/src/extras/shaders/neoGloss_PS.cso b/src/extras/shaders/obj/neoGloss_PS.cso Binary files differindex aa88e450..aa88e450 100644 --- a/src/extras/shaders/neoGloss_PS.cso +++ b/src/extras/shaders/obj/neoGloss_PS.cso diff --git a/src/extras/shaders/neoGloss_PS.inc b/src/extras/shaders/obj/neoGloss_PS.inc index 97e5641d..97e5641d 100644 --- a/src/extras/shaders/neoGloss_PS.inc +++ b/src/extras/shaders/obj/neoGloss_PS.inc diff --git a/src/extras/shaders/neoGloss_VS.cso b/src/extras/shaders/obj/neoGloss_VS.cso Binary files differindex 9635b8b7..9635b8b7 100644 --- a/src/extras/shaders/neoGloss_VS.cso +++ b/src/extras/shaders/obj/neoGloss_VS.cso diff --git a/src/extras/shaders/neoGloss_VS.inc b/src/extras/shaders/obj/neoGloss_VS.inc index 1ec03761..1ec03761 100644 --- a/src/extras/shaders/neoGloss_VS.inc +++ b/src/extras/shaders/obj/neoGloss_VS.inc diff --git a/src/extras/shaders/neoGloss_fs_gl.inc b/src/extras/shaders/obj/neoGloss_frag.inc index 67e9724e..67e9724e 100644 --- a/src/extras/shaders/neoGloss_fs_gl.inc +++ b/src/extras/shaders/obj/neoGloss_frag.inc diff --git a/src/extras/shaders/neoGloss_vs_gl.inc b/src/extras/shaders/obj/neoGloss_vert.inc index dffb423f..dffb423f 100644 --- a/src/extras/shaders/neoGloss_vs_gl.inc +++ b/src/extras/shaders/obj/neoGloss_vert.inc diff --git a/src/extras/shaders/neoRimSkin_VS.cso b/src/extras/shaders/obj/neoRimSkin_VS.cso Binary files differindex 8410504e..8410504e 100644 --- a/src/extras/shaders/neoRimSkin_VS.cso +++ b/src/extras/shaders/obj/neoRimSkin_VS.cso diff --git a/src/extras/shaders/neoRimSkin_VS.inc b/src/extras/shaders/obj/neoRimSkin_VS.inc index ac182956..ac182956 100644 --- a/src/extras/shaders/neoRimSkin_VS.inc +++ b/src/extras/shaders/obj/neoRimSkin_VS.inc diff --git a/src/extras/shaders/neoRimSkin_gl.inc b/src/extras/shaders/obj/neoRimSkin_vert.inc index 01b739b2..01b739b2 100644 --- a/src/extras/shaders/neoRimSkin_gl.inc +++ b/src/extras/shaders/obj/neoRimSkin_vert.inc diff --git a/src/extras/shaders/neoRim_VS.cso b/src/extras/shaders/obj/neoRim_VS.cso Binary files differindex 4af538b1..4af538b1 100644 --- a/src/extras/shaders/neoRim_VS.cso +++ b/src/extras/shaders/obj/neoRim_VS.cso diff --git a/src/extras/shaders/neoRim_VS.inc b/src/extras/shaders/obj/neoRim_VS.inc index 03b044a6..03b044a6 100644 --- a/src/extras/shaders/neoRim_VS.inc +++ b/src/extras/shaders/obj/neoRim_VS.inc diff --git a/src/extras/shaders/neoRim_gl.inc b/src/extras/shaders/obj/neoRim_vert.inc index 7cd199d0..7cd199d0 100644 --- a/src/extras/shaders/neoRim_gl.inc +++ b/src/extras/shaders/obj/neoRim_vert.inc diff --git a/src/extras/shaders/neoVehicle_PS.cso b/src/extras/shaders/obj/neoVehicle_PS.cso Binary files differindex ded01bfb..ded01bfb 100644 --- a/src/extras/shaders/neoVehicle_PS.cso +++ b/src/extras/shaders/obj/neoVehicle_PS.cso diff --git a/src/extras/shaders/neoVehicle_PS.inc b/src/extras/shaders/obj/neoVehicle_PS.inc index 8b77cec2..8b77cec2 100644 --- a/src/extras/shaders/neoVehicle_PS.inc +++ b/src/extras/shaders/obj/neoVehicle_PS.inc diff --git a/src/extras/shaders/neoVehicle_VS.cso b/src/extras/shaders/obj/neoVehicle_VS.cso Binary files differindex 6ea47987..6ea47987 100644 --- a/src/extras/shaders/neoVehicle_VS.cso +++ b/src/extras/shaders/obj/neoVehicle_VS.cso diff --git a/src/extras/shaders/neoVehicle_VS.inc b/src/extras/shaders/obj/neoVehicle_VS.inc index 37c5858d..37c5858d 100644 --- a/src/extras/shaders/neoVehicle_VS.inc +++ b/src/extras/shaders/obj/neoVehicle_VS.inc diff --git a/src/extras/shaders/neoVehicle_fs_gl.inc b/src/extras/shaders/obj/neoVehicle_frag.inc index 20537440..20537440 100644 --- a/src/extras/shaders/neoVehicle_fs_gl.inc +++ b/src/extras/shaders/obj/neoVehicle_frag.inc diff --git a/src/extras/shaders/neoVehicle_vs_gl.inc b/src/extras/shaders/obj/neoVehicle_vert.inc index b7b42622..ebd0ea12 100644 --- a/src/extras/shaders/neoVehicle_vs_gl.inc +++ b/src/extras/shaders/obj/neoVehicle_vert.inc @@ -43,7 +43,7 @@ const char *neoVehicle_vert_src = " v_tex1 = uv2.xy*0.5 + 0.5;\n" " float b = 1.0 - clamp(dot(viewVec, Normal), 0.0, 1.0);\n" " v_reflcolor = vec4(0.0, 0.0, 0.0, 1.0);\n" -" v_reflcolor.a = mix(b*b*b*b*b, 1.0f, fresnel)*shininess;\n" +" v_reflcolor.a = mix(b*b*b*b*b, 1.0, fresnel)*shininess;\n" " for(int i = 0; i < 5; i++)\n" " v_reflcolor.rgb += DoDirLightSpec(u_specDir[i].xyz, u_specColor[i].rgb, Normal, viewVec, u_specDir[i].w)*specularity*lightStrength;\n" diff --git a/src/extras/shaders/neoWorldIII_PS.cso b/src/extras/shaders/obj/neoWorldIII_PS.cso Binary files differindex 817888ef..817888ef 100644 --- a/src/extras/shaders/neoWorldIII_PS.cso +++ b/src/extras/shaders/obj/neoWorldIII_PS.cso diff --git a/src/extras/shaders/neoWorldIII_PS.inc b/src/extras/shaders/obj/neoWorldIII_PS.inc index a4631efb..a4631efb 100644 --- a/src/extras/shaders/neoWorldIII_PS.inc +++ b/src/extras/shaders/obj/neoWorldIII_PS.inc diff --git a/src/extras/shaders/neoWorldIII_fs_gl.inc b/src/extras/shaders/obj/neoWorldIII_frag.inc index afd75f57..afd75f57 100644 --- a/src/extras/shaders/neoWorldIII_fs_gl.inc +++ b/src/extras/shaders/obj/neoWorldIII_frag.inc diff --git a/src/extras/shaders/screenDroplet_PS.cso b/src/extras/shaders/obj/screenDroplet_PS.cso Binary files differindex 5508096b..5508096b 100644 --- a/src/extras/shaders/screenDroplet_PS.cso +++ b/src/extras/shaders/obj/screenDroplet_PS.cso diff --git a/src/extras/shaders/screenDroplet_PS.inc b/src/extras/shaders/obj/screenDroplet_PS.inc index c2055188..c2055188 100644 --- a/src/extras/shaders/screenDroplet_PS.inc +++ b/src/extras/shaders/obj/screenDroplet_PS.inc diff --git a/src/extras/shaders/screenDroplet_fs_gl.inc b/src/extras/shaders/obj/screenDroplet_frag.inc index dd393b02..dd393b02 100644 --- a/src/extras/shaders/screenDroplet_fs_gl.inc +++ b/src/extras/shaders/obj/screenDroplet_frag.inc diff --git a/src/extras/shaders/simple_fs_gl.inc b/src/extras/shaders/obj/simple_frag.inc index 614d79a0..614d79a0 100644 --- a/src/extras/shaders/simple_fs_gl.inc +++ b/src/extras/shaders/obj/simple_frag.inc diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 366dcf3e..1d4c881f 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -945,6 +945,43 @@ RtBMPImageRead(const RwChar *imageName) #endif } + +RwImage * +RtPNGImageWrite(RwImage *image, const RwChar *imageName) +{ +#ifndef _WIN32 + char *r = casepath(imageName); + if (r) { + rw::writePNG(image, r); + free(r); + } else { + rw::writePNG(image, imageName); + } + +#else + rw::writePNG(image, imageName); +#endif + return image; +} +RwImage * +RtPNGImageRead(const RwChar *imageName) +{ +#ifndef _WIN32 + RwImage *image; + char *r = casepath(imageName); + if (r) { + image = rw::readPNG(r); + free(r); + } else { + image = rw::readPNG(imageName); + } + return image; + +#else + return rw::readPNG(imageName); +#endif +} + #include "rtquat.h" RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return (RtQuat*)((rw::Quat*)quat)->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); } diff --git a/src/fakerw/rtpng.h b/src/fakerw/rtpng.h new file mode 100644 index 00000000..80f29020 --- /dev/null +++ b/src/fakerw/rtpng.h @@ -0,0 +1,4 @@ +#pragma once + +RwImage *RtPNGImageWrite(RwImage * image, const RwChar * imageName); +RwImage *RtPNGImageRead(const RwChar * imageName); diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp index 29612ccf..44e3baf0 100644 --- a/src/peds/CopPed.cpp +++ b/src/peds/CopPed.cpp @@ -239,9 +239,9 @@ CCopPed::ArrestPlayer(void) if (suspect && (suspect->m_nPedState == PED_ARRESTED || suspect->DyingOrDead() || suspect->EnteringCar())) { - CAnimBlendAssociation *arrestAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ARREST_GUN); + CAnimBlendAssociation *arrestAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ARREST); if (!arrestAssoc || arrestAssoc->blendDelta < 0.0f) - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ARREST_GUN, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_ARREST, 4.0f); CVector suspMidPos; suspect->m_pedIK.GetComponentPosition(suspMidPos, PED_MID); @@ -401,7 +401,7 @@ CCopPed::CopAI(void) if (m_nPedState != PED_ATTACK && m_nPedState != PED_FIGHT && !m_bZoneDisabled) { CVector targetDist = playerOrHisVeh->GetPosition() - GetPosition(); if (m_fDistanceToTarget > 30.0f) { - CAnimBlendAssociation* crouchShootAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RBLOCK_CSHOOT); + CAnimBlendAssociation* crouchShootAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RBLOCK_SHOOT); if (crouchShootAssoc) crouchShootAssoc->blendDelta = -1000.0f; diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp index 9f87c12b..d8c8309e 100644 --- a/src/peds/EmergencyPed.cpp +++ b/src/peds/EmergencyPed.cpp @@ -317,7 +317,7 @@ CEmergencyPed::MedicAI(void) m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL; } else { m_nEmergencyPedState = EMERGENCY_PED_FACE_TO_PATIENT; - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CPR, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_MEDIC_CPR, 4.0f); bIsDucking = true; } SetLookTimer(2000); diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 87e77ef3..28a4e989 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -329,7 +329,7 @@ CPed::SetModelIndex(uint32 mi) SetPedStats(modelInfo->m_pedStatType); m_headingRate = m_pedStats->m_headingChangeRate; m_animGroup = (AssocGroupId) modelInfo->m_animGroup; - CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE); + CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE); (*RPANIMBLENDCLUMPDATA(m_rwObject))->velocity2d = &m_vecAnimMoveDelta; @@ -496,30 +496,30 @@ CPed::SetMoveAnim(void) CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK); if (!animAssoc) { - CAnimBlendAssociation *fightIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); + CAnimBlendAssociation *fightIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); animAssoc = fightIdleAssoc; if (fightIdleAssoc && m_nPedState == PED_FIGHT) return; if (fightIdleAssoc) { - CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); + CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); if (!idleAssoc || idleAssoc->blendDelta <= 0.0f) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_IDLE_STANCE, 8.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_IDLE, 8.0f); } } } if (!animAssoc) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (animAssoc) if (m_nWaitState == WAITSTATE_STUCK || m_nWaitState == WAITSTATE_FINISH_FLEE) return; if (animAssoc) { - CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); + CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); if (!idleAssoc || idleAssoc->blendDelta <= 0.0f) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_IDLE_STANCE, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_IDLE, 4.0f); } } } @@ -541,20 +541,20 @@ CPed::SetMoveAnim(void) switch (m_nMoveState) { case PEDMOVE_STILL: - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_IDLE_STANCE, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_IDLE, 4.0f); break; case PEDMOVE_WALK: - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_WALK, 1.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_WALK, 1.0f); break; case PEDMOVE_RUN: if (m_nPedState == PED_FLEE_ENTITY) { - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_RUN, 3.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_RUN, 3.0f); } else { - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_RUN, 1.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_RUN, 1.0f); } break; case PEDMOVE_SPRINT: - animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_SPRINT, 1.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_RUNFAST, 1.0f); break; default: break; @@ -562,12 +562,12 @@ CPed::SetMoveAnim(void) if (animAssoc) { if (m_leader) { - CAnimBlendAssociation *walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_WALK); + CAnimBlendAssociation *walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_STD_WALK); if (!walkAssoc) - walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_RUN); + walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_STD_RUN); if (!walkAssoc) - walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_SPRINT); + walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_STD_RUNFAST); if (walkAssoc) { animAssoc->speed = walkAssoc->speed; @@ -920,7 +920,7 @@ FinishFuckUCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; - if (animAssoc->animId == ANIM_FUCKU && ped->GetWeapon()->m_eWeaponType == WEAPONTYPE_UNARMED) + if (animAssoc->animId == ANIM_STD_PARTIAL_FUCKU && ped->GetWeapon()->m_eWeaponType == WEAPONTYPE_UNARMED) ped->RemoveWeaponModel(0); } @@ -939,7 +939,7 @@ CPed::MoveHeadToLook(void) if (!bShakeFist && GetWeapon()->m_eWeaponType == WEAPONTYPE_UNARMED) { - CAnimBlendAssociation *fuckUAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FUCKU); + CAnimBlendAssociation *fuckUAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_PARTIAL_FUCKU); if (fuckUAssoc) { float animTime = fuckUAssoc->currentTime; @@ -984,7 +984,7 @@ CPed::MoveHeadToLook(void) bool notRocketLauncher = false; bool notTwoHanded = false; - AnimationId animToPlay = NUM_ANIMS; + AnimationId animToPlay = ANIM_STD_NUM; if (!GetWeapon()->IsType2Handed()) notTwoHanded = true; @@ -1002,24 +1002,24 @@ CPed::MoveHeadToLook(void) #ifndef FIX_BUGS if (m_pedStats->m_temper < 47) #endif - animToPlay = ANIM_FIGHT_PPUNCH; + animToPlay = ANIM_STD_PARTIAL_PUNCH; } else { - animToPlay = ANIM_FUCKU; + animToPlay = ANIM_STD_PARTIAL_FUCKU; } } else if (m_pedStats->m_temper > 49 || m_pLookTarget->GetModelIndex() == MI_POLICE) { - animToPlay = ANIM_FUCKU; + animToPlay = ANIM_STD_PARTIAL_FUCKU; } } else if (notRocketLauncher && (CGeneral::GetRandomNumber() & 1)) { - animToPlay = ANIM_FUCKU; + animToPlay = ANIM_STD_PARTIAL_FUCKU; } - if (animToPlay != NUM_ANIMS) { + if (animToPlay != ANIM_STD_NUM) { CAnimBlendAssociation *newAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f); if (newAssoc) { newAssoc->flags |= ASSOC_FADEOUTWHENDONE; newAssoc->flags |= ASSOC_DELETEFADEDOUT; - if (newAssoc->animId == ANIM_FUCKU) + if (newAssoc->animId == ANIM_STD_PARTIAL_FUCKU) newAssoc->SetDeleteCallback(FinishFuckUCB, this); } } @@ -1365,8 +1365,8 @@ CPed::CalculateNewVelocity(void) m_moved = CVector2D(-Sin(walkAngle), Cos(walkAngle)) * pedSpeed; } - CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); - CAnimBlendAssociation *fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); + CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); + CAnimBlendAssociation *fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); #ifdef VC_PED_PORTS if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc && !bIsDucking) { #else @@ -1809,7 +1809,7 @@ CPed::ProcessControl(void) ++m_panicCounter; if (m_fHealth <= 1.0f && m_nPedState <= PED_STATES_NO_AI && !bIsInTheAir && !bIsLanding) - SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); bCollidedWithMyVehicle = false; @@ -1900,9 +1900,9 @@ CPed::ProcessControl(void) } else { if (m_nPedType != PEDTYPE_COP && neededTurn < DEGTORAD(15.0f) && m_nWaitState == WAITSTATE_FALSE) { if ((m_nStoredMoveState == PEDMOVE_RUN || m_nStoredMoveState == PEDMOVE_SPRINT) && m_vecDamageNormal.z < 0.3f) { - CAnimBlendAssociation *runAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN); + CAnimBlendAssociation *runAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUN); if (!runAssoc) - runAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_SPRINT); + runAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNFAST); if (runAssoc && runAssoc->blendAmount > 0.9f && runAssoc->IsRunning()) { SetWaitState(WAITSTATE_HITWALL, nil); @@ -2189,7 +2189,7 @@ CPed::ProcessControl(void) bIsStanding = false; CVector2D collidingEntMoveDir = -collidingVeh->m_vecMoveSpeed; int dir = GetLocalDirection(collidingEntMoveDir); - SetFall(1000, (AnimationId)(dir + ANIM_KO_SKID_FRONT), false); + SetFall(1000, (AnimationId)(dir + ANIM_STD_HIGHIMPACT_FRONT), false); float damage; if (collidingVeh->m_modelIndex == MI_TRAIN) { @@ -2321,7 +2321,7 @@ CPed::ProcessControl(void) bIsStanding = false; CVector2D collidingEntMoveDir = -collidingVeh->m_vecMoveSpeed; int dir = GetLocalDirection(collidingEntMoveDir); - SetFall(1000, (AnimationId)(dir + ANIM_KO_SKID_FRONT), false); + SetFall(1000, (AnimationId)(dir + ANIM_STD_HIGHIMPACT_FRONT), false); CPed *driver = collidingVeh->pDriver; float damage; @@ -2448,12 +2448,17 @@ CPed::ProcessControl(void) #ifdef VC_PED_PORTS uint8 flyDir = 0; float feetZ = GetPosition().z - FEET_OFFSET; - if ((obstacleForFlyingZ <= feetZ || obstacleForFlyingOtherDirZ >= 500.0f) && (obstacleForFlyingZ <= feetZ || obstacleForFlyingOtherDirZ <= feetZ)) { - if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 499.0f) - flyDir = 2; - } else { +#ifdef FIX_BUGS + if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) flyDir = 1; - } + else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f) + flyDir = 2; +#else + if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ)) + flyDir = 1; + else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 499.0f) + flyDir = 2; +#endif if (flyDir != 0 && !bSomeVCflag1) { SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); @@ -2471,6 +2476,10 @@ CPed::ProcessControl(void) forceDir.z = 4.0f; ApplyMoveForce(forceDir); + // What was that for?? It pushes player inside of collision sometimes and kills him. +#ifdef FIX_BUGS + if (!IsPlayer()) +#endif GetMatrix().GetPosition() += 0.25f * offsetToCheck; m_fRotationCur = CGeneral::GetRadianAngleBetweenPoints(offsetToCheck.x, offsetToCheck.y, 0.0f, 0.0f); @@ -2479,7 +2488,7 @@ CPed::ProcessControl(void) SetHeading(m_fRotationCur); if (m_nPedState != PED_FALL && !bIsPedDieAnimPlaying) { - SetFall(1000, ANIM_KO_SKID_BACK, true); + SetFall(1000, ANIM_STD_HIGHIMPACT_BACK, true); } bIsInTheAir = false; } else if (m_vecDamageNormal.z > 0.4f) { @@ -2534,10 +2543,10 @@ CPed::ProcessControl(void) m_fRotationCur = m_fRotationDest; SetHeading(m_fRotationCur); } - CAnimBlendAssociation *jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_JUMP_GLIDE); + CAnimBlendAssociation *jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_JUMP_GLIDE); if (!jumpAssoc) - jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_GLIDE); + jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL_GLIDE); if (jumpAssoc) { jumpAssoc->blendDelta = -3.0f; @@ -2546,10 +2555,10 @@ CPed::ProcessControl(void) if (m_nPedState == PED_JUMP) m_nPedState = PED_IDLE; } else { - CAnimBlendAssociation *jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_JUMP_GLIDE); + CAnimBlendAssociation *jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_JUMP_GLIDE); if (!jumpAssoc) - jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_GLIDE); + jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL_GLIDE); if (jumpAssoc) { jumpAssoc->blendDelta = -3.0f; @@ -2675,7 +2684,7 @@ CPed::ProcessControl(void) Wait(); if (m_nPedState != PED_IDLE) { - CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_ARMED); + CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_BIGGUN); if(idleAssoc) { idleAssoc->blendDelta = -8.0f; idleAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -2694,27 +2703,27 @@ CPed::ProcessControl(void) int16 padWalkX = pad->GetPedWalkLeftRight(); int16 padWalkY = pad->GetPedWalkUpDown(); if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) { - if (vehAnim == ANIM_CAR_OPEN_LHS || vehAnim == ANIM_CAR_OPEN_RHS || vehAnim == ANIM_COACH_OPEN_L || vehAnim == ANIM_COACH_OPEN_R || - vehAnim == ANIM_VAN_OPEN_L || vehAnim == ANIM_VAN_OPEN) { + if (vehAnim == ANIM_STD_CAR_OPEN_DOOR_LHS || vehAnim == ANIM_STD_CAR_OPEN_DOOR_RHS || vehAnim == ANIM_STD_COACH_OPEN_LHS || vehAnim == ANIM_STD_COACH_OPEN_RHS || + vehAnim == ANIM_STD_VAN_OPEN_DOOR_REAR_LHS || vehAnim == ANIM_STD_VAN_OPEN_DOOR_REAR_RHS) { if (!m_pMyVehicle->pDriver) { cancelJack = false; bCancelEnteringCar = true; } else cancelJack = true; - } else if (vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) { + } else if (vehAnim == ANIM_STD_QUICKJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) { cancelJack = true; - } else if (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS) { + } else if (vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_RHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_RHS) { bCancelEnteringCar = true; cancelJack = false; } } - if (cancelJack && vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) { + if (cancelJack && vehAnim == ANIM_STD_QUICKJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) { cancelJack = false; QuitEnteringCar(); RestorePreviousObjective(); } - if (cancelJack && (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS)) { + if (cancelJack && (vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_RHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_RHS)) { cancelJack = false; bCancelEnteringCar = true; } @@ -2874,25 +2883,25 @@ CPed::ProcessControl(void) CAnimBlendAssociation *lbAssoc; CAnimBlendAssociation *sitAssoc; if (m_pMyVehicle->bLowVehicle) { - sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT); + sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_LO); if (!sitAssoc || sitAssoc->blendAmount < 1.0f) { break; } - lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_LOW_L); + lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_LEFT_LO); lbAssoc = nil; - rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_LOW_R); + rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_RIGHT_LO); } else { - sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SIT); + sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT); if (!sitAssoc || sitAssoc->blendAmount < 1.0f) { break; } - lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_L); - rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_R); - lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LB); + lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_LEFT); + rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_RIGHT); + lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_LOOKBEHIND); if (lbAssoc && TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON @@ -2901,10 +2910,10 @@ CPed::ProcessControl(void) } } - CAnimBlendAssociation *driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_L); + CAnimBlendAssociation *driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if (!driveByAssoc) - driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_R); + driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if (m_pMyVehicle->bLowVehicle || m_pMyVehicle->m_fGasPedal >= 0.0f || driveByAssoc) { if (steerAngle == 0.0f || driveByAssoc) { @@ -2920,9 +2929,9 @@ CPed::ProcessControl(void) if (rDriveAssoc) rDriveAssoc->blendAmount = clamp(steerAngle * -100.0f / 61.0f, 0.0f, 1.0f); else if (m_pMyVehicle->bLowVehicle) - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_LOW_R); + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_RIGHT_LO); else - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_R); + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_RIGHT); } else { if (rDriveAssoc) @@ -2931,9 +2940,9 @@ CPed::ProcessControl(void) if (lDriveAssoc) lDriveAssoc->blendAmount = clamp(steerAngle * 100.0f / 61.0f, 0.0f, 1.0f); else if (m_pMyVehicle->bLowVehicle) - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_LOW_L); + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_LEFT_LO); else - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_L); + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_LEFT); } if (lbAssoc) @@ -2943,7 +2952,7 @@ CPed::ProcessControl(void) if ((TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_1STPERSON || TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking != LOOKING_LEFT) && (!lbAssoc || lbAssoc->blendAmount < 1.0f)) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LB, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_LOOKBEHIND, 4.0f); } } break; @@ -2953,12 +2962,12 @@ CPed::ProcessControl(void) break; case PED_HANDS_UP: if (m_pedStats->m_temper <= 50) { - if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_HANDSCOWER)) { - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_HANDSCOWER); + if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HANDSCOWER)) { + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSCOWER); Say(SOUND_PED_HANDS_COWER); } - } else if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_HANDSUP)) { - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_HANDSUP); + } else if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HANDSUP)) { + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSUP); Say(SOUND_PED_HANDS_UP); } break; @@ -3150,7 +3159,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) upperSpeedLimit *= 2.0f; lowerSpeedLimit *= 1.5f; } - CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL); + CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); if (!bWasStanding && speed > upperSpeedLimit && (/*!bPushedAlongByCar ||*/ m_vecMoveSpeed.z < lowerSpeedLimit) && m_pCollidingEntity != collidingEnt) { @@ -3174,7 +3183,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) } #else float speedSqr = 0.0f; - CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL); + CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); if (!bWasStanding && (m_vecMoveSpeed.z < -0.25f || (speedSqr = m_vecMoveSpeed.MagnitudeSqr()) > sq(0.5f))) { if (speedSqr == 0.0f) speedSqr = sq(m_vecMoveSpeed.z); @@ -3326,10 +3335,10 @@ CPed::PlayFootSteps(void) if ( IsPlayer() ) { - runStopAsoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP); + runStopAsoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); if ( runStopAsoc == NULL ) - runStopAsoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP_R); + runStopAsoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); } if ( runStopAsoc != NULL && runStopAsoc->blendAmount > 0.1f ) @@ -4158,7 +4167,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg) #ifdef VC_PED_PORTS else if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { ped->m_fHealth = 0.0f; - ped->SetDie(ANIM_FLOOR_HIT, 4.0f, 0.5f); + ped->SetDie(ANIM_STD_HIT_FLOOR, 4.0f, 0.5f); } #endif @@ -4286,7 +4295,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg) ped->bOnBoat = false; if (ped->bBusJacked) { - ped->SetFall(1500, ANIM_KO_SKID_BACK, false); + ped->SetFall(1500, ANIM_STD_HIGHIMPACT_BACK, false); ped->bBusJacked = false; } ped->m_nStoredMoveState = PEDMOVE_NONE; @@ -4310,7 +4319,7 @@ CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg) CVehicle *vehicle; CPed *ped = (CPed*)arg; - quickJackedAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_CAR_QJACKED); + quickJackedAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_STD_QUICKJACKED); if (ped->m_nPedState != PED_ARRESTED) { ped->m_nLastPedState = PED_NONE; if (dragAssoc) @@ -4343,7 +4352,7 @@ CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg) if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { dragAssoc->SetDeleteCallback(PedSetDraggedOutCarPositionCB, ped); ped->m_fHealth = 0.0f; - ped->SetDie(ANIM_FLOOR_HIT, 1000.0f, 0.5f); + ped->SetDie(ANIM_STD_HIT_FLOOR, 1000.0f, 0.5f); return; } #endif @@ -4353,7 +4362,7 @@ CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg) } else { dragAssoc->SetDeleteCallback(PedSetDraggedOutCarPositionCB, ped); if (ped->CanSetPedState()) - CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_GETUP1, 1000.0f); + CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_GET_UP, 1000.0f); } ped->ReplaceWeaponWhenExitingVehicle(); @@ -4588,14 +4597,14 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) if (veh->pDriver == ped) { if (veh->bLowVehicle) { - ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_LSIT, 100.0f); + ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_LO, 100.0f); } else { - ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f); + ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); } } else if (veh->bLowVehicle) { - ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SITPLO, 100.0f); + ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_P_LO, 100.0f); } else { - ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SITP, 100.0f); + ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_P, 100.0f); } ped->StopNonPartialAnims(); @@ -4839,7 +4848,7 @@ CPed::PreRender(void) if (Abs(speed.x) <= 0.05f && Abs(speed.y) <= 0.05f) { if (!OnGround() && m_nPedState != PED_ATTACK && m_nPedState != PED_FIGHT) { - if (!IsPedHeadAbovePos(0.3f) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED)) { + if (!IsPedHeadAbovePos(0.3f) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED)) { doSplashUp = false; } } else @@ -4973,8 +4982,8 @@ CPed::Idle(void) } } - CAnimBlendAssociation *armedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_ARMED); - CAnimBlendAssociation *unarmedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); + CAnimBlendAssociation *armedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_BIGGUN); + CAnimBlendAssociation *unarmedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); int waitTime; if (m_nMoveState == PEDMOVE_STILL) { @@ -4989,7 +4998,7 @@ CPed::Idle(void) m_moved = CVector2D(0.0f, 0.0f); return; } - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_ARMED, 3.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_BIGGUN, 3.0f); waitTime = CGeneral::GetRandomNumberInRange(4000, 7500); } else { armedIdleAssoc->blendDelta = -2.0f; @@ -5113,7 +5122,7 @@ CPed::SetInTheAir(void) return; bIsInTheAir = true; - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FALL_GLIDE, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_GLIDE, 4.0f); if (m_nPedState == PED_ATTACK) { ClearAttack(); @@ -5144,9 +5153,9 @@ CPed::InTheAir(void) ) SetLanding(); } else { - if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL)) { + if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL)) { if (m_vecMoveSpeed.z < -0.1f) - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FALL_FALL, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL, 4.0f); } } } @@ -5159,19 +5168,19 @@ CPed::SetLanding(void) if (DyingOrDead()) return; - CAnimBlendAssociation *fallAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL); + CAnimBlendAssociation *fallAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); CAnimBlendAssociation *landAssoc; RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f); if (fallAssoc) { - landAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_FALL_COLLAPSE); + landAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_COLLAPSE); DMAudio.PlayOneShot(m_audioEntityId, SOUND_FALL_COLLAPSE, 1.0f); if (IsPlayer()) Say(SOUND_PED_LAND); } else { - landAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_FALL_LAND); + landAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_LAND); DMAudio.PlayOneShot(m_audioEntityId, SOUND_FALL_LAND, 1.0f); } @@ -5222,25 +5231,25 @@ CPed::SetGetUp(void) bGetUpAnimStarted = true; m_pCollidingEntity = nil; bKnockedUpIntoAir = false; - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_SPRINT); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNFAST); if (animAssoc) { - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN)) { - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_RUN, 8.0f); + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUN)) { + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_RUN, 8.0f); } else { - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 8.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 8.0f); } animAssoc->flags |= ASSOC_DELETEFADEDOUT; } if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_GETUP_FRONT, 1000.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GET_UP_FRONT, 1000.0f); else - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_GETUP1, 1000.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GET_UP, 1000.0f); animAssoc->SetFinishCallback(PedGetupCB,this); } else { m_fHealth = 0.0f; - SetDie(NUM_ANIMS, 4.0f, 0.0f); + SetDie(ANIM_STD_NUM, 4.0f, 0.0f); } } @@ -6087,7 +6096,7 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType) if (neededTurn <= DEGTORAD(90.0f) || veh->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) { SetLookFlag(veh, true); if ((CGeneral::GetRandomNumber() & 1) && veh->GetModelIndex() != MI_RCBANDIT && animType == 0) { - stepAnim = ANIM_IDLE_TAXI; + stepAnim = ANIM_STD_HAILTAXI; } else { float vehDirection = CGeneral::GetRadianAngleBetweenPoints( @@ -6110,11 +6119,11 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType) else angleToFace = vehDirection + HALFPI; - stepAnim = NUM_ANIMS; + stepAnim = ANIM_STD_NUM; if (animType == 0 || animType == 1) - stepAnim = ANIM_EV_STEP; + stepAnim = ANIM_STD_EVADE_STEP; else if (animType == 2) - stepAnim = ANIM_HANDSCOWER; + stepAnim = ANIM_STD_HANDSCOWER; } if (!RpAnimBlendClumpGetAssociation(GetClump(), stepAnim)) { CAnimBlendAssociation *stepAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, stepAnim, 8.0f); @@ -6216,11 +6225,11 @@ CPed::SetEvasiveDive(CPhysical *reason, uint8 onlyRandomJump) ClearLookFlag(); ClearAimFlag(); SetLookFlag(reason, true); - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_HANDSUP); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HANDSUP); if (animAssoc) return; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_HANDSUP, 8.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSUP, 8.0f); animAssoc->flags &= ~ASSOC_DELETEFADEDOUT; animAssoc->SetFinishCallback(PedEvadeCB, this); SetStoredState(); @@ -6231,7 +6240,7 @@ CPed::SetEvasiveDive(CPhysical *reason, uint8 onlyRandomJump) ClearAimFlag(); SetStoredState(); SetPedState(PED_DIVE_AWAY); - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_EV_DIVE, 8.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_EVADE_DIVE, 8.0f); animAssoc->SetFinishCallback(PedEvadeCB, this); } @@ -6262,7 +6271,7 @@ CPed::PedEvadeCB(CAnimBlendAssociation* animAssoc, void* arg) if (ped->m_nPedState == PED_DIVE_AWAY || ped->m_nPedState == PED_STEP_AWAY) ped->RestorePreviousState(); - } else if (animAssoc->animId == ANIM_EV_DIVE) { + } else if (animAssoc->animId == ANIM_STD_EVADE_DIVE) { ped->bUpdateAnimHeading = true; ped->ClearLookFlag(); if (ped->m_nPedState == PED_DIVE_AWAY) @@ -6320,7 +6329,7 @@ CPed::SetDie(AnimationId animId, float delta, float speed) } SetPedState(PED_DIE); - if (animId == NUM_ANIMS) { + if (animId == ANIM_STD_NUM) { bIsPedDieAnimPlaying = false; } else { CAnimBlendAssociation *dieAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animId, delta); @@ -6429,7 +6438,7 @@ CPed::Chat(void) } if (bIsTalking) { if (CGeneral::GetRandomNumber() < 512) { - CAnimBlendAssociation *chatAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_CHAT); + CAnimBlendAssociation *chatAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CHAT); if (chatAssoc) { chatAssoc->blendDelta = -4.0f; chatAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -6441,10 +6450,10 @@ CPed::Chat(void) } else { if (CGeneral::GetRandomNumber() < 20 && !RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_IDLE)) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_XPRESS_SCRATCH, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_XPRESS_SCRATCH, 4.0f); } if (!bIsTalking && !RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_IDLE)) { - CAnimBlendAssociation *chatAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_CHAT, 4.0f); + CAnimBlendAssociation *chatAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CHAT, 4.0f); float chatTime = CGeneral::GetRandomNumberInRange(0.0f, 3.0f); chatAssoc->SetCurrentTime(chatTime); @@ -6461,7 +6470,7 @@ CPed::Chat(void) void CPed::ClearChat(void) { - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_CHAT); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CHAT); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -6477,10 +6486,10 @@ ReportPhonePickUpCB(CAnimBlendAssociation* assoc, void* arg) { CPed* ped = (CPed*)arg; ped->m_nMoveState = PEDMOVE_STILL; - CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_IDLE_STANCE, 8.0f); + CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE, 8.0f); if (assoc->blendAmount > 0.5f && ped) { - CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_PHONE_TALK, 8.0f); + CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_TALK, 8.0f); } } @@ -6524,7 +6533,7 @@ CPed::FacePhone(void) ClearLookFlag(); SetIdle(); m_phoneTalkTimer = CTimer::GetTimeInMilliseconds() + 10000; - CAnimBlendAssociation* assoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_PHONE_IN, 4.0f); + CAnimBlendAssociation* assoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_IN, 4.0f); assoc->SetFinishCallback(ReportPhonePickUpCB, this); return true; } @@ -6579,9 +6588,9 @@ CPed::MakePhonecall(void) return false; #ifdef PEDS_REPORT_CRIMES_ON_PHONE - CAnimBlendAssociation* talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_PHONE_TALK); + CAnimBlendAssociation* talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_PHONE_TALK); if (talkAssoc && talkAssoc->blendAmount > 0.5f) { - CAnimBlendAssociation* endAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_PHONE_OUT, 8.0f); + CAnimBlendAssociation* endAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_OUT, 8.0f); endAssoc->flags &= ~ASSOC_DELETEFADEDOUT; endAssoc->SetFinishCallback(ReportPhonePutDownCB, this); } @@ -6911,18 +6920,18 @@ CPed::SetPedPositionInCar(void) if (bChangedSeat) { bool notYet = false; - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_GETIN_LHS) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_GETIN_LOW_LHS) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_CLOSEDOOR_LHS) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_CLOSEDOOR_LOW_LHS) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SHUFFLE_RHS) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSHUFFLE_RHS) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_CLOSE_L) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_CLOSE) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_GETIN_L) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_GETIN) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_COACH_IN_L) - || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_COACH_IN_R)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_GET_IN_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_GET_IN_LO_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_LO_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SHUFFLE_RHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SHUFFLE_LO_RHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_GET_IN_REAR_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_GET_IN_REAR_RHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_COACH_GET_IN_LHS) + || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_COACH_GET_IN_RHS)) { notYet = true; } if (notYet) { @@ -7175,7 +7184,7 @@ CPed::LookForInterestingNodes(void) void CPed::SetWaitState(eWaitState state, void *time) { - AnimationId waitAnim = NUM_ANIMS; + AnimationId waitAnim = ANIM_STD_NUM; CAnimBlendAssociation *animAssoc; if (!IsPedInControl()) @@ -7191,10 +7200,10 @@ CPed::SetWaitState(eWaitState state, void *time) break; case WAITSTATE_CROSS_ROAD: m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 1000; - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_HBHB, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_HBHB, 4.0f); break; case WAITSTATE_CROSS_ROAD_LOOK: - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ROAD_CROSS, 8.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_ROADCROSS, 8.0f); if (time) m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time; @@ -7210,7 +7219,7 @@ CPed::SetWaitState(eWaitState state, void *time) case WAITSTATE_DOUBLEBACK: m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 3500; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_HBHB, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_HBHB, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif @@ -7218,7 +7227,7 @@ CPed::SetWaitState(eWaitState state, void *time) case WAITSTATE_HITWALL: m_headingRate = 2.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_HIT_WALL, 16.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_WALL, 16.0f); animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc->flags |= ASSOC_FADEOUTWHENDONE; animAssoc->SetDeleteCallback(FinishedWaitCB, this); @@ -7232,14 +7241,14 @@ CPed::SetWaitState(eWaitState state, void *time) case WAITSTATE_TURN180: m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TURN_180, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_TURN180, 4.0f); animAssoc->SetFinishCallback(FinishedWaitCB, this); animAssoc->SetDeleteCallback(RestoreHeadingRateCB, this); break; case WAITSTATE_SURPRISE: m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 2000; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_HIT_WALL, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_WALL, 4.0f); animAssoc->SetFinishCallback(FinishedWaitCB, this); break; case WAITSTATE_STUCK: @@ -7247,7 +7256,7 @@ CPed::SetWaitState(eWaitState state, void *time) SetMoveAnim(); m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif @@ -7263,20 +7272,20 @@ CPed::SetWaitState(eWaitState state, void *time) SetMoveAnim(); m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_HBHB, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_HBHB, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif break; case WAITSTATE_PLAYANIM_COWER: - waitAnim = ANIM_HANDSCOWER; + waitAnim = ANIM_STD_HANDSCOWER; case WAITSTATE_PLAYANIM_HANDSUP: - if (waitAnim == NUM_ANIMS) - waitAnim = ANIM_HANDSUP; + if (waitAnim == ANIM_STD_NUM) + waitAnim = ANIM_STD_HANDSUP; case WAITSTATE_PLAYANIM_HANDSCOWER: - if (waitAnim == NUM_ANIMS) - waitAnim = ANIM_HANDSCOWER; + if (waitAnim == ANIM_STD_NUM) + waitAnim = ANIM_STD_HANDSCOWER; m_headingRate = 0.0f; if (time) m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time; @@ -7287,13 +7296,13 @@ CPed::SetWaitState(eWaitState state, void *time) animAssoc->SetDeleteCallback(FinishedWaitCB, this); break; case WAITSTATE_PLAYANIM_DUCK: - waitAnim = ANIM_DUCK_DOWN; + waitAnim = ANIM_STD_DUCK_DOWN; case WAITSTATE_PLAYANIM_TAXI: - if (waitAnim == NUM_ANIMS) - waitAnim = ANIM_IDLE_TAXI; + if (waitAnim == ANIM_STD_NUM) + waitAnim = ANIM_STD_HAILTAXI; case WAITSTATE_PLAYANIM_CHAT: - if (waitAnim == NUM_ANIMS) - waitAnim = ANIM_IDLE_CHAT; + if (waitAnim == ANIM_STD_NUM) + waitAnim = ANIM_STD_CHAT; if (time) m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time; else @@ -7309,7 +7318,7 @@ CPed::SetWaitState(eWaitState state, void *time) SetMoveAnim(); m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 2500; - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif @@ -7325,7 +7334,7 @@ CPed::SetWaitState(eWaitState state, void *time) void CPed::Wait(void) { - AnimationId mustHaveAnim = NUM_ANIMS; + AnimationId mustHaveAnim = ANIM_STD_NUM; CAnimBlendAssociation *animAssoc; CPed *pedWeLook; @@ -7353,7 +7362,7 @@ CPed::Wait(void) else SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, nil); - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_HBHB); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_HBHB); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -7364,7 +7373,7 @@ CPed::Wait(void) case WAITSTATE_CROSS_ROAD_LOOK: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { m_nWaitState = WAITSTATE_FALSE; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ROAD_CROSS); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -7377,7 +7386,7 @@ CPed::Wait(void) uint32 timeLeft = m_nWaitTimer - CTimer::GetTimeInMilliseconds(); if (timeLeft < 2500 && timeLeft > 2000) { m_nWaitTimer -= 500; - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_XPRESS_SCRATCH, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_XPRESS_SCRATCH, 4.0f); } } else { m_nWaitState = WAITSTATE_FALSE; @@ -7411,8 +7420,8 @@ CPed::Wait(void) case WAITSTATE_SURPRISE: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_HIT_WALL)) { - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_XPRESS_SCRATCH, 4.0f); + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HIT_WALL)) { + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_XPRESS_SCRATCH, 4.0f); animAssoc->SetFinishCallback(FinishedWaitCB, this); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; } else { @@ -7425,14 +7434,14 @@ CPed::Wait(void) if (CTimer::GetTimeInMilliseconds() <= m_nWaitTimer) break; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_TURN_180); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_TURN180); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_XPRESS_SCRATCH); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_XPRESS_SCRATCH); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ROAD_CROSS); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (animAssoc) { if (animAssoc->IsPartial()) { @@ -7440,10 +7449,10 @@ CPed::Wait(void) animAssoc->flags |= ASSOC_DELETEFADEDOUT; } else { animAssoc->flags |= ASSOC_DELETEFADEDOUT; - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); } - if (animAssoc->animId == ANIM_TURN_180) { + if (animAssoc->animId == ANIM_STD_TURN180) { m_fRotationCur = CGeneral::LimitRadianAngle(PI + m_fRotationCur); m_nWaitState = WAITSTATE_FALSE; SetMoveState(PEDMOVE_WALK); @@ -7457,16 +7466,16 @@ CPed::Wait(void) switch (CGeneral::GetRandomNumber() & 3) { case 0: - animToPlay = ANIM_ROAD_CROSS; + animToPlay = ANIM_STD_ROADCROSS; break; case 1: - animToPlay = ANIM_IDLE_TIRED; + animToPlay = ANIM_STD_IDLE_TIRED; break; case 2: - animToPlay = ANIM_XPRESS_SCRATCH; + animToPlay = ANIM_STD_XPRESS_SCRATCH; break; case 3: - animToPlay = ANIM_TURN_180; + animToPlay = ANIM_STD_TURN180; break; default: break; @@ -7474,7 +7483,7 @@ CPed::Wait(void) animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f); - if (animToPlay == ANIM_TURN_180) + if (animToPlay == ANIM_STD_TURN180) animAssoc->SetFinishCallback(FinishedWaitCB, this); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(1500, 5000); @@ -7483,7 +7492,7 @@ CPed::Wait(void) case WAITSTATE_LOOK_ABOUT: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { m_nWaitState = WAITSTATE_FALSE; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_HBHB); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_HBHB); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -7492,11 +7501,11 @@ CPed::Wait(void) break; case WAITSTATE_PLAYANIM_HANDSUP: - mustHaveAnim = ANIM_HANDSUP; + mustHaveAnim = ANIM_STD_HANDSUP; case WAITSTATE_PLAYANIM_HANDSCOWER: - if (mustHaveAnim == NUM_ANIMS) - mustHaveAnim = ANIM_HANDSCOWER; + if (mustHaveAnim == ANIM_STD_NUM) + mustHaveAnim = ANIM_STD_HANDSCOWER; animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), mustHaveAnim); pedWeLook = (CPed*) m_pLookTarget; @@ -7564,19 +7573,19 @@ CPed::Wait(void) } break; case WAITSTATE_PLAYANIM_COWER: - mustHaveAnim = ANIM_HANDSCOWER; + mustHaveAnim = ANIM_STD_HANDSCOWER; case WAITSTATE_PLAYANIM_DUCK: - if (mustHaveAnim == NUM_ANIMS) - mustHaveAnim = ANIM_DUCK_DOWN; + if (mustHaveAnim == ANIM_STD_NUM) + mustHaveAnim = ANIM_STD_DUCK_DOWN; case WAITSTATE_PLAYANIM_TAXI: - if (mustHaveAnim == NUM_ANIMS) - mustHaveAnim = ANIM_IDLE_TAXI; + if (mustHaveAnim == ANIM_STD_NUM) + mustHaveAnim = ANIM_STD_HAILTAXI; case WAITSTATE_PLAYANIM_CHAT: - if (mustHaveAnim == NUM_ANIMS) - mustHaveAnim = ANIM_IDLE_CHAT; + if (mustHaveAnim == ANIM_STD_NUM) + mustHaveAnim = ANIM_STD_CHAT; if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), mustHaveAnim); @@ -7602,11 +7611,11 @@ CPed::Wait(void) break; case WAITSTATE_FINISH_FLEE: - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (animAssoc) { if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); int timer = 2000; m_nWaitState = WAITSTATE_FALSE; SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, &timer); @@ -7686,7 +7695,7 @@ CPed::SetSolicit(uint32 time) m_chatTimer = CTimer::GetTimeInMilliseconds() + time; if(!m_carInObjective->bIsVan && !m_carInObjective->bIsBus) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_HOOKERTALK, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_HOOKERTALK, 4.0f); SetPedState(PED_SOLICIT); } @@ -7713,7 +7722,7 @@ CPed::Solicit(void) if ((GetPosition() - doorPos).MagnitudeSqr() <= 1.0f) return; - CAnimBlendAssociation *talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_HOOKERTALK); + CAnimBlendAssociation *talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_HOOKERTALK); if (talkAssoc) { talkAssoc->blendDelta = -1000.0f; talkAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -7959,12 +7968,12 @@ CPed::SetJump(void) { if (!bInVehicle && #if defined VC_PED_PORTS || defined FIX_BUGS - m_nPedState != PED_JUMP && !RpAnimBlendClumpGetAssociation(GetClump(), ANIM_JUMP_LAUNCH) && + m_nPedState != PED_JUMP && !RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_JUMP_LAUNCH) && #endif (m_nSurfaceTouched != SURFACE_STEEP_CLIFF || DotProduct(GetForward(), m_vecDamageNormal) >= 0.0f)) { SetStoredState(); SetPedState(PED_JUMP); - CAnimBlendAssociation *jumpAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_JUMP_LAUNCH, 8.0f); + CAnimBlendAssociation *jumpAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_JUMP_LAUNCH, 8.0f); jumpAssoc->SetFinishCallback(FinishLaunchCB, this); m_fRotationDest = m_fRotationCur; } @@ -7993,7 +8002,7 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg) animAssoc->flags |= ASSOC_DELETEFADEDOUT; // ANIM_HIT_WALL in VC (which makes more sense) - CAnimBlendAssociation *handsCoverAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_HANDSCOWER, 8.0f); + CAnimBlendAssociation *handsCoverAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSCOWER, 8.0f); handsCoverAssoc->flags &= ~ASSOC_FADEOUTWHENDONE; handsCoverAssoc->SetFinishCallback(FinishHitHeadCB, ped); ped->bIsLanding = true; @@ -8001,12 +8010,12 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg) } float velocityFromAnim = 0.1f; - CAnimBlendAssociation *sprintAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_SPRINT); + CAnimBlendAssociation *sprintAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_STD_RUNFAST); if (sprintAssoc) { velocityFromAnim = 0.05f * sprintAssoc->blendAmount + 0.17f; } else { - CAnimBlendAssociation *runAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_RUN); + CAnimBlendAssociation *runAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_STD_RUN); if (runAssoc) { velocityFromAnim = 0.07f * runAssoc->blendAmount + 0.1f; } @@ -8050,7 +8059,7 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg) ped->bIsStanding = false; ped->bIsInTheAir = true; animAssoc->blendDelta = -1000.0f; - CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_JUMP_GLIDE); + CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_JUMP_GLIDE); if (ped->bDoBloodyFootprints) { CVector bloodPos(0.0f, 0.0f, 0.0f); @@ -8318,7 +8327,7 @@ CPed::WarpPedIntoCar(CVehicle *car) #else if (car->IsBoat()) { #ifndef FIX_BUGS - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f); #else m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f); #endif @@ -8329,9 +8338,9 @@ CPed::WarpPedIntoCar(CVehicle *car) RemoveWeaponWhenEnteringVehicle(); if (car->bLowVehicle) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LSIT, 100.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_LO, 100.0f); else - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); } #endif diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp index 089c8d9d..7f7120af 100644 --- a/src/peds/PedAI.cpp +++ b/src/peds/PedAI.cpp @@ -1121,7 +1121,7 @@ CPed::ProcessObjective(void) if (m_attackTimer < CTimer::GetTimeInMilliseconds() && distWithTargetSc < wepRange && m_pedInObjective->m_nPedState != PED_GETUP && m_pedInObjective->m_nPedState != PED_DRAG_FROM_CAR) { if (bIsDucking) { - CAnimBlendAssociation *duckAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_DOWN); + CAnimBlendAssociation *duckAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_DOWN); if (duckAnim) { duckAnim->blendDelta = -2.0f; break; @@ -1202,14 +1202,14 @@ CPed::ProcessObjective(void) // This is weird... if (bNotAllowedToDuck && bKindaStayInSamePlace) { if (!bIsDucking) { - CAnimBlendAssociation* duckAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_DOWN); + CAnimBlendAssociation* duckAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_DOWN); if (!duckAnim || duckAnim->blendDelta < 0.0f) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DUCK_DOWN, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_DUCK_DOWN, 4.0f); bIsDucking = true; } break; } else { - CAnimBlendAssociation* duckAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_DOWN); + CAnimBlendAssociation* duckAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_DOWN); if (!duckAnim || duckAnim->blendDelta < 0.0f) { bIsDucking = false; } else { @@ -1701,9 +1701,9 @@ CPed::ProcessObjective(void) } break; case OBJECTIVE_HAIL_TAXI: - if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TAXI) && CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { + if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HAILTAXI) && CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { Say(SOUND_PED_TAXI_WAIT); - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TAXI, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HAILTAXI, 4.0f); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 2000; } break; @@ -1813,7 +1813,7 @@ CPed::ProcessObjective(void) float distWithTargetScSqr = distWithTarget.MagnitudeSqr(); if (distWithTargetScSqr <= sq(10.0f)) { if (distWithTargetScSqr <= sq(1.4f)) { - CAnimBlendAssociation *reloadAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_AK_RELOAD); + CAnimBlendAssociation *reloadAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_AK_RELOAD); m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( m_pedInObjective->GetPosition().x, m_pedInObjective->GetPosition().y, GetPosition().x, GetPosition().y); @@ -1821,7 +1821,7 @@ CPed::ProcessObjective(void) if (reloadAssoc || !m_pedInObjective->IsPedShootable()) { if (reloadAssoc && (!reloadAssoc->IsRunning() || reloadAssoc->currentTime / reloadAssoc->hierarchy->totalLength > 0.8f)) { - CAnimBlendAssociation *punchAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_PPUNCH, 8.0f); + CAnimBlendAssociation *punchAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PARTIAL_PUNCH, 8.0f); punchAssoc->flags |= ASSOC_DELETEFADEDOUT; punchAssoc->flags |= ASSOC_FADEOUTWHENDONE; CVector2D offset(distWithTarget.x, distWithTarget.y); @@ -1850,13 +1850,13 @@ CPed::ProcessObjective(void) if (weaponType != WEAPONTYPE_UNARMED && weaponType != WEAPONTYPE_BASEBALLBAT) SetCurrentWeapon(WEAPONTYPE_UNARMED); - CAnimBlendAssociation *newReloadAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_AK_RELOAD, 8.0f); + CAnimBlendAssociation *newReloadAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_AK_RELOAD, 8.0f); newReloadAssoc->flags |= ASSOC_DELETEFADEDOUT; newReloadAssoc->flags |= ASSOC_FADEOUTWHENDONE; } } else { SetSeek(m_pedInObjective, 1.0f); - CAnimBlendAssociation *walkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK); + CAnimBlendAssociation *walkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_WALK); if (walkAssoc) walkAssoc->speed = 1.3f; @@ -2256,26 +2256,26 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg) } if (enterDoor != DOOR_FRONT_LEFT && enterDoor != DOOR_REAR_LEFT) { if (itsVan) { - enterAnim = ANIM_VAN_GETIN; + enterAnim = ANIM_STD_VAN_GET_IN_REAR_RHS; } else if (itsBus) { - enterAnim = ANIM_COACH_IN_R; + enterAnim = ANIM_STD_COACH_GET_IN_RHS; #ifdef FIX_BUGS } else if (itsLow) { - enterAnim = ANIM_CAR_GETIN_LOW_RHS; + enterAnim = ANIM_STD_CAR_GET_IN_LO_RHS; #endif } else { - enterAnim = ANIM_CAR_GETIN_RHS; + enterAnim = ANIM_STD_CAR_GET_IN_RHS; } } else if (itsVan) { - enterAnim = ANIM_VAN_GETIN_L; + enterAnim = ANIM_STD_VAN_GET_IN_REAR_LHS; } else if (itsBus) { - enterAnim = ANIM_COACH_IN_L; + enterAnim = ANIM_STD_COACH_GET_IN_LHS; #ifdef FIX_BUGS } else if (itsLow) { - enterAnim = ANIM_CAR_GETIN_LOW_LHS; + enterAnim = ANIM_STD_CAR_GET_IN_LO_LHS; #endif } else { - enterAnim = ANIM_CAR_GETIN_LHS; + enterAnim = ANIM_STD_CAR_GET_IN_LHS; } ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, enterAnim); ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); @@ -2285,16 +2285,16 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg) veh->AutoPilot.m_nCruiseSpeed = 0; if (enterDoor != DOOR_FRONT_LEFT && enterDoor != DOOR_REAR_LEFT) { if (itsVan) { - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_VAN_OPEN); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_VAN_OPEN_DOOR_REAR_RHS); } else if (itsBus) { - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_COACH_OPEN_R); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_COACH_OPEN_RHS); } else { - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_OPEN_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_OPEN_DOOR_RHS); } } else if (itsVan) { - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_VAN_OPEN_L); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_VAN_OPEN_DOOR_REAR_LHS); } else if (itsBus) { - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_COACH_OPEN_L); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_COACH_OPEN_LHS); } else { if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && veh->pDriver) { @@ -2303,7 +2303,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg) && veh->pDriver->CharCreatedBy != MISSION_CHAR && veh->pDriver->m_nPedState == PED_DRIVING) { - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_QJACK); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_QUICKJACK); ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); veh->pDriver->SetBeingDraggedFromCar(veh, ped->m_vehDoor, true); @@ -2312,15 +2312,15 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg) return; } } - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_OPEN_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_OPEN_DOOR_LHS); } ped->m_pVehicleAnim->SetFinishCallback(PedAnimDoorOpenCB, ped); } else { if (enterDoor != DOOR_FRONT_LEFT && enterDoor != DOOR_REAR_LEFT) - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_DOORLOCKED_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CARDOOR_LOCKED_RHS); else - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_DOORLOCKED_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CARDOOR_LOCKED_LHS); ped->bCancelEnteringCar = true; ped->m_pVehicleAnim->SetFinishCallback(PedAnimDoorOpenCB, ped); @@ -2393,13 +2393,13 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg) if (veh->m_vecMoveSpeed.Magnitude() > 0.2f) { ped->QuitEnteringCar(); if (ped->m_vehDoor != CAR_DOOR_LF && ped->m_vehDoor != CAR_DOOR_LR) - ped->SetFall(1000, ANIM_KO_SPIN_R, false); + ped->SetFall(1000, ANIM_STD_HIGHIMPACT_LEFT, false); else - ped->SetFall(1000, ANIM_KO_SPIN_L, false); + ped->SetFall(1000, ANIM_STD_HIGHIMPACT_RIGHT, false); return; } - veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_CAR_OPEN_LHS, 1.0f); + veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_STD_CAR_OPEN_DOOR_LHS, 1.0f); if (ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_RF) isVan = false; @@ -2409,22 +2409,22 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg) if (ped->m_vehDoor != CAR_DOOR_LF && ped->m_vehDoor != CAR_DOOR_LR) { if (isVan) { - animToPlay = ANIM_VAN_GETIN; + animToPlay = ANIM_STD_VAN_GET_IN_REAR_RHS; } else if (isBus) { - animToPlay = ANIM_COACH_IN_R; + animToPlay = ANIM_STD_COACH_GET_IN_RHS; } else if (isLow) { - animToPlay = ANIM_CAR_GETIN_LOW_RHS; + animToPlay = ANIM_STD_CAR_GET_IN_LO_RHS; } else { - animToPlay = ANIM_CAR_GETIN_RHS; + animToPlay = ANIM_STD_CAR_GET_IN_RHS; } } else if (isVan) { - animToPlay = ANIM_VAN_GETIN_L; + animToPlay = ANIM_STD_VAN_GET_IN_REAR_LHS; } else if (isBus) { - animToPlay = ANIM_COACH_IN_L; + animToPlay = ANIM_STD_COACH_GET_IN_LHS; } else if (isLow) { - animToPlay = ANIM_CAR_GETIN_LOW_LHS; + animToPlay = ANIM_STD_CAR_GET_IN_LO_LHS; } else { - animToPlay = ANIM_CAR_GETIN_LHS; + animToPlay = ANIM_STD_CAR_GET_IN_LHS; } ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, animToPlay); ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); @@ -2451,9 +2451,9 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg) pedToDragOut = nil; } else { if (isLow) - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_PULLOUT_LOW_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_PULL_OUT_PED_LO_RHS); else - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_PULLOUT_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_PULL_OUT_PED_RHS); ped->m_pVehicleAnim->SetFinishCallback(PedAnimPullPedOutCB, ped); } @@ -2468,9 +2468,9 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg) } else { // BUG: Probably we will sit on top of the passenger if his m_ped_flagF4 is true. if (isLow) - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_GETIN_LOW_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_GET_IN_LO_LHS); else - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_GETIN_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_GET_IN_LHS); ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); } @@ -2483,17 +2483,17 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg) pedToDragOut = nil; } else { if (isLow) - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_PULLOUT_LOW_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_PULL_OUT_PED_LO_LHS); else - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_PULLOUT_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_PULL_OUT_PED_LHS); ped->m_pVehicleAnim->SetFinishCallback(PedAnimPullPedOutCB, ped); } } else { if (isLow) - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_GETIN_LOW_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_GET_IN_LO_LHS); else - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_GETIN_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_GET_IN_LHS); ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); } @@ -2577,13 +2577,13 @@ CPed::PedAnimPullPedOutCB(CAnimBlendAssociation* animAssoc, void* arg) AnimationId animToPlay; if (ped->m_vehDoor != CAR_DOOR_LF && ped->m_vehDoor != CAR_DOOR_LR) { if (isLow) - animToPlay = ANIM_CAR_GETIN_LOW_RHS; + animToPlay = ANIM_STD_CAR_GET_IN_LO_RHS; else - animToPlay = ANIM_CAR_GETIN_RHS; + animToPlay = ANIM_STD_CAR_GET_IN_RHS; } else if (isLow) { - animToPlay = ANIM_CAR_GETIN_LOW_LHS; + animToPlay = ANIM_STD_CAR_GET_IN_LO_LHS; } else { - animToPlay = ANIM_CAR_GETIN_LHS; + animToPlay = ANIM_STD_CAR_GET_IN_LHS; } ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, animToPlay); ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); @@ -2717,18 +2717,18 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg) AnimationId animToPlay; if (enterDoor != DOOR_FRONT_LEFT && enterDoor != DOOR_REAR_LEFT) { if (isVan) { - animToPlay = ANIM_VAN_CLOSE; + animToPlay = ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS; } else if (isLow) { - animToPlay = ANIM_CAR_CLOSEDOOR_LOW_RHS; + animToPlay = ANIM_STD_CAR_CLOSE_DOOR_LO_RHS; } else { - animToPlay = ANIM_CAR_CLOSEDOOR_RHS; + animToPlay = ANIM_STD_CAR_CLOSE_DOOR_RHS; } } else if (isVan) { - animToPlay = ANIM_VAN_CLOSE_L; + animToPlay = ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS; } else if (isLow) { - animToPlay = ANIM_CAR_CLOSEDOOR_LOW_LHS; + animToPlay = ANIM_STD_CAR_CLOSE_DOOR_LO_LHS; } else { - animToPlay = ANIM_CAR_CLOSEDOOR_LHS; + animToPlay = ANIM_STD_CAR_CLOSE_DOOR_LHS; } ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, animToPlay); ped->m_pVehicleAnim->SetFinishCallback(PedAnimDoorCloseCB, ped); @@ -2749,7 +2749,7 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg) bool isLow = !!veh->bLowVehicle; if (!veh->bIsBus) - veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_CAR_CLOSEDOOR_LHS, 1.0f); + veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_STD_CAR_CLOSE_DOOR_LHS, 1.0f); eDoors door; switch (ped->m_vehDoor) { @@ -2796,9 +2796,9 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg) animAssoc->blendDelta = -1000.0f; if (isLow) - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_LSHUFFLE_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SHUFFLE_LO_RHS); else - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SHUFFLE_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SHUFFLE_RHS); ped->m_pVehicleAnim->SetFinishCallback(PedSetInCarCB, ped); } @@ -2902,7 +2902,7 @@ CPed::PedAnimStepOutCarCB(CAnimBlendAssociation* animAssoc, void* arg) veh->m_vecMoveSpeed += CVector(0.001f, 0.001f, 0.001f); veh->m_vecTurnSpeed += CVector(0.001f, 0.001f, 0.001f); if (!veh->bIsBus) - veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_CAR_GETOUT_LHS, 1.0f); + veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_STD_GETOUT_LHS, 1.0f); /* // Duplicate and only in PC for some reason @@ -2991,16 +2991,16 @@ CPed::PedAnimStepOutCarCB(CAnimBlendAssociation* animAssoc, void* arg) } else { switch (door) { case DOOR_FRONT_LEFT: - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_CLOSE_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_LHS); break; case DOOR_FRONT_RIGHT: - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_CLOSE_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_RHS); break; case DOOR_REAR_LEFT: - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_CLOSE_LHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_LHS); break; case DOOR_REAR_RIGHT: - ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_CLOSE_RHS); + ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_RHS); break; default: break; @@ -3026,19 +3026,19 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) return; if (!bChangedSeat && phase != LINE_UP_TO_CAR_2) { - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SIT)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT)) { SetPedPositionInCar(); return; } - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_LO)) { SetPedPositionInCar(); return; } - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITP)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_P)) { SetPedPositionInCar(); return; } - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITPLO)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_P_LO)) { SetPedPositionInCar(); return; } @@ -3093,22 +3093,22 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) vehAnim = m_pVehicleAnim->animId; switch (vehAnim) { - case ANIM_CAR_JACKED_RHS: - case ANIM_CAR_LJACKED_RHS: - case ANIM_CAR_JACKED_LHS: - case ANIM_CAR_LJACKED_LHS: - case ANIM_VAN_GETIN_L: - case ANIM_VAN_GETIN: + case ANIM_STD_JACKEDCAR_RHS: + case ANIM_STD_JACKEDCAR_LO_RHS: + case ANIM_STD_JACKEDCAR_LHS: + case ANIM_STD_JACKEDCAR_LO_LHS: + case ANIM_STD_VAN_GET_IN_REAR_LHS: + case ANIM_STD_VAN_GET_IN_REAR_RHS: #ifdef VC_PED_PORTS multExtractedFromAnim = true; zBlend = Max(m_pVehicleAnim->currentTime / m_pVehicleAnim->hierarchy->totalLength - 0.3f, 0.0f) / (1.0f - 0.3f); // fall through #endif - case ANIM_CAR_QJACKED: - case ANIM_CAR_GETOUT_LHS: - case ANIM_CAR_GETOUT_LOW_LHS: - case ANIM_CAR_GETOUT_RHS: - case ANIM_CAR_GETOUT_LOW_RHS: + case ANIM_STD_QUICKJACKED: + case ANIM_STD_GETOUT_LHS: + case ANIM_STD_GETOUT_LO_LHS: + case ANIM_STD_GETOUT_RHS: + case ANIM_STD_GETOUT_LO_RHS: #ifdef VC_PED_PORTS if (!multExtractedFromAnim) { multExtractedFromAnim = true; @@ -3116,14 +3116,14 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) } // fall through #endif - case ANIM_CAR_CRAWLOUT_RHS: - case ANIM_CAR_CRAWLOUT_RHS2: - case ANIM_VAN_GETOUT_L: - case ANIM_VAN_GETOUT: + case ANIM_STD_CRAWLOUT_LHS: + case ANIM_STD_CRAWLOUT_RHS: + case ANIM_STD_VAN_GET_OUT_REAR_LHS: + case ANIM_STD_VAN_GET_OUT_REAR_RHS: seatPosMult = m_pVehicleAnim->currentTime / m_pVehicleAnim->hierarchy->totalLength; break; - case ANIM_CAR_GETIN_RHS: - case ANIM_CAR_GETIN_LHS: + case ANIM_STD_CAR_GET_IN_RHS: + case ANIM_STD_CAR_GET_IN_LHS: #ifdef VC_PED_PORTS if (veh && veh->IsCar() && veh->bIsBus) { multExtractedFromAnimBus = true; @@ -3131,27 +3131,27 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) } // fall through #endif - case ANIM_CAR_QJACK: - case ANIM_CAR_GETIN_LOW_LHS: - case ANIM_CAR_GETIN_LOW_RHS: - case ANIM_DRIVE_BOAT: + case ANIM_STD_QUICKJACK: + case ANIM_STD_CAR_GET_IN_LO_LHS: + case ANIM_STD_CAR_GET_IN_LO_RHS: + case ANIM_STD_BOAT_DRIVE: seatPosMult = m_pVehicleAnim->GetTimeLeft() / m_pVehicleAnim->hierarchy->totalLength; break; - case ANIM_CAR_CLOSEDOOR_LHS: - case ANIM_CAR_CLOSEDOOR_LOW_LHS: - case ANIM_CAR_CLOSEDOOR_RHS: - case ANIM_CAR_CLOSEDOOR_LOW_RHS: - case ANIM_CAR_SHUFFLE_RHS: - case ANIM_CAR_LSHUFFLE_RHS: + case ANIM_STD_CAR_CLOSE_DOOR_LHS: + case ANIM_STD_CAR_CLOSE_DOOR_LO_LHS: + case ANIM_STD_CAR_CLOSE_DOOR_RHS: + case ANIM_STD_CAR_CLOSE_DOOR_LO_RHS: + case ANIM_STD_CAR_SHUFFLE_RHS: + case ANIM_STD_CAR_SHUFFLE_LO_RHS: seatPosMult = 0.0f; break; - case ANIM_CAR_CLOSE_LHS: - case ANIM_CAR_CLOSE_RHS: - case ANIM_COACH_OPEN_L: - case ANIM_COACH_OPEN_R: - case ANIM_COACH_IN_L: - case ANIM_COACH_IN_R: - case ANIM_COACH_OUT_L: + case ANIM_STD_CAR_CLOSE_LHS: + case ANIM_STD_CAR_CLOSE_RHS: + case ANIM_STD_COACH_OPEN_LHS: + case ANIM_STD_COACH_OPEN_RHS: + case ANIM_STD_COACH_GET_IN_LHS: + case ANIM_STD_COACH_GET_IN_RHS: + case ANIM_STD_COACH_GET_OUT_LHS: seatPosMult = 1.0f; break; default: @@ -3203,10 +3203,10 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) } else { #endif currentZ = GetPosition().z; - if (m_pVehicleAnim && vehAnim != ANIM_VAN_GETIN_L && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE && vehAnim != ANIM_VAN_GETIN) { + if (m_pVehicleAnim && vehAnim != ANIM_STD_VAN_GET_IN_REAR_LHS && vehAnim != ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS && vehAnim != ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS && vehAnim != ANIM_STD_VAN_GET_IN_REAR_RHS) { neededPos.z = autoZPos.z; m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); - } else if (neededPos.z < currentZ && m_pVehicleAnim && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE) { + } else if (neededPos.z < currentZ && m_pVehicleAnim && vehAnim != ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS && vehAnim != ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS) { adjustedTimeStep = Max(m_pVehicleAnim->timeStep, 0.1f); // Smoothly change ped position @@ -3227,8 +3227,8 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) } else { #endif if (m_pVehicleAnim && - (vehAnim == ANIM_CAR_GETIN_RHS || vehAnim == ANIM_CAR_GETIN_LOW_RHS || vehAnim == ANIM_CAR_GETIN_LHS || vehAnim == ANIM_CAR_GETIN_LOW_LHS - || vehAnim == ANIM_CAR_QJACK || vehAnim == ANIM_VAN_GETIN_L || vehAnim == ANIM_VAN_GETIN)) { + (vehAnim == ANIM_STD_CAR_GET_IN_RHS || vehAnim == ANIM_STD_CAR_GET_IN_LO_RHS || vehAnim == ANIM_STD_CAR_GET_IN_LHS || vehAnim == ANIM_STD_CAR_GET_IN_LO_LHS + || vehAnim == ANIM_STD_QUICKJACK || vehAnim == ANIM_STD_VAN_GET_IN_REAR_LHS || vehAnim == ANIM_STD_VAN_GET_IN_REAR_RHS)) { adjustedTimeStep = Max(m_pVehicleAnim->timeStep, 0.1f); // Smoothly change ped position @@ -3358,9 +3358,9 @@ CPed::SetCarJack_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag) bUsesCollision = false; if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_CAR_ALIGNHI_LHS : ANIM_CAR_ALIGN_LHS, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_STD_CAR_ALIGNHI_DOOR_LHS : ANIM_STD_CAR_ALIGN_DOOR_LHS, 4.0f); else - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_CAR_ALIGNHI_RHS : ANIM_CAR_ALIGN_RHS, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_STD_CAR_ALIGNHI_DOOR_RHS : ANIM_STD_CAR_ALIGN_DOOR_RHS, 4.0f); m_pVehicleAnim->SetFinishCallback(PedAnimAlignCB, this); } @@ -3408,14 +3408,14 @@ CPed::BeingDraggedFromCar(void) PedLineUpPhase lineUpType; if (!m_pVehicleAnim) { - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 100.0f); - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SIT); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 100.0f); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT); if (!animAssoc) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_LO); if (!animAssoc) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITP); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_P); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITPLO); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_P_LO); } } if (animAssoc) @@ -3423,17 +3423,17 @@ CPed::BeingDraggedFromCar(void) if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) { if (bWillBeQuickJacked) { - enterAnim = ANIM_CAR_QJACKED; + enterAnim = ANIM_STD_QUICKJACKED; } else if (m_pMyVehicle->bLowVehicle) { - enterAnim = ANIM_CAR_LJACKED_LHS; + enterAnim = ANIM_STD_JACKEDCAR_LO_LHS; } else { - enterAnim = ANIM_CAR_JACKED_LHS; + enterAnim = ANIM_STD_JACKEDCAR_LHS; } } else if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) { if (m_pMyVehicle->bLowVehicle) - enterAnim = ANIM_CAR_LJACKED_RHS; + enterAnim = ANIM_STD_JACKEDCAR_LO_RHS; else - enterAnim = ANIM_CAR_JACKED_RHS; + enterAnim = ANIM_STD_JACKEDCAR_RHS; } else dontRunAnim = true; @@ -3454,7 +3454,7 @@ CPed::BeingDraggedFromCar(void) #ifdef VC_PED_PORTS if (m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { if (m_pMyVehicle) { - m_pMyVehicle->ProcessOpenDoor(m_vehDoor, NUM_ANIMS, m_pVehicleAnim->currentTime * 5.0f); + m_pMyVehicle->ProcessOpenDoor(m_vehDoor, ANIM_STD_NUM, m_pVehicleAnim->currentTime * 5.0f); } } #endif @@ -3534,16 +3534,16 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag) #ifdef VC_PED_PORTS // VC checks for handling flag, but we can't do that if(car->GetModelIndex() == MI_SPEEDER) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); else - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f); PedSetInCarCB(nil, this); bVehExitWillBeInstant = true; #else #ifndef FIX_BUGS - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f); #else m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f); #endif @@ -3555,15 +3555,15 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag) } else { if (zDiff > 4.4f) { if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ALIGNHI_RHS, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_ALIGNHI_DOOR_RHS, 4.0f); else - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ALIGNHI_LHS, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_ALIGNHI_DOOR_LHS, 4.0f); } else { if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ALIGN_RHS, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_ALIGN_DOOR_RHS, 4.0f); else - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ALIGN_LHS, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_ALIGN_DOOR_LHS, 4.0f); } m_pVehicleAnim->SetFinishCallback(PedAnimAlignCB, this); car->AutoPilot.m_nCruiseSpeed = 0; @@ -3588,7 +3588,7 @@ CPed::EnterCar(void) LineUpPedWithCar(LINE_UP_TO_CAR_START); } else { QuitEnteringCar(); - SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); } } @@ -3601,8 +3601,8 @@ CPed::QuitEnteringCar(void) RestartNonPartialAnims(); - if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE)) - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 100.0f); + if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE)) + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 100.0f); if (veh) { if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_nPedState == PED_CARJACK) @@ -3677,9 +3677,9 @@ CPed::SetExitBoat(CVehicle *boat) #ifndef VC_PED_PORTS SetPedState(PED_IDLE); CVector firstPos = GetPosition(); - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 100.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 100.0f); if (boat->GetModelIndex() == MI_SPEEDER && boat->IsUpsideDown()) { - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS, 8.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CRAWLOUT_LHS, 8.0f); m_pVehicleAnim->SetFinishCallback(PedSetOutCarCB, this); m_vehDoor = CAR_DOOR_RF; SetPedState(PED_EXIT_CAR); @@ -3926,7 +3926,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) if (m_pVehicleAnim && m_pVehicleAnim->flags & ASSOC_PARTIAL) m_pVehicleAnim->blendDelta = -1000.0f; SetMoveState(PEDMOVE_NONE); - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 100.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 100.0f); RemoveInCarAnims(); veh->AutoPilot.m_nCruiseSpeed = 0; if (teleportNeeded) { @@ -3966,12 +3966,12 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) switch (m_vehDoor) { case CAR_DOOR_RF: if (veh->bIsBus) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_COACH_OUT_L); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_COACH_GET_OUT_LHS); } else { if (isLow) - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_LOW_RHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_LO_RHS); else - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_RHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_RHS); if (addDoorSmoke) AddYardieDoorSmoke(veh, CAR_DOOR_RF); @@ -3979,21 +3979,21 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) break; case CAR_DOOR_RR: if (veh->bIsVan) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_VAN_GETOUT); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_VAN_GET_OUT_REAR_RHS); } else if (isLow) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_LOW_RHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_LO_RHS); } else { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_RHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_RHS); } break; case CAR_DOOR_LF: if (veh->bIsBus) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_COACH_OUT_L); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_COACH_GET_OUT_LHS); } else { if (isLow) - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_LOW_LHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_LO_LHS); else - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_LHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_LHS); if (addDoorSmoke) AddYardieDoorSmoke(veh, CAR_DOOR_LF); @@ -4001,11 +4001,11 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) break; case CAR_DOOR_LR: if (veh->bIsVan) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_VAN_GETOUT_L); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_VAN_GET_OUT_REAR_LHS); } else if (isLow) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_LOW_LHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_LO_LHS); } else { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_GETOUT_LHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GETOUT_LHS); } break; default: @@ -4032,9 +4032,9 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) m_pVehicleAnim->SetFinishCallback(PedAnimStepOutCarCB, this); } else { if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS2); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CRAWLOUT_RHS); } else if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) { - m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS); + m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CRAWLOUT_LHS); } m_pVehicleAnim->SetFinishCallback(PedSetOutCarCB, this); } @@ -4067,7 +4067,7 @@ CPed::ExitCar(void) if (m_pSeekTarget) { // Car is upside down if (m_pMyVehicle->GetUp().z > -0.8f) { - if (exitAnim == ANIM_CAR_CLOSE_RHS || exitAnim == ANIM_CAR_CLOSE_LHS || animTime > 0.3f) + if (exitAnim == ANIM_STD_CAR_CLOSE_RHS || exitAnim == ANIM_STD_CAR_CLOSE_LHS || animTime > 0.3f) LineUpPedWithCar(LINE_UP_TO_CAR_END); else LineUpPedWithCar((m_pMyVehicle->GetModelIndex() == MI_DODO ? LINE_UP_TO_CAR_END : LINE_UP_TO_CAR_START)); @@ -4086,7 +4086,7 @@ CPed::ExitCar(void) } } if (foundPed && animTime > 0.4f && foundPed->IsPedInControl()) - foundPed->SetFall(1000, ANIM_KO_SKID_FRONT, 1); + foundPed->SetFall(1000, ANIM_STD_HIGHIMPACT_FRONT, 1); } } @@ -4248,7 +4248,7 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void) { // FIX: If there were no translations on enter anims, there were overflows all over this function. - CAnimBlendHierarchy *enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_CAR_JACKED_LHS)->hierarchy; + CAnimBlendHierarchy *enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_STD_JACKEDCAR_LHS)->hierarchy; CAnimBlendSequence *seq = enterAssoc->sequences; CAnimManager::UncompressAnimation(enterAssoc); if (seq->numFrames > 0) { @@ -4260,7 +4260,7 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void) } } - enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_CAR_GETIN_LHS)->hierarchy; + enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_STD_CAR_GET_IN_LHS)->hierarchy; seq = enterAssoc->sequences; CAnimManager::UncompressAnimation(enterAssoc); if (seq->numFrames > 0) { @@ -4272,7 +4272,7 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void) } } - enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_CAR_GETIN_LOW_LHS)->hierarchy; + enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_STD_CAR_GET_IN_LO_LHS)->hierarchy; seq = enterAssoc->sequences; CAnimManager::UncompressAnimation(enterAssoc); if (seq->numFrames > 0) { @@ -4284,7 +4284,7 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void) } } - enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_CAR_QJACKED)->hierarchy; + enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_STD_QUICKJACKED)->hierarchy; seq = enterAssoc->sequences; CAnimManager::UncompressAnimation(enterAssoc); if (seq->numFrames > 0) { @@ -4296,7 +4296,7 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void) } } - enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_VAN_GETIN_L)->hierarchy; + enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_STD_VAN_GET_IN_REAR_LHS)->hierarchy; seq = enterAssoc->sequences; CAnimManager::UncompressAnimation(enterAssoc); if (seq->numFrames > 0) { @@ -4308,7 +4308,7 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void) } } - enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_TRAIN_GETOUT)->hierarchy; + enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_STD_TRAIN_GETOUT)->hierarchy; seq = enterAssoc->sequences; CAnimManager::UncompressAnimation(enterAssoc); if (seq->numFrames > 0) { @@ -4614,7 +4614,7 @@ CPed::SetEnterTrain(CVehicle *train, uint32 unused) m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle); SetPedState(PED_ENTER_TRAIN); - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETIN, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_TRAIN_GETIN, 4.0f); m_pVehicleAnim->SetFinishCallback(PedSetInTrainCB, this); bUsesCollision = false; LineUpPedWithTrain(); @@ -4688,7 +4688,7 @@ CPed::SetExitTrain(CVehicle* train) GetNearestTrainPedPosition(train, exitPos); */ SetPedState(PED_EXIT_TRAIN); - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETOUT, 4.0f); + m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_TRAIN_GETOUT, 4.0f); m_pVehicleAnim->SetFinishCallback(PedSetOutTrainCB, this); bUsesCollision = false; LineUpPedWithTrain(); @@ -5060,16 +5060,16 @@ CPed::SetDuck(uint32 time) return; if (bCrouchWhenShooting && (m_nPedState == PED_ATTACK || m_nPedState == PED_AIM_GUN)) { - CAnimBlendAssociation *duckAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_LOW); + CAnimBlendAssociation *duckAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_LOW); if (!duckAssoc || duckAssoc->blendDelta < 0.0f) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DUCK_LOW, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_DUCK_LOW, 4.0f); bIsDucking = true; m_duckTimer = CTimer::GetTimeInMilliseconds() + time; } } else { - CAnimBlendAssociation *duckAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_DOWN); + CAnimBlendAssociation *duckAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_DOWN); if (!duckAssoc || duckAssoc->blendDelta < 0.0f) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DUCK_DOWN, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_DUCK_DOWN, 4.0f); bIsDucking = true; m_duckTimer = CTimer::GetTimeInMilliseconds() + time; } @@ -5086,9 +5086,9 @@ CPed::Duck(void) void CPed::ClearDuck(void) { - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_DOWN); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_DOWN); if (!animAssoc) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DUCK_LOW); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_DUCK_LOW); if (!animAssoc) { bIsDucking = false; @@ -5102,9 +5102,9 @@ CPed::ClearDuck(void) if (m_nPedState != PED_ATTACK && m_nPedState != PED_AIM_GUN) return; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RBLOCK_CSHOOT); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RBLOCK_SHOOT); if (!animAssoc || animAssoc->blendDelta < 0.0f) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_RBLOCK_CSHOOT, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_RBLOCK_SHOOT, 4.0f); } } @@ -5154,9 +5154,9 @@ CPed::PedAnimDoorCloseRollingCB(CAnimBlendAssociation* animAssoc, void* arg) animAssoc->blendDelta = -1000.0f; if (veh->bLowVehicle) { - veh->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR_LOW, 1.0f); + veh->ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS, 1.0f); } else { - veh->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, 1.0f); + veh->ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, 1.0f); } veh->m_nGettingOutFlags &= ~CAR_DOOR_FLAG_LF; @@ -5235,40 +5235,40 @@ CPed::RemoveInCarAnims(void) CAnimBlendAssociation *animAssoc; if (m_pMyVehicle && m_pMyVehicle->bLowVehicle) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_LOW_L); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_LEFT_LO); if (animAssoc) animAssoc->blendDelta = -1000.0f; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_LOW_R); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_RIGHT_LO); if (animAssoc) animAssoc->blendDelta = -1000.0f; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_L); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if (animAssoc) animAssoc->blendDelta = -1000.0f; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_R); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if (animAssoc) animAssoc->blendDelta = -1000.0f; } else { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_L); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_LEFT); if (animAssoc) animAssoc->blendDelta = -1000.0f; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_R); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_RIGHT); if (animAssoc) animAssoc->blendDelta = -1000.0f; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_L); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if (animAssoc) animAssoc->blendDelta = -1000.0f; - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_R); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if (animAssoc) animAssoc->blendDelta = -1000.0f; } #ifdef VC_PED_PORTS - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_BOAT); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_BOAT_DRIVE); if (animAssoc) animAssoc->blendDelta = -1000.0f; #endif - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LB); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_LOOKBEHIND); if (animAssoc) animAssoc->blendDelta = -1000.0f; } diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp index 8625f23e..c03d492a 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -29,30 +29,30 @@ RpClump *flyingClumpTemp; // This is beta fistfite.dat array. Not used anymore since they're being fetched from fistfite.dat. FightMove tFightMoves[NUM_FIGHTMOVES] = { - {NUM_ANIMS, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_PUNCH_R, 0.2f, 8.0f / 30.0f, 0.0f, 0.3f, HITLEVEL_HIGH, 1, 0}, - {ANIM_FIGHT_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_FIGHT_SH_F, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_FIGHT_KNEE, 4.0f / 30.0f, 0.2f, 0.0f, 0.6f, HITLEVEL_LOW, 2, 0}, - {ANIM_FIGHT_HEAD, 4.0f / 30.0f, 0.2f, 0.0f, 0.7f, HITLEVEL_HIGH, 3, 0}, - {ANIM_FIGHT_PUNCH, 4.0f / 30.0f, 7.0f / 30.0f, 10.0f / 30.0f, 0.4f, HITLEVEL_HIGH, 1, 0}, - {ANIM_FIGHT_LHOOK, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.4f, HITLEVEL_HIGH, 3, 0}, - {ANIM_FIGHT_KICK, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.5, HITLEVEL_MEDIUM, 2, 0}, - {ANIM_FIGHT_LONGKICK, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.5, HITLEVEL_MEDIUM, 4, 0}, - {ANIM_FIGHT_ROUNDHOUSE, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.6f, HITLEVEL_MEDIUM, 4, 0}, - {ANIM_FIGHT_BODYBLOW, 5.0f / 30.0f, 7.0f / 30.0f, 0.0f, 0.35f, HITLEVEL_LOW, 2, 0}, - {ANIM_KICK_FLOOR, 10.0f / 30.0f, 14.0f / 30.0f, 0.0f, 0.4f, HITLEVEL_GROUND, 1, 0}, - {ANIM_HIT_FRONT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_BACK, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_BODYBLOW, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_CHEST, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_WALK, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_FLOOR_HIT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_HIT_BEHIND, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, - {ANIM_FIGHT2_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_NUM, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_PUNCH, 0.2f, 8.0f / 30.0f, 0.0f, 0.3f, HITLEVEL_HIGH, 1, 0}, + {ANIM_STD_FIGHT_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_FIGHT_SHUFFLE_F, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_FIGHT_KNEE, 4.0f / 30.0f, 0.2f, 0.0f, 0.6f, HITLEVEL_LOW, 2, 0}, + {ANIM_STD_FIGHT_HEAD, 4.0f / 30.0f, 0.2f, 0.0f, 0.7f, HITLEVEL_HIGH, 3, 0}, + {ANIM_STD_FIGHT_PUNCH, 4.0f / 30.0f, 7.0f / 30.0f, 10.0f / 30.0f, 0.4f, HITLEVEL_HIGH, 1, 0}, + {ANIM_STD_FIGHT_LHOOK, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.4f, HITLEVEL_HIGH, 3, 0}, + {ANIM_STD_FIGHT_KICK, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.5, HITLEVEL_MEDIUM, 2, 0}, + {ANIM_STD_FIGHT_LONGKICK, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.5, HITLEVEL_MEDIUM, 4, 0}, + {ANIM_STD_FIGHT_ROUNDHOUSE, 8.0f / 30.0f, 10.0f / 30.0f, 0.0f, 0.6f, HITLEVEL_MEDIUM, 4, 0}, + {ANIM_STD_FIGHT_BODYBLOW, 5.0f / 30.0f, 7.0f / 30.0f, 0.0f, 0.35f, HITLEVEL_LOW, 2, 0}, + {ANIM_STD_KICKGROUND, 10.0f / 30.0f, 14.0f / 30.0f, 0.0f, 0.4f, HITLEVEL_GROUND, 1, 0}, + {ANIM_STD_HIT_FRONT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_BACK, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_BODYBLOW, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_CHEST, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_WALK, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_FLOOR, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_HIT_BEHIND, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, + {ANIM_STD_FIGHT_2IDLE, 0.0f, 0.0f, 0.0f, 0.0f, HITLEVEL_NULL, 0, 0}, }; static PedOnGroundState @@ -247,7 +247,7 @@ CPed::SetAttack(CEntity *victim) if (victim && victim->IsPed()) victimPed = (CPed*)victim; - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_ARMED); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_BIGGUN); if (animAssoc) { animAssoc->blendDelta = -1000.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -256,12 +256,12 @@ CPed::SetAttack(CEntity *victim) if (m_attackTimer > CTimer::GetTimeInMilliseconds() || m_nWaitState == WAITSTATE_SURPRISE) return; - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_HGUN_RELOAD)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HGUN_RELOAD)) { bIsAttacking = false; return; } - if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_AK_RELOAD)) { + if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_AK_RELOAD)) { if (!IsPlayer() || m_nPedState != PED_ATTACK || ((CPlayerPed*)this)->m_bHaveTargetSelected) bIsAttacking = false; else @@ -351,7 +351,7 @@ CPed::SetAttack(CEntity *victim) SetPedState(PED_ATTACK); SetMoveState(PEDMOVE_NONE); if (bCrouchWhenShooting) { - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_RBLOCK_CSHOOT, 4.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_RBLOCK_SHOOT, 4.0f); } else { float animDelta = 8.0f; if (curWeapon->m_eWeaponFire == WEAPON_FIRE_MELEE) @@ -418,7 +418,7 @@ CPed::ClearAttackByRemovingAnim(void) weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), weapon->m_Anim2ToPlay); if (!weaponAssoc && weapon->IsFlagSet(WEAPONFLAG_THROW)) - weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_THROWU); + weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_THROW_UNDER); if (!weaponAssoc) { ClearAttack(); @@ -440,27 +440,27 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg) if (attackAssoc) { switch (attackAssoc->animId) { - case ANIM_WEAPON_START_THROW: + case ANIM_STD_START_THROW: // what?! if ((!ped->IsPlayer() || ((CPlayerPed*)ped)->m_bHaveTargetSelected) && ped->IsPlayer()) { attackAssoc->blendDelta = -1000.0f; - newAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_WEAPON_THROWU); + newAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_THROW_UNDER); } else { attackAssoc->blendDelta = -1000.0f; - newAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_WEAPON_THROW); + newAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_WEAPON_THROW); } newAnim->SetFinishCallback(FinishedAttackCB, ped); return; - case ANIM_FIGHT_PPUNCH: + case ANIM_STD_PARTIAL_PUNCH: attackAssoc->blendDelta = -8.0f; attackAssoc->flags |= ASSOC_DELETEFADEDOUT; ped->ClearAttack(); return; - case ANIM_WEAPON_THROW: - case ANIM_WEAPON_THROWU: + case ANIM_STD_WEAPON_THROW: + case ANIM_STD_THROW_UNDER: if (ped->GetWeapon()->m_nAmmoTotal > 0) { currentWeapon = CWeaponInfo::GetWeaponInfo(ped->GetWeapon()->m_eWeaponType); ped->AddWeaponModel(currentWeapon->m_nModelId); @@ -535,16 +535,16 @@ CPed::Attack(void) weaponAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ourWeapon->m_AnimToPlay); attackShouldContinue = bIsAttacking; reloadAnimAssoc = nil; - reloadAnim = NUM_ANIMS; + reloadAnim = ANIM_STD_NUM; delayBetweenAnimAndFire = ourWeapon->m_fAnimFrameFire; weaponAnim = ourWeapon->m_AnimToPlay; - if (weaponAnim == ANIM_WEAPON_HGUN_BODY) - reloadAnim = ANIM_HGUN_RELOAD; - else if (weaponAnim == ANIM_WEAPON_AK_BODY) - reloadAnim = ANIM_AK_RELOAD; + if (weaponAnim == ANIM_STD_WEAPON_HGUN_BODY) + reloadAnim = ANIM_STD_HGUN_RELOAD; + else if (weaponAnim == ANIM_STD_WEAPON_AK_BODY) + reloadAnim = ANIM_STD_AK_RELOAD; - if (reloadAnim != NUM_ANIMS) + if (reloadAnim != ANIM_STD_NUM) reloadAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), reloadAnim); if (bIsDucking) @@ -566,7 +566,7 @@ CPed::Attack(void) // Long throw granade, molotov if (!weaponAnimAssoc && ourWeapon->IsFlagSet(WEAPONFLAG_THROW)) { - weaponAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_THROWU); + weaponAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_THROW_UNDER); delayBetweenAnimAndFire = 0.2f; } @@ -619,7 +619,7 @@ CPed::Attack(void) firePos = GetMatrix() * firePos; } else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED) { - TransformToNode(firePos, weaponAnimAssoc->animId == ANIM_KICK_FLOOR ? PED_FOOTR : PED_HANDR); + TransformToNode(firePos, weaponAnimAssoc->animId == ANIM_STD_KICKGROUND ? PED_FOOTR : PED_HANDR); } else { firePos = GetMatrix() * firePos; } @@ -636,7 +636,7 @@ CPed::Attack(void) if (GetWeapon()->m_eWeaponState != WEAPONSTATE_MELEE_MADECONTACT) { // If reloading just began, start the animation // Last condition will always return true, even IDA hides it - if (GetWeapon()->m_eWeaponState == WEAPONSTATE_RELOADING && reloadAnim != NUM_ANIMS /* && !reloadAnimAssoc*/) { + if (GetWeapon()->m_eWeaponState == WEAPONSTATE_RELOADING && reloadAnim != ANIM_STD_NUM /* && !reloadAnimAssoc*/) { CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, reloadAnim, 8.0f); ClearLookFlag(); ClearAimFlag(); @@ -646,9 +646,9 @@ CPed::Attack(void) return; } } else { - if (weaponAnimAssoc->animId == ANIM_WEAPON_BAT_V || weaponAnimAssoc->animId == ANIM_WEAPON_BAT_H) { + if (weaponAnimAssoc->animId == ANIM_STD_WEAPON_BAT_V || weaponAnimAssoc->animId == ANIM_STD_WEAPON_BAT_H) { DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_BAT_ATTACK, 1.0f); - } else if (weaponAnimAssoc->animId == ANIM_FIGHT_PPUNCH) { + } else if (weaponAnimAssoc->animId == ANIM_STD_PARTIAL_PUNCH) { DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_PUNCH_39, 0.0f); } @@ -712,7 +712,7 @@ CPed::Attack(void) weaponAnim = weaponAnimAssoc->animId; if (ourWeapon->m_eWeaponFire != WEAPON_FIRE_MELEE || CheckForPedsOnGroundToAttack(this, nil) < PED_ON_THE_FLOOR) { - if (weaponAnim != ourWeapon->m_Anim2ToPlay || weaponAnim == ANIM_RBLOCK_CSHOOT) { + if (weaponAnim != ourWeapon->m_Anim2ToPlay || weaponAnim == ANIM_STD_RBLOCK_SHOOT) { weaponAnimAssoc->Start(ourWeapon->m_fAnimLoopStart); } else { CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ourWeapon->m_AnimToPlay, 8.0f); @@ -785,16 +785,16 @@ CPed::StartFightAttack(uint8 buttonPressure) SetPedState(PED_FIGHT); m_fightButtonPressure = 0; RpAnimBlendClumpRemoveAssociations(GetClump(), ASSOC_REPEAT); - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK_START); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_STARTWALK); if (animAssoc) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc->blendDelta = -1000.0f; } - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP1); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP_R); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); if (animAssoc) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -805,7 +805,7 @@ CPed::StartFightAttack(uint8 buttonPressure) SetMoveState(PEDMOVE_NONE); m_nStoredMoveState = PEDMOVE_NONE; - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_IDLE)->blendAmount = 1.0f; + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FIGHT_IDLE)->blendAmount = 1.0f; CPed *pedOnGround = nil; if (IsPlayer() && CheckForPedsOnGroundToAttack(this, &pedOnGround) > PED_IN_FRONT_OF_ATTACKER) { @@ -845,7 +845,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) if (hitLevel == HITLEVEL_GROUND) { CAnimBlendAssociation *floorHitAssoc; if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) { - floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f); + floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f); } else { floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[FIGHTMOVE_HITONFLOOR].animId, 8.0f); } @@ -867,8 +867,8 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) } else if (m_nPedState == PED_FALL) { if (hitLevel == HITLEVEL_GROUND && !IsPedHeadAbovePos(-0.3f)) { CAnimBlendAssociation *floorHitAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL) ? - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f) : - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f) : + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f); if (floorHitAssoc) { floorHitAssoc->flags &= ~ASSOC_FADEOUTWHENDONE; floorHitAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -887,16 +887,16 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) AnimationId shotAnim; switch (direction) { case 1: - shotAnim = ANIM_SHOT_LEFT_PARTIAL; + shotAnim = ANIM_STD_HITBYGUN_LEFT; break; case 2: - shotAnim = ANIM_SHOT_BACK_PARTIAL; + shotAnim = ANIM_STD_HITBYGUN_BACK; break; case 3: - shotAnim = ANIM_SHOT_RIGHT_PARTIAL; + shotAnim = ANIM_STD_HITBYGUN_RIGHT; break; default: - shotAnim = ANIM_SHOT_FRONT_PARTIAL; + shotAnim = ANIM_STD_HITBYGUN_FRONT; break; } CAnimBlendAssociation *shotAssoc = RpAnimBlendClumpGetAssociation(GetClump(), shotAnim); @@ -914,16 +914,16 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) #ifndef VC_PED_PORTS switch (direction) { case 1: - SetFall(500, ANIM_KO_SPIN_R, false); + SetFall(500, ANIM_STD_HIGHIMPACT_LEFT, false); break; case 2: - SetFall(500, ANIM_KO_SKID_BACK, false); + SetFall(500, ANIM_STD_HIGHIMPACT_BACK, false); break; case 3: - SetFall(500, ANIM_KO_SPIN_L, false); + SetFall(500, ANIM_STD_HIGHIMPACT_RIGHT, false); break; default: - SetFall(500, ANIM_KO_SHOT_STOM, false); + SetFall(500, ANIM_STD_KO_SHOT_STOMACH, false); break; } #else @@ -931,30 +931,30 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) AnimationId hitAnim; switch (direction) { case 1: - hitAnim = ANIM_KO_SPIN_R; + hitAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: if (CGeneral::GetRandomNumber() & 1) { fall = false; - hitAnim = ANIM_HIT_BACK; + hitAnim = ANIM_STD_HIT_BACK; } else { - hitAnim = ANIM_KO_SKID_BACK; + hitAnim = ANIM_STD_HIGHIMPACT_BACK; } break; case 3: - hitAnim = ANIM_KO_SPIN_L; + hitAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: if (hitLevel == HITLEVEL_LOW) { - hitAnim = ANIM_KO_SHOT_STOM; + hitAnim = ANIM_STD_KO_SHOT_STOMACH; } else if (CGeneral::GetRandomNumber() & 1) { fall = false; - hitAnim = ANIM_HIT_WALK; + hitAnim = ANIM_STD_HIT_WALK; } else if (CGeneral::GetRandomNumber() & 1) { fall = false; - hitAnim = ANIM_HIT_HEAD; + hitAnim = ANIM_STD_HIT_HEAD; } else { - hitAnim = ANIM_KO_SHOT_FACE; + hitAnim = ANIM_STD_KO_SHOT_FACE; } break; } @@ -981,15 +981,15 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) case HITLEVEL_LOW: #ifndef VC_PED_PORTS if (direction == 2) { - SetFall(1000, ANIM_KO_SKID_BACK, false); + SetFall(1000, ANIM_STD_HIGHIMPACT_BACK, false); return; } #else if (direction == 2 && (!IsPlayer() || ((CGeneral::GetRandomNumber() & 1) && m_fHealth < 30.0f))) { - SetFall(1000, ANIM_KO_SKID_BACK, false); + SetFall(1000, ANIM_STD_HIGHIMPACT_BACK, false); return; } else if (direction != 2 && !IsPlayer() && (CGeneral::GetRandomNumber() & 1) && m_fHealth < 30.0f) { - SetFall(1000, ANIM_KO_SHOT_STOM, false); + SetFall(1000, ANIM_STD_KO_SHOT_STOMACH, false); return; } #endif @@ -1061,14 +1061,14 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) SetPedState(PED_FIGHT); m_fightButtonPressure = 0; RpAnimBlendClumpRemoveAssociations(GetClump(), ASSOC_REPEAT); - CAnimBlendAssociation *walkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK_START); + CAnimBlendAssociation *walkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_STARTWALK); if (walkStartAssoc) { walkStartAssoc->flags |= ASSOC_DELETEFADEDOUT; walkStartAssoc->blendDelta = -1000.0f; } - CAnimBlendAssociation *walkStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP); + CAnimBlendAssociation *walkStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP1); if (!walkStopAssoc) - walkStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP_R); + walkStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); if (walkStopAssoc) { walkStopAssoc->flags |= ASSOC_DELETEFADEDOUT; walkStopAssoc->blendDelta = -1000.0f; @@ -1076,7 +1076,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk) } SetMoveState(PEDMOVE_NONE); m_nStoredMoveState = PEDMOVE_NONE; - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_IDLE)->blendAmount = 1.0f; + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FIGHT_IDLE)->blendAmount = 1.0f; CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 8.0f); moveAssoc->SetFinishCallback(FinishFightMoveCB, this); m_fightState = FIGHTSTATE_NO_MOVE; @@ -1445,22 +1445,22 @@ CPed::EndFight(uint8 endType) m_curFightMove = FIGHTMOVE_NULL; RestorePreviousState(); - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); if (animAssoc) animAssoc->flags |= ASSOC_DELETEFADEDOUT; switch (endType) { case ENDFIGHT_NORMAL: - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 8.0f); - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT2_IDLE, 8.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 8.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FIGHT_2IDLE, 8.0f); break; case ENDFIGHT_WITH_A_STEP: - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 1.0f); - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_WALK_START, 8.0f); + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 1.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_STARTWALK, 8.0f); break; case ENDFIGHT_FAST: - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 8.0f); - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT2_IDLE, 8.0f)->speed = 2.0f; + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 8.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FIGHT_2IDLE, 8.0f)->speed = 2.0f; break; default: break; @@ -1656,7 +1656,7 @@ CPed::FightStrike(CVector &touchedNodePos) || GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED && IsPlayer() || nearPed->m_pedStats->m_flags & STAT_ONE_HIT_KNOCKDOWN)) { - nearPed->SetFall(0, (AnimationId)(direction + ANIM_KO_SKID_FRONT), 0); + nearPed->SetFall(0, (AnimationId)(direction + ANIM_STD_HIGHIMPACT_FRONT), 0); if (nearPed->m_nPedState == PED_FALL) nearPed->bIsStanding = false; } @@ -1778,7 +1778,7 @@ CPed::LoadFightData(void) animAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, animName); tFightMoves[moveId].animId = (AnimationId)animAssoc->animId; } else { - tFightMoves[moveId].animId = ANIM_WALK; + tFightMoves[moveId].animId = ANIM_STD_WALK; } moveId++; } @@ -1802,7 +1802,7 @@ CPed::SetInvestigateEvent(eEventType event, CVector2D pos, float distanceToCount if (m_eventType >= EVENT_ICECREAM) m_lookTimer = 0; else - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_HANDSCOWER, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSCOWER, 4.0f); } @@ -1842,7 +1842,7 @@ CPed::InvestigateEvent(void) case EVENT_HIT_AND_RUN_COP: if (CTimer::GetTimeInMilliseconds() > m_lookTimer) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ROAD_CROSS); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (animAssoc) { animAssoc->blendDelta = -8.0f; @@ -1854,7 +1854,7 @@ CPed::InvestigateEvent(void) } else if (CGeneral::GetRandomNumber() & 3) { ClearLookFlag(); - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ROAD_CROSS, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_ROADCROSS, 4.0f); SetLookTimer(CGeneral::GetRandomNumberInRange(1000, 2500)); Say(SOUND_PED_CHAT_EVENT); @@ -1868,16 +1868,16 @@ CPed::InvestigateEvent(void) case EVENT_EXPLOSION: if (bHasACamera && CTimer::GetTimeInMilliseconds() > m_lookTimer) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_CAM); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_CAM); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); - if (animAssoc && animAssoc->animId == ANIM_IDLE_CAM) { - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); + if (animAssoc && animAssoc->animId == ANIM_STD_IDLE_CAM) { + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); SetLookTimer(CGeneral::GetRandomNumberInRange(1000, 2500)); } else if (CGeneral::GetRandomNumber() & 3) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_CAM, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_CAM, 4.0f); SetLookTimer(CGeneral::GetRandomNumberInRange(2500, 5000)); Say(SOUND_PED_CHAT_EVENT); @@ -1886,30 +1886,30 @@ CPed::InvestigateEvent(void) } } else if (CTimer::GetTimeInMilliseconds() > m_lookTimer) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_HBHB); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_HBHB); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_XPRESS_SCRATCH); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_XPRESS_SCRATCH); - if (animAssoc && animAssoc->animId == ANIM_IDLE_STANCE) { + if (animAssoc && animAssoc->animId == ANIM_STD_IDLE) { if (CGeneral::GetRandomNumber() & 1) - animToPlay = ANIM_IDLE_HBHB; + animToPlay = ANIM_STD_IDLE_HBHB; else - animToPlay = ANIM_XPRESS_SCRATCH; + animToPlay = ANIM_STD_XPRESS_SCRATCH; CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f); SetLookTimer(CGeneral::GetRandomNumberInRange(1500, 4000)); - } else if (animAssoc && animAssoc->animId == ANIM_IDLE_HBHB) { + } else if (animAssoc && animAssoc->animId == ANIM_STD_IDLE_HBHB) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; if (CGeneral::GetRandomNumber() & 1) { - animToPlay = ANIM_IDLE_STANCE; + animToPlay = ANIM_STD_IDLE; animGroup = m_animGroup; } else { - animToPlay = ANIM_XPRESS_SCRATCH; + animToPlay = ANIM_STD_XPRESS_SCRATCH; animGroup = ASSOCGRP_STD; } @@ -1918,10 +1918,10 @@ CPed::InvestigateEvent(void) } else { if (CGeneral::GetRandomNumber() & 1) { - animToPlay = ANIM_IDLE_STANCE; + animToPlay = ANIM_STD_IDLE; animGroup = m_animGroup; } else { - animToPlay = ANIM_IDLE_HBHB; + animToPlay = ANIM_STD_IDLE_HBHB; animGroup = ASSOCGRP_STD; } @@ -1938,26 +1938,26 @@ CPed::InvestigateEvent(void) if (CTimer::GetTimeInMilliseconds() > m_lookTimer) { if (m_lookTimer) { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ROAD_CROSS); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; if (m_eventType == EVENT_ICECREAM) - animToPlay = ANIM_IDLE_CHAT; + animToPlay = ANIM_STD_CHAT; else - animToPlay = ANIM_XPRESS_SCRATCH; + animToPlay = ANIM_STD_XPRESS_SCRATCH; CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay,4.0f); SetLookTimer(CGeneral::GetRandomNumberInRange(2000, 5000)); } else { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_CHAT); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CHAT); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; ClearInvestigateEvent(); } else { - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_XPRESS_SCRATCH); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_XPRESS_SCRATCH); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -1966,7 +1966,7 @@ CPed::InvestigateEvent(void) } } } else { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ROAD_CROSS, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_ROADCROSS, 4.0f); SetLookTimer(CGeneral::GetRandomNumberInRange(1000, 2500)); } } @@ -2009,13 +2009,13 @@ CPed::InvestigateEvent(void) void CPed::ClearInvestigateEvent(void) { - CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ROAD_CROSS); + CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_XPRESS_SCRATCH); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_XPRESS_SCRATCH); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_HBHB); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_HBHB); if (!animAssoc) - animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_CHAT); + animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CHAT); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; @@ -2037,7 +2037,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi CPlayerPed *player = FindPlayerPed(); float dieDelta = 4.0f; float dieSpeed = 0.0f; - AnimationId dieAnim = ANIM_KO_SHOT_FRONT1; + AnimationId dieAnim = ANIM_STD_KO_FRONT; bool headShot = false; bool willLinger = false; int random; @@ -2069,14 +2069,14 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (m_nPedState == PED_FALL || m_nPedState == PED_GETUP) { if (!IsPedHeadAbovePos(-0.3f)) { if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) - dieAnim = ANIM_FLOOR_HIT_F; + dieAnim = ANIM_STD_HIT_FLOOR_FRONT; else - dieAnim = ANIM_FLOOR_HIT; + dieAnim = ANIM_STD_HIT_FLOOR; dieDelta *= 2.0f; dieSpeed = 0.5f; detectDieAnim = false; } else if (m_nPedState == PED_FALL) { - dieAnim = NUM_ANIMS; + dieAnim = ANIM_STD_NUM; detectDieAnim = false; } } @@ -2088,28 +2088,28 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (m_nPedState == PED_FALL) { if (IsPedHeadAbovePos(-0.3f)) { - dieAnim = NUM_ANIMS; + dieAnim = ANIM_STD_NUM; } else { if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) - dieAnim = ANIM_FLOOR_HIT_F; + dieAnim = ANIM_STD_HIT_FLOOR_FRONT; else - dieAnim = ANIM_FLOOR_HIT; + dieAnim = ANIM_STD_HIT_FLOOR; dieDelta = dieDelta * 2.0f; dieSpeed = 0.5f; } } else { switch (direction) { case 0: - dieAnim = ANIM_KO_SKID_FRONT; + dieAnim = ANIM_STD_HIGHIMPACT_FRONT; break; case 1: - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: - dieAnim = ANIM_KO_SKID_BACK; + dieAnim = ANIM_STD_HIGHIMPACT_BACK; break; case 3: - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: break; @@ -2122,28 +2122,28 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (m_nPedState == PED_FALL) { if (IsPedHeadAbovePos(-0.3f)) { - dieAnim = NUM_ANIMS; + dieAnim = ANIM_STD_NUM; } else { if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) - dieAnim = ANIM_FLOOR_HIT_F; + dieAnim = ANIM_STD_HIT_FLOOR_FRONT; else - dieAnim = ANIM_FLOOR_HIT; + dieAnim = ANIM_STD_HIT_FLOOR; dieDelta = dieDelta * 2.0f; dieSpeed = 0.5f; } } else { switch (direction) { case 0: - dieAnim = ANIM_KO_SKID_FRONT; + dieAnim = ANIM_STD_HIGHIMPACT_FRONT; break; case 1: - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: - dieAnim = ANIM_KO_SKID_BACK; + dieAnim = ANIM_STD_HIGHIMPACT_BACK; break; case 3: - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: break; @@ -2183,56 +2183,56 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (method == WEAPONTYPE_SHOTGUN) { switch (direction) { case 0: - dieAnim = ANIM_KO_SKID_FRONT; + dieAnim = ANIM_STD_HIGHIMPACT_FRONT; break; case 1: - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: - dieAnim = ANIM_KO_SKID_BACK; + dieAnim = ANIM_STD_HIGHIMPACT_BACK; break; case 3: - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: break; } } else - dieAnim = ANIM_KO_SHOT_FRONT1; + dieAnim = ANIM_STD_KO_FRONT; willLinger = false; } else { switch (pedPiece) { case PEDPIECE_TORSO: willLinger = false; - dieAnim = ANIM_KO_SHOT_FRONT1; + dieAnim = ANIM_STD_KO_FRONT; break; case PEDPIECE_MID: willLinger = false; - dieAnim = ANIM_KO_SHOT_STOM; + dieAnim = ANIM_STD_KO_SHOT_STOMACH; break; case PEDPIECE_LEFTARM: - dieAnim = ANIM_KO_SHOT_ARML; + dieAnim = ANIM_STD_KO_SHOT_ARM_L; RemoveBodyPart(PED_UPPERARML, direction); willLinger = true; break; case PEDPIECE_RIGHTARM: - dieAnim = ANIM_KO_SHOT_ARMR; + dieAnim = ANIM_STD_KO_SHOT_ARM_R; RemoveBodyPart(PED_UPPERARMR, direction); willLinger = true; break; case PEDPIECE_LEFTLEG: - dieAnim = ANIM_KO_SHOT_LEGL; + dieAnim = ANIM_STD_KO_SHOT_LEG_L; RemoveBodyPart(PED_UPPERLEGL, direction); willLinger = true; break; case PEDPIECE_RIGHTLEG: - dieAnim = ANIM_KO_SHOT_LEGR; + dieAnim = ANIM_STD_KO_SHOT_LEG_R; RemoveBodyPart(PED_UPPERLEGR, direction); willLinger = true; break; case PEDPIECE_HEAD: - dieAnim = ANIM_KO_SHOT_FACE; + dieAnim = ANIM_STD_KO_SHOT_FACE; RemoveBodyPart(PED_HEAD, direction); headShot = true; willLinger = true; @@ -2272,16 +2272,16 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi switch (direction) { case 0: - dieAnim = ANIM_KO_SKID_FRONT; + dieAnim = ANIM_STD_HIGHIMPACT_FRONT; break; case 1: - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: - dieAnim = ANIM_KO_SKID_BACK; + dieAnim = ANIM_STD_HIGHIMPACT_BACK; break; case 3: - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: break; @@ -2291,7 +2291,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (bFireProof) return false; - dieAnim = ANIM_KO_SHOT_FRONT1; + dieAnim = ANIM_STD_KO_FRONT; break; case WEAPONTYPE_RAMMEDBYCAR: case WEAPONTYPE_RUNOVERBYCAR: @@ -2306,36 +2306,36 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (pedPiece == PEDPIECE_RIGHTARM && random > 1 || pedPiece == PEDPIECE_MID && random == 2) - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; else - dieAnim = ANIM_KO_SKID_FRONT; + dieAnim = ANIM_STD_HIGHIMPACT_FRONT; } else - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 1: if (m_nPedState == PED_DIVE_AWAY) - dieAnim = ANIM_KD_LEFT; + dieAnim = ANIM_STD_SPINFORWARD_LEFT; else - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: if ((pedPiece != PEDPIECE_LEFTARM || random <= 1) && (pedPiece != PEDPIECE_MID || random != 1)) { if ((pedPiece != PEDPIECE_RIGHTARM || random <= 1) && (pedPiece != PEDPIECE_MID || random != 2)) { - dieAnim = ANIM_KO_SKID_BACK; + dieAnim = ANIM_STD_HIGHIMPACT_BACK; } else { - dieAnim = ANIM_KD_RIGHT; + dieAnim = ANIM_STD_SPINFORWARD_RIGHT; } } else - dieAnim = ANIM_KD_LEFT; + dieAnim = ANIM_STD_SPINFORWARD_LEFT; break; case 3: if (m_nPedState == PED_DIVE_AWAY) - dieAnim = ANIM_KD_RIGHT; + dieAnim = ANIM_STD_SPINFORWARD_RIGHT; else - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: break; @@ -2353,7 +2353,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi } break; case WEAPONTYPE_DROWNING: - dieAnim = ANIM_DROWN; + dieAnim = ANIM_STD_DROWN; break; case WEAPONTYPE_FALL: if (bCollisionProof) @@ -2361,16 +2361,16 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi switch (direction) { case 0: - dieAnim = ANIM_KO_SKID_FRONT; + dieAnim = ANIM_STD_HIGHIMPACT_FRONT; break; case 1: - dieAnim = ANIM_KO_SPIN_R; + dieAnim = ANIM_STD_HIGHIMPACT_LEFT; break; case 2: - dieAnim = ANIM_KO_SKID_BACK; + dieAnim = ANIM_STD_HIGHIMPACT_BACK; break; case 3: - dieAnim = ANIM_KO_SPIN_L; + dieAnim = ANIM_STD_HIGHIMPACT_RIGHT; break; default: break; @@ -2460,7 +2460,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi if (player == this) m_pMyVehicle->SetStatus(STATUS_PLAYER_DISABLED); - SetDie(NUM_ANIMS, 4.0f, 0.0f); + SetDie(ANIM_STD_NUM, 4.0f, 0.0f); return true; } else { m_fHealth = 0.0f; @@ -2663,7 +2663,7 @@ CPed::ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer) // BUG: This condition will always return true. Even fixing it won't work, because these states are unused. // if (m_nPedState != PED_PASSENGER || m_nPedState != PED_TAXI_PASSENGER) { - SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); // } bBodyPartJustCameOff = true; @@ -2887,7 +2887,7 @@ CPed::CollideWithPed(CPed *collideWith) } else { SetLookFlag(collideWith, false); TurnBody(); - animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_PPUNCH, 8.0f); + animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PARTIAL_PUNCH, 8.0f); animAssoc->flags |= ASSOC_FADEOUTWHENDONE; #ifdef VC_PED_PORTS m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 2000; @@ -2912,22 +2912,22 @@ CPed::CollideWithPed(CPed *collideWith) moveForce.z += 0.1f; ApplyMoveForce(moveForce); if (collideWith->m_nMoveState != PEDMOVE_RUN && collideWith->m_nMoveState != PEDMOVE_SPRINT) - animToPlay = ANIM_HIT_LEFT; + animToPlay = ANIM_STD_HIT_LEFT; else - animToPlay = ANIM_SHOT_LEFT_PARTIAL; + animToPlay = ANIM_STD_HITBYGUN_LEFT; } else if (heLooksToUs) { CVector moveForce = GetRight() * -1.0f; moveForce.z += 0.1f; ApplyMoveForce(moveForce); if (collideWith->m_nMoveState != PEDMOVE_RUN && collideWith->m_nMoveState != PEDMOVE_SPRINT) - animToPlay = ANIM_HIT_RIGHT; + animToPlay = ANIM_STD_HIT_RIGHT; else - animToPlay = ANIM_SHOT_RIGHT_PARTIAL; + animToPlay = ANIM_STD_HITBYGUN_RIGHT; } else { if (collideWith->m_nMoveState != PEDMOVE_RUN && collideWith->m_nMoveState != PEDMOVE_SPRINT) - animToPlay = ANIM_HIT_BACK; + animToPlay = ANIM_STD_HIT_BACK; else - animToPlay = ANIM_SHOT_BACK_PARTIAL; + animToPlay = ANIM_STD_HITBYGUN_BACK; } if (collideWith->IsPedInControl() && CTimer::GetTimeInMilliseconds() > collideWith->m_nPedStateTimer) { @@ -2944,17 +2944,17 @@ CPed::CollideWithPed(CPed *collideWith) moveForce.z += 0.1f; ApplyMoveForce(moveForce); if (heLooksToUs) - animToPlay = ANIM_KO_SPIN_L; + animToPlay = ANIM_STD_HIGHIMPACT_RIGHT; else - animToPlay = ANIM_KD_RIGHT; + animToPlay = ANIM_STD_SPINFORWARD_RIGHT; } else { CVector moveForce = GetRight(); moveForce.z += 0.1f; ApplyMoveForce(moveForce); if (heLooksToUs) - animToPlay = ANIM_KO_SPIN_R; + animToPlay = ANIM_STD_HIGHIMPACT_LEFT; else - animToPlay = ANIM_KD_LEFT; + animToPlay = ANIM_STD_SPINFORWARD_LEFT; } if (m_nPedState == PED_ATTACK && collideWith->IsPedInControl()) @@ -3209,7 +3209,7 @@ CPed::KillPedWithCar(CVehicle *car, float impulse) damage = 30.0f; InflictDamage(car, WEAPONTYPE_RAMMEDBYCAR, damage, PEDPIECE_TORSO, fallDirection); - SetFall(1000, (AnimationId)(fallDirection + ANIM_KO_SKID_FRONT), true); + SetFall(1000, (AnimationId)(fallDirection + ANIM_STD_HIGHIMPACT_FRONT), true); if (OnGround() && !m_pCollidingEntity && (!IsPlayer() || bHasHitWall || car->GetModelIndex() == MI_TRAIN || m_vecDamageNormal.z < -0.8f)) { diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index ae981d1d..53187d0b 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -206,7 +206,7 @@ CPlayerPed::MakeChangesForNewWeapon(int8 weapon) void CPlayerPed::ReApplyMoveAnims(void) { - static AnimationId moveAnims[] = { ANIM_WALK, ANIM_RUN, ANIM_SPRINT, ANIM_IDLE_STANCE, ANIM_WALK_START }; + static AnimationId moveAnims[] = { ANIM_STD_WALK, ANIM_STD_RUN, ANIM_STD_RUNFAST, ANIM_STD_IDLE, ANIM_STD_STARTWALK }; for(int i = 0; i < ARRAY_SIZE(moveAnims); i++) { CAnimBlendAssociation *curMoveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), moveAnims[i]); @@ -262,13 +262,13 @@ CPlayerPed::SetInitialState(void) void CPlayerPed::SetRealMoveAnim(void) { - CAnimBlendAssociation *curWalkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK); - CAnimBlendAssociation *curRunAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN); - CAnimBlendAssociation *curSprintAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_SPRINT); - CAnimBlendAssociation *curWalkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK_START); - CAnimBlendAssociation *curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); - CAnimBlendAssociation *curRunStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP); - CAnimBlendAssociation *curRunStopRAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP_R); + CAnimBlendAssociation *curWalkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_WALK); + CAnimBlendAssociation *curRunAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUN); + CAnimBlendAssociation *curSprintAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNFAST); + CAnimBlendAssociation *curWalkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_STARTWALK); + CAnimBlendAssociation *curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); + CAnimBlendAssociation *curRunStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP1); + CAnimBlendAssociation *curRunStopRAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); if (bResetWalkAnims) { if (curWalkAssoc) curWalkAssoc->SetCurrentTime(0.0f); @@ -280,9 +280,9 @@ CPlayerPed::SetRealMoveAnim(void) } if (!curIdleAssoc) - curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); + curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (!curIdleAssoc) - curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); + curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); if (!((curRunStopAssoc && curRunStopAssoc->IsRunning()) || (curRunStopRAssoc && curRunStopRAssoc->IsRunning()))) { @@ -301,10 +301,10 @@ CPlayerPed::SetRealMoveAnim(void) if (!curIdleAssoc) { if (m_fCurrentStamina < 0.0f && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, nil, true, false, false, false, false, false)) { - curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 8.0f); + curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 8.0f); } else { - curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 8.0f); + curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 8.0f); } m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2500, 4000); } @@ -315,25 +315,25 @@ CPlayerPed::SetRealMoveAnim(void) if (!curIdleAssoc) { if (m_fCurrentStamina < 0.0f && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, nil, true, false, false, false, false, false)) { - curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 4.0f); + curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f); } else { - curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); + curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); } m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2500, 4000); } - if (m_fCurrentStamina > 0.0f && curIdleAssoc->animId == ANIM_IDLE_TIRED) { - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); + if (m_fCurrentStamina > 0.0f && curIdleAssoc->animId == ANIM_STD_IDLE_TIRED) { + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); } else if (m_nPedState != PED_FIGHT) { - if (m_fCurrentStamina < 0.0f && curIdleAssoc->animId != ANIM_IDLE_TIRED + if (m_fCurrentStamina < 0.0f && curIdleAssoc->animId != ANIM_STD_IDLE_TIRED && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, nil, true, false, false, false, false, false)) { - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 4.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f); - } else if (curIdleAssoc->animId != ANIM_IDLE_STANCE) { - CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); + } else if (curIdleAssoc->animId != ANIM_STD_IDLE) { + CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); } } m_nMoveState = PEDMOVE_STILL; @@ -344,7 +344,7 @@ CPlayerPed::SetRealMoveAnim(void) curWalkStartAssoc->blendAmount = 1.0f; curWalkStartAssoc->blendDelta = 0.0f; } else { - curWalkStartAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_WALK_START); + curWalkStartAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_STARTWALK); } if (curWalkAssoc) curWalkAssoc->SetCurrentTime(0.0f); @@ -352,8 +352,8 @@ CPlayerPed::SetRealMoveAnim(void) curRunAssoc->SetCurrentTime(0.0f); delete curIdleAssoc; - delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); - delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); + delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); + delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); delete curSprintAssoc; curSprintAssoc = nil; @@ -368,11 +368,11 @@ CPlayerPed::SetRealMoveAnim(void) RestoreHeadingRate(); } if (!curWalkAssoc) { - curWalkAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_WALK); + curWalkAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_WALK); curWalkAssoc->blendAmount = 0.0f; } if (!curRunAssoc) { - curRunAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_RUN); + curRunAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_RUN); curRunAssoc->blendAmount = 0.0f; } if (curWalkStartAssoc && !(curWalkStartAssoc->IsRunning())) { @@ -399,9 +399,9 @@ CPlayerPed::SetRealMoveAnim(void) if (m_fMoveSpeed < 0.4f) { AnimationId runStopAnim; if (curSprintAssoc->currentTime / curSprintAssoc->hierarchy->totalLength < 0.5) // double - runStopAnim = ANIM_RUN_STOP; + runStopAnim = ANIM_STD_RUNSTOP1; else - runStopAnim = ANIM_RUN_STOP_R; + runStopAnim = ANIM_STD_RUNSTOP2; CAnimBlendAssociation* newRunStopAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, runStopAnim); newRunStopAssoc->blendAmount = 1.0f; newRunStopAssoc->SetDeleteCallback(RestoreHeadingRateCB, this); @@ -444,7 +444,7 @@ CPlayerPed::SetRealMoveAnim(void) // Transition between run-sprint curWalkAssoc->blendAmount = 0.0f; curRunAssoc->blendAmount = 1.0f; - curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_SPRINT, 2.0f); + curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_RUNFAST, 2.0f); } UseSprintEnergy(); } else { @@ -539,14 +539,14 @@ CPlayerPed::DoesTargetHaveToBeBroken(CVector target, CWeapon *weaponUsed) void CPlayerPed::RunningLand(CPad *padUsed) { - CAnimBlendAssociation *landAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_LAND); + CAnimBlendAssociation *landAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL_LAND); if (landAssoc && landAssoc->currentTime == 0.0f && m_fMoveSpeed > 1.5f && padUsed && (padUsed->GetPedWalkLeftRight() != 0.0f || padUsed->GetPedWalkUpDown() != 0.0f)) { landAssoc->blendDelta = -1000.0f; landAssoc->flags |= ASSOC_DELETEFADEDOUT; - CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_JUMP_LAND)->SetFinishCallback(FinishJumpCB, this); + CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_JUMP_LAND)->SetFinishCallback(FinishJumpCB, this); if (m_nPedState == PED_JUMP) RestorePreviousState(); @@ -1009,7 +1009,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed) TheCamera.SetNewPlayerWeaponMode(CCam::MODE_M16_1STPERSON, 0, 0); m_fMoveSpeed = 0.0f; - CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_STANCE, 1000.0f); + CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE, 1000.0f); } if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER || GetWeapon()->m_eWeaponType == WEAPONTYPE_SNIPERRIFLE || TheCamera.PlayerWeaponMode.Mode == CCam::MODE_M16_1STPERSON) @@ -1280,24 +1280,24 @@ CPlayerPed::ProcessControl(void) } if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) { if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) { - CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR); + CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS); - if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || (rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR_LOW))) { + if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || (rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS))) { if (rollDoorAssoc) - m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime); + m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, rollDoorAssoc->currentTime); } else { // These comparisons are wrong, they return uint16 if (padUsed && (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f || padUsed->GetBrake() != 0.0f)) { if (rollDoorAssoc) - m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime); + m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, rollDoorAssoc->currentTime); } else { m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF; if (m_pMyVehicle->bLowVehicle) - rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR_LOW); + rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS); else - rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR); + rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS); rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this); } diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 053cf5e4..a0bf8be6 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -847,7 +847,7 @@ CPopulation::AddPedInCar(CVehicle* car) } #else { - newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f); + newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); } #endif diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp index b5af6619..684f5d74 100644 --- a/src/render/Clouds.cpp +++ b/src/render/Clouds.cpp @@ -273,8 +273,8 @@ CClouds::Render(void) for(i = 0; i < 37; i++){ RwV3d pos = { 2.0f*CoorsOffsetX[i], 2.0f*CoorsOffsetY[i], 40.0f*CoorsOffsetZ[i] + 40.0f }; - worldpos.x = campos.x*rot_cos + campos.y*rot_sin + pos.x; - worldpos.y = campos.x*rot_sin + campos.y*rot_cos + pos.y; + worldpos.x = pos.x*rot_cos + pos.y*rot_sin + campos.x; + worldpos.y = pos.x*rot_sin - pos.y*rot_cos + campos.y; worldpos.z = pos.z; if(bCloudOnScreen[i] && CSprite::CalcScreenCoors(worldpos, &screenpos, &szx, &szy, false)){ // BUG: this is stupid....would have to do this for each cloud individually diff --git a/src/render/Font.cpp b/src/render/Font.cpp index 7eed0933..6a9944e1 100644 --- a/src/render/Font.cpp +++ b/src/render/Font.cpp @@ -348,11 +348,26 @@ CFont::Initialise(void) SetDropShadowPosition(0); CTxdStore::PopCurrentTxd(); +#if !defined(GAMEPAD_MENU) && defined(BUTTON_ICONS) + // loaded in CMenuManager with GAMEPAD_MENU defined + LoadButtons("MODELS/X360BTNS.TXD"); +#endif +} + #ifdef BUTTON_ICONS - if (int file = CFileMgr::OpenFile("MODELS/X360BTNS.TXD")) { +void +CFont::LoadButtons(const char* txdPath) +{ + if (int file = CFileMgr::OpenFile(txdPath)) { CFileMgr::CloseFile(file); - ButtonsSlot = CTxdStore::AddTxdSlot("buttons"); - CTxdStore::LoadTxd(ButtonsSlot, "MODELS/X360BTNS.TXD"); + if (ButtonsSlot == -1) + ButtonsSlot = CTxdStore::AddTxdSlot("buttons"); + else { + for (int i = 0; i < MAX_BUTTON_ICONS; i++) + ButtonSprite[i].Delete(); + CTxdStore::RemoveTxd(ButtonsSlot); + } + CTxdStore::LoadTxd(ButtonsSlot, txdPath); CTxdStore::AddRef(ButtonsSlot); CTxdStore::PushCurrentTxd(); CTxdStore::SetCurrentTxd(ButtonsSlot); @@ -374,8 +389,16 @@ CFont::Initialise(void) ButtonSprite[BUTTON_R3].SetTexture("r3"); CTxdStore::PopCurrentTxd(); } -#endif // BUTTON_ICONS + else { + if (ButtonsSlot != -1) { + for (int i = 0; i < MAX_BUTTON_ICONS; i++) + ButtonSprite[i].Delete(); + CTxdStore::RemoveTxdSlot(ButtonsSlot); + ButtonsSlot = -1; + } + } } +#endif // BUTTON_ICONS #ifdef MORE_LANGUAGES void @@ -428,6 +451,7 @@ CFont::Shutdown(void) for (int i = 0; i < MAX_BUTTON_ICONS; i++) ButtonSprite[i].Delete(); CTxdStore::RemoveTxdSlot(ButtonsSlot); + ButtonsSlot = -1; } #endif Sprite[0].Delete(); diff --git a/src/render/Font.h b/src/render/Font.h index 621375d6..9316ed34 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -109,6 +109,7 @@ public: static CSprite2d ButtonSprite[MAX_BUTTON_ICONS]; static int PS2Symbol; + static void LoadButtons(const char *txdPath); static void DrawButton(float x, float y); #endif // BUTTON_ICONS diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index 2f7b9001..4991e024 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -1150,18 +1150,18 @@ void CHud::Draw() if (IntroRect.m_nTextureId >= 0) { CRect rect ( IntroRect.m_sRect.left, - IntroRect.m_sRect.top, + IntroRect.m_sRect.bottom, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom ); + IntroRect.m_sRect.top ); CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor); } else { CRect rect ( IntroRect.m_sRect.left, - IntroRect.m_sRect.top, + IntroRect.m_sRect.bottom, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom ); + IntroRect.m_sRect.top ); CSprite2d::DrawRect(rect, IntroRect.m_sColor); } diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp index 8c892be3..d7eccbfd 100644 --- a/src/render/Shadows.cpp +++ b/src/render/Shadows.cpp @@ -21,8 +21,8 @@ #include "Shadows.h" #ifdef DEBUGMENU -SETTWEAKPATH("Shadows"); -TWEAKBOOL(gbPrintShite); +//SETTWEAKPATH("Shadows"); +//TWEAKBOOL(gbPrintShite); #endif RwImVertexIndex ShadowIndexList[24]; diff --git a/src/render/WaterCannon.cpp b/src/render/WaterCannon.cpp index f54b31b9..3aaa74be 100644 --- a/src/render/WaterCannon.cpp +++ b/src/render/WaterCannon.cpp @@ -127,7 +127,7 @@ void CWaterCannon::Render(void) int16 pointA = m_nCur % NUM_SEGMENTPOINTS; int16 pointB = pointA - 1; - if ( (pointA - 1) < 0 ) + if ( pointB < 0 ) pointB += NUM_SEGMENTPOINTS; bool bInit = false; @@ -231,7 +231,7 @@ void CWaterCannon::PushPeds(void) ped->m_vecMoveSpeed.x = (0.6f * m_avecVelocity[j].x + ped->m_vecMoveSpeed.x) * 0.5f; ped->m_vecMoveSpeed.y = (0.6f * m_avecVelocity[j].y + ped->m_vecMoveSpeed.y) * 0.5f; - ped->SetFall(2000, AnimationId(ANIM_KO_SKID_FRONT + localDir), 0); + ped->SetFall(2000, AnimationId(ANIM_STD_HIGHIMPACT_FRONT + localDir), 0); CFire *fire = ped->m_pFire; if ( fire ) diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index 8c4fb14c..710a7702 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -71,7 +71,7 @@ void CapturePad(RwInt32 padID); void joysChangeCB(int jid, int event); #endif -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU extern char gSelectedJoystickName[128]; #endif @@ -132,7 +132,12 @@ void GetLocalTime_CP(SYSTEMTIME* out); typedef void* HANDLE; #define INVALID_HANDLE_VALUE NULL -#define FindClose(h) closedir((DIR*)h) +#define FindClose(h) \ + do { \ + if (h != nil) \ + closedir((DIR*)h); \ + } while(0) + #define LOCALE_USER_DEFAULT 0 #define DATE_SHORTDATE 0 diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 9643c63b..baed9000 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -52,6 +52,11 @@ long _dwOperatingSystemVersion; #define MAX_SUBSYSTEMS (16) +#ifdef _WIN32 +#define GLFW_EXPOSE_NATIVE_WIN32 +#include <GLFW/glfw3native.h> +#endif + rw::EngineOpenParams openParams; @@ -81,7 +86,7 @@ static psGlobalType PsGlobal; size_t _dwMemAvailPhys; RwUInt32 gGameState; -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU char gSelectedJoystickName[128] = ""; #endif @@ -204,6 +209,7 @@ psGrabScreen(RwCamera *pCamera) } #else rw::Image *image = RwCameraGetRaster(pCamera)->toImage(); + image->removeMask(); if(image) return image; #endif @@ -841,7 +847,7 @@ void joysChangeCB(int jid, int event); bool IsThisJoystickBlacklisted(int i) { -#ifndef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifndef DETECT_JOYSTICK_MENU return false; #else if (glfwJoystickIsGamepad(i)) @@ -906,7 +912,7 @@ void _InputInitialiseJoys() if (PSGLOBAL(joy1id) != -1) { int count; glfwGetJoystickButtons(PSGLOBAL(joy1id), &count); -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU strcpy(gSelectedJoystickName, glfwGetJoystickName(PSGLOBAL(joy1id))); #endif ControlsManager.InitDefaultControlConfigJoyPad(count); @@ -1559,6 +1565,15 @@ main(int argc, char *argv[]) return 0; } +#ifdef _WIN32 + HWND wnd = glfwGetWin32Window(PSGLOBAL(window)); + + HICON icon = LoadIcon(instance, MAKEINTRESOURCE(IDI_MAIN_ICON)); + + SendMessage(wnd, WM_SETICON, ICON_BIG, (LPARAM)icon); + SendMessage(wnd, WM_SETICON, ICON_SMALL, (LPARAM)icon); +#endif + psPostRWinit(); ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp()); @@ -2150,7 +2165,7 @@ void joysChangeCB(int jid, int event) if (event == GLFW_CONNECTED && !IsThisJoystickBlacklisted(jid)) { if (PSGLOBAL(joy1id) == -1) { PSGLOBAL(joy1id) = jid; -#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS +#ifdef DETECT_JOYSTICK_MENU strcpy(gSelectedJoystickName, glfwGetJoystickName(jid)); #endif // This is behind LOAD_INI_SETTINGS, because otherwise the Init call below will destroy/overwrite your bindings. diff --git a/src/skel/win/gta3.ico b/src/skel/win/gta3.ico Binary files differindex 2017c811..d0a47713 100644 --- a/src/skel/win/gta3.ico +++ b/src/skel/win/gta3.ico diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 3bda4e9d..86b0b214 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -121,6 +121,10 @@ DWORD _dwOperatingSystemVersion; RwUInt32 gGameState; CJoySticks AllValidWinJoys; +#ifdef DETECT_JOYSTICK_MENU +char gSelectedJoystickName[128] = ""; +#endif + // What is that for anyway? #ifndef IMPROVED_VIDEOMODE static RwBool defaultFullscreenRes = TRUE; @@ -255,6 +259,7 @@ psGrabScreen(RwCamera *pCamera) } #else rw::Image *image = RwCameraGetRaster(pCamera)->toImage(); + image->removeMask(); if(image) return image; #endif @@ -1325,7 +1330,11 @@ InitApplication(HANDLE instance) windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = (HINSTANCE)instance; +#ifdef FIX_BUGS + windowClass.hIcon = LoadIcon((HINSTANCE)instance, MAKEINTRESOURCE(IDI_MAIN_ICON)); +#else windowClass.hIcon = nil; +#endif windowClass.hCursor = LoadCursor(nil, IDC_ARROW); windowClass.hbrBackground = nil; windowClass.lpszMenuName = NULL; diff --git a/src/text/Text.cpp b/src/text/Text.cpp index fe37d0f1..08ab0e1e 100644 --- a/src/text/Text.cpp +++ b/src/text/Text.cpp @@ -8,7 +8,7 @@ #include "Messages.h" #include "Text.h" -static wchar WideErrorString[25]; +wchar WideErrorString[25]; CText TheText; diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 7e8c4702..4863b945 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -3058,21 +3058,21 @@ CAutomobile::DoDriveByShootings(void) if(lookingLeft || lookingRight){ if(lookingLeft){ - anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R); + anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if(anim) anim->blendDelta = -1000.0f; - anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L); + anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if(anim == nil || anim->blendDelta < 0.0f) - CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_L); + CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVEBY_LEFT); else anim->SetRun(); }else if(pDriver->m_pMyVehicle->pPassengers[0] == nil || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON){ - anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L); + anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if(anim) anim->blendDelta = -1000.0f; - anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R); + anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if(anim == nil || anim->blendDelta < 0.0f) - CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_R); + CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVEBY_RIGHT); else anim->SetRun(); } @@ -3083,10 +3083,10 @@ CAutomobile::DoDriveByShootings(void) } }else{ weapon->Reload(); - anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L); + anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if(anim) anim->blendDelta = -1000.0f; - anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R); + anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if(anim) anim->blendDelta = -1000.0f; } @@ -3094,11 +3094,11 @@ CAutomobile::DoDriveByShootings(void) // TODO: what is this? if(!lookingLeft && m_weaponDoorTimerLeft > 0.0f){ m_weaponDoorTimerLeft = Max(m_weaponDoorTimerLeft - CTimer::GetTimeStep()*0.1f, 0.0f); - ProcessOpenDoor(CAR_DOOR_LF, NUM_ANIMS, m_weaponDoorTimerLeft); + ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_NUM, m_weaponDoorTimerLeft); } if(!lookingRight && m_weaponDoorTimerRight > 0.0f){ m_weaponDoorTimerRight = Max(m_weaponDoorTimerRight - CTimer::GetTimeStep()*0.1f, 0.0f); - ProcessOpenDoor(CAR_DOOR_RF, NUM_ANIMS, m_weaponDoorTimerRight); + ProcessOpenDoor(CAR_DOOR_RF, ANIM_STD_NUM, m_weaponDoorTimerRight); } } @@ -3736,55 +3736,55 @@ CAutomobile::ProcessOpenDoor(uint32 component, uint32 anim, float time) return; switch(anim){ - case ANIM_CAR_QJACK: - case ANIM_CAR_OPEN_LHS: - case ANIM_CAR_OPEN_RHS: + case ANIM_STD_QUICKJACK: + case ANIM_STD_CAR_OPEN_DOOR_LHS: + case ANIM_STD_CAR_OPEN_DOOR_RHS: ProcessDoorOpenAnimation(this, component, door, time, 0.66f, 0.8f); break; - case ANIM_CAR_CLOSEDOOR_LHS: - case ANIM_CAR_CLOSEDOOR_LOW_LHS: - case ANIM_CAR_CLOSEDOOR_RHS: - case ANIM_CAR_CLOSEDOOR_LOW_RHS: + case ANIM_STD_CAR_CLOSE_DOOR_LHS: + case ANIM_STD_CAR_CLOSE_DOOR_LO_LHS: + case ANIM_STD_CAR_CLOSE_DOOR_RHS: + case ANIM_STD_CAR_CLOSE_DOOR_LO_RHS: ProcessDoorCloseAnimation(this, component, door, time, 0.2f, 0.63f); break; - case ANIM_CAR_ROLLDOOR: - case ANIM_CAR_ROLLDOOR_LOW: + case ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS: + case ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS: ProcessDoorOpenCloseAnimation(this, component, door, time, 0.1f, 0.6f, 0.95f); break; - case ANIM_CAR_GETOUT_LHS: - case ANIM_CAR_GETOUT_LOW_LHS: - case ANIM_CAR_GETOUT_RHS: - case ANIM_CAR_GETOUT_LOW_RHS: + case ANIM_STD_GETOUT_LHS: + case ANIM_STD_GETOUT_LO_LHS: + case ANIM_STD_GETOUT_RHS: + case ANIM_STD_GETOUT_LO_RHS: ProcessDoorOpenAnimation(this, component, door, time, 0.06f, 0.43f); break; - case ANIM_CAR_CLOSE_LHS: - case ANIM_CAR_CLOSE_RHS: + case ANIM_STD_CAR_CLOSE_LHS: + case ANIM_STD_CAR_CLOSE_RHS: ProcessDoorCloseAnimation(this, component, door, time, 0.1f, 0.23f); break; - case ANIM_CAR_PULLOUT_RHS: - case ANIM_CAR_PULLOUT_LOW_RHS: + case ANIM_STD_CAR_PULL_OUT_PED_RHS: + case ANIM_STD_CAR_PULL_OUT_PED_LO_RHS: OpenDoor(component, door, 1.0f); break; - case ANIM_COACH_OPEN_L: - case ANIM_COACH_OPEN_R: + case ANIM_STD_COACH_OPEN_LHS: + case ANIM_STD_COACH_OPEN_RHS: ProcessDoorOpenAnimation(this, component, door, time, 0.66f, 0.8f); break; - case ANIM_COACH_OUT_L: + case ANIM_STD_COACH_GET_OUT_LHS: ProcessDoorOpenAnimation(this, component, door, time, 0.0f, 0.3f); break; - case ANIM_VAN_OPEN_L: - case ANIM_VAN_OPEN: + case ANIM_STD_VAN_OPEN_DOOR_REAR_LHS: + case ANIM_STD_VAN_OPEN_DOOR_REAR_RHS: ProcessDoorOpenAnimation(this, component, door, time, 0.37f, 0.55f); break; - case ANIM_VAN_CLOSE_L: - case ANIM_VAN_CLOSE: + case ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS: + case ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS: ProcessDoorCloseAnimation(this, component, door, time, 0.5f, 0.8f); break; - case ANIM_VAN_GETOUT_L: - case ANIM_VAN_GETOUT: + case ANIM_STD_VAN_GET_OUT_REAR_LHS: + case ANIM_STD_VAN_GET_OUT_REAR_RHS: ProcessDoorOpenAnimation(this, component, door, time, 0.5f, 0.6f); break; - case NUM_ANIMS: + case ANIM_STD_NUM: OpenDoor(component, door, time); break; } @@ -3879,7 +3879,7 @@ CAutomobile::BlowUpCar(CEntity *culprit) if(!pDriver->IsPlayer()) pDriver->FlagToDestroyWhenNextProcessed(); }else - pDriver->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + pDriver->SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); } for(i = 0; i < m_nNumMaxPassengers; i++){ if(pPassengers[i]){ @@ -3889,7 +3889,7 @@ CAutomobile::BlowUpCar(CEntity *culprit) if(!pPassengers[i]->IsPlayer()) pPassengers[i]->FlagToDestroyWhenNextProcessed(); }else - pPassengers[i]->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f); + pPassengers[i]->SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); } } diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index a6a4f815..fcfa3401 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -182,7 +182,7 @@ public: float m_fMapObjectHeightBehind; // rear Z? eCarLock m_nDoorLock; int8 m_nLastWeaponDamage; // see eWeaponType, -1 if no damage - int8 m_nRadioStation; + uint8 m_nRadioStation; uint8 m_bRainAudioCounter; uint8 m_bRainSamplesCounter; uint8 m_nCarHornTimer; @@ -276,7 +276,7 @@ public: #endif CVehicleModelInfo* GetModelInfo() { return (CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()); } bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_BORGNINE; } - AnimationId GetDriverAnim(void) { return IsCar() && bLowVehicle ? ANIM_CAR_LSIT : (IsBoat() && GetModelIndex() != MI_SPEEDER ? ANIM_DRIVE_BOAT : ANIM_CAR_SIT); } + AnimationId GetDriverAnim(void) { return IsCar() && bLowVehicle ? ANIM_STD_CAR_SIT_LO : (IsBoat() && GetModelIndex() != MI_SPEEDER ? ANIM_STD_BOAT_DRIVE : ANIM_STD_CAR_SIT); } static bool bWheelsOnlyCheat; static bool bAllDodosCheat; diff --git a/src/weapons/BulletInfo.cpp b/src/weapons/BulletInfo.cpp index e87a7407..bfe27e18 100644 --- a/src/weapons/BulletInfo.cpp +++ b/src/weapons/BulletInfo.cpp @@ -121,7 +121,7 @@ void CBulletInfo::Update(void) if (pPed->DoesLOSBulletHitPed(point)) { if (pPed->IsPedInControl() && !pPed->bIsDucking) { pPed->ClearAttackByRemovingAnim(); - CAnimBlendAssociation* pAnim = CAnimManager::AddAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_SHOT_FRONT_PARTIAL); + CAnimBlendAssociation* pAnim = CAnimManager::AddAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HITBYGUN_FRONT); pAnim->SetBlend(0.0f, 8.0f); } pPed->InflictDamage(pBullet->m_pSource, pBullet->m_eWeaponType, pBullet->m_nDamage, (ePedPieceTypes)point.pieceB, pPed->GetLocalDirection(pPed->GetPosition() - point.point)); @@ -146,9 +146,9 @@ void CBulletInfo::Update(void) if (pPed->GetPedState() == PED_DEAD) { CAnimBlendAssociation* pAnim; if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FRONTAL)) - pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f); + pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f); else - pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f); + pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f); if (pAnim) { pAnim->SetCurrentTime(0.0f); pAnim->flags |= ASSOC_RUNNING; diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index a987a4c7..dab510be 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -473,9 +473,9 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) victimPed->ApplyMoveForce(posOffset.x*-5.0f, posOffset.y*-5.0f, 3.0f); if ( isBat && victimPed->IsPlayer() ) - victimPed->SetFall(3000, AnimationId(ANIM_KO_SKID_FRONT + localDir), false); + victimPed->SetFall(3000, AnimationId(ANIM_STD_HIGHIMPACT_FRONT + localDir), false); else - victimPed->SetFall(1500, AnimationId(ANIM_KO_SKID_FRONT + localDir), false); + victimPed->SetFall(1500, AnimationId(ANIM_STD_HIGHIMPACT_FRONT + localDir), false); shooterPed->m_pSeekTarget = victimPed; shooterPed->m_pSeekTarget->RegisterReference(&shooterPed->m_pSeekTarget); @@ -904,7 +904,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, victimPed->bIsStanding = false; victimPed->ApplyMoveForce(posOffset.x*-5.0f, posOffset.y*-5.0f, 5.0f); - victimPed->SetFall(1500, AnimationId(ANIM_KO_SKID_FRONT + localDir), false); + victimPed->SetFall(1500, AnimationId(ANIM_STD_HIGHIMPACT_FRONT + localDir), false); victimPed->InflictDamage(shooter, m_eWeaponType, info->m_nDamage, (ePedPieceTypes)point->pieceB, localDir); } @@ -917,7 +917,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, { victimPed->ClearAttackByRemovingAnim(); - CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_SHOT_FRONT_PARTIAL + localDir)); + CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_STD_HITBYGUN_FRONT + localDir)); ASSERT(asoc!=nil); asoc->blendAmount = 0.0f; @@ -933,7 +933,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, { victimPed->ClearAttackByRemovingAnim(); - CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_SHOT_FRONT_PARTIAL + localDir)); + CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_STD_HITBYGUN_FRONT + localDir)); ASSERT(asoc!=nil); asoc->blendAmount = 0.0f; @@ -983,9 +983,9 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, { CAnimBlendAssociation *asoc; if ( RpAnimBlendClumpGetFirstAssociation(victimPed->GetClump(), ASSOC_FRONTAL) ) - asoc = CAnimManager::BlendAnimation(victimPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f); + asoc = CAnimManager::BlendAnimation(victimPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f); else - asoc = CAnimManager::BlendAnimation(victimPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f); + asoc = CAnimManager::BlendAnimation(victimPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f); if ( asoc ) { @@ -1248,7 +1248,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) victimPed->ApplyMoveForce(posOffset.x*-2.0f, posOffset.y*-2.0f, 0.0f); if ( cantStandup ) - victimPed->SetFall(1500, AnimationId(ANIM_KO_SKID_FRONT + localDir), false); + victimPed->SetFall(1500, AnimationId(ANIM_STD_HIGHIMPACT_FRONT + localDir), false); victimPed->InflictDamage(shooter, m_eWeaponType, info->m_nDamage, (ePedPieceTypes)point.pieceB, localDir); @@ -1719,7 +1719,7 @@ CWeapon::FireInstantHitFromCar(CAutomobile *shooter, bool left) victimPed->ReactToAttack(FindPlayerPed()); victimPed->ClearAttackByRemovingAnim(); - CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_SHOT_FRONT_PARTIAL + localDir)); + CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_STD_HITBYGUN_FRONT + localDir)); ASSERT(asoc!=nil); asoc->blendAmount = 0.0f; asoc->blendDelta = 8.0f; @@ -2089,7 +2089,7 @@ FireOneInstantHitRound(CVector *source, CVector *target, int32 damage) victimPed->ClearAttackByRemovingAnim(); - CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_SHOT_FRONT_PARTIAL + localDir)); + CAnimBlendAssociation *asoc = CAnimManager::AddAnimation(victimPed->GetClump(), ASSOCGRP_STD, AnimationId(ANIM_STD_HITBYGUN_FRONT + localDir)); ASSERT(asoc!=nil); asoc->blendAmount = 0.0f; asoc->blendDelta = 8.0f; diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp index 10737acb..ba872454 100644 --- a/src/weapons/WeaponInfo.cpp +++ b/src/weapons/WeaponInfo.cpp @@ -37,8 +37,8 @@ CWeaponInfo::Initialise(void) debug("Initialising CWeaponInfo...\n"); for (int i = 0; i < WEAPONTYPE_TOTALWEAPONS; i++) { aWeaponInfo[i].m_eWeaponFire = WEAPON_FIRE_INSTANT_HIT; - aWeaponInfo[i].m_AnimToPlay = ANIM_PUNCH_R; - aWeaponInfo[i].m_Anim2ToPlay = NUM_ANIMS; + aWeaponInfo[i].m_AnimToPlay = ANIM_STD_PUNCH; + aWeaponInfo[i].m_Anim2ToPlay = ANIM_STD_NUM; aWeaponInfo[i].m_Flags = WEAPONFLAG_USE_GRAVITY | WEAPONFLAG_SLOWS_DOWN | WEAPONFLAG_RAND_SPEED | WEAPONFLAG_EXPANDS | WEAPONFLAG_EXPLODES; } debug("Loading weapon data...\n"); @@ -96,7 +96,7 @@ CWeaponInfo::LoadWeaponData(void) fireType[0] = '\0'; fireOffsetY = 0.0f; fireOffsetZ = 0.0f; - animId = ANIM_WALK; + animId = ANIM_STD_WALK; sscanf( &line[lp], "%s %s %f %d %d %d %d %f %f %f %f %f %f %f %s %s %f %f %f %f %d %d", |