Merge remote-tracking branch 'origin/master'

This commit is contained in:
Aleric Inglewood
2011-07-12 16:00:33 +02:00
31 changed files with 405 additions and 214 deletions

View File

@@ -88,7 +88,7 @@ if (VIEWER)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger) add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
add_dependencies(viewer linux-crash-logger-strip-target) add_dependencies(viewer linux-crash-logger-strip-target)
elseif (DARWIN) elseif (DARWIN)
add_subdirectory(${VIEWER_PREFIX}mac_crash_logger) #add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
#add_subdirectory(${VIEWER_PREFIX}mac_updater) #add_subdirectory(${VIEWER_PREFIX}mac_updater)
add_dependencies(viewer mac-crash-logger) add_dependencies(viewer mac-crash-logger)
#add_dependencies(viewer mac-updater) #add_dependencies(viewer mac-updater)

View File

@@ -24,11 +24,11 @@ else (STANDALONE)
endif (LINUX) endif (LINUX)
endif (STANDALONE) endif (STANDALONE)
if (GOOGLE_PERFTOOLS_FOUND) if (GOOGLE_PERFTOOLS_FOUND AND STANDALONE)
set(USE_GOOGLE_PERFTOOLS ON CACHE BOOL "Build with Google PerfTools support.") set(USE_GOOGLE_PERFTOOLS ON CACHE BOOL "Build with Google PerfTools support.")
else (GOOGLE_PERFTOOLS_FOUND) else ()
set(USE_GOOGLE_PERFTOOLS OFF) set(USE_GOOGLE_PERFTOOLS OFF)
endif (GOOGLE_PERFTOOLS_FOUND) endif ()
# XXX Disable temporarily, until we have compilation issues on 64-bit # XXX Disable temporarily, until we have compilation issues on 64-bit
# Etch sorted. # Etch sorted.

View File

@@ -5,6 +5,12 @@ include(Boost)
include(EXPAT) include(EXPAT)
include(ZLIB) include(ZLIB)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(CORESERVICES_LIBRARY CoreServices)
endif (DARWIN)
set(LLCOMMON_INCLUDE_DIRS set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/cwdebug ${LIBS_OPEN_DIR}/cwdebug
${LIBS_OPEN_DIR}/llcommon ${LIBS_OPEN_DIR}/llcommon

View File

@@ -30,7 +30,7 @@ set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX}) set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX}) set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX}) set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)") set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
set(VISTA_ICON OFF CACHE BOOL "Allow vista icon with pre 2008 Visual Studio IDEs. (Assumes replacement old rcdll.dll with new rcdll.dll from win sdk 7.0 or later)") set(VISTA_ICON OFF CACHE BOOL "Allow vista icon with pre 2008 Visual Studio IDEs. (Assumes replacement old rcdll.dll with new rcdll.dll from win sdk 7.0 or later)")
set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH

View File

@@ -223,6 +223,7 @@ target_link_libraries(
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${WINDOWS_LIBRARIES} ${WINDOWS_LIBRARIES}
${CWDEBUG_LIBRARIES} ${CWDEBUG_LIBRARIES}
${CORESERVICES_LIBRARY}
) )
if (LINUX) if (LINUX)

View File

@@ -52,7 +52,7 @@
# include <sys/sysctl.h> # include <sys/sysctl.h>
# include <sys/utsname.h> # include <sys/utsname.h>
# include <stdint.h> # include <stdint.h>
//# include <Carbon/Carbon.h> May be needed? # include <Carbon/Carbon.h>
#elif LL_LINUX #elif LL_LINUX
# include <errno.h> # include <errno.h>
# include <sys/utsname.h> # include <sys/utsname.h>

View File

@@ -293,7 +293,7 @@ int main(int argc, char **argv)
} }
// Check for a change in this process's frontmost window. // Check for a change in this process's frontmost window.
if(FrontWindow() != front_window) if(FrontNonFloatingWindow() != front_window)
{ {
ProcessSerialNumber self = { 0, kCurrentProcess }; ProcessSerialNumber self = { 0, kCurrentProcess };
ProcessSerialNumber parent = { 0, kNoProcess }; ProcessSerialNumber parent = { 0, kNoProcess };
@@ -319,7 +319,7 @@ int main(int argc, char **argv)
} }
} }
if((FrontWindow() != NULL) && (front_window == NULL)) if((FrontNonFloatingWindow() != NULL) && (front_window == NULL))
{ {
// Opening the first window // Opening the first window
@@ -331,7 +331,7 @@ int main(int argc, char **argv)
if(layer_group) if(layer_group)
{ {
SetWindowGroup(FrontWindow(), layer_group); SetWindowGroup(FrontNonFloatingWindow(), layer_group);
} }
if(parent_is_front_process) if(parent_is_front_process)
@@ -340,9 +340,9 @@ int main(int argc, char **argv)
(void) SetFrontProcess( &self ); (void) SetFrontProcess( &self );
} }
ActivateWindow(FrontWindow(), true); ActivateWindow(FrontNonFloatingWindow(), true);
} }
else if((FrontWindow() == NULL) && (front_window != NULL)) else if((FrontNonFloatingWindow() == NULL) && (front_window != NULL))
{ {
// Closing the last window // Closing the last window
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
window_hack_state = 2; window_hack_state = 2;
} }
front_window = FrontWindow(); front_window = FrontNonFloatingWindow();
} }
} }

View File

@@ -9,6 +9,52 @@
<string>settings_rlv.xml</string> <string>settings_rlv.xml</string>
</array> </array>
<key>CCSAllowNameplateOverride</key>
<map>
<key>Comment</key>
<string>Allow CCS HUD to override nameplates.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>HTTPRequestRate</key>
<map>
<key>Comment</key>
<string>Number of HTTP texture requests fired per second.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>30</integer>
</map>
<key>HTTPMaxRequests</key>
<map>
<key>Comment</key>
<string>Maximum number of simultaneous HTTP requests in progress.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>32</integer>
</map>
<key>HTTPMinRequests</key>
<map>
<key>Comment</key>
<string>Attempt to maintain at least this many HTTP requests in progress by ignoring bandwidth</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>2</integer>
</map>
<key>AllowLargeSounds</key> <key>AllowLargeSounds</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -10,20 +10,20 @@
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform float glowStrength; uniform float glowStrength;
float kern[4] = float[4](.25,.5,.8,1.0); //Initialize the correct (non nVidia cg) way vec4 kern = vec4(.25,.5,.8,1.0);
void main() void main()
{ {
vec4 col = vec4(0.0, 0.0, 0.0, 0.0); vec4 col = vec4(0.0, 0.0, 0.0, 0.0);
col += kern[0] * texture2D(diffuseMap, gl_TexCoord[0].xy); col += kern.x * texture2D(diffuseMap, gl_TexCoord[0].xy);
col += kern[1] * texture2D(diffuseMap, gl_TexCoord[1].xy); col += kern.y * texture2D(diffuseMap, gl_TexCoord[1].xy);
col += kern[2] * texture2D(diffuseMap, gl_TexCoord[2].xy); col += kern.z * texture2D(diffuseMap, gl_TexCoord[2].xy);
col += kern[3] * texture2D(diffuseMap, gl_TexCoord[3].xy); col += kern.w * texture2D(diffuseMap, gl_TexCoord[3].xy);
col += kern[3] * texture2D(diffuseMap, gl_TexCoord[0].zw); col += kern.w * texture2D(diffuseMap, gl_TexCoord[0].zw);
col += kern[2] * texture2D(diffuseMap, gl_TexCoord[1].zw); col += kern.z * texture2D(diffuseMap, gl_TexCoord[1].zw);
col += kern[1] * texture2D(diffuseMap, gl_TexCoord[2].zw); col += kern.y * texture2D(diffuseMap, gl_TexCoord[2].zw);
col += kern[0] * texture2D(diffuseMap, gl_TexCoord[3].zw); col += kern.x * texture2D(diffuseMap, gl_TexCoord[3].zw);
gl_FragColor = vec4(col.rgb * glowStrength, col.a); gl_FragColor = vec4(col.rgb * glowStrength, col.a);
} }

View File

@@ -32,7 +32,7 @@ vec4 applyWaterFog(vec4 color)
float depth = length(getPositionEye() - int_v); float depth = length(getPositionEye() - int_v);
//get "thickness" of water //get "thickness" of water
float l = max(depth, 0.1); float l = min(max(depth, 0.1),50.0);
float kd = waterFogDensity; float kd = waterFogDensity;
float ks = waterFogKS; float ks = waterFogKS;

View File

@@ -678,6 +678,15 @@ bool LLAppViewer::init()
LLViewerJointMesh::updateVectorize(); LLViewerJointMesh::updateVectorize();
// load MIME type -> media impl mappings
#if LL_WINDOWS
LLMIMETypes::parseMIMETypes( std::string("mime_types_windows.xml") );
#elif LL_DARWIN
LLMIMETypes::parseMIMETypes( std::string("mime_types_mac.xml") );
#elif LL_LINUX
LLMIMETypes::parseMIMETypes( std::string("mime_types_linux.xml") );
#endif
// Copy settings to globals. *TODO: Remove or move to appropriage class initializers // Copy settings to globals. *TODO: Remove or move to appropriage class initializers
settings_to_globals(); settings_to_globals();
// Setup settings listeners // Setup settings listeners
@@ -2113,13 +2122,13 @@ bool LLAppViewer::initConfiguration()
} }
} }
const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent");
if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString())
{ {
gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); gDirUtilp->setSkinFolder(skinfolder->getValue().asString());
} }
mYieldTime = gSavedSettings.getS32("YieldTime"); mYieldTime = gSavedSettings.getS32("YieldTime");
// XUI:translate // XUI:translate
gSecondLife = "Singularity Viewer"; gSecondLife = "Singularity Viewer";
@@ -2390,9 +2399,6 @@ bool LLAppViewer::initWindow()
LLTrans::parseStrings("strings.xml"); LLTrans::parseStrings("strings.xml");
LLUITrans::parseStrings("ui_strings.xml"); LLUITrans::parseStrings("ui_strings.xml");
// load MIME type -> media impl mappings
LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") );
// Show watch cursor // Show watch cursor
gViewerWindow->setCursor(UI_CURSOR_WAIT); gViewerWindow->setCursor(UI_CURSOR_WAIT);

View File

@@ -476,7 +476,7 @@ void LLPanelObject::getState( )
} }
// can move or rotate only linked group with move permissions, or sub-object with move and modify perms // can move or rotate only linked group with move permissions, or sub-object with move and modify perms
BOOL enable_move = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); BOOL enable_move = objectp->permMove() && (!objectp->isAttachment() && objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
BOOL enable_scale = objectp->permMove() && objectp->permModify(); BOOL enable_scale = objectp->permMove() && objectp->permModify();
BOOL enable_rotate = objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); BOOL enable_rotate = objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
BOOL enable_link = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); BOOL enable_link = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
@@ -492,15 +492,6 @@ void LLPanelObject::getState( )
enable_rotate = FALSE; enable_rotate = FALSE;
} }
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) )
{ {
@@ -1125,14 +1116,14 @@ void LLPanelObject::getState( )
//top_shear_x_visible = FALSE; //top_shear_x_visible = FALSE;
//top_shear_y_visible = FALSE; //top_shear_y_visible = FALSE;
//advanced_cut_visible = TRUE; //advanced_cut_visible = TRUE;
//advanced_is_dimple = TRUE; advanced_is_dimple = TRUE;
//twist_min = OBJECT_TWIST_MIN; //twist_min = OBJECT_TWIST_MIN;
//twist_max = OBJECT_TWIST_MAX; //twist_max = OBJECT_TWIST_MAX;
//twist_inc = OBJECT_TWIST_INC; //twist_inc = OBJECT_TWIST_INC;
// Just like the others except no radius // Just like the others except no radius
size_is_hole = TRUE; size_is_hole = TRUE;
skew_visible = TRUE; skew_visible = TRUE;
advanced_cut_visible = TRUE; //advanced_cut_visible = TRUE;
taper_visible = TRUE; taper_visible = TRUE;
radius_offset_visible = FALSE; radius_offset_visible = FALSE;
revolutions_visible = TRUE; revolutions_visible = TRUE;
@@ -1145,8 +1136,9 @@ void LLPanelObject::getState( )
case MI_TEST_PRISM: case MI_TEST_PRISM:
case MI_TEST_HEMICYLINDER: case MI_TEST_HEMICYLINDER:
cut_visible = FALSE; cut_visible = FALSE;
advanced_cut_visible = TRUE; //advanced_cut_visible = TRUE;
taper_visible = FALSE; advanced_is_slice = TRUE;
//taper_visible = FALSE;
radius_offset_visible = FALSE; radius_offset_visible = FALSE;
revolutions_visible = FALSE; revolutions_visible = FALSE;
top_shear_x_visible = FALSE; top_shear_x_visible = FALSE;
@@ -2199,7 +2191,8 @@ void LLPanelObject::sendPosition(BOOL btn_down)
// won't get dumped by the simulator. // won't get dumped by the simulator.
LLVector3d new_pos_global = regionp->getPosGlobalFromRegion(newpos); LLVector3d new_pos_global = regionp->getPosGlobalFromRegion(newpos);
if ( LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global) ) if (LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global) ||
mObject->isAttachment())
{ {
// send only if the position is changed, that is, the delta vector is not zero // send only if the position is changed, that is, the delta vector is not zero
LLVector3d old_pos_global = mObject->getPositionGlobal(); LLVector3d old_pos_global = mObject->getPositionGlobal();
@@ -2637,9 +2630,9 @@ void LLPanelObject::onPastePos(void* user_data)
LLPanelObject* self = (LLPanelObject*) user_data; LLPanelObject* self = (LLPanelObject*) user_data;
LLCalc* calcp = LLCalc::getInstance(); LLCalc* calcp = LLCalc::getInstance();
mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, 256.f); mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], -3.5f, 256.f);
mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, 256.f); mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], -3.5f, 256.f);
mClipboardPos.mV[VZ] = llclamp( mClipboardPos.mV[VZ], 0.f, 4096.f); mClipboardPos.mV[VZ] = llclamp( mClipboardPos.mV[VZ], -3.5f, 4096.f);
self->mCtrlPosX->set( mClipboardPos.mV[VX] ); self->mCtrlPosX->set( mClipboardPos.mV[VX] );
self->mCtrlPosY->set( mClipboardPos.mV[VY] ); self->mCtrlPosY->set( mClipboardPos.mV[VY] );
@@ -2716,9 +2709,9 @@ void LLPanelObject::onPastePosClip(void* user_data)
std::string stringVec = wstring_to_utf8str(temp_string); std::string stringVec = wstring_to_utf8str(temp_string);
if(!getvectorfromclip(stringVec, &mClipboardPos)) return; if(!getvectorfromclip(stringVec, &mClipboardPos)) return;
mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], 0.f, 256.f); mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, 256.f);
mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], 0.f, 256.f); mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, 256.f);
mClipboardPos.mV[VZ] = llclamp(mClipboardPos.mV[VZ], 0.f, 4096.f); mClipboardPos.mV[VZ] = llclamp(mClipboardPos.mV[VZ], -3.5f, 4096.f);
self->mCtrlPosX->set( mClipboardPos.mV[VX] ); self->mCtrlPosX->set( mClipboardPos.mV[VX] );
self->mCtrlPosY->set( mClipboardPos.mV[VY] ); self->mCtrlPosY->set( mClipboardPos.mV[VY] );

View File

@@ -472,6 +472,30 @@ public:
LLMutex* SGHostBlackList::sMutex = 0; LLMutex* SGHostBlackList::sMutex = 0;
SGHostBlackList::blacklist_t SGHostBlackList::blacklist; SGHostBlackList::blacklist_t SGHostBlackList::blacklist;
//call every time a connection is opened
//return true if connecting allowed
static bool sgConnectionThrottle() {
static LLMutex mutex;
LLMutexLock lock(&mutex);
const U32 THROTTLE_TIMESTEPS_PER_SECOND = 10;
static const LLCachedControl<U32> max_connections_per_second("HTTPRequestRate", 30);
S32 max_connections = max_connections_per_second/THROTTLE_TIMESTEPS_PER_SECOND;
const S32 timestep = USEC_PER_SEC/THROTTLE_TIMESTEPS_PER_SECOND;
U64 now = LLTimer::getTotalTime();
std::deque<U64> timestamps;
while(!timestamps.empty() && (timestamps[0]<=now-timestep)) {
timestamps.pop_front();
}
if(timestamps.size() < max_connections) {
//llinfos << "throttle pass" << llendl;
timestamps.push_back(now);
return true;
} else {
//llinfos << "throttle fail" << llendl;
return false;
}
}
#if HTTP_METRICS #if HTTP_METRICS
// Cross-thread messaging for asset metrics. // Cross-thread messaging for asset metrics.
@@ -1250,11 +1274,12 @@ bool LLTextureFetchWorker::doWork(S32 param)
//1, not openning too many file descriptors at the same time; //1, not openning too many file descriptors at the same time;
//2, control the traffic of http so udp gets bandwidth. //2, control the traffic of http so udp gets bandwidth.
// //
static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 32; static const LLCachedControl<S32> max_http_requests("HTTPMaxRequests", 32);
static const S32 NUM_REQUESTS_TILL_THRESHOLDING = 2; static const LLCachedControl<S32> min_http_requests("HTTPMinRequests", 2);
if((mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) || if((mFetcher->getNumHTTPRequests() > max_http_requests) ||
((mFetcher->getTextureBandwidth() > mFetcher->mMaxBandwidth) && ((mFetcher->getTextureBandwidth() > mFetcher->mMaxBandwidth) &&
mFetcher->getNumHTTPRequests() > NUM_REQUESTS_TILL_THRESHOLDING)) (mFetcher->getNumHTTPRequests() > min_http_requests)) ||
!sgConnectionThrottle())
{ {
return false ; //wait. return false ; //wait.
} }
@@ -2058,8 +2083,8 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
unlockQueue() ; unlockQueue() ;
worker->lockWorkMutex(); worker->lockWorkMutex();
worker->mActiveCount++; worker->mActiveCount++;
worker->mNeedsAux = needs_aux; worker->mNeedsAux = needs_aux;
worker->setCanUseHTTP(can_use_http) ; worker->setCanUseHTTP(can_use_http) ;
worker->unlockWorkMutex(); worker->unlockWorkMutex();
} }
@@ -2709,8 +2734,8 @@ bool LLTextureFetch::receiveImageHeader(const LLHost& host, const LLUUID& id, U8
res = worker->insertPacket(0, data, data_size); res = worker->insertPacket(0, data, data_size);
worker->setPriority(LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority); worker->setPriority(LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority);
worker->mState = LLTextureFetchWorker::LOAD_FROM_SIMULATOR; worker->mState = LLTextureFetchWorker::LOAD_FROM_SIMULATOR;
worker->unlockWorkMutex(); worker->unlockWorkMutex();
return res; return res;
} }
bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data) bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data)

View File

@@ -111,6 +111,10 @@ void process_generic_message(LLMessageSystem* msg, void**)
LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
LLWaterParamSet & param_set = param_mgr->mCurParams; LLWaterParamSet & param_set = param_mgr->mCurParams;
LLWaterParamSet backup;
if(!param_mgr->getParamSet("LightShare-Backup", backup)) {
param_mgr->addParamSet("LightShare-Backup", param_set);
}
param_set.set("waterFogColor", wl->waterColor.red / 256.f, wl->waterColor.green / 256.f, wl->waterColor.blue / 256.f); param_set.set("waterFogColor", wl->waterColor.red / 256.f, wl->waterColor.green / 256.f, wl->waterColor.blue / 256.f);
param_set.set("waterFogDensity", pow(2.0f, wl->waterFogDensityExponent)); param_set.set("waterFogDensity", pow(2.0f, wl->waterFogDensityExponent));
@@ -147,11 +151,16 @@ void process_generic_message(LLMessageSystem* msg, void**)
normalMapTexture.set(out); normalMapTexture.set(out);
param_mgr->setParamSet( "Meta7CurrentRegion", param_set); param_mgr->setParamSet( "LightShare-CurrentRegion", param_set);
param_mgr->setNormalMapID(normalMapTexture); param_mgr->setNormalMapID(normalMapTexture);
LLWLParamManager * wl_param_mgr = LLWLParamManager::instance(); LLWLParamManager * wl_param_mgr = LLWLParamManager::instance();
LLWLParamSet & wl_param_set = wl_param_mgr->mCurParams; LLWLParamSet & wl_param_set = wl_param_mgr->mCurParams;
LLWLParamSet wl_backup;
if(!wl_param_mgr->getParamSet("LightShare-Backup", wl_backup)) {
wl_param_mgr->addParamSet("LightShare-Backup", wl_param_set);
}
wl_param_set.setSunAngle(F_TWO_PI * wl->sunMoonPosiiton); wl_param_set.setSunAngle(F_TWO_PI * wl->sunMoonPosiiton);
wl_param_set.setEastAngle(F_TWO_PI * wl->eastAngle); wl_param_set.setEastAngle(F_TWO_PI * wl->eastAngle);
wl_param_set.set("sunlight_color", wl->sunMoonColor.red * 3.0f, wl->sunMoonColor.green * 3.0f, wl->sunMoonColor.blue * 3.0f, wl->sunMoonColor.alpha * 3.0f); wl_param_set.set("sunlight_color", wl->sunMoonColor.red * 3.0f, wl->sunMoonColor.green * 3.0f, wl->sunMoonColor.blue * 3.0f, wl->sunMoonColor.alpha * 3.0f);
@@ -175,12 +184,12 @@ void process_generic_message(LLMessageSystem* msg, void**)
wl_param_set.setEnableCloudScrollX(!wl->cloudScrollXLock); wl_param_set.setEnableCloudScrollX(!wl->cloudScrollXLock);
wl_param_set.setEnableCloudScrollY(!wl->cloudScrollYLock); wl_param_set.setEnableCloudScrollY(!wl->cloudScrollYLock);
wl_param_set.setStarBrightness(wl->starBrightness); wl_param_set.setStarBrightness(wl->starBrightness);
wl_param_mgr->removeParamSet("Meta7-CurrentRegion",true); wl_param_mgr->removeParamSet("LightShare-CurrentRegion",true);
wl_param_mgr->addParamSet( "Meta7-CurrentRegion", wl_param_set); wl_param_mgr->addParamSet( "LightShare-CurrentRegion", wl_param_set);
wl_param_mgr->savePreset( "Meta7-CurrentRegion"); wl_param_mgr->savePreset( "LightShare-CurrentRegion");
LLWLParamManager::instance()->mAnimator.mIsRunning = false; LLWLParamManager::instance()->mAnimator.mIsRunning = false;
LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; LLWLParamManager::instance()->mAnimator.mUseLindenTime = false;
wl_param_mgr->loadPreset( "Meta7-CurrentRegion",true); wl_param_mgr->loadPreset( "LightShare-CurrentRegion",true);
} }
} }
} }

View File

@@ -2863,15 +2863,10 @@ class LLObjectExport : public view_listener_t
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
if (!object) return true; if (object)
LLVOAvatar* avatar = find_avatar_from_object(object);
if (!avatar)
{ {
LLObjectBackup::getInstance()->exportObject(); LLObjectBackup::getInstance()->exportObject();
} }
return true; return true;
} }
}; };

View File

@@ -3095,7 +3095,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
// RELEASE-RLVa: if this code changes, remember to change the code down below as well // RELEASE-RLVa: if this code changes, remember to change the code down below as well
if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) && if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) &&
(gSavedSettings.getBOOL("EffectScriptChatParticles")) && (gSavedSettings.getBOOL("EffectScriptChatParticles")) &&
((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) ) (CHAT_TYPE_OWNER != chat.mChatType) )
// [/RLVa:KB] // [/RLVa:KB]
{ {
LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
@@ -3429,8 +3429,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
#endif //shy_mod #endif //shy_mod
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g) // [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g)
// Copy/paste from above // Copy/paste from above
if ( (chatter) && (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) && if ( chatter && (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) &&
(gSavedSettings.getBOOL("EffectScriptChatParticles")) ) (gSavedSettings.getBOOL("EffectScriptChatParticles")) &&
(CHAT_TYPE_OWNER != chat.mChatType) )
{ {
LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
psc->setSourceObject(chatter); psc->setSourceObject(chatter);
@@ -3759,10 +3760,18 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
*/ */
//Reset the windlight profile to default //Reset the windlight profile to default
/*LLWLParamManager::instance()->mAnimator.mIsRunning = false; //LLWLParamManager::instance()->mAnimator.mIsRunning = false;
LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; //LLWLParamManager::instance()->mAnimator.mUseLindenTime = false;
LLWLParamManager::instance()->loadPreset("Default", true); LLWLParamSet wl_backup;
LLWaterParamManager::instance()->loadPreset("Default",true);*/ if(LLWLParamManager::instance()->getParamSet("LightShare-Backup", wl_backup)) {
LLWLParamManager::instance()->propagateParameters();
LLWLParamManager::instance()->removeParamSet("LightShare-Backup", true);
}
LLWaterParamSet backup;
if(LLWaterParamManager::instance()->getParamSet("LightShare-Backup", backup)) {
LLWaterParamManager::instance()->propagateParameters();
LLWaterParamManager::instance()->removeParamSet("LightShare-Backup", true);
}
// now, use the circuit info to tell simulator about us! // now, use the circuit info to tell simulator about us!
LL_INFOS("Messaging") << "process_teleport_finish() Enabling " LL_INFOS("Messaging") << "process_teleport_finish() Enabling "

View File

@@ -34,12 +34,10 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include "hippogridmanager.h"
// linden library includes // linden library includes
#include "indra_constants.h" #include "indra_constants.h"
#include "llapr.h"
#include "llalertdialog.h" #include "llalertdialog.h"
#include "llapr.h"
#include "llcallbacklist.h" #include "llcallbacklist.h"
#include "lldir.h" #include "lldir.h"
#include "lleconomy.h" #include "lleconomy.h"
@@ -79,9 +77,37 @@
#include "llviewerstats.h" #include "llviewerstats.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "hippogridmanager.h"
#include "llviewerobjectbackup.h" #include "llviewerobjectbackup.h"
LLObjectBackup* LLObjectBackup::sInstance = 0; LLObjectBackup* LLObjectBackup::sInstance = NULL;
// Note: these default textures are initialized with hard coded values to
// prevent cheating. When not in SL, the user-configurable values are used
// instead (see setDefaultTextures() below).
static LLUUID LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f");
static LLUUID LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
static LLUUID LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837");
static LLUUID LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
static LLUUID LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361");
void setDefaultTextures()
{
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
{
// When not in SL (no texture perm check needed), we can get these
// defaults from the user settings...
LL_TEXTURE_PLYWOOD = LLUUID(gSavedSettings.getString("DefaultObjectTexture"));
LL_TEXTURE_BLANK = LLUUID(gSavedSettings.getString("UIImgWhiteUUID"));
if (gSavedSettings.controlExists("UIImgInvisibleUUID"))
{
// This control only exists in the Cool VL Viewer (added by the
// AllowInvisibleTextureInPicker patch)
LL_TEXTURE_INVISIBLE = LLUUID(gSavedSettings.getString("UIImgInvisibleUUID"));
}
}
}
class importResponder: public LLNewAgentInventoryResponder class importResponder: public LLNewAgentInventoryResponder
{ {
@@ -95,7 +121,7 @@ public:
//virtual //virtual
virtual void uploadComplete(const LLSD& content) virtual void uploadComplete(const LLSD& content)
{ {
lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl; LL_DEBUGS("ObjectBackup") << "LLNewAgentInventoryResponder::result from capabilities" << LL_ENDL;
LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString()); LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString());
LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString());
@@ -120,8 +146,8 @@ public:
} }
// Actually add the upload to viewer inventory // Actually add the upload to viewer inventory
llinfos << "Adding " << content["new_inventory_item"].asUUID() << " " LL_INFOS("ObjectBackup") << "Adding " << content["new_inventory_item"].asUUID() << " "
<< content["new_asset"].asUUID() << " to inventory." << llendl; << content["new_asset"].asUUID() << " to inventory." << LL_ENDL;
if (mPostData["folder_id"].asUUID().notNull()) if (mPostData["folder_id"].asUUID().notNull())
{ {
LLPermissions perm; LLPermissions perm;
@@ -154,7 +180,7 @@ public:
} }
else else
{ {
llwarns << "Can't find a folder to put it into" << llendl; LL_WARNS("ObjectBackup") << "Can't find a folder to put it into" << LL_ENDL;
} }
// remove the "Uploading..." message // remove the "Uploading..." message
@@ -177,7 +203,7 @@ public:
{ {
if (imageformat == IMG_CODEC_TGA && mFormattedImage->getCodec() == IMG_CODEC_J2C) if (imageformat == IMG_CODEC_TGA && mFormattedImage->getCodec() == IMG_CODEC_J2C)
{ {
llwarns << "FAILED: texture " << mID << " is formatted as TGA. Not saving." << llendl; LL_WARNS("ObjectBackup") << "FAILED: texture " << mID << " is formatted as TGA. Not saving." << LL_ENDL;
LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_BAD_ENCODING; LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_BAD_ENCODING;
mFormattedImage = NULL; mFormattedImage = NULL;
mImageSize = 0; mImageSize = 0;
@@ -202,14 +228,14 @@ public:
{ {
if (success && mFormattedImage.notNull() && mImageSize > 0) if (success && mFormattedImage.notNull() && mImageSize > 0)
{ {
llinfos << "SUCCESS getting texture " << mID << llendl; LL_INFOS("ObjectBackup") << "SUCCESS getting texture " << mID << LL_ENDL;
std::string name; std::string name;
mID.toString(name); mID.toString(name);
name = LLObjectBackup::getInstance()->getfolder() + "//" + name; name = LLObjectBackup::getInstance()->getfolder() + "//" + name;
llinfos << "Saving to " << name << llendl; LL_INFOS("ObjectBackup") << "Saving to " << name << LL_ENDL;
if (!mFormattedImage->save(name)) if (!mFormattedImage->save(name))
{ {
llwarns << "FAILED to save texture " << mID << llendl; LL_WARNS("ObjectBackup") << "FAILED to save texture " << mID << LL_ENDL;
LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_SAVED_FAILED; LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_SAVED_FAILED;
} }
} }
@@ -217,12 +243,12 @@ public:
{ {
if (!success) if (!success)
{ {
llwarns << "FAILED to get texture " << mID << llendl; LL_WARNS("ObjectBackup") << "FAILED to get texture " << mID << LL_ENDL;
LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_MISSING; LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_MISSING;
} }
if (mFormattedImage.isNull()) if (mFormattedImage.isNull())
{ {
llwarns << "FAILED: NULL texture " << mID << llendl; LL_WARNS("ObjectBackup") << "FAILED: NULL texture " << mID << LL_ENDL;
LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_IS_NULL; LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_IS_NULL;
} }
} }
@@ -340,6 +366,9 @@ void LLObjectBackup::exportObject()
mLLSD.clear(); mLLSD.clear();
mThisGroup.clear(); mThisGroup.clear();
setDefaultTextures();
LLSelectMgr::getInstance()->getSelection()->ref();
// Open the file save dialog // Open the file save dialog
AIFilePicker* filepicker = AIFilePicker::create(); AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open("", FFSAVE_XML); filepicker->open("", FFSAVE_XML);
@@ -351,6 +380,7 @@ void LLObjectBackup::exportObject_continued(AIFilePicker* filepicker)
if (!filepicker->hasFilename()) if (!filepicker->hasFilename())
{ {
// User canceled save. // User canceled save.
LLSelectMgr::getInstance()->getSelection()->unref();
return; return;
} }
@@ -365,7 +395,7 @@ void LLObjectBackup::exportObject_continued(AIFilePicker* filepicker)
bool LLObjectBackup::validatePerms(const LLPermissions *item_permissions) bool LLObjectBackup::validatePerms(const LLPermissions *item_permissions)
{ {
if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) if (gHippoGridManager->getConnectedGrid()->isSecondLife())
{ {
// In Second Life, you must be the creator to be permitted to export the asset. // In Second Life, you must be the creator to be permitted to export the asset.
return (gAgent.getID() == item_permissions->getOwner() && return (gAgent.getID() == item_permissions->getOwner() &&
@@ -390,12 +420,21 @@ bool LLObjectBackup::validatePerms(const LLPermissions *item_permissions)
// the textures in the Library), whoever is the actual creator... Go figure ! // the textures in the Library), whoever is the actual creator... Go figure !
LLUUID LLObjectBackup::validateTextureID(LLUUID asset_id) LLUUID LLObjectBackup::validateTextureID(LLUUID asset_id)
{ {
if (gHippoGridManager->getConnectedGrid()->getPlatform() != HippoGridInfo::PLATFORM_SECONDLIFE) if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
{ {
// If we are not in Second Life, don't bother. // If we are not in Second Life, don't bother.
return asset_id; return asset_id;
} }
LLUUID texture = LLUUID(gSavedSettings.getString("DefaultObjectTexture")); LLUUID texture = LL_TEXTURE_PLYWOOD;
if (asset_id == texture ||
asset_id == LL_TEXTURE_BLANK ||
asset_id == LL_TEXTURE_INVISIBLE ||
asset_id == LL_TEXTURE_TRANSPARENT ||
asset_id == LL_TEXTURE_MEDIA)
{
// Allow to export a few default SL textures.
return asset_id;
}
LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items; LLViewerInventoryItem::item_array_t items;
LLAssetIDMatches asset_id_matches(asset_id); LLAssetIDMatches asset_id_matches(asset_id);
@@ -434,7 +473,6 @@ void LLObjectBackup::exportWorker(void *userdata)
case EXPORT_INIT: case EXPORT_INIT:
{ {
LLObjectBackup::getInstance()->show(true); LLObjectBackup::getInstance()->show(true);
LLSelectMgr::getInstance()->getSelection()->ref();
struct ff : public LLSelectedNodeFunctor struct ff : public LLSelectedNodeFunctor
{ {
virtual bool apply(LLSelectNode* node) virtual bool apply(LLSelectNode* node)
@@ -449,7 +487,7 @@ void LLObjectBackup::exportWorker(void *userdata)
} }
else else
{ {
llwarns << "Incorrect permission to export" << llendl; LL_WARNS("ObjectBackup") << "Incorrect permission to export" << LL_ENDL;
LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED; LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED;
LLSelectMgr::getInstance()->getSelection()->unref(); LLSelectMgr::getInstance()->getSelection()->unref();
} }
@@ -462,13 +500,22 @@ void LLObjectBackup::exportWorker(void *userdata)
{ {
virtual bool apply(LLViewerObject* object) virtual bool apply(LLViewerObject* object)
{ {
bool is_attachment = object->isAttachment();
object->boostTexturePriority(TRUE); object->boostTexturePriority(TRUE);
LLViewerObject::child_list_t children = object->getChildren(); LLViewerObject::child_list_t children = object->getChildren();
children.push_front(object); //push root onto list children.push_front(object); //push root onto list
LLSD prim_llsd = LLObjectBackup::getInstance()->primsToLLSD(children); LLSD prim_llsd = LLObjectBackup::getInstance()->primsToLLSD(children, is_attachment);
LLSD stuff; LLSD stuff;
stuff["root_position"] = object->getPosition().getValue(); if (is_attachment)
stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotation()); {
stuff["root_position"] = object->getPositionEdit().getValue();
stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotationEdit());
}
else
{
stuff["root_position"] = object->getPosition().getValue();
stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotation());
}
stuff["group_body"] = prim_llsd; stuff["group_body"] = prim_llsd;
LLObjectBackup::getInstance()->mLLSD["data"].append(stuff); LLObjectBackup::getInstance()->mLLSD["data"].append(stuff);
return true; return true;
@@ -512,12 +559,12 @@ void LLObjectBackup::exportWorker(void *userdata)
gIdleCallbacks.deleteFunction(exportWorker); gIdleCallbacks.deleteFunction(exportWorker);
if (LLObjectBackup::getInstance()->mNonExportedTextures == LLObjectBackup::TEXTURE_OK) if (LLObjectBackup::getInstance()->mNonExportedTextures == LLObjectBackup::TEXTURE_OK)
{ {
llinfos << "Export successful and complete." << llendl; LL_INFOS("ObjectBackup") << "Export successful and complete." << LL_ENDL;
LLNotifications::instance().add("ExportSuccessful"); LLNotifications::instance().add("ExportSuccessful");
} }
else else
{ {
llinfos << "Export successful but incomplete: some texture(s) not saved." << llendl; LL_INFOS("ObjectBackup") << "Export successful but incomplete: some texture(s) not saved." << LL_ENDL;
std::string reason; std::string reason;
if (LLObjectBackup::getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_BAD_PERM) if (LLObjectBackup::getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_BAD_PERM)
{ {
@@ -525,7 +572,7 @@ void LLObjectBackup::exportWorker(void *userdata)
} }
if (LLObjectBackup::getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_MISSING) if (LLObjectBackup::getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_MISSING)
{ {
reason += "\nMissing texture."; reason += "\nMissing texture (retrying after full rezzing might work).";
} }
if (LLObjectBackup::getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_BAD_ENCODING) if (LLObjectBackup::getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_BAD_ENCODING)
{ {
@@ -548,14 +595,14 @@ void LLObjectBackup::exportWorker(void *userdata)
case EXPORT_FAILED: case EXPORT_FAILED:
gIdleCallbacks.deleteFunction(exportWorker); gIdleCallbacks.deleteFunction(exportWorker);
llwarns << "Export process aborted." << llendl; LL_WARNS("ObjectBackup") << "Export process aborted." << LL_ENDL;
LLNotifications::instance().add("ExportFailed"); LLNotifications::instance().add("ExportFailed");
LLObjectBackup::getInstance()->close(); LLObjectBackup::getInstance()->close();
break; break;
} }
} }
LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list) LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool is_attachment)
{ {
LLViewerObject* object; LLViewerObject* object;
LLSD llsd; LLSD llsd;
@@ -566,7 +613,7 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list)
object = (*i); object = (*i);
LLUUID id = object->getID(); LLUUID id = object->getID();
llinfos << "Exporting prim " << object->getID().asString() << llendl; LL_INFOS("ObjectBackup") << "Exporting prim " << object->getID().asString() << LL_ENDL;
// Create an LLSD object that represents this prim. It will be injected in to the overall LLSD // Create an LLSD object that represents this prim. It will be injected in to the overall LLSD
// tree structure // tree structure
@@ -588,9 +635,17 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list)
} }
// Transforms // Transforms
prim_llsd["position"] = object->getPosition().getValue(); if (is_attachment)
{
prim_llsd["position"] = object->getPositionEdit().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotationEdit());
}
else
{
prim_llsd["position"] = object->getPosition().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
prim_llsd["scale"] = object->getScale().getValue(); prim_llsd["scale"] = object->getScale().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
// Flags // Flags
prim_llsd["shadows"] = object->flagCastShadows(); prim_llsd["shadows"] = object->flagCastShadows();
@@ -632,13 +687,13 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list)
} }
if (alreadyseen == false) if (alreadyseen == false)
{ {
llinfos << "Found a sculpt texture, adding to list " << sculpt_texture << llendl; LL_INFOS("ObjectBackup") << "Found a sculpt texture, adding to list " << sculpt_texture << LL_ENDL;
mTexturesList.push_back(sculpt_texture); mTexturesList.push_back(sculpt_texture);
} }
} }
else else
{ {
llwarns << "Incorrect permission to export a sculpt texture." << llendl; LL_WARNS("ObjectBackup") << "Incorrect permission to export a sculpt texture." << LL_ENDL;
LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED; LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED;
} }
} }
@@ -655,14 +710,22 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list)
this_te_llsd = object->getTE(i)->asLLSD(); this_te_llsd = object->getTE(i)->asLLSD();
this_te_llsd["imageid"] = t_id; this_te_llsd["imageid"] = t_id;
te_llsd.append(this_te_llsd); te_llsd.append(this_te_llsd);
std::list<LLUUID>::iterator iter; // Do not export Linden textures even though they don't taint creation.
for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++) if (t_id != LL_TEXTURE_PLYWOOD &&
{ t_id != LL_TEXTURE_BLANK &&
if ((*iter) == t_id) t_id != LL_TEXTURE_TRANSPARENT &&
alreadyseen = true; t_id != LL_TEXTURE_INVISIBLE &&
t_id != LL_TEXTURE_MEDIA)
{
std::list<LLUUID>::iterator iter;
for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++)
{
if ((*iter) == t_id)
alreadyseen = true;
}
if (alreadyseen == false)
mTexturesList.push_back(t_id);
} }
if (alreadyseen == false)
mTexturesList.push_back(t_id);
} }
prim_llsd["textures"] = te_llsd; prim_llsd["textures"] = te_llsd;
@@ -679,7 +742,7 @@ void LLObjectBackup::exportNextTexture()
{ {
if (mTexturesList.empty()) if (mTexturesList.empty())
{ {
llinfos << "Finished exporting textures." << llendl; LL_INFOS("ObjectBackup") << "Finished exporting textures." << LL_ENDL;
return; return;
} }
@@ -687,7 +750,7 @@ void LLObjectBackup::exportNextTexture()
std::list<LLUUID>::iterator iter; std::list<LLUUID>::iterator iter;
iter = mTexturesList.begin(); iter = mTexturesList.begin();
while (1) while (true)
{ {
if (iter == mTexturesList.end()) if (iter == mTexturesList.end())
{ {
@@ -696,6 +759,13 @@ void LLObjectBackup::exportNextTexture()
} }
id = (*iter); id = (*iter);
if (id.isNull())
{
// NULL texture id: just remove and ignore.
mTexturesList.remove(id);
iter = mTexturesList.begin();
continue;
}
LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id); LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id);
if (imagep != NULL) if (imagep != NULL)
@@ -716,15 +786,17 @@ void LLObjectBackup::exportNextTexture()
} }
else else
{ {
llwarns << "We *DON'T* have the texture " << llendl; LL_WARNS("ObjectBackup") << "We *DON'T* have the texture " << id.asString() << LL_ENDL;
mNonExportedTextures |= TEXTURE_MISSING; mNonExportedTextures |= TEXTURE_MISSING;
mTexturesList.remove(id);
return;
} }
iter++; iter++;
} }
mTexturesList.remove(id); mTexturesList.remove(id);
llinfos << "Requesting texture " << id << llendl; LL_INFOS("ObjectBackup") << "Requesting texture " << id << LL_ENDL;
LLImageJ2C* mFormattedImage = new LLImageJ2C; LLImageJ2C* mFormattedImage = new LLImageJ2C;
CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage); CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage);
LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder); LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder);
@@ -735,27 +807,33 @@ void LLObjectBackup::importObject(bool upload)
mTexturesList.clear(); mTexturesList.clear();
mAssetMap.clear(); mAssetMap.clear();
mCurrentAsset = LLUUID::null; mCurrentAsset = LLUUID::null;
setDefaultTextures();
mRetexture = upload; mRetexture = upload;
// Open the file open dialog // Open the file open dialog
AIFilePicker* filepicker = AIFilePicker::create(); AIFilePicker* filepicker = new AIFilePicker;
filepicker->open(FFLOAD_XML, "", "import"); filepicker->open(FFLOAD_XML, "", "import");
filepicker->run(boost::bind(&LLObjectBackup::importObject_continued, this, filepicker)); filepicker->run(boost::bind(&LLObjectBackup::importObject_continued, this, filepicker));
return; return;
} }
void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) void LLObjectBackup::importObject_continued(AIFilePicker* filepicker)
{ {
if (!filepicker->hasFilename()) if (!filepicker->hasFilename())
{
// User canceled save.
return; return;
}
std::string file_name = filepicker->getFilename();
std::string file_name = filepicker->getFilename();
mFolder = gDirUtilp->getDirName(file_name); mFolder = gDirUtilp->getDirName(file_name);
llifstream import_file(file_name); llifstream import_file(file_name);
LLSDSerialize::fromXML(mLLSD, import_file); LLSDSerialize::fromXML(mLLSD, import_file);
import_file.close(); import_file.close();
show(false);
mAgentPos = gAgent.getPositionAgent(); mAgentPos = gAgent.getPositionAgent();
mAgentRot = LLQuaternion(gAgent.getAtAxis(), gAgent.getLeftAxis(), gAgent.getUpAxis()); mAgentRot = LLQuaternion(gAgent.getAtAxis(), gAgent.getLeftAxis(), gAgent.getUpAxis());
@@ -770,17 +848,6 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker)
mObjects = mLLSD["data"].size(); mObjects = mLLSD["data"].size();
mPrims = 0; mPrims = 0;
mRezCount = 0; mRezCount = 0;
if (mObjects <= 0) {
LLSD args;
args["MESSAGE"] = std::string("Object import failed.\nThe XML file has an incompatible format or does not contain any objects.");
LLNotifications::instance().add("GenericAlert", args);
llwarns << "Trying to import illegal XML object file." << llendl;
return;
}
show(false);
updateImportNumbers(); updateImportNumbers();
for (prim_arr_it = mLLSD["data"].beginArray(); prim_arr_it != mLLSD["data"].endArray(); prim_arr_it++) for (prim_arr_it = mLLSD["data"].beginArray(); prim_arr_it != mLLSD["data"].endArray(); prim_arr_it++)
@@ -806,7 +873,7 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker)
} }
if (alreadyseen == false) if (alreadyseen == false)
{ {
llinfos << "Found a new SCULPT texture to upload " << orig << llendl; LL_INFOS("ObjectBackup") << "Found a new SCULPT texture to upload " << orig << LL_ENDL;
mTexturesList.push_back(orig); mTexturesList.push_back(orig);
} }
} }
@@ -819,18 +886,21 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker)
LLTextureEntry te; LLTextureEntry te;
te.fromLLSD(the_te); te.fromLLSD(the_te);
te.getID(); LLUUID id = te.getID();
bool alreadyseen = false; if (id != LL_TEXTURE_PLYWOOD && id != LL_TEXTURE_BLANK && id != LL_TEXTURE_INVISIBLE) // Do not upload the default textures
{
bool alreadyseen = false;
for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++) for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++)
{ {
if ((*iter) == te.getID()) if ((*iter) == te.getID())
alreadyseen = true; alreadyseen = true;
} }
if (alreadyseen == false) if (alreadyseen == false)
{ {
llinfos << "Found a new texture to upload "<< te.getID() << llendl; LL_INFOS("ObjectBackup") << "Found a new texture to upload "<< te.getID() << LL_ENDL;
mTexturesList.push_back(te.getID()); mTexturesList.push_back(te.getID());
}
} }
} }
} }
@@ -970,7 +1040,7 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object)
} }
// Textures // Textures
llinfos << "Processing textures for prim" << llendl; LL_INFOS("ObjectBackup") << "Processing textures for prim" << LL_ENDL;
LLSD te_llsd = prim_llsd["textures"]; LLSD te_llsd = prim_llsd["textures"];
LLSD::array_iterator text_it; LLSD::array_iterator text_it;
U8 i = 0; U8 i = 0;
@@ -990,7 +1060,7 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object)
object->setTE(i++, te); object->setTE(i++, te);
} }
llinfos << "Textures done !" << llendl; LL_INFOS("ObjectBackup") << "Textures done !" << LL_ENDL;
//bump the iterator now so the callbacks hook together nicely //bump the iterator now so the callbacks hook together nicely
//if (mPrimImportIter != mThisGroup.endMap()) //if (mPrimImportIter != mThisGroup.endMap())
@@ -1023,7 +1093,7 @@ void LLObjectBackup::primUpdate(LLViewerObject* object)
if (mPrimImportIter == mThisGroup.endMap()) if (mPrimImportIter == mThisGroup.endMap())
{ {
llinfos << "Trying to link" << llendl; LL_INFOS("ObjectBackup") << "Trying to link" << LL_ENDL;
if (mToSelect.size() > 1) if (mToSelect.size() > 1)
{ {
@@ -1053,7 +1123,7 @@ void LLObjectBackup::primUpdate(LLViewerObject* object)
if (mToSelect.empty()) if (mToSelect.empty())
{ {
llwarns << "error: ran out of objects to mod." << llendl; LL_WARNS("ObjectBackup") << "error: ran out of objects to mod." << LL_ENDL;
return; return;
} }
@@ -1085,7 +1155,7 @@ bool LLObjectBackup::newPrim(LLViewerObject* pobject)
} }
else else
{ {
llinfos << "All prims rezzed, moving to build stage" << llendl; LL_INFOS("ObjectBackup") << "All prims rezzed, moving to build stage" << LL_ENDL;
// Deselecting is required to ensure that the first child prim // Deselecting is required to ensure that the first child prim
// in the link set (which is also the last rezzed prim and thus // in the link set (which is also the last rezzed prim and thus
// currently selected) will be properly renamed and desced. // currently selected) will be properly renamed and desced.
@@ -1104,7 +1174,7 @@ void LLObjectBackup::updateMap(LLUUID uploaded_asset)
if (mCurrentAsset.isNull()) if (mCurrentAsset.isNull())
return; return;
llinfos << "Mapping " << mCurrentAsset << " to " << uploaded_asset << llendl; LL_INFOS("ObjectBackup") << "Mapping " << mCurrentAsset << " to " << uploaded_asset << LL_ENDL;
mAssetMap.insert(std::pair<LLUUID, LLUUID>(mCurrentAsset, uploaded_asset)); mAssetMap.insert(std::pair<LLUUID, LLUUID>(mCurrentAsset, uploaded_asset));
} }
@@ -1140,13 +1210,13 @@ void myupload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_
std::ostringstream llsdxml; std::ostringstream llsdxml;
LLSDSerialize::toXML(body, llsdxml); LLSDSerialize::toXML(body, llsdxml);
lldebugs << "posting body to capability: " << llsdxml.str() << llendl; LL_DEBUGS("ObjectBackup") << "posting body to capability: " << llsdxml.str() << LL_ENDL;
//LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); //LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type));
LLHTTPClient::post(url, body, new importResponder(body, uuid, asset_type)); LLHTTPClient::post(url, body, new importResponder(body, uuid, asset_type));
} }
else else
{ {
llinfos << "NewAgentInventory capability not found. Can't upload !" << llendl; LL_INFOS("ObjectBackup") << "NewAgentInventory capability not found. Can't upload !" << LL_ENDL;
} }
} }
@@ -1154,7 +1224,7 @@ void LLObjectBackup::uploadNextAsset()
{ {
if (mTexturesList.empty()) if (mTexturesList.empty())
{ {
llinfos << "Texture list is empty, moving to rez stage." << llendl; LL_INFOS("ObjectBackup") << "Texture list is empty, moving to rez stage." << LL_ENDL;
mCurrentAsset = LLUUID::null; mCurrentAsset = LLUUID::null;
importFirstObject(); importFirstObject();
return; return;
@@ -1167,7 +1237,7 @@ void LLObjectBackup::uploadNextAsset()
LLUUID id = *iter; LLUUID id = *iter;
mTexturesList.pop_front(); mTexturesList.pop_front();
llinfos << "Got texture ID " << id << ": trying to upload" << llendl; LL_INFOS("ObjectBackup") << "Got texture ID " << id << ": trying to upload" << LL_ENDL;
mCurrentAsset = id; mCurrentAsset = id;
std::string struid; std::string struid;
@@ -1182,7 +1252,7 @@ void LLObjectBackup::uploadNextAsset()
S32 file_size; S32 file_size;
LLAPRFile outfile; LLAPRFile outfile;
outfile.open(filename, LL_APR_RB, LLAPRFile::global, &file_size); outfile.open(filename, LL_APR_RB, LLAPRFile::local, &file_size);
if (outfile.getFileHandle()) if (outfile.getFileHandle())
{ {
const S32 buf_size = 65536; const S32 buf_size = 65536;
@@ -1197,7 +1267,7 @@ void LLObjectBackup::uploadNextAsset()
} }
else else
{ {
llwarns << "Unable to access output file " << filename << llendl; LL_WARNS("ObjectBackup") << "Unable to access output file " << filename << LL_ENDL;
uploadNextAsset(); uploadNextAsset();
return; return;
} }

View File

@@ -107,7 +107,7 @@ private:
LLUUID validateTextureID(LLUUID asset_id); LLUUID validateTextureID(LLUUID asset_id);
// Convert a selection list of objects to LLSD // Convert a selection list of objects to LLSD
LLSD primsToLLSD(LLViewerObject::child_list_t child_list); LLSD primsToLLSD(LLViewerObject::child_list_t child_list, bool is_attachment);
// Start the import process // Start the import process
void importFirstObject(); void importFirstObject();
@@ -176,3 +176,4 @@ private:
LLVector3 mAgentPos; LLVector3 mAgentPos;
LLQuaternion mAgentRot; LLQuaternion mAgentRot;
}; };

View File

@@ -1163,7 +1163,7 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary
// AND the CRC matches. JC // AND the CRC matches. JC
LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc) LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc)
{ {
llassert(mCacheLoaded); //llassert(mCacheLoaded); unnecessary and annoyijng, davep agrees
LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL); LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL);

View File

@@ -1094,8 +1094,12 @@ const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons.
S32 LLViewerTextureList::getMinVideoRamSetting() S32 LLViewerTextureList::getMinVideoRamSetting()
{ {
S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped());
//min texture mem sets to 64M if total physical mem is more than 1.5GB if (system_ram > 2000)
return (system_ram > 1500) ? 64 : MIN_VIDEO_RAM_IN_MEGA_BYTES ; return 128;
else if (system_ram > 1000)
return 64;
else
return MIN_VIDEO_RAM_IN_MEGA_BYTES;
} }
//static //static

View File

@@ -3523,9 +3523,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
} }
// check attachments for nameplate override // check attachments for nameplate override
static const LLCachedControl<bool> allow_nameplate_override ("CCSAllowNameplateOverride", true);
std::string nameplate; std::string nameplate;
attachment_map_t::iterator it, end=mAttachmentPoints.end(); attachment_map_t::iterator it, end=mAttachmentPoints.end();
for (it=mAttachmentPoints.begin(); it!=end; ++it) { if (allow_nameplate_override) for (it=mAttachmentPoints.begin(); it!=end; ++it) {
// get attached object // get attached object
LLViewerJointAttachment *atm = it->second; LLViewerJointAttachment *atm = it->second;
if (!atm) continue; if (!atm) continue;
@@ -8417,6 +8418,22 @@ void LLVOAvatar::setCompositeUpdatesEnabled( BOOL b )
} }
} }
void LLVOAvatar::setNameFromChat(const std::string &text) {
static const LLCachedControl<bool> allow_nameplate_override ("CCSAllowNameplateOverride", true);
if(allow_nameplate_override) {
mNameFromChatOverride = true;
mNameFromChatChanged = true;
mNameFromChatText = text;
}
}
void LLVOAvatar::clearNameFromChat() {
mNameFromChatOverride = false;
mNameFromChatChanged = true;
mNameFromChatText = "";
}
void LLVOAvatar::addChat(const LLChat& chat) void LLVOAvatar::addChat(const LLChat& chat)
{ {
std::deque<LLChat>::iterator chat_iter; std::deque<LLChat>::iterator chat_iter;

View File

@@ -559,8 +559,8 @@ public:
void setCompositeUpdatesEnabled(BOOL b); void setCompositeUpdatesEnabled(BOOL b);
void setNameFromChat(const std::string &text) { mNameFromChatOverride = mNameFromChatChanged = true; mNameFromChatText = text; } void setNameFromChat(const std::string &text);
void clearNameFromChat() { mNameFromChatOverride = false; mNameFromChatChanged = true; mNameFromChatText = ""; } void clearNameFromChat();
public: public:

View File

@@ -298,6 +298,11 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm)); mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm));
if((mWaterPlane.mV[3] >= 0.f) == LLViewerCamera::getInstance()->cameraUnderWater()) //Sign borkage..
{
mWaterPlane.scaleVec(LLVector4(-1.f,-1.f,-1.f,-1.f));
}
LLVector3 sunMoonDir; LLVector3 sunMoonDir;
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS) if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
{ {

View File

@@ -39,8 +39,8 @@
</string> </string>
<button bottom="-40" follows="left|top" height="20" label="Profile" left="5" <button bottom="-40" follows="left|top" height="20" label="Profile" left="5"
name="profile_callee_btn" width="80" /> name="profile_callee_btn" width="80" />
<!--button bottom="-40" follows="left|top" halign="center" height="20" label="Teleport" left_delta="80" <button bottom="-40" follows="left|top" halign="center" height="20" label="Teleport" left_delta="80"
name="profile_tele_btn" width="80" /--> name="profile_tele_btn" width="80" />
<button bottom="-40" follows="left|top" halign="center" height="20" label="History" left_delta="80" <button bottom="-40" follows="left|top" halign="center" height="20" label="History" left_delta="80"
name="history_btn" visible="true" width="80" /> name="history_btn" visible="true" width="80" />
<check_box bottom="-40" follows="left|top" halign="center" height="20" left_delta="80" <check_box bottom="-40" follows="left|top" halign="center" height="20" left_delta="80"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
rect_control="FloaterObjectBackuptRect"
height="80" width="200" name="Import" title="Import progress" mouse_opaque="true">
<text height="30" left="10" name="name_label" top="-20"> Progress </text>
</floater>

View File

@@ -632,7 +632,7 @@
text_enabled_color="0, 100, 40, 255" width="87" /> text_enabled_color="0, 100, 40, 255" width="87" />
<spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16" <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
increment="0.01" initial_val="0" label="Z" label_width="10" left_delta="0" increment="0.01" initial_val="0" label="Z" label_width="10" left_delta="0"
max_val="4096" min_val="0" mouse_opaque="true" name="Pos Z" max_val="4096" min_val="-3.5" mouse_opaque="true" name="Pos Z"
text_enabled_color="0, 67, 132, 255" width="87" /> text_enabled_color="0, 67, 132, 255" width="87" />
<button bottom_delta="35" follows="top|right" font="SansSerifSmall" halign="center" <button bottom_delta="35" follows="top|right" font="SansSerifSmall" halign="center"
height="18" label="C" left_delta="90" mouse_opaque="true" name="copypos" enabled="true" height="18" label="C" left_delta="90" mouse_opaque="true" name="copypos" enabled="true"

View File

@@ -85,9 +85,6 @@ class ViewerManifest(LLManifest):
self.path("*.png") self.path("*.png")
self.path("textures.xml") self.path("textures.xml")
self.end_prefix("default/textures") self.end_prefix("default/textures")
self.exclude("default/xui/en_us/mime_types_windows.xml")
self.exclude("default/xui/en_us/mime_types_mac.xml")
self.exclude("default/xui/en_us/mime_types_linux.xml")
self.path("default/xui/*/*.xml") self.path("default/xui/*/*.xml")
self.path("Default.xml") self.path("Default.xml")
self.path("default/*.xml") self.path("default/*.xml")
@@ -269,9 +266,6 @@ class WindowsManifest(ViewerManifest):
self.path("qtwcodecs4.dll") self.path("qtwcodecs4.dll")
self.end_prefix() self.end_prefix()
# Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
self.path("skins/default/xui/en-us/mime_types_windows.xml", "skins/default/xui/en-us/mime_types.xml")
# Get llcommon and deps. If missing assume static linkage and continue. # Get llcommon and deps. If missing assume static linkage and continue.
if self.prefix(src=self.args['configuration'], dst=""): if self.prefix(src=self.args['configuration'], dst=""):
try: try:
@@ -461,10 +455,10 @@ class DarwinManifest(ViewerManifest):
# copy additional libs in <bundle>/Contents/MacOS/ # copy additional libs in <bundle>/Contents/MacOS/
self.path("../../libraries/universal-darwin/lib_release/libhunspell-1.2.dylib", dst="MacOS/libhunspell-1.2.dylib") self.path("../../libraries/universal-darwin/lib_release/libhunspell-1.2.dylib", dst="MacOS/libhunspell-1.2.dylib")
self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib") self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib")
self.path("../../libraries/universal-darwin/lib_release/libvorbisenc.2.dylib", dst="MacOS/libvorbisenc.2.dylib") #self.path("../../libraries/universal-darwin/lib_release/libvorbisenc.2.dylib", dst="MacOS/libvorbisenc.2.dylib")
self.path("../../libraries/universal-darwin/lib_release/libvorbisfile.3.dylib", dst="MacOS/libvorbisfile.3.dylib") #self.path("../../libraries/universal-darwin/lib_release/libvorbisfile.3.dylib", dst="MacOS/libvorbisfile.3.dylib")
self.path("../../libraries/universal-darwin/lib_release/libvorbis.0.dylib", dst="MacOS/libvorbis.0.dylib") #self.path("../../libraries/universal-darwin/lib_release/libvorbis.0.dylib", dst="MacOS/libvorbis.0.dylib")
self.path("../../libraries/universal-darwin/lib_release/libogg.0.dylib", dst="MacOS/libogg.0.dylib") #self.path("../../libraries/universal-darwin/lib_release/libogg.0.dylib", dst="MacOS/libogg.0.dylib")
# most everything goes in the Resources directory # most everything goes in the Resources directory
if self.prefix(src="", dst="Resources"): if self.prefix(src="", dst="Resources"):
@@ -520,8 +514,11 @@ class DarwinManifest(ViewerManifest):
self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib") self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
# our apps # our apps
self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app") try:
#self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app") self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
except:
pass
# plugin launcher # plugin launcher
self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin.app", "SLPlugin.app") self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin.app", "SLPlugin.app")
@@ -534,14 +531,14 @@ class DarwinManifest(ViewerManifest):
"libaprutil-1.0.3.8.dylib", "libaprutil-1.0.3.8.dylib",
"libexpat.0.5.0.dylib"): "libexpat.0.5.0.dylib"):
target_lib = os.path.join('../../..', libfile) target_lib = os.path.join('../../..', libfile)
self.run_command("ln -sf %(target)r %(link)r" %
{'target': target_lib,
'link' : os.path.join(mac_crash_logger_res_path, libfile)}
)
self.run_command("ln -sf %(target)r %(link)r" % self.run_command("ln -sf %(target)r %(link)r" %
{'target': target_lib, {'target': target_lib,
'link' : os.path.join(slplugin_res_path, libfile)} 'link' : os.path.join(slplugin_res_path, libfile)}
) )
#self.run_command("ln -sf %(target)r %(link)r" %
# {'target': target_lib,
# 'link' : os.path.join(mac_crash_logger_res_path, libfile)}
# )
# plugins # plugins
if self.prefix(src="", dst="llplugin"): if self.prefix(src="", dst="llplugin"):
@@ -552,9 +549,6 @@ class DarwinManifest(ViewerManifest):
self.end_prefix("llplugin") self.end_prefix("llplugin")
# Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
self.path("skins/default/xui/en-us/mime_types_mac.xml", "skins/default/xui/en-us/mime_types.xml")
# command line arguments for connecting to the proper grid # command line arguments for connecting to the proper grid
self.put_in_file(self.flags_list(), 'arguments.txt') self.put_in_file(self.flags_list(), 'arguments.txt')
@@ -707,9 +701,6 @@ class LinuxManifest(ViewerManifest):
self.path("../plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") self.path("../plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
self.end_prefix("bin/llplugin") self.end_prefix("bin/llplugin")
# Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
self.path("skins/default/xui/en-us/mime_types_linux.xml", "skins/default/xui/en-us/mime_types.xml")
self.path("featuretable_linux.txt") self.path("featuretable_linux.txt")
def wrapper_name(self): def wrapper_name(self):

View File

@@ -63,12 +63,21 @@ else (WINDOWS)
set(WINDOWS_API_LIBRARIES "") set(WINDOWS_API_LIBRARIES "")
endif (WINDOWS) endif (WINDOWS)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(APPKIT_LIBRARY AppKit)
find_library(CARBON_LIBRARY Carbon)
find_library(IOKIT_LIBRARY IOKit)
set(OSX_FILE_LIBRARIES ${APPKIT_LIBRARY} ${CARBON_LIBRARY} ${IOKIT_LIBRARY})
endif (DARWIN)
target_link_libraries(basic_plugin_filepicker target_link_libraries(basic_plugin_filepicker
${LLPLUGIN_LIBRARIES} ${LLPLUGIN_LIBRARIES}
${LLCOMMON_LIBRARIES} ${LLCOMMON_LIBRARIES}
${BASIC_PLUGIN_BASE_LIBRARIES} ${BASIC_PLUGIN_BASE_LIBRARIES}
${UI_LIBRARIES} ${UI_LIBRARIES}
${WINDOWS_API_LIBRARIES} ${WINDOWS_API_LIBRARIES}
${OSX_FILE_LIBRARIES}
) )
add_dependencies(basic_plugin_filepicker add_dependencies(basic_plugin_filepicker

View File

@@ -189,16 +189,12 @@ OSStatus LLDirPicker::doNavChooseDialog()
error = NavCreateChooseFolderDialog(&mNavOptions, &doNavCallbackEvent, NULL, NULL, &navRef); error = NavCreateChooseFolderDialog(&mNavOptions, &doNavCallbackEvent, NULL, NULL, &navRef);
gViewerWindow->mWindow->beforeDialog();
if (error == noErr) if (error == noErr)
{ {
PLS_FLUSH; PLS_FLUSH;
error = NavDialogRun(navRef); error = NavDialogRun(navRef);
} }
gViewerWindow->mWindow->afterDialog();
if (error == noErr) if (error == noErr)
error = NavDialogGetReply(navRef, &navReply); error = NavDialogGetReply(navRef, &navReply);
@@ -232,7 +228,7 @@ BOOL LLDirPicker::getDir(std::string const& folder)
BOOL success = FALSE; BOOL success = FALSE;
OSStatus error = noErr; OSStatus error = noErr;
mFileName = folder; mFileName = const_cast<std::string*>(&folder);
// mNavOptions.saveFileName // mNavOptions.saveFileName

View File

@@ -761,7 +761,7 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
} }
else if (filter == FFLOAD_XML) else if (filter == FFLOAD_XML)
{ {
if (fileInfo.filetype != 'XML' && if (fileInfo.filetype != 'XML ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("xml"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("xml"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
) )
{ {
@@ -785,7 +785,7 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
} }
else if (filter == FFLOAD_RAW) else if (filter == FFLOAD_RAW)
{ {
if (fileInfo.filetype != L'\?\?\?\?' && if (fileInfo.filetype != '\?\?\?\?' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("raw"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("raw"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
) )
{ {
@@ -952,14 +952,14 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const
extension = CFSTR(".png"); extension = CFSTR(".png");
break; break;
case FFSAVE_AVI: case FFSAVE_AVI:
type = L'\?\?\?\?'; type = '\?\?\?\?';
creator = L'\?\?\?\?'; creator = '\?\?\?\?';
extension = CFSTR(".mov"); extension = CFSTR(".mov");
break; break;
case FFSAVE_ANIM: case FFSAVE_ANIM:
type = L'\?\?\?\?'; type = '\?\?\?\?';
creator = L'\?\?\?\?'; creator = '\?\?\?\?';
extension = CFSTR(".xaf"); extension = CFSTR(".xaf");
break; break;
@@ -971,26 +971,26 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const
break; break;
#endif #endif
case FFSAVE_RAW: case FFSAVE_RAW:
type = L'\?\?\?\?'; type = '\?\?\?\?';
creator = L'\?\?\?\?'; creator = '\?\?\?\?';
extension = CFSTR(".raw"); extension = CFSTR(".raw");
break; break;
case FFSAVE_J2C: case FFSAVE_J2C:
type = L'\?\?\?\?'; type = '\?\?\?\?';
creator = 'prvw'; creator = 'prvw';
extension = CFSTR(".j2c"); extension = CFSTR(".j2c");
break; break;
case FFSAVE_ALL: case FFSAVE_ALL:
default: default:
type = L'\?\?\?\?'; type = '\?\?\?\?';
creator = L'\?\?\?\?'; creator = '\?\?\?\?';
extension = CFSTR(""); extension = CFSTR("");
break; break;
} }
NavEventUPP eventUPP = NewNavEventUPP(navSetDefaultFolderProc); NavEventUPP eventUPP = NewNavEventUPP(NULL); //TODO: test filepicker
mFolder = folder; mFolder = folder;
// Create the dialog // Create the dialog

View File

@@ -39,6 +39,7 @@
#ifndef LL_LLFILEPICKER_H #ifndef LL_LLFILEPICKER_H
#define LL_LLFILEPICKER_H #define LL_LLFILEPICKER_H
#include "basic_plugin_base.h" // For PLS_INFOS etc.
#include "legacy.h" #include "legacy.h"
#include <vector> #include <vector>
@@ -163,10 +164,10 @@ private:
#if LL_DARWIN #if LL_DARWIN
NavDialogCreationOptions mNavOptions; NavDialogCreationOptions mNavOptions;
OSStatus doNavChooseDialog(ELoadFilter filter); OSStatus doNavChooseDialog(ELoadFilter filter, const std::string& folder);
OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename); OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename, const std::string& folder);
static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode);
static pascal void LLFilePickerBase::doNavCallbackEvent(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void* callBackUD); static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void* callBackUD);
ELoadFilter getLoadFilter(void) const { return mLoadFilter; } ELoadFilter getLoadFilter(void) const { return mLoadFilter; }
std::string const& getFolder(void) const { return mFolder; } std::string const& getFolder(void) const { return mFolder; }
#endif // LL_DARWIN #endif // LL_DARWIN
@@ -189,6 +190,7 @@ public:
#endif // LL_GTK #endif // LL_GTK
#if !LL_WINDOWS && !(LL_GTK && LL_X11) #if !LL_WINDOWS && !(LL_GTK && LL_X11)
public:
void setWindowID(unsigned long window_id) { PLS_WARNS << "Calling unimplemented LLFilePickerBase::setWindowID" << PLS_ENDL; } void setWindowID(unsigned long window_id) { PLS_WARNS << "Calling unimplemented LLFilePickerBase::setWindowID" << PLS_ENDL; }
#endif #endif