mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-22 21:40:01 +00:00
Merge branch 'master' of https://github.com/GTAmodding/re3
This commit is contained in:
commit
0bea6d039b
|
@ -1,54 +0,0 @@
|
|||
version: 1.0.{build}
|
||||
image: Visual Studio 2019
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
platform:
|
||||
- win-x86-librw_d3d9-mss
|
||||
- win-x86-librw_gl3_glfw-mss
|
||||
environment:
|
||||
APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
||||
GLEW_VER: "2.1.0"
|
||||
GLFW_VER: "3.3.2"
|
||||
GLEW_BASE: glew-%GLEW_VER%
|
||||
GLFW_BASE: glfw-%GLFW_VER%.bin.WIN32
|
||||
GLEW_FILE: "%GLEW_BASE%-win32.zip"
|
||||
GLFW_FILE: "%GLFW_BASE%.zip"
|
||||
GLEW_URL: https://github.com/nigels-com/glew/releases/download/%GLEW_BASE%/%GLEW_FILE%
|
||||
GLFW_URL: https://github.com/glfw/glfw/releases/download/%GLFW_VER%/%GLFW_FILE%
|
||||
install:
|
||||
- IF [%PLATFORM%] == [win-x86-librw_gl3_glfw-mss] IF NOT EXIST %GLEW_FILE% appveyor DownloadFile %GLEW_URL% -FileName "%APPVEYOR_BUILD_FOLDER%/%GLEW_FILE%"
|
||||
- IF [%PLATFORM%] == [win-x86-librw_gl3_glfw-mss] 7z x "%APPVEYOR_BUILD_FOLDER%/%GLEW_FILE%"
|
||||
- IF [%PLATFORM%] == [win-x86-librw_gl3_glfw-mss] IF NOT EXIST %GLFW_FILE% appveyor DownloadFile %GLFW_URL% -FileName "%APPVEYOR_BUILD_FOLDER%/%GLFW_FILE%"
|
||||
- IF [%PLATFORM%] == [win-x86-librw_gl3_glfw-mss] 7z x "%APPVEYOR_BUILD_FOLDER%/%GLFW_FILE%"
|
||||
- cmd: >-
|
||||
git submodule update --init --recursive
|
||||
|
||||
premake5 vs2019 --with-librw --glewdir=%APPVEYOR_BUILD_FOLDER%/%GLEW_BASE% --glfwdir32=%APPVEYOR_BUILD_FOLDER%/%GLFW_BASE%
|
||||
|
||||
build:
|
||||
project: build/re3.sln
|
||||
verbosity: minimal
|
||||
after_build:
|
||||
- 7z a "re3_%configuration%_%platform%_%APPVEYOR_BUILD_VERSION%.zip" bin/%PLATFORM%/%CONFIGURATION%/re3.exe bin/%PLATFORM%/%CONFIGURATION%/re3.pdb
|
||||
artifacts:
|
||||
- path: "re3_%configuration%_%platform%_%APPVEYOR_BUILD_VERSION%.zip"
|
||||
name: re3
|
||||
deploy:
|
||||
- provider: BinTray
|
||||
username: shfil119
|
||||
api_key:
|
||||
secure: xWnYDfNWM87iPoBFbz6L1XAduxijJRWSpQLhMDOjznmzbMCsORtdx2tmWmFLTwf6
|
||||
subject: gtamodding
|
||||
repo: re3
|
||||
package: "%configuration%_%platform%"
|
||||
version: "%APPVEYOR_BUILD_VERSION%"
|
||||
artifact: re3
|
||||
publish: true
|
||||
on:
|
||||
branch: master
|
||||
APPVEYOR_REPO_TAG: true
|
||||
|
||||
cache:
|
||||
- "%GLEW_FILE%"
|
||||
- "%GLFW_FILE%"
|
28
.clang-format
Normal file
28
.clang-format
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
AllowShortBlocksOnASingleLine: 'true'
|
||||
AllowShortCaseLabelsOnASingleLine: 'true'
|
||||
AllowShortIfStatementsOnASingleLine: 'true'
|
||||
AllowShortLoopsOnASingleLine: 'true'
|
||||
AlwaysBreakAfterReturnType: TopLevel
|
||||
AccessModifierOffset: -8
|
||||
BreakBeforeBraces: Linux
|
||||
ColumnLimit: 160
|
||||
IndentCaseLabels: 'false'
|
||||
IndentWidth: '8'
|
||||
Language: Cpp
|
||||
PointerAlignment: Right
|
||||
SpaceAfterCStyleCast: 'false'
|
||||
SpaceBeforeAssignmentOperators: 'true'
|
||||
SpaceBeforeCtorInitializerColon: 'true'
|
||||
SpaceBeforeInheritanceColon: 'true'
|
||||
SpaceBeforeParens: Never
|
||||
SpaceInEmptyParentheses: 'false'
|
||||
SpacesInAngles: 'false'
|
||||
SpacesInCStyleCastParentheses: 'false'
|
||||
SpacesInContainerLiterals: 'false'
|
||||
SpacesInParentheses: 'false'
|
||||
SpacesInSquareBrackets: 'false'
|
||||
TabWidth: '8'
|
||||
UseTab: ForIndentation
|
||||
|
||||
...
|
|
@ -1,10 +1,6 @@
|
|||
# re3
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/hyiwgegks122h8jg/branch/master?svg=true)](https://ci.appveyor.com/project/aap/re3/branch/master)
|
||||
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=master)
|
||||
<a href="https://discord.gg/aKYAwCx92H"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>
|
||||
| Platform | Debug | Release |
|
||||
|------------------|-------------|-------------|
|
||||
| Windows Direct3D9 | [![Download](https://api.bintray.com/packages/gtamodding/re3/Debug_win-x86-librw_d3d9-mss/images/download.svg)](https://bintray.com/gtamodding/re3/Debug_win-x86-librw_d3d9-mss/_latestVersion) | [![Download](https://api.bintray.com/packages/gtamodding/re3/Release_win-x86-librw_d3d9-mss/images/download.svg)](https://bintray.com/gtamodding/re3/Release_win-x86-librw_d3d9-mss/_latestVersion) |
|
||||
| Windows OpenGL3.3 | [![Download](https://api.bintray.com/packages/gtamodding/re3/Debug_win-x86-librw_gl3_glfw-mss/images/download.svg)](https://bintray.com/gtamodding/re3/Debug_win-x86-librw_gl3_glfw-mss/_latestVersion) | [![Download](https://api.bintray.com/packages/gtamodding/re3/Release_win-x86-librw_gl3_glfw-mss/images/download.svg)](https://bintray.com/gtamodding/re3/Release_win-x86-librw_gl3_glfw-mss/_latestVersion) |
|
||||
|
||||
## Intro
|
||||
|
||||
|
|
Binary file not shown.
199
gamefiles/gamecontrollerdb.txt
Normal file
199
gamefiles/gamecontrollerdb.txt
Normal file
|
@ -0,0 +1,199 @@
|
|||
# Windows - DINPUT
|
||||
8f0e1200000000000000504944564944,Acme,platform:Windows,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
|
||||
341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||
ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
||||
6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||
0d0f6e00000000000000504944564944,HORIPAD 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
6d0419c2000000000000504944564944,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||
88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
|
||||
4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Windows,
|
||||
25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows,
|
||||
4c05c405000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
||||
6d0418c2000000000000504944564944,Logitech RumblePad 2 USB,platform:Windows,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
36280100000000000000504944564944,OUYA Controller,platform:Windows,a:b0,b:b3,y:b2,x:b1,start:b14,guide:b15,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b8,dpleft:b10,dpdown:b9,dpright:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b12,righttrigger:b13,
|
||||
4f0400b3000000000000504944564944,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,platform:Windows,
|
||||
00f00300000000000000504944564944,RetroUSB.com RetroPad,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Windows,
|
||||
00f0f100000000000000504944564944,RetroUSB.com Super RetroPort,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Windows,
|
||||
28040140000000000000504944564944,GamePad Pro USB,platform:Windows,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,lefttrigger:b6,righttrigger:b7,
|
||||
ff113133000000000000504944564944,SVEN X-PAD,platform:Windows,a:b2,b:b3,y:b1,x:b0,start:b5,back:b4,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b8,righttrigger:b9,
|
||||
8f0e0300000000000000504944564944,Piranha xtreme,platform:Windows,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
|
||||
8f0e0d31000000000000504944564944,Multilaser JS071 USB,platform:Windows,a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
10080300000000000000504944564944,PS2 USB,platform:Windows,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a4,righty:a2,lefttrigger:b4,righttrigger:b5,
|
||||
79000600000000000000504944564944,G-Shark GS-GP702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
4b12014d000000000000504944564944,NYKO AIRFLO,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b10,start:b9,leftstick:a0,rightstick:a2,leftshoulder:a3,rightshoulder:b5,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:h0.6,lefty:h0.12,rightx:h0.9,righty:h0.4,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
d6206dca000000000000504944564944,PowerA Pro Ex,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
a3060cff000000000000504944564944,Saitek P2500,a:b2,b:b3,y:b1,x:b0,start:b4,guide:b10,back:b5,leftstick:b8,rightstick:b9,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Windows,
|
||||
4f0415b3000000000000504944564944,Thrustmaster Dual Analog 3.2,platform:Windows,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
6f0e1e01000000000000504944564944,Rock Candy Gamepad for PS3,platform:Windows,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,guide:b12,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
|
||||
83056020000000000000504944564944,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,y:b2,x:b3,start:b7,back:b6,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Windows,
|
||||
10080100000000000000504944564944,PS1 USB,platform:Windows,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftshoulder:b6,rightshoulder:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
|
||||
49190204000000000000504944564944,Ipega PG-9023,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b8,righttrigger:b9,platform:Windows,
|
||||
4f0423b3000000000000504944564944,Dual Trigger 3-in-1,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
0d0f4900000000000000504944564944,Hatsune Miku Sho Controller,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
79004318000000000000504944564944,Mayflash GameCube Controller Adapter,platform:Windows,a:b1,b:b2,x:b0,y:b3,back:b0,start:b9,guide:b0,leftshoulder:b4,rightshoulder:b7,leftstick:b0,rightstick:b0,leftx:a0,lefty:a1,rightx:a5,righty:a2,lefttrigger:a3,righttrigger:a4,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
|
||||
79000018000000000000504944564944,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
2509e803000000000000504944564944,Mayflash Wii Classic Controller,a:b1,b:b0,x:b3,y:b2,back:b8,guide:b10,start:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:b11,dpdown:b13,dpleft:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
|
||||
300f1001000000000000504944564944,Saitek P480 Rumble Pad,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b5,righttrigger:b7,platform:Windows,
|
||||
10280900000000000000504944564944,8Bitdo SFC30 GamePad,a:b1,b:b0,y:b3,x:b4,start:b11,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,platform:Windows,
|
||||
63252305000000000000504944564944,USB Vibration Joystick (BM),platform:Windows,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
20380900000000000000504944564944,8Bitdo NES30 PRO Wireless,platform:Windows,a:b0,b:b1,x:b3,y:b4,leftshoulder:b6,rightshoulder:b7,lefttrigger:b8,righttrigger:b9,back:b10,start:b11,leftstick:b13,rightstick:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,
|
||||
02200090000000000000504944564944,8Bitdo NES30 PRO USB,platform:Windows,a:b0,b:b1,x:b3,y:b4,leftshoulder:b6,rightshoulder:b7,lefttrigger:b8,righttrigger:b9,back:b10,start:b11,leftstick:b13,rightstick:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,
|
||||
ff113133000000000000504944564944,Gembird JPD-DualForce,platform:Windows,a:b2,b:b3,x:b0,y:b1,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,leftstick:b10,rightstick:b11,
|
||||
341a0108000000000000504944564944,EXEQ RF USB Gamepad 8206,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,leftstick:b8,rightstick:b7,back:b8,start:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Windows,
|
||||
c0111352000000000000504944564944,Battalife Joystick,platform:Windows,x:b4,a:b6,b:b7,y:b5,back:b2,start:b3,leftshoulder:b0,rightshoulder:b1,leftx:a0,lefty:a1,
|
||||
100801e5000000000000504944564944,NEXT Classic USB Game Controller,a:b0,b:b1,back:b8,start:b9,rightx:a2,righty:a3,leftx:a0,lefty:a1,platform:Windows,
|
||||
4c05cc09000000000000504944564944,Sony DualShock 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Windows,
|
||||
4c05a00b000000000000504944564944,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Windows,
|
||||
|
||||
# OS X
|
||||
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||
6d0400000000000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
6d0400000000000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
6d040000000000001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||
6d0400000000000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,
|
||||
4c05000000000000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||
891600000000000000fd000000000000,Razer Onza Tournament,a:b0,b:b1,y:b3,x:b2,start:b8,guide:b10,back:b9,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b11,dpleft:b13,dpdown:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Mac OS X,
|
||||
4f0400000000000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,platform:Mac OS X,
|
||||
8f0e0000000000000300000000000000,Piranha xtreme,platform:Mac OS X,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
|
||||
0d0f0000000000004d00000000000000,HORI Gem Pad 3,platform:Mac OS X,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
79000000000000000600000000000000,G-Shark GP-702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Mac OS X,
|
||||
4f0400000000000015b3000000000000,Thrustmaster Dual Analog 3.2,platform:Mac OS X,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
AD1B00000000000001F9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||
050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,y:b9,x:b10,start:b6,guide:b8,back:b7,dpup:b2,dpleft:b0,dpdown:b3,dpright:b1,leftx:a0,lefty:a1,lefttrigger:b12,righttrigger:,leftshoulder:b11,platform:Mac OS X,
|
||||
83050000000000006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Mac OS X,
|
||||
5e04000000000000dd02000000000000,Xbox One Wired Controller,platform:Mac OS X,x:b2,a:b0,b:b1,y:b3,back:b9,guide:b10,start:b8,dpleft:b13,dpdown:b12,dpright:b14,dpup:b11,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,x:b18,y:b17,back:b7,guide:b8,start:b6,leftstick:b23,rightstick:b24,leftshoulder:b19,rightshoulder:b20,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b21,righttrigger:b22,platform:Mac OS X,
|
||||
79000000000000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,x:b0,y:b12,back:b32,start:b36,leftstick:b40,rightstick:b44,leftshoulder:b16,rightshoulder:b20,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a4,rightx:a8,righty:a12,lefttrigger:b24,righttrigger:b28,platform:Mac OS X,
|
||||
2509000000000000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,x:b3,y:b2,back:b8,guide:b10,start:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:b11,dpdown:b13,dpleft:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Mac OS X,
|
||||
351200000000000021ab000000000000,SFC30 Joystick,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Mac OS X,
|
||||
b4040000000000000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,x:b3,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Mac OS X,
|
||||
10280000000000000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Mac OS X,
|
||||
d814000000000000cecf000000000000,MC Cthulhu,platform:Mac OS X,leftx:,lefty:,rightx:,righty:,lefttrigger:b6,a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,righttrigger:b7,
|
||||
0d0f0000000000006600000000000000,HORIPAD FPS PLUS 4,platform:Mac OS X,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:a4,
|
||||
5e04000000000000e002000000000000,Xbox Wireless Controller,platform:Mac OS X,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b10,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
79000000000000001100000000000000,Retrolink Classic Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a3,lefty:a4,platform:Mac OS X,
|
||||
4c05000000000000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Mac OS X,
|
||||
5e04000000000000ea02000000000000,Xbox Wireless Controller,platform:Mac OS X,x:b2,a:b0,b:b1,y:b3,back:b9,guide:b10,start:b8,dpleft:b13,dpdown:b12,dpright:b14,dpup:b11,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
81170000000000007e05000000000000,Sega Saturn,x:b0,a:b2,b:b4,y:b6,start:b13,dpleft:b15,dpdown:b16,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,lefttrigger:b10,rightshoulder:b9,righttrigger:a4,righttrigger:b11,leftx:a0,lefty:a2,platform:Mac OS X,
|
||||
bd1200000000000015d0000000000000,Tomee SNES USB Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Mac OS X,
|
||||
03000000632500002305000000010000,Redragon Saturn,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Mac OS X,
|
||||
|
||||
# Linux
|
||||
050000004c0500006802000000000000,Sony PLAYSTATION(R)3 Controller,platform:Linux,a:b14,b:b13,x:b15,y:b12,back:b0,guide:b16,start:b3,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpdown:b6,dpleft:b7,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a12,righttrigger:a13,
|
||||
03000000ff1100004133000010010000,GreenAsia Inc.USB Joystick,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
|
||||
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||
03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
|
||||
030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
|
||||
03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,platform:Linux,
|
||||
030000004c050000c405000011010000,Sony DualShock 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,platform:Linux,
|
||||
030000006f0e00003001000001010000,EA Sports PS3 Controller,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
03000000de280000ff11000001000000,Valve Streaming Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,y:b0,x:b3,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,platform:Linux,
|
||||
03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Linux,
|
||||
030000004f04000020b3000010010000,Thrustmaster 2 in 1 DT,a:b0,b:b2,y:b3,x:b1,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,platform:Linux,
|
||||
030000004f04000023b3000000010000,Thrustmaster Dual Trigger 3-in-1,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a5,
|
||||
030000008f0e00000300000010010000,GreenAsia Inc. USB Joystick ,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
|
||||
030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick ,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
|
||||
030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b11,dpdown:b14,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux,
|
||||
030000006d04000016c2000010010000,Logitech Logitech Dual Action,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
03000000260900008888000000010000,GameCube {WiseGroup USB box},a:b0,b:b2,y:b3,x:b1,start:b7,leftshoulder:,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,rightstick:,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,platform:Linux,
|
||||
030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,y:b4,x:b3,start:b8,guide:b5,back:b2,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b9,righttrigger:b10,platform:Linux,
|
||||
030000006d04000018c2000010010000,Logitech Logitech RumblePad 2 USB,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
05000000d6200000ad0d000001000000,Moga Pro,platform:Linux,a:b0,b:b1,y:b3,x:b2,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,
|
||||
030000004f04000009d0000000010000,Thrustmaster Run N Drive Wireless PS3,platform:Linux,a:b1,b:b2,x:b0,y:b3,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
030000004f04000008d0000000010000,Thrustmaster Run N Drive Wireless,platform:Linux,a:b1,b:b2,x:b0,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,
|
||||
0300000000f000000300000000010000,RetroUSB.com RetroPad,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Linux,
|
||||
0300000000f00000f100000000010000,RetroUSB.com Super RetroPort,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Linux,
|
||||
030000006f0e00001f01000000010000,Generic X-Box pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000280400000140000000010000,Gravis GamePad Pro USB ,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftx:a0,lefty:a1,
|
||||
030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),platform:Linux,x:b3,a:b0,b:b1,y:b4,back:b6,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:a2,rightshoulder:b2,righttrigger:a5,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000005e0400008502000000010000,Microsoft X-Box pad (Japan),platform:Linux,x:b3,a:b0,b:b1,y:b4,back:b6,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:a2,rightshoulder:b2,righttrigger:a5,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000006f0e00001e01000011010000,Rock Candy Gamepad for PS3,platform:Linux,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,guide:b12,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
|
||||
03000000250900000500000000010000,Sony PS2 pad with SmartJoy adapter,platform:Linux,a:b2,b:b1,y:b0,x:b3,start:b8,back:b9,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b4,righttrigger:b5,
|
||||
030000008916000000fd000024010000,Razer Onza Tournament,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b11,dpdown:b14,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux,
|
||||
030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,platform:Linux,
|
||||
03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux,
|
||||
050000004c050000c405000000010000,PS4 Controller (Bluetooth),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||
060000004c0500006802000000010000,PS3 Controller (Bluetooth),a:b14,b:b13,y:b12,x:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,platform:Linux,
|
||||
050000004c0500006802000000010000,PS3 Controller (Bluetooth),a:b14,b:b13,y:b12,x:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,platform:Linux,
|
||||
05000000504c415953544154494f4e00,PS3 Controller (Bluetooth),a:b14,b:b13,y:b12,x:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,platform:Linux,
|
||||
03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick ,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000666600000488000000010000,Super Joy Box 5 Pro,platform:Linux,a:b2,b:b1,x:b3,y:b0,back:b9,start:b8,leftshoulder:b6,rightshoulder:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b4,righttrigger:b5,dpup:b12,dpleft:b15,dpdown:b14,dpright:b13,
|
||||
05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,platform:Linux,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,
|
||||
05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,platform:Linux,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,
|
||||
030000008916000001fd000024010000,Razer Onza Classic Edition,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:b11,dpdown:b14,dpright:b12,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000005e040000d102000001010000,Microsoft X-Box One pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000005e040000dd02000003020000,Microsoft X-Box One pad v2,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,platform:Linux,
|
||||
03000000790000001100000010010000,RetroLink Saturn Classic Controller,platform:Linux,x:b3,a:b0,b:b1,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,
|
||||
050000007e0500003003000001000000,Nintendo Wii U Pro Controller,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b8,start:b9,guide:b10,leftshoulder:b4,rightshoulder:b5,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:b13,dpleft:b15,dpdown:b14,dpright:b16,
|
||||
030000005e0400008e02000004010000,Microsoft X-Box 360 pad,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,guide:b8,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
|
||||
030000000d0f00002200000011010000,HORI CO. LTD. REAL ARCADE Pro.V3,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,
|
||||
030000000d0f00001000000011010000,HORI CO. LTD. FIGHTING STICK 3,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7
|
||||
03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
03000000f0250000c283000010010000,Goodbetterbest Ltd PC USB Controller,platform:Linux,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7
|
||||
0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),platform:Linux,a:b0,b:b1,x:b2,y:b3,start:b7,back:b6,guide:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,lefttrigger:a5,righttrigger:a4,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Linux,
|
||||
030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000006f0e00001304000000010000,Generic X-Box pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:a0,rightstick:a3,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000830500006020000010010000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Linux,
|
||||
03000000c9110000f055000011010000,HJC Game GAMEPAD,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b11,rightshoulder:b5,rightx:a2,start:b9,righty:a3,dpleft:h0.8,lefttrigger:b6,x:b2,dpup:h0.1,back:b8,leftstick:b10,leftshoulder:b4,y:b3,a:b0,dpright:h0.2,righttrigger:b7,b:b1,platform:Linux,
|
||||
03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,y:b3,x:b0,start:b12,guide:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,platform:Linux,
|
||||
03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,y:b3,x:b0,start:b9,guide:,back:,leftstick:,rightstick:,leftshoulder:,dpleft:b15,dpdown:b14,dpright:b13,leftx:a0,lefty:a1,rightx:a5,righty:a2,lefttrigger:a3,righttrigger:a4,rightshoulder:b7,dpup:b12,platform:Linux,
|
||||
030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,platform:Linux,x:b0,a:b2,b:b3,y:b1,back:b10,guide:b12,start:b11,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
030000006f0e00004601000001010000,Rock Candy Wired Controller for Xbox One,platform:Linux,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,guide:b8,leftstick:b9,rightstick:b10,lefttrigger:a2,righttrigger:a5,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000380700001647000010040000,Mad Catz Wired Xbox 360 Controller,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000006f0e00003901000020060000,Afterglow Wired Controller for Xbox One,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,platform:Linux,
|
||||
030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,platform:Linux,a:b0,b:b2,x:b1,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,
|
||||
05000000102800000900000000010000,8Bitdo SFC30 GamePad,platform:Linux,x:b4,a:b1,b:b0,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,
|
||||
03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b12,guide:b9,back:b8,leftshoulder:b4,rightshoulder:b5,lefttrigger:b6,righttrigger:b7,leftx:a0,lefty:a1,
|
||||
030000000d0f00000d00000000010000,hori,platform:Linux,a:b0,b:b6,y:b2,x:b1,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,start:b9,guide:b10,back:b8,leftshoulder:b3,rightshoulder:b7,leftx:b4,lefty:b5,
|
||||
030000000d0f00006700000001010000,HORIPAD ONE,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,guide:b8,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
|
||||
03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,platform:Linux,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,
|
||||
03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,platform:Linux,a:b0,b:b1,y:b2,x:b3,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,lefttrigger:b6,righttrigger:b7,
|
||||
03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),platform:Linux,a:b3,b:b4,y:b1,x:b0,start:b7,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,
|
||||
05000000010000000100000003000000,Nintendo Wiimote,platform:Linux,a:b0,b:b1,y:b3,x:b2,start:b9,guide:b10,back:b8,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
030000005e0400008e02000062230000,Microsoft X-Box 360 pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,y:b1,x:b0,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b6,righttrigger:b7,platform:Linux,
|
||||
030000006f0e00000103000000020000,Logic3 Controller,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
05000000380700006652000025010000,Mad Catz C.T.R.L.R ,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
06000000adde0000efbe000002010000,Hidromancer Game Controller,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000c01600008704000011010000,Serial/Keyboard/Mouse/Joystick,platform:Linux,a:b12,b:b10,x:b13,y:b11,back:b4,start:b5,leftstick:b14,rightstick:b15,leftshoulder:b9,rightshoulder:b8,dpup:b0,dpdown:b2,dpleft:b3,dpright:b1,leftx:a1,lefty:a0,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
05000000a00500003232000001000000,8Bitdo Zero GamePad,platform:Linux,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,
|
||||
03000000780000000600000010010000,Microntek USB Joystick,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftx:a0,lefty:a1,
|
||||
03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,platform:Linux,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,lefttrigger:a2,righttrigger:a5,
|
||||
03000000100800000300000010010000,USB Gamepad,platform:Linux,a:b2,b:b1,x:b3,y:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,
|
||||
030000005e0400008e02000073050000,Speedlink TORID Wireless Gamepad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000001008000001e5000010010000,NEXT Classic USB Game Controller,a:b0,b:b1,back:b8,start:b9,rightx:a2,righty:a3,leftx:a0,lefty:a1,platform:Linux,
|
||||
030000006d04000016c2000011010000,Logitech F310 Gamepad (DInput),x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Linux,
|
||||
03000000bd12000015d0000010010000,Tomee SNES USB Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Linux,
|
||||
050000004c050000cc09000000010000,Sony DualShock 4 V2 BT,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Linux,
|
||||
030000004c050000a00b000011010000,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Linux,
|
||||
05000000ac0500003232000001000000,VR-BOX,platform:Linux,a:b0,b:b1,x:b2,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,
|
||||
030000004c050000cc09000011010000,Sony DualShock 4 V2,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Linux,
|
||||
030000004c050000cc09000011810000,Sony Interactive Entertainment Wireless Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
050000004c050000cc09000000810000,Wireless Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
030000004c0500006802000011810000,Sony PLAYSTATION(R)3 Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
050000004c0500006802000000810000,PLAYSTATION(R)3 Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
03000000c82d00000190000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,platform:Linux,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,
|
||||
05000000c82d00002038000000010000,8Bitdo NES30 Pro,platform:Linux,a:b1,b:b0,x:b4,y:b3,back:b10,guide:b2,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,
|
||||
030000005e040000a102000000010000,Xbox 360 Wireless Receiver,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpdown:b14,dpleft:b11,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,
|
||||
050000004c050000cc09000001000000,Sony DualShock 4 V2 BT,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Linux,
|
||||
03000000bc2000006412000011010000,BETOP CONTROLLER,a:b2,b:b1,y:b0,x:b3,start:b9,guide:b30,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Linux,
|
||||
05000000c82d00000161000000010000,8Bitdo SN30 Pro,platform:Linux,a:b1,b:b0,x:b4,y:b3,back:b10,guide:b2,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,
|
||||
03000000380700008532000010010000,MadCatz Madcatz Fightpad,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,lefttrigger:b5,righttrigger:b7,
|
||||
030000000d0f0000ee00000011010000,HORI CO.,LTD. HORIPAD mini4,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
030000000d0f0000c100000011010000,HORI CO.,LTD. HORIPAD S,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
|
||||
03000000ad1b000003f5000033050000,Hori Fighting Stick VX,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b10,start:b9,leftshoulder:b4,rightshoulder:b5,-leftx:h0.8,+leftx:h0.2,-lefty:h0.1,+lefty:h0.4,lefttrigger:b6,righttrigger:b7,
|
||||
03000000c82d00000260000011010000,8Bitdo SF30 Pro 8BitDo SN30 Pro+,platform:Linux,a:b1,b:b0,x:b4,y:b3,back:b10,guide:b2,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,
|
||||
060000007e0500000820000000000000,Nintendo Switch Combined Joy-Cons,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b9,guide:b11,start:b10,leftstick:b12,rightstick:b13,leftshoulder:b5,rightshoulder:b6,dpup:b14,dpdown:b15,dpleft:b16,dpright:b17,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b7,righttrigger:b8,
|
|
@ -52,8 +52,7 @@ CAnimBlendHierarchy::RemoveQuaternionFlips(void)
|
|||
void
|
||||
CAnimBlendHierarchy::RemoveAnimSequences(void)
|
||||
{
|
||||
if(sequences)
|
||||
delete[] sequences;
|
||||
delete[] sequences;
|
||||
numSequences = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public:
|
|||
char name[24];
|
||||
CAnimBlendSequence *sequences;
|
||||
int16 numSequences;
|
||||
int16 compressed; // not really used
|
||||
int16 compressed;
|
||||
float totalLength;
|
||||
CLink<CAnimBlendHierarchy*> *linkPtr;
|
||||
|
||||
|
|
|
@ -16,9 +16,10 @@ CAnimBlendSequence::CAnimBlendSequence(void)
|
|||
|
||||
CAnimBlendSequence::~CAnimBlendSequence(void)
|
||||
{
|
||||
assert(keyFramesCompressed == nil);
|
||||
if(keyFrames)
|
||||
RwFree(keyFrames);
|
||||
if(keyFramesCompressed)
|
||||
RwFree(keyFramesCompressed);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -841,54 +841,57 @@ CAnimManager::LoadAnimFile(int fd, bool compress)
|
|||
ROUNDSIZE(anim.size);
|
||||
CFileMgr::Read(fd, buf, anim.size);
|
||||
int numFrames = *(int*)(buf+28);
|
||||
seq->SetName(buf);
|
||||
#ifdef PED_SKIN
|
||||
if(anim.size == 44)
|
||||
seq->SetBoneTag(*(int*)(buf+40));
|
||||
#endif
|
||||
seq->SetName(buf);
|
||||
if(numFrames == 0)
|
||||
continue;
|
||||
|
||||
bool hasScale = false;
|
||||
bool hasTranslation = false;
|
||||
CFileMgr::Read(fd, (char*)&info, sizeof(info));
|
||||
if(strncmp(info.ident, "KR00", 4) == 0){
|
||||
seq->SetNumFrames(numFrames, false);
|
||||
KeyFrame *kf = seq->GetKeyFrame(0);
|
||||
for(l = 0; l < numFrames; l++, kf++){
|
||||
CFileMgr::Read(fd, buf, 0x14);
|
||||
kf->rotation.x = -fbuf[0];
|
||||
kf->rotation.y = -fbuf[1];
|
||||
kf->rotation.z = -fbuf[2];
|
||||
kf->rotation.w = fbuf[3];
|
||||
kf->deltaTime = fbuf[4]; // absolute time here
|
||||
}
|
||||
if(strncmp(info.ident, "KRTS", 4) == 0){
|
||||
hasScale = true;
|
||||
seq->SetNumFrames(numFrames, true);
|
||||
}else if(strncmp(info.ident, "KRT0", 4) == 0){
|
||||
hasTranslation = true;
|
||||
seq->SetNumFrames(numFrames, true);
|
||||
KeyFrameTrans *kf = (KeyFrameTrans*)seq->GetKeyFrame(0);
|
||||
for(l = 0; l < numFrames; l++, kf++){
|
||||
CFileMgr::Read(fd, buf, 0x20);
|
||||
kf->rotation.x = -fbuf[0];
|
||||
kf->rotation.y = -fbuf[1];
|
||||
kf->rotation.z = -fbuf[2];
|
||||
kf->rotation.w = fbuf[3];
|
||||
kf->translation.x = fbuf[4];
|
||||
kf->translation.y = fbuf[5];
|
||||
kf->translation.z = fbuf[6];
|
||||
kf->deltaTime = fbuf[7]; // absolute time here
|
||||
}
|
||||
}else if(strncmp(info.ident, "KRTS", 4) == 0){
|
||||
seq->SetNumFrames(numFrames, true);
|
||||
KeyFrameTrans *kf = (KeyFrameTrans*)seq->GetKeyFrame(0);
|
||||
for(l = 0; l < numFrames; l++, kf++){
|
||||
}else if(strncmp(info.ident, "KR00", 4) == 0){
|
||||
seq->SetNumFrames(numFrames, false);
|
||||
}
|
||||
|
||||
for(l = 0; l < numFrames; l++){
|
||||
if(hasScale){
|
||||
CFileMgr::Read(fd, buf, 0x2C);
|
||||
kf->rotation.x = -fbuf[0];
|
||||
kf->rotation.y = -fbuf[1];
|
||||
kf->rotation.z = -fbuf[2];
|
||||
kf->rotation.w = fbuf[3];
|
||||
kf->translation.x = fbuf[4];
|
||||
kf->translation.y = fbuf[5];
|
||||
kf->translation.z = fbuf[6];
|
||||
CQuaternion rot(fbuf[0], fbuf[1], fbuf[2], fbuf[3]);
|
||||
rot.Invert();
|
||||
CVector trans(fbuf[4], fbuf[5], fbuf[6]);
|
||||
|
||||
KeyFrameTrans *kf = (KeyFrameTrans*)seq->GetKeyFrame(l);
|
||||
kf->rotation = rot;
|
||||
kf->translation = trans;
|
||||
// scaling ignored
|
||||
kf->deltaTime = fbuf[10]; // absolute time here
|
||||
}else if(hasTranslation){
|
||||
CFileMgr::Read(fd, buf, 0x20);
|
||||
CQuaternion rot(fbuf[0], fbuf[1], fbuf[2], fbuf[3]);
|
||||
rot.Invert();
|
||||
CVector trans(fbuf[4], fbuf[5], fbuf[6]);
|
||||
|
||||
KeyFrameTrans *kf = (KeyFrameTrans*)seq->GetKeyFrame(l);
|
||||
kf->rotation = rot;
|
||||
kf->translation = trans;
|
||||
kf->deltaTime = fbuf[7]; // absolute time here
|
||||
}else{
|
||||
CFileMgr::Read(fd, buf, 0x14);
|
||||
CQuaternion rot(fbuf[0], fbuf[1], fbuf[2], fbuf[3]);
|
||||
rot.Invert();
|
||||
|
||||
KeyFrame *kf = (KeyFrame*)seq->GetKeyFrame(l);
|
||||
kf->rotation = rot;
|
||||
kf->deltaTime = fbuf[4]; // absolute time here
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "AnimBlendClumpData.h"
|
||||
#include "AnimBlendHierarchy.h"
|
||||
#include "AnimBlendAssociation.h"
|
||||
#include "AnimManager.h"
|
||||
#include "RpAnimBlend.h"
|
||||
#ifdef PED_SKIN
|
||||
#include "PedModelInfo.h"
|
||||
|
@ -441,7 +442,7 @@ RpAnimBlendClumpUpdateAnimations(RpClump *clump, float timeDelta)
|
|||
next = link->next;
|
||||
CAnimBlendAssociation *assoc = CAnimBlendAssociation::FromLink(link);
|
||||
if(assoc->UpdateBlend(timeDelta)){
|
||||
// CAnimManager::UncompressAnimation(v6->hierarchy)
|
||||
CAnimManager::UncompressAnimation(assoc->hierarchy);
|
||||
updateData.nodes[i++] = assoc->GetNode(0);
|
||||
if(assoc->flags & ASSOC_MOVEMENT){
|
||||
totalLength += assoc->hierarchy->totalLength/assoc->speed * assoc->blendAmount;
|
||||
|
|
|
@ -52,8 +52,8 @@ uint32 gHomeNextTime;
|
|||
uint32 gCellNextTime;
|
||||
uint32 gNextCryTime;
|
||||
|
||||
enum PLAY_STATUS : uint8 { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED };
|
||||
enum LOADING_STATUS : uint8 { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED };
|
||||
enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED };
|
||||
enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED };
|
||||
|
||||
void
|
||||
cAudioManager::PreInitialiseGameSpecificSetup() const
|
||||
|
@ -8121,7 +8121,7 @@ cAudioManager::ProcessGarages()
|
|||
const float SOUND_INTENSITY = 80.0f;
|
||||
|
||||
CEntity *entity;
|
||||
eGarageState state;
|
||||
uint8 state;
|
||||
uint32 sampleIndex;
|
||||
uint8 j;
|
||||
float distSquared;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "common.h"
|
||||
|
||||
enum eSfxSample : uint32
|
||||
enum eSfxSample
|
||||
{
|
||||
SFX_CAR_HORN_JEEP = 0,
|
||||
SFX_CAR_HORN_BMW328,
|
||||
|
|
|
@ -235,7 +235,7 @@ enum AudioEntityHandle {
|
|||
AEHANDLE_ERROR_BADAUDIOTYPE = -1,
|
||||
};
|
||||
|
||||
enum eAudioType : int32
|
||||
enum eAudioType
|
||||
{
|
||||
AUDIOTYPE_PHYSICAL = 0,
|
||||
AUDIOTYPE_EXPLOSION,
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
|
||||
#ifdef AUDIO_OAL
|
||||
|
||||
/*
|
||||
* When linking to a static openal-soft library,
|
||||
* the extension function inside the openal library conflict with the variables here.
|
||||
* Therefore declare these re3 owned symbols in a private namespace.
|
||||
*/
|
||||
|
||||
namespace re3_openal {
|
||||
|
||||
LPALGENEFFECTS alGenEffects;
|
||||
LPALDELETEEFFECTS alDeleteEffects;
|
||||
LPALISEFFECT alIsEffect;
|
||||
|
@ -37,6 +45,9 @@ LPALGETFILTERIV alGetFilteriv;
|
|||
LPALGETFILTERF alGetFilterf;
|
||||
LPALGETFILTERFV alGetFilterfv;
|
||||
|
||||
}
|
||||
|
||||
using namespace re3_openal;
|
||||
|
||||
void EFXInit()
|
||||
{
|
||||
|
|
|
@ -11,6 +11,8 @@ void EFX_Set(ALuint effect, const EAXLISTENERPROPERTIES *props);
|
|||
void EAX3_SetReverbMix(ALuint filter, float mix);
|
||||
void SetEffectsLevel(ALuint uiFilter, float level);
|
||||
|
||||
namespace re3_openal {
|
||||
|
||||
extern LPALGENEFFECTS alGenEffects;
|
||||
extern LPALDELETEEFFECTS alDeleteEffects;
|
||||
extern LPALISEFFECT alIsEffect;
|
||||
|
@ -44,4 +46,9 @@ extern LPALGETFILTERI alGetFilteri;
|
|||
extern LPALGETFILTERIV alGetFilteriv;
|
||||
extern LPALGETFILTERF alGetFilterf;
|
||||
extern LPALGETFILTERFV alGetFilterfv;
|
||||
|
||||
}
|
||||
|
||||
using namespace re3_openal;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum eSound : uint16
|
||||
enum eSound
|
||||
{
|
||||
SOUND_CAR_DOOR_CLOSE_BONNET = 0,
|
||||
SOUND_CAR_DOOR_CLOSE_BUMPER,
|
||||
|
@ -173,7 +173,7 @@ enum eSound : uint16
|
|||
};
|
||||
|
||||
|
||||
enum eScriptSounds : uint16 {
|
||||
enum eScriptSounds {
|
||||
SCRIPT_SOUND_0 = 0,
|
||||
SCRIPT_SOUND_1,
|
||||
SCRIPT_SOUND_2,
|
||||
|
|
|
@ -665,7 +665,7 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
|
|||
// transform line to model space
|
||||
Invert(matrix, matTransform);
|
||||
CVuVector newline[2];
|
||||
TransformPoints(newline, 2, matTransform, (RwV3d*)&line.p0, sizeof(CColLine)/2);
|
||||
TransformPoints(newline, 2, matTransform, &line.p0, sizeof(CColLine)/2);
|
||||
|
||||
// If we don't intersect with the bounding box, no chance on the rest
|
||||
if(!TestLineBox(*(CColLine*)newline, model.boundingBox))
|
||||
|
@ -1474,7 +1474,7 @@ CCollision::ProcessLineOfSight(const CColLine &line,
|
|||
// transform line to model space
|
||||
Invert(matrix, matTransform);
|
||||
CVuVector newline[2];
|
||||
TransformPoints(newline, 2, matTransform, (RwV3d*)&line.p0, sizeof(CColLine)/2);
|
||||
TransformPoints(newline, 2, matTransform, &line.p0, sizeof(CColLine)/2);
|
||||
|
||||
if(mindist < 1.0f)
|
||||
newline[1] = newline[0] + (newline[1] - newline[0])*mindist;
|
||||
|
@ -1606,7 +1606,7 @@ CCollision::ProcessVerticalLine(const CColLine &line,
|
|||
// transform line to model space
|
||||
Invert(matrix, matTransform);
|
||||
CVuVector newline[2];
|
||||
TransformPoints(newline, 2, matTransform, (RwV3d*)&line.p0, sizeof(CColLine)/2);
|
||||
TransformPoints(newline, 2, matTransform, &line.p0, sizeof(CColLine)/2);
|
||||
|
||||
if(mindist < 1.0f)
|
||||
newline[1] = newline[0] + (newline[1] - newline[0])*mindist;
|
||||
|
@ -1806,16 +1806,16 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||
matAB *= matrixA;
|
||||
|
||||
CVuVector bsphereAB; // bounding sphere of A in B space
|
||||
TransformPoint(bsphereAB, matAB, *(RwV3d*)modelA.boundingSphere.center); // inlined
|
||||
TransformPoint(bsphereAB, matAB, modelA.boundingSphere.center); // inlined
|
||||
bsphereAB.w = modelA.boundingSphere.radius;
|
||||
if(!TestSphereBox(*(CColSphere*)&bsphereAB, modelB.boundingBox))
|
||||
return 0;
|
||||
|
||||
// transform modelA's spheres and lines to B space
|
||||
TransformPoints(aSpheresA, modelA.numSpheres, matAB, (RwV3d*)&modelA.spheres->center, sizeof(CColSphere));
|
||||
TransformPoints(aSpheresA, modelA.numSpheres, matAB, &modelA.spheres->center, sizeof(CColSphere));
|
||||
for(i = 0; i < modelA.numSpheres; i++)
|
||||
aSpheresA[i].w = modelA.spheres[i].radius;
|
||||
TransformPoints(aLinesA, modelA.numLines*2, matAB, (RwV3d*)&modelA.lines->p0, sizeof(CColLine)/2);
|
||||
TransformPoints(aLinesA, modelA.numLines*2, matAB, &modelA.lines->p0, sizeof(CColLine)/2);
|
||||
|
||||
// Test them against model B's bounding volumes
|
||||
int numSpheresA = 0;
|
||||
|
@ -1832,7 +1832,7 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||
matBA *= matrixB;
|
||||
|
||||
// transform modelB's spheres to A space
|
||||
TransformPoints(aSpheresB, modelB.numSpheres, matBA, (RwV3d*)&modelB.spheres->center, sizeof(CColSphere));
|
||||
TransformPoints(aSpheresB, modelB.numSpheres, matBA, &modelB.spheres->center, sizeof(CColSphere));
|
||||
for(i = 0; i < modelB.numSpheres; i++)
|
||||
aSpheresB[i].w = modelB.spheres[i].radius;
|
||||
|
||||
|
|
|
@ -103,9 +103,9 @@ void CAutoPilot::Load(uint8*& buf)
|
|||
m_nNextDirection = ReadSaveBuf<int8>(buf);
|
||||
m_nCurrentLane = ReadSaveBuf<int8>(buf);
|
||||
m_nNextLane = ReadSaveBuf<int8>(buf);
|
||||
m_nDrivingStyle = (eCarDrivingStyle)ReadSaveBuf<uint8>(buf);
|
||||
m_nCarMission = (eCarMission)ReadSaveBuf<uint8>(buf);
|
||||
m_nTempAction = (eCarTempAction)ReadSaveBuf<uint8>(buf);
|
||||
m_nDrivingStyle = ReadSaveBuf<uint8>(buf);
|
||||
m_nCarMission = ReadSaveBuf<uint8>(buf);
|
||||
m_nTempAction = ReadSaveBuf<uint8>(buf);
|
||||
m_nTimeTempAction = ReadSaveBuf<uint32>(buf);
|
||||
m_fMaxTrafficSpeed = ReadSaveBuf<float>(buf);
|
||||
m_nCruiseSpeed = ReadSaveBuf<uint8>(buf);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
class CVehicle;
|
||||
struct CPathNode;
|
||||
|
||||
enum eCarMission : uint8
|
||||
enum eCarMission
|
||||
{
|
||||
MISSION_NONE,
|
||||
MISSION_CRUISE,
|
||||
|
@ -28,7 +28,7 @@ enum eCarMission : uint8
|
|||
MISSION_BLOCKCAR_HANDBRAKESTOP,
|
||||
};
|
||||
|
||||
enum eCarTempAction : uint8
|
||||
enum eCarTempAction
|
||||
{
|
||||
TEMPACT_NONE,
|
||||
TEMPACT_WAIT,
|
||||
|
@ -43,7 +43,7 @@ enum eCarTempAction : uint8
|
|||
TEMPACT_SWERVERIGHT
|
||||
};
|
||||
|
||||
enum eCarDrivingStyle : uint8
|
||||
enum eCarDrivingStyle
|
||||
{
|
||||
DRIVINGSTYLE_STOP_FOR_CARS,
|
||||
DRIVINGSTYLE_SLOW_DOWN_FOR_CARS,
|
||||
|
@ -69,9 +69,9 @@ public:
|
|||
int8 m_nNextDirection;
|
||||
int8 m_nCurrentLane;
|
||||
int8 m_nNextLane;
|
||||
eCarDrivingStyle m_nDrivingStyle;
|
||||
eCarMission m_nCarMission;
|
||||
eCarTempAction m_nTempAction;
|
||||
uint8 m_nDrivingStyle;
|
||||
uint8 m_nCarMission;
|
||||
uint8 m_nTempAction;
|
||||
uint32 m_nTimeTempAction;
|
||||
float m_fMaxTrafficSpeed;
|
||||
uint8 m_nCruiseSpeed;
|
||||
|
|
|
@ -539,7 +539,7 @@ void CCarAI::TellCarToBlockOtherCar(CVehicle* pVehicle, CVehicle* pTarget)
|
|||
pVehicle->AutoPilot.m_nCruiseSpeed = Max(6, pVehicle->AutoPilot.m_nCruiseSpeed);
|
||||
}
|
||||
|
||||
eCarMission CCarAI::FindPoliceCarMissionForWantedLevel()
|
||||
uint8 CCarAI::FindPoliceCarMissionForWantedLevel()
|
||||
{
|
||||
switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel){
|
||||
case 0:
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
static void TellOccupantsToLeaveCar(CVehicle*);
|
||||
static void TellCarToRamOtherCar(CVehicle*, CVehicle*);
|
||||
static void TellCarToBlockOtherCar(CVehicle*, CVehicle*);
|
||||
static eCarMission FindPoliceCarMissionForWantedLevel();
|
||||
static uint8 FindPoliceCarMissionForWantedLevel();
|
||||
static int32 FindPoliceCarSpeedForWantedLevel(CVehicle*);
|
||||
static void MellowOutChaseSpeed(CVehicle*);
|
||||
static void MakeWayForCarWithSiren(CVehicle *veh);
|
||||
|
|
|
@ -408,11 +408,6 @@ CCarCtrl::GenerateOneRandomCar()
|
|||
float directionNextLinkX;
|
||||
float directionNextLinkY;
|
||||
if (positionBetweenNodes < 0.5f) {
|
||||
float currentPathLinkForwardX = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirX();
|
||||
float currentPathLinkForwardY = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirY();
|
||||
float nextPathLinkForwardX = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirX();
|
||||
float nextPathLinkForwardY = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirY();
|
||||
|
||||
pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo];
|
||||
pNextLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo];
|
||||
positionOnCurrentLinkIncludingLane = CVector(
|
||||
|
@ -442,11 +437,6 @@ CCarCtrl::GenerateOneRandomCar()
|
|||
pVehicle->AutoPilot.m_nTimeEnteredCurve = CTimer::GetTimeInMilliseconds() -
|
||||
(uint32)((positionBetweenNodes - 0.5f) * pVehicle->AutoPilot.m_nTimeToSpendOnCurrentCurve);
|
||||
|
||||
float currentPathLinkForwardX = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirX();
|
||||
float currentPathLinkForwardY = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirY();
|
||||
float nextPathLinkForwardX = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirX();
|
||||
float nextPathLinkForwardY = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirY();
|
||||
|
||||
pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo];
|
||||
pNextLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo];
|
||||
positionOnCurrentLinkIncludingLane = CVector(
|
||||
|
@ -2348,7 +2338,11 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
|
|||
switch (pVehicle->AutoPilot.m_nDrivingStyle) {
|
||||
case DRIVINGSTYLE_STOP_FOR_CARS:
|
||||
case DRIVINGSTYLE_SLOW_DOWN_FOR_CARS:
|
||||
speedStyleMultiplier = FindMaximumSpeedForThisCarInTraffic(pVehicle) / pVehicle->AutoPilot.m_nCruiseSpeed;
|
||||
speedStyleMultiplier = FindMaximumSpeedForThisCarInTraffic(pVehicle);
|
||||
#ifdef FIX_BUGS
|
||||
if (pVehicle->AutoPilot.m_nCruiseSpeed != 0)
|
||||
#endif
|
||||
speedStyleMultiplier /= pVehicle->AutoPilot.m_nCruiseSpeed;
|
||||
break;
|
||||
default:
|
||||
speedStyleMultiplier = 1.0f;
|
||||
|
|
|
@ -179,10 +179,8 @@ void CGarages::Shutdown(void)
|
|||
void CGarages::Update(void)
|
||||
{
|
||||
static int GarageToBeTidied = 0;
|
||||
#ifndef GTA_PS2
|
||||
if (CReplay::IsPlayingBack())
|
||||
return;
|
||||
#endif
|
||||
bCamShouldBeOutisde = false;
|
||||
TheCamera.pToGarageWeAreIn = nil;
|
||||
TheCamera.pToGarageWeAreInForHackAvoidFirstPerson = nil;
|
||||
|
@ -202,7 +200,7 @@ void CGarages::Update(void)
|
|||
aGarages[GarageToBeTidied].TidyUpGarage();
|
||||
}
|
||||
|
||||
int16 CGarages::AddOne(CVector p1, CVector p2, eGarageType type, int32 targetId)
|
||||
int16 CGarages::AddOne(CVector p1, CVector p2, uint8 type, int32 targetId)
|
||||
{
|
||||
if (NumGarages >= NUM_GARAGES) {
|
||||
assert(0);
|
||||
|
@ -285,7 +283,7 @@ int16 CGarages::AddOne(CVector p1, CVector p2, eGarageType type, int32 targetId)
|
|||
return NumGarages++;
|
||||
}
|
||||
|
||||
void CGarages::ChangeGarageType(int16 garage, eGarageType type, int32 mi)
|
||||
void CGarages::ChangeGarageType(int16 garage, uint8 type, int32 mi)
|
||||
{
|
||||
CGarage* pGarage = &aGarages[garage];
|
||||
pGarage->m_eGarageType = type;
|
||||
|
@ -2198,7 +2196,7 @@ void CGarages::CloseHideOutGaragesBeforeSave()
|
|||
}
|
||||
}
|
||||
|
||||
int32 CGarages::CountCarsInHideoutGarage(eGarageType type)
|
||||
int32 CGarages::CountCarsInHideoutGarage(uint8 type)
|
||||
{
|
||||
int32 total = 0;
|
||||
for (int i = 0; i < NUM_GARAGE_STORED_CARS; i++) {
|
||||
|
@ -2218,7 +2216,7 @@ int32 CGarages::CountCarsInHideoutGarage(eGarageType type)
|
|||
return total;
|
||||
}
|
||||
|
||||
int32 CGarages::FindMaxNumStoredCarsForGarage(eGarageType type)
|
||||
int32 CGarages::FindMaxNumStoredCarsForGarage(uint8 type)
|
||||
{
|
||||
switch (type) {
|
||||
case GARAGE_HIDEOUT_ONE:
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class CVehicle;
|
||||
class CCamera;
|
||||
|
||||
enum eGarageState : int8
|
||||
enum eGarageState
|
||||
{
|
||||
GS_FULLYCLOSED,
|
||||
GS_OPENED,
|
||||
|
@ -18,7 +18,7 @@ enum eGarageState : int8
|
|||
GS_AFTERDROPOFF,
|
||||
};
|
||||
|
||||
enum eGarageType : int8
|
||||
enum eGarageType
|
||||
{
|
||||
GARAGE_NONE,
|
||||
GARAGE_MISSION,
|
||||
|
@ -81,8 +81,8 @@ VALIDATE_SIZE(CStoredCar, 0x28);
|
|||
|
||||
class CGarage
|
||||
{
|
||||
eGarageType m_eGarageType;
|
||||
eGarageState m_eGarageState;
|
||||
uint8 m_eGarageType;
|
||||
uint8 m_eGarageState;
|
||||
bool field_2; // unused
|
||||
bool m_bClosingWithoutTargetCar;
|
||||
bool m_bDeactivated;
|
||||
|
@ -207,8 +207,8 @@ public:
|
|||
#endif
|
||||
static void Update(void);
|
||||
|
||||
static int16 AddOne(CVector pos1, CVector pos2, eGarageType type, int32 targetId);
|
||||
static void ChangeGarageType(int16, eGarageType, int32);
|
||||
static int16 AddOne(CVector pos1, CVector pos2, uint8 type, int32 targetId);
|
||||
static void ChangeGarageType(int16, uint8, int32);
|
||||
static void PrintMessages(void);
|
||||
static void TriggerMessage(const char* text, int16, uint16 time, int16);
|
||||
static void SetTargetCarForMissonGarage(int16, CVehicle*);
|
||||
|
@ -244,11 +244,14 @@ private:
|
|||
static bool IsCarSprayable(CVehicle*);
|
||||
static float FindDoorHeightForMI(int32);
|
||||
static void CloseHideOutGaragesBeforeSave(void);
|
||||
static int32 CountCarsInHideoutGarage(eGarageType);
|
||||
static int32 FindMaxNumStoredCarsForGarage(eGarageType);
|
||||
static int32 GetBombTypeForGarageType(eGarageType type) { return type - GARAGE_BOMBSHOP1 + 1; }
|
||||
static int32 GetCarsCollectedIndexForGarageType(eGarageType type) { return type - GARAGE_COLLECTCARS_1; }
|
||||
static int32 CountCarsInHideoutGarage(uint8);
|
||||
static int32 FindMaxNumStoredCarsForGarage(uint8);
|
||||
static int32 GetBombTypeForGarageType(uint8 type) { return type - GARAGE_BOMBSHOP1 + 1; }
|
||||
static int32 GetCarsCollectedIndexForGarageType(uint8 type) { return type - GARAGE_COLLECTCARS_1; }
|
||||
|
||||
friend class cAudioManager;
|
||||
friend class CGarage;
|
||||
#ifdef FIX_BUGS
|
||||
friend class CReplay;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -67,7 +67,7 @@ CPhoneInfo::Update(void)
|
|||
} else {
|
||||
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PHONE);
|
||||
if (player->m_nPedState == PED_MAKE_CALL)
|
||||
player->m_nPedState = PED_IDLE;
|
||||
player->SetPedState(PED_IDLE);
|
||||
}
|
||||
}
|
||||
bool notInCar;
|
||||
|
@ -114,7 +114,7 @@ CPhoneInfo::Update(void)
|
|||
player->m_fRotationCur = angleToFace;
|
||||
player->m_fRotationDest = angleToFace;
|
||||
player->SetHeading(angleToFace);
|
||||
player->m_nPedState = PED_MAKE_CALL;
|
||||
player->SetPedState(PED_MAKE_CALL);
|
||||
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE);
|
||||
TheCamera.SetWideScreenOn();
|
||||
playerInfo->MakePlayerSafe(true);
|
||||
|
@ -412,7 +412,7 @@ PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg)
|
|||
ped->bUpdateAnimHeading = true;
|
||||
|
||||
if (ped->m_nPedState == PED_MAKE_CALL)
|
||||
ped->m_nPedState = PED_IDLE;
|
||||
ped->SetPedState(PED_IDLE);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -535,7 +535,7 @@ CPickups::GenerateNewOne(CVector pos, uint32 modelIndex, uint8 type, uint32 quan
|
|||
|
||||
if (slot >= NUMPICKUPS) return -1;
|
||||
|
||||
aPickUps[slot].m_eType = (ePickupType)type;
|
||||
aPickUps[slot].m_eType = type;
|
||||
aPickUps[slot].m_bRemoved = false;
|
||||
aPickUps[slot].m_nQuantity = quantity;
|
||||
if (type == PICKUP_ONCE_TIMEOUT)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include "Weapon.h"
|
||||
|
||||
enum ePickupType : uint8
|
||||
enum ePickupType
|
||||
{
|
||||
PICKUP_NONE = 0,
|
||||
PICKUP_IN_SHOP,
|
||||
|
@ -29,7 +29,7 @@ class CPlayerPed;
|
|||
class CPickup
|
||||
{
|
||||
public:
|
||||
ePickupType m_eType;
|
||||
uint8 m_eType;
|
||||
bool m_bRemoved;
|
||||
uint16 m_nQuantity;
|
||||
CObject *m_pObject;
|
||||
|
|
|
@ -391,15 +391,17 @@ void CRecordDataForChase::ProcessControlCars(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if (defined(GTA_PS2) || defined(FIX_BUGS))
|
||||
bool CRecordDataForChase::ShouldThisPadBeLeftAlone(uint8 pad)
|
||||
{
|
||||
// may be wrong
|
||||
if (Status == STATE_NONE || Status == STATE_PLAYBACK)
|
||||
if (Status == STATE_PLAYBACK_INIT) // this is useless but ps2 def checks if it's STATE_PLAYBACK_INIT
|
||||
return false;
|
||||
return pad != 0;
|
||||
|
||||
if (Status == STATE_RECORD)
|
||||
return pad != 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void CRecordDataForChase::GiveUsACar(int32 mi, CVector pos, float angle, CAutomobile** ppCar, uint8 colour1, uint8 colour2)
|
||||
{
|
||||
|
|
|
@ -57,9 +57,7 @@ public:
|
|||
static void RestoreInfoForMatrix(CMatrix&, CCarStateEachFrame*);
|
||||
static void RestoreInfoForCar(CAutomobile*, CCarStateEachFrame*, bool);
|
||||
static void ProcessControlCars(void);
|
||||
#if (defined(GTA_PS2) || defined(FIX_BUGS))
|
||||
static bool ShouldThisPadBeLeftAlone(uint8 pad);
|
||||
#endif
|
||||
static void GiveUsACar(int32, CVector, float, CAutomobile**, uint8, uint8);
|
||||
static void StartChaseScene(float);
|
||||
static void CleanUpChaseScene(void);
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
#include "DMAudio.h"
|
||||
#include "Draw.h"
|
||||
#include "FileMgr.h"
|
||||
#ifdef FIX_BUGS
|
||||
#include "Fire.h"
|
||||
#include "Garages.h"
|
||||
#endif
|
||||
#include "Heli.h"
|
||||
#include "main.h"
|
||||
#include "Matrix.h"
|
||||
|
@ -22,6 +26,10 @@
|
|||
#include "Plane.h"
|
||||
#include "Pools.h"
|
||||
#include "Population.h"
|
||||
#ifdef FIX_BUGS
|
||||
#include "Projectile.h"
|
||||
#include "ProjectileInfo.h"
|
||||
#endif
|
||||
#include "Replay.h"
|
||||
#include "References.h"
|
||||
#include "Pools.h"
|
||||
|
@ -102,6 +110,11 @@ float CReplay::fDistanceLookAroundCam;
|
|||
float CReplay::fBetaAngleLookAroundCam;
|
||||
float CReplay::fAlphaAngleLookAroundCam;
|
||||
#ifdef FIX_BUGS
|
||||
uint8* CReplay::pGarages;
|
||||
CFire* CReplay::FireArray;
|
||||
uint32 CReplay::NumOfFires;
|
||||
uint8* CReplay::paProjectileInfo;
|
||||
uint8* CReplay::paProjectiles;
|
||||
int CReplay::nHandleOfPlayerPed[NUMPLAYERS];
|
||||
#endif
|
||||
|
||||
|
@ -1025,10 +1038,10 @@ void CReplay::ProcessReplayCamera(void)
|
|||
TheCamera.GetUp() = CVector(0.0f, 1.0f, 0.0f);
|
||||
TheCamera.GetRight() = CVector(1.0f, 0.0f, 0.0f);
|
||||
RwMatrix* pm = RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera));
|
||||
pm->pos = *(RwV3d*)&TheCamera.GetPosition();
|
||||
pm->at = *(RwV3d*)&TheCamera.GetForward();
|
||||
pm->up = *(RwV3d*)&TheCamera.GetUp();
|
||||
pm->right = *(RwV3d*)&TheCamera.GetRight();
|
||||
pm->pos = TheCamera.GetPosition();
|
||||
pm->at = TheCamera.GetForward();
|
||||
pm->up = TheCamera.GetUp();
|
||||
pm->right = TheCamera.GetRight();
|
||||
break;
|
||||
}
|
||||
case REPLAYCAMMODE_FIXED:
|
||||
|
@ -1044,10 +1057,10 @@ void CReplay::ProcessReplayCamera(void)
|
|||
TheCamera.GetMatrix().GetUp() = up;
|
||||
TheCamera.GetMatrix().GetRight() = right;
|
||||
RwMatrix* pm = RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera));
|
||||
pm->pos = *(RwV3d*)&TheCamera.GetMatrix().GetPosition();
|
||||
pm->at = *(RwV3d*)&TheCamera.GetMatrix().GetForward();
|
||||
pm->up = *(RwV3d*)&TheCamera.GetMatrix().GetUp();
|
||||
pm->right = *(RwV3d*)&TheCamera.GetMatrix().GetRight();
|
||||
pm->pos = TheCamera.GetMatrix().GetPosition();
|
||||
pm->at = TheCamera.GetMatrix().GetForward();
|
||||
pm->up = TheCamera.GetMatrix().GetUp();
|
||||
pm->right = TheCamera.GetMatrix().GetRight();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -1156,6 +1169,17 @@ void CReplay::StoreStuffInMem(void)
|
|||
if (ped)
|
||||
StoreDetailedPedAnimation(ped, &pPedAnims[i]);
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
pGarages = new uint8[sizeof(CGarages::aGarages)];
|
||||
memcpy(pGarages, CGarages::aGarages, sizeof(CGarages::aGarages));
|
||||
FireArray = new CFire[NUM_FIRES];
|
||||
memcpy(FireArray, gFireManager.m_aFires, sizeof(gFireManager.m_aFires));
|
||||
NumOfFires = gFireManager.m_nTotalFires;
|
||||
paProjectileInfo = new uint8[sizeof(gaProjectileInfo)];
|
||||
memcpy(paProjectileInfo, gaProjectileInfo, sizeof(gaProjectileInfo));
|
||||
paProjectiles = new uint8[sizeof(CProjectileInfo::ms_apProjectile)];
|
||||
memcpy(paProjectiles, CProjectileInfo::ms_apProjectile, sizeof(CProjectileInfo::ms_apProjectile));
|
||||
#endif
|
||||
}
|
||||
|
||||
void CReplay::RestoreStuffFromMem(void)
|
||||
|
@ -1206,7 +1230,7 @@ void CReplay::RestoreStuffFromMem(void)
|
|||
ped->m_rwObject = nil;
|
||||
ped->m_modelIndex = -1;
|
||||
ped->SetModelIndex(mi);
|
||||
ped->m_pVehicleAnim = 0;
|
||||
ped->m_pVehicleAnim = nil;
|
||||
ped->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, ped);
|
||||
DMAudio.SetEntityStatus(ped->m_audioEntityId, true);
|
||||
CPopulation::UpdatePedCount((ePedType)ped->m_nPedType, false);
|
||||
|
@ -1322,6 +1346,22 @@ void CReplay::RestoreStuffFromMem(void)
|
|||
}
|
||||
delete[] pPedAnims;
|
||||
pPedAnims = nil;
|
||||
#ifdef FIX_BUGS
|
||||
memcpy(CGarages::aGarages, pGarages, sizeof(CGarages::aGarages));
|
||||
delete[] pGarages;
|
||||
pGarages = nil;
|
||||
memcpy(gFireManager.m_aFires, FireArray, sizeof(gFireManager.m_aFires));
|
||||
delete[] FireArray;
|
||||
FireArray = nil;
|
||||
gFireManager.m_nTotalFires = NumOfFires;
|
||||
memcpy(gaProjectileInfo, paProjectileInfo, sizeof(gaProjectileInfo));
|
||||
delete[] paProjectileInfo;
|
||||
paProjectileInfo = nil;
|
||||
memcpy(CProjectileInfo::ms_apProjectile, paProjectiles, sizeof(CProjectileInfo::ms_apProjectile));
|
||||
delete[] paProjectiles;
|
||||
paProjectiles = nil;
|
||||
//CExplosion::ClearAllExplosions(); not in III
|
||||
#endif
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
|
||||
DMAudio.SetRadioInCar(OldRadioStation);
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
|
||||
|
@ -1541,10 +1581,10 @@ void CReplay::ProcessLookAroundCam(void)
|
|||
TheCamera.GetRight() = right;
|
||||
TheCamera.SetPosition(camera_pt);
|
||||
RwMatrix* pm = RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera));
|
||||
pm->pos = *(RwV3d*)&TheCamera.GetPosition();
|
||||
pm->at = *(RwV3d*)&TheCamera.GetForward();
|
||||
pm->up = *(RwV3d*)&TheCamera.GetUp();
|
||||
pm->right = *(RwV3d*)&TheCamera.GetRight();
|
||||
pm->pos = TheCamera.GetPosition();
|
||||
pm->at = TheCamera.GetForward();
|
||||
pm->up = TheCamera.GetUp();
|
||||
pm->right = TheCamera.GetRight();
|
||||
TheCamera.CalculateDerivedValues();
|
||||
RwMatrixUpdate(RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera)));
|
||||
RwFrameUpdateObjects(RwCameraGetFrame(TheCamera.m_pRwCamera));
|
||||
|
|
|
@ -275,6 +275,11 @@ private:
|
|||
static float fAlphaAngleLookAroundCam;
|
||||
static float fBetaAngleLookAroundCam;
|
||||
#ifdef FIX_BUGS
|
||||
static uint8* pGarages;
|
||||
static CFire* FireArray;
|
||||
static uint32 NumOfFires;
|
||||
static uint8* paProjectileInfo;
|
||||
static uint8* paProjectiles;
|
||||
static int nHandleOfPlayerPed[NUMPLAYERS];
|
||||
#endif
|
||||
|
||||
|
|
|
@ -90,8 +90,7 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
|
|||
pCopPed->m_nRoadblockNode = roadBlockNode;
|
||||
pCopPed->bCrouchWhenShooting = roadBlockType != 2;
|
||||
if (pEntityToAttack) {
|
||||
pCopPed->m_pPointGunAt = pEntityToAttack;
|
||||
pEntityToAttack->RegisterReference(&pCopPed->m_pPointGunAt);
|
||||
pCopPed->SetWeaponLockOnTarget(pEntityToAttack);
|
||||
pCopPed->SetAttack(pEntityToAttack);
|
||||
}
|
||||
pCopPed->m_pMyVehicle = pVehicle;
|
||||
|
|
|
@ -238,12 +238,12 @@ const tScriptCommandData commands[] = {
|
|||
REGISTER_COMMAND(COMMAND_DIV_FLOAT_VAR_BY_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
||||
REGISTER_COMMAND(COMMAND_DIV_INT_LVAR_BY_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
||||
REGISTER_COMMAND(COMMAND_DIV_FLOAT_LVAR_BY_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_VAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_VAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_VAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_VAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +=@"),
|
||||
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +=@"),
|
||||
REGISTER_COMMAND(COMMAND_SUB_TIMED_VAL_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_SUB_TIMED_VAL_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
REGISTER_COMMAND(COMMAND_SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
||||
|
@ -3593,7 +3593,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
|
|||
CollectParameters(&m_nIp, 2);
|
||||
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
||||
script_assert(car);
|
||||
car->AutoPilot.m_nDrivingStyle = (eCarDrivingStyle)ScriptParams[1];
|
||||
car->AutoPilot.m_nDrivingStyle = (uint8)ScriptParams[1];
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_SET_CAR_MISSION:
|
||||
|
@ -3601,7 +3601,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
|
|||
CollectParameters(&m_nIp, 2);
|
||||
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
||||
script_assert(car);
|
||||
car->AutoPilot.m_nCarMission = (eCarMission)ScriptParams[1];
|
||||
car->AutoPilot.m_nCarMission = (uint8)ScriptParams[1];
|
||||
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
||||
car->bEngineOn = true;
|
||||
return 0;
|
||||
|
|
|
@ -396,7 +396,7 @@ private:
|
|||
friend class CRunningScript;
|
||||
friend class CHud;
|
||||
friend void CMissionCleanup::Process();
|
||||
#ifdef FIX_BUGS
|
||||
#ifdef MISSION_REPLAY
|
||||
friend void RetryMission(int, int);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
|
|||
infZ = *(float*)&ScriptParams[5];
|
||||
supZ = *(float*)&ScriptParams[2];
|
||||
}
|
||||
ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), (eGarageType)ScriptParams[6], 0);
|
||||
ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), ScriptParams[6], 0);
|
||||
StoreParameters(&m_nIp, 1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
|
|||
infZ = *(float*)&ScriptParams[5];
|
||||
supZ = *(float*)&ScriptParams[2];
|
||||
}
|
||||
ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), (eGarageType)ScriptParams[6], ScriptParams[7]);
|
||||
ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), ScriptParams[6], ScriptParams[7]);
|
||||
StoreParameters(&m_nIp, 1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -996,7 +996,7 @@ int8 CRunningScript::ProcessCommands600To699(int32 command)
|
|||
CollectParameters(&m_nIp, 4);
|
||||
int mi = ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::UsedObjectArray[-ScriptParams[0]].index;
|
||||
CObject* pObj = new CObject(mi, false);
|
||||
; pObj->ObjectCreatedBy = MISSION_OBJECT;
|
||||
pObj->ObjectCreatedBy = MISSION_OBJECT;
|
||||
CVector pos = *(CVector*)&ScriptParams[1];
|
||||
if (pos.z <= MAP_Z_LOW_LIMIT)
|
||||
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
||||
|
@ -1826,7 +1826,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
|||
}
|
||||
case COMMAND_CHANGE_GARAGE_TYPE:
|
||||
CollectParameters(&m_nIp, 2);
|
||||
CGarages::ChangeGarageType(ScriptParams[0], (eGarageType)ScriptParams[1], 0);
|
||||
CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], 0);
|
||||
return 0;
|
||||
case COMMAND_ACTIVATE_CRUSHER_CRANE:
|
||||
{
|
||||
|
|
|
@ -1436,7 +1436,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
|||
CollectParameters(&m_nIp, 2);
|
||||
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
||||
script_assert(pVehicle);
|
||||
pVehicle->SetStatus((eEntityStatus)ScriptParams[1]);
|
||||
pVehicle->SetStatus(ScriptParams[1]);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_IS_CHAR_MALE:
|
||||
|
@ -1459,7 +1459,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
|||
case COMMAND_CHANGE_GARAGE_TYPE_WITH_CAR_MODEL:
|
||||
{
|
||||
CollectParameters(&m_nIp, 3);
|
||||
CGarages::ChangeGarageType(ScriptParams[0], (eGarageType)ScriptParams[1], ScriptParams[2]);
|
||||
CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], ScriptParams[2]);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_FIND_DRUG_PLANE_COORDINATES:
|
||||
|
@ -2025,3 +2025,143 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32 CTheScripts::GetNewUniqueScriptSphereIndex(int32 index)
|
||||
{
|
||||
if (ScriptSphereArray[index].m_Index >= UINT16_MAX - 1)
|
||||
ScriptSphereArray[index].m_Index = 1;
|
||||
else
|
||||
ScriptSphereArray[index].m_Index++;
|
||||
return (uint16)index | ScriptSphereArray[index].m_Index << 16;
|
||||
}
|
||||
|
||||
int32 CTheScripts::GetActualScriptSphereIndex(int32 index)
|
||||
{
|
||||
if (index == -1)
|
||||
return -1;
|
||||
uint16 check = (uint32)index >> 16;
|
||||
uint16 array_idx = index & (0xFFFF);
|
||||
script_assert(array_idx < ARRAY_SIZE(ScriptSphereArray));
|
||||
if (check != ScriptSphereArray[array_idx].m_Index)
|
||||
return -1;
|
||||
return array_idx;
|
||||
}
|
||||
|
||||
void CTheScripts::DrawScriptSpheres()
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
||||
if (ScriptSphereArray[i].m_bInUse)
|
||||
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, MARKERTYPE_CYLINDER, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
|
||||
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int32 CTheScripts::AddScriptSphere(int32 id, CVector pos, float radius)
|
||||
{
|
||||
int16 i = 0;
|
||||
for (i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
||||
if (!ScriptSphereArray[i].m_bInUse)
|
||||
break;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
if (i == MAX_NUM_SCRIPT_SPHERES)
|
||||
return -1;
|
||||
#endif
|
||||
ScriptSphereArray[i].m_bInUse = true;
|
||||
ScriptSphereArray[i].m_Id = id;
|
||||
ScriptSphereArray[i].m_vecCenter = pos;
|
||||
ScriptSphereArray[i].m_fRadius = radius;
|
||||
return GetNewUniqueScriptSphereIndex(i);
|
||||
}
|
||||
|
||||
void CTheScripts::RemoveScriptSphere(int32 index)
|
||||
{
|
||||
index = GetActualScriptSphereIndex(index);
|
||||
if (index == -1)
|
||||
return;
|
||||
ScriptSphereArray[index].m_bInUse = false;
|
||||
ScriptSphereArray[index].m_Id = 0;
|
||||
}
|
||||
|
||||
void CTheScripts::AddToBuildingSwapArray(CBuilding* pBuilding, int32 old_model, int32 new_model)
|
||||
{
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
while (i < MAX_NUM_BUILDING_SWAPS && !found) {
|
||||
if (BuildingSwapArray[i].m_pBuilding == pBuilding)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found) {
|
||||
if (BuildingSwapArray[i].m_nOldModel == new_model) {
|
||||
BuildingSwapArray[i].m_pBuilding = nil;
|
||||
BuildingSwapArray[i].m_nOldModel = BuildingSwapArray[i].m_nNewModel = -1;
|
||||
}
|
||||
else {
|
||||
BuildingSwapArray[i].m_nNewModel = new_model;
|
||||
}
|
||||
}
|
||||
else {
|
||||
i = 0;
|
||||
while (i < MAX_NUM_BUILDING_SWAPS && !found) {
|
||||
if (BuildingSwapArray[i].m_pBuilding == nil)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found) {
|
||||
BuildingSwapArray[i].m_pBuilding = pBuilding;
|
||||
BuildingSwapArray[i].m_nNewModel = new_model;
|
||||
BuildingSwapArray[i].m_nOldModel = old_model;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CTheScripts::AddToInvisibilitySwapArray(CEntity* pEntity, bool remove)
|
||||
{
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
while (i < MAX_NUM_INVISIBILITY_SETTINGS && !found) {
|
||||
if (InvisibilitySettingArray[i] == pEntity)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found) {
|
||||
if (remove)
|
||||
InvisibilitySettingArray[i] = nil;
|
||||
}
|
||||
else if (!remove) {
|
||||
i = 0;
|
||||
while (i < MAX_NUM_INVISIBILITY_SETTINGS && !found) {
|
||||
if (InvisibilitySettingArray[i] == nil)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found)
|
||||
InvisibilitySettingArray[i] = pEntity;
|
||||
}
|
||||
}
|
||||
|
||||
void CTheScripts::UndoBuildingSwaps()
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
|
||||
if (BuildingSwapArray[i].m_pBuilding) {
|
||||
BuildingSwapArray[i].m_pBuilding->ReplaceWithNewModel(BuildingSwapArray[i].m_nOldModel);
|
||||
BuildingSwapArray[i].m_pBuilding = nil;
|
||||
BuildingSwapArray[i].m_nOldModel = BuildingSwapArray[i].m_nNewModel = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CTheScripts::UndoEntityInvisibilitySettings()
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
|
||||
if (InvisibilitySettingArray[i]) {
|
||||
InvisibilitySettingArray[i]->bIsVisible = true;
|
||||
InvisibilitySettingArray[i] = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,147 +17,6 @@
|
|||
#include "World.h"
|
||||
#include "main.h"
|
||||
|
||||
int32 CTheScripts::GetNewUniqueScriptSphereIndex(int32 index)
|
||||
{
|
||||
if (ScriptSphereArray[index].m_Index >= UINT16_MAX - 1)
|
||||
ScriptSphereArray[index].m_Index = 1;
|
||||
else
|
||||
ScriptSphereArray[index].m_Index++;
|
||||
return (uint16)index | ScriptSphereArray[index].m_Index << 16;
|
||||
}
|
||||
|
||||
int32 CTheScripts::GetActualScriptSphereIndex(int32 index)
|
||||
{
|
||||
if (index == -1)
|
||||
return -1;
|
||||
uint16 check = (uint32)index >> 16;
|
||||
uint16 array_idx = index & (0xFFFF);
|
||||
script_assert(array_idx < ARRAY_SIZE(ScriptSphereArray));
|
||||
if (check != ScriptSphereArray[array_idx].m_Index)
|
||||
return -1;
|
||||
return array_idx;
|
||||
}
|
||||
|
||||
void CTheScripts::DrawScriptSpheres()
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
||||
if (ScriptSphereArray[i].m_bInUse)
|
||||
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, MARKERTYPE_CYLINDER, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
|
||||
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int32 CTheScripts::AddScriptSphere(int32 id, CVector pos, float radius)
|
||||
{
|
||||
int16 i = 0;
|
||||
for (i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
||||
if (!ScriptSphereArray[i].m_bInUse)
|
||||
break;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
if (i == MAX_NUM_SCRIPT_SPHERES)
|
||||
return -1;
|
||||
#endif
|
||||
ScriptSphereArray[i].m_bInUse = true;
|
||||
ScriptSphereArray[i].m_Id = id;
|
||||
ScriptSphereArray[i].m_vecCenter = pos;
|
||||
ScriptSphereArray[i].m_fRadius = radius;
|
||||
return GetNewUniqueScriptSphereIndex(i);
|
||||
}
|
||||
|
||||
void CTheScripts::RemoveScriptSphere(int32 index)
|
||||
{
|
||||
index = GetActualScriptSphereIndex(index);
|
||||
if (index == -1)
|
||||
return;
|
||||
ScriptSphereArray[index].m_bInUse = false;
|
||||
ScriptSphereArray[index].m_Id = 0;
|
||||
}
|
||||
|
||||
void CTheScripts::AddToBuildingSwapArray(CBuilding* pBuilding, int32 old_model, int32 new_model)
|
||||
{
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
while (i < MAX_NUM_BUILDING_SWAPS && !found) {
|
||||
if (BuildingSwapArray[i].m_pBuilding == pBuilding)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found) {
|
||||
if (BuildingSwapArray[i].m_nOldModel == new_model) {
|
||||
BuildingSwapArray[i].m_pBuilding = nil;
|
||||
BuildingSwapArray[i].m_nOldModel = BuildingSwapArray[i].m_nNewModel = -1;
|
||||
}
|
||||
else {
|
||||
BuildingSwapArray[i].m_nNewModel = new_model;
|
||||
}
|
||||
}
|
||||
else {
|
||||
i = 0;
|
||||
while (i < MAX_NUM_BUILDING_SWAPS && !found) {
|
||||
if (BuildingSwapArray[i].m_pBuilding == nil)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found) {
|
||||
BuildingSwapArray[i].m_pBuilding = pBuilding;
|
||||
BuildingSwapArray[i].m_nNewModel = new_model;
|
||||
BuildingSwapArray[i].m_nOldModel = old_model;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CTheScripts::AddToInvisibilitySwapArray(CEntity* pEntity, bool remove)
|
||||
{
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
while (i < MAX_NUM_INVISIBILITY_SETTINGS && !found) {
|
||||
if (InvisibilitySettingArray[i] == pEntity)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found) {
|
||||
if (remove)
|
||||
InvisibilitySettingArray[i] = nil;
|
||||
}
|
||||
else if (!remove) {
|
||||
i = 0;
|
||||
while (i < MAX_NUM_INVISIBILITY_SETTINGS && !found) {
|
||||
if (InvisibilitySettingArray[i] == nil)
|
||||
found = true;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (found)
|
||||
InvisibilitySettingArray[i] = pEntity;
|
||||
}
|
||||
}
|
||||
|
||||
void CTheScripts::UndoBuildingSwaps()
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
|
||||
if (BuildingSwapArray[i].m_pBuilding) {
|
||||
BuildingSwapArray[i].m_pBuilding->ReplaceWithNewModel(BuildingSwapArray[i].m_nOldModel);
|
||||
BuildingSwapArray[i].m_pBuilding = nil;
|
||||
BuildingSwapArray[i].m_nOldModel = BuildingSwapArray[i].m_nNewModel = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CTheScripts::UndoEntityInvisibilitySettings()
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
|
||||
if (InvisibilitySettingArray[i]) {
|
||||
InvisibilitySettingArray[i]->bIsVisible = true;
|
||||
InvisibilitySettingArray[i] = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CRunningScript::UpdateCompareFlag(bool flag)
|
||||
{
|
||||
if (m_bNotFlag)
|
||||
|
@ -1921,7 +1780,7 @@ void CTheScripts::CleanUpThisPed(CPed* pPed)
|
|||
if (pPed->IsPedInControl())
|
||||
pPed->SetWanderPath(CGeneral::GetRandomNumber() & 7);
|
||||
if (flees) {
|
||||
pPed->m_nPedState = state;
|
||||
pPed->SetPedState(state);
|
||||
pPed->SetMoveState(ms);
|
||||
}
|
||||
--CPopulation::ms_nTotalMissionPeds;
|
||||
|
|
|
@ -545,7 +545,14 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
|
|||
CStats::RegisterHighestScore(ScriptParams[0], ScriptParams[1]);
|
||||
return 0;
|
||||
//case COMMAND_WARP_CHAR_INTO_CAR_AS_PASSENGER:
|
||||
//case COMMAND_IS_CAR_PASSENGER_SEAT_FREE:
|
||||
case COMMAND_IS_CAR_PASSENGER_SEAT_FREE:
|
||||
{
|
||||
CollectParameters(&m_nIp, 2);
|
||||
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
||||
script_assert(pVehicle);
|
||||
UpdateCompareFlag(ScriptParams[1] < pVehicle->m_nNumMaxPassengers && pVehicle->pPassengers[ScriptParams[1]] == nil);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_GET_CHAR_IN_CAR_PASSENGER_SEAT:
|
||||
{
|
||||
CollectParameters(&m_nIp, 2);
|
||||
|
|
|
@ -45,7 +45,7 @@ CEntity *CAnimViewer::pTarget = nil;
|
|||
void
|
||||
CAnimViewer::Render(void) {
|
||||
if (pTarget) {
|
||||
// pTarget->GetPosition() = CVector(0.0f, 0.0f, 0.0f);
|
||||
// pTarget->GetPosition() = CVector(0.0f, 0.0f, 0.0f); // Only on Mobile
|
||||
if (pTarget) {
|
||||
#ifdef FIX_BUGS
|
||||
#ifdef PED_SKIN
|
||||
|
@ -61,7 +61,9 @@ CAnimViewer::Render(void) {
|
|||
|
||||
void
|
||||
CAnimViewer::Initialise(void) {
|
||||
LoadingScreen("Loading the ModelViewer", "", GetRandomSplashScreen());
|
||||
// we need messages, messages needs hud, hud needs this
|
||||
CHud::m_Wants_To_Draw_Hud = false;
|
||||
|
||||
animTxdSlot = CTxdStore::AddTxdSlot("generic");
|
||||
CTxdStore::Create(animTxdSlot);
|
||||
int hudSlot = CTxdStore::AddTxdSlot("hud");
|
||||
|
@ -75,9 +77,6 @@ CAnimViewer::Initialise(void) {
|
|||
TheCamera.SetRwCamera(Scene.camera);
|
||||
TheCamera.Cams[TheCamera.ActiveCam].Distance = 5.0f;
|
||||
|
||||
gbModelViewer = true;
|
||||
CHud::m_Wants_To_Draw_Hud = false;
|
||||
|
||||
ThePaths.Init();
|
||||
ThePaths.AllocatePathFindInfoMem(4500);
|
||||
CCollision::Init();
|
||||
|
@ -113,7 +112,7 @@ CAnimViewer::Initialise(void) {
|
|||
CTimeCycle::Initialise();
|
||||
CCarCtrl::Init();
|
||||
CPlayerPed *player = new CPlayerPed();
|
||||
player->SetPosition(0.0f, 0.0f, 0.0f);
|
||||
player->SetPosition(0.0f, 0.0f, 0.0f); // This is 1000.f for all axes on Xbox, but 0.f on mobile?
|
||||
CWorld::Players[0].m_pPed = player;
|
||||
CDraw::SetFOV(120.0f);
|
||||
CDraw::ms_fLODDistance = 500.0f;
|
||||
|
@ -222,8 +221,7 @@ CAnimViewer::Update(void)
|
|||
{
|
||||
static int modelId = 0;
|
||||
static int animId = 0;
|
||||
// Please don't make this bool, static bool's are problematic on my side.
|
||||
static int reloadIFP = 0;
|
||||
static bool reloadIFP = false;
|
||||
|
||||
AssocGroupId animGroup = ASSOCGRP_STD;
|
||||
int nextModelId = modelId;
|
||||
|
@ -248,7 +246,7 @@ CAnimViewer::Update(void)
|
|||
CAnimManager::Initialise();
|
||||
CAnimManager::LoadAnimFiles();
|
||||
|
||||
reloadIFP = 0;
|
||||
reloadIFP = false;
|
||||
}
|
||||
} else {
|
||||
animGroup = ASSOCGRP_STD;
|
||||
|
@ -302,6 +300,7 @@ CAnimViewer::Update(void)
|
|||
pTarget->GetMatrix().GetPosition().z = 10.0f;
|
||||
#else
|
||||
pTarget->GetMatrix().GetPosition().z = 0.0f;
|
||||
|
||||
#endif
|
||||
|
||||
if (modelInfo->GetModelType() == MITYPE_PED) {
|
||||
|
@ -309,7 +308,7 @@ CAnimViewer::Update(void)
|
|||
|
||||
// Triangle in mobile
|
||||
if (pad->GetSquareJustDown()) {
|
||||
reloadIFP = 1;
|
||||
reloadIFP = true;
|
||||
AsciiToUnicode("IFP reloaded", gUString);
|
||||
CMessages::AddMessage(gUString, 1000, 0);
|
||||
|
||||
|
|
136
src/core/Cam.cpp
136
src/core/Cam.cpp
|
@ -2472,7 +2472,7 @@ CCam::Process_Rocket(const CVector &CameraTarget, float, float, float)
|
|||
ResetStatics = false;
|
||||
}
|
||||
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
|
||||
Source = HeadPos;
|
||||
Source.z += 0.1f;
|
||||
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
|
||||
|
@ -2573,7 +2573,7 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float)
|
|||
}
|
||||
|
||||
#if GTA_VERSION < GTA3_PC_11
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
|
||||
Source = HeadPos;
|
||||
Source.z += 0.1f;
|
||||
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
|
||||
|
@ -2611,7 +2611,7 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float)
|
|||
HeadPos.x = 0.0f;
|
||||
HeadPos.y = 0.0f;
|
||||
HeadPos.z = 0.0f;
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
|
||||
Source = HeadPos;
|
||||
Source.z += 0.1f;
|
||||
Source.x -= 0.19f * Cos(m_fInitialPlayerOrientation);
|
||||
|
@ -2700,7 +2700,7 @@ CCam::Process_1stPerson(const CVector &CameraTarget, float TargetOrientation, fl
|
|||
ResetStatics = false;
|
||||
}
|
||||
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
|
||||
Source = HeadPos;
|
||||
Source.z += 0.1f;
|
||||
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
|
||||
|
@ -2868,7 +2868,7 @@ CCam::Process_1rstPersonPedOnPC(const CVector&, float TargetOrientation, float,
|
|||
Source = HeadPos;
|
||||
|
||||
// unused:
|
||||
// ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&MidPos, PED_MID);
|
||||
// ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(MidPos, PED_MID);
|
||||
// Source - MidPos;
|
||||
|
||||
// Look around
|
||||
|
@ -2963,7 +2963,7 @@ CCam::Process_Sniper(const CVector &CameraTarget, float TargetOrientation, float
|
|||
ResetStatics = false;
|
||||
}
|
||||
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
|
||||
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
|
||||
Source = HeadPos;
|
||||
Source.z += 0.1f;
|
||||
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
|
||||
|
@ -3003,8 +3003,7 @@ CCam::Process_Sniper(const CVector &CameraTarget, float TargetOrientation, float
|
|||
UseMouse = false;
|
||||
int ZoomInButton = ControlsManager.GetMouseButtonAssociatedWithAction(PED_SNIPER_ZOOM_IN);
|
||||
int ZoomOutButton = ControlsManager.GetMouseButtonAssociatedWithAction(PED_SNIPER_ZOOM_OUT);
|
||||
// TODO: enum? this should be mouse wheel up and down
|
||||
if(ZoomInButton == 4 || ZoomInButton == 5 || ZoomOutButton == 4 || ZoomOutButton == 5){
|
||||
if(ZoomInButton == rsMOUSEWHEELUPBUTTON || ZoomInButton == rsMOUSEWHEELDOWNBUTTON || ZoomOutButton == rsMOUSEWHEELUPBUTTON || ZoomOutButton == rsMOUSEWHEELDOWNBUTTON){
|
||||
if(CPad::GetPad(0)->GetMouseWheelUp() || CPad::GetPad(0)->GetMouseWheelDown()){
|
||||
if(CPad::GetPad(0)->SniperZoomIn()){
|
||||
TargetFOV = FOV - 10.0f;
|
||||
|
@ -4894,13 +4893,9 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
|||
|
||||
if (FOV > DefaultFOV)
|
||||
// 0.98f: CAR_FOV_FADE_MULT
|
||||
FOV = pow(0.98f, CTimer::GetTimeStep()) * (FOV - DefaultFOV) + DefaultFOV;
|
||||
FOV = Pow(0.98f, CTimer::GetTimeStep()) * (FOV - DefaultFOV) + DefaultFOV;
|
||||
|
||||
if (FOV <= DefaultFOV + 30.0f) {
|
||||
if (FOV < DefaultFOV)
|
||||
FOV = DefaultFOV;
|
||||
} else
|
||||
FOV = DefaultFOV + 30.0f;
|
||||
FOV = clamp(FOV, DefaultFOV, DefaultFOV + 30.0f);
|
||||
}
|
||||
|
||||
// WORKAROUND: I still don't know how looking behind works (m_bCamDirectlyInFront is unused in III, they seem to use m_bUseTransitionBeta)
|
||||
|
@ -5030,7 +5025,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
|||
targetAlpha = maxAlphaAllowed;
|
||||
}
|
||||
float maxAlphaBlendAmount = CTimer::GetTimeStep() * CARCAM_SET[camSetArrPos][6];
|
||||
float targetAlphaBlendAmount = (1.0f - pow(CARCAM_SET[camSetArrPos][5], CTimer::GetTimeStep())) * (targetAlpha - Alpha);
|
||||
float targetAlphaBlendAmount = (1.0f - Pow(CARCAM_SET[camSetArrPos][5], CTimer::GetTimeStep())) * (targetAlpha - Alpha);
|
||||
if (targetAlphaBlendAmount <= maxAlphaBlendAmount) {
|
||||
if (targetAlphaBlendAmount < -maxAlphaBlendAmount)
|
||||
targetAlphaBlendAmount = -maxAlphaBlendAmount;
|
||||
|
@ -5042,9 +5037,9 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
|||
float stickX = -(pad->GetCarGunLeftRight());
|
||||
float stickY = pad->GetCarGunUpDown();
|
||||
|
||||
// In SA this checks for m_bUseMouse3rdPerson so num2/num8 do not move camera when Keyboard & Mouse controls are used.
|
||||
if (CCamera::m_bUseMouse3rdPerson)
|
||||
stickY = 0.0f;
|
||||
// In SA this is for not let num2/num8 move camera when Keyboard & Mouse controls are used.
|
||||
// if (CCamera::m_bUseMouse3rdPerson)
|
||||
// stickY = 0.0f;
|
||||
|
||||
float xMovement = Abs(stickX) * (FOV / 80.0f * 5.f / 70.f) * stickX * 0.007f * 0.007f;
|
||||
float yMovement = Abs(stickY) * (FOV / 80.0f * 3.f / 70.f) * stickY * 0.007f * 0.007f;
|
||||
|
@ -5122,7 +5117,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
|||
float betaSpeedFromStickX = xMovement * CARCAM_SET[camSetArrPos][12];
|
||||
|
||||
float newAngleSpeedMaxBlendAmount = CARCAM_SET[camSetArrPos][9];
|
||||
float angleChangeStep = pow(CARCAM_SET[camSetArrPos][8], CTimer::GetTimeStep());
|
||||
float angleChangeStep = Pow(CARCAM_SET[camSetArrPos][8], CTimer::GetTimeStep());
|
||||
float targetBetaWithStickBlendAmount = betaSpeedFromStickX + (targetBeta - Beta) / Max(CTimer::GetTimeStep(), 1.0f);
|
||||
|
||||
if (targetBetaWithStickBlendAmount < -newAngleSpeedMaxBlendAmount)
|
||||
|
@ -5234,69 +5229,78 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
|
|||
// SA calls SetColVarsVehicle in here
|
||||
if (nextDirectionIsForward) {
|
||||
|
||||
// This is new in LCS!
|
||||
// LCS uses exactly the same collision code as FollowPedWithMouse, so we will do so.
|
||||
|
||||
// This is only in LCS!
|
||||
float timestepFactor = Pow(0.99f, CTimer::GetTimeStep());
|
||||
dontCollideWithCars = (timestepFactor * dontCollideWithCars) + ((1.0f - timestepFactor) * car->m_vecMoveSpeed.Magnitude());
|
||||
|
||||
// Move cam if on collision
|
||||
CColPoint foundCol;
|
||||
CEntity* foundEnt;
|
||||
// Our addition
|
||||
#define IS_TRAFFIC_LIGHT(ent) (ent->IsObject() && (IsStreetLight(ent->GetModelIndex())))
|
||||
|
||||
// Clip Source and fix near clip
|
||||
CColPoint colPoint;
|
||||
CEntity* entity;
|
||||
CWorld::pIgnoreEntity = CamTargetEntity;
|
||||
if (CWorld::ProcessLineOfSight(TargetCoors, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, false, false, true, false)) {
|
||||
float obstacleTargetDist = (TargetCoors - foundCol.point).Magnitude();
|
||||
float obstacleCamDist = newDistance - obstacleTargetDist;
|
||||
if (!foundEnt->IsPed() || obstacleCamDist <= 1.0f) {
|
||||
Source = foundCol.point;
|
||||
if (obstacleTargetDist < 1.2f) {
|
||||
RwCameraSetNearClipPlane(Scene.camera, Max(0.05f, obstacleTargetDist - 0.3f));
|
||||
}
|
||||
} else {
|
||||
if (!CWorld::ProcessLineOfSight(foundCol.point, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, false, false, true, false)) {
|
||||
float lessClip = obstacleCamDist - 0.35f;
|
||||
if (lessClip <= DEFAULT_NEAR)
|
||||
RwCameraSetNearClipPlane(Scene.camera, lessClip);
|
||||
else
|
||||
RwCameraSetNearClipPlane(Scene.camera, DEFAULT_NEAR);
|
||||
} else {
|
||||
obstacleTargetDist = (TargetCoors - foundCol.point).Magnitude();
|
||||
Source = foundCol.point;
|
||||
if (obstacleTargetDist < 1.2f) {
|
||||
float lessClip = obstacleTargetDist - 0.3f;
|
||||
if (lessClip >= 0.05f)
|
||||
RwCameraSetNearClipPlane(Scene.camera, lessClip);
|
||||
else
|
||||
RwCameraSetNearClipPlane(Scene.camera, 0.05f);
|
||||
}
|
||||
if(CWorld::ProcessLineOfSight(TargetCoors, Source, colPoint, entity, true, dontCollideWithCars < 0.1f, false, true, false, true, true) && !IS_TRAFFIC_LIGHT(entity)){
|
||||
float PedColDist = (TargetCoors - colPoint.point).Magnitude();
|
||||
float ColCamDist = newDistance - PedColDist;
|
||||
if(entity->IsPed() && ColCamDist > DEFAULT_NEAR + 0.1f){
|
||||
// Ped in the way but not clipping through
|
||||
if(CWorld::ProcessLineOfSight(colPoint.point, Source, colPoint, entity, true, dontCollideWithCars < 0.1f, false, true, false, true, true) || IS_TRAFFIC_LIGHT(entity)){
|
||||
PedColDist = (TargetCoors - colPoint.point).Magnitude();
|
||||
Source = colPoint.point;
|
||||
if(PedColDist < DEFAULT_NEAR + 0.3f)
|
||||
RwCameraSetNearClipPlane(Scene.camera, Max(PedColDist-0.3f, 0.05f));
|
||||
}else{
|
||||
RwCameraSetNearClipPlane(Scene.camera, Min(ColCamDist-0.35f, DEFAULT_NEAR));
|
||||
}
|
||||
}else{
|
||||
Source = colPoint.point;
|
||||
if(PedColDist < DEFAULT_NEAR + 0.3f)
|
||||
RwCameraSetNearClipPlane(Scene.camera, Max(PedColDist-0.3f, 0.05f));
|
||||
}
|
||||
}
|
||||
|
||||
CWorld::pIgnoreEntity = nil;
|
||||
float nearClip = RwCameraGetNearClipPlane(Scene.camera);
|
||||
float radius = Tan(DEGTORAD(FOV * 0.5f)) * CDraw::GetAspectRatio() * 1.1f;
|
||||
|
||||
// If we're seeing blue hell due to camera intersects some surface, fix it.
|
||||
// SA and LCS have this unrolled.
|
||||
for (int i = 0;
|
||||
i <= 5 && CWorld::TestSphereAgainstWorld((nearClip * Front) + Source, radius * nearClip, nil, true, true, false, true, false, false);
|
||||
i++) {
|
||||
|
||||
CVector surfaceCamDist = gaTempSphereColPoints->point - Source;
|
||||
CVector frontButInvertedIfTouchesSurface = DotProduct(surfaceCamDist, Front) * Front;
|
||||
float newNearClip = (surfaceCamDist - frontButInvertedIfTouchesSurface).Magnitude() / radius;
|
||||
float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f);
|
||||
float ViewPlaneWidth = ViewPlaneHeight * CDraw::FindAspectRatio() * fTweakFOV;
|
||||
float Near = RwCameraGetNearClipPlane(Scene.camera);
|
||||
float radius = ViewPlaneWidth*Near;
|
||||
entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, true);
|
||||
int i = 0;
|
||||
while(entity){
|
||||
|
||||
if (newNearClip > nearClip)
|
||||
newNearClip = nearClip;
|
||||
if (newNearClip < 0.1f)
|
||||
newNearClip = 0.1f;
|
||||
if (nearClip > newNearClip)
|
||||
RwCameraSetNearClipPlane(Scene.camera, newNearClip);
|
||||
if (IS_TRAFFIC_LIGHT(entity))
|
||||
break;
|
||||
|
||||
if (newNearClip == 0.1f)
|
||||
Source += (TargetCoors - Source) * 0.3f;
|
||||
CVector CamToCol = gaTempSphereColPoints[0].point - Source;
|
||||
float frontDist = DotProduct(CamToCol, Front);
|
||||
float dist = (CamToCol - Front*frontDist).Magnitude() / ViewPlaneWidth;
|
||||
|
||||
nearClip = RwCameraGetNearClipPlane(Scene.camera);
|
||||
radius = Tan(DEGTORAD(FOV * 0.5f)) * CDraw::GetAspectRatio() * 1.1f;
|
||||
// Try to decrease near clip
|
||||
dist = Max(Min(Near, dist), 0.1f);
|
||||
if(dist < Near)
|
||||
RwCameraSetNearClipPlane(Scene.camera, dist);
|
||||
|
||||
// Move forward a bit
|
||||
if(dist == 0.1f)
|
||||
Source += (TargetCoors - Source)*0.3f;
|
||||
|
||||
// Keep testing
|
||||
Near = RwCameraGetNearClipPlane(Scene.camera);
|
||||
radius = ViewPlaneWidth*Near;
|
||||
entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, true);
|
||||
|
||||
i++;
|
||||
if(i > 5)
|
||||
entity = nil;
|
||||
}
|
||||
#undef IS_TRAFFIC_LIGHT
|
||||
}
|
||||
TheCamera.m_bCamDirectlyBehind = false;
|
||||
TheCamera.m_bCamDirectlyInFront = false;
|
||||
|
|
|
@ -1065,7 +1065,7 @@ CFileLoader::LoadMLOInstance(int id, const char *line)
|
|||
&rot.x, &rot.y, &rot.z,
|
||||
&angle);
|
||||
float rad = Acos(angle) * 2.0f;
|
||||
CInstance *inst = CModelInfo::GetMloInstanceStore().alloc();
|
||||
CInstance *inst = CModelInfo::GetMloInstanceStore().Alloc();
|
||||
minfo->lastInstance++;
|
||||
|
||||
RwMatrix *matrix = RwMatrixCreate();
|
||||
|
@ -1305,7 +1305,7 @@ CFileLoader::Load2dEffect(const char *line)
|
|||
CTxdStore::SetCurrentTxd(CTxdStore::FindTxdSlot("particle"));
|
||||
|
||||
mi = CModelInfo::GetModelInfo(id);
|
||||
effect = CModelInfo::Get2dEffectStore().alloc();
|
||||
effect = CModelInfo::Get2dEffectStore().Alloc();
|
||||
mi->Add2dEffect(effect);
|
||||
effect->pos = CVector(x, y, z);
|
||||
effect->col = CRGBA(r, g, b, a);
|
||||
|
|
|
@ -90,7 +90,11 @@ CFire::ProcessFire(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!FindPlayerVehicle() && !FindPlayerPed()->m_pFire && !(FindPlayerPed()->bFireProof)
|
||||
if (!FindPlayerVehicle() &&
|
||||
#ifdef FIX_BUGS
|
||||
FindPlayerPed() &&
|
||||
#endif
|
||||
!FindPlayerPed()->m_pFire && !(FindPlayerPed()->bFireProof)
|
||||
&& ((FindPlayerPed()->GetPosition() - m_vecPos).MagnitudeSqr() < 2.0f)) {
|
||||
FindPlayerPed()->DoStuffToGoOnFire();
|
||||
gFireManager.StartFire(FindPlayerPed(), m_pSource, 0.8f, 1);
|
||||
|
@ -224,7 +228,7 @@ CFireManager::StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength
|
|||
ped->bDrawLast = false;
|
||||
ped->SetMoveState(PEDMOVE_SPRINT);
|
||||
ped->SetMoveAnim();
|
||||
ped->m_nPedState = PED_ON_FIRE;
|
||||
ped->SetPedState(PED_ON_FIRE);
|
||||
}
|
||||
if (fleeFrom) {
|
||||
if (ped->m_nPedType == PEDTYPE_COP) {
|
||||
|
@ -397,7 +401,7 @@ CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strengt
|
|||
CVector2D pos = target->GetPosition();
|
||||
ped->SetFlee(pos, 10000);
|
||||
ped->SetMoveAnim();
|
||||
ped->m_nPedState = PED_ON_FIRE;
|
||||
ped->SetPedState(PED_ON_FIRE);
|
||||
}
|
||||
} else if (target->IsVehicle()) {
|
||||
veh->m_pCarFire = fire;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -25,15 +25,18 @@
|
|||
#define MENUSLIDER_X 256.0f
|
||||
#define MENUSLIDER_UNK 256.0f
|
||||
|
||||
#define BIGTEXT_X_SCALE 0.75f
|
||||
#define BIGTEXT_X_SCALE 0.75f // For FONT_HEADING
|
||||
#define BIGTEXT_Y_SCALE 0.9f
|
||||
#define MEDIUMTEXT_X_SCALE 0.55f
|
||||
#define MEDIUMTEXT_X_SCALE 0.55f // For FONT_HEADING
|
||||
#define MEDIUMTEXT_Y_SCALE 0.8f
|
||||
#define SMALLTEXT_X_SCALE 0.45f
|
||||
#define SMALLTEXT_X_SCALE 0.45f // used for FONT_HEADING and FONT_BANK, but looks off for HEADING
|
||||
#define SMALLTEXT_Y_SCALE 0.7f
|
||||
#define SMALLESTTEXT_X_SCALE 0.4f
|
||||
#define SMALLESTTEXT_X_SCALE 0.4f // used for both FONT_HEADING and FONT_BANK
|
||||
#define SMALLESTTEXT_Y_SCALE 0.6f
|
||||
|
||||
#define HELPER_TEXT_LEFT_MARGIN 320.0f
|
||||
#define HELPER_TEXT_BOTTOM_MARGIN 120.0f
|
||||
|
||||
#define PLAYERSETUP_LIST_TOP 28.0f
|
||||
#define PLAYERSETUP_LIST_BOTTOM 125.0f
|
||||
#define PLAYERSETUP_LIST_LEFT 200.0f
|
||||
|
@ -45,8 +48,6 @@
|
|||
#endif
|
||||
#define PLAYERSETUP_SCROLLBUTTON_HEIGHT 17.0f
|
||||
#define PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION 64
|
||||
#define PLAYERSETUP_ROW_TEXT_X_SCALE 0.4f
|
||||
#define PLAYERSETUP_ROW_TEXT_Y_SCALE 0.6f
|
||||
#define PLAYERSETUP_SKIN_COLUMN_LEFT 220.0f
|
||||
#define PLAYERSETUP_DATE_COLUMN_RIGHT 56.0f
|
||||
#define PLAYERSETUP_LIST_BODY_TOP 47
|
||||
|
@ -241,8 +242,6 @@ enum eMenuScreen
|
|||
|
||||
#ifdef GRAPHICS_MENU_OPTIONS
|
||||
MENUPAGE_GRAPHICS_SETTINGS,
|
||||
#else
|
||||
MENUPAGE_ADVANCED_DISPLAY_SETTINGS,
|
||||
#endif
|
||||
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
|
||||
MENUPAGE_DETECT_JOYSTICK,
|
||||
|
@ -697,8 +696,6 @@ public:
|
|||
|
||||
#ifdef MENU_MAP
|
||||
static bool bMenuMapActive;
|
||||
static bool bMapMouseShownOnce;
|
||||
static bool bMapLoaded;
|
||||
static float fMapSize;
|
||||
static float fMapCenterY;
|
||||
static float fMapCenterX;
|
||||
|
|
|
@ -5,7 +5,8 @@ enum eLevelName {
|
|||
LEVEL_GENERIC = 0,
|
||||
LEVEL_INDUSTRIAL,
|
||||
LEVEL_COMMERCIAL,
|
||||
LEVEL_SUBURBAN
|
||||
LEVEL_SUBURBAN,
|
||||
NUM_LEVELS
|
||||
};
|
||||
|
||||
class CGame
|
||||
|
|
|
@ -399,7 +399,12 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
|
|||
MENUACTION_SCREENRES, "FED_RES", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
|
||||
VIDEOMODE_SELECTOR
|
||||
MULTISAMPLING_SELECTOR
|
||||
MENUACTION_CHANGEMENU, "FET_ADV", { nil, SAVESLOT_NONE, MENUPAGE_ADVANCED_DISPLAY_SETTINGS },
|
||||
ISLAND_LOADING_SELECTOR
|
||||
DUALPASS_SELECTOR
|
||||
CUTSCENE_BORDERS_TOGGLE
|
||||
FREE_CAM_TOGGLE
|
||||
POSTFX_SELECTORS
|
||||
PIPELINES_SELECTOR
|
||||
MENUACTION_RESTOREDEF, "FET_DEF", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
|
||||
},
|
||||
|
@ -829,31 +834,12 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
|
|||
#else
|
||||
MENUACTION_TRAILS, "FED_TRA", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
|
||||
#endif
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
PIPELINES_SELECTOR
|
||||
#endif
|
||||
ISLAND_LOADING_SELECTOR
|
||||
DUALPASS_SELECTOR
|
||||
MENUACTION_CFO_DYNAMIC, "FET_DEF", { new CCFODynamic(nil, nil, nil, RestoreDefGraphics) },
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
|
||||
},
|
||||
#else
|
||||
// MENUPAGE_ADVANCED_DISPLAY_SETTINGS
|
||||
{ "FET_ADV", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS,
|
||||
new CCustomScreenLayout({MENUSPRITE_MAINMENU, 50, 0, 20, FONT_HEADING, FESCREEN_LEFT_ALIGN, true, MEDIUMTEXT_X_SCALE, MEDIUMTEXT_Y_SCALE}), nil,
|
||||
|
||||
ISLAND_LOADING_SELECTOR
|
||||
DUALPASS_SELECTOR
|
||||
CUTSCENE_BORDERS_TOGGLE
|
||||
FREE_CAM_TOGGLE
|
||||
#ifdef EXTENDED_COLOURFILTER
|
||||
POSTFX_SELECTORS
|
||||
#endif
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
PIPELINES_SELECTOR
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
|
||||
},
|
||||
#endif
|
||||
|
||||
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "Automobile.h"
|
||||
#include "Bridge.h"
|
||||
#include "Camera.h"
|
||||
#include "CarCtrl.h"
|
||||
#include "Cranes.h"
|
||||
#include "Darkel.h"
|
||||
#include "Explosion.h"
|
||||
|
@ -31,83 +32,6 @@
|
|||
#include "ZoneCull.h"
|
||||
#include "main.h"
|
||||
|
||||
void
|
||||
CPlayerInfo::SetPlayerSkin(char *skin)
|
||||
{
|
||||
strncpy(m_aSkinName, skin, 32);
|
||||
LoadPlayerSkin();
|
||||
}
|
||||
|
||||
const CVector &
|
||||
CPlayerInfo::GetPos()
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (!m_pPed)
|
||||
return TheCamera.GetPosition();
|
||||
#endif
|
||||
if (m_pPed->InVehicle())
|
||||
return m_pPed->m_pMyVehicle->GetPosition();
|
||||
return m_pPed->GetPosition();
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::LoadPlayerSkin()
|
||||
{
|
||||
DeletePlayerSkin();
|
||||
|
||||
m_pSkinTexture = CPlayerSkin::GetSkinTexture(m_aSkinName);
|
||||
if (!m_pSkinTexture)
|
||||
m_pSkinTexture = CPlayerSkin::GetSkinTexture(DEFAULT_SKIN_NAME);
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::DeletePlayerSkin()
|
||||
{
|
||||
if (m_pSkinTexture) {
|
||||
RwTextureDestroy(m_pSkinTexture);
|
||||
m_pSkinTexture = nil;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::KillPlayer()
|
||||
{
|
||||
if (m_WBState != WBSTATE_PLAYING) return;
|
||||
|
||||
m_WBState = WBSTATE_WASTED;
|
||||
m_nWBTime = CTimer::GetTimeInMilliseconds();
|
||||
CDarkel::ResetOnPlayerDeath();
|
||||
CMessages::AddBigMessage(TheText.Get("DEAD"), 4000, 2);
|
||||
CStats::TimesDied++;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::ArrestPlayer()
|
||||
{
|
||||
if (m_WBState != WBSTATE_PLAYING) return;
|
||||
|
||||
m_WBState = WBSTATE_BUSTED;
|
||||
m_nWBTime = CTimer::GetTimeInMilliseconds();
|
||||
CDarkel::ResetOnPlayerDeath();
|
||||
CMessages::AddBigMessage(TheText.Get("BUSTED"), 5000, 2);
|
||||
CStats::TimesArrested++;
|
||||
}
|
||||
|
||||
bool
|
||||
CPlayerInfo::IsPlayerInRemoteMode()
|
||||
{
|
||||
return m_pRemoteVehicle || m_bInRemoteMode;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::PlayerFailedCriticalMission()
|
||||
{
|
||||
if (m_WBState != WBSTATE_PLAYING)
|
||||
return;
|
||||
m_WBState = WBSTATE_FAILED_CRITICAL_MISSION;
|
||||
m_nWBTime = CTimer::GetTimeInMilliseconds();
|
||||
CDarkel::ResetOnPlayerDeath();
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::Clear(void)
|
||||
|
@ -146,197 +70,6 @@ CPlayerInfo::Clear(void)
|
|||
m_nExplosionsSinceLastReward = 0;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::BlowUpRCBuggy(void)
|
||||
{
|
||||
if (!m_pRemoteVehicle || m_pRemoteVehicle->bRemoveFromWorld)
|
||||
return;
|
||||
|
||||
CRemote::TakeRemoteControlledCarFromPlayer();
|
||||
m_pRemoteVehicle->BlowUpCar(FindPlayerPed());
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::CancelPlayerEnteringCars(CVehicle *car)
|
||||
{
|
||||
if (!car || car == m_pPed->m_pMyVehicle) {
|
||||
if (m_pPed->EnteringCar())
|
||||
m_pPed->QuitEnteringCar();
|
||||
}
|
||||
if (m_pPed->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER || m_pPed->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER)
|
||||
m_pPed->ClearObjective();
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::MakePlayerSafe(bool toggle)
|
||||
{
|
||||
if (toggle) {
|
||||
CTheScripts::ResetCountdownToMakePlayerUnsafe();
|
||||
m_pPed->m_pWanted->m_bIgnoredByEveryone = true;
|
||||
CWorld::StopAllLawEnforcersInTheirTracks();
|
||||
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PLAYERINFO);
|
||||
CPad::StopPadsShaking();
|
||||
m_pPed->bBulletProof = true;
|
||||
m_pPed->bFireProof = true;
|
||||
m_pPed->bCollisionProof = true;
|
||||
m_pPed->bMeleeProof = true;
|
||||
m_pPed->bOnlyDamagedByPlayer = true;
|
||||
m_pPed->bExplosionProof = true;
|
||||
m_pPed->m_bCanBeDamaged = false;
|
||||
((CPlayerPed*)m_pPed)->ClearAdrenaline();
|
||||
CancelPlayerEnteringCars(nil);
|
||||
gFireManager.ExtinguishPoint(GetPos(), 4000.0f);
|
||||
CExplosion::RemoveAllExplosionsInArea(GetPos(), 4000.0f);
|
||||
CProjectileInfo::RemoveAllProjectiles();
|
||||
CWorld::SetAllCarsCanBeDamaged(false);
|
||||
CWorld::ExtinguishAllCarFiresInArea(GetPos(), 4000.0f);
|
||||
CReplay::DisableReplays();
|
||||
|
||||
} else if (!CGame::playingIntro && !CTheScripts::IsCountdownToMakePlayerUnsafeOn()) {
|
||||
m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
|
||||
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PLAYERINFO);
|
||||
m_pPed->bBulletProof = false;
|
||||
m_pPed->bFireProof = false;
|
||||
m_pPed->bCollisionProof = false;
|
||||
m_pPed->bMeleeProof = false;
|
||||
m_pPed->bOnlyDamagedByPlayer = false;
|
||||
m_pPed->bExplosionProof = false;
|
||||
m_pPed->m_bCanBeDamaged = true;
|
||||
CWorld::SetAllCarsCanBeDamaged(true);
|
||||
CReplay::EnableReplays();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CPlayerInfo::IsRestartingAfterDeath()
|
||||
{
|
||||
return m_WBState == WBSTATE_WASTED;
|
||||
}
|
||||
|
||||
bool
|
||||
CPlayerInfo::IsRestartingAfterArrest()
|
||||
{
|
||||
return m_WBState == WBSTATE_BUSTED;
|
||||
}
|
||||
|
||||
// lastCloseness is passed to other calls of this function
|
||||
void
|
||||
CPlayerInfo::EvaluateCarPosition(CEntity *carToTest, CPed *player, float carBoundCentrePedDist, float *lastCloseness, CVehicle **closestCarOutput)
|
||||
{
|
||||
// This dist used for determining the angle to face
|
||||
CVector2D dist(carToTest->GetPosition() - player->GetPosition());
|
||||
float neededTurn = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y) - CGeneral::GetATanOfXY(dist.x, dist.y);
|
||||
while (neededTurn >= PI) {
|
||||
neededTurn -= 2 * PI;
|
||||
}
|
||||
|
||||
while (neededTurn < -PI) {
|
||||
neededTurn += 2 * PI;
|
||||
}
|
||||
|
||||
// This dist used for evaluating cars' distances, weird...
|
||||
// Accounts inverted needed turn (or needed turn in long way) and car dist.
|
||||
float closeness = (1.0f - Abs(neededTurn) / TWOPI) * (10.0f - carBoundCentrePedDist);
|
||||
if (closeness > *lastCloseness) {
|
||||
*lastCloseness = closeness;
|
||||
*closestCarOutput = (CVehicle*)carToTest;
|
||||
}
|
||||
}
|
||||
|
||||
// There is something unfinished in here... Sadly all IDBs we have have it unfinished.
|
||||
void
|
||||
CPlayerInfo::AwardMoneyForExplosion(CVehicle *wreckedCar)
|
||||
{
|
||||
if (CTimer::GetTimeInMilliseconds() - m_nPreviousTimeRewardedForExplosion < 6000)
|
||||
++m_nExplosionsSinceLastReward;
|
||||
else
|
||||
m_nExplosionsSinceLastReward = 1;
|
||||
|
||||
m_nPreviousTimeRewardedForExplosion = CTimer::GetTimeInMilliseconds();
|
||||
int award = wreckedCar->pHandling->nMonetaryValue * 0.002f;
|
||||
sprintf(gString, "$%d", award);
|
||||
#ifdef MONEY_MESSAGES
|
||||
// This line is a leftover from PS2, I don't know what it was meant to be.
|
||||
// CVector sth(TheCamera.GetPosition() * 4.0f);
|
||||
|
||||
CMoneyMessages::RegisterOne(wreckedCar->GetPosition() + CVector(0.0f, 0.0f, 2.0f), gString, 0, 255, 0, 2.0f, 0.5f);
|
||||
#endif
|
||||
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += award;
|
||||
|
||||
for (int i = m_nExplosionsSinceLastReward; i > 1; --i) {
|
||||
CGeneral::GetRandomNumber();
|
||||
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += award;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::SavePlayerInfo(uint8 *buf, uint32 *size)
|
||||
{
|
||||
// Interesting
|
||||
*size = sizeof(CPlayerInfo);
|
||||
|
||||
#define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); buf += sizeof(data);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nMoney);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_WBState);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nWBTime);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTrafficMultiplier);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_fRoadDensity);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTotalPackages);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bInfiniteSprint);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bFastReload);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfJailFree);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfHospitalFree);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_aPlayerName);
|
||||
#undef CopyToBuf
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::LoadPlayerInfo(uint8 *buf, uint32 size)
|
||||
{
|
||||
#define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); buf += sizeof(data);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nMoney);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_WBState);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nWBTime);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTrafficMultiplier);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_fRoadDensity);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTotalPackages);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bInfiniteSprint);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bFastReload);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfJailFree);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfHospitalFree);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_aPlayerName)
|
||||
#undef CopyFromBuf
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1, float unk2, float unk3, float unk4, float* lastCloseness, CVehicle** closestCarOutput)
|
||||
{
|
||||
for (CPtrNode* node = carList.first; node; node = node->next) {
|
||||
CVehicle *car = (CVehicle*)node->item;
|
||||
if(car->m_scanCode != CWorld::GetCurrentScanCode()) {
|
||||
if (!car->bUsesCollision || !car->IsVehicle())
|
||||
continue;
|
||||
|
||||
car->m_scanCode = CWorld::GetCurrentScanCode();
|
||||
if (car->GetStatus() != STATUS_WRECKED && car->GetStatus() != STATUS_TRAIN_MOVING
|
||||
&& (car->GetUp().z > 0.3f || (car->IsVehicle() && ((CVehicle*)car)->m_vehType == VEHICLE_TYPE_BIKE))) {
|
||||
CVector carCentre = car->GetBoundCentre();
|
||||
|
||||
if (Abs(ped->GetPosition().z - carCentre.z) < 2.0f) {
|
||||
float dist = (ped->GetPosition() - carCentre).Magnitude2D();
|
||||
if (dist <= 10.0f && !CCranes::IsThisCarBeingCarriedByAnyCrane(car)) {
|
||||
EvaluateCarPosition(car, ped, dist, lastCloseness, closestCarOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::Process(void)
|
||||
{
|
||||
|
@ -419,7 +152,7 @@ CPlayerInfo::Process(void)
|
|||
|
||||
if (found)
|
||||
sth.z = 1.0f + groundZ;
|
||||
m_pPed->m_nPedState = PED_IDLE;
|
||||
m_pPed->SetPedState(PED_IDLE);
|
||||
m_pPed->SetMoveState(PEDMOVE_STILL);
|
||||
CPed::PedSetOutCarCB(0, m_pPed);
|
||||
CAnimManager::BlendAnimation(m_pPed->GetClump(), m_pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
||||
|
@ -503,13 +236,13 @@ CPlayerInfo::Process(void)
|
|||
uint32 timeWithoutRemoteCar = CTimer::GetTimeInMilliseconds() - m_nTimeLostRemoteCar;
|
||||
if (CTimer::GetPreviousTimeInMilliseconds() - m_nTimeLostRemoteCar < 1000 && timeWithoutRemoteCar >= 1000 && m_WBState == WBSTATE_PLAYING) {
|
||||
TheCamera.SetFadeColour(0, 0, 0);
|
||||
TheCamera.Fade(1.0f, 0);
|
||||
TheCamera.Fade(1.0f, FADE_OUT);
|
||||
}
|
||||
if (timeWithoutRemoteCar > 2000) {
|
||||
if (m_WBState == WBSTATE_PLAYING) {
|
||||
TheCamera.RestoreWithJumpCut();
|
||||
TheCamera.SetFadeColour(0, 0, 0);
|
||||
TheCamera.Fade(1.0f, 1);
|
||||
TheCamera.Fade(1.0f, FADE_IN);
|
||||
TheCamera.Process();
|
||||
CTimer::Stop();
|
||||
CCullZones::ForceCullZoneCoors(TheCamera.GetPosition());
|
||||
|
@ -560,3 +293,370 @@ CPlayerInfo::Process(void)
|
|||
CStats::DistanceTravelledOnFoot += FindPlayerPed()->m_fDistanceTravelled;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CPlayerInfo::IsPlayerInRemoteMode()
|
||||
{
|
||||
return m_pRemoteVehicle || m_bInRemoteMode;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::SavePlayerInfo(uint8 *buf, uint32 *size)
|
||||
{
|
||||
// Interesting
|
||||
*size = sizeof(CPlayerInfo);
|
||||
|
||||
#define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); buf += sizeof(data);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nMoney);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_WBState);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nWBTime);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTrafficMultiplier);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_fRoadDensity);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTotalPackages);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bInfiniteSprint);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bFastReload);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfJailFree);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfHospitalFree);
|
||||
CopyToBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_aPlayerName);
|
||||
#undef CopyToBuf
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::LoadPlayerInfo(uint8 *buf, uint32 size)
|
||||
{
|
||||
#define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); buf += sizeof(data);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nMoney);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_WBState);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nWBTime);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTrafficMultiplier);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_fRoadDensity);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_nTotalPackages);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bInfiniteSprint);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bFastReload);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfJailFree);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_bGetOutOfHospitalFree);
|
||||
CopyFromBuf(buf, CWorld::Players[CWorld::PlayerInFocus].m_aPlayerName)
|
||||
#undef CopyFromBuf
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1, float unk2, float unk3, float unk4, float* lastCloseness, CVehicle** closestCarOutput)
|
||||
{
|
||||
for (CPtrNode* node = carList.first; node; node = node->next) {
|
||||
CVehicle *car = (CVehicle*)node->item;
|
||||
if(car->m_scanCode != CWorld::GetCurrentScanCode()) {
|
||||
if (!car->bUsesCollision || !car->IsVehicle())
|
||||
continue;
|
||||
|
||||
car->m_scanCode = CWorld::GetCurrentScanCode();
|
||||
if (car->GetStatus() != STATUS_WRECKED && car->GetStatus() != STATUS_TRAIN_MOVING
|
||||
&& (car->GetUp().z > 0.3f || (car->IsVehicle() && ((CVehicle*)car)->m_vehType == VEHICLE_TYPE_BIKE))) {
|
||||
CVector carCentre = car->GetBoundCentre();
|
||||
|
||||
if (Abs(ped->GetPosition().z - carCentre.z) < 2.0f) {
|
||||
float dist = (ped->GetPosition() - carCentre).Magnitude2D();
|
||||
if (dist <= 10.0f && !CCranes::IsThisCarBeingCarriedByAnyCrane(car)) {
|
||||
EvaluateCarPosition(car, ped, dist, lastCloseness, closestCarOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// lastCloseness is passed to other calls of this function
|
||||
void
|
||||
CPlayerInfo::EvaluateCarPosition(CEntity *carToTest, CPed *player, float carBoundCentrePedDist, float *lastCloseness, CVehicle **closestCarOutput)
|
||||
{
|
||||
// This dist used for determining the angle to face
|
||||
CVector2D dist(carToTest->GetPosition() - player->GetPosition());
|
||||
float neededTurn = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y) - CGeneral::GetATanOfXY(dist.x, dist.y);
|
||||
while (neededTurn >= PI) {
|
||||
neededTurn -= 2 * PI;
|
||||
}
|
||||
|
||||
while (neededTurn < -PI) {
|
||||
neededTurn += 2 * PI;
|
||||
}
|
||||
|
||||
// This dist used for evaluating cars' distances, weird...
|
||||
// Accounts inverted needed turn (or needed turn in long way) and car dist.
|
||||
float closeness = (1.0f - Abs(neededTurn) / TWOPI) * (10.0f - carBoundCentrePedDist);
|
||||
if (closeness > *lastCloseness) {
|
||||
*lastCloseness = closeness;
|
||||
*closestCarOutput = (CVehicle*)carToTest;
|
||||
}
|
||||
}
|
||||
|
||||
const CVector &
|
||||
CPlayerInfo::GetPos()
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (!m_pPed)
|
||||
return TheCamera.GetPosition();
|
||||
#endif
|
||||
if (m_pPed->InVehicle())
|
||||
return m_pPed->m_pMyVehicle->GetPosition();
|
||||
return m_pPed->GetPosition();
|
||||
}
|
||||
|
||||
CVector
|
||||
FindPlayerCoors(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (CReplay::IsPlayingBack())
|
||||
return TheCamera.GetPosition();
|
||||
#endif
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle->GetPosition();
|
||||
else
|
||||
return ped->GetPosition();
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerSpeed(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
static CVector vecTmpVector(0.0f, 0.0f, 0.0f);
|
||||
if (CReplay::IsPlayingBack())
|
||||
return vecTmpVector;
|
||||
#endif
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle->m_vecMoveSpeed;
|
||||
else
|
||||
return ped->m_vecMoveSpeed;
|
||||
}
|
||||
|
||||
CVehicle *
|
||||
FindPlayerVehicle(void)
|
||||
{
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped && ped->InVehicle()) return ped->m_pMyVehicle;
|
||||
return nil;
|
||||
}
|
||||
|
||||
CEntity *
|
||||
FindPlayerEntity(void)
|
||||
{
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle;
|
||||
else
|
||||
return ped;
|
||||
}
|
||||
|
||||
CVehicle *
|
||||
FindPlayerTrain(void)
|
||||
{
|
||||
if(FindPlayerVehicle() && FindPlayerVehicle()->IsTrain())
|
||||
return FindPlayerVehicle();
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
CPlayerPed *
|
||||
FindPlayerPed(void)
|
||||
{
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pPed;
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld(int32 player)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if(CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||
#endif
|
||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||
if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||
return CWorld::Players[player].m_pPed->GetPosition();
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld_NoSniperShift(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||
#endif
|
||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||
return FindPlayerPed()->GetPosition();
|
||||
}
|
||||
|
||||
float
|
||||
FindPlayerHeading(void)
|
||||
{
|
||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetForward().Heading();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetForward().Heading();
|
||||
return FindPlayerPed()->GetForward().Heading();
|
||||
}
|
||||
|
||||
bool
|
||||
CPlayerInfo::IsRestartingAfterDeath()
|
||||
{
|
||||
return m_WBState == WBSTATE_WASTED;
|
||||
}
|
||||
|
||||
bool
|
||||
CPlayerInfo::IsRestartingAfterArrest()
|
||||
{
|
||||
return m_WBState == WBSTATE_BUSTED;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::KillPlayer()
|
||||
{
|
||||
if (m_WBState != WBSTATE_PLAYING) return;
|
||||
|
||||
m_WBState = WBSTATE_WASTED;
|
||||
m_nWBTime = CTimer::GetTimeInMilliseconds();
|
||||
CDarkel::ResetOnPlayerDeath();
|
||||
CMessages::AddBigMessage(TheText.Get("DEAD"), 4000, 2);
|
||||
CStats::TimesDied++;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::ArrestPlayer()
|
||||
{
|
||||
if (m_WBState != WBSTATE_PLAYING) return;
|
||||
|
||||
m_WBState = WBSTATE_BUSTED;
|
||||
m_nWBTime = CTimer::GetTimeInMilliseconds();
|
||||
CDarkel::ResetOnPlayerDeath();
|
||||
CMessages::AddBigMessage(TheText.Get("BUSTED"), 5000, 2);
|
||||
CStats::TimesArrested++;
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::PlayerFailedCriticalMission()
|
||||
{
|
||||
if (m_WBState != WBSTATE_PLAYING)
|
||||
return;
|
||||
m_WBState = WBSTATE_FAILED_CRITICAL_MISSION;
|
||||
m_nWBTime = CTimer::GetTimeInMilliseconds();
|
||||
CDarkel::ResetOnPlayerDeath();
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::CancelPlayerEnteringCars(CVehicle *car)
|
||||
{
|
||||
if (!car || car == m_pPed->m_pMyVehicle) {
|
||||
if (m_pPed->EnteringCar())
|
||||
m_pPed->QuitEnteringCar();
|
||||
}
|
||||
if (m_pPed->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER || m_pPed->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER)
|
||||
m_pPed->ClearObjective();
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::MakePlayerSafe(bool toggle)
|
||||
{
|
||||
if (toggle) {
|
||||
CTheScripts::ResetCountdownToMakePlayerUnsafe();
|
||||
m_pPed->m_pWanted->m_bIgnoredByEveryone = true;
|
||||
CWorld::StopAllLawEnforcersInTheirTracks();
|
||||
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PLAYERINFO);
|
||||
CPad::StopPadsShaking();
|
||||
m_pPed->bBulletProof = true;
|
||||
m_pPed->bFireProof = true;
|
||||
m_pPed->bCollisionProof = true;
|
||||
m_pPed->bMeleeProof = true;
|
||||
m_pPed->bOnlyDamagedByPlayer = true;
|
||||
m_pPed->bExplosionProof = true;
|
||||
m_pPed->m_bCanBeDamaged = false;
|
||||
((CPlayerPed*)m_pPed)->ClearAdrenaline();
|
||||
CancelPlayerEnteringCars(nil);
|
||||
gFireManager.ExtinguishPoint(GetPos(), 4000.0f);
|
||||
CExplosion::RemoveAllExplosionsInArea(GetPos(), 4000.0f);
|
||||
CProjectileInfo::RemoveAllProjectiles();
|
||||
CWorld::SetAllCarsCanBeDamaged(false);
|
||||
CWorld::ExtinguishAllCarFiresInArea(GetPos(), 4000.0f);
|
||||
CReplay::DisableReplays();
|
||||
|
||||
} else if (!CGame::playingIntro && !CTheScripts::IsCountdownToMakePlayerUnsafeOn()) {
|
||||
m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
|
||||
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PLAYERINFO);
|
||||
m_pPed->bBulletProof = false;
|
||||
m_pPed->bFireProof = false;
|
||||
m_pPed->bCollisionProof = false;
|
||||
m_pPed->bMeleeProof = false;
|
||||
m_pPed->bOnlyDamagedByPlayer = false;
|
||||
m_pPed->bExplosionProof = false;
|
||||
m_pPed->m_bCanBeDamaged = true;
|
||||
CWorld::SetAllCarsCanBeDamaged(true);
|
||||
CReplay::EnableReplays();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::BlowUpRCBuggy(void)
|
||||
{
|
||||
if (!m_pRemoteVehicle || m_pRemoteVehicle->bRemoveFromWorld)
|
||||
return;
|
||||
|
||||
CRemote::TakeRemoteControlledCarFromPlayer();
|
||||
m_pRemoteVehicle->BlowUpCar(FindPlayerPed());
|
||||
}
|
||||
|
||||
// There is something unfinished in here... Sadly all IDBs we have have it unfinished.
|
||||
void
|
||||
CPlayerInfo::AwardMoneyForExplosion(CVehicle *wreckedCar)
|
||||
{
|
||||
if (CTimer::GetTimeInMilliseconds() - m_nPreviousTimeRewardedForExplosion < 6000)
|
||||
++m_nExplosionsSinceLastReward;
|
||||
else
|
||||
m_nExplosionsSinceLastReward = 1;
|
||||
|
||||
m_nPreviousTimeRewardedForExplosion = CTimer::GetTimeInMilliseconds();
|
||||
int award = wreckedCar->pHandling->nMonetaryValue * 0.002f;
|
||||
sprintf(gString, "$%d", award);
|
||||
#ifdef MONEY_MESSAGES
|
||||
// This line is a leftover from PS2, I don't know what it was meant to be.
|
||||
// CVector sth(TheCamera.GetPosition() * 4.0f);
|
||||
|
||||
CMoneyMessages::RegisterOne(wreckedCar->GetPosition() + CVector(0.0f, 0.0f, 2.0f), gString, 0, 255, 0, 2.0f, 0.5f);
|
||||
#endif
|
||||
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += award;
|
||||
|
||||
for (int i = m_nExplosionsSinceLastReward; i > 1; --i) {
|
||||
CGeneral::GetRandomNumber();
|
||||
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += award;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GTA_PC
|
||||
void
|
||||
CPlayerInfo::SetPlayerSkin(const char *skin)
|
||||
{
|
||||
strncpy(m_aSkinName, skin, 32);
|
||||
LoadPlayerSkin();
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::LoadPlayerSkin()
|
||||
{
|
||||
DeletePlayerSkin();
|
||||
|
||||
m_pSkinTexture = CPlayerSkin::GetSkinTexture(m_aSkinName);
|
||||
if (!m_pSkinTexture)
|
||||
m_pSkinTexture = CPlayerSkin::GetSkinTexture(DEFAULT_SKIN_NAME);
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::DeletePlayerSkin()
|
||||
{
|
||||
if (m_pSkinTexture) {
|
||||
RwTextureDestroy(m_pSkinTexture);
|
||||
m_pSkinTexture = nil;
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -54,14 +54,13 @@ public:
|
|||
bool m_bFastReload;
|
||||
bool m_bGetOutOfJailFree;
|
||||
bool m_bGetOutOfHospitalFree;
|
||||
#ifdef GTA_PC
|
||||
char m_aSkinName[32];
|
||||
RwTexture *m_pSkinTexture;
|
||||
#endif
|
||||
|
||||
void MakePlayerSafe(bool);
|
||||
void LoadPlayerSkin();
|
||||
void DeletePlayerSkin();
|
||||
void AwardMoneyForExplosion(CVehicle *vehicle);
|
||||
void SetPlayerSkin(char* skin);
|
||||
const CVector &GetPos();
|
||||
void Process(void);
|
||||
void KillPlayer(void);
|
||||
|
@ -78,7 +77,21 @@ public:
|
|||
void SavePlayerInfo(uint8 *buf, uint32* size);
|
||||
void FindClosestCarSectorList(CPtrList&, CPed*, float, float, float, float, float*, CVehicle**);
|
||||
|
||||
~CPlayerInfo() { };
|
||||
#ifdef GTA_PC
|
||||
void LoadPlayerSkin();
|
||||
void SetPlayerSkin(const char *skin);
|
||||
void DeletePlayerSkin();
|
||||
#endif
|
||||
};
|
||||
|
||||
CPlayerPed *FindPlayerPed(void);
|
||||
CVehicle *FindPlayerVehicle(void);
|
||||
CVehicle *FindPlayerTrain(void);
|
||||
CEntity *FindPlayerEntity(void);
|
||||
CVector FindPlayerCoors(void);
|
||||
const CVector &FindPlayerSpeed(void);
|
||||
const CVector &FindPlayerCentreOfWorld(int32 player);
|
||||
const CVector &FindPlayerCentreOfWorld_NoSniperShift(void);
|
||||
float FindPlayerHeading(void);
|
||||
|
||||
VALIDATE_SIZE(CPlayerInfo, 0x13C);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
|
||||
|
||||
CPtrList CWorld::ms_bigBuildingsList[4];
|
||||
CPtrList CWorld::ms_bigBuildingsList[NUM_LEVELS];
|
||||
CPtrList CWorld::ms_listMovingEntityPtrs;
|
||||
CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
|
||||
uint16 CWorld::ms_nCurrentScanCode;
|
||||
|
@ -1361,102 +1361,6 @@ CWorld::FindMissionEntitiesIntersectingCubeSectorList(CPtrList &list, const CVec
|
|||
}
|
||||
}
|
||||
|
||||
CPlayerPed *
|
||||
FindPlayerPed(void)
|
||||
{
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pPed;
|
||||
}
|
||||
|
||||
CVehicle *
|
||||
FindPlayerVehicle(void)
|
||||
{
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped && ped->InVehicle()) return ped->m_pMyVehicle;
|
||||
return nil;
|
||||
}
|
||||
|
||||
CVehicle *
|
||||
FindPlayerTrain(void)
|
||||
{
|
||||
if(FindPlayerVehicle() && FindPlayerVehicle()->IsTrain())
|
||||
return FindPlayerVehicle();
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
CEntity *
|
||||
FindPlayerEntity(void)
|
||||
{
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle;
|
||||
else
|
||||
return ped;
|
||||
}
|
||||
|
||||
CVector
|
||||
FindPlayerCoors(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (CReplay::IsPlayingBack())
|
||||
return TheCamera.GetPosition();
|
||||
#endif
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle->GetPosition();
|
||||
else
|
||||
return ped->GetPosition();
|
||||
}
|
||||
|
||||
CVector &
|
||||
FindPlayerSpeed(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
static CVector vecTmpVector(0.0f, 0.0f, 0.0f);
|
||||
if (CReplay::IsPlayingBack())
|
||||
return vecTmpVector;
|
||||
#endif
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle->m_vecMoveSpeed;
|
||||
else
|
||||
return ped->m_vecMoveSpeed;
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld(int32 player)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if(CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||
#endif
|
||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||
if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||
return CWorld::Players[player].m_pPed->GetPosition();
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld_NoSniperShift(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||
#endif
|
||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||
return FindPlayerPed()->GetPosition();
|
||||
}
|
||||
|
||||
float
|
||||
FindPlayerHeading(void)
|
||||
{
|
||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetForward().Heading();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetForward().Heading();
|
||||
return FindPlayerPed()->GetForward().Heading();
|
||||
}
|
||||
|
||||
void
|
||||
CWorld::ClearCarsFromArea(float x1, float y1, float z1, float x2, float y2, float z2)
|
||||
{
|
||||
|
@ -1537,7 +1441,7 @@ CWorld::CallOffChaseForAreaSectorListVehicles(CPtrList &list, float x1, float y1
|
|||
if(pVehicle->m_scanCode != GetCurrentScanCode()) {
|
||||
pVehicle->m_scanCode = GetCurrentScanCode();
|
||||
const CVector &vehiclePos = pVehicle->GetPosition();
|
||||
eCarMission carMission = pVehicle->AutoPilot.m_nCarMission;
|
||||
uint8 carMission = pVehicle->AutoPilot.m_nCarMission;
|
||||
if(pVehicle != FindPlayerVehicle() && vehiclePos.x > fStartX && vehiclePos.x < fEndX &&
|
||||
vehiclePos.y > fStartY && vehiclePos.y < fEndY && pVehicle->bIsLawEnforcer &&
|
||||
(carMission == MISSION_RAMPLAYER_FARAWAY || carMission == MISSION_RAMPLAYER_CLOSE ||
|
||||
|
@ -1745,13 +1649,13 @@ CWorld::ShutDown(void)
|
|||
pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush();
|
||||
#endif
|
||||
}
|
||||
for(int32 i = 0; i < 4; i++) {
|
||||
for(CPtrNode *pNode = GetBigBuildingList((eLevelName)i).first; pNode; pNode = pNode->next) {
|
||||
for(int32 i = 0; i < NUM_LEVELS; i++) {
|
||||
for(CPtrNode *pNode = ms_bigBuildingsList[i].first; pNode; pNode = pNode->next) {
|
||||
CEntity *pEntity = (CEntity *)pNode->item;
|
||||
// Maybe remove from world here?
|
||||
delete pEntity;
|
||||
}
|
||||
GetBigBuildingList((eLevelName)i).Flush();
|
||||
ms_bigBuildingsList[i].Flush();
|
||||
}
|
||||
for(int i = 0; i < NUMSECTORS_X * NUMSECTORS_Y; i++) {
|
||||
CSector *pSector = GetSector(i % NUMSECTORS_X, i / NUMSECTORS_Y);
|
||||
|
@ -1955,12 +1859,11 @@ CWorld::Process(void)
|
|||
} else {
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CEntity *movingEnt = (CEntity *)node->item;
|
||||
#ifdef SQUEEZE_PERFORMANCE
|
||||
if (movingEnt->bRemoveFromWorld) {
|
||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||
} else
|
||||
#endif
|
||||
#ifdef FIX_BUGS // from VC
|
||||
if(!movingEnt->bRemoveFromWorld && movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
|
||||
#else
|
||||
if(movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
|
||||
#endif
|
||||
RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) {
|
||||
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(),
|
||||
0.02f * (movingEnt->IsObject()
|
||||
|
|
|
@ -55,7 +55,7 @@ struct CStoredCollPoly;
|
|||
|
||||
class CWorld
|
||||
{
|
||||
static CPtrList ms_bigBuildingsList[4];
|
||||
static CPtrList ms_bigBuildingsList[NUM_LEVELS];
|
||||
static CPtrList ms_listMovingEntityPtrs;
|
||||
static CSector ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
|
||||
static uint16 ms_nCurrentScanCode;
|
||||
|
@ -157,14 +157,3 @@ public:
|
|||
|
||||
extern CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
|
||||
|
||||
class CPlayerPed;
|
||||
class CVehicle;
|
||||
CPlayerPed *FindPlayerPed(void);
|
||||
CVehicle *FindPlayerVehicle(void);
|
||||
CVehicle *FindPlayerTrain(void);
|
||||
CEntity *FindPlayerEntity(void);
|
||||
CVector FindPlayerCoors(void);
|
||||
CVector &FindPlayerSpeed(void);
|
||||
const CVector &FindPlayerCentreOfWorld(int32 player);
|
||||
const CVector &FindPlayerCentreOfWorld_NoSniperShift(void);
|
||||
float FindPlayerHeading(void);
|
||||
|
|
|
@ -274,8 +274,14 @@ void re3_usererror(const char *format, ...);
|
|||
|
||||
#define DEBUGBREAK() __debugbreak();
|
||||
|
||||
#define debug(f, ...) re3_debug("[DBG]: " f, ## __VA_ARGS__)
|
||||
// Switch to enable development messages.
|
||||
#if 1
|
||||
#define DEV(f, ...)
|
||||
#else
|
||||
#define DEV(f, ...) re3_debug("[DEV]: " f, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define debug(f, ...) re3_debug("[DBG]: " f, ## __VA_ARGS__)
|
||||
#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__)
|
||||
#define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__)
|
||||
#define USERERROR(f, ...) re3_usererror(f, ## __VA_ARGS__)
|
||||
|
|
|
@ -300,7 +300,7 @@ enum Config {
|
|||
# define CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
# ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Advanced Options menu will appear if Display is full
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
|
||||
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
# define CUTSCENE_BORDERS_SWITCH
|
||||
# define MULTISAMPLING // adds MSAA option
|
||||
|
|
|
@ -415,6 +415,63 @@ PluginAttach(void)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef GTA_PS2
|
||||
#define NUM_PREALLOC_ATOMICS 3245
|
||||
#define NUM_PREALLOC_CLUMPS 101
|
||||
#define NUM_PREALLOC_FRAMES 2821
|
||||
#define NUM_PREALLOC_GEOMETRIES 1404
|
||||
#define NUM_PREALLOC_TEXDICTS 106
|
||||
#define NUM_PREALLOC_TEXTURES 1900
|
||||
#define NUM_PREALLOC_MATERIALS 3300
|
||||
bool preAlloc;
|
||||
|
||||
void
|
||||
PreAllocateRwObjects(void)
|
||||
{
|
||||
int i;
|
||||
void **tmp = new void*[0x8000];
|
||||
preAlloc = true;
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_ATOMICS; i++)
|
||||
tmp[i] = RpAtomicCreate();
|
||||
for(i = 0; i < NUM_PREALLOC_ATOMICS; i++)
|
||||
RpAtomicDestroy((RpAtomic*)tmp[i]);
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_CLUMPS; i++)
|
||||
tmp[i] = RpClumpCreate();
|
||||
for(i = 0; i < NUM_PREALLOC_CLUMPS; i++)
|
||||
RpClumpDestroy((RpClump*)tmp[i]);
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_FRAMES; i++)
|
||||
tmp[i] = RwFrameCreate();
|
||||
for(i = 0; i < NUM_PREALLOC_FRAMES; i++)
|
||||
RwFrameDestroy((RwFrame*)tmp[i]);
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_GEOMETRIES; i++)
|
||||
tmp[i] = RpGeometryCreate(0, 0, 0);
|
||||
for(i = 0; i < NUM_PREALLOC_GEOMETRIES; i++)
|
||||
RpGeometryDestroy((RpGeometry*)tmp[i]);
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_TEXDICTS; i++)
|
||||
tmp[i] = RwTexDictionaryCreate();
|
||||
for(i = 0; i < NUM_PREALLOC_TEXDICTS; i++)
|
||||
RwTexDictionaryDestroy((RwTexDictionary*)tmp[i]);
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_TEXTURES; i++)
|
||||
tmp[i] = RwTextureCreate(RwRasterCreate(0, 0, 0, 0));
|
||||
for(i = 0; i < NUM_PREALLOC_TEXDICTS; i++)
|
||||
RwTextureDestroy((RwTexture*)tmp[i]);
|
||||
|
||||
for(i = 0; i < NUM_PREALLOC_MATERIALS; i++)
|
||||
tmp[i] = RpMaterialCreate();
|
||||
for(i = 0; i < NUM_PREALLOC_MATERIALS; i++)
|
||||
RpMaterialDestroy((RpMaterial*)tmp[i]);
|
||||
|
||||
delete[] tmp;
|
||||
preAlloc = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static RwBool
|
||||
Initialise3D(void *param)
|
||||
{
|
||||
|
@ -621,8 +678,10 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
|
|||
AsciiToUnicode(str1, tmpstr);
|
||||
CFont::PrintString(hpos, vpos, tmpstr);
|
||||
vpos += 22*yscale;
|
||||
AsciiToUnicode(str2, tmpstr);
|
||||
CFont::PrintString(hpos, vpos, tmpstr);
|
||||
if (str2) {
|
||||
AsciiToUnicode(str2, tmpstr);
|
||||
CFont::PrintString(hpos, vpos, tmpstr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1581,15 +1640,6 @@ AppEventHandler(RsEvent event, void *param)
|
|||
return rsEVENTPROCESSED;
|
||||
}
|
||||
|
||||
#ifndef MASTER
|
||||
case rsANIMVIEWER:
|
||||
{
|
||||
TheModelViewer();
|
||||
|
||||
return rsEVENTPROCESSED;
|
||||
}
|
||||
#endif
|
||||
|
||||
default:
|
||||
{
|
||||
return rsEVENTNOTPROCESSED;
|
||||
|
@ -1604,8 +1654,11 @@ TheModelViewer(void)
|
|||
#if (defined(GTA_PS2) || defined(GTA_XBOX))
|
||||
//TODO
|
||||
#else
|
||||
// This is III Mobile code. III Xbox code run it like main function, which is impossible to implement on PC's state machine implementation.
|
||||
// Also we want 2D things initialized in here to print animation ids etc., our additions for that marked with X
|
||||
|
||||
#ifdef ASPECT_RATIO_SCALE
|
||||
CDraw::SetAspectRatio(CDraw::FindAspectRatio());
|
||||
CDraw::SetAspectRatio(CDraw::FindAspectRatio()); // X
|
||||
#endif
|
||||
CAnimViewer::Update();
|
||||
CTimer::Update();
|
||||
|
@ -1615,12 +1668,12 @@ TheModelViewer(void)
|
|||
CTimeCycle::GetSkyBottomRed(), CTimeCycle::GetSkyBottomGreen(), CTimeCycle::GetSkyBottomBlue(),
|
||||
255);
|
||||
|
||||
CSprite2d::InitPerFrame();
|
||||
CFont::InitPerFrame();
|
||||
CSprite2d::InitPerFrame(); // X
|
||||
CFont::InitPerFrame(); // X
|
||||
DefinedState();
|
||||
CVisibilityPlugins::InitAlphaEntityList();
|
||||
CAnimViewer::Render();
|
||||
Render2dStuff();
|
||||
Render2dStuff(); // X
|
||||
DoRWStuffEndOfFrame();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class CSprite2d;
|
|||
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
|
||||
bool DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
|
||||
void DoRWStuffEndOfFrame(void);
|
||||
void PreAllocateRwObjects(void);
|
||||
void InitialiseGame(void);
|
||||
void LoadingScreen(const char *str1, const char *str2, const char *splashscreen);
|
||||
void LoadingIslandScreen(const char *levelName);
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
template<typename T, int n>
|
||||
template<typename T, int32 n>
|
||||
class CStore
|
||||
{
|
||||
public:
|
||||
int allocPtr;
|
||||
int32 allocPtr;
|
||||
T store[n];
|
||||
|
||||
T *alloc(void){
|
||||
if(this->allocPtr >= n){
|
||||
T *Alloc(void){
|
||||
if(allocPtr >= n){
|
||||
printf("Size of this thing:%d needs increasing\n", n);
|
||||
assert(0);
|
||||
}
|
||||
return &this->store[this->allocPtr++];
|
||||
return &store[allocPtr++];
|
||||
}
|
||||
void clear(void){
|
||||
this->allocPtr = 0;
|
||||
void Clear(void){
|
||||
allocPtr = 0;
|
||||
}
|
||||
int getIndex(T *item){
|
||||
assert(item >= &this->store[0]);
|
||||
assert(item < &this->store[n]);
|
||||
return item - this->store;
|
||||
int32 GetIndex(T *item){
|
||||
assert(item >= &store[0]);
|
||||
assert(item < &store[n]);
|
||||
return item - store;
|
||||
}
|
||||
T *getItem(int index){
|
||||
T *GetItem(int32 index){
|
||||
assert(index >= 0);
|
||||
assert(index < n);
|
||||
return &this->store[index];
|
||||
return &store[index];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -40,12 +40,11 @@ class CPool
|
|||
};
|
||||
uint8 u;
|
||||
} *m_flags;
|
||||
int m_size;
|
||||
int m_allocPtr;
|
||||
int32 m_size;
|
||||
int32 m_allocPtr;
|
||||
|
||||
public:
|
||||
CPool(int size){
|
||||
// TODO: use new here
|
||||
CPool(int32 size){
|
||||
m_entries = (U*)new uint8[sizeof(U)*size];
|
||||
m_flags = (Flags*)new uint8[sizeof(Flags)*size];
|
||||
m_size = size;
|
||||
|
@ -69,7 +68,7 @@ public:
|
|||
m_allocPtr = 0;
|
||||
}
|
||||
}
|
||||
int GetSize(void) const { return m_size; }
|
||||
int32 GetSize(void) const { return m_size; }
|
||||
T *New(void){
|
||||
bool wrapped = false;
|
||||
do
|
||||
|
@ -93,12 +92,12 @@ public:
|
|||
m_flags[m_allocPtr].id++;
|
||||
return (T*)&m_entries[m_allocPtr];
|
||||
}
|
||||
T *New(int handle){
|
||||
T *New(int32 handle){
|
||||
T *entry = (T*)&m_entries[handle>>8];
|
||||
SetNotFreeAt(handle);
|
||||
return entry;
|
||||
}
|
||||
void SetNotFreeAt(int handle){
|
||||
void SetNotFreeAt(int32 handle){
|
||||
int idx = handle>>8;
|
||||
m_flags[idx].free = 0;
|
||||
m_flags[idx].id = handle & 0x7F;
|
||||
|
@ -123,21 +122,21 @@ public:
|
|||
return m_flags[handle>>8].u == (handle & 0xFF) ?
|
||||
(T*)&m_entries[handle >> 8] : nil;
|
||||
}
|
||||
int GetIndex(T *entry){
|
||||
int32 GetIndex(T *entry){
|
||||
int i = GetJustIndex_NoFreeAssert(entry);
|
||||
return m_flags[i].u + (i<<8);
|
||||
}
|
||||
int GetJustIndex(T *entry){
|
||||
int32 GetJustIndex(T *entry){
|
||||
int index = GetJustIndex_NoFreeAssert(entry);
|
||||
assert(!IsFreeSlot(index));
|
||||
return index;
|
||||
}
|
||||
int GetJustIndex_NoFreeAssert(T* entry){
|
||||
int32 GetJustIndex_NoFreeAssert(T* entry){
|
||||
int index = ((U*)entry - m_entries);
|
||||
assert((U*)entry == (U*)&m_entries[index]); // cast is unsafe - check required
|
||||
return index;
|
||||
}
|
||||
int GetNoOfUsedSpaces(void) const{
|
||||
int32 GetNoOfUsedSpaces(void) const{
|
||||
int i;
|
||||
int n = 0;
|
||||
for(i = 0; i < m_size; i++)
|
||||
|
@ -241,7 +240,7 @@ public:
|
|||
link->Remove(); // remove from list
|
||||
freeHead.Insert(link); // insert into free list
|
||||
}
|
||||
int Count(void){
|
||||
int32 Count(void){
|
||||
int n = 0;
|
||||
CLink<T> *lnk;
|
||||
for(lnk = head.next; lnk != &tail; lnk = lnk->next)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
struct CReference;
|
||||
class CPtrList;
|
||||
|
||||
enum eEntityType : uint8
|
||||
enum eEntityType
|
||||
{
|
||||
ENTITY_TYPE_NOTHING = 0,
|
||||
ENTITY_TYPE_BUILDING,
|
||||
|
@ -16,7 +16,7 @@ enum eEntityType : uint8
|
|||
ENTITY_TYPE_DUMMY,
|
||||
};
|
||||
|
||||
enum eEntityStatus : uint8
|
||||
enum eEntityStatus
|
||||
{
|
||||
STATUS_PLAYER,
|
||||
STATUS_PLAYER_PLAYBACKFROMBUFFER,
|
||||
|
@ -92,10 +92,10 @@ public:
|
|||
CReference *m_pFirstReference;
|
||||
|
||||
public:
|
||||
eEntityType GetType() const { return (eEntityType)m_type; }
|
||||
void SetType(eEntityType type) { m_type = type; }
|
||||
eEntityStatus GetStatus() const { return (eEntityStatus)m_status; }
|
||||
void SetStatus(eEntityStatus status) { m_status = status; }
|
||||
uint8 GetType() const { return m_type; }
|
||||
void SetType(uint8 type) { m_type = type; }
|
||||
uint8 GetStatus() const { return m_status; }
|
||||
void SetStatus(uint8 status) { m_status = status; }
|
||||
CColModel *GetColModel(void) { return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); }
|
||||
bool GetIsStatic(void) const { return bIsStatic; }
|
||||
void SetIsStatic(bool state) { bIsStatic = state; }
|
||||
|
|
|
@ -384,9 +384,9 @@ ScreenDroplets::ProcessCameraMovement(void)
|
|||
ms_prevCamUp = camUp;
|
||||
ms_prevCamPos = camPos;
|
||||
|
||||
ms_screenMoveDelta.x = -RwV3dDotProduct(&camMat->right, (RwV3d*)&ms_camMoveDelta);
|
||||
ms_screenMoveDelta.y = RwV3dDotProduct(&camMat->up, (RwV3d*)&ms_camMoveDelta);
|
||||
ms_screenMoveDelta.z = RwV3dDotProduct(&camMat->at, (RwV3d*)&ms_camMoveDelta);
|
||||
ms_screenMoveDelta.x = -RwV3dDotProduct(&camMat->right, &ms_camMoveDelta);
|
||||
ms_screenMoveDelta.y = RwV3dDotProduct(&camMat->up, &ms_camMoveDelta);
|
||||
ms_screenMoveDelta.z = RwV3dDotProduct(&camMat->at, &ms_camMoveDelta);
|
||||
ms_screenMoveDelta *= 10.0f;
|
||||
ms_screenMoveDist = ms_screenMoveDelta.Magnitude2D();
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ public:
|
|||
float MagnitudeSqr(void) const { return x*x + y*y + z*z + w*w; }
|
||||
void Normalise(void);
|
||||
void Multiply(const CQuaternion &q1, const CQuaternion &q2);
|
||||
void Invert(void){ // Conjugate would have been a better name
|
||||
x = -x;
|
||||
y = -y;
|
||||
z = -z;
|
||||
}
|
||||
|
||||
const CQuaternion &operator+=(CQuaternion const &right) {
|
||||
x += right.x;
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
class CVector
|
||||
class CVector : public RwV3d
|
||||
{
|
||||
public:
|
||||
float x, y, z;
|
||||
CVector(void) {}
|
||||
CVector(float x, float y, float z) : x(x), y(y), z(z) {}
|
||||
#ifdef RWCORE_H
|
||||
CVector(const RwV3d &v) : x(v.x), y(v.y), z(v.z) {}
|
||||
CVector(float x, float y, float z)
|
||||
{
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
|
||||
operator RwV3d (void) const {
|
||||
RwV3d vecRw = { this->x, this->y, this->z };
|
||||
return vecRw;
|
||||
CVector(const RwV3d &v)
|
||||
{
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
z = v.z;
|
||||
}
|
||||
|
||||
operator RwV3d *(void) {
|
||||
return (RwV3d*)this;
|
||||
}
|
||||
#endif
|
||||
// (0,1,0) means no rotation. So get right vector and its atan
|
||||
float Heading(void) const { return Atan2(-x, y); }
|
||||
float Magnitude(void) const { return Sqrt(x*x + y*y + z*z); }
|
||||
|
|
|
@ -8,18 +8,7 @@ public:
|
|||
CVuVector(float x, float y, float z) : CVector(x, y, z) {}
|
||||
CVuVector(float x, float y, float z, float w) : CVector(x, y, z), w(w) {}
|
||||
CVuVector(const CVector &v) : CVector(v.x, v.y, v.z) {}
|
||||
#ifdef RWCORE_H
|
||||
CVuVector(const RwV3d &v) : CVector(v.x, v.y, v.z) {}
|
||||
|
||||
operator RwV3d (void) const {
|
||||
RwV3d vecRw = { this->x, this->y, this->z };
|
||||
return vecRw;
|
||||
}
|
||||
|
||||
operator RwV3d *(void) {
|
||||
return (RwV3d*)this;
|
||||
}
|
||||
#endif
|
||||
CVuVector(const RwV3d &v) : CVector(v) {}
|
||||
/*
|
||||
void Normalise(void) {
|
||||
float sq = MagnitudeSqr();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#define MAX_MODEL_NAME (24)
|
||||
|
||||
enum ModelInfoType : uint8
|
||||
enum ModelInfoType
|
||||
{
|
||||
MITYPE_NA = 0,
|
||||
MITYPE_SIMPLE = 1,
|
||||
|
@ -15,7 +15,6 @@ enum ModelInfoType : uint8
|
|||
MITYPE_PED = 6,
|
||||
MITYPE_XTRACOMPS = 7,
|
||||
};
|
||||
VALIDATE_SIZE(ModelInfoType, 1);
|
||||
|
||||
class C2dEffect;
|
||||
|
||||
|
@ -28,7 +27,7 @@ protected:
|
|||
int16 m_objectId;
|
||||
uint16 m_refCount;
|
||||
int16 m_txdSlot;
|
||||
ModelInfoType m_type;
|
||||
uint8 m_type;
|
||||
uint8 m_num2dEffects;
|
||||
bool m_bOwnsColModel;
|
||||
#ifdef EXTRA_MODEL_FLAGS
|
||||
|
@ -50,7 +49,7 @@ public:
|
|||
virtual RwObject *GetRwObject(void) = 0;
|
||||
|
||||
// one day it becomes virtual
|
||||
ModelInfoType GetModelType() const { return m_type; }
|
||||
uint8 GetModelType() const { return m_type; }
|
||||
bool IsSimple(void) { return m_type == MITYPE_SIMPLE || m_type == MITYPE_TIME; }
|
||||
bool IsClump(void) { return m_type == MITYPE_CLUMP || m_type == MITYPE_PED || m_type == MITYPE_VEHICLE ||
|
||||
m_type == MITYPE_MLO || m_type == MITYPE_XTRACOMPS; // unused but what the heck
|
||||
|
|
|
@ -26,15 +26,15 @@ CModelInfo::Initialise(void)
|
|||
|
||||
for(i = 0; i < MODELINFOSIZE; i++)
|
||||
ms_modelInfoPtrs[i] = nil;
|
||||
ms_2dEffectStore.clear();
|
||||
ms_mloInstanceStore.clear();
|
||||
ms_xtraCompsModelStore.clear();
|
||||
ms_simpleModelStore.clear();
|
||||
ms_timeModelStore.clear();
|
||||
ms_mloModelStore.clear();
|
||||
ms_clumpModelStore.clear();
|
||||
ms_pedModelStore.clear();
|
||||
ms_vehicleModelStore.clear();
|
||||
ms_2dEffectStore.Clear();
|
||||
ms_mloInstanceStore.Clear();
|
||||
ms_xtraCompsModelStore.Clear();
|
||||
ms_simpleModelStore.Clear();
|
||||
ms_timeModelStore.Clear();
|
||||
ms_mloModelStore.Clear();
|
||||
ms_clumpModelStore.Clear();
|
||||
ms_pedModelStore.Clear();
|
||||
ms_vehicleModelStore.Clear();
|
||||
|
||||
m = AddSimpleModel(MI_CAR_DOOR);
|
||||
m->SetColModel(&CTempColModels::ms_colModelDoor1);
|
||||
|
@ -108,22 +108,22 @@ CModelInfo::ShutDown(void)
|
|||
for(i = 0; i < ms_2dEffectStore.allocPtr; i++)
|
||||
ms_2dEffectStore.store[i].Shutdown();
|
||||
|
||||
ms_2dEffectStore.clear();
|
||||
ms_simpleModelStore.clear();
|
||||
ms_mloInstanceStore.clear();
|
||||
ms_mloModelStore.clear();
|
||||
ms_xtraCompsModelStore.clear();
|
||||
ms_timeModelStore.clear();
|
||||
ms_pedModelStore.clear();
|
||||
ms_clumpModelStore.clear();
|
||||
ms_vehicleModelStore.clear();
|
||||
ms_2dEffectStore.Clear();
|
||||
ms_simpleModelStore.Clear();
|
||||
ms_mloInstanceStore.Clear();
|
||||
ms_mloModelStore.Clear();
|
||||
ms_xtraCompsModelStore.Clear();
|
||||
ms_timeModelStore.Clear();
|
||||
ms_pedModelStore.Clear();
|
||||
ms_clumpModelStore.Clear();
|
||||
ms_vehicleModelStore.Clear();
|
||||
}
|
||||
|
||||
CSimpleModelInfo*
|
||||
CModelInfo::AddSimpleModel(int id)
|
||||
{
|
||||
CSimpleModelInfo *modelinfo;
|
||||
modelinfo = CModelInfo::ms_simpleModelStore.alloc();
|
||||
modelinfo = CModelInfo::ms_simpleModelStore.Alloc();
|
||||
CModelInfo::ms_modelInfoPtrs[id] = modelinfo;
|
||||
modelinfo->Init();
|
||||
return modelinfo;
|
||||
|
@ -133,7 +133,7 @@ CMloModelInfo *
|
|||
CModelInfo::AddMloModel(int id)
|
||||
{
|
||||
CMloModelInfo *modelinfo;
|
||||
modelinfo = CModelInfo::ms_mloModelStore.alloc();
|
||||
modelinfo = CModelInfo::ms_mloModelStore.Alloc();
|
||||
CModelInfo::ms_modelInfoPtrs[id] = modelinfo;
|
||||
modelinfo->m_clump = nil;
|
||||
modelinfo->firstInstance = 0;
|
||||
|
@ -145,7 +145,7 @@ CTimeModelInfo*
|
|||
CModelInfo::AddTimeModel(int id)
|
||||
{
|
||||
CTimeModelInfo *modelinfo;
|
||||
modelinfo = CModelInfo::ms_timeModelStore.alloc();
|
||||
modelinfo = CModelInfo::ms_timeModelStore.Alloc();
|
||||
CModelInfo::ms_modelInfoPtrs[id] = modelinfo;
|
||||
modelinfo->Init();
|
||||
return modelinfo;
|
||||
|
@ -155,7 +155,7 @@ CClumpModelInfo*
|
|||
CModelInfo::AddClumpModel(int id)
|
||||
{
|
||||
CClumpModelInfo *modelinfo;
|
||||
modelinfo = CModelInfo::ms_clumpModelStore.alloc();
|
||||
modelinfo = CModelInfo::ms_clumpModelStore.Alloc();
|
||||
CModelInfo::ms_modelInfoPtrs[id] = modelinfo;
|
||||
modelinfo->m_clump = nil;
|
||||
return modelinfo;
|
||||
|
@ -165,7 +165,7 @@ CPedModelInfo*
|
|||
CModelInfo::AddPedModel(int id)
|
||||
{
|
||||
CPedModelInfo *modelinfo;
|
||||
modelinfo = CModelInfo::ms_pedModelStore.alloc();
|
||||
modelinfo = CModelInfo::ms_pedModelStore.Alloc();
|
||||
CModelInfo::ms_modelInfoPtrs[id] = modelinfo;
|
||||
modelinfo->m_clump = nil;
|
||||
return modelinfo;
|
||||
|
@ -175,7 +175,7 @@ CVehicleModelInfo*
|
|||
CModelInfo::AddVehicleModel(int id)
|
||||
{
|
||||
CVehicleModelInfo *modelinfo;
|
||||
modelinfo = CModelInfo::ms_vehicleModelStore.alloc();
|
||||
modelinfo = CModelInfo::ms_vehicleModelStore.Alloc();
|
||||
CModelInfo::ms_modelInfoPtrs[id] = modelinfo;
|
||||
modelinfo->m_clump = nil;
|
||||
modelinfo->m_vehicleType = -1;
|
||||
|
@ -245,7 +245,7 @@ CModelInfo::ConstructMloClumps()
|
|||
void
|
||||
CModelInfo::ReInit2dEffects()
|
||||
{
|
||||
ms_2dEffectStore.clear();
|
||||
ms_2dEffectStore.Clear();
|
||||
|
||||
for (int i = 0; i < MODELINFOSIZE; i++) {
|
||||
if (ms_modelInfoPtrs[i])
|
||||
|
|
|
@ -471,7 +471,7 @@ CVehicleModelInfo::PreprocessHierarchy(void)
|
|||
|
||||
if(desc[i].flags & VEHICLE_FLAG_POS){
|
||||
f = assoc.frame;
|
||||
rwvec = (RwV3d*)&m_positions[desc[i].hierId];
|
||||
rwvec = &m_positions[desc[i].hierId];
|
||||
*rwvec = *RwMatrixGetPos(RwFrameGetMatrix(f));
|
||||
for(f = RwFrameGetParent(f); f; f = RwFrameGetParent(f))
|
||||
RwV3dTransformPoints(rwvec, rwvec, 1, RwFrameGetMatrix(f));
|
||||
|
|
|
@ -209,15 +209,15 @@ CObject::ObjectDamage(float amount)
|
|||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
const RwRGBA color = { 96, 48, 0, 255 };
|
||||
for (int32 i = 0; i < 25; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.25f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
float fRandom = CGeneral::GetRandomNumberInRange(0.01f, 1.0f);
|
||||
RwRGBA randomColor = { uint8(color.red * fRandom), uint8(color.green * fRandom) , color.blue, color.alpha };
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.20f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 40);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, randomColor, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(SCRIPT_SOUND_BOX_DESTROYED_2, vecPos);
|
||||
|
@ -232,15 +232,15 @@ CObject::ObjectDamage(float amount)
|
|||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
const RwRGBA color = { 128, 128, 128, 255 };
|
||||
for (int32 i = 0; i < 45; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.25f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
float fRandom = CGeneral::GetRandomNumberInRange(0.5f, 0.5f);
|
||||
float fRandom = CGeneral::GetRandomNumberInRange(0.5f, 1.0f);
|
||||
RwRGBA randomColor = { uint8(color.red * fRandom), uint8(color.green * fRandom), uint8(color.blue * fRandom), color.alpha };
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.20f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 40);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, randomColor, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(SCRIPT_SOUND_BOX_DESTROYED_1, vecPos);
|
||||
|
@ -256,16 +256,16 @@ CObject::ObjectDamage(float amount)
|
|||
const RwRGBA color1 = { 200, 0, 0, 255 };
|
||||
const RwRGBA color2 = { 200, 200, 200, 255 };
|
||||
for (int32 i = 0; i < 10; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.25f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
RwRGBA color = color2;
|
||||
if (nFrameGen & 1)
|
||||
color = color1;
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.20f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 40);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, color, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(SCRIPT_SOUND_TIRE_COLLISION, vecPos);
|
||||
|
@ -281,16 +281,16 @@ CObject::ObjectDamage(float amount)
|
|||
const RwRGBA color1 = { 200, 0, 0, 255 };
|
||||
const RwRGBA color2 = { 200, 200, 200, 255 };
|
||||
for (int32 i = 0; i < 32; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.35f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.25f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
RwRGBA color = color2;
|
||||
if (nFrameGen & 1)
|
||||
color = color1;
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.20f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 40);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, color, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(SCRIPT_SOUND_METAL_COLLISION, vecPos);
|
||||
|
@ -389,7 +389,7 @@ CObject::DeleteAllTempObjectsInArea(CVector point, float fRadius)
|
|||
CObjectPool *objectPool = CPools::GetObjectPool();
|
||||
for (int32 i = 0; i < objectPool->GetSize(); i++) {
|
||||
CObject *pObject = objectPool->GetSlot(i);
|
||||
if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && fRadius * fRadius > pObject->GetPosition().MagnitudeSqr()) {
|
||||
if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && (point - pObject->GetPosition()).MagnitudeSqr() < SQR(fRadius)) {
|
||||
CWorld::Remove(pObject);
|
||||
delete pObject;
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ CCivilianPed::ProcessControl(void)
|
|||
} else {
|
||||
crimeReporters[m_phoneId] = this;
|
||||
m_facePhoneStart = true;
|
||||
m_nPedState = PED_FACE_PHONE;
|
||||
SetPedState(PED_FACE_PHONE);
|
||||
}
|
||||
#else
|
||||
} else if (bRunningToPhone) {
|
||||
|
@ -283,7 +283,7 @@ CCivilianPed::ProcessControl(void)
|
|||
m_phoneId = -1;
|
||||
} else {
|
||||
gPhoneInfo.m_aPhones[m_phoneId].m_nState = PHONE_STATE_REPORTING_CRIME;
|
||||
m_nPedState = PED_FACE_PHONE;
|
||||
SetPedState(PED_FACE_PHONE);
|
||||
}
|
||||
#endif
|
||||
} else if (m_objective != OBJECTIVE_KILL_CHAR_ANY_MEANS && m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) {
|
||||
|
@ -305,7 +305,7 @@ CCivilianPed::ProcessControl(void)
|
|||
break;
|
||||
case PED_FACE_PHONE:
|
||||
if (FacePhone())
|
||||
m_nPedState = PED_MAKE_CALL;
|
||||
SetPedState(PED_MAKE_CALL);
|
||||
break;
|
||||
case PED_MAKE_CALL:
|
||||
if (MakePhonecall())
|
||||
|
@ -331,7 +331,7 @@ CCivilianPed::ProcessControl(void)
|
|||
for (int j = 0; j < m_numNearPeds; ++j) {
|
||||
CPed *nearPed = m_nearPeds[j];
|
||||
if (nearPed->m_nPedType == m_nPedType && nearPed->m_nPedState == PED_WANDER_PATH) {
|
||||
nearPed->m_nPedState = PED_UNKNOWN;
|
||||
nearPed->SetPedState(PED_UNKNOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP)
|
|||
m_bStopAndShootDisabledZone = false;
|
||||
m_bZoneDisabled = false;
|
||||
field_1364 = -1;
|
||||
m_pPointGunAt = nil;
|
||||
SetWeaponLockOnTarget(nil);
|
||||
|
||||
// VC also initializes in here, but as nil
|
||||
#ifdef FIX_BUGS
|
||||
|
@ -114,14 +114,14 @@ CCopPed::SetArrestPlayer(CPed *player)
|
|||
|
||||
} else if (player->m_nPedState != PED_DIE && player->m_nPedState != PED_DEAD && player->m_nPedState != PED_ARRESTED) {
|
||||
player->m_nLastPedState = player->m_nPedState;
|
||||
player->m_nPedState = PED_ARRESTED;
|
||||
player->SetPedState(PED_ARRESTED);
|
||||
|
||||
FindPlayerPed()->m_bCanBeDamaged = false;
|
||||
((CPlayerPed*)player)->m_pArrestingCop = this;
|
||||
this->RegisterReference((CEntity**) &((CPlayerPed*)player)->m_pArrestingCop);
|
||||
}
|
||||
|
||||
m_nPedState = PED_ARREST_PLAYER;
|
||||
SetPedState(PED_ARREST_PLAYER);
|
||||
SetObjective(OBJECTIVE_NONE);
|
||||
m_prevObjective = OBJECTIVE_NONE;
|
||||
bIsPointingGunAt = false;
|
||||
|
@ -229,7 +229,7 @@ CCopPed::ArrestPlayer(void)
|
|||
CPed *suspect = (CPed*)m_pSeekTarget;
|
||||
if (suspect) {
|
||||
if (suspect->CanSetPedState())
|
||||
suspect->m_nPedState = PED_ARRESTED;
|
||||
suspect->SetPedState(PED_ARRESTED);
|
||||
|
||||
if (suspect->bInVehicle && m_pMyVehicle && suspect->m_pMyVehicle == m_pMyVehicle) {
|
||||
|
||||
|
@ -244,7 +244,7 @@ CCopPed::ArrestPlayer(void)
|
|||
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ARREST_GUN, 4.0f);
|
||||
|
||||
CVector suspMidPos;
|
||||
suspect->m_pedIK.GetComponentPosition((RwV3d*)suspMidPos, PED_MID);
|
||||
suspect->m_pedIK.GetComponentPosition(suspMidPos, PED_MID);
|
||||
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(suspMidPos.x, suspMidPos.y,
|
||||
GetPosition().x, GetPosition().y);
|
||||
|
||||
|
@ -472,10 +472,7 @@ CCopPed::CopAI(void)
|
|||
if (!CWorld::ProcessLineOfSight(gunPos, playerOrHisVeh->GetPosition(), foundCol, foundEnt,
|
||||
false, true, false, false, true, false, false)
|
||||
|| foundEnt && foundEnt == playerOrHisVeh) {
|
||||
m_pPointGunAt = playerOrHisVeh;
|
||||
if (playerOrHisVeh)
|
||||
playerOrHisVeh->RegisterReference((CEntity**) &m_pPointGunAt);
|
||||
|
||||
SetWeaponLockOnTarget(playerOrHisVeh);
|
||||
SetAttack(playerOrHisVeh);
|
||||
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 1000));
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ CEmergencyPed::FiremanAI(void)
|
|||
case EMERGENCY_PED_READY:
|
||||
nearestFire = gFireManager.FindNearestFire(GetPosition(), &fireDist);
|
||||
if (nearestFire) {
|
||||
m_nPedState = PED_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
SetSeek(nearestFire->m_vecPos, 1.0f);
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
|
||||
|
@ -114,7 +114,7 @@ CEmergencyPed::FiremanAI(void)
|
|||
case EMERGENCY_PED_DETERMINE_NEXT_STATE:
|
||||
nearestFire = gFireManager.FindNearestFire(GetPosition(), &fireDist);
|
||||
if (nearestFire && nearestFire != m_pAttendedFire) {
|
||||
m_nPedState = PED_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
SetSeek(nearestFire->m_vecPos, 1.0f);
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
#ifdef FIX_BUGS
|
||||
|
@ -160,7 +160,7 @@ CEmergencyPed::FiremanAI(void)
|
|||
#endif
|
||||
--m_pAttendedFire->m_nFiremenPuttingOut;
|
||||
|
||||
m_nPedState = PED_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
SetWanderPath(CGeneral::GetRandomNumber() & 7);
|
||||
m_pAttendedFire = nil;
|
||||
m_nEmergencyPedState = EMERGENCY_PED_READY;
|
||||
|
@ -234,8 +234,8 @@ CEmergencyPed::MedicAI(void)
|
|||
if (nearestAccident) {
|
||||
m_pRevivedPed = nearestAccident->m_pVictim;
|
||||
m_pRevivedPed->RegisterReference((CEntity**)&m_pRevivedPed);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(headPos, PED_HEAD);
|
||||
SetSeek((headPos + midPos) * 0.5f, 1.0f);
|
||||
SetObjective(OBJECTIVE_NONE);
|
||||
bIsRunning = true;
|
||||
|
@ -274,8 +274,8 @@ CEmergencyPed::MedicAI(void)
|
|||
m_nEmergencyPedState = EMERGENCY_PED_STOP;
|
||||
break;
|
||||
}
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(headPos, PED_HEAD);
|
||||
SetSeek((headPos + midPos) * 0.5f, nearestAccident->m_nMedicsPerformingCPR * 0.5f + 1.0f);
|
||||
SetObjective(OBJECTIVE_NONE);
|
||||
bIsRunning = true;
|
||||
|
@ -307,7 +307,7 @@ CEmergencyPed::MedicAI(void)
|
|||
} else {
|
||||
m_pRevivedPed->m_bloodyFootprintCountOrDeathTime = CTimer::GetTimeInMilliseconds();
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
m_nPedState = PED_CPR;
|
||||
SetPedState(PED_CPR);
|
||||
m_nLastPedState = PED_CPR;
|
||||
SetLookFlag(m_pRevivedPed, 0);
|
||||
SetLookTimer(500);
|
||||
|
@ -329,8 +329,8 @@ CEmergencyPed::MedicAI(void)
|
|||
if (!m_pRevivedPed || m_pRevivedPed->m_fHealth > 0.0f)
|
||||
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
|
||||
else {
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(headPos, PED_HEAD);
|
||||
midPos = (headPos + midPos) * 0.5f;
|
||||
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
|
||||
midPos.x, midPos.y,
|
||||
|
@ -351,8 +351,8 @@ CEmergencyPed::MedicAI(void)
|
|||
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
|
||||
break;
|
||||
}
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(midPos, PED_MID);
|
||||
m_pRevivedPed->m_pedIK.GetComponentPosition(headPos, PED_HEAD);
|
||||
midPos = (headPos + midPos) * 0.5f;
|
||||
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
|
||||
midPos.x, midPos.y,
|
||||
|
@ -366,12 +366,12 @@ CEmergencyPed::MedicAI(void)
|
|||
break;
|
||||
}
|
||||
m_nEmergencyPedState = EMERGENCY_PED_STOP_CPR;
|
||||
m_nPedState = PED_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
SetMoveState(PEDMOVE_WALK);
|
||||
m_pVehicleAnim = nil;
|
||||
if (!m_pRevivedPed->bBodyPartJustCameOff) {
|
||||
m_pRevivedPed->m_fHealth = 100.0f;
|
||||
m_pRevivedPed->m_nPedState = PED_NONE;
|
||||
m_pRevivedPed->SetPedState(PED_NONE);
|
||||
m_pRevivedPed->m_nLastPedState = PED_WANDER_PATH;
|
||||
m_pRevivedPed->SetGetUp();
|
||||
m_pRevivedPed->bUsesCollision = true;
|
||||
|
@ -400,7 +400,7 @@ CEmergencyPed::MedicAI(void)
|
|||
break;
|
||||
case EMERGENCY_PED_STOP:
|
||||
m_bStartedToCPR = false;
|
||||
m_nPedState = PED_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
if (m_pAttendedAccident) {
|
||||
m_pAttendedAccident->m_pVictim = nil;
|
||||
--m_pAttendedAccident->m_nMedicsAttending;
|
||||
|
|
101
src/peds/Ped.cpp
101
src/peds/Ped.cpp
|
@ -641,7 +641,7 @@ CPed::RestorePreviousState(void)
|
|||
return;
|
||||
|
||||
if (InVehicle()) {
|
||||
m_nPedState = PED_DRIVING;
|
||||
SetPedState(PED_DRIVING);
|
||||
m_nLastPedState = PED_NONE;
|
||||
} else {
|
||||
if (m_nLastPedState == PED_NONE) {
|
||||
|
@ -658,7 +658,7 @@ CPed::RestorePreviousState(void)
|
|||
SetIdle();
|
||||
break;
|
||||
case PED_WANDER_PATH:
|
||||
m_nPedState = PED_WANDER_PATH;
|
||||
SetPedState(PED_WANDER_PATH);
|
||||
bIsRunning = false;
|
||||
if (bFindNewNodeAfterStateRestore) {
|
||||
if (m_pNextPathNode) {
|
||||
|
@ -672,7 +672,7 @@ CPed::RestorePreviousState(void)
|
|||
SetWanderPath(CGeneral::GetRandomNumber() & 7);
|
||||
break;
|
||||
default:
|
||||
m_nPedState = m_nLastPedState;
|
||||
SetPedState(m_nLastPedState);
|
||||
SetMoveState((eMoveState) m_nPrevMoveState);
|
||||
break;
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ CPed::MoveHeadToLook(void)
|
|||
}
|
||||
|
||||
if (m_pLookTarget->IsPed()) {
|
||||
((CPed*)m_pLookTarget)->m_pedIK.GetComponentPosition((RwV3d*) &lookPos, PED_MID);
|
||||
((CPed*)m_pLookTarget)->m_pedIK.GetComponentPosition(lookPos, PED_MID);
|
||||
} else {
|
||||
lookPos = m_pLookTarget->GetPosition();
|
||||
}
|
||||
|
@ -1511,8 +1511,8 @@ CPed::ClearAll(void)
|
|||
if (!IsPedInControl() && m_nPedState != PED_DEAD)
|
||||
return;
|
||||
|
||||
m_nPedState = PED_NONE;
|
||||
m_nMoveState = PEDMOVE_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
SetMoveState(PEDMOVE_NONE);
|
||||
m_pSeekTarget = nil;
|
||||
m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_fleeFromPosX = 0.0f;
|
||||
|
@ -1585,7 +1585,7 @@ CPed::ProcessBuoyancy(void)
|
|||
CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, pos, CVector(0.0f, 0.0f, 0.0f), 0.0f, 50, CRGBA(0, 0, 0, 0), true);
|
||||
#endif
|
||||
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_nPedState = PED_IDLE;
|
||||
SetPedState(PED_IDLE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2692,36 +2692,6 @@ CPed::ProcessControl(void)
|
|||
case PED_WANDER_PATH:
|
||||
WanderPath();
|
||||
break;
|
||||
case PED_SEEK_POS:
|
||||
case PED_SEEK_ENTITY:
|
||||
case PED_PURSUE:
|
||||
case PED_SNIPER_MODE:
|
||||
case PED_ROCKET_MODE:
|
||||
case PED_DUMMY:
|
||||
case PED_FACE_PHONE:
|
||||
case PED_MAKE_CALL:
|
||||
case PED_MUG:
|
||||
case PED_AI_CONTROL:
|
||||
case PED_FOLLOW_ROUTE:
|
||||
case PED_CPR:
|
||||
case PED_SOLICIT:
|
||||
case PED_BUY_ICECREAM:
|
||||
case PED_STEP_AWAY:
|
||||
case PED_UNKNOWN:
|
||||
case PED_STATES_NO_AI:
|
||||
case PED_JUMP:
|
||||
case PED_STAGGER:
|
||||
case PED_DIVE_AWAY:
|
||||
case PED_STATES_NO_ST:
|
||||
case PED_ARREST_PLAYER:
|
||||
case PED_PASSENGER:
|
||||
case PED_TAXI_PASSENGER:
|
||||
case PED_OPEN_DOOR:
|
||||
case PED_DEAD:
|
||||
case PED_DRAG_FROM_CAR:
|
||||
case PED_EXIT_CAR:
|
||||
case PED_STEAL_CAR:
|
||||
break;
|
||||
case PED_ENTER_CAR:
|
||||
case PED_CARJACK:
|
||||
{
|
||||
|
@ -4467,7 +4437,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
|||
if (!veh->bEngineOn)
|
||||
veh->bEngineOn = true;
|
||||
|
||||
ped->m_nPedState = PED_DRIVING;
|
||||
ped->SetPedState(PED_DRIVING);
|
||||
ped->StopNonPartialAnims();
|
||||
return;
|
||||
}
|
||||
|
@ -4512,7 +4482,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
|||
else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) {
|
||||
if (ped->m_nPedState == PED_CARJACK) {
|
||||
veh->AddPassenger(ped, 0);
|
||||
ped->m_nPedState = PED_DRIVING;
|
||||
ped->SetPedState(PED_DRIVING);
|
||||
ped->RestorePreviousObjective();
|
||||
ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
|
||||
} else if (veh->pDriver && ped->CharCreatedBy == RANDOM_CHAR) {
|
||||
|
@ -4552,7 +4522,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
|||
veh->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
|
||||
veh->AutoPilot.m_nCruiseSpeed = 25;
|
||||
}
|
||||
ped->m_nPedState = PED_DRIVING;
|
||||
ped->SetPedState(PED_DRIVING);
|
||||
if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) {
|
||||
|
||||
if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT)
|
||||
|
@ -4580,7 +4550,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
|||
break;
|
||||
}
|
||||
}
|
||||
ped->m_nPedState = PED_DRIVING;
|
||||
ped->SetPedState(PED_DRIVING);
|
||||
if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT)
|
||||
ped->m_prevObjective = OBJECTIVE_NONE;
|
||||
|
||||
|
@ -4967,7 +4937,7 @@ CPed::SetIdle(void)
|
|||
|
||||
m_nLastPedState = PED_NONE;
|
||||
#endif
|
||||
m_nPedState = PED_IDLE;
|
||||
SetPedState(PED_IDLE);
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
}
|
||||
if (m_nWaitState == WAITSTATE_FALSE) {
|
||||
|
@ -5055,7 +5025,7 @@ CPed::SetFall(int extraTime, AnimationId animId, uint8 evenIfNotInControl)
|
|||
ClearLookFlag();
|
||||
ClearAimFlag();
|
||||
SetStoredState();
|
||||
m_nPedState = PED_FALL;
|
||||
SetPedState(PED_FALL);
|
||||
CAnimBlendAssociation *fallAssoc = RpAnimBlendClumpGetAssociation(GetClump(), animId);
|
||||
|
||||
if (fallAssoc) {
|
||||
|
@ -5220,7 +5190,7 @@ CPed::SetGetUp(void)
|
|||
}
|
||||
if (m_nPedState != PED_GETUP) {
|
||||
SetStoredState();
|
||||
m_nPedState = PED_GETUP;
|
||||
SetPedState(PED_GETUP);
|
||||
}
|
||||
|
||||
CVehicle *collidingVeh = (CVehicle*)m_pCollidingEntity;
|
||||
|
@ -5375,7 +5345,7 @@ CPed::SetSeek(CVector pos, float distanceToCountDone)
|
|||
if (m_nPedState != PED_SEEK_POS)
|
||||
SetStoredState();
|
||||
|
||||
m_nPedState = PED_SEEK_POS;
|
||||
SetPedState(PED_SEEK_POS);
|
||||
m_distanceToCountSeekDone = distanceToCountDone;
|
||||
m_vecSeekPos = pos;
|
||||
}
|
||||
|
@ -5395,7 +5365,7 @@ CPed::SetSeek(CEntity *seeking, float distanceToCountDone)
|
|||
if (m_nPedState != PED_SEEK_ENTITY)
|
||||
SetStoredState();
|
||||
|
||||
m_nPedState = PED_SEEK_ENTITY;
|
||||
SetPedState(PED_SEEK_ENTITY);
|
||||
m_distanceToCountSeekDone = distanceToCountDone;
|
||||
m_pSeekTarget = seeking;
|
||||
m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget);
|
||||
|
@ -5572,7 +5542,7 @@ CPed::SetFlee(CVector2D const &from, int time)
|
|||
|
||||
if (m_nPedState != PED_FLEE_ENTITY) {
|
||||
SetStoredState();
|
||||
m_nPedState = PED_FLEE_POS;
|
||||
SetPedState(PED_FLEE_POS);
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
m_fleeFromPosX = from.x;
|
||||
m_fleeFromPosY = from.y;
|
||||
|
@ -5601,7 +5571,7 @@ CPed::SetFlee(CEntity *fleeFrom, int time)
|
|||
return;
|
||||
|
||||
SetStoredState();
|
||||
m_nPedState = PED_FLEE_ENTITY;
|
||||
SetPedState(PED_FLEE_ENTITY);
|
||||
bUsePedNodeSeek = true;
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
m_fleeFrom = fleeFrom;
|
||||
|
@ -5862,7 +5832,7 @@ CPed::SetWanderPath(int8 pathStateDest)
|
|||
|
||||
// We did it, save next path state and return true
|
||||
m_nPathDir = nextPathState;
|
||||
m_nPedState = PED_WANDER_PATH;
|
||||
SetPedState(PED_WANDER_PATH);
|
||||
SetMoveState(PEDMOVE_WALK);
|
||||
bIsRunning = false;
|
||||
return true;
|
||||
|
@ -6047,7 +6017,7 @@ CPed::SetFollowPath(CVector dest)
|
|||
return false;
|
||||
|
||||
SetStoredState();
|
||||
m_nPedState = PED_FOLLOW_PATH;
|
||||
SetPedState(PED_FOLLOW_PATH);
|
||||
SetMoveState(PEDMOVE_WALK);
|
||||
return true;
|
||||
}
|
||||
|
@ -6150,7 +6120,7 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
|
|||
m_fRotationCur = CGeneral::LimitRadianAngle(angleToFace);
|
||||
ClearAimFlag();
|
||||
SetStoredState();
|
||||
m_nPedState = PED_STEP_AWAY;
|
||||
SetPedState(PED_STEP_AWAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6247,13 +6217,13 @@ CPed::SetEvasiveDive(CPhysical *reason, uint8 onlyRandomJump)
|
|||
animAssoc->flags &= ~ASSOC_DELETEFADEDOUT;
|
||||
animAssoc->SetFinishCallback(PedEvadeCB, this);
|
||||
SetStoredState();
|
||||
m_nPedState = PED_STEP_AWAY;
|
||||
SetPedState(PED_STEP_AWAY);
|
||||
} else {
|
||||
m_fRotationCur = angleToFace;
|
||||
ClearLookFlag();
|
||||
ClearAimFlag();
|
||||
SetStoredState();
|
||||
m_nPedState = PED_DIVE_AWAY;
|
||||
SetPedState(PED_DIVE_AWAY);
|
||||
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_EV_DIVE, 8.0f);
|
||||
animAssoc->SetFinishCallback(PedEvadeCB, this);
|
||||
}
|
||||
|
@ -6291,7 +6261,7 @@ CPed::PedEvadeCB(CAnimBlendAssociation* animAssoc, void* arg)
|
|||
if (ped->m_nPedState == PED_DIVE_AWAY)
|
||||
{
|
||||
ped->m_getUpTimer = CTimer::GetTimeInMilliseconds() + 1;
|
||||
ped->m_nPedState = PED_FALL;
|
||||
ped->SetPedState(PED_FALL);
|
||||
}
|
||||
animAssoc->flags &= ~ASSOC_FADEOUTWHENDONE;
|
||||
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
||||
|
@ -6342,7 +6312,7 @@ CPed::SetDie(AnimationId animId, float delta, float speed)
|
|||
QuitEnteringCar();
|
||||
}
|
||||
|
||||
m_nPedState = PED_DIE;
|
||||
SetPedState(PED_DIE);
|
||||
if (animId == NUM_ANIMS) {
|
||||
bIsPedDieAnimPlaying = false;
|
||||
} else {
|
||||
|
@ -6384,7 +6354,7 @@ CPed::SetDead(void)
|
|||
if (m_nPedState == PED_DRIVING)
|
||||
bIsVisible = false;
|
||||
|
||||
m_nPedState = PED_DEAD;
|
||||
SetPedState(PED_DEAD);
|
||||
m_pVehicleAnim = nil;
|
||||
m_pCollidingEntity = nil;
|
||||
|
||||
|
@ -6417,7 +6387,7 @@ CPed::SetChat(CEntity *chatWith, uint32 time)
|
|||
if(m_nPedState != PED_CHAT)
|
||||
SetStoredState();
|
||||
|
||||
m_nPedState = PED_CHAT;
|
||||
SetPedState(PED_CHAT);
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
#if defined VC_PED_PORTS || defined FIX_BUGS
|
||||
m_lookTimer = 0;
|
||||
|
@ -6658,7 +6628,7 @@ CPed::SetSeekCar(CVehicle *car, uint32 doorNode)
|
|||
// m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget);
|
||||
m_vehEnterType = doorNode;
|
||||
m_distanceToCountSeekDone = 0.5f;
|
||||
m_nPedState = PED_SEEK_CAR;
|
||||
SetPedState(PED_SEEK_CAR);
|
||||
|
||||
}
|
||||
|
||||
|
@ -7683,10 +7653,11 @@ CPed::FlagToDestroyWhenNextProcessed(void)
|
|||
}
|
||||
bInVehicle = false;
|
||||
m_pMyVehicle = nil;
|
||||
|
||||
if (CharCreatedBy == MISSION_CHAR)
|
||||
m_nPedState = PED_DEAD;
|
||||
SetPedState(PED_DEAD);
|
||||
else
|
||||
m_nPedState = PED_NONE;
|
||||
SetPedState(PED_NONE);
|
||||
m_pVehicleAnim = nil;
|
||||
}
|
||||
|
||||
|
@ -7710,7 +7681,7 @@ CPed::SetSolicit(uint32 time)
|
|||
if(!m_carInObjective->bIsVan && !m_carInObjective->bIsBus)
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_HOOKERTALK, 4.0f);
|
||||
|
||||
m_nPedState = PED_SOLICIT;
|
||||
SetPedState(PED_SOLICIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7769,7 +7740,7 @@ CPed::SetBuyIceCream(void)
|
|||
// Simulating BuyIceCream
|
||||
CPed* driver = m_carInObjective->pDriver;
|
||||
if (driver) {
|
||||
m_nPedState = PED_BUY_ICECREAM;
|
||||
SetPedState(PED_BUY_ICECREAM);
|
||||
bFindNewNodeAfterStateRestore = true;
|
||||
SetObjectiveTimer(8000);
|
||||
SetChat(driver, 8000);
|
||||
|
@ -7783,7 +7754,7 @@ CPed::SetBuyIceCream(void)
|
|||
|
||||
if (Abs(m_fRotationDest - m_fRotationCur) < HALFPI) {
|
||||
m_standardTimer = CTimer::GetTimeInMilliseconds() + 3000;
|
||||
m_nPedState = PED_BUY_ICECREAM;
|
||||
SetPedState(PED_BUY_ICECREAM);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7985,7 +7956,7 @@ CPed::SetJump(void)
|
|||
#endif
|
||||
(m_nSurfaceTouched != SURFACE_STEEP_CLIFF || DotProduct(GetForward(), m_vecDamageNormal) >= 0.0f)) {
|
||||
SetStoredState();
|
||||
m_nPedState = PED_JUMP;
|
||||
SetPedState(PED_JUMP);
|
||||
CAnimBlendAssociation *jumpAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_JUMP_LAUNCH, 8.0f);
|
||||
jumpAssoc->SetFinishCallback(FinishLaunchCB, this);
|
||||
m_fRotationDest = m_fRotationCur;
|
||||
|
@ -8287,7 +8258,7 @@ CPed::WarpPedIntoCar(CVehicle *car)
|
|||
m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle);
|
||||
m_carInObjective = car;
|
||||
m_carInObjective->RegisterReference((CEntity **) &m_carInObjective);
|
||||
m_nPedState = PED_DRIVING;
|
||||
SetPedState(PED_DRIVING);
|
||||
bUsesCollision = false;
|
||||
bIsInTheAir = false;
|
||||
bVehExitWillBeInstant = true;
|
||||
|
|
|
@ -43,7 +43,7 @@ enum eFormation
|
|||
FORMATION_FRONT
|
||||
};
|
||||
|
||||
enum FightState : int8 {
|
||||
enum FightState {
|
||||
FIGHTSTATE_MOVE_FINISHED = -2,
|
||||
FIGHTSTATE_JUST_ATTACKED,
|
||||
FIGHTSTATE_NO_MOVE,
|
||||
|
@ -153,7 +153,7 @@ enum eWaitState {
|
|||
WAITSTATE_FINISH_FLEE
|
||||
};
|
||||
|
||||
enum eObjective : uint32 {
|
||||
enum eObjective {
|
||||
OBJECTIVE_NONE,
|
||||
OBJECTIVE_WAIT_ON_FOOT,
|
||||
OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE,
|
||||
|
@ -212,7 +212,7 @@ enum PedOnGroundState {
|
|||
PED_DEAD_ON_THE_FLOOR
|
||||
};
|
||||
|
||||
enum PointBlankNecessity : uint8 {
|
||||
enum PointBlankNecessity {
|
||||
NO_POINT_BLANK_PED,
|
||||
POINT_BLANK_FOR_WANTED_PED,
|
||||
POINT_BLANK_FOR_SOMEONE_ELSE
|
||||
|
@ -484,7 +484,7 @@ public:
|
|||
CVector m_vecHitLastPos;
|
||||
uint32 m_curFightMove;
|
||||
uint8 m_fightButtonPressure;
|
||||
FightState m_fightState;
|
||||
int8 m_fightState;
|
||||
bool m_takeAStepAfterAttack;
|
||||
CFire *m_pFire;
|
||||
CEntity *m_pLookTarget;
|
||||
|
@ -598,7 +598,7 @@ public:
|
|||
#endif
|
||||
bool CheckForExplosions(CVector2D &area);
|
||||
CPed *CheckForGunShots(void);
|
||||
PointBlankNecessity CheckForPointBlankPeds(CPed*);
|
||||
uint8 CheckForPointBlankPeds(CPed*);
|
||||
bool CheckIfInTheAir(void);
|
||||
void ClearAll(void);
|
||||
void SetPointGunAt(CEntity*);
|
||||
|
@ -863,6 +863,13 @@ public:
|
|||
SetMoveState(PEDMOVE_WALK);
|
||||
}
|
||||
|
||||
inline void SetWeaponLockOnTarget(CEntity *target)
|
||||
{
|
||||
m_pPointGunAt = (CPed *)target;
|
||||
if(target)
|
||||
((CEntity *)target)->RegisterReference(&m_pPointGunAt);
|
||||
}
|
||||
|
||||
// Using this to abstract nodes of skinned and non-skinned meshes
|
||||
CVector GetNodePosition(int32 node)
|
||||
{
|
||||
|
@ -891,13 +898,13 @@ public:
|
|||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump());
|
||||
int32 idx = RpHAnimIDGetIndex(hier, m_pFrames[node]->nodeID);
|
||||
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
|
||||
RwV3dTransformPoints((RwV3d*)&pos, (RwV3d*)&pos, 1, &mats[idx]);
|
||||
RwV3dTransformPoints(&pos, &pos, 1, &mats[idx]);
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
RwFrame *frame;
|
||||
for (frame = m_pFrames[node]->frame; frame; frame = RwFrameGetParent(frame))
|
||||
RwV3dTransformPoints((RwV3d*)&pos, (RwV3d*)&pos, 1, RwFrameGetMatrix(frame));
|
||||
RwV3dTransformPoints(&pos, &pos, 1, RwFrameGetMatrix(frame));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -620,9 +620,7 @@ CPed::UpdateFromLeader(void)
|
|||
m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget);
|
||||
TurnBody();
|
||||
if (m_attackTimer < CTimer::GetTimeInMilliseconds() && !GetWeapon()->IsTypeMelee()) {
|
||||
m_pPointGunAt = m_threatEntity;
|
||||
if (m_threatEntity)
|
||||
m_threatEntity->RegisterReference((CEntity **) &m_pPointGunAt);
|
||||
SetWeaponLockOnTarget(m_threatEntity);
|
||||
SetAttack(m_threatEntity);
|
||||
}
|
||||
}
|
||||
|
@ -811,10 +809,10 @@ CPed::ProcessObjective(void)
|
|||
break;
|
||||
}
|
||||
case OBJECTIVE_WAIT_IN_CAR:
|
||||
m_nPedState = PED_DRIVING;
|
||||
SetPedState(PED_DRIVING);
|
||||
break;
|
||||
case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT:
|
||||
m_nPedState = PED_DRIVING;
|
||||
SetPedState(PED_DRIVING);
|
||||
break;
|
||||
case OBJECTIVE_KILL_CHAR_ANY_MEANS:
|
||||
{
|
||||
|
@ -972,9 +970,9 @@ CPed::ProcessObjective(void)
|
|||
}
|
||||
CWeaponInfo *wepInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
|
||||
float wepRange = wepInfo->m_fRange;
|
||||
float wepRangeAdjusted;
|
||||
float maxDistToKeep;
|
||||
if (GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED) {
|
||||
wepRangeAdjusted = wepRange / 3.0f;
|
||||
maxDistToKeep = wepRange / 3.0f;
|
||||
} else {
|
||||
if (m_nPedState == PED_FIGHT) {
|
||||
if (!IsPlayer() && !(m_pedStats->m_flags & STAT_CAN_KICK))
|
||||
|
@ -982,10 +980,10 @@ CPed::ProcessObjective(void)
|
|||
} else {
|
||||
wepRange = 1.3f;
|
||||
}
|
||||
wepRangeAdjusted = wepRange;
|
||||
maxDistToKeep = wepRange;
|
||||
}
|
||||
if (m_pedInObjective->m_getUpTimer > CTimer::GetTimeInMilliseconds() && wepRangeAdjusted < 2.5f) {
|
||||
wepRangeAdjusted = 2.5f;
|
||||
if (m_pedInObjective->m_getUpTimer > CTimer::GetTimeInMilliseconds() && maxDistToKeep < 2.5f) {
|
||||
maxDistToKeep = 2.5f;
|
||||
}
|
||||
if (m_pedInObjective->IsPlayer() && m_nPedType != PEDTYPE_COP
|
||||
&& CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops) {
|
||||
|
@ -1015,21 +1013,18 @@ CPed::ProcessObjective(void)
|
|||
// I hope so
|
||||
CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f);
|
||||
CVector maxShotPos = vehOfTarget->GetPosition() - ourHead;
|
||||
maxShotPos.Normalise();
|
||||
maxShotPos = maxShotPos * wepInfo->m_fRange + ourHead;
|
||||
maxShotPos *= wepInfo->m_fRange / maxShotPos.Magnitude();
|
||||
maxShotPos += ourHead;
|
||||
|
||||
CWorld::bIncludeDeadPeds = true;
|
||||
CColPoint foundCol;
|
||||
CEntity *foundEnt;
|
||||
CWorld::ProcessLineOfSight(ourHead, maxShotPos, foundCol, foundEnt,
|
||||
true, true, true, true, false, true, false);
|
||||
|
||||
CWorld::bIncludeDeadPeds = true;
|
||||
CWorld::ProcessLineOfSight(ourHead, maxShotPos, foundCol, foundEnt, true, true, true, true, false, true, false);
|
||||
CWorld::bIncludeDeadPeds = false;
|
||||
if (foundEnt == vehOfTarget) {
|
||||
SetAttack(vehOfTarget);
|
||||
m_pPointGunAt = vehOfTarget;
|
||||
if (vehOfTarget)
|
||||
vehOfTarget->RegisterReference((CEntity **) &m_pPointGunAt);
|
||||
|
||||
SetWeaponLockOnTarget(vehOfTarget);
|
||||
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 2000));
|
||||
if (distWithTargetSc <= m_distanceToCountSeekDone) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(200, 500));
|
||||
|
@ -1038,8 +1033,7 @@ CPed::ProcessObjective(void)
|
|||
SetAttackTimer(CGeneral::GetRandomNumberInRange(2000, 5000));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_nPedState != PED_ATTACK && !bKindaStayInSamePlace && !killPlayerInNoPoliceZone) {
|
||||
} else if (m_nPedState != PED_ATTACK && !bKindaStayInSamePlace && !killPlayerInNoPoliceZone) {
|
||||
if (vehOfTarget) {
|
||||
if (m_nPedType == PEDTYPE_COP || vehOfTarget->bIsBus) {
|
||||
GoToNearestDoor(vehOfTarget);
|
||||
|
@ -1086,7 +1080,7 @@ CPed::ProcessObjective(void)
|
|||
|| distWithTargetSc > m_distanceToCountSeekDone && !CanSeeEntity(m_pedInObjective)) {
|
||||
|
||||
if (m_pedInObjective->EnteringCar())
|
||||
wepRangeAdjusted = 2.0f;
|
||||
maxDistToKeep = 2.0f;
|
||||
|
||||
if (bUsePedNodeSeek) {
|
||||
CVector bestCoords(0.0f, 0.0f, 0.0f);
|
||||
|
@ -1100,7 +1094,7 @@ CPed::ProcessObjective(void)
|
|||
|
||||
SetSeek(m_vecSeekPos, m_distanceToCountSeekDone);
|
||||
} else {
|
||||
SetSeek(m_pedInObjective, wepRangeAdjusted);
|
||||
SetSeek(m_pedInObjective, maxDistToKeep);
|
||||
}
|
||||
bCrouchWhenShooting = false;
|
||||
if (m_pedInObjective->m_pCurrentPhysSurface && distWithTargetSc < 5.0f) {
|
||||
|
@ -1147,32 +1141,27 @@ CPed::ProcessObjective(void)
|
|||
CVector target;
|
||||
CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f);
|
||||
if (m_pedInObjective->IsPed())
|
||||
m_pedInObjective->m_pedIK.GetComponentPosition((RwV3d*)&target, PED_MID);
|
||||
m_pedInObjective->m_pedIK.GetComponentPosition(target, PED_MID);
|
||||
else
|
||||
target = m_pedInObjective->GetPosition();
|
||||
|
||||
target -= ourHead;
|
||||
target.Normalise();
|
||||
target = target * wepInfo->m_fRange + ourHead;
|
||||
target *= wepInfo->m_fRange / target.Magnitude();
|
||||
target += ourHead;
|
||||
|
||||
CColPoint foundCol;
|
||||
CEntity *foundEnt = nil;
|
||||
|
||||
CWorld::bIncludeDeadPeds = true;
|
||||
CEntity *foundEnt = nil;
|
||||
CColPoint foundCol;
|
||||
|
||||
CWorld::ProcessLineOfSight(
|
||||
ourHead, target, foundCol, foundEnt,
|
||||
true, true, true, false, true, false);
|
||||
CWorld::bIncludeDeadPeds = 0;
|
||||
CWorld::ProcessLineOfSight(ourHead, target, foundCol, foundEnt, true, true, true, true, false, true, false);
|
||||
CWorld::bIncludeDeadPeds = false;
|
||||
if (foundEnt == m_pedInObjective) {
|
||||
SetAttack(m_pedInObjective);
|
||||
m_pPointGunAt = m_pedInObjective;
|
||||
if (m_pedInObjective)
|
||||
m_pedInObjective->RegisterReference((CEntity **) &m_pPointGunAt);
|
||||
|
||||
SetWeaponLockOnTarget(m_pedInObjective);
|
||||
SetShootTimer(CGeneral::GetRandomNumberInRange(500.0f, 2000.0f));
|
||||
|
||||
int time;
|
||||
if (distWithTargetSc <= wepRangeAdjusted)
|
||||
if (distWithTargetSc <= maxDistToKeep)
|
||||
time = CGeneral::GetRandomNumberInRange(100.0f, 500.0f);
|
||||
else
|
||||
time = CGeneral::GetRandomNumberInRange(1500.0f, 3000.0f);
|
||||
|
@ -1180,25 +1169,27 @@ CPed::ProcessObjective(void)
|
|||
SetAttackTimer(time);
|
||||
bObstacleShowedUpDuringKillObjective = false;
|
||||
|
||||
} else if (foundEnt) {
|
||||
if (foundEnt->IsPed()) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(500.0f, 1000.0f));
|
||||
bObstacleShowedUpDuringKillObjective = false;
|
||||
} else {
|
||||
if (foundEnt->IsObject()) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(200.0f, 400.0f));
|
||||
bObstacleShowedUpDuringKillObjective = true;
|
||||
} else if (foundEnt->IsVehicle()) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(400.0f, 600.0f));
|
||||
bObstacleShowedUpDuringKillObjective = true;
|
||||
} else {
|
||||
if (foundEnt) {
|
||||
if (foundEnt->IsPed()) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(500.0f, 1000.0f));
|
||||
bObstacleShowedUpDuringKillObjective = false;
|
||||
} else {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(700.0f, 1200.0f));
|
||||
bObstacleShowedUpDuringKillObjective = true;
|
||||
if (foundEnt->IsObject()) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(200.0f, 400.0f));
|
||||
bObstacleShowedUpDuringKillObjective = true;
|
||||
} else if (foundEnt->IsVehicle()) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(400.0f, 600.0f));
|
||||
bObstacleShowedUpDuringKillObjective = true;
|
||||
} else {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(700.0f, 1200.0f));
|
||||
bObstacleShowedUpDuringKillObjective = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_fleeFrom = foundEnt;
|
||||
m_fleeFrom->RegisterReference((CEntity**) &m_fleeFrom);
|
||||
m_fleeFrom = foundEnt;
|
||||
m_fleeFrom->RegisterReference((CEntity**) &m_fleeFrom);
|
||||
}
|
||||
SetPointGunAt(m_pedInObjective);
|
||||
}
|
||||
}
|
||||
|
@ -1230,17 +1221,17 @@ CPed::ProcessObjective(void)
|
|||
if (m_nPedType == PEDTYPE_COP) {
|
||||
if (GetWeapon()->m_eWeaponType > WEAPONTYPE_COLT45
|
||||
|| m_fleeFrom && m_fleeFrom->IsObject()) {
|
||||
wepRangeAdjusted = 6.0f;
|
||||
maxDistToKeep = 6.0f;
|
||||
} else if (m_fleeFrom && m_fleeFrom->IsVehicle()) {
|
||||
wepRangeAdjusted = 4.0f;
|
||||
maxDistToKeep = 4.0f;
|
||||
} else {
|
||||
wepRangeAdjusted = 2.0f;
|
||||
maxDistToKeep = 2.0f;
|
||||
}
|
||||
} else {
|
||||
wepRangeAdjusted = 2.0f;
|
||||
maxDistToKeep = 2.0f;
|
||||
}
|
||||
}
|
||||
if (distWithTargetSc <= wepRangeAdjusted) {
|
||||
if (distWithTargetSc <= maxDistToKeep) {
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
bIsPointingGunAt = true;
|
||||
if (m_nPedState != PED_AIM_GUN && !bDuckAndCover) {
|
||||
|
@ -1251,7 +1242,7 @@ CPed::ProcessObjective(void)
|
|||
if (m_nPedState != PED_SEEK_ENTITY && m_nPedState != PED_SEEK_POS
|
||||
&& !bStopAndShoot && !killPlayerInNoPoliceZone && !bKindaStayInSamePlace) {
|
||||
Say(SOUND_PED_ATTACK);
|
||||
SetSeek(m_pedInObjective, wepRangeAdjusted);
|
||||
SetSeek(m_pedInObjective, maxDistToKeep);
|
||||
bIsRunning = true;
|
||||
}
|
||||
}
|
||||
|
@ -1541,21 +1532,18 @@ CPed::ProcessObjective(void)
|
|||
// I hope so
|
||||
CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f);
|
||||
CVector maxShotPos = m_carInObjective->GetPosition() - ourHead;
|
||||
maxShotPos.Normalise();
|
||||
maxShotPos = maxShotPos * wepInfo->m_fRange + ourHead;
|
||||
maxShotPos *= wepInfo->m_fRange / maxShotPos.Magnitude();
|
||||
maxShotPos += ourHead;
|
||||
|
||||
CWorld::bIncludeDeadPeds = true;
|
||||
CColPoint foundCol;
|
||||
CEntity *foundEnt;
|
||||
CWorld::ProcessLineOfSight(ourHead, maxShotPos, foundCol, foundEnt,
|
||||
true, true, true, true, false, true, false);
|
||||
|
||||
CWorld::bIncludeDeadPeds = true;
|
||||
CWorld::ProcessLineOfSight(ourHead, maxShotPos, foundCol, foundEnt, true, true, true, true, false, true, false);
|
||||
CWorld::bIncludeDeadPeds = false;
|
||||
if (foundEnt == m_carInObjective) {
|
||||
SetAttack(m_carInObjective);
|
||||
m_pPointGunAt = m_carInObjective;
|
||||
if (m_pPointGunAt)
|
||||
m_pPointGunAt->RegisterReference((CEntity **) &m_pPointGunAt);
|
||||
|
||||
SetWeaponLockOnTarget(m_carInObjective);
|
||||
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 2000));
|
||||
if (distWithTargetSc > 10.0f && !bKindaStayInSamePlace) {
|
||||
SetAttackTimer(CGeneral::GetRandomNumberInRange(2000, 5000));
|
||||
|
@ -2629,7 +2617,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
|
|||
if (ped->IsPlayer() && ped->bGonnaKillTheCarJacker && ((CPlayerPed*)ped)->m_pArrestingCop) {
|
||||
PedSetInCarCB(nil, ped);
|
||||
ped->m_nLastPedState = ped->m_nPedState;
|
||||
ped->m_nPedState = PED_ARRESTED;
|
||||
ped->SetPedState(PED_ARRESTED);
|
||||
ped->bGonnaKillTheCarJacker = false;
|
||||
if (veh) {
|
||||
veh->m_nNumGettingIn = 0;
|
||||
|
@ -2990,9 +2978,15 @@ CPed::PedAnimStepOutCarCB(CAnimBlendAssociation* animAssoc, void* arg)
|
|||
}
|
||||
|
||||
if (ped->bFleeAfterExitingCar || ped->bGonnaKillTheCarJacker) {
|
||||
// POTENTIAL BUG? Why DOOR_FRONT_LEFT instead of door variable? or vice versa?
|
||||
#ifdef FIX_BUGS
|
||||
if (!veh->IsDoorMissing(door))
|
||||
((CAutomobile*)veh)->Damage.SetDoorStatus(door, DOOR_STATUS_SWINGING);
|
||||
PedSetOutCarCB(nil, ped);
|
||||
return;
|
||||
#else
|
||||
if (!veh->IsDoorMissing(door))
|
||||
((CAutomobile*)veh)->Damage.SetDoorStatus(DOOR_FRONT_LEFT, DOOR_STATUS_SWINGING);
|
||||
#endif
|
||||
} else {
|
||||
switch (door) {
|
||||
case DOOR_FRONT_LEFT:
|
||||
|
@ -3346,7 +3340,7 @@ CPed::SetCarJack_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
|
|||
|
||||
m_pSeekTarget = car;
|
||||
m_pSeekTarget->RegisterReference((CEntity**)&m_pSeekTarget);
|
||||
m_nPedState = PED_CARJACK;
|
||||
SetPedState(PED_CARJACK);
|
||||
car->bIsBeingCarJacked = true;
|
||||
m_pMyVehicle = (CVehicle*)m_pSeekTarget;
|
||||
m_pMyVehicle->RegisterReference((CEntity**)&m_pMyVehicle);
|
||||
|
@ -3393,7 +3387,7 @@ CPed::SetBeingDraggedFromCar(CVehicle *veh, uint32 vehEnterType, bool quickJack)
|
|||
SetMoveState(PEDMOVE_NONE);
|
||||
LineUpPedWithCar(LINE_UP_TO_CAR_START);
|
||||
m_pVehicleAnim = nil;
|
||||
m_nPedState = PED_DRAG_FROM_CAR;
|
||||
SetPedState(PED_DRAG_FROM_CAR);
|
||||
bChangedSeat = false;
|
||||
bWillBeQuickJacked = quickJack;
|
||||
|
||||
|
@ -3518,7 +3512,7 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
|
|||
m_pSeekTarget = car;
|
||||
m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget);
|
||||
m_vehEnterType = doorNode;
|
||||
m_nPedState = PED_ENTER_CAR;
|
||||
SetPedState(PED_ENTER_CAR);
|
||||
if (m_vehEnterType == CAR_DOOR_RF && m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && car->m_vehType != VEHICLE_TYPE_BIKE) {
|
||||
car->bIsBeingCarJacked = true;
|
||||
}
|
||||
|
@ -3680,14 +3674,14 @@ void
|
|||
CPed::SetExitBoat(CVehicle *boat)
|
||||
{
|
||||
#ifndef VC_PED_PORTS
|
||||
m_nPedState = PED_IDLE;
|
||||
SetPedState(PED_IDLE);
|
||||
CVector firstPos = GetPosition();
|
||||
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
||||
if (boat->GetModelIndex() == MI_SPEEDER && boat->IsUpsideDown()) {
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS, 8.0f);
|
||||
m_pVehicleAnim->SetFinishCallback(PedSetOutCarCB, this);
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_nPedState = PED_EXIT_CAR;
|
||||
SetPedState(PED_EXIT_CAR);
|
||||
} else {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
PedSetOutCarCB(nil, this);
|
||||
|
@ -3700,7 +3694,7 @@ CPed::SetExitBoat(CVehicle *boat)
|
|||
m_vecMoveSpeed = boat->m_vecMoveSpeed;
|
||||
bTryingToReachDryLand = true;
|
||||
#else
|
||||
m_nPedState = PED_IDLE;
|
||||
SetPedState(PED_IDLE);
|
||||
CVector newPos = GetPosition();
|
||||
RemoveInCarAnims();
|
||||
CColModel* boatCol = boat->GetColModel();
|
||||
|
@ -3927,7 +3921,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
|||
m_pSeekTarget = veh;
|
||||
m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget);
|
||||
m_vehEnterType = optedDoorNode;
|
||||
m_nPedState = PED_EXIT_CAR;
|
||||
SetPedState(PED_EXIT_CAR);
|
||||
if (m_pVehicleAnim && m_pVehicleAnim->flags & ASSOC_PARTIAL)
|
||||
m_pVehicleAnim->blendDelta = -1000.0f;
|
||||
SetMoveState(PEDMOVE_NONE);
|
||||
|
@ -4475,7 +4469,7 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg)
|
|||
ped->bGonnaKillTheCarJacker = false;
|
||||
if (!ped->m_pedInObjective || !(CGeneral::GetRandomNumber() & 1)) {
|
||||
if (!driver || driver == ped || driver->IsPlayer() && CTheScripts::IsPlayerOnAMission()) {
|
||||
ped->m_nPedState = PED_NONE;
|
||||
ped->SetPedState(PED_NONE);
|
||||
ped->m_nLastPedState = PED_NONE;
|
||||
ped->SetFlee(ped->m_pMyVehicle->GetPosition(), 4000);
|
||||
} else {
|
||||
|
@ -4504,7 +4498,7 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg)
|
|||
else
|
||||
#endif
|
||||
{
|
||||
ped->m_nPedState = PED_NONE;
|
||||
ped->SetPedState(PED_NONE);
|
||||
ped->m_nLastPedState = PED_NONE;
|
||||
ped->SetFindPathAndFlee(ped->m_pMyVehicle->GetPosition(), 10000);
|
||||
}
|
||||
|
@ -4597,7 +4591,7 @@ CPed::PedSetInTrainCB(CAnimBlendAssociation* animAssoc, void* arg)
|
|||
return;
|
||||
|
||||
ped->bInVehicle = true;
|
||||
ped->m_nPedState = PED_DRIVING;
|
||||
ped->SetPedState(PED_DRIVING);
|
||||
ped->RestorePreviousObjective();
|
||||
ped->SetMoveState(PEDMOVE_STILL);
|
||||
veh->AddPassenger(ped);
|
||||
|
@ -4618,7 +4612,7 @@ CPed::SetEnterTrain(CVehicle *train, uint32 unused)
|
|||
m_pMyVehicle = train;
|
||||
m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle);
|
||||
|
||||
m_nPedState = PED_ENTER_TRAIN;
|
||||
SetPedState(PED_ENTER_TRAIN);
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETIN, 4.0f);
|
||||
m_pVehicleAnim->SetFinishCallback(PedSetInTrainCB, this);
|
||||
bUsesCollision = false;
|
||||
|
@ -4692,7 +4686,7 @@ CPed::SetExitTrain(CVehicle* train)
|
|||
CVector exitPos;
|
||||
GetNearestTrainPedPosition(train, exitPos);
|
||||
*/
|
||||
m_nPedState = PED_EXIT_TRAIN;
|
||||
SetPedState(PED_EXIT_TRAIN);
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETOUT, 4.0f);
|
||||
m_pVehicleAnim->SetFinishCallback(PedSetOutTrainCB, this);
|
||||
bUsesCollision = false;
|
||||
|
@ -4718,7 +4712,7 @@ CPed::PedSetOutTrainCB(CAnimBlendAssociation *animAssoc, void *arg)
|
|||
ped->bUsesCollision = true;
|
||||
ped->m_pVehicleAnim = nil;
|
||||
ped->bInVehicle = false;
|
||||
ped->m_nPedState = PED_IDLE;
|
||||
ped->SetPedState(PED_IDLE);
|
||||
ped->RestorePreviousObjective();
|
||||
ped->SetMoveState(PEDMOVE_STILL);
|
||||
|
||||
|
@ -5186,7 +5180,7 @@ CPed::SetSeekBoatPosition(CVehicle *boat)
|
|||
m_pMyVehicle = boat;
|
||||
m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle);
|
||||
m_distanceToCountSeekDone = 0.5f;
|
||||
m_nPedState = PED_SEEK_IN_BOAT;
|
||||
SetPedState(PED_SEEK_IN_BOAT);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -164,7 +164,7 @@ CPed::SetPointGunAt(CEntity *to)
|
|||
if (m_nPedState != PED_ATTACK)
|
||||
SetStoredState();
|
||||
|
||||
m_nPedState = PED_AIM_GUN;
|
||||
SetPedState(PED_AIM_GUN);
|
||||
bIsPointingGunAt = true;
|
||||
CWeaponInfo *curWeapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
|
||||
SetMoveState(PEDMOVE_NONE);
|
||||
|
@ -222,7 +222,7 @@ CPed::ClearPointGunAt(void)
|
|||
RestorePreviousState();
|
||||
#else
|
||||
if (m_nPedState == PED_AIM_GUN || m_nPedState == PED_ATTACK) {
|
||||
m_nPedState = PED_IDLE;
|
||||
SetPedState(PED_IDLE);
|
||||
RestorePreviousState();
|
||||
}
|
||||
#endif
|
||||
|
@ -281,7 +281,7 @@ CPed::SetAttack(CEntity *victim)
|
|||
(m_nPedState != PED_FIGHT && m_nMoveState != PEDMOVE_NONE && m_nMoveState != PEDMOVE_STILL && !(m_pedStats->m_flags & STAT_SHOPPING_BAGS))) {
|
||||
|
||||
if (m_nPedState != PED_ATTACK) {
|
||||
m_nPedState = PED_ATTACK;
|
||||
SetPedState(PED_ATTACK);
|
||||
bIsAttacking = false;
|
||||
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, curWeapon->m_AnimToPlay, 8.0f);
|
||||
animAssoc->SetRun();
|
||||
|
@ -329,7 +329,7 @@ CPed::SetAttack(CEntity *victim)
|
|||
if (IsPlayer())
|
||||
CPad::GetPad(0)->ResetAverageWeapon();
|
||||
|
||||
PointBlankNecessity pointBlankStatus;
|
||||
uint8 pointBlankStatus;
|
||||
if ((curWeapon->m_eWeaponFire == WEAPON_FIRE_INSTANT_HIT || GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER)
|
||||
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
|
||||
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON_RUNABOUT
|
||||
|
@ -348,7 +348,7 @@ CPed::SetAttack(CEntity *victim)
|
|||
if (m_nPedState != PED_AIM_GUN)
|
||||
SetStoredState();
|
||||
|
||||
m_nPedState = PED_ATTACK;
|
||||
SetPedState(PED_ATTACK);
|
||||
SetMoveState(PEDMOVE_NONE);
|
||||
if (bCrouchWhenShooting) {
|
||||
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_RBLOCK_CSHOOT, 4.0f);
|
||||
|
@ -475,7 +475,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
|
|||
ped->ClearAttack();
|
||||
}
|
||||
|
||||
PointBlankNecessity
|
||||
uint8
|
||||
CPed::CheckForPointBlankPeds(CPed *pedToVerify)
|
||||
{
|
||||
float pbDistance = 1.1f;
|
||||
|
@ -786,7 +786,7 @@ CPed::StartFightAttack(uint8 buttonPressure)
|
|||
RestoreHeadingRate();
|
||||
}
|
||||
|
||||
m_nPedState = PED_FIGHT;
|
||||
SetPedState(PED_FIGHT);
|
||||
m_fightButtonPressure = 0;
|
||||
RpAnimBlendClumpRemoveAssociations(GetClump(), ASSOC_REPEAT);
|
||||
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK_START);
|
||||
|
@ -1062,7 +1062,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
|
|||
m_nWaitState = WAITSTATE_FALSE;
|
||||
RestoreHeadingRate();
|
||||
}
|
||||
m_nPedState = PED_FIGHT;
|
||||
SetPedState(PED_FIGHT);
|
||||
m_fightButtonPressure = 0;
|
||||
RpAnimBlendClumpRemoveAssociations(GetClump(), ASSOC_REPEAT);
|
||||
CAnimBlendAssociation *walkStartAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WALK_START);
|
||||
|
@ -1690,7 +1690,7 @@ CPed::FightStrike(CVector &touchedNodePos)
|
|||
if (m_fightState == FIGHTSTATE_NO_MOVE)
|
||||
m_fightState = FIGHTSTATE_1;
|
||||
|
||||
m_vecHitLastPos = *touchedNodePos;
|
||||
m_vecHitLastPos = touchedNodePos;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1796,7 +1796,7 @@ CPed::SetInvestigateEvent(eEventType event, CVector2D pos, float distanceToCount
|
|||
|
||||
SetStoredState();
|
||||
bFindNewNodeAfterStateRestore = false;
|
||||
m_nPedState = PED_INVESTIGATE;
|
||||
SetPedState(PED_INVESTIGATE);
|
||||
m_standardTimer = CTimer::GetTimeInMilliseconds() + time;
|
||||
m_eventType = event;
|
||||
m_eventOrThreat = pos;
|
||||
|
|
|
@ -137,28 +137,28 @@ CPedIK::RotateTorso(AnimBlendFrameData *node, LimbOrientation *limb, bool change
|
|||
}
|
||||
|
||||
void
|
||||
CPedIK::GetComponentPosition(RwV3d *pos, uint32 node)
|
||||
CPedIK::GetComponentPosition(RwV3d &pos, uint32 node)
|
||||
{
|
||||
RwFrame *f;
|
||||
RwMatrix *mat;
|
||||
|
||||
#ifdef PED_SKIN
|
||||
if(IsClumpSkinned(m_ped->GetClump())){
|
||||
pos->x = 0.0f;
|
||||
pos->y = 0.0f;
|
||||
pos->z = 0.0f;
|
||||
pos.x = 0.0f;
|
||||
pos.y = 0.0f;
|
||||
pos.z = 0.0f;
|
||||
mat = GetComponentMatrix(m_ped, node);
|
||||
// could just copy the position out of the matrix...
|
||||
RwV3dTransformPoints(pos, pos, 1, mat);
|
||||
RwV3dTransformPoints(&pos, &pos, 1, mat);
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
f = m_ped->m_pFrames[node]->frame;
|
||||
mat = RwFrameGetMatrix(f);
|
||||
*pos = mat->pos;
|
||||
pos = mat->pos;
|
||||
|
||||
for (f = RwFrameGetParent(f); f; f = RwFrameGetParent(f))
|
||||
RwV3dTransformPoints(pos, pos, 1, RwFrameGetMatrix(f));
|
||||
RwV3dTransformPoints(&pos, &pos, 1, RwFrameGetMatrix(f));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
bool PointGunInDirection(float targetYaw, float targetPitch);
|
||||
bool PointGunInDirectionUsingArm(float targetYaw, float targetPitch);
|
||||
bool PointGunAtPosition(CVector const& position);
|
||||
void GetComponentPosition(RwV3d *pos, uint32 node);
|
||||
void GetComponentPosition(RwV3d &pos, uint32 node);
|
||||
static RwMatrix *GetWorldMatrix(RwFrame *source, RwMatrix *destination);
|
||||
void RotateTorso(AnimBlendFrameData* animBlend, LimbOrientation* limb, bool changeRoll);
|
||||
void ExtractYawAndPitchLocal(RwMatrix *mat, float *yaw, float *pitch);
|
||||
|
|
|
@ -47,8 +47,8 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
|
|||
m_nSelectedWepSlot = WEAPONTYPE_UNARMED;
|
||||
m_nSpeedTimer = 0;
|
||||
m_bSpeedTimerFlag = false;
|
||||
m_pPointGunAt = nil;
|
||||
m_nPedState = PED_IDLE;
|
||||
SetWeaponLockOnTarget(nil);
|
||||
SetPedState(PED_IDLE);
|
||||
#ifndef FIX_BUGS
|
||||
m_fCurrentStamina = m_fMaxStamina = 150.0f;
|
||||
#endif
|
||||
|
@ -73,7 +73,7 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
|
|||
void CPlayerPed::ClearWeaponTarget()
|
||||
{
|
||||
if (m_nPedType == PEDTYPE_PLAYER1) {
|
||||
m_pPointGunAt = nil;
|
||||
SetWeaponLockOnTarget(nil);
|
||||
TheCamera.ClearPlayerWeaponMode();
|
||||
CWeaponEffects::ClearCrossHair();
|
||||
}
|
||||
|
@ -113,14 +113,10 @@ CPlayerPed::AnnoyPlayerPed(bool annoyedByPassingEntity)
|
|||
{
|
||||
if (m_pedStats->m_temper < 52) {
|
||||
m_pedStats->m_temper++;
|
||||
} else {
|
||||
if (annoyedByPassingEntity) {
|
||||
if (m_pedStats->m_temper < 55) {
|
||||
m_pedStats->m_temper++;
|
||||
} else {
|
||||
m_pedStats->m_temper = 46;
|
||||
}
|
||||
}
|
||||
} else if (annoyedByPassingEntity && m_pedStats->m_temper < 55) {
|
||||
m_pedStats->m_temper++;
|
||||
} else if (annoyedByPassingEntity) {
|
||||
m_pedStats->m_temper = 46;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +211,7 @@ CPlayerPed::ReApplyMoveAnims(void)
|
|||
for(int i = 0; i < ARRAY_SIZE(moveAnims); i++) {
|
||||
CAnimBlendAssociation *curMoveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), moveAnims[i]);
|
||||
if (curMoveAssoc) {
|
||||
if (strcmp(CAnimManager::GetAnimAssociation(m_animGroup, moveAnims[i])->hierarchy->name, curMoveAssoc->hierarchy->name) != 0) {
|
||||
if (CGeneral::faststrcmp(CAnimManager::GetAnimAssociation(m_animGroup, moveAnims[i])->hierarchy->name, curMoveAssoc->hierarchy->name)) {
|
||||
CAnimBlendAssociation *newMoveAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, moveAnims[i]);
|
||||
newMoveAssoc->blendDelta = curMoveAssoc->blendDelta;
|
||||
newMoveAssoc->blendAmount = curMoveAssoc->blendAmount;
|
||||
|
@ -248,7 +244,7 @@ CPlayerPed::SetInitialState(void)
|
|||
if (m_pFire)
|
||||
m_pFire->Extinguish();
|
||||
RpAnimBlendClumpRemoveAllAssociations(GetClump());
|
||||
m_nPedState = PED_IDLE;
|
||||
SetPedState(PED_IDLE);
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
m_nLastPedState = PED_NONE;
|
||||
m_animGroup = ASSOCGRP_PLAYER;
|
||||
|
@ -288,7 +284,7 @@ CPlayerPed::SetRealMoveAnim(void)
|
|||
if (!curIdleAssoc)
|
||||
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
|
||||
|
||||
if ((!curRunStopAssoc || !(curRunStopAssoc->IsRunning())) && (!curRunStopRAssoc || !(curRunStopRAssoc->IsRunning()))) {
|
||||
if (!((curRunStopAssoc && curRunStopAssoc->IsRunning()) || (curRunStopRAssoc && curRunStopRAssoc->IsRunning()))) {
|
||||
|
||||
if (curRunStopAssoc && curRunStopAssoc->blendDelta >= 0.0f || curRunStopRAssoc && curRunStopRAssoc->blendDelta >= 0.0f) {
|
||||
if (curRunStopAssoc) {
|
||||
|
@ -340,8 +336,8 @@ CPlayerPed::SetRealMoveAnim(void)
|
|||
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f);
|
||||
}
|
||||
}
|
||||
|
||||
m_nMoveState = PEDMOVE_STILL;
|
||||
|
||||
} else {
|
||||
if (curIdleAssoc) {
|
||||
if (curWalkStartAssoc) {
|
||||
|
@ -394,6 +390,7 @@ CPlayerPed::SetRealMoveAnim(void)
|
|||
}
|
||||
|
||||
if (curSprintAssoc && (m_nMoveState != PEDMOVE_SPRINT || m_fMoveSpeed < 0.4f)) {
|
||||
// Stop sprinting in various conditions
|
||||
if (curSprintAssoc->blendAmount == 0.0f) {
|
||||
curSprintAssoc->blendDelta = -1000.0f;
|
||||
curSprintAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
||||
|
@ -417,8 +414,8 @@ CPlayerPed::SetRealMoveAnim(void)
|
|||
curRunAssoc->flags &= ~ASSOC_RUNNING;
|
||||
curRunAssoc->blendAmount = 0.0f;
|
||||
curRunAssoc->blendDelta = 0.0f;
|
||||
} else if (curSprintAssoc->blendDelta >= 0.0f) {
|
||||
|
||||
} else if (curSprintAssoc->blendDelta >= 0.0f) {
|
||||
// Stop sprinting when tired
|
||||
curSprintAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
||||
curSprintAssoc->blendDelta = -1.0f;
|
||||
|
@ -428,7 +425,9 @@ CPlayerPed::SetRealMoveAnim(void)
|
|||
curSprintAssoc->blendDelta = -8.0f;
|
||||
curRunAssoc->blendDelta = 8.0f;
|
||||
}
|
||||
|
||||
} else if (curWalkStartAssoc) {
|
||||
// Walk start and walk/run shouldn't run at the same time
|
||||
curWalkAssoc->flags &= ~ASSOC_RUNNING;
|
||||
curRunAssoc->flags &= ~ASSOC_RUNNING;
|
||||
curWalkAssoc->blendAmount = 0.0f;
|
||||
|
@ -436,11 +435,13 @@ CPlayerPed::SetRealMoveAnim(void)
|
|||
|
||||
} else if (m_nMoveState == PEDMOVE_SPRINT) {
|
||||
if (curSprintAssoc) {
|
||||
// We have anim, do it
|
||||
if (curSprintAssoc->blendDelta < 0.0f) {
|
||||
curSprintAssoc->blendDelta = 2.0f;
|
||||
curRunAssoc->blendDelta = -2.0f;
|
||||
}
|
||||
} else {
|
||||
// Transition between run-sprint
|
||||
curWalkAssoc->blendAmount = 0.0f;
|
||||
curRunAssoc->blendAmount = 1.0f;
|
||||
curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_SPRINT, 2.0f);
|
||||
|
@ -703,14 +704,7 @@ CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
|
|||
float padMove = CVector2D(leftRight, upDown).Magnitude();
|
||||
float padMoveInGameUnit = padMove / PAD_MOVE_TO_GAME_WORLD_MOVE;
|
||||
if (padMoveInGameUnit > 0.0f) {
|
||||
#ifdef FREE_CAM
|
||||
if (!CCamera::bFreeCam)
|
||||
m_fRotationDest = CGeneral::LimitRadianAngle(TheCamera.Orientation);
|
||||
else
|
||||
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown) - TheCamera.Orientation;
|
||||
#else
|
||||
m_fRotationDest = CGeneral::LimitRadianAngle(TheCamera.Orientation);
|
||||
#endif
|
||||
m_fMoveSpeed = Min(padMoveInGameUnit, 0.07f * CTimer::GetTimeStep() + m_fMoveSpeed);
|
||||
} else {
|
||||
m_fMoveSpeed = 0.0f;
|
||||
|
@ -718,8 +712,7 @@ CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
|
|||
|
||||
if (m_nPedState == PED_JUMP) {
|
||||
if (bIsInTheAir) {
|
||||
if (bUsesCollision && !bHitSteepSlope &&
|
||||
(!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
|
||||
if (bUsesCollision && !bHitSteepSlope && (!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
|
||||
&& m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) {
|
||||
|
||||
float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O
|
||||
|
@ -730,8 +723,7 @@ CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
|
|||
m_fMoveSpeed = 0.0f;
|
||||
}
|
||||
}
|
||||
if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy)
|
||||
&& padUsed->GetSprint()) {
|
||||
if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy) && padUsed->GetSprint()) {
|
||||
m_nMoveState = PEDMOVE_SPRINT;
|
||||
}
|
||||
if (m_nPedState != PED_FIGHT)
|
||||
|
@ -856,10 +848,9 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
|
|||
{
|
||||
CEntity *nextTarget = nil;
|
||||
float weaponRange = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_fRange;
|
||||
// nextTarget = nil;
|
||||
// nextTarget = nil; // duplicate
|
||||
float lastCloseness = -10000.0f;
|
||||
// unused
|
||||
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y);
|
||||
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
|
||||
CVector distVec = previousTarget->GetPosition() - GetPosition();
|
||||
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
|
||||
|
||||
|
@ -884,9 +875,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
|
|||
if (!nextTarget)
|
||||
return false;
|
||||
|
||||
m_pPointGunAt = nextTarget;
|
||||
if (nextTarget)
|
||||
nextTarget->RegisterReference((CEntity**)&m_pPointGunAt);
|
||||
SetWeaponLockOnTarget(nextTarget);
|
||||
SetPointGunAt(nextTarget);
|
||||
return true;
|
||||
}
|
||||
|
@ -900,14 +889,14 @@ CPlayerPed::FindWeaponLockOnTarget(void)
|
|||
if (m_pPointGunAt) {
|
||||
CVector distVec = m_pPointGunAt->GetPosition() - GetPosition();
|
||||
if (distVec.Magnitude2D() > weaponRange) {
|
||||
m_pPointGunAt = nil;
|
||||
SetWeaponLockOnTarget(nil);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// nextTarget = nil;
|
||||
// nextTarget = nil; // duplicate
|
||||
float lastCloseness = -10000.0f;
|
||||
float referenceBeta = CGeneral::GetATanOfXY(GetForward().x, GetForward().y);
|
||||
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
|
||||
|
@ -931,9 +920,7 @@ CPlayerPed::FindWeaponLockOnTarget(void)
|
|||
if (!nextTarget)
|
||||
return false;
|
||||
|
||||
m_pPointGunAt = nextTarget;
|
||||
if (nextTarget)
|
||||
nextTarget->RegisterReference((CEntity**)&m_pPointGunAt);
|
||||
SetWeaponLockOnTarget(nextTarget);
|
||||
SetPointGunAt(nextTarget);
|
||||
return true;
|
||||
}
|
||||
|
@ -1002,7 +989,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
|
|||
GetWeapon()->m_eWeaponType == WEAPONTYPE_SNIPERRIFLE || GetWeapon()->m_eWeaponType == WEAPONTYPE_M16) {
|
||||
if (padUsed->TargetJustDown()) {
|
||||
SetStoredState();
|
||||
m_nPedState = PED_SNIPER_MODE;
|
||||
SetPedState(PED_SNIPER_MODE);
|
||||
#ifdef FREE_CAM
|
||||
if (CCamera::bFreeCam && TheCamera.Cams[0].Using3rdPersonMouseCam()) {
|
||||
m_fRotationCur = CGeneral::LimitRadianAngle(-TheCamera.Orientation);
|
||||
|
@ -1105,7 +1092,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
|
|||
m_fRotationCur += (limitedRotDest - m_fRotationCur) / 2;
|
||||
}
|
||||
}
|
||||
} else if (weaponInfo->m_bCanAimWithArm)
|
||||
} else if (weaponInfo->m_bCanAimWithArm && m_nPedState != PED_ATTACK)
|
||||
ClearPointGunAt();
|
||||
}
|
||||
}
|
||||
|
@ -1159,7 +1146,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
|
|||
#else
|
||||
CVector markPos;
|
||||
if (m_pPointGunAt->IsPed()) {
|
||||
((CPed*)m_pPointGunAt)->m_pedIK.GetComponentPosition((RwV3d*)markPos, PED_MID);
|
||||
((CPed*)m_pPointGunAt)->m_pedIK.GetComponentPosition(markPos, PED_MID);
|
||||
} else {
|
||||
markPos = m_pPointGunAt->GetPosition();
|
||||
}
|
||||
|
@ -1212,8 +1199,7 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
|
|||
|
||||
if (m_nPedState == PED_JUMP) {
|
||||
if (bIsInTheAir) {
|
||||
if (bUsesCollision && !bHitSteepSlope &&
|
||||
(!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
|
||||
if (bUsesCollision && !bHitSteepSlope && (!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
|
||||
&& m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) {
|
||||
|
||||
float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O
|
||||
|
@ -1225,8 +1211,7 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
|
|||
}
|
||||
}
|
||||
|
||||
if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy)
|
||||
&& padUsed->GetSprint()) {
|
||||
if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy) && padUsed->GetSprint()) {
|
||||
m_nMoveState = PEDMOVE_SPRINT;
|
||||
}
|
||||
if (m_nPedState != PED_FIGHT)
|
||||
|
@ -1291,25 +1276,26 @@ CPlayerPed::ProcessControl(void)
|
|||
if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) {
|
||||
if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) {
|
||||
CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR);
|
||||
if (!rollDoorAssoc) {
|
||||
rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR_LOW);
|
||||
}
|
||||
|
||||
// These comparisons are wrong, they return uint16
|
||||
if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || padUsed
|
||||
&& (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f
|
||||
|| padUsed->GetBrake() != 0.0f)) {
|
||||
|
||||
if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || (rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR_LOW))) {
|
||||
if (rollDoorAssoc)
|
||||
m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime);
|
||||
} else {
|
||||
m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF;
|
||||
if (m_pMyVehicle->bLowVehicle)
|
||||
rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR_LOW);
|
||||
else
|
||||
rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR);
|
||||
|
||||
rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this);
|
||||
} else {
|
||||
// These comparisons are wrong, they return uint16
|
||||
if (padUsed && (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f || padUsed->GetBrake() != 0.0f)) {
|
||||
if (rollDoorAssoc)
|
||||
m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime);
|
||||
|
||||
} else {
|
||||
m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF;
|
||||
if (m_pMyVehicle->bLowVehicle)
|
||||
rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR_LOW);
|
||||
else
|
||||
rollDoorAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLDOOR);
|
||||
|
||||
rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -1338,12 +1324,18 @@ CPlayerPed::ProcessControl(void)
|
|||
case PED_FIGHT:
|
||||
case PED_AIM_GUN:
|
||||
if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK)) {
|
||||
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) {
|
||||
if (TheCamera.Cams[0].Using3rdPersonMouseCam()
|
||||
#ifdef FREE_CAM
|
||||
&& !CCamera::bFreeCam
|
||||
#endif
|
||||
) {
|
||||
if (padUsed)
|
||||
PlayerControl1stPersonRunAround(padUsed);
|
||||
|
||||
} else if (m_nPedState == PED_FIGHT) {
|
||||
if (padUsed)
|
||||
PlayerControlFighter(padUsed);
|
||||
|
||||
} else if (padUsed) {
|
||||
PlayerControlZelda(padUsed);
|
||||
}
|
||||
|
@ -1351,41 +1343,6 @@ CPlayerPed::ProcessControl(void)
|
|||
if (IsPedInControl() && padUsed)
|
||||
ProcessPlayerWeapon(padUsed);
|
||||
break;
|
||||
case PED_LOOK_ENTITY:
|
||||
case PED_LOOK_HEADING:
|
||||
case PED_WANDER_RANGE:
|
||||
case PED_WANDER_PATH:
|
||||
case PED_PURSUE:
|
||||
case PED_FOLLOW_PATH:
|
||||
case PED_ROCKET_MODE:
|
||||
case PED_DUMMY:
|
||||
case PED_PAUSE:
|
||||
case PED_FACE_PHONE:
|
||||
case PED_MAKE_CALL:
|
||||
case PED_CHAT:
|
||||
case PED_MUG:
|
||||
case PED_AI_CONTROL:
|
||||
case PED_FOLLOW_ROUTE:
|
||||
case PED_CPR:
|
||||
case PED_SOLICIT:
|
||||
case PED_BUY_ICECREAM:
|
||||
case PED_INVESTIGATE:
|
||||
case PED_STEP_AWAY:
|
||||
case PED_ON_FIRE:
|
||||
case PED_UNKNOWN:
|
||||
case PED_STATES_NO_AI:
|
||||
case PED_STAGGER:
|
||||
case PED_DIVE_AWAY:
|
||||
case PED_STATES_NO_ST:
|
||||
case PED_ARREST_PLAYER:
|
||||
case PED_DRIVING:
|
||||
case PED_PASSENGER:
|
||||
case PED_TAXI_PASSENGER:
|
||||
case PED_OPEN_DOOR:
|
||||
case PED_DIE:
|
||||
case PED_DEAD:
|
||||
case PED_HANDS_UP:
|
||||
break;
|
||||
case PED_SEEK_ENTITY:
|
||||
m_vecSeekPos = m_pSeekTarget->GetPosition();
|
||||
|
||||
|
@ -1415,6 +1372,7 @@ CPlayerPed::ProcessControl(void)
|
|||
if (FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_M16) {
|
||||
if (padUsed)
|
||||
PlayerControlM16(padUsed);
|
||||
|
||||
} else if (padUsed) {
|
||||
PlayerControlSniper(padUsed);
|
||||
}
|
||||
|
@ -1464,6 +1422,8 @@ CPlayerPed::ProcessControl(void)
|
|||
if (m_nLastPedState == PED_DRAG_FROM_CAR && m_pVehicleAnim)
|
||||
BeingDraggedFromCar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (padUsed && IsPedShootable()) {
|
||||
ProcessWeaponSwitch(padUsed);
|
||||
|
@ -1477,20 +1437,17 @@ CPlayerPed::ProcessControl(void)
|
|||
m_lookTimer = 0;
|
||||
float camAngle = CGeneral::LimitRadianAngle(TheCamera.Cams[TheCamera.ActiveCam].Front.Heading());
|
||||
float angleBetweenPlayerAndCam = Abs(camAngle - m_fRotationCur);
|
||||
if (m_nPedState != PED_ATTACK
|
||||
&& angleBetweenPlayerAndCam > DEGTORAD(30.0f) && angleBetweenPlayerAndCam < DEGTORAD(330.0f)) {
|
||||
if (m_nPedState != PED_ATTACK && angleBetweenPlayerAndCam > DEGTORAD(30.0f) && angleBetweenPlayerAndCam < DEGTORAD(330.0f)) {
|
||||
|
||||
if (angleBetweenPlayerAndCam > DEGTORAD(150.0f) && angleBetweenPlayerAndCam < DEGTORAD(210.0f)) {
|
||||
float rightTurnAngle = CGeneral::LimitRadianAngle(m_fRotationCur - DEGTORAD(150.0f));
|
||||
float leftTurnAngle = CGeneral::LimitRadianAngle(DEGTORAD(150.0f) + m_fRotationCur);
|
||||
if (m_fLookDirection != 999999.0f) {
|
||||
if (Abs(rightTurnAngle - m_fLookDirection) < Abs(leftTurnAngle - m_fLookDirection))
|
||||
camAngle = rightTurnAngle;
|
||||
else
|
||||
camAngle = leftTurnAngle;
|
||||
} else {
|
||||
if (m_fLookDirection == 999999.0f)
|
||||
camAngle = rightTurnAngle;
|
||||
}
|
||||
else if (Abs(rightTurnAngle - m_fLookDirection) < Abs(leftTurnAngle - m_fLookDirection))
|
||||
camAngle = rightTurnAngle;
|
||||
else
|
||||
camAngle = leftTurnAngle;
|
||||
}
|
||||
SetLookFlag(camAngle, true);
|
||||
SetLookTimer(CTimer::GetTimeStepInMilliseconds() * 5.0f);
|
||||
|
|
|
@ -718,10 +718,10 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
|
|||
if (i != 0) {
|
||||
// Gang member
|
||||
newPed->SetLeader(gangLeader);
|
||||
#ifndef FIX_BUGS
|
||||
#if !defined(FIX_BUGS) && GTA_VERSION >= GTA3_PC_10
|
||||
// seems to be a miami leftover (this code is not on PS2) but gang peds end up just being frozen
|
||||
newPed->m_nPedState = PED_UNKNOWN;
|
||||
gangLeader->m_nPedState = PED_UNKNOWN;
|
||||
newPed->SetPedState(PED_UNKNOWN);
|
||||
gangLeader->SetPedState(PED_UNKNOWN);
|
||||
newPed->m_fRotationCur = CGeneral::GetRadianAngleBetweenPoints(
|
||||
gangLeader->GetPosition().x, gangLeader->GetPosition().y,
|
||||
newPed->GetPosition().x, newPed->GetPosition().y);
|
||||
|
|
|
@ -133,7 +133,7 @@ CClouds::Render(void)
|
|||
CSprite::InitSpriteBuffer();
|
||||
|
||||
int minute = CClock::GetHours()*60 + CClock::GetMinutes();
|
||||
RwV3d campos = *(RwV3d*)&TheCamera.GetPosition();
|
||||
RwV3d campos = TheCamera.GetPosition();
|
||||
|
||||
// Moon
|
||||
int moonfadeout = Abs(minute - 180); // fully visible at 3AM
|
||||
|
|
|
@ -255,7 +255,7 @@ CCoronas::Render(void)
|
|||
|
||||
CVector spriteCoors;
|
||||
float spritew, spriteh;
|
||||
if(!CSprite::CalcScreenCoors(aCoronas[i].coors, spriteCoors, &spritew, &spriteh, true)){
|
||||
if(!CSprite::CalcScreenCoors(aCoronas[i].coors, &spriteCoors, &spritew, &spriteh, true)){
|
||||
aCoronas[i].offScreen = true;
|
||||
aCoronas[i].sightClear = false;
|
||||
}else{
|
||||
|
@ -464,7 +464,7 @@ CCoronas::RenderReflections(void)
|
|||
|
||||
CVector spriteCoors;
|
||||
float spritew, spriteh;
|
||||
if(CSprite::CalcScreenCoors(coors, spriteCoors, &spritew, &spriteh, true)){
|
||||
if(CSprite::CalcScreenCoors(coors, &spriteCoors, &spritew, &spriteh, true)){
|
||||
float drawDist = 0.75f * aCoronas[i].drawDist;
|
||||
drawDist = Min(drawDist, 55.0f);
|
||||
if(spriteCoors.z < drawDist){
|
||||
|
@ -531,7 +531,7 @@ CCoronas::DoSunAndMoon(void)
|
|||
|
||||
CVector spriteCoors;
|
||||
float spritew, spriteh;
|
||||
if(CSprite::CalcScreenCoors(sunCoors, spriteCoors, &spritew, &spriteh, true)){
|
||||
if(CSprite::CalcScreenCoors(sunCoors, &spriteCoors, &spritew, &spriteh, true)){
|
||||
SunScreenX = spriteCoors.x;
|
||||
SunScreenY = spriteCoors.y;
|
||||
}else{
|
||||
|
|
|
@ -655,7 +655,7 @@ void CScrollBar::Render()
|
|||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
|
||||
|
||||
CVector coronaCoord, screenCoord;
|
||||
float screenW, screenH;
|
||||
float screenW, screenH;
|
||||
for (int i = 1; i < ARRAY_SIZE(m_MessageBar); ++i)
|
||||
{
|
||||
for (int j = 0; j < 5; ++j)
|
||||
|
@ -667,7 +667,7 @@ void CScrollBar::Render()
|
|||
// Render main coronas
|
||||
if (m_MessageBar[i] & (1 << j))
|
||||
{
|
||||
if (CSprite::CalcScreenCoors(coronaCoord, screenCoord, &screenW, &screenH, true))
|
||||
if (CSprite::CalcScreenCoors(coronaCoord, &screenCoord, &screenW, &screenH, true))
|
||||
{
|
||||
CSprite::RenderBufferedOneXLUSprite(
|
||||
screenCoord.x, screenCoord.y, screenCoord.z,
|
||||
|
@ -679,7 +679,7 @@ void CScrollBar::Render()
|
|||
// Render smaller and faded coronas for a trailing effect
|
||||
else if (m_MessageBar[i - 1] & (1 << j))
|
||||
{
|
||||
if (CSprite::CalcScreenCoors(coronaCoord, screenCoord, &screenW, &screenH, true))
|
||||
if (CSprite::CalcScreenCoors(coronaCoord, &screenCoord, &screenW, &screenH, true))
|
||||
{
|
||||
CSprite::RenderBufferedOneXLUSprite(
|
||||
screenCoord.x, screenCoord.y, screenCoord.z,
|
||||
|
@ -834,7 +834,7 @@ void CDigitalClock::Render()
|
|||
const char* clockMessage = FindDigitalClockMessage();
|
||||
|
||||
CVector coronaCoord, screenCoord;
|
||||
float screenW, screenH;
|
||||
float screenW, screenH;
|
||||
for (int c = 0; c < 5; ++c) // for each char to be displayed
|
||||
{
|
||||
for (int i = 0; i < 5; ++i) // for each column of coronas
|
||||
|
@ -847,7 +847,7 @@ void CDigitalClock::Render()
|
|||
coronaCoord.y = m_Position.y + (8 * c + i) * m_Size.y * m_fScale / 8.0f;
|
||||
coronaCoord.z = m_Position.z + j * m_fScale / 8.0f;
|
||||
|
||||
if (CSprite::CalcScreenCoors(coronaCoord, screenCoord, &screenW, &screenH, true))
|
||||
if (CSprite::CalcScreenCoors(coronaCoord, &screenCoord, &screenW, &screenH, true))
|
||||
{
|
||||
CSprite::RenderBufferedOneXLUSprite(
|
||||
screenCoord.x, screenCoord.y, screenCoord.z,
|
||||
|
|
|
@ -1570,7 +1570,7 @@ void CParticle::Render()
|
|||
float w;
|
||||
float h;
|
||||
|
||||
if ( CSprite::CalcScreenCoors(particle->m_vecPosition, coors, &w, &h, true) )
|
||||
if ( CSprite::CalcScreenCoors(particle->m_vecPosition, &coors, &w, &h, true) )
|
||||
{
|
||||
#ifdef PC_PARTICLE
|
||||
if ( (!particleBanned || SCREEN_WIDTH * fParticleScaleLimit >= w)
|
||||
|
@ -1650,7 +1650,7 @@ void CParticle::Render()
|
|||
float fRotation;
|
||||
float fTrailLength;
|
||||
|
||||
if ( CSprite::CalcScreenCoors(vecPrevPos, particle->m_vecScreenPosition, &fTrailLength, &fRotation, true) )
|
||||
if ( CSprite::CalcScreenCoors(vecPrevPos, &particle->m_vecScreenPosition, &fTrailLength, &fRotation, true) )
|
||||
{
|
||||
CVector2D vecDist
|
||||
(
|
||||
|
|
|
@ -218,7 +218,7 @@ CPointLights::RenderFogEffect(void)
|
|||
// more intensity the closer to line
|
||||
intensity *= 1.0f - sq(Sqrt(linedistsq) / FOG_AREA_WIDTH);
|
||||
|
||||
if(CSprite::CalcScreenCoors(fogcoors, spriteCoors, &spritew, &spriteh, true)){
|
||||
if(CSprite::CalcScreenCoors(fogcoors, &spriteCoors, &spritew, &spriteh, true)){
|
||||
float rotation = (CTimer::GetTimeInMilliseconds()&0x1FFF) * 2*3.14f / 0x2000;
|
||||
float size = FogSizes[r>>1];
|
||||
CSprite::RenderOneXLUSprite_Rotate_Aspect(spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
||||
|
@ -267,7 +267,7 @@ CPointLights::RenderFogEffect(void)
|
|||
intensity *= 1.0f - sq(lightdist / FOG_AREA_RADIUS);
|
||||
|
||||
CVector fogcoors(xi, yi, point.point.z + 1.6f);
|
||||
if(CSprite::CalcScreenCoors(fogcoors, spriteCoors, &spritew, &spriteh, true)){
|
||||
if(CSprite::CalcScreenCoors(fogcoors, &spriteCoors, &spritew, &spriteh, true)){
|
||||
float rotation = (CTimer::GetTimeInMilliseconds()&0x3FFF) * 2*3.14f / 0x4000;
|
||||
float size = FogSizes[r>>1];
|
||||
CSprite::RenderOneXLUSprite_Rotate_Aspect(spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
||||
|
|
|
@ -741,7 +741,7 @@ CRenderer::ScanWorld(void)
|
|||
vectors[CORNER_PRIO_RIGHT].x = vectors[CORNER_LOD_RIGHT].x * 0.2f;
|
||||
vectors[CORNER_PRIO_RIGHT].y = vectors[CORNER_LOD_RIGHT].y * 0.2f;
|
||||
vectors[CORNER_PRIO_RIGHT].z = vectors[CORNER_LOD_RIGHT].z;
|
||||
RwV3dTransformPoints((RwV3d*)vectors, (RwV3d*)vectors, 9, cammatrix);
|
||||
RwV3dTransformPoints(vectors, vectors, 9, cammatrix);
|
||||
|
||||
m_loadingPriority = false;
|
||||
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN ||
|
||||
|
@ -881,7 +881,7 @@ CRenderer::RequestObjectsInFrustum(void)
|
|||
vectors[CORNER_PRIO_RIGHT].x = vectors[CORNER_LOD_RIGHT].x * 0.2f;
|
||||
vectors[CORNER_PRIO_RIGHT].y = vectors[CORNER_LOD_RIGHT].y * 0.2f;
|
||||
vectors[CORNER_PRIO_RIGHT].z = vectors[CORNER_LOD_RIGHT].z;
|
||||
RwV3dTransformPoints((RwV3d*)vectors, (RwV3d*)vectors, 9, cammatrix);
|
||||
RwV3dTransformPoints(vectors, vectors, 9, cammatrix);
|
||||
|
||||
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN ||
|
||||
#ifdef FIX_BUGS
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "common.h"
|
||||
#include "main.h"
|
||||
#include "FileMgr.h"
|
||||
#include "FileLoader.h"
|
||||
#include "TxdStore.h"
|
||||
#include "Timer.h"
|
||||
#include "Weather.h"
|
||||
|
@ -30,8 +31,8 @@ float TEXTURE_ADDV;
|
|||
int32 CWaterLevel::ms_nNoOfWaterLevels;
|
||||
float CWaterLevel::ms_aWaterZs[48];
|
||||
CRect CWaterLevel::ms_aWaterRects[48];
|
||||
uint8 CWaterLevel::aWaterBlockList[WATER_BLOCK_SIZE][WATER_BLOCK_SIZE];
|
||||
uint8 CWaterLevel::aWaterFineBlockList[WATER_FINEBLOCK_SIZE][WATER_FINEBLOCK_SIZE];
|
||||
int8 CWaterLevel::aWaterBlockList[MAX_LARGE_SECTORS][MAX_LARGE_SECTORS];
|
||||
int8 CWaterLevel::aWaterFineBlockList[MAX_SMALL_SECTORS][MAX_SMALL_SECTORS];
|
||||
bool CWaterLevel::WavesCalculatedThisFrame;
|
||||
RpAtomic *CWaterLevel::ms_pWavyAtomic;
|
||||
RpGeometry *CWaterLevel::apGeomArray[8];
|
||||
|
@ -53,41 +54,179 @@ const float fGreenMult = 1.0f;
|
|||
const float fBlueMult = 1.4f;
|
||||
|
||||
|
||||
|
||||
void
|
||||
CWaterLevel::Initialise(Const char *pWaterDat)
|
||||
{
|
||||
ms_nNoOfWaterLevels = 0;
|
||||
|
||||
|
||||
#ifdef MASTER
|
||||
int32 hFile = -1;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
hFile = CFileMgr::OpenFile("DATA\\waterpro.dat", "rb");
|
||||
}
|
||||
while ( hFile < 0 );
|
||||
|
||||
if ( hFile > 0 )
|
||||
#else
|
||||
int32 hFile = CFileMgr::OpenFile("DATA\\waterpro.dat", "rb");
|
||||
#endif
|
||||
|
||||
if (hFile > 0)
|
||||
{
|
||||
if ( hFile >= 0 )
|
||||
{
|
||||
CFileMgr::Read(hFile, (char *)&ms_nNoOfWaterLevels, sizeof(ms_nNoOfWaterLevels));
|
||||
CFileMgr::Read(hFile, (char *)ms_aWaterZs, sizeof(ms_aWaterZs));
|
||||
CFileMgr::Read(hFile, (char *)ms_aWaterRects, sizeof(ms_aWaterRects));
|
||||
CFileMgr::Read(hFile, (char *)aWaterBlockList, sizeof(aWaterBlockList));
|
||||
CFileMgr::Read(hFile, (char *)aWaterFineBlockList, sizeof(aWaterFineBlockList));
|
||||
}
|
||||
|
||||
CFileMgr::Read(hFile, (char *)&ms_nNoOfWaterLevels, sizeof(ms_nNoOfWaterLevels));
|
||||
CFileMgr::Read(hFile, (char *)ms_aWaterZs, sizeof(ms_aWaterZs));
|
||||
CFileMgr::Read(hFile, (char *)ms_aWaterRects, sizeof(ms_aWaterRects));
|
||||
CFileMgr::Read(hFile, (char *)aWaterBlockList, sizeof(aWaterBlockList));
|
||||
CFileMgr::Read(hFile, (char *)aWaterFineBlockList, sizeof(aWaterFineBlockList));
|
||||
|
||||
CFileMgr::CloseFile(hFile);
|
||||
}
|
||||
#ifndef MASTER
|
||||
else
|
||||
{
|
||||
printf("Init waterlevels\n");
|
||||
|
||||
CFileMgr::SetDir("");
|
||||
hFile = CFileMgr::OpenFile(pWaterDat, "r");
|
||||
|
||||
char *line;
|
||||
|
||||
while ((line = CFileLoader::LoadLine(hFile)))
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (*line && *line != ';' && !strstr(line, "* ;end of file"))
|
||||
#else
|
||||
if (*line && *line != ';')
|
||||
#endif
|
||||
{
|
||||
float z, l, b, r, t;
|
||||
sscanf(line, "%f %f %f %f %f", &z, &l, &b, &r, &t);
|
||||
AddWaterLevel(l, b, r, t, z);
|
||||
}
|
||||
}
|
||||
|
||||
CFileMgr::CloseFile(hFile);
|
||||
|
||||
for (int32 x = 0; x < MAX_SMALL_SECTORS; x++)
|
||||
{
|
||||
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
||||
{
|
||||
aWaterFineBlockList[x][y] = NO_WATER;
|
||||
}
|
||||
}
|
||||
|
||||
// rasterize water rects read from file
|
||||
for (int32 i = 0; i < ms_nNoOfWaterLevels; i++)
|
||||
{
|
||||
int32 l = WATER_HUGE_X(ms_aWaterRects[i].left);
|
||||
int32 r = WATER_HUGE_X(ms_aWaterRects[i].right) + 1.0f;
|
||||
int32 t = WATER_HUGE_Y(ms_aWaterRects[i].top);
|
||||
int32 b = WATER_HUGE_Y(ms_aWaterRects[i].bottom) + 1.0f;
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
// water.dat has rects that go out of bounds
|
||||
// which causes memory corruption
|
||||
l = clamp(l, 0, MAX_SMALL_SECTORS - 1);
|
||||
r = clamp(r, 0, MAX_SMALL_SECTORS - 1);
|
||||
t = clamp(t, 0, MAX_SMALL_SECTORS - 1);
|
||||
b = clamp(b, 0, MAX_SMALL_SECTORS - 1);
|
||||
#endif
|
||||
|
||||
for (int32 x = l; x <= r; x++)
|
||||
{
|
||||
for (int32 y = t; y <= b; y++)
|
||||
{
|
||||
aWaterFineBlockList[x][y] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove tiles that are obscured by land
|
||||
for (int32 x = 0; x < MAX_SMALL_SECTORS; x++)
|
||||
{
|
||||
float worldX = WATER_START_X + x * SMALL_SECTOR_SIZE;
|
||||
|
||||
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
||||
{
|
||||
if (aWaterFineBlockList[x][y] >= 0)
|
||||
{
|
||||
float worldY = WATER_START_Y + y * SMALL_SECTOR_SIZE;
|
||||
|
||||
int32 i;
|
||||
for (i = 0; i <= 8; i++)
|
||||
{
|
||||
for (int32 j = 0; j <= 8; j++)
|
||||
{
|
||||
CVector worldPos = CVector(worldX + i * (SMALL_SECTOR_SIZE / 8), worldY + j * (SMALL_SECTOR_SIZE / 8), ms_aWaterZs[aWaterFineBlockList[x][y]]);
|
||||
|
||||
if ((worldPos.x > WORLD_MIN_X && worldPos.x < WORLD_MAX_X) && (worldPos.y > WORLD_MIN_Y && worldPos.y < WORLD_MAX_Y) &&
|
||||
(!WaterLevelAccordingToRectangles(worldPos.x, worldPos.y) || TestVisibilityForFineWaterBlocks(worldPos)))
|
||||
continue;
|
||||
|
||||
// at least one point in the tile wasn't blocked, so don't remove water
|
||||
i = 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < 1000)
|
||||
aWaterFineBlockList[x][y] = NO_WATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RemoveIsolatedWater();
|
||||
|
||||
// calculate coarse tiles from fine tiles
|
||||
for (int32 x = 0; x < MAX_LARGE_SECTORS; x++)
|
||||
{
|
||||
for (int32 y = 0; y < MAX_LARGE_SECTORS; y++)
|
||||
{
|
||||
if (aWaterFineBlockList[x * 2][y * 2] >= 0)
|
||||
{
|
||||
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2][y * 2];
|
||||
}
|
||||
else if (aWaterFineBlockList[x * 2 + 1][y * 2] >= 0)
|
||||
{
|
||||
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2 + 1][y * 2];
|
||||
}
|
||||
else if (aWaterFineBlockList[x * 2][y * 2 + 1] >= 0)
|
||||
{
|
||||
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2][y * 2 + 1];
|
||||
}
|
||||
else if (aWaterFineBlockList[x * 2 + 1][y * 2 + 1] >= 0)
|
||||
{
|
||||
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2 + 1][y * 2 + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
aWaterBlockList[x][y] = NO_WATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hFile = CFileMgr::OpenFileForWriting("data\\waterpro.dat");
|
||||
|
||||
if (hFile > 0)
|
||||
{
|
||||
CFileMgr::Write(hFile, (char *)&ms_nNoOfWaterLevels, sizeof(ms_nNoOfWaterLevels));
|
||||
CFileMgr::Write(hFile, (char *)ms_aWaterZs, sizeof(ms_aWaterZs));
|
||||
CFileMgr::Write(hFile, (char *)ms_aWaterRects, sizeof(ms_aWaterRects));
|
||||
CFileMgr::Write(hFile, (char *)aWaterBlockList, sizeof(aWaterBlockList));
|
||||
CFileMgr::Write(hFile, (char *)aWaterFineBlockList, sizeof(aWaterFineBlockList));
|
||||
|
||||
CFileMgr::CloseFile(hFile);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
CTxdStore::PushCurrentTxd();
|
||||
|
||||
int32 slot = CTxdStore::FindTxdSlot("particle");
|
||||
CTxdStore::SetCurrentTxd(slot);
|
||||
|
||||
if ( gpWaterTex == NULL )
|
||||
gpWaterTex = RwTextureRead("water_old", NULL);
|
||||
if ( gpWaterTex == nil )
|
||||
gpWaterTex = RwTextureRead("water_old", nil);
|
||||
gpWaterRaster = RwTextureGetRaster(gpWaterTex);
|
||||
|
||||
CTxdStore::PopCurrentTxd();
|
||||
|
@ -104,10 +243,10 @@ CWaterLevel::Shutdown()
|
|||
FreeBoatWakeArray();
|
||||
DestroyWavyAtomic();
|
||||
|
||||
if ( gpWaterTex != NULL )
|
||||
if ( gpWaterTex != nil )
|
||||
{
|
||||
RwTextureDestroy(gpWaterTex);
|
||||
gpWaterTex = NULL;
|
||||
gpWaterTex = nil;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,15 +268,15 @@ CWaterLevel::CreateWavyAtomic()
|
|||
|rpGEOMETRYPRELIT
|
||||
|rpGEOMETRYMODULATEMATERIALCOLOR);
|
||||
|
||||
ASSERT(wavyGeometry != NULL);
|
||||
ASSERT(wavyGeometry != nil);
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
wavyMaterial = RpMaterialCreate();
|
||||
|
||||
ASSERT(wavyMaterial != NULL);
|
||||
ASSERT(gpWaterTex != NULL);
|
||||
ASSERT(wavyMaterial != nil);
|
||||
ASSERT(gpWaterTex != nil);
|
||||
|
||||
RpMaterialSetTexture(wavyMaterial, gpWaterTex);
|
||||
}
|
||||
|
@ -145,7 +284,7 @@ CWaterLevel::CreateWavyAtomic()
|
|||
{
|
||||
wavyTriangles = RpGeometryGetTriangles(wavyGeometry);
|
||||
|
||||
ASSERT(wavyTriangles != NULL);
|
||||
ASSERT(wavyTriangles != nil);
|
||||
/*
|
||||
[B] [C]
|
||||
***********
|
||||
|
@ -176,9 +315,9 @@ CWaterLevel::CreateWavyAtomic()
|
|||
|
||||
{
|
||||
wavyMorphTarget = RpGeometryGetMorphTarget(wavyGeometry, 0);
|
||||
ASSERT(wavyMorphTarget != NULL);
|
||||
ASSERT(wavyMorphTarget != nil);
|
||||
wavyVert = RpMorphTargetGetVertices(wavyMorphTarget);
|
||||
ASSERT(wavyVert != NULL);
|
||||
ASSERT(wavyVert != nil);
|
||||
|
||||
for ( int32 i = 0; i < 9; i++ )
|
||||
{
|
||||
|
@ -198,10 +337,10 @@ CWaterLevel::CreateWavyAtomic()
|
|||
|
||||
{
|
||||
wavyFrame = RwFrameCreate();
|
||||
ASSERT( wavyFrame != NULL );
|
||||
ASSERT( wavyFrame != nil );
|
||||
|
||||
ms_pWavyAtomic = RpAtomicCreate();
|
||||
ASSERT( ms_pWavyAtomic != NULL );
|
||||
ASSERT( ms_pWavyAtomic != nil );
|
||||
|
||||
RpAtomicSetGeometry(ms_pWavyAtomic, wavyGeometry, 0);
|
||||
RpAtomicSetFrame(ms_pWavyAtomic, wavyFrame);
|
||||
|
@ -222,6 +361,170 @@ CWaterLevel::DestroyWavyAtomic()
|
|||
RwFrameDestroy(frame);
|
||||
}
|
||||
|
||||
#ifndef MASTER
|
||||
void
|
||||
CWaterLevel::AddWaterLevel(float fXLeft, float fYBottom, float fXRight, float fYTop, float fLevel)
|
||||
{
|
||||
ms_aWaterRects[ms_nNoOfWaterLevels] = CRect(fXLeft, fYBottom, fXRight, fYTop);
|
||||
ms_aWaterZs[ms_nNoOfWaterLevels] = fLevel;
|
||||
ms_nNoOfWaterLevels++;
|
||||
}
|
||||
|
||||
bool
|
||||
CWaterLevel::WaterLevelAccordingToRectangles(float fX, float fY, float *pfOutLevel)
|
||||
{
|
||||
if (ms_nNoOfWaterLevels <= 0) return false;
|
||||
|
||||
for (int32 i = 0; i < ms_nNoOfWaterLevels; i++)
|
||||
{
|
||||
if (fX >= ms_aWaterRects[i].left && fX <= ms_aWaterRects[i].right
|
||||
&& fY >= ms_aWaterRects[i].top && fY <= ms_aWaterRects[i].bottom)
|
||||
{
|
||||
if (pfOutLevel) *pfOutLevel = ms_aWaterZs[i];
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
CWaterLevel::TestVisibilityForFineWaterBlocks(const CVector &worldPos)
|
||||
{
|
||||
static CVector2D tab[] =
|
||||
{
|
||||
{ 50.0f, 50.0f },
|
||||
{ -50.0f, 50.0f },
|
||||
{ -50.0f, -50.0f },
|
||||
{ 50.0f, -50.0f },
|
||||
{ 50.0f, 0.0f },
|
||||
{ -50.0f, 0.0f },
|
||||
{ 0.0f, -50.0f },
|
||||
{ 0.0f, 50.0f },
|
||||
};
|
||||
|
||||
CEntity *entity;
|
||||
CColPoint col;
|
||||
CVector lineStart, lineEnd;
|
||||
|
||||
lineStart = worldPos;
|
||||
|
||||
if (!CWorld::ProcessVerticalLine(lineStart, lineStart.z + 100.0f, col, entity, true, false, false, false, true, false, nil))
|
||||
{
|
||||
lineStart.x += 0.4f;
|
||||
lineStart.y += 0.4f;
|
||||
|
||||
if (!CWorld::ProcessVerticalLine(lineStart, lineStart.z + 100.0f, col, entity, true, false, false, false, true, false, nil))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (int32 i = 0; i < ARRAY_SIZE(tab); i++)
|
||||
{
|
||||
lineStart = worldPos;
|
||||
lineEnd = worldPos;
|
||||
|
||||
lineEnd.x += tab[i].x;
|
||||
lineEnd.y += tab[i].y;
|
||||
lineEnd.z += 100.0f;
|
||||
|
||||
if ((lineEnd.x > WORLD_MIN_X && lineEnd.x < WORLD_MAX_X) && (lineEnd.y > WORLD_MIN_Y && lineEnd.y < WORLD_MAX_Y))
|
||||
{
|
||||
if (!CWorld::ProcessLineOfSight(lineStart, lineEnd, col, entity, true, false, false, false, true, false, nil))
|
||||
{
|
||||
lineStart.x += 0.4f;
|
||||
lineStart.y += 0.4f;
|
||||
lineEnd.x += 0.4f;
|
||||
lineEnd.y += 0.4f;
|
||||
|
||||
if (!CWorld::ProcessLineOfSight(lineStart, lineEnd, col, entity, true, false, false, false, true, false, nil))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
CWaterLevel::RemoveIsolatedWater()
|
||||
{
|
||||
bool (*isConnected)[MAX_SMALL_SECTORS] = new bool[MAX_SMALL_SECTORS][MAX_SMALL_SECTORS];
|
||||
|
||||
for (int32 x = 0; x < MAX_SMALL_SECTORS; x++)
|
||||
{
|
||||
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
||||
{
|
||||
isConnected[x][y] = false;
|
||||
}
|
||||
}
|
||||
|
||||
isConnected[0][0] = true;
|
||||
bool keepGoing;
|
||||
|
||||
do
|
||||
{
|
||||
keepGoing = false;
|
||||
|
||||
for (int32 x = 0; x < MAX_SMALL_SECTORS; x++)
|
||||
{
|
||||
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
||||
{
|
||||
if (aWaterFineBlockList[x][y] < 0 || isConnected[x][y])
|
||||
continue;
|
||||
|
||||
if (x > 0 && isConnected[x - 1][y])
|
||||
{
|
||||
isConnected[x][y] = true;
|
||||
keepGoing = true;
|
||||
}
|
||||
|
||||
if (y > 0 && isConnected[x][y - 1])
|
||||
{
|
||||
isConnected[x][y] = true;
|
||||
keepGoing = true;
|
||||
}
|
||||
|
||||
if (x + 1 < MAX_SMALL_SECTORS && isConnected[x + 1][y])
|
||||
{
|
||||
isConnected[x][y] = true;
|
||||
keepGoing = true;
|
||||
}
|
||||
|
||||
if (y + 1 < MAX_SMALL_SECTORS && isConnected[x][y + 1])
|
||||
{
|
||||
isConnected[x][y] = true;
|
||||
keepGoing = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (keepGoing);
|
||||
|
||||
int32 numRemoved = 0;
|
||||
|
||||
for (int32 x = 0; x < MAX_SMALL_SECTORS; x++)
|
||||
{
|
||||
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
||||
{
|
||||
if (aWaterFineBlockList[x][y] >= 0 && !isConnected[x][y] && ms_aWaterZs[aWaterFineBlockList[x][y]] == 0.0f)
|
||||
{
|
||||
numRemoved++;
|
||||
aWaterFineBlockList[x][y] = NO_WATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Removed %d isolated patches of water\n", numRemoved);
|
||||
|
||||
delete[] isConnected;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
CWaterLevel::GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool bDontCheckZ)
|
||||
{
|
||||
|
@ -231,12 +534,12 @@ CWaterLevel::GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool
|
|||
ASSERT( x >= 0 && x < HUGE_SECTOR_SIZE );
|
||||
ASSERT( y >= 0 && y < HUGE_SECTOR_SIZE );
|
||||
|
||||
uint8 nBlock = aWaterFineBlockList[x][y];
|
||||
int8 nBlock = aWaterFineBlockList[x][y];
|
||||
|
||||
if ( nBlock == 128 )
|
||||
if ( nBlock == NO_WATER )
|
||||
return false;
|
||||
|
||||
ASSERT( pfOutLevel != NULL );
|
||||
ASSERT( pfOutLevel != nil );
|
||||
*pfOutLevel = ms_aWaterZs[nBlock];
|
||||
|
||||
float fAngle = (CTimer::GetTimeInMilliseconds() & 4095) * (TWOPI / 4096.0f);
|
||||
|
@ -270,12 +573,12 @@ CWaterLevel::GetWaterLevelNoWaves(float fX, float fY, float fZ, float *pfOutLeve
|
|||
ASSERT( x >= 0 && x < HUGE_SECTOR_SIZE );
|
||||
ASSERT( y >= 0 && y < HUGE_SECTOR_SIZE );
|
||||
|
||||
uint8 nBlock = aWaterFineBlockList[x][y];
|
||||
int8 nBlock = aWaterFineBlockList[x][y];
|
||||
|
||||
if ( nBlock == 128 )
|
||||
if ( nBlock == NO_WATER )
|
||||
return false;
|
||||
|
||||
ASSERT( pfOutLevel != NULL );
|
||||
ASSERT( pfOutLevel != nil );
|
||||
*pfOutLevel = ms_aWaterZs[nBlock];
|
||||
|
||||
return true;
|
||||
|
@ -418,10 +721,10 @@ CWaterLevel::RenderWater()
|
|||
{
|
||||
for ( int32 y = nStartY; y <= nEndY; y++ )
|
||||
{
|
||||
if ( !(aWaterBlockList[2*x+0][2*y+0] & 128)
|
||||
|| !(aWaterBlockList[2*x+1][2*y+0] & 128)
|
||||
|| !(aWaterBlockList[2*x+0][2*y+1] & 128)
|
||||
|| !(aWaterBlockList[2*x+1][2*y+1] & 128) )
|
||||
if ( aWaterBlockList[2*x+0][2*y+0] >= 0
|
||||
|| aWaterBlockList[2*x+1][2*y+0] >= 0
|
||||
|| aWaterBlockList[2*x+0][2*y+1] >= 0
|
||||
|| aWaterBlockList[2*x+1][2*y+1] >= 0 )
|
||||
{
|
||||
float fX = WATER_FROM_HUGE_SECTOR_X(x);
|
||||
float fY = WATER_FROM_HUGE_SECTOR_Y(y);
|
||||
|
@ -443,16 +746,16 @@ CWaterLevel::RenderWater()
|
|||
{
|
||||
float fZ;
|
||||
|
||||
if ( !(aWaterBlockList[2*x+0][2*y+0] & 128) )
|
||||
if ( aWaterBlockList[2*x+0][2*y+0] >= 0 )
|
||||
fZ = ms_aWaterZs[ aWaterBlockList[2*x+0][2*y+0] ];
|
||||
|
||||
if ( !(aWaterBlockList[2*x+1][2*y+0] & 128) )
|
||||
if ( aWaterBlockList[2*x+1][2*y+0] >= 0 )
|
||||
fZ = ms_aWaterZs[ aWaterBlockList[2*x+1][2*y+0] ];
|
||||
|
||||
if ( !(aWaterBlockList[2*x+0][2*y+1] & 128) )
|
||||
if ( aWaterBlockList[2*x+0][2*y+1] >= 0 )
|
||||
fZ = ms_aWaterZs[ aWaterBlockList[2*x+0][2*y+1] ];
|
||||
|
||||
if ( !(aWaterBlockList[2*x+1][2*y+1] & 128) )
|
||||
if ( aWaterBlockList[2*x+1][2*y+1] >= 0 )
|
||||
fZ = ms_aWaterZs[ aWaterBlockList[2*x+1][2*y+1] ];
|
||||
|
||||
RenderOneFlatHugeWaterPoly(fX, fY, fZ, color);
|
||||
|
@ -463,7 +766,7 @@ CWaterLevel::RenderWater()
|
|||
{
|
||||
for ( int32 y2 = 2*y; y2 <= 2*y+1; y2++ )
|
||||
{
|
||||
if ( !(aWaterBlockList[x2][y2] & 128) )
|
||||
if ( aWaterBlockList[x2][y2] >= 0 )
|
||||
{
|
||||
float fLargeX = WATER_FROM_LARGE_SECTOR_X(x2);
|
||||
float fLargeY = WATER_FROM_LARGE_SECTOR_Y(y2);
|
||||
|
@ -498,7 +801,7 @@ CWaterLevel::RenderWater()
|
|||
float fZ;
|
||||
|
||||
// WS
|
||||
if ( !(aWaterFineBlockList[2*x2+0][2*y2+0] & 128) )
|
||||
if ( aWaterFineBlockList[2*x2+0][2*y2+0] >= 0 )
|
||||
{
|
||||
float fSmallX = fLargeX;
|
||||
float fSmallY = fLargeY;
|
||||
|
@ -519,7 +822,7 @@ CWaterLevel::RenderWater()
|
|||
}
|
||||
|
||||
// SE
|
||||
if ( !(aWaterFineBlockList[2*x2+1][2*y2+0] & 128) )
|
||||
if ( aWaterFineBlockList[2*x2+1][2*y2+0] >= 0 )
|
||||
{
|
||||
float fSmallX = fLargeX + (LARGE_SECTOR_SIZE/2);
|
||||
float fSmallY = fLargeY;
|
||||
|
@ -540,7 +843,7 @@ CWaterLevel::RenderWater()
|
|||
}
|
||||
|
||||
// WN
|
||||
if ( !(aWaterFineBlockList[2*x2+0][2*y2+1] & 128) )
|
||||
if ( aWaterFineBlockList[2*x2+0][2*y2+1] >= 0 )
|
||||
{
|
||||
float fSmallX = fLargeX;
|
||||
float fSmallY = fLargeY + (LARGE_SECTOR_SIZE/2);
|
||||
|
@ -561,7 +864,7 @@ CWaterLevel::RenderWater()
|
|||
}
|
||||
|
||||
//NE
|
||||
if ( !(aWaterFineBlockList[2*x2+1][2*y2+1] & 128) )
|
||||
if ( aWaterFineBlockList[2*x2+1][2*y2+1] >= 0 )
|
||||
{
|
||||
float fSmallX = fLargeX + (LARGE_SECTOR_SIZE/2);
|
||||
float fSmallY = fLargeY + (LARGE_SECTOR_SIZE/2);
|
||||
|
@ -591,7 +894,7 @@ CWaterLevel::RenderWater()
|
|||
}
|
||||
} // if ( TheCamera.IsSphereVisible
|
||||
} // if ( fLargeSectorDistToCamSqr < fHugeSectorMaxRenderDistSqr )
|
||||
} // if ( !(aWaterBlockList[x2][y2] & 128) )
|
||||
} // if ( aWaterBlockList[x2][y2] >= 0 )
|
||||
} // for ( int32 y2 = 2*y; y2 <= 2*y+1; y2++ )
|
||||
} // for ( int32 x2 = 2*x; x2 <= 2*x+1; x2++ )
|
||||
//
|
||||
|
@ -948,19 +1251,19 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
|
|||
|
||||
CBoat::FillBoatList();
|
||||
|
||||
ASSERT( ms_pWavyAtomic != NULL );
|
||||
ASSERT( ms_pWavyAtomic != nil );
|
||||
|
||||
RpGeometry *geometry = RpAtomicGetGeometry(ms_pWavyAtomic);
|
||||
|
||||
ASSERT( geometry != NULL );
|
||||
ASSERT( geometry != nil );
|
||||
|
||||
RwRGBA *wavyPreLights = RpGeometryGetPreLightColors(geometry);
|
||||
RwTexCoords *wavyTexCoords = RpGeometryGetVertexTexCoords(geometry, rwTEXTURECOORDINATEINDEX0);
|
||||
RwV3d *wavyVertices = RpMorphTargetGetVertices(RpGeometryGetMorphTarget(geometry, 0));
|
||||
|
||||
ASSERT( wavyPreLights != NULL );
|
||||
ASSERT( wavyTexCoords != NULL );
|
||||
ASSERT( wavyVertices != NULL );
|
||||
ASSERT( wavyPreLights != nil );
|
||||
ASSERT( wavyTexCoords != nil );
|
||||
ASSERT( wavyVertices != nil );
|
||||
|
||||
RpGeometryLock(geometry, rpGEOMETRYLOCKVERTICES
|
||||
| rpGEOMETRYLOCKPRELIGHT
|
||||
|
@ -983,7 +1286,7 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
|
|||
RpGeometryUnlock(geometry);
|
||||
}
|
||||
|
||||
static CBoat *apBoatList[4] = { NULL };
|
||||
static CBoat *apBoatList[4] = { nil };
|
||||
|
||||
if ( apGeomArray[0]
|
||||
&& nGeomUsed < MAX_BOAT_WAKES
|
||||
|
@ -997,16 +1300,16 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
|
|||
RpGeometry *wavyGeometry = RpAtomicGetGeometry(ms_pWavyAtomic);
|
||||
RpGeometry *geom = apGeomArray[nGeomUsed++];
|
||||
|
||||
ASSERT( wavyGeometry != NULL );
|
||||
ASSERT( geom != NULL );
|
||||
ASSERT( wavyGeometry != nil );
|
||||
ASSERT( geom != nil );
|
||||
|
||||
RpAtomic *atomic = RpAtomicCreate();
|
||||
ASSERT( atomic != NULL );
|
||||
ASSERT( atomic != nil );
|
||||
|
||||
RpAtomicSetGeometry(atomic, geom, 0);
|
||||
|
||||
RwFrame *frame = RwFrameCreate();
|
||||
ASSERT( frame != NULL );
|
||||
ASSERT( frame != nil );
|
||||
|
||||
RwMatrixCopy(RwFrameGetMatrix(frame), RwFrameGetMatrix(RpAtomicGetFrame(ms_pWavyAtomic)));
|
||||
RpAtomicSetFrame(atomic, frame);
|
||||
|
@ -1017,11 +1320,11 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
|
|||
RwV3d *geomVertices = RpMorphTargetGetVertices(RpGeometryGetMorphTarget(geom, 0));
|
||||
RwV3d *wavyVertices = RpMorphTargetGetVertices(RpGeometryGetMorphTarget(wavyGeometry, 0));
|
||||
|
||||
ASSERT( geomTexCoords != NULL );
|
||||
ASSERT( wavyTexCoord != NULL );
|
||||
ASSERT( geomPreLights != NULL );
|
||||
ASSERT( geomVertices != NULL );
|
||||
ASSERT( wavyVertices != NULL );
|
||||
ASSERT( geomTexCoords != nil );
|
||||
ASSERT( wavyTexCoord != nil );
|
||||
ASSERT( geomPreLights != nil );
|
||||
ASSERT( geomVertices != nil );
|
||||
ASSERT( wavyVertices != nil );
|
||||
|
||||
RpGeometryLock(geom, rpGEOMETRYLOCKVERTICES | rpGEOMETRYLOCKPRELIGHT | rpGEOMETRYLOCKTEXCOORDS);
|
||||
|
||||
|
@ -1038,7 +1341,7 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
|
|||
|
||||
for ( int32 k = 0; k < 4; k++ )
|
||||
{
|
||||
if ( apBoatList[k] != NULL )
|
||||
if ( apBoatList[k] != nil )
|
||||
fDistMult += CBoat::IsVertexAffectedByWake(CVector(fVertexX, fVertexY, 0.0f), apBoatList[k]);
|
||||
}
|
||||
|
||||
|
@ -1087,7 +1390,7 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
|
|||
pos.y = fY;
|
||||
pos.z = fZ;
|
||||
|
||||
ASSERT( ms_pWavyAtomic != NULL );
|
||||
ASSERT( ms_pWavyAtomic != nil );
|
||||
|
||||
RwFrameTranslate(RpAtomicGetFrame(ms_pWavyAtomic), &pos, rwCOMBINEREPLACE);
|
||||
|
||||
|
@ -1116,7 +1419,7 @@ CWaterLevel::CalcDistanceToWater(float fX, float fY)
|
|||
{
|
||||
for ( int32 y = nStartY; y <= nEndY; y++ )
|
||||
{
|
||||
if ( !(aWaterFineBlockList[x][y] & 128) )
|
||||
if ( aWaterFineBlockList[x][y] >= 0 )
|
||||
{
|
||||
float fSectorX = WATER_FROM_SMALL_SECTOR_X(x);
|
||||
float fSectorY = WATER_FROM_SMALL_SECTOR_Y(y);
|
||||
|
@ -1142,7 +1445,7 @@ CWaterLevel::RenderAndEmptyRenderBuffer()
|
|||
{
|
||||
LittleTest();
|
||||
|
||||
if ( RwIm3DTransform(TempBufferRenderVertices, TempBufferVerticesStored, NULL, rwIM3D_VERTEXUV) )
|
||||
if ( RwIm3DTransform(TempBufferRenderVertices, TempBufferVerticesStored, nil, rwIM3D_VERTEXUV) )
|
||||
{
|
||||
RwIm3DRenderIndexedPrimitive(rwPRIMTYPETRILIST, TempBufferRenderIndexList, TempBufferIndicesStored);
|
||||
RwIm3DEnd();
|
||||
|
@ -1160,29 +1463,29 @@ CWaterLevel::AllocateBoatWakeArray()
|
|||
|
||||
PUSH_MEMID(MEMID_STREAM);
|
||||
|
||||
ASSERT(ms_pWavyAtomic != NULL );
|
||||
ASSERT(ms_pWavyAtomic != nil );
|
||||
|
||||
RpGeometry *wavyGeometry = RpAtomicGetGeometry(ms_pWavyAtomic);
|
||||
ASSERT(wavyGeometry != NULL );
|
||||
ASSERT(wavyGeometry != nil );
|
||||
RpMorphTarget *wavyMorphTarget = RpGeometryGetMorphTarget(wavyGeometry, 0);
|
||||
RpMaterial *wavyMaterial = RpGeometryGetMaterial(wavyGeometry, 0);
|
||||
|
||||
ASSERT(wavyMorphTarget != NULL );
|
||||
ASSERT(wavyMaterial != NULL );
|
||||
ASSERT(wavyMorphTarget != nil );
|
||||
ASSERT(wavyMaterial != nil );
|
||||
|
||||
for ( int32 geom = 0; geom < MAX_BOAT_WAKES; geom++ )
|
||||
{
|
||||
if ( apGeomArray[geom] == NULL )
|
||||
if ( apGeomArray[geom] == nil )
|
||||
{
|
||||
apGeomArray[geom] = RpGeometryCreate(9*9, 8*8*2, rpGEOMETRYTRISTRIP
|
||||
| rpGEOMETRYPRELIT
|
||||
| rpGEOMETRYMODULATEMATERIALCOLOR
|
||||
| rpGEOMETRYTEXTURED);
|
||||
ASSERT(apGeomArray[geom] != NULL);
|
||||
ASSERT(apGeomArray[geom] != nil);
|
||||
|
||||
RpTriangle *geomTriangles = RpGeometryGetTriangles(apGeomArray[geom]);
|
||||
|
||||
ASSERT( geomTriangles != NULL );
|
||||
ASSERT( geomTriangles != nil );
|
||||
|
||||
for ( int32 i = 0; i < 8; i++ )
|
||||
{
|
||||
|
@ -1216,8 +1519,8 @@ CWaterLevel::AllocateBoatWakeArray()
|
|||
RpMorphTarget *geomMorphTarget = RpGeometryGetMorphTarget(apGeomArray[geom], 0);
|
||||
RwV3d *geomVertices = RpMorphTargetGetVertices(geomMorphTarget);
|
||||
|
||||
ASSERT( geomMorphTarget != NULL );
|
||||
ASSERT( geomVertices != NULL );
|
||||
ASSERT( geomMorphTarget != nil );
|
||||
ASSERT( geomVertices != nil );
|
||||
|
||||
for ( int32 i = 0; i < 9; i++ )
|
||||
{
|
||||
|
@ -1242,10 +1545,10 @@ CWaterLevel::FreeBoatWakeArray()
|
|||
{
|
||||
for ( int32 i = 0; i < MAX_BOAT_WAKES; i++ )
|
||||
{
|
||||
if ( apGeomArray[i] != NULL )
|
||||
if ( apGeomArray[i] != nil )
|
||||
{
|
||||
RpGeometryDestroy(apGeomArray[i]);
|
||||
apGeomArray[i] = NULL;
|
||||
apGeomArray[i] = nil;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#define WATER_BLOCK_SIZE LARGE_SECTOR_SIZE
|
||||
#define WATER_FINEBLOCK_SIZE HUGE_SECTOR_SIZE
|
||||
#define WATER_Z_OFFSET (1.5f)
|
||||
|
||||
#define NO_WATER -128
|
||||
|
||||
#define MAX_SMALL_SECTORS 128
|
||||
#define MAX_LARGE_SECTORS 64
|
||||
#define MAX_HUGE_SECTORS 32
|
||||
|
@ -23,7 +23,6 @@
|
|||
#define WATER_WIDTH ((WATER_END_X - WATER_START_X))
|
||||
#define WATER_HEIGHT ((WATER_END_Y - WATER_START_Y))
|
||||
|
||||
|
||||
#define WATER_UNSIGN_X(x) ( (x) + (WATER_WIDTH /2) )
|
||||
#define WATER_UNSIGN_Y(y) ( (y) + (WATER_HEIGHT/2) )
|
||||
#define WATER_SIGN_X(x) ( (x) - (WATER_WIDTH /2) )
|
||||
|
@ -72,8 +71,8 @@ class CWaterLevel
|
|||
static int32 ms_nNoOfWaterLevels;
|
||||
static float ms_aWaterZs[48];
|
||||
static CRect ms_aWaterRects[48];
|
||||
static uint8 aWaterBlockList[WATER_BLOCK_SIZE][WATER_BLOCK_SIZE];
|
||||
static uint8 aWaterFineBlockList[WATER_FINEBLOCK_SIZE][WATER_FINEBLOCK_SIZE];
|
||||
static int8 aWaterBlockList[MAX_LARGE_SECTORS][MAX_LARGE_SECTORS];
|
||||
static int8 aWaterFineBlockList[MAX_SMALL_SECTORS][MAX_SMALL_SECTORS];
|
||||
static bool WavesCalculatedThisFrame;
|
||||
static RpAtomic *ms_pWavyAtomic;
|
||||
static RpGeometry *apGeomArray[MAX_BOAT_WAKES];
|
||||
|
@ -84,6 +83,10 @@ public:
|
|||
static void Shutdown();
|
||||
static void CreateWavyAtomic();
|
||||
static void DestroyWavyAtomic();
|
||||
static void AddWaterLevel(float fXLeft, float fYBottom, float fXRight, float fYTop, float fLevel);
|
||||
static bool WaterLevelAccordingToRectangles(float fX, float fY, float *pfOutLevel = nil);
|
||||
static bool TestVisibilityForFineWaterBlocks(const CVector &worldPos);
|
||||
static void RemoveIsolatedWater();
|
||||
static bool GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool bDontCheckZ);
|
||||
static bool GetWaterLevel(CVector coors, float *pfOutLevel, bool bDontCheckZ) { return GetWaterLevel(coors.x, coors.y, coors.z, pfOutLevel, bDontCheckZ); }
|
||||
static bool GetWaterLevelNoWaves(float fX, float fY, float fZ, float *pfOutLevel);
|
||||
|
|
|
@ -359,7 +359,7 @@ void CWeather::AddRain()
|
|||
RwCameraGetFarClipPlane(TheCamera.m_pRwCamera) / (RwCameraGetFarClipPlane(TheCamera.m_pRwCamera) * *(CVector2D*)RwCameraGetViewWindow(TheCamera.m_pRwCamera)).Magnitude();
|
||||
splash_points[3] = 4.0f * CVector(RwCameraGetViewWindow(TheCamera.m_pRwCamera)->x, RwCameraGetViewWindow(TheCamera.m_pRwCamera)->y, 1.0f) *
|
||||
RwCameraGetFarClipPlane(TheCamera.m_pRwCamera) / (RwCameraGetFarClipPlane(TheCamera.m_pRwCamera) * *(CVector2D*)RwCameraGetViewWindow(TheCamera.m_pRwCamera)).Magnitude();
|
||||
RwV3dTransformPoints((RwV3d*)splash_points, (RwV3d*)splash_points, 4, RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera)));
|
||||
RwV3dTransformPoints(splash_points, splash_points, 4, RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera)));
|
||||
CVector fp = (splash_points[0] + splash_points[1] + splash_points[2] + splash_points[3]) / 4;
|
||||
for (int i = 0; i < num_splash_attempts; i++) {
|
||||
CColPoint point;
|
||||
|
|
|
@ -203,6 +203,10 @@ CVisibilityPlugins::InsertAtomicIntoSortedList(RpAtomic *a, float dist)
|
|||
return ret;
|
||||
}
|
||||
|
||||
// can't increase this yet unfortunately...
|
||||
// probably have to fix fading for this so material alpha isn't overwritten
|
||||
#define VEHICLE_LODDIST_MULTIPLIER (TheCamera.GenerationDistMultiplier)
|
||||
|
||||
void
|
||||
CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
|
||||
{
|
||||
|
@ -215,11 +219,11 @@ CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
|
|||
else
|
||||
ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f);
|
||||
|
||||
ms_vehicleLod0Dist = sq(70.0f * TheCamera.GenerationDistMultiplier);
|
||||
ms_vehicleLod1Dist = sq(90.0f * TheCamera.GenerationDistMultiplier);
|
||||
ms_vehicleFadeDist = sq(100.0f * TheCamera.GenerationDistMultiplier);
|
||||
ms_bigVehicleLod0Dist = sq(60.0f * TheCamera.GenerationDistMultiplier);
|
||||
ms_bigVehicleLod1Dist = sq(150.0f * TheCamera.GenerationDistMultiplier);
|
||||
ms_vehicleLod0Dist = sq(70.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||
ms_vehicleLod1Dist = sq(90.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||
ms_vehicleFadeDist = sq(100.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||
ms_bigVehicleLod0Dist = sq(60.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||
ms_bigVehicleLod1Dist = sq(150.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||
ms_pedLod0Dist = sq(25.0f * TheCamera.LODDistMultiplier);
|
||||
ms_pedLod1Dist = sq(60.0f * TheCamera.LODDistMultiplier);
|
||||
ms_pedFadeDist = sq(70.0f * TheCamera.LODDistMultiplier);
|
||||
|
@ -311,7 +315,12 @@ CVisibilityPlugins::RenderWheelAtomicCB(RpAtomic *atomic)
|
|||
m = RwFrameGetLTM(RpAtomicGetFrame(atomic));
|
||||
RwV3dSub(&view, RwMatrixGetPos(m), ms_pCameraPosn);
|
||||
len = RwV3dLength(&view);
|
||||
#ifdef FIX_BUGS
|
||||
// from VC
|
||||
lodatm = mi->GetAtomicFromDistance(len * TheCamera.LODDistMultiplier / VEHICLE_LODDIST_MULTIPLIER);
|
||||
#else
|
||||
lodatm = mi->GetAtomicFromDistance(len);
|
||||
#endif
|
||||
if(lodatm){
|
||||
if(RpAtomicGetGeometry(lodatm) != RpAtomicGetGeometry(atomic))
|
||||
RpAtomicSetGeometry(atomic, RpAtomicGetGeometry(lodatm), rpATOMICSAMEBOUNDINGSPHERE);
|
||||
|
|
|
@ -83,9 +83,6 @@ enum eGameState
|
|||
GS_FRONTEND,
|
||||
GS_INIT_PLAYING_GAME,
|
||||
GS_PLAYING_GAME,
|
||||
#ifndef MASTER
|
||||
GS_ANIMVIEWER,
|
||||
#endif
|
||||
};
|
||||
extern RwUInt32 gGameState;
|
||||
|
||||
|
|
|
@ -70,9 +70,6 @@ static psGlobalType PsGlobal;
|
|||
|
||||
#define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var)
|
||||
|
||||
#undef MAKEPOINTS
|
||||
#define MAKEPOINTS(l) (*((POINTS /*FAR*/ *)&(l)))
|
||||
|
||||
size_t _dwMemAvailPhys;
|
||||
RwUInt32 gGameState;
|
||||
|
||||
|
@ -870,6 +867,36 @@ void _InputInitialiseJoys()
|
|||
PSGLOBAL(joy1id) = -1;
|
||||
PSGLOBAL(joy2id) = -1;
|
||||
|
||||
// Load our gamepad mappings.
|
||||
#define SDL_GAMEPAD_DB_PATH "gamecontrollerdb.txt"
|
||||
FILE *f = fopen(SDL_GAMEPAD_DB_PATH, "rb");
|
||||
if (f) {
|
||||
fseek(f, 0, SEEK_END);
|
||||
size_t fsize = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
char *db = (char*)malloc(fsize + 1);
|
||||
if (fread(db, 1, fsize, f) == fsize) {
|
||||
db[fsize] = '\0';
|
||||
|
||||
if (glfwUpdateGamepadMappings(db) == GLFW_FALSE)
|
||||
Error("glfwUpdateGamepadMappings didn't succeed, check " SDL_GAMEPAD_DB_PATH ".\n");
|
||||
} else
|
||||
Error("fread on " SDL_GAMEPAD_DB_PATH " wasn't successful.\n");
|
||||
|
||||
free(db);
|
||||
fclose(f);
|
||||
} else
|
||||
printf("You don't seem to have copied " SDL_GAMEPAD_DB_PATH " file from re3/gamefiles to GTA3 directory. Some gamepads may not be recognized.\n");
|
||||
|
||||
#undef SDL_GAMEPAD_DB_PATH
|
||||
|
||||
// But always overwrite it with the one in SDL_GAMECONTROLLERCONFIG.
|
||||
char const* EnvControlConfig = getenv("SDL_GAMECONTROLLERCONFIG");
|
||||
if (EnvControlConfig != nil) {
|
||||
glfwUpdateGamepadMappings(EnvControlConfig);
|
||||
}
|
||||
|
||||
for (int i = 0; i <= GLFW_JOYSTICK_LAST; i++) {
|
||||
if (glfwJoystickPresent(i) && !IsThisJoystickBlacklisted(i)) {
|
||||
if (PSGLOBAL(joy1id) == -1)
|
||||
|
@ -1175,15 +1202,15 @@ void InitialiseLanguage()
|
|||
}
|
||||
}
|
||||
|
||||
TheText.Unload();
|
||||
TheText.Load();
|
||||
|
||||
#ifndef _WIN32
|
||||
// TODO this is needed for strcasecmp to work correctly across all languages, but can these cause other problems??
|
||||
setlocale(LC_CTYPE, "C");
|
||||
setlocale(LC_COLLATE, "C");
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
#endif
|
||||
|
||||
TheText.Unload();
|
||||
TheText.Load();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1230,17 +1257,11 @@ void resizeCB(GLFWwindow* window, int width, int height) {
|
|||
* memory things don't work.
|
||||
*/
|
||||
/* redraw window */
|
||||
#ifndef MASTER
|
||||
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
|
||||
{
|
||||
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
|
||||
}
|
||||
#else
|
||||
|
||||
if (RwInitialised && gGameState == GS_PLAYING_GAME)
|
||||
{
|
||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (RwInitialised && height > 0 && width > 0) {
|
||||
RwRect r;
|
||||
|
@ -1619,18 +1640,6 @@ main(int argc, char *argv[])
|
|||
FrontEndMenuManager.DrawMemoryCardStartUpMenus();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TurnOnAnimViewer)
|
||||
{
|
||||
#ifndef MASTER
|
||||
CAnimViewer::Initialise();
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_bGameNotLoaded = false;
|
||||
#endif
|
||||
gGameState = GS_ANIMVIEWER;
|
||||
TurnOnAnimViewer = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
initkeymap();
|
||||
|
||||
|
@ -1650,6 +1659,18 @@ main(int argc, char *argv[])
|
|||
* Enter the message processing loop...
|
||||
*/
|
||||
|
||||
#ifndef MASTER
|
||||
if (gbModelViewer) {
|
||||
// This is TheModelViewer in LCS, but not compiled on III Mobile.
|
||||
LoadingScreen("Loading the ModelViewer", NULL, GetRandomSplashScreen());
|
||||
CAnimViewer::Initialise();
|
||||
CTimer::Update();
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_bGameNotLoaded = false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if (TheMemoryCard.m_bWantToLoad)
|
||||
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
|
||||
|
@ -1664,7 +1685,13 @@ main(int argc, char *argv[])
|
|||
#endif
|
||||
{
|
||||
glfwPollEvents();
|
||||
if( ForegroundApp )
|
||||
#ifndef MASTER
|
||||
if (gbModelViewer) {
|
||||
// This is TheModelViewerCore in LCS, but TheModelViewer on other state-machine III-VCs.
|
||||
TheModelViewer();
|
||||
} else
|
||||
#endif
|
||||
if ( ForegroundApp )
|
||||
{
|
||||
switch ( gGameState )
|
||||
{
|
||||
|
@ -1867,18 +1894,6 @@ main(int argc, char *argv[])
|
|||
}
|
||||
break;
|
||||
}
|
||||
#ifndef MASTER
|
||||
case GS_ANIMVIEWER:
|
||||
{
|
||||
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
||||
if (RwInitialised)
|
||||
{
|
||||
if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
||||
RsEventHandler(rsANIMVIEWER, (void*)TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1950,12 +1965,13 @@ main(int argc, char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
CTimer::Stop();
|
||||
|
||||
|
@ -1977,12 +1993,13 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
DMAudio.Terminate();
|
||||
|
||||
|
|
|
@ -10,14 +10,13 @@
|
|||
|
||||
#include "skeleton.h"
|
||||
#include "platform.h"
|
||||
#include "main.h"
|
||||
#include "MemoryHeap.h"
|
||||
|
||||
|
||||
|
||||
static RwBool DefaultVideoMode = TRUE;
|
||||
|
||||
bool TurnOnAnimViewer = false;
|
||||
|
||||
RsGlobalType RsGlobal;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -162,7 +161,7 @@ rsPreInitCommandLine(RwChar *arg)
|
|||
#ifndef MASTER
|
||||
if (!strcmp(arg, RWSTRING("-animviewer")))
|
||||
{
|
||||
TurnOnAnimViewer = TRUE;
|
||||
gbModelViewer = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -79,11 +79,8 @@ enum RsEvent
|
|||
rsPADANALOGUERIGHTRESET,
|
||||
rsPREINITCOMMANDLINE,
|
||||
rsACTIVATE,
|
||||
rsANIMVIEWER,
|
||||
};
|
||||
|
||||
extern bool TurnOnAnimViewer;
|
||||
|
||||
typedef enum RsEvent RsEvent;
|
||||
|
||||
typedef RsEventStatus (*RsInputEventHandler)(RsEvent event, void *param);
|
||||
|
|
|
@ -1017,17 +1017,12 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
RECT rect;
|
||||
|
||||
/* redraw window */
|
||||
#ifndef MASTER
|
||||
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
|
||||
{
|
||||
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
|
||||
}
|
||||
#else
|
||||
|
||||
if (RwInitialised && gGameState == GS_PLAYING_GAME)
|
||||
{
|
||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Manually resize window */
|
||||
rect.left = rect.top = 0;
|
||||
rect.bottom = newPos->bottom - newPos->top;
|
||||
|
@ -2183,17 +2178,17 @@ WinMain(HINSTANCE instance,
|
|||
}
|
||||
#endif
|
||||
|
||||
if (TurnOnAnimViewer)
|
||||
{
|
||||
#ifndef MASTER
|
||||
if (gbModelViewer) {
|
||||
// This is TheModelViewer in LCS, but not compiled on III Mobile.
|
||||
LoadingScreen("Loading the ModelViewer", NULL, GetRandomSplashScreen());
|
||||
CAnimViewer::Initialise();
|
||||
CTimer::Update();
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_bGameNotLoaded = false;
|
||||
#endif
|
||||
gGameState = GS_ANIMVIEWER;
|
||||
TurnOnAnimViewer = false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
while ( TRUE )
|
||||
{
|
||||
|
@ -2238,6 +2233,12 @@ WinMain(HINSTANCE instance,
|
|||
DispatchMessage(&message);
|
||||
}
|
||||
}
|
||||
#ifndef MASTER
|
||||
else if (gbModelViewer) {
|
||||
// This is TheModelViewerCore in LCS
|
||||
TheModelViewer();
|
||||
}
|
||||
#endif
|
||||
else if( ForegroundApp )
|
||||
{
|
||||
switch ( gGameState )
|
||||
|
@ -2451,18 +2452,6 @@ WinMain(HINSTANCE instance,
|
|||
}
|
||||
break;
|
||||
}
|
||||
#ifndef MASTER
|
||||
case GS_ANIMVIEWER:
|
||||
{
|
||||
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
||||
if (RwInitialised)
|
||||
{
|
||||
if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
||||
RsEventHandler(rsANIMVIEWER, (void*)TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2534,13 +2523,14 @@ WinMain(HINSTANCE instance,
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
|
||||
CTimer::Stop();
|
||||
|
||||
if ( FrontEndMenuManager.m_bFirstTime == true )
|
||||
|
@ -2561,12 +2551,13 @@ WinMain(HINSTANCE instance,
|
|||
}
|
||||
|
||||
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
DMAudio.Terminate();
|
||||
|
||||
|
|
|
@ -768,7 +768,7 @@ CAutomobile::ProcessControl(void)
|
|||
adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_FRONT_LEFT].surfaceB);
|
||||
WheelState[CARWHEEL_FRONT_LEFT] = m_aWheelState[CARWHEEL_FRONT_LEFT];
|
||||
|
||||
if(Damage.GetWheelStatus(VEHWHEEL_FRONT_LEFT) == WHEEL_STATUS_BURST)
|
||||
if(Damage.GetWheelStatus(CARWHEEL_FRONT_LEFT) == WHEEL_STATUS_BURST)
|
||||
ProcessWheel(wheelFwd, wheelRight,
|
||||
contactSpeeds[CARWHEEL_FRONT_LEFT], contactPoints[CARWHEEL_FRONT_LEFT],
|
||||
m_nWheelsOnGround, fThrust,
|
||||
|
@ -802,7 +802,7 @@ CAutomobile::ProcessControl(void)
|
|||
adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_FRONT_RIGHT].surfaceB);
|
||||
WheelState[CARWHEEL_FRONT_RIGHT] = m_aWheelState[CARWHEEL_FRONT_RIGHT];
|
||||
|
||||
if(Damage.GetWheelStatus(VEHWHEEL_FRONT_RIGHT) == WHEEL_STATUS_BURST)
|
||||
if(Damage.GetWheelStatus(CARWHEEL_FRONT_RIGHT) == WHEEL_STATUS_BURST)
|
||||
ProcessWheel(wheelFwd, wheelRight,
|
||||
contactSpeeds[CARWHEEL_FRONT_RIGHT], contactPoints[CARWHEEL_FRONT_RIGHT],
|
||||
m_nWheelsOnGround, fThrust,
|
||||
|
@ -883,7 +883,7 @@ CAutomobile::ProcessControl(void)
|
|||
adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_REAR_LEFT].surfaceB);
|
||||
WheelState[CARWHEEL_REAR_LEFT] = m_aWheelState[CARWHEEL_REAR_LEFT];
|
||||
|
||||
if(Damage.GetWheelStatus(VEHWHEEL_REAR_LEFT) == WHEEL_STATUS_BURST)
|
||||
if(Damage.GetWheelStatus(CARWHEEL_REAR_LEFT) == WHEEL_STATUS_BURST)
|
||||
ProcessWheel(wheelFwd, wheelRight,
|
||||
contactSpeeds[CARWHEEL_REAR_LEFT], contactPoints[CARWHEEL_REAR_LEFT],
|
||||
m_nWheelsOnGround, fThrust,
|
||||
|
@ -917,7 +917,7 @@ CAutomobile::ProcessControl(void)
|
|||
adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_REAR_RIGHT].surfaceB);
|
||||
WheelState[CARWHEEL_REAR_RIGHT] = m_aWheelState[CARWHEEL_REAR_RIGHT];
|
||||
|
||||
if(Damage.GetWheelStatus(VEHWHEEL_REAR_RIGHT) == WHEEL_STATUS_BURST)
|
||||
if(Damage.GetWheelStatus(CARWHEEL_REAR_RIGHT) == WHEEL_STATUS_BURST)
|
||||
ProcessWheel(wheelFwd, wheelRight,
|
||||
contactSpeeds[CARWHEEL_REAR_RIGHT], contactPoints[CARWHEEL_REAR_RIGHT],
|
||||
m_nWheelsOnGround, fThrust,
|
||||
|
@ -3946,10 +3946,10 @@ void
|
|||
CAutomobile::BurstTyre(uint8 wheel)
|
||||
{
|
||||
switch(wheel){
|
||||
case CAR_PIECE_WHEEL_LF: wheel = VEHWHEEL_FRONT_LEFT; break;
|
||||
case CAR_PIECE_WHEEL_LR: wheel = VEHWHEEL_REAR_LEFT; break;
|
||||
case CAR_PIECE_WHEEL_RF: wheel = VEHWHEEL_FRONT_RIGHT; break;
|
||||
case CAR_PIECE_WHEEL_RR: wheel = VEHWHEEL_REAR_RIGHT; break;
|
||||
case CAR_PIECE_WHEEL_LF: wheel = CARWHEEL_FRONT_LEFT; break;
|
||||
case CAR_PIECE_WHEEL_RF: wheel = CARWHEEL_FRONT_RIGHT; break;
|
||||
case CAR_PIECE_WHEEL_LR: wheel = CARWHEEL_REAR_LEFT; break;
|
||||
case CAR_PIECE_WHEEL_RR: wheel = CARWHEEL_REAR_RIGHT; break;
|
||||
}
|
||||
|
||||
int status = Damage.GetWheelStatus(wheel);
|
||||
|
|
|
@ -30,8 +30,6 @@ enum eCarNodes
|
|||
NUM_CAR_NODES,
|
||||
};
|
||||
|
||||
// These are used for all the wheel arrays
|
||||
// DON'T confuse with VEHWHEEL, which are vehicle components
|
||||
enum {
|
||||
CARWHEEL_FRONT_LEFT,
|
||||
CARWHEEL_REAR_LEFT,
|
||||
|
|
|
@ -11,7 +11,7 @@ class CBuilding;
|
|||
class CCrane
|
||||
{
|
||||
public:
|
||||
enum CraneState : uint8 {
|
||||
enum CraneState {
|
||||
IDLE = 0,
|
||||
GOING_TOWARDS_TARGET = 1,
|
||||
LIFTING_TARGET = 2,
|
||||
|
@ -19,7 +19,7 @@ public:
|
|||
ROTATING_TARGET = 4,
|
||||
DROPPING_TARGET = 5
|
||||
};
|
||||
enum CraneStatus : uint8 {
|
||||
enum CraneStatus {
|
||||
NONE = 0,
|
||||
ACTIVATED = 1,
|
||||
DEACTIVATED = 2
|
||||
|
@ -47,8 +47,8 @@ public:
|
|||
CVector2D m_vecHookVelocity;
|
||||
CVehicle *m_pVehiclePickedUp;
|
||||
uint32 m_nTimeForNextCheck;
|
||||
CraneStatus m_nCraneStatus;
|
||||
CraneState m_nCraneState;
|
||||
uint8 m_nCraneStatus;
|
||||
uint8 m_nCraneState;
|
||||
uint8 m_nVehiclesCollected;
|
||||
bool m_bIsCrusher;
|
||||
bool m_bIsMilitaryCrane;
|
||||
|
|
|
@ -65,7 +65,7 @@ enum tVehicleType
|
|||
NUMHANDLINGS
|
||||
};
|
||||
|
||||
enum tField : uint32 // most likely a handling field enum, never used so :shrug:
|
||||
enum tField // most likely a handling field enum, never used so :shrug:
|
||||
{
|
||||
|
||||
};
|
||||
|
|
|
@ -57,14 +57,6 @@ enum eLights
|
|||
VEHLIGHT_REAR_RIGHT,
|
||||
};
|
||||
|
||||
enum eWheels
|
||||
{
|
||||
VEHWHEEL_FRONT_LEFT,
|
||||
VEHWHEEL_FRONT_RIGHT,
|
||||
VEHWHEEL_REAR_LEFT,
|
||||
VEHWHEEL_REAR_RIGHT,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CAR_PIECE_BONNET = 1,
|
||||
|
|
|
@ -385,7 +385,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
|
|||
if ( victimPed->bUsesCollision || victimPed->Dead() || victimPed->Driving() )
|
||||
{
|
||||
CVector victimPedPos = victimPed->GetPosition();
|
||||
if ( SQR(victimPedRadius) > (victimPedPos-(*fireSource)).MagnitudeSqr() )
|
||||
if ( SQR(victimPedRadius) > (victimPedPos-fireSource).MagnitudeSqr() )
|
||||
{
|
||||
CVector collisionDist;
|
||||
|
||||
|
@ -393,7 +393,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
|
|||
while ( s < victimPedCol->numSpheres )
|
||||
{
|
||||
CColSphere *sphere = &victimPedCol->spheres[s];
|
||||
collisionDist = victimPedPos+sphere->center-(*fireSource);
|
||||
collisionDist = victimPedPos+sphere->center-fireSource;
|
||||
|
||||
if ( SQR(sphere->radius + info->m_fRadius) > collisionDist.MagnitudeSqr() )
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
2
vendor/librw
vendored
2
vendor/librw
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 2066cf6634383e056cd5dda105e87f8da04b1ed8
|
||||
Subproject commit ed9cb45ee9a2749a0a89231bf16f09a5c53bfc92
|
Loading…
Reference in a new issue