| 105 | } |
| 106 | |
| 107 | static void LoadSpriteEffectsDescription( |
| 108 | const Vfs::FileContent& inf_file, |
| 109 | GameResources& game_resources ) |
| 110 | { |
| 111 | const char* const effects_start= |
| 112 | std::strstr( reinterpret_cast<const char*>(inf_file.data()), "[BLOWS]" ); |
| 113 | const char* const effects_end= reinterpret_cast<const char*>(inf_file.data()) + inf_file.size() - 1u; |
| 114 | |
| 115 | std::istringstream stream( std::string( effects_start, effects_end ) ); |
| 116 | |
| 117 | char line[ 512 ]; |
| 118 | stream.getline( line, sizeof(line), '\n' ); |
| 119 | |
| 120 | unsigned int effects_count= 0u; |
| 121 | stream >> effects_count; |
| 122 | stream.getline( line, sizeof(line), '\n' ); |
| 123 | |
| 124 | game_resources.sprites_effects_description.resize( effects_count ); |
| 125 | |
| 126 | for( unsigned int i= 0u; i < effects_count; ) |
| 127 | { |
| 128 | stream.getline( line, sizeof(line), '\n' ); |
| 129 | if( line[0] == ';' ) |
| 130 | continue; |
| 131 | |
| 132 | std::istringstream line_stream{ std::string( line ) }; |
| 133 | |
| 134 | GameResources::SpriteEffectDescription& effect_description= game_resources.sprites_effects_description[i]; |
| 135 | |
| 136 | line_stream >> effect_description.glass; |
| 137 | line_stream >> effect_description.half_size; |
| 138 | line_stream >> effect_description.smooking; |
| 139 | line_stream >> effect_description.looped; |
| 140 | line_stream >> effect_description.gravity; |
| 141 | line_stream >> effect_description.jump; |
| 142 | line_stream >> effect_description.light_on; |
| 143 | line_stream >> effect_description.sprite_file_name; |
| 144 | |
| 145 | i++; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | static void LoadBMPObjectsDescription( |
| 150 | const Vfs::FileContent& inf_file, |