summaryrefslogtreecommitdiff
path: root/src/utility.h
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 /src/utility.h
parent39fbf1527308993cea7e0d2235ee1687e80d9755 (diff)
downloadminetest-de3fdba568cf0b05e8fe0ec7fb11552416474093.tar.gz
minetest-de3fdba568cf0b05e8fe0ec7fb11552416474093.tar.bz2
minetest-de3fdba568cf0b05e8fe0ec7fb11552416474093.zip
Tweaking around
Diffstat (limited to 'src/utility.h')
-rw-r--r--src/utility.h33
1 files changed, 10 insertions, 23 deletions
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: