Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
33
Src/Wasabi/api/console/console.cpp
Normal file
33
Src/Wasabi/api/console/console.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "console.h"
|
||||
#include <api/service/svcs/svc_console.h>
|
||||
#include <api/service/svc_enum.h>
|
||||
|
||||
void Console::outputString(int severity, const char *string) {
|
||||
if (!console) {
|
||||
console = new ConsoleEnum;
|
||||
}
|
||||
|
||||
if (needscan) {
|
||||
needscan=0;
|
||||
console->reset();
|
||||
svc_console *con = console->getNext();
|
||||
noconsole = (con == NULL);
|
||||
}
|
||||
if (noconsole) return;
|
||||
|
||||
console->reset();
|
||||
svc_console *con = console->getNext();
|
||||
while (con) {
|
||||
con->outputString(severity, string);
|
||||
con = console->getNext();
|
||||
}
|
||||
}
|
||||
|
||||
void Console::reset() {
|
||||
needscan=1;
|
||||
}
|
||||
|
||||
int Console::needscan=1;
|
||||
int Console::noconsole=0;
|
||||
|
||||
ConsoleEnum *Console::console = NULL;
|
19
Src/Wasabi/api/console/console.h
Normal file
19
Src/Wasabi/api/console/console.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#ifndef __CONSOLE_H
|
||||
#define __CONSOLE_H
|
||||
|
||||
class ConsoleEnum;
|
||||
|
||||
class Console {
|
||||
public:
|
||||
|
||||
static void outputString(int severity, const char *string);
|
||||
static void reset();
|
||||
|
||||
private:
|
||||
|
||||
static ConsoleEnum *console;
|
||||
static int needscan;
|
||||
static int noconsole;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue