User:Chalst/hier

From Minetest Developer Wiki
Jump to navigation Jump to search

Project file hierarchy

Everything outside the src directory seems to be either not code, or tools that are not part of the client or server runtime.

Reused code

Some widely used libraries are included as subfolders under src

  1. cguitfont - Some Freetype-related font stuff
  2. json - The C++ Json Project implementation
  3. jthread
  4. lua - Lua 5.1, I assume for compatibility with Luajit
  5. sqlite - Although the make process seems to allow Redis and Leveldb as alternative db backends

Additionally, the util subfolder seems to contain repurposed older code of celeron's.

Some other projects are used via external includes: Irrlicht, Freetype itself,

  1. sha1.cpp

And other projects are used which are not included in the src hierarchy: Irrlicht and Ogg Vorbis

The script subfolder

  1. script - contains both C++ to intialise Lua structures, and code to register C++ code as Lua functions. (E.g., script/scripting_mainmenu.cpp seems to be C++ code to invoke Lua fns defined in script/lua_api/l_mainmenu.cpp)
    1. lua_api - (i) wrappers for C++ code to use in Lua scripts and via the Lua-C api (e.g., lua_api/l_server.cpp), and (ii) making simple game abstractions (e.g., lua_api/l_inventory.cpp)
    2. cpp_api - seems to be C++ similar to (ii) for lua_api, except they don't register Lua functions and they seem to a named global L Lua state object

Subsystems

Chat

Item

  • itemdef.cpp
  • script/cpp_api/s_item.cpp
  • script/lua_api/l_item.cpp

Inventory

  • inventory.cpp
  • inventorymanager.cpp
  • script/cpp_api/s_inventory.cpp
  • script/lua_api/l_inventory.cpp


Menus

Mapgen

Rendering

Heavily dependent on the Irrlicht engine.

Server