Skip to content

Commit

Permalink
Fix super shotgun hack affect other sprites
Browse files Browse the repository at this point in the history
Because supershotgun bool wasn't set to false after drawing the super
shotgun, all sprites drawn on screen would have pixels with color 71
removed while the player had the super shotgun selected.
  • Loading branch information
bradharding committed Feb 1, 2014
1 parent ccedc71 commit 05929a1
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ int maxframe;
char *spritename;

extern int screenblocks;
extern boolean supershotgun;



Expand Down Expand Up @@ -442,7 +443,8 @@ void R_DrawVisSprite(vissprite_t *vis, int x1, int x2, boolean psprite)
if (vis->mobjflags2 & MF2_FUZZYWEAPON)
colfunc = psprcolfunc;
else if (vis->mobjflags2 & MF2_TRANSLUCENT)
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ? tl50colfunc : tlcolfunc);
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ?
tl50colfunc : tlcolfunc);
else if (vis->mobjflags2 & MF2_TRANSLUCENT_REDTOGREEN_50)
colfunc = tlredtogreen50colfunc;
else if (vis->mobjflags2 & MF2_TRANSLUCENT_REDTOBLUE_50)
Expand All @@ -452,13 +454,17 @@ void R_DrawVisSprite(vissprite_t *vis, int x1, int x2, boolean psprite)
else if (vis->mobjflags2 & MF2_TRANSLUCENT_33)
colfunc = tl33colfunc;
else if (vis->mobjflags2 & MF2_TRANSLUCENT_GREENONLY)
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ? tlgreen50colfunc : tlgreencolfunc);
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ?
tlgreen50colfunc : tlgreencolfunc);
else if (vis->mobjflags2 & MF2_TRANSLUCENT_REDONLY)
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ? tlred50colfunc : tlredcolfunc);
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ?
tlred50colfunc : tlredcolfunc);
else if (vis->mobjflags2 & MF2_TRANSLUCENT_REDWHITEONLY)
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ? tlredwhite50colfunc : tlredwhitecolfunc);
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ?
tlredwhite50colfunc : tlredwhitecolfunc);
else if (vis->mobjflags2 & MF2_TRANSLUCENT_BLUEONLY)
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ? tlblue50colfunc : tlbluecolfunc);
colfunc = (viewplayer->fixedcolormap == INVERSECOLORMAP ?
tlblue50colfunc : tlbluecolfunc);
else if (vis->mobjflags2 & MF2_REDTOGREEN)
colfunc = redtogreencolfunc;
else if (vis->mobjflags2 & MF2_REDTOBLUE)
Expand All @@ -475,8 +481,6 @@ void R_DrawVisSprite(vissprite_t *vis, int x1, int x2, boolean psprite)
dc_translation = translationtables - 256 +
((vis->mobjflags & MF_TRANSLATION) >> (MF_TRANSSHIFT - 8));
}
//if (viewplayer->fixedcolormap == INVERSECOLORMAP)
// colfunc = basecolfunc;

dc_iscale = FixedDiv(FRACUNIT, vis->scale);
dc_texturemid = vis->texturemid;
Expand All @@ -497,6 +501,8 @@ void R_DrawVisSprite(vissprite_t *vis, int x1, int x2, boolean psprite)
R_DrawMaskedColumn2(column);
}

supershotgun = false;

colfunc = basecolfunc;
}

Expand Down

0 comments on commit 05929a1

Please sign in to comment.