Major breaking changes
This commit is contained in:
@@ -122,6 +122,8 @@ bool create_app_mutex()
|
||||
return result;
|
||||
}
|
||||
|
||||
#define NVAPI_APPNAME L"Second Life"
|
||||
|
||||
void ll_nvapi_init(NvDRSSessionHandle hSession)
|
||||
{
|
||||
// (2) load all the system settings into the session
|
||||
@@ -132,12 +134,9 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
|
||||
return;
|
||||
}
|
||||
|
||||
NvAPI_UnicodeString profile_name;
|
||||
//std::string app_name = LLTrans::getString("APP_NAME");
|
||||
std::string app_name("Second Life"); // <alchemy/>
|
||||
llutf16string w_app_name = utf8str_to_utf16str(app_name);
|
||||
wsprintf(profile_name, L"%s", w_app_name.c_str());
|
||||
status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name);
|
||||
NvAPI_UnicodeString wsz = { 0 };
|
||||
memcpy_s(wsz, sizeof(wsz), NVAPI_APPNAME, sizeof(NVAPI_APPNAME));
|
||||
status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, wsz);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
@@ -409,11 +408,8 @@ const S32 MAX_CONSOLE_LINES = 500;
|
||||
|
||||
void create_console()
|
||||
{
|
||||
int h_con_handle;
|
||||
long l_std_handle;
|
||||
|
||||
CONSOLE_SCREEN_BUFFER_INFO coninfo;
|
||||
FILE *fp;
|
||||
|
||||
// allocate a console for this app
|
||||
AllocConsole();
|
||||
@@ -423,48 +419,16 @@ void create_console()
|
||||
coninfo.dwSize.Y = MAX_CONSOLE_LINES;
|
||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
|
||||
|
||||
// redirect unbuffered STDOUT to the console
|
||||
l_std_handle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
|
||||
if (h_con_handle == -1)
|
||||
{
|
||||
LL_WARNS() << "create_console() failed to open stdout handle" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fp = _fdopen( h_con_handle, "w" );
|
||||
*stdout = *fp;
|
||||
setvbuf( stdout, NULL, _IONBF, 0 );
|
||||
}
|
||||
// Redirect the CRT standard input, output, and error handles to the console
|
||||
freopen("CONIN$", "r", stdin);
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
|
||||
setvbuf( stdin, NULL, _IONBF, 0 );
|
||||
setvbuf( stdout, NULL, _IONBF, 0 );
|
||||
setvbuf( stderr, NULL, _IONBF, 0 );
|
||||
|
||||
// redirect unbuffered STDIN to the console
|
||||
l_std_handle = (long)GetStdHandle(STD_INPUT_HANDLE);
|
||||
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
|
||||
if (h_con_handle == -1)
|
||||
{
|
||||
LL_WARNS() << "create_console() failed to open stdin handle" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fp = _fdopen( h_con_handle, "r" );
|
||||
*stdin = *fp;
|
||||
setvbuf( stdin, NULL, _IONBF, 0 );
|
||||
}
|
||||
|
||||
// redirect unbuffered STDERR to the console
|
||||
l_std_handle = (long)GetStdHandle(STD_ERROR_HANDLE);
|
||||
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
|
||||
if (h_con_handle == -1)
|
||||
{
|
||||
LL_WARNS() << "create_console() failed to open stderr handle" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fp = _fdopen( h_con_handle, "w" );
|
||||
*stderr = *fp;
|
||||
setvbuf( stderr, NULL, _IOFBF, 1024 ); //Assigning a buffer improves speed a LOT, esp on vista/win7
|
||||
//_IOLBF is borked.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user