aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/basenodes/textures
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-01-17 01:56:50 +0100
committersfan5 <sfan5@live.de>2021-01-29 17:34:41 +0100
commit83229921e5f378625d9ef63ede3dffbe778e1798 (patch)
tree8189436795cad017e2eb858b5d2cc23c16a55f46 /games/devtest/mods/basenodes/textures
parentedd8c3c664ad005eb32e1968ce80091851ffb817 (diff)
downloadminetest-83229921e5f378625d9ef63ede3dffbe778e1798.tar.gz
minetest-83229921e5f378625d9ef63ede3dffbe778e1798.tar.bz2
minetest-83229921e5f378625d9ef63ede3dffbe778e1798.zip
Rework use_texture_alpha to provide three opaque/clip/blend modes
The change that turns nodeboxes and meshes opaque when possible is kept, as is the compatibility code that warns modders to adjust their nodedefs.
Diffstat (limited to 'games/devtest/mods/basenodes/textures')
0 files changed, 0 insertions, 0 deletions
z <juhdanad@gmail.com> This program is free software; you can redistribute it and/or modify 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 Lesser General Public License for more details. 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. */ #include "raycast.h" #include "irr_v3d.h" #include "irr_aabb3d.h" #include "constants.h" bool RaycastSort::operator() (const PointedThing &pt1, const PointedThing &pt2) const { // "nothing" can not be sorted assert(pt1.type != POINTEDTHING_NOTHING); assert(pt2.type != POINTEDTHING_NOTHING); f32 pt1_distSq = pt1.distanceSq; // Add some bonus when one of them is an object if (pt1.type != pt2.type) { if (pt1.type == POINTEDTHING_OBJECT) pt1_distSq -= BS * BS; else if (pt2.type == POINTEDTHING_OBJECT) pt1_distSq += BS * BS; } // returns false if pt1 is nearer than pt2 if (pt1_distSq < pt2.distanceSq) { return false; } if (pt1_distSq == pt2.distanceSq) { // Sort them to allow only one order if (pt1.type == POINTEDTHING_OBJECT) return (pt2.type == POINTEDTHING_OBJECT && pt1.object_id < pt2.object_id); return (pt2.type == POINTEDTHING_OBJECT