sync
This commit is contained in:
@@ -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})
|
||||
|
||||
@@ -230,3 +230,9 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
CAnimBlendAssociation::Remove()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
void UpdateTimeStep(float timeDelta, float relSpeed);
|
||||
bool UpdateTime(float timeDelta, float relSpeed);
|
||||
bool UpdateBlend(float timeDelta);
|
||||
void Remove();
|
||||
|
||||
void SetRun(void) { flags |= ASSOC_RUNNING; }
|
||||
|
||||
|
||||
@@ -20,212 +20,212 @@ 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 },
|
||||
{ ANIM_KO_SHOT_STOM, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ 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 },
|
||||
{ ANIM_KD_RIGHT, ASSOC_PARTIAL },
|
||||
{ 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_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_FIGHT_IDLE, ASSOC_REPEAT },
|
||||
{ ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_L_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_R_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_UPPERCUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HEADBUTT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FRONTKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_L_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_R_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_UPPERCUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_HEADBUTT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_FRONTKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_RHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PUNCH_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FIGHT_PPUNCH2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_KICK_FLOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FIGHT_SH_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ 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_JUMPIN_LHS, 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 | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVE_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVE_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVEBY_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVEBY_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVE_BOAT_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_DRIVE_BOAT_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BOAT_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_PICKUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_PICKUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_PULLUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_PULLUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_ELBOW_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_ELBOW_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_FALL_OFF, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_BIKE_FALL_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ 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_TRAIN_GETIN, ASSOC_DELETEFADEDOUT },
|
||||
{ ANIM_TRAIN_GETOUT, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE },
|
||||
{ ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_CAR_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_CAR_ROLLOUT_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ 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 | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FALL_FALL, ASSOC_DELETEFADEDOUT },
|
||||
{ ANIM_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FALL_COLLAPSE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FALL_BACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_FALL_FRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_EV_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_COMMANDO_ROLL, 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_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_CROUCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_RBLOCK_CSHOOT, ASSOC_RUNNING },
|
||||
{ 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_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_SEAT_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_SEAT_UP, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_SEAT_IDLE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_SEAT_DOWN2, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ATM, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ABSEIL, 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 },
|
||||
{ ANIM_STD_KO_SHOT_STOMACH, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ 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 },
|
||||
{ ANIM_STD_SPINFORWARD_RIGHT, ASSOC_PARTIAL },
|
||||
{ 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 },
|
||||
{ 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_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_PARTIAL_PUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_FIGHT_ATTACK_A1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_ATTACK_A2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_ATTACK_A3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_ATTACK_B1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_ATTACK_B2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_ATTACK_B3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_HIT_A1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_HIT_A2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_HIT_A3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_HIT_B1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_HIT_B2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_HIT_B3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_DETONATE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_PARTIALPUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_KICKGROUND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_THROW_UNDER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_FIGHT_SHUFFLE_B, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ 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_CAR_JUMP_IN_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 | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVE_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVE_LEFT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVE_RIGHT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVEBY_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVEBY_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVEBY_LEFT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_DRIVEBY_RIGHT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_CAR_LOOKBEHIND, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_BOAT_DRIVE, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
|
||||
{ ANIM_STD_BOAT_DRIVE_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_BOAT_DRIVE_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_BOAT_LOOKBEHIND, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_STD_BIKE_PICKUP_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_BIKE_PICKUP_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_BIKE_PULLUP_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_BIKE_PULLUP_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_BIKE_ELBOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_BIKE_ELBOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_BIKE_FALLOFF, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_BIKE_FALLBACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ 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_TRAIN_GETIN, ASSOC_DELETEFADEDOUT },
|
||||
{ ANIM_STD_TRAIN_GETOUT, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE },
|
||||
{ ANIM_STD_CRAWLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_STD_ROLLOUT_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ 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 | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_FALL, ASSOC_DELETEFADEDOUT },
|
||||
{ ANIM_STD_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_FALL_COLLAPSE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_FALL_ONBACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_FALL_ONFRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_STD_EVADE_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_STD_EVADE_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_STD_COMMANDO_ROLL, 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_STD_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_DUCK_WEAPON, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_RBLOCK_SHOOT, ASSOC_RUNNING },
|
||||
{ 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_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_SEAT_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_SEAT_UP, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_SEAT_IDLE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_SEAT_RVRS, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_ATM, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_STD_ABSEIL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aVanAnimDescs[] = {
|
||||
{ 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_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 },
|
||||
};
|
||||
AnimAssocDesc aCoachAnimDescs[] = {
|
||||
{ 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_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 },
|
||||
};
|
||||
AnimAssocDesc aBikeAnimDescs[] = {
|
||||
{ ANIM_BIKE_RIDE, ASSOC_DELETEFADEDOUT },
|
||||
{ ANIM_BIKE_STILL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_READY, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_LEFT, ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_RIGHT, ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_BACK, ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_FWD, ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_PUSHES, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_JUMPON_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_JUMPON_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_LEANB, ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_LEANF, ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_WALKBACK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_JUMPON_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_JUMPON_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_HIT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_GETOFF_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_GETOFF_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_GETOFF_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BIKE_GETOFF_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_BIKE_DRIVEBY_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_DRIVEBY_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_DRIVEBY_FT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_PASSENGER, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_DRIVEBY_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_DRIVEBY_FORWARD, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||
{ ANIM_BIKE_RIDE_P, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
|
||||
};
|
||||
AnimAssocDesc aMeleeAnimDescs[] = {
|
||||
{ ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
@@ -242,25 +242,25 @@ AnimAssocDesc aSwingAnimDescs[] = {
|
||||
{ ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aWeaponAnimDescs[] = {
|
||||
{ ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_CROUCHFIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_CROUCHRELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ATTACK_1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ATTACK_2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ATTACK_EXTRA1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ATTACK_EXTRA2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aMedicAnimDescs[] = {
|
||||
{ ANIM_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_MEDIC_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aSunbatheAnimDescs[] = {
|
||||
{ ANIM_SUNBATHE, ASSOC_REPEAT | ASSOC_PARTIAL },
|
||||
{ ANIM_SUNBATHE_IDLE, ASSOC_REPEAT | ASSOC_PARTIAL },
|
||||
{ ANIM_SUNBATHE_DOWN, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
|
||||
{ ANIM_SUNBATHE_UP, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
|
||||
{ ANIM_SUNBATHE_ESCAPE, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aPlayerIdleAnimDescs[] = {
|
||||
{ ANIM_IDLE_STRETCH, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_IDLE_TIME, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_IDLE_SHOULDER, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_IDLE_STRETCH_LEG, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PLAYER_IDLE1, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PLAYER_IDLE2, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PLAYER_IDLE3, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PLAYER_IDLE4, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aRiotAnimDescs[] = {
|
||||
{ ANIM_RIOT_ANGRY, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
@@ -269,7 +269,7 @@ AnimAssocDesc aRiotAnimDescs[] = {
|
||||
{ ANIM_RIOT_PUNCHES, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_RIOT_SHOUT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_RIOT_CHALLENGE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_RIOT_FUKU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_RIOT_FUCKYOU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aStripAnimDescs[] = {
|
||||
{ ANIM_STRIP_A, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
@@ -281,25 +281,25 @@ AnimAssocDesc aStripAnimDescs[] = {
|
||||
{ ANIM_STRIP_G, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aStdAnimDescsSide[] = {
|
||||
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
|
||||
{ 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_HAS_X_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_STD_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_STD_RUNFAST, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_STD_IDLE, ASSOC_REPEAT },
|
||||
{ ANIM_STD_STARTWALK, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
|
||||
};
|
||||
AnimAssocDesc aMPNoteAnimDescs[] = {
|
||||
{ ANIM_MPNOTE, ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_MPNOTE_LOOP, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_MULTIPLAYER_CUTSCENE_MPNOTE, ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
};
|
||||
AnimAssocDesc aCSMiscAnimDescs[] = {
|
||||
{ ANIM_IDLE_LOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_NO, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_YES, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_CHAT2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_COUGH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_GIGGLE_FEMALE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_TOUGH_CHAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_IDLE_CELL_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_LOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_NO, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_YES, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_CHAT2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_COUGH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_GIGGLE_FEMALE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_TOUGH_CHAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_CS_MISC_IDLE_CELL_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
};
|
||||
AnimAssocDesc aDONH2AnimDescs[] = {
|
||||
{ ANIM_DONH2_CAMERA, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
@@ -320,7 +320,7 @@ AnimAssocDesc aJDT5AnimDescs[] = {
|
||||
};
|
||||
AnimAssocDesc aJDT6AnimDescs[] = {
|
||||
{ ANIM_JDT6_PICKUP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_JDT6_DOORKNOCK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_JDT6_KNOCK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
};
|
||||
AnimAssocDesc aMAR1AnimDescs[] = {
|
||||
{ ANIM_MAR1_SKIRT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
@@ -334,7 +334,7 @@ AnimAssocDesc aMAR2AnimDescs[] = {
|
||||
AnimAssocDesc aMAR3AnimDescs[] = {
|
||||
{ ANIM_MAR3_HOOCHY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_MAR3_NOTE_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_MAR3_NOTE_PICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_MAR3_NOTE_PICKUP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
};
|
||||
AnimAssocDesc aSAL1AnimDescs[] = {
|
||||
{ ANIM_SAL1_BIREFCASE_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
@@ -349,8 +349,8 @@ AnimAssocDesc aSAL3AnimDescs[] = {
|
||||
{ ANIM_SAL3_SIT_DOWN, ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
};
|
||||
AnimAssocDesc aSAL4AnimDescs[] = {
|
||||
{ ANIM_SAL4_DUSTDOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_SAL4_GIRLRUN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_SAL4_DUST_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
{ ANIM_SAL4_GIRL_RUN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
};
|
||||
AnimAssocDesc aSAL6AnimDescs[] = {
|
||||
{ ANIM_SAL6_ANGRY_SEATED, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
|
||||
|
||||
@@ -2,250 +2,256 @@
|
||||
|
||||
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_HIT_WALL,
|
||||
ANIM_FLOOR_HIT_F,
|
||||
ANIM_HIT_BEHIND,
|
||||
ANIM_FIGHT_IDLE,
|
||||
ANIM_FIGHT2_IDLE,
|
||||
ANIM_FIGHT_SH_F,
|
||||
ANIM_FIGHT_PPUNCH,
|
||||
ANIM_L_HOOK,
|
||||
ANIM_R_HOOK,
|
||||
ANIM_UPPERCUT,
|
||||
ANIM_HEADBUTT,
|
||||
ANIM_FRONTKICK,
|
||||
ANIM_ROUNDHOUSE,
|
||||
ANIM_HIT_L_HOOK,
|
||||
ANIM_HIT_R_HOOK,
|
||||
ANIM_HIT_UPPERCUT,
|
||||
ANIM_HIT_HEADBUTT,
|
||||
ANIM_HIT_FRONTKICK,
|
||||
ANIM_HIT_RHOUSE,
|
||||
ANIM_BOMBER,
|
||||
ANIM_PUNCH_R,
|
||||
ANIM_FIGHT_PPUNCH2,
|
||||
ANIM_KICK_FLOOR,
|
||||
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,
|
||||
ANIM_STD_HIT_WALL,
|
||||
ANIM_STD_HIT_FLOOR_FRONT,
|
||||
ANIM_STD_HIT_BEHIND,
|
||||
ANIM_STD_FIGHT_IDLE,
|
||||
ANIM_STD_FIGHT_2IDLE,
|
||||
ANIM_STD_FIGHT_SHUFFLE_F,
|
||||
ANIM_STD_PARTIAL_PUNCH,
|
||||
ANIM_FIGHT_ATTACK_A1,
|
||||
ANIM_FIGHT_ATTACK_A2,
|
||||
ANIM_FIGHT_ATTACK_A3,
|
||||
ANIM_FIGHT_ATTACK_B1,
|
||||
ANIM_FIGHT_ATTACK_B2,
|
||||
ANIM_FIGHT_ATTACK_B3,
|
||||
ANIM_FIGHT_HIT_A1,
|
||||
ANIM_FIGHT_HIT_A2,
|
||||
ANIM_FIGHT_HIT_A3,
|
||||
ANIM_FIGHT_HIT_B1,
|
||||
ANIM_FIGHT_HIT_B2,
|
||||
ANIM_FIGHT_HIT_B3,
|
||||
ANIM_STD_DETONATE,
|
||||
ANIM_STD_PUNCH,
|
||||
ANIM_STD_PARTIALPUNCH,
|
||||
ANIM_STD_KICKGROUND,
|
||||
|
||||
ANIM_WEAPON_THROWU,
|
||||
ANIM_FIGHT_SH_BACK,
|
||||
ANIM_STD_THROW_UNDER,
|
||||
ANIM_STD_FIGHT_SHUFFLE_B,
|
||||
|
||||
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_JUMPIN_LHS,
|
||||
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_DRIVEBY_LOW_L,
|
||||
ANIM_DRIVEBY_LOW_R,
|
||||
ANIM_CAR_LB,
|
||||
ANIM_DRIVE_BOAT,
|
||||
ANIM_DRIVE_BOAT_L,
|
||||
ANIM_DRIVE_BOAT_R,
|
||||
ANIM_BOAT_LB,
|
||||
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_CAR_JUMP_IN_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_DRIVEBY_LEFT_LO,
|
||||
ANIM_STD_CAR_DRIVEBY_RIGHT_LO,
|
||||
ANIM_STD_CAR_LOOKBEHIND,
|
||||
ANIM_STD_BOAT_DRIVE,
|
||||
ANIM_STD_BOAT_DRIVE_LEFT,
|
||||
ANIM_STD_BOAT_DRIVE_RIGHT,
|
||||
ANIM_STD_BOAT_LOOKBEHIND,
|
||||
|
||||
ANIM_BIKE_PICKUP_R,
|
||||
ANIM_BIKE_PICKUP_L,
|
||||
ANIM_BIKE_PULLUP_R,
|
||||
ANIM_BIKE_PULLUP_L,
|
||||
ANIM_BIKE_ELBOW_R,
|
||||
ANIM_BIKE_ELBOW_L,
|
||||
ANIM_BIKE_FALL_OFF,
|
||||
ANIM_BIKE_FALL_R,
|
||||
ANIM_STD_BIKE_PICKUP_LHS,
|
||||
ANIM_STD_BIKE_PICKUP_RHS,
|
||||
ANIM_STD_BIKE_PULLUP_LHS,
|
||||
ANIM_STD_BIKE_PULLUP_RHS,
|
||||
ANIM_STD_BIKE_ELBOW_LHS,
|
||||
ANIM_STD_BIKE_ELBOW_RHS,
|
||||
ANIM_STD_BIKE_FALLOFF,
|
||||
ANIM_STD_BIKE_FALLBACK,
|
||||
|
||||
ANIM_CAR_GETOUT_RHS,
|
||||
ANIM_CAR_GETOUT_LOW_RHS,
|
||||
ANIM_CAR_CLOSE_RHS,
|
||||
ANIM_CAR_HOOKERTALK,
|
||||
ANIM_STD_GETOUT_RHS,
|
||||
ANIM_STD_GETOUT_LO_RHS,
|
||||
ANIM_STD_CAR_CLOSE_RHS,
|
||||
ANIM_STD_CAR_HOOKERTALK,
|
||||
|
||||
ANIM_TRAIN_GETIN,
|
||||
ANIM_TRAIN_GETOUT,
|
||||
ANIM_STD_TRAIN_GETIN,
|
||||
ANIM_STD_TRAIN_GETOUT,
|
||||
|
||||
ANIM_CAR_CRAWLOUT_RHS,
|
||||
ANIM_CAR_CRAWLOUT_RHS2,
|
||||
ANIM_CAR_ROLLOUT_LHS,
|
||||
ANIM_CAR_ROLLOUT_RHS,
|
||||
ANIM_STD_CRAWLOUT_LHS,
|
||||
ANIM_STD_CRAWLOUT_RHS,
|
||||
ANIM_STD_ROLLOUT_LHS,
|
||||
ANIM_STD_ROLLOUT_RHS,
|
||||
|
||||
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_FALL_BACK,
|
||||
ANIM_FALL_FRONT,
|
||||
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_FALL_ONBACK,
|
||||
ANIM_STD_FALL_ONFRONT,
|
||||
|
||||
ANIM_EV_STEP,
|
||||
ANIM_EV_DIVE,
|
||||
ANIM_COMMANDO_ROLL,
|
||||
ANIM_XPRESS_SCRATCH,
|
||||
ANIM_ROAD_CROSS,
|
||||
ANIM_TURN_180,
|
||||
ANIM_ARREST_GUN,
|
||||
ANIM_DROWN,
|
||||
ANIM_DUCK_DOWN,
|
||||
ANIM_DUCK_LOW,
|
||||
ANIM_STD_EVADE_STEP,
|
||||
ANIM_STD_EVADE_DIVE,
|
||||
ANIM_STD_COMMANDO_ROLL,
|
||||
ANIM_STD_XPRESS_SCRATCH,
|
||||
ANIM_STD_ROADCROSS,
|
||||
ANIM_STD_TURN180,
|
||||
ANIM_STD_ARREST,
|
||||
ANIM_STD_DROWN,
|
||||
ANIM_STD_DUCK_DOWN,
|
||||
ANIM_STD_DUCK_LOW,
|
||||
|
||||
ANIM_WEAPON_CROUCH,
|
||||
ANIM_STD_DUCK_WEAPON,
|
||||
|
||||
ANIM_RBLOCK_CSHOOT,
|
||||
ANIM_HANDSUP,
|
||||
ANIM_HANDSCOWER,
|
||||
ANIM_FUCKU,
|
||||
ANIM_PHONE_IN,
|
||||
ANIM_PHONE_OUT,
|
||||
ANIM_PHONE_TALK,
|
||||
ANIM_STD_RBLOCK_SHOOT,
|
||||
ANIM_STD_HANDSUP,
|
||||
ANIM_STD_HANDSCOWER,
|
||||
ANIM_STD_PARTIAL_FUCKU,
|
||||
ANIM_STD_PHONE_IN,
|
||||
ANIM_STD_PHONE_OUT,
|
||||
ANIM_STD_PHONE_TALK,
|
||||
|
||||
ANIM_SEAT_DOWN,
|
||||
ANIM_SEAT_UP,
|
||||
ANIM_SEAT_IDLE,
|
||||
ANIM_SEAT_DOWN2,
|
||||
ANIM_ATM,
|
||||
ANIM_ABSEIL,
|
||||
ANIM_STD_SEAT_DOWN,
|
||||
ANIM_STD_SEAT_UP,
|
||||
ANIM_STD_SEAT_IDLE,
|
||||
ANIM_STD_SEAT_RVRS,
|
||||
ANIM_STD_ATM,
|
||||
ANIM_STD_ABSEIL,
|
||||
|
||||
NUM_STD_ANIMS,
|
||||
ANIM_STD_NUM,
|
||||
|
||||
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_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_COACH_OPEN_L,
|
||||
ANIM_COACH_OPEN_R,
|
||||
ANIM_COACH_IN_L,
|
||||
ANIM_COACH_IN_R,
|
||||
ANIM_COACH_OUT_L,
|
||||
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_BIKE_RIDE,
|
||||
ANIM_BIKE_STILL,
|
||||
ANIM_BIKE_READY,
|
||||
ANIM_BIKE_LEFT,
|
||||
ANIM_BIKE_RIGHT,
|
||||
ANIM_BIKE_BACK,
|
||||
ANIM_BIKE_FWD,
|
||||
ANIM_BIKE_PUSHES,
|
||||
ANIM_BIKE_JUMPON_R,
|
||||
ANIM_BIKE_JUMPON_L,
|
||||
ANIM_BIKE_LEANB,
|
||||
ANIM_BIKE_LEANF,
|
||||
ANIM_BIKE_WALKBACK,
|
||||
ANIM_BIKE_JUMPON_LHS,
|
||||
ANIM_BIKE_JUMPON_RHS,
|
||||
ANIM_BIKE_KICK,
|
||||
ANIM_BIKE_HIT,
|
||||
ANIM_BIKE_GETOFF_RHS,
|
||||
ANIM_BIKE_GETOFF_LHS,
|
||||
ANIM_BIKE_GETOFF_RHS,
|
||||
ANIM_BIKE_GETOFF_BACK,
|
||||
ANIM_BIKE_DRIVEBY_RHS,
|
||||
ANIM_BIKE_DRIVEBY_LHS,
|
||||
ANIM_BIKE_DRIVEBY_FT,
|
||||
ANIM_BIKE_PASSENGER,
|
||||
ANIM_BIKE_DRIVEBY_RHS,
|
||||
ANIM_BIKE_DRIVEBY_FORWARD,
|
||||
ANIM_BIKE_RIDE_P,
|
||||
|
||||
ANIM_WEAPON_FIRE,
|
||||
ANIM_ATTACK_1,
|
||||
ANIM_ATTACK_2,
|
||||
ANIM_ATTACK_EXTRA1,
|
||||
ANIM_ATTACK_EXTRA2,
|
||||
ANIM_ATTACK_3,
|
||||
|
||||
// our synonyms... because originals are hard to understand
|
||||
ANIM_WEAPON_FIRE = ANIM_ATTACK_1,
|
||||
ANIM_WEAPON_CROUCHFIRE,
|
||||
ANIM_WEAPON_FIRE_2ND = ANIM_WEAPON_CROUCHFIRE,
|
||||
ANIM_WEAPON_RELOAD,
|
||||
ANIM_WEAPON_CROUCHRELOAD,
|
||||
ANIM_WEAPON_SPECIAL,
|
||||
ANIM_MELEE_ATTACK = ANIM_WEAPON_FIRE,
|
||||
ANIM_WEAPON_FIRE_3RD,
|
||||
ANIM_THROWABLE_THROW = ANIM_ATTACK_1,
|
||||
ANIM_THROWABLE_THROWU,
|
||||
ANIM_THROWABLE_START_THROW,
|
||||
ANIM_MELEE_ATTACK = ANIM_ATTACK_1,
|
||||
ANIM_MELEE_ATTACK_2ND,
|
||||
ANIM_MELEE_ATTACK_START,
|
||||
ANIM_MELEE_IDLE_FIGHTMODE,
|
||||
ANIM_MELEE_ATTACK_FINISH,
|
||||
ANIM_THROWABLE_THROW = ANIM_WEAPON_FIRE,
|
||||
ANIM_THROWABLE_THROWU,
|
||||
ANIM_THROWABLE_START_THROW,
|
||||
ANIM_WEAPON_FIRE_2ND = ANIM_WEAPON_CROUCHFIRE,
|
||||
ANIM_WEAPON_FIRE_3RD = ANIM_WEAPON_SPECIAL,
|
||||
|
||||
ANIM_SUNBATHE,
|
||||
ANIM_SUNBATHE_IDLE,
|
||||
ANIM_SUNBATHE_DOWN,
|
||||
ANIM_SUNBATHE_UP,
|
||||
ANIM_SUNBATHE_ESCAPE,
|
||||
|
||||
ANIM_CPR,
|
||||
ANIM_MEDIC_CPR,
|
||||
|
||||
ANIM_IDLE_STRETCH,
|
||||
ANIM_IDLE_TIME,
|
||||
ANIM_IDLE_SHOULDER,
|
||||
ANIM_IDLE_STRETCH_LEG,
|
||||
ANIM_PLAYER_IDLE1,
|
||||
ANIM_PLAYER_IDLE2,
|
||||
ANIM_PLAYER_IDLE3,
|
||||
ANIM_PLAYER_IDLE4,
|
||||
|
||||
ANIM_RIOT_ANGRY,
|
||||
ANIM_RIOT_ANGRY_B,
|
||||
@@ -253,7 +259,7 @@ enum AnimationId
|
||||
ANIM_RIOT_PUNCHES,
|
||||
ANIM_RIOT_SHOUT,
|
||||
ANIM_RIOT_CHALLENGE,
|
||||
ANIM_RIOT_FUKU,
|
||||
ANIM_RIOT_FUCKYOU,
|
||||
|
||||
ANIM_STRIP_A,
|
||||
ANIM_STRIP_B,
|
||||
@@ -264,17 +270,17 @@ enum AnimationId
|
||||
ANIM_STRIP_G,
|
||||
|
||||
|
||||
ANIM_MPNOTE,
|
||||
ANIM_MPNOTE_LOOP,
|
||||
ANIM_MULTIPLAYER_CUTSCENE_MPNOTE,
|
||||
ANIM_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP,
|
||||
|
||||
ANIM_IDLE_LOOK,
|
||||
ANIM_IDLE_NO,
|
||||
ANIM_IDLE_YES,
|
||||
ANIM_IDLE_CHAT2,
|
||||
ANIM_IDLE_COUGH,
|
||||
ANIM_IDLE_GIGGLE_FEMALE,
|
||||
ANIM_IDLE_TOUGH_CHAT,
|
||||
ANIM_IDLE_CELL_TALK,
|
||||
ANIM_CS_MISC_IDLE_LOOK,
|
||||
ANIM_CS_MISC_IDLE_NO,
|
||||
ANIM_CS_MISC_IDLE_YES,
|
||||
ANIM_CS_MISC_IDLE_CHAT2,
|
||||
ANIM_CS_MISC_IDLE_COUGH,
|
||||
ANIM_CS_MISC_IDLE_GIGGLE_FEMALE,
|
||||
ANIM_CS_MISC_IDLE_TOUGH_CHAT,
|
||||
ANIM_CS_MISC_IDLE_CELL_TALK,
|
||||
|
||||
ANIM_DONH2_CAMERA,
|
||||
ANIM_DONH3_HAPPY,
|
||||
@@ -285,7 +291,7 @@ enum AnimationId
|
||||
ANIM_JDT5_CALM_DOWN,
|
||||
ANIM_JDT5_POINT,
|
||||
ANIM_JDT6_PICKUP,
|
||||
ANIM_JDT6_DOORKNOCK,
|
||||
ANIM_JDT6_KNOCK,
|
||||
|
||||
ANIM_MAR1_SKIRT,
|
||||
ANIM_MAR2_CELL_ANSWER,
|
||||
@@ -294,7 +300,7 @@ enum AnimationId
|
||||
ANIM_MAR2_FOOT_TAP,
|
||||
ANIM_MAR3_HOOCHY,
|
||||
ANIM_MAR3_NOTE_IDLE,
|
||||
ANIM_MAR3_NOTE_PICK,
|
||||
ANIM_MAR3_NOTE_PICKUP,
|
||||
|
||||
ANIM_SAL1_BIREFCASE_DOWN,
|
||||
ANIM_SAL2_IDLE_SEATED,
|
||||
@@ -302,8 +308,8 @@ enum AnimationId
|
||||
ANIM_SAL3_SEATED_TALK,
|
||||
ANIM_SAL3_SEATED_IDLE,
|
||||
ANIM_SAL3_SIT_DOWN,
|
||||
ANIM_SAL4_DUSTDOWN,
|
||||
ANIM_SAL4_GIRLRUN,
|
||||
ANIM_SAL4_DUST_DOWN,
|
||||
ANIM_SAL4_GIRL_RUN,
|
||||
ANIM_SAL6_ANGRY_SEATED,
|
||||
ANIM_SAL6_IDLE_SEATED,
|
||||
ANIM_SAL7_LOOKOUT,
|
||||
@@ -322,7 +328,5 @@ enum AnimationId
|
||||
|
||||
ANIM_MAC2_PLEAD,
|
||||
|
||||
ANIM_VIC7_PROD_WITH_FOOT,
|
||||
|
||||
NUM_ANIMS
|
||||
ANIM_VIC7_PROD_WITH_FOOT
|
||||
};
|
||||
@@ -158,7 +158,7 @@ cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollisio
|
||||
void
|
||||
cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter)
|
||||
{
|
||||
bool distCalculated = false;
|
||||
bool8 distCalculated = FALSE;
|
||||
if(col.m_fIntensity2 > 0.0016f) {
|
||||
uint8 emittingVol = SetLoopingCollisionRequestedSfxFreqAndGetVol(col);
|
||||
if(emittingVol) {
|
||||
@@ -168,20 +168,17 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
|
||||
m_sQueueSample.m_nCounter = counter;
|
||||
m_sQueueSample.m_vecPos = col.m_vecPosition;
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
m_sQueueSample.m_bIs2D = false;
|
||||
m_sQueueSample.m_bIs2D = FALSE;
|
||||
m_sQueueSample.m_nReleasingVolumeModificator = 7;
|
||||
m_sQueueSample.m_nLoopCount = 0;
|
||||
m_sQueueSample.m_nEmittingVolume = emittingVol;
|
||||
m_sQueueSample.m_nLoopStart =
|
||||
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||
m_sQueueSample.m_nLoopEnd =
|
||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
|
||||
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = false;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
|
||||
m_sQueueSample.m_nReleasingVolumeDivider = 5;
|
||||
m_sQueueSample.m_bReverbFlag = true;
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
m_sQueueSample.m_bReverbFlag = TRUE;
|
||||
m_sQueueSample.m_bRequireReflection = FALSE;
|
||||
AddSampleToRequestedQueue();
|
||||
}
|
||||
}
|
||||
@@ -311,17 +308,16 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
|
||||
if(counter >= 255) counter = 28;
|
||||
m_sQueueSample.m_vecPos = col.m_vecPosition;
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
m_sQueueSample.m_bIs2D = false;
|
||||
m_sQueueSample.m_bIs2D = FALSE;
|
||||
m_sQueueSample.m_nReleasingVolumeModificator = 11;
|
||||
m_sQueueSample.m_nLoopCount = 1;
|
||||
m_sQueueSample.m_nEmittingVolume = emittingVol;
|
||||
m_sQueueSample.m_nLoopStart = 0;
|
||||
m_sQueueSample.m_nLoopEnd = -1;
|
||||
RESET_LOOP_OFFSETS
|
||||
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = true;
|
||||
m_sQueueSample.m_bReverbFlag = true;
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
|
||||
m_sQueueSample.m_bReverbFlag = TRUE;
|
||||
m_sQueueSample.m_bRequireReflection = FALSE;
|
||||
AddSampleToRequestedQueue();
|
||||
}
|
||||
}
|
||||
@@ -332,13 +328,12 @@ void
|
||||
cAudioManager::ServiceCollisions()
|
||||
{
|
||||
int i, j;
|
||||
bool abRepeatedCollision1[NUMAUDIOCOLLISIONS];
|
||||
bool abRepeatedCollision2[NUMAUDIOCOLLISIONS];
|
||||
bool8 abRepeatedCollision1[NUMAUDIOCOLLISIONS];
|
||||
bool8 abRepeatedCollision2[NUMAUDIOCOLLISIONS];
|
||||
|
||||
m_sQueueSample.m_nEntityIndex = m_nCollisionEntity;
|
||||
|
||||
for (int i = 0; i < NUMAUDIOCOLLISIONS; i++)
|
||||
abRepeatedCollision1[i] = abRepeatedCollision2[i] = false;
|
||||
for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) abRepeatedCollision1[i] = abRepeatedCollision2[i] = FALSE;
|
||||
|
||||
for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) {
|
||||
for (j = 0; j < NUMAUDIOCOLLISIONS; j++) {
|
||||
@@ -348,8 +343,8 @@ cAudioManager::ServiceCollisions()
|
||||
&& (m_sCollisionManager.m_asCollisions1[index].m_bSurface1 == m_sCollisionManager.m_asCollisions2[j].m_bSurface1)
|
||||
&& (m_sCollisionManager.m_asCollisions1[index].m_bSurface2 == m_sCollisionManager.m_asCollisions2[j].m_bSurface2)
|
||||
) {
|
||||
abRepeatedCollision1[index] = true;
|
||||
abRepeatedCollision2[j] = true;
|
||||
abRepeatedCollision1[index] = TRUE;
|
||||
abRepeatedCollision2[j] = TRUE;
|
||||
m_sCollisionManager.m_asCollisions1[index].m_nBaseVolume = ++m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume;
|
||||
SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j);
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,21 +14,17 @@
|
||||
|
||||
cAudioManager AudioManager;
|
||||
|
||||
const int channels = ARRAY_SIZE(AudioManager.m_asActiveSamples);
|
||||
const int policeChannel = channels + 1;
|
||||
const int allChannels = channels + 2;
|
||||
|
||||
#define SPEED_OF_SOUND 343.f
|
||||
#define TIME_SPENT 40
|
||||
|
||||
cAudioManager::cAudioManager()
|
||||
{
|
||||
m_bIsInitialised = false;
|
||||
m_bReverb = true;
|
||||
m_bIsInitialised = FALSE;
|
||||
m_bReverb = TRUE;
|
||||
field_6 = 0;
|
||||
m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT;
|
||||
m_nTimeSpent = TIME_SPENT;
|
||||
m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS;
|
||||
m_nActiveSamples = NUM_CHANNELS_GENERIC;
|
||||
m_nActiveSampleQueue = 1;
|
||||
ClearRequestedQueue();
|
||||
m_nActiveSampleQueue = 0;
|
||||
@@ -36,16 +32,16 @@ cAudioManager::cAudioManager()
|
||||
ClearActiveSamples();
|
||||
GenerateIntegerRandomNumberTable();
|
||||
field_4 = 0;
|
||||
m_bDynamicAcousticModelingStatus = true;
|
||||
m_bDynamicAcousticModelingStatus = TRUE;
|
||||
|
||||
for (int i = 0; i < NUM_AUDIOENTITIES; i++) {
|
||||
m_asAudioEntities[i].m_bIsUsed = false;
|
||||
m_asAudioEntities[i].m_bIsUsed = FALSE;
|
||||
m_anAudioEntityIndices[i] = NUM_AUDIOENTITIES;
|
||||
}
|
||||
m_nAudioEntitiesTotal = 0;
|
||||
m_FrameCounter = 0;
|
||||
m_bFifthFrameFlag = false;
|
||||
m_bTimerJustReset = false;
|
||||
m_bFifthFrameFlag = FALSE;
|
||||
m_bTimerJustReset = FALSE;
|
||||
m_nTimer = 0;
|
||||
}
|
||||
|
||||
@@ -83,7 +79,7 @@ cAudioManager::Terminate()
|
||||
MusicManager.Terminate();
|
||||
|
||||
for (uint32 i = 0; i < NUM_AUDIOENTITIES; i++) {
|
||||
m_asAudioEntities[i].m_bIsUsed = false;
|
||||
m_asAudioEntities[i].m_bIsUsed = FALSE;
|
||||
m_anAudioEntityIndices[i] = ARRAY_SIZE(m_anAudioEntityIndices);
|
||||
}
|
||||
|
||||
@@ -98,7 +94,7 @@ cAudioManager::Terminate()
|
||||
|
||||
SampleManager.Terminate();
|
||||
|
||||
m_bIsInitialised = false;
|
||||
m_bIsInitialised = FALSE;
|
||||
PostTerminateGameSpecificShutdown();
|
||||
}
|
||||
}
|
||||
@@ -110,7 +106,7 @@ cAudioManager::Service()
|
||||
if (m_bTimerJustReset) {
|
||||
ResetAudioLogicTimers(m_nTimer);
|
||||
MusicManager.ResetTimers(m_nTimer);
|
||||
m_bTimerJustReset = false;
|
||||
m_bTimerJustReset = FALSE;
|
||||
}
|
||||
if (m_bIsInitialised) {
|
||||
m_nPreviousUserPause = m_nUserPause;
|
||||
@@ -132,8 +128,8 @@ cAudioManager::CreateEntity(eAudioType type, void *entity)
|
||||
return AEHANDLE_ERROR_BADAUDIOTYPE;
|
||||
for (uint32 i = 0; i < ARRAY_SIZE(m_asAudioEntities); i++) {
|
||||
if (!m_asAudioEntities[i].m_bIsUsed) {
|
||||
m_asAudioEntities[i].m_bIsUsed = true;
|
||||
m_asAudioEntities[i].m_bStatus = false;
|
||||
m_asAudioEntities[i].m_bIsUsed = TRUE;
|
||||
m_asAudioEntities[i].m_bStatus = FALSE;
|
||||
m_asAudioEntities[i].m_nType = type;
|
||||
m_asAudioEntities[i].m_pEntity = entity;
|
||||
m_asAudioEntities[i].m_awAudioEvent[0] = SOUND_NO_SOUND;
|
||||
@@ -152,7 +148,7 @@ void
|
||||
cAudioManager::DestroyEntity(int32 id)
|
||||
{
|
||||
if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed) {
|
||||
m_asAudioEntities[id].m_bIsUsed = false;
|
||||
m_asAudioEntities[id].m_bIsUsed = FALSE;
|
||||
for (int32 i = 0; i < m_nAudioEntitiesTotal; ++i) {
|
||||
if (id == m_anAudioEntityIndices[i]) {
|
||||
if (i < NUM_AUDIOENTITIES - 1)
|
||||
@@ -165,7 +161,7 @@ cAudioManager::DestroyEntity(int32 id)
|
||||
}
|
||||
|
||||
void
|
||||
cAudioManager::SetEntityStatus(int32 id, uint8 status)
|
||||
cAudioManager::SetEntityStatus(int32 id, bool8 status)
|
||||
{
|
||||
if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed)
|
||||
m_asAudioEntities[id].m_bStatus = status;
|
||||
@@ -193,7 +189,7 @@ cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol)
|
||||
}
|
||||
} else {
|
||||
int32 i = 0;
|
||||
while (true) {
|
||||
while (TRUE) {
|
||||
if (i >= entity.m_AudioEvents) {
|
||||
if (entity.m_AudioEvents < ARRAY_SIZE(entity.m_awAudioEvent)) {
|
||||
entity.m_awAudioEvent[i] = sound;
|
||||
@@ -246,7 +242,7 @@ cAudioManager::SetEffectsFadeVol(uint8 volume) const
|
||||
}
|
||||
|
||||
void
|
||||
cAudioManager::SetMonoMode(uint8 mono)
|
||||
cAudioManager::SetMonoMode(bool8 mono)
|
||||
{
|
||||
SampleManager.SetMonoMode(mono);
|
||||
}
|
||||
@@ -261,7 +257,7 @@ void
|
||||
cAudioManager::ResetTimers(uint32 time)
|
||||
{
|
||||
if (m_bIsInitialised) {
|
||||
m_bTimerJustReset = true;
|
||||
m_bTimerJustReset = TRUE;
|
||||
m_nTimer = time;
|
||||
ClearRequestedQueue();
|
||||
if (m_nActiveSampleQueue) {
|
||||
@@ -276,11 +272,13 @@ cAudioManager::ResetTimers(uint32 time)
|
||||
ClearActiveSamples();
|
||||
ClearMissionAudio(0);
|
||||
ClearMissionAudio(1);
|
||||
SampleManager.StopChannel(policeChannel);
|
||||
SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||
SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_1);
|
||||
SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_2);
|
||||
SampleManager.SetEffectsFadeVolume(0);
|
||||
SampleManager.SetMusicFadeVolume(0);
|
||||
MusicManager.ResetMusicAfterReload();
|
||||
m_bIsPlayerShutUp = false;
|
||||
m_bIsPlayerShutUp = FALSE;
|
||||
#ifdef AUDIO_OAL
|
||||
SampleManager.Service();
|
||||
#endif
|
||||
@@ -391,13 +389,13 @@ cAudioManager::SetSpeakerConfig(int32 conf) const
|
||||
SampleManager.SetSpeakerConfig(conf);
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cAudioManager::IsMP3RadioChannelAvailable() const
|
||||
{
|
||||
if (m_bIsInitialised)
|
||||
return SampleManager.IsMP3RadioChannelAvailable();
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -417,25 +415,25 @@ cAudioManager::ReacquireDigitalHandle() const
|
||||
}
|
||||
|
||||
void
|
||||
cAudioManager::SetDynamicAcousticModelingStatus(uint8 status)
|
||||
cAudioManager::SetDynamicAcousticModelingStatus(bool8 status)
|
||||
{
|
||||
m_bDynamicAcousticModelingStatus = status!=0;
|
||||
m_bDynamicAcousticModelingStatus = status;
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cAudioManager::CheckForAnAudioFileOnCD() const
|
||||
{
|
||||
return SampleManager.CheckForAnAudioFileOnCD();
|
||||
}
|
||||
|
||||
uint8
|
||||
char
|
||||
cAudioManager::GetCDAudioDriveLetter() const
|
||||
{
|
||||
if(m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter();
|
||||
return 0;
|
||||
return '\0';
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cAudioManager::IsAudioInitialised() const
|
||||
{
|
||||
return m_bIsInitialised;
|
||||
@@ -444,9 +442,12 @@ cAudioManager::IsAudioInitialised() const
|
||||
void
|
||||
cAudioManager::ServiceSoundEffects()
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if(CTimer::GetLogicalFramesPassed() != 0)
|
||||
#endif
|
||||
m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0;
|
||||
if (m_nUserPause && !m_nPreviousUserPause) {
|
||||
for (int32 i = 0; i < allChannels; i++)
|
||||
for (int32 i = 0; i < NUM_CHANNELS; i++)
|
||||
SampleManager.StopChannel(i);
|
||||
|
||||
ClearRequestedQueue();
|
||||
@@ -545,7 +546,7 @@ cAudioManager::RandomDisplacement(uint32 seed) const
|
||||
{
|
||||
int32 value;
|
||||
|
||||
static bool bPos = true;
|
||||
static bool8 bPos = TRUE;
|
||||
static uint32 Adjustment = 0;
|
||||
|
||||
if (!seed)
|
||||
@@ -576,7 +577,7 @@ cAudioManager::AddSampleToRequestedQueue()
|
||||
{
|
||||
int32 calculatedVolume;
|
||||
uint8 sampleIndex;
|
||||
bool bReflections;
|
||||
bool8 bReflections;
|
||||
|
||||
if (m_sQueueSample.m_nSampleIndex < TOTAL_AUDIO_SAMPLES) {
|
||||
calculatedVolume = m_sQueueSample.m_nReleasingVolumeModificator * (MAX_VOLUME - m_sQueueSample.m_nVolume);
|
||||
@@ -589,24 +590,24 @@ cAudioManager::AddSampleToRequestedQueue()
|
||||
++m_SampleRequestQueuesStatus[m_nActiveSampleQueue];
|
||||
}
|
||||
m_sQueueSample.m_nCalculatedVolume = calculatedVolume;
|
||||
m_sQueueSample.m_bLoopEnded = false;
|
||||
m_sQueueSample.m_bLoopEnded = FALSE;
|
||||
if (m_sQueueSample.m_bIs2D || CCullZones::InRoomForAudio()) {
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
m_sQueueSample.m_bRequireReflection = FALSE;
|
||||
m_sQueueSample.m_nLoopsRemaining = 0;
|
||||
}
|
||||
if (m_bDynamicAcousticModelingStatus && m_sQueueSample.m_nLoopCount) {
|
||||
bReflections = m_sQueueSample.m_bRequireReflection;
|
||||
} else {
|
||||
bReflections = false;
|
||||
bReflections = FALSE;
|
||||
m_sQueueSample.m_nLoopsRemaining = 0;
|
||||
}
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
m_sQueueSample.m_bRequireReflection = FALSE;
|
||||
|
||||
if ( m_bReverb && m_sQueueSample.m_bIs2D )
|
||||
m_sQueueSample.field_4C = 30;
|
||||
|
||||
if (!m_bDynamicAcousticModelingStatus)
|
||||
m_sQueueSample.m_bReverbFlag = false;
|
||||
m_sQueueSample.m_bReverbFlag = FALSE;
|
||||
|
||||
m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample;
|
||||
|
||||
@@ -773,7 +774,12 @@ cAudioManager::UpdateReflections()
|
||||
void
|
||||
cAudioManager::AddReleasingSounds()
|
||||
{
|
||||
bool toProcess[44]; // why not 27?
|
||||
// in case someone would want to increase it
|
||||
#ifdef FIX_BUGS
|
||||
bool8 toProcess[NUM_CHANNELS_GENERIC];
|
||||
#else
|
||||
bool8 toProcess[44];
|
||||
#endif
|
||||
|
||||
int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0;
|
||||
|
||||
@@ -782,19 +788,19 @@ cAudioManager::AddReleasingSounds()
|
||||
if (sample.m_bLoopEnded)
|
||||
continue;
|
||||
|
||||
toProcess[i] = false;
|
||||
toProcess[i] = FALSE;
|
||||
for (int32 j = 0; j < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; j++) {
|
||||
if (sample.m_nEntityIndex == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nEntityIndex &&
|
||||
sample.m_nCounter == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nCounter) {
|
||||
toProcess[i] = true;
|
||||
toProcess[i] = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!toProcess[i]) {
|
||||
if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) {
|
||||
if (!sample.m_nReleasingVolumeDivider)
|
||||
if (sample.m_nReleasingVolumeDivider == 0)
|
||||
continue;
|
||||
if (!sample.m_nLoopCount) {
|
||||
if (sample.m_nLoopCount == 0) {
|
||||
if (sample.m_nVolumeChange == -1) {
|
||||
sample.m_nVolumeChange = sample.m_nVolume / sample.m_nReleasingVolumeDivider;
|
||||
if (sample.m_nVolumeChange <= 0)
|
||||
@@ -806,12 +812,15 @@ cAudioManager::AddReleasingSounds()
|
||||
}
|
||||
sample.m_nVolume -= sample.m_nVolumeChange;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
if(CTimer::GetLogicalFramesPassed() != 0)
|
||||
#endif
|
||||
--sample.m_nReleasingVolumeDivider;
|
||||
if (m_bFifthFrameFlag) {
|
||||
if (sample.m_nReleasingVolumeModificator < 20)
|
||||
++sample.m_nReleasingVolumeModificator;
|
||||
}
|
||||
sample.m_bReleasingSoundFlag = false;
|
||||
sample.m_bReleasingSoundFlag = FALSE;
|
||||
}
|
||||
memcpy(&m_sQueueSample, &sample, sizeof(tSound));
|
||||
AddSampleToRequestedQueue();
|
||||
@@ -829,12 +838,12 @@ cAudioManager::ProcessActiveQueues()
|
||||
uint8 vol;
|
||||
uint8 offset;
|
||||
float x;
|
||||
bool flag;
|
||||
bool missionState;
|
||||
bool8 flag;
|
||||
bool8 missionState;
|
||||
|
||||
for (int32 i = 0; i < m_nActiveSamples; i++) {
|
||||
m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = false;
|
||||
m_asActiveSamples[i].m_bIsProcessed = false;
|
||||
m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = FALSE;
|
||||
m_asActiveSamples[i].m_bIsProcessed = FALSE;
|
||||
}
|
||||
for (int32 i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; i++) {
|
||||
tSound& sample = m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]];
|
||||
@@ -847,19 +856,19 @@ cAudioManager::ProcessActiveQueues()
|
||||
|
||||
if (m_FrameCounter & 1) {
|
||||
if (!(j & 1)) {
|
||||
flag = false;
|
||||
flag = FALSE;
|
||||
} else {
|
||||
flag = true;
|
||||
flag = TRUE;
|
||||
}
|
||||
} else if (j & 1) {
|
||||
flag = false;
|
||||
flag = FALSE;
|
||||
} else {
|
||||
flag = true;
|
||||
flag = TRUE;
|
||||
}
|
||||
|
||||
if (flag && !SampleManager.GetChannelUsedFlag(j)) {
|
||||
sample.m_bLoopEnded = true;
|
||||
m_asActiveSamples[j].m_bLoopEnded = true;
|
||||
sample.m_bLoopEnded = TRUE;
|
||||
m_asActiveSamples[j].m_bLoopEnded = TRUE;
|
||||
m_asActiveSamples[j].m_nSampleIndex = NO_SAMPLE;
|
||||
m_asActiveSamples[j].m_nEntityIndex = AEHANDLE_NONE;
|
||||
continue;
|
||||
@@ -867,8 +876,8 @@ cAudioManager::ProcessActiveQueues()
|
||||
if (!sample.m_nReleasingVolumeDivider)
|
||||
sample.m_nReleasingVolumeDivider = 1;
|
||||
}
|
||||
sample.m_bIsProcessed = true;
|
||||
m_asActiveSamples[j].m_bIsProcessed = true;
|
||||
sample.m_bIsProcessed = TRUE;
|
||||
m_asActiveSamples[j].m_bIsProcessed = TRUE;
|
||||
sample.m_nVolumeChange = -1;
|
||||
if (!sample.m_bReleasingSoundFlag) {
|
||||
if (sample.m_bIs2D) {
|
||||
@@ -900,10 +909,10 @@ cAudioManager::ProcessActiveQueues()
|
||||
emittingVol = vol;
|
||||
}
|
||||
|
||||
missionState = false;
|
||||
missionState = FALSE;
|
||||
for (int32 k = 0; k < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); k++) {
|
||||
if (m_sMissionAudio.m_bIsMobile[k]) {
|
||||
missionState = true;
|
||||
missionState = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -924,8 +933,8 @@ cAudioManager::ProcessActiveQueues()
|
||||
SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag);
|
||||
break; //continue for i
|
||||
}
|
||||
sample.m_bIsProcessed = false;
|
||||
m_asActiveSamples[j].m_bIsProcessed = false;
|
||||
sample.m_bIsProcessed = FALSE;
|
||||
m_asActiveSamples[j].m_bIsProcessed = FALSE;
|
||||
//continue for j
|
||||
}
|
||||
}
|
||||
@@ -966,10 +975,10 @@ cAudioManager::ProcessActiveQueues()
|
||||
}
|
||||
if (SampleManager.InitialiseChannel(k, m_asActiveSamples[k].m_nSampleIndex, m_asActiveSamples[k].m_nBankIndex)) {
|
||||
SampleManager.SetChannelFrequency(k, m_asActiveSamples[k].m_nFrequency);
|
||||
bool isMobile = false;
|
||||
bool8 isMobile = FALSE;
|
||||
for (int32 l = 0; l < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); l++) {
|
||||
if (m_sMissionAudio.m_bIsMobile[l]) {
|
||||
isMobile = true;
|
||||
isMobile = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1000,8 +1009,8 @@ cAudioManager::ProcessActiveQueues()
|
||||
SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_fSoundIntensity, 0.25f * m_asActiveSamples[k].m_fSoundIntensity);
|
||||
SampleManager.StartChannel(k);
|
||||
}
|
||||
m_asActiveSamples[k].m_bIsProcessed = true;
|
||||
sample.m_bIsProcessed = true;
|
||||
m_asActiveSamples[k].m_bIsProcessed = TRUE;
|
||||
sample.m_bIsProcessed = TRUE;
|
||||
sample.m_nVolumeChange = -1;
|
||||
break;
|
||||
}
|
||||
@@ -1029,28 +1038,30 @@ cAudioManager::ClearActiveSamples()
|
||||
m_asActiveSamples[i].m_nCounter = 0;
|
||||
m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE;
|
||||
m_asActiveSamples[i].m_nBankIndex = INVALID_SFX_BANK;
|
||||
m_asActiveSamples[i].m_bIs2D = false;
|
||||
m_asActiveSamples[i].m_bIs2D = FALSE;
|
||||
m_asActiveSamples[i].m_nReleasingVolumeModificator = 5;
|
||||
m_asActiveSamples[i].m_nFrequency = 0;
|
||||
m_asActiveSamples[i].m_nVolume = 0;
|
||||
m_asActiveSamples[i].m_nEmittingVolume = 0;
|
||||
m_asActiveSamples[i].m_fDistance = 0.0f;
|
||||
m_asActiveSamples[i].m_bIsProcessed = false;
|
||||
m_asActiveSamples[i].m_bLoopEnded = false;
|
||||
m_asActiveSamples[i].m_bIsProcessed = FALSE;
|
||||
m_asActiveSamples[i].m_bLoopEnded = FALSE;
|
||||
m_asActiveSamples[i].m_nLoopCount = 1;
|
||||
#ifndef GTA_PS2
|
||||
m_asActiveSamples[i].m_nLoopStart = 0;
|
||||
m_asActiveSamples[i].m_nLoopEnd = -1;
|
||||
#endif
|
||||
m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f;
|
||||
m_asActiveSamples[i].m_fSoundIntensity = 200.0f;
|
||||
m_asActiveSamples[i].m_nOffset = 63;
|
||||
m_asActiveSamples[i].m_bReleasingSoundFlag = false;
|
||||
m_asActiveSamples[i].m_bReleasingSoundFlag = FALSE;
|
||||
m_asActiveSamples[i].m_nCalculatedVolume = 0;
|
||||
m_asActiveSamples[i].m_nReleasingVolumeDivider = 0;
|
||||
m_asActiveSamples[i].m_nVolumeChange = -1;
|
||||
m_asActiveSamples[i].m_vecPos = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_asActiveSamples[i].m_bReverbFlag = false;
|
||||
m_asActiveSamples[i].m_bReverbFlag = FALSE;
|
||||
m_asActiveSamples[i].m_nLoopsRemaining = 0;
|
||||
m_asActiveSamples[i].m_bRequireReflection = false;
|
||||
m_asActiveSamples[i].m_bRequireReflection = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "audio_enums.h"
|
||||
#include "AudioCollision.h"
|
||||
#include "PoliceRadio.h"
|
||||
#include "PolRadio.h"
|
||||
#include "VehicleModelInfo.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
@@ -13,27 +13,29 @@ public:
|
||||
int32 m_nCounter;
|
||||
int32 m_nSampleIndex;
|
||||
uint8 m_nBankIndex;
|
||||
bool m_bIs2D;
|
||||
bool8 m_bIs2D;
|
||||
int32 m_nReleasingVolumeModificator;
|
||||
uint32 m_nFrequency;
|
||||
uint8 m_nVolume;
|
||||
float m_fDistance;
|
||||
int32 m_nLoopCount;
|
||||
#ifndef GTA_PS2
|
||||
int32 m_nLoopStart;
|
||||
int32 m_nLoopEnd;
|
||||
#endif
|
||||
uint8 m_nEmittingVolume;
|
||||
float m_fSpeedMultiplier;
|
||||
float m_fSoundIntensity;
|
||||
bool m_bReleasingSoundFlag;
|
||||
bool8 m_bReleasingSoundFlag;
|
||||
CVector m_vecPos;
|
||||
bool m_bReverbFlag;
|
||||
bool8 m_bReverbFlag;
|
||||
uint8 m_nLoopsRemaining;
|
||||
bool m_bRequireReflection; // Used for oneshots
|
||||
bool8 m_bRequireReflection; // Used for oneshots
|
||||
uint8 m_nOffset;
|
||||
uint8 field_4C;
|
||||
int32 m_nReleasingVolumeDivider;
|
||||
bool m_bIsProcessed;
|
||||
bool m_bLoopEnded;
|
||||
bool8 m_bIsProcessed;
|
||||
bool8 m_bLoopEnded;
|
||||
int32 m_nCalculatedVolume;
|
||||
int8 m_nVolumeChange;
|
||||
};
|
||||
@@ -48,7 +50,7 @@ class tAudioEntity
|
||||
public:
|
||||
eAudioType m_nType;
|
||||
void *m_pEntity;
|
||||
bool m_bIsUsed;
|
||||
bool8 m_bIsUsed;
|
||||
uint8 m_bStatus;
|
||||
int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS];
|
||||
float m_afVolume[NUM_AUDIOENTITY_EVENTS];
|
||||
@@ -78,7 +80,7 @@ public:
|
||||
uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS];
|
||||
uint8 m_nActiveBank;
|
||||
#ifdef GTA_PC
|
||||
bool m_bDelay;
|
||||
bool8 m_bDelay;
|
||||
uint32 m_nDelayTimer;
|
||||
#endif
|
||||
|
||||
@@ -110,14 +112,14 @@ class cMissionAudio
|
||||
{
|
||||
public:
|
||||
CVector m_vecPos[MISSION_AUDIO_SLOTS];
|
||||
bool m_bPredefinedProperties[MISSION_AUDIO_SLOTS];
|
||||
bool8 m_bPredefinedProperties[MISSION_AUDIO_SLOTS];
|
||||
int32 m_nSampleIndex[MISSION_AUDIO_SLOTS];
|
||||
uint8 m_nLoadingStatus[MISSION_AUDIO_SLOTS];
|
||||
uint8 m_nPlayStatus[MISSION_AUDIO_SLOTS];
|
||||
bool m_bIsPlaying[MISSION_AUDIO_SLOTS];
|
||||
bool8 m_bIsPlaying[MISSION_AUDIO_SLOTS];
|
||||
int32 m_nMissionAudioCounter[MISSION_AUDIO_SLOTS];
|
||||
bool m_bIsPlayed[MISSION_AUDIO_SLOTS];
|
||||
bool m_bIsMobile[MISSION_AUDIO_SLOTS];
|
||||
bool8 m_bIsPlayed[MISSION_AUDIO_SLOTS];
|
||||
bool8 m_bIsMobile[MISSION_AUDIO_SLOTS];
|
||||
};
|
||||
VALIDATE_SIZE(cMissionAudio, 0x38);
|
||||
|
||||
@@ -141,7 +143,7 @@ class CPed;
|
||||
class cPedParams
|
||||
{
|
||||
public:
|
||||
bool m_bDistanceCalculated;
|
||||
bool8 m_bDistanceCalculated;
|
||||
float m_fDistance;
|
||||
CPed *m_pPed;
|
||||
|
||||
@@ -157,7 +159,7 @@ class cVehicleParams
|
||||
{
|
||||
public:
|
||||
int32 m_VehicleType;
|
||||
bool m_bDistanceCalculated;
|
||||
bool8 m_bDistanceCalculated;
|
||||
float m_fDistance;
|
||||
CVehicle *m_pVehicle;
|
||||
cTransmission *m_pTransmission;
|
||||
@@ -193,22 +195,22 @@ enum {
|
||||
class cAudioManager
|
||||
{
|
||||
public:
|
||||
bool m_bIsInitialised;
|
||||
bool8 m_bIsInitialised;
|
||||
uint8 m_bReverb; // unused
|
||||
bool m_bFifthFrameFlag;
|
||||
bool8 m_bFifthFrameFlag;
|
||||
uint8 m_nActiveSamples;
|
||||
uint8 field_4; // unused
|
||||
bool m_bDynamicAcousticModelingStatus;
|
||||
bool8 m_bDynamicAcousticModelingStatus;
|
||||
int8 field_6;
|
||||
float m_fSpeedOfSound;
|
||||
bool m_bTimerJustReset;
|
||||
bool8 m_bTimerJustReset;
|
||||
int32 m_nTimer;
|
||||
tSound m_sQueueSample;
|
||||
uint8 m_nActiveSampleQueue;
|
||||
tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
|
||||
uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
|
||||
tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_CHANNELS_GENERIC];
|
||||
uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_CHANNELS_GENERIC];
|
||||
uint8 m_SampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS];
|
||||
tSound m_asActiveSamples[NUM_SOUNDS_SAMPLES_SLOTS];
|
||||
tSound m_asActiveSamples[NUM_CHANNELS_GENERIC];
|
||||
tAudioEntity m_asAudioEntities[NUM_AUDIOENTITIES];
|
||||
int32 m_anAudioEntityIndices[NUM_AUDIOENTITIES];
|
||||
int32 m_nAudioEntitiesTotal;
|
||||
@@ -217,11 +219,11 @@ public:
|
||||
cAudioScriptObjectManager m_sAudioScriptObjectManager;
|
||||
|
||||
// miami
|
||||
uint8 m_bIsPlayerShutUp;
|
||||
bool8 m_bIsPlayerShutUp;
|
||||
uint8 m_nPlayerMood;
|
||||
uint32 m_nPlayerMoodTimer;
|
||||
uint8 field_rest[4];
|
||||
bool m_bGenericSfx;
|
||||
bool8 m_bGenericSfx;
|
||||
|
||||
cPedComments m_sPedComments;
|
||||
int32 m_nFireAudioEntity;
|
||||
@@ -253,19 +255,19 @@ public:
|
||||
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } // done
|
||||
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
|
||||
int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; }
|
||||
bool IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; }
|
||||
bool ShouldDuckMissionAudio(uint8 slot) const;
|
||||
bool8 IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; }
|
||||
bool8 ShouldDuckMissionAudio(uint8 slot) const;
|
||||
|
||||
// "Should" be in alphabetic order, except "getXTalkSfx"
|
||||
void AddDetailsToRequestedOrderList(uint8 sample); // done (inlined in vc)
|
||||
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool notLooping); // done
|
||||
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping); // done
|
||||
void AddReflectionsToRequestedQueue(); // done
|
||||
void AddReleasingSounds(); // done
|
||||
void AddSampleToRequestedQueue(); // done
|
||||
void AgeCrimes(); // done (inlined in vc)
|
||||
|
||||
void CalculateDistance(bool &condition, float dist); // done
|
||||
bool CheckForAnAudioFileOnCD() const; // done
|
||||
void CalculateDistance(bool8 &condition, float dist); // done
|
||||
bool8 CheckForAnAudioFileOnCD() const; // done
|
||||
void ClearActiveSamples(); // done
|
||||
void ClearMissionAudio(uint8 slot); // done (inlined in vc)
|
||||
void ClearRequestedQueue(); // done (inlined in vc)
|
||||
@@ -288,90 +290,93 @@ public:
|
||||
uint32 GetMedicTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetFiremanTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetDefaultTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFOSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMYSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMOSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYRITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFORITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMYRITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMORITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFOBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMYBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMOBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYBUTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYMDTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYCGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFYPRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHFOTRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMOTRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMYAPTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHMOCATalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMODKTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYCRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFYSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFOSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMOSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFYRITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFORITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYRITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFYBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFOBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMOBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYBUTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFYPRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBFOTRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMOTRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYPITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBMYBBTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYCRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFOSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMOSTTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYRITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFORITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYRITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMORITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFOBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMOBETalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYCWTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYGOTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFOGOTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMOGOTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYLGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYLGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYBUTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYBUTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMOBUTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYPRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFOTRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMOTRTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYPITalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMOCATalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYJGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYJGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYSKTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWMYSKTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYSHTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFOSHTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetJFOTOTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetJMOTOTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetCBTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetHNTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetSGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetCLTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetGDTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetBKTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetPGTalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetVICETalkSfx(CPed *ped, int16 sound, int16 model);
|
||||
uint32 GetWFYG1TalkSfx(CPed *ped, int16 sound);
|
||||
uint32 GetWFYG2TalkSfx(CPed *ped, int16 sound);
|
||||
|
||||
// LCS: Do not delete, some of these are still used
|
||||
|
||||
//uint32 GetHFYSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFOSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMYSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMOSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFYRITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFORITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMYRITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMORITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFYBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFOBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMYBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMOBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFYBUTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFYMDTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFYCGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFYPRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHFOTRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMOTRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMYAPTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHMOCATalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMODKTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYCRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFYSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFOSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMOSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFYRITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFORITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYRITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFYBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFOBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMOBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYBUTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFYPRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBFOTRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMOTRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYPITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBMYBBTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYCRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFOSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMOSTTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYRITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFORITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYRITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMORITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFOBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMOBETalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYCWTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYGOTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFOGOTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMOGOTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYLGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYLGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYBUTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYBUTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMOBUTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYPRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFOTRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMOTRTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYPITalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMOCATalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYJGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYJGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYSKTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWMYSKTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYSHTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFOSHTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetJFOTOTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetJMOTOTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetCBTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetHNTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetSGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetCLTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetGDTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetBKTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetPGTalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetVICETalkSfx(CPed *ped, int16 sound, int16 model);
|
||||
//uint32 GetWFYG1TalkSfx(CPed *ped, int16 sound);
|
||||
//uint32 GetWFYG2TalkSfx(CPed *ped, int16 sound);
|
||||
|
||||
uint32 GetGenericMaleTalkSfx(CPed *ped, int16 sound); // todo names (inlined in vc)
|
||||
uint32 GetGenericFemaleTalkSfx(CPed *ped, int16 sound); // todo names (inlined in vc)
|
||||
@@ -379,7 +384,7 @@ public:
|
||||
|
||||
void GenerateIntegerRandomNumberTable(); // done
|
||||
char *Get3DProviderName(uint8 id) const; // done
|
||||
uint8 GetCDAudioDriveLetter() const; // done
|
||||
char GetCDAudioDriveLetter() const; // done
|
||||
int8 GetCurrent3DProviderIndex() const; // done
|
||||
int8 AutoDetect3DProviders() const; // done
|
||||
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used
|
||||
@@ -396,17 +401,17 @@ public:
|
||||
float velocityChange); // done
|
||||
float GetVehicleNonDriveWheelSkidValue(CVehicle *veh, tWheelState wheelState, cTransmission *transmission, float velocityChange); // done
|
||||
|
||||
bool HasAirBrakes(int32 model) const; // done
|
||||
bool8 HasAirBrakes(int32 model) const; // done
|
||||
|
||||
void Initialise(); // done
|
||||
void InitialisePoliceRadio(); // done
|
||||
void InitialisePoliceRadioZones(); // done
|
||||
void InterrogateAudioEntities(); // done (inlined)
|
||||
bool IsAudioInitialised() const; // done
|
||||
bool IsMissionAudioSampleFinished(uint8 slot); // done
|
||||
bool IsMP3RadioChannelAvailable() const; // done
|
||||
bool8 IsAudioInitialised() const; // done
|
||||
bool8 IsMissionAudioSampleFinished(uint8 slot); // done
|
||||
bool8 IsMP3RadioChannelAvailable() const; // done
|
||||
|
||||
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done
|
||||
bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done
|
||||
|
||||
void PlayLoadedMissionAudio(uint8 slot); // done
|
||||
void PlayOneShot(int32 index, uint16 sound, float vol); // done
|
||||
@@ -420,20 +425,20 @@ public:
|
||||
void PreTerminateGameSpecificShutdown(); // done
|
||||
/// processX - main logic of adding new sounds
|
||||
void ProcessActiveQueues(); // done
|
||||
bool ProcessAirBrakes(cVehicleParams& params); // done
|
||||
bool ProcessBoatEngine(cVehicleParams& params);
|
||||
bool ProcessBoatMovingOverWater(cVehicleParams& params); //done
|
||||
bool8 ProcessAirBrakes(cVehicleParams& params); // done
|
||||
bool8 ProcessBoatEngine(cVehicleParams& params);
|
||||
bool8 ProcessBoatMovingOverWater(cVehicleParams& params); //done
|
||||
#ifdef GTA_BRIDGE
|
||||
void ProcessBridge(); // done(bcs not exists in VC)
|
||||
void ProcessBridgeMotor(); // done(bcs not exists in VC)
|
||||
void ProcessBridgeOneShots(); // done(bcs not exists in VC)
|
||||
void ProcessBridgeWarning(); // done(bcs not exists in VC)
|
||||
#endif
|
||||
bool ProcessCarBombTick(cVehicleParams& params); // done
|
||||
bool8 ProcessCarBombTick(cVehicleParams& params); // done
|
||||
void ProcessCarHeli(cVehicleParams& params); // done
|
||||
void ProcessCesna(cVehicleParams& params); // done
|
||||
//void ProcessCrane(); // done(bcs not exists in VC)
|
||||
bool ProcessEngineDamage(cVehicleParams& params); // done
|
||||
bool8 ProcessEngineDamage(cVehicleParams& params); // done
|
||||
void ProcessEntity(int32 sound); // done
|
||||
void ProcessExplosions(int32 explosion); // done
|
||||
void ProcessFireHydrant(); // done
|
||||
@@ -462,25 +467,25 @@ public:
|
||||
void ProcessProjectiles(); // done
|
||||
void ProcessRainOnVehicle(cVehicleParams& params); // done
|
||||
void ProcessReverb() const; // done
|
||||
bool ProcessReverseGear(cVehicleParams& params); // done
|
||||
bool8 ProcessReverseGear(cVehicleParams& params); // done
|
||||
void ProcessScriptObject(int32 id); // done
|
||||
void ProcessSpecial(); // done
|
||||
#ifdef GTA_TRAIN
|
||||
bool ProcessTrainNoise(cVehicleParams ¶ms); //done(bcs not exists in VC)
|
||||
bool8 ProcessTrainNoise(cVehicleParams ¶ms); //done(bcs not exists in VC)
|
||||
#endif
|
||||
void ProcessVehicle(CVehicle *vehicle); // done
|
||||
bool ProcessVehicleDoors(cVehicleParams ¶ms); // done
|
||||
bool8 ProcessVehicleDoors(cVehicleParams ¶ms); // done
|
||||
void ProcessVehicleEngine(cVehicleParams ¶ms); // done
|
||||
void ProcessVehicleFlatTyre(cVehicleParams ¶ms); // done
|
||||
bool ProcessVehicleHorn(cVehicleParams ¶ms); // done
|
||||
bool8 ProcessVehicleHorn(cVehicleParams ¶ms); // done
|
||||
void ProcessVehicleOneShots(cVehicleParams ¶ms); // done
|
||||
bool ProcessVehicleReverseWarning(cVehicleParams ¶ms); // done
|
||||
bool ProcessVehicleRoadNoise(cVehicleParams ¶ms); // done
|
||||
bool ProcessVehicleSirenOrAlarm(cVehicleParams ¶ms); // done
|
||||
bool ProcessVehicleSkidding(cVehicleParams ¶ms); // done
|
||||
bool8 ProcessVehicleReverseWarning(cVehicleParams ¶ms); // done
|
||||
bool8 ProcessVehicleRoadNoise(cVehicleParams ¶ms); // done
|
||||
bool8 ProcessVehicleSirenOrAlarm(cVehicleParams ¶ms); // done
|
||||
bool8 ProcessVehicleSkidding(cVehicleParams ¶ms); // done
|
||||
void ProcessWaterCannon(int32); // done
|
||||
void ProcessWeather(int32 id); // done
|
||||
bool ProcessWetRoadNoise(cVehicleParams& params); // done
|
||||
bool8 ProcessWetRoadNoise(cVehicleParams& params); // done
|
||||
void ProcessEscalators(); // done
|
||||
void ProcessExtraSounds(); // done
|
||||
|
||||
@@ -499,26 +504,26 @@ public:
|
||||
void ServicePoliceRadioChannel(uint8 wantedLevel); // done
|
||||
void ServiceSoundEffects(); // done
|
||||
int8 SetCurrent3DProvider(uint8 which); // done
|
||||
void SetDynamicAcousticModelingStatus(uint8 status); // done
|
||||
void SetDynamicAcousticModelingStatus(bool8 status); // done
|
||||
void SetEffectsFadeVol(uint8 volume) const; // done
|
||||
void SetEffectsMasterVolume(uint8 volume) const; // done
|
||||
void SetMP3BoostVolume(uint8 volume) const; // done
|
||||
void SetEntityStatus(int32 id, uint8 status); // done
|
||||
void SetEntityStatus(int32 id, bool8 status); // done
|
||||
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); // done
|
||||
void SetMissionAudioLocation(uint8 slot, float x, float y, float z); // done
|
||||
void SetMissionScriptPoliceAudio(int32 sfx) const; // inlined and optimized
|
||||
void SetMonoMode(uint8 mono); // done
|
||||
void SetMonoMode(bool8 mono); // done
|
||||
void SetMusicFadeVol(uint8 volume) const; // done
|
||||
void SetMusicMasterVolume(uint8 volume) const; // done
|
||||
void SetSpeakerConfig(int32 conf) const; // done
|
||||
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); // done
|
||||
void SetUpOneShotCollisionSound(const cAudioCollision &col); // done
|
||||
bool SetupCrimeReport(); // done
|
||||
bool SetupJumboEngineSound(uint8 vol, uint32 freq); // done
|
||||
bool SetupJumboFlySound(uint8 emittingVol); // done
|
||||
bool SetupJumboRumbleSound(uint8 emittingVol); // done
|
||||
bool SetupJumboTaxiSound(uint8 vol); // done
|
||||
bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done
|
||||
bool8 SetupCrimeReport(); // done
|
||||
bool8 SetupJumboEngineSound(uint8 vol, uint32 freq); // done
|
||||
bool8 SetupJumboFlySound(uint8 emittingVol); // done
|
||||
bool8 SetupJumboRumbleSound(uint8 emittingVol); // done
|
||||
bool8 SetupJumboTaxiSound(uint8 vol); // done
|
||||
bool8 SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done
|
||||
void SetupPedComments(cPedParams ¶ms, uint16 sound); // done
|
||||
void SetupSuspectLastSeenReport();
|
||||
|
||||
@@ -527,12 +532,12 @@ public:
|
||||
|
||||
void UpdateGasPedalAudio(CVehicle *veh, int vehType); // done
|
||||
void UpdateReflections(); // done
|
||||
bool UsesReverseWarning(int32 model) const; // done
|
||||
bool UsesSiren(cVehicleParams ¶ms) const; // done
|
||||
bool UsesSirenSwitching(cVehicleParams ¶ms) const; // done
|
||||
bool8 UsesReverseWarning(int32 model) const; // done
|
||||
bool8 UsesSiren(cVehicleParams ¶ms) const; // done
|
||||
bool8 UsesSirenSwitching(cVehicleParams ¶ms) const; // done
|
||||
|
||||
CVehicle *FindVehicleOfPlayer(); // done
|
||||
void SetPedTalkingStatus(CPed *ped, uint8 status); // done
|
||||
void SetPedTalkingStatus(CPed *ped, bool8 status); // done
|
||||
void SetPlayersMood(uint8 mood, uint32 time); // done
|
||||
|
||||
float Sqrt(float v) const { return v <= 0.0f ? 0.0f : ::Sqrt(v); }
|
||||
@@ -544,8 +549,26 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
//#ifdef AUDIO_MSS
|
||||
/*
|
||||
Manual loop points are not on PS2 so let's have these macros to avoid massive ifndefs.
|
||||
Setting these manually was pointless anyway since they never change from sdt values.
|
||||
What were they thinking?
|
||||
*/
|
||||
#ifndef GTA_PS2
|
||||
#define RESET_LOOP_OFFSETS \
|
||||
m_sQueueSample.m_nLoopStart = 0; \
|
||||
m_sQueueSample.m_nLoopEnd = -1;
|
||||
#define SET_LOOP_OFFSETS(sample) \
|
||||
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(sample); \
|
||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(sample);
|
||||
#else
|
||||
#define RESET_LOOP_OFFSETS
|
||||
#define SET_LOOP_OFFSETS(sample)
|
||||
#endif
|
||||
|
||||
//#if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS)
|
||||
//static_assert(sizeof(cAudioManager) == 0x5558, "cAudioManager: error");
|
||||
//#endif
|
||||
|
||||
|
||||
extern cAudioManager AudioManager;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,25 +23,25 @@ cAudioScriptObject::Reset()
|
||||
}
|
||||
|
||||
void *
|
||||
cAudioScriptObject::operator new(size_t sz)
|
||||
cAudioScriptObject::operator new(size_t sz) throw()
|
||||
{
|
||||
return CPools::GetAudioScriptObjectPool()->New();
|
||||
}
|
||||
|
||||
void *
|
||||
cAudioScriptObject::operator new(size_t sz, int handle)
|
||||
cAudioScriptObject::operator new(size_t sz, int handle) throw()
|
||||
{
|
||||
return CPools::GetAudioScriptObjectPool()->New(handle);
|
||||
}
|
||||
|
||||
void
|
||||
cAudioScriptObject::operator delete(void *p, size_t sz)
|
||||
cAudioScriptObject::operator delete(void *p, size_t sz) throw()
|
||||
{
|
||||
CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject *)p);
|
||||
}
|
||||
|
||||
void
|
||||
cAudioScriptObject::operator delete(void *p, int handle)
|
||||
cAudioScriptObject::operator delete(void *p, int handle) throw()
|
||||
{
|
||||
CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject *)p);
|
||||
}
|
||||
@@ -90,6 +90,8 @@ cAudioScriptObject::SaveAllAudioScriptObjects(uint8 *buf, uint32 *size)
|
||||
void
|
||||
PlayOneShotScriptObject(uint8 id, CVector const &pos)
|
||||
{
|
||||
if (!DMAudio.IsAudioInitialised()) return;
|
||||
|
||||
cAudioScriptObject *audioScriptObject = new cAudioScriptObject();
|
||||
audioScriptObject->Posn = pos;
|
||||
audioScriptObject->AudioId = id;
|
||||
|
||||
@@ -12,10 +12,10 @@ public:
|
||||
|
||||
void Reset(); /// ok
|
||||
|
||||
static void* operator new(size_t);
|
||||
static void* operator new(size_t, int);
|
||||
static void operator delete(void*, size_t);
|
||||
static void operator delete(void*, int);
|
||||
static void* operator new(size_t) throw();
|
||||
static void* operator new(size_t, int) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
static void operator delete(void*, int) throw();
|
||||
|
||||
static void LoadAllAudioScriptObjects(uint8 *buf, uint32 size);
|
||||
static void SaveAllAudioScriptObjects(uint8 *buf, uint32 *size);
|
||||
|
||||
@@ -39,7 +39,7 @@ cDMAudio::DestroyEntity(int32 audioEntity)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::SetEntityStatus(int32 audioEntity, uint8 status)
|
||||
cDMAudio::SetEntityStatus(int32 audioEntity, bool8 status)
|
||||
{
|
||||
AudioManager.SetEntityStatus(audioEntity, status);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ cDMAudio::DestroyAllGameCreatedEntities(void)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::SetMonoMode(uint8 mono)
|
||||
cDMAudio::SetMonoMode(bool8 mono)
|
||||
{
|
||||
AudioManager.SetMonoMode(mono);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ cDMAudio::SetSpeakerConfig(int32 config)
|
||||
AudioManager.SetSpeakerConfig(config);
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cDMAudio::IsMP3RadioChannelAvailable(void)
|
||||
{
|
||||
return AudioManager.IsMP3RadioChannelAvailable();
|
||||
@@ -161,12 +161,12 @@ cDMAudio::ReacquireDigitalHandle(void)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::SetDynamicAcousticModelingStatus(uint8 status)
|
||||
cDMAudio::SetDynamicAcousticModelingStatus(bool8 status)
|
||||
{
|
||||
AudioManager.SetDynamicAcousticModelingStatus(status);
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cDMAudio::CheckForAnAudioFileOnCD(void)
|
||||
{
|
||||
return AudioManager.CheckForAnAudioFileOnCD();
|
||||
@@ -178,7 +178,7 @@ cDMAudio::GetCDAudioDriveLetter(void)
|
||||
return AudioManager.GetCDAudioDriveLetter();
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cDMAudio::IsAudioInitialised(void)
|
||||
{
|
||||
return AudioManager.IsAudioInitialised();
|
||||
@@ -196,7 +196,7 @@ cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject)
|
||||
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
|
||||
|
||||
if ( AEHANDLE_IS_OK(audioEntity) )
|
||||
AudioManager.SetEntityStatus(audioEntity, true);
|
||||
AudioManager.SetEntityStatus(audioEntity, TRUE);
|
||||
|
||||
return audioEntity;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject)
|
||||
|
||||
if ( AEHANDLE_IS_OK(audioEntity) )
|
||||
{
|
||||
AudioManager.SetEntityStatus(audioEntity, true);
|
||||
AudioManager.SetEntityStatus(audioEntity, TRUE);
|
||||
AudioManager.PlayOneShot(audioEntity, scriptObject->AudioId, 0.0f);
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ cDMAudio::PlayRadioAnnouncement(uint32 announcement)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::PlayFrontEndTrack(uint32 track, uint8 frontendFlag)
|
||||
cDMAudio::PlayFrontEndTrack(uint32 track, bool8 frontendFlag)
|
||||
{
|
||||
MusicManager.PlayFrontEndTrack(track, frontendFlag);
|
||||
}
|
||||
@@ -309,7 +309,7 @@ cDMAudio::PlayLoadedMissionAudio(uint8 slot)
|
||||
AudioManager.PlayLoadedMissionAudio(slot);
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cDMAudio::IsMissionAudioSampleFinished(uint8 slot)
|
||||
{
|
||||
return AudioManager.IsMissionAudioSampleFinished(slot);
|
||||
@@ -340,7 +340,7 @@ cDMAudio::SetRadioChannel(uint32 radio, int32 pos)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::SetStartingTrackPositions(uint8 isStartGame)
|
||||
cDMAudio::SetStartingTrackPositions(bool8 isStartGame)
|
||||
{
|
||||
MusicManager.SetStartingTrackPositions(isStartGame);
|
||||
}
|
||||
@@ -364,7 +364,7 @@ cDMAudio::GetRadioPosition(uint32 station)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::SetPedTalkingStatus(CPed *ped, uint8 status)
|
||||
cDMAudio::SetPedTalkingStatus(CPed *ped, bool8 status)
|
||||
{
|
||||
return AudioManager.SetPedTalkingStatus(ped, status);
|
||||
}
|
||||
@@ -376,7 +376,7 @@ cDMAudio::SetPlayersMood(uint8 mood, uint32 time)
|
||||
}
|
||||
|
||||
void
|
||||
cDMAudio::ShutUpPlayerTalking(uint8 state)
|
||||
cDMAudio::ShutUpPlayerTalking(bool8 state)
|
||||
{
|
||||
AudioManager.m_bIsPlayerShutUp = state;
|
||||
}
|
||||
@@ -25,11 +25,11 @@ public:
|
||||
|
||||
int32 CreateEntity(eAudioType type, void *UID);
|
||||
void DestroyEntity(int32 audioEntity);
|
||||
void SetEntityStatus(int32 audioEntity, uint8 status);
|
||||
void SetEntityStatus(int32 audioEntity, bool8 status);
|
||||
void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume);
|
||||
void DestroyAllGameCreatedEntities(void);
|
||||
|
||||
void SetMonoMode(uint8 mono);
|
||||
void SetMonoMode(bool8 mono);
|
||||
void SetMP3BoostVolume(uint8 volume);
|
||||
void SetEffectsMasterVolume(uint8 volume);
|
||||
void SetMusicMasterVolume(uint8 volume);
|
||||
@@ -46,17 +46,17 @@ public:
|
||||
|
||||
void SetSpeakerConfig(int32 config);
|
||||
|
||||
bool IsMP3RadioChannelAvailable(void);
|
||||
bool8 IsMP3RadioChannelAvailable(void);
|
||||
|
||||
void ReleaseDigitalHandle(void);
|
||||
void ReacquireDigitalHandle(void);
|
||||
|
||||
void SetDynamicAcousticModelingStatus(uint8 status);
|
||||
void SetDynamicAcousticModelingStatus(bool8 status);
|
||||
|
||||
bool CheckForAnAudioFileOnCD(void);
|
||||
bool8 CheckForAnAudioFileOnCD(void);
|
||||
|
||||
char GetCDAudioDriveLetter(void);
|
||||
bool IsAudioInitialised(void);
|
||||
bool8 IsAudioInitialised(void);
|
||||
|
||||
void ReportCrime(eCrimeType crime, CVector const &pos);
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
void PlayFrontEndSound(uint16 frontend, uint32 volume);
|
||||
void PlayRadioAnnouncement(uint32 announcement);
|
||||
void PlayFrontEndTrack(uint32 track, uint8 frontendFlag);
|
||||
void PlayFrontEndTrack(uint32 track, bool8 frontendFlag);
|
||||
void StopFrontEndTrack(void);
|
||||
|
||||
void ResetTimers(uint32 time);
|
||||
@@ -85,19 +85,19 @@ public:
|
||||
uint8 GetMissionAudioLoadingStatus(uint8 slot);
|
||||
void SetMissionAudioLocation(uint8 slot, float x, float y, float z);
|
||||
void PlayLoadedMissionAudio(uint8 slot);
|
||||
bool IsMissionAudioSampleFinished(uint8 slot);
|
||||
bool8 IsMissionAudioSampleFinished(uint8 slot);
|
||||
void ClearMissionAudio(uint8 slot);
|
||||
|
||||
uint8 GetRadioInCar(void);
|
||||
void SetRadioInCar(uint32 radio);
|
||||
void SetRadioChannel(uint32 radio, int32 pos);
|
||||
|
||||
void SetStartingTrackPositions(uint8 isStartGame);
|
||||
void SetStartingTrackPositions(bool8 isStartGame);
|
||||
float *GetListenTimeArray();
|
||||
uint32 GetFavouriteRadioStation();
|
||||
int32 GetRadioPosition(uint32 station);
|
||||
void SetPedTalkingStatus(class CPed *ped, uint8 status);
|
||||
void SetPedTalkingStatus(class CPed *ped, bool8 status);
|
||||
void SetPlayersMood(uint8 mood, uint32 time);
|
||||
void ShutUpPlayerTalking(uint8 state);
|
||||
void ShutUpPlayerTalking(bool8 state);
|
||||
};
|
||||
extern cDMAudio DMAudio;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,59 +16,59 @@ class CPed;
|
||||
class cMusicManager
|
||||
{
|
||||
public:
|
||||
bool m_bIsInitialised;
|
||||
bool m_bDisabled;
|
||||
bool field_2;
|
||||
bool8 m_bIsInitialised;
|
||||
bool8 m_bDisabled;
|
||||
bool8 m_bSetNextStation;
|
||||
uint8 m_nVolumeLatency;
|
||||
uint8 m_nCurrentVolume;
|
||||
uint8 m_nMaxVolume;
|
||||
uint32 m_nAnnouncement;
|
||||
bool m_bAnnouncementInProgress;
|
||||
bool8 m_bAnnouncementInProgress;
|
||||
tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS];
|
||||
bool m_bResetTimers;
|
||||
bool8 m_bResetTimers;
|
||||
uint32 m_nResetTime;
|
||||
bool m_bRadioSetByScript;
|
||||
uint8 m_nRadioStation;
|
||||
uint32 m_nRadioPosition;
|
||||
bool8 m_bRadioSetByScript;
|
||||
uint8 m_nRadioStationScript;
|
||||
int32 m_nRadioPosition;
|
||||
uint32 m_nRadioInCar;
|
||||
uint32 m_nFrontendTrack;
|
||||
uint32 m_nPlayingTrack;
|
||||
uint8 m_nUpcomingMusicMode;
|
||||
uint8 m_nMusicMode;
|
||||
bool field_398E;
|
||||
bool field_398F;
|
||||
uint32 m_nStreamedTrack;
|
||||
bool field_3994;
|
||||
bool field_3995;
|
||||
bool field_3996;
|
||||
bool field_3997;
|
||||
bool8 m_FrontendLoopFlag;
|
||||
bool8 m_bTrackChangeStarted;
|
||||
uint32 m_nNextTrack;
|
||||
bool8 m_nNextLoopFlag;
|
||||
bool8 m_bVerifyNextTrackStartedToPlay;
|
||||
bool8 m_bGameplayAllowsRadio;
|
||||
bool8 m_bRadioStreamReady;
|
||||
int8 nFramesSinceCutsceneEnded;
|
||||
bool field_3999;
|
||||
bool field_399A;
|
||||
bool8 m_bUserResumedGame;
|
||||
bool8 m_bMusicModeChangeStarted;
|
||||
uint8 m_nMusicModeToBeSet;
|
||||
bool field_399C;
|
||||
bool8 m_bEarlyFrontendTrack;
|
||||
float aListenTimeArray[NUM_RADIOS];
|
||||
float m_nLastTrackServiceTime;
|
||||
|
||||
public:
|
||||
cMusicManager();
|
||||
bool IsInitialised() { return m_bIsInitialised; }
|
||||
bool8 IsInitialised() { return m_bIsInitialised; }
|
||||
uint8 GetMusicMode() { return m_nMusicMode; }
|
||||
uint32 GetCurrentTrack() { return m_nPlayingTrack; }
|
||||
|
||||
void ResetMusicAfterReload();
|
||||
void SetStartingTrackPositions(uint8 isNewGameTimer);
|
||||
bool Initialise();
|
||||
void SetStartingTrackPositions(bool8 isNewGameTimer);
|
||||
bool8 Initialise();
|
||||
void Terminate();
|
||||
|
||||
void ChangeMusicMode(uint8 mode);
|
||||
void StopFrontEndTrack();
|
||||
|
||||
bool PlayerInCar();
|
||||
bool8 PlayerInCar();
|
||||
void DisplayRadioStationName();
|
||||
|
||||
void PlayAnnouncement(uint32);
|
||||
void PlayFrontEndTrack(uint32, uint8);
|
||||
void PlayFrontEndTrack(uint32, bool8);
|
||||
void PreloadCutSceneMusic(uint32);
|
||||
void PlayPreloadedCutSceneMusic(void);
|
||||
void StopCutSceneMusic(void);
|
||||
@@ -83,16 +83,16 @@ public:
|
||||
void ServiceAmbience();
|
||||
void ServiceTrack(CVehicle *veh, CPed *ped);
|
||||
|
||||
bool UsesPoliceRadio(CVehicle *veh);
|
||||
bool UsesTaxiRadio(CVehicle *veh);
|
||||
bool8 UsesPoliceRadio(CVehicle *veh);
|
||||
bool8 UsesTaxiRadio(CVehicle *veh);
|
||||
uint32 GetTrackStartPos(uint32 track);
|
||||
|
||||
void ComputeAmbienceVol(uint8 reset, uint8& outVolume);
|
||||
bool ServiceAnnouncement();
|
||||
void ComputeAmbienceVol(bool8 reset, uint8& outVolume);
|
||||
bool8 ServiceAnnouncement();
|
||||
|
||||
uint32 GetCarTuning();
|
||||
uint32 GetNextCarTuning();
|
||||
bool ChangeRadioChannel();
|
||||
bool8 ChangeRadioChannel();
|
||||
void RecordRadioStats();
|
||||
void SetUpCorrectAmbienceTrack();
|
||||
float *GetListenTimeArray();
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
uint32 GetFavouriteRadioStation();
|
||||
void SetMalibuClubTrackPos(uint8 pos);
|
||||
void SetStripClubTrackPos(uint8 pos);
|
||||
bool CheckForMusicInterruptions();
|
||||
bool8 CheckForMusicInterruptions();
|
||||
|
||||
void Enable();
|
||||
void Disable();
|
||||
@@ -109,5 +109,5 @@ public:
|
||||
VALIDATE_SIZE(cMusicManager, 0x95C);
|
||||
|
||||
extern cMusicManager MusicManager;
|
||||
extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
|
||||
extern bool8 g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
|
||||
float GetHeightScale();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "AudioSamples.h"
|
||||
#include "MusicManager.h"
|
||||
#include "PlayerPed.h"
|
||||
#include "PoliceRadio.h"
|
||||
#include "PolRadio.h"
|
||||
#include "Replay.h"
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
@@ -15,9 +15,6 @@
|
||||
#include "sampman.h"
|
||||
#include "Wanted.h"
|
||||
|
||||
const int channels = ARRAY_SIZE(AudioManager.m_asActiveSamples);
|
||||
const int policeChannel = channels + 1;
|
||||
|
||||
struct tPoliceRadioZone {
|
||||
char m_aName[8];
|
||||
uint32 m_nSampleIndex;
|
||||
@@ -41,20 +38,20 @@ cAudioManager::InitialisePoliceRadioZones()
|
||||
strcpy(ZoneSfx[i].m_aName, name); \
|
||||
ZoneSfx[i].m_nSampleIndex = sample;
|
||||
|
||||
SETZONESFX(0, "VICE_C", SFX_POLICE_RADIO_VICE_CITY);
|
||||
SETZONESFX(1, "IND_ZON", SFX_POLICE_RADIO_VICE_CITY_BEACH);
|
||||
SETZONESFX(2, "COM_ZON", SFX_POLICE_RADIO_VICE_CITY_MAINLAND);
|
||||
SETZONESFX(3, "BEACH1", SFX_POLICE_RADIO_OCEAN_BEACH);
|
||||
SETZONESFX(4, "BEACH2", SFX_POLICE_RADIO_WASHINGTON_BEACH);
|
||||
SETZONESFX(5, "BEACH3", SFX_POLICE_RADIO_VICE_POINT);
|
||||
SETZONESFX(6, "GOLFC", SFX_POLICE_RADIO_LEAF_LINKS);
|
||||
SETZONESFX(7, "STARI", SFX_POLICE_RADIO_STRAFISH_ISLAND);
|
||||
SETZONESFX(8, "DOCKS", SFX_POLICE_RADIO_VICE_PORT);
|
||||
SETZONESFX(9, "HAVANA", SFX_POLICE_RADIO_LITTLE_HAVANA);
|
||||
SETZONESFX(10, "HAITI", SFX_POLICE_RADIO_LITTLE_HAITI);
|
||||
SETZONESFX(11, "PORNI", SFX_POLICE_RADIO_PRAWN_ISLAND);
|
||||
SETZONESFX(12, "DTOWN", SFX_POLICE_RADIO_DOWNTOWN);
|
||||
SETZONESFX(13, "A_PORT", SFX_POLICE_RADIO_ESCOBAR_INTERNATIONAL);
|
||||
SETZONESFX(0, "VICE_C", SFX_SFX_POLICE_RADIO_VICE_CITY);
|
||||
SETZONESFX(1, "IND_ZON", SFX_SFX_POLICE_RADIO_VICE_CITY_BEACH);
|
||||
SETZONESFX(2, "COM_ZON", SFX_SFX_POLICE_RADIO_VICE_CITY_MAINLAND);
|
||||
SETZONESFX(3, "BEACH1", SFX_SFX_POLICE_RADIO_OCEAN_BEACH);
|
||||
SETZONESFX(4, "BEACH2", SFX_SFX_POLICE_RADIO_WASHINGTON_BEACH);
|
||||
SETZONESFX(5, "BEACH3", SFX_SFX_POLICE_RADIO_VICE_POINT);
|
||||
SETZONESFX(6, "GOLFC", SFX_SFX_POLICE_RADIO_LEAF_LINKS);
|
||||
SETZONESFX(7, "STARI", SFX_SFX_POLICE_RADIO_STARFISH_ISLAND);
|
||||
SETZONESFX(8, "DOCKS", SFX_SFX_POLICE_RADIO_VICEPORT);
|
||||
SETZONESFX(9, "HAVANA", SFX_SFX_POLICE_RADIO_LITTLE_HAVANA);
|
||||
SETZONESFX(10, "HAITI", SFX_SFX_POLICE_RADIO_LITTLE_HAITI);
|
||||
SETZONESFX(11, "PORNI", SFX_SFX_POLICE_RADIO_PRAWN_ISLAND);
|
||||
SETZONESFX(12, "DTOWN", SFX_SFX_POLICE_RADIO_DOWNTOWN);
|
||||
SETZONESFX(13, "A_PORT", SFX_SFX_POLICE_RADIO_ESCOBAR_INTERNATIONAL);
|
||||
|
||||
#undef SETZONESFX
|
||||
}
|
||||
@@ -68,8 +65,8 @@ cAudioManager::InitialisePoliceRadio()
|
||||
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++)
|
||||
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
|
||||
|
||||
SampleManager.SetChannelReverbFlag(policeChannel, false);
|
||||
gSpecialSuspectLastSeenReport = false;
|
||||
SampleManager.SetChannelReverbFlag(CHANNEL_POLICE_RADIO, FALSE);
|
||||
gSpecialSuspectLastSeenReport = FALSE;
|
||||
for (int32 i = 0; i < ARRAY_SIZE(gMinTimeToNextReport); i++)
|
||||
gMinTimeToNextReport[i] = m_FrameCounter;
|
||||
}
|
||||
@@ -78,7 +75,7 @@ void
|
||||
cAudioManager::ResetPoliceRadio()
|
||||
{
|
||||
if (!m_bIsInitialised) return;
|
||||
if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel);
|
||||
if (SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||
InitialisePoliceRadio();
|
||||
}
|
||||
|
||||
@@ -105,19 +102,18 @@ cAudioManager::DoPoliceRadioCrackle()
|
||||
m_sQueueSample.m_nCounter = 0;
|
||||
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
m_sQueueSample.m_bIs2D = true;
|
||||
m_sQueueSample.m_bIs2D = TRUE;
|
||||
m_sQueueSample.m_nReleasingVolumeModificator = 10;
|
||||
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE);
|
||||
m_sQueueSample.m_nVolume = m_anRandomTable[2] % 20 + 15;
|
||||
m_sQueueSample.m_nLoopCount = 0;
|
||||
m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume;
|
||||
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE);
|
||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE);
|
||||
m_sQueueSample.m_bReleasingSoundFlag = false;
|
||||
m_sQueueSample.m_bReverbFlag = false;
|
||||
SET_LOOP_OFFSETS(SFX_POLICE_RADIO_CRACKLE)
|
||||
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
|
||||
m_sQueueSample.m_bReverbFlag = FALSE;
|
||||
m_sQueueSample.m_nOffset = 63;
|
||||
m_sQueueSample.m_nReleasingVolumeDivider = 3;
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
m_sQueueSample.m_bRequireReflection = FALSE;
|
||||
AddSampleToRequestedQueue();
|
||||
}
|
||||
|
||||
@@ -130,7 +126,7 @@ cAudioManager::ServicePoliceRadio()
|
||||
if(!m_bIsInitialised) return;
|
||||
|
||||
if(m_nUserPause == 0) {
|
||||
bool crimeReport = SetupCrimeReport();
|
||||
bool8 crimeReport = SetupCrimeReport();
|
||||
#ifdef FIX_BUGS // Crash at 0x5fe6ef
|
||||
if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
|
||||
return;
|
||||
@@ -141,7 +137,11 @@ cAudioManager::ServicePoliceRadio()
|
||||
if (!crimeReport) {
|
||||
if (wantedLevel != 0) {
|
||||
if (nLastSeen != 0)
|
||||
#ifdef FIX_BUGS
|
||||
nLastSeen -= CTimer::GetLogicalFramesPassed();
|
||||
#else
|
||||
--nLastSeen;
|
||||
#endif
|
||||
else {
|
||||
nLastSeen = m_anRandomTable[1] % 1000 + 2000;
|
||||
SetupSuspectLastSeenReport();
|
||||
@@ -156,31 +156,35 @@ cAudioManager::ServicePoliceRadio()
|
||||
void
|
||||
cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
||||
{
|
||||
bool processed = false;
|
||||
bool8 processed = FALSE;
|
||||
uint32 sample;
|
||||
int32 freq;
|
||||
|
||||
static int cWait = 0;
|
||||
static bool bChannelOpen = false;
|
||||
static bool8 bChannelOpen = FALSE;
|
||||
static uint8 bMissionAudioPhysicalPlayingStatus = 0;
|
||||
static int32 PoliceChannelFreq = 22050;
|
||||
|
||||
if (!m_bIsInitialised) return;
|
||||
|
||||
if (m_nUserPause != 0) {
|
||||
if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel);
|
||||
if (SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||
if (g_nMissionAudioSfx != NO_SAMPLE && bMissionAudioPhysicalPlayingStatus == 1 &&
|
||||
SampleManager.IsStreamPlaying(1)) {
|
||||
SampleManager.PauseStream(1, 1);
|
||||
SampleManager.PauseStream(TRUE, 1);
|
||||
}
|
||||
} else {
|
||||
if (m_nPreviousUserPause && g_nMissionAudioSfx != NO_SAMPLE &&
|
||||
bMissionAudioPhysicalPlayingStatus == 1) {
|
||||
SampleManager.PauseStream(0, 1);
|
||||
SampleManager.PauseStream(FALSE, 1);
|
||||
}
|
||||
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = false;
|
||||
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE;
|
||||
if (cWait) {
|
||||
#ifdef FIX_BUGS
|
||||
cWait -= CTimer::GetLogicalFramesPassed();
|
||||
#else
|
||||
--cWait;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
if (g_nMissionAudioSfx != NO_SAMPLE && !bChannelOpen) {
|
||||
@@ -200,9 +204,9 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else if (!SampleManager.GetChannelUsedFlag(policeChannel)) {
|
||||
} else if (!SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) {
|
||||
SampleManager.PreloadStreamedFile(g_nMissionAudioSfx, 1);
|
||||
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 1);
|
||||
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 1);
|
||||
SampleManager.StartPreloadedStreamedFile(1);
|
||||
g_nMissionAudioPlayingStatus = 1;
|
||||
bMissionAudioPhysicalPlayingStatus = 0;
|
||||
@@ -211,7 +215,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
||||
}
|
||||
if (bChannelOpen) DoPoliceRadioCrackle();
|
||||
if ((g_nMissionAudioSfx == NO_SAMPLE || g_nMissionAudioPlayingStatus != 1) &&
|
||||
!SampleManager.GetChannelUsedFlag(policeChannel) && m_sPoliceRadioQueue.policeChannelTimer) {
|
||||
!SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO) && m_sPoliceRadioQueue.policeChannelTimer) {
|
||||
if (m_sPoliceRadioQueue.policeChannelTimer) {
|
||||
sample = m_sPoliceRadioQueue.crimesSamples[m_sPoliceRadioQueue.policeChannelCounterSeconds];
|
||||
m_sPoliceRadioQueue.policeChannelTimer--;
|
||||
@@ -223,35 +227,35 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
||||
if (gSpecialSuspectLastSeenReport) {
|
||||
gSpecialSuspectLastSeenReport = 0;
|
||||
} else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1) {
|
||||
bChannelOpen = false;
|
||||
processed = true;
|
||||
bChannelOpen = FALSE;
|
||||
processed = TRUE;
|
||||
}
|
||||
}
|
||||
if (sample == NO_SAMPLE) {
|
||||
if (!processed) cWait = 30;
|
||||
} else {
|
||||
SampleManager.InitialiseChannel(policeChannel, sample, 0);
|
||||
SampleManager.InitialiseChannel(CHANNEL_POLICE_RADIO, sample, SFX_BANK_0);
|
||||
switch (sample) {
|
||||
case SFX_POLICE_RADIO_MESSAGE_NOISE_1:
|
||||
freq = m_anRandomTable[4] % 2000 + 10025;
|
||||
bChannelOpen = bChannelOpen == false;
|
||||
bChannelOpen = bChannelOpen == FALSE;
|
||||
break;
|
||||
default: freq = SampleManager.GetSampleBaseFrequency(sample); break;
|
||||
}
|
||||
PoliceChannelFreq = freq;
|
||||
SampleManager.SetChannelFrequency(policeChannel, freq);
|
||||
SampleManager.SetChannelVolume(policeChannel, 100);
|
||||
SampleManager.SetChannelPan(policeChannel, 63);
|
||||
SampleManager.SetChannelLoopCount(policeChannel, 1);
|
||||
SampleManager.SetChannelLoopPoints(policeChannel, 0, -1);
|
||||
SampleManager.StartChannel(policeChannel);
|
||||
SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, freq);
|
||||
SampleManager.SetChannelVolume(CHANNEL_POLICE_RADIO, 100);
|
||||
SampleManager.SetChannelPan(CHANNEL_POLICE_RADIO, 63);
|
||||
SampleManager.SetChannelLoopCount(CHANNEL_POLICE_RADIO, 1);
|
||||
SampleManager.SetChannelLoopPoints(CHANNEL_POLICE_RADIO, 0, -1);
|
||||
SampleManager.StartChannel(CHANNEL_POLICE_RADIO);
|
||||
}
|
||||
if (processed) ResetPoliceRadio();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cAudioManager::SetupCrimeReport()
|
||||
{
|
||||
int16 audioZoneId;
|
||||
@@ -264,13 +268,13 @@ cAudioManager::SetupCrimeReport()
|
||||
float quarterY;
|
||||
int i;
|
||||
int32 sampleIndex;
|
||||
bool processed = false;
|
||||
bool8 processed = FALSE;
|
||||
|
||||
if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return false;
|
||||
if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return FALSE;
|
||||
|
||||
if (60 - m_sPoliceRadioQueue.policeChannelTimer <= 9) {
|
||||
AgeCrimes();
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
|
||||
@@ -278,7 +282,7 @@ cAudioManager::SetupCrimeReport()
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) return false;
|
||||
if (i == ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) return FALSE;
|
||||
audioZoneId = CTheZones::FindAudioZone(&m_sPoliceRadioQueue.crimes[i].position);
|
||||
if (audioZoneId >= 0 && audioZoneId < NUMAUDIOZONES) {
|
||||
zone = CTheZones::GetAudioZone(audioZoneId);
|
||||
@@ -303,9 +307,9 @@ cAudioManager::SetupCrimeReport()
|
||||
default: break;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1 - 1);
|
||||
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_SFX_CRIME_1 - 1);
|
||||
#else
|
||||
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1);
|
||||
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_SFX_CRIME_1);
|
||||
#endif
|
||||
m_sPoliceRadioQueue.Add(SFX_IN);
|
||||
rangeX = zone->maxx - zone->minx;
|
||||
@@ -317,10 +321,10 @@ cAudioManager::SetupCrimeReport()
|
||||
|
||||
if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) {
|
||||
m_sPoliceRadioQueue.Add(SFX_NORTH);
|
||||
processed = true;
|
||||
processed = TRUE;
|
||||
} else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) {
|
||||
m_sPoliceRadioQueue.Add(SFX_SOUTH);
|
||||
processed = true;
|
||||
processed = TRUE;
|
||||
}
|
||||
|
||||
if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX)
|
||||
@@ -339,7 +343,7 @@ cAudioManager::SetupCrimeReport()
|
||||
}
|
||||
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
|
||||
AgeCrimes();
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -354,85 +358,85 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
int32 color_post_modifier;
|
||||
|
||||
const int32 gCarColourTable[][3] = {
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLACK, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_WHITE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_BRIGHT, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_BLUE, SFX_POLICE_RADIO_GREY},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLACK, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_WHITE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_BRIGHT, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, SFX_SFX_POLICE_RADIO_BLUE, SFX_SFX_POLICE_RADIO_GREY},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_RED, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_ORANGE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_YELLOW, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_GREEN, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_BLUE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_PURPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{NO_SAMPLE, SFX_SFX_POLICE_RADIO_SILVER, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
{SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE},
|
||||
@@ -468,7 +472,7 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
case MI_RANCHER:
|
||||
case MI_FBIRANCH:
|
||||
case MI_SANDKING:
|
||||
sample = SFX_POLICE_RADIO_OFFROAD;
|
||||
sample = SFX_SFX_POLICE_RADIO_OFFROAD;
|
||||
break;
|
||||
case MI_IDAHO:
|
||||
case MI_MANANA:
|
||||
@@ -479,7 +483,7 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
case MI_SABRETUR:
|
||||
case MI_VIRGO:
|
||||
case MI_BLISTAC:
|
||||
sample = SFX_POLICE_RADIO_2_DOOR;
|
||||
sample = SFX_SFX_POLICE_RADIO_TUDOOR;
|
||||
break;
|
||||
case MI_STINGER:
|
||||
case MI_INFERNUS:
|
||||
@@ -489,14 +493,14 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
case MI_COMET:
|
||||
case MI_DELUXO:
|
||||
case MI_HOTRING:
|
||||
sample = SFX_POLICE_RADIO_SPORTS_CAR;
|
||||
sample = SFX_SFX_POLICE_RADIO_SPORTS_CAR;
|
||||
break;
|
||||
case MI_LINERUN:
|
||||
sample = SFX_POLICE_RADIO_RIG;
|
||||
sample = SFX_SFX_POLICE_RADIO_RIG;
|
||||
break;
|
||||
case MI_PEREN:
|
||||
case MI_REGINA:
|
||||
sample = SFX_POLICE_RADIO_STATION_WAGON;
|
||||
sample = SFX_SFX_POLICE_RADIO_STATION_WAGON;
|
||||
break;
|
||||
case MI_SENTINEL:
|
||||
case MI_FBICAR:
|
||||
@@ -507,23 +511,23 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
case MI_OCEANIC:
|
||||
case MI_HERMES:
|
||||
case MI_GREENWOO:
|
||||
sample = SFX_POLICE_RADIO_SEDAN;
|
||||
sample = SFX_SFX_POLICE_RADIO_SEDAN;
|
||||
break;
|
||||
case MI_RIO:
|
||||
sample = SFX_POLICE_RADIO_CRUISER;
|
||||
sample = SFX_SFX_POLICE_RADIO_CRUISER;
|
||||
break;
|
||||
case MI_FIRETRUCK:
|
||||
sample = SFX_POLICE_RADIO_FIRE_TRUCK;
|
||||
sample = SFX_SFX_POLICE_RADIO_FIRE_TRUCK;
|
||||
break;
|
||||
case MI_TRASH:
|
||||
sample = SFX_POLICE_RADIO_GARBAGE_TRUCK;
|
||||
sample = SFX_SFX_POLICE_RADIO_GARBAGE_TRUCK;
|
||||
break;
|
||||
case MI_STRETCH:
|
||||
case MI_LOVEFIST:
|
||||
sample = SFX_POLICE_RADIO_STRETCH;
|
||||
sample = SFX_SFX_POLICE_RADIO_STRETCH;
|
||||
break;
|
||||
case MI_VOODOO:
|
||||
sample = SFX_POLICE_RADIO_LOWRIDER;
|
||||
sample = SFX_SFX_POLICE_RADIO_LOWRIDER;
|
||||
break;
|
||||
case MI_PONY:
|
||||
case MI_MOONBEAM:
|
||||
@@ -534,31 +538,31 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
case MI_TOPFUN:
|
||||
case MI_BURRITO:
|
||||
case MI_SPAND:
|
||||
sample = SFX_POLICE_RADIO_VAN;
|
||||
sample = SFX_SFX_POLICE_RADIO_VAN;
|
||||
break;
|
||||
case MI_MULE:
|
||||
case MI_BARRACKS:
|
||||
case MI_PACKER:
|
||||
case MI_FLATBED:
|
||||
sample = SFX_POLICE_RADIO_TRUCK;
|
||||
sample = SFX_SFX_POLICE_RADIO_TRUCK;
|
||||
break;
|
||||
case MI_AMBULAN:
|
||||
sample = SFX_POLICE_RADIO_AMBULANCE;
|
||||
sample = SFX_SFX_POLICE_RADIO_AMBULANCE;
|
||||
break;
|
||||
case MI_TAXI:
|
||||
case MI_CABBIE:
|
||||
case MI_BORGNINE:
|
||||
sample = SFX_POLICE_RADIO_TAXI;
|
||||
sample = SFX_SFX_POLICE_RADIO_TAXI;
|
||||
break;
|
||||
case MI_BOBCAT:
|
||||
case MI_WALTON:
|
||||
sample = SFX_POLICE_RADIO_PICKUP;
|
||||
sample = SFX_SFX_POLICE_RADIO_PICKUP;
|
||||
break;
|
||||
case MI_MRWHOOP:
|
||||
sample = SFX_POLICE_RADIO_ICE_CREAM_VAN;
|
||||
sample = SFX_SFX_POLICE_RADIO_ICE_CREAM_VAN;
|
||||
break;
|
||||
case MI_BFINJECT:
|
||||
sample = SFX_POLICE_RADIO_BUGGY;
|
||||
sample = SFX_SFX_POLICE_RADIO_BUGGY;
|
||||
break;
|
||||
case MI_HUNTER:
|
||||
case MI_CHOPPER:
|
||||
@@ -567,57 +571,57 @@ cAudioManager::SetupSuspectLastSeenReport()
|
||||
case MI_MAVERICK:
|
||||
case MI_VCNMAV:
|
||||
case MI_POLMAV:
|
||||
sample = SFX_POLICE_RADIO_HELICOPTER;
|
||||
sample = SFX_SFX_POLICE_RADIO_HELICOPTER;
|
||||
break;
|
||||
case MI_POLICE:
|
||||
sample = SFX_POLICE_RADIO_POLICE_CAR;
|
||||
sample = SFX_SFX_POLICE_RADIO_POLICE_CAR;
|
||||
break;
|
||||
case MI_ENFORCER:
|
||||
sample = SFX_POLICE_RADIO_SWAT_VAN;
|
||||
sample = SFX_SFX_POLICE_RADIO_SWAT_VAN;
|
||||
break;
|
||||
case MI_PREDATOR:
|
||||
case MI_SQUALO:
|
||||
case MI_SPEEDER:
|
||||
sample = SFX_POLICE_RADIO_SPEEDBOAT;
|
||||
sample = SFX_SFX_POLICE_RADIO_SPEEDBOAT;
|
||||
break;
|
||||
case MI_BUS:
|
||||
sample = SFX_POLICE_RADIO_BUS;
|
||||
sample = SFX_SFX_POLICE_RADIO_BUS;
|
||||
break;
|
||||
case MI_RHINO:
|
||||
sample = SFX_POLICE_RADIO_TANK;
|
||||
sample = SFX_SFX_POLICE_RADIO_TANK;
|
||||
break;
|
||||
case MI_ANGEL:
|
||||
case MI_PCJ600:
|
||||
case MI_FREEWAY:
|
||||
case MI_SANCHEZ:
|
||||
sample = SFX_POLICE_RADIO_MOTOBIKE;
|
||||
sample = SFX_SFX_POLICE_RADIO_MOTOBIKE;
|
||||
break;
|
||||
case MI_COACH:
|
||||
sample = SFX_POLICE_RADIO_COACH;
|
||||
sample = SFX_SFX_POLICE_RADIO_COACH;
|
||||
break;
|
||||
case MI_ROMERO:
|
||||
sample = SFX_POLICE_RADIO_HEARSE;
|
||||
sample = SFX_SFX_POLICE_RADIO_HEARSE;
|
||||
break;
|
||||
case MI_PIZZABOY:
|
||||
case MI_FAGGIO:
|
||||
sample = SFX_POLICE_RADIO_MOPED;
|
||||
sample = SFX_SFX_POLICE_RADIO_MOPED;
|
||||
break;
|
||||
case MI_DEADDODO:
|
||||
case MI_SKIMMER:
|
||||
sample = SFX_POLICE_RADIO_PLANE;
|
||||
sample = SFX_SFX_POLICE_RADIO_PLANE;
|
||||
break;
|
||||
case MI_REEFER:
|
||||
case MI_TROPIC:
|
||||
case MI_COASTG:
|
||||
case MI_MARQUIS:
|
||||
case MI_JETMAX:
|
||||
sample = SFX_POLICE_RADIO_BOAT;
|
||||
sample = SFX_SFX_POLICE_RADIO_BOAT;
|
||||
break;
|
||||
case MI_CADDY:
|
||||
sample = SFX_POLICE_RADIO_GOLF_CART;
|
||||
sample = SFX_SFX_POLICE_RADIO_GOLF_CART;
|
||||
break;
|
||||
case MI_DINGHY:
|
||||
sample = SFX_POLICE_RADIO_DINGHY;
|
||||
sample = SFX_SFX_POLICE_RADIO_DINGHY;
|
||||
break;
|
||||
default:
|
||||
//debug("\n *** UNKNOWN CAR MODEL INDEX %d *** ", veh->GetModelIndex());
|
||||
@@ -687,7 +691,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
|
||||
float quarterX;
|
||||
float quarterY;
|
||||
int32 sample;
|
||||
bool processed = false;
|
||||
bool8 processed = FALSE;
|
||||
CVector vec = CVector(x, y, z);
|
||||
|
||||
if (!m_bIsInitialised) return;
|
||||
@@ -712,10 +716,10 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
|
||||
|
||||
if (vec.y > halfY + quarterY) {
|
||||
m_sPoliceRadioQueue.Add(SFX_NORTH);
|
||||
processed = true;
|
||||
processed = TRUE;
|
||||
} else if (vec.y < halfY - quarterY) {
|
||||
m_sPoliceRadioQueue.Add(SFX_SOUTH);
|
||||
processed = true;
|
||||
processed = TRUE;
|
||||
}
|
||||
|
||||
if (vec.x > halfX + quarterX)
|
||||
@@ -727,7 +731,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
|
||||
m_sPoliceRadioQueue.Add(sample);
|
||||
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
|
||||
m_sPoliceRadioQueue.Add(NO_SAMPLE);
|
||||
gSpecialSuspectLastSeenReport = true;
|
||||
gSpecialSuspectLastSeenReport = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,8 @@ enum eRadioStation
|
||||
USERTRACK,
|
||||
NUM_RADIOS = 11,
|
||||
POLICE_RADIO = 11,
|
||||
RADIO_OFF = 10,
|
||||
//TAXI_RADIO,
|
||||
RADIO_OFF,
|
||||
};
|
||||
|
||||
enum eMusicMode
|
||||
@@ -137,3 +137,28 @@ enum eAudioType
|
||||
AUDIOTYPE_POLICERADIO,
|
||||
TOTAL_AUDIO_TYPES,
|
||||
};
|
||||
|
||||
#ifdef GTA_PS2
|
||||
enum
|
||||
{
|
||||
NUM_CHANNELS_GENERIC = 40,
|
||||
CHANNEL_POLICE_RADIO = NUM_CHANNELS_GENERIC,
|
||||
CHANNEL_MISSION_AUDIO_1,
|
||||
CHANNEL_MISSION_AUDIO_2,
|
||||
CHANNEL_PLAYER_VEHICLE_ENGINE,
|
||||
NUM_CHANNELS
|
||||
};
|
||||
#else
|
||||
enum
|
||||
{
|
||||
#ifdef PS2_AUDIO_CHANNELS
|
||||
NUM_CHANNELS_GENERIC = 40,
|
||||
#else
|
||||
NUM_CHANNELS_GENERIC = 20,
|
||||
#endif
|
||||
CHANNEL_POLICE_RADIO,
|
||||
CHANNEL_MISSION_AUDIO_1,
|
||||
CHANNEL_MISSION_AUDIO_2,
|
||||
NUM_CHANNELS
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
|
||||
#include "aldlist.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#define _stricmp strcasecmp
|
||||
#define _strnicmp strncasecmp
|
||||
#define _strdup strdup
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_OAL
|
||||
/*
|
||||
* Init call
|
||||
@@ -47,8 +41,8 @@ ALDeviceList::ALDeviceList()
|
||||
defaultDeviceIndex = 0;
|
||||
|
||||
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) {
|
||||
devices = (char *)alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
defaultDeviceName = (char *)alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
devices = (char *)alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||
defaultDeviceName = (char *)alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
|
||||
|
||||
index = 0;
|
||||
// go through device list (each device terminated with a single NULL, list terminated with double NULL)
|
||||
@@ -62,17 +56,11 @@ ALDeviceList::ALDeviceList()
|
||||
if (context) {
|
||||
alcMakeContextCurrent(context);
|
||||
// if new actual device name isn't already in the list, then add it...
|
||||
actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
bool bNewName = true;
|
||||
for (unsigned int i = 0; i < GetNumDevices(); i++) {
|
||||
if (strcmp(GetDeviceName(i), actualDeviceName) == 0) {
|
||||
bNewName = false;
|
||||
}
|
||||
}
|
||||
if ((bNewName) && (actualDeviceName != NULL) && (strlen(actualDeviceName) > 0)) {
|
||||
ALDEVICEINFO ALDeviceInfo;
|
||||
actualDeviceName = alcGetString(device, ALC_ALL_DEVICES_SPECIFIER);
|
||||
if ((actualDeviceName != NULL) && (strlen(actualDeviceName) > 0)) {
|
||||
ALDEVICEINFO &ALDeviceInfo = aDeviceInfo[nNumOfDevices++];
|
||||
ALDeviceInfo.bSelected = true;
|
||||
ALDeviceInfo.strDeviceName = _strdup(actualDeviceName);
|
||||
ALDeviceInfo.SetName(actualDeviceName);
|
||||
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(int), &ALDeviceInfo.iMajorVersion);
|
||||
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(int), &ALDeviceInfo.iMinorVersion);
|
||||
|
||||
@@ -105,8 +93,6 @@ ALDeviceList::ALDeviceList()
|
||||
|
||||
// Get Source Count
|
||||
ALDeviceInfo.uiSourceCount = GetMaxNumSources();
|
||||
|
||||
aDeviceInfo[nNumOfDevices++] = ALDeviceInfo;
|
||||
}
|
||||
alcMakeContextCurrent(NULL);
|
||||
alcDestroyContext(context);
|
||||
|
||||
@@ -21,7 +21,7 @@ enum
|
||||
};
|
||||
|
||||
struct ALDEVICEINFO {
|
||||
const char *strDeviceName;
|
||||
char *strDeviceName;
|
||||
int iMajorVersion;
|
||||
int iMinorVersion;
|
||||
unsigned int uiSourceCount;
|
||||
@@ -33,6 +33,19 @@ struct ALDEVICEINFO {
|
||||
strDeviceName = NULL;
|
||||
Extensions = 0;
|
||||
}
|
||||
|
||||
~ALDEVICEINFO()
|
||||
{
|
||||
delete[] strDeviceName;
|
||||
strDeviceName = NULL;
|
||||
}
|
||||
|
||||
void SetName(const char *name)
|
||||
{
|
||||
if(strDeviceName) delete[] strDeviceName;
|
||||
strDeviceName = new char[strlen(name) + 1];
|
||||
strcpy(strDeviceName, name);
|
||||
}
|
||||
};
|
||||
|
||||
typedef ALDEVICEINFO *LPALDEVICEINFO;
|
||||
|
||||
@@ -10,18 +10,22 @@
|
||||
|
||||
extern bool IsFXSupported();
|
||||
|
||||
ALuint alSources[MAXCHANNELS+MAX2DCHANNELS];
|
||||
ALuint alFilters[MAXCHANNELS+MAX2DCHANNELS];
|
||||
ALuint alBuffers[MAXCHANNELS+MAX2DCHANNELS];
|
||||
ALuint alSources[NUM_CHANNELS];
|
||||
ALuint alFilters[NUM_CHANNELS];
|
||||
ALuint alBuffers[NUM_CHANNELS];
|
||||
bool bChannelsCreated = false;
|
||||
|
||||
int32 CChannel::channelsThatNeedService = 0;
|
||||
|
||||
uint8 tempStereoBuffer[PED_BLOCKSIZE * 2];
|
||||
|
||||
void
|
||||
CChannel::InitChannels()
|
||||
{
|
||||
alGenSources(MAXCHANNELS+MAX2DCHANNELS, alSources);
|
||||
alGenBuffers(MAXCHANNELS+MAX2DCHANNELS, alBuffers);
|
||||
alGenSources(NUM_CHANNELS, alSources);
|
||||
alGenBuffers(NUM_CHANNELS, alBuffers);
|
||||
if (IsFXSupported())
|
||||
alGenFilters(MAXCHANNELS + MAX2DCHANNELS, alFilters);
|
||||
alGenFilters(NUM_CHANNELS, alFilters);
|
||||
bChannelsCreated = true;
|
||||
}
|
||||
|
||||
@@ -30,13 +34,13 @@ CChannel::DestroyChannels()
|
||||
{
|
||||
if (bChannelsCreated)
|
||||
{
|
||||
alDeleteSources(MAXCHANNELS + MAX2DCHANNELS, alSources);
|
||||
alDeleteSources(NUM_CHANNELS, alSources);
|
||||
memset(alSources, 0, sizeof(alSources));
|
||||
alDeleteBuffers(MAXCHANNELS + MAX2DCHANNELS, alBuffers);
|
||||
alDeleteBuffers(NUM_CHANNELS, alBuffers);
|
||||
memset(alBuffers, 0, sizeof(alBuffers));
|
||||
if (IsFXSupported())
|
||||
{
|
||||
alDeleteFilters(MAXCHANNELS + MAX2DCHANNELS, alFilters);
|
||||
alDeleteFilters(NUM_CHANNELS, alFilters);
|
||||
memset(alFilters, 0, sizeof(alFilters));
|
||||
}
|
||||
bChannelsCreated = false;
|
||||
@@ -48,6 +52,7 @@ CChannel::CChannel()
|
||||
{
|
||||
Data = nil;
|
||||
DataSize = 0;
|
||||
bIs2D = false;
|
||||
SetDefault();
|
||||
}
|
||||
|
||||
@@ -59,7 +64,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 +74,10 @@ void CChannel::SetDefault()
|
||||
|
||||
void CChannel::Reset()
|
||||
{
|
||||
// Here is safe because ctor don't call this
|
||||
if (LoopCount > 1)
|
||||
channelsThatNeedService--;
|
||||
|
||||
ClearBuffer();
|
||||
SetDefault();
|
||||
}
|
||||
@@ -82,6 +93,7 @@ void CChannel::Init(uint32 _id, bool Is2D)
|
||||
|
||||
if ( Is2D )
|
||||
{
|
||||
bIs2D = true;
|
||||
alSource3f(alSources[id], AL_POSITION, 0.0f, 0.0f, 0.0f);
|
||||
alSourcef(alSources[id], AL_GAIN, 1.0f);
|
||||
}
|
||||
@@ -105,7 +117,20 @@ void CChannel::Start()
|
||||
if ( !HasSource() ) return;
|
||||
if ( !Data ) return;
|
||||
|
||||
alBufferData(alBuffers[id], AL_FORMAT_MONO16, Data, DataSize, Frequency);
|
||||
if ( bIs2D )
|
||||
{
|
||||
// convert mono data to stereo
|
||||
int16 *monoData = (int16*)Data;
|
||||
int16 *stereoData = (int16*)tempStereoBuffer;
|
||||
for (size_t i = 0; i < DataSize / 2; i++)
|
||||
{
|
||||
*(stereoData++) = *monoData;
|
||||
*(stereoData++) = *(monoData++);
|
||||
}
|
||||
alBufferData(alBuffers[id], AL_FORMAT_STEREO16, tempStereoBuffer, DataSize * 2, Frequency);
|
||||
}
|
||||
else
|
||||
alBufferData(alBuffers[id], AL_FORMAT_MONO16, Data, DataSize, Frequency);
|
||||
if ( LoopPoints[0] != 0 && LoopPoints[0] != -1 )
|
||||
alBufferiv(alBuffers[id], AL_LOOP_POINTS_SOFT, LoopPoints);
|
||||
alSourcei(alSources[id], AL_BUFFER, alBuffers[id]);
|
||||
@@ -165,10 +190,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 +266,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;
|
||||
|
||||
@@ -19,7 +19,11 @@ class CChannel
|
||||
float Distances[2];
|
||||
int32 LoopCount;
|
||||
ALint LoopPoints[2];
|
||||
ALint LastProcessedOffset;
|
||||
bool bIs2D;
|
||||
public:
|
||||
static int32 channelsThatNeedService;
|
||||
|
||||
static void InitChannels();
|
||||
static void DestroyChannels();
|
||||
|
||||
@@ -37,7 +41,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 +49,7 @@ public:
|
||||
void ClearBuffer();
|
||||
void SetReverbMix(ALuint slot, float mix);
|
||||
void UpdateReverb(ALuint slot);
|
||||
bool Update();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -464,8 +464,8 @@ public:
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_OAL_USE_MPG123
|
||||
// fuzzy seek eliminates stutter when playing ADF but spams errors a lot (nothing breaks though)
|
||||
#define MP3_USE_FUZZY_SEEK
|
||||
// fuzzy seek eliminates stutter when playing ADF but spams errors a lot (and breaks radio sometimes)
|
||||
//#define MP3_USE_FUZZY_SEEK
|
||||
|
||||
class CMP3File : public IDecoder
|
||||
{
|
||||
@@ -492,6 +492,8 @@ public:
|
||||
{
|
||||
#ifdef MP3_USE_FUZZY_SEEK
|
||||
mpg123_param(m_pMH, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS | MPG123_QUIET, 0.0);
|
||||
#else
|
||||
mpg123_param(m_pMH, MPG123_FLAGS, MPG123_SEEKBUFFER | MPG123_GAPLESS, 0.0);
|
||||
#endif
|
||||
long rate = 0;
|
||||
int channels = 0;
|
||||
@@ -499,6 +501,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;
|
||||
|
||||
@@ -601,6 +604,8 @@ public:
|
||||
{
|
||||
#ifdef MP3_USE_FUZZY_SEEK
|
||||
mpg123_param(m_pMH, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS | MPG123_QUIET, 0.0);
|
||||
#else
|
||||
mpg123_param(m_pMH, MPG123_FLAGS, MPG123_SEEKBUFFER | MPG123_GAPLESS, 0.0);
|
||||
#endif
|
||||
long rate = 0;
|
||||
int channels = 0;
|
||||
@@ -980,7 +985,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/)
|
||||
@@ -1078,7 +1084,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;
|
||||
}
|
||||
|
||||
@@ -1150,6 +1156,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;
|
||||
@@ -1232,10 +1239,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);
|
||||
@@ -1246,6 +1259,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;
|
||||
@@ -1305,7 +1325,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
|
||||
@@ -1313,44 +1333,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 )
|
||||
{
|
||||
TRACE("stream set looping");
|
||||
alSourcei(m_pAlSources[0], AL_LOOPING, AL_TRUE);
|
||||
alSourcei(m_pAlSources[1], AL_LOOPING, AL_TRUE);
|
||||
}
|
||||
|
||||
assert(buffersProcessed[0] == buffersProcessed[1]);
|
||||
|
||||
while( buffersProcessed[0]-- )
|
||||
// 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)
|
||||
{
|
||||
ALuint buffer[2];
|
||||
|
||||
alSourceUnqueueBuffers(m_pAlSources[0], 1, &buffer[0]);
|
||||
alSourceUnqueueBuffers(m_pAlSources[1], 1, &buffer[1]);
|
||||
|
||||
if (m_bActive && FillBuffer(buffer))
|
||||
Setup(true);
|
||||
buffersRefilled = FillBuffers() != 0;
|
||||
if (m_nLoopCount != 0)
|
||||
m_nLoopCount--;
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1358,10 +1385,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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "AudioSamples.h"
|
||||
#include "audio_enums.h"
|
||||
|
||||
#define MAX_VOLUME 127
|
||||
#define MAX_FREQ DIGITALRATE
|
||||
@@ -111,22 +112,29 @@ enum
|
||||
#endif
|
||||
};
|
||||
#define MAX_PEDSFX 7
|
||||
#define PED_BLOCKSIZE 79000
|
||||
#define PED_BLOCKSIZE 160000
|
||||
|
||||
#define MAXPROVIDERS 64
|
||||
|
||||
#define MAXCHANNELS 28
|
||||
#define MAXCHANNELS_SURROUND 24
|
||||
#define MAX2DCHANNELS 1
|
||||
#define CHANNEL2D MAXCHANNELS
|
||||
#define MAXCHANNELS (NUM_CHANNELS_GENERIC+1)
|
||||
#define MAXCHANNELS_SURROUND (MAXCHANNELS-4)
|
||||
#define MAX2DCHANNELS 3
|
||||
|
||||
#define MAX_STREAMS 3
|
||||
#define MAX_STREAMS 1
|
||||
|
||||
#define DIGITALRATE 32000
|
||||
#define DIGITALBITS 16
|
||||
#define DIGITALCHANNELS 2
|
||||
|
||||
#define MAX_DIGITAL_MIXER_CHANNELS 32
|
||||
#ifdef FIX_BUGS
|
||||
#define MAX_DIGITAL_MIXER_CHANNELS (MAXCHANNELS+MAX_STREAMS*2+MAX2DCHANNELS)
|
||||
#else
|
||||
#define MAX_DIGITAL_MIXER_CHANNELS (MAXCHANNELS+MAX_STREAMS*2)
|
||||
#endif
|
||||
|
||||
static_assert( NUM_CHANNELS == MAXCHANNELS + MAX2DCHANNELS, "The number of channels doesn't match with an enum" );
|
||||
|
||||
extern int gBankStartOffset[67];
|
||||
|
||||
class cSampleManager
|
||||
{
|
||||
@@ -135,9 +143,9 @@ class cSampleManager
|
||||
uint8 m_nMP3BoostVolume;
|
||||
uint8 m_nEffectsFadeVolume;
|
||||
uint8 m_nMusicFadeVolume;
|
||||
uint8 m_nMonoMode;
|
||||
bool8 m_nMonoMode;
|
||||
char m_szCDRomRootPath[80];
|
||||
bool m_bInitialised;
|
||||
bool8 m_bInitialised;
|
||||
uint8 m_nNumberOfProviders;
|
||||
char *m_aAudioProviders[MAXPROVIDERS];
|
||||
tSample m_aSamples[TOTAL_AUDIO_SAMPLES];
|
||||
@@ -167,16 +175,16 @@ public:
|
||||
|
||||
int8 AutoDetect3DProviders();
|
||||
|
||||
bool IsMP3RadioChannelAvailable(void);
|
||||
bool8 IsMP3RadioChannelAvailable(void);
|
||||
|
||||
void ReleaseDigitalHandle (void);
|
||||
void ReacquireDigitalHandle(void);
|
||||
|
||||
bool Initialise(void);
|
||||
void Terminate (void);
|
||||
bool8 Initialise(void);
|
||||
void Terminate (void);
|
||||
|
||||
bool CheckForAnAudioFileOnCD(void);
|
||||
char GetCDAudioDriveLetter (void);
|
||||
bool8 CheckForAnAudioFileOnCD(void);
|
||||
char GetCDAudioDriveLetter (void);
|
||||
|
||||
void UpdateEffectsVolume(void);
|
||||
|
||||
@@ -185,14 +193,14 @@ public:
|
||||
void SetMP3BoostVolume (uint8 nVolume);
|
||||
void SetEffectsFadeVolume (uint8 nVolume);
|
||||
void SetMusicFadeVolume (uint8 nVolume);
|
||||
void SetMonoMode (uint8 nMode);
|
||||
void SetMonoMode (bool8 nMode);
|
||||
|
||||
bool LoadSampleBank (uint8 nBank);
|
||||
void UnloadSampleBank (uint8 nBank);
|
||||
bool IsSampleBankLoaded(uint8 nBank);
|
||||
bool8 LoadSampleBank (uint8 nBank);
|
||||
void UnloadSampleBank (uint8 nBank);
|
||||
bool8 IsSampleBankLoaded(uint8 nBank);
|
||||
|
||||
bool IsPedCommentLoaded(uint32 nComment);
|
||||
bool LoadPedComment (uint32 nComment);
|
||||
bool8 IsPedCommentLoaded(uint32 nComment);
|
||||
bool8 LoadPedComment (uint32 nComment);
|
||||
int32 GetBankContainingSound(uint32 offset);
|
||||
|
||||
int32 _GetPedCommentSlot(uint32 nComment);
|
||||
@@ -202,10 +210,10 @@ public:
|
||||
int32 GetSampleLoopEndOffset (uint32 nSample);
|
||||
uint32 GetSampleLength (uint32 nSample);
|
||||
|
||||
bool UpdateReverb(void);
|
||||
bool8 UpdateReverb(void);
|
||||
|
||||
void SetChannelReverbFlag (uint32 nChannel, uint8 nReverbFlag);
|
||||
bool InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank);
|
||||
void SetChannelReverbFlag (uint32 nChannel, bool8 nReverbFlag);
|
||||
bool8 InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank);
|
||||
void SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume);
|
||||
void SetChannel3DPosition (uint32 nChannel, float fX, float fY, float fZ);
|
||||
void SetChannel3DDistances (uint32 nChannel, float fMax, float fMin);
|
||||
@@ -214,241 +222,96 @@ public:
|
||||
void SetChannelFrequency (uint32 nChannel, uint32 nFreq);
|
||||
void SetChannelLoopPoints (uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd);
|
||||
void SetChannelLoopCount (uint32 nChannel, uint32 nLoopCount);
|
||||
bool GetChannelUsedFlag (uint32 nChannel);
|
||||
bool8 GetChannelUsedFlag (uint32 nChannel);
|
||||
void StartChannel (uint32 nChannel);
|
||||
void StopChannel (uint32 nChannel);
|
||||
|
||||
void PreloadStreamedFile (uint32 nFile, uint8 nStream);
|
||||
void PauseStream (uint8 nPauseFlag, uint8 nStream);
|
||||
void StartPreloadedStreamedFile (uint8 nStream);
|
||||
bool StartStreamedFile (uint32 nFile, uint32 nPos, uint8 nStream);
|
||||
void StopStreamedFile (uint8 nStream);
|
||||
int32 GetStreamedFilePosition (uint8 nStream);
|
||||
void SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffectFlag, uint8 nStream);
|
||||
int32 GetStreamedFileLength (uint8 nStream);
|
||||
bool IsStreamPlaying (uint8 nStream);
|
||||
void PreloadStreamedFile (uint32 nFile, uint8 nStream = 0);
|
||||
void PauseStream (bool8 nPauseFlag, uint8 nStream = 0);
|
||||
void StartPreloadedStreamedFile (uint8 nStream = 0);
|
||||
bool8 StartStreamedFile (uint32 nFile, uint32 nPos, uint8 nStream = 0);
|
||||
void StopStreamedFile (uint8 nStream = 0);
|
||||
int32 GetStreamedFilePosition (uint8 nStream = 0);
|
||||
void SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, bool8 nEffectFlag, uint8 nStream = 0);
|
||||
int32 GetStreamedFileLength (uint8 nStream = 0);
|
||||
bool8 IsStreamPlaying (uint8 nStream = 0);
|
||||
void SetStreamedFileLoopFlag (bool8 nLoopFlag, uint8 nStream = 0);
|
||||
#ifdef AUDIO_OAL
|
||||
void Service(void);
|
||||
#endif
|
||||
bool InitialiseSampleBanks(void);
|
||||
bool8 InitialiseSampleBanks(void);
|
||||
|
||||
uint8 GetMusicVolume() const { return m_nMusicVolume; }
|
||||
void SetStreamedFileLoopFlag(uint8 nLoopFlag, uint8 nStream);
|
||||
};
|
||||
|
||||
extern cSampleManager SampleManager;
|
||||
extern uint32 BankStartOffset[MAX_SFX_BANKS];
|
||||
|
||||
#if defined(OPUS_AUDIO_PATHS)
|
||||
static char StreamedNameTable[][25] = {
|
||||
"AUDIO\\HEAD.OPUS", "AUDIO\\CLASS.OPUS", "AUDIO\\KJAH.OPUS", "AUDIO\\RISE.OPUS", "AUDIO\\LIPS.OPUS", "AUDIO\\GAME.OPUS",
|
||||
"AUDIO\\MSX.OPUS", "AUDIO\\FLASH.OPUS", "AUDIO\\CHAT.OPUS", "AUDIO\\HEAD.OPUS", "AUDIO\\POLICE.OPUS", "AUDIO\\CITY.OPUS",
|
||||
"AUDIO\\WATER.OPUS", "AUDIO\\COMOPEN.OPUS", "AUDIO\\SUBOPEN.OPUS", "AUDIO\\JB.OPUS", "AUDIO\\BET.OPUS", "AUDIO\\L1_LG.OPUS",
|
||||
"AUDIO\\L2_DSB.OPUS", "AUDIO\\L3_DM.OPUS", "AUDIO\\L4_PAP.OPUS", "AUDIO\\L5_TFB.OPUS", "AUDIO\\J0_DM2.OPUS", "AUDIO\\J1_LFL.OPUS",
|
||||
"AUDIO\\J2_KCL.OPUS", "AUDIO\\J3_VH.OPUS", "AUDIO\\J4_ETH.OPUS", "AUDIO\\J5_DST.OPUS", "AUDIO\\J6_TBJ.OPUS", "AUDIO\\T1_TOL.OPUS",
|
||||
"AUDIO\\T2_TPU.OPUS", "AUDIO\\T3_MAS.OPUS", "AUDIO\\T4_TAT.OPUS", "AUDIO\\T5_BF.OPUS", "AUDIO\\S0_MAS.OPUS", "AUDIO\\S1_PF.OPUS",
|
||||
"AUDIO\\S2_CTG.OPUS", "AUDIO\\S3_RTC.OPUS", "AUDIO\\S5_LRQ.OPUS", "AUDIO\\S4_BDBA.OPUS", "AUDIO\\S4_BDBB.OPUS", "AUDIO\\S2_CTG2.OPUS",
|
||||
"AUDIO\\S4_BDBD.OPUS", "AUDIO\\S5_LRQB.OPUS", "AUDIO\\S5_LRQC.OPUS", "AUDIO\\A1_SSO.OPUS", "AUDIO\\A2_PP.OPUS", "AUDIO\\A3_SS.OPUS",
|
||||
"AUDIO\\A4_PDR.OPUS", "AUDIO\\A5_K2FT.OPUS", "AUDIO\\K1_KBO.OPUS", "AUDIO\\K2_GIS.OPUS", "AUDIO\\K3_DS.OPUS", "AUDIO\\K4_SHI.OPUS",
|
||||
"AUDIO\\K5_SD.OPUS", "AUDIO\\R0_PDR2.OPUS", "AUDIO\\R1_SW.OPUS", "AUDIO\\R2_AP.OPUS", "AUDIO\\R3_ED.OPUS", "AUDIO\\R4_GF.OPUS",
|
||||
"AUDIO\\R5_PB.OPUS", "AUDIO\\R6_MM.OPUS", "AUDIO\\D1_STOG.OPUS", "AUDIO\\D2_KK.OPUS", "AUDIO\\D3_ADO.OPUS", "AUDIO\\D5_ES.OPUS",
|
||||
"AUDIO\\D7_MLD.OPUS", "AUDIO\\D4_GTA.OPUS", "AUDIO\\D4_GTA2.OPUS", "AUDIO\\D6_STS.OPUS", "AUDIO\\A6_BAIT.OPUS", "AUDIO\\A7_ETG.OPUS",
|
||||
"AUDIO\\A8_PS.OPUS", "AUDIO\\A9_ASD.OPUS", "AUDIO\\K4_SHI2.OPUS", "AUDIO\\C1_TEX.OPUS", "AUDIO\\EL_PH1.OPUS", "AUDIO\\EL_PH2.OPUS",
|
||||
"AUDIO\\EL_PH3.OPUS", "AUDIO\\EL_PH4.OPUS", "AUDIO\\YD_PH1.OPUS", "AUDIO\\YD_PH2.OPUS", "AUDIO\\YD_PH3.OPUS", "AUDIO\\YD_PH4.OPUS",
|
||||
"AUDIO\\HD_PH1.OPUS", "AUDIO\\HD_PH2.OPUS", "AUDIO\\HD_PH3.OPUS", "AUDIO\\HD_PH4.OPUS", "AUDIO\\HD_PH5.OPUS", "AUDIO\\MT_PH1.OPUS",
|
||||
"AUDIO\\MT_PH2.OPUS", "AUDIO\\MT_PH3.OPUS", "AUDIO\\MT_PH4.OPUS", "AUDIO\\MISCOM.OPUS", "AUDIO\\END.OPUS", "AUDIO\\lib_a1.OPUS",
|
||||
"AUDIO\\lib_a2.OPUS", "AUDIO\\lib_a.OPUS", "AUDIO\\lib_b.OPUS", "AUDIO\\lib_c.OPUS", "AUDIO\\lib_d.OPUS", "AUDIO\\l2_a.OPUS",
|
||||
"AUDIO\\j4t_1.OPUS", "AUDIO\\j4t_2.OPUS", "AUDIO\\j4t_3.OPUS", "AUDIO\\j4t_4.OPUS", "AUDIO\\j4_a.OPUS", "AUDIO\\j4_b.OPUS",
|
||||
"AUDIO\\j4_c.OPUS", "AUDIO\\j4_d.OPUS", "AUDIO\\j4_e.OPUS", "AUDIO\\j4_f.OPUS", "AUDIO\\j6_1.OPUS", "AUDIO\\j6_a.OPUS",
|
||||
"AUDIO\\j6_b.OPUS", "AUDIO\\j6_c.OPUS", "AUDIO\\j6_d.OPUS", "AUDIO\\t4_a.OPUS", "AUDIO\\s1_a.OPUS", "AUDIO\\s1_a1.OPUS",
|
||||
"AUDIO\\s1_b.OPUS", "AUDIO\\s1_c.OPUS", "AUDIO\\s1_c1.OPUS", "AUDIO\\s1_d.OPUS", "AUDIO\\s1_e.OPUS", "AUDIO\\s1_f.OPUS",
|
||||
"AUDIO\\s1_g.OPUS", "AUDIO\\s1_h.OPUS", "AUDIO\\s1_i.OPUS", "AUDIO\\s1_j.OPUS", "AUDIO\\s1_k.OPUS", "AUDIO\\s1_l.OPUS",
|
||||
"AUDIO\\s3_a.OPUS", "AUDIO\\s3_b.OPUS", "AUDIO\\el3_a.OPUS", "AUDIO\\mf1_a.OPUS", "AUDIO\\mf2_a.OPUS", "AUDIO\\mf3_a.OPUS",
|
||||
"AUDIO\\mf3_b.OPUS", "AUDIO\\mf3_b1.OPUS", "AUDIO\\mf3_c.OPUS", "AUDIO\\mf4_a.OPUS", "AUDIO\\mf4_b.OPUS", "AUDIO\\mf4_c.OPUS",
|
||||
"AUDIO\\a1_a.OPUS", "AUDIO\\a3_a.OPUS", "AUDIO\\a5_a.OPUS", "AUDIO\\a4_a.OPUS", "AUDIO\\a4_b.OPUS", "AUDIO\\a4_c.OPUS",
|
||||
"AUDIO\\a4_d.OPUS", "AUDIO\\k1_a.OPUS", "AUDIO\\k3_a.OPUS", "AUDIO\\r1_a.OPUS", "AUDIO\\r2_a.OPUS", "AUDIO\\r2_b.OPUS",
|
||||
"AUDIO\\r2_c.OPUS", "AUDIO\\r2_d.OPUS", "AUDIO\\r2_e.OPUS", "AUDIO\\r2_f.OPUS", "AUDIO\\r2_g.OPUS", "AUDIO\\r2_h.OPUS",
|
||||
"AUDIO\\r5_a.OPUS", "AUDIO\\r6_a.OPUS", "AUDIO\\r6_a1.OPUS", "AUDIO\\r6_b.OPUS", "AUDIO\\lo2_a.OPUS", "AUDIO\\lo6_a.OPUS",
|
||||
"AUDIO\\yd2_a.OPUS", "AUDIO\\yd2_b.OPUS", "AUDIO\\yd2_c.OPUS", "AUDIO\\yd2_c1.OPUS", "AUDIO\\yd2_d.OPUS", "AUDIO\\yd2_e.OPUS",
|
||||
"AUDIO\\yd2_f.OPUS", "AUDIO\\yd2_g.OPUS", "AUDIO\\yd2_h.OPUS", "AUDIO\\yd2_ass.OPUS", "AUDIO\\yd2_ok.OPUS", "AUDIO\\h5_a.OPUS",
|
||||
"AUDIO\\h5_b.OPUS", "AUDIO\\h5_c.OPUS", "AUDIO\\ammu_a.OPUS", "AUDIO\\ammu_b.OPUS", "AUDIO\\ammu_c.OPUS", "AUDIO\\door_1.OPUS",
|
||||
"AUDIO\\door_2.OPUS", "AUDIO\\door_3.OPUS", "AUDIO\\door_4.OPUS", "AUDIO\\door_5.OPUS", "AUDIO\\door_6.OPUS", "AUDIO\\t3_a.OPUS",
|
||||
"AUDIO\\t3_b.OPUS", "AUDIO\\t3_c.OPUS", "AUDIO\\k1_b.OPUS", "AUDIO\\cat1.OPUS"};
|
||||
#elif defined(PS2_AUDIO_PATHS)
|
||||
static char StreamedNameTable[][40] =
|
||||
{
|
||||
"AUDIO\\MUSIC\\HEAD.VB",
|
||||
"AUDIO\\MUSIC\\DOUBLE.VB",
|
||||
"AUDIO\\MUSIC\\KJAH.VB",
|
||||
"AUDIO\\MUSIC\\RISE.VB",
|
||||
"AUDIO\\MUSIC\\LIPS.VB",
|
||||
"AUDIO\\MUSIC\\MUNDO.VB",
|
||||
"AUDIO\\MUSIC\\MSX.VB",
|
||||
"AUDIO\\MUSIC\\FLASH.VB",
|
||||
"AUDIO\\MUSIC\\LCJ.VB",
|
||||
"AUDIO\\MUSIC\\LCFR.VB",
|
||||
"AUDIO\\MUSIC\\MISCOM2.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\WATER.VB",
|
||||
"AUDIO\\MUSIC\\SAWMILL.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\WATER.VB",
|
||||
"AUDIO\\MUSIC\\WATER.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\CITY.VB",
|
||||
"AUDIO\\MUSIC\\POLICE.VB",
|
||||
"AUDIO\\MUSIC\\TAXI.VB",
|
||||
"AUDIO\\NEWS\\NEWS_A.VB",
|
||||
"AUDIO\\NEWS\\NEWS_B.VB",
|
||||
"AUDIO\\NEWS\\NEWS_C.VB",
|
||||
"AUDIO\\NEWS\\NEWS_D.VB",
|
||||
"AUDIO\\NEWS\\NEWS_E.VB",
|
||||
"AUDIO\\NEWS\\NEWS_F.VB",
|
||||
"AUDIO\\NEWS\\NEWS_G.VB",
|
||||
"AUDIO\\NEWS\\NEWS_H.VB",
|
||||
"AUDIO\\NEWS\\NEWS_I.VB",
|
||||
"AUDIO\\NEWS\\NEWS_J.VB",
|
||||
"AUDIO\\NEWS\\NEWS_K.VB",
|
||||
"AUDIO\\NEWS\\NEWS_L.VB",
|
||||
"AUDIO\\NEWS\\NEWS_M.VB",
|
||||
"AUDIO\\NEWS\\NEWS_N.VB",
|
||||
"AUDIO\\CUTSCENE\\BIKER.VB",
|
||||
"AUDIO\\CUTSCENE\\BONEVOY.VB",
|
||||
"AUDIO\\CUTSCENE\\CAMPAIN.VB",
|
||||
"AUDIO\\CUTSCENE\\CASHCHP.VB",
|
||||
"AUDIO\\CUTSCENE\\CONTBAN.VB",
|
||||
"AUDIO\\CUTSCENE\\CRAZY69.VB",
|
||||
"AUDIO\\CUTSCENE\\CRAZY69.VB",
|
||||
"AUDIO\\CUTSCENE\\DEADLY.VB",
|
||||
"AUDIO\\CUTSCENE\\DONPROB.VB",
|
||||
"AUDIO\\CUTSCENE\\DRIVNMR.VB",
|
||||
"AUDIO\\CUTSCENE\\ELECTON.VB",
|
||||
"AUDIO\\CUTSCENE\\FINAL.VB",
|
||||
"AUDIO\\CUTSCENE\\FINAL_2.VB",
|
||||
"AUDIO\\CUTSCENE\\HOMSWET.VB",
|
||||
"AUDIO\\CUTSCENE\\HOTWHEL.VB",
|
||||
"AUDIO\\CUTSCENE\\KIDNAPP.VB",
|
||||
"AUDIO\\CUTSCENE\\LANDGRB.VB",
|
||||
"AUDIO\\CUTSCENE\\MORGUE.VB",
|
||||
"AUDIO\\CUTSCENE\\OVERDOS.VB",
|
||||
"AUDIO\\CUTSCENE\\RUFJUST.VB",
|
||||
"AUDIO\\CUTSCENE\\SAYONAR.VB",
|
||||
"AUDIO\\CUTSCENE\\SICILAN.VB",
|
||||
"AUDIO\\CUTSCENE\\THEOFER.VB",
|
||||
"AUDIO\\CUTSCENE\\INTRO.VB",
|
||||
"AUDIO\\MUSIC\\FINALE.VB",
|
||||
"AUDIO\\MUSIC\\MISCOM2.VB"
|
||||
#else
|
||||
static char StreamedNameTable[][25] =
|
||||
{
|
||||
"AUDIO\\WILD.ADF",
|
||||
"AUDIO\\FLASH.ADF",
|
||||
"AUDIO\\KCHAT.ADF",
|
||||
"AUDIO\\FEVER.ADF",
|
||||
"AUDIO\\VROCK.ADF",
|
||||
"AUDIO\\VCPR.ADF",
|
||||
"AUDIO\\ESPANT.ADF",
|
||||
"AUDIO\\EMOTION.ADF",
|
||||
"AUDIO\\WAVE.ADF",
|
||||
"AUDIO\\MISCOM.MP3",
|
||||
"AUDIO\\CITY.MP3",
|
||||
"AUDIO\\WATER.MP3",
|
||||
"AUDIO\\BEACHAMB.MP3",
|
||||
"AUDIO\\HCITY.MP3",
|
||||
"AUDIO\\HWATER.MP3",
|
||||
"AUDIO\\HBEACH.MP3",
|
||||
"AUDIO\\MALLAMB.MP3",
|
||||
"AUDIO\\STRIP.MP3",
|
||||
"AUDIO\\MALIBU.MP3",
|
||||
"AUDIO\\HOTEL.MP3",
|
||||
"AUDIO\\DIRTRING.MP3",
|
||||
"AUDIO\\LAW4RIOT.MP3",
|
||||
"AUDIO\\AMBSIL.MP3",
|
||||
"AUDIO\\POLICE.MP3",
|
||||
"AUDIO\\TAXI.MP3",
|
||||
"AUDIO\\BCLOSED.MP3",
|
||||
"AUDIO\\BOPEN.MP3",
|
||||
"AUDIO\\ASS_1.MP3",
|
||||
"AUDIO\\ASS_2.MP3",
|
||||
"AUDIO\\BANK_1.MP3",
|
||||
"AUDIO\\BANK_2A.MP3",
|
||||
"AUDIO\\BANK_2B.MP3",
|
||||
"AUDIO\\BANK_3A.MP3",
|
||||
"AUDIO\\BANK_3B.MP3",
|
||||
"AUDIO\\BANK_4.MP3",
|
||||
"AUDIO\\BIKE_1.MP3",
|
||||
"AUDIO\\BIKE_2.MP3",
|
||||
"AUDIO\\BIKE_3.MP3",
|
||||
"AUDIO\\BUD_1.MP3",
|
||||
"AUDIO\\BUD_2.MP3",
|
||||
"AUDIO\\BUD_3.MP3",
|
||||
"AUDIO\\CAP_1.MP3",
|
||||
"AUDIO\\CAR_1.MP3",
|
||||
"AUDIO\\CNT_1A.MP3",
|
||||
"AUDIO\\CNT_1B.MP3",
|
||||
"AUDIO\\CNT_2.MP3",
|
||||
"AUDIO\\COK_1.MP3",
|
||||
"AUDIO\\COK_2A.MP3",
|
||||
"AUDIO\\COK_2B.MP3",
|
||||
"AUDIO\\COK_3.MP3",
|
||||
"AUDIO\\COK_4A.MP3",
|
||||
"AUDIO\\COK_4A2.MP3",
|
||||
"AUDIO\\COK_4B.MP3",
|
||||
"AUDIO\\COL_1.MP3",
|
||||
"AUDIO\\COL_2.MP3",
|
||||
"AUDIO\\COL_3A.MP3",
|
||||
"AUDIO\\COL_4A.MP3",
|
||||
"AUDIO\\COL_5A.MP3",
|
||||
"AUDIO\\COL_5B.MP3",
|
||||
"AUDIO\\CUB_1.MP3",
|
||||
"AUDIO\\CUB_2.MP3",
|
||||
"AUDIO\\CUB_3.MP3",
|
||||
"AUDIO\\CUB_4.MP3",
|
||||
"AUDIO\\DRUG_1.MP3",
|
||||
"AUDIO\\FIN.MP3",
|
||||
"AUDIO\\FIN2.MP3",
|
||||
"AUDIO\\FINALE.MP3",
|
||||
"AUDIO\\HAT_1.MP3",
|
||||
"AUDIO\\HAT_2.MP3",
|
||||
"AUDIO\\HAT_3.MP3",
|
||||
"AUDIO\\ICE_1.MP3",
|
||||
"AUDIO\\INT_A.MP3",
|
||||
"AUDIO\\INT_B.MP3",
|
||||
"AUDIO\\INT_D.MP3",
|
||||
"AUDIO\\INT_M.MP3",
|
||||
"AUDIO\\LAW_1A.MP3",
|
||||
"AUDIO\\LAW_1B.MP3",
|
||||
"AUDIO\\LAW_2A.MP3",
|
||||
"AUDIO\\LAW_2B.MP3",
|
||||
"AUDIO\\LAW_2C.MP3",
|
||||
"AUDIO\\LAW_3.MP3",
|
||||
"AUDIO\\LAW_4.MP3",
|
||||
"AUDIO\\PHIL_1.MP3",
|
||||
"AUDIO\\PHIL_2.MP3",
|
||||
"AUDIO\\PORN_1.MP3",
|
||||
"AUDIO\\PORN_2.MP3",
|
||||
"AUDIO\\PORN_3.MP3",
|
||||
"AUDIO\\PORN_4.MP3",
|
||||
"AUDIO\\RESC_1A.MP3",
|
||||
"AUDIO\\ROK_1.MP3",
|
||||
"AUDIO\\ROK_2.MP3",
|
||||
"AUDIO\\ROK_3A.MP3",
|
||||
"AUDIO\\STRIPA.MP3",
|
||||
"AUDIO\\TAX_1.MP3",
|
||||
"AUDIO\\TEX_1.MP3",
|
||||
"AUDIO\\TEX_2.MP3",
|
||||
"AUDIO\\TEX_3.MP3",
|
||||
"AUDIO\\GLIGHT.MP3",
|
||||
"AUDIO\\FIST.MP3",
|
||||
"AUDIO\\MISCOM.MP3",
|
||||
"AUDIO\\MISCOM.MP3",
|
||||
"AUDIO\\MISCOM.MP3",
|
||||
"AUDIO\\MISCOM.MP3",
|
||||
#endif
|
||||
|
||||
static char StreamedNameTable[][40] = {
|
||||
"AUDIO\\MUSIC\\HEAD",
|
||||
"AUDIO\\MUSIC\\DOUBLE",
|
||||
"AUDIO\\MUSIC\\KJAH",
|
||||
"AUDIO\\MUSIC\\RISE",
|
||||
"AUDIO\\MUSIC\\LIPS",
|
||||
"AUDIO\\MUSIC\\MUNDO",
|
||||
"AUDIO\\MUSIC\\MSX",
|
||||
"AUDIO\\MUSIC\\FLASH",
|
||||
"AUDIO\\MUSIC\\LCJ",
|
||||
"AUDIO\\MUSIC\\LCFR",
|
||||
"AUDIO\\MUSIC\\MISCOM2",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\WATER",
|
||||
"AUDIO\\MUSIC\\SAWMILL",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\WATER",
|
||||
"AUDIO\\MUSIC\\WATER",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\CITY",
|
||||
"AUDIO\\MUSIC\\POLICE",
|
||||
"AUDIO\\MUSIC\\TAXI",
|
||||
"AUDIO\\NEWS\\NEWS_A",
|
||||
"AUDIO\\NEWS\\NEWS_B",
|
||||
"AUDIO\\NEWS\\NEWS_C",
|
||||
"AUDIO\\NEWS\\NEWS_D",
|
||||
"AUDIO\\NEWS\\NEWS_E",
|
||||
"AUDIO\\NEWS\\NEWS_F",
|
||||
"AUDIO\\NEWS\\NEWS_G",
|
||||
"AUDIO\\NEWS\\NEWS_H",
|
||||
"AUDIO\\NEWS\\NEWS_I",
|
||||
"AUDIO\\NEWS\\NEWS_J",
|
||||
"AUDIO\\NEWS\\NEWS_K",
|
||||
"AUDIO\\NEWS\\NEWS_L",
|
||||
"AUDIO\\NEWS\\NEWS_M",
|
||||
"AUDIO\\NEWS\\NEWS_N",
|
||||
"AUDIO\\CUTSCENE\\BIKER",
|
||||
"AUDIO\\CUTSCENE\\BONEVOY",
|
||||
"AUDIO\\CUTSCENE\\CAMPAIN",
|
||||
"AUDIO\\CUTSCENE\\CASHCHP",
|
||||
"AUDIO\\CUTSCENE\\CONTBAN",
|
||||
"AUDIO\\CUTSCENE\\CRAZY69",
|
||||
"AUDIO\\CUTSCENE\\CRAZY69",
|
||||
"AUDIO\\CUTSCENE\\DEADLY",
|
||||
"AUDIO\\CUTSCENE\\DONPROB",
|
||||
"AUDIO\\CUTSCENE\\DRIVNMR",
|
||||
"AUDIO\\CUTSCENE\\ELECTON",
|
||||
"AUDIO\\CUTSCENE\\FINAL",
|
||||
"AUDIO\\CUTSCENE\\FINAL_2",
|
||||
"AUDIO\\CUTSCENE\\HOMSWET",
|
||||
"AUDIO\\CUTSCENE\\HOTWHEL",
|
||||
"AUDIO\\CUTSCENE\\KIDNAPP",
|
||||
"AUDIO\\CUTSCENE\\LANDGRB",
|
||||
"AUDIO\\CUTSCENE\\MORGUE",
|
||||
"AUDIO\\CUTSCENE\\OVERDOS",
|
||||
"AUDIO\\CUTSCENE\\RUFJUST",
|
||||
"AUDIO\\CUTSCENE\\SAYONAR",
|
||||
"AUDIO\\CUTSCENE\\SICILAN",
|
||||
"AUDIO\\CUTSCENE\\THEOFER",
|
||||
"AUDIO\\CUTSCENE\\INTRO",
|
||||
"AUDIO\\MUSIC\\FINALE",
|
||||
"AUDIO\\MUSIC\\MISCOM2"
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
#include "AudioManager.h"
|
||||
|
||||
cSampleManager SampleManager;
|
||||
bool _bSampmanInitialised = false;
|
||||
bool8 _bSampmanInitialised = FALSE;
|
||||
|
||||
uint32 BankStartOffset[MAX_SFX_BANKS];
|
||||
uint32 nNumMP3s;
|
||||
@@ -60,7 +60,7 @@ int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::IsMP3RadioChannelAvailable(void)
|
||||
{
|
||||
return nNumMP3s != 0;
|
||||
@@ -75,10 +75,10 @@ void cSampleManager::ReacquireDigitalHandle(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::Initialise(void)
|
||||
{
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -87,9 +87,9 @@ cSampleManager::Terminate(void)
|
||||
|
||||
}
|
||||
|
||||
bool cSampleManager::CheckForAnAudioFileOnCD(void)
|
||||
bool8 cSampleManager::CheckForAnAudioFileOnCD(void)
|
||||
{
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char cSampleManager::GetCDAudioDriveLetter(void)
|
||||
@@ -129,15 +129,15 @@ cSampleManager::SetMusicFadeVolume(uint8 nVolume)
|
||||
}
|
||||
|
||||
void
|
||||
cSampleManager::SetMonoMode(uint8 nMode)
|
||||
cSampleManager::SetMonoMode(bool8 nMode)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::LoadSampleBank(uint8 nBank)
|
||||
{
|
||||
ASSERT( nBank < MAX_SFX_BANKS );
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -146,20 +146,20 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
|
||||
ASSERT( nBank < MAX_SFX_BANKS );
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
||||
{
|
||||
ASSERT( nBank < MAX_SFX_BANKS );
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||
{
|
||||
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -169,11 +169,11 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::LoadPedComment(uint32 nComment)
|
||||
{
|
||||
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int32
|
||||
@@ -210,22 +210,22 @@ cSampleManager::GetSampleLength(uint32 nSample)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool cSampleManager::UpdateReverb(void)
|
||||
bool8 cSampleManager::UpdateReverb(void)
|
||||
{
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
|
||||
cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
|
||||
{
|
||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
|
||||
{
|
||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -281,12 +281,12 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
|
||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::GetChannelUsedFlag(uint32 nChannel)
|
||||
{
|
||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -308,7 +308,7 @@ cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
|
||||
}
|
||||
|
||||
void
|
||||
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
|
||||
cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
|
||||
{
|
||||
ASSERT( nStream < MAX_STREAMS );
|
||||
}
|
||||
@@ -319,12 +319,12 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
|
||||
ASSERT( nStream < MAX_STREAMS );
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
|
||||
{
|
||||
ASSERT( nStream < MAX_STREAMS );
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -342,7 +342,7 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
|
||||
}
|
||||
|
||||
void
|
||||
cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffectFlag, uint8 nStream)
|
||||
cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, bool8 nEffectFlag, uint8 nStream)
|
||||
{
|
||||
ASSERT( nStream < MAX_STREAMS );
|
||||
}
|
||||
@@ -355,23 +355,23 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::IsStreamPlaying(uint8 nStream)
|
||||
{
|
||||
ASSERT( nStream < MAX_STREAMS );
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool
|
||||
bool8
|
||||
cSampleManager::InitialiseSampleBanks(void)
|
||||
{
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
cSampleManager::SetStreamedFileLoopFlag(uint8 nLoopFlag, uint8 nChannel)
|
||||
cSampleManager::SetStreamedFileLoopFlag(bool8 nLoopFlag, uint8 nChannel)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -54,8 +54,8 @@ enum eSound
|
||||
SOUND_49,
|
||||
SOUND_WEAPON_BAT_ATTACK,
|
||||
SOUND_WEAPON_KNIFE_ATTACK,
|
||||
SOUND_WEAPON_CHAINSAW_ATTACK,
|
||||
SOUND_WEAPON_CHAINSAW_IDLE,
|
||||
SOUND_WEAPON_CHAINSAW_ATTACK,
|
||||
SOUND_WEAPON_CHAINSAW_MADECONTACT,
|
||||
SOUND_WEAPON_SHOT_FIRED,
|
||||
SOUND_WEAPON_RELOAD,
|
||||
@@ -116,8 +116,8 @@ enum eSound
|
||||
SOUND_PED_MIAMIVICE_EXITING_CAR,
|
||||
SOUND_PED_COP_HELIPILOTPHRASE,
|
||||
SOUND_PED_PULLOUTWEAPON,
|
||||
SOUND_PED_HELI_PLAYER_FOUND = 114,
|
||||
SOUND_PED_VCPA_PLAYER_FOUND = 115,
|
||||
SOUND_PED_HELI_PLAYER_FOUND,
|
||||
SOUND_PED_VCPA_PLAYER_FOUND,
|
||||
SOUND_PED_ON_FIRE,
|
||||
SOUND_PED_AIMING,
|
||||
SOUND_PED_HANDS_UP,
|
||||
@@ -128,15 +128,15 @@ enum eSound
|
||||
SOUND_PED_CAR_JACKED,
|
||||
SOUND_PED_ROBBED,
|
||||
SOUND_PED_ACCIDENTREACTION1,
|
||||
SOUND_PED_UNK_126,
|
||||
SOUND_PED_INNOCENT,
|
||||
SOUND_PED_PLAYER_AFTERSEX,
|
||||
SOUND_PED_PLAYER_BEFORESEX,
|
||||
SOUND_PED_COP_UNK_129, // also used for medics
|
||||
SOUND_PED_COP_TARGETING, // also used for medics
|
||||
SOUND_PED_COP_MANYCOPSAROUND, // also used for medics
|
||||
SOUND_PED_GUNAIMEDAT2,
|
||||
SOUND_PED_COP_ALONE, // also used for medics
|
||||
SOUND_PED_GUNAIMEDAT3,
|
||||
SOUND_PED_COP_REACTION,
|
||||
SOUND_PED_COP_ASK_FOR_ID,
|
||||
SOUND_PED_COP_LITTLECOPSAROUND, // also used for medics
|
||||
SOUND_PED_PLAYER_FARFROMCOPS, // also used for medics
|
||||
SOUND_PED_TAXI_WAIT,
|
||||
@@ -151,12 +151,12 @@ enum eSound
|
||||
SOUND_PED_ANNOYED_DRIVER,
|
||||
SOUND_PED_147,
|
||||
SOUND_PED_SOLICIT,
|
||||
SOUND_PED_149,
|
||||
SOUND_PED_JEER,
|
||||
SOUND_PED_150,
|
||||
SOUND_PED_EXTINGUISHING_FIRE,
|
||||
SOUND_PED_WAIT_DOUBLEBACK,
|
||||
SOUND_153,
|
||||
SOUND_PED_CHAT_SEXY,
|
||||
SOUND_PED_CHAT_SEXY_FEMALE,
|
||||
SOUND_PED_CHAT_SEXY_MALE,
|
||||
SOUND_PED_CHAT_EVENT,
|
||||
SOUND_PED_PED_COLLISION,
|
||||
SOUND_PED_CHAT,
|
||||
@@ -171,22 +171,22 @@ enum eSound
|
||||
SOUND_CAR_PED_COLLISION,
|
||||
SOUND_CLOCK_TICK,
|
||||
SOUND_PART_MISSION_COMPLETE,
|
||||
SOUND_FRONTEND_MENU_STARTING, // same with SOUND_HUD_SOUND
|
||||
SOUND_FRONTEND_MENU_STARTING, // same sound as SOUND_HUD
|
||||
|
||||
// TODO(Miami): What are 170-175??
|
||||
|
||||
SOUND_FRONTEND_NO_RADIO = 176, // those 3 are all same sound
|
||||
SOUND_FRONTEND_RADIO_CHANGE,
|
||||
SOUND_FRONTEND_RADIO_CHANGE_2,
|
||||
SOUND_HUD_SOUND,
|
||||
SOUND_FRONTEND_RADIO_TURN_OFF = 176, // those 2 are same sound
|
||||
SOUND_FRONTEND_RADIO_TURN_ON,
|
||||
SOUND_FRONTEND_HURRICANE, // yes, frontend
|
||||
SOUND_HUD,
|
||||
SOUND_180,
|
||||
SOUND_181,
|
||||
SOUND_182,
|
||||
SOUND_LIGHTNING,
|
||||
SOUND_BULLETTRACE_1,
|
||||
SOUND_BULLETTRACE_2,
|
||||
SOUND_186, // makes same sound with 40
|
||||
SOUND_187, // makes same sound with 46
|
||||
SOUND_186, // makes same sound as 40
|
||||
SOUND_187, // makes same sound as 46
|
||||
SOUND_MELEE_ATTACK_START,
|
||||
SOUND_SKATING,
|
||||
SOUND_WEAPON_MINIGUN_ATTACK,
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "Streaming.h"
|
||||
#include "Pools.h"
|
||||
|
||||
void *CBuilding::operator new(size_t sz) { return CPools::GetBuildingPool()->New(); }
|
||||
void CBuilding::operator delete(void *p, size_t sz) { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
|
||||
void *CBuilding::operator new(size_t sz) throw() { return CPools::GetBuildingPool()->New(); }
|
||||
void CBuilding::operator delete(void *p, size_t sz) throw() { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
|
||||
|
||||
void
|
||||
CBuilding::ReplaceWithNewModel(int32 id)
|
||||
|
||||
@@ -9,8 +9,8 @@ public:
|
||||
m_type = ENTITY_TYPE_BUILDING;
|
||||
bUsesCollision = true;
|
||||
}
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
static void *operator new(size_t) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
|
||||
void ReplaceWithNewModel(int32 id);
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
#include "Treadable.h"
|
||||
#include "Pools.h"
|
||||
|
||||
void *CTreadable::operator new(size_t sz) { return CPools::GetTreadablePool()->New(); }
|
||||
void CTreadable::operator delete(void *p, size_t sz) { CPools::GetTreadablePool()->Delete((CTreadable*)p); }
|
||||
void *CTreadable::operator new(size_t sz) throw() { return CPools::GetTreadablePool()->New(); }
|
||||
void CTreadable::operator delete(void *p, size_t sz) throw() { CPools::GetTreadablePool()->Delete((CTreadable*)p); }
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
class CTreadable : public CBuilding
|
||||
{
|
||||
public:
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
static void *operator new(size_t) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
|
||||
bool GetIsATreadable(void) { return true; }
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ CColModel::~CColModel(void)
|
||||
|
||||
//--LCS: no pool used, but maybe we better keep it?
|
||||
void*
|
||||
CColModel::operator new(size_t)
|
||||
CColModel::operator new(size_t) throw()
|
||||
{
|
||||
CColModel* node = CPools::GetColModelPool()->New();
|
||||
assert(node);
|
||||
@@ -44,7 +44,7 @@ CColModel::operator new(size_t)
|
||||
}
|
||||
|
||||
void
|
||||
CColModel::operator delete(void *p, size_t)
|
||||
CColModel::operator delete(void *p, size_t) throw()
|
||||
{
|
||||
CPools::GetColModelPool()->Delete((CColModel*)p);
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ struct CColModel
|
||||
void SetLinkPtr(CLink<CColModel*>*);
|
||||
void GetTrianglePoint(CVector &v, int i) const;
|
||||
|
||||
void *operator new(size_t);
|
||||
void operator delete(void *p, size_t);
|
||||
void *operator new(size_t) throw();
|
||||
void operator delete(void *p, size_t) throw();
|
||||
CColModel& operator=(const CColModel& other);
|
||||
|
||||
bool Write(base::cRelocatableChunkWriter &writer, bool allocSpace);
|
||||
|
||||
@@ -148,11 +148,10 @@ CCollision::SortOutCollisionAfterLoad(void)
|
||||
void
|
||||
CCollision::LoadCollisionScreen(eLevelName level)
|
||||
{
|
||||
static Const char *levelNames[4] = {
|
||||
static Const char *levelNames[] = {
|
||||
"",
|
||||
"IND_ZON",
|
||||
"COM_ZON",
|
||||
"SUB_ZON"
|
||||
};
|
||||
|
||||
// Why twice?
|
||||
@@ -311,8 +310,16 @@ CCollision::TestLineTriangle(const CColLine &line, const CompressedVector *verts
|
||||
if(plane.CalcPoint(line.p0) * plane.CalcPoint(line.p1) > 0.0f)
|
||||
return false;
|
||||
|
||||
float p0dist = DotProduct(line.p1 - line.p0, normal);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
// line lines in the plane, assume no collision
|
||||
if (p0dist == 0.0f)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
// intersection parameter on line
|
||||
t = -plane.CalcPoint(line.p0) / DotProduct(line.p1 - line.p0, normal);
|
||||
t = -plane.CalcPoint(line.p0) / p0dist;
|
||||
// find point of intersection
|
||||
CVector p = line.p0 + (line.p1-line.p0)*t;
|
||||
|
||||
@@ -1131,8 +1138,17 @@ CCollision::ProcessLineTriangle(const CColLine &line,
|
||||
if(plane.CalcPoint(line.p0) * plane.CalcPoint(line.p1) > 0.0f)
|
||||
return false;
|
||||
|
||||
float p0dist = DotProduct(line.p1 - line.p0, normal);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
// line lines in the plane, assume no collision
|
||||
if (p0dist == 0.0f)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
// intersection parameter on line
|
||||
t = -plane.CalcPoint(line.p0) / DotProduct(line.p1 - line.p0, normal);
|
||||
t = -plane.CalcPoint(line.p0) / p0dist;
|
||||
|
||||
// early out if we're beyond the mindist
|
||||
if(t >= mindist)
|
||||
return false;
|
||||
|
||||
@@ -1603,8 +1603,8 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
|
||||
forward.Normalise();
|
||||
float forwardAngle = GetATanOfXY(forward.x, forward.y);
|
||||
float angleDiff = angleBetweenVehicles - forwardAngle;
|
||||
float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * sin(angleDiff));
|
||||
float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * cos(angleDiff));
|
||||
float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * Sin(angleDiff));
|
||||
float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * Cos(angleDiff));
|
||||
float lengthToEvade = (2 * (lenProjection + widthProjection) + WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x) / distance;
|
||||
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicles - *pAngleToWeaveLeft);
|
||||
diffToLeftAngle = ABS(diffToLeftAngle);
|
||||
@@ -2790,7 +2790,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
|
||||
up.Normalise();
|
||||
CVector forward(Cos(pPlane->m_fOrientation), Sin(pPlane->m_fOrientation), fForwardZ);
|
||||
forward.Normalise();
|
||||
CVector right = CrossProduct(forward, up);
|
||||
CVector right = CrossProduct(up, forward);
|
||||
right.z -= 5.0f * pPlane->m_fPlaneSteer;
|
||||
right.Normalise();
|
||||
up = CrossProduct(forward, right);
|
||||
@@ -3273,7 +3273,7 @@ bool CCarCtrl::GenerateOneEmergencyServicesCar(uint32 mi, CVector vecPos)
|
||||
attempts += 1;
|
||||
}
|
||||
if (attempts >= 5)
|
||||
return nil;
|
||||
return false;
|
||||
CAutomobile* pVehicle = new CAutomobile(mi, RANDOM_VEHICLE);
|
||||
pVehicle->AutoPilot.m_vecDestinationCoors = vecPos;
|
||||
pVehicle->SetPosition(spawnPos);
|
||||
|
||||
@@ -163,7 +163,7 @@ void CGarages::Init(void)
|
||||
}
|
||||
hGarages = DMAudio.CreateEntity(AUDIOTYPE_GARAGE, (void*)1);
|
||||
if (hGarages >= 0)
|
||||
DMAudio.SetEntityStatus(hGarages, true);
|
||||
DMAudio.SetEntityStatus(hGarages, TRUE);
|
||||
}
|
||||
|
||||
void CGarages::Shutdown(void)
|
||||
@@ -2357,7 +2357,11 @@ float CGarages::FindDoorHeightForMI(int32 mi)
|
||||
void CGarage::TidyUpGarage()
|
||||
{
|
||||
uint32 i = CPools::GetVehiclePool()->GetSize();
|
||||
#ifdef FIX_BUGS
|
||||
while (i--) {
|
||||
#else
|
||||
while (--i) {
|
||||
#endif
|
||||
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
|
||||
if (pVehicle && (pVehicle->IsCar() || pVehicle->IsBike())) {
|
||||
if (IsPointInsideGarage(pVehicle->GetPosition())) {
|
||||
@@ -2373,7 +2377,11 @@ void CGarage::TidyUpGarage()
|
||||
void CGarage::TidyUpGarageClose()
|
||||
{
|
||||
uint32 i = CPools::GetVehiclePool()->GetSize();
|
||||
#ifdef FIX_BUGS
|
||||
while (i--) {
|
||||
#else
|
||||
while (--i) {
|
||||
#endif
|
||||
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
|
||||
if (!pVehicle)
|
||||
continue;
|
||||
|
||||
@@ -200,8 +200,8 @@ CPedPath::AddBlockade(CEntity *pEntity, CPedPathNode(*pathNodes)[40], CVector *p
|
||||
const float fBoundMaxY = boundingBox.max.y + 0.3f;
|
||||
const float fBoundMinY = boundingBox.min.y - 0.3f;
|
||||
const float fBoundMaxX = boundingBox.max.x + 0.3f;
|
||||
const float fDistanceX = pPosition->x - pEntity->m_matrix.GetPosition().x;
|
||||
const float fDistanceY = pPosition->y - pEntity->m_matrix.GetPosition().y;
|
||||
const float fDistanceX = pPosition->x - pEntity->GetMatrix().GetPosition().x;
|
||||
const float fDistanceY = pPosition->y - pEntity->GetMatrix().GetPosition().y;
|
||||
const float fBoundRadius = pEntity->GetBoundRadius();
|
||||
CVector vecBoundCentre;
|
||||
pEntity->GetBoundCentre(vecBoundCentre);
|
||||
@@ -215,8 +215,8 @@ CPedPath::AddBlockade(CEntity *pEntity, CPedPathNode(*pathNodes)[40], CVector *p
|
||||
if (!pathNodes[x][y].bBlockade) {
|
||||
const float pointY = y * 0.7f + fDistanceY;
|
||||
CVector2D point(pointX, pointY);
|
||||
if (fBoundMaxX > Abs(DotProduct2D(point, pEntity->m_matrix.GetRight()))) {
|
||||
float fDotProduct = DotProduct2D(point, pEntity->m_matrix.GetForward());
|
||||
if (fBoundMaxX > Abs(DotProduct2D(point, pEntity->GetMatrix().GetRight()))) {
|
||||
float fDotProduct = DotProduct2D(point, pEntity->GetMatrix().GetForward());
|
||||
if (fBoundMaxY > fDotProduct && fBoundMinY < fDotProduct)
|
||||
pathNodes[x][y].bBlockade = true;
|
||||
}
|
||||
@@ -859,7 +859,7 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor
|
||||
mag = Sqrt(dx*dx + dy*dy);
|
||||
dx /= mag;
|
||||
dy /= mag;
|
||||
int width = Max(m_pathNodes[i].width, m_pathNodes[j].width);
|
||||
uint8 width = Max(m_pathNodes[i].width, m_pathNodes[j].width);
|
||||
if(i < j){
|
||||
dx = -dx;
|
||||
dy = -dy;
|
||||
|
||||
@@ -120,7 +120,7 @@ struct CCarPathLink
|
||||
uint8 trafficLightDirection : 1;
|
||||
uint8 trafficLightType : 2;
|
||||
uint8 bBridgeLights : 1; // at least in LCS...
|
||||
int8 width;
|
||||
uint8 width;
|
||||
|
||||
CVector2D GetPosition(void) { return CVector2D(x/8.0f, y/8.0f); }
|
||||
CVector2D GetDirection(void) { return CVector2D(dirX/100.0f, dirY/100.0f); }
|
||||
@@ -151,7 +151,7 @@ struct CPathInfoForObject
|
||||
int8 numLeftLanes;
|
||||
int8 numRightLanes;
|
||||
int8 speedLimit;
|
||||
int8 width;
|
||||
uint8 width;
|
||||
|
||||
uint8 crossing : 1;
|
||||
uint8 onlySmallBoats : 1;
|
||||
@@ -177,7 +177,7 @@ struct CTempNode
|
||||
int16 link2;
|
||||
int8 numLeftLanes;
|
||||
int8 numRightLanes;
|
||||
int8 width;
|
||||
uint8 width;
|
||||
bool isCross;
|
||||
int8 linkState;
|
||||
};
|
||||
@@ -188,7 +188,7 @@ struct CTempNodeExternal // made up name
|
||||
int16 next;
|
||||
int8 numLeftLanes;
|
||||
int8 numRightLanes;
|
||||
int8 width;
|
||||
uint8 width;
|
||||
bool isCross;
|
||||
};
|
||||
|
||||
|
||||
@@ -48,9 +48,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 {
|
||||
@@ -107,7 +107,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;
|
||||
@@ -363,10 +363,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;
|
||||
}
|
||||
|
||||
@@ -274,10 +274,11 @@ CPickup::CanBePickedUp(CPlayerPed *player, int playerId)
|
||||
{
|
||||
assert(m_pObject != nil);
|
||||
bool cannotBePickedUp =
|
||||
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 0.5f)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > CWorld::Players[playerId].m_nMaxHealth - 0.5f)
|
||||
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 0.2f)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > CWorld::Players[playerId].m_nMaxHealth - 0.2f)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->GetWantedLevel() == 0)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame));
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame))
|
||||
|| (m_eType == PICKUP_ASSET_REVENUE && m_fRevenue < 10.0f);
|
||||
return !cannotBePickedUp;
|
||||
}
|
||||
|
||||
@@ -1007,8 +1008,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
|
||||
entity->bDoNotRender = CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame;
|
||||
|
||||
if (!entity->bDoNotRender) {
|
||||
float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800));
|
||||
float modifiedSin = 0.3f * (s + 1.0f);
|
||||
float modifiedSin = 0.3f * (Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800)) + 1.0f);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
int16 colorId = 0;
|
||||
@@ -1148,7 +1148,20 @@ CPickups::DoPickUpEffects(CEntity *entity)
|
||||
if (model == MI_MINIGUN || model == MI_MINIGUN2)
|
||||
scale = 1.2f;
|
||||
|
||||
entity->GetMatrix().SetRotateZOnlyScaled((float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800), scale);
|
||||
float angle = (float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800);
|
||||
float c = Cos(angle) * scale;
|
||||
float s = Sin(angle) * scale;
|
||||
|
||||
// we know from SA they were setting each field manually like this
|
||||
entity->GetMatrix().rx = c;
|
||||
entity->GetMatrix().ry = s;
|
||||
entity->GetMatrix().rz = 0.0f;
|
||||
entity->GetMatrix().fx = -s;
|
||||
entity->GetMatrix().fy = c;
|
||||
entity->GetMatrix().fz = 0.0f;
|
||||
entity->GetMatrix().ux = 0.0f;
|
||||
entity->GetMatrix().uy = 0.0f;
|
||||
entity->GetMatrix().uz = scale;
|
||||
|
||||
if (entity->GetModelIndex() == MI_MINIGUN2) {
|
||||
CMatrix matrix1;
|
||||
|
||||
@@ -521,7 +521,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
|
||||
state->aFunctionCallbackID[i] = 0;
|
||||
}
|
||||
}else{
|
||||
state->aAnimId[i] = NUM_STD_ANIMS;
|
||||
state->aAnimId[i] = ANIM_STD_NUM;
|
||||
state->aCurTime[i] = 0;
|
||||
state->aSpeed[i] = 85;
|
||||
state->aFunctionCallbackID[i] = 0;
|
||||
@@ -548,7 +548,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
|
||||
}
|
||||
}
|
||||
else {
|
||||
state->aAnimId2[i] = NUM_STD_ANIMS;
|
||||
state->aAnimId2[i] = ANIM_STD_NUM;
|
||||
state->aCurTime2[i] = 0;
|
||||
state->aSpeed2[i] = 85;
|
||||
state->aFunctionCallbackID2[i] = 0;
|
||||
@@ -611,13 +611,13 @@ bool HasAnimGroupLoaded(uint8 group)
|
||||
void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
|
||||
{
|
||||
CAnimBlendAssociation* anim1;
|
||||
if (state->animId <= 3)
|
||||
if (state->animId <= ANIM_STD_IDLE)
|
||||
anim1 = CAnimManager::BlendAnimation(
|
||||
(RpClump*)ped->m_rwObject, ped->m_animGroup, (AnimationId)state->animId, 100.0f);
|
||||
else if (HasAnimGroupLoaded(state->groupId))
|
||||
anim1 = CAnimManager::BlendAnimation((RpClump*)ped->m_rwObject, (AssocGroupId)state->groupId, (AnimationId)state->animId, 100.0f);
|
||||
else
|
||||
anim1 = CAnimManager::BlendAnimation((RpClump*)ped->m_rwObject, ASSOCGRP_STD, ANIM_WALK, 100.0f);
|
||||
anim1 = CAnimManager::BlendAnimation((RpClump*)ped->m_rwObject, ASSOCGRP_STD, ANIM_STD_WALK, 100.0f);
|
||||
|
||||
anim1->SetCurrentTime(state->time * 4.0f / 255.0f);
|
||||
anim1->speed = state->speed * 3.0f / 255.0f;
|
||||
@@ -629,7 +629,7 @@ void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
|
||||
float blend = state->blendAmount * 2.0f / 255.0f;
|
||||
CAnimBlendAssociation* anim2 = CAnimManager::BlendAnimation(
|
||||
(RpClump*)ped->m_rwObject,
|
||||
(state->secAnimId > 3) ? (AssocGroupId)state->secGroupId : ped->m_animGroup,
|
||||
(state->secAnimId > ANIM_STD_IDLE) ? (AssocGroupId)state->secGroupId : ped->m_animGroup,
|
||||
(AnimationId)state->secAnimId, 100.0f);
|
||||
anim2->SetCurrentTime(time);
|
||||
anim2->speed = speed;
|
||||
@@ -641,7 +641,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 && HasAnimGroupLoaded(state->partGroupId)){
|
||||
if (blend > 0.0f && state->partAnimId != ANIM_STD_IDLE && HasAnimGroupLoaded(state->partGroupId)){
|
||||
CAnimBlendAssociation* anim3 = CAnimManager::BlendAnimation(
|
||||
(RpClump*)ped->m_rwObject, (AssocGroupId)state->partGroupId, (AnimationId)state->partAnimId, 1000.0f);
|
||||
anim3->SetCurrentTime(time);
|
||||
@@ -659,10 +659,10 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt
|
||||
for (int i = 0; ((assoc = RpAnimBlendClumpGetMainPartialAssociation_N(ped->GetClump(), i))); i++)
|
||||
assoc->SetBlend(0.0f, -1.0f);
|
||||
for (int i = 0; i < NUM_MAIN_ANIMS_IN_REPLAY; i++) {
|
||||
if (state->aAnimId[i] == NUM_STD_ANIMS)
|
||||
if (state->aAnimId[i] == ANIM_STD_NUM)
|
||||
continue;
|
||||
CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(),
|
||||
state->aAnimId[i] > 3 ? (AssocGroupId)state->aGroupId[i] : ped->m_animGroup,
|
||||
state->aAnimId[i] > ANIM_STD_IDLE ? (AssocGroupId)state->aGroupId[i] : ped->m_animGroup,
|
||||
(AnimationId)state->aAnimId[i]);
|
||||
anim->SetCurrentTime(state->aCurTime[i] * 4.0f / 255.0f);
|
||||
anim->speed = state->aSpeed[i] * 3.0f / 255.0f;
|
||||
@@ -677,10 +677,10 @@ 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_STD_ANIMS)
|
||||
if (state->aAnimId2[i] == ANIM_STD_NUM)
|
||||
continue;
|
||||
CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(),
|
||||
state->aAnimId2[i] > 3 ? (AssocGroupId)state->aGroupId2[i] : ped->m_animGroup,
|
||||
state->aAnimId2[i] > ANIM_STD_IDLE ? (AssocGroupId)state->aGroupId2[i] : ped->m_animGroup,
|
||||
(AnimationId)state->aAnimId2[i]);
|
||||
anim->SetCurrentTime(state->aCurTime2[i] * 4.0f / 255.0f);
|
||||
anim->speed = state->aSpeed2[i] * 3.0f / 255.0f;
|
||||
@@ -1463,7 +1463,7 @@ void CReplay::RestoreStuffFromMem(void)
|
||||
ped->SetModelIndex(mi);
|
||||
ped->m_pVehicleAnim = nil;
|
||||
ped->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, ped);
|
||||
DMAudio.SetEntityStatus(ped->m_audioEntityId, true);
|
||||
DMAudio.SetEntityStatus(ped->m_audioEntityId, TRUE);
|
||||
CPopulation::UpdatePedCount((ePedType)ped->m_nPedType, false);
|
||||
for (int j = 0; j < TOTAL_WEAPON_SLOTS; j++) {
|
||||
int mi1 = CWeaponInfo::GetWeaponInfo(ped->m_weapons[j].m_eWeaponType)->m_nModelId;
|
||||
@@ -1529,7 +1529,7 @@ void CReplay::RestoreStuffFromMem(void)
|
||||
car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true);
|
||||
}
|
||||
vehicle->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, vehicle);
|
||||
DMAudio.SetEntityStatus(vehicle->m_audioEntityId, true);
|
||||
DMAudio.SetEntityStatus(vehicle->m_audioEntityId, TRUE);
|
||||
CCarCtrl::UpdateCarCount(vehicle, false);
|
||||
if ((mi == MI_AIRTRAIN || mi == MI_DEADDODO) && vehicle->m_rwObject){
|
||||
CVehicleModelInfo* info = (CVehicleModelInfo*)CModelInfo::GetModelInfo(mi);
|
||||
|
||||
@@ -64,7 +64,7 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
|
||||
float fRadius = pVehicle->GetBoundRadius() / pPoliceColModel->boundingSphere.radius;
|
||||
for (int32 i = 0; i < 2; i++) {
|
||||
const int32 roadBlockIndex = i + 2 * roadBlockType;
|
||||
CVector posForZ = pVehicle->m_matrix * (fRadius * vecRoadBlockOffets[roadBlockIndex]);
|
||||
CVector posForZ = pVehicle->GetMatrix() * (fRadius * vecRoadBlockOffets[roadBlockIndex]);
|
||||
int32 modelInfoId = MI_COP;
|
||||
eCopType copType = COP_STREET;
|
||||
switch (pVehicle->GetModelIndex())
|
||||
@@ -239,10 +239,10 @@ CRoadBlocks::CreateRoadBlockBetween2Points(CVector point1, CVector point2)
|
||||
pVehicle->SetStatus(STATUS_ABANDONED);
|
||||
// pVehicle->GetHeightAboveRoad(); // called but return value is ignored?
|
||||
tmp.GetPosition().z += fModelRadius - 0.6f;
|
||||
pVehicle->m_matrix = tmp;
|
||||
pVehicle->SetMatrix(tmp);
|
||||
pVehicle->PlaceOnRoadProperly();
|
||||
pVehicle->SetIsStatic(false);
|
||||
pVehicle->m_matrix.UpdateRW();
|
||||
pVehicle->GetMatrix().UpdateRW();
|
||||
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
|
||||
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
||||
pVehicle->bIsLocked = false;
|
||||
|
||||
@@ -2104,7 +2104,7 @@ void CMissionCleanup::Process()
|
||||
CWorld::Players[0].m_bDriveByAllowed = true;
|
||||
CPad::GetPad(0)->unk_B4 = 1.0f;
|
||||
CPad::GetPad(0)->unk_B8 = 0.5f;
|
||||
DMAudio.ShutUpPlayerTalking(0);
|
||||
DMAudio.ShutUpPlayerTalking(FALSE);
|
||||
CVehicle::bDisableRemoteDetonation = false;
|
||||
CVehicle::bDisableRemoteDetonationOnContact = false;
|
||||
CTheScripts::RiotIntensity = 0;
|
||||
@@ -5165,7 +5165,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, 1000.0f);
|
||||
CAnimManager::BlendAnimation(pPlayer->m_pPed->GetClump(), pPlayer->m_pPed->m_animGroup, ANIM_STD_IDLE, 1000.0f);
|
||||
pPlayer->m_pPed->RestartNonPartialAnims();
|
||||
AudioManager.PlayerJustLeftCar();
|
||||
pos.z += pPlayer->m_pPed->GetDistanceFromCentreOfMassToBaseOfModel();
|
||||
|
||||
@@ -278,7 +278,7 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command)
|
||||
CollectParameters(&m_nIp, 3);
|
||||
CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0));
|
||||
if (pPed)
|
||||
pPed->SetWaitState((eWaitState)GET_INTEGER_PARAM(0), GET_INTEGER_PARAM(1) >= 0 ? (void*)GET_INTEGER_PARAM(0) : nil); // + true
|
||||
pPed->SetWaitState((eWaitState)GET_INTEGER_PARAM(1), GET_INTEGER_PARAM(2) >= 0 ? (void*)GET_INTEGER_PARAM(2) : nil, true);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_REGISTER_BEST_TIME_GOGO_FAGGIO:
|
||||
|
||||
@@ -467,8 +467,8 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
|
||||
float length = GET_FLOAT_PARAM(5);
|
||||
float x, y;
|
||||
if (angle != 0.0f){
|
||||
y = cos(angle) * length;
|
||||
x = sin(angle) * length;
|
||||
y = Cos(angle) * length;
|
||||
x = Sin(angle) * length;
|
||||
}else{
|
||||
y = length;
|
||||
x = 0.0f;
|
||||
|
||||
@@ -817,7 +817,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
|
||||
}
|
||||
}
|
||||
pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags;
|
||||
pPed->m_pMyVehicle->ProcessOpenDoor(pPed->m_vehDoor, NUM_STD_ANIMS, 0.0f);
|
||||
pPed->m_pMyVehicle->ProcessOpenDoor(pPed->m_vehDoor, ANIM_STD_NUM, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -834,7 +834,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, 1000.0f);
|
||||
CAnimManager::BlendAnimation(pPed->GetClump(), pPed->m_animGroup, ANIM_STD_IDLE, 1000.0f);
|
||||
pos.z += pPed->GetDistanceFromCentreOfMassToBaseOfModel();
|
||||
pPed->Teleport(pos);
|
||||
CTheScripts::ClearSpaceForMissionEntity(pos, pPed);
|
||||
@@ -1396,7 +1396,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||
{
|
||||
CollectParameters(&m_nIp, 1);
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
|
||||
DMAudio.PlayFrontEndTrack(GET_INTEGER_PARAM(0) + STREAMED_SOUND_MISSION_COMPLETED - 1, 0);
|
||||
DMAudio.PlayFrontEndTrack(GET_INTEGER_PARAM(0) + STREAMED_SOUND_MISSION_COMPLETED - 1, FALSE);
|
||||
//DMAudio.SaveAnnouncementsWhenMissionPassedPlayed(); // TODO!
|
||||
return 0;
|
||||
}
|
||||
@@ -2012,8 +2012,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||
case COMMAND_HAS_MISSION_AUDIO_LOADED:
|
||||
{
|
||||
CollectParameters(&m_nIp, 1);
|
||||
//UpdateCompareFlag(DMAudio.GetMissionAudioLoadingStatus(GET_INTEGER_PARAM(0) - 1) == 1);
|
||||
UpdateCompareFlag(true); // TODO
|
||||
UpdateCompareFlag(DMAudio.GetMissionAudioLoadingStatus(GET_INTEGER_PARAM(0) - 1) == 1);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_PLAY_MISSION_AUDIO:
|
||||
@@ -2023,8 +2022,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||
case COMMAND_HAS_MISSION_AUDIO_FINISHED:
|
||||
{
|
||||
CollectParameters(&m_nIp, 1);
|
||||
//UpdateCompareFlag(DMAudio.IsMissionAudioSampleFinished(GET_INTEGER_PARAM(0) - 1)); // TODO
|
||||
UpdateCompareFlag(true);
|
||||
UpdateCompareFlag(DMAudio.IsMissionAudioSampleFinished(GET_INTEGER_PARAM(0) - 1));
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING:
|
||||
|
||||
@@ -1002,10 +1002,10 @@ void CRunningScript::PlayerInAngledAreaCheckCommand(int32 command, uint32* pIp)
|
||||
initAngle -= TWOPI;
|
||||
// it looks like the idea is to use a rectangle using the diagonal of the rectangle as
|
||||
// the side of new rectangle, with "length" being the length of second side
|
||||
float rotatedSupX = supX + side2length * sin(initAngle);
|
||||
float rotatedSupY = supY - side2length * cos(initAngle);
|
||||
float rotatedInfX = infX + side2length * sin(initAngle);
|
||||
float rotatedInfY = infY - side2length * cos(initAngle);
|
||||
float rotatedSupX = supX + side2length * Sin(initAngle);
|
||||
float rotatedSupY = supY - side2length * Cos(initAngle);
|
||||
float rotatedInfX = infX + side2length * Sin(initAngle);
|
||||
float rotatedInfY = infY - side2length * Cos(initAngle);
|
||||
float side1X = supX - infX;
|
||||
float side1Y = supY - infY;
|
||||
float side1Length = CVector2D(side1X, side1Y).Magnitude();
|
||||
@@ -2674,10 +2674,10 @@ bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer)
|
||||
CPed* pPed = pPlayer->m_pPed;
|
||||
if (pPed->InVehicle())
|
||||
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) &&
|
||||
!pPed->bIsInTheAir && !pPed->bIsLanding && pPed->bIsStanding && pPed->m_vecAnimMoveDelta.x == 0.0f && pPed->m_vecAnimMoveDelta.y == 0.0f;
|
||||
|
||||
@@ -452,12 +452,12 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
|
||||
CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0));
|
||||
script_assert(pPed);
|
||||
if (GET_INTEGER_PARAM(1)) {
|
||||
pPed->bIsDucking = true;
|
||||
pPed->bCrouchWhenShooting = true;
|
||||
pPed->SetDuck(GET_INTEGER_PARAM(2), true);
|
||||
}
|
||||
else {
|
||||
pPed->ClearDuck(true);
|
||||
pPed->bIsDucking = false;
|
||||
pPed->bCrouchWhenShooting = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -771,7 +771,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
|
||||
CHud::SetHelpMessage(text, false, true); // + true
|
||||
if (text != CHud::gLastPrintForeverString) {
|
||||
CHud::gLastPrintForeverString = text;
|
||||
DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0);
|
||||
DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
|
||||
((CPlayerPed*)pPed)->m_fMoveSpeed = 0.0f;
|
||||
else
|
||||
pPed->m_nStoredMoveState = PEDMOVE_STILL;
|
||||
CAnimManager::AddAnimation(pPed->GetClump(), pPed->m_animGroup, ANIM_IDLE_STANCE);
|
||||
CAnimManager::AddAnimation(pPed->GetClump(), pPed->m_animGroup, ANIM_STD_IDLE);
|
||||
pPed->bIsPedDieAnimPlaying = false;
|
||||
}
|
||||
return 0;
|
||||
@@ -346,7 +346,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
|
||||
CollectParameters(&m_nIp, 1);
|
||||
CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0));
|
||||
script_assert(pPed);
|
||||
UpdateCompareFlag(RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_DUCK_DOWN) != nil);
|
||||
UpdateCompareFlag(RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_DUCK_DOWN) != nil);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI:
|
||||
@@ -386,7 +386,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
|
||||
}
|
||||
case COMMAND_IS_JAPANESE_GAME:
|
||||
#ifdef MORE_LANGUAGES
|
||||
UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_JAPANESE);
|
||||
UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_JAPANESE);
|
||||
#elif (defined GTAVC_JP_PATCH)
|
||||
UpdateCompareFlag(true);
|
||||
#else
|
||||
|
||||
@@ -453,8 +453,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command)
|
||||
CollectParameters(&m_nIp, 1);
|
||||
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0));
|
||||
assert(pVehicle);
|
||||
pVehicle->ProcessOpenDoor(CAR_DOOR_RR, ANIM_VAN_OPEN, 1.0f);
|
||||
pVehicle->ProcessOpenDoor(CAR_DOOR_LR, ANIM_VAN_OPEN_L, 1.0f);
|
||||
pVehicle->ProcessOpenDoor(CAR_DOOR_RR, ANIM_STD_VAN_OPEN_DOOR_REAR_RHS, 1.0f);
|
||||
pVehicle->ProcessOpenDoor(CAR_DOOR_LR, ANIM_STD_VAN_OPEN_DOOR_REAR_LHS, 1.0f);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_GET_CHAR_THREAT_CHAR:
|
||||
@@ -568,11 +568,11 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command)
|
||||
}
|
||||
case COMMAND_LOAD_NON_STANDARD_PED_ANIM:
|
||||
CollectParameters(&m_nIp, 1);
|
||||
// CPed::LoadNonStandardPedAnim(GET_INTEGER_PARAM(0));
|
||||
CPed::LoadNonStandardPedAnim((eWaitState)GET_INTEGER_PARAM(0));
|
||||
return 0;
|
||||
case COMMAND_UNLOAD_NON_STANDARD_PED_ANIM:
|
||||
CollectParameters(&m_nIp, 1);
|
||||
// CPed::UnloadNonStandardPedAnim(SET_INTEGER_PARAM(0));
|
||||
CPed::UnloadNonStandardPedAnim((eWaitState)GET_INTEGER_PARAM(0));
|
||||
return 0;
|
||||
case COMMAND_1566:
|
||||
CollectParameters(&m_nIp, 1);
|
||||
|
||||
@@ -260,8 +260,8 @@ void CSetPiece::Update(void)
|
||||
CCarAI::AddPoliceCarOccupants(pVehicle1);
|
||||
CVehicle* pVehicle2 = TryToGenerateCopCar(m_vSpawn2, m_vTarget2);
|
||||
if (!pVehicle2) {
|
||||
CWorld::Remove(pVehicle2);
|
||||
delete pVehicle2;
|
||||
CWorld::Remove(pVehicle1);
|
||||
delete pVehicle1;
|
||||
return;
|
||||
}
|
||||
pVehicle2->SetStatus(STATUS_PHYSICS);
|
||||
|
||||
@@ -245,7 +245,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) {
|
||||
@@ -334,14 +334,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_STD_ANIMS - 1;
|
||||
animId = ANIM_STD_NUM - 1;
|
||||
}
|
||||
PlayAnimation(pTarget->GetClump(), animGroup, (AnimationId)animId);
|
||||
|
||||
@@ -350,7 +350,7 @@ CAnimViewer::Update(void)
|
||||
CMessages::AddMessage(gUString, 1000, 0);
|
||||
|
||||
} else if (pad->GetDPadDownJustDown()) {
|
||||
animId = (animId == (NUM_STD_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);
|
||||
|
||||
@@ -4956,9 +4956,9 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
||||
AlphaSpeed = 0.0;
|
||||
Distance = 1000.0;
|
||||
|
||||
Front.x = -(cos(Beta) * cos(Alpha));
|
||||
Front.y = -(sin(Beta) * cos(Alpha));
|
||||
Front.z = sin(Alpha);
|
||||
Front.x = -(Cos(Beta) * Cos(Alpha));
|
||||
Front.y = -(Sin(Beta) * Cos(Alpha));
|
||||
Front.z = Sin(Alpha);
|
||||
|
||||
m_aTargetHistoryPosOne = TargetCoors - nextDistance * Front;
|
||||
|
||||
@@ -5232,9 +5232,9 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
||||
|
||||
lastBeta = Beta;
|
||||
|
||||
Front.x = -(cos(Beta) * cos(Alpha));
|
||||
Front.y = -(sin(Beta) * cos(Alpha));
|
||||
Front.z = sin(Alpha);
|
||||
Front.x = -(Cos(Beta) * Cos(Alpha));
|
||||
Front.y = -(Sin(Beta) * Cos(Alpha));
|
||||
Front.z = Sin(Alpha);
|
||||
GetVectorsReadyForRW();
|
||||
TheCamera.m_bCamDirectlyBehind = false;
|
||||
TheCamera.m_bCamDirectlyInFront = false;
|
||||
@@ -5244,9 +5244,9 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
||||
m_cvecTargetCoorsForFudgeInter = TargetCoors;
|
||||
m_aTargetHistoryPosThree = m_aTargetHistoryPosOne;
|
||||
float nextAlpha = alphaWithSpeedAccounted + zoomModeAlphaOffset;
|
||||
float nextFrontX = -(cos(Beta) * cos(nextAlpha));
|
||||
float nextFrontY = -(sin(Beta) * cos(nextAlpha));
|
||||
float nextFrontZ = sin(nextAlpha);
|
||||
float nextFrontX = -(Cos(Beta) * Cos(nextAlpha));
|
||||
float nextFrontY = -(Sin(Beta) * Cos(nextAlpha));
|
||||
float nextFrontZ = Sin(nextAlpha);
|
||||
|
||||
m_aTargetHistoryPosOne.x = TargetCoors.x - nextFrontX * nextDistance;
|
||||
m_aTargetHistoryPosOne.y = TargetCoors.y - nextFrontY * nextDistance;
|
||||
@@ -5399,7 +5399,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
||||
|
||||
float alphaToFace = Atan2(hi.z, hi.Magnitude2D()) + DEGTORAD(15.0f);
|
||||
float neededAlphaTurn = alphaToFace - carGunUD;
|
||||
float alphaTurnPerFrame = CTimer::GetTimeStep() * 0.02f;
|
||||
float alphaTurnPerFrame = CTimer::GetTimeStepInSeconds();
|
||||
|
||||
if (neededAlphaTurn > alphaTurnPerFrame) {
|
||||
neededTurn = alphaTurnPerFrame;
|
||||
|
||||
@@ -214,7 +214,7 @@ CCamera::Init(void)
|
||||
m_iModeToGoTo = CCam::MODE_FOLLOWPED;
|
||||
m_bJust_Switched = false;
|
||||
m_bUseTransitionBeta = false;
|
||||
m_matrix.SetScale(1.0f);
|
||||
GetMatrix().SetScale(1.0f);
|
||||
m_bTargetJustBeenOnTrain = false;
|
||||
m_bInitialNoNodeStaticsSet = false;
|
||||
m_uiLongestTimeInMill = 5000;
|
||||
@@ -1769,7 +1769,7 @@ CCamera::CamControl(void)
|
||||
(m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) &&
|
||||
!m_WideScreenOn &&
|
||||
(WhoIsInControlOfTheCamera != CAMCONTROL_OBBE || bSwitchedToObbeCam))
|
||||
DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0);
|
||||
DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
|
||||
}
|
||||
|
||||
// What a mess!
|
||||
@@ -4019,7 +4019,7 @@ CCamera::SetRwCamera(RwCamera *cam)
|
||||
void
|
||||
CCamera::CalculateDerivedValues(void)
|
||||
{
|
||||
m_cameraMatrix = Invert(m_matrix);
|
||||
m_cameraMatrix = Invert(GetMatrix());
|
||||
|
||||
float hfov = DEGTORAD(CDraw::GetScaledFOV()/2.0f);
|
||||
float c = Cos(hfov);
|
||||
@@ -4103,16 +4103,11 @@ CCamera::IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat
|
||||
bool
|
||||
CCamera::IsSphereVisible(const CVector ¢er, float radius)
|
||||
{
|
||||
CMatrix mat = m_cameraMatrix;
|
||||
return IsSphereVisible(center, radius, &mat);
|
||||
return IsSphereVisible(center, radius, &GetCameraMatrix());
|
||||
}
|
||||
|
||||
bool
|
||||
#ifdef GTA_PS2
|
||||
CCamera::IsBoxVisible(CVuVector *box, const CMatrix *mat)
|
||||
#else
|
||||
CCamera::IsBoxVisible(CVector *box, const CMatrix *mat)
|
||||
#endif
|
||||
CCamera::IsBoxVisible(CVUVECTOR *box, const CMatrix *mat)
|
||||
{
|
||||
int i;
|
||||
int frustumTests[6] = { 0 };
|
||||
|
||||
@@ -634,11 +634,7 @@ public:
|
||||
bool IsPointVisible(const CVector ¢er, const CMatrix *mat);
|
||||
bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat);
|
||||
bool IsSphereVisible(const CVector ¢er, float radius);
|
||||
#ifdef GTA_PS2
|
||||
bool IsBoxVisible(CVuVector *box, const CMatrix *mat);
|
||||
#else
|
||||
bool IsBoxVisible(CVector *box, const CMatrix *mat);
|
||||
#endif
|
||||
bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat);
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CCamera, 0xE9D8);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,6 @@ char *CdStreamGetImageName(int32 cd);
|
||||
void CdStreamRemoveImages(void);
|
||||
int32 CdStreamGetNumImages(void);
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
extern bool flushStream[MAX_CDCHANNELS];
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef _WIN32
|
||||
#include "common.h"
|
||||
#include "crossplatform.h"
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
@@ -12,7 +12,11 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/resource.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
|
||||
#include "CdStream.h"
|
||||
#include "rwcore.h"
|
||||
@@ -21,9 +25,61 @@
|
||||
#define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
|
||||
#define CDTRACE(f, ...) printf("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
|
||||
|
||||
// #define ONE_THREAD_PER_CHANNEL // Don't use if you're not on SSD/Flash. (Also you may want to benefit from this via using all channels in Streaming.cpp)
|
||||
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
bool flushStream[MAX_CDCHANNELS];
|
||||
#endif
|
||||
|
||||
#ifdef USE_UNNAMED_SEM
|
||||
|
||||
#define RE3_SEM_OPEN(name, ...) re3_sem_open()
|
||||
sem_t*
|
||||
re3_sem_open(void)
|
||||
{
|
||||
sem_t* sem = (sem_t*)malloc(sizeof(sem_t));
|
||||
if (sem_init(sem, 0, 1) == -1) {
|
||||
sem = SEM_FAILED;
|
||||
}
|
||||
|
||||
return sem;
|
||||
}
|
||||
|
||||
#define RE3_SEM_CLOSE(sem, format, ...) re3_sem_close(sem)
|
||||
void
|
||||
re3_sem_close(sem_t* sem)
|
||||
{
|
||||
sem_destroy(sem);
|
||||
free(sem);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define RE3_SEM_OPEN re3_sem_open
|
||||
sem_t*
|
||||
re3_sem_open(const char* format, ...)
|
||||
{
|
||||
char semName[21];
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
vsprintf(semName, format, va);
|
||||
|
||||
return sem_open(semName, O_CREAT, 0644, 1);
|
||||
}
|
||||
|
||||
#define RE3_SEM_CLOSE re3_sem_close
|
||||
void
|
||||
re3_sem_close(sem_t* sem, const char* format, ...)
|
||||
{
|
||||
sem_close(sem);
|
||||
|
||||
char semName[21];
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
vsprintf(semName, format, va);
|
||||
|
||||
sem_unlink(semName);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct CdReadInfo
|
||||
{
|
||||
@@ -69,14 +125,13 @@ void
|
||||
CdStreamInitThread(void)
|
||||
{
|
||||
int status;
|
||||
char semName[20];
|
||||
#ifndef ONE_THREAD_PER_CHANNEL
|
||||
gChannelRequestQ.items = (int32 *)calloc(gNumChannels + 1, sizeof(int32));
|
||||
gChannelRequestQ.head = 0;
|
||||
gChannelRequestQ.tail = 0;
|
||||
gChannelRequestQ.size = gNumChannels + 1;
|
||||
ASSERT(gChannelRequestQ.items != nil );
|
||||
gCdStreamSema = sem_open("/semaphore_cd_stream", O_CREAT, 0644, 1);
|
||||
gCdStreamSema = RE3_SEM_OPEN("/semaphore_cd_stream");
|
||||
|
||||
|
||||
if (gCdStreamSema == SEM_FAILED) {
|
||||
@@ -90,8 +145,7 @@ CdStreamInitThread(void)
|
||||
{
|
||||
for ( int32 i = 0; i < gNumChannels; i++ )
|
||||
{
|
||||
sprintf(semName,"/semaphore_done%d",i);
|
||||
gpReadInfo[i].pDoneSemaphore = sem_open(semName, O_CREAT, 0644, 1);
|
||||
gpReadInfo[i].pDoneSemaphore = RE3_SEM_OPEN("/semaphore_done%d", i);
|
||||
|
||||
if (gpReadInfo[i].pDoneSemaphore == SEM_FAILED)
|
||||
{
|
||||
@@ -99,9 +153,9 @@ CdStreamInitThread(void)
|
||||
ASSERT(0);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ONE_THREAD_PER_CHANNEL
|
||||
sprintf(semName,"/semaphore_start%d",i);
|
||||
gpReadInfo[i].pStartSemaphore = sem_open(semName, O_CREAT, 0644, 1);
|
||||
gpReadInfo[i].pStartSemaphore = RE3_SEM_OPEN("/semaphore_start%d", i);
|
||||
|
||||
if (gpReadInfo[i].pStartSemaphore == SEM_FAILED)
|
||||
{
|
||||
@@ -170,6 +224,7 @@ CdStreamInit(int32 numChannels)
|
||||
gNumImages = 0;
|
||||
|
||||
gNumChannels = numChannels;
|
||||
ASSERT( gNumChannels != 0 );
|
||||
|
||||
gpReadInfo = (CdReadInfo *)calloc(numChannels, sizeof(CdReadInfo));
|
||||
ASSERT( gpReadInfo != nil );
|
||||
@@ -245,10 +300,12 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
|
||||
if ( pChannel->nSectorsToRead != 0 || pChannel->bReading ) {
|
||||
if (pChannel->hFile == hImage - 1 && pChannel->nSectorOffset == _GET_OFFSET(offset) && pChannel->nSectorsToRead >= size)
|
||||
return STREAM_SUCCESS;
|
||||
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
flushStream[channel] = 1;
|
||||
CdStreamSync(channel);
|
||||
//return STREAM_NONE;
|
||||
#else
|
||||
return STREAM_NONE;
|
||||
#endif
|
||||
}
|
||||
|
||||
pChannel->hFile = hImage - 1;
|
||||
@@ -316,34 +373,34 @@ CdStreamSync(int32 channel)
|
||||
CdReadInfo *pChannel = &gpReadInfo[channel];
|
||||
ASSERT( pChannel != nil );
|
||||
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
if (flushStream[channel]) {
|
||||
#ifdef ONE_THREAD_PER_CHANNEL
|
||||
pChannel->nSectorsToRead = 0;
|
||||
#ifdef ONE_THREAD_PER_CHANNEL
|
||||
pthread_kill(pChannel->pChannelThread, SIGUSR1);
|
||||
if (pChannel->bReading) {
|
||||
pChannel->bLocked = true;
|
||||
while (pChannel->bLocked)
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
}
|
||||
#else
|
||||
pChannel->nSectorsToRead = 0;
|
||||
if (pChannel->bReading) {
|
||||
pChannel->bLocked = true;
|
||||
pthread_kill(_gCdStreamThread, SIGUSR1);
|
||||
#endif
|
||||
while (pChannel->bLocked)
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
}
|
||||
#endif
|
||||
pChannel->bReading = false;
|
||||
flushStream[channel] = false;
|
||||
return STREAM_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( pChannel->nSectorsToRead != 0 )
|
||||
{
|
||||
pChannel->bLocked = true;
|
||||
while (pChannel->bLocked)
|
||||
while (pChannel->bLocked && pChannel->nSectorsToRead != 0){
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
}
|
||||
pChannel->bLocked = false;
|
||||
}
|
||||
|
||||
pChannel->bReading = false;
|
||||
@@ -395,7 +452,12 @@ void *CdStreamThread(void *param)
|
||||
#ifndef ONE_THREAD_PER_CHANNEL
|
||||
while (gCdStreamThreadStatus != 2) {
|
||||
sem_wait(gCdStreamSema);
|
||||
|
||||
int32 channel = GetFirstInQueue(&gChannelRequestQ);
|
||||
|
||||
// spurious wakeup
|
||||
if (channel == -1)
|
||||
continue;
|
||||
#else
|
||||
int channel = *((int*)param);
|
||||
while (gpReadInfo[channel].nThreadStatus != 2){
|
||||
@@ -447,7 +509,7 @@ void *CdStreamThread(void *param)
|
||||
if ( pChannel->bLocked )
|
||||
{
|
||||
pChannel->bLocked = 0;
|
||||
sem_post(pChannel->pDoneSemaphore);
|
||||
sem_post(pChannel->pDoneSemaphore);
|
||||
}
|
||||
pChannel->bReading = false;
|
||||
}
|
||||
@@ -455,21 +517,14 @@ void *CdStreamThread(void *param)
|
||||
#ifndef ONE_THREAD_PER_CHANNEL
|
||||
for ( int32 i = 0; i < gNumChannels; i++ )
|
||||
{
|
||||
sem_close(gpReadInfo[i].pDoneSemaphore);
|
||||
sprintf(semName,"/semaphore_done%d",i);
|
||||
sem_unlink(semName);
|
||||
RE3_SEM_CLOSE(gpReadInfo[i].pDoneSemaphore, "/semaphore_done%d", i);
|
||||
}
|
||||
sem_close(gCdStreamSema);
|
||||
sem_unlink("/semaphore_cd_stream");
|
||||
RE3_SEM_CLOSE(gCdStreamSema, "/semaphore_cd_stream");
|
||||
free(gChannelRequestQ.items);
|
||||
#else
|
||||
sem_close(gpReadInfo[channel].pStartSemaphore);
|
||||
sprintf(semName,"/semaphore_start%d",channel);
|
||||
sem_unlink(semName);
|
||||
RE3_SEM_CLOSE(gpReadInfo[channel].pStartSemaphore, "/semaphore_start%d", channel);
|
||||
|
||||
sem_close(gpReadInfo[channel].pDoneSemaphore);
|
||||
sprintf(semName,"/semaphore_done%d",channel);
|
||||
sem_unlink(semName);
|
||||
RE3_SEM_CLOSE(gpReadInfo[channel].pDoneSemaphore, "/semaphore_done%d", channel);
|
||||
#endif
|
||||
if (gpReadInfo)
|
||||
free(gpReadInfo);
|
||||
@@ -524,7 +579,9 @@ void
|
||||
CdStreamRemoveImages(void)
|
||||
{
|
||||
for ( int32 i = 0; i < gNumChannels; i++ ) {
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
flushStream[i] = 1;
|
||||
#endif
|
||||
CdStreamSync(i);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,9 @@ void CControllerConfigManager::LoadSettings(int32 file)
|
||||
{
|
||||
bool bValid = true;
|
||||
int nVersion = 0;
|
||||
#ifdef BIND_VEHICLE_FIREWEAPON
|
||||
bool skipVehicleFireWeapon = false;
|
||||
#endif
|
||||
|
||||
if (file)
|
||||
{
|
||||
@@ -148,11 +151,26 @@ void CControllerConfigManager::LoadSettings(int32 file)
|
||||
if (bValid && nVersion >= 3)
|
||||
{
|
||||
ControlsManager.MakeControllerActionsBlank();
|
||||
#ifdef BIND_VEHICLE_FIREWEAPON
|
||||
skipVehicleFireWeapon = nVersion < 4;
|
||||
// Set the default settings of VEHICLE_FIREWEAPON
|
||||
if (skipVehicleFireWeapon) {
|
||||
SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, rsPADINS, KEYBOARD);
|
||||
SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, rsLCTRL, OPTIONAL_EXTRA);
|
||||
if (m_bMouseAssociated)
|
||||
SetMouseButtonAssociatedWithAction(VEHICLE_FIREWEAPON, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int32 i = 0; i < MAX_CONTROLLERTYPES; i++)
|
||||
{
|
||||
for (int32 j = 0; j < MAX_CONTROLLERACTIONS; j++)
|
||||
{
|
||||
#ifdef BIND_VEHICLE_FIREWEAPON
|
||||
// Skip file read
|
||||
if (skipVehicleFireWeapon && j == VEHICLE_FIREWEAPON)
|
||||
continue;
|
||||
#endif
|
||||
CFileMgr::Read(file, (char *)&ControlsManager.m_aSettings[j][i], sizeof(tControllerConfigBind));
|
||||
}
|
||||
}
|
||||
@@ -326,6 +344,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;
|
||||
@@ -1765,6 +1788,51 @@ void CControllerConfigManager::DeleteMatching1rstPersonControls(e_ControllerActi
|
||||
|
||||
#undef CLEAR_ACTION_IF_NEEDED
|
||||
|
||||
#ifdef RADIO_SCROLL_TO_PREV_STATION
|
||||
#define CHECK_ACTION(action) \
|
||||
if (key == GetControllerKeyAssociatedWithAction(action, type))\
|
||||
return true;
|
||||
|
||||
bool CControllerConfigManager::IsAnyVehicleActionAssignedToMouseKey(int32 key)
|
||||
{
|
||||
const eControllerType type = MOUSE;
|
||||
if (!GetIsKeyBlank(key, type))
|
||||
{
|
||||
#ifdef BIND_VEHICLE_FIREWEAPON
|
||||
CHECK_ACTION(VEHICLE_FIREWEAPON);
|
||||
#endif
|
||||
CHECK_ACTION(VEHICLE_LOOKBEHIND);
|
||||
CHECK_ACTION(VEHICLE_LOOKLEFT);
|
||||
CHECK_ACTION(VEHICLE_LOOKRIGHT);
|
||||
CHECK_ACTION(VEHICLE_HORN);
|
||||
CHECK_ACTION(VEHICLE_HANDBRAKE);
|
||||
CHECK_ACTION(VEHICLE_ACCELERATE);
|
||||
CHECK_ACTION(VEHICLE_BRAKE);
|
||||
CHECK_ACTION(VEHICLE_CHANGE_RADIO_STATION);
|
||||
CHECK_ACTION(TOGGLE_SUBMISSIONS);
|
||||
CHECK_ACTION(VEHICLE_TURRETLEFT);
|
||||
CHECK_ACTION(VEHICLE_TURRETRIGHT);
|
||||
CHECK_ACTION(VEHICLE_TURRETUP);
|
||||
CHECK_ACTION(VEHICLE_TURRETDOWN);
|
||||
CHECK_ACTION(VEHICLE_ENTER_EXIT);
|
||||
CHECK_ACTION(CAMERA_CHANGE_VIEW_ALL_SITUATIONS);
|
||||
#ifndef BIND_VEHICLE_FIREWEAPON
|
||||
CHECK_ACTION(PED_FIREWEAPON);
|
||||
#endif
|
||||
CHECK_ACTION(GO_LEFT);
|
||||
CHECK_ACTION(GO_RIGHT);
|
||||
CHECK_ACTION(NETWORK_TALK);
|
||||
CHECK_ACTION(SWITCH_DEBUG_CAM_ON);
|
||||
CHECK_ACTION(TOGGLE_DPAD);
|
||||
CHECK_ACTION(TAKE_SCREEN_SHOT);
|
||||
CHECK_ACTION(SHOW_MOUSE_POINTER_TOGGLE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#undef CHECK_ACTION
|
||||
#endif
|
||||
|
||||
void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction action, int32 key, eControllerType type)
|
||||
{
|
||||
if (!GetIsKeyBlank(key, type))
|
||||
@@ -2371,7 +2439,7 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
|
||||
#define VFB(b)
|
||||
#endif
|
||||
|
||||
#define CONTROLLER_BUTTONS(T, O, X, Q, L1, L2, L3, R1, R2, R3, SELECT, RSL, RSR) \
|
||||
#define CONTROLLER_BUTTONS(T, O, X, Q, L1, L2, L3, R1, R2, R3, SELECT, RSU, RSD, RSL, RSR) \
|
||||
{{ \
|
||||
O, /* PED_FIREWEAPON */ \
|
||||
R2, /* PED_CYCLE_WEAPON_RIGHT */ \
|
||||
@@ -2482,7 +2550,7 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
|
||||
O, /* PED_SPRINT */ \
|
||||
R3, /* PED_LOOKBEHIND */ \
|
||||
L3, /* PED_DUCK */ \
|
||||
L1, /* PED_ANSWER_PHONE */ \
|
||||
T, /* PED_ANSWER_PHONE */ \
|
||||
VFB(O) /* VEHICLE_FIREWEAPON */ \
|
||||
X, /* VEHICLE_ACCELERATE */ \
|
||||
Q, /* VEHICLE_BRAKE */ \
|
||||
@@ -2529,10 +2597,10 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
|
||||
X, /* PED_SPRINT */ \
|
||||
R3, /* PED_LOOKBEHIND */ \
|
||||
L3, /* PED_DUCK */ \
|
||||
L1, /* PED_ANSWER_PHONE */ \
|
||||
O, /* PED_ANSWER_PHONE */ \
|
||||
VFB(R1) /* VEHICLE_FIREWEAPON */ \
|
||||
nil, /* VEHICLE_ACCELERATE */ \
|
||||
nil, /* VEHICLE_BRAKE */ \
|
||||
RSU, /* VEHICLE_ACCELERATE */ \
|
||||
RSD, /* VEHICLE_BRAKE */ \
|
||||
O, /* VEHICLE_CHANGE_RADIO_STATION */ \
|
||||
L3, /* VEHICLE_HORN */ \
|
||||
Q, /* TOGGLE_SUBMISSIONS */ \
|
||||
@@ -2573,10 +2641,10 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
|
||||
#define RIGHT "RIGHT"
|
||||
#endif
|
||||
|
||||
const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK", "right stick left", "right stick right");
|
||||
const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK", "right stick up", "right stick down", "right stick left", "right stick right");
|
||||
|
||||
#ifdef BUTTON_ICONS
|
||||
const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK", "~(~", "~)~");
|
||||
const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK", "~H~", "~L~", "~(~", "~)~");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2585,11 +2653,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"
|
||||
@@ -2598,11 +2661,11 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
|
||||
#endif
|
||||
|
||||
const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] =
|
||||
CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT", "right stick left", "right stick right");
|
||||
CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT", "right stick up", "right stick down", "right stick left", "right stick right");
|
||||
|
||||
#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", "~H~", "~L~", "~(~", "~)~");
|
||||
#endif
|
||||
|
||||
#undef PS2_TRIANGLE
|
||||
@@ -2624,11 +2687,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
|
||||
|
||||
@@ -195,6 +195,10 @@ public:
|
||||
void DeleteMatching1rstPersonControls (e_ControllerAction action, int32 key, eControllerType type);
|
||||
void DeleteMatchingActionInitiators (e_ControllerAction action, int32 key, eControllerType type);
|
||||
|
||||
#ifdef RADIO_SCROLL_TO_PREV_STATION
|
||||
bool IsAnyVehicleActionAssignedToMouseKey(int32 key);
|
||||
#endif
|
||||
|
||||
bool GetIsKeyBlank(int32 key, eControllerType type);
|
||||
e_ControllerActionType GetActionType(e_ControllerAction action);
|
||||
|
||||
|
||||
@@ -1279,7 +1279,7 @@ CFileLoader::LoadObjectInstance(const char *line)
|
||||
if(!CStreaming::IsObjectInCdImage(id))
|
||||
debug("Not in cdimage %s\n", mi->GetModelName());
|
||||
|
||||
angle = -RADTODEG(2.0f * acosf(angle));
|
||||
angle = -RADTODEG(2.0f * Acos(angle));
|
||||
xform = RwMatrixCreate();
|
||||
RwMatrixRotate(xform, &axis, angle, rwCOMBINEREPLACE);
|
||||
RwMatrixTranslate(xform, &trans, rwCOMBINEPOSTCONCAT);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -137,6 +137,13 @@ enum eMenuSprites
|
||||
MENUSPRITE_DOWNON,
|
||||
MENUSPRITE_UPOFF,
|
||||
MENUSPRITE_UPON,
|
||||
#ifdef GAMEPAD_MENU
|
||||
MENUSPRITE_CONTROLLER,
|
||||
MENUSPRITE_ARROWS1,
|
||||
MENUSPRITE_ARROWS2,
|
||||
MENUSPRITE_ARROWS3,
|
||||
MENUSPRITE_ARROWS4,
|
||||
#endif
|
||||
NUM_MENU_SPRITES
|
||||
};
|
||||
|
||||
@@ -192,8 +199,10 @@ enum eMenuScreen
|
||||
MENUPAGE_MOUSE_CONTROLS = 31,
|
||||
MENUPAGE_PAUSE_MENU = 32,
|
||||
MENUPAGE_NONE = 33, // Then chooses main menu or pause menu
|
||||
#ifdef LEGACY_MENU_OPTIONS
|
||||
#ifdef GAMEPAD_MENU
|
||||
MENUPAGE_CONTROLLER_SETTINGS,
|
||||
#endif
|
||||
#ifdef LEGACY_MENU_OPTIONS
|
||||
MENUPAGE_DEBUG_MENU,
|
||||
MENUPAGE_CONTROLLER_PC_OLD1,
|
||||
MENUPAGE_CONTROLLER_PC_OLD2,
|
||||
@@ -206,7 +215,7 @@ enum eMenuScreen
|
||||
#ifdef GRAPHICS_MENU_OPTIONS
|
||||
MENUPAGE_GRAPHICS_SETTINGS,
|
||||
#endif
|
||||
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
|
||||
#ifdef DETECT_JOYSTICK_MENU
|
||||
MENUPAGE_DETECT_JOYSTICK,
|
||||
#endif
|
||||
|
||||
@@ -275,7 +284,7 @@ enum eMenuAction
|
||||
MENUACTION_DRAWDIST,
|
||||
MENUACTION_MOUSESENS,
|
||||
MENUACTION_MP3VOLUMEBOOST,
|
||||
#ifdef LEGACY_MENU_OPTIONS
|
||||
#ifdef GAMEPAD_MENU
|
||||
MENUACTION_CTRLVIBRATION,
|
||||
MENUACTION_CTRLCONFIG,
|
||||
#endif
|
||||
@@ -668,6 +677,18 @@ public:
|
||||
int8 m_nDisplayMSAALevel;
|
||||
#endif
|
||||
|
||||
#ifdef GAMEPAD_MENU
|
||||
enum
|
||||
{
|
||||
CONTROLLER_DUALSHOCK2 = 0,
|
||||
CONTROLLER_DUALSHOCK3,
|
||||
CONTROLLER_DUALSHOCK4,
|
||||
CONTROLLER_XBOX360,
|
||||
CONTROLLER_XBOXONE,
|
||||
};
|
||||
|
||||
int8 m_PrefsControllerType;
|
||||
#endif
|
||||
enum LANGUAGE
|
||||
{
|
||||
LANGUAGE_AMERICAN,
|
||||
@@ -714,7 +735,7 @@ public:
|
||||
|
||||
#ifdef XBOX_MESSAGE_SCREEN
|
||||
static uint32 m_nDialogHideTimer;
|
||||
static PauseModeTime m_nDialogHideTimerPauseMode;
|
||||
static uint32 m_nDialogHideTimerPauseMode;
|
||||
static bool m_bDialogOpen;
|
||||
static wchar *m_pDialogText;
|
||||
static bool m_bSaveWasSuccessful;
|
||||
@@ -788,6 +809,10 @@ public:
|
||||
int8 GetPreviousPageOption();
|
||||
|
||||
// uint8 GetNumberOfMenuOptions();
|
||||
#ifdef GAMEPAD_MENU
|
||||
void LoadController(int8 type);
|
||||
void PrintController(void);
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
|
||||
@@ -779,7 +779,7 @@ TriggerAudio_RadioStation(CMenuMultiChoicePicturedTriggered *widget)
|
||||
if ( CMenuManager::m_PrefsRadioStation != widget->GetMenuSelection() )
|
||||
{
|
||||
CMenuManager::m_PrefsRadioStation = widget->GetMenuSelection();
|
||||
DMAudio.PlayFrontEndTrack(CMenuManager::m_PrefsRadioStation, 1);
|
||||
DMAudio.PlayFrontEndTrack(CMenuManager::m_PrefsRadioStation, TRUE);
|
||||
DMAudio.SetRadioInCar(CMenuManager::m_PrefsRadioStation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2858,7 +2858,7 @@ CMenuManager::ProcessDPadCrossJustDown(void)
|
||||
{
|
||||
if ( !gMusicPlaying )
|
||||
{
|
||||
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
|
||||
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
|
||||
gMusicPlaying = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,10 +246,16 @@ CGame::InitialiseRenderWare(void)
|
||||
|
||||
#ifdef LIBRW
|
||||
#ifdef PS2_MATFX
|
||||
rw::MatFX::modulateEnvMap = true;
|
||||
rw::MatFX::envMapApplyLight = true;
|
||||
rw::MatFX::envMapUseMatColor = true;
|
||||
rw::MatFX::envMapFlipU = true;
|
||||
#else
|
||||
rw::MatFX::modulateEnvMap = false;
|
||||
rw::MatFX::envMapApplyLight = false;
|
||||
rw::MatFX::envMapUseMatColor = false;
|
||||
rw::MatFX::envMapFlipU = false;
|
||||
#endif
|
||||
rw::RGBA envcol = { 64, 64, 64, 255 };
|
||||
rw::MatFX::envMapColor = envcol;
|
||||
#else
|
||||
#ifdef PS2_MATFX
|
||||
ReplaceMatFxCallback();
|
||||
@@ -385,6 +391,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");
|
||||
@@ -444,10 +455,7 @@ bool CGame::Initialise(const char* datFile)
|
||||
|
||||
// CFileLoader::LoadLevel("DATA\\DEFAULT.DAT");
|
||||
CFileLoader::LoadLevel(datFile);
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
// for generic fallback
|
||||
CustomPipes::SetTxdFindCallback();
|
||||
#endif
|
||||
|
||||
LoadingScreen("Loading the Game", "Add Particles", nil);
|
||||
CWorld::AddParticles();
|
||||
CVehicleModelInfo::LoadVehicleColours();
|
||||
@@ -574,7 +582,7 @@ bool CGame::Initialise(const char* datFile)
|
||||
#endif
|
||||
|
||||
|
||||
DMAudio.SetStartingTrackPositions(true);
|
||||
DMAudio.SetStartingTrackPositions(TRUE);
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
|
||||
return true;
|
||||
}
|
||||
@@ -596,7 +604,6 @@ bool CGame::ShutDown(void)
|
||||
gPhoneInfo.Shutdown();
|
||||
CWeapon::ShutdownWeapons();
|
||||
CPedType::Shutdown();
|
||||
CMBlur::MotionBlurClose();
|
||||
|
||||
for (int32 i = 0; i < NUMPLAYERS; i++)
|
||||
{
|
||||
@@ -622,7 +629,7 @@ bool CGame::ShutDown(void)
|
||||
CStreaming::Shutdown();
|
||||
CTxdStore::GameShutdown();
|
||||
CCollision::Shutdown();
|
||||
CWaterLevel::DestroyWavyAtomic();
|
||||
CWaterLevel::Shutdown();
|
||||
CRubbish::Shutdown();
|
||||
CClouds::Shutdown();
|
||||
CShadows::Shutdown();
|
||||
@@ -631,6 +638,7 @@ bool CGame::ShutDown(void)
|
||||
CWeaponEffects::Shutdown();
|
||||
CParticle::Shutdown();
|
||||
CPools::ShutDown();
|
||||
CHud::ReInitialise();
|
||||
CTxdStore::RemoveTxdSlot(gameTxdSlot);
|
||||
CMBlur::MotionBlurClose();
|
||||
CdStreamRemoveImages();
|
||||
|
||||
@@ -277,13 +277,6 @@ CMenuScreen aScreens[] = {
|
||||
{ "", 0, 0, },
|
||||
|
||||
#ifdef LEGACY_MENU_OPTIONS
|
||||
// MENUPAGE_CONTROLLER_SETTINGS
|
||||
{ "FET_CON", MENUPAGE_OPTIONS, 0,
|
||||
MENUACTION_CTRLCONFIG, "FEC_CCF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS, 0, 0, 0,
|
||||
MENUACTION_CTRLVIBRATION, "FEC_VIB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS, 0, 0, 0,
|
||||
MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0,
|
||||
},
|
||||
|
||||
// MENUPAGE_DEBUG_MENU
|
||||
{ "FED_DBG", MENUPAGE_NONE, 0,
|
||||
MENUACTION_RELOADIDE, "FED_RID", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0,
|
||||
|
||||
@@ -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"
|
||||
@@ -69,11 +78,17 @@
|
||||
#endif
|
||||
|
||||
#ifdef INVERT_LOOK_FOR_PAD
|
||||
#define INVERT_PAD_SELECTOR MENUACTION_CFO_SELECT, "FEC_ILU", { new CCFOSelect((int8*)&CPad::bInvertLook4Pad, "Controller", "InvertPad", off_on, 2, false) }, 150, 0, MENUALIGN_LEFT,
|
||||
#define INVERT_PAD_SELECTOR MENUACTION_CFO_SELECT, "FEC_ILU", { new CCFOSelect((int8*)&CPad::bInvertLook4Pad, "Controller", "InvertPad", off_on, 2, false) }, 0, 0, MENUALIGN_LEFT,
|
||||
#else
|
||||
#define INVERT_PAD_SELECTOR
|
||||
#endif
|
||||
|
||||
#ifdef GAMEPAD_MENU
|
||||
#define SELECT_CONTROLLER_TYPE MENUACTION_CFO_SELECT, "FEC_TYP", { new CCFOSelect((int8*)&FrontEndMenuManager.m_PrefsControllerType, "Controller", "Type", controllerTypes, ARRAY_SIZE(controllerTypes), false, ControllerTypeAfterChange) }, 0, 0, MENUALIGN_LEFT,
|
||||
#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" };
|
||||
|
||||
@@ -166,38 +181,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() {
|
||||
}
|
||||
@@ -277,11 +260,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;
|
||||
@@ -312,6 +297,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);
|
||||
@@ -332,6 +348,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[] = {
|
||||
// MENUPAGE_STATS = 0
|
||||
{ "FEH_STA", MENUPAGE_NONE, nil, nil,
|
||||
@@ -415,11 +439,6 @@ CMenuScreenCustom aScreens[] = {
|
||||
MENUACTION_LANG_GER, "FEL_GER", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_LANG_ITA, "FEL_ITA", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_LANG_SPA, "FEL_SPA", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
#ifdef MORE_LANGUAGES
|
||||
MENUACTION_CFO_DYNAMIC, "FEL_POL", { new CCFODynamic(nil, nil, nil, nil, LangPolSelect) }, 0, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_CFO_DYNAMIC, "FEL_RUS", { new CCFODynamic(nil, nil, nil, nil, LangRusSelect) }, 0, 0, MENUALIGN_CENTER
|
||||
MENUACTION_CFO_DYNAMIC, "FEL_JAP", { new CCFODynamic(nil, nil, nil, nil, LangJapSelect) }, 0, 0, MENUALIGN_CENTER,
|
||||
#endif
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, MENUALIGN_CENTER,
|
||||
},
|
||||
|
||||
@@ -567,11 +586,13 @@ CMenuScreenCustom aScreens[] = {
|
||||
#else
|
||||
MENUACTION_KEYBOARDCTRLS,"FEC_RED", {nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS}, 320, 150, MENUALIGN_CENTER,
|
||||
#endif
|
||||
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
|
||||
#ifdef GAMEPAD_MENU
|
||||
MENUACTION_CHANGEMENU, "FET_AGS", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
#endif
|
||||
#ifdef DETECT_JOYSTICK_MENU
|
||||
MENUACTION_CHANGEMENU, "FEC_JOD", {nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK}, 0, 0, MENUALIGN_CENTER,
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FEC_MOU", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_CENTER,
|
||||
INVERT_PAD_SELECTOR
|
||||
MENUACTION_RESTOREDEF, "FET_DEF", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC}, 320, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 0, MENUALIGN_CENTER,
|
||||
},
|
||||
@@ -582,7 +603,7 @@ CMenuScreenCustom aScreens[] = {
|
||||
MENUACTION_LOADRADIO, "FEO_AUD", {nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_CHANGEMENU, "FEO_DIS", {nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
#ifdef GRAPHICS_MENU_OPTIONS
|
||||
MENUACTION_CHANGEMENU, "FET_GRA", {nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_CHANGEMENU, "FET_GFX", {nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FEO_LAN", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
|
||||
MENUACTION_PLAYERSETUP, "FET_PS", {nil, SAVESLOT_NONE, MENUPAGE_SKIN_SELECT}, 0, 0, MENUALIGN_CENTER,
|
||||
@@ -611,8 +632,12 @@ CMenuScreenCustom aScreens[] = {
|
||||
{ "FEC_MOU", MENUPAGE_CONTROLLER_PC, nil, nil,
|
||||
MENUACTION_MOUSESENS, "FEC_MSH", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 40, 170, MENUALIGN_LEFT,
|
||||
MENUACTION_INVVERT, "FEC_IVV", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_LEFT,
|
||||
#ifndef GAMEPAD_MENU
|
||||
INVERT_PAD_SELECTOR
|
||||
#endif
|
||||
MENUACTION_MOUSESTEER, "FET_MST", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 260, MENUALIGN_CENTER,
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 0, MENUALIGN_CENTER,
|
||||
//MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 260, MENUALIGN_CENTER, // original y
|
||||
},
|
||||
|
||||
// MENUPAGE_PAUSE_MENU = 32
|
||||
@@ -629,15 +654,17 @@ CMenuScreenCustom aScreens[] = {
|
||||
// MENUPAGE_NONE = 33
|
||||
{ "", 0, nil, nil, },
|
||||
|
||||
|
||||
#ifdef GAMEPAD_MENU
|
||||
{ "FET_AGS", MENUPAGE_CONTROLLER_PC, new CCustomScreenLayout({40, 78, 25, true, true}), nil,
|
||||
MENUACTION_CTRLCONFIG, "FEC_CCF", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, 40, 76, MENUALIGN_LEFT,
|
||||
MENUACTION_CTRLDISPLAY, "FEC_CDP", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, 0, 0, MENUALIGN_LEFT,
|
||||
INVERT_PAD_SELECTOR
|
||||
MENUACTION_CTRLVIBRATION, "FEC_VIB", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, 0, 0, MENUALIGN_LEFT,
|
||||
SELECT_CONTROLLER_TYPE
|
||||
MENUACTION_GOBACK, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, 0, 0, MENUALIGN_LEFT,
|
||||
},
|
||||
#endif
|
||||
#ifdef LEGACY_MENU_OPTIONS
|
||||
// MENUPAGE_CONTROLLER_SETTINGS = 4
|
||||
{ "FET_CON", MENUPAGE_OPTIONS, nil, nil,
|
||||
MENUACTION_CTRLCONFIG, "FEC_CCF", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS}, 0, 0, 0,
|
||||
MENUACTION_CTRLVIBRATION, "FEC_VIB", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS}, 0, 0, 0,
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, 0,
|
||||
},
|
||||
|
||||
// MENUPAGE_DEBUG_MENU = 18
|
||||
{ "FED_DBG", MENUPAGE_NONE, nil, nil,
|
||||
MENUACTION_RELOADIDE, "FED_RID", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, 0,
|
||||
@@ -692,7 +719,7 @@ CMenuScreenCustom aScreens[] = {
|
||||
|
||||
#ifdef GRAPHICS_MENU_OPTIONS
|
||||
// MENUPAGE_GRAPHICS_SETTINGS
|
||||
{ "FET_GRA", MENUPAGE_OPTIONS, new CCustomScreenLayout({40, 78, 25, true, true}), GraphicsGoBack,
|
||||
{ "FET_GFX", MENUPAGE_OPTIONS, new CCustomScreenLayout({40, 78, 25, true, true}), GraphicsGoBack,
|
||||
|
||||
MENUACTION_SCREENRES, "FED_RES", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_WIDESCREEN, "FED_WIS", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, 0, 0, MENUALIGN_LEFT,
|
||||
@@ -715,7 +742,7 @@ CMenuScreenCustom aScreens[] = {
|
||||
},
|
||||
#endif
|
||||
|
||||
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
|
||||
#ifdef DETECT_JOYSTICK_MENU
|
||||
// MENUPAGE_DETECT_JOYSTICK
|
||||
{ "FEC_JOD", MENUPAGE_CONTROLLER_PC, new CCustomScreenLayout({0, 0, 0, false, false, 30}), DetectJoystickGoBack,
|
||||
MENUACTION_LABEL, "FEC_JPR", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, 0, 0, 0,
|
||||
|
||||
@@ -1594,8 +1594,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)
|
||||
|
||||
@@ -288,6 +288,8 @@ public:
|
||||
int16 GetSkipCutscene() { return GetCrossJustDown(); }
|
||||
|
||||
#ifdef XINPUT
|
||||
static int XInputJoy1;
|
||||
static int XInputJoy2;
|
||||
void AffectFromXinput(uint32 pad);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
class CPlaceable
|
||||
{
|
||||
protected:
|
||||
CMatrix m_matrix;
|
||||
|
||||
public:
|
||||
// disable allocation
|
||||
static void *operator new(size_t);
|
||||
|
||||
CMatrix m_matrix;
|
||||
|
||||
CPlaceable(void);
|
||||
const CVector &GetPosition(void) { return m_matrix.GetPosition(); }
|
||||
void SetPosition(float x, float y, float z) {
|
||||
@@ -20,6 +21,7 @@ public:
|
||||
CVector &GetForward(void) { return m_matrix.GetForward(); }
|
||||
CVector &GetUp(void) { return m_matrix.GetUp(); }
|
||||
CMatrix &GetMatrix(void) { return m_matrix; }
|
||||
void SetMatrix(CMatrix &newMatrix) { m_matrix = newMatrix; }
|
||||
void SetTransform(RwMatrix *m) { m_matrix = CMatrix(m, false); }
|
||||
void SetHeading(float angle);
|
||||
void SetOrientation(float x, float y, float z){
|
||||
|
||||
@@ -105,7 +105,7 @@ CPools::CheckPoolsEmpty()
|
||||
printf("pools have been cleared\n");
|
||||
}
|
||||
|
||||
|
||||
// Thankfully unused, it would break the game!
|
||||
void
|
||||
CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
|
||||
{
|
||||
|
||||
@@ -239,6 +239,75 @@ void GetTextureCorners(int32 x, int32 y, CVector2D *out)
|
||||
out[3].y = RADAR_TILE_SIZE * (y);
|
||||
}
|
||||
|
||||
uint8 CRadar::CalculateBlipAlpha(float dist)
|
||||
{
|
||||
if (FrontEndMenuManager.m_bMenuMapActive)
|
||||
return 255;
|
||||
|
||||
if (dist <= 1.0f)
|
||||
return 255;
|
||||
|
||||
if (dist <= 10.0f)
|
||||
return (128.0f * ((dist - 1.0f) / 9.0f)) + ((1.0f - (dist - 1.0f) / 9.0f) * 255.0f);
|
||||
|
||||
return 128;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipBrightness(int32 i, int32 bright)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_bDim = bright != 1;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipColour(int32 i, int32 color)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_nColor = color;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipDisplay(int32 i, eBlipDisplay display)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_eBlipDisplay = display;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipScale(int32 i, int32 scale)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_wScale = scale;
|
||||
}
|
||||
|
||||
void CRadar::ClearBlip(int32 i)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1) {
|
||||
SetRadarMarkerState(index, false);
|
||||
ms_RadarTrace[index].m_bInUse = false;
|
||||
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
|
||||
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void CRadar::ClearBlipForEntity(eBlipType type, int32 id)
|
||||
{
|
||||
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
||||
if (type == ms_RadarTrace[i].m_eBlipType && id == ms_RadarTrace[i].m_nEntityHandle) {
|
||||
SetRadarMarkerState(i, false);
|
||||
ms_RadarTrace[i].m_bInUse = false;
|
||||
ms_RadarTrace[i].m_eBlipType = BLIP_NONE;
|
||||
ms_RadarTrace[i].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||
ms_RadarTrace[i].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Why not a proper clipping algorithm?
|
||||
#ifdef THIS_IS_STUPID
|
||||
|
||||
bool IsPointInsideRadar(const CVector2D &point)
|
||||
{
|
||||
@@ -319,74 +388,6 @@ int LineRadarBoxCollision(CVector2D &out, const CVector2D &p1, const CVector2D &
|
||||
return edge;
|
||||
}
|
||||
|
||||
uint8 CRadar::CalculateBlipAlpha(float dist)
|
||||
{
|
||||
if (FrontEndMenuManager.m_bMenuMapActive)
|
||||
return 255;
|
||||
|
||||
if (dist <= 1.0f)
|
||||
return 255;
|
||||
|
||||
if (dist <= 10.0f)
|
||||
return (128.0f * ((dist - 1.0f) / 9.0f)) + ((1.0f - (dist - 1.0f) / 9.0f) * 255.0f);
|
||||
|
||||
return 128;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipBrightness(int32 i, int32 bright)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_bDim = bright != 1;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipColour(int32 i, int32 color)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_nColor = color;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipDisplay(int32 i, eBlipDisplay display)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_eBlipDisplay = display;
|
||||
}
|
||||
|
||||
void CRadar::ChangeBlipScale(int32 i, int32 scale)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1)
|
||||
ms_RadarTrace[index].m_wScale = scale;
|
||||
}
|
||||
|
||||
void CRadar::ClearBlip(int32 i)
|
||||
{
|
||||
int index = GetActualBlipArrayIndex(i);
|
||||
if (index != -1) {
|
||||
SetRadarMarkerState(index, false);
|
||||
ms_RadarTrace[index].m_bInUse = false;
|
||||
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
|
||||
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void CRadar::ClearBlipForEntity(eBlipType type, int32 id)
|
||||
{
|
||||
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
||||
if (type == ms_RadarTrace[i].m_eBlipType && id == ms_RadarTrace[i].m_nEntityHandle) {
|
||||
SetRadarMarkerState(i, false);
|
||||
ms_RadarTrace[i].m_bInUse = false;
|
||||
ms_RadarTrace[i].m_eBlipType = BLIP_NONE;
|
||||
ms_RadarTrace[i].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||
ms_RadarTrace[i].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Why not a proper clipping algorithm?
|
||||
int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
||||
{
|
||||
CVector2D corners[4] = {
|
||||
@@ -465,6 +466,50 @@ int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
||||
|
||||
return n;
|
||||
}
|
||||
#else
|
||||
|
||||
int
|
||||
ClipPolyPlane(const CVector2D *in, int nin, CVector2D *out, CVector *plane)
|
||||
{
|
||||
int j;
|
||||
int nout;
|
||||
int x1, x2;
|
||||
float d1, d2, t;
|
||||
|
||||
nout = 0;
|
||||
for(j = 0; j < nin; j++){
|
||||
x1 = j;
|
||||
x2 = (j+1) % nin;
|
||||
|
||||
d1 = plane->x*in[x1].x + plane->y*in[x1].y + plane->z;
|
||||
d2 = plane->x*in[x2].x + plane->y*in[x2].y + plane->z;
|
||||
if(d1*d2 < 0.0f){
|
||||
t = d1/(d1 - d2);
|
||||
out[nout++] = in[x1]*(1.0f-t) + in[x2]*t;
|
||||
}
|
||||
if(d2 >= 0.0f)
|
||||
out[nout++] = in[x2];
|
||||
}
|
||||
return nout;
|
||||
}
|
||||
|
||||
int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
||||
{
|
||||
CVector planes[4] = {
|
||||
CVector(-1.0f, 0.0f, 1.0f),
|
||||
CVector( 1.0f, 0.0f, 1.0f),
|
||||
CVector(0.0f, -1.0f, 1.0f),
|
||||
CVector(0.0f, 1.0f, 1.0f)
|
||||
};
|
||||
CVector2D tmp[8];
|
||||
int n;
|
||||
if(n = ClipPolyPlane(rect, 4, tmp, &planes[0]), n == 0) return 0;
|
||||
if(n = ClipPolyPlane(tmp, n, poly, &planes[1]), n == 0) return 0;
|
||||
if(n = ClipPolyPlane(poly, n, tmp, &planes[2]), n == 0) return 0;
|
||||
if(n = ClipPolyPlane(tmp, n, poly, &planes[3]), n == 0) return 0;
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool CRadar::DisplayThisBlip(int32 counter)
|
||||
{
|
||||
@@ -488,7 +533,7 @@ void CRadar::Draw3dMarkers()
|
||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||
CVector pos = entity->GetPosition();
|
||||
pos.z += 1.2f * CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 2.5f;
|
||||
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 2.5f, CARBLIP_MARKER_COLOR_R, CARBLIP_MARKER_COLOR_G, CARBLIP_MARKER_COLOR_B, CARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
|
||||
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), MARKERTYPE_ARROW, pos, 2.5f, CARBLIP_MARKER_COLOR_R, CARBLIP_MARKER_COLOR_G, CARBLIP_MARKER_COLOR_B, CARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -502,7 +547,7 @@ void CRadar::Draw3dMarkers()
|
||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||
CVector pos = entity->GetPosition();
|
||||
pos.z += 3.0f;
|
||||
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.5f, CHARBLIP_MARKER_COLOR_R, CHARBLIP_MARKER_COLOR_G, CHARBLIP_MARKER_COLOR_B, CHARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
|
||||
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), MARKERTYPE_ARROW, pos, 1.5f, CHARBLIP_MARKER_COLOR_R, CHARBLIP_MARKER_COLOR_G, CHARBLIP_MARKER_COLOR_B, CHARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -512,7 +557,7 @@ void CRadar::Draw3dMarkers()
|
||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||
CVector pos = entity->GetPosition();
|
||||
pos.z += CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 1.0f + 1.0f;
|
||||
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.0f, OBJECTBLIP_MARKER_COLOR_R, OBJECTBLIP_MARKER_COLOR_G, OBJECTBLIP_MARKER_COLOR_B, OBJECTBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
|
||||
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), MARKERTYPE_ARROW, pos, 1.0f, OBJECTBLIP_MARKER_COLOR_R, OBJECTBLIP_MARKER_COLOR_G, OBJECTBLIP_MARKER_COLOR_B, OBJECTBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -521,7 +566,7 @@ void CRadar::Draw3dMarkers()
|
||||
case BLIP_CONTACT_POINT:
|
||||
if (!CTheScripts::IsPlayerOnAMission()) {
|
||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY)
|
||||
C3dMarkers::PlaceMarkerSet(i | (ms_RadarTrace[i].m_BlipIndex << 16), 4, ms_RadarTrace[i].m_vecPos, 2.0f, COORDBLIP_MARKER_COLOR_R, COORDBLIP_MARKER_COLOR_G, COORDBLIP_MARKER_COLOR_B, COORDBLIP_MARKER_COLOR_A, 2048, 0.2f, 0);
|
||||
C3dMarkers::PlaceMarkerSet(i | (ms_RadarTrace[i].m_BlipIndex << 16), MARKERTYPE_CYLINDER, ms_RadarTrace[i].m_vecPos, 2.0f, COORDBLIP_MARKER_COLOR_R, COORDBLIP_MARKER_COLOR_G, COORDBLIP_MARKER_COLOR_B, COORDBLIP_MARKER_COLOR_A, 2048, 0.2f, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -879,7 +924,7 @@ int32 CRadar::GetNewUniqueBlipIndex(int32 i)
|
||||
|
||||
uint32 CRadar::GetRadarTraceColour(uint32 color, bool bright)
|
||||
{
|
||||
int32 c;
|
||||
uint32 c;
|
||||
switch (color) {
|
||||
case RADAR_TRACE_RED:
|
||||
if (bright)
|
||||
@@ -1458,7 +1503,7 @@ CRadar::InitFrontEndMap()
|
||||
void
|
||||
CRadar::DrawYouAreHereSprite(float x, float y)
|
||||
{
|
||||
static PauseModeTime lastChange = 0;
|
||||
static uint32 lastChange = 0;
|
||||
static bool show = true;
|
||||
|
||||
if (show) {
|
||||
@@ -1658,7 +1703,7 @@ void
|
||||
CRadar::DrawLegend(int32 x, int32 y, int32 sprite)
|
||||
{
|
||||
if (sprite < 0) {
|
||||
static PauseModeTime lastChange = 0;
|
||||
static uint32 lastChange = 0;
|
||||
static int8 blipMode = 0;
|
||||
|
||||
CRGBA color;
|
||||
|
||||
@@ -39,9 +39,7 @@ CEntity::RegisterReference(CEntity **pent)
|
||||
ref->pentity = pent;
|
||||
ref->next = m_pFirstReference;
|
||||
m_pFirstReference = ref;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up the reference from *pent -> 'this'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "Timer.h"
|
||||
#include "ModelIndices.h"
|
||||
#include "Streaming.h"
|
||||
@@ -91,9 +92,11 @@ void
|
||||
CRopes::Render(void)
|
||||
{
|
||||
int i;
|
||||
PUSH_RENDERGROUP("CRopes::Render");
|
||||
for(i = 0; i < ARRAY_SIZE(aRopes); i++)
|
||||
if(aRopes[i].m_bActive)
|
||||
aRopes[i].Render();
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -167,7 +170,7 @@ CRopes::CreateRopeWithSwatComingDown(CVector pos)
|
||||
swat->bUsesCollision = false;
|
||||
swat->m_pRopeEntity = (CEntity*)1;
|
||||
swat->m_nRopeID = 100 + ropeId;
|
||||
CAnimManager::BlendAnimation(swat->GetClump(), ASSOCGRP_STD, ANIM_ABSEIL, 4.0f);
|
||||
CAnimManager::BlendAnimation(swat->GetClump(), ASSOCGRP_STD, ANIM_STD_ABSEIL, 4.0f);
|
||||
ropeId++;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -214,11 +214,15 @@ CStreaming::Init2(void)
|
||||
|
||||
// allocate streaming buffers
|
||||
if(ms_streamingBufferSize & 1) ms_streamingBufferSize++;
|
||||
#ifndef ONE_THREAD_PER_CHANNEL
|
||||
ms_pStreamingBuffer[0] = (int8*)RwMallocAlign(ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE, CDSTREAM_SECTOR_SIZE);
|
||||
ms_streamingBufferSize /= 2;
|
||||
ms_pStreamingBuffer[1] = ms_pStreamingBuffer[0] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
|
||||
#ifdef ONE_THREAD_PER_CHANNEL
|
||||
ms_pStreamingBuffer[2] = (int8*)RwMallocAlign(ms_streamingBufferSize*2*CDSTREAM_SECTOR_SIZE, CDSTREAM_SECTOR_SIZE);
|
||||
#else
|
||||
ms_pStreamingBuffer[0] = (int8*)RwMallocAlign(ms_streamingBufferSize*2*CDSTREAM_SECTOR_SIZE, CDSTREAM_SECTOR_SIZE);
|
||||
ms_streamingBufferSize /= 2;
|
||||
ms_pStreamingBuffer[1] = ms_pStreamingBuffer[0] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
|
||||
ms_pStreamingBuffer[2] = ms_pStreamingBuffer[1] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
|
||||
ms_pStreamingBuffer[3] = ms_pStreamingBuffer[2] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
|
||||
#endif
|
||||
debug("Streaming buffer size is %d sectors", ms_streamingBufferSize);
|
||||
@@ -1759,7 +1763,13 @@ CStreaming::StreamVehiclesAndPeds(void)
|
||||
for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){
|
||||
if(CCarCtrl::NumRequestsOfCarRating[i] > maxReq &&
|
||||
((i == 0 && zone.carThreshold[0] != 0) ||
|
||||
#ifdef FIX_BUGS
|
||||
(i < CCarCtrl::NUM_CAR_CLASSES && zone.carThreshold[i] != zone.carThreshold[i-1]) ||
|
||||
(i == CCarCtrl::NUM_CAR_CLASSES && zone.boatThreshold[i - CCarCtrl::NUM_CAR_CLASSES] != 0) ||
|
||||
(i > CCarCtrl::NUM_CAR_CLASSES && i < CCarCtrl::TOTAL_CUSTOM_CLASSES && zone.boatThreshold[i - CCarCtrl::NUM_CAR_CLASSES] != zone.boatThreshold[i - CCarCtrl::NUM_CAR_CLASSES - 1]))) {
|
||||
#else
|
||||
(i != 0 && zone.carThreshold[i] != zone.carThreshold[i-1]))) {
|
||||
#endif
|
||||
maxReq = CCarCtrl::NumRequestsOfCarRating[i];
|
||||
mostRequestedRating = i;
|
||||
}
|
||||
@@ -1902,8 +1912,7 @@ CStreaming::RemoveCurrentZonesModels(void)
|
||||
if (ms_currentPedGrp != -1)
|
||||
for (i = 0; i < NUMMODELSPERPEDGROUP; i++) {
|
||||
ms_bIsPedFromPedGroupLoaded[i] = false;
|
||||
if (CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != -1 &&
|
||||
CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != MI_MALE01) {
|
||||
if (CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != -1) {
|
||||
SetModelIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]);
|
||||
SetModelTxdIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]);
|
||||
}
|
||||
@@ -2344,9 +2353,10 @@ CStreaming::LoadRequestedModels(void)
|
||||
}
|
||||
|
||||
|
||||
// Let's load models first, then process it. Unfortunately processing models are still single-threaded.
|
||||
// Let's load models in 4 threads; when one of them becomes idle, process the file, and fill thread with another file. Unfortunately processing models are still single-threaded.
|
||||
// Currently only supported on POSIX streamer.
|
||||
#ifdef ONE_THREAD_PER_CHANNEL
|
||||
// WIP - some files are loaded swapped (CdStreamPosix problem?)
|
||||
#if 0 //def ONE_THREAD_PER_CHANNEL
|
||||
void
|
||||
CStreaming::LoadAllRequestedModels(bool priority)
|
||||
{
|
||||
@@ -2365,14 +2375,18 @@ CStreaming::LoadAllRequestedModels(bool priority)
|
||||
int streamIds[ARRAY_SIZE(ms_pStreamingBuffer)];
|
||||
int streamSizes[ARRAY_SIZE(ms_pStreamingBuffer)];
|
||||
int streamPoses[ARRAY_SIZE(ms_pStreamingBuffer)];
|
||||
bool first = true;
|
||||
int readOrder[4] = {-1}; // Channel IDs ordered by read time
|
||||
int readI = 0;
|
||||
int processI = 0;
|
||||
bool first = true;
|
||||
|
||||
// All those "first" checks are because of variables aren't initialized in first pass.
|
||||
|
||||
while (true) {
|
||||
// Enumerate files and start reading
|
||||
for (int i=0; i<ARRAY_SIZE(ms_pStreamingBuffer); i++) {
|
||||
|
||||
// Channel has file to load
|
||||
if (!first && streamIds[i] != -1) {
|
||||
processI = i;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2385,12 +2399,16 @@ CStreaming::LoadAllRequestedModels(bool priority)
|
||||
|
||||
if (ms_aInfoForModel[streamId].GetCdPosnAndSize(posn, size)) {
|
||||
streamIds[i] = -1;
|
||||
|
||||
// Big file, needs 2 buffer
|
||||
if (size > (uint32)ms_streamingBufferSize) {
|
||||
if (i + 1 == ARRAY_SIZE(ms_pStreamingBuffer))
|
||||
continue;
|
||||
break;
|
||||
else if (!first && streamIds[i+1] != -1)
|
||||
continue;
|
||||
|
||||
} else {
|
||||
// Buffer of current channel is part of a "big file", pass
|
||||
if (i != 0 && streamIds[i-1] != -1 && streamSizes[i-1] > (uint32)ms_streamingBufferSize)
|
||||
continue;
|
||||
}
|
||||
@@ -2400,8 +2418,18 @@ CStreaming::LoadAllRequestedModels(bool priority)
|
||||
streamIds[i] = streamId;
|
||||
streamSizes[i] = size;
|
||||
streamPoses[i] = posn;
|
||||
|
||||
if (!first)
|
||||
assert(readOrder[readI] == -1);
|
||||
|
||||
//printf("read: order %d, ch %d, id %d, size %d\n", readI, i, streamId, size);
|
||||
|
||||
CdStreamRead(i, ms_pStreamingBuffer[i], imgOffset+posn, size);
|
||||
processI = i;
|
||||
readOrder[readI] = i;
|
||||
if (first && readI+1 != ARRAY_SIZE(readOrder))
|
||||
readOrder[readI+1] = -1;
|
||||
|
||||
readI = (readI + 1) % ARRAY_SIZE(readOrder);
|
||||
} else {
|
||||
ms_aInfoForModel[streamId].RemoveFromList();
|
||||
DecrementRef(streamId);
|
||||
@@ -2409,33 +2437,40 @@ CStreaming::LoadAllRequestedModels(bool priority)
|
||||
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED;
|
||||
streamIds[i] = -1;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
streamIds[i] = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
first = false;
|
||||
int nextChannel = readOrder[processI];
|
||||
|
||||
// Now process
|
||||
if (streamIds[processI] == -1)
|
||||
// Now start processing
|
||||
if (nextChannel == -1 || streamIds[nextChannel] == -1)
|
||||
break;
|
||||
|
||||
// Try again on error
|
||||
while (CdStreamSync(processI) != STREAM_NONE) {
|
||||
CdStreamRead(processI, ms_pStreamingBuffer[processI], imgOffset+streamPoses[processI], streamSizes[processI]);
|
||||
}
|
||||
ms_aInfoForModel[streamIds[processI]].m_loadState = STREAMSTATE_READING;
|
||||
|
||||
MakeSpaceFor(streamSizes[processI] * CDSTREAM_SECTOR_SIZE);
|
||||
ConvertBufferToObject(ms_pStreamingBuffer[processI], streamIds[processI]);
|
||||
if(ms_aInfoForModel[streamIds[processI]].m_loadState == STREAMSTATE_STARTED)
|
||||
FinishLoadingLargeFile(ms_pStreamingBuffer[processI], streamIds[processI]);
|
||||
//printf("process: order %d, ch %d, id %d\n", processI, nextChannel, streamIds[nextChannel]);
|
||||
|
||||
if(streamIds[processI] < STREAM_OFFSET_TXD){
|
||||
CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(streamIds[processI]);
|
||||
// Try again on error
|
||||
while (CdStreamSync(nextChannel) != STREAM_NONE) {
|
||||
CdStreamRead(nextChannel, ms_pStreamingBuffer[nextChannel], imgOffset+streamPoses[nextChannel], streamSizes[nextChannel]);
|
||||
}
|
||||
ms_aInfoForModel[streamIds[nextChannel]].m_loadState = STREAMSTATE_READING;
|
||||
|
||||
MakeSpaceFor(streamSizes[nextChannel] * CDSTREAM_SECTOR_SIZE);
|
||||
ConvertBufferToObject(ms_pStreamingBuffer[nextChannel], streamIds[nextChannel]);
|
||||
if(ms_aInfoForModel[streamIds[nextChannel]].m_loadState == STREAMSTATE_STARTED)
|
||||
FinishLoadingLargeFile(ms_pStreamingBuffer[nextChannel], streamIds[nextChannel]);
|
||||
|
||||
if(streamIds[nextChannel] < STREAM_OFFSET_TXD){
|
||||
CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(streamIds[nextChannel]);
|
||||
if(mi->IsSimple())
|
||||
mi->m_alpha = 255;
|
||||
}
|
||||
streamIds[processI] = -1;
|
||||
streamIds[nextChannel] = -1;
|
||||
readOrder[processI] = -1;
|
||||
processI = (processI + 1) % ARRAY_SIZE(readOrder);
|
||||
}
|
||||
|
||||
ms_bLoadingBigModel = false;
|
||||
@@ -2482,7 +2517,7 @@ CStreaming::LoadAllRequestedModels(bool priority)
|
||||
status = CdStreamRead(0, ms_pStreamingBuffer[0], imgOffset+posn, size);
|
||||
while(CdStreamSync(0) || status == STREAM_NONE);
|
||||
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_READING;
|
||||
|
||||
|
||||
MakeSpaceFor(size * CDSTREAM_SECTOR_SIZE);
|
||||
ConvertBufferToObject(ms_pStreamingBuffer[0], streamId);
|
||||
if(ms_aInfoForModel[streamId].m_loadState == STREAMSTATE_STARTED)
|
||||
@@ -2539,7 +2574,7 @@ CStreaming::FlushRequestList(void)
|
||||
next = si->m_next;
|
||||
RemoveModel(si - ms_aInfoForModel);
|
||||
}
|
||||
#ifndef _WIN32
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
if(ms_channel[0].state == CHANNELSTATE_READING) {
|
||||
flushStream[0] = 1;
|
||||
}
|
||||
@@ -3295,4 +3330,4 @@ CStreaming::PrintStreamingBufferState()
|
||||
DoRWStuffEndOfFrame();
|
||||
}
|
||||
CTimer::Update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,11 @@ public:
|
||||
static int32 ms_oldSectorX;
|
||||
static int32 ms_oldSectorY;
|
||||
static int32 ms_streamingBufferSize;
|
||||
#ifndef ONE_THREAD_PER_CHANNEL
|
||||
static int8 *ms_pStreamingBuffer[2];
|
||||
#else
|
||||
static int8 *ms_pStreamingBuffer[4];
|
||||
#endif
|
||||
static size_t ms_memoryUsed;
|
||||
static CStreamingChannel ms_channel[2];
|
||||
static int32 ms_channelError;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "SpecialFX.h"
|
||||
|
||||
uint32 CTimer::m_snTimeInMilliseconds;
|
||||
PauseModeTime CTimer::m_snTimeInMillisecondsPauseMode = 1;
|
||||
uint32 CTimer::m_snTimeInMillisecondsPauseMode = 1;
|
||||
|
||||
uint32 CTimer::m_snTimeInMillisecondsNonClipped;
|
||||
uint32 CTimer::m_snPreviousTimeInMilliseconds;
|
||||
@@ -17,7 +17,11 @@ float CTimer::ms_fTimeScale;
|
||||
float CTimer::ms_fTimeStep;
|
||||
float CTimer::ms_fTimeStepNonClipped;
|
||||
bool CTimer::m_UserPause;
|
||||
bool CTimer::m_CodePause;
|
||||
bool CTimer::m_CodePause;
|
||||
#ifdef FIX_BUGS
|
||||
uint32 CTimer::m_LogicalFrameCounter;
|
||||
uint32 CTimer::m_LogicalFramesPassed;
|
||||
#endif
|
||||
|
||||
uint32 _nCyclesPerMS = 1;
|
||||
|
||||
@@ -35,10 +39,6 @@ RsTimerType suspendPcTimer;
|
||||
|
||||
uint32 suspendDepth;
|
||||
|
||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
double frameTime;
|
||||
#endif
|
||||
|
||||
void CTimer::Initialise(void)
|
||||
{
|
||||
debug("Initialising CTimer...\n");
|
||||
@@ -51,6 +51,10 @@ void CTimer::Initialise(void)
|
||||
m_snTimeInMillisecondsNonClipped = 0;
|
||||
m_snPreviousTimeInMilliseconds = 0;
|
||||
m_snTimeInMilliseconds = 1;
|
||||
#ifdef FIX_BUGS
|
||||
m_LogicalFrameCounter = 0;
|
||||
m_LogicalFramesPassed = 0;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
LARGE_INTEGER perfFreq;
|
||||
@@ -82,6 +86,94 @@ void CTimer::Shutdown(void)
|
||||
;
|
||||
}
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
void CTimer::Update(void)
|
||||
{
|
||||
static double frameTimeLogical = 0.0;
|
||||
static double frameTimeFraction = 0.0;
|
||||
static double frameTimeFractionScaled = 0.0;
|
||||
double frameTime;
|
||||
double dblUpdInMs;
|
||||
|
||||
m_snPreviousTimeInMilliseconds = m_snTimeInMilliseconds;
|
||||
|
||||
#ifdef _WIN32
|
||||
if ( (double)_nCyclesPerMS != 0.0 )
|
||||
{
|
||||
LARGE_INTEGER pc;
|
||||
QueryPerformanceCounter(&pc);
|
||||
|
||||
int32 updInCycles = (pc.LowPart - _oldPerfCounter.LowPart); // & 0x7FFFFFFF; pointless
|
||||
|
||||
_oldPerfCounter = pc;
|
||||
|
||||
float updInCyclesScaled = GetIsPaused() ? updInCycles : updInCycles * ms_fTimeScale;
|
||||
|
||||
frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
|
||||
|
||||
dblUpdInMs = (double)updInCycles / (double)_nCyclesPerMS;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
RsTimerType timer = RsTimer();
|
||||
|
||||
RsTimerType updInMs = timer - oldPcTimer;
|
||||
|
||||
frameTime = (double)updInMs * ms_fTimeScale;
|
||||
|
||||
oldPcTimer = timer;
|
||||
|
||||
dblUpdInMs = (double)updInMs;
|
||||
}
|
||||
|
||||
// count frames as if we're running at 30 fps
|
||||
m_LogicalFramesPassed = 0;
|
||||
frameTimeLogical += dblUpdInMs;
|
||||
while (frameTimeLogical >= 1000.0 / 30.0) {
|
||||
frameTimeLogical -= 1000.0 / 30.0;
|
||||
m_LogicalFramesPassed++;
|
||||
}
|
||||
m_LogicalFrameCounter += m_LogicalFramesPassed;
|
||||
|
||||
frameTimeFraction += dblUpdInMs;
|
||||
frameTimeFractionScaled += frameTime;
|
||||
|
||||
m_snTimeInMillisecondsPauseMode += uint32(frameTimeFraction);
|
||||
|
||||
if ( GetIsPaused() )
|
||||
ms_fTimeStep = 0.0f;
|
||||
else
|
||||
{
|
||||
m_snTimeInMilliseconds += uint32(frameTimeFractionScaled);
|
||||
m_snTimeInMillisecondsNonClipped += uint32(frameTimeFractionScaled);
|
||||
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
||||
}
|
||||
frameTimeFraction -= uint32(frameTimeFraction);
|
||||
frameTimeFractionScaled -= uint32(frameTimeFractionScaled);
|
||||
|
||||
if ( ms_fTimeStep < 0.01f && !GetIsPaused() && !CSpecialFX::bSnapShotActive)
|
||||
ms_fTimeStep = 0.01f;
|
||||
|
||||
ms_fTimeStepNonClipped = ms_fTimeStep;
|
||||
|
||||
if ( !CRecordDataForGame::IsPlayingBack() )
|
||||
{
|
||||
ms_fTimeStep = Min(3.0f, ms_fTimeStep);
|
||||
|
||||
if ( (m_snTimeInMilliseconds - m_snPreviousTimeInMilliseconds) > 60 )
|
||||
m_snTimeInMilliseconds = m_snPreviousTimeInMilliseconds + 60;
|
||||
}
|
||||
|
||||
if ( CRecordDataForChase::IsRecording() )
|
||||
{
|
||||
ms_fTimeStep = 1.0f;
|
||||
m_snTimeInMilliseconds = m_snPreviousTimeInMilliseconds + 16;
|
||||
}
|
||||
|
||||
m_FrameCounter++;
|
||||
}
|
||||
#else
|
||||
void CTimer::Update(void)
|
||||
{
|
||||
m_snPreviousTimeInMilliseconds = m_snTimeInMilliseconds;
|
||||
@@ -98,11 +190,7 @@ void CTimer::Update(void)
|
||||
|
||||
float updInCyclesScaled = GetIsPaused() ? updInCycles : updInCycles * ms_fTimeScale;
|
||||
|
||||
// We need that real frame time to fix transparent menu bug.
|
||||
#ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
double
|
||||
#endif
|
||||
frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
|
||||
double frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
|
||||
|
||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
||||
|
||||
@@ -122,16 +210,12 @@ void CTimer::Update(void)
|
||||
|
||||
RsTimerType updInMs = timer - oldPcTimer;
|
||||
|
||||
// We need that real frame time to fix transparent menu bug.
|
||||
#ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
double
|
||||
#endif
|
||||
frameTime = (double)updInMs * ms_fTimeScale;
|
||||
double frameTime = (double)updInMs * ms_fTimeScale;
|
||||
|
||||
oldPcTimer = timer;
|
||||
|
||||
|
||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
||||
|
||||
|
||||
if ( GetIsPaused() )
|
||||
ms_fTimeStep = 0.0f;
|
||||
else
|
||||
@@ -163,6 +247,7 @@ void CTimer::Update(void)
|
||||
|
||||
m_FrameCounter++;
|
||||
}
|
||||
#endif
|
||||
|
||||
void CTimer::Suspend(void)
|
||||
{
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
#define PauseModeTime double
|
||||
#else
|
||||
#define PauseModeTime uint32
|
||||
#endif
|
||||
|
||||
class CTimer
|
||||
{
|
||||
|
||||
static uint32 m_snTimeInMilliseconds;
|
||||
static PauseModeTime m_snTimeInMillisecondsPauseMode;
|
||||
static uint32 m_snTimeInMillisecondsPauseMode;
|
||||
static uint32 m_snTimeInMillisecondsNonClipped;
|
||||
static uint32 m_snPreviousTimeInMilliseconds;
|
||||
static uint32 m_FrameCounter;
|
||||
static float ms_fTimeScale;
|
||||
static float ms_fTimeStep;
|
||||
static float ms_fTimeStepNonClipped;
|
||||
#ifdef FIX_BUGS
|
||||
static uint32 m_LogicalFrameCounter;
|
||||
static uint32 m_LogicalFramesPassed;
|
||||
#endif
|
||||
public:
|
||||
static bool m_UserPause;
|
||||
static bool m_CodePause;
|
||||
@@ -35,7 +33,7 @@ public:
|
||||
static void SetTimeInMilliseconds(uint32 t) { m_snTimeInMilliseconds = t; }
|
||||
static uint32 GetTimeInMillisecondsNonClipped(void) { return m_snTimeInMillisecondsNonClipped; }
|
||||
static void SetTimeInMillisecondsNonClipped(uint32 t) { m_snTimeInMillisecondsNonClipped = t; }
|
||||
static PauseModeTime GetTimeInMillisecondsPauseMode(void) { return m_snTimeInMillisecondsPauseMode; }
|
||||
static uint32 GetTimeInMillisecondsPauseMode(void) { return m_snTimeInMillisecondsPauseMode; }
|
||||
static void SetTimeInMillisecondsPauseMode(uint32 t) { m_snTimeInMillisecondsPauseMode = t; }
|
||||
static uint32 GetPreviousTimeInMilliseconds(void) { return m_snPreviousTimeInMilliseconds; }
|
||||
static void SetPreviousTimeInMilliseconds(uint32 t) { m_snPreviousTimeInMilliseconds = t; }
|
||||
@@ -67,9 +65,7 @@ public:
|
||||
#ifdef FIX_BUGS
|
||||
static float GetDefaultTimeStep(void) { return 50.0f / 30.0f; }
|
||||
static float GetTimeStepFix(void) { return GetTimeStep() / GetDefaultTimeStep(); }
|
||||
static uint32 GetLogicalFrameCounter(void) { return m_LogicalFrameCounter; }
|
||||
static uint32 GetLogicalFramesPassed(void) { return m_LogicalFramesPassed; }
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
extern double frameTime;
|
||||
#endif
|
||||
|
||||
@@ -65,7 +65,7 @@ CWorld::Initialise()
|
||||
void
|
||||
CWorld::Add(CEntity *ent)
|
||||
{
|
||||
if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, true);
|
||||
if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, TRUE);
|
||||
|
||||
if(ent->bIsBIGBuilding)
|
||||
ms_bigBuildingsList[ent->m_level].InsertItem(ent);
|
||||
@@ -80,7 +80,7 @@ CWorld::Add(CEntity *ent)
|
||||
void
|
||||
CWorld::Remove(CEntity *ent)
|
||||
{
|
||||
if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, false);
|
||||
if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, FALSE);
|
||||
|
||||
if(ent->bIsBIGBuilding)
|
||||
ms_bigBuildingsList[ent->m_level].RemoveItem(ent);
|
||||
@@ -367,7 +367,7 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
|
||||
} else if(e->bUsesCollision)
|
||||
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
|
||||
|
||||
if(colmodel && CCollision::ProcessLineOfSight(line, e->GetMatrix(), *colmodel, point, dist,
|
||||
if(colmodel && CCollision::ProcessLineOfSight(line, e->GetMatrix(), *colmodel, point, mindist,
|
||||
ignoreSeeThrough, ignoreShootThrough))
|
||||
entity = e;
|
||||
if(carTyres && ((CVehicle*)e)->SetUpWheelColModel(&tyreCol) && CCollision::ProcessLineOfSight(line, e->GetMatrix(), tyreCol, tyreColPoint, tyreDist, false, ignoreShootThrough)){
|
||||
@@ -466,7 +466,7 @@ CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CCol
|
||||
e->m_scanCode = GetCurrentScanCode();
|
||||
|
||||
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
|
||||
if(CCollision::ProcessVerticalLine(line, e->GetMatrix(), *colmodel, point, dist,
|
||||
if(CCollision::ProcessVerticalLine(line, e->GetMatrix(), *colmodel, point, mindist,
|
||||
ignoreSeeThrough, false, poly))
|
||||
entity = e;
|
||||
}
|
||||
@@ -1486,7 +1486,7 @@ CWorld::CallOffChaseForAreaSectorListVehicles(CPtrList &list, float x1, float y1
|
||||
CColModel *pColModel = pVehicle->GetColModel();
|
||||
bool bInsideSphere = false;
|
||||
for(int32 i = 0; i < pColModel->numSpheres; i++) {
|
||||
CVector pos = pVehicle->m_matrix * pColModel->spheres[i].center;
|
||||
CVector pos = pVehicle->GetMatrix() * pColModel->spheres[i].center;
|
||||
float fRadius = pColModel->spheres[i].radius;
|
||||
if(pos.x + fRadius > x1 && pos.x - fRadius < x2 && pos.y + fRadius > y1 &&
|
||||
pos.y - fRadius < y2)
|
||||
@@ -1801,7 +1801,7 @@ CWorld::RepositionOneObject(CEntity *pEntity)
|
||||
position.z = FindGroundZFor3DCoord(position.x, position.y,
|
||||
position.z + OBJECT_REPOSITION_OFFSET_Z, nil) -
|
||||
fBoundingBoxMinZ;
|
||||
pEntity->m_matrix.UpdateRW();
|
||||
pEntity->GetMatrix().UpdateRW();
|
||||
pEntity->UpdateRwFrame();
|
||||
} else if(modelId == MI_BUOY) {
|
||||
float fWaterLevel = 0.0f;
|
||||
@@ -1906,16 +1906,7 @@ CWorld::Process(void)
|
||||
for(int i = 0; i < NUMCUTSCENEOBJECTS; i++) {
|
||||
CCutsceneObject *csObj = CCutsceneMgr::GetCutsceneObject(i);
|
||||
if(csObj && csObj->m_entryInfoList.first) {
|
||||
if(csObj->m_rwObject && RwObjectGetType(csObj->m_rwObject) == rpCLUMP &&
|
||||
RpAnimBlendClumpGetFirstAssociation(csObj->GetClump())) {
|
||||
if (csObj->IsObject())
|
||||
RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
|
||||
else {
|
||||
if (!csObj->bOffscreen)
|
||||
csObj->bOffscreen = !csObj->GetIsOnScreen();
|
||||
RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepInSeconds(), !csObj->bOffscreen);
|
||||
}
|
||||
}
|
||||
csObj->UpdateAnim();
|
||||
csObj->ProcessControl();
|
||||
csObj->ProcessCollision();
|
||||
csObj->GetMatrix().UpdateRW();
|
||||
@@ -1927,26 +1918,40 @@ CWorld::Process(void)
|
||||
} else {
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CEntity *movingEnt = (CEntity *)node->item;
|
||||
if(!movingEnt->bRemoveFromWorld && movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
|
||||
RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) {
|
||||
if (movingEnt->IsObject())
|
||||
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
|
||||
else {
|
||||
if (!movingEnt->bOffscreen)
|
||||
movingEnt->bOffscreen = !movingEnt->GetIsOnScreen();
|
||||
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepInSeconds(), !movingEnt->bOffscreen);
|
||||
}
|
||||
}
|
||||
if(!movingEnt->bRemoveFromWorld)
|
||||
movingEnt->UpdateAnim();
|
||||
}
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CPhysical *movingEnt = (CPhysical *)node->item;
|
||||
if(movingEnt->bRemoveFromWorld) {
|
||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||
} else {
|
||||
movingEnt->ProcessControl();
|
||||
if(!CCutsceneMgr::IsCutsceneProcessing() || movingEnt->UpdatesInCutscene())
|
||||
movingEnt->ProcessControl();
|
||||
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||
}
|
||||
}
|
||||
for(int y = 0; y < NUMSECTORS_Y; y++)
|
||||
for(int x = 0; x < NUMSECTORS_X; x++){
|
||||
CPtrNode *node;
|
||||
CSector *sect = CWorld::GetSector(x, y);
|
||||
for(node = sect->m_lists[ENTITYLIST_PEDS].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_PEDS_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_VEHICLES].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_VEHICLES_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_OBJECTS].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_OBJECTS_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_DUMMIES].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_DUMMIES_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
}
|
||||
bForceProcessControl = true;
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CPhysical *movingEnt = (CPhysical *)node->item;
|
||||
@@ -2192,7 +2197,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;
|
||||
|
||||
@@ -29,6 +29,7 @@ enum
|
||||
{
|
||||
ENTITYLIST_BUILDINGS,
|
||||
ENTITYLIST_BUILDINGS_OVERLAP,
|
||||
ENTITYLIST_UNKNOWN,
|
||||
ENTITYLIST_OBJECTS,
|
||||
ENTITYLIST_OBJECTS_OVERLAP,
|
||||
ENTITYLIST_VEHICLES,
|
||||
|
||||
@@ -452,6 +452,7 @@ CTheZones::GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info)
|
||||
assert(d >= 0.0f && d <= 1.0f);
|
||||
n = 1.0f - d;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
info->carDensity = day->carDensity * d + night->carDensity * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->carThreshold); i++)
|
||||
info->carThreshold[i] = day->carThreshold[i] * d + night->carThreshold[i] * n;
|
||||
@@ -465,6 +466,22 @@ CTheZones::GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info)
|
||||
info->copPedThreshold = day->copPedThreshold * d + night->copPedThreshold * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->gangPedThreshold); i++)
|
||||
info->gangPedThreshold[i] = day->gangPedThreshold[i] * d + night->gangPedThreshold[i] * n;
|
||||
#else
|
||||
// This is a complete mess.
|
||||
info->carDensity = day->carDensity * n + night->carDensity * d;
|
||||
for(i = 0; i < ARRAY_SIZE(info->carThreshold); i++)
|
||||
info->carThreshold[i] = night->carThreshold[i] * d + night->carThreshold[i] * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->boatThreshold); i++)
|
||||
info->boatThreshold[i] = night->boatThreshold[i] * d + night->boatThreshold[i] * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->gangThreshold); i++)
|
||||
info->gangThreshold[i] = night->gangThreshold[i] * d + night->gangThreshold[i] * n;
|
||||
|
||||
info->copThreshold = night->copThreshold * d + night->copThreshold * n;
|
||||
info->pedDensity = night->pedDensity * d + night->pedDensity * n;
|
||||
info->copPedThreshold = night->copPedThreshold * d + night->copPedThreshold * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->gangPedThreshold); i++)
|
||||
info->gangPedThreshold[i] = night->gangPedThreshold[i] * d + night->gangPedThreshold[i] * n;
|
||||
#endif
|
||||
}
|
||||
if(CClock::GetIsTimeInRange(5, 19))
|
||||
info->pedGroup = day->pedGroup;
|
||||
|
||||
@@ -228,6 +228,12 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
||||
|
||||
#include "maths.h"
|
||||
#include "Vector.h"
|
||||
#ifdef GTA_PS2
|
||||
#include "VuVector.h"
|
||||
#define CVUVECTOR CVuVector
|
||||
#else
|
||||
#define CVUVECTOR CVector
|
||||
#endif
|
||||
#include "Vector2D.h"
|
||||
#include "Matrix.h"
|
||||
#include "Rect.h"
|
||||
@@ -369,7 +375,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
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ enum Config {
|
||||
MAX_CDIMAGES = 8, // additional cdimages
|
||||
MAX_CDCHANNELS = 5,
|
||||
|
||||
MODELINFOSIZE = 6500, // only 4900
|
||||
TXDSTORESIZE = 1385, // only 1200
|
||||
COLSTORESIZE = 31, // only 15
|
||||
MODELINFOSIZE = 4900,
|
||||
TXDSTORESIZE = 1200,
|
||||
COLSTORESIZE = 15,
|
||||
EXTRADIRSIZE = 256,
|
||||
CUTSCENEDIRSIZE = 512,
|
||||
|
||||
@@ -100,7 +100,7 @@ enum Config {
|
||||
NUMPACMANPICKUPS = 256,
|
||||
NUMEVENTS = 64,
|
||||
|
||||
NUM_CARGENS = 500,
|
||||
NUM_CARGENS = 195, // 500 on mobile
|
||||
|
||||
NUM_PATH_NODES_IN_AUTOPILOT = 8,
|
||||
|
||||
@@ -131,7 +131,6 @@ enum Config {
|
||||
NUM_PED_COMMENTS_SLOTS = 20,
|
||||
|
||||
NUM_SOUNDS_SAMPLES_BANKS = 2,
|
||||
NUM_SOUNDS_SAMPLES_SLOTS = 27,
|
||||
NUM_AUDIOENTITIES = 250,
|
||||
|
||||
NUM_AUDIO_REFLECTIONS = 8,
|
||||
@@ -196,6 +195,10 @@ enum Config {
|
||||
|
||||
// those infamous texts
|
||||
#define DRAW_GAME_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
|
||||
|
||||
// Memory allocation and compression
|
||||
// #define USE_CUSTOM_ALLOCATOR // use CMemoryHeap for allocation. use with care, not finished yet
|
||||
@@ -233,7 +236,6 @@ enum Config {
|
||||
// not in master builds
|
||||
#define VALIDATE_SAVE_SIZE
|
||||
|
||||
#define NO_MOVIES // disable intro videos
|
||||
#define DEBUGMENU
|
||||
#endif
|
||||
|
||||
@@ -250,12 +252,19 @@ enum Config {
|
||||
//#define MORE_LANGUAGES // Add more translations to the game
|
||||
#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible
|
||||
#define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS
|
||||
#define FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
|
||||
#define NO_MOVIES // add option to disable intro videos
|
||||
|
||||
#if defined(__LP64__) || defined(_WIN64)
|
||||
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
|
||||
#endif
|
||||
|
||||
#define ASCII_STRCMP // use faster ascii str comparisons
|
||||
|
||||
#if !defined _WIN32 || defined __MWERKS__ || defined __MINGW32__ || defined VANILLA_DEFINES
|
||||
#undef ASCII_STRCMP
|
||||
#endif
|
||||
|
||||
// Just debug menu entries
|
||||
#ifdef DEBUGMENU
|
||||
#define RELOADABLES // some debug menu options to reload TXD files
|
||||
@@ -298,8 +307,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
|
||||
@@ -307,19 +316,22 @@ enum Config {
|
||||
#define BETTER_ALLCARSAREDODO_CHEAT
|
||||
#define WALLCLIMB_CHEAT
|
||||
#define REGISTER_START_BUTTON
|
||||
//#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
|
||||
#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
|
||||
#define BUTTON_ICONS // use textures to show controller buttons
|
||||
|
||||
// Hud, frontend and radar
|
||||
#define PC_MENU
|
||||
|
||||
#define FIX_RADAR // use radar size from early version before R* broke it
|
||||
#define RADIO_OFF_TEXT // Won't work without FIX_BUGS
|
||||
|
||||
#ifndef PC_MENU
|
||||
# define PS2_MENU
|
||||
//# define PS2_MENU_USEALLPAGEICONS
|
||||
#else
|
||||
# define MAP_ENHANCEMENTS // Adding waypoint and better mouse support
|
||||
# ifdef XINPUT
|
||||
# define GAMEPAD_MENU // Add gamepad menu
|
||||
# endif
|
||||
# define TRIANGLE_BACK_BUTTON
|
||||
//# define CIRCLE_BACK_BUTTON
|
||||
#define LEGACY_MENU_OPTIONS // i.e. frame sync(vsync)
|
||||
@@ -353,6 +365,10 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||
#define SCRIPT_LOG_FILE_LEVEL 1 // 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
|
||||
@@ -382,8 +398,10 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||
#define FREE_CAM // Rotating cam
|
||||
|
||||
// Audio
|
||||
#define AUDIO_CACHE // cache sound lengths to speed up the cold boot
|
||||
#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds)
|
||||
#define RADIO_SCROLL_TO_PREV_STATION // Won't work without FIX_BUGS
|
||||
//#define AUDIO_CACHE // cache sound lengths to speed up the cold boot
|
||||
#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 41 (PSP and mobile have 21 originally)
|
||||
//#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds)
|
||||
//#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder
|
||||
#define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files
|
||||
|
||||
@@ -399,18 +417,22 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef LIBRW
|
||||
// these are not supported with librw yet
|
||||
// Streaming
|
||||
#if !defined(_WIN32) && !defined(__SWITCH__)
|
||||
//#define ONE_THREAD_PER_CHANNEL // Don't use if you're not on SSD/Flash - also not utilized too much right now(see commented LoadAllRequestedModels in Streaming.cpp)
|
||||
#define FLUSHABLE_STREAMING // Make it possible to interrupt reading when processing file isn't needed anymore.
|
||||
#endif
|
||||
// IMG
|
||||
#define BIG_IMG // allows to read larger img files
|
||||
#define BIG_IMG // Not complete - allows to read larger img files
|
||||
|
||||
//#define SQUEEZE_PERFORMANCE
|
||||
#ifdef SQUEEZE_PERFORMANCE
|
||||
#undef PS2_ALPHA_TEST
|
||||
#undef NO_ISLAND_LOADING
|
||||
#undef PS2_AUDIO_CHANNELS
|
||||
#endif
|
||||
|
||||
// -------
|
||||
|
||||
#if defined __MWERKS__ || defined VANILLA_DEFINES
|
||||
#define FINAL
|
||||
#undef CHATTYSPLASH
|
||||
@@ -436,7 +458,6 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||
#undef MORE_LANGUAGES
|
||||
#undef COMPATIBLE_SAVES
|
||||
#undef LOAD_INI_SETTINGS
|
||||
#undef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
||||
|
||||
#undef ASPECT_RATIO_SCALE
|
||||
#undef PROPER_SCALING
|
||||
@@ -465,8 +486,10 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||
#undef BUTTON_ICONS
|
||||
|
||||
#undef FIX_RADAR
|
||||
#undef RADIO_OFF_TEXT
|
||||
|
||||
#undef MAP_ENHANCEMENTS
|
||||
#undef GAMEPAD_MENU
|
||||
#undef MUCH_SHORTER_OUTRO_SCREEN
|
||||
#undef CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
@@ -493,4 +516,6 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||
#undef IMPROVED_CAMERA
|
||||
#undef FREE_CAM
|
||||
#undef BIG_IMG
|
||||
#undef PS2_AUDIO_CHANNELS
|
||||
#undef RADIO_SCROLL_TO_PREV_STATION
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
@@ -73,6 +75,9 @@
|
||||
#include "custompipes.h"
|
||||
#include "screendroplets.h"
|
||||
#include "VarConsole.h"
|
||||
#ifdef USE_OUR_VERSIONING
|
||||
#include "GitSHA1.h"
|
||||
#endif
|
||||
|
||||
GlobalScene Scene;
|
||||
|
||||
@@ -97,6 +102,12 @@ bool gbModelViewer;
|
||||
#ifdef TIMEBARS
|
||||
bool gbShowTimebars;
|
||||
#endif
|
||||
#ifdef DRAW_GAME_VERSION_TEXT
|
||||
bool gbDrawVersionText; // Our addition, we think it was always enabled on !MASTER builds
|
||||
#endif
|
||||
#ifdef NO_MOVIES
|
||||
bool gbNoMovies;
|
||||
#endif
|
||||
|
||||
volatile int32 frameCount;
|
||||
|
||||
@@ -339,7 +350,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;
|
||||
@@ -358,6 +373,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) {
|
||||
@@ -369,6 +385,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
|
||||
}
|
||||
|
||||
@@ -1048,7 +1070,7 @@ DisplayGameDebugText()
|
||||
|
||||
#ifndef FINAL
|
||||
{
|
||||
SETTWEAKPATH("GameDebugText");
|
||||
SETTWEAKPATH("Debug");
|
||||
TWEAKBOOL(bDisplayPosn);
|
||||
TWEAKBOOL(bDisplayCheatStr);
|
||||
}
|
||||
@@ -1062,13 +1084,56 @@ DisplayGameDebugText()
|
||||
|
||||
#ifdef DRAW_GAME_VERSION_TEXT
|
||||
wchar ver[200];
|
||||
|
||||
|
||||
if(gbDrawVersionText) // 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_STANDARD);
|
||||
CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f));
|
||||
CFont::SetCentreOff();
|
||||
CFont::SetRightJustifyOff();
|
||||
CFont::SetWrapx(SCREEN_WIDTH);
|
||||
@@ -1076,11 +1141,20 @@ DisplayGameDebugText()
|
||||
CFont::SetBackGroundOnlyTextOff();
|
||||
CFont::SetColor(CRGBA(255, 108, 0, 255));
|
||||
CFont::PrintString(SCREEN_SCALE_X(10.0f), SCREEN_SCALE_Y(10.0f), ver);
|
||||
#endif
|
||||
}
|
||||
#endif // #ifdef DRAW_GAME_VERSION_TEXT
|
||||
|
||||
FrameSamples++;
|
||||
FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f);
|
||||
#ifdef FIX_BUGS
|
||||
// this is inaccurate with over 1000 fps
|
||||
static uint32 PreviousTimeInMillisecondsPauseMode = 0;
|
||||
FramesPerSecondCounter += (CTimer::GetTimeInMillisecondsPauseMode() - PreviousTimeInMillisecondsPauseMode) / 1000.0f; // convert to seconds
|
||||
PreviousTimeInMillisecondsPauseMode = CTimer::GetTimeInMillisecondsPauseMode();
|
||||
FramesPerSecond = FrameSamples / FramesPerSecondCounter;
|
||||
#else
|
||||
FramesPerSecondCounter += 1000.0f / CTimer::GetTimeStepNonClippedInMilliseconds();
|
||||
FramesPerSecond = FramesPerSecondCounter / FrameSamples;
|
||||
#endif
|
||||
|
||||
if ( FrameSamples > 30 )
|
||||
{
|
||||
@@ -1209,6 +1283,7 @@ if(gbRenderEverythingBarRoads)
|
||||
void
|
||||
RenderScene_new(void)
|
||||
{
|
||||
PUSH_RENDERGROUP("RenderScene_new");
|
||||
CClouds::Render();
|
||||
DoRWRenderHorizon();
|
||||
|
||||
@@ -1216,6 +1291,7 @@ RenderScene_new(void)
|
||||
DefinedState();
|
||||
// CMattRenderer::ResetRenderStates
|
||||
// moved CRenderer::RenderBoats to before transparent water
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
// TODO
|
||||
@@ -1223,10 +1299,13 @@ bool FredIsInFirstPersonCam(void) { return false; }
|
||||
void
|
||||
RenderEffects_new(void)
|
||||
{
|
||||
PUSH_RENDERGROUP("RenderEffects_new");
|
||||
/* // stupid to do this before the whole world is drawn!
|
||||
CShadows::RenderStaticShadows();
|
||||
CShadows::RenderStoredShadows();
|
||||
CSkidmarks::Render();
|
||||
CRubbish::Render();
|
||||
*/
|
||||
|
||||
// these aren't really effects
|
||||
DefinedState();
|
||||
@@ -1249,6 +1328,13 @@ if(gbRenderFadingInEntities)
|
||||
CRenderer::RenderFadingInEntities();
|
||||
|
||||
// actual effects here
|
||||
|
||||
// from above
|
||||
CShadows::RenderStaticShadows();
|
||||
CShadows::RenderStoredShadows();
|
||||
CSkidmarks::Render();
|
||||
CRubbish::Render();
|
||||
|
||||
CGlass::Render();
|
||||
// CMattRenderer::ResetRenderStates
|
||||
DefinedState();
|
||||
@@ -1266,6 +1352,7 @@ if(gbRenderFadingInEntities)
|
||||
CPointLights::RenderFogEffect();
|
||||
CMovingThings::Render();
|
||||
CRenderer::RenderFirstPersonVehicle();
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1278,6 +1365,7 @@ RenderScene(void)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
PUSH_RENDERGROUP("RenderScene");
|
||||
CClouds::Render();
|
||||
DoRWRenderHorizon();
|
||||
CRenderer::RenderRoads();
|
||||
@@ -1293,11 +1381,13 @@ RenderScene(void)
|
||||
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
|
||||
CWeather::RenderRainStreaks();
|
||||
CCoronas::RenderSunReflection();
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
void
|
||||
RenderDebugShit(void)
|
||||
{
|
||||
PUSH_RENDERGROUP("RenderDebugShit");
|
||||
//CTheScripts::RenderTheScriptDebugLines();
|
||||
#ifndef FINAL
|
||||
if(gbShowCollisionLines)
|
||||
@@ -1306,6 +1396,7 @@ RenderDebugShit(void)
|
||||
CDebug::DrawLines();
|
||||
DefinedState();
|
||||
#endif
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1317,6 +1408,7 @@ RenderEffects(void)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
PUSH_RENDERGROUP("RenderEffects");
|
||||
CGlass::Render();
|
||||
CWaterCannons::Render();
|
||||
CSpecialFX::Render();
|
||||
@@ -1333,11 +1425,13 @@ RenderEffects(void)
|
||||
CPointLights::RenderFogEffect();
|
||||
CMovingThings::Render();
|
||||
CRenderer::RenderFirstPersonVehicle();
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
void
|
||||
Render2dStuff(void)
|
||||
{
|
||||
PUSH_RENDERGROUP("Render2dStuff");
|
||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||
@@ -1409,6 +1503,7 @@ Render2dStuff(void)
|
||||
#ifdef DEBUGMENU
|
||||
DebugMenuRender();
|
||||
#endif
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1416,7 +1511,9 @@ RenderMenus(void)
|
||||
{
|
||||
if (FrontEndMenuManager.m_bMenuActive)
|
||||
{
|
||||
PUSH_RENDERGROUP("RenderMenus");
|
||||
FrontEndMenuManager.DrawFrontEnd();
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
#ifndef MASTER
|
||||
else
|
||||
@@ -1427,6 +1524,7 @@ RenderMenus(void)
|
||||
void
|
||||
Render2dStuffAfterFade(void)
|
||||
{
|
||||
PUSH_RENDERGROUP("Render2dStuffAfterFade");
|
||||
#ifndef MASTER
|
||||
DisplayGameDebugText();
|
||||
#endif
|
||||
@@ -1437,6 +1535,7 @@ Render2dStuffAfterFade(void)
|
||||
CHud::DrawAfterFade();
|
||||
CFont::DrawFonts();
|
||||
CCredits::Render();
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef FINAL
|
||||
// defined in RwHelpder.cpp
|
||||
void PushRendergroup(const char *name);
|
||||
void PopRendergroup(void);
|
||||
#define PUSH_RENDERGROUP(str) PushRendergroup(str)
|
||||
#define POP_RENDERGROUP() PopRendergroup()
|
||||
#else
|
||||
#define PUSH_RENDERGROUP(str)
|
||||
#define POP_RENDERGROUP()
|
||||
#endif
|
||||
|
||||
struct GlobalScene
|
||||
{
|
||||
RpWorld *world;
|
||||
@@ -63,3 +74,11 @@ void SaveINIControllerSettings();
|
||||
extern bool gbNewRenderer;
|
||||
bool FredIsInFirstPersonCam(void);
|
||||
#endif
|
||||
|
||||
#ifdef DRAW_GAME_VERSION_TEXT
|
||||
extern bool gbDrawVersionText;
|
||||
#endif
|
||||
|
||||
#ifdef NO_MOVIES
|
||||
extern bool gbNoMovies;
|
||||
#endif
|
||||
|
||||
268
src/core/re3.cpp
268
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 "Occlusion.h"
|
||||
#include "Credits.h"
|
||||
@@ -37,7 +45,7 @@
|
||||
#include "MBlur.h"
|
||||
#include "ControllerConfig.h"
|
||||
|
||||
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
|
||||
#ifdef DETECT_JOYSTICK_MENU
|
||||
#include "crossplatform.h"
|
||||
#endif
|
||||
|
||||
@@ -82,16 +90,51 @@ 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
|
||||
|
||||
int fd;
|
||||
// These work only if we have neo folder, so they're dynamically added
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
const char *pipelineNames[] = { "FED_PSP", "FED_PS2","FED_MOB" };
|
||||
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);
|
||||
@@ -108,6 +151,38 @@ CustomFrontendOptionsPopulate(void)
|
||||
#endif
|
||||
CFileMgr::CloseFile(fd);
|
||||
}
|
||||
#endif
|
||||
// Add outsourced language translations, if files are found
|
||||
#ifdef MORE_LANGUAGES
|
||||
int fd2;
|
||||
FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, 5, false);
|
||||
#if 0
|
||||
if (fd = CFileMgr::OpenFile("text/polish.gxt")) {
|
||||
if (fd2 = CFileMgr::OpenFile("models/fonts_p.txd")) {
|
||||
FrontendOptionAddDynamic("FEL_POL", 0, 0, MENUALIGN_CENTER, nil, nil, LangPolSelect, nil, nil);
|
||||
CFileMgr::CloseFile(fd2);
|
||||
}
|
||||
CFileMgr::CloseFile(fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fd = CFileMgr::OpenFile("text/russian.gxt")) {
|
||||
if (fd2 = CFileMgr::OpenFile("models/fonts_r.txd")) {
|
||||
FrontendOptionAddDynamic("FEL_RUS", 0, 0, MENUALIGN_CENTER, nil, nil, LangRusSelect, nil, nil);
|
||||
CFileMgr::CloseFile(fd2);
|
||||
}
|
||||
CFileMgr::CloseFile(fd);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (fd = CFileMgr::OpenFile("text/japanese.gxt")) {
|
||||
if (fd2 = CFileMgr::OpenFile("models/fonts_j.txd")) {
|
||||
FrontendOptionAddDynamic("FEL_JAP", 0, 0, MENUALIGN_CENTER, nil, nil, LangJapSelect, nil, nil);
|
||||
CFileMgr::CloseFile(fd2);
|
||||
}
|
||||
CFileMgr::CloseFile(fd);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -249,8 +324,40 @@ 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)) {
|
||||
@@ -348,8 +455,12 @@ 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("reLCS.ini");
|
||||
@@ -373,6 +484,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", "MP3BoostVolume", &FrontEndMenuManager.m_PrefsMP3BoostVolume);
|
||||
@@ -406,6 +518,10 @@ bool LoadINISettings()
|
||||
ReadIniIfExists("CustomPipesValues", "LightmapMult", &CustomPipes::LightmapMult);
|
||||
ReadIniIfExists("CustomPipesValues", "GlossMult", &CustomPipes::GlossMult);
|
||||
#endif
|
||||
ReadIniIfExists("Rendering", "BackfaceCulling", &gBackfaceCulling);
|
||||
#ifdef NEW_RENDERER
|
||||
ReadIniIfExists("Rendering", "NewRenderer", &gbNewRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef PROPER_SCALING
|
||||
ReadIniIfExists("Draw", "ProperScaling", &CDraw::ms_bProperScaling);
|
||||
@@ -416,6 +532,12 @@ bool LoadINISettings()
|
||||
#ifdef FIX_SPRITES
|
||||
ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites);
|
||||
#endif
|
||||
#ifdef DRAW_GAME_VERSION_TEXT
|
||||
ReadIniIfExists("General", "DrawVersionText", &gbDrawVersionText);
|
||||
#endif
|
||||
#ifdef NO_MOVIES
|
||||
ReadIniIfExists("General", "NoMovies", &gbNoMovies);
|
||||
#endif
|
||||
|
||||
#ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
bool migrate = cfg.category_size("FrontendOptions") != 0;
|
||||
@@ -461,6 +583,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", "MP3BoostVolume", FrontEndMenuManager.m_PrefsMP3BoostVolume);
|
||||
@@ -495,6 +618,9 @@ void SaveINISettings()
|
||||
StoreIni("CustomPipesValues", "GlossMult", CustomPipes::GlossMult);
|
||||
#endif
|
||||
StoreIni("Rendering", "BackfaceCulling", gBackfaceCulling);
|
||||
#ifdef NEW_RENDERER
|
||||
StoreIni("Rendering", "NewRenderer", gbNewRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef PROPER_SCALING
|
||||
StoreIni("Draw", "ProperScaling", CDraw::ms_bProperScaling);
|
||||
@@ -505,6 +631,12 @@ void SaveINISettings()
|
||||
#ifdef FIX_SPRITES
|
||||
StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites);
|
||||
#endif
|
||||
#ifdef DRAW_GAME_VERSION_TEXT
|
||||
StoreIni("General", "DrawVersionText", gbDrawVersionText);
|
||||
#endif
|
||||
#ifdef NO_MOVIES
|
||||
StoreIni("General", "NoMovies", gbNoMovies);
|
||||
#endif
|
||||
#ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
for (int i = 0; i < MENUPAGES; i++) {
|
||||
for (int j = 0; j < NUM_MENUROWS; j++) {
|
||||
@@ -632,18 +764,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)
|
||||
{
|
||||
@@ -859,13 +979,22 @@ DebugMenuPopulate(void)
|
||||
|
||||
DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil);
|
||||
DebugMenuAddVar("Render", "Brightness", &FrontEndMenuManager.m_PrefsBrightness, nil, 16, 0, 700, 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", "Backface Culling", &gBackfaceCulling, nil);
|
||||
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;
|
||||
@@ -876,16 +1005,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
|
||||
@@ -900,6 +1029,11 @@ extern bool gbRenderWorld2;
|
||||
#ifndef MASTER
|
||||
DebugMenuAddVarBool8("Render", "Occlusion debug", &bDispayOccDebugStuff, nil);
|
||||
#endif
|
||||
#ifdef LIBRW
|
||||
DebugMenuAddVarBool32("Render", "MatFX env map apply light", &rw::MatFX::envMapApplyLight, nil);
|
||||
DebugMenuAddVarBool32("Render", "MatFX env map flip U", &rw::MatFX::envMapFlipU, nil);
|
||||
DebugMenuAddVarBool32("Render", "MatFX env map use matcolor", &rw::MatFX::envMapUseMatColor, nil);
|
||||
#endif
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
static const char *worldpipenames[] = { "PSP", "PS2", "Mobile" };
|
||||
e = DebugMenuAddVar("Render", "World Rendering", &CustomPipes::WorldPipeSwitch, nil,
|
||||
@@ -921,29 +1055,28 @@ extern bool gbRenderDebugEnvMap;
|
||||
// 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 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 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);
|
||||
|
||||
#ifdef DRAW_GAME_VERSION_TEXT
|
||||
DebugMenuAddVarBool8("Debug", "Version Text", &gbDrawVersionText, nil);
|
||||
#endif
|
||||
#ifdef FIX_RADAR
|
||||
DebugMenuAddVarBool8("Draw", "Fix Radar", &CDraw::ms_bFixRadar, nil);
|
||||
DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil);
|
||||
#ifdef TIMEBARS
|
||||
DebugMenuAddVarBool8("Debug", "Show Timebars", &gbShowTimebars, nil);
|
||||
#endif
|
||||
#ifdef FIX_SPRITES
|
||||
DebugMenuAddVarBool8("Draw", "Fix Sprites", &CDraw::ms_bFixSprites, nil);
|
||||
#endif
|
||||
|
||||
#ifndef FINAL
|
||||
DebugMenuAddVarBool8("Debug", "Use debug render groups", &bDebugRenderGroups, nil);
|
||||
DebugMenuAddVarBool8("Debug", "Print Memory Usage", &gbPrintMemoryUsage, nil);
|
||||
#ifdef USE_CUSTOM_ALLOCATOR
|
||||
DebugMenuAddCmd("Debug", "Parse Heap", ParseHeap);
|
||||
@@ -954,28 +1087,23 @@ extern bool gbRenderDebugEnvMap;
|
||||
#ifdef GTA_SCENE_EDIT
|
||||
DebugMenuAddVarBool8("Debug", "Edit on", &CSceneEdit::m_bEditOn, nil);
|
||||
#endif
|
||||
#ifdef MAP_ENHANCEMENTS
|
||||
DebugMenuAddCmd("Debug", "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", "Script Heli On", &CHeli::ScriptHeliOn, nil);
|
||||
|
||||
DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
|
||||
DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
|
||||
//DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
|
||||
//DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
|
||||
|
||||
#ifdef RELOADABLES
|
||||
DebugMenuAddCmd("Reload", "HUD.TXD", CHud::ReloadTXD);
|
||||
// maybe put it back if we have more to reload
|
||||
// DebugMenuAddCmd("Reload", "HUD.TXD", CHud::ReloadTXD);
|
||||
#endif
|
||||
DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil);
|
||||
#ifdef TIMEBARS
|
||||
DebugMenuAddVarBool8("Debug", "Show Timebars", &gbShowTimebars, nil);
|
||||
|
||||
#ifdef MAP_ENHANCEMENTS
|
||||
DebugMenuAddCmd("Game", "Teleport to map waypoint", TeleportToWaypoint);
|
||||
#endif
|
||||
DebugMenuAddCmd("Game", "Fix Car", FixCar);
|
||||
DebugMenuAddCmd("Game", "Place Car on Road", PlaceOnRoad);
|
||||
DebugMenuAddCmd("Game", "Switch car collision", SwitchCarCollision);
|
||||
DebugMenuAddCmd("Game", "Toggle Comedy Controls", ToggleComedy);
|
||||
|
||||
|
||||
#ifdef MISSION_SWITCHER
|
||||
DebugMenuEntry *missionEntry;
|
||||
static const char* missions[] = {
|
||||
@@ -1005,9 +1133,9 @@ extern bool gbRenderDebugEnvMap;
|
||||
"A Date with Death (Toshiko Kasen)", "Cash in Kazuki's Chips (Toshiko Kasen)"
|
||||
};
|
||||
|
||||
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;
|
||||
extern int16 DebugCamMode;
|
||||
@@ -1060,7 +1188,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
|
||||
strcat_s(re3_buff, re3_buffsize, "(Press Retry to debug the application)");
|
||||
|
||||
|
||||
nCode = ::MessageBoxA(nil, re3_buff, "RE3 Assertion Failed!",
|
||||
nCode = ::MessageBoxA(nil, re3_buff, "RELCS Assertion Failed!",
|
||||
MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
|
||||
|
||||
if (nCode == IDABORT)
|
||||
@@ -1081,7 +1209,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
|
||||
abort();
|
||||
#else
|
||||
// TODO
|
||||
printf("\nRE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
|
||||
printf("\nRELCS ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
|
||||
assert(false);
|
||||
#endif
|
||||
}
|
||||
@@ -1133,14 +1261,14 @@ void re3_usererror(const char *format, ...)
|
||||
vsprintf_s(re3_buff, re3_buffsize, format, va);
|
||||
va_end(va);
|
||||
|
||||
::MessageBoxA(nil, re3_buff, "RE3 Error!",
|
||||
::MessageBoxA(nil, re3_buff, "RELCS Error!",
|
||||
MB_OK|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
|
||||
|
||||
raise(SIGABRT);
|
||||
_exit(3);
|
||||
#else
|
||||
vsprintf(re3_buff, format, va);
|
||||
printf("\nRE3 Error!\n\t%s\n",re3_buff);
|
||||
printf("\nRELCS Error!\n\t%s\n",re3_buff);
|
||||
assert(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "World.h"
|
||||
#include "Dummy.h"
|
||||
|
||||
void *CDummy::operator new(size_t sz) { return CPools::GetDummyPool()->New(); }
|
||||
void CDummy::operator delete(void *p, size_t sz) { CPools::GetDummyPool()->Delete((CDummy*)p); }
|
||||
void *CDummy::operator new(size_t sz) throw() { return CPools::GetDummyPool()->New(); }
|
||||
void CDummy::operator delete(void *p, size_t sz) throw() { CPools::GetDummyPool()->Delete((CDummy*)p); }
|
||||
|
||||
void
|
||||
CDummy::Add(void)
|
||||
|
||||
@@ -12,8 +12,8 @@ public:
|
||||
void Add(void);
|
||||
void Remove(void);
|
||||
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
static void *operator new(size_t) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
};
|
||||
|
||||
bool IsDummyPointerValid(CDummy* pDummy);
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
#include "Ped.h"
|
||||
#include "Dummy.h"
|
||||
#include "WindModifiers.h"
|
||||
#include "SpecialFX.h"
|
||||
#include "VisibilityPlugins.h"
|
||||
#include "RpAnimBlend.h"
|
||||
#include "CutsceneMgr.h"
|
||||
|
||||
//--LCS: file done except TODO for distance alpha
|
||||
|
||||
int gBuildings;
|
||||
|
||||
@@ -71,13 +77,18 @@ CEntity::CEntity(void)
|
||||
bDistanceFade = false;
|
||||
|
||||
m_flagE1 = false;
|
||||
m_flagE2 = false;
|
||||
bDontCastShadowsOn = false;
|
||||
bOffscreen = false;
|
||||
bIsStaticWaitingForCollision = false;
|
||||
bDontStream = false;
|
||||
bUnderwater = false;
|
||||
bHasPreRenderEffects = false;
|
||||
|
||||
bIsTreeModel = false;
|
||||
m_flagG2 = false;
|
||||
m_flagG4 = false;
|
||||
m_flagG8 = false;
|
||||
|
||||
m_scanCode = 0;
|
||||
m_modelIndex = -1;
|
||||
m_rwObject = nil;
|
||||
@@ -96,6 +107,8 @@ void
|
||||
CEntity::SetModelIndex(uint32 id)
|
||||
{
|
||||
m_modelIndex = id;
|
||||
bIsTreeModel = IsTreeModel(m_modelIndex);
|
||||
bDrawLast |= bIsTreeModel;
|
||||
bHasPreRenderEffects = HasPreRenderEffects();
|
||||
CreateRwObject();
|
||||
}
|
||||
@@ -104,6 +117,8 @@ void
|
||||
CEntity::SetModelIndexNoCreate(uint32 id)
|
||||
{
|
||||
m_modelIndex = id;
|
||||
bIsTreeModel = IsTreeModel(m_modelIndex);
|
||||
bDrawLast |= bIsTreeModel;
|
||||
bHasPreRenderEffects = HasPreRenderEffects();
|
||||
}
|
||||
|
||||
@@ -122,10 +137,11 @@ CEntity::CreateRwObject(void)
|
||||
if(IsBuilding())
|
||||
gBuildings++;
|
||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||
m_matrix.AttachRW(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false);
|
||||
GetMatrix().AttachRW(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic *)m_rwObject)), false);
|
||||
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
||||
m_matrix.AttachRW(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false);
|
||||
GetMatrix().AttachRW(RwFrameGetMatrix(RpClumpGetFrame((RpClump *)m_rwObject)), false);
|
||||
|
||||
// useless IsTextureLoaded();
|
||||
mi->AddRef();
|
||||
}
|
||||
}
|
||||
@@ -136,9 +152,9 @@ CEntity::AttachToRwObject(RwObject *obj)
|
||||
m_rwObject = obj;
|
||||
if(m_rwObject){
|
||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||
m_matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false);
|
||||
GetMatrix().Attach(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic *)m_rwObject)), false);
|
||||
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
||||
m_matrix.Attach(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false);
|
||||
GetMatrix().Attach(RwFrameGetMatrix(RpClumpGetFrame((RpClump *)m_rwObject)), false);
|
||||
|
||||
CModelInfo::GetModelInfo(m_modelIndex)->AddRef();
|
||||
}
|
||||
@@ -150,7 +166,7 @@ CEntity::DetachFromRwObject(void)
|
||||
if(m_rwObject)
|
||||
CModelInfo::GetModelInfo(m_modelIndex)->RemoveRef();
|
||||
m_rwObject = nil;
|
||||
m_matrix.Detach();
|
||||
GetMatrix().Detach();
|
||||
}
|
||||
|
||||
RpAtomic*
|
||||
@@ -178,13 +194,15 @@ CEntity::DeleteRwObject(void)
|
||||
{
|
||||
RwFrame *f;
|
||||
|
||||
m_matrix.Detach();
|
||||
GetMatrix().Detach();
|
||||
if(m_rwObject){
|
||||
if(RwObjectGetType(m_rwObject) == rpATOMIC){
|
||||
f = RpAtomicGetFrame((RpAtomic*)m_rwObject);
|
||||
CStreaming::UnregisterInstance((RpAtomic*)m_rwObject, nil);
|
||||
RpAtomicDestroy((RpAtomic*)m_rwObject);
|
||||
RwFrameDestroy(f);
|
||||
}else if(RwObjectGetType(m_rwObject) == rpCLUMP){
|
||||
CStreaming::UnregisterInstance((RpClump*)m_rwObject);
|
||||
if(IsClumpSkinned((RpClump*)m_rwObject))
|
||||
RpClumpForAllAtomics((RpClump*)m_rwObject, AtomicRemoveAnimFromSkinCB, nil);
|
||||
RpClumpDestroy((RpClump*)m_rwObject);
|
||||
@@ -201,18 +219,18 @@ CEntity::GetBoundRect(void)
|
||||
{
|
||||
CRect rect;
|
||||
CVector v;
|
||||
CColModel *col = CModelInfo::GetModelInfo(m_modelIndex)->GetColModel();
|
||||
CColModel *col = CModelInfo::GetColModel(m_modelIndex);
|
||||
|
||||
rect.ContainPoint(m_matrix * col->boundingBox.min);
|
||||
rect.ContainPoint(m_matrix * col->boundingBox.max);
|
||||
rect.ContainPoint(GetMatrix() * col->boundingBox.min);
|
||||
rect.ContainPoint(GetMatrix() * col->boundingBox.max);
|
||||
|
||||
v = col->boundingBox.min;
|
||||
v.x = col->boundingBox.max.x;
|
||||
rect.ContainPoint(m_matrix * v);
|
||||
rect.ContainPoint(GetMatrix() * v);
|
||||
|
||||
v = col->boundingBox.max;
|
||||
v.x = col->boundingBox.min.x;
|
||||
rect.ContainPoint(m_matrix * v);
|
||||
rect.ContainPoint(GetMatrix() * v);
|
||||
|
||||
return rect;
|
||||
}
|
||||
@@ -220,21 +238,27 @@ CEntity::GetBoundRect(void)
|
||||
CVector
|
||||
CEntity::GetBoundCentre(void)
|
||||
{
|
||||
CVector v;
|
||||
GetBoundCentre(v);
|
||||
return v;
|
||||
return GetMatrix() * CModelInfo::GetColModel(m_modelIndex)->boundingSphere.center;
|
||||
}
|
||||
|
||||
#ifdef GTA_PS2
|
||||
void
|
||||
CEntity::GetBoundCentre(CVuVector &out)
|
||||
{
|
||||
TransformPoint(out, GetMatrix(), CModelInfo::GetColModel(m_modelIndex)->boundingSphere.center);
|
||||
}
|
||||
#else
|
||||
void
|
||||
CEntity::GetBoundCentre(CVector &out)
|
||||
{
|
||||
out = m_matrix * CModelInfo::GetModelInfo(m_modelIndex)->GetColModel()->boundingSphere.center;
|
||||
out = GetMatrix() * CModelInfo::GetColModel(m_modelIndex)->boundingSphere.center;
|
||||
}
|
||||
#endif
|
||||
|
||||
float
|
||||
CEntity::GetBoundRadius(void)
|
||||
{
|
||||
return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel()->boundingSphere.radius;
|
||||
return CModelInfo::GetColModel(m_modelIndex)->boundingSphere.radius;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -244,9 +268,18 @@ CEntity::UpdateRwFrame(void)
|
||||
RwFrameUpdateObjects((RwFrame*)rwObjectGetParent(m_rwObject));
|
||||
}
|
||||
|
||||
bool
|
||||
PauseEntityAnims(void)
|
||||
{
|
||||
return CSpecialFX::bSnapShotActive;
|
||||
}
|
||||
|
||||
void
|
||||
CEntity::UpdateRpHAnim(void)
|
||||
{
|
||||
if(PauseEntityAnims())
|
||||
return;
|
||||
|
||||
if(IsClumpSkinned(GetClump())){
|
||||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump());
|
||||
RpHAnimHierarchyUpdateMatrices(hier);
|
||||
@@ -308,9 +341,10 @@ CEntity::PreRender(void)
|
||||
if(!bHasPreRenderEffects)
|
||||
return;
|
||||
|
||||
// separate function in LCS but we don't know the name
|
||||
switch(m_type){
|
||||
case ENTITY_TYPE_BUILDING:
|
||||
if(IsTreeModel(GetModelIndex())){
|
||||
if(bIsTreeModel){
|
||||
float dist = (TheCamera.GetPosition() - GetPosition()).Magnitude2D();
|
||||
CObject::fDistToNearestTree = Min(CObject::fDistToNearestTree, dist);
|
||||
ModifyMatrixForTreeInWind();
|
||||
@@ -373,7 +407,7 @@ CEntity::PreRender(void)
|
||||
CVector pos = GetPosition();
|
||||
CShadows::StoreShadowToBeRendered(SHADOWTYPE_DARK,
|
||||
gpShadowPedTex, &pos,
|
||||
0.4f, 0.0f, 0.0f, -0.4f,
|
||||
0.4f, 0.0f, 0.0f, 0.4f,
|
||||
CTimeCycle::GetShadowStrength(),
|
||||
CTimeCycle::GetShadowStrength(),
|
||||
CTimeCycle::GetShadowStrength(),
|
||||
@@ -409,19 +443,65 @@ void
|
||||
CEntity::Render(void)
|
||||
{
|
||||
if(m_rwObject){
|
||||
bImBeingRendered = true;
|
||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||
RpAtomicRender((RpAtomic*)m_rwObject);
|
||||
else
|
||||
RpClumpRender((RpClump*)m_rwObject);
|
||||
bImBeingRendered = false;
|
||||
if(CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject) != 0){
|
||||
// NB: LCS does not use bImBeingRendered here,
|
||||
// but that may be due to the streamed world. better keep it for safety
|
||||
bImBeingRendered = true;
|
||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||
RpAtomicRender((RpAtomic*)m_rwObject);
|
||||
else
|
||||
RpClumpRender((RpClump*)m_rwObject);
|
||||
bImBeingRendered = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CEntity::UpdateDistanceFade(void)
|
||||
{
|
||||
// TODO(LCS):
|
||||
// increasing and decreasing alpha depending on bDistanceFade doesn't make any sense
|
||||
// so disable this whole thing until it does.
|
||||
return;
|
||||
int alpha = CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject);
|
||||
if(CCutsceneMgr::IsRunning() || TheCamera.WorldViewerBeingUsed)
|
||||
alpha = 255;
|
||||
else if(bDistanceFade)
|
||||
alpha = Max(alpha-16, 0);
|
||||
else if(alpha < 255)
|
||||
alpha = Min(alpha+32, 255);
|
||||
CVisibilityPlugins::SetObjectDistanceAlpha(m_rwObject, alpha);
|
||||
}
|
||||
|
||||
void
|
||||
CEntity::UpdateAnim(void)
|
||||
{
|
||||
if(PauseEntityAnims())
|
||||
return;
|
||||
|
||||
if(m_rwObject && RwObjectGetType(m_rwObject) == rpCLUMP && RpAnimBlendClumpGetFirstAssociation(GetClump())) {
|
||||
if (IsObject())
|
||||
RpAnimBlendClumpUpdateAnimations(GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
|
||||
else {
|
||||
if (!bOffscreen)
|
||||
bOffscreen = !GetIsOnScreen();
|
||||
RpAnimBlendClumpUpdateAnimations(GetClump(), CTimer::GetTimeStepInSeconds(), !bOffscreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CEntity::GetIsTouching(CVector const ¢er, float radius)
|
||||
CEntity::GetIsTouching(CVUVECTOR const ¢er, float radius)
|
||||
{
|
||||
return sq(GetBoundRadius()+radius) > (GetBoundCentre()-center).MagnitudeSqr();
|
||||
CVUVECTOR boundCenter;
|
||||
GetBoundCentre(boundCenter);
|
||||
return sq(GetBoundRadius()+radius) > (boundCenter-center).MagnitudeSqr();
|
||||
}
|
||||
|
||||
bool
|
||||
CEntity::GetIsTouching(CEntity *other)
|
||||
{
|
||||
return sq(GetBoundRadius()+other->GetBoundRadius()) > (GetBoundCentre()-other->GetBoundCentre()).MagnitudeSqr();
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -439,8 +519,7 @@ CEntity::IsVisibleComplex(void)
|
||||
bool
|
||||
CEntity::GetIsOnScreen(void)
|
||||
{
|
||||
return TheCamera.IsSphereVisible(GetBoundCentre(), GetBoundRadius(),
|
||||
&TheCamera.GetCameraMatrix());
|
||||
return TheCamera.IsSphereVisible(GetBoundCentre(), GetBoundRadius());
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -456,7 +535,7 @@ CEntity::GetIsOnScreenComplex(void)
|
||||
return true;
|
||||
|
||||
CRect rect = GetBoundRect();
|
||||
CColModel *colmodel = CModelInfo::GetModelInfo(m_modelIndex)->GetColModel();
|
||||
CColModel *colmodel = CModelInfo::GetColModel(m_modelIndex);
|
||||
float z = GetPosition().z;
|
||||
float minz = z + colmodel->boundingBox.min.z;
|
||||
float maxz = z + colmodel->boundingBox.max.z;
|
||||
@@ -611,7 +690,7 @@ CEntity::Remove(void)
|
||||
float
|
||||
CEntity::GetDistanceFromCentreOfMassToBaseOfModel(void)
|
||||
{
|
||||
return -CModelInfo::GetModelInfo(m_modelIndex)->GetColModel()->boundingBox.min.z;
|
||||
return -CModelInfo::GetColModel(m_modelIndex)->boundingBox.min.z;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -737,11 +816,6 @@ CEntity::PreRenderForGlassWindow(void)
|
||||
bIsVisible = false;
|
||||
}
|
||||
|
||||
/*
|
||||
0x487A10 - SetAtomicAlphaCB
|
||||
0x4879E0 - SetClumpAlphaCB
|
||||
*/
|
||||
|
||||
RpMaterial*
|
||||
SetAtomicAlphaCB(RpMaterial *material, void *data)
|
||||
{
|
||||
@@ -840,7 +914,7 @@ CEntity::SaveEntityFlags(uint8*& buf)
|
||||
if (bDistanceFade) tmp |= BIT(7);
|
||||
|
||||
if (m_flagE1) tmp |= BIT(8);
|
||||
if (m_flagE2) tmp |= BIT(9);
|
||||
if (bDontCastShadowsOn) tmp |= BIT(9);
|
||||
if (bOffscreen) tmp |= BIT(10);
|
||||
if (bIsStaticWaitingForCollision) tmp |= BIT(11);
|
||||
if (bDontStream) tmp |= BIT(12);
|
||||
@@ -896,7 +970,7 @@ CEntity::LoadEntityFlags(uint8*& buf)
|
||||
bDistanceFade = !!(tmp & BIT(7));
|
||||
|
||||
m_flagE1 = !!(tmp & BIT(8));
|
||||
m_flagE2 = !!(tmp & BIT(9));
|
||||
bDontCastShadowsOn = !!(tmp & BIT(9));
|
||||
bOffscreen = !!(tmp & BIT(10));
|
||||
bIsStaticWaitingForCollision = !!(tmp & BIT(11));
|
||||
bDontStream = !!(tmp & BIT(12));
|
||||
|
||||
@@ -45,6 +45,7 @@ private:
|
||||
uint32 m_status : 5;
|
||||
public:
|
||||
// flagsA
|
||||
// LCS flagsB 02
|
||||
uint32 bUsesCollision : 1; // does entity use collision
|
||||
uint32 bCollisionProcessed : 1; // has object been processed by a ProcessEntityCollision function
|
||||
uint32 bIsStatic : 1; // is entity static
|
||||
@@ -52,6 +53,7 @@ public:
|
||||
uint32 bPedPhysics : 1;
|
||||
uint32 bIsStuck : 1; // is entity stuck
|
||||
uint32 bIsInSafePosition : 1; // is entity in a collision free safe position
|
||||
// LCS flagsC
|
||||
uint32 bUseCollisionRecords : 1;
|
||||
|
||||
// flagsB
|
||||
@@ -62,6 +64,7 @@ public:
|
||||
uint32 bRenderScorched : 1;
|
||||
uint32 bHasBlip : 1;
|
||||
uint32 bIsBIGBuilding : 1; // Set if this entity is a big building
|
||||
// LCS flagsD
|
||||
uint32 bStreamBIGBuilding : 1; // set when draw dist <= 2000
|
||||
|
||||
// flagsC
|
||||
@@ -72,6 +75,7 @@ public:
|
||||
uint32 bMeleeProof : 1;
|
||||
uint32 bOnlyDamagedByPlayer : 1;
|
||||
uint32 bStreamingDontDelete : 1; // Dont let the streaming remove this
|
||||
// LCS flagsE
|
||||
uint32 bRemoveFromWorld : 1; // remove this entity next time it should be processed
|
||||
|
||||
// flagsD
|
||||
@@ -82,17 +86,24 @@ public:
|
||||
uint32 bDrawLast : 1; // draw object last
|
||||
uint32 bNoBrightHeadLights : 1;
|
||||
uint32 bDoNotRender : 1; //-- only applies to CObjects apparently
|
||||
// LCS flagsF
|
||||
uint32 bDistanceFade : 1; // Fade entity because it is far away
|
||||
|
||||
// flagsE
|
||||
uint32 m_flagE1 : 1;
|
||||
uint32 m_flagE2 : 1;
|
||||
uint32 bDontCastShadowsOn : 1; // Dont cast shadows on this object
|
||||
uint32 bOffscreen : 1; // offscreen flag. This can only be trusted when it is set to true
|
||||
uint32 bIsStaticWaitingForCollision : 1; // this is used by script created entities - they are static until the collision is loaded below them
|
||||
uint32 bDontStream : 1; // tell the streaming not to stream me
|
||||
uint32 bUnderwater : 1; // this object is underwater change drawing order
|
||||
uint32 bHasPreRenderEffects : 1; // Object has a prerender effects attached to it
|
||||
|
||||
// LCS flagsG
|
||||
uint32 bIsTreeModel : 1;
|
||||
uint32 m_flagG2 : 1;
|
||||
uint32 m_flagG4 : 1;
|
||||
uint32 m_flagG8 : 1;
|
||||
|
||||
uint16 m_scanCode;
|
||||
uint16 m_randomSeed;
|
||||
int16 m_modelIndex;
|
||||
@@ -120,6 +131,7 @@ public:
|
||||
|
||||
virtual void Add(void);
|
||||
virtual void Remove(void);
|
||||
virtual bool UpdatesInCutscene(void) { return false; }
|
||||
virtual void SetModelIndex(uint32 id);
|
||||
virtual void SetModelIndexNoCreate(uint32 id);
|
||||
virtual void CreateRwObject(void);
|
||||
@@ -131,6 +143,7 @@ public:
|
||||
virtual void Teleport(CVector v) {}
|
||||
virtual void PreRender(void);
|
||||
virtual void Render(void);
|
||||
virtual void UpdateAnim(void);
|
||||
virtual bool SetupLighting(void);
|
||||
virtual void RemoveLighting(bool);
|
||||
virtual void FlagToDestroyWhenNextProcessed(void) {}
|
||||
@@ -150,11 +163,13 @@ public:
|
||||
return (RpClump*)m_rwObject;
|
||||
}
|
||||
|
||||
void GetBoundCentre(CVector &out);
|
||||
void UpdateDistanceFade(void);
|
||||
void GetBoundCentre(CVUVECTOR &out);
|
||||
CVector GetBoundCentre(void);
|
||||
float GetBoundRadius(void);
|
||||
float GetDistanceFromCentreOfMassToBaseOfModel(void);
|
||||
bool GetIsTouching(CVector const ¢er, float r);
|
||||
bool GetIsTouching(CVUVECTOR const ¢er, float r);
|
||||
bool GetIsTouching(CEntity *other);
|
||||
bool GetIsOnScreen(void);
|
||||
bool GetIsOnScreenComplex(void);
|
||||
bool IsVisible(void);
|
||||
|
||||
@@ -224,7 +224,7 @@ CPhysical::RemoveAndAdd(void)
|
||||
CRect
|
||||
CPhysical::GetBoundRect(void)
|
||||
{
|
||||
CVector center;
|
||||
CVUVECTOR center;
|
||||
float radius;
|
||||
GetBoundCentre(center);
|
||||
radius = GetBoundRadius();
|
||||
@@ -463,7 +463,7 @@ CPhysical::ApplyMoveForce(float jx, float jy, float jz)
|
||||
void
|
||||
CPhysical::ApplyTurnForce(float jx, float jy, float jz, float px, float py, float pz)
|
||||
{
|
||||
CVector com = Multiply3x3(m_matrix, m_vecCentreOfMass);
|
||||
CVector com = Multiply3x3(GetMatrix(), m_vecCentreOfMass);
|
||||
CVector turnimpulse = CrossProduct(CVector(px, py, pz)-com, CVector(jx, jy, jz));
|
||||
m_vecTurnSpeed += turnimpulse*(1.0f/m_fTurnMass);
|
||||
m_vecTurnSpeed.x = clamp(m_vecTurnSpeed.x, -4.0f, 4.0f);
|
||||
@@ -482,7 +482,7 @@ CPhysical::ApplyFrictionMoveForce(float jx, float jy, float jz)
|
||||
void
|
||||
CPhysical::ApplyFrictionTurnForce(float jx, float jy, float jz, float px, float py, float pz)
|
||||
{
|
||||
CVector com = Multiply3x3(m_matrix, m_vecCentreOfMass);
|
||||
CVector com = Multiply3x3(GetMatrix(), m_vecCentreOfMass);
|
||||
CVector turnimpulse = CrossProduct(CVector(px, py, pz)-com, CVector(jx, jy, jz));
|
||||
m_vecTurnFriction += turnimpulse*(1.0f/m_fTurnMass);
|
||||
}
|
||||
@@ -1046,7 +1046,7 @@ CPhysical::ApplyCollisionAlt(CEntity *B, CColPoint &colpoint, float &impulse, CV
|
||||
moveSpeed += vImpulse * (1.0f/m_fMass);
|
||||
|
||||
// ApplyTurnForce
|
||||
CVector com = Multiply3x3(m_matrix, m_vecCentreOfMass);
|
||||
CVector com = Multiply3x3(GetMatrix(), m_vecCentreOfMass);
|
||||
CVector turnimpulse = CrossProduct(pointpos-com, vImpulse);
|
||||
turnSpeed += turnimpulse*(1.0f/m_fTurnMass);
|
||||
|
||||
@@ -1282,7 +1282,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
|
||||
CPhysical *A, *B;
|
||||
CObject *Bobj;
|
||||
bool canshift;
|
||||
CVector center;
|
||||
CVUVECTOR center;
|
||||
float radius;
|
||||
|
||||
int numCollisions;
|
||||
@@ -1441,7 +1441,7 @@ CPhysical::ProcessCollisionSectorList_SimpleCar(CPtrList *lists)
|
||||
{
|
||||
static CColPoint aColPoints[MAX_COLLISION_POINTS];
|
||||
float radius;
|
||||
CVector center;
|
||||
CVUVECTOR center;
|
||||
int listtype;
|
||||
CPhysical *A, *B;
|
||||
int numCollisions;
|
||||
@@ -1608,7 +1608,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
|
||||
{
|
||||
static CColPoint aColPoints[MAX_COLLISION_POINTS];
|
||||
float radius;
|
||||
CVector center;
|
||||
CVUVECTOR center;
|
||||
CPtrList *list;
|
||||
CPhysical *A, *B;
|
||||
CObject *Aobj, *Bobj;
|
||||
|
||||
2
src/extras/GitSHA1.cpp.in
Normal file
2
src/extras/GitSHA1.cpp.in
Normal file
@@ -0,0 +1,2 @@
|
||||
#define GIT_SHA1 "@GIT_SHA1@"
|
||||
const char* g_GIT_SHA1 = GIT_SHA1;
|
||||
1
src/extras/GitSHA1.h
Normal file
1
src/extras/GitSHA1.h
Normal file
@@ -0,0 +1 @@
|
||||
extern const char* g_GIT_SHA1;
|
||||
@@ -111,13 +111,7 @@ leedsVehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||
lightingCB(atomic);
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -167,9 +161,7 @@ leedsVehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
|
||||
SetRenderState(SRCBLEND, BLENDSRCALPHA);
|
||||
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -200,13 +192,7 @@ leedsVehicleRenderCB_mobile(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *hea
|
||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||
lightingCB(atomic);
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -251,9 +237,7 @@ leedsVehicleRenderCB_mobile(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *hea
|
||||
|
||||
setTexture(1, nil);
|
||||
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -310,13 +294,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||
lightingCB(atomic);
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -357,9 +335,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
|
||||
SetRenderState(SRCBLEND, BLENDSRCALPHA);
|
||||
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -382,7 +358,7 @@ CreateVehiclePipe(void)
|
||||
{
|
||||
#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 *vs[] = { shaderDecl, "#define DIRECTIONALS\n", header_vert_src, neoVehicle_vert_src, nil };
|
||||
const char *fs[] = { shaderDecl, header_frag_src, neoVehicle_frag_src, nil };
|
||||
neoVehicleShader = Shader::create(vs, fs);
|
||||
assert(neoVehicleShader);
|
||||
@@ -455,13 +431,7 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
|
||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -494,9 +464,7 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
drawInst(header, inst);
|
||||
inst++;
|
||||
}
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -564,13 +532,7 @@ glossRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
|
||||
Material *m;
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -608,9 +570,7 @@ glossRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
SetRenderState(SRCBLEND, BLENDSRCALPHA);
|
||||
SetRenderState(DESTBLEND, BLENDINVSRCALPHA);
|
||||
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -693,13 +653,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||
lightingCB(atomic);
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -722,9 +676,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
drawInst(header, inst);
|
||||
inst++;
|
||||
}
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -743,13 +695,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||
lightingCB(atomic);
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(header->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(header);
|
||||
|
||||
InstanceData *inst = header->inst;
|
||||
rw::int32 n = header->numMeshes;
|
||||
@@ -770,9 +716,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||
drawInst(header, inst);
|
||||
inst++;
|
||||
}
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(header);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -794,7 +738,7 @@ CreateRimLightPipes(void)
|
||||
{
|
||||
#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 *vs[] = { shaderDecl, "#define DIRECTIONALS\n", header_vert_src, neoRimSkin_vert_src, nil };
|
||||
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
|
||||
neoRimSkinShader = Shader::create(vs, fs);
|
||||
assert(neoRimSkinShader);
|
||||
@@ -803,7 +747,7 @@ CreateRimLightPipes(void)
|
||||
{
|
||||
#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 *vs[] = { shaderDecl, "#define DIRECTIONALS\n", header_vert_src, neoRim_vert_src, nil };
|
||||
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
|
||||
neoRimShader = Shader::create(vs, fs);
|
||||
assert(neoRimShader);
|
||||
@@ -938,13 +882,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
|
||||
else
|
||||
CustomPipes::leedsWorldShader->use();
|
||||
setWorldMatrix(&building->matrix);
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(building->instHeader->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, building->instHeader->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, building->instHeader->vbo);
|
||||
setAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(building->instHeader);
|
||||
|
||||
CustomPipes::uploadWorldLights();
|
||||
|
||||
@@ -965,9 +903,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
|
||||
|
||||
drawInst(building->instHeader, inst);
|
||||
}
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(building->instHeader);
|
||||
if(defer)
|
||||
numBlendInsts[pass]++;
|
||||
}
|
||||
@@ -1010,13 +946,7 @@ RenderBlendPass(int pass)
|
||||
for(i = 0; i < numBlendInsts[pass]; i++){
|
||||
BuildingInst *building = &blendInsts[pass][i];
|
||||
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glBindVertexArray(building->instHeader->vao);
|
||||
#else
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, building->instHeader->ibo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, building->instHeader->vbo);
|
||||
setAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
|
||||
#endif
|
||||
setupVertexInput(building->instHeader);
|
||||
setWorldMatrix(&building->matrix);
|
||||
|
||||
InstanceData *inst = building->instHeader->inst;
|
||||
@@ -1041,9 +971,7 @@ RenderBlendPass(int pass)
|
||||
|
||||
drawInst(building->instHeader, inst);
|
||||
}
|
||||
#ifndef RW_GL_USE_VAOS
|
||||
disableAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
|
||||
#endif
|
||||
teardownVertexInput(building->instHeader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#error "Need librw for EXTENDED_COLOURFILTER"
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
#include "RwHelper.h"
|
||||
#include "Camera.h"
|
||||
#include "MBlur.h"
|
||||
@@ -50,6 +51,9 @@ CPostFX::InitOnce(void)
|
||||
void
|
||||
CPostFX::Open(RwCamera *cam)
|
||||
{
|
||||
if(pFrontBuffer)
|
||||
Close();
|
||||
|
||||
uint32 width = Pow(2.0f, int32(log2(RwRasterGetWidth (RwCameraGetRaster(cam))))+1);
|
||||
uint32 height = Pow(2.0f, int32(log2(RwRasterGetHeight(RwCameraGetRaster(cam))))+1);
|
||||
uint32 depth = RwRasterGetDepth(RwCameraGetRaster(cam));
|
||||
@@ -407,6 +411,8 @@ CPostFX::GetBackBuffer(RwCamera *cam)
|
||||
void
|
||||
CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha)
|
||||
{
|
||||
PUSH_RENDERGROUP("CPostFX::Render");
|
||||
|
||||
// LCS PS2 blur is drawn in three passes:
|
||||
// blend frame with current frame 3 times to blur a bit
|
||||
// blend one more time with colour filter
|
||||
@@ -475,6 +481,8 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
|
||||
bJustInitialised = false;
|
||||
}else
|
||||
bJustInitialised = true;
|
||||
|
||||
POP_RENDERGROUP();
|
||||
}
|
||||
|
||||
int CPostFX::PrevRed[NUMAVERAGE], CPostFX::AvgRed;
|
||||
|
||||
@@ -13,7 +13,7 @@ main(void)
|
||||
|
||||
vec4 color;
|
||||
color.rgb = dst.rgb;
|
||||
color.a = 1.0f;
|
||||
color.a = 1.0;
|
||||
|
||||
FRAGCOLOR(color);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user