diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llappviewerwin32.cpp | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llappviewerwin32.cpp | 92 |
1 files changed, 27 insertions, 65 deletions
diff --git a/linden/indra/newview/llappviewerwin32.cpp b/linden/indra/newview/llappviewerwin32.cpp index b665cb4..a2d89a3 100644 --- a/linden/indra/newview/llappviewerwin32.cpp +++ b/linden/indra/newview/llappviewerwin32.cpp | |||
@@ -55,41 +55,13 @@ | |||
55 | #include "llviewernetwork.h" | 55 | #include "llviewernetwork.h" |
56 | #include "llmd5.h" | 56 | #include "llmd5.h" |
57 | 57 | ||
58 | void fill_args(int& argc, char** argv, const S32 max_args, LPSTR cmd_line) | 58 | #include "llcommandlineparser.h" |
59 | { | ||
60 | char *token = NULL; | ||
61 | if( cmd_line[0] == '\"' ) | ||
62 | { | ||
63 | // Exe name is enclosed in quotes | ||
64 | token = strtok( cmd_line, "\"" ); | ||
65 | argv[argc++] = token; | ||
66 | token = strtok( NULL, " \t," ); | ||
67 | } | ||
68 | else | ||
69 | { | ||
70 | // Exe name is not enclosed in quotes | ||
71 | token = strtok( cmd_line, " \t," ); | ||
72 | } | ||
73 | 59 | ||
74 | while( (token != NULL) && (argc < max_args) ) | ||
75 | { | ||
76 | argv[argc++] = token; | ||
77 | /* Get next token: */ | ||
78 | if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore*/ | ||
79 | { | ||
80 | token = strtok( NULL, "\""); | ||
81 | } | ||
82 | else | ||
83 | { | ||
84 | token = strtok( NULL, " \t," ); | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | |||
89 | // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. | ||
90 | LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) | 60 | LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) |
91 | { | 61 | { |
92 | // Translate the signals/exceptions into cross-platform stuff | 62 | // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. |
63 | |||
64 | // Translate the signals/exceptions into cross-platform stuff | ||
93 | // Windows implementation | 65 | // Windows implementation |
94 | llinfos << "Entering Windows Exception Handler..." << llendl; | 66 | llinfos << "Entering Windows Exception Handler..." << llendl; |
95 | 67 | ||
@@ -144,21 +116,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, | |||
144 | // *FIX: global | 116 | // *FIX: global |
145 | gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); | 117 | gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); |
146 | 118 | ||
147 | // In Win32, we need to generate argc and argv ourselves... | 119 | LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); |
148 | // Note: GetCommandLine() returns a potentially return a LPTSTR | ||
149 | // which can resolve to a LPWSTR (unicode string). | ||
150 | // (That's why it's different from lpCmdLine which is a LPSTR.) | ||
151 | // We don't currently do unicode, so call the non-unicode version | ||
152 | // directly. | ||
153 | LPSTR cmd_line_including_exe_name = GetCommandLineA(); | ||
154 | |||
155 | const S32 MAX_ARGS = 100; | ||
156 | int argc = 0; | ||
157 | char* argv[MAX_ARGS]; /* Flawfinder: ignore */ | ||
158 | |||
159 | fill_args(argc, argv, MAX_ARGS, cmd_line_including_exe_name); | ||
160 | |||
161 | LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(); | ||
162 | 120 | ||
163 | // *FIX:Mani This method is poorly named, since the exception | 121 | // *FIX:Mani This method is poorly named, since the exception |
164 | // is now handled by LLApp. | 122 | // is now handled by LLApp. |
@@ -180,13 +138,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, | |||
180 | 138 | ||
181 | viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); | 139 | viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); |
182 | 140 | ||
183 | ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); | ||
184 | if(!ok) | ||
185 | { | ||
186 | llwarns << "Unable to parse command line." << llendl; | ||
187 | return -1; | ||
188 | } | ||
189 | |||
190 | ok = viewer_app_ptr->init(); | 141 | ok = viewer_app_ptr->init(); |
191 | if(!ok) | 142 | if(!ok) |
192 | { | 143 | { |
@@ -308,7 +259,8 @@ void create_console() | |||
308 | setvbuf( stderr, NULL, _IONBF, 0 ); | 259 | setvbuf( stderr, NULL, _IONBF, 0 ); |
309 | } | 260 | } |
310 | 261 | ||
311 | LLAppViewerWin32::LLAppViewerWin32() | 262 | LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) : |
263 | mCmdLine(cmd_line) | ||
312 | { | 264 | { |
313 | } | 265 | } |
314 | 266 | ||
@@ -339,15 +291,11 @@ bool LLAppViewerWin32::cleanup() | |||
339 | return result; | 291 | return result; |
340 | } | 292 | } |
341 | 293 | ||
342 | bool LLAppViewerWin32::initWindow() | 294 | void LLAppViewerWin32::initConsole() |
343 | { | 295 | { |
344 | // pop up debug console if necessary | 296 | // pop up debug console |
345 | if (gUseConsole && gSavedSettings.getBOOL("ShowConsoleWindow")) | 297 | create_console(); |
346 | { | 298 | return LLAppViewer::initConsole(); |
347 | create_console(); | ||
348 | } | ||
349 | |||
350 | return LLAppViewer::initWindow(); | ||
351 | } | 299 | } |
352 | 300 | ||
353 | void write_debug_dx(const char* str) | 301 | void write_debug_dx(const char* str) |
@@ -368,10 +316,14 @@ bool LLAppViewerWin32::initHardwareTest() | |||
368 | // Do driver verification and initialization based on DirectX | 316 | // Do driver verification and initialization based on DirectX |
369 | // hardware polling and driver versions | 317 | // hardware polling and driver versions |
370 | // | 318 | // |
371 | if (gProbeHardware) | 319 | if (FALSE == gSavedSettings.getBOOL("NoHardwareProbe")) |
372 | { | 320 | { |
373 | BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup"); | 321 | BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup"); |
374 | 322 | ||
323 | // per DEV-11631 - disable hardware probing for everything | ||
324 | // but vram. | ||
325 | vram_only = TRUE; | ||
326 | |||
375 | LLSplashScreen::update("Detecting hardware..."); | 327 | LLSplashScreen::update("Detecting hardware..."); |
376 | 328 | ||
377 | llinfos << "Attempting to poll DirectX for hardware info" << llendl; | 329 | llinfos << "Attempting to poll DirectX for hardware info" << llendl; |
@@ -431,6 +383,16 @@ bool LLAppViewerWin32::initHardwareTest() | |||
431 | return true; | 383 | return true; |
432 | } | 384 | } |
433 | 385 | ||
386 | bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) | ||
387 | { | ||
388 | return clp.parseCommandLineString(mCmdLine); | ||
389 | } | ||
390 | |||
391 | void LLAppViewerWin32::handleSyncCrashTrace() | ||
392 | { | ||
393 | // do nothing | ||
394 | } | ||
395 | |||
434 | void LLAppViewerWin32::handleCrashReporting() | 396 | void LLAppViewerWin32::handleCrashReporting() |
435 | { | 397 | { |
436 | // Windows only behaivor. Spawn win crash reporter. | 398 | // Windows only behaivor. Spawn win crash reporter. |
@@ -486,4 +448,4 @@ std::string LLAppViewerWin32::generateSerialNumber() | |||
486 | llwarns << "GetVolumeInformation failed" << llendl; | 448 | llwarns << "GetVolumeInformation failed" << llendl; |
487 | } | 449 | } |
488 | return serial_md5; | 450 | return serial_md5; |
489 | } \ No newline at end of file | 451 | } |