Variable Size Regions! Support for prehash RegionSizeX and large patches. (WIP)
Mostly from Ukando, tweaked a bit to be cleaner, and a little less dramatic. decode_patch_header now takes a bool optionally, as third argument. _PREHASH_RegionSizeX is the only used of the two _PREHASH_RegionSize*. llsurface.cpp: Copy the connectNeighbor for variable size regions almost directly from Ukando llsurfacepatch.cpp: Patch code from ukando and voodoo. Changed hardcoded 256 constants and such to width functions in: llglsandbox.cpp, llsurface.cpp, llviewerregion.cpp, llviewerparcelmanager, llviewerparcelmgr.cpp, llvowater.cpp, llworld.cpp Use region specific width in: llagent.cpp, llglsandbox.cpp, llmanip.cpp, llmanipscale.cpp, llpanelobject.cpp, llviewerbject.cpp, llwind.cpp Use 256 in llnetmap.cpp in places... llfloaterregioninfo.cpp: Aurora grid has wacky textures. Add LLViewerParcelMgr::widthUpdate() for updating mParcelsPerEdge given a region's width. Used in llstartup now. Add LLWorld::setWidth() for getting a region's size from LLMessageSystem pointers and setting mWidth and mWidthInMeters, accordingly. Called in llviewermessage.cpp as well.
This commit is contained in:
@@ -229,7 +229,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp)
|
||||
gPatchSize = gopp->patch_size;
|
||||
}
|
||||
|
||||
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
|
||||
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch)
|
||||
{
|
||||
U8 retvalu8;
|
||||
|
||||
@@ -268,15 +268,28 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
|
||||
#endif
|
||||
ph->range = retvalu16;
|
||||
|
||||
retvalu16 = 0;
|
||||
retvalu32 = 0;
|
||||
#ifdef LL_BIG_ENDIAN
|
||||
ret = (U8 *)&retvalu16;
|
||||
bitpack.bitUnpack(&(ret[1]), 8);
|
||||
bitpack.bitUnpack(&(ret[0]), 2);
|
||||
ret = (U8*)&retvalu32;
|
||||
if (b_large_patch)
|
||||
{
|
||||
bitpack.bitUnpack(&(ret[3]), 8);
|
||||
bitpack.bitUnpack(&(ret[2]), 8);
|
||||
bitpack.bitUnpack(&(ret[1]), 8);
|
||||
bitpack.bitUnpack(&(ret[0]), 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
bitpack.bitUnpack(&(ret[1]), 8);
|
||||
bitpack.bitUnpack(&(ret[0]), 2);
|
||||
}
|
||||
#else
|
||||
bitpack.bitUnpack((U8 *)&retvalu16, 10);
|
||||
if (b_large_patch)
|
||||
bitpack.bitUnpack((U8*)&retvalu32, 32);
|
||||
else
|
||||
bitpack.bitUnpack((U8*)&retvalu32, 10);
|
||||
#endif
|
||||
ph->patchids = retvalu16;
|
||||
ph->patchids = retvalu32;
|
||||
|
||||
gWordBits = (ph->quant_wbits & 0xf) + 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user