-
From 67e0321688af37571a7cb77fcde70f9513bf89db Mon Sep 17 00:00:00 2001
From: Philip Taylor <philip@zaynar.co.uk>
Date: Tue, 20 Jan 2015 23:16:14 +0000
Subject: [PATCH 08/13] Automatically convert all CLogger format strings from
wchar_t* to char*.
Done with:
ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed -i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'
---
source/graphics/ColladaManager.cpp | 32 ++++-----
source/graphics/FontManager.cpp | 6 +-
source/graphics/LOSTexture.cpp | 4 +-
source/graphics/MapGenerator.cpp | 22 +++---
source/graphics/MapReader.cpp | 14 ++--
source/graphics/MapWriter.cpp | 4 +-
source/graphics/MeshManager.cpp | 4 +-
source/graphics/Model.cpp | 2 +-
source/graphics/ModelAbstract.cpp | 4 +-
source/graphics/ObjectBase.cpp | 4 +-
source/graphics/ObjectEntry.cpp | 12 ++--
source/graphics/ObjectManager.cpp | 2 +-
source/graphics/ParticleEmitterType.cpp | 2 +-
source/graphics/ShaderManager.cpp | 8 +--
source/graphics/ShaderProgram.cpp | 18 ++---
source/graphics/ShaderProgramFFP.cpp | 2 +-
source/graphics/SkeletonAnimManager.cpp | 8 +--
source/graphics/TerrainTextureEntry.cpp | 4 +-
source/graphics/TerrainTextureManager.cpp | 6 +-
source/graphics/TextureConverter.cpp | 26 +++----
source/graphics/TextureManager.cpp | 10 +--
source/graphics/scripting/JSInterface_GameView.cpp | 4 +-
source/gui/CGUI.cpp | 82 +++++++++++-----------
source/gui/CGUIScrollBarVertical.cpp | 2 +-
source/gui/COList.cpp | 6 +-
source/gui/GUIManager.cpp | 20 +++---
source/gui/GUIRenderer.cpp | 4 +-
source/gui/GUITooltip.cpp | 10 +--
source/gui/GUIbase.cpp | 6 +-
source/gui/GUItext.cpp | 34 ++++-----
source/gui/GUIutil.cpp | 22 +++---
source/gui/IGUIObject.cpp | 2 +-
source/gui/scripting/ScriptFunctions.cpp | 12 ++--
source/i18n/L10n.cpp | 14 ++--
source/lib/sysdep/os/linux/dir_watch_inotify.cpp | 4 +-
source/lobby/XmppClient.cpp | 8 +--
source/main.cpp | 2 +-
source/network/NetClient.cpp | 8 +--
source/network/NetFileTransfer.cpp | 18 ++---
source/network/NetHost.cpp | 6 +-
source/network/NetMessage.cpp | 6 +-
source/network/NetServer.cpp | 42 +++++------
source/network/NetSession.cpp | 6 +-
source/network/NetTurnManager.cpp | 12 ++--
source/ps/CStrIntern.cpp | 2 +-
source/ps/ConfigDB.cpp | 26 +++----
source/ps/DllLoader.cpp | 6 +-
source/ps/FileIo.cpp | 2 +-
source/ps/Filesystem.cpp | 2 +-
source/ps/GameSetup/Config.cpp | 4 +-
source/ps/GameSetup/GameSetup.cpp | 26 +++----
source/ps/GameSetup/HWDetect.cpp | 2 +-
source/ps/GameSetup/Paths.cpp | 2 +-
source/ps/Hotkey.cpp | 2 +-
source/ps/Joystick.cpp | 10 +--
source/ps/Overlay.cpp | 8 +--
source/ps/Preprocessor.cpp | 4 +-
source/ps/PreprocessorWrapper.cpp | 4 +-
source/ps/ProfileViewer.cpp | 4 +-
source/ps/Profiler2.cpp | 10 +--
source/ps/SavedGame.cpp | 2 +-
source/ps/TemplateLoader.cpp | 26 +++----
source/ps/Util.cpp | 4 +-
source/ps/VideoMode.cpp | 18 ++---
source/ps/World.cpp | 2 +-
source/ps/XML/RelaxNG.cpp | 10 +--
source/ps/XML/XMLWriter.cpp | 2 +-
source/ps/XML/Xeromyces.cpp | 10 +--
source/ps/scripting/JSInterface_ConfigDB.cpp | 2 +-
source/ps/scripting/JSInterface_Console.cpp | 2 +-
source/ps/scripting/JSInterface_VFS.cpp | 2 +-
source/renderer/DecalRData.cpp | 4 +-
source/renderer/ModelRenderer.cpp | 2 +-
source/renderer/PatchRData.cpp | 2 +-
source/renderer/PostprocManager.cpp | 8 +--
source/renderer/Renderer.cpp | 12 ++--
source/renderer/ShadowMap.cpp | 4 +-
source/renderer/SkyManager.cpp | 4 +-
source/renderer/TerrainRenderer.cpp | 2 +-
source/renderer/VertexBufferManager.cpp | 2 +-
source/renderer/WaterManager.cpp | 6 +-
source/scriptinterface/DebuggingServer.cpp | 4 +-
source/scriptinterface/ScriptInterface.cpp | 36 +++++-----
source/scriptinterface/ThreadDebugger.cpp | 8 +--
source/simulation2/Simulation2.cpp | 14 ++--
source/simulation2/components/CCmpAIManager.cpp | 36 +++++-----
source/simulation2/components/CCmpCommandQueue.cpp | 4 +-
source/simulation2/components/CCmpObstruction.cpp | 6 +-
source/simulation2/components/CCmpPathfinder.cpp | 4 +-
source/simulation2/components/CCmpPosition.cpp | 24 +++----
.../components/CCmpProjectileManager.cpp | 2 +-
.../components/CCmpRallyPointRenderer.cpp | 2 +-
source/simulation2/components/CCmpRangeManager.cpp | 16 ++---
.../simulation2/components/CCmpTemplateManager.cpp | 4 +-
source/simulation2/components/CCmpUnitMotion.cpp | 2 +-
source/simulation2/components/CCmpVisualActor.cpp | 6 +-
source/simulation2/components/ICmpVisibility.cpp | 2 +-
.../scripting/EngineScriptConversions.cpp | 2 +-
.../scripting/MessageTypeConversions.cpp | 22 +++---
source/simulation2/scripting/ScriptComponent.cpp | 6 +-
source/simulation2/scripting/ScriptComponent.h | 4 +-
.../simulation2/serialization/BinarySerializer.cpp | 6 +-
source/simulation2/system/ComponentManager.cpp | 18 ++---
.../system/ComponentManagerSerialization.cpp | 8 +--
source/simulation2/system/ParamNode.cpp | 2 +-
source/soundmanager/SoundManager.cpp | 10 +--
source/soundmanager/data/SoundData.cpp | 2 +-
source/soundmanager/items/CSoundBase.cpp | 2 +-
source/soundmanager/scripting/SoundGroup.cpp | 4 +-
source/tools/atlas/GameInterface/GameLoop.cpp | 2 +-
.../atlas/GameInterface/Handlers/MapHandlers.cpp | 8 +--
.../GameInterface/Handlers/ObjectHandlers.cpp | 2 +-
112 files changed, 516 insertions(+), 516 deletions(-)
diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp
index 35552e1..c6176d2 100644
a
|
b
|
namespace
|
42 | 42 | VfsPath* path = static_cast<VfsPath*>(cb_data); |
43 | 43 | |
44 | 44 | if (severity == LOG_INFO) |
45 | | LOGMESSAGE(L"%ls: %hs", path->string().c_str(), text); |
| 45 | LOGMESSAGE("%ls: %hs", path->string().c_str(), text); |
46 | 46 | else if (severity == LOG_WARNING) |
47 | | LOGWARNING(L"%ls: %hs", path->string().c_str(), text); |
| 47 | LOGWARNING("%ls: %hs", path->string().c_str(), text); |
48 | 48 | else |
49 | | LOGERROR(L"%ls: %hs", path->string().c_str(), text); |
| 49 | LOGERROR("%ls: %hs", path->string().c_str(), text); |
50 | 50 | } |
51 | 51 | |
52 | 52 | void ColladaOutput(void* cb_data, const char* data, unsigned int length) |
… |
… |
public:
|
99 | 99 | if (!dll.IsLoaded() && !TryLoadDLL()) |
100 | 100 | return ERR::FAIL; |
101 | 101 | |
102 | | LOGMESSAGE(L"Hotloading skeleton definitions from '%ls'", path.string().c_str()); |
| 102 | LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string().c_str()); |
103 | 103 | // Set the filename for the logger to report |
104 | 104 | set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&path))); |
105 | 105 | |
106 | 106 | CVFSFile skeletonFile; |
107 | 107 | if (skeletonFile.Load(m_VFS, path) != PSRETURN_OK) |
108 | 108 | { |
109 | | LOGERROR(L"Failed to read skeleton defintions from '%ls'", path.string().c_str()); |
| 109 | LOGERROR("Failed to read skeleton defintions from '%ls'", path.string().c_str()); |
110 | 110 | return ERR::FAIL; |
111 | 111 | } |
112 | 112 | |
113 | 113 | int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize()); |
114 | 114 | if (ok < 0) |
115 | 115 | { |
116 | | LOGERROR(L"Failed to load skeleton definitions from '%ls'", path.string().c_str()); |
| 116 | LOGERROR("Failed to load skeleton definitions from '%ls'", path.string().c_str()); |
117 | 117 | return ERR::FAIL; |
118 | 118 | } |
119 | 119 | |
… |
… |
public:
|
189 | 189 | { |
190 | 190 | if (!dll.LoadDLL()) |
191 | 191 | { |
192 | | LOGERROR(L"Failed to load COLLADA conversion DLL"); |
| 192 | LOGERROR("Failed to load COLLADA conversion DLL"); |
193 | 193 | return false; |
194 | 194 | } |
195 | 195 | |
… |
… |
public:
|
202 | 202 | } |
203 | 203 | catch (PSERROR_DllLoader&) |
204 | 204 | { |
205 | | LOGERROR(L"Failed to load symbols from COLLADA conversion DLL"); |
| 205 | LOGERROR("Failed to load symbols from COLLADA conversion DLL"); |
206 | 206 | dll.Unload(); |
207 | 207 | return false; |
208 | 208 | } |
… |
… |
public:
|
214 | 214 | VfsPaths pathnames; |
215 | 215 | if (vfs::GetPathnames(m_VFS, L"art/skeletons/", L"*.xml", pathnames) < 0) |
216 | 216 | { |
217 | | LOGERROR(L"No skeleton definition files present"); |
| 217 | LOGERROR("No skeleton definition files present"); |
218 | 218 | return false; |
219 | 219 | } |
220 | 220 | |
221 | 221 | bool loaded = false; |
222 | 222 | for (VfsPaths::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it) |
223 | 223 | { |
224 | | LOGMESSAGE(L"Loading skeleton definitions from '%ls'", it->string().c_str()); |
| 224 | LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string().c_str()); |
225 | 225 | // Set the filename for the logger to report |
226 | 226 | set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&(*it)))); |
227 | 227 | |
228 | 228 | CVFSFile skeletonFile; |
229 | 229 | if (skeletonFile.Load(m_VFS, *it) != PSRETURN_OK) |
230 | 230 | { |
231 | | LOGERROR(L"Failed to read skeleton defintions from '%ls'", it->string().c_str()); |
| 231 | LOGERROR("Failed to read skeleton defintions from '%ls'", it->string().c_str()); |
232 | 232 | continue; |
233 | 233 | } |
234 | 234 | |
235 | 235 | int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize()); |
236 | 236 | if (ok < 0) |
237 | 237 | { |
238 | | LOGERROR(L"Failed to load skeleton definitions from '%ls'", it->string().c_str()); |
| 238 | LOGERROR("Failed to load skeleton definitions from '%ls'", it->string().c_str()); |
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | |
… |
… |
public:
|
243 | 243 | } |
244 | 244 | |
245 | 245 | if (!loaded) |
246 | | LOGERROR(L"Failed to load any skeleton definitions"); |
| 246 | LOGERROR("Failed to load any skeleton definitions"); |
247 | 247 | |
248 | 248 | return loaded; |
249 | 249 | } |
… |
… |
public:
|
267 | 267 | VfsPaths paths; |
268 | 268 | if (vfs::GetPathnames(m_VFS, L"art/skeletons/", L"*.xml", paths) != INFO::OK) |
269 | 269 | { |
270 | | LOGWARNING(L"Failed to load skeleton definitions"); |
| 270 | LOGWARNING("Failed to load skeleton definitions"); |
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
… |
… |
public:
|
287 | 287 | // should never happen, unless there really is a problem |
288 | 288 | if (m_VFS->GetFileInfo(*it, &fileInfo) != INFO::OK) |
289 | 289 | { |
290 | | LOGERROR(L"Failed to stat '%ls' for DAE caching", it->string().c_str()); |
| 290 | LOGERROR("Failed to stat '%ls' for DAE caching", it->string().c_str()); |
291 | 291 | } |
292 | 292 | else |
293 | 293 | { |
… |
… |
public:
|
298 | 298 | |
299 | 299 | // Check if we were able to load any skeleton files |
300 | 300 | if (m_skeletonHashes.empty()) |
301 | | LOGERROR(L"Failed to stat any skeleton definitions for DAE caching"); |
| 301 | LOGERROR("Failed to stat any skeleton definitions for DAE caching"); |
302 | 302 | // We can continue, something else will break if we try loading a skeletal model |
303 | 303 | |
304 | 304 | m_skeletonHashInvalidated = false; |
-
diff --git a/source/graphics/FontManager.cpp b/source/graphics/FontManager.cpp
index c7180ce..c88fac2 100644
a
|
b
|
bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)
|
59 | 59 | const VfsPath fntName(fontName.string() + ".fnt"); |
60 | 60 | if (g_VFS->LoadFile(path / fntName, buf, size) < 0) |
61 | 61 | { |
62 | | LOGERROR(L"Failed to open font file %ls", (path / fntName).string().c_str()); |
| 62 | LOGERROR("Failed to open font file %ls", (path / fntName).string().c_str()); |
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | std::istringstream FNTStream(std::string((const char*)buf.get(), size)); |
… |
… |
bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)
|
68 | 68 | FNTStream >> Version; |
69 | 69 | if (Version != 101) // Make sure this is from a recent version of the font builder |
70 | 70 | { |
71 | | LOGERROR(L"Font %hs has invalid version", fontName.c_str()); |
| 71 | LOGERROR("Font %hs has invalid version", fontName.c_str()); |
72 | 72 | return 0; |
73 | 73 | } |
74 | 74 | |
… |
… |
bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)
|
102 | 102 | |
103 | 103 | if (Codepoint < 0 || Codepoint > 0xFFFF) |
104 | 104 | { |
105 | | LOGWARNING(L"Font %hs has invalid codepoint 0x%x", fontName.c_str(), Codepoint); |
| 105 | LOGWARNING("Font %hs has invalid codepoint 0x%x", fontName.c_str(), Codepoint); |
106 | 106 | continue; |
107 | 107 | } |
108 | 108 | |
-
diff --git a/source/graphics/LOSTexture.cpp b/source/graphics/LOSTexture.cpp
index 2bde7bb..ce6e136 100644
a
|
b
|
bool CLOSTexture::CreateShader()
|
82 | 82 | |
83 | 83 | if (!m_ShaderInitialized) |
84 | 84 | { |
85 | | LOGERROR(L"Failed to load SmoothLOS shader, disabling."); |
| 85 | LOGERROR("Failed to load SmoothLOS shader, disabling."); |
86 | 86 | g_Renderer.m_Options.m_SmoothLOS = false; |
87 | 87 | return false; |
88 | 88 | } |
… |
… |
void CLOSTexture::InterpolateLOS()
|
163 | 163 | GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
164 | 164 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
165 | 165 | { |
166 | | LOGWARNING(L"LOS framebuffer object incomplete: 0x%04X", status); |
| 166 | LOGWARNING("LOS framebuffer object incomplete: 0x%04X", status); |
167 | 167 | } |
168 | 168 | |
169 | 169 | m_smoothShader->BeginPass(); |
-
diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp
index 780ca79..2e7a14d 100644
a
|
b
|
bool CMapGeneratorWorker::Run()
|
111 | 111 | JS::RootedValue settingsVal(cx); |
112 | 112 | if (!m_ScriptInterface->ParseJSON(m_Settings, &settingsVal) && settingsVal.isUndefined()) |
113 | 113 | { |
114 | | LOGERROR(L"CMapGeneratorWorker::Run: Failed to parse settings"); |
| 114 | LOGERROR("CMapGeneratorWorker::Run: Failed to parse settings"); |
115 | 115 | return false; |
116 | 116 | } |
117 | 117 | |
… |
… |
bool CMapGeneratorWorker::Run()
|
119 | 119 | u32 seed; |
120 | 120 | if (!m_ScriptInterface->GetProperty(settingsVal, "Seed", seed)) |
121 | 121 | { // No seed specified |
122 | | LOGWARNING(L"CMapGeneratorWorker::Run: No seed value specified - using 0"); |
| 122 | LOGWARNING("CMapGeneratorWorker::Run: No seed value specified - using 0"); |
123 | 123 | seed = 0; |
124 | 124 | } |
125 | 125 | |
… |
… |
bool CMapGeneratorWorker::Run()
|
129 | 129 | JS::RootedValue global(cx, m_ScriptInterface->GetGlobalObject()); |
130 | 130 | if (!m_ScriptInterface->SetProperty(global, "g_MapSettings", settingsVal)) |
131 | 131 | { |
132 | | LOGERROR(L"CMapGeneratorWorker::Run: Failed to define g_MapSettings"); |
| 132 | LOGERROR("CMapGeneratorWorker::Run: Failed to define g_MapSettings"); |
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
136 | 136 | // Load RMS |
137 | | LOGMESSAGE(L"Loading RMS '%ls'", m_ScriptPath.string().c_str()); |
| 137 | LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string().c_str()); |
138 | 138 | if (!m_ScriptInterface->LoadGlobalScriptFile(m_ScriptPath)) |
139 | 139 | { |
140 | | LOGERROR(L"CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string().c_str()); |
| 140 | LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string().c_str()); |
141 | 141 | return false; |
142 | 142 | } |
143 | 143 | |
… |
… |
std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv
|
210 | 210 | PSRETURN ret = file.Load(g_VFS, *it); |
211 | 211 | if (ret != PSRETURN_OK) |
212 | 212 | { |
213 | | LOGERROR(L"CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 213 | LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
214 | 214 | } |
215 | 215 | else |
216 | 216 | { |
… |
… |
std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv
|
222 | 222 | { |
223 | 223 | // Some error reading directory |
224 | 224 | wchar_t error[200]; |
225 | | LOGERROR(L"CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 225 | LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
226 | 226 | } |
227 | 227 | |
228 | 228 | return data; |
… |
… |
CParamNode CMapGeneratorWorker::GetTemplate(ScriptInterface::CxPrivate* pCxPriva
|
234 | 234 | CMapGeneratorWorker* self = static_cast<CMapGeneratorWorker*>(pCxPrivate->pCBData); |
235 | 235 | const CParamNode& templateRoot = self->m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity"); |
236 | 236 | if (!templateRoot.IsOk()) |
237 | | LOGERROR(L"Invalid template found for '%hs'", templateName.c_str()); |
| 237 | LOGERROR("Invalid template found for '%hs'", templateName.c_str()); |
238 | 238 | |
239 | 239 | return templateRoot; |
240 | 240 | } |
… |
… |
bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)
|
271 | 271 | { |
272 | 272 | for (VfsPaths::iterator it = pathnames.begin(); it != pathnames.end(); ++it) |
273 | 273 | { |
274 | | LOGMESSAGE(L"Loading map generator script '%ls'", it->string().c_str()); |
| 274 | LOGMESSAGE("Loading map generator script '%ls'", it->string().c_str()); |
275 | 275 | |
276 | 276 | if (!m_ScriptInterface->LoadGlobalScriptFile(*it)) |
277 | 277 | { |
278 | | LOGERROR(L"CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string().c_str()); |
| 278 | LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string().c_str()); |
279 | 279 | return false; |
280 | 280 | } |
281 | 281 | } |
… |
… |
bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)
|
284 | 284 | { |
285 | 285 | // Some error reading directory |
286 | 286 | wchar_t error[200]; |
287 | | LOGERROR(L"CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 287 | LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
288 | 288 | return false; |
289 | 289 | } |
290 | 290 | |
-
diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp
index 090b70e..c6dccd0 100644
a
|
b
|
int CXMLReader::ReadEntities(XMBElement parent, double end_time)
|
1052 | 1052 | entity_id_t player = cmpPlayerManager->GetPlayerByID(PlayerID); |
1053 | 1053 | if (ent == INVALID_ENTITY || player == INVALID_ENTITY) |
1054 | 1054 | { // Don't add entities with invalid player IDs |
1055 | | LOGERROR(L"Failed to load entity template '%ls'", TemplateName.c_str()); |
| 1055 | LOGERROR("Failed to load entity template '%ls'", TemplateName.c_str()); |
1056 | 1056 | } |
1057 | 1057 | else |
1058 | 1058 | { |
… |
… |
int CMapReader::ParseTerrain()
|
1332 | 1332 | // an error here should stop the loading process |
1333 | 1333 | #define GET_TERRAIN_PROPERTY(val, prop, out)\ |
1334 | 1334 | if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\ |
1335 | | { LOGERROR(L"CMapReader::ParseTerrain() failed to get '%hs' property", #prop);\ |
| 1335 | { LOGERROR("CMapReader::ParseTerrain() failed to get '%hs' property", #prop);\ |
1336 | 1336 | throw PSERROR_Game_World_MapLoadFailed("Error parsing terrain data.\nCheck application log for details"); } |
1337 | 1337 | |
1338 | 1338 | JS::RootedValue tmpMapData(cx, m_MapData.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade |
… |
… |
int CMapReader::ParseEntities()
|
1411 | 1411 | std::vector<Entity> entities; |
1412 | 1412 | |
1413 | 1413 | if (!pSimulation2->GetScriptInterface().GetProperty(tmpMapData, "entities", entities)) |
1414 | | LOGWARNING(L"CMapReader::ParseEntities() failed to get 'entities' property"); |
| 1414 | LOGWARNING("CMapReader::ParseEntities() failed to get 'entities' property"); |
1415 | 1415 | |
1416 | 1416 | CSimulation2& sim = *pSimulation2; |
1417 | 1417 | CmpPtr<ICmpPlayerManager> cmpPlayerManager(sim, SYSTEM_ENTITY); |
… |
… |
int CMapReader::ParseEntities()
|
1430 | 1430 | entity_id_t player = cmpPlayerManager->GetPlayerByID(currEnt.playerID); |
1431 | 1431 | if (ent == INVALID_ENTITY || player == INVALID_ENTITY) |
1432 | 1432 | { // Don't add entities with invalid player IDs |
1433 | | LOGERROR(L"Failed to load entity template '%ls'", currEnt.templateName.c_str()); |
| 1433 | LOGERROR("Failed to load entity template '%ls'", currEnt.templateName.c_str()); |
1434 | 1434 | } |
1435 | 1435 | else |
1436 | 1436 | { |
… |
… |
int CMapReader::ParseEnvironment()
|
1476 | 1476 | |
1477 | 1477 | #define GET_ENVIRONMENT_PROPERTY(val, prop, out)\ |
1478 | 1478 | if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\ |
1479 | | LOGWARNING(L"CMapReader::ParseEnvironment() failed to get '%hs' property", #prop); |
| 1479 | LOGWARNING("CMapReader::ParseEnvironment() failed to get '%hs' property", #prop); |
1480 | 1480 | |
1481 | 1481 | JS::RootedValue envObj(cx); |
1482 | 1482 | GET_ENVIRONMENT_PROPERTY(tmpMapData, Environment, &envObj) |
1483 | 1483 | |
1484 | 1484 | if (envObj.isUndefined()) |
1485 | 1485 | { |
1486 | | LOGWARNING(L"CMapReader::ParseEnvironment(): Environment settings not found"); |
| 1486 | LOGWARNING("CMapReader::ParseEnvironment(): Environment settings not found"); |
1487 | 1487 | return 0; |
1488 | 1488 | } |
1489 | 1489 | |
… |
… |
int CMapReader::ParseCamera()
|
1581 | 1581 | |
1582 | 1582 | #define GET_CAMERA_PROPERTY(val, prop, out)\ |
1583 | 1583 | if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\ |
1584 | | LOGWARNING(L"CMapReader::ParseCamera() failed to get '%hs' property", #prop); |
| 1584 | LOGWARNING("CMapReader::ParseCamera() failed to get '%hs' property", #prop); |
1585 | 1585 | |
1586 | 1586 | JS::RootedValue tmpMapData(cx, m_MapData.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade |
1587 | 1587 | JS::RootedValue cameraObj(cx); |
-
diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp
index 6b00443..be1c778 100644
a
|
b
|
void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain,
|
71 | 71 | } |
72 | 72 | catch (PSERROR_File_WriteFailed&) |
73 | 73 | { |
74 | | LOGERROR(L"Failed to write map '%ls'", pathname.string().c_str()); |
| 74 | LOGERROR("Failed to write map '%ls'", pathname.string().c_str()); |
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
… |
… |
void CMapWriter::WriteXML(const VfsPath& filename,
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | if (!XML_StoreVFS(g_VFS, filename)) |
450 | | LOGERROR(L"Failed to write map '%ls'", filename.string().c_str()); |
| 450 | LOGERROR("Failed to write map '%ls'", filename.string().c_str()); |
451 | 451 | } |
-
diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp
index 0a827d0..3f0fda9 100644
a
|
b
|
CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
|
53 | 53 | |
54 | 54 | if (pmdFilename.empty()) |
55 | 55 | { |
56 | | LOGERROR(L"Could not load mesh '%ls'", pathname.string().c_str()); |
| 56 | LOGERROR("Could not load mesh '%ls'", pathname.string().c_str()); |
57 | 57 | return CModelDefPtr(); |
58 | 58 | } |
59 | 59 | |
… |
… |
CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
|
65 | 65 | } |
66 | 66 | catch (PSERROR_File&) |
67 | 67 | { |
68 | | LOGERROR(L"Could not load mesh '%ls'", pmdFilename.string().c_str()); |
| 68 | LOGERROR("Could not load mesh '%ls'", pmdFilename.string().c_str()); |
69 | 69 | return CModelDefPtr(); |
70 | 70 | } |
71 | 71 | } |
-
diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp
index 127bbd5..c4bb532 100644
a
|
b
|
bool CModel::SetAnimation(CSkeletonAnim* anim, bool once)
|
473 | 473 | if (anim->m_AnimDef && anim->m_AnimDef->GetNumKeys() != m_pModelDef->GetNumBones()) |
474 | 474 | { |
475 | 475 | // mismatch between model's skeleton and animation's skeleton |
476 | | LOGERROR(L"Mismatch between model's skeleton and animation's skeleton (%lu model bones != %lu animation keys)", |
| 476 | LOGERROR("Mismatch between model's skeleton and animation's skeleton (%lu model bones != %lu animation keys)", |
477 | 477 | (unsigned long)m_pModelDef->GetNumBones(), (unsigned long)anim->m_AnimDef->GetNumKeys()); |
478 | 478 | return false; |
479 | 479 | } |
-
diff --git a/source/graphics/ModelAbstract.cpp b/source/graphics/ModelAbstract.cpp
index aa56125..769de5d 100644
a
|
b
|
void CModelAbstract::CalcSelectionBox()
|
57 | 57 | { |
58 | 58 | // TODO: unimplemented |
59 | 59 | m_SelectionBox.SetEmpty(); |
60 | | LOGWARNING(L"[ModelAbstract] TODO: Cylinder selection boxes are not yet implemented. Use BOX or BOUNDS selection shapes instead."); |
| 60 | LOGWARNING("[ModelAbstract] TODO: Cylinder selection boxes are not yet implemented. Use BOX or BOUNDS selection shapes instead."); |
61 | 61 | } |
62 | 62 | break; |
63 | 63 | default: |
64 | 64 | { |
65 | 65 | m_SelectionBox.SetEmpty(); |
66 | | //LOGWARNING(L"[ModelAbstract] Unrecognized selection shape type: %ld", m_CustomSelectionShape->m_Type); |
| 66 | //LOGWARNING("[ModelAbstract] Unrecognized selection shape type: %ld", m_CustomSelectionShape->m_Type); |
67 | 67 | debug_warn("[ModelAbstract] Unrecognized selection shape type"); |
68 | 68 | } |
69 | 69 | break; |
-
diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp
index f55ff9a..2270005 100644
a
|
b
|
bool CObjectBase::Load(const VfsPath& pathname)
|
90 | 90 | |
91 | 91 | if (root.GetNodeName() != el_actor) |
92 | 92 | { |
93 | | LOGERROR(L"Invalid actor format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); |
| 93 | LOGERROR("Invalid actor format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); |
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | |
… |
… |
bool CObjectBase::Load(const VfsPath& pathname)
|
266 | 266 | |
267 | 267 | if (currentGroup->size() == 0) |
268 | 268 | { |
269 | | LOGERROR(L"Actor group has zero variants ('%ls')", pathname.string().c_str()); |
| 269 | LOGERROR("Actor group has zero variants ('%ls')", pathname.string().c_str()); |
270 | 270 | } |
271 | 271 | |
272 | 272 | ++currentGroup; |
-
diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp
index 16b4e48..d9838dc 100644
a
|
b
|
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
73 | 73 | str << variation.color; |
74 | 74 | int r, g, b; |
75 | 75 | if (! (str >> r >> g >> b)) // Any trailing data is ignored |
76 | | LOGERROR(L"Actor '%ls' has invalid RGB colour '%hs'", m_Base->m_ShortName.c_str(), variation.color.c_str()); |
| 76 | LOGERROR("Actor '%ls' has invalid RGB colour '%hs'", m_Base->m_ShortName.c_str(), variation.color.c_str()); |
77 | 77 | else |
78 | 78 | m_Color = CColor(r/255.0f, g/255.0f, b/255.0f, 1.0f); |
79 | 79 | } |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
119 | 119 | CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName)); |
120 | 120 | if (!modeldef) |
121 | 121 | { |
122 | | LOGERROR(L"CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string().c_str()); |
| 122 | LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string().c_str()); |
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
133 | 133 | |
134 | 134 | if (m_Samplers.size() == 0) |
135 | 135 | { |
136 | | LOGERROR(L"Actor '%ls' has no textures.", m_Base->m_ShortName.c_str()); |
| 136 | LOGERROR("Actor '%ls' has no textures.", m_Base->m_ShortName.c_str()); |
137 | 137 | } |
138 | 138 | |
139 | 139 | std::vector<CObjectBase::Samp>::iterator samp; |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
190 | 190 | { |
191 | 191 | // start up idling |
192 | 192 | if (!model->SetAnimation(GetRandomAnimation("idle"))) |
193 | | LOGERROR(L"Failed to set idle animation in model \"%ls\"", m_ModelName.string().c_str()); |
| 193 | LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string().c_str()); |
194 | 194 | } |
195 | 195 | |
196 | 196 | // build props - TODO, RC - need to fix up bounds here |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
209 | 209 | CObjectEntry* oe = objectManager.FindObjectVariation(prop.m_ModelName.c_str(), selections); |
210 | 210 | if (!oe) |
211 | 211 | { |
212 | | LOGERROR(L"Failed to build prop model \"%ls\" on actor \"%ls\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str()); |
| 212 | LOGERROR("Failed to build prop model \"%ls\" on actor \"%ls\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str()); |
213 | 213 | continue; |
214 | 214 | } |
215 | 215 | |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
240 | 240 | propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle")); |
241 | 241 | } |
242 | 242 | else |
243 | | LOGERROR(L"Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string().c_str(), m_Base->m_ShortName.c_str()); |
| 243 | LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string().c_str(), m_Base->m_ShortName.c_str()); |
244 | 244 | } |
245 | 245 | |
246 | 246 | // setup flags |
-
diff --git a/source/graphics/ObjectManager.cpp b/source/graphics/ObjectManager.cpp
index b8bd6b8..8101364 100644
a
|
b
|
CObjectBase* CObjectManager::FindObjectBase(const CStrW& objectname)
|
96 | 96 | else |
97 | 97 | delete obj; |
98 | 98 | |
99 | | LOGERROR(L"CObjectManager::FindObjectBase(): Cannot find object '%ls'", objectname.c_str()); |
| 99 | LOGERROR("CObjectManager::FindObjectBase(): Cannot find object '%ls'", objectname.c_str()); |
100 | 100 | |
101 | 101 | return 0; |
102 | 102 | } |
-
diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp
index 657feed..7ecd403 100644
a
|
b
|
int CParticleEmitterType::GetVariableID(const std::string& name)
|
329 | 329 | if (name == "color.r") return VAR_COLOR_R; |
330 | 330 | if (name == "color.g") return VAR_COLOR_G; |
331 | 331 | if (name == "color.b") return VAR_COLOR_B; |
332 | | LOGWARNING(L"Particle sets unknown variable '%hs'", name.c_str()); |
| 332 | LOGWARNING("Particle sets unknown variable '%hs'", name.c_str()); |
333 | 333 | return -1; |
334 | 334 | } |
335 | 335 | |
-
diff --git a/source/graphics/ShaderManager.cpp b/source/graphics/ShaderManager.cpp
index 929123c..dcb3f1c 100644
a
|
b
|
CShaderManager::CShaderManager()
|
49 | 49 | TIMER_ACCRUE(tc_ShaderValidation); |
50 | 50 | CVFSFile grammar; |
51 | 51 | if (grammar.Load(g_VFS, L"shaders/program.rng") != PSRETURN_OK) |
52 | | LOGERROR(L"Failed to read grammar shaders/program.rng"); |
| 52 | LOGERROR("Failed to read grammar shaders/program.rng"); |
53 | 53 | else |
54 | 54 | { |
55 | 55 | if (!m_Validator.LoadGrammar(grammar.GetAsString())) |
56 | | LOGERROR(L"Failed to load grammar shaders/program.rng"); |
| 56 | LOGERROR("Failed to load grammar shaders/program.rng"); |
57 | 57 | } |
58 | 58 | } |
59 | 59 | #endif |
… |
… |
CShaderProgramPtr CShaderManager::LoadProgram(const char* name, const CShaderDef
|
77 | 77 | CShaderProgramPtr program; |
78 | 78 | if (!NewProgram(name, defines, program)) |
79 | 79 | { |
80 | | LOGERROR(L"Failed to load shader '%hs'", name); |
| 80 | LOGERROR("Failed to load shader '%hs'", name); |
81 | 81 | program = CShaderProgramPtr(); |
82 | 82 | } |
83 | 83 | |
… |
… |
CShaderTechniquePtr CShaderManager::LoadEffect(CStrIntern name, const CShaderDef
|
378 | 378 | CShaderTechniquePtr tech(new CShaderTechnique()); |
379 | 379 | if (!NewEffect(name.c_str(), defines, tech)) |
380 | 380 | { |
381 | | LOGERROR(L"Failed to load effect '%hs'", name.c_str()); |
| 381 | LOGERROR("Failed to load effect '%hs'", name.c_str()); |
382 | 382 | tech = CShaderTechniquePtr(); |
383 | 383 | } |
384 | 384 | |
-
diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp
index 817ff41..82e7140 100644
a
|
b
|
public:
|
71 | 71 | glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); |
72 | 72 | int errLine = std::count(code.begin(), code.begin() + std::min((int)code.length(), errPos + 1), '\n') + 1; |
73 | 73 | char* errStr = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB); |
74 | | LOGERROR(L"Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string().c_str(), errLine, errStr); |
| 74 | LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string().c_str(), errLine, errStr); |
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
… |
… |
public:
|
310 | 310 | pglGetShaderInfoLog(shader, length, NULL, infolog); |
311 | 311 | |
312 | 312 | if (ok) |
313 | | LOGMESSAGE(L"Info when compiling shader '%ls':\n%hs", file.string().c_str(), infolog); |
| 313 | LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string().c_str(), infolog); |
314 | 314 | else |
315 | | LOGERROR(L"Failed to compile shader '%ls':\n%hs", file.string().c_str(), infolog); |
| 315 | LOGERROR("Failed to compile shader '%ls':\n%hs", file.string().c_str(), infolog); |
316 | 316 | |
317 | 317 | delete[] infolog; |
318 | 318 | } |
… |
… |
public:
|
357 | 357 | pglGetProgramInfoLog(m_Program, length, NULL, infolog); |
358 | 358 | |
359 | 359 | if (ok) |
360 | | LOGMESSAGE(L"Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); |
| 360 | LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); |
361 | 361 | else |
362 | | LOGERROR(L"Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); |
| 362 | LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); |
363 | 363 | |
364 | 364 | delete[] infolog; |
365 | 365 | } |
… |
… |
public:
|
561 | 561 | else if (id.second == GL_FLOAT_VEC4) |
562 | 562 | pglUniform4fARB(id.first, v0, v1, v2, v3); |
563 | 563 | else |
564 | | LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected float, vec2, vec3, vec4)"); |
| 564 | LOGERROR("CShaderProgramGLSL::Uniform(): Invalid uniform type (expected float, vec2, vec3, vec4)"); |
565 | 565 | } |
566 | 566 | } |
567 | 567 | |
… |
… |
public:
|
572 | 572 | if (id.second == GL_FLOAT_MAT4) |
573 | 573 | pglUniformMatrix4fvARB(id.first, 1, GL_FALSE, &v._11); |
574 | 574 | else |
575 | | LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); |
| 575 | LOGERROR("CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); |
576 | 576 | } |
577 | 577 | } |
578 | 578 | |
… |
… |
public:
|
583 | 583 | if (id.second == GL_FLOAT_MAT4) |
584 | 584 | pglUniformMatrix4fvARB(id.first, count, GL_FALSE, &v->_11); |
585 | 585 | else |
586 | | LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); |
| 586 | LOGERROR("CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); |
587 | 587 | } |
588 | 588 | } |
589 | 589 | |
… |
… |
CShaderProgram::CShaderProgram(int streamflags)
|
663 | 663 | const std::map<CStrIntern, int>& UNUSED(vertexIndexes), const std::map<CStrIntern, frag_index_pair_t>& UNUSED(fragmentIndexes), |
664 | 664 | int UNUSED(streamflags)) |
665 | 665 | { |
666 | | LOGERROR(L"CShaderProgram::ConstructARB: '%ls'+'%ls': ARB shaders not supported on this device", |
| 666 | LOGERROR("CShaderProgram::ConstructARB: '%ls'+'%ls': ARB shaders not supported on this device", |
667 | 667 | vertexFile.string().c_str(), fragmentFile.string().c_str()); |
668 | 668 | return NULL; |
669 | 669 | } |
-
diff --git a/source/graphics/ShaderProgramFFP.cpp b/source/graphics/ShaderProgramFFP.cpp
index a3ec42b..771bdd5 100644
a
|
b
|
public:
|
1159 | 1159 | if (id == "model_solid_tex") |
1160 | 1160 | return new CShaderProgramFFP_ModelSolidTex(defines); |
1161 | 1161 | |
1162 | | LOGERROR(L"CShaderProgram::ConstructFFP: '%hs': Invalid id", id.c_str()); |
| 1162 | LOGERROR("CShaderProgram::ConstructFFP: '%hs': Invalid id", id.c_str()); |
1163 | 1163 | debug_warn(L"CShaderProgram::ConstructFFP: Invalid id"); |
1164 | 1164 | return NULL; |
1165 | 1165 | } |
-
diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp
index 80bb336..2d99118 100644
a
|
b
|
CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
65 | 65 | |
66 | 66 | if (psaFilename.empty()) |
67 | 67 | { |
68 | | LOGERROR(L"Could not load animation '%ls'", pathname.string().c_str()); |
| 68 | LOGERROR("Could not load animation '%ls'", pathname.string().c_str()); |
69 | 69 | def = NULL; |
70 | 70 | } |
71 | 71 | else |
… |
… |
CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
76 | 76 | } |
77 | 77 | catch (PSERROR_File&) |
78 | 78 | { |
79 | | LOGERROR(L"Could not load animation '%ls'", psaFilename.string().c_str()); |
| 79 | LOGERROR("Could not load animation '%ls'", psaFilename.string().c_str()); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | if (def) |
84 | | LOGMESSAGE(L"CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str()); |
| 84 | LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str()); |
85 | 85 | else |
86 | | LOGERROR(L"CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str()); |
| 86 | LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str()); |
87 | 87 | |
88 | 88 | // Add to map |
89 | 89 | m_Animations[name] = def; // NULL if failed to load - we won't try loading it again |
-
diff --git a/source/graphics/TerrainTextureEntry.cpp b/source/graphics/TerrainTextureEntry.cpp
index 7429dce..a15b043 100644
a
|
b
|
CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
47 | 47 | CXeromyces XeroFile; |
48 | 48 | if (XeroFile.Load(g_VFS, path) != PSRETURN_OK) |
49 | 49 | { |
50 | | LOGERROR(L"Terrain xml not found (%hs)", path.string().c_str()); |
| 50 | LOGERROR("Terrain xml not found (%hs)", path.string().c_str()); |
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
… |
… |
CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
70 | 70 | |
71 | 71 | if (root.GetNodeName() != el_terrain) |
72 | 72 | { |
73 | | LOGERROR(L"Invalid terrain format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); |
| 73 | LOGERROR("Invalid terrain format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); |
74 | 74 | return; |
75 | 75 | } |
76 | 76 | |
-
diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp
index 5913c10..7add3d5 100644
a
|
b
|
CTerrainTextureEntry* CTerrainTextureManager::FindTexture(const CStr& tag_)
|
89 | 89 | return m_TextureEntries[i]; |
90 | 90 | } |
91 | 91 | |
92 | | LOGWARNING(L"CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str()); |
| 92 | LOGWARNING("CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str()); |
93 | 93 | return 0; |
94 | 94 | } |
95 | 95 | |
… |
… |
void CTerrainTextureManager::LoadTextures(const CTerrainPropertiesPtr& props, co
|
141 | 141 | |
142 | 142 | void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& parentProps, const VfsPath& path) |
143 | 143 | { |
144 | | //LOGMESSAGE(L"CTextureManager::RecurseDirectory(%ls)", path.string().c_str()); |
| 144 | //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string().c_str()); |
145 | 145 | |
146 | 146 | CTerrainPropertiesPtr props; |
147 | 147 | |
… |
… |
void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& paren
|
153 | 153 | // No terrains.xml, or read failures -> use parent props (i.e. |
154 | 154 | if (!props) |
155 | 155 | { |
156 | | LOGMESSAGE(L"CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string().c_str()); |
| 156 | LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string().c_str()); |
157 | 157 | props = parentProps; |
158 | 158 | } |
159 | 159 | |
-
diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp
index aadca03..a855587 100644
a
|
b
|
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
120 | 120 | |
121 | 121 | if (root.GetNodeName() != el_textures) |
122 | 122 | { |
123 | | LOGERROR(L"Invalid texture settings file \"%ls\" (unrecognised root element)", path.string().c_str()); |
| 123 | LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string().c_str()); |
124 | 124 | return NULL; |
125 | 125 | } |
126 | 126 | |
… |
… |
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
152 | 152 | else if (v == "alpha") |
153 | 153 | p.settings.format = FMT_ALPHA; |
154 | 154 | else |
155 | | LOGERROR(L"Invalid attribute value <file format='%hs'>", v.c_str()); |
| 155 | LOGERROR("Invalid attribute value <file format='%hs'>", v.c_str()); |
156 | 156 | } |
157 | 157 | else if (attr.Name == at_mipmap) |
158 | 158 | { |
… |
… |
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
162 | 162 | else if (v == "false") |
163 | 163 | p.settings.mipmap = MIP_FALSE; |
164 | 164 | else |
165 | | LOGERROR(L"Invalid attribute value <file mipmap='%hs'>", v.c_str()); |
| 165 | LOGERROR("Invalid attribute value <file mipmap='%hs'>", v.c_str()); |
166 | 166 | } |
167 | 167 | else if (attr.Name == at_normal) |
168 | 168 | { |
… |
… |
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
172 | 172 | else if (v == "false") |
173 | 173 | p.settings.normal = NORMAL_FALSE; |
174 | 174 | else |
175 | | LOGERROR(L"Invalid attribute value <file normal='%hs'>", v.c_str()); |
| 175 | LOGERROR("Invalid attribute value <file normal='%hs'>", v.c_str()); |
176 | 176 | } |
177 | 177 | else if (attr.Name == at_alpha) |
178 | 178 | { |
… |
… |
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
184 | 184 | else if (v == "transparency") |
185 | 185 | p.settings.alpha = ALPHA_TRANSPARENCY; |
186 | 186 | else |
187 | | LOGERROR(L"Invalid attribute value <file alpha='%hs'>", v.c_str()); |
| 187 | LOGERROR("Invalid attribute value <file alpha='%hs'>", v.c_str()); |
188 | 188 | } |
189 | 189 | else if (attr.Name == at_filter) |
190 | 190 | { |
… |
… |
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
196 | 196 | else if (v == "kaiser") |
197 | 197 | p.settings.filter = FILTER_KAISER; |
198 | 198 | else |
199 | | LOGERROR(L"Invalid attribute value <file filter='%hs'>", v.c_str()); |
| 199 | LOGERROR("Invalid attribute value <file filter='%hs'>", v.c_str()); |
200 | 200 | } |
201 | 201 | else if (attr.Name == at_kaiserwidth) |
202 | 202 | { |
… |
… |
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
212 | 212 | } |
213 | 213 | else |
214 | 214 | { |
215 | | LOGERROR(L"Invalid attribute name <file %hs='...'>", XeroFile.GetAttributeString(attr.Name).c_str()); |
| 215 | LOGERROR("Invalid attribute name <file %hs='...'>", XeroFile.GetAttributeString(attr.Name).c_str()); |
216 | 216 | } |
217 | 217 | } |
218 | 218 | |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
326 | 326 | size_t fileSize; |
327 | 327 | if (m_VFS->LoadFile(src, file, fileSize) < 0) |
328 | 328 | { |
329 | | LOGERROR(L"Failed to load texture \"%ls\"", src.string().c_str()); |
| 329 | LOGERROR("Failed to load texture \"%ls\"", src.string().c_str()); |
330 | 330 | return false; |
331 | 331 | } |
332 | 332 | |
333 | 333 | Tex tex; |
334 | 334 | if (tex.decode(file, fileSize) < 0) |
335 | 335 | { |
336 | | LOGERROR(L"Failed to decode texture \"%ls\"", src.string().c_str()); |
| 336 | LOGERROR("Failed to decode texture \"%ls\"", src.string().c_str()); |
337 | 337 | return false; |
338 | 338 | } |
339 | 339 | |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
345 | 345 | // Convert to uncompressed 8-bit with no mipmaps |
346 | 346 | if (tex.transform_to((tex.m_Flags | TEX_GREY) & ~(TEX_DXT | TEX_MIPMAPS | TEX_ALPHA)) < 0) |
347 | 347 | { |
348 | | LOGERROR(L"Failed to transform texture \"%ls\"", src.string().c_str()); |
| 348 | LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str()); |
349 | 349 | return false; |
350 | 350 | } |
351 | 351 | } |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
356 | 356 | // (plain_transform doesn't know how to construct the alpha channel) |
357 | 357 | if (tex.m_Flags & TEX_GREY) |
358 | 358 | { |
359 | | LOGERROR(L"Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string().c_str()); |
| 359 | LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string().c_str()); |
360 | 360 | return false; |
361 | 361 | } |
362 | 362 | |
363 | 363 | // Convert to uncompressed BGRA with no mipmaps |
364 | 364 | if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0) |
365 | 365 | { |
366 | | LOGERROR(L"Failed to transform texture \"%ls\"", src.string().c_str()); |
| 366 | LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str()); |
367 | 367 | return false; |
368 | 368 | } |
369 | 369 | } |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
482 | 482 | return true; |
483 | 483 | |
484 | 484 | #else |
485 | | LOGERROR(L"Failed to convert texture \"%ls\" (NVTT not available)", src.string().c_str()); |
| 485 | LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string().c_str()); |
486 | 486 | return false; |
487 | 487 | #endif |
488 | 488 | } |
-
diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp
index bfccc8b..33eff64 100644
a
|
b
|
public:
|
178 | 178 | Handle h = ogl_tex_load(m_VFS, path, RES_UNIQUE); |
179 | 179 | if (h <= 0) |
180 | 180 | { |
181 | | LOGERROR(L"Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 181 | LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
182 | 182 | |
183 | 183 | // Replace with error texture to make it obvious |
184 | 184 | texture->SetHandle(m_ErrorHandle); |
… |
… |
public:
|
218 | 218 | // Upload to GL |
219 | 219 | if (!m_DisableGL && ogl_tex_upload(h, texture->m_Properties.m_Format) < 0) |
220 | 220 | { |
221 | | LOGERROR(L"Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 221 | LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
222 | 222 | |
223 | 223 | ogl_tex_free(h); |
224 | 224 | |
… |
… |
public:
|
277 | 277 | |
278 | 278 | // No source file or archive cache was found, so we can't load the |
279 | 279 | // real texture at all - return the error texture instead |
280 | | LOGERROR(L"CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 280 | LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
281 | 281 | texture->SetHandle(m_ErrorHandle); |
282 | 282 | return true; |
283 | 283 | } |
… |
… |
public:
|
299 | 299 | PrepareCacheKey(texture, hash, version); |
300 | 300 | VfsPath looseCachePath = m_CacheLoader.LooseCachePath(sourcePath, hash, version); |
301 | 301 | |
302 | | // LOGWARNING(L"Converting texture \"%ls\"", srcPath.c_str()); |
| 302 | // LOGWARNING("Converting texture \"%ls\"", srcPath.c_str()); |
303 | 303 | |
304 | 304 | CTextureConverter::Settings settings = GetConverterSettings(texture); |
305 | 305 | |
… |
… |
public:
|
345 | 345 | } |
346 | 346 | else |
347 | 347 | { |
348 | | LOGERROR(L"Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 348 | LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
349 | 349 | texture->SetHandle(m_ErrorHandle); |
350 | 350 | } |
351 | 351 | texture->m_State = CTexture::LOADED; |
-
diff --git a/source/graphics/scripting/JSInterface_GameView.cpp b/source/graphics/scripting/JSInterface_GameView.cpp
index b5c0b13..22e1c7f 100644
a
|
b
|
bool JSI_GameView::Get##NAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPriv
|
28 | 28 | { \ |
29 | 29 | if (!g_Game || !g_Game->GetView()) \ |
30 | 30 | { \ |
31 | | LOGERROR(L"Trying to get a setting from GameView when it's not initialized!"); \ |
| 31 | LOGERROR("Trying to get a setting from GameView when it's not initialized!"); \ |
32 | 32 | return false; \ |
33 | 33 | } \ |
34 | 34 | return g_Game->GetView()->Get##NAME##Enabled(); \ |
… |
… |
void JSI_GameView::Set##NAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPriv
|
38 | 38 | { \ |
39 | 39 | if (!g_Game || !g_Game->GetView()) \ |
40 | 40 | { \ |
41 | | LOGERROR(L"Trying to set a setting of GameView when it's not initialized!"); \ |
| 41 | LOGERROR("Trying to set a setting of GameView when it's not initialized!"); \ |
42 | 42 | return; \ |
43 | 43 | } \ |
44 | 44 | g_Game->GetView()->Set##NAME##Enabled(Enabled); \ |
-
diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp
index 51e33f8..e32395b 100644
a
|
b
|
void CGUI::Draw()
|
380 | 380 | } |
381 | 381 | catch (PSERROR_GUI& e) |
382 | 382 | { |
383 | | LOGERROR(L"GUI draw error: %hs", e.what()); |
| 383 | LOGERROR("GUI draw error: %hs", e.what()); |
384 | 384 | } |
385 | 385 | } |
386 | 386 | |
… |
… |
void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& P
|
969 | 969 | } |
970 | 970 | catch (PSERROR_GUI& e) |
971 | 971 | { |
972 | | LOGERROR(L"Errors loading GUI file %ls (%u)", Filename.string().c_str(), e.getCode()); |
| 972 | LOGERROR("Errors loading GUI file %ls (%u)", Filename.string().c_str(), e.getCode()); |
973 | 973 | return; |
974 | 974 | } |
975 | 975 | } |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1091 | 1091 | if (!object) |
1092 | 1092 | { |
1093 | 1093 | // Report error that object was unsuccessfully loaded |
1094 | | LOGERROR(L"GUI: Unrecognized object type \"%hs\"", type.c_str()); |
| 1094 | LOGERROR("GUI: Unrecognized object type \"%hs\"", type.c_str()); |
1095 | 1095 | return; |
1096 | 1096 | } |
1097 | 1097 | |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1133 | 1133 | { |
1134 | 1134 | // additional check |
1135 | 1135 | if (m_Styles.count(argStyle) == 0) |
1136 | | LOGERROR(L"GUI: Trying to use style '%hs' that doesn't exist.", argStyle.c_str()); |
| 1136 | LOGERROR("GUI: Trying to use style '%hs' that doesn't exist.", argStyle.c_str()); |
1137 | 1137 | else |
1138 | 1138 | object->LoadStyle(*this, argStyle); |
1139 | 1139 | } |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1185 | 1185 | // Try setting the value |
1186 | 1186 | if (object->SetSetting(pFile->GetAttributeString(attr.Name), attr.Value.FromUTF8(), true) != PSRETURN_OK) |
1187 | 1187 | { |
1188 | | LOGERROR(L"GUI: (object: %hs) Can't set \"%hs\" to \"%ls\"", object->GetPresentableName().c_str(), pFile->GetAttributeString(attr.Name).c_str(), attr.Value.FromUTF8().c_str()); |
| 1188 | LOGERROR("GUI: (object: %hs) Can't set \"%hs\" to \"%ls\"", object->GetPresentableName().c_str(), pFile->GetAttributeString(attr.Name).c_str(), attr.Value.FromUTF8().c_str()); |
1189 | 1189 | |
1190 | 1190 | // This is not a fatal error |
1191 | 1191 | } |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1248 | 1248 | CVFSFile scriptfile; |
1249 | 1249 | if (scriptfile.Load(g_VFS, filename) != PSRETURN_OK) |
1250 | 1250 | { |
1251 | | LOGERROR(L"Error opening GUI script action file '%ls'", filename.c_str()); |
| 1251 | LOGERROR("Error opening GUI script action file '%ls'", filename.c_str()); |
1252 | 1252 | throw PSERROR_GUI_JSOpenFailed(); |
1253 | 1253 | } |
1254 | 1254 | |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1293 | 1293 | CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name. |
1294 | 1294 | if (attributeName.empty()) |
1295 | 1295 | { |
1296 | | LOGERROR(L"GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); |
| 1296 | LOGERROR("GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); |
1297 | 1297 | continue; |
1298 | 1298 | } |
1299 | 1299 | |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1320 | 1320 | CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name. |
1321 | 1321 | if (attributeName.empty()) |
1322 | 1322 | { |
1323 | | LOGERROR(L"GUI: ‘attribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); |
| 1323 | LOGERROR("GUI: ‘attribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); |
1324 | 1324 | continue; |
1325 | 1325 | } |
1326 | 1326 | |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1348 | 1348 | if (!filename.empty()) |
1349 | 1349 | { |
1350 | 1350 | if (!directory.empty()) |
1351 | | LOGWARNING(L"GUI: Include element found with file name (%ls) and directory name (%ls). Only the file will be processed.", filename.c_str(), directory.c_str()); |
| 1351 | LOGWARNING("GUI: Include element found with file name (%ls) and directory name (%ls). Only the file will be processed.", filename.c_str(), directory.c_str()); |
1352 | 1352 | |
1353 | 1353 | Paths.insert(filename); |
1354 | 1354 | |
1355 | 1355 | CXeromyces XeroIncluded; |
1356 | 1356 | if (XeroIncluded.Load(g_VFS, filename) != PSRETURN_OK) |
1357 | 1357 | { |
1358 | | LOGERROR(L"GUI: Error reading included XML: '%ls'", filename.c_str()); |
| 1358 | LOGERROR("GUI: Error reading included XML: '%ls'", filename.c_str()); |
1359 | 1359 | continue; |
1360 | 1360 | } |
1361 | 1361 | |
1362 | 1362 | XMBElement node = XeroIncluded.GetRoot(); |
1363 | 1363 | if (node.GetNodeName() != XeroIncluded.GetElementID("object")) |
1364 | 1364 | { |
1365 | | LOGERROR(L"GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", filename.c_str()); |
| 1365 | LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", filename.c_str()); |
1366 | 1366 | continue; |
1367 | 1367 | } |
1368 | 1368 | Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1); |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1379 | 1379 | CXeromyces XeroIncluded; |
1380 | 1380 | if (XeroIncluded.Load(g_VFS, *it) != PSRETURN_OK) |
1381 | 1381 | { |
1382 | | LOGERROR(L"GUI: Error reading included XML: '%ls'", (*it).string().c_str()); |
| 1382 | LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string().c_str()); |
1383 | 1383 | continue; |
1384 | 1384 | } |
1385 | 1385 | |
1386 | 1386 | XMBElement node = XeroIncluded.GetRoot(); |
1387 | 1387 | if (node.GetNodeName() != XeroIncluded.GetElementID("object")) |
1388 | 1388 | { |
1389 | | LOGERROR(L"GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string().c_str()); |
| 1389 | LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string().c_str()); |
1390 | 1390 | continue; |
1391 | 1391 | } |
1392 | 1392 | Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1); |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1394 | 1394 | |
1395 | 1395 | } |
1396 | 1396 | else |
1397 | | LOGERROR(L"GUI: 'include' XML element must have valid 'file' or 'directory' attribute found. (object %hs)", object->GetPresentableName().c_str()); |
| 1397 | LOGERROR("GUI: 'include' XML element must have valid 'file' or 'directory' attribute found. (object %hs)", object->GetPresentableName().c_str()); |
1398 | 1398 | } |
1399 | 1399 | else |
1400 | 1400 | { |
1401 | 1401 | // Try making the object read the tag. |
1402 | 1402 | if (!object->HandleAdditionalChildren(child, pFile)) |
1403 | 1403 | { |
1404 | | LOGERROR(L"GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str()); |
| 1404 | LOGERROR("GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str()); |
1405 | 1405 | } |
1406 | 1406 | } |
1407 | 1407 | } |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1442 | 1442 | } |
1443 | 1443 | catch (PSERROR_GUI& e) |
1444 | 1444 | { |
1445 | | LOGERROR(L"GUI error: %hs", e.what()); |
| 1445 | LOGERROR("GUI error: %hs", e.what()); |
1446 | 1446 | } |
1447 | 1447 | } |
1448 | 1448 | |
… |
… |
void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
1491 | 1491 | } |
1492 | 1492 | catch (PSERROR_Scripting& e) |
1493 | 1493 | { |
1494 | | LOGERROR(L"GUI: Error executing script %ls: %hs", file.c_str(), e.what()); |
| 1494 | LOGERROR("GUI: Error executing script %ls: %hs", file.c_str(), e.what()); |
1495 | 1495 | } |
1496 | 1496 | } |
1497 | 1497 | |
… |
… |
void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
1512 | 1512 | } |
1513 | 1513 | catch (PSERROR_Scripting& e) |
1514 | 1514 | { |
1515 | | LOGERROR(L"GUI: Error executing script %ls: %hs", (*it).string().c_str(), e.what()); |
| 1515 | LOGERROR("GUI: Error executing script %ls: %hs", (*it).string().c_str(), e.what()); |
1516 | 1516 | } |
1517 | 1517 | } |
1518 | 1518 | } |
… |
… |
void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
1527 | 1527 | } |
1528 | 1528 | catch (PSERROR_Scripting& e) |
1529 | 1529 | { |
1530 | | LOGERROR(L"GUI: Error executing inline script: %hs", e.what()); |
| 1530 | LOGERROR("GUI: Error executing inline script: %hs", e.what()); |
1531 | 1531 | } |
1532 | 1532 | } |
1533 | 1533 | |
… |
… |
void CGUI::Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile)
|
1547 | 1547 | name = Element.GetAttributes().GetNamedItem( pFile->GetAttributeID("name") ); |
1548 | 1548 | |
1549 | 1549 | if (m_Sprites.find(name) != m_Sprites.end()) |
1550 | | LOGWARNING(L"GUI sprite name '%hs' used more than once; first definition will be discarded", name.c_str()); |
| 1550 | LOGWARNING("GUI sprite name '%hs' used more than once; first definition will be discarded", name.c_str()); |
1551 | 1551 | |
1552 | 1552 | // |
1553 | 1553 | // Read Children (the images) |
… |
… |
void CGUI::Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile)
|
1573 | 1573 | { |
1574 | 1574 | if (effects) |
1575 | 1575 | { |
1576 | | LOGERROR(L"GUI <sprite> must not have more than one <effect>"); |
| 1576 | LOGERROR("GUI <sprite> must not have more than one <effect>"); |
1577 | 1577 | } |
1578 | 1578 | else |
1579 | 1579 | { |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1636 | 1636 | { |
1637 | 1637 | CClientArea ca; |
1638 | 1638 | if (!GUI<CClientArea>::ParseString(attr_value, ca)) |
1639 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1639 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1640 | 1640 | else Image->m_Size = ca; |
1641 | 1641 | } |
1642 | 1642 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1644 | 1644 | { |
1645 | 1645 | CClientArea ca; |
1646 | 1646 | if (!GUI<CClientArea>::ParseString(attr_value, ca)) |
1647 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1647 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1648 | 1648 | else Image->m_TextureSize = ca; |
1649 | 1649 | } |
1650 | 1650 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1652 | 1652 | { |
1653 | 1653 | CRect rect; |
1654 | 1654 | if (!GUI<CRect>::ParseString(attr_value, rect)) |
1655 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1655 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1656 | 1656 | else Image->m_TexturePlacementInFile = rect; |
1657 | 1657 | } |
1658 | 1658 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1660 | 1660 | { |
1661 | 1661 | CSize size; |
1662 | 1662 | if (!GUI<CSize>::ParseString(attr_value, size)) |
1663 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1663 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1664 | 1664 | else Image->m_CellSize = size; |
1665 | 1665 | } |
1666 | 1666 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1668 | 1668 | { |
1669 | 1669 | float val; |
1670 | 1670 | if (!GUI<float>::ParseString(attr_value, val)) |
1671 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1671 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1672 | 1672 | else Image->m_FixedHAspectRatio = val; |
1673 | 1673 | } |
1674 | 1674 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1676 | 1676 | { |
1677 | 1677 | bool b; |
1678 | 1678 | if (!GUI<bool>::ParseString(attr_value, b)) |
1679 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1679 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1680 | 1680 | else Image->m_RoundCoordinates = b; |
1681 | 1681 | } |
1682 | 1682 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1689 | 1689 | else if (attr_value == L"clamp_to_edge") |
1690 | 1690 | Image->m_WrapMode = GL_CLAMP_TO_EDGE; |
1691 | 1691 | else |
1692 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1692 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1693 | 1693 | } |
1694 | 1694 | else |
1695 | 1695 | if (attr_name == "z_level") |
1696 | 1696 | { |
1697 | 1697 | float z_level; |
1698 | 1698 | if (!GUI<float>::ParseString(attr_value, z_level)) |
1699 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1699 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1700 | 1700 | else Image->m_DeltaZ = z_level/100.f; |
1701 | 1701 | } |
1702 | 1702 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1704 | 1704 | { |
1705 | 1705 | CColor color; |
1706 | 1706 | if (!GUI<CColor>::ParseString(attr_value, color)) |
1707 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1707 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1708 | 1708 | else Image->m_BackColor = color; |
1709 | 1709 | } |
1710 | 1710 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1712 | 1712 | { |
1713 | 1713 | CColor color; |
1714 | 1714 | if (!GUI<CColor>::ParseString(attr_value, color)) |
1715 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1715 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1716 | 1716 | else Image->m_BorderColor = color; |
1717 | 1717 | } |
1718 | 1718 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1720 | 1720 | { |
1721 | 1721 | bool b; |
1722 | 1722 | if (!GUI<bool>::ParseString(attr_value, b)) |
1723 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1723 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1724 | 1724 | else Image->m_Border = b; |
1725 | 1725 | } |
1726 | 1726 | else |
… |
… |
void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
1739 | 1739 | { |
1740 | 1740 | if (Image->m_Effects) |
1741 | 1741 | { |
1742 | | LOGERROR(L"GUI <image> must not have more than one <effect>"); |
| 1742 | LOGERROR("GUI <image> must not have more than one <effect>"); |
1743 | 1743 | } |
1744 | 1744 | else |
1745 | 1745 | { |
… |
… |
void CGUI::Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImag
|
1773 | 1773 | { |
1774 | 1774 | CColor color; |
1775 | 1775 | if (!GUI<int>::ParseColor(attr_value, color, 0)) |
1776 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 1776 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
1777 | 1777 | else effects.m_AddColor = color; |
1778 | 1778 | } |
1779 | 1779 | else if (attr_name == "grayscale") |
… |
… |
void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)
|
1853 | 1853 | { |
1854 | 1854 | bool b; |
1855 | 1855 | if (!GUI<bool>::ParseString(attr_value.FromUTF8(), b)) |
1856 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
| 1856 | LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
1857 | 1857 | else |
1858 | 1858 | scrollbar.m_UseEdgeButtons = b; |
1859 | 1859 | } |
… |
… |
void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)
|
1861 | 1861 | { |
1862 | 1862 | float f; |
1863 | 1863 | if (!GUI<float>::ParseString(attr_value.FromUTF8(), f)) |
1864 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
| 1864 | LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
1865 | 1865 | else |
1866 | 1866 | scrollbar.m_Width = f; |
1867 | 1867 | } |
… |
… |
void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)
|
1870 | 1870 | { |
1871 | 1871 | float f; |
1872 | 1872 | if (!GUI<float>::ParseString(attr_value.FromUTF8(), f)) |
1873 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
| 1873 | LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
1874 | 1874 | else |
1875 | 1875 | scrollbar.m_MinimumBarSize = f; |
1876 | 1876 | } |
… |
… |
void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)
|
1879 | 1879 | { |
1880 | 1880 | float f; |
1881 | 1881 | if (!GUI<float>::ParseString(attr_value.FromUTF8(), f)) |
1882 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
| 1882 | LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); |
1883 | 1883 | else |
1884 | 1884 | scrollbar.m_MaximumBarSize = f; |
1885 | 1885 | } |
… |
… |
void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile)
|
1952 | 1952 | { |
1953 | 1953 | CSize size; |
1954 | 1954 | if (!GUI<CSize>::ParseString(attr_value.FromUTF8(), size)) |
1955 | | LOGERROR(L"Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str()); |
| 1955 | LOGERROR("Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str()); |
1956 | 1956 | else |
1957 | 1957 | icon.m_Size = size; |
1958 | 1958 | } |
… |
… |
void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile)
|
1960 | 1960 | { |
1961 | 1961 | int cell_id; |
1962 | 1962 | if (!GUI<int>::ParseString(attr_value.FromUTF8(), cell_id)) |
1963 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str()); |
| 1963 | LOGERROR("GUI: Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str()); |
1964 | 1964 | else |
1965 | 1965 | icon.m_CellID = cell_id; |
1966 | 1966 | } |
… |
… |
void CGUI::Xeromyces_ReadColor(XMBElement Element, CXeromyces* pFile)
|
2013 | 2013 | // Try setting color to value |
2014 | 2014 | if (!color.ParseString(value)) |
2015 | 2015 | { |
2016 | | LOGERROR(L"GUI: Unable to create custom color '%hs'. Invalid color syntax.", name.c_str()); |
| 2016 | LOGERROR("GUI: Unable to create custom color '%hs'. Invalid color syntax.", name.c_str()); |
2017 | 2017 | } |
2018 | 2018 | else |
2019 | 2019 | { |
-
diff --git a/source/gui/CGUIScrollBarVertical.cpp b/source/gui/CGUIScrollBarVertical.cpp
index 4e0efe6..4c5c6eb 100644
a
|
b
|
void CGUIScrollBarVertical::Draw()
|
51 | 51 | { |
52 | 52 | if (!GetStyle()) |
53 | 53 | { |
54 | | LOGWARNING(L"Attempt to draw scrollbar without a style."); |
| 54 | LOGWARNING("Attempt to draw scrollbar without a style."); |
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
-
diff --git a/source/gui/COList.cpp b/source/gui/COList.cpp
index 09ff828..633ca91 100644
a
|
b
|
bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile
|
158 | 158 | { |
159 | 159 | CColor color; |
160 | 160 | if (!GUI<CColor>::ParseString(attr_value.FromUTF8(), color)) |
161 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 161 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
162 | 162 | else oDef.m_TextColor = color; |
163 | 163 | } |
164 | 164 | else if (attr_name == "id") |
… |
… |
bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile
|
169 | 169 | { |
170 | 170 | float width; |
171 | 171 | if (!GUI<float>::ParseString(attr_value.FromUTF8(), width)) |
172 | | LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
| 172 | LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); |
173 | 173 | else |
174 | 174 | { |
175 | 175 | // Check if it's a relative value, and save as decimal if so. |
… |
… |
bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile
|
215 | 215 | } |
216 | 216 | else // Ignore. |
217 | 217 | { |
218 | | LOGERROR(L"GUI: translatable attribute in olist def that isn't a heading. (object: %hs)", this->GetPresentableName().c_str()); |
| 218 | LOGERROR("GUI: translatable attribute in olist def that isn't a heading. (object: %hs)", this->GetPresentableName().c_str()); |
219 | 219 | } |
220 | 220 | } |
221 | 221 | } |
-
diff --git a/source/gui/GUIManager.cpp b/source/gui/GUIManager.cpp
index d0999c7..992088d 100644
a
|
b
|
void CGUIManager::PopPageCB(shared_ptr<ScriptInterface::StructuredClone> args)
|
117 | 117 | scriptInterface->ReadStructuredClone(initDataClone, &initDataVal); |
118 | 118 | else |
119 | 119 | { |
120 | | LOGERROR(L"Called PopPageCB when initData (which should contain the callback function name) isn't set!"); |
| 120 | LOGERROR("Called PopPageCB when initData (which should contain the callback function name) isn't set!"); |
121 | 121 | return; |
122 | 122 | } |
123 | 123 | |
124 | 124 | if (!scriptInterface->HasProperty(initDataVal, "callback")) |
125 | 125 | { |
126 | | LOGERROR(L"Called PopPageCB when the callback function name isn't set!"); |
| 126 | LOGERROR("Called PopPageCB when the callback function name isn't set!"); |
127 | 127 | return; |
128 | 128 | } |
129 | 129 | |
130 | 130 | std::string callback; |
131 | 131 | if (!scriptInterface->GetProperty(initDataVal, "callback", callback)) |
132 | 132 | { |
133 | | LOGERROR(L"Failed to get the callback property as a string from initData in PopPageCB!"); |
| 133 | LOGERROR("Failed to get the callback property as a string from initData in PopPageCB!"); |
134 | 134 | return; |
135 | 135 | } |
136 | 136 | |
137 | 137 | JS::RootedValue global(cx, scriptInterface->GetGlobalObject()); |
138 | 138 | if (!scriptInterface->HasProperty(global, callback.c_str())) |
139 | 139 | { |
140 | | LOGERROR(L"The specified callback function %hs does not exist in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); |
| 140 | LOGERROR("The specified callback function %hs does not exist in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); |
141 | 141 | return; |
142 | 142 | } |
143 | 143 | |
… |
… |
void CGUIManager::PopPageCB(shared_ptr<ScriptInterface::StructuredClone> args)
|
146 | 146 | scriptInterface->ReadStructuredClone(args, &argVal); |
147 | 147 | if (!scriptInterface->CallFunctionVoid(global, callback.c_str(), argVal)) |
148 | 148 | { |
149 | | LOGERROR(L"Failed to call the callback function %hs in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); |
| 149 | LOGERROR("Failed to call the callback function %hs in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); |
150 | 150 | return; |
151 | 151 | } |
152 | 152 | } |
… |
… |
void CGUIManager::LoadPage(SGUIPage& page)
|
204 | 204 | |
205 | 205 | if (root.GetNodeName() != elmt_page) |
206 | 206 | { |
207 | | LOGERROR(L"GUI page '%ls' must have root element <page>", page.name.c_str()); |
| 207 | LOGERROR("GUI page '%ls' must have root element <page>", page.name.c_str()); |
208 | 208 | return; |
209 | 209 | } |
210 | 210 | |
… |
… |
void CGUIManager::LoadPage(SGUIPage& page)
|
212 | 212 | { |
213 | 213 | if (node.GetNodeName() != elmt_include) |
214 | 214 | { |
215 | | LOGERROR(L"GUI page '%ls' must only have <include> elements inside <page>", page.name.c_str()); |
| 215 | LOGERROR("GUI page '%ls' must only have <include> elements inside <page>", page.name.c_str()); |
216 | 216 | continue; |
217 | 217 | } |
218 | 218 | |
… |
… |
void CGUIManager::LoadPage(SGUIPage& page)
|
252 | 252 | hotloadDataVal) |
253 | 253 | ) |
254 | 254 | { |
255 | | LOGERROR(L"GUI page '%ls': Failed to call init() function", page.name.c_str()); |
| 255 | LOGERROR("GUI page '%ls': Failed to call init() function", page.name.c_str()); |
256 | 256 | } |
257 | 257 | |
258 | 258 | m_CurrentGUI = oldGUI; |
… |
… |
Status CGUIManager::ReloadChangedFile(const VfsPath& path)
|
264 | 264 | { |
265 | 265 | if (it->inputs.count(path)) |
266 | 266 | { |
267 | | LOGMESSAGE(L"GUI file '%ls' changed - reloading page '%ls'", path.string().c_str(), it->name.c_str()); |
| 267 | LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string().c_str(), it->name.c_str()); |
268 | 268 | LoadPage(*it); |
269 | 269 | // TODO: this can crash if LoadPage runs an init script which modifies the page stack and breaks our iterators |
270 | 270 | } |
… |
… |
const CParamNode& CGUIManager::GetTemplate(const std::string& templateName)
|
407 | 407 | { |
408 | 408 | const CParamNode& templateRoot = m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity"); |
409 | 409 | if (!templateRoot.IsOk()) |
410 | | LOGERROR(L"Invalid template found for '%hs'", templateName.c_str()); |
| 410 | LOGERROR("Invalid template found for '%hs'", templateName.c_str()); |
411 | 411 | |
412 | 412 | return templateRoot; |
413 | 413 | } |
-
diff --git a/source/gui/GUIRenderer.cpp b/source/gui/GUIRenderer.cpp
index 75b133a..ebeed7f 100644
a
|
b
|
void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName,
|
144 | 144 | // Check colour is valid |
145 | 145 | if (!GUI<CColor>::ParseString(value, color)) |
146 | 146 | { |
147 | | LOGERROR(L"GUI: Error parsing sprite 'colour' (\"%ls\")", value.c_str()); |
| 147 | LOGERROR("GUI: Error parsing sprite 'colour' (\"%ls\")", value.c_str()); |
148 | 148 | return; |
149 | 149 | } |
150 | 150 | |
… |
… |
void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName,
|
167 | 167 | else |
168 | 168 | { |
169 | 169 | // Otherwise, just complain and give up: |
170 | | LOGERROR(L"Trying to use a sprite that doesn't exist (\"%hs\").", SpriteName.c_str()); |
| 170 | LOGERROR("Trying to use a sprite that doesn't exist (\"%hs\").", SpriteName.c_str()); |
171 | 171 | return; |
172 | 172 | } |
173 | 173 | } |
-
diff --git a/source/gui/GUITooltip.cpp b/source/gui/GUITooltip.cpp
index c560885..c18f59a 100644
a
|
b
|
void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI*
|
149 | 149 | IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style); |
150 | 150 | if (! tooltipobj) |
151 | 151 | { |
152 | | LOGERROR(L"Cannot find tooltip named '%hs'", style.c_str()); |
| 152 | LOGERROR("Cannot find tooltip named '%hs'", style.c_str()); |
153 | 153 | return; |
154 | 154 | } |
155 | 155 | |
… |
… |
void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI*
|
162 | 162 | usedobj = gui->FindObjectByName(usedObjectName); |
163 | 163 | if (! usedobj) |
164 | 164 | { |
165 | | LOGERROR(L"Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); |
| 165 | LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); |
166 | 166 | return; |
167 | 167 | } |
168 | 168 | |
… |
… |
void GUITooltip::HideTooltip(const CStr& style, CGUI* gui)
|
213 | 213 | IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style); |
214 | 214 | if (! tooltipobj) |
215 | 215 | { |
216 | | LOGERROR(L"Cannot find tooltip named '%hs'", style.c_str()); |
| 216 | LOGERROR("Cannot find tooltip named '%hs'", style.c_str()); |
217 | 217 | return; |
218 | 218 | } |
219 | 219 | |
… |
… |
void GUITooltip::HideTooltip(const CStr& style, CGUI* gui)
|
224 | 224 | IGUIObject* usedobj = gui->FindObjectByName(usedObjectName); |
225 | 225 | if (! usedobj) |
226 | 226 | { |
227 | | LOGERROR(L"Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); |
| 227 | LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); |
228 | 228 | return; |
229 | 229 | } |
230 | 230 | |
… |
… |
static int GetTooltipDelay(CStr& style, CGUI* gui)
|
254 | 254 | IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style); |
255 | 255 | if (! tooltipobj) |
256 | 256 | { |
257 | | LOGERROR(L"Cannot find tooltip object named '%hs'", style.c_str()); |
| 257 | LOGERROR("Cannot find tooltip object named '%hs'", style.c_str()); |
258 | 258 | return delay; |
259 | 259 | } |
260 | 260 | GUI<int>::GetSetting(tooltipobj, "delay", delay); |
-
diff --git a/source/gui/GUIbase.cpp b/source/gui/GUIbase.cpp
index 491c2ec..effb583 100644
a
|
b
|
bool CClientArea::SetClientArea(const CStr& Value)
|
113 | 113 | coord++; |
114 | 114 | break; |
115 | 115 | default: |
116 | | LOGWARNING(L"ClientArea definitions may only contain numerics. Your input: '%hs'", Value.c_str()); |
| 116 | LOGWARNING("ClientArea definitions may only contain numerics. Your input: '%hs'", Value.c_str()); |
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | if (coord > 3) |
120 | 120 | { |
121 | | LOGWARNING(L"Too many CClientArea parameters (4 max). Your input: '%hs'", Value.c_str()); |
| 121 | LOGWARNING("Too many CClientArea parameters (4 max). Your input: '%hs'", Value.c_str()); |
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | 126 | if (coord < 3) |
127 | 127 | { |
128 | | LOGWARNING(L"Too few CClientArea parameters (4 min). Your input: '%hs'", Value.c_str()); |
| 128 | LOGWARNING("Too few CClientArea parameters (4 min). Your input: '%hs'", Value.c_str()); |
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
-
diff --git a/source/gui/GUItext.cpp b/source/gui/GUItext.cpp
index 69d9f47..8b5f594 100644
a
|
b
|
void CGUIString::GenerateTextCall(const CGUI *pGUI,
|
109 | 109 | if (!pGUI->IconExists(path)) |
110 | 110 | { |
111 | 111 | if (pObject) |
112 | | LOGERROR(L"Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%hs\").", path.c_str()); |
| 112 | LOGERROR("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%hs\").", path.c_str()); |
113 | 113 | continue; |
114 | 114 | } |
115 | 115 | |
… |
… |
void CGUIString::GenerateTextCall(const CGUI *pGUI,
|
158 | 158 | CSize displacement; |
159 | 159 | // Parse the value |
160 | 160 | if (!GUI<CSize>::ParseString(tagAttrib.value, displacement)) |
161 | | LOGERROR(L"Error parsing 'displace' value for tag [ICON]"); |
| 161 | LOGERROR("Error parsing 'displace' value for tag [ICON]"); |
162 | 162 | else |
163 | 163 | SpriteCall.m_Area += displacement; |
164 | 164 | } |
… |
… |
void CGUIString::GenerateTextCall(const CGUI *pGUI,
|
182 | 182 | } |
183 | 183 | break; |
184 | 184 | default: |
185 | | LOGERROR(L"Encountered unexpected tag applied to text"); |
| 185 | LOGERROR("Encountered unexpected tag applied to text"); |
186 | 186 | break; |
187 | 187 | } |
188 | 188 | } |
… |
… |
void CGUIString::GenerateTextCall(const CGUI *pGUI,
|
207 | 207 | |
208 | 208 | if (!GUI<CColor>::ParseString(it2->m_TagValue, TextCall.m_Color) |
209 | 209 | && pObject) |
210 | | LOGERROR(L"Error parsing the value of a [color]-tag in GUI text when reading object \"%hs\".", pObject->GetPresentableName().c_str()); |
| 210 | LOGERROR("Error parsing the value of a [color]-tag in GUI text when reading object \"%hs\".", pObject->GetPresentableName().c_str()); |
211 | 211 | break; |
212 | 212 | case CGUIString::TextChunk::Tag::TAG_FONT: |
213 | 213 | // TODO Gee: (2004-08-15) Check if Font exists? |
214 | 214 | TextCall.m_Font = CStrIntern(utf8_from_wstring(it2->m_TagValue)); |
215 | 215 | break; |
216 | 216 | default: |
217 | | LOGERROR(L"Encountered unexpected tag applied to text"); |
| 217 | LOGERROR("Encountered unexpected tag applied to text"); |
218 | 218 | break; |
219 | 219 | } |
220 | 220 | } |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
306 | 306 | closing = false; |
307 | 307 | if (++p == l) |
308 | 308 | { |
309 | | LOGERROR(L"Partial tag at end of string '%ls'", str.c_str()); |
| 309 | LOGERROR("Partial tag at end of string '%ls'", str.c_str()); |
310 | 310 | break; |
311 | 311 | } |
312 | 312 | if (str[p] == L'/') |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
314 | 314 | closing = true; |
315 | 315 | if (tags.empty()) |
316 | 316 | { |
317 | | LOGERROR(L"Encountered closing tag without having any open tags. At %d in '%ls'", p, str.c_str()); |
| 317 | LOGERROR("Encountered closing tag without having any open tags. At %d in '%ls'", p, str.c_str()); |
318 | 318 | break; |
319 | 319 | } |
320 | 320 | if (++p == l) |
321 | 321 | { |
322 | | LOGERROR(L"Partial closing tag at end of string '%ls'", str.c_str()); |
| 322 | LOGERROR("Partial closing tag at end of string '%ls'", str.c_str()); |
323 | 323 | break; |
324 | 324 | } |
325 | 325 | } |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
332 | 332 | { |
333 | 333 | case L' ': |
334 | 334 | if (closing) // We still parse them to make error handling cleaner |
335 | | LOGERROR(L"Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); |
| 335 | LOGERROR("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); |
336 | 336 | |
337 | 337 | // parse something="something else" |
338 | 338 | for (++p; p < l && str[p] != L'='; ++p) |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
340 | 340 | |
341 | 341 | if (p == l) |
342 | 342 | { |
343 | | LOGERROR(L"Parameter without value at pos %d '%ls'", p, str.c_str()); |
| 343 | LOGERROR("Parameter without value at pos %d '%ls'", p, str.c_str()); |
344 | 344 | break; |
345 | 345 | } |
346 | 346 | // fall-through |
347 | 347 | case L'=': |
348 | 348 | // parse a quoted parameter |
349 | 349 | if (closing) // We still parse them to make error handling cleaner |
350 | | LOGERROR(L"Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); |
| 350 | LOGERROR("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); |
351 | 351 | |
352 | 352 | if (++p == l) |
353 | 353 | { |
354 | | LOGERROR(L"Expected parameter, got end of string '%ls'", str.c_str()); |
| 354 | LOGERROR("Expected parameter, got end of string '%ls'", str.c_str()); |
355 | 355 | break; |
356 | 356 | } |
357 | 357 | if (str[p] != L'"') |
358 | 358 | { |
359 | | LOGERROR(L"Unquoted parameters are not supported (at pos %d '%ls')", p, str.c_str()); |
| 359 | LOGERROR("Unquoted parameters are not supported (at pos %d '%ls')", p, str.c_str()); |
360 | 360 | break; |
361 | 361 | } |
362 | 362 | for (++p; p < l && str[p] != L'"'; ++p) |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
366 | 366 | case L'\\': |
367 | 367 | if (++p == l) |
368 | 368 | { |
369 | | LOGERROR(L"Escape character at end of string '%ls'", str.c_str()); |
| 369 | LOGERROR("Escape character at end of string '%ls'", str.c_str()); |
370 | 370 | break; |
371 | 371 | } |
372 | 372 | // NOTE: We do not support \n in tag parameters |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
392 | 392 | |
393 | 393 | if (!tag_.SetTagType(tag)) |
394 | 394 | { |
395 | | LOGERROR(L"Invalid tag '%ls' at %d in '%ls'", tag.c_str(), p, str.c_str()); |
| 395 | LOGERROR("Invalid tag '%ls' at %d in '%ls'", tag.c_str(), p, str.c_str()); |
396 | 396 | break; |
397 | 397 | } |
398 | 398 | if (!closing) |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
415 | 415 | { |
416 | 416 | if (tag != tags.back()) |
417 | 417 | { |
418 | | LOGERROR(L"Closing tag '%ls' does not match last opened tag '%ls' at %d in '%ls'", tag.c_str(), tags.back().c_str(), p, str.c_str()); |
| 418 | LOGERROR("Closing tag '%ls' does not match last opened tag '%ls' at %d in '%ls'", tag.c_str(), tags.back().c_str(), p, str.c_str()); |
419 | 419 | break; |
420 | 420 | } |
421 | 421 | |
… |
… |
void CGUIString::SetValue(const CStrW& str)
|
426 | 426 | case L'\\': |
427 | 427 | if (++p == l) |
428 | 428 | { |
429 | | LOGERROR(L"Escape character at end of string '%ls'", str.c_str()); |
| 429 | LOGERROR("Escape character at end of string '%ls'", str.c_str()); |
430 | 430 | break; |
431 | 431 | } |
432 | 432 | if (str[p] == L'n') |
-
diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp
index 009c702..15f0da4 100644
a
|
b
|
bool __ParseString<CRect>(const CStrW& Value, CRect &Output)
|
69 | 69 | { |
70 | 70 | if (stream.eof()) |
71 | 71 | { |
72 | | LOGWARNING(L"Too few CRect parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
| 72 | LOGWARNING("Too few CRect parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
73 | 73 | return false; |
74 | 74 | } |
75 | 75 | stream >> coords[i]; |
76 | 76 | if ((stream.rdstate() & std::wstringstream::failbit) != 0) |
77 | 77 | { |
78 | | LOGWARNING(L"Unable to parse CRect parameters. Your input: '%hs'", Value.ToUTF8().c_str()); |
| 78 | LOGWARNING("Unable to parse CRect parameters. Your input: '%hs'", Value.ToUTF8().c_str()); |
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | if (!stream.eof()) |
84 | 84 | { |
85 | | LOGWARNING(L"Too many CRect parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
| 85 | LOGWARNING("Too many CRect parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
86 | 86 | return false; |
87 | 87 | } |
88 | 88 | |
… |
… |
bool __ParseString<CSize>(const CStrW& Value, CSize &Output)
|
134 | 134 | { |
135 | 135 | if (stream.eof()) |
136 | 136 | { |
137 | | LOGWARNING(L"Too few CSize parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
| 137 | LOGWARNING("Too few CSize parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | stream >> coords[i]; |
141 | 141 | if ((stream.rdstate() & std::wstringstream::failbit) != 0) |
142 | 142 | { |
143 | | LOGWARNING(L"Unable to parse CSize parameters. Your input: '%hs'", Value.ToUTF8().c_str()); |
| 143 | LOGWARNING("Unable to parse CSize parameters. Your input: '%hs'", Value.ToUTF8().c_str()); |
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | } |
… |
… |
bool __ParseString<CSize>(const CStrW& Value, CSize &Output)
|
150 | 150 | |
151 | 151 | if (!stream.eof()) |
152 | 152 | { |
153 | | LOGWARNING(L"Too many CSize parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
| 153 | LOGWARNING("Too many CSize parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
154 | 154 | return false; |
155 | 155 | } |
156 | 156 | |
… |
… |
bool __ParseString<CPos>(const CStrW& Value, CPos &Output)
|
169 | 169 | { |
170 | 170 | if (stream.eof()) |
171 | 171 | { |
172 | | LOGWARNING(L"Too few CPos parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
| 172 | LOGWARNING("Too few CPos parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | stream >> coords[i]; |
176 | 176 | if ((stream.rdstate() & std::wstringstream::failbit) != 0) |
177 | 177 | { |
178 | | LOGWARNING(L"Unable to parse CPos parameters. Your input: '%hs'", Value.ToUTF8().c_str()); |
| 178 | LOGWARNING("Unable to parse CPos parameters. Your input: '%hs'", Value.ToUTF8().c_str()); |
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | } |
… |
… |
bool __ParseString<CPos>(const CStrW& Value, CPos &Output)
|
185 | 185 | |
186 | 186 | if (!stream.eof()) |
187 | 187 | { |
188 | | LOGWARNING(L"Too many CPos parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
| 188 | LOGWARNING("Too many CPos parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); |
189 | 189 | return false; |
190 | 190 | } |
191 | 191 | |
… |
… |
PSRETURN GUI<T>::GetSettingPointer(const IGUIObject *pObject, const CStr& Settin
|
339 | 339 | std::map<CStr, SGUISetting>::const_iterator it = pObject->m_Settings.find(Setting); |
340 | 340 | if (it == pObject->m_Settings.end()) |
341 | 341 | { |
342 | | LOGWARNING(L"setting %hs was not found on object %hs", |
| 342 | LOGWARNING("setting %hs was not found on object %hs", |
343 | 343 | Setting.c_str(), |
344 | 344 | pObject->GetPresentableName().c_str()); |
345 | 345 | return PSRETURN_GUI_InvalidSetting; |
… |
… |
PSRETURN GUI<T>::SetSetting(IGUIObject *pObject, const CStr& Setting,
|
388 | 388 | |
389 | 389 | if (!pObject->SettingExists(Setting)) |
390 | 390 | { |
391 | | LOGWARNING(L"setting %hs was not found on object %hs", |
| 391 | LOGWARNING("setting %hs was not found on object %hs", |
392 | 392 | Setting.c_str(), |
393 | 393 | pObject->GetPresentableName().c_str()); |
394 | 394 | return PSRETURN_GUI_InvalidSetting; |
-
diff --git a/source/gui/IGUIObject.cpp b/source/gui/IGUIObject.cpp
index d32cb28..62e93e5 100644
a
|
b
|
bool IGUIObject::IsRootObject() const
|
561 | 561 | |
562 | 562 | PSRETURN IGUIObject::LogInvalidSettings(const CStr8 &Setting) const |
563 | 563 | { |
564 | | LOGWARNING(L"IGUIObject: setting %hs was not found on an object", |
| 564 | LOGWARNING("IGUIObject: setting %hs was not found on an object", |
565 | 565 | Setting.c_str()); |
566 | 566 | return PSRETURN_GUI_InvalidSetting; |
567 | 567 | } |
-
diff --git a/source/gui/scripting/ScriptFunctions.cpp b/source/gui/scripting/ScriptFunctions.cpp
index 1f7f309..bc6881a 100644
a
|
b
|
void SaveGame(ScriptInterface::CxPrivate* pCxPrivate, std::wstring filename, std
|
308 | 308 | |
309 | 309 | shared_ptr<ScriptInterface::StructuredClone> GUIMetadataClone = pCxPrivate->pScriptInterface->WriteStructuredClone(GUIMetadata); |
310 | 310 | if (SavedGames::Save(filename, description, *g_Game->GetSimulation2(), GUIMetadataClone, g_Game->GetPlayerID()) < 0) |
311 | | LOGERROR(L"Failed to save game"); |
| 311 | LOGERROR("Failed to save game"); |
312 | 312 | } |
313 | 313 | |
314 | 314 | void SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, std::wstring prefix, std::wstring description, CScriptVal GUIMetadata1) |
… |
… |
void SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, std::wstring prefix,
|
320 | 320 | |
321 | 321 | shared_ptr<ScriptInterface::StructuredClone> GUIMetadataClone = pCxPrivate->pScriptInterface->WriteStructuredClone(GUIMetadata); |
322 | 322 | if (SavedGames::SavePrefix(prefix, description, *g_Game->GetSimulation2(), GUIMetadataClone, g_Game->GetPlayerID()) < 0) |
323 | | LOGERROR(L"Failed to save game"); |
| 323 | LOGERROR("Failed to save game"); |
324 | 324 | } |
325 | 325 | |
326 | 326 | void SetNetworkGameAttributes(ScriptInterface::CxPrivate* pCxPrivate, CScriptVal attribs1) |
… |
… |
void SetTurnLength(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), int length)
|
630 | 630 | if (g_NetServer) |
631 | 631 | g_NetServer->SetTurnLength(length); |
632 | 632 | else |
633 | | LOGERROR(L"Only network host can change turn length"); |
| 633 | LOGERROR("Only network host can change turn length"); |
634 | 634 | } |
635 | 635 | |
636 | 636 | // Focus the game camera on a given position. |
… |
… |
void DumpTerrainMipmap(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
676 | 676 | g_Game->GetWorld()->GetTerrain()->GetHeightMipmap().DumpToDisk(filename); |
677 | 677 | OsPath realPath; |
678 | 678 | g_VFS->GetRealPath(filename, realPath); |
679 | | LOGMESSAGERENDER(L"Terrain mipmap written to '%ls'", realPath.string().c_str()); |
| 679 | LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string().c_str()); |
680 | 680 | } |
681 | 681 | |
682 | 682 | void EnableTimeWarpRecording(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int numTurns) |
… |
… |
void StartJsTimer(ScriptInterface::CxPrivate* pCxPrivate, unsigned int slot)
|
906 | 906 | ONCE(InitJsTimers(*(pCxPrivate->pScriptInterface))); |
907 | 907 | |
908 | 908 | if (slot >= MAX_JS_TIMERS) |
909 | | LOGERROR(L"Exceeded the maximum number of timer slots for scripts!"); |
| 909 | LOGERROR("Exceeded the maximum number of timer slots for scripts!"); |
910 | 910 | |
911 | 911 | js_start_times[slot].SetFromTimer(); |
912 | 912 | } |
… |
… |
void StartJsTimer(ScriptInterface::CxPrivate* pCxPrivate, unsigned int slot)
|
914 | 914 | void StopJsTimer(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int slot) |
915 | 915 | { |
916 | 916 | if (slot >= MAX_JS_TIMERS) |
917 | | LOGERROR(L"Exceeded the maximum number of timer slots for scripts!"); |
| 917 | LOGERROR("Exceeded the maximum number of timer slots for scripts!"); |
918 | 918 | |
919 | 919 | TimerUnit now; |
920 | 920 | now.SetFromTimer(); |
-
diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp
index a77c7da..6f109e3 100644
a
|
b
|
void L10n::GetDictionaryLocale(const std::string& configLocaleString, Locale& ou
|
203 | 203 | return; |
204 | 204 | } |
205 | 205 | else |
206 | | LOGWARNING(L"The configured locale is not valid or no translations are available. Falling back to another locale."); |
| 206 | LOGWARNING("The configured locale is not valid or no translations are available. Falling back to another locale."); |
207 | 207 | } |
208 | 208 | |
209 | 209 | Locale systemLocale = Locale::getDefault(); |
… |
… |
std::string L10n::FormatMillisecondsIntoDateString(const UDate& milliseconds, co
|
408 | 408 | UnicodeString unicodeFormat = UnicodeString::fromUTF8(formatString.c_str()); |
409 | 409 | SimpleDateFormat* dateFormat = new SimpleDateFormat(unicodeFormat, status); |
410 | 410 | if (U_FAILURE(status)) |
411 | | LOGERROR(L"Error creating SimpleDateFormat: %hs", u_errorName(status)); |
| 411 | LOGERROR("Error creating SimpleDateFormat: %hs", u_errorName(status)); |
412 | 412 | |
413 | 413 | const TimeZone* timeZone = TimeZone::getGMT(); |
414 | 414 | |
415 | 415 | status = U_ZERO_ERROR; |
416 | 416 | Calendar* calendar = Calendar::createInstance(*timeZone, currentLocale, status); |
417 | 417 | if (U_FAILURE(status)) |
418 | | LOGERROR(L"Error creating calendar: %hs", u_errorName(status)); |
| 418 | LOGERROR("Error creating calendar: %hs", u_errorName(status)); |
419 | 419 | |
420 | 420 | dateFormat->adoptCalendar(calendar); |
421 | 421 | dateFormat->format(milliseconds, dateString); |
… |
… |
Status L10n::ReloadChangedFile(const VfsPath& path)
|
470 | 470 | if (path.string().rfind(dictName) == std::string::npos) |
471 | 471 | return INFO::OK; |
472 | 472 | |
473 | | LOGMESSAGE(L"Hotloading translations from '%ls'", path.string().c_str()); |
| 473 | LOGMESSAGE("Hotloading translations from '%ls'", path.string().c_str()); |
474 | 474 | |
475 | 475 | CVFSFile file; |
476 | 476 | if (file.Load(g_VFS, path) != PSRETURN_OK) |
477 | 477 | { |
478 | | LOGERROR(L"Failed to read translations from '%ls'", path.string().c_str()); |
| 478 | LOGERROR("Failed to read translations from '%ls'", path.string().c_str()); |
479 | 479 | return ERR::FAIL; |
480 | 480 | } |
481 | 481 | |
… |
… |
void L10n::LoadDictionaryForCurrentLocale()
|
505 | 505 | std::wstring dictName = GetFallbackToAvailableDictLocale(currentLocale); |
506 | 506 | if (vfs::GetPathnames(g_VFS, L"l10n/", dictName.append(L".*.po").c_str(), filenames) < 0) |
507 | 507 | { |
508 | | LOGERROR(L"No files for the dictionary found, but at this point the input should already be validated!"); |
| 508 | LOGERROR("No files for the dictionary found, but at this point the input should already be validated!"); |
509 | 509 | return; |
510 | 510 | } |
511 | 511 | } |
… |
… |
void L10n::ReadPoIntoDictionary(const std::string& poContent, tinygettext::Dicti
|
569 | 569 | } |
570 | 570 | catch(std::exception& e) |
571 | 571 | { |
572 | | LOGERROR(L"[Localization] Exception while reading virtual PO file: %hs", e.what()); |
| 572 | LOGERROR("[Localization] Exception while reading virtual PO file: %hs", e.what()); |
573 | 573 | } |
574 | 574 | } |
575 | 575 | |
-
diff --git a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp
index 52bd702..93c5ad2 100644
a
|
b
|
Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch)
|
188 | 188 | // Check for error ? |
189 | 189 | int err = errno; |
190 | 190 | initialized = -1; |
191 | | LOGERROR(L"Error initializing inotify file descriptor; hotloading will be disabled, errno=%d", err); |
| 191 | LOGERROR("Error initializing inotify file descriptor; hotloading will be disabled, errno=%d", err); |
192 | 192 | errno = err; |
193 | 193 | return StatusFromErrno(); // NOWARN |
194 | 194 | } |
… |
… |
Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch)
|
198 | 198 | if (ret != 0) |
199 | 199 | { |
200 | 200 | initialized = -1; |
201 | | LOGERROR(L"Error creating inotify event loop thread; hotloading will be disabled, err=%d", ret); |
| 201 | LOGERROR("Error creating inotify event loop thread; hotloading will be disabled, err=%d", ret); |
202 | 202 | errno = ret; |
203 | 203 | return StatusFromErrno(); // NOWARN |
204 | 204 | } |
-
diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp
index 4b454e0..a09bfb9 100644
a
|
b
|
bool XmppClient::handleIq(const glooxwrapper::IQ& iq)
|
749 | 749 | { |
750 | 750 | CreateSimpleMessage("system", g_L10n.Translate("unknown subtype (see logs)"), "error"); |
751 | 751 | std::string tag = tag_name(iq); |
752 | | LOGMESSAGE(L"unknown subtype '%hs'", tag.c_str()); |
| 752 | LOGMESSAGE("unknown subtype '%hs'", tag.c_str()); |
753 | 753 | } |
754 | 754 | |
755 | 755 | return true; |
… |
… |
void XmppClient::SetPresence(const std::string& presence)
|
896 | 896 | else IF("offline", Unavailable); |
897 | 897 | // The others are not to be set |
898 | 898 | #undef IF |
899 | | else LOGERROR(L"Unknown presence '%hs'", presence.c_str()); |
| 899 | else LOGERROR("Unknown presence '%hs'", presence.c_str()); |
900 | 900 | } |
901 | 901 | |
902 | 902 | /** |
… |
… |
void XmppClient::GetPresenceString(const gloox::Presence::PresenceType p, std::s
|
952 | 952 | CASE(Error, "error"); |
953 | 953 | CASE(Invalid, "invalid"); |
954 | 954 | default: |
955 | | LOGERROR(L"Unknown presence type '%d'", (int)p); |
| 955 | LOGERROR("Unknown presence type '%d'", (int)p); |
956 | 956 | break; |
957 | 957 | #undef CASE |
958 | 958 | } |
… |
… |
void XmppClient::GetRoleString(const gloox::MUCRoomRole r, std::string& role) co
|
975 | 975 | CASE(RoleModerator, "moderator"); |
976 | 976 | CASE(RoleInvalid, "invalid"); |
977 | 977 | default: |
978 | | LOGERROR(L"Unknown role type '%d'", (int)r); |
| 978 | LOGERROR("Unknown role type '%d'", (int)r); |
979 | 979 | break; |
980 | 980 | #undef CASE |
981 | 981 | } |
-
diff --git a/source/main.cpp b/source/main.cpp
index 4d90e76..051e2f9 100644
a
|
b
|
static InReaction MainInputHandler(const SDL_Event_* ev)
|
159 | 159 | // Fullscreen toggling is broken on OS X w/ SDL 1.2, see http://trac.wildfiregames.com/ticket/741 |
160 | 160 | g_VideoMode.ToggleFullscreen(); |
161 | 161 | #else |
162 | | LOGWARNING(L"Toggling fullscreen and resizing are disabled on OS X due to a known bug. Please use the config file to change display settings."); |
| 162 | LOGWARNING("Toggling fullscreen and resizing are disabled on OS X due to a known bug. Please use the config file to change display settings."); |
163 | 163 | #endif |
164 | 164 | return IN_HANDLED; |
165 | 165 | } |
-
diff --git a/source/network/NetClient.cpp b/source/network/NetClient.cpp
index 8062cc8..bc5aa66 100644
a
|
b
|
bool CNetClient::HandleMessage(CNetMessage* message)
|
304 | 304 | |
305 | 305 | std::stringstream stream; |
306 | 306 | |
307 | | LOGMESSAGERENDER(L"Serializing game at turn %u for rejoining player", m_ClientTurnManager->GetCurrentTurn()); |
| 307 | LOGMESSAGERENDER("Serializing game at turn %u for rejoining player", m_ClientTurnManager->GetCurrentTurn()); |
308 | 308 | u32 turn = to_le32(m_ClientTurnManager->GetCurrentTurn()); |
309 | 309 | stream.write((char*)&turn, sizeof(turn)); |
310 | 310 | |
… |
… |
bool CNetClient::HandleMessage(CNetMessage* message)
|
324 | 324 | // Update FSM |
325 | 325 | bool ok = Update(message->GetType(), message); |
326 | 326 | if (!ok) |
327 | | LOGERROR(L"Net client: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)GetCurrState()); |
| 327 | LOGERROR("Net client: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)GetCurrState()); |
328 | 328 | return ok; |
329 | 329 | } |
330 | 330 | |
… |
… |
void CNetClient::LoadFinished()
|
347 | 347 | stream.read((char*)&turn, sizeof(turn)); |
348 | 348 | turn = to_le32(turn); |
349 | 349 | |
350 | | LOGMESSAGE(L"Rejoining client deserializing state at turn %u\n", turn); |
| 350 | LOGMESSAGE("Rejoining client deserializing state at turn %u\n", turn); |
351 | 351 | |
352 | 352 | bool ok = m_Game->GetSimulation2()->DeserializeState(stream); |
353 | 353 | ENSURE(ok); |
… |
… |
bool CNetClient::OnAuthenticate(void* context, CFsmEvent* event)
|
428 | 428 | |
429 | 429 | CAuthenticateResultMessage* message = (CAuthenticateResultMessage*)event->GetParamRef(); |
430 | 430 | |
431 | | LOGMESSAGE(L"Net: Authentication result: host=%u, %ls", message->m_HostID, message->m_Message.c_str()); |
| 431 | LOGMESSAGE("Net: Authentication result: host=%u, %ls", message->m_HostID, message->m_Message.c_str()); |
432 | 432 | |
433 | 433 | bool isRejoining = (message->m_Code == ARC_OK_REJOINING); |
434 | 434 | |
-
diff --git a/source/network/NetFileTransfer.cpp b/source/network/NetFileTransfer.cpp
index 02805e3..1bf4da9 100644
a
|
b
|
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
15 | 15 | |
16 | 16 | if (m_FileReceiveTasks.find(respMessage->m_RequestID) == m_FileReceiveTasks.end()) |
17 | 17 | { |
18 | | LOGERROR(L"Net transfer: Unsolicited file transfer response (id=%d)", (int)respMessage->m_RequestID); |
| 18 | LOGERROR("Net transfer: Unsolicited file transfer response (id=%d)", (int)respMessage->m_RequestID); |
19 | 19 | return ERR::FAIL; |
20 | 20 | } |
21 | 21 | |
22 | 22 | if (respMessage->m_Length == 0 || respMessage->m_Length > MAX_FILE_TRANSFER_SIZE) |
23 | 23 | { |
24 | | LOGERROR(L"Net transfer: Invalid size for file transfer response (length=%d)", (int)respMessage->m_Length); |
| 24 | LOGERROR("Net transfer: Invalid size for file transfer response (length=%d)", (int)respMessage->m_Length); |
25 | 25 | return ERR::FAIL; |
26 | 26 | } |
27 | 27 | |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
30 | 30 | task->m_Length = respMessage->m_Length; |
31 | 31 | task->m_Buffer.reserve(respMessage->m_Length); |
32 | 32 | |
33 | | LOGMESSAGERENDER(L"Downloading data over network (%d KB) - please wait...", (int)(task->m_Length/1024)); |
| 33 | LOGMESSAGERENDER("Downloading data over network (%d KB) - please wait...", (int)(task->m_Length/1024)); |
34 | 34 | m_LastProgressReportTime = timer_Time(); |
35 | 35 | |
36 | 36 | return INFO::OK; |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
41 | 41 | |
42 | 42 | if (m_FileReceiveTasks.find(dataMessage->m_RequestID) == m_FileReceiveTasks.end()) |
43 | 43 | { |
44 | | LOGERROR(L"Net transfer: Unsolicited file transfer data (id=%d)", (int)dataMessage->m_RequestID); |
| 44 | LOGERROR("Net transfer: Unsolicited file transfer data (id=%d)", (int)dataMessage->m_RequestID); |
45 | 45 | return ERR::FAIL; |
46 | 46 | } |
47 | 47 | |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
51 | 51 | |
52 | 52 | if (task->m_Buffer.size() > task->m_Length) |
53 | 53 | { |
54 | | LOGERROR(L"Net transfer: Invalid size for file transfer data (length=%d actual=%d)", (int)task->m_Length, (int)task->m_Buffer.size()); |
| 54 | LOGERROR("Net transfer: Invalid size for file transfer data (length=%d actual=%d)", (int)task->m_Length, (int)task->m_Buffer.size()); |
55 | 55 | return ERR::FAIL; |
56 | 56 | } |
57 | 57 | |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
62 | 62 | |
63 | 63 | if (task->m_Buffer.size() == task->m_Length) |
64 | 64 | { |
65 | | LOGMESSAGERENDER(L"Download completed"); |
| 65 | LOGMESSAGERENDER("Download completed"); |
66 | 66 | |
67 | 67 | task->OnComplete(); |
68 | 68 | m_FileReceiveTasks.erase(dataMessage->m_RequestID); |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
75 | 75 | double t = timer_Time(); |
76 | 76 | if (t > m_LastProgressReportTime + 0.5) |
77 | 77 | { |
78 | | LOGMESSAGERENDER(L"Downloading data: %.1f%% of %d KB", 100.f*task->m_Buffer.size()/task->m_Length, (int)(task->m_Length/1024)); |
| 78 | LOGMESSAGERENDER("Downloading data: %.1f%% of %d KB", 100.f*task->m_Buffer.size()/task->m_Length, (int)(task->m_Length/1024)); |
79 | 79 | m_LastProgressReportTime = t; |
80 | 80 | } |
81 | 81 | |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
87 | 87 | |
88 | 88 | if (m_FileSendTasks.find(ackMessage->m_RequestID) == m_FileSendTasks.end()) |
89 | 89 | { |
90 | | LOGERROR(L"Net transfer: Unsolicited file transfer ack (id=%d)", (int)ackMessage->m_RequestID); |
| 90 | LOGERROR("Net transfer: Unsolicited file transfer ack (id=%d)", (int)ackMessage->m_RequestID); |
91 | 91 | return ERR::FAIL; |
92 | 92 | } |
93 | 93 | |
… |
… |
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message)
|
95 | 95 | |
96 | 96 | if (ackMessage->m_NumPackets > task.packetsInFlight) |
97 | 97 | { |
98 | | LOGERROR(L"Net transfer: Invalid num packets for file transfer ack (num=%d inflight=%d)", |
| 98 | LOGERROR("Net transfer: Invalid num packets for file transfer ack (num=%d inflight=%d)", |
99 | 99 | (int)ackMessage->m_NumPackets, (int)task.packetsInFlight); |
100 | 100 | return ERR::FAIL; |
101 | 101 | } |
-
diff --git a/source/network/NetHost.cpp b/source/network/NetHost.cpp
index 7d0d682..1f14daf 100644
a
|
b
|
bool CNetHost::SendMessage(const CNetMessage* message, ENetPeer* peer, const cha
|
29 | 29 | if (!packet) |
30 | 30 | return false; |
31 | 31 | |
32 | | LOGMESSAGE(L"Net: Sending message %hs of size %lu to %hs", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName); |
| 32 | LOGMESSAGE("Net: Sending message %hs of size %lu to %hs", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName); |
33 | 33 | |
34 | 34 | // Let ENet send the message to peer |
35 | 35 | if (enet_peer_send(peer, DEFAULT_CHANNEL, packet) < 0) |
36 | 36 | { |
37 | | LOGERROR(L"Net: Failed to send packet to peer"); |
| 37 | LOGERROR("Net: Failed to send packet to peer"); |
38 | 38 | return false; |
39 | 39 | } |
40 | 40 | |
… |
… |
ENetPacket* CNetHost::CreatePacket(const CNetMessage* message)
|
62 | 62 | // Create a reliable packet |
63 | 63 | ENetPacket* packet = enet_packet_create(&buffer[0], size, ENET_PACKET_FLAG_RELIABLE); |
64 | 64 | if (!packet) |
65 | | LOGERROR(L"Net: Failed to construct packet"); |
| 65 | LOGERROR("Net: Failed to construct packet"); |
66 | 66 | |
67 | 67 | return packet; |
68 | 68 | } |
-
diff --git a/source/network/NetMessage.cpp b/source/network/NetMessage.cpp
index d2c3be2..daa892c 100644
a
|
b
|
const u8* CNetMessage::Deserialize(const u8* pStart, const u8* pEnd)
|
54 | 54 | { |
55 | 55 | if (pStart + 3 > pEnd) |
56 | 56 | { |
57 | | LOGERROR(L"CNetMessage: Corrupt packet (smaller than header)"); |
| 57 | LOGERROR("CNetMessage: Corrupt packet (smaller than header)"); |
58 | 58 | return NULL; |
59 | 59 | } |
60 | 60 | |
… |
… |
const u8* CNetMessage::Deserialize(const u8* pStart, const u8* pEnd)
|
68 | 68 | |
69 | 69 | if (pStart + size != pEnd) |
70 | 70 | { |
71 | | LOGERROR(L"CNetMessage: Corrupt packet (incorrect size)"); |
| 71 | LOGERROR("CNetMessage: Corrupt packet (incorrect size)"); |
72 | 72 | return NULL; |
73 | 73 | } |
74 | 74 | |
… |
… |
CNetMessage* CNetMessageFactory::CreateMessage(const void* pData,
|
184 | 184 | break; |
185 | 185 | |
186 | 186 | default: |
187 | | LOGERROR(L"CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", header.GetType()); |
| 187 | LOGERROR("CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", header.GetType()); |
188 | 188 | break; |
189 | 189 | } |
190 | 190 | |
-
diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp
index bcf904d..ca48504 100644
a
|
b
|
public:
|
94 | 94 | |
95 | 95 | if (!session) |
96 | 96 | { |
97 | | LOGMESSAGE(L"Net server: rejoining client disconnected before we sent to it"); |
| 97 | LOGMESSAGE("Net server: rejoining client disconnected before we sent to it"); |
98 | 98 | return; |
99 | 99 | } |
100 | 100 | |
… |
… |
bool CNetServerWorker::SetupConnection()
|
177 | 177 | m_Host = enet_host_create(&addr, MAX_CLIENTS, CHANNEL_COUNT, 0, 0); |
178 | 178 | if (!m_Host) |
179 | 179 | { |
180 | | LOGERROR(L"Net server: enet_host_create failed"); |
| 180 | LOGERROR("Net server: enet_host_create failed"); |
181 | 181 | return false; |
182 | 182 | } |
183 | 183 | |
… |
… |
void* CNetServerWorker::SetupUPnP(void*)
|
224 | 224 | std::string rootDescURL; |
225 | 225 | CFG_GET_VAL("network.upnprootdescurl", rootDescURL); |
226 | 226 | if (!rootDescURL.empty()) |
227 | | LOGMESSAGE(L"Net server: attempting to use cached root descriptor URL: %hs", rootDescURL.c_str()); |
| 227 | LOGMESSAGE("Net server: attempting to use cached root descriptor URL: %hs", rootDescURL.c_str()); |
228 | 228 | |
229 | 229 | int ret = 0; |
230 | 230 | bool allocatedUrls = false; |
… |
… |
void* CNetServerWorker::SetupUPnP(void*)
|
232 | 232 | // Try a cached URL first |
233 | 233 | if (!rootDescURL.empty() && UPNP_GetIGDFromUrl(rootDescURL.c_str(), &urls, &data, internalIPAddress, sizeof(internalIPAddress))) |
234 | 234 | { |
235 | | LOGMESSAGE(L"Net server: using cached IGD = %hs", urls.controlURL); |
| 235 | LOGMESSAGE("Net server: using cached IGD = %hs", urls.controlURL); |
236 | 236 | ret = 1; |
237 | 237 | } |
238 | 238 | // No cached URL, or it did not respond. Try getting a valid UPnP device for 10 seconds. |
… |
… |
void* CNetServerWorker::SetupUPnP(void*)
|
243 | 243 | } |
244 | 244 | else |
245 | 245 | { |
246 | | LOGMESSAGE(L"Net server: upnpDiscover failed and no working cached URL."); |
| 246 | LOGMESSAGE("Net server: upnpDiscover failed and no working cached URL."); |
247 | 247 | return NULL; |
248 | 248 | } |
249 | 249 | |
250 | 250 | switch (ret) |
251 | 251 | { |
252 | 252 | case 0: |
253 | | LOGMESSAGE(L"Net server: No IGD found"); |
| 253 | LOGMESSAGE("Net server: No IGD found"); |
254 | 254 | break; |
255 | 255 | case 1: |
256 | | LOGMESSAGE(L"Net server: found valid IGD = %hs", urls.controlURL); |
| 256 | LOGMESSAGE("Net server: found valid IGD = %hs", urls.controlURL); |
257 | 257 | break; |
258 | 258 | case 2: |
259 | | LOGMESSAGE(L"Net server: found a valid, not connected IGD = %hs, will try to continue anyway", urls.controlURL); |
| 259 | LOGMESSAGE("Net server: found a valid, not connected IGD = %hs, will try to continue anyway", urls.controlURL); |
260 | 260 | break; |
261 | 261 | case 3: |
262 | | LOGMESSAGE(L"Net server: found a UPnP device unrecognized as IGD = %hs, will try to continue anyway", urls.controlURL); |
| 262 | LOGMESSAGE("Net server: found a UPnP device unrecognized as IGD = %hs, will try to continue anyway", urls.controlURL); |
263 | 263 | break; |
264 | 264 | default: |
265 | 265 | debug_warn(L"Unrecognized return value from UPNP_GetValidIGD"); |
… |
… |
void* CNetServerWorker::SetupUPnP(void*)
|
269 | 269 | ret = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress); |
270 | 270 | if (ret != UPNPCOMMAND_SUCCESS) |
271 | 271 | { |
272 | | LOGMESSAGE(L"Net server: GetExternalIPAddress failed with code %d (%hs)", ret, strupnperror(ret)); |
| 272 | LOGMESSAGE("Net server: GetExternalIPAddress failed with code %d (%hs)", ret, strupnperror(ret)); |
273 | 273 | return NULL; |
274 | 274 | } |
275 | | LOGMESSAGE(L"Net server: ExternalIPAddress = %hs", externalIPAddress); |
| 275 | LOGMESSAGE("Net server: ExternalIPAddress = %hs", externalIPAddress); |
276 | 276 | |
277 | 277 | // Try to setup port forwarding. |
278 | 278 | ret = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, psPort, psPort, |
279 | 279 | internalIPAddress, description, protocall, 0, leaseDuration); |
280 | 280 | if (ret != UPNPCOMMAND_SUCCESS) |
281 | 281 | { |
282 | | LOGMESSAGE(L"Net server: AddPortMapping(%hs, %hs, %hs) failed with code %d (%hs)", |
| 282 | LOGMESSAGE("Net server: AddPortMapping(%hs, %hs, %hs) failed with code %d (%hs)", |
283 | 283 | psPort, psPort, internalIPAddress, ret, strupnperror(ret)); |
284 | 284 | return NULL; |
285 | 285 | } |
… |
… |
void* CNetServerWorker::SetupUPnP(void*)
|
296 | 296 | |
297 | 297 | if (ret != UPNPCOMMAND_SUCCESS) |
298 | 298 | { |
299 | | LOGMESSAGE(L"Net server: GetSpecificPortMappingEntry() failed with code %d (%hs)", ret, strupnperror(ret)); |
| 299 | LOGMESSAGE("Net server: GetSpecificPortMappingEntry() failed with code %d (%hs)", ret, strupnperror(ret)); |
300 | 300 | return NULL; |
301 | 301 | } |
302 | 302 | |
303 | | LOGMESSAGE(L"Net server: External %hs:%hs %hs is redirected to internal %hs:%hs (duration=%hs)", |
| 303 | LOGMESSAGE("Net server: External %hs:%hs %hs is redirected to internal %hs:%hs (duration=%hs)", |
304 | 304 | externalIPAddress, psPort, protocall, intClient, intPort, duration); |
305 | 305 | |
306 | 306 | // Cache root descriptor URL to try to avoid discovery next time. |
307 | 307 | g_ConfigDB.SetValueString(CFG_USER, "network.upnprootdescurl", urls.controlURL); |
308 | 308 | g_ConfigDB.WriteFile(CFG_USER); |
309 | | LOGMESSAGE(L"Net server: cached UPnP root descriptor URL as %hs", urls.controlURL); |
| 309 | LOGMESSAGE("Net server: cached UPnP root descriptor URL as %hs", urls.controlURL); |
310 | 310 | |
311 | 311 | // Make sure everything is properly freed. |
312 | 312 | if (allocatedUrls) |
… |
… |
bool CNetServerWorker::RunStep()
|
451 | 451 | int status = enet_host_service(m_Host, &event, HOST_SERVICE_TIMEOUT); |
452 | 452 | if (status < 0) |
453 | 453 | { |
454 | | LOGERROR(L"CNetServerWorker: enet_host_service failed (%d)", status); |
| 454 | LOGERROR("CNetServerWorker: enet_host_service failed (%d)", status); |
455 | 455 | // TODO: notify game that the server has shut down |
456 | 456 | return false; |
457 | 457 | } |
… |
… |
bool CNetServerWorker::RunStep()
|
471 | 471 | // Report the client address |
472 | 472 | char hostname[256] = "(error)"; |
473 | 473 | enet_address_get_host_ip(&event.peer->address, hostname, ARRAY_SIZE(hostname)); |
474 | | LOGMESSAGE(L"Net server: Received connection from %hs:%u", hostname, (unsigned int)event.peer->address.port); |
| 474 | LOGMESSAGE("Net server: Received connection from %hs:%u", hostname, (unsigned int)event.peer->address.port); |
475 | 475 | |
476 | 476 | // Set up a session object for this peer |
477 | 477 | |
… |
… |
bool CNetServerWorker::RunStep()
|
496 | 496 | CNetServerSession* session = static_cast<CNetServerSession*>(event.peer->data); |
497 | 497 | if (session) |
498 | 498 | { |
499 | | LOGMESSAGE(L"Net server: Disconnected %hs", DebugName(session).c_str()); |
| 499 | LOGMESSAGE("Net server: Disconnected %hs", DebugName(session).c_str()); |
500 | 500 | |
501 | 501 | // Remove the session first, so we won't send player-update messages to it |
502 | 502 | // when updating the FSM |
… |
… |
bool CNetServerWorker::RunStep()
|
522 | 522 | CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, GetScriptInterface()); |
523 | 523 | if (msg) |
524 | 524 | { |
525 | | LOGMESSAGE(L"Net server: Received message %hs of size %lu from %hs", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str()); |
| 525 | LOGMESSAGE("Net server: Received message %hs of size %lu from %hs", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str()); |
526 | 526 | |
527 | 527 | HandleMessageReceive(msg, session); |
528 | 528 | |
… |
… |
void CNetServerWorker::HandleMessageReceive(const CNetMessage* message, CNetServ
|
566 | 566 | // Update FSM |
567 | 567 | bool ok = session->Update(message->GetType(), (void*)message); |
568 | 568 | if (!ok) |
569 | | LOGERROR(L"Net server: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)session->GetCurrState()); |
| 569 | LOGERROR("Net server: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)session->GetCurrState()); |
570 | 570 | } |
571 | 571 | |
572 | 572 | void CNetServerWorker::SetupSession(CNetServerSession* session) |
… |
… |
bool CNetServerWorker::OnAuthenticate(void* context, CFsmEvent* event)
|
810 | 810 | // Players who weren't already in the game are not allowed to join now that it's started |
811 | 811 | if (!isRejoining) |
812 | 812 | { |
813 | | LOGMESSAGE(L"Refused connection after game start from not-previously-known user \"%ls\"", username.c_str()); |
| 813 | LOGMESSAGE("Refused connection after game start from not-previously-known user \"%ls\"", username.c_str()); |
814 | 814 | session->Disconnect(NDR_SERVER_ALREADY_IN_GAME); |
815 | 815 | return true; |
816 | 816 | } |
-
diff --git a/source/network/NetSession.cpp b/source/network/NetSession.cpp
index 6bdaa57..cadf277 100644
a
|
b
|
void CNetClientSession::Poll()
|
112 | 112 | // Report the server address |
113 | 113 | char hostname[256] = "(error)"; |
114 | 114 | enet_address_get_host_ip(&event.peer->address, hostname, ARRAY_SIZE(hostname)); |
115 | | LOGMESSAGE(L"Net client: Connected to %hs:%u", hostname, (unsigned int)event.peer->address.port); |
| 115 | LOGMESSAGE("Net client: Connected to %hs:%u", hostname, (unsigned int)event.peer->address.port); |
116 | 116 | |
117 | 117 | m_Client.HandleConnect(); |
118 | 118 | |
… |
… |
void CNetClientSession::Poll()
|
123 | 123 | { |
124 | 124 | ENSURE(event.peer == m_Server); |
125 | 125 | |
126 | | LOGMESSAGE(L"Net client: Disconnected"); |
| 126 | LOGMESSAGE("Net client: Disconnected"); |
127 | 127 | m_Client.HandleDisconnect(event.data); |
128 | 128 | return; |
129 | 129 | } |
… |
… |
void CNetClientSession::Poll()
|
133 | 133 | CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, m_Client.GetScriptInterface()); |
134 | 134 | if (msg) |
135 | 135 | { |
136 | | LOGMESSAGE(L"Net client: Received message %hs of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength()); |
| 136 | LOGMESSAGE("Net client: Received message %hs of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength()); |
137 | 137 | |
138 | 138 | m_Client.HandleMessage(msg); |
139 | 139 | |
-
diff --git a/source/network/NetTurnManager.cpp b/source/network/NetTurnManager.cpp
index 70059ec..2b9ade2 100644
a
|
b
|
void CNetTurnManager::OnSyncError(u32 turn, const std::string& expectedHash)
|
244 | 244 | if (g_GUI) |
245 | 245 | g_GUI->DisplayMessageBox(600, 350, L"Sync error", msg.str()); |
246 | 246 | else |
247 | | LOGERROR(L"%ls", msg.str().c_str()); |
| 247 | LOGERROR("%ls", msg.str().c_str()); |
248 | 248 | } |
249 | 249 | |
250 | 250 | void CNetTurnManager::Interpolate(float simFrameLength, float realFrameLength) |
… |
… |
void CNetTurnManager::QuickSave()
|
327 | 327 | bool ok = m_Simulation2.SerializeState(stream); |
328 | 328 | if (!ok) |
329 | 329 | { |
330 | | LOGERROR(L"Failed to quicksave game"); |
| 330 | LOGERROR("Failed to quicksave game"); |
331 | 331 | return; |
332 | 332 | } |
333 | 333 | |
… |
… |
void CNetTurnManager::QuickSave()
|
337 | 337 | else |
338 | 338 | m_QuickSaveMetadata = std::string(); |
339 | 339 | |
340 | | LOGMESSAGERENDER(L"Quicksaved game"); |
| 340 | LOGMESSAGERENDER("Quicksaved game"); |
341 | 341 | |
342 | 342 | } |
343 | 343 | |
… |
… |
void CNetTurnManager::QuickLoad()
|
347 | 347 | |
348 | 348 | if (m_QuickSaveState.empty()) |
349 | 349 | { |
350 | | LOGERROR(L"Cannot quickload game - no game was quicksaved"); |
| 350 | LOGERROR("Cannot quickload game - no game was quicksaved"); |
351 | 351 | return; |
352 | 352 | } |
353 | 353 | |
… |
… |
void CNetTurnManager::QuickLoad()
|
355 | 355 | bool ok = m_Simulation2.DeserializeState(stream); |
356 | 356 | if (!ok) |
357 | 357 | { |
358 | | LOGERROR(L"Failed to quickload game"); |
| 358 | LOGERROR("Failed to quickload game"); |
359 | 359 | return; |
360 | 360 | } |
361 | 361 | |
362 | 362 | if (g_GUI && !m_QuickSaveMetadata.empty()) |
363 | 363 | g_GUI->RestoreSavedGameData(m_QuickSaveMetadata); |
364 | 364 | |
365 | | LOGMESSAGERENDER(L"Quickloaded game"); |
| 365 | LOGMESSAGERENDER("Quickloaded game"); |
366 | 366 | |
367 | 367 | // See RewindTimeWarp |
368 | 368 | ResetState(0, 1); |
-
diff --git a/source/ps/CStrIntern.cpp b/source/ps/CStrIntern.cpp
index 53a5098..6d87a4c 100644
a
|
b
|
public:
|
30 | 30 | CStrInternInternals(const char* str, size_t len) |
31 | 31 | : data(str, str+len), hash(fnv_hash(str, len)) |
32 | 32 | { |
33 | | // LOGWARNING(L"New interned string '%hs'", data.c_str()); |
| 33 | // LOGWARNING("New interned string '%hs'", data.c_str()); |
34 | 34 | } |
35 | 35 | |
36 | 36 | bool operator==(const CStrInternInternals& b) const |
-
diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp
index 11ce79e..17b4838 100644
a
|
b
|
bool CConfigDB::Reload(EConfigNamespace ns)
|
214 | 214 | // Handle missing files quietly |
215 | 215 | if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0) |
216 | 216 | { |
217 | | LOGMESSAGE(L"Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string().c_str()); |
| 217 | LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string().c_str()); |
218 | 218 | return false; |
219 | 219 | } |
220 | 220 | |
221 | | LOGMESSAGE(L"Loading config file \"%ls\"", m_ConfigFile[ns].string().c_str()); |
| 221 | LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string().c_str()); |
222 | 222 | Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen); |
223 | 223 | if (ret != INFO::OK) |
224 | 224 | { |
225 | | LOGERROR(L"CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string().c_str(), (long long)ret); |
| 225 | LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string().c_str(), (long long)ret); |
226 | 226 | return false; |
227 | 227 | } |
228 | 228 | } |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
256 | 256 | |
257 | 257 | if (pos == filebufend || *pos == '\n') |
258 | 258 | { |
259 | | LOGERROR(L"Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); |
| 259 | LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); |
260 | 260 | header.clear(); |
261 | 261 | ++line; |
262 | 262 | continue; |
263 | 263 | } |
264 | 264 | |
265 | | LOGMESSAGE(L"Found config header '%hs'", header.c_str()); |
| 265 | LOGMESSAGE("Found config header '%hs'", header.c_str()); |
266 | 266 | header.push_back('.'); |
267 | 267 | while (++pos < filebufend && *pos != '\n' && *pos != ';') |
268 | 268 | if (*pos != ' ' && *pos != '\r') |
269 | 269 | { |
270 | | LOGERROR(L"Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); |
| 270 | LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); |
271 | 271 | break; |
272 | 272 | } |
273 | 273 | while (pos < filebufend && *pos != '\n') |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
288 | 288 | { |
289 | 289 | if (*pos == '\\' && ++pos == filebufend) |
290 | 290 | { |
291 | | LOGERROR(L"Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string().c_str()); |
| 291 | LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string().c_str()); |
292 | 292 | break; |
293 | 293 | } |
294 | 294 | |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | if (quoted) // We ignore the invalid parameter |
319 | | LOGERROR(L"Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string().c_str(), line); |
| 319 | LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string().c_str(), line); |
320 | 320 | else if (!value.empty()) |
321 | 321 | values.push_back(value); |
322 | 322 | value.clear(); |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
337 | 337 | CStr key(header + name); |
338 | 338 | newMap[key] = values; |
339 | 339 | if (key == "lobby.password") |
340 | | LOGMESSAGE(L"Loaded config string \"%hs\"", key.c_str()); |
| 340 | LOGMESSAGE("Loaded config string \"%hs\"", key.c_str()); |
341 | 341 | else |
342 | 342 | { |
343 | 343 | std::string vals; |
344 | 344 | for (size_t i = 0; i < newMap[key].size() - 1; ++i) |
345 | 345 | vals += "\"" + EscapeString(newMap[key][i]) + "\", "; |
346 | 346 | vals += "\"" + EscapeString(newMap[key][values.size()-1]) + "\""; |
347 | | LOGMESSAGE(L"Loaded config string \"%hs\" = %hs", key.c_str(), vals.c_str()); |
| 347 | LOGMESSAGE("Loaded config string \"%hs\" = %hs", key.c_str(), vals.c_str()); |
348 | 348 | } |
349 | 349 | } |
350 | 350 | else if (!name.empty()) |
351 | | LOGERROR(L"Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string().c_str(), line); |
| 351 | LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string().c_str(), line); |
352 | 352 | |
353 | 353 | name.clear(); |
354 | 354 | values.clear(); |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
356 | 356 | } |
357 | 357 | |
358 | 358 | if (!name.empty()) |
359 | | LOGERROR(L"Config file does not have a new line after the last config setting '%hs'", name.c_str()); |
| 359 | LOGERROR("Config file does not have a new line after the last config setting '%hs'", name.c_str()); |
360 | 360 | |
361 | 361 | m_Map[ns].swap(newMap); |
362 | 362 | |
… |
… |
bool CConfigDB::WriteFile(EConfigNamespace ns, const VfsPath& path)
|
393 | 393 | Status ret = g_VFS->CreateFile(path, buf, len); |
394 | 394 | if (ret < 0) |
395 | 395 | { |
396 | | LOGERROR(L"CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string().c_str(), (int)ret); |
| 396 | LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string().c_str(), (int)ret); |
397 | 397 | return false; |
398 | 398 | } |
399 | 399 | |
-
diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp
index ad120fb..758ba81 100644
a
|
b
|
void DllLoader::LogLoadError(const char* errors)
|
196 | 196 | switch (m_LoadErrorLogMethod) |
197 | 197 | { |
198 | 198 | case CLogger::Normal: |
199 | | LOGMESSAGE(L"DllLoader: %hs", errors); |
| 199 | LOGMESSAGE("DllLoader: %hs", errors); |
200 | 200 | break; |
201 | 201 | case CLogger::Warning: |
202 | | LOGWARNING(L"DllLoader: %hs", errors); |
| 202 | LOGWARNING("DllLoader: %hs", errors); |
203 | 203 | break; |
204 | 204 | case CLogger::Error: |
205 | | LOGERROR(L"DllLoader: %hs", errors); |
| 205 | LOGERROR("DllLoader: %hs", errors); |
206 | 206 | break; |
207 | 207 | } |
208 | 208 | } |
-
diff --git a/source/ps/FileIo.cpp b/source/ps/FileIo.cpp
index e06d339..c345da7 100644
a
|
b
|
void CFilePacker::Write(const VfsPath& filename)
|
69 | 69 | const Status st = g_VFS->CreateFile(filename, m_writeBuffer.Data(), m_writeBuffer.Size()); |
70 | 70 | if (st < 0) |
71 | 71 | { |
72 | | LOGERROR(L"Failed to write file '%ls' with status '%lld'", filename.string().c_str(), (long long)st); |
| 72 | LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string().c_str(), (long long)st); |
73 | 73 | throw PSERROR_File_WriteFailed(); |
74 | 74 | } |
75 | 75 | } |
-
diff --git a/source/ps/Filesystem.cpp b/source/ps/Filesystem.cpp
index de0ba9e..d273ce5 100644
a
|
b
|
PSRETURN CVFSFile::Load(const PIVFS& vfs, const VfsPath& filename, bool log /* =
|
124 | 124 | if (ret != INFO::OK) |
125 | 125 | { |
126 | 126 | if (log) |
127 | | LOGERROR(L"CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string().c_str(), (long long)ret); |
| 127 | LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string().c_str(), (long long)ret); |
128 | 128 | m_Buffer.reset(); |
129 | 129 | m_BufferSize = 0; |
130 | 130 | return PSRETURN_CVFSFile_LoadFailed; |
-
diff --git a/source/ps/GameSetup/Config.cpp b/source/ps/GameSetup/Config.cpp
index 0f18291..67fc7b2 100644
a
|
b
|
static void LoadGlobals()
|
131 | 131 | CFG_GET_VAL("profiler2.script.enable", g_ScriptProfilingEnabled); |
132 | 132 | |
133 | 133 | if (g_JSDebuggerEnabled) |
134 | | LOGERROR(L"JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)"); |
| 134 | LOGERROR("JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)"); |
135 | 135 | // Script Debugging and profiling does not make sense together because of the hooks |
136 | 136 | // that reduce performance a lot - and it wasn't tested if it even works together. |
137 | 137 | if (g_JSDebuggerEnabled && g_ScriptProfilingEnabled) |
138 | | LOGERROR(L"Enabling both script profiling and script debugging is not supported!"); |
| 138 | LOGERROR("Enabling both script profiling and script debugging is not supported!"); |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
-
diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp
index 3709648..dac6867 100644
a
|
b
|
void Render()
|
293 | 293 | #warning TODO: cursors for Android |
294 | 294 | #else |
295 | 295 | if (cursor_draw(g_VFS, cursorName.c_str(), g_mouse_x, g_yres-g_mouse_y, forceGL) < 0) |
296 | | LOGWARNING(L"Failed to draw cursor '%ls'", cursorName.c_str()); |
| 296 | LOGWARNING("Failed to draw cursor '%ls'", cursorName.c_str()); |
297 | 297 | #endif |
298 | 298 | |
299 | 299 | #if CONFIG2_GLES |
… |
… |
static void InitSDL()
|
656 | 656 | |
657 | 657 | if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) < 0) |
658 | 658 | { |
659 | | LOGERROR(L"SDL library initialization failed: %hs", SDL_GetError()); |
| 659 | LOGERROR("SDL library initialization failed: %hs", SDL_GetError()); |
660 | 660 | throw PSERROR_System_SDLInitFailed(); |
661 | 661 | } |
662 | 662 | atexit(SDL_Quit); |
… |
… |
static void FixLocales()
|
814 | 814 | } |
815 | 815 | catch (std::runtime_error&) |
816 | 816 | { |
817 | | LOGWARNING(L"Invalid locale settings"); |
| 817 | LOGWARNING("Invalid locale settings"); |
818 | 818 | |
819 | 819 | for (size_t i = 0; i < ARRAY_SIZE(LocaleEnvVars); i++) |
820 | 820 | { |
821 | 821 | if (char* envval = getenv(LocaleEnvVars[i])) |
822 | | LOGWARNING(L" %hs=\"%hs\"", LocaleEnvVars[i], envval); |
| 822 | LOGWARNING(" %hs=\"%hs\"", LocaleEnvVars[i], envval); |
823 | 823 | else |
824 | | LOGWARNING(L" %hs=\"(unset)\"", LocaleEnvVars[i]); |
| 824 | LOGWARNING(" %hs=\"(unset)\"", LocaleEnvVars[i]); |
825 | 825 | } |
826 | 826 | |
827 | 827 | // We should set LC_ALL since it overrides LANG |
828 | 828 | if (setenv("LC_ALL", std::locale::classic().name().c_str(), 1)) |
829 | 829 | debug_warn(L"Invalid locale settings, and unable to set LC_ALL env variable."); |
830 | 830 | else |
831 | | LOGWARNING(L"Setting LC_ALL env variable to: %hs", getenv("LC_ALL")); |
| 831 | LOGWARNING("Setting LC_ALL env variable to: %hs", getenv("LC_ALL")); |
832 | 832 | } |
833 | 833 | } |
834 | 834 | #else |
… |
… |
CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath)
|
1132 | 1132 | |
1133 | 1133 | if (INFO::OK != loadResult) |
1134 | 1134 | { |
1135 | | LOGERROR(L"LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string().c_str()); |
| 1135 | LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string().c_str()); |
1136 | 1136 | throw PSERROR_Game_World_MapLoadFailed("Unable to load map file, check the path for typos."); |
1137 | 1137 | } |
1138 | 1138 | XMBElement mapElement = mapFile.GetRoot(); |
… |
… |
bool Autostart(const CmdLineArgs& args)
|
1246 | 1246 | else |
1247 | 1247 | { |
1248 | 1248 | // Problem with JSON file |
1249 | | LOGERROR(L"Autostart: Error reading random map script '%ls'", scriptPath.c_str()); |
| 1249 | LOGERROR("Autostart: Error reading random map script '%ls'", scriptPath.c_str()); |
1250 | 1250 | throw PSERROR_Game_World_MapLoadFailed("Error reading random map script.\nCheck application log for details."); |
1251 | 1251 | } |
1252 | 1252 | |
… |
… |
bool Autostart(const CmdLineArgs& args)
|
1301 | 1301 | } |
1302 | 1302 | else |
1303 | 1303 | { |
1304 | | LOGERROR(L"Autostart: Unrecognized map type '%ls'", mapDirectory.c_str()); |
| 1304 | LOGERROR("Autostart: Unrecognized map type '%ls'", mapDirectory.c_str()); |
1305 | 1305 | throw PSERROR_Game_World_MapLoadFailed("Unrecognized map type.\nConsult readme.txt for the currently supported types."); |
1306 | 1306 | } |
1307 | 1307 | scriptInterface.SetProperty(attrs, "mapType", mapType); |
… |
… |
bool Autostart(const CmdLineArgs& args)
|
1336 | 1336 | if (mapDirectory == L"scenarios" || mapDirectory == L"skirmishes") |
1337 | 1337 | { |
1338 | 1338 | // playerID is certainly bigger than this map player number |
1339 | | LOGWARNING(L"Autostart: Invalid player %d in autostart-ai option", playerID); |
| 1339 | LOGWARNING("Autostart: Invalid player %d in autostart-ai option", playerID); |
1340 | 1340 | continue; |
1341 | 1341 | } |
1342 | 1342 | scriptInterface.Eval("({})", &player); |
… |
… |
bool Autostart(const CmdLineArgs& args)
|
1363 | 1363 | if (mapDirectory == L"scenarios" || mapDirectory == L"skirmishes") |
1364 | 1364 | { |
1365 | 1365 | // playerID is certainly bigger than this map player number |
1366 | | LOGWARNING(L"Autostart: Invalid player %d in autostart-aidiff option", playerID); |
| 1366 | LOGWARNING("Autostart: Invalid player %d in autostart-aidiff option", playerID); |
1367 | 1367 | continue; |
1368 | 1368 | } |
1369 | 1369 | scriptInterface.Eval("({})", &player); |
… |
… |
bool Autostart(const CmdLineArgs& args)
|
1391 | 1391 | if (mapDirectory == L"skirmishes") |
1392 | 1392 | { |
1393 | 1393 | // playerID is certainly bigger than this map player number |
1394 | | LOGWARNING(L"Autostart: Invalid player %d in autostart-civ option", playerID); |
| 1394 | LOGWARNING("Autostart: Invalid player %d in autostart-civ option", playerID); |
1395 | 1395 | continue; |
1396 | 1396 | } |
1397 | 1397 | scriptInterface.Eval("({})", &player); |
… |
… |
bool Autostart(const CmdLineArgs& args)
|
1403 | 1403 | } |
1404 | 1404 | } |
1405 | 1405 | else |
1406 | | LOGWARNING(L"Autostart: Option 'autostart-civ' is invalid for scenarios"); |
| 1406 | LOGWARNING("Autostart: Option 'autostart-civ' is invalid for scenarios"); |
1407 | 1407 | } |
1408 | 1408 | |
1409 | 1409 | // Add player data to map settings |
-
diff --git a/source/ps/GameSetup/HWDetect.cpp b/source/ps/GameSetup/HWDetect.cpp
index 4d7668a..97276f7 100644
a
|
b
|
void RunHardwareDetection()
|
203 | 203 | CVFSFile file; |
204 | 204 | if (file.Load(g_VFS, scriptName) != PSRETURN_OK) |
205 | 205 | { |
206 | | LOGERROR(L"Failed to load hardware detection script"); |
| 206 | LOGERROR("Failed to load hardware detection script"); |
207 | 207 | return; |
208 | 208 | } |
209 | 209 | |
-
diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp
index 7d9883e..aeeca95 100644
a
|
b
|
Paths::Paths(const CmdLineArgs& args)
|
172 | 172 | // make sure it's valid |
173 | 173 | if(!FileExists(pathname)) |
174 | 174 | { |
175 | | LOGERROR(L"Cannot find executable (expected at '%ls')", pathname.string().c_str()); |
| 175 | LOGERROR("Cannot find executable (expected at '%ls')", pathname.string().c_str()); |
176 | 176 | WARN_IF_ERR(StatusFromErrno()); |
177 | 177 | } |
178 | 178 | |
-
diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp
index 22ceeba..cd7730b 100644
a
|
b
|
static void LoadConfigBindings()
|
83 | 83 | int mapping = FindKeyCode(*it); |
84 | 84 | if (!mapping) |
85 | 85 | { |
86 | | LOGWARNING(L"Hotkey mapping used invalid key '%hs'", hotkey.c_str()); |
| 86 | LOGWARNING("Hotkey mapping used invalid key '%hs'", hotkey.c_str()); |
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | |
-
diff --git a/source/ps/Joystick.cpp b/source/ps/Joystick.cpp
index 2950620..3fa207a 100644
a
|
b
|
void CJoystick::Initialise()
|
41 | 41 | |
42 | 42 | if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) |
43 | 43 | { |
44 | | LOGERROR(L"CJoystick::Initialise failed to initialise joysticks (\"%hs\")", SDL_GetError()); |
| 44 | LOGERROR("CJoystick::Initialise failed to initialise joysticks (\"%hs\")", SDL_GetError()); |
45 | 45 | return; |
46 | 46 | } |
47 | 47 | |
48 | 48 | int numJoysticks = SDL_NumJoysticks(); |
49 | 49 | |
50 | | LOGMESSAGE(L"Found %d joystick(s)", numJoysticks); |
| 50 | LOGMESSAGE("Found %d joystick(s)", numJoysticks); |
51 | 51 | |
52 | 52 | for (int i = 0; i < numJoysticks; ++i) |
53 | 53 | { |
… |
… |
void CJoystick::Initialise()
|
55 | 55 | SDL_Joystick* stick = SDL_JoystickOpen(i); |
56 | 56 | if (!stick) |
57 | 57 | { |
58 | | LOGERROR(L"CJoystick::Initialise failed to open joystick %d (\"%hs\")", i, SDL_GetError()); |
| 58 | LOGERROR("CJoystick::Initialise failed to open joystick %d (\"%hs\")", i, SDL_GetError()); |
59 | 59 | continue; |
60 | 60 | } |
61 | 61 | const char* name = SDL_JoystickName(stick); |
62 | 62 | #else // SDL 1.2 |
63 | 63 | const char* name = SDL_JoystickName(i); |
64 | 64 | #endif |
65 | | LOGMESSAGE(L"Joystick %d: %hs", i, name); |
| 65 | LOGMESSAGE("Joystick %d: %hs", i, name); |
66 | 66 | #if SDL_VERSION_ATLEAST(2, 0, 0) |
67 | 67 | SDL_JoystickClose(stick); |
68 | 68 | #endif |
… |
… |
void CJoystick::Initialise()
|
75 | 75 | // Always pick the first joystick, and assume that's the right one |
76 | 76 | m_Joystick = SDL_JoystickOpen(0); |
77 | 77 | if (!m_Joystick) |
78 | | LOGERROR(L"CJoystick::Initialise failed to open joystick (\"%hs\")", SDL_GetError()); |
| 78 | LOGERROR("CJoystick::Initialise failed to open joystick (\"%hs\")", SDL_GetError()); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
-
diff --git a/source/ps/Overlay.cpp b/source/ps/Overlay.cpp
index f09d3d2..a7e90aa 100644
a
|
b
|
bool CColor::ParseString(const CStr8& Value, int DefaultAlpha)
|
48 | 48 | stream >> values[i]; |
49 | 49 | if ((stream.rdstate() & std::stringstream::failbit) != 0) |
50 | 50 | { |
51 | | LOGWARNING(L"Unable to parse CColor parameters. Your input: '%hs'", Value.c_str()); |
| 51 | LOGWARNING("Unable to parse CColor parameters. Your input: '%hs'", Value.c_str()); |
52 | 52 | return false; |
53 | 53 | } |
54 | 54 | if (values[i] < 0 || values[i] > 255) |
55 | 55 | { |
56 | | LOGWARNING(L"Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%hs'", Value.c_str()); |
| 56 | LOGWARNING("Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%hs'", Value.c_str()); |
57 | 57 | return false; |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | 61 | if (i < 3) |
62 | 62 | { |
63 | | LOGWARNING(L"Not enough parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); |
| 63 | LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); |
64 | 64 | return false; |
65 | 65 | } |
66 | 66 | if (!stream.eof()) |
67 | 67 | { |
68 | | LOGWARNING(L"Too many parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); |
| 68 | LOGWARNING("Too many parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); |
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | |
-
diff --git a/source/ps/Preprocessor.cpp b/source/ps/Preprocessor.cpp
index d7c228d..7821423 100644
a
|
b
|
static void DefaultError (void *iData, int iLine, const char *iError,
|
231 | 231 | { |
232 | 232 | (void)iData; |
233 | 233 | if (iToken) |
234 | | LOGERROR(L"Preprocessor error: line %d: %hs: '%.*hs'\n", |
| 234 | LOGERROR("Preprocessor error: line %d: %hs: '%.*hs'\n", |
235 | 235 | iLine, iError, int (iTokenLen), iToken); |
236 | 236 | else |
237 | | LOGERROR(L"Preprocessor error: line %d: %hs\n", iLine, iError); |
| 237 | LOGERROR("Preprocessor error: line %d: %hs\n", iLine, iError); |
238 | 238 | } |
239 | 239 | |
240 | 240 | //---------------------------------------------------------------------------// |
-
diff --git a/source/ps/PreprocessorWrapper.cpp b/source/ps/PreprocessorWrapper.cpp
index 720edb1..096d284 100644
a
|
b
|
bool CPreprocessorWrapper::TestConditional(const CStr& expr)
|
51 | 51 | |
52 | 52 | if (!output) |
53 | 53 | { |
54 | | LOGERROR(L"Failed to parse conditional expression '%hs'", expr.c_str()); |
| 54 | LOGERROR("Failed to parse conditional expression '%hs'", expr.c_str()); |
55 | 55 | return false; |
56 | 56 | } |
57 | 57 | |
… |
… |
CStr CPreprocessorWrapper::Preprocess(const CStr& input)
|
72 | 72 | |
73 | 73 | if (!output) |
74 | 74 | { |
75 | | LOGERROR(L"Shader preprocessing failed"); |
| 75 | LOGERROR("Shader preprocessing failed"); |
76 | 76 | return ""; |
77 | 77 | } |
78 | 78 | |
-
diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp
index e976e90..fe6fdab 100644
a
|
b
|
void CProfileViewer::SaveToFile()
|
570 | 570 | |
571 | 571 | if (m->outputStream.fail()) |
572 | 572 | { |
573 | | LOGERROR(L"Failed to open profile log file"); |
| 573 | LOGERROR("Failed to open profile log file"); |
574 | 574 | return; |
575 | 575 | } |
576 | 576 | else |
577 | 577 | { |
578 | | LOGMESSAGERENDER(L"Profiler snapshot saved to '%ls'", path.string().c_str()); |
| 578 | LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string().c_str()); |
579 | 579 | } |
580 | 580 | } |
581 | 581 | |
-
diff --git a/source/ps/Profiler2.cpp b/source/ps/Profiler2.cpp
index ae49b0c..d989e42 100644
a
|
b
|
static void* MgCallback(mg_event event, struct mg_connection *conn, const struct
|
126 | 126 | |
127 | 127 | case MG_EVENT_LOG: |
128 | 128 | // Called by Mongoose's cry() |
129 | | LOGERROR(L"Mongoose error: %hs", request_info->log_message); |
| 129 | LOGERROR("Mongoose error: %hs", request_info->log_message); |
130 | 130 | return NULL; |
131 | 131 | |
132 | 132 | case MG_INIT_SSL: |
… |
… |
void CProfiler2::InitialiseGPU()
|
157 | 157 | void CProfiler2::EnableHTTP() |
158 | 158 | { |
159 | 159 | ENSURE(m_Initialised); |
160 | | LOGMESSAGERENDER(L"Starting profiler2 HTTP server"); |
| 160 | LOGMESSAGERENDER("Starting profiler2 HTTP server"); |
161 | 161 | |
162 | 162 | // Ignore multiple enablings |
163 | 163 | if (m_MgContext) |
… |
… |
void CProfiler2::EnableGPU()
|
177 | 177 | ENSURE(m_Initialised); |
178 | 178 | if (!m_GPU) |
179 | 179 | { |
180 | | LOGMESSAGERENDER(L"Starting profiler2 GPU mode"); |
| 180 | LOGMESSAGERENDER("Starting profiler2 GPU mode"); |
181 | 181 | InitialiseGPU(); |
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
185 | 185 | void CProfiler2::ShutdownGPU() |
186 | 186 | { |
187 | | LOGMESSAGERENDER(L"Shutting down profiler2 GPU mode"); |
| 187 | LOGMESSAGERENDER("Shutting down profiler2 GPU mode"); |
188 | 188 | SAFE_DELETE(m_GPU); |
189 | 189 | } |
190 | 190 | |
191 | 191 | void CProfiler2::ShutDownHTTP() |
192 | 192 | { |
193 | | LOGMESSAGERENDER(L"Shutting down profiler2 HTTP server"); |
| 193 | LOGMESSAGERENDER("Shutting down profiler2 HTTP server"); |
194 | 194 | if (m_MgContext) |
195 | 195 | { |
196 | 196 | mg_stop(m_MgContext); |
-
diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp
index 007dcb2..7bc32af 100644
a
|
b
|
std::vector<CScriptValRooted> SavedGames::GetSavedGames(ScriptInterface& scriptI
|
244 | 244 | if (!archiveReader) |
245 | 245 | { |
246 | 246 | // Triggered by e.g. the file being open in another program |
247 | | LOGWARNING(L"Failed to read saved game '%ls'", realPath.string().c_str()); |
| 247 | LOGWARNING("Failed to read saved game '%ls'", realPath.string().c_str()); |
248 | 248 | continue; // skip this file |
249 | 249 | } |
250 | 250 | |
-
diff --git a/source/ps/TemplateLoader.cpp b/source/ps/TemplateLoader.cpp
index d2e8345..67029d6 100644
a
|
b
|
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
39 | 39 | // Handle infinite loops more gracefully than running out of stack space and crashing |
40 | 40 | if (depth > 100) |
41 | 41 | { |
42 | | LOGERROR(L"Probable infinite inheritance loop in entity template '%hs'", templateName.c_str()); |
| 42 | LOGERROR("Probable infinite inheritance loop in entity template '%hs'", templateName.c_str()); |
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
57 | 57 | std::string baseName = templateName.substr(8); |
58 | 58 | if (!LoadTemplateFile(baseName, depth+1)) |
59 | 59 | { |
60 | | LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); |
| 60 | LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); |
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | // Copy a subset to the requested template |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
72 | 72 | std::string baseName = templateName.substr(7); |
73 | 73 | if (!LoadTemplateFile(baseName, depth+1)) |
74 | 74 | { |
75 | | LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); |
| 75 | LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); |
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | // Copy a subset to the requested template |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
87 | 87 | std::string baseName = templateName.substr(7); |
88 | 88 | if (!LoadTemplateFile(baseName, depth+1)) |
89 | 89 | { |
90 | | LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); |
| 90 | LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); |
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | // Copy a subset to the requested template |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
102 | 102 | std::string baseName = templateName.substr(11); |
103 | 103 | if (!LoadTemplateFile(baseName, depth+1)) |
104 | 104 | { |
105 | | LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); |
| 105 | LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); |
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | // Copy a subset to the requested template |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
117 | 117 | std::string baseName = templateName.substr(13); |
118 | 118 | if (!LoadTemplateFile(baseName, depth+1)) |
119 | 119 | { |
120 | | LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); |
| 120 | LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); |
121 | 121 | return false; |
122 | 122 | } |
123 | 123 | // Copy a subset to the requested template |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
132 | 132 | std::string baseName = templateName.substr(9); |
133 | 133 | if (!LoadTemplateFile(baseName, depth+1)) |
134 | 134 | { |
135 | | LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); |
| 135 | LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); |
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | // Copy a subset to the requested template |
… |
… |
bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept
|
155 | 155 | // To prevent needless complexity in template design, we don't allow |-separated strings as parents |
156 | 156 | if (parentName.find('|') != parentName.npos) |
157 | 157 | { |
158 | | LOGERROR(L"Invalid parent '%hs' in entity template '%hs'", parentName.c_str(), templateName.c_str()); |
| 158 | LOGERROR("Invalid parent '%hs' in entity template '%hs'", parentName.c_str(), templateName.c_str()); |
159 | 159 | return false; |
160 | 160 | } |
161 | 161 | |
162 | 162 | // Ensure the parent is loaded |
163 | 163 | if (!LoadTemplateFile(parentName, depth+1)) |
164 | 164 | { |
165 | | LOGERROR(L"Failed to load parent '%hs' of entity template '%hs'", parentName.c_str(), templateName.c_str()); |
| 165 | LOGERROR("Failed to load parent '%hs' of entity template '%hs'", parentName.c_str(), templateName.c_str()); |
166 | 166 | return false; |
167 | 167 | } |
168 | 168 | |
… |
… |
std::vector<std::string> CTemplateLoader::FindPlaceableTemplates(const std::stri
|
272 | 272 | } |
273 | 273 | |
274 | 274 | if (templatesType != SIMULATION_TEMPLATES && templatesType != ACTOR_TEMPLATES && templatesType != ALL_TEMPLATES) |
275 | | LOGERROR(L"Undefined template type (valid: all, simulation, actor)"); |
| 275 | LOGERROR("Undefined template type (valid: all, simulation, actor)"); |
276 | 276 | |
277 | 277 | return templates; |
278 | 278 | } |
… |
… |
std::vector<std::string> CTemplateLoader::FindTemplates(const std::string& path,
|
304 | 304 | } |
305 | 305 | |
306 | 306 | if (templatesType != SIMULATION_TEMPLATES && templatesType != ACTOR_TEMPLATES && templatesType != ALL_TEMPLATES) |
307 | | LOGERROR(L"Undefined template type (valid: all, simulation, actor)"); |
| 307 | LOGERROR("Undefined template type (valid: all, simulation, actor)"); |
308 | 308 | |
309 | 309 | return templates; |
310 | 310 | } |
… |
… |
const CParamNode& CTemplateLoader::GetTemplateFileData(const std::string& templa
|
314 | 314 | // Load the template if necessary |
315 | 315 | if (!LoadTemplateFile(templateName, 0)) |
316 | 316 | { |
317 | | LOGERROR(L"Failed to load entity template '%hs'", templateName.c_str()); |
| 317 | LOGERROR("Failed to load entity template '%hs'", templateName.c_str()); |
318 | 318 | return NULL_NODE; |
319 | 319 | } |
320 | 320 | |
… |
… |
void CTemplateLoader::ConstructTemplateActor(const std::string& actorName, CPara
|
327 | 327 | const char* templateName = "special/actor"; |
328 | 328 | if (!LoadTemplateFile(templateName, 0)) |
329 | 329 | { |
330 | | LOGERROR(L"Failed to load entity template '%hs'", templateName); |
| 330 | LOGERROR("Failed to load entity template '%hs'", templateName); |
331 | 331 | return; |
332 | 332 | } |
333 | 333 | |
-
diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp
index 3817112..62f2897 100644
a
|
b
|
void WriteScreenshot(const VfsPath& extension)
|
244 | 244 | LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str()); |
245 | 245 | } |
246 | 246 | else |
247 | | LOGERROR(L"Error writing screenshot to '%ls'", filename.string().c_str()); |
| 247 | LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str()); |
248 | 248 | } |
249 | 249 | |
250 | 250 | |
… |
… |
void WriteBigScreenshot(const VfsPath& extension, int tiles)
|
377 | 377 | LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str()); |
378 | 378 | } |
379 | 379 | else |
380 | | LOGERROR(L"Error writing screenshot to '%ls'", filename.string().c_str()); |
| 380 | LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str()); |
381 | 381 | |
382 | 382 | free(tile_data); |
383 | 383 | } |
-
diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp
index 7ff6870..626ca22 100644
a
|
b
|
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
88 | 88 | // If fullscreen fails, try windowed mode |
89 | 89 | if (fullscreen) |
90 | 90 | { |
91 | | LOGWARNING(L"Failed to set the video mode to fullscreen for the chosen resolution " |
| 91 | LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution " |
92 | 92 | L"%dx%d:%d (\"%hs\"), falling back to windowed mode", |
93 | 93 | w, h, bpp, SDL_GetError()); |
94 | 94 | // Using default size for the window for now, as the attempted setting |
… |
… |
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
97 | 97 | } |
98 | 98 | else |
99 | 99 | { |
100 | | LOGERROR(L"SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%hs\")", |
| 100 | LOGERROR("SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%hs\")", |
101 | 101 | w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); |
102 | 102 | return false; |
103 | 103 | } |
… |
… |
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
105 | 105 | |
106 | 106 | if (SDL_SetWindowDisplayMode(m_Window, NULL) < 0) |
107 | 107 | { |
108 | | LOGERROR(L"SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%hs\")", |
| 108 | LOGERROR("SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%hs\")", |
109 | 109 | w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); |
110 | 110 | return false; |
111 | 111 | } |
… |
… |
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
113 | 113 | SDL_GLContext context = SDL_GL_CreateContext(m_Window); |
114 | 114 | if (!context) |
115 | 115 | { |
116 | | LOGERROR(L"SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%hs\")", |
| 116 | LOGERROR("SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%hs\")", |
117 | 117 | w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); |
118 | 118 | return false; |
119 | 119 | } |
… |
… |
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
132 | 132 | |
133 | 133 | if (SDL_SetWindowFullscreen(m_Window, flags) < 0) |
134 | 134 | { |
135 | | LOGERROR(L"SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%hs\")", |
| 135 | LOGERROR("SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%hs\")", |
136 | 136 | w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); |
137 | 137 | return false; |
138 | 138 | } |
… |
… |
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
172 | 172 | // If fullscreen fails, try windowed mode |
173 | 173 | if (fullscreen) |
174 | 174 | { |
175 | | LOGWARNING(L"Failed to set the video mode to fullscreen for the chosen resolution " |
| 175 | LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution " |
176 | 176 | L"%dx%d:%d (\"%hs\"), falling back to windowed mode", |
177 | 177 | w, h, bpp, SDL_GetError()); |
178 | 178 | // Using default size for the window for now, as the attempted setting |
… |
… |
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
181 | 181 | } |
182 | 182 | else |
183 | 183 | { |
184 | | LOGERROR(L"SetVideoMode failed: %dx%d:%d %d (\"%hs\")", |
| 184 | LOGERROR("SetVideoMode failed: %dx%d:%d %d (\"%hs\")", |
185 | 185 | w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); |
186 | 186 | return false; |
187 | 187 | } |
… |
… |
bool CVideoMode::InitSDL()
|
294 | 294 | u16 ramp[256]; |
295 | 295 | SDL_CalculateGammaRamp(g_Gamma, ramp); |
296 | 296 | if (SDL_SetWindowGammaRamp(m_Window, ramp, ramp, ramp) < 0) |
297 | | LOGWARNING(L"SDL_SetWindowGammaRamp failed"); |
| 297 | LOGWARNING("SDL_SetWindowGammaRamp failed"); |
298 | 298 | #else |
299 | 299 | # if OS_MACOSX |
300 | 300 | // Workaround for crash on Mavericks, see http://trac.wildfiregames.com/ticket/2272 |
… |
… |
bool CVideoMode::InitSDL()
|
304 | 304 | { |
305 | 305 | # endif |
306 | 306 | if (SDL_SetGamma(g_Gamma, g_Gamma, g_Gamma) < 0) |
307 | | LOGWARNING(L"SDL_SetGamma failed"); |
| 307 | LOGWARNING("SDL_SetGamma failed"); |
308 | 308 | # if OS_MACOSX |
309 | 309 | } |
310 | 310 | # endif |
-
diff --git a/source/ps/World.cpp b/source/ps/World.cpp
index 879825d..12de4d0 100644
a
|
b
|
void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings
|
89 | 89 | catch (PSERROR_File& err) |
90 | 90 | { |
91 | 91 | delete reader; |
92 | | LOGERROR(L"Failed to load map %ls: %hs", mapfilename.string().c_str(), err.what()); |
| 92 | LOGERROR("Failed to load map %ls: %hs", mapfilename.string().c_str(), err.what()); |
93 | 93 | throw PSERROR_Game_World_MapLoadFailed("Failed to load map.\nCheck application log for details."); |
94 | 94 | } |
95 | 95 | } |
-
diff --git a/source/ps/XML/RelaxNG.cpp b/source/ps/XML/RelaxNG.cpp
index 8a63869..57d6344 100644
a
|
b
|
public:
|
46 | 46 | xmlRelaxNGFreeParserCtxt(ctxt); |
47 | 47 | |
48 | 48 | if (m_Schema == NULL) |
49 | | LOGERROR(L"RelaxNGValidator: Failed to compile schema"); |
| 49 | LOGERROR("RelaxNGValidator: Failed to compile schema"); |
50 | 50 | } |
51 | 51 | |
52 | 52 | ~RelaxNGSchema() |
… |
… |
bool RelaxNGValidator::ValidateEncoded(const std::wstring& filename, const std::
|
108 | 108 | |
109 | 109 | if (!m_Schema) |
110 | 110 | { |
111 | | LOGERROR(L"RelaxNGValidator: No grammar loaded"); |
| 111 | LOGERROR("RelaxNGValidator: No grammar loaded"); |
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | 115 | xmlDocPtr doc = xmlReadMemory(document.c_str(), (int)document.size(), utf8_from_wstring(filename).c_str(), NULL, XML_PARSE_NONET); |
116 | 116 | if (doc == NULL) |
117 | 117 | { |
118 | | LOGERROR(L"RelaxNGValidator: Failed to parse document"); |
| 118 | LOGERROR("RelaxNGValidator: Failed to parse document"); |
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | |
… |
… |
bool RelaxNGValidator::ValidateEncoded(const std::wstring& filename, const std::
|
130 | 130 | } |
131 | 131 | else if (ret > 0) |
132 | 132 | { |
133 | | LOGERROR(L"RelaxNGValidator: Validation failed"); |
| 133 | LOGERROR("RelaxNGValidator: Validation failed"); |
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | else |
137 | 137 | { |
138 | | LOGERROR(L"RelaxNGValidator: Internal error %d", ret); |
| 138 | LOGERROR("RelaxNGValidator: Internal error %d", ret); |
139 | 139 | return false; |
140 | 140 | } |
141 | 141 | } |
-
diff --git a/source/ps/XML/XMLWriter.cpp b/source/ps/XML/XMLWriter.cpp
index e77ce17..ea99187 100644
a
|
b
|
bool XMLWriter_File::StoreVFS(const PIVFS& vfs, const VfsPath& pathname)
|
102 | 102 | Status ret = vfs->CreateFile(pathname, data, size); |
103 | 103 | if (ret < 0) |
104 | 104 | { |
105 | | LOGERROR(L"Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string().c_str()); |
| 105 | LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string().c_str()); |
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | return true; |
-
diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp
index e7b2e57..61fd869 100644
a
|
b
|
static void errorHandler(void* UNUSED(userData), xmlErrorPtr error)
|
38 | 38 | if (message.length() > 0 && message[message.length()-1] == '\n') |
39 | 39 | message.erase(message.length()-1); |
40 | 40 | |
41 | | LOGERROR(L"CXeromyces: Parse %ls: %hs:%d: %hs", |
| 41 | LOGERROR("CXeromyces: Parse %ls: %hs:%d: %hs", |
42 | 42 | error->level == XML_ERR_WARNING ? L"warning" : L"error", |
43 | 43 | error->file, error->line, message.c_str()); |
44 | 44 | // TODO: The (non-fatal) warnings and errors don't get stored in the XMB, |
… |
… |
PSRETURN CXeromyces::Load(const PIVFS& vfs, const VfsPath& filename)
|
89 | 89 | |
90 | 90 | // No source file or archive cache was found, so we can't load the |
91 | 91 | // XML file at all |
92 | | LOGERROR(L"CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string().c_str()); |
| 92 | LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string().c_str()); |
93 | 93 | return PSRETURN_Xeromyces_XMLOpenFailed; |
94 | 94 | } |
95 | 95 | |
… |
… |
PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons
|
111 | 111 | CVFSFile input; |
112 | 112 | if (input.Load(vfs, filename)) |
113 | 113 | { |
114 | | LOGERROR(L"CXeromyces: Failed to open XML file %ls", filename.string().c_str()); |
| 114 | LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string().c_str()); |
115 | 115 | return PSRETURN_Xeromyces_XMLOpenFailed; |
116 | 116 | } |
117 | 117 | |
… |
… |
PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons
|
120 | 120 | filename8.c_str(), NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA); |
121 | 121 | if (! doc) |
122 | 122 | { |
123 | | LOGERROR(L"CXeromyces: Failed to parse XML file %ls", filename.string().c_str()); |
| 123 | LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string().c_str()); |
124 | 124 | return PSRETURN_Xeromyces_XMLParseError; |
125 | 125 | } |
126 | 126 | |
… |
… |
PSRETURN CXeromyces::LoadString(const char* xml)
|
167 | 167 | xmlDocPtr doc = xmlReadMemory(xml, (int)strlen(xml), "", NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA); |
168 | 168 | if (! doc) |
169 | 169 | { |
170 | | LOGERROR(L"CXeromyces: Failed to parse XML string"); |
| 170 | LOGERROR("CXeromyces: Failed to parse XML string"); |
171 | 171 | return PSRETURN_Xeromyces_XMLParseError; |
172 | 172 | } |
173 | 173 | |
-
diff --git a/source/ps/scripting/JSInterface_ConfigDB.cpp b/source/ps/scripting/JSInterface_ConfigDB.cpp
index 43c6a4d..319db0e 100644
a
|
b
|
bool JSI_ConfigDB::GetConfigNamespace(std::wstring cfgNsString, EConfigNamespace
|
35 | 35 | cfgNs = CFG_MOD; |
36 | 36 | else |
37 | 37 | { |
38 | | LOGERROR(L"Invalid namespace name passed to the ConfigDB!"); |
| 38 | LOGERROR("Invalid namespace name passed to the ConfigDB!"); |
39 | 39 | cfgNs = CFG_DEFAULT; |
40 | 40 | return false; |
41 | 41 | } |
-
diff --git a/source/ps/scripting/JSInterface_Console.cpp b/source/ps/scripting/JSInterface_Console.cpp
index bc7ab85..d65d9a9 100644
a
|
b
|
bool JSI_Console::CheckGlobalInitialized()
|
26 | 26 | { |
27 | 27 | if (!g_Console) |
28 | 28 | { |
29 | | LOGERROR(L"Trying to access the console when it's not initialized!"); |
| 29 | LOGERROR("Trying to access the console when it's not initialized!"); |
30 | 30 | return false; |
31 | 31 | } |
32 | 32 | return true; |
-
diff --git a/source/ps/scripting/JSInterface_VFS.cpp b/source/ps/scripting/JSInterface_VFS.cpp
index ccc804b..bf74daf 100644
a
|
b
|
|
36 | 36 | }\ |
37 | 37 | /* unknown failure. We output an error message. */\ |
38 | 38 | else if (err < 0)\ |
39 | | LOGERROR(L"Unknown failure in VFS %i", err ); |
| 39 | LOGERROR("Unknown failure in VFS %i", err ); |
40 | 40 | /* else: success */ |
41 | 41 | |
42 | 42 | |
-
diff --git a/source/renderer/DecalRData.cpp b/source/renderer/DecalRData.cpp
index 0c85902..62c565b 100644
a
|
b
|
void CDecalRData::RenderDecals(std::vector<CDecalRData*>& decals, const CShaderD
|
84 | 84 | |
85 | 85 | if (material.GetShaderEffect().length() == 0) |
86 | 86 | { |
87 | | LOGERROR(L"Terrain renderer failed to load shader effect.\n"); |
| 87 | LOGERROR("Terrain renderer failed to load shader effect.\n"); |
88 | 88 | continue; |
89 | 89 | } |
90 | 90 | |
… |
… |
void CDecalRData::RenderDecals(std::vector<CDecalRData*>& decals, const CShaderD
|
98 | 98 | |
99 | 99 | if (!techBase) |
100 | 100 | { |
101 | | LOGERROR(L"Terrain renderer failed to load shader effect (%hs)\n", |
| 101 | LOGERROR("Terrain renderer failed to load shader effect (%hs)\n", |
102 | 102 | material.GetShaderEffect().string().c_str()); |
103 | 103 | continue; |
104 | 104 | } |
-
diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp
index 3737f61..03e621a 100644
a
|
b
|
void ModelRenderer::BuildPositionAndNormals(
|
98 | 98 | // some broken situations |
99 | 99 | if (numVertices && vertices[0].m_Blend.m_Bone[0] == 0xff) |
100 | 100 | { |
101 | | LOGERROR(L"Model %ls is boned with unboned animation", mdef->GetName().string().c_str()); |
| 101 | LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string().c_str()); |
102 | 102 | return; |
103 | 103 | } |
104 | 104 | |
-
diff --git a/source/renderer/PatchRData.cpp b/source/renderer/PatchRData.cpp
index c8c5553..2604567 100644
a
|
b
|
void CPatchRData::RenderBases(const std::vector<CPatchRData*>& patches, const CS
|
766 | 766 | { |
767 | 767 | if (itt->first->GetMaterial().GetShaderEffect().length() == 0) |
768 | 768 | { |
769 | | LOGERROR(L"Terrain renderer failed to load shader effect.\n"); |
| 769 | LOGERROR("Terrain renderer failed to load shader effect.\n"); |
770 | 770 | continue; |
771 | 771 | } |
772 | 772 | |
-
diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp
index 0dadb89..4d4bf7b 100644
a
|
b
|
void CPostprocManager::RecreateBuffers()
|
159 | 159 | GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
160 | 160 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
161 | 161 | { |
162 | | LOGWARNING(L"Framebuffer object incomplete (A): 0x%04X", status); |
| 162 | LOGWARNING("Framebuffer object incomplete (A): 0x%04X", status); |
163 | 163 | } |
164 | 164 | |
165 | 165 | pglGenFramebuffersEXT(1, &m_PongFbo); |
… |
… |
void CPostprocManager::RecreateBuffers()
|
174 | 174 | status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
175 | 175 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
176 | 176 | { |
177 | | LOGWARNING(L"Framebuffer object incomplete (B): 0x%04X", status); |
| 177 | LOGWARNING("Framebuffer object incomplete (B): 0x%04X", status); |
178 | 178 | } |
179 | 179 | |
180 | 180 | pglGenFramebuffersEXT(1, &m_BloomFbo); |
… |
… |
void CPostprocManager::RecreateBuffers()
|
187 | 187 | status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
188 | 188 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
189 | 189 | { |
190 | | LOGWARNING(L"Framebuffer object incomplete (B): 0x%04X", status); |
| 190 | LOGWARNING("Framebuffer object incomplete (B): 0x%04X", status); |
191 | 191 | } |
192 | 192 | */ |
193 | 193 | |
… |
… |
std::vector<CStrW> CPostprocManager::GetPostEffects()
|
519 | 519 | |
520 | 520 | VfsPaths pathnames; |
521 | 521 | if(vfs::GetPathnames(g_VFS, path, 0, pathnames) < 0) |
522 | | LOGERROR(L"Error finding Post effects in '%ls'", path.string().c_str()); |
| 522 | LOGERROR("Error finding Post effects in '%ls'", path.string().c_str()); |
523 | 523 | |
524 | 524 | for(size_t i = 0; i < pathnames.size(); i++) |
525 | 525 | { |
-
diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp
index 404d90a..398c331 100644
a
|
b
|
bool CRenderer::Open(int width, int height)
|
636 | 636 | |
637 | 637 | GLint bits; |
638 | 638 | glGetIntegerv(GL_DEPTH_BITS,&bits); |
639 | | LOGMESSAGE(L"CRenderer::Open: depth bits %d",bits); |
| 639 | LOGMESSAGE("CRenderer::Open: depth bits %d",bits); |
640 | 640 | glGetIntegerv(GL_STENCIL_BITS,&bits); |
641 | | LOGMESSAGE(L"CRenderer::Open: stencil bits %d",bits); |
| 641 | LOGMESSAGE("CRenderer::Open: stencil bits %d",bits); |
642 | 642 | glGetIntegerv(GL_ALPHA_BITS,&bits); |
643 | | LOGMESSAGE(L"CRenderer::Open: alpha bits %d",bits); |
| 643 | LOGMESSAGE("CRenderer::Open: alpha bits %d",bits); |
644 | 644 | |
645 | 645 | // Validate the currently selected render path |
646 | 646 | SetRenderPath(m_Options.m_RenderPath); |
… |
… |
void CRenderer::SetRenderPath(RenderPath rp)
|
808 | 808 | { |
809 | 809 | if (!(m_Caps.m_ARBProgram || (m_Caps.m_VertexShader && m_Caps.m_FragmentShader && m_Options.m_PreferGLSL))) |
810 | 810 | { |
811 | | LOGWARNING(L"Falling back to fixed function\n"); |
| 811 | LOGWARNING("Falling back to fixed function\n"); |
812 | 812 | rp = RP_FIXED; |
813 | 813 | } |
814 | 814 | } |
… |
… |
CRenderer::RenderPath CRenderer::GetRenderPathByName(const CStr& name)
|
843 | 843 | if (name == "default") |
844 | 844 | return RP_DEFAULT; |
845 | 845 | |
846 | | LOGWARNING(L"Unknown render path name '%hs', assuming 'default'", name.c_str()); |
| 846 | LOGWARNING("Unknown render path name '%hs', assuming 'default'", name.c_str()); |
847 | 847 | return RP_DEFAULT; |
848 | 848 | } |
849 | 849 | |
… |
… |
void CRenderer::EndFrame()
|
1629 | 1629 | int err = glGetError(); |
1630 | 1630 | if (err) |
1631 | 1631 | { |
1632 | | ONCE(LOGERROR(L"CRenderer::EndFrame: GL errors %i occurred", err)); |
| 1632 | ONCE(LOGERROR("CRenderer::EndFrame: GL errors %i occurred", err)); |
1633 | 1633 | } |
1634 | 1634 | } |
1635 | 1635 | } |
-
diff --git a/source/renderer/ShadowMap.cpp b/source/renderer/ShadowMap.cpp
index f776175..e23e555 100644
a
|
b
|
void ShadowMapInternals::CreateTexture()
|
406 | 406 | default: formatname = "DEPTH_COMPONENT"; break; |
407 | 407 | } |
408 | 408 | |
409 | | LOGMESSAGE(L"Creating shadow texture (size %dx%d) (format = %hs)", |
| 409 | LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %hs)", |
410 | 410 | Width, Height, formatname); |
411 | 411 | |
412 | 412 | |
… |
… |
void ShadowMapInternals::CreateTexture()
|
494 | 494 | |
495 | 495 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
496 | 496 | { |
497 | | LOGWARNING(L"Framebuffer object incomplete: 0x%04X", status); |
| 497 | LOGWARNING("Framebuffer object incomplete: 0x%04X", status); |
498 | 498 | |
499 | 499 | // Disable shadow rendering (but let the user try again if they want) |
500 | 500 | g_Renderer.m_Options.m_Shadows = false; |
-
diff --git a/source/renderer/SkyManager.cpp b/source/renderer/SkyManager.cpp
index e0368e7..013edbd 100644
a
|
b
|
void SkyManager::LoadSkyTextures()
|
126 | 126 | if (g_VFS->LoadFile(path2, file, fileSize) < 0) |
127 | 127 | { |
128 | 128 | glDeleteTextures(1, &m_SkyCubeMap); |
129 | | LOGERROR(L"Error creating sky cubemap."); |
| 129 | LOGERROR("Error creating sky cubemap."); |
130 | 130 | return; |
131 | 131 | } |
132 | 132 | } |
… |
… |
std::vector<CStrW> SkyManager::GetSkySets() const
|
207 | 207 | DirectoryNames subdirectories; |
208 | 208 | if(g_VFS->GetDirectoryEntries(path, 0, &subdirectories) < 0) |
209 | 209 | { |
210 | | LOGERROR(L"Error opening directory '%ls'", path.string().c_str()); |
| 210 | LOGERROR("Error opening directory '%ls'", path.string().c_str()); |
211 | 211 | return std::vector<CStrW>(1, GetSkySet()); // just return what we currently have |
212 | 212 | } |
213 | 213 | |
-
diff --git a/source/renderer/TerrainRenderer.cpp b/source/renderer/TerrainRenderer.cpp
index 4f6d9bc..026f49b 100644
a
|
b
|
bool TerrainRenderer::RenderFancyWater(const CShaderDefines& context, int cullGr
|
653 | 653 | |
654 | 654 | if (!m->fancyWaterShader) |
655 | 655 | { |
656 | | LOGERROR(L"Failed to load water shader. Falling back to fixed pipeline water.\n"); |
| 656 | LOGERROR("Failed to load water shader. Falling back to fixed pipeline water.\n"); |
657 | 657 | WaterMgr->m_RenderWater = false; |
658 | 658 | return false; |
659 | 659 | } |
-
diff --git a/source/renderer/VertexBufferManager.cpp b/source/renderer/VertexBufferManager.cpp
index d9ada2f..3911efa 100644
a
|
b
|
CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t
|
87 | 87 | |
88 | 88 | if (!result) |
89 | 89 | { |
90 | | LOGERROR(L"Failed to create VBOs (%lu*%lu)", (unsigned long)vertexSize, (unsigned long)numVertices); |
| 90 | LOGERROR("Failed to create VBOs (%lu*%lu)", (unsigned long)vertexSize, (unsigned long)numVertices); |
91 | 91 | } |
92 | 92 | |
93 | 93 | return result; |
-
diff --git a/source/renderer/WaterManager.cpp b/source/renderer/WaterManager.cpp
index aa66016..2e48d34 100644
a
|
b
|
int WaterManager::LoadWaterTextures()
|
326 | 326 | GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
327 | 327 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
328 | 328 | { |
329 | | LOGWARNING(L"Reflection framebuffer object incomplete: 0x%04X", status); |
| 329 | LOGWARNING("Reflection framebuffer object incomplete: 0x%04X", status); |
330 | 330 | g_Renderer.m_Options.m_WaterReflection = false; |
331 | 331 | } |
332 | 332 | |
… |
… |
int WaterManager::LoadWaterTextures()
|
341 | 341 | status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
342 | 342 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
343 | 343 | { |
344 | | LOGWARNING(L"Refraction framebuffer object incomplete: 0x%04X", status); |
| 344 | LOGWARNING("Refraction framebuffer object incomplete: 0x%04X", status); |
345 | 345 | g_Renderer.m_Options.m_WaterRefraction = false; |
346 | 346 | } |
347 | 347 | |
… |
… |
int WaterManager::LoadWaterTextures()
|
356 | 356 | status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); |
357 | 357 | if (status != GL_FRAMEBUFFER_COMPLETE_EXT) |
358 | 358 | { |
359 | | LOGWARNING(L"Fancy Effects framebuffer object incomplete: 0x%04X", status); |
| 359 | LOGWARNING("Fancy Effects framebuffer object incomplete: 0x%04X", status); |
360 | 360 | g_Renderer.m_Options.m_WaterRefraction = false; |
361 | 361 | } |
362 | 362 | |
-
diff --git a/source/scriptinterface/DebuggingServer.cpp b/source/scriptinterface/DebuggingServer.cpp
index fa484b0..1b8b9bf 100644
a
|
b
|
CDebuggingServer::CDebuggingServer() :
|
94 | 94 | m_SettingBreakOnException = true; |
95 | 95 | |
96 | 96 | EnableHTTP(); |
97 | | LOGWARNING(L"Javascript debugging webserver enabled."); |
| 97 | LOGWARNING("Javascript debugging webserver enabled."); |
98 | 98 | } |
99 | 99 | |
100 | 100 | CDebuggingServer::~CDebuggingServer() |
… |
… |
void* CDebuggingServer::MgDebuggingServerCallback(mg_event event, struct mg_conn
|
396 | 396 | |
397 | 397 | case MG_EVENT_LOG: |
398 | 398 | // Called by Mongoose's cry() |
399 | | LOGERROR(L"Mongoose error: %hs", request_info->log_message); |
| 399 | LOGERROR("Mongoose error: %hs", request_info->log_message); |
400 | 400 | return NULL; |
401 | 401 | |
402 | 402 | case MG_INIT_SSL: |
-
diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp
index d87ab68..aaba59a 100644
a
|
b
|
void ErrorReporter(JSContext* cx, const char* message, JSErrorReport* report)
|
126 | 126 | } |
127 | 127 | |
128 | 128 | if (isWarning) |
129 | | LOGWARNING(L"%hs", msg.str().c_str()); |
| 129 | LOGWARNING("%hs", msg.str().c_str()); |
130 | 130 | else |
131 | | LOGERROR(L"%hs", msg.str().c_str()); |
| 131 | LOGERROR("%hs", msg.str().c_str()); |
132 | 132 | |
133 | 133 | // When running under Valgrind, print more information in the error message |
134 | 134 | // VALGRIND_PRINTF_BACKTRACE("->"); |
… |
… |
JSBool logmsg(JSContext* cx, uint argc, jsval* vp)
|
163 | 163 | std::wstring str; |
164 | 164 | if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str)) |
165 | 165 | return JS_FALSE; |
166 | | LOGMESSAGE(L"%ls", str.c_str()); |
| 166 | LOGMESSAGE("%ls", str.c_str()); |
167 | 167 | args.rval().setUndefined(); |
168 | 168 | return JS_TRUE; |
169 | 169 | } |
… |
… |
JSBool warn(JSContext* cx, uint argc, jsval* vp)
|
180 | 180 | std::wstring str; |
181 | 181 | if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str)) |
182 | 182 | return JS_FALSE; |
183 | | LOGWARNING(L"%ls", str.c_str()); |
| 183 | LOGWARNING("%ls", str.c_str()); |
184 | 184 | args.rval().setUndefined(); |
185 | 185 | return JS_TRUE; |
186 | 186 | } |
… |
… |
JSBool error(JSContext* cx, uint argc, jsval* vp)
|
197 | 197 | std::wstring str; |
198 | 198 | if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str)) |
199 | 199 | return JS_FALSE; |
200 | | LOGERROR(L"%ls", str.c_str()); |
| 200 | LOGERROR("%ls", str.c_str()); |
201 | 201 | args.rval().setUndefined(); |
202 | 202 | return JS_TRUE; |
203 | 203 | } |
… |
… |
ScriptInterface::ScriptInterface(const char* nativeScopeName, const char* debugN
|
420 | 420 | if (g_JSDebuggerEnabled && g_DebuggingServer != NULL) |
421 | 421 | { |
422 | 422 | if(!JS_SetDebugMode(GetContext(), true)) |
423 | | LOGERROR(L"Failed to set Spidermonkey to debug mode!"); |
| 423 | LOGERROR("Failed to set Spidermonkey to debug mode!"); |
424 | 424 | else |
425 | 425 | g_DebuggingServer->RegisterScriptinterface(debugName, this); |
426 | 426 | } */ |
… |
… |
bool ScriptInterface::LoadGlobalScripts()
|
478 | 478 | { |
479 | 479 | if (!LoadGlobalScriptFile(*it)) |
480 | 480 | { |
481 | | LOGERROR(L"LoadGlobalScripts: Failed to load script %ls", it->string().c_str()); |
| 481 | LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string().c_str()); |
482 | 482 | return false; |
483 | 483 | } |
484 | 484 | } |
… |
… |
bool ScriptInterface::ReplaceNondeterministicRNG(boost::rand48& rng)
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
510 | | LOGERROR(L"ReplaceNondeterministicRNG: failed to replace Math.random"); |
| 510 | LOGERROR("ReplaceNondeterministicRNG: failed to replace Math.random"); |
511 | 511 | return false; |
512 | 512 | } |
513 | 513 | |
… |
… |
void ScriptInterface::CallConstructor(JS::HandleValue ctor, JS::AutoValueVector&
|
543 | 543 | JSAutoRequest rq(m->m_cx); |
544 | 544 | if (!ctor.isObject()) |
545 | 545 | { |
546 | | LOGERROR(L"CallConstructor: ctor is not an object"); |
| 546 | LOGERROR("CallConstructor: ctor is not an object"); |
547 | 547 | out.setNull(); |
548 | 548 | return; |
549 | 549 | } |
… |
… |
bool ScriptInterface::EnumeratePropertyNamesWithPrefix(JS::HandleValue objVal, c
|
750 | 750 | |
751 | 751 | if (!objVal.isObjectOrNull()) |
752 | 752 | { |
753 | | LOGERROR(L"EnumeratePropertyNamesWithPrefix expected object type!"); |
| 753 | LOGERROR("EnumeratePropertyNamesWithPrefix expected object type!"); |
754 | 754 | return false; |
755 | 755 | } |
756 | 756 | |
… |
… |
bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)
|
866 | 866 | JSAutoRequest rq(m->m_cx); |
867 | 867 | if (!VfsFileExists(path)) |
868 | 868 | { |
869 | | LOGERROR(L"File '%ls' does not exist", path.string().c_str()); |
| 869 | LOGERROR("File '%ls' does not exist", path.string().c_str()); |
870 | 870 | return false; |
871 | 871 | } |
872 | 872 | |
… |
… |
bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)
|
876 | 876 | |
877 | 877 | if (ret != PSRETURN_OK) |
878 | 878 | { |
879 | | LOGERROR(L"Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 879 | LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
880 | 880 | return false; |
881 | 881 | } |
882 | 882 | |
… |
… |
bool ScriptInterface::ParseJSON(const std::string& string_utf8, JS::MutableHandl
|
926 | 926 | if (JS_ParseJSON(m->m_cx, reinterpret_cast<const jschar*>(string.c_str()), (u32)string.size(), out)) |
927 | 927 | return true; |
928 | 928 | |
929 | | LOGERROR(L"JS_ParseJSON failed!"); |
| 929 | LOGERROR("JS_ParseJSON failed!"); |
930 | 930 | if (!JS_IsExceptionPending(m->m_cx)) |
931 | 931 | return false; |
932 | 932 | |
… |
… |
bool ScriptInterface::ParseJSON(const std::string& string_utf8, JS::MutableHandl
|
946 | 946 | |
947 | 947 | std::wstring error; |
948 | 948 | ScriptInterface::FromJSVal(m->m_cx, rval, error); |
949 | | LOGERROR(L"%ls", error.c_str()); |
| 949 | LOGERROR("%ls", error.c_str()); |
950 | 950 | return false; |
951 | 951 | } |
952 | 952 | |
… |
… |
void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o
|
954 | 954 | { |
955 | 955 | if (!VfsFileExists(path)) |
956 | 956 | { |
957 | | LOGERROR(L"File '%ls' does not exist", path.string().c_str()); |
| 957 | LOGERROR("File '%ls' does not exist", path.string().c_str()); |
958 | 958 | return; |
959 | 959 | } |
960 | 960 | |
… |
… |
void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o
|
964 | 964 | |
965 | 965 | if (ret != PSRETURN_OK) |
966 | 966 | { |
967 | | LOGERROR(L"Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 967 | LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
968 | 968 | return; |
969 | 969 | } |
970 | 970 | |
971 | 971 | std::string content(file.DecodeUTF8()); // assume it's UTF-8 |
972 | 972 | |
973 | 973 | if (!ParseJSON(content, out)) |
974 | | LOGERROR(L"Failed to parse '%ls'", path.string().c_str()); |
| 974 | LOGERROR("Failed to parse '%ls'", path.string().c_str()); |
975 | 975 | } |
976 | 976 | |
977 | 977 | struct Stringifier |
… |
… |
std::string ScriptInterface::StringifyJSON(JS::MutableHandleValue obj, bool inde
|
1011 | 1011 | if (!JS_Stringify(m->m_cx, obj.address(), NULL, indentVal, &Stringifier::callback, &str)) |
1012 | 1012 | { |
1013 | 1013 | JS_ClearPendingException(m->m_cx); |
1014 | | LOGERROR(L"StringifyJSON failed"); |
| 1014 | LOGERROR("StringifyJSON failed"); |
1015 | 1015 | return std::string(); |
1016 | 1016 | } |
1017 | 1017 | |
-
diff --git a/source/scriptinterface/ThreadDebugger.cpp b/source/scriptinterface/ThreadDebugger.cpp
index e9eebbc..a320f02 100644
a
|
b
|
JSTrapStatus CThreadDebugger::BreakHandler(JSContext* cx, JSScript* script, jsby
|
493 | 493 | *m->m_pLastBreakFrame = JS_FrameIterator(m->m_pScriptInterface->GetContext(), &iter); |
494 | 494 | |
495 | 495 | if (!JS_SetSingleStepMode(cx, script, true)) |
496 | | LOGERROR(L"JS_SetSingleStepMode returned false!"); // TODO: When can this happen? |
| 496 | LOGERROR("JS_SetSingleStepMode returned false!"); // TODO: When can this happen? |
497 | 497 | else |
498 | 498 | { |
499 | 499 | if (nextDbgCmd == DBG_CMD_SINGLESTEP) |
… |
… |
JSTrapStatus CThreadDebugger::BreakHandler(JSContext* cx, JSScript* script, jsby
|
516 | 516 | else if (nextDbgCmd == DBG_CMD_CONTINUE) |
517 | 517 | { |
518 | 518 | if (!JS_SetSingleStepMode(cx, script, true)) |
519 | | LOGERROR(L"JS_SetSingleStepMode returned false!"); // TODO: When can this happen? |
| 519 | LOGERROR("JS_SetSingleStepMode returned false!"); // TODO: When can this happen? |
520 | 520 | else |
521 | 521 | { |
522 | 522 | // Setup a handler to check for break-requests from the DebuggingServer regularly |
… |
… |
std::string CThreadDebugger::StringifyCyclicJSON(jsval obj, bool indent)
|
846 | 846 | JSObject* replacer = JS_GetFunctionObject(fun); |
847 | 847 | if (!JS_Stringify(m->m_pScriptInterface->GetContext(), &obj, replacer, indent ? INT_TO_JSVAL(2) : JSVAL_VOID, &CyclicRefWorkaround::Stringifier::callback, &str)) |
848 | 848 | { |
849 | | LOGERROR(L"StringifyJSON failed"); |
| 849 | LOGERROR("StringifyJSON failed"); |
850 | 850 | jsval exec; |
851 | 851 | jsval execString; |
852 | 852 | if (JS_GetPendingException(m->m_pScriptInterface->GetContext(), &exec)) |
… |
… |
std::string CThreadDebugger::StringifyCyclicJSON(jsval obj, bool indent)
|
858 | 858 | if (JSVAL_IS_STRING(execString)) |
859 | 859 | { |
860 | 860 | std::string strExec = JS_EncodeString(m->m_pScriptInterface->GetContext(), JSVAL_TO_STRING(execString)); |
861 | | LOGERROR(L"Error: %hs", strExec.c_str()); |
| 861 | LOGERROR("Error: %hs", strExec.c_str()); |
862 | 862 | } |
863 | 863 | } |
864 | 864 | |
-
diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp
index 4e5a366..7db1fae 100644
a
|
b
|
bool CSimulation2Impl::LoadScripts(CComponentManager& componentManager, std::set
|
187 | 187 | VfsPath filename = *it; |
188 | 188 | if (loadedScripts) |
189 | 189 | loadedScripts->insert(filename); |
190 | | LOGMESSAGE(L"Loading simulation script '%ls'", filename.string().c_str()); |
| 190 | LOGMESSAGE("Loading simulation script '%ls'", filename.string().c_str()); |
191 | 191 | if (!componentManager.LoadScript(filename)) |
192 | 192 | ok = false; |
193 | 193 | } |
… |
… |
bool CSimulation2Impl::LoadTriggerScripts(CComponentManager& componentManager, J
|
204 | 204 | for (u32 i = 0; i < scriptNames.size(); ++i) |
205 | 205 | { |
206 | 206 | std::string scriptName = "maps/" + scriptNames[i]; |
207 | | LOGMESSAGE(L"Loading trigger script '%hs'", scriptName.c_str()); |
| 207 | LOGMESSAGE("Loading trigger script '%hs'", scriptName.c_str()); |
208 | 208 | if (!componentManager.LoadScript(scriptName.data())) |
209 | 209 | ok = false; |
210 | 210 | } |
… |
… |
Status CSimulation2Impl::ReloadChangedFile(const VfsPath& path)
|
224 | 224 | if (!VfsFileExists(path)) |
225 | 225 | return INFO::OK; |
226 | 226 | |
227 | | LOGMESSAGE(L"Reloading simulation script '%ls'", path.string().c_str()); |
| 227 | LOGMESSAGE("Reloading simulation script '%ls'", path.string().c_str()); |
228 | 228 | if (!m_ComponentManager.LoadScript(path, true)) |
229 | 229 | return ERR::FAIL; |
230 | 230 | |
… |
… |
static std::vector<std::string> GetJSONData(const VfsPath& path)
|
828 | 828 | { |
829 | 829 | // Some error reading directory |
830 | 830 | wchar_t error[200]; |
831 | | LOGERROR(L"Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 831 | LOGERROR("Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
832 | 832 | return std::vector<std::string>(); |
833 | 833 | } |
834 | 834 | |
… |
… |
static std::vector<std::string> GetJSONData(const VfsPath& path)
|
840 | 840 | PSRETURN ret = file.Load(g_VFS, *it); |
841 | 841 | if (ret != PSRETURN_OK) |
842 | 842 | { |
843 | | LOGERROR(L"GetJSONData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 843 | LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
844 | 844 | continue; |
845 | 845 | } |
846 | 846 | |
… |
… |
static std::string ReadJSON(const VfsPath& path)
|
864 | 864 | { |
865 | 865 | if (!VfsFileExists(path)) |
866 | 866 | { |
867 | | LOGERROR(L"File '%ls' does not exist", path.string().c_str()); |
| 867 | LOGERROR("File '%ls' does not exist", path.string().c_str()); |
868 | 868 | return std::string(); |
869 | 869 | } |
870 | 870 | |
… |
… |
static std::string ReadJSON(const VfsPath& path)
|
873 | 873 | PSRETURN ret = file.Load(g_VFS, path); |
874 | 874 | if (ret != PSRETURN_OK) |
875 | 875 | { |
876 | | LOGERROR(L"Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 876 | LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
877 | 877 | return std::string(); |
878 | 878 | } |
879 | 879 | |
-
diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp
index ac1c542..dab13d4 100644
a
|
b
|
private:
|
104 | 104 | m_Worker.LoadMetadata(path, &metadata); |
105 | 105 | if (metadata.isUndefined()) |
106 | 106 | { |
107 | | LOGERROR(L"Failed to create AI player: can't find %ls", path.string().c_str()); |
| 107 | LOGERROR("Failed to create AI player: can't find %ls", path.string().c_str()); |
108 | 108 | return false; |
109 | 109 | } |
110 | 110 | |
… |
… |
private:
|
116 | 116 | JS::RootedValue ctor(cx); |
117 | 117 | if (!m_ScriptInterface->HasProperty(metadata, "moduleName")) |
118 | 118 | { |
119 | | LOGERROR(L"Failed to create AI player: %ls: missing 'moduleName'", path.string().c_str()); |
| 119 | LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string().c_str()); |
120 | 120 | return false; |
121 | 121 | } |
122 | 122 | |
… |
… |
private:
|
124 | 124 | if (!m_ScriptInterface->GetProperty(global, moduleName.c_str(), &objectWithConstructor) |
125 | 125 | || objectWithConstructor.isUndefined()) |
126 | 126 | { |
127 | | LOGERROR(L"Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string().c_str(), moduleName.c_str()); |
| 127 | LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string().c_str(), moduleName.c_str()); |
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
131 | 131 | if (!m_ScriptInterface->GetProperty(metadata, "constructor", constructor)) |
132 | 132 | { |
133 | | LOGERROR(L"Failed to create AI player: %ls: missing 'constructor'", path.string().c_str()); |
| 133 | LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string().c_str()); |
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
… |
… |
private:
|
138 | 138 | if (!m_ScriptInterface->GetProperty(objectWithConstructor, constructor.c_str(), &ctor) |
139 | 139 | || ctor.isNull()) |
140 | 140 | { |
141 | | LOGERROR(L"Failed to create AI player: %ls: can't find constructor '%hs'", path.string().c_str(), constructor.c_str()); |
| 141 | LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string().c_str(), constructor.c_str()); |
142 | 142 | return false; |
143 | 143 | } |
144 | 144 | |
… |
… |
private:
|
160 | 160 | |
161 | 161 | if (obj.isNull()) |
162 | 162 | { |
163 | | LOGERROR(L"Failed to create AI player: %ls: error calling constructor '%hs'", path.string().c_str(), constructor.c_str()); |
| 163 | LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string().c_str(), constructor.c_str()); |
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | |
… |
… |
public:
|
261 | 261 | VfsPaths pathnames; |
262 | 262 | if (vfs::GetPathnames(g_VFS, L"simulation/ai/" + moduleName + L"/", L"*.js", pathnames) < 0) |
263 | 263 | { |
264 | | LOGERROR(L"Failed to load AI scripts for module %ls", moduleName.c_str()); |
| 264 | LOGERROR("Failed to load AI scripts for module %ls", moduleName.c_str()); |
265 | 265 | return false; |
266 | 266 | } |
267 | 267 | |
… |
… |
public:
|
269 | 269 | { |
270 | 270 | if (!m_ScriptInterface->LoadGlobalScriptFile(*it)) |
271 | 271 | { |
272 | | LOGERROR(L"Failed to load script %ls", it->string().c_str()); |
| 272 | LOGERROR("Failed to load script %ls", it->string().c_str()); |
273 | 273 | return false; |
274 | 274 | } |
275 | 275 | } |
… |
… |
public:
|
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
311 | | LOGERROR(L"Invalid playerid in PostCommand!"); |
| 311 | LOGERROR("Invalid playerid in PostCommand!"); |
312 | 312 | } |
313 | 313 | // The next two ought to be implmeneted someday but for now as it returns "null" it can't |
314 | 314 | static void DumpHeap(ScriptInterface::CxPrivate* pCxPrivate) |
… |
… |
public:
|
391 | 391 | JS::RootedValue ctor(cx); |
392 | 392 | if (!m_ScriptInterface->GetProperty(global, "API3", &AIModule) || AIModule.isUndefined()) |
393 | 393 | { |
394 | | LOGERROR(L"Failed to create shared AI component: %ls: can't find module '%hs'", path.string().c_str(), "API3"); |
| 394 | LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string().c_str(), "API3"); |
395 | 395 | return false; |
396 | 396 | } |
397 | 397 | |
398 | 398 | if (!m_ScriptInterface->GetProperty(AIModule, "SharedScript", &ctor) |
399 | 399 | || ctor.isUndefined()) |
400 | 400 | { |
401 | | LOGERROR(L"Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string().c_str(), "SharedScript"); |
| 401 | LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string().c_str(), "SharedScript"); |
402 | 402 | return false; |
403 | 403 | } |
404 | 404 | |
… |
… |
public:
|
440 | 440 | |
441 | 441 | if (tmpSharedAIObj.isNull()) |
442 | 442 | { |
443 | | LOGERROR(L"Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string().c_str(), "SharedScript"); |
| 443 | LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string().c_str(), "SharedScript"); |
444 | 444 | return false; |
445 | 445 | } |
446 | 446 | |
… |
… |
public:
|
617 | 617 | JS::RootedValue sharedData(cx); |
618 | 618 | JS::RootedValue tmpSharedAIObj(cx, m_SharedAIObj.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade |
619 | 619 | if (!m_ScriptInterface->CallFunction(tmpSharedAIObj, "Serialize", &sharedData)) |
620 | | LOGERROR(L"AI shared script Serialize call failed"); |
| 620 | LOGERROR("AI shared script Serialize call failed"); |
621 | 621 | serializer.ScriptVal("sharedData", &sharedData); |
622 | 622 | } |
623 | 623 | for (size_t i = 0; i < m_Players.size(); ++i) |
… |
… |
public:
|
640 | 640 | { |
641 | 641 | JS::RootedValue scriptData(cx); |
642 | 642 | if (!m_ScriptInterface->CallFunction(tmpPlayerObj, "Serialize", &scriptData)) |
643 | | LOGERROR(L"AI script Serialize call failed"); |
| 643 | LOGERROR("AI script Serialize call failed"); |
644 | 644 | serializer.ScriptVal("data", &scriptData); |
645 | 645 | } |
646 | 646 | else |
… |
… |
public:
|
681 | 681 | JS::RootedValue tmpSharedAIObj(cx, m_SharedAIObj.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 |
682 | 682 | deserializer.ScriptVal("sharedData", &sharedData); |
683 | 683 | if (!m_ScriptInterface->CallFunctionVoid(tmpSharedAIObj, "Deserialize", sharedData)) |
684 | | LOGERROR(L"AI shared script Deserialize call failed"); |
| 684 | LOGERROR("AI shared script Deserialize call failed"); |
685 | 685 | } |
686 | 686 | |
687 | 687 | for (size_t i = 0; i < numAis; ++i) |
… |
… |
public:
|
720 | 720 | if (m_Players[i]->m_UseSharedComponent) |
721 | 721 | { |
722 | 722 | if (!m_ScriptInterface->CallFunctionVoid(tmpPlayerObj, "Deserialize", scriptData, m_SharedAIObj)) |
723 | | LOGERROR(L"AI script Deserialize call failed"); |
| 723 | LOGERROR("AI script Deserialize call failed"); |
724 | 724 | } |
725 | 725 | else if (!m_ScriptInterface->CallFunctionVoid(tmpPlayerObj, "Deserialize", scriptData)) |
726 | 726 | { |
727 | | LOGERROR(L"AI script deserialize() call failed"); |
| 727 | LOGERROR("AI script deserialize() call failed"); |
728 | 728 | } |
729 | 729 | } |
730 | 730 | else |
… |
… |
public:
|
748 | 748 | std::pair<std::map<JSObject*, std::wstring>::iterator, bool> ret1 = m_SerializablePrototypes.insert(std::make_pair(obj, name)); |
749 | 749 | std::pair<std::map<std::wstring, JSObject*>::iterator, bool> ret2 = m_DeserializablePrototypes.insert(std::make_pair(name, obj)); |
750 | 750 | if (!ret1.second || !ret2.second) |
751 | | LOGERROR(L"RegisterSerializablePrototype called with same prototype multiple times: p=%p n='%ls'", obj, name.c_str()); |
| 751 | LOGERROR("RegisterSerializablePrototype called with same prototype multiple times: p=%p n='%ls'", obj, name.c_str()); |
752 | 752 | } |
753 | 753 | |
754 | 754 | private: |
-
diff --git a/source/simulation2/components/CCmpCommandQueue.cpp b/source/simulation2/components/CCmpCommandQueue.cpp
index 3b3b0c6..c66ef5d 100644
a
|
b
|
public:
|
119 | 119 | { |
120 | 120 | bool ok = scriptInterface.CallFunctionVoid(global, "ProcessCommand", localCommands[i].player, localCommands[i].data); |
121 | 121 | if (!ok) |
122 | | LOGERROR(L"Failed to call ProcessCommand() global script function"); |
| 122 | LOGERROR("Failed to call ProcessCommand() global script function"); |
123 | 123 | } |
124 | 124 | |
125 | 125 | for (size_t i = 0; i < commands.size(); ++i) |
126 | 126 | { |
127 | 127 | bool ok = scriptInterface.CallFunctionVoid(global, "ProcessCommand", commands[i].player, commands[i].data); |
128 | 128 | if (!ok) |
129 | | LOGERROR(L"Failed to call ProcessCommand() global script function"); |
| 129 | LOGERROR("Failed to call ProcessCommand() global script function"); |
130 | 130 | } |
131 | 131 | } |
132 | 132 | }; |
-
diff --git a/source/simulation2/components/CCmpObstruction.cpp b/source/simulation2/components/CCmpObstruction.cpp
index 638d804..37afbcd 100644
a
|
b
|
public:
|
515 | 515 | // required precondition to use SkipControlGroupsRequireFlagObstructionFilter |
516 | 516 | if (m_ControlGroup == INVALID_ENTITY) |
517 | 517 | { |
518 | | LOGERROR(L"[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); |
| 518 | LOGERROR("[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); |
519 | 519 | return FOUNDATION_CHECK_FAIL_ERROR; |
520 | 520 | } |
521 | 521 | |
… |
… |
public:
|
552 | 552 | // required precondition to use SkipControlGroupsRequireFlagObstructionFilter |
553 | 553 | if (m_ControlGroup == INVALID_ENTITY) |
554 | 554 | { |
555 | | LOGERROR(L"[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); |
| 555 | LOGERROR("[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); |
556 | 556 | return false; |
557 | 557 | } |
558 | 558 | |
… |
… |
public:
|
586 | 586 | // required precondition to use SkipControlGroupsRequireFlagObstructionFilter |
587 | 587 | if (m_ControlGroup == INVALID_ENTITY) |
588 | 588 | { |
589 | | LOGERROR(L"[CmpObstruction] Cannot test for unit or structure obstructions; primary control group must be valid"); |
| 589 | LOGERROR("[CmpObstruction] Cannot test for unit or structure obstructions; primary control group must be valid"); |
590 | 590 | return ret; |
591 | 591 | } |
592 | 592 | |
-
diff --git a/source/simulation2/components/CCmpPathfinder.cpp b/source/simulation2/components/CCmpPathfinder.cpp
index b2a321c..2fe21f6 100644
a
|
b
|
ICmpPathfinder::pass_class_t CCmpPathfinder::GetPassabilityClass(const std::stri
|
254 | 254 | { |
255 | 255 | if (m_PassClassMasks.find(name) == m_PassClassMasks.end()) |
256 | 256 | { |
257 | | LOGERROR(L"Invalid passability class name '%hs'", name.c_str()); |
| 257 | LOGERROR("Invalid passability class name '%hs'", name.c_str()); |
258 | 258 | return 0; |
259 | 259 | } |
260 | 260 | |
… |
… |
ICmpPathfinder::cost_class_t CCmpPathfinder::GetCostClass(const std::string& nam
|
270 | 270 | { |
271 | 271 | if (m_UnitCostClassTags.find(name) == m_UnitCostClassTags.end()) |
272 | 272 | { |
273 | | LOGERROR(L"Invalid unit cost class name '%hs'", name.c_str()); |
| 273 | LOGERROR("Invalid unit cost class name '%hs'", name.c_str()); |
274 | 274 | return m_UnitCostClassTags["default"]; |
275 | 275 | } |
276 | 276 | |
-
diff --git a/source/simulation2/components/CCmpPosition.cpp b/source/simulation2/components/CCmpPosition.cpp
index 51004b4..d5838b7 100644
a
|
b
|
public:
|
271 | 271 | CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), m_TurretParent); |
272 | 272 | if (!cmpPosition) |
273 | 273 | { |
274 | | LOGERROR(L"Turret with parent without position component"); |
| 274 | LOGERROR("Turret with parent without position component"); |
275 | 275 | return; |
276 | 276 | } |
277 | 277 | if (!cmpPosition->IsInWorld()) |
… |
… |
public:
|
482 | 482 | { |
483 | 483 | if (!m_InWorld) |
484 | 484 | { |
485 | | LOGERROR(L"CCmpPosition::GetPosition called on entity when IsInWorld is false"); |
| 485 | LOGERROR("CCmpPosition::GetPosition called on entity when IsInWorld is false"); |
486 | 486 | return CFixedVector3D(); |
487 | 487 | } |
488 | 488 | |
… |
… |
public:
|
493 | 493 | { |
494 | 494 | if (!m_InWorld) |
495 | 495 | { |
496 | | LOGERROR(L"CCmpPosition::GetPosition2D called on entity when IsInWorld is false"); |
| 496 | LOGERROR("CCmpPosition::GetPosition2D called on entity when IsInWorld is false"); |
497 | 497 | return CFixedVector2D(); |
498 | 498 | } |
499 | 499 | |
… |
… |
public:
|
504 | 504 | { |
505 | 505 | if (!m_InWorld) |
506 | 506 | { |
507 | | LOGERROR(L"CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false"); |
| 507 | LOGERROR("CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false"); |
508 | 508 | return CFixedVector3D(); |
509 | 509 | } |
510 | 510 | |
… |
… |
public:
|
515 | 515 | { |
516 | 516 | if (!m_InWorld) |
517 | 517 | { |
518 | | LOGERROR(L"CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false"); |
| 518 | LOGERROR("CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false"); |
519 | 519 | return CFixedVector2D(); |
520 | 520 | } |
521 | 521 | |
… |
… |
public:
|
589 | 589 | { |
590 | 590 | if (!m_InWorld) |
591 | 591 | { |
592 | | LOGERROR(L"CCmpPosition::GetDistanceTravelled called on entity when IsInWorld is false"); |
| 592 | LOGERROR("CCmpPosition::GetDistanceTravelled called on entity when IsInWorld is false"); |
593 | 593 | return fixed::Zero(); |
594 | 594 | } |
595 | 595 | |
… |
… |
public:
|
630 | 630 | { |
631 | 631 | if (!m_InWorld) |
632 | 632 | { |
633 | | LOGERROR(L"CCmpPosition::GetInterpolatedPosition2D called on entity when IsInWorld is false"); |
| 633 | LOGERROR("CCmpPosition::GetInterpolatedPosition2D called on entity when IsInWorld is false"); |
634 | 634 | return; |
635 | 635 | } |
636 | 636 | |
… |
… |
public:
|
647 | 647 | CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), m_TurretParent); |
648 | 648 | if (!cmpPosition) |
649 | 649 | { |
650 | | LOGERROR(L"Turret with parent without position component"); |
| 650 | LOGERROR("Turret with parent without position component"); |
651 | 651 | CMatrix3D m; |
652 | 652 | m.SetIdentity(); |
653 | 653 | return m; |
654 | 654 | } |
655 | 655 | if (!cmpPosition->IsInWorld()) |
656 | 656 | { |
657 | | LOGERROR(L"CCmpPosition::GetInterpolatedTransform called on turret entity when IsInWorld is false"); |
| 657 | LOGERROR("CCmpPosition::GetInterpolatedTransform called on turret entity when IsInWorld is false"); |
658 | 658 | CMatrix3D m; |
659 | 659 | m.SetIdentity(); |
660 | 660 | return m; |
… |
… |
public:
|
670 | 670 | } |
671 | 671 | if (!m_InWorld) |
672 | 672 | { |
673 | | LOGERROR(L"CCmpPosition::GetInterpolatedTransform called on entity when IsInWorld is false"); |
| 673 | LOGERROR("CCmpPosition::GetInterpolatedTransform called on entity when IsInWorld is false"); |
674 | 674 | CMatrix3D m; |
675 | 675 | m.SetIdentity(); |
676 | 676 | return m; |
… |
… |
private:
|
925 | 925 | { |
926 | 926 | if (!m_InWorld) |
927 | 927 | { |
928 | | LOGERROR(L"CCmpPosition::UpdateXZRotation called on entity when IsInWorld is false"); |
| 928 | LOGERROR("CCmpPosition::UpdateXZRotation called on entity when IsInWorld is false"); |
929 | 929 | return; |
930 | 930 | } |
931 | 931 | |
… |
… |
private:
|
940 | 940 | CmpPtr<ICmpTerrain> cmpTerrain(GetSystemEntity()); |
941 | 941 | if (!cmpTerrain || !cmpTerrain->IsLoaded()) |
942 | 942 | { |
943 | | LOGERROR(L"Terrain not loaded"); |
| 943 | LOGERROR("Terrain not loaded"); |
944 | 944 | return; |
945 | 945 | } |
946 | 946 | |
-
diff --git a/source/simulation2/components/CCmpProjectileManager.cpp b/source/simulation2/components/CCmpProjectileManager.cpp
index 3b243a7..0b61a2a 100644
a
|
b
|
uint32_t CCmpProjectileManager::LaunchProjectile(entity_id_t source, CFixedVecto
|
175 | 175 | { |
176 | 176 | // If the actor was actually loaded, complain that it doesn't have a projectile |
177 | 177 | if (!cmpSourceVisual->GetActorShortName().empty()) |
178 | | LOGERROR(L"Unit with actor '%ls' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str()); |
| 178 | LOGERROR("Unit with actor '%ls' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str()); |
179 | 179 | return 0; |
180 | 180 | } |
181 | 181 | |
-
diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp
index a5258fe..e686c40 100644
a
|
b
|
void CCmpRallyPointRenderer::UpdateMarkers()
|
521 | 521 | |
522 | 522 | // the marker entity should be valid at this point, otherwise something went wrong trying to allocate it |
523 | 523 | if (m_MarkerEntityIds[i] == INVALID_ENTITY) |
524 | | LOGERROR(L"Failed to create rally point marker entity"); |
| 524 | LOGERROR("Failed to create rally point marker entity"); |
525 | 525 | |
526 | 526 | CmpPtr<ICmpPosition> markerCmpPosition(GetSimContext(), m_MarkerEntityIds[i]); |
527 | 527 | if (markerCmpPosition) |
-
diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp
index b4988b9..6c31b7c 100644
a
|
b
|
public:
|
738 | 738 | { |
739 | 739 | if (m_Queries.find(tag) == m_Queries.end()) |
740 | 740 | { |
741 | | LOGERROR(L"CCmpRangeManager: DestroyActiveQuery called with invalid tag %u", tag); |
| 741 | LOGERROR("CCmpRangeManager: DestroyActiveQuery called with invalid tag %u", tag); |
742 | 742 | return; |
743 | 743 | } |
744 | 744 | |
… |
… |
public:
|
750 | 750 | std::map<tag_t, Query>::iterator it = m_Queries.find(tag); |
751 | 751 | if (it == m_Queries.end()) |
752 | 752 | { |
753 | | LOGERROR(L"CCmpRangeManager: EnableActiveQuery called with invalid tag %u", tag); |
| 753 | LOGERROR("CCmpRangeManager: EnableActiveQuery called with invalid tag %u", tag); |
754 | 754 | return; |
755 | 755 | } |
756 | 756 | |
… |
… |
public:
|
763 | 763 | std::map<tag_t, Query>::iterator it = m_Queries.find(tag); |
764 | 764 | if (it == m_Queries.end()) |
765 | 765 | { |
766 | | LOGERROR(L"CCmpRangeManager: DisableActiveQuery called with invalid tag %u", tag); |
| 766 | LOGERROR("CCmpRangeManager: DisableActiveQuery called with invalid tag %u", tag); |
767 | 767 | return; |
768 | 768 | } |
769 | 769 | |
… |
… |
public:
|
820 | 820 | std::map<tag_t, Query>::iterator it = m_Queries.find(tag); |
821 | 821 | if (it == m_Queries.end()) |
822 | 822 | { |
823 | | LOGERROR(L"CCmpRangeManager: ResetActiveQuery called with invalid tag %u", tag); |
| 823 | LOGERROR("CCmpRangeManager: ResetActiveQuery called with invalid tag %u", tag); |
824 | 824 | return r; |
825 | 825 | } |
826 | 826 | |
… |
… |
public:
|
1156 | 1156 | { |
1157 | 1157 | // Min range must be non-negative |
1158 | 1158 | if (minRange < entity_pos_t::Zero()) |
1159 | | LOGWARNING(L"CCmpRangeManager: Invalid min range %f in query for entity %u", minRange.ToDouble(), source); |
| 1159 | LOGWARNING("CCmpRangeManager: Invalid min range %f in query for entity %u", minRange.ToDouble(), source); |
1160 | 1160 | |
1161 | 1161 | // Max range must be non-negative, or else -1 |
1162 | 1162 | if (maxRange < entity_pos_t::Zero() && maxRange != entity_pos_t::FromInt(-1)) |
1163 | | LOGWARNING(L"CCmpRangeManager: Invalid max range %f in query for entity %u", maxRange.ToDouble(), source); |
| 1163 | LOGWARNING("CCmpRangeManager: Invalid max range %f in query for entity %u", maxRange.ToDouble(), source); |
1164 | 1164 | |
1165 | 1165 | Query q; |
1166 | 1166 | q.enabled = false; |
… |
… |
public:
|
1337 | 1337 | if (identifier == "injured") |
1338 | 1338 | return 2; |
1339 | 1339 | |
1340 | | LOGWARNING(L"CCmpRangeManager: Invalid flag identifier %hs", identifier.c_str()); |
| 1340 | LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs", identifier.c_str()); |
1341 | 1341 | return 0; |
1342 | 1342 | } |
1343 | 1343 | |
… |
… |
public:
|
1354 | 1354 | // We don't have a flag set |
1355 | 1355 | if (flag == 0) |
1356 | 1356 | { |
1357 | | LOGWARNING(L"CCmpRangeManager: Invalid flag identifier %hs for entity %u", identifier.c_str(), ent); |
| 1357 | LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs for entity %u", identifier.c_str(), ent); |
1358 | 1358 | return; |
1359 | 1359 | } |
1360 | 1360 | |
-
diff --git a/source/simulation2/components/CCmpTemplateManager.cpp b/source/simulation2/components/CCmpTemplateManager.cpp
index ffb3cd8..192cd77 100644
a
|
b
|
const CParamNode* CCmpTemplateManager::GetTemplate(std::string templateName)
|
187 | 187 | |
188 | 188 | // Show error on the first failure to validate the template |
189 | 189 | if (!m_TemplateSchemaValidity[templateName]) |
190 | | LOGERROR(L"Failed to validate entity template '%hs'", templateName.c_str()); |
| 190 | LOGERROR("Failed to validate entity template '%hs'", templateName.c_str()); |
191 | 191 | } |
192 | 192 | // Refuse to return invalid templates |
193 | 193 | if (!m_TemplateSchemaValidity[templateName]) |
… |
… |
const CParamNode* CCmpTemplateManager::GetTemplate(std::string templateName)
|
198 | 198 | if (!templateRoot.IsOk()) |
199 | 199 | { |
200 | 200 | // The validator should never let this happen |
201 | | LOGERROR(L"Invalid root element in entity template '%hs'", templateName.c_str()); |
| 201 | LOGERROR("Invalid root element in entity template '%hs'", templateName.c_str()); |
202 | 202 | return NULL; |
203 | 203 | } |
204 | 204 | |
-
diff --git a/source/simulation2/components/CCmpUnitMotion.cpp b/source/simulation2/components/CCmpUnitMotion.cpp
index 6a4ebda..d24eb12 100644
a
|
b
|
void CCmpUnitMotion::PathResult(u32 ticket, const ICmpPathfinder::Path& path)
|
814 | 814 | } |
815 | 815 | else |
816 | 816 | { |
817 | | LOGWARNING(L"unexpected PathResult (%u %d %d)", GetEntityId(), m_State, m_PathState); |
| 817 | LOGWARNING("unexpected PathResult (%u %d %d)", GetEntityId(), m_State, m_PathState); |
818 | 818 | } |
819 | 819 | } |
820 | 820 | |
-
diff --git a/source/simulation2/components/CCmpVisualActor.cpp b/source/simulation2/components/CCmpVisualActor.cpp
index 52c189b..0e4a003 100644
a
|
b
|
void CCmpVisualActor::InitSelectionShapeDescriptor(const CParamNode& paramNode)
|
655 | 655 | } |
656 | 656 | else |
657 | 657 | { |
658 | | LOGERROR(L"[VisualActor] Cannot apply footprint-based SelectionShape; Footprint component not initialized."); |
| 658 | LOGERROR("[VisualActor] Cannot apply footprint-based SelectionShape; Footprint component not initialized."); |
659 | 659 | } |
660 | 660 | } |
661 | 661 | else if (shapeNode.GetChild("Box").IsOk()) |
… |
… |
void CCmpVisualActor::InitSelectionShapeDescriptor(const CParamNode& paramNode)
|
669 | 669 | } |
670 | 670 | else if (shapeNode.GetChild("Cylinder").IsOk()) |
671 | 671 | { |
672 | | LOGWARNING(L"[VisualActor] TODO: Cylinder selection shapes are not yet implemented; defaulting to recursive bounding boxes"); |
| 672 | LOGWARNING("[VisualActor] TODO: Cylinder selection shapes are not yet implemented; defaulting to recursive bounding boxes"); |
673 | 673 | } |
674 | 674 | else |
675 | 675 | { |
676 | 676 | // shouldn't happen by virtue of validation against schema |
677 | | LOGERROR(L"[VisualActor] No selection shape specified"); |
| 677 | LOGERROR("[VisualActor] No selection shape specified"); |
678 | 678 | } |
679 | 679 | } |
680 | 680 | |
-
diff --git a/source/simulation2/components/ICmpVisibility.cpp b/source/simulation2/components/ICmpVisibility.cpp
index f597605..b700f87 100644
a
|
b
|
public:
|
43 | 43 | case ICmpRangeManager::VIS_VISIBLE: |
44 | 44 | return ICmpRangeManager::VIS_VISIBLE; |
45 | 45 | default: |
46 | | LOGERROR(L"Received the invalid visibility value %d from the Visibility scripted component!", visibility); |
| 46 | LOGERROR("Received the invalid visibility value %d from the Visibility scripted component!", visibility); |
47 | 47 | return ICmpRangeManager::VIS_HIDDEN; |
48 | 48 | } |
49 | 49 | } |
-
diff --git a/source/simulation2/scripting/EngineScriptConversions.cpp b/source/simulation2/scripting/EngineScriptConversions.cpp
index 2f907a3..baeffc6 100644
a
|
b
|
template<> void ScriptInterface::ToJSVal<IComponent*>(JSContext* cx, JS::Mutable
|
55 | 55 | if (!val->NewJSObject(*ScriptInterface::GetScriptInterfaceAndCBData(cx)->pScriptInterface, &obj)) |
56 | 56 | { |
57 | 57 | // Report as an error, since scripts really shouldn't try to use unscriptable interfaces |
58 | | LOGERROR(L"IComponent does not have a scriptable interface"); |
| 58 | LOGERROR("IComponent does not have a scriptable interface"); |
59 | 59 | ret.setUndefined(); |
60 | 60 | return; |
61 | 61 | } |
-
diff --git a/source/simulation2/scripting/MessageTypeConversions.cpp b/source/simulation2/scripting/MessageTypeConversions.cpp
index d6a909d..2adb6fe 100644
a
|
b
|
CMessage* CMessageInterpolate::FromJSVal(ScriptInterface& scriptInterface, JS::H
|
119 | 119 | |
120 | 120 | JS::Value CMessageRenderSubmit::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const |
121 | 121 | { |
122 | | LOGWARNING(L"CMessageRenderSubmit::ToJSVal not implemented"); |
| 122 | LOGWARNING("CMessageRenderSubmit::ToJSVal not implemented"); |
123 | 123 | return JS::UndefinedValue(); |
124 | 124 | } |
125 | 125 | |
126 | 126 | CMessage* CMessageRenderSubmit::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) |
127 | 127 | { |
128 | | LOGWARNING(L"CMessageRenderSubmit::FromJSVal not implemented"); |
| 128 | LOGWARNING("CMessageRenderSubmit::FromJSVal not implemented"); |
129 | 129 | return NULL; |
130 | 130 | } |
131 | 131 | |
… |
… |
CMessage* CMessageRenderSubmit::FromJSVal(ScriptInterface& UNUSED(scriptInterfac
|
133 | 133 | |
134 | 134 | JS::Value CMessageProgressiveLoad::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const |
135 | 135 | { |
136 | | LOGWARNING(L"CMessageProgressiveLoad::ToJSVal not implemented"); |
| 136 | LOGWARNING("CMessageProgressiveLoad::ToJSVal not implemented"); |
137 | 137 | return JS::UndefinedValue(); |
138 | 138 | } |
139 | 139 | |
140 | 140 | CMessage* CMessageProgressiveLoad::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) |
141 | 141 | { |
142 | | LOGWARNING(L"CMessageProgressiveLoad::FromJSVal not implemented"); |
| 142 | LOGWARNING("CMessageProgressiveLoad::FromJSVal not implemented"); |
143 | 143 | return NULL; |
144 | 144 | } |
145 | 145 | |
… |
… |
CMessage* CMessageProgressiveLoad::FromJSVal(ScriptInterface& UNUSED(scriptInter
|
147 | 147 | |
148 | 148 | JS::Value CMessageDeserialized::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const |
149 | 149 | { |
150 | | LOGWARNING(L"CMessageDeserialized::ToJSVal not implemented"); |
| 150 | LOGWARNING("CMessageDeserialized::ToJSVal not implemented"); |
151 | 151 | return JS::UndefinedValue(); |
152 | 152 | } |
153 | 153 | |
154 | 154 | CMessage* CMessageDeserialized::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) |
155 | 155 | { |
156 | | LOGWARNING(L"CMessageDeserialized::FromJSVal not implemented"); |
| 156 | LOGWARNING("CMessageDeserialized::FromJSVal not implemented"); |
157 | 157 | return NULL; |
158 | 158 | } |
159 | 159 | |
… |
… |
CMessage* CMessagePositionChanged::FromJSVal(ScriptInterface& scriptInterface, J
|
237 | 237 | |
238 | 238 | JS::Value CMessageInterpolatedPositionChanged::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const |
239 | 239 | { |
240 | | LOGWARNING(L"CMessageInterpolatedPositionChanged::ToJSVal not implemented"); |
| 240 | LOGWARNING("CMessageInterpolatedPositionChanged::ToJSVal not implemented"); |
241 | 241 | return JS::UndefinedValue(); |
242 | 242 | } |
243 | 243 | |
244 | 244 | CMessage* CMessageInterpolatedPositionChanged::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) |
245 | 245 | { |
246 | | LOGWARNING(L"CMessageInterpolatedPositionChanged::FromJSVal not implemented"); |
| 246 | LOGWARNING("CMessageInterpolatedPositionChanged::FromJSVal not implemented"); |
247 | 247 | return NULL; |
248 | 248 | } |
249 | 249 | |
… |
… |
JS::Value CMessageRangeUpdate::ToJSVal(ScriptInterface& scriptInterface) const
|
379 | 379 | |
380 | 380 | CMessage* CMessageRangeUpdate::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) |
381 | 381 | { |
382 | | LOGWARNING(L"CMessageRangeUpdate::FromJSVal not implemented"); |
| 382 | LOGWARNING("CMessageRangeUpdate::FromJSVal not implemented"); |
383 | 383 | return NULL; |
384 | 384 | } |
385 | 385 | |
… |
… |
CMessage* CMessageRangeUpdate::FromJSVal(ScriptInterface& UNUSED(scriptInterface
|
387 | 387 | |
388 | 388 | JS::Value CMessagePathResult::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const |
389 | 389 | { |
390 | | LOGWARNING(L"CMessagePathResult::ToJSVal not implemented"); |
| 390 | LOGWARNING("CMessagePathResult::ToJSVal not implemented"); |
391 | 391 | return JS::UndefinedValue(); |
392 | 392 | } |
393 | 393 | |
394 | 394 | CMessage* CMessagePathResult::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) |
395 | 395 | { |
396 | | LOGWARNING(L"CMessagePathResult::FromJSVal not implemented"); |
| 396 | LOGWARNING("CMessagePathResult::FromJSVal not implemented"); |
397 | 397 | return NULL; |
398 | 398 | } |
399 | 399 | |
-
diff --git a/source/simulation2/scripting/ScriptComponent.cpp b/source/simulation2/scripting/ScriptComponent.cpp
index f3ada5b..1df5b45 100644
a
|
b
|
void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global)
|
73 | 73 | |
74 | 74 | JS::RootedValue tmpInstance(cx, m_Instance.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade |
75 | 75 | if (!m_ScriptInterface.CallFunctionVoid(tmpInstance, name, msgVal)) |
76 | | LOGERROR(L"Script message handler %hs failed", name); |
| 76 | LOGERROR("Script message handler %hs failed", name); |
77 | 77 | } |
78 | 78 | |
79 | 79 | void CComponentTypeScript::Serialize(ISerializer& serialize) |
… |
… |
void CComponentTypeScript::Serialize(ISerializer& serialize)
|
92 | 92 | { |
93 | 93 | JS::RootedValue val(cx); |
94 | 94 | if (!m_ScriptInterface.CallFunction(tmpInstance, "Serialize", &val)) |
95 | | LOGERROR(L"Script Serialize call failed"); |
| 95 | LOGERROR("Script Serialize call failed"); |
96 | 96 | serialize.ScriptVal("object", &val); |
97 | 97 | } |
98 | 98 | else |
… |
… |
void CComponentTypeScript::Deserialize(const CParamNode& paramNode, IDeserialize
|
118 | 118 | deserialize.ScriptVal("object", &val); |
119 | 119 | |
120 | 120 | if (!m_ScriptInterface.CallFunctionVoid(tmpInstance, "Deserialize", val)) |
121 | | LOGERROR(L"Script Deserialize call failed"); |
| 121 | LOGERROR("Script Deserialize call failed"); |
122 | 122 | } |
123 | 123 | else |
124 | 124 | { |
-
diff --git a/source/simulation2/scripting/ScriptComponent.h b/source/simulation2/scripting/ScriptComponent.h
index 035013c..a772756 100644
a
|
b
|
public:
|
64 | 64 | R ret; \ |
65 | 65 | if (m_ScriptInterface.CallFunction(tmpInstance, funcname BOOST_PP_ENUM_TRAILING_PARAMS(i, a), ret)) \ |
66 | 66 | return ret; \ |
67 | | LOGERROR(L"Error calling component script function %hs", funcname); \ |
| 67 | LOGERROR("Error calling component script function %hs", funcname); \ |
68 | 68 | return R(); \ |
69 | 69 | } \ |
70 | 70 | BOOST_PP_IF(i, template<, ) BOOST_PP_ENUM_PARAMS(i, typename T) BOOST_PP_IF(i, >, ) \ |
… |
… |
public:
|
75 | 75 | JS::RootedValue tmpInstance(cx, m_Instance.get()); \ |
76 | 76 | if (m_ScriptInterface.CallFunctionVoid(tmpInstance, funcname BOOST_PP_ENUM_TRAILING_PARAMS(i, a))) \ |
77 | 77 | return; \ |
78 | | LOGERROR(L"Error calling component script function %hs", funcname); \ |
| 78 | LOGERROR("Error calling component script function %hs", funcname); \ |
79 | 79 | } |
80 | 80 | BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~) |
81 | 81 | #undef OVERLOADS |
-
diff --git a/source/simulation2/serialization/BinarySerializer.cpp b/source/simulation2/serialization/BinarySerializer.cpp
index 9cc61ac..cf3d222 100644
a
|
b
|
static u8 GetArrayType(JSArrayBufferViewType arrayType)
|
49 | 49 | case js::ArrayBufferView::TYPE_UINT8_CLAMPED: |
50 | 50 | return SCRIPT_TYPED_ARRAY_UINT8_CLAMPED; |
51 | 51 | default: |
52 | | LOGERROR(L"Cannot serialize unrecognized typed array view: %d", arrayType); |
| 52 | LOGERROR("Cannot serialize unrecognized typed array view: %d", arrayType); |
53 | 53 | throw PSERROR_Serialize_InvalidScriptValue(); |
54 | 54 | } |
55 | 55 | } |
… |
… |
void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val)
|
258 | 258 | else |
259 | 259 | { |
260 | 260 | // Unrecognized class |
261 | | LOGERROR(L"Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name); |
| 261 | LOGERROR("Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name); |
262 | 262 | throw PSERROR_Serialize_InvalidScriptValue(); |
263 | 263 | } |
264 | 264 | } |
… |
… |
void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val)
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
320 | | LOGERROR(L"Cannot serialise JS objects of type 'function': %ls", funcname.c_str()); |
| 320 | LOGERROR("Cannot serialise JS objects of type 'function': %ls", funcname.c_str()); |
321 | 321 | throw PSERROR_Serialize_InvalidScriptValue(); |
322 | 322 | } |
323 | 323 | case JSTYPE_STRING: |
-
diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp
index 3e8aef7..ac4045c 100644
a
|
b
|
std::vector<IComponent*> CComponentManager::Script_GetComponentsWithInterface(Sc
|
429 | 429 | CMessage* CComponentManager::ConstructMessage(int mtid, JS::HandleValue data) |
430 | 430 | { |
431 | 431 | if (mtid == MT__Invalid || mtid > (int)m_MessageTypeIdsByName.size()) // (IDs start at 1 so use '>' here) |
432 | | LOGERROR(L"PostMessage with invalid message type ID '%d'", mtid); |
| 432 | LOGERROR("PostMessage with invalid message type ID '%d'", mtid); |
433 | 433 | |
434 | 434 | if (mtid < MT__LastNative) |
435 | 435 | { |
… |
… |
CComponentManager::ComponentTypeId CComponentManager::GetScriptWrapper(Interface
|
672 | 672 | for (; iiit != m_InterfaceIdsByName.end(); ++iiit) |
673 | 673 | if (iiit->second == iid) |
674 | 674 | { |
675 | | LOGERROR(L"No script wrapper found for interface id %d '%hs'", iid, iiit->first.c_str()); |
| 675 | LOGERROR("No script wrapper found for interface id %d '%hs'", iid, iiit->first.c_str()); |
676 | 676 | return CID__Invalid; |
677 | 677 | } |
678 | 678 | |
679 | | LOGERROR(L"No script wrapper found for interface id %d", iid); |
| 679 | LOGERROR("No script wrapper found for interface id %d", iid); |
680 | 680 | return CID__Invalid; |
681 | 681 | } |
682 | 682 | |
… |
… |
IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy
|
753 | 753 | std::map<ComponentTypeId, ComponentType>::const_iterator it = m_ComponentTypesById.find(cid); |
754 | 754 | if (it == m_ComponentTypesById.end()) |
755 | 755 | { |
756 | | LOGERROR(L"Invalid component id %d", cid); |
| 756 | LOGERROR("Invalid component id %d", cid); |
757 | 757 | return NULL; |
758 | 758 | } |
759 | 759 | |
… |
… |
IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy
|
764 | 764 | boost::unordered_map<entity_id_t, IComponent*>& emap1 = m_ComponentsByInterface[ct.iid]; |
765 | 765 | if (emap1.find(ent.GetId()) != emap1.end()) |
766 | 766 | { |
767 | | LOGERROR(L"Multiple components for interface %d", ct.iid); |
| 767 | LOGERROR("Multiple components for interface %d", ct.iid); |
768 | 768 | return NULL; |
769 | 769 | } |
770 | 770 | |
… |
… |
IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy
|
780 | 780 | m_ScriptInterface.CallConstructor(tmpCtor, argv, &obj); |
781 | 781 | if (obj.isNull()) |
782 | 782 | { |
783 | | LOGERROR(L"Script component constructor failed"); |
| 783 | LOGERROR("Script component constructor failed"); |
784 | 784 | return NULL; |
785 | 785 | } |
786 | 786 | } |
… |
… |
entity_id_t CComponentManager::AddEntity(const std::wstring& templateName, entit
|
887 | 887 | CComponentManager::ComponentTypeId cid = LookupCID(it->first); |
888 | 888 | if (cid == CID__Invalid) |
889 | 889 | { |
890 | | LOGERROR(L"Unrecognised component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); |
| 890 | LOGERROR("Unrecognised component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); |
891 | 891 | return INVALID_ENTITY; |
892 | 892 | } |
893 | 893 | |
894 | 894 | if (!AddComponent(handle, cid, it->second)) |
895 | 895 | { |
896 | | LOGERROR(L"Failed to construct component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); |
| 896 | LOGERROR("Failed to construct component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); |
897 | 897 | return INVALID_ENTITY; |
898 | 898 | } |
899 | 899 | // TODO: maybe we should delete already-constructed components if one of them fails? |
… |
… |
std::vector<std::string> CComponentManager::Script_FindJSONFiles(ScriptInterface
|
1226 | 1226 | { |
1227 | 1227 | // Some error reading directory |
1228 | 1228 | wchar_t error[200]; |
1229 | | LOGERROR(L"Error reading directory '%ls': %ls", cbData.path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 1229 | LOGERROR("Error reading directory '%ls': %ls", cbData.path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | return cbData.templates; |
-
diff --git a/source/simulation2/system/ComponentManagerSerialization.cpp b/source/simulation2/system/ComponentManagerSerialization.cpp
index 78b2cd3..1dd0939 100644
a
|
b
|
bool CComponentManager::DeserializeState(std::istream& stream)
|
322 | 322 | ComponentTypeId ctid = LookupCID(ctname); |
323 | 323 | if (ctid == CID__Invalid) |
324 | 324 | { |
325 | | LOGERROR(L"Deserialization saw unrecognised component type '%hs'", ctname.c_str()); |
| 325 | LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str()); |
326 | 326 | return false; |
327 | 327 | } |
328 | 328 | |
… |
… |
bool CComponentManager::DeserializeState(std::istream& stream)
|
349 | 349 | ComponentTypeId ctid = LookupCID(ctname); |
350 | 350 | if (ctid == CID__Invalid) |
351 | 351 | { |
352 | | LOGERROR(L"Deserialization saw unrecognised component type '%hs'", ctname.c_str()); |
| 352 | LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str()); |
353 | 353 | return false; |
354 | 354 | } |
355 | 355 | |
… |
… |
bool CComponentManager::DeserializeState(std::istream& stream)
|
379 | 379 | |
380 | 380 | if (stream.peek() != EOF) |
381 | 381 | { |
382 | | LOGERROR(L"Deserialization didn't reach EOF"); |
| 382 | LOGERROR("Deserialization didn't reach EOF"); |
383 | 383 | return false; |
384 | 384 | } |
385 | 385 | |
… |
… |
bool CComponentManager::DeserializeState(std::istream& stream)
|
391 | 391 | } |
392 | 392 | catch (PSERROR_Deserialize& e) |
393 | 393 | { |
394 | | LOGERROR(L"Deserialization failed: %hs", e.what()); |
| 394 | LOGERROR("Deserialization failed: %hs", e.what()); |
395 | 395 | return false; |
396 | 396 | } |
397 | 397 | } |
-
diff --git a/source/simulation2/system/ParamNode.cpp b/source/simulation2/system/ParamNode.cpp
index f966004..0c5016a 100644
a
|
b
|
void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element, const
|
123 | 123 | if (tokenIt != tokens.end()) |
124 | 124 | tokens.erase(tokenIt); |
125 | 125 | else |
126 | | LOGWARNING(L"[ParamNode] Could not remove token '%ls' from node '%hs'%ls; not present in list nor inherited (possible typo?)", |
| 126 | LOGWARNING("[ParamNode] Could not remove token '%ls' from node '%hs'%ls; not present in list nor inherited (possible typo?)", |
127 | 127 | newTokens[i].substr(1).c_str(), name.c_str(), sourceIdentifier ? (L" in '" + std::wstring(sourceIdentifier) + L"'").c_str() : L""); |
128 | 128 | } |
129 | 129 | else |
-
diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp
index daa6f3e..c3977bf 100644
a
|
b
|
void ISoundManager::CloseGame()
|
204 | 204 | |
205 | 205 | void CSoundManager::al_ReportError(ALenum err, const char* caller, int line) |
206 | 206 | { |
207 | | LOGERROR(L"OpenAL error: %hs; called from %hs (line %d)\n", alGetString(err), caller, line); |
| 207 | LOGERROR("OpenAL error: %hs; called from %hs (line %d)\n", alGetString(err), caller, line); |
208 | 208 | } |
209 | 209 | |
210 | 210 | void CSoundManager::al_check(const char* caller, int line) |
… |
… |
void CSoundManager::al_check(const char* caller, int line)
|
216 | 216 | |
217 | 217 | Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path)) |
218 | 218 | { |
219 | | // LOGERROR(L"GUI file '%ls' changed - reloading page", path.string().c_str()); |
| 219 | // LOGERROR("GUI file '%ls' changed - reloading page", path.string().c_str()); |
220 | 220 | |
221 | 221 | return INFO::OK; |
222 | 222 | } |
… |
… |
Status CSoundManager::AlcInit()
|
338 | 338 | } |
339 | 339 | else |
340 | 340 | { |
341 | | LOGERROR(L"error in gensource = %d", err); |
| 341 | LOGERROR("error in gensource = %d", err); |
342 | 342 | } |
343 | 343 | delete[] sourceList; |
344 | 344 | } |
… |
… |
Status CSoundManager::AlcInit()
|
354 | 354 | debug_printf(L"Sound: AlcInit success, using %hs\n", dev_name); |
355 | 355 | else |
356 | 356 | { |
357 | | LOGERROR(L"Sound: AlcInit failed, m_Device=%p m_Context=%p dev_name=%hs err=%x\n", m_Device, m_Context, dev_name, err); |
| 357 | LOGERROR("Sound: AlcInit failed, m_Device=%p m_Context=%p dev_name=%hs err=%x\n", m_Device, m_Context, dev_name, err); |
358 | 358 | |
359 | 359 | // FIXME Hack to get around exclusive access to the sound device |
360 | 360 | #if OS_UNIX |
… |
… |
void CSoundManager::PlayAsGroup(const VfsPath& groupPath, CVector3D sourcePos, e
|
654 | 654 | group = new CSoundGroup(); |
655 | 655 | if (!group->LoadSoundGroup(L"audio/" + groupPath.string())) |
656 | 656 | { |
657 | | LOGERROR(L"Failed to load sound group '%ls'", groupPath.string().c_str()); |
| 657 | LOGERROR("Failed to load sound group '%ls'", groupPath.string().c_str()); |
658 | 658 | delete group; |
659 | 659 | group = NULL; |
660 | 660 | } |
-
diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp
index e3f6173..65647d4 100644
a
|
b
|
CSoundData* CSoundData::SoundDataFromOgg(const VfsPath& itemPath)
|
107 | 107 | } |
108 | 108 | else |
109 | 109 | { |
110 | | LOGERROR(L"could not initialize ogg data at %ls", itemPath.string().c_str()); |
| 110 | LOGERROR("could not initialize ogg data at %ls", itemPath.string().c_str()); |
111 | 111 | delete oggAnswer; |
112 | 112 | } |
113 | 113 | |
-
diff --git a/source/soundmanager/items/CSoundBase.cpp b/source/soundmanager/items/CSoundBase.cpp
index e7dce37..8486114 100644
a
|
b
|
bool CSoundBase::InitOpenAL()
|
112 | 112 | } |
113 | 113 | else |
114 | 114 | { |
115 | | // LOGERROR(L"Source not allocated by SoundManager\n", 0); |
| 115 | // LOGERROR("Source not allocated by SoundManager\n", 0); |
116 | 116 | } |
117 | 117 | return false; |
118 | 118 | } |
-
diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp
index 2969e2e..373b382 100644
a
|
b
|
static void HandleError(const CStrW& message, const VfsPath& pathname, Status er
|
227 | 227 | { |
228 | 228 | if (err == ERR::AGAIN) |
229 | 229 | return; // open failed because sound is disabled (don't log this) |
230 | | LOGERROR(L"%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string().c_str(), ErrorString(err)); |
| 230 | LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string().c_str(), ErrorString(err)); |
231 | 231 | } |
232 | 232 | |
233 | 233 | void CSoundGroup::PlayNext(const CVector3D& position, entity_id_t source) |
… |
… |
bool CSoundGroup::LoadSoundGroup(const VfsPath& pathnameXML)
|
320 | 320 | |
321 | 321 | if (root.GetNodeName() != el_soundgroup) |
322 | 322 | { |
323 | | LOGERROR(L"Invalid SoundGroup format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); |
| 323 | LOGERROR("Invalid SoundGroup format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); |
324 | 324 | return false; |
325 | 325 | } |
326 | 326 | |
-
diff --git a/source/tools/atlas/GameInterface/GameLoop.cpp b/source/tools/atlas/GameInterface/GameLoop.cpp
index cc2fa20..4943f6b 100644
a
|
b
|
static void* RunEngine(void* data)
|
178 | 178 | debug_warn(L"Unrecognised message"); |
179 | 179 | // CLogger might not be initialised, but this error will be sent |
180 | 180 | // to the debug output window anyway so people can still see it |
181 | | LOGERROR(L"Unrecognised message (%hs)", name.c_str()); |
| 181 | LOGERROR("Unrecognised message (%hs)", name.c_str()); |
182 | 182 | } |
183 | 183 | |
184 | 184 | if (msg->GetType() == IMessage::Query) |
-
diff --git a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp
index 38060ee..9a7c2e7 100644
a
|
b
|
MESSAGEHANDLER(ImportHeightmap)
|
176 | 176 | File file; |
177 | 177 | if (file.Open(src, O_RDONLY) < 0) |
178 | 178 | { |
179 | | LOGERROR(L"Failed to load heightmap."); |
| 179 | LOGERROR("Failed to load heightmap."); |
180 | 180 | return; |
181 | 181 | } |
182 | 182 | |
… |
… |
MESSAGEHANDLER(ImportHeightmap)
|
187 | 187 | |
188 | 188 | if (read(file.Descriptor(), fileData.get(), fileSize) < 0) |
189 | 189 | { |
190 | | LOGERROR(L"Failed to read heightmap image."); |
| 190 | LOGERROR("Failed to read heightmap image."); |
191 | 191 | file.Close(); |
192 | 192 | return; |
193 | 193 | } |
… |
… |
MESSAGEHANDLER(ImportHeightmap)
|
198 | 198 | Tex tex; |
199 | 199 | if (tex.decode(fileData, fileSize) < 0) |
200 | 200 | { |
201 | | LOGERROR(L"Failed to decode heightmap."); |
| 201 | LOGERROR("Failed to decode heightmap."); |
202 | 202 | return; |
203 | 203 | } |
204 | 204 | |
205 | 205 | // Convert to uncompressed BGRA with no mipmaps |
206 | 206 | if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0) |
207 | 207 | { |
208 | | LOGERROR(L"Failed to transform heightmap."); |
| 208 | LOGERROR("Failed to transform heightmap."); |
209 | 209 | return; |
210 | 210 | } |
211 | 211 | |
-
diff --git a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
index a366503..6da4081 100644
a
|
b
|
BEGIN_COMMAND(DeleteObjects)
|
930 | 930 | entity_id_t ent = sim.AddEntity(oldObjects[i].templateName.FromUTF8(), oldObjects[i].entityID); |
931 | 931 | if (ent == INVALID_ENTITY) |
932 | 932 | { |
933 | | LOGERROR(L"Failed to load entity template '%hs'", oldObjects[i].templateName.c_str()); |
| 933 | LOGERROR("Failed to load entity template '%hs'", oldObjects[i].templateName.c_str()); |
934 | 934 | } |
935 | 935 | else |
936 | 936 | { |