aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/testnodes/textures/testnodes_liquidsource_r4.png
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2021-10-20 21:51:21 +0200
committerGitHub <noreply@github.com>2021-10-20 21:51:21 +0200
commit0d345dc1bd56068b8d40f8ff712a9263c6ff7517 (patch)
tree3558b64dc2fefc38b3592bc75ce813f80123b23d /games/devtest/mods/testnodes/textures/testnodes_liquidsource_r4.png
parent86b44ecd8280d8304aa26a600fc004d40a970020 (diff)
downloadminetest-0d345dc1bd56068b8d40f8ff712a9263c6ff7517.tar.gz
minetest-0d345dc1bd56068b8d40f8ff712a9263c6ff7517.tar.bz2
minetest-0d345dc1bd56068b8d40f8ff712a9263c6ff7517.zip
Fix view bobbing not resetting when resting
partially fixes #11694, also fixes #11692
Diffstat (limited to 'games/devtest/mods/testnodes/textures/testnodes_liquidsource_r4.png')
0 files changed, 0 insertions, 0 deletions
='#n148'>148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
/*
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 <string>
#include <libpq-fe.h>
#include "database.h"
#include "util/basic_macros.h"

class Settings;

class Database_PostgreSQL: public Database
{
public:
	Database_PostgreSQL(const std::string &connect_string, const char *type);
	~Database_PostgreSQL();

	void beginSave();
	void endSave();
	void rollback();

	bool initialized() const;


protected:
	// Conversion helpers
	inline int pg_to_int(PGresult *res, int row, int col)
	{
		return atoi(PQgetvalue(res, row, col));
	}

	inline u32 pg_to_uint(PGresult *res, int row, int col)
	{
		return (u32) atoi(PQgetvalue(res, row, col));
	}

	inline float pg_to_float(PGresult *res, int row, int col)
	{
		return (float) atof(PQgetvalue(res, row, col));
	}

	inline v3s16 pg_to_v3s16(PGresult *res, int row, int col)
	{
		return v3s16(
			pg_to_int(res, row, col),
			pg_to_int(res, row, col + 1),
			pg_to_int(res, row, col + 2)
		);
	}

	inline PGresult *execPrepared(const char *stmtName, const int paramsNumber,
		const void **params,
		const int *paramsLengths = NULL, const int *paramsFormats = NULL,
		bool clear = true, bool nobinary = true)
	{
		return checkResults(PQexecPrepared(m_conn, stmtName, paramsNumber,
			(const char* const*) params, paramsLengths, paramsFormats,