Commit Graph

341 Commits

Author SHA1 Message Date
adrido d7343b6c93 Fix msvc annoyances (#5963)
* MSVC: Fix '/std:c++11' is not a valid compiler option

* MSVC/MINGW: Define 'WIN32_LEAN_AND_MEAN' for the whole project

In some obscure cases 'Windows.h" got includet before that definition, which leaded to compilation warnings+errors

* MSVC: '/arch:SSE' is only available for x86

* MSVC: Fix float conversation

* MSVC/MINGW: use winthreads on Windows

* MSVC: 'USE_CMAKE_CONFIG' might be already definied by CMake build system

* MSVC: Use all available cpu cores for compiling

* Add missing include ctime and use std::time_t
2017-06-27 11:54:40 +02:00
Loïc Blot b3a36f7378 Isolate irrlicht references and use a singleton (#6041)
* Add Device3D class which will contain IrrlichtDevice interface

move getSupportedVideoDrivers to Device3D

Add Device3D singleton & use it in various places

Rename Device3D to Rendering engine & add helper functions to various device pointers

More singleton work

RenderingEngine owns draw_load_screen

move draw functions to RenderingEngine

Reduce IrrlichtDevice exposure and guienvironment

RenderingEngine: Expose get_timer_time() to remove device from guiEngine

Make irrlichtdevice & scene manager less exposed

* Code style fixes

* Move porting::getVideoDriverName, getVideoDriverFriendlyName, getDisplayDensity, getDisplaySize to RenderingEngine

Fix XORG_USED macro -> RenderingEngine + create_engine_device from RenderingEngine constructor directly

* enum paralax => enum parallax
2017-06-26 20:11:17 +02:00
Loïc Blot 16938adfc0 Merge cguittfont lib in irrlicht change folder. (#6016)
* Merge cguittfont lib in irrlicht change folder.

This remove hack and static lib for FreeType
2017-06-20 17:18:34 +02:00
Loïc Blot ddcd026344 Remove legacy content_abm.{cpp,h} 2017-06-14 16:23:08 +02:00
red-001 26e2eb019a Improve the path select GUI (#5852)
- Allow lua to chose whatever directories or files can be selected
- Fix selecting directories
- Rename dialog to `guiPathSelectMenu` from `guiFileSelectMenu`
- Rename lua function for opening the menu from `show_file_open_dialog` to `show_path_select_dialog`
- Remove duplicate code and fix code style.

Related changes
- fix `clang-format` whitelist.
- Regenerate minetest.conf.example
2017-06-11 09:43:31 +02:00
Loïc Blot 8bdde45895 Revert "Remove deprecated code segments (#5891)"
This reverts commit 599e13e95e.
2017-06-06 16:19:04 +02:00
Thomas--S 599e13e95e Remove deprecated code segments (#5891) 2017-06-04 21:42:32 +02:00
Loic Blot bf6569b570 Minetest for C++11 (CMakeLists + Travis)
* Move GCC to GCC 6 & GCC 7
* Move Clang to Clang 3.6 & Clang 4.0
* LINT moves from Clang 3.9 to Clang 4.0
* Move XCode 7.3 to 8.0
* Use more travis tricks to install compilers instead of adding complexity to our build script
* Clang format fixes on checked files (compat Cpp11 instead of Cpp03)
* Mingw GCC update from 4.8.4 to 5.3 (Ubuntu Xenial)
* Drop mingw cmake generated files and add them to gitignore
2017-06-04 09:57:08 +02:00
ShadowNinja 77597c4ff3 Clean up numeric.h and split FacePositionCache from it
I also optiized FacePositionCache a bit: I removed a map
lookup and vector copy from both branches of getFacePosition.
2017-05-06 16:09:45 -04:00
Vaughan Lapsley c874bfa5c3 Remove CMAKE -ffast-math flag from OSX/FreeBSD
Fixes issue: #4274

I have tested on MacOS 10.12.4

Requires testing on:
FreeBSD, Windows and Linux which I do not have access to.
2017-05-04 13:24:36 +02:00
Loïc Blot 29ab20c272 Player data to Database (#5475)
* Player data to Database

Add player data into databases (SQLite3 & PG only)

PostgreSQL & SQLite: better POO Design for databases

Add --migrate-players argument to server + deprecation warning

* Remove players directory if empty
2017-04-23 14:35:08 +02:00
Perttu Ahola 04cc9de8f2 MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock copying done in the main thread
Cache size is configurable by the meshgen_block_cache_size (default 20 MB).

New profiler stats:
- MeshUpdateQueue MapBlock cache hit %
- MeshUpdateQueue MapBlock cache size kB

Removes one type of stutter that was seen on the client when received MapBlocks
were being handled. (the "MeshMakeData::fill" stutter)

Kind of related to at least #5239

Originally preceded by these commits, now includes them:
- Move the mesh generator thread into src/mesh_generator_thread.{cpp,h}
- mesh_generator_thread.cpp: Update code style
- MeshUpdateThread: Modify interface to house a different implementation: Actual functionality will be changed by next commits.
- MeshMakeData: Add fillBlockData() interface (so that caller can fill in stuff from eg. a MapBlock cache)
2017-04-17 14:58:29 +03:00
adrido 676951d90d Windows: Skip cmd for release builds (#5416) 2017-04-07 07:14:39 +02:00
Loïc Blot 86b1542181 Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ instead of src/ (#5473)
* Update embedded jsoncpp from unk version to 0.10.6

0.10.6 is last release without c++11

* Make jsoncpp more compliant with its amalgamate

Jsoncpp cpp file should be upper, make the library like it does in amalgamate

* Reorganization: move minetest embedded libs outside of source tree to /lib

* Fix a dead grep in LINT
2017-04-02 10:51:50 +02:00
rubenwardy f2aa2c6a98 Add ItemStack key-value meta storage 2017-02-04 22:07:55 +00:00
rubenwardy bbdd869d72 Derive NodeMetadata from Metadata 2017-02-04 22:07:55 +00:00
red-001 0dada51a55 Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072) 2017-01-20 23:19:41 +01:00
Loic Blot 98e36d7d68 Move ServerEnvironment to dedicated cpp/header files
* also cleanup some unneeded inclusions
2017-01-08 12:16:06 +01:00
Loic Blot eb2c19bbed Move ClientEnvironment to dedicated cpp/header files 2017-01-08 12:16:06 +01:00
Dániel Juhász 3f8261830e Improve getPointedThing() (#4346)
* Improved getPointedThing()

The new algorithm checks every node exactly once.
Now the point and normal vector of the collision is also returned in the
PointedThing (currently they are not used outside of the function).
Now the CNodeDefManager keeps the union of all possible nodeboxes, so
the raycast won't miss any nodes. Also if there are only small
nodeboxes, getPointedThing() is exceptionally fast.
Also adds unit test for VoxelLineIterator.

* Cleanup, code move

This commit moves getPointedThing() and
Client::getSelectedActiveObject() to ClientEnvironment.
The map nodes now can decide which neighbors they are connecting to
(MapNode::getNeighbors()).
2017-01-04 19:18:40 +01:00
sfan5 523f0e8c5b Move TileAnimation code to seperate file 2017-01-02 15:28:06 +01:00
est31 ba52a34f94 Don't ship with broken languages (#4940) 2016-12-21 14:15:48 +01:00
MillersMan 9714cdcf4b Liquids: Update flow on block load
When loading a block add liquid-nodes that might flow away or spread to
neighbours to the transforming_liquid queue.
2016-12-07 04:06:00 +00:00
adrido 295232667e Windows: Add manifest file and set "High DPI Aware" true
This resolves washy font and incorrect mouse handling on Windows if
a screen with high DPI is used.
2016-11-07 21:55:01 +00:00
SmallJoker ad4bf2ccf9 MSVC: Generate debug information for release builds (#4674)
Replace parameters with the equivalent /Ox
2016-11-06 11:14:36 -05:00
Rogier a4a9ee94f3 Disable cmake message concerning WIN32 on non-windows systems 2016-10-11 07:29:04 +02:00
Loic Blot 569b89b36f Move RemotePlayer code to its own cpp/header 2016-10-08 22:27:44 +02:00
sfan5 45a9145a4b Only include keycode unittests in client build (fixes #4559) 2016-09-29 16:31:31 +02:00
sfan5 af4c2107e0 Don't use ZLIB_WINAPI if the required DLL is not provided to CMake
This allows you to use an stdcall zlib (zlib1.dll instead of zlibwapi.dll)
when building Minetest for win32.
2016-09-21 20:16:31 +02:00
Eric Mountain 9dd22aebc7 Fix "unknown CMake command "check_library_exists" (#4517)
Adds CMakeLists.txt include to fix this issue:

$ cmake . -DBUILD_SERVER=TRUE -DBUILD_CLIENT=FALSE \
   -DCMAKE_BUILD_TYPE=Release -DENABLE_CURL=TRUE -DENABLE_CURSES=FALSE \
   -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=FALSE \
   -DENABLE_POSTGRESQL=FALSE -DENABLE_SOUND=FALSE -DENABLE_LUAJIT=TRUE \
   -DIRRLICHT_SOURCE_DIR=$HOME/irrlicht-1.8.4 -LH
...
CMake Error at src/CMakeLists.txt:339 (check_library_exists):
  Unknown CMake command "check_library_exists".
...
2016-09-13 23:05:21 -04:00
kwolekr 3c63c3044d Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system.
- MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap,
  instead of the EmergeManager.
- New Script API functions added:
    core.get_mapgen_setting
    core.get_mapgen_setting_noiseparams,
    core.set_mapgen_setting, and
    core.set_mapgen_setting_noiseparams.
- minetest.get/set_mapgen_params are deprecated by the above new functions.
- It is now possible to view and modify any arbitrary mapgen setting from a mod,
  rather than the base MapgenParams structure.
- MapgenSpecificParams has been removed.
2016-07-03 15:38:36 -04:00
David Carlier b6eef1c0c2 openbsd's port fix for non Linux systems w/o libRT
X11 headers are not always in expected locations, add them to include list.

Modifications by est31: indentation fixes, commit message improved
2016-07-03 13:01:49 +02:00
Ekdohibs 14ef2b445a Add colored text (not only colored chat).
Add documentation, move files to a proper place and avoid memory leaks.
Make it work with most kind of texts, and allow backgrounds too.
2016-05-31 17:34:29 +02:00
Loic Blot ce42ff9cf7 Implement a PostgreSQL backend 2016-05-22 11:34:47 +02:00
ShadowNinja 0079887b64 Move AreaStore to util 2016-03-07 16:33:20 -05:00
Duane Robertson 3c6b2ffb10 Add Valleys mapgen. 2016-01-14 05:04:29 +00:00
Ferdinand Thiessen 70ece71ee4 Improve LuaJIT detection
On openSUSE luajit is not detected correctly.
This is because openSUSE is using a lua version suffix, like other Linux distributions do it also.
So the include directory is:
include/luajit-5_1-2.0
2015-12-05 23:31:09 +01:00
paramat 76c9abe4c8 Mapgen: Add flat mapgen in hidden form 2015-11-11 09:37:54 +00:00
est31 5e507c9829 Add server side ncurses terminal
This adds a chat console the server owner can use for administration
or to talk with players.
It runs in its own thread, which makes the user interface immune to
the server's lag, behaving just like a client, except timeout.
As it uses the same console code as the f10 console, things like nick
completion or a scroll buffer basically come for free.
The terminal itself is written in a general way so that adding a
client version later on is just about implementing an interface.

Fatal errors are printed after the console exists and the ncurses
terminal buffer gets cleaned up with endwin(), so that the error still
remains visible.

The server owner can chose their username their entered text will
have in chat and where players can send PMs to.
Once the username is secured with a password to prevent anybody to
take over the server, the owner can execute admin tasks over the
console.

This change includes a contribution by @kahrl who has improved ncurses
library detection.
2015-11-06 08:51:14 +01:00
paramat e62eac49d5 Mapgen: Add 4D fractal mapgen 2015-10-06 06:43:04 +01:00
ShadowNinja e511282d78 Warn when building without cURL 2015-09-01 14:43:59 -04:00
ShadowNinja 7419504079 Enable server build when no builds are enabled 2015-09-01 14:43:59 -04:00
ShadowNinja e4bff8be94 Clean up threading
* Rename everything.
    * Strip J prefix.
    * Change UpperCamelCase functions to lowerCamelCase.
  * Remove global (!) semaphore count mutex on OSX.
  * Remove semaphore count getter (unused, unsafe, depended on internal
    API functions on Windows, and used a hack on OSX).
  * Add `Atomic<type>`.
  * Make `Thread` handle thread names.
  * Add support for C++11 multi-threading.
  * Combine pthread and win32 sources.
  * Remove `ThreadStarted` (unused, unneeded).
  * Move some includes from the headers to the sources.
  * Move all of `Event` into its header (allows inlining with no new includes).
  * Make `Event` use `Semaphore` (except on Windows).
  * Move some porting functions into `Thread`.
  * Integrate logging with `Thread`.
  * Add threading test.
2015-08-23 22:04:06 -04:00
est31 c30a2d6854 Add AreaStore data structure 2015-07-27 06:42:56 +02:00
kwolekr 4e28c8d3c8 Fix *BSD build with GNU iconv 2015-06-29 12:32:01 +02:00
RealBadAngel ffd16e3fec Add minimap feature 2015-06-27 03:42:01 +02:00
est31 572990dcd3 Add utf-8 conversion utilities and re-add intlGUIEditBox 2015-06-13 19:49:55 +02:00
kwolekr 6c5a6967ec Split ObjDef/ObjDefManager out to objdef.cpp 2015-05-18 22:30:25 -04:00
kwolekr 11a96e4901 Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler warnings 2015-05-16 20:15:03 -04:00
est31 181f7baa45 Add LibGMP
Uses system provided libgmp if found, if not it falls back to mini-gmp.
2015-05-11 17:48:33 +02:00