Skip to content

Enabled glows showing on ALL MovableObjects #94

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

Merged
merged 16 commits into from
Feb 18, 2024
Merged

Conversation

comradeshook
Copy link
Contributor

I'm not sure why this wasn't already a thing but screen effects now show on all MO's to which they're attached, provided they're not obscured (or you set EffectAlwaysShows = 1).

GLOWTATING

@@ -339,6 +339,7 @@ void AEmitter::SetFlash(Attachable* newFlash) {
m_pFlash->SetInheritsRotAngle(false);
m_pFlash->SetDeleteWhenRemovedFromParent(true);
m_pFlash->SetCollidesWithTerrainWhileAttached(false);
m_pFlash->MovableObject::SetEffectDrawEveryFrame(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the manual disambiguation of MovableObject:: - this shouldn't be necessary.

@@ -407,6 +407,7 @@ void HDFirearm::SetFlash(Attachable* newFlash) {
m_pFlash->SetDrawnNormallyByParent(false);
m_pFlash->SetDeleteWhenRemovedFromParent(true);
m_pFlash->SetCollidesWithTerrainWhileAttached(false);
m_pFlash->MovableObject::SetEffectDrawEveryFrame(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

@@ -1058,6 +1067,9 @@ namespace RTE {
/// @return Whether this MO has requested a synced update this frame.
virtual bool HasRequestedSyncedUpdate() { return m_RequestedSyncedUpdate; }

/// Sets the screen effect to draw at the final post-processing stage.
void SetPostScreenEffectToDraw() const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this should be private

@@ -893,6 +894,10 @@ void MovableObject::Update() {
if (m_RandomizeEffectRotAngleEveryFrame) {
m_EffectRotAngle = c_PI * 2.0F * RandomNormalNum();
}

if (m_pScreenEffect && m_EffectDrawEveryFrame) {
MovableObject::SetPostScreenEffectToDraw();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, no disambiguation needed here

@Causeless
Copy link
Contributor

As comments above, and the stuff we talked about in Discord about renaming EffectDrawEveryFrame

@@ -20,6 +20,7 @@ MOSParticle::~MOSParticle() {
void MOSParticle::Clear() {
m_Atom = nullptr;
m_SpriteAnimMode = OVERLIFETIME;
m_PostEffectEnabled = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment describing why this is being done (backwards compat reasons)

@@ -24,6 +24,7 @@ void MOPixel::Clear() {
m_MaxLethalRange = 1;
m_LethalSharpness = 1;
m_Staininess = 0;
m_PostEffectEnabled = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment describing why this is being done (backwards compat reasons)

@@ -12,6 +12,7 @@
#include "LuabindObjectWrapper.h"
#include "Material.h"
#include "MovableMan.h"
#include "PostProcessMan.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this in the .cpp, not the header

@Causeless Causeless merged commit f60b870 into development Feb 18, 2024
@Causeless Causeless deleted the glowsoneverything branch February 18, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants