Merge branch 'view_bobbing_and_vielded_tool'
[oweals/minetest.git] / src / constants.h
1 /*
2 Minetest-c55
3 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef CONSTANTS_HEADER
21 #define CONSTANTS_HEADER
22
23 /*
24         All kinds of constants.
25
26         Cross-platform compatibility crap should go in porting.h.
27 */
28
29 //#define HAXMODE 0
30
31 #define DEBUGFILE "debug.txt"
32
33 // Define for simulating the quirks of sending through internet.
34 // Causes the socket class to deliberately drop random packets.
35 // This disables unit testing of socket and connection.
36 #define INTERNET_SIMULATOR 0
37
38 #define CONNECTION_TIMEOUT 30
39
40 #define RESEND_TIMEOUT_MIN 0.333
41 #define RESEND_TIMEOUT_MAX 3.0
42 // resend_timeout = avg_rtt * this
43 #define RESEND_TIMEOUT_FACTOR 4
44
45 #define PI 3.14159
46
47 // The absolute working limit is (2^15 - viewing_range).
48 // I really don't want to make every algorithm to check if it's 
49 // going near the limit or not, so this is lower.
50 #define MAP_GENERATION_LIMIT (31000)
51
52 // Size of node in rendering units
53 #define BS 10
54
55 #define MAP_BLOCKSIZE 16
56 /*
57         This makes mesh updates too slow, as many meshes are updated during
58         the main loop (related to TempMods and day/night)
59 */
60 //#define MAP_BLOCKSIZE 32
61
62 // Sectors are split to SECTOR_HEIGHTMAP_SPLIT^2 heightmaps
63 #define SECTOR_HEIGHTMAP_SPLIT (MAP_BLOCKSIZE/8)
64
65 // Time after building, during which the following limit
66 // is in use
67 //#define FULL_BLOCK_SEND_ENABLE_MIN_TIME_FROM_BUILDING 2.0
68 // This many blocks are sent when player is building
69 #define LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS 0
70 // Override for the previous one when distance of block
71 // is very low
72 #define BLOCK_SEND_DISABLE_LIMITS_MAX_D 1
73
74 #define PLAYER_INVENTORY_SIZE (8*4)
75
76 #define SIGN_TEXT_MAX_LENGTH 50
77
78 // Whether to catch all std::exceptions.
79 // Assert will be called on such an event.
80 // In debug mode, leave these for the debugger and don't catch them.
81 #ifdef NDEBUG
82         #define CATCH_UNHANDLED_EXCEPTIONS 1
83 #else
84         #define CATCH_UNHANDLED_EXCEPTIONS 0
85 #endif
86
87 /*
88         Collecting active blocks is stopped after object data
89         size reaches this
90 */
91 #define MAX_OBJECTDATA_SIZE 450
92
93 /*
94         This is good to be a bit different than 0 so that water level
95         is not between two MapBlocks
96 */
97 #define WATER_LEVEL 1
98
99 // Length of cracking animation in count of images
100 #define CRACK_ANIMATION_LENGTH 5
101
102 // Some stuff needed by old code moved to here from heightmap.h
103 #define GROUNDHEIGHT_NOTFOUND_SETVALUE (-10e6)
104 #define GROUNDHEIGHT_VALID_MINVALUE    ( -9e6)
105
106 #endif
107