MCPcopy Create free account
hub / github.com/antopilo/Nuake / Update

Method Update

Nuake/Source/Nuake/Scene/Scene.cpp:282–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280 }
281
282 void Scene::Update(Timestep ts)
283 {
284 ZoneScoped;
285
286 if (!Engine::IsPlayMode())
287 {
288 const auto& view = m_Registry.view<QuakeMapComponent>();
289 for (const auto& e : view)
290 {
291 auto& map = view.get<QuakeMapComponent>(e);
292
293 bool buildMap = false;
294 if (map.rebuildNextTick && map.Path.Exist())
295 {
296 buildMap = true;
297 map.rebuildNextTick = false;
298 }
299
300 if (map.AutoRebuild && map.Path.Exist())
301 {
302 if (auto file = FileSystem::GetFile(map.Path.GetRelativePath()); file->Exist() && file->GetHasBeenModified())
303 {
304 file->SetHasBeenModified(false);
305 buildMap = true;
306 }
307 }
308
309 if (buildMap)
310 {
311 Entity entity = Entity(e, this);
312 QuakeMapBuilder builder;
313 builder.BuildQuakeMap(entity, map.HasCollisions);
314 }
315 }
316
317 std::map<std::string, Ref<File>> prefabToReimport;
318 const auto& prefabView = m_Registry.view<PrefabComponent>();
319 for (const auto& e : prefabView)
320 {
321 auto& prefabComponent = prefabView.get<PrefabComponent>(e);
322 if (prefabComponent.PrefabInstance == nullptr)
323 {
324 continue;
325 }
326
327 const std::string& filePath = prefabComponent.PrefabInstance->Path;
328 if (!FileSystem::FileExists(filePath))
329 {
330 continue;
331 }
332
333 Ref<File> file = FileSystem::GetFile(filePath);
334 if (file->GetHasBeenModified() || !prefabComponent.isInitialized)
335 {
336 prefabToReimport[filePath] = file;
337 }
338 }
339

Callers

nothing calls this directly

Calls 13

DestroyEntityMethod · 0.95
GetHasBeenModifiedMethod · 0.80
SetHasBeenModifiedMethod · 0.80
BuildQuakeMapMethod · 0.80
ReInstanceMethod · 0.80
EntityClass · 0.70
ExistMethod · 0.45
GetRelativePathMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45
IsValidMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected