2021-06-14 01:15:34 -04:00
|
|
|
The overall source code is structured where each .c represents a particular module. These modules are:
|
|
|
|
|
2023-09-21 06:48:44 -04:00
|
|
|
TODO: explain multiple backends for some Modules
|
|
|
|
|
2021-06-14 01:15:34 -04:00
|
|
|
## 2D modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Bitmap|Represents a 2D array of pixels (and encoding/decoding to PNG)
|
|
|
|
|Drawer2D|Contains a variety of drawing operations on bitmaps (including text and fonts)
|
|
|
|
|PackedCol|32 bit RGBA color in a format suitable for using as color component of a vertex
|
|
|
|
|SystemFonts|Drawing, measuring, and retrieving the list of platform/system specific fonts
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Audio modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Audio|Playing music and dig/place/step sounds, and abstracts a PCM audio playing API
|
|
|
|
|Vorbis| Decodes [ogg vorbis](https://xiph.org/vorbis/) audio into PCM audio samples
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Entity modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Entity|Represents an in-game entity, and manages updating and rendering all entities
|
|
|
|
|EntityComponents|Various components that can be used by entities (e.g. tilt, animation, hacks state)
|
|
|
|
|Model|Contains the list of entity models, and provides relevant methods for entity models
|
|
|
|
|Particle|Represents particle effects, and manages rendering and spawning particles
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Game modules
|
|
|
|
|File|Functionality|
|
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Block|Stores properties and data for blocks (e.g. collide type, draw type, sound type)
|
|
|
|
|BlockPhysics|Implements simple block physics for singleplayer
|
|
|
|
|Camera|Represents a camera (can be first or third person)
|
|
|
|
|Chat|Manages sending, adding, logging and handling chat
|
|
|
|
|Game|Manages the overall game loop, state, and variables (e.g. renders a frame, runs scheduled tasks)
|
|
|
|
|Input|Manages keyboard, mouse, and touch state and events, and implements base handlers for them
|
|
|
|
|Inventory|Manages inventory hotbar, and ordering of blocks in the inventory menu
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Game gui modules
|
|
|
|
|File|Functionality|
|
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Gui|Describes and manages the 2D GUI elements on screen
|
|
|
|
|IsometricDrawer|Draws 2D isometric blocks for the hotbar and inventory UIs
|
|
|
|
|Menus|Contains all 2D non-menu screens (e.g. inventory, HUD, loading, chat)
|
|
|
|
|Screens|Contains all 2D menu screens (e.g. pause menu, keys list menu, font list menu)
|
|
|
|
|Widgets|Contains individual GUI widgets (e.g. button, label)
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Graphics modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Builder|Converts a 16x16x16 chunk into a mesh of vertices
|
|
|
|
|Drawer|Draws the vertices for a cuboid region
|
|
|
|
|Graphics|Abstracts a 3D graphics rendering API
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## I/O modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Deflate|Decodes and encodes data compressed using DEFLATE (in addition to GZIP/ZLIB headers)
|
|
|
|
|Stream|Abstract reading and writing data to/from various sources in a streaming manner
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Launcher modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Launcher|Manages the overall launcher loop, state, and variables (e.g. resets pixels in areas, marks areas as needing to be redrawn)
|
|
|
|
|LBackend|Handles the rendering of widgets and forwarding input events to screens/menus
|
|
|
|
|LScreens|Contains all the menus in the launcher (e.g. servers list, updates menu, main menu)
|
|
|
|
|LWeb|Responsible for launcher related web requests (e.g. signing in, fetching servers list)
|
|
|
|
|LWidgets|Contains individual launcher GUI widgets (e.g. button, label, input textbox)
|
|
|
|
|Resources|Responsible for checking, downloading, and creating the default assets (e.g. default.zip, sounds)
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Map modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Description|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Formats|Imports/exports a world from/to several map file formats (e.g. .cw, .dat, .lvl)
|
|
|
|
|Generator|Generates a new world in either a flatgrass or Minecraft Classic style
|
|
|
|
|Lighting|Gets lighting colors at coordinates in the world
|
|
|
|
|World|Manages fixed size 3D array of blocks and associated environment metadata
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Math/Physics modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Description|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|ExtMath|Math functions, math constants, and a Random Number Generator
|
|
|
|
|Physics|AABBs and geometry intersection
|
|
|
|
|Picking|Performs raytracing to e.g. determine the picked/selected block in the world
|
|
|
|
|Vectors|Contains vector,matrix,and frustum culling
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Network modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Description|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Http|Performs GET and POST requests in the background
|
|
|
|
|Protocol|Implements Minecraft Classic, CPE, and WoM environment protocols
|
|
|
|
|Server|Manages a connection to a singleplayer or multiplayer server
|
|
|
|
|SSL|Performs SSL/TLS encryption and decryption
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Platform modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Description|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Logger|Manages logging to client.log, and dumping state in both intentional and unhandled crashes
|
|
|
|
|Platform|Abstracts platform specific functionality. (e.g. opening a file, allocating memory, starting a thread)
|
|
|
|
|Program|Parses command line arguments, and then starts either the Game or Launcher
|
|
|
|
|Window|Abstracts creating and managing a window (e.g. setting titlebar text, entering fullscreen)
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Rendering modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Description|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|AxisLinesRenderer|Renders 3 lines showing direction of each axis
|
|
|
|
|EnvRenderer|Renders environment of the world (clouds, sky, skybox, world sides/edges, etc)
|
|
|
|
|HeldBlockRenderer|Renders the block currently being held in bottom right corner
|
|
|
|
|MapRenderer|Renders the blocks of the world by diving it into chunks, and manages sorting/updating these chunks
|
2024-01-15 02:19:59 -05:00
|
|
|
|SelOutlineRenderer|Renders an outline around the block currently being looked at
|
2023-09-20 07:44:02 -04:00
|
|
|
|SelectionBox|Renders and stores selection boxes
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Texture pack modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Animations|Everything relating to texture animations (including default water/lava ones)
|
|
|
|
|TexturePack|Everything relating to texture packs (e.g. extracting .zip, terrain atlas, etc)
|
2021-06-14 01:15:34 -04:00
|
|
|
|
|
|
|
## Utility modules
|
2023-09-20 07:44:02 -04:00
|
|
|
|Module|Functionality|
|
2021-06-14 01:15:34 -04:00
|
|
|
|--------|-------|
|
2023-09-20 07:44:02 -04:00
|
|
|
|Event|Contains all events and provies helper methods for using events
|
|
|
|
|Options|Retrieves options from and sets options in options.txt
|
|
|
|
|String|Implements operations for a string with a buffer, length, and capacity
|
|
|
|
|Utils|Various general utility functions
|