Lots of refactoring in IntegrationGameModeBase
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
#include "LockedWrapper.h"
|
||||
#include "DebugPrint.h"
|
||||
#include "drvutil.hpp"
|
||||
|
||||
void FLockedWrapper::InitWrapper() {
|
||||
if (Lockable.Wrapper.play_initialize != nullptr) {
|
||||
@@ -16,4 +17,24 @@ void FLockedWrapper::InitWrapper() {
|
||||
Lockable.Wrapper.hook_dprint(DebugPrint::DPrint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FString FLockedWrapper::FetchStdout() {
|
||||
if (Lockable.Wrapper.engine == nullptr) {
|
||||
return FString();
|
||||
}
|
||||
|
||||
uint32_t ndata; const char* data;
|
||||
Lockable.Wrapper.get_outgoing(Get(), 0, &ndata, &data);
|
||||
|
||||
if (ndata == 0) {
|
||||
return FString();
|
||||
}
|
||||
|
||||
std::string_view src(data, ndata);
|
||||
int consumed;
|
||||
std::u16string cps = drvutil::utf8_to_ucs2(src, &consumed);
|
||||
Lockable.Wrapper.play_sent_outgoing(Get(), 0, consumed);
|
||||
return FString(cps.size(), (const UCS2CHAR*)(&cps[0]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user