aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures/default_cactus_side.png
blob: 128a4d28a74a7bd8e4436b67e8f1e5a4cd41e65f (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 02 03 00 00 00 62 9d 17 .PNG........IHDR.............b..
0020 f2 00 00 00 09 50 4c 54 45 00 00 00 34 66 04 4e 9a 06 9d 51 de ae 00 00 00 42 49 44 41 54 08 1d .....PLTE...4f.N...Q.....BIDAT..
0040 05 c1 41 15 c0 20 10 43 c1 6f 87 95 52 19 9c fa a2 04 70 51 4e 9b a8 ec 0c 72 06 d3 65 ca dd 68 ..A....C.o..R.....pQN....r..e..h
0060 c5 c8 e7 e3 19 31 ea 2c 6a 5f 23 c7 bc ce 46 7d 8c 1c 53 23 03 75 9a b9 af 29 a7 7f 31 4d 21 ad .....1.,j_#...F}..S#.u...)..1M!.
0080 de c7 8f c9 00 00 00 00 49 45 4e 44 ae 42 60 82 ........IEND.B`.
f='#n66'>66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
/*
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.
*/

#include "pointedthing.h"

#include "serialize.h"
#include "../exceptions.h"
#include <sstream>

PointedThing::PointedThing():
	type(POINTEDTHING_NOTHING),
	node_undersurface(0,0,0),
	node_abovesurface(0,0,0),
	object_id(-1)
{}

std::string PointedThing::dump() const
{
	std::ostringstream os(std::ios::binary);
	if(type == POINTEDTHING_NOTHING)
	{
		os<<"[nothing]";
	}
	else if(type == POINTEDTHING_NODE)
	{
		const v3s16 &u = node_undersurface;
		const v3s16 &a = node_abovesurface;
		os<<"[node under="<<u.X<<","<<u.Y<<","<<u.Z
			<< " above="<<a.X<<","<<a.Y<<","<<a.Z<<"]";
	}
	else if(type == POINTEDTHING_OBJECT)
	{
		os<<"[object "<<object_id<<"]";
	}
	else
	{
		os<<"[unknown PointedThing]";
	}
	return os.str();
}

void PointedThing::serialize(std::ostream &os) const
{
	writeU8(os, 0); // version
	writeU8(os, (u8)type);
	if(type == POINTEDTHING_NOTHING)
	{
		// nothing
	}
	else if(type == POINTEDTHING_NODE)
	{
		writeV3S16(os, node_undersurface);
		writeV3S16(os, node_abovesurface);
	}
	else if(type == POINTEDTHING_OBJECT)
	{