aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/down.png
blob: b85717a7f48f4f6e9b8d79a6a3571cc5da9f485a (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 00 00 00 00 80 08 03 00 00 00 d3 6b 47 .PNG........IHDR..............kG
0020 38 00 00 01 5f 50 4c 54 45 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 8..._PLTE.......................
0040 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
00a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
00e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0120 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0140 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0160 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................................
0180 ff ff ff ff ff ff ff ff 28 3e ba a0 00 00 00 74 74 52 4e 53 00 01 02 04 05 08 09 0a 0b 0d 0e 0f ........(>.....ttRNS............
01a0 10 11 12 17 18 19 1a 1b 1d 21 22 23 24 25 26 2c 2d 2e 2f 30 31 32 3a 3b 3c 3d 3e 3f 40 44 4a 4b .........!"#$%&,-./012:;<=>?@DJK
01c0 4c 52 55 57 59 5d 62 66 6e 77 7e 7f 80 88 90 99 a1 a6 aa ab ac ad ae b1 b6 b7 b8 b9 ba bb bc be LRUWY]bfnw~.....................
01e0 c6 c7 c8 c9 ca cb cc d3 d4 d5 d6 d7 d8 d9 db df e0 e1 e2 e3 e4 e7 e8 e9 ea eb ec ed f1 f2 f3 f4 ................................
0200 f5 f7 f8 f9 fa fc fd fe d1 d0 a8 e8 00 00 03 0c 49 44 41 54 78 5e ed db 59 53 13 41 14 86 e1 6f ................IDATx^..YS.A...o
0220 42 00 95 35 60 c4 85 5d 11 d4 31 1a 93 18 09 11 45 05 51 41 10 44 70 01 54 40 36 01 09 fd ff cb B..5`..]..1.....E.QA.Dp.T@6.....
0240 3b cb 9b af 42 92 e9 99 ee ce 79 ae b9 e0 bc 5d d5 45 4e 1a fc 23 84 10 42 08 21 84 10 42 08 a1 ;...B.....y....].EN..#..B.!..B..
0260 9c 82 ca 49 00 09 20 01 24 80 04 90 00 12 40 02 48 00 09 20 01 14 ac 24 01 24 80 04 90 00 12 40 ...I....$.....@.H......$.$.....@
0280 02 48 00 09 20 01 24 80 04 90 00 12 a0 42 12 40 02 48 00 09 60 7b 81 80 77 82 b0 8c 86 a5 28 2c .H....$......B.@.H..`{..w.....(,
02a0 a2 69 2b 0c 4b 68 5c 8b c3 02 9a df 07 c0 70 fa df 07 c0 0c fa 7f eb c7 47 f6 25 50 c4 ef 3c aa .i+.Kh\.......p.........G.%P..<.
02c0 90 7c 65 5b 01 45 3c eb 42 75 fc 4d 9b 12 28 62 c3 47 d5 5a 0a 25 5b 12 28 e2 b4 70 09 b5 18 5e .|e[.E<.Bu.M..(b.G.Z.%[.(..p...^
02e0 b6 a3 80 22 96 86 50 a3 78 f6 d0 fc 04 8a 38 c8 36 a0 76 57 66 4c 2f a0 88 99 24 82 91 da 32 39 ..."..P.x.....8.6.vWfL/...$...29
0300 81 22 b6 52 08 4c eb c4 19 29 60 ec fc a5 42 2b 82 34 b2 a2 08 33 8f 7f 65 04 01 8b e7 8e 49 01 .".R.L...)`...B+.4...3..e.....I.
0320 03 e7 3f ce c5 11 bc be 79 45 98 76 fc 0b fd d0 c2 4b ef 98 94 40 11 3b 69 0f ba b4 1b 74 19 2a ..?.....yE.v.....K...@.;i....t.*
0340 a2 d8 01 9d 46 57 15 61 c6 f8 9f c7 a0 59 63 9e 5d 86 06 cc 7f 92 6f 82 7e d7 df 29 22 ea e3 9f ....FW.a.....Yc.].....o.~..)"...
0360 ef 43 28 bc f4 af 48 0b 90 fc 7b 99 18 c2 72 f9 a5 22 a2 3b fe e9 24 c2 74 ff 7b 44 05 48 f8 9f .C(...H...{...r..".;..$.t.{D.H..
0380 0f 11 b2 a6 fc 49 04 09 d8 d6 63 fc 02 42 c7 ff 32 0c 7d fe 0f 83 88 44 2c b3 17 6a 02 be f5 40 .....I....c..B..2.}....D,..j...@
03a0 54 12 45 45 38 76 f9 71 0f 7e 84 54 80 84 de 7d e4 21 5a cd e3 a7 24 81 21 5b 0f fd 06 16 b4 17 T.EE8v.q.~.T...}.!Z...$.![......
03c0 60 5b 8f 5b 30 42 2c b3 af 35 01 e9 7b 94 8b c3 14 5d cf 35 16 20 71 df 5c 85 49 fc 0d 4d 09 f8 `[.[0B,..5..{....].5..q.\.I..M..
03e0 d6 03 66 69 29 90 cb 50 c7 fc 67 13 ed 30 cf d0 12 39 ad c0 8f 7f 6d 14 46 6a c8 1e 90 04 1a b6 ..fi)..P..g..0...9....m.Fj......
0400 1e 66 4a 4e 07 58 80 c4 9c eb 85 c9 7c f6 31 39 b0 ad 87 07 b3 b5 b2 27 05 81 cc 5f 4c c0 7c 37 .fJN.X......|.19.......'..._L.|7
0420 3f 92 d3 ab 79 fc 75 1f 56 88 e7 8e 6a 2b c0 b6 1e cd b0 45 cf 2c 39 c3 1a 8e 7f 71 00 36 49 6d ?...y.u.V...j+.....E.,9....q.6Im
0440 57 5b 80 6f 3d ec d2 c6 9e 14 54 75 fc 2f ba 61 9f db 9f 48 81 8a e7 df f4 61 23 fe a4 00 04 df W[.o=.....Tu./.a...H.....a#.....
0460 7a d8 ea da db 0a 2e 43 f2 a3 5f ee c0 3e fc 49 01 2f c0 b7 1e 76 eb 28 f2 cb b0 fc f1 cf f6 c0 z......C.._..>.I./...v.(........
0480 7e 63 6b a4 40 d9 f9 b7 53 70 c2 45 b6 2b 29 b7 f5 68 83 2b 7a e7 58 01 3e ff ea 28 1c e2 a5 77 ~ck.@...Sp.E.+)..h.+z.X.>..(...w
04a0 59 02 b6 f5 68 84 5b 3a 8b aa 02 73 37 e0 9e bb 5f d5 39 ed a6 3d b8 a8 39 ff 47 9d 47 b1 13 ae Y...h.[:...s7..._.9..=..9.G.G...
04c0 ea 7f af ca fa 76 0f 2e e1 4f 0a f8 d6 c3 6d 89 49 c5 a9 85 01 b8 cf 5f 57 c4 7e 26 06 f7 f1 27 .....v...O....m.I......_W.~&...'
04e0 05 53 5d a8 17 83 8b 96 6d 3d f4 7f 8b 56 2a b4 a0 be 74 4f a9 ff 2c 0f c3 7d fc 1f 73 0f b3 71 .S].....m=...V*...tO..,..}..s..q
0500 b8 8f 3f 29 78 dd 83 7a 35 bc 4c b6 1e 75 a3 f1 c9 d3 04 22 20 84 10 42 08 21 c4 5f 87 99 86 d7 ..?)x..z5.L..u....."...B.!._....
0520 fb 78 87 15 00 00 00 00 49 45 4e 44 ae 42 60 82 .x......IEND.B`.
a id='n292' href='#n292'>292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
/*
Minetest
Copyright (C) 2010-2013 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 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.
*/

#ifndef NODEDEF_HEADER
#define NODEDEF_HEADER

#include "irrlichttypes_bloated.h"
#include <string>
#include <iostream>
#include <map>
#include <list>
#include "mapnode.h"
#ifndef SERVER
#include "tile.h"
#endif
#include "itemgroup.h"
#include "sound.h" // SimpleSoundSpec
#include "constants.h" // BS

class IItemDefManager;
class ITextureSource;
class IGameDef;

typedef std::list<std::pair<content_t, int> > GroupItems;

enum ContentParamType
{
	CPT_NONE,
	CPT_LIGHT,
};

enum ContentParamType2
{
	CPT2_NONE,
	// Need 8-bit param2
	CPT2_FULL,
	// Flowing liquid properties
	CPT2_FLOWINGLIQUID,
	// Direction for chests and furnaces and such
	CPT2_FACEDIR,
	// Direction for signs, torches and such
	CPT2_WALLMOUNTED,
	// Block level like FLOWINGLIQUID
	CPT2_LEVELED,
};

enum LiquidType
{
	LIQUID_NONE,
	LIQUID_FLOWING,
	LIQUID_SOURCE,
};

enum NodeBoxType
{
	NODEBOX_REGULAR, // Regular block; allows buildable_to
	NODEBOX_FIXED, // Static separately defined box(es)
	NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
	NODEBOX_LEVELED, // Same as fixed, but with dynamic height from param2. for snow, ...
};

struct NodeBox
{
	enum NodeBoxType type;
	// NODEBOX_REGULAR (no parameters)
	// NODEBOX_FIXED
	std::vector<aabb3f> fixed;
	// NODEBOX_WALLMOUNTED
	aabb3f wall_top;
	aabb3f wall_bottom;
	aabb3f wall_side; // being at the -X side

	NodeBox()
	{ reset(); }

	void reset();
	void serialize(std::ostream &os, u16 protocol_version) const;
	void deSerialize(std::istream &is);
};

struct MapNode;
class NodeMetadata;

/*
	Stand-alone definition of a TileSpec (basically a server-side TileSpec)
*/
enum TileAnimationType{
	TAT_NONE=0,
	TAT_VERTICAL_FRAMES=1,
};
struct TileDef
{
	std::string name;
	bool backface_culling; // Takes effect only in special cases
	struct{
		enum TileAnimationType type;
		int aspect_w; // width for aspect ratio
		int aspect_h; // height for aspect ratio
		float length; // seconds
	} animation;

	TileDef()
	{
		name = "";
		backface_culling = true;
		animation.type = TAT_NONE;
		animation.aspect_w = 1;
		animation.aspect_h = 1;
		animation.length = 1.0;
	}

	void serialize(std::ostream &os, u16 protocol_version) const;
	void deSerialize(std::istream &is);
};

enum NodeDrawType
{
	NDT_NORMAL, // A basic solid block
	NDT_AIRLIKE, // Nothing is drawn
	NDT_LIQUID, // Do not draw face towards same kind of flowing/source liquid
	NDT_FLOWINGLIQUID, // A very special kind of thing
	NDT_GLASSLIKE, // Glass-like, don't draw faces towards other glass
	NDT_ALLFACES, // Leaves-like, draw all faces no matter what
	NDT_ALLFACES_OPTIONAL, // Fancy -> allfaces, fast -> normal
	NDT_TORCHLIKE,
	NDT_SIGNLIKE,
	NDT_PLANTLIKE,
	NDT_FENCELIKE,
	NDT_RAILLIKE,
	NDT_NODEBOX,
	NDT_GLASSLIKE_FRAMED, // Glass-like, draw connected frames and all all
	                      // visible faces
						  // uses 2 textures, one for frames, second for faces
};

#define CF_SPECIAL_COUNT 2

struct ContentFeatures
{
	/*
		Cached stuff
	*/
#ifndef SERVER
	// 0     1     2     3     4     5
	// up    down  right left  back  front 
	TileSpec tiles[6];
	// Special tiles
	// - Currently used for flowing liquids
	TileSpec special_tiles[CF_SPECIAL_COUNT];
	u8 solidness; // Used when choosing which face is drawn
	u8 visual_solidness; // When solidness=0, this tells how it looks like
	bool backface_culling;
#endif

	// Server-side cached callback existence for fast skipping
	bool has_on_construct;
	bool has_on_destruct;
	bool has_after_destruct;

	/*
		Actual data
	*/

	std::string name; // "" = undefined node
	ItemGroupList groups; // Same as in itemdef

	// Visual definition
	enum NodeDrawType drawtype;
	float visual_scale; // Misc. scale parameter
	TileDef tiledef[6];
	TileDef tiledef_special[CF_SPECIAL_COUNT]; // eg. flowing liquid
	u8 alpha;

	// Post effect color, drawn when the camera is inside the node.
	video::SColor post_effect_color;
	// Type of MapNode::param1
	ContentParamType param_type;
	// Type of MapNode::param2
	ContentParamType2 param_type_2;
	// True for all ground-like things like stone and mud, false for eg. trees
	bool is_ground_content;
	bool light_propagates;
	bool sunlight_propagates;
	// This is used for collision detection.
	// Also for general solidness queries.
	bool walkable;
	// Player can point to these
	bool pointable;
	// Player can dig these
	bool diggable;
	// Player can climb these
	bool climbable;
	// Player can build on these
	bool buildable_to;
	// Player cannot build to these (placement prediction disabled)
	bool rightclickable;
	// Flowing liquid or snow, value = default level
	u8 leveled;
	// Whether the node is non-liquid, source liquid or flowing liquid
	enum LiquidType liquid_type;
	// If the content is liquid, this is the flowing version of the liquid.
	std::string liquid_alternative_flowing;
	// If the content is liquid, this is the source version of the liquid.
	std::string liquid_alternative_source;
	// Viscosity for fluid flow, ranging from 1 to 7, with
	// 1 giving almost instantaneous propagation and 7 being
	// the slowest possible
	u8 liquid_viscosity;
	// Is liquid renewable (new liquid source will be created between 2 existing)
	bool liquid_renewable;
	// Ice for water, water for ice
	std::string freezemelt;
	// Number of flowing liquids surrounding source
	u8 liquid_range;
	u8 drowning;
	// Amount of light the node emits
	u8 light_source;
	u32 damage_per_second;
	NodeBox node_box;
	NodeBox selection_box;
	// Compatibility with old maps
	// Set to true if paramtype used to be 'facedir_simple'
	bool legacy_facedir_simple;
	// Set to true if wall_mounted used to be set to true
	bool legacy_wallmounted;

	// Sound properties
	SimpleSoundSpec sound_footstep;
	SimpleSoundSpec sound_dig;
	SimpleSoundSpec sound_dug;

	/*
		Methods
	*/
	
	ContentFeatures();
	~ContentFeatures();
	void reset();
	void serialize(std::ostream &os, u16 protocol_version);
	void deSerialize(std::istream &is);
	void serializeOld(std::ostream &os, u16 protocol_version);
	void deSerializeOld(std::istream &is, int version);

	/*
		Some handy methods
	*/
	bool isLiquid() const{
		return (liquid_type != LIQUID_NONE);
	}
	bool sameLiquid(const ContentFeatures &f) const{
		if(!isLiquid() || !f.isLiquid()) return false;
		return (liquid_alternative_flowing == f.liquid_alternative_flowing);
	}
};

class INodeDefManager
{
public:
	INodeDefManager(){}
	virtual ~INodeDefManager(){}
	// Get node definition
	virtual const ContentFeatures& get(content_t c) const=0;
	virtual const ContentFeatures& get(const MapNode &n) const=0;
	virtual bool getId(const std::string &name, content_t &result) const=0;
	virtual content_t getId(const std::string &name) const=0;
	// Allows "group:name" in addition to regular node names