mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-22 22:43:42 +03:00
Compare commits
No commits in common. "master" and "4.1" have entirely different histories.
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -36,11 +36,11 @@ vpc_osx binary
|
|||||||
*.inl text
|
*.inl text
|
||||||
*.asm text
|
*.asm text
|
||||||
|
|
||||||
.github/CONTRIBUTING.md text
|
|
||||||
.gitignore text
|
.gitignore text
|
||||||
sourcesdk_def.mak text
|
sourcesdk_def.mak text
|
||||||
smdlexp.mak text
|
smdlexp.mak text
|
||||||
README text
|
README text
|
||||||
|
CONTRIBUTING text
|
||||||
LICENSE text
|
LICENSE text
|
||||||
|
|
||||||
*.exe binary
|
*.exe binary
|
||||||
|
66
.github/CONTRIBUTING.md
vendored
66
.github/CONTRIBUTING.md
vendored
@ -1,66 +0,0 @@
|
|||||||
This file details how to contribute to the Mapbase project on GitHub:
|
|
||||||
https://github.com/mapbase-source/source-sdk-2013
|
|
||||||
|
|
||||||
For the original Source SDK 2013 contribution guidelines, click here:
|
|
||||||
https://github.com/ValveSoftware/source-sdk-2013/blob/master/CONTRIBUTING
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Mapbase is a project which many Source modders draw from, so it has its own unique standards
|
|
||||||
for contributions which differ from other projects, but it is still an open-source repository
|
|
||||||
that is always open to contributions.
|
|
||||||
|
|
||||||
Whenever you contribute to the Mapbase repository, you must keep in mind that any contributions
|
|
||||||
made could be deployed to all mods utilizing Mapbase, which can include everything from high-profile
|
|
||||||
Steam mods to amateur HL2 maps. Many contributions can also end up being available in both SP and MP
|
|
||||||
if the contributions are not obviously exclusive to one of the two.
|
|
||||||
|
|
||||||
All contributions must follow the following rules:
|
|
||||||
|
|
||||||
* A contribution must be aligned with Mapbase's goals and priorities and should not be "subjective"
|
|
||||||
or related to a specific mod or type of mod. For example, fixing an existing issue or adding a
|
|
||||||
new tool for mappers to use is usually fine, but adding a new custom weapon with its own assets
|
|
||||||
is usually not fit for Mapbase.
|
|
||||||
|
|
||||||
* All content in a contribution must be either already legally open-source or done with the
|
|
||||||
full permission of the content's original creator(s). If a license is involved, the contributor
|
|
||||||
should ensure Mapbase conforms to its terms.
|
|
||||||
* **NOTE:** Due to concerns with mods which do not wish to be open-source, content using GPL licenses (or any
|
|
||||||
license with similar open-source requirements) are currently not allowed to be distributed with Mapbase.
|
|
||||||
Contributions which can draw from them without actually distributing the licensed content may be excepted
|
|
||||||
from this rule.
|
|
||||||
|
|
||||||
* Contributions must not break existing maps/content or interfere with them in a negative or non-objective way.
|
|
||||||
|
|
||||||
* Code contributions are not obliged to follow Mapbase's preprocessor conventions (e.g. #ifdef MAPBASE),
|
|
||||||
although following them is usually acceptable.
|
|
||||||
|
|
||||||
* Code contributions which modify or add onto existing code should generally match its syntax and shouldn't
|
|
||||||
change the spacing unless necessary.
|
|
||||||
|
|
||||||
* If you are contributing a file you created yourself specifically for Mapbase, you are required to
|
|
||||||
use the custom "Mapbase - Source 2013" header used in other Mapbase files as of Mapbase v5.0.
|
|
||||||
You are encouraged to append an "Author(s)" part to that header in your file in order to clarify who wrote it.
|
|
||||||
|
|
||||||
* Do not modify the README to add attribution for your contribution. That is handled by Mapbase's maintainers.
|
|
||||||
|
|
||||||
Contributions which do not follow these guidelines cannot be accepted into Mapbase. Attempting to contribute content
|
|
||||||
which seriously violates the rules above can lead to being blocked from contributing, especially if done repeatedly.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Mapbase uses GitHub Actions to help manage issues and pull requests. Some of these workflows build the code of incoming
|
|
||||||
contributions to make sure they compile properly. The code is compiled separately for Visual Studio 2022 and GCC/G++ 9 (Linux)
|
|
||||||
and on both Debug and Release configurations.
|
|
||||||
|
|
||||||
If these workflows fail, don't freak out! Accidents can happen frequently due to compiler syntax differences and conflicts
|
|
||||||
from other contributions. You can look at a failed workflow's log by clicking "Details", which will include the build's output
|
|
||||||
in the "Build" step(s). Any errors must be resolved by you and/or by code reviewers before a pull request can be merged.
|
|
||||||
|
|
||||||
If your contribution is accepted, you may be listed in Mapbase's credits and the README's external content list:
|
|
||||||
https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Credits#Contributors
|
|
||||||
https://github.com/mapbase-source/source-sdk-2013/blob/master/README
|
|
||||||
|
|
||||||
You may also receive the "Contributor" or "Major Contributor" role on Mapbase's Discord server if you are
|
|
||||||
a member of it.
|
|
||||||
|
|
25
.github/ISSUE_TEMPLATE/bug-report---code.md
vendored
25
.github/ISSUE_TEMPLATE/bug-report---code.md
vendored
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - Code
|
|
||||||
about: Create a bug report related to the source code itself. (e.g. a compile error)
|
|
||||||
title: "[CODE] "
|
|
||||||
labels: Bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Have '...' set to something
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
25
.github/ISSUE_TEMPLATE/bug-report---game.md
vendored
25
.github/ISSUE_TEMPLATE/bug-report---game.md
vendored
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - Game
|
|
||||||
about: Create a bug report related to game behavior.
|
|
||||||
title: "[GAME] "
|
|
||||||
labels: Bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Have '...' in the map
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
25
.github/ISSUE_TEMPLATE/bug-report---misc.md
vendored
25
.github/ISSUE_TEMPLATE/bug-report---misc.md
vendored
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - Miscellaneous
|
|
||||||
about: Create a bug report not related to any of the other subjects.
|
|
||||||
title: "[MISC] "
|
|
||||||
labels: Bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Do '...'
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
25
.github/ISSUE_TEMPLATE/bug-report---npc.md
vendored
25
.github/ISSUE_TEMPLATE/bug-report---npc.md
vendored
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - NPCs
|
|
||||||
about: Create a bug report related to NPCs.
|
|
||||||
title: "[NPCs] "
|
|
||||||
labels: Bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Have '...' do something
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
25
.github/ISSUE_TEMPLATE/bug-report---tools.md
vendored
25
.github/ISSUE_TEMPLATE/bug-report---tools.md
vendored
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - Tools
|
|
||||||
about: Create a bug report related to compile tools, editor stuff, etc.
|
|
||||||
title: "[TOOLS] "
|
|
||||||
labels: Bug, Tools
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Have '...' in the map
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - Visuals/Graphics
|
|
||||||
about: Create a bug report related to visual issues. (e.g. shaders, projected textures,
|
|
||||||
etc.)
|
|
||||||
title: "[VISUAL] "
|
|
||||||
labels: Bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Have '...' in the map
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
### Media
|
|
||||||
Any related screenshots, videos, etc. which show the bug.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
25
.github/ISSUE_TEMPLATE/bug-report---vscript.md
vendored
25
.github/ISSUE_TEMPLATE/bug-report---vscript.md
vendored
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report - VScript
|
|
||||||
about: Create a bug report related to VScript.
|
|
||||||
title: "[VSCRIPT] "
|
|
||||||
labels: Bug, VScript
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Describe the bug
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Have '...' in the script
|
|
||||||
2. ???
|
|
||||||
3. See error
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context about the problem here.
|
|
22
.github/ISSUE_TEMPLATE/feature-request---code.md
vendored
22
.github/ISSUE_TEMPLATE/feature-request---code.md
vendored
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - Code
|
|
||||||
about: Suggest an idea related to the source code itself. (e.g. a new utility function)
|
|
||||||
title: "[CODE] "
|
|
||||||
labels: Enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
22
.github/ISSUE_TEMPLATE/feature-request---game.md
vendored
22
.github/ISSUE_TEMPLATE/feature-request---game.md
vendored
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - Game
|
|
||||||
about: Suggest an idea related to game behavior.
|
|
||||||
title: "[GAME] "
|
|
||||||
labels: Enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
22
.github/ISSUE_TEMPLATE/feature-request---misc.md
vendored
22
.github/ISSUE_TEMPLATE/feature-request---misc.md
vendored
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - Miscellaneous
|
|
||||||
about: Suggest an idea not related to any of the other subjects.
|
|
||||||
title: "[MISC] "
|
|
||||||
labels: Enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
22
.github/ISSUE_TEMPLATE/feature-request---npc.md
vendored
22
.github/ISSUE_TEMPLATE/feature-request---npc.md
vendored
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - NPCs
|
|
||||||
about: Suggest an idea related to NPCs.
|
|
||||||
title: "[NPCs] "
|
|
||||||
labels: Enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - Tools
|
|
||||||
about: Suggest an idea related to compile tools, editor stuff, etc.
|
|
||||||
title: "[TOOLS] "
|
|
||||||
labels: Enhancement, Tools
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - Visuals/Graphics
|
|
||||||
about: Suggest an idea related to visuals or graphics. (e.g. shaders, projected textures,
|
|
||||||
etc.)
|
|
||||||
title: "[VISUAL] "
|
|
||||||
labels: Enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request - VScript
|
|
||||||
about: Suggest an idea related to VScript.
|
|
||||||
title: "[VSCRIPT] "
|
|
||||||
labels: Enhancement, VScript
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
(Optional) Add any other context or screenshots about the feature request here.
|
|
35
.github/labeler.yml
vendored
35
.github/labeler.yml
vendored
@ -1,35 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE REPO AUTOMATION
|
|
||||||
#
|
|
||||||
# Automatically labels pull requests according to changed file paths.
|
|
||||||
# See mapbase_pr.yml for more information.
|
|
||||||
#
|
|
||||||
Repo:
|
|
||||||
- '*'
|
|
||||||
- '.github/**'
|
|
||||||
|
|
||||||
Project Generation:
|
|
||||||
- '**/src/vpc_scripts/**'
|
|
||||||
- '**/src/devtools/**'
|
|
||||||
- '**/src/create*'
|
|
||||||
|
|
||||||
Entities:
|
|
||||||
- '**/src/game/**/**logic**'
|
|
||||||
- '**/src/game/**/**point**'
|
|
||||||
|
|
||||||
Shaders:
|
|
||||||
- '**/src/materialsystem/**'
|
|
||||||
|
|
||||||
VScript:
|
|
||||||
- '**vscript**'
|
|
||||||
|
|
||||||
Tools:
|
|
||||||
- '**utils**'
|
|
||||||
|
|
||||||
NPCs:
|
|
||||||
- '**npc_**'
|
|
||||||
- '**ai_**'
|
|
||||||
|
|
||||||
VGUI:
|
|
||||||
- '**hud_**'
|
|
||||||
- '**vgui_**'
|
|
11
.github/pull-request-template.md
vendored
11
.github/pull-request-template.md
vendored
@ -1,11 +0,0 @@
|
|||||||
(Describe your PR here and then fill out the checklist at the bottom)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### Does this PR close any issues?
|
|
||||||
* (Optional) Insert issue number(s) and any related info here
|
|
||||||
|
|
||||||
<!-- Replace [ ] with [x] for each item your PR satisfies -->
|
|
||||||
#### PR Checklist
|
|
||||||
- [ ] **My PR follows all guidelines in the CONTRIBUTING.md file**
|
|
||||||
- [ ] My PR targets a `develop` branch OR targets another branch with a specific goal in mind
|
|
@ -1,70 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE SOURCE 2013 CI
|
|
||||||
#
|
|
||||||
# This can be used to manually build the codebase.
|
|
||||||
#
|
|
||||||
# See mapbase_build-base.yml for more information on how this works.
|
|
||||||
|
|
||||||
name: Build Projects (Manual)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
configuration:
|
|
||||||
description: 'Which configuration to build with'
|
|
||||||
default: 'Release'
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- Release
|
|
||||||
- Debug
|
|
||||||
branch:
|
|
||||||
description: 'Which Source 2013 engine branch to compile for'
|
|
||||||
default: 'sp'
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- sp
|
|
||||||
- mp
|
|
||||||
game:
|
|
||||||
description: 'Name of the game to build (if relevant)'
|
|
||||||
default: 'episodic'
|
|
||||||
required: false
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- episodic
|
|
||||||
- hl2
|
|
||||||
project-group:
|
|
||||||
description: 'Which group of projects to compile'
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- all
|
|
||||||
- game
|
|
||||||
- shaders
|
|
||||||
- maptools
|
|
||||||
solution-name:
|
|
||||||
description: 'Name of the solution/makefile'
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- everything
|
|
||||||
- games
|
|
||||||
- shaders
|
|
||||||
- maptools
|
|
||||||
build-on-linux:
|
|
||||||
description: 'Build on Ubuntu/Linux?'
|
|
||||||
default: true
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_manual:
|
|
||||||
uses: ./.github/workflows/mapbase_build-base.yml
|
|
||||||
with:
|
|
||||||
configuration: '${{ github.event.inputs.configuration }}'
|
|
||||||
branch: '${{ github.event.inputs.branch }}'
|
|
||||||
game: '${{ github.event.inputs.game }}'
|
|
||||||
project-group: '${{ github.event.inputs.project-group }}'
|
|
||||||
solution-name: '${{ github.event.inputs.solution-name }}'
|
|
||||||
build-on-linux: "${{ github.event.inputs.build-on-linux == 'true' }}"
|
|
195
.github/workflows/mapbase_build-base.yml
vendored
195
.github/workflows/mapbase_build-base.yml
vendored
@ -1,195 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE SOURCE 2013 CI
|
|
||||||
#
|
|
||||||
# This workflow script automatically builds the Source SDK 2013 codebase on Windows and Linux using GitHub Actions.
|
|
||||||
#
|
|
||||||
# This is useful in a number of ways:
|
|
||||||
#
|
|
||||||
# 1. It ensures pull requests compile correctly on multiple platforms and provides binaries that can be used to test them.
|
|
||||||
# 2. It can be used to compile code for releases without having to pull and prepare a local development environment.
|
|
||||||
# 3. It opens potential for scripts that can employ more principles of CI/CD. (e.g. automatically publishing a release)
|
|
||||||
#
|
|
||||||
# This is based on a workflow originally created by z33ky.
|
|
||||||
|
|
||||||
name: Build Projects
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
configuration:
|
|
||||||
description: 'Which configuration to build with'
|
|
||||||
default: 'Release'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
branch:
|
|
||||||
description: 'Which Source 2013 engine branch to compile for'
|
|
||||||
default: 'sp'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
game:
|
|
||||||
description: 'The name of the game to build (if relevant)'
|
|
||||||
default: 'episodic'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
project-group:
|
|
||||||
description: 'Which group of projects to compile'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
solution-name:
|
|
||||||
description: 'The name of the solution/makefile'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
build-on-linux:
|
|
||||||
description: 'Build on Ubuntu/Linux?'
|
|
||||||
default: true
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_windows:
|
|
||||||
name: Windows (VS2022)
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Add MSBuild to PATH
|
|
||||||
uses: compnerd/gha-setup-vsdevenv@v6
|
|
||||||
|
|
||||||
- name: Enable VS2022
|
|
||||||
working-directory: '${{inputs.branch}}/src/vpc_scripts'
|
|
||||||
shell: bash
|
|
||||||
run: sed -i 's/^\($Conditional[ ]\+VS2022[ ]\+\).*/\1"1"/' newer_vs_toolsets.vpc
|
|
||||||
|
|
||||||
- name: Pick game
|
|
||||||
if: inputs.project-group == 'game' || inputs.project-group == 'shaders'
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
shell: bash
|
|
||||||
run: sed -i 's/\/hl2 \/episodic/\/${{inputs.game}}/' create${{inputs.project-group}}projects.bat
|
|
||||||
|
|
||||||
- name: Create project files
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
shell: cmd
|
|
||||||
# https://github.com/ValveSoftware/source-sdk-2013/issues/72
|
|
||||||
run: |
|
|
||||||
reg add "HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" /v DefaultProjectExtension /t REG_SZ /d vcproj /f
|
|
||||||
create${{inputs.project-group}}projects.bat
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
#if: steps.filter.outputs.game == 'true'
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
devenv ${{inputs.solution-name}}.sln /upgrade
|
|
||||||
msbuild -m -t:Rebuild -p:Configuration=${{inputs.configuration}};Platform=x86 ${{inputs.solution-name}}.sln
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
|
|
||||||
- name: Publish game binaries
|
|
||||||
if: inputs.project-group == 'game' || inputs.project-group == 'shaders'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: '${{inputs.project-group}}_${{inputs.game}}_win32_${{ inputs.configuration }}'
|
|
||||||
path: |
|
|
||||||
${{inputs.branch}}/game/mod_${{inputs.game}}/bin/*.dll
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Publish map tools
|
|
||||||
if: inputs.project-group == 'maptools'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: '${{inputs.project-group}}_win32_${{ inputs.configuration }}'
|
|
||||||
path: |
|
|
||||||
${{inputs.branch}}/game/bin/*.exe
|
|
||||||
${{inputs.branch}}/game/bin/*.dll
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Publish everything
|
|
||||||
if: inputs.project-group == 'all'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: 'everything_win32_${{ inputs.configuration }}'
|
|
||||||
path: |
|
|
||||||
${{inputs.branch}}/game/bin
|
|
||||||
${{inputs.branch}}/game/mod_*/bin
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
build_ubuntu:
|
|
||||||
if: inputs.build-on-linux == true && inputs.project-group != 'maptools' # No Linux map tools for now
|
|
||||||
name: Ubuntu (GCC/G++)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
config: ${{ inputs.configuration }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install GCC/G++ multilib
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install gcc-multilib g++-multilib
|
|
||||||
|
|
||||||
- name: Pick game
|
|
||||||
if: inputs.project-group == 'game' || inputs.project-group == 'shaders'
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
shell: bash
|
|
||||||
run: sed -i 's/\/hl2 \/episodic/\/${{inputs.game}}/' create${{inputs.project-group}}projects
|
|
||||||
|
|
||||||
- name: Set configuration
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
config=${{inputs.configuration}}
|
|
||||||
export CFG=${config,,}
|
|
||||||
echo "config=${CFG}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create project files
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
run: ./create${{inputs.project-group}}projects
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
working-directory: '${{inputs.branch}}/src'
|
|
||||||
run: make CFG=${{env.config}} -f ${{inputs.solution-name}}.mak
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
|
|
||||||
- name: Publish game binaries
|
|
||||||
if: inputs.project-group == 'game' || inputs.project-group == 'shaders'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: '${{inputs.project-group}}_${{inputs.game}}_linux32_${{ inputs.configuration }}'
|
|
||||||
path: |
|
|
||||||
${{inputs.branch}}/game/mod_${{inputs.game}}/bin/*.so
|
|
||||||
!${{inputs.branch}}/game/mod_${{inputs.game}}/bin/*_srv.so
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
#- name: Publish map tools
|
|
||||||
# if: inputs.project-group == 'maptools'
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: '${{inputs.project-group}}_linux32_${{ inputs.configuration }}'
|
|
||||||
# path: |
|
|
||||||
# ${{inputs.branch}}/game/bin/vbsp
|
|
||||||
# ${{inputs.branch}}/game/bin/vvis
|
|
||||||
# ${{inputs.branch}}/game/bin/vvis_dll.so
|
|
||||||
# ${{inputs.branch}}/game/bin/vrad
|
|
||||||
# ${{inputs.branch}}/game/bin/vrad_dll.so
|
|
||||||
# if-no-files-found: error
|
|
||||||
|
|
||||||
# For now, don't publish the .dbg files even though we publish .pdb files on Windows
|
|
||||||
# (they're too big)
|
|
||||||
- name: Publish everything
|
|
||||||
if: inputs.project-group == 'all'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: 'everything_linux32_${{ inputs.configuration }}'
|
|
||||||
path: |
|
|
||||||
${{inputs.branch}}/game/bin/*.so
|
|
||||||
!${{inputs.branch}}/game/bin/*_srv.so
|
|
||||||
${{inputs.branch}}/game/mod_*/bin/*.so
|
|
||||||
!${{inputs.branch}}/game/mod_*/bin/*_srv.so
|
|
||||||
if-no-files-found: error
|
|
31
.github/workflows/mapbase_build-master.yml
vendored
31
.github/workflows/mapbase_build-master.yml
vendored
@ -1,31 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE SOURCE 2013 CI
|
|
||||||
#
|
|
||||||
# Builds all projects when a pull request to the master branch is opened.
|
|
||||||
# If you're using a fork of Mapbase, feel free to configure this to meet your repository's needs.
|
|
||||||
#
|
|
||||||
# The "mapbase_build-sp" set of workflows can build specific projects depending on what files are changed.
|
|
||||||
# They are designed around a "develop" branch, but can be configured to target "master" and replace this
|
|
||||||
# instead (or target a similar branch with a different name)
|
|
||||||
#
|
|
||||||
# See mapbase_build-base.yml for more information on how this works.
|
|
||||||
|
|
||||||
name: Build All Projects #(SP Release)
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
everything:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
configuration: [Release, Debug]
|
|
||||||
uses: ./.github/workflows/mapbase_build-base.yml
|
|
||||||
with:
|
|
||||||
configuration: ${{ matrix.configuration }}
|
|
||||||
branch: 'sp'
|
|
||||||
project-group: 'all'
|
|
||||||
solution-name: 'everything'
|
|
||||||
build-on-linux: true # Disable this if you don't want to compile for Linux
|
|
38
.github/workflows/mapbase_build-sp-games.yml
vendored
38
.github/workflows/mapbase_build-sp-games.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE SOURCE 2013 CI
|
|
||||||
#
|
|
||||||
# Builds game projects every time a pull request which modifies the game code is opened.
|
|
||||||
# If you're using a fork of Mapbase, feel free to configure this to meet your repository's needs.
|
|
||||||
#
|
|
||||||
# See mapbase_build-base.yml for more information on how this works.
|
|
||||||
|
|
||||||
name: Build Game Projects #(SP Release)
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/mapbase_build-base.yml'
|
|
||||||
- '.github/workflows/mapbase_build-sp-rel-games.yml'
|
|
||||||
- 'sp/src/vpc_scripts/**'
|
|
||||||
- 'sp/src/game/**'
|
|
||||||
- 'sp/src/mathlib/**'
|
|
||||||
- 'sp/src/responserules/runtime/**'
|
|
||||||
- 'sp/src/tier1/**'
|
|
||||||
- 'sp/src/vgui2/vgui_controls/**'
|
|
||||||
- 'sp/src/vscript/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
games:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
configuration: [Release, Debug]
|
|
||||||
uses: ./.github/workflows/mapbase_build-base.yml
|
|
||||||
with:
|
|
||||||
configuration: ${{ matrix.configuration }}
|
|
||||||
branch: 'sp'
|
|
||||||
game: 'episodic' # Change this if your mod is not using HL2/Episodic game projects
|
|
||||||
project-group: 'game'
|
|
||||||
solution-name: 'games'
|
|
||||||
build-on-linux: true # Disable this if you don't want to compile for Linux
|
|
38
.github/workflows/mapbase_build-sp-maptools.yml
vendored
38
.github/workflows/mapbase_build-sp-maptools.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE SOURCE 2013 CI
|
|
||||||
#
|
|
||||||
# Builds map tool projects every time a pull request which modifies the map tool code is opened.
|
|
||||||
# If you're using a fork of Mapbase, feel free to configure this to meet your repository's needs.
|
|
||||||
#
|
|
||||||
# See mapbase_build-base.yml for more information on how this works.
|
|
||||||
|
|
||||||
name: Build Map Tool Projects #(SP Release)
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/mapbase_build-sp-rel-maptools.yml'
|
|
||||||
- 'sp/src/vpc_scripts/**'
|
|
||||||
- 'sp/src/utils/vbsp/**'
|
|
||||||
- 'sp/src/utils/vvis/**'
|
|
||||||
- 'sp/src/utils/vvis_launcher/**'
|
|
||||||
- 'sp/src/utils/vrad/**'
|
|
||||||
- 'sp/src/utils/vrad_launcher/**'
|
|
||||||
- 'sp/src/mathlib/**'
|
|
||||||
- 'sp/src/tier1/**'
|
|
||||||
- 'sp/src/vgui2/vgui_controls/**'
|
|
||||||
- 'sp/src/vscript/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
maptools:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
configuration: [Release, Debug]
|
|
||||||
uses: ./.github/workflows/mapbase_build-base.yml
|
|
||||||
with:
|
|
||||||
configuration: ${{ matrix.configuration }}
|
|
||||||
branch: 'sp'
|
|
||||||
project-group: 'maptools'
|
|
||||||
solution-name: 'maptools'
|
|
33
.github/workflows/mapbase_build-sp-shaders.yml
vendored
33
.github/workflows/mapbase_build-sp-shaders.yml
vendored
@ -1,33 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE SOURCE 2013 CI
|
|
||||||
#
|
|
||||||
# Builds shader projects every time a pull request which modifies the shader code is opened.
|
|
||||||
# If you're using a fork of Mapbase, feel free to configure this to meet your repository's needs.
|
|
||||||
#
|
|
||||||
# See mapbase_build-base.yml for more information on how this works.
|
|
||||||
|
|
||||||
name: Build Shader Projects #(SP Release)
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/mapbase_build-sp-rel-shaders.yml'
|
|
||||||
- 'sp/src/vpc_scripts/**'
|
|
||||||
- 'sp/src/materialsystem/**'
|
|
||||||
- 'sp/src/mathlib/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
shaders:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
configuration: [Release, Debug]
|
|
||||||
uses: ./.github/workflows/mapbase_build-base.yml
|
|
||||||
with:
|
|
||||||
configuration: ${{ matrix.configuration }}
|
|
||||||
branch: 'sp'
|
|
||||||
game: 'episodic' # Change this if your mod is not using HL2/Episodic game projects
|
|
||||||
project-group: 'shaders'
|
|
||||||
solution-name: 'shaders'
|
|
||||||
build-on-linux: true # Disable this if you don't want to compile for Linux
|
|
23
.github/workflows/mapbase_pr.yml
vendored
23
.github/workflows/mapbase_pr.yml
vendored
@ -1,23 +0,0 @@
|
|||||||
#
|
|
||||||
# MAPBASE REPO AUTOMATION
|
|
||||||
#
|
|
||||||
# Automatically labels pull requests according to changed file paths.
|
|
||||||
#
|
|
||||||
# https://github.com/actions/labeler
|
|
||||||
|
|
||||||
name: Pull Request Automation
|
|
||||||
on: [pull_request] # pull_request_target
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
label:
|
|
||||||
|
|
||||||
if: github.repository_owner == 'mapbase-source' # ${{ vars.MAPBASE_LABELS == 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/labeler@v4
|
|
||||||
with:
|
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
36
CONTRIBUTING
Normal file
36
CONTRIBUTING
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
This file details how to contribute to the Mapbase project on GitHub:
|
||||||
|
https://github.com/mapbase-source/source-sdk-2013
|
||||||
|
|
||||||
|
For the original Source SDK 2013 contribution guidelines, click here:
|
||||||
|
https://github.com/ValveSoftware/source-sdk-2013/blob/master/CONTRIBUTING
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Mapbase is a project which many Source modders draw from, so it has its own unique standards
|
||||||
|
for contributions which differ from other projects, but it is still an open-source repository
|
||||||
|
that is always open to contributions.
|
||||||
|
|
||||||
|
Whenever you contribute to the Mapbase repository, you must keep in mind that any contributions
|
||||||
|
made could be deployed to all mods utilizing Mapbase, which can include everything from high-profile
|
||||||
|
Steam mods to amateur HL2 maps.
|
||||||
|
|
||||||
|
All contributions must follow the following rules:
|
||||||
|
|
||||||
|
* A contribution must be aligned with Mapbase's goals and priorities and should not be "subjective"
|
||||||
|
or related to a specific mod or type of mod. For example, fixing an existing issue or adding a
|
||||||
|
new tool for mappers to use is usually fine, but adding a new custom weapon with its own assets
|
||||||
|
is usually not fit for Mapbase.
|
||||||
|
|
||||||
|
* All content in a contribution must be either already legally open-source or done with the
|
||||||
|
full permission of the contribution's original creator(s).
|
||||||
|
|
||||||
|
* A code contribution should typically follow Mapbase's preprocessor conventions unless it's a massive
|
||||||
|
feature which makes fundamental changes to several different parts of the code (e.g. reductor's VScript PR).
|
||||||
|
When following these standards, all changes should be nested within "#ifdef MAPBASE", "#ifndef MAPBASE", etc.
|
||||||
|
|
||||||
|
If your contribution is accepted, you may be listed in Mapbase's credits:
|
||||||
|
https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Credits#Contributors
|
||||||
|
|
||||||
|
You may also receive the "Contributor" or "Major Contributor" role on Mapbase's Discord server if you are
|
||||||
|
a member of it.
|
||||||
|
|
229
README
229
README
@ -1,226 +1,21 @@
|
|||||||
//=========================================================================================================================
|
Mapbase - Source 2013
|
||||||
|
|
||||||
Mapbase v7.3 - Source 2013
|
This repository contains the code and game files of the Source 2013 modification known as Mapbase.
|
||||||
https://github.com/mapbase-source/source-sdk-2013
|
|
||||||
https://www.moddb.com/mods/mapbase
|
|
||||||
|
|
||||||
//=========================================================================================================================
|
The projected texture fixes within the "ASW_PROJECTED_TEXTURES" preprocessor and most of the shader changes involving projected textures are cumulative changes from Insolence's repository using fixes from Alien Swarm, G-String, and City 17: Episode One. (https://github.com/95Navigator/insolence-2013, https://github.com/Biohazard90/g-string_2013, https://github.com/KyleGospo/City-17-Episode-One-Source)
|
||||||
|
The original code for phong reflections on LightmappedGeneric-derived shaders are from City 17: Episode One. (https://github.com/KyleGospo/City-17-Episode-One-Source)
|
||||||
|
The Alien Swarm-based radial fog and rope code as well as the multiple skybox support are from Half-Life 2: Downfall. (https://github.com/DownFall-Team/DownFall)
|
||||||
|
The dynamic RTT shadow angles code is from Saul Rennison on the VDC. (https://developer.valvesoftware.com/wiki/Dynamic_RTT_shadow_angles_in_Source_2007)
|
||||||
|
The vortigaunt LOS fix is from Half-Life 2: Community Edition (dky.tehkingd.u in particular). (https://gitlab.com/RaraCerberus/HL2CE)
|
||||||
|
The parallax corrected cubemap code was originally created by Brian Charles. (https://developer.valvesoftware.com/wiki/Parallax_Corrected_Cubemaps)
|
||||||
|
The custom VScript library was created by reductor for Mapbase. (https://github.com/mapbase-source/source-sdk-2013/pull/5)
|
||||||
|
Various other code and contributions were based off of pull requests in the Source 2013 SDK (https://github.com/ValveSoftware/source-sdk-2013/pulls) and snippets on the Valve Developer Community (http://developer.valvesoftware.com/).
|
||||||
|
|
||||||
This repository contains code from Mapbase, a modification of the Source 2013 SDK which serves as a combined package
|
All of the work mentioned above was open source when it was borrowed.
|
||||||
of general-purpose improvements, fixes, and utility features for mods.
|
|
||||||
|
|
||||||
Mapbase's main content in this repository may include:
|
More credits can be found here:
|
||||||
|
|
||||||
- 80+ custom entities (new logic entities, filters, etc.)
|
|
||||||
- Hundreds of Inputs/Outputs/KeyValues additions and modifications
|
|
||||||
- Custom SDK_ shaders with improvements adapted from Alien Swarm SDK code, including projected texture fixes and radial fog
|
|
||||||
- Custom VScript implementation based on public Squirrel API and Alien Swarm SDK interfaces/descriptions
|
|
||||||
- Additional gameplay control for Half-Life 2 mods, including grenade features for more NPCs and singleplayer respawning
|
|
||||||
- More map-specific capabilities for maps unable to branch into their own mods, e.g. MP mods or map compilations
|
|
||||||
- View rendering changes for drawing 3D skyboxes and RT-based entities
|
|
||||||
- Countless other fixes and improvements
|
|
||||||
|
|
||||||
For more information, view this page:
|
|
||||||
https://github.com/mapbase-source/source-sdk-2013/wiki/Introduction-to-Mapbase
|
|
||||||
|
|
||||||
//=========================================================================================================================
|
|
||||||
|
|
||||||
Mapbase is an open-source project and its contents can be distributed and used at the discretion of its users. However, this project contains content from
|
|
||||||
a vast number of different sources which have their own licensing or attribution requirements. We try to handle most of that ourselves, but users who plan on
|
|
||||||
distributing Mapbase content are expected to comply with certain rules.
|
|
||||||
|
|
||||||
Up-to-date information about Mapbase content usage and credit are addressed in this article on Mapbase's wiki:
|
|
||||||
https://github.com/mapbase-source/source-sdk-2013/wiki/Using-Mapbase-Content
|
|
||||||
|
|
||||||
//=========================================================================================================================
|
|
||||||
|
|
||||||
>>>>>>>> EXTERNAL CONTENT USED IN MAPBASE <<<<<<<<
|
|
||||||
|
|
||||||
The Mapbase project is a combination of original code from its creators, code contributed by other Source modders, and code borrowed from open-source articles
|
|
||||||
and repositories (especially ones which are specifically published as free source code). One of Mapbase's goals is to make the most popular fixes and the most obscure
|
|
||||||
or complicated code changes accessible and easy to use for level designers and other kinds of Source modders who would otherwise have no idea how to implement them.
|
|
||||||
|
|
||||||
*** DISCLAIMER: Mapbase has a strict no-leak-content policy and only allows content created directly by contributors or content originating from open-source repositories.
|
|
||||||
If you believe any content in Mapbase originates from any leak or unauthorized source (Valve or otherwise), please contact Blixibon immediately.
|
|
||||||
Mapbase is intended to be usable by everyone, including licensed Source projects and Steam mods. ***
|
|
||||||
|
|
||||||
Mapbase uses content from the following non-Source SDK 2013 Valve games or SDKs:
|
|
||||||
|
|
||||||
-- Alien Swarm SDK (Used to backport features and code from newer branches of Source into a Source 2013/Half-Life 2 environment)
|
|
||||||
-- Source SDK 2007 Code (Used to implement some of Tony Sergi's code changes)
|
|
||||||
|
|
||||||
-- Alien Swarm (Used to port assets from the aforementioned SDK code features, e.g. game instructor icons)
|
|
||||||
-- Left 4 Dead (Used to port certain animations as well as assets from the aforementioned SDK code features, e.g. particle rain)
|
|
||||||
-- Half-Life: Source (Used to port friction tool textures)
|
|
||||||
|
|
||||||
Valve allows assets from these titles to be distributed for modding purposes. Note that ported assets are only used in the release build, not the code repository.
|
|
||||||
|
|
||||||
Mapbase may also contain new third-party software distributed under specific licensing. Please see the bottom of thirdpartylegalnotices.txt for more information.
|
|
||||||
|
|
||||||
Here's a list of Mapbase's other external code sources:
|
|
||||||
|
|
||||||
- https://github.com/95Navigator/insolence-2013 (Initial custom shader code and projected texture improvements; also used to implement ASW SDK particle precipitation code)
|
|
||||||
-- https://github.com/Biohazard90/g-string_2013 (Custom shadow filters, included indirectly via Insolence repo)
|
|
||||||
-- https://github.com/KyleGospo/City-17-Episode-One-Source (Brush phong and projected texture changes, included indirectly via Insolence repo)
|
|
||||||
- https://github.com/DownFall-Team/DownFall (Multiple skybox code and fix for ent_fire delay not using floats; Also used as a guide to port certain Alien Swarm SDK changes to Source 2013,
|
|
||||||
including radial fog, rope code, and treesway)
|
|
||||||
- https://github.com/momentum-mod/game (Used as a guide to port postprocess_controller and env_dof_controller to Source 2013 from the Alien Swarm SDK)
|
|
||||||
- https://github.com/DeathByNukes/source-sdk-2013 (VBSP manifest fixes)
|
|
||||||
- https://github.com/entropy-zero/source-sdk-2013 (skill_changed game event)
|
|
||||||
- https://github.com/Nbc66/source-sdk-2013-ce/tree/v142 (Base for VS2019 toolset support)
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Valve Developer Community (VDC) sources:
|
|
||||||
|
|
||||||
- https://developer.valvesoftware.com/wiki/Dynamic_RTT_shadow_angles_in_Source_2007 (Dynamic RTT shadow angles by Saul Rennison)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Parallax_Corrected_Cubemaps (Parallax corrected cubemaps implementation from Brian Charles)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Adding_the_Game_Instructor (ASW SDK game instructor adapted to Source 2013 by Kolesias123; was implemented based on a translated article)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Brush_ladders (Functional func_ladders in Source 2013)
|
|
||||||
- https://developer.valvesoftware.com/wiki/CAreaPortalOneWay (func_areaportal_oneway)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Implementing_Discord_RPC (Discord RPC implementation; Mapbase has its own framework originally based on this article)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Rain_splashes (NOTE: This code is not completely used in Mapbase, but may still exist in its codebase)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Hand_Viewmodels (NOTE: This code is not completely supported by default because Mapbase does not yet have weapon viewmodels which support
|
|
||||||
interchangeable arms; this may change in the future)
|
|
||||||
|
|
||||||
- https://developer.valvesoftware.com/wiki/General_SDK_Snippets_%26_Fixes (Various snippets on the article, including the dropship gun fix)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Memory_Leak_Fixes (Most of these snippets were applied in later SDK updates, but some were not and have been added to Mapbase)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes (Misc. env_projectedtexture fixes; Some of these are superceded by Alien Swarm-based changes and not used)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Scenes.image (Original raw VCD file support; Code was improved for Mapbase and the article was later updated with it)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Extending_Prop_Sphere (prop_sphere customization)
|
|
||||||
- https://developer.valvesoftware.com/wiki/TF2_Glow_Effect_(2013_SDK) (Glow effect)
|
|
||||||
- https://developer.valvesoftware.com/wiki/CFuncMoveLinear_ParentingFix (func_movelinear parenting fix; Code was improved for Mapbase and the article was later updated with it)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Viewmodel_Prediction_Fix (Viewmodel prediction fix)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Owner#Collisions_with_owner (FSOLID_COLLIDE_WITH_OWNER flag)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Npc_clawscanner#Strider_Scout_Issue (npc_clawscanner strider scout fix)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Ambient_generic:_stop_and_toggle_fix (Fixes for stopping/toggling ambient_generic)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Func_clip_vphysics ("Start Disabled" keyvalue fix)
|
|
||||||
- https://developer.valvesoftware.com/wiki/Importing_CSS_Weapons_Into_HL2 (CS:S viewmodel chirality)
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Direct contributions:
|
|
||||||
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/3 ("playvideo" command playback fix from Avanate)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/5 (Custom VScript implementation by ReDucTor; was placed into feature branch before being merged in a subsequent PR)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/60 (Adjustment by RoyaleNoir to one of Saul's VDC changes)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/84 (CS:S viewmodel chirality from 1upD)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/116 (vgui_movie_display mute keyvalue from Alivebyte/rzkid)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/140 (logic_substring entity and icon created by moofemp)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/143 (Propper features for VBSP from Matty-64)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/174 (Fix for multiply defined symbols in later toolsets from und)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/issues/201 (env_projectedtexture shadow filter keyvalue from celisej567)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/193 (RTB:R info_particle_system_coordinate by arbabf and Iridium77)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/193 (Infinite prop_interactable cooldown by arbabf)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/229 (Extended point_bugbait functionality by arbabf)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/236 (Toggleable prop sprinting by Crimson-X1)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/237 (Commander goal trace fix by Agrimar)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/245 (ViewPunch random fix by Mr0maks)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/248 (soundlevel_t conversation warning fix by Mechami)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/266 ("OnPhysGunPull" output in CPhysicsProp by rlenhub)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/292 (env_headcrabcanister random spawn type by arbabf)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/294 (SDK_LightmappedGeneric editor blend swap fix by azzyr)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/308 (BlurFilterY fix by Wikot235)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/312 (Zombie improvements by Wikot235)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/315 (env_flare crash fix by Wikot235)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/324 (server-only info/func_null by SirYodaJedi)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/333 (Cvar to transition levels while in MOVETYPE_NOCLIP by Wikot235)
|
|
||||||
- https://github.com/mapbase-source/source-sdk-2013/pull/342 (NaN particle cull radius fix by celisej567)
|
|
||||||
- https://github.com/mapbase-source/mapbase-game-src/pull/1 (Advanced video options duplicate field name fix by arbabf; This is asset-based and not reflected in the code)
|
|
||||||
- https://github.com/mapbase-source/mapbase-game-src/pull/2 (gameinfo.txt typo fix by CarePackage17; This is asset-based and not reflected in the code)
|
|
||||||
- https://github.com/mapbase-source/mapbase-game-src/pull/3 (HudMessage cutoff fix by arbabf; This is asset-based and not reflected in the code)
|
|
||||||
- Demo autorecord code provided by Klems
|
|
||||||
- cc_emit crash fix provided by 1upD
|
|
||||||
- Custom HL2 ammo crate models created by Rykah (Textures created by Blixibon; This is asset-based and, aside from the SLAM crate, not reflected in the code)
|
|
||||||
- Combine lock hardware on door01_left.mdl created by Kralich (This is asset-based and not reflected in the code)
|
|
||||||
- npc_vehicledriver fixes provided by CrAzY
|
|
||||||
- npc_combine cover behavior patches provided by iohnnyboy
|
|
||||||
- logic_playmovie icon created by URAKOLOUY5 (This is asset-based and not reflected in the code)
|
|
||||||
- Dropship APC save/load fix provided by Cvoxulary
|
|
||||||
|
|
||||||
== Contributions from samisalreadytaken:
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/47 (VScript utility/consistency changes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/59 (New VScript functions and singletons based on API documentation in later Source/Source 2 games)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/80 (More VScript changes, including support for extremely flexible client/server messaging)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/105 (VScript fixes and optimizations, Vector class extensions, custom convars/commands)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/114 (VScript fixes and extensions)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/122 (Minor VScript-related adjustments)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/148 (Minor fixup)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/167 (Security fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/168 (Squirrel update)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/169 (VScript VGUI)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/171 (VScript documentation sorting)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/173 (VScript fixes and optimizations)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/192 (VScript hook manager and fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/206 (Fix CScriptNetMsgHelper::WriteEntity())
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/213 (VScript HUD visibility control, optimizations for 3D skybox angles/fake worldportals)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/229 (VScript VGUI HUD viewport parenting, game_text and vgui_text_display VScript font fallback)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/260 (CScriptNetPropManager rewrite)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/261 (Misc VScript additions)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/279 (weapon_custom_scripted fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/332 (Fix OOB access)
|
|
||||||
|
|
||||||
== Contributions from z33ky:
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/21 (Various GCC/Linux compilation fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/95 (Additional GCC/Linux compilation fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/117 (Additional GCC/Linux compilation fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/124 (Memory error fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/130 (Memory error fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/131 (env_projectedtexture target shadows fix)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/132 (Console error fix)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/152 (Additional GCC/Linux compilation fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/159 (Additional GCC/Linux compilation fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/162 (VS2019 exception specification fix)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/170 (HL2 non-Episodic build fix)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/322 (Small Mapbase fixes)
|
|
||||||
|
|
||||||
== Contributions from Petercov:
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/182 (NPCs load dynamic interactions from all animation MDLs)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/184 (Projected texture horizontal FOV shadow fix)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/185 (Fix enemyfinders becoming visible when they wake)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/186 (Fix for brightly glowing teeth)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/183 (Enhanced custom weapons support)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/230 (Caption fixes)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/231 (Sentence source bug fix)
|
|
||||||
=-- https://github.com/mapbase-source/source-sdk-2013/pull/264 (Outputs for vgui_screen)
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Other sources:
|
|
||||||
|
|
||||||
- Various code from Source SDK 2013 pull requests on the GitHub repository (https://github.com/ValveSoftware/source-sdk-2013/pulls):
|
|
||||||
-- https://github.com/ValveSoftware/source-sdk-2013/pull/441 (Smooth scrape sound oversight fix)
|
|
||||||
-- https://github.com/ValveSoftware/source-sdk-2013/pull/436 (VRAD debug counter fix + thread bump)
|
|
||||||
-- https://github.com/ValveSoftware/source-sdk-2013/pull/416 (Ragdoll null pointer dereference fix)
|
|
||||||
-- https://github.com/ValveSoftware/source-sdk-2013/pull/401 (func_rot_button "Starts locked" flag fix)
|
|
||||||
-- https://github.com/ValveSoftware/source-sdk-2013/pull/391 (VBSP func_detail smoothing group fix)
|
|
||||||
-- https://github.com/ValveSoftware/source-sdk-2013/pull/362 (npc_manhack npc_maker fix; Adjusted for formatting and save/restore in Mapbase)
|
|
||||||
-- https://github.com/Petercov/Source-PlusPlus/commit/ecdf50c48cd31dec4dbdb7fea2d0780e7f0dd8ec (used as a guide for porting the Alien Swarm SDK response system)
|
|
||||||
- https://github.com/momentum-mod/game/blob/1d066180b3bf74830c51e6914d46c40b0bea1fc2/mp/src/game/server/player.cpp#L6543 (spec_goto fix)
|
|
||||||
- Poison zombie barnacle crash fix implemented based on a snippet from HL2: Plus posted by Agent Agrimar on Discord (Mapbase makes the barnacle recognize it as poison just like poison headcrabs)
|
|
||||||
- https://gamebanana.com/skins/172192 (Airboat handling fix; This is asset-based and not reflected in the code)
|
|
||||||
- Vortigaunt LOS fix originally created by dky.tehkingd.u for HL2:CE
|
|
||||||
- https://combineoverwiki.net/wiki/File:Combine_main_symbol.svg ("icon_combine" instructor icon in "materials/vgui/hud/gameinstructor_hl2_1"; This is asset-based and not reflected in the code)
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
If there is anything missing from this list, please contact Blixibon.
|
|
||||||
|
|
||||||
//=========================================================================================================================
|
|
||||||
|
|
||||||
Aside from the content list above, Mapbase has more descriptive and up-to-date credits on this wiki article:
|
|
||||||
https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Credits
|
https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Credits
|
||||||
|
|
||||||
Other relevant articles:
|
|
||||||
* https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Disclaimers
|
|
||||||
* https://github.com/mapbase-source/source-sdk-2013/wiki/Frequently-Asked-Questions-(FAQ)
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
In memory of Holly Liberatore (moofemp)
|
|
||||||
|
|
||||||
//=========================================================================================================================
|
|
||||||
|
|
||||||
Please see the Source SDK 2013 license below:
|
Please see the Source SDK 2013 license below:
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,8 +146,6 @@ CParticleEffectBinding::CParticleEffectBinding()
|
|||||||
m_LastMin = m_Min;
|
m_LastMin = m_Min;
|
||||||
m_LastMax = m_Max;
|
m_LastMax = m_Max;
|
||||||
|
|
||||||
m_flParticleCullRadius = 0.0f;
|
|
||||||
|
|
||||||
SetParticleCullRadius( 0.0f );
|
SetParticleCullRadius( 0.0f );
|
||||||
m_nActiveParticles = 0;
|
m_nActiveParticles = 0;
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@ void CPointEntity::Spawn( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class CNullEntity : public CServerOnlyEntity
|
class CNullEntity : public CBaseEntity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DECLARE_CLASS( CNullEntity, CServerOnlyEntity );
|
DECLARE_CLASS( CNullEntity, CBaseEntity );
|
||||||
|
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
};
|
};
|
||||||
|
@ -208,7 +208,7 @@ void CWeaponAR2::DelayedAttack( void )
|
|||||||
|
|
||||||
// pOwner->SnapEyeAngles( angles );
|
// pOwner->SnapEyeAngles( angles );
|
||||||
|
|
||||||
pOwner->ViewPunch( QAngle( SharedRandomInt( "ar2pax", -12, -8 ), SharedRandomInt( "ar2pay", 1, 2 ), 0 ) );
|
pOwner->ViewPunch( QAngle( SharedRandomInt( "ar2pax", -8, -12 ), SharedRandomInt( "ar2pay", 1, 2 ), 0 ) );
|
||||||
|
|
||||||
// Decrease ammo
|
// Decrease ammo
|
||||||
pOwner->RemoveAmmo( 1, m_iSecondaryAmmoType );
|
pOwner->RemoveAmmo( 1, m_iSecondaryAmmoType );
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
pushd `dirname $0`
|
|
||||||
devtools/bin/vpc /hl2 /episodic +maptools /mksln maptools
|
|
||||||
popd
|
|
@ -1 +0,0 @@
|
|||||||
devtools\bin\vpc.exe +maptools /mksln maptools.sln
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
pushd `dirname $0`
|
|
||||||
devtools/bin/vpc /hl2 /episodic +shaders /mksln shaders
|
|
||||||
popd
|
|
@ -1 +0,0 @@
|
|||||||
devtools\bin\vpc.exe /hl2 /episodic +shaders /mksln shaders.sln
|
|
@ -6,11 +6,10 @@ MAKEFILE_LINK:=$(THISFILE).link
|
|||||||
|
|
||||||
-include $(MAKEFILE_LINK)
|
-include $(MAKEFILE_LINK)
|
||||||
|
|
||||||
# depend on CXX so the correct makefile can be selected when the system is updated
|
$(MAKEFILE_LINK): $(shell which $(CC)) $(THISFILE)
|
||||||
$(MAKEFILE_LINK): $(shell which $(CXX)) $(THISFILE) $(SRCROOT)/devtools/gcc9+support.cpp
|
if [ "$(shell printf "$(shell $(CC) -dumpversion)\n8" | sort -Vr | head -1)" = 8 ]; then \
|
||||||
@ if [ "$(shell printf "$(shell $(CXX) -dumpversion)\n8" | sort -Vr | head -1)" = 8 ]; then \
|
$(COMPILE.cpp) -o gcc9+support.o gcc9+support.c ;\
|
||||||
ln -sf $(MAKEFILE_BASE).default $@ ;\
|
ln -sf $(MAKEFILE_BASE).default $@ ;\
|
||||||
else \
|
else \
|
||||||
$(COMPILE.cpp) -m32 -o $(SRCROOT)/devtools/gcc9+support.o $(SRCROOT)/devtools/gcc9+support.cpp &&\
|
|
||||||
ln -sf $(MAKEFILE_BASE).gcc8 $@ ;\
|
ln -sf $(MAKEFILE_BASE).gcc8 $@ ;\
|
||||||
fi
|
fi
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
#include "filesystem_tools.h"
|
#include "filesystem_tools.h"
|
||||||
#include "tier1/strtools.h"
|
#include "tier1/strtools.h"
|
||||||
#include "utlmap.h"
|
#include "utlmap.h"
|
||||||
#ifdef MAPBASE
|
|
||||||
#include "fmtstr.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
@ -582,34 +579,6 @@ GDclass *GameData::BeginInstanceRemap( const char *pszClassName, const char *psz
|
|||||||
return m_InstanceClass;
|
return m_InstanceClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose: Sets up for additional instance remap fixes from Mapbase
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void GameData::SetupInstanceRemapParams( int iStartNodes, int iStartBrushSide, bool bRemapVecLines )
|
|
||||||
{
|
|
||||||
// Set the numer of nodes in the level
|
|
||||||
m_InstanceStartAINodes = iStartNodes;
|
|
||||||
|
|
||||||
// If we have a "nodeid" key, set it to ivNodeDest so it's properly recognized
|
|
||||||
// during AI node remapping
|
|
||||||
GDinputvariable *var = m_InstanceClass->VarForName( "nodeid" );
|
|
||||||
if ( var )
|
|
||||||
{
|
|
||||||
var->ForceSetType( ivNodeDest );
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------
|
|
||||||
|
|
||||||
// Set the number of brush sides in the level
|
|
||||||
m_InstanceStartSide = iStartBrushSide;
|
|
||||||
|
|
||||||
//---------------------------------------------
|
|
||||||
|
|
||||||
m_bRemapVecLines = bRemapVecLines;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
enum tRemapOperation
|
enum tRemapOperation
|
||||||
{
|
{
|
||||||
@ -617,13 +586,6 @@ enum tRemapOperation
|
|||||||
REMAP_POSITION,
|
REMAP_POSITION,
|
||||||
REMAP_ANGLE,
|
REMAP_ANGLE,
|
||||||
REMAP_ANGLE_NEGATIVE_PITCH,
|
REMAP_ANGLE_NEGATIVE_PITCH,
|
||||||
#ifdef MAPBASE
|
|
||||||
// Remaps the node ID for instance/manifest AI node support
|
|
||||||
REMAP_NODE_ID,
|
|
||||||
|
|
||||||
// Remaps brush sides and sidelists
|
|
||||||
REMAP_SIDES,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -662,12 +624,6 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
|
|||||||
RemapOperation.Insert( ivOrigin, REMAP_POSITION );
|
RemapOperation.Insert( ivOrigin, REMAP_POSITION );
|
||||||
RemapOperation.Insert( ivAxis, REMAP_ANGLE );
|
RemapOperation.Insert( ivAxis, REMAP_ANGLE );
|
||||||
RemapOperation.Insert( ivAngleNegativePitch, REMAP_ANGLE_NEGATIVE_PITCH );
|
RemapOperation.Insert( ivAngleNegativePitch, REMAP_ANGLE_NEGATIVE_PITCH );
|
||||||
#ifdef MAPBASE
|
|
||||||
RemapOperation.Insert( ivNodeDest, REMAP_NODE_ID );
|
|
||||||
RemapOperation.Insert( ivSide, REMAP_SIDES );
|
|
||||||
RemapOperation.Insert( ivSideList, REMAP_SIDES );
|
|
||||||
RemapOperation.Insert( ivVecLine, REMAP_POSITION );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !m_InstanceClass )
|
if ( !m_InstanceClass )
|
||||||
@ -701,12 +657,6 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
|
|||||||
|
|
||||||
case REMAP_POSITION:
|
case REMAP_POSITION:
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
|
||||||
// Only remap ivVecLine if the keyvalue is enabled
|
|
||||||
if (KVType == ivVecLine && !m_bRemapVecLines)
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Vector inPoint( 0.0f, 0.0f, 0.0f ), outPoint;
|
Vector inPoint( 0.0f, 0.0f, 0.0f ), outPoint;
|
||||||
|
|
||||||
sscanf ( pszInValue, "%f %f %f", &inPoint.x, &inPoint.y, &inPoint.z );
|
sscanf ( pszInValue, "%f %f %f", &inPoint.x, &inPoint.y, &inPoint.z );
|
||||||
@ -747,54 +697,6 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
|
|||||||
sprintf( pszOutValue, "%g", -outAngles.x ); // just the pitch
|
sprintf( pszOutValue, "%g", -outAngles.x ); // just the pitch
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
case REMAP_NODE_ID:
|
|
||||||
{
|
|
||||||
int value = atoi( pszInValue );
|
|
||||||
if (value == -1)
|
|
||||||
break;
|
|
||||||
|
|
||||||
//Warning( " %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), value, value + m_InstanceStartAINodes );
|
|
||||||
|
|
||||||
value += m_InstanceStartAINodes;
|
|
||||||
|
|
||||||
sprintf( pszOutValue, "%i", value );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REMAP_SIDES:
|
|
||||||
{
|
|
||||||
CUtlStringList sideList;
|
|
||||||
V_SplitString( pszInValue, " ", sideList );
|
|
||||||
|
|
||||||
// Convert sides
|
|
||||||
CUtlStringList newSideList;
|
|
||||||
for (int i = 0; i < sideList.Count(); i++)
|
|
||||||
{
|
|
||||||
int iSide = atoi( sideList[i] );
|
|
||||||
|
|
||||||
//Warning( " %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), iSide, iSide + m_InstanceStartSide );
|
|
||||||
|
|
||||||
iSide += m_InstanceStartSide;
|
|
||||||
|
|
||||||
newSideList.AddToTail( const_cast<char*>( CNumStr( iSide ).String() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initial side
|
|
||||||
strcpy( pszOutValue, newSideList[0] );
|
|
||||||
|
|
||||||
// Start at 1 for subsequent sides
|
|
||||||
for (int i = 1; i < newSideList.Count(); i++)
|
|
||||||
{
|
|
||||||
// Any subsequent sides are spaced
|
|
||||||
sprintf( pszOutValue, "%s %s", pszOutValue, newSideList[i] );
|
|
||||||
}
|
|
||||||
|
|
||||||
//Warning("Old side list: \"%s\", new side list: \"%s\"\n", pszInValue, pszOutValue);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( strcmpi( pszInValue, pszOutValue ) != 0 );
|
return ( strcmpi( pszInValue, pszOutValue ) != 0 );
|
||||||
@ -813,11 +715,7 @@ bool GameData::RemapNameField( const char *pszInValue, char *pszOutValue, TNameF
|
|||||||
{
|
{
|
||||||
strcpy( pszOutValue, pszInValue );
|
strcpy( pszOutValue, pszInValue );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if ( pszInValue[ 0 ] && pszInValue[ 0 ] != '@' && pszInValue[ 0 ] != '!' )
|
|
||||||
#else
|
|
||||||
if ( pszInValue[ 0 ] && pszInValue[ 0 ] != '@' )
|
if ( pszInValue[ 0 ] && pszInValue[ 0 ] != '@' )
|
||||||
#endif
|
|
||||||
{ // ! at the start of a value means it is global and should not be remaped
|
{ // ! at the start of a value means it is global and should not be remaped
|
||||||
switch( NameFixup )
|
switch( NameFixup )
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,6 @@ private:
|
|||||||
float m_flLinearAtten;
|
float m_flLinearAtten;
|
||||||
float m_flQuadraticAtten;
|
float m_flQuadraticAtten;
|
||||||
float m_flShadowAtten;
|
float m_flShadowAtten;
|
||||||
float m_flShadowFilter;
|
|
||||||
|
|
||||||
bool m_bAlwaysDraw;
|
bool m_bAlwaysDraw;
|
||||||
//bool m_bProjectedTextureVersion;
|
//bool m_bProjectedTextureVersion;
|
||||||
|
@ -259,9 +259,6 @@ LINK_ENTITY_TO_CLASS( client_ragdoll, C_ClientRagdoll );
|
|||||||
BEGIN_DATADESC( C_ClientRagdoll )
|
BEGIN_DATADESC( C_ClientRagdoll )
|
||||||
DEFINE_FIELD( m_bFadeOut, FIELD_BOOLEAN ),
|
DEFINE_FIELD( m_bFadeOut, FIELD_BOOLEAN ),
|
||||||
DEFINE_FIELD( m_bImportant, FIELD_BOOLEAN ),
|
DEFINE_FIELD( m_bImportant, FIELD_BOOLEAN ),
|
||||||
#ifdef MAPBASE
|
|
||||||
DEFINE_FIELD( m_flForcedRetireTime, FIELD_FLOAT ),
|
|
||||||
#endif
|
|
||||||
DEFINE_FIELD( m_iCurrentFriction, FIELD_INTEGER ),
|
DEFINE_FIELD( m_iCurrentFriction, FIELD_INTEGER ),
|
||||||
DEFINE_FIELD( m_iMinFriction, FIELD_INTEGER ),
|
DEFINE_FIELD( m_iMinFriction, FIELD_INTEGER ),
|
||||||
DEFINE_FIELD( m_iMaxFriction, FIELD_INTEGER ),
|
DEFINE_FIELD( m_iMaxFriction, FIELD_INTEGER ),
|
||||||
@ -284,92 +281,9 @@ BEGIN_DATADESC( C_ClientRagdoll )
|
|||||||
|
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
BEGIN_ENT_SCRIPTDESC( C_ClientRagdoll, C_BaseAnimating, "Client-side ragdolls" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( SUB_Remove, "FadeOut", "Fades out the ragdoll and removes it from the client." )
|
|
||||||
|
|
||||||
// TODO: Proper shared ragdoll funcs?
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRagdollObject, "GetRagdollObject", "Gets the ragdoll object of the specified index." )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRagdollObjectCount, "GetRagdollObjectCount", "Gets the number of ragdoll objects on this ragdoll." )
|
|
||||||
|
|
||||||
END_SCRIPTDESC();
|
|
||||||
|
|
||||||
ScriptHook_t C_BaseAnimating::g_Hook_OnClientRagdoll;
|
|
||||||
ScriptHook_t C_BaseAnimating::g_Hook_FireEvent;
|
|
||||||
//ScriptHook_t C_BaseAnimating::g_Hook_BuildTransformations;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BEGIN_ENT_SCRIPTDESC( C_BaseAnimating, C_BaseEntity, "Animating models client-side" )
|
BEGIN_ENT_SCRIPTDESC( C_BaseAnimating, C_BaseEntity, "Animating models client-side" )
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetPoseParameter, "GetPoseParameter", "Get the specified pose parameter's value" )
|
|
||||||
#endif
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetPoseParameter, "SetPoseParameter", "Set the specified pose parameter to the specified value" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptSetPoseParameter, "SetPoseParameter", "Set the specified pose parameter to the specified value" )
|
||||||
DEFINE_SCRIPTFUNC( IsSequenceFinished, "Ask whether the main sequence is done playing" )
|
DEFINE_SCRIPTFUNC( IsSequenceFinished, "Ask whether the main sequence is done playing" )
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptLookupAttachment, "LookupAttachment", "Get the named attachement id" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentOrigin, "GetAttachmentOrigin", "Get the attachement id's origin vector" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentAngles, "GetAttachmentAngles", "Get the attachement id's angles as a p,y,r vector" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentMatrix, "GetAttachmentMatrix", "Get the attachement id's matrix transform" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( LookupBone, "Get the named bone id" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoneTransform, "GetBoneTransform", "Get the transform for the specified bone" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetBoneTransform, "SetBoneTransform", "Set the transform for the specified bone" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptAttachEntityToBone, "AttachEntityToBone", "Attaches this entity to the specified target and bone. Also allows for optional local position offset" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptRemoveBoneAttachment, "RemoveBoneAttachment", "Removes the specified bone attachment" )
|
|
||||||
//DEFINE_SCRIPTFUNC( RemoveBoneAttachments, "Removes all bone attachments" )
|
|
||||||
DEFINE_SCRIPTFUNC( DestroyBoneAttachments, "Destroys all bone attachments" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetNumBoneAttachments, "Gets the number of bone attachments" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoneAttachment, "GetBoneAttachment", "Gets the specified bone attachment" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( SetBodygroup, "Sets a bodygroup")
|
|
||||||
DEFINE_SCRIPTFUNC( GetBodygroup, "Gets a bodygroup" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetBodygroupName, "Gets a bodygroup name" )
|
|
||||||
DEFINE_SCRIPTFUNC( FindBodygroupByName, "Finds a bodygroup by name" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetBodygroupCount, "Gets the number of models in a bodygroup" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetNumBodyGroups, "Gets the number of bodygroups" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetSequence, "Gets the current sequence" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetSequence, "Sets the current sequence" )
|
|
||||||
DEFINE_SCRIPTFUNC( SequenceLoops, "Does the current sequence loop?" )
|
|
||||||
DEFINE_SCRIPTFUNC( LookupSequence, "Gets the index of the specified sequence name" )
|
|
||||||
DEFINE_SCRIPTFUNC( LookupActivity, "Gets the ID of the specified activity name" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetSequenceName, "Gets the name of the specified sequence index" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetSequenceActivityName, "Gets the activity name of the specified sequence index" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceMoveDist, "GetSequenceMoveDist", "Gets the move distance of the specified sequence" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceActivity, "GetSequenceActivity", "Gets the activity ID of the specified sequence index" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSelectWeightedSequence, "SelectWeightedSequence", "Selects a sequence for the specified activity ID" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetPlaybackRate, "" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetPlaybackRate, "" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetCycle, "" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetCycle, "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSkin, "GetSkin", "Gets the model's skin" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetSkin, "Sets the model's skin" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetForceBone, "Gets the entity's force bone, which is used to determine which bone a ragdoll should apply its force to." )
|
|
||||||
DEFINE_SCRIPTFUNC( SetForceBone, "Sets the entity's force bone, which is used to determine which bone a ragdoll should apply its force to." )
|
|
||||||
DEFINE_SCRIPTFUNC( GetRagdollForce, "Gets the entity's ragdoll force, which is used to apply velocity to a ragdoll." )
|
|
||||||
DEFINE_SCRIPTFUNC( SetRagdollForce, "Sets the entity's ragdoll force, which is used to apply velocity to a ragdoll." )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptBecomeRagdollOnClient, "BecomeRagdollOnClient", "" )
|
|
||||||
DEFINE_SCRIPTFUNC( IsRagdoll, "" )
|
|
||||||
|
|
||||||
BEGIN_SCRIPTHOOK( C_BaseAnimating::g_Hook_OnClientRagdoll, "OnClientRagdoll", FIELD_VOID, "Called when this entity turns into a client-side ragdoll." )
|
|
||||||
DEFINE_SCRIPTHOOK_PARAM( "ragdoll", FIELD_HSCRIPT )
|
|
||||||
END_SCRIPTHOOK()
|
|
||||||
|
|
||||||
BEGIN_SCRIPTHOOK( C_BaseAnimating::g_Hook_FireEvent, "FireEvent", FIELD_BOOLEAN, "Called when handling animation events. Return false to cancel base handling." )
|
|
||||||
DEFINE_SCRIPTHOOK_PARAM( "origin", FIELD_VECTOR )
|
|
||||||
DEFINE_SCRIPTHOOK_PARAM( "angles", FIELD_VECTOR )
|
|
||||||
DEFINE_SCRIPTHOOK_PARAM( "event", FIELD_INTEGER )
|
|
||||||
DEFINE_SCRIPTHOOK_PARAM( "options", FIELD_CSTRING )
|
|
||||||
END_SCRIPTHOOK()
|
|
||||||
|
|
||||||
//BEGIN_SCRIPTHOOK( C_BaseAnimating::g_Hook_BuildTransformations, "BuildTransformations", FIELD_VOID, "Called when building bone transformations. Allows VScript to read/write any bone with Get/SetBoneTransform." )
|
|
||||||
//END_SCRIPTHOOK()
|
|
||||||
#endif
|
|
||||||
END_SCRIPTDESC();
|
END_SCRIPTDESC();
|
||||||
|
|
||||||
C_ClientRagdoll::C_ClientRagdoll( bool bRestoring )
|
C_ClientRagdoll::C_ClientRagdoll( bool bRestoring )
|
||||||
@ -380,9 +294,6 @@ C_ClientRagdoll::C_ClientRagdoll( bool bRestoring )
|
|||||||
m_bFadeOut = false;
|
m_bFadeOut = false;
|
||||||
m_bFadingOut = false;
|
m_bFadingOut = false;
|
||||||
m_bImportant = false;
|
m_bImportant = false;
|
||||||
#ifdef MAPBASE
|
|
||||||
m_flForcedRetireTime = 0.0f;
|
|
||||||
#endif
|
|
||||||
m_bNoModelParticles = false;
|
m_bNoModelParticles = false;
|
||||||
|
|
||||||
SetClassname("client_ragdoll");
|
SetClassname("client_ragdoll");
|
||||||
@ -463,11 +374,7 @@ void C_ClientRagdoll::OnRestore( void )
|
|||||||
|
|
||||||
if ( m_bFadeOut == true )
|
if ( m_bFadeOut == true )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
|
||||||
s_RagdollLRU.MoveToTopOfLRU( this, m_bImportant, m_flForcedRetireTime );
|
|
||||||
#else
|
|
||||||
s_RagdollLRU.MoveToTopOfLRU( this, m_bImportant );
|
s_RagdollLRU.MoveToTopOfLRU( this, m_bImportant );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NoteRagdollCreationTick( this );
|
NoteRagdollCreationTick( this );
|
||||||
@ -739,24 +646,6 @@ void C_ClientRagdoll::Release( void )
|
|||||||
BaseClass::Release();
|
BaseClass::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
HSCRIPT C_ClientRagdoll::ScriptGetRagdollObject( int iIndex )
|
|
||||||
{
|
|
||||||
if (iIndex < 0 || iIndex > m_pRagdoll->RagdollBoneCount())
|
|
||||||
{
|
|
||||||
Warning("%s GetRagdollObject: Index %i not valid (%i objects)\n", GetDebugName(), iIndex, m_pRagdoll->RagdollBoneCount());
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return g_pScriptVM->RegisterInstance( m_pRagdoll->GetElement(iIndex) );
|
|
||||||
}
|
|
||||||
|
|
||||||
int C_ClientRagdoll::ScriptGetRagdollObjectCount()
|
|
||||||
{
|
|
||||||
return m_pRagdoll->RagdollBoneCount();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Incremented each frame in InvalidateModelBones. Models compare this value to what it
|
// Incremented each frame in InvalidateModelBones. Models compare this value to what it
|
||||||
// was last time they setup their bones to determine if they need to re-setup their bones.
|
// was last time they setup their bones to determine if they need to re-setup their bones.
|
||||||
@ -794,10 +683,6 @@ C_BaseAnimating::C_BaseAnimating() :
|
|||||||
m_nPrevSequence = -1;
|
m_nPrevSequence = -1;
|
||||||
m_nRestoreSequence = -1;
|
m_nRestoreSequence = -1;
|
||||||
m_pRagdoll = NULL;
|
m_pRagdoll = NULL;
|
||||||
m_pClientsideRagdoll = NULL;
|
|
||||||
#ifdef MAPBASE
|
|
||||||
m_pServerRagdoll = NULL;
|
|
||||||
#endif
|
|
||||||
m_builtRagdoll = false;
|
m_builtRagdoll = false;
|
||||||
m_hitboxBoneCacheHandle = 0;
|
m_hitboxBoneCacheHandle = 0;
|
||||||
int i;
|
int i;
|
||||||
@ -1523,106 +1408,6 @@ float C_BaseAnimating::ClampCycle( float flCycle, bool isLooping )
|
|||||||
return flCycle;
|
return flCycle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose: Returns the world location and world angles of an attachment to vscript caller
|
|
||||||
// Input : attachment name
|
|
||||||
// Output : location and angles
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
const Vector& C_BaseAnimating::ScriptGetAttachmentOrigin( int iAttachment )
|
|
||||||
{
|
|
||||||
|
|
||||||
static Vector absOrigin;
|
|
||||||
static QAngle qa;
|
|
||||||
|
|
||||||
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
|
|
||||||
|
|
||||||
return absOrigin;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Vector& C_BaseAnimating::ScriptGetAttachmentAngles( int iAttachment )
|
|
||||||
{
|
|
||||||
|
|
||||||
static Vector absOrigin;
|
|
||||||
static Vector absAngles;
|
|
||||||
static QAngle qa;
|
|
||||||
|
|
||||||
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
|
|
||||||
absAngles.x = qa.x;
|
|
||||||
absAngles.y = qa.y;
|
|
||||||
absAngles.z = qa.z;
|
|
||||||
return absAngles;
|
|
||||||
}
|
|
||||||
|
|
||||||
HSCRIPT C_BaseAnimating::ScriptGetAttachmentMatrix( int iAttachment )
|
|
||||||
{
|
|
||||||
static matrix3x4_t matrix;
|
|
||||||
|
|
||||||
C_BaseAnimating::GetAttachment( iAttachment, matrix );
|
|
||||||
return g_pScriptVM->RegisterInstance( &matrix );
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_BaseAnimating::ScriptGetBoneTransform( int iBone, HSCRIPT hTransform )
|
|
||||||
{
|
|
||||||
matrix3x4_t *matTransform = HScriptToClass<matrix3x4_t>( hTransform );
|
|
||||||
if (matTransform == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GetBoneTransform( iBone, *matTransform );
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_BaseAnimating::ScriptSetBoneTransform( int iBone, HSCRIPT hTransform )
|
|
||||||
{
|
|
||||||
matrix3x4_t *matTransform = HScriptToClass<matrix3x4_t>( hTransform );
|
|
||||||
if (matTransform == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
MatrixCopy( *matTransform, GetBoneForWrite( iBone ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_BaseAnimating::ScriptAttachEntityToBone( HSCRIPT attachTarget, int boneIndexAttached, const Vector &bonePosition, const QAngle &boneAngles )
|
|
||||||
{
|
|
||||||
C_BaseEntity *pTarget = ToEnt( attachTarget );
|
|
||||||
if (pTarget == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
AttachEntityToBone( pTarget->GetBaseAnimating(), boneIndexAttached, bonePosition, boneAngles );
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_BaseAnimating::ScriptRemoveBoneAttachment( HSCRIPT boneAttachment )
|
|
||||||
{
|
|
||||||
C_BaseEntity *pTarget = ToEnt( boneAttachment );
|
|
||||||
if (pTarget == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
RemoveBoneAttachment( pTarget->GetBaseAnimating() );
|
|
||||||
}
|
|
||||||
|
|
||||||
HSCRIPT C_BaseAnimating::ScriptGetBoneAttachment( int i )
|
|
||||||
{
|
|
||||||
return ToHScript( GetBoneAttachment( i ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
HSCRIPT C_BaseAnimating::ScriptBecomeRagdollOnClient()
|
|
||||||
{
|
|
||||||
C_BaseAnimating *pRagdoll = BecomeRagdollOnClient();
|
|
||||||
if (!pRagdoll)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return pRagdoll->GetScriptInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
float C_BaseAnimating::ScriptGetPoseParameter( const char* szName )
|
|
||||||
{
|
|
||||||
CStudioHdr* pHdr = GetModelPtr();
|
|
||||||
if (pHdr == NULL)
|
|
||||||
return 0.0f;
|
|
||||||
|
|
||||||
int iPoseParam = LookupPoseParameter( pHdr, szName );
|
|
||||||
return GetPoseParameter( iPoseParam );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void C_BaseAnimating::ScriptSetPoseParameter(const char* szName, float fValue)
|
void C_BaseAnimating::ScriptSetPoseParameter(const char* szName, float fValue)
|
||||||
{
|
{
|
||||||
CStudioHdr* pHdr = GetModelPtr();
|
CStudioHdr* pHdr = GetModelPtr();
|
||||||
@ -1778,23 +1563,7 @@ void C_BaseAnimating::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quater
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
//if (m_ScriptScope.IsInitialized() && g_Hook_BuildTransformations.CanRunInScope(m_ScriptScope))
|
|
||||||
//{
|
|
||||||
// int oldWritableBones = m_BoneAccessor.GetWritableBones();
|
|
||||||
// int oldReadableBones = m_BoneAccessor.GetReadableBones();
|
|
||||||
// m_BoneAccessor.SetWritableBones( BONE_USED_BY_ANYTHING );
|
|
||||||
// m_BoneAccessor.SetReadableBones( BONE_USED_BY_ANYTHING );
|
|
||||||
//
|
|
||||||
// // No parameters
|
|
||||||
// //ScriptVariant_t args[] = {};
|
|
||||||
// //ScriptVariant_t returnValue;
|
|
||||||
// g_Hook_BuildTransformations.Call( m_ScriptScope, NULL, NULL /*&returnValue, args*/ );
|
|
||||||
//
|
|
||||||
// m_BoneAccessor.SetWritableBones( oldWritableBones );
|
|
||||||
// m_BoneAccessor.SetReadableBones( oldReadableBones );
|
|
||||||
//}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -2000,10 +1769,6 @@ CollideType_t C_BaseAnimating::GetCollideType( void )
|
|||||||
return BaseClass::GetCollideType();
|
return BaseClass::GetCollideType();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVar ai_death_pose_enabled( "ai_death_pose_enabled", "1", FCVAR_NONE, "Toggles the death pose fix code, which cancels sequence transitions while a NPC is ragdolling." );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: if the active sequence changes, keep track of the previous ones and decay them based on their decay rate
|
// Purpose: if the active sequence changes, keep track of the previous ones and decay them based on their decay rate
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -2020,14 +1785,6 @@ void C_BaseAnimating::MaintainSequenceTransitions( IBoneSetup &boneSetup, float
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if ( IsAboutToRagdoll() && ai_death_pose_enabled.GetBool() )
|
|
||||||
{
|
|
||||||
m_nPrevNewSequenceParity = m_nNewSequenceParity;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_SequenceTransitioner.CheckForSequenceChange(
|
m_SequenceTransitioner.CheckForSequenceChange(
|
||||||
boneSetup.GetStudioHdr(),
|
boneSetup.GetStudioHdr(),
|
||||||
GetSequence(),
|
GetSequence(),
|
||||||
@ -2807,29 +2564,14 @@ void C_BaseAnimating::CalculateIKLocks( float currentTime )
|
|||||||
|
|
||||||
// debugoverlay->AddBoxOverlay( origin, Vector( -1, -1, -1 ), Vector( 1, 1, 1 ), QAngle( 0, 0, 0 ), 255, 0, 0, 0, 0 );
|
// debugoverlay->AddBoxOverlay( origin, Vector( -1, -1, -1 ), Vector( 1, 1, 1 ), QAngle( 0, 0, 0 ), 255, 0, 0, 0, 0 );
|
||||||
|
|
||||||
Vector vecDelta = (origin - pTarget->est.pos);
|
float d = (pTarget->est.pos - origin).Length();
|
||||||
float d = vecDelta.Length();
|
|
||||||
|
|
||||||
if ( d >= flDist)
|
if ( d >= flDist)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
flDist = d;
|
flDist = d;
|
||||||
#ifdef MAPBASE
|
pTarget->SetPos( origin );
|
||||||
// For blending purposes, IK attachments should obey weight
|
pTarget->SetAngles( angles );
|
||||||
if ( pTarget->est.flWeight < 1.0f )
|
|
||||||
{
|
|
||||||
Quaternion qTarget;
|
|
||||||
AngleQuaternion( angles, qTarget );
|
|
||||||
|
|
||||||
QuaternionSlerp( pTarget->est.q, qTarget, pTarget->est.flWeight, pTarget->est.q );
|
|
||||||
pTarget->SetPos( pTarget->est.pos + (vecDelta * pTarget->est.flWeight) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
pTarget->SetPos( origin );
|
|
||||||
pTarget->SetAngles( angles );
|
|
||||||
}
|
|
||||||
// debugoverlay->AddBoxOverlay( pTarget->est.pos, Vector( -pTarget->est.radius, -pTarget->est.radius, -pTarget->est.radius ), Vector( pTarget->est.radius, pTarget->est.radius, pTarget->est.radius), QAngle( 0, 0, 0 ), 0, 255, 0, 0, 0 );
|
// debugoverlay->AddBoxOverlay( pTarget->est.pos, Vector( -pTarget->est.radius, -pTarget->est.radius, -pTarget->est.radius ), Vector( pTarget->est.radius, pTarget->est.radius, pTarget->est.radius), QAngle( 0, 0, 0 ), 0, 255, 0, 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3762,10 +3504,6 @@ void C_BaseAnimating::DoAnimationEvents( CStudioHdr *pStudioHdr )
|
|||||||
gpGlobals->curtime );
|
gpGlobals->curtime );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
if (ScriptHookFireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() ) == false)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() );
|
FireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() );
|
||||||
}
|
}
|
||||||
@ -3798,11 +3536,6 @@ void C_BaseAnimating::DoAnimationEvents( CStudioHdr *pStudioHdr )
|
|||||||
gpGlobals->curtime );
|
gpGlobals->curtime );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
if (ScriptHookFireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() ) == false)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() );
|
FireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3810,26 +3543,6 @@ void C_BaseAnimating::DoAnimationEvents( CStudioHdr *pStudioHdr )
|
|||||||
m_flPrevEventCycle = flEventCycle;
|
m_flPrevEventCycle = flEventCycle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BaseAnimating::ScriptHookFireEvent( const Vector& origin, const QAngle& angles, int event, const char *options )
|
|
||||||
{
|
|
||||||
if (m_ScriptScope.IsInitialized() && g_Hook_FireEvent.CanRunInScope(m_ScriptScope))
|
|
||||||
{
|
|
||||||
// origin, angles, event, options
|
|
||||||
ScriptVariant_t args[] = { origin, angles, event, options };
|
|
||||||
ScriptVariant_t returnValue = true;
|
|
||||||
g_Hook_FireEvent.Call( m_ScriptScope, &returnValue, args );
|
|
||||||
|
|
||||||
return returnValue.m_bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Parses a muzzle effect event and sends it out for drawing
|
// Purpose: Parses a muzzle effect event and sends it out for drawing
|
||||||
// Input : *options - event parameters in text format
|
// Input : *options - event parameters in text format
|
||||||
@ -4042,92 +3755,6 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
case AE_CL_STOP_PARTICLE_EFFECT:
|
|
||||||
{
|
|
||||||
char token[256];
|
|
||||||
char szParticleEffect[256];
|
|
||||||
|
|
||||||
// Get the particle effect name
|
|
||||||
const char *p = options;
|
|
||||||
p = nexttoken(token, p, ' ', sizeof(token));
|
|
||||||
if ( token )
|
|
||||||
{
|
|
||||||
Q_strncpy( szParticleEffect, token, sizeof(szParticleEffect) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the attachment point index
|
|
||||||
p = nexttoken(token, p, ' ', sizeof(token));
|
|
||||||
bool bStopInstantly = ( token && !Q_stricmp( token, "instantly" ) );
|
|
||||||
|
|
||||||
ParticleProp()->StopParticlesNamed( szParticleEffect, bStopInstantly );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AE_CL_ADD_PARTICLE_EFFECT_CP:
|
|
||||||
{
|
|
||||||
int iControlPoint = 1;
|
|
||||||
int iAttachment = -1;
|
|
||||||
int iAttachType = PATTACH_ABSORIGIN_FOLLOW;
|
|
||||||
int iEffectIndex = -1;
|
|
||||||
char token[256];
|
|
||||||
char szParticleEffect[256];
|
|
||||||
|
|
||||||
// Get the particle effect name
|
|
||||||
const char *p = options;
|
|
||||||
p = nexttoken(token, p, ' ', sizeof(token));
|
|
||||||
if ( token )
|
|
||||||
{
|
|
||||||
Q_strncpy( szParticleEffect, token, sizeof(szParticleEffect) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the control point number
|
|
||||||
p = nexttoken(token, p, ' ', sizeof(token));
|
|
||||||
if ( token )
|
|
||||||
{
|
|
||||||
iControlPoint = atoi( token );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the attachment type
|
|
||||||
p = nexttoken(token, p, ' ', sizeof(token));
|
|
||||||
if ( token )
|
|
||||||
{
|
|
||||||
iAttachType = GetAttachTypeFromString( token );
|
|
||||||
if ( iAttachType == -1 )
|
|
||||||
{
|
|
||||||
Warning("Invalid attach type specified for particle effect anim event. Trying to spawn effect '%s' with attach type of '%s'\n", szParticleEffect, token );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the attachment point index
|
|
||||||
p = nexttoken(token, p, ' ', sizeof(token));
|
|
||||||
if ( token )
|
|
||||||
{
|
|
||||||
iAttachment = atoi(token);
|
|
||||||
|
|
||||||
// See if we can find any attachment points matching the name
|
|
||||||
if ( token[0] != '0' && iAttachment == 0 )
|
|
||||||
{
|
|
||||||
iAttachment = LookupAttachment( token );
|
|
||||||
if ( iAttachment == -1 )
|
|
||||||
{
|
|
||||||
Warning("Failed to find attachment point specified for particle effect anim event. Trying to spawn effect '%s' on attachment named '%s'\n", szParticleEffect, token );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iEffectIndex = ParticleProp()->FindEffect( szParticleEffect );
|
|
||||||
if ( iEffectIndex == -1 )
|
|
||||||
{
|
|
||||||
Warning("Failed to find specified particle effect. Trying to add CP to '%s' on attachment named '%s'\n", szParticleEffect, token );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ParticleProp()->AddControlPoint( iEffectIndex, iControlPoint, this, (ParticleAttachment_t)iAttachType, iAttachment );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case AE_CL_PLAYSOUND:
|
case AE_CL_PLAYSOUND:
|
||||||
{
|
{
|
||||||
CLocalPlayerFilter filter;
|
CLocalPlayerFilter filter;
|
||||||
@ -4226,33 +3853,18 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
|
|||||||
|
|
||||||
// Eject brass
|
// Eject brass
|
||||||
case CL_EVENT_EJECTBRASS1:
|
case CL_EVENT_EJECTBRASS1:
|
||||||
|
if ( m_Attachments.Count() > 0 )
|
||||||
{
|
{
|
||||||
// Check if we're a weapon, if we belong to the local player, and if the local player is in third person - if all are true, don't do a muzzleflash in this instance, because
|
if ( MainViewOrigin().DistToSqr( GetAbsOrigin() ) < (256 * 256) )
|
||||||
// we're using the view models dispatch for smoothness.
|
|
||||||
if ( dynamic_cast< C_BaseCombatWeapon *>(this) != NULL )
|
|
||||||
{
|
{
|
||||||
C_BaseCombatWeapon *pWeapon = dynamic_cast< C_BaseCombatWeapon *>(this);
|
Vector attachOrigin;
|
||||||
if ( pWeapon && pWeapon->GetOwner() == C_BasePlayer::GetLocalPlayer() && ::input->CAM_IsThirdPerson() )
|
QAngle attachAngles;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ( prediction->InPrediction() && !prediction->IsFirstTimePredicted() ) )
|
if( GetAttachment( 2, attachOrigin, attachAngles ) )
|
||||||
break;
|
|
||||||
|
|
||||||
if ( m_Attachments.Count() > 0 )
|
|
||||||
{
|
|
||||||
if ( MainViewOrigin().DistToSqr( GetAbsOrigin() ) < (256 * 256) )
|
|
||||||
{
|
{
|
||||||
Vector attachOrigin;
|
tempents->EjectBrass( attachOrigin, attachAngles, GetAbsAngles(), atoi( options ) );
|
||||||
QAngle attachAngles;
|
|
||||||
|
|
||||||
if( GetAttachment( 2, attachOrigin, attachAngles ) )
|
|
||||||
{
|
|
||||||
tempents->EjectBrass( attachOrigin, attachAngles, GetAbsAngles(), atoi( options ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4266,36 +3878,6 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
|
|||||||
case AE_NPC_MUZZLEFLASH:
|
case AE_NPC_MUZZLEFLASH:
|
||||||
{
|
{
|
||||||
// Send out the effect for an NPC
|
// Send out the effect for an NPC
|
||||||
#if defined ( HL2MP ) || defined ( SDK_DLL ) // works for the modified CSS weapons included in the new template sdk.
|
|
||||||
// HL2MP - Make third person muzzleflashes as reliable as the first person ones
|
|
||||||
// while in third person the view model dispatches the muzzleflash event - note: the weapon models dispatch them too, but not frequently.
|
|
||||||
if ( IsViewModel() )
|
|
||||||
{
|
|
||||||
C_BasePlayer *pPlayer = ToBasePlayer( dynamic_cast<C_BaseViewModel *>(this)->GetOwner() );
|
|
||||||
if ( pPlayer && pPlayer == C_BasePlayer::GetLocalPlayer())
|
|
||||||
{
|
|
||||||
if ( ::input->CAM_IsThirdPerson() )
|
|
||||||
{
|
|
||||||
// Dispatch on the weapon - the player model doesn't have the attachments in hl2mp.
|
|
||||||
C_BaseCombatWeapon *pWeapon = pPlayer->GetActiveWeapon();
|
|
||||||
if ( !pWeapon )
|
|
||||||
break;
|
|
||||||
pWeapon->DispatchMuzzleEffect( options, false );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we're a weapon, if we belong to the local player, and if the local player is in third person - if all are true, don't do a muzzleflash in this instance, because
|
|
||||||
// we're using the view models dispatch for smoothness.
|
|
||||||
if ( dynamic_cast< C_BaseCombatWeapon *>(this) != NULL )
|
|
||||||
{
|
|
||||||
C_BaseCombatWeapon *pWeapon = dynamic_cast< C_BaseCombatWeapon *>(this);
|
|
||||||
if ( pWeapon && pWeapon->GetOwner() == C_BasePlayer::GetLocalPlayer() && ::input->CAM_IsThirdPerson() )
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
DispatchMuzzleEffect( options, false );
|
DispatchMuzzleEffect( options, false );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -4377,22 +3959,6 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
case AE_VSCRIPT_RUN:
|
|
||||||
{
|
|
||||||
if (!RunScript( options ))
|
|
||||||
Warning( "%s failed to run AE_VSCRIPT_RUN on client with \"%s\"\n", GetDebugName(), options );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AE_VSCRIPT_RUN_FILE:
|
|
||||||
{
|
|
||||||
if (!RunScriptFile( options ))
|
|
||||||
Warning( "%s failed to run AE_VSCRIPT_RUN_FILE on client with \"%s\"\n", GetDebugName(), options );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -5012,18 +4578,12 @@ void C_BaseAnimating::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
C_ClientRagdoll *C_BaseAnimating::CreateClientRagdoll( bool bRestoring )
|
|
||||||
{
|
|
||||||
//DevMsg( "Creating ragdoll at tick %d\n", gpGlobals->tickcount );
|
|
||||||
return new C_ClientRagdoll( bRestoring );
|
|
||||||
}
|
|
||||||
|
|
||||||
C_BaseAnimating *C_BaseAnimating::CreateRagdollCopy()
|
C_BaseAnimating *C_BaseAnimating::CreateRagdollCopy()
|
||||||
{
|
{
|
||||||
//Adrian: We now create a separate entity that becomes this entity's ragdoll.
|
//Adrian: We now create a separate entity that becomes this entity's ragdoll.
|
||||||
//That way the server side version of this entity can go away.
|
//That way the server side version of this entity can go away.
|
||||||
//Plus we can hook save/restore code to these ragdolls so they don't fall on restore anymore.
|
//Plus we can hook save/restore code to these ragdolls so they don't fall on restore anymore.
|
||||||
C_ClientRagdoll *pRagdoll = CreateClientRagdoll( false );
|
C_ClientRagdoll *pRagdoll = new C_ClientRagdoll( false );
|
||||||
if ( pRagdoll == NULL )
|
if ( pRagdoll == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -5091,26 +4651,15 @@ C_BaseAnimating *C_BaseAnimating::BecomeRagdollOnClient()
|
|||||||
{
|
{
|
||||||
MoveToLastReceivedPosition( true );
|
MoveToLastReceivedPosition( true );
|
||||||
GetAbsOrigin();
|
GetAbsOrigin();
|
||||||
m_pClientsideRagdoll = CreateRagdollCopy();
|
C_BaseAnimating *pRagdoll = CreateRagdollCopy();
|
||||||
|
|
||||||
matrix3x4_t boneDelta0[MAXSTUDIOBONES];
|
matrix3x4_t boneDelta0[MAXSTUDIOBONES];
|
||||||
matrix3x4_t boneDelta1[MAXSTUDIOBONES];
|
matrix3x4_t boneDelta1[MAXSTUDIOBONES];
|
||||||
matrix3x4_t currentBones[MAXSTUDIOBONES];
|
matrix3x4_t currentBones[MAXSTUDIOBONES];
|
||||||
const float boneDt = 0.1f;
|
const float boneDt = 0.1f;
|
||||||
GetRagdollInitBoneArrays( boneDelta0, boneDelta1, currentBones, boneDt );
|
GetRagdollInitBoneArrays( boneDelta0, boneDelta1, currentBones, boneDt );
|
||||||
m_pClientsideRagdoll->InitAsClientRagdoll( boneDelta0, boneDelta1, currentBones, boneDt );
|
pRagdoll->InitAsClientRagdoll( boneDelta0, boneDelta1, currentBones, boneDt );
|
||||||
|
return pRagdoll;
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
// Hook for ragdolling
|
|
||||||
if (m_ScriptScope.IsInitialized() && g_Hook_OnClientRagdoll.CanRunInScope( m_ScriptScope ))
|
|
||||||
{
|
|
||||||
// ragdoll
|
|
||||||
ScriptVariant_t args[] = { ScriptVariant_t( m_pClientsideRagdoll->GetScriptInstance() ) };
|
|
||||||
g_Hook_OnClientRagdoll.Call( m_ScriptScope, NULL, args );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return m_pClientsideRagdoll;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C_BaseAnimating::InitAsClientRagdoll( const matrix3x4_t *pDeltaBones0, const matrix3x4_t *pDeltaBones1, const matrix3x4_t *pCurrentBonePosition, float boneDt, bool bFixedConstraints )
|
bool C_BaseAnimating::InitAsClientRagdoll( const matrix3x4_t *pDeltaBones0, const matrix3x4_t *pDeltaBones1, const matrix3x4_t *pCurrentBonePosition, float boneDt, bool bFixedConstraints )
|
||||||
@ -5576,11 +5125,6 @@ void C_BaseAnimating::StudioFrameAdvance()
|
|||||||
|
|
||||||
if ( flNewCycle < 0.0f || flNewCycle >= 1.0f )
|
if ( flNewCycle < 0.0f || flNewCycle >= 1.0f )
|
||||||
{
|
{
|
||||||
if (flNewCycle >= 1.0f)
|
|
||||||
{
|
|
||||||
ReachedEndOfSequence();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( IsSequenceLooping( hdr, GetSequence() ) )
|
if ( IsSequenceLooping( hdr, GetSequence() ) )
|
||||||
{
|
{
|
||||||
flNewCycle -= (int)(flNewCycle);
|
flNewCycle -= (int)(flNewCycle);
|
||||||
|
@ -38,7 +38,6 @@ class C_BaseClientShader
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class IRagdoll;
|
class IRagdoll;
|
||||||
class C_ClientRagdoll;
|
|
||||||
class CIKContext;
|
class CIKContext;
|
||||||
class CIKState;
|
class CIKState;
|
||||||
class ConVar;
|
class ConVar;
|
||||||
@ -80,7 +79,7 @@ public:
|
|||||||
QAngle m_angRotation;
|
QAngle m_angRotation;
|
||||||
Vector m_vOriginVelocity;
|
Vector m_vOriginVelocity;
|
||||||
int m_nLastFramecount : 31;
|
int m_nLastFramecount : 31;
|
||||||
bool m_bAnglesComputed : 1;
|
int m_bAnglesComputed : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -165,17 +164,6 @@ public:
|
|||||||
virtual void FireObsoleteEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
|
virtual void FireObsoleteEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
|
||||||
virtual const char* ModifyEventParticles( const char* token ) { return token; }
|
virtual const char* ModifyEventParticles( const char* token ) { return token; }
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
bool ScriptHookFireEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined ( SDK_DLL ) || defined ( HL2MP )
|
|
||||||
virtual void ResetEventsParity() { m_nPrevResetEventsParity = -1; } // used to force animation events to function on players so the muzzleflashes and other events occur
|
|
||||||
// so new functions don't have to be made to parse the models like CSS does in ProcessMuzzleFlashEvent
|
|
||||||
// allows the multiplayer world weapon models to declare the muzzleflashes, and other effects like sp
|
|
||||||
// without the need to script it and add extra parsing code.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Parses and distributes muzzle flash events
|
// Parses and distributes muzzle flash events
|
||||||
virtual bool DispatchMuzzleEffect( const char *options, bool isFirstPerson );
|
virtual bool DispatchMuzzleEffect( const char *options, bool isFirstPerson );
|
||||||
|
|
||||||
@ -302,7 +290,6 @@ public:
|
|||||||
bool IsRagdoll() const;
|
bool IsRagdoll() const;
|
||||||
bool IsAboutToRagdoll() const;
|
bool IsAboutToRagdoll() const;
|
||||||
virtual C_BaseAnimating *BecomeRagdollOnClient();
|
virtual C_BaseAnimating *BecomeRagdollOnClient();
|
||||||
virtual C_ClientRagdoll *CreateClientRagdoll( bool bRestoring = false );
|
|
||||||
C_BaseAnimating *CreateRagdollCopy();
|
C_BaseAnimating *CreateRagdollCopy();
|
||||||
bool InitAsClientRagdoll( const matrix3x4_t *pDeltaBones0, const matrix3x4_t *pDeltaBones1, const matrix3x4_t *pCurrentBonePosition, float boneDt, bool bFixedConstraints=false );
|
bool InitAsClientRagdoll( const matrix3x4_t *pDeltaBones0, const matrix3x4_t *pDeltaBones1, const matrix3x4_t *pCurrentBonePosition, float boneDt, bool bFixedConstraints=false );
|
||||||
void IgniteRagdoll( C_BaseAnimating *pSource );
|
void IgniteRagdoll( C_BaseAnimating *pSource );
|
||||||
@ -356,8 +343,6 @@ public:
|
|||||||
void ClientSideAnimationChanged();
|
void ClientSideAnimationChanged();
|
||||||
virtual unsigned int ComputeClientSideAnimationFlags();
|
virtual unsigned int ComputeClientSideAnimationFlags();
|
||||||
|
|
||||||
virtual void ReachedEndOfSequence() { return; }
|
|
||||||
|
|
||||||
virtual void ResetClientsideFrame( void ) { SetCycle( 0 ); }
|
virtual void ResetClientsideFrame( void ) { SetCycle( 0 ); }
|
||||||
|
|
||||||
void SetCycle( float flCycle );
|
void SetCycle( float flCycle );
|
||||||
@ -461,40 +446,6 @@ public:
|
|||||||
|
|
||||||
virtual bool IsViewModel() const;
|
virtual bool IsViewModel() const;
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
int ScriptLookupAttachment( const char *pAttachmentName ) { return LookupAttachment( pAttachmentName ); }
|
|
||||||
const Vector& ScriptGetAttachmentOrigin(int iAttachment);
|
|
||||||
const Vector& ScriptGetAttachmentAngles(int iAttachment);
|
|
||||||
HSCRIPT ScriptGetAttachmentMatrix(int iAttachment);
|
|
||||||
|
|
||||||
void ScriptGetBoneTransform( int iBone, HSCRIPT hTransform );
|
|
||||||
void ScriptSetBoneTransform( int iBone, HSCRIPT hTransform );
|
|
||||||
|
|
||||||
void ScriptAttachEntityToBone( HSCRIPT attachTarget, int boneIndexAttached, const Vector &bonePosition, const QAngle &boneAngles );
|
|
||||||
void ScriptRemoveBoneAttachment( HSCRIPT boneAttachment );
|
|
||||||
HSCRIPT ScriptGetBoneAttachment( int i );
|
|
||||||
|
|
||||||
int ScriptGetSequenceActivity( int iSequence ) { return GetSequenceActivity( iSequence ); }
|
|
||||||
float ScriptGetSequenceMoveDist( int iSequence ) { return GetSequenceMoveDist( GetModelPtr(), iSequence ); }
|
|
||||||
int ScriptSelectWeightedSequence( int activity ) { return SelectWeightedSequence( (Activity)activity ); }
|
|
||||||
|
|
||||||
// For VScript
|
|
||||||
int ScriptGetSkin() { return GetSkin(); }
|
|
||||||
void SetSkin( int iSkin ) { m_nSkin = iSkin; }
|
|
||||||
|
|
||||||
int GetForceBone() { return m_nForceBone; }
|
|
||||||
void SetForceBone( int iBone ) { m_nForceBone = iBone; }
|
|
||||||
const Vector& GetRagdollForce() { return m_vecForce; }
|
|
||||||
void SetRagdollForce( const Vector &vecForce ) { m_vecForce = vecForce; }
|
|
||||||
|
|
||||||
HSCRIPT ScriptBecomeRagdollOnClient();
|
|
||||||
|
|
||||||
static ScriptHook_t g_Hook_OnClientRagdoll;
|
|
||||||
static ScriptHook_t g_Hook_FireEvent;
|
|
||||||
//static ScriptHook_t g_Hook_BuildTransformations; // UNDONE: Thread access issues
|
|
||||||
|
|
||||||
float ScriptGetPoseParameter(const char* szName);
|
|
||||||
#endif
|
|
||||||
void ScriptSetPoseParameter(const char* szName, float fValue);
|
void ScriptSetPoseParameter(const char* szName, float fValue);
|
||||||
protected:
|
protected:
|
||||||
// View models scale their attachment positions to account for FOV. To get the unmodified
|
// View models scale their attachment positions to account for FOV. To get the unmodified
|
||||||
@ -531,10 +482,6 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CRagdoll *m_pRagdoll;
|
CRagdoll *m_pRagdoll;
|
||||||
C_BaseAnimating *m_pClientsideRagdoll; // From Alien Swarm SDK
|
|
||||||
#ifdef MAPBASE
|
|
||||||
C_BaseAnimating *m_pServerRagdoll; // Not from Alien Swarm SDK (note that this can exist without the entity having died)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Texture group to use
|
// Texture group to use
|
||||||
int m_nSkin;
|
int m_nSkin;
|
||||||
@ -706,9 +653,6 @@ public:
|
|||||||
C_ClientRagdoll( bool bRestoring = true );
|
C_ClientRagdoll( bool bRestoring = true );
|
||||||
DECLARE_CLASS( C_ClientRagdoll, C_BaseAnimating );
|
DECLARE_CLASS( C_ClientRagdoll, C_BaseAnimating );
|
||||||
DECLARE_DATADESC();
|
DECLARE_DATADESC();
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
DECLARE_ENT_SCRIPTDESC();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// inherited from IPVSNotify
|
// inherited from IPVSNotify
|
||||||
virtual void OnPVSStatusChanged( bool bInPVS );
|
virtual void OnPVSStatusChanged( bool bInPVS );
|
||||||
@ -730,17 +674,8 @@ public:
|
|||||||
void FadeOut( void );
|
void FadeOut( void );
|
||||||
virtual float LastBoneChangedTime();
|
virtual float LastBoneChangedTime();
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
HSCRIPT ScriptGetRagdollObject( int iIndex );
|
|
||||||
int ScriptGetRagdollObjectCount();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool m_bFadeOut;
|
bool m_bFadeOut;
|
||||||
bool m_bImportant;
|
bool m_bImportant;
|
||||||
#ifdef MAPBASE
|
|
||||||
// Required to save/restore Alien Swarm SDK ragdoll LRU forced fade
|
|
||||||
float m_flForcedRetireTime;
|
|
||||||
#endif
|
|
||||||
float m_flEffectTime;
|
float m_flEffectTime;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -34,10 +34,6 @@ C_BaseCombatCharacter::C_BaseCombatCharacter()
|
|||||||
m_pGlowEffect = NULL;
|
m_pGlowEffect = NULL;
|
||||||
m_bGlowEnabled = false;
|
m_bGlowEnabled = false;
|
||||||
m_bOldGlowEnabled = false;
|
m_bOldGlowEnabled = false;
|
||||||
m_GlowColor.Init( 0.76f, 0.76f, 0.76f );
|
|
||||||
m_OldGlowColor = m_GlowColor;
|
|
||||||
m_GlowAlpha = 1.0f;
|
|
||||||
m_OldGlowAlpha = 1.0f;
|
|
||||||
#endif // GLOWS_ENABLE
|
#endif // GLOWS_ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,8 +66,6 @@ void C_BaseCombatCharacter::OnPreDataChanged( DataUpdateType_t updateType )
|
|||||||
|
|
||||||
#ifdef GLOWS_ENABLE
|
#ifdef GLOWS_ENABLE
|
||||||
m_bOldGlowEnabled = m_bGlowEnabled;
|
m_bOldGlowEnabled = m_bGlowEnabled;
|
||||||
m_OldGlowColor = m_GlowColor;
|
|
||||||
m_OldGlowAlpha = m_GlowAlpha;
|
|
||||||
#endif // GLOWS_ENABLE
|
#endif // GLOWS_ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +77,7 @@ void C_BaseCombatCharacter::OnDataChanged( DataUpdateType_t updateType )
|
|||||||
BaseClass::OnDataChanged( updateType );
|
BaseClass::OnDataChanged( updateType );
|
||||||
|
|
||||||
#ifdef GLOWS_ENABLE
|
#ifdef GLOWS_ENABLE
|
||||||
if ( m_bOldGlowEnabled != m_bGlowEnabled || m_OldGlowColor != m_GlowColor || m_OldGlowAlpha != m_GlowAlpha )
|
if ( m_bOldGlowEnabled != m_bGlowEnabled )
|
||||||
{
|
{
|
||||||
UpdateGlowEffect();
|
UpdateGlowEffect();
|
||||||
}
|
}
|
||||||
@ -112,13 +106,11 @@ void C_BaseCombatCharacter::DoMuzzleFlash()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void C_BaseCombatCharacter::GetGlowEffectColor( float *r, float *g, float *b, float *a )
|
void C_BaseCombatCharacter::GetGlowEffectColor( float *r, float *g, float *b )
|
||||||
{
|
{
|
||||||
*r = m_GlowColor.x;
|
*r = 0.76f;
|
||||||
*g = m_GlowColor.y;
|
*g = 0.76f;
|
||||||
*b = m_GlowColor.z;
|
*b = 0.76f;
|
||||||
if (a)
|
|
||||||
*a = m_GlowAlpha;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -135,10 +127,10 @@ void C_BaseCombatCharacter::UpdateGlowEffect( void )
|
|||||||
// create a new effect
|
// create a new effect
|
||||||
if ( m_bGlowEnabled )
|
if ( m_bGlowEnabled )
|
||||||
{
|
{
|
||||||
float r, g, b, a;
|
float r, g, b;
|
||||||
GetGlowEffectColor( &r, &g, &b, &a );
|
GetGlowEffectColor( &r, &g, &b );
|
||||||
|
|
||||||
m_pGlowEffect = new CGlowObject( this, Vector( r, g, b ), a, true );
|
m_pGlowEffect = new CGlowObject( this, Vector( r, g, b ), 1.0, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,8 +161,6 @@ BEGIN_RECV_TABLE(C_BaseCombatCharacter, DT_BaseCombatCharacter)
|
|||||||
RecvPropArray3( RECVINFO_ARRAY(m_hMyWeapons), RecvPropEHandle( RECVINFO( m_hMyWeapons[0] ) ) ),
|
RecvPropArray3( RECVINFO_ARRAY(m_hMyWeapons), RecvPropEHandle( RECVINFO( m_hMyWeapons[0] ) ) ),
|
||||||
#ifdef GLOWS_ENABLE
|
#ifdef GLOWS_ENABLE
|
||||||
RecvPropBool( RECVINFO( m_bGlowEnabled ) ),
|
RecvPropBool( RECVINFO( m_bGlowEnabled ) ),
|
||||||
RecvPropVector( RECVINFO( m_GlowColor ) ),
|
|
||||||
RecvPropFloat( RECVINFO( m_GlowAlpha ) ),
|
|
||||||
#endif // GLOWS_ENABLE
|
#endif // GLOWS_ENABLE
|
||||||
|
|
||||||
#ifdef INVASION_CLIENT_DLL
|
#ifdef INVASION_CLIENT_DLL
|
||||||
@ -188,39 +178,3 @@ BEGIN_PREDICTION_DATA( C_BaseCombatCharacter )
|
|||||||
DEFINE_PRED_ARRAY( m_hMyWeapons, FIELD_EHANDLE, MAX_WEAPONS, FTYPEDESC_INSENDTABLE ),
|
DEFINE_PRED_ARRAY( m_hMyWeapons, FIELD_EHANDLE, MAX_WEAPONS, FTYPEDESC_INSENDTABLE ),
|
||||||
|
|
||||||
END_PREDICTION_DATA()
|
END_PREDICTION_DATA()
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
|
|
||||||
BEGIN_ENT_SCRIPTDESC( C_BaseCombatCharacter, C_BaseAnimating, "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAmmoCount, "GetAmmoCount", "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetActiveWeapon, "GetActiveWeapon", "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetWeapon, "GetWeapon", "" )
|
|
||||||
END_SCRIPTDESC();
|
|
||||||
|
|
||||||
|
|
||||||
int C_BaseCombatCharacter::ScriptGetAmmoCount( int i )
|
|
||||||
{
|
|
||||||
Assert( i == -1 || i < MAX_AMMO_SLOTS );
|
|
||||||
|
|
||||||
if ( i < 0 || i >= MAX_AMMO_SLOTS )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return GetAmmoCount( i );
|
|
||||||
}
|
|
||||||
|
|
||||||
HSCRIPT C_BaseCombatCharacter::ScriptGetActiveWeapon()
|
|
||||||
{
|
|
||||||
return ToHScript( GetActiveWeapon() );
|
|
||||||
}
|
|
||||||
|
|
||||||
HSCRIPT C_BaseCombatCharacter::ScriptGetWeapon( int i )
|
|
||||||
{
|
|
||||||
Assert( i >= 0 && i < MAX_WEAPONS );
|
|
||||||
|
|
||||||
if ( i < 0 || i >= MAX_WEAPONS )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return ToHScript( GetWeapon(i) );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -29,9 +29,6 @@ class C_BaseCombatCharacter : public C_BaseFlex
|
|||||||
public:
|
public:
|
||||||
DECLARE_CLIENTCLASS();
|
DECLARE_CLIENTCLASS();
|
||||||
DECLARE_PREDICTABLE();
|
DECLARE_PREDICTABLE();
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
DECLARE_ENT_SCRIPTDESC();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
C_BaseCombatCharacter( void );
|
C_BaseCombatCharacter( void );
|
||||||
virtual ~C_BaseCombatCharacter( void );
|
virtual ~C_BaseCombatCharacter( void );
|
||||||
@ -99,15 +96,9 @@ public:
|
|||||||
|
|
||||||
#ifdef GLOWS_ENABLE
|
#ifdef GLOWS_ENABLE
|
||||||
CGlowObject *GetGlowObject( void ){ return m_pGlowEffect; }
|
CGlowObject *GetGlowObject( void ){ return m_pGlowEffect; }
|
||||||
virtual void GetGlowEffectColor( float *r, float *g, float *b, float *a = NULL );
|
virtual void GetGlowEffectColor( float *r, float *g, float *b );
|
||||||
#endif // GLOWS_ENABLE
|
#endif // GLOWS_ENABLE
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
int ScriptGetAmmoCount( int i );
|
|
||||||
HSCRIPT ScriptGetActiveWeapon();
|
|
||||||
HSCRIPT ScriptGetWeapon( int i );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
float m_flNextAttack;
|
float m_flNextAttack;
|
||||||
@ -133,10 +124,6 @@ private:
|
|||||||
bool m_bGlowEnabled;
|
bool m_bGlowEnabled;
|
||||||
bool m_bOldGlowEnabled;
|
bool m_bOldGlowEnabled;
|
||||||
CGlowObject *m_pGlowEffect;
|
CGlowObject *m_pGlowEffect;
|
||||||
Vector m_GlowColor;
|
|
||||||
Vector m_OldGlowColor;
|
|
||||||
float m_GlowAlpha;
|
|
||||||
int m_OldGlowAlpha;
|
|
||||||
#endif // GLOWS_ENABLE
|
#endif // GLOWS_ENABLE
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -85,7 +85,9 @@ static inline bool ShouldDrawLocalPlayerViewModel( void )
|
|||||||
{
|
{
|
||||||
#if defined( PORTAL )
|
#if defined( PORTAL )
|
||||||
return false;
|
return false;
|
||||||
#elif MAPBASE
|
#else
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
// We shouldn't draw the viewmodel externally.
|
// We shouldn't draw the viewmodel externally.
|
||||||
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
||||||
if (localplayer)
|
if (localplayer)
|
||||||
@ -99,13 +101,15 @@ static inline bool ShouldDrawLocalPlayerViewModel( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Since we already have the local player, check its own ShouldDrawThisPlayer() to avoid extra checks
|
// Since we already have the local player, check its own ShouldDrawThisPlayer() to avoid extra checks
|
||||||
return !localplayer->ShouldDrawThisPlayer();
|
return localplayer->ShouldDrawThisPlayer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
return !C_BasePlayer::ShouldDrawLocalPlayer();
|
return !C_BasePlayer::ShouldDrawLocalPlayer();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -125,15 +129,9 @@ void C_BaseCombatWeapon::OnRestore()
|
|||||||
|
|
||||||
int C_BaseCombatWeapon::GetWorldModelIndex( void )
|
int C_BaseCombatWeapon::GetWorldModelIndex( void )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
|
||||||
int iIndex = GetOwner() ? m_iWorldModelIndex.Get() : m_iDroppedModelIndex.Get();
|
|
||||||
#else
|
|
||||||
int iIndex = m_iWorldModelIndex.Get();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( GameRules() )
|
if ( GameRules() )
|
||||||
{
|
{
|
||||||
const char *pBaseName = modelinfo->GetModelName( modelinfo->GetModel( iIndex ) );
|
const char *pBaseName = modelinfo->GetModelName( modelinfo->GetModel( m_iWorldModelIndex ) );
|
||||||
const char *pTranslatedName = GameRules()->TranslateEffectForVisionFilter( "weapons", pBaseName );
|
const char *pTranslatedName = GameRules()->TranslateEffectForVisionFilter( "weapons", pBaseName );
|
||||||
|
|
||||||
if ( pTranslatedName != pBaseName )
|
if ( pTranslatedName != pBaseName )
|
||||||
@ -142,7 +140,7 @@ int C_BaseCombatWeapon::GetWorldModelIndex( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return iIndex;
|
return m_iWorldModelIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -183,8 +181,11 @@ void C_BaseCombatWeapon::OnDataChanged( DataUpdateType_t updateType )
|
|||||||
}
|
}
|
||||||
else // weapon carried by other player or not at all
|
else // weapon carried by other player or not at all
|
||||||
{
|
{
|
||||||
// See comment below
|
int overrideModelIndex = CalcOverrideModelIndex();
|
||||||
EnsureCorrectRenderingModel();
|
if( overrideModelIndex != -1 && overrideModelIndex != GetModelIndex() )
|
||||||
|
{
|
||||||
|
SetModelIndex( overrideModelIndex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateVisibility();
|
UpdateVisibility();
|
||||||
@ -508,44 +509,25 @@ int C_BaseCombatWeapon::DrawModel( int flags )
|
|||||||
// check if local player chases owner of this weapon in first person
|
// check if local player chases owner of this weapon in first person
|
||||||
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
||||||
|
|
||||||
if ( localplayer )
|
if ( localplayer && localplayer->IsObserver() && GetOwner() )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
if (localplayer->m_bDrawPlayerModelExternally)
|
if (localplayer->m_bDrawPlayerModelExternally)
|
||||||
{
|
{
|
||||||
// If this isn't the main view, draw the weapon.
|
// If this isn't the main view, draw the weapon.
|
||||||
view_id_t viewID = CurrentViewID();
|
view_id_t viewID = CurrentViewID();
|
||||||
if ( (!localplayer->InFirstPersonView() || (viewID != VIEW_MAIN && viewID != VIEW_INTRO_CAMERA)) && (viewID != VIEW_SHADOW_DEPTH_TEXTURE || !localplayer->IsEffectActive(EF_DIMLIGHT)) )
|
if (viewID != VIEW_MAIN && viewID != VIEW_INTRO_CAMERA)
|
||||||
{
|
return BaseClass::DrawModel( flags );
|
||||||
// TODO: Is this inefficient?
|
|
||||||
int nModelIndex = GetModelIndex();
|
|
||||||
int nWorldModelIndex = GetWorldModelIndex();
|
|
||||||
if (nModelIndex != nWorldModelIndex)
|
|
||||||
{
|
|
||||||
SetModelIndex(nWorldModelIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
int iDraw = BaseClass::DrawModel(flags);
|
|
||||||
|
|
||||||
if (nModelIndex != nWorldModelIndex)
|
|
||||||
{
|
|
||||||
SetModelIndex(nModelIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return iDraw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ( localplayer->IsObserver() && GetOwner() )
|
|
||||||
{
|
|
||||||
// don't draw weapon if chasing this guy as spectator
|
|
||||||
// we don't check that in ShouldDraw() since this may change
|
|
||||||
// without notification
|
|
||||||
|
|
||||||
if ( localplayer->GetObserverMode() == OBS_MODE_IN_EYE &&
|
// don't draw weapon if chasing this guy as spectator
|
||||||
localplayer->GetObserverTarget() == GetOwner() )
|
// we don't check that in ShouldDraw() since this may change
|
||||||
return false;
|
// without notification
|
||||||
}
|
|
||||||
|
if ( localplayer->GetObserverMode() == OBS_MODE_IN_EYE &&
|
||||||
|
localplayer->GetObserverTarget() == GetOwner() )
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return BaseClass::DrawModel( flags );
|
return BaseClass::DrawModel( flags );
|
||||||
@ -573,35 +555,6 @@ int C_BaseCombatWeapon::CalcOverrideModelIndex()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// If the local player is visible (thirdperson mode, tf2 taunts, etc., then make sure that we are using the
|
|
||||||
// w_ (world) model not the v_ (view) model or else the model can flicker, etc.
|
|
||||||
// Otherwise, if we're not the local player, always use the world model
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void C_BaseCombatWeapon::EnsureCorrectRenderingModel()
|
|
||||||
{
|
|
||||||
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
|
||||||
if ( localplayer &&
|
|
||||||
localplayer == GetOwner() &&
|
|
||||||
!ShouldDrawUsingViewModel() )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// BRJ 10/14/02
|
|
||||||
// FIXME: Remove when Yahn's client-side prediction is done
|
|
||||||
// It's a hacky workaround for the model indices fighting
|
|
||||||
// (GetRenderBounds uses the model index, which is for the view model)
|
|
||||||
SetModelIndex( GetWorldModelIndex() );
|
|
||||||
|
|
||||||
// Validate our current sequence just in case ( in theory the view and weapon models should have the same sequences for sequences that overlap at least )
|
|
||||||
CStudioHdr *pStudioHdr = GetModelPtr();
|
|
||||||
if ( pStudioHdr &&
|
|
||||||
GetSequence() >= pStudioHdr->GetNumSeq() )
|
|
||||||
{
|
|
||||||
SetSequence( 0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// tool recording
|
// tool recording
|
||||||
|
@ -43,9 +43,6 @@
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
#include "viewrender.h"
|
#include "viewrender.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
#include "vscript_client.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gamestringpool.h"
|
#include "gamestringpool.h"
|
||||||
|
|
||||||
@ -428,35 +425,19 @@ BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_AnimTimeMustBeFirst )
|
|||||||
RecvPropInt( RECVINFO(m_flAnimTime), 0, RecvProxy_AnimTime ),
|
RecvPropInt( RECVINFO(m_flAnimTime), 0, RecvProxy_AnimTime ),
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
ScriptHook_t C_BaseEntity::g_Hook_UpdateOnRemove;
|
|
||||||
ScriptHook_t C_BaseEntity::g_Hook_ModifyEmitSoundParams;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BEGIN_ENT_SCRIPTDESC_ROOT( C_BaseEntity, "Root class of all client-side entities" )
|
BEGIN_ENT_SCRIPTDESC_ROOT( C_BaseEntity, "Root class of all client-side entities" )
|
||||||
DEFINE_SCRIPT_INSTANCE_HELPER( &g_BaseEntityScriptInstanceHelper )
|
DEFINE_SCRIPTFUNC_NAMED( GetAbsOrigin, "GetOrigin", "" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetAbsOrigin, "GetOrigin", "" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetForward, "GetForwardVector", "Get the forward vector of the entity" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetForward, "GetForwardVector", "Get the forward vector of the entity" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetLeft, "GetLeftVector", "Get the left vector of the entity" )
|
||||||
#ifdef MAPBASE_VSCRIPT
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetUp, "GetUpVector", "Get the up vector of the entity" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRight, "GetRightVector", "Get the right vector of the entity" )
|
DEFINE_SCRIPTFUNC( GetTeamNumber, "Gets this entity's team" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetTeamNumber, "GetTeam", "Gets this entity's team" )
|
|
||||||
#endif
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetLeft, "GetLeftVector", SCRIPT_HIDE )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetTeamNumber, "GetTeamNumber", SCRIPT_HIDE )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetUp, "GetUpVector", "Get the up vector of the entity" )
|
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
DEFINE_SCRIPTFUNC( ValidateScriptScope, "Ensure that an entity's script scope has been created" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetOrCreatePrivateScriptScope, "Create and retrieve the script-side data associated with an entity" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetScriptScope, "Retrieve the script-side data associated with an entity" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetHealth, "" )
|
DEFINE_SCRIPTFUNC( GetHealth, "" )
|
||||||
DEFINE_SCRIPTFUNC( GetMaxHealth, "" )
|
DEFINE_SCRIPTFUNC( GetMaxHealth, "" )
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetModelName, "GetModelName", "Returns the name of the model" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetModelName, "GetModelName", "Returns the name of the model" )
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptStopSound, "StopSound", "Stops a sound from this entity." )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptEmitSound, "EmitSound", "Plays a sound from this entity." )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptEmitSound, "EmitSound", "Plays a sound from this entity." )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( VScriptPrecacheScriptSound, "PrecacheSoundScript", "Precache a sound for later playing." )
|
DEFINE_SCRIPTFUNC_NAMED( VScriptPrecacheScriptSound, "PrecacheSoundScript", "Precache a sound for later playing." )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSoundDuration, "GetSoundDuration", "Returns float duration of the sound. Takes soundname and optional actormodelname." )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptSoundDuration, "GetSoundDuration", "Returns float duration of the sound. Takes soundname and optional actormodelname." )
|
||||||
@ -464,111 +445,21 @@ BEGIN_ENT_SCRIPTDESC_ROOT( C_BaseEntity, "Root class of all client-side entities
|
|||||||
DEFINE_SCRIPTFUNC( GetClassname, "" )
|
DEFINE_SCRIPTFUNC( GetClassname, "" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetEntityName, "GetName", "" )
|
DEFINE_SCRIPTFUNC_NAMED( GetEntityName, "GetName", "" )
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( SetAbsOrigin, "SetOrigin", "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetForward, "SetForwardVector", "Set the orientation of the entity to have this forward vector" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetLocalOrigin, "GetLocalOrigin" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetLocalOrigin, "SetLocalOrigin" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetLocalAngles, "GetLocalAngles" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetLocalAngles, "SetLocalAngles" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( WorldSpaceCenter, "GetCenter", "Get vector to center of object - absolute coords" )
|
DEFINE_SCRIPTFUNC_NAMED( WorldSpaceCenter, "GetCenter", "Get vector to center of object - absolute coords" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptEyePosition, "EyePosition", "Get vector to eye position - absolute coords" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptEyePosition, "EyePosition", "Get vector to eye position - absolute coords" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptEyeAngles, "EyeAngles", "Get eye pitch, yaw, roll as a vector" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAngles, "GetAngles", "Get entity pitch, yaw, roll as a vector" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetAbsAngles, "GetAngles", "Get entity pitch, yaw, roll as a vector" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( SetAbsAngles, "SetAngles", "Set entity pitch, yaw, roll" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( SetSize, "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoundingMins, "GetBoundingMins", "Get a vector containing min bounds, centered on object" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoundingMins, "GetBoundingMins", "Get a vector containing min bounds, centered on object" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoundingMaxs, "GetBoundingMaxs", "Get a vector containing max bounds, centered on object" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoundingMaxs, "GetBoundingMaxs", "Get a vector containing max bounds, centered on object" )
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptEntityToWorldTransform, "EntityToWorldTransform", "Get the entity's transform" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetPhysicsObject, "GetPhysicsObject", "Get the entity's physics object if it has one" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptPhysicsInitNormal, "PhysicsInitNormal", "Initializes the entity's physics object with the specified solid type, solid flags, and whether to start asleep" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptPhysicsDestroyObject, "PhysicsDestroyObject", "Destroys the entity's physics object" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetWaterLevel, "Get current level of water submergence" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetParent, "SetParent", "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetMoveParent, "GetMoveParent", "If in hierarchy, retrieves the entity's parent" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetMoveParent, "GetMoveParent", "If in hierarchy, retrieves the entity's parent" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRootMoveParent, "GetRootMoveParent", "If in hierarchy, walks up the hierarchy to find the root parent" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRootMoveParent, "GetRootMoveParent", "If in hierarchy, walks up the hierarchy to find the root parent" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptFirstMoveChild, "FirstMoveChild", "" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptFirstMoveChild, "FirstMoveChild", "" )
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptNextMovePeer, "NextMovePeer", "" )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptNextMovePeer, "NextMovePeer", "" )
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptFollowEntity, "FollowEntity", "Begin following the specified entity. This makes this entity non-solid, parents it to the target entity, and teleports it to the specified entity's origin. The second parameter is whether or not to use bonemerging while following." )
|
|
||||||
DEFINE_SCRIPTFUNC( StopFollowingEntity, "Stops following an entity if we're following one." )
|
|
||||||
DEFINE_SCRIPTFUNC( IsFollowingEntity, "Returns true if this entity is following another entity." )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetFollowedEntity, "GetFollowedEntity", "Get the entity we're following." )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetScriptOwnerEntity, "GetOwner", "Gets this entity's owner" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( SetScriptOwnerEntity, "SetOwner", "Sets this entity's owner" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetGroundEntity, "GetGroundEntity", "Get the entity we're standing on." )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetGroundEntity, "SetGroundEntity", "Set the entity we're standing on." )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorVector, "GetRenderColorVector", "Get the render color as a vector" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorR, "GetRenderColorR", "Get the render color's R value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorG, "GetRenderColorG", "Get the render color's G value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorB, "GetRenderColorB", "Get the render color's B value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAlpha, "GetRenderAlpha", "Get the render color's alpha value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorVector, "SetRenderColorVector", "Set the render color as a vector" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColor, "SetRenderColor", "Set the render color" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorR, "SetRenderColorR", "Set the render color's R value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorG, "SetRenderColorG", "Set the render color's G value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorB, "SetRenderColorB", "Set the render color's B value" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetAlpha, "SetRenderAlpha", "Set the render color's alpha value" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRenderMode, "GetRenderMode", "Get render mode" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetRenderMode, "SetRenderMode", "Set render mode" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetEffects, "Get effects" )
|
DEFINE_SCRIPTFUNC( GetEffects, "Get effects" )
|
||||||
DEFINE_SCRIPTFUNC( AddEffects, "Add effect(s)" )
|
|
||||||
DEFINE_SCRIPTFUNC( RemoveEffects, "Remove effect(s)" )
|
|
||||||
DEFINE_SCRIPTFUNC( ClearEffects, "Clear effect(s)" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetEffects, "Set effect(s)" )
|
|
||||||
DEFINE_SCRIPTFUNC( IsEffectActive, "Check if an effect is active" )
|
DEFINE_SCRIPTFUNC( IsEffectActive, "Check if an effect is active" )
|
||||||
|
#endif
|
||||||
DEFINE_SCRIPTFUNC( GetFlags, "Get flags" )
|
|
||||||
DEFINE_SCRIPTFUNC( AddFlag, "Add flag" )
|
|
||||||
DEFINE_SCRIPTFUNC( RemoveFlag, "Remove flag" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetEFlags, "Get Eflags" )
|
|
||||||
DEFINE_SCRIPTFUNC( AddEFlags, "Add Eflags" )
|
|
||||||
DEFINE_SCRIPTFUNC( RemoveEFlags, "Remove Eflags" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetMoveType, "GetMoveType", "Get the move type" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetMoveType, "SetMoveType", "Set the move type" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetCollisionGroup, "Get the collision group" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetCollisionGroup, "Set the collision group" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( GetSolidFlags, "Get solid flags" )
|
|
||||||
DEFINE_SCRIPTFUNC( AddSolidFlags, "Add solid flags" )
|
|
||||||
DEFINE_SCRIPTFUNC( RemoveSolidFlags, "Remove solid flags" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( IsPlayer, "Returns true if this entity is a player." )
|
|
||||||
DEFINE_SCRIPTFUNC( IsNPC, "Returns true if this entity is a NPC." )
|
|
||||||
//DEFINE_SCRIPTFUNC( IsCombatCharacter, "Returns true if this entity is a combat character (player or NPC)." )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( IsBaseCombatWeapon, "IsWeapon", "Returns true if this entity is a weapon." )
|
|
||||||
DEFINE_SCRIPTFUNC( IsWorld, "Returns true if this entity is the world." )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( SetModel, "Set client-only entity model" )
|
|
||||||
//DEFINE_SCRIPTFUNC_NAMED( ScriptInitializeAsClientEntity, "InitializeAsClientEntity", "" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( Remove, "Destroy", "Remove clientside entity" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( GetEntityIndex, "entindex", "" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptSetContextThink, "SetContextThink", "Set a think function on this entity." )
|
|
||||||
|
|
||||||
|
|
||||||
DEFINE_SIMPLE_SCRIPTHOOK( C_BaseEntity::g_Hook_UpdateOnRemove, "UpdateOnRemove", FIELD_VOID, "Called when the entity is being removed." )
|
|
||||||
|
|
||||||
BEGIN_SCRIPTHOOK( C_BaseEntity::g_Hook_ModifyEmitSoundParams, "ModifyEmitSoundParams", FIELD_VOID, "Called every time a sound is emitted on this entity, allowing for its parameters to be modified." )
|
|
||||||
DEFINE_SCRIPTHOOK_PARAM( "params", FIELD_HSCRIPT )
|
|
||||||
END_SCRIPTHOOK()
|
|
||||||
|
|
||||||
#endif // MAPBASE_VSCRIPT
|
|
||||||
|
|
||||||
END_SCRIPTDESC();
|
END_SCRIPTDESC();
|
||||||
|
|
||||||
#ifndef NO_ENTITY_PREDICTION
|
#ifndef NO_ENTITY_PREDICTION
|
||||||
@ -603,7 +494,6 @@ BEGIN_RECV_TABLE_NOBASE(C_BaseEntity, DT_BaseEntity)
|
|||||||
RecvPropInt(RECVINFO(m_clrRender)),
|
RecvPropInt(RECVINFO(m_clrRender)),
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
RecvPropInt(RECVINFO(m_iViewHideFlags)),
|
RecvPropInt(RECVINFO(m_iViewHideFlags)),
|
||||||
RecvPropBool(RECVINFO(m_bDisableFlashlight)),
|
|
||||||
#endif
|
#endif
|
||||||
RecvPropInt(RECVINFO(m_iTeamNum)),
|
RecvPropInt(RECVINFO(m_iTeamNum)),
|
||||||
RecvPropInt(RECVINFO(m_CollisionGroup)),
|
RecvPropInt(RECVINFO(m_CollisionGroup)),
|
||||||
@ -1357,23 +1247,8 @@ void C_BaseEntity::Term()
|
|||||||
|
|
||||||
if ( m_hScriptInstance )
|
if ( m_hScriptInstance )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
if ( m_ScriptScope.IsInitialized() && g_Hook_UpdateOnRemove.CanRunInScope( m_ScriptScope ) )
|
|
||||||
{
|
|
||||||
g_Hook_UpdateOnRemove.Call( m_ScriptScope, NULL, NULL );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
g_pScriptVM->RemoveInstance( m_hScriptInstance );
|
g_pScriptVM->RemoveInstance( m_hScriptInstance );
|
||||||
m_hScriptInstance = NULL;
|
m_hScriptInstance = NULL;
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
FOR_EACH_VEC( m_ScriptThinkFuncs, i )
|
|
||||||
{
|
|
||||||
HSCRIPT h = m_ScriptThinkFuncs[i]->m_hfnThink;
|
|
||||||
if ( h ) g_pScriptVM->ReleaseScript( h );
|
|
||||||
}
|
|
||||||
m_ScriptThinkFuncs.PurgeAndDeleteElements();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1724,11 +1599,6 @@ bool C_BaseEntity::ShouldReceiveProjectedTextures( int flags )
|
|||||||
if ( IsEffectActive( EF_NODRAW ) )
|
if ( IsEffectActive( EF_NODRAW ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if ( m_bDisableFlashlight )
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( flags & SHADOW_FLAGS_FLASHLIGHT )
|
if( flags & SHADOW_FLAGS_FLASHLIGHT )
|
||||||
{
|
{
|
||||||
if ( GetRenderMode() > kRenderNormal && GetRenderColor().a == 0 )
|
if ( GetRenderMode() > kRenderNormal && GetRenderColor().a == 0 )
|
||||||
@ -4937,15 +4807,9 @@ C_BaseEntity *C_BaseEntity::Instance( int iEnt )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
#if _MSC_VER < 1900
|
|
||||||
#pragma warning( push )
|
#pragma warning( push )
|
||||||
#include <typeinfo.h>
|
#include <typeinfo.h>
|
||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
#else
|
|
||||||
#include <typeinfo>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -6183,9 +6047,6 @@ BEGIN_DATADESC_NO_BASE( C_BaseEntity )
|
|||||||
DEFINE_FIELD( m_angAbsRotation, FIELD_VECTOR ),
|
DEFINE_FIELD( m_angAbsRotation, FIELD_VECTOR ),
|
||||||
DEFINE_ARRAY( m_rgflCoordinateFrame, FIELD_FLOAT, 12 ), // NOTE: MUST BE IN LOCAL SPACE, NOT POSITION_VECTOR!!! (see CBaseEntity::Restore)
|
DEFINE_ARRAY( m_rgflCoordinateFrame, FIELD_FLOAT, 12 ), // NOTE: MUST BE IN LOCAL SPACE, NOT POSITION_VECTOR!!! (see CBaseEntity::Restore)
|
||||||
DEFINE_FIELD( m_fFlags, FIELD_INTEGER ),
|
DEFINE_FIELD( m_fFlags, FIELD_INTEGER ),
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
DEFINE_FIELD( m_iszScriptId, FIELD_STRING ),
|
|
||||||
#endif
|
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -6651,138 +6512,6 @@ HSCRIPT C_BaseEntity::GetScriptInstance()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Using my edict, cook up a unique VScript scope that's private to me, and
|
|
||||||
// persistent.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BaseEntity::ValidateScriptScope()
|
|
||||||
{
|
|
||||||
if (!m_ScriptScope.IsInitialized())
|
|
||||||
{
|
|
||||||
if (scriptmanager == NULL)
|
|
||||||
{
|
|
||||||
ExecuteOnce(DevMsg("Cannot execute script because scripting is disabled (-scripting)\n"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_pScriptVM == NULL)
|
|
||||||
{
|
|
||||||
ExecuteOnce(DevMsg(" Cannot execute script because there is no available VM\n"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Force instance creation
|
|
||||||
GetScriptInstance();
|
|
||||||
|
|
||||||
EHANDLE hThis;
|
|
||||||
hThis.Set(this);
|
|
||||||
|
|
||||||
bool bResult = m_ScriptScope.Init(STRING(m_iszScriptId));
|
|
||||||
|
|
||||||
if (!bResult)
|
|
||||||
{
|
|
||||||
DevMsg("%s couldn't create ScriptScope!\n", GetDebugName());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
g_pScriptVM->SetValue(m_ScriptScope, "self", GetScriptInstance());
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Returns true if the function was located and called. false otherwise.
|
|
||||||
// NOTE: Assumes the function takes no parameters at the moment.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BaseEntity::CallScriptFunction( const char* pFunctionName, ScriptVariant_t* pFunctionReturn )
|
|
||||||
{
|
|
||||||
if (!ValidateScriptScope())
|
|
||||||
{
|
|
||||||
DevMsg("\n***\nFAILED to create private ScriptScope. ABORTING script\n***\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HSCRIPT hFunc = m_ScriptScope.LookupFunction(pFunctionName);
|
|
||||||
|
|
||||||
if (hFunc)
|
|
||||||
{
|
|
||||||
m_ScriptScope.Call(hFunc, pFunctionReturn);
|
|
||||||
m_ScriptScope.ReleaseFunction(hFunc);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Gets a function handle
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
HSCRIPT C_BaseEntity::LookupScriptFunction( const char* pFunctionName )
|
|
||||||
{
|
|
||||||
if (!m_ScriptScope.IsInitialized())
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_ScriptScope.LookupFunction(pFunctionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Calls and releases a function handle (ASSUMES SCRIPT SCOPE AND FUNCTION ARE VALID!)
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BaseEntity::CallScriptFunctionHandle( HSCRIPT hFunc, ScriptVariant_t* pFunctionReturn )
|
|
||||||
{
|
|
||||||
m_ScriptScope.Call(hFunc, pFunctionReturn);
|
|
||||||
m_ScriptScope.ReleaseFunction(hFunc);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose: Load, compile, and run a script file from disk.
|
|
||||||
// Input : *pScriptFile - The filename of the script file.
|
|
||||||
// bUseRootScope - If true, runs this script in the root scope, not
|
|
||||||
// in this entity's private scope.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BaseEntity::RunScriptFile( const char* pScriptFile, bool bUseRootScope )
|
|
||||||
{
|
|
||||||
if (!ValidateScriptScope())
|
|
||||||
{
|
|
||||||
DevMsg("\n***\nFAILED to create private ScriptScope. ABORTING script\n***\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bUseRootScope)
|
|
||||||
{
|
|
||||||
return VScriptRunScript(pScriptFile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return VScriptRunScript(pScriptFile, m_ScriptScope, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose: Compile and execute a discrete string of script source code
|
|
||||||
// Input : *pScriptText - A string containing script code to compile and run
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BaseEntity::RunScript( const char* pScriptText, const char* pDebugFilename )
|
|
||||||
{
|
|
||||||
if (!ValidateScriptScope())
|
|
||||||
{
|
|
||||||
DevMsg("\n***\nFAILED to create private ScriptScope. ABORTING script\n***\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_ScriptScope.Run(pScriptText, pDebugFilename) == SCRIPT_ERROR)
|
|
||||||
{
|
|
||||||
DevWarning(" Entity %s encountered an error in RunScript()\n", GetDebugName());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
HSCRIPT C_BaseEntity::ScriptGetMoveParent( void )
|
HSCRIPT C_BaseEntity::ScriptGetMoveParent( void )
|
||||||
|
@ -161,15 +161,6 @@ struct thinkfunc_t
|
|||||||
int m_nLastThinkTick;
|
int m_nLastThinkTick;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
struct scriptthinkfunc_t
|
|
||||||
{
|
|
||||||
float m_flNextThink;
|
|
||||||
HSCRIPT m_hfnThink;
|
|
||||||
unsigned m_iContextHash;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CREATE_PREDICTED_ENTITY( className ) \
|
#define CREATE_PREDICTED_ENTITY( className ) \
|
||||||
C_BaseEntity::CreatePredictedEntityByName( className, __FILE__, __LINE__ );
|
C_BaseEntity::CreatePredictedEntityByName( className, __FILE__, __LINE__ );
|
||||||
|
|
||||||
@ -270,39 +261,10 @@ public:
|
|||||||
|
|
||||||
string_t m_iClassname;
|
string_t m_iClassname;
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
// VSCRIPT
|
|
||||||
bool ValidateScriptScope();
|
|
||||||
bool CallScriptFunction( const char* pFunctionName, ScriptVariant_t* pFunctionReturn );
|
|
||||||
|
|
||||||
HSCRIPT GetOrCreatePrivateScriptScope();
|
|
||||||
HSCRIPT GetScriptScope() { return m_ScriptScope; }
|
|
||||||
|
|
||||||
HSCRIPT LookupScriptFunction(const char* pFunctionName);
|
|
||||||
bool CallScriptFunctionHandle(HSCRIPT hFunc, ScriptVariant_t* pFunctionReturn);
|
|
||||||
|
|
||||||
bool RunScriptFile( const char* pScriptFile, bool bUseRootScope = false );
|
|
||||||
bool RunScript( const char* pScriptText, const char* pDebugFilename = "C_BaseEntity::RunScript" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HSCRIPT GetScriptOwnerEntity();
|
|
||||||
virtual void SetScriptOwnerEntity(HSCRIPT pOwner);
|
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
HSCRIPT ScriptGetGroundEntity();
|
|
||||||
void ScriptSetGroundEntity( HSCRIPT hGroundEnt );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HSCRIPT GetScriptInstance();
|
HSCRIPT GetScriptInstance();
|
||||||
|
|
||||||
HSCRIPT m_hScriptInstance;
|
HSCRIPT m_hScriptInstance;
|
||||||
string_t m_iszScriptId;
|
string_t m_iszScriptId;
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
CScriptScope m_ScriptScope;
|
|
||||||
|
|
||||||
static ScriptHook_t g_Hook_UpdateOnRemove;
|
|
||||||
static ScriptHook_t g_Hook_ModifyEmitSoundParams;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// IClientUnknown overrides.
|
// IClientUnknown overrides.
|
||||||
public:
|
public:
|
||||||
@ -405,11 +367,6 @@ public:
|
|||||||
|
|
||||||
virtual int entindex( void ) const;
|
virtual int entindex( void ) const;
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
// "I don't know why but wrapping entindex() works, while calling it directly crashes."
|
|
||||||
inline int GetEntityIndex() const { return entindex(); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This works for client-only entities and returns the GetEntryIndex() of the entity's handle,
|
// This works for client-only entities and returns the GetEntryIndex() of the entity's handle,
|
||||||
// so the sound system can get an IClientEntity from it.
|
// so the sound system can get an IClientEntity from it.
|
||||||
int GetSoundSourceIndex() const;
|
int GetSoundSourceIndex() const;
|
||||||
@ -911,7 +868,6 @@ public:
|
|||||||
void SetSize( const Vector &vecMin, const Vector &vecMax ); // UTIL_SetSize( pev, mins, maxs );
|
void SetSize( const Vector &vecMin, const Vector &vecMax ); // UTIL_SetSize( pev, mins, maxs );
|
||||||
char const *GetClassname( void );
|
char const *GetClassname( void );
|
||||||
char const *GetDebugName( void );
|
char const *GetDebugName( void );
|
||||||
virtual const char *GetPlayerName() const { return NULL; }
|
|
||||||
static int PrecacheModel( const char *name );
|
static int PrecacheModel( const char *name );
|
||||||
static bool PrecacheSound( const char *name );
|
static bool PrecacheSound( const char *name );
|
||||||
static void PrefetchSound( const char *name );
|
static void PrefetchSound( const char *name );
|
||||||
@ -1054,7 +1010,6 @@ public:
|
|||||||
/////////////////
|
/////////////////
|
||||||
|
|
||||||
virtual bool IsPlayer( void ) const { return false; };
|
virtual bool IsPlayer( void ) const { return false; };
|
||||||
virtual bool IsBot( void ) const { return ((GetFlags() & FL_FAKECLIENT) == FL_FAKECLIENT) ? true : false; }
|
|
||||||
virtual bool IsBaseCombatCharacter( void ) { return false; };
|
virtual bool IsBaseCombatCharacter( void ) { return false; };
|
||||||
virtual C_BaseCombatCharacter *MyCombatCharacterPointer( void ) { return NULL; }
|
virtual C_BaseCombatCharacter *MyCombatCharacterPointer( void ) { return NULL; }
|
||||||
virtual bool IsNPC( void ) { return false; }
|
virtual bool IsNPC( void ) { return false; }
|
||||||
@ -1170,68 +1125,32 @@ public:
|
|||||||
bool IsFollowingEntity();
|
bool IsFollowingEntity();
|
||||||
CBaseEntity *GetFollowedEntity();
|
CBaseEntity *GetFollowedEntity();
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
void ScriptFollowEntity( HSCRIPT hBaseEntity, bool bBoneMerge );
|
|
||||||
HSCRIPT ScriptGetFollowedEntity();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// For shadows rendering the correct body + sequence...
|
// For shadows rendering the correct body + sequence...
|
||||||
virtual int GetBody() { return 0; }
|
virtual int GetBody() { return 0; }
|
||||||
virtual int GetSkin() { return 0; }
|
virtual int GetSkin() { return 0; }
|
||||||
|
|
||||||
const Vector& ScriptGetForward(void) { static Vector vecForward; GetVectors(&vecForward, NULL, NULL); return vecForward; }
|
const Vector& ScriptGetForward(void) { static Vector vecForward; GetVectors(&vecForward, NULL, NULL); return vecForward; }
|
||||||
#ifdef MAPBASE_VSCRIPT
|
const Vector& ScriptGetLeft(void) { static Vector vecLeft; GetVectors(NULL, &vecLeft, NULL); return vecLeft; }
|
||||||
const Vector& ScriptGetRight(void) { static Vector vecRight; GetVectors(NULL, &vecRight, NULL); return vecRight; }
|
|
||||||
#endif
|
|
||||||
const Vector& ScriptGetLeft(void) { static Vector vecRight; GetVectors(NULL, &vecRight, NULL); return vecRight; }
|
|
||||||
|
|
||||||
const Vector& ScriptGetUp(void) { static Vector vecUp; GetVectors(NULL, NULL, &vecUp); return vecUp; }
|
const Vector& ScriptGetUp(void) { static Vector vecUp; GetVectors(NULL, NULL, &vecUp); return vecUp; }
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
const char* ScriptGetModelName( void ) const { return STRING(GetModelName()); }
|
const char* ScriptGetModelName( void ) const { return STRING(GetModelName()); }
|
||||||
|
|
||||||
void ScriptStopSound(const char* soundname);
|
|
||||||
void ScriptEmitSound(const char* soundname);
|
void ScriptEmitSound(const char* soundname);
|
||||||
float ScriptSoundDuration(const char* soundname, const char* actormodel);
|
float ScriptSoundDuration(const char* soundname, const char* actormodel);
|
||||||
|
|
||||||
void VScriptPrecacheScriptSound(const char* soundname);
|
void VScriptPrecacheScriptSound(const char* soundname);
|
||||||
|
|
||||||
const Vector& ScriptEyePosition(void) { static Vector vec; vec = EyePosition(); return vec; }
|
const Vector& ScriptEyePosition(void) { static Vector vec; vec = EyePosition(); return vec; }
|
||||||
const QAngle& ScriptEyeAngles(void) { static QAngle ang; ang = EyeAngles(); return ang; }
|
const Vector& ScriptGetAngles(void) { static Vector vec; QAngle qa = GetAbsAngles(); vec.x = qa.x; vec.y = qa.y; vec.z = qa.z; return vec; }
|
||||||
void ScriptSetForward( const Vector& v ) { QAngle angles; VectorAngles( v, angles ); SetAbsAngles( angles ); }
|
|
||||||
|
|
||||||
const Vector& ScriptGetBoundingMins( void ) { return m_Collision.OBBMins(); }
|
const Vector& ScriptGetBoundingMins( void ) { return m_Collision.OBBMins(); }
|
||||||
const Vector& ScriptGetBoundingMaxs( void ) { return m_Collision.OBBMaxs(); }
|
const Vector& ScriptGetBoundingMaxs( void ) { return m_Collision.OBBMaxs(); }
|
||||||
|
|
||||||
HSCRIPT ScriptEntityToWorldTransform( void );
|
|
||||||
|
|
||||||
HSCRIPT ScriptGetPhysicsObject( void );
|
|
||||||
void ScriptPhysicsInitNormal( int nSolidType, int nSolidFlags, bool createAsleep );
|
|
||||||
void ScriptPhysicsDestroyObject() { VPhysicsDestroyObject(); }
|
|
||||||
|
|
||||||
void ScriptSetParent( HSCRIPT hParent, const char *szAttachment );
|
|
||||||
HSCRIPT ScriptGetMoveParent( void );
|
HSCRIPT ScriptGetMoveParent( void );
|
||||||
HSCRIPT ScriptGetRootMoveParent();
|
HSCRIPT ScriptGetRootMoveParent();
|
||||||
HSCRIPT ScriptFirstMoveChild( void );
|
HSCRIPT ScriptFirstMoveChild( void );
|
||||||
HSCRIPT ScriptNextMovePeer( void );
|
HSCRIPT ScriptNextMovePeer( void );
|
||||||
|
|
||||||
const Vector& ScriptGetColorVector();
|
|
||||||
int ScriptGetColorR() { return m_clrRender.GetR(); }
|
|
||||||
int ScriptGetColorG() { return m_clrRender.GetG(); }
|
|
||||||
int ScriptGetColorB() { return m_clrRender.GetB(); }
|
|
||||||
int ScriptGetAlpha() { return m_clrRender.GetA(); }
|
|
||||||
void ScriptSetColorVector( const Vector& vecColor );
|
|
||||||
void ScriptSetColor( int r, int g, int b );
|
|
||||||
void ScriptSetColorR( int iVal ) { SetRenderColorR( iVal ); }
|
|
||||||
void ScriptSetColorG( int iVal ) { SetRenderColorG( iVal ); }
|
|
||||||
void ScriptSetColorB( int iVal ) { SetRenderColorB( iVal ); }
|
|
||||||
void ScriptSetAlpha( int iVal ) { SetRenderColorA( iVal ); }
|
|
||||||
|
|
||||||
int ScriptGetRenderMode() { return GetRenderMode(); }
|
|
||||||
void ScriptSetRenderMode( int nRenderMode ) { SetRenderMode( (RenderMode_t)nRenderMode ); }
|
|
||||||
|
|
||||||
int ScriptGetMoveType() { return GetMoveType(); }
|
|
||||||
void ScriptSetMoveType( int iMoveType ) { SetMoveType( (MoveType_t)iMoveType ); }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Stubs on client
|
// Stubs on client
|
||||||
@ -1271,7 +1190,7 @@ public:
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
void FunctionCheck( void *pFunction, const char *name );
|
void FunctionCheck( void *pFunction, const char *name );
|
||||||
|
|
||||||
ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, const char *name )
|
ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name )
|
||||||
{
|
{
|
||||||
//COMPILE_TIME_ASSERT( sizeof(func) == 4 );
|
//COMPILE_TIME_ASSERT( sizeof(func) == 4 );
|
||||||
m_pfnTouch = func;
|
m_pfnTouch = func;
|
||||||
@ -1398,7 +1317,6 @@ public:
|
|||||||
|
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
int m_iViewHideFlags;
|
int m_iViewHideFlags;
|
||||||
bool m_bDisableFlashlight;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -1539,15 +1457,6 @@ protected:
|
|||||||
CUtlVector< thinkfunc_t > m_aThinkFunctions;
|
CUtlVector< thinkfunc_t > m_aThinkFunctions;
|
||||||
int m_iCurrentThinkContext;
|
int m_iCurrentThinkContext;
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
public:
|
|
||||||
void ScriptSetContextThink( const char* szContext, HSCRIPT hFunc, float time );
|
|
||||||
void ScriptContextThink();
|
|
||||||
private:
|
|
||||||
CUtlVector< scriptthinkfunc_t* > m_ScriptThinkFuncs;
|
|
||||||
public:
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Object eye position
|
// Object eye position
|
||||||
Vector m_vecViewOffset;
|
Vector m_vecViewOffset;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,460 +0,0 @@
|
|||||||
//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============//
|
|
||||||
//
|
|
||||||
// Purpose: Client handler for instruction players how to play
|
|
||||||
//
|
|
||||||
//=============================================================================//
|
|
||||||
|
|
||||||
#ifndef _C_BASELESSON_H_
|
|
||||||
#define _C_BASELESSON_H_
|
|
||||||
|
|
||||||
|
|
||||||
#include "GameEventListener.h"
|
|
||||||
#include "hud_locator_target.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define DECLARE_LESSON( _lessonClassName, _baseLessonClassName ) \
|
|
||||||
typedef _baseLessonClassName BaseClass;\
|
|
||||||
typedef _lessonClassName ThisClass;\
|
|
||||||
_lessonClassName( const char *pchName, bool bIsDefaultHolder, bool bIsOpenOpportunity )\
|
|
||||||
: _baseLessonClassName( pchName, bIsDefaultHolder, bIsOpenOpportunity )\
|
|
||||||
{\
|
|
||||||
Init();\
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
enum LessonInstanceType
|
|
||||||
{
|
|
||||||
LESSON_INSTANCE_MULTIPLE,
|
|
||||||
LESSON_INSTANCE_SINGLE_OPEN,
|
|
||||||
LESSON_INSTANCE_FIXED_REPLACE,
|
|
||||||
LESSON_INSTANCE_SINGLE_ACTIVE,
|
|
||||||
|
|
||||||
LESSON_INSTANCE_TYPE_TOTAL
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// This is used to solve a problem where bots can take the place of a player, where on or the other don't have valid entities on the client at the same time
|
|
||||||
#define MAX_DELAYED_PLAYER_SWAPS 8
|
|
||||||
|
|
||||||
struct delayed_player_swap_t
|
|
||||||
{
|
|
||||||
CHandle<C_BaseEntity> *phHandleToChange;
|
|
||||||
int iNewUserID;
|
|
||||||
|
|
||||||
delayed_player_swap_t( void )
|
|
||||||
{
|
|
||||||
phHandleToChange = NULL;
|
|
||||||
iNewUserID = -1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
abstract_class CBaseLesson : public CGameEventListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CBaseLesson( const char *pchName, bool bIsDefaultHolder, bool bIsOpenOpportunity );
|
|
||||||
virtual ~CBaseLesson( void );
|
|
||||||
|
|
||||||
void AddPrerequisite( const char *pchLessonName );
|
|
||||||
|
|
||||||
const CGameInstructorSymbol& GetNameSymbol( void ) const { return m_stringName; }
|
|
||||||
const char * GetName( void ) const { return m_stringName.String(); }
|
|
||||||
int GetPriority( void ) const { return m_iPriority; }
|
|
||||||
const char * GetCloseReason( void ) const { return m_stringCloseReason.String(); }
|
|
||||||
void SetCloseReason( const char *pchReason ) { m_stringCloseReason = pchReason; }
|
|
||||||
|
|
||||||
CBaseLesson* GetRoot( void ) const { return m_pRoot; }
|
|
||||||
void SetRoot( CBaseLesson *pRoot );
|
|
||||||
const CUtlVector < CBaseLesson * >* GetChildren( void ) const { return &m_OpenOpportunities; }
|
|
||||||
|
|
||||||
float GetInitTime( void ) { return m_fInitTime; }
|
|
||||||
void SetStartTime( void ) { m_fStartTime = gpGlobals->curtime; }
|
|
||||||
void ResetStartTime( void ) { m_fStartTime = 0.0f; m_bHasPlayedSound = false; }
|
|
||||||
|
|
||||||
bool ShouldShowSpew( void );
|
|
||||||
bool NoPriority( void ) const;
|
|
||||||
bool IsDefaultHolder( void ) const { return m_bIsDefaultHolder; }
|
|
||||||
bool IsOpenOpportunity( void ) const { return m_bIsOpenOpportunity; }
|
|
||||||
bool IsLocked( void ) const;
|
|
||||||
bool CanOpenWhenDead( void ) const { return m_bCanOpenWhenDead; }
|
|
||||||
bool IsInstructing( void ) const { return ( m_fStartTime > 0.0f ); }
|
|
||||||
bool IsLearned( void ) const;
|
|
||||||
bool PrerequisitesHaveBeenMet( void ) const;
|
|
||||||
bool IsTimedOut( void );
|
|
||||||
|
|
||||||
int InstanceType( void ) const { return m_iInstanceType; }
|
|
||||||
const CGameInstructorSymbol& GetReplaceKeySymbol( void ) const { return m_stringReplaceKey; }
|
|
||||||
const char* GetReplaceKey( void ) const { return m_stringReplaceKey.String(); }
|
|
||||||
int GetFixedInstancesMax( void ) const { return m_iFixedInstancesMax; }
|
|
||||||
bool ShouldReplaceOnlyWhenStopped( void ) const { return m_bReplaceOnlyWhenStopped; }
|
|
||||||
void SetInstanceActive( bool bInstanceActive ) { m_bInstanceActive = bInstanceActive; }
|
|
||||||
bool IsInstanceActive( void ) const { return m_bInstanceActive; }
|
|
||||||
|
|
||||||
void ResetDisplaysAndSuccesses( void );
|
|
||||||
bool IncDisplayCount( void );
|
|
||||||
bool IncSuccessCount( void );
|
|
||||||
void SetDisplayCount( int iDisplayCount ) { m_iDisplayCount = iDisplayCount; }
|
|
||||||
void SetSuccessCount( int iSuccessCount ) { m_iSuccessCount = iSuccessCount; }
|
|
||||||
int GetDisplayCount( void ) const { return m_iDisplayCount; }
|
|
||||||
int GetSuccessCount( void ) const { return m_iSuccessCount; }
|
|
||||||
int GetDisplayLimit( void ) const { return m_iDisplayLimit; }
|
|
||||||
int GetSuccessLimit( void ) const { return m_iSuccessLimit; }
|
|
||||||
|
|
||||||
void Init( void ); // NOT virtual, each constructor calls their own
|
|
||||||
virtual void InitPrerequisites( void ) {};
|
|
||||||
virtual void Start( void ) = 0;
|
|
||||||
virtual void Stop( void ) = 0;
|
|
||||||
virtual void OnOpen( void ) {};
|
|
||||||
virtual void Update( void ) {};
|
|
||||||
virtual void UpdateInactive( void ) {};
|
|
||||||
|
|
||||||
virtual bool ShouldDisplay( void ) const { return true; }
|
|
||||||
virtual bool IsVisible( void ) const { return true; }
|
|
||||||
virtual bool WasDisplayed( void ) const { return m_bWasDisplayed ? true : false; }
|
|
||||||
virtual void SwapOutPlayers( int iOldUserID, int iNewUserID ) {}
|
|
||||||
virtual void TakePlaceOf( CBaseLesson *pLesson );
|
|
||||||
|
|
||||||
const char *GetGroup() { return m_szLessonGroup.String(); }
|
|
||||||
void SetEnabled( bool bEnabled ) { m_bDisabled = !bEnabled; }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void MarkSucceeded( void );
|
|
||||||
void CloseOpportunity( const char *pchReason );
|
|
||||||
bool DoDelayedPlayerSwaps( void ) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
CBaseLesson *m_pRoot;
|
|
||||||
CUtlVector < CBaseLesson * > m_OpenOpportunities;
|
|
||||||
CUtlVector < const CBaseLesson * > m_Prerequisites;
|
|
||||||
|
|
||||||
CGameInstructorSymbol m_stringCloseReason;
|
|
||||||
CGameInstructorSymbol m_stringName;
|
|
||||||
|
|
||||||
bool m_bInstanceActive : 1;
|
|
||||||
bool m_bSuccessCounted : 1;
|
|
||||||
bool m_bIsDefaultHolder : 1;
|
|
||||||
bool m_bIsOpenOpportunity : 1;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
LessonInstanceType m_iInstanceType;
|
|
||||||
|
|
||||||
int m_iPriority;
|
|
||||||
CGameInstructorSymbol m_stringReplaceKey;
|
|
||||||
int m_iFixedInstancesMax;
|
|
||||||
bool m_bReplaceOnlyWhenStopped;
|
|
||||||
int m_iTeam;
|
|
||||||
bool m_bOnlyKeyboard;
|
|
||||||
bool m_bOnlyGamepad;
|
|
||||||
|
|
||||||
int m_iDisplayLimit;
|
|
||||||
int m_iDisplayCount;
|
|
||||||
bool m_bWasDisplayed;
|
|
||||||
int m_iSuccessLimit;
|
|
||||||
int m_iSuccessCount;
|
|
||||||
|
|
||||||
float m_fLockDuration;
|
|
||||||
float m_fTimeout;
|
|
||||||
float m_fInitTime;
|
|
||||||
float m_fStartTime;
|
|
||||||
float m_fLockTime;
|
|
||||||
float m_fUpdateInterval;
|
|
||||||
bool m_bHasPlayedSound;
|
|
||||||
|
|
||||||
CGameInstructorSymbol m_szStartSound;
|
|
||||||
CGameInstructorSymbol m_szLessonGroup;
|
|
||||||
|
|
||||||
bool m_bCanOpenWhenDead;
|
|
||||||
bool m_bBumpWithTimeoutWhenLearned;
|
|
||||||
bool m_bCanTimeoutWhileInactive;
|
|
||||||
bool m_bDisabled;
|
|
||||||
|
|
||||||
// Right now we can only queue up 4 swaps...
|
|
||||||
// this number can be increased if more entity handle scripted variables are added
|
|
||||||
mutable delayed_player_swap_t m_pDelayedPlayerSwap[ MAX_DELAYED_PLAYER_SWAPS ];
|
|
||||||
mutable int m_iNumDelayedPlayerSwaps;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Colors for console spew in verbose mode
|
|
||||||
static Color m_rgbaVerboseHeader;
|
|
||||||
static Color m_rgbaVerbosePlain;
|
|
||||||
static Color m_rgbaVerboseName;
|
|
||||||
static Color m_rgbaVerboseOpen;
|
|
||||||
static Color m_rgbaVerboseClose;
|
|
||||||
static Color m_rgbaVerboseSuccess;
|
|
||||||
static Color m_rgbaVerboseUpdate;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class CTextLesson : public CBaseLesson
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DECLARE_LESSON( CTextLesson, CBaseLesson );
|
|
||||||
|
|
||||||
void Init( void ); // NOT virtual, each constructor calls their own
|
|
||||||
virtual void Start( void );
|
|
||||||
virtual void Stop( void );
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
CGameInstructorSymbol m_szDisplayText;
|
|
||||||
CGameInstructorSymbol m_szDisplayParamText;
|
|
||||||
CGameInstructorSymbol m_szBinding;
|
|
||||||
CGameInstructorSymbol m_szGamepadBinding;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class CIconLesson : public CTextLesson
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DECLARE_LESSON( CIconLesson, CTextLesson );
|
|
||||||
|
|
||||||
void Init( void ); // NOT virtual, each constructor calls their own
|
|
||||||
virtual void Start( void );
|
|
||||||
virtual void Stop( void );
|
|
||||||
virtual void Update( void );
|
|
||||||
virtual void UpdateInactive( void );
|
|
||||||
|
|
||||||
virtual bool ShouldDisplay( void ) const;
|
|
||||||
virtual bool IsVisible( void ) const;
|
|
||||||
virtual void SwapOutPlayers( int iOldUserID, int iNewUserID );
|
|
||||||
virtual void TakePlaceOf( CBaseLesson *pLesson );
|
|
||||||
|
|
||||||
void SetLocatorBinding( CLocatorTarget * pLocatorTarget );
|
|
||||||
|
|
||||||
const char *GetCaptionColorString() { return m_szCaptionColor.String(); }
|
|
||||||
|
|
||||||
bool IsPresentComplete( void );
|
|
||||||
void PresentStart( void );
|
|
||||||
void PresentEnd( void );
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void UpdateLocatorTarget( CLocatorTarget *pLocatorTarget, C_BaseEntity *pIconTarget );
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
Vector GetIconTargetPosition( C_BaseEntity *pIconTarget );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
|
||||||
CHandle<C_BaseEntity> m_hIconTarget;
|
|
||||||
CGameInstructorSymbol m_szVguiTargetName;
|
|
||||||
CGameInstructorSymbol m_szVguiTargetLookup;
|
|
||||||
int m_nVguiTargetEdge;
|
|
||||||
float m_flUpOffset;
|
|
||||||
float m_flRelativeUpOffset;
|
|
||||||
float m_fFixedPositionX;
|
|
||||||
float m_fFixedPositionY;
|
|
||||||
|
|
||||||
int m_hLocatorTarget;
|
|
||||||
int m_iFlags;
|
|
||||||
|
|
||||||
float m_fRange;
|
|
||||||
float m_fCurrentDistance;
|
|
||||||
float m_fOnScreenStartTime;
|
|
||||||
float m_fUpdateDistanceTime;
|
|
||||||
|
|
||||||
CGameInstructorSymbol m_szOnscreenIcon;
|
|
||||||
CGameInstructorSymbol m_szOffscreenIcon;
|
|
||||||
CGameInstructorSymbol m_szCaptionColor;
|
|
||||||
|
|
||||||
bool m_bFixedPosition;
|
|
||||||
bool m_bNoIconTarget;
|
|
||||||
bool m_bAllowNodrawTarget;
|
|
||||||
bool m_bVisible;
|
|
||||||
bool m_bShowWhenOccluded;
|
|
||||||
bool m_bNoOffscreen;
|
|
||||||
bool m_bForceCaption;
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
int m_iIconTargetPos;
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
ICON_TARGET_EYE_POSITION,
|
|
||||||
ICON_TARGET_ORIGIN,
|
|
||||||
ICON_TARGET_CENTER,
|
|
||||||
};
|
|
||||||
|
|
||||||
CGameInstructorSymbol m_szHudHint;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
enum LessonAction
|
|
||||||
{
|
|
||||||
LESSON_ACTION_NONE,
|
|
||||||
|
|
||||||
LESSON_ACTION_SCOPE_IN,
|
|
||||||
LESSON_ACTION_SCOPE_OUT,
|
|
||||||
LESSON_ACTION_CLOSE,
|
|
||||||
LESSON_ACTION_SUCCESS,
|
|
||||||
LESSON_ACTION_LOCK,
|
|
||||||
LESSON_ACTION_PRESENT_COMPLETE,
|
|
||||||
LESSON_ACTION_PRESENT_START,
|
|
||||||
LESSON_ACTION_PRESENT_END,
|
|
||||||
|
|
||||||
LESSON_ACTION_REFERENCE_OPEN,
|
|
||||||
|
|
||||||
LESSON_ACTION_SET,
|
|
||||||
LESSON_ACTION_ADD,
|
|
||||||
LESSON_ACTION_SUBTRACT,
|
|
||||||
LESSON_ACTION_MULTIPLY,
|
|
||||||
LESSON_ACTION_IS,
|
|
||||||
LESSON_ACTION_LESS_THAN,
|
|
||||||
LESSON_ACTION_HAS_PREFIX,
|
|
||||||
LESSON_ACTION_HAS_BIT,
|
|
||||||
LESSON_ACTION_BIT_COUNT_IS,
|
|
||||||
LESSON_ACTION_BIT_COUNT_LESS_THAN,
|
|
||||||
|
|
||||||
LESSON_ACTION_GET_DISTANCE,
|
|
||||||
LESSON_ACTION_GET_ANGULAR_DISTANCE,
|
|
||||||
LESSON_ACTION_GET_PLAYER_DISPLAY_NAME,
|
|
||||||
LESSON_ACTION_CLASSNAME_IS,
|
|
||||||
LESSON_ACTION_MODELNAME_IS,
|
|
||||||
LESSON_ACTION_TEAM_IS,
|
|
||||||
LESSON_ACTION_HEALTH_LESS_THAN,
|
|
||||||
LESSON_ACTION_HEALTH_PERCENTAGE_LESS_THAN,
|
|
||||||
LESSON_ACTION_GET_ACTIVE_WEAPON,
|
|
||||||
LESSON_ACTION_WEAPON_IS,
|
|
||||||
LESSON_ACTION_WEAPON_HAS,
|
|
||||||
LESSON_ACTION_GET_ACTIVE_WEAPON_SLOT,
|
|
||||||
LESSON_ACTION_GET_WEAPON_SLOT,
|
|
||||||
LESSON_ACTION_GET_WEAPON_IN_SLOT,
|
|
||||||
LESSON_ACTION_CLIP_PERCENTAGE_LESS_THAN,
|
|
||||||
LESSON_ACTION_WEAPON_AMMO_LOW,
|
|
||||||
LESSON_ACTION_WEAPON_AMMO_FULL,
|
|
||||||
LESSON_ACTION_WEAPON_AMMO_EMPTY,
|
|
||||||
LESSON_ACTION_WEAPON_CAN_USE,
|
|
||||||
LESSON_ACTION_USE_TARGET_IS,
|
|
||||||
LESSON_ACTION_GET_USE_TARGET,
|
|
||||||
LESSON_ACTION_GET_POTENTIAL_USE_TARGET,
|
|
||||||
|
|
||||||
// Enum continued in Mod_LessonAction
|
|
||||||
LESSON_ACTION_MOD_START,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct LessonElement_t
|
|
||||||
{
|
|
||||||
int iVariable;
|
|
||||||
int iParamVarIndex;
|
|
||||||
int iAction;
|
|
||||||
_fieldtypes paramType;
|
|
||||||
CGameInstructorSymbol szParam;
|
|
||||||
bool bNot : 1;
|
|
||||||
bool bOptionalParam : 1;
|
|
||||||
|
|
||||||
LessonElement_t( int p_iVariable, int p_iAction, bool p_bNot, bool p_bOptionalParam, const char *pchParam, int p_iParamVarIndex, _fieldtypes p_paramType )
|
|
||||||
{
|
|
||||||
iVariable = p_iVariable;
|
|
||||||
iAction = p_iAction;
|
|
||||||
bNot = p_bNot;
|
|
||||||
bOptionalParam = p_bOptionalParam;
|
|
||||||
szParam = pchParam;
|
|
||||||
iParamVarIndex = p_iParamVarIndex;
|
|
||||||
paramType = p_paramType;
|
|
||||||
}
|
|
||||||
|
|
||||||
LessonElement_t( const LessonElement_t &p_LessonElement )
|
|
||||||
{
|
|
||||||
iVariable = p_LessonElement.iVariable;
|
|
||||||
iAction = p_LessonElement.iAction;
|
|
||||||
bNot = p_LessonElement.bNot;
|
|
||||||
bOptionalParam = p_LessonElement.bOptionalParam;
|
|
||||||
szParam = p_LessonElement.szParam;
|
|
||||||
iParamVarIndex = p_LessonElement.iParamVarIndex;
|
|
||||||
paramType = p_LessonElement.paramType;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct LessonEvent_t
|
|
||||||
{
|
|
||||||
CUtlVector< LessonElement_t > elements;
|
|
||||||
CGameInstructorSymbol szEventName;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CScriptedIconLesson : public CIconLesson
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DECLARE_LESSON( CScriptedIconLesson, CIconLesson )
|
|
||||||
|
|
||||||
virtual ~CScriptedIconLesson( void );
|
|
||||||
|
|
||||||
static void PreReadLessonsFromFile( void );
|
|
||||||
static void Mod_PreReadLessonsFromFile( void );
|
|
||||||
|
|
||||||
void Init( void ); // NOT virtual, each constructor calls their own
|
|
||||||
virtual void InitPrerequisites( void );
|
|
||||||
virtual void OnOpen( void );
|
|
||||||
virtual void Update( void );
|
|
||||||
|
|
||||||
virtual void SwapOutPlayers( int iOldUserID, int iNewUserID );
|
|
||||||
|
|
||||||
virtual void FireGameEvent( IGameEvent *event );
|
|
||||||
virtual void ProcessOpenGameEvents( const CScriptedIconLesson *pRootLesson, const char *name, IGameEvent *event );
|
|
||||||
virtual void ProcessCloseGameEvents( const CScriptedIconLesson *pRootLesson, const char *name, IGameEvent *event );
|
|
||||||
virtual void ProcessSuccessGameEvents( const CScriptedIconLesson *pRootLesson, const char *name, IGameEvent *event );
|
|
||||||
|
|
||||||
CUtlVector< LessonEvent_t >& GetOpenEvents( void ) { return m_OpenEvents; }
|
|
||||||
CUtlVector< LessonEvent_t >& GetCloseEvents( void ) { return m_CloseEvents; }
|
|
||||||
CUtlVector< LessonEvent_t >& GetSuccessEvents( void ) { return m_SuccessEvents; }
|
|
||||||
CUtlVector< LessonEvent_t >& GetOnOpenEvents( void ) { return m_OnOpenEvents; }
|
|
||||||
CUtlVector< LessonEvent_t >& GetUpdateEvents( void ) { return m_UpdateEvents; }
|
|
||||||
|
|
||||||
bool ProcessElements( IGameEvent *event, const CUtlVector< LessonElement_t > *pElements );
|
|
||||||
|
|
||||||
private:
|
|
||||||
void InitElementsFromKeys( CUtlVector< LessonElement_t > *pLessonElements, KeyValues *pKey );
|
|
||||||
void InitElementsFromElements( CUtlVector< LessonElement_t > *pLessonElements, const CUtlVector< LessonElement_t > *pLessonElements2 );
|
|
||||||
|
|
||||||
void InitFromKeys( KeyValues *pKey );
|
|
||||||
|
|
||||||
bool ProcessElement( IGameEvent *event, const LessonElement_t *pLessonElement, bool bInFailedScope );
|
|
||||||
|
|
||||||
bool ProcessElementAction( int iAction, bool bNot, const char *pchVarName, float &bVar, const CGameInstructorSymbol *pchParamName, float fParam );
|
|
||||||
bool ProcessElementAction( int iAction, bool bNot, const char *pchVarName, int &bVar, const CGameInstructorSymbol *pchParamName, float fParam );
|
|
||||||
bool ProcessElementAction( int iAction, bool bNot, const char *pchVarName, bool &bVar, const CGameInstructorSymbol *pchParamName, float fParam );
|
|
||||||
bool ProcessElementAction( int iAction, bool bNot, const char *pchVarName, EHANDLE &hVar, const CGameInstructorSymbol *pchParamName, float fParam, C_BaseEntity *pParam, const char *pchParam );
|
|
||||||
bool ProcessElementAction( int iAction, bool bNot, const char *pchVarName, CGameInstructorSymbol *pchVar, const CGameInstructorSymbol *pchParamName, const char *pchParam );
|
|
||||||
|
|
||||||
// Implemented per mod so they can have custom actions
|
|
||||||
bool Mod_ProcessElementAction( int iAction, bool bNot, const char *pchVarName, EHANDLE &hVar, const CGameInstructorSymbol *pchParamName, float fParam, C_BaseEntity *pParam, const char *pchParam, bool &bModHandled );
|
|
||||||
|
|
||||||
LessonEvent_t * AddOpenEvent( void );
|
|
||||||
LessonEvent_t * AddCloseEvent( void );
|
|
||||||
LessonEvent_t * AddSuccessEvent( void );
|
|
||||||
LessonEvent_t * AddOnOpenEvent( void );
|
|
||||||
LessonEvent_t * AddUpdateEvent( void );
|
|
||||||
|
|
||||||
private:
|
|
||||||
static CUtlDict< int, int > LessonActionMap;
|
|
||||||
|
|
||||||
EHANDLE m_hLocalPlayer;
|
|
||||||
float m_fOutput;
|
|
||||||
CHandle<C_BaseEntity> m_hEntity1;
|
|
||||||
CHandle<C_BaseEntity> m_hEntity2;
|
|
||||||
CGameInstructorSymbol m_szString1;
|
|
||||||
CGameInstructorSymbol m_szString2;
|
|
||||||
int m_iInteger1;
|
|
||||||
int m_iInteger2;
|
|
||||||
float m_fFloat1;
|
|
||||||
float m_fFloat2;
|
|
||||||
|
|
||||||
CUtlVector< CGameInstructorSymbol > m_PrerequisiteNames;
|
|
||||||
CUtlVector< LessonEvent_t > m_OpenEvents;
|
|
||||||
CUtlVector< LessonEvent_t > m_CloseEvents;
|
|
||||||
CUtlVector< LessonEvent_t > m_SuccessEvents;
|
|
||||||
CUtlVector< LessonEvent_t > m_OnOpenEvents;
|
|
||||||
CUtlVector< LessonEvent_t > m_UpdateEvents;
|
|
||||||
|
|
||||||
float m_fUpdateEventTime;
|
|
||||||
CScriptedIconLesson *m_pDefaultHolder;
|
|
||||||
|
|
||||||
int m_iScopeDepth;
|
|
||||||
|
|
||||||
// Need this to get offsets to scripted variables
|
|
||||||
friend class LessonVariableInfo;
|
|
||||||
friend int LessonActionFromString( const char *pchName );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _C_BASELESSON_H_
|
|
@ -192,7 +192,6 @@ BEGIN_RECV_TABLE_NOBASE( CPlayerLocalData, DT_Local )
|
|||||||
RecvPropVector(RECVINFO(m_skybox3d.origin)),
|
RecvPropVector(RECVINFO(m_skybox3d.origin)),
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
RecvPropVector(RECVINFO(m_skybox3d.angles)),
|
RecvPropVector(RECVINFO(m_skybox3d.angles)),
|
||||||
RecvPropEHandle(RECVINFO(m_skybox3d.skycamera)),
|
|
||||||
RecvPropInt( RECVINFO( m_skybox3d.skycolor ), 0, RecvProxy_IntToColor32 ),
|
RecvPropInt( RECVINFO( m_skybox3d.skycolor ), 0, RecvProxy_IntToColor32 ),
|
||||||
#endif
|
#endif
|
||||||
RecvPropInt(RECVINFO(m_skybox3d.area)),
|
RecvPropInt(RECVINFO(m_skybox3d.area)),
|
||||||
@ -225,14 +224,6 @@ BEGIN_RECV_TABLE_NOBASE( CPlayerLocalData, DT_Local )
|
|||||||
RecvPropInt( RECVINFO( m_audio.soundscapeIndex ) ),
|
RecvPropInt( RECVINFO( m_audio.soundscapeIndex ) ),
|
||||||
RecvPropInt( RECVINFO( m_audio.localBits ) ),
|
RecvPropInt( RECVINFO( m_audio.localBits ) ),
|
||||||
RecvPropEHandle( RECVINFO( m_audio.ent ) ),
|
RecvPropEHandle( RECVINFO( m_audio.ent ) ),
|
||||||
|
|
||||||
//Tony; tonemap stuff! -- TODO! Optimize this with bit sizes from env_tonemap_controller.
|
|
||||||
RecvPropFloat ( RECVINFO( m_TonemapParams.m_flTonemapScale ) ),
|
|
||||||
RecvPropFloat ( RECVINFO( m_TonemapParams.m_flTonemapRate ) ),
|
|
||||||
RecvPropFloat ( RECVINFO( m_TonemapParams.m_flBloomScale ) ),
|
|
||||||
|
|
||||||
RecvPropFloat ( RECVINFO( m_TonemapParams.m_flAutoExposureMin ) ),
|
|
||||||
RecvPropFloat ( RECVINFO( m_TonemapParams.m_flAutoExposureMax ) ),
|
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------------- //
|
||||||
@ -281,7 +272,6 @@ END_RECV_TABLE()
|
|||||||
RecvPropInt ( RECVINFO( m_spawnflags ), 0, RecvProxy_ShiftPlayerSpawnflags ),
|
RecvPropInt ( RECVINFO( m_spawnflags ), 0, RecvProxy_ShiftPlayerSpawnflags ),
|
||||||
|
|
||||||
RecvPropBool ( RECVINFO( m_bDrawPlayerModelExternally ) ),
|
RecvPropBool ( RECVINFO( m_bDrawPlayerModelExternally ) ),
|
||||||
RecvPropBool ( RECVINFO( m_bInTriggerFall ) ),
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
@ -332,11 +322,6 @@ END_RECV_TABLE()
|
|||||||
|
|
||||||
RecvPropString( RECVINFO(m_szLastPlaceName) ),
|
RecvPropString( RECVINFO(m_szLastPlaceName) ),
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
RecvPropEHandle( RECVINFO( m_hPostProcessCtrl ) ), // Send to everybody - for spectating
|
|
||||||
RecvPropEHandle( RECVINFO( m_hColorCorrectionCtrl ) ), // Send to everybody - for spectating
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined USES_ECON_ITEMS
|
#if defined USES_ECON_ITEMS
|
||||||
RecvPropUtlVector( RECVINFO_UTLVECTOR( m_hMyWearables ), MAX_WEARABLES_SENT_FROM_SERVER, RecvPropEHandle(NULL, 0, 0) ),
|
RecvPropUtlVector( RECVINFO_UTLVECTOR( m_hMyWearables ), MAX_WEARABLES_SENT_FROM_SERVER, RecvPropEHandle(NULL, 0, 0) ),
|
||||||
#endif
|
#endif
|
||||||
@ -440,10 +425,7 @@ BEGIN_PREDICTION_DATA( C_BasePlayer )
|
|||||||
|
|
||||||
END_PREDICTION_DATA()
|
END_PREDICTION_DATA()
|
||||||
|
|
||||||
// link this in each derived player class, like the server!!
|
|
||||||
#if 0
|
|
||||||
LINK_ENTITY_TO_CLASS( player, C_BasePlayer );
|
LINK_ENTITY_TO_CLASS( player, C_BasePlayer );
|
||||||
#endif
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------------- //
|
||||||
// Functions.
|
// Functions.
|
||||||
@ -496,14 +478,14 @@ C_BasePlayer::~C_BasePlayer()
|
|||||||
if ( this == s_pLocalPlayer )
|
if ( this == s_pLocalPlayer )
|
||||||
{
|
{
|
||||||
s_pLocalPlayer = NULL;
|
s_pLocalPlayer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
if ( g_pScriptVM )
|
if ( IsLocalPlayer() && g_pScriptVM )
|
||||||
{
|
{
|
||||||
g_pScriptVM->SetValue( "player", SCRIPT_VARIANT_NULL );
|
g_pScriptVM->SetValue( "player", SCRIPT_VARIANT_NULL );
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
delete m_pFlashlight;
|
delete m_pFlashlight;
|
||||||
}
|
}
|
||||||
@ -859,14 +841,6 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
|
|||||||
// changed level, which would cause the snd_soundmixer to be left modified.
|
// changed level, which would cause the snd_soundmixer to be left modified.
|
||||||
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
|
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
|
||||||
pVar->Revert();
|
pVar->Revert();
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
// Moved here from LevelInitPostEntity, which is executed before local player is spawned.
|
|
||||||
if ( g_pScriptVM )
|
|
||||||
{
|
|
||||||
g_pScriptVM->SetValue( "player", GetScriptInstance() );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1133,9 +1107,6 @@ void C_BasePlayer::DetermineVguiInputMode( CUserCmd *pCmd )
|
|||||||
|
|
||||||
// Kill all attack inputs if we're in vgui screen mode
|
// Kill all attack inputs if we're in vgui screen mode
|
||||||
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_VALIDVGUIINPUT);
|
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_VALIDVGUIINPUT);
|
||||||
#ifdef MAPBASE
|
|
||||||
pCmd->buttons |= IN_VGUIMODE;
|
|
||||||
#endif // MAPBASE
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -1145,10 +1116,6 @@ void C_BasePlayer::DetermineVguiInputMode( CUserCmd *pCmd )
|
|||||||
|
|
||||||
// Kill all attack inputs if we're in vgui screen mode
|
// Kill all attack inputs if we're in vgui screen mode
|
||||||
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2);
|
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2);
|
||||||
#ifdef MAPBASE
|
|
||||||
pCmd->buttons &= ~(IN_USE | IN_ATTACK3);
|
|
||||||
pCmd->buttons |= IN_VGUIMODE;
|
|
||||||
#endif // MAPBASE
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1213,10 +1180,6 @@ void C_BasePlayer::DetermineVguiInputMode( CUserCmd *pCmd )
|
|||||||
|
|
||||||
// Kill all attack inputs if we're in vgui screen mode
|
// Kill all attack inputs if we're in vgui screen mode
|
||||||
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2);
|
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2);
|
||||||
#ifdef MAPBASE
|
|
||||||
pCmd->buttons &= ~(IN_USE | IN_ATTACK3);
|
|
||||||
pCmd->buttons |= IN_VGUIMODE;
|
|
||||||
#endif // MAPBASE
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1378,10 +1341,6 @@ void C_BasePlayer::AddEntity( void )
|
|||||||
|
|
||||||
// Add in lighting effects
|
// Add in lighting effects
|
||||||
CreateLightEffects();
|
CreateLightEffects();
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
SetLocalAnglesDim( X_INDEX, 0 );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern float UTIL_WaterLevel( const Vector &position, float minz, float maxz );
|
extern float UTIL_WaterLevel( const Vector &position, float minz, float maxz );
|
||||||
@ -1504,9 +1463,8 @@ int C_BasePlayer::DrawModel( int flags )
|
|||||||
if (m_bDrawPlayerModelExternally)
|
if (m_bDrawPlayerModelExternally)
|
||||||
{
|
{
|
||||||
// Draw the player in any view except the main or "intro" view, both of which are default first-person views.
|
// Draw the player in any view except the main or "intro" view, both of which are default first-person views.
|
||||||
// HACKHACK: Also don't draw in shadow depth textures if the player's flashlight is on, as that causes the playermodel to block it.
|
|
||||||
view_id_t viewID = CurrentViewID();
|
view_id_t viewID = CurrentViewID();
|
||||||
if (viewID == VIEW_MAIN || viewID == VIEW_INTRO_CAMERA || (viewID == VIEW_SHADOW_DEPTH_TEXTURE && IsEffectActive(EF_DIMLIGHT)))
|
if (viewID == VIEW_MAIN || viewID == VIEW_INTRO_CAMERA)
|
||||||
{
|
{
|
||||||
// Make sure the player model wouldn't draw anyway...
|
// Make sure the player model wouldn't draw anyway...
|
||||||
if (!ShouldDrawThisPlayer())
|
if (!ShouldDrawThisPlayer())
|
||||||
@ -1529,38 +1487,6 @@ int C_BasePlayer::DrawModel( int flags )
|
|||||||
return BaseClass::DrawModel( flags );
|
return BaseClass::DrawModel( flags );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVar cl_player_allow_thirdperson_projtex( "cl_player_allow_thirdperson_projtex", "1", FCVAR_NONE, "Allows players to receive projected textures if they're non-local or in third person." );
|
|
||||||
ConVar cl_player_allow_thirdperson_rttshadows( "cl_player_allow_thirdperson_rttshadows", "0", FCVAR_NONE, "Allows players to cast RTT shadows if they're non-local or in third person." );
|
|
||||||
ConVar cl_player_allow_firstperson_projtex( "cl_player_allow_firstperson_projtex", "1", FCVAR_NONE, "Allows players to receive projected textures even if they're in first person." );
|
|
||||||
ConVar cl_player_allow_firstperson_rttshadows( "cl_player_allow_firstperson_rttshadows", "0", FCVAR_NONE, "Allows players to cast RTT shadows even if they're in first person." );
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
ShadowType_t C_BasePlayer::ShadowCastType()
|
|
||||||
{
|
|
||||||
if ( (!IsLocalPlayer() || ShouldDraw()) ? !cl_player_allow_thirdperson_rttshadows.GetBool() : !cl_player_allow_firstperson_rttshadows.GetBool() )
|
|
||||||
return SHADOWS_NONE;
|
|
||||||
|
|
||||||
if ( !IsVisible() )
|
|
||||||
return SHADOWS_NONE;
|
|
||||||
|
|
||||||
return SHADOWS_RENDER_TO_TEXTURE_DYNAMIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Should this object receive shadows?
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_BasePlayer::ShouldReceiveProjectedTextures( int flags )
|
|
||||||
{
|
|
||||||
if ( (!IsLocalPlayer() || ShouldDraw()) ? !cl_player_allow_thirdperson_projtex.GetBool() : !cl_player_allow_firstperson_projtex.GetBool() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return BaseClass::ShouldReceiveProjectedTextures( flags );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -1682,14 +1608,7 @@ void C_BasePlayer::CalcChaseCamView(Vector& eyeOrigin, QAngle& eyeAngles, float&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SDK TODO
|
if ( target && !target->IsPlayer() && target->IsNextBot() )
|
||||||
if ( target && target->IsBaseTrain() )
|
|
||||||
{
|
|
||||||
// if this is a train, we want to be back a little further so we can see more of it
|
|
||||||
flMaxDistance *= 2.5f;
|
|
||||||
m_flObserverChaseDistance = flMaxDistance;
|
|
||||||
}
|
|
||||||
else if ( target && !target->IsPlayer() && target->IsNextBot() )
|
|
||||||
{
|
{
|
||||||
// if this is a boss, we want to be back a little further so we can see more of it
|
// if this is a boss, we want to be back a little further so we can see more of it
|
||||||
flMaxDistance *= 2.5f;
|
flMaxDistance *= 2.5f;
|
||||||
@ -2022,12 +1941,6 @@ void C_BasePlayer::ThirdPersonSwitch( bool bThirdperson )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
CBaseCombatWeapon *pWeapon = GetActiveWeapon();
|
|
||||||
if ( pWeapon )
|
|
||||||
pWeapon->ThirdPersonSwitch( bThirdperson );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2969,24 +2882,6 @@ void C_BasePlayer::UpdateFogBlend( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
C_PostProcessController* C_BasePlayer::GetActivePostProcessController() const
|
|
||||||
{
|
|
||||||
return m_hPostProcessCtrl.Get();
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
C_ColorCorrection* C_BasePlayer::GetActiveColorCorrection() const
|
|
||||||
{
|
|
||||||
return m_hColorCorrectionCtrl.Get();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -23,10 +23,6 @@
|
|||||||
#include "hintsystem.h"
|
#include "hintsystem.h"
|
||||||
#include "SoundEmitterSystem/isoundemittersystembase.h"
|
#include "SoundEmitterSystem/isoundemittersystembase.h"
|
||||||
#include "c_env_fog_controller.h"
|
#include "c_env_fog_controller.h"
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
#include "c_postprocesscontroller.h"
|
|
||||||
#include "c_colorcorrection.h"
|
|
||||||
#endif
|
|
||||||
#include "igameevents.h"
|
#include "igameevents.h"
|
||||||
#include "GameEventListener.h"
|
#include "GameEventListener.h"
|
||||||
|
|
||||||
@ -41,7 +37,6 @@ class C_BaseViewModel;
|
|||||||
class C_FuncLadder;
|
class C_FuncLadder;
|
||||||
class CFlashlightEffect;
|
class CFlashlightEffect;
|
||||||
class C_EconWearable;
|
class C_EconWearable;
|
||||||
class C_PostProcessController;
|
|
||||||
|
|
||||||
extern int g_nKillCamMode;
|
extern int g_nKillCamMode;
|
||||||
extern int g_nKillCamTarget1;
|
extern int g_nKillCamTarget1;
|
||||||
@ -188,7 +183,7 @@ public:
|
|||||||
|
|
||||||
// Flashlight
|
// Flashlight
|
||||||
void Flashlight( void );
|
void Flashlight( void );
|
||||||
virtual void UpdateFlashlight( void );
|
void UpdateFlashlight( void );
|
||||||
|
|
||||||
// Weapon selection code
|
// Weapon selection code
|
||||||
virtual bool IsAllowedToSwitchWeapons( void ) { return !IsObserver(); }
|
virtual bool IsAllowedToSwitchWeapons( void ) { return !IsObserver(); }
|
||||||
@ -207,11 +202,6 @@ public:
|
|||||||
void SetMaxSpeed( float flMaxSpeed ) { m_flMaxspeed = flMaxSpeed; }
|
void SetMaxSpeed( float flMaxSpeed ) { m_flMaxspeed = flMaxSpeed; }
|
||||||
float MaxSpeed() const { return m_flMaxspeed; }
|
float MaxSpeed() const { return m_flMaxspeed; }
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// See c_baseplayer.cpp
|
|
||||||
virtual ShadowType_t ShadowCastType();
|
|
||||||
virtual bool ShouldReceiveProjectedTextures( int flags );
|
|
||||||
#else
|
|
||||||
// Should this object cast shadows?
|
// Should this object cast shadows?
|
||||||
virtual ShadowType_t ShadowCastType() { return SHADOWS_NONE; }
|
virtual ShadowType_t ShadowCastType() { return SHADOWS_NONE; }
|
||||||
|
|
||||||
@ -219,7 +209,6 @@ public:
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
bool IsLocalPlayer( void ) const;
|
bool IsLocalPlayer( void ) const;
|
||||||
@ -390,11 +379,6 @@ public:
|
|||||||
void UpdateFogController( void );
|
void UpdateFogController( void );
|
||||||
void UpdateFogBlend( void );
|
void UpdateFogBlend( void );
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
C_PostProcessController* GetActivePostProcessController() const;
|
|
||||||
C_ColorCorrection* GetActiveColorCorrection() const;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float GetFOVTime( void ){ return m_flFOVTime; }
|
float GetFOVTime( void ){ return m_flFOVTime; }
|
||||||
|
|
||||||
virtual void OnAchievementAchieved( int iAchievement ) {}
|
virtual void OnAchievementAchieved( int iAchievement ) {}
|
||||||
@ -470,24 +454,22 @@ public:
|
|||||||
|
|
||||||
// Allows the player's model to draw on non-main views, like monitors or mirrors.
|
// Allows the player's model to draw on non-main views, like monitors or mirrors.
|
||||||
bool m_bDrawPlayerModelExternally;
|
bool m_bDrawPlayerModelExternally;
|
||||||
|
|
||||||
bool m_bInTriggerFall;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//Tony; made all of these virtual so mods can override.
|
void CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||||
virtual void CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
void CalcVehicleView(IClientVehicle *pVehicle, Vector& eyeOrigin, QAngle& eyeAngles,
|
||||||
virtual void CalcVehicleView(IClientVehicle *pVehicle, Vector& eyeOrigin, QAngle& eyeAngles, float& zNear, float& zFar, float& fov );
|
float& zNear, float& zFar, float& fov );
|
||||||
virtual void CalcObserverView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
virtual void CalcObserverView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||||
virtual Vector GetChaseCamViewOffset( CBaseEntity *target );
|
virtual Vector GetChaseCamViewOffset( CBaseEntity *target );
|
||||||
virtual void CalcChaseCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
void CalcChaseCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||||
virtual void CalcInEyeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
virtual void CalcInEyeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||||
|
|
||||||
virtual float GetDeathCamInterpolationTime();
|
virtual float GetDeathCamInterpolationTime();
|
||||||
|
|
||||||
virtual void CalcDeathCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
virtual void CalcDeathCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||||
virtual void CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov);
|
void CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov);
|
||||||
virtual void CalcFreezeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
virtual void CalcFreezeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||||
|
|
||||||
// Check to see if we're in vgui input mode...
|
// Check to see if we're in vgui input mode...
|
||||||
@ -659,11 +641,6 @@ private:
|
|||||||
// One for left and one for right side of step
|
// One for left and one for right side of step
|
||||||
StepSoundCache_t m_StepSoundCache[ 2 ];
|
StepSoundCache_t m_StepSoundCache[ 2 ];
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
CNetworkHandle( C_PostProcessController, m_hPostProcessCtrl ); // active postprocessing controller
|
|
||||||
CNetworkHandle( C_ColorCorrection, m_hColorCorrectionCtrl ); // active FXVolume color correction
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
const char *GetLastKnownPlaceName( void ) const { return m_szLastPlaceName; } // return the last nav place name the player occupied
|
const char *GetLastKnownPlaceName( void ) const { return m_szLastPlaceName; } // return the last nav place name the player occupied
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
|
|
||||||
#if defined(CSTRIKE_DLL) || defined (MAPBASE)
|
#ifdef CSTRIKE_DLL
|
||||||
ConVar cl_righthand( "cl_righthand", "1", FCVAR_ARCHIVE, "Use right-handed view models." );
|
ConVar cl_righthand( "cl_righthand", "1", FCVAR_ARCHIVE, "Use right-handed view models." );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -192,9 +192,9 @@ bool C_BaseViewModel::Interpolate( float currentTime )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool C_BaseViewModel::ShouldFlipViewModel()
|
inline bool C_BaseViewModel::ShouldFlipViewModel()
|
||||||
{
|
{
|
||||||
#if defined(CSTRIKE_DLL) || defined (MAPBASE)
|
#ifdef CSTRIKE_DLL
|
||||||
// If cl_righthand is set, then we want them all right-handed.
|
// If cl_righthand is set, then we want them all right-handed.
|
||||||
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
|
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
|
||||||
if ( pWeapon )
|
if ( pWeapon )
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
//===========================================================================//
|
//===========================================================================//
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
|
|
||||||
#include "c_colorcorrection.h"
|
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include "cdll_client_int.h"
|
#include "cdll_client_int.h"
|
||||||
#include "colorcorrectionmgr.h"
|
#include "colorcorrectionmgr.h"
|
||||||
@ -18,27 +17,45 @@
|
|||||||
|
|
||||||
static ConVar mat_colcorrection_disableentities( "mat_colcorrection_disableentities", "0", FCVAR_NONE, "Disable map color-correction entities" );
|
static ConVar mat_colcorrection_disableentities( "mat_colcorrection_disableentities", "0", FCVAR_NONE, "Disable map color-correction entities" );
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
static ConVar mat_colcorrection_forceentitiesclientside( "mat_colcorrection_forceentitiesclientside", "0", FCVAR_CHEAT, "Forces color correction entities to be updated on the client" );
|
//------------------------------------------------------------------------------
|
||||||
#endif
|
// Purpose : Color correction entity with radial falloff
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
class C_ColorCorrection : public C_BaseEntity
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DECLARE_CLASS( C_ColorCorrection, C_BaseEntity );
|
||||||
|
|
||||||
|
DECLARE_CLIENTCLASS();
|
||||||
|
|
||||||
|
C_ColorCorrection();
|
||||||
|
virtual ~C_ColorCorrection();
|
||||||
|
|
||||||
|
void OnDataChanged(DataUpdateType_t updateType);
|
||||||
|
bool ShouldDraw();
|
||||||
|
|
||||||
|
void ClientThink();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector m_vecOrigin;
|
||||||
|
|
||||||
|
float m_minFalloff;
|
||||||
|
float m_maxFalloff;
|
||||||
|
float m_flCurWeight;
|
||||||
|
char m_netLookupFilename[MAX_PATH];
|
||||||
|
|
||||||
|
bool m_bEnabled;
|
||||||
|
|
||||||
|
ClientCCHandle_t m_CCHandle;
|
||||||
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT(C_ColorCorrection, DT_ColorCorrection, CColorCorrection)
|
IMPLEMENT_CLIENTCLASS_DT(C_ColorCorrection, DT_ColorCorrection, CColorCorrection)
|
||||||
RecvPropVector( RECVINFO(m_vecOrigin) ),
|
RecvPropVector( RECVINFO(m_vecOrigin) ),
|
||||||
RecvPropFloat( RECVINFO(m_minFalloff) ),
|
RecvPropFloat( RECVINFO(m_minFalloff) ),
|
||||||
RecvPropFloat( RECVINFO(m_maxFalloff) ),
|
RecvPropFloat( RECVINFO(m_maxFalloff) ),
|
||||||
RecvPropFloat( RECVINFO(m_flCurWeight) ),
|
RecvPropFloat( RECVINFO(m_flCurWeight) ),
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
RecvPropFloat( RECVINFO(m_flMaxWeight) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flFadeInDuration) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flFadeOutDuration) ),
|
|
||||||
#endif
|
|
||||||
RecvPropString( RECVINFO(m_netLookupFilename) ),
|
RecvPropString( RECVINFO(m_netLookupFilename) ),
|
||||||
RecvPropBool( RECVINFO(m_bEnabled) ),
|
RecvPropBool( RECVINFO(m_bEnabled) ),
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
RecvPropBool( RECVINFO(m_bMaster) ),
|
|
||||||
RecvPropBool( RECVINFO(m_bClientSide) ),
|
|
||||||
RecvPropBool( RECVINFO(m_bExclusive) )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
@ -48,43 +65,14 @@ END_RECV_TABLE()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
C_ColorCorrection::C_ColorCorrection()
|
C_ColorCorrection::C_ColorCorrection()
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
m_minFalloff = -1.0f;
|
|
||||||
m_maxFalloff = -1.0f;
|
|
||||||
m_flFadeInDuration = 0.0f;
|
|
||||||
m_flFadeOutDuration = 0.0f;
|
|
||||||
m_flCurWeight = 0.0f;
|
|
||||||
m_flMaxWeight = 1.0f;
|
|
||||||
m_netLookupFilename[0] = '\0';
|
|
||||||
m_bEnabled = false;
|
|
||||||
m_bMaster = false;
|
|
||||||
m_bExclusive = false;
|
|
||||||
#endif
|
|
||||||
m_CCHandle = INVALID_CLIENT_CCHANDLE;
|
m_CCHandle = INVALID_CLIENT_CCHANDLE;
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
m_bFadingIn = false;
|
|
||||||
m_flFadeStartWeight = 0.0f;
|
|
||||||
m_flFadeStartTime = 0.0f;
|
|
||||||
m_flFadeDuration = 0.0f;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
C_ColorCorrection::~C_ColorCorrection()
|
C_ColorCorrection::~C_ColorCorrection()
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
g_pColorCorrectionMgr->RemoveColorCorrectionEntity( this, m_CCHandle );
|
|
||||||
#else
|
|
||||||
g_pColorCorrectionMgr->RemoveColorCorrection( m_CCHandle );
|
g_pColorCorrectionMgr->RemoveColorCorrection( m_CCHandle );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
bool C_ColorCorrection::IsClientSide() const
|
|
||||||
{
|
|
||||||
return m_bClientSide || mat_colcorrection_forceentitiesclientside.GetBool();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Purpose :
|
// Purpose :
|
||||||
@ -99,21 +87,11 @@ void C_ColorCorrection::OnDataChanged(DataUpdateType_t updateType)
|
|||||||
{
|
{
|
||||||
if ( m_CCHandle == INVALID_CLIENT_CCHANDLE )
|
if ( m_CCHandle == INVALID_CLIENT_CCHANDLE )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
// forming a unique name without extension
|
|
||||||
char cleanName[MAX_PATH];
|
|
||||||
V_StripExtension( m_netLookupFilename, cleanName, sizeof( cleanName ) );
|
|
||||||
char name[MAX_PATH];
|
|
||||||
Q_snprintf( name, MAX_PATH, "%s_%d", cleanName, entindex() );
|
|
||||||
|
|
||||||
m_CCHandle = g_pColorCorrectionMgr->AddColorCorrectionEntity( this, name, m_netLookupFilename );
|
|
||||||
#else
|
|
||||||
char filename[MAX_PATH];
|
char filename[MAX_PATH];
|
||||||
Q_strncpy( filename, m_netLookupFilename, MAX_PATH );
|
Q_strncpy( filename, m_netLookupFilename, MAX_PATH );
|
||||||
|
|
||||||
m_CCHandle = g_pColorCorrectionMgr->AddColorCorrection( filename );
|
m_CCHandle = g_pColorCorrectionMgr->AddColorCorrection( filename );
|
||||||
SetNextClientThink( ( m_CCHandle != INVALID_CLIENT_CCHANDLE ) ? CLIENT_THINK_ALWAYS : CLIENT_THINK_NEVER );
|
SetNextClientThink( ( m_CCHandle != INVALID_CLIENT_CCHANDLE ) ? CLIENT_THINK_ALWAYS : CLIENT_THINK_NEVER );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,129 +104,6 @@ bool C_ColorCorrection::ShouldDraw()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
void C_ColorCorrection::Update( C_BasePlayer *pPlayer, float ccScale )
|
|
||||||
{
|
|
||||||
Assert( m_CCHandle != INVALID_CLIENT_CCHANDLE );
|
|
||||||
|
|
||||||
if ( mat_colcorrection_disableentities.GetInt() )
|
|
||||||
{
|
|
||||||
// Allow the colorcorrectionui panel (or user) to turn off color-correction entities
|
|
||||||
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, 0.0f, m_bExclusive );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// fade weight on client
|
|
||||||
if ( IsClientSide() )
|
|
||||||
{
|
|
||||||
m_flCurWeight = Lerp( GetFadeRatio(), m_flFadeStartWeight, m_bFadingIn ? m_flMaxWeight : 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !m_bEnabled && m_flCurWeight == 0.0f )
|
|
||||||
{
|
|
||||||
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, 0.0f, m_bExclusive );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector playerOrigin = pPlayer->GetAbsOrigin();
|
|
||||||
|
|
||||||
float weight = 0;
|
|
||||||
if ( ( m_minFalloff != -1 ) && ( m_maxFalloff != -1 ) && m_minFalloff != m_maxFalloff )
|
|
||||||
{
|
|
||||||
float dist = (playerOrigin - m_vecOrigin).Length();
|
|
||||||
weight = (dist-m_minFalloff) / (m_maxFalloff-m_minFalloff);
|
|
||||||
if ( weight<0.0f ) weight = 0.0f;
|
|
||||||
if ( weight>1.0f ) weight = 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, m_flCurWeight * ( 1.0 - weight ) * ccScale, m_bExclusive );
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_ColorCorrection::EnableOnClient( bool bEnable, bool bSkipFade )
|
|
||||||
{
|
|
||||||
if ( !IsClientSide() )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_bFadingIn = bEnable;
|
|
||||||
|
|
||||||
// initialize countdown timer
|
|
||||||
m_flFadeStartWeight = m_flCurWeight;
|
|
||||||
float flFadeTimeScale = 1.0f;
|
|
||||||
if ( m_flMaxWeight != 0.0f )
|
|
||||||
{
|
|
||||||
flFadeTimeScale = m_flCurWeight / m_flMaxWeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_bFadingIn )
|
|
||||||
{
|
|
||||||
flFadeTimeScale = 1.0f - flFadeTimeScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( bSkipFade )
|
|
||||||
{
|
|
||||||
flFadeTimeScale = 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
StartFade( flFadeTimeScale * ( m_bFadingIn ? m_flFadeInDuration : m_flFadeOutDuration ) );
|
|
||||||
|
|
||||||
// update the clientside weight once here, in case the fade duration is 0
|
|
||||||
m_flCurWeight = Lerp( GetFadeRatio(), m_flFadeStartWeight, m_bFadingIn ? m_flMaxWeight : 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector C_ColorCorrection::GetOrigin()
|
|
||||||
{
|
|
||||||
return m_vecOrigin;
|
|
||||||
}
|
|
||||||
|
|
||||||
float C_ColorCorrection::GetMinFalloff()
|
|
||||||
{
|
|
||||||
return m_minFalloff;
|
|
||||||
}
|
|
||||||
|
|
||||||
float C_ColorCorrection::GetMaxFalloff()
|
|
||||||
{
|
|
||||||
return m_maxFalloff;
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_ColorCorrection::SetWeight( float fWeight )
|
|
||||||
{
|
|
||||||
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, fWeight, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_ColorCorrection::StartFade( float flDuration )
|
|
||||||
{
|
|
||||||
m_flFadeStartTime = gpGlobals->curtime;
|
|
||||||
m_flFadeDuration = MAX( flDuration, 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
float C_ColorCorrection::GetFadeRatio() const
|
|
||||||
{
|
|
||||||
float flRatio = 1.0f;
|
|
||||||
|
|
||||||
if ( m_flFadeDuration != 0.0f )
|
|
||||||
{
|
|
||||||
flRatio = ( gpGlobals->curtime - m_flFadeStartTime ) / m_flFadeDuration;
|
|
||||||
flRatio = clamp( flRatio, 0.0f, 1.0f );
|
|
||||||
}
|
|
||||||
return flRatio;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_ColorCorrection::IsFadeTimeElapsed() const
|
|
||||||
{
|
|
||||||
return ( ( gpGlobals->curtime - m_flFadeStartTime ) > m_flFadeDuration ) ||
|
|
||||||
( ( gpGlobals->curtime - m_flFadeStartTime ) < 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateColorCorrectionEntities( C_BasePlayer *pPlayer, float ccScale, C_ColorCorrection **pList, int listCount )
|
|
||||||
{
|
|
||||||
for ( int i = 0; i < listCount; i++ )
|
|
||||||
{
|
|
||||||
pList[i]->Update(pPlayer, ccScale);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void C_ColorCorrection::ClientThink()
|
void C_ColorCorrection::ClientThink()
|
||||||
{
|
{
|
||||||
if ( m_CCHandle == INVALID_CLIENT_CCHANDLE )
|
if ( m_CCHandle == INVALID_CLIENT_CCHANDLE )
|
||||||
@ -286,7 +141,6 @@ void C_ColorCorrection::ClientThink()
|
|||||||
|
|
||||||
BaseClass::ClientThink();
|
BaseClass::ClientThink();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,88 +0,0 @@
|
|||||||
//========= Mapbase - https://github.com/mapbase-source/source-sdk-2013 ============//
|
|
||||||
//
|
|
||||||
// Note that this header exists in the Alien Swarm SDK, but not in stock Source SDK 2013.
|
|
||||||
// Although technically a new Mapbase file, it only serves to move otherwise identical code,
|
|
||||||
// so most code and repo conventions will pretend it was always there.
|
|
||||||
//
|
|
||||||
// --------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Purpose: Color correction entity with simple radial falloff
|
|
||||||
//
|
|
||||||
//=============================================================================//
|
|
||||||
|
|
||||||
#ifndef C_COLORCORRECTION_H
|
|
||||||
#define C_COLORCORRECTION_H
|
|
||||||
#ifdef _WIN32
|
|
||||||
#pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "colorcorrectionmgr.h"
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// Purpose : Color correction entity with radial falloff
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
class C_ColorCorrection : public C_BaseEntity
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DECLARE_CLASS( C_ColorCorrection, C_BaseEntity );
|
|
||||||
|
|
||||||
DECLARE_CLIENTCLASS();
|
|
||||||
|
|
||||||
C_ColorCorrection();
|
|
||||||
virtual ~C_ColorCorrection();
|
|
||||||
|
|
||||||
void OnDataChanged(DataUpdateType_t updateType);
|
|
||||||
bool ShouldDraw();
|
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
virtual void Update(C_BasePlayer *pPlayer, float ccScale);
|
|
||||||
|
|
||||||
bool IsMaster() const { return m_bMaster; }
|
|
||||||
bool IsClientSide() const;
|
|
||||||
bool IsExclusive() const { return m_bExclusive; }
|
|
||||||
|
|
||||||
void EnableOnClient( bool bEnable, bool bSkipFade = false );
|
|
||||||
|
|
||||||
Vector GetOrigin();
|
|
||||||
float GetMinFalloff();
|
|
||||||
float GetMaxFalloff();
|
|
||||||
|
|
||||||
void SetWeight( float fWeight );
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void StartFade( float flDuration );
|
|
||||||
float GetFadeRatio() const;
|
|
||||||
bool IsFadeTimeElapsed() const;
|
|
||||||
#else
|
|
||||||
void ClientThink();
|
|
||||||
|
|
||||||
private:
|
|
||||||
#endif
|
|
||||||
Vector m_vecOrigin;
|
|
||||||
|
|
||||||
float m_minFalloff;
|
|
||||||
float m_maxFalloff;
|
|
||||||
float m_flCurWeight;
|
|
||||||
char m_netLookupFilename[MAX_PATH];
|
|
||||||
|
|
||||||
bool m_bEnabled;
|
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
float m_flFadeInDuration;
|
|
||||||
float m_flFadeOutDuration;
|
|
||||||
float m_flMaxWeight;
|
|
||||||
|
|
||||||
bool m_bMaster;
|
|
||||||
bool m_bClientSide;
|
|
||||||
bool m_bExclusive;
|
|
||||||
|
|
||||||
bool m_bFadingIn;
|
|
||||||
float m_flFadeStartWeight;
|
|
||||||
float m_flFadeStartTime;
|
|
||||||
float m_flFadeDuration;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ClientCCHandle_t m_CCHandle;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
@ -36,26 +36,9 @@ public:
|
|||||||
void OnDataChanged(DataUpdateType_t updateType);
|
void OnDataChanged(DataUpdateType_t updateType);
|
||||||
bool ShouldDraw();
|
bool ShouldDraw();
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
void Update( C_BasePlayer *pPlayer, float ccScale );
|
|
||||||
|
|
||||||
void StartTouch( C_BaseEntity *pOther );
|
|
||||||
void EndTouch( C_BaseEntity *pOther );
|
|
||||||
#else
|
|
||||||
void ClientThink();
|
void ClientThink();
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
float m_LastEnterWeight;
|
|
||||||
float m_LastEnterTime;
|
|
||||||
|
|
||||||
float m_LastExitWeight;
|
|
||||||
float m_LastExitTime;
|
|
||||||
bool m_bEnabled;
|
|
||||||
float m_MaxWeight;
|
|
||||||
float m_FadeDuration;
|
|
||||||
#endif
|
|
||||||
float m_Weight;
|
float m_Weight;
|
||||||
char m_lookupFilename[MAX_PATH];
|
char m_lookupFilename[MAX_PATH];
|
||||||
|
|
||||||
@ -63,11 +46,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT(C_ColorCorrectionVolume, DT_ColorCorrectionVolume, CColorCorrectionVolume)
|
IMPLEMENT_CLIENTCLASS_DT(C_ColorCorrectionVolume, DT_ColorCorrectionVolume, CColorCorrectionVolume)
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
RecvPropBool( RECVINFO( m_bEnabled ) ),
|
|
||||||
RecvPropFloat( RECVINFO( m_MaxWeight ) ),
|
|
||||||
RecvPropFloat( RECVINFO( m_FadeDuration ) ),
|
|
||||||
#endif
|
|
||||||
RecvPropFloat( RECVINFO(m_Weight) ),
|
RecvPropFloat( RECVINFO(m_Weight) ),
|
||||||
RecvPropString( RECVINFO(m_lookupFilename) ),
|
RecvPropString( RECVINFO(m_lookupFilename) ),
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
@ -104,21 +82,11 @@ void C_ColorCorrectionVolume::OnDataChanged(DataUpdateType_t updateType)
|
|||||||
{
|
{
|
||||||
if ( m_CCHandle == INVALID_CLIENT_CCHANDLE )
|
if ( m_CCHandle == INVALID_CLIENT_CCHANDLE )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
// forming a unique name without extension
|
|
||||||
char cleanName[MAX_PATH];
|
|
||||||
V_StripExtension( m_lookupFilename, cleanName, sizeof( cleanName ) );
|
|
||||||
char name[MAX_PATH];
|
|
||||||
Q_snprintf( name, MAX_PATH, "%s_%d", cleanName, entindex() );
|
|
||||||
|
|
||||||
m_CCHandle = g_pColorCorrectionMgr->AddColorCorrectionVolume( this, name, m_lookupFilename );
|
|
||||||
#else
|
|
||||||
char filename[MAX_PATH];
|
char filename[MAX_PATH];
|
||||||
Q_strncpy( filename, m_lookupFilename, MAX_PATH );
|
Q_strncpy( filename, m_lookupFilename, MAX_PATH );
|
||||||
|
|
||||||
m_CCHandle = g_pColorCorrectionMgr->AddColorCorrection( filename );
|
m_CCHandle = g_pColorCorrectionMgr->AddColorCorrection( filename );
|
||||||
SetNextClientThink( ( m_CCHandle != INVALID_CLIENT_CCHANDLE ) ? CLIENT_THINK_ALWAYS : CLIENT_THINK_NEVER );
|
SetNextClientThink( ( m_CCHandle != INVALID_CLIENT_CCHANDLE ) ? CLIENT_THINK_ALWAYS : CLIENT_THINK_NEVER );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,95 +99,11 @@ bool C_ColorCorrectionVolume::ShouldDraw()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
//--------------------------------------------------------------------------------------------------------
|
|
||||||
void C_ColorCorrectionVolume::StartTouch( CBaseEntity *pEntity )
|
|
||||||
{
|
|
||||||
m_LastEnterTime = gpGlobals->curtime;
|
|
||||||
m_LastEnterWeight = m_Weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------
|
|
||||||
void C_ColorCorrectionVolume::EndTouch( CBaseEntity *pEntity )
|
|
||||||
{
|
|
||||||
m_LastExitTime = gpGlobals->curtime;
|
|
||||||
m_LastExitWeight = m_Weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void C_ColorCorrectionVolume::Update( C_BasePlayer *pPlayer, float ccScale )
|
|
||||||
{
|
|
||||||
if ( pPlayer )
|
|
||||||
{
|
|
||||||
bool isTouching = CollisionProp()->IsPointInBounds( pPlayer->EyePosition() );
|
|
||||||
bool wasTouching = m_LastEnterTime > m_LastExitTime;
|
|
||||||
|
|
||||||
if ( isTouching && !wasTouching )
|
|
||||||
{
|
|
||||||
StartTouch( pPlayer );
|
|
||||||
}
|
|
||||||
else if ( !isTouching && wasTouching )
|
|
||||||
{
|
|
||||||
EndTouch( pPlayer );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !m_bEnabled )
|
|
||||||
{
|
|
||||||
m_Weight = 0.0f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( m_LastEnterTime > m_LastExitTime )
|
|
||||||
{
|
|
||||||
// we most recently entered the volume
|
|
||||||
|
|
||||||
if( m_Weight < 1.0f )
|
|
||||||
{
|
|
||||||
float dt = gpGlobals->curtime - m_LastEnterTime;
|
|
||||||
float weight = m_LastEnterWeight + dt / ((1.0f-m_LastEnterWeight)*m_FadeDuration);
|
|
||||||
if( weight>1.0f )
|
|
||||||
weight = 1.0f;
|
|
||||||
|
|
||||||
m_Weight = weight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// we most recently exitted the volume
|
|
||||||
|
|
||||||
if( m_Weight > 0.0f )
|
|
||||||
{
|
|
||||||
float dt = gpGlobals->curtime - m_LastExitTime;
|
|
||||||
float weight = (1.0f-m_LastExitWeight) + dt / (m_LastExitWeight*m_FadeDuration);
|
|
||||||
if( weight>1.0f )
|
|
||||||
weight = 1.0f;
|
|
||||||
|
|
||||||
m_Weight = 1.0f - weight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vector entityPosition = GetAbsOrigin();
|
|
||||||
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, m_Weight * ccScale );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void UpdateColorCorrectionVolumes( C_BasePlayer *pPlayer, float ccScale, C_ColorCorrectionVolume **pList, int listCount )
|
|
||||||
{
|
|
||||||
for ( int i = 0; i < listCount; i++ )
|
|
||||||
{
|
|
||||||
pList[i]->Update(pPlayer, ccScale);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void C_ColorCorrectionVolume::ClientThink()
|
void C_ColorCorrectionVolume::ClientThink()
|
||||||
{
|
{
|
||||||
Vector entityPosition = GetAbsOrigin();
|
Vector entityPosition = GetAbsOrigin();
|
||||||
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, m_Weight );
|
g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, m_Weight );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
//
|
//
|
||||||
//=============================================================================//
|
//=============================================================================//
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "c_effects.h"
|
|
||||||
#include "c_tracer.h"
|
#include "c_tracer.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include "initializer.h"
|
#include "initializer.h"
|
||||||
@ -23,7 +22,6 @@
|
|||||||
#include "collisionutils.h"
|
#include "collisionutils.h"
|
||||||
#include "tier0/vprof.h"
|
#include "tier0/vprof.h"
|
||||||
#include "viewrender.h"
|
#include "viewrender.h"
|
||||||
#include "raytrace.h"
|
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
@ -37,15 +35,6 @@ float g_flSplashLifetime = 0.5f;
|
|||||||
float g_flSplashAlpha = 0.3f;
|
float g_flSplashAlpha = 0.3f;
|
||||||
ConVar r_RainSplashPercentage( "r_RainSplashPercentage", "20", FCVAR_CHEAT ); // N% chance of a rain particle making a splash.
|
ConVar r_RainSplashPercentage( "r_RainSplashPercentage", "20", FCVAR_CHEAT ); // N% chance of a rain particle making a splash.
|
||||||
|
|
||||||
ConVar r_RainParticleDensity( "r_RainParticleDensity", "1", FCVAR_NONE, "Density of Particle Rain 0-1" );
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVar r_RainParticleClampOffset_Rain( "r_RainParticleClampOffset_Rain", "120", FCVAR_NONE, "How far inward or outward to extrude clamped precipitation particle systems using the 'Particle Rain' type." );
|
|
||||||
ConVar r_RainParticleClampOffset_Ash( "r_RainParticleClampOffset_Ash", "300", FCVAR_NONE, "How far inward or outward to extrude clamped precipitation particle systems using the 'Particle Ash' type." );
|
|
||||||
ConVar r_RainParticleClampOffset_RainStorm( "r_RainParticleClampOffset_RainStorm", "112", FCVAR_NONE, "How far inward or outward to extrude clamped precipitation particle systems using the 'Particle Rain Storm' type." );
|
|
||||||
ConVar r_RainParticleClampOffset_Snow( "r_RainParticleClampOffset_Snow", "300", FCVAR_NONE, "How far inward or outward to extrude clamped precipitation particle systems using the 'Particle Snow' type." );
|
|
||||||
ConVar r_RainParticleClampDebug( "r_RainParticleClampDebug", "0", FCVAR_NONE, "Enables debug code for precipitation particle system clamping" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float GUST_INTERVAL_MIN = 1;
|
float GUST_INTERVAL_MIN = 1;
|
||||||
float GUST_INTERVAL_MAX = 2;
|
float GUST_INTERVAL_MAX = 2;
|
||||||
@ -71,14 +60,151 @@ CLIENTEFFECT_MATERIAL( "particle/rain" )
|
|||||||
CLIENTEFFECT_MATERIAL( "particle/snow" )
|
CLIENTEFFECT_MATERIAL( "particle/snow" )
|
||||||
CLIENTEFFECT_REGISTER_END()
|
CLIENTEFFECT_REGISTER_END()
|
||||||
|
|
||||||
CUtlVector< RayTracingEnvironment* > g_RayTraceEnvironments;
|
//-----------------------------------------------------------------------------
|
||||||
|
// Precipitation particle type
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class CPrecipitationParticle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Vector m_Pos;
|
||||||
|
Vector m_Velocity;
|
||||||
|
float m_SpawnTime; // Note: Tweak with this to change lifetime
|
||||||
|
float m_Mass;
|
||||||
|
float m_Ramp;
|
||||||
|
|
||||||
|
float m_flCurLifetime;
|
||||||
|
float m_flMaxLifetime;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CClient_Precipitation;
|
||||||
|
static CUtlVector<CClient_Precipitation*> g_Precipitations;
|
||||||
|
|
||||||
|
//===========
|
||||||
|
// Snow fall
|
||||||
|
//===========
|
||||||
|
class CSnowFallManager;
|
||||||
|
static CSnowFallManager *s_pSnowFallMgr = NULL;
|
||||||
|
bool SnowFallManagerCreate( CClient_Precipitation *pSnowEntity );
|
||||||
|
void SnowFallManagerDestroy( void );
|
||||||
|
|
||||||
|
class AshDebrisEffect : public CSimpleEmitter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AshDebrisEffect( const char *pDebugName ) : CSimpleEmitter( pDebugName ) {}
|
||||||
|
|
||||||
|
static AshDebrisEffect* Create( const char *pDebugName );
|
||||||
|
|
||||||
|
virtual float UpdateAlpha( const SimpleParticle *pParticle );
|
||||||
|
virtual float UpdateRoll( SimpleParticle *pParticle, float timeDelta );
|
||||||
|
|
||||||
|
private:
|
||||||
|
AshDebrisEffect( const AshDebrisEffect & );
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Precipitation base entity
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class CClient_Precipitation : public C_BaseEntity
|
||||||
|
{
|
||||||
|
class CPrecipitationEffect;
|
||||||
|
friend class CClient_Precipitation::CPrecipitationEffect;
|
||||||
|
|
||||||
|
public:
|
||||||
|
DECLARE_CLASS( CClient_Precipitation, C_BaseEntity );
|
||||||
|
DECLARE_CLIENTCLASS();
|
||||||
|
|
||||||
|
CClient_Precipitation();
|
||||||
|
virtual ~CClient_Precipitation();
|
||||||
|
|
||||||
|
// Inherited from C_BaseEntity
|
||||||
|
virtual void Precache( );
|
||||||
|
|
||||||
|
void Render();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Creates a single particle
|
||||||
|
CPrecipitationParticle* CreateParticle();
|
||||||
|
|
||||||
|
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||||
|
virtual void ClientThink();
|
||||||
|
|
||||||
|
void Simulate( float dt );
|
||||||
|
|
||||||
|
// Renders the particle
|
||||||
|
void RenderParticle( CPrecipitationParticle* pParticle, CMeshBuilder &mb );
|
||||||
|
|
||||||
|
void CreateWaterSplashes();
|
||||||
|
|
||||||
|
// Emits the actual particles
|
||||||
|
void EmitParticles( float fTimeDelta );
|
||||||
|
|
||||||
|
// Computes where we're gonna emit
|
||||||
|
bool ComputeEmissionArea( Vector& origin, Vector2D& size );
|
||||||
|
|
||||||
|
// Gets the tracer width and speed
|
||||||
|
float GetWidth() const;
|
||||||
|
float GetLength() const;
|
||||||
|
float GetSpeed() const;
|
||||||
|
|
||||||
|
// Gets the remaining lifetime of the particle
|
||||||
|
float GetRemainingLifetime( CPrecipitationParticle* pParticle ) const;
|
||||||
|
|
||||||
|
// Computes the wind vector
|
||||||
|
static void ComputeWindVector( );
|
||||||
|
|
||||||
|
// simulation methods
|
||||||
|
bool SimulateRain( CPrecipitationParticle* pParticle, float dt );
|
||||||
|
bool SimulateSnow( CPrecipitationParticle* pParticle, float dt );
|
||||||
|
|
||||||
|
void CreateAshParticle( void );
|
||||||
|
void CreateRainOrSnowParticle( Vector vSpawnPosition, Vector vVelocity );
|
||||||
|
|
||||||
|
// Information helpful in creating and rendering particles
|
||||||
|
IMaterial *m_MatHandle; // material used
|
||||||
|
|
||||||
|
float m_Color[4]; // precip color
|
||||||
|
float m_Lifetime; // Precip lifetime
|
||||||
|
float m_InitialRamp; // Initial ramp value
|
||||||
|
float m_Speed; // Precip speed
|
||||||
|
float m_Width; // Tracer width
|
||||||
|
float m_Remainder; // particles we should render next time
|
||||||
|
PrecipitationType_t m_nPrecipType; // Precip type
|
||||||
|
float m_flHalfScreenWidth; // Precalculated each frame.
|
||||||
|
|
||||||
|
float m_flDensity;
|
||||||
|
|
||||||
|
// Some state used in rendering and simulation
|
||||||
|
// Used to modify the rain density and wind from the console
|
||||||
|
static ConVar s_raindensity;
|
||||||
|
static ConVar s_rainwidth;
|
||||||
|
static ConVar s_rainlength;
|
||||||
|
static ConVar s_rainspeed;
|
||||||
|
|
||||||
|
static Vector s_WindVector; // Stores the wind speed vector
|
||||||
|
|
||||||
|
CUtlLinkedList<CPrecipitationParticle> m_Particles;
|
||||||
|
CUtlVector<Vector> m_Splashes;
|
||||||
|
|
||||||
|
CSmartPtr<AshDebrisEffect> m_pAshEmitter;
|
||||||
|
TimedEvent m_tAshParticleTimer;
|
||||||
|
TimedEvent m_tAshParticleTraceTimer;
|
||||||
|
bool m_bActiveAshEmitter;
|
||||||
|
Vector m_vAshSpawnOrigin;
|
||||||
|
|
||||||
|
int m_iAshCount;
|
||||||
|
|
||||||
|
private:
|
||||||
|
CClient_Precipitation( const CClient_Precipitation & ); // not defined, not accessible
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Just receive the normal data table stuff
|
// Just receive the normal data table stuff
|
||||||
IMPLEMENT_CLIENTCLASS_DT(CClient_Precipitation, DT_Precipitation, CPrecipitation)
|
IMPLEMENT_CLIENTCLASS_DT(CClient_Precipitation, DT_Precipitation, CPrecipitation)
|
||||||
RecvPropInt( RECVINFO( m_nPrecipType ) ),
|
RecvPropInt( RECVINFO( m_nPrecipType ) )
|
||||||
#ifdef MAPBASE
|
|
||||||
RecvPropInt( RECVINFO( m_spawnflags ) ),
|
|
||||||
#endif
|
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
static ConVar r_SnowEnable( "r_SnowEnable", "1", FCVAR_CHEAT, "Snow Enable" );
|
static ConVar r_SnowEnable( "r_SnowEnable", "1", FCVAR_CHEAT, "Snow Enable" );
|
||||||
@ -270,12 +396,6 @@ inline bool CClient_Precipitation::SimulateSnow( CPrecipitationParticle* pPartic
|
|||||||
|
|
||||||
void CClient_Precipitation::Simulate( float dt )
|
void CClient_Precipitation::Simulate( float dt )
|
||||||
{
|
{
|
||||||
if ( IsParticleRainType(m_nPrecipType) )
|
|
||||||
{
|
|
||||||
CreateParticlePrecip();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: When client-side prechaching works, we need to remove this
|
// NOTE: When client-side prechaching works, we need to remove this
|
||||||
Precache();
|
Precache();
|
||||||
|
|
||||||
@ -352,9 +472,6 @@ inline void CClient_Precipitation::RenderParticle( CPrecipitationParticle* pPart
|
|||||||
float scale;
|
float scale;
|
||||||
Vector start, delta;
|
Vector start, delta;
|
||||||
|
|
||||||
if ( IsParticleRainType(m_nPrecipType) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( m_nPrecipType == PRECIPITATION_TYPE_ASH )
|
if ( m_nPrecipType == PRECIPITATION_TYPE_ASH )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -445,9 +562,6 @@ void CClient_Precipitation::Render()
|
|||||||
if ( !r_DrawRain.GetInt() )
|
if ( !r_DrawRain.GetInt() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( IsParticleRainType(m_nPrecipType) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Don't render in monitors or in reflections or refractions.
|
// Don't render in monitors or in reflections or refractions.
|
||||||
if ( CurrentViewID() == VIEW_MONITOR )
|
if ( CurrentViewID() == VIEW_MONITOR )
|
||||||
return;
|
return;
|
||||||
@ -519,11 +633,6 @@ CClient_Precipitation::CClient_Precipitation() : m_Remainder(0.0f)
|
|||||||
m_MatHandle = INVALID_MATERIAL_HANDLE;
|
m_MatHandle = INVALID_MATERIAL_HANDLE;
|
||||||
m_flHalfScreenWidth = 1;
|
m_flHalfScreenWidth = 1;
|
||||||
|
|
||||||
m_pParticlePrecipInnerNear = NULL;
|
|
||||||
m_pParticlePrecipInnerFar = NULL;
|
|
||||||
m_pParticlePrecipOuter = NULL;
|
|
||||||
m_bActiveParticlePrecipEmitter = false;
|
|
||||||
|
|
||||||
g_Precipitations.AddToTail( this );
|
g_Precipitations.AddToTail( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -902,397 +1011,6 @@ void CClient_Precipitation::CreateAshParticle( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient_Precipitation::PrecacheParticlePrecip( void )
|
|
||||||
{
|
|
||||||
if ( m_nPrecipType == PRECIPITATION_TYPE_PARTICLEASH )
|
|
||||||
{
|
|
||||||
PrecacheParticleSystem( "ash" );
|
|
||||||
PrecacheParticleSystem( "ash_outer" );
|
|
||||||
}
|
|
||||||
else if ( m_nPrecipType == PRECIPITATION_TYPE_PARTICLESNOW )
|
|
||||||
{
|
|
||||||
PrecacheParticleSystem( "snow" );
|
|
||||||
PrecacheParticleSystem( "snow_outer" );
|
|
||||||
}
|
|
||||||
else if ( m_nPrecipType == PRECIPITATION_TYPE_PARTICLERAINSTORM )
|
|
||||||
{
|
|
||||||
PrecacheParticleSystem( "rain_storm" );
|
|
||||||
PrecacheParticleSystem( "rain_storm_screen" );
|
|
||||||
PrecacheParticleSystem( "rain_storm_outer" );
|
|
||||||
}
|
|
||||||
else //default to rain
|
|
||||||
{
|
|
||||||
PrecacheParticleSystem( "rain" );
|
|
||||||
PrecacheParticleSystem( "rain_outer" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::CreateParticlePrecip( void )
|
|
||||||
{
|
|
||||||
if ( !m_bParticlePrecipInitialized )
|
|
||||||
{
|
|
||||||
PrecacheParticlePrecip();
|
|
||||||
InitializeParticlePrecip();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
|
|
||||||
|
|
||||||
if ( pPlayer == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Make sure the emitter is setup
|
|
||||||
if ( !m_bActiveParticlePrecipEmitter )
|
|
||||||
{
|
|
||||||
//Update 8 times per second.
|
|
||||||
m_tParticlePrecipTraceTimer.Init( 8 );
|
|
||||||
DestroyInnerParticlePrecip();
|
|
||||||
DestroyOuterParticlePrecip();
|
|
||||||
m_bActiveParticlePrecipEmitter = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateParticlePrecip( pPlayer );
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
void CClient_Precipitation::ClampParticlePosition( Vector &vPlayerPos, Vector &vOffsetPos, Vector &vOffsetPosNear, Vector &vOffsetPosFar )
|
|
||||||
{
|
|
||||||
Vector mins, maxs;
|
|
||||||
modelinfo->GetModelBounds( GetModel(), mins, maxs );
|
|
||||||
|
|
||||||
// Account for precipitation height
|
|
||||||
maxs.z += 180;
|
|
||||||
|
|
||||||
Vector vecOrigin; //= WorldSpaceCenter();
|
|
||||||
VectorLerp( mins, maxs, 0.5f, vecOrigin );
|
|
||||||
|
|
||||||
maxs -= vecOrigin;
|
|
||||||
mins -= vecOrigin;
|
|
||||||
|
|
||||||
//float flMax = r_RainParticleClampOffset.GetFloat();
|
|
||||||
float flMax = 0;
|
|
||||||
switch (m_nPrecipType)
|
|
||||||
{
|
|
||||||
case PRECIPITATION_TYPE_PARTICLERAIN:
|
|
||||||
flMax = r_RainParticleClampOffset_Rain.GetFloat();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PRECIPITATION_TYPE_PARTICLEASH:
|
|
||||||
flMax = r_RainParticleClampOffset_Ash.GetFloat();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PRECIPITATION_TYPE_PARTICLERAINSTORM:
|
|
||||||
flMax = r_RainParticleClampOffset_RainStorm.GetFloat();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PRECIPITATION_TYPE_PARTICLESNOW:
|
|
||||||
flMax = r_RainParticleClampOffset_Snow.GetFloat();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector addend( flMax, flMax, 0 );
|
|
||||||
mins += addend;
|
|
||||||
maxs -= addend;
|
|
||||||
|
|
||||||
if (flMax > 0)
|
|
||||||
{
|
|
||||||
// Unless this is extruding outwards, make sure the offset isn't inverting the bounds.
|
|
||||||
// This means precipitation triggers with bounds less than offset*2 will turn into a thin line
|
|
||||||
// and the involved precipitation will pretty much be spatial at all times, which is okay.
|
|
||||||
mins.x = clamp( mins.x, -FLT_MAX, -1 );
|
|
||||||
mins.y = clamp( mins.y, -FLT_MAX, -1 );
|
|
||||||
maxs.x = clamp( maxs.x, 1, FLT_MAX );
|
|
||||||
maxs.y = clamp( maxs.y, 1, FLT_MAX );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r_RainParticleClampDebug.GetBool())
|
|
||||||
debugoverlay->AddBoxOverlay( vecOrigin, mins, maxs, vec3_angle, 255, 0, 0, 128, 0.15f );
|
|
||||||
|
|
||||||
maxs += vecOrigin;
|
|
||||||
mins += vecOrigin;
|
|
||||||
|
|
||||||
CalcClosestPointOnAABB( mins, maxs, vPlayerPos, vPlayerPos );
|
|
||||||
CalcClosestPointOnAABB( mins, maxs, vOffsetPos, vOffsetPos );
|
|
||||||
CalcClosestPointOnAABB( mins, maxs, vOffsetPosNear, vOffsetPosNear );
|
|
||||||
CalcClosestPointOnAABB( mins, maxs, vOffsetPosFar, vOffsetPosFar );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void CClient_Precipitation::UpdateParticlePrecip( C_BasePlayer *pPlayer )
|
|
||||||
{
|
|
||||||
if ( !pPlayer )
|
|
||||||
return;
|
|
||||||
|
|
||||||
Vector vForward;
|
|
||||||
Vector vRight;
|
|
||||||
|
|
||||||
pPlayer->GetVectors( &vForward, &vRight, NULL );
|
|
||||||
vForward.z = 0.0f;
|
|
||||||
vForward.NormalizeInPlace();
|
|
||||||
Vector vForward45Right = vForward + vRight;
|
|
||||||
Vector vForward45Left = vForward - vRight;
|
|
||||||
vForward45Right.NormalizeInPlace();
|
|
||||||
vForward45Left.NormalizeInPlace();
|
|
||||||
fltx4 TMax = ReplicateX4( 320.0f );
|
|
||||||
SubFloat( TMax, 3 ) = FLT_MAX;
|
|
||||||
float curTime = gpGlobals->frametime;
|
|
||||||
|
|
||||||
while ( m_tParticlePrecipTraceTimer.NextEvent( curTime ) )
|
|
||||||
{
|
|
||||||
Vector vPlayerPos = pPlayer->EyePosition();
|
|
||||||
Vector vOffsetPos = vPlayerPos + Vector ( 0, 0, 180 );
|
|
||||||
Vector vOffsetPosNear = vPlayerPos + Vector ( 0, 0, 180 ) + ( vForward * 32 );
|
|
||||||
Vector vOffsetPosFar = vPlayerPos + Vector ( 0, 0, 180 ) + ( vForward * 100 );
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if (m_spawnflags & SF_PRECIP_PARTICLE_CLAMP)
|
|
||||||
{
|
|
||||||
ClampParticlePosition( vPlayerPos, vOffsetPos, vOffsetPosNear, vOffsetPosFar );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Vector vDensity = Vector( r_RainParticleDensity.GetFloat(), 0, 0 ) * m_flDensity;
|
|
||||||
|
|
||||||
// Get the rain volume Ray Tracing Environment. Currently hard coded to 0, should have this lookup
|
|
||||||
RayTracingEnvironment *RtEnv = g_RayTraceEnvironments.Element( 0 );
|
|
||||||
|
|
||||||
// Our 4 Rays are forward, off to the left and right, and directly up.
|
|
||||||
// Use the first three to determine if there's generally visible rain where we're looking.
|
|
||||||
// The forth, straight up, tells us if we're standing inside a rain volume
|
|
||||||
// (based on the normal that we hit or if we miss entirely)
|
|
||||||
FourRays frRays;
|
|
||||||
FourVectors fvDirection;
|
|
||||||
fvDirection = FourVectors( vForward, vForward45Left, vForward45Right, Vector( 0, 0, 1 ) );
|
|
||||||
frRays.direction = fvDirection;
|
|
||||||
frRays.origin.DuplicateVector( vPlayerPos );
|
|
||||||
RayTracingResult Result;
|
|
||||||
|
|
||||||
RtEnv->Trace4Rays( frRays, Four_Zeros, TMax, &Result );
|
|
||||||
|
|
||||||
i32x4 in4HitIds = LoadAlignedIntSIMD( Result.HitIds );
|
|
||||||
fltx4 fl4HitIds = SignedIntConvertToFltSIMD ( in4HitIds );
|
|
||||||
|
|
||||||
fltx4 fl4Tolerance = ReplicateX4( 300.0f );
|
|
||||||
// ignore upwards test for tolerance, as we may be below an area which is raining, but with it not visible in front of us
|
|
||||||
//SubFloat( fl4Tolerance, 3 ) = 0.0f;
|
|
||||||
|
|
||||||
bool bInside = ( Result.HitIds[3] != -1 && Result.surface_normal.Vec( 3 ).z < 0.0f );
|
|
||||||
bool bNearby = ( IsAnyNegative ( CmpGeSIMD ( fl4HitIds, Four_Zeros ) ) && IsAnyNegative( CmpGeSIMD( fl4Tolerance, Result.HitDistance ) ) );
|
|
||||||
|
|
||||||
if ( bInside || bNearby )
|
|
||||||
{
|
|
||||||
//We can see a rain volume, but it's farther than 180 units away, only use far effect.
|
|
||||||
if ( !bInside && SubFloat( FindLowestSIMD3( Result.HitDistance ), 0 ) >= m_flParticleInnerDist )
|
|
||||||
{
|
|
||||||
// Kill the inner rain if it's previously been in use
|
|
||||||
if ( m_pParticlePrecipInnerNear != NULL )
|
|
||||||
{
|
|
||||||
DestroyInnerParticlePrecip();
|
|
||||||
}
|
|
||||||
// Update if we've already got systems, otherwise, create them.
|
|
||||||
if ( m_pParticlePrecipOuter != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 1, vOffsetPos );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DispatchOuterParticlePrecip( pPlayer, vForward );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else //We're close enough to use the near effect.
|
|
||||||
{
|
|
||||||
// Update if we've already got systems, otherwise, create them.
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// The outer can now be suppressed without interfering with other functionality
|
|
||||||
if ( m_pParticlePrecipOuter != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 1, vOffsetPos );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
if ( m_pParticlePrecipInnerNear != NULL && m_pParticlePrecipInnerFar != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPoint( 1, vOffsetPosNear );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPoint( 1, vOffsetPosFar );
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPoint( 3, vDensity );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if ( m_pParticlePrecipInnerNear != NULL && m_pParticlePrecipInnerFar != NULL && m_pParticlePrecipOuter != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 1, vOffsetPos );
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPoint( 1, vOffsetPosNear );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPoint( 1, vOffsetPosFar );
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPoint( 3, vDensity );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPoint( 3, vDensity );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DispatchInnerParticlePrecip( pPlayer, vForward );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // No rain in the area, kill any leftover systems.
|
|
||||||
{
|
|
||||||
DestroyInnerParticlePrecip();
|
|
||||||
DestroyOuterParticlePrecip();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::InitializeParticlePrecip( void )
|
|
||||||
{
|
|
||||||
//Set up which type of precipitation particle we'll use
|
|
||||||
if ( m_nPrecipType == PRECIPITATION_TYPE_PARTICLEASH )
|
|
||||||
{
|
|
||||||
m_pParticleInnerNearDef = "ash";
|
|
||||||
m_pParticleInnerFarDef = "ash";
|
|
||||||
m_pParticleOuterDef = "ash_outer";
|
|
||||||
m_flParticleInnerDist = 280.0;
|
|
||||||
}
|
|
||||||
else if ( m_nPrecipType == PRECIPITATION_TYPE_PARTICLESNOW )
|
|
||||||
{
|
|
||||||
m_pParticleInnerNearDef = "snow";
|
|
||||||
m_pParticleInnerFarDef = "snow";
|
|
||||||
m_pParticleOuterDef = "snow_outer";
|
|
||||||
m_flParticleInnerDist = 280.0;
|
|
||||||
}
|
|
||||||
else if ( m_nPrecipType == PRECIPITATION_TYPE_PARTICLERAINSTORM )
|
|
||||||
{
|
|
||||||
m_pParticleInnerNearDef = "rain_storm";
|
|
||||||
m_pParticleInnerFarDef = "rain_storm_screen";
|
|
||||||
m_pParticleOuterDef = "rain_storm_outer";
|
|
||||||
m_flParticleInnerDist = 0.0;
|
|
||||||
}
|
|
||||||
else //default to rain
|
|
||||||
{
|
|
||||||
m_pParticleInnerNearDef = "rain";
|
|
||||||
m_pParticleInnerFarDef = "rain";
|
|
||||||
m_pParticleOuterDef = "rain_outer";
|
|
||||||
m_flParticleInnerDist = 180.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert( m_pParticleInnerFarDef != NULL );
|
|
||||||
|
|
||||||
//We'll want to change this if/when we add more raytrace environments.
|
|
||||||
g_RayTraceEnvironments.PurgeAndDeleteElements();
|
|
||||||
|
|
||||||
// Sets up ray tracing environments for all func_precipitations and func_precipitation_blockers
|
|
||||||
RayTracingEnvironment *rtEnvRainEmission = new RayTracingEnvironment();
|
|
||||||
g_RayTraceEnvironments.AddToTail( rtEnvRainEmission );
|
|
||||||
RayTracingEnvironment *rtEnvRainBlocker = new RayTracingEnvironment();
|
|
||||||
g_RayTraceEnvironments.AddToTail( rtEnvRainBlocker );
|
|
||||||
|
|
||||||
rtEnvRainEmission->Flags |= RTE_FLAGS_DONT_STORE_TRIANGLE_COLORS; // save some ram
|
|
||||||
rtEnvRainBlocker->Flags |= RTE_FLAGS_DONT_STORE_TRIANGLE_COLORS; // save some ram
|
|
||||||
|
|
||||||
int nTriCount = 1;
|
|
||||||
for ( int i=0; i<g_Precipitations.Count(); ++i )
|
|
||||||
{
|
|
||||||
CClient_Precipitation *volume = g_Precipitations[i];
|
|
||||||
|
|
||||||
vcollide_t *pCollide = modelinfo->GetVCollide( volume->GetModelIndex() );
|
|
||||||
|
|
||||||
if ( !pCollide || pCollide->solidCount <= 0 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Vector *outVerts;
|
|
||||||
int vertCount = physcollision->CreateDebugMesh( pCollide->solids[0], &outVerts );
|
|
||||||
|
|
||||||
if ( vertCount )
|
|
||||||
{
|
|
||||||
for ( int j = 0; j < vertCount; j += 3 )
|
|
||||||
{
|
|
||||||
rtEnvRainEmission->AddTriangle( nTriCount++, outVerts[j], outVerts[j + 1], outVerts[j + 2], Vector( 1, 1, 1 ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
physcollision->DestroyDebugMesh( vertCount, outVerts );
|
|
||||||
}
|
|
||||||
rtEnvRainEmission->SetupAccelerationStructure();
|
|
||||||
|
|
||||||
m_bParticlePrecipInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::DestroyInnerParticlePrecip( void )
|
|
||||||
{
|
|
||||||
if ( m_pParticlePrecipInnerFar != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipInnerFar->StopEmission();
|
|
||||||
m_pParticlePrecipInnerFar = NULL;
|
|
||||||
}
|
|
||||||
if ( m_pParticlePrecipInnerNear != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipInnerNear->StopEmission();
|
|
||||||
m_pParticlePrecipInnerNear = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::DestroyOuterParticlePrecip( void )
|
|
||||||
{
|
|
||||||
if ( m_pParticlePrecipOuter != NULL )
|
|
||||||
{
|
|
||||||
m_pParticlePrecipOuter->StopEmission();
|
|
||||||
m_pParticlePrecipOuter = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::DispatchOuterParticlePrecip( C_BasePlayer *pPlayer, Vector vForward )
|
|
||||||
{
|
|
||||||
DestroyOuterParticlePrecip();
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if (m_spawnflags & SF_PRECIP_PARTICLE_NO_OUTER)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Vector vDensity = Vector( r_RainParticleDensity.GetFloat(), 0, 0 ) * m_flDensity;
|
|
||||||
Vector vPlayerPos = pPlayer->EyePosition();
|
|
||||||
|
|
||||||
m_pParticlePrecipOuter = ParticleProp()->Create( m_pParticleOuterDef, PATTACH_ABSORIGIN_FOLLOW );
|
|
||||||
m_pParticlePrecipOuter->SetControlPointEntity( 2, pPlayer );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 1, vPlayerPos + Vector (0, 0, 180 ) );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::DispatchInnerParticlePrecip( C_BasePlayer *pPlayer, Vector vForward )
|
|
||||||
{
|
|
||||||
DestroyInnerParticlePrecip();
|
|
||||||
DestroyOuterParticlePrecip();
|
|
||||||
Vector vPlayerPos = pPlayer->EyePosition();
|
|
||||||
Vector vOffsetPos = vPlayerPos + Vector ( 0, 0, 180 );
|
|
||||||
Vector vOffsetPosNear = vPlayerPos + Vector ( 0, 0, 180 ) + ( vForward * 32 );
|
|
||||||
Vector vOffsetPosFar = vPlayerPos + Vector ( 0, 0, 180 ) + ( vForward * m_flParticleInnerDist ); // 100.0
|
|
||||||
Vector vDensity = Vector( r_RainParticleDensity.GetFloat(), 0, 0 ) * m_flDensity;
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if (m_spawnflags & SF_PRECIP_PARTICLE_CLAMP)
|
|
||||||
{
|
|
||||||
ClampParticlePosition( vPlayerPos, vOffsetPos, vOffsetPosNear, vOffsetPosFar );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if (!(m_spawnflags & SF_PRECIP_PARTICLE_NO_OUTER))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
m_pParticlePrecipOuter = ParticleProp()->Create( m_pParticleOuterDef, PATTACH_ABSORIGIN_FOLLOW );
|
|
||||||
m_pParticlePrecipOuter->SetControlPointEntity( 2, pPlayer );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 1, vOffsetPos );
|
|
||||||
m_pParticlePrecipOuter->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pParticlePrecipInnerNear = ParticleProp()->Create( m_pParticleInnerNearDef, PATTACH_ABSORIGIN_FOLLOW );
|
|
||||||
m_pParticlePrecipInnerFar = ParticleProp()->Create( m_pParticleInnerFarDef, PATTACH_ABSORIGIN_FOLLOW );
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPointEntity( 2, pPlayer );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPointEntity( 2, pPlayer );
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPoint( 1, vOffsetPosNear );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPoint( 1, vOffsetPosFar );
|
|
||||||
m_pParticlePrecipInnerNear->SetControlPoint( 3, vDensity );
|
|
||||||
m_pParticlePrecipInnerFar->SetControlPoint( 3, vDensity );
|
|
||||||
}
|
|
||||||
|
|
||||||
void CClient_Precipitation::CreateRainOrSnowParticle( Vector vSpawnPosition, Vector vVelocity )
|
void CClient_Precipitation::CreateRainOrSnowParticle( Vector vSpawnPosition, Vector vVelocity )
|
||||||
{
|
{
|
||||||
// Create the particle
|
// Create the particle
|
||||||
|
@ -10,182 +10,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "cbase.h"
|
|
||||||
#include "precipitation_shared.h"
|
|
||||||
|
|
||||||
// Draw rain effects.
|
// Draw rain effects.
|
||||||
void DrawPrecipitation();
|
void DrawPrecipitation();
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Precipitation particle type
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class CPrecipitationParticle
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Vector m_Pos;
|
|
||||||
Vector m_Velocity;
|
|
||||||
float m_SpawnTime; // Note: Tweak with this to change lifetime
|
|
||||||
float m_Mass;
|
|
||||||
float m_Ramp;
|
|
||||||
|
|
||||||
float m_flCurLifetime;
|
|
||||||
float m_flMaxLifetime;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class CClient_Precipitation;
|
|
||||||
static CUtlVector<CClient_Precipitation*> g_Precipitations;
|
|
||||||
|
|
||||||
//===========
|
|
||||||
// Snow fall
|
|
||||||
//===========
|
|
||||||
class CSnowFallManager;
|
|
||||||
static CSnowFallManager *s_pSnowFallMgr = NULL;
|
|
||||||
bool SnowFallManagerCreate( CClient_Precipitation *pSnowEntity );
|
|
||||||
void SnowFallManagerDestroy( void );
|
|
||||||
|
|
||||||
class AshDebrisEffect : public CSimpleEmitter
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
AshDebrisEffect( const char *pDebugName ) : CSimpleEmitter( pDebugName ) {}
|
|
||||||
|
|
||||||
static AshDebrisEffect* Create( const char *pDebugName );
|
|
||||||
|
|
||||||
virtual float UpdateAlpha( const SimpleParticle *pParticle );
|
|
||||||
virtual float UpdateRoll( SimpleParticle *pParticle, float timeDelta );
|
|
||||||
|
|
||||||
private:
|
|
||||||
AshDebrisEffect( const AshDebrisEffect & );
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Precipitation base entity
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class CClient_Precipitation : public C_BaseEntity
|
|
||||||
{
|
|
||||||
class CPrecipitationEffect;
|
|
||||||
friend class CClient_Precipitation::CPrecipitationEffect;
|
|
||||||
|
|
||||||
public:
|
|
||||||
DECLARE_CLASS( CClient_Precipitation, C_BaseEntity );
|
|
||||||
DECLARE_CLIENTCLASS();
|
|
||||||
|
|
||||||
CClient_Precipitation();
|
|
||||||
virtual ~CClient_Precipitation();
|
|
||||||
|
|
||||||
// Inherited from C_BaseEntity
|
|
||||||
virtual void Precache( );
|
|
||||||
|
|
||||||
void Render();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Creates a single particle
|
|
||||||
CPrecipitationParticle* CreateParticle();
|
|
||||||
|
|
||||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
|
||||||
virtual void ClientThink();
|
|
||||||
|
|
||||||
void Simulate( float dt );
|
|
||||||
|
|
||||||
// Renders the particle
|
|
||||||
void RenderParticle( CPrecipitationParticle* pParticle, CMeshBuilder &mb );
|
|
||||||
|
|
||||||
void CreateWaterSplashes();
|
|
||||||
|
|
||||||
// Emits the actual particles
|
|
||||||
void EmitParticles( float fTimeDelta );
|
|
||||||
|
|
||||||
// Computes where we're gonna emit
|
|
||||||
bool ComputeEmissionArea( Vector& origin, Vector2D& size );
|
|
||||||
|
|
||||||
// Gets the tracer width and speed
|
|
||||||
float GetWidth() const;
|
|
||||||
float GetLength() const;
|
|
||||||
float GetSpeed() const;
|
|
||||||
|
|
||||||
// Gets the remaining lifetime of the particle
|
|
||||||
float GetRemainingLifetime( CPrecipitationParticle* pParticle ) const;
|
|
||||||
|
|
||||||
// Computes the wind vector
|
|
||||||
static void ComputeWindVector( );
|
|
||||||
|
|
||||||
// simulation methods
|
|
||||||
bool SimulateRain( CPrecipitationParticle* pParticle, float dt );
|
|
||||||
bool SimulateSnow( CPrecipitationParticle* pParticle, float dt );
|
|
||||||
|
|
||||||
void PrecacheParticlePrecip( void );
|
|
||||||
void CreateParticlePrecip( void );
|
|
||||||
void InitializeParticlePrecip( void );
|
|
||||||
void DispatchOuterParticlePrecip( C_BasePlayer *pPlayer, Vector vForward );
|
|
||||||
void DispatchInnerParticlePrecip( C_BasePlayer *pPlayer, Vector vForward );
|
|
||||||
void DestroyOuterParticlePrecip( void );
|
|
||||||
void DestroyInnerParticlePrecip( void );
|
|
||||||
|
|
||||||
void UpdateParticlePrecip( C_BasePlayer *pPlayer );
|
|
||||||
|
|
||||||
private:
|
|
||||||
void CreateAshParticle( void );
|
|
||||||
void CreateRainOrSnowParticle( Vector vSpawnPosition, Vector vVelocity );
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
void ClampParticlePosition( Vector &vPlayerPos, Vector &vOffsetPos, Vector &vOffsetPosNear, Vector &vOffsetPosFar );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Information helpful in creating and rendering particles
|
|
||||||
IMaterial *m_MatHandle; // material used
|
|
||||||
|
|
||||||
float m_Color[4]; // precip color
|
|
||||||
float m_Lifetime; // Precip lifetime
|
|
||||||
float m_InitialRamp; // Initial ramp value
|
|
||||||
float m_Speed; // Precip speed
|
|
||||||
float m_Width; // Tracer width
|
|
||||||
float m_Remainder; // particles we should render next time
|
|
||||||
PrecipitationType_t m_nPrecipType; // Precip type
|
|
||||||
float m_flHalfScreenWidth; // Precalculated each frame.
|
|
||||||
|
|
||||||
float m_flDensity;
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
int m_spawnflags;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Some state used in rendering and simulation
|
|
||||||
// Used to modify the rain density and wind from the console
|
|
||||||
static ConVar s_raindensity;
|
|
||||||
static ConVar s_rainwidth;
|
|
||||||
static ConVar s_rainlength;
|
|
||||||
static ConVar s_rainspeed;
|
|
||||||
|
|
||||||
static Vector s_WindVector; // Stores the wind speed vector
|
|
||||||
|
|
||||||
CUtlLinkedList<CPrecipitationParticle> m_Particles;
|
|
||||||
CUtlVector<Vector> m_Splashes;
|
|
||||||
|
|
||||||
CSmartPtr<AshDebrisEffect> m_pAshEmitter;
|
|
||||||
TimedEvent m_tAshParticleTimer;
|
|
||||||
TimedEvent m_tAshParticleTraceTimer;
|
|
||||||
bool m_bActiveAshEmitter;
|
|
||||||
Vector m_vAshSpawnOrigin;
|
|
||||||
|
|
||||||
int m_iAshCount;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
float m_flParticleInnerDist; //The distance at which to start drawing the inner system
|
|
||||||
char *m_pParticleInnerNearDef; //Name of the first inner system
|
|
||||||
char *m_pParticleInnerFarDef; //Name of the second inner system
|
|
||||||
char *m_pParticleOuterDef; //Name of the outer system
|
|
||||||
HPARTICLEFFECT m_pParticlePrecipInnerNear;
|
|
||||||
HPARTICLEFFECT m_pParticlePrecipInnerFar;
|
|
||||||
HPARTICLEFFECT m_pParticlePrecipOuter;
|
|
||||||
TimedEvent m_tParticlePrecipTraceTimer;
|
|
||||||
bool m_bActiveParticlePrecipEmitter;
|
|
||||||
bool m_bParticlePrecipInitialized;
|
|
||||||
|
|
||||||
private:
|
|
||||||
CClient_Precipitation( const CClient_Precipitation & ); // not defined, not accessible
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // C_EFFECTS_H
|
#endif // C_EFFECTS_H
|
||||||
|
@ -1,88 +0,0 @@
|
|||||||
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
|
|
||||||
//
|
|
||||||
// Purpose: Depth of field controller entity
|
|
||||||
//
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
#include "cbase.h"
|
|
||||||
|
|
||||||
// NOTE: This has to be the last file included!
|
|
||||||
#include "tier0/memdbgon.h"
|
|
||||||
|
|
||||||
|
|
||||||
extern bool g_bDOFEnabled;
|
|
||||||
extern float g_flDOFNearBlurDepth;
|
|
||||||
extern float g_flDOFNearFocusDepth;
|
|
||||||
extern float g_flDOFFarFocusDepth;
|
|
||||||
extern float g_flDOFFarBlurDepth;
|
|
||||||
extern float g_flDOFNearBlurRadius;
|
|
||||||
extern float g_flDOFFarBlurRadius;
|
|
||||||
|
|
||||||
EHANDLE g_hDOFControllerInUse = NULL;
|
|
||||||
|
|
||||||
class C_EnvDOFController : public C_BaseEntity
|
|
||||||
{
|
|
||||||
DECLARE_CLASS( C_EnvDOFController, C_BaseEntity );
|
|
||||||
public:
|
|
||||||
DECLARE_CLIENTCLASS();
|
|
||||||
|
|
||||||
C_EnvDOFController();
|
|
||||||
~C_EnvDOFController();
|
|
||||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_bDOFEnabled;
|
|
||||||
float m_flNearBlurDepth;
|
|
||||||
float m_flNearFocusDepth;
|
|
||||||
float m_flFarFocusDepth;
|
|
||||||
float m_flFarBlurDepth;
|
|
||||||
float m_flNearBlurRadius;
|
|
||||||
float m_flFarBlurRadius;
|
|
||||||
|
|
||||||
private:
|
|
||||||
C_EnvDOFController( const C_EnvDOFController & );
|
|
||||||
};
|
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT( C_EnvDOFController, DT_EnvDOFController, CEnvDOFController )
|
|
||||||
RecvPropInt( RECVINFO(m_bDOFEnabled) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flNearBlurDepth) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flNearFocusDepth) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flFarFocusDepth) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flFarBlurDepth) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flNearBlurRadius) ),
|
|
||||||
RecvPropFloat( RECVINFO(m_flFarBlurRadius) )
|
|
||||||
END_RECV_TABLE()
|
|
||||||
|
|
||||||
C_EnvDOFController::C_EnvDOFController()
|
|
||||||
: m_bDOFEnabled( true ),
|
|
||||||
m_flNearBlurDepth( 20.0f ),
|
|
||||||
m_flNearFocusDepth( 100.0f ),
|
|
||||||
m_flFarFocusDepth( 250.0f ),
|
|
||||||
m_flFarBlurDepth( 1000.0f ),
|
|
||||||
m_flNearBlurRadius( 0.0f ), // no near blur by default
|
|
||||||
m_flFarBlurRadius( 5.0f )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
C_EnvDOFController::~C_EnvDOFController()
|
|
||||||
{
|
|
||||||
if ( g_hDOFControllerInUse == this )
|
|
||||||
{
|
|
||||||
g_bDOFEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_EnvDOFController::OnDataChanged( DataUpdateType_t updateType )
|
|
||||||
{
|
|
||||||
BaseClass::OnDataChanged( updateType );
|
|
||||||
|
|
||||||
g_bDOFEnabled = m_bDOFEnabled && ( ( m_flNearBlurRadius > 0.0f ) || ( m_flFarBlurRadius > 0.0f ) );
|
|
||||||
g_flDOFNearBlurDepth = m_flNearBlurDepth;
|
|
||||||
g_flDOFNearFocusDepth = m_flNearFocusDepth;
|
|
||||||
g_flDOFFarFocusDepth = m_flFarFocusDepth;
|
|
||||||
g_flDOFFarBlurDepth = m_flFarBlurDepth;
|
|
||||||
g_flDOFNearBlurRadius = m_flNearBlurRadius;
|
|
||||||
g_flDOFFarBlurRadius = m_flFarBlurRadius;
|
|
||||||
|
|
||||||
g_hDOFControllerInUse = this;
|
|
||||||
}
|
|
@ -25,11 +25,6 @@ ConVar cl_globallight_freeze( "cl_globallight_freeze", "0" );
|
|||||||
// You can set these as KV anyway.
|
// You can set these as KV anyway.
|
||||||
ConVar cl_globallight_xoffset( "cl_globallight_xoffset", "0" );
|
ConVar cl_globallight_xoffset( "cl_globallight_xoffset", "0" );
|
||||||
ConVar cl_globallight_yoffset( "cl_globallight_yoffset", "0" );
|
ConVar cl_globallight_yoffset( "cl_globallight_yoffset", "0" );
|
||||||
|
|
||||||
static ConVar cl_globallight_slopescaledepthbias_shadowmap( "cl_globallight_slopescaledepthbias_shadowmap", "16", FCVAR_CHEAT );
|
|
||||||
static ConVar cl_globallight_shadowfiltersize( "cl_globallight_shadowfiltersize", "0.1", FCVAR_CHEAT );
|
|
||||||
static ConVar cl_globallight_depthbias_shadowmap( "cl_globallight_depthbias_shadowmap", "0.00001", FCVAR_CHEAT );
|
|
||||||
static ConVar cl_globallight_depthres( "cl_globallight_depthres", "8192", FCVAR_CHEAT );
|
|
||||||
#else
|
#else
|
||||||
ConVar cl_globallight_xoffset( "cl_globallight_xoffset", "-800" );
|
ConVar cl_globallight_xoffset( "cl_globallight_xoffset", "-800" );
|
||||||
ConVar cl_globallight_yoffset( "cl_globallight_yoffset", "1600" );
|
ConVar cl_globallight_yoffset( "cl_globallight_yoffset", "1600" );
|
||||||
@ -291,21 +286,16 @@ void C_GlobalLight::ClientThink()
|
|||||||
state.m_bOrtho = false;
|
state.m_bOrtho = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
#ifndef MAPBASE // Don't draw that huge debug thing
|
||||||
//state.m_bDrawShadowFrustum = true; // Don't draw that huge debug thing
|
|
||||||
state.m_flShadowMapResolution = cl_globallight_depthres.GetFloat();
|
|
||||||
state.m_flShadowFilterSize = cl_globallight_shadowfiltersize.GetFloat();
|
|
||||||
state.m_flShadowSlopeScaleDepthBias = cl_globallight_slopescaledepthbias_shadowmap.GetFloat();
|
|
||||||
state.m_flShadowDepthBias = cl_globallight_depthbias_shadowmap.GetFloat();
|
|
||||||
state.m_bEnableShadows = m_bEnableShadows;
|
|
||||||
state.m_pSpotlightTexture = m_SpotlightTexture;
|
|
||||||
state.m_nSpotlightTextureFrame = m_nSpotlightTextureFrame;
|
|
||||||
#else
|
|
||||||
state.m_bDrawShadowFrustum = true;
|
state.m_bDrawShadowFrustum = true;
|
||||||
|
#endif
|
||||||
/*state.m_flShadowSlopeScaleDepthBias = g_pMaterialSystemHardwareConfig->GetShadowSlopeScaleDepthBias();;
|
/*state.m_flShadowSlopeScaleDepthBias = g_pMaterialSystemHardwareConfig->GetShadowSlopeScaleDepthBias();;
|
||||||
state.m_flShadowDepthBias = g_pMaterialSystemHardwareConfig->GetShadowDepthBias();*/
|
state.m_flShadowDepthBias = g_pMaterialSystemHardwareConfig->GetShadowDepthBias();*/
|
||||||
state.m_bEnableShadows = m_bEnableShadows;
|
state.m_bEnableShadows = m_bEnableShadows;
|
||||||
state.m_pSpotlightTexture = m_SpotlightTexture;
|
state.m_pSpotlightTexture = m_SpotlightTexture;
|
||||||
|
#ifdef MAPBASE
|
||||||
|
state.m_nSpotlightTextureFrame = m_nSpotlightTextureFrame;
|
||||||
|
#else
|
||||||
state.m_nSpotlightTextureFrame = 0;
|
state.m_nSpotlightTextureFrame = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
|
|
||||||
#ifdef ASW_PROJECTED_TEXTURES
|
#ifdef ASW_PROJECTED_TEXTURES
|
||||||
extern ConVarRef mat_slopescaledepthbias_shadowmap;
|
static ConVar mat_slopescaledepthbias_shadowmap( "mat_slopescaledepthbias_shadowmap", "16", FCVAR_CHEAT );
|
||||||
extern ConVarRef mat_depthbias_shadowmap;
|
static ConVar mat_depthbias_shadowmap( "mat_depthbias_shadowmap", "0.00001", FCVAR_CHEAT );
|
||||||
|
|
||||||
float C_EnvProjectedTexture::m_flVisibleBBoxMinHeight = -FLT_MAX;
|
float C_EnvProjectedTexture::m_flVisibleBBoxMinHeight = -FLT_MAX;
|
||||||
|
|
||||||
@ -60,7 +60,6 @@ IMPLEMENT_CLIENTCLASS_DT( C_EnvProjectedTexture, DT_EnvProjectedTexture, CEnvPro
|
|||||||
RecvPropFloat( RECVINFO( m_flLinearAtten ) ),
|
RecvPropFloat( RECVINFO( m_flLinearAtten ) ),
|
||||||
RecvPropFloat( RECVINFO( m_flQuadraticAtten ) ),
|
RecvPropFloat( RECVINFO( m_flQuadraticAtten ) ),
|
||||||
RecvPropFloat( RECVINFO( m_flShadowAtten ) ),
|
RecvPropFloat( RECVINFO( m_flShadowAtten ) ),
|
||||||
RecvPropFloat( RECVINFO( m_flShadowFilter ) ),
|
|
||||||
RecvPropBool( RECVINFO( m_bAlwaysDraw ) ),
|
RecvPropBool( RECVINFO( m_bAlwaysDraw ) ),
|
||||||
|
|
||||||
// Not needed on the client right now, change when it actually is needed
|
// Not needed on the client right now, change when it actually is needed
|
||||||
@ -98,7 +97,6 @@ C_EnvProjectedTexture *C_EnvProjectedTexture::Create( )
|
|||||||
pEnt->m_flLinearAtten = 100.0f;
|
pEnt->m_flLinearAtten = 100.0f;
|
||||||
pEnt->m_flQuadraticAtten = 0.0f;
|
pEnt->m_flQuadraticAtten = 0.0f;
|
||||||
pEnt->m_flShadowAtten = 0.0f;
|
pEnt->m_flShadowAtten = 0.0f;
|
||||||
pEnt->m_flShadowFilter = 0.5f;
|
|
||||||
//pEnt->m_bProjectedTextureVersion = 1;
|
//pEnt->m_bProjectedTextureVersion = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -285,8 +283,6 @@ void C_EnvProjectedTexture::UpdateLight( void )
|
|||||||
|
|
||||||
// VectorNormalize( vRight );
|
// VectorNormalize( vRight );
|
||||||
// VectorNormalize( vUp );
|
// VectorNormalize( vUp );
|
||||||
|
|
||||||
VectorVectors( vForward, vRight, vUp );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -405,7 +401,6 @@ void C_EnvProjectedTexture::UpdateLight( void )
|
|||||||
state.m_flShadowSlopeScaleDepthBias = mat_slopescaledepthbias_shadowmap.GetFloat();
|
state.m_flShadowSlopeScaleDepthBias = mat_slopescaledepthbias_shadowmap.GetFloat();
|
||||||
state.m_flShadowDepthBias = mat_depthbias_shadowmap.GetFloat();
|
state.m_flShadowDepthBias = mat_depthbias_shadowmap.GetFloat();
|
||||||
state.m_flShadowAtten = m_flShadowAtten;
|
state.m_flShadowAtten = m_flShadowAtten;
|
||||||
state.m_flShadowFilterSize = m_flShadowFilter;
|
|
||||||
#else
|
#else
|
||||||
state.m_fQuadraticAtten = 0.0;
|
state.m_fQuadraticAtten = 0.0;
|
||||||
state.m_fLinearAtten = 100;
|
state.m_fLinearAtten = 100;
|
||||||
|
@ -48,9 +48,6 @@ protected:
|
|||||||
int m_iCachedDesiredOverlay;
|
int m_iCachedDesiredOverlay;
|
||||||
int m_iCurrentOverlay;
|
int m_iCurrentOverlay;
|
||||||
float m_flCurrentOverlayTime;
|
float m_flCurrentOverlayTime;
|
||||||
#ifdef MAPBASE
|
|
||||||
int m_iOverlayIndex;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT( C_EnvScreenOverlay, DT_EnvScreenOverlay, CEnvScreenOverlay )
|
IMPLEMENT_CLIENTCLASS_DT( C_EnvScreenOverlay, DT_EnvScreenOverlay, CEnvScreenOverlay )
|
||||||
@ -59,9 +56,6 @@ IMPLEMENT_CLIENTCLASS_DT( C_EnvScreenOverlay, DT_EnvScreenOverlay, CEnvScreenOve
|
|||||||
RecvPropFloat( RECVINFO( m_flStartTime ) ),
|
RecvPropFloat( RECVINFO( m_flStartTime ) ),
|
||||||
RecvPropInt( RECVINFO( m_iDesiredOverlay ) ),
|
RecvPropInt( RECVINFO( m_iDesiredOverlay ) ),
|
||||||
RecvPropBool( RECVINFO( m_bIsActive ) ),
|
RecvPropBool( RECVINFO( m_bIsActive ) ),
|
||||||
#ifdef MAPBASE
|
|
||||||
RecvPropInt( RECVINFO( m_iOverlayIndex ) ),
|
|
||||||
#endif
|
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -83,11 +77,7 @@ void C_EnvScreenOverlay::PostDataUpdate( DataUpdateType_t updateType )
|
|||||||
BaseClass::PostDataUpdate( updateType );
|
BaseClass::PostDataUpdate( updateType );
|
||||||
|
|
||||||
// If we have a start time now, start the overlays going
|
// If we have a start time now, start the overlays going
|
||||||
#ifdef MAPBASE
|
|
||||||
if ( m_bIsActive && m_flStartTime > 0 && (view->GetScreenOverlayMaterial() == NULL || (m_iOverlayIndex != -1 && view->GetIndexedScreenOverlayMaterial(m_iOverlayIndex) == NULL)) )
|
|
||||||
#else
|
|
||||||
if ( m_bIsActive && m_flStartTime > 0 && view->GetScreenOverlayMaterial() == NULL )
|
if ( m_bIsActive && m_flStartTime > 0 && view->GetScreenOverlayMaterial() == NULL )
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
StartOverlays();
|
StartOverlays();
|
||||||
}
|
}
|
||||||
@ -121,16 +111,7 @@ void C_EnvScreenOverlay::StopOverlays( void )
|
|||||||
|
|
||||||
if ( m_bWasActive && !m_bIsActive )
|
if ( m_bWasActive && !m_bIsActive )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
view->SetScreenOverlayMaterial( NULL );
|
||||||
if (m_iOverlayIndex != -1)
|
|
||||||
{
|
|
||||||
view->SetIndexedScreenOverlayMaterial( m_iOverlayIndex, NULL );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
view->SetScreenOverlayMaterial( NULL );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,16 +163,7 @@ void C_EnvScreenOverlay::StartCurrentOverlay( void )
|
|||||||
IMaterial *pMaterial = materials->FindMaterial( m_iszOverlayNames[m_iCurrentOverlay], TEXTURE_GROUP_CLIENT_EFFECTS, false );
|
IMaterial *pMaterial = materials->FindMaterial( m_iszOverlayNames[m_iCurrentOverlay], TEXTURE_GROUP_CLIENT_EFFECTS, false );
|
||||||
if ( !IsErrorMaterial( pMaterial ) )
|
if ( !IsErrorMaterial( pMaterial ) )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
view->SetScreenOverlayMaterial( pMaterial );
|
||||||
if (m_iOverlayIndex != -1)
|
|
||||||
{
|
|
||||||
view->SetIndexedScreenOverlayMaterial( m_iOverlayIndex, pMaterial );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
view->SetScreenOverlayMaterial( pMaterial );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -219,11 +191,6 @@ enum
|
|||||||
SCREENEFFECT_EP2_ADVISOR_STUN,
|
SCREENEFFECT_EP2_ADVISOR_STUN,
|
||||||
SCREENEFFECT_EP1_INTRO,
|
SCREENEFFECT_EP1_INTRO,
|
||||||
SCREENEFFECT_EP2_GROGGY,
|
SCREENEFFECT_EP2_GROGGY,
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
SCREENEFFECT_MAPBASE_CHROMATIC_BLUR = 100, // Overlays 3 different frames of red, green, and blue tints respectively with different offsets
|
|
||||||
SCREENEFFECT_MAPBASE_CHROMATIC_ABERRATION, // Similar to above, except it stretches frames in addition to offsetting them
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@ -308,21 +275,6 @@ void C_EnvScreenEffect::ReceiveMessage( int classID, bf_read &msg )
|
|||||||
g_pScreenSpaceEffects->SetScreenSpaceEffectParams( "ep2_groggy", pKeys );
|
g_pScreenSpaceEffects->SetScreenSpaceEffectParams( "ep2_groggy", pKeys );
|
||||||
g_pScreenSpaceEffects->EnableScreenSpaceEffect( "ep2_groggy" );
|
g_pScreenSpaceEffects->EnableScreenSpaceEffect( "ep2_groggy" );
|
||||||
}
|
}
|
||||||
#ifdef MAPBASE
|
|
||||||
else if ( m_nType == SCREENEFFECT_MAPBASE_CHROMATIC_BLUR || m_nType == SCREENEFFECT_MAPBASE_CHROMATIC_ABERRATION )
|
|
||||||
{
|
|
||||||
if( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() < 80 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Set our keys
|
|
||||||
pKeys->SetFloat( "duration", m_flDuration );
|
|
||||||
pKeys->SetInt( "fadeout", 0 );
|
|
||||||
pKeys->SetInt( "stretch", m_nType == SCREENEFFECT_MAPBASE_CHROMATIC_ABERRATION );
|
|
||||||
|
|
||||||
g_pScreenSpaceEffects->SetScreenSpaceEffectParams( "mapbase_chromatic_aberration", pKeys );
|
|
||||||
g_pScreenSpaceEffects->EnableScreenSpaceEffect( "mapbase_chromatic_aberration" );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pKeys->deleteThis();
|
pKeys->deleteThis();
|
||||||
}
|
}
|
||||||
@ -369,25 +321,6 @@ void C_EnvScreenEffect::ReceiveMessage( int classID, bf_read &msg )
|
|||||||
|
|
||||||
g_pScreenSpaceEffects->SetScreenSpaceEffectParams( "ep2_groggy", pKeys );
|
g_pScreenSpaceEffects->SetScreenSpaceEffectParams( "ep2_groggy", pKeys );
|
||||||
}
|
}
|
||||||
#ifdef MAPBASE
|
|
||||||
else if ( m_nType == SCREENEFFECT_MAPBASE_CHROMATIC_BLUR || m_nType == SCREENEFFECT_MAPBASE_CHROMATIC_ABERRATION )
|
|
||||||
{
|
|
||||||
if( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() < 80 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Create a keyvalue block to set these params
|
|
||||||
KeyValues *pKeys = new KeyValues( "keys" );
|
|
||||||
if ( pKeys == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Set our keys
|
|
||||||
pKeys->SetFloat( "duration", m_flDuration );
|
|
||||||
pKeys->SetInt( "fadeout", 1 );
|
|
||||||
pKeys->SetInt( "stretch", m_nType == SCREENEFFECT_MAPBASE_CHROMATIC_ABERRATION );
|
|
||||||
|
|
||||||
g_pScreenSpaceEffects->SetScreenSpaceEffectParams( "mapbase_chromatic_aberration", pKeys );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
//===========================================================================//
|
//===========================================================================//
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "view_shared.h"
|
#include "view_shared.h"
|
||||||
#ifdef MAPBASE
|
|
||||||
#include "viewrender.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
@ -26,27 +23,10 @@ public:
|
|||||||
|
|
||||||
virtual bool ShouldDraw();
|
virtual bool ShouldDraw();
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
virtual void OnDataChanged( DataUpdateType_t type );
|
|
||||||
ITexture *ReflectionRenderTarget();
|
|
||||||
ITexture *RefractionRenderTarget();
|
|
||||||
|
|
||||||
char m_iszReflectRenderTarget[64];
|
|
||||||
char m_iszRefractRenderTarget[64];
|
|
||||||
ITexture *m_pReflectRenderTarget;
|
|
||||||
ITexture *m_pRefractRenderTarget;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
C_FuncReflectiveGlass *m_pNext;
|
C_FuncReflectiveGlass *m_pNext;
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT( C_FuncReflectiveGlass, DT_FuncReflectiveGlass, CFuncReflectiveGlass )
|
IMPLEMENT_CLIENTCLASS_DT( C_FuncReflectiveGlass, DT_FuncReflectiveGlass, CFuncReflectiveGlass )
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
RecvPropString( RECVINFO( m_iszReflectRenderTarget ) ),
|
|
||||||
RecvPropString( RECVINFO( m_iszRefractRenderTarget ) ),
|
|
||||||
#endif
|
|
||||||
|
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@ -67,11 +47,6 @@ C_FuncReflectiveGlass* GetReflectiveGlassList()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
C_FuncReflectiveGlass::C_FuncReflectiveGlass()
|
C_FuncReflectiveGlass::C_FuncReflectiveGlass()
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
|
||||||
m_iszReflectRenderTarget[0] = '\0';
|
|
||||||
m_iszRefractRenderTarget[0] = '\0';
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_ReflectiveGlassList.Insert( this );
|
g_ReflectiveGlassList.Insert( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,111 +114,5 @@ bool IsReflectiveGlassInView( const CViewSetup& view, cplane_t &plane )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Iterates through reflective glass instead of just picking one
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
C_BaseEntity *NextReflectiveGlass( C_BaseEntity *pStart, const CViewSetup& view, cplane_t &plane,
|
|
||||||
const Frustum_t &frustum, ITexture **pRenderTargets )
|
|
||||||
{
|
|
||||||
// Early out if no cameras
|
|
||||||
C_FuncReflectiveGlass *pReflectiveGlass = NULL;
|
|
||||||
if (!pStart)
|
|
||||||
pReflectiveGlass = GetReflectiveGlassList();
|
|
||||||
else
|
|
||||||
pReflectiveGlass = ((C_FuncReflectiveGlass*)pStart)->m_pNext;
|
|
||||||
|
|
||||||
cplane_t localPlane;
|
|
||||||
Vector vecOrigin, vecWorld, vecDelta;
|
|
||||||
for ( ; pReflectiveGlass != NULL; pReflectiveGlass = pReflectiveGlass->m_pNext )
|
|
||||||
{
|
|
||||||
if ( pReflectiveGlass->IsDormant() )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( pReflectiveGlass->m_iViewHideFlags & (1 << CurrentViewID()) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Vector vecMins, vecMaxs;
|
|
||||||
pReflectiveGlass->GetRenderBoundsWorldspace( vecMins, vecMaxs );
|
|
||||||
if ( R_CullBox( vecMins, vecMaxs, frustum ) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
const model_t *pModel = pReflectiveGlass->GetModel();
|
|
||||||
const matrix3x4_t& mat = pReflectiveGlass->EntityToWorldTransform();
|
|
||||||
|
|
||||||
int nCount = modelinfo->GetBrushModelPlaneCount( pModel );
|
|
||||||
for ( int i = 0; i < nCount; ++i )
|
|
||||||
{
|
|
||||||
modelinfo->GetBrushModelPlane( pModel, i, localPlane, &vecOrigin );
|
|
||||||
|
|
||||||
MatrixTransformPlane( mat, localPlane, plane ); // Transform to world space
|
|
||||||
VectorTransform( vecOrigin, mat, vecWorld );
|
|
||||||
|
|
||||||
if ( view.origin.Dot( plane.normal ) <= plane.dist ) // Check for view behind plane
|
|
||||||
continue;
|
|
||||||
|
|
||||||
VectorSubtract( vecWorld, view.origin, vecDelta ); // Backface cull
|
|
||||||
if ( vecDelta.Dot( plane.normal ) >= 0 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (pRenderTargets != NULL)
|
|
||||||
{
|
|
||||||
pRenderTargets[0] = pReflectiveGlass->ReflectionRenderTarget();
|
|
||||||
pRenderTargets[1] = pReflectiveGlass->RefractionRenderTarget();
|
|
||||||
}
|
|
||||||
|
|
||||||
return pReflectiveGlass;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_FuncReflectiveGlass::OnDataChanged( DataUpdateType_t type )
|
|
||||||
{
|
|
||||||
// Reset render textures
|
|
||||||
m_pReflectRenderTarget = NULL;
|
|
||||||
m_pRefractRenderTarget = NULL;
|
|
||||||
|
|
||||||
return BaseClass::OnDataChanged( type );
|
|
||||||
}
|
|
||||||
|
|
||||||
ITexture *C_FuncReflectiveGlass::ReflectionRenderTarget()
|
|
||||||
{
|
|
||||||
if (m_iszReflectRenderTarget[0] != '\0')
|
|
||||||
{
|
|
||||||
if (!m_pReflectRenderTarget)
|
|
||||||
{
|
|
||||||
// We don't use a CTextureReference for this because we don't want to shut down the texture on removal/change
|
|
||||||
m_pReflectRenderTarget = materials->FindTexture( m_iszReflectRenderTarget, TEXTURE_GROUP_RENDER_TARGET );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_pReflectRenderTarget)
|
|
||||||
return m_pReflectRenderTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
//return GetWaterReflectionTexture();
|
|
||||||
}
|
|
||||||
|
|
||||||
ITexture *C_FuncReflectiveGlass::RefractionRenderTarget()
|
|
||||||
{
|
|
||||||
if (m_iszRefractRenderTarget[0] != '\0')
|
|
||||||
{
|
|
||||||
if (!m_pRefractRenderTarget)
|
|
||||||
{
|
|
||||||
// We don't use a CTextureReference for this because we don't want to shut down the texture on removal/change
|
|
||||||
m_pRefractRenderTarget = materials->FindTexture( m_iszRefractRenderTarget, TEXTURE_GROUP_RENDER_TARGET );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_pRefractRenderTarget)
|
|
||||||
return m_pRefractRenderTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
//return GetWaterRefractionTexture();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,11 +21,6 @@ class CViewSetup;
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool IsReflectiveGlassInView( const CViewSetup& view, cplane_t &plane );
|
bool IsReflectiveGlassInView( const CViewSetup& view, cplane_t &plane );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
C_BaseEntity *NextReflectiveGlass( C_BaseEntity *pStart, const CViewSetup& view, cplane_t &plane,
|
|
||||||
const Frustum_t &frustum, ITexture **pRenderTargets = NULL );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif // C_FUNC_REFLECTIVE_GLASS
|
#endif // C_FUNC_REFLECTIVE_GLASS
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,118 +0,0 @@
|
|||||||
//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============//
|
|
||||||
//
|
|
||||||
// Purpose: Client handler for instruction players how to play
|
|
||||||
//
|
|
||||||
//=============================================================================//
|
|
||||||
|
|
||||||
#ifndef _C_GAMEINSTRUCTOR_H_
|
|
||||||
#define _C_GAMEINSTRUCTOR_H_
|
|
||||||
|
|
||||||
|
|
||||||
#include "GameEventListener.h"
|
|
||||||
#include "vgui_controls/PHandle.h"
|
|
||||||
|
|
||||||
class CBaseLesson;
|
|
||||||
|
|
||||||
|
|
||||||
struct LessonGroupConVarToggle_t
|
|
||||||
{
|
|
||||||
ConVarRef var;
|
|
||||||
char szLessonGroupName[ 64 ];
|
|
||||||
|
|
||||||
LessonGroupConVarToggle_t( const char *pchConVarName ) :
|
|
||||||
var( pchConVarName )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class C_GameInstructor : public CAutoGameSystemPerFrame, public CGameEventListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
C_GameInstructor() : CAutoGameSystemPerFrame( "C_GameInstructor" )
|
|
||||||
{
|
|
||||||
m_bHasLoadedSaveData = false;
|
|
||||||
m_bDirtySaveData = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods of IGameSystem
|
|
||||||
virtual bool Init( void );
|
|
||||||
virtual void Shutdown( void );
|
|
||||||
virtual void Update( float frametime );
|
|
||||||
|
|
||||||
void UpdateHiddenByOtherElements( void );
|
|
||||||
bool Mod_HiddenByOtherElements( void );
|
|
||||||
|
|
||||||
virtual void FireGameEvent( IGameEvent *event );
|
|
||||||
|
|
||||||
void DefineLesson( CBaseLesson *pLesson );
|
|
||||||
|
|
||||||
const CBaseLesson * GetLesson( const char *pchLessonName );
|
|
||||||
bool IsLessonOfSameTypeOpen( const CBaseLesson *pLesson ) const;
|
|
||||||
|
|
||||||
bool ReadSaveData( void );
|
|
||||||
bool WriteSaveData( void );
|
|
||||||
void RefreshDisplaysAndSuccesses( void );
|
|
||||||
void ResetDisplaysAndSuccesses( void );
|
|
||||||
void MarkDisplayed( const char *pchLessonName );
|
|
||||||
void MarkSucceeded( const char *pchLessonName );
|
|
||||||
|
|
||||||
void PlaySound( const char *pchSoundName );
|
|
||||||
|
|
||||||
bool OpenOpportunity( CBaseLesson *pLesson );
|
|
||||||
|
|
||||||
void DumpOpenOpportunities( void );
|
|
||||||
|
|
||||||
KeyValues * GetScriptKeys( void );
|
|
||||||
C_BasePlayer * GetLocalPlayer( void );
|
|
||||||
|
|
||||||
void EvaluateLessonsForGameRules( void );
|
|
||||||
void SetLessonGroupEnabled( const char *pszGroup, bool bEnabled );
|
|
||||||
|
|
||||||
// Mapbase needs this to be public for map-specific file system
|
|
||||||
void ReadLessonsFromFile( const char *pchFileName );
|
|
||||||
|
|
||||||
private:
|
|
||||||
void FindErrors( void );
|
|
||||||
|
|
||||||
bool UpdateActiveLesson( CBaseLesson *pLesson, const CBaseLesson *pRootLesson );
|
|
||||||
void UpdateInactiveLesson( CBaseLesson *pLesson );
|
|
||||||
|
|
||||||
CBaseLesson * GetLesson_Internal( const char *pchLessonName );
|
|
||||||
|
|
||||||
void StopAllLessons( void );
|
|
||||||
|
|
||||||
void CloseAllOpenOpportunities( void );
|
|
||||||
void CloseOpportunity( CBaseLesson *pLesson );
|
|
||||||
|
|
||||||
void InitLessonPrerequisites( void );
|
|
||||||
|
|
||||||
private:
|
|
||||||
CUtlVector < CBaseLesson* > m_Lessons;
|
|
||||||
CUtlVector < CBaseLesson* > m_OpenOpportunities;
|
|
||||||
|
|
||||||
CUtlVector < LessonGroupConVarToggle_t > m_LessonGroupConVarToggles;
|
|
||||||
|
|
||||||
KeyValues *m_pScriptKeys;
|
|
||||||
|
|
||||||
bool m_bNoDraw;
|
|
||||||
bool m_bHiddenDueToOtherElements;
|
|
||||||
|
|
||||||
int m_iCurrentPriority;
|
|
||||||
EHANDLE m_hLastSpectatedPlayer;
|
|
||||||
bool m_bSpectatedPlayerChanged;
|
|
||||||
|
|
||||||
char m_szPreviousStartSound[ 128 ];
|
|
||||||
float m_fNextStartSoundTime;
|
|
||||||
|
|
||||||
bool m_bHasLoadedSaveData;
|
|
||||||
bool m_bDirtySaveData;
|
|
||||||
};
|
|
||||||
|
|
||||||
C_GameInstructor &GetGameInstructor();
|
|
||||||
|
|
||||||
void GameInstructor_Init();
|
|
||||||
void GameInstructor_Shutdown();
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _C_GAMEINSTRUCTOR_H_
|
|
@ -95,23 +95,18 @@ extern PMaterialHandle g_Material_Spark;
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void GetColorForSurface( trace_t *trace, Vector *color )
|
void GetColorForSurface( trace_t *trace, Vector *color )
|
||||||
{
|
{
|
||||||
Vector baseColor = vec3_invalid, diffuseColor;
|
Vector baseColor, diffuseColor;
|
||||||
const char *kind;
|
Vector end = trace->startpos + ( ( Vector )trace->endpos - ( Vector )trace->startpos ) * 1.1f;
|
||||||
|
|
||||||
if ( trace->DidHitWorld() )
|
if ( trace->DidHitWorld() )
|
||||||
{
|
{
|
||||||
if ( trace->hitbox == 0 )
|
if ( trace->hitbox == 0 )
|
||||||
{
|
{
|
||||||
kind = "World";
|
|
||||||
Vector end = trace->startpos + ( trace->endpos - trace->startpos ) * 1.1f;
|
|
||||||
// If we hit the world, then ask the world for the fleck color
|
// If we hit the world, then ask the world for the fleck color
|
||||||
if ( !engine->TraceLineMaterialAndLighting( trace->startpos, end, diffuseColor, baseColor ) ) {
|
engine->TraceLineMaterialAndLighting( trace->startpos, end, diffuseColor, baseColor );
|
||||||
baseColor = vec3_invalid; // Make sure this wasn't modified
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
kind = "Static Prop";
|
|
||||||
// In this case we hit a static prop.
|
// In this case we hit a static prop.
|
||||||
staticpropmgr->GetStaticPropMaterialColorAndLighting( trace, trace->hitbox - 1, diffuseColor, baseColor );
|
staticpropmgr->GetStaticPropMaterialColorAndLighting( trace, trace->hitbox - 1, diffuseColor, baseColor );
|
||||||
}
|
}
|
||||||
@ -122,24 +117,20 @@ void GetColorForSurface( trace_t *trace, Vector *color )
|
|||||||
C_BaseEntity *pEnt = trace->m_pEnt;
|
C_BaseEntity *pEnt = trace->m_pEnt;
|
||||||
if ( !pEnt )
|
if ( !pEnt )
|
||||||
{
|
{
|
||||||
kind = "Null-Entity";
|
Msg("Couldn't find surface in GetColorForSurface()\n");
|
||||||
} else {
|
color->x = 255;
|
||||||
kind = "Entity";
|
color->y = 255;
|
||||||
ICollideable *pCollide = pEnt->GetCollideable();
|
color->z = 255;
|
||||||
int modelIndex = pCollide->GetCollisionModelIndex();
|
return;
|
||||||
model_t* pModel = const_cast<model_t*>(modelinfo->GetModel( modelIndex ));
|
|
||||||
|
|
||||||
// Ask the model info about what we need to know
|
|
||||||
modelinfo->GetModelMaterialColorAndLighting( pModel, pCollide->GetCollisionOrigin(),
|
|
||||||
pCollide->GetCollisionAngles(), trace, diffuseColor, baseColor );
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( baseColor == vec3_invalid )
|
ICollideable *pCollide = pEnt->GetCollideable();
|
||||||
{
|
int modelIndex = pCollide->GetCollisionModelIndex();
|
||||||
Warning( "Couldn't find surface color of %s\n", kind );
|
model_t* pModel = const_cast<model_t*>(modelinfo->GetModel( modelIndex ));
|
||||||
baseColor = Vector( .5f, .5f, .5f );
|
|
||||||
diffuseColor = engine->GetLightForPoint( trace->endpos, true );
|
// Ask the model info about what we need to know
|
||||||
|
modelinfo->GetModelMaterialColorAndLighting( pModel, pCollide->GetCollisionOrigin(),
|
||||||
|
pCollide->GetCollisionAngles(), trace, diffuseColor, baseColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get final light value
|
//Get final light value
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
//========= Copyright © 1996-2009, Valve Corporation, All rights reserved. ============//
|
|
||||||
//
|
|
||||||
// Purpose:
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//=====================================================================================//
|
|
||||||
#include "cbase.h"
|
|
||||||
#include "c_movie_display.h"
|
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
|
||||||
#include "tier0/memdbgon.h"
|
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT( C_MovieDisplay, DT_MovieDisplay, CMovieDisplay )
|
|
||||||
RecvPropBool( RECVINFO( m_bEnabled ) ),
|
|
||||||
RecvPropBool( RECVINFO( m_bLooping ) ),
|
|
||||||
RecvPropBool( RECVINFO( m_bMuted ) ),
|
|
||||||
RecvPropString( RECVINFO( m_szMovieFilename ) ),
|
|
||||||
RecvPropString( RECVINFO( m_szGroupName ) ),
|
|
||||||
END_RECV_TABLE()
|
|
||||||
|
|
||||||
C_MovieDisplay::C_MovieDisplay()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
C_MovieDisplay::~C_MovieDisplay()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
//========= Copyright © 1996-2009, Valve Corporation, All rights reserved. ============//
|
|
||||||
//
|
|
||||||
// Purpose:
|
|
||||||
//
|
|
||||||
//=====================================================================================//
|
|
||||||
|
|
||||||
#ifndef C_MOVIE_DISPLAY_H
|
|
||||||
#define C_MOVIE_DISPLAY_H
|
|
||||||
|
|
||||||
#include "cbase.h"
|
|
||||||
|
|
||||||
class C_MovieDisplay : public C_BaseEntity
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DECLARE_CLASS( C_MovieDisplay, C_BaseEntity );
|
|
||||||
DECLARE_CLIENTCLASS();
|
|
||||||
|
|
||||||
C_MovieDisplay();
|
|
||||||
~C_MovieDisplay();
|
|
||||||
|
|
||||||
bool IsEnabled( void ) const { return m_bEnabled; }
|
|
||||||
bool IsLooping( void ) const { return m_bLooping; }
|
|
||||||
bool IsMuted(void) const { return m_bMuted; }
|
|
||||||
|
|
||||||
const char *GetMovieFilename( void ) const { return m_szMovieFilename; }
|
|
||||||
const char *GetGroupName( void ) const { return m_szGroupName; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_bEnabled;
|
|
||||||
bool m_bLooping;
|
|
||||||
bool m_bMuted;
|
|
||||||
char m_szMovieFilename[128];
|
|
||||||
char m_szGroupName[128];
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //C_MOVIE_DISPLAY_H
|
|
@ -42,7 +42,6 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
EHANDLE m_hControlPointEnts[kMAXCONTROLPOINTS];
|
EHANDLE m_hControlPointEnts[kMAXCONTROLPOINTS];
|
||||||
Vector m_vControlPointVecs[kMAXCONTROLPOINTS];
|
|
||||||
// SendPropArray3( SENDINFO_ARRAY3(m_iControlPointParents), SendPropInt( SENDINFO_ARRAY(m_iControlPointParents), 3, SPROP_UNSIGNED ) ),
|
// SendPropArray3( SENDINFO_ARRAY3(m_iControlPointParents), SendPropInt( SENDINFO_ARRAY(m_iControlPointParents), 3, SPROP_UNSIGNED ) ),
|
||||||
unsigned char m_iControlPointParents[kMAXCONTROLPOINTS];
|
unsigned char m_iControlPointParents[kMAXCONTROLPOINTS];
|
||||||
|
|
||||||
@ -66,7 +65,6 @@ BEGIN_RECV_TABLE_NOBASE( C_ParticleSystem, DT_ParticleSystem )
|
|||||||
RecvPropFloat( RECVINFO( m_flStartTime ) ),
|
RecvPropFloat( RECVINFO( m_flStartTime ) ),
|
||||||
|
|
||||||
RecvPropArray3( RECVINFO_ARRAY(m_hControlPointEnts), RecvPropEHandle( RECVINFO( m_hControlPointEnts[0] ) ) ),
|
RecvPropArray3( RECVINFO_ARRAY(m_hControlPointEnts), RecvPropEHandle( RECVINFO( m_hControlPointEnts[0] ) ) ),
|
||||||
RecvPropArray3( RECVINFO_ARRAY(m_vControlPointVecs), RecvPropVector( RECVINFO( m_vControlPointVecs[0] ) ) ),
|
|
||||||
RecvPropArray3( RECVINFO_ARRAY(m_iControlPointParents), RecvPropInt( RECVINFO(m_iControlPointParents[0]))),
|
RecvPropArray3( RECVINFO_ARRAY(m_iControlPointParents), RecvPropInt( RECVINFO(m_iControlPointParents[0]))),
|
||||||
RecvPropBool( RECVINFO( m_bWeatherEffect ) ),
|
RecvPropBool( RECVINFO( m_bWeatherEffect ) ),
|
||||||
END_RECV_TABLE();
|
END_RECV_TABLE();
|
||||||
@ -152,41 +150,21 @@ void C_ParticleSystem::ClientThink( void )
|
|||||||
AssertMsg1( pEffect, "Particle system couldn't make %s", pszName );
|
AssertMsg1( pEffect, "Particle system couldn't make %s", pszName );
|
||||||
if (pEffect)
|
if (pEffect)
|
||||||
{
|
{
|
||||||
if (m_vControlPointVecs[0] != GetAbsOrigin() && m_hControlPointEnts[0] == NULL)
|
for ( int i = 0 ; i < kMAXCONTROLPOINTS ; ++i )
|
||||||
{
|
{
|
||||||
// we are using info_particle_system_coordinate
|
CBaseEntity *pOnEntity = m_hControlPointEnts[i].Get();
|
||||||
for (int i = 0; i < kMAXCONTROLPOINTS; ++i)
|
if ( pOnEntity )
|
||||||
{
|
{
|
||||||
ParticleProp()->AddControlPoint(pEffect, i + 1, this, PATTACH_WORLDORIGIN, 0, m_vControlPointVecs[i] - GetAbsOrigin());
|
ParticleProp()->AddControlPoint( pEffect, i + 1, pOnEntity, PATTACH_ABSORIGIN_FOLLOW );
|
||||||
|
|
||||||
AssertMsg2(m_iControlPointParents[i] >= 0 && m_iControlPointParents[i] <= kMAXCONTROLPOINTS,
|
|
||||||
"Particle system specified bogus control point parent (%d) for point %d.",
|
|
||||||
m_iControlPointParents[i], i);
|
|
||||||
|
|
||||||
if (m_iControlPointParents[i] != 0)
|
|
||||||
{
|
|
||||||
pEffect->SetControlPointParent(i + 1, m_iControlPointParents[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
AssertMsg2( m_iControlPointParents[i] >= 0 && m_iControlPointParents[i] <= kMAXCONTROLPOINTS ,
|
||||||
{
|
"Particle system specified bogus control point parent (%d) for point %d.",
|
||||||
for ( int i = 0 ; i < kMAXCONTROLPOINTS ; ++i )
|
m_iControlPointParents[i], i );
|
||||||
|
|
||||||
|
if (m_iControlPointParents[i] != 0)
|
||||||
{
|
{
|
||||||
CBaseEntity *pOnEntity = m_hControlPointEnts[i].Get();
|
pEffect->SetControlPointParent(i+1, m_iControlPointParents[i]);
|
||||||
if ( pOnEntity )
|
|
||||||
{
|
|
||||||
ParticleProp()->AddControlPoint( pEffect, i + 1, pOnEntity, PATTACH_ABSORIGIN_FOLLOW );
|
|
||||||
}
|
|
||||||
|
|
||||||
AssertMsg2( m_iControlPointParents[i] >= 0 && m_iControlPointParents[i] <= kMAXCONTROLPOINTS ,
|
|
||||||
"Particle system specified bogus control point parent (%d) for point %d.",
|
|
||||||
m_iControlPointParents[i], i );
|
|
||||||
|
|
||||||
if (m_iControlPointParents[i] != 0)
|
|
||||||
{
|
|
||||||
pEffect->SetControlPointParent(i+1, m_iControlPointParents[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,10 +429,8 @@ void CPixelVisibilityQuery::IssueQuery( IMatRenderContext *pRenderContext, float
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef MAPBASE // Mapbase can also query visibility several times via multiple point_cameras, etc.
|
|
||||||
#ifndef PORTAL // FIXME: In portal we query visibility multiple times per frame because of portal renders!
|
#ifndef PORTAL // FIXME: In portal we query visibility multiple times per frame because of portal renders!
|
||||||
Assert ( ( m_frameIssued != gpGlobals->framecount ) || UseVR() );
|
Assert ( ( m_frameIssued != gpGlobals->framecount ) || UseVR() );
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_frameIssued = gpGlobals->framecount;
|
m_frameIssued = gpGlobals->framecount;
|
||||||
|
@ -75,9 +75,6 @@ public:
|
|||||||
|
|
||||||
bool m_bSlowMovement;
|
bool m_bSlowMovement;
|
||||||
|
|
||||||
//Tony; added so tonemap controller can work in multiplayer with inputs.
|
|
||||||
tonemap_params_t m_TonemapParams;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // C_PLAYERLOCALDATA_H
|
#endif // C_PLAYERLOCALDATA_H
|
||||||
|
@ -27,7 +27,6 @@ IMPLEMENT_CLIENTCLASS_DT( C_PointCamera, DT_PointCamera, CPointCamera )
|
|||||||
RecvPropInt( RECVINFO( m_bUseScreenAspectRatio ) ),
|
RecvPropInt( RECVINFO( m_bUseScreenAspectRatio ) ),
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
RecvPropInt( RECVINFO( m_iSkyMode ) ),
|
RecvPropInt( RECVINFO( m_iSkyMode ) ),
|
||||||
RecvPropString( RECVINFO( m_iszRenderTarget ) ),
|
|
||||||
#endif
|
#endif
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
@ -44,10 +43,6 @@ C_PointCamera::C_PointCamera()
|
|||||||
m_bActive = false;
|
m_bActive = false;
|
||||||
m_bFogEnable = false;
|
m_bFogEnable = false;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
m_iszRenderTarget[0] = '\0';
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_PointCameraList.Insert( this );
|
g_PointCameraList.Insert( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,16 +56,6 @@ bool C_PointCamera::ShouldDraw()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void C_PointCamera::OnDataChanged( DataUpdateType_t type )
|
|
||||||
{
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// Reset render texture
|
|
||||||
m_pRenderTarget = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return BaseClass::OnDataChanged( type );
|
|
||||||
}
|
|
||||||
|
|
||||||
float C_PointCamera::GetFOV()
|
float C_PointCamera::GetFOV()
|
||||||
{
|
{
|
||||||
return m_FOV;
|
return m_FOV;
|
||||||
@ -132,26 +117,6 @@ void C_PointCamera::GetToolRecordingState( KeyValues *msg )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
extern ITexture *GetCameraTexture( void );
|
|
||||||
extern void AddReleaseFunc( void );
|
|
||||||
|
|
||||||
ITexture *C_PointCamera::RenderTarget()
|
|
||||||
{
|
|
||||||
if (m_iszRenderTarget[0] != '\0')
|
|
||||||
{
|
|
||||||
if (!m_pRenderTarget)
|
|
||||||
{
|
|
||||||
// We don't use a CTextureReference for this because we don't want to shut down the texture on removal/change
|
|
||||||
m_pRenderTarget = materials->FindTexture( m_iszRenderTarget, TEXTURE_GROUP_RENDER_TARGET );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_pRenderTarget)
|
|
||||||
return m_pRenderTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetCameraTexture();
|
|
||||||
}
|
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT( C_PointCameraOrtho, DT_PointCameraOrtho, CPointCameraOrtho )
|
IMPLEMENT_CLIENTCLASS_DT( C_PointCameraOrtho, DT_PointCameraOrtho, CPointCameraOrtho )
|
||||||
RecvPropInt( RECVINFO( m_bOrtho ) ),
|
RecvPropInt( RECVINFO( m_bOrtho ) ),
|
||||||
RecvPropArray( RecvPropFloat( RECVINFO( m_OrthoDimensions[0] ) ), m_OrthoDimensions ),
|
RecvPropArray( RecvPropFloat( RECVINFO( m_OrthoDimensions[0] ) ), m_OrthoDimensions ),
|
||||||
|
@ -29,9 +29,6 @@ public:
|
|||||||
// C_BaseEntity.
|
// C_BaseEntity.
|
||||||
virtual bool ShouldDraw();
|
virtual bool ShouldDraw();
|
||||||
|
|
||||||
// Mapbase uses this for m_iszRenderTarget
|
|
||||||
virtual void OnDataChanged( DataUpdateType_t type );
|
|
||||||
|
|
||||||
float GetFOV();
|
float GetFOV();
|
||||||
float GetResolution();
|
float GetResolution();
|
||||||
bool IsFogEnabled();
|
bool IsFogEnabled();
|
||||||
@ -45,8 +42,6 @@ public:
|
|||||||
virtual void GetOrthoDimensions(float &up, float &dn, float &lf, float &rt) const {}
|
virtual void GetOrthoDimensions(float &up, float &dn, float &lf, float &rt) const {}
|
||||||
|
|
||||||
SkyboxVisibility_t SkyMode() { return m_iSkyMode; }
|
SkyboxVisibility_t SkyMode() { return m_iSkyMode; }
|
||||||
|
|
||||||
ITexture *RenderTarget();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual void GetToolRecordingState( KeyValues *msg );
|
virtual void GetToolRecordingState( KeyValues *msg );
|
||||||
@ -63,8 +58,6 @@ private:
|
|||||||
bool m_bUseScreenAspectRatio;
|
bool m_bUseScreenAspectRatio;
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
SkyboxVisibility_t m_iSkyMode;
|
SkyboxVisibility_t m_iSkyMode;
|
||||||
ITexture *m_pRenderTarget;
|
|
||||||
char m_iszRenderTarget[64];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,63 +0,0 @@
|
|||||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
|
||||||
//
|
|
||||||
// Purpose: stores map postprocess params
|
|
||||||
//
|
|
||||||
//=============================================================================
|
|
||||||
#include "cbase.h"
|
|
||||||
#include "c_postprocesscontroller.h"
|
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
|
||||||
#include "tier0/memdbgon.h"
|
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS_DT( C_PostProcessController, DT_PostProcessController, CPostProcessController )
|
|
||||||
RecvPropArray3( RECVINFO_NAME( m_PostProcessParameters.m_flParameters[0], m_flPostProcessParameters ), POST_PROCESS_PARAMETER_COUNT, RecvPropFloat( RECVINFO_NAME( m_PostProcessParameters.m_flParameters[0], m_flPostProcessParameters[0] ) ) ),
|
|
||||||
RecvPropBool( RECVINFO(m_bMaster) )
|
|
||||||
END_RECV_TABLE()
|
|
||||||
|
|
||||||
C_PostProcessController* C_PostProcessController::ms_pMasterController = nullptr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
C_PostProcessController::C_PostProcessController()
|
|
||||||
: m_bMaster( false )
|
|
||||||
{
|
|
||||||
if ( ms_pMasterController == nullptr)
|
|
||||||
{
|
|
||||||
ms_pMasterController = this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
C_PostProcessController::~C_PostProcessController()
|
|
||||||
{
|
|
||||||
if ( ms_pMasterController == this )
|
|
||||||
{
|
|
||||||
ms_pMasterController = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_PostProcessController::PostDataUpdate( DataUpdateType_t updateType )
|
|
||||||
{
|
|
||||||
BaseClass::PostDataUpdate( updateType );
|
|
||||||
|
|
||||||
if ( m_bMaster )
|
|
||||||
{
|
|
||||||
ms_pMasterController = this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// Prevents parameters from fading after a save/restore
|
|
||||||
bool g_bPostProcessNeedsRestore = false;
|
|
||||||
|
|
||||||
void C_PostProcessController::OnRestore()
|
|
||||||
{
|
|
||||||
BaseClass::OnRestore();
|
|
||||||
|
|
||||||
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
|
|
||||||
if ( pPlayer && pPlayer->GetActivePostProcessController() == this )
|
|
||||||
{
|
|
||||||
// Tell clientmode this is part of a save/restore
|
|
||||||
g_bPostProcessNeedsRestore = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "postprocess_shared.h"
|
|
||||||
|
|
||||||
//=============================================================================
|
|
||||||
//
|
|
||||||
// Class Postprocess Controller:
|
|
||||||
//
|
|
||||||
class C_PostProcessController : public C_BaseEntity
|
|
||||||
{
|
|
||||||
DECLARE_CLASS( C_PostProcessController, C_BaseEntity );
|
|
||||||
public:
|
|
||||||
DECLARE_CLIENTCLASS();
|
|
||||||
|
|
||||||
C_PostProcessController();
|
|
||||||
virtual ~C_PostProcessController();
|
|
||||||
|
|
||||||
virtual void PostDataUpdate( DataUpdateType_t updateType );
|
|
||||||
|
|
||||||
static C_PostProcessController* GetMasterController() { return ms_pMasterController; }
|
|
||||||
|
|
||||||
PostProcessParameters_t m_PostProcessParameters;
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// Prevents fade time from being used in save/restore
|
|
||||||
virtual void OnRestore();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_bMaster;
|
|
||||||
|
|
||||||
static C_PostProcessController* ms_pMasterController;
|
|
||||||
};
|
|
@ -24,11 +24,6 @@ BEGIN_NETWORK_TABLE( CDynamicProp, DT_DynamicProp )
|
|||||||
RecvPropBool(RECVINFO(m_bUseHitboxesForRenderBox)),
|
RecvPropBool(RECVINFO(m_bUseHitboxesForRenderBox)),
|
||||||
END_NETWORK_TABLE()
|
END_NETWORK_TABLE()
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
// Allows client-side VScript to create dynamic props via CreateProp()
|
|
||||||
LINK_ENTITY_TO_CLASS( prop_dynamic, C_DynamicProp );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
C_DynamicProp::C_DynamicProp( void )
|
C_DynamicProp::C_DynamicProp( void )
|
||||||
{
|
{
|
||||||
m_iCachedFrameCount = -1;
|
m_iCachedFrameCount = -1;
|
||||||
|
@ -73,27 +73,6 @@ IMPLEMENT_CLIENTCLASS_DT_NOBASE( C_RopeKeyframe, DT_RopeKeyframe, CRopeKeyframe
|
|||||||
RecvPropInt( RECVINFO( m_iParentAttachment ) ),
|
RecvPropInt( RECVINFO( m_iParentAttachment ) ),
|
||||||
END_RECV_TABLE()
|
END_RECV_TABLE()
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
BEGIN_ENT_SCRIPTDESC( C_RopeKeyframe, C_BaseEntity, "The clientside class of move_rope and keyframe_rope" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetNodePosition, "Gets the position of the specified node index" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetNumNodes, "Gets the number of nodes available" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetStartEntity, "GetStartEntity", "Gets the rope's start entity" )
|
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetEndEntity, "GetEndEntity", "Gets the rope's end entity" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( SetupHangDistance, "Sets the rope's hang distance" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetSlack, "Sets the rope's slack value (extra length)" )
|
|
||||||
DEFINE_SCRIPTFUNC( GetRopeFlags, "Gets the rope's flags" )
|
|
||||||
DEFINE_SCRIPTFUNC( SetRopeFlags, "Sets the rope's flags" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( SetColorMod, "Sets the rope's color mod value" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( ShakeRope, "Shakes the rope with the specified center, radius, and magnitude" )
|
|
||||||
|
|
||||||
DEFINE_SCRIPTFUNC( AnyPointsMoved, "Returns true if any points have moved recently" )
|
|
||||||
END_SCRIPTDESC();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ROPE_IMPULSE_SCALE 20
|
#define ROPE_IMPULSE_SCALE 20
|
||||||
#define ROPE_IMPULSE_DECAY 0.95
|
#define ROPE_IMPULSE_DECAY 0.95
|
||||||
|
|
||||||
@ -545,7 +524,7 @@ void CRopeManager::DrawRenderCache_NonQueued( bool bShadowDepth, RopeRenderData_
|
|||||||
IMaterial *pMaterial = bShadowDepth ? g_pSplineCableShadowdepth : pRenderCache[iRenderCache].m_pSolidMaterial;
|
IMaterial *pMaterial = bShadowDepth ? g_pSplineCableShadowdepth : pRenderCache[iRenderCache].m_pSolidMaterial;
|
||||||
|
|
||||||
// Need to make sure that all rope materials use the splinerope shader since there are a lot of assumptions about how the shader interfaces with this code.
|
// Need to make sure that all rope materials use the splinerope shader since there are a lot of assumptions about how the shader interfaces with this code.
|
||||||
AssertOnce( V_strstr( pMaterial->GetShaderName(), "SDK_Cable" ) != NULL ); // splinerope
|
AssertOnce( V_stricmp( pMaterial->GetShaderName(), "SDK_Cable" ) == 0 ); // splinerope
|
||||||
|
|
||||||
pRenderContext->Bind( pMaterial );
|
pRenderContext->Bind( pMaterial );
|
||||||
|
|
||||||
@ -2043,25 +2022,6 @@ bool C_RopeKeyframe::GetAttachment( int number, Vector &origin, QAngle &angles )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
const Vector &C_RopeKeyframe::GetNodePosition( int index )
|
|
||||||
{
|
|
||||||
int nNodes = m_RopePhysics.NumNodes();
|
|
||||||
if ( index >= nNodes || nNodes < 2 )
|
|
||||||
{
|
|
||||||
Warning( "C_RopeKeyframe::GetNodePosition(): Invalid node index %i (number of nodes is %i)\n", index, nNodes );
|
|
||||||
return vec3_origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_RopePhysics.GetNode( index )->m_vPredicted;
|
|
||||||
}
|
|
||||||
|
|
||||||
int C_RopeKeyframe::GetNumNodes()
|
|
||||||
{
|
|
||||||
return m_RopePhysics.NumNodes();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool C_RopeKeyframe::AnyPointsMoved()
|
bool C_RopeKeyframe::AnyPointsMoved()
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
|
@ -33,9 +33,6 @@ public:
|
|||||||
DECLARE_CLASS( C_RopeKeyframe, C_BaseEntity );
|
DECLARE_CLASS( C_RopeKeyframe, C_BaseEntity );
|
||||||
DECLARE_CLIENTCLASS();
|
DECLARE_CLIENTCLASS();
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
DECLARE_ENT_SCRIPTDESC();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -145,11 +142,6 @@ public:
|
|||||||
virtual bool GetAttachment( int number, Vector &origin );
|
virtual bool GetAttachment( int number, Vector &origin );
|
||||||
virtual bool GetAttachmentVelocity( int number, Vector &originVel, Quaternion &angleVel );
|
virtual bool GetAttachmentVelocity( int number, Vector &originVel, Quaternion &angleVel );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
const Vector &GetNodePosition( int index );
|
|
||||||
int GetNumNodes();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void FinishInit( const char *pMaterialName );
|
void FinishInit( const char *pMaterialName );
|
||||||
@ -174,11 +166,6 @@ private:
|
|||||||
void ReceiveMessage( int classID, bf_read &msg );
|
void ReceiveMessage( int classID, bf_read &msg );
|
||||||
bool CalculateEndPointAttachment( C_BaseEntity *pEnt, int iAttachment, Vector &vPos, QAngle *pAngles );
|
bool CalculateEndPointAttachment( C_BaseEntity *pEnt, int iAttachment, Vector &vPos, QAngle *pAngles );
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
HSCRIPT ScriptGetStartEntity() { return ToHScript( GetStartEntity() ); }
|
|
||||||
HSCRIPT ScriptGetEndEntity() { return ToHScript( GetEndEntity() ); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Track which links touched something last frame. Used to prevent wind from gusting on them.
|
// Track which links touched something last frame. Used to prevent wind from gusting on them.
|
||||||
|
@ -179,10 +179,6 @@ void DispatchEffect( const char *pName, const CEffectData &data )
|
|||||||
te->DispatchEffect( filter, 0.0, data.m_vOrigin, pName, data );
|
te->DispatchEffect( filter, 0.0, data.m_vOrigin, pName, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
void DispatchEffect( const char *pName, const CEffectData &data, IRecipientFilter &filter )
|
|
||||||
{
|
|
||||||
te->DispatchEffect( filter, 0.0, data.m_vOrigin, pName, data );
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Playback
|
// Playback
|
||||||
|
@ -42,6 +42,5 @@ public:
|
|||||||
|
|
||||||
void DispatchEffectToCallback( const char *pEffectName, const CEffectData &m_EffectData );
|
void DispatchEffectToCallback( const char *pEffectName, const CEffectData &m_EffectData );
|
||||||
void DispatchEffect( const char *pName, const CEffectData &data );
|
void DispatchEffect( const char *pName, const CEffectData &data );
|
||||||
void DispatchEffect( const char *pName, const CEffectData &data, IRecipientFilter &filter );
|
|
||||||
|
|
||||||
#endif // C_TE_EFFECT_DISPATCH_H
|
#endif // C_TE_EFFECT_DISPATCH_H
|
||||||
|
@ -1833,9 +1833,6 @@ void CTempEnts::MuzzleFlash( const Vector& pos1, const QAngle& angles, int type,
|
|||||||
|
|
||||||
// UNDONE: These need their own effects/sprites. For now use the pistol
|
// UNDONE: These need their own effects/sprites. For now use the pistol
|
||||||
// SMG1
|
// SMG1
|
||||||
#if defined ( HL2MP ) // HACK for hl2mp, make the default muzzleflash the smg muzzleflash for weapons like the RPG that are using 'type 0'
|
|
||||||
default:
|
|
||||||
#endif // HL2MP
|
|
||||||
case MUZZLEFLASH_SMG1:
|
case MUZZLEFLASH_SMG1:
|
||||||
if ( firstPerson )
|
if ( firstPerson )
|
||||||
{
|
{
|
||||||
@ -1873,12 +1870,10 @@ void CTempEnts::MuzzleFlash( const Vector& pos1, const QAngle& angles, int type,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if !defined ( HL2MP ) // HACK for hl2mp, make the default muzzleflash the smg muzzleflash for weapons like the RPG that are using 'type 0'
|
|
||||||
default:
|
default:
|
||||||
// There's no supported muzzle flash for the type specified!
|
// There's no supported muzzle flash for the type specified!
|
||||||
Assert(0);
|
Assert(0);
|
||||||
break;
|
break;
|
||||||
#endif // HL2MP
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,14 +38,10 @@ extern vgui::IInputInternal *g_InputInternal;
|
|||||||
#define VGUI_SCREEN_MODE_RADIUS 80
|
#define VGUI_SCREEN_MODE_RADIUS 80
|
||||||
|
|
||||||
//Precache the materials
|
//Precache the materials
|
||||||
CLIENTEFFECT_REGISTER_BEGIN(PrecacheEffectVGuiScreen)
|
CLIENTEFFECT_REGISTER_BEGIN( PrecacheEffectVGuiScreen )
|
||||||
CLIENTEFFECT_MATERIAL("engine/writez")
|
CLIENTEFFECT_MATERIAL( "engine/writez" )
|
||||||
CLIENTEFFECT_REGISTER_END()
|
CLIENTEFFECT_REGISTER_END()
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
C_EntityClassList<C_VGuiScreen> g_VGUIScreenList;
|
|
||||||
template <> C_VGuiScreen* C_EntityClassList<C_VGuiScreen>::m_pClassList = NULL;
|
|
||||||
#endif // MAPBASE
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------------- //
|
||||||
// This is a cache of preloaded keyvalues.
|
// This is a cache of preloaded keyvalues.
|
||||||
@ -106,19 +102,11 @@ C_VGuiScreen::C_VGuiScreen()
|
|||||||
|
|
||||||
m_WriteZMaterial.Init( "engine/writez", TEXTURE_GROUP_VGUI );
|
m_WriteZMaterial.Init( "engine/writez", TEXTURE_GROUP_VGUI );
|
||||||
m_OverlayMaterial.Init( m_WriteZMaterial );
|
m_OverlayMaterial.Init( m_WriteZMaterial );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
g_VGUIScreenList.Insert(this);
|
|
||||||
#endif // MAPBASE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
C_VGuiScreen::~C_VGuiScreen()
|
C_VGuiScreen::~C_VGuiScreen()
|
||||||
{
|
{
|
||||||
DestroyVguiScreen();
|
DestroyVguiScreen();
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
g_VGUIScreenList.Remove(this);
|
|
||||||
#endif // MAPBASE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -428,69 +416,34 @@ void C_VGuiScreen::ClientThink( void )
|
|||||||
int px = (int)(u * m_nPixelWidth + 0.5f);
|
int px = (int)(u * m_nPixelWidth + 0.5f);
|
||||||
int py = (int)(v * m_nPixelHeight + 0.5f);
|
int py = (int)(v * m_nPixelHeight + 0.5f);
|
||||||
|
|
||||||
#ifndef MAPBASE
|
|
||||||
// Generate mouse input commands
|
// Generate mouse input commands
|
||||||
if ((px != m_nOldPx) || (py != m_nOldPy))
|
if ((px != m_nOldPx) || (py != m_nOldPy))
|
||||||
{
|
{
|
||||||
g_InputInternal->InternalCursorMoved(px, py);
|
g_InputInternal->InternalCursorMoved( px, py );
|
||||||
|
|
||||||
m_nOldPx = px;
|
m_nOldPx = px;
|
||||||
m_nOldPy = py;
|
m_nOldPy = py;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_nButtonPressed & IN_ATTACK)
|
if (m_nButtonPressed & IN_ATTACK)
|
||||||
{
|
{
|
||||||
g_InputInternal->SetMouseCodeState(MOUSE_LEFT, vgui::BUTTON_PRESSED);
|
g_InputInternal->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED );
|
||||||
g_InputInternal->InternalMousePressed(MOUSE_LEFT);
|
g_InputInternal->InternalMousePressed(MOUSE_LEFT);
|
||||||
}
|
}
|
||||||
if (m_nButtonPressed & IN_ATTACK2)
|
if (m_nButtonPressed & IN_ATTACK2)
|
||||||
{
|
{
|
||||||
g_InputInternal->SetMouseCodeState(MOUSE_RIGHT, vgui::BUTTON_PRESSED);
|
g_InputInternal->SetMouseCodeState( MOUSE_RIGHT, vgui::BUTTON_PRESSED );
|
||||||
g_InputInternal->InternalMousePressed(MOUSE_RIGHT);
|
g_InputInternal->InternalMousePressed( MOUSE_RIGHT );
|
||||||
}
|
}
|
||||||
if ((m_nButtonReleased & IN_ATTACK) || m_bLoseThinkNextFrame) // for a button release on loosing focus
|
if ( (m_nButtonReleased & IN_ATTACK) || m_bLoseThinkNextFrame) // for a button release on loosing focus
|
||||||
{
|
{
|
||||||
g_InputInternal->SetMouseCodeState(MOUSE_LEFT, vgui::BUTTON_RELEASED);
|
g_InputInternal->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED );
|
||||||
g_InputInternal->InternalMouseReleased(MOUSE_LEFT);
|
g_InputInternal->InternalMouseReleased( MOUSE_LEFT );
|
||||||
}
|
}
|
||||||
if (m_nButtonReleased & IN_ATTACK2)
|
if (m_nButtonReleased & IN_ATTACK2)
|
||||||
{
|
{
|
||||||
g_InputInternal->SetMouseCodeState(MOUSE_RIGHT, vgui::BUTTON_RELEASED);
|
g_InputInternal->SetMouseCodeState( MOUSE_RIGHT, vgui::BUTTON_RELEASED );
|
||||||
g_InputInternal->InternalMouseReleased(MOUSE_RIGHT);
|
g_InputInternal->InternalMouseReleased( MOUSE_RIGHT );
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
vgui::VPANEL focus = g_InputInternal->GetMouseOver();
|
|
||||||
// Generate mouse input commands
|
|
||||||
if ((px != m_nOldPx) || (py != m_nOldPy))
|
|
||||||
{
|
|
||||||
g_InputInternal->UpdateCursorPosInternal(px, py);
|
|
||||||
|
|
||||||
m_nOldPx = px;
|
|
||||||
m_nOldPy = py;
|
|
||||||
|
|
||||||
focus = pPanel->IsWithinTraverse(px, py, true);
|
|
||||||
g_InputInternal->SetMouseFocus(focus);
|
|
||||||
vgui::ivgui()->PostMessage(focus, new KeyValues("CursorMoved", "xpos", px, "ypos", py), NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
|
||||||
{
|
|
||||||
const int nBit = i ? IN_ATTACK2 : (IN_ATTACK | IN_USE);
|
|
||||||
const vgui::MouseCode nButton = i ? MOUSE_RIGHT : MOUSE_LEFT;
|
|
||||||
|
|
||||||
if ((m_nButtonReleased & nBit) || ((m_nButtonState & nBit) && m_bLoseThinkNextFrame)) // for a button release on loosing focus
|
|
||||||
{
|
|
||||||
g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_RELEASED);
|
|
||||||
vgui::ivgui()->PostMessage(focus, new KeyValues("MouseReleased", "code", nButton), NULL);
|
|
||||||
}
|
|
||||||
else if (m_nButtonPressed & nBit)
|
|
||||||
{
|
|
||||||
g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_PRESSED);
|
|
||||||
vgui::ivgui()->PostMessage(focus, new KeyValues("MousePressed", "code", nButton), NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // !MAPBASE
|
|
||||||
|
|
||||||
|
|
||||||
if ( m_bLoseThinkNextFrame == true )
|
if ( m_bLoseThinkNextFrame == true )
|
||||||
{
|
{
|
||||||
@ -674,7 +627,6 @@ bool C_VGuiScreen::IsInputOnlyToOwner( void )
|
|||||||
return (m_fScreenFlags & VGUI_SCREEN_ONLY_USABLE_BY_OWNER) != 0;
|
return (m_fScreenFlags & VGUI_SCREEN_ONLY_USABLE_BY_OWNER) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MAPBASE
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Enumator class for finding vgui screens close to the local player
|
// Enumator class for finding vgui screens close to the local player
|
||||||
@ -682,29 +634,29 @@ bool C_VGuiScreen::IsInputOnlyToOwner( void )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class CVGuiScreenEnumerator : public IPartitionEnumerator
|
class CVGuiScreenEnumerator : public IPartitionEnumerator
|
||||||
{
|
{
|
||||||
DECLARE_CLASS_GAMEROOT(CVGuiScreenEnumerator, IPartitionEnumerator);
|
DECLARE_CLASS_GAMEROOT( CVGuiScreenEnumerator, IPartitionEnumerator );
|
||||||
public:
|
public:
|
||||||
virtual IterationRetval_t EnumElement(IHandleEntity* pHandleEntity);
|
virtual IterationRetval_t EnumElement( IHandleEntity *pHandleEntity );
|
||||||
|
|
||||||
int GetScreenCount();
|
int GetScreenCount();
|
||||||
C_VGuiScreen* GetVGuiScreen(int index);
|
C_VGuiScreen *GetVGuiScreen( int index );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CUtlVector< CHandle< C_VGuiScreen > > m_VguiScreens;
|
CUtlVector< CHandle< C_VGuiScreen > > m_VguiScreens;
|
||||||
};
|
};
|
||||||
|
|
||||||
IterationRetval_t CVGuiScreenEnumerator::EnumElement(IHandleEntity* pHandleEntity)
|
IterationRetval_t CVGuiScreenEnumerator::EnumElement( IHandleEntity *pHandleEntity )
|
||||||
{
|
{
|
||||||
C_BaseEntity* pEnt = ClientEntityList().GetBaseEntityFromHandle(pHandleEntity->GetRefEHandle());
|
C_BaseEntity *pEnt = ClientEntityList().GetBaseEntityFromHandle( pHandleEntity->GetRefEHandle() );
|
||||||
if (pEnt == NULL)
|
if ( pEnt == NULL )
|
||||||
return ITERATION_CONTINUE;
|
return ITERATION_CONTINUE;
|
||||||
|
|
||||||
// FIXME.. pretty expensive...
|
// FIXME.. pretty expensive...
|
||||||
C_VGuiScreen* pScreen = dynamic_cast<C_VGuiScreen*>(pEnt);
|
C_VGuiScreen *pScreen = dynamic_cast<C_VGuiScreen*>(pEnt);
|
||||||
if (pScreen)
|
if ( pScreen )
|
||||||
{
|
{
|
||||||
int i = m_VguiScreens.AddToTail();
|
int i = m_VguiScreens.AddToTail( );
|
||||||
m_VguiScreens[i].Set(pScreen);
|
m_VguiScreens[i].Set( pScreen );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ITERATION_CONTINUE;
|
return ITERATION_CONTINUE;
|
||||||
@ -715,12 +667,10 @@ int CVGuiScreenEnumerator::GetScreenCount()
|
|||||||
return m_VguiScreens.Count();
|
return m_VguiScreens.Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
C_VGuiScreen* CVGuiScreenEnumerator::GetVGuiScreen(int index)
|
C_VGuiScreen *CVGuiScreenEnumerator::GetVGuiScreen( int index )
|
||||||
{
|
{
|
||||||
return m_VguiScreens[index].Get();
|
return m_VguiScreens[index].Get();
|
||||||
}
|
}
|
||||||
#endif // !MAPBASE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -754,29 +704,18 @@ C_BaseEntity *FindNearbyVguiScreen( const Vector &viewPosition, const QAngle &vi
|
|||||||
Ray_t lookRay;
|
Ray_t lookRay;
|
||||||
lookRay.Init( viewPosition, lookEnd );
|
lookRay.Init( viewPosition, lookEnd );
|
||||||
|
|
||||||
#ifndef MAPBASE
|
|
||||||
// Look for vgui screens that are close to the player
|
// Look for vgui screens that are close to the player
|
||||||
CVGuiScreenEnumerator localScreens;
|
CVGuiScreenEnumerator localScreens;
|
||||||
partition->EnumerateElementsInSphere(PARTITION_CLIENT_NON_STATIC_EDICTS, viewPosition, VGUI_SCREEN_MODE_RADIUS, false, &localScreens);
|
partition->EnumerateElementsInSphere( PARTITION_CLIENT_NON_STATIC_EDICTS, viewPosition, VGUI_SCREEN_MODE_RADIUS, false, &localScreens );
|
||||||
#endif // !MAPBASE
|
|
||||||
|
|
||||||
Vector vecOut, vecViewDelta;
|
Vector vecOut, vecViewDelta;
|
||||||
|
|
||||||
float flBestDist = 2.0f;
|
float flBestDist = 2.0f;
|
||||||
C_VGuiScreen *pBestScreen = NULL;
|
C_VGuiScreen *pBestScreen = NULL;
|
||||||
#ifndef MAPBASE
|
|
||||||
for (int i = localScreens.GetScreenCount(); --i >= 0; )
|
for (int i = localScreens.GetScreenCount(); --i >= 0; )
|
||||||
#else
|
|
||||||
for (C_VGuiScreen* pScreen = g_VGUIScreenList.m_pClassList; pScreen != NULL; pScreen = pScreen->m_pNext)
|
|
||||||
#endif // !MAPBASE
|
|
||||||
{
|
{
|
||||||
#ifndef MAPBASE
|
C_VGuiScreen *pScreen = localScreens.GetVGuiScreen(i);
|
||||||
C_VGuiScreen* pScreen = localScreens.GetVGuiScreen(i);
|
|
||||||
#else
|
|
||||||
// Skip if out of PVS
|
|
||||||
if (pScreen->IsDormant())
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
if ( pScreen->IsAttachedToViewModel() )
|
if ( pScreen->IsAttachedToViewModel() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -926,21 +865,11 @@ vgui::Panel *CVGuiScreenPanel::CreateControlByName(const char *controlName)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Called when the user presses a button
|
// Purpose: Called when the user presses a button
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CVGuiScreenPanel::OnCommand(const char* command)
|
void CVGuiScreenPanel::OnCommand( const char *command)
|
||||||
{
|
{
|
||||||
if (Q_stricmp(command, "vguicancel"))
|
if ( Q_stricmp( command, "vguicancel" ) )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
engine->ClientCmd( const_cast<char *>( command ) );
|
||||||
if (m_hEntity && m_hEntity->IsServerEntity())
|
|
||||||
{
|
|
||||||
KeyValues* pCommand = new KeyValues("EntityCommand");
|
|
||||||
pCommand->SetInt("entindex", m_hEntity->index);
|
|
||||||
pCommand->SetString("command_data", command);
|
|
||||||
engine->ServerCmdKeyValues(pCommand);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
engine->ClientCmd(const_cast<char*>(command));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseClass::OnCommand(command);
|
BaseClass::OnCommand(command);
|
||||||
|
@ -66,10 +66,6 @@ class C_VGuiScreen : public C_BaseEntity
|
|||||||
public:
|
public:
|
||||||
DECLARE_CLIENTCLASS();
|
DECLARE_CLIENTCLASS();
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
C_VGuiScreen* m_pNext;
|
|
||||||
#endif // MAPBASE
|
|
||||||
|
|
||||||
C_VGuiScreen();
|
C_VGuiScreen();
|
||||||
~C_VGuiScreen();
|
~C_VGuiScreen();
|
||||||
|
|
||||||
@ -116,15 +112,6 @@ public:
|
|||||||
C_BasePlayer *GetPlayerOwner( void );
|
C_BasePlayer *GetPlayerOwner( void );
|
||||||
bool IsInputOnlyToOwner( void );
|
bool IsInputOnlyToOwner( void );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
void GetSize( float &width, float &height ) const { width = m_flWidth; height = m_flHeight; }
|
|
||||||
void GetPixelSize( int &width, int &height ) const { width = m_nPixelWidth; height = m_nPixelHeight; }
|
|
||||||
void SetWidth( float flWidth ) { m_flWidth = flWidth; }
|
|
||||||
void SetHeight( float flHeight ) { m_flHeight = flHeight; }
|
|
||||||
void SetPixelWidth( int nWidth ) { m_nPixelWidth = nWidth; }
|
|
||||||
void SetPixelHeight( int nHeight ) { m_nPixelHeight = nHeight; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Vgui screen management
|
// Vgui screen management
|
||||||
void CreateVguiScreen( const char *pTypeName );
|
void CreateVguiScreen( const char *pTypeName );
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
#include "ivieweffects.h"
|
#include "ivieweffects.h"
|
||||||
#include "shake.h"
|
#include "shake.h"
|
||||||
#include "eventlist.h"
|
#include "eventlist.h"
|
||||||
#ifdef MAPBASE
|
|
||||||
#include "mapentities_shared.h"
|
|
||||||
#endif
|
|
||||||
// NVNT haptic include for notification of world precache
|
// NVNT haptic include for notification of world precache
|
||||||
#include "haptics/haptic_utils.h"
|
#include "haptics/haptic_utils.h"
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
@ -65,11 +62,10 @@ BEGIN_RECV_TABLE( C_World, DT_World )
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
RecvPropString(RECVINFO(m_iszChapterTitle)),
|
RecvPropString(RECVINFO(m_iszChapterTitle)),
|
||||||
#endif
|
#endif
|
||||||
END_RECV_TABLE()
|
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
extern bool VScriptClientInit();
|
RecvPropInt(RECVINFO(m_iScriptLanguage)),
|
||||||
#endif
|
#endif
|
||||||
|
END_RECV_TABLE()
|
||||||
|
|
||||||
|
|
||||||
C_World::C_World( void )
|
C_World::C_World( void )
|
||||||
@ -86,11 +82,6 @@ bool C_World::Init( int entnum, int iSerialNum )
|
|||||||
ActivityList_Init();
|
ActivityList_Init();
|
||||||
EventList_Init();
|
EventList_Init();
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
m_iScriptLanguageServer = SL_NONE;
|
|
||||||
m_iScriptLanguageClient = SL_NONE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return BaseClass::Init( entnum, iSerialNum );
|
return BaseClass::Init( entnum, iSerialNum );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,72 +190,6 @@ void C_World::Spawn( void )
|
|||||||
Precache();
|
Precache();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Parse data from a map file
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool C_World::KeyValue( const char *szKeyName, const char *szValue )
|
|
||||||
{
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
if ( FStrEq( szKeyName, "vscriptlanguage" ) )
|
|
||||||
{
|
|
||||||
m_iScriptLanguageServer = atoi( szValue );
|
|
||||||
}
|
|
||||||
else if ( FStrEq( szKeyName, "vscriptlanguage_client" ) )
|
|
||||||
{
|
|
||||||
m_iScriptLanguageClient = atoi( szValue );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
return BaseClass::KeyValue( szKeyName, szValue );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Parses worldspawn data from BSP on the client
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void C_World::ParseWorldMapData( const char *pMapData )
|
|
||||||
{
|
|
||||||
char szTokenBuffer[MAPKEY_MAXLENGTH];
|
|
||||||
for ( ; true; pMapData = MapEntity_SkipToNextEntity(pMapData, szTokenBuffer) )
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Parse the opening brace.
|
|
||||||
//
|
|
||||||
char token[MAPKEY_MAXLENGTH];
|
|
||||||
pMapData = MapEntity_ParseToken( pMapData, token );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check to see if we've finished or not.
|
|
||||||
//
|
|
||||||
if (!pMapData)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (token[0] != '{')
|
|
||||||
{
|
|
||||||
Error( "MapEntity_ParseAllEntities: found %s when expecting {", token);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
CEntityMapData entData( (char*)pMapData );
|
|
||||||
char className[MAPKEY_MAXLENGTH];
|
|
||||||
|
|
||||||
if (!entData.ExtractValue( "classname", className ))
|
|
||||||
{
|
|
||||||
Error( "classname missing from entity!\n" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_strcmp( className, "worldspawn" ) )
|
|
||||||
{
|
|
||||||
// Set up keyvalues.
|
|
||||||
ParseMapData( &entData );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
C_World *GetClientWorldEntity()
|
C_World *GetClientWorldEntity()
|
||||||
|
@ -31,7 +31,6 @@ public:
|
|||||||
|
|
||||||
virtual void Precache();
|
virtual void Precache();
|
||||||
virtual void Spawn();
|
virtual void Spawn();
|
||||||
virtual bool KeyValue( const char *szKeyName, const char *szValue );
|
|
||||||
|
|
||||||
// Don't worry about adding the world to the collision list; it's already there
|
// Don't worry about adding the world to the collision list; it's already there
|
||||||
virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_NOT_COLLIDE; }
|
virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_NOT_COLLIDE; }
|
||||||
@ -42,17 +41,8 @@ public:
|
|||||||
float GetWaveHeight() const;
|
float GetWaveHeight() const;
|
||||||
const char *GetDetailSpriteMaterial() const;
|
const char *GetDetailSpriteMaterial() const;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// A special function which parses map data for the client world entity before LevelInitPreEntity().
|
|
||||||
// This can be used to access keyvalues early and without transmitting from the server.
|
|
||||||
void ParseWorldMapData( const char *pMapData );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
void ClientThink() { ScriptContextThink(); }
|
ScriptLanguage_t GetScriptLanguage() { return (ScriptLanguage_t)m_iScriptLanguage; }
|
||||||
|
|
||||||
// -2 = Use server language
|
|
||||||
ScriptLanguage_t GetScriptLanguage() { return (ScriptLanguage_t)(m_iScriptLanguageClient != -2 ? m_iScriptLanguageClient : m_iScriptLanguageServer); }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -74,8 +64,7 @@ public:
|
|||||||
char m_iszChapterTitle[64];
|
char m_iszChapterTitle[64];
|
||||||
#endif
|
#endif
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
int m_iScriptLanguageServer;
|
int m_iScriptLanguage;
|
||||||
int m_iScriptLanguageClient;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -37,10 +37,6 @@ struct studiohdr_t;
|
|||||||
#include <icvar.h>
|
#include <icvar.h>
|
||||||
#include <baseentity_shared.h>
|
#include <baseentity_shared.h>
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
#include "tier1/mapbase_con_groups.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// This is a precompiled header. Include a bunch of common stuff.
|
// This is a precompiled header. Include a bunch of common stuff.
|
||||||
// This is kind of ugly in that it adds a bunch of dependency where it isn't needed.
|
// This is kind of ugly in that it adds a bunch of dependency where it isn't needed.
|
||||||
|
@ -147,8 +147,9 @@
|
|||||||
#include "fbxsystem/fbxsystem.h"
|
#include "fbxsystem/fbxsystem.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef DISCORD_RPC
|
||||||
#include "vscript_client.h"
|
#include "discord_rpc.h"
|
||||||
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern vgui::IInputInternal *g_InputInternal;
|
extern vgui::IInputInternal *g_InputInternal;
|
||||||
@ -274,8 +275,6 @@ void ProcessCacheUsedMaterials()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGui_ClearVideoPanels();
|
|
||||||
|
|
||||||
// String tables
|
// String tables
|
||||||
INetworkStringTable *g_pStringTableParticleEffectNames = NULL;
|
INetworkStringTable *g_pStringTableParticleEffectNames = NULL;
|
||||||
INetworkStringTable *g_StringTableEffectDispatch = NULL;
|
INetworkStringTable *g_StringTableEffectDispatch = NULL;
|
||||||
@ -1110,9 +1109,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
|
|||||||
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetEntitySaveRestoreBlockHandler() );
|
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetEntitySaveRestoreBlockHandler() );
|
||||||
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetPhysSaveRestoreBlockHandler() );
|
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetPhysSaveRestoreBlockHandler() );
|
||||||
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetViewEffectsRestoreBlockHandler() );
|
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetViewEffectsRestoreBlockHandler() );
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetVScriptSaveRestoreBlockHandler() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ClientWorldFactoryInit();
|
ClientWorldFactoryInit();
|
||||||
|
|
||||||
@ -1130,10 +1126,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
|
|||||||
MapbaseRPC_Init();
|
MapbaseRPC_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
CommandLine()->AppendParm( "+r_hunkalloclightmaps", "0" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1219,17 +1211,12 @@ void CHLClient::Shutdown( void )
|
|||||||
g_pSixenseInput = NULL;
|
g_pSixenseInput = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VGui_ClearVideoPanels();
|
|
||||||
|
|
||||||
C_BaseAnimating::ShutdownBoneSetupThreadPool();
|
C_BaseAnimating::ShutdownBoneSetupThreadPool();
|
||||||
ClientWorldFactoryShutdown();
|
ClientWorldFactoryShutdown();
|
||||||
|
|
||||||
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetViewEffectsRestoreBlockHandler() );
|
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetViewEffectsRestoreBlockHandler() );
|
||||||
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetPhysSaveRestoreBlockHandler() );
|
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetPhysSaveRestoreBlockHandler() );
|
||||||
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetEntitySaveRestoreBlockHandler() );
|
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetEntitySaveRestoreBlockHandler() );
|
||||||
#ifdef MAPBASE_VSCRIPT
|
|
||||||
g_pGameSaveRestoreBlockSet->RemoveBlockHandler( GetVScriptSaveRestoreBlockHandler() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ClientVoiceMgr_Shutdown();
|
ClientVoiceMgr_Shutdown();
|
||||||
|
|
||||||
@ -1649,10 +1636,6 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
|
|||||||
tempents->LevelInit();
|
tempents->LevelInit();
|
||||||
ResetToneMapping(1.0);
|
ResetToneMapping(1.0);
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
GetClientWorldEntity()->ParseWorldMapData( engine->GetMapEntitiesString() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IGameSystem::LevelInitPreEntityAllSystems(pMapName);
|
IGameSystem::LevelInitPreEntityAllSystems(pMapName);
|
||||||
|
|
||||||
#ifdef USES_ECON_ITEMS
|
#ifdef USES_ECON_ITEMS
|
||||||
|
@ -166,6 +166,7 @@ inline bool FStrEq(const char *sz1, const char *sz2)
|
|||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
// V_stricmp() already checks if the pointers are equal, so having a comparison here is pointless.
|
// V_stricmp() already checks if the pointers are equal, so having a comparison here is pointless.
|
||||||
|
// I had few reasons to do this, but maybe you'll thank me later.
|
||||||
return ( V_stricmp(sz1, sz2) == 0 );
|
return ( V_stricmp(sz1, sz2) == 0 );
|
||||||
#else
|
#else
|
||||||
return ( sz1 == sz2 || V_stricmp(sz1, sz2) == 0 );
|
return ( sz1 == sz2 || V_stricmp(sz1, sz2) == 0 );
|
||||||
|
@ -536,6 +536,7 @@ $Project
|
|||||||
"$SRCDIR\public\dt_utlvector_recv.cpp" \
|
"$SRCDIR\public\dt_utlvector_recv.cpp" \
|
||||||
"$SRCDIR\public\filesystem_helpers.cpp" \
|
"$SRCDIR\public\filesystem_helpers.cpp" \
|
||||||
"$SRCDIR\public\interpolatortypes.cpp" \
|
"$SRCDIR\public\interpolatortypes.cpp" \
|
||||||
|
"$SRCDIR\game\shared\interval.cpp" \
|
||||||
"$SRCDIR\common\language.cpp" \
|
"$SRCDIR\common\language.cpp" \
|
||||||
"$SRCDIR\public\networkvar.cpp" \
|
"$SRCDIR\public\networkvar.cpp" \
|
||||||
"$SRCDIR\common\randoverride.cpp" \
|
"$SRCDIR\common\randoverride.cpp" \
|
||||||
@ -1106,7 +1107,6 @@ $Project
|
|||||||
$File "$SRCDIR\public\vgui_controls\WizardSubPanel.h"
|
$File "$SRCDIR\public\vgui_controls\WizardSubPanel.h"
|
||||||
$File "$SRCDIR\public\worldsize.h"
|
$File "$SRCDIR\public\worldsize.h"
|
||||||
$File "$SRCDIR\public\zip_uncompressed.h"
|
$File "$SRCDIR\public\zip_uncompressed.h"
|
||||||
$File "$SRCDIR\public\tier1\interval.h"
|
|
||||||
//Haptics
|
//Haptics
|
||||||
$File "$SRCDIR\public\haptics\ihaptics.h" [$WIN32]
|
$File "$SRCDIR\public\haptics\ihaptics.h" [$WIN32]
|
||||||
$File "$SRCDIR\public\haptics\haptic_utils.h" [$WIN32]
|
$File "$SRCDIR\public\haptics\haptic_utils.h" [$WIN32]
|
||||||
@ -1163,6 +1163,7 @@ $Project
|
|||||||
$File "$SRCDIR\game\shared\igamesystem.h"
|
$File "$SRCDIR\game\shared\igamesystem.h"
|
||||||
$File "$SRCDIR\game\shared\imovehelper.h"
|
$File "$SRCDIR\game\shared\imovehelper.h"
|
||||||
$File "$SRCDIR\game\shared\in_buttons.h"
|
$File "$SRCDIR\game\shared\in_buttons.h"
|
||||||
|
$File "$SRCDIR\game\shared\interval.h"
|
||||||
$File "$SRCDIR\game\shared\iplayeranimstate.h"
|
$File "$SRCDIR\game\shared\iplayeranimstate.h"
|
||||||
$File "$SRCDIR\game\shared\ipredictionsystem.h"
|
$File "$SRCDIR\game\shared\ipredictionsystem.h"
|
||||||
$File "$SRCDIR\game\shared\itempents.h"
|
$File "$SRCDIR\game\shared\itempents.h"
|
||||||
@ -1260,9 +1261,6 @@ $Project
|
|||||||
$Lib vtf
|
$Lib vtf
|
||||||
$ImpLib steam_api
|
$ImpLib steam_api
|
||||||
|
|
||||||
// Discord integration
|
|
||||||
$Lib "$LIBPUBLIC\discord-rpc" [$MAPBASE_RPC&&!$LINUXALL]
|
|
||||||
|
|
||||||
$Lib $LIBCOMMON/libcrypto [$POSIX]
|
$Lib $LIBCOMMON/libcrypto [$POSIX]
|
||||||
|
|
||||||
$ImpLib "$LIBCOMMON\curl" [$OSXALL]
|
$ImpLib "$LIBCOMMON\curl" [$OSXALL]
|
||||||
|
@ -8,11 +8,9 @@ $Configuration
|
|||||||
{
|
{
|
||||||
$Compiler
|
$Compiler
|
||||||
{
|
{
|
||||||
$PreprocessorDefinitions "$BASE;ASW_PROJECTED_TEXTURES;DYNAMIC_RTT_SHADOWS;GLOWS_ENABLE"
|
$PreprocessorDefinitions "$BASE;ASW_PROJECTED_TEXTURES;DYNAMIC_RTT_SHADOWS"
|
||||||
|
|
||||||
$PreprocessorDefinitions "$BASE;MAPBASE_RPC;DISCORD_RPC;STEAM_RPC" [$MAPBASE_RPC&&!$LINUXALL]
|
$PreprocessorDefinitions "$BASE;MAPBASE_RPC;DISCORD_RPC;STEAM_RPC" [$MAPBASE_RPC]
|
||||||
$PreprocessorDefinitions "$BASE;MAPBASE_VSCRIPT" [$MAPBASE_VSCRIPT]
|
|
||||||
$PreprocessorDefinitions "$BASE;NEW_RESPONSE_SYSTEM" [$NEW_RESPONSE_SYSTEM]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,54 +21,21 @@ $Project
|
|||||||
$File "c_env_global_light.cpp"
|
$File "c_env_global_light.cpp"
|
||||||
$File "worldlight.cpp"
|
$File "worldlight.cpp"
|
||||||
$File "worldlight.h"
|
$File "worldlight.h"
|
||||||
$File "c_baselesson.cpp"
|
|
||||||
$File "c_baselesson.h"
|
|
||||||
$File "c_gameinstructor.cpp"
|
|
||||||
$File "c_gameinstructor.h"
|
|
||||||
$File "hud_locator_target.cpp"
|
|
||||||
$File "hud_locator_target.h"
|
|
||||||
$File "c_postprocesscontroller.cpp"
|
|
||||||
$File "c_postprocesscontroller.h"
|
|
||||||
$File "c_env_dof_controller.cpp"
|
|
||||||
$File "c_movie_display.cpp"
|
|
||||||
$File "c_movie_display.h"
|
|
||||||
$File "vgui_movie_display.cpp"
|
|
||||||
$File "convarproxy.cpp"
|
|
||||||
|
|
||||||
$Folder "Mapbase"
|
$Folder "Mapbase"
|
||||||
{
|
{
|
||||||
$File "$SRCDIR\game\shared\mapbase\mapbase_shared.cpp"
|
$File "$SRCDIR\game\shared\mapbase\mapbase_shared.cpp"
|
||||||
$File "$SRCDIR\game\shared\mapbase\mapbase_usermessages.cpp"
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\mapbase_rpc.cpp"
|
$File "$SRCDIR\game\shared\mapbase\mapbase_rpc.cpp"
|
||||||
$File "$SRCDIR\game\shared\mapbase\mapbase_game_log.cpp"
|
$File "$SRCDIR\game\shared\mapbase\mapbase_game_log.cpp"
|
||||||
$File "$SRCDIR\game\shared\mapbase\MapEdit.cpp"
|
$File "$SRCDIR\game\shared\mapbase\MapEdit.cpp"
|
||||||
$File "$SRCDIR\game\shared\mapbase\MapEdit.h"
|
$File "$SRCDIR\game\shared\mapbase\MapEdit.h"
|
||||||
$File "$SRCDIR\game\shared\mapbase\matchers.cpp"
|
$File "$SRCDIR\game\shared\mapbase\matchers.cpp"
|
||||||
$File "$SRCDIR\game\shared\mapbase\matchers.h"
|
$File "$SRCDIR\game\shared\mapbase\matchers.h"
|
||||||
$File "$SRCDIR\game\shared\mapbase\singleplayer_animstate.cpp"
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\singleplayer_animstate.h"
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.h" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_math.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.cpp" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.h" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_hl2.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_hl2.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_consts_shared.cpp" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_consts_weapons.cpp" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.cpp" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.h" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "$SRCDIR\game\shared\mapbase\logic_script_client.cpp" [$MAPBASE_VSCRIPT]
|
|
||||||
|
|
||||||
$File "mapbase\vscript_vgui.cpp" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "mapbase\vscript_vgui.h" [$MAPBASE_VSCRIPT]
|
|
||||||
$File "mapbase\vscript_vgui.nut" [$MAPBASE_VSCRIPT]
|
|
||||||
|
|
||||||
$File "mapbase\c_func_clientclip.cpp"
|
$File "mapbase\c_func_clientclip.cpp"
|
||||||
$File "mapbase\c_func_fake_worldportal.cpp"
|
|
||||||
$File "mapbase\c_func_fake_worldportal.h"
|
|
||||||
$File "mapbase\c_point_glow.cpp"
|
|
||||||
$File "mapbase\c_vgui_text_display.cpp"
|
|
||||||
$File "mapbase\c_weapon_custom_hl2.cpp"
|
|
||||||
$File "mapbase\mapbase_autocubemap.cpp"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$Folder "HL2 DLL"
|
$Folder "HL2 DLL"
|
||||||
@ -93,6 +58,5 @@ $Project
|
|||||||
$Folder "Link Libraries"
|
$Folder "Link Libraries"
|
||||||
{
|
{
|
||||||
$Lib "vscript" [$MAPBASE_VSCRIPT]
|
$Lib "vscript" [$MAPBASE_VSCRIPT]
|
||||||
$Lib "raytrace"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <vgui/ILocalize.h>
|
#include <vgui/ILocalize.h>
|
||||||
#include "hud_vote.h"
|
#include "hud_vote.h"
|
||||||
#include "ienginevgui.h"
|
#include "ienginevgui.h"
|
||||||
#include "viewpostprocess.h"
|
|
||||||
#include "sourcevr/isourcevirtualreality.h"
|
#include "sourcevr/isourcevirtualreality.h"
|
||||||
#if defined( _X360 )
|
#if defined( _X360 )
|
||||||
#include "xbox/xbox_console.h"
|
#include "xbox/xbox_console.h"
|
||||||
@ -66,10 +65,6 @@ extern ConVar replay_rendersetting_renderglow;
|
|||||||
#include "econ_item_description.h"
|
#include "econ_item_description.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLOWS_ENABLE
|
|
||||||
#include "clienteffectprecachesystem.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
|
|
||||||
@ -94,13 +89,6 @@ extern ConVar voice_modenable;
|
|||||||
|
|
||||||
extern bool IsInCommentaryMode( void );
|
extern bool IsInCommentaryMode( void );
|
||||||
|
|
||||||
#ifdef GLOWS_ENABLE
|
|
||||||
CLIENTEFFECT_REGISTER_BEGIN( PrecachePostProcessingEffectsGlow )
|
|
||||||
CLIENTEFFECT_MATERIAL( "dev/glow_color" )
|
|
||||||
CLIENTEFFECT_MATERIAL( "dev/halo_add_to_screen" )
|
|
||||||
CLIENTEFFECT_REGISTER_END_CONDITIONAL( engine->GetDXSupportLevel() >= 90 )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef VOICE_VOX_ENABLE
|
#ifdef VOICE_VOX_ENABLE
|
||||||
void VoxCallback( IConVar *var, const char *oldString, float oldFloat )
|
void VoxCallback( IConVar *var, const char *oldString, float oldFloat )
|
||||||
{
|
{
|
||||||
@ -292,12 +280,6 @@ ClientModeShared::ClientModeShared()
|
|||||||
m_pWeaponSelection = NULL;
|
m_pWeaponSelection = NULL;
|
||||||
m_nRootSize[ 0 ] = m_nRootSize[ 1 ] = -1;
|
m_nRootSize[ 0 ] = m_nRootSize[ 1 ] = -1;
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
m_pCurrentPostProcessController = NULL;
|
|
||||||
m_PostProcessLerpTimer.Invalidate();
|
|
||||||
m_pCurrentColorCorrection = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined( REPLAY_ENABLED )
|
#if defined( REPLAY_ENABLED )
|
||||||
m_pReplayReminderPanel = NULL;
|
m_pReplayReminderPanel = NULL;
|
||||||
m_flReplayStartRecordTime = 0.0f;
|
m_flReplayStartRecordTime = 0.0f;
|
||||||
@ -611,8 +593,6 @@ void ClientModeShared::Update()
|
|||||||
m_pViewport->SetVisible( cl_drawhud.GetBool() );
|
m_pViewport->SetVisible( cl_drawhud.GetBool() );
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePostProcessingEffects();
|
|
||||||
|
|
||||||
UpdateRumbleEffects();
|
UpdateRumbleEffects();
|
||||||
|
|
||||||
if ( cl_show_num_particle_systems.GetBool() )
|
if ( cl_show_num_particle_systems.GetBool() )
|
||||||
@ -638,43 +618,6 @@ void ClientModeShared::Update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void ClientModeShared::OnColorCorrectionWeightsReset( void )
|
|
||||||
{
|
|
||||||
C_ColorCorrection *pNewColorCorrection = NULL;
|
|
||||||
C_ColorCorrection *pOldColorCorrection = m_pCurrentColorCorrection;
|
|
||||||
C_BasePlayer* pPlayer = C_BasePlayer::GetLocalPlayer();
|
|
||||||
if ( pPlayer )
|
|
||||||
{
|
|
||||||
pNewColorCorrection = pPlayer->GetActiveColorCorrection();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pNewColorCorrection != pOldColorCorrection )
|
|
||||||
{
|
|
||||||
if ( pOldColorCorrection )
|
|
||||||
{
|
|
||||||
pOldColorCorrection->EnableOnClient( false );
|
|
||||||
}
|
|
||||||
if ( pNewColorCorrection )
|
|
||||||
{
|
|
||||||
pNewColorCorrection->EnableOnClient( true, pOldColorCorrection == NULL );
|
|
||||||
}
|
|
||||||
m_pCurrentColorCorrection = pNewColorCorrection;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
float ClientModeShared::GetColorCorrectionScale( void ) const
|
|
||||||
{
|
|
||||||
return 1.0f;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// This processes all input before SV Move messages are sent
|
// This processes all input before SV Move messages are sent
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -821,10 +764,6 @@ int ClientModeShared::HudElementKeyInput( int down, ButtonCode_t keynum, const c
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool ClientModeShared::DoPostScreenSpaceEffects( const CViewSetup *pSetup )
|
bool ClientModeShared::DoPostScreenSpaceEffects( const CViewSetup *pSetup )
|
||||||
{
|
{
|
||||||
#ifdef GLOWS_ENABLE
|
|
||||||
g_GlowObjectManager.RenderGlowEffects( pSetup, 0 );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined( REPLAY_ENABLED )
|
#if defined( REPLAY_ENABLED )
|
||||||
if ( engine->IsPlayingDemo() )
|
if ( engine->IsPlayingDemo() )
|
||||||
{
|
{
|
||||||
@ -960,17 +899,6 @@ void ClientModeShared::LevelShutdown( void )
|
|||||||
s_hVGuiContext = DEFAULT_VGUI_CONTEXT;
|
s_hVGuiContext = DEFAULT_VGUI_CONTEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// Always reset post-processing on level unload
|
|
||||||
//if (m_pCurrentPostProcessController)
|
|
||||||
{
|
|
||||||
m_CurrentPostProcessParameters = PostProcessParameters_t();
|
|
||||||
m_LerpEndPostProcessParameters = PostProcessParameters_t();
|
|
||||||
m_pCurrentPostProcessController = NULL;
|
|
||||||
SetPostProcessParams( &m_CurrentPostProcessParameters );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Reset any player explosion/shock effects
|
// Reset any player explosion/shock effects
|
||||||
CLocalPlayerFilter filter;
|
CLocalPlayerFilter filter;
|
||||||
enginesound->SetPlayerDSP( filter, 0, true );
|
enginesound->SetPlayerDSP( filter, 0, true );
|
||||||
@ -1045,69 +973,6 @@ float ClientModeShared::GetViewModelFOV( void )
|
|||||||
return v_viewmodel_fov.GetFloat();
|
return v_viewmodel_fov.GetFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
extern bool g_bPostProcessNeedsRestore;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void ClientModeShared::UpdatePostProcessingEffects()
|
|
||||||
{
|
|
||||||
C_PostProcessController* pNewPostProcessController = NULL;
|
|
||||||
C_BasePlayer* pPlayer = C_BasePlayer::GetLocalPlayer();
|
|
||||||
|
|
||||||
if (pPlayer)
|
|
||||||
pNewPostProcessController = pPlayer->GetActivePostProcessController();
|
|
||||||
|
|
||||||
if (!pNewPostProcessController)
|
|
||||||
{
|
|
||||||
m_CurrentPostProcessParameters = PostProcessParameters_t();
|
|
||||||
m_pCurrentPostProcessController = NULL;
|
|
||||||
SetPostProcessParams( &m_CurrentPostProcessParameters );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pNewPostProcessController != m_pCurrentPostProcessController)
|
|
||||||
m_pCurrentPostProcessController = pNewPostProcessController;
|
|
||||||
|
|
||||||
// Start a lerp timer if the parameters changed, regardless of whether the controller changed
|
|
||||||
if (m_LerpEndPostProcessParameters != pNewPostProcessController->m_PostProcessParameters)
|
|
||||||
{
|
|
||||||
m_LerpStartPostProcessParameters = m_CurrentPostProcessParameters;
|
|
||||||
m_LerpEndPostProcessParameters = pNewPostProcessController ? pNewPostProcessController->m_PostProcessParameters : m_CurrentPostProcessParameters;
|
|
||||||
|
|
||||||
float flFadeTime = pNewPostProcessController ? pNewPostProcessController->m_PostProcessParameters.m_flParameters[PPPN_FADE_TIME] : 0.0f;
|
|
||||||
if (flFadeTime <= 0.0f)
|
|
||||||
{
|
|
||||||
flFadeTime = 0.001f;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_PostProcessLerpTimer.Start( flFadeTime );
|
|
||||||
}
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// HACKHACK: Needs to be checked here because OnRestore() doesn't seem to run before a lerp begins
|
|
||||||
else if (g_bPostProcessNeedsRestore)
|
|
||||||
{
|
|
||||||
// The player just loaded a saved game.
|
|
||||||
// Don't fade parameters from 0; instead, take what's already there and assume they were already active.
|
|
||||||
// (we have no way of knowing if they were in the middle of a lerp)
|
|
||||||
m_PostProcessLerpTimer.Invalidate();
|
|
||||||
g_bPostProcessNeedsRestore = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Lerp between old and new parameters
|
|
||||||
float flLerpFactor = 1.0f - m_PostProcessLerpTimer.GetRemainingRatio();
|
|
||||||
for (int nParameter = 0; nParameter < POST_PROCESS_PARAMETER_COUNT; ++nParameter)
|
|
||||||
{
|
|
||||||
m_CurrentPostProcessParameters.m_flParameters[nParameter] =
|
|
||||||
Lerp(
|
|
||||||
flLerpFactor,
|
|
||||||
m_LerpStartPostProcessParameters.m_flParameters[nParameter],
|
|
||||||
m_LerpEndPostProcessParameters.m_flParameters[nParameter] );
|
|
||||||
}
|
|
||||||
|
|
||||||
SetPostProcessParams( &m_CurrentPostProcessParameters );
|
|
||||||
}
|
|
||||||
|
|
||||||
class CHudChat;
|
class CHudChat;
|
||||||
|
|
||||||
bool PlayerNameNotSetYet( const char *pszName )
|
bool PlayerNameNotSetYet( const char *pszName )
|
||||||
@ -1299,7 +1164,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( team == 0 && GetLocalTeam() )
|
if ( team == 0 && GetLocalTeam() > 0 )
|
||||||
{
|
{
|
||||||
bValidTeam = false;
|
bValidTeam = false;
|
||||||
}
|
}
|
||||||
|
@ -91,11 +91,6 @@ public:
|
|||||||
virtual void ProcessInput(bool bActive);
|
virtual void ProcessInput(bool bActive);
|
||||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd );
|
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd );
|
||||||
virtual void Update();
|
virtual void Update();
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
virtual void OnColorCorrectionWeightsReset( void );
|
|
||||||
virtual float GetColorCorrectionScale( void ) const;
|
|
||||||
virtual void ClearCurrentColorCorrection() { m_pCurrentColorCorrection = NULL; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
virtual int KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
|
virtual int KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
|
||||||
@ -169,17 +164,6 @@ private:
|
|||||||
vgui::HCursor m_CursorNone;
|
vgui::HCursor m_CursorNone;
|
||||||
CBaseHudWeaponSelection *m_pWeaponSelection;
|
CBaseHudWeaponSelection *m_pWeaponSelection;
|
||||||
int m_nRootSize[2];
|
int m_nRootSize[2];
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
void UpdatePostProcessingEffects();
|
|
||||||
|
|
||||||
const C_PostProcessController* m_pCurrentPostProcessController;
|
|
||||||
PostProcessParameters_t m_CurrentPostProcessParameters;
|
|
||||||
PostProcessParameters_t m_LerpStartPostProcessParameters, m_LerpEndPostProcessParameters;
|
|
||||||
CountdownTimer m_PostProcessLerpTimer;
|
|
||||||
|
|
||||||
CHandle<C_ColorCorrection> m_pCurrentColorCorrection;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CLIENTMODE_NORMAL_H
|
#endif // CLIENTMODE_NORMAL_H
|
||||||
|
@ -125,11 +125,6 @@ ConVar r_threaded_client_shadow_manager( "r_threaded_client_shadow_manager", "1"
|
|||||||
ConVar r_threaded_client_shadow_manager( "r_threaded_client_shadow_manager", "0" );
|
ConVar r_threaded_client_shadow_manager( "r_threaded_client_shadow_manager", "0" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVarRef mat_slopescaledepthbias_shadowmap( "mat_slopescaledepthbias_shadowmap" );
|
|
||||||
ConVarRef mat_depthbias_shadowmap( "mat_depthbias_shadowmap" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#pragma warning( disable: 4701 )
|
#pragma warning( disable: 4701 )
|
||||||
#endif
|
#endif
|
||||||
@ -1429,15 +1424,6 @@ bool CClientShadowMgr::Init()
|
|||||||
|
|
||||||
materials->AddRestoreFunc( ShadowRestoreFunc );
|
materials->AddRestoreFunc( ShadowRestoreFunc );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// These need to be referenced here since the cvars don't exist in the initial declaration
|
|
||||||
mat_slopescaledepthbias_shadowmap = ConVarRef( "mat_slopescaledepthbias_shadowmap" );
|
|
||||||
mat_depthbias_shadowmap = ConVarRef( "mat_depthbias_shadowmap" );
|
|
||||||
|
|
||||||
mat_slopescaledepthbias_shadowmap.SetValue( "16" ); // Would do something like 2 here, but it causes citizens to look weird under flashlights
|
|
||||||
mat_depthbias_shadowmap.SetValue( "0.00005" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1508,8 +1494,7 @@ void CClientShadowMgr::InitDepthTextureShadows()
|
|||||||
#else
|
#else
|
||||||
#if defined(MAPBASE) //&& !defined(ASW_PROJECTED_TEXTURES)
|
#if defined(MAPBASE) //&& !defined(ASW_PROJECTED_TEXTURES)
|
||||||
// SAUL: we want to create a *DEPTH TEXTURE* of specific size, so use RT_SIZE_NO_CHANGE and MATERIAL_RT_DEPTH_ONLY
|
// SAUL: we want to create a *DEPTH TEXTURE* of specific size, so use RT_SIZE_NO_CHANGE and MATERIAL_RT_DEPTH_ONLY
|
||||||
// However, MATERIAL_RT_DEPTH_ONLY forces point filtering to be enabled which negatively affect PCF, so the standard MATERIAL_RT_DEPTH_NONE works better.
|
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_ONLY, false, strRTName );
|
||||||
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName );
|
|
||||||
#else
|
#else
|
||||||
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_OFFSCREEN, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName );
|
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_OFFSCREEN, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName );
|
||||||
#endif
|
#endif
|
||||||
@ -3250,8 +3235,7 @@ void CClientShadowMgr::PreRender()
|
|||||||
{
|
{
|
||||||
#ifdef ASW_PROJECTED_TEXTURES
|
#ifdef ASW_PROJECTED_TEXTURES
|
||||||
// only update shadows once per frame
|
// only update shadows once per frame
|
||||||
if( gpGlobals->framecount == m_nPrevFrameCount )
|
Assert( gpGlobals->framecount != m_nPrevFrameCount );
|
||||||
return;
|
|
||||||
m_nPrevFrameCount = gpGlobals->framecount;
|
m_nPrevFrameCount = gpGlobals->framecount;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -4484,18 +4468,13 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
|
|||||||
}
|
}
|
||||||
|
|
||||||
CViewSetup shadowView;
|
CViewSetup shadowView;
|
||||||
#ifndef MAPBASE
|
|
||||||
shadowView.m_flAspectRatio = 1.0f;
|
shadowView.m_flAspectRatio = 1.0f;
|
||||||
#endif
|
|
||||||
shadowView.x = shadowView.y = 0;
|
shadowView.x = shadowView.y = 0;
|
||||||
shadowView.width = shadowDepthTexture->GetActualWidth();
|
shadowView.width = shadowDepthTexture->GetActualWidth();
|
||||||
shadowView.height = shadowDepthTexture->GetActualHeight();
|
shadowView.height = shadowDepthTexture->GetActualHeight();
|
||||||
#ifndef ASW_PROJECTED_TEXTURES
|
#ifndef ASW_PROJECTED_TEXTURES
|
||||||
shadowView.m_bOrtho = false;
|
shadowView.m_bOrtho = false;
|
||||||
shadowView.m_bDoBloomAndToneMapping = false;
|
shadowView.m_bDoBloomAndToneMapping = false;
|
||||||
#ifdef MAPBASE
|
|
||||||
shadowView.m_flAspectRatio = (flashlightState.m_fHorizontalFOVDegrees / flashlightState.m_fVerticalFOVDegrees);
|
|
||||||
#endif // MAPBASE
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Copy flashlight parameters
|
// Copy flashlight parameters
|
||||||
@ -4503,10 +4482,6 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
|
|||||||
if ( !flashlightState.m_bOrtho )
|
if ( !flashlightState.m_bOrtho )
|
||||||
{
|
{
|
||||||
shadowView.m_bOrtho = false;
|
shadowView.m_bOrtho = false;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
shadowView.m_flAspectRatio = (flashlightState.m_fHorizontalFOVDegrees / flashlightState.m_fVerticalFOVDegrees);
|
|
||||||
#endif // MAPBASE
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4515,10 +4490,6 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
|
|||||||
shadowView.m_OrthoTop = flashlightState.m_fOrthoTop;
|
shadowView.m_OrthoTop = flashlightState.m_fOrthoTop;
|
||||||
shadowView.m_OrthoRight = flashlightState.m_fOrthoRight;
|
shadowView.m_OrthoRight = flashlightState.m_fOrthoRight;
|
||||||
shadowView.m_OrthoBottom = flashlightState.m_fOrthoBottom;
|
shadowView.m_OrthoBottom = flashlightState.m_fOrthoBottom;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
shadowView.m_flAspectRatio = 1.0f;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shadowView.m_bDoBloomAndToneMapping = false;
|
shadowView.m_bDoBloomAndToneMapping = false;
|
||||||
|
@ -8,12 +8,6 @@
|
|||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "tier0/vprof.h"
|
#include "tier0/vprof.h"
|
||||||
#include "colorcorrectionmgr.h"
|
#include "colorcorrectionmgr.h"
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
#include "clientmode_shared.h" //"clientmode.h"
|
|
||||||
|
|
||||||
// NOTE: This has to be the last file included!
|
|
||||||
#include "tier0/memdbgon.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -22,13 +16,6 @@
|
|||||||
static CColorCorrectionMgr s_ColorCorrectionMgr;
|
static CColorCorrectionMgr s_ColorCorrectionMgr;
|
||||||
CColorCorrectionMgr *g_pColorCorrectionMgr = &s_ColorCorrectionMgr;
|
CColorCorrectionMgr *g_pColorCorrectionMgr = &s_ColorCorrectionMgr;
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
static ConVar mat_colcorrection_editor( "mat_colcorrection_editor", "0" );
|
|
||||||
|
|
||||||
static CUtlVector<C_ColorCorrection *> g_ColorCorrectionList;
|
|
||||||
static CUtlVector<C_ColorCorrectionVolume *> g_ColorCorrectionVolumeList;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Constructor
|
// Constructor
|
||||||
@ -75,89 +62,10 @@ void CColorCorrectionMgr::RemoveColorCorrection( ClientCCHandle_t h )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
ClientCCHandle_t CColorCorrectionMgr::AddColorCorrectionEntity( C_ColorCorrection *pEntity, const char *pName, const char *pFileName )
|
|
||||||
{
|
|
||||||
ClientCCHandle_t h = AddColorCorrection(pName, pFileName);
|
|
||||||
if ( h != INVALID_CLIENT_CCHANDLE )
|
|
||||||
{
|
|
||||||
Assert(g_ColorCorrectionList.Find(pEntity) == -1);
|
|
||||||
g_ColorCorrectionList.AddToTail(pEntity);
|
|
||||||
}
|
|
||||||
return h;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CColorCorrectionMgr::RemoveColorCorrectionEntity( C_ColorCorrection *pEntity, ClientCCHandle_t h)
|
|
||||||
{
|
|
||||||
RemoveColorCorrection(h);
|
|
||||||
g_ColorCorrectionList.FindAndFastRemove(pEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientCCHandle_t CColorCorrectionMgr::AddColorCorrectionVolume( C_ColorCorrectionVolume *pVolume, const char *pName, const char *pFileName )
|
|
||||||
{
|
|
||||||
ClientCCHandle_t h = AddColorCorrection(pName, pFileName);
|
|
||||||
if ( h != INVALID_CLIENT_CCHANDLE )
|
|
||||||
{
|
|
||||||
Assert(g_ColorCorrectionVolumeList.Find(pVolume) == -1);
|
|
||||||
g_ColorCorrectionVolumeList.AddToTail(pVolume);
|
|
||||||
}
|
|
||||||
return h;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CColorCorrectionMgr::RemoveColorCorrectionVolume( C_ColorCorrectionVolume *pVolume, ClientCCHandle_t h)
|
|
||||||
{
|
|
||||||
RemoveColorCorrection(h);
|
|
||||||
g_ColorCorrectionVolumeList.FindAndFastRemove(pVolume);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Modify color correction weights
|
// Modify color correction weights
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
void CColorCorrectionMgr::SetColorCorrectionWeight( ClientCCHandle_t h, float flWeight, bool bExclusive )
|
|
||||||
{
|
|
||||||
if ( h != INVALID_CLIENT_CCHANDLE )
|
|
||||||
{
|
|
||||||
SetWeightParams_t params = { h, flWeight, bExclusive };
|
|
||||||
m_colorCorrectionWeights.AddToTail( params );
|
|
||||||
if( bExclusive && m_bHaveExclusiveWeight && ( flWeight != 0.0f ) )
|
|
||||||
{
|
|
||||||
DevWarning( "Found multiple active color_correction entities with exclusive setting enabled. This is invalid.\n" );
|
|
||||||
}
|
|
||||||
if ( bExclusive )
|
|
||||||
{
|
|
||||||
m_bHaveExclusiveWeight = true;
|
|
||||||
m_flExclusiveWeight = flWeight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CColorCorrectionMgr::CommitColorCorrectionWeights()
|
|
||||||
{
|
|
||||||
CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
|
|
||||||
|
|
||||||
for ( int i = 0; i < m_colorCorrectionWeights.Count(); i++ )
|
|
||||||
{
|
|
||||||
ColorCorrectionHandle_t ccHandle = reinterpret_cast<ColorCorrectionHandle_t>( m_colorCorrectionWeights[i].handle );
|
|
||||||
float flWeight = m_colorCorrectionWeights[i].flWeight;
|
|
||||||
if ( !m_colorCorrectionWeights[i].bExclusive )
|
|
||||||
{
|
|
||||||
flWeight = (1.0f - m_flExclusiveWeight ) * m_colorCorrectionWeights[i].flWeight;
|
|
||||||
}
|
|
||||||
pRenderContext->SetLookupWeight( ccHandle, flWeight );
|
|
||||||
|
|
||||||
// FIXME: NOTE! This doesn't work if the same handle has
|
|
||||||
// its weight set twice with no intervening calls to ResetColorCorrectionWeights
|
|
||||||
// which, at the moment, is true
|
|
||||||
if ( flWeight != 0.0f )
|
|
||||||
{
|
|
||||||
++m_nActiveWeightCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_colorCorrectionWeights.RemoveAll();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void CColorCorrectionMgr::SetColorCorrectionWeight( ClientCCHandle_t h, float flWeight )
|
void CColorCorrectionMgr::SetColorCorrectionWeight( ClientCCHandle_t h, float flWeight )
|
||||||
{
|
{
|
||||||
if ( h != INVALID_CLIENT_CCHANDLE )
|
if ( h != INVALID_CLIENT_CCHANDLE )
|
||||||
@ -175,7 +83,6 @@ void CColorCorrectionMgr::SetColorCorrectionWeight( ClientCCHandle_t h, float fl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void CColorCorrectionMgr::ResetColorCorrectionWeights()
|
void CColorCorrectionMgr::ResetColorCorrectionWeights()
|
||||||
{
|
{
|
||||||
@ -186,11 +93,6 @@ void CColorCorrectionMgr::ResetColorCorrectionWeights()
|
|||||||
CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
|
CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
|
||||||
pRenderContext->ResetLookupWeights();
|
pRenderContext->ResetLookupWeights();
|
||||||
m_nActiveWeightCount = 0;
|
m_nActiveWeightCount = 0;
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
m_bHaveExclusiveWeight = false;
|
|
||||||
m_flExclusiveWeight = 0.0f;
|
|
||||||
m_colorCorrectionWeights.RemoveAll();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CColorCorrectionMgr::SetResetable( ClientCCHandle_t h, bool bResetable )
|
void CColorCorrectionMgr::SetResetable( ClientCCHandle_t h, bool bResetable )
|
||||||
@ -211,34 +113,7 @@ void CColorCorrectionMgr::SetResetable( ClientCCHandle_t h, bool bResetable )
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Is color correction active?
|
// Is color correction active?
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
bool CColorCorrectionMgr::HasNonZeroColorCorrectionWeights() const
|
|
||||||
{
|
|
||||||
return ( m_nActiveWeightCount != 0 ) || mat_colcorrection_editor.GetBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CColorCorrectionMgr::UpdateColorCorrection()
|
|
||||||
{
|
|
||||||
ResetColorCorrectionWeights();
|
|
||||||
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
|
|
||||||
IClientMode *pClientMode = GetClientModeNormal(); //GetClientMode();
|
|
||||||
|
|
||||||
Assert( pClientMode );
|
|
||||||
if ( !pPlayer || !pClientMode )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pClientMode->OnColorCorrectionWeightsReset();
|
|
||||||
float ccScale = pClientMode->GetColorCorrectionScale();
|
|
||||||
|
|
||||||
UpdateColorCorrectionEntities( pPlayer, ccScale, g_ColorCorrectionList.Base(), g_ColorCorrectionList.Count() );
|
|
||||||
UpdateColorCorrectionVolumes( pPlayer, ccScale, g_ColorCorrectionVolumeList.Base(), g_ColorCorrectionVolumeList.Count() );
|
|
||||||
CommitColorCorrectionWeights();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
bool CColorCorrectionMgr::HasNonZeroColorCorrectionWeights() const
|
bool CColorCorrectionMgr::HasNonZeroColorCorrectionWeights() const
|
||||||
{
|
{
|
||||||
return ( m_nActiveWeightCount != 0 );
|
return ( m_nActiveWeightCount != 0 );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -14,10 +14,6 @@
|
|||||||
|
|
||||||
#include "igamesystem.h"
|
#include "igamesystem.h"
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
class C_ColorCorrection;
|
|
||||||
class C_ColorCorrectionVolume;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Purpose : Singleton manager for color correction on the client
|
// Purpose : Singleton manager for color correction on the client
|
||||||
@ -39,21 +35,8 @@ public:
|
|||||||
ClientCCHandle_t AddColorCorrection( const char *pName, const char *pFileName = NULL );
|
ClientCCHandle_t AddColorCorrection( const char *pName, const char *pFileName = NULL );
|
||||||
void RemoveColorCorrection( ClientCCHandle_t );
|
void RemoveColorCorrection( ClientCCHandle_t );
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
ClientCCHandle_t AddColorCorrectionEntity( C_ColorCorrection *pEntity, const char *pName, const char *pFileName = NULL );
|
|
||||||
void RemoveColorCorrectionEntity( C_ColorCorrection *pEntity, ClientCCHandle_t );
|
|
||||||
|
|
||||||
ClientCCHandle_t AddColorCorrectionVolume( C_ColorCorrectionVolume *pVolume, const char *pName, const char *pFileName = NULL );
|
|
||||||
void RemoveColorCorrectionVolume( C_ColorCorrectionVolume *pVolume, ClientCCHandle_t );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Modify color correction weights
|
// Modify color correction weights
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
void SetColorCorrectionWeight( ClientCCHandle_t h, float flWeight, bool bExclusive = false );
|
|
||||||
void UpdateColorCorrection();
|
|
||||||
#else
|
|
||||||
void SetColorCorrectionWeight( ClientCCHandle_t h, float flWeight );
|
void SetColorCorrectionWeight( ClientCCHandle_t h, float flWeight );
|
||||||
#endif
|
|
||||||
void ResetColorCorrectionWeights();
|
void ResetColorCorrectionWeights();
|
||||||
void SetResetable( ClientCCHandle_t h, bool bResetable );
|
void SetResetable( ClientCCHandle_t h, bool bResetable );
|
||||||
|
|
||||||
@ -62,27 +45,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int m_nActiveWeightCount;
|
int m_nActiveWeightCount;
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
bool m_bHaveExclusiveWeight;
|
|
||||||
float m_flExclusiveWeight;
|
|
||||||
|
|
||||||
struct SetWeightParams_t
|
|
||||||
{
|
|
||||||
ClientCCHandle_t handle;
|
|
||||||
float flWeight;
|
|
||||||
bool bExclusive;
|
|
||||||
};
|
|
||||||
|
|
||||||
CUtlVector< SetWeightParams_t > m_colorCorrectionWeights;
|
|
||||||
|
|
||||||
void CommitColorCorrectionWeights();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef MAPBASE // From Alien Swarm SDK
|
|
||||||
void UpdateColorCorrectionEntities( C_BasePlayer *pPlayer, float ccScale, C_ColorCorrection **pList, int listCount );
|
|
||||||
void UpdateColorCorrectionVolumes( C_BasePlayer *pPlayer, float ccScale, C_ColorCorrectionVolume **pList, int listCount );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Singleton access
|
// Singleton access
|
||||||
|
@ -1,113 +0,0 @@
|
|||||||
//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============//
|
|
||||||
//
|
|
||||||
// Material proxy to stuff a convar into a material var.
|
|
||||||
//
|
|
||||||
// $NoKeywords: $
|
|
||||||
//=============================================================================//
|
|
||||||
|
|
||||||
#include "cbase.h"
|
|
||||||
// identifier was truncated to '255' characters in the debug information
|
|
||||||
//#pragma warning(disable: 4786)
|
|
||||||
|
|
||||||
#include "convar.h"
|
|
||||||
#include "materialsystem/imaterialproxy.h"
|
|
||||||
#include "materialsystem/imaterialvar.h"
|
|
||||||
//#include "imaterialproxydict.h"
|
|
||||||
|
|
||||||
// NOTE: This has to be the last file included!
|
|
||||||
#include "tier0/memdbgon.h"
|
|
||||||
|
|
||||||
|
|
||||||
class CConVarMaterialProxy: public IMaterialProxy
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CConVarMaterialProxy()
|
|
||||||
: m_pResult( NULL ),
|
|
||||||
m_conVarRef( "", true )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~CConVarMaterialProxy()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool Init( IMaterial *pMaterial, KeyValues *pKeyValues )
|
|
||||||
{
|
|
||||||
const char *pResult = pKeyValues->GetString( "resultVar" );
|
|
||||||
if ( !pResult )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
bool found;
|
|
||||||
m_pResult = pMaterial->FindVar( pResult, &found );
|
|
||||||
if ( !found )
|
|
||||||
{
|
|
||||||
m_pResult = NULL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if ( !Q_stricmp( pResult, "$alpha" ) )
|
|
||||||
{
|
|
||||||
pMaterial->SetMaterialVarFlag( MATERIAL_VAR_ALPHA_MODIFIED_BY_PROXY, true );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
pResult = pKeyValues->GetString( "convar" );
|
|
||||||
if( !pResult )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_conVarRef.Init( pResult, false );
|
|
||||||
if ( !m_conVarRef.IsValid() )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void OnBind( void* )
|
|
||||||
{
|
|
||||||
switch( m_pResult->GetType() )
|
|
||||||
{
|
|
||||||
case MATERIAL_VAR_TYPE_VECTOR:
|
|
||||||
{
|
|
||||||
float f = m_conVarRef.GetFloat();
|
|
||||||
Vector4D vec( f, f, f, f );
|
|
||||||
m_pResult->SetVecValue( vec.Base(), m_pResult->VectorSize() );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
case MATERIAL_VAR_TYPE_STRING:
|
|
||||||
m_pResult->SetStringValue( m_conVarRef.GetString() );
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case MATERIAL_VAR_TYPE_INT:
|
|
||||||
m_pResult->SetIntValue( m_conVarRef.GetInt() );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MATERIAL_VAR_TYPE_FLOAT:
|
|
||||||
default:
|
|
||||||
m_pResult->SetFloatValue( m_conVarRef.GetFloat() );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual IMaterial *GetMaterial()
|
|
||||||
{
|
|
||||||
return m_pResult->GetOwningMaterial();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void Release()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
IMaterialVar *m_pResult;
|
|
||||||
ConVarRef m_conVarRef;
|
|
||||||
};
|
|
||||||
|
|
||||||
EXPOSE_INTERFACE( CConVarMaterialProxy, IMaterialProxy, "ConVar" IMATERIAL_PROXY_INTERFACE_VERSION );
|
|
@ -1624,14 +1624,12 @@ void CDetailObjectSystem::UnserializeModelDict( CUtlBuffer& buf )
|
|||||||
DetailModelDict_t dict;
|
DetailModelDict_t dict;
|
||||||
dict.m_pModel = (model_t *)engine->LoadModel( lump.m_Name, true );
|
dict.m_pModel = (model_t *)engine->LoadModel( lump.m_Name, true );
|
||||||
|
|
||||||
#ifndef MAPBASE
|
|
||||||
// Don't allow vertex-lit models
|
// Don't allow vertex-lit models
|
||||||
if (modelinfo->IsModelVertexLit(dict.m_pModel))
|
if (modelinfo->IsModelVertexLit(dict.m_pModel))
|
||||||
{
|
{
|
||||||
Warning("Detail prop model %s is using vertex-lit materials!\nIt must use unlit materials!\n", lump.m_Name );
|
Warning("Detail prop model %s is using vertex-lit materials!\nIt must use unlit materials!\n", lump.m_Name );
|
||||||
dict.m_pModel = (model_t *)engine->LoadModel( "models/error.mdl" );
|
dict.m_pModel = (model_t *)engine->LoadModel( "models/error.mdl" );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
m_DetailObjectDict.AddToTail( dict );
|
m_DetailObjectDict.AddToTail( dict );
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,6 @@
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#ifdef MAPBASE
|
|
||||||
#include "proxyentity.h"
|
|
||||||
#include "materialsystem/imaterialvar.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class C_PropScalable : public C_BaseAnimating
|
class C_PropScalable : public C_BaseAnimating
|
||||||
{
|
{
|
||||||
@ -198,56 +194,3 @@ void C_PropScalable::GetRenderBounds( Vector &theMins, Vector &theMaxs )
|
|||||||
Assert( theMins.IsValid() && theMaxs.IsValid() );
|
Assert( theMins.IsValid() && theMaxs.IsValid() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVar r_coreball_update_sphere_center( "r_coreball_update_sphere_center", "1", FCVAR_NONE, "Allows prop_coreball to update its center to the entity's origin" );
|
|
||||||
|
|
||||||
class CCoreBallUpdateMaterialProxy : public CEntityMaterialProxy
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CCoreBallUpdateMaterialProxy()
|
|
||||||
{
|
|
||||||
m_pMaterial = NULL;
|
|
||||||
m_pSphereCenter = NULL;
|
|
||||||
}
|
|
||||||
virtual ~CCoreBallUpdateMaterialProxy()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
virtual bool Init( IMaterial *pMaterial, KeyValues *pKeyValues )
|
|
||||||
{
|
|
||||||
m_pMaterial = pMaterial;
|
|
||||||
bool found;
|
|
||||||
m_pSphereCenter = m_pMaterial->FindVar( "$spherecenter", &found );
|
|
||||||
if( !found )
|
|
||||||
{
|
|
||||||
m_pSphereCenter = NULL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
virtual void OnBind( C_BaseEntity *pC_BaseEntity )
|
|
||||||
{
|
|
||||||
if (r_coreball_update_sphere_center.GetBool())
|
|
||||||
{
|
|
||||||
const Vector &origin = pC_BaseEntity->GetAbsOrigin();
|
|
||||||
m_pSphereCenter->SetVecValue( origin.x, origin.y, origin.z );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Just continuously bind the old hacked value (TODO: Optimize so it's not just assigning the same value constantly?)
|
|
||||||
m_pSphereCenter->SetVecValue( 2688.0, 12139.0, 5170.0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual IMaterial *GetMaterial()
|
|
||||||
{
|
|
||||||
return m_pMaterial;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
IMaterial *m_pMaterial;
|
|
||||||
IMaterialVar *m_pSphereCenter;
|
|
||||||
};
|
|
||||||
|
|
||||||
EXPOSE_INTERFACE( CCoreBallUpdateMaterialProxy, IMaterialProxy, "CoreBallUpdate" IMATERIAL_PROXY_INTERFACE_VERSION );
|
|
||||||
#endif
|
|
||||||
|
@ -462,225 +462,3 @@ void CEP2StunEffect::Render( int x, int y, int w, int h )
|
|||||||
pRenderContext->MatrixMode( MATERIAL_PROJECTION );
|
pRenderContext->MatrixMode( MATERIAL_PROJECTION );
|
||||||
pRenderContext->PopMatrix();
|
pRenderContext->PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================================================================================================================
|
|
||||||
//
|
|
||||||
// Chromatic Aberration
|
|
||||||
//
|
|
||||||
// ================================================================================================================
|
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVar r_chromatic_aberration_offset( "r_chromatic_aberration_offset", "8.0" );
|
|
||||||
ConVar r_chromatic_aberration_intensity( "r_chromatic_aberration_intensity", "0.2" );
|
|
||||||
ConVar r_chromatic_aberration_noise( "r_chromatic_aberration_noise", "4.0" );
|
|
||||||
|
|
||||||
ConVar r_chromatic_aberration_frame1_clr( "r_chromatic_aberration_frame1_clr", "1.0 0.0 0.0 1.0" );
|
|
||||||
ConVar r_chromatic_aberration_frame1_offset_x( "r_chromatic_aberration_frame1_offset_x", "1.0" );
|
|
||||||
ConVar r_chromatic_aberration_frame1_offset_y( "r_chromatic_aberration_frame1_offset_y", "4.0" );
|
|
||||||
|
|
||||||
ConVar r_chromatic_aberration_frame2_clr( "r_chromatic_aberration_frame2_clr", "0.0 1.0 0.0 1.0" );
|
|
||||||
ConVar r_chromatic_aberration_frame2_offset_x( "r_chromatic_aberration_frame2_offset_x", "-5.0" );
|
|
||||||
ConVar r_chromatic_aberration_frame2_offset_y( "r_chromatic_aberration_frame2_offset_y", "-1.0" );
|
|
||||||
|
|
||||||
ConVar r_chromatic_aberration_frame3_clr( "r_chromatic_aberration_frame3_clr", "0.0 0.0 1.0 1.0" );
|
|
||||||
ConVar r_chromatic_aberration_frame3_offset_x( "r_chromatic_aberration_frame3_offset_x", "3.0" );
|
|
||||||
ConVar r_chromatic_aberration_frame3_offset_y( "r_chromatic_aberration_frame3_offset_y", "-3.0" );
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void CChromaticAberrationEffect::Init( void )
|
|
||||||
{
|
|
||||||
m_flDuration = 0.0f;
|
|
||||||
m_flFinishTime = 0.0f;
|
|
||||||
m_bUpdateView = true;
|
|
||||||
|
|
||||||
KeyValues *pVMTKeyValues = new KeyValues( "UnlitGeneric" );
|
|
||||||
pVMTKeyValues->SetString( "$basetexture", STUN_TEXTURE );
|
|
||||||
m_EffectMaterial.Init( "__stuneffect", TEXTURE_GROUP_CLIENT_EFFECTS, pVMTKeyValues );
|
|
||||||
m_StunTexture.Init( STUN_TEXTURE, TEXTURE_GROUP_CLIENT_EFFECTS );
|
|
||||||
}
|
|
||||||
|
|
||||||
void CChromaticAberrationEffect::Shutdown( void )
|
|
||||||
{
|
|
||||||
m_EffectMaterial.Shutdown();
|
|
||||||
m_StunTexture.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// Purpose: Pick up changes in our parameters
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
void CChromaticAberrationEffect::SetParameters( KeyValues *params )
|
|
||||||
{
|
|
||||||
if( params->FindKey( "duration" ) )
|
|
||||||
{
|
|
||||||
m_flDuration = params->GetFloat( "duration" );
|
|
||||||
m_flFinishTime = gpGlobals->curtime + m_flDuration;
|
|
||||||
m_bUpdateView = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( params->FindKey( "fadeout" ) )
|
|
||||||
{
|
|
||||||
m_bFadeOut = ( params->GetInt( "fadeout" ) == 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( params->FindKey( "stretch" ) )
|
|
||||||
{
|
|
||||||
m_bStretch = ( params->GetInt( "stretch" ) == 1 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose: Render the effect
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void CChromaticAberrationEffect::RenderColorFrame( CMatRenderContextPtr &pRenderContext, float flEffectPerc, int nColorMode, int x, int y, int w, int h )
|
|
||||||
{
|
|
||||||
// Change color
|
|
||||||
float flColor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
|
||||||
|
|
||||||
float viewOffsX = flEffectPerc;
|
|
||||||
if (m_bStretch)
|
|
||||||
viewOffsX *= r_chromatic_aberration_offset.GetFloat() * 2;
|
|
||||||
else
|
|
||||||
viewOffsX *= r_chromatic_aberration_offset.GetFloat();
|
|
||||||
|
|
||||||
float viewOffsY = viewOffsX;
|
|
||||||
|
|
||||||
{
|
|
||||||
char szColor[16] = { 0 };
|
|
||||||
float flNoise = sin( gpGlobals->curtime * r_chromatic_aberration_noise.GetFloat() ) * flEffectPerc;
|
|
||||||
|
|
||||||
switch (nColorMode)
|
|
||||||
{
|
|
||||||
// Red
|
|
||||||
case 0:
|
|
||||||
Q_strncpy( szColor, r_chromatic_aberration_frame1_clr.GetString(), sizeof( szColor ) );
|
|
||||||
|
|
||||||
viewOffsX *= r_chromatic_aberration_frame1_offset_x.GetFloat();
|
|
||||||
viewOffsY *= r_chromatic_aberration_frame1_offset_y.GetFloat();
|
|
||||||
|
|
||||||
viewOffsX += flNoise;
|
|
||||||
viewOffsY += flNoise;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Green
|
|
||||||
case 1:
|
|
||||||
Q_strncpy( szColor, r_chromatic_aberration_frame2_clr.GetString(), sizeof( szColor ) );
|
|
||||||
|
|
||||||
viewOffsX *= r_chromatic_aberration_frame2_offset_x.GetFloat();
|
|
||||||
viewOffsY *= r_chromatic_aberration_frame2_offset_y.GetFloat();
|
|
||||||
|
|
||||||
viewOffsX += flNoise;
|
|
||||||
viewOffsY += flNoise;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Blue
|
|
||||||
case 2:
|
|
||||||
Q_strncpy( szColor, r_chromatic_aberration_frame3_clr.GetString(), sizeof( szColor ) );
|
|
||||||
|
|
||||||
viewOffsX *= r_chromatic_aberration_frame3_offset_x.GetFloat();
|
|
||||||
viewOffsY *= r_chromatic_aberration_frame3_offset_y.GetFloat();
|
|
||||||
|
|
||||||
viewOffsX += flNoise;
|
|
||||||
viewOffsY += flNoise;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *c = strtok( szColor, " " );
|
|
||||||
for (int i = 0; i < 4 && c != NULL; i++, c = strtok( NULL, " " ))
|
|
||||||
{
|
|
||||||
flColor[i] = atof( c );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flColor[3] == 0.0f || g_pMaterialSystemHardwareConfig->GetDXSupportLevel() < 80)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_EffectMaterial->ColorModulate( flColor[0], flColor[1], flColor[2] );
|
|
||||||
|
|
||||||
// Set alpha blend value
|
|
||||||
float flOverlayAlpha = clamp( r_chromatic_aberration_intensity.GetFloat() * flEffectPerc * flColor[3], 0.0f, 1.0f);
|
|
||||||
m_EffectMaterial->AlphaModulate( flOverlayAlpha );
|
|
||||||
|
|
||||||
// Draw full screen alpha-blended quad
|
|
||||||
if (m_bStretch)
|
|
||||||
{
|
|
||||||
float vX = x - (viewOffsX * 0.5f);
|
|
||||||
float vY = y - (viewOffsY * 0.5f);
|
|
||||||
|
|
||||||
pRenderContext->DrawScreenSpaceRectangle( m_EffectMaterial, vX, vY, w + viewOffsX, h + viewOffsY,
|
|
||||||
0, 0, (m_StunTexture->GetActualWidth()-1), (m_StunTexture->GetActualHeight()-1),
|
|
||||||
m_StunTexture->GetActualWidth(), m_StunTexture->GetActualHeight() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float vX = x + viewOffsX;
|
|
||||||
float vY = y + viewOffsY;
|
|
||||||
|
|
||||||
pRenderContext->DrawScreenSpaceRectangle( m_EffectMaterial, 0, 0, w, h,
|
|
||||||
vX, vY, (m_StunTexture->GetActualWidth()-1)+vX, (m_StunTexture->GetActualHeight()-1)+vY,
|
|
||||||
m_StunTexture->GetActualWidth(), m_StunTexture->GetActualHeight() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose: Render the effect
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void CChromaticAberrationEffect::Render( int x, int y, int w, int h )
|
|
||||||
{
|
|
||||||
// Make sure we're ready to play this effect
|
|
||||||
if ( !IsEnabled() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( m_bFadeOut && m_flFinishTime < gpGlobals->curtime )
|
|
||||||
{
|
|
||||||
g_pScreenSpaceEffects->DisableScreenSpaceEffect( "mapbase_chromatic_aberration" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CMatRenderContextPtr pRenderContext( materials );
|
|
||||||
|
|
||||||
// Set ourselves to the proper rendermode
|
|
||||||
pRenderContext->MatrixMode( MATERIAL_VIEW );
|
|
||||||
pRenderContext->PushMatrix();
|
|
||||||
pRenderContext->LoadIdentity();
|
|
||||||
pRenderContext->MatrixMode( MATERIAL_PROJECTION );
|
|
||||||
pRenderContext->PushMatrix();
|
|
||||||
pRenderContext->LoadIdentity();
|
|
||||||
|
|
||||||
// Draw the texture if we're using it
|
|
||||||
if ( m_bUpdateView )
|
|
||||||
{
|
|
||||||
// Save off this pass
|
|
||||||
Rect_t srcRect;
|
|
||||||
srcRect.x = x;
|
|
||||||
srcRect.y = y;
|
|
||||||
srcRect.width = w;
|
|
||||||
srcRect.height = h;
|
|
||||||
pRenderContext->CopyRenderTargetToTextureEx( m_StunTexture, 0, &srcRect, NULL );
|
|
||||||
m_bUpdateView = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
float flEffectPerc = SmoothCurve( clamp( ( m_flFinishTime - gpGlobals->curtime ) / m_flDuration, 0.0f, 1.0f ) );
|
|
||||||
if (!m_bFadeOut)
|
|
||||||
flEffectPerc = 1.0f - flEffectPerc;
|
|
||||||
|
|
||||||
RenderColorFrame( pRenderContext, flEffectPerc, 0, x, y, w, h );
|
|
||||||
RenderColorFrame( pRenderContext, flEffectPerc, 1, x, y, w, h );
|
|
||||||
RenderColorFrame( pRenderContext, flEffectPerc, 2, x, y, w, h );
|
|
||||||
|
|
||||||
// Save off this pass
|
|
||||||
Rect_t srcRect;
|
|
||||||
srcRect.x = x;
|
|
||||||
srcRect.y = y;
|
|
||||||
srcRect.width = w;
|
|
||||||
srcRect.height = h;
|
|
||||||
pRenderContext->CopyRenderTargetToTextureEx( m_StunTexture, 0, &srcRect, NULL );
|
|
||||||
|
|
||||||
// Restore our state
|
|
||||||
pRenderContext->MatrixMode( MATERIAL_VIEW );
|
|
||||||
pRenderContext->PopMatrix();
|
|
||||||
pRenderContext->MatrixMode( MATERIAL_PROJECTION );
|
|
||||||
pRenderContext->PopMatrix();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
@ -116,38 +116,4 @@ private:
|
|||||||
|
|
||||||
ADD_SCREENSPACE_EFFECT( CEP2StunEffect, ep2_groggy );
|
ADD_SCREENSPACE_EFFECT( CEP2StunEffect, ep2_groggy );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
class CChromaticAberrationEffect : public IScreenSpaceEffect
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CChromaticAberrationEffect( void ) :
|
|
||||||
m_flDuration( 0.0f ),
|
|
||||||
m_flFinishTime( 0.0f ),
|
|
||||||
m_bUpdateView( true ),
|
|
||||||
m_bEnabled( false ),
|
|
||||||
m_bFadeOut( false ) {}
|
|
||||||
|
|
||||||
virtual void Init( void );
|
|
||||||
virtual void Shutdown( void );
|
|
||||||
virtual void SetParameters( KeyValues *params );
|
|
||||||
virtual void Enable( bool bEnable ) { m_bEnabled = bEnable; };
|
|
||||||
virtual bool IsEnabled( ) { return m_bEnabled; }
|
|
||||||
|
|
||||||
virtual void RenderColorFrame( CMatRenderContextPtr &pRenderContext, float flEffectPerc, int nColorMode, int x, int y, int w, int h );
|
|
||||||
virtual void Render( int x, int y, int w, int h );
|
|
||||||
|
|
||||||
private:
|
|
||||||
CTextureReference m_StunTexture;
|
|
||||||
CMaterialReference m_EffectMaterial;
|
|
||||||
float m_flDuration;
|
|
||||||
float m_flFinishTime;
|
|
||||||
bool m_bUpdateView;
|
|
||||||
bool m_bStretch;
|
|
||||||
bool m_bFadeOut;
|
|
||||||
bool m_bEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
ADD_SCREENSPACE_EFFECT( CChromaticAberrationEffect, mapbase_chromatic_aberration );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // EPISODIC_SCREENSPACEEFFECTS_H
|
#endif // EPISODIC_SCREENSPACEEFFECTS_H
|
||||||
|
@ -52,8 +52,8 @@ static ConVar r_flashlightladderdist( "r_flashlightladderdist", "40.0", FCVAR_CH
|
|||||||
static ConVar mat_slopescaledepthbias_shadowmap( "mat_slopescaledepthbias_shadowmap", "16", FCVAR_CHEAT );
|
static ConVar mat_slopescaledepthbias_shadowmap( "mat_slopescaledepthbias_shadowmap", "16", FCVAR_CHEAT );
|
||||||
static ConVar mat_depthbias_shadowmap( "mat_depthbias_shadowmap", "0.0005", FCVAR_CHEAT );
|
static ConVar mat_depthbias_shadowmap( "mat_depthbias_shadowmap", "0.0005", FCVAR_CHEAT );
|
||||||
#else
|
#else
|
||||||
extern ConVarRef mat_slopescaledepthbias_shadowmap;
|
static ConVar mat_slopescaledepthbias_shadowmap( "mat_slopescaledepthbias_shadowmap", "4", FCVAR_CHEAT );
|
||||||
extern ConVarRef mat_depthbias_shadowmap;
|
static ConVar mat_depthbias_shadowmap( "mat_depthbias_shadowmap", "0.00001", FCVAR_CHEAT );
|
||||||
#endif
|
#endif
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
static ConVar r_flashlighttextureoverride( "r_flashlighttextureoverride", "", FCVAR_CHEAT );
|
static ConVar r_flashlighttextureoverride( "r_flashlighttextureoverride", "", FCVAR_CHEAT );
|
||||||
|
@ -25,13 +25,6 @@ extern ConVar r_drawmodeldecals;
|
|||||||
|
|
||||||
ImpactSoundRouteFn g_pImpactSoundRouteFn = NULL;
|
ImpactSoundRouteFn g_pImpactSoundRouteFn = NULL;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
ConVar g_ragdoll_steal_impacts_client( "g_ragdoll_steal_impacts_client", "1", FCVAR_NONE, "Allows clientside death ragdolls to \"steal\" impacts from their source entities. This fixes issues with NPCs dying before decals are applied." );
|
|
||||||
ConVar g_ragdoll_steal_impacts_server( "g_ragdoll_steal_impacts_server", "1", FCVAR_NONE, "Allows serverside death ragdolls to \"steal\" impacts from their source entities. This fixes issues with NPCs dying before decals are applied." );
|
|
||||||
|
|
||||||
ConVar g_ragdoll_client_impact_decals( "g_ragdoll_client_impact_decals", "1", FCVAR_NONE, "Applies decals to clientside ragdolls when they are hit." );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//==========================================================================================================================
|
//==========================================================================================================================
|
||||||
// RAGDOLL ENUMERATOR
|
// RAGDOLL ENUMERATOR
|
||||||
//==========================================================================================================================
|
//==========================================================================================================================
|
||||||
@ -39,11 +32,7 @@ CRagdollEnumerator::CRagdollEnumerator( Ray_t& shot, int iDamageType )
|
|||||||
{
|
{
|
||||||
m_rayShot = shot;
|
m_rayShot = shot;
|
||||||
m_iDamageType = iDamageType;
|
m_iDamageType = iDamageType;
|
||||||
#ifdef MAPBASE
|
|
||||||
m_pHitEnt = NULL;
|
|
||||||
#else
|
|
||||||
m_bHit = false;
|
m_bHit = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IterationRetval_t CRagdollEnumerator::EnumElement( IHandleEntity *pHandleEntity )
|
IterationRetval_t CRagdollEnumerator::EnumElement( IHandleEntity *pHandleEntity )
|
||||||
@ -68,11 +57,7 @@ IterationRetval_t CRagdollEnumerator::EnumElement( IHandleEntity *pHandleEntity
|
|||||||
if ( tr.fraction < 1.0 )
|
if ( tr.fraction < 1.0 )
|
||||||
{
|
{
|
||||||
pModel->ImpactTrace( &tr, m_iDamageType, NULL );
|
pModel->ImpactTrace( &tr, m_iDamageType, NULL );
|
||||||
#ifdef MAPBASE
|
|
||||||
m_pHitEnt = pModel;
|
|
||||||
#else
|
|
||||||
m_bHit = true;
|
m_bHit = true;
|
||||||
#endif
|
|
||||||
|
|
||||||
//FIXME: Yes? No?
|
//FIXME: Yes? No?
|
||||||
return ITERATION_STOP;
|
return ITERATION_STOP;
|
||||||
@ -99,22 +84,6 @@ bool FX_AffectRagdolls( Vector vecOrigin, Vector vecStart, int iDamageType )
|
|||||||
return ragdollEnum.Hit();
|
return ragdollEnum.Hit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
C_BaseAnimating *FX_AffectRagdolls_GetHit( Vector vecOrigin, Vector vecStart, int iDamageType )
|
|
||||||
{
|
|
||||||
// don't do this when lots of ragdolls are simulating
|
|
||||||
if ( s_RagdollLRU.CountRagdolls(true) > 1 )
|
|
||||||
return NULL;
|
|
||||||
Ray_t shotRay;
|
|
||||||
shotRay.Init( vecStart, vecOrigin );
|
|
||||||
|
|
||||||
CRagdollEnumerator ragdollEnum( shotRay, iDamageType );
|
|
||||||
partition->EnumerateElementsAlongRay( PARTITION_CLIENT_RESPONSIVE_EDICTS, shotRay, false, &ragdollEnum );
|
|
||||||
|
|
||||||
return ragdollEnum.GetHit();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Input : &data -
|
// Input : &data -
|
||||||
@ -135,22 +104,6 @@ bool Impact( Vector &vecOrigin, Vector &vecStart, int iMaterial, int iDamageType
|
|||||||
|
|
||||||
Assert ( pEntity );
|
Assert ( pEntity );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
// If the entity already has a ragdoll that was created on the current tick, use that ragdoll instead.
|
|
||||||
// This allows the killing damage's decals to show up on the ragdoll.
|
|
||||||
if (C_BaseAnimating *pAnimating = pEntity->GetBaseAnimating())
|
|
||||||
{
|
|
||||||
if (pAnimating->m_pClientsideRagdoll && WasRagdollCreatedOnCurrentTick( pAnimating->m_pClientsideRagdoll ) && g_ragdoll_steal_impacts_client.GetBool())
|
|
||||||
{
|
|
||||||
pEntity = pAnimating->m_pClientsideRagdoll;
|
|
||||||
}
|
|
||||||
else if (pAnimating->m_pServerRagdoll && WasRagdollCreatedOnCurrentTick( pAnimating->m_pServerRagdoll ) && g_ragdoll_steal_impacts_server.GetBool())
|
|
||||||
{
|
|
||||||
pEntity = pAnimating->m_pServerRagdoll;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Clear out the trace
|
// Clear out the trace
|
||||||
memset( &tr, 0, sizeof(trace_t));
|
memset( &tr, 0, sizeof(trace_t));
|
||||||
tr.fraction = 1.0f;
|
tr.fraction = 1.0f;
|
||||||
@ -165,49 +118,10 @@ bool Impact( Vector &vecOrigin, Vector &vecStart, int iMaterial, int iDamageType
|
|||||||
|
|
||||||
bool bHitRagdoll = false;
|
bool bHitRagdoll = false;
|
||||||
|
|
||||||
#ifdef MAPBASE
|
|
||||||
if ( !pEntity->IsClientCreated() )
|
|
||||||
{
|
|
||||||
C_BaseAnimating *pRagdoll = FX_AffectRagdolls_GetHit( vecOrigin, vecStart, iDamageType );
|
|
||||||
if (pRagdoll)
|
|
||||||
{
|
|
||||||
bHitRagdoll = true;
|
|
||||||
|
|
||||||
if (g_ragdoll_client_impact_decals.GetBool() && pRagdoll->IsRagdoll())
|
|
||||||
{
|
|
||||||
pEntity = pRagdoll;
|
|
||||||
|
|
||||||
// HACKHACK: Get the ragdoll's nearest bone for its material
|
|
||||||
int iNearestMaterial = 0;
|
|
||||||
float flNearestDistSqr = FLT_MAX;
|
|
||||||
|
|
||||||
IPhysicsObject *pList[VPHYSICS_MAX_OBJECT_LIST_COUNT];
|
|
||||||
int count = pEntity->VPhysicsGetObjectList( pList, ARRAYSIZE(pList) );
|
|
||||||
for ( int i = 0; i < count; i++ )
|
|
||||||
{
|
|
||||||
Vector vecPosition;
|
|
||||||
QAngle angAngles;
|
|
||||||
pList[i]->GetPosition( &vecPosition, &angAngles );
|
|
||||||
float flDistSqr = (vecStart - vecPosition).LengthSqr();
|
|
||||||
if (flDistSqr < flNearestDistSqr)
|
|
||||||
{
|
|
||||||
iNearestMaterial = pList[i]->GetMaterialIndex();
|
|
||||||
flNearestDistSqr = flDistSqr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the material from the surfaceprop
|
|
||||||
surfacedata_t *psurfaceData = physprops->GetSurfaceData( iNearestMaterial );
|
|
||||||
iMaterial = psurfaceData->game.material;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if ( !pEntity->IsClientCreated() )
|
if ( !pEntity->IsClientCreated() )
|
||||||
{
|
{
|
||||||
bHitRagdoll = FX_AffectRagdolls( vecOrigin, vecStart, iDamageType );
|
bHitRagdoll = FX_AffectRagdolls( vecOrigin, vecStart, iDamageType );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( (nFlags & IMPACT_NODECAL) == 0 )
|
if ( (nFlags & IMPACT_NODECAL) == 0 )
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user