1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-22 17:50:01 +00:00

Merge remote-tracking branch 'origin/miami' into lcs

# Conflicts:
#	.github/workflows/reLCS_msvc_amd64.yml
#	.github/workflows/reLCS_msvc_x86.yml
#	README.md
#	gamefiles/TEXT/american.gxt
#	gamefiles/TEXT/french.gxt
#	gamefiles/TEXT/german.gxt
#	gamefiles/TEXT/italian.gxt
#	gamefiles/TEXT/spanish.gxt
#	premake5.lua
#	src/animation/AnimManager.cpp
#	src/animation/AnimationId.h
#	src/audio/MusicManager.cpp
#	src/audio/audio_enums.h
#	src/control/Script7.cpp
#	src/core/FileLoader.cpp
#	src/core/re3.cpp
#	src/extras/custompipes_d3d9.cpp
#	src/extras/custompipes_gl.cpp
#	src/extras/postfx.cpp
#	src/extras/shaders/colourfilterVC.frag
#	src/extras/shaders/colourfilterVC_PS.hlsl
#	src/extras/shaders/make_hlsl.cmd
#	src/extras/shaders/obj/colourfilterVC_PS.cso
#	src/extras/shaders/obj/colourfilterVC_PS.inc
#	src/extras/shaders/obj/colourfilterVC_frag.inc
#	src/peds/PedFight.cpp
#	src/render/Font.cpp
#	src/render/Hud.cpp
#	src/render/Particle.cpp
#	src/render/WaterCannon.cpp
#	src/skel/win/gtavc.ico
#	src/vehicles/Automobile.cpp
#	utils/gxt/american.txt
#	utils/gxt/french.txt
#	utils/gxt/german.txt
#	utils/gxt/italian.txt
#	utils/gxt/spanish.txt
This commit is contained in:
Sergeanur 2021-02-16 18:08:19 +02:00
commit e38467ef3a
114 changed files with 5143 additions and 2112 deletions

13
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,13 @@
As long as it's not linux/cross-platform skeleton/compatibility layer, all of the code on the repo that's not behind a preprocessor condition(like FIX_BUGS) are **completely** reversed code from original binaries.
We **don't** accept custom codes, as long as it's not wrapped via preprocessor conditions, or it's linux/cross-platform skeleton/compatibility layer.
We accept only these kinds of PRs;
- A new feature that exists in at least one of the GTAs (if it wasn't in III/VC then it doesn't have to be decompilation)
- Game, UI or UX bug fixes (if it's a fix to R* code, it should be behind FIX_BUGS)
- Platform-specific and/or unused code that's not been reversed yet
- Makes reversed code more understandable/accurate, as in "which code would produce this assembly".
- A new cross-platform skeleton/compatibility layer, or improvements to them
- Translation fixes, for languages R* supported/outsourced
- Code that increase maintainability

View file

@ -20,7 +20,7 @@ jobs:
strategy: strategy:
matrix: matrix:
platform: [win-amd64-librw_d3d9-oal, win-amd64-librw_gl3_glfw-oal] platform: [win-amd64-librw_d3d9-oal, win-amd64-librw_gl3_glfw-oal]
buildtype: [Debug, Release] buildtype: [Debug, Release, Vanilla]
steps: steps:
- name: Add msbuild to PATH - name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2 uses: microsoft/setup-msbuild@v1.0.2
@ -48,14 +48,22 @@ jobs:
- name: Build - name: Build
run: | run: |
msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}} msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
- name: Pack artifacts # - name: Pack artifacts
# run: |
# 7z a reLCS_${{matrix.buildtype}}_${{matrix.platform}}.zip ./bin/${{matrix.platform}}/${{matrix.buildtype}}/*
- name: Move binaries to gamefiles
run: | run: |
7z a reLCS_${{matrix.buildtype}}_${{matrix.platform}}.zip ./bin/${{matrix.platform}}/${{matrix.buildtype}}/* mv ./bin/${{matrix.platform}}/${{matrix.buildtype}}/reLCS.exe ./gamefiles/
mv ./bin/${{matrix.platform}}/${{matrix.buildtype}}/reLCS.pdb ./gamefiles/
- name: Move dynamic dependencies to gamefiles
run: |
mv ./vendor/mpg123/dist/Win64/libmpg123-0.dll ./gamefiles/
mv ./vendor/openal-soft/dist/Win64/OpenAL32.dll ./gamefiles/
- name: Upload artifact to actions - name: Upload artifact to actions
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: reLCS_${{matrix.buildtype}}_${{matrix.platform}} name: reLCS_${{matrix.buildtype}}_${{matrix.platform}}
path: ./bin/${{matrix.platform}}/${{matrix.buildtype}} path: ./gamefiles/*
# - name: Upload artifact to Bintray # - name: Upload artifact to Bintray
# uses: hpcsc/upload-bintray-docker-action@v1 # uses: hpcsc/upload-bintray-docker-action@v1
# with: # with:

View file

@ -20,7 +20,7 @@ jobs:
strategy: strategy:
matrix: matrix:
platform: [win-x86-librw_d3d9-mss, win-x86-librw_gl3_glfw-mss, win-x86-librw_d3d9-oal, win-x86-librw_gl3_glfw-oal] platform: [win-x86-librw_d3d9-mss, win-x86-librw_gl3_glfw-mss, win-x86-librw_d3d9-oal, win-x86-librw_gl3_glfw-oal]
buildtype: [Debug, Release] buildtype: [Debug, Release, Vanilla]
steps: steps:
- name: Add msbuild to PATH - name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2 uses: microsoft/setup-msbuild@v1.0.2
@ -48,14 +48,23 @@ jobs:
- name: Build - name: Build
run: | run: |
msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}} msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
- name: Pack artifacts # - name: Pack artifacts
# run: |
# 7z a reLCS_${{matrix.buildtype}}_${{matrix.platform}}.zip ./bin/${{matrix.platform}}/${{matrix.buildtype}}/*
- name: Move binaries to gamefiles
run: | run: |
7z a reLCS_${{matrix.buildtype}}_${{matrix.platform}}.zip ./bin/${{matrix.platform}}/${{matrix.buildtype}}/* mv ./bin/${{matrix.platform}}/${{matrix.buildtype}}/reLCS.exe ./gamefiles/
mv ./bin/${{matrix.platform}}/${{matrix.buildtype}}/reLCS.pdb ./gamefiles/
- if: contains(matrix.platform, 'oal')
name: Move dynamic dependencies to gamefiles
run: |
mv ./vendor/mpg123/dist/Win32/libmpg123-0.dll ./gamefiles/
mv ./vendor/openal-soft/dist/Win32/OpenAL32.dll ./gamefiles/
- name: Upload artifact to actions - name: Upload artifact to actions
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: reLCS_${{matrix.buildtype}}_${{matrix.platform}} name: reLCS_${{matrix.buildtype}}_${{matrix.platform}}
path: reLCS_${{matrix.buildtype}}_${{matrix.platform}}.zip path: ./gamefiles/*
# - name: Upload artifact to Bintray # - name: Upload artifact to Bintray
# uses: hpcsc/upload-bintray-docker-action@v1 # uses: hpcsc/upload-bintray-docker-action@v1
# with: # with:

4
.gitignore vendored
View file

@ -357,4 +357,6 @@ sdk/
codewarrior/reVC_Data/ codewarrior/reVC_Data/
codewarrior/Release/ codewarrior/Release/
codewarrior/Debug/ codewarrior/Debug/
src/extras/GitSHA1.cpp

View file

@ -6,6 +6,10 @@ set(PROJECT RELCS)
project(${EXECUTABLE} C CXX) project(${EXECUTABLE} C CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1 "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
message(STATUS "Building ${CMAKE_PROJECT_NAME} GIT SHA1: ${GIT_SHA1}")
if(WIN32) if(WIN32)
set(${PROJECT}_AUDIOS "OAL" "MSS") set(${PROJECT}_AUDIOS "OAL" "MSS")
else() else()

193
README.md
View file

@ -1,37 +1,190 @@
# reLCS <img src="https://github.com/GTAmodding/re3/blob/miami/logo.png?raw=true" alt="reVC logo" width="200">
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dlcs&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=lcs)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dmiami&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=miami)
<a href="https://discord.gg/ERYg58ttcE"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a> <a href="https://discord.gg/ERYg58ttcE"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>
## Intro ## Intro
The aim of this project is to reverse GTA Liberty City Stories. In this repository you'll find the fully reversed source code for GTA III ([master](https://github.com/GTAmodding/re3/tree/master/) branch) and GTA VC ([miami](https://github.com/GTAmodding/re3/tree/miami/) branch).
It has been tested and works on Windows, Linux and FreeBSD, on x86, amd64, arm and arm64.\
Rendering is handled either by original RenderWare (D3D8)
or the reimplementation [librw](https://github.com/aap/librw) (D3D9, OpenGL 2.1 or above, OpenGL ES 2.0 or above).\
Audio is done with MSS (using dlls from original GTA) or OpenAL.
We cannot build for PS2 or Xbox yet. If you're interested in doing so, get in touch with us.
## How can I try it? ## How can I try it?
- reLCS requires game assets to work. - reVC requires game assets to work, so you **must** own [a copy of GTA Vice City](https://store.steampowered.com/app/12110/Grand_Theft_Auto_Vice_City/).
- Build reLCS or download it from one of the above links (Debug or Release). - Build reVC or download the latest nightly build:
- (Optional) If you want to use optional features, copy the files in /gamefiles folder to your game root folder. - [Windows D3D9 MSS 32bit](https://nightly.link/GTAmodding/re3/workflows/reVC_msvc_x86/miami/reVC_Release_win-x86-librw_d3d9-mss.zip)
- Move reLCS.exe to GTA LCS directory and run it. - [Windows D3D9 64bit](https://nightly.link/GTAmodding/re3/workflows/reVC_msvc_amd64/miami/reVC_Release_win-amd64-librw_d3d9-oal.zip)
- [Windows OpenGL 64bit](https://nightly.link/GTAmodding/re3/workflows/reVC_msvc_amd64/miami/reVC_Release_win-amd64-librw_gl3_glfw-oal.zip)
- [Linux 64bit](https://nightly.link/GTAmodding/re3/workflows/build-cmake-conan/miami/ubuntu-latest-gl3.zip)
- [MacOS 64bit](https://nightly.link/GTAmodding/re3/workflows/build-cmake-conan/miami/macos-latest-gl3.zip)
- Extract the downloaded zip over your GTA VC directory and run reVC. The zip includes the gamefiles and in case of OpenAL the required dlls.
## Preparing the environment for building ## Screenshots
You may want to point GTA_LCS_RE_DIR environment variable to GTA LCS root folder if you want executable to be moved there via post-build script. ![screen_ 1613087332](https://user-images.githubusercontent.com/1521437/107714111-f84f3200-6ccc-11eb-902e-d757481d579a.png)
![screen_ 1613086852](https://user-images.githubusercontent.com/1521437/107714115-fa18f580-6ccc-11eb-9de5-eb4cd04865d3.png)
![screen_ 1613086989](https://user-images.githubusercontent.com/1521437/107714103-f38a7e00-6ccc-11eb-88a3-c8c2033c51d6.png)
![screen_ 1613087193](https://user-images.githubusercontent.com/1521437/107714106-f4bbab00-6ccc-11eb-96a9-13821d9b9684.png)
- For Linux, proceed: [Building on Linux](https://github.com/GTAmodding/re3/wiki/Building-on-Linux) ## Improvements
- For FreeBSD, proceed: [Building on FreeBSD](https://github.com/GTAmodding/re3/wiki/Building-on-FreeBSD)
- For Windows, assuming you have Visual Studio: We have implemented a number of changes and improvements to the original game.
- Clone the repo using the argument `--recursive`. They can be configured in `core/config.h`.
- Run one of the `premake-vsXXXX.cmd` variants on root folder. Some of them can be toggled at runtime, some cannot.
- Open the project via Visual Studio
* Fixed a lot of smaller and bigger bugs
* User files (saves and settings) stored in GTA root directory
* Settings stored in reVC.ini file instead of gta_vc.set
* Debug menu to do and change various things (Ctrl-M to open)
* Debug camera (Ctrl-B to toggle)
* Rotatable camera
* XInput controller support (Windows)
* No loading screens between islands ("map memory usage" in menu)
* Rendering
* Widescreen support (properly scaled HUD, Menu and FOV)
* PS2 MatFX (vehicle reflections)
* PS2 alpha test (better rendering of transparency)
* Xbox vehicle rendering
* Xbox world lightmap rendering (needs Xbox map)
* Xbox ped rim light
* Xbox screen rain droplets
* More customizable colourfilter
* Menu
* More options
* Controller configuration menu
* ...
* Can load DFFs and TXDs from other platforms, possibly with a performance penalty
* ...
## To-Do
The following things would be nice to have/do:
* Fix physics for high FPS
* Improve performance on lower end devices, especially the OpenGL layer on the Raspberry Pi (if you have experience with this, please get in touch)
* [PS2 port](https://github.com/GTAmodding/re3/wiki/PS2-port)
* Xbox port (not quite as important)
* reverse remaining unused/debug functions
* compare CodeWarrior build with original binary for more accurate code (very tedious)
## Modding
Asset modifications (models, texture, handling, script, ...) should work the same way as with original GTA for the most part.
Mods that make changes to the code (dll/asi, CLEO, limit adjusters) will *not* work.
Some things these mods do are already implemented in re3 (much of SkyGFX, GInput, SilentPatch, Widescreen fix),
others can easily be achieved (increasing limis, see `config.h`),
others will simply have to be rewritten and integrated into the code directly.
Sorry for the inconvenience.
## Building from Source
When using premake, you may want to point GTA_VC_RE_DIR environment variable to GTA Vice City root folder if you want the executable to be moved there via post-build script.
Clone the repository with `git clone --recursive -b miami https://github.com/GTAmodding/re3.git reVC`. Then `cd reVC` into the cloned repository.
<details><summary>Linux Premake</summary>
For Linux using premake, proceed: [Building on Linux](https://github.com/GTAmodding/re3/wiki/Building-on-Linux)
</details>
<details><summary>Linux Conan</summary>
Install python and conan, and then run build.
```
conan export vendor/librw librw/master@
mkdir build
cd build
conan install .. reVC/master@ -if build -o reVC:audio=openal -o librw:platform=gl3 -o librw:gl3_gfxlib=glfw --build missing -s reVC:build_type=RelWithDebInfo -s librw:build_type=RelWithDebInfo
conan build .. -if build -bf build -pf package
```
</details>
<details><summary>FreeBSD</summary>
For FreeBSD using premake, proceed: [Building on FreeBSD](https://github.com/GTAmodding/re3/wiki/Building-on-FreeBSD)
</details>
<details><summary>Windows</summary>
Assuming you have Visual Studio 2015/2017/2019:
- Run one of the `premake-vsXXXX.cmd` variants on root folder.
- Open build/reVC.sln with Visual Studio and compile the solution.
**If you use 64-bit D3D9**: We don't ship 64-bit Dx9 SDK. You need to download it from Microsoft if you don't have it(although it should come pre-installed after some Windows version) Microsoft recently discontinued its downloads of the DX9 SDK. You can download an archived version here: https://archive.org/details/dxsdk_jun10
There are various settings at the very bottom of [config.h](https://github.com/GTAmodding/re3/tree/lcs/src/core/config.h), you may want to take a look there. i.e. FIX_BUGS define fixes the bugs we've come across. **If you choose OpenAL on Windows** You must read [Running OpenAL build on Windows](https://github.com/GTAmodding/re3/wiki/Running-OpenAL-build-on-Windows).
</details>
> :information_source: **If you choose OpenAL on Windows** You must read [Running OpenAL build on Windows](https://github.com/GTAmodding/re3/wiki/Running-OpenAL-build-on-Windows). > :information_source: premake has an `--lto` option if you want the project to be compiled with Link Time Optimization.
> :information_source: **Did you notice librw?** reLCS uses completely homebrew RenderWare-replacement rendering engine; [librw](https://github.com/aap/librw/). librw comes as submodule of reLCS, but you also can use LIBRW enviorenment variable to specify path to your own librw. > :information_source: There are various settings in [config.h](https://github.com/GTAmodding/re3/tree/miami/src/core/config.h), you may want to take a look there.
> :information_source: reVC uses completely homebrew RenderWare-replacement rendering engine; [librw](https://github.com/aap/librw/). librw comes as submodule of re3, but you also can use LIBRW enviorenment variable to specify path to your own librw.
If you feel the need, you can also use CodeWarrior 7 to compile reVC using the supplied codewarrior/reVC.mcp project - this requires the original RW34 libraries, and the DX8 SDK. The build is unstable compared to the MSVC builds though, and is mostly meant to serve as a reference.
## Contributing ## Contributing
Please read the [Coding Style](https://github.com/GTAmodding/re3/blob/master/CODING_STYLE.md) Document As long as it's not linux/cross-platform skeleton/compatibility layer, all of the code on the repo that's not behind a preprocessor condition(like FIX_BUGS) are **completely** reversed code from original binaries.
We **don't** accept custom codes, as long as it's not wrapped via preprocessor conditions, or it's linux/cross-platform skeleton/compatibility layer.
We accept only these kinds of PRs;
- A new feature that exists in at least one of the GTAs (if it wasn't in III/VC then it doesn't have to be decompilation)
- Game, UI or UX bug fixes (if it's a fix to original code, it should be behind FIX_BUGS)
- Platform-specific and/or unused code that's not been reversed yet
- Makes reversed code more understandable/accurate, as in "which code would produce this assembly".
- A new cross-platform skeleton/compatibility layer, or improvements to them
- Translation fixes, for languages original game supported
- Code that increase maintainability
We have a [Coding Style](https://github.com/GTAmodding/re3/blob/master/CODING_STYLE.md) document that isn't followed or enforced very well.
Do not use features from C++11 or later.
## History
re3 was started sometime in the spring of 2018,
initially as a way to test reversed collision and physics code
inside the game.
This was done by replacing single functions of the game
with their reversed counterparts using a dll.
After a bit of work the project lay dormant for about a year
and was picked up again and pushed to github in May 2019.
At the time I (aap) had reversed around 10k lines of code and estimated
the final game to have around 200-250k.
Others quickly joined the effort (Fire_Head, shfil, erorcun and Nick007J
in time order, and Serge a bit later) and we made very quick progress
throughout the summer of 2019
after which the pace slowed down a bit.
Due to everyone staying home during the start of the Corona pandemic
everybody had a lot of time to work on re3 again and
we finally got a standalone exe in April 2020 (around 180k lines by then).
After the initial excitement and fixing and polishing the code further,
reVC was started in early May 2020 by starting from re3 code,
not by starting from scratch replacing functions with a dll.
After a few months of mostly steady progress we considered reVC
finished in December.
Since then we have started reLCS, which is currently work in progress.
## License
We don't feel like we're in a position to give this code a license.\
The code should only be used for educational, documentation and modding purposes.\
We do not encourage piracy or commercial use.\
Please keep derivate work open source and give proper credit.

View file

@ -0,0 +1,284 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the working tree (--dirty option),
# and adjusting the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
# Uses the return code of "git diff-index --quiet HEAD --".
# Does not regard untracked files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
# http://academic.cleardefinition.com
#
# Copyright 2009-2013, Iowa State University.
# Copyright 2013-2020, Ryan Pavlik
# Copyright 2013-2020, Contributors
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
# Function _git_find_closest_git_dir finds the next closest .git directory
# that is part of any directory in the path defined by _start_dir.
# The result is returned in the parent scope variable whose name is passed
# as variable _git_dir_var. If no .git directory can be found, the
# function returns an empty string via _git_dir_var.
#
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
# neither foo nor bar contain a file/directory .git. This wil return
# C:/bla/.git
#
function(_git_find_closest_git_dir _start_dir _git_dir_var)
set(cur_dir "${_start_dir}")
set(git_dir "${_start_dir}/.git")
while(NOT EXISTS "${git_dir}")
# .git dir not found, search parent directories
set(git_previous_parent "${cur_dir}")
get_filename_component(cur_dir ${cur_dir} DIRECTORY)
if(cur_dir STREQUAL git_previous_parent)
# We have reached the root directory, we are not in git
set(${_git_dir_var}
""
PARENT_SCOPE)
return()
endif()
set(git_dir "${cur_dir}/.git")
endwhile()
set(${_git_dir_var}
"${git_dir}"
PARENT_SCOPE)
endfunction()
function(get_git_head_revision _refspecvar _hashvar)
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE)
else()
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE)
endif()
if(NOT "${GIT_DIR}" STREQUAL "")
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
"${GIT_DIR}")
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
# We've gone above the CMake root dir.
set(GIT_DIR "")
endif()
endif()
if("${GIT_DIR}" STREQUAL "")
set(${_refspecvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
set(${_hashvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
return()
endif()
# Check if the current source dir is a git submodule or a worktree.
# In both cases .git is a file instead of a directory.
#
if(NOT IS_DIRECTORY ${GIT_DIR})
# The following git command will return a non empty string that
# points to the super project working tree if the current
# source dir is inside a git submodule.
# Otherwise the command will return an empty string.
#
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse
--show-superproject-working-tree
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT "${out}" STREQUAL "")
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE
${submodule})
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
ABSOLUTE)
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
else()
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
file(READ ${GIT_DIR} worktree_ref)
# The .git directory contains a path to the worktree information directory
# inside the parent git repo of the worktree.
#
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
${worktree_ref})
string(STRIP ${git_worktree_dir} git_worktree_dir)
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
endif()
else()
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake" @ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar}
"${HEAD_REF}"
PARENT_SCOPE)
set(${_hashvar}
"${HEAD_HASH}"
PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_describe_working_tree _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var}
"CLEAN"
PARENT_SCOPE)
else()
set(${_var}
"DIRTY"
PARENT_SCOPE)
endif()
endfunction()

View file

@ -0,0 +1,43 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright 2009-2012, Iowa State University
# Copyright 2011-2015, Contributors
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# SPDX-License-Identifier: BSL-1.0
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

162
logo.svg Normal file
View file

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="reVC.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07, custom)"
id="svg8"
version="1.1"
viewBox="0 0 270.93331 270.93334"
height="1024"
width="1024"
inkscape:export-filename="/home/hazelnot/Design/re3_final.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs2">
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter1055">
<feFlood
flood-opacity="1"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood1045" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite1047" />
<feGaussianBlur
in="composite1"
stdDeviation="0"
result="blur"
id="feGaussianBlur1049" />
<feOffset
dx="1"
dy="1"
result="offset"
id="feOffset1051" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite1053" />
</filter>
</defs>
<sodipodi:namedview
inkscape:window-maximized="1"
inkscape:window-y="0"
inkscape:window-x="0"
inkscape:window-height="1359"
inkscape:window-width="2560"
inkscape:snap-page="true"
inkscape:showpageshadow="false"
inkscape:pagecheckerboard="false"
showgrid="false"
inkscape:document-rotation="0"
inkscape:current-layer="svg8"
inkscape:document-units="mm"
inkscape:cy="624.20389"
inkscape:cx="108.63858"
inkscape:zoom="0.7"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
borderopacity="1"
bordercolor="#000000"
pagecolor="#606060"
id="base"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
lock-margins="false"
units="px" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="g837"
transform="matrix(2.1130708,0,0,2.1130708,14.956432,63.50059)"
style="display:none">
<path
id="path1450"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:1.25;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.83595;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="M 0.91799998,0.91799998 V 54.101316 H 17.960888 v 2.33009 c 0,2.95453 1.347497,6.384348 3.911905,8.332308 2.564408,1.947971 5.514112,2.433445 8.500257,2.433445 h 46.367194 v -14.5464 c 2.171993,1.134845 4.548071,1.450557 6.948413,1.450557 h 17.042893 c 2.98614,0 5.93584,-0.485482 8.50025,-2.433442 2.5644,-1.94796 3.91191,-5.377273 3.91191,-8.331793 V 30.964744 c 0,-1.094128 -0.25094,-2.296243 -0.70487,-3.457153 0.45593,-1.16196 0.70487,-2.363609 0.70487,-3.453019 V 11.81656 c 0,-2.9682265 -1.29681,-6.3966108 -3.85713,-8.3907028 -2.56031,-1.9940909 -5.55104,-2.50785722 -8.55503,-2.50785722 H 83.819398 c -3.003989,0 -5.99213,0.51376632 -8.55245,2.50785722 C 74.832145,3.7645045 74.436551,4.1470248 74.074773,4.5591214 73.713016,4.1470532 73.317379,3.7644843 72.8826,3.4258572 70.322288,1.4317663 67.332073,0.91799998 64.328081,0.91799998 H 47.285195 c -2.976748,0 -5.937909,0.51342982 -8.482687,2.46289872 C 36.275393,1.4370808 33.325985,0.91799998 30.37305,0.91799998 Z"
inkscape:label="Border" />
<g
id="g1475"
inkscape:label="Text"
style="display:inline"
transform="translate(-51.547657,-77.439255)">
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:1.25;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:11.136;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 84.566726,139.06892 c -4.562445,0 -6.843668,-1.73285 -6.843668,-5.19856 v -24.61088 c 0,-0.0877 -0.04387,-0.13161 -0.131609,-0.13161 h -3.22442 v 16.84595 H 60.679694 V 83.92475 h 23.887032 c 4.518575,0 6.777863,1.776721 6.777863,5.330164 v 12.239636 c 0,2.01801 -1.118676,3.15862 -3.356029,3.42183 2.281223,0.30709 3.421834,1.46964 3.421834,3.48764 v 20.07037 c 0,0.0877 0.04387,0.13161 0.131609,0.13161 h 33.823507 v 10.46292 z M 77.723058,94.585079 c 0,-0.08774 -0.04387,-0.131609 -0.131609,-0.131609 h -3.22442 v 6.31723 h 3.22442 c 0.08774,0 0.131609,-0.0439 0.131609,-0.13161 z m 33.955122,0 c 0,-0.08774 -0.0439,-0.131609 -0.13161,-0.131609 h -3.09281 c -0.0877,0 -0.13161,0.04387 -0.13161,0.131609 v 5.856601 h 3.35603 z m -10.1997,31.388741 c -4.562444,0 -6.843666,-1.73285 -6.843666,-5.19855 V 89.254914 c 0,-3.553443 2.281222,-5.330164 6.843666,-5.330164 h 17.04337 c 4.56244,0 6.84366,1.776721 6.84366,5.330164 v 20.991636 h -17.04336 v 5.13275 c 0,0.0877 0.0439,0.13161 0.13161,0.13161 h 3.09281 c 0.0877,0 0.13161,-0.0439 0.13161,-0.13161 v -2.50057 h 13.68733 v 7.89654 c 0,3.4657 -2.28122,5.19855 -6.84366,5.19855 z"
id="path1452"
transform="translate(-2.6458322)"
inkscape:label="re" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:1.25;font-family:Pricedown;-inkscape-font-specification:Pricedown;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#c60000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:11.1359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 135.23613,125.97382 c -4.56245,0 -6.84367,-1.73285 -6.84367,-5.19855 v -7.89654 h 13.68733 v 2.50057 c 0,0.0877 0.0439,0.13161 0.13161,0.13161 h 3.09281 c 0.0877,0 0.13161,-0.0439 0.13161,-0.13161 v -6.11982 c 0,-0.0877 -0.0439,-0.13161 -0.13161,-0.13161 h -16.71434 v -8.35717 h 16.71434 c 0.0877,0 0.13161,-0.0439 0.13161,-0.13161 v -6.054011 c 0,-0.08774 -0.0439,-0.131609 -0.13161,-0.131609 h -3.09281 c -0.0877,0 -0.13161,0.04387 -0.13161,0.131609 v 2.434766 h -13.55572 v -7.764931 c 0,-3.553443 2.28122,-5.330164 6.84366,-5.330164 h 16.91176 c 4.56245,0 6.84367,1.776721 6.84367,5.330164 v 12.239636 c 0,2.01801 -1.14061,3.15862 -3.42184,3.42183 2.28123,0.30709 3.42184,1.46964 3.42184,3.48764 v 12.37125 c 0,3.4657 -2.28122,5.19855 -6.84367,5.19855 z"
id="path1458"
inkscape:label="3" />
</g>
</g>
<g
id="g3625-7"
inkscape:label="reVC_10"
transform="matrix(2.4113736,0,0,2.4113736,-122.44911,-160.08821)">
<path
style="display:inline;fill:#00bbe2;fill-opacity:1;stroke:none;stroke-width:0.264583;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 102.78895,112.11187 54.54276,9.96769 -30.34918,43.22598 z"
id="path1613-9"
sodipodi:nodetypes="cccc"
inkscape:label="triangle" />
<g
id="g3669-0"
style="display:inline;opacity:1"
inkscape:label="re">
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:1.25;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#f17db2;stroke-width:1.60863;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 57.388672,80.632812 v 48.632808 h 17.042969 v 4.60547 c 0,2.45514 1.029322,5.01368 3.011718,6.51953 1.982397,1.50586 4.425056,1.97071 7.123047,1.97071 H 128.6582 v -17.04688 h -1.47851 c 0.87224,-1.37715 1.47851,-2.92106 1.47851,-4.53906 v -7.23633 -3.95312 -20.330081 c 0,-2.481169 -1.00049,-5.053605 -2.98047,-6.595703 -1.97997,-1.542097 -4.44771,-2.027344 -7.15625,-2.027344 h -17.04296 c -2.708546,10e-7 -5.176278,0.485247 -7.156254,2.027344 -0.588908,0.458669 -0.913121,1.140613 -1.328125,1.751953 -0.409812,-0.606749 -0.72664,-1.284534 -1.308594,-1.742187 -1.967878,-1.547555 -4.428385,-2.03711 -7.119141,-2.03711 z m 6.582031,6.583985 h 20.595703 c 1.827819,0 2.757419,0.399739 3.048828,0.628906 0.29141,0.229167 0.4375,0.331111 0.4375,1.410156 v 12.238281 c 0,0.0702 0.0022,0.0438 0.002,0.0801 0.03874,-0.0312 0.06635,0.0114 -0.451172,0.0723 l -0.05469,6.53321 c 0.66816,0.0899 0.752817,0.24295 0.65625,0.14453 -0.09657,-0.0984 -0.08594,-0.3087 -0.08594,0.0801 v 20.07031 c 0,0.59276 0.198598,1.6281 0.996093,2.42578 0.797496,0.79768 1.834701,0.99805 2.427735,0.99805 h 30.53125 v 3.8789 H 84.566406 c -1.864454,0 -2.841799,-0.40191 -3.140625,-0.6289 -0.298826,-0.227 -0.410156,-0.26677 -0.410156,-1.27735 v -24.61132 c 0,-0.59276 -0.200551,-1.6281 -0.998047,-2.42579 -0.797496,-0.79768 -1.832748,-0.99804 -2.425781,-0.99804 h -6.517578 v 16.8457 h -7.103516 z m 37.507817,0 h 17.04296 c 1.8539,0 2.80813,0.402095 3.10938,0.636719 0.30124,0.234623 0.44336,0.33007 0.44336,1.402343 V 106.95508 H 105.0293 v 8.42383 c 0,0.59313 0.20067,1.63031 0.99804,2.42773 0.79738,0.79742 1.83258,0.99609 2.42578,0.99609 h 3.09376 c 0.59313,0 1.62836,-0.19872 2.42578,-0.99609 0.51996,-0.51993 0.73732,-1.1028 0.85937,-1.63672 h 7.24219 v 4.60547 c 0,1.01057 -0.11133,1.05035 -0.41016,1.27734 -0.29882,0.227 -1.27812,0.62891 -3.14258,0.62891 h -17.04296 c -1.864458,0 -2.841803,-0.40191 -3.140629,-0.62891 -0.298826,-0.22699 -0.410157,-0.26677 -0.410157,-1.27734 V 89.255859 c 0,-1.072272 0.140161,-1.167719 0.441407,-1.402343 0.301246,-0.234625 1.255472,-0.636719 3.109379,-0.636719 z M 71.074219,91.162109 V 104.0625 h 6.517578 c 0.592903,0 1.628193,-0.20031 2.425781,-0.99805 0.797588,-0.79773 0.998047,-1.83309 0.998047,-2.42578 v -6.052732 c 0,-0.592528 -0.200189,-1.629881 -0.998047,-2.427735 -0.797858,-0.797853 -1.83326,-0.996094 -2.425781,-0.996094 z m 37.378901,0 c -0.59275,0 -1.62809,0.198598 -2.42578,0.996094 -0.79768,0.797496 -0.99804,1.834701 -0.99804,2.427735 v 9.148442 h 9.9414 v -9.148442 c 0,-0.592903 -0.20031,-1.630147 -0.99804,-2.427735 -0.79774,-0.797588 -1.8331,-0.996094 -2.42578,-0.996094 z"
id="path3671-2"
inkscape:label="outline" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:1.25;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:9.53813;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 84.566726,139.06892 c -4.562445,0 -6.843668,-1.73285 -6.843668,-5.19856 v -24.61088 c 0,-0.0877 -0.04387,-0.13161 -0.131609,-0.13161 h -3.22442 v 16.84595 H 60.679694 V 83.92475 h 23.887032 c 4.518575,0 6.777863,1.776721 6.777863,5.330164 v 12.239636 c 0,2.01801 -1.118676,3.15862 -3.356029,3.42183 2.281223,0.30709 3.421834,1.46964 3.421834,3.48764 v 20.07037 c 0,0.0877 0.04387,0.13161 0.131609,0.13161 h 33.823507 v 10.46292 z M 77.723058,94.585079 c 0,-0.08774 -0.04387,-0.131609 -0.131609,-0.131609 h -3.22442 v 6.31723 h 3.22442 c 0.08774,0 0.131609,-0.0439 0.131609,-0.13161 z m 33.955122,0 c 0,-0.08774 -0.0439,-0.131609 -0.13161,-0.131609 h -3.09281 c -0.0877,0 -0.13161,0.04387 -0.13161,0.131609 v 5.856601 h 3.35603 z m -10.1997,31.388741 c -4.562444,0 -6.843666,-1.73285 -6.843666,-5.19855 V 89.254914 c 0,-3.553443 2.281222,-5.330164 6.843666,-5.330164 h 17.04337 c 4.56244,0 6.84366,1.776721 6.84366,5.330164 v 20.991636 h -17.04336 v 5.13275 c 0,0.0877 0.0439,0.13161 0.13161,0.13161 h 3.09281 c 0.0877,0 0.13161,-0.0439 0.13161,-0.13161 v -2.50057 h 13.68733 v 7.89654 c 0,3.4657 -2.28122,5.19855 -6.84366,5.19855 z"
id="path3673-3"
inkscape:label="text" />
</g>
<g
id="g861-9-7"
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#f17db2;stroke-opacity:1;filter:url(#filter1055)"
transform="matrix(1.3835644,0,0,1.3835644,-22.936608,36.936115)"
inkscape:label="Vc">
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#f17db2;stroke-width:3.175;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 115.29478,55.979585 a 1.0583349,1.0583349 0 0 0 -0.94727,0.53711 l -13.61915,24.06445 -1.763667,-7.15234 a 1.0583349,1.0583349 0 0 0 -1.28125,-0.77344 1.0583349,1.0583349 0 0 0 -0.77344,1.28125 l 2.40235,9.73438 a 1.0584408,1.0584408 0 0 0 1.947257,0.26757 l 14.9297,-26.38086 a 1.0583349,1.0583349 0 0 0 -0.39844,-1.4414 1.0583349,1.0583349 0 0 0 -0.49609,-0.13672 z"
id="path892-1-5" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#f17db2;stroke-width:3.175;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 118.1854,69.604585 a 1.0583349,1.0583349 0 0 0 -0.27343,0.0391 c 0,0 -2.1903,0.59881 -4.46875,2.08789 -2.27846,1.48909 -4.77359,3.96951 -5.16602,7.69531 -0.20107,1.90898 0.49022,3.43086 1.68359,4.15821 1.19338,0.72735 2.6066,0.75222 3.94727,0.60547 2.68134,-0.29351 5.29297,-1.44336 5.29297,-1.44336 a 1.0583349,1.0583349 0 0 0 0.55078,-1.39063 1.0583349,1.0583349 0 0 0 -1.39063,-0.55273 c 0,0 -2.46507,1.04035 -4.68359,1.2832 -1.10926,0.12142 -2.10191,0.002 -2.61523,-0.31055 -0.51333,-0.31286 -0.82729,-0.72566 -0.67969,-2.12695 0.3049,-2.89473 2.23993,-4.85323 4.21875,-6.14648 1.97882,-1.29326 3.87305,-1.82032 3.87305,-1.82032 a 1.0583349,1.0583349 0 0 0 0.73828,-1.30078 1.0583349,1.0583349 0 0 0 -1.02735,-0.77734 z"
id="path896-2-9" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -65,7 +65,7 @@ end
workspace "reLCS" workspace "reLCS"
language "C++" language "C++"
configurations { "Debug", "Release" } configurations { "Debug", "Release", "Vanilla" }
startproject "reLCS" startproject "reLCS"
location "build" location "build"
symbols "Full" symbols "Full"
@ -120,13 +120,16 @@ workspace "reLCS"
filter "configurations:Debug" filter "configurations:Debug"
defines { "DEBUG" } defines { "DEBUG" }
filter "configurations:Release" filter "configurations:not Debug"
defines { "NDEBUG" } defines { "NDEBUG" }
optimize "Speed" optimize "Speed"
if(_OPTIONS["lto"]) then if(_OPTIONS["lto"]) then
flags { "LinkTimeOptimization" } flags { "LinkTimeOptimization" }
end end
filter "configurations:Vanilla"
defines { "VANILLA_DEFINES" }
filter { "platforms:win*" } filter { "platforms:win*" }
system "windows" system "windows"
@ -208,6 +211,7 @@ project "librw"
architecture "amd64" architecture "amd64"
filter "platforms:win*" filter "platforms:win*"
defines { "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE" }
staticruntime "on" staticruntime "on"
buildoptions { "/Zc:sizedDealloc-" } buildoptions { "/Zc:sizedDealloc-" }
@ -239,6 +243,10 @@ project "reLCS"
targetname "reLCS" targetname "reLCS"
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}" targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
if(_OPTIONS["with-librw"]) then
dependson "librw"
end
files { addSrcFiles("src") } files { addSrcFiles("src") }
files { addSrcFiles("src/animation") } files { addSrcFiles("src/animation") }
files { addSrcFiles("src/audio") } files { addSrcFiles("src/audio") }
@ -264,6 +272,7 @@ project "reLCS"
files { addSrcFiles("src/vehicles") } files { addSrcFiles("src/vehicles") }
files { addSrcFiles("src/weapons") } files { addSrcFiles("src/weapons") }
files { addSrcFiles("src/extras") } files { addSrcFiles("src/extras") }
files { "src/extras/GitSHA1.cpp" } -- this won't be in repo in first build
includedirs { "src" } includedirs { "src" }
includedirs { "src/animation" } includedirs { "src/animation" }
@ -316,7 +325,7 @@ project "reLCS"
filter {} filter {}
if(os.getenv("GTA_LCS_RE_DIR")) then if(os.getenv("GTA_LCS_RE_DIR")) then
setpaths("$(GTA_LCS_RE_DIR)/", "%(cfg.buildtarget.name)") setpaths(os.getenv("GTA_LCS_RE_DIR") .. "/", "%(cfg.buildtarget.name)")
end end
filter "platforms:win*" filter "platforms:win*"
@ -330,6 +339,10 @@ project "reLCS"
-- external librw is dynamic -- external librw is dynamic
staticruntime "on" staticruntime "on"
end end
prebuildcommands { '"%{prj.location}..\\printHash.bat" "%{prj.location}..\\src\\extras\\GitSHA1.cpp"' }
filter "platforms:not win*"
prebuildcommands { '"%{prj.location}/../printHash.sh" "%{prj.location}/../src/extras/GitSHA1.cpp"' }
filter "platforms:win*glfw*" filter "platforms:win*glfw*"
staticruntime "off" staticruntime "off"

26
printHash.bat Normal file
View file

@ -0,0 +1,26 @@
@echo off
REM creates version.h with HEAD commit hash
REM params: $1=full path to output file (usually points version.h)
setlocal enableextensions enabledelayedexpansion
cd /d "%~dp0"
break> %1
<nul set /p=^"#define GIT_SHA1 ^"^"> %1
where git
if "%errorlevel%" == "0" ( goto :havegit ) else ( goto :writeending )
:havegit
for /f %%v in ('git rev-parse --short HEAD') do set version=%%v
<nul set /p="%version%" >> %1
:writeending
echo ^" >> %1
echo const char* g_GIT_SHA1 = GIT_SHA1; >> %1
EXIT /B

12
printHash.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
> $1
echo -n "#define GIT_SHA1 \"" > $1
if (command -v "git" >/dev/null) then
git rev-parse --short HEAD | tr -d '\n' >> $1
fi
echo "\"" >> $1
echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1

View file

@ -1,5 +1,5 @@
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
file(GLOB_RECURSE ${PROJECT}_SOURCES "*.cpp" "*.h" "*.rc") file(GLOB_RECURSE ${PROJECT}_SOURCES "*.cpp" "*.h" "*.rc")
@ -17,6 +17,9 @@ endfunction()
header_directories(${PROJECT}_INCLUDES) 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 add_executable(${EXECUTABLE} WIN32
${${PROJECT}_SOURCES} ${${PROJECT}_SOURCES}
) )
@ -46,6 +49,8 @@ if(LIBRW_PLATFORM_D3D9)
) )
endif() endif()
target_compile_definitions(${EXECUTABLE} PRIVATE CMAKE_BUILD)
if(${PROJECT}_AUDIO STREQUAL "OAL") if(${PROJECT}_AUDIO STREQUAL "OAL")
find_package(OpenAL REQUIRED) find_package(OpenAL REQUIRED)
target_include_directories(${EXECUTABLE} PRIVATE ${OPENAL_INCLUDE_DIR}) target_include_directories(${EXECUTABLE} PRIVATE ${OPENAL_INCLUDE_DIR})

View file

@ -20,212 +20,212 @@ CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups;
CLinkList<CAnimBlendHierarchy*> CAnimManager::ms_animCache; CLinkList<CAnimBlendHierarchy*> CAnimManager::ms_animCache;
AnimAssocDesc aStdAnimDescs[] = { AnimAssocDesc aStdAnimDescs[] = {
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, { ANIM_STD_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, { ANIM_STD_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
{ ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK }, { ANIM_STD_RUNFAST, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
{ ANIM_IDLE_STANCE, ASSOC_REPEAT }, { ANIM_STD_IDLE, ASSOC_REPEAT },
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION }, { ANIM_STD_STARTWALK, ASSOC_HAS_TRANSLATION },
{ ANIM_RUN_STOP, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION }, { ANIM_STD_RUNSTOP1, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
{ ANIM_RUN_STOP_R, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION }, { ANIM_STD_RUNSTOP2, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
{ ANIM_IDLE_CAM, ASSOC_REPEAT | ASSOC_PARTIAL }, { ANIM_STD_IDLE_CAM, ASSOC_REPEAT | ASSOC_PARTIAL },
{ ANIM_IDLE_HBHB, ASSOC_REPEAT | ASSOC_PARTIAL }, { ANIM_STD_IDLE_HBHB, ASSOC_REPEAT | ASSOC_PARTIAL },
{ ANIM_IDLE_TIRED, ASSOC_REPEAT }, { ANIM_STD_IDLE_TIRED, ASSOC_REPEAT },
{ ANIM_IDLE_ARMED, ASSOC_REPEAT | ASSOC_PARTIAL }, { ANIM_STD_IDLE_BIGGUN, ASSOC_REPEAT | ASSOC_PARTIAL },
{ ANIM_IDLE_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL }, { ANIM_STD_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL },
{ ANIM_IDLE_TAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_HAILTAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_KO_SHOT_FRONT1, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_KO_FRONT, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_FRONT2, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_KO_LEFT, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_FRONT3, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_KO_BACK, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_FRONT4, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_KO_RIGHT, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_KO_SHOT_STOM, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_KO_SHOT_STOMACH, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_ARML, ASSOC_PARTIAL | ASSOC_FRONTAL }, { ANIM_STD_KO_SHOT_ARM_L, ASSOC_PARTIAL | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_ARMR, ASSOC_PARTIAL | ASSOC_FRONTAL }, { ANIM_STD_KO_SHOT_ARM_R, ASSOC_PARTIAL | ASSOC_FRONTAL },
{ ANIM_KO_SHOT_LEGL, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_KO_SHOT_LEG_L, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_KO_SHOT_LEGR, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_KO_SHOT_LEG_R, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_KD_LEFT, ASSOC_PARTIAL }, { ANIM_STD_SPINFORWARD_LEFT, ASSOC_PARTIAL },
{ ANIM_KD_RIGHT, ASSOC_PARTIAL }, { ANIM_STD_SPINFORWARD_RIGHT, ASSOC_PARTIAL },
{ ANIM_KO_SKID_FRONT, ASSOC_PARTIAL }, { ANIM_STD_HIGHIMPACT_FRONT, ASSOC_PARTIAL },
{ ANIM_KO_SPIN_R, ASSOC_PARTIAL }, { ANIM_STD_HIGHIMPACT_LEFT, ASSOC_PARTIAL },
{ ANIM_KO_SKID_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL }, { ANIM_STD_HIGHIMPACT_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL },
{ ANIM_KO_SPIN_L, ASSOC_PARTIAL }, { ANIM_STD_HIGHIMPACT_RIGHT, ASSOC_PARTIAL },
{ ANIM_SHOT_FRONT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_STD_HITBYGUN_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_SHOT_LEFT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_STD_HITBYGUN_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_SHOT_BACK_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_STD_HITBYGUN_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_SHOT_RIGHT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_STD_HITBYGUN_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FLOOR_HIT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_HIT_FLOOR, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FLOOR_HIT_F, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL }, { ANIM_STD_HIT_FLOOR_FRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
{ ANIM_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FIGHT_IDLE, ASSOC_REPEAT }, { ANIM_STD_FIGHT_IDLE, ASSOC_REPEAT },
{ ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_FIGHT_2IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_FIGHT_SHUFFLE_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_STD_PARTIAL_PUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_L_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_ATTACK_A1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_R_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_ATTACK_A2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_UPPERCUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_ATTACK_A3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HEADBUTT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_ATTACK_B1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FRONTKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_ATTACK_B2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_ATTACK_B3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_L_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_HIT_A1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_R_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_HIT_A2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_UPPERCUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_HIT_A3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_HEADBUTT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_HIT_B1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_FRONTKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_HIT_B2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_RHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_FIGHT_HIT_B3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_DETONATE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_PUNCH_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FIGHT_PPUNCH2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_PARTIALPUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_KICK_FLOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_KICKGROUND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_THROW_UNDER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FIGHT_SH_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_FIGHT_SHUFFLE_B, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_CAR_JACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_JACKEDCAR_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_CAR_LJACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_JACKEDCAR_LO_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_CAR_JACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_JACKEDCAR_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_CAR_LJACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_JACKEDCAR_LO_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_CAR_QJACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_QUICKJACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_QJACKED, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_QUICKJACKED, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_CAR_ALIGN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_ALIGN_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ALIGNHI_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_ALIGNHI_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_OPEN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_OPEN_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_DOORLOCKED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CARDOOR_LOCKED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_PULLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_PULL_OUT_PED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_PULLOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_PULL_OUT_PED_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_GET_IN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETIN_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_GET_IN_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CLOSEDOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_DOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CLOSEDOOR_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_DOOR_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ROLLDOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ROLLDOOR_LOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_JUMPIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_JUMP_IN_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_GETOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_GETOUT_LO_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CLOSE_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ALIGN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_ALIGN_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ALIGNHI_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_ALIGNHI_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_OPEN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_OPEN_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_DOORLOCKED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CARDOOR_LOCKED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_PULLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_PULL_OUT_PED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_PULLOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_PULL_OUT_PED_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETIN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_GET_IN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETIN_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_GET_IN_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CLOSEDOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_DOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CLOSEDOOR_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_DOOR_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_SHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_SHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_LSHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_SHUFFLE_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_SIT, ASSOC_DELETEFADEDOUT }, { ANIM_STD_CAR_SIT, ASSOC_DELETEFADEDOUT },
{ ANIM_CAR_LSIT, ASSOC_DELETEFADEDOUT }, { ANIM_STD_CAR_SIT_LO, ASSOC_DELETEFADEDOUT },
{ ANIM_CAR_SITP, ASSOC_DELETEFADEDOUT }, { ANIM_STD_CAR_SIT_P, ASSOC_DELETEFADEDOUT },
{ ANIM_CAR_SITPLO, ASSOC_DELETEFADEDOUT }, { ANIM_STD_CAR_SIT_P_LO, ASSOC_DELETEFADEDOUT },
{ ANIM_DRIVE_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVE_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVE_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVE_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVE_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVE_LEFT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVE_RIGHT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVEBY_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVEBY_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVEBY_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVEBY_LEFT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVEBY_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_DRIVEBY_RIGHT_LO, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_CAR_LOOKBEHIND, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING }, { ANIM_STD_BOAT_DRIVE, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
{ ANIM_DRIVE_BOAT_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_BOAT_DRIVE_LEFT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_DRIVE_BOAT_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_BOAT_DRIVE_RIGHT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BOAT_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_STD_BOAT_LOOKBEHIND, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_PICKUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_BIKE_PICKUP_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_PICKUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_BIKE_PICKUP_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_PULLUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_BIKE_PULLUP_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_PULLUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_BIKE_PULLUP_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_ELBOW_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_BIKE_ELBOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_ELBOW_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_BIKE_ELBOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_FALL_OFF, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_BIKE_FALLOFF, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_BIKE_FALL_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_BIKE_FALLBACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_CAR_GETOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_GETOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_GETOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_GETOUT_LO_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CLOSE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CAR_CLOSE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_HOOKERTALK, ASSOC_REPEAT | ASSOC_PARTIAL }, { ANIM_STD_CAR_HOOKERTALK, ASSOC_REPEAT | ASSOC_PARTIAL },
{ ANIM_TRAIN_GETIN, ASSOC_DELETEFADEDOUT }, { ANIM_STD_TRAIN_GETIN, ASSOC_DELETEFADEDOUT },
{ ANIM_TRAIN_GETOUT, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE }, { ANIM_STD_TRAIN_GETOUT, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE },
{ ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CRAWLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_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_STD_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_STD_GET_UP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_GETUP2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_GET_UP_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_GETUP3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_GET_UP_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_GETUP_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_GET_UP_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_JUMP_LAUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_JUMP_LAUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FALL_FALL, ASSOC_DELETEFADEDOUT }, { ANIM_STD_FALL, ASSOC_DELETEFADEDOUT },
{ ANIM_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FALL_COLLAPSE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_FALL_COLLAPSE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FALL_BACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_FALL_ONBACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_FALL_FRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL }, { ANIM_STD_FALL_ONFRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
{ ANIM_EV_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_EVADE_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_EVADE_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_COMMANDO_ROLL, ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL }, { ANIM_STD_COMMANDO_ROLL, ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
{ ANIM_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_STD_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_ROAD_CROSS, ASSOC_REPEAT | ASSOC_PARTIAL }, { ANIM_STD_ROADCROSS, ASSOC_REPEAT | ASSOC_PARTIAL },
{ ANIM_TURN_180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_TURN180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ARREST_GUN, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_ARREST, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_DROWN, ASSOC_PARTIAL }, { ANIM_STD_DROWN, ASSOC_PARTIAL },
{ ANIM_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_WEAPON_CROUCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_DUCK_WEAPON, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_RBLOCK_CSHOOT, ASSOC_RUNNING }, { ANIM_STD_RBLOCK_SHOOT, ASSOC_RUNNING },
{ ANIM_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_STD_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_STD_PARTIAL_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_PHONE_IN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_PHONE_IN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
{ ANIM_SEAT_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_SEAT_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_SEAT_UP, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_SEAT_UP, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_SEAT_IDLE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_SEAT_IDLE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_SEAT_DOWN2, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_SEAT_RVRS, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATM, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_ATM, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ABSEIL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL }, { ANIM_STD_ABSEIL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
}; };
AnimAssocDesc aVanAnimDescs[] = { AnimAssocDesc aVanAnimDescs[] = {
{ ANIM_VAN_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_OPEN_DOOR_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_GETIN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_GET_IN_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_CLOSE_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_GETOUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_GET_OUT_REAR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_OPEN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_OPEN_DOOR_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_GETIN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_GET_IN_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_CLOSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_VAN_GETOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_VAN_GET_OUT_REAR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aCoachAnimDescs[] = { AnimAssocDesc aCoachAnimDescs[] = {
{ ANIM_COACH_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_COACH_OPEN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_COACH_OPEN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_COACH_OPEN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_COACH_IN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_COACH_GET_IN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_COACH_IN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_COACH_GET_IN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_COACH_OUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STD_COACH_GET_OUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aBikeAnimDescs[] = { AnimAssocDesc aBikeAnimDescs[] = {
{ ANIM_BIKE_RIDE, ASSOC_DELETEFADEDOUT }, { 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_LEFT, ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_RIGHT, ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_BIKE_RIGHT, ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_BACK, ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_BIKE_LEANB, ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_FWD, ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_BIKE_LEANF, ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_PUSHES, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_BIKE_WALKBACK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_JUMPON_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_BIKE_JUMPON_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_JUMPON_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_BIKE_JUMPON_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_BIKE_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_BIKE_HIT, 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_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_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_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_DRIVEBY_FT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING }, { ANIM_BIKE_DRIVEBY_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_PASSENGER, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING }, { ANIM_BIKE_DRIVEBY_FORWARD, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
{ ANIM_BIKE_RIDE_P, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
}; };
AnimAssocDesc aMeleeAnimDescs[] = { AnimAssocDesc aMeleeAnimDescs[] = {
{ ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
@ -242,25 +242,25 @@ AnimAssocDesc aSwingAnimDescs[] = {
{ ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aWeaponAnimDescs[] = { AnimAssocDesc aWeaponAnimDescs[] = {
{ ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_ATTACK_1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_WEAPON_CROUCHFIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_ATTACK_2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_WEAPON_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_ATTACK_EXTRA1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_WEAPON_CROUCHRELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_ATTACK_EXTRA2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aMedicAnimDescs[] = { AnimAssocDesc aMedicAnimDescs[] = {
{ ANIM_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MEDIC_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aSunbatheAnimDescs[] = { 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_DOWN, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
{ ANIM_SUNBATHE_UP, 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 }, { ANIM_SUNBATHE_ESCAPE, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
}; };
AnimAssocDesc aPlayerIdleAnimDescs[] = { AnimAssocDesc aPlayerIdleAnimDescs[] = {
{ ANIM_IDLE_STRETCH, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_PLAYER_IDLE1, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_IDLE_TIME, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_PLAYER_IDLE2, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_IDLE_SHOULDER, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_PLAYER_IDLE3, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_IDLE_STRETCH_LEG, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_PLAYER_IDLE4, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aRiotAnimDescs[] = { AnimAssocDesc aRiotAnimDescs[] = {
{ ANIM_RIOT_ANGRY, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { 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_PUNCHES, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_RIOT_SHOUT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_RIOT_SHOUT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_RIOT_CHALLENGE, 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[] = { AnimAssocDesc aStripAnimDescs[] = {
{ ANIM_STRIP_A, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STRIP_A, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
@ -281,25 +281,25 @@ AnimAssocDesc aStripAnimDescs[] = {
{ ANIM_STRIP_G, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_STRIP_G, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aStdAnimDescsSide[] = { AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK }, { ANIM_STD_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_STD_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_STD_RUNFAST, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
{ ANIM_IDLE_STANCE, ASSOC_REPEAT }, { ANIM_STD_IDLE, ASSOC_REPEAT },
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION }, { ANIM_STD_STARTWALK, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
}; };
AnimAssocDesc aMPNoteAnimDescs[] = { AnimAssocDesc aMPNoteAnimDescs[] = {
{ ANIM_MPNOTE, ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_MULTIPLAYER_CUTSCENE_MPNOTE, ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_MPNOTE_LOOP, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_IDLE },
}; };
AnimAssocDesc aCSMiscAnimDescs[] = { AnimAssocDesc aCSMiscAnimDescs[] = {
{ ANIM_IDLE_LOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_LOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_NO, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_NO, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_YES, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_YES, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_CHAT2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_CHAT2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_COUGH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_COUGH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_GIGGLE_FEMALE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_GIGGLE_FEMALE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_TOUGH_CHAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_TOUGH_CHAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_IDLE_CELL_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_CS_MISC_IDLE_CELL_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
}; };
AnimAssocDesc aDONH2AnimDescs[] = { AnimAssocDesc aDONH2AnimDescs[] = {
{ ANIM_DONH2_CAMERA, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_DONH2_CAMERA, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
@ -320,7 +320,7 @@ AnimAssocDesc aJDT5AnimDescs[] = {
}; };
AnimAssocDesc aJDT6AnimDescs[] = { AnimAssocDesc aJDT6AnimDescs[] = {
{ ANIM_JDT6_PICKUP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { 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[] = { AnimAssocDesc aMAR1AnimDescs[] = {
{ ANIM_MAR1_SKIRT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_MAR1_SKIRT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
@ -334,7 +334,7 @@ AnimAssocDesc aMAR2AnimDescs[] = {
AnimAssocDesc aMAR3AnimDescs[] = { AnimAssocDesc aMAR3AnimDescs[] = {
{ ANIM_MAR3_HOOCHY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_MAR3_HOOCHY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_MAR3_NOTE_IDLE, 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[] = { AnimAssocDesc aSAL1AnimDescs[] = {
{ ANIM_SAL1_BIREFCASE_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_SAL1_BIREFCASE_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
@ -349,8 +349,8 @@ AnimAssocDesc aSAL3AnimDescs[] = {
{ ANIM_SAL3_SIT_DOWN, ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_SAL3_SIT_DOWN, ASSOC_PARTIAL | ASSOC_IDLE },
}; };
AnimAssocDesc aSAL4AnimDescs[] = { AnimAssocDesc aSAL4AnimDescs[] = {
{ ANIM_SAL4_DUSTDOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_SAL4_DUST_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
{ ANIM_SAL4_GIRLRUN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_SAL4_GIRL_RUN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
}; };
AnimAssocDesc aSAL6AnimDescs[] = { AnimAssocDesc aSAL6AnimDescs[] = {
{ ANIM_SAL6_ANGRY_SEATED, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE }, { ANIM_SAL6_ANGRY_SEATED, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },

View file

@ -2,250 +2,256 @@
enum AnimationId enum AnimationId
{ {
ANIM_WALK, ANIM_STD_WALK,
ANIM_RUN, ANIM_STD_RUN,
ANIM_SPRINT, ANIM_STD_RUNFAST,
ANIM_IDLE_STANCE, ANIM_STD_IDLE,
ANIM_WALK_START, ANIM_STD_STARTWALK,
ANIM_RUN_STOP, ANIM_STD_RUNSTOP1,
ANIM_RUN_STOP_R, ANIM_STD_RUNSTOP2,
ANIM_IDLE_CAM, ANIM_STD_IDLE_CAM,
ANIM_IDLE_HBHB, ANIM_STD_IDLE_HBHB,
ANIM_IDLE_TIRED, ANIM_STD_IDLE_TIRED,
ANIM_IDLE_ARMED, ANIM_STD_IDLE_BIGGUN,
ANIM_IDLE_CHAT, ANIM_STD_CHAT,
ANIM_IDLE_TAXI, ANIM_STD_HAILTAXI,
ANIM_KO_SHOT_FRONT1, ANIM_STD_KO_FRONT,
ANIM_KO_SHOT_FRONT2, ANIM_STD_KO_LEFT,
ANIM_KO_SHOT_FRONT3, ANIM_STD_KO_BACK,
ANIM_KO_SHOT_FRONT4, ANIM_STD_KO_RIGHT,
ANIM_KO_SHOT_FACE, ANIM_STD_KO_SHOT_FACE,
ANIM_KO_SHOT_STOM, ANIM_STD_KO_SHOT_STOMACH,
ANIM_KO_SHOT_ARML, ANIM_STD_KO_SHOT_ARM_L,
ANIM_KO_SHOT_ARMR, ANIM_STD_KO_SHOT_ARM_R,
ANIM_KO_SHOT_LEGL, ANIM_STD_KO_SHOT_LEG_L,
ANIM_KO_SHOT_LEGR, ANIM_STD_KO_SHOT_LEG_R,
ANIM_KD_LEFT, ANIM_STD_SPINFORWARD_LEFT,
ANIM_KD_RIGHT, ANIM_STD_SPINFORWARD_RIGHT,
ANIM_KO_SKID_FRONT, ANIM_STD_HIGHIMPACT_FRONT,
ANIM_KO_SPIN_R, // named left in VC ANIM_STD_HIGHIMPACT_LEFT,
ANIM_KO_SKID_BACK, ANIM_STD_HIGHIMPACT_BACK,
ANIM_KO_SPIN_L, // named right in VC ANIM_STD_HIGHIMPACT_RIGHT,
ANIM_SHOT_FRONT_PARTIAL, ANIM_STD_HITBYGUN_FRONT,
ANIM_SHOT_LEFT_PARTIAL, ANIM_STD_HITBYGUN_LEFT,
ANIM_SHOT_BACK_PARTIAL, ANIM_STD_HITBYGUN_BACK,
ANIM_SHOT_RIGHT_PARTIAL, ANIM_STD_HITBYGUN_RIGHT,
ANIM_HIT_FRONT, ANIM_STD_HIT_FRONT,
ANIM_HIT_LEFT, ANIM_STD_HIT_LEFT,
ANIM_HIT_BACK, ANIM_STD_HIT_BACK,
ANIM_HIT_RIGHT, ANIM_STD_HIT_RIGHT,
ANIM_FLOOR_HIT, ANIM_STD_HIT_FLOOR,
ANIM_HIT_WALL, ANIM_STD_HIT_WALL,
ANIM_FLOOR_HIT_F, ANIM_STD_HIT_FLOOR_FRONT,
ANIM_HIT_BEHIND, ANIM_STD_HIT_BEHIND,
ANIM_FIGHT_IDLE, ANIM_STD_FIGHT_IDLE,
ANIM_FIGHT2_IDLE, ANIM_STD_FIGHT_2IDLE,
ANIM_FIGHT_SH_F, ANIM_STD_FIGHT_SHUFFLE_F,
ANIM_FIGHT_PPUNCH, ANIM_STD_PARTIAL_PUNCH,
ANIM_L_HOOK, ANIM_FIGHT_ATTACK_A1,
ANIM_R_HOOK, ANIM_FIGHT_ATTACK_A2,
ANIM_UPPERCUT, ANIM_FIGHT_ATTACK_A3,
ANIM_HEADBUTT, ANIM_FIGHT_ATTACK_B1,
ANIM_FRONTKICK, ANIM_FIGHT_ATTACK_B2,
ANIM_ROUNDHOUSE, ANIM_FIGHT_ATTACK_B3,
ANIM_HIT_L_HOOK, ANIM_FIGHT_HIT_A1,
ANIM_HIT_R_HOOK, ANIM_FIGHT_HIT_A2,
ANIM_HIT_UPPERCUT, ANIM_FIGHT_HIT_A3,
ANIM_HIT_HEADBUTT, ANIM_FIGHT_HIT_B1,
ANIM_HIT_FRONTKICK, ANIM_FIGHT_HIT_B2,
ANIM_HIT_RHOUSE, ANIM_FIGHT_HIT_B3,
ANIM_BOMBER, ANIM_STD_DETONATE,
ANIM_PUNCH_R, ANIM_STD_PUNCH,
ANIM_FIGHT_PPUNCH2, ANIM_STD_PARTIALPUNCH,
ANIM_KICK_FLOOR, ANIM_STD_KICKGROUND,
ANIM_WEAPON_THROWU, ANIM_STD_THROW_UNDER,
ANIM_FIGHT_SH_BACK, ANIM_STD_FIGHT_SHUFFLE_B,
ANIM_CAR_JACKED_RHS, ANIM_STD_JACKEDCAR_RHS,
ANIM_CAR_LJACKED_RHS, ANIM_STD_JACKEDCAR_LO_RHS,
ANIM_CAR_JACKED_LHS, ANIM_STD_JACKEDCAR_LHS,
ANIM_CAR_LJACKED_LHS, ANIM_STD_JACKEDCAR_LO_LHS,
ANIM_CAR_QJACK, ANIM_STD_QUICKJACK,
ANIM_CAR_QJACKED, ANIM_STD_QUICKJACKED,
ANIM_CAR_ALIGN_LHS, ANIM_STD_CAR_ALIGN_DOOR_LHS,
ANIM_CAR_ALIGNHI_LHS, ANIM_STD_CAR_ALIGNHI_DOOR_LHS,
ANIM_CAR_OPEN_LHS, ANIM_STD_CAR_OPEN_DOOR_LHS,
ANIM_CAR_DOORLOCKED_LHS, ANIM_STD_CARDOOR_LOCKED_LHS,
ANIM_CAR_PULLOUT_LHS, ANIM_STD_CAR_PULL_OUT_PED_LHS,
ANIM_CAR_PULLOUT_LOW_LHS, ANIM_STD_CAR_PULL_OUT_PED_LO_LHS,
ANIM_CAR_GETIN_LHS, ANIM_STD_CAR_GET_IN_LHS,
ANIM_CAR_GETIN_LOW_LHS, ANIM_STD_CAR_GET_IN_LO_LHS,
ANIM_CAR_CLOSEDOOR_LHS, ANIM_STD_CAR_CLOSE_DOOR_LHS,
ANIM_CAR_CLOSEDOOR_LOW_LHS, ANIM_STD_CAR_CLOSE_DOOR_LO_LHS,
ANIM_CAR_ROLLDOOR, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS,
ANIM_CAR_ROLLDOOR_LOW, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS,
ANIM_CAR_JUMPIN_LHS, ANIM_STD_CAR_JUMP_IN_LO_LHS,
ANIM_CAR_GETOUT_LHS, ANIM_STD_GETOUT_LHS,
ANIM_CAR_GETOUT_LOW_LHS, ANIM_STD_GETOUT_LO_LHS,
ANIM_CAR_CLOSE_LHS, ANIM_STD_CAR_CLOSE_LHS,
ANIM_CAR_ALIGN_RHS, ANIM_STD_CAR_ALIGN_DOOR_RHS,
ANIM_CAR_ALIGNHI_RHS, ANIM_STD_CAR_ALIGNHI_DOOR_RHS,
ANIM_CAR_OPEN_RHS, ANIM_STD_CAR_OPEN_DOOR_RHS,
ANIM_CAR_DOORLOCKED_RHS, ANIM_STD_CARDOOR_LOCKED_RHS,
ANIM_CAR_PULLOUT_RHS, ANIM_STD_CAR_PULL_OUT_PED_RHS,
ANIM_CAR_PULLOUT_LOW_RHS, ANIM_STD_CAR_PULL_OUT_PED_LO_RHS,
ANIM_CAR_GETIN_RHS, ANIM_STD_CAR_GET_IN_RHS,
ANIM_CAR_GETIN_LOW_RHS, ANIM_STD_CAR_GET_IN_LO_RHS,
ANIM_CAR_CLOSEDOOR_RHS, ANIM_STD_CAR_CLOSE_DOOR_RHS,
ANIM_CAR_CLOSEDOOR_LOW_RHS, ANIM_STD_CAR_CLOSE_DOOR_LO_RHS,
ANIM_CAR_SHUFFLE_RHS, ANIM_STD_CAR_SHUFFLE_RHS,
ANIM_CAR_LSHUFFLE_RHS, ANIM_STD_CAR_SHUFFLE_LO_RHS,
ANIM_CAR_SIT, ANIM_STD_CAR_SIT,
ANIM_CAR_LSIT, ANIM_STD_CAR_SIT_LO,
ANIM_CAR_SITP, ANIM_STD_CAR_SIT_P,
ANIM_CAR_SITPLO, ANIM_STD_CAR_SIT_P_LO,
ANIM_DRIVE_L, ANIM_STD_CAR_DRIVE_LEFT,
ANIM_DRIVE_R, ANIM_STD_CAR_DRIVE_RIGHT,
ANIM_DRIVE_LOW_L, ANIM_STD_CAR_DRIVE_LEFT_LO,
ANIM_DRIVE_LOW_R, ANIM_STD_CAR_DRIVE_RIGHT_LO,
ANIM_DRIVEBY_L, ANIM_STD_CAR_DRIVEBY_LEFT,
ANIM_DRIVEBY_R, ANIM_STD_CAR_DRIVEBY_RIGHT,
ANIM_DRIVEBY_LOW_L, ANIM_STD_CAR_DRIVEBY_LEFT_LO,
ANIM_DRIVEBY_LOW_R, ANIM_STD_CAR_DRIVEBY_RIGHT_LO,
ANIM_CAR_LB, ANIM_STD_CAR_LOOKBEHIND,
ANIM_DRIVE_BOAT, ANIM_STD_BOAT_DRIVE,
ANIM_DRIVE_BOAT_L, ANIM_STD_BOAT_DRIVE_LEFT,
ANIM_DRIVE_BOAT_R, ANIM_STD_BOAT_DRIVE_RIGHT,
ANIM_BOAT_LB, ANIM_STD_BOAT_LOOKBEHIND,
ANIM_BIKE_PICKUP_R, ANIM_STD_BIKE_PICKUP_LHS,
ANIM_BIKE_PICKUP_L, ANIM_STD_BIKE_PICKUP_RHS,
ANIM_BIKE_PULLUP_R, ANIM_STD_BIKE_PULLUP_LHS,
ANIM_BIKE_PULLUP_L, ANIM_STD_BIKE_PULLUP_RHS,
ANIM_BIKE_ELBOW_R, ANIM_STD_BIKE_ELBOW_LHS,
ANIM_BIKE_ELBOW_L, ANIM_STD_BIKE_ELBOW_RHS,
ANIM_BIKE_FALL_OFF, ANIM_STD_BIKE_FALLOFF,
ANIM_BIKE_FALL_R, ANIM_STD_BIKE_FALLBACK,
ANIM_CAR_GETOUT_RHS, ANIM_STD_GETOUT_RHS,
ANIM_CAR_GETOUT_LOW_RHS, ANIM_STD_GETOUT_LO_RHS,
ANIM_CAR_CLOSE_RHS, ANIM_STD_CAR_CLOSE_RHS,
ANIM_CAR_HOOKERTALK, ANIM_STD_CAR_HOOKERTALK,
ANIM_TRAIN_GETIN, ANIM_STD_TRAIN_GETIN,
ANIM_TRAIN_GETOUT, ANIM_STD_TRAIN_GETOUT,
ANIM_CAR_CRAWLOUT_RHS, ANIM_STD_CRAWLOUT_LHS,
ANIM_CAR_CRAWLOUT_RHS2, ANIM_STD_CRAWLOUT_RHS,
ANIM_CAR_ROLLOUT_LHS, ANIM_STD_ROLLOUT_LHS,
ANIM_CAR_ROLLOUT_RHS, ANIM_STD_ROLLOUT_RHS,
ANIM_GETUP1, ANIM_STD_GET_UP,
ANIM_GETUP2, ANIM_STD_GET_UP_LEFT,
ANIM_GETUP3, ANIM_STD_GET_UP_RIGHT,
ANIM_GETUP_FRONT, ANIM_STD_GET_UP_FRONT,
ANIM_JUMP_LAUNCH, ANIM_STD_JUMP_LAUNCH,
ANIM_JUMP_GLIDE, ANIM_STD_JUMP_GLIDE,
ANIM_JUMP_LAND, ANIM_STD_JUMP_LAND,
ANIM_FALL_FALL, ANIM_STD_FALL,
ANIM_FALL_GLIDE, ANIM_STD_FALL_GLIDE,
ANIM_FALL_LAND, ANIM_STD_FALL_LAND,
ANIM_FALL_COLLAPSE, ANIM_STD_FALL_COLLAPSE,
ANIM_FALL_BACK, ANIM_STD_FALL_ONBACK,
ANIM_FALL_FRONT, ANIM_STD_FALL_ONFRONT,
ANIM_EV_STEP, ANIM_STD_EVADE_STEP,
ANIM_EV_DIVE, ANIM_STD_EVADE_DIVE,
ANIM_COMMANDO_ROLL, ANIM_STD_COMMANDO_ROLL,
ANIM_XPRESS_SCRATCH, ANIM_STD_XPRESS_SCRATCH,
ANIM_ROAD_CROSS, ANIM_STD_ROADCROSS,
ANIM_TURN_180, ANIM_STD_TURN180,
ANIM_ARREST_GUN, ANIM_STD_ARREST,
ANIM_DROWN, ANIM_STD_DROWN,
ANIM_DUCK_DOWN, ANIM_STD_DUCK_DOWN,
ANIM_DUCK_LOW, ANIM_STD_DUCK_LOW,
ANIM_WEAPON_CROUCH, ANIM_STD_DUCK_WEAPON,
ANIM_RBLOCK_CSHOOT, ANIM_STD_RBLOCK_SHOOT,
ANIM_HANDSUP, ANIM_STD_HANDSUP,
ANIM_HANDSCOWER, ANIM_STD_HANDSCOWER,
ANIM_FUCKU, ANIM_STD_PARTIAL_FUCKU,
ANIM_PHONE_IN, ANIM_STD_PHONE_IN,
ANIM_PHONE_OUT, ANIM_STD_PHONE_OUT,
ANIM_PHONE_TALK, ANIM_STD_PHONE_TALK,
ANIM_SEAT_DOWN, ANIM_STD_SEAT_DOWN,
ANIM_SEAT_UP, ANIM_STD_SEAT_UP,
ANIM_SEAT_IDLE, ANIM_STD_SEAT_IDLE,
ANIM_SEAT_DOWN2, ANIM_STD_SEAT_RVRS,
ANIM_ATM, ANIM_STD_ATM,
ANIM_ABSEIL, ANIM_STD_ABSEIL,
NUM_STD_ANIMS, ANIM_STD_NUM,
ANIM_VAN_OPEN_L, ANIM_STD_VAN_OPEN_DOOR_REAR_LHS,
ANIM_VAN_GETIN_L, ANIM_STD_VAN_GET_IN_REAR_LHS,
ANIM_VAN_CLOSE_L, ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS,
ANIM_VAN_GETOUT_L, ANIM_STD_VAN_GET_OUT_REAR_LHS,
ANIM_VAN_OPEN, ANIM_STD_VAN_OPEN_DOOR_REAR_RHS,
ANIM_VAN_GETIN, ANIM_STD_VAN_GET_IN_REAR_RHS,
ANIM_VAN_CLOSE, ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS,
ANIM_VAN_GETOUT, ANIM_STD_VAN_GET_OUT_REAR_RHS,
ANIM_COACH_OPEN_L, ANIM_STD_COACH_OPEN_LHS,
ANIM_COACH_OPEN_R, ANIM_STD_COACH_OPEN_RHS,
ANIM_COACH_IN_L, ANIM_STD_COACH_GET_IN_LHS,
ANIM_COACH_IN_R, ANIM_STD_COACH_GET_IN_RHS,
ANIM_COACH_OUT_L, ANIM_STD_COACH_GET_OUT_LHS,
ANIM_BIKE_RIDE, ANIM_BIKE_RIDE,
ANIM_BIKE_STILL, ANIM_BIKE_READY,
ANIM_BIKE_LEFT, ANIM_BIKE_LEFT,
ANIM_BIKE_RIGHT, ANIM_BIKE_RIGHT,
ANIM_BIKE_BACK, ANIM_BIKE_LEANB,
ANIM_BIKE_FWD, ANIM_BIKE_LEANF,
ANIM_BIKE_PUSHES, ANIM_BIKE_WALKBACK,
ANIM_BIKE_JUMPON_R, ANIM_BIKE_JUMPON_LHS,
ANIM_BIKE_JUMPON_L, ANIM_BIKE_JUMPON_RHS,
ANIM_BIKE_KICK, ANIM_BIKE_KICK,
ANIM_BIKE_HIT, ANIM_BIKE_HIT,
ANIM_BIKE_GETOFF_RHS,
ANIM_BIKE_GETOFF_LHS, ANIM_BIKE_GETOFF_LHS,
ANIM_BIKE_GETOFF_RHS,
ANIM_BIKE_GETOFF_BACK, ANIM_BIKE_GETOFF_BACK,
ANIM_BIKE_DRIVEBY_RHS,
ANIM_BIKE_DRIVEBY_LHS, ANIM_BIKE_DRIVEBY_LHS,
ANIM_BIKE_DRIVEBY_FT, ANIM_BIKE_DRIVEBY_RHS,
ANIM_BIKE_PASSENGER, 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_CROUCHFIRE,
ANIM_WEAPON_FIRE_2ND = ANIM_WEAPON_CROUCHFIRE,
ANIM_WEAPON_RELOAD, ANIM_WEAPON_RELOAD,
ANIM_WEAPON_CROUCHRELOAD, ANIM_WEAPON_CROUCHRELOAD,
ANIM_WEAPON_SPECIAL, ANIM_WEAPON_FIRE_3RD,
ANIM_MELEE_ATTACK = ANIM_WEAPON_FIRE, 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_2ND,
ANIM_MELEE_ATTACK_START, ANIM_MELEE_ATTACK_START,
ANIM_MELEE_IDLE_FIGHTMODE, ANIM_MELEE_IDLE_FIGHTMODE,
ANIM_MELEE_ATTACK_FINISH, 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_DOWN,
ANIM_SUNBATHE_UP, ANIM_SUNBATHE_UP,
ANIM_SUNBATHE_ESCAPE, ANIM_SUNBATHE_ESCAPE,
ANIM_CPR, ANIM_MEDIC_CPR,
ANIM_IDLE_STRETCH, ANIM_PLAYER_IDLE1,
ANIM_IDLE_TIME, ANIM_PLAYER_IDLE2,
ANIM_IDLE_SHOULDER, ANIM_PLAYER_IDLE3,
ANIM_IDLE_STRETCH_LEG, ANIM_PLAYER_IDLE4,
ANIM_RIOT_ANGRY, ANIM_RIOT_ANGRY,
ANIM_RIOT_ANGRY_B, ANIM_RIOT_ANGRY_B,
@ -253,7 +259,7 @@ enum AnimationId
ANIM_RIOT_PUNCHES, ANIM_RIOT_PUNCHES,
ANIM_RIOT_SHOUT, ANIM_RIOT_SHOUT,
ANIM_RIOT_CHALLENGE, ANIM_RIOT_CHALLENGE,
ANIM_RIOT_FUKU, ANIM_RIOT_FUCKYOU,
ANIM_STRIP_A, ANIM_STRIP_A,
ANIM_STRIP_B, ANIM_STRIP_B,
@ -264,17 +270,17 @@ enum AnimationId
ANIM_STRIP_G, ANIM_STRIP_G,
ANIM_MPNOTE, ANIM_MULTIPLAYER_CUTSCENE_MPNOTE,
ANIM_MPNOTE_LOOP, ANIM_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP,
ANIM_IDLE_LOOK, ANIM_CS_MISC_IDLE_LOOK,
ANIM_IDLE_NO, ANIM_CS_MISC_IDLE_NO,
ANIM_IDLE_YES, ANIM_CS_MISC_IDLE_YES,
ANIM_IDLE_CHAT2, ANIM_CS_MISC_IDLE_CHAT2,
ANIM_IDLE_COUGH, ANIM_CS_MISC_IDLE_COUGH,
ANIM_IDLE_GIGGLE_FEMALE, ANIM_CS_MISC_IDLE_GIGGLE_FEMALE,
ANIM_IDLE_TOUGH_CHAT, ANIM_CS_MISC_IDLE_TOUGH_CHAT,
ANIM_IDLE_CELL_TALK, ANIM_CS_MISC_IDLE_CELL_TALK,
ANIM_DONH2_CAMERA, ANIM_DONH2_CAMERA,
ANIM_DONH3_HAPPY, ANIM_DONH3_HAPPY,
@ -285,7 +291,7 @@ enum AnimationId
ANIM_JDT5_CALM_DOWN, ANIM_JDT5_CALM_DOWN,
ANIM_JDT5_POINT, ANIM_JDT5_POINT,
ANIM_JDT6_PICKUP, ANIM_JDT6_PICKUP,
ANIM_JDT6_DOORKNOCK, ANIM_JDT6_KNOCK,
ANIM_MAR1_SKIRT, ANIM_MAR1_SKIRT,
ANIM_MAR2_CELL_ANSWER, ANIM_MAR2_CELL_ANSWER,
@ -294,7 +300,7 @@ enum AnimationId
ANIM_MAR2_FOOT_TAP, ANIM_MAR2_FOOT_TAP,
ANIM_MAR3_HOOCHY, ANIM_MAR3_HOOCHY,
ANIM_MAR3_NOTE_IDLE, ANIM_MAR3_NOTE_IDLE,
ANIM_MAR3_NOTE_PICK, ANIM_MAR3_NOTE_PICKUP,
ANIM_SAL1_BIREFCASE_DOWN, ANIM_SAL1_BIREFCASE_DOWN,
ANIM_SAL2_IDLE_SEATED, ANIM_SAL2_IDLE_SEATED,
@ -302,8 +308,8 @@ enum AnimationId
ANIM_SAL3_SEATED_TALK, ANIM_SAL3_SEATED_TALK,
ANIM_SAL3_SEATED_IDLE, ANIM_SAL3_SEATED_IDLE,
ANIM_SAL3_SIT_DOWN, ANIM_SAL3_SIT_DOWN,
ANIM_SAL4_DUSTDOWN, ANIM_SAL4_DUST_DOWN,
ANIM_SAL4_GIRLRUN, ANIM_SAL4_GIRL_RUN,
ANIM_SAL6_ANGRY_SEATED, ANIM_SAL6_ANGRY_SEATED,
ANIM_SAL6_IDLE_SEATED, ANIM_SAL6_IDLE_SEATED,
ANIM_SAL7_LOOKOUT, ANIM_SAL7_LOOKOUT,
@ -322,7 +328,5 @@ enum AnimationId
ANIM_MAC2_PLEAD, ANIM_MAC2_PLEAD,
ANIM_VIC7_PROD_WITH_FOOT, ANIM_VIC7_PROD_WITH_FOOT
NUM_ANIMS
}; };

View file

@ -2970,6 +2970,8 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
int32 sampleIndex; int32 sampleIndex;
int32 frequency; int32 frequency;
CPed *pPed = params.m_pVehicle->pDriver; CPed *pPed = params.m_pVehicle->pDriver;
if(!pPed)
break;
if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN)) { if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN)) {
sampleIndex = SFX_UZI_LEFT; sampleIndex = SFX_UZI_LEFT;
frequency = SampleManager.GetSampleBaseFrequency(sampleIndex); frequency = SampleManager.GetSampleBaseFrequency(sampleIndex);
@ -8853,7 +8855,7 @@ cAudioManager::ProcessFrontEnd()
break; break;
case SOUND_PICKUP_BONUS: case SOUND_PICKUP_BONUS:
case SOUND_FRONTEND_MENU_STARTING: case SOUND_FRONTEND_MENU_STARTING:
case SOUND_HUD_SOUND: case SOUND_HUD:
stereo = true; stereo = true;
m_sQueueSample.m_nSampleIndex = SFX_INFO_LEFT; m_sQueueSample.m_nSampleIndex = SFX_INFO_LEFT;
center = true; center = true;
@ -8889,11 +8891,11 @@ cAudioManager::ProcessFrontEnd()
case SOUND_CLOCK_TICK: case SOUND_CLOCK_TICK:
m_sQueueSample.m_nSampleIndex = SFX_TIMER; m_sQueueSample.m_nSampleIndex = SFX_TIMER;
break; break;
case SOUND_FRONTEND_NO_RADIO: case SOUND_FRONTEND_RADIO_TURN_OFF:
case SOUND_FRONTEND_RADIO_CHANGE: case SOUND_FRONTEND_RADIO_TURN_ON:
m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK; m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK;
break; break;
case SOUND_FRONTEND_RADIO_CHANGE_2: case SOUND_FRONTEND_HURRICANE:
m_sQueueSample.m_nSampleIndex = SFX_HURRICANE_MA; m_sQueueSample.m_nSampleIndex = SFX_HURRICANE_MA;
break; break;
case SOUND_BULLETTRACE_1: case SOUND_BULLETTRACE_1:
@ -8944,9 +8946,9 @@ cAudioManager::ProcessFrontEnd()
sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]; sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
if (sample == SOUND_FRONTEND_NO_RADIO) if (sample == SOUND_FRONTEND_RADIO_TURN_OFF)
m_sQueueSample.m_nFrequency = 28509; m_sQueueSample.m_nFrequency = 28509;
else if (sample == SOUND_FRONTEND_RADIO_CHANGE) else if (sample == SOUND_FRONTEND_RADIO_TURN_ON)
m_sQueueSample.m_nFrequency = 32000; m_sQueueSample.m_nFrequency = 32000;
else if (sample == SOUND_BULLETTRACE_1 || sample == SOUND_BULLETTRACE_2) { else if (sample == SOUND_BULLETTRACE_1 || sample == SOUND_BULLETTRACE_2) {
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);

View file

@ -21,6 +21,10 @@
#include "DMAudio.h" #include "DMAudio.h"
#include "GenericGameStorage.h" #include "GenericGameStorage.h"
#if !defined FIX_BUGS && (defined RADIO_SCROLL_TO_PREV_STATION || defined RADIO_OFF_TEXT)
static_assert(false, "R*'s radio implementation is quite buggy, RADIO_SCROLL_TO_PREV_STATION and RADIO_OFF_TEXT won't work without FIX_BUGS");
#endif
cMusicManager MusicManager; cMusicManager MusicManager;
int32 gNumRetunePresses; int32 gNumRetunePresses;
int32 gRetuneCounter; int32 gRetuneCounter;
@ -52,7 +56,7 @@ cMusicManager::cMusicManager()
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nUpcomingMusicMode = MUSICMODE_DISABLED; m_nUpcomingMusicMode = MUSICMODE_DISABLED;
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
field_2 = false; m_bSetNextStation = false;
for (int i = 0; i < NUM_RADIOS; i++) for (int i = 0; i < NUM_RADIOS; i++)
aListenTimeArray[i] = 0.0f; aListenTimeArray[i] = 0.0f;
@ -71,27 +75,27 @@ cMusicManager::ResetMusicAfterReload()
float afRadioTime[NUM_RADIOS]; float afRadioTime[NUM_RADIOS];
m_bRadioSetByScript = false; m_bRadioSetByScript = false;
m_nRadioStation = WILDSTYLE; m_nRadioStationScript = WILDSTYLE;
m_nRadioPosition = -1; m_nRadioPosition = -1;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = false;
field_2 = false; m_bSetNextStation = false;
RadioStaticTimer = 0; RadioStaticTimer = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
field_398E = false; m_FrontendLoopFlag = false;
field_398F = false; m_bTrackChangeStarted = false;
m_nStreamedTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
field_3994 = false; m_nNextLoopFlag = false;
field_3995 = false; m_bVerifyNextTrackStartedToPlay = false;
field_3996 = false; m_bGameplayAllowsRadio = false;
field_3997 = false; m_bRadioStreamReady = false;
nFramesSinceCutsceneEnded = -1; nFramesSinceCutsceneEnded = -1;
field_3999 = false; m_bUserResumedGame = false;
field_399A = false; m_bMusicModeChangeStarted = false;
field_399C = false; m_bEarlyFrontendTrack = false;
m_nVolumeLatency = 0; m_nVolumeLatency = 0;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 0; m_nMaxVolume = 0;
@ -108,7 +112,7 @@ cMusicManager::ResetMusicAfterReload()
for (int i = 0; i < NUM_RADIOS; i++) { for (int i = 0; i < NUM_RADIOS; i++) {
aListenTimeArray[i] = afRadioTime[i]; aListenTimeArray[i] = afRadioTime[i];
uint32 trackPos = GetSavedRadioStationPosition(i); int32 trackPos = GetSavedRadioStationPosition(i);
if (trackPos != -1) { if (trackPos != -1) {
if (trackPos > m_aTracks[i].m_nLength) { if (trackPos > m_aTracks[i].m_nLength) {
debug("Radio Track %d saved position is %d, Length is only %d\n", i, trackPos, m_aTracks[i].m_nLength); debug("Radio Track %d saved position is %d, Length is only %d\n", i, trackPos, m_aTracks[i].m_nLength);
@ -179,7 +183,7 @@ cMusicManager::Initialise()
m_bResetTimers = false; m_bResetTimers = false;
m_nResetTime = 0; m_nResetTime = 0;
m_bRadioSetByScript = false; m_bRadioSetByScript = false;
m_nRadioStation = WILDSTYLE; m_nRadioStationScript = WILDSTYLE;
m_nRadioPosition = -1; m_nRadioPosition = -1;
m_nRadioInCar = NO_TRACK; m_nRadioInCar = NO_TRACK;
gRetuneCounter = 0; gRetuneCounter = 0;
@ -188,18 +192,18 @@ cMusicManager::Initialise()
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nUpcomingMusicMode = MUSICMODE_DISABLED; m_nUpcomingMusicMode = MUSICMODE_DISABLED;
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
field_398E = false; m_FrontendLoopFlag = false;
field_398F = false; m_bTrackChangeStarted = false;
m_nStreamedTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
field_3994 = false; m_nNextLoopFlag = false;
field_3995 = false; m_bVerifyNextTrackStartedToPlay = false;
field_3996 = false; m_bGameplayAllowsRadio = false;
field_3997 = false; m_bRadioStreamReady = false;
nFramesSinceCutsceneEnded = -1; nFramesSinceCutsceneEnded = -1;
field_3999 = false; m_bUserResumedGame = false;
field_399A = false; m_bMusicModeChangeStarted = false;
m_nMusicModeToBeSet = MUSICMODE_DISABLED; m_nMusicModeToBeSet = MUSICMODE_DISABLED;
field_399C = false; m_bEarlyFrontendTrack = false;
m_nVolumeLatency = 0; m_nVolumeLatency = 0;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 0; m_nMaxVolume = 0;
@ -227,7 +231,7 @@ cMusicManager::SetRadioChannelByScript(uint32 station, int32 pos)
station = STREAMED_SOUND_CITY_AMBIENT; station = STREAMED_SOUND_CITY_AMBIENT;
if (station <= STREAMED_SOUND_RADIO_POLICE) { if (station <= STREAMED_SOUND_RADIO_POLICE) {
m_bRadioSetByScript = true; m_bRadioSetByScript = true;
m_nRadioStation = station; m_nRadioStationScript = station;
m_nRadioPosition = pos == -1 ? -1 : pos % m_aTracks[station].m_nLength; m_nRadioPosition = pos == -1 ? -1 : pos % m_aTracks[station].m_nLength;
} }
} }
@ -292,7 +296,7 @@ cMusicManager::SetRadioInCar(uint32 station)
void void
cMusicManager::RecordRadioStats() cMusicManager::RecordRadioStats()
{ {
if (m_nPlayingTrack < STREAMED_SOUND_CITY_AMBIENT) { if (m_nPlayingTrack < NUM_RADIOS) {
double time /*Rusty*/ = CTimer::GetTimeInMillisecondsPauseMode(); double time /*Rusty*/ = CTimer::GetTimeInMillisecondsPauseMode();
if (time > m_nLastTrackServiceTime) if (time > m_nLastTrackServiceTime)
aListenTimeArray[m_nPlayingTrack] += time - m_nLastTrackServiceTime; aListenTimeArray[m_nPlayingTrack] += time - m_nLastTrackServiceTime;
@ -321,11 +325,11 @@ cMusicManager::ChangeMusicMode(uint8 mode)
while (SampleManager.IsStreamPlaying(0)) while (SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
m_nMusicMode = m_nUpcomingMusicMode; m_nMusicMode = m_nUpcomingMusicMode;
field_399A = false; m_bMusicModeChangeStarted = false;
field_398F = false; m_bTrackChangeStarted = false;
m_nStreamedTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
field_3994 = false; m_nNextLoopFlag = false;
field_3995 = false; m_bVerifyNextTrackStartedToPlay = false;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = false;
@ -356,7 +360,7 @@ cMusicManager::Service()
if (!m_bIsInitialised || m_bDisabled) return; if (!m_bIsInitialised || m_bDisabled) return;
if (!field_399A) if (!m_bMusicModeChangeStarted)
m_nMusicModeToBeSet = m_nUpcomingMusicMode; m_nMusicModeToBeSet = m_nUpcomingMusicMode;
if (m_nMusicModeToBeSet == m_nMusicMode) { if (m_nMusicModeToBeSet == m_nMusicMode) {
if (!AudioManager.m_nUserPause || AudioManager.m_nPreviousUserPause || m_nMusicMode != MUSICMODE_FRONTEND) if (!AudioManager.m_nUserPause || AudioManager.m_nPreviousUserPause || m_nMusicMode != MUSICMODE_FRONTEND)
@ -371,13 +375,13 @@ cMusicManager::Service()
else else
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
} else { } else {
field_399A = true; m_bMusicModeChangeStarted = true;
if (!field_3999 && !AudioManager.m_nUserPause && AudioManager.m_nPreviousUserPause) if (!m_bUserResumedGame && !AudioManager.m_nUserPause && AudioManager.m_nPreviousUserPause)
field_3999 = true; m_bUserResumedGame = true;
if (AudioManager.m_FrameCounter % 4 == 0) { if (AudioManager.m_FrameCounter % 4 == 0) {
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
field_2 = false; m_bSetNextStation = false;
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded) if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded)
{ {
@ -390,14 +394,14 @@ cMusicManager::Service()
} else { } else {
bRadioStatsRecorded = false; bRadioStatsRecorded = false;
m_nMusicMode = m_nMusicModeToBeSet; m_nMusicMode = m_nMusicModeToBeSet;
field_399A = false; m_bMusicModeChangeStarted = false;
field_398F = false; m_bTrackChangeStarted = false;
m_nStreamedTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
field_3994 = false; m_nNextLoopFlag = false;
field_3995 = false; m_bVerifyNextTrackStartedToPlay = false;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
if (field_399C) if (m_bEarlyFrontendTrack)
field_399C = false; m_bEarlyFrontendTrack = false;
else else
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
} }
@ -417,19 +421,19 @@ cMusicManager::ServiceFrontEndMode()
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = false;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = false;
m_nStreamedTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
if (AudioManager.m_FrameCounter % 4 != 0) return; if (AudioManager.m_FrameCounter % 4 != 0) return;
if (!field_398F && !field_3995) { if (!m_bTrackChangeStarted && !m_bVerifyNextTrackStartedToPlay) {
m_nStreamedTrack = m_nFrontendTrack; m_nNextTrack = m_nFrontendTrack;
field_3994 = field_398E; m_nNextLoopFlag = m_FrontendLoopFlag;
} }
if (m_nStreamedTrack == m_nPlayingTrack) { if (m_nNextTrack == m_nPlayingTrack) {
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
if (m_nVolumeLatency > 0) m_nVolumeLatency--; if (m_nVolumeLatency > 0) m_nVolumeLatency--;
else { else {
@ -444,25 +448,25 @@ cMusicManager::ServiceFrontEndMode()
ChangeMusicMode(MUSICMODE_GAME); ChangeMusicMode(MUSICMODE_GAME);
} }
} else { } else {
field_398F = true; m_bTrackChangeStarted = true;
if (field_3995 || !SampleManager.IsStreamPlaying(0)) { if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) {
bRadioStatsRecorded = false; bRadioStatsRecorded = false;
if (SampleManager.IsStreamPlaying(0) || m_nStreamedTrack == NO_TRACK) { if (SampleManager.IsStreamPlaying(0) || m_nNextTrack == NO_TRACK) {
m_nPlayingTrack = m_nStreamedTrack; m_nPlayingTrack = m_nNextTrack;
field_3995 = false; m_bVerifyNextTrackStartedToPlay = false;
field_398F = false; m_bTrackChangeStarted = false;
} else { } else {
uint32 trackStartPos = (m_nStreamedTrack > STREAMED_SOUND_RADIO_POLICE) ? 0 : GetTrackStartPos(m_nStreamedTrack); uint32 trackStartPos = (m_nNextTrack > STREAMED_SOUND_RADIO_POLICE) ? 0 : GetTrackStartPos(m_nNextTrack);
if (m_nStreamedTrack != NO_TRACK) { if (m_nNextTrack != NO_TRACK) {
SampleManager.SetStreamedFileLoopFlag(field_3994, 0); SampleManager.SetStreamedFileLoopFlag(m_nNextLoopFlag, 0);
SampleManager.StartStreamedFile(m_nStreamedTrack, trackStartPos, 0); SampleManager.StartStreamedFile(m_nNextTrack, trackStartPos, 0);
m_nVolumeLatency = 3; m_nVolumeLatency = 3;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 100; m_nMaxVolume = 100;
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
if (m_nStreamedTrack < STREAMED_SOUND_CITY_AMBIENT) if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
field_3995 = true; m_bVerifyNextTrackStartedToPlay = true;
} }
} }
} else { } else {
@ -483,8 +487,8 @@ cMusicManager::ServiceGameMode()
{ {
CPed *ped = FindPlayerPed(); CPed *ped = FindPlayerPed();
CVehicle *vehicle = AudioManager.FindVehicleOfPlayer(); CVehicle *vehicle = AudioManager.FindVehicleOfPlayer();
field_3997 = field_3996; m_bRadioStreamReady = m_bGameplayAllowsRadio;
field_3996 = false; m_bGameplayAllowsRadio = false;
switch (CGame::currArea) switch (CGame::currArea)
{ {
@ -495,29 +499,28 @@ cMusicManager::ServiceGameMode()
case AREA_BLOOD: case AREA_BLOOD:
case AREA_OVALRING: case AREA_OVALRING:
case AREA_MALIBU_CLUB: case AREA_MALIBU_CLUB:
field_3996 = false; m_bGameplayAllowsRadio = false;
break; break;
default: default:
if (SampleManager.GetMusicVolume()) { if (SampleManager.GetMusicVolume()) {
if (PlayerInCar()) if (PlayerInCar())
field_3996 = true; m_bGameplayAllowsRadio = true;
} else } else
field_3996 = false; m_bGameplayAllowsRadio = false;
break; break;
} }
if (!field_3996) { if (!m_bGameplayAllowsRadio) {
nFramesSinceCutsceneEnded = -1; nFramesSinceCutsceneEnded = -1;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
field_2 = false; m_bSetNextStation = false;
} else if (ped) { } else if (ped) {
if(!ped->DyingOrDead()) { if(!ped->DyingOrDead() && vehicle) {
#ifdef GTA_PC #ifdef GTA_PC
if (SampleManager.IsMP3RadioChannelAvailable() if (SampleManager.IsMP3RadioChannelAvailable()
&& vehicle->m_nRadioStation < USERTRACK && vehicle->m_nRadioStation < USERTRACK
&& ControlsManager.GetIsKeyboardKeyJustDown(rsF9) && ControlsManager.GetIsKeyboardKeyJustDown(rsF9))
&& vehicle)
{ {
if (!UsesPoliceRadio(vehicle) && !UsesTaxiRadio(vehicle)) { if (!UsesPoliceRadio(vehicle) && !UsesTaxiRadio(vehicle)) {
gNumRetunePresses = 0; gNumRetunePresses = 0;
@ -532,7 +535,7 @@ cMusicManager::ServiceGameMode()
} }
} }
#endif #endif
if (CPad::GetPad(0)->ChangeStationJustDown() && vehicle) if (CPad::GetPad(0)->ChangeStationJustDown())
{ {
if (!UsesPoliceRadio(vehicle) && !UsesTaxiRadio(vehicle)) { if (!UsesPoliceRadio(vehicle) && !UsesTaxiRadio(vehicle)) {
gNumRetunePresses++; gNumRetunePresses++;
@ -540,147 +543,183 @@ cMusicManager::ServiceGameMode()
RadioStaticCounter = 0; RadioStaticCounter = 0;
} }
} }
#ifdef RADIO_SCROLL_TO_PREV_STATION
else if(CPad::GetPad(0)->GetMouseWheelDownJustDown() || CPad::GetPad(0)->GetMouseWheelUpJustDown()) {
if(!UsesPoliceRadio(vehicle) && !UsesTaxiRadio(vehicle)) {
int scrollNext = ControlsManager.GetControllerKeyAssociatedWithAction(VEHICLE_CHANGE_RADIO_STATION, MOUSE);
int scrollPrev = scrollNext == rsMOUSEWHEELUPBUTTON ? rsMOUSEWHEELDOWNBUTTON
: scrollNext == rsMOUSEWHEELDOWNBUTTON ? rsMOUSEWHEELUPBUTTON : -1;
if(scrollPrev != -1 && !ControlsManager.IsAnyVehicleActionAssignedToMouseKey(scrollPrev)) {
gNumRetunePresses--;
gRetuneCounter = 20;
RadioStaticCounter = 0;
int track = gNumRetunePresses + vehicle->m_nRadioStation;
while(track < 0) track += NUM_RADIOS + 1;
while(track >= NUM_RADIOS + 1) track -= NUM_RADIOS + 1;
if(!DMAudio.IsMP3RadioChannelAvailable() && track == USERTRACK) gNumRetunePresses--;
}
}
}
#endif
} }
} }
if (field_3999) if (m_bUserResumedGame)
{ {
field_3997 = false; m_bRadioStreamReady = false;
field_3999 = false; m_bUserResumedGame = false;
} }
if (m_nPlayingTrack == NO_TRACK && m_nFrontendTrack == NO_TRACK) if (m_nPlayingTrack == NO_TRACK && m_nFrontendTrack == NO_TRACK)
field_3997 = false; m_bRadioStreamReady = false;
if (field_3996) if (m_bGameplayAllowsRadio)
{ {
if (field_3997) if (!m_bRadioStreamReady)
{ {
if (m_nAnnouncement < NO_TRACK) { if(vehicle == nil) {
if ((m_bAnnouncementInProgress || m_nFrontendTrack == m_nPlayingTrack) && ServiceAnnouncement()) { m_nFrontendTrack = STREAMED_SOUND_RADIO_LCFR; // huh?
if (m_bAnnouncementInProgress) {
field_2 = false;
gNumRetunePresses = 0;
gRetuneCounter = 0;
return;
}
if(m_nAnnouncement == NO_TRACK) {
m_nStreamedTrack = NO_TRACK;
m_nFrontendTrack = GetCarTuning();
field_2 = false;
gRetuneCounter = 0;
gNumRetunePresses = 0;
}
}
}
if (!m_bAnnouncementInProgress
&& m_nAnnouncement == NO_TRACK
&& m_nPlayingTrack == STREAMED_SOUND_RADIO_MP3_PLAYER
&& !SampleManager.IsStreamPlaying(0))
{
SampleManager.StartStreamedFile(STREAMED_SOUND_RADIO_MP3_PLAYER, 0, 0);
}
if (!m_bRadioSetByScript)
{
if (gNumRetunePresses != 0)
{
if (--gRetuneCounter == 0)
{
field_2 = true;
gRetuneCounter = 0;
}
}
if (gRetuneCounter)
{
int32 station = gNumRetunePresses + vehicle->m_nRadioStation;
while (station >= RADIO_OFF) station -= RADIO_OFF;
if (!DMAudio.IsMP3RadioChannelAvailable() && station == USERTRACK)
{
++gNumRetunePresses;
station = NUM_RADIOS;
}
if (station == NUM_RADIOS)
{
if (gRetuneCounter == NUM_RADIOS + 9)
{
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_NO_RADIO, 0.0f);
RadioStaticCounter = 5;
}
}
else
{
if (station == WILDSTYLE && gRetuneCounter == NUM_RADIOS + 9)
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 0.0f);
AudioManager.DoPoliceRadioCrackle();
}
}
if (RadioStaticCounter < 2 && CTimer::GetTimeInMilliseconds() > RadioStaticTimer + 800)
{
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_RADIO_CHANGE, 0.0f);
RadioStaticCounter++;
RadioStaticTimer = CTimer::GetTimeInMilliseconds();
}
if (field_2)
m_nFrontendTrack = GetNextCarTuning();
if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped);
if (field_2)
field_2 = false;
return; return;
} }
if (UsesPoliceRadio(vehicle)) if(m_bRadioSetByScript) {
m_nFrontendTrack = STREAMED_SOUND_RADIO_POLICE; if(UsesPoliceRadio(vehicle))
else if (UsesTaxiRadio(vehicle)) m_nFrontendTrack = STREAMED_SOUND_RADIO_POLICE;
m_nFrontendTrack = STREAMED_SOUND_RADIO_TAXI; else if(UsesTaxiRadio(vehicle))
else { m_nFrontendTrack = STREAMED_SOUND_RADIO_TAXI;
m_nFrontendTrack = m_nRadioStation; else {
vehicle->m_nRadioStation = m_nRadioStation; m_nFrontendTrack = m_nRadioStationScript;
vehicle->m_nRadioStation = m_nRadioStationScript;
}
if(m_nRadioPosition != -1) {
m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition;
m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
m_bRadioSetByScript = false;
return;
} }
if (m_nRadioPosition != -1) { // This starts the radio when you enter the car.
m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition; m_nFrontendTrack = GetCarTuning();
m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); return;
}
if (m_nAnnouncement < NO_TRACK) {
if ((m_bAnnouncementInProgress || m_nFrontendTrack == m_nPlayingTrack) && ServiceAnnouncement()) {
if (m_bAnnouncementInProgress) {
m_bSetNextStation = false;
gNumRetunePresses = 0;
gRetuneCounter = 0;
return;
}
if(m_nAnnouncement == NO_TRACK) {
m_nNextTrack = NO_TRACK;
m_nFrontendTrack = GetCarTuning();
m_bSetNextStation = false;
gRetuneCounter = 0;
gNumRetunePresses = 0;
}
} }
}
if (!m_bAnnouncementInProgress
&& m_nAnnouncement == NO_TRACK
&& m_nPlayingTrack == STREAMED_SOUND_RADIO_MP3_PLAYER
&& !SampleManager.IsStreamPlaying(0))
{
SampleManager.StartStreamedFile(STREAMED_SOUND_RADIO_MP3_PLAYER, 0, 0);
}
gRetuneCounter = 0; if (!m_bRadioSetByScript)
gNumRetunePresses = 0; {
field_2 = false; // Because when you switch radio back and forth, gNumRetunePresses will be 0 but gRetuneCounter won't.
m_bRadioSetByScript = false; #ifdef RADIO_SCROLL_TO_PREV_STATION
if(gRetuneCounter != 0) {
if(gRetuneCounter > 1)
gRetuneCounter--;
else if(gRetuneCounter == 1) {
m_bSetNextStation = true;
gRetuneCounter = 0;
}
}
#else
if (gNumRetunePresses != 0)
{
if (--gRetuneCounter == 0)
{
m_bSetNextStation = true;
gRetuneCounter = 0;
}
}
#endif
if (gRetuneCounter)
{
int32 station = gNumRetunePresses + vehicle->m_nRadioStation;
#ifdef RADIO_SCROLL_TO_PREV_STATION
while (station < 0) station += NUM_RADIOS + 1;
#endif
while (station >= NUM_RADIOS + 1) station -= NUM_RADIOS + 1;
// Scrolling back won't hit here, so increasing isn't problem
if (!DMAudio.IsMP3RadioChannelAvailable() && station == USERTRACK)
{
++gNumRetunePresses;
station = RADIO_OFF;
}
if (station == RADIO_OFF)
{
if (gRetuneCounter == 19) // One less then what switching radio sets, so runs right after turning off radio
{
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_TURN_OFF, 0.0f);
RadioStaticCounter = 5;
}
}
else
{
#ifdef RADIO_SCROLL_TO_PREV_STATION
if (vehicle->m_nRadioStation == RADIO_OFF && gRetuneCounter == 19) // Right after turning on the radio
#else
if (station == 0 && gRetuneCounter == 19) // Right after turning on the radio
#endif
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_TURN_ON, 0.0f);
AudioManager.DoPoliceRadioCrackle();
}
}
if (RadioStaticCounter < 2 && CTimer::GetTimeInMilliseconds() > RadioStaticTimer + 800)
{
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_RADIO_CHANGE, 0.0f);
RadioStaticCounter++;
RadioStaticTimer = CTimer::GetTimeInMilliseconds();
}
if (m_bSetNextStation)
m_nFrontendTrack = GetNextCarTuning();
if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT) if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
SetUpCorrectAmbienceTrack(); SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped); ServiceTrack(vehicle, ped);
if (field_2) if (m_bSetNextStation)
field_2 = false; m_bSetNextStation = false;
return; return;
} }
if (vehicle == nil) if (UsesPoliceRadio(vehicle))
{ m_nFrontendTrack = STREAMED_SOUND_RADIO_POLICE;
m_nFrontendTrack = STREAMED_SOUND_RADIO_LCFR; // huh? else if (UsesTaxiRadio(vehicle))
return; m_nFrontendTrack = STREAMED_SOUND_RADIO_TAXI;
} else {
if (m_bRadioSetByScript) m_nFrontendTrack = m_nRadioStationScript;
{ vehicle->m_nRadioStation = m_nRadioStationScript;
if (UsesPoliceRadio(vehicle))
m_nFrontendTrack = STREAMED_SOUND_RADIO_POLICE;
else if (UsesTaxiRadio(vehicle))
m_nFrontendTrack = STREAMED_SOUND_RADIO_TAXI;
else {
m_nFrontendTrack = m_nRadioStation;
vehicle->m_nRadioStation = m_nRadioStation;
}
if (m_nRadioPosition != -1)
{
m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition;
m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
m_bRadioSetByScript = false;
return;
} }
m_nFrontendTrack = GetCarTuning(); if (m_nRadioPosition != -1) {
m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition;
m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
gRetuneCounter = 0;
gNumRetunePresses = 0;
m_bSetNextStation = false;
m_bRadioSetByScript = false;
if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped);
if (m_bSetNextStation)
m_bSetNextStation = false;
return; return;
} }
@ -692,7 +731,7 @@ cMusicManager::ServiceGameMode()
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = false;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = false;
m_nStreamedTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
@ -834,7 +873,7 @@ cMusicManager::ServiceAnnouncement()
{ {
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
if (SampleManager.IsStreamPlaying(0)) if (SampleManager.IsStreamPlaying(0))
m_nPlayingTrack = m_nStreamedTrack; m_nPlayingTrack = m_nNextTrack;
else if (m_nPlayingTrack != NO_TRACK) { else if (m_nPlayingTrack != NO_TRACK) {
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = false;
@ -852,9 +891,9 @@ cMusicManager::ServiceAnnouncement()
} else { } else {
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = false;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nStreamedTrack = m_nAnnouncement; m_nNextTrack = m_nAnnouncement;
SampleManager.SetStreamedFileLoopFlag(0, false); SampleManager.SetStreamedFileLoopFlag(0, 0);
SampleManager.StartStreamedFile(m_nStreamedTrack, 0, 0); SampleManager.StartStreamedFile(m_nNextTrack, 0, 0);
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 0, 0);
m_bAnnouncementInProgress = true; m_bAnnouncementInProgress = true;
} }
@ -868,9 +907,9 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
static bool bRadioStatsRecorded = false; static bool bRadioStatsRecorded = false;
static bool bRadioStatsRecorded2 = false; static bool bRadioStatsRecorded2 = false;
uint8 volume; uint8 volume;
if (!field_398F) if (!m_bTrackChangeStarted)
m_nStreamedTrack = m_nFrontendTrack; m_nNextTrack = m_nFrontendTrack;
if (gRetuneCounter != 0 || field_2) { if (gRetuneCounter != 0 || m_bSetNextStation) {
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded) { if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded) {
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
@ -889,28 +928,35 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
if (m_nStreamedTrack != m_nPlayingTrack) if (m_nNextTrack != m_nPlayingTrack)
{ {
field_398F = true; m_bTrackChangeStarted = true;
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
if (!(AudioManager.m_FrameCounter & 1)) { if (!(AudioManager.m_FrameCounter & 1)) {
if (field_3995 || !SampleManager.IsStreamPlaying(0)) { if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) {
bRadioStatsRecorded2 = false; bRadioStatsRecorded2 = false;
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
m_nPlayingTrack = m_nStreamedTrack; m_nPlayingTrack = m_nNextTrack;
field_3995 = false; m_bVerifyNextTrackStartedToPlay = false;
field_398F = false; m_bTrackChangeStarted = false;
if (veh) { if (veh) {
if (veh->m_nRadioStation < STREAMED_SOUND_CITY_AMBIENT || veh->m_nRadioStation > STREAMED_SOUND_AMBSIL_AMBIENT) #ifdef FIX_BUGS
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
veh->m_nRadioStation = RADIO_OFF;
else if (m_nPlayingTrack < STREAMED_SOUND_CITY_AMBIENT)
veh->m_nRadioStation = m_nPlayingTrack; veh->m_nRadioStation = m_nPlayingTrack;
#else
if (veh->m_nRadioStation >= STREAMED_SOUND_CITY_AMBIENT && veh->m_nRadioStation <= STREAMED_SOUND_AMBSIL_AMBIENT)
veh->m_nRadioStation = RADIO_OFF;
else else
veh->m_nRadioStation = STREAMED_SOUND_CITY_AMBIENT; veh->m_nRadioStation = m_nPlayingTrack;
#endif
} }
} else { } else {
uint32 pos = GetTrackStartPos(m_nStreamedTrack); uint32 pos = GetTrackStartPos(m_nNextTrack);
if (m_nStreamedTrack != NO_TRACK) { if (m_nNextTrack != NO_TRACK) {
SampleManager.SetStreamedFileLoopFlag(1, 0); SampleManager.SetStreamedFileLoopFlag(1, 0);
SampleManager.StartStreamedFile(m_nStreamedTrack, pos, 0); SampleManager.StartStreamedFile(m_nNextTrack, pos, 0);
if (m_nFrontendTrack < STREAMED_SOUND_CITY_AMBIENT || m_nFrontendTrack > STREAMED_SOUND_AMBSIL_AMBIENT) if (m_nFrontendTrack < STREAMED_SOUND_CITY_AMBIENT || m_nFrontendTrack > STREAMED_SOUND_AMBSIL_AMBIENT)
{ {
m_nVolumeLatency = 10; m_nVolumeLatency = 10;
@ -923,9 +969,9 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
ComputeAmbienceVol(true, volume); ComputeAmbienceVol(true, volume);
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
} }
if (m_nStreamedTrack < STREAMED_SOUND_CITY_AMBIENT) if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
field_3995 = true; m_bVerifyNextTrackStartedToPlay = true;
} }
} }
} else { } else {
@ -939,8 +985,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
RecordRadioStats(); RecordRadioStats();
if (m_nPlayingTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT) if (m_nPlayingTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT)
{ {
if (m_nStreamedTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nStreamedTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT) if (m_nNextTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nNextTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT)
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE_2, 0.0); AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_HURRICANE, 0.0);
} }
} }
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
@ -1050,14 +1096,14 @@ cMusicManager::StopCutSceneMusic(void)
} }
void void
cMusicManager::PlayFrontEndTrack(uint32 track, uint8 bPlayInFrontend) cMusicManager::PlayFrontEndTrack(uint32 track, uint8 loopFlag)
{ {
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && (m_nUpcomingMusicMode == MUSICMODE_FRONTEND || m_nMusicMode == MUSICMODE_FRONTEND)) if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && (m_nUpcomingMusicMode == MUSICMODE_FRONTEND || m_nMusicMode == MUSICMODE_FRONTEND))
{ {
m_nFrontendTrack = track; m_nFrontendTrack = track;
field_398E = bPlayInFrontend; m_FrontendLoopFlag = loopFlag;
if (m_nMusicMode != MUSICMODE_FRONTEND) if (m_nMusicMode != MUSICMODE_FRONTEND)
field_399C = true; m_bEarlyFrontendTrack = true;
} }
} }
@ -1083,10 +1129,18 @@ cMusicManager::GetNextCarTuning()
if (UsesPoliceRadio(veh)) return STREAMED_SOUND_RADIO_POLICE; if (UsesPoliceRadio(veh)) return STREAMED_SOUND_RADIO_POLICE;
if (UsesTaxiRadio(veh)) return STREAMED_SOUND_RADIO_TAXI; if (UsesTaxiRadio(veh)) return STREAMED_SOUND_RADIO_TAXI;
if (gNumRetunePresses != 0) { if (gNumRetunePresses != 0) {
#ifdef RADIO_SCROLL_TO_PREV_STATION
// m_nRadioStation is unsigned, so...
int station = veh->m_nRadioStation + gNumRetunePresses;
while(station < 0) station += NUM_RADIOS + 1;
while(station >= NUM_RADIOS + 1) station -= NUM_RADIOS + 1;
veh->m_nRadioStation = station;
#else
veh->m_nRadioStation += gNumRetunePresses; veh->m_nRadioStation += gNumRetunePresses;
while (veh->m_nRadioStation >= RADIO_OFF) while(veh->m_nRadioStation >= NUM_RADIOS + 1)
veh->m_nRadioStation -= RADIO_OFF; veh->m_nRadioStation -= NUM_RADIOS + 1;
DMAudio.IsMP3RadioChannelAvailable(); // woof, just call and do nothing =P #endif
DMAudio.IsMP3RadioChannelAvailable(); // woof, just call and do nothing =P they manipulate gNumRetunePresses on DisplayRadioStationName in this case
gNumRetunePresses = 0; gNumRetunePresses = 0;
} }
return veh->m_nRadioStation; return veh->m_nRadioStation;
@ -1129,7 +1183,7 @@ cMusicManager::GetTrackStartPos(uint32 track)
uint32 uint32
cMusicManager::GetRadioPosition(uint32 station) cMusicManager::GetRadioPosition(uint32 station)
{ {
if (station < STREAMED_SOUND_CITY_AMBIENT) if (station < NUM_RADIOS)
return GetTrackStartPos(station); return GetTrackStartPos(station);
return 0; return 0;
} }
@ -1158,7 +1212,7 @@ cMusicManager::SetMalibuClubTrackPos(uint8 scriptObject)
{ {
if (!IsInitialised()) if (!IsInitialised())
m_aTracks[STREAMED_SOUND_MALIBU_AMBIENT].m_nPosition = 8640; m_aTracks[STREAMED_SOUND_MALIBU_AMBIENT].m_nPosition = 8640;
if (m_nStreamedTrack != STREAMED_SOUND_MALIBU_AMBIENT && m_nPlayingTrack != STREAMED_SOUND_MALIBU_AMBIENT) { if (m_nNextTrack != STREAMED_SOUND_MALIBU_AMBIENT && m_nPlayingTrack != STREAMED_SOUND_MALIBU_AMBIENT) {
switch (scriptObject) switch (scriptObject)
{ {
case SCRIPT_SOUND_NEW_BUILDING_MALIBU_1: case SCRIPT_SOUND_NEW_BUILDING_MALIBU_1:
@ -1180,7 +1234,7 @@ cMusicManager::SetStripClubTrackPos(uint8 scriptObject)
{ {
if (!IsInitialised()) if (!IsInitialised())
m_aTracks[STREAMED_SOUND_STRIPCLUB_AMBIENT].m_nPosition = 0; m_aTracks[STREAMED_SOUND_STRIPCLUB_AMBIENT].m_nPosition = 0;
if (m_nStreamedTrack != STREAMED_SOUND_STRIPCLUB_AMBIENT && m_nPlayingTrack != STREAMED_SOUND_STRIPCLUB_AMBIENT) if (m_nNextTrack != STREAMED_SOUND_STRIPCLUB_AMBIENT && m_nPlayingTrack != STREAMED_SOUND_STRIPCLUB_AMBIENT)
{ {
switch (scriptObject) switch (scriptObject)
{ {
@ -1201,7 +1255,7 @@ cMusicManager::SetStripClubTrackPos(uint8 scriptObject)
void void
cMusicManager::DisplayRadioStationName() cMusicManager::DisplayRadioStationName()
{ {
int8 gStreamedSound; uint8 gStreamedSound;
static wchar *pCurrentStation = nil; static wchar *pCurrentStation = nil;
static uint8 cDisplay = 0; static uint8 cDisplay = 0;
@ -1211,20 +1265,28 @@ cMusicManager::DisplayRadioStationName()
if (vehicle) if (vehicle)
{ {
uint8 track; int8 track;
gStreamedSound = vehicle->m_nRadioStation; gStreamedSound = vehicle->m_nRadioStation;
if (gStreamedSound >= STREAMED_SOUND_CITY_AMBIENT && gStreamedSound <= STREAMED_SOUND_AMBSIL_AMBIENT) if (gStreamedSound >= STREAMED_SOUND_CITY_AMBIENT && gStreamedSound <= STREAMED_SOUND_AMBSIL_AMBIENT)
gStreamedSound = STREAMED_SOUND_CITY_AMBIENT; gStreamedSound = RADIO_OFF;
if (gNumRetunePresses != 0) if (gNumRetunePresses != 0)
{ {
track = gNumRetunePresses + gStreamedSound; track = gNumRetunePresses + gStreamedSound;
while (track >= RADIO_OFF) track -= RADIO_OFF; #ifdef RADIO_SCROLL_TO_PREV_STATION
while (track < 0) track += NUM_RADIOS + 1;
#endif
while (track >= NUM_RADIOS + 1) track -= NUM_RADIOS + 1;
// We already handle this condition while scrolling back, on key press. No need to change this.
if (!DMAudio.IsMP3RadioChannelAvailable() && track == USERTRACK) if (!DMAudio.IsMP3RadioChannelAvailable() && track == USERTRACK)
gNumRetunePresses++; gNumRetunePresses++;
} }
else else
#ifdef FIX_BUGS
track = GetCarTuning(); // gStreamedSound or veh->m_nRadioStation would also work, but these don't cover police/taxi radios
#else
track = m_nFrontendTrack; track = m_nFrontendTrack;
#endif
wchar* string = nil; wchar* string = nil;
switch (track) { switch (track) {
@ -1274,6 +1336,11 @@ cMusicManager::DisplayRadioStationName()
CFont::SetCentreSize(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH)); CFont::SetCentreSize(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
} }
} }
// Always show station text after entering car. Same behaviour as III and SA.
#ifdef FIX_BUGS
else
pCurrentStation = nil;
#endif
} }
bool bool

View file

@ -18,7 +18,7 @@ class cMusicManager
public: public:
bool m_bIsInitialised; bool m_bIsInitialised;
bool m_bDisabled; bool m_bDisabled;
bool field_2; bool m_bSetNextStation;
uint8 m_nVolumeLatency; uint8 m_nVolumeLatency;
uint8 m_nCurrentVolume; uint8 m_nCurrentVolume;
uint8 m_nMaxVolume; uint8 m_nMaxVolume;
@ -28,25 +28,25 @@ public:
bool m_bResetTimers; bool m_bResetTimers;
uint32 m_nResetTime; uint32 m_nResetTime;
bool m_bRadioSetByScript; bool m_bRadioSetByScript;
uint8 m_nRadioStation; uint8 m_nRadioStationScript;
uint32 m_nRadioPosition; int32 m_nRadioPosition;
uint32 m_nRadioInCar; uint32 m_nRadioInCar;
uint32 m_nFrontendTrack; uint32 m_nFrontendTrack;
uint32 m_nPlayingTrack; uint32 m_nPlayingTrack;
uint8 m_nUpcomingMusicMode; uint8 m_nUpcomingMusicMode;
uint8 m_nMusicMode; uint8 m_nMusicMode;
bool field_398E; bool m_FrontendLoopFlag;
bool field_398F; bool m_bTrackChangeStarted;
uint32 m_nStreamedTrack; uint32 m_nNextTrack;
bool field_3994; bool m_nNextLoopFlag;
bool field_3995; bool m_bVerifyNextTrackStartedToPlay;
bool field_3996; bool m_bGameplayAllowsRadio;
bool field_3997; bool m_bRadioStreamReady;
int8 nFramesSinceCutsceneEnded; int8 nFramesSinceCutsceneEnded;
bool field_3999; bool m_bUserResumedGame;
bool field_399A; bool m_bMusicModeChangeStarted;
uint8 m_nMusicModeToBeSet; uint8 m_nMusicModeToBeSet;
bool field_399C; bool m_bEarlyFrontendTrack;
float aListenTimeArray[NUM_RADIOS]; float aListenTimeArray[NUM_RADIOS];
float m_nLastTrackServiceTime; float m_nLastTrackServiceTime;

View file

@ -14,8 +14,8 @@ enum eRadioStation
USERTRACK, USERTRACK,
NUM_RADIOS = 11, NUM_RADIOS = 11,
POLICE_RADIO = 11, POLICE_RADIO = 11,
RADIO_OFF = 10,
//TAXI_RADIO, //TAXI_RADIO,
RADIO_OFF,
}; };
enum eMusicMode enum eMusicMode

View file

@ -15,6 +15,8 @@ ALuint alFilters[MAXCHANNELS+MAX2DCHANNELS];
ALuint alBuffers[MAXCHANNELS+MAX2DCHANNELS]; ALuint alBuffers[MAXCHANNELS+MAX2DCHANNELS];
bool bChannelsCreated = false; bool bChannelsCreated = false;
int32 CChannel::channelsThatNeedService = 0;
void void
CChannel::InitChannels() CChannel::InitChannels()
{ {
@ -59,7 +61,9 @@ void CChannel::SetDefault()
Position[0] = 0.0f; Position[1] = 0.0f; Position[2] = 0.0f; Position[0] = 0.0f; Position[1] = 0.0f; Position[2] = 0.0f;
Distances[0] = 0.0f; Distances[1] = FLT_MAX; Distances[0] = 0.0f; Distances[1] = FLT_MAX;
LoopCount = 1;
LoopCount = 1;
LastProcessedOffset = UINT32_MAX;
LoopPoints[0] = 0; LoopPoints[1] = -1; LoopPoints[0] = 0; LoopPoints[1] = -1;
Frequency = MAX_FREQ; Frequency = MAX_FREQ;
@ -67,6 +71,10 @@ void CChannel::SetDefault()
void CChannel::Reset() void CChannel::Reset()
{ {
// Here is safe because ctor don't call this
if (LoopCount > 1)
channelsThatNeedService--;
ClearBuffer(); ClearBuffer();
SetDefault(); SetDefault();
} }
@ -165,10 +173,51 @@ void CChannel::SetCurrentFreq(uint32 freq)
SetPitch(ALfloat(freq) / Frequency); SetPitch(ALfloat(freq) / Frequency);
} }
void CChannel::SetLoopCount(int32 loopCount) // fake. TODO: void CChannel::SetLoopCount(int32 count)
{ {
if ( !HasSource() ) return; 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) void CChannel::SetLoopPoints(ALint start, ALint end)
@ -200,6 +249,7 @@ void CChannel::SetPan(int32 pan)
void CChannel::ClearBuffer() void CChannel::ClearBuffer()
{ {
if ( !HasSource() ) return; if ( !HasSource() ) return;
alSourcei(alSources[id], AL_LOOPING, AL_FALSE);
alSourcei(alSources[id], AL_BUFFER, AL_NONE); alSourcei(alSources[id], AL_BUFFER, AL_NONE);
Data = nil; Data = nil;
DataSize = 0; DataSize = 0;

View file

@ -19,7 +19,10 @@ class CChannel
float Distances[2]; float Distances[2];
int32 LoopCount; int32 LoopCount;
ALint LoopPoints[2]; ALint LoopPoints[2];
ALint LastProcessedOffset;
public: public:
static int32 channelsThatNeedService;
static void InitChannels(); static void InitChannels();
static void DestroyChannels(); static void DestroyChannels();
@ -37,7 +40,7 @@ public:
void SetVolume(int32 vol); void SetVolume(int32 vol);
void SetSampleData(void *_data, size_t _DataSize, int32 freq); void SetSampleData(void *_data, size_t _DataSize, int32 freq);
void SetCurrentFreq(uint32 freq); void SetCurrentFreq(uint32 freq);
void SetLoopCount(int32 loopCount); // fake void SetLoopCount(int32 count);
void SetLoopPoints(ALint start, ALint end); void SetLoopPoints(ALint start, ALint end);
void SetPosition(float x, float y, float z); void SetPosition(float x, float y, float z);
void SetDistances(float max, float min); void SetDistances(float max, float min);
@ -45,6 +48,7 @@ public:
void ClearBuffer(); void ClearBuffer();
void SetReverbMix(ALuint slot, float mix); void SetReverbMix(ALuint slot, float mix);
void UpdateReverb(ALuint slot); void UpdateReverb(ALuint slot);
bool Update();
}; };
#endif #endif

View file

@ -465,7 +465,7 @@ public:
#ifdef AUDIO_OAL_USE_MPG123 #ifdef AUDIO_OAL_USE_MPG123
// fuzzy seek eliminates stutter when playing ADF but spams errors a lot (nothing breaks though) // fuzzy seek eliminates stutter when playing ADF but spams errors a lot (nothing breaks though)
#define MP3_USE_FUZZY_SEEK //#define MP3_USE_FUZZY_SEEK
class CMP3File : public IDecoder class CMP3File : public IDecoder
{ {
@ -499,6 +499,7 @@ public:
m_bOpened = mpg123_open(m_pMH, path) == MPG123_OK m_bOpened = mpg123_open(m_pMH, path) == MPG123_OK
&& mpg123_getformat(m_pMH, &rate, &channels, &encoding) == MPG123_OK; && mpg123_getformat(m_pMH, &rate, &channels, &encoding) == MPG123_OK;
m_nRate = rate; m_nRate = rate;
m_nChannels = channels; m_nChannels = channels;
@ -980,7 +981,8 @@ CStream::CStream(char *filename, ALuint *sources, ALuint (&buffers)[NUM_STREAMBU
m_bReset(false), m_bReset(false),
m_nVolume(0), m_nVolume(0),
m_nPan(0), m_nPan(0),
m_nPosBeforeReset(0) m_nPosBeforeReset(0),
m_nLoopCount(1)
{ {
// Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/) // Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/)
@ -1078,7 +1080,7 @@ bool CStream::IsPlaying()
ALint sourceState[2]; ALint sourceState[2];
alGetSourcei(m_pAlSources[0], AL_SOURCE_STATE, &sourceState[0]); alGetSourcei(m_pAlSources[0], AL_SOURCE_STATE, &sourceState[0]);
alGetSourcei(m_pAlSources[1], AL_SOURCE_STATE, &sourceState[1]); 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; return true;
} }
@ -1150,6 +1152,7 @@ void CStream::SetPan(uint8 nPan)
m_nPan = nPan; m_nPan = nPan;
} }
// Should only be called if source is stopped
void CStream::SetPosMS(uint32 nPos) void CStream::SetPosMS(uint32 nPos)
{ {
if ( !IsOpened() ) return; if ( !IsOpened() ) return;
@ -1232,10 +1235,16 @@ void CStream::ClearBuffers()
alSourceUnqueueBuffers(m_pAlSources[1], 1, &value); alSourceUnqueueBuffers(m_pAlSources[1], 1, &value);
} }
bool CStream::Setup() bool CStream::Setup(bool imSureQueueIsEmpty)
{ {
if ( IsOpened() ) 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); m_pSoundFile->Seek(0);
//SetPosition(0.0f, 0.0f, 0.0f); //SetPosition(0.0f, 0.0f, 0.0f);
SetPitch(1.0f); SetPitch(1.0f);
@ -1246,6 +1255,13 @@ bool CStream::Setup()
return IsOpened(); return IsOpened();
} }
void CStream::SetLoopCount(int32 count)
{
if ( !HasSource() ) return;
m_nLoopCount = count;
}
void CStream::SetPlay(bool state) void CStream::SetPlay(bool state)
{ {
if ( !HasSource() ) return; if ( !HasSource() ) return;
@ -1305,7 +1321,7 @@ void CStream::Update()
if ( !m_bPaused ) if ( !m_bPaused )
{ {
ALint sourceState[2]; ALint totalBuffers[2] = { 0, 0 };
ALint buffersProcessed[2] = { 0, 0 }; ALint buffersProcessed[2] = { 0, 0 };
// Relying a lot on left buffer states in here // Relying a lot on left buffer states in here
@ -1313,44 +1329,51 @@ void CStream::Update()
do do
{ {
//alSourcef(m_pAlSources[0], AL_ROLLOFF_FACTOR, 0.0f); //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]); alGetSourcei(m_pAlSources[0], AL_BUFFERS_PROCESSED, &buffersProcessed[0]);
//alSourcef(m_pAlSources[1], AL_ROLLOFF_FACTOR, 0.0f); //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]); alGetSourcei(m_pAlSources[1], AL_BUFFERS_PROCESSED, &buffersProcessed[1]);
} while (buffersProcessed[0] != 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]); 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]; Setup(true);
buffersRefilled = FillBuffers() != 0;
alSourceUnqueueBuffers(m_pAlSources[0], 1, &buffer[0]); if (m_nLoopCount != 0)
alSourceUnqueueBuffers(m_pAlSources[1], 1, &buffer[1]); m_nLoopCount--;
}
if (m_bActive && FillBuffer(buffer)) else
{
while( buffersProcessed[0]-- )
{ {
alSourceQueueBuffers(m_pAlSources[0], 1, &buffer[0]); ALuint buffer[2];
alSourceQueueBuffers(m_pAlSources[1], 1, &buffer[1]);
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 ) // 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)))
alGetSourcei(m_pAlSources[0], AL_BUFFERS_PROCESSED, &buffersProcessed[0]); SetPlay(true);
SetPlay(buffersProcessed[0]!=0);
}
} }
} }
@ -1358,10 +1381,11 @@ void CStream::ProviderInit()
{ {
if ( m_bReset ) if ( m_bReset )
{ {
if ( Setup() ) if ( Setup(true) )
{ {
SetPan(m_nPan); SetPan(m_nPan);
SetVolume(m_nVolume); SetVolume(m_nVolume);
SetLoopCount(m_nLoopCount);
SetPosMS(m_nPosBeforeReset); SetPosMS(m_nPosBeforeReset);
if (m_bActive) if (m_bActive)
FillBuffers(); FillBuffers();

View file

@ -69,6 +69,7 @@ class CStream
uint32 m_nVolume; uint32 m_nVolume;
uint8 m_nPan; uint8 m_nPan;
uint32 m_nPosBeforeReset; uint32 m_nPosBeforeReset;
int32 m_nLoopCount;
IDecoder *m_pSoundFile; IDecoder *m_pSoundFile;
@ -99,10 +100,12 @@ public:
uint32 GetPosMS(); uint32 GetPosMS();
uint32 GetLengthMS(); uint32 GetLengthMS();
bool Setup(); bool Setup(bool imSureQueueIsEmpty = false);
void Start(); void Start();
void Stop(); void Stop();
void Update(void); void Update(void);
void SetLoopCount(int32);
void ProviderInit(); void ProviderInit();
void ProviderTerm(); void ProviderTerm();

View file

@ -46,7 +46,6 @@
//TODO: fix eax3 reverb //TODO: fix eax3 reverb
//TODO: max channels //TODO: max channels
//TODO: loop count
cSampleManager SampleManager; cSampleManager SampleManager;
bool _bSampmanInitialised = false; bool _bSampmanInitialised = false;
@ -1695,7 +1694,7 @@ cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
ASSERT(stream != NULL); ASSERT(stream != NULL);
aStream[nStream] = stream; aStream[nStream] = stream;
if ( !stream->IsOpened() ) if ( !stream->Setup() )
{ {
delete stream; delete stream;
aStream[nStream] = NULL; aStream[nStream] = NULL;
@ -1725,7 +1724,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
if ( stream ) if ( stream )
{ {
if ( stream->Setup() ) if ( stream->IsOpened() )
{ {
stream->Start(); stream->Start();
} }
@ -1771,13 +1770,13 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
aStream[nStream] = stream; aStream[nStream] = stream;
if (stream->IsOpened()) { if (stream->Setup()) {
if (stream->Setup()) { stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
if (position != 0) nStreamLoopedFlag[nStream] = true;
stream->SetPosMS(position); if (position != 0)
stream->SetPosMS(position);
stream->Start(); stream->Start();
}
return true; return true;
} else { } else {
@ -1798,10 +1797,8 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
} }
if (aStream[nStream]->IsOpened()) { if (aStream[nStream]->Setup()) {
if (aStream[nStream]->Setup()) { aStream[nStream]->Start();
aStream[nStream]->Start();
}
return true; return true;
} else { } else {
@ -1827,13 +1824,13 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
aStream[nStream] = stream; aStream[nStream] = stream;
if (stream->IsOpened()) { if (stream->Setup()) {
if (stream->Setup()) { stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
if (position != 0) nStreamLoopedFlag[nStream] = true;
stream->SetPosMS(position); if (position != 0)
stream->SetPosMS(position);
stream->Start(); stream->Start();
}
return true; return true;
} else { } else {
@ -1854,13 +1851,11 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream]); aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream]);
} }
if (aStream[nStream]->IsOpened()) { if (aStream[nStream]->Setup()) {
if (aStream[nStream]->Setup()) { if (position != 0)
if (position != 0) aStream[nStream]->SetPosMS(position);
aStream[nStream]->SetPosMS(position);
aStream[nStream]->Start(); aStream[nStream]->Start();
}
_bIsMp3Active = true; _bIsMp3Active = true;
return true; return true;
@ -1884,13 +1879,13 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
aStream[nStream] = stream; aStream[nStream] = stream;
if ( stream->IsOpened() ) { if ( stream->Setup() ) {
if ( stream->Setup() ) { stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
if (position != 0) nStreamLoopedFlag[nStream] = true;
stream->SetPosMS(position); if (position != 0)
stream->SetPosMS(position);
stream->Start(); stream->Start();
}
return true; return true;
} else { } else {
@ -1913,6 +1908,9 @@ cSampleManager::StopStreamedFile(uint8 nStream)
{ {
delete stream; delete stream;
aStream[nStream] = NULL; aStream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
} }
} }
@ -1925,7 +1923,21 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
if ( stream ) if ( stream )
{ {
return stream->GetPosMS(); if ( _bIsMp3Active )
{
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
if ( mp3 != NULL )
{
return stream->GetPosMS() + mp3->nTrackStreamPos;
}
else
return 0;
}
else
{
return stream->GetPosMS();
}
} }
return 0; return 0;
@ -2001,6 +2013,12 @@ cSampleManager::Service(void)
if ( stream ) if ( stream )
stream->Update(); stream->Update();
} }
int refCount = CChannel::channelsThatNeedService;
for ( int32 i = 0; refCount && i < MAXCHANNELS+MAX2DCHANNELS; i++ )
{
if ( aChannel[i].Update() )
refCount--;
}
} }
bool bool

View file

@ -171,22 +171,22 @@ enum eSound
SOUND_CAR_PED_COLLISION, SOUND_CAR_PED_COLLISION,
SOUND_CLOCK_TICK, SOUND_CLOCK_TICK,
SOUND_PART_MISSION_COMPLETE, 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?? // TODO(Miami): What are 170-175??
SOUND_FRONTEND_NO_RADIO = 176, // those 3 are all same sound SOUND_FRONTEND_RADIO_TURN_OFF = 176, // those 2 are same sound
SOUND_FRONTEND_RADIO_CHANGE, SOUND_FRONTEND_RADIO_TURN_ON,
SOUND_FRONTEND_RADIO_CHANGE_2, SOUND_FRONTEND_HURRICANE, // yes, frontend
SOUND_HUD_SOUND, SOUND_HUD,
SOUND_180, SOUND_180,
SOUND_181, SOUND_181,
SOUND_182, SOUND_182,
SOUND_LIGHTNING, SOUND_LIGHTNING,
SOUND_BULLETTRACE_1, SOUND_BULLETTRACE_1,
SOUND_BULLETTRACE_2, SOUND_BULLETTRACE_2,
SOUND_186, // makes same sound with 40 SOUND_186, // makes same sound as 40
SOUND_187, // makes same sound with 46 SOUND_187, // makes same sound as 46
SOUND_MELEE_ATTACK_START, SOUND_MELEE_ATTACK_START,
SOUND_SKATING, SOUND_SKATING,
SOUND_WEAPON_MINIGUN_ATTACK, SOUND_WEAPON_MINIGUN_ATTACK,

View file

@ -311,8 +311,16 @@ CCollision::TestLineTriangle(const CColLine &line, const CompressedVector *verts
if(plane.CalcPoint(line.p0) * plane.CalcPoint(line.p1) > 0.0f) if(plane.CalcPoint(line.p0) * plane.CalcPoint(line.p1) > 0.0f)
return false; 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 // 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 // find point of intersection
CVector p = line.p0 + (line.p1-line.p0)*t; CVector p = line.p0 + (line.p1-line.p0)*t;
@ -1131,8 +1139,17 @@ CCollision::ProcessLineTriangle(const CColLine &line,
if(plane.CalcPoint(line.p0) * plane.CalcPoint(line.p1) > 0.0f) if(plane.CalcPoint(line.p0) * plane.CalcPoint(line.p1) > 0.0f)
return false; 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 // 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 // early out if we're beyond the mindist
if(t >= mindist) if(t >= mindist)
return false; return false;

View file

@ -2790,7 +2790,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
up.Normalise(); up.Normalise();
CVector forward(Cos(pPlane->m_fOrientation), Sin(pPlane->m_fOrientation), fForwardZ); CVector forward(Cos(pPlane->m_fOrientation), Sin(pPlane->m_fOrientation), fForwardZ);
forward.Normalise(); forward.Normalise();
CVector right = CrossProduct(forward, up); CVector right = CrossProduct(up, forward);
right.z -= 5.0f * pPlane->m_fPlaneSteer; right.z -= 5.0f * pPlane->m_fPlaneSteer;
right.Normalise(); right.Normalise();
up = CrossProduct(forward, right); up = CrossProduct(forward, right);

View file

@ -2357,7 +2357,11 @@ float CGarages::FindDoorHeightForMI(int32 mi)
void CGarage::TidyUpGarage() void CGarage::TidyUpGarage()
{ {
uint32 i = CPools::GetVehiclePool()->GetSize(); uint32 i = CPools::GetVehiclePool()->GetSize();
#ifdef FIX_BUGS
while (i--) { while (i--) {
#else
while (--i) {
#endif
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
if (pVehicle && (pVehicle->IsCar() || pVehicle->IsBike())) { if (pVehicle && (pVehicle->IsCar() || pVehicle->IsBike())) {
if (IsPointInsideGarage(pVehicle->GetPosition())) { if (IsPointInsideGarage(pVehicle->GetPosition())) {
@ -2373,7 +2377,11 @@ void CGarage::TidyUpGarage()
void CGarage::TidyUpGarageClose() void CGarage::TidyUpGarageClose()
{ {
uint32 i = CPools::GetVehiclePool()->GetSize(); uint32 i = CPools::GetVehiclePool()->GetSize();
#ifdef FIX_BUGS
while (i--) { while (i--) {
#else
while (--i) {
#endif
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
if (!pVehicle) if (!pVehicle)
continue; continue;

View file

@ -859,7 +859,7 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor
mag = Sqrt(dx*dx + dy*dy); mag = Sqrt(dx*dx + dy*dy);
dx /= mag; dx /= mag;
dy /= 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){ if(i < j){
dx = -dx; dx = -dx;
dy = -dy; dy = -dy;

View file

@ -120,7 +120,7 @@ struct CCarPathLink
uint8 trafficLightDirection : 1; uint8 trafficLightDirection : 1;
uint8 trafficLightType : 2; uint8 trafficLightType : 2;
uint8 bBridgeLights : 1; // at least in LCS... uint8 bBridgeLights : 1; // at least in LCS...
int8 width; uint8 width;
CVector2D GetPosition(void) { return CVector2D(x/8.0f, y/8.0f); } CVector2D GetPosition(void) { return CVector2D(x/8.0f, y/8.0f); }
CVector2D GetDirection(void) { return CVector2D(dirX/100.0f, dirY/100.0f); } CVector2D GetDirection(void) { return CVector2D(dirX/100.0f, dirY/100.0f); }
@ -151,7 +151,7 @@ struct CPathInfoForObject
int8 numLeftLanes; int8 numLeftLanes;
int8 numRightLanes; int8 numRightLanes;
int8 speedLimit; int8 speedLimit;
int8 width; uint8 width;
uint8 crossing : 1; uint8 crossing : 1;
uint8 onlySmallBoats : 1; uint8 onlySmallBoats : 1;
@ -177,7 +177,7 @@ struct CTempNode
int16 link2; int16 link2;
int8 numLeftLanes; int8 numLeftLanes;
int8 numRightLanes; int8 numRightLanes;
int8 width; uint8 width;
bool isCross; bool isCross;
int8 linkState; int8 linkState;
}; };
@ -188,7 +188,7 @@ struct CTempNodeExternal // made up name
int16 next; int16 next;
int8 numLeftLanes; int8 numLeftLanes;
int8 numRightLanes; int8 numRightLanes;
int8 width; uint8 width;
bool isCross; bool isCross;
}; };

View file

@ -48,9 +48,9 @@ CPhoneInfo::Update(void)
TheCamera.SetWideScreenOff(); TheCamera.SetWideScreenOff();
pPhoneDisplayingMessages = nil; pPhoneDisplayingMessages = nil;
bDisplayingPhoneMessage = false; 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) { 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->flags &= ~ASSOC_DELETEFADEDOUT;
endAssoc->SetFinishCallback(PhonePutDownCB, player); endAssoc->SetFinishCallback(PhonePutDownCB, player);
} else { } else {
@ -107,7 +107,7 @@ CPhoneInfo::Update(void)
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE); CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE);
TheCamera.SetWideScreenOn(); TheCamera.SetWideScreenOn();
playerInfo->MakePlayerSafe(true); 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]); phonePickAssoc->SetFinishCallback(PhonePickUpCB, &m_aPhones[phoneId]);
bPickingUpPhone = true; bPickingUpPhone = true;
pCallBackPed = player; pCallBackPed = player;
@ -363,10 +363,10 @@ PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg)
CPed *ped = CPhoneInfo::pCallBackPed; CPed *ped = CPhoneInfo::pCallBackPed;
ped->m_nMoveState = PEDMOVE_STILL; 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) 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; CPhoneInfo::pCallBackPed = nil;
} }

View file

@ -274,10 +274,11 @@ CPickup::CanBePickedUp(CPlayerPed *player, int playerId)
{ {
assert(m_pObject != nil); assert(m_pObject != nil);
bool cannotBePickedUp = bool cannotBePickedUp =
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 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.5f) || (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_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; return !cannotBePickedUp;
} }

View file

@ -521,7 +521,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
state->aFunctionCallbackID[i] = 0; state->aFunctionCallbackID[i] = 0;
} }
}else{ }else{
state->aAnimId[i] = NUM_STD_ANIMS; state->aAnimId[i] = ANIM_STD_NUM;
state->aCurTime[i] = 0; state->aCurTime[i] = 0;
state->aSpeed[i] = 85; state->aSpeed[i] = 85;
state->aFunctionCallbackID[i] = 0; state->aFunctionCallbackID[i] = 0;
@ -548,7 +548,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
} }
} }
else { else {
state->aAnimId2[i] = NUM_STD_ANIMS; state->aAnimId2[i] = ANIM_STD_NUM;
state->aCurTime2[i] = 0; state->aCurTime2[i] = 0;
state->aSpeed2[i] = 85; state->aSpeed2[i] = 85;
state->aFunctionCallbackID2[i] = 0; state->aFunctionCallbackID2[i] = 0;
@ -611,13 +611,13 @@ bool HasAnimGroupLoaded(uint8 group)
void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state) void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
{ {
CAnimBlendAssociation* anim1; CAnimBlendAssociation* anim1;
if (state->animId <= 3) if (state->animId <= ANIM_STD_IDLE)
anim1 = CAnimManager::BlendAnimation( anim1 = CAnimManager::BlendAnimation(
(RpClump*)ped->m_rwObject, ped->m_animGroup, (AnimationId)state->animId, 100.0f); (RpClump*)ped->m_rwObject, ped->m_animGroup, (AnimationId)state->animId, 100.0f);
else if (HasAnimGroupLoaded(state->groupId)) else if (HasAnimGroupLoaded(state->groupId))
anim1 = CAnimManager::BlendAnimation((RpClump*)ped->m_rwObject, (AssocGroupId)state->groupId, (AnimationId)state->animId, 100.0f); anim1 = CAnimManager::BlendAnimation((RpClump*)ped->m_rwObject, (AssocGroupId)state->groupId, (AnimationId)state->animId, 100.0f);
else 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->SetCurrentTime(state->time * 4.0f / 255.0f);
anim1->speed = state->speed * 3.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; float blend = state->blendAmount * 2.0f / 255.0f;
CAnimBlendAssociation* anim2 = CAnimManager::BlendAnimation( CAnimBlendAssociation* anim2 = CAnimManager::BlendAnimation(
(RpClump*)ped->m_rwObject, (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); (AnimationId)state->secAnimId, 100.0f);
anim2->SetCurrentTime(time); anim2->SetCurrentTime(time);
anim2->speed = speed; anim2->speed = speed;
@ -641,7 +641,7 @@ void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
float time = state->partAnimTime * 4.0f / 255.0f; float time = state->partAnimTime * 4.0f / 255.0f;
float speed = state->partAnimSpeed * 3.0f / 255.0f; float speed = state->partAnimSpeed * 3.0f / 255.0f;
float blend = state->partBlendAmount * 2.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( CAnimBlendAssociation* anim3 = CAnimManager::BlendAnimation(
(RpClump*)ped->m_rwObject, (AssocGroupId)state->partGroupId, (AnimationId)state->partAnimId, 1000.0f); (RpClump*)ped->m_rwObject, (AssocGroupId)state->partGroupId, (AnimationId)state->partAnimId, 1000.0f);
anim3->SetCurrentTime(time); anim3->SetCurrentTime(time);
@ -659,10 +659,10 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt
for (int i = 0; ((assoc = RpAnimBlendClumpGetMainPartialAssociation_N(ped->GetClump(), i))); i++) for (int i = 0; ((assoc = RpAnimBlendClumpGetMainPartialAssociation_N(ped->GetClump(), i))); i++)
assoc->SetBlend(0.0f, -1.0f); assoc->SetBlend(0.0f, -1.0f);
for (int i = 0; i < NUM_MAIN_ANIMS_IN_REPLAY; i++) { 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; continue;
CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), 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]); (AnimationId)state->aAnimId[i]);
anim->SetCurrentTime(state->aCurTime[i] * 4.0f / 255.0f); anim->SetCurrentTime(state->aCurTime[i] * 4.0f / 255.0f);
anim->speed = state->aSpeed[i] * 3.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); anim->SetDeleteCallback(FindCBFunction(callback & 0x7F), ped);
} }
for (int i = 0; i < NUM_PARTIAL_ANIMS_IN_REPLAY; i++) { 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; continue;
CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), 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]); (AnimationId)state->aAnimId2[i]);
anim->SetCurrentTime(state->aCurTime2[i] * 4.0f / 255.0f); anim->SetCurrentTime(state->aCurTime2[i] * 4.0f / 255.0f);
anim->speed = state->aSpeed2[i] * 3.0f / 255.0f; anim->speed = state->aSpeed2[i] * 3.0f / 255.0f;

View file

@ -5165,7 +5165,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
pPlayer->m_pPed->m_pVehicleAnim->blendDelta = -1000.0f; pPlayer->m_pPed->m_pVehicleAnim->blendDelta = -1000.0f;
pPlayer->m_pPed->m_pVehicleAnim = nil; pPlayer->m_pPed->m_pVehicleAnim = nil;
pPlayer->m_pPed->SetMoveState(PEDMOVE_NONE); 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(); pPlayer->m_pPed->RestartNonPartialAnims();
AudioManager.PlayerJustLeftCar(); AudioManager.PlayerJustLeftCar();
pos.z += pPlayer->m_pPed->GetDistanceFromCentreOfMassToBaseOfModel(); pos.z += pPlayer->m_pPed->GetDistanceFromCentreOfMassToBaseOfModel();

View file

@ -817,7 +817,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
} }
} }
pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags; 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->m_pVehicleAnim = nil;
pPed->RestartNonPartialAnims(); pPed->RestartNonPartialAnims();
pPed->SetMoveState(PEDMOVE_NONE); 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(); pos.z += pPed->GetDistanceFromCentreOfMassToBaseOfModel();
pPed->Teleport(pos); pPed->Teleport(pos);
CTheScripts::ClearSpaceForMissionEntity(pos, pPed); CTheScripts::ClearSpaceForMissionEntity(pos, pPed);

View file

@ -2674,10 +2674,10 @@ bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer)
CPed* pPed = pPlayer->m_pPed; CPed* pPed = pPlayer->m_pPed;
if (pPed->InVehicle()) if (pPed->InVehicle())
return IsVehicleStopped(pPed->m_pMyVehicle); return IsVehicleStopped(pPed->m_pMyVehicle);
if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP) || if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_RUNSTOP1) ||
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP_R) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_RUNSTOP2) ||
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_JUMP_LAUNCH) ||
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE)) RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_JUMP_GLIDE))
return false; return false;
return (pPed->m_nMoveState == PEDMOVE_NONE || pPed->m_nMoveState == PEDMOVE_STILL) && 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; !pPed->bIsInTheAir && !pPed->bIsLanding && pPed->bIsStanding && pPed->m_vecAnimMoveDelta.x == 0.0f && pPed->m_vecAnimMoveDelta.y == 0.0f;

View file

@ -452,12 +452,12 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0)); CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0));
script_assert(pPed); script_assert(pPed);
if (GET_INTEGER_PARAM(1)) { if (GET_INTEGER_PARAM(1)) {
pPed->bIsDucking = true; pPed->bCrouchWhenShooting = true;
pPed->SetDuck(GET_INTEGER_PARAM(2), true); pPed->SetDuck(GET_INTEGER_PARAM(2), true);
} }
else { else {
pPed->ClearDuck(true); pPed->ClearDuck(true);
pPed->bIsDucking = false; pPed->bCrouchWhenShooting = false;
} }
return 0; return 0;
} }
@ -771,7 +771,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
CHud::SetHelpMessage(text, false, true); // + true CHud::SetHelpMessage(text, false, true); // + true
if (text != CHud::gLastPrintForeverString) { if (text != CHud::gLastPrintForeverString) {
CHud::gLastPrintForeverString = text; CHud::gLastPrintForeverString = text;
DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0); DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
} }
return 0; return 0;
} }

View file

@ -53,7 +53,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
((CPlayerPed*)pPed)->m_fMoveSpeed = 0.0f; ((CPlayerPed*)pPed)->m_fMoveSpeed = 0.0f;
else else
pPed->m_nStoredMoveState = PEDMOVE_STILL; 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; pPed->bIsPedDieAnimPlaying = false;
} }
return 0; return 0;
@ -346,7 +346,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0)); CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0));
script_assert(pPed); script_assert(pPed);
UpdateCompareFlag(RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_DUCK_DOWN) != nil); UpdateCompareFlag(RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_DUCK_DOWN) != nil);
return 0; return 0;
} }
case COMMAND_CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI: case COMMAND_CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI:

View file

@ -453,8 +453,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0)); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0));
assert(pVehicle); assert(pVehicle);
pVehicle->ProcessOpenDoor(CAR_DOOR_RR, ANIM_VAN_OPEN, 1.0f); pVehicle->ProcessOpenDoor(CAR_DOOR_RR, ANIM_STD_VAN_OPEN_DOOR_REAR_RHS, 1.0f);
pVehicle->ProcessOpenDoor(CAR_DOOR_LR, ANIM_VAN_OPEN_L, 1.0f); pVehicle->ProcessOpenDoor(CAR_DOOR_LR, ANIM_STD_VAN_OPEN_DOOR_REAR_LHS, 1.0f);
return 0; return 0;
} }
case COMMAND_GET_CHAR_THREAT_CHAR: case COMMAND_GET_CHAR_THREAT_CHAR:

View file

@ -260,8 +260,8 @@ void CSetPiece::Update(void)
CCarAI::AddPoliceCarOccupants(pVehicle1); CCarAI::AddPoliceCarOccupants(pVehicle1);
CVehicle* pVehicle2 = TryToGenerateCopCar(m_vSpawn2, m_vTarget2); CVehicle* pVehicle2 = TryToGenerateCopCar(m_vSpawn2, m_vTarget2);
if (!pVehicle2) { if (!pVehicle2) {
CWorld::Remove(pVehicle2); CWorld::Remove(pVehicle1);
delete pVehicle2; delete pVehicle1;
return; return;
} }
pVehicle2->SetStatus(STATUS_PHYSICS); pVehicle2->SetStatus(STATUS_PHYSICS);

View file

@ -245,7 +245,7 @@ CAnimViewer::Update(void)
if (modelInfo->GetModelType() == MITYPE_PED) { if (modelInfo->GetModelType() == MITYPE_PED) {
int animGroup = ((CPedModelInfo*)modelInfo)->m_animGroup; int animGroup = ((CPedModelInfo*)modelInfo)->m_animGroup;
if (animId > ANIM_IDLE_STANCE) if (animId > ANIM_STD_IDLE)
animGroup = ASSOCGRP_STD; animGroup = ASSOCGRP_STD;
if (reloadIFP) { if (reloadIFP) {
@ -334,14 +334,14 @@ CAnimViewer::Update(void)
CMessages::AddMessage(gUString, 1000, 0); CMessages::AddMessage(gUString, 1000, 0);
} else if (pad->GetCircleJustDown()) { } else if (pad->GetCircleJustDown()) {
PlayAnimation(pTarget->GetClump(), animGroup, ANIM_IDLE_STANCE); PlayAnimation(pTarget->GetClump(), animGroup, ANIM_STD_IDLE);
AsciiToUnicode("Idle animation playing", gUString); AsciiToUnicode("Idle animation playing", gUString);
CMessages::AddMessage(gUString, 1000, 0); CMessages::AddMessage(gUString, 1000, 0);
} else if (pad->GetDPadUpJustDown()) { } else if (pad->GetDPadUpJustDown()) {
animId--; animId--;
if (animId < 0) { if (animId < 0) {
animId = NUM_STD_ANIMS - 1; animId = ANIM_STD_NUM - 1;
} }
PlayAnimation(pTarget->GetClump(), animGroup, (AnimationId)animId); PlayAnimation(pTarget->GetClump(), animGroup, (AnimationId)animId);
@ -350,7 +350,7 @@ CAnimViewer::Update(void)
CMessages::AddMessage(gUString, 1000, 0); CMessages::AddMessage(gUString, 1000, 0);
} else if (pad->GetDPadDownJustDown()) { } 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); PlayAnimation(pTarget->GetClump(), animGroup, (AnimationId)animId);
sprintf(gString, "Current anim: %d", animId); sprintf(gString, "Current anim: %d", animId);

View file

@ -1769,7 +1769,7 @@ CCamera::CamControl(void)
(m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) && (m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) &&
!m_WideScreenOn && !m_WideScreenOn &&
(WhoIsInControlOfTheCamera != CAMCONTROL_OBBE || bSwitchedToObbeCam)) (WhoIsInControlOfTheCamera != CAMCONTROL_OBBE || bSwitchedToObbeCam))
DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0); DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
} }
// What a mess! // What a mess!

View file

@ -43,6 +43,6 @@ char *CdStreamGetImageName(int32 cd);
void CdStreamRemoveImages(void); void CdStreamRemoveImages(void);
int32 CdStreamGetNumImages(void); int32 CdStreamGetNumImages(void);
#ifndef _WIN32 #ifdef FLUSHABLE_STREAMING
extern bool flushStream[MAX_CDCHANNELS]; extern bool flushStream[MAX_CDCHANNELS];
#endif #endif

View file

@ -21,9 +21,9 @@
#define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__) #define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
#define CDTRACE(f, ...) printf("%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]; bool flushStream[MAX_CDCHANNELS];
#endif
struct CdReadInfo struct CdReadInfo
{ {
@ -76,7 +76,7 @@ CdStreamInitThread(void)
gChannelRequestQ.tail = 0; gChannelRequestQ.tail = 0;
gChannelRequestQ.size = gNumChannels + 1; gChannelRequestQ.size = gNumChannels + 1;
ASSERT(gChannelRequestQ.items != nil ); ASSERT(gChannelRequestQ.items != nil );
gCdStreamSema = sem_open("/semaphore_cd_stream", O_CREAT, 0644, 1); gCdStreamSema = sem_open("/semaphore_cd_stream", O_CREAT, 0644, 0);
if (gCdStreamSema == SEM_FAILED) { if (gCdStreamSema == SEM_FAILED) {
@ -91,7 +91,7 @@ CdStreamInitThread(void)
for ( int32 i = 0; i < gNumChannels; i++ ) for ( int32 i = 0; i < gNumChannels; i++ )
{ {
sprintf(semName,"/semaphore_done%d",i); sprintf(semName,"/semaphore_done%d",i);
gpReadInfo[i].pDoneSemaphore = sem_open(semName, O_CREAT, 0644, 1); gpReadInfo[i].pDoneSemaphore = sem_open(semName, O_CREAT, 0644, 0);
if (gpReadInfo[i].pDoneSemaphore == SEM_FAILED) if (gpReadInfo[i].pDoneSemaphore == SEM_FAILED)
{ {
@ -99,9 +99,10 @@ CdStreamInitThread(void)
ASSERT(0); ASSERT(0);
return; return;
} }
#ifdef ONE_THREAD_PER_CHANNEL #ifdef ONE_THREAD_PER_CHANNEL
sprintf(semName,"/semaphore_start%d",i); sprintf(semName,"/semaphore_start%d",i);
gpReadInfo[i].pStartSemaphore = sem_open(semName, O_CREAT, 0644, 1); gpReadInfo[i].pStartSemaphore = sem_open(semName, O_CREAT, 0644, 0);
if (gpReadInfo[i].pStartSemaphore == SEM_FAILED) if (gpReadInfo[i].pStartSemaphore == SEM_FAILED)
{ {
@ -170,6 +171,7 @@ CdStreamInit(int32 numChannels)
gNumImages = 0; gNumImages = 0;
gNumChannels = numChannels; gNumChannels = numChannels;
ASSERT( gNumChannels != 0 );
gpReadInfo = (CdReadInfo *)calloc(numChannels, sizeof(CdReadInfo)); gpReadInfo = (CdReadInfo *)calloc(numChannels, sizeof(CdReadInfo));
ASSERT( gpReadInfo != nil ); ASSERT( gpReadInfo != nil );
@ -245,10 +247,12 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
if ( pChannel->nSectorsToRead != 0 || pChannel->bReading ) { if ( pChannel->nSectorsToRead != 0 || pChannel->bReading ) {
if (pChannel->hFile == hImage - 1 && pChannel->nSectorOffset == _GET_OFFSET(offset) && pChannel->nSectorsToRead >= size) if (pChannel->hFile == hImage - 1 && pChannel->nSectorOffset == _GET_OFFSET(offset) && pChannel->nSectorsToRead >= size)
return STREAM_SUCCESS; return STREAM_SUCCESS;
#ifdef FLUSHABLE_STREAMING
flushStream[channel] = 1; flushStream[channel] = 1;
CdStreamSync(channel); CdStreamSync(channel);
//return STREAM_NONE; #else
return STREAM_NONE;
#endif
} }
pChannel->hFile = hImage - 1; pChannel->hFile = hImage - 1;
@ -316,34 +320,34 @@ CdStreamSync(int32 channel)
CdReadInfo *pChannel = &gpReadInfo[channel]; CdReadInfo *pChannel = &gpReadInfo[channel];
ASSERT( pChannel != nil ); ASSERT( pChannel != nil );
#ifdef FLUSHABLE_STREAMING
if (flushStream[channel]) { if (flushStream[channel]) {
#ifdef ONE_THREAD_PER_CHANNEL
pChannel->nSectorsToRead = 0; pChannel->nSectorsToRead = 0;
#ifdef ONE_THREAD_PER_CHANNEL
pthread_kill(pChannel->pChannelThread, SIGUSR1); pthread_kill(pChannel->pChannelThread, SIGUSR1);
if (pChannel->bReading) { if (pChannel->bReading) {
pChannel->bLocked = true; pChannel->bLocked = true;
while (pChannel->bLocked)
sem_wait(pChannel->pDoneSemaphore);
}
#else #else
pChannel->nSectorsToRead = 0;
if (pChannel->bReading) { if (pChannel->bReading) {
pChannel->bLocked = true; pChannel->bLocked = true;
pthread_kill(_gCdStreamThread, SIGUSR1); pthread_kill(_gCdStreamThread, SIGUSR1);
#endif
while (pChannel->bLocked) while (pChannel->bLocked)
sem_wait(pChannel->pDoneSemaphore); sem_wait(pChannel->pDoneSemaphore);
} }
#endif
pChannel->bReading = false; pChannel->bReading = false;
flushStream[channel] = false; flushStream[channel] = false;
return STREAM_NONE; return STREAM_NONE;
} }
#endif
if ( pChannel->nSectorsToRead != 0 ) if ( pChannel->nSectorsToRead != 0 )
{ {
pChannel->bLocked = true; pChannel->bLocked = true;
while (pChannel->bLocked) while (pChannel->bLocked && pChannel->nSectorsToRead != 0){
sem_wait(pChannel->pDoneSemaphore); sem_wait(pChannel->pDoneSemaphore);
}
pChannel->bLocked = false;
} }
pChannel->bReading = false; pChannel->bReading = false;
@ -395,7 +399,12 @@ void *CdStreamThread(void *param)
#ifndef ONE_THREAD_PER_CHANNEL #ifndef ONE_THREAD_PER_CHANNEL
while (gCdStreamThreadStatus != 2) { while (gCdStreamThreadStatus != 2) {
sem_wait(gCdStreamSema); sem_wait(gCdStreamSema);
int32 channel = GetFirstInQueue(&gChannelRequestQ); int32 channel = GetFirstInQueue(&gChannelRequestQ);
// spurious wakeup
if (channel == -1)
continue;
#else #else
int channel = *((int*)param); int channel = *((int*)param);
while (gpReadInfo[channel].nThreadStatus != 2){ while (gpReadInfo[channel].nThreadStatus != 2){
@ -447,7 +456,7 @@ void *CdStreamThread(void *param)
if ( pChannel->bLocked ) if ( pChannel->bLocked )
{ {
pChannel->bLocked = 0; pChannel->bLocked = 0;
sem_post(pChannel->pDoneSemaphore); sem_post(pChannel->pDoneSemaphore);
} }
pChannel->bReading = false; pChannel->bReading = false;
} }
@ -524,7 +533,9 @@ void
CdStreamRemoveImages(void) CdStreamRemoveImages(void)
{ {
for ( int32 i = 0; i < gNumChannels; i++ ) { for ( int32 i = 0; i < gNumChannels; i++ ) {
#ifdef FLUSHABLE_STREAMING
flushStream[i] = 1; flushStream[i] = 1;
#endif
CdStreamSync(i); CdStreamSync(i);
} }

View file

@ -131,6 +131,9 @@ void CControllerConfigManager::LoadSettings(int32 file)
{ {
bool bValid = true; bool bValid = true;
int nVersion = 0; int nVersion = 0;
#ifdef BIND_VEHICLE_FIREWEAPON
bool skipVehicleFireWeapon = false;
#endif
if (file) if (file)
{ {
@ -148,11 +151,26 @@ void CControllerConfigManager::LoadSettings(int32 file)
if (bValid && nVersion >= 3) if (bValid && nVersion >= 3)
{ {
ControlsManager.MakeControllerActionsBlank(); 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 i = 0; i < MAX_CONTROLLERTYPES; i++)
{ {
for (int32 j = 0; j < MAX_CONTROLLERACTIONS; j++) 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)); 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) void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons)
{ {
#ifdef XINPUT
// No manual bindings for you, honey.
return;
#endif
m_bFirstCapture = true; m_bFirstCapture = true;
uint32 btn = buttons; uint32 btn = buttons;
@ -1765,6 +1788,51 @@ void CControllerConfigManager::DeleteMatching1rstPersonControls(e_ControllerActi
#undef CLEAR_ACTION_IF_NEEDED #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) void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction action, int32 key, eControllerType type)
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
@ -2371,7 +2439,7 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
#define VFB(b) #define VFB(b)
#endif #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 */ \ O, /* PED_FIREWEAPON */ \
R2, /* PED_CYCLE_WEAPON_RIGHT */ \ R2, /* PED_CYCLE_WEAPON_RIGHT */ \
@ -2482,7 +2550,7 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
O, /* PED_SPRINT */ \ O, /* PED_SPRINT */ \
R3, /* PED_LOOKBEHIND */ \ R3, /* PED_LOOKBEHIND */ \
L3, /* PED_DUCK */ \ L3, /* PED_DUCK */ \
L1, /* PED_ANSWER_PHONE */ \ T, /* PED_ANSWER_PHONE */ \
VFB(O) /* VEHICLE_FIREWEAPON */ \ VFB(O) /* VEHICLE_FIREWEAPON */ \
X, /* VEHICLE_ACCELERATE */ \ X, /* VEHICLE_ACCELERATE */ \
Q, /* VEHICLE_BRAKE */ \ Q, /* VEHICLE_BRAKE */ \
@ -2529,10 +2597,10 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
X, /* PED_SPRINT */ \ X, /* PED_SPRINT */ \
R3, /* PED_LOOKBEHIND */ \ R3, /* PED_LOOKBEHIND */ \
L3, /* PED_DUCK */ \ L3, /* PED_DUCK */ \
L1, /* PED_ANSWER_PHONE */ \ O, /* PED_ANSWER_PHONE */ \
VFB(R1) /* VEHICLE_FIREWEAPON */ \ VFB(R1) /* VEHICLE_FIREWEAPON */ \
nil, /* VEHICLE_ACCELERATE */ \ RSU, /* VEHICLE_ACCELERATE */ \
nil, /* VEHICLE_BRAKE */ \ RSD, /* VEHICLE_BRAKE */ \
O, /* VEHICLE_CHANGE_RADIO_STATION */ \ O, /* VEHICLE_CHANGE_RADIO_STATION */ \
L3, /* VEHICLE_HORN */ \ L3, /* VEHICLE_HORN */ \
Q, /* TOGGLE_SUBMISSIONS */ \ Q, /* TOGGLE_SUBMISSIONS */ \
@ -2573,10 +2641,10 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
#define RIGHT "RIGHT" #define RIGHT "RIGHT"
#endif #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 #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 #endif
@ -2585,11 +2653,6 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
#define PS2_CIRCLE "|" #define PS2_CIRCLE "|"
#define PS2_CROSS "/" #define PS2_CROSS "/"
#define PS2_SQUARE "^" #define PS2_SQUARE "^"
#elif defined(BUTTON_ICONS)
#define PS2_TRIANGLE "~T~"
#define PS2_CIRCLE "~O~"
#define PS2_CROSS "~X~"
#define PS2_SQUARE "~Q~"
#else #else
#define PS2_TRIANGLE "TRIANGLE" #define PS2_TRIANGLE "TRIANGLE"
#define PS2_CIRCLE "CIRCLE" #define PS2_CIRCLE "CIRCLE"
@ -2598,11 +2661,11 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
#endif #endif
const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] = 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 #ifdef BUTTON_ICONS
const char *PlayStationButtons[][MAX_CONTROLLERACTIONS] = 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 #endif
#undef PS2_TRIANGLE #undef PS2_TRIANGLE
@ -2624,11 +2687,36 @@ void CControllerConfigManager::GetWideStringOfCommandKeys(uint16 action, wchar *
if (CPad::GetPad(0)->IsAffectedByController) { if (CPad::GetPad(0)->IsAffectedByController) {
wchar wstr[16]; wchar wstr[16];
// TODO: INI and/or menu setting for Xbox/PS switch const char* (*Buttons)[MAX_CONTROLLERACTIONS];
#ifdef BUTTON_ICONS #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 #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 #endif
assert(Buttons[CPad::GetPad(0)->Mode][action] != nil); // we cannot use these assert(Buttons[CPad::GetPad(0)->Mode][action] != nil); // we cannot use these

View file

@ -195,6 +195,10 @@ public:
void DeleteMatching1rstPersonControls (e_ControllerAction action, int32 key, eControllerType type); void DeleteMatching1rstPersonControls (e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatchingActionInitiators (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); bool GetIsKeyBlank(int32 key, eControllerType type);
e_ControllerActionType GetActionType(e_ControllerAction action); e_ControllerActionType GetActionType(e_ControllerAction action);

File diff suppressed because it is too large Load diff

View file

@ -137,6 +137,13 @@ enum eMenuSprites
MENUSPRITE_DOWNON, MENUSPRITE_DOWNON,
MENUSPRITE_UPOFF, MENUSPRITE_UPOFF,
MENUSPRITE_UPON, MENUSPRITE_UPON,
#ifdef GAMEPAD_MENU
MENUSPRITE_CONTROLLER,
MENUSPRITE_ARROWS1,
MENUSPRITE_ARROWS2,
MENUSPRITE_ARROWS3,
MENUSPRITE_ARROWS4,
#endif
NUM_MENU_SPRITES NUM_MENU_SPRITES
}; };
@ -192,8 +199,10 @@ enum eMenuScreen
MENUPAGE_MOUSE_CONTROLS = 31, MENUPAGE_MOUSE_CONTROLS = 31,
MENUPAGE_PAUSE_MENU = 32, MENUPAGE_PAUSE_MENU = 32,
MENUPAGE_NONE = 33, // Then chooses main menu or pause menu MENUPAGE_NONE = 33, // Then chooses main menu or pause menu
#ifdef LEGACY_MENU_OPTIONS #ifdef GAMEPAD_MENU
MENUPAGE_CONTROLLER_SETTINGS, MENUPAGE_CONTROLLER_SETTINGS,
#endif
#ifdef LEGACY_MENU_OPTIONS
MENUPAGE_DEBUG_MENU, MENUPAGE_DEBUG_MENU,
MENUPAGE_CONTROLLER_PC_OLD1, MENUPAGE_CONTROLLER_PC_OLD1,
MENUPAGE_CONTROLLER_PC_OLD2, MENUPAGE_CONTROLLER_PC_OLD2,
@ -206,7 +215,7 @@ enum eMenuScreen
#ifdef GRAPHICS_MENU_OPTIONS #ifdef GRAPHICS_MENU_OPTIONS
MENUPAGE_GRAPHICS_SETTINGS, MENUPAGE_GRAPHICS_SETTINGS,
#endif #endif
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS #ifdef DETECT_JOYSTICK_MENU
MENUPAGE_DETECT_JOYSTICK, MENUPAGE_DETECT_JOYSTICK,
#endif #endif
@ -275,7 +284,7 @@ enum eMenuAction
MENUACTION_DRAWDIST, MENUACTION_DRAWDIST,
MENUACTION_MOUSESENS, MENUACTION_MOUSESENS,
MENUACTION_MP3VOLUMEBOOST, MENUACTION_MP3VOLUMEBOOST,
#ifdef LEGACY_MENU_OPTIONS #ifdef GAMEPAD_MENU
MENUACTION_CTRLVIBRATION, MENUACTION_CTRLVIBRATION,
MENUACTION_CTRLCONFIG, MENUACTION_CTRLCONFIG,
#endif #endif
@ -668,6 +677,18 @@ public:
int8 m_nDisplayMSAALevel; int8 m_nDisplayMSAALevel;
#endif #endif
#ifdef GAMEPAD_MENU
enum
{
CONTROLLER_DUALSHOCK2 = 0,
CONTROLLER_DUALSHOCK3,
CONTROLLER_DUALSHOCK4,
CONTROLLER_XBOX360,
CONTROLLER_XBOXONE,
};
int8 m_PrefsControllerType;
#endif
enum LANGUAGE enum LANGUAGE
{ {
LANGUAGE_AMERICAN, LANGUAGE_AMERICAN,
@ -788,6 +809,10 @@ public:
int8 GetPreviousPageOption(); int8 GetPreviousPageOption();
// uint8 GetNumberOfMenuOptions(); // uint8 GetNumberOfMenuOptions();
#ifdef GAMEPAD_MENU
void LoadController(int8 type);
void PrintController(void);
#endif
}; };
#ifndef IMPROVED_VIDEOMODE #ifndef IMPROVED_VIDEOMODE

View file

@ -384,6 +384,11 @@ bool CGame::Initialise(const char* datFile)
CTxdStore::Create(gameTxdSlot); CTxdStore::Create(gameTxdSlot);
CTxdStore::AddRef(gameTxdSlot); CTxdStore::AddRef(gameTxdSlot);
#ifdef EXTENDED_PIPELINES
// for generic fallback
CustomPipes::SetTxdFindCallback();
#endif
LoadingScreen("Loading the Game", "Loading particles", nil); LoadingScreen("Loading the Game", "Loading particles", nil);
int particleTxdSlot = CTxdStore::AddTxdSlot("particle"); int particleTxdSlot = CTxdStore::AddTxdSlot("particle");
CTxdStore::LoadTxd(particleTxdSlot, "MODELS/PARTICLE.TXD"); CTxdStore::LoadTxd(particleTxdSlot, "MODELS/PARTICLE.TXD");
@ -443,10 +448,7 @@ bool CGame::Initialise(const char* datFile)
// CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); // CFileLoader::LoadLevel("DATA\\DEFAULT.DAT");
CFileLoader::LoadLevel(datFile); CFileLoader::LoadLevel(datFile);
#ifdef EXTENDED_PIPELINES
// for generic fallback
CustomPipes::SetTxdFindCallback();
#endif
LoadingScreen("Loading the Game", "Add Particles", nil); LoadingScreen("Loading the Game", "Add Particles", nil);
CWorld::AddParticles(); CWorld::AddParticles();
CVehicleModelInfo::LoadVehicleColours(); CVehicleModelInfo::LoadVehicleColours();
@ -594,7 +596,6 @@ bool CGame::ShutDown(void)
gPhoneInfo.Shutdown(); gPhoneInfo.Shutdown();
CWeapon::ShutdownWeapons(); CWeapon::ShutdownWeapons();
CPedType::Shutdown(); CPedType::Shutdown();
CMBlur::MotionBlurClose();
for (int32 i = 0; i < NUMPLAYERS; i++) for (int32 i = 0; i < NUMPLAYERS; i++)
{ {
@ -620,7 +621,7 @@ bool CGame::ShutDown(void)
CStreaming::Shutdown(); CStreaming::Shutdown();
CTxdStore::GameShutdown(); CTxdStore::GameShutdown();
CCollision::Shutdown(); CCollision::Shutdown();
CWaterLevel::DestroyWavyAtomic(); CWaterLevel::Shutdown();
CRubbish::Shutdown(); CRubbish::Shutdown();
CClouds::Shutdown(); CClouds::Shutdown();
CShadows::Shutdown(); CShadows::Shutdown();
@ -629,6 +630,7 @@ bool CGame::ShutDown(void)
CWeaponEffects::Shutdown(); CWeaponEffects::Shutdown();
CParticle::Shutdown(); CParticle::Shutdown();
CPools::ShutDown(); CPools::ShutDown();
CHud::ReInitialise();
CTxdStore::RemoveTxdSlot(gameTxdSlot); CTxdStore::RemoveTxdSlot(gameTxdSlot);
CMBlur::MotionBlurClose(); CMBlur::MotionBlurClose();
CdStreamRemoveImages(); CdStreamRemoveImages();

View file

@ -277,13 +277,6 @@ CMenuScreen aScreens[] = {
{ "", 0, 0, }, { "", 0, 0, },
#ifdef LEGACY_MENU_OPTIONS #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 // MENUPAGE_DEBUG_MENU
{ "FED_DBG", MENUPAGE_NONE, 0, { "FED_DBG", MENUPAGE_NONE, 0,
MENUACTION_RELOADIDE, "FED_RID", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0, MENUACTION_RELOADIDE, "FED_RID", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0,

View file

@ -1,4 +1,13 @@
#include "common.h" #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 "platform.h"
#include "crossplatform.h" #include "crossplatform.h"
#include "Renderer.h" #include "Renderer.h"
@ -69,11 +78,17 @@
#endif #endif
#ifdef INVERT_LOOK_FOR_PAD #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 #else
#define INVERT_PAD_SELECTOR #define INVERT_PAD_SELECTOR
#endif #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 *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" }; const char *off_on[] = { "FEM_OFF", "FEM_ON" };
@ -277,11 +292,13 @@ void ScreenModeAfterChange(int8 before, int8 after)
#endif #endif
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS #ifdef DETECT_JOYSTICK_MENU
wchar selectedJoystickUnicode[128]; wchar selectedJoystickUnicode[128];
int cachedButtonNum = -1; int cachedButtonNum = -1;
wchar* DetectJoystickDraw(bool* disabled, bool userHovering) { wchar* DetectJoystickDraw(bool* disabled, bool userHovering) {
#if defined RW_GL3 && !defined LIBRW_SDL2
int numButtons; int numButtons;
int found = -1; int found = -1;
const char *joyname; const char *joyname;
@ -312,6 +329,37 @@ wchar* DetectJoystickDraw(bool* disabled, bool userHovering) {
} }
} }
if (PSGLOBAL(joy1id) == -1) 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); AsciiToUnicode("Not found", selectedJoystickUnicode);
else else
AsciiToUnicode(gSelectedJoystickName, selectedJoystickUnicode); AsciiToUnicode(gSelectedJoystickName, selectedJoystickUnicode);
@ -332,6 +380,14 @@ void DetectJoystickGoBack() {
} }
#endif #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[] = { CMenuScreenCustom aScreens[] = {
// MENUPAGE_STATS = 0 // MENUPAGE_STATS = 0
{ "FEH_STA", MENUPAGE_NONE, nil, nil, { "FEH_STA", MENUPAGE_NONE, nil, nil,
@ -567,11 +623,13 @@ CMenuScreenCustom aScreens[] = {
#else #else
MENUACTION_KEYBOARDCTRLS,"FEC_RED", {nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS}, 320, 150, MENUALIGN_CENTER, MENUACTION_KEYBOARDCTRLS,"FEC_RED", {nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS}, 320, 150, MENUALIGN_CENTER,
#endif #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, MENUACTION_CHANGEMENU, "FEC_JOD", {nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK}, 0, 0, MENUALIGN_CENTER,
#endif #endif
MENUACTION_CHANGEMENU, "FEC_MOU", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_CENTER, 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_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, MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 0, MENUALIGN_CENTER,
}, },
@ -582,7 +640,7 @@ CMenuScreenCustom aScreens[] = {
MENUACTION_LOADRADIO, "FEO_AUD", {nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS}, 0, 0, MENUALIGN_CENTER, 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, MENUACTION_CHANGEMENU, "FEO_DIS", {nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS}, 0, 0, MENUALIGN_CENTER,
#ifdef GRAPHICS_MENU_OPTIONS #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 #endif
MENUACTION_CHANGEMENU, "FEO_LAN", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER, 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, MENUACTION_PLAYERSETUP, "FET_PS", {nil, SAVESLOT_NONE, MENUPAGE_SKIN_SELECT}, 0, 0, MENUALIGN_CENTER,
@ -611,8 +669,12 @@ CMenuScreenCustom aScreens[] = {
{ "FEC_MOU", MENUPAGE_CONTROLLER_PC, nil, nil, { "FEC_MOU", MENUPAGE_CONTROLLER_PC, nil, nil,
MENUACTION_MOUSESENS, "FEC_MSH", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 40, 170, MENUALIGN_LEFT, 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, 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_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 // MENUPAGE_PAUSE_MENU = 32
@ -629,15 +691,17 @@ CMenuScreenCustom aScreens[] = {
// MENUPAGE_NONE = 33 // MENUPAGE_NONE = 33
{ "", 0, nil, nil, }, { "", 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 #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 // MENUPAGE_DEBUG_MENU = 18
{ "FED_DBG", MENUPAGE_NONE, nil, nil, { "FED_DBG", MENUPAGE_NONE, nil, nil,
MENUACTION_RELOADIDE, "FED_RID", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, 0, MENUACTION_RELOADIDE, "FED_RID", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, 0,
@ -692,7 +756,7 @@ CMenuScreenCustom aScreens[] = {
#ifdef GRAPHICS_MENU_OPTIONS #ifdef GRAPHICS_MENU_OPTIONS
// MENUPAGE_GRAPHICS_SETTINGS // 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_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, MENUACTION_WIDESCREEN, "FED_WIS", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, 0, 0, MENUALIGN_LEFT,
@ -715,7 +779,7 @@ CMenuScreenCustom aScreens[] = {
}, },
#endif #endif
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS #ifdef DETECT_JOYSTICK_MENU
// MENUPAGE_DETECT_JOYSTICK // MENUPAGE_DETECT_JOYSTICK
{ "FEC_JOD", MENUPAGE_CONTROLLER_PC, new CCustomScreenLayout({0, 0, 0, false, false, 30}), DetectJoystickGoBack, { "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, MENUACTION_LABEL, "FEC_JPR", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, 0, 0, 0,

View file

@ -1594,8 +1594,14 @@ void CPad::AddToPCCheatString(char c)
} }
#ifdef XINPUT #ifdef XINPUT
int CPad::XInputJoy1 = 0;
int CPad::XInputJoy2 = 1;
void CPad::AffectFromXinput(uint32 pad) void CPad::AffectFromXinput(uint32 pad)
{ {
pad = pad == 0 ? XInputJoy1 : XInputJoy2;
if (pad == -1) // LoadINIControllerSettings can set it to -1
return;
XINPUT_STATE xstate; XINPUT_STATE xstate;
memset(&xstate, 0, sizeof(XINPUT_STATE)); memset(&xstate, 0, sizeof(XINPUT_STATE));
if (XInputGetState(pad, &xstate) == ERROR_SUCCESS) if (XInputGetState(pad, &xstate) == ERROR_SUCCESS)

View file

@ -288,6 +288,8 @@ public:
int16 GetSkipCutscene() { return GetCrossJustDown(); } int16 GetSkipCutscene() { return GetCrossJustDown(); }
#ifdef XINPUT #ifdef XINPUT
static int XInputJoy1;
static int XInputJoy2;
void AffectFromXinput(uint32 pad); void AffectFromXinput(uint32 pad);
#endif #endif

View file

@ -879,7 +879,7 @@ int32 CRadar::GetNewUniqueBlipIndex(int32 i)
uint32 CRadar::GetRadarTraceColour(uint32 color, bool bright) uint32 CRadar::GetRadarTraceColour(uint32 color, bool bright)
{ {
int32 c; uint32 c;
switch (color) { switch (color) {
case RADAR_TRACE_RED: case RADAR_TRACE_RED:
if (bright) if (bright)

View file

@ -167,7 +167,7 @@ CRopes::CreateRopeWithSwatComingDown(CVector pos)
swat->bUsesCollision = false; swat->bUsesCollision = false;
swat->m_pRopeEntity = (CEntity*)1; swat->m_pRopeEntity = (CEntity*)1;
swat->m_nRopeID = 100 + ropeId; 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++; ropeId++;
return true; return true;
} }

View file

@ -214,11 +214,15 @@ CStreaming::Init2(void)
// allocate streaming buffers // allocate streaming buffers
if(ms_streamingBufferSize & 1) ms_streamingBufferSize++; 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_pStreamingBuffer[0] = (int8*)RwMallocAlign(ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE, CDSTREAM_SECTOR_SIZE);
ms_streamingBufferSize /= 2; ms_streamingBufferSize /= 2;
ms_pStreamingBuffer[1] = ms_pStreamingBuffer[0] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE; ms_pStreamingBuffer[1] = ms_pStreamingBuffer[0] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
#ifdef ONE_THREAD_PER_CHANNEL #else
ms_pStreamingBuffer[2] = (int8*)RwMallocAlign(ms_streamingBufferSize*2*CDSTREAM_SECTOR_SIZE, CDSTREAM_SECTOR_SIZE); 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; ms_pStreamingBuffer[3] = ms_pStreamingBuffer[2] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
#endif #endif
debug("Streaming buffer size is %d sectors", ms_streamingBufferSize); debug("Streaming buffer size is %d sectors", ms_streamingBufferSize);
@ -2344,9 +2348,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. // 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 void
CStreaming::LoadAllRequestedModels(bool priority) CStreaming::LoadAllRequestedModels(bool priority)
{ {
@ -2365,14 +2370,18 @@ CStreaming::LoadAllRequestedModels(bool priority)
int streamIds[ARRAY_SIZE(ms_pStreamingBuffer)]; int streamIds[ARRAY_SIZE(ms_pStreamingBuffer)];
int streamSizes[ARRAY_SIZE(ms_pStreamingBuffer)]; int streamSizes[ARRAY_SIZE(ms_pStreamingBuffer)];
int streamPoses[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; int processI = 0;
bool first = true;
// All those "first" checks are because of variables aren't initialized in first pass.
while (true) { while (true) {
// Enumerate files and start reading
for (int i=0; i<ARRAY_SIZE(ms_pStreamingBuffer); i++) { for (int i=0; i<ARRAY_SIZE(ms_pStreamingBuffer); i++) {
// Channel has file to load
if (!first && streamIds[i] != -1) { if (!first && streamIds[i] != -1) {
processI = i;
continue; continue;
} }
@ -2385,12 +2394,16 @@ CStreaming::LoadAllRequestedModels(bool priority)
if (ms_aInfoForModel[streamId].GetCdPosnAndSize(posn, size)) { if (ms_aInfoForModel[streamId].GetCdPosnAndSize(posn, size)) {
streamIds[i] = -1; streamIds[i] = -1;
// Big file, needs 2 buffer
if (size > (uint32)ms_streamingBufferSize) { if (size > (uint32)ms_streamingBufferSize) {
if (i + 1 == ARRAY_SIZE(ms_pStreamingBuffer)) if (i + 1 == ARRAY_SIZE(ms_pStreamingBuffer))
continue; break;
else if (!first && streamIds[i+1] != -1) else if (!first && streamIds[i+1] != -1)
continue; continue;
} else { } 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) if (i != 0 && streamIds[i-1] != -1 && streamSizes[i-1] > (uint32)ms_streamingBufferSize)
continue; continue;
} }
@ -2400,8 +2413,18 @@ CStreaming::LoadAllRequestedModels(bool priority)
streamIds[i] = streamId; streamIds[i] = streamId;
streamSizes[i] = size; streamSizes[i] = size;
streamPoses[i] = posn; 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); 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 { } else {
ms_aInfoForModel[streamId].RemoveFromList(); ms_aInfoForModel[streamId].RemoveFromList();
DecrementRef(streamId); DecrementRef(streamId);
@ -2409,33 +2432,40 @@ CStreaming::LoadAllRequestedModels(bool priority)
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED; ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED;
streamIds[i] = -1; streamIds[i] = -1;
} }
} else } else {
streamIds[i] = -1; streamIds[i] = -1;
break;
}
} }
first = false; first = false;
int nextChannel = readOrder[processI];
// Now process // Now start processing
if (streamIds[processI] == -1) if (nextChannel == -1 || streamIds[nextChannel] == -1)
break; break;
// Try again on error //printf("process: order %d, ch %d, id %d\n", processI, nextChannel, streamIds[nextChannel]);
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]);
if(streamIds[processI] < STREAM_OFFSET_TXD){ // Try again on error
CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(streamIds[processI]); 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()) if(mi->IsSimple())
mi->m_alpha = 255; mi->m_alpha = 255;
} }
streamIds[processI] = -1; streamIds[nextChannel] = -1;
readOrder[processI] = -1;
processI = (processI + 1) % ARRAY_SIZE(readOrder);
} }
ms_bLoadingBigModel = false; ms_bLoadingBigModel = false;
@ -2482,7 +2512,7 @@ CStreaming::LoadAllRequestedModels(bool priority)
status = CdStreamRead(0, ms_pStreamingBuffer[0], imgOffset+posn, size); status = CdStreamRead(0, ms_pStreamingBuffer[0], imgOffset+posn, size);
while(CdStreamSync(0) || status == STREAM_NONE); while(CdStreamSync(0) || status == STREAM_NONE);
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_READING; ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_READING;
MakeSpaceFor(size * CDSTREAM_SECTOR_SIZE); MakeSpaceFor(size * CDSTREAM_SECTOR_SIZE);
ConvertBufferToObject(ms_pStreamingBuffer[0], streamId); ConvertBufferToObject(ms_pStreamingBuffer[0], streamId);
if(ms_aInfoForModel[streamId].m_loadState == STREAMSTATE_STARTED) if(ms_aInfoForModel[streamId].m_loadState == STREAMSTATE_STARTED)
@ -2539,7 +2569,7 @@ CStreaming::FlushRequestList(void)
next = si->m_next; next = si->m_next;
RemoveModel(si - ms_aInfoForModel); RemoveModel(si - ms_aInfoForModel);
} }
#ifndef _WIN32 #ifdef FLUSHABLE_STREAMING
if(ms_channel[0].state == CHANNELSTATE_READING) { if(ms_channel[0].state == CHANNELSTATE_READING) {
flushStream[0] = 1; flushStream[0] = 1;
} }
@ -3295,4 +3325,4 @@ CStreaming::PrintStreamingBufferState()
DoRWStuffEndOfFrame(); DoRWStuffEndOfFrame();
} }
CTimer::Update(); CTimer::Update();
} }

View file

@ -91,7 +91,11 @@ public:
static int32 ms_oldSectorX; static int32 ms_oldSectorX;
static int32 ms_oldSectorY; static int32 ms_oldSectorY;
static int32 ms_streamingBufferSize; static int32 ms_streamingBufferSize;
#ifndef ONE_THREAD_PER_CHANNEL
static int8 *ms_pStreamingBuffer[2]; static int8 *ms_pStreamingBuffer[2];
#else
static int8 *ms_pStreamingBuffer[4];
#endif
static size_t ms_memoryUsed; static size_t ms_memoryUsed;
static CStreamingChannel ms_channel[2]; static CStreamingChannel ms_channel[2];
static int32 ms_channelError; static int32 ms_channelError;

View file

@ -367,7 +367,7 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
} else if(e->bUsesCollision) } else if(e->bUsesCollision)
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(); 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)) ignoreSeeThrough, ignoreShootThrough))
entity = e; entity = e;
if(carTyres && ((CVehicle*)e)->SetUpWheelColModel(&tyreCol) && CCollision::ProcessLineOfSight(line, e->GetMatrix(), tyreCol, tyreColPoint, tyreDist, false, ignoreShootThrough)){ 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(); e->m_scanCode = GetCurrentScanCode();
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(); 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)) ignoreSeeThrough, false, poly))
entity = e; entity = e;
} }
@ -2192,7 +2192,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
PEDPIECE_TORSO, direction); PEDPIECE_TORSO, direction);
if(pPed->m_nPedState != PED_DIE) if(pPed->m_nPedState != PED_DIE)
pPed->SetFall(2000, pPed->SetFall(2000,
(AnimationId)(direction + ANIM_KO_SKID_FRONT), 0); (AnimationId)(direction + ANIM_STD_HIGHIMPACT_FRONT), 0);
if(pCreator && pCreator->IsPed()) { if(pCreator && pCreator->IsPed()) {
eEventType eventType = EVENT_SHOOT_PED; eEventType eventType = EVENT_SHOOT_PED;
if(pPed->m_nPedType == PEDTYPE_COP) eventType = EVENT_SHOOT_COP; if(pPed->m_nPedType == PEDTYPE_COP) eventType = EVENT_SHOOT_COP;

View file

@ -369,7 +369,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
#ifndef MASTER #ifndef MASTER
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) #define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#else #else
#define assert(_Expression) #define assert(_Expression) (_Expression)
#endif #endif
#define ASSERT assert #define ASSERT assert

View file

@ -194,6 +194,10 @@ enum Config {
// those infamous texts // those infamous texts
#define DRAW_GAME_VERSION_TEXT #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 // Memory allocation and compression
// #define USE_CUSTOM_ALLOCATOR // use CMemoryHeap for allocation. use with care, not finished yet // #define USE_CUSTOM_ALLOCATOR // use CMemoryHeap for allocation. use with care, not finished yet
@ -254,6 +258,12 @@ enum Config {
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build #define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
#endif #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 // Just debug menu entries
#ifdef DEBUGMENU #ifdef DEBUGMENU
#define RELOADABLES // some debug menu options to reload TXD files #define RELOADABLES // some debug menu options to reload TXD files
@ -296,8 +306,8 @@ enum Config {
#if !defined(RW_GL3) && defined(_WIN32) #if !defined(RW_GL3) && defined(_WIN32)
#define XINPUT #define XINPUT
#endif #endif
#if !defined(_WIN32) && !defined(__SWITCH__) #if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !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. #define DETECT_JOYSTICK_MENU // Then we'll expect user to enter Controller->Detect joysticks if his joystick isn't detected at the start.
#endif #endif
#define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m #define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m
#define KANGAROO_CHEAT #define KANGAROO_CHEAT
@ -305,19 +315,22 @@ enum Config {
#define BETTER_ALLCARSAREDODO_CHEAT #define BETTER_ALLCARSAREDODO_CHEAT
#define WALLCLIMB_CHEAT #define WALLCLIMB_CHEAT
#define REGISTER_START_BUTTON #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 #define BUTTON_ICONS // use textures to show controller buttons
// Hud, frontend and radar // Hud, frontend and radar
#define PC_MENU #define PC_MENU
#define FIX_RADAR // use radar size from early version before R* broke it #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 #ifndef PC_MENU
# define PS2_MENU # define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS //# define PS2_MENU_USEALLPAGEICONS
#else #else
# define MAP_ENHANCEMENTS // Adding waypoint and better mouse support # define MAP_ENHANCEMENTS // Adding waypoint and better mouse support
# ifdef XINPUT
# define GAMEPAD_MENU // Add gamepad menu
# endif
# define TRIANGLE_BACK_BUTTON # define TRIANGLE_BACK_BUTTON
//# define CIRCLE_BACK_BUTTON //# define CIRCLE_BACK_BUTTON
#define LEGACY_MENU_OPTIONS // i.e. frame sync(vsync) #define LEGACY_MENU_OPTIONS // i.e. frame sync(vsync)
@ -351,6 +364,10 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log #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 #ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define USE_BASIC_SCRIPT_DEBUG_OUTPUT #define USE_BASIC_SCRIPT_DEBUG_OUTPUT
#endif #endif
@ -380,6 +397,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#define FREE_CAM // Rotating cam #define FREE_CAM // Rotating cam
// Audio // Audio
#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 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 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_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder
@ -397,11 +415,12 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#endif #endif
#ifdef LIBRW // Streaming
// these are not supported with librw yet #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 #endif
// IMG #define BIG_IMG // Not complete - allows to read larger img files
#define BIG_IMG // allows to read larger img files
//#define SQUEEZE_PERFORMANCE //#define SQUEEZE_PERFORMANCE
#ifdef SQUEEZE_PERFORMANCE #ifdef SQUEEZE_PERFORMANCE
@ -409,6 +428,8 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#undef NO_ISLAND_LOADING #undef NO_ISLAND_LOADING
#endif #endif
// -------
#if defined __MWERKS__ || defined VANILLA_DEFINES #if defined __MWERKS__ || defined VANILLA_DEFINES
#define FINAL #define FINAL
#undef CHATTYSPLASH #undef CHATTYSPLASH
@ -463,8 +484,10 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#undef BUTTON_ICONS #undef BUTTON_ICONS
#undef FIX_RADAR #undef FIX_RADAR
#undef RADIO_OFF_TEXT
#undef MAP_ENHANCEMENTS #undef MAP_ENHANCEMENTS
#undef GAMEPAD_MENU
#undef MUCH_SHORTER_OUTRO_SCREEN #undef MUCH_SHORTER_OUTRO_SCREEN
#undef CUSTOM_FRONTEND_OPTIONS #undef CUSTOM_FRONTEND_OPTIONS
@ -491,4 +514,6 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#undef IMPROVED_CAMERA #undef IMPROVED_CAMERA
#undef FREE_CAM #undef FREE_CAM
#undef BIG_IMG #undef BIG_IMG
#undef RADIO_SCROLL_TO_PREV_STATION
#endif #endif

View file

@ -1,8 +1,10 @@
#include "common.h" #include "common.h"
#include <time.h>
#include "rpmatfx.h" #include "rpmatfx.h"
#include "rphanim.h" #include "rphanim.h"
#include "rpskin.h" #include "rpskin.h"
#include "rtbmp.h" #include "rtbmp.h"
#include "rtpng.h"
#ifdef ANISOTROPIC_FILTERING #ifdef ANISOTROPIC_FILTERING
#include "rpanisot.h" #include "rpanisot.h"
#endif #endif
@ -73,6 +75,9 @@
#include "custompipes.h" #include "custompipes.h"
#include "screendroplets.h" #include "screendroplets.h"
#include "VarConsole.h" #include "VarConsole.h"
#ifdef USE_OUR_VERSIONING
#include "GitSHA1.h"
#endif
GlobalScene Scene; GlobalScene Scene;
@ -97,6 +102,9 @@ bool gbModelViewer;
#ifdef TIMEBARS #ifdef TIMEBARS
bool gbShowTimebars; bool gbShowTimebars;
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT
bool gDrawVersionText; // Our addition, we think it was always enabled on !MASTER builds
#endif
volatile int32 frameCount; volatile int32 frameCount;
@ -339,7 +347,11 @@ RwGrabScreen(RwCamera *camera, RwChar *filename)
strcpy(temp, CFileMgr::GetRootDirName()); strcpy(temp, CFileMgr::GetRootDirName());
strcat(temp, filename); strcat(temp, filename);
#ifndef LIBRW
if (RtBMPImageWrite(pImage, &temp[0]) == nil) if (RtBMPImageWrite(pImage, &temp[0]) == nil)
#else
if (RtPNGImageWrite(pImage, &temp[0]) == nil)
#endif
result = false; result = false;
RwImageDestroy(pImage); RwImageDestroy(pImage);
return result; return result;
@ -358,6 +370,7 @@ DoRWStuffEndOfFrame(void)
RsCameraShowRaster(Scene.camera); RsCameraShowRaster(Scene.camera);
#ifndef MASTER #ifndef MASTER
char s[48]; char s[48];
#ifdef THIS_IS_STUPID
if (CPad::GetPad(1)->GetLeftShockJustDown()) { if (CPad::GetPad(1)->GetLeftShockJustDown()) {
// try using both controllers for this thing... crazy bastards // try using both controllers for this thing... crazy bastards
if (CPad::GetPad(0)->GetRightStickY() > 0) { if (CPad::GetPad(0)->GetRightStickY() > 0) {
@ -369,6 +382,12 @@ DoRWStuffEndOfFrame(void)
RwGrabScreen(Scene.camera, s); 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 #endif // !MASTER
} }
@ -1048,7 +1067,7 @@ DisplayGameDebugText()
#ifndef FINAL #ifndef FINAL
{ {
SETTWEAKPATH("GameDebugText"); SETTWEAKPATH("Debug");
TWEAKBOOL(bDisplayPosn); TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayCheatStr); TWEAKBOOL(bDisplayCheatStr);
} }
@ -1062,13 +1081,56 @@ DisplayGameDebugText()
#ifdef DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT
wchar ver[200]; wchar ver[200];
if(gDrawVersionText) // This realtime switch is our thing
{
#ifdef USE_OUR_VERSIONING
char verA[200];
sprintf(verA,
#if defined _WIN32
"Win "
#elif defined __linux__
"Linux "
#elif defined __APPLE__
"Mac OS X "
#elif defined __FreeBSD__
"FreeBSD "
#else
"Posix-compliant "
#endif
#if defined __LP64__ || defined _WIN64
"64-bit "
#else
"32-bit "
#endif
#if defined RW_D3D9
"D3D9 "
#elif defined RWLIBS
"D3D8 "
#elif defined RW_GL3
"OpenGL "
#endif
#if defined AUDIO_OAL
"OAL "
#elif defined AUDIO_MSS
"MSS "
#endif
#if defined _DEBUG || defined DEBUG
"DEBUG "
#endif
"%.8s",
g_GIT_SHA1);
AsciiToUnicode(verA, ver);
CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.7f));
#else
AsciiToUnicode(version_name, ver); AsciiToUnicode(version_name, ver);
CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f));
#endif
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetFontStyle(FONT_STANDARD); CFont::SetFontStyle(FONT_STANDARD);
CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f));
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::SetWrapx(SCREEN_WIDTH); CFont::SetWrapx(SCREEN_WIDTH);
@ -1076,11 +1138,17 @@ DisplayGameDebugText()
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetColor(CRGBA(255, 108, 0, 255)); CFont::SetColor(CRGBA(255, 108, 0, 255));
CFont::PrintString(SCREEN_SCALE_X(10.0f), SCREEN_SCALE_Y(10.0f), ver); CFont::PrintString(SCREEN_SCALE_X(10.0f), SCREEN_SCALE_Y(10.0f), ver);
#endif }
#endif // #ifdef DRAW_GAME_VERSION_TEXT
FrameSamples++; FrameSamples++;
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
FramesPerSecondCounter += frameTime / 1000.f; // convert to seconds
FramesPerSecond = FrameSamples / FramesPerSecondCounter;
#else
FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f); FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f);
FramesPerSecond = FramesPerSecondCounter / FrameSamples; FramesPerSecond = FramesPerSecondCounter / FrameSamples;
#endif
if ( FrameSamples > 30 ) if ( FrameSamples > 30 )
{ {

View file

@ -1,6 +1,14 @@
#include <csignal> #include <csignal>
#define WITHWINDOWS #define WITHWINDOWS
#include "common.h" #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 "Renderer.h"
#include "Occlusion.h" #include "Occlusion.h"
#include "Credits.h" #include "Credits.h"
@ -37,7 +45,7 @@
#include "MBlur.h" #include "MBlur.h"
#include "ControllerConfig.h" #include "ControllerConfig.h"
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS #ifdef DETECT_JOYSTICK_MENU
#include "crossplatform.h" #include "crossplatform.h"
#endif #endif
@ -249,8 +257,40 @@ const char *iniKeyboardButtons[] = {"ESC","F1","F2","F3","F4","F5","F6","F7","F8
void LoadINIControllerSettings() 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); ReadIniIfExists("Controller", "JoystickName", gSelectedJoystickName, 128);
#endif
#endif #endif
// force to default GTA behaviour (never overwrite bindings on joy change/initialization) if user init'ed/set bindings before we introduced that // 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)) { if (!ReadIniIfExists("Controller", "PadButtonsInited", &ControlsManager.ms_padButtonsInited)) {
@ -348,8 +388,12 @@ void SaveINIControllerSettings()
StoreIni("Bindings", iniControllerActions[i], value, 128); 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); StoreIni("Controller", "JoystickName", gSelectedJoystickName, 128);
#endif
#endif #endif
StoreIni("Controller", "PadButtonsInited", ControlsManager.ms_padButtonsInited); StoreIni("Controller", "PadButtonsInited", ControlsManager.ms_padButtonsInited);
cfg.write_file("reLCS.ini"); cfg.write_file("reLCS.ini");
@ -373,6 +417,7 @@ bool LoadINISettings()
ReadIniIfExists("Controller", "HorizantalMouseSens", &TheCamera.m_fMouseAccelHorzntl); ReadIniIfExists("Controller", "HorizantalMouseSens", &TheCamera.m_fMouseAccelHorzntl);
ReadIniIfExists("Controller", "InvertMouseVertically", &MousePointerStateHelper.bInvertVertically); ReadIniIfExists("Controller", "InvertMouseVertically", &MousePointerStateHelper.bInvertVertically);
ReadIniIfExists("Controller", "DisableMouseSteering", &CVehicle::m_bDisableMouseSteering); ReadIniIfExists("Controller", "DisableMouseSteering", &CVehicle::m_bDisableMouseSteering);
ReadIniIfExists("Controller", "Vibration", &FrontEndMenuManager.m_PrefsUseVibration);
ReadIniIfExists("Audio", "SfxVolume", &FrontEndMenuManager.m_PrefsSfxVolume); ReadIniIfExists("Audio", "SfxVolume", &FrontEndMenuManager.m_PrefsSfxVolume);
ReadIniIfExists("Audio", "MusicVolume", &FrontEndMenuManager.m_PrefsMusicVolume); ReadIniIfExists("Audio", "MusicVolume", &FrontEndMenuManager.m_PrefsMusicVolume);
ReadIniIfExists("Audio", "MP3BoostVolume", &FrontEndMenuManager.m_PrefsMP3BoostVolume); ReadIniIfExists("Audio", "MP3BoostVolume", &FrontEndMenuManager.m_PrefsMP3BoostVolume);
@ -406,6 +451,10 @@ bool LoadINISettings()
ReadIniIfExists("CustomPipesValues", "LightmapMult", &CustomPipes::LightmapMult); ReadIniIfExists("CustomPipesValues", "LightmapMult", &CustomPipes::LightmapMult);
ReadIniIfExists("CustomPipesValues", "GlossMult", &CustomPipes::GlossMult); ReadIniIfExists("CustomPipesValues", "GlossMult", &CustomPipes::GlossMult);
#endif #endif
ReadIniIfExists("Rendering", "BackfaceCulling", &gBackfaceCulling);
#ifdef NEW_RENDERER
ReadIniIfExists("Rendering", "NewRenderer", &gbNewRenderer);
#endif
#ifdef PROPER_SCALING #ifdef PROPER_SCALING
ReadIniIfExists("Draw", "ProperScaling", &CDraw::ms_bProperScaling); ReadIniIfExists("Draw", "ProperScaling", &CDraw::ms_bProperScaling);
@ -416,6 +465,10 @@ bool LoadINISettings()
#ifdef FIX_SPRITES #ifdef FIX_SPRITES
ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites); ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites);
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT
extern bool gDrawVersionText;
ReadIniIfExists("General", "DrawVersionText", &gDrawVersionText);
#endif
#ifdef CUSTOM_FRONTEND_OPTIONS #ifdef CUSTOM_FRONTEND_OPTIONS
bool migrate = cfg.category_size("FrontendOptions") != 0; bool migrate = cfg.category_size("FrontendOptions") != 0;
@ -461,6 +514,7 @@ void SaveINISettings()
StoreIni("Controller", "HorizantalMouseSens", TheCamera.m_fMouseAccelHorzntl); StoreIni("Controller", "HorizantalMouseSens", TheCamera.m_fMouseAccelHorzntl);
StoreIni("Controller", "InvertMouseVertically", MousePointerStateHelper.bInvertVertically); StoreIni("Controller", "InvertMouseVertically", MousePointerStateHelper.bInvertVertically);
StoreIni("Controller", "DisableMouseSteering", CVehicle::m_bDisableMouseSteering); StoreIni("Controller", "DisableMouseSteering", CVehicle::m_bDisableMouseSteering);
StoreIni("Controller", "Vibration", FrontEndMenuManager.m_PrefsUseVibration);
StoreIni("Audio", "SfxVolume", FrontEndMenuManager.m_PrefsSfxVolume); StoreIni("Audio", "SfxVolume", FrontEndMenuManager.m_PrefsSfxVolume);
StoreIni("Audio", "MusicVolume", FrontEndMenuManager.m_PrefsMusicVolume); StoreIni("Audio", "MusicVolume", FrontEndMenuManager.m_PrefsMusicVolume);
StoreIni("Audio", "MP3BoostVolume", FrontEndMenuManager.m_PrefsMP3BoostVolume); StoreIni("Audio", "MP3BoostVolume", FrontEndMenuManager.m_PrefsMP3BoostVolume);
@ -495,6 +549,9 @@ void SaveINISettings()
StoreIni("CustomPipesValues", "GlossMult", CustomPipes::GlossMult); StoreIni("CustomPipesValues", "GlossMult", CustomPipes::GlossMult);
#endif #endif
StoreIni("Rendering", "BackfaceCulling", gBackfaceCulling); StoreIni("Rendering", "BackfaceCulling", gBackfaceCulling);
#ifdef NEW_RENDERER
StoreIni("Rendering", "NewRenderer", gbNewRenderer);
#endif
#ifdef PROPER_SCALING #ifdef PROPER_SCALING
StoreIni("Draw", "ProperScaling", CDraw::ms_bProperScaling); StoreIni("Draw", "ProperScaling", CDraw::ms_bProperScaling);
@ -505,6 +562,10 @@ void SaveINISettings()
#ifdef FIX_SPRITES #ifdef FIX_SPRITES
StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites); StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites);
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT
extern bool gDrawVersionText;
StoreIni("General", "DrawVersionText", gDrawVersionText);
#endif
#ifdef CUSTOM_FRONTEND_OPTIONS #ifdef CUSTOM_FRONTEND_OPTIONS
for (int i = 0; i < MENUPAGES; i++) { for (int i = 0; i < MENUPAGES; i++) {
for (int j = 0; j < NUM_MENUROWS; j++) { for (int j = 0; j < NUM_MENUROWS; j++) {
@ -632,18 +693,6 @@ SwitchCarCollision(void)
FindPlayerVehicle()->bUsesCollision = !FindPlayerVehicle()->bUsesCollision; 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 static void
ToggleComedy(void) ToggleComedy(void)
{ {
@ -859,13 +908,22 @@ DebugMenuPopulate(void)
DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil); DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil);
DebugMenuAddVar("Render", "Brightness", &FrontEndMenuManager.m_PrefsBrightness, nil, 16, 0, 700, 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", "Backface Culling", &gBackfaceCulling, nil);
DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil); DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil);
DebugMenuAddVarBool8("Render", "Frame limiter", &FrontEndMenuManager.m_PrefsFrameLimiter, nil); DebugMenuAddVarBool8("Render", "Frame limiter", &FrontEndMenuManager.m_PrefsFrameLimiter, nil);
DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil); DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil);
DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil); DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil);
#ifdef NEW_RENDERER #ifdef NEW_RENDERER
DebugMenuAddVarBool8("Render", "new renderer", &gbNewRenderer, nil); DebugMenuAddVarBool8("Render", "New Renderer", &gbNewRenderer, nil);
extern bool gbRenderRoads; extern bool gbRenderRoads;
extern bool gbRenderEverythingBarRoads; extern bool gbRenderEverythingBarRoads;
extern bool gbRenderFadingInUnderwaterEntities; extern bool gbRenderFadingInUnderwaterEntities;
@ -876,16 +934,16 @@ extern bool gbRenderVehicles;
extern bool gbRenderWorld0; extern bool gbRenderWorld0;
extern bool gbRenderWorld1; extern bool gbRenderWorld1;
extern bool gbRenderWorld2; extern bool gbRenderWorld2;
DebugMenuAddVarBool8("Render", "gbRenderRoads", &gbRenderRoads, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderRoads", &gbRenderRoads, nil);
DebugMenuAddVarBool8("Render", "gbRenderEverythingBarRoads", &gbRenderEverythingBarRoads, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderEverythingBarRoads", &gbRenderEverythingBarRoads, nil);
DebugMenuAddVarBool8("Render", "gbRenderFadingInUnderwaterEntities", &gbRenderFadingInUnderwaterEntities, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInUnderwaterEntities", &gbRenderFadingInUnderwaterEntities, nil);
DebugMenuAddVarBool8("Render", "gbRenderFadingInEntities", &gbRenderFadingInEntities, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInEntities", &gbRenderFadingInEntities, nil);
DebugMenuAddVarBool8("Render", "gbRenderWater", &gbRenderWater, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderWater", &gbRenderWater, nil);
DebugMenuAddVarBool8("Render", "gbRenderBoats", &gbRenderBoats, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderBoats", &gbRenderBoats, nil);
DebugMenuAddVarBool8("Render", "gbRenderVehicles", &gbRenderVehicles, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderVehicles", &gbRenderVehicles, nil);
DebugMenuAddVarBool8("Render", "gbRenderWorld0", &gbRenderWorld0, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderWorld0", &gbRenderWorld0, nil);
DebugMenuAddVarBool8("Render", "gbRenderWorld1", &gbRenderWorld1, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderWorld1", &gbRenderWorld1, nil);
DebugMenuAddVarBool8("Render", "gbRenderWorld2", &gbRenderWorld2, nil); DebugMenuAddVarBool8("Debug Render", "gbRenderWorld2", &gbRenderWorld2, nil);
#endif #endif
#ifdef EXTENDED_COLOURFILTER #ifdef EXTENDED_COLOURFILTER
@ -921,28 +979,27 @@ extern bool gbRenderDebugEnvMap;
// DebugMenuAddVarBool8("Render", "Neo Road Gloss enable", &CustomPipes::GlossEnable, nil); // DebugMenuAddVarBool8("Render", "Neo Road Gloss enable", &CustomPipes::GlossEnable, nil);
// DebugMenuAddVar("Render", "Mult", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f); // DebugMenuAddVar("Render", "Mult", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f);
#endif #endif
DebugMenuAddVarBool8("Render", "Show Ped Paths", &gbShowPedPaths, nil); DebugMenuAddVarBool8("Debug Render", "Show Ped Paths", &gbShowPedPaths, nil);
DebugMenuAddVarBool8("Render", "Show Car Paths", &gbShowCarPaths, nil); DebugMenuAddVarBool8("Debug Render", "Show Car Paths", &gbShowCarPaths, nil);
DebugMenuAddVarBool8("Render", "Show Car Path Links", &gbShowCarPathsLinks, nil); DebugMenuAddVarBool8("Debug Render", "Show Car Path Links", &gbShowCarPathsLinks, nil);
DebugMenuAddVarBool8("Render", "Show Collision Lines", &gbShowCollisionLines, nil); DebugMenuAddVarBool8("Debug Render", "Show Collision Lines", &gbShowCollisionLines, nil);
DebugMenuAddVarBool8("Render", "Show Collision Polys", &gbShowCollisionPolys, nil); DebugMenuAddVarBool8("Debug Render", "Show Collision Polys", &gbShowCollisionPolys, nil);
DebugMenuAddVarBool8("Render", "Don't render Buildings", &gbDontRenderBuildings, nil); DebugMenuAddVarBool8("Debug Render", "Don't render Buildings", &gbDontRenderBuildings, nil);
DebugMenuAddVarBool8("Render", "Don't render Big Buildings", &gbDontRenderBigBuildings, nil); DebugMenuAddVarBool8("Debug Render", "Don't render Big Buildings", &gbDontRenderBigBuildings, nil);
DebugMenuAddVarBool8("Render", "Don't render Peds", &gbDontRenderPeds, nil); DebugMenuAddVarBool8("Debug Render", "Don't render Peds", &gbDontRenderPeds, nil);
DebugMenuAddVarBool8("Render", "Don't render Vehicles", &gbDontRenderVehicles, nil); DebugMenuAddVarBool8("Debug Render", "Don't render Vehicles", &gbDontRenderVehicles, nil);
DebugMenuAddVarBool8("Render", "Don't render Objects", &gbDontRenderObjects, nil); DebugMenuAddVarBool8("Debug Render", "Don't render Objects", &gbDontRenderObjects, nil);
DebugMenuAddVarBool8("Render", "Don't Render Water", &gbDontRenderWater, 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
extern bool gDrawVersionText;
DebugMenuAddVarBool8("Debug", "Version Text", &gDrawVersionText, nil);
#endif #endif
#ifdef FIX_RADAR DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil);
DebugMenuAddVarBool8("Draw", "Fix Radar", &CDraw::ms_bFixRadar, nil); #ifdef TIMEBARS
DebugMenuAddVarBool8("Debug", "Show Timebars", &gbShowTimebars, nil);
#endif #endif
#ifdef FIX_SPRITES
DebugMenuAddVarBool8("Draw", "Fix Sprites", &CDraw::ms_bFixSprites, nil);
#endif
#ifndef FINAL #ifndef FINAL
DebugMenuAddVarBool8("Debug", "Print Memory Usage", &gbPrintMemoryUsage, nil); DebugMenuAddVarBool8("Debug", "Print Memory Usage", &gbPrintMemoryUsage, nil);
#ifdef USE_CUSTOM_ALLOCATOR #ifdef USE_CUSTOM_ALLOCATOR
@ -954,28 +1011,23 @@ extern bool gbRenderDebugEnvMap;
#ifdef GTA_SCENE_EDIT #ifdef GTA_SCENE_EDIT
DebugMenuAddVarBool8("Debug", "Edit on", &CSceneEdit::m_bEditOn, nil); DebugMenuAddVarBool8("Debug", "Edit on", &CSceneEdit::m_bEditOn, nil);
#endif #endif
#ifdef MAP_ENHANCEMENTS //DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
DebugMenuAddCmd("Debug", "Teleport to map waypoint", TeleportToWaypoint); //DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
#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);
#ifdef RELOADABLES #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 #endif
DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil);
#ifdef TIMEBARS #ifdef MAP_ENHANCEMENTS
DebugMenuAddVarBool8("Debug", "Show Timebars", &gbShowTimebars, nil); DebugMenuAddCmd("Game", "Teleport to map waypoint", TeleportToWaypoint);
#endif #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 #ifdef MISSION_SWITCHER
DebugMenuEntry *missionEntry; DebugMenuEntry *missionEntry;
static const char* missions[] = { static const char* missions[] = {
@ -1005,9 +1057,9 @@ extern bool gbRenderDebugEnvMap;
"A Date with Death (Toshiko Kasen)", "Cash in Kazuki's Chips (Toshiko Kasen)" "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); DebugMenuEntrySetWrap(missionEntry, true);
DebugMenuAddCmd("Debug", "Start selected mission ", SwitchToMission); DebugMenuAddCmd("Game", "Start selected mission ", SwitchToMission);
#endif #endif
extern bool PrintDebugCode; extern bool PrintDebugCode;
extern int16 DebugCamMode; extern int16 DebugCamMode;

View file

@ -0,0 +1,2 @@
#define GIT_SHA1 "@GIT_SHA1@"
const char* g_GIT_SHA1 = GIT_SHA1;

1
src/extras/GitSHA1.h Normal file
View file

@ -0,0 +1 @@
extern const char* g_GIT_SHA1;

View file

@ -1,7 +0,0 @@
@echo off
for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f
for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f
"%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /DENVMAP /Fo obj\leedsDefault_ENV_VS.cso leedsDefault_VS_x.hlsl
"%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /DPASS_ADD /Fo obj\leedsDefault_ADD_PS.cso leedsDefault_PS_x.hlsl
"%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /DPASS_BLEND /Fo obj\leedsDefault_BLEND_PS.cso leedsDefault_PS_x.hlsl

View file

@ -950,6 +950,43 @@ RtBMPImageRead(const RwChar *imageName)
#endif #endif
} }
RwImage *
RtPNGImageWrite(RwImage *image, const RwChar *imageName)
{
#ifndef _WIN32
char *r = casepath(imageName);
if (r) {
rw::writePNG(image, r);
free(r);
} else {
rw::writePNG(image, imageName);
}
#else
rw::writePNG(image, imageName);
#endif
return image;
}
RwImage *
RtPNGImageRead(const RwChar *imageName)
{
#ifndef _WIN32
RwImage *image;
char *r = casepath(imageName);
if (r) {
image = rw::readPNG(r);
free(r);
} else {
image = rw::readPNG(imageName);
}
return image;
#else
return rw::readPNG(imageName);
#endif
}
#include "rtquat.h" #include "rtquat.h"
RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return (RtQuat*)((rw::Quat*)quat)->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); } RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return (RtQuat*)((rw::Quat*)quat)->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); }

4
src/fakerw/rtpng.h Normal file
View file

@ -0,0 +1,4 @@
#pragma once
RwImage *RtPNGImageWrite(RwImage * image, const RwChar * imageName);
RwImage *RtPNGImageRead(const RwChar * imageName);

View file

@ -87,10 +87,10 @@ void
CStinger::Deploy(CPed *pPed) CStinger::Deploy(CPed *pPed)
{ {
if (NumOfStingerSegments < NUM_STINGER_SEGMENTS*2 && !pPed->bInVehicle && pPed->IsPedInControl()) { if (NumOfStingerSegments < NUM_STINGER_SEGMENTS*2 && !pPed->bInVehicle && pPed->IsPedInControl()) {
if (!bIsDeployed && RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_WEAPON_THROWU) == nil) { if (!bIsDeployed && RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_THROW_UNDER) == nil) {
Init(pPed); Init(pPed);
pPed->SetPedState(PED_DEPLOY_STINGER); pPed->SetPedState(PED_DEPLOY_STINGER);
CAnimManager::AddAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_WEAPON_THROWU); CAnimManager::AddAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_THROW_UNDER);
} }
} }
} }
@ -170,7 +170,7 @@ CStinger::Process()
if (pOwner != nil if (pOwner != nil
&& !pOwner->bInVehicle && !pOwner->bInVehicle
&& pOwner->GetPedState() == PED_DEPLOY_STINGER && pOwner->GetPedState() == PED_DEPLOY_STINGER
&& RpAnimBlendClumpGetAssociation(pOwner->GetClump(), ANIM_WEAPON_THROWU)->currentTime > 0.39f) && RpAnimBlendClumpGetAssociation(pOwner->GetClump(), ANIM_STD_THROW_UNDER)->currentTime > 0.39f)
{ {
m_nSpikeState = STINGERSTATE_DEPLOYING; m_nSpikeState = STINGERSTATE_DEPLOYING;
for (int i = 0; i < NUM_STINGER_SEGMENTS; i++) for (int i = 0; i < NUM_STINGER_SEGMENTS; i++)

View file

@ -257,9 +257,9 @@ CCopPed::ArrestPlayer(void)
if (suspect && (suspect->m_nPedState == PED_ARRESTED || suspect->DyingOrDead() || suspect->EnteringCar())) { if (suspect && (suspect->m_nPedState == PED_ARRESTED || suspect->DyingOrDead() || suspect->EnteringCar())) {
CAnimBlendAssociation *arrestAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ARREST_GUN); CAnimBlendAssociation *arrestAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ARREST);
if (!arrestAssoc || arrestAssoc->blendDelta < 0.0f) if (!arrestAssoc || arrestAssoc->blendDelta < 0.0f)
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ARREST_GUN, 4.0f); CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_ARREST, 4.0f);
CVector suspMidPos; CVector suspMidPos;
suspect->m_pedIK.GetComponentPosition(suspMidPos, PED_MID); suspect->m_pedIK.GetComponentPosition(suspMidPos, PED_MID);

View file

@ -310,7 +310,7 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL; m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL;
} else { } else {
m_nEmergencyPedState = EMERGENCY_PED_FACE_TO_PATIENT; m_nEmergencyPedState = EMERGENCY_PED_FACE_TO_PATIENT;
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_MEDIC, ANIM_CPR, 4.0f); m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_MEDIC, ANIM_MEDIC_CPR, 4.0f);
bIsDucking = true; bIsDucking = true;
} }
SetLookTimer(2000); SetLookTimer(2000);

File diff suppressed because it is too large Load diff

View file

@ -696,7 +696,7 @@ public:
uint32 m_threatFlags; uint32 m_threatFlags;
uint32 m_threatCheckTimer; uint32 m_threatCheckTimer;
uint32 m_threatCheckInterval; uint32 m_threatCheckInterval;
uint32 m_delayedSoundID; int32 m_delayedSoundID;
uint32 m_delayedSoundTimer; uint32 m_delayedSoundTimer;
uint32 m_lastSoundStart; uint32 m_lastSoundStart;
uint32 m_soundStart; uint32 m_soundStart;
@ -737,7 +737,7 @@ public:
void SetLookFlag(CEntity* target, bool keepTryingToLook, bool cancelPrevious = false); void SetLookFlag(CEntity* target, bool keepTryingToLook, bool cancelPrevious = false);
void SetLookFlag(float direction, bool keepTryingToLook, bool cancelPrevious = false); void SetLookFlag(float direction, bool keepTryingToLook, bool cancelPrevious = false);
void SetLookTimer(int time); void SetLookTimer(int time);
void SetDie(AnimationId anim = ANIM_KO_SHOT_FRONT1, float arg1 = 4.0f, float arg2 = 0.0f); void SetDie(AnimationId anim = ANIM_STD_KO_FRONT, float arg1 = 4.0f, float arg2 = 0.0f);
void SetDead(void); void SetDead(void);
void ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer); void ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer);
void RemoveBodyPart(PedNode nodeId, int8 direction); void RemoveBodyPart(PedNode nodeId, int8 direction);
@ -1092,39 +1092,39 @@ public:
static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) { static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) {
if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND)) if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND))
return ANIM_WEAPON_CROUCHFIRE; return ANIM_ATTACK_2;
else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD)) else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))
return ANIM_WEAPON_FIRE_3RD; return ANIM_WEAPON_FIRE_3RD;
else if (kickFloorIfNone) else if (kickFloorIfNone)
return ANIM_KICK_FLOOR; return ANIM_STD_KICKGROUND;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetPrimaryFireAnim(CWeaponInfo* weapon) { static AnimationId GetPrimaryFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE)) if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE))
return ANIM_BOMBER; return ANIM_STD_DETONATE;
else else
return ANIM_WEAPON_FIRE; return ANIM_ATTACK_1;
} }
static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) { static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD)) if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
return ANIM_WEAPON_CROUCHRELOAD; return ANIM_ATTACK_EXTRA2;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) { static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE))
return ANIM_WEAPON_CROUCHFIRE; return ANIM_ATTACK_2;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetReloadAnim(CWeaponInfo* weapon) { static AnimationId GetReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD)) if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
return ANIM_WEAPON_RELOAD; return ANIM_ATTACK_EXTRA1;
else else
return (AnimationId)0; return (AnimationId)0;
} }
@ -1145,7 +1145,7 @@ public:
static AnimationId GetSecondFireAnim(CWeaponInfo* weapon) { static AnimationId GetSecondFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_USE_2ND)) if (weapon->IsFlagSet(WEAPONFLAG_USE_2ND))
return ANIM_WEAPON_FIRE_2ND; // or ANIM_MELEE_ATTACK_2ND return ANIM_WEAPON_FIRE_2ND;
else else
return (AnimationId)0; return (AnimationId)0;
} }

File diff suppressed because it is too large Load diff

View file

@ -113,7 +113,11 @@ const C2dEffect* CPedAttractorManager::GetEffectForIceCreamVan(CVehicle* pVehicl
CVehicleToEffect effect(pVehicle); CVehicleToEffect effect(pVehicle);
vVehicleToEffect.push_back(effect); vVehicleToEffect.push_back(effect);
POP_MEMID(); POP_MEMID();
#ifdef FIX_BUGS
return vVehicleToEffect.back().ChooseEffect(pos);
#else
return effect.ChooseEffect(pos); return effect.ChooseEffect(pos);
#endif
} }
CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect) CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect)
@ -658,12 +662,12 @@ CPedAttractor* CPedAttractorManager::RegisterPed(CPed* pPed, C2dEffect* pEffect,
} }
PUSH_MEMID(MEMID_PED_ATTR); PUSH_MEMID(MEMID_PED_ATTR);
switch (pEffect->pedattr.type) { switch (pEffect->pedattr.type) {
case ATTRACTOR_ATM: vecAttractors.push_back(new CPedAtmAttractor(pEffect, matrix, gcMaxSizeOfAtmQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.15f, 0.1f, 0.1f)); break; case ATTRACTOR_ATM: pRegisteredAttractor = new CPedAtmAttractor(pEffect, matrix, gcMaxSizeOfAtmQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.15f, 0.1f, 0.1f); vecAttractors.push_back(pRegisteredAttractor); break;
case ATTRACTOR_SEAT: vecAttractors.push_back(new CPedSeatAttractor(pEffect, matrix, gcMaxSizeOfSeatQueue, 1.0f, 30000.0f, 3000.0f, 0.125f, 0.1f, 0.1f, 0.1f)); break; case ATTRACTOR_SEAT: pRegisteredAttractor = new CPedSeatAttractor(pEffect, matrix, gcMaxSizeOfSeatQueue, 1.0f, 30000.0f, 3000.0f, 0.125f, 0.1f, 0.1f, 0.1f); vecAttractors.push_back(pRegisteredAttractor); break;
case ATTRACTOR_STOP: vecAttractors.push_back(new CPedStopAttractor(pEffect, matrix, gcMaxSizeOfStopQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.1f, 0.1f, 0.1f)); break; case ATTRACTOR_STOP: pRegisteredAttractor = new CPedStopAttractor(pEffect, matrix, gcMaxSizeOfStopQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.1f, 0.1f, 0.1f); vecAttractors.push_back(pRegisteredAttractor); break;
case ATTRACTOR_PIZZA: vecAttractors.push_back(new CPedPizzaAttractor(pEffect, matrix, gcMaxSizeOfPizzaQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.1f, 0.1f, 0.1f)); break; case ATTRACTOR_PIZZA: pRegisteredAttractor = new CPedPizzaAttractor(pEffect, matrix, gcMaxSizeOfPizzaQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.1f, 0.1f, 0.1f); vecAttractors.push_back(pRegisteredAttractor); break;
case ATTRACTOR_SHELTER: vecAttractors.push_back(new CPedShelterAttractor(pEffect, matrix, gcMaxSizeOfShelterQueue, 1.0f, 30000.0f, 3000.0f, 0.5f, 6.28f, 0.1f, 0.1f)); break; case ATTRACTOR_SHELTER: pRegisteredAttractor = new CPedShelterAttractor(pEffect, matrix, gcMaxSizeOfShelterQueue, 1.0f, 30000.0f, 3000.0f, 0.5f, 6.28f, 0.1f, 0.1f); vecAttractors.push_back(pRegisteredAttractor); break;
case ATTRACTOR_ICECREAM: vecAttractors.push_back(new CPedIceCreamAttractor(pEffect, matrix, gcMaxSizeOfIceCreamQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.3f, 0.1f, 0.1f)); break; case ATTRACTOR_ICECREAM: pRegisteredAttractor = new CPedIceCreamAttractor(pEffect, matrix, gcMaxSizeOfIceCreamQueue, 1.0f, 30000.0f, 3000.0f, 0.2f, 0.3f, 0.1f, 0.1f); vecAttractors.push_back(pRegisteredAttractor); break;
} }
POP_MEMID(); POP_MEMID();
if (pRegisteredAttractor) if (pRegisteredAttractor)

File diff suppressed because it is too large Load diff

View file

@ -246,7 +246,7 @@ CPlayerPed::MakeChangesForNewWeapon(int32 slot)
void void
CPlayerPed::ReApplyMoveAnims(void) CPlayerPed::ReApplyMoveAnims(void)
{ {
static AnimationId moveAnims[] = { ANIM_WALK, ANIM_RUN, ANIM_SPRINT, ANIM_IDLE_STANCE, ANIM_WALK_START }; static AnimationId moveAnims[] = { ANIM_STD_WALK, ANIM_STD_RUN, ANIM_STD_RUNFAST, ANIM_STD_IDLE, ANIM_STD_STARTWALK };
for(int i = 0; i < ARRAY_SIZE(moveAnims); i++) { for(int i = 0; i < ARRAY_SIZE(moveAnims); i++) {
CAnimBlendAssociation *curMoveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), moveAnims[i]); CAnimBlendAssociation *curMoveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), moveAnims[i]);
@ -311,13 +311,13 @@ CPlayerPed::SetInitialState(void)
void void
CPlayerPed::SetRealMoveAnim(void) CPlayerPed::SetRealMoveAnim(void)
{ {
CAnimBlendAssociation *curWalkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK); CAnimBlendAssociation *curWalkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_WALK);
CAnimBlendAssociation *curRunAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN); CAnimBlendAssociation *curRunAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUN);
CAnimBlendAssociation *curSprintAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_SPRINT); CAnimBlendAssociation *curSprintAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNFAST);
CAnimBlendAssociation *curWalkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK_START); CAnimBlendAssociation *curWalkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_STARTWALK);
CAnimBlendAssociation *curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE); CAnimBlendAssociation *curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE);
CAnimBlendAssociation *curRunStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP); CAnimBlendAssociation *curRunStopAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP1);
CAnimBlendAssociation *curRunStopRAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_RUN_STOP_R); CAnimBlendAssociation *curRunStopRAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2);
if (bResetWalkAnims) { if (bResetWalkAnims) {
if (curWalkAssoc) if (curWalkAssoc)
curWalkAssoc->SetCurrentTime(0.0f); curWalkAssoc->SetCurrentTime(0.0f);
@ -329,9 +329,9 @@ CPlayerPed::SetRealMoveAnim(void)
} }
if (!curIdleAssoc) if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED);
if (!curIdleAssoc) if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!curIdleAssoc) if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE); curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
@ -352,10 +352,10 @@ CPlayerPed::SetRealMoveAnim(void)
if (!curIdleAssoc) { if (!curIdleAssoc) {
if (m_fCurrentStamina < 0.0f && !bIsAimingGun && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, if (m_fCurrentStamina < 0.0f && !bIsAimingGun && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f,
nil, true, false, false, false, false, false)) { nil, true, false, false, false, false, false)) {
curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 8.0f); curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 8.0f);
} else { } else {
curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 8.0f); curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 8.0f);
} }
m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2500, 4000); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2500, 4000);
} }
@ -366,25 +366,25 @@ CPlayerPed::SetRealMoveAnim(void)
if (!curIdleAssoc) { if (!curIdleAssoc) {
if (m_fCurrentStamina < 0.0f && !bIsAimingGun && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, if (m_fCurrentStamina < 0.0f && !bIsAimingGun && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f,
nil, true, false, false, false, false, false)) { nil, true, false, false, false, false, false)) {
curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 4.0f); curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f);
} else { } else {
curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); curIdleAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f);
} }
m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2500, 4000); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2500, 4000);
} }
if ((m_fCurrentStamina > 0.0f || bIsAimingGun) && curIdleAssoc->animId == ANIM_IDLE_TIRED) { if ((m_fCurrentStamina > 0.0f || bIsAimingGun) && curIdleAssoc->animId == ANIM_STD_IDLE_TIRED) {
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f);
} else if (m_nPedState != PED_FIGHT) { } else if (m_nPedState != PED_FIGHT) {
if (m_fCurrentStamina < 0.0f && !bIsAimingGun && curIdleAssoc->animId != ANIM_IDLE_TIRED if (m_fCurrentStamina < 0.0f && !bIsAimingGun && curIdleAssoc->animId != ANIM_STD_IDLE_TIRED
&& !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, nil, true, false, false, false, false, false)) { && !CWorld::TestSphereAgainstWorld(GetPosition(), 0.5f, nil, true, false, false, false, false, false)) {
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_TIRED, 4.0f); CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f);
} else if (curIdleAssoc->animId != ANIM_IDLE_STANCE) { } else if (curIdleAssoc->animId != ANIM_STD_IDLE) {
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f);
} }
} }
m_nMoveState = PEDMOVE_STILL; m_nMoveState = PEDMOVE_STILL;
@ -395,7 +395,7 @@ CPlayerPed::SetRealMoveAnim(void)
curWalkStartAssoc->blendAmount = 1.0f; curWalkStartAssoc->blendAmount = 1.0f;
curWalkStartAssoc->blendDelta = 0.0f; curWalkStartAssoc->blendDelta = 0.0f;
} else { } else {
curWalkStartAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_WALK_START); curWalkStartAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_STARTWALK);
} }
if (curWalkAssoc) if (curWalkAssoc)
curWalkAssoc->SetCurrentTime(0.0f); curWalkAssoc->SetCurrentTime(0.0f);
@ -403,8 +403,8 @@ CPlayerPed::SetRealMoveAnim(void)
curRunAssoc->SetCurrentTime(0.0f); curRunAssoc->SetCurrentTime(0.0f);
delete curIdleAssoc; delete curIdleAssoc;
delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED); delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED);
CAnimBlendAssociation *fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); CAnimBlendAssociation *fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!fightIdleAnim) if (!fightIdleAnim)
fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE); fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
delete fightIdleAnim; delete fightIdleAnim;
@ -422,11 +422,11 @@ CPlayerPed::SetRealMoveAnim(void)
RestoreHeadingRate(); RestoreHeadingRate();
} }
if (!curWalkAssoc) { if (!curWalkAssoc) {
curWalkAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_WALK); curWalkAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_WALK);
curWalkAssoc->blendAmount = 0.0f; curWalkAssoc->blendAmount = 0.0f;
} }
if (!curRunAssoc) { if (!curRunAssoc) {
curRunAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_RUN); curRunAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_RUN);
curRunAssoc->blendAmount = 0.0f; curRunAssoc->blendAmount = 0.0f;
} }
if (curWalkStartAssoc && !(curWalkStartAssoc->IsRunning())) { if (curWalkStartAssoc && !(curWalkStartAssoc->IsRunning())) {
@ -453,9 +453,9 @@ CPlayerPed::SetRealMoveAnim(void)
if (m_fMoveSpeed < 0.4f) { if (m_fMoveSpeed < 0.4f) {
AnimationId runStopAnim; AnimationId runStopAnim;
if (curSprintAssoc->GetProgress() < 0.5) // double if (curSprintAssoc->GetProgress() < 0.5) // double
runStopAnim = ANIM_RUN_STOP; runStopAnim = ANIM_STD_RUNSTOP1;
else else
runStopAnim = ANIM_RUN_STOP_R; runStopAnim = ANIM_STD_RUNSTOP2;
CAnimBlendAssociation* newRunStopAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, runStopAnim); CAnimBlendAssociation* newRunStopAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, runStopAnim);
newRunStopAssoc->blendAmount = 1.0f; newRunStopAssoc->blendAmount = 1.0f;
newRunStopAssoc->SetDeleteCallback(RestoreHeadingRateCB, this); newRunStopAssoc->SetDeleteCallback(RestoreHeadingRateCB, this);
@ -498,7 +498,7 @@ CPlayerPed::SetRealMoveAnim(void)
// Transition between run-sprint // Transition between run-sprint
curWalkAssoc->blendAmount = 0.0f; curWalkAssoc->blendAmount = 0.0f;
curRunAssoc->blendAmount = 1.0f; curRunAssoc->blendAmount = 1.0f;
curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_SPRINT, 2.0f); curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_RUNFAST, 2.0f);
} }
UseSprintEnergy(); UseSprintEnergy();
} else { } else {
@ -629,14 +629,14 @@ CPlayerPed::DoesTargetHaveToBeBroken(CVector target, CWeapon *weaponUsed)
void void
CPlayerPed::RunningLand(CPad *padUsed) CPlayerPed::RunningLand(CPad *padUsed)
{ {
CAnimBlendAssociation *landAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_LAND); CAnimBlendAssociation *landAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL_LAND);
if (landAssoc && landAssoc->currentTime == 0.0f && m_fMoveSpeed > 1.5f if (landAssoc && landAssoc->currentTime == 0.0f && m_fMoveSpeed > 1.5f
&& padUsed && (padUsed->GetPedWalkLeftRight() != 0.0f || padUsed->GetPedWalkUpDown() != 0.0f)) { && padUsed && (padUsed->GetPedWalkLeftRight() != 0.0f || padUsed->GetPedWalkUpDown() != 0.0f)) {
landAssoc->blendDelta = -1000.0f; landAssoc->blendDelta = -1000.0f;
landAssoc->flags |= ASSOC_DELETEFADEDOUT; landAssoc->flags |= ASSOC_DELETEFADEDOUT;
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_JUMP_LAND)->SetFinishCallback(FinishJumpCB, this); CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_JUMP_LAND)->SetFinishCallback(FinishJumpCB, this);
if (m_nPedState == PED_JUMP) if (m_nPedState == PED_JUMP)
RestorePreviousState(); RestorePreviousState();
@ -1259,7 +1259,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
TheCamera.SetNewPlayerWeaponMode(CCam::MODE_M16_1STPERSON, 0, 0); TheCamera.SetNewPlayerWeaponMode(CCam::MODE_M16_1STPERSON, 0, 0);
m_fMoveSpeed = 0.0f; m_fMoveSpeed = 0.0f;
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_STANCE, 1000.0f); CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE, 1000.0f);
SetPedState(PED_SNIPER_MODE); SetPedState(PED_SNIPER_MODE);
return; return;
} }
@ -1701,24 +1701,24 @@ CPlayerPed::ProcessControl(void)
if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) { if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) {
if (!CReplay::IsPlayingBack() || m_pMyVehicle) { if (!CReplay::IsPlayingBack() || m_pMyVehicle) {
if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) { if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) {
CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR); CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS);
if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || (rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR_LOW))) { if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || (rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS))) {
if (rollDoorAssoc) if (rollDoorAssoc)
m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime); m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, rollDoorAssoc->currentTime);
} else { } else {
// These comparisons are wrong, they return uint16 // These comparisons are wrong, they return uint16
if (padUsed && (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f || padUsed->GetBrake() != 0.0f)) { if (padUsed && (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f || padUsed->GetBrake() != 0.0f)) {
if (rollDoorAssoc) if (rollDoorAssoc)
m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime); m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS, rollDoorAssoc->currentTime);
} else { } else {
m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF; m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF;
if (m_pMyVehicle->bLowVehicle) if (m_pMyVehicle->bLowVehicle)
rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR_LOW); rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LO_LHS);
else else
rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR); rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_CLOSE_DOOR_ROLLING_LHS);
rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this); rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this);
} }
@ -1948,11 +1948,11 @@ CPlayerPed::PlayIdleAnimations(CPad *padUsed)
}; };
const animAndGroup idleAnims[] = { const animAndGroup idleAnims[] = {
{ANIM_IDLE_STRETCH, ASSOCGRP_PLAYER_IDLE}, {ANIM_PLAYER_IDLE1, ASSOCGRP_PLAYER_IDLE},
{ANIM_IDLE_TIME, ASSOCGRP_PLAYER_IDLE}, {ANIM_PLAYER_IDLE2, ASSOCGRP_PLAYER_IDLE},
{ANIM_IDLE_SHOULDER, ASSOCGRP_PLAYER_IDLE}, {ANIM_PLAYER_IDLE3, ASSOCGRP_PLAYER_IDLE},
{ANIM_IDLE_STRETCH_LEG, ASSOCGRP_PLAYER_IDLE}, {ANIM_PLAYER_IDLE4, ASSOCGRP_PLAYER_IDLE},
{ANIM_XPRESS_SCRATCH, ASSOCGRP_STD}, {ANIM_STD_XPRESS_SCRATCH, ASSOCGRP_STD},
}; };
static int32 lastTime = 0; static int32 lastTime = 0;

View file

@ -798,6 +798,9 @@ CCredits::Render(void)
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
CFont::DrawFonts(); CFont::DrawFonts();
#ifdef CUTSCENE_BORDERS_SWITCH
if (CMenuManager::m_PrefsCutsceneBorders)
#endif
if(TheCamera.m_WideScreenOn) if(TheCamera.m_WideScreenOn)
TheCamera.DrawBordersForWideScreen(); TheCamera.DrawBordersForWideScreen();

View file

@ -30,28 +30,48 @@ bool CDraw::ms_bFixRadar = true;
bool CDraw::ms_bFixSprites = true; bool CDraw::ms_bFixSprites = true;
#endif #endif
#ifdef ASPECT_RATIO_SCALE
float
FindAspectRatio(void)
{
switch (FrontEndMenuManager.m_PrefsUseWideScreen) {
case AR_AUTO:
return SCREEN_WIDTH / SCREEN_HEIGHT;
default:
case AR_4_3:
return 4.0f / 3.0f;
case AR_5_4:
return 5.0f / 4.0f;
case AR_16_10:
return 16.0f / 10.0f;
case AR_16_9:
return 16.0f / 9.0f;
case AR_21_9:
return 21.0f / 9.0f;
};
}
#endif
float float
CDraw::CalculateAspectRatio(void) CDraw::CalculateAspectRatio(void)
{ {
if (FrontEndMenuManager.m_PrefsUseWideScreen) {
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
if (TheCamera.m_WideScreenOn) if (TheCamera.m_WideScreenOn)
CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? CDraw::ms_fAspectRatio = (5.f / 3.f) * FindAspectRatio() / (16.f / 9.f); // It's used on theatrical showings according to Wiki
(5.f / 3.f) * (SCREEN_WIDTH / SCREEN_HEIGHT) / (16.f / 9.f) : else
5.f / 3.f; // It's used on theatrical showings according to Wiki CDraw::ms_fAspectRatio = FindAspectRatio();
else
CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? SCREEN_WIDTH / SCREEN_HEIGHT : 16.f / 9.f;
#else #else
if(FrontEndMenuManager.m_PrefsUseWideScreen) {
if (TheCamera.m_WideScreenOn) if (TheCamera.m_WideScreenOn)
CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki
else else
CDraw::ms_fAspectRatio = 16.f / 9.f; CDraw::ms_fAspectRatio = 16.f / 9.f;
#endif
} else if (TheCamera.m_WideScreenOn) { } else if (TheCamera.m_WideScreenOn) {
CDraw::ms_fAspectRatio = 5.f/4.f; CDraw::ms_fAspectRatio = 5.f/4.f;
} else { } else {
CDraw::ms_fAspectRatio = 4.f/3.f; CDraw::ms_fAspectRatio = 4.f/3.f;
} }
#endif
return CDraw::ms_fAspectRatio; return CDraw::ms_fAspectRatio;
} }

View file

@ -4,10 +4,14 @@ enum eAspectRatio
{ {
// Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen // Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen
// without widescreen support // without widescreen support
AR_4_3,
AR_16_9,
AR_AUTO, AR_AUTO,
AR_4_3,
AR_5_4,
AR_16_10,
AR_16_9,
AR_21_9,
AR_MAX,
}; };
class CDraw class CDraw

View file

@ -176,11 +176,26 @@ CFont::Initialise(void)
} }
*/ */
#if !defined(GAMEPAD_MENU) && defined(BUTTON_ICONS)
// loaded in CMenuManager with GAMEPAD_MENU defined
LoadButtons("MODELS/X360BTNS.TXD");
#endif
}
#ifdef BUTTON_ICONS #ifdef BUTTON_ICONS
if (int file = CFileMgr::OpenFile("MODELS/X360BTNS.TXD")) { void
CFont::LoadButtons(const char *txdPath)
{
if (int file = CFileMgr::OpenFile(txdPath)) {
CFileMgr::CloseFile(file); CFileMgr::CloseFile(file);
ButtonsSlot = CTxdStore::AddTxdSlot("buttons"); if (ButtonsSlot == -1)
CTxdStore::LoadTxd(ButtonsSlot, "MODELS/X360BTNS.TXD"); ButtonsSlot = CTxdStore::AddTxdSlot("buttons");
else {
for (int i = 0; i < MAX_BUTTON_ICONS; i++)
ButtonSprite[i].Delete();
CTxdStore::RemoveTxd(ButtonsSlot);
}
CTxdStore::LoadTxd(ButtonsSlot, txdPath);
CTxdStore::AddRef(ButtonsSlot); CTxdStore::AddRef(ButtonsSlot);
CTxdStore::PushCurrentTxd(); CTxdStore::PushCurrentTxd();
CTxdStore::SetCurrentTxd(ButtonsSlot); CTxdStore::SetCurrentTxd(ButtonsSlot);
@ -198,12 +213,22 @@ CFont::Initialise(void)
ButtonSprite[BUTTON_R1].SetTexture("r1"); ButtonSprite[BUTTON_R1].SetTexture("r1");
ButtonSprite[BUTTON_R2].SetTexture("r2"); ButtonSprite[BUTTON_R2].SetTexture("r2");
ButtonSprite[BUTTON_R3].SetTexture("r3"); ButtonSprite[BUTTON_R3].SetTexture("r3");
ButtonSprite[BUTTON_RSTICK_UP].SetTexture("thumbryu");
ButtonSprite[BUTTON_RSTICK_DOWN].SetTexture("thumbryd");
ButtonSprite[BUTTON_RSTICK_LEFT].SetTexture("thumbrxl"); ButtonSprite[BUTTON_RSTICK_LEFT].SetTexture("thumbrxl");
ButtonSprite[BUTTON_RSTICK_RIGHT].SetTexture("thumbrxr"); ButtonSprite[BUTTON_RSTICK_RIGHT].SetTexture("thumbrxr");
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
} }
#endif // BUTTON_ICONS else {
if (ButtonsSlot != -1) {
for (int i = 0; i < MAX_BUTTON_ICONS; i++)
ButtonSprite[i].Delete();
CTxdStore::RemoveTxdSlot(ButtonsSlot);
ButtonsSlot = -1;
}
}
} }
#endif // BUTTON_ICONS
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
void void
@ -257,6 +282,7 @@ CFont::Shutdown(void)
for (int i = 0; i < MAX_BUTTON_ICONS; i++) for (int i = 0; i < MAX_BUTTON_ICONS; i++)
ButtonSprite[i].Delete(); ButtonSprite[i].Delete();
CTxdStore::RemoveTxdSlot(ButtonsSlot); CTxdStore::RemoveTxdSlot(ButtonsSlot);
ButtonsSlot = -1;
} }
#endif #endif
Sprite[0].Delete(); Sprite[0].Delete();
@ -296,16 +322,19 @@ CFont::DrawButton(float x, float y)
if (PS2Symbol != BUTTON_NONE) { if (PS2Symbol != BUTTON_NONE) {
CRect rect; CRect rect;
rect.left = x; rect.left = x;
rect.top = Details.scaleY + Details.scaleY + y; rect.top = RenderState.scaleY + RenderState.scaleY + y;
rect.right = Details.scaleY * 17.0f + x; rect.right = RenderState.scaleY * 17.0f + x;
rect.bottom = Details.scaleY * 19.0f + y; rect.bottom = RenderState.scaleY * 19.0f + y;
int vertexAlphaState; int vertexAlphaState;
void *raster; void *raster;
RwRenderStateGet(rwRENDERSTATEVERTEXALPHAENABLE, &vertexAlphaState); RwRenderStateGet(rwRENDERSTATEVERTEXALPHAENABLE, &vertexAlphaState);
RwRenderStateGet(rwRENDERSTATETEXTURERASTER, &raster); RwRenderStateGet(rwRENDERSTATETEXTURERASTER, &raster);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
ButtonSprite[PS2Symbol].Draw(rect, CRGBA(255, 255, 255, Details.color.a)); if (RenderState.bIsShadow)
ButtonSprite[PS2Symbol].Draw(rect, RenderState.color);
else
ButtonSprite[PS2Symbol].Draw(rect, CRGBA(255, 255, 255, RenderState.color.a));
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)vertexAlphaState); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)vertexAlphaState);
} }
@ -455,7 +484,7 @@ CFont::RenderFontBuffer()
#ifdef BUTTON_ICONS #ifdef BUTTON_ICONS
if(PS2Symbol != BUTTON_NONE) { if(PS2Symbol != BUTTON_NONE) {
DrawButton(textPosX, textPosY); DrawButton(textPosX, textPosY);
textPosX += Details.scaleY * 17.0f; textPosX += RenderState.scaleY * 17.0f;
PS2Symbol = BUTTON_NONE; PS2Symbol = BUTTON_NONE;
} }
#endif #endif
@ -1254,6 +1283,8 @@ CFont::ParseToken(wchar* str, CRGBA &color, bool &flash, bool &bold)
case 'J': PS2Symbol = BUTTON_R1; break; case 'J': PS2Symbol = BUTTON_R1; break;
case 'V': PS2Symbol = BUTTON_R2; break; case 'V': PS2Symbol = BUTTON_R2; break;
case 'C': PS2Symbol = BUTTON_R3; break; case 'C': PS2Symbol = BUTTON_R3; break;
case 'H': PS2Symbol = BUTTON_RSTICK_UP; break;
case 'L': PS2Symbol = BUTTON_RSTICK_DOWN; break;
case '(': PS2Symbol = BUTTON_RSTICK_LEFT; break; case '(': PS2Symbol = BUTTON_RSTICK_LEFT; break;
case ')': PS2Symbol = BUTTON_RSTICK_RIGHT; break; case ')': PS2Symbol = BUTTON_RSTICK_RIGHT; break;
#endif #endif

View file

@ -114,6 +114,8 @@ enum
BUTTON_R1, BUTTON_R1,
BUTTON_R2, BUTTON_R2,
BUTTON_R3, BUTTON_R3,
BUTTON_RSTICK_UP,
BUTTON_RSTICK_DOWN,
BUTTON_RSTICK_LEFT, BUTTON_RSTICK_LEFT,
BUTTON_RSTICK_RIGHT, BUTTON_RSTICK_RIGHT,
MAX_BUTTON_ICONS MAX_BUTTON_ICONS
@ -140,7 +142,8 @@ public:
static int32 ButtonsSlot; static int32 ButtonsSlot;
static CSprite2d ButtonSprite[MAX_BUTTON_ICONS]; static CSprite2d ButtonSprite[MAX_BUTTON_ICONS];
static int PS2Symbol; static int PS2Symbol;
static void LoadButtons(const char *txdPath);
static void DrawButton(float x, float y); static void DrawButton(float x, float y);
#endif // BUTTON_ICONS #endif // BUTTON_ICONS

View file

@ -1107,18 +1107,18 @@ void CHud::Draw()
if (IntroRect.m_nTextureId >= 0) { if (IntroRect.m_nTextureId >= 0) {
CRect rect ( CRect rect (
IntroRect.m_sRect.left, IntroRect.m_sRect.left,
IntroRect.m_sRect.top, IntroRect.m_sRect.bottom,
IntroRect.m_sRect.right, IntroRect.m_sRect.right,
IntroRect.m_sRect.bottom ); IntroRect.m_sRect.top );
CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor); CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor);
} }
else { else {
CRect rect ( CRect rect (
IntroRect.m_sRect.left, IntroRect.m_sRect.left,
IntroRect.m_sRect.top, IntroRect.m_sRect.bottom,
IntroRect.m_sRect.right, IntroRect.m_sRect.right,
IntroRect.m_sRect.bottom ); IntroRect.m_sRect.top );
CSprite2d::DrawRect(rect, IntroRect.m_sColor); CSprite2d::DrawRect(rect, IntroRect.m_sColor);
} }
@ -1139,7 +1139,14 @@ void CHud::Draw()
CFont::SetBackgroundColor(CRGBA(0, 0, 0, 128)); CFont::SetBackgroundColor(CRGBA(0, 0, 0, 128));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetDropShadowPosition(0); #ifdef CUTSCENE_BORDERS_SWITCH
if (!FrontEndMenuManager.m_PrefsCutsceneBorders) {
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CFont::SetDropShadowPosition(2);
}
else
#endif
CFont::SetDropShadowPosition(0);
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetColor(CRGBA(225, 225, 225, 255)); CFont::SetColor(CRGBA(225, 225, 225, 255));
@ -1149,10 +1156,6 @@ void CHud::Draw()
onceItWasWidescreen = true; onceItWasWidescreen = true;
if (FrontEndMenuManager.m_PrefsShowSubtitles || !CCutsceneMgr::IsRunning()) { if (FrontEndMenuManager.m_PrefsShowSubtitles || !CCutsceneMgr::IsRunning()) {
#ifdef CUTSCENE_BORDERS_SWITCH
if (!FrontEndMenuManager.m_PrefsCutsceneBorders)
CFont::SetDropShadowPosition(0);
#endif
CFont::SetCentreSize(SCREEN_WIDTH - SCREEN_SCALE_X(60.0f)); CFont::SetCentreSize(SCREEN_WIDTH - SCREEN_SCALE_X(60.0f));
CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.2f)); CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.2f));
CFont::PrintString(SCREEN_WIDTH / 2.f, SCREEN_SCALE_FROM_BOTTOM(80.0f), m_Message); CFont::PrintString(SCREEN_WIDTH / 2.f, SCREEN_SCALE_FROM_BOTTOM(80.0f), m_Message);
@ -1191,7 +1194,7 @@ void CHud::Draw()
m_HelpMessageDisplayTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f; m_HelpMessageDisplayTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f;
if (TheCamera.m_ScreenReductionPercentage == 0.0f) if (TheCamera.m_ScreenReductionPercentage == 0.0f)
DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0); DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
break; break;
case 1: case 1:
case 2: case 2:

View file

@ -1398,6 +1398,10 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
void void
CRenderer::InsertEntityIntoList(CEntity *ent) CRenderer::InsertEntityIntoList(CEntity *ent)
{ {
#ifdef FIX_BUGS
if (!ent->m_rwObject) return;
#endif
#ifdef NEW_RENDERER #ifdef NEW_RENDERER
// TODO: there are more flags being checked here // TODO: there are more flags being checked here
if(gbNewRenderer && (ent->IsVehicle() || ent->IsPed())) if(gbNewRenderer && (ent->IsVehicle() || ent->IsPed()))

View file

@ -28,8 +28,8 @@
#include "VarConsole.h" #include "VarConsole.h"
#ifdef DEBUGMENU #ifdef DEBUGMENU
SETTWEAKPATH("Shadows"); //SETTWEAKPATH("Shadows");
TWEAKBOOL(gbPrintShite); //TWEAKBOOL(gbPrintShite);
#endif #endif
RwImVertexIndex ShadowIndexList[24]; RwImVertexIndex ShadowIndexList[24];

View file

@ -266,7 +266,7 @@ void CWaterCannon::PushPeds(void)
ped->m_vecMoveSpeed.x *= (0.2f / pedSpeed2D); ped->m_vecMoveSpeed.x *= (0.2f / pedSpeed2D);
ped->m_vecMoveSpeed.y *= (0.2f / pedSpeed2D); ped->m_vecMoveSpeed.y *= (0.2f / pedSpeed2D);
} }
ped->SetFall(2000, (AnimationId)(localDir + ANIM_KO_SKID_FRONT), 0); ped->SetFall(2000, (AnimationId)(localDir + ANIM_STD_HIGHIMPACT_FRONT), 0);
CParticle::AddParticle(PARTICLE_STEAM_NY_SLOWMOTION, ped->GetPosition(), ped->m_vecMoveSpeed * 0.3f, 0, 0.5f); CParticle::AddParticle(PARTICLE_STEAM_NY_SLOWMOTION, ped->GetPosition(), ped->m_vecMoveSpeed * 0.3f, 0, 0.5f);
CParticle::AddParticle(PARTICLE_CAR_SPLASH, ped->GetPosition(), ped->m_vecMoveSpeed * -0.3f + CVector(0.f, 0.f, 0.5f), 0, 0.5f, CParticle::AddParticle(PARTICLE_CAR_SPLASH, ped->GetPosition(), ped->m_vecMoveSpeed * -0.3f + CVector(0.f, 0.f, 0.5f), 0, 0.5f,
CGeneral::GetRandomNumberInRange(0.f, 10.f), CGeneral::GetRandomNumberInRange(0.f, 90.f), 1); CGeneral::GetRandomNumberInRange(0.f, 10.f), CGeneral::GetRandomNumberInRange(0.f, 90.f), 1);

View file

@ -73,7 +73,7 @@ RwRaster *gpWaterEnvBaseRaster;
RwRaster *gpWaterWakeRaster; RwRaster *gpWaterWakeRaster;
bool _bSeaLife; bool _bSeaLife;
float _fWaterZOffset = 0.5f; float _fWaterZOffset = WATER_Z_OFFSET;
#ifdef PC_WATER #ifdef PC_WATER
float fEnvScale = 0.25f; float fEnvScale = 0.25f;
@ -318,6 +318,7 @@ CWaterLevel::Shutdown()
_DELETE_TEXTURE(gpWaterTex); _DELETE_TEXTURE(gpWaterTex);
_DELETE_TEXTURE(gpWaterEnvTex); _DELETE_TEXTURE(gpWaterEnvTex);
_DELETE_TEXTURE(gpWaterWakeTex);
_DELETE_TEXTURE(gpWaterEnvBaseTex); _DELETE_TEXTURE(gpWaterEnvBaseTex);
#undef _DELETE_TEXTURE #undef _DELETE_TEXTURE
@ -714,9 +715,9 @@ CWaterLevel::GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool
if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false; if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false;
#endif #endif
uint8 nBlock = aWaterFineBlockList[x][y]; int8 nBlock = aWaterFineBlockList[x][y];
if ( nBlock == 0x80 ) if ( nBlock == NO_WATER )
return false; return false;
ASSERT( pfOutLevel != nil ); ASSERT( pfOutLevel != nil );
@ -756,9 +757,9 @@ CWaterLevel::GetWaterLevelNoWaves(float fX, float fY, float fZ, float *pfOutLeve
if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false; if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false;
#endif #endif
uint8 nBlock = aWaterFineBlockList[x][y]; int8 nBlock = aWaterFineBlockList[x][y];
if ( nBlock == 0x80 ) if ( nBlock == NO_WATER )
return false; return false;
ASSERT( pfOutLevel != nil ); ASSERT( pfOutLevel != nil );
@ -1076,7 +1077,7 @@ CWaterLevel::RenderWater()
{ {
for ( int32 y = 0; y < 5; y++ ) for ( int32 y = 0; y < 5; y++ )
{ {
float fX = WATER_SIGN_X(float(x) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f - 400.0f; float fX = WATER_SIGN_X(float(x) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f - WATER_X_OFFSET;
float fY = WATER_SIGN_Y(float(y) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f; float fY = WATER_SIGN_Y(float(y) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f;
if ( !bUseCamStartY ) if ( !bUseCamStartY )
@ -1462,7 +1463,7 @@ CWaterLevel::RenderTransparentWater(void)
int32 nBlock; int32 nBlock;
int32 BlockX = WATER_TO_SMALL_SECTOR_X(fCamX + 400.0f) + 1; int32 BlockX = WATER_TO_SMALL_SECTOR_X(fCamX + WATER_X_OFFSET) + 1;
int32 BlockY = WATER_TO_SMALL_SECTOR_Y(fCamY) + 1; int32 BlockY = WATER_TO_SMALL_SECTOR_Y(fCamY) + 1;
if (_IsColideWithBlock(BlockX, BlockY, nBlock)) if (_IsColideWithBlock(BlockX, BlockY, nBlock))
@ -1472,7 +1473,7 @@ CWaterLevel::RenderTransparentWater(void)
float fMaskX = Floor(fCamX / 2.0f) * 2.0f; float fMaskX = Floor(fCamX / 2.0f) * 2.0f;
float fMaskY = Floor(fCamY / 2.0f) * 2.0f; float fMaskY = Floor(fCamY / 2.0f) * 2.0f;
float fWaterZ = CWaterLevel::ms_aWaterZs[nBlock]; float fWaterZ = CWaterLevel::ms_aWaterZs[nBlock];
float fSectorX = WATER_FROM_SMALL_SECTOR_X(BlockX) - 400.0f; float fSectorX = WATER_FROM_SMALL_SECTOR_X(BlockX) - WATER_X_OFFSET;
float fSectorY = WATER_FROM_SMALL_SECTOR_Y(BlockY); float fSectorY = WATER_FROM_SMALL_SECTOR_Y(BlockY);
RenderWavyMask(fMaskX, fMaskY, fWaterZ, RenderWavyMask(fMaskX, fMaskY, fWaterZ,

View file

@ -1,6 +1,7 @@
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable : 4005) #pragma warning( disable : 4005)
#pragma warning( pop ) #pragma warning( pop )
#define FORCE_PC_SCALING
#ifndef LIBRW #ifndef LIBRW
#define WITHD3D #define WITHD3D
#endif #endif
@ -320,7 +321,11 @@ ConvertingTexturesScreen(uint32 num, uint32 count, const char *text)
splash->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255)); splash->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(240.0f), SCREEN_SCALE_FROM_RIGHT(200.0f), SCREEN_SCALE_Y(248.0f)), CRGBA(64, 64, 64, 255)); CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(240.0f), SCREEN_SCALE_FROM_RIGHT(200.0f), SCREEN_SCALE_Y(248.0f)), CRGBA(64, 64, 64, 255));
#ifdef FIX_BUGS
CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(240.0f), (SCREEN_SCALE_FROM_RIGHT(200.0f) - SCREEN_SCALE_X(200.0f)) * ((float)num / (float)count) + SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(248.0f)), CRGBA(255, 150, 225, 255));
#else
CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(240.0f), (SCREEN_SCALE_FROM_RIGHT(200.0f) - SCREEN_SCALE_X(200.0f)) * ((float)num / (float)count) + SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(248.0f)), CRGBA(255, 217, 106, 255)); CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(240.0f), (SCREEN_SCALE_FROM_RIGHT(200.0f) - SCREEN_SCALE_X(200.0f)) * ((float)num / (float)count) + SCREEN_SCALE_X(200.0f), SCREEN_SCALE_Y(248.0f)), CRGBA(255, 217, 106, 255));
#endif
CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(120.0f), SCREEN_SCALE_Y(150.0f), SCREEN_SCALE_FROM_RIGHT(120.0f), SCREEN_HEIGHT - SCREEN_SCALE_Y(220.0f)), CRGBA(50, 50, 50, 210)); CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(120.0f), SCREEN_SCALE_Y(150.0f), SCREEN_SCALE_FROM_RIGHT(120.0f), SCREEN_HEIGHT - SCREEN_SCALE_Y(220.0f)), CRGBA(50, 50, 50, 210));
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
@ -329,7 +334,11 @@ ConvertingTexturesScreen(uint32 num, uint32 count, const char *text)
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(170.0f)); CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(170.0f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
#ifdef FIX_BUGS
CFont::SetColor(CRGBA(255, 150, 225, 255));
#else
CFont::SetColor(CRGBA(255, 217, 106, 255)); CFont::SetColor(CRGBA(255, 217, 106, 255));
#endif
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetFontStyle(FONT_STANDARD); CFont::SetFontStyle(FONT_STANDARD);
CFont::PrintString(SCREEN_SCALE_X(170.0f), SCREEN_SCALE_Y(160.0f), TheText.Get(text)); CFont::PrintString(SCREEN_SCALE_X(170.0f), SCREEN_SCALE_Y(160.0f), TheText.Get(text));

View file

@ -96,6 +96,10 @@ CVisibilityPlugins::InitAlphaEntityList(void)
bool bool
CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist) CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist)
{ {
#ifdef FIX_BUGS
if (!e->m_rwObject) return true;
#endif
AlphaObjectInfo item; AlphaObjectInfo item;
item.entity = e; item.entity = e;
item.sort = dist; item.sort = dist;

View file

@ -67,16 +67,16 @@ bool StillToFadeOut;
uint32 TimeStartedCountingForFade; uint32 TimeStartedCountingForFade;
uint32 TimeToStayFadedBeforeFadeOut = 1750; uint32 TimeToStayFadedBeforeFadeOut = 1750;
uint32 RadioStationPosition[NUM_RADIOS]; int32 RadioStationPosition[NUM_RADIOS];
void void
InitRadioStationPositionList() InitRadioStationPositionList()
{ {
for (int i = 0; i < NUM_RADIOS; i++) for (int i = 0; i < NUM_RADIOS; i++)
RadioStationPosition[i] = 0; RadioStationPosition[i] = -1;
} }
uint32 int32
GetSavedRadioStationPosition(int32 station) GetSavedRadioStationPosition(int32 station)
{ {
return RadioStationPosition[station]; return RadioStationPosition[station];

View file

@ -6,7 +6,7 @@
#define SLOT_COUNT (8) #define SLOT_COUNT (8)
void InitRadioStationPositionList(); void InitRadioStationPositionList();
uint32 GetSavedRadioStationPosition(int32 station); int32 GetSavedRadioStationPosition(int32 station);
void PopulateRadioStationPositionList(); void PopulateRadioStationPositionList();
bool GenericSave(int file); bool GenericSave(int file);
bool GenericLoad(); bool GenericLoad();

Some files were not shown because too many files have changed in this diff Show more