configuration updates; making to build on msvc

This commit is contained in:
Perttu Ahola 2011-01-17 23:35:09 +02:00
parent 7dc6b03f31
commit a35d8dabcf
5 changed files with 40 additions and 71 deletions

@ -29,19 +29,6 @@
#map-dir = /home/palle/custom_map #map-dir = /home/palle/custom_map
# - The possible generators are:
# (Indeed you can do all of them with only "power" 8))
# H=value:
# constant <value>
# H=slope.dot(pos):
# linear <height> <slope.X> <slope.Y>
# H=slope.dot(pos^power):
# power <height> <slope.X> <slope.Y> <power>
#mapgen_heightmap_blocksize = 32
#height_randmax = constant 50.0
#height_randfactor = constant 0.6
#height_base = linear 0 0 0
#plants_amount = 1.0 #plants_amount = 1.0
#ravines_amount = 1.0 #ravines_amount = 1.0
#coal_amount = 1.0 #coal_amount = 1.0
@ -59,10 +46,6 @@
#max_block_send_distance = 5 #max_block_send_distance = 5
#max_block_generate_distance = 4 #max_block_generate_distance = 4
#disable_water_climb = true
# Note that this gets applied at map generation time
#endless_water = true
# 20 min/day # 20 min/day
#time_speed = 72 #time_speed = 72
# 4 min/day # 4 min/day

@ -41,19 +41,6 @@ void set_default_settings()
// Server stuff // Server stuff
g_settings.setDefault("creative_mode", "false"); g_settings.setDefault("creative_mode", "false");
g_settings.setDefault("haxmode", "false"); g_settings.setDefault("haxmode", "false");
/*g_settings.setDefault("heightmap_blocksize", "32");
g_settings.setDefault("height_randmax", "constant 45.0");
g_settings.setDefault("height_randfactor", "constant 0.6");
g_settings.setDefault("height_base", "linear 0 0 0");
g_settings.setDefault("plants_amount", "1.0");
g_settings.setDefault("ravines_amount", "1.0");
g_settings.setDefault("coal_amount", "1.0");*/
g_settings.setDefault("heightmap_blocksize", "16");
//g_settings.setDefault("height_randmax", "linear 0 0 30");
g_settings.setDefault("height_randmax", "linear 0.5 0 0");
//g_settings.setDefault("height_randfactor", "linear 0.50 -0.10 0");
g_settings.setDefault("height_randfactor", "linear 0.60 0 0");
g_settings.setDefault("height_base", "linear 5 0 0");
g_settings.setDefault("plants_amount", "1.0"); g_settings.setDefault("plants_amount", "1.0");
g_settings.setDefault("ravines_amount", "0"); g_settings.setDefault("ravines_amount", "0");
g_settings.setDefault("coal_amount", "1.0"); g_settings.setDefault("coal_amount", "1.0");
@ -62,9 +49,6 @@ void set_default_settings()
g_settings.setDefault("active_object_range", "2"); g_settings.setDefault("active_object_range", "2");
g_settings.setDefault("max_simultaneous_block_sends_per_client", "1"); g_settings.setDefault("max_simultaneous_block_sends_per_client", "1");
g_settings.setDefault("max_simultaneous_block_sends_server_total", "4"); g_settings.setDefault("max_simultaneous_block_sends_server_total", "4");
//g_settings.setDefault("water_moves", "true");
//g_settings.setDefault("disable_water_climb", "true");
//g_settings.setDefault("endless_water", "true");
g_settings.setDefault("max_block_send_distance", "6"); g_settings.setDefault("max_block_send_distance", "6");
g_settings.setDefault("max_block_generate_distance", "6"); g_settings.setDefault("max_block_generate_distance", "6");
g_settings.setDefault("time_send_interval", "20"); g_settings.setDefault("time_send_interval", "20");

@ -221,6 +221,8 @@ TODO: Map generator version 2
FIXME: The new pre-sunlight-propagation code messes up with initial FIXME: The new pre-sunlight-propagation code messes up with initial
water lighting water lighting
TODO: Remove HMParams
Doing now: Doing now:
====================================================================== ======================================================================
@ -1269,10 +1271,10 @@ int main(int argc, char *argv[])
// Read map parameters from settings // Read map parameters from settings
HMParams hm_params; HMParams hm_params;
hm_params.blocksize = g_settings.getU16("heightmap_blocksize"); /*hm_params.blocksize = g_settings.getU16("heightmap_blocksize");
hm_params.randmax = g_settings.get("height_randmax"); hm_params.randmax = g_settings.get("height_randmax");
hm_params.randfactor = g_settings.get("height_randfactor"); hm_params.randfactor = g_settings.get("height_randfactor");
hm_params.base = g_settings.get("height_base"); hm_params.base = g_settings.get("height_base");*/
MapParams map_params; MapParams map_params;
map_params.plants_amount = g_settings.getFloat("plants_amount"); map_params.plants_amount = g_settings.getFloat("plants_amount");

@ -259,10 +259,10 @@ int main(int argc, char *argv[])
// Read map parameters from settings // Read map parameters from settings
HMParams hm_params; HMParams hm_params;
hm_params.blocksize = g_settings.getU16("heightmap_blocksize"); /*hm_params.blocksize = g_settings.getU16("heightmap_blocksize");
hm_params.randmax = g_settings.get("height_randmax"); hm_params.randmax = g_settings.get("height_randmax");
hm_params.randfactor = g_settings.get("height_randfactor"); hm_params.randfactor = g_settings.get("height_randfactor");
hm_params.base = g_settings.get("height_base"); hm_params.base = g_settings.get("height_base");*/
MapParams map_params; MapParams map_params;
map_params.plants_amount = g_settings.getFloat("plants_amount"); map_params.plants_amount = g_settings.getFloat("plants_amount");

@ -113,7 +113,7 @@ float PointAttributeList::getInterpolatedFloat(v3s16 p)
{ {
const u32 near_wanted_count = 5; const u32 near_wanted_count = 5;
// Last is nearest, first is farthest // Last is nearest, first is farthest
core::list<DFloat> near; core::list<DFloat> near_list;
for(core::list<PointWithAttr>::Iterator for(core::list<PointWithAttr>::Iterator
i = m_points.begin(); i = m_points.begin();
@ -127,17 +127,17 @@ float PointAttributeList::getInterpolatedFloat(v3s16 p)
df.d = d; df.d = d;
// If near list is empty, add directly and continue // If near list is empty, add directly and continue
if(near.size() == 0) if(near_list.size() == 0)
{ {
near.push_back(df); near_list.push_back(df);
continue; continue;
} }
// Get distance of farthest in near list // Get distance of farthest in near list
u32 near_d = 100000; u32 near_d = 100000;
if(near.size() > 0) if(near_list.size() > 0)
{ {
core::list<DFloat>::Iterator i = near.begin(); core::list<DFloat>::Iterator i = near_list.begin();
near_d = i->d; near_d = i->d;
} }
@ -145,35 +145,35 @@ float PointAttributeList::getInterpolatedFloat(v3s16 p)
If point is closer than the farthest in the near list or If point is closer than the farthest in the near list or
there are not yet enough points on the list there are not yet enough points on the list
*/ */
if(d < near_d || near.size() < near_wanted_count) if(d < near_d || near_list.size() < near_wanted_count)
{ {
// Find the right place in the near list and put it there // Find the right place in the near list and put it there
// Go from farthest to near in the near list // Go from farthest to near in the near list
core::list<DFloat>::Iterator i = near.begin(); core::list<DFloat>::Iterator i = near_list.begin();
for(; i != near.end(); i++) for(; i != near_list.end(); i++)
{ {
// Stop when i is at the first nearer node // Stop when i is at the first nearer node
if(i->d < d) if(i->d < d)
break; break;
} }
// Add df to before i // Add df to before i
if(i == near.end()) if(i == near_list.end())
near.push_back(df); near_list.push_back(df);
else else
near.insert_before(i, df); near_list.insert_before(i, df);
// Keep near list at right size // Keep near list at right size
if(near.size() > near_wanted_count) if(near_list.size() > near_wanted_count)
{ {
core::list<DFloat>::Iterator j = near.begin(); core::list<DFloat>::Iterator j = near_list.begin();
near.erase(j); near_list.erase(j);
} }
} }
} }
// Return if no values found // Return if no values found
if(near.size() == 0) if(near_list.size() == 0)
return 0.0; return 0.0;
/* /*
@ -183,8 +183,8 @@ lopuks sit otetaan a/b
float a = 0; float a = 0;
float b = 0; float b = 0;
for(core::list<DFloat>::Iterator i = near.begin(); for(core::list<DFloat>::Iterator i = near_list.begin();
i != near.end(); i++) i != near_list.end(); i++)
{ {
if(i->d == 0) if(i->d == 0)
return i->v; return i->v;
@ -220,17 +220,17 @@ float PointAttributeList::getInterpolatedFloat(v3s16 p)
df.d = d; df.d = d;
// If near list is empty, add directly and continue // If near list is empty, add directly and continue
if(near.size() == 0) if(near_list.size() == 0)
{ {
near.push_back(df); near_list.push_back(df);
continue; continue;
} }
// Get distance of farthest in near list // Get distance of farthest in near list
u32 near_d = 100000; u32 near_d = 100000;
if(near.size() > 0) if(near_list.size() > 0)
{ {
core::list<DFloat>::Iterator i = near.begin(); core::list<DFloat>::Iterator i = near_list.begin();
near_d = i->d; near_d = i->d;
} }
@ -238,35 +238,35 @@ float PointAttributeList::getInterpolatedFloat(v3s16 p)
If point is closer than the farthest in the near list or If point is closer than the farthest in the near list or
there are not yet enough points on the list there are not yet enough points on the list
*/ */
if(d < near_d || near.size() < near_wanted_count) if(d < near_d || near_list.size() < near_wanted_count)
{ {
// Find the right place in the near list and put it there // Find the right place in the near list and put it there
// Go from farthest to near in the near list // Go from farthest to near in the near list
core::list<DFloat>::Iterator i = near.begin(); core::list<DFloat>::Iterator i = near_list.begin();
for(; i != near.end(); i++) for(; i != near_list.end(); i++)
{ {
// Stop when i is at the first nearer node // Stop when i is at the first nearer node
if(i->d < d) if(i->d < d)
break; break;
} }
// Add df to before i // Add df to before i
if(i == near.end()) if(i == near_list.end())
near.push_back(df); near_list.push_back(df);
else else
near.insert_before(i, df); near_list.insert_before(i, df);
// Keep near list at right size // Keep near list at right size
if(near.size() > near_wanted_count) if(near_list.size() > near_wanted_count)
{ {
core::list<DFloat>::Iterator j = near.begin(); core::list<DFloat>::Iterator j = near_list.begin();
near.erase(j); near_list.erase(j);
} }
} }
} }
// Return if no values found // Return if no values found
if(near.size() == 0) if(near_list.size() == 0)
return 0.0; return 0.0;
/* /*
@ -274,11 +274,11 @@ float PointAttributeList::getInterpolatedFloat(v3s16 p)
*/ */
u32 nearest_count = nearest_wanted_count; u32 nearest_count = nearest_wanted_count;
if(nearest_count > near.size()) if(nearest_count > near_list.size())
nearest_count = near.size(); nearest_count = near_list.size();
core::list<DFloat> nearest; core::list<DFloat> nearest;
{ {
core::list<DFloat>::Iterator i = near.getLast(); core::list<DFloat>::Iterator i = near_list.getLast();
for(u32 j=0; j<nearest_count; j++) for(u32 j=0; j<nearest_count; j++)
{ {
nearest.push_front(*i); nearest.push_front(*i);