Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

add support for colored blood and gibs #182

Merged
merged 5 commits into from
Feb 5, 2021
Merged

Conversation

fabiangreffrath
Copy link
Collaborator

Due to popular demand. 😉

Due to popular demand. 😉
@kraflab
Copy link
Collaborator

kraflab commented Jan 28, 2021

On the speedrunning side, we actually don't allow any kind of sprite changes like this. Obviously prboom+ isn't constrained to dsda rules, which is why there's a separate port in the first place, but I felt like I should mention it anyway for posterity.

@@ -2008,6 +2009,7 @@ dboolean PIT_ChangeSector (mobj_t* thing)
mo = P_SpawnMobj (thing->x,
thing->y,
thing->z + thing->height/2, MT_BLOOD);
mo->target = thing;
Copy link
Collaborator

@kraflab kraflab Jan 28, 2021

Choose a reason for hiding this comment

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

With the way prboom+'s pointer cleanup works, you should use P_SetTarget instead of editing the target value directly. It probably wouldn't happen under normal constraints that a bleeding monster might be removed from memory, but I bet it's possible with dehacked, which could lead to some odd behaviour.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, it is indeed possible - and actually, doing this unconditionally may cause demo desyncs - not with the regular blood setup but if you add some code pointers that may work with the target pointer, all bets will be off.
I'd actually try to store the MT_ value somewhere instead of a target reference which may cause unforeseen issues

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whoa, I wasn't even aware of P_SetTarget(), thanks!

I'd actually try to store the MT_ value somewhere instead of a target reference which may cause unforeseen issues

I'll see what I can do, but if I can't misuse an existing field in the mobj_t struct, then I'll have to introduce something new anywhere else. Stay tuned...

@fabiangreffrath
Copy link
Collaborator Author

So, what do you guys say?

If MF_COLOREDBLOOD is set and none of (MF_TRANSLATION1|MF_TRANSLATION2)
this means green blood (Baron of Hell / Hell Knight) and if
MF_TRANSLATION1 is additionally set this means blue blood (Cacodaemon).

This allows for up to 4 different blood colors once MF_TRANSLATION2 is
also taken into account. Let's see what we come up with...
@fabiangreffrath fabiangreffrath merged commit 051c4a5 into master Feb 5, 2021
@fabiangreffrath fabiangreffrath deleted the coloredblood branch February 5, 2021 14:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants