diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-02-16 03:40:06 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-02-16 03:40:06 +0000 |
commit | 425decdf7e9284d15aa726e3ae96b9942fb0e3ea (patch) | |
tree | 6c0dd7edfefff1be7b9e75fe0b3a0a85fe1595f3 /src/qcommon/q3_lauxlib.cpp | |
parent | ccb0b2e4d6674a7a00c9bf491f08fc73b6898c54 (diff) |
create tremded branch
Diffstat (limited to 'src/qcommon/q3_lauxlib.cpp')
-rw-r--r-- | src/qcommon/q3_lauxlib.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/qcommon/q3_lauxlib.cpp b/src/qcommon/q3_lauxlib.cpp new file mode 100644 index 0000000..ee7efa2 --- /dev/null +++ b/src/qcommon/q3_lauxlib.cpp @@ -0,0 +1,46 @@ +#include "q3_lauxlib.h" + +#include <sys/types.h> + +#include <cstdarg> +#include <iostream> + +#include "sys/sys_shared.h" + +#include "cvar.h" +#include "msg.h" +#include "net.h" +#include "q_shared.h" +#include "qcommon.h" + +size_t qlua_writestring(const char* string, size_t n) +{ +#ifndef DEDICATED + CL_ConsolePrint( string ); +#endif + Q_StripIndentMarker( const_cast<char*>(string) ); + Sys_Print( string ); + + return n; +} + +int qlua_writeline(void) +{ +#ifndef DEDICATED + CL_ConsolePrint( "\n" ); +#endif + Sys_Print( "\n" ); + return 0; +} + +int qlua_writestringerror(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + char m[MAXPRINTMSG]; + Q_vsnprintf(m, sizeof(m), fmt, ap); + va_end (ap); + Com_Printf(S_COLOR_YELLOW "%s\n", m); + return 0; +} + |