aboutsummaryrefslogtreecommitdiff
path: root/src/mods.h
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-05-11 00:14:57 +0200
committersapier <Sapier at GMX dot net>2014-05-11 00:14:57 +0200
commitf76b9d724b322875016005763ae8389c3c23e5f1 (patch)
tree15f6dc501e456a6c47be8954fc6216bb5f8692cc /src/mods.h
parentc8aed03ace88ad979af54f0af2707f6ed9db5655 (diff)
downloadminetest-f76b9d724b322875016005763ae8389c3c23e5f1.tar.gz
minetest-f76b9d724b322875016005763ae8389c3c23e5f1.tar.bz2
minetest-f76b9d724b322875016005763ae8389c3c23e5f1.zip
Fix possible deadlock in error conditions
Diffstat (limited to 'src/mods.h')
0 files changed, 0 insertions, 0 deletions
119 120 121 122 123 124 125 126 127 128 129 130
/*
Minetest
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>

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.
*/

#ifndef HUD_HEADER
#define HUD_HEADER

#include "irrlichttypes_extrabloated.h"

#define HUD_DIR_LEFT_RIGHT 0
#define HUD_DIR_RIGHT_LEFT 1
#define HUD_DIR_TOP_BOTTOM 2
#define HUD_DIR_BOTTOM_TOP 3

#define HUD_CORNER_UPPER  0
#define HUD_CORNER_LOWER  1
#define HUD_CORNER_CENTER 2

#define HUD_FLAG_HOTBAR_VISIBLE    (1 << 0)
#define HUD_FLAG_HEALTHBAR_VISIBLE (1 << 1)
#define HUD_FLAG_CROSSHAIR_VISIBLE (1 << 2)
#define HUD_FLAG_WIELDITEM_VISIBLE (1 << 3)

class Player;

enum HudElementType {
	HUD_ELEM_IMAGE     = 0,
	HUD_ELEM_TEXT      = 1,
	HUD_ELEM_STATBAR   = 2,
	HUD_ELEM_INVENTORY = 3
};

enum HudElementStat {
	HUD_STAT_POS,
	HUD_STAT_NAME,
	HUD_STAT_SCALE,
	HUD_STAT_TEXT,
	HUD_STAT_NUMBER,
	HUD_STAT_ITEM,
	HUD_STAT_DIR,
	HUD_STAT_ALIGN,
	HUD_STAT_OFFSET
};

struct HudElement {
	HudElementType type;
	v2f pos;
	std::string name;
	v2f scale;
	std::string text;
	u32 number;
	u32 item;
	u32 dir;
	v2f align;
	v2f offset;
};


inline u32 hud_get_free_id(Player *player) {
	size_t size = player->hud.size();