From de3fdba568cf0b05e8fe0ec7fb11552416474093 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 25 Jan 2011 09:30:49 +0200 Subject: [PATCH] Tweaking around --- src/client.cpp | 8 ++++---- src/main.cpp | 10 ++++------ src/utility.cpp | 6 +++++- src/utility.h | 33 ++++++++++----------------------- 4 files changed, 23 insertions(+), 34 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index d6062ef6..36e0f3c7 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 d2f8a6b9..858d25fa 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 269b545a..8befaaee 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 8ab2345e..fd2881cf 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::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::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: -- 2.30.2