Tweaking around
authorPerttu Ahola <celeron55@gmail.com>
Tue, 25 Jan 2011 07:30:49 +0000 (09:30 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 25 Jan 2011 07:30:49 +0000 (09:30 +0200)
src/client.cpp
src/main.cpp
src/utility.cpp
src/utility.h

index d6062ef61f9f17d6f8f4c74f9cd161d3b3d0f763..36e0f3c7c66611a40dfcdc199dfb4435b8e31c44 100644 (file)
@@ -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
index d2f8a6b9d559a25dbd9780a31ec55b12acf8624e..858d25fa1466483a306ed7a89124a74cfbd501e9 100644 (file)
@@ -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\r
       in 3D fields anyway.\r
 \r
-FIXME: The new pre-sunlight-propagation code messes up with initial\r
-       water lighting. Does it any more?\r
-\r
 TODO: Remove HMParams\r
 \r
 TODO: Flowing water to actually contain flow direction information\r
@@ -2119,9 +2116,9 @@ int main(int argc, char *argv[])
                camera_direction.rotateXZBy(camera_yaw);\r
                \r
                // This is at the height of the eyes of the current figure\r
-               v3f camera_position = player_position + v3f(0, BS+BS/2, 0);\r
+               //v3f camera_position = player_position + v3f(0, BS+BS/2, 0);\r
                // This is more like in minecraft\r
-               //v3f camera_position = player_position + v3f(0, BS+BS*0.625, 0);\r
+               v3f camera_position = player_position + v3f(0, BS+BS*0.625, 0);\r
 \r
                camera->setPosition(camera_position);\r
                // *100.0 helps in large map coordinates\r
@@ -2752,7 +2749,8 @@ int main(int argc, char *argv[])
                //TimeTaker //timer10("//timer10");\r
                \r
                video::SMaterial m;\r
-               m.Thickness = 10;\r
+               //m.Thickness = 10;\r
+               m.Thickness = 3;\r
                m.Lighting = false;\r
                driver->setMaterial(m);\r
 \r
index 269b545a56271ab38ae6680960b7def1a83fc880..8befaaeec1cf5c3af39eb32e30ace46531dd7bba 100644 (file)
@@ -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
index 8ab2345e1aad863fcbcd90b7e847849bf37c8805..fd2881cffd6ade359065e0f217fdb1af15be8f2f 100644 (file)
@@ -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: