| 172 | } |
| 173 | |
| 174 | CutsceneScriptPtr LoadCutsceneScript( const Vfs& vfs, unsigned int map_number ) |
| 175 | { |
| 176 | if( map_number >= 100 ) |
| 177 | return nullptr; |
| 178 | |
| 179 | char level_path[ MapData::c_max_file_path_size ]; |
| 180 | char script_file_name[ MapData::c_max_file_path_size ]; |
| 181 | |
| 182 | std::snprintf( level_path, sizeof(level_path), "LEVEL%02u/", map_number ); |
| 183 | std::snprintf( script_file_name, sizeof(script_file_name), "%sSCRIPT.%02u", level_path, map_number ); |
| 184 | |
| 185 | const Vfs::FileContent file_content= vfs.ReadFile( script_file_name ); |
| 186 | if( file_content.empty() ) |
| 187 | return nullptr; |
| 188 | |
| 189 | CutsceneScriptPtr result= std::make_shared<CutsceneScript>(); |
| 190 | |
| 191 | LoadSetupData( file_content, *result ); |
| 192 | LoadAction( file_content, *result ); |
| 193 | |
| 194 | return result; |
| 195 | } |
| 196 | |
| 197 | } // namespace PanzerChasm |
no test coverage detected