aboutsummaryrefslogtreecommitdiff
path: root/src/constants.h
blob: 5ddb5465621739bb424f01632a67ccb452511e45 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
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

/*
	All kinds of constants.

	Cross-platform compatibility crap should go in porting.h.

    Some things here are legacy crap.
*/

/*
    Connection
*/

#define PEER_ID_INEXISTENT 0
#define PEER_ID_SERVER 1

// Define for simulating the quirks of sending through internet.
// Causes the socket class to deliberately drop random packets.
// This disables unit testing of socket and connection.
#define INTERNET_SIMULATOR 0
#define INTERNET_SIMULATOR_PACKET_LOSS 10 // 10 = easy, 4 = hard

#define CONNECTION_TIMEOUT 30

#define RESEND_TIMEOUT_MIN 0.1
#define RESEND_TIMEOUT_MAX 3.0
// resend_timeout = avg_rtt * this
#define RESEND_TIMEOUT_FACTOR 4

/*
    Server
*/

// This many blocks are sent when player is building
#define LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS 0
// Override for the previous one when distance of block is very low
#define BLOCK_SEND_DISABLE_LIMITS_MAX_D 1

/*
    Map-related things
*/

// The absolute working limit is (2^15 - viewing_range).
// I really don't want to make every algorithm to check if it's going near
// the limit or not, so this is lower.
// This is the maximum value the setting map_generation_limit can be
#define MAX_MAP_GENERATION_LIMIT (31000)

// Size of node in floating-point units
// The original idea behind this is to disallow plain casts between
// floating-point and integer positions, which potentially give wrong
// results. (negative coordinates, values between nodes, ...)
// Use floatToInt(p, BS) and intToFloat(p, BS).
#define BS 10.0f

// Dimension of a MapBlock
#define MAP_BLOCKSIZE 16
// This makes mesh updates too slow, as many meshes are updated during
// the main loop (related to TempMods and day/night)
//#define MAP_BLOCKSIZE 32

// Player step height in nodes
#define PLAYER_DEFAULT_STEPHEIGHT 0.6f

/*
    Old stuff that shouldn't be hardcoded
*/

// Size of player's main inventory
#define PLAYER_INVENTORY_SIZE (8 * 4)

// Default maximum hit points of a player
#define PLAYER_MAX_HP_DEFAULT 20

// Default maximal breath of a player
#define PLAYER_MAX_BREATH_DEFAULT 11

// Number of different files to try to save a player to if the first fails
// (because of a case-insensitive filesystem)
// TODO: Use case-insensitive player names instead of this hack.
#define PLAYER_FILE_ALTERNATE_TRIES 1000

// For screenshots a serial number is appended to the filename + datetimestamp
// if filename + datetimestamp is not unique.
// This is the maximum number of attempts to try and add a serial to the end of
// the file attempting to ensure a unique filename
#define SCREENSHOT_MAX_SERIAL_TRIES 1000

/*
    GUI related things
*/

// TODO: implement dpi-based scaling for windows and remove this hack
#if defined(_WIN32)
#define TTF_DEFAULT_FONT_SIZE (18)
#else
#define TTF_DEFAULT_FONT_SIZE (16)
#endif
#define DEFAULT_FONT_SIZE (10)
>320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8,00"
	Name="minetest"
	ProjectGUID="{AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}"
	RootNamespace="minetest"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="$(SolutionDir)\bin"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="1"
			UseOfATL="1"
			ATLMinimizesCRunTimeLibraryUsage="true"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include&quot;;&quot;..\jthread\jthread-1.2.1\src&quot;;&quot;..\irrlicht\irrlicht-1.7.1\include&quot;;&quot;..\zlib\zlib-1.2.5&quot;"
				PreprocessorDefinitions="WIN32;RUN_IN_PLACE"
				BufferSecurityCheck="true"
				EnableEnhancedInstructionSet="1"
				FloatingPointModel="2"
				DebugInformationFormat="1"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="wsock32.lib"
				AdditionalLibraryDirectories="&quot;..\irrlicht\irrlicht-1.7.1\lib\Win32-visualstudio&quot;;..\zlib125dll\dll32"
				IgnoreAllDefaultLibraries="false"
				GenerateDebugInformation="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCWebDeploymentTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="$(SolutionDir)\bin"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="1"
			UseOfMFC="0"
			WholeProgramOptimization="3"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="2"
				EnableIntrinsicFunctions="true"
				FavorSizeOrSpeed="1"
				OmitFramePointers="true"
				WholeProgramOptimization="true"
				AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include&quot;;&quot;..\jthread\jthread-1.2.1\src&quot;;&quot;..\irrlicht\irrlicht-1.7.1\include&quot;;&quot;..\zlib\zlib-1.2.5&quot;"
				PreprocessorDefinitions="WIN32;_HAS_ITERATOR_DEBUGGING=0;NDEBUG;_CRT_SECURE_NO_DEPRECATE;RUN_IN_PLACE"
				ExceptionHandling="2"
				BufferSecurityCheck="false"
				EnableEnhancedInstructionSet="1"
				FloatingPointModel="2"
				DebugInformationFormat="0"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="wsock32.lib"
				AdditionalLibraryDirectories="&quot;..\irrlicht\irrlicht-1.7.1\lib\Win32-visualstudio&quot;;..\zlib125dll\dll32"
				IgnoreDefaultLibraryNames="libcmtd.dll"
				GenerateDebugInformation="false"
				LinkTimeCodeGeneration="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCWebDeploymentTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
			>
			<File
				RelativePath=".\src\client.cpp"
				>
			</File>
			<File
				RelativePath=".\src\connection.cpp"
				>
			</File>
			<File
				RelativePath=".\src\debug.cpp"
				>
			</File>
			<File
				RelativePath=".\src\defaultsettings.cpp"
				>
			</File>
			<File
				RelativePath=".\src\environment.cpp"
				>
			</File>
			<File
				RelativePath=".\src\filesys.cpp"
				>
			</File>
			<File
				RelativePath=".\src\guiInventoryMenu.cpp"
				>
			</File>
			<File
				RelativePath=".\src\guiMainMenu.cpp"
				>
			</File>
			<File
				RelativePath=".\src\guiMessageMenu.cpp"
				>
			</File>
			<File
				RelativePath=".\src\guiPauseMenu.cpp"
				>
			</File>
			<File
				RelativePath=".\src\guiTextInputMenu.cpp"
				>
			</File>
			<File
				RelativePath=".\src\inventory.cpp"
				>
			</File>
			<File
				RelativePath=".\src\irrlichtwrapper.cpp"
				>
			</File>
			<File
				RelativePath=".\src\jthread\win32\jmutex.cpp"
				>
			</File>
			<File
				RelativePath=".\src\jthread\win32\jthread.cpp"
				>
			</File>
			<File
				RelativePath=".\src\light.cpp"
				>
			</File>
			<File
				RelativePath=".\src\main.cpp"
				>
			</File>
			<File
				RelativePath=".\src\map.cpp"
				>
			</File>
			<File
				RelativePath=".\src\mapblock.cpp"
				>
			</File>
			<File
				RelativePath=".\src\mapblockobject.cpp"
				>
			</File>
			<File
				RelativePath=".\src\mapnode.cpp"
				>
			</File>
			<File
				RelativePath=".\src\mapsector.cpp"
				>
			</File>
			<File
				RelativePath=".\src\materials.cpp"
				>
			</File>
			<File
				RelativePath=".\src\mineral.cpp"
				>
			</File>
			<File
				RelativePath=".\src\noise.cpp"
				>
			</File>
			<File
				RelativePath=".\src\player.cpp"
				>
			</File>
			<File
				RelativePath=".\src\porting.cpp"
				>
			</File>
			<File
				RelativePath=".\src\serialization.cpp"
				>
			</File>
			<File
				RelativePath=".\src\server.cpp"
				>
			</File>
			<File
				RelativePath=".\src\socket.cpp"
				>
			</File>
			<File
				RelativePath=".\src\test.cpp"
				>
			</File>
			<File
				RelativePath=".\src\tile.cpp"
				>
			</File>
			<File
				RelativePath=".\src\utility.cpp"
				>
			</File>
			<File
				RelativePath=".\src\voxel.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl;inc;xsd"
			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
			>
			<File
				RelativePath=".\src\client.h"
				>
			</File>
			<File
				RelativePath=".\src\clientserver.h"
				>
			</File>
			<File
				RelativePath=".\src\common_irrlicht.h"
				>
			</File>
			<File
				RelativePath=".\src\connection.h"
				>
			</File>
			<File
				RelativePath=".\src\constants.h"
				>
			</File>
			<File
				RelativePath=".\src\debug.h"
				>
			</File>
			<File
				RelativePath=".\src\environment.h"
				>
			</File>
			<File
				RelativePath=".\src\exceptions.h"
				>
			</File>
			<File
				RelativePath=".\src\heightmap.h"
				>
			</File>
			<File
				RelativePath=".\src\inventory.h"
				>
			</File>
			<File
				RelativePath=".\src\light.h"
				>
			</File>
			<File
				RelativePath=".\src\loadstatus.h"
				>
			</File>
			<File
				RelativePath=".\src\main.h"
				>
			</File>
			<File
				RelativePath=".\src\map.h"
				>
			</File>
			<File
				RelativePath=".\src\mapblock.h"
				>
			</File>
			<File
				RelativePath=".\src\mapnode.h"
				>
			</File>
			<File
				RelativePath=".\src\mapsector.h"
				>
			</File>
			<File
				RelativePath=".\src\player.h"
				>
			</File>
			<File
				RelativePath=".\src\serialization.h"
				>
			</File>
			<File
				RelativePath=".\src\server.h"
				>
			</File>
			<File
				RelativePath=".\src\socket.h"
				>
			</File>
			<File
				RelativePath=".\src\test.h"
				>
			</File>
			<File
				RelativePath=".\src\utility.h"
				>
			</File>
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
			>
		</Filter>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>