diff options
Diffstat (limited to 'linden/indra/newview/viewer.cpp')
-rw-r--r-- | linden/indra/newview/viewer.cpp | 192 |
1 files changed, 10 insertions, 182 deletions
diff --git a/linden/indra/newview/viewer.cpp b/linden/indra/newview/viewer.cpp index 48108bd..9bfa373 100644 --- a/linden/indra/newview/viewer.cpp +++ b/linden/indra/newview/viewer.cpp | |||
@@ -205,7 +205,6 @@ | |||
205 | #include "llviewerbuild.h" | 205 | #include "llviewerbuild.h" |
206 | #include "llviewercamera.h" | 206 | #include "llviewercamera.h" |
207 | #include "llviewercontrol.h" | 207 | #include "llviewercontrol.h" |
208 | #include "llviewerjointmesh.h" | ||
209 | #include "llviewerimagelist.h" | 208 | #include "llviewerimagelist.h" |
210 | #include "llviewerkeyboard.h" | 209 | #include "llviewerkeyboard.h" |
211 | #include "llviewermenu.h" | 210 | #include "llviewermenu.h" |
@@ -322,6 +321,9 @@ LLString gDisabledMessage; | |||
322 | BOOL gHideLinks = FALSE; | 321 | BOOL gHideLinks = FALSE; |
323 | 322 | ||
324 | // This is whether or not we are connect to a production grid. | 323 | // This is whether or not we are connect to a production grid. |
324 | // HACK/TEMP - the code that used to set this based on the userserver selection | ||
325 | // is gone, so there is no code that currently sets this to TRUE. Since we don't | ||
326 | // want to ship as "FALSE", hardcoding it to TRUE for now. Please fix. | ||
325 | BOOL gInProductionGrid = FALSE; | 327 | BOOL gInProductionGrid = FALSE; |
326 | 328 | ||
327 | //#define APPLE_PREVIEW // Define this if you're doing a preview build on the Mac | 329 | //#define APPLE_PREVIEW // Define this if you're doing a preview build on the Mac |
@@ -929,6 +931,11 @@ int main( int argc, char **argv ) | |||
929 | } | 931 | } |
930 | } | 932 | } |
931 | 933 | ||
934 | if (!strcmp(gUserServerName, gUserServerDomainName[USERSERVER_AGNI].mName)) | ||
935 | { | ||
936 | gInProductionGrid = TRUE; | ||
937 | } | ||
938 | |||
932 | // | 939 | // |
933 | // Start of the application | 940 | // Start of the application |
934 | // | 941 | // |
@@ -966,7 +973,6 @@ int main( int argc, char **argv ) | |||
966 | // Set up some defaults... | 973 | // Set up some defaults... |
967 | gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE); | 974 | gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE); |
968 | gOldSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, LEGACY_DEFAULT_SETTINGS_FILE); | 975 | gOldSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, LEGACY_DEFAULT_SETTINGS_FILE); |
969 | gUserServer.setPort(DEFAULT_USER_SERVER_PORT); | ||
970 | 976 | ||
971 | ///////////////////////////////////////// | 977 | ///////////////////////////////////////// |
972 | // | 978 | // |
@@ -1078,10 +1084,8 @@ int main( int argc, char **argv ) | |||
1078 | // Initialize apple menubar and various callbacks | 1084 | // Initialize apple menubar and various callbacks |
1079 | init_apple_menu(gSecondLife.c_str()); | 1085 | init_apple_menu(gSecondLife.c_str()); |
1080 | 1086 | ||
1081 | #if __ppc__ | ||
1082 | // If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further. | 1087 | // If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further. |
1083 | // Only test PowerPC - all Intel Macs have SSE. | 1088 | if(!gSysCPU.hasSSE()) |
1084 | if(!gSysCPU.hasAltivec()) | ||
1085 | { | 1089 | { |
1086 | std::ostringstream msg; | 1090 | std::ostringstream msg; |
1087 | msg << gSecondLife << " requires a processor with AltiVec (G4 or later)."; | 1091 | msg << gSecondLife << " requires a processor with AltiVec (G4 or later)."; |
@@ -1092,7 +1096,6 @@ int main( int argc, char **argv ) | |||
1092 | remove_marker_file(); | 1096 | remove_marker_file(); |
1093 | return 1; | 1097 | return 1; |
1094 | } | 1098 | } |
1095 | #endif | ||
1096 | 1099 | ||
1097 | #endif // LL_DARWIN | 1100 | #endif // LL_DARWIN |
1098 | 1101 | ||
@@ -3101,36 +3104,7 @@ void user_logout() | |||
3101 | LLMessageSystem* msg = gMessageSystem; | 3104 | LLMessageSystem* msg = gMessageSystem; |
3102 | if (msg) | 3105 | if (msg) |
3103 | { | 3106 | { |
3104 | /* if (gSavedSettings.getBOOL("LoggedIn") ) | ||
3105 | { | ||
3106 | // bleah - we can't use llinfos inside a signal handler | ||
3107 | //llinfos << "Sending logout message" << llendl; | ||
3108 | |||
3109 | msg->newMessage("LogoutDemand"); | ||
3110 | msg->nextBlockFast(_PREHASH_LogoutBlock); | ||
3111 | msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID ); | ||
3112 | msg->sendMessage(gUserServer); | ||
3113 | */ | ||
3114 | gSavedSettings.setBOOL("LoggedIn", FALSE); | 3107 | gSavedSettings.setBOOL("LoggedIn", FALSE); |
3115 | // } | ||
3116 | /* This message has been removed and functionality moved into logoutrequest | ||
3117 | |||
3118 | if (gAgent.getRegion()) | ||
3119 | { | ||
3120 | msg->newMessageFast(_PREHASH_AgentQuit); | ||
3121 | msg->nextBlockFast(_PREHASH_AgentData); | ||
3122 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
3123 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
3124 | gAgent.sendMessage(); | ||
3125 | } | ||
3126 | */ | ||
3127 | |||
3128 | // Go through all of the regions we know about... | ||
3129 | /* if (gWorldp) | ||
3130 | { | ||
3131 | gWorldp->disconnectRegions(); | ||
3132 | }*/ | ||
3133 | |||
3134 | } | 3108 | } |
3135 | gDoneLogout = TRUE; | 3109 | gDoneLogout = TRUE; |
3136 | } | 3110 | } |
@@ -3404,15 +3378,7 @@ void update_statistics(U32 frame_count) | |||
3404 | 3378 | ||
3405 | gViewerStats->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); | 3379 | gViewerStats->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); |
3406 | 3380 | ||
3407 | cdp = gMessageSystem->mCircuitInfo.findCircuit(gUserServer); | 3381 | gViewerStats->mUserserverPingStat.addValue(0); // userserver doesn't exist, therefore ping time is always awesome |
3408 | if (cdp) | ||
3409 | { | ||
3410 | gViewerStats->mUserserverPingStat.addValue(cdp->getPingDelay()); | ||
3411 | } | ||
3412 | else | ||
3413 | { | ||
3414 | gViewerStats->mUserserverPingStat.addValue(10000); | ||
3415 | } | ||
3416 | 3382 | ||
3417 | // log when the LibXUL (aka Mozilla) widget is used and opened so we can monitor framerate changes | 3383 | // log when the LibXUL (aka Mozilla) widget is used and opened so we can monitor framerate changes |
3418 | #if LL_LIBXUL_ENABLED | 3384 | #if LL_LIBXUL_ENABLED |
@@ -4998,89 +4964,6 @@ class LLRenderLightingDetailListener: public LLSimpleListener | |||
4998 | }; | 4964 | }; |
4999 | static LLRenderLightingDetailListener render_lighting_detail_listener; | 4965 | static LLRenderLightingDetailListener render_lighting_detail_listener; |
5000 | 4966 | ||
5001 | |||
5002 | //------------------------------------------------------------------- | ||
5003 | //------------------------------------------------------------------- | ||
5004 | // Vector Performance Options | ||
5005 | //------------------------------------------------------------------- | ||
5006 | //------------------------------------------------------------------- | ||
5007 | |||
5008 | // Initially, we test the performance of the vectorization code, then | ||
5009 | // turn it off if it ends up being slower. JC | ||
5010 | BOOL gVectorizePerfTest = TRUE; | ||
5011 | BOOL gVectorizeEnable = FALSE; | ||
5012 | U32 gVectorizeProcessor = 0; | ||
5013 | BOOL gVectorizeSkin = FALSE; | ||
5014 | |||
5015 | void update_vector_performances(void) | ||
5016 | { | ||
5017 | char *vp; | ||
5018 | |||
5019 | switch(gVectorizeProcessor) | ||
5020 | { | ||
5021 | case 2: vp = "SSE2"; break; // *TODO: replace the magic #s | ||
5022 | case 1: vp = "SSE"; break; | ||
5023 | default: vp = "COMPILER DEFAULT"; break; | ||
5024 | } | ||
5025 | llinfos << "Vectorization : " << ( gVectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ; | ||
5026 | llinfos << "Vector Processor : " << vp << llendl ; | ||
5027 | llinfos << "Vectorized Skinning : " << ( gVectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ; | ||
5028 | |||
5029 | if(gVectorizeEnable && gVectorizeSkin) | ||
5030 | { | ||
5031 | switch(gVectorizeProcessor) | ||
5032 | { | ||
5033 | case 2: | ||
5034 | LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE2; | ||
5035 | break; | ||
5036 | case 1: | ||
5037 | LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE; | ||
5038 | break; | ||
5039 | default: | ||
5040 | LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryVectorized; | ||
5041 | break; | ||
5042 | } | ||
5043 | } | ||
5044 | else | ||
5045 | { | ||
5046 | LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryOriginal; | ||
5047 | } | ||
5048 | } | ||
5049 | |||
5050 | |||
5051 | class LLVectorizationEnableListener: public LLSimpleListener | ||
5052 | { | ||
5053 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5054 | { | ||
5055 | gVectorizeEnable = event->getValue().asBoolean(); | ||
5056 | update_vector_performances(); | ||
5057 | return true; | ||
5058 | } | ||
5059 | }; | ||
5060 | static LLVectorizationEnableListener vectorization_enable_listener; | ||
5061 | |||
5062 | class LLVectorizeSkinListener: public LLSimpleListener | ||
5063 | { | ||
5064 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5065 | { | ||
5066 | gVectorizeSkin = event->getValue().asBoolean(); | ||
5067 | update_vector_performances(); | ||
5068 | return true; | ||
5069 | } | ||
5070 | }; | ||
5071 | static LLVectorizeSkinListener vectorize_skin_listener; | ||
5072 | |||
5073 | class LLVectorProcessorListener: public LLSimpleListener | ||
5074 | { | ||
5075 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5076 | { | ||
5077 | gVectorizeProcessor = event->getValue().asInteger(); | ||
5078 | update_vector_performances(); | ||
5079 | return true; | ||
5080 | } | ||
5081 | }; | ||
5082 | static LLVectorProcessorListener vector_processor_listener; | ||
5083 | |||
5084 | // Use these strictly for things that are constructed at startup, | 4967 | // Use these strictly for things that are constructed at startup, |
5085 | // or for things that are performance critical. JC | 4968 | // or for things that are performance critical. JC |
5086 | void saved_settings_to_globals() | 4969 | void saved_settings_to_globals() |
@@ -5132,38 +5015,6 @@ void saved_settings_to_globals() | |||
5132 | gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard"); | 5015 | gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard"); |
5133 | LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); | 5016 | LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); |
5134 | 5017 | ||
5135 | if (gSysCPU.hasAltivec()) | ||
5136 | { | ||
5137 | gSavedSettings.setBOOL("VectorizeEnable", TRUE ); | ||
5138 | gSavedSettings.setU32("VectorizeProcessor", 0 ); | ||
5139 | } | ||
5140 | else | ||
5141 | if (gSysCPU.hasSSE2()) | ||
5142 | { | ||
5143 | gSavedSettings.setBOOL("VectorizeEnable", TRUE ); | ||
5144 | gSavedSettings.setU32("VectorizeProcessor", 2 ); | ||
5145 | } | ||
5146 | else | ||
5147 | if (gSysCPU.hasSSE()) | ||
5148 | { | ||
5149 | gSavedSettings.setBOOL("VectorizeEnable", TRUE ); | ||
5150 | gSavedSettings.setU32("VectorizeProcessor", 1 ); | ||
5151 | } | ||
5152 | else | ||
5153 | { | ||
5154 | // Don't bother testing or running if CPU doesn't support it. JC | ||
5155 | gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); | ||
5156 | gSavedSettings.setBOOL("VectorizeEnable", FALSE ); | ||
5157 | gSavedSettings.setU32("VectorizeProcessor", 0 ); | ||
5158 | gSavedSettings.setBOOL("VectorizeSkin", FALSE); | ||
5159 | } | ||
5160 | |||
5161 | gVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest"); | ||
5162 | gVectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable"); | ||
5163 | gVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor"); | ||
5164 | gVectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin"); | ||
5165 | update_vector_performances(); | ||
5166 | |||
5167 | // Into a global in case we corrupt the list on crash. | 5018 | // Into a global in case we corrupt the list on crash. |
5168 | gCrashBehavior = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); | 5019 | gCrashBehavior = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); |
5169 | 5020 | ||
@@ -5210,9 +5061,6 @@ void saved_settings_to_globals() | |||
5210 | gSavedSettings.getControl("FlycamAxis4")->addListener(&joystick_listener); | 5061 | gSavedSettings.getControl("FlycamAxis4")->addListener(&joystick_listener); |
5211 | gSavedSettings.getControl("FlycamAxis5")->addListener(&joystick_listener); | 5062 | gSavedSettings.getControl("FlycamAxis5")->addListener(&joystick_listener); |
5212 | gSavedSettings.getControl("FlycamAxis6")->addListener(&joystick_listener); | 5063 | gSavedSettings.getControl("FlycamAxis6")->addListener(&joystick_listener); |
5213 | gSavedSettings.getControl("VectorizeEnable")->addListener(&vectorization_enable_listener); | ||
5214 | gSavedSettings.getControl("VectorizeProcessor")->addListener(&vector_processor_listener); | ||
5215 | gSavedSettings.getControl("VectorizeSkin")->addListener(&vectorize_skin_listener); | ||
5216 | 5064 | ||
5217 | // gAgent.init() also loads from saved settings. | 5065 | // gAgent.init() also loads from saved settings. |
5218 | } | 5066 | } |
@@ -5828,28 +5676,10 @@ int parse_args(int argc, char **argv) | |||
5828 | gUserServerChoice = USERSERVER_OTHER; | 5676 | gUserServerChoice = USERSERVER_OTHER; |
5829 | ip_string.assign( argv[j] ); | 5677 | ip_string.assign( argv[j] ); |
5830 | LLString::trim(ip_string); | 5678 | LLString::trim(ip_string); |
5831 | gUserServer.setHostByName( ip_string.c_str() ); | ||
5832 | snprintf(gUserServerName, MAX_STRING, "%s", ip_string.c_str()); /* Flawfinder: ignore */ | 5679 | snprintf(gUserServerName, MAX_STRING, "%s", ip_string.c_str()); /* Flawfinder: ignore */ |
5833 | } | 5680 | } |
5834 | gConnectToSomething = TRUE; | 5681 | gConnectToSomething = TRUE; |
5835 | } | 5682 | } |
5836 | else if (!strcmp(argv[j], "-space") && (++j < argc)) | ||
5837 | { | ||
5838 | if (!strcmp(argv[j], "-")) | ||
5839 | { | ||
5840 | gUserServerChoice = USERSERVER_LOCAL; | ||
5841 | } | ||
5842 | else | ||
5843 | { | ||
5844 | gUserServerChoice = USERSERVER_OTHER; | ||
5845 | ip_string.assign( argv[j] ); | ||
5846 | LLString::trim(ip_string); | ||
5847 | gUserServer.setAddress( ip_string.c_str() ); | ||
5848 | } | ||
5849 | gConnectToSomething = TRUE; | ||
5850 | |||
5851 | llinfos << "Argument -space is deprecated, use -user instead" << llendl; | ||
5852 | } | ||
5853 | else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) | 5683 | else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) |
5854 | { | 5684 | { |
5855 | gLoginURIs.push_back(utf8str_trim(argv[j])); | 5685 | gLoginURIs.push_back(utf8str_trim(argv[j])); |
@@ -5921,7 +5751,6 @@ int parse_args(int argc, char **argv) | |||
5921 | else if (!strcmp(argv[j], "-local")) | 5751 | else if (!strcmp(argv[j], "-local")) |
5922 | { | 5752 | { |
5923 | gConnectToSomething = FALSE; | 5753 | gConnectToSomething = FALSE; |
5924 | gUserServer.invalidate(); | ||
5925 | gRunLocal = TRUE; | 5754 | gRunLocal = TRUE; |
5926 | } | 5755 | } |
5927 | else if(!strcmp(argv[j], "-noinvlib")) | 5756 | else if(!strcmp(argv[j], "-noinvlib")) |
@@ -6345,7 +6174,6 @@ void disconnect_viewer(void *) | |||
6345 | gWorldp = NULL; | 6174 | gWorldp = NULL; |
6346 | 6175 | ||
6347 | cleanup_xfer_manager(); | 6176 | cleanup_xfer_manager(); |
6348 | gUserServer.invalidate(); | ||
6349 | gDisconnected = TRUE; | 6177 | gDisconnected = TRUE; |
6350 | } | 6178 | } |
6351 | 6179 | ||