1# Source Folders
2
3- `extern`
4    Contains all built-in libraries:
5    - `al` - OpenAL 1.16 (or 1.17, needs confirmation) Changes: Uses custom SDL2 backend; AL built-in library works on Windows and MacOS. However, Linux is not supported thus it is important when building under Linux, native AL library are used instead.
6    - `bullet` 2.83 - No changes.
7    - `freetype2` - No changes.
8    - `ogg` - No changes, configured for build under Windows by default. Under other platforms, their native libs are required.
9
10- `src`
11    Contains engine code:
12    - `core` - Low-level code:
13         - `vmath` - Base vector, Quaternion, Matrix 4x4 and spline mathematics.
14         - `polygon` - Base polygon structure.
15         - `obb` - Oriented bounding box module (OBB).
16         - `utf8_32` - UT8 - 32 string manipulation functions.
17         - `console` - Console implementation (allows reading UTF-8 strings inputted into the console window).
18         - `gl_utils` - Contains OpenGL function pointers and base shader loading functions; module only makes use of `SDL_opengl` and `SDL_GL_GetProcAdress(...)`. It is important that ONLY `gl_ulils.h` as `gl` header is used. Also, only use qgl\* functions for interaction with the OpenGL API.
19         - `gl_font` - Contains implementation of rendering for True Type Font lib within an OpenGL context. (works with UTF-8 strings).
20         - `redblack` - Red-black tree for built-in data storage.
21         - `system` - Contains basic debug print, error functions, check if file exists function and take screenshot function.
22    - `notes`:
23         - \* - For file I/O operations. It is important to use `SDL_rwops`. This is part of SDL, works everywhere and is suggested to maintain continuity.
24
25    - `vt` - External trosettastone Tomb Raider resource loader project, rewritten and updated :-)
26
27    - `render` - Contains the source for scene rendering.
28         - `bordered_texture_atlas`, `bsp_tree_2d` - [Cochrane](https://github.com/Cochrane)'s module for storing many original textures in a single one.
29         - `bsp_tree` - Module for transparent polygon sorting (BSP tree creation module, uses internal memory management).
30         - `camera` - Structure with camera related fields, matrices + camera manipulation functions.
31         - `frustum` - Special module for rooms and object visibility calculation. This is done via portal/frustum intersections (uses internal memory management).
32         - `shader_description`, shader_manager - Module for shader object creation/application.
33         - `render` - The main scene rendering module, works in two stages: 1: Generates room rendering list based on the camera. 2: render previously generated list, only used during debug rendering.
34
35    - `script` - Contains LUA script functions.
36         - `script` - Engine constants loading to LUA, parsers functions, system functions.
37         - `script_audio` - Audio config file parsing, audio starting,  stopping and state retrieval.
38         - `script_character` - Character parameter manipulation and inventory related functions.
39         - `script_entity` - Physics, positioning, flags state manipulation.
40         - `script_skeletal_model` - Animation control system.
41         - `script_world` - Spawning objects, level transitions, level configuration functions, objects and effects generation.
42
43    - `anim_state_control` - Only Lara's state control control module.
44    - `audio` - AL audio sources, soundtrack manipulation and a storage module.
45    - `character_controller` - Manages controls for the character under different state conditions i.e whilst (on floor, free fall, underwater, on water or climbing etc.). Also, helper functions and weapon state control functions are included.
46    - `controls` - Parses input from SDL and updates engine input control state structure.
47    - `engine` - Contains main loop function, SDL event handlers, and debug output functions.
48    - `entity` - Main in-game object type structure and manipulation functions. Contains frame update functions, callback callers, physics state updater/checker functions.
49    - `game` - Contains main game frame function. Also contains save/load functions and low-level game effects (flyby camera, look at control, load screen updater).
50    - `gameflow` - Contains the base module for interfacing with external LUA "gameflow" scripts. This module is responsible for tracking secrets and transitioning between different game states (i.e play FMV, play level etc) or setting special game/level specific parameters.
51    - `gui` - Renders all debug strings, bars, load screen and the inventory menu.
52    - `image` - Layer module for reading pcx, png and saving png images. bpp = 24 or 32 only (RGB or RGBA only).
53    - `inventory` - Contains the item structure and simple add/remove item from inventory functions.
54    - `main_SDL` - Only main function and engine start (+ todo list in comment).
55    - `mesh` - Base item for rendering, contains vertices and VBO.
56    - `physics` - Contains abstract engine interface for working with physics. It is important to use it only within the engine code! Here ray/sphere test functions, multi-mesh models for skeletal models.
57    - `physics_bullet` - Stores all engine physics geometry. Contains all physics code implementation with bullet library, creates own physics geometry from level resources.
58    - `resource` - Simple layer for converting level data from VT format to a format this engine supports. There is also a floor data to collision geometry converter included.
59    - `room` - Contains room structure and object ownership manipulation (entity is within in room c and moved to room d).
60    - `skeletal_model` - Contains base model, animation representation structures for in-game usage. A unique skeletal model structure is implemented with a smooth skeletal model update algorithm. Multi-animation system algorithm, multi-targeting bone mutators algorithm (head tracking, weapons targeting).
61    - `trigger` - Here is the main (in-game) sector trigger handler/parser and object functions caller.
62    - `world` - Main level database storage (excluding sound): models, entities, rooms, meshes etc. here are level loader/destructor and interface for accessing to rooms/entities by coordinates/ids;
63
64