Tweaking around

master
Perttu Ahola 2011-01-25 09:30:49 +02:00
parent 39fbf15273
commit de3fdba568
4 changed files with 23 additions and 34 deletions

View File

@ -981,14 +981,14 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
12000 = midday 12000 = midday
*/ */
{ {
const s32 daylength = 8; const s32 daylength = 16;
const s32 nightlength = 2; const s32 nightlength = 6;
const s32 daytimelength = 4; const s32 daytimelength = 8;
s32 d = daylength; s32 d = daylength;
s32 t = (((m_time_of_day.get())%24000)/(24000/d)); s32 t = (((m_time_of_day.get())%24000)/(24000/d));
u32 dr; u32 dr;
if(t < nightlength/2 || t >= d - nightlength/2) if(t < nightlength/2 || t >= d - nightlength/2)
dr = 350; dr = 400;
else if(t >= d/2 - daytimelength/2 && t < d/2 + daytimelength/2) else if(t >= d/2 - daytimelength/2 && t < d/2 + daytimelength/2)
dr = 1000; dr = 1000;
else else

View 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 TODO: Change AttributeList to be 2D, as it would be too slow to search
in 3D fields anyway. 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: Remove HMParams
TODO: Flowing water to actually contain flow direction information TODO: Flowing water to actually contain flow direction information
@ -2119,9 +2116,9 @@ int main(int argc, char *argv[])
camera_direction.rotateXZBy(camera_yaw); camera_direction.rotateXZBy(camera_yaw);
// This is at the height of the eyes of the current figure // 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 // 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); camera->setPosition(camera_position);
// *100.0 helps in large map coordinates // *100.0 helps in large map coordinates
@ -2752,7 +2749,8 @@ int main(int argc, char *argv[])
//TimeTaker //timer10("//timer10"); //TimeTaker //timer10("//timer10");
video::SMaterial m; video::SMaterial m;
m.Thickness = 10; //m.Thickness = 10;
m.Thickness = 3;
m.Lighting = false; m.Lighting = false;
driver->setMaterial(m); driver->setMaterial(m);

View File

@ -102,6 +102,10 @@ void mysrand(unsigned seed)
next = seed; next = seed;
} }
/*
PointAttributeList
*/
// Float with distance // Float with distance
struct DFloat struct DFloat
{ {
@ -109,7 +113,7 @@ struct DFloat
u32 d; u32 d;
}; };
float PointAttributeList::getInterpolatedFloat(v3s16 p) float PointAttributeList::getInterpolatedFloat(v2s16 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

View File

@ -1450,23 +1450,16 @@ class PointAttributeList
{ {
struct PointWithAttr struct PointWithAttr
{ {
v3s16 p; v2s16 p;
Attribute attr; Attribute attr;
}; };
public: public:
~PointAttributeList() ~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 core::list<PointWithAttr>::Iterator
nearest_i = m_points.end(); nearest_i = m_points.end();
@ -1490,9 +1483,9 @@ public:
return nearest_i->attr; 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() bool empty()
@ -1504,20 +1497,14 @@ public:
Take all points in range, or at least the nearest point, Take all points in range, or at least the nearest point,
and interpolate the values as floats 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); void addPoint(v2s16 p, const Attribute &attr)
/*float getInterpolatedFloat(v2s16 p, s32 range)
{
return getInterpolatedFloat(v3s16(p.X, 0, p.Y), range);
}*/
void addPoint(v3s16 p, const Attribute &attr)
{ {
PointWithAttr pattr; PointWithAttr pattr;
pattr.p = p; pattr.p = p;
@ -1525,9 +1512,9 @@ public:
m_points.push_back(pattr); 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: private: