mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
Logging cleanup (#69)
* Mac OS X 10.6 & More C++03 Support * Fix SDL2 options.txt loading for C++03 * Output/Logging Overhaul * Added StandardOut class * Renamed LOGX macros to LOG_X * Removed LogMsg macros in favor of LOG_X * Added console window for debug Windows builds * Updated Xcode Project + StandardOut.hpp + StandardOut.cpp * StandardOut_windows * Replaced the Windows #ifdefs in StandardOut with StandardOut_windows --------- Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
This commit is contained in:
@@ -53,7 +53,7 @@ LevelRenderer::LevelRenderer(Minecraft* pMC, Textures* pTexs)
|
||||
m_pBuffers = new GLuint[m_nBuffers];
|
||||
xglGenBuffers(m_nBuffers, m_pBuffers);
|
||||
|
||||
printf("numBuffers: %d\n", m_nBuffers);
|
||||
LOG_I("numBuffers: %d", m_nBuffers);
|
||||
xglGenBuffers(1, &field_D8);
|
||||
|
||||
generateSky(); // inlined in the 0.1.0 demo
|
||||
@@ -146,7 +146,7 @@ void LevelRenderer::allChanged()
|
||||
field_A8 = 8;
|
||||
|
||||
m_chunksLength = field_A8 * field_A4 * field_AC;
|
||||
printf("chunksLength: %d\n", m_chunksLength);
|
||||
LOG_I("chunksLength: %d", m_chunksLength);
|
||||
m_chunks = new Chunk* [m_chunksLength];
|
||||
field_98 = new Chunk* [m_chunksLength];
|
||||
|
||||
@@ -1162,6 +1162,7 @@ void LevelRenderer::takePicture(TripodCamera* pCamera, Entity* pOwner)
|
||||
|
||||
void LevelRenderer::addParticle(const std::string& name, float x, float y, float z, float vx, float vy, float vz)
|
||||
{
|
||||
// TODO: Who's the genius who decided it'd be better to check a name string rather than an enum?
|
||||
if (m_pMinecraft->m_pMobPersp->distanceToSqr_inline(x, y, z) > 256.0f)
|
||||
return;
|
||||
|
||||
@@ -1202,13 +1203,12 @@ void LevelRenderer::addParticle(const std::string& name, float x, float y, float
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
//LogMsg("Unknown particle type: %s", name.c_str());
|
||||
#endif
|
||||
LOG_W("Unknown particle type: %s", name.c_str());
|
||||
}
|
||||
|
||||
void LevelRenderer::playSound(const std::string& name, float x, float y, float z, float a, float b)
|
||||
{
|
||||
// TODO: Who's the genius who decided it'd be better to check a name string rather than an enum?
|
||||
float mult = 1.0f, dist = 16.0f;
|
||||
|
||||
if (a > 1.0f)
|
||||
|
||||
@@ -41,7 +41,7 @@ void PatchManager::LoadPatchData(const std::string& patchData)
|
||||
|
||||
if (command == "stop_now")
|
||||
{
|
||||
LogMsg("PatchManager: Found stop_now, quitting patch processing earlier, iProgramInCpp probably wanted to test something");
|
||||
LOG_I("PatchManager: Found stop_now, quitting patch processing earlier, iProgramInCpp probably wanted to test something");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void PatchManager::LoadPatchData(const std::string& patchData)
|
||||
if (itemID == -1)
|
||||
{
|
||||
namefailure:
|
||||
LogMsg("Unknown item/tile with the name %s", itemName.c_str());
|
||||
LOG_W("Unknown item/tile with the name %s", itemName.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ void PatchManager::LoadPatchData(const std::string& patchData)
|
||||
continue;
|
||||
}
|
||||
|
||||
LogMsg("Unknown command %s from patch data.", command.c_str());
|
||||
LOG_W("Unknown command %s from patch data.", command.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ void PatchManager::PatchTextures(AppPlatform* pAppPlatform, ePatchType patchType
|
||||
Texture texture = pAppPlatform->loadTexture("patches/" + pd.m_filename, true);
|
||||
if (texture.m_width == 0)
|
||||
{
|
||||
LogMsg("Image %s has width 0, not found?! Skipping", pd.m_filename.c_str());
|
||||
LOG_W("Image %s has width 0, not found?! Skipping", pd.m_filename.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void PatchManager::PatchTiles()
|
||||
continue;
|
||||
}
|
||||
|
||||
LogMsg("PatchTiles: unknown item ID %d", pd.m_destID);
|
||||
LOG_W("PatchTiles: unknown item ID %d", pd.m_destID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ void Tesselator::vertex(float x, float y, float z)
|
||||
if (!(field_4 & 3) && field_2C >= m_maxVertices - 1)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
puts("Overwriting the vertex buffer! This chunk/entity won't show up");
|
||||
LOG_W("Overwriting the vertex buffer! This chunk/entity won't show up");
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ SoundEngine::SoundEngine()
|
||||
|
||||
void SoundEngine::init(Options* options)
|
||||
{
|
||||
// TODO: Who's the genius who decided it'd be better to check a name string rather than an enum?
|
||||
m_pOptions = options;
|
||||
|
||||
m_repository.add("step.cloth", SA_cloth1);
|
||||
|
||||
@@ -27,10 +27,11 @@ void SoundRepository::add(const std::string& name, SoundDesc& sd)
|
||||
|
||||
bool SoundRepository::get(const std::string& name, SoundDesc& sd)
|
||||
{
|
||||
// TODO: Who's the genius who decided it'd be better to check a name string rather than an enum?
|
||||
std::map<std::string, std::vector<SoundDesc> >::iterator iter = m_repo.find(name);
|
||||
if (iter == m_repo.end())
|
||||
{
|
||||
printf("Couldn't find a sound with id: %s\n", name.c_str());
|
||||
LOG_E("Couldn't find a sound with id: %s", name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user