/** * @brief Draws all mesh model shells for the current frame. */ void R_DrawMeshShells_default(const r_entities_t *ents) { if (!r_shell->value) { return; } if (r_draw_wireframe->value) { return; } R_EnableShell(program_shell, true); for (size_t i = 0; i < ents->count; i++) { const r_entity_t *e = ents->entities[i]; if ((e->effects & EF_SHELL) == 0) { continue; } if (e->effects & EF_NO_DRAW) { continue; } r_view.current_entity = e; R_DrawMeshShell_default(e); } r_view.current_entity = NULL; R_EnableShell(NULL, false); R_Color(NULL); }
/** * @brief Draws an animated, colored shell for the specified entity. Rather than * re-lerping or re-scaling the entity, the currently bound vertex arrays * are simply re-drawn using a small depth offset and varying texcoord delta. */ static void R_DrawMeshModelShell (const mAliasMesh_t *mesh, const vec4_t color) { /* check whether rgb is set */ if (!VectorNotEmpty(color)) return; R_Color(color); R_BindTexture(r_envmaptextures[1]->texnum); R_EnableShell(true); glDrawArrays(GL_TRIANGLES, 0, mesh->num_tris * 3); refdef.batchCount++; R_EnableShell(false); R_Color(NULL); }