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:
@@ -105,7 +105,7 @@ LLNetMap::LLNetMap(const std::string& name) :
|
||||
mUpdateNow( FALSE )
|
||||
{
|
||||
mScale = gSavedSettings.getF32("MiniMapScale");
|
||||
mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
mPixelsPerMeter = mScale / REGION_WIDTH_METERS;
|
||||
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
|
||||
|
||||
mObjectImageCenterGlobal = gAgentCamera.getCameraPositionGlobal();
|
||||
@@ -161,13 +161,13 @@ void LLNetMap::setScale( F32 scale )
|
||||
F32 height = (F32)(getRect().getHeight());
|
||||
F32 diameter = sqrt(width * width + height * height);
|
||||
F32 region_widths = diameter / mScale;
|
||||
F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
F32 meters = region_widths * REGION_WIDTH_METERS;
|
||||
F32 num_pixels = (F32)mObjectImagep->getWidth();
|
||||
mObjectMapTPM = num_pixels / meters;
|
||||
mObjectMapPixels = diameter;
|
||||
}
|
||||
|
||||
mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
mPixelsPerMeter = mScale / REGION_WIDTH_METERS;
|
||||
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
|
||||
|
||||
mUpdateNow = TRUE;
|
||||
@@ -262,8 +262,8 @@ void LLNetMap::draw()
|
||||
// background region rectangle
|
||||
F32 bottom = relative_y;
|
||||
F32 left = relative_x;
|
||||
F32 top = bottom + mScale ;
|
||||
F32 right = left + mScale ;
|
||||
F32 top = bottom + region_width/256 * mScale ;
|
||||
F32 right = left + region_width/256 * mScale ;
|
||||
|
||||
gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV);
|
||||
if (!regionp->isAlive())
|
||||
@@ -332,8 +332,8 @@ void LLNetMap::draw()
|
||||
|
||||
LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal);
|
||||
map_center_agent -= gAgentCamera.getCameraPositionAgent();
|
||||
map_center_agent.mV[0] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
map_center_agent.mV[1] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
map_center_agent.mV[0] *= mScale/256;
|
||||
map_center_agent.mV[1] *= mScale/256;
|
||||
|
||||
gGL.getTexUnit(0)->bind(mObjectImagep);
|
||||
F32 image_half_width = 0.5f*mObjectMapPixels;
|
||||
@@ -470,7 +470,7 @@ void LLNetMap::draw()
|
||||
dot_width);
|
||||
|
||||
// Draw frustum
|
||||
F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
F32 meters_to_pixels = mScale/ REGION_WIDTH_METERS;
|
||||
|
||||
F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect();
|
||||
F32 far_clip_meters = LLViewerCamera::getInstance()->getFar();
|
||||
@@ -597,7 +597,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated )
|
||||
pos_local.rotVec( rot );
|
||||
}
|
||||
|
||||
pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale );
|
||||
pos_local *= ( REGION_WIDTH_METERS / mScale );
|
||||
|
||||
LLVector3d pos_global;
|
||||
pos_global.setVec( pos_local );
|
||||
|
||||
Reference in New Issue
Block a user