Skip to content

Commit

Permalink
Tekstury sprajtov pri vklücönnoj filjtraçii podgotavlivajutsä, podobn…
Browse files Browse the repository at this point in the history
…o teksturam sten i HUD.
  • Loading branch information
Panzerschrek committed Jul 13, 2017
1 parent 8b1b6b3 commit c499944
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions PanzerChasm/client/map_drawer_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@ void MapDrawerGL::LoadSprites( const std::vector<ObjSprite>& sprites, std::vecto
dst[3]= color_index == 255u ? 0u : 255u;
}

if( filter_textures_ )
{
for( unsigned int j= 0u; j < sprite.frame_count; j++ )
FillAlphaTexelsColorRGBA(
sprite.size[0], sprite.size[1],
data_rgba.data() + 4u * sprite.size[0] * sprite.size[1] * j );
}

glBindTexture( GL_TEXTURE_2D_ARRAY, out_textures[i] );
glTexImage3D(
GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8,
Expand All @@ -727,6 +735,8 @@ void MapDrawerGL::LoadSprites( const std::vector<ObjSprite>& sprites, std::vecto
{
glTexParameteri( GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameteri( GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion PanzerChasm/images.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ void CreateBriefbarTextureRGBA(

void FillAlphaTexelsColorRGBA(
unsigned int width, unsigned int height,
unsigned char* in_data );
unsigned char* data );

} // namespace PanzerChasm

0 comments on commit c499944

Please sign in to comment.