Variable size region support, by RevolutionSmythe

This commit is contained in:
Siana Gearz
2011-08-04 22:20:25 +02:00
parent 87070be7e3
commit 174a33beb3
24 changed files with 159 additions and 50 deletions

View File

@@ -370,6 +370,8 @@ bool idle_startup()
static U64 first_sim_handle = 0;
static LLHost first_sim;
static std::string first_sim_seed_cap;
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
@@ -1657,7 +1659,17 @@ bool idle_startup()
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
first_sim_handle = 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())
{
@@ -1946,7 +1958,7 @@ bool idle_startup()
gAgent.initOriginGlobal(from_region_handle(first_sim_handle));
LLWorld::getInstance()->addRegion(first_sim_handle, first_sim);
LLWorld::getInstance()->addRegion(first_sim_handle, first_sim, first_sim_size_x, first_sim_size_y);
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;