MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Load

Method Load

ogsr_engine/xr_3da/IGame_Level.cpp:63–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61//-------------------------------------------------------------------------------------------
62
63BOOL IGame_Level::Load(u32 dwNum)
64{
65 // Initialize level data
66 string_path temp;
67 if (!FS.exist(temp, fsgame::level, fsgame::level_files::level_ltx))
68 FATAL("Can't find level configuration file '%s'.", temp);
69 pLevel = xr_new<CInifile>(temp);
70
71 // Open
72 g_pGamePersistent->LoadTitle("st_opening_stream");
73 IReader* LL_Stream = FS.r_open(fsgame::level, fsgame::level_files::level);
74 IReader& fs = *LL_Stream;
75
76 // Header
77 hdrLEVEL H;
78 fs.r_chunk_safe(fsL_HEADER, &H, sizeof(H));
79 R_ASSERT(XRCL_PRODUCTION_VERSION == H.XRLC_version, "Incompatible level version.");
80
81 // CForms
82 g_pGamePersistent->LoadTitle("st_loading_cform");
83 ObjectSpace.Load();
84
85 if (!g_hud)
86 g_hud = (CCustomHUD*)NEW_INSTANCE(CLSID_HUDMANAGER);
87
88 Render->level_Load(LL_Stream);
89 // Msg ("* S-CREATE: %f ms, %d times",tscreate.result,tscreate.count);
90
91 // Objects
92 g_pGamePersistent->Environment().mods_load();
93 R_ASSERT(Load_GameSpecific_Before());
94 Objects.Load();
95
96 // Done
97 FS.r_close(LL_Stream);
98 bReady = true;
99 IR_Capture();
100 Device.seqRender.Add(this);
101 Device.seqFrame.Add(this);
102
103 return TRUE;
104}
105
106void IGame_Level::OnRender()
107{

Callers

nothing calls this directly

Calls 10

Load_GameSpecific_BeforeFunction · 0.85
existMethod · 0.80
LoadTitleMethod · 0.80
r_openMethod · 0.80
r_chunk_safeMethod · 0.80
level_LoadMethod · 0.80
mods_loadMethod · 0.80
EnvironmentMethod · 0.80
r_closeMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected