diff options
Diffstat (limited to 'linden/indra/newview/llsurface.cpp')
-rw-r--r-- | linden/indra/newview/llsurface.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp index aaafe0d..5a99e66 100644 --- a/linden/indra/newview/llsurface.cpp +++ b/linden/indra/newview/llsurface.cpp | |||
@@ -303,7 +303,7 @@ void LLSurface::initTextures() | |||
303 | mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); | 303 | mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); |
304 | gPipeline.createObject(mWaterObjp); | 304 | gPipeline.createObject(mWaterObjp); |
305 | LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle()); | 305 | LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle()); |
306 | water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); | 306 | water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT); |
307 | mWaterObjp->setPositionGlobal(water_pos_global); | 307 | mWaterObjp->setPositionGlobal(water_pos_global); |
308 | } | 308 | } |
309 | } | 309 | } |
@@ -356,8 +356,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global) | |||
356 | // Hack! | 356 | // Hack! |
357 | if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) | 357 | if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) |
358 | { | 358 | { |
359 | const F64 x = origin_global.mdV[VX] + 128.0; | 359 | const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2; |
360 | const F64 y = origin_global.mdV[VY] + 128.0; | 360 | const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2; |
361 | const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; | 361 | const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; |
362 | 362 | ||
363 | LLVector3d water_origin_global(x, y, z); | 363 | LLVector3d water_origin_global(x, y, z); |
@@ -707,14 +707,22 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL | |||
707 | 707 | ||
708 | while (1) | 708 | while (1) |
709 | { | 709 | { |
710 | decode_patch_header(bitpack, &ph); | 710 | decode_patch_header(bitpack, &ph, b_large_patch); |
711 | if (ph.quant_wbits == END_OF_PATCHES) | 711 | if (ph.quant_wbits == END_OF_PATCHES) |
712 | { | 712 | { |
713 | break; | 713 | break; |
714 | } | 714 | } |
715 | 715 | ||
716 | i = ph.patchids >> 5; | 716 | if (b_large_patch) |
717 | j = ph.patchids & 0x1F; | 717 | { |
718 | i = ph.patchids >> 16; //x | ||
719 | j = ph.patchids & 0xFFFF; //y | ||
720 | } | ||
721 | else | ||
722 | { | ||
723 | i = ph.patchids >> 5; //x | ||
724 | j = ph.patchids & 0x1F; //y | ||
725 | } | ||
718 | 726 | ||
719 | if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) | 727 | if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) |
720 | { | 728 | { |