diff options
Diffstat (limited to 'linden/indra/newview/viewer.cpp')
-rw-r--r-- | linden/indra/newview/viewer.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/linden/indra/newview/viewer.cpp b/linden/indra/newview/viewer.cpp index c009039..19b5260 100644 --- a/linden/indra/newview/viewer.cpp +++ b/linden/indra/newview/viewer.cpp | |||
@@ -352,7 +352,7 @@ BOOL gDoneLogout = FALSE; | |||
352 | 352 | ||
353 | BOOL gInitializationComplete = FALSE; // used in windows handlers to determine if OK to call idle() | 353 | BOOL gInitializationComplete = FALSE; // used in windows handlers to determine if OK to call idle() |
354 | BOOL gAutoLogin = FALSE; | 354 | BOOL gAutoLogin = FALSE; |
355 | char gOldSettingsFileName[LL_MAX_PATH]; | 355 | LLString gOldSettingsFileName; |
356 | BOOL gPrintMessagesThisFrame = FALSE; | 356 | BOOL gPrintMessagesThisFrame = FALSE; |
357 | const char* DEFAULT_SETTINGS_FILE = "settings.xml"; | 357 | const char* DEFAULT_SETTINGS_FILE = "settings.xml"; |
358 | const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; | 358 | const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; |
@@ -925,8 +925,8 @@ int main( int argc, char **argv ) | |||
925 | // | 925 | // |
926 | 926 | ||
927 | // Set up some defaults... | 927 | // Set up some defaults... |
928 | strcpy(gSettingsFileName, gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE).c_str()); | 928 | gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE); |
929 | strcpy(gOldSettingsFileName, gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, LEGACY_DEFAULT_SETTINGS_FILE).c_str()); | 929 | gOldSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, LEGACY_DEFAULT_SETTINGS_FILE); |
930 | gUserServer.setPort(DEFAULT_USER_SERVER_PORT); | 930 | gUserServer.setPort(DEFAULT_USER_SERVER_PORT); |
931 | 931 | ||
932 | ///////////////////////////////////////// | 932 | ///////////////////////////////////////// |
@@ -4215,7 +4215,7 @@ BOOL add_object( LLPCode pcode, S32 x, S32 y, U8 use_physics ) | |||
4215 | { | 4215 | { |
4216 | case LL_PCODE_LEGACY_GRASS: | 4216 | case LL_PCODE_LEGACY_GRASS: |
4217 | // Randomize size of grass patch | 4217 | // Randomize size of grass patch |
4218 | scale.setVec(10.f + frand(20.f), 10.f + frand(20.f), 1.f + frand(2.f)); | 4218 | scale.setVec(10.f + ll_frand(20.f), 10.f + ll_frand(20.f), 1.f + ll_frand(2.f)); |
4219 | state = rand() % LLVOGrass::sMaxGrassSpecies; | 4219 | state = rand() % LLVOGrass::sMaxGrassSpecies; |
4220 | break; | 4220 | break; |
4221 | 4221 | ||
@@ -5337,8 +5337,14 @@ void send_stats() | |||
5337 | gMessageSystem->addU32Fast(_PREHASH_SysRAM, gSysMemory.getPhysicalMemory()); | 5337 | gMessageSystem->addU32Fast(_PREHASH_SysRAM, gSysMemory.getPhysicalMemory()); |
5338 | gMessageSystem->addStringFast(_PREHASH_SysOS, gSysOS.getOSString()); | 5338 | gMessageSystem->addStringFast(_PREHASH_SysOS, gSysOS.getOSString()); |
5339 | gMessageSystem->addStringFast(_PREHASH_SysCPU, gSysCPU.getCPUStringTerse()); | 5339 | gMessageSystem->addStringFast(_PREHASH_SysCPU, gSysCPU.getCPUStringTerse()); |
5340 | |||
5340 | 5341 | ||
5341 | gMessageSystem->addStringFast(_PREHASH_SysGPU, gGLManager.getRawGLString()); | 5342 | std::string gpu_desc = llformat("%-6s Class %d ", |
5343 | gGLManager.mGLVendorShort.substr(0,6).c_str(), | ||
5344 | gFeatureManagerp->getGPUClass()) | ||
5345 | + gFeatureManagerp->getGPUString(); | ||
5346 | |||
5347 | gMessageSystem->addStringFast(_PREHASH_SysGPU, gpu_desc); | ||
5342 | 5348 | ||
5343 | gMessageSystem->nextBlockFast(_PREHASH_DownloadTotals); | 5349 | gMessageSystem->nextBlockFast(_PREHASH_DownloadTotals); |
5344 | gMessageSystem->addU32Fast(_PREHASH_World, gTotalWorldBytes); | 5350 | gMessageSystem->addU32Fast(_PREHASH_World, gTotalWorldBytes); |
@@ -5365,6 +5371,14 @@ void send_stats() | |||
5365 | gMessageSystem->addU32Fast(_PREHASH_OffCircuit, (U32)gMessageSystem->mOffCircuitPackets); | 5371 | gMessageSystem->addU32Fast(_PREHASH_OffCircuit, (U32)gMessageSystem->mOffCircuitPackets); |
5366 | gMessageSystem->addU32Fast(_PREHASH_Invalid, (U32)gMessageSystem->mInvalidOnCircuitPackets); | 5372 | gMessageSystem->addU32Fast(_PREHASH_Invalid, (U32)gMessageSystem->mInvalidOnCircuitPackets); |
5367 | 5373 | ||
5374 | // 1.00.00.000000 | ||
5375 | F64 version = | ||
5376 | LL_VERSION_MAJOR * 10000000000.0 + | ||
5377 | LL_VERSION_MINOR * 100000000.0 + | ||
5378 | LL_VERSION_PATCH * 1000000.0 + | ||
5379 | LL_VERSION_BUILD; | ||
5380 | gViewerStats->setStat(LLViewerStats::ST_VERSION, version); | ||
5381 | |||
5368 | gViewerStats->addToMessage(); | 5382 | gViewerStats->addToMessage(); |
5369 | 5383 | ||
5370 | gAgent.sendReliableMessage(); | 5384 | gAgent.sendReliableMessage(); |
@@ -5596,7 +5610,7 @@ int parse_args(int argc, char **argv) | |||
5596 | std::string folder(argv[j]); | 5610 | std::string folder(argv[j]); |
5597 | gDirUtilp->setSkinFolder(folder); | 5611 | gDirUtilp->setSkinFolder(folder); |
5598 | } | 5612 | } |
5599 | else if (!strcmp(argv[j], "--autologin")) | 5613 | else if (!strcmp(argv[j], "-autologin") || !strcmp(argv[j], "--autologin")) // keep --autologin for compatibility |
5600 | { | 5614 | { |
5601 | gAutoLogin = TRUE; | 5615 | gAutoLogin = TRUE; |
5602 | } | 5616 | } |
@@ -5731,8 +5745,9 @@ int parse_args(int argc, char **argv) | |||
5731 | } | 5745 | } |
5732 | else if (!strcmp(argv[j], "-logfile") && (++j < argc)) | 5746 | else if (!strcmp(argv[j], "-logfile") && (++j < argc)) |
5733 | { | 5747 | { |
5748 | // *NOTE: This buffer size is hard coded into scanf() below. | ||
5734 | char logfile[256]; | 5749 | char logfile[256]; |
5735 | sscanf(argv[j], "%s", logfile); | 5750 | sscanf(argv[j], "%255s", logfile); |
5736 | llinfos << "Setting log file to " << logfile << llendl; | 5751 | llinfos << "Setting log file to " << logfile << llendl; |
5737 | LLFile::remove(logfile); | 5752 | LLFile::remove(logfile); |
5738 | if (!gErrorStream.setFile(logfile)) | 5753 | if (!gErrorStream.setFile(logfile)) |
@@ -5742,7 +5757,7 @@ int parse_args(int argc, char **argv) | |||
5742 | } | 5757 | } |
5743 | else if (!strcmp(argv[j], "-settings") && (++j < argc)) | 5758 | else if (!strcmp(argv[j], "-settings") && (++j < argc)) |
5744 | { | 5759 | { |
5745 | strcpy(gSettingsFileName, argv[j]); | 5760 | gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, argv[j]); |
5746 | } | 5761 | } |
5747 | else if (!strcmp(argv[j], "-setdefault") && (j + 2 < argc)) | 5762 | else if (!strcmp(argv[j], "-setdefault") && (j + 2 < argc)) |
5748 | { | 5763 | { |
@@ -6475,7 +6490,7 @@ void cleanup_app() | |||
6475 | // Must do this after all panels have been deleted because panels that have persistent rects | 6490 | // Must do this after all panels have been deleted because panels that have persistent rects |
6476 | // save their rects on delete. | 6491 | // save their rects on delete. |
6477 | gSavedSettings.saveToFile(gSettingsFileName, TRUE); | 6492 | gSavedSettings.saveToFile(gSettingsFileName, TRUE); |
6478 | if (gPerAccountSettingsFileName[0]) | 6493 | if (!gPerAccountSettingsFileName.empty()) |
6479 | { | 6494 | { |
6480 | gSavedPerAccountSettings.saveToFile(gPerAccountSettingsFileName, TRUE); | 6495 | gSavedPerAccountSettings.saveToFile(gPerAccountSettingsFileName, TRUE); |
6481 | } | 6496 | } |