Skip to content

Commit f91b5b6

Browse files
committed
Console::println() -> Console::printLine()
1 parent 39d25ed commit f91b5b6

File tree

224 files changed

+1966
-1966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+1966
-1966
lines changed

src/tdme/application/Application.cpp

+26-26
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void Application::exit(int exitCode) {
164164

165165
vector<string> backtraceLines;
166166
auto backtraceHeaderLine = "windowsExceptionHandler(): process " + to_string((uint64_t)process) + " crashed: Printing stacktrace(thread " + to_string((uint64_t)thread) + ")";
167-
Console::println(backtraceHeaderLine);
167+
Console::printLine(backtraceHeaderLine);
168168
backtraceLines.push_back(backtraceHeaderLine);
169169

170170
CHAR _pathToExecutable[MAX_PATH];
@@ -174,11 +174,11 @@ void Application::exit(int exitCode) {
174174
#if defined(_MSC_VER) == false
175175
auto addr2lineToolCmd = StringTools::substring(pathToExecutable, 0, StringTools::lastIndexOf(pathToExecutable, '\\')) + "\\addr2line.exe";
176176
if (FileSystem::getInstance()->exists(addr2lineToolCmd) == false) {
177-
Console::println("handler(): " + addr2lineToolCmd + ": not found! Please copy addr2line utility to binary location!");
177+
Console::printLine("handler(): " + addr2lineToolCmd + ": not found! Please copy addr2line utility to binary location!");
178178
mutex.unlock();
179179

180180
//
181-
Console::println();
181+
Console::printLine();
182182

183183
// shutdown console
184184
Console::shutdown();
@@ -190,7 +190,7 @@ void Application::exit(int exitCode) {
190190
#endif
191191

192192
auto backtraceExecutableLine = "windowsExceptionHandler(): path to executable: " + pathToExecutable;
193-
Console::println(backtraceExecutableLine);
193+
Console::printLine(backtraceExecutableLine);
194194
backtraceLines.push_back(backtraceExecutableLine);
195195

196196
pathToExecutable = string("\"") + StringTools::replace(pathToExecutable, "\\", "\\\\") + "\"";
@@ -310,15 +310,15 @@ void Application::exit(int exitCode) {
310310
addr2LineOutput = StringTools::replace(StringTools::replace(addr2LineOutput, addr2lineFunctionName, RTTI::demangle(addr2lineFunctionName.c_str())), "\n", "");
311311
}
312312
auto backtraceLine = to_string(frameIdx) + ": " + addr2LineOutput;
313-
Console::println(backtraceLine);
313+
Console::printLine(backtraceLine);
314314
backtraceLines.push_back(backtraceLine);
315315
} else {
316316
auto backtraceLine = to_string(frameIdx) + ": " + string(RTTI::demangle(_functionName)) + " at " + fileName + ":" + to_string(line);
317-
Console::println(backtraceLine);
317+
Console::printLine(backtraceLine);
318318
backtraceLines.push_back(backtraceLine);
319319
}
320320
#else
321-
Console::println(to_string(frameIdx) + ": " + functionName + " at " + fileName + ":" + to_string(line));
321+
Console::printLine(to_string(frameIdx) + ": " + functionName + " at " + fileName + ":" + to_string(line));
322322
#endif
323323
frameIdx++;
324324
}
@@ -330,7 +330,7 @@ void Application::exit(int exitCode) {
330330

331331
mutex.unlock();
332332

333-
Console::println();
333+
Console::printLine();
334334

335335
// shutdown console
336336
Console::shutdown();
@@ -538,7 +538,7 @@ void Application::setClipboardContent(const string& content) {
538538
}
539539

540540
static void glfwErrorCallback(int error, const char* description) {
541-
Console::println(string("glfwErrorCallback(): ") + description);
541+
Console::printLine(string("glfwErrorCallback(): ") + description);
542542
}
543543

544544
int Application::run(int argc, char** argv, const string& title, InputEventHandler* inputEventHandler, int windowHints) {
@@ -567,7 +567,7 @@ int Application::run(int argc, char** argv, const string& title, InputEventHandl
567567
Application::inputEventHandler = inputEventHandler;
568568
glfwSetErrorCallback(glfwErrorCallback);
569569
if (glfwInit() == false) {
570-
Console::println("glflInit(): failed!");
570+
Console::printLine("glflInit(): failed!");
571571
return EXITCODE_FAILURE;
572572
}
573573

@@ -592,29 +592,29 @@ int Application::run(int argc, char** argv, const string& title, InputEventHandl
592592
}
593593

594594
//
595-
Console::println("Application::run(): Opening renderer library: " + rendererLibrary);
595+
Console::printLine("Application::run(): Opening renderer library: " + rendererLibrary);
596596

597597
// load renderer library
598598
#if defined(_MSC_VER)
599599
//
600600
auto rendererLibraryHandle = LoadLibrary(rendererLibrary.c_str());
601601
if (rendererLibraryHandle == nullptr) {
602-
Console::println("Application::run(): Could not open renderer library");
602+
Console::printLine("Application::run(): Could not open renderer library");
603603
glfwTerminate();
604604
return EXITCODE_FAILURE;
605605
}
606606
//
607607
Renderer* (*rendererCreateInstance)() = (Renderer*(*)())GetProcAddress(rendererLibraryHandle, "createInstance");
608608
//
609609
if (rendererCreateInstance == nullptr) {
610-
Console::println("Application::run(): Could not find renderer library createInstance() entry point");
610+
Console::printLine("Application::run(): Could not find renderer library createInstance() entry point");
611611
glfwTerminate();
612612
return EXITCODE_FAILURE;
613613
}
614614
//
615615
renderer = (Renderer*)rendererCreateInstance();
616616
if (renderer == nullptr) {
617-
Console::println("Application::run(): Could not create renderer");
617+
Console::printLine("Application::run(): Could not create renderer");
618618
glfwTerminate();
619619
return EXITCODE_FAILURE;
620620
}
@@ -626,22 +626,22 @@ int Application::run(int argc, char** argv, const string& title, InputEventHandl
626626
auto rendererLibraryHandle = dlopen(rendererLibrary.c_str(), RTLD_NOW);
627627
#endif
628628
if (rendererLibraryHandle == nullptr) {
629-
Console::println("Application::run(): Could not open renderer library");
629+
Console::printLine("Application::run(): Could not open renderer library");
630630
glfwTerminate();
631631
return EXITCODE_FAILURE;
632632
}
633633
//
634634
Renderer* (*rendererCreateInstance)() = (Renderer*(*)())dlsym(rendererLibraryHandle, "createInstance");
635635
//
636636
if (rendererCreateInstance == nullptr) {
637-
Console::println("Application::run(): Could not find renderer library createInstance() entry point");
637+
Console::printLine("Application::run(): Could not find renderer library createInstance() entry point");
638638
glfwTerminate();
639639
return EXITCODE_FAILURE;
640640
}
641641
//
642642
renderer = (Renderer*)rendererCreateInstance();
643643
if (renderer == nullptr) {
644-
Console::println("Application::run(): Could not create renderer");
644+
Console::printLine("Application::run(): Could not create renderer");
645645
glfwTerminate();
646646
return EXITCODE_FAILURE;
647647
}
@@ -661,14 +661,14 @@ int Application::run(int argc, char** argv, const string& title, InputEventHandl
661661

662662
//
663663
if (glfwWindow == nullptr) {
664-
Console::println("glfwCreateWindow(): Could not create window");
664+
Console::printLine("glfwCreateWindow(): Could not create window");
665665
glfwTerminate();
666666
return EXITCODE_FAILURE;
667667
}
668668

669669
//
670670
if (renderer->initializeWindowSystemRendererContext(glfwWindow) == false) {
671-
Console::println("glfwCreateWindow(): Could not initialize window system renderer context");
671+
Console::printLine("glfwCreateWindow(): Could not initialize window system renderer context");
672672
glfwTerminate();
673673
return EXITCODE_FAILURE;
674674
}
@@ -709,7 +709,7 @@ int Application::run(int argc, char** argv, const string& title, InputEventHandl
709709
auto gameControllerDatabase = FileSystem::getInstance()->getContentAsString("resources/engine/misc", "gamecontrollerdb.txt");
710710
glfwUpdateGamepadMappings(gameControllerDatabase.c_str());
711711
} catch (Exception& exception) {
712-
Console::println("An error occurred: " + string(exception.what()));
712+
Console::printLine("An error occurred: " + string(exception.what()));
713713
}
714714

715715
//
@@ -731,7 +731,7 @@ int Application::run(int argc, char** argv, const string& title, InputEventHandl
731731
//
732732
auto localExitCode = exitCode;
733733
if (Application::application != nullptr) {
734-
Console::println("Application::run(): Shutting down application");
734+
Console::printLine("Application::run(): Shutting down application");
735735
Application::application->dispose();
736736
Engine::shutdown();
737737
Audio::shutdown();
@@ -875,10 +875,10 @@ void Application::glfwOnClose(GLFWwindow* window) {
875875
}
876876

877877
void Application::glfwOnDrop(GLFWwindow* window, int count, const char** paths) {
878-
Console::println("Application::glfwOnDrop(): " + to_string(count) + " items have been dropped");
878+
Console::printLine("Application::glfwOnDrop(): " + to_string(count) + " items have been dropped");
879879
vector<string> pathsVector;
880880
for (auto i = 0; i < count; i++) {
881-
Console::println("\t" + string(paths[i]));
881+
Console::printLine("\t" + string(paths[i]));
882882
pathsVector.push_back(paths[i]);
883883
}
884884
Application::application->onDrop(pathsVector);
@@ -889,14 +889,14 @@ void Application::glfwOnJoystickConnect(int joystickIdx, int event) {
889889
//
890890
if (event == GLFW_CONNECTED) {
891891
if (glfwJoystickIsGamepad(joystickIdx) == GLFW_TRUE) {
892-
Console::println("Application::glfwOnJoystickConnect(): connected gamepad with idx = " + to_string(joystickIdx) + ", name = " + glfwGetJoystickName(joystickIdx));
892+
Console::printLine("Application::glfwOnJoystickConnect(): connected gamepad with idx = " + to_string(joystickIdx) + ", name = " + glfwGetJoystickName(joystickIdx));
893893
Application::application->connectedGamepads.insert(joystickIdx);
894894
} else {
895-
Console::println("Application::glfwOnJoystickConnect(): connected joystick with idx = " + to_string(joystickIdx) + ", name = " + glfwGetJoystickName(joystickIdx));
895+
Console::printLine("Application::glfwOnJoystickConnect(): connected joystick with idx = " + to_string(joystickIdx) + ", name = " + glfwGetJoystickName(joystickIdx));
896896
Application::application->connectedJoysticks.insert(joystickIdx);
897897
}
898898
} else if (event == GLFW_DISCONNECTED) {
899-
Console::println("Application::glfwOnJoystickConnect(): disconnected joystick/gamepad with idx = " + to_string(joystickIdx));
899+
Console::printLine("Application::glfwOnJoystickConnect(): disconnected joystick/gamepad with idx = " + to_string(joystickIdx));
900900
Application::application->connectedGamepads.erase(joystickIdx);
901901
Application::application->connectedJoysticks.erase(joystickIdx);
902902
}

src/tdme/audio/Audio.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ void Audio::addEntity(AudioEntity* entity)
7171
if (audioEntityIt != audioEntities.end()) {
7272
// check if we want to add this entity a second time
7373
if (entity == audioEntityIt->second) {
74-
Console::println("Audio::addEntity(): " + entity->getId() + ": entity already added!");
74+
Console::printLine("Audio::addEntity(): " + entity->getId() + ": entity already added!");
7575
return;
7676
}
7777
// remove old other entity
7878
removeEntity(entity->getId());
7979
}
8080
audioEntities[entity->getId()] = entity;
8181
} else {
82-
Console::println(string("Audio::addEntity(): adding '" + entity->getId() + "' failed"));
82+
Console::printLine(string("Audio::addEntity(): adding '" + entity->getId() + "' failed"));
8383
}
8484
}
8585

src/tdme/audio/AudioBufferManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ bool AudioBufferManager::removeAudioBuffer(const string& id)
5151
}
5252
}
5353
// should never happen
54-
Console::println(string("Warning: audio buffer not loaded by audio buffer manager"));
54+
Console::printLine(string("Warning: audio buffer not loaded by audio buffer manager"));
5555
return false;
5656
}

src/tdme/audio/AudioStream.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ void AudioStream::play()
7373
alBufferData(alBufferIds[i], format, data->getBuffer(), data->getPosition(), sampleRate);
7474
//
7575
if (alGetError() != AL_NO_ERROR) {
76-
Console::println(string("AudioStream::play(): '"+ id + "': Could not upload buffer"));
76+
Console::printLine(string("AudioStream::play(): '"+ id + "': Could not upload buffer"));
7777
}
7878
buffersToPlay++;
7979
}
8080

8181
alSourceQueueBuffers(alSourceId, buffersToPlay, alBufferIds.data());
8282
if (alGetError() != AL_NO_ERROR) {
83-
Console::println(string("AudioStream::play(): '" + id + "': Could not queue buffers"));
83+
Console::printLine(string("AudioStream::play(): '" + id + "': Could not queue buffers"));
8484
}
8585
alSourcePlay(alSourceId);
8686
if (alGetError() != AL_NO_ERROR) {
87-
Console::println(string("AudioStream::play(): '"+ id + "': Could not play source"));
87+
Console::printLine(string("AudioStream::play(): '"+ id + "': Could not play source"));
8888
}
8989

9090
//
@@ -98,7 +98,7 @@ void AudioStream::pause()
9898

9999
alSourcePause(alSourceId);
100100
if (alGetError() != AL_NO_ERROR) {
101-
Console::println(string("AudioStream::pause(): '" + id + "': Could not pause"));
101+
Console::printLine(string("AudioStream::pause(): '" + id + "': Could not pause"));
102102
}
103103
}
104104

@@ -109,21 +109,21 @@ void AudioStream::stop()
109109

110110
alSourceStop(alSourceId);
111111
if (alGetError() != AL_NO_ERROR) {
112-
Console::println(string("AudioStream::stop(): '" + id + "': Could not stop"));
112+
Console::printLine(string("AudioStream::stop(): '" + id + "': Could not stop"));
113113
}
114114
// determine queued buffers
115115
ALint queuedBuffers;
116116
alGetSourcei(alSourceId, AL_BUFFERS_QUEUED, &queuedBuffers);
117117
if (alGetError() != AL_NO_ERROR) {
118-
Console::println(string("AudioStream::stop(): '" + id + "': Could not determine queued buffers"));
118+
Console::printLine(string("AudioStream::stop(): '" + id + "': Could not determine queued buffers"));
119119
}
120120
// unqueue buffers
121121
if (queuedBuffers > 0) {
122122
vector<uint32_t> removedBuffers;
123123
removedBuffers.resize(queuedBuffers);
124124
alSourceUnqueueBuffers(alSourceId, queuedBuffers, removedBuffers.data());
125125
if (alGetError() != AL_NO_ERROR) {
126-
Console::println(string("AudioStream::stop(): '" + id + "': Could not unqueue buffers"));
126+
Console::printLine(string("AudioStream::stop(): '" + id + "': Could not unqueue buffers"));
127127
}
128128
}
129129

@@ -137,18 +137,18 @@ bool AudioStream::initialize()
137137
case(1): format = AL_FORMAT_MONO16; break;
138138
case(2): format = AL_FORMAT_STEREO16; break;
139139
default:
140-
Console::println(string("AudioStream::initialize(): '" + id + "': Unsupported number of channels"));
140+
Console::printLine(string("AudioStream::initialize(): '" + id + "': Unsupported number of channels"));
141141
}
142142

143143
alGenBuffers(alBufferIds.size(), alBufferIds.data());
144144
if (alGetError() != AL_NO_ERROR) {
145-
Console::println(string("AudioStream::initialize(): '" + id + "': Could not generate buffer"));
145+
Console::printLine(string("AudioStream::initialize(): '" + id + "': Could not generate buffer"));
146146
return false;
147147
}
148148
// create source
149149
alGenSources(1, &alSourceId);
150150
if (alGetError() != AL_NO_ERROR) {
151-
Console::println(string("AudioStream::initialize(): '" + id + "': Could not generate source"));
151+
Console::printLine(string("AudioStream::initialize(): '" + id + "': Could not generate source"));
152152
dispose();
153153
return false;
154154
}
@@ -167,7 +167,7 @@ void AudioStream::update()
167167
int32_t processedBuffers;
168168
alGetSourcei(alSourceId, AL_BUFFERS_PROCESSED, &processedBuffers);
169169
if (alGetError() != AL_NO_ERROR) {
170-
Console::println(string("AudioStream::update(): '" + id + "': Could not determine processed buffers"));
170+
Console::printLine(string("AudioStream::update(): '" + id + "': Could not determine processed buffers"));
171171
}
172172
if (isPlayingBuffers() == false && playing == true) {
173173
play();
@@ -177,7 +177,7 @@ void AudioStream::update()
177177
uint32_t processedBufferId;
178178
alSourceUnqueueBuffers(alSourceId, 1, &processedBufferId);
179179
if (alGetError() != AL_NO_ERROR) {
180-
Console::println(string("AudioStream::update(): '" + id + "': Could not unqueue buffers"));
180+
Console::printLine(string("AudioStream::update(): '" + id + "': Could not unqueue buffers"));
181181
}
182182
// fill processed buffer again
183183
data->clear();
@@ -189,12 +189,12 @@ void AudioStream::update()
189189
// upload buffer data
190190
alBufferData(processedBufferId, format, data->getBuffer(), data->getPosition(), sampleRate);
191191
if (alGetError() != AL_NO_ERROR) {
192-
Console::println(string("AudioStream::update(): '" + id + "': Could not upload buffer"));
192+
Console::printLine(string("AudioStream::update(): '" + id + "': Could not upload buffer"));
193193
}
194194
// queue it
195195
alSourceQueueBuffers(alSourceId, 1, &processedBufferId);
196196
if (alGetError() != AL_NO_ERROR) {
197-
Console::println(string("AudioStream::update(): '" + id + "': Could not queue buffer"));
197+
Console::printLine(string("AudioStream::update(): '" + id + "': Could not queue buffer"));
198198
}
199199
// stop buffer if not filled completely
200200
if (data->getPosition() < data->getCapacity()) {
@@ -233,13 +233,13 @@ void AudioStream::dispose()
233233
//
234234
alDeleteSources(1, &alSourceId);
235235
if (alGetError() != AL_NO_ERROR) {
236-
Console::println(string("AudioStream::dispose(): '" + id + "': Could not delete source"));
236+
Console::printLine(string("AudioStream::dispose(): '" + id + "': Could not delete source"));
237237
}
238238
alSourceId = Audio::ALSOURCEID_NONE;
239239
//
240240
alDeleteBuffers(alBufferIds.size(), alBufferIds.data());
241241
if (alGetError() != AL_NO_ERROR) {
242-
Console::println(string("AudioStream::dispose(): '" + id + "': Could not delete buffers"));
242+
Console::printLine(string("AudioStream::dispose(): '" + id + "': Could not delete buffers"));
243243
}
244244
alBufferIds.fill(Audio::ALBUFFERID_NONE);
245245
//

src/tdme/audio/PacketAudioStream.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using tdme::utilities::Console;
1818

1919
void PacketAudioStream::rewind()
2020
{
21-
Console::println("PacketAudioStream::rewind(): Not supported!");
21+
Console::printLine("PacketAudioStream::rewind(): Not supported!");
2222
}
2323

2424
bool PacketAudioStream::initialize()

0 commit comments

Comments
 (0)