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

Function LoadCutsceneScript

PanzerChasm/client/cutscene_script.cpp:174–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174CutsceneScriptPtr 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

Callers 1

CutscenePlayerMethod · 0.85

Calls 3

LoadSetupDataFunction · 0.85
LoadActionFunction · 0.85
ReadFileMethod · 0.80

Tested by

no test coverage detected