1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-15 14:27:37 +00:00

support to draw colored textures

This commit is contained in:
Zeno Rogue
2020-09-11 11:08:27 +02:00
parent 8dc7a6cd92
commit 6d8cc0eadc
3 changed files with 34 additions and 2 deletions

View File

@@ -598,10 +598,17 @@ void dqi_poly::gldraw() {
#endif
if(tinf) {
glhr::be_textured();
bool col = isize(tinf->colors);
if(col)
glhr::be_color_textured();
else
glhr::be_textured();
if(flags & POLY_SHADE_TEXTURE) current_display->next_shader_flags |= GF_TEXTURE_SHADED;
glBindTexture(GL_TEXTURE_2D, tinf->texture_id);
glhr::vertices_texture(v, tinf->tvertices, offset, offset_texture);
if(isize(tinf->colors))
glhr::vertices_texture_color(v, tinf->tvertices, tinf->colors, offset, offset_texture);
else
glhr::vertices_texture(v, tinf->tvertices, offset, offset_texture);
ioffset = 0;
}
else {