From 453a613b6431060d7086290b54fde4ab14bc7b4a Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Wed, 26 May 2010 16:25:27 +0100 Subject: LightShare: Add proper decoding of the water normal map UUID --- linden/indra/newview/llviewergenericmessage.cpp | 27 ++++++++++++++++++++++++- linden/indra/newview/meta7windlight.h | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/linden/indra/newview/llviewergenericmessage.cpp b/linden/indra/newview/llviewergenericmessage.cpp index 84f464f..c9954b3 100644 --- a/linden/indra/newview/llviewergenericmessage.cpp +++ b/linden/indra/newview/llviewergenericmessage.cpp @@ -88,6 +88,7 @@ void process_generic_message(LLMessageSystem* msg, void**) std::string method; msg->getStringFast(_PREHASH_MethodData, _PREHASH_Method, method); + //This needs to be handled by a dispatcher really, but I'm not sure where is the best place to put it if (method == "Windlight" && gSavedSettings.getBOOL("UseServersideWindlightSettings")) { //Meta7 WindLight packet @@ -121,8 +122,32 @@ void process_generic_message(LLMessageSystem* msg, void**) param_set.set("blurMultiplier", wl->blurMultiplier); param_set.set("wave1Dir", wl->littleWaveDirection.X, wl->littleWaveDirection.Y); param_set.set("wave2Dir", wl->bigWaveDirection.X, wl->bigWaveDirection.Y); - + + LLUUID normalMapTexture; + + std::string out = llformat( + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + (U8)(wl->normalMapTexture[0]), + (U8)(wl->normalMapTexture[1]), + (U8)(wl->normalMapTexture[2]), + (U8)(wl->normalMapTexture[3]), + (U8)(wl->normalMapTexture[4]), + (U8)(wl->normalMapTexture[5]), + (U8)(wl->normalMapTexture[6]), + (U8)(wl->normalMapTexture[7]), + (U8)(wl->normalMapTexture[8]), + (U8)(wl->normalMapTexture[9]), + (U8)(wl->normalMapTexture[10]), + (U8)(wl->normalMapTexture[11]), + (U8)(wl->normalMapTexture[12]), + (U8)(wl->normalMapTexture[13]), + (U8)(wl->normalMapTexture[14]), + (U8)(wl->normalMapTexture[15])); + + normalMapTexture.set(out); + param_mgr->setParamSet( "Meta7CurrentRegion", param_set); + param_mgr->setNormalMapID(normalMapTexture); LLWLParamManager * wl_param_mgr = LLWLParamManager::instance(); LLWLParamSet & wl_param_set = wl_param_mgr->mCurParams; diff --git a/linden/indra/newview/meta7windlight.h b/linden/indra/newview/meta7windlight.h index 9bbdf69..9927558 100644 --- a/linden/indra/newview/meta7windlight.h +++ b/linden/indra/newview/meta7windlight.h @@ -65,7 +65,7 @@ struct Meta7WindlightPacket { F32 blurMultiplier; M7Vector2 littleWaveDirection; M7Vector2 bigWaveDirection; - LLUUID normalMapTexture; + unsigned char normalMapTexture[16]; M7Color4 horizon; F32 hazeHorizon; M7Color4 blueDensity; -- cgit v1.1