Commit Graph

176 Commits

Author SHA1 Message Date
Loic Blot a3441638c6
Fix a formspec crash triggered by ae9b5e0098 2017-08-20 20:24:26 +02:00
Loïc Blot ae9b5e0098 Modernize code: very last fixes (#6290)
Last modernization fixes
2017-08-20 19:37:29 +02:00
Vincent Glize c772e0e18c C++11 cleanup inventorymanager (#6077)
* C++11 cleanup inventorymanager
2017-07-01 14:07: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
Loic Blot 8f2e60a961
Client::makeScreenshot: remove device param
We already have the device param as class member
2017-06-19 00:00:55 +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
QrchackOfficial 5cc8ad946e Remove superfluous pointer null checks 2017-06-10 21:04:47 -04:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
SmallJoker 7a2b9df970 Tooltips: Unify the tooltip[] and list[] description tooltip display functions (#5848)
* Tooltips: Unify the tooltip[] and list[] description tooltip display functions
2017-06-03 08:55:26 +02:00
red-001 a7787bb9d2 Fix dropdown menu selection (#5847)
This fixes a bug that occurred when the selection list of a drop down menu was changed but the name was still the same.
2017-06-01 08:00:26 +02:00
SmallJoker d99b6fed55 Time: Change old `u32` timestamps to 64-bit (#5818)
MacOSX build fix + cleanups
2017-05-26 14:03:36 +02:00
ShadowNinja b662a4577d Clean up getTime helpers
This increases size of the getTime return values to 64 bits.
It also removes the TimeGetter classes since the getTime functions
are now very precise.
2017-04-28 14:43:18 -04:00
ShadowNinja 2818d3f224 Rename Scripting API files for consistency 2017-04-25 13:41:36 -04:00
Loïc Blot dc0e9097d3 Fix various performance issues reported by cppcheck + code style (CI) (#5635)
* 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
2017-04-21 23:40:48 +02:00
Loïc Blot f98bbe193e Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions
* Make some functions around const ref changes const
2017-04-20 00:12:52 +02:00
Auke Kok 5433e9bd19 Don't make TAB exit game if bound to inventory.
I play with the TAB key bound to the inventory. However, the
code here assumes that TAB means "close formspec" in all contexts,
including the main menu. This causes my game to exit when I attempt
to TAB in between USERNAME and PASSWORD fields.

We know when m_client != NULL that the game is a client game and
not in the main menu, and then it's OK to use the INVENTORY bound
key to exit the formspec, since it's not the main menu.
2017-04-17 21:45:40 -07:00
Wuzzy 2cc518dcaf Show itemstring as tooltip if no item description 2017-03-18 12:36:28 +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
adelcoding1 6de83a2756 FormSpec: Add position and anchor elements (#5284) 2017-03-04 10:46:55 +01:00
rubenwardy f2f9a92351 Add per-stack descriptions using ItemStack Metadata 2017-02-04 22:07:55 +00: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
sfan5 bdf8f85493 Limit drawing rect of selected item to viewport size (fixes #4341) 2016-12-20 14:29:12 +01:00
lisacvuk 8a1a9fdc24 Fixed tooltips not resizing with \n (#4766)
* Fixed tooltips not resizing with \n

* Fixed it for 1.8.4 too.

* Fixed not working with Freetype disabled.

* Modified it to use Zeno-'s solution.
2016-11-11 21:16:34 +10:00
rubenwardy 067766eec2 Fix backwards compatibility issue introduced by close_on_enter 2016-10-08 18:58:28 +02:00
rubenwardy 077b6cfa21 Formspec: Add container[] and container_end[] elements 2016-10-03 01:53:13 +01:00
rubenwardy 78ff5c1936 Fix background formspec elements from interfering with each other
Fixes #4397
2016-08-29 01:15:31 +01:00
rubenwardy e10fee0001 Allow fields to choose whether they close on enter press 2016-08-27 13:05:01 +01:00
rubenwardy 4330c63ea4 Submit name of field on enter key press 2016-08-27 13:02:45 +01: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
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
Craig Robbins 22f78ea38e Fix irrlicht version checking macro for tooltip_height calculation 2016-05-24 00:27:11 +10:00
Craig Robbins 88acda0256 Fix tooltip height for versions of irrlicht < 1.8.2
Version 1.8.2 of irrlicht changed the way that IGUIStaticText::getTextHeight() works and since that release properly deals with newlines.

From irrlicht changes.txt for 1.8.2, "IGUIStaticText::getTextHeight returns now the correct height for texts with newlines even WordWrap is not set."
2016-05-21 00:26:04 +10:00
Ekdohibs 4d9dbceb39 Run unescape_enriched *after* unescape_string.
Doing it the other way round was a mistake, since it breaks
minetest.formspec_escape with escape sequences that contain
special characters.
2016-05-07 08:33:21 +02:00
Ekdohibs d5c3db9c41 Make dropdowns show the string that was their argument.
This makes it work even if it contains escape sequences,
which didn't work before.
2016-05-07 08:33:21 +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
Xunto 21079cc8eb Fix bug that was leading to oversized tooltips containing multiline text when it have multiple lines 2016-04-23 21:12:53 +10:00
ShadowNinja 93887043d9 Clean up Strfnd
Changes:
  * Fix indentation.
  * Pass strings by const reference.
  * Merge Strfnd and WStrfnd into one class instead of copying them.
  * Remove trailing spaces.
  * Fix variable names.
  * Move to util.
  * Other miscellaneous style fixes.
2016-03-19 21:27:57 -04:00
RealBadAngel c17c40a0f5 Formspec: fix broken irrlicht 1.7 build
Fixes #3701.
2016-02-13 22:19:01 +01:00
RealBadAngel 5ca48a35a6 Formspec: recreate item_image_button pressed state for its image and label 2016-02-13 02:35:52 +01:00
RealBadAngel baa7c8f8ad FormSpec: Add StaticTextSpec and superimpose over item image buttons 2016-02-09 03:03:55 -05:00
est31 16c7008771 small drawItemStack cleanup
-> Replace the three bool params with an enum
-> Add struct for the static content, leads to less repetition
-> cache enable_animations setting
2016-02-08 00:35:24 +01:00
RealBadAngel 6cd2b3b445 Use meshes to display inventory items 2016-02-07 19:51:55 +01:00
BlockMen 36855522a5 Fix scrollbars 2015-11-12 17:38:15 +01:00
ShadowNinja 96cc5b34fe Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
est31 41d896d5c2 Clear list rings when loading a new formspec
Fixes a bug where the old list ring remained when a new formspec
was displayed over the old one. This created the list-ring of the new formspec
to be partly ignored.

Thanks to @VanessaE to report the bug, and @DonBatman to produce the code that
exposed it.
2015-10-10 17:10:52 +02:00
David Jones 34b7a147dc Change i++ to ++i 2015-08-25 18:33:52 -04:00
Kahrl 6c0c27f662 Fix intlGUIEditBox leak and uninitialized value in Mapper (reported by valgrind) 2015-08-10 08:41:45 +02:00
est31 2c1fd29884 Add MoveSomewhere inventory action
Improve shift+click experience
2015-06-23 20:18:41 +02:00
est31 ea1b17b88f Don't print an error for valid listring[] formspec 2015-06-18 04:25:11 +02:00