Commit Graph

62 Commits

Author SHA1 Message Date
Dániel Juhász
3face01a20 Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
2018-02-10 21:04:16 +01:00
Loïc Blot
bd6b90359c Remove DSTACK support (#6346)
Debugstacks is not useful, we don't really use it, the DebugStack is not pertinent, gdb and lldb are better if we really want to debug.
2017-08-30 08:09:41 +02:00
Loïc Blot
ae9b5e0098 Modernize code: very last fixes (#6290)
Last modernization fixes
2017-08-20 19:37:29 +02:00
Loïc Blot
de4c2e4250 ServerMap saving: cleanups (#6274)
* remove sector meta loading/saving from files which targets dead code (differs_from_disk is always empty)
* this remove empty ServerMapSector and ClientMapSector, remove MapSector childs
2017-08-19 11:29:46 +02:00
Loic Blot
b204bc4da9
clientmap, clientmedia: code modernization
* use range-based for loops
* simplify some tests
* various code style fixes
* remove debugprint in ClientMap::getBackgroundBrightness, debug code was not intended to be there
* remove unused fields in MapDrawControl
* use emplace_back instead of push_back when necessary
2017-08-17 08:26:52 +02:00
Lars Hofhansl
d1a130488e Darkness detection: Reduce chance of false positives darkening the skybox
The getBackgroundBrightness() function detects darkness in the view direction
to decide when to make the skybox dark. The volume checked was too narrow and
missed the left and right edges of the view, too easily causing a dark skybox.

Widen the checked volume to match a FOV of 72 degrees and a 16:9 aspect ratio
game window.
2017-07-30 18:28:16 +01: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
Dániel Juhász
12aad731ad Fix render order of overlays (#6008)
* Fix render order of overlays

* Use C++11 loops

* Fix time_t
2017-06-21 10:47:31 +02:00
Loïc Blot
8f7785771b Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors

* Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop)

* More classes cleanup

* More classes cleanup + change NULL tests to boolean tests
2017-06-17 19:11:28 +02:00
Loïc Blot
76be103a91 C++11 patchset 9: move hardcoded init parameters to class definitions (part 1) (#5984)
* C++11 patchset 9: move hardcoded init parameters to class definitions

C++11 introduced the possibility to define the default values directly in class definitions, do it on current code

Also remove some unused attributes

* CollisionInfo::bouncy
* collisionMoveResult::collides_xy
* collisionMoveResult::standing_on_unloaded
* Clouds::speed

* More constructor cleanups + some variables removal

* remove only write guiFormSpecMenu::m_old_tooltip
* move header included inside defintions in genericobject.h
* remove some unused since years exception classes
* remove unused & empty debug_stacks_init
* remove unused & empty content_nodemeta_serialize_legacy
* remove forgotten useless bool (bouncy) in collision.cpp code
2017-06-16 11:25:52 +02:00
Dániel Juhász
1ffb180868 Soft node overlay (#5186)
This commit adds node overlays, which are tiles that are drawn on top of
other tiles.
2017-04-21 23:34:59 +10:00
Lars Hofhansl
ba4b704ebf Allow server side occlusion culling. 2017-03-11 18:11:19 -08:00
Lars Hofhansl
3ad68c052b Perform mesh animation only once per frame. 2017-02-09 00:10:41 +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
lhofhansl
c41352a1c7 Only set material flag on rendered meshes (#5023) 2017-01-14 22:30:14 +01:00
Ner'zhul
8e7449e092 Environment & IGameDef code refactoring (#4985)
* Environment code refactoring
* Cleanup includes & class declarations in client & server environment to improve build speed
* ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts.
* Cleanup IGameDef
  * Move ITextureSource* IGameDef::getTextureSource() to Client only.
  * Also move ITextureSource *IGameDef::tsrc() helper
  * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call
  * drop unused emerge() call
  * cleanup server unused functions (mentionned before)
* Drop one unused parameter from ContentFeatures::updateTextures
* move checkLocalPrivilege to Client
* Remove some unnecessary casts
* create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it
* Fix some comments
* Change required IGameDef to Server/Client pointers
* Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects
* Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu
* drop ClientMap::sectorWasDrawn which is unused
2017-01-09 20:39:22 +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
Lars Hofhansl
7387b19021 Pull occlusion check out of loop, and minor code cleanups. 2017-01-03 08:14:58 +01:00
Rogier
4d4b8bb8a4 Move PP() and PP2() macros to basic_macros.h
Instead of redefining them everywhere.
2016-12-24 00:32:50 +00:00
lhofhansl
24edfb77af Fix occlusion culling, again (#4930) 2016-12-19 06:43:04 +01:00
lhofhansl
e4f7ce1985 Fix occlusing counting (#4922) 2016-12-18 22:25:42 +10:00
paramat
c05aac3766 Occlusion culling: Add comments, minor code improvements
Remove unnecessary code.
Use '/ 2.0f' because endoff is a float.
2016-11-09 00:09:35 +00:00
Lars Hofhansl
2b21cac1d8 Occlusion culling: Fix 'end offset' distance, half this for centre point
'endoff', the maximum diagonal of a mapblock, was incorrectly calculated.
Half this value for the centre point of the mapblock.
2016-11-08 15:12:08 +00:00
lhofhansl
f8fd432dca Add debug priv, and allow player to display the scene as wire-frame. (#4709) 2016-11-04 03:14:32 +01:00
RealBadAngel
b2aabdfe07 Camera: remove auto tune FPS, single view range setting 2016-02-21 18:18:13 +01:00
paramat
997be666e3 Clientmap: Define p_nodes_min/max as v3s32 instead of v3s16
'cam_pos_nodes -/+ box_nodes_d' can exceed the range of v3s16
when a player is near the world edge using a large view range
This previously caused world to disappear
Create new function getBlocksInViewRange() called from
updateDrawList() and renderMap()
Correct code style throughout updateDrawList() and renderMap()
2016-02-19 14:51:41 +00:00
nerzhul
fefa148d69 v2d & aabbox3d<f32> & sky cleanups
* Sky: rename Box => m_box and inline getBoundingBox
* Uniformize aabbox3d<f32> to aabb3f
2016-02-11 16:55:15 +01:00
Kahrl
180893e79d Remove ClientMap::m_camera_mutex
All places that lock this mutex are only called by the main thread:
ClientMap::updateCamera(), ClientMap::updateDrawList(), ClientMap::renderMap(), ClientMap::renderPostFx().
2016-02-09 07:16:00 +00:00
ShadowNinja
6f2d785d0f Rename macros with two leading underscores
These names are reserved for the compiler/library implementations.
2015-10-14 02:39:37 -04:00
David Jones
34b7a147dc Change i++ to ++i 2015-08-25 18:33:52 -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
RealBadAngel
43fcfbfe05 Improved parallax mapping. Generate heightmaps on the fly. 2015-06-14 21:13:36 +02:00
Craig Robbins
9527984dbc Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
Craig Robbins
ced6d20295 For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
Loic Blot
9749d9fee6 Fix issue #2441: crash on respawn, since a conversion std::list to std::vector on Environment.cpp
* Also change some std::list to std::vector for ClientMap::renderMap
* Remove disabled code in ClientMap::renderMap, disabled since a long time
2015-03-05 15:36:20 +01:00
Miguel Almeida
056e8f7839 Fix occlusion 2015-03-02 12:09:02 +01:00
Loic Blot
fd70f4f2f0 Replace std::list by std::vector into ClientMap::updateDrawList, Map::timerUpdate and ServerMap::save().
This will speedup the loop reading into those functions
2015-02-17 15:28:49 +01:00
kwolekr
38bd9e93a2 Fix all warnings and remove -Wno-unused-but-set cflag 2015-01-18 23:29:19 -05:00
Craig Robbins
3d29be24e0 Add display_gamma option for client 2014-12-31 02:44:31 +10:00
Craig Robbins
2b119e1e19 Performance of main client loop up to 2x faster In places, up to 3 times faster
NOTE 1: This does not mean a 2x increase in framerate. Increase in fps may be up to 1-2fps
NOTE 2: This local 'caching' of settings is not optimal and an alternative solution will be worked on after 0.4.11 is released
2014-12-07 00:51:01 +10:00
sapier
334ec4bb1b Avoid doing a full material compare if not even first texture does match 2014-06-23 00:13:41 +02:00
sapier
09970b7b6d Add support for interlaced polarized 3d screens
Add (experimental) support for topbottom as well as sidebyside 3d mode
2014-05-18 01:08:13 +02:00
BlockMen
c0ab09af74 Add player:set_eye_offset() by @MirceaKitsune and clean up 2014-04-12 17:44:20 +02:00
BlockMen
a1db9242ec Add third person view 2014-04-12 17:44:15 +02:00
Novatux
062de11b4c Fix rendering glitches when far from the center of the map 2014-03-04 20:12:10 +01:00
sapier
04e9a9d541 Cleanup jthread and fix win32 build 2013-12-01 16:25:46 +01:00
Perttu Ahola
c50c9a10f1 Fix and improve view range tuner 2013-08-03 18:46:18 +03:00
Ilya Zhuravlev
6a1670dbc3 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00
Sfan5
6d0ea26c2d Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam
497ff1ecd6 Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00