Frame images are now ETC1 compressed.

This commit is contained in:
Bartosz Taudul 2019-06-07 00:29:59 +02:00
parent a654b642ef
commit 42a30bffe1
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ void UpdateTexture( void* _tex, const char* data, int w, int h )
{
auto tex = (GLuint)_tex;
glBindTexture( GL_TEXTURE_2D, tex );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data );
glCompressedTexImage2D( GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB8_ETC2, w, h, 0, w * h / 2, data );
}
}

View File

@ -1248,7 +1248,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
auto fi = m_slab.Alloc<FrameImage>();
f.Read2( fi->w, fi->h );
const auto sz = fi->w * fi->h * 4;
const auto sz = fi->w * fi->h / 2;
auto ptr = (char*)m_slab.AllocBig( sz );
f.Read( ptr, sz );
fi->ptr = ptr;
@ -4326,7 +4326,7 @@ void Worker::Write( FileWrite& f )
{
f.Write( &fi->w, sizeof( fi->w ) );
f.Write( &fi->h, sizeof( fi->h ) );
f.Write( fi->ptr, fi->w * fi->h * 4 );
f.Write( fi->ptr, fi->w * fi->h / 2 );
}
}