summaryrefslogtreecommitdiff
path: root/src/game.cpp
Commit message (Collapse)AuthorAge
* Fix crash due to missing pointer validationLoic Blot2018-06-10
| | | | Based on commit 014a1a0
* Fix Android node selection distance (#6187)Dániel Juhász2018-06-03
|
* Trigger on_rightclick regardless on the formspec meta fieldSmallJoker2018-06-03
| | | | Document behaviour for older clients.
* Full viewing range key message clarifiedFixer2018-06-03
| | | | To make it sound less confusing to players
* Automatic item and node colorization (#5640)Dániel Juhász2018-06-03
| | | | | | | | | | | | | | | | | * Automatic item and node colorization Now nodes with a palette yield colored item stacks, and colored items place colored nodes by default. The client predicts the colorization. * Backwards compatibility * Use nil * Style fixes * Fix code style * Document changes
* Fix segmentation fault with tool capabilities (#5899)ShadowNinja2018-06-03
|
* Close formspec on client shutdown. (#5811)red-0012017-05-25
| | | This ensures the shutting down progress bar is correctly rendered. This fixes #3050.
* Client crashfix: load meta after digging (#5801)Paramat2017-05-23
| | | | | | | Fixes a crash caused in MTGame by breaking and right-clicking a chest. If loading meta, digging, node can disappear and we looked at meta, which is wrong because meta became NULL. Pointer is invalidated and we read wrong memory area
* Fix instant digging (#5785)you2017-05-20
| | | | Use runData.dig_time_complete instead of params.time to find out whether it's instant digging. runData.dig_time_complete is set to something very big if the node can't be dug, whereas param.time is 0 when digging is impossible or it's instant digging. So not using param.time fixes #5728.
* When minimap is disabled in configuration, really disable it (#5771)Loïc Blot2017-05-19
| | | | * When minimap is disabled in configuration, really disable it
* No cursor lock when window inactive (#5754)SmallJoker2017-05-13
|
* Limit properly the sound setting at updateSound runtime step (#5753)Loïc Blot2017-05-13
| | | | | | | | * Limit properly the sound setting at updateSound runtime step Fix #5026 * Add a comment
* Move KeyList & InputHandler from game.h to client/inputhandler.h (#5752)Loïc Blot2017-05-13
| | | | | | | | | | * Move KeyList & InputHandler from game.h to client/inputhandler.h We have a header for inputs, move inputhandler class & related keylist object to it Also introduce a cpp file for MyEventReceiver::OnEvent function in inputhandler.h because a so huge function doesn't needs to be inlined * Pass clang-format on inputhandler.{cpp,h} (compatible)
* Android build fixLoic Blot2017-05-13
|
* Minor pause/escape menu improvements (#5751)red-0012017-05-13
| | | | | | - Split movement keys into separate entries. - Increase buffer size due to the above change. - Change capitalisation. - Remove code-style violating white spaces.
* Rework escape/pause menu (#5719)red-0012017-05-11
| | | | | | | | | | | | * Rework escape/pause menu - Remove build information - Use current controls instead of default controls - Add information about the current server in place of the build information - Add text saying the game is paused to if in singleplayer mode. rework pause/escape menu * improve consistency + display server_name
* Add configurable key bindings for hotbar scrolling, and for changing volume.Wuzzy2017-05-06
|
* [CSM] add `on_item_use` (#5544)red-0012017-05-06
|
* Make players respect makes_footstep_sound in the object propertiesTeTpaAka2017-05-06
|
* Save minetest screen width/height options when modified (#5683)Loïc Blot2017-05-05
| | | | | | | | * Save minetest screen width/height options when modified * Add autosave_screensize setting (default true) * Fix @SmallJoker comments
* Add function to get server info.red-0012017-05-04
|
* Set sky API: Add bool for clouds in front of custom skyboxparamat2017-05-02
| | | | | | | Default true. Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API. Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of 'm_visible' (whether normal sky is visible).
* Add clouds APIBen Deutsch2017-04-30
|
* Client & ClientEnvirnment: don't create fake events (#5676)Loïc Blot2017-04-29
| | | | | | | Instead of create fake events on the stack on each loop call (Game::run), verify is queue is empty or not and handle event directly if there is. This prevents fake ClientEvent creation & memory allocations Same fix is also applied on ClientEnvironment, & rename getClientEvent to getClientEnvEvent to match ClientEnvEvent object
* [CSM] Add event on_place_node API lua (#5548)Vincent Glize2017-04-29
| | | | * [CSM] Add event on_place_node API lua
* Fix click-digging torches (#5652)you2017-04-28
| | | | Torches are dug instantly again. When the digging time is 0, a delay of 0.15 seconds is added between digging nodes. If the left mouse button is released, the delay is set to 0, thus click-digging.
* Search user path for sounds (#5657)Louis Pearson2017-04-27
|
* Rename Scripting API files for consistencyShadowNinja2017-04-25
|
* Fix various points reported by cppcheck (#5656)Loïc Blot2017-04-25
| | | | | | | | | | | | * Fix various performance issues reported by cppcheck + code style (CI) * Make CI happy with code style on master * guiFileSelectMenu: remove useless includes * some performance fixes pointed by cppcheck * remove some useless casts * TextDest: remove unused setFormSpec function * Fix various iterator post-increment reported by cppcheck
* Fix various copy instead of const ref reported by cppcheck (#5615)Loïc Blot2017-04-19
| | | | * Also remove InventoryList::peekItem unused function * Fix some post increment to preincrement reported by cppcheck
* Tools: Fix tool digging speed limitHybrid Dog2017-04-19
|
* Fix various variables passed by copy instead of const ref (#5610)Loïc Blot2017-04-19
| | | Pointed by cppcheck
* Android progressbar fix (#5601)Loïc Blot2017-04-16
| | | | | | | | | | | | | | | | | * Fix progressbar for Android Fixes #5599 Fixed #5403 * draw_load_screen: use texturesource this permits to unify texture loading code * scale progress bar * Add gl version check for GL_OES_texture_npot. This fixed the texture on loading screen * Remove two sanity checks pointed by @celeron55 * sfan5 comments + android ratio fixes
* Fix spacingEkdohibs2017-04-06
|
* Fix problems when overriding the hand:Ekdohibs2017-04-06
| | | | | - If the hand can dig a node the item wielded can't, allow to dig it anyway. - Fix the API callbacks from setting the hand instead of the wielded item.
* Show media download progress in percent on progress screen (#5498)orwell962017-04-07
|
* Change command prefix to "." and add "help" command.red-0012017-03-26
|
* Some performance optimizations (#5424)Loïc Blot2017-03-22
| | | | | | | | | | | | | | | | | | | * Some performance optimizations This is globally removing some memory useless copy * use a const ref return on std::string Settings::get to prevent data copy on getters which doesn't need to copy it * pass some stack created strings to static const as they are not modified anywhere * Camera: return nametags per const ref instead of a list pointer, we only need to read it * INodeDefManager: getAll should be a result ref writer instead of a return copy * INodeDefManager: getAlias should return a const std::string ref * Minimap: unroll a Scolor creation in blitMinimapPixersToImageRadar to prvent many variable construct/destruct which are unneeded (we rewrite the content in the loop) * CNodeDefManager::updateAliases: prevent a idef getall copy * Profiler: constness * rollback_interface: create real_name later, and use const ref * MapBlockMesh updateFastFaceRow: unroll TileSpec next_tile, which has a cost of 1.8% CPU due to variable allocation/destruction, * MapBlockMesh updateFastFaceRow: copy next_tile to tile only if it's a different tilespec * MapBlockMesh updateFastFaceRow: use memcpy to copy next_lights to lights to do it in a single cpu operation
* Refactored client event if-else cascade to switch statementBen Deutsch2017-03-20
|
* Refactor Game class (part 2) (#5422)Loïc Blot2017-03-19
| | | | | | | | | | | | | | * showPauseMenu is now part of game * remove many flags parameters passed to game functions, use the member. * rename VolatileRunFlags to GameUIFlags (this will permit to share structure with client and CSM * updatePointedThing: remove pointer ref, we already have the pointer in rundata * move some attributes outside of VolatileRunFlags after renaming, to game class * rename statustext to m_statustext * make some const variables static * All those changes permit to reduce a little bit function class cost and will permit to interface CSM with some interesting Game flags * Expose GameUIFlags to client * Client now have GameUIFlags parameter and setters for other classes * Fix minimap show/hide in Lua because we now have access to the real flag
* Server list cleanupShadowNinja2017-03-18
| | | | This removes the hacky server_dedicated pseudo-setting.
* TOGGLE_CHAT keymap should togglechat not HUDLoic Blot2017-03-18
| | | | Fixes #5413
* Reduce memory & function cost of Game class functions (#5406)Loïc Blot2017-03-17
| | | | GameRunData is passed on many game functions, or one of its attributes whereas it's a member of the class. Remove it from functions arguments and call object directly from concerned functions. This will reduce a little bit the Game class loop usage & very little bit the memory usage (due to non creation of pointer/references)
* [CSM] Fix minimap problems (#5405)Loïc Blot2017-03-17
| | | This fixes issue #5404
* [CSM] Add minimap API modifiers (#5399)Loïc Blot2017-03-16
| | | | | | | | * 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
* [CSM] Add enable_client_modding param (default: false)nerzhul2017-03-13
|
* [CSM] Add `on_punchnode` callbackred-0012017-03-13
|
* [CSM] Add `on_dignode` callback (#5140)red-0012017-03-13
|
* [CSM] Add local formspecs. (#5094)red-0012017-03-13
|
* [CSM] Add on_death, on_hp_modification & oh_damage_taken callbacks (#5093)Loïc Blot2017-03-13
| | | | | | * Add on_death callback * Add on_hp_modification & on_damage_taken callbacks * move preview code to preview.lua