Merge branch 'master' of git://github.com/lkalif/SingularityViewer
This commit is contained in:
@@ -1,163 +1,163 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Herv<72> Drolon, FreeImage Team
|
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef __OPJ_MALLOC_H
|
||||
#define __OPJ_MALLOC_H
|
||||
/**
|
||||
@file opj_malloc.h
|
||||
@brief Internal functions
|
||||
|
||||
The functions in opj_malloc.h are internal utilities used for memory management.
|
||||
*/
|
||||
|
||||
/** @defgroup MISC MISC - Miscellaneous internal functions */
|
||||
/*@{*/
|
||||
|
||||
/** @name Exported functions */
|
||||
/*@{*/
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
Allocate an uninitialized memory block
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_malloc(size_t size);
|
||||
#else
|
||||
#define opj_malloc(size) malloc(size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate a memory block with elements initialized to 0
|
||||
@param num Blocks to allocate
|
||||
@param size Bytes per block to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
|
||||
#else
|
||||
#define opj_calloc(num, size) calloc(num, size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate memory aligned to a 16 byte boundry
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
|
||||
#ifdef WIN32
|
||||
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
|
||||
#ifdef __GNUC__
|
||||
#include <mm_malloc.h>
|
||||
#define HAVE_MM_MALLOC
|
||||
#else /* MSVC, Intel C++ */
|
||||
#include <malloc.h>
|
||||
#ifdef _mm_malloc
|
||||
#define HAVE_MM_MALLOC
|
||||
#endif
|
||||
#endif
|
||||
#else /* Not WIN32 */
|
||||
#if defined(__sun)
|
||||
#define HAVE_MEMALIGN
|
||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||
#elif !defined(__amd64__) && !defined(__APPLE__)
|
||||
#define HAVE_MEMALIGN
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define opj_aligned_malloc(size) malloc(size)
|
||||
#define opj_aligned_free(m) free(m)
|
||||
|
||||
#ifdef HAVE_MM_MALLOC
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) _mm_free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMALIGN
|
||||
extern void* memalign(size_t, size_t);
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) memalign(16, (size))
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POSIX_MEMALIGN
|
||||
#undef opj_aligned_malloc
|
||||
extern int posix_memalign(void**, size_t, size_t);
|
||||
|
||||
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
|
||||
void* mem = NULL;
|
||||
posix_memalign(&mem, 16, size);
|
||||
return mem;
|
||||
}
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) opj_malloc(size)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) opj_free(m)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Reallocate memory blocks.
|
||||
@param memblock Pointer to previously allocated memory block
|
||||
@param size New size in bytes
|
||||
@return Returns a void pointer to the reallocated (and possibly moved) memory block
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_realloc(void * _Memory, size_t NewSize);
|
||||
#else
|
||||
#define opj_realloc(m, s) realloc(m, s)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Deallocates or frees a memory block.
|
||||
@param memblock Previously allocated memory block to be freed
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void OPJ_CALLCONV opj_free(void * _Memory);
|
||||
#else
|
||||
#define opj_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC poison malloc calloc realloc free
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif /* __OPJ_MALLOC_H */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, Herv<72> Drolon, FreeImage Team
|
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef __OPJ_MALLOC_H
|
||||
#define __OPJ_MALLOC_H
|
||||
/**
|
||||
@file opj_malloc.h
|
||||
@brief Internal functions
|
||||
|
||||
The functions in opj_malloc.h are internal utilities used for memory management.
|
||||
*/
|
||||
|
||||
/** @defgroup MISC MISC - Miscellaneous internal functions */
|
||||
/*@{*/
|
||||
|
||||
/** @name Exported functions */
|
||||
/*@{*/
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
Allocate an uninitialized memory block
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_malloc(size_t size);
|
||||
#else
|
||||
#define opj_malloc(size) malloc(size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate a memory block with elements initialized to 0
|
||||
@param num Blocks to allocate
|
||||
@param size Bytes per block to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
|
||||
#else
|
||||
#define opj_calloc(num, size) calloc(num, size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate memory aligned to a 16 byte boundry
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
|
||||
#ifdef WIN32
|
||||
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
|
||||
#ifdef __GNUC__
|
||||
#include <mm_malloc.h>
|
||||
#define HAVE_MM_MALLOC
|
||||
#else /* MSVC, Intel C++ */
|
||||
#include <malloc.h>
|
||||
#ifdef _mm_malloc
|
||||
#define HAVE_MM_MALLOC
|
||||
#endif
|
||||
#endif
|
||||
#else /* Not WIN32 */
|
||||
#if defined(__sun)
|
||||
#define HAVE_MEMALIGN
|
||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||
#elif !defined(__amd64__) && !defined(__APPLE__)
|
||||
#define HAVE_MEMALIGN
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define opj_aligned_malloc(size) malloc(size)
|
||||
#define opj_aligned_free(m) free(m)
|
||||
|
||||
#ifdef HAVE_MM_MALLOC
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) _mm_free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMALIGN
|
||||
extern void* memalign(size_t, size_t);
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) memalign(16, (size))
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POSIX_MEMALIGN
|
||||
#undef opj_aligned_malloc
|
||||
extern int posix_memalign(void**, size_t, size_t);
|
||||
|
||||
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
|
||||
void* mem = NULL;
|
||||
posix_memalign(&mem, 16, size);
|
||||
return mem;
|
||||
}
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) opj_malloc(size)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) opj_free(m)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Reallocate memory blocks.
|
||||
@param memblock Pointer to previously allocated memory block
|
||||
@param size New size in bytes
|
||||
@return Returns a void pointer to the reallocated (and possibly moved) memory block
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_realloc(void * _Memory, size_t NewSize);
|
||||
#else
|
||||
#define opj_realloc(m, s) realloc(m, s)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Deallocates or frees a memory block.
|
||||
@param memblock Previously allocated memory block to be freed
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void OPJ_CALLCONV opj_free(void * _Memory);
|
||||
#else
|
||||
#define opj_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC poison malloc calloc realloc free
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif /* __OPJ_MALLOC_H */
|
||||
|
||||
|
||||
@@ -153,11 +153,6 @@ const char LAND_LAYER_CODE = 'L';
|
||||
const char WATER_LAYER_CODE = 'W';
|
||||
const char WIND_LAYER_CODE = '7';
|
||||
const char CLOUD_LAYER_CODE = '8';
|
||||
// Extended land layer for Aurora Sim
|
||||
const char AURORA_LAND_LAYER_CODE = 'M';
|
||||
const char AURORA_WATER_LAYER_CODE = 'X';
|
||||
const char AURORA_WIND_LAYER_CODE = '9';
|
||||
const char AURORA_CLOUD_LAYER_CODE = ':';
|
||||
|
||||
// keys
|
||||
// Bit masks for various keyboard modifier keys.
|
||||
|
||||
@@ -67,7 +67,6 @@ const F32 PARCEL_PASS_HOURS_DEFAULT = 1.f;
|
||||
|
||||
// Number of "chunks" in which parcel overlay data is sent
|
||||
// Chunk 0 = southern rows, entire width
|
||||
// NOTE: NOT USABLE FOR VAR SIZED REGIONS!
|
||||
const S32 PARCEL_OVERLAY_CHUNKS = 4;
|
||||
|
||||
// Bottom three bits are a color index for the land overlay
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -235,7 +235,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp)
|
||||
gPatchSize = gopp->patch_size;
|
||||
}
|
||||
|
||||
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch)
|
||||
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
|
||||
{
|
||||
U8 retvalu8;
|
||||
|
||||
@@ -274,18 +274,15 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_pat
|
||||
#endif
|
||||
ph->range = retvalu16;
|
||||
|
||||
retvalu32 = 0;
|
||||
retvalu16 = 0;
|
||||
#ifdef LL_BIG_ENDIAN
|
||||
ret = (U8 *)&retvalu16;
|
||||
bitpack.bitUnpack(&(ret[1]), 8);
|
||||
bitpack.bitUnpack(&(ret[0]), 2);
|
||||
#else
|
||||
if (b_large_patch)
|
||||
bitpack.bitUnpack((U8 *)&retvalu32, 32);
|
||||
else
|
||||
bitpack.bitUnpack((U8 *)&retvalu32, 10);
|
||||
bitpack.bitUnpack((U8 *)&retvalu16, 10);
|
||||
#endif
|
||||
ph->patchids = retvalu32;
|
||||
ph->patchids = retvalu16;
|
||||
|
||||
gWordBits = (ph->quant_wbits & 0xf) + 2;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void end_patch_coding(LLBitPack &bitpack);
|
||||
|
||||
void init_patch_decoding(LLBitPack &bitpack);
|
||||
void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp);
|
||||
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch);
|
||||
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph);
|
||||
void decode_patch(LLBitPack &bitpack, S32 *patches);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
F32 dc_offset; // 4 bytes
|
||||
U16 range; // 2 = 7 ((S16) FP range (breaks if we need > 32K meters in 1 patch)
|
||||
U8 quant_wbits; // 1 = 8 (upper 4 bits is quant - 2, lower 4 bits is word bits - 2)
|
||||
U32 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each)
|
||||
U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each)
|
||||
};
|
||||
|
||||
// Compression routines
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -440,7 +440,7 @@ void LLCloudLayer::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
|
||||
group_headerp->stride = group_headerp->patch_size; // offset required to step up one row
|
||||
set_group_of_patch_header(group_headerp);
|
||||
|
||||
decode_patch_header(bitpack, &patch_header, FALSE);
|
||||
decode_patch_header(bitpack, &patch_header);
|
||||
decode_patch(bitpack, gBuffer);
|
||||
decompress_patch(mDensityp, gBuffer, &patch_header);
|
||||
}
|
||||
|
||||
@@ -1092,11 +1092,10 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
|
||||
llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
|
||||
|
||||
// Make sure user hasn't chosen wacky textures.
|
||||
// -Revolution Allow 'wacky' things
|
||||
//if (!validateTextureSizes())
|
||||
//{
|
||||
// return FALSE;
|
||||
//}
|
||||
if (!validateTextureSizes())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LLTextureCtrl* texture_ctrl;
|
||||
std::string buffer;
|
||||
|
||||
@@ -610,7 +610,7 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
|
||||
return;
|
||||
// HACK: At edge of last region of world, we need to make sure the region
|
||||
// resolves correctly so we can get a height value.
|
||||
const F32 BORDER = regionp->getWidth() - 0.1f;
|
||||
const F32 BORDER = REGION_WIDTH_METERS - 0.1f;
|
||||
|
||||
F32 clamped_x1 = x1;
|
||||
F32 clamped_y1 = y1;
|
||||
|
||||
@@ -377,9 +377,6 @@ bool idle_startup()
|
||||
static std::string password;
|
||||
static std::vector<const char*> requested_options;
|
||||
|
||||
static U32 first_sim_size_x = 256;
|
||||
static U32 first_sim_size_y = 256;
|
||||
|
||||
static LLVector3 initial_sun_direction(1.f, 0.f, 0.f);
|
||||
static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server
|
||||
static LLVector3 agent_start_look_at(1.0f, 0.f, 0.f);
|
||||
@@ -1681,17 +1678,7 @@ bool idle_startup()
|
||||
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
|
||||
gFirstSimHandle = to_region_handle(region_x, region_y);
|
||||
}
|
||||
|
||||
text = LLUserAuth::getInstance()->getResponse("region_size_x");
|
||||
if(!text.empty()) {
|
||||
first_sim_size_x = strtoul(text.c_str(), NULL, 10);
|
||||
LLViewerParcelMgr::getInstance()->init(first_sim_size_x);
|
||||
}
|
||||
|
||||
//region Y size is currently unused, major refactoring required. - Patrick Sapinski (2/10/2011)
|
||||
text = LLUserAuth::getInstance()->getResponse("region_size_y");
|
||||
if(!text.empty()) first_sim_size_y = strtoul(text.c_str(), NULL, 10);
|
||||
|
||||
|
||||
const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at");
|
||||
if (!look_at_str.empty())
|
||||
{
|
||||
@@ -1976,7 +1963,7 @@ bool idle_startup()
|
||||
|
||||
gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
|
||||
|
||||
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim, first_sim_size_x, first_sim_size_y);
|
||||
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
|
||||
|
||||
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
|
||||
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
|
||||
|
||||
@@ -176,7 +176,6 @@ void LLSurface::create(const S32 grids_per_edge,
|
||||
mNumberOfPatches = mPatchesPerEdge * mPatchesPerEdge;
|
||||
mMetersPerGrid = width / ((F32)(mGridsPerEdge - 1));
|
||||
mMetersPerEdge = mMetersPerGrid * (mGridsPerEdge - 1);
|
||||
sTextureSize = width;
|
||||
|
||||
mOriginGlobal.setVec(origin_global);
|
||||
|
||||
@@ -300,7 +299,7 @@ void LLSurface::initTextures()
|
||||
mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
|
||||
gPipeline.createObject(mWaterObjp);
|
||||
LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
|
||||
water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT);
|
||||
water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);
|
||||
mWaterObjp->setPositionGlobal(water_pos_global);
|
||||
}
|
||||
}
|
||||
@@ -330,8 +329,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
|
||||
// Hack!
|
||||
if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull())
|
||||
{
|
||||
const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2;
|
||||
const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2;
|
||||
const F64 x = origin_global.mdV[VX] + 128.0;
|
||||
const F64 y = origin_global.mdV[VY] + 128.0;
|
||||
const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ];
|
||||
|
||||
LLVector3d water_origin_global(x, y, z);
|
||||
@@ -692,22 +691,14 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
|
||||
|
||||
while (1)
|
||||
{
|
||||
decode_patch_header(bitpack, &ph, b_large_patch);
|
||||
decode_patch_header(bitpack, &ph);
|
||||
if (ph.quant_wbits == END_OF_PATCHES)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (b_large_patch)
|
||||
{
|
||||
i = ph.patchids >> 16; //x
|
||||
j = ph.patchids & 0xFFFF; //y
|
||||
}
|
||||
else
|
||||
{
|
||||
i = ph.patchids >> 5; //x
|
||||
j = ph.patchids & 0x1F; //y
|
||||
}
|
||||
i = ph.patchids >> 5;
|
||||
j = ph.patchids & 0x1F;
|
||||
|
||||
if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge))
|
||||
{
|
||||
|
||||
@@ -3762,18 +3762,6 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
|
||||
U32 teleport_flags;
|
||||
msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
|
||||
|
||||
U32 region_size_x = 256;
|
||||
msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x);
|
||||
|
||||
U32 region_size_y = 256;
|
||||
msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeY, region_size_y);
|
||||
|
||||
//and a little hack for Second Life compatibility
|
||||
if (region_size_y == 0 || region_size_x == 0)
|
||||
{
|
||||
region_size_x = 256;
|
||||
region_size_y = 256;
|
||||
}
|
||||
|
||||
std::string seedCap;
|
||||
msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
|
||||
@@ -3793,7 +3781,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
|
||||
|
||||
// Viewer trusts the simulator.
|
||||
gMessageSystem->enableCircuit(sim_host, TRUE);
|
||||
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
|
||||
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
|
||||
|
||||
/*
|
||||
// send camera update to new region
|
||||
@@ -4098,22 +4086,9 @@ void process_crossed_region(LLMessageSystem* msg, void**)
|
||||
std::string seedCap;
|
||||
msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap);
|
||||
|
||||
U32 region_size_x = 256;
|
||||
msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x);
|
||||
|
||||
U32 region_size_y = 256;
|
||||
msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeY, region_size_y);
|
||||
|
||||
//and a little hack for Second Life compatibility
|
||||
if (region_size_y == 0 || region_size_x == 0)
|
||||
{
|
||||
region_size_x = 256;
|
||||
region_size_y = 256;
|
||||
}
|
||||
|
||||
send_complete_agent_movement(sim_host);
|
||||
|
||||
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
|
||||
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
|
||||
regionp->setSeedCapability(seedCap);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,24 +143,21 @@ LLViewerParcelMgr::LLViewerParcelMgr()
|
||||
mAgentParcel = new LLParcel();
|
||||
mHoverParcel = new LLParcel();
|
||||
mCollisionParcel = new LLParcel();
|
||||
mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c");
|
||||
mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c");
|
||||
}
|
||||
|
||||
//moved this stuff out of the constructor and into a function that we can call again after we get the region size.
|
||||
//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes
|
||||
//on a single grid properly - Patrick Sapinski (2/10/2011)
|
||||
void LLViewerParcelMgr::init(F32 region_size)
|
||||
{
|
||||
mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS );
|
||||
mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
|
||||
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
|
||||
resetSegments(mHighlightSegments);
|
||||
|
||||
mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
|
||||
resetSegments(mCollisionSegments);
|
||||
|
||||
S32 mParcelOverLayChunks = region_size * region_size / (128 * 128);
|
||||
S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / mParcelOverLayChunks;
|
||||
// JC: Resolved a merge conflict here, eliminated
|
||||
// mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP);
|
||||
// because it is done in llviewertexturelist.cpp
|
||||
mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c");
|
||||
mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c");
|
||||
|
||||
S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS;
|
||||
sPackedOverlay = new U8[overlay_size];
|
||||
|
||||
mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge];
|
||||
@@ -1412,7 +1409,8 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
|
||||
return;
|
||||
}
|
||||
|
||||
S32 expected_size = 1024;
|
||||
S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge;
|
||||
S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS;
|
||||
if (packed_overlay_size != expected_size)
|
||||
{
|
||||
llwarns << "Got parcel overlay size " << packed_overlay_size
|
||||
|
||||
@@ -90,8 +90,6 @@ public:
|
||||
LLViewerParcelMgr();
|
||||
~LLViewerParcelMgr();
|
||||
|
||||
void init(F32 region_size);
|
||||
|
||||
static void cleanupGlobals();
|
||||
|
||||
BOOL selectionEmpty() const;
|
||||
|
||||
@@ -59,7 +59,6 @@ const U8 OVERLAY_IMG_COMPONENTS = 4;
|
||||
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
|
||||
: mRegion( region ),
|
||||
mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
|
||||
mRegionSize(S32(region_width_meters)),
|
||||
mDirty( FALSE ),
|
||||
mTimeSinceLastUpdate(),
|
||||
mOverlayTextureIdx(-1),
|
||||
@@ -414,8 +413,7 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
|
||||
{
|
||||
// Unpack the message data into the ownership array
|
||||
S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
|
||||
S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128);
|
||||
S32 chunk_size = size / mParcelOverLayChunks;
|
||||
S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS;
|
||||
|
||||
memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ private:
|
||||
LLViewerRegion* mRegion;
|
||||
|
||||
S32 mParcelGridsPerEdge;
|
||||
S32 mRegionSize;
|
||||
|
||||
LLPointer<LLViewerTexture> mTexture;
|
||||
LLPointer<LLImageRaw> mImageRaw;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -164,7 +164,7 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y,
|
||||
const F32 xyScaleInv = (1.f / xyScale);
|
||||
const F32 zScaleInv = (1.f / zScale);
|
||||
|
||||
const F32 inv_width = 1.f/256.f;
|
||||
const F32 inv_width = 1.f/mWidth;
|
||||
|
||||
// OK, for now, just have the composition value equal the height at the point.
|
||||
for (S32 j = y_begin; j < y_end; j++)
|
||||
|
||||
@@ -56,26 +56,18 @@ LLVLManager::~LLVLManager()
|
||||
|
||||
void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
|
||||
{
|
||||
if (LAND_LAYER_CODE == vl_datap->mType ||
|
||||
AURORA_LAND_LAYER_CODE == vl_datap->mType)
|
||||
if (LAND_LAYER_CODE == vl_datap->mType)
|
||||
{
|
||||
mLandBits += mesg_size * 8;
|
||||
}
|
||||
else if (WIND_LAYER_CODE == vl_datap->mType ||
|
||||
AURORA_WIND_LAYER_CODE == vl_datap->mType)
|
||||
else if (WIND_LAYER_CODE == vl_datap->mType)
|
||||
{
|
||||
mWindBits += mesg_size * 8;
|
||||
}
|
||||
else if (CLOUD_LAYER_CODE == vl_datap->mType ||
|
||||
AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
|
||||
else if (CLOUD_LAYER_CODE == vl_datap->mType)
|
||||
{
|
||||
mCloudBits += mesg_size * 8;
|
||||
}
|
||||
else if (WATER_LAYER_CODE == vl_datap->mType ||
|
||||
AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
|
||||
{
|
||||
mWaterBits += mesg_size * 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl;
|
||||
@@ -101,25 +93,15 @@ void LLVLManager::unpackData(const S32 num_packets)
|
||||
{
|
||||
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE);
|
||||
}
|
||||
else if (AURORA_LAND_LAYER_CODE == datap->mType)
|
||||
{
|
||||
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE);
|
||||
}
|
||||
else if (WIND_LAYER_CODE == datap->mType ||
|
||||
AURORA_WIND_LAYER_CODE == datap->mType)
|
||||
else if (WIND_LAYER_CODE == datap->mType)
|
||||
{
|
||||
datap->mRegionp->mWind.decompress(bit_pack, &goph);
|
||||
|
||||
}
|
||||
else if (CLOUD_LAYER_CODE == datap->mType ||
|
||||
AURORA_CLOUD_LAYER_CODE == datap->mType)
|
||||
else if (CLOUD_LAYER_CODE == datap->mType)
|
||||
{
|
||||
datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph);
|
||||
}
|
||||
else if (WATER_LAYER_CODE == datap->mType ||
|
||||
AURORA_WATER_LAYER_CODE == datap->mType)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < mPacketData.count(); i++)
|
||||
|
||||
@@ -65,7 +65,6 @@ protected:
|
||||
U32 mLandBits;
|
||||
U32 mWindBits;
|
||||
U32 mCloudBits;
|
||||
U32 mWaterBits;
|
||||
};
|
||||
|
||||
class LLVLData
|
||||
|
||||
@@ -74,7 +74,7 @@ LLVOWater::LLVOWater(const LLUUID &id,
|
||||
{
|
||||
// Terrain must draw during selection passes so it can block objects behind it.
|
||||
mbCanSelect = FALSE;
|
||||
setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); // Hack for setting scale for bounding boxes/visibility.
|
||||
setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility.
|
||||
|
||||
mUseTexture = TRUE;
|
||||
mIsEdgePatch = FALSE;
|
||||
|
||||
@@ -121,12 +121,12 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
|
||||
set_group_of_patch_header(group_headerp);
|
||||
|
||||
// X component
|
||||
decode_patch_header(bitpack, &patch_header, FALSE);
|
||||
decode_patch_header(bitpack, &patch_header);
|
||||
decode_patch(bitpack, buffer);
|
||||
decompress_patch(mVelX, buffer, &patch_header);
|
||||
|
||||
// Y component
|
||||
decode_patch_header(bitpack, &patch_header, FALSE);
|
||||
decode_patch_header(bitpack, &patch_header);
|
||||
decode_patch(bitpack, buffer);
|
||||
decompress_patch(mVelY, buffer, &patch_header);
|
||||
|
||||
|
||||
@@ -80,12 +80,12 @@ const S32 WORLD_PATCH_SIZE = 16;
|
||||
|
||||
extern LLColor4U MAX_WATER_COLOR;
|
||||
|
||||
U32 LLWorld::mWidth = 256;
|
||||
const U32 LLWorld::mWidth = 256;
|
||||
|
||||
// meters/point, therefore mWidth * mScale = meters per edge
|
||||
const F32 LLWorld::mScale = 1.f;
|
||||
|
||||
F32 LLWorld::mWidthInMeters = mWidth * mScale;
|
||||
const F32 LLWorld::mWidthInMeters = mWidth * mScale;
|
||||
|
||||
//
|
||||
// Functions
|
||||
@@ -146,7 +146,7 @@ void LLWorld::destroyClass()
|
||||
}
|
||||
|
||||
|
||||
LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y)
|
||||
LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_REGIONS);
|
||||
llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl;
|
||||
@@ -179,11 +179,9 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host,
|
||||
|
||||
U32 iindex = 0;
|
||||
U32 jindex = 0;
|
||||
mWidth = region_size_x; //MegaRegion
|
||||
mWidthInMeters = mWidth * mScale; //MegaRegion
|
||||
from_region_handle(region_handle, &iindex, &jindex);
|
||||
S32 x = (S32)(iindex/256); //MegaRegion
|
||||
S32 y = (S32)(jindex/256); //MegaRegion
|
||||
S32 x = (S32)(iindex/mWidth);
|
||||
S32 y = (S32)(jindex/mWidth);
|
||||
llinfos << "Adding new region (" << x << ":" << y << ")" << llendl;
|
||||
llinfos << "Host: " << host << llendl;
|
||||
|
||||
@@ -837,7 +835,7 @@ F32 LLWorld::getLandFarClip() const
|
||||
|
||||
void LLWorld::setLandFarClip(const F32 far_clip)
|
||||
{
|
||||
static S32 const rwidth = (S32)getRegionWidthInMeters();
|
||||
static S32 const rwidth = (S32)REGION_WIDTH_U32;
|
||||
S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth;
|
||||
S32 const n2 = (llceil(far_clip) - 1) / rwidth;
|
||||
bool need_water_objects_update = n1 != n2;
|
||||
@@ -1267,21 +1265,9 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
|
||||
// which simulator should we modify?
|
||||
LLHost sim(ip_u32, port);
|
||||
|
||||
U32 region_size_x = 256;
|
||||
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
|
||||
|
||||
U32 region_size_y = 256;
|
||||
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y);
|
||||
|
||||
if (region_size_y == 0 || region_size_x == 0)
|
||||
{
|
||||
region_size_x = 256;
|
||||
region_size_y = 256;
|
||||
}
|
||||
|
||||
// Viewer trusts the simulator.
|
||||
msg->enableCircuit(sim, TRUE);
|
||||
LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y);
|
||||
LLWorld::getInstance()->addRegion(handle, sim);
|
||||
|
||||
// give the simulator a message it can use to get ip and port
|
||||
llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
LLWorld();
|
||||
void destroyClass();
|
||||
|
||||
LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y);
|
||||
LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host);
|
||||
// safe to call if already present, does the "right thing" if
|
||||
// hosts are same, or if hosts are different, etc...
|
||||
void removeRegion(const LLHost &host);
|
||||
@@ -170,12 +170,12 @@ private:
|
||||
region_list_t mCulledRegionList;
|
||||
|
||||
// Number of points on edge
|
||||
static U32 mWidth;
|
||||
static const U32 mWidth;
|
||||
|
||||
// meters/point, therefore mWidth * mScale = meters per edge
|
||||
static const F32 mScale;
|
||||
|
||||
static F32 mWidthInMeters;
|
||||
static const F32 mWidthInMeters;
|
||||
|
||||
F32 mLandFarClip; // Far clip distance for land.
|
||||
LLPatchVertexArray mLandPatch;
|
||||
|
||||
@@ -2445,4 +2445,5 @@ osSetWindParam(string plugin, string param, float value)
|
||||
Sets value of param property for plugin module.
|
||||
(OpenSim only.)
|
||||
</string>
|
||||
<string name="Unnamed">(Unnamed)</string>
|
||||
</strings>
|
||||
|
||||
Reference in New Issue
Block a user