-
Notifications
You must be signed in to change notification settings - Fork 132
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
Heretic: Adding A11Y Features: Weapon Flash Lighting & Sprite, Palette Changes, Invul Colormap, Extra Lighting #1258
Changes from all commits
c66b6d4
e0544d3
5c8407d
c220189
b1a9c5b
c79a704
b9f0c10
40fa086
8501390
0ec334b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
#include "r_bmaps.h" | ||
#include "r_local.h" | ||
#include "v_trans.h" // [crispy] blending functions | ||
#include "a11y.h" // [crispy] A11Y | ||
|
||
typedef struct | ||
{ | ||
|
@@ -949,7 +950,7 @@ void R_DrawPSprite(pspdef_t * psp, int psyoffset, int translucent) // [crispy] y | |
void R_DrawPlayerSprites(void) | ||
{ | ||
int i, lightnum; | ||
int tmpframe, offset, translucent = 0; // [crispy] temps for drawing translucent psrites | ||
int tmpframe, offset, drawbase = 0; // [crispy] for drawing base frames | ||
pspdef_t *psp; | ||
|
||
// | ||
|
@@ -977,11 +978,12 @@ void R_DrawPlayerSprites(void) | |
{ | ||
if (psp->state) | ||
{ | ||
// [crispy] Draw offset base frame and translucent current frame | ||
if (crispy->translucency & TRANSLUCENCY_ITEM && | ||
!(viewplayer->powers[pw_invisibility] > 4*32 || viewplayer->powers[pw_invisibility] & 8)) | ||
// [crispy] draw base frame for transparent or deactivated weapon flashes | ||
if (!a11y_weapon_pspr || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, here you are using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the weaponsprites are disabled, the "translucent" variable would mark that a base-frame (idle with y-offset) was drawn instead and the real attack-frame can be discarded. In case the weaponsprites and transparency option is enabled, the variable would instead be used to draw a transparent attack-frame in addition to the base-frame. Maybe renaming it would be helpful, just need to find a good name.. 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, a comment and a renaming of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did an update, let me know if it was for better or worse. 😁 |
||
(crispy->translucency & TRANSLUCENCY_ITEM && | ||
!(viewplayer->powers[pw_invisibility] > 4*32 || viewplayer->powers[pw_invisibility] & 8))) | ||
{ | ||
translucent = 1; | ||
drawbase = 1; | ||
tmpframe = psp->state->frame; | ||
|
||
switch (psp->state->sprite) | ||
|
@@ -996,7 +998,7 @@ void R_DrawPlayerSprites(void) | |
if (tmpframe == 3) | ||
offset = spriteoffsets[SPR_GWND_F3].offset; | ||
else | ||
translucent = 0; | ||
drawbase = 0; | ||
break; | ||
case SPR_BLSR: | ||
if (tmpframe == 1) | ||
|
@@ -1008,7 +1010,7 @@ void R_DrawPlayerSprites(void) | |
if (tmpframe == 3) | ||
offset = spriteoffsets[SPR_BLSR_F3].offset; | ||
else | ||
translucent = 0; | ||
drawbase = 0; | ||
break; | ||
case SPR_HROD: | ||
if (tmpframe == 1) | ||
|
@@ -1020,7 +1022,7 @@ void R_DrawPlayerSprites(void) | |
if (tmpframe == 6) | ||
offset = spriteoffsets[SPR_HROD_F6].offset; | ||
else | ||
translucent = 0; | ||
drawbase = 0; | ||
break; | ||
case SPR_PHNX: | ||
if (tmpframe == 1) | ||
|
@@ -1032,21 +1034,23 @@ void R_DrawPlayerSprites(void) | |
if (tmpframe == 3) | ||
offset = spriteoffsets[SPR_PHNX_F3].offset; | ||
else | ||
translucent = 0; | ||
drawbase = 0; | ||
break; | ||
default: | ||
offset = 0x0; | ||
translucent = 0; | ||
drawbase = 0; | ||
break; | ||
} | ||
if (translucent && psp->state->sprite != SPR_GAUN) | ||
if (drawbase && psp->state->sprite != SPR_GAUN) | ||
{ | ||
psp->state->frame = 0; // draw base frame | ||
psp->state->frame = 0; // set base frame | ||
R_DrawPSprite(psp, offset, 0); | ||
psp->state->frame = tmpframe; // restore frame | ||
psp->state->frame = tmpframe; // restore attack frame | ||
} | ||
} | ||
R_DrawPSprite(psp, 0x0, translucent); | ||
if (!a11y_weapon_pspr && drawbase) | ||
continue; // [crispy] A11Y no weapon flash, use base instead | ||
R_DrawPSprite(psp, 0x0, drawbase); // [crispy] translucent when base was drawn | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is a bit confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first idea was to handle the disabling of the invul colormap and torch flickering directly within P_PlayerThink (p_user.c ), however I found that for the torch flickering, a M_Random call is involved. So I refrained from changing it there but instead did it right before the colormap is applied.
So assigning the colormap to 1 (stable "infrared") to either deactive the invul or to stablize the torch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could add a comment or two to make clear what happens here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I added a few comments!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good, thank you very much!