summaryrefslogtreecommitdiff
path: root/Runtime/Misc/SaveAndLoadHelper.h
blob: f9bd799ebe518db547468592bbf3811b896ea9cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef SAVEANDLOADHELPER_H
#define SAVEANDLOADHELPER_H

#include <map>
#include <string>
#include <set>
#include <vector>
#include "Runtime/BaseClasses/BaseObject.h"
#include "Runtime/Utilities/GUID.h"
#include "Runtime/Misc/GarbageCollectSharedAssets.h"

class AssetBundle;
class AwakeFromLoadQueue;

typedef dynamic_array<int> InstanceIDArray;

void DestroyWorld (bool destroySceneAssets);

bool InitializeEngineNoGraphics ();
bool InitializeEngineGraphics (bool batch = false);
void CleanupEngine ();
void CleanupAllObjects (bool reloadable);

void CreateWorldEditor ();
void CleanupAfterLoad ();

/// Loads a new world from a pathname, playmode or editmode
/// Returns true if any datatemplates were merged while loading.
bool LoadSceneEditor (const std::string& pathName, std::map<LocalIdentifierInFileType, SInt32>* hintFileIDToHeapID, int mode);

void PostLoadLevelAdditive (const std::string& pathName, AwakeFromLoadQueue& awakeQueue);
void PostEditorLoadLevelAdditive (const std::string& pathName, AwakeFromLoadQueue& awakeQueue);
void CompletePreloadManagerLoadLevel (const std::string& path, AwakeFromLoadQueue& awakeQueue);
void CompletePreloadMainData (AwakeFromLoadQueue& awakeQueue);
void CompletePreloadManagerLoadLevelEditor (const std::string& path, AwakeFromLoadQueue& awakeQueue, int preloadOperationMode);

void LoadLevelAdditiveEditor (const std::string& level);

void CollectSceneGameObjects (InstanceIDArray& instanceIDs);

void CheckAllGOConsistency ();

void PostprocessScene ();

void UnloadAssetBundle (AssetBundle& file, bool unloadAllLoadedObjects);

void VerifyNothingIsPersistentInLoadedScene (const std::string& pathName);

/// Make there are any game objects and/or level managers still present, print an error message.
///
/// @param includeAllEditorExtensions If true, not only check for GameObjects but also for
///		any object derived from EditorExtension.
void ValidateNoSceneObjectsAreLoaded (bool includeAllEditorExtensions = false);

extern const char* kMainData;


#endif