Skip to content

Commit

Permalink
Fixed a couple of logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszkax86 committed Dec 7, 2023
1 parent 6be6d45 commit f790080
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion colobot-base/src/app/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ bool CApplication::CreateVideoSurface()
vsync = m_engine->GetVSync();
GetConfigFile().SetIntProperty("Setup", "VSync", vsync);

GetLogger()->Info("Using Vsync: %s\n", (vsync == -1 ? "adaptive" : (vsync ? "true" : "false")));
GetLogger()->Info("Using Vsync: %%", (vsync == -1 ? "adaptive" : (vsync ? "true" : "false")));
}

return true;
Expand Down
34 changes: 17 additions & 17 deletions colobot-base/src/graphics/engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,27 +811,27 @@ void CEngine::DebugObject(int objRank)

CLogger* l = GetLogger();

l->Debug("Debug object: %d\n", objRank);
l->Debug("Debug object: %%", objRank);
if (! m_objects[objRank].used)
{
l->Debug(" not used\n");
return;
}

l->Debug(" baseObjRank = %d\n", m_objects[objRank].baseObjRank);
l->Debug(" visible = %s\n", m_objects[objRank].visible ? "true" : "false");
l->Debug(" drawWorld = %s\n", m_objects[objRank].drawWorld ? "true" : "false");
l->Debug(" drawFront = %s\n", m_objects[objRank].drawFront ? "true" : "false");
l->Debug(" type = %d\n", m_objects[objRank].type);
l->Debug(" distance = %f\n", m_objects[objRank].distance);
l->Debug(" shadowRank = %d\n", m_objects[objRank].shadowRank);
l->Debug(" ghost = %s\n", m_objects[objRank].ghost ? "true" : "false");
l->Debug(" baseObjRank = %%", m_objects[objRank].baseObjRank);
l->Debug(" visible = %%", m_objects[objRank].visible);
l->Debug(" drawWorld = %%", m_objects[objRank].drawWorld);
l->Debug(" drawFront = %%", m_objects[objRank].drawFront);
l->Debug(" type = %%", m_objects[objRank].type);
l->Debug(" distance = %%", m_objects[objRank].distance);
l->Debug(" shadowRank = %%", m_objects[objRank].shadowRank);
l->Debug(" ghost = %%", m_objects[objRank].ghost);

l->Debug(" baseObj:\n");
l->Debug(" baseObj:");
int baseObjRank = m_objects[objRank].baseObjRank;
if (baseObjRank == -1)
{
l->Debug(" null\n");
l->Debug(" null");
return;
}

Expand All @@ -840,23 +840,23 @@ void CEngine::DebugObject(int objRank)
EngineBaseObject& p1 = m_baseObjects[baseObjRank];
if (!p1.used)
{
l->Debug(" not used\n");
l->Debug(" not used");
return;
}

std::string vecStr;

vecStr = Math::ToString(p1.bboxMin);
l->Debug(" bboxMin: %s\n", vecStr.c_str());
l->Debug(" bboxMin: %%", vecStr);
vecStr = Math::ToString(p1.bboxMax);
l->Debug(" bboxMax: %s\n", vecStr.c_str());
l->Debug(" totalTriangles: %d\n", p1.totalTriangles);
l->Debug(" radius: %f\n", p1.boundingSphere.radius);
l->Debug(" bboxMax: %%", vecStr);
l->Debug(" totalTriangles: %%", p1.totalTriangles);
l->Debug(" radius: %%", p1.boundingSphere.radius);

for (int l2 = 0; l2 < static_cast<int>( p1.next.size() ); l2++)
{
EngineBaseObjDataTier& p2 = p1.next[l2];
l->Debug(" l2:\n");
l->Debug(" l2:");

/*
l->Debug(" tex1: %s (id: %u)\n", p2.tex1Name.c_str(), p2.tex1.id);
Expand Down
44 changes: 22 additions & 22 deletions colobot-base/src/graphics/engine/lightman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void CLightManager::DebugDumpLights()
{
CLogger* l = GetLogger();

l->Debug("Dynamic lights:\n");
l->Debug("Dynamic lights:");

for (int i = 0; i < static_cast<int>( m_dynLights.size() ); ++i)
{
Expand All @@ -116,36 +116,36 @@ void CLightManager::DebugDumpLights()
}
}

l->Debug(" light %d\n", i);
l->Debug(" enabled = %s\n", dynLight.enabled ? "true" : "false");
l->Debug(" priority = %d\n", dynLight.priority);
l->Debug(" device light = %d\n", deviceLight);
l->Debug(" light:\n");
l->Debug(" light %%", i);
l->Debug(" enabled = %%", dynLight.enabled);
l->Debug(" priority = %%", dynLight.priority);
l->Debug(" device light = %%", deviceLight);
l->Debug(" light:");

const Light& light = dynLight.light;
std::string str;

l->Debug(" type = %d\n", light.type);
l->Debug(" type = %%", light.type);
str = light.ambient.ToString();
l->Debug(" ambient = %s\n", str.c_str());
l->Debug(" ambient = %%", str);
str = light.diffuse.ToString();
l->Debug(" diffuse = %s\n", str.c_str());
l->Debug(" diffuse = %%", str);
str = light.specular.ToString();
l->Debug(" specular = %s\n", str.c_str());
l->Debug(" specular = %%", str);
str = Math::ToString(light.position);
l->Debug(" position = %s\n", str.c_str());
l->Debug(" position = %%", str);
str = Math::ToString(light.direction);
l->Debug(" direction = %s\n", str.c_str());
l->Debug(" attenuation0 = %f\n", light.attenuation0);
l->Debug(" attenuation1 = %f\n", light.attenuation1);
l->Debug(" attenuation2 = %f\n", light.attenuation2);
l->Debug(" spotAngle = %f\n", light.spotAngle);
l->Debug(" spotIntensity = %f\n", light.spotIntensity);

l->Debug(" intensity: %f\n", dynLight.intensity.current);
l->Debug(" color: %f %f %f\n", dynLight.colorRed.current, dynLight.colorGreen.current, dynLight.colorBlue.current);
l->Debug(" includeType: %d\n", dynLight.includeType);
l->Debug(" excludeType: %d\n", dynLight.excludeType);
l->Debug(" direction = %%", str);
l->Debug(" attenuation0 = %%", light.attenuation0);
l->Debug(" attenuation1 = %%", light.attenuation1);
l->Debug(" attenuation2 = %%", light.attenuation2);
l->Debug(" spotAngle = %%", light.spotAngle);
l->Debug(" spotIntensity = %%", light.spotIntensity);

l->Debug(" intensity: %%", dynLight.intensity.current);
l->Debug(" color: %% %% %%", dynLight.colorRed.current, dynLight.colorGreen.current, dynLight.colorBlue.current);
l->Debug(" includeType: %%", dynLight.includeType);
l->Debug(" excludeType: %%", dynLight.excludeType);
}
}

Expand Down
2 changes: 1 addition & 1 deletion colobot-base/src/level/robotmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2916,7 +2916,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (rank >= 0)
{
// TODO: Fix default levels and add a future removal warning
GetLogger()->Warn("This level is using deprecated way of defining %% scene. Please change the %%= parameter in EndingFile from %% to \"levels/other/%1$s%2$03d.txt\".\n", type, rank);
GetLogger()->Warn("This level is using deprecated way of defining %% scene. Please change the %%= parameter in EndingFile from %% to \"levels/other/%1$s%2$03d.txt\".\n", type, type, rank);
std::stringstream ss;
ss << "levels/other/" << type << std::setfill('0') << std::setw(3) << rank << ".txt";
return ss.str();
Expand Down

0 comments on commit f790080

Please sign in to comment.