Skip to content

Commit

Permalink
Fix up some "shader" related functions; tweak 2D MDL drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Dec 15, 2024
1 parent 7aa8e89 commit 790e859
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion source_files/edge/r_mdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,9 @@ void MDLRenderModel2D(MDLModel *md, const Image *skin_img, int frame, float x, f

const MDLPoint *point = &md->points_[strip->first + v_idx];
const MDLVertex *vert = &frame_ptr->vertices[point->vert_idx];
const HMM_Vec2 texc = { point->skin_s, point->skin_t };

glTexCoord2f(point->skin_s, point->skin_t);
global_render_state->MultiTexCoord(GL_TEXTURE0, &texc);

float dx = vert->x * xscale;
float dy = vert->y * xscale;
Expand Down
10 changes: 5 additions & 5 deletions source_files/edge/r_render.cc
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,12 @@ static void WallCoordFunc(void *d, int v_idx, HMM_Vec3 *pos, RGBAColor *rgb, HMM
if (swirl_pass > 1)
{
*rgb = epi::MakeRGBA((uint8_t)(255.0f / data->R * render_view_red_multiplier), (uint8_t)(255.0f / data->G * render_view_green_multiplier),
(uint8_t)(255.0f / data->B * render_view_blue_multiplier));
(uint8_t)(255.0f / data->B * render_view_blue_multiplier), epi::GetRGBAAlpha(*rgb));
}
else
{
*rgb = epi::MakeRGBA((uint8_t)(data->R * render_view_red_multiplier), (uint8_t)(data->G * render_view_green_multiplier),
(uint8_t)(data->B * render_view_blue_multiplier));
(uint8_t)(data->B * render_view_blue_multiplier), epi::GetRGBAAlpha(*rgb));
}

float along;
Expand Down Expand Up @@ -619,12 +619,12 @@ static void PlaneCoordFunc(void *d, int v_idx, HMM_Vec3 *pos, RGBAColor *rgb, HM
if (swirl_pass > 1)
{
*rgb = epi::MakeRGBA((uint8_t)(255.0f / data->R * render_view_red_multiplier), (uint8_t)(255.0f / data->G * render_view_green_multiplier),
(uint8_t)(255.0f / data->B * render_view_blue_multiplier));
(uint8_t)(255.0f / data->B * render_view_blue_multiplier), epi::GetRGBAAlpha(*rgb));
}
else
{
*rgb = epi::MakeRGBA((uint8_t)(data->R * render_view_red_multiplier), (uint8_t)(data->G * render_view_green_multiplier),
(uint8_t)(data->B * render_view_blue_multiplier));
(uint8_t)(data->B * render_view_blue_multiplier), epi::GetRGBAAlpha(*rgb));
}

HMM_Vec2 rxy = {{(data->tx0 + pos->X), (data->ty0 + pos->Y)}};
Expand Down Expand Up @@ -1778,7 +1778,7 @@ static void FloodCoordFunc(void *d, int v_idx, HMM_Vec3 *pos, RGBAColor *rgb, HM
*pos = data->vertices[v_idx];
*normal = data->normal;
*rgb = epi::MakeRGBA((uint8_t)(data->R * render_view_red_multiplier), (uint8_t)(data->G * render_view_green_multiplier),
(uint8_t)(data->B * render_view_blue_multiplier));
(uint8_t)(data->B * render_view_blue_multiplier), epi::GetRGBAAlpha(*rgb));

float along = (view_z - data->plane_h) / (view_z - pos->Z);

Expand Down

0 comments on commit 790e859

Please sign in to comment.