From 9ed70192aaf51f65a779ebdba9858474e7e07a03 Mon Sep 17 00:00:00 2001 From: paramat Date: Sat, 15 Apr 2017 00:26:46 +0100 Subject: [PATCH] Use data buffer memory optimisation. Correct noise buffer memory optimisation. Change source code license to LGPL. Improve license docs --- README.txt | 4 ++-- init.lua | 29 +++++++++++++++----------- license.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 68 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 7a34a34..7fd5893 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -watershed 0.7.1 by paramat +watershed 0.7.2 by paramat For Minetest 0.4.13 and later Depends default stairs bucket -Licenses: code WTFPL, textures CC BY-SA +Licenses: Source code LGPL (2.1). Media (textures) CC BY-SA (3.0) diff --git a/init.lua b/init.lua index 71ed357..45ad743 100644 --- a/init.lua +++ b/init.lua @@ -195,17 +195,22 @@ local nobj_magma = nil -- Localise noise buffers -local nbuf_terrain -local nbuf_fissure -local nbuf_temp -local nbuf_humid -local nbuf_seam -local nbuf_strata +local nbuf_terrain = {} +local nbuf_fissure = {} +local nbuf_temp = {} +local nbuf_humid = {} +local nbuf_seam = {} +local nbuf_strata = {} -local nbuf_mid -local nbuf_base -local nbuf_xlscale -local nbuf_magma +local nbuf_mid = {} +local nbuf_base = {} +local nbuf_xlscale = {} +local nbuf_magma = {} + + +-- Localise data buffer + +local dbuf = {} -- Mapchunk generation function @@ -741,7 +746,7 @@ minetest.register_chatcommand("regen",{ local pos2 = {x = x1, y = y1 + 1, z = z1} local emin, emax = vm:read_from_map(pos1, pos2) local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) - local data = vm:get_data() + local data = vm:get_data(dbuf) watershed_chunkgen(x0, y0, z0, x1, y1, z1, area, data) @@ -773,7 +778,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") local area = VoxelArea:new{MinEdge = emin, MaxEdge = emax} - local data = vm:get_data() + local data = vm:get_data(dbuf) watershed_chunkgen(x0, y0, z0, x1, y1, z1, area, data) diff --git a/license.txt b/license.txt index c73f8ae..f3a8555 100644 --- a/license.txt +++ b/license.txt @@ -1,14 +1,53 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 +License of source code +---------------------- +GNU Lesser General Public License (2.1) +Copyright (C) 2014-2017 paramat. - Copyright (C) 2004 Sam Hocevar +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. - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. +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. - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +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. - 0. You just DO WHAT THE FUCK YOU WANT TO. - + +License of media (textures) +--------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2014-2017 paramat + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/