From 976821e604987cebc36a3cbc98db26fe702a0966 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Fri, 4 Jun 2021 12:21:39 +0200 Subject: [PATCH] Map_StartPosition: Don't just pick some random entity, just default to the center since this happens in our games anyway. Address the constant spam of unnecessary prints to console. We do not need to know that a material we loaded succeeded - focus on the warnings and errors. --- plugins/shaders/shaders.cpp | 3 ++- radiant/map.cpp | 20 ++++++-------------- radiant/referencecache.cpp | 21 ++++++++++----------- radiant/textures.cpp | 3 ++- 4 files changed, 20 insertions(+), 27 deletions(-) diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 25d36e0..2c21ce2 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -1180,7 +1180,8 @@ void LoadShaderFile(const char *filename) ArchiveTextFile *file = GlobalFileSystem().openTextFile(filename); if (file != 0) { - globalOutputStream() << "Parsing material " << filename << "\n"; + // we probably only want to output when errors happen + //globalOutputStream() << "Parsing material " << filename << "\n"; Tokeniser &tokeniser = GlobalScriptLibrary().m_pfnNewScriptTokeniser(file->getInputStream()); ParseShaderFile(tokeniser, filename); tokeniser.release(); diff --git a/radiant/map.cpp b/radiant/map.cpp index 6e8196b..5592306 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -497,6 +497,8 @@ Entity *Scene_FindEntityByClass(const char *name) return entity; } +#if 0 +// TODO: We probably want to make this game-specific and put it into the game definitions! Entity *Scene_FindPlayerStart() { typedef const char *StaticString; @@ -517,11 +519,7 @@ Entity *Scene_FindPlayerStart() } return 0; } - -// -// move the view to a start position -// - +#endif void FocusViews(const Vector3 &point, float angle) { @@ -538,21 +536,15 @@ void FocusViews(const Vector3 &point, float angle) #include "stringio.h" +// +// move the view to a start position +// void GlobalCamera_GoToZero(); void Map_StartPosition() { - Entity *entity = Scene_FindPlayerStart(); - - if (entity) { - Vector3 origin; - string_parse_vector3(entity->getKeyValue("origin"), origin); - FocusViews(origin, string_read_float(entity->getKeyValue("angle"))); - } else { GlobalCamera_GoToZero(); - } } - inline bool node_is_worldspawn(scene::Node &node) { Entity *entity = Node_getEntity(node); diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 448cd91..7f2bd7d 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -190,21 +190,20 @@ NodeSmartReference ModelResource_load(ModelLoader *loader, const char *name) NodeSmartReference model(g_nullModel); - { + ArchiveFile *file = GlobalFileSystem().openFile(name); if (file != 0) { - globalOutputStream() << "Loaded Model: \"" << name << "\"\n"; - model = loader->loadModel(*file); - file->release(); - } else { - globalErrorStream() << "Model load failed: \"" << name << "\"\n"; - } - } + // Only output failures, we don't need to spam the console with successes + //globalOutputStream() << "Loaded Model: \"" << name << "\"\n"; + model = loader->loadModel(*file); + file->release(); + } else { + globalErrorStream() << "Model load failed: \"" << name << "\"\n"; + } - model.get().m_isRoot = true; - - return model; + model.get().m_isRoot = true; + return model; } diff --git a/radiant/textures.cpp b/radiant/textures.cpp index 50e0374..9983e77 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -337,7 +337,8 @@ void qtexture_realise(qtexture_t &texture, const TextureKey &key) texture.contentFlags = image->getContentFlags(); texture.value = image->getValue(); image->release(); - globalOutputStream() << "Loaded Texture: \"" << key.second.c_str() << "\"\n"; + // We only want to report when errors happen + //globalOutputStream() << "Loaded Texture: \"" << key.second.c_str() << "\"\n"; GlobalOpenGL_debugAssertNoErrors(); } else { globalErrorStream() << "Texture load failed: \"" << key.second.c_str() << "\"\n";