aboutsummaryrefslogtreecommitdiff
path: root/src/object_properties.h
blob: 199182d70839ced53c4a803e8acc7579f87788f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
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 "irrlichttypes_bloated.h"
#include <iostream>
#include <map>
#include <vector>

struct ObjectProperties
{
	u16 hp_max = 1;
	u16 breath_max = 0;
	bool physical = false;
	bool collideWithObjects = true;
	float weight = 5.0f;
	// Values are BS=1
	aabb3f collisionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
	aabb3f selectionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
	bool pointable = true;
	std::string visual = "sprite";
	std::string mesh = "";
	v3f visual_size = v3f(1, 1, 1);
	std::vector<std::string> textures;
	std::vector<video::SColor> colors;
	v2s16 spritediv = v2s16(1, 1);
	v2s16 initial_sprite_basepos;
	bool is_visible = true;
	bool makes_footstep_sound = false;
	f32 stepheight = 0.0f;
	float automatic_rotate = 0.0f;
	bool automatic_face_movement_dir = false;
	f32 automatic_face_movement_dir_offset = 0.0f;
	bool backface_culling = true;
	s8 glow = 0;
	std::string nametag = "";
	video::SColor nametag_color = video::SColor(255, 255, 255, 255);
	f32 automatic_face_movement_max_rotation_per_sec = -1.0f;
	std::string infotext;
	//! For dropped items, this contains item information.
	std::string wield_item;
	bool static_save = true;
	float eye_height = 1.625f;
	float zoom_fov = 0.0f;
	bool use_texture_alpha = false;

	ObjectProperties();
	std::string dump();
	void serialize(std::ostream &os) const;
	void deSerialize(std::istream &is);
};
rectory to install data files into") if(NOT CUSTOM_SHAREDIR STREQUAL "") set(SHAREDIR "${CUSTOM_SHAREDIR}") message(STATUS "Using SHAREDIR=${SHAREDIR}") endif() set(CUSTOM_BINDIR "" CACHE STRING "Directory to install binaries into") if(NOT CUSTOM_BINDIR STREQUAL "") set(BINDIR "${CUSTOM_BINDIR}") message(STATUS "Using BINDIR=${BINDIR}") endif() set(CUSTOM_DOCDIR "" CACHE STRING "Directory to install documentation into") if(NOT CUSTOM_DOCDIR STREQUAL "") set(DOCDIR "${CUSTOM_DOCDIR}") message(STATUS "Using DOCDIR=${DOCDIR}") endif() set(CUSTOM_MANDIR "" CACHE STRING "Directory to install manpages into") if(NOT CUSTOM_MANDIR STREQUAL "") set(MANDIR "${CUSTOM_MANDIR}") message(STATUS "Using MANDIR=${MANDIR}") endif() set(CUSTOM_EXAMPLE_CONF_DIR "" CACHE STRING "Directory to install example config file into") if(NOT CUSTOM_EXAMPLE_CONF_DIR STREQUAL "") set(EXAMPLE_CONF_DIR "${CUSTOM_EXAMPLE_CONF_DIR}") message(STATUS "Using EXAMPLE_CONF_DIR=${EXAMPLE_CONF_DIR}") endif() set(CUSTOM_XDG_APPS_DIR "" CACHE STRING "Directory to install .desktop files into") if(NOT CUSTOM_XDG_APPS_DIR STREQUAL "") set(XDG_APPS_DIR "${CUSTOM_XDG_APPS_DIR}") message(STATUS "Using XDG_APPS_DIR=${XDG_APPS_DIR}") endif() set(CUSTOM_ICONDIR "" CACHE STRING "Directory to install icons into") if(NOT CUSTOM_ICONDIR STREQUAL "") set(ICONDIR "${CUSTOM_ICONDIR}") message(STATUS "Using ICONDIR=${ICONDIR}") endif() set(CUSTOM_LOCALEDIR "" CACHE STRING "Directory to install l10n files into") if(NOT CUSTOM_LOCALEDIR STREQUAL "") set(LOCALEDIR "${CUSTOM_LOCALEDIR}") message(STATUS "Using LOCALEDIR=${LOCALEDIR}") endif() install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/builtin" DESTINATION "${SHAREDIR}") install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/client" DESTINATION "${SHAREDIR}") install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minimal" DESTINATION "${SHAREDIR}/games") set(MINETEST_GAME_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game") if(EXISTS ${MINETEST_GAME_SOURCE} AND IS_DIRECTORY ${MINETEST_GAME_SOURCE}) install(FILES ${MINETEST_GAME_SOURCE}/game.conf DESTINATION "${SHAREDIR}/games/minetest_game/") install(FILES ${MINETEST_GAME_SOURCE}/README.txt DESTINATION "${SHAREDIR}/games/minetest_game/") install(DIRECTORY ${MINETEST_GAME_SOURCE}/mods DESTINATION "${SHAREDIR}/games/minetest_game") install(DIRECTORY ${MINETEST_GAME_SOURCE}/menu DESTINATION "${SHAREDIR}/games/minetest_game") endif() if(BUILD_CLIENT) #install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/sounds/base/pack" DESTINATION "${SHAREDIR}/sounds/base") install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/textures/base/pack" DESTINATION "${SHAREDIR}/textures/base") endif() if(RUN_IN_PLACE) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/mods/mods_here.txt" DESTINATION "${SHAREDIR}/mods") install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures") endif() install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/fonts" DESTINATION "${SHAREDIR}") install(FILES "README.txt" DESTINATION "${DOCDIR}") install(FILES "doc/lua_api.txt" DESTINATION "${DOCDIR}") install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}") install(FILES "doc/mapformat.txt" DESTINATION "${DOCDIR}") install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}") if(UNIX AND NOT APPLE) install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6") install(FILES "misc/minetest.desktop" DESTINATION "${XDG_APPS_DIR}") install(FILES "misc/minetest.appdata.xml" DESTINATION "${APPDATADIR}") install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps") endif() if(APPLE) install(FILES "misc/minetest-icon.icns" DESTINATION "${SHAREDIR}") install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents") endif() # Subdirectories # Be sure to add all relevant definitions above this add_subdirectory(src) # CPack set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game") set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) set(CPACK_PACKAGE_VENDOR "celeron55") set(CPACK_PACKAGE_CONTACT "Perttu Ahola <celeron55@gmail.com>") if(WIN32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win64") else() set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32") endif() set(CPACK_GENERATOR ZIP) elseif(APPLE) set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx") set(CPACK_GENERATOR ZIP) else() set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux") set(CPACK_GENERATOR TGZ) set(CPACK_SOURCE_GENERATOR TGZ) endif() include(CPack) # Add a target to generate API documentation with Doxygen find_package(Doxygen) if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY) add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc COMMENT "Generating API documentation with Doxygen" VERBATIM ) endif()