Skip to content

Commit

Permalink
Remove unused GL normal stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Nov 27, 2024
1 parent 6b736e2 commit e5b2881
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 27 deletions.
6 changes: 0 additions & 6 deletions source_files/edge/r_md2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1358,10 +1358,8 @@ void MD2RenderModel(MD2Model *md, const Image *skin_img, bool is_weapon, int fra
GL_STREAM_DRAW);
glVertexPointer(3, GL_FLOAT, sizeof(RendererVertex), (void *)(offsetof(RendererVertex, position.X)));
glColorPointer(4, GL_FLOAT, sizeof(RendererVertex), (void *)(offsetof(RendererVertex, rgba_color)));
glNormalPointer(GL_FLOAT, sizeof(RendererVertex), (void *)(offsetof(RendererVertex, normal.Y)));
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glClientActiveTexture(GL_TEXTURE0);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(RendererVertex),
Expand Down Expand Up @@ -1421,10 +1419,6 @@ void MD2RenderModel2D(MD2Model *md, const Image *skin_img, int frame, float x, f

glTexCoord2f(point->skin_s * im_right, point->skin_t * im_top);

short n = vert->normal_idx;

global_render_state->SetNormal(md_normals[n]);

float dx = vert->x * xscale;
float dy = vert->y * xscale;
float dz = (vert->z + info->model_bias_) * yscale;
Expand Down
6 changes: 0 additions & 6 deletions source_files/edge/r_mdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1055,10 +1055,8 @@ void MDLRenderModel(MDLModel *md, const Image *skin_img, bool is_weapon, int fra
GL_STREAM_DRAW);
glVertexPointer(3, GL_FLOAT, sizeof(RendererVertex), (void *)(offsetof(RendererVertex, position.X)));
glColorPointer(4, GL_FLOAT, sizeof(RendererVertex), (void *)(offsetof(RendererVertex, rgba_color)));
glNormalPointer(GL_FLOAT, sizeof(RendererVertex), (void *)(offsetof(RendererVertex, normal.X)));
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glClientActiveTexture(GL_TEXTURE0);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(RendererVertex),
Expand Down Expand Up @@ -1118,10 +1116,6 @@ void MDLRenderModel2D(MDLModel *md, const Image *skin_img, int frame, float x, f

glTexCoord2f(point->skin_s, point->skin_t);

short n = vert->normal_idx;

global_render_state->SetNormal(md_normals[n]);

float dx = vert->x * xscale;
float dy = vert->y * xscale;
float dz = (vert->z + info->model_bias_) * yscale;
Expand Down
14 changes: 0 additions & 14 deletions source_files/edge/r_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,18 +368,6 @@ class RenderState
ec_frame_stats.draw_state_change++;
}

void SetNormal(const HMM_Vec3 &normal)
{
if (AlmostEquals(normal_vector_.X, normal.X) && AlmostEquals(normal_vector_.Y, normal.Y)
&& AlmostEquals(normal_vector_.Z, normal.Z))
{
return;
}
normal_vector_ = normal;
glNormal3fv((GLfloat *)&normal_vector_);
ec_frame_stats.draw_state_change++;
}

void GLColor(const GLfloat *color)
{
if (AlmostEquals(color[0], gl_color_[0]) && AlmostEquals(color[1], gl_color_[1]) &&
Expand Down Expand Up @@ -618,8 +606,6 @@ class RenderState
GLfloat fog_density_;
GLfloat fog_color_[4];

HMM_Vec3 normal_vector_;

GLfloat gl_color_[4];
};

Expand Down
1 change: 0 additions & 1 deletion source_files/edge/r_units.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ struct Compare_Unit_pred
static inline void RendererSendRawVector(const RendererVertex *V)
{
global_render_state->GLColor(V->rgba_color);
global_render_state->SetNormal(V->normal);

global_render_state->MultiTexCoord(GL_TEXTURE0, &V->texture_coordinates[0]);
global_render_state->MultiTexCoord(GL_TEXTURE1, &V->texture_coordinates[1]);
Expand Down

0 comments on commit e5b2881

Please sign in to comment.