Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion port/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ two ABIs use the same registers for 32-bit integers, floats and pointers.

### OpenGL ES

The renderer (`port/linux/src/d3d8_gl.c`) uses OpenGL ES 3.0, and some
The renderer's OpenGL backend (`port/linux/src/gpu_gl.c`) uses OpenGL ES 3.0, and some
functions of OpenGL ES 3.2 if they are available:

- The vertex shaders flip y and change the depth range from 0..1. The front
Expand Down
4 changes: 2 additions & 2 deletions port/android/host/host_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int host_gl_has_extension(const char *name)
}

/* copies size bytes of a buffer object (the snapshots of the visibility
tests' counters, d3d8_gl.c); ES has no glGetBufferSubData, and the mapping
tests' counters, gpu_gl.c); ES has no glGetBufferSubData, and the mapping
it offers instead is a host pointer. Binds GL_COPY_READ_BUFFER, which the
renderer uses only for its copies, and leaves it unbound. */
void host_gl_read_buffer(uint32_t buffer, uint32_t offset, uint32_t size, void *data)
Expand All @@ -79,7 +79,7 @@ void host_gl_read_buffer(uint32_t buffer, uint32_t offset, uint32_t size, void *
}

/* The renderer streams each frame's vertices and indices into the next of
a ring of buffers (d3d8_gl.c). A fence marks the end of each frame's work,
a ring of buffers (gpu_gl.c). A fence marks the end of each frame's work,
and a buffer is written again only once the GPU has passed the fence of the
frame that last used it: drivers queue several frames, and a draw still
waiting to run would otherwise read a later frame's vertices. */
Expand Down
2 changes: 1 addition & 1 deletion port/android/host/host_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static void *game_main(void *unused)
environment_set(&environment, "HALO_SAVE_ROOT", save_root);
{
/* the game renders 480 lines at the display's aspect ratio
(landscape) unless display.screen_width says otherwise (d3d8_gl.c) */
(landscape) unless display.screen_width says otherwise (d3d8_device.c) */
const SDL_DisplayMode *mode;
char width[16];

Expand Down
2 changes: 1 addition & 1 deletion port/include/xdk/xdk_d3d8.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ by default, they must be declared extern to be shared) */
#endif

/* state the inline functions below read and write, which the platform
layer defines (port/linux/src/d3d8_gl.c); the library's own copies are
layer defines (port/linux/src/d3d8_device.c); the library's own copies are
public symbols of the January build (D3D__RenderState, D3D__TextureState,
D3D__IndexData) */
extern DWORD D3D__RenderState[D3DRS_MAX];
Expand Down
6 changes: 3 additions & 3 deletions port/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,10 @@ crafted file) is refused, and the level starts over.
| Area | Status |
| --- | --- |
| Game code | All 466 C files of the game. The changes are in "Game source changes". |
| Graphics | Direct3D 8 on OpenGL 4.5 core through SDL3 (`src/d3d8_gl.c`). The port translates the NV2A vertex shaders and register combiners to GLSL. It decodes all the Xbox texture formats. The vertex and index buffers come from a GL copy of the Xbox memory. |
| Graphics | Direct3D 8 on OpenGL 4.5 core through SDL3: the Direct3D device (`src/d3d8_device.c`) describes each draw to a GPU backend (`src/gpu.h`), which is OpenGL's (`src/gpu_gl.c`). The port translates the NV2A vertex shaders and register combiners to GLSL. It decodes all the Xbox texture formats. The vertex and index buffers come from a GL copy of the Xbox memory. |
| High-res HUD | The HUD is drawn from high-res assets: redraws at 8x the size of the maps' bitmaps (4x for the largest), in `port/assets/hud`. They cover the meters, counters, panels and their outlines, the motion sensor, reticles, waypoints and scopes, but no bitmap with English text. `tools/hud_assets.py` makes them from the SVG redraws, and the build embeds them in the executable. When the game uploads one of those bitmaps, `src/hud_hires.c` gives the high-res texture in its place, if the bitmap's pixels are those of the English maps: another language's maps keep their own. The game sizes and places the HUD from its tags as before. `display.high_res_hud = false` turns this off. |
| High-res text | The menus' and HUD's text is drawn with Overpass (`port/assets/fonts`, SIL Open Font License) in place of the maps' bitmap fonts, which are Interstate. `src/text_hires.c` rasterizes each glyph with stb_truetype (`port/third_party/stb`) at the resolution the game draws at, into an atlas that a placeholder bitmap of the game stands for. The game lays the text out from its font tags as before. The menus' titles (the screens' headers and the main menu's items) are pictures of text in the maps, so they are drawn as the high-res HUD is: `tools/title_assets.py` sets each one again in OpenCE, Roger White's public-domain Newtown respaced to match the maps' commercial title typeface (`tools/title_font.py`), at 4x the bitmap's size over its own plate or glow, each letter placed where the map's letter is, in `port/assets/titles`. The postgame carnage report's title is set over a hand-made SVG redraw of its panel (`port/assets/titles/svg`) instead. `display.high_res_text = false` turns it off. |
| Anti-aliasing | Off unless `display.anti_aliasing` is set (`src/d3d8_gl.c`, `src/xgpu_post.c`). FXAA (written in the port) and SMAA (`port/third_party/smaa`, MIT licensed, at its HIGH preset, compiled as GLSL) are passes over the 3D view of each window, after the lens flares and before the HUD and the menus (`render/render.c`). Their programs are built when the setting is chosen. Supersampling draws the render targets the size of the screen at two times the resolution in each direction, and the display blit scales them down. Multisampling draws the back buffer and its depth buffer into multisampled renderbuffers, and with them any target that is drawn together with one of them (a mirror's view, in the secondary target with the back buffer's depth buffer), so that the attachments of a framebuffer are all multisampled or none is. A target's pixels are resolved into its texture before something reads the texture (as a texture, or at the display blit). Visibility tests count samples, divided by the samples of a pixel. An alpha-tested surface (foliage, grates) covers the samples of a pixel in proportion to its alpha past the reference (`gl_SampleMask`, not on Android). |
| Anti-aliasing | Off unless `display.anti_aliasing` is set (`src/d3d8_device.c`, `src/gpu_gl.c`, `src/gpu_gl_post.c`). FXAA (written in the port) and SMAA (`port/third_party/smaa`, MIT licensed, at its HIGH preset, compiled as GLSL) are passes over the 3D view of each window, after the lens flares and before the HUD and the menus (`render/render.c`). Their programs are built when the setting is chosen. Supersampling draws the render targets the size of the screen at two times the resolution in each direction, and the display blit scales them down. Multisampling draws the back buffer and its depth buffer into multisampled renderbuffers, and with them any target that is drawn together with one of them (a mirror's view, in the secondary target with the back buffer's depth buffer), so that the attachments of a framebuffer are all multisampled or none is. A target's pixels are resolved into its texture before something reads the texture (as a texture, or at the display blit). Visibility tests count samples, divided by the samples of a pixel. An alpha-tested surface (foliage, grates) covers the samples of a pixel in proportion to its alpha past the reference (`gl_SampleMask`, not on Android). |
| Sound | Xbox DirectSound on SDL3 audio (`src/dsound_sdl.c`): PCM and Xbox ADPCM, mixed at 48 kHz, with volume, pitch, mix bins, distance, stereo pan, occlusion and obstruction. There is no Doppler effect, no cones and no reverb. |
| Input | XInput on SDL3 (`src/xinput_sdl.c`): keyboard, mouse, gamepads with rumble, and the debug keyboard for the console. |
| Files | The Win32 file functions and the MSVC file functions on POSIX, with the translation of Xbox paths. |
Expand Down Expand Up @@ -770,7 +770,7 @@ definition. Without this check, the linker gives the reference the address
- `src/halo_linker_common.c` gives weak storage for some globals of the
January link, and for `fast_ftol_C` and `main_crash`.
- `main/d3d_intimacy.cpp` reads a private structure of the Xbox Direct3D.
The Linux build does not use this file. `src/d3d8_gl.c` gives
The Linux build does not use this file. `src/d3d8_device.c` gives
`d3d_find_flipcount`.
- The build returns small structures and unions in registers
(`-freg-struct-return`), as on Win32.
Expand Down
2 changes: 1 addition & 1 deletion port/linux/game/custom_edition_geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ them. Its uncompressed vertices (cache_file_formats.c checked their size and
place) stay where they are. */
/* geometry the renderer draws from: in the Xbox's contiguous memory, as the
game's own vertex and index buffers are (physical_memory_map.c), which the
renderer keeps on the GPU (d3d8_gl.c's mirror: anything outside it is sent
renderer keeps on the GPU (d3d8_device.c's mirror: anything outside it is sent
again at every draw); in the game's heap when that memory is spent */
static void *geometry_allocate(
unsigned long size,
Expand Down
2 changes: 1 addition & 1 deletion port/linux/game/tag_schema_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ enum
_bitmap_group_type_sprites = 3,
NUMBER_OF_BITMAP_GROUP_TYPES = 5,

/* the device's (d3d8_gl.c, D3DDevice_GetDeviceCaps; xbox_textures.c
/* the device's (d3d8_device.c, D3DDevice_GetDeviceCaps; xbox_textures.c
uploads nothing larger) */
MAXIMUM_BITMAP_SIZE = 4096,
MAXIMUM_VOLUME_BITMAP_SIZE = 512,
Expand Down
4 changes: 2 additions & 2 deletions port/linux/include/halo_linux_source_fixups.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ unsigned char custom_edition_vehicles_by_placement(void);
unsigned char custom_edition_vehicle_placement_allowed(struct scenario_object_datum const *placement);

/* the width of the screen the game draws, 480 lines tall: the device's or
the display's shape, or 640 (port/linux/src/d3d8_gl.c) */
the display's shape, or 640 (port/linux/src/d3d8_device.c) */
long halo_screen_width(void);
/* takes up a new width between frames (F11); returns the width */
long halo_screen_commit(void);
Expand All @@ -65,7 +65,7 @@ long halo_shadow_map_scale(void);
/* while TRUE, drawing shifts right to center 640-column layouts */
void halo_screen_ui_offset(unsigned char centered);
/* names a model lighting vertex program, whose draws can be lit for each
pixel (port/linux/src/d3d8_gl.c, display.per_pixel_lighting) */
pixel (port/linux/src/d3d8_device.c, display.per_pixel_lighting) */
void halo_vertex_shader_lighting(unsigned long handle);
/* display.anti_aliasing's pass over a window's 3D view, before the HUD and
menus (source/render/render.c): the window's bounds on the screen */
Expand Down
2 changes: 1 addition & 1 deletion port/linux/include/halo_ui_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ HALO_UI_POINTER.H
The mouse in the menus of the desktop builds. While a menu is up, the mouse
is released and its pointer shows (port/linux/src/sdl_platform.c); each frame
the menus (source/interface/ui_widget.c) ask where it is, in their own 640x480
coordinates (port/linux/src/d3d8_gl.c undoes the letterbox, the scale and the
coordinates (port/linux/src/d3d8_device.c undoes the letterbox, the scale and the
widescreen centering), and what it did since.
*/

Expand Down
Loading