]> git.lizzy.rs Git - minetest.git/blobdiff - src/farmesh.cpp
Make shift the default descent control on ladders and when flying
[minetest.git] / src / farmesh.cpp
index 72dbe11c21e60305c05fcd4dccf99591f4c8df9a..bd08acadc3fd28133262d4ff80672d2976a9ff37 100644 (file)
@@ -3,16 +3,16 @@ Part of Minetest-c55
 Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
+You should have received a copy of the GNU Lesser General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
@@ -23,13 +23,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "farmesh.h"
+
 #include "constants.h"
 #include "debug.h"
 #include "noise.h"
 #include "map.h"
 #include "client.h"
+#include "tile.h" // ITextureSource
+#include "clientmap.h"
 
-#include "mapgen.h"
+#include "mapgen.h" // Shouldn't really be done this way
 
 FarMesh::FarMesh(
                scene::ISceneNode* parent,
@@ -47,7 +50,7 @@ FarMesh::FarMesh(
 {
        dstream<<__FUNCTION_NAME<<std::endl;
        
-       video::IVideoDriver* driver = mgr->getVideoDriver();
+       //video::IVideoDriver* driver = mgr->getVideoDriver();
 
        m_materials[0].setFlag(video::EMF_LIGHTING, false);
        m_materials[0].setFlag(video::EMF_BACK_FACE_CULLING, true);
@@ -62,8 +65,7 @@ FarMesh::FarMesh(
        m_materials[1].setFlag(video::EMF_BACK_FACE_CULLING, false);
        m_materials[1].setFlag(video::EMF_BILINEAR_FILTER, false);
        m_materials[1].setFlag(video::EMF_FOG_ENABLE, false);
-       m_materials[1].setTexture
-                       (0, driver->getTexture(getTexturePath("treeprop.png").c_str()));
+       m_materials[1].setTexture(0, client->tsrc()->getTextureRaw("treeprop.png"));
        m_materials[1].MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
        m_materials[1].setFlag(video::EMF_FOG_ENABLE, true);
 
@@ -123,7 +125,7 @@ HeightPoint ground_height(u64 seed, v2s16 p2d)
        hp.ma = (4)*BS;
        /*hp.gh = BS*base_rock_level_2d(seed, p2d);
        hp.ma = BS*get_mud_add_amount(seed, p2d);*/
-       hp.have_sand = mapgen::get_have_sand(seed, p2d);
+       hp.have_sand = mapgen::get_have_beach(seed, p2d);
        if(hp.gh > BS*WATER_LEVEL)
                hp.tree_amount = mapgen::tree_amount_2d(seed, p2d);
        else
@@ -279,7 +281,8 @@ void FarMesh::render()
                if(h_avg < WATER_LEVEL*BS && h_max < (WATER_LEVEL+5)*BS)
                {
                        //c = video::SColor(255,59,86,146);
-                       c = video::SColor(255,82,120,204);
+                       //c = video::SColor(255,82,120,204);
+                       c = video::SColor(255,74,105,170);
 
                        /*// Set to water level
                        for(u32 i=0; i<4; i++)