| 153 | } |
| 154 | |
| 155 | void 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 |