summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-25 09:30:49 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-25 09:30:49 +0200
commitde3fdba568cf0b05e8fe0ec7fb11552416474093 (patch)
tree65225261d60d8e7f6a2eaaee35c49f61767c7fdd
parent39fbf1527308993cea7e0d2235ee1687e80d9755 (diff)
downloadminetest-de3fdba568cf0b05e8fe0ec7fb11552416474093.tar.gz
minetest-de3fdba568cf0b05e8fe0ec7fb11552416474093.tar.bz2
minetest-de3fdba568cf0b05e8fe0ec7fb11552416474093.zip
Tweaking around
-rw-r--r--src/client.cpp8
-rw-r--r--src/main.cpp10
-rw-r--r--src/utility.cpp6
-rw-r--r--src/utility.h33
4 files changed, 23 insertions, 34 deletions
diff --git a/src/client.cpp b/src/client.cpp
index d6062ef61..36e0f3c7c 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -981,14 +981,14 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
12000 = midday
*/
{
- const s32 daylength = 8;
- const s32 nightlength = 2;
- const s32 daytimelength = 4;
+ const s32 daylength = 16;
+ const s32 nightlength = 6;
+ const s32 daytimelength = 8;
s32 d = daylength;
s32 t = (((m_time_of_day.get())%24000)/(24000/d));
u32 dr;
if(t < nightlength/2 || t >= d - nightlength/2)
- dr = 350;
+ dr = 400;
else if(t >= d/2 - daytimelength/2 && t < d/2 + daytimelength/2)
dr = 1000;
else
diff --git a/src/main.cpp b/src/main.cpp
index d2f8a6b9d..858d25fa1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -252,9 +252,6 @@ TODO: Change AttributeList to split the area into smaller sections so
TODO: Change AttributeList to be 2D, as it would be too slow to search
in 3D fields anyway.
-FIXME: The new pre-sunlight-propagation code messes up with initial
- water lighting. Does it any more?
-
TODO: Remove HMParams
TODO: Flowing water to actually contain flow direction information
@@ -2119,9 +2116,9 @@ int main(int argc, char *argv[])
camera_direction.rotateXZBy(camera_yaw);
// This is at the height of the eyes of the current figure
- v3f camera_position = player_position + v3f(0, BS+BS/2, 0);
+ //v3f camera_position = player_position + v3f(0, BS+BS/2, 0);
// This is more like in minecraft
- //v3f camera_position = player_position + v3f(0, BS+BS*0.625, 0);
+ v3f camera_position = player_position + v3f(0, BS+BS*0.625, 0);
camera->setPosition(camera_position);
// *100.0 helps in large map coordinates
@@ -2752,7 +2749,8 @@ int main(int argc, char *argv[])
//TimeTaker //timer10("//timer10");
video::SMaterial m;
- m.Thickness = 10;
+ //m.Thickness = 10;
+ m.Thickness = 3;
m.Lighting = false;
driver->setMaterial(m);
diff --git a/src/utility.cpp b/src/utility.cpp
index 269b545a5..8befaaeec 100644
--- a/src/utility.cpp
+++ b/src/utility.cpp
@@ -102,6 +102,10 @@ void mysrand(unsigned seed)
next = seed;
}
+/*
+ PointAttributeList
+*/
+
// Float with distance
struct DFloat
{
@@ -109,7 +113,7 @@ struct DFloat
u32 d;
};
-float PointAttributeList::getInterpolatedFloat(v3s16 p)
+float PointAttributeList::getInterpolatedFloat(v2s16 p)
{
const u32 near_wanted_count = 5;
// Last is nearest, first is farthest
diff --git a/src/utility.h b/src/utility.h
index 8ab2345e1..fd2881cff 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -1450,23 +1450,16 @@ class PointAttributeList
{
struct PointWithAttr
{
- v3s16 p;
+ v2s16 p;
Attribute attr;
};
public:
~PointAttributeList()
{
- /*for(core::list<PointWithAttr>::Iterator
- i = m_points.begin();
- i != m_points.end(); i++)
- {
- PointWithAttr &pwa = *i;
- //delete pwa.attr;
- }*/
}
- Attribute getNearAttr(v3s16 p)
+ Attribute getNearAttr(v2s16 p)
{
core::list<PointWithAttr>::Iterator
nearest_i = m_points.end();
@@ -1490,9 +1483,9 @@ public:
return nearest_i->attr;
}
- Attribute getNearAttr(v2s16 p)
+ Attribute getNearAttr(v3s16 p)
{
- return getNearAttr(v3s16(p.X, 0, p.Y));
+ return getNearAttr(v2s16(p.X, p.Z));
}
bool empty()
@@ -1504,20 +1497,14 @@ public:
Take all points in range, or at least the nearest point,
and interpolate the values as floats
*/
- float getInterpolatedFloat(v3s16 p);
+ float getInterpolatedFloat(v2s16 p);
- float getInterpolatedFloat(v2s16 p)
+ float getInterpolatedFloat(v3s16 p)
{
- return getInterpolatedFloat(v3s16(p.X, 0, p.Y));
+ return getInterpolatedFloat(v2s16(p.X, p.Z));
}
- //float getInterpolatedFloat(v3s16 p, s32 range);
- /*float getInterpolatedFloat(v2s16 p, s32 range)
- {
- return getInterpolatedFloat(v3s16(p.X, 0, p.Y), range);
- }*/
-
- void addPoint(v3s16 p, const Attribute &attr)
+ void addPoint(v2s16 p, const Attribute &attr)
{
PointWithAttr pattr;
pattr.p = p;
@@ -1525,9 +1512,9 @@ public:
m_points.push_back(pattr);
}
- void addPoint(v2s16 p, const Attribute &attr)
+ void addPoint(v3s16 p, const Attribute &attr)
{
- addPoint(v3s16(p.X, 0, p.Y), attr);
+ addPoint(v2s16(p.X, p.Z), attr);
}
private: