aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_sound.h
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2017-06-03 14:42:10 -0400
committerShadowNinja <shadowninja@minetest.net>2017-06-03 14:42:10 -0400
commit80dc961d24e1964e25d57039ddb2ba639f9f4d22 (patch)
treee5115982ea59bbf2343ba9b35bc4a0cfbb56f407 /src/script/lua_api/l_sound.h
parente4d3639d403f1d7cc4223bcca3816d8f19198cb6 (diff)
downloadminetest-80dc961d24e1964e25d57039ddb2ba639f9f4d22.tar.gz
minetest-80dc961d24e1964e25d57039ddb2ba639f9f4d22.tar.bz2
minetest-80dc961d24e1964e25d57039ddb2ba639f9f4d22.zip
Bump version to 0.4.16
Diffstat (limited to 'src/script/lua_api/l_sound.h')
0 files changed, 0 insertions, 0 deletions
#n130'>130 131 132 133 134 135 136 137 138 139 140 141
/*
Minetest-c55
Copyright (C) 2010-2012 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
(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.

You should have received a copy of the GNU 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 "nodetimer.h"
#include "utility.h"
#include "log.h"

/*
	NodeTimer
*/

void NodeTimer::serialize(std::ostream &os) const
{
	writeF1000(os, duration);
	writeF1000(os, elapsed);
}

void NodeTimer::deSerialize(std::istream &is)
{
	duration = readF1000(is);
	elapsed = readF1000(is);
}

/*
	NodeTimerList
*/

void NodeTimerList::serialize(std::ostream &os) const
{
	/*
		Version 0 is a placeholder for "nothing to see here; go away."
	*/

	if(m_data.size() == 0){
		writeU8(os, 0); // version
		return;
	}

	writeU8(os, 1); // version
	writeU16(os, m_data.size());

	for(std::map<v3s16, NodeTimer>::const_iterator