Commit Graph

582 Commits

Author SHA1 Message Date
Loïc Blot 7b74f04a61 [CSM] Fix minimap problems (#5405)
This fixes issue #5404
2017-03-17 07:54:49 +01:00
Loïc Blot 40ce538aad [CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
2017-03-16 10:34:54 +01:00
nerzhul 44ca9c9cb2 [CSM] Add enable_client_modding param (default: false) 2017-03-13 23:56:05 +01:00
red-001 0727bb3ddd [CSM] Add `on_punchnode` callback 2017-03-13 23:56:05 +01:00
red-001 073f5cf03d [CSM] Add `on_dignode` callback (#5140) 2017-03-13 23:56:05 +01:00
red-001 c42c53fccf [CSM] Add local formspecs. (#5094) 2017-03-13 23:56:05 +01:00
Loïc Blot 9978f5af82 [CSM] Add on_death, on_hp_modification & oh_damage_taken callbacks (#5093)
* Add on_death callback
* Add on_hp_modification & on_damage_taken callbacks
* move preview code to preview.lua
2017-03-13 23:56:05 +01:00
Loic Blot 2efae3ffd7 [CSM] Client side modding
* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
  This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
2017-03-13 23:56:05 +01:00
Dániel Juhász 00123ee04d Fixes for colorwallmounted and colorfacedir nodes
Correct node placement prediction for attached colorwallmounted nodes.
Correct placement direction for colorfacedir and colorwallmounted nodes.
Correct detatch mechanism for attached colorwallmounted nodes.
2017-02-18 22:47:24 +00:00
paramat 984e063374 Footsteps: Fix offset footstep and shallow water sound bugs
Fix footstep sounds coming from nodes to either side when walking on a
1 node wide row of nodebox slabs such as default:snow.
Fix sand footsteps when swimming in 1 node deep water.

Use a new function 'getFootstepNodePos()' instead of 'getStandingNodePos()'
to avoid using a horizontally-offset 'sneak node' for sounds.

Sound is selected from the node BS * 0.05 below the player's feet, so
that 1/16th slabs will play the slab sound but 1/32nd slabs will not.
If the player is not 'touching ground' the node detection position is
changed to BS * 0.5 below to preserve footstep sounds when landing after
a jump or fall.
2017-02-12 01:52:12 +00:00
Dániel Juhász f0e3abc64d Re-add halo highlight (#5130)
Due to a rebase mistake halo highlighting was disabled. This commit
re-adds that feature.
2017-01-30 11:47:36 +10:00
Ezhh 0c9189d109 Add console height setting (#5136) 2017-01-30 02:10:17 +10:00
Zeno- 707e27b5c2 Rename height to scale for openConsole() (#5139)
For Game::openConsole() and GUIChatConsole::openConsole() the
parameter name 'height' is misleading because it's actually a
percentage of the screen/window height.
2017-01-29 19:26:00 +10:00
Dániel Juhász d04d8aba70 Add hardware node coloring. Includes:
- Increase ContentFeatures serialization version
- Color property and palettes for nodes
- paramtype2 = "color", "colored facedir" or "colored wallmounted"
2017-01-23 07:27:12 +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
sfan5 084cdea686 Irrlicht 1.9 support 2016-12-26 22:36:22 +01:00
rubenwardy 0fdf24d64a Fix camera jumping on Android when panning past 0/360 mark 2016-12-12 13:20:18 +00:00
Rogier 02112f84e2 View range: Set maximum to 4000 nodes
The network protocol does not support larger than 255 mapblocks.
2016-12-12 07:20:50 +00:00
Rogier-5 60772071e9 Fix computation of viewing range (in blocks) sent to server (#4882)
Fixes #4878

Also remove an artificial viewing range reduction that
(presumably) was added to compensate for miscomputed
viewing ranges, and that doesn't seem to be needed any
more (thanks to lhofhansl).
2016-12-11 19:49:49 +01:00
Lars Hofhansl 075833e393 Fog: Make fraction of visible distance at which fog starts configurable
Optimise the fetching of global settings 'camera_smoothing',
'cinematic' and 'cinematic_camera_smoothing'.
Cache 'cam_smoothing'.
2016-12-07 04:07:54 +00:00
TeTpaAka 785a9a6c1a Wieldhand: Allow overriding the hand 2016-11-26 03:49:30 +00:00
orwell96 0d1c9598a0 Make supplying empty formspec strings close the formspec (#4737)
This will only happen if the formname matches or if formname is "".
2016-11-23 02:15:22 +10:00
ShadowNinja 4bf4154cad Fix superflous shader setting updates (#4800)
This improves rendering performance by ~40%
2016-11-23 00:05:39 +10:00
RealBadAngel 68f5b877c7 Halo: Highlight selected face
This is a slightly modified and cleaned up version of #3774 by RealBadAngel.
By sofar: Remove color change (just make it lighter) and some minor cleanups.
2016-11-12 06:41:04 +00:00
lhofhansl dde66a82ed Cycle directly to nothing shown instead of showing the profiler graph again
Fix for previous commit.
2016-11-04 05:08:23 +01: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
Hugo Locurcio d43326021a Rename testsounds/ directory to sounds/ (#1984) 2016-10-30 14:36:57 +10:00
paramat 0c76303186 Damage flash: Reduce maximum alpha. Avoid fade overload
Flash alpha maximum is reduced from 180 to 127 to avoid player blindness
in combat. Flash alpha minimum is unchanged.
The 'damage_flash' value is now limited to max alpha, to avoid multiple
hits creating a huge value that causes flash to stay at maximum alpha
for a long period. Now alpha always starts to fade immediately after
taking damage.
Both problems can be seen in Minetest let's play videos.
Simplify and optimise some code.
2016-10-21 05:48:53 +01:00
Lars Hofhansl a291cd6132 Revert changes to toggleNoClip and toggleFreeMove 2016-10-17 20:26:48 +02:00
Lars Hofhansl 3253b6bd22 Don't use day light sky unless noclip and free_move are enabled 2016-10-17 20:26:48 +02:00
Lars Hofhansl 0ad40fd484 Use range-based fog instead of z-plane based. 2016-10-13 23:30:15 +02:00
sfan5 0b27a70b29 Don't use unordered maps for ProfilerGraph (fixes flickering) 2016-10-12 18:42:18 +02:00
Rui b3fc133442 Remove unused parameter of GUIVolumeChange 2016-10-09 10:35:51 +02:00
Loic Blot 8bcd10b872 Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)
* LocalPlayer take ownership of maxHudId as it's the only caller
* RemotePlayer take ownership of day night ratio as it's the only user
* Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call)
* getPlayerSAO is now only RemotePlayer call
* get/setHotbarItemCount is now RemotePlayer owned
* Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type
* PlayerSAO now uses RemotePlayer instead of Player because it's only server side
* ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
2016-10-08 11:36:28 +02:00
Loic Blot 613797a304 Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
2016-10-05 10:53:19 +02:00
est31 d767f025cb Client: disable pre v25 init sending by default
Disable the ability to connect to old servers by default to
improve password security.

If people still want to connect to old (0.4.12 and earlier)
servers, they can flip the send_pre_v25_init setting.

Add the ability to detect if we've tried to connect
to a server which only supports the pre v25 init protocol,
and show an apropriate error message. Most times the error
will already be catched at the serverlist level, the
detection mechanism only acts as last resort, because the
"Connection timed out" error message that would be shown
otherwise would be very confusing.

Automatic "fixing" of this condition is not desired,
as it would allow for downgrade attacks.

As already 161 of the 167 servers on the serverlist
support the new srp based auth protocol (> 96%),
the breakage should be minimal.

Follow up of commit

af30183124 "Add option to not send pre v25 init packet"

Also change the pessimistic assumption of masterlist
server versions to optimistic, in order to avoid buggy
behaviour (favourites not in the serverlist would be
denied to connect to, etc).
2016-08-22 20:23:28 +02:00
Esteban I. Ruiz Moreno 2c31b79235 Add zoom, tweakable with zoom_fov, default key: Z (like optifine) 2016-08-10 12:18:25 +02:00
sfan5 7a532056e2 Use mathematical function to determine yaw direction 2016-07-05 20:36:05 +02:00
est31 e1aa98fe07 Remove top left minetest watermark
Move version information into the window caption.

On popular player request.

Fixes #4209.
2016-07-03 21:49:33 +02:00
est31 2060fd9cbe Initial Gamepad support
Adds initial ingame gamepad support to minetest.

Full Formspec support is not implemented yet and
can be added by a later change.
2016-06-03 19:42:57 +02:00
est31 1e86c89f36 Input related generalisations
* Move key types into own file
* Use Generalized input methods in game.cpp
2016-06-03 19:42:57 +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
TriBlade9 1d40385d4a Colored chat working as expected for both freetype and non-freetype builds. @nerzhul improvements * Add unit tests * Fix coding style * move guiChatConsole.hpp to client/ 2016-05-31 17:34:29 +02:00
est31 fa6b21a15b Tell irrlicht if we handle a key or not.
We can remove the function in MtNativeActivity now
as it serves precisely that purpose: to tell irrlicht
that we handled the esc key.

TODO for later:
 * Perhaps try to find a more performant container than KeyList
2016-05-26 20:33:33 +02:00
Ekdohibs 48939df9a5 Escape more strings: formspecs, item descriptions, infotexts...
Also, change the escape character to the more standard \x1b
Thus, it can be used in the future for translation or colored text,
for example.
2016-04-24 03:54:11 +10:00
TriBlade9 6530ed4dd8 Add option to disable entity selectionboxes. (#3992)
Setting only loaded once, default value is to enable them.
2016-04-14 11:20:11 +02:00
Auke Kok 80cec4702d Fix connected nodes' selection boxes.
This allows the player to more easily target and punch connected
nodeboxes, especially if they have a fixed nodebox that is very
small, like technic cabling, or xpanes. Tried it on fences and
my xpane conversion, and happy with the result.
2016-03-21 17:42:20 +00:00
Auke Kok e737b1c271 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
ShadowNinja 9dd38cf968 Add Android chat form 2016-03-02 23:23:31 -05:00
ShadowNinja 3edb7575a1 Unlock cursor when opening console 2016-03-02 23:23:31 -05:00
Esteban I. Ruiz Moreno effa24737d Use the console instead of a dedicated window when pressing keymap_chat/cmd
keymap_console opens a full window for chat history browsing.
2016-03-02 23:23:31 -05:00
RealBadAngel 9961185550 Fix getting pointed node
Fixes #3719
Closes #3753
2016-02-22 15:54:32 +01:00
RealBadAngel b2aabdfe07 Camera: remove auto tune FPS, single view range setting 2016-02-21 18:18:13 +01:00
RealBadAngel c3b279750e Move object nametags to camera 2016-02-18 16:43:29 +01:00
RealBadAngel cfc8e44759 Use proper variable types for uniform sampler layers 2016-02-14 10:01:30 +01:00
RealBadAngel b44da4916a Cleanup selection mesh code, add shaders for halo and selection boxes 2016-02-08 03:57:42 -05:00
RealBadAngel 87291ea44a Show infotext with description for item entities 2016-01-18 17:21:41 +00:00
Dalai Felinto 9943ae3f1a New 3D Mode: Pageflip
The pageflip mode requires a stereo quadbuffer, and a modern graphic
card. Patch tested with NVidia 3D Vision.

The mini-map is not drawn, but that's what is done for topbottom and
sidebyside modes as well.

Also most of the time the user would prefer the HUD to be off. That's
for the user to decide though, and toggle it manually.

Finally, the interocular distance (aka eye separation) is twice as much
as the "3d_paralax_strength" settings. I find this a strange design
decision. I didn't want to chance this though, since it's how the other
3d modes interpret this settings.
2016-01-09 16:52:29 +01:00
est31 a142e4f4b2 Fix client crashing when connecting to server
My commit

e2d54c9f92 "shutdown when requested from lua in singleplayer too"

broke minetest's feature to connect to servers. The client crashed
after the connection init was complete.

Thanks to @sofar for reporting the bug.

Fixes #3498.
2015-12-30 00:50:50 +01:00
est31 e2d54c9f92 shutdown when requested from lua in singleplayer too
Before, minetest.request_shutdown didn't shut down
singleplayer instances or server instances from the server tab.

This commit fixes this. Fixes #3489.
2015-12-29 00:40:22 +01:00
Sapier 06632205d8 Android: Implement Autohiding button bars to cleanup screen 2015-12-18 20:35:54 +01:00
Sapier 6a7e1667f6 Android: Fix pressed buttons not beeing cleared on opening menu 2015-12-17 20:43:25 +01:00
Alex Ford 97908cc656 Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
Amaz e664abeb88 Add a status text for autorun 2015-11-15 13:42:31 +01:00
BlockMen 2a12579fab Add support for audio feedback if placing node failed 2015-11-07 13:23:38 +01:00
gregorycu 5c3546e459 Speed up saving of profiling data by 27x
On Windows Release x64 bit build this changes:

ProfilerGraph::put
1.68% -> 0.061%

ProfilerGraph::draw
12% -> 17.%

So yes, there is a tradeoff between saving profiling data
(executed always) and drawing the profiler graph (executed very rarely).
But usually you don't have the profiler graph open.
2015-11-02 13:25:21 +01:00
Duane Robertson b6dfae0221 WoW-style Autorun
This allows the player to toggle continuous forward with a key (F by default),
so we don't have to hold down the forward key endlessly.
2015-10-29 21:48:57 +01:00
BlockMen 127b9aed09 Fix on_rightclick() being called directly after placing node
fixes https://github.com/minetest/minetest_game/issues/537
2015-10-24 12:18:57 +02:00
est31 6b0cae5a9d Remove wstrgettext
Everywhere where wstrgettext was used, its output was converted back
to utf8. As wstrgettext internally converts the return value
from utf8 to wstring, it has been a waste. Remove the function, and
use strgettext instead.
2015-10-18 02:29:06 +02:00
ShadowNinja 2139d7d45f Refactor logging
- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
2015-10-14 01:03:54 -04:00
est31 0903190ba2 Hide minimap if it has been disabled by server 2015-09-01 19:00:33 +02:00
David Jones 34b7a147dc Change i++ to ++i 2015-08-25 18:33:52 -04:00
kwolekr be9024a397 minimap: Add ability to disable from server 2015-08-13 15:05:48 -04:00
est31 a670ecfde4 game.cpp: Update cached settings 2015-08-13 20:05:53 +02:00
est31 3b50b2766a Optional reconnect functionality
Enable the server to request the client to reconnect.

This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
2015-07-23 07:38:13 +02:00
RealBadAngel 655fc6010f Fix relief mapping issues 2015-07-16 15:36:48 +02:00
Kahrl b30e8d8ec6 Make serialization error message translatable
Also don't show "probably running a different version" message in simple singleplayer mode
2015-07-14 19:01:33 +02:00
est31 cb8978fb1d Settings: pass name to callbacks by reference
Spare some copies.
2015-07-09 08:25:17 +02:00
est31 b0784ba871 Use UTF-8 instead of narrow
Use wide_to_utf8 and utf8_to_wide instead of wide_to_narrow and narrow_to_wide at almost all places.
Only exceptions: test functions for narrow conversion, and chat, which is done in a separate commit.
2015-07-08 10:12:44 +02:00
kwolekr e234d8b378 Clean-up Minimap code
- Fixed race conditions
- Fixed null dereference
- Fixed out-of-bounds array access
- MinimapMapblock is now allocated and added to update queue only when enabled
- Removed dependency on LocalPlayer
- Fixed code style
- Simplified expressions and program logic
- Cleaned minimap object interfaces
2015-07-08 01:50:31 -04:00
RealBadAngel ffd16e3fec Add minimap feature 2015-06-27 03:42:01 +02:00
est31 40226e5274 Make attached objects visible in 3rd person view 2015-06-20 02:59:53 +02:00
Ilya Zhuravlev b6387b4e0f Use utf-8 in formspecs 2015-06-13 19:49:55 +02:00
Craig Robbins addf3ee165 (Android) Only simulate holding down fast key if fast_move is toggled to true 2015-05-29 22:59:21 +10:00
kwolekr da34a2b33e Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
2015-05-19 16:10:49 -04:00
Craig Robbins 99cf53c908 ANDROID: Do not limit situations where fast is enabled
Before this commit autofast for Android was ignored if the user was sneaking, digging or building. There is no reason for this and it impedes movement control
2015-05-15 13:22:07 +10:00
ShadowNinja d720fd5644 Fix connection speed unit names 2015-05-06 15:41:37 -04:00
sfan5 4ea5a96fff Revert the upper-case PROJECT_NAME nonsense that was part of #2402 2015-04-27 16:24:49 +02:00
Kevin Ott 400c6087b6 Fix player pitch and yaw not being set properly 2015-04-26 23:36:05 +10:00
est31 f1a41e4f77 Disable connection timeout for singleplayer and server tabs
In worlds with many mods we can easily reach timeout, waiting for the server to start.
2015-04-19 19:58:21 +02:00
SmallJoker 5f0b36b8b7 10s timeout when connecting to server 2015-04-17 10:40:48 +02:00
Aaron Suen db32e6c5aa Move texture_min_size even further down the pipe. Now, textures are JIT-upscaled using an image transformation, right at the time they're added to a mesh or particle; images used in 2D elements are left unscaled. This should fix any remaining issues with HUD elements. 2015-03-31 16:56:33 +10:00
Craig Robbins ff924ef0dc On Android enable always fast
Invert the meaning of holding down the fast button (i.e. holding down the fast button -- if there is one -- means walk), unless performing an action, sneaking or jumping.
Still requires fast move to be toggled on (and fast priv)
2015-03-30 00:40:12 +10:00
ShadowNinja 30075467b8 Change error_message from wstring to string
This removes a lot of narrow/wide conversions where a wide string was never used.
2015-03-27 20:24:04 -04:00
ShadowNinja 93fcab952b Clean up and tweak build system
* Combine client and server man pages.
  * Update unit test options and available databases in man page.
  * Add `--worldname` to man page.
  * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
  * Disable server build by default on all operating systems.
  * Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
  * Enable LevelDB, Redis, and FreeType detection by default.
  * Remove the `VERSION_PATCH_ORIG` hack.
  * Add option to search for and use system JSONCPP.
  * Remove broken LuaJIT version detection.
  * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
  * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
  * Clean up style of CMake files.
2015-03-27 15:00:48 -04:00
Craig Robbins 34c5a5b377 Minor cleanup: game.cpp
* Sort includes
* Remove unnecessary includes
* Ensure the parameter name for GameRunData is consistent for class member functions
2015-03-17 17:07:39 +10:00
est31 e4f7c92cff Finer progress bar updates when initializing nodes
The bar is only drawn when the user will notice a change, which prevents time overheads that this commit would cause, resulting from useless draws.
2015-03-15 22:01:52 +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
Craig Robbins 5698e2baf8 Fix Android text bug (no text displaying) 2015-03-07 20:51:07 +10:00
Loic Blot 6c09b34edc ProfilerGraph: Use std::list instead of std::vector 2015-03-05 17:57:47 +01:00
Loic Blot 0d1eedcccc Replace std::list to std::vector into tile.cpp (m_texture_trash) and move tile.hpp to src/client/ 2015-03-05 11:59:40 +01:00
rubenwardy d65a90a86b Add camera smoothing and cinematic mode (F8) 2015-02-25 15:34:33 +01:00
Perttu Ahola 4d744cf87a Use fixed size for builtin menus on non-android platforms 2015-02-18 12:33:40 +02:00
Yaman 98d80e2012 Add player direction to on-screen debug text
(PR Modified slightly)
2015-02-17 01:56:21 +10:00
ngosang c7a7803780 Minor fixes in translations 2015-02-12 16:41:40 +01:00
Loic Blot a9355284b5 Don't permit to open inventory is playerCAO isn't present. This prevent to open an empty inventory at player load. ok @zeno- 2015-02-11 12:23:14 +01:00
Loic Blot 8252e1ecd0 Fix issue #2279. ok @zeno- 2015-02-11 10:03:29 +01:00
ngosang dd2bb950be Fix Exit to OS button focus in Pause Menu 2015-02-10 21:23:16 +10:00
gregorycu a0535d286b Fix rebase bug, make render loop use cache setting 2015-02-07 22:23:36 +10:00
ShadowNinja 9e2a9b55e1 Reduce gettext wide/narrow and string/char* conversions 2015-02-05 03:24:22 -05:00
ShadowNinja 84c367bb46 Fix translation memory leak 2015-02-05 03:24:13 -05:00
ShadowNinja 8bbf106379 Fix translation finding of overlay messages 2015-02-05 03:24:00 -05:00
Craig Robbins 38561023b4 Fix local map saving when joining a local server from the server tab
Disables local map saving for all local server types

See: https://github.com/minetest/minetest/issues/2024
2015-01-31 00:42:08 +10:00
gregorycu ed7c9c4cb8 Settings fixes Make the GameGlobalShaderConstantSetter use the settings callback (8% perf improvement in game loop) Ensure variable is set Ensure settings callback is threadsafe 2015-01-25 15:23:37 +10:00
Craig Robbins 2c4a5e1861 Revert "Make the GameGlobalShaderConstantSetter use the settings callback (8% perf improvement in game loop)"
This reverts commit a555e2d9b0.
2015-01-25 01:19:40 +10:00
Craig Robbins 0ea843bbdb Fix unitialised variable occassionally being used 2015-01-24 14:54:42 +10:00
gregorycu a555e2d9b0 Make the GameGlobalShaderConstantSetter use the settings callback (8% perf improvement in game loop)
Amend the settings callback to support userdata
2015-01-23 21:27:51 -05:00
Kahrl e80a044818 Fix use of uninit data in Sky and (potentially) GUIChatConsole constructors
Clean up nearby code a bit

As a small side effect, it is now possible to add a background texture
to the chat console by simply providing background_chat.jpg, it is no
longer necessary to also add "console_color =" to minetest.conf.
2015-01-18 13:16:01 +01:00
sapier aed70cb0b6 Disable sound and key binding settings in "pause" menu on android 2015-01-11 13:58:49 +01:00
sapier de3888ca09 Remove automatic consistent formspec size <-> font size (now has to be done manually)
Set builtin formspecs to autoscale in order to get consistent formspec look and feel
Uncouple label positioning from font size (May break some formspecs but is required to allow manual font adjustment)
2015-01-09 18:46:24 +01:00
sapier 63867b1a37 Fix memory leaks due to messed up memory handling for particles as well as their spawners 2015-01-09 15:23:49 +01:00
sapier 0db73bd83e More consistent progress bar from 0-100 on startup 2015-01-02 17:53:42 +01:00
Craig Robbins 3d29be24e0 Add display_gamma option for client 2014-12-31 02:44:31 +10:00
Craig Robbins 53bc56dc3c Cleanup updateCameraDirection and fix random input not working 2014-12-30 22:59:55 +10:00
Kodexky a79a116ac8 Center status text for better visibility. 2014-12-30 00:30:28 +10:00
RealBadAngel 638f3a8454 Disable loading .mtl files. Theyre not used anyway. 2014-12-08 02:24:46 +01:00
Craig Robbins 5c55738276 Fix f6 debug/profiler display
After fonts were re-engineered the height of the f6 debug/profiler display would only display about 2-3 lines of text.
2014-12-08 00:01:22 +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
Craig Robbins 0e78aa296e Add name of node 'pointed at' to debug
This is "Add name of node pointed at to debug #1677" by @rubenwardy updated to work with game.cpp after it was refactored.
2014-12-05 16:14:50 +10:00
Craig Robbins 691b18c41b Fix node 0,0,0 being highlighted when enable_node_highlighting == false
Without this patch node 0,0,0 is highlighted when enable_node_highligting is false
There is a minor lighting issue remaining, however it seems to be related to a different bug (https://github.com/minetest/minetest/issues/1887)
2014-12-01 22:13:21 +10:00
sapier 39162de15a Make hud use fontengine too
Fix non coding style conforming glb_fontengine to g_fontengine
Fix fonts never been deleted due to grabbed to often
2014-11-30 18:06:54 +01:00
sapier dceb9f7d60 Implement proper font handling 2014-11-30 17:50:09 +01:00
Sokomine 9f9279008c added enable_build_where_you_stand option
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-27 01:07:11 +10:00
Craig Robbins 26cf98ccfc Fix client "double saving" simple singleplayer local maps 2014-11-26 00:49:54 +10:00
KodexKy 5413ed1195 Fixes for Android build errors. Enable sensor landscape rotation.
Fix typo in Android Makefile ndk path.
Fix touchscreen parts of game.cpp to work after Zeno's refactor.
Fix isdigit and isspace overload conflict with Android Irrlicht in string.h
Enable sensor landscape rotation in Android Manifiest.
Add mapgen v5 to Android build.
Fix Makefile not checking leveldb.

Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-25 13:28:51 +10:00
Craig Robbins 5b8855e83c Remove most exceptions from getNode() (and variants) 2014-11-14 18:05:34 +10:00
Craig Robbins 45ebaa3524 Fix profiler values not being updated (F6) and not being logged 2014-11-11 20:58:57 +10:00
Craig Robbins 987e565eeb Create faster key cache for main game loop (client) 2014-11-10 12:26:19 +10:00
Kahrl 9b551d5cbc Implement WieldMeshSceneNode which improves wield mesh rendering
- Don't create and cache an extruded mesh for every (non-node) item.
  Instead use a single one per image resolution.

- For cubic nodes reuse a single wield mesh too

- Improve lighting of the wielded item

- Increase far value of wield mesh scene camera, fixes #1770

- Also includes some minor refactorings of Camera and GenericCAO.
2014-11-08 23:11:57 +01:00
Craig Robbins 1c21e391ed Fix regressions and minor improvements in refactor_the_game
a) Fix double tap for jump and show_debug
b) Revert changes to limitFps()... there is no verification that the new method was an issue, but going back to old method just in case
b.2) limitFps() no longer calls device->run() and also no longer has to be called immediately after a call to device->run()
2014-11-08 21:40:11 +01:00
Craig Robbins 96fcca4ea0 Address issues related to refactoring the_game
Fix time of day persistence
Fix wield item being updated every frame causing small performance hit
Rename some classes and variables
2014-11-03 13:57:56 +01:00
Kahrl 817e3a6c64 Fix regression: mouse wheel couldn't scroll from last hotbar item to first 2014-11-02 21:59:56 +01:00
Craig Robbins 43bf4324d5 Cleanup and (mostly) document util/string.h and (very) minor refactoring
Updated: Incorporated feedback from 'kahrl'
Updated: Moved MinetestApp::boolToCStr() from game.cpp into string.h renaming it bool_to_cstr()
2014-11-02 18:07:20 +01:00
Craig Robbins dfd15fd1d9 Modified dtime calculation method in limitFps() 2014-11-02 02:20:06 +01:00
Craig Robbins 429ecb2b94 Refactor the_game() to make it more understandable and maintainable.
The following is a record of 31 commits before squashing:

Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"

This reverts commit b49e5cfc70.

Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered

Start "outlining" what a MinetestApp class might look like

Add MinetestApp::shutdown()

Converted class member functions to camelCase and created protos for new functions

First stage of connect to server done

Add get itemdefs/nodedefs/media code

Init clouds, camera, sky, init GUI, HUD

Input handling

Client events, camera, sound, draw

Fix wield hand getting stuck digging and add debug text back

Fix FPS

Added profiler graph back

Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff

Annotate

Various:
Rewrote limitFps()
Limited scope of some variables

Jitter calcs

Reduce scope of objects

Move some stuff out of ::run and minor formatting cleanup

Scope reduction

Function splits

Removed old (broken) limitFps()

Added exception handling back

Fixed some formatting

Reverted commented out unit tests (uncommented them)

Slow clouds down on loading and media screens so the behaviour is like the original the_game()

Formatting/style (no functional changes)

Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism

Fixed silly errors on my part
Minor formatting cleanups

Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense

Cleaning up

Add some comments
2014-11-02 02:18:25 +01:00
Kahrl b49e5cfc70 Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism 2014-10-24 21:14:48 +02:00
Craig Robbins fe8ef1be59 Move buttons upwards to accommodate for new configure keys button in the
pause menu
2014-10-18 17:30:17 +02:00
Mushiden 7b548cd2b5 Add in-game key change menu 2014-10-07 17:24:09 -04:00
RealBadAngel b9cb196d49 Bugfix: dont highlight (0,0,0) when theres no node pointed. 2014-10-03 16:03:14 +02:00