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.
This commit is contained in:
Marco Cawthorne 2021-06-04 12:21:39 +02:00
parent 9ba6ef4628
commit 976821e604
4 changed files with 20 additions and 27 deletions

View file

@ -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();

View file

@ -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);

View file

@ -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;
}

View file

@ -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";