Commit Graph

21 Commits

Author SHA1 Message Date
sfan5 83229921e5 Rework use_texture_alpha to provide three opaque/clip/blend modes
The change that turns nodeboxes and meshes opaque when possible is kept,
as is the compatibility code that warns modders to adjust their nodedefs.
2021-01-29 17:34:41 +01:00
Jozef Behran 833e60d8d2 Fix compare between pointer and 0 in unittests
Pointers shall be set to nullptr, not 0, according to the
coding standards. By implication they shall be compared with
nullptr, not 0, too. Fix this code to match that.
2019-08-13 14:44:32 +02:00
nOOb3167 9537cfd3f8 Add a MSVC / Windows compatible snprintf function (#7353)
Use sizeof where applicable for mt_snprintf
2018-07-22 21:56:06 +02:00
rubenwardy 87ad4d8e7f
Add online content repository
Replaces mods and texture pack tabs with a single content tab
2018-04-19 20:14:53 +01:00
Loïc Blot ce873108aa
Client eventmanager refactor (#7179)
* Drop EventManager from GameDef & do some client cleanups

* EventManager is only used by Client. Don't expose it on Server & GameDef for nothing
* Drop Client::event() in favor of direct calls to getEventManager
* Cleanup some event put from new + put to put(new)
* MtEvent: add Type(u8) enum
* This will enhance event performance & ensure stricter type
* Drop MtEvent::checkIs (unused)

* clang-tidy reported fixes

* Code style

* Move event_manager.h to the client directory as it's only used by client

Add EventManager unittests + switch to unordered_map as order is not important here

Drop a unused function
2018-03-30 18:32:52 +02:00
Loïc Blot 4fd9715876
Cleanup sound manager class (#7158)
* Cleanup sound manager client

* Use some const refs
* Use auto on iterators
* Drop unused parameters
* Move sound_openal.* to client folder
* Move sound.cpp + OnDemandSoundFetcher to client/ folder + reorganize includes properly
2018-03-24 15:45:25 +01:00
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 6f1c907204 Implement mod communication channels (#6351)
Implement network communication for channels

* Implement ModChannel manager server side to route incoming messages from clients to other clients
* Add signal handler switch on client & ModChannelMgr on client to handle channels
* Add Lua API bindings + client packet sending + unittests
* Implement server message sending
* Add callback from received message handler to Lua API using registration method
2017-09-26 00:11:20 +02: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 1c1c97cbd1 Modernize source code: last part (#6285)
* Modernize source code: last par

* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
2017-08-20 13:30:50 +02:00
Loïc Blot 85511a642f Cleanup various headers to reduce compilation times (#6255)
* Cleanup various headers to reduce compilation times
2017-08-16 22:11:45 +02:00
Vincent Glize 4a5e8ad343 C++11 cleanup on constructors (#6000)
* C++11 cleanup on constructors dir script
2017-06-19 23:54:58 +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
Loïc Blot eb88e5dd4b Add ModStorageAPI to client side modding (#5396)
mod storage is located into user_path / client / mod_storage
2017-03-16 07:53:39 +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
est31 5f342aa015 Remove some abort() calls
abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
2015-10-26 04:45:00 +01: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
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
kwolekr 2dba29ebf2 Tests: Add schematic unittests
Improve schematic file-saving interface
Add ability to create temporary test files
2015-05-08 00:55:42 -04:00
kwolekr b45df9d6a7 Tests: Add NodeResolver unittests
Minor misc. NodeResolver cleanups
Prefix faux content type constants for testing with t_ to avoid
confusion or name collisions
2015-05-05 12:00:36 -04:00
kwolekr 7220ca906d Tests: Modularize unit testing
Split unit tests into separate files under src/unittest/
Give better unittest diagnostics
Clean up some code
2015-04-26 15:08:54 -04:00