mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 17:42:29 +01:00
Fix for MSVC
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace OpenRCT2 { namespace Ui
|
||||
{
|
||||
class InGameConsole : public InteractiveConsole
|
||||
class InGameConsole final : public InteractiveConsole
|
||||
{
|
||||
private:
|
||||
static constexpr sint32 CONSOLE_MAX_LINES = 300;
|
||||
|
||||
@@ -1234,11 +1234,11 @@ void InteractiveConsole::WriteLineWarning(const std::string &s)
|
||||
WriteLine(s, FORMAT_YELLOW);
|
||||
}
|
||||
|
||||
void InteractiveConsole::WriteFormatLine(const std::string &format, ...)
|
||||
void InteractiveConsole::WriteFormatLine(const char * format, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, format);
|
||||
auto buffer = String::Format_VA(format.c_str(), list);
|
||||
auto buffer = String::Format_VA(format, list);
|
||||
va_end(list);
|
||||
|
||||
auto s = std::string(buffer);
|
||||
|
||||
@@ -43,20 +43,18 @@ class InteractiveConsole
|
||||
public:
|
||||
virtual ~InteractiveConsole() { }
|
||||
|
||||
sint32 cc_clear(const utf8 **argv, sint32 argc);
|
||||
|
||||
void Execute(const std::string &s);
|
||||
void WriteLine(const std::string &s);
|
||||
void WriteLineError(const std::string &s);
|
||||
void WriteLineWarning(const std::string &s);
|
||||
void WriteFormatLine(const std::string &format, ...);
|
||||
void WriteFormatLine(const char * format, ...);
|
||||
|
||||
virtual void Clear() abstract;
|
||||
virtual void Close() abstract;
|
||||
virtual void WriteLine(const std::string &s, uint32 colourFormat) abstract;
|
||||
};
|
||||
|
||||
class StdInOutConsole : public InteractiveConsole
|
||||
class StdInOutConsole final : public InteractiveConsole
|
||||
{
|
||||
private:
|
||||
std::queue<std::tuple<std::promise<void>, std::string>> _evalQueue;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../thirdparty/linenoise.hpp"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "Console.h"
|
||||
|
||||
void StdInOutConsole::Start()
|
||||
|
||||
10
src/openrct2/thirdparty/linenoise.hpp
vendored
10
src/openrct2/thirdparty/linenoise.hpp
vendored
@@ -333,7 +333,7 @@ inline void PushBuffer(WCHAR c)
|
||||
// Send the string to the input buffer.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline void SendSequence(LPWSTR seq)
|
||||
inline void SendSequence(LPCWSTR seq)
|
||||
{
|
||||
DWORD out;
|
||||
INPUT_RECORD in;
|
||||
@@ -776,14 +776,14 @@ inline void InterpretEscSeq(void)
|
||||
if (es_argv[0] == 21) // ESC[21t Report xterm window's title
|
||||
{
|
||||
WCHAR buf[MAX_PATH * 2];
|
||||
DWORD len = GetConsoleTitleW(buf + 3, lenof(buf) - 3 - 2);
|
||||
DWORD len2 = GetConsoleTitleW(buf + 3, lenof(buf) - 3 - 2);
|
||||
// Too bad if it's too big or fails.
|
||||
buf[0] = ESC;
|
||||
buf[1] = ']';
|
||||
buf[2] = 'l';
|
||||
buf[3 + len] = ESC;
|
||||
buf[3 + len + 1] = '\\';
|
||||
buf[3 + len + 2] = '\0';
|
||||
buf[3 + len2] = ESC;
|
||||
buf[3 + len2 + 1] = '\\';
|
||||
buf[3 + len2 + 2] = '\0';
|
||||
SendSequence(buf);
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user