aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llappviewerwin32.cpp')
-rw-r--r--linden/indra/newview/llappviewerwin32.cpp75
1 files changed, 47 insertions, 28 deletions
diff --git a/linden/indra/newview/llappviewerwin32.cpp b/linden/indra/newview/llappviewerwin32.cpp
index a2d89a3..59883e5 100644
--- a/linden/indra/newview/llappviewerwin32.cpp
+++ b/linden/indra/newview/llappviewerwin32.cpp
@@ -54,9 +54,23 @@
54 54
55#include "llviewernetwork.h" 55#include "llviewernetwork.h"
56#include "llmd5.h" 56#include "llmd5.h"
57#include "llfindlocale.h"
57 58
58#include "llcommandlineparser.h" 59#include "llcommandlineparser.h"
59 60
61//*FIX:Mani - This hack is to fix a linker issue with libndofdev.lib
62// The lib was compiled under VS2005 - in VS2003 we need to remap assert
63#ifdef LL_DEBUG
64 #if (_MSC_VER < 1400)
65 extern "C" {
66 void _wassert(const wchar_t * _Message, const wchar_t *_File, unsigned _Line)
67 {
68 llerrs << _Message << llendl;
69 }
70 }
71 #endif
72#endif
73
60LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) 74LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop)
61{ 75{
62 // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. 76 // *NOTE:Mani - this code is stolen from LLApp, where its never actually used.
@@ -78,7 +92,7 @@ LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *excepti
78 // Generate a minidump if we can. 92 // Generate a minidump if we can.
79 // Before we wake the error thread... 93 // Before we wake the error thread...
80 // Which will start the crash reporting. 94 // Which will start the crash reporting.
81 LLWinDebug::handleException(exception_infop); 95 LLWinDebug::generateCrashStacks(exception_infop);
82 96
83 // Flag status to error, so thread_error starts its work 97 // Flag status to error, so thread_error starts its work
84 LLApp::setError(); 98 LLApp::setError();
@@ -118,27 +132,11 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
118 132
119 LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); 133 LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine);
120 134
121 // *FIX:Mani This method is poorly named, since the exception 135 LLWinDebug::initExceptionHandler(viewer_windows_exception_handler);
122 // is now handled by LLApp.
123 bool ok = LLWinDebug::setupExceptionHandler();
124 136
125 // Actually here's the exception setup.
126 LPTOP_LEVEL_EXCEPTION_FILTER prev_filter;
127 prev_filter = SetUnhandledExceptionFilter(viewer_windows_exception_handler);
128 if (!prev_filter)
129 {
130 llwarns << "Our exception handler (" << (void *)LLWinDebug::handleException << ") replaced with NULL!" << llendl;
131 ok = FALSE;
132 }
133 if (prev_filter != LLWinDebug::handleException)
134 {
135 llwarns << "Our exception handler (" << (void *)LLWinDebug::handleException << ") replaced with " << prev_filter << "!" << llendl;
136 ok = FALSE;
137 }
138
139 viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); 137 viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash);
140 138
141 ok = viewer_app_ptr->init(); 139 bool ok = viewer_app_ptr->init();
142 if(!ok) 140 if(!ok)
143 { 141 {
144 llwarns << "Application init failed." << llendl; 142 llwarns << "Application init failed." << llendl;
@@ -326,14 +324,14 @@ bool LLAppViewerWin32::initHardwareTest()
326 324
327 LLSplashScreen::update("Detecting hardware..."); 325 LLSplashScreen::update("Detecting hardware...");
328 326
329 llinfos << "Attempting to poll DirectX for hardware info" << llendl; 327 LL_DEBUGS("AppInit") << "Attempting to poll DirectX for hardware info" << LL_ENDL;
330 gDXHardware.setWriteDebugFunc(write_debug_dx); 328 gDXHardware.setWriteDebugFunc(write_debug_dx);
331 BOOL probe_ok = gDXHardware.getInfo(vram_only); 329 BOOL probe_ok = gDXHardware.getInfo(vram_only);
332 330
333 if (!probe_ok 331 if (!probe_ok
334 && gSavedSettings.getWarning("AboutDirectX9")) 332 && gSavedSettings.getWarning("AboutDirectX9"))
335 { 333 {
336 llinfos << "DirectX probe failed, alerting user." << llendl; 334 LL_WARNS("AppInit") << "DirectX probe failed, alerting user." << LL_ENDL;
337 335
338 // Warn them that runnin without DirectX 9 will 336 // Warn them that runnin without DirectX 9 will
339 // not allow us to tell them about driver issues 337 // not allow us to tell them about driver issues
@@ -354,13 +352,13 @@ bool LLAppViewerWin32::initHardwareTest()
354 OSMB_YESNO); 352 OSMB_YESNO);
355 if (OSBTN_NO== button) 353 if (OSBTN_NO== button)
356 { 354 {
357 llinfos << "User quitting after failed DirectX 9 detection" << llendl; 355 LL_INFOS("AppInit") << "User quitting after failed DirectX 9 detection" << LL_ENDL;
358 LLWeb::loadURLExternal(DIRECTX_9_URL); 356 LLWeb::loadURLExternal(DIRECTX_9_URL);
359 return false; 357 return false;
360 } 358 }
361 gSavedSettings.setWarning("AboutDirectX9", FALSE); 359 gSavedSettings.setWarning("AboutDirectX9", FALSE);
362 } 360 }
363 llinfos << "Done polling DirectX for hardware info" << llendl; 361 LL_DEBUGS("AppInit") << "Done polling DirectX for hardware info" << LL_ENDL;
364 362
365 // Only probe once after installation 363 // Only probe once after installation
366 gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE); 364 gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE);
@@ -372,20 +370,41 @@ bool LLAppViewerWin32::initHardwareTest()
372 LLSplashScreen::update(splash_msg.str().c_str()); 370 LLSplashScreen::update(splash_msg.str().c_str());
373 } 371 }
374 372
375 if (!LLWinDebug::setupExceptionHandler()) 373 if (!LLWinDebug::checkExceptionHandler())
376 { 374 {
377 llwarns << " Someone took over my exception handler (post hardware probe)!" << llendl; 375 LL_WARNS("AppInit") << " Someone took over my exception handler (post hardware probe)!" << LL_ENDL;
378 } 376 }
379 377
380 gGLManager.mVRAM = gDXHardware.getVRAM(); 378 gGLManager.mVRAM = gDXHardware.getVRAM();
381 llinfos << "Detected VRAM: " << gGLManager.mVRAM << llendl; 379 LL_INFOS("AppInit") << "Detected VRAM: " << gGLManager.mVRAM << LL_ENDL;
382 380
383 return true; 381 return true;
384} 382}
385 383
386bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) 384bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp)
387{ 385{
388 return clp.parseCommandLineString(mCmdLine); 386 if (!clp.parseCommandLineString(mCmdLine))
387 {
388 return false;
389 }
390
391 // Find the system language.
392 FL_Locale *locale = NULL;
393 FL_Success success = FL_FindLocale(&locale, FL_MESSAGES);
394 if (success != 0)
395 {
396 if (success >= 2 && locale->lang) // confident!
397 {
398 LLControlVariable* c = gSavedSettings.getControl("SystemLanguage");
399 if(c)
400 {
401 c->setValue(std::string(locale->lang), false);
402 }
403 }
404 FL_FreeLocale(&locale);
405 }
406
407 return true;
389} 408}
390 409
391void LLAppViewerWin32::handleSyncCrashTrace() 410void LLAppViewerWin32::handleSyncCrashTrace()
@@ -401,7 +420,7 @@ void LLAppViewerWin32::handleCrashReporting()
401 exe_path += "win_crash_logger.exe"; 420 exe_path += "win_crash_logger.exe";
402 421
403 std::string arg_string = "-user "; 422 std::string arg_string = "-user ";
404 arg_string += gGridName; 423 arg_string += LLViewerLogin::getInstance()->getGridLabel();
405 424
406 switch(getCrashBehavior()) 425 switch(getCrashBehavior())
407 { 426 {