diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llworld.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp index 7866bf8..525195d 100644 --- a/linden/indra/newview/llworld.cpp +++ b/linden/indra/newview/llworld.cpp | |||
@@ -80,12 +80,12 @@ const S32 WORLD_PATCH_SIZE = 16; | |||
80 | 80 | ||
81 | extern LLColor4U MAX_WATER_COLOR; | 81 | extern LLColor4U MAX_WATER_COLOR; |
82 | 82 | ||
83 | const U32 LLWorld::mWidth = 256; | 83 | U32 LLWorld::mWidth = 256; |
84 | 84 | ||
85 | // meters/point, therefore mWidth * mScale = meters per edge | 85 | // meters/point, therefore mWidth * mScale = meters per edge |
86 | const F32 LLWorld::mScale = 1.f; | 86 | const F32 LLWorld::mScale = 1.f; |
87 | 87 | ||
88 | const F32 LLWorld::mWidthInMeters = mWidth * mScale; | 88 | F32 LLWorld::mWidthInMeters = mWidth * mScale; |
89 | 89 | ||
90 | // | 90 | // |
91 | // Functions | 91 | // Functions |
@@ -140,7 +140,7 @@ F32 LLWorld::getRegionMaxHeight() const | |||
140 | return gHippoLimits->getMaxHeight(); | 140 | return gHippoLimits->getMaxHeight(); |
141 | } | 141 | } |
142 | 142 | ||
143 | LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) | 143 | LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y) |
144 | { | 144 | { |
145 | LLMemType mt(LLMemType::MTYPE_REGIONS); | 145 | LLMemType mt(LLMemType::MTYPE_REGIONS); |
146 | 146 | ||
@@ -172,9 +172,11 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) | |||
172 | 172 | ||
173 | U32 iindex = 0; | 173 | U32 iindex = 0; |
174 | U32 jindex = 0; | 174 | U32 jindex = 0; |
175 | mWidth = region_size_x; | ||
176 | mWidthInMeters = mWidth * mScale; | ||
175 | from_region_handle(region_handle, &iindex, &jindex); | 177 | from_region_handle(region_handle, &iindex, &jindex); |
176 | S32 x = (S32)(iindex/mWidth); | 178 | S32 x = (S32)(iindex/256); |
177 | S32 y = (S32)(jindex/mWidth); | 179 | S32 y = (S32)(jindex/256); |
178 | llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; | 180 | llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; |
179 | llinfos << "Host: " << host << llendl; | 181 | llinfos << "Host: " << host << llendl; |
180 | 182 | ||
@@ -902,7 +904,7 @@ void LLWorld::updateWaterObjects() | |||
902 | } | 904 | } |
903 | 905 | ||
904 | // Region width in meters. | 906 | // Region width in meters. |
905 | S32 const rwidth = (S32)REGION_WIDTH_U32; | 907 | S32 const rwidth = (S32)getRegionWidthInMeters(); |
906 | 908 | ||
907 | // The distance we might see into the void | 909 | // The distance we might see into the void |
908 | // when standing on the edge of a region, in meters. | 910 | // when standing on the edge of a region, in meters. |
@@ -1256,9 +1258,20 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) | |||
1256 | // which simulator should we modify? | 1258 | // which simulator should we modify? |
1257 | LLHost sim(ip_u32, port); | 1259 | LLHost sim(ip_u32, port); |
1258 | 1260 | ||
1261 | U32 region_size_x = 256; | ||
1262 | msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x); | ||
1263 | U32 region_size_y = 256; | ||
1264 | msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y); | ||
1265 | |||
1266 | if (region_size_y == 0 || region_size_x == 0) | ||
1267 | { | ||
1268 | region_size_x = 256; | ||
1269 | region_size_y = 256; | ||
1270 | } | ||
1271 | |||
1259 | // Viewer trusts the simulator. | 1272 | // Viewer trusts the simulator. |
1260 | msg->enableCircuit(sim, TRUE); | 1273 | msg->enableCircuit(sim, TRUE); |
1261 | LLWorld::getInstance()->addRegion(handle, sim); | 1274 | LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y); |
1262 | 1275 | ||
1263 | // give the simulator a message it can use to get ip and port | 1276 | // give the simulator a message it can use to get ip and port |
1264 | llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl; | 1277 | llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl; |