MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / LoadImage

Method LoadImage

PanzerChasm/client/hud_drawer_soft.cpp:155–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void HudDrawerSoft::LoadImage( const char* const file_name, Image& out_image )
156{
157 const Vfs::FileContent texture_file= game_resources_->vfs->ReadFile( file_name );
158 const CelTextureHeader& cel_header= *reinterpret_cast<const CelTextureHeader*>( texture_file.data() );
159
160 out_image.size[0]= cel_header.size[0];
161 out_image.size[1]= cel_header.size[1];
162
163 const unsigned int pixel_count= out_image.size[0] * out_image.size[1];
164 out_image.data.resize( pixel_count );
165 std::memcpy( out_image.data.data(), texture_file.data() + sizeof(CelTextureHeader), pixel_count );
166}
167
168} // namespace PanzerChasm

Callers

nothing calls this directly

Calls 1

ReadFileMethod · 0.80

Tested by

no test coverage detected