-
Notifications
You must be signed in to change notification settings - Fork 213
Create Post Processor Component and System #2760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dkapell
wants to merge
14
commits into
daid:master
Choose a base branch
from
dkapell:postProcessorComponent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e31ceea
Create Post Processor Component and System
dkapell f4d3c76
Update player.cpp
dkapell ed4c77b
remove debug message
dkapell 9e146d1
Allow setting size of blackholes and wormholes
dkapell 1df8360
Give just_teleported the same glitch overlay as just_jumped
dkapell 2229e66
Add min_effect_strength
dkapell 8f17e14
Merge branch 'master' into postProcessorComponent
dkapell 66fa587
Remove custom code
dkapell 61b4136
merge changes from upstream
dkapell 4f4b1b3
update comments from master
dkapell d8c6374
Remove git diff message
dkapell 9761ad2
remove added whitespace
dkapell 85dc9c4
Add braces to if statement to make gravity hardware parameter correct
dkapell 99a5857
Merge branch 'master' into postProcessorComponent
dkapell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #include "postprocessor.h" | ||
|
|
||
| string getPostProcessorType(PostProcessor::Type postprocessor) | ||
| { | ||
| switch(postprocessor) | ||
| { | ||
| case PostProcessor::Type::Glitch: return "glitch"; | ||
| case PostProcessor::Type::Warp: return "warp"; | ||
| default: | ||
| return "UNKNOWN"; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #pragma once | ||
|
|
||
| // Base class for Postproccessor components, never created directtly | ||
|
|
||
| class PostProcessorComponent | ||
| { | ||
| public: | ||
| enum class Type | ||
| { | ||
| Glitch, | ||
| Warp | ||
| }; | ||
| float min_effect_strength = 0.0f; //postprocessor effect strength at max_radius | ||
| float max_effect_strength = 1.0f; // postprocessor effect strength at min_radius | ||
| float min_radius = 0.0f; | ||
| float max_radius = 5000.0f; | ||
| }; | ||
|
|
||
| string getPostProcessorType(PostProcessorComponent::Type postprocessor); | ||
|
|
||
|
|
||
| class GlitchPostProcessor: public PostProcessorComponent{ | ||
| public: | ||
| //Config | ||
|
|
||
| }; | ||
|
|
||
| class WarpPostProcessor: public PostProcessorComponent{ | ||
| public: | ||
| // Config | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #include "multiplayer/postprocessor.h" | ||
| #include "multiplayer.h" | ||
|
|
||
|
|
||
| BASIC_REPLICATION_IMPL(GlitchPostProcessorReplication, GlitchPostProcessor) | ||
| BASIC_REPLICATION_FIELD(max_radius); | ||
| BASIC_REPLICATION_FIELD(min_radius); | ||
| BASIC_REPLICATION_FIELD(max_effect_strength); | ||
| BASIC_REPLICATION_FIELD(min_effect_strength); | ||
| } | ||
|
|
||
| BASIC_REPLICATION_IMPL(WarpPostProcessorReplication, WarpPostProcessor) | ||
| BASIC_REPLICATION_FIELD(max_radius); | ||
| BASIC_REPLICATION_FIELD(min_radius); | ||
| BASIC_REPLICATION_FIELD(max_effect_strength); | ||
| BASIC_REPLICATION_FIELD(min_effect_strength); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| #include "multiplayer/basic.h" | ||
| #include "components/postprocessor.h" | ||
|
|
||
| BASIC_REPLICATION_CLASS(GlitchPostProcessorReplication, GlitchPostProcessor); | ||
| BASIC_REPLICATION_CLASS(WarpPostProcessorReplication, WarpPostProcessor); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #include "systems/player.h" | ||
| #include "components/player.h" | ||
| #include "ecs/query.h" | ||
|
|
||
| void PlayerSystem::update(float delta) | ||
| { | ||
| if (delta <= 0.0f) return; | ||
| for(auto [entity, player] : sp::ecs::Query<PlayerControl>()) | ||
| { | ||
| // Decrease glitch postprocessor visual effects | ||
| if (player.glitch_alpha > 0.0f) | ||
| player.glitch_alpha -= delta * player.glitch_alpha_decay_rate; | ||
|
|
||
| // Decrease warp postprocessor visual effects | ||
| if (player.warp_alpha > 0.0f) | ||
| player.warp_alpha -= delta * player.warp_alpha_decay_rate; | ||
|
|
||
| // Decrease post-wormhole teleport | ||
| if (player.just_teleported > 0.0f) | ||
| player.just_teleported -= delta; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| #include "ecs/system.h" | ||
|
|
||
|
|
||
| class PlayerSystem : public sp::ecs::System | ||
| { | ||
| public: | ||
| void update(float delta) override; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.