aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_serialization.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-12-02 07:25:43 +0000
committerGitHub <noreply@github.com>2018-12-02 07:25:43 +0000
commitff12630bc966ef6d72f4c6d07c59d952fd44dfb7 (patch)
tree8af7af1def7f114837bfe687250130c9ba3a653b /src/unittest/test_serialization.cpp
parent5dd542401a3537928b6a730eb534c3eb239e8308 (diff)
downloadminetest-ff12630bc966ef6d72f4c6d07c59d952fd44dfb7.tar.gz
minetest-ff12630bc966ef6d72f4c6d07c59d952fd44dfb7.tar.bz2
minetest-ff12630bc966ef6d72f4c6d07c59d952fd44dfb7.zip
Draw stars behind the moon (#7928)
This time correctly, by resetting the 'material' to '1' after moon draw.
Diffstat (limited to 'src/unittest/test_serialization.cpp')
0 files changed, 0 insertions, 0 deletions
n125'>125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
/*
Minetest
Copyright (C) 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.
*/

#pragma once

#include <cstring>
#include <string>
#include "database.h"
#include "exceptions.h"

extern "C" {
#include "sqlite3.h"
}

class Database_SQLite3 : public Database
{
public:
	virtual ~Database_SQLite3();

	void beginSave();
	void endSave();

	bool initialized() const { return m_initialized; }
protected:
	Database_SQLite3(const std::string &savedir, const std::string &dbname);

	// Open and initialize the database if needed
	void verifyDatabase();

	// Convertors
	inline void str_to_sqlite(sqlite3_stmt *s, int iCol, const std::string &str) const
	{
		sqlite3_vrfy(sqlite3_bind_text(s, iCol, str.c_str(), str.size(), NULL));
	}

	inline void str_to_sqlite(sqlite3_stmt *s, int iCol, const char *str) const
	{
		sqlite3_vrfy(sqlite3_bind_text(s, iCol, str, strlen(str), NULL));
	}

	inline void int_to_sqlite(sqlite3_stmt *s, int iCol, int val) const
	{