Skip to content
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

Hexen/Heretic: Support Color-Translation in V_DrawTLPatch #1267

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ static const inline pixel_t drawtinttab (const pixel_t dest, const pixel_t sourc
#else
{return I_BlendOverTinttab(dest, pal_color[source]);}
#endif
// V_DrawTLPatch Translated Option (translucent patch, color-translated)
static const inline pixel_t drawtrtinttab (const pixel_t dest, const pixel_t source)
#ifndef CRISPY_TRUECOLOR
{return tinttable[dest+(dp_translation[source]<<8)];}
#else
{return I_BlendOverTinttab(dest, pal_color[dp_translation[source]]);}
#endif
// V_DrawAltTLPatch (translucent patch, no coloring or color-translation are used)
static const inline pixel_t drawalttinttab (const pixel_t dest, const pixel_t source)
#ifndef CRISPY_TRUECOLOR
Expand All @@ -227,6 +234,7 @@ static const inline pixel_t drawxlatab (const pixel_t dest, const pixel_t source
// [crispy] array of function pointers holding the different rendering functions
typedef const pixel_t drawpatchpx_t (const pixel_t dest, const pixel_t source);
static drawpatchpx_t *const drawpatchpx_a[2][2] = {{drawpatchpx11, drawpatchpx10}, {drawpatchpx01, drawpatchpx00}};
static drawpatchpx_t *const drawtlpatchpx_a[2] = {drawtrtinttab, drawtinttab};

static fixed_t dx, dxi, dy, dyi;

Expand Down Expand Up @@ -520,8 +528,8 @@ void V_DrawTLPatch(int x, int y, patch_t * patch)
byte *source;
int w;

// [crispy] translucent patch, no coloring or color-translation are used
drawpatchpx_t *const drawpatchpx = drawtinttab;
// [crispy] translucent patch with optional color-translation used
drawpatchpx_t *const drawpatchpx = drawtlpatchpx_a[!dp_translation];

y -= SHORT(patch->topoffset);
x -= SHORT(patch->leftoffset);
Expand Down
Loading