Showing preview only (5,980K chars total). Download the full file or copy to clipboard to get everything.
Repository: acoto87/war1
Branch: master
Commit: 5a6070277e64
Files: 230
Total size: 60.9 MB
Directory structure:
gitextract__n2furko/
├── .clangformat
├── .github/
│ └── workflows/
│ └── build.yml
├── .gitignore
├── ANALYSIS.md
├── LICENSE
├── README.md
├── assets/
│ └── GMGeneric.SF2
├── cinematics.txt
├── deps/
│ ├── include/
│ │ ├── SDL3/
│ │ │ ├── SDL.h
│ │ │ ├── SDL_assert.h
│ │ │ ├── SDL_asyncio.h
│ │ │ ├── SDL_atomic.h
│ │ │ ├── SDL_audio.h
│ │ │ ├── SDL_begin_code.h
│ │ │ ├── SDL_bits.h
│ │ │ ├── SDL_blendmode.h
│ │ │ ├── SDL_camera.h
│ │ │ ├── SDL_clipboard.h
│ │ │ ├── SDL_close_code.h
│ │ │ ├── SDL_copying.h
│ │ │ ├── SDL_cpuinfo.h
│ │ │ ├── SDL_dialog.h
│ │ │ ├── SDL_dlopennote.h
│ │ │ ├── SDL_egl.h
│ │ │ ├── SDL_endian.h
│ │ │ ├── SDL_error.h
│ │ │ ├── SDL_events.h
│ │ │ ├── SDL_filesystem.h
│ │ │ ├── SDL_gamepad.h
│ │ │ ├── SDL_gpu.h
│ │ │ ├── SDL_guid.h
│ │ │ ├── SDL_haptic.h
│ │ │ ├── SDL_hidapi.h
│ │ │ ├── SDL_hints.h
│ │ │ ├── SDL_init.h
│ │ │ ├── SDL_intrin.h
│ │ │ ├── SDL_iostream.h
│ │ │ ├── SDL_joystick.h
│ │ │ ├── SDL_keyboard.h
│ │ │ ├── SDL_keycode.h
│ │ │ ├── SDL_loadso.h
│ │ │ ├── SDL_locale.h
│ │ │ ├── SDL_log.h
│ │ │ ├── SDL_main.h
│ │ │ ├── SDL_main_impl.h
│ │ │ ├── SDL_messagebox.h
│ │ │ ├── SDL_metal.h
│ │ │ ├── SDL_misc.h
│ │ │ ├── SDL_mouse.h
│ │ │ ├── SDL_mutex.h
│ │ │ ├── SDL_oldnames.h
│ │ │ ├── SDL_opengl.h
│ │ │ ├── SDL_opengl_glext.h
│ │ │ ├── SDL_opengles.h
│ │ │ ├── SDL_opengles2.h
│ │ │ ├── SDL_opengles2_gl2.h
│ │ │ ├── SDL_opengles2_gl2ext.h
│ │ │ ├── SDL_opengles2_gl2platform.h
│ │ │ ├── SDL_opengles2_khrplatform.h
│ │ │ ├── SDL_pen.h
│ │ │ ├── SDL_pixels.h
│ │ │ ├── SDL_platform.h
│ │ │ ├── SDL_platform_defines.h
│ │ │ ├── SDL_power.h
│ │ │ ├── SDL_process.h
│ │ │ ├── SDL_properties.h
│ │ │ ├── SDL_rect.h
│ │ │ ├── SDL_render.h
│ │ │ ├── SDL_revision.h
│ │ │ ├── SDL_scancode.h
│ │ │ ├── SDL_sensor.h
│ │ │ ├── SDL_stdinc.h
│ │ │ ├── SDL_storage.h
│ │ │ ├── SDL_surface.h
│ │ │ ├── SDL_system.h
│ │ │ ├── SDL_test.h
│ │ │ ├── SDL_test_assert.h
│ │ │ ├── SDL_test_common.h
│ │ │ ├── SDL_test_compare.h
│ │ │ ├── SDL_test_crc32.h
│ │ │ ├── SDL_test_font.h
│ │ │ ├── SDL_test_fuzzer.h
│ │ │ ├── SDL_test_harness.h
│ │ │ ├── SDL_test_log.h
│ │ │ ├── SDL_test_md5.h
│ │ │ ├── SDL_test_memory.h
│ │ │ ├── SDL_thread.h
│ │ │ ├── SDL_time.h
│ │ │ ├── SDL_timer.h
│ │ │ ├── SDL_touch.h
│ │ │ ├── SDL_tray.h
│ │ │ ├── SDL_version.h
│ │ │ ├── SDL_video.h
│ │ │ └── SDL_vulkan.h
│ │ ├── TinySoundFont/
│ │ │ ├── tml.h
│ │ │ └── tsf.h
│ │ ├── TracyC.h
│ │ ├── shl/
│ │ │ ├── array.h
│ │ │ ├── binary_heap.h
│ │ │ ├── flic.h
│ │ │ ├── list.h
│ │ │ ├── map.h
│ │ │ ├── memory_buffer.h
│ │ │ ├── memzone.h
│ │ │ ├── memzone_audit.h
│ │ │ ├── queue.h
│ │ │ ├── set.h
│ │ │ ├── shl_internal.h
│ │ │ ├── stack.h
│ │ │ ├── wav.h
│ │ │ └── wstr.h
│ │ └── stb/
│ │ ├── stb_image.h
│ │ ├── stb_image_resize.h
│ │ └── stb_image_write.h
│ └── lib/
│ ├── arm64/
│ │ ├── libSDL3.so.0
│ │ └── libSDL3.so.0.5.0
│ ├── linux64/
│ │ ├── libSDL3.so.0
│ │ └── libSDL3.so.0.5.0
│ ├── win32/
│ │ ├── SDL3.lib
│ │ ├── Tracy.lib
│ │ └── libSDL3.dll.a
│ └── win64/
│ ├── SDL3.lib
│ ├── Tracy.lib
│ └── libSDL3.dll.a
├── docs/
│ ├── ACTION_SYSTEM.md
│ ├── ANIMATION_SYSTEM.md
│ ├── COMMANDS_SYSTEM.md
│ ├── ENTITIES_SYSTEM.md
│ ├── INPUT_SYSTEM.md
│ ├── SCENES_SYSTEM.md
│ ├── STATE_MACHINE_SYSTEM.md
│ └── UI_SYSTEM.md
├── nob.c
├── nob.h
├── src/
│ ├── common.h
│ ├── war.h
│ ├── war1.c
│ ├── war_actions.c
│ ├── war_actions.h
│ ├── war_ai.c
│ ├── war_ai.h
│ ├── war_alloc.c
│ ├── war_alloc.h
│ ├── war_animations.c
│ ├── war_animations.h
│ ├── war_audio.c
│ ├── war_audio.h
│ ├── war_campaigns.c
│ ├── war_campaigns.h
│ ├── war_cheats.c
│ ├── war_cheats.h
│ ├── war_cheats_panel.c
│ ├── war_color.h
│ ├── war_commands.c
│ ├── war_commands.h
│ ├── war_database.h
│ ├── war_entities.c
│ ├── war_entities.h
│ ├── war_enums.h
│ ├── war_file.c
│ ├── war_file.h
│ ├── war_font.c
│ ├── war_font.h
│ ├── war_fwd.h
│ ├── war_game.c
│ ├── war_game.h
│ ├── war_imui.c
│ ├── war_imui.h
│ ├── war_log.c
│ ├── war_log.h
│ ├── war_map.c
│ ├── war_map.h
│ ├── war_map_menu.c
│ ├── war_map_menu.h
│ ├── war_map_ui.c
│ ├── war_map_ui.h
│ ├── war_math.c
│ ├── war_math.h
│ ├── war_net.c
│ ├── war_net.h
│ ├── war_pathfinder.c
│ ├── war_pathfinder.h
│ ├── war_projectiles.c
│ ├── war_projectiles.h
│ ├── war_render.c
│ ├── war_render.h
│ ├── war_resources.c
│ ├── war_resources.h
│ ├── war_roads.c
│ ├── war_ruins.c
│ ├── war_scene_blizzard.c
│ ├── war_scene_blizzard.h
│ ├── war_scene_briefing.c
│ ├── war_scene_briefing.h
│ ├── war_scene_download.c
│ ├── war_scene_download.h
│ ├── war_scene_menu.c
│ ├── war_scene_menu.h
│ ├── war_scenes.c
│ ├── war_scenes.h
│ ├── war_sprites.c
│ ├── war_sprites.h
│ ├── war_state_machine.c
│ ├── war_state_machine.h
│ ├── war_state_machine_attack.c
│ ├── war_state_machine_build.c
│ ├── war_state_machine_cast.c
│ ├── war_state_machine_chopping.c
│ ├── war_state_machine_collapse.c
│ ├── war_state_machine_death.c
│ ├── war_state_machine_deliver.c
│ ├── war_state_machine_follow.c
│ ├── war_state_machine_gather_gold.c
│ ├── war_state_machine_gather_wood.c
│ ├── war_state_machine_idle.c
│ ├── war_state_machine_mining.c
│ ├── war_state_machine_move.c
│ ├── war_state_machine_patrol.c
│ ├── war_state_machine_repair.c
│ ├── war_state_machine_repairing.c
│ ├── war_state_machine_train.c
│ ├── war_state_machine_upgrade.c
│ ├── war_state_machine_wait.c
│ ├── war_trees.c
│ ├── war_ui.c
│ ├── war_ui.h
│ ├── war_units.c
│ ├── war_units.h
│ └── war_walls.c
└── todo.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .clangformat
================================================
# ClangFormat configuration for war1-c
# Style: Allman braces, 4-space indent, no tabs, C99/C11
Language: Cpp
BasedOnStyle: LLVM
# ── Indentation ────────────────────────────────────────────────
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4
# ── Brace placement — Allman style ─────────────────────────────
BreakBeforeBraces: Allman
# ── Braces / short forms — keep nothing on one line ────────────
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
# ── Line length ─────────────────────────────────────────────────
ColumnLimit: 120
# ── Pointer / reference alignment ──────────────────────────────
# WarContext* context (pointer attached to type)
PointerAlignment: Right
# ── Includes ────────────────────────────────────────────────────
SortIncludes: false
IncludeBlocks: Preserve
# ── Spaces ──────────────────────────────────────────────────────
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeSquareBrackets: false
# ── Operators ───────────────────────────────────────────────────
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
# ── Function call / declaration alignment ──────────────────────
AlignAfterOpenBracket: Align
BinPackArguments: false
BinPackParameters: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
# ── Trailing commas ─────────────────────────────────────────────
InsertTrailingCommas: None
# ── Blank lines ─────────────────────────────────────────────────
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
# ── Comments ────────────────────────────────────────────────────
ReflowComments: false
SpacesBeforeTrailingComments: 1
# ── Switch/case ─────────────────────────────────────────────────
IndentCaseLabels: true
IndentCaseBlocks: false
# ── Misc ────────────────────────────────────────────────────────
DeriveLineEnding: false
UseCRLF: false
InsertNewlineAtEOF: true
================================================
FILE: .github/workflows/build.yml
================================================
name: build
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang
if: matrix.compiler == 'clang'
run: sudo apt-get update && sudo apt-get install -y clang
- name: Compile nob bootstrap
run: ${{ matrix.compiler }} -std=c99 -Wall -Wextra -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -o nob nob.c
- name: Build project
run: ./nob build --cc ${{ matrix.compiler }} --target linux64
rpi:
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang
if: matrix.compiler == 'clang'
run: sudo apt-get update && sudo apt-get install -y clang
- name: Compile nob bootstrap
run: ${{ matrix.compiler }} -std=c99 -Wall -Wextra -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -o nob nob.c
- name: Build project (Raspberry Pi 4/5 - ARM64)
run: ./nob build --cc ${{ matrix.compiler }} --target arm64 --check
windows-msvc:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up MSVC developer command prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Compile nob bootstrap
shell: cmd
run: cl /nologo /std:c11 /W4 /D_CRT_SECURE_NO_WARNINGS /Fenob.exe nob.c
- name: Compile-check project with MSVC
shell: cmd
run: nob.exe build --cc msvc --target win64 --check
================================================
FILE: .gitignore
================================================
/build/
/.vscode/
build_timings.ctm
ctime.exe
nob.exe
nob.exe.old
nob.obj
nob
flic-file-format
output_189.png
output_192.png
output_195.png
tags
callgrind*
assets/*.WAR
.vscode-ctags
.markdownlint.json
*.pdb
================================================
FILE: ANALYSIS.md
================================================
# War1-C: Comprehensive Project Analysis
**Author:** Alejandro Coto Gutierrez
**Repository:** https://github.com/acoto87/war1
**License:** zlib
**Date:** April 2026 (updated from March 2026)
---
## 1. What Is This Project?
**War1-C** is a ground-up reimplementation of *Warcraft: Orcs & Humans* (1994) written in C99/C11. It reads the original game's `DATA.WAR` asset file (from the DOS version) and recreates the full gameplay experience using modern cross-platform libraries.
| Layer | Technology |
|-------|-------------|
| Windowing/Input/Events | SDL3 |
| 2D Rendering | SDL3 Renderer (hardware-accelerated) |
| Audio | SDL3 Audio + TinySoundFont (MIDI synthesis) |
| Data Structures | shl (author's own single-header libraries) |
| Build System | `nob.c` (C-based build script) |
| Profiling | Tracy C (opt-in via `TRACY_ENABLE`) |
| Memory | Custom arena allocators (`memzone_t`) |
> **Breaking change since March 2026:** GLFW, NanoVG (OpenGL ES 2.0), and Miniaudio have all been replaced with SDL3 (PR #9). This is the single largest architectural change in the project's history — approximately 100,000 lines of dependency code removed and replaced.
**Targets:** Windows 64-bit (MSVC), Linux x86_64, Raspberry Pi ARM64.
*(Windows 32-bit dropped; Raspberry Pi 32-bit replaced with ARM64.)*
**Codebase:** ~35,000+ lines of C across ~56 source files (after the war_types.h breakup and war_units.c expansion), compiled as a **unity build** (single translation unit — all `.c` files `#include`d into `war1.c`).
---
## 2. Implemented Features
### Core Engine
- **Game loop:** Classic `input → update → render → present` at 60 FPS using `SDL_PollEvent` / `SDL_RenderPresent`
- **Scene system:** Download → Blizzard Splash → Main Menu → Custom Game Menu → Briefing → Map (gameplay)
- **Asset pipeline:** Full `DATA.WAR` archive parser with 583 indexed entries (supports both retail and demo versions)
- **Custom bitmap font system** recreated pixel-by-pixel from the original game
- **Build system:** `nob.c` C-based build script with `--cc` and `--target` flags, replacing per-platform shell scripts
- **CI/CD:** GitHub Actions pipeline building on linux64 (gcc + clang), arm64, and win64 (MSVC) on every push and PR
- **Memory management:** Custom arena allocator with `permanentZone` (512 MB) and `frameZone` (4 MB); all subsystems route allocations through `wm_alloc()`/`wm_free()`
- **Profiling:** Tracy C profiler integrated with 41 zones across game loop, AI, pathfinder, entity system, and animations
- **Logging:** Thread-safe logging via SDL3's `SDL_LogMessage`, routing all `logInfo`/`logError`/`logWarning` calls through a single `wlog_log()` function
### Gameplay — Fully Functional
- **All 30+ unit types** from the original game (both Human and Orc rosters)
- **All buildings** (Farm, Barracks, Town Hall, Church/Temple, Tower, Lumber Mill, Stable/Kennel, Blacksmith, Keep/Spire, Gold Mine)
- **Full unit state machine** with 19 states: Idle, Move, Patrol, Follow, Attack, Gold Gathering, Mining, Wood Gathering, Chopping, Deliver, Death, Collapse, Train, Upgrade, Build, Repair, Repairing, Cast, Wait
- **Resource management:** Gold mining (workers enter mine, extract, deliver) and wood chopping (chop trees, carry lumber, deliver)
- **Building construction** with placement validation, build progress, and completion
- **Unit training** from buildings with resource cost enforcement
- **Upgrades** (weapons, armor, spells) from appropriate buildings
- **Combat:** Melee and ranged attacks with proper damage calculation
- **Projectile system:** Arrows, fireballs, catapult rocks with splash damage
- **All 10 spells:** Healing, Far Sight/Dark Vision, Invisibility, Unholy Armor, Rain of Fire, Poison Cloud, Raise Dead, Summon (Spider, Scorpion, Daemon, Water Elemental)
- **A\* pathfinding** with static and dynamic entity avoidance
- **Fog of war** with three states (unknown, fog, visible), timed decay, and sight radius
- **Full audio:** All 45 MIDI tracks, all sound effects, spatial audio attenuation, separate volume controls
- **Complete HUD:** Minimap, unit portraits, contextual command buttons, resource counters, status bar
- **Campaign:** All 24 maps defined (12 Human, 12 Orc) with briefing text and voiceovers
- **Custom games:** Custom game menu scene, map selection, 21+ maps across Forest, Swamp, and Dungeon tilesets
- **Cheat system:** All original cheats + custom development cheats (god mode, unit spawning, map editing, music/volume control, speed/scale adjustment, add unit)
---
## 3. What Is Left to Implement
### Critical Missing Features
| Feature | Status | Notes |
|---------|--------|-------|
| **AI System** | ~20–25% done | Request/Wait/Sleep commands execute. Attack/Defend commands are defined but fall through to `logWarning`. Building creation code is a stub returning `true` without doing anything. Still hardcoded to `players[1]` only. |
| **Campaign Win/Loss Conditions** | ~8% done | Only maps 01 (Human) and 02 (Orc) check objectives. Remaining 22 maps never detect victory or defeat. |
| **Save/Load** | 0% | `wmm_handleGameOverSave` calls `NOT_IMPLEMENTED()`. No serialization code exists. |
| **Cinematics** | 0% | All 40 FLIC animation files catalogued. `shl/flic.h` reader exists in `deps/`. No playback scene. |
| **Multiplayer** | 0% | Main menu "Multi Player" button is a dead end. `war_net.c` only handles HTTP asset download. |
| **Dialogues** | 0% | No dialogue system. |
### Gameplay Polish (from `todo.md`)
- Palette variation for unit portraits per tileset
- NPC explosion animation on repeated clicking
- Ctrl+click to select all units of same type on screen
- Rally points for trained units
- Animated water/blue-water tiles
- Zoom feature
- State machine return values (so Follow can tell Attack that target is unreachable)
- Better diagonal movement cost in pathfinding
- Actions system description (documentation)
- Idle units do not retaliate when attacked
- Worker collision near town hall during resource delivery
### Technical Debt
- Component dictionary instead of each entity having all components
- Remove BFS pathfinding implementation (superseded by A\*)
- Multi-sprite support for entities
- Separate animation rendering pass (render animations above everything else)
- Better minimap layering
- Dialogue system
- Cutscene system (FLIC playback)
- `rewriteAppendCheatTextInput` and `downloadFileFromUrl` to use `wstr`/`StringView`-friendly implementations
---
## 4. Confirmed Bugs
### Fixed Since March 2026
The following bugs from the previous analysis have been resolved:
1. ~~**Copy-paste bug in palette colors**~~ — Fixed in `wres_getPalette()`. Green and blue channels are now correctly indexed from `palette2`.
2. ~~**Wrong unit type for Orc Blacksmith**~~ — Fixed: `wcmd_buildBlacksmithOrcs` now passes `WAR_UNIT_BLACKSMITH_ORCS`.
3. ~~**Wrong unit type for Raider training**~~ — Fixed: `wcmd_trainRaider` now passes `WAR_UNIT_RAIDER`.
4. ~~**Logic bug in projectile type check**~~ — Fixed: condition is now `&&` (`type != FIREBALL && type != RAIN_OF_FIRE`).
5. ~~**Integer division kills audio interpolation**~~ — Fixed: `wa_changeSampleRate` now uses `1.0f / (f32)factor` with proper linear interpolation between samples.
6. ~~**Wrong loop variable in UI button reset**~~ — Fixed: inner loop now correctly uses `buttons->items[j]`.
7. ~~**`sizeof` instead of `arrayLength`**~~ — Fixed: `war_render.c` now uses `arrayLength(colors)`.
8. ~~**~84 instances of unbounded `sprintf`/`strcpy`/`vsprintf`**~~ — Dramatically reduced; only 2 remaining (see below).
### Active Bugs
#### 1. Duplicate macro definition in `war_units.c`
- **File:** `src/war_units.c:6,14`
- **Issue:** `#define WSV_INIT(s) { s, sizeof(s) - 1 }` is defined twice at lines 6 and 14. Under `-Wpedantic` this is a benign redefinition, but it is dead code that will confuse editors and should be removed.
#### 2. Two remaining `strcpy` calls
- **File:** `src/war_net.c` — `strcpy(cut, urlStr + shift)` — buffer overflow risk if `urlStr` is malformed.
- **File:** `src/war_resources.c` — `strcpy(resource->levelInfo.objectives, ...)` — relies on the destination buffer being large enough for the raw level data.
- **Recommendation:** Replace both with `strncpy` or a length-checked copy.
#### 3. AI building creation is a silent no-op
- **File:** `src/war_ai.c:176–187`
- **Issue:** `wai_tryCreateUnit()` for building types immediately `return true` with a TODO comment. A `WAR_AI_COMMAND_REQUEST` for any building type will mark itself complete without spawning anything. The AI scripting will silently succeed without creating any buildings.
#### 4. AI hardcoded to a single player index
- **File:** `src/war_ai.c:127,360`
- **Issue:** Both `wai_initAIPlayers` and `wai_updateAIPlayers` hardcode `players[1]`. On any map with more than one AI opponent this is wrong. The multi-player AI will not run.
#### 5. AI Attack/Defend commands unimplemented
- **File:** `src/war_ai.c:264–269`
- **Issue:** `WAR_AI_COMMAND_ATTACK` and `WAR_AI_COMMAND_DEFEND` hit the `default` case which logs a warning and returns `true`. Any AI script that issues attack or defend commands will silently do nothing.
#### 6. Memory leak on unknown file type
- **File:** `src/war_file.c:40-42`
- **Issue:** Returns `NULL` without freeing the allocated `warFile` struct or closing the file handle on unrecognised file types.
### Pre-Existing High-Risk Issues (still unresolved)
7. **Potential crash from NULL entity manager** (`src/war_entities.c`): `getEntityManager()` can return `NULL`; callers dereference without checking.
8. **Possible crash with 0 selected entities** (`src/war_commands.c`): `selectedEntities.items[0]` accessed in code paths where `selectedEntities.count` could be 0.
9. **VLA buffer overflow in HTTP request** (`src/war_net.c`): Buffer may be too small for multi-line HTTP headers.
10. **AI commands never freed** (`src/war_ai.c:316–331`): `WarAICommandListRemoveAt` removes from list but the `WarAICommand*` pointer is never `wm_free()`d. Permanent zone leak per completed command.
11. **Entities never fully freed** (`src/war_entities.c`): Components cleaned up but the `WarEntity` struct itself is never returned to the allocator.
### Bugs from `todo.md` (Unresolved)
12. **Cursor escapes window** — OS cursor appears outside game window.
13. **Pathfinding edge case** — Last path position occupied by another entity; behavior undefined.
14. **Memory leaks in animation removal**.
15. **Linux rendering** — Global scale renders incorrectly on Linux after a scale change.
16. **UI drag bug** — Dragging from a button to the map panel starts a selection rectangle.
17. **Idle units don't retaliate** when attacked.
18. **Worker collision near town hall** during resource delivery.
19. **Invisible worker bug** — Worker enters mine but doesn't mine; remains commandable.
20. **Audio saturation** from rapid order commands.
21. **Sprite antialiasing lines** visible between sprites on Windows.
---
## 5. Architecture Analysis
### Current Architecture
```
war1.c (entry point + unity build root)
├── war_game.c (game loop: input → update → render → present)
│ ├── war_scenes.c (scene stack management)
│ │ ├── war_scene_blizzard.c
│ │ ├── war_scene_download.c
│ │ ├── war_scene_menu.c (main menu + custom game menu)
│ │ └── war_scene_briefing.c
│ └── war_map.c (main gameplay scene)
│ ├── war_entities.c (ECS-like entity/component system)
│ ├── war_commands.c (command dispatch)
│ ├── war_state_machine*.c (19 behavior states)
│ ├── war_pathfinder.c (A*)
│ ├── war_ai.c (enemy AI — partial)
│ ├── war_projectiles.c
│ └── war_map_ui.c / war_map_menu.c
├── war_resources.c + war_file.c (DATA.WAR asset loading)
├── war_render.c + war_font.c (SDL3 renderer)
├── war_audio.c (SDL3 Audio + TinySoundFont, separate thread)
├── war_alloc.c (arena allocator — permanentZone + frameZone)
└── war_log.c (thread-safe SDL3-backed logging)
```
**Key design patterns:**
- **Entity-Component System** (ECS-like): `WarEntity` has components (sprite, unit, button, animation, etc.)
- **Hierarchical State Machine**: Units driven by enter/update/leave callbacks per state
- **Scene Stack**: Scenes managed as a stack with push/pop semantics
- **Unity Build**: Entire codebase compiled as one translation unit via `war1.c`
- **Arena Allocation**: All game memory allocated from two `memzone_t` arenas; no scattered `malloc`/`free` in game code
- **Forward Declaration Header**: `war_fwd.h` centralises all forward declarations for the now-decomposed type system
### Architectural Strengths
1. **Clean state machine decomposition** — Each of the 19 unit states is in its own file with clear enter/update/leave contracts. Well-organised and easy to extend.
2. **Unified arena memory model** — The `wm_alloc`/`wm_free`/`wm_realloc` API backed by `memzone_t` is now threaded throughout the entire codebase including third-party libraries (TinySoundFont, stb_image, shl). This eliminates fragmentation, enables debug auditing with `memzone_audit.h`, and makes leak tracking possible.
3. **SDL3 unification** — Replacing three separate dependencies (GLFW, NanoVG, Miniaudio) with a single SDL3 layer dramatically reduces the dependency surface. SDL3 handles windowing, input, 2D rendering, audio, threading, and timing under one API with better long-term maintenance guarantees.
4. **Self-contained build system** — `nob.c` is a single C file that bootstraps with one compiler command and drives the full build. Combined with GitHub Actions CI (linux64 GCC+Clang, arm64, win64 MSVC), every commit is compile-verified across all supported targets.
5. **Accurate original game data integration** — The 583-entry `war_database.h` maps every asset in `DATA.WAR` by index. Faithfully reads original game assets including custom map loading.
6. **Tracy profiler integration** — 41 instrumented zones across the game loop, AI, pathfinding, entity system, and animations allow real profiling sessions without code modification. Zero overhead when `TRACY_ENABLE` is not defined.
7. **Thread-safe logging** — The previous global `__log__` state and mutex is gone; `wlog_log()` delegates to `SDL_LogMessage` which is thread-safe by design, fixing the audio thread vs main thread stdout corruption.
### Architectural Weaknesses & Improvement Ideas
#### 1. Monolithic Entity Structure (unchanged)
**Problem:** `WarEntity` contains ALL component types as direct struct members. Every entity carries the full weight of every possible component regardless of its type.
**Recommendation:** Move to a proper ECS with components stored in separate arrays/pools indexed by entity ID. Already in `todo.md`. Would reduce memory footprint and improve cache coherence significantly. The arena allocator makes this refactor safer — a per-component-type pool can be carved from the permanent zone.
#### 2. Unity Build Limits Development Velocity
**Problem:** `war1.c` compiles everything as a single translation unit. Any change recompiles all 35 000+ lines. `nob.c` uses `--check` mode for compile verification but cannot do incremental builds. This is manageable for a solo project, but will become a bottleneck for contributors.
**Note:** The `nob.c` build system does compile the project; the unity build is a deliberate design choice. The issue is that there is no way to compile only the changed files. A CMakeLists.txt companion (compile-only mode) could enable IDE integration and faster iteration without abandoning the unity build for release.
#### 3. AI Architecture Needs a Rethink
**Problem:** The current AI is a linear command script (`WarAICustomData::commands` array walked by index). This works for simple build-order sequences but cannot represent reactive behaviour (defend when attacked, retreat when losing). Attack/Defend commands exist in the enum but are unimplemented. Building creation is a stub. The system is hard-coded to `players[1]`.
**Recommendation:** The scripted command queue is a solid foundation. The next step is:
1. Fix the multi-player loop (iterate all players with `player->ai != NULL`).
2. Implement building creation (find a free worker, find a buildable tile, issue a repair state).
3. Implement attack: select military units and issue a move-to-attack order towards the enemy base.
4. Add a reactive layer: a periodic `wai_scanThreats()` function that inserts defend commands when friendly units take damage.
#### 4. `war_units.c` Centralisation Risk
**Problem:** `war_units.c` has grown to ~2 771 lines and is the single source of truth for all unit stats, upgrade data, upgrade names, feature names, and build time constants. While well-structured, any mistake here silently corrupts game balance data for all unit types.
**Recommendation:** Add compile-time `static_assert` guards verifying array lengths against the corresponding enum `_COUNT` values. This catches off-by-one errors in stat tables at compile time.
#### 5. Unsafe String Handling (nearly resolved, 2 remaining)
**Problem:** The original ~84 instances of `sprintf`/`strcpy`/`vsprintf` have been resolved almost entirely. Two `strcpy` calls remain:
- `src/war_net.c`: URL parsing without bounds check.
- `src/war_resources.c`: Level objectives text copy.
**Recommendation:** Replace both with `strncpy` + explicit null-termination, or a safer helper.
#### 6. No Tests (unchanged)
**Problem:** Zero test files. No test framework. Critical systems like pathfinding, state machines, combat damage, resource management, and DATA.WAR parsing have no automated verification. The CI only checks that the code *compiles* — it does not verify correctness.
**Recommendation:** Add unit tests for:
- Pathfinding (A\* correctness with known obstacle maps)
- Damage calculation
- Resource cost enforcement
- State machine transitions
- DATA.WAR file parsing
---
## 6. Recent Change Log Analysis (Last ~25 Commits)
### What Changed and Why It Matters
| PR / Commit | Change | Impact |
|---|---|---|
| PR #9 | **SDL3 migration** — removed GLFW, NanoVG (OpenGL ES), Miniaudio | Eliminates ~100 kloc of deps; single unified API; better portability |
| PR #8 + String 1 | **`nob.c` + GitHub Actions CI** | Every commit now compile-verified on 3 platforms/4 compilers |
| PR #10 | **Unity build cleanup** — each `.c` file got proper guards and headers | Fixes include ordering; eliminates order-dependent compile errors |
| PR #11 | **Prefix refactor** — `io.c`/`log.c` absorbed into `war_log.c`; `__log__` global removed | Thread-safety; cleaner API surface |
| PR #12 | **`wstr.h` / `memzone.h`** added to shl; Linux SDL3 lib added | Foundation for string refactor and arena allocator |
| PR #13 | **StringView + cheat refactor** — `str.c`/`str.h` removed; `shl/wstr.h` and `shl/wav.h` adopted | Safer, non-owning string passing throughout cheat and UI text paths |
| PR #14 | **Memory + audio refactor** — `war_alloc.c` introduced; Tracy added; all allocs routed through `wm_*` | Arena model; debug auditing; profiling infrastructure |
| PR #15 | **Full function prefix rename** across all 85 source files | Naming conventions now consistently applied; greatly aids code search |
| PR #16 | **`war_types.h` decomposed** — types moved into module headers; `war_fwd.h` for forward decls; `war_units.c` fully populated | Reduced header coupling; `war_units.c` now ~2771 lines of authoritative unit data |
| AI commits | **AI command system** — request/wait/sleep execute; attack/defend stubbed | Foundation for AI is solid; execution layer is partially complete |
| Custom game commits | **Custom game menu + map loading** | Enables AI development and testing without playing campaign maps |
---
## 7. Potential New Development Directions
### High-Value, Feasible
1. **Complete the AI system** — The command infrastructure exists. The highest-leverage work is: (a) multi-player loop, (b) building-construction execution, (c) basic army attack logic. These three items would make AI opponents functional in custom games and set up campaign AI.
2. **Implement all campaign win/loss conditions** — Only 2 of 24 maps have objectives. The original game's objectives are well-documented and the framework already handles the two working cases. Filling in the remaining 22 is largely mechanical.
3. **Integrate FLIC cinematics** — `shl/flic.h` reader already exists. Needs: a playback scene, frame rendering via SDL3 textures, and campaign sequence integration.
4. **Save/Load system** — `wmm_handleGameOverSave` exists as a stub. With the arena allocator, a binary snapshot of the permanent zone is technically feasible, though a structured approach (serialising `WarMap` + entity list + player state) would be more robust and portable.
### Medium-Term
5. **State machine return values** — The most impactful open state machine issue: Follow cannot currently tell Attack that a target is unreachable, causing an infinite Follow↔Attack loop. Fixing this would resolve one of the most noticeable AI/gameplay bugs.
6. **Component dictionary (ECS refactor)** — Already in `todo.md`. Now that the arena allocator is in place, a per-component-type pool approach is feasible without changing the existing allocation API.
7. **Map editor** — Cheat system already has tree/wall/road/ruins editing. Expanding this into a proper editor with save-to-file would be high value for the modding community.
8. **WebAssembly port** — SDL3 has Emscripten support. The arena allocator (one large static buffer) maps naturally to WASM. A browser-playable version would greatly increase accessibility.
### Ambitious / Long-Term
9. **Multiplayer (LAN/Online)** — The command system is centralised and the game loop is deterministic, which is the correct foundation for lockstep networking. The `war_net.c` HTTP stack would need to be repurposed or a separate networking layer added.
10. **Higher resolution rendering** — The game renders at 320×200 scaled up via SDL3's logical presentation. Mode using upscaling filters (xBRZ, HQ2x) could modernise visuals without touching the game logic.
11. **Steam Deck / Console ports** — SDL3 is portable to all major platforms including consoles. The main work would be controller input mapping and resolution adaptation.
---
## 8. Summary of Priorities
| Priority | Task | Impact |
|----------|------|--------|
| **P0** | Fix AI building-creation stub (currently returns `true` silently) | AI correctness |
| **P0** | Fix AI hardcoded to `players[1]` | Multi-AI maps |
| **P0** | Fix 2 remaining `strcpy` calls | Security/stability |
| **P0** | Fix duplicate `WSV_INIT` macro in `war_units.c` | Code hygiene |
| **P1** | Implement AI Attack/Defend command execution | Makes AI fight back |
| **P1** | Complete campaign win/loss conditions (22 remaining maps) | Campaign completable |
| **P2** | Fix state machine return values (Follow → Attack unreachable loop) | Gameplay polish |
| **P2** | Integrate FLIC cinematics playback | Campaign polish |
| **P2** | Implement Save/Load | Player quality of life |
| **P3** | ECS refactor (component dictionary) | Memory and cache efficiency |
| **P3** | Fix memory leaks (AI commands never freed, entities never freed) | Stability for long sessions |
| **P3** | Add compile-time `static_assert` guards in `war_units.c` | Data correctness |
| **P4** | Add unit tests | Long-term maintainability |
| **P4** | WebAssembly port | Accessibility |
| **P5** | Multiplayer | Feature expansion |
---
## Conclusion
This project has made substantial architectural improvements since the March 2026 snapshot. The SDL3 migration eliminated three large dependency stacks in favour of a single well-maintained library. The `nob.c` build system and GitHub Actions CI — previously absent entirely — now provide multi-platform compile verification on every commit. The arena-based memory model and Tracy profiler integration put the project on a professional footing for performance work. The naming conventions and `war_types.h` decomposition have significantly improved code navigability.
The core gameplay loop remains fully functional. The highest-leverage remaining work is completing the AI system to make single-player against an opponent actually playable, then filling in the 22 missing campaign objective checks to make the full campaign completable. With those two items done, this would be a faithfully playable recreation of the original game.
The foundational architecture is sound. The main gaps are feature completeness (AI, campaign, cinematics, save/load) rather than structural problems.
================================================
FILE: LICENSE
================================================
zlib License
(C) 2019 Alejandro Coto Gutiérrez
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
================================================
FILE: README.md
================================================
# War1
A remake of Warcraft: Orcs & Humans written in C.
This is a remake of the Warcraft: Orcs & Humans game created and published by Blizzard Entertainment in 1994. It pretends to be a complete implementation of the game using only the assets (*.WAR files) from the original game.
War1 is not an official Blizzard Entertainment product. It intent to be an enhancement of the original product with modern RTS features. You will need a copy of the original Warcraft: Orcs & Humans MS-DOS (or shareware) version be able to play War1. You can get it here Warcraft: Orcs and Humans. Warcraft and all graphics you see in the game are a registered trademark of Blizzard Entertainment.
Current features (this list is not complete):
* Path finding and collisions detection
* Unit movement with animations
* Unit training
* Building construction
* Resources gathering by peasants and peons
* Features specification for maps (this is specify if the player can train, build or research certain units, buildings or spells)
* Win/lose condition checking
* Fog of war
* Basic behavior for enemies (it will attack your units if you get near enough, it will chase your units)
* Spells
* Typing commands for cheats and other stuff that could be activated by it in the engine
Still to develop (this list is not complete):
* AI (I'm planning to do a basic one first and build from that more complex ones)
* Cinematics (I've the code for reading FLIC files just need to integrate it into the engine)
* Save/Load
You can check videos of gameplay and features as they are built [here](https://www.youtube.com/playlist?list=PLgN8fwyHpZaY42SjuwAQ4MPJ1rD9w1Kym).
## How to build
1. Clone the repository `git clone https://github.com/acoto87/war1`
2. Get the `DATA.WAR` file and place it in the `assets` folder.
3. Bootstrap the `nob` build entry point with your C compiler of choice:
### Bootstrap with GCC
```sh
gcc -std=c99 -Wall -Wextra -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -o nob nob.c
```
### Bootstrap with Clang
```sh
clang -std=c99 -Wall -Wextra -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -o nob nob.c
```
### Bootstrap with MSVC
```bat
cl /nologo /std:c11 /W4 /D_CRT_SECURE_NO_WARNINGS /Fenob.exe nob.c
```
4. Build the project with `nob`:
### Linux 64-bit
```sh
./nob build --cc gcc --target linux64
./nob build --cc clang --target linux64
```
### Windows
```bat
nob.exe build --cc gcc --target win32
nob.exe build --cc gcc --target win64
```
MSVC currently supports compile validation with `--check`:
```bat
nob.exe build --cc msvc --target win64 --check
```
### Raspberry Pi
```sh
./nob build --cc gcc --target arm32
```
The legacy `build-gcc-*.sh` and `build-gcc-*.bat` scripts are still available, but `nob.c` is now the main build entry point.
## How to run
Since I'm not able to distribute the DATA.WAR file, which contains the original assets, there is a little process to get the game working properly (this applies if you don't own a copy of the game that you can purchase here [Warcraft: Orcs and Humans](https://www.gog.com/game/warcraft_orcs_and_humans)).
If you own an original copy of the game, or just bought the game on GOG, find the file DATA.WAR and just copy and paste it into the War 1 folder, and execute war1.exe.
Or just start the game and there is an option within the game to download the file.
If you don't own the original game and want to try it with the demo version, just download the demo version of [DATA.WAR](https://archive.org/download/WarcraftOrcsHumansDemo/WCRFT.ZIP/DEMODATA%2FDATA.WAR). Or just start the game and there is an option within the game to download the file.
If you want to check were that file comes from, it's from here: https://archive.org/details/WarcraftOrcsHumansDemo. If you click SEE ALL in the DOWNLOADS section you will see a WCRFT.ZIP (View Contents) entry, just click on View Contents and there is a line with the DATA.WAR file of the demo version.
## Libraries used
* [SDL3](https://libsdl.org/): A cross-platform development library designed to provide low-level access to audio, keyboard, mouse, joystick, and graphics hardware.
* [TinySoundFont](https://github.com/schellingb/TinySoundFont) SoundFont2 synthesizer.
* [shl](https://github.com/acoto87/shl): Single header libraries with commonly used data structures.
* [stb](https://github.com/nothings/stb) Single-file public domain libraries for C/C++
Here is my [TODO](https://github.com/acoto87/war1/blob/master/todo.md) list.
## Other Warcraft 1 re-implementations:
* [War1gus](https://wargus.github.io/war1gus.html): War1gus is a re-implementation of "Warcraft: Orcs & Humans" that allows you to play Warcraft with the Stratagus engine.
* [OpenWar](https://phix.itch.io/openwar): OpenWar is an alternative Warcraft: Orcs & Humans game engine.
* [Warcraft Remake](http://www.b3dgs.com/v7/page.php?lang=en§ion=warcraft_remake): Warcraft Remake is a remake of the classic Blizzard game.
* [WinWar](https://github.com/CAMongrel/WinWar): WinWar is a multiplatform (Windows, WindowsStore, OSX, Linux, iOS) port of the original DOS WarCraft: Orcs & Humans PC Game.
## Screenshots
Gifs | Images
------------------------- | -------------------------
 | 
 | 
 | 
================================================
FILE: cinematics.txt
================================================
File name Scene Length
CAVE1 Approaching cave 7.7 secs
CAVE2 Loop before cave door 1.7 secs
CAVE3 Door opens, view point passes through 2.4 secs
HFINALE Fireworks over Stormwind Keep 8.6 secs
HINTRO1 Approaching Stormwind Keep 7.2 secs
HINTRO2 Loop of flags flying at Stormwind Keep 1.8 secs
HMAP01 Intro to human map 3.2 secs
HMAP02 Intro to human map 3.3 secs
HMAP03 Intro to human map 3.3 secs
HMAP04 Intro to human map 3.3 secs
HMAP05 Intro to human map 3.3 secs
HMAP06 Intro to human map 3.3 secs
HMAP07 Intro to human map 3.3 secs
HMAP08 Intro to human map 3.3 secs
HMAP09 Intro to human map 3.3 secs
HMAP10 Intro to human map 3.3 secs
HMAP11 Intro to human map 3.3 secs
HMAP12 Intro to human map 3.3 secs
LOSE1 Approach skeleton on battle field 6.0 secs
LOSE2 Loop of burning fires 0.9 secs
OFINALE Loop of Orcs w/ spears at a fire 2.1 secs
OINTRO1 Approaching Black Rock Spire gate 9.8 secs
OINTRO2 Looping fires at Black Rock Spire gate 0.8 secs
OINTRO3 Pass through Black Rock Spire gate 3.6 secs
OMAP01 Intro to orc map 3.2 secs
OMAP02 Intro to orc map 3.3 secs
OMAP03 Intro to orc map 3.3 secs
OMAP04 Intro to orc map 3.3 secs
OMAP05 Intro to orc map 3.3 secs
OMAP06 Intro to orc map 3.3 secs
OMAP07 Intro to orc map 3.3 secs
OMAP08 Intro to orc map 3.3 secs
OMAP09 Intro to orc map 3.3 secs
OMAP10 Intro to orc map 3.3 secs
OMAP11 Intro to orc map 3.3 secs
OMAP12 Intro to orc map 3.3 secs
TITLE Zoom in on "Warcraft" title 3.0 secs
WIN1 Fly into throne room 5.0 secs
WIN2 Looping torches in throne room 0.8 secs
================================================
FILE: deps/include/SDL3/SDL.h
================================================
/*
Simple DirectMedia Layer
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* Main include header for the SDL library, version 3.4.4
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to
* this rule--SDL_main.h is special and not included here--but usually
* letting SDL.h include the kitchen sink for you is the correct approach.
*/
#ifndef SDL_h_
#define SDL_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_assert.h>
#include <SDL3/SDL_asyncio.h>
#include <SDL3/SDL_atomic.h>
#include <SDL3/SDL_audio.h>
#include <SDL3/SDL_bits.h>
#include <SDL3/SDL_blendmode.h>
#include <SDL3/SDL_camera.h>
#include <SDL3/SDL_clipboard.h>
#include <SDL3/SDL_cpuinfo.h>
#include <SDL3/SDL_dialog.h>
#include <SDL3/SDL_dlopennote.h>
#include <SDL3/SDL_endian.h>
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_events.h>
#include <SDL3/SDL_filesystem.h>
#include <SDL3/SDL_gamepad.h>
#include <SDL3/SDL_gpu.h>
#include <SDL3/SDL_guid.h>
#include <SDL3/SDL_haptic.h>
#include <SDL3/SDL_hidapi.h>
#include <SDL3/SDL_hints.h>
#include <SDL3/SDL_init.h>
#include <SDL3/SDL_iostream.h>
#include <SDL3/SDL_joystick.h>
#include <SDL3/SDL_keyboard.h>
#include <SDL3/SDL_keycode.h>
#include <SDL3/SDL_loadso.h>
#include <SDL3/SDL_locale.h>
#include <SDL3/SDL_log.h>
#include <SDL3/SDL_messagebox.h>
#include <SDL3/SDL_metal.h>
#include <SDL3/SDL_misc.h>
#include <SDL3/SDL_mouse.h>
#include <SDL3/SDL_mutex.h>
#include <SDL3/SDL_pen.h>
#include <SDL3/SDL_pixels.h>
#include <SDL3/SDL_platform.h>
#include <SDL3/SDL_power.h>
#include <SDL3/SDL_process.h>
#include <SDL3/SDL_properties.h>
#include <SDL3/SDL_rect.h>
#include <SDL3/SDL_render.h>
#include <SDL3/SDL_scancode.h>
#include <SDL3/SDL_sensor.h>
#include <SDL3/SDL_storage.h>
#include <SDL3/SDL_surface.h>
#include <SDL3/SDL_system.h>
#include <SDL3/SDL_thread.h>
#include <SDL3/SDL_time.h>
#include <SDL3/SDL_timer.h>
#include <SDL3/SDL_tray.h>
#include <SDL3/SDL_touch.h>
#include <SDL3/SDL_version.h>
#include <SDL3/SDL_video.h>
#include <SDL3/SDL_oldnames.h>
#endif /* SDL_h_ */
================================================
FILE: deps/include/SDL3/SDL_assert.h
================================================
/*
Simple DirectMedia Layer
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* # CategoryAssert
*
* A helpful assertion macro!
*
* SDL assertions operate like your usual `assert` macro, but with some added
* features:
*
* - It uses a trick with the `sizeof` operator, so disabled assertions
* vaporize out of the compiled code, but variables only referenced in the
* assertion won't trigger compiler warnings about being unused.
* - It is safe to use with a dangling-else: `if (x) SDL_assert(y); else
* do_something();`
* - It works the same everywhere, instead of counting on various platforms'
* compiler and C runtime to behave.
* - It provides multiple levels of assertion (SDL_assert, SDL_assert_release,
* SDL_assert_paranoid) instead of a single all-or-nothing option.
* - It offers a variety of responses when an assertion fails (retry, trigger
* the debugger, abort the program, ignore the failure once, ignore it for
* the rest of the program's run).
* - It tries to show the user a dialog by default, if possible, but the app
* can provide a callback to handle assertion failures however they like.
* - It lets failed assertions be retried. Perhaps you had a network failure
* and just want to retry the test after plugging your network cable back
* in? You can.
* - It lets the user ignore an assertion failure, if there's a harmless
* problem that one can continue past.
* - It lets the user mark an assertion as ignored for the rest of the
* program's run; if there's a harmless problem that keeps popping up.
* - It provides statistics and data on all failed assertions to the app.
* - It allows the default assertion handler to be controlled with environment
* variables, in case an automated script needs to control it.
* - It can be used as an aid to Clang's static analysis; it will treat SDL
* assertions as universally true (under the assumption that you are serious
* about the asserted claims and that your debug builds will detect when
* these claims were wrong). This can help the analyzer avoid false
* positives.
*
* To use it: compile a debug build and just sprinkle around tests to check
* your code!
*/
#ifndef SDL_assert_h_
#define SDL_assert_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_begin_code.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* The level of assertion aggressiveness.
*
* This value changes depending on compiler options and other preprocessor
* defines.
*
* It is currently one of the following values, but future SDL releases might
* add more:
*
* - 0: All SDL assertion macros are disabled.
* - 1: Release settings: SDL_assert disabled, SDL_assert_release enabled.
* - 2: Debug settings: SDL_assert and SDL_assert_release enabled.
* - 3: Paranoid settings: All SDL assertion macros enabled, including
* SDL_assert_paranoid.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors
#elif !defined(SDL_ASSERT_LEVEL)
#ifdef SDL_DEFAULT_ASSERT_LEVEL
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
#elif defined(_DEBUG) || defined(DEBUG) || \
(defined(__GNUC__) && !defined(__OPTIMIZE__))
#define SDL_ASSERT_LEVEL 2
#else
#define SDL_ASSERT_LEVEL 1
#endif
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* Attempt to tell an attached debugger to pause.
*
* This allows an app to programmatically halt ("break") the debugger as if it
* had hit a breakpoint, allowing the developer to examine program state, etc.
*
* This is a macro--not a function--so that the debugger breaks on the source
* code line that used SDL_TriggerBreakpoint and not in some random guts of
* SDL. SDL_assert uses this macro for the same reason.
*
* If the program is not running under a debugger, SDL_TriggerBreakpoint will
* likely terminate the app, possibly without warning. If the current platform
* isn't supported, this macro is left undefined.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
#elif defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1310)
/* Don't include intrin.h here because it contains C++ code */
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif defined(_MSC_VER) && defined(_M_IX86)
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
#elif SDL_HAS_BUILTIN(__builtin_debugtrap)
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
#elif SDL_HAS_BUILTIN(__builtin_trap)
#define SDL_TriggerBreakpoint() __builtin_trap()
#elif (defined(__GNUC__) || defined(__clang__) || defined(__TINYC__) || defined(__slimcc__)) && (defined(__i386__) || defined(__x86_64__))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
#elif ( defined(SDL_PLATFORM_APPLE) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
#elif defined(SDL_PLATFORM_APPLE) && defined(__arm__)
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
#elif defined(__GNUC__) || defined(__clang__)
#define SDL_TriggerBreakpoint() __builtin_trap() /* older gcc may not support SDL_HAS_BUILTIN(__builtin_trap) above */
#elif defined(__386__) && defined(__WATCOMC__)
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
#include <signal.h>
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
#else
/* SDL_TriggerBreakpoint is intentionally left undefined on unknown platforms. */
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A constant that contains the current function being compiled.
*
* If SDL can't figure how the compiler reports this, it will use "???".
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_FUNCTION __FUNCTION__
#elif !defined(SDL_FUNCTION)
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
# define SDL_FUNCTION __func__
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
#endif
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro that reports the current file being compiled.
*
* This macro is only defined if it isn't already defined, so to override it
* (perhaps with something that doesn't provide path information at all, so
* build machine information doesn't leak into public binaries), apps can
* define this macro before including SDL.h or SDL_assert.h.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_FILE __FILE_NAME__
#elif !defined(SDL_FILE)
#ifdef __FILE_NAME__
#define SDL_FILE __FILE_NAME__
#else
#define SDL_FILE __FILE__
#endif
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro that reports the current file being compiled, for use in
* assertions.
*
* This macro is only defined if it isn't already defined, so to override it
* (perhaps with something that doesn't provide path information at all, so
* build machine information doesn't leak into public binaries), apps can
* define this macro before including SDL_assert.h. For example, defining this
* to `""` will make sure no source path information is included in asserts.
*
* \since This macro is available since SDL 3.4.0.
*/
#define SDL_ASSERT_FILE SDL_FILE
#elif !defined(SDL_ASSERT_FILE)
#define SDL_ASSERT_FILE SDL_FILE
#endif
/**
* A macro that reports the current line number of the file being compiled.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_LINE __LINE__
/*
sizeof (x) makes the compiler still parse the expression even without
assertions enabled, so the code is always checked at compile time, but
doesn't actually generate code for it, so there are no side effects or
expensive checks at run time, just the constant size of what x WOULD be,
which presumably gets optimized out as unused.
This also solves the problem of...
int somevalue = blah();
SDL_assert(somevalue == 1);
...which would cause compiles to complain that somevalue is unused if we
disable assertions.
*/
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro for wrapping code in `do {} while (0);` without compiler warnings.
*
* Visual Studio with really aggressive warnings enabled needs this to avoid
* compiler complaints.
*
* the `do {} while (0);` trick is useful for wrapping code in a macro that
* may or may not be a single statement, to avoid various C language
* accidents.
*
* To use:
*
* ```c
* do { SomethingOnce(); } while (SDL_NULL_WHILE_LOOP_CONDITION (0));
* ```
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
#elif defined(_MSC_VER) /* Avoid /W4 warnings. */
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
this condition isn't constant. And looks like an owl's face! */
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
#else
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
#endif
/**
* The macro used when an assertion is disabled.
*
* This isn't for direct use by apps, but this is the code that is inserted
* when an SDL_assert is disabled (perhaps in a release build).
*
* The code does nothing, but wraps `condition` in a sizeof operator, which
* generates no code and has no side effects, but avoid compiler warnings
* about unused variables.
*
* \param condition the condition to assert (but not actually run here).
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
/**
* Possible outcomes from a triggered assertion.
*
* When an enabled assertion triggers, it may call the assertion handler
* (possibly one provided by the app via SDL_SetAssertionHandler), which will
* return one of these values, possibly after asking the user.
*
* Then SDL will respond based on this outcome (loop around to retry the
* condition, try to break in a debugger, kill the program, or ignore the
* problem).
*
* \since This enum is available since SDL 3.2.0.
*/
typedef enum SDL_AssertState
{
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
SDL_ASSERTION_ABORT, /**< Terminate the program. */
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
} SDL_AssertState;
/**
* Information about an assertion failure.
*
* This structure is filled in with information about a triggered assertion,
* used by the assertion handler, then added to the assertion report. This is
* returned as a linked list from SDL_GetAssertionReport().
*
* \since This struct is available since SDL 3.2.0.
*/
typedef struct SDL_AssertData
{
bool always_ignore; /**< true if app should always continue when assertion is triggered. */
unsigned int trigger_count; /**< Number of times this assertion has been triggered. */
const char *condition; /**< A string of this assert's test code. */
const char *filename; /**< The source file where this assert lives. */
int linenum; /**< The line in `filename` where this assert lives. */
const char *function; /**< The name of the function where this assert lives. */
const struct SDL_AssertData *next; /**< next item in the linked list. */
} SDL_AssertData;
/**
* Never call this directly.
*
* Use the SDL_assert macros instead.
*
* \param data assert data structure.
* \param func function name.
* \param file file name.
* \param line line number.
* \returns assert state.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
const char *func,
const char *file, int line) SDL_ANALYZER_NORETURN;
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* The macro used when an assertion triggers a breakpoint.
*
* This isn't for direct use by apps; use SDL_assert or SDL_TriggerBreakpoint
* instead.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()
#elif !defined(SDL_AssertBreakpoint)
# if defined(ANDROID) && defined(assert)
/* Define this as empty in case assert() is defined as SDL_assert */
# define SDL_AssertBreakpoint()
# else
# define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()
# endif
#endif /* !SDL_AssertBreakpoint */
/**
* The macro used when an assertion is enabled.
*
* This isn't for direct use by apps, but this is the code that is inserted
* when an SDL_assert is enabled.
*
* The `do {} while(0)` avoids dangling else problems:
*
* ```c
* if (x) SDL_assert(y); else blah();
* ```
*
* ... without the do/while, the "else" could attach to this macro's "if". We
* try to handle just the minimum we need here in a macro...the loop, the
* static vars, and break points. The heavy lifting is handled in
* SDL_ReportAssertion().
*
* \param condition the condition to assert.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
static struct SDL_AssertData sdl_assert_data = { false, 0, #condition, NULL, 0, NULL, NULL }; \
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_ASSERT_FILE, SDL_LINE); \
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
continue; /* go again. */ \
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
SDL_AssertBreakpoint(); \
} \
break; /* not retrying. */ \
} \
} while (SDL_NULL_WHILE_LOOP_CONDITION)
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* An assertion test that is normally performed only in debug builds.
*
* This macro is enabled when the SDL_ASSERT_LEVEL is >= 2, otherwise it is
* disabled. This is meant to only do these tests in debug builds, so they can
* tend to be more expensive, and they are meant to bring everything to a halt
* when they fail, with the programmer there to assess the problem.
*
* In short: you can sprinkle these around liberally and assume they will
* evaporate out of the build when building for end-users.
*
* When assertions are disabled, this wraps `condition` in a `sizeof`
* operator, which means any function calls and side effects will not run, but
* the compiler will not complain about any otherwise-unused variables that
* are only referenced in the assertion.
*
* One can set the environment variable "SDL_ASSERT" to one of several strings
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
* behavior, which may be desirable for automation purposes. If your platform
* requires GUI interfaces to happen on the main thread but you're debugging
* an assertion in a background thread, it might be desirable to set this to
* "break" so that your debugger takes control as soon as assert is triggered,
* instead of risking a bad UI interaction (deadlock, etc) in the application.
*
* \param condition boolean value to test.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert(condition) if (assertion_enabled && (condition)) { trigger_assertion; }
/**
* An assertion test that is performed even in release builds.
*
* This macro is enabled when the SDL_ASSERT_LEVEL is >= 1, otherwise it is
* disabled. This is meant to be for tests that are cheap to make and
* extremely unlikely to fail; generally it is frowned upon to have an
* assertion failure in a release build, so these assertions generally need to
* be of more than life-and-death importance if there's a chance they might
* trigger. You should almost always consider handling these cases more
* gracefully than an assert allows.
*
* When assertions are disabled, this wraps `condition` in a `sizeof`
* operator, which means any function calls and side effects will not run, but
* the compiler will not complain about any otherwise-unused variables that
* are only referenced in the assertion.
*
* One can set the environment variable "SDL_ASSERT" to one of several strings
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
* behavior, which may be desirable for automation purposes. If your platform
* requires GUI interfaces to happen on the main thread but you're debugging
* an assertion in a background thread, it might be desirable to set this to
* "break" so that your debugger takes control as soon as assert is triggered,
* instead of risking a bad UI interaction (deadlock, etc) in the application.
* *
*
* \param condition boolean value to test.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert_release(condition) SDL_disabled_assert(condition)
/**
* An assertion test that is performed only when built with paranoid settings.
*
* This macro is enabled when the SDL_ASSERT_LEVEL is >= 3, otherwise it is
* disabled. This is a higher level than both release and debug, so these
* tests are meant to be expensive and only run when specifically looking for
* extremely unexpected failure cases in a special build.
*
* When assertions are disabled, this wraps `condition` in a `sizeof`
* operator, which means any function calls and side effects will not run, but
* the compiler will not complain about any otherwise-unused variables that
* are only referenced in the assertion.
*
* One can set the environment variable "SDL_ASSERT" to one of several strings
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
* behavior, which may be desirable for automation purposes. If your platform
* requires GUI interfaces to happen on the main thread but you're debugging
* an assertion in a background thread, it might be desirable to set this to
* "break" so that your debugger takes control as soon as assert is triggered,
* instead of risking a bad UI interaction (deadlock, etc) in the application.
*
* \param condition boolean value to test.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
/* Enable various levels of assertions. */
#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 2 /* debug settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
#else
# error Unknown assertion level.
#endif
/**
* An assertion test that is always performed.
*
* This macro is always enabled no matter what SDL_ASSERT_LEVEL is set to. You
* almost never want to use this, as it could trigger on an end-user's system,
* crashing your program.
*
* One can set the environment variable "SDL_ASSERT" to one of several strings
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
* behavior, which may be desirable for automation purposes. If your platform
* requires GUI interfaces to happen on the main thread but you're debugging
* an assertion in a background thread, it might be desirable to set this to
* "break" so that your debugger takes control as soon as assert is triggered,
* instead of risking a bad UI interaction (deadlock, etc) in the application.
*
* \param condition boolean value to test.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
/**
* A callback that fires when an SDL assertion fails.
*
* \param data a pointer to the SDL_AssertData structure corresponding to the
* current assertion.
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
* \returns an SDL_AssertState value indicating how to handle the failure.
*
* \threadsafety This callback may be called from any thread that triggers an
* assert at any time.
*
* \since This datatype is available since SDL 3.2.0.
*/
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
const SDL_AssertData *data, void *userdata);
/**
* Set an application-defined assertion handler.
*
* This function allows an application to show its own assertion UI and/or
* force the response to an assertion failure. If the application doesn't
* provide this, SDL will try to do the right thing, popping up a
* system-specific GUI dialog, and probably minimizing any fullscreen windows.
*
* This callback may fire from any thread, but it runs wrapped in a mutex, so
* it will only fire from one thread at a time.
*
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
*
* \param handler the SDL_AssertionHandler function to call when an assertion
* fails or NULL for the default handler.
* \param userdata a pointer that is passed to `handler`.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAssertionHandler
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
SDL_AssertionHandler handler,
void *userdata);
/**
* Get the default assertion handler.
*
* This returns the function pointer that is called by default when an
* assertion is triggered. This is an internal function provided by SDL, that
* is used for assertions when SDL_SetAssertionHandler() hasn't been used to
* provide a different function.
*
* \returns the default SDL_AssertionHandler that is called when an assert
* triggers.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAssertionHandler
*/
extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
/**
* Get the current assertion handler.
*
* This returns the function pointer that is called when an assertion is
* triggered. This is either the value last passed to
* SDL_SetAssertionHandler(), or if no application-specified function is set,
* is equivalent to calling SDL_GetDefaultAssertionHandler().
*
* The parameter `puserdata` is a pointer to a void*, which will store the
* "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
* will always be NULL for the default handler. If you don't care about this
* data, it is safe to pass a NULL pointer to this function to ignore it.
*
* \param puserdata pointer which is filled with the "userdata" pointer that
* was passed to SDL_SetAssertionHandler().
* \returns the SDL_AssertionHandler that is called when an assert triggers.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAssertionHandler
*/
extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
/**
* Get a list of all assertion failures.
*
* This function gets all assertions triggered since the last call to
* SDL_ResetAssertionReport(), or the start of the program.
*
* The proper way to examine this data looks something like this:
*
* ```c
* const SDL_AssertData *item = SDL_GetAssertionReport();
* while (item) {
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
* item->condition, item->function, item->filename,
* item->linenum, item->trigger_count,
* item->always_ignore ? "yes" : "no");
* item = item->next;
* }
* ```
*
* \returns a list of all failed assertions or NULL if the list is empty. This
* memory should not be modified or freed by the application. This
* pointer remains valid until the next call to SDL_Quit() or
* SDL_ResetAssertionReport().
*
* \threadsafety This function is not thread safe. Other threads calling
* SDL_ResetAssertionReport() simultaneously, may render the
* returned pointer invalid.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ResetAssertionReport
*/
extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
/**
* Clear the list of all assertion failures.
*
* This function will clear the list of all assertions triggered up to that
* point. Immediately following this call, SDL_GetAssertionReport will return
* no items. In addition, any previously-triggered assertions will be reset to
* a trigger_count of zero, and their always_ignore state will be false.
*
* \threadsafety This function is not thread safe. Other threads triggering an
* assertion, or simultaneously calling this function may cause
* memory leaks or crashes.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAssertionReport
*/
extern SDL_DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include <SDL3/SDL_close_code.h>
#endif /* SDL_assert_h_ */
================================================
FILE: deps/include/SDL3/SDL_asyncio.h
================================================
/*
Simple DirectMedia Layer
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* WIKI CATEGORY: AsyncIO */
/**
* # CategoryAsyncIO
*
* SDL offers a way to perform I/O asynchronously. This allows an app to read
* or write files without waiting for data to actually transfer; the functions
* that request I/O never block while the request is fulfilled.
*
* Instead, the data moves in the background and the app can check for results
* at their leisure.
*
* This is more complicated than just reading and writing files in a
* synchronous way, but it can allow for more efficiency, and never having
* framerate drops as the hard drive catches up, etc.
*
* The general usage pattern for async I/O is:
*
* - Create one or more SDL_AsyncIOQueue objects.
* - Open files with SDL_AsyncIOFromFile.
* - Start I/O tasks to the files with SDL_ReadAsyncIO or SDL_WriteAsyncIO,
* putting those tasks into one of the queues.
* - Later on, use SDL_GetAsyncIOResult on a queue to see if any task is
* finished without blocking. Tasks might finish in any order with success
* or failure.
* - When all your tasks are done, close the file with SDL_CloseAsyncIO. This
* also generates a task, since it might flush data to disk!
*
* This all works, without blocking, in a single thread, but one can also wait
* on a queue in a background thread, sleeping until new results have arrived:
*
* - Call SDL_WaitAsyncIOResult from one or more threads to efficiently block
* until new tasks complete.
* - When shutting down, call SDL_SignalAsyncIOQueue to unblock any sleeping
* threads despite there being no new tasks completed.
*
* And, of course, to match the synchronous SDL_LoadFile, we offer
* SDL_LoadFileAsync as a convenience function. This will handle allocating a
* buffer, slurping in the file data, and null-terminating it; you still check
* for results later.
*
* Behind the scenes, SDL will use newer, efficient APIs on platforms that
* support them: Linux's io_uring and Windows 11's IoRing, for example. If
* those technologies aren't available, SDL will offload the work to a thread
* pool that will manage otherwise-synchronous loads without blocking the app.
*
* ## Best Practices
*
* Simple non-blocking I/O--for an app that just wants to pick up data
* whenever it's ready without losing framerate waiting on disks to spin--can
* use whatever pattern works well for the program. In this case, simply call
* SDL_ReadAsyncIO, or maybe SDL_LoadFileAsync, as needed. Once a frame, call
* SDL_GetAsyncIOResult to check for any completed tasks and deal with the
* data as it arrives.
*
* If two separate pieces of the same program need their own I/O, it is legal
* for each to create their own queue. This will prevent either piece from
* accidentally consuming the other's completed tasks. Each queue does require
* some amount of resources, but it is not an overwhelming cost. Do not make a
* queue for each task, however. It is better to put many tasks into a single
* queue. They will be reported in order of completion, not in the order they
* were submitted, so it doesn't generally matter what order tasks are
* started.
*
* One async I/O queue can be shared by multiple threads, or one thread can
* have more than one queue, but the most efficient way--if ruthless
* efficiency is the goal--is to have one queue per thread, with multiple
* threads working in parallel, and attempt to keep each queue loaded with
* tasks that are both started by and consumed by the same thread. On modern
* platforms that can use newer interfaces, this can keep data flowing as
* efficiently as possible all the way from storage hardware to the app, with
* no contention between threads for access to the same queue.
*
* Written data is not guaranteed to make it to physical media by the time a
* closing task is completed, unless SDL_CloseAsyncIO is called with its
* `flush` parameter set to true, which is to say that a successful result
* here can still result in lost data during an unfortunately-timed power
* outage if not flushed. However, flushing will take longer and may be
* unnecessary, depending on the app's needs.
*/
#ifndef SDL_asyncio_h_
#define SDL_asyncio_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_begin_code.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* The asynchronous I/O operation structure.
*
* This operates as an opaque handle. One can then request read or write
* operations on it.
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_AsyncIOFromFile
*/
typedef struct SDL_AsyncIO SDL_AsyncIO;
/**
* Types of asynchronous I/O tasks.
*
* \since This enum is available since SDL 3.2.0.
*/
typedef enum SDL_AsyncIOTaskType
{
SDL_ASYNCIO_TASK_READ, /**< A read operation. */
SDL_ASYNCIO_TASK_WRITE, /**< A write operation. */
SDL_ASYNCIO_TASK_CLOSE /**< A close operation. */
} SDL_AsyncIOTaskType;
/**
* Possible outcomes of an asynchronous I/O task.
*
* \since This enum is available since SDL 3.2.0.
*/
typedef enum SDL_AsyncIOResult
{
SDL_ASYNCIO_COMPLETE, /**< request was completed without error */
SDL_ASYNCIO_FAILURE, /**< request failed for some reason; check SDL_GetError()! */
SDL_ASYNCIO_CANCELED /**< request was canceled before completing. */
} SDL_AsyncIOResult;
/**
* Information about a completed asynchronous I/O request.
*
* \since This struct is available since SDL 3.2.0.
*/
typedef struct SDL_AsyncIOOutcome
{
SDL_AsyncIO *asyncio; /**< what generated this task. This pointer will be invalid if it was closed! */
SDL_AsyncIOTaskType type; /**< What sort of task was this? Read, write, etc? */
SDL_AsyncIOResult result; /**< the result of the work (success, failure, cancellation). */
void *buffer; /**< buffer where data was read/written. */
Uint64 offset; /**< offset in the SDL_AsyncIO where data was read/written. */
Uint64 bytes_requested; /**< number of bytes the task was to read/write. */
Uint64 bytes_transferred; /**< actual number of bytes that were read/written. */
void *userdata; /**< pointer provided by the app when starting the task */
} SDL_AsyncIOOutcome;
/**
* A queue of completed asynchronous I/O tasks.
*
* When starting an asynchronous operation, you specify a queue for the new
* task. A queue can be asked later if any tasks in it have completed,
* allowing an app to manage multiple pending tasks in one place, in whatever
* order they complete.
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CreateAsyncIOQueue
* \sa SDL_ReadAsyncIO
* \sa SDL_WriteAsyncIO
* \sa SDL_GetAsyncIOResult
* \sa SDL_WaitAsyncIOResult
*/
typedef struct SDL_AsyncIOQueue SDL_AsyncIOQueue;
/**
* Use this function to create a new SDL_AsyncIO object for reading from
* and/or writing to a named file.
*
* The `mode` string understands the following values:
*
* - "r": Open a file for reading only. It must exist.
* - "w": Open a file for writing only. It will create missing files or
* truncate existing ones.
* - "r+": Open a file for update both reading and writing. The file must
* exist.
* - "w+": Create an empty file for both reading and writing. If a file with
* the same name already exists its content is erased and the file is
* treated as a new empty file.
*
* There is no "b" mode, as there is only "binary" style I/O, and no "a" mode
* for appending, since you specify the position when starting a task.
*
* This function supports Unicode filenames, but they must be encoded in UTF-8
* format, regardless of the underlying operating system.
*
* This call is _not_ asynchronous; it will open the file before returning,
* under the assumption that doing so is generally a fast operation. Future
* reads and writes to the opened file will be async, however.
*
* \param file a UTF-8 string representing the filename to open.
* \param mode an ASCII string representing the mode to be used for opening
* the file.
* \returns a pointer to the SDL_AsyncIO structure that is created or NULL on
* failure; call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CloseAsyncIO
* \sa SDL_ReadAsyncIO
* \sa SDL_WriteAsyncIO
*/
extern SDL_DECLSPEC SDL_AsyncIO * SDLCALL SDL_AsyncIOFromFile(const char *file, const char *mode);
/**
* Use this function to get the size of the data stream in an SDL_AsyncIO.
*
* This call is _not_ asynchronous; it assumes that obtaining this info is a
* non-blocking operation in most reasonable cases.
*
* \param asyncio the SDL_AsyncIO to get the size of the data stream from.
* \returns the size of the data stream in the SDL_IOStream on success or a
* negative error code on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio);
/**
* Start an async read.
*
* This function reads up to `size` bytes from `offset` position in the data
* source to the area pointed at by `ptr`. This function may read less bytes
* than requested.
*
* This function returns as quickly as possible; it does not wait for the read
* to complete. On a successful return, this work will continue in the
* background. If the work begins, even failure is asynchronous: a failing
* return value from this function only means the work couldn't start at all.
*
* `ptr` must remain available until the work is done, and may be accessed by
* the system at any time until then. Do not allocate it on the stack, as this
* might take longer than the life of the calling function to complete!
*
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
* to it when it completes its work.
*
* \param asyncio a pointer to an SDL_AsyncIO structure.
* \param ptr a pointer to a buffer to read data into.
* \param offset the position to start reading in the data source.
* \param size the number of bytes to read from the data source.
* \param queue a queue to add the new SDL_AsyncIO to.
* \param userdata an app-defined pointer that will be provided with the task
* results.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WriteAsyncIO
* \sa SDL_CreateAsyncIOQueue
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ReadAsyncIO(SDL_AsyncIO *asyncio, void *ptr, Uint64 offset, Uint64 size, SDL_AsyncIOQueue *queue, void *userdata);
/**
* Start an async write.
*
* This function writes `size` bytes from `offset` position in the data source
* to the area pointed at by `ptr`.
*
* This function returns as quickly as possible; it does not wait for the
* write to complete. On a successful return, this work will continue in the
* background. If the work begins, even failure is asynchronous: a failing
* return value from this function only means the work couldn't start at all.
*
* `ptr` must remain available until the work is done, and may be accessed by
* the system at any time until then. Do not allocate it on the stack, as this
* might take longer than the life of the calling function to complete!
*
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
* to it when it completes its work.
*
* \param asyncio a pointer to an SDL_AsyncIO structure.
* \param ptr a pointer to a buffer to write data from.
* \param offset the position to start writing to the data source.
* \param size the number of bytes to write to the data source.
* \param queue a queue to add the new SDL_AsyncIO to.
* \param userdata an app-defined pointer that will be provided with the task
* results.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ReadAsyncIO
* \sa SDL_CreateAsyncIOQueue
*/
extern SDL_DECLSPEC bool SDLCALL SDL_WriteAsyncIO(SDL_AsyncIO *asyncio, void *ptr, Uint64 offset, Uint64 size, SDL_AsyncIOQueue *queue, void *userdata);
/**
* Close and free any allocated resources for an async I/O object.
*
* Closing a file is _also_ an asynchronous task! If a write failure were to
* happen during the closing process, for example, the task results will
* report it as usual.
*
* Closing a file that has been written to does not guarantee the data has
* made it to physical media; it may remain in the operating system's file
* cache, for later writing to disk. This means that a successfully-closed
* file can be lost if the system crashes or loses power in this small window.
* To prevent this, call this function with the `flush` parameter set to true.
* This will make the operation take longer, and perhaps increase system load
* in general, but a successful result guarantees that the data has made it to
* physical storage. Don't use this for temporary files, caches, and
* unimportant data, and definitely use it for crucial irreplaceable files,
* like game saves.
*
* This function guarantees that the close will happen after any other pending
* tasks to `asyncio`, so it's safe to open a file, start several operations,
* close the file immediately, then check for all results later. This function
* will not block until the tasks have completed.
*
* Once this function returns true, `asyncio` is no longer valid, regardless
* of any future outcomes. Any completed tasks might still contain this
* pointer in their SDL_AsyncIOOutcome data, in case the app was using this
* value to track information, but it should not be used again.
*
* If this function returns false, the close wasn't started at all, and it's
* safe to attempt to close again later.
*
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
* to it when it completes its work.
*
* \param asyncio a pointer to an SDL_AsyncIO structure to close.
* \param flush true if data should sync to disk before the task completes.
* \param queue a queue to add the new SDL_AsyncIO to.
* \param userdata an app-defined pointer that will be provided with the task
* results.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, but two
* threads should not attempt to close the same object.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flush, SDL_AsyncIOQueue *queue, void *userdata);
/**
* Create a task queue for tracking multiple I/O operations.
*
* Async I/O operations are assigned to a queue when started. The queue can be
* checked for completed tasks thereafter.
*
* \returns a new task queue object or NULL if there was an error; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroyAsyncIOQueue
* \sa SDL_GetAsyncIOResult
* \sa SDL_WaitAsyncIOResult
*/
extern SDL_DECLSPEC SDL_AsyncIOQueue * SDLCALL SDL_CreateAsyncIOQueue(void);
/**
* Destroy a previously-created async I/O task queue.
*
* If there are still tasks pending for this queue, this call will block until
* those tasks are finished. All those tasks will be deallocated. Their
* results will be lost to the app.
*
* Any pending reads from SDL_LoadFileAsync() that are still in this queue
* will have their buffers deallocated by this function, to prevent a memory
* leak.
*
* Once this function is called, the queue is no longer valid and should not
* be used, including by other threads that might access it while destruction
* is blocking on pending tasks.
*
* Do not destroy a queue that still has threads waiting on it through
* SDL_WaitAsyncIOResult(). You can call SDL_SignalAsyncIOQueue() first to
* unblock those threads, and take measures (such as SDL_WaitThread()) to make
* sure they have finished their wait and won't wait on the queue again.
*
* \param queue the task queue to destroy.
*
* \threadsafety It is safe to call this function from any thread, so long as
* no other thread is waiting on the queue with
* SDL_WaitAsyncIOResult.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC void SDLCALL SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue);
/**
* Query an async I/O task queue for completed tasks.
*
* If a task assigned to this queue has finished, this will return true and
* fill in `outcome` with the details of the task. If no task in the queue has
* finished, this function will return false. This function does not block.
*
* If a task has completed, this function will free its resources and the task
* pointer will no longer be valid. The task will be removed from the queue.
*
* It is safe for multiple threads to call this function on the same queue at
* once; a completed task will only go to one of the threads.
*
* \param queue the async I/O task queue to query.
* \param outcome details of a finished task will be written here. May not be
* NULL.
* \returns true if a task has completed, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WaitAsyncIOResult
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome);
/**
* Block until an async I/O task queue has a completed task.
*
* This function puts the calling thread to sleep until there a task assigned
* to the queue that has finished.
*
* If a task assigned to the queue has finished, this will return true and
* fill in `outcome` with the details of the task. If no task in the queue has
* finished, this function will return false.
*
* If a task has completed, this function will free its resources and the task
* pointer will no longer be valid. The task will be removed from the queue.
*
* It is safe for multiple threads to call this function on the same queue at
* once; a completed task will only go to one of the threads.
*
* Note that by the nature of various platforms, more than one waiting thread
* may wake to handle a single task, but only one will obtain it, so
* `timeoutMS` is a _maximum_ wait time, and this function may return false
* sooner.
*
* This function may return false if there was a system error, the OS
* inadvertently awoke multiple threads, or if SDL_SignalAsyncIOQueue() was
* called to wake up all waiting threads without a finished task.
*
* A timeout can be used to specify a maximum wait time, but rather than
* polling, it is possible to have a timeout of -1 to wait forever, and use
* SDL_SignalAsyncIOQueue() to wake up the waiting threads later.
*
* \param queue the async I/O task queue to wait on.
* \param outcome details of a finished task will be written here. May not be
* NULL.
* \param timeoutMS the maximum time to wait, in milliseconds, or -1 to wait
* indefinitely.
* \returns true if task has completed, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SignalAsyncIOQueue
*/
extern SDL_DECLSPEC bool SDLCALL SDL_WaitAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome, Sint32 timeoutMS);
/**
* Wake up any threads that are blocking in SDL_WaitAsyncIOResult().
*
* This will unblock any threads that are sleeping in a call to
* SDL_WaitAsyncIOResult for the specified queue, and cause them to return
* from that function.
*
* This can be useful when destroying a queue to make sure nothing is touching
* it indefinitely. In this case, once this call completes, the caller should
* take measures to make sure any previously-blocked threads have returned
* from their wait and will not touch the queue again (perhaps by setting a
* flag to tell the threads to terminate and then using SDL_WaitThread() to
* make sure they've done so).
*
* \param queue the async I/O task queue to signal.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WaitAsyncIOResult
*/
extern SDL_DECLSPEC void SDLCALL SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue);
/**
* Load all the data from a file path, asynchronously.
*
* This function returns as quickly as possible; it does not wait for the read
* to complete. On a successful return, this work will continue in the
* background. If the work begins, even failure is asynchronous: a failing
* return value from this function only means the work couldn't start at all.
*
* The data is allocated with a zero byte at the end (null terminated) for
* convenience. This extra byte is not included in SDL_AsyncIOOutcome's
* bytes_transferred value.
*
* This function will allocate the buffer to contain the file. It must be
* deallocated by calling SDL_free() on SDL_AsyncIOOutcome's buffer field
* after completion.
*
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
* to it when it completes its work.
*
* \param file the path to read all available data from.
* \param queue a queue to add the new SDL_AsyncIO to.
* \param userdata an app-defined pointer that will be provided with the task
* results.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LoadFile_IO
*/
extern SDL_DECLSPEC bool SDLCALL SDL_LoadFileAsync(const char *file, SDL_AsyncIOQueue *queue, void *userdata);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include <SDL3/SDL_close_code.h>
#endif /* SDL_asyncio_h_ */
================================================
FILE: deps/include/SDL3/SDL_atomic.h
================================================
/*
Simple DirectMedia Layer
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* # CategoryAtomic
*
* Atomic operations.
*
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
* should not be using any functions in this file. You should be protecting
* your data structures with full mutexes instead.
*
* ***Seriously, here be dragons!***
*
* You can find out a little more about lockless programming and the subtle
* issues that can arise here:
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
*
* There's also lots of good information here:
*
* - https://www.1024cores.net/home/lock-free-algorithms
* - https://preshing.com/
*
* These operations may or may not actually be implemented using processor
* specific atomic operations. When possible they are implemented as true
* processor specific atomic operations. When that is not possible the are
* implemented using locks that *do* use the available atomic operations.
*
* All of the atomic operations that modify memory are full memory barriers.
*/
#ifndef SDL_atomic_h_
#define SDL_atomic_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_platform_defines.h>
#include <SDL3/SDL_begin_code.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* An atomic spinlock.
*
* The atomic locks are efficient spinlocks using CPU instructions, but are
* vulnerable to starvation and can spin forever if a thread holding a lock
* has been terminated. For this reason you should minimize the code executed
* inside an atomic lock and never do expensive things like API or system
* calls while holding them.
*
* They are also vulnerable to starvation if the thread holding the lock is
* lower priority than other threads and doesn't get scheduled. In general you
* should use mutexes instead, since they have better performance and
* contention behavior.
*
* The atomic locks are not safe to lock recursively.
*
* Porting Note: The spin lock functions and type are required and can not be
* emulated because they are used in the atomic emulation code.
*/
typedef int SDL_SpinLock;
/**
* Try to lock a spin lock by setting it to a non-zero value.
*
* ***Please note that spinlocks are dangerous if you don't know what you're
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable.
* \returns true if the lock succeeded, false if the lock is already held.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockSpinlock
* \sa SDL_UnlockSpinlock
*/
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
/**
* Lock a spin lock by setting it to a non-zero value.
*
* ***Please note that spinlocks are dangerous if you don't know what you're
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_TryLockSpinlock
* \sa SDL_UnlockSpinlock
*/
extern SDL_DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
/**
* Unlock a spin lock by setting it to 0.
*
* Always returns immediately.
*
* ***Please note that spinlocks are dangerous if you don't know what you're
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockSpinlock
* \sa SDL_TryLockSpinlock
*/
extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* Mark a compiler barrier.
*
* A compiler barrier prevents the compiler from reordering reads and writes
* to globally visible variables across the call.
*
* This macro only prevents the compiler from reordering reads and writes, it
* does not prevent the CPU from reordering reads and writes. However, all of
* the atomic operations that modify memory are full memory barriers.
*
* \threadsafety Obviously this macro is safe to use from any thread at any
* time, but if you find yourself needing this, you are probably
* dealing with some very sensitive code; be careful!
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier()
#elif defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
#define SDL_CompilerBarrier() _ReadWriteBarrier()
#elif (defined(__GNUC__) && !defined(SDL_PLATFORM_EMSCRIPTEN)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
#elif defined(__WATCOMC__)
extern __inline void SDL_CompilerBarrier(void);
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
#else
#define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); SDL_UnlockSpinlock(&_tmp); }
#endif
/**
* Insert a memory release barrier (function version).
*
* Please refer to SDL_MemoryBarrierRelease for details. This is a function
* version, which might be useful if you need to use this functionality from a
* scripting language, etc. Also, some of the macro versions call this
* function behind the scenes, where more heavy lifting can happen inside of
* SDL. Generally, though, an app written in C/C++/etc should use the macro
* version, as it will be more efficient.
*
* \threadsafety Obviously this function is safe to use from any thread at any
* time, but if you find yourself needing this, you are probably
* dealing with some very sensitive code; be careful!
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_MemoryBarrierRelease
*/
extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
/**
* Insert a memory acquire barrier (function version).
*
* Please refer to SDL_MemoryBarrierRelease for details. This is a function
* version, which might be useful if you need to use this functionality from a
* scripting language, etc. Also, some of the macro versions call this
* function behind the scenes, where more heavy lifting can happen inside of
* SDL. Generally, though, an app written in C/C++/etc should use the macro
* version, as it will be more efficient.
*
* \threadsafety Obviously this function is safe to use from any thread at any
* time, but if you find yourself needing this, you are probably
* dealing with some very sensitive code; be careful!
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_MemoryBarrierAcquire
*/
extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* Insert a memory release barrier (macro version).
*
* Memory barriers are designed to prevent reads and writes from being
* reordered by the compiler and being seen out of order on multi-core CPUs.
*
* A typical pattern would be for thread A to write some data and a flag, and
* for thread B to read the flag and get the data. In this case you would
* insert a release barrier between writing the data and the flag,
* guaranteeing that the data write completes no later than the flag is
* written, and you would insert an acquire barrier between reading the flag
* and reading the data, to ensure that all the reads associated with the flag
* have completed.
*
* In this pattern you should always see a release barrier paired with an
* acquire barrier and you should gate the data reads/writes with a single
* flag variable.
*
* For more information on these semantics, take a look at the blog post:
* http://preshing.com/20120913/acquire-and-release-semantics
*
* This is the macro version of this functionality; if possible, SDL will use
* compiler intrinsics or inline assembly, but some platforms might need to
* call the function version of this, SDL_MemoryBarrierReleaseFunction to do
* the heavy lifting. Apps that can use the macro should favor it over the
* function.
*
* \threadsafety Obviously this macro is safe to use from any thread at any
* time, but if you find yourself needing this, you are probably
* dealing with some very sensitive code; be careful!
*
* \since This macro is available since SDL 3.2.0.
*
* \sa SDL_MemoryBarrierAcquire
* \sa SDL_MemoryBarrierReleaseFunction
*/
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
/**
* Insert a memory acquire barrier (macro version).
*
* Please see SDL_MemoryBarrierRelease for the details on what memory barriers
* are and when to use them.
*
* This is the macro version of this functionality; if possible, SDL will use
* compiler intrinsics or inline assembly, but some platforms might need to
* call the function version of this, SDL_MemoryBarrierAcquireFunction, to do
* the heavy lifting. Apps that can use the macro should favor it over the
* function.
*
* \threadsafety Obviously this macro is safe to use from any thread at any
* time, but if you find yourself needing this, you are probably
* dealing with some very sensitive code; be careful!
*
* \since This macro is available since SDL 3.2.0.
*
* \sa SDL_MemoryBarrierRelease
* \sa SDL_MemoryBarrierAcquireFunction
*/
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
#elif defined(__GNUC__) && defined(__aarch64__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__GNUC__) && defined(__arm__)
#if 0 /* defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID) */
/* Information from:
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
The Linux kernel provides a helper function which provides the right code for a memory barrier,
hard-coded at address 0xffff0fa0
*/
typedef void (*SDL_KernelMemoryBarrierFunc)();
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
#else
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
#ifdef __thumb__
/* The mcr instruction isn't available in thumb mode, use real functions */
#define SDL_MEMORY_BARRIER_USES_FUNCTION
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#endif /* __thumb__ */
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
#endif /* SDL_PLATFORM_LINUX || SDL_PLATFORM_ANDROID */
#endif /* __GNUC__ && __arm__ */
#else
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
#include <mbarrier.h>
#define SDL_MemoryBarrierRelease() __machine_rel_barrier()
#define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
#else
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
#endif
#endif
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro to insert a CPU-specific "pause" instruction into the program.
*
* This can be useful in busy-wait loops, as it serves as a hint to the CPU as
* to the program's intent; some CPUs can use this to do more efficient
* processing. On some platforms, this doesn't do anything, so using this
* macro might just be a harmless no-op.
*
* Note that if you are busy-waiting, there are often more-efficient
* approaches with other synchronization primitives: mutexes, semaphores,
* condition variables, etc.
*
* \threadsafety This macro is safe to use from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_CPUPauseInstruction() DoACPUPauseInACompilerAndArchitectureSpecificWay
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
#elif (defined(__powerpc__) || defined(__powerpc64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
#elif (defined(__riscv) && __riscv_xlen == 64)
#define SDL_CPUPauseInstruction() __asm__ __volatile__(".insn i 0x0F, 0, x0, x0, 0x010");
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
#define SDL_CPUPauseInstruction() __yield()
#elif defined(__WATCOMC__) && defined(__386__)
extern __inline void SDL_CPUPauseInstruction(void);
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
#else
#define SDL_CPUPauseInstruction()
#endif
/**
* A type representing an atomic integer value.
*
* This can be used to manage a value that is synchronized across multiple
* CPUs without a race condition; when an app sets a value with
* SDL_SetAtomicInt all other threads, regardless of the CPU it is running on,
* will see that value when retrieved with SDL_GetAtomicInt, regardless of CPU
* caches, etc.
*
* This is also useful for atomic compare-and-swap operations: a thread can
* change the value as long as its current value matches expectations. When
* done in a loop, one can guarantee data consistency across threads without a
* lock (but the usual warnings apply: if you don't know what you're doing, or
* you don't do it carefully, you can confidently cause any number of
* disasters with this, so in most cases, you _should_ use a mutex instead of
* this!).
*
* This is a struct so people don't accidentally use numeric operations on it
* directly. You have to use SDL atomic functions.
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CompareAndSwapAtomicInt
* \sa SDL_GetAtomicInt
* \sa SDL_SetAtomicInt
* \sa SDL_AddAtomicInt
*/
typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
/**
* Set an atomic variable to a new value if it is currently an old value.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicInt variable to be modified.
* \param oldval the old value.
* \param newval the new value.
* \returns true if the atomic variable was set, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAtomicInt
* \sa SDL_SetAtomicInt
*/
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval);
/**
* Set an atomic variable to a value.
*
* This function also acts as a full memory barrier.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicInt variable to be modified.
* \param v the desired value.
* \returns the previous value of the atomic variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAtomicInt
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAtomicInt(SDL_AtomicInt *a, int v);
/**
* Get the value of an atomic variable.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicInt variable.
* \returns the current value of an atomic variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAtomicInt
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetAtomicInt(SDL_AtomicInt *a);
/**
* Add to an atomic variable.
*
* This function also acts as a full memory barrier.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicInt variable to be modified.
* \param v the desired value to add.
* \returns the previous value of the atomic variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AtomicDecRef
* \sa SDL_AtomicIncRef
*/
extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v);
#ifndef SDL_AtomicIncRef
/**
* Increment an atomic variable used as a reference count.
*
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
*
* \param a a pointer to an SDL_AtomicInt to increment.
* \returns the previous value of the atomic variable.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*
* \sa SDL_AtomicDecRef
*/
#define SDL_AtomicIncRef(a) SDL_AddAtomicInt(a, 1)
#endif
#ifndef SDL_AtomicDecRef
/**
* Decrement an atomic variable used as a reference count.
*
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
*
* \param a a pointer to an SDL_AtomicInt to decrement.
* \returns true if the variable reached zero after decrementing, false
* otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*
* \sa SDL_AtomicIncRef
*/
#define SDL_AtomicDecRef(a) (SDL_AddAtomicInt(a, -1) == 1)
#endif
/**
* A type representing an atomic unsigned 32-bit value.
*
* This can be used to manage a value that is synchronized across multiple
* CPUs without a race condition; when an app sets a value with
* SDL_SetAtomicU32 all other threads, regardless of the CPU it is running on,
* will see that value when retrieved with SDL_GetAtomicU32, regardless of CPU
* caches, etc.
*
* This is also useful for atomic compare-and-swap operations: a thread can
* change the value as long as its current value matches expectations. When
* done in a loop, one can guarantee data consistency across threads without a
* lock (but the usual warnings apply: if you don't know what you're doing, or
* you don't do it carefully, you can confidently cause any number of
* disasters with this, so in most cases, you _should_ use a mutex instead of
* this!).
*
* This is a struct so people don't accidentally use numeric operations on it
* directly. You have to use SDL atomic functions.
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CompareAndSwapAtomicU32
* \sa SDL_GetAtomicU32
* \sa SDL_SetAtomicU32
*/
typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
/**
* Set an atomic variable to a new value if it is currently an old value.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
* \param oldval the old value.
* \param newval the new value.
* \returns true if the atomic variable was set, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAtomicU32
* \sa SDL_SetAtomicU32
*/
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval);
/**
* Set an atomic variable to a value.
*
* This function also acts as a full memory barrier.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
* \param v the desired value.
* \returns the previous value of the atomic variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAtomicU32
*/
extern SDL_DECLSPEC Uint32 SDLCALL SDL_SetAtomicU32(SDL_AtomicU32 *a, Uint32 v);
/**
* Get the value of an atomic variable.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicU32 variable.
* \returns the current value of an atomic variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAtomicU32
*/
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
/**
* Add to an atomic variable.
*
* This function also acts as a full memory barrier.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
* \param v the desired value to add or subtract.
* \returns the previous value of the atomic variable.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.4.0.
*/
extern SDL_DECLSPEC Uint32 SDLCALL SDL_AddAtomicU32(SDL_AtomicU32 *a, int v);
/**
* Set a pointer to a new value if it is currently an old value.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to a pointer.
* \param oldval the old pointer value.
* \param newval the new pointer value.
* \returns true if the pointer was set, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CompareAndSwapAtomicInt
* \sa SDL_GetAtomicPointer
* \sa SDL_SetAtomicPointer
*/
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval);
/**
* Set a pointer to a value atomically.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to a pointer.
* \param v the desired pointer value.
* \returns the previous value of the pointer.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CompareAndSwapAtomicPointer
* \sa SDL_GetAtomicPointer
*/
extern SDL_DECLSPEC void * SDLCALL SDL_SetAtomicPointer(void **a, void *v);
/**
* Get the value of a pointer atomically.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to a pointer.
* \returns the current value of a pointer.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CompareAndSwapAtomicPointer
* \sa SDL_SetAtomicPointer
*/
extern SDL_DECLSPEC void * SDLCALL SDL_GetAtomicPointer(void **a);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include <SDL3/SDL_close_code.h>
#endif /* SDL_atomic_h_ */
================================================
FILE: deps/include/SDL3/SDL_audio.h
================================================
/*
Simple DirectMedia Layer
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* # CategoryAudio
*
* Audio functionality for the SDL library.
*
* All audio in SDL3 revolves around SDL_AudioStream. Whether you want to play
* or record audio, convert it, stream it, buffer it, or mix it, you're going
* to be passing it through an audio stream.
*
* Audio streams are quite flexible; they can accept any amount of data at a
* time, in any supported format, and output it as needed in any other format,
* even if the data format changes on either side halfway through.
*
* An app opens an audio device and binds any number of audio streams to it,
* feeding more data to the streams as available. When the device needs more
* data, it will pull it from all bound streams and mix them together for
* playback.
*
* Audio streams can also use an app-provided callback to supply data
* on-demand, which maps pretty closely to the SDL2 audio model.
*
* SDL also provides a simple .WAV loader in SDL_LoadWAV (and SDL_LoadWAV_IO
* if you aren't reading from a file) as a basic means to load sound data into
* your program.
*
* ## Logical audio devices
*
* In SDL3, opening a physical device (like a SoundBlaster 16 Pro) gives you a
* logical device ID that you can bind audio streams to. In almost all cases,
* logical devices can be used anywhere in the API that a physical device is
* normally used. However, since each device opening generates a new logical
* device, different parts of the program (say, a VoIP library, or
* text-to-speech framework, or maybe some other sort of mixer on top of SDL)
* can have their own device opens that do not interfere with each other; each
* logical device will mix its separate audio down to a single buffer, fed to
* the physical device, behind the scenes. As many logical devices as you like
* can come and go; SDL will only have to open the physical device at the OS
* level once, and will manage all the logical devices on top of it
* internally.
*
* One other benefit of logical devices: if you don't open a specific physical
* device, instead opting for the default, SDL can automatically migrate those
* logical devices to different hardware as circumstances change: a user
* plugged in headphones? The system default changed? SDL can transparently
* migrate the logical devices to the correct physical device seamlessly and
* keep playing; the app doesn't even have to know it happened if it doesn't
* want to.
*
* ## Simplified audio
*
* As a simplified model for when a single source of audio is all that's
* needed, an app can use SDL_OpenAudioDeviceStream, which is a single
* function to open an audio device, create an audio stream, bind that stream
* to the newly-opened device, and (optionally) provide a callback for
* obtaining audio data. When using this function, the primary interface is
* the SDL_AudioStream and the device handle is mostly hidden away; destroying
* a stream created through this function will also close the device, stream
* bindings cannot be changed, etc. One other quirk of this is that the device
* is started in a _paused_ state and must be explicitly resumed; this is
* partially to offer a clean migration for SDL2 apps and partially because
* the app might have to do more setup before playback begins; in the
* non-simplified form, nothing will play until a stream is bound to a device,
* so they start _unpaused_.
*
* ## Channel layouts
*
* Audio data passing through SDL is uncompressed PCM data, interleaved. One
* can provide their own decompression through an MP3, etc, decoder, but SDL
* does not provide this directly. Each interleaved channel of data is meant
* to be in a specific order.
*
* Abbreviations:
*
* - FRONT = single mono speaker
* - FL = front left speaker
* - FR = front right speaker
* - FC = front center speaker
* - BL = back left speaker
* - BR = back right speaker
* - SR = surround right speaker
* - SL = surround left speaker
* - BC = back center speaker
* - LFE = low-frequency speaker
*
* These are listed in the order they are laid out in memory, so "FL, FR"
* means "the front left speaker is laid out in memory first, then the front
* right, then it repeats for the next audio frame".
*
* - 1 channel (mono) layout: FRONT
* - 2 channels (stereo) layout: FL, FR
* - 3 channels (2.1) layout: FL, FR, LFE
* - 4 channels (quad) layout: FL, FR, BL, BR
* - 5 channels (4.1) layout: FL, FR, LFE, BL, BR
* - 6 channels (5.1) layout: FL, FR, FC, LFE, BL, BR (last two can also be
* SL, SR)
* - 7 channels (6.1) layout: FL, FR, FC, LFE, BC, SL, SR
* - 8 channels (7.1) layout: FL, FR, FC, LFE, BL, BR, SL, SR
*
* This is the same order as DirectSound expects, but applied to all
* platforms; SDL will swizzle the channels as necessary if a platform expects
* something different.
*
* SDL_AudioStream can also be provided channel maps to change this ordering
* to whatever is necessary, in other audio processing scenarios.
*/
#ifndef SDL_audio_h_
#define SDL_audio_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_endian.h>
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_mutex.h>
#include <SDL3/SDL_properties.h>
#include <SDL3/SDL_iostream.h>
#include <SDL3/SDL_begin_code.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* Mask of bits in an SDL_AudioFormat that contains the format bit size.
*
* Generally one should use SDL_AUDIO_BITSIZE instead of this macro directly.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_MASK_BITSIZE (0xFFu)
/**
* Mask of bits in an SDL_AudioFormat that contain the floating point flag.
*
* Generally one should use SDL_AUDIO_ISFLOAT instead of this macro directly.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_MASK_FLOAT (1u<<8)
/**
* Mask of bits in an SDL_AudioFormat that contain the bigendian flag.
*
* Generally one should use SDL_AUDIO_ISBIGENDIAN or SDL_AUDIO_ISLITTLEENDIAN
* instead of this macro directly.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_MASK_BIG_ENDIAN (1u<<12)
/**
* Mask of bits in an SDL_AudioFormat that contain the signed data flag.
*
* Generally one should use SDL_AUDIO_ISSIGNED instead of this macro directly.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_MASK_SIGNED (1u<<15)
/**
* Define an SDL_AudioFormat value.
*
* SDL does not support custom audio formats, so this macro is not of much use
* externally, but it can be illustrative as to what the various bits of an
* SDL_AudioFormat mean.
*
* For example, SDL_AUDIO_S32LE looks like this:
*
* ```c
* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 32)
* ```
*
* \param signed 1 for signed data, 0 for unsigned data.
* \param bigendian 1 for bigendian data, 0 for littleendian data.
* \param flt 1 for floating point data, 0 for integer data.
* \param size number of bits per sample.
* \returns a format value in the style of SDL_AudioFormat.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_DEFINE_AUDIO_FORMAT(signed, bigendian, flt, size) \
(((Uint16)(signed) << 15) | ((Uint16)(bigendian) << 12) | ((Uint16)(flt) << 8) | ((size) & SDL_AUDIO_MASK_BITSIZE))
/**
* Audio format.
*
* \since This enum is available since SDL 3.2.0.
*
* \sa SDL_AUDIO_BITSIZE
* \sa SDL_AUDIO_BYTESIZE
* \sa SDL_AUDIO_ISINT
* \sa SDL_AUDIO_ISFLOAT
* \sa SDL_AUDIO_ISBIGENDIAN
* \sa SDL_AUDIO_ISLITTLEENDIAN
* \sa SDL_AUDIO_ISSIGNED
* \sa SDL_AUDIO_ISUNSIGNED
*/
typedef enum SDL_AudioFormat
{
SDL_AUDIO_UNKNOWN = 0x0000u, /**< Unspecified audio format */
SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */
/* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */
SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */
/* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 8), */
SDL_AUDIO_S16LE = 0x8010u, /**< Signed 16-bit samples */
/* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 16), */
SDL_AUDIO_S16BE = 0x9010u, /**< As above, but big-endian byte order */
/* SDL_DEFINE_AUDIO_FORMAT(1, 1, 0, 16), */
SDL_AUDIO_S32LE = 0x8020u, /**< 32-bit integer samples */
/* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 32), */
SDL_AUDIO_S32BE = 0x9020u, /**< As above, but big-endian byte order */
/* SDL_DEFINE_AUDIO_FORMAT(1, 1, 0, 32), */
SDL_AUDIO_F32LE = 0x8120u, /**< 32-bit floating point samples */
/* SDL_DEFINE_AUDIO_FORMAT(1, 0, 1, 32), */
SDL_AUDIO_F32BE = 0x9120u, /**< As above, but big-endian byte order */
/* SDL_DEFINE_AUDIO_FORMAT(1, 1, 1, 32), */
/* These represent the current system's byteorder. */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
SDL_AUDIO_S16 = SDL_AUDIO_S16LE,
SDL_AUDIO_S32 = SDL_AUDIO_S32LE,
SDL_AUDIO_F32 = SDL_AUDIO_F32LE
#else
SDL_AUDIO_S16 = SDL_AUDIO_S16BE,
SDL_AUDIO_S32 = SDL_AUDIO_S32BE,
SDL_AUDIO_F32 = SDL_AUDIO_F32BE
#endif
} SDL_AudioFormat;
/**
* Retrieve the size, in bits, from an SDL_AudioFormat.
*
* For example, `SDL_AUDIO_BITSIZE(SDL_AUDIO_S16)` returns 16.
*
* \param x an SDL_AudioFormat value.
* \returns data size in bits.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_BITSIZE(x) ((x) & SDL_AUDIO_MASK_BITSIZE)
/**
* Retrieve the size, in bytes, from an SDL_AudioFormat.
*
* For example, `SDL_AUDIO_BYTESIZE(SDL_AUDIO_S16)` returns 2.
*
* \param x an SDL_AudioFormat value.
* \returns data size in bytes.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_BYTESIZE(x) (SDL_AUDIO_BITSIZE(x) / 8)
/**
* Determine if an SDL_AudioFormat represents floating point data.
*
* For example, `SDL_AUDIO_ISFLOAT(SDL_AUDIO_S16)` returns 0.
*
* \param x an SDL_AudioFormat value.
* \returns non-zero if format is floating point, zero otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_ISFLOAT(x) ((x) & SDL_AUDIO_MASK_FLOAT)
/**
* Determine if an SDL_AudioFormat represents bigendian data.
*
* For example, `SDL_AUDIO_ISBIGENDIAN(SDL_AUDIO_S16LE)` returns 0.
*
* \param x an SDL_AudioFormat value.
* \returns non-zero if format is bigendian, zero otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_ISBIGENDIAN(x) ((x) & SDL_AUDIO_MASK_BIG_ENDIAN)
/**
* Determine if an SDL_AudioFormat represents littleendian data.
*
* For example, `SDL_AUDIO_ISLITTLEENDIAN(SDL_AUDIO_S16BE)` returns 0.
*
* \param x an SDL_AudioFormat value.
* \returns non-zero if format is littleendian, zero otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
/**
* Determine if an SDL_AudioFormat represents signed data.
*
* For example, `SDL_AUDIO_ISSIGNED(SDL_AUDIO_U8)` returns 0.
*
* \param x an SDL_AudioFormat value.
* \returns non-zero if format is signed, zero otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_ISSIGNED(x) ((x) & SDL_AUDIO_MASK_SIGNED)
/**
* Determine if an SDL_AudioFormat represents integer data.
*
* For example, `SDL_AUDIO_ISINT(SDL_AUDIO_F32)` returns 0.
*
* \param x an SDL_AudioFormat value.
* \returns non-zero if format is integer, zero otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
/**
* Determine if an SDL_AudioFormat represents unsigned data.
*
* For example, `SDL_AUDIO_ISUNSIGNED(SDL_AUDIO_S16)` returns 0.
*
* \param x an SDL_AudioFormat value.
* \returns non-zero if format is unsigned, zero otherwise.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
/**
* SDL Audio Device instance IDs.
*
* Zero is used to signify an invalid/null device.
*
* \since This datatype is available since SDL 3.2.0.
*/
typedef Uint32 SDL_AudioDeviceID;
/**
* A value used to request a default playback audio device.
*
* Several functions that require an SDL_AudioDeviceID will accept this value
* to signify the app just wants the system to choose a default device instead
* of the app providing a specific one.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK ((SDL_AudioDeviceID) 0xFFFFFFFFu)
/**
* A value used to request a default recording audio device.
*
* Several functions that require an SDL_AudioDeviceID will accept this value
* to signify the app just wants the system to choose a default device instead
* of the app providing a specific one.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFEu)
/**
* Format specifier for audio data.
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_AudioFormat
*/
typedef struct SDL_AudioSpec
{
SDL_AudioFormat format; /**< Audio data format */
int channels; /**< Number of channels: 1 mono, 2 stereo, etc */
int freq; /**< sample rate: sample frames per second */
} SDL_AudioSpec;
/**
* Calculate the size of each audio frame (in bytes) from an SDL_AudioSpec.
*
* This reports on the size of an audio sample frame: stereo Sint16 data (2
* channels of 2 bytes each) would be 4 bytes per frame, for example.
*
* \param x an SDL_AudioSpec to query.
* \returns the number of bytes used per sample frame.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AUDIO_FRAMESIZE(x) (SDL_AUDIO_BYTESIZE((x).format) * (x).channels)
/**
* The opaque handle that represents an audio stream.
*
* SDL_AudioStream is an audio conversion interface.
*
* - It can handle resampling data in chunks without generating artifacts,
* when it doesn't have the complete buffer available.
* - It can handle incoming data in any variable size.
* - It can handle input/output format changes on the fly.
* - It can remap audio channels between inputs and outputs.
* - You push data as you have it, and pull it when you need it
* - It can also function as a basic audio data queue even if you just have
* sound that needs to pass from one place to another.
* - You can hook callbacks up to them when more data is added or requested,
* to manage data on-the-fly.
*
* Audio streams are the core of the SDL3 audio interface. You create one or
* more of them, bind them to an opened audio device, and feed data to them
* (or for recording, consume data from them).
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CreateAudioStream
*/
typedef struct SDL_AudioStream SDL_AudioStream;
/* Function prototypes */
/**
* Use this function to get the number of built-in audio drivers.
*
* This function returns a hardcoded number. This never returns a negative
* value; if there are no drivers compiled into this build of SDL, this
* function returns zero. The presence of a driver in this list does not mean
* it will function, it just means SDL is capable of interacting with that
* interface. For example, a build of SDL might have esound support, but if
* there's no esound server available, SDL's esound driver would fail if used.
*
* By default, SDL tries all drivers, in its preferred order, until one is
* found to be usable.
*
* \returns the number of built-in audio drivers.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioDriver
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
/**
* Use this function to get the name of a built in audio driver.
*
* The list of audio drivers is given in the order that they are normally
* initialized by default; the drivers that seem more reasonable to choose
* first (as far as the SDL developers believe) are earlier in the list.
*
* The names of drivers are all simple, low-ASCII identifiers, like "alsa",
* "coreaudio" or "wasapi". These never have Unicode characters, and are not
* meant to be proper names.
*
* \param index the index of the audio driver; the value ranges from 0 to
* SDL_GetNumAudioDrivers() - 1.
* \returns the name of the audio driver at the requested index, or NULL if an
* invalid index was specified.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetNumAudioDrivers
*/
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDriver(int index);
/**
* Get the name of the current audio driver.
*
* The names of drivers are all simple, low-ASCII identifiers, like "alsa",
* "coreaudio" or "wasapi". These never have Unicode characters, and are not
* meant to be proper names.
*
* \returns the name of the current audio driver or NULL if no driver has been
* initialized.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentAudioDriver(void);
/**
* Get a list of currently-connected audio playback devices.
*
* This returns of list of available devices that play sound, perhaps to
* speakers or headphones ("playback" devices). If you want devices that
* record audio, like a microphone ("recording" devices), use
* SDL_GetAudioRecordingDevices() instead.
*
* This only returns a list of physical devices; it will not have any device
* IDs returned by SDL_OpenAudioDevice().
*
* If this function returns NULL, to signify an error, `*count` will be set to
* zero.
*
* \param count a pointer filled in with the number of devices returned, may
* be NULL.
* \returns a 0 terminated array of device instance IDs or NULL on error; call
* SDL_GetError() for more information. This should be freed with
* SDL_free() when it is no longer needed.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_OpenAudioDevice
* \sa SDL_GetAudioRecordingDevices
*/
extern SDL_DECLSPEC SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackDevices(int *count);
/**
* Get a list of currently-connected audio recording devices.
*
* This returns of list of available devices that record audio, like a
* microphone ("recording" devices). If you want devices that play sound,
* perhaps to speakers or headphones ("playback" devices), use
* SDL_GetAudioPlaybackDevices() instead.
*
* This only returns a list of physical devices; it will not have any device
* IDs returned by SDL_OpenAudioDevice().
*
* If this function returns NULL, to signify an error, `*count` will be set to
* zero.
*
* \param count a pointer filled in with the number of devices returned, may
* be NULL.
* \returns a 0 terminated array of device instance IDs, or NULL on failure;
* call SDL_GetError() for more information. This should be freed
* with SDL_free() when it is no longer needed.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_OpenAudioDevice
* \sa SDL_GetAudioPlaybackDevices
*/
extern SDL_DECLSPEC SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevices(int *count);
/**
* Get the human-readable name of a specific audio device.
*
* **WARNING**: this function will work with SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK
* and SDL_AUDIO_DEVICE_DEFAULT_RECORDING, returning the current default
* physical devices' names. However, as the default device may change at any
* time, it is likely better to show a generic name to the user, like "System
* default audio device" or perhaps "default [currently %s]". Do not store
* this name to disk to reidentify the device in a later run of the program,
* as the default might change in general, and the string will be the name of
* a specific device and not the abstract system default.
*
* \param devid the instance ID of the device to query.
* \returns the name of the audio device, or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioPlaybackDevices
* \sa SDL_GetAudioRecordingDevices
*/
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
/**
* Get the current audio format of a specific audio device.
*
* For an opened device, this will report the format the device is currently
* using. If the device isn't yet opened, this will report the device's
* preferred format (or a reasonable default if this can't be determined).
*
* You may also specify SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK or
* SDL_AUDIO_DEVICE_DEFAULT_RECORDING here, which is useful for getting a
* reasonable recommendation before opening the system-recommended default
* device.
*
* You can also use this to request the current device buffer size. This is
* specified in sample frames and represents the amount of data SDL will feed
* to the physical hardware in each chunk. This can be converted to
* milliseconds of audio with the following equation:
*
* `ms = (int) ((((Sint64) frames) * 1000) / spec.freq);`
*
* Buffer size is only important if you need low-level control over the audio
* playback timing. Most apps do not need this.
*
* \param devid the instance ID of the device to query.
* \param spec on return, will be filled with device details.
* \param sample_frames pointer to store device buffer size, in sample frames.
* Can be NULL.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
/**
* Get the current channel map of an audio device.
*
* Channel maps are optional; most things do not need them, instead passing
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
*
* Audio devices usually have no remapping applied. This is represented by
* returning NULL, and does not signify an error.
*
* \param devid the instance ID of the device to query.
* \param count On output, set to number of channels in the map. Can be NULL.
* \returns an array of the current channel mapping, with as many elements as
* the current output spec's channels, or NULL if default. This
* should be freed with SDL_free() when it is no longer needed.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count);
/**
* Open a specific audio device.
*
* You can open both playback and recording devices through this function.
* Playback devices will take data from bound audio streams, mix it, and send
* it to the hardware. Recording devices will feed any bound audio streams
* with a copy of any incoming data.
*
* An opened audio device starts out with no audio streams bound. To start
* audio playing, bind a stream and supply audio data to it. Unlike SDL2,
* there is no audio callback; you only bind audio streams and make sure they
* have data flowing into them (however, you can simulate SDL2's semantics
* fairly closely by using SDL_OpenAudioDeviceStream instead of this
* function).
*
* If you don't care about opening a specific device, pass a `devid` of either
* `SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK` or
* `SDL_AUDIO_DEVICE_DEFAULT_RECORDING`. In this case, SDL will try to pick
* the most reasonable default, and may also switch between physical devices
* seamlessly later, if the most reasonable default changes during the
* lifetime of this opened device (user changed the default in the OS's system
* preferences, the default got unplugged so the system jumped to a new
* default, the user plugged in headphones on a mobile device, etc). Unless
* you have a good reason to choose a specific device, this is probably what
* you want.
*
* You may request a specific format for the audio device, but there is no
* promise the device will honor that request for several reasons. As such,
* it's only meant to be a hint as to what data your app will provide. Audio
* streams will accept data in whatever format you specify and manage
* conversion for you as appropriate. SDL_GetAudioDeviceFormat can tell you
* the preferred format for the device before opening and the actual format
* the device is using after opening.
*
* It's legal to open the same device ID more than once; each successful open
* will generate a new logical SDL_AudioDeviceID that is managed separately
* from others on the same physical device. This allows libraries to open a
* device separately from the main app and bind its own streams without
* conflicting.
*
* It is also legal to open a device ID returned by a previous call to this
* function; doing so just creates another logical device on the same physical
* device. This may be useful for making logical groupings of audio streams.
*
* This function returns the opened device ID on success. This is a new,
* unique SDL_AudioDeviceID that represents a logical device.
*
* Some backends might offer arbitrary devices (for example, a networked audio
* protocol that can connect to an arbitrary server). For these, as a change
* from SDL2, you should open a default device ID and use an SDL hint to
* specify the target if you care, or otherwise let the backend figure out a
* reasonable default. Most backends don't offer anything like this, and often
* this would be an end user setting an environment variable for their custom
* need, and not something an application should specifically manage.
*
* When done with an audio device, possibly at the end of the app's life, one
* should call SDL_CloseAudioDevice() on the returned device id.
*
* \param devid the device instance id to open, or
* SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK or
* SDL_AUDIO_DEVICE_DEFAULT_RECORDING for the most reasonable
* default device.
* \param spec the requested device configuration. Can be NULL to use
* reasonable defaults.
* \returns the device ID on success or 0 on failure; call SDL_GetError() for
* more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CloseAudioDevice
* \sa SDL_GetAudioDeviceFormat
*/
extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec);
/**
* Determine if an audio device is physical (instead of logical).
*
* An SDL_AudioDeviceID that represents physical hardware is a physical
* device; there is one for each piece of hardware that SDL can see. Logical
* devices are created by calling SDL_OpenAudioDevice or
* SDL_OpenAudioDeviceStream, and while each is associated with a physical
* device, there can be any number of logical devices on one physical device.
*
* For the most part, logical and physical IDs are interchangeable--if you try
* to open a logical device, SDL understands to assign that effort to the
* underlying physical device, etc. However, it might be useful to know if an
* arbitrary device ID is physical or logical. This function reports which.
*
* This function may return either true or false for invalid device IDs.
*
* \param devid the device ID to query.
* \returns true if devid is a physical device, false if it is logical.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePhysical(SDL_AudioDeviceID devid);
/**
* Determine if an audio device is a playback device (instead of recording).
*
* This function may return either true or false for invalid device IDs.
*
* \param devid the device ID to query.
* \returns true if devid is a playback device, false if it is recording.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePlayback(SDL_AudioDeviceID devid);
/**
* Use this function to pause audio playback on a specified device.
*
* This function pauses audio processing for a given device. Any bound audio
* streams will not progress, and no audio will be generated. Pausing one
* device does not prevent other unpaused devices from running.
*
* Unlike in SDL2, audio devices start in an _unpaused_ state, since an app
* has to bind a stream before any audio will flow. Pausing a paused device is
* a legal no-op.
*
* Pausing a device can be useful to halt all audio without unbinding all the
* audio streams. This might be useful while a game is paused, or a level is
* loading, etc.
*
* Physical devices can not be paused or unpaused, only logical devices
* created through SDL_OpenAudioDevice() can be.
*
* \param devid a device opened by SDL_OpenAudioDevice().
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ResumeAudioDevice
* \sa SDL_AudioDevicePaused
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID devid);
/**
* Use this function to unpause audio playback on a specified device.
*
* This function unpauses audio processing for a given device that has
* previously been paused with SDL_PauseAudioDevice(). Once unpaused, any
* bound audio streams will begin to progress again, and audio can be
* generated.
*
* Unlike in SDL2, audio devices start in an _unpaused_ state, since an app
* has to bind a stream before any audio will flow. Unpausing an unpaused
* device is a legal no-op.
*
* Physical devices can not be paused or unpaused, only logical devices
* created through SDL_OpenAudioDevice() can be.
*
* \param devid a device opened by SDL_OpenAudioDevice().
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AudioDevicePaused
* \sa SDL_PauseAudioDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid);
/**
* Use this function to query if an audio device is paused.
*
* Unlike in SDL2, audio devices start in an _unpaused_ state, since an app
* has to bind a stream before any audio will flow.
*
* Physical devices can not be paused or unpaused, only logical devices
* created through SDL_OpenAudioDevice() can be. Physical and invalid device
* IDs will report themselves as unpaused here.
*
* \param devid a device opened by SDL_OpenAudioDevice().
* \returns true if device is valid and paused, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PauseAudioDevice
* \sa SDL_ResumeAudioDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID devid);
/**
* Get the gain of an audio device.
*
* The gain of a device is its volume; a larger gain means a louder output,
* with a gain of zero being silence.
*
* Audio devices default to a gain of 1.0f (no change in output).
*
* Physical devices may not have their gain changed, only logical devices, and
* this function will always return -1.0f when used on physical devices.
*
* \param devid the audio device to query.
* \returns the gain of the device or -1.0f on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioDeviceGain
*/
extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid);
/**
* Change the gain of an audio device.
*
* The gain of a device is its volume; a larger gain means a louder output,
* with a gain of zero being silence.
*
* Audio devices default to a gain of 1.0f (no change in output).
*
* Physical devices may not have their gain changed, only logical devices, and
* this function will always return false when used on physical devices. While
* it might seem attractive to adjust several logical devices at once in this
* way, it would allow an app or library to interfere with another portion of
* the program's otherwise-isolated devices.
*
* This is applied, along with any per-audiostream gain, during playback to
* the hardware, and can be continuously changed to create various effects. On
* recording devices, this will adjust the gain before passing the data into
* an audiostream; that recording audiostream can then adjust its gain further
* when outputting the data elsewhere, if it likes, but that second gain is
* not applied until the data leaves the audiostream again.
*
* \param devid the audio device on which to change gain.
* \param gain the gain. 1.0f is no change, 0.0f is silence.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioDeviceGain
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
/**
* Close a previously-opened audio device.
*
* The application should close open audio devices once they are no longer
* needed.
*
* This function may block briefly while pending audio data is played by the
* hardware, so that applications don't drop the last buffer of data they
* supplied if terminating immediately afterwards.
*
* \param devid an audio device id previously returned by
* SDL_OpenAudioDevice().
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_OpenAudioDevice
*/
extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
/**
* Bind a list of audio streams to an audio device.
*
* Audio data will flow through any bound streams. For a playback device, data
* for all bound streams will be mixed together and fed to the device. For a
* recording device, a copy of recorded data will be provided to each bound
* stream.
*
* Audio streams can only be bound to an open device. This operation is
* atomic--all streams bound in the same call will start processing at the
* same time, so they can stay in sync. Also: either all streams will be bound
* or none of them will be.
*
* It is an error to bind an already-bound stream; it must be explicitly
* unbound first.
*
* Binding a stream to a device will set its output format for playback
* devices, and its input format for recording devices, so they match the
* device's settings. The caller is welcome to change the other end of the
* stream's format at any time with SDL_SetAudioStreamFormat(). If the other
* end of the stream's format has never been set (the audio stream was created
* with a NULL audio spec), this function will set it to match the device
* end's format.
*
* \param devid an audio device to bind a stream to.
* \param streams an array of audio streams to bind.
* \param num_streams number streams listed in the `streams` array.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BindAudioStreams
* \sa SDL_UnbindAudioStream
* \sa SDL_GetAudioStreamDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream * const *streams, int num_streams);
/**
* Bind a single audio stream to an audio device.
*
* This is a convenience function, equivalent to calling
* `SDL_BindAudioStreams(devid, &stream, 1)`.
*
* \param devid an audio device to bind a stream to.
* \param stream an audio stream to bind to a device.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BindAudioStreams
* \sa SDL_UnbindAudioStream
* \sa SDL_GetAudioStreamDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
/**
* Unbind a list of audio streams from their audio devices.
*
* The streams being unbound do not all have to be on the same device. All
* streams on the same device will be unbound atomically (data will stop
* flowing through all unbound streams on the same device at the same time).
*
* Unbinding a stream that isn't bound to a device is a legal no-op.
*
* \param streams an array of audio streams to unbind. Can be NULL or contain
* NULL.
* \param num_streams number streams listed in the `streams` array.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BindAudioStreams
*/
extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream * const *streams, int num_streams);
/**
* Unbind a single audio stream from its audio device.
*
* This is a convenience function, equivalent to calling
* `SDL_UnbindAudioStreams(&stream, 1)`.
*
* \param stream an audio stream to unbind from a device. Can be NULL.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BindAudioStream
*/
extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
/**
* Query an audio stream for its currently-bound device.
*
* This reports the logical audio device that an audio stream is currently
* bound to.
*
* If not bound, or invalid, this returns zero, which is not a valid device
* ID.
*
* \param stream the audio stream to query.
* \returns the bound audio device, or 0 if not bound or invalid.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BindAudioStream
* \sa SDL_BindAudioStreams
*/
extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStream *stream);
/**
* Create a new audio stream.
*
* \param src_spec the format details of the input audio.
* \param dst_spec the format details of the output audio.
* \returns a new audio stream on success or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PutAudioStreamData
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamAvailable
* \sa SDL_FlushAudioStream
* \sa SDL_ClearAudioStream
* \sa SDL_SetAudioStreamFormat
* \sa SDL_DestroyAudioStream
*/
extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
/**
* Get the properties associated with an audio stream.
*
* The application can hang any data it wants here, but the following
* properties are understood by SDL:
*
* - `SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN`: if true (the default), the
* stream be automatically cleaned up when the audio subsystem quits. If set
* to false, the streams will persist beyond that. This property is ignored
* for streams created through SDL_OpenAudioDeviceStream(), and will always
* be cleaned up. Streams that are not cleaned up will still be unbound from
* devices when the audio subsystem quits. This property was added in SDL
* 3.4.0.
*
* \param stream the SDL_AudioStream to query.
* \returns a valid property ID on success or 0 on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
#define SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN "SDL.audiostream.auto_cleanup"
/**
* Query the current format of an audio stream.
*
* \param stream the SDL_AudioStream to query.
* \param src_spec where to store the input audio format; ignored if NULL.
* \param dst_spec where to store the output audio format; ignored if NULL.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamFormat
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec);
/**
* Change the input and output formats of an audio stream.
*
* Future calls to and SDL_GetAudioStreamAvailable and SDL_GetAudioStreamData
* will reflect the new format, and future calls to SDL_PutAudioStreamData
* must provide data in the new input formats.
*
* Data that was previously queued in the stream will still be operated on in
* the format that was current when it was added, which is to say you can put
* the end of a sound file in one format to a stream, change formats for the
* next sound file, and start putting that new data while the previous sound
* file is still queued, and everything will still play back correctly.
*
* If a stream is bound to a device, then the format of the side of the stream
* bound to a device cannot be changed (src_spec for recording devices,
* dst_spec for playback devices). Attempts to make a change to this side will
* be ignored, but this will not report an error. The other side's format can
* be changed.
*
* \param stream the stream the format is being changed.
* \param src_spec the new format of the audio input; if NULL, it is not
* changed.
* \param dst_spec the new format of the audio output; if NULL, it is not
* changed.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioStreamFormat
* \sa SDL_SetAudioStreamFrequencyRatio
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
/**
* Get the frequency ratio of an audio stream.
*
* \param stream the SDL_AudioStream to query.
* \returns the frequency ratio of the stream or 0.0 on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamFrequencyRatio
*/
extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream);
/**
* Change the frequency ratio of an audio stream.
*
* The frequency ratio is used to adjust the rate at which input data is
* consumed. Changing this effectively modifies the speed and pitch of the
* audio. A value greater than 1.0f will play the audio faster, and at a
* higher pitch. A value less than 1.0f will play the audio slower, and at a
* lower pitch. 1.0f means play at normal speed.
*
* This is applied during SDL_GetAudioStreamData, and can be continuously
* changed to create various effects.
*
* \param stream the stream on which the frequency ratio is being changed.
* \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01
* and 100.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioStreamFrequencyRatio
* \sa SDL_SetAudioStreamFormat
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
/**
* Get the gain of an audio stream.
*
* The gain of a stream is its volume; a larger gain means a louder output,
* with a gain of zero being silence.
*
* Audio streams default to a gain of 1.0f (no change in output).
*
* \param stream the SDL_AudioStream to query.
* \returns the gain of the stream or -1.0f on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamGain
*/
extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream);
/**
* Change the gain of an audio stream.
*
* The gain of a stream is its volume; a larger gain means a louder output,
* with a gain of zero being silence.
*
* Audio streams default to a gain of 1.0f (no change in output).
*
* This is applied during SDL_GetAudioStreamData, and can be continuously
* changed to create various effects.
*
* \param stream the stream on which the gain is being changed.
* \param gain the gain. 1.0f is no change, 0.0f is silence.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioStreamGain
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
/**
* Get the current input channel map of an audio stream.
*
* Channel maps are optional; most things do not need them, instead passing
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
*
* Audio streams default to no remapping applied. This is represented by
* returning NULL, and does not signify an error.
*
* \param stream the SDL_AudioStream to query.
* \param count On output, set to number of channels in the map. Can be NULL.
* \returns an array of the current channel mapping, with as many elements as
* the current output spec's channels, or NULL if default. This
* should be freed with SDL_free() when it is no longer needed.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count);
/**
* Get the current output channel map of an audio stream.
*
* Channel maps are optional; most things do not need them, instead passing
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
*
* Audio streams default to no remapping applied. This is represented by
* returning NULL, and does not signify an error.
*
* \param stream the SDL_AudioStream to query.
* \param count On output, set to number of channels in the map. Can be NULL.
* \returns an array of the current channel mapping, with as many elements as
* the current output spec's channels, or NULL if default. This
* should be freed with SDL_free() when it is no longer needed.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *count);
/**
* Set the current input channel map of an audio stream.
*
* Channel maps are optional; most things do not need them, instead passing
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
*
* The input channel map reorders data that is added to a stream via
* SDL_PutAudioStreamData. Future calls to SDL_PutAudioStreamData must provide
* data in the new channel order.
*
* Each item in the array represents an input channel, and its value is the
* channel that it should be remapped to. To reverse a stereo signal's left
* and right values, you'd have an array of `{ 1, 0 }`. It is legal to remap
* multiple channels to the same thing, so `{ 1, 1 }` would duplicate the
* right channel to both channels of a stereo signal. An element in the
* channel map set to -1 instead of a valid channel will mute that channel,
* setting it to a silence value.
*
* You cannot change the number of channels through a channel map, just
* reorder/mute them.
*
* Data that was previously queued in the stream will still be operated on in
* the order that was current when it was added, which is to say you can put
* the end of a sound file in one order to a stream, change orders for the
* next sound file, and start putting that new data while the previous sound
* file is still queued, and everything will still play back correctly.
*
* Audio streams default to no remapping applied. Passing a NULL channel map
* is legal, and turns off remapping.
*
* SDL will copy the channel map; the caller does not have to save this array
* after this call.
*
* If `count` is not equal to the current number of channels in the audio
* stream's format, this will fail. This is a safety measure to make sure a
* race condition hasn't changed the format while this call is setting the
* channel map.
*
* Unlike attempting to change the stream's format, the input channel map on a
* stream bound to a recording device is permitted to change at any time; any
* data added to the stream from the device after this call will have the new
* mapping, but previously-added data will still have the prior mapping.
*
* \param stream the SDL_AudioStream to change.
* \param chmap the new channel map, NULL to reset to default.
* \param count The number of channels in the map.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running. Don't change the
* stream's format to have a different number of channels from a
* different thread at the same time, though!
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamOutputChannelMap
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
/**
* Set the current output channel map of an audio stream.
*
* Channel maps are optional; most things do not need them, instead passing
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
*
* The output channel map reorders data that is leaving a stream via
* SDL_GetAudioStreamData.
*
* Each item in the array represents an input channel, and its value is the
* channel that it should be remapped to. To reverse a stereo signal's left
* and right values, you'd have an array of `{ 1, 0 }`. It is legal to remap
* multiple channels to the same thing, so `{ 1, 1 }` would duplicate the
* right channel to both channels of a stereo signal. An element in the
* channel map set to -1 instead of a valid channel will mute that channel,
* setting it to a silence value.
*
* You cannot change the number of channels through a channel map, just
* reorder/mute them.
*
* The output channel map can be changed at any time, as output remapping is
* applied during SDL_GetAudioStreamData.
*
* Audio streams default to no remapping applied. Passing a NULL channel map
* is legal, and turns off remapping.
*
* SDL will copy the channel map; the caller does not have to save this array
* after this call.
*
* If `count` is not equal to the current number of channels in the audio
* stream's format, this will fail. This is a safety measure to make sure a
* race condition hasn't changed the format while this call is setting the
* channel map.
*
* Unlike attempting to change the stream's format, the output channel map on
* a stream bound to a recording device is permitted to change at any time;
* any data added to the stream after this call will have the new mapping, but
* previously-added data will still have the prior mapping. When the channel
* map doesn't match the hardware's channel layout, SDL will convert the data
* before feeding it to the device for playback.
*
* \param stream the SDL_AudioStream to change.
* \param chmap the new channel map, NULL to reset to default.
* \param count The number of channels in the map.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running. Don't change the
* stream's format to have a different number of channels from a
* a different thread at the same time, though!
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
/**
* Add data to the stream.
*
* This data must match the format/channels/samplerate specified in the latest
* call to SDL_SetAudioStreamFormat, or the format specified when creating the
* stream if it hasn't been changed.
*
* Note that this call simply copies the unconverted data for later. This is
* different than SDL2, where data was converted during the Put call and the
* Get call would just dequeue the previously-converted data.
*
* \param stream the stream the audio data is being added to.
* \param buf a pointer to the audio data to add.
* \param len the number of bytes to write to the stream.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, but if the
* stream has a callback set, the caller might need to manage
* extra locking.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ClearAudioStream
* \sa SDL_FlushAudioStream
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamQueued
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
/**
* A callback that fires for completed SDL_PutAudioStreamDataNoCopy() data.
*
* When using SDL_PutAudioStreamDataNoCopy() to provide data to an
* SDL_AudioStream, it's not safe to dispose of the data until the stream has
* completely consumed it. Often times it's difficult to know exactly when
* this has happened.
*
* This callback fires once when the stream no longer needs the buffer,
* allowing the app to easily free or reuse it.
*
* \param userdata an opaque pointer provided by the app for their personal
* use.
* \param buf the pointer provided to SDL_PutAudioStreamDataNoCopy().
* \param buflen the size of buffer, in bytes, provided to
* SDL_PutAudioStreamDataNoCopy().
*
* \threadsafety This callbacks may run from any thread, so if you need to
* protect shared data, you should use SDL_LockAudioStream to
* serialize access; this lock will be held before your callback
* is called, so your callback does not need to manage the lock
* explicitly.
*
* \since This datatype is available since SDL 3.4.0.
*
* \sa SDL_SetAudioStreamGetCallback
* \sa SDL_SetAudioStreamPutCallback
*/
typedef void (SDLCALL *SDL_AudioStreamDataCompleteCallback)(void *userdata, const void *buf, int buflen);
/**
* Add external data to an audio stream without copying it.
*
* Unlike SDL_PutAudioStreamData(), this function does not make a copy of the
* provided data, instead storing the provided pointer. This means that the
* put operation does not need to allocate and copy the data, but the original
* data must remain available until the stream is done with it, either by
* being read from the stream in its entirety, or a call to
* SDL_ClearAudioStream() or SDL_DestroyAudioStream().
*
* The data must match the format/channels/samplerate specified in the latest
* call to SDL_SetAudioStreamFormat, or the format specified when creating the
* stream if it hasn't been changed.
*
* An optional callback may be provided, which is called when the stream no
* longer needs the data. Once this callback fires, the stream will not access
* the data again. This callback will fire for any reason the data is no
* longer needed, including clearing or destroying the stream.
*
* Note that there is still an allocation to store tracking information, so
* this function is more efficient for larger blocks of data. If you're
* planning to put a few samples at a time, it will be more efficient to use
* SDL_PutAudioStreamData(), which allocates and buffers in blocks.
*
* \param stream the stream the audio data is being added to.
* \param buf a pointer to the audio data to add.
* \param len the number of bytes to add to the stream.
* \param callback the callback function to call when the data is no longer
* needed by the stream. May be NULL.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, but if the
* stream has a callback set, the caller might need to manage
* extra locking.
*
* \since This function is available since SDL 3.4.0.
*
* \sa SDL_ClearAudioStream
* \sa SDL_FlushAudioStream
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamQueued
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamDataNoCopy(SDL_AudioStream *stream, const void *buf, int len, SDL_AudioStreamDataCompleteCallback callback, void *userdata);
/**
* Add data to the stream with each channel in a separate array.
*
* This data must match the format/channels/samplerate specified in the latest
* call to SDL_SetAudioStreamFormat, or the format specified when creating the
* stream if it hasn't been changed.
*
* The data will be interleaved and queued. Note that SDL_AudioStream only
* operates on interleaved data, so this is simply a convenience function for
* easily queueing data from sources that provide separate arrays. There is no
* equivalent function to retrieve planar data.
*
* The arrays in `channel_buffers` are ordered as they are to be interleaved;
* the first array will be the first sample in the interleaved data. Any
* individual array may be NULL; in this case, silence will be interleaved for
* that channel.
*
* `num_channels` specifies how many arrays are in `channel_buffers`. This can
* be used as a safety to prevent overflow, in case the stream format has
* changed elsewhere. If more channels are specified than the current input
* spec, they are ignored. If less channels are specified, the missing arrays
* are treated as if they are NULL (silence is written to those channels). If
* the count is -1, SDL will assume the array count matches the current input
* spec.
*
* Note that `num_samples` is the number of _samples per array_. This can also
* be thought of as the number of _sample frames_ to be queued. A value of 1
* with stereo arrays will queue two samples to the stream. This is different
* than SDL_PutAudioStreamData, which wants the size of a single array in
* bytes.
*
* \param stream the stream the audio data is being added to.
* \param channel_buffers a pointer to an array of arrays, one array per
* channel.
* \param num_channels the number of arrays in `channel_buffers` or -1.
* \param num_samples the number of _samples_ per array to write to the
* stream.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread, but if the
* stream has a callback set, the caller might need to manage
* extra locking.
*
* \since This function is available since SDL 3.4.0.
*
* \sa SDL_ClearAudioStream
* \sa SDL_FlushAudioStream
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamQueued
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamPlanarData(SDL_AudioStream *stream, const void * const *channel_buffers, int num_channels, int num_samples);
/**
* Get converted/resampled data from the stream.
*
* The input/output data format/channels/samplerate is specified when creating
* the stream, and can be changed after creation by calling
* SDL_SetAudioStreamFormat.
*
* Note that any conversion and resampling necessary is done during this call,
* and SDL_PutAudioStreamData simply queues unconverted data for later. This
* is different than SDL2, where that work was done while inputting new data
* to the stream and requesting the output just copied the converted data.
*
* \param stream the stream the audio is being requested from.
* \param buf a buffer to fill with audio data.
* \param len the maximum number of bytes to fill.
* \returns the number of bytes read from the stream or -1 on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, but if the
* stream has a callback set, the caller might need to manage
* extra locking.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ClearAudioStream
* \sa SDL_GetAudioStreamAvailable
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len);
/**
* Get the number of converted/resampled bytes available.
*
* The stream may be buffering data behind the scenes until it has enough to
* resample correctly, so this number might be lower than what you expect, or
* even be zero. Add more data or flush the stream if you need the data now.
*
* If the stream has so much data that it would overflow an int, the return
* value is clamped to a maximum value, but no queued data is lost; if there
* are gigabytes of data queued, the app might need to read some of it with
* SDL_GetAudioStreamData before this function's return value is no longer
* clamped.
*
* \param stream the audio stream to query.
* \returns the number of converted/resampled bytes available or -1 on
* failure; call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioStreamData
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream);
/**
* Get the number of bytes currently queued.
*
* This is the number of bytes put into a stream as input, not the number that
* can be retrieved as output. Because of several details, it's not possible
* to calculate one number directly from the other. If you need to know how
* much usable data can be retrieved right now, you should use
* SDL_GetAudioStreamAvailable() and not this function.
*
* Note that audio streams can change their input format at any time, even if
* there is still data queued in a different format, so the returned byte
* count will not necessarily match the number of _sample frames_ available.
* Users of this API should be aware of format changes they make when feeding
* a stream and plan accordingly.
*
* Queued data is not converted until it is consumed by
* SDL_GetAudioStreamData, so this value should be representative of the exact
* data that was put into the stream.
*
* If the stream has so much data that it would overflow an int, the return
* value is clamped to a maximum value, but no queued data is lost; if there
* are gigabytes of data queued, the app might need to read some of it with
* SDL_GetAudioStreamData before this function's return value is no longer
* clamped.
*
* \param stream the audio stream to query.
* \returns the number of bytes queued or -1 on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PutAudioStreamData
* \sa SDL_ClearAudioStream
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
/**
* Tell the stream that you're done sending data, and anything being buffered
* should be converted/resampled and made available immediately.
*
* It is legal to add more data to a stream after flushing, but there may be
* audio gaps in the output. Generally this is intended to signal the end of
* input, so the complete output becomes available.
*
* \param stream the audio stream to flush.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
/**
* Clear any pending data in the stream.
*
* This drops any queued data, so there will be nothing to read from the
* stream until more is added.
*
* \param stream the audio stream to clear.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAudioStreamAvailable
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamQueued
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
/**
* Use this function to pause audio playback on the audio device associated
* with an audio stream.
*
* This function pauses audio processing for a given device. Any bound audio
* streams will not progress, and no audio will be generated. Pausing one
* device does not prevent other unpaused devices from running.
*
* Pausing a device can be useful to halt all audio without unbinding all the
* audio streams. This might be useful while a game is paused, or a level is
* loading, etc.
*
* \param stream the audio stream associated with the audio device to pause.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ResumeAudioStreamDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
/**
* Use this function to unpause audio playback on the audio device associated
* with an audio stream.
*
* This function unpauses audio processing for a given device that has
* previously been paused. Once unpaused, any bound audio streams will begin
* to progress again, and audio can be generated.
*
* SDL_OpenAudioDeviceStream opens audio devices in a paused state, so this
* function call is required for audio playback to begin on such devices.
*
* \param stream the audio stream associated with the audio device to resume.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PauseAudioStreamDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
/**
* Use this function to query if an audio device associated with a stream is
* paused.
*
* Unlike in SDL2, audio devices start in an _unpaused_ state, since an app
* has to bind a stream before any audio will flow.
*
* \param stream the audio stream associated with the audio device to query.
* \returns true if device is valid and paused, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PauseAudioStreamDevice
* \sa SDL_ResumeAudioStreamDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_AudioStreamDevicePaused(SDL_AudioStream *stream);
/**
* Lock an audio stream for serialized access.
*
* Each SDL_AudioStream has an internal mutex it uses to protect its data
* structures from threading conflicts. This function allows an app to lock
* that mutex, which could be useful if registering callbacks on this stream.
*
* One does not need to lock a stream to use in it most cases, as the stream
* manages this lock internally. However, this lock is held during callbacks,
* which may run from arbitrary threads at any time, so if an app needs to
* protect shared data during those callbacks, locking the stream guarantees
* that the callback is not running while the lock is held.
*
* As this is just a wrapper over SDL_LockMutex for an internal lock; it has
* all the same attributes (recursive locks are allowed, etc).
*
* \param stream the audio stream to lock.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_UnlockAudioStream
*/
extern SDL_DECLSPEC bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
/**
* Unlock an audio stream for serialized access.
*
* This unlocks an audio stream after a call to SDL_LockAudioStream.
*
* \param stream the audio stream to unlock.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety You should only call this from the same thread that
* previously called SDL_LockAudioStream.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockAudioStream
*/
extern SDL_DECLSPEC bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
/**
* A callback that fires when data passes through an SDL_AudioStream.
*
* Apps can (optionally) register a callback with an audio stream that is
* called when data is added with SDL_PutAudioStreamData, or requested with
* SDL_GetAudioStreamData.
*
* Two values are offered here: one is the amount of additional data needed to
* satisfy the immediate request (which might be zero if the stream already
* has enough data queued) and the other is the total amount being requested.
* In a Get call triggering a Put callback, these values can be different. In
* a Put call triggering a Get callback, these values are always the same.
*
* Byte counts might be slightly overestimated due to buffering or resampling,
* and may change from call to call.
*
* This callback is not required to do anything. Generally this is useful for
* adding/reading data on demand, and the app will often put/get data as
* appropriate, but the system goes on with the data currently available to it
* if this callback does nothing.
*
* \param stream the SDL audio stream associated with this callback.
* \param additional_amount the amount of data, in bytes, that is needed right
* now.
* \param total_amount the total amount of data requested, in bytes, that is
* requested or available.
* \param userdata an opaque pointer provided by the app for their personal
* use.
*
* \threadsafety This callbacks may run from any thread, so if you need to
* protect shared data, you should use SDL_LockAudioStream to
* serialize access; this lock will be held before your callback
* is called, so your callback does not need to manage the lock
* explicitly.
*
* \since This datatype is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamGetCallback
* \sa SDL_SetAudioStreamPutCallback
*/
typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream *stream, int additional_amount, int total_amount);
/**
* Set a callback that runs when data is requested from an audio stream.
*
* This callback is called _before_ data is obtained from the stream, giving
* the callback the chance to add more on-demand.
*
* The callback can (optionally) call SDL_PutAudioStreamData() to add more
* audio to the stream during this call; if needed, the request that triggered
* this callback will obtain the new data immediately.
*
* The callback's `additional_amount` argument is roughly how many bytes of
* _unconverted_ data (in the stream's input format) is needed by the caller,
* although this may overestimate a little for safety. This takes into account
* how much is already in the stream and only asks for any extra necessary to
* resolve the request, which means the callback may be asked for zero bytes,
* and a different amount on each call.
*
* The callback is not required to supply exact amounts; it is allowed to
* supply too much or too little or none at all. The caller will get what's
* available, up to the amount they requested, regardless of this callback's
* outcome.
*
* Clearing or flushing an audio stream does not call this callback.
*
* This function obtains the stream's lock, which means any existing callback
* (get or put) in progress will finish running before setting the new
* callback.
*
* Setting a NULL function turns off the callback.
*
* \param stream the audio stream to set the new callback on.
* \param callback the new callback function to call when data is requested
* from the stream.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns true on success or false on failure; call SDL_GetError() for more
* information. This only fails if `stream` is NULL.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamPutCallback
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
/**
* Set a callback that runs when data is added to an audio stream.
*
* This callback is called _after_ the data is added to the stream, giving the
* callback the chance to obtain it immediately.
*
* The callback can (optionally) call SDL_GetAudioStreamData() to obtain audio
* from the stream during this call.
*
* The callback's `additional_amount` argument is how many bytes of
* _converted_ data (in the stream's output format) was provided by the
* caller, although this may underestimate a little for safety. This value
* might be less than what is currently available in the stream, if data was
* already there, and might be less than the caller provided if the stream
* needs to keep a buffer to aid in resampling. Which means the callback may
* be provided with zero bytes, and a different amount on each call.
*
* The callback may call SDL_GetAudioStreamAvailable to see the total amount
* currently available to read from the stream, instead of the total provided
* by the current call.
*
* The callback is not required to obtain all data. It is allowed to read less
* or none at all. Anything not read now simply remains in the stream for
* later access.
*
* Clearing or flushing an audio stream does not call this callback.
*
* This function obtains the stream's lock, which means any existing callback
* (get or put) in progress will finish running before setting the new
* callback.
*
* Setting a NULL function turns off the callback.
*
* \param stream the audio stream to set the new callback on.
* \param callback the new callback function to call when data is added to the
* stream.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns true on success or false on failure; call SDL_GetError() for more
* information. This only fails if `stream` is NULL.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamGetCallback
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
/**
* Free an audio stream.
*
* This will release all allocated data, including any audio that is still
* queued. You do not need to manually clear the stream first.
*
* If this stream was bound to an audio device, it is unbound during this
* call. If this stream was created with SDL_OpenAudioDeviceStream, the audio
* device that was opened alongside this stream's creation will be closed,
* too.
*
* \param stream the audio stream to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateAudioStream
*/
extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
/**
* Convenience function for straightforward audio init for the common case.
*
* If all your app intends to do is provide a single source of PCM audio, this
* function allows you to do all your audio setup in a single call.
*
* This is also intended to be a clean means to migrate apps from SDL2.
*
* This function will open an audio device, create a stream and bind it.
*
gitextract__n2furko/ ├── .clangformat ├── .github/ │ └── workflows/ │ └── build.yml ├── .gitignore ├── ANALYSIS.md ├── LICENSE ├── README.md ├── assets/ │ └── GMGeneric.SF2 ├── cinematics.txt ├── deps/ │ ├── include/ │ │ ├── SDL3/ │ │ │ ├── SDL.h │ │ │ ├── SDL_assert.h │ │ │ ├── SDL_asyncio.h │ │ │ ├── SDL_atomic.h │ │ │ ├── SDL_audio.h │ │ │ ├── SDL_begin_code.h │ │ │ ├── SDL_bits.h │ │ │ ├── SDL_blendmode.h │ │ │ ├── SDL_camera.h │ │ │ ├── SDL_clipboard.h │ │ │ ├── SDL_close_code.h │ │ │ ├── SDL_copying.h │ │ │ ├── SDL_cpuinfo.h │ │ │ ├── SDL_dialog.h │ │ │ ├── SDL_dlopennote.h │ │ │ ├── SDL_egl.h │ │ │ ├── SDL_endian.h │ │ │ ├── SDL_error.h │ │ │ ├── SDL_events.h │ │ │ ├── SDL_filesystem.h │ │ │ ├── SDL_gamepad.h │ │ │ ├── SDL_gpu.h │ │ │ ├── SDL_guid.h │ │ │ ├── SDL_haptic.h │ │ │ ├── SDL_hidapi.h │ │ │ ├── SDL_hints.h │ │ │ ├── SDL_init.h │ │ │ ├── SDL_intrin.h │ │ │ ├── SDL_iostream.h │ │ │ ├── SDL_joystick.h │ │ │ ├── SDL_keyboard.h │ │ │ ├── SDL_keycode.h │ │ │ ├── SDL_loadso.h │ │ │ ├── SDL_locale.h │ │ │ ├── SDL_log.h │ │ │ ├── SDL_main.h │ │ │ ├── SDL_main_impl.h │ │ │ ├── SDL_messagebox.h │ │ │ ├── SDL_metal.h │ │ │ ├── SDL_misc.h │ │ │ ├── SDL_mouse.h │ │ │ ├── SDL_mutex.h │ │ │ ├── SDL_oldnames.h │ │ │ ├── SDL_opengl.h │ │ │ ├── SDL_opengl_glext.h │ │ │ ├── SDL_opengles.h │ │ │ ├── SDL_opengles2.h │ │ │ ├── SDL_opengles2_gl2.h │ │ │ ├── SDL_opengles2_gl2ext.h │ │ │ ├── SDL_opengles2_gl2platform.h │ │ │ ├── SDL_opengles2_khrplatform.h │ │ │ ├── SDL_pen.h │ │ │ ├── SDL_pixels.h │ │ │ ├── SDL_platform.h │ │ │ ├── SDL_platform_defines.h │ │ │ ├── SDL_power.h │ │ │ ├── SDL_process.h │ │ │ ├── SDL_properties.h │ │ │ ├── SDL_rect.h │ │ │ ├── SDL_render.h │ │ │ ├── SDL_revision.h │ │ │ ├── SDL_scancode.h │ │ │ ├── SDL_sensor.h │ │ │ ├── SDL_stdinc.h │ │ │ ├── SDL_storage.h │ │ │ ├── SDL_surface.h │ │ │ ├── SDL_system.h │ │ │ ├── SDL_test.h │ │ │ ├── SDL_test_assert.h │ │ │ ├── SDL_test_common.h │ │ │ ├── SDL_test_compare.h │ │ │ ├── SDL_test_crc32.h │ │ │ ├── SDL_test_font.h │ │ │ ├── SDL_test_fuzzer.h │ │ │ ├── SDL_test_harness.h │ │ │ ├── SDL_test_log.h │ │ │ ├── SDL_test_md5.h │ │ │ ├── SDL_test_memory.h │ │ │ ├── SDL_thread.h │ │ │ ├── SDL_time.h │ │ │ ├── SDL_timer.h │ │ │ ├── SDL_touch.h │ │ │ ├── SDL_tray.h │ │ │ ├── SDL_version.h │ │ │ ├── SDL_video.h │ │ │ └── SDL_vulkan.h │ │ ├── TinySoundFont/ │ │ │ ├── tml.h │ │ │ └── tsf.h │ │ ├── TracyC.h │ │ ├── shl/ │ │ │ ├── array.h │ │ │ ├── binary_heap.h │ │ │ ├── flic.h │ │ │ ├── list.h │ │ │ ├── map.h │ │ │ ├── memory_buffer.h │ │ │ ├── memzone.h │ │ │ ├── memzone_audit.h │ │ │ ├── queue.h │ │ │ ├── set.h │ │ │ ├── shl_internal.h │ │ │ ├── stack.h │ │ │ ├── wav.h │ │ │ └── wstr.h │ │ └── stb/ │ │ ├── stb_image.h │ │ ├── stb_image_resize.h │ │ └── stb_image_write.h │ └── lib/ │ ├── arm64/ │ │ ├── libSDL3.so.0 │ │ └── libSDL3.so.0.5.0 │ ├── linux64/ │ │ ├── libSDL3.so.0 │ │ └── libSDL3.so.0.5.0 │ ├── win32/ │ │ ├── SDL3.lib │ │ ├── Tracy.lib │ │ └── libSDL3.dll.a │ └── win64/ │ ├── SDL3.lib │ ├── Tracy.lib │ └── libSDL3.dll.a ├── docs/ │ ├── ACTION_SYSTEM.md │ ├── ANIMATION_SYSTEM.md │ ├── COMMANDS_SYSTEM.md │ ├── ENTITIES_SYSTEM.md │ ├── INPUT_SYSTEM.md │ ├── SCENES_SYSTEM.md │ ├── STATE_MACHINE_SYSTEM.md │ └── UI_SYSTEM.md ├── nob.c ├── nob.h ├── src/ │ ├── common.h │ ├── war.h │ ├── war1.c │ ├── war_actions.c │ ├── war_actions.h │ ├── war_ai.c │ ├── war_ai.h │ ├── war_alloc.c │ ├── war_alloc.h │ ├── war_animations.c │ ├── war_animations.h │ ├── war_audio.c │ ├── war_audio.h │ ├── war_campaigns.c │ ├── war_campaigns.h │ ├── war_cheats.c │ ├── war_cheats.h │ ├── war_cheats_panel.c │ ├── war_color.h │ ├── war_commands.c │ ├── war_commands.h │ ├── war_database.h │ ├── war_entities.c │ ├── war_entities.h │ ├── war_enums.h │ ├── war_file.c │ ├── war_file.h │ ├── war_font.c │ ├── war_font.h │ ├── war_fwd.h │ ├── war_game.c │ ├── war_game.h │ ├── war_imui.c │ ├── war_imui.h │ ├── war_log.c │ ├── war_log.h │ ├── war_map.c │ ├── war_map.h │ ├── war_map_menu.c │ ├── war_map_menu.h │ ├── war_map_ui.c │ ├── war_map_ui.h │ ├── war_math.c │ ├── war_math.h │ ├── war_net.c │ ├── war_net.h │ ├── war_pathfinder.c │ ├── war_pathfinder.h │ ├── war_projectiles.c │ ├── war_projectiles.h │ ├── war_render.c │ ├── war_render.h │ ├── war_resources.c │ ├── war_resources.h │ ├── war_roads.c │ ├── war_ruins.c │ ├── war_scene_blizzard.c │ ├── war_scene_blizzard.h │ ├── war_scene_briefing.c │ ├── war_scene_briefing.h │ ├── war_scene_download.c │ ├── war_scene_download.h │ ├── war_scene_menu.c │ ├── war_scene_menu.h │ ├── war_scenes.c │ ├── war_scenes.h │ ├── war_sprites.c │ ├── war_sprites.h │ ├── war_state_machine.c │ ├── war_state_machine.h │ ├── war_state_machine_attack.c │ ├── war_state_machine_build.c │ ├── war_state_machine_cast.c │ ├── war_state_machine_chopping.c │ ├── war_state_machine_collapse.c │ ├── war_state_machine_death.c │ ├── war_state_machine_deliver.c │ ├── war_state_machine_follow.c │ ├── war_state_machine_gather_gold.c │ ├── war_state_machine_gather_wood.c │ ├── war_state_machine_idle.c │ ├── war_state_machine_mining.c │ ├── war_state_machine_move.c │ ├── war_state_machine_patrol.c │ ├── war_state_machine_repair.c │ ├── war_state_machine_repairing.c │ ├── war_state_machine_train.c │ ├── war_state_machine_upgrade.c │ ├── war_state_machine_wait.c │ ├── war_trees.c │ ├── war_ui.c │ ├── war_ui.h │ ├── war_units.c │ ├── war_units.h │ └── war_walls.c └── todo.md
Showing preview only (265K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2852 symbols across 160 files)
FILE: deps/include/SDL3/SDL_assert.h
type SDL_AssertState (line 306) | typedef enum SDL_AssertState
type SDL_AssertData (line 324) | typedef struct SDL_AssertData
function else (line 404) | else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
FILE: deps/include/SDL3/SDL_asyncio.h
type SDL_AsyncIO (line 124) | typedef struct SDL_AsyncIO SDL_AsyncIO;
type SDL_AsyncIOTaskType (line 131) | typedef enum SDL_AsyncIOTaskType
type SDL_AsyncIOResult (line 143) | typedef enum SDL_AsyncIOResult
type SDL_AsyncIOOutcome (line 155) | typedef struct SDL_AsyncIOOutcome
type SDL_AsyncIOQueue (line 183) | typedef struct SDL_AsyncIOQueue SDL_AsyncIOQueue;
FILE: deps/include/SDL3/SDL_atomic.h
type SDL_SpinLock (line 82) | typedef int SDL_SpinLock;
type SDL_AtomicInt (line 395) | typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
type SDL_AtomicU32 (line 540) | typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
FILE: deps/include/SDL3/SDL_audio.h
type SDL_AudioFormat (line 221) | typedef enum SDL_AudioFormat
type Uint32 (line 374) | typedef Uint32 SDL_AudioDeviceID;
type SDL_AudioSpec (line 405) | typedef struct SDL_AudioSpec
type SDL_AudioStream (line 451) | typedef struct SDL_AudioStream SDL_AudioStream;
FILE: deps/include/SDL3/SDL_bits.h
function SDL_FORCE_INLINE (line 65) | SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
function SDL_FORCE_INLINE (line 132) | SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x)
FILE: deps/include/SDL3/SDL_blendmode.h
type Uint32 (line 52) | typedef Uint32 SDL_BlendMode;
type SDL_BlendOperation (line 69) | typedef enum SDL_BlendOperation
type SDL_BlendFactor (line 88) | typedef enum SDL_BlendFactor
FILE: deps/include/SDL3/SDL_camera.h
type Uint32 (line 95) | typedef Uint32 SDL_CameraID;
type SDL_Camera (line 102) | typedef struct SDL_Camera SDL_Camera;
type SDL_CameraSpec (line 115) | typedef struct SDL_CameraSpec
type SDL_CameraPosition (line 132) | typedef enum SDL_CameraPosition
type SDL_CameraPermissionState (line 146) | typedef enum SDL_CameraPermissionState
FILE: deps/include/SDL3/SDL_dialog.h
type SDL_DialogFileFilter (line 70) | typedef struct SDL_DialogFileFilter
type SDL_FileDialogType (line 272) | typedef enum SDL_FileDialogType
FILE: deps/include/SDL3/SDL_egl.h
type khronos_int32_t (line 192) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 193) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 194) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 195) | typedef uint64_t khronos_uint64_t;
type khronos_int32_t (line 219) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 220) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 221) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 222) | typedef uint64_t khronos_uint64_t;
type __int32 (line 231) | typedef __int32 khronos_int32_t;
type khronos_uint32_t (line 232) | typedef unsigned __int32 khronos_uint32_t;
type __int64 (line 233) | typedef __int64 khronos_int64_t;
type khronos_uint64_t (line 234) | typedef unsigned __int64 khronos_uint64_t;
type khronos_int32_t (line 243) | typedef int khronos_int32_t;
type khronos_uint32_t (line 244) | typedef unsigned int khronos_uint32_t;
type khronos_int64_t (line 246) | typedef long int khronos_int64_t;
type khronos_uint64_t (line 247) | typedef unsigned long int khronos_uint64_t;
type khronos_int64_t (line 249) | typedef long long int khronos_int64_t;
type khronos_uint64_t (line 250) | typedef unsigned long long int khronos_uint64_t;
type khronos_int32_t (line 260) | typedef int khronos_int32_t;
type khronos_uint32_t (line 261) | typedef unsigned int khronos_uint32_t;
type khronos_int32_t (line 271) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 272) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 273) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 274) | typedef uint64_t khronos_uint64_t;
type khronos_int8_t (line 284) | typedef signed char khronos_int8_t;
type khronos_uint8_t (line 285) | typedef unsigned char khronos_uint8_t;
type khronos_int16_t (line 286) | typedef signed short int khronos_int16_t;
type khronos_uint16_t (line 287) | typedef unsigned short int khronos_uint16_t;
type khronos_intptr_t (line 295) | typedef intptr_t khronos_intptr_t;
type khronos_uintptr_t (line 296) | typedef uintptr_t khronos_uintptr_t;
type khronos_intptr_t (line 298) | typedef signed long long int khronos_intptr_t;
type khronos_uintptr_t (line 299) | typedef unsigned long long int khronos_uintptr_t;
type khronos_intptr_t (line 301) | typedef signed long int khronos_intptr_t;
type khronos_uintptr_t (line 302) | typedef unsigned long int khronos_uintptr_t;
type khronos_ssize_t (line 306) | typedef signed long long int khronos_ssize_t;
type khronos_usize_t (line 307) | typedef unsigned long long int khronos_usize_t;
type khronos_ssize_t (line 309) | typedef signed long int khronos_ssize_t;
type khronos_usize_t (line 310) | typedef unsigned long int khronos_usize_t;
type khronos_float_t (line 317) | typedef float khronos_float_t;
type khronos_uint64_t (line 330) | typedef khronos_uint64_t khronos_utime_nanoseconds_t;
type khronos_int64_t (line 331) | typedef khronos_int64_t khronos_stime_nanoseconds_t;
type khronos_boolean_enum_t (line 347) | typedef enum {
type HDC (line 418) | typedef HDC EGLNativeDisplayType;
type HBITMAP (line 419) | typedef HBITMAP EGLNativePixmapType;
type HWND (line 420) | typedef HWND EGLNativeWindowType;
type EGLNativeDisplayType (line 424) | typedef int EGLNativeDisplayType;
type EGLNativePixmapType (line 425) | typedef int EGLNativePixmapType;
type EGLNativeWindowType (line 426) | typedef int EGLNativeWindowType;
type EGLNativeDisplayType (line 430) | typedef int EGLNativeDisplayType;
type wl_display (line 436) | struct wl_display
type wl_egl_pixmap (line 437) | struct wl_egl_pixmap
type wl_egl_window (line 438) | struct wl_egl_window
type gbm_device (line 442) | struct gbm_device
type gbm_bo (line 443) | struct gbm_bo
type ANativeWindow (line 448) | struct ANativeWindow
type egl_native_pixmap_t (line 449) | struct egl_native_pixmap_t
type egl_native_pixmap_t (line 452) | struct egl_native_pixmap_t
type ANativeWindow (line 453) | struct ANativeWindow
type EGLNativeDisplayType (line 457) | typedef intptr_t EGLNativeDisplayType;
type EGLNativePixmapType (line 458) | typedef intptr_t EGLNativePixmapType;
type EGLNativeWindowType (line 459) | typedef intptr_t EGLNativeWindowType;
type Display (line 467) | typedef Display *EGLNativeDisplayType;
type Pixmap (line 468) | typedef Pixmap EGLNativePixmapType;
type Window (line 469) | typedef Window EGLNativeWindowType;
type khronos_uintptr_t (line 474) | typedef khronos_uintptr_t EGLNativePixmapType;
type khronos_uintptr_t (line 475) | typedef khronos_uintptr_t EGLNativeWindowType;
type EGLNativeDisplayType (line 479) | typedef int EGLNativeDisplayType;
type khronos_uintptr_t (line 488) | typedef khronos_uintptr_t EGLNativePixmapType;
type khronos_uintptr_t (line 489) | typedef khronos_uintptr_t EGLNativeWindowType;
type khronos_uintptr_t (line 494) | typedef khronos_uintptr_t EGLNativePixmapType;
type khronos_uintptr_t (line 495) | typedef khronos_uintptr_t EGLNativeWindowType;
type EGLNativeDisplayType (line 502) | typedef EGLNativeDisplayType NativeDisplayType;
type EGLNativePixmapType (line 503) | typedef EGLNativePixmapType NativePixmapType;
type EGLNativeWindowType (line 504) | typedef EGLNativeWindowType NativeWindowType;
type khronos_int32_t (line 514) | typedef khronos_int32_t EGLint;
type EGLBoolean (line 565) | typedef unsigned int EGLBoolean;
type EGLint (line 632) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy...
type const (line 634) | typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dp...
type EGLenum (line 714) | typedef unsigned int EGLenum;
type EGLAttrib (line 794) | typedef intptr_t EGLAttrib;
type khronos_utime_nanoseconds_t (line 795) | typedef khronos_utime_nanoseconds_t EGLTime;
type const (line 846) | typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum ...
type const (line 847) | typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) ...
type const (line 848) | typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) ...
type EGLAttribKHR (line 913) | typedef intptr_t EGLAttribKHR;
type EGLAttribKHR (line 914) | typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay ...
type khronos_utime_nanoseconds_t (line 998) | typedef khronos_utime_nanoseconds_t EGLTimeKHR;
type khronos_uint64_t (line 1183) | typedef khronos_uint64_t EGLuint64KHR;
type EGLNativeFileDescriptorKHR (line 1248) | typedef int EGLNativeFileDescriptorKHR;
type EGLint (line 1297) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EG...
type khronos_ssize_t (line 1322) | typedef khronos_ssize_t EGLsizeiANDROID;
type EGLsizeiANDROID (line 1324) | typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsi...
type khronos_stime_nanoseconds_t (line 1355) | typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;
type const (line 1372) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCOMPOSITORTIMINGANDROIDPROC) (...
type const (line 1375) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSANDROIDPROC) (E...
type AHardwareBuffer (line 1387) | struct AHardwareBuffer
type AHardwareBuffer (line 1390) | struct AHardwareBuffer
type EGLint (line 1507) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETCONTEXTATTRIBUTESEXT...
type EGLint (line 1508) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETWINDOWLISTEXTPROC) (...
type EGLint (line 1509) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETWINDOWATTRIBUTESEXTP...
type EGLAttrib (line 1708) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDispl...
type EGLAttrib (line 1709) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDispla...
type const (line 1750) | typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLen...
type const (line 1751) | typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPRO...
type const (line 1752) | typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPRO...
type EGLAttrib (line 1844) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXT...
type EGLint (line 1852) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EG...
type EGLClientPixmapHI (line 1897) | struct EGLClientPixmapHI {
type EGLClientPixmapHI (line 1904) | struct EGLClientPixmapHI
type EGLClientPixmapHI (line 1906) | struct EGLClientPixmapHI
type const (line 2084) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC)...
type khronos_utime_nanoseconds_t (line 2255) | typedef khronos_utime_nanoseconds_t EGLTimeNV;
type khronos_utime_nanoseconds_t (line 2289) | typedef khronos_utime_nanoseconds_t EGLuint64NV;
type wl_display (line 2320) | struct wl_display
type wl_resource (line 2321) | struct wl_resource
type EGLint (line 2331) | typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDis...
type wl_display (line 2333) | struct wl_display
type wl_display (line 2334) | struct wl_display
type wl_resource (line 2335) | struct wl_resource
type wl_buffer (line 2342) | struct wl_buffer
type wl_buffer (line 2343) | struct wl_buffer
FILE: deps/include/SDL3/SDL_endian.h
function _m_prefetch (line 52) | static __inline__ void __attribute__((__always_inline__, __nodebug__))
function SDL_FORCE_INLINE (line 247) | SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
function SDL_FORCE_INLINE (line 253) | SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
function SDL_FORCE_INLINE (line 259) | SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
function SDL_FORCE_INLINE (line 267) | SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
function SDL_FORCE_INLINE (line 279) | SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
function SDL_FORCE_INLINE (line 294) | SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x)
function SDL_FORCE_INLINE (line 300) | SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x)
function SDL_FORCE_INLINE (line 306) | SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x)
function SDL_FORCE_INLINE (line 316) | SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x)
function SDL_FORCE_INLINE (line 328) | SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x)
function SDL_FORCE_INLINE (line 344) | SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x)
function SDL_FORCE_INLINE (line 359) | SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x)
function SDL_FORCE_INLINE (line 373) | SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x)
function SDL_FORCE_INLINE (line 408) | SDL_FORCE_INLINE float SDL_SwapFloat(float x)
function SDL_FORCE_INLINE (line 447) | SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x) { return x_but_byteswapped; }
function SDL_FORCE_INLINE (line 468) | SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { return x_but_byteswapped; }
function SDL_FORCE_INLINE (line 489) | SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
FILE: deps/include/SDL3/SDL_events.h
type SDL_EventType (line 84) | typedef enum SDL_EventType
type SDL_CommonEvent (line 296) | typedef struct SDL_CommonEvent
type SDL_DisplayEvent (line 308) | typedef struct SDL_DisplayEvent
type SDL_WindowEvent (line 323) | typedef struct SDL_WindowEvent
type SDL_KeyboardDeviceEvent (line 338) | typedef struct SDL_KeyboardDeviceEvent
type SDL_KeyboardEvent (line 360) | typedef struct SDL_KeyboardEvent
type SDL_TextEditingEvent (line 384) | typedef struct SDL_TextEditingEvent
type SDL_TextEditingCandidatesEvent (line 400) | typedef struct SDL_TextEditingCandidatesEvent
type SDL_TextInputEvent (line 426) | typedef struct SDL_TextInputEvent
type SDL_MouseDeviceEvent (line 440) | typedef struct SDL_MouseDeviceEvent
type SDL_MouseMotionEvent (line 453) | typedef struct SDL_MouseMotionEvent
type SDL_MouseButtonEvent (line 472) | typedef struct SDL_MouseButtonEvent
type SDL_MouseWheelEvent (line 492) | typedef struct SDL_MouseWheelEvent
type SDL_JoyAxisEvent (line 513) | typedef struct SDL_JoyAxisEvent
type SDL_JoyBallEvent (line 532) | typedef struct SDL_JoyBallEvent
type SDL_JoyHatEvent (line 551) | typedef struct SDL_JoyHatEvent
type SDL_JoyButtonEvent (line 574) | typedef struct SDL_JoyButtonEvent
type SDL_JoyDeviceEvent (line 596) | typedef struct SDL_JoyDeviceEvent
type SDL_JoyBatteryEvent (line 609) | typedef struct SDL_JoyBatteryEvent
type SDL_GamepadAxisEvent (line 624) | typedef struct SDL_GamepadAxisEvent
type SDL_GamepadButtonEvent (line 644) | typedef struct SDL_GamepadButtonEvent
type SDL_GamepadDeviceEvent (line 671) | typedef struct SDL_GamepadDeviceEvent
type SDL_GamepadTouchpadEvent (line 684) | typedef struct SDL_GamepadTouchpadEvent
type SDL_GamepadSensorEvent (line 702) | typedef struct SDL_GamepadSensorEvent
type SDL_AudioDeviceEvent (line 722) | typedef struct SDL_AudioDeviceEvent
type SDL_CameraDeviceEvent (line 739) | typedef struct SDL_CameraDeviceEvent
type SDL_RenderEvent (line 753) | typedef struct SDL_RenderEvent
type SDL_TouchFingerEvent (line 781) | typedef struct SDL_TouchFingerEvent
type SDL_PinchFingerEvent (line 799) | typedef struct SDL_PinchFingerEvent
type SDL_PenProximityEvent (line 826) | typedef struct SDL_PenProximityEvent
type SDL_PenMotionEvent (line 846) | typedef struct SDL_PenMotionEvent
type SDL_PenTouchEvent (line 866) | typedef struct SDL_PenTouchEvent
type SDL_PenButtonEvent (line 888) | typedef struct SDL_PenButtonEvent
type SDL_PenAxisEvent (line 910) | typedef struct SDL_PenAxisEvent
type SDL_DropEvent (line 930) | typedef struct SDL_DropEvent
type SDL_ClipboardEvent (line 948) | typedef struct SDL_ClipboardEvent
type SDL_SensorEvent (line 963) | typedef struct SDL_SensorEvent
type SDL_QuitEvent (line 978) | typedef struct SDL_QuitEvent
type SDL_UserEvent (line 996) | typedef struct SDL_UserEvent
type SDL_Event (line 1016) | typedef union SDL_Event
type SDL_EventAction (line 1109) | typedef enum SDL_EventAction
FILE: deps/include/SDL3/SDL_filesystem.h
type SDL_Folder (line 195) | typedef enum SDL_Folder
type SDL_PathType (line 251) | typedef enum SDL_PathType
type SDL_PathInfo (line 267) | typedef struct SDL_PathInfo
type Uint32 (line 284) | typedef Uint32 SDL_GlobFlags;
type SDL_EnumerationResult (line 313) | typedef enum SDL_EnumerationResult
type const (line 344) | typedef SDL_EnumerationResult (SDLCALL *SDL_EnumerateDirectoryCallback)(...
FILE: deps/include/SDL3/SDL_gamepad.h
type SDL_Gamepad (line 100) | typedef struct SDL_Gamepad SDL_Gamepad;
type SDL_GamepadType (line 111) | typedef enum SDL_GamepadType
type SDL_GamepadButton (line 152) | typedef enum SDL_GamepadButton
type SDL_GamepadButtonLabel (line 195) | typedef enum SDL_GamepadButtonLabel
type SDL_GamepadAxis (line 222) | typedef enum SDL_GamepadAxis
type SDL_GamepadBindingType (line 244) | typedef enum SDL_GamepadBindingType
type SDL_GamepadBinding (line 267) | typedef struct SDL_GamepadBinding
FILE: deps/include/SDL3/SDL_gpu.h
type SDL_GPUDevice (line 411) | typedef struct SDL_GPUDevice SDL_GPUDevice;
type SDL_GPUBuffer (line 435) | typedef struct SDL_GPUBuffer SDL_GPUBuffer;
type SDL_GPUTransferBuffer (line 453) | typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer;
type SDL_GPUTexture (line 473) | typedef struct SDL_GPUTexture SDL_GPUTexture;
type SDL_GPUSampler (line 485) | typedef struct SDL_GPUSampler SDL_GPUSampler;
type SDL_GPUShader (line 496) | typedef struct SDL_GPUShader SDL_GPUShader;
type SDL_GPUComputePipeline (line 509) | typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline;
type SDL_GPUGraphicsPipeline (line 522) | typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline;
type SDL_GPUCommandBuffer (line 547) | typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer;
type SDL_GPURenderPass (line 560) | typedef struct SDL_GPURenderPass SDL_GPURenderPass;
type SDL_GPUComputePass (line 573) | typedef struct SDL_GPUComputePass SDL_GPUComputePass;
type SDL_GPUCopyPass (line 586) | typedef struct SDL_GPUCopyPass SDL_GPUCopyPass;
type SDL_GPUFence (line 598) | typedef struct SDL_GPUFence SDL_GPUFence;
type SDL_GPUPrimitiveType (line 621) | typedef enum SDL_GPUPrimitiveType
type SDL_GPULoadOp (line 638) | typedef enum SDL_GPULoadOp
type SDL_GPUStoreOp (line 653) | typedef enum SDL_GPUStoreOp
type SDL_GPUIndexElementSize (line 668) | typedef enum SDL_GPUIndexElementSize
type SDL_GPUTextureFormat (line 759) | typedef enum SDL_GPUTextureFormat
type Uint32 (line 904) | typedef Uint32 SDL_GPUTextureUsageFlags;
type SDL_GPUTextureType (line 921) | typedef enum SDL_GPUTextureType
type SDL_GPUSampleCount (line 941) | typedef enum SDL_GPUSampleCount
type SDL_GPUCubeMapFace (line 957) | typedef enum SDL_GPUCubeMapFace
type Uint32 (line 984) | typedef Uint32 SDL_GPUBufferUsageFlags;
type SDL_GPUTransferBufferUsage (line 1003) | typedef enum SDL_GPUTransferBufferUsage
type SDL_GPUShaderStage (line 1016) | typedef enum SDL_GPUShaderStage
type Uint32 (line 1031) | typedef Uint32 SDL_GPUShaderFormat;
type SDL_GPUVertexElementFormat (line 1048) | typedef enum SDL_GPUVertexElementFormat
type SDL_GPUVertexInputRate (line 1114) | typedef enum SDL_GPUVertexInputRate
type SDL_GPUFillMode (line 1127) | typedef enum SDL_GPUFillMode
type SDL_GPUCullMode (line 1140) | typedef enum SDL_GPUCullMode
type SDL_GPUFrontFace (line 1155) | typedef enum SDL_GPUFrontFace
type SDL_GPUCompareOp (line 1168) | typedef enum SDL_GPUCompareOp
type SDL_GPUStencilOp (line 1189) | typedef enum SDL_GPUStencilOp
type SDL_GPUBlendOp (line 1213) | typedef enum SDL_GPUBlendOp
type SDL_GPUBlendFactor (line 1234) | typedef enum SDL_GPUBlendFactor
type Uint8 (line 1259) | typedef Uint8 SDL_GPUColorComponentFlags;
type SDL_GPUFilter (line 1273) | typedef enum SDL_GPUFilter
type SDL_GPUSamplerMipmapMode (line 1286) | typedef enum SDL_GPUSamplerMipmapMode
type SDL_GPUSamplerAddressMode (line 1300) | typedef enum SDL_GPUSamplerAddressMode
type SDL_GPUPresentMode (line 1332) | typedef enum SDL_GPUPresentMode
type SDL_GPUSwapchainComposition (line 1365) | typedef enum SDL_GPUSwapchainComposition
type SDL_GPUViewport (line 1382) | typedef struct SDL_GPUViewport
type SDL_GPUTextureTransferInfo (line 1413) | typedef struct SDL_GPUTextureTransferInfo
type SDL_GPUTransferBufferLocation (line 1431) | typedef struct SDL_GPUTransferBufferLocation
type SDL_GPUTextureLocation (line 1446) | typedef struct SDL_GPUTextureLocation
type SDL_GPUTextureRegion (line 1467) | typedef struct SDL_GPUTextureRegion
type SDL_GPUBlitRegion (line 1487) | typedef struct SDL_GPUBlitRegion
type SDL_GPUBufferLocation (line 1507) | typedef struct SDL_GPUBufferLocation
type SDL_GPUBufferRegion (line 1523) | typedef struct SDL_GPUBufferRegion
type SDL_GPUIndirectDrawCommand (line 1544) | typedef struct SDL_GPUIndirectDrawCommand
type SDL_GPUIndexedIndirectDrawCommand (line 1566) | typedef struct SDL_GPUIndexedIndirectDrawCommand
type SDL_GPUIndirectDispatchCommand (line 1582) | typedef struct SDL_GPUIndirectDispatchCommand
type SDL_GPUSamplerCreateInfo (line 1605) | typedef struct SDL_GPUSamplerCreateInfo
type SDL_GPUVertexBufferDescription (line 1644) | typedef struct SDL_GPUVertexBufferDescription
type SDL_GPUVertexAttribute (line 1664) | typedef struct SDL_GPUVertexAttribute
type SDL_GPUVertexInputState (line 1682) | typedef struct SDL_GPUVertexInputState
type SDL_GPUStencilOpState (line 1697) | typedef struct SDL_GPUStencilOpState
type SDL_GPUColorTargetBlendState (line 1715) | typedef struct SDL_GPUColorTargetBlendState
type SDL_GPUShaderCreateInfo (line 1740) | typedef struct SDL_GPUShaderCreateInfo
type SDL_GPUTextureCreateInfo (line 1770) | typedef struct SDL_GPUTextureCreateInfo
type SDL_GPUBufferCreateInfo (line 1795) | typedef struct SDL_GPUBufferCreateInfo
type SDL_GPUTransferBufferCreateInfo (line 1810) | typedef struct SDL_GPUTransferBufferCreateInfo
type SDL_GPURasterizerState (line 1836) | typedef struct SDL_GPURasterizerState
type SDL_GPUMultisampleState (line 1858) | typedef struct SDL_GPUMultisampleState
type SDL_GPUDepthStencilState (line 1876) | typedef struct SDL_GPUDepthStencilState
type SDL_GPUColorTargetDescription (line 1899) | typedef struct SDL_GPUColorTargetDescription
type SDL_GPUGraphicsPipelineTargetInfo (line 1915) | typedef struct SDL_GPUGraphicsPipelineTargetInfo
type SDL_GPUGraphicsPipelineCreateInfo (line 1940) | typedef struct SDL_GPUGraphicsPipelineCreateInfo
type SDL_GPUComputePipelineCreateInfo (line 1962) | typedef struct SDL_GPUComputePipelineCreateInfo
type SDL_GPUColorTargetInfo (line 2017) | typedef struct SDL_GPUColorTargetInfo
type SDL_GPUDepthStencilTargetInfo (line 2081) | typedef struct SDL_GPUDepthStencilTargetInfo
type SDL_GPUBlitInfo (line 2102) | typedef struct SDL_GPUBlitInfo {
type SDL_GPUBufferBinding (line 2125) | typedef struct SDL_GPUBufferBinding
type SDL_GPUTextureSamplerBinding (line 2141) | typedef struct SDL_GPUTextureSamplerBinding
type SDL_GPUStorageBufferReadWriteBinding (line 2155) | typedef struct SDL_GPUStorageBufferReadWriteBinding
type SDL_GPUStorageTextureReadWriteBinding (line 2172) | typedef struct SDL_GPUStorageTextureReadWriteBinding
type SDL_GPUVulkanOptions (line 2402) | typedef struct SDL_GPUVulkanOptions
FILE: deps/include/SDL3/SDL_guid.h
type SDL_GUID (line 61) | typedef struct SDL_GUID {
FILE: deps/include/SDL3/SDL_haptic.h
type SDL_Haptic (line 150) | typedef struct SDL_Haptic SDL_Haptic;
type Uint16 (line 181) | typedef Uint16 SDL_HapticEffectType;
type Uint8 (line 407) | typedef Uint8 SDL_HapticDirectionType;
type SDL_HapticEffectID (line 460) | typedef int SDL_HapticEffectID;
type SDL_HapticDirection (line 566) | typedef struct SDL_HapticDirection
type SDL_HapticConstant (line 586) | typedef struct SDL_HapticConstant
type SDL_HapticPeriodic (line 672) | typedef struct SDL_HapticPeriodic
type SDL_HapticCondition (line 728) | typedef struct SDL_HapticCondition
type SDL_HapticRamp (line 767) | typedef struct SDL_HapticRamp
type SDL_HapticLeftRight (line 806) | typedef struct SDL_HapticLeftRight
type SDL_HapticCustom (line 836) | typedef struct SDL_HapticCustom
type SDL_HapticEffect (line 935) | typedef union SDL_HapticEffect
type Uint32 (line 957) | typedef Uint32 SDL_HapticID;
FILE: deps/include/SDL3/SDL_hidapi.h
type SDL_hid_device (line 71) | typedef struct SDL_hid_device SDL_hid_device;
type SDL_hid_bus_type (line 78) | typedef enum SDL_hid_bus_type {
type SDL_hid_device_info (line 113) | typedef struct SDL_hid_device_info
FILE: deps/include/SDL3/SDL_hints.h
type SDL_HintPriority (line 4770) | typedef enum SDL_HintPriority
FILE: deps/include/SDL3/SDL_init.h
type Uint32 (line 78) | typedef Uint32 SDL_InitFlags;
type SDL_AppResult (line 109) | typedef enum SDL_AppResult
FILE: deps/include/SDL3/SDL_intrin.h
function _m_prefetch (line 225) | static __inline__ void __attribute__((__always_inline__, __nodebug__))
FILE: deps/include/SDL3/SDL_iostream.h
type SDL_IOStatus (line 53) | typedef enum SDL_IOStatus
type SDL_IOWhence (line 71) | typedef enum SDL_IOWhence
type SDL_IOStreamInterface (line 92) | typedef struct SDL_IOStreamInterface
type SDL_IOStream (line 182) | typedef struct SDL_IOStream SDL_IOStream;
FILE: deps/include/SDL3/SDL_joystick.h
type SDL_Joystick (line 94) | typedef struct SDL_Joystick SDL_Joystick;
type Uint32 (line 106) | typedef Uint32 SDL_JoystickID;
type SDL_JoystickType (line 124) | typedef enum SDL_JoystickType
type SDL_JoystickConnectionState (line 147) | typedef enum SDL_JoystickConnectionState
type SDL_VirtualJoystickTouchpadDesc (line 433) | typedef struct SDL_VirtualJoystickTouchpadDesc
type SDL_VirtualJoystickSensorDesc (line 446) | typedef struct SDL_VirtualJoystickSensorDesc
type SDL_VirtualJoystickDesc (line 465) | typedef struct SDL_VirtualJoystickDesc
FILE: deps/include/SDL3/SDL_keyboard.h
type Uint32 (line 60) | typedef Uint32 SDL_KeyboardID;
type SDL_TextInputType (line 391) | typedef enum SDL_TextInputType
type SDL_Capitalization (line 415) | typedef enum SDL_Capitalization
FILE: deps/include/SDL3/SDL_keycode.h
type Uint32 (line 59) | typedef Uint32 SDL_Keycode;
type Uint16 (line 326) | typedef Uint16 SDL_Keymod;
FILE: deps/include/SDL3/SDL_loadso.h
type SDL_SharedObject (line 77) | typedef struct SDL_SharedObject SDL_SharedObject;
FILE: deps/include/SDL3/SDL_locale.h
type SDL_Locale (line 60) | typedef struct SDL_Locale
FILE: deps/include/SDL3/SDL_log.h
type SDL_LogCategory (line 90) | typedef enum SDL_LogCategory
type SDL_LogPriority (line 130) | typedef enum SDL_LogPriority
FILE: deps/include/SDL3/SDL_main_impl.h
function SDL_main (line 57) | int SDL_main(int argc, char **argv)
type HINSTANCE__ (line 82) | struct HINSTANCE__
type wchar_t (line 84) | typedef wchar_t *PWSTR;
function wmain (line 91) | int wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
function main (line 99) | int main(int argc, char *argv[])
function WinMain (line 118) | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, in...
function main (line 135) | int main(int argc, char *argv[])
FILE: deps/include/SDL3/SDL_messagebox.h
type Uint32 (line 59) | typedef Uint32 SDL_MessageBoxFlags;
type Uint32 (line 72) | typedef Uint32 SDL_MessageBoxButtonFlags;
type SDL_MessageBoxButtonData (line 82) | typedef struct SDL_MessageBoxButtonData
type SDL_MessageBoxColor (line 94) | typedef struct SDL_MessageBoxColor
type SDL_MessageBoxColorType (line 103) | typedef enum SDL_MessageBoxColorType
type SDL_MessageBoxColorScheme (line 118) | typedef struct SDL_MessageBoxColorScheme
type SDL_MessageBoxData (line 128) | typedef struct SDL_MessageBoxData
FILE: deps/include/SDL3/SDL_mouse.h
type Uint32 (line 81) | typedef Uint32 SDL_MouseID;
type SDL_Cursor (line 90) | typedef struct SDL_Cursor SDL_Cursor;
type SDL_SystemCursor (line 97) | typedef enum SDL_SystemCursor
type SDL_MouseWheelDirection (line 127) | typedef enum SDL_MouseWheelDirection
type SDL_CursorFrameInfo (line 138) | typedef struct SDL_CursorFrameInfo
type Uint32 (line 159) | typedef Uint32 SDL_MouseButtonFlags;
FILE: deps/include/SDL3/SDL_mutex.h
type SDL_Mutex (line 296) | typedef struct SDL_Mutex SDL_Mutex;
type SDL_RWLock (line 438) | typedef struct SDL_RWLock SDL_RWLock;
type SDL_Semaphore (line 684) | typedef struct SDL_Semaphore SDL_Semaphore;
type SDL_Condition (line 841) | typedef struct SDL_Condition SDL_Condition;
type SDL_InitStatus (line 975) | typedef enum SDL_InitStatus
type SDL_InitState (line 1039) | typedef struct SDL_InitState
FILE: deps/include/SDL3/SDL_opengl.h
type GLenum (line 159) | typedef unsigned int GLenum;
type GLboolean (line 160) | typedef unsigned char GLboolean;
type GLbitfield (line 161) | typedef unsigned int GLbitfield;
type GLvoid (line 162) | typedef void GLvoid;
type GLbyte (line 163) | typedef signed char GLbyte;
type GLshort (line 164) | typedef short GLshort;
type GLint (line 165) | typedef int GLint;
type GLubyte (line 166) | typedef unsigned char GLubyte;
type GLushort (line 167) | typedef unsigned short GLushort;
type GLuint (line 168) | typedef unsigned int GLuint;
type GLsizei (line 169) | typedef int GLsizei;
type GLfloat (line 170) | typedef float GLfloat;
type GLclampf (line 171) | typedef float GLclampf;
type GLdouble (line 172) | typedef double GLdouble;
type GLclampd (line 173) | typedef double GLclampd;
type GLubyte (line 1570) | typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC) ( GLenum name );
type GLuint (line 2056) | typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTPROC) ( GLsizei n,
FILE: deps/include/SDL3/SDL_opengl_glext.h
type khronos_int32_t (line 191) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 192) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 193) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 194) | typedef uint64_t khronos_uint64_t;
type khronos_int32_t (line 218) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 219) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 220) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 221) | typedef uint64_t khronos_uint64_t;
type __int32 (line 230) | typedef __int32 khronos_int32_t;
type khronos_uint32_t (line 231) | typedef unsigned __int32 khronos_uint32_t;
type __int64 (line 232) | typedef __int64 khronos_int64_t;
type khronos_uint64_t (line 233) | typedef unsigned __int64 khronos_uint64_t;
type khronos_int32_t (line 242) | typedef int khronos_int32_t;
type khronos_uint32_t (line 243) | typedef unsigned int khronos_uint32_t;
type khronos_int64_t (line 245) | typedef long int khronos_int64_t;
type khronos_uint64_t (line 246) | typedef unsigned long int khronos_uint64_t;
type khronos_int64_t (line 248) | typedef long long int khronos_int64_t;
type khronos_uint64_t (line 249) | typedef unsigned long long int khronos_uint64_t;
type khronos_int32_t (line 259) | typedef int khronos_int32_t;
type khronos_uint32_t (line 260) | typedef unsigned int khronos_uint32_t;
type khronos_int32_t (line 270) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 271) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 272) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 273) | typedef uint64_t khronos_uint64_t;
type khronos_int8_t (line 283) | typedef signed char khronos_int8_t;
type khronos_uint8_t (line 284) | typedef unsigned char khronos_uint8_t;
type khronos_int16_t (line 285) | typedef signed short int khronos_int16_t;
type khronos_uint16_t (line 286) | typedef unsigned short int khronos_uint16_t;
type khronos_intptr_t (line 294) | typedef intptr_t khronos_intptr_t;
type khronos_uintptr_t (line 295) | typedef uintptr_t khronos_uintptr_t;
type khronos_intptr_t (line 297) | typedef signed long long int khronos_intptr_t;
type khronos_uintptr_t (line 298) | typedef unsigned long long int khronos_uintptr_t;
type khronos_intptr_t (line 300) | typedef signed long int khronos_intptr_t;
type khronos_uintptr_t (line 301) | typedef unsigned long int khronos_uintptr_t;
type khronos_ssize_t (line 305) | typedef signed long long int khronos_ssize_t;
type khronos_usize_t (line 306) | typedef unsigned long long int khronos_usize_t;
type khronos_ssize_t (line 308) | typedef signed long int khronos_ssize_t;
type khronos_usize_t (line 309) | typedef unsigned long int khronos_usize_t;
type khronos_float_t (line 316) | typedef float khronos_float_t;
type khronos_uint64_t (line 329) | typedef khronos_uint64_t khronos_utime_nanoseconds_t;
type khronos_int64_t (line 330) | typedef khronos_int64_t khronos_stime_nanoseconds_t;
type khronos_boolean_enum_t (line 346) | typedef enum {
type khronos_ssize_t (line 765) | typedef khronos_ssize_t GLsizeiptr;
type khronos_intptr_t (line 766) | typedef khronos_intptr_t GLintptr;
type GLchar (line 861) | typedef char GLchar;
type khronos_uint16_t (line 1179) | typedef khronos_uint16_t GLhalf;
type GLubyte (line 1474) | typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLu...
type __GLsync (line 1682) | struct __GLsync
type khronos_uint64_t (line 1683) | typedef khronos_uint64_t GLuint64;
type khronos_int64_t (line 1684) | typedef khronos_int64_t GLint64;
type const (line 2033) | typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint ...
type const (line 2034) | typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, ...
type const (line 2742) | typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint prog...
type const (line 2745) | typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint pr...
type const (line 2746) | typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLui...
type khronos_uint64_t (line 3211) | typedef khronos_uint64_t GLuint64EXT;
type _cl_context (line 3259) | struct _cl_context
type _cl_event (line 3260) | struct _cl_event
type struct (line 3263) | typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl...
type _cl_context (line 3265) | struct _cl_context
type _cl_event (line 3265) | struct _cl_event
type khronos_uint16_t (line 3771) | typedef khronos_uint16_t GLhalfARB;
type GLhandleARB (line 4373) | typedef unsigned int GLhandleARB;
type GLcharARB (line 4375) | typedef char GLcharARB;
type GLchar (line 4537) | typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, ...
type khronos_ssize_t (line 4995) | typedef khronos_ssize_t GLsizeiptrARB;
type khronos_intptr_t (line 4996) | typedef khronos_intptr_t GLintptrARB;
type khronos_int32_t (line 5419) | typedef khronos_int32_t GLfixed;
type khronos_int64_t (line 5805) | typedef khronos_int64_t GLint64EXT;
type GLenum (line 6621) | typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, co...
type GLuint (line 8853) | typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n...
type GLuint (line 9810) | typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei w...
type GLuint (line 9811) | typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei wa...
type GLhalfNV (line 10536) | typedef unsigned short GLhalfNV;
type GLbitfield (line 11033) | typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTa...
type const (line 11034) | typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstP...
type GLintptr (line 11776) | typedef GLintptr GLvdpauSurfaceNV;
type const (line 11783) | typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC...
type const (line 11784) | typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPRO...
type const (line 11807) | typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACEWITHPI...
type GLuint (line 12017) | typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n,...
FILE: deps/include/SDL3/SDL_opengles2_gl2.h
type khronos_int8_t (line 43) | typedef khronos_int8_t GLbyte;
type khronos_float_t (line 44) | typedef khronos_float_t GLclampf;
type khronos_int32_t (line 45) | typedef khronos_int32_t GLfixed;
type khronos_int16_t (line 46) | typedef khronos_int16_t GLshort;
type khronos_uint16_t (line 47) | typedef khronos_uint16_t GLushort;
type GLvoid (line 48) | typedef void GLvoid;
type __GLsync (line 49) | struct __GLsync
type khronos_int64_t (line 50) | typedef khronos_int64_t GLint64;
type khronos_uint64_t (line 51) | typedef khronos_uint64_t GLuint64;
type GLenum (line 52) | typedef unsigned int GLenum;
type GLuint (line 53) | typedef unsigned int GLuint;
type GLchar (line 54) | typedef char GLchar;
type khronos_float_t (line 55) | typedef khronos_float_t GLfloat;
type khronos_ssize_t (line 56) | typedef khronos_ssize_t GLsizeiptr;
type khronos_intptr_t (line 57) | typedef khronos_intptr_t GLintptr;
type GLbitfield (line 58) | typedef unsigned int GLbitfield;
type GLint (line 59) | typedef int GLint;
type GLboolean (line 60) | typedef unsigned char GLboolean;
type GLsizei (line 61) | typedef int GLsizei;
type khronos_uint8_t (line 62) | typedef khronos_uint8_t GLubyte;
type GLubyte (line 435) | typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
FILE: deps/include/SDL3/SDL_opengles2_gl2ext.h
type const (line 1131) | typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC)...
type khronos_int64_t (line 2933) | typedef khronos_int64_t GLint64EXT;
type khronos_uint64_t (line 2934) | typedef khronos_uint64_t GLuint64EXT;
type GLdouble (line 3191) | typedef double GLdouble;
type GLbitfield (line 3397) | typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fon...
type const (line 3398) | typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint fir...
FILE: deps/include/SDL3/SDL_opengles2_khrplatform.h
type khronos_int32_t (line 150) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 151) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 152) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 153) | typedef uint64_t khronos_uint64_t;
type khronos_int32_t (line 177) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 178) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 179) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 180) | typedef uint64_t khronos_uint64_t;
type __int32 (line 189) | typedef __int32 khronos_int32_t;
type khronos_uint32_t (line 190) | typedef unsigned __int32 khronos_uint32_t;
type __int64 (line 191) | typedef __int64 khronos_int64_t;
type khronos_uint64_t (line 192) | typedef unsigned __int64 khronos_uint64_t;
type khronos_int32_t (line 201) | typedef int khronos_int32_t;
type khronos_uint32_t (line 202) | typedef unsigned int khronos_uint32_t;
type khronos_int64_t (line 204) | typedef long int khronos_int64_t;
type khronos_uint64_t (line 205) | typedef unsigned long int khronos_uint64_t;
type khronos_int64_t (line 207) | typedef long long int khronos_int64_t;
type khronos_uint64_t (line 208) | typedef unsigned long long int khronos_uint64_t;
type khronos_int32_t (line 218) | typedef int khronos_int32_t;
type khronos_uint32_t (line 219) | typedef unsigned int khronos_uint32_t;
type khronos_int32_t (line 229) | typedef int32_t khronos_int32_t;
type khronos_uint32_t (line 230) | typedef uint32_t khronos_uint32_t;
type khronos_int64_t (line 231) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 232) | typedef uint64_t khronos_uint64_t;
type khronos_int8_t (line 242) | typedef signed char khronos_int8_t;
type khronos_uint8_t (line 243) | typedef unsigned char khronos_uint8_t;
type khronos_int16_t (line 244) | typedef signed short int khronos_int16_t;
type khronos_uint16_t (line 245) | typedef unsigned short int khronos_uint16_t;
type khronos_intptr_t (line 253) | typedef intptr_t khronos_intptr_t;
type khronos_uintptr_t (line 254) | typedef uintptr_t khronos_uintptr_t;
type khronos_intptr_t (line 256) | typedef signed long long int khronos_intptr_t;
type khronos_uintptr_t (line 257) | typedef unsigned long long int khronos_uintptr_t;
type khronos_intptr_t (line 259) | typedef signed long int khronos_intptr_t;
type khronos_uintptr_t (line 260) | typedef unsigned long int khronos_uintptr_t;
type khronos_ssize_t (line 264) | typedef signed long long int khronos_ssize_t;
type khronos_usize_t (line 265) | typedef unsigned long long int khronos_usize_t;
type khronos_ssize_t (line 267) | typedef signed long int khronos_ssize_t;
type khronos_usize_t (line 268) | typedef unsigned long int khronos_usize_t;
type khronos_float_t (line 275) | typedef float khronos_float_t;
type khronos_uint64_t (line 288) | typedef khronos_uint64_t khronos_utime_nanoseconds_t;
type khronos_int64_t (line 289) | typedef khronos_int64_t khronos_stime_nanoseconds_t;
type khronos_boolean_enum_t (line 305) | typedef enum {
FILE: deps/include/SDL3/SDL_pen.h
type Uint32 (line 93) | typedef Uint32 SDL_PenID;
type Uint32 (line 114) | typedef Uint32 SDL_PenInputFlags;
type SDL_PenAxis (line 140) | typedef enum SDL_PenAxis
type SDL_PenDeviceType (line 167) | typedef enum SDL_PenDeviceType
FILE: deps/include/SDL3/SDL_pixels.h
type SDL_PixelType (line 134) | typedef enum SDL_PixelType
type SDL_BitmapOrder (line 157) | typedef enum SDL_BitmapOrder
type SDL_PackedOrder (line 169) | typedef enum SDL_PackedOrder
type SDL_ArrayOrder (line 187) | typedef enum SDL_ArrayOrder
type SDL_PackedLayout (line 203) | typedef enum SDL_PackedLayout
type SDL_PixelFormat (line 548) | typedef enum SDL_PixelFormat
type SDL_ColorType (line 709) | typedef enum SDL_ColorType
type SDL_ColorRange (line 722) | typedef enum SDL_ColorRange
type SDL_ColorPrimaries (line 735) | typedef enum SDL_ColorPrimaries
type SDL_TransferCharacteristics (line 760) | typedef enum SDL_TransferCharacteristics
type SDL_MatrixCoefficients (line 790) | typedef enum SDL_MatrixCoefficients
type SDL_ChromaLocation (line 814) | typedef enum SDL_ChromaLocation
type SDL_Colorspace (line 1011) | typedef enum SDL_Colorspace
type SDL_Color (line 1112) | typedef struct SDL_Color
type SDL_FColor (line 1126) | typedef struct SDL_FColor
type SDL_Palette (line 1141) | typedef struct SDL_Palette
type SDL_PixelFormatDetails (line 1154) | typedef struct SDL_PixelFormatDetails
FILE: deps/include/SDL3/SDL_power.h
type SDL_PowerState (line 56) | typedef enum SDL_PowerState
FILE: deps/include/SDL3/SDL_process.h
type SDL_Process (line 64) | typedef struct SDL_Process SDL_Process;
type SDL_ProcessIO (line 150) | typedef enum SDL_ProcessIO
FILE: deps/include/SDL3/SDL_properties.h
type Uint32 (line 66) | typedef Uint32 SDL_PropertiesID;
type SDL_PropertyType (line 73) | typedef enum SDL_PropertyType
FILE: deps/include/SDL3/SDL_rect.h
type SDL_Point (line 49) | typedef struct SDL_Point
type SDL_FPoint (line 63) | typedef struct SDL_FPoint
type SDL_Rect (line 83) | typedef struct SDL_Rect
type SDL_FRect (line 109) | typedef struct SDL_FRect
function SDL_FORCE_INLINE (line 129) | SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *f...
function SDL_FORCE_INLINE (line 158) | SDL_FORCE_INLINE bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect...
function SDL_FORCE_INLINE (line 182) | SDL_FORCE_INLINE bool SDL_RectEmpty(const SDL_Rect *r)
function SDL_FORCE_INLINE (line 206) | SDL_FORCE_INLINE bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
function SDL_FORCE_INLINE (line 331) | SDL_FORCE_INLINE bool SDL_PointInRectFloat(const SDL_FPoint *p, const SD...
function SDL_FORCE_INLINE (line 355) | SDL_FORCE_INLINE bool SDL_RectEmptyFloat(const SDL_FRect *r)
function SDL_FORCE_INLINE (line 385) | SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SD...
function SDL_FORCE_INLINE (line 420) | SDL_FORCE_INLINE bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_...
FILE: deps/include/SDL3/SDL_render.h
type SDL_Vertex (line 89) | typedef struct SDL_Vertex
type SDL_TextureAccess (line 101) | typedef enum SDL_TextureAccess
type SDL_TextureAddressMode (line 119) | typedef enum SDL_TextureAddressMode
type SDL_RendererLogicalPresentation (line 132) | typedef enum SDL_RendererLogicalPresentation
type SDL_Renderer (line 146) | typedef struct SDL_Renderer SDL_Renderer;
type SDL_Texture (line 160) | struct SDL_Texture
type SDL_Texture (line 170) | typedef struct SDL_Texture SDL_Texture;
type SDL_GPURenderStateCreateInfo (line 2923) | typedef struct SDL_GPURenderStateCreateInfo
type SDL_GPURenderState (line 2949) | typedef struct SDL_GPURenderState SDL_GPURenderState;
FILE: deps/include/SDL3/SDL_scancode.h
type SDL_Scancode (line 52) | typedef enum SDL_Scancode
FILE: deps/include/SDL3/SDL_sensor.h
type SDL_Sensor (line 54) | typedef struct SDL_Sensor SDL_Sensor;
type Uint32 (line 64) | typedef Uint32 SDL_SensorID;
type SDL_SensorType (line 132) | typedef enum SDL_SensorType
FILE: deps/include/SDL3/SDL_stdinc.h
type __int64 (line 67) | typedef __int64 intptr_t;
type Sint8 (line 437) | typedef int8_t Sint8;
type Uint8 (line 446) | typedef uint8_t Uint8;
type Sint16 (line 455) | typedef int16_t Sint16;
type Uint16 (line 464) | typedef uint16_t Uint16;
type Sint32 (line 473) | typedef int32_t Sint32;
type Uint32 (line 482) | typedef uint32_t Uint32;
type Sint64 (line 493) | typedef int64_t Sint64;
type Uint64 (line 504) | typedef uint64_t Uint64;
type Sint64 (line 521) | typedef Sint64 SDL_Time;
type SDL_alignment_test (line 1182) | typedef struct SDL_alignment_test
type SDL_DUMMY_ENUM (line 1202) | typedef enum SDL_DUMMY_ENUM
function SDL_FORCE_INLINE (line 6094) | SDL_FORCE_INLINE bool SDL_size_mul_check_overflow(size_t a, size_t b, si...
function SDL_FORCE_INLINE (line 6108) | SDL_FORCE_INLINE bool SDL_size_mul_check_overflow_builtin(size_t a, size...
function SDL_FORCE_INLINE (line 6133) | SDL_FORCE_INLINE bool SDL_size_add_check_overflow(size_t a, size_t b, si...
function SDL_FORCE_INLINE (line 6146) | SDL_FORCE_INLINE bool SDL_size_add_check_overflow_builtin(size_t a, size...
FILE: deps/include/SDL3/SDL_storage.h
type SDL_StorageInterface (line 274) | typedef struct SDL_StorageInterface
type SDL_Storage (line 332) | typedef struct SDL_Storage SDL_Storage;
FILE: deps/include/SDL3/SDL_surface.h
type Uint32 (line 68) | typedef Uint32 SDL_SurfaceFlags;
type SDL_ScaleMode (line 87) | typedef enum SDL_ScaleMode
type SDL_FlipMode (line 100) | typedef enum SDL_FlipMode
type SDL_Surface (line 138) | struct SDL_Surface
type SDL_Surface (line 153) | typedef struct SDL_Surface SDL_Surface;
FILE: deps/include/SDL3/SDL_system.h
type MSG (line 54) | typedef struct tagMSG MSG;
type XEvent (line 141) | typedef union _XEvent XEvent;
type SDL_Sandbox (line 650) | typedef enum SDL_Sandbox
type XTaskQueueObject (line 798) | struct XTaskQueueObject
type XUser (line 799) | struct XUser
FILE: deps/include/SDL3/SDL_test_common.h
type Uint32 (line 46) | typedef Uint32 SDLTest_VerboseFlags;
type SDLTest_ArgumentParser (line 61) | typedef struct SDLTest_ArgumentParser
type SDLTest_CommonState (line 75) | typedef struct
FILE: deps/include/SDL3/SDL_test_crc32.h
type SDLTest_Crc32Context (line 65) | typedef struct SDLTest_Crc32Context {
FILE: deps/include/SDL3/SDL_test_font.h
type SDLTest_TextWindow (line 76) | typedef struct SDLTest_TextWindow
FILE: deps/include/SDL3/SDL_test_harness.h
type SDLTest_TestCaseReference (line 75) | typedef struct SDLTest_TestCaseReference {
type SDLTest_TestSuiteReference (line 89) | typedef struct SDLTest_TestSuiteReference {
type SDLTest_TestSuiteRunner (line 115) | typedef struct SDLTest_TestSuiteRunner SDLTest_TestSuiteRunner;
FILE: deps/include/SDL3/SDL_test_md5.h
type Uint32 (line 68) | typedef Uint32 MD5UINT4;
type SDLTest_Md5Context (line 71) | typedef struct SDLTest_Md5Context {
FILE: deps/include/SDL3/SDL_thread.h
type SDL_Thread (line 71) | typedef struct SDL_Thread SDL_Thread;
type Uint64 (line 85) | typedef Uint64 SDL_ThreadID;
type SDL_AtomicInt (line 98) | typedef SDL_AtomicInt SDL_TLSID;
type SDL_ThreadPriority (line 111) | typedef enum SDL_ThreadPriority {
type SDL_ThreadState (line 127) | typedef enum SDL_ThreadState
FILE: deps/include/SDL3/SDL_time.h
type SDL_DateTime (line 54) | typedef struct SDL_DateTime
type SDL_DateFormat (line 74) | typedef enum SDL_DateFormat
type SDL_TimeFormat (line 88) | typedef enum SDL_TimeFormat
FILE: deps/include/SDL3/SDL_timer.h
type Uint32 (line 306) | typedef Uint32 SDL_TimerID;
FILE: deps/include/SDL3/SDL_touch.h
type Uint64 (line 62) | typedef Uint64 SDL_TouchID;
type Uint64 (line 76) | typedef Uint64 SDL_FingerID;
type SDL_TouchDeviceType (line 83) | typedef enum SDL_TouchDeviceType
type SDL_Finger (line 102) | typedef struct SDL_Finger
FILE: deps/include/SDL3/SDL_tray.h
type SDL_Tray (line 51) | typedef struct SDL_Tray SDL_Tray;
type SDL_TrayMenu (line 58) | typedef struct SDL_TrayMenu SDL_TrayMenu;
type SDL_TrayEntry (line 65) | typedef struct SDL_TrayEntry SDL_TrayEntry;
type Uint32 (line 78) | typedef Uint32 SDL_TrayEntryFlags;
FILE: deps/include/SDL3/SDL_video.h
type Uint32 (line 75) | typedef Uint32 SDL_DisplayID;
type Uint32 (line 84) | typedef Uint32 SDL_WindowID;
type SDL_SystemTheme (line 110) | typedef enum SDL_SystemTheme
type SDL_DisplayModeData (line 126) | typedef struct SDL_DisplayModeData SDL_DisplayModeData;
type SDL_DisplayMode (line 139) | typedef struct SDL_DisplayMode
type SDL_DisplayOrientation (line 159) | typedef enum SDL_DisplayOrientation
type SDL_Window (line 175) | typedef struct SDL_Window SDL_Window;
type Uint64 (line 195) | typedef Uint64 SDL_WindowFlags;
type SDL_FlashOperation (line 328) | typedef enum SDL_FlashOperation
type SDL_ProgressState (line 340) | typedef enum SDL_ProgressState
type SDL_GLContextState (line 360) | struct SDL_GLContextState
type SDL_EGLAttrib (line 388) | typedef intptr_t SDL_EGLAttrib;
type SDL_EGLint (line 395) | typedef int SDL_EGLint;
type SDL_EGLAttrib (line 420) | typedef SDL_EGLAttrib *(SDLCALL *SDL_EGLAttribArrayCallback)(void *userd...
type SDL_EGLint (line 451) | typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void *userdata, S...
type SDL_GLAttr (line 470) | typedef enum SDL_GLAttr
type Uint32 (line 507) | typedef Uint32 SDL_GLProfile;
type Uint32 (line 519) | typedef Uint32 SDL_GLContextFlag;
type Uint32 (line 533) | typedef Uint32 SDL_GLContextReleaseFlag;
type Uint32 (line 544) | typedef Uint32 SDL_GLContextResetNotification;
type SDL_HitTestResult (line 2828) | typedef enum SDL_HitTestResult
type SDL_Point (line 2852) | typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
FILE: deps/include/SDL3/SDL_vulkan.h
type VkAllocationCallbacks (line 228) | struct VkAllocationCallbacks
type VkAllocationCallbacks (line 256) | struct VkAllocationCallbacks
FILE: deps/include/TinySoundFont/tml.h
type TMLMessageType (line 53) | enum TMLMessageType
type TMLController (line 59) | enum TMLController
type tml_message (line 74) | typedef struct tml_message
type tml_stream (line 130) | struct tml_stream
type tml_stream (line 140) | struct tml_stream
type tsf_stream (line 141) | struct tsf_stream
function tml_stream_stdio_read (line 192) | static int tml_stream_stdio_read(FILE* f, void* ptr, unsigned int size) ...
function TMLDEF (line 193) | TMLDEF tml_message* tml_load_filename(const char* filename)
type tml_stream_memory (line 210) | struct tml_stream_memory { const char* buffer; unsigned int total, pos; }
function tml_stream_memory_read (line 211) | static int tml_stream_memory_read(struct tml_stream_memory* m, void* ptr...
function tml_message (line 212) | tml_message* tml_load_memory(const void* buffer, int size)
type tml_track (line 222) | struct tml_track
type tml_tempomsg (line 227) | struct tml_tempomsg
type tml_parser (line 234) | struct tml_parser
type TMLSystemType (line 240) | enum TMLSystemType
function tml_readbyte (line 248) | static int tml_readbyte(struct tml_parser* p)
function tml_readvariablelength (line 253) | static int tml_readvariablelength(struct tml_parser* p)
function tml_parsemessage (line 267) | static int tml_parsemessage(tml_message** f, struct tml_parser* p)
function TMLDEF (line 367) | TMLDEF tml_message* tml_load(struct tml_stream* stream)
function TMLDEF (line 469) | TMLDEF tml_message* tml_load_tsf_stream(struct tsf_stream* stream)
function TMLDEF (line 474) | TMLDEF int tml_get_info(tml_message* Msg, int* out_used_channels, int* o...
function TMLDEF (line 497) | TMLDEF int tml_get_tempo_value(tml_message* msg)
function TMLDEF (line 505) | TMLDEF void tml_free(tml_message* f)
FILE: deps/include/TinySoundFont/tsf.h
type tsf (line 71) | typedef struct tsf tsf;
type tsf_stream (line 82) | struct tsf_stream
type tsf_stream (line 95) | struct tsf_stream
type TSFOutputMode (line 116) | enum TSFOutputMode
type TSFOutputMode (line 136) | enum TSFOutputMode
type tsf_s8 (line 277) | typedef signed char tsf_s8;
type tsf_u8 (line 278) | typedef unsigned char tsf_u8;
type tsf_u16 (line 279) | typedef unsigned short tsf_u16;
type tsf_s16 (line 280) | typedef signed short tsf_s16;
type tsf_u32 (line 281) | typedef unsigned int tsf_u32;
type tsf (line 286) | struct tsf
function tsf_stream_stdio_read (line 305) | static int tsf_stream_stdio_read(FILE* f, void* ptr, unsigned int size) ...
function tsf_stream_stdio_skip (line 306) | static int tsf_stream_stdio_skip(FILE* f, unsigned int count) { return !...
function TSFDEF (line 307) | TSFDEF tsf* tsf_load_filename(const char* filename)
type tsf_stream_memory (line 328) | struct tsf_stream_memory { const char* buffer; unsigned int total, pos; }
function tsf_stream_memory_read (line 329) | static int tsf_stream_memory_read(struct tsf_stream_memory* m, void* ptr...
function tsf_stream_memory_skip (line 330) | static int tsf_stream_memory_skip(struct tsf_stream_memory* m, unsigned ...
function TSFDEF (line 331) | TSFDEF tsf* tsf_load_memory(const void* buffer, int size)
type tsf_hydra (line 345) | struct tsf_hydra
type tsf_hydra_phdr (line 354) | struct tsf_hydra_phdr { tsf_char20 presetName; tsf_u16 preset, bank, pre...
type tsf_hydra_pbag (line 355) | struct tsf_hydra_pbag { tsf_u16 genNdx, modNdx; }
type tsf_hydra_pmod (line 356) | struct tsf_hydra_pmod { tsf_u16 modSrcOper, modDestOper; tsf_s16 modAmou...
type tsf_hydra_pgen (line 357) | struct tsf_hydra_pgen { tsf_u16 genOper; union tsf_hydra_genamount genAm...
type tsf_hydra_inst (line 358) | struct tsf_hydra_inst { tsf_char20 instName; tsf_u16 instBagNdx; }
type tsf_hydra_ibag (line 359) | struct tsf_hydra_ibag { tsf_u16 instGenNdx, instModNdx; }
type tsf_hydra_imod (line 360) | struct tsf_hydra_imod { tsf_u16 modSrcOper, modDestOper; tsf_s16 modAmou...
type tsf_hydra_igen (line 361) | struct tsf_hydra_igen { tsf_u16 genOper; union tsf_hydra_genamount genAm...
type tsf_hydra_shdr (line 362) | struct tsf_hydra_shdr { tsf_char20 sampleName; tsf_u32 start, end, start...
function tsf_hydra_read_phdr (line 365) | static void tsf_hydra_read_phdr(struct tsf_hydra_phdr* i, struct tsf_str...
type tsf_hydra_pbag (line 366) | struct tsf_hydra_pbag
type tsf_stream (line 366) | struct tsf_stream
function TSFR (line 366) | TSFR(genNdx) TSFR(modNdx) }
function tsf_timecents2Secsf (line 434) | static float tsf_timecents2Secsf(float timecents) { return TSF_POWF(2.0f...
function tsf_cents2Hertz (line 435) | static float tsf_cents2Hertz(float cents) { return 8.176f * TSF_POWF(2.0...
function tsf_decibelsToGain (line 436) | static float tsf_decibelsToGain(float db) { return (db > -100.f ? TSF_PO...
function tsf_gainToDecibels (line 437) | static float tsf_gainToDecibels(float gain) { return (gain <= .00001f ? ...
function TSF_BOOL (line 439) | static TSF_BOOL tsf_riffchunk_read(struct tsf_riffchunk* parent, struct ...
function tsf_region_clear (line 455) | static void tsf_region_clear(struct tsf_region* i, TSF_BOOL for_relative)
function tsf_region_operator (line 476) | static void tsf_region_operator(struct tsf_region* region, tsf_u16 genOp...
function tsf_region_envtosecs (line 541) | static void tsf_region_envtosecs(struct tsf_envelope* p, TSF_BOOL sustai...
function tsf_load_presets (line 560) | static void tsf_load_presets(tsf* res, struct tsf_hydra *hydra, unsigned...
function tsf_load_samples (line 743) | static void tsf_load_samples(float** fontSamples, unsigned int* fontSamp...
function tsf_voice_envelope_nextsegment (line 762) | static void tsf_voice_envelope_nextsegment(struct tsf_voice_envelope* e,...
function tsf_voice_envelope_setup (line 867) | static void tsf_voice_envelope_setup(struct tsf_voice_envelope* e, struc...
function tsf_voice_envelope_process (line 885) | static void tsf_voice_envelope_process(struct tsf_voice_envelope* e, int...
function tsf_voice_lowpass_setup (line 896) | static void tsf_voice_lowpass_setup(struct tsf_voice_lowpass* e, float Fc)
function tsf_voice_lowpass_process (line 907) | static float tsf_voice_lowpass_process(struct tsf_voice_lowpass* e, doub...
function tsf_voice_lfo_setup (line 912) | static void tsf_voice_lfo_setup(struct tsf_voice_lfo* e, float delay, in...
function tsf_voice_lfo_process (line 919) | static void tsf_voice_lfo_process(struct tsf_voice_lfo* e, int blockSamp...
function tsf_voice_kill (line 927) | static void tsf_voice_kill(struct tsf_voice* v)
function tsf_voice_end (line 932) | static void tsf_voice_end(struct tsf_voice* v, float outSampleRate)
function tsf_voice_endquick (line 943) | static void tsf_voice_endquick(struct tsf_voice* v, float outSampleRate)
function tsf_voice_calcpitchratio (line 949) | static void tsf_voice_calcpitchratio(struct tsf_voice* v, float pitchShi...
function tsf_voice_render (line 958) | static void tsf_voice_render(tsf* f, struct tsf_voice* v, float* outputB...
function TSFDEF (line 1098) | TSFDEF tsf* tsf_load(struct tsf_stream* stream)
function TSFDEF (line 1181) | TSFDEF void tsf_close(tsf* f)
function TSFDEF (line 1195) | TSFDEF void tsf_reset(tsf* f)
function TSFDEF (line 1204) | TSFDEF int tsf_get_presetindex(const tsf* f, int bank, int preset_number)
function TSFDEF (line 1214) | TSFDEF int tsf_get_presetcount(const tsf* f)
function TSFDEF (line 1219) | TSFDEF const char* tsf_get_presetname(const tsf* f, int preset)
function TSFDEF (line 1224) | TSFDEF const char* tsf_bank_get_presetname(const tsf* f, int bank, int p...
function TSFDEF (line 1229) | TSFDEF void tsf_set_output(tsf* f, enum TSFOutputMode outputmode, int sa...
function TSFDEF (line 1236) | TSFDEF void tsf_note_on(tsf* f, int preset_index, int key, float vel)
function TSFDEF (line 1312) | TSFDEF int tsf_bank_note_on(tsf* f, int bank, int preset_number, int key...
function TSFDEF (line 1320) | TSFDEF void tsf_note_off(tsf* f, int preset_index, int key)
function TSFDEF (line 1340) | TSFDEF int tsf_bank_note_off(tsf* f, int bank, int preset_number, int key)
function TSFDEF (line 1348) | TSFDEF void tsf_note_off_all(tsf* f, int quick)
function TSFDEF (line 1363) | TSFDEF int tsf_active_voice_count(tsf* f)
function TSFDEF (line 1371) | TSFDEF void tsf_render_short(tsf* f, short* buffer, int samples, int fla...
function TSFDEF (line 1401) | TSFDEF void tsf_render_float(tsf* f, float* buffer, int samples, int fla...
function tsf_channel_setup_voice (line 1410) | static void tsf_channel_setup_voice(tsf* f, struct tsf_voice* v)
type tsf_channel (line 1422) | struct tsf_channel
type tsf_channels (line 1428) | struct tsf_channels
type tsf_channels (line 1428) | struct tsf_channels
type tsf_channel (line 1436) | struct tsf_channel
type tsf_channel (line 1436) | struct tsf_channel
type tsf_channel (line 1439) | struct tsf_channel
function tsf_channel_applypitch (line 1453) | static void tsf_channel_applypitch(tsf* f, int channel, struct tsf_chann...
function TSFDEF (line 1462) | TSFDEF void tsf_channel_set_presetindex(tsf* f, int channel, int preset_...
function TSFDEF (line 1467) | TSFDEF int tsf_channel_set_presetnumber(tsf* f, int channel, int preset_...
function TSFDEF (line 1488) | TSFDEF void tsf_channel_set_bank(tsf* f, int channel, int bank)
function TSFDEF (line 1493) | TSFDEF int tsf_channel_set_bank_preset(tsf* f, int channel, int bank, in...
function TSFDEF (line 1503) | TSFDEF void tsf_channel_set_pan(tsf* f, int channel, float pan)
function TSFDEF (line 1517) | TSFDEF void tsf_channel_set_volume(tsf* f, int channel, float volume)
function TSFDEF (line 1529) | TSFDEF void tsf_channel_set_pitchwheel(tsf* f, int channel, int pitch_wh...
function TSFDEF (line 1537) | TSFDEF void tsf_channel_set_pitchrange(tsf* f, int channel, float pitch_...
function TSFDEF (line 1545) | TSFDEF void tsf_channel_set_tuning(tsf* f, int channel, float tuning)
function TSFDEF (line 1553) | TSFDEF void tsf_channel_note_on(tsf* f, int channel, int key, float vel)
function TSFDEF (line 1560) | TSFDEF void tsf_channel_note_off(tsf* f, int channel, int key)
function TSFDEF (line 1580) | TSFDEF void tsf_channel_note_off_all(tsf* f, int channel)
function TSFDEF (line 1588) | TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel)
function TSFDEF (line 1596) | TSFDEF void tsf_channel_midi_control(tsf* f, int channel, int controller...
function TSFDEF (line 1641) | TSFDEF int tsf_channel_get_preset_index(tsf* f, int channel)
function TSFDEF (line 1646) | TSFDEF int tsf_channel_get_preset_bank(tsf* f, int channel)
function TSFDEF (line 1651) | TSFDEF int tsf_channel_get_preset_number(tsf* f, int channel)
function TSFDEF (line 1656) | TSFDEF float tsf_channel_get_pan(tsf* f, int channel)
function TSFDEF (line 1661) | TSFDEF float tsf_channel_get_volume(tsf* f, int channel)
function TSFDEF (line 1666) | TSFDEF int tsf_channel_get_pitchwheel(tsf* f, int channel)
function TSFDEF (line 1671) | TSFDEF float tsf_channel_get_pitchrange(tsf* f, int channel)
function TSFDEF (line 1676) | TSFDEF float tsf_channel_get_tuning(tsf* f, int channel)
FILE: deps/include/TracyC.h
type TracyPlotFormatEnum (line 26) | enum TracyPlotFormatEnum
type ___tracy_source_location_data (line 147) | struct ___tracy_source_location_data
type ___tracy_c_zone_context (line 156) | struct ___tracy_c_zone_context
type ___tracy_gpu_time_data (line 162) | struct ___tracy_gpu_time_data
type ___tracy_gpu_zone_begin_data (line 169) | struct ___tracy_gpu_zone_begin_data {
type ___tracy_gpu_zone_begin_callstack_data (line 175) | struct ___tracy_gpu_zone_begin_callstack_data {
type ___tracy_gpu_zone_end_data (line 182) | struct ___tracy_gpu_zone_end_data {
type ___tracy_gpu_new_context_data (line 187) | struct ___tracy_gpu_new_context_data {
type ___tracy_gpu_context_name_data (line 195) | struct ___tracy_gpu_context_name_data {
type ___tracy_gpu_calibration_data (line 201) | struct ___tracy_gpu_calibration_data {
type ___tracy_gpu_time_sync_data (line 207) | struct ___tracy_gpu_time_sync_data {
type __tracy_lockable_context_data (line 212) | struct __tracy_lockable_context_data
type TracyCZoneCtx (line 216) | typedef /*const*/ struct ___tracy_c_zone_context TracyCZoneCtx;
type __tracy_lockable_context_data (line 218) | struct __tracy_lockable_context_data
type ___tracy_source_location_data (line 233) | struct ___tracy_source_location_data
type ___tracy_source_location_data (line 234) | struct ___tracy_source_location_data
type ___tracy_gpu_zone_begin_data (line 243) | struct ___tracy_gpu_zone_begin_data
type ___tracy_gpu_zone_begin_callstack_data (line 244) | struct ___tracy_gpu_zone_begin_callstack_data
type ___tracy_gpu_zone_begin_data (line 245) | struct ___tracy_gpu_zone_begin_data
type ___tracy_gpu_zone_begin_callstack_data (line 246) | struct ___tracy_gpu_zone_begin_callstack_data
type ___tracy_gpu_zone_end_data (line 247) | struct ___tracy_gpu_zone_end_data
type ___tracy_gpu_time_data (line 248) | struct ___tracy_gpu_time_data
type ___tracy_gpu_new_context_data (line 249) | struct ___tracy_gpu_new_context_data
type ___tracy_gpu_context_name_data (line 250) | struct ___tracy_gpu_context_name_data
type ___tracy_gpu_calibration_data (line 251) | struct ___tracy_gpu_calibration_data
type ___tracy_gpu_time_sync_data (line 252) | struct ___tracy_gpu_time_sync_data
type ___tracy_gpu_zone_begin_data (line 254) | struct ___tracy_gpu_zone_begin_data
type ___tracy_gpu_zone_begin_callstack_data (line 255) | struct ___tracy_gpu_zone_begin_callstack_data
type ___tracy_gpu_zone_begin_data (line 256) | struct ___tracy_gpu_zone_begin_data
type ___tracy_gpu_zone_begin_callstack_data (line 257) | struct ___tracy_gpu_zone_begin_callstack_data
type ___tracy_gpu_zone_end_data (line 258) | struct ___tracy_gpu_zone_end_data
type ___tracy_gpu_time_data (line 259) | struct ___tracy_gpu_time_data
type ___tracy_gpu_new_context_data (line 260) | struct ___tracy_gpu_new_context_data
type ___tracy_gpu_context_name_data (line 261) | struct ___tracy_gpu_context_name_data
type ___tracy_gpu_calibration_data (line 262) | struct ___tracy_gpu_calibration_data
type ___tracy_gpu_time_sync_data (line 263) | struct ___tracy_gpu_time_sync_data
type ___tracy_source_location_data (line 366) | struct ___tracy_source_location_data
type __tracy_lockable_context_data (line 367) | struct __tracy_lockable_context_data
type __tracy_lockable_context_data (line 368) | struct __tracy_lockable_context_data
type __tracy_lockable_context_data (line 369) | struct __tracy_lockable_context_data
type __tracy_lockable_context_data (line 370) | struct __tracy_lockable_context_data
type __tracy_lockable_context_data (line 371) | struct __tracy_lockable_context_data
type __tracy_lockable_context_data (line 372) | struct __tracy_lockable_context_data
type ___tracy_source_location_data (line 372) | struct ___tracy_source_location_data
type __tracy_lockable_context_data (line 373) | struct __tracy_lockable_context_data
FILE: deps/include/shl/flic.h
type Flic (line 78) | typedef struct _Flic {
type FlicFrame (line 90) | typedef struct _FlicFrame {
function flic__read8 (line 109) | static inline uint8_t flic__read8(FILE* file)
function flic__write8 (line 114) | static inline void flic__write8(FILE* file, uint8_t value)
function flic__read16 (line 119) | static inline uint16_t flic__read16(FILE* file)
function flic__read32 (line 129) | static inline uint32_t flic__read32(FILE* file)
function flic__tell (line 143) | static inline size_t flic__tell(FILE* file)
function flic__seek (line 148) | static inline void flic__seek(FILE* file, size_t pos)
function flic__readBlackChunk (line 153) | static void flic__readBlackChunk(Flic* flic, FlicFrame* frame)
function flic__readCopyChunk (line 158) | static void flic__readCopyChunk(Flic* flic, FlicFrame* frame)
function flic__readColorChunk (line 168) | static void flic__readColorChunk(Flic* flic, FlicFrame* frame, bool is64...
function flic__readBrunChunk (line 201) | static void flic__readBrunChunk(Flic* flic, FlicFrame* frame)
function flic__readLcChunk (line 229) | static void flic__readLcChunk(Flic* flic, FlicFrame* frame)
function flic__readDeltaChunk (line 264) | static void flic__readDeltaChunk(Flic* flic, FlicFrame* frame)
function flic__readChunk (line 341) | static void flic__readChunk(Flic* flic, FlicFrame* frame)
function flicOpen (line 377) | bool flicOpen(Flic* flic, const char* filename)
function flicClose (line 429) | void flicClose(Flic* flic)
function flicReadFrame (line 438) | bool flicReadFrame(Flic* flic, FlicFrame* frame)
function flicMakeImage (line 478) | void flicMakeImage(Flic* flic, FlicFrame* frame, uint8_t* image)
FILE: deps/include/shl/memory_buffer.h
type memory_buffer_t (line 64) | typedef struct _memory_buffer_t memory_buffer_t;
type _memory_buffer_t (line 125) | struct _memory_buffer_t
function mb__realloc (line 132) | static bool mb__realloc(memory_buffer_t* buffer, size_t newLength)
function mb_initEmpty (line 158) | void mb_initEmpty(memory_buffer_t* buffer)
function mb_initFromMemory (line 165) | void mb_initFromMemory(memory_buffer_t* buffer, uint8_t* data, size_t le...
function mb_free (line 172) | void mb_free(memory_buffer_t* buffer)
function mb_seek (line 190) | bool mb_seek(memory_buffer_t* buffer, uint32_t position)
function mb_skip (line 202) | bool mb_skip(memory_buffer_t* buffer, int32_t distance)
function mb_scanTo (line 217) | bool mb_scanTo(memory_buffer_t* buffer, const void* data, size_t length)
function mb_read (line 231) | bool mb_read(memory_buffer_t* buffer, uint8_t* value)
function mb_readBytes (line 236) | bool mb_readBytes(memory_buffer_t* buffer, uint8_t* values, size_t count)
function mb_readString (line 246) | bool mb_readString(memory_buffer_t* buffer, char* str, size_t count)
function mb_readInt16LE (line 251) | bool mb_readInt16LE(memory_buffer_t* buffer, int16_t* value)
function mb_readInt16BE (line 263) | bool mb_readInt16BE(memory_buffer_t* buffer, int16_t* value)
function mb_readUInt16LE (line 275) | bool mb_readUInt16LE(memory_buffer_t* buffer, uint16_t* value)
function mb_readUInt16BE (line 287) | bool mb_readUInt16BE(memory_buffer_t* buffer, uint16_t* value)
function mb_readInt24LE (line 299) | bool mb_readInt24LE(memory_buffer_t* buffer, int32_t* value)
function mb_readInt24BE (line 311) | bool mb_readInt24BE(memory_buffer_t* buffer, int32_t* value)
function mb_readUInt24LE (line 323) | bool mb_readUInt24LE(memory_buffer_t* buffer, uint32_t* value)
function mb_readUInt24BE (line 335) | bool mb_readUInt24BE(memory_buffer_t* buffer, uint32_t* value)
function mb_readInt32LE (line 347) | bool mb_readInt32LE(memory_buffer_t* buffer, int32_t* value)
function mb_readInt32BE (line 359) | bool mb_readInt32BE(memory_buffer_t* buffer, int32_t* value)
function mb_readUInt32LE (line 371) | bool mb_readUInt32LE(memory_buffer_t* buffer, uint32_t* value)
function mb_readUInt32BE (line 383) | bool mb_readUInt32BE(memory_buffer_t* buffer, uint32_t* value)
function mb_write (line 395) | bool mb_write(memory_buffer_t* buffer, uint8_t value)
function mb_writeBytes (line 400) | bool mb_writeBytes(memory_buffer_t* buffer, uint8_t values[], size_t count)
function mb_writeString (line 414) | bool mb_writeString(memory_buffer_t* buffer, const char* str, size_t count)
function mb_writeInt16LE (line 419) | bool mb_writeInt16LE(memory_buffer_t* buffer, int16_t value)
function mb_writeInt16BE (line 431) | bool mb_writeInt16BE(memory_buffer_t* buffer, int16_t value)
function mb_writeUInt16LE (line 443) | bool mb_writeUInt16LE(memory_buffer_t* buffer, uint16_t value)
function mb_writeUInt16BE (line 455) | bool mb_writeUInt16BE(memory_buffer_t* buffer, uint16_t value)
function mb_writeInt24LE (line 467) | bool mb_writeInt24LE(memory_buffer_t* buffer, int32_t value)
function mb_writeInt24BE (line 480) | bool mb_writeInt24BE(memory_buffer_t* buffer, int32_t value)
function mb_writeUInt24LE (line 493) | bool mb_writeUInt24LE(memory_buffer_t* buffer, uint32_t value)
function mb_writeUInt24BE (line 506) | bool mb_writeUInt24BE(memory_buffer_t* buffer, uint32_t value)
function mb_writeInt32LE (line 519) | bool mb_writeInt32LE(memory_buffer_t* buffer, int32_t value)
function mb_writeInt32BE (line 533) | bool mb_writeInt32BE(memory_buffer_t* buffer, int32_t value)
function mb_writeUInt32LE (line 547) | bool mb_writeUInt32LE(memory_buffer_t* buffer, uint32_t value)
function mb_writeUInt32BE (line 561) | bool mb_writeUInt32BE(memory_buffer_t* buffer, uint32_t value)
function mb_isEOF (line 575) | bool mb_isEOF(memory_buffer_t* buffer)
FILE: deps/include/shl/memzone.h
type memzone_t (line 66) | typedef struct memzone_s memzone_t;
type mz_report_t (line 68) | typedef enum
type memblock_t (line 78) | typedef struct memblock_s
type memzone_s (line 85) | struct memzone_s
type memblock_t (line 147) | typedef struct memblock_s
type memzone_s (line 154) | struct memzone_s
function mz__alignUp (line 171) | static bool mz__alignUp(size_t value, size_t alignment, size_t* alignedV...
function mz__isPowerOfTwo (line 201) | static bool mz__isPowerOfTwo(size_t value)
function mz__isSupportedAlignment (line 206) | static bool mz__isSupportedAlignment(size_t alignment)
function mz__stderrReporter (line 232) | static void mz__stderrReporter(const memzone_t* zone, mz_report_t report...
function mz__report (line 255) | static void mz__report(const memzone_t* zone, mz_report_t report, const ...
function mz__validationFailure (line 265) | static bool mz__validationFailure(const memzone_t* zone, const void* con...
function mz__debugAssertValid (line 271) | static void mz__debugAssertValid(const memzone_t* zone)
function mz__headerSize (line 280) | static size_t mz__headerSize(void)
function mz__zoneBaseSize (line 289) | static size_t mz__zoneBaseSize(void)
function mz__payloadSize (line 294) | static size_t mz__payloadSize(const memblock_t* block)
function mz__allocationSize (line 304) | static size_t mz__allocationSize(const memblock_t* block)
function mz__isNextBlockAdjacent (line 314) | static bool mz__isNextBlockAdjacent(const memblock_t* block)
function mz__isPrevBlockAdjacent (line 319) | static bool mz__isPrevBlockAdjacent(const memblock_t* block)
function memblock_t (line 324) | static const memblock_t* mz__findBlock(const memzone_t* zone, const void...
function mz_alignment (line 345) | size_t mz_alignment(void)
function mz_maxSize (line 350) | size_t mz_maxSize(const memzone_t* zone)
function mz_usedSize (line 355) | size_t mz_usedSize(const memzone_t* zone)
function memzone_t (line 360) | memzone_t* mz_init(size_t maxSize)
function mz_destroy (line 394) | void mz_destroy(memzone_t* zone)
function mz_reset (line 399) | void mz_reset(memzone_t* zone)
function mz_setReporter (line 421) | void mz_setReporter(memzone_t* zone, mz_reporter_t reporter, void* userD...
function mz_free (line 560) | void mz_free(memzone_t* zone, void* p)
function mz_contains (line 709) | bool mz_contains(const memzone_t* zone, const void* p)
function mz_allocationSize (line 714) | size_t mz_allocationSize(const memzone_t* zone, const void* p)
function mz_validate (line 720) | bool mz_validate(const memzone_t* zone)
function mz_blockCount (line 854) | int32_t mz_blockCount(const memzone_t* zone)
function mz_usableFreeSize (line 873) | size_t mz_usableFreeSize(const memzone_t* zone)
function mz_fragmentation (line 896) | float mz_fragmentation(const memzone_t* zone)
FILE: deps/include/shl/memzone_audit.h
type mz_audit_format_t (line 73) | typedef enum
type mz__audit_state_t (line 158) | typedef struct
function mz__audit_state_t (line 169) | static mz__audit_state_t* mz__audit_find(const memzone_t* zone)
function mz__audit_state_t (line 179) | static mz__audit_state_t* mz__audit_acquire(memzone_t* zone, mz_audit_fo...
function mz__audit_release (line 218) | static void mz__audit_release(mz__audit_state_t* s)
function mz__audit_timestamp (line 242) | static void mz__audit_timestamp(char* buf, size_t sz)
function mz__audit_open (line 271) | static void mz__audit_open(mz__audit_state_t* s)
function mz__audit_zone_state (line 308) | static void mz__audit_zone_state(const memzone_t* zone, char* buf, size_...
function mz__audit_live_count (line 334) | static int32_t mz__audit_live_count(const memzone_t* zone)
function mz__audit_block_list (line 349) | static void mz__audit_block_list(FILE* fp, const memzone_t* zone)
function mz__audit_verbose_sep (line 387) | static void mz__audit_verbose_sep(FILE* fp)
function mz__audit_verbose_div (line 393) | static void mz__audit_verbose_div(FILE* fp)
function mz__audit_verbose_open (line 399) | static void mz__audit_verbose_open(FILE* fp, uint32_t seq, const char* op,
function mz__audit_verbose_close (line 407) | static void mz__audit_verbose_close(FILE* fp, const memzone_t* zone)
function memzone_t (line 424) | memzone_t* mz__audit_init(size_t maxSize, const char* file, int line)
function memzone_t (line 430) | memzone_t* mz__audit_initWithLog(size_t maxSize, mz_audit_format_t format,
function mz__audit_destroy (line 474) | void mz__audit_destroy(memzone_t* zone, const char* file, int line)
function mz__audit_reset (line 518) | void mz__audit_reset(memzone_t* zone, const char* file, int line)
function mz__audit_free (line 647) | void mz__audit_free(memzone_t* zone, void* p, const char* file, int line)
function mz_auditConfigure (line 807) | void mz_auditConfigure(memzone_t* zone, mz_audit_format_t format, const ...
function mz_auditFlush (line 816) | void mz_auditFlush(memzone_t* zone)
function mz_auditClose (line 823) | void mz_auditClose(memzone_t* zone)
FILE: deps/include/shl/shl_internal.h
function shl__grownCapacity (line 32) | static inline int32_t shl__grownCapacity(int32_t currentCapacity, int32_...
function shl__resizeArray (line 42) | static inline void shl__resizeArray(void** items, int32_t* capacity, int...
function shl__resizeCircularArray (line 48) | static inline void shl__resizeCircularArray(void** items, int32_t* capac...
function shl__fibHash (line 79) | static inline int32_t shl__fibHash(uint32_t hash, int32_t shift)
function shl__findEmptyBucket (line 85) | static inline int32_t shl__findEmptyBucket(const void* entries, int32_t ...
FILE: deps/include/shl/wav.h
type wav_sample_t (line 66) | typedef short wav_sample_t;
type wav_file_t (line 67) | typedef struct _wav_file_t wav_file_t;
type _wav_file_t (line 89) | struct _wav_file_t
function wav__flushBuffer (line 99) | static bool wav__flushBuffer(wav_file_t* waveFile)
function wav_init (line 109) | bool wav_init(wav_file_t* waveFile, long sampleRate, const char* filename)
function wav_stereo (line 133) | void wav_stereo(wav_file_t* waveFile, bool stereo)
function wav_sampleCount (line 138) | long wav_sampleCount(wav_file_t* waveFile)
function wav_write (line 143) | bool wav_write(wav_file_t* waveFile, const wav_sample_t* in, long count,...
function wav_flush (line 173) | bool wav_flush(wav_file_t* waveFile, bool closeFile)
FILE: deps/include/shl/wstr.h
type StringView (line 90) | typedef struct
type String (line 96) | typedef struct
function wstr__toLowerAscii (line 216) | static char wstr__toLowerAscii(char c)
function wsv__containsChar (line 221) | static bool wsv__containsChar(StringView chars, char c)
function wstr__isAliased (line 234) | static bool wstr__isAliased(const String* string, StringView view)
function wstr__grow (line 246) | static bool wstr__grow(String* string, size_t minCapacity)
function wstr__appendFormatAt (line 295) | static bool wstr__appendFormatAt(String* string, size_t offset, const ch...
function wsv__tryParseInteger (line 334) | static bool wsv__tryParseInteger(StringView view, int64_t minValue, int6...
function StringView (line 452) | StringView wsv_empty(void)
function StringView (line 457) | StringView wsv_fromCString(const char* text)
function StringView (line 467) | StringView wsv_fromParts(const char* text, size_t length)
function StringView (line 477) | StringView wsv_fromRange(const char* begin, const char* end)
function StringView (line 487) | StringView wsv_fromString(const String* string)
function wsv_isEmpty (line 497) | bool wsv_isEmpty(StringView view)
function wsv_length (line 507) | size_t wsv_length(StringView view)
function StringView (line 512) | StringView wsv_slice(StringView view, size_t index, size_t length)
function StringView (line 528) | StringView wsv_subview(StringView view, size_t index)
function StringView (line 538) | StringView wsv_trimLeft(StringView view)
function StringView (line 549) | StringView wsv_trimRight(StringView view)
function StringView (line 559) | StringView wsv_trim(StringView view)
function wsv_equals (line 564) | bool wsv_equals(StringView left, StringView right)
function wsv_equalsIgnoreCase (line 579) | bool wsv_equalsIgnoreCase(StringView left, StringView right)
function wsv_startsWith (line 597) | bool wsv_startsWith(StringView view, StringView prefix)
function wsv_startsWithIgnoreCase (line 602) | bool wsv_startsWithIgnoreCase(StringView view, StringView prefix)
function wsv_findChar (line 607) | size_t wsv_findChar(StringView view, char c)
function wsv_find (line 620) | size_t wsv_find(StringView view, StringView needle)
function wsv_findAny (line 644) | size_t wsv_findAny(StringView view, StringView chars)
function StringView (line 657) | StringView wsv_skipChars(StringView view, StringView chars)
function StringView (line 668) | StringView wsv_takeUntilAny(StringView view, StringView chars)
function wsv_splitOnce (line 679) | bool wsv_splitOnce(StringView view, StringView separator, StringView* le...
function StringView (line 706) | StringView wsv_chopByDelimiter(StringView* remaining, char delimiter)
function wsv_nextToken (line 726) | bool wsv_nextToken(StringView* remaining, StringView separators, StringV...
function wsv_hashFNV32 (line 753) | uint32_t wsv_hashFNV32(StringView view)
function wsv_parseS32 (line 764) | int32_t wsv_parseS32(StringView view)
function wsv_tryParseS32 (line 771) | bool wsv_tryParseS32(StringView view, int32_t* value)
function wsv_parseS64 (line 787) | int64_t wsv_parseS64(StringView view)
function wsv_tryParseS64 (line 794) | bool wsv_tryParseS64(StringView view, int64_t* value)
function wsv_copyToBuffer (line 810) | bool wsv_copyToBuffer(StringView view, char* buffer, size_t capacity)
function String (line 831) | String wsv_toString(StringView view)
function StringView (line 836) | StringView wsv_fromCStringFormatv(char* buffer, size_t capacity, const c...
function StringView (line 854) | StringView wsv_fromCStringFormat(char* buffer, size_t capacity, const ch...
function String (line 865) | String wstr_make(void)
function String (line 870) | String wstr_withCapacity(size_t capacity)
function String (line 877) | String wstr_fromCString(const char* text)
function String (line 882) | String wstr_fromCStringFormat(const char* textFormat, ...)
function String (line 891) | String wstr_fromCStringFormatv(const char* textFormat, va_list args)
function String (line 901) | String wstr_fromView(StringView view)
function String (line 908) | String wstr_concat(StringView left, StringView right)
function String (line 940) | String wstr_adopt(char* buffer, size_t length, size_t capacity)
function wstr_freePtr (line 956) | void wstr_freePtr(String* string)
function wstr_free (line 971) | void wstr_free(String string)
function wstr_clear (line 979) | void wstr_clear(String* string)
function StringView (line 993) | StringView wstr_view(const String* string)
function wstr_isEmpty (line 1003) | bool wstr_isEmpty(const String* string)
function wstr_reserve (line 1008) | bool wstr_reserve(String* string, size_t capacity)
function wstr_resize (line 1013) | bool wstr_resize(String* string, size_t length)
function String (line 1039) | String wstr_copy(const String* string)
function wstr_assign (line 1049) | bool wstr_assign(String* string, StringView view)
function wstr_assignCString (line 1078) | bool wstr_assignCString(String* string, const char* text)
function wstr_assignCStringFormat (line 1083) | bool wstr_assignCStringFormat(String* string, const char* textFormat, ...)
function wstr_assignCStringFormatv (line 1092) | bool wstr_assignCStringFormatv(String* string, const char* textFormat, v...
function wstr_append (line 1097) | bool wstr_append(String* string, StringView view)
function wstr_appendCString (line 1128) | bool wstr_appendCString(String* string, const char* text)
function wstr_appendCStringFormat (line 1133) | bool wstr_appendCStringFormat(String* string, const char* textFormat, ...)
function wstr_appendCStringFormatv (line 1142) | bool wstr_appendCStringFormatv(String* string, const char* textFormat, v...
function wstr_appendChar (line 1147) | bool wstr_appendChar(String* string, char c)
function wstr_insert (line 1152) | bool wstr_insert(String* string, size_t index, StringView view)
function wstr_removeRange (line 1187) | bool wstr_removeRange(String* string, size_t index, size_t length)
function wstr_setFormat (line 1213) | bool wstr_setFormat(String* string, const char* fmt, ...)
function wstr_setFormatv (line 1222) | bool wstr_setFormatv(String* string, const char* fmt, va_list args)
function wstr_appendFormat (line 1233) | bool wstr_appendFormat(String* string, const char* fmt, ...)
function wstr_appendFormatv (line 1242) | bool wstr_appendFormatv(String* string, const char* fmt, va_list args)
FILE: deps/include/stb/stb_image.h
type stbi_uc (line 387) | typedef unsigned char stbi_uc;
type stbi_us (line 388) | typedef unsigned short stbi_us;
type stbi_io_callbacks (line 411) | typedef struct
type stbi__uint16 (line 642) | typedef unsigned short stbi__uint16;
type stbi__int16 (line 643) | typedef signed short stbi__int16;
type stbi__uint32 (line 644) | typedef unsigned int stbi__uint32;
type stbi__int32 (line 645) | typedef signed int stbi__int32;
type stbi__uint16 (line 648) | typedef uint16_t stbi__uint16;
type stbi__int16 (line 649) | typedef int16_t stbi__int16;
type stbi__uint32 (line 650) | typedef uint32_t stbi__uint32;
type stbi__int32 (line 651) | typedef int32_t stbi__int32;
function stbi__cpuid3 (line 732) | static int stbi__cpuid3(void)
function stbi__sse2_available (line 754) | static int stbi__sse2_available(void)
function stbi__sse2_available (line 765) | static int stbi__sse2_available(void)
type stbi__context (line 805) | typedef struct
function stbi__start_mem (line 826) | static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int...
function stbi__start_callbacks (line 836) | static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c...
function stbi__stdio_read (line 850) | static int stbi__stdio_read(void *user, char *data, int size)
function stbi__stdio_skip (line 855) | static void stbi__stdio_skip(void *user, int n)
function stbi__stdio_eof (line 865) | static int stbi__stdio_eof(void *user)
function stbi__start_file (line 877) | static void stbi__start_file(stbi__context *s, FILE *f)
function stbi__rewind (line 886) | static void stbi__rewind(stbi__context *s)
type stbi__result_info (line 901) | typedef struct
function STBIDEF (line 972) | STBIDEF const char *stbi_failure_reason(void)
function stbi__err (line 978) | static int stbi__err(const char *str)
function stbi__addsizes_valid (line 1002) | static int stbi__addsizes_valid(int a, int b)
function stbi__mul2sizes_valid (line 1014) | static int stbi__mul2sizes_valid(int a, int b)
function stbi__mad2sizes_valid (line 1024) | static int stbi__mad2sizes_valid(int a, int b, int add)
function stbi__mad3sizes_valid (line 1031) | static int stbi__mad3sizes_valid(int a, int b, int c, int add)
function stbi__mad4sizes_valid (line 1039) | static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)
function stbi__addints_valid (line 1070) | static int stbi__addints_valid(int a, int b)
function stbi__mul2shorts_valid (line 1078) | static int stbi__mul2shorts_valid(int a, int b)
function STBIDEF (line 1101) | STBIDEF void stbi_image_free(void *retval_from_stbi_load)
function STBIDEF (line 1116) | STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
function STBIDEF (line 1126) | STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_sh...
function stbi_uc (line 1190) | static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, ...
function stbi__uint16 (line 1206) | static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, ...
function stbi__vertical_flip (line 1222) | static void stbi__vertical_flip(void *image, int w, int h, int bytes_per...
function stbi__vertical_flip_slices (line 1247) | static void stbi__vertical_flip_slices(void *image, int w, int h, int z,...
function stbi__uint16 (line 1286) | static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, ...
function stbi__float_postprocess (line 1314) | static void stbi__float_postprocess(float *result, int *x, int *y, int *...
function STBIDEF (line 1331) | STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, c...
function FILE (line 1337) | static FILE *stbi__fopen(char const *filename, char const *mode)
function STBIDEF (line 1366) | STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *co...
function STBIDEF (line 1376) | STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp,...
function STBIDEF (line 1389) | STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, in...
function STBIDEF (line 1402) | STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int ...
function STBIDEF (line 1415) | STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len...
function STBIDEF (line 1422) | STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *cl...
function STBIDEF (line 1429) | STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, i...
function STBIDEF (line 1436) | STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk,...
function STBIDEF (line 1444) | STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int le...
function STBIDEF (line 1478) | STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, in...
function STBIDEF (line 1485) | STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, ...
function STBIDEF (line 1493) | STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *com...
function STBIDEF (line 1503) | STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, ...
function STBIDEF (line 1517) | STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
function STBIDEF (line 1531) | STBIDEF int stbi_is_hdr (char const *filename)
function STBIDEF (line 1542) | STBIDEF int stbi_is_hdr_from_file(FILE *f)
function STBIDEF (line 1559) | STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clb...
function STBIDEF (line 1575) | STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = ga...
function STBIDEF (line 1576) | STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = sc...
function STBIDEF (line 1581) | STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = ...
function STBIDEF (line 1582) | STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = ...
function stbi__refill_buffer (line 1597) | static void stbi__refill_buffer(stbi__context *s)
function stbi_inline (line 1614) | stbi_inline static stbi_uc stbi__get8(stbi__context *s)
function stbi_inline (line 1628) | stbi_inline static int stbi__at_eof(stbi__context *s)
function stbi__skip (line 1644) | static void stbi__skip(stbi__context *s, int n)
function stbi__getn (line 1666) | static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
function stbi__get16be (line 1694) | static int stbi__get16be(stbi__context *s)
function stbi__uint32 (line 1704) | static stbi__uint32 stbi__get32be(stbi__context *s)
function stbi__get16le (line 1714) | static int stbi__get16le(stbi__context *s)
function stbi__uint32 (line 1722) | static stbi__uint32 stbi__get32le(stbi__context *s)
function stbi_uc (line 1746) | static stbi_uc stbi__compute_y(int r, int g, int b)
function stbi__uint16 (line 1803) | static stbi__uint16 stbi__compute_y_16(int r, int g, int b)
function stbi__uint16 (line 1812) | static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_...
function stbi_uc (line 1884) | static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
type stbi__huffman (line 1938) | typedef struct
type stbi__jpeg (line 1949) | typedef struct
function stbi__build_huffman (line 2003) | static int stbi__build_huffman(stbi__huffman *h, int *count)
function stbi__build_fast_ac (line 2050) | static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
function stbi__grow_buffer_unsafe (line 2075) | static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
function stbi_inline (line 2097) | stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffm...
function stbi_inline (line 2153) | stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
function stbi_inline (line 2169) | stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
function stbi_inline (line 2181) | stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
function stbi__jpeg_decode_block (line 2210) | static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__...
function stbi__jpeg_decode_block_prog_dc (line 2265) | static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64]...
function stbi__jpeg_decode_block_prog_ac (line 2295) | static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64]...
function stbi_inline (line 2416) | stbi_inline static stbi_uc stbi__clamp(int x)
function stbi__idct_block (line 2467) | static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
function stbi__idct_simd (line 2530) | static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
function stbi__idct_simd (line 2711) | static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
function stbi_uc (line 2919) | static stbi_uc stbi__get_marker(stbi__jpeg *j)
function stbi__jpeg_reset (line 2936) | static void stbi__jpeg_reset(stbi__jpeg *j)
function stbi__parse_entropy_coded_data (line 2949) | static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
function stbi__jpeg_dequantize (line 3073) | static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant)
function stbi__jpeg_finish (line 3080) | static void stbi__jpeg_finish(stbi__jpeg *z)
function stbi__process_marker (line 3099) | static int stbi__process_marker(stbi__jpeg *z, int m)
function stbi__process_scan_header (line 3203) | static int stbi__process_scan_header(stbi__jpeg *z)
function stbi__free_jpeg_components (line 3242) | static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why)
function stbi__process_frame_header (line 3264) | static int stbi__process_frame_header(stbi__jpeg *z, int scan)
function stbi__decode_jpeg_header (line 3365) | static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
function stbi_uc (line 3389) | static stbi_uc stbi__skip_jpeg_junk_at_end(stbi__jpeg *j)
function stbi__decode_jpeg_image (line 3412) | static int stbi__decode_jpeg_image(stbi__jpeg *j)
type stbi_uc (line 3451) | typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_u...
function stbi_uc (line 3456) | static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *...
function stbi_uc (line 3465) | static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, s...
function stbi_uc (line 3475) | static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, ...
function stbi_uc (line 3505) | static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, ...
function stbi_uc (line 3530) | static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_n...
function stbi_uc (line 3646) | static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_nea...
function stbi__YCbCr_to_RGB_row (line 3660) | static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const...
function stbi__YCbCr_to_RGB_simd (line 3686) | static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi...
function stbi__setup_jpeg (line 3821) | static void stbi__setup_jpeg(stbi__jpeg *j)
function stbi__cleanup_jpeg (line 3843) | static void stbi__cleanup_jpeg(stbi__jpeg *j)
type stbi__resample (line 3848) | typedef struct
function stbi_uc (line 3859) | static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y)
function stbi_uc (line 3865) | static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, i...
function stbi__jpeg_test (line 4042) | static int stbi__jpeg_test(stbi__context *s)
function stbi__jpeg_info_raw (line 4056) | static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
function stbi__jpeg_info (line 4068) | static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
type stbi__zhuffman (line 4097) | typedef struct
function stbi_inline (line 4107) | stbi_inline static int stbi__bitreverse16(int n)
function stbi_inline (line 4116) | stbi_inline static int stbi__bit_reverse(int v, int bits)
function stbi__zbuild_huffman (line 4124) | static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizeli...
type stbi__zbuf (line 4177) | typedef struct
function stbi_inline (line 4192) | stbi_inline static int stbi__zeof(stbi__zbuf *z)
function stbi_inline (line 4197) | stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
function stbi__fill_bits (line 4202) | static void stbi__fill_bits(stbi__zbuf *z)
function stbi__zreceive (line 4214) | int stbi__zreceive(stbi__zbuf *z, int n)
function stbi__zhuffman_decode_slowpath (line 4224) | static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
function stbi_inline (line 4243) | stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffm...
function stbi__zexpand (line 4273) | static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to m...
function stbi__parse_huffman_block (line 4309) | static int stbi__parse_huffman_block(stbi__zbuf *a)
function stbi__compute_huffman_codes (line 4359) | static int stbi__compute_huffman_codes(stbi__zbuf *a)
function stbi__parse_uncompressed_block (line 4409) | static int stbi__parse_uncompressed_block(stbi__zbuf *a)
function stbi__parse_zlib_header (line 4438) | static int stbi__parse_zlib_header(stbi__zbuf *a)
function stbi__parse_zlib (line 4481) | static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
function stbi__do_zlib (line 4510) | static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, i...
function STBIDEF (line 4520) | STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int ...
function STBIDEF (line 4536) | STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *...
function STBIDEF (line 4541) | STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *b...
function STBIDEF (line 4557) | STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const ...
function STBIDEF (line 4568) | STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int l...
function STBIDEF (line 4584) | STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, co...
type stbi__pngchunk (line 4607) | typedef struct
function stbi__pngchunk (line 4613) | static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
function stbi__check_png_header (line 4621) | static int stbi__check_png_header(stbi__context *s)
type stbi__png (line 4630) | typedef struct
function stbi__paeth (line 4657) | static int stbi__paeth(int a, int b, int c)
function stbi__create_png_alpha_expand8 (line 4675) | static void stbi__create_png_alpha_expand8(stbi_uc *dest, stbi_uc *src, ...
function stbi__create_png_image_raw (line 4696) | static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__...
function stbi__create_png_image (line 4861) | static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stb...
function stbi__compute_transparency (line 4906) | static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int o...
function stbi__compute_transparency16 (line 4931) | static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3]...
function stbi__expand_png_palette (line 4956) | static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int ...
function STBIDEF (line 4996) | STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpr...
function STBIDEF (line 5001) | STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_conv...
function STBIDEF (line 5013) | STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_shou...
function STBIDEF (line 5019) | STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_shou...
function stbi__de_iphone (line 5033) | static void stbi__de_iphone(stbi__png *z)
function stbi__parse_png_file (line 5078) | static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
function stbi__png_test (line 5302) | static int stbi__png_test(stbi__context *s)
function stbi__png_info_raw (line 5310) | static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
function stbi__png_info (line 5322) | static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__png_is16 (line 5329) | static int stbi__png_is16(stbi__context *s)
function stbi__bmp_test_raw (line 5346) | static int stbi__bmp_test_raw(stbi__context *s)
function stbi__bmp_test (line 5361) | static int stbi__bmp_test(stbi__context *s)
function stbi__high_bit (line 5370) | static int stbi__high_bit(unsigned int z)
function stbi__bitcount (line 5382) | static int stbi__bitcount(unsigned int a)
function stbi__shiftsigned (line 5395) | static int stbi__shiftsigned(unsigned int v, int shift, int bits)
type stbi__bmp_data (line 5415) | typedef struct
function stbi__bmp_set_mask_defaults (line 5422) | static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress)
function stbi__tga_get_comp (line 5739) | static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_r...
function stbi__tga_info (line 5755) | static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__tga_test (line 5820) | static int stbi__tga_test(stbi__context *s)
function stbi__tga_read_rgb16 (line 5852) | static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out)
function stbi__psd_test (line 6081) | static int stbi__psd_test(stbi__context *s)
function stbi__psd_decode_rle (line 6088) | static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelC...
function stbi__pic_is4 (line 6336) | static int stbi__pic_is4(stbi__context *s,const char *str)
function stbi__pic_test_core (line 6346) | static int stbi__pic_test_core(stbi__context *s)
type stbi__pic_packet (line 6362) | typedef struct
function stbi_uc (line 6367) | static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)
function stbi__copyval (line 6381) | static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)
function stbi_uc (line 6390) | static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int heigh...
function stbi__pic_test (line 6541) | static int stbi__pic_test(stbi__context *s)
type stbi__gif_lzw (line 6553) | typedef struct
type stbi__gif (line 6560) | typedef struct
function stbi__gif_test_raw (line 6580) | static int stbi__gif_test_raw(stbi__context *s)
function stbi__gif_test (line 6590) | static int stbi__gif_test(stbi__context *s)
function stbi__gif_parse_colortable (line 6597) | static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256...
function stbi__gif_header (line 6608) | static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, i...
function stbi__gif_info_raw (line 6639) | static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)
function stbi__out_gif_code (line 6654) | static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
function stbi_uc (line 6691) | static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
function stbi_uc (line 6778) | static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int ...
function stbi__gif_info (line 7077) | static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__hdr_test_core (line 7087) | static int stbi__hdr_test_core(stbi__context *s, const char *signature)
function stbi__hdr_test (line 7097) | static int stbi__hdr_test(stbi__context* s)
function stbi__hdr_convert (line 7131) | static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
function stbi__hdr_info (line 7289) | static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__bmp_info (line 7335) | static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__psd_info (line 7359) | static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__psd_is16 (line 7394) | static int stbi__psd_is16(stbi__context *s)
function stbi__pic_info (line 7423) | static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__pnm_test (line 7494) | static int stbi__pnm_test(stbi__context *s)
function stbi__pnm_isspace (line 7543) | static int stbi__pnm_isspace(char c)
function stbi__pnm_skip_whitespace (line 7548) | static void stbi__pnm_skip_whitespace(stbi__context *s, char *c)
function stbi__pnm_isdigit (line 7562) | static int stbi__pnm_isdigit(char c)
function stbi__pnm_getinteger (line 7567) | static int stbi__pnm_getinteger(stbi__context *s, char *c)
function stbi__pnm_info (line 7581) | static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
function stbi__pnm_is16 (line 7624) | static int stbi__pnm_is16(stbi__context *s)
function stbi__info_main (line 7632) | static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
function stbi__is_16_main (line 7674) | static int stbi__is_16_main(stbi__context *s)
function STBIDEF (line 7691) | STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
function STBIDEF (line 7701) | STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
function STBIDEF (line 7712) | STBIDEF int stbi_is_16_bit(char const *filename)
function STBIDEF (line 7722) | STBIDEF int stbi_is_16_bit_from_file(FILE *f)
function STBIDEF (line 7734) | STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x...
function STBIDEF (line 7741) | STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *u...
function STBIDEF (line 7748) | STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len)
function STBIDEF (line 7755) | STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *c, vo...
FILE: deps/include/stb/stb_image_resize.h
type stbir_uint8 (line 186) | typedef unsigned char stbir_uint8;
type stbir_uint16 (line 187) | typedef unsigned short stbir_uint16;
type stbir_uint32 (line 188) | typedef unsigned int stbir_uint32;
type stbir_uint8 (line 191) | typedef uint8_t stbir_uint8;
type stbir_uint16 (line 192) | typedef uint16_t stbir_uint16;
type stbir_uint32 (line 193) | typedef uint32_t stbir_uint32;
type stbir_edge (line 255) | typedef enum
type stbir_filter (line 284) | typedef enum
type stbir_colorspace (line 294) | typedef enum
type stbir_datatype (line 337) | typedef enum
type stbir__filter_info (line 475) | typedef struct
type stbir__contributors (line 483) | typedef struct
type stbir__info (line 489) | typedef struct
function stbir__inline (line 564) | static stbir__inline int stbir__min(int a, int b)
function stbir__inline (line 569) | static stbir__inline float stbir__saturate(float x)
function stbir__inline (line 581) | static stbir__inline stbir_uint8 stbir__saturate8(int x)
function stbir__inline (line 592) | static stbir__inline stbir_uint16 stbir__saturate16(int x)
function stbir__srgb_to_linear (line 631) | static float stbir__srgb_to_linear(float f)
function stbir__linear_to_srgb (line 639) | static float stbir__linear_to_srgb(float f)
type stbir__FP32 (line 650) | typedef union
function stbir_uint8 (line 672) | static stbir_uint8 stbir__linear_to_srgb_uchar(float in)
function stbir_uint8 (line 736) | static stbir_uint8 stbir__linear_to_srgb_uchar(float f)
function stbir__filter_trapezoid (line 756) | static float stbir__filter_trapezoid(float x, float scale)
function stbir__support_trapezoid (line 776) | static float stbir__support_trapezoid(float scale)
function stbir__filter_triangle (line 782) | static float stbir__filter_triangle(float x, float s)
function stbir__filter_cubic (line 794) | static float stbir__filter_cubic(float x, float s)
function stbir__filter_catmullrom (line 808) | static float stbir__filter_catmullrom(float x, float s)
function stbir__filter_mitchell (line 822) | static float stbir__filter_mitchell(float x, float s)
function stbir__support_zero (line 836) | static float stbir__support_zero(float s)
function stbir__support_one (line 842) | static float stbir__support_one(float s)
function stbir__support_two (line 848) | static float stbir__support_two(float s)
function stbir__inline (line 863) | stbir__inline static int stbir__use_upsampling(float ratio)
function stbir__inline (line 868) | stbir__inline static int stbir__use_width_upsampling(stbir__info* stbir_...
function stbir__inline (line 873) | stbir__inline static int stbir__use_height_upsampling(stbir__info* stbir...
function stbir__get_filter_pixel_width (line 880) | static int stbir__get_filter_pixel_width(stbir_filter filter, float scale)
function stbir__get_filter_pixel_margin (line 893) | static int stbir__get_filter_pixel_margin(stbir_filter filter, float scale)
function stbir__get_coefficient_width (line 898) | static int stbir__get_coefficient_width(stbir_filter filter, float scale)
function stbir__get_contributors (line 906) | static int stbir__get_contributors(float scale, stbir_filter filter, int...
function stbir__get_total_horizontal_coefficients (line 914) | static int stbir__get_total_horizontal_coefficients(stbir__info* info)
function stbir__get_total_vertical_coefficients (line 920) | static int stbir__get_total_vertical_coefficients(stbir__info* info)
function stbir__contributors (line 926) | static stbir__contributors* stbir__get_contributor(stbir__contributors* ...
function stbir__edge_wrap_slow (line 939) | static int stbir__edge_wrap_slow(stbir_edge edge, int n, int max)
function stbir__inline (line 997) | stbir__inline static int stbir__edge_wrap(stbir_edge edge, int n, int max)
function stbir__calculate_sample_range_upsample (line 1006) | static void stbir__calculate_sample_range_upsample(int n, float out_filt...
function stbir__calculate_sample_range_downsample (line 1021) | static void stbir__calculate_sample_range_downsample(int n, float in_pix...
function stbir__calculate_coefficients_upsample (line 1035) | static void stbir__calculate_coefficients_upsample(stbir_filter filter, ...
function stbir__calculate_coefficients_downsample (line 1085) | static void stbir__calculate_coefficients_downsample(stbir_filter filter...
function stbir__normalize_downsample_coefficients (line 1115) | static void stbir__normalize_downsample_coefficients(stbir__contributors...
function stbir__calculate_filters (line 1192) | static void stbir__calculate_filters(stbir__contributors* contributors, ...
function stbir__decode_scanline (line 1241) | static void stbir__decode_scanline(stbir__info* stbir_info, int n)
function stbir__resample_horizontal_upsample (line 1439) | static void stbir__resample_horizontal_upsample(stbir__info* stbir_info,...
function stbir__resample_horizontal_downsample (line 1522) | static void stbir__resample_horizontal_downsample(stbir__info* stbir_inf...
function stbir__decode_and_resample_upsample (line 1652) | static void stbir__decode_and_resample_upsample(stbir__info* stbir_info,...
function stbir__decode_and_resample_downsample (line 1666) | static void stbir__decode_and_resample_downsample(stbir__info* stbir_inf...
function stbir__encode_scanline (line 1690) | static void stbir__encode_scanline(stbir__info* stbir_info, int num_pixe...
function stbir__resample_vertical_upsample (line 1864) | static void stbir__resample_vertical_upsample(stbir__info* stbir_info, i...
function stbir__resample_vertical_downsample (line 1981) | static void stbir__resample_vertical_downsample(stbir__info* stbir_info,...
function stbir__buffer_loop_upsample (line 2061) | static void stbir__buffer_loop_upsample(stbir__info* stbir_info)
function stbir__empty_ring_buffer (line 2114) | static void stbir__empty_ring_buffer(stbir__info* stbir_info, int first_...
function stbir__buffer_loop_downsample (line 2159) | static void stbir__buffer_loop_downsample(stbir__info* stbir_info)
function stbir__setup (line 2200) | static void stbir__setup(stbir__info *info, int input_w, int input_h, in...
function stbir__calculate_transform (line 2209) | static void stbir__calculate_transform(stbir__info *info, float s0, floa...
function stbir__choose_filter (line 2233) | static void stbir__choose_filter(stbir__info *info, stbir_filter h_filte...
function stbir_uint32 (line 2243) | static stbir_uint32 stbir__calculate_memory(stbir__info *info)
function stbir__resize_allocated (line 2284) | static int stbir__resize_allocated(stbir__info *info,
function stbir__resize_arbitrary (line 2421) | static int stbir__resize_arbitrary(
function STBIRDEF (line 2455) | STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels ,...
function STBIRDEF (line 2465) | STBIRDEF int stbir_resize_float( const float *input_pixels , int inp...
function STBIRDEF (line 2475) | STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels ,...
function STBIRDEF (line 2485) | STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input...
function STBIRDEF (line 2496) | STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixe...
function STBIRDEF (line 2508) | STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixel...
function STBIRDEF (line 2521) | STBIRDEF int stbir_resize_float_generic( const float *input_pixels ...
function STBIRDEF (line 2534) | STBIRDEF int stbir_resize( const void *input_pixels , int input_...
function STBIRDEF (line 2549) | STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_...
function STBIRDEF (line 2570) | STBIRDEF int stbir_resize_region( const void *input_pixels , int input_...
FILE: deps/include/stb/stb_image_write.h
function STBIWDEF (line 266) | STBIWDEF void stbi_flip_vertically_on_write(int flag)
type stbi__write_context (line 271) | typedef struct
function stbi__start_write_callbacks (line 278) | static void stbi__start_write_callbacks(stbi__write_context *s, stbi_wri...
function stbi__stdio_write (line 286) | static void stbi__stdio_write(void *context, void *data, int size)
function STBIWDEF (line 300) | STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen,...
function FILE (line 306) | static FILE *stbiw__fopen(char const *filename, char const *mode)
function stbi__start_write_file (line 334) | static int stbi__start_write_file(stbi__write_context *s, const char *fi...
function stbi__end_write_file (line 341) | static void stbi__end_write_file(stbi__write_context *s)
type stbiw_uint32 (line 348) | typedef unsigned int stbiw_uint32;
function stbiw__writefv (line 351) | static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_l...
function stbiw__writef (line 380) | static void stbiw__writef(stbi__write_context *s, const char *fmt, ...)
function stbiw__putc (line 388) | static void stbiw__putc(stbi__write_context *s, unsigned char c)
function stbiw__write3 (line 393) | static void stbiw__write3(stbi__write_context *s, unsigned char a, unsig...
function stbiw__write_pixel (line 400) | static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int ...
function stbiw__write_pixels (line 433) | static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int...
function stbiw__outfile (line 458) | static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir,...
function stbi_write_bmp_core (line 472) | static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int...
function STBIWDEF (line 481) | STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 489) | STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp...
function stbi_write_tga_core (line 501) | static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int...
function STBIWDEF (line 579) | STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 587) | STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp...
function stbiw__linear_to_rgbe (line 605) | static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
function stbiw__write_run_data (line 622) | static void stbiw__write_run_data(stbi__write_context *s, int length, un...
function stbiw__write_dump_data (line 630) | static void stbiw__write_dump_data(stbi__write_context *s, int length, u...
function stbiw__write_hdr_scanline (line 638) | static void stbiw__write_hdr_scanline(stbi__write_context *s, int width,...
function stbi_write_hdr_core (line 727) | static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int...
function STBIWDEF (line 753) | STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 761) | STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp...
function stbiw__zlib_bitrev (line 816) | static int stbiw__zlib_bitrev(int code, int codebits)
function stbiw__zlib_countm (line 826) | static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *...
function stbiw__zhash (line 834) | static unsigned int stbiw__zhash(unsigned char *data)
function stbiw__crc32 (line 974) | static unsigned int stbiw__crc32(unsigned char *buffer, int len)
function stbiw__wpcrc (line 1027) | static void stbiw__wpcrc(unsigned char **data, int len)
function stbiw__paeth (line 1033) | static unsigned char stbiw__paeth(int a, int b, int c)
function stbiw__encode_png_line (line 1042) | static void stbiw__encode_png_line(unsigned char *pixels, int stride_byt...
function STBIWDEF (line 1165) | STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp...
function STBIWDEF (line 1181) | STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context...
function stbiw__jpg_writeBits (line 1203) | static void stbiw__jpg_writeBits(stbi__write_context *s, int *bitBufP, i...
function stbiw__jpg_DCT (line 1220) | static void stbiw__jpg_DCT(float *d0p, float *d1p, float *d2p, float *d3...
function stbiw__jpg_calcBits (line 1268) | static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) {
function stbiw__jpg_processDU (line 1278) | static int stbiw__jpg_processDU(stbi__write_context *s, int *bitBuf, int...
function stbi_write_jpg_core (line 1343) | static int stbi_write_jpg_core(stbi__write_context *s, int width, int he...
function STBIWDEF (line 1513) | STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 1522) | STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp...
FILE: nob.c
type Toolchain (line 12) | typedef enum {
type Target (line 18) | typedef enum {
type Command (line 25) | typedef enum {
type Build_Options (line 30) | typedef struct {
function target_is_windows (line 110) | static bool target_is_windows(Target target)
function host_is_windows (line 115) | static bool host_is_windows(void)
function Target (line 124) | static Target default_target(void)
function Toolchain (line 139) | static Toolchain default_toolchain(void)
function usage (line 150) | static void usage(const char *program)
function parse_toolchain (line 164) | static bool parse_toolchain(const char *value, Toolchain *toolchain)
function parse_target (line 184) | static bool parse_target(const char *value, Target *target)
function parse_args (line 209) | static bool parse_args(int argc, char **argv, Build_Options *options)
function nob_read_entire_dir_recursively (line 301) | static bool nob_read_entire_dir_recursively(const char* parent, Nob_File...
function clear_folder (line 330) | static bool clear_folder(const char* parent)
function ensure_output_dirs (line 352) | static bool ensure_output_dirs(Target target)
function append_gnu_common_flags (line 358) | static bool append_gnu_common_flags(Nob_Cmd *cmd, const Build_Options *o...
function append_msvc_common_flags (line 383) | static bool append_msvc_common_flags(Nob_Cmd *cmd, const Build_Options *...
function compile_gnu_source (line 407) | static bool compile_gnu_source(const Build_Options *options, const char ...
function compile_msvc_source (line 415) | static bool compile_msvc_source(const Build_Options *options, const char...
function copy_runtime_files (line 423) | static bool copy_runtime_files(const Build_Options *options)
function build_with_gnu_like (line 473) | static bool build_with_gnu_like(const Build_Options *options)
function build_with_msvc (line 533) | static bool build_with_msvc(const Build_Options *options)
function build_project (line 590) | static bool build_project(const Build_Options *options)
function run_project (line 614) | static bool run_project(const Build_Options *options)
function main (line 638) | int main(int argc, char **argv)
FILE: nob.h
type Nob_Log_Level (line 212) | typedef enum {
type Nob_Log_Handler (line 224) | typedef Nob_Log_Handler nob_log_handler;
type Nob_File_Paths (line 244) | typedef struct {
type Nob_File_Type (line 250) | typedef enum {
type Nob_Walk_Action (line 265) | typedef enum {
type Nob_Walk_Entry (line 274) | typedef struct {
type Nob_Walk_Dir_Opt (line 299) | typedef struct {
type Nob_Dir_Entry (line 310) | typedef struct {
type Nob_String_Builder (line 426) | typedef struct {
type HANDLE (line 473) | typedef HANDLE Nob_Proc;
type HANDLE (line 475) | typedef HANDLE Nob_Fd;
type Nob_Proc (line 478) | typedef int Nob_Proc;
type Nob_Fd (line 480) | typedef int Nob_Fd;
type Nob_Pipe (line 488) | typedef struct {
type Nob_Procs (line 495) | typedef struct {
type Nob_Cmd (line 519) | typedef struct {
type Nob_Cmd_Opt (line 526) | typedef struct {
type Nob_Chain (line 578) | typedef struct {
type Nob_Chain_Begin_Opt (line 587) | typedef struct {
type Nob_Chain_Cmd_Opt (line 593) | typedef struct {
type Nob_Chain_End_Opt (line 600) | typedef struct {
type Nob_Cmd_Redirect (line 645) | typedef struct {
function nob__cpp_cmd_append_wrapper (line 666) | inline void nob__cpp_cmd_append_wrapper(Nob_Cmd *cmd, Args... strs)
type Nob_String_View (line 903) | typedef struct {
function NOBDEF (line 972) | NOBDEF void nob__cmd_append(Nob_Cmd *cmd, size_t n, const char **args)
function NOBDEF (line 989) | NOBDEF char *nob_win32_error_message(DWORD err) {
function NOBDEF (line 1020) | NOBDEF void nob__go_rebuild_urself(int argc, char **argv, const char *so...
function NOBDEF (line 1076) | NOBDEF bool nob_mkdir_if_not_exists(const char *path)
function NOBDEF (line 1100) | NOBDEF bool nob_copy_file(const char *src_path, const char *dst_path)
function NOBDEF (line 1164) | NOBDEF void nob_cmd_render(Nob_Cmd cmd, Nob_String_Builder *render)
function nob__win32_cmd_quote (line 1182) | static void nob__win32_cmd_quote(Nob_Cmd cmd, Nob_String_Builder *quoted)
function NOBDEF (line 1223) | NOBDEF int nob_nprocs(void)
function NOBDEF (line 1234) | NOBDEF bool nob_cmd_run_opt(Nob_Cmd *cmd, Nob_Cmd_Opt opt)
function NOBDEF (line 1292) | NOBDEF bool nob_chain_begin_opt(Nob_Chain *chain, Nob_Chain_Begin_Opt opt)
function NOBDEF (line 1304) | NOBDEF bool nob_chain_cmd_opt(Nob_Chain *chain, Nob_Cmd *cmd, Nob_Chain_...
function Nob_Fd (line 1346) | static Nob_Fd nob__fd_stdout(void)
function NOBDEF (line 1355) | NOBDEF bool nob_chain_end_opt(Nob_Chain *chain, Nob_Chain_End_Opt opt)
function NOBDEF (line 1430) | NOBDEF uint64_t nob_nanos_since_unspecified_epoch(void)
function NOBDEF (line 1452) | NOBDEF Nob_Proc nob_cmd_run_async_redirect(Nob_Cmd cmd, Nob_Cmd_Redirect...
function Nob_Proc (line 1457) | static Nob_Proc nob__cmd_start_process(Nob_Cmd cmd, Nob_Fd *fdin, Nob_Fd...
function NOBDEF (line 1550) | NOBDEF Nob_Proc nob_cmd_run_async(Nob_Cmd cmd)
function NOBDEF (line 1555) | NOBDEF Nob_Proc nob_cmd_run_async_and_reset(Nob_Cmd *cmd)
function NOBDEF (line 1562) | NOBDEF Nob_Proc nob_cmd_run_async_redirect_and_reset(Nob_Cmd *cmd, Nob_C...
function NOBDEF (line 1581) | NOBDEF Nob_Fd nob_fd_open_for_read(const char *path)
function NOBDEF (line 1614) | NOBDEF Nob_Fd nob_fd_open_for_write(const char *path)
function NOBDEF (line 1649) | NOBDEF void nob_fd_close(Nob_Fd fd)
function NOBDEF (line 1658) | NOBDEF bool nob_pipe_create(Nob_Pipe *pp)
function NOBDEF (line 1687) | NOBDEF bool nob_procs_wait(Nob_Procs procs)
function NOBDEF (line 1696) | NOBDEF bool nob_procs_flush(Nob_Procs *procs)
function NOBDEF (line 1703) | NOBDEF bool nob_procs_wait_and_reset(Nob_Procs *procs)
function NOBDEF (line 1708) | NOBDEF bool nob_proc_wait(Nob_Proc proc)
function nob__proc_wait_async (line 1765) | static int nob__proc_wait_async(Nob_Proc proc, int ms)
function NOBDEF (line 1837) | NOBDEF bool nob_procs_append_with_flush(Nob_Procs *procs, Nob_Proc proc,...
function NOBDEF (line 1848) | NOBDEF bool nob_cmd_run_sync_redirect(Nob_Cmd cmd, Nob_Cmd_Redirect redi...
function NOBDEF (line 1854) | NOBDEF bool nob_cmd_run_sync(Nob_Cmd cmd)
function NOBDEF (line 1860) | NOBDEF bool nob_cmd_run_sync_and_reset(Nob_Cmd *cmd)
function NOBDEF (line 1867) | NOBDEF bool nob_cmd_run_sync_redirect_and_reset(Nob_Cmd *cmd, Nob_Cmd_Re...
function NOBDEF (line 1888) | NOBDEF void nob_set_log_handler(Nob_Log_Handler *handler)
function NOBDEF (line 1893) | NOBDEF Nob_Log_Handler *nob_get_log_handler(void)
function NOBDEF (line 1898) | NOBDEF void nob_default_log_handler(Nob_Log_Level level, const char *fmt...
function NOBDEF (line 1921) | NOBDEF void nob_null_log_handler(Nob_Log_Level level, const char *fmt, v...
function NOBDEF (line 1928) | NOBDEF void nob_cancer_log_handler(Nob_Log_Level level, const char *fmt,...
function NOBDEF (line 1949) | NOBDEF void nob_log(Nob_Log_Level level, const char *fmt, ...)
function NOBDEF (line 1957) | NOBDEF bool nob_dir_entry_open(const char *dir_path, Nob_Dir_Entry *dir)
function NOBDEF (line 1982) | NOBDEF bool nob_dir_entry_next(Nob_Dir_Entry *dir)
function NOBDEF (line 2012) | NOBDEF void nob_dir_entry_close(Nob_Dir_Entry dir)
function nob__walk_dir_opt_impl (line 2024) | bool nob__walk_dir_opt_impl(Nob_String_Builder *file_path, Nob_Walk_Func...
function NOBDEF (line 2109) | NOBDEF bool nob_walk_dir_opt(const char *root, Nob_Walk_Func func, Nob_W...
function NOBDEF (line 2122) | NOBDEF bool nob_read_entire_dir(const char *parent, Nob_File_Paths *chil...
function NOBDEF (line 2138) | NOBDEF bool nob_write_entire_file(const char *path, const void *data, si...
function NOBDEF (line 2171) | NOBDEF Nob_File_Type nob_get_file_type(const char *path)
function NOBDEF (line 2197) | NOBDEF bool nob_delete_file(const char *path)
function NOBDEF (line 2231) | NOBDEF bool nob_copy_directory_recursively(const char *src_path, const c...
function NOBDEF (line 2295) | NOBDEF char *nob_temp_strdup(const char *cstr)
function NOBDEF (line 2305) | NOBDEF char *nob_temp_strndup(const char *s, size_t n)
function NOBDEF (line 2314) | NOBDEF void *nob_temp_alloc(size_t requested_size)
function NOBDEF (line 2324) | NOBDEF char *nob_temp_vsprintf(const char *format, va_list ap)
function NOBDEF (line 2342) | NOBDEF char *nob_temp_sprintf(const char *format, ...)
function NOBDEF (line 2351) | NOBDEF void nob_temp_reset(void)
function NOBDEF (line 2356) | NOBDEF size_t nob_temp_save(void)
function NOBDEF (line 2361) | NOBDEF void nob_temp_rewind(size_t checkpoint)
function NOBDEF (line 2366) | NOBDEF const char *nob_temp_sv_to_cstr(Nob_String_View sv)
function NOBDEF (line 2371) | NOBDEF int nob_needs_rebuild(const char *output_path, const char **input...
function NOBDEF (line 2439) | NOBDEF int nob_needs_rebuild1(const char *output_path, const char *input...
function NOBDEF (line 2444) | NOBDEF const char *nob_path_name(const char *path)
function NOBDEF (line 2457) | NOBDEF bool nob_rename(const char *old_path, const char *new_path)
function NOBDEF (line 2476) | NOBDEF bool nob_read_entire_file(const char *path, Nob_String_Builder *sb)
function NOBDEF (line 2513) | NOBDEF int nob_sb_appendf(Nob_String_Builder *sb, const char *fmt, ...)
function NOBDEF (line 2535) | NOBDEF void nob_sb_pad_align(Nob_String_Builder *sb, size_t size)
function NOBDEF (line 2544) | NOBDEF Nob_String_View nob_sv_chop_while(Nob_String_View *sv, int (*p)(i...
function NOBDEF (line 2558) | NOBDEF Nob_String_View nob_sv_chop_by_delim(Nob_String_View *sv, char de...
function NOBDEF (line 2578) | NOBDEF bool nob_sv_chop_prefix(Nob_String_View *sv, Nob_String_View prefix)
function NOBDEF (line 2587) | NOBDEF bool nob_sv_chop_suffix(Nob_String_View *sv, Nob_String_View suffix)
function NOBDEF (line 2596) | NOBDEF Nob_String_View nob_sv_chop_left(Nob_String_View *sv, size_t n)
function NOBDEF (line 2610) | NOBDEF Nob_String_View nob_sv_chop_right(Nob_String_View *sv, size_t n)
function NOBDEF (line 2623) | NOBDEF Nob_String_View nob_sv_from_parts(const char *data, size_t count)
function NOBDEF (line 2631) | NOBDEF Nob_String_View nob_sv_trim_left(Nob_String_View sv)
function NOBDEF (line 2641) | NOBDEF Nob_String_View nob_sv_trim_right(Nob_String_View sv)
function NOBDEF (line 2651) | NOBDEF Nob_String_View nob_sv_trim(Nob_String_View sv)
function NOBDEF (line 2656) | NOBDEF Nob_String_View nob_sv_from_cstr(const char *cstr)
function NOBDEF (line 2661) | NOBDEF bool nob_sv_eq(Nob_String_View a, Nob_String_View b)
function NOBDEF (line 2670) | NOBDEF bool nob_sv_end_with(Nob_String_View sv, const char *cstr)
function NOBDEF (line 2675) | NOBDEF bool nob_sv_ends_with_cstr(Nob_String_View sv, const char *cstr)
function NOBDEF (line 2680) | NOBDEF bool nob_sv_ends_with(Nob_String_View sv, Nob_String_View suffix)
function NOBDEF (line 2692) | NOBDEF bool nob_sv_starts_with(Nob_String_View sv, Nob_String_View expec...
function NOBDEF (line 2705) | NOBDEF int nob_file_exists(const char *file_path)
function NOBDEF (line 2714) | NOBDEF const char *nob_get_current_dir_temp(void)
function NOBDEF (line 2741) | NOBDEF bool nob_set_current_dir(const char *path)
function NOBDEF (line 2758) | NOBDEF char *nob_temp_dir_name(const char *path)
function NOBDEF (line 2781) | NOBDEF char *nob_temp_file_name(const char *path)
function NOBDEF (line 2804) | NOBDEF char *nob_temp_file_ext(const char *path)
function NOBDEF (line 2818) | NOBDEF char *nob_temp_running_executable_path(void)
FILE: src/common.h
type s8 (line 6) | typedef int8_t s8;
type s16 (line 7) | typedef int16_t s16;
type s32 (line 8) | typedef int32_t s32;
type s64 (line 9) | typedef int64_t s64;
type u8 (line 11) | typedef uint8_t u8;
type u16 (line 12) | typedef uint16_t u16;
type u32 (line 13) | typedef uint32_t u32;
type u64 (line 14) | typedef uint64_t u64;
type f32 (line 16) | typedef float f32;
type f64 (line 17) | typedef double f64;
type uchar (line 19) | typedef unsigned char uchar;
type size32 (line 21) | typedef size_t size32;
FILE: src/war.h
type _WarInputState (line 131) | struct _WarInputState
type _WarInput (line 138) | struct _WarInput
type _WarRenderState (line 158) | struct _WarRenderState
type _WarImuiSpriteEntry (line 170) | struct _WarImuiSpriteEntry
type _WarImuiState (line 178) | struct _WarImuiState
type _WarContext (line 208) | struct _WarContext
FILE: src/war1.c
function main (line 115) | int main(void)
FILE: src/war_actions.c
type WarUnitFrameNumbers (line 13) | typedef struct
function WarUnitFrameNumbers (line 25) | static WarUnitFrameNumbers wact_getFrameNumbers(s32 nbdir, s32 initCount...
function WarUnitActionDef (line 62) | static WarUnitActionDef createUnitActionDef(WarUnitActionType type, bool...
function addUnitActionDefStep (line 72) | static void addUnitActionDefStep(WarUnitActionDef* def, WarUnitActionSte...
function WarUnitActionDef (line 77) | static WarUnitActionDef createWalkActionDef(s32 nframes, s32 frames[], s...
function WarUnitActionDef (line 163) | static WarUnitActionDef createLinearWalkActionDef(s32 framesCount, s32 f...
function WarUnitActionDef (line 179) | static WarUnitActionDef createAttackActionDef(s32 nframes, s32 frames[],...
function WarUnitActionDef (line 208) | static WarUnitActionDef createRepairActionDef(s32 nframes, s32 frames[],...
function WarUnitActionDef (line 237) | static WarUnitActionDef createHarvestActionDef(s32 nframes, s32 frames[]...
function WarUnitActionDef (line 268) | static WarUnitActionDef createDeathActionDef(s32 nframes, s32 frames[], ...
function WarUnitActionDef (line 286) | static WarUnitActionDef createBuildActionDef(s32 nframes, s32 frames[], ...
function WarUnitActionDef (line 301) | static WarUnitActionDef createIdleActionDef(s32 nframes, s32 frames[], s...
function WarUnitActionDef (line 316) | static WarUnitActionDef createDefaultIdleActionDef(s32 waitTime, bool di...
function WarUnitActionDef (line 322) | static WarUnitActionDef createSpiderScorpionDeathActionDef(s32 framesCou...
function WarUnitActionDef (line 344) | static WarUnitActionDef createSlimeWalkActionDef(bool directional, s32 w...
function WarUnitActionDef (line 361) | static WarUnitActionDef createFireElementalWalkActionDef(bool directiona...
function initFootmanGruntActionDefs (line 378) | static void initFootmanGruntActionDefs(WarUnitFrameNumbers frames)
function initPeasantPeonActionDefs (line 403) | static void initPeasantPeonActionDefs(WarUnitFrameNumbers frames, WarUni...
function initCatapultActionDefs (line 432) | static void initCatapultActionDefs(WarUnitFrameNumbers frames)
function initKnightRaiderActionDefs (line 457) | static void initKnightRaiderActionDefs(WarUnitFrameNumbers frames)
function initArcherSpearmanActionDefs (line 491) | static void initArcherSpearmanActionDefs(WarUnitFrameNumbers frames)
function initConjurerActionDefs (line 516) | static void initConjurerActionDefs(WarUnitFrameNumbers frames)
function initWarlockActionDefs (line 536) | static void initWarlockActionDefs(WarUnitFrameNumbers frames)
function initClericActionDefs (line 556) | static void initClericActionDefs(WarUnitFrameNumbers frames)
function initNecrolyteActionDefs (line 575) | static void initNecrolyteActionDefs(WarUnitFrameNumbers frames)
function initMedivhActionDefs (line 594) | static void initMedivhActionDefs(WarUnitFrameNumbers frames)
function initLotharActionDefs (line 613) | static void initLotharActionDefs(WarUnitFrameNumbers frames)
function initGrizeldaGaronaActionDefs (line 632) | static void initGrizeldaGaronaActionDefs(void)
function initOgreActionDefs (line 655) | static void initOgreActionDefs(WarUnitFrameNumbers frames)
function initSpiderActionDefs (line 674) | static void initSpiderActionDefs(WarUnitFrameNumbers frames)
function initSlimeActionDefs (line 694) | static void initSlimeActionDefs(WarUnitFrameNumbers frames)
function initFireElementalActionDefs (line 714) | static void initFireElementalActionDefs(WarUnitFrameNumbers frames)
function initWaterElementalActionDefs (line 732) | static void initWaterElementalActionDefs(WarUnitFrameNumbers frames)
function initScorpionActionDefs (line 752) | static void initScorpionActionDefs(WarUnitFrameNumbers frames)
function initBrigandActionDefs (line 772) | static void initBrigandActionDefs(WarUnitFrameNumbers frames)
function initSkeletonActionDefs (line 791) | static void initSkeletonActionDefs(WarUnitFrameNumbers frames)
function initDaemonActionDefs (line 810) | static void initDaemonActionDefs(WarUnitFrameNumbers frames)
function initTheDeadActionDefs (line 829) | static void initTheDeadActionDefs(WarUnitFrameNumbers frames)
function initWoundedActionDefs (line 848) | static void initWoundedActionDefs(void)
function initBuildableActionDefs (line 856) | static void initBuildableActionDefs(void)
function initNonBuildableActionDefs (line 883) | static void initNonBuildableActionDefs(void)
function initHumanCorpseActionDefs (line 898) | static void initHumanCorpseActionDefs(void)
function initOrcCorpseActionDefs (line 906) | static void initOrcCorpseActionDefs(void)
function resetAction (line 914) | static void resetAction(WarUnitAction* action)
function wact_initUnitActionDefs (line 920) | void wact_initUnitActionDefs(void)
function wact_equalsActionStep (line 975) | bool wact_equalsActionStep(const WarUnitActionStep step1, const WarUnitA...
function wact_addUnitActions (line 982) | void wact_addUnitActions(WarContext* context, WarEntity* entity)
function s32 (line 998) | s32 wact_getActionDuration(WarContext* context, WarEntity* entity, WarUn...
function wact_setAction (line 1022) | void wact_setAction(WarContext* context, WarEntity* entity, WarUnitActio...
function wact_updateAction (line 1055) | void wact_updateAction(WarContext* context, WarEntity* entity)
function wact_resetAction (line 1184) | void wact_resetAction(WarContext* context, WarEntity* entity, WarUnitAct...
FILE: src/war_actions.h
type _WarUnitActionStep (line 8) | struct _WarUnitActionStep
type _WarUnitActionDef (line 22) | struct _WarUnitActionDef
type _WarUnitAction (line 30) | struct _WarUnitAction
FILE: src/war_ai.c
function wai_equalsAICommand (line 5) | bool wai_equalsAICommand(const WarAICommand* command1, const WarAIComman...
function wai_freeAICommand (line 10) | void wai_freeAICommand(WarAICommand* command)
function WarAICommand (line 47) | WarAICommand* wai_createUnitRequest(WarContext* context, WarPlayerInfo* ...
function WarAICommand (line 55) | WarAICommand* wai_createWaitForUnit(WarContext* context, WarPlayerInfo* ...
function WarAICommand (line 63) | WarAICommand* wai_createSleepForTime(WarContext* context, WarPlayerInfo*...
type WarAICustomData (line 70) | typedef struct
function wai_initAI (line 76) | void wai_initAI(WarContext* context, WarPlayerInfo* aiPlayer)
function WarAICommand (line 100) | WarAICommand* wai_getNextAICommand(WarContext* context, WarPlayerInfo* a...
function wai_initAIPlayer (line 116) | void wai_initAIPlayer(WarContext* context, WarPlayerInfo* aiPlayer)
function wai_initAIPlayers (line 122) | void wai_initAIPlayers(WarContext* context)
function wai_tryCreateUnit (line 130) | bool wai_tryCreateUnit(WarContext* context, WarPlayerInfo* aiPlayer, War...
function wai_executeRequestAICommand (line 199) | bool wai_executeRequestAICommand(WarContext* context, WarPlayerInfo* aiP...
function wai_executeWaitAICommand (line 216) | bool wai_executeWaitAICommand(WarContext* context, WarPlayerInfo* aiPlay...
function wai_executeSleepAICommand (line 230) | bool wai_executeSleepAICommand(WarContext* context, WarPlayerInfo* aiPla...
function wai_executeAICommand (line 246) | bool wai_executeAICommand(WarContext* context, WarPlayerInfo* aiPlayer, ...
function wai_updateAICurrentCommands (line 278) | bool wai_updateAICurrentCommands(WarContext* context, WarPlayerInfo* aiP...
function wai_updateAINextCommands (line 298) | void wai_updateAINextCommands(WarContext* context, WarPlayerInfo* aiPlayer)
function wai_removeCompletedAICommands (line 322) | void wai_removeCompletedAICommands(WarContext* context, WarPlayerInfo* a...
function wai_updateAIPlayer (line 340) | void wai_updateAIPlayer(WarContext* context, WarPlayerInfo* aiPlayer)
function wai_updateAIPlayers (line 360) | void wai_updateAIPlayers(WarContext* context)
FILE: src/war_ai.h
type _WarAICommand (line 8) | struct _WarAICommand
FILE: src/war_alloc.c
function zoneReporter (line 20) | static void zoneReporter(const memzone_t* zone, mz_report_t report, cons...
function initZone (line 44) | static bool initZone(size_t size, const char* logFileName, memzone_t** o...
function isInZone (line 55) | static bool isInZone(memzone_t* zone, void* p)
function freeInZone (line 86) | static void freeInZone(memzone_t* zone, void* p, const char* file, int l...
function wm_allocInit (line 97) | bool wm_allocInit(size_t globalSize, size_t frameSize, size_t audioSize)
function wm_allocFree (line 129) | void wm_allocFree(void)
function wm__free (line 191) | void wm__free(void* p, const char* file, int line)
FILE: src/war_alloc.h
type memzone_t (line 7) | typedef struct memzone_s memzone_t;
FILE: src/war_animations.c
function wanim_equalsSpriteAnimation (line 11) | bool wanim_equalsSpriteAnimation(const WarSpriteAnimation* anim1, const ...
function wanim_addAnimation (line 49) | void wanim_addAnimation(WarContext* context, WarEntity* entity, WarSprit...
function wanim_addAnimationFrame (line 57) | void wanim_addAnimationFrame(WarSpriteAnimation* animation, s32 frameIndex)
function wanim_addAnimationFrames (line 62) | void wanim_addAnimationFrames(WarSpriteAnimation* animation, s32 count, ...
function wanim_addAnimationFramesRange (line 76) | void wanim_addAnimationFramesRange(WarSpriteAnimation* animation, s32 fr...
function f32 (line 90) | f32 wanim_getAnimationDuration(WarSpriteAnimation* animation)
function wanim_freeAnimation (line 95) | void wanim_freeAnimation(WarSpriteAnimation* animation)
function s32 (line 104) | s32 wanim_findAnimationIndex(WarContext* context, WarEntity* entity, Str...
function wanim_removeAnimation (line 126) | void wanim_removeAnimation(WarContext* context, WarEntity* entity, Strin...
function wanim_resetAnimation (line 140) | void wanim_resetAnimation(WarSpriteAnimation* animation)
function wanim_updateAnimation (line 147) | void wanim_updateAnimation(WarContext* context, WarEntity* entity, WarSp...
function wanim_updateAnimations (line 190) | void wanim_updateAnimations(WarContext* context)
function WarSpriteAnimation (line 214) | WarSpriteAnimation* wanim_findAnimation(WarContext* context, WarEntity* ...
function wanim_containsAnimation (line 233) | bool wanim_containsAnimation(WarContext* context, WarEntity* entity, Str...
function WarSpriteAnimation (line 238) | WarSpriteAnimation* wanim_createDamageAnimation(WarContext* context, War...
function WarSpriteAnimation (line 254) | WarSpriteAnimation* wanim_createCollapseAnimation(WarContext* context, W...
function WarSpriteAnimation (line 284) | WarSpriteAnimation* wanim_createExplosionAnimation(WarContext* context, ...
function WarSpriteAnimation (line 305) | WarSpriteAnimation* wanim_createRainOfFireExplosionAnimation(WarContext*...
function WarSpriteAnimation (line 326) | WarSpriteAnimation* wanim_createSpellAnimation(WarContext* context, WarE...
function WarSpriteAnimation (line 347) | WarSpriteAnimation* wanim_createPoisonCloudAnimation(WarContext* context...
FILE: src/war_animations.h
type _WarSpriteAnimation (line 8) | struct _WarSpriteAnimation
FILE: src/war_audio.c
type WarAudioData (line 14) | typedef struct
function WarAudioData (line 180) | WarAudioData wa_getAudioData(WarAudioId audioId)
function wa_playMidi (line 191) | bool wa_playMidi(WarContext* context, WarEntity* entity, u32 sampleCount...
function wa_playWave (line 284) | bool wa_playWave(WarContext* context, WarEntity* entity, u32 sampleCount...
function audioDataCallback (line 332) | void SDLCALL audioDataCallback(void* userdata, SDL_AudioStream* stream, ...
function wa_initAudio (line 474) | bool wa_initAudio(WarContext* context)
function wa_removeAudiosOfType (line 551) | void wa_removeAudiosOfType(WarContext* context, WarAudioType type)
function WarEntity (line 588) | WarEntity* wa_createAudio(WarContext* context, const CreateAudioArgs* args)
function WarEntity (line 607) | WarEntity* wa_createAudioWithPosition(WarContext* context, const CreateA...
function WarEntity (line 630) | WarEntity* wa_createAudioRandom(WarContext* context, const CreateAudioAr...
function WarEntity (line 638) | WarEntity* wa_createAudioRandomWithPosition(WarContext* context, const C...
function WarEntity (line 647) | WarEntity* wa_playAttackSound(WarContext* context, vec2 position, WarUni...
function WarEntity (line 667) | WarEntity* wa_playDudeSelectionSound(WarContext* context, WarEntity* ent...
function WarEntity (line 689) | WarEntity* wa_playBuildingSelectionSound(WarContext* context, WarEntity*...
function WarEntity (line 721) | WarEntity* wa_playAcknowledgementSound(WarContext* context, WarPlayerInf...
function wa_mb_readUIntVar (line 731) | bool wa_mb_readUIntVar(memory_buffer_t* buffer, u32* value)
function wa_mb_writeUIntVar (line 751) | bool wa_mb_writeUIntVar(memory_buffer_t* buffer, u32 value)
type MidiToken (line 773) | typedef struct _MidiToken
function s32 (line 782) | static s32 wa_compareTokens(const MidiToken left, const MidiToken right,...
function MidiToken (line 791) | static MidiToken* MidiTokenListAppend(MidiTokenList* list, s32 time, u8 ...
function u8 (line 810) | u8* wa_transcodeXmiToMid(WarContext* context, u8* xmiData, size_t xmiLen...
function u8 (line 1088) | u8* wa_changeSampleRate(WarContext* context, u8* samplesIn, s32 length, ...
FILE: src/war_audio.h
type tsf (line 8) | typedef struct tsf tsf;
type tml_message (line 9) | typedef struct tml_message tml_message;
type _WarAudioComponent (line 11) | struct _WarAudioComponent
type CreateAudioArgs (line 39) | typedef struct {
FILE: src/war_campaigns.c
type WarCampaignMapRawData (line 14) | typedef struct
function WarCampaignMapData (line 364) | WarCampaignMapData wcamp_getCampaignData(WarCampaignMapType type)
function WarLevelResult (line 385) | WarLevelResult wcamp_checkMap01Objectives(WarContext* context)
function WarLevelResult (line 409) | WarLevelResult wcamp_checkMap02Objectives(WarContext* context)
function WarLevelResult (line 428) | WarLevelResult wcamp_checkCustomMapObjectives(WarContext* context)
FILE: src/war_campaigns.h
type _WarCampaignMapData (line 5) | struct _WarCampaignMapData
FILE: src/war_cheats.c
function wcheat_applyCheat (line 40) | void wcheat_applyCheat(WarContext* context, StringView text)
function wcheat_applyGoldCheat (line 72) | void wcheat_applyGoldCheat(WarContext* context, StringView argument)
function wcheat_applySpellsCheat (line 87) | void wcheat_applySpellsCheat(WarContext* context, StringView argument)
function wcheat_applyUpgradesCheat (line 150) | void wcheat_applyUpgradesCheat(WarContext* context, StringView argument)
function wcheat_applyEndCheat (line 185) | void wcheat_applyEndCheat(WarContext* context, StringView argument)
function wcheat_applyEnableCheat (line 201) | void wcheat_applyEnableCheat(WarContext* context, StringView argument)
function wcheat_applyGodModeCheat (line 217) | void wcheat_applyGodModeCheat(WarContext* context, StringView argument)
function wcheat_applyWinCheat (line 234) | void wcheat_applyWinCheat(WarContext* context, StringView argument)
function wcheat_applyLossCheat (line 250) | void wcheat_applyLossCheat(WarContext* context, StringView argument)
function wcheat_applyFogOfWarCheat (line 266) | void wcheat_applyFogOfWarCheat(WarContext* context, StringView argument)
function wcheat_applySkipHumanCheat (line 282) | void wcheat_applySkipHumanCheat(WarContext* context, StringView argument)
function wcheat_applySkipOrcCheat (line 305) | void wcheat_applySkipOrcCheat(WarContext* context, StringView argument)
function wcheat_applySpeedCheat (line 328) | void wcheat_applySpeedCheat(WarContext* context, StringView argument)
function wcheat_applyMusicCheat (line 344) | void wcheat_applyMusicCheat(WarContext* context, StringView argument)
function wcheat_applySoundCheat (line 383) | void wcheat_applySoundCheat(WarContext* context, StringView argument)
function wcheat_applyMusicVolCheat (line 400) | void wcheat_applyMusicVolCheat(WarContext* context, StringView argument)
function wcheat_applySoundVolCheat (line 432) | void wcheat_applySoundVolCheat(WarContext* context, StringView argument)
function wcheat_applyGlobalScaleCheat (line 464) | void wcheat_applyGlobalScaleCheat(WarContext* context, StringView argument)
function wcheat_applyGlobalSpeedCheat (line 478) | void wcheat_applyGlobalSpeedCheat(WarContext* context, StringView argument)
function wcheat_applyEditCheat (line 492) | void wcheat_applyEditCheat(WarContext* context, StringView argument)
function wcheat_applyRainOfFireCheat (line 536) | void wcheat_applyRainOfFireCheat(WarContext* context, StringView argument)
function wcheat_applyAddUnitCheat (line 560) | void wcheat_applyAddUnitCheat(WarContext* context, StringView argument)
FILE: src/war_cheats.h
type _WarFlashStatus (line 10) | struct _WarFlashStatus
type _WarCheatStatus (line 18) | struct _WarCheatStatus
type _WarCheatDescriptor (line 39) | struct _WarCheatDescriptor
FILE: src/war_cheats_panel.c
function wcheatp_setCheatsPanelVisible (line 13) | void wcheatp_setCheatsPanelVisible(WarContext* context, bool visible)
function wcheatp_setCheatsFeedback (line 37) | void wcheatp_setCheatsFeedback(WarContext* context, String feedbackText)
function wcheatp_createCheatsPanel (line 65) | void wcheatp_createCheatsPanel(WarContext* context)
function wcheatp_setCheatText (line 80) | void wcheatp_setCheatText(WarContext* context, String text)
function wcheatp_updateCheatsPanel (line 88) | void wcheatp_updateCheatsPanel(WarContext* context)
function wcheatp_renderCheatsPanel (line 197) | void wcheatp_renderCheatsPanel(WarContext* context)
FILE: src/war_color.h
type WarColor (line 5) | typedef union {
FILE: src/war_commands.c
function wcmd_executeMoveCommand (line 13) | void wcmd_executeMoveCommand(WarContext* context, vec2 targetPoint)
function wcmd_executeFollowCommand (line 128) | void wcmd_executeFollowCommand(WarContext* context, WarEntity* targetEnt...
function wcmd_executeStopCommand (line 157) | void wcmd_executeStopCommand(WarContext* context)
function wcmd_executeHarvestCommand (line 176) | void wcmd_executeHarvestCommand(WarContext* context, WarEntity* targetEn...
function wcmd_executeDeliverCommand (line 241) | void wcmd_executeDeliverCommand(WarContext* context, WarEntity* targetEn...
function wcmd_executeRepairCommand (line 289) | void wcmd_executeRepairCommand(WarContext* context, WarEntity* targetEnt...
function wcmd_executeSummonCommand (line 327) | void wcmd_executeSummonCommand(WarContext* context, WarUnitCommandType s...
function wcmd_executeRainOfFireCommand (line 385) | void wcmd_executeRainOfFireCommand(WarContext* context, vec2 targetTile)
function wcmd_executePoisonCloudCommand (line 404) | void wcmd_executePoisonCloudCommand(WarContext* context, vec2 targetTile)
function wcmd_executeHealingCommand (line 423) | void wcmd_executeHealingCommand(WarContext* context, WarEntity* targetEn...
function wcmd_executeInvisiblityCommand (line 449) | void wcmd_executeInvisiblityCommand(WarContext* context, WarEntity* targ...
function wcmd_executeUnholyArmorCommand (line 471) | void wcmd_executeUnholyArmorCommand(WarContext* context, WarEntity* targ...
function wcmd_executeRaiseDeadCommand (line 493) | void wcmd_executeRaiseDeadCommand(WarContext* context, vec2 targetTile)
function wcmd_executeSightCommand (line 512) | void wcmd_executeSightCommand(WarContext* context, vec2 targetTile)
function wcmd_executeAttackCommand (line 532) | void wcmd_executeAttackCommand(WarContext* context, WarEntity* targetEnt...
function wcmd_executeCommand (line 583) | bool wcmd_executeCommand(WarContext* context)
function wcmd_trainUnit (line 1210) | void wcmd_trainUnit(WarContext* context, WarUnitCommandType commandType,...
function wcmd_trainFootman (line 1219) | void wcmd_trainFootman(WarContext* context, WarEntity* entity)
function wcmd_trainGrunt (line 1225) | void wcmd_trainGrunt(WarContext* context, WarEntity* entity)
function wcmd_trainPeasant (line 1231) | void wcmd_trainPeasant(WarContext* context, WarEntity* entity)
function wcmd_trainPeon (line 1237) | void wcmd_trainPeon(WarContext* context, WarEntity* entity)
function wcmd_trainHumanCatapult (line 1243) | void wcmd_trainHumanCatapult(WarContext* context, WarEntity* entity)
function wcmd_trainOrcCatapult (line 1249) | void wcmd_trainOrcCatapult(WarContext* context, WarEntity* entity)
function wcmd_trainKnight (line 1255) | void wcmd_trainKnight(WarContext* context, WarEntity* entity)
function wcmd_trainRaider (line 1261) | void wcmd_trainRaider(WarContext* context, WarEntity* entity)
function wcmd_trainArcher (line 1267) | void wcmd_trainArcher(WarContext* context, WarEntity* entity)
function wcmd_trainSpearman (line 1273) | void wcmd_trainSpearman(WarContext* context, WarEntity* entity)
function wcmd_trainConjurer (line 1279) | void wcmd_trainConjurer(WarContext* context, WarEntity* entity)
function wcmd_trainWarlock (line 1285) | void wcmd_trainWarlock(WarContext* context, WarEntity* entity)
function wcmd_trainCleric (line 1291) | void wcmd_trainCleric(WarContext* context, WarEntity* entity)
function wcmd_trainNecrolyte (line 1297) | void wcmd_trainNecrolyte(WarContext* context, WarEntity* entity)
function wcmd_upgradeUpgrade (line 1304) | void wcmd_upgradeUpgrade(WarContext* context, WarUnitCommandType command...
function wcmd_upgradeSwords (line 1313) | void wcmd_upgradeSwords(WarContext* context, WarEntity* entity)
function wcmd_upgradeAxes (line 1319) | void wcmd_upgradeAxes(WarContext* context, WarEntity* entity)
function wcmd_upgradeHumanShields (line 1325) | void wcmd_upgradeHumanShields(WarContext* context, WarEntity* entity)
function wcmd_upgradeOrcsShields (line 1331) | void wcmd_upgradeOrcsShields(WarContext* context, WarEntity* entity)
function wcmd_upgradeArrows (line 1337) | void wcmd_upgradeArrows(WarContext* context, WarEntity* entity)
function wcmd_upgradeSpears (line 1343) | void wcmd_upgradeSpears(WarContext* context, WarEntity* entity)
function wcmd_upgradeHorses (line 1349) | void wcmd_upgradeHorses(WarContext* context, WarEntity* entity)
function wcmd_upgradeWolves (line 1355) | void wcmd_upgradeWolves(WarContext* context, WarEntity* entity)
function wcmd_upgradeScorpions (line 1361) | void wcmd_upgradeScorpions(WarContext* context, WarEntity* entity)
function wcmd_upgradeSpiders (line 1367) | void wcmd_upgradeSpiders(WarContext* context, WarEntity* entity)
function wcmd_upgradeRainOfFire (line 1373) | void wcmd_upgradeRainOfFire(WarContext* context, WarEntity* entity)
function wcmd_upgradePoisonCloud (line 1379) | void wcmd_upgradePoisonCloud(WarContext* context, WarEntity* entity)
function wcmd_upgradeWaterElemental (line 1385) | void wcmd_upgradeWaterElemental(WarContext* context, WarEntity* entity)
function wcmd_upgradeDaemon (line 1391) | void wcmd_upgradeDaemon(WarContext* context, WarEntity* entity)
function wcmd_upgradeHealing (line 1397) | void wcmd_upgradeHealing(WarContext* context, WarEntity* entity)
function wcmd_upgradeRaiseDead (line 1403) | void wcmd_upgradeRaiseDead(WarContext* context, WarEntity* entity)
function wcmd_upgradeFarSight (line 1409) | void wcmd_upgradeFarSight(WarContext* context, WarEntity* entity)
function wcmd_upgradeDarkVision (line 1415) | void wcmd_upgradeDarkVision(WarContext* context, WarEntity* entity)
function wcmd_upgradeInvisibility (line 1421) | void wcmd_upgradeInvisibility(WarContext* context, WarEntity* entity)
function wcmd_upgradeUnholyArmor (line 1427) | void wcmd_upgradeUnholyArmor(WarContext* context, WarEntity* entity)
function wcmd_cancel (line 1434) | void wcmd_cancel(WarContext* context, WarEntity* entity)
function move (line 1493) | void move(WarContext* context, WarEntity* entity)
function wcmd_stop (line 1501) | void wcmd_stop(WarContext* context, WarEntity* entity)
function wcmd_harvest (line 1509) | void wcmd_harvest(WarContext* context, WarEntity* entity)
function deliver (line 1517) | void deliver(WarContext* context, WarEntity* entity)
function repair (line 1525) | void repair(WarContext* context, WarEntity* entity)
function attack (line 1533) | void attack(WarContext* context, WarEntity* entity)
function wcmd_buildBasic (line 1541) | void wcmd_buildBasic(WarContext* context, WarEntity* entity)
function wcmd_buildAdvanced (line 1549) | void wcmd_buildAdvanced(WarContext* context, WarEntity* entity)
function wcmd_buildBuilding (line 1557) | void wcmd_buildBuilding(WarContext* context, WarUnitCommandType commandT...
function wcmd_buildFarmHumans (line 1565) | void wcmd_buildFarmHumans(WarContext* context, WarEntity* entity)
function wcmd_buildFarmOrcs (line 1571) | void wcmd_buildFarmOrcs(WarContext* context, WarEntity* entity)
function wcmd_buildBarracksHumans (line 1577) | void wcmd_buildBarracksHumans(WarContext* context, WarEntity* entity)
function wcmd_buildBarracksOrcs (line 1583) | void wcmd_buildBarracksOrcs(WarContext* context, WarEntity* entity)
function wcmd_buildChurch (line 1589) | void wcmd_buildChurch(WarContext* context, WarEntity* entity)
function wcmd_buildTemple (line 1595) | void wcmd_buildTemple(WarContext* context, WarEntity* entity)
function wcmd_buildTowerHumans (line 1601) | void wcmd_buildTowerHumans(WarContext* context, WarEntity* entity)
function wcmd_buildTowerOrcs (line 1607) | void wcmd_buildTowerOrcs(WarContext* context, WarEntity* entity)
function wcmd_buildTownHallHumans (line 1613) | void wcmd_buildTownHallHumans(WarContext* context, WarEntity* entity)
function wcmd_buildTownHallOrcs (line 1619) | void wcmd_buildTownHallOrcs(WarContext* context, WarEntity* entity)
function wcmd_buildLumbermillHumans (line 1625) | void wcmd_buildLumbermillHumans(WarContext* context, WarEntity* entity)
function wcmd_buildLumbermillOrcs (line 1631) | void wcmd_buildLumbermillOrcs(WarContext* context, WarEntity* entity)
function wcmd_buildStable (line 1637) | void wcmd_buildStable(WarContext* context, WarEntity* entity)
function wcmd_buildKennel (line 1643) | void wcmd_buildKennel(WarContext* context, WarEntity* entity)
function wcmd_buildBlacksmithHumans (line 1649) | void wcmd_buildBlacksmithHumans(WarContext* context, WarEntity* entity)
function wcmd_buildBlacksmithOrcs (line 1655) | void wcmd_buildBlacksmithOrcs(WarContext* context, WarEntity* entity)
function wcmd_buildWall (line 1661) | void wcmd_buildWall(WarContext* context, WarEntity* entity)
function wcmd_buildRoad (line 1669) | void wcmd_buildRoad(WarContext* context, WarEntity* entity)
function wcmd_castRainOfFire (line 1678) | void wcmd_castRainOfFire(WarContext* context, WarEntity* entity)
function wcmd_castPoisonCloud (line 1686) | void wcmd_castPoisonCloud(WarContext* context, WarEntity* entity)
function wcmd_castHeal (line 1694) | void wcmd_castHeal(WarContext* context, WarEntity* entity)
function wcmd_castFarSight (line 1702) | void wcmd_castFarSight(WarContext* context, WarEntity* entity)
function wcmd_castDarkVision (line 1710) | void wcmd_castDarkVision(WarContext* context, WarEntity* entity)
function wcmd_castInvisibility (line 1718) | void wcmd_castInvisibility(WarContext* context, WarEntity* entity)
function wcmd_castUnHolyArmor (line 1726) | void wcmd_castUnHolyArmor(WarContext* context, WarEntity* entity)
function wcmd_castRaiseDead (line 1734) | void wcmd_castRaiseDead(WarContext* context, WarEntity* entity)
function wcmd_summonSpider (line 1743) | void wcmd_summonSpider(WarContext* context, WarEntity* entity)
function wcmd_summonScorpion (line 1751) | void wcmd_summonScorpion(WarContext* context, WarEntity* entity)
function wcmd_summonDaemon (line 1759) | void wcmd_summonDaemon(WarContext* context, WarEntity* entity)
function wcmd_summonWaterElemental (line 1767) | void wcmd_summonWaterElemental(WarContext* context, WarEntity* entity)
FILE: src/war_commands.h
type _WarUnitCommand (line 7) | struct _WarUnitCommand
FILE: src/war_database.h
type DatabaseEntry (line 6) | typedef struct
FILE: src/war_entities.c
function u32 (line 56) | u32 we_hashEntityId(const WarEntityId id)
function we_equalsEntity (line 61) | bool we_equalsEntity(const WarEntity* e1, const WarEntity* e2)
function we_freeEntity (line 66) | void we_freeEntity(WarEntity* e)
function u32 (line 73) | u32 we_hashEntityType(const WarEntityType type)
function we_equalsEntityType (line 78) | bool we_equalsEntityType(const WarEntityType t1, const WarEntityType t2)
function we_freeEntityList (line 83) | void we_freeEntityList(WarEntityList* list)
function we_isComponentEnabled (line 88) | bool we_isComponentEnabled(WarContext* context, WarEntity* entity, WarCo...
function we_setComponentEnabled (line 128) | void we_setComponentEnabled(WarContext* context, WarEntity* entity, WarC...
function we_enableComponent (line 168) | void we_enableComponent(WarContext* context, WarEntity* entity, WarCompo...
function we_disableComponent (line 173) | void we_disableComponent(WarContext* context, WarEntity* entity, WarComp...
function WarTransformComponent (line 178) | WarTransformComponent* we_getTransformComponent(WarContext* context, con...
function WarSpriteComponent (line 187) | WarSpriteComponent* we_getSpriteComponent(WarContext* context, const War...
function WarUnitComponent (line 196) | WarUnitComponent* we_getUnitComponent(WarContext* context, const WarEnti...
function WarAnimationsComponent (line 205) | WarAnimationsComponent* we_getAnimationsComponent(WarContext* context, c...
function WarRoadComponent (line 214) | WarRoadComponent* we_getRoadComponent(WarContext* context, const WarEnti...
function WarWallComponent (line 223) | WarWallComponent* we_getWallComponent(WarContext* context, const WarEnti...
function WarRuinComponent (line 232) | WarRuinComponent* we_getRuinComponent(WarContext* context, const WarEnti...
function WarForestComponent (line 241) | WarForestComponent* we_getForestComponent(WarContext* context, const War...
function WarStateMachineComponent (line 250) | WarStateMachineComponent* we_getStateMachineComponent(WarContext* contex...
function WarUIComponent (line 259) | WarUIComponent* we_getUIComponent(WarContext* context, const WarEntity* ...
function WarTextComponent (line 268) | WarTextComponent* we_getTextComponent(WarContext* context, const WarEnti...
function WarRectComponent (line 277) | WarRectComponent* we_getRectComponent(WarContext* context, const WarEnti...
function WarButtonComponent (line 286) | WarButtonComponent* we_getButtonComponent(WarContext* context, const War...
function WarAudioComponent (line 295) | WarAudioComponent* we_getAudioComponent(WarContext* context, const WarEn...
function WarCursorComponent (line 304) | WarCursorComponent* we_getCursorComponent(WarContext* context, const War...
function WarProjectileComponent (line 313) | WarProjectileComponent* we_getProjectileComponent(WarContext* context, c...
function WarPoisonCloudComponent (line 322) | WarPoisonCloudComponent* we_getPoisonCloudComponent(WarContext* context,...
function WarSightComponent (line 331) | WarSightComponent* we_getSightComponent(WarContext* context, const WarEn...
function WarTransformComponent (line 340) | WarTransformComponent* we_addTransformComponent(WarContext* context, War...
function we_removeTransformComponent (line 364) | void we_removeTransformComponent(WarContext* context, WarEntity* entity)
function WarSpriteComponent (line 394) | WarSpriteComponent* we_addSpriteComponent(WarContext* context, WarEntity...
function WarSpriteComponent (line 417) | WarSpriteComponent* we_addSpriteComponentFromResource(WarContext* contex...
function we_removeSpriteComponent (line 441) | void we_removeSpriteComponent(WarContext* context, WarEntity* entity)
function WarUnitComponent (line 471) | WarUnitComponent* we_addUnitComponent(WarContext* context, WarEntity* en...
function we_removeUnitComponent (line 494) | void we_removeUnitComponent(WarContext* context, WarEntity* entity)
function WarRoadComponent (line 522) | WarRoadComponent* we_addRoadComponent(WarContext* context, WarEntity* en...
function we_removeRoadComponent (line 548) | void we_removeRoadComponent(WarContext* context, WarEntity* entity)
function WarWallComponent (line 578) | WarWallComponent* we_addWallComponent(WarContext* context, WarEntity* en...
function we_removeWallComponent (line 604) | void we_removeWallComponent(WarContext* context, WarEntity* entity)
function WarRuinComponent (line 634) | WarRuinComponent* we_addRuinComponent(WarContext* context, WarEntity* en...
function we_removeRuinComponent (line 660) | void we_removeRuinComponent(WarContext* context, WarEntity* entity)
function WarForestComponent (line 690) | WarForestComponent* we_addForestComponent(WarContext* context, WarEntity...
function we_removeForestComponent (line 716) | void we_removeForestComponent(WarContext* context, WarEntity* entity)
function WarStateMachineComponent (line 746) | WarStateMachineComponent* we_addStateMachineComponent(WarContext* contex...
function we_removeStateMachineComponent (line 775) | void we_removeStateMachineComponent(WarContext* context, WarEntity* entity)
function WarAnimationsComponent (line 810) | WarAnimationsComponent* we_addAnimationsComponent(WarContext* context, W...
function we_removeAnimationsComponent (line 836) | void we_removeAnimationsComponent(WarContext* context, WarEntity* entity)
function WarUIComponent (line 866) | WarUIComponent* we_addUIComponent(WarContext* context, WarEntity* entity...
function we_removeUIComponent (line 892) | void we_removeUIComponent(WarContext* context, WarEntity* entity)
function WarTextComponent (line 920) | WarTextComponent* we_addTextComponent(WarContext* context, WarEntity* en...
function we_removeTextComponent (line 947) | void we_removeTextComponent(WarContext* context, WarEntity* entity)
function WarRectComponent (line 977) | WarRectComponent* we_addRectComponent(WarContext* context, WarEntity* en...
function we_removeRectComponent (line 1000) | void we_removeRectComponent(WarContext* context, WarEntity* entity)
function WarButtonComponent (line 1028) | WarButtonComponent* we_addButtonComponent(WarContext* context, WarEntity...
function WarButtonComponent (line 1051) | WarButtonComponent* we_addButtonComponentFromResource(WarContext* contex...
function we_removeButtonComponent (line 1081) | void we_removeButtonComponent(WarContext* context, WarEntity* entity)
function WarAudioComponent (line 1114) | WarAudioComponent* we_addAudioComponent(WarContext* context, WarEntity* ...
function we_removeAudioComponent (line 1156) | void we_removeAudioComponent(WarContext* context, WarEntity* entity)
function WarProjectileComponent (line 1195) | WarProjectileComponent* we_addProjectileComponent(WarContext* context, W...
function we_removeProjectileComponent (line 1218) | void we_removeProjectileComponent(WarContext* context, WarEntity* entity)
function WarCursorComponent (line 1246) | WarCursorComponent* we_addCursorComponent(WarContext* context, WarEntity...
function we_removeCursorComponent (line 1269) | void we_removeCursorComponent(WarContext* context, WarEntity* entity)
function WarPoisonCloudComponent (line 1297) | WarPoisonCloudComponent* we_addPoisonCloudComponent(WarContext* context,...
function we_removePoisonCloudComponent (line 1320) | void we_removePoisonCloudComponent(WarContext* context, WarEntity* entity)
function WarSightComponent (line 1348) | WarSightComponent* we_addSightComponent(WarContext* context, WarEntity* ...
function we_removeSightComponent (line 1371) | void we_removeSightComponent(WarContext* context, WarEntity* entity)
function WarEntity (line 1400) | WarEntity* we_createEntity(WarContext* context, WarEntityType type, bool...
function WarEntity (line 1446) | WarEntity* we_createUnit(WarContext* context, const CreateUnitArgs* args)
function WarEntity (line 1534) | WarEntity* we_createDude(WarContext* context, const CreateUnitArgs* args)
function WarEntity (line 1546) | WarEntity* we_createBuilding(WarContext* context, const CreateUnitArgs* ...
function WarEntity (line 1567) | WarEntity* we_findEntity(WarContext* context, WarEntityId id)
function WarEntity (line 1590) | WarEntity* we_findClosestUnitOfType(WarContext* context, WarEntity* enti...
function WarEntity (line 1619) | WarEntity* we_findUIEntity(WarContext* context, StringView name)
function WarEntity (line 1647) | WarEntity* we_findEntityUnderCursor(WarContext* context, bool includeTre...
function we_removeEntity (line 1775) | void we_removeEntity(WarContext* context, WarEntity* entity)
function we_removeEntityById (line 1838) | void we_removeEntityById(WarContext* context, WarEntityId id)
function we_initEntityManager (line 1853) | void we_initEntityManager(WarContext* context, WarEntityManager* manager)
function WarEntityManager (line 1926) | WarEntityManager* we_getEntityManager(WarContext* context)
function WarEntityList (line 1938) | WarEntityList* we_getEntitiesOfType(WarContext* context, WarEntityType t...
function WarEntityList (line 1947) | WarEntityList* we_getUnitsOfType(WarContext* context, WarUnitType type)
function WarEntityList (line 1956) | WarEntityList* we_getUIEntities(WarContext* context)
function s32 (line 1963) | s32 renderCompareUnits(const WarEntity* e1, const WarEntity* e2, void* u...
function s32 (line 1985) | s32 renderCompareProjectiles(const WarEntity* e1, const WarEntity* e2, v...
function renderImage (line 1999) | void renderImage(WarContext* context, WarEntity* entity)
function renderRoad (line 2037) | void renderRoad(WarContext* context, WarEntity* entity)
function renderWall (line 2087) | void renderWall(WarContext* context, WarEntity* entity)
function renderRuin (line 2154) | void renderRuin(WarContext* context, WarEntity* entity)
function renderForest (line 2207) | void renderForest(WarContext* context, WarEntity* entity)
function renderUnit (line 2247) | void renderUnit(WarContext* context, WarEntity* entity)
function renderText (line 2353) | void renderText(WarContext* context, WarEntity* entity)
function renderRect (line 2397) | void renderRect(WarContext* context, WarEntity* entity)
function renderButton (line 2421) | void renderButton(WarContext* context, WarEntity* entity)
function renderProjectile (line 2493) | void renderProjectile(WarContext* context, WarEntity* entity)
function renderMinimap (line 2560) | void renderMinimap(WarContext* context, WarEntity* entity)
function renderAnimation (line 2648) | void renderAnimation(WarContext* context, WarEntity* entity)
function we_renderEntity (line 2690) | void we_renderEntity(WarContext* context, WarEntity* entity)
function we_renderEntitiesOfType (line 2733) | void we_renderEntitiesOfType(WarContext* context, WarEntityType type)
function we_renderUnitSelection (line 2788) | void we_renderUnitSelection(WarContext* context)
function we_increaseUpgradeLevel (line 2842) | void we_increaseUpgradeLevel(WarContext* context, WarPlayerInfo* player,...
function we_enoughPlayerResources (line 2954) | bool we_enoughPlayerResources(WarContext* context, WarPlayerInfo* player...
function we_decreasePlayerResources (line 2961) | bool we_decreasePlayerResources(WarContext* context, WarPlayerInfo* play...
function we_increasePlayerResources (line 2980) | void we_increasePlayerResources(WarContext* context, WarPlayerInfo* play...
function we_increaseUnitHp (line 2988) | bool we_increaseUnitHp(WarContext* context, WarEntity* entity, s32 hp)
function we_decreaseUnitHp (line 3001) | bool we_decreaseUnitHp(WarContext* context, WarEntity* entity, s32 hp)
function we_decreaseUnitMana (line 3014) | bool we_decreaseUnitMana(WarContext* context, WarEntity* entity, s32 mana)
function we_increaseUnitMana (line 3031) | void we_increaseUnitMana(WarContext* context, WarEntity* entity, s32 mana)
function we_enoughFarmFood (line 3040) | bool we_enoughFarmFood(WarContext* context, WarPlayerInfo* player)
function we_checkFarmFood (line 3050) | bool we_checkFarmFood(WarContext* context, WarPlayerInfo* player)
function we_checkRectToBuild (line 3061) | bool we_checkRectToBuild(WarContext* context, s32 x, s32 y, s32 w, s32 h)
function we_checkTileToBuild (line 3084) | bool we_checkTileToBuild(WarContext* context, WarUnitType buildingToBuil...
function we_checkTileToBuildRoadOrWall (line 3097) | bool we_checkTileToBuildRoadOrWall(WarContext* context, s32 x, s32 y)
function WarEntityList (line 3108) | WarEntityList* we_getNearUnits(WarContext* context, vec2 tilePosition, s...
function WarEntity (line 3129) | WarEntity* we_getNearEnemy(WarContext* context, WarEntity* entity)
function we_isBeingAttackedBy (line 3160) | bool we_isBeingAttackedBy(WarContext* context, WarEntity* entity, WarEnt...
function we_isBeingAttacked (line 3171) | bool we_isBeingAttacked(WarContext* context, WarEntity* entity)
function WarEntity (line 3193) | WarEntity* we_getAttacker(WarContext* context, WarEntity* entity)
function WarEntity (line 3215) | WarEntity* we_getAttackTarget(WarContext* context, WarEntity* entity)
function s32 (line 3230) | s32 we_getTotalDamage(s32 minDamage, s32 rndDamage, s32 armor)
function we_takeDamage (line 3235) | void we_takeDamage(WarContext* context, WarEntity *entity, s32 minDamage...
function we_takeWallDamage (line 3309) | void we_takeWallDamage(WarContext* context, WarEntity* entity, WarWallPi...
function we_rangeAttack (line 3321) | void we_rangeAttack(WarContext* context, WarEntity* entity, WarEntity* t...
function we_rangeWallAttack (line 3355) | void we_rangeWallAttack(WarContext* context, WarEntity* entity, WarEntit...
function we_meleeAttack (line 3389) | void we_meleeAttack(WarContext* context, WarEntity* entity, WarEntity* t...
function we_meleeWallAttack (line 3414) | void we_meleeWallAttack(WarContext* context, WarEntity* entity, WarEntit...
function s32 (line 3439) | s32 mine(WarContext* context, WarEntity* goldmine, s32 amount)
FILE: src/war_entities.h
type _WarRoadPiece (line 19) | struct _WarRoadPiece
type _WarWallPiece (line 26) | struct _WarWallPiece
type _WarRuinPiece (line 35) | struct _WarRuinPiece
type _WarTree (line 41) | struct _WarTree
type _WarTransformComponent (line 92) | struct _WarTransformComponent
type _WarSpriteComponent (line 107) | struct _WarSpriteComponent
type _WarUnitComponent (line 122) | struct _WarUnitComponent
type _WarAnimationsComponent (line 206) | struct _WarAnimationsComponent
type _WarRoadComponent (line 211) | struct _WarRoadComponent
type _WarWallComponent (line 216) | struct _WarWallComponent
type _WarRuinComponent (line 221) | struct _WarRuinComponent
type _WarForestComponent (line 226) | struct _WarForestComponent
type _WarStateMachineComponent (line 231) | struct _WarStateMachineComponent
type _WarUIComponent (line 248) | struct _WarUIComponent
type _WarTextComponent (line 253) | struct _WarTextComponent
type _WarRectComponent (line 291) | struct _WarRectComponent
type _WarButtonComponent (line 304) | struct _WarButtonComponent
type _WarCursorComponent (line 337) | struct _WarCursorComponent
type _WarProjectileComponent (line 350) | struct _WarProjectileComponent
type _WarPoisonCloudComponent (line 371) | struct _WarPoisonCloudComponent
type _WarSightComponent (line 388) | struct _WarSightComponent
type _WarEntity (line 401) | struct _WarEntity
type _WarEntityManager (line 436) | struct _WarEntityManager
type CreateUnitArgs (line 590) | typedef struct {
FILE: src/war_enums.h
type DatabaseEntryType (line 6) | typedef enum
type WarMouseButtons (line 25) | typedef enum _WarMouseButtons
type WarKeys (line 33) | typedef enum _WarKeys
type WarFileType (line 129) | typedef enum _WarFileType
type WarResourceType (line 136) | typedef enum _WarResourceType
type WarLevelInfoType (line 155) | typedef enum _WarLevelInfoType
type WarRace (line 163) | typedef enum _WarRace
type WarUnitDirection (line 170) | typedef enum _WarUnitDirection
type WarUnitType (line 184) | typedef enum _WarUnitType
type WarAnimationStatus (line 252) | typedef enum _WarAnimationStatus
type WarResourceKind (line 259) | typedef enum _WarResourceKind
type WarConstructType (line 266) | typedef enum _WarConstructType
type WarCampaignMapType (line 273) | typedef enum _WarCampaignMapType
type WarLevelResult (line 302) | typedef enum _WarLevelResult
type WarMenuState (line 309) | typedef enum _WarMenuState
type WarFeatureType (line 321) | typedef enum _WarFeatureType
type WarUpgradeType (line 369) | typedef enum _WarUpgradeType
type WarSpellType (line 392) | typedef enum _WarSpellType
type WarUnitCommandType (line 411) | typedef enum _WarUnitCommandType
type WarEntityType (line 503) | typedef enum _WarEntityType
type WarRoadPieceType (line 527) | typedef enum _WarRoadPieceType
type WarWallPieceType (line 546) | typedef enum _WarWallPieceType
type WarRuinPieceType (line 565) | typedef enum _WarRuinPieceType
type WarTreeTileType (line 585) | typedef enum _WarTreeTileType
type WarUnitActionStepType (line 609) | typedef enum _WarUnitActionStepType
type WarUnitActionType (line 624) | typedef enum _WarUnitActionType
type WarUnitActionStatus (line 639) | typedef enum _WarUnitActionStatus
type PathFindingType (line 646) | typedef enum _PathFindingType
type WarPathFinderDataType (line 652) | typedef enum _WarPathFinderDataType
type WarStateType (line 659) | typedef enum _WarStateType
type WarTextAlignment (line 684) | typedef enum _WarTextAlignment
type WarTextWrapping (line 696) | typedef enum _WarTextWrapping
type WarTextTrimming (line 702) | typedef enum _WarTextTrimming
type WarAudioId (line 709) | typedef enum _WarAudioId
type WarAudioType (line 869) | typedef enum _WarAudioType
type WarCursorType (line 875) | typedef enum _WarCursorType
type WarProjectileType (line 895) | typedef enum _WarProjectileType
type WarMapTilesetType (line 905) | typedef enum _WarMapTilesetType
type WarFogPieceType (line 912) | typedef enum _WarFogPieceType
type WarFogBoundaryType (line 926) | typedef enum _WarFogBoundaryType
type WarUnitPortraits (line 933) | typedef enum _WarUnitPortraits
type WarMapTileState (line 1030) | typedef enum _WarMapTileState
type WarAICommandStatus (line 1037) | typedef enum _WarAICommandStatus
type WarAICommandType (line 1044) | typedef enum _WarAICommandType
type WarCheat (line 1055) | typedef enum _WarCheat
type WarMapSpeed (line 1087) | typedef enum _WarMapSpeed
type WarSceneType (line 1096) | typedef enum _WarSceneType
type WarSceneDownloadState (line 1106) | typedef enum _WarSceneDownloadState
type WarMainMenuPanel (line 1116) | typedef enum _WarMainMenuPanel
type WarComponentType (line 1123) | typedef enum _WarComponentType
FILE: src/war_file.c
function WarFile (line 5) | WarFile* wfile_loadWarFile(WarContext* context, StringView filePath)
FILE: src/war_font.c
function WarSprite (line 218) | WarSprite wfont_loadFontSprite(WarContext* context, StringView fontPath)
function WarFontData (line 233) | WarFontData getFontData(s32 fontIndex)
function vec2 (line 244) | vec2 wfont_getAlignmentOffset(WarTextAlignment horizontalAlign, WarTextA...
function f32 (line 299) | f32 wfont_getLineAlignmentOffset(WarTextAlignment lineAlign, f32 width, ...
type WarTextSpan (line 330) | typedef struct
function s32 (line 337) | static s32 wfont_splitTextIntoLines(StringView text, s32 maxLines, WarTe...
function vec2 (line 459) | vec2 wfont_measureSingleSpriteText(StringView text, s32 length, WarFontP...
function vec2 (line 492) | vec2 wfont_measureMultiSpriteText(StringView text, f32 width, WarFontPar...
function f32 (line 515) | f32 wfont_renderSingleSpriteTextSpan(WarContext* context, StringView text,
function wfont_renderSingleSpriteText (line 580) | void wfont_renderSingleSpriteText(WarContext* context, StringView text, ...
function wfont_renderMultiSpriteText (line 652) | void wfont_renderMultiSpriteText(WarContext* context, StringView text, f...
FILE: src/war_font.h
type _WarFontData (line 18) | struct _WarFontData
type WarFontParams (line 27) | typedef struct
FILE: src/war_fwd.h
type _WarInput (line 6) | struct _WarInput
type WarInput (line 7) | typedef struct _WarInput WarInput;
type _WarInputState (line 9) | struct _WarInputState
type WarInputState (line 10) | typedef struct _WarInputState WarInputState;
type _WarFontData (line 12) | struct _WarFontData
type WarFontData (line 13) | typedef struct _WarFontData WarFontData;
type _WarRawResource (line 15) | struct _WarRawResource
type WarRawResource (line 16) | typedef struct _WarRawResource WarRawResource;
type _WarFile (line 18) | struct _WarFile
type WarFile (line 19) | typedef struct _WarFile WarFile;
type _WarSpriteFrame (line 21) | struct _WarSpriteFrame
type WarSpriteFrame (line 22) | typedef struct _WarSpriteFrame WarSpriteFrame;
type _WarSprite (line 24) | struct _WarSprite
type WarSprite (line 25) | typedef struct _WarSprite WarSprite;
type _WarSpriteResourceRef (line 27) | struct _WarSpriteResourceRef
type WarSpriteResourceRef (line 28) | typedef struct _WarSpriteResourceRef WarSpriteResourceRef;
type _WarSpriteAnimation (line 30) | struct _WarSpriteAnimation
type WarSpriteAnimation (line 31) | typedef struct _WarSpriteAnimation WarSpriteAnimation;
type _WarLevelUnit (line 33) | struct _WarLevelUnit
type WarLevelUnit (line 34) | typedef struct _WarLevelUnit WarLevelUnit;
type _WarLevelConstruct (line 36) | struct _WarLevelConstruct
type WarLevelConstruct (line 37) | typedef struct _WarLevelConstruct WarLevelConstruct;
type _WarTilesetTile (line 39) | struct _WarTilesetTile
type WarTilesetTile (line 40) | typedef struct _WarTilesetTile WarTilesetTile;
type _WarCustomMapConfiguration (line 42) | struct _WarCustomMapConfiguration
type WarCustomMapConfiguration (line 43) | typedef struct _WarCustomMapConfiguration WarCustomMapConfiguration;
type _WarResource (line 45) | struct _WarResource
type WarResource (line 46) | typedef struct _WarResource WarResource;
type _WarUnitCommand (line 48) | struct _WarUnitCommand
type WarUnitCommand (line 49) | typedef struct _WarUnitCommand WarUnitCommand;
type _WarRoadPiece (line 51) | struct _WarRoadPiece
type WarRoadPiece (line 52) | typedef struct _WarRoadPiece WarRoadPiece;
type _WarWallPiece (line 54) | struct _WarWallPiece
type WarWallPiece (line 55) | typedef struct _WarWallPiece WarWallPiece;
type _WarRuinPiece (line 57) | struct _WarRuinPiece
type WarRuinPiece (line 58) | typedef struct _WarRuinPiece WarRuinPiece;
type _WarTree (line 60) | struct _WarTree
type WarTree (line 61) | typedef struct _WarTree WarTree;
type _WarUnitActionStep (line 63) | struct _WarUnitActionStep
type WarUnitActionStep (line 64) | typedef struct _WarUnitActionStep WarUnitActionStep;
type _WarUnitActionDef (line 66) | struct _WarUnitActionDef
type WarUnitActionDef (line 67) | typedef struct _WarUnitActionDef WarUnitActionDef;
type _WarUnitAction (line 69) | struct _WarUnitAction
type WarUnitAction (line 70) | typedef struct _WarUnitAction WarUnitAction;
type _WarUnitData (line 72) | struct _WarUnitData
type WarUnitData (line 73) | typedef struct _WarUnitData WarUnitData;
type _WarWorkerData (line 75) | struct _WarWorkerData
type WarWorkerData (line 76) | typedef struct _WarWorkerData WarWorkerData;
type _WarBuildingData (line 78) | struct _WarBuildingData
type WarBuildingData (line 79) | typedef struct _WarBuildingData WarBuildingData;
type _WarRoadData (line 81) | struct _WarRoadData
type WarRoadData (line 82) | typedef struct _WarRoadData WarRoadData;
type _WarWallData (line 84) | struct _WarWallData
type WarWallData (line 85) | typedef struct _WarWallData WarWallData;
type _WarRuinData (line 87) | struct _WarRuinData
type WarRuinData (line 88) | typedef struct _WarRuinData WarRuinData;
type _WarTreeData (line 90) | struct _WarTreeData
type WarTreeData (line 91) | typedef struct _WarTreeData WarTreeData;
type _WarUnitStats (line 93) | struct _WarUnitStats
type WarUnitStats (line 94) | typedef struct _WarUnitStats WarUnitStats;
type _WarBuildingStats (line 96) | struct _WarBuildingStats
type WarBuildingStats (line 97) | typedef struct _WarBuildingStats WarBuildingStats;
type _WarUpgradeData (line 99) | struct _WarUpgradeData
type WarUpgradeData (line 100) | typedef struct _WarUpgradeData WarUpgradeData;
type _WarUpgradeStats (line 102) | struct _WarUpgradeStats
type WarUpgradeStats (line 103) | typedef struct _WarUpgradeStats WarUpgradeStats;
type _WarSpellData (line 105) | struct _WarSpellData
type WarSpellData (line 106) | typedef struct _WarSpellData WarSpellData;
type _WarSpellStats (line 108) | struct _WarSpellStats
type WarSpellStats (line 109) | typedef struct _WarSpellStats WarSpellStats;
type _WarSpellMapping (line 111) | struct _WarSpellMapping
type WarSpellMapping (line 112) | typedef struct _WarSpellMapping WarSpellMapping;
type _WarUnitCommandBaseData (line 114) | struct _WarUnitCommandBaseData
type WarUnitCommandBaseData (line 115) | typedef struct _WarUnitCommandBaseData WarUnitCommandBaseData;
type _WarUnitCommandMapping (line 117) | struct _WarUnitCommandMapping
type WarUnitCommandMapping (line 118) | typedef struct _WarUnitCommandMapping WarUnitCommandMapping;
type _WarUnitCommandData (line 120) | struct _WarUnitCommandData
type WarUnitCommandData (line 121) | typedef struct _WarUnitCommandData WarUnitCommandData;
type _WarMapNode (line 123) | struct _WarMapNode
type WarMapNode (line 124) | typedef struct _WarMapNode WarMapNode;
type _WarMapPath (line 126) | struct _WarMapPath
type WarMapPath (line 127) | typedef struct _WarMapPath WarMapPath;
type _WarPathFinder (line 129) | struct _WarPathFinder
type WarPathFinder (line 130) | typedef struct _WarPathFinder WarPathFinder;
type _WarState (line 132) | struct _WarState
type WarState (line 133) | typedef struct _WarState WarState;
type _WarCampaignMapData (line 135) | struct _WarCampaignMapData
type WarCampaignMapData (line 136) | typedef struct _WarCampaignMapData WarCampaignMapData;
type _WarSpriteComponent (line 138) | struct _WarSpriteComponent
type WarSpriteComponent (line 139) | typedef struct _WarSpriteComponent WarSpriteComponent;
type _WarUnitComponent (line 141) | struct _WarUnitComponent
type WarUnitComponent (line 142) | typedef struct _WarUnitComponent WarUnitComponent;
type _WarAnimationsComponent (line 144) | struct _WarAnimationsComponent
type WarAnimationsComponent (line 145) | typedef struct _WarAnimationsComponent WarAnimationsComponent;
type _WarRoadComponent (line 147) | struct _WarRoadComponent
type WarRoadComponent (line 148) | typedef struct _WarRoadComponent WarRoadComponent;
type _WarWallComponent (line 150) | struct _WarWallComponent
type WarWallComponent (line 151) | typedef struct _WarWallComponent WarWallComponent;
type _WarRuinComponent (line 153) | struct _WarRuinComponent
type WarRuinComponent (line 154) | typedef struct _WarRuinComponent WarRuinComponent;
type _WarForestComponent (line 156) | struct _WarForestComponent
type WarForestComponent (line 157) | typedef struct _WarForestComponent WarForestComponent;
type _WarStateMachineComponent (line 159) | struct _WarStateMachineComponent
type WarStateMachineComponent (line 160) | typedef struct _WarStateMachineComponent WarStateMachineComponent;
type _WarUIComponent (line 162) | struct _WarUIComponent
type WarUIComponent (line 163) | typedef struct _WarUIComponent WarUIComponent;
type _WarTextComponent (line 165) | struct _WarTextComponent
type WarTextComponent (line 166) | typedef struct _WarTextComponent WarTextComponent;
type _WarRectComponent (line 168) | struct _WarRectComponent
type WarRectComponent (line 169) | typedef struct _WarRectComponent WarRectComponent;
type _WarButtonComponent (line 171) | struct _WarButtonComponent
type WarButtonComponent (line 172) | typedef struct _WarButtonComponent WarButtonComponent;
type _WarAudioComponent (line 174) | struct _WarAudioComponent
type WarAudioComponent (line 175) | typedef struct _WarAudioComponent WarAudioComponent;
type _WarCursorComponent (line 177) | struct _WarCursorComponent
type WarCursorComponent (line 178) | typedef struct _WarCursorComponent WarCursorComponent;
type _WarProjectileComponent (line 180) | struct _WarProjectileComponent
type WarProjectileComponent (line 181) | typedef struct _WarProjectileComponent WarProjectileComponent;
type _WarPoisonCloudComponent (line 183) | struct _WarPoisonCloudComponent
type WarPoisonCloudComponent (line 184) | typedef struct _WarPoisonCloudComponent WarPoisonCloudComponent;
type _WarSightComponent (line 186) | struct _WarSightComponent
type WarSightComponent (line 187) | typedef struct _WarSightComponent WarSightComponent;
type _WarEntity (line 189) | struct _WarEntity
type WarEntity (line 190) | typedef struct _WarEntity WarEntity;
type _WarMapTile (line 192) | struct _WarMapTile
type WarMapTile (line 193) | typedef struct _WarMapTile WarMapTile;
type _WarUpgrade (line 195) | struct _WarUpgrade
type WarUpgrade (line 196) | typedef struct _WarUpgrade WarUpgrade;
type _WarAICommand (line 198) | struct _WarAICommand
type WarAICommand (line 199) | typedef struct _WarAICommand WarAICommand;
type _WarAI (line 201) | struct _WarAI
type WarAI (line 202) | typedef struct _WarAI WarAI;
type _WarPlayerInfo (line 204) | struct _WarPlayerInfo
type WarPlayerInfo (line 205) | typedef struct _WarPlayerInfo WarPlayerInfo;
type _WarFlashStatus (line 207) | struct _WarFlashStatus
type WarFlashStatus (line 208) | typedef struct _WarFlashStatus WarFlashStatus;
type _WarCheatStatus (line 210) | struct _WarCheatStatus
type WarCheatStatus (line 211) | typedef struct _WarCheatStatus WarCheatStatus;
type _WarMapSettings (line 213) | struct _WarMapSettings
type WarMapSettings (line 214) | typedef struct _WarMapSettings WarMapSettings;
type _WarEntityManager (line 216) | struct _WarEntityManager
type WarEntityManager (line 217) | typedef struct _WarEntityManager WarEntityManager;
type _WarMap (line 219) | struct _WarMap
type WarMap (line 220) | typedef struct _WarMap WarMap;
type _WarScene (line 222) | struct _WarScene
type WarScene (line 223) | typedef struct _WarScene WarScene;
type _WarCheatDescriptor (line 225) | struct _WarCheatDescriptor
type WarCheatDescriptor (line 226) | typedef struct _WarCheatDescriptor WarCheatDescriptor;
type _WarSceneDescriptor (line 228) | struct _WarSceneDescriptor
type WarSceneDescriptor (line 229) | typedef struct _WarSceneDescriptor WarSceneDescriptor;
type _WarTransformComponent (line 231) | struct _WarTransformComponent
type WarTransformComponent (line 232) | typedef struct _WarTransformComponent WarTransformComponent;
type _WarRenderState (line 234) | struct _WarRenderState
type WarRenderState (line 235) | typedef struct _WarRenderState WarRenderState;
type _WarImuiSpriteEntry (line 237) | struct _WarImuiSpriteEntry
type WarImuiSpriteEntry (line 238) | typedef struct _WarImuiSpriteEntry WarImuiSpriteEntry;
type _WarImuiState (line 240) | struct _WarImuiState
type WarImuiState (line 241) | typedef struct _WarImuiState WarImuiState;
type _WarContext (line 243) | struct _WarContext
type WarContext (line 244) | typedef struct _WarContext WarContext;
type WarEntityId (line 246) | typedef uint16_t WarEntityId;
type WarLevelResult (line 249) | typedef WarLevelResult (*WarCheckObjectivesFunc)(WarContext* context);
FILE: src/war_game.c
function WarKeys (line 30) | static WarKeys wg_getWarKeyFromSDLKey(SDL_Keycode key)
function wg_appendCheatTextInput (line 135) | static void wg_appendCheatTextInput(WarContext* context, StringView text)
function wg_initGame (line 167) | bool wg_initGame(WarContext* context)
function wg_quitGame (line 251) | void wg_quitGame(WarContext* context)
function wg_loadDataFile (line 302) | bool wg_loadDataFile(WarContext* context)
function wg_setWindowSize (line 319) | void wg_setWindowSize(WarContext* context, s32 width, s32 height)
function wg_setGlobalScale (line 326) | void wg_setGlobalScale(WarContext* context, f32 scale)
function wg_changeGlobalScale (line 336) | void wg_changeGlobalScale(WarContext* context, f32 deltaScale)
function wg_setGlobalSpeed (line 341) | void wg_setGlobalSpeed(WarContext* context, f32 speed)
function wg_changeGlobalSpeed (line 347) | void wg_changeGlobalSpeed(WarContext* context, f32 deltaSpeed)
function wg_setMusicVolume (line 352) | void wg_setMusicVolume(WarContext* context, f32 volume)
function wg_changeMusicVolume (line 358) | void wg_changeMusicVolume(WarContext* context, f32 deltaVolume)
function wg_setSoundVolume (line 363) | void wg_setSoundVolume(WarContext* context, f32 volume)
function wg_changeSoundVolume (line 369) | void wg_changeSoundVolume(WarContext* context, f32 deltaVolume)
function wg_setNextScene (line 374) | void wg_setNextScene(WarContext* context, WarScene* scene, f32 transitio...
function wg_setNextMap (line 380) | void wg_setNextMap(WarContext* context, WarMap* map, f32 transitionDelay)
function wg_setInputButton (line 386) | void wg_setInputButton(WarContext* context, s32 button, bool pressed)
function wg_setInputKey (line 403) | void wg_setInputKey(WarContext* context, s32 key, bool pressed)
function wg_beginInputFrame (line 420) | void wg_beginInputFrame(WarContext* context)
function wg_processGameEvent (line 437) | void wg_processGameEvent(WarContext* context, SDL_Event* event)
function wg_updateGame (line 543) | void wg_updateGame(WarContext* context)
function wg_renderGame (line 636) | void wg_renderGame(WarContext *context)
function wg_presentGame (line 672) | void wg_presentGame(WarContext *context)
FILE: src/war_imui.c
function WarSprite (line 22) | static WarSprite imui_getOrCreateSprite(WarContext* context, WarSpriteRe...
function imui_deferTooltip (line 83) | void imui_deferTooltip(WarContext* context, StringView tooltip, s32 high...
function imui_begin (line 109) | void imui_begin(WarContext* context)
function imui_end (line 128) | void imui_end(WarContext* context)
function imui_text (line 240) | void imui_text(WarContext* context, const char* id, const CreateUITextAr...
function imui_rect (line 278) | void imui_rect(WarContext* context, const char* id, const CreateUIRectAr...
function imui_image (line 293) | void imui_image(WarContext* context, const char* id, const CreateUIImage...
function imui_image_frame (line 316) | void imui_image_frame(WarContext* context, const char* id, const CreateU...
function imui_evalButton (line 346) | static bool imui_evalButton(WarContext* context, u32 itemId, rect button...
function imui_image_button (line 388) | bool imui_image_button(WarContext* context, const char* id, const Create...
function imui_text_button (line 461) | bool imui_text_button(WarContext* context, const char* id, const CreateU...
FILE: src/war_imui.h
function u32 (line 9) | static inline u32 imui_hashCString(const char* str)
FILE: src/war_log.c
function wlog_log (line 6) | void wlog_log(SDL_LogPriority priority, const char* file, int line, cons...
FILE: src/war_map.c
function wmap_addEntityToSelection (line 26) | void wmap_addEntityToSelection(WarContext* context, WarEntityId id)
function wmap_removeEntityFromSelection (line 35) | void wmap_removeEntityFromSelection(WarContext* context, WarEntityId id)
function wmap_clearSelection (line 41) | void wmap_clearSelection(WarContext* context)
function vec2 (line 47) | vec2 wmap_getDirFromArrowKeys(WarContext* context)
function vec2 (line 67) | vec2 wmap_getDirFromMousePos(WarContext* context)
function vec2 (line 87) | vec2 wmap_screenToMapCoordinatesV(WarContext* context, vec2 v)
function vec2 (line 99) | vec2 wmap_screenToMinimapCoordinatesV(WarContext* context, vec2 v)
function rect (line 109) | rect wmap_screenToMapCoordinatesR(WarContext* context, rect r)
function vec2 (line 121) | vec2 wmap_mapToScreenCoordinatesV(WarContext* context, vec2 v)
function rect (line 130) | rect wmap_mapToScreenCoordinatesR(WarContext* context, rect r)
function vec2 (line 139) | vec2 wmap_mapToTileCoordinatesV(vec2 v)
function vec2 (line 146) | vec2 wmap_tileToMapCoordinatesV(vec2 v, bool centeredInTile)
function vec2 (line 160) | vec2 wmap_minimapToViewp
Condensed preview — 230 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,131K chars).
[
{
"path": ".clangformat",
"chars": 2209,
"preview": "# ClangFormat configuration for war1-c\n# Style: Allman braces, 4-space indent, no tabs, C99/C11\n\nLanguage: Cpp\nBasedOnSt"
},
{
"path": ".github/workflows/build.yml",
"chars": 1799,
"preview": "name: build\n\non:\n push:\n branches:\n - master\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n linux:\n "
},
{
"path": ".gitignore",
"chars": 208,
"preview": "/build/\n/.vscode/\nbuild_timings.ctm\nctime.exe\nnob.exe\nnob.exe.old\nnob.obj\nnob\nflic-file-format\noutput_189.png\noutput_192"
},
{
"path": "ANALYSIS.md",
"chars": 24683,
"preview": "# War1-C: Comprehensive Project Analysis\n\n**Author:** Alejandro Coto Gutierrez\n**Repository:** https://github.com/acoto8"
},
{
"path": "LICENSE",
"chars": 868,
"preview": "zlib License\n\n(C) 2019 Alejandro Coto Gutiérrez\n\nThis software is provided 'as-is', without any express or implied\nwarra"
},
{
"path": "README.md",
"chars": 5606,
"preview": "# War1\n\nA remake of Warcraft: Orcs & Humans written in C.\n\nThis is a remake of the Warcraft: Orcs & Humans game created "
},
{
"path": "cinematics.txt",
"chars": 2437,
"preview": "File name Scene Length\nCAVE1 Approaching cave 7.7 secs\n"
},
{
"path": "deps/include/SDL3/SDL.h",
"chars": 2985,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_assert.h",
"chars": 28007,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_asyncio.h",
"chars": 23450,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_atomic.h",
"chars": 25367,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_audio.h",
"chars": 97364,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_begin_code.h",
"chars": 18082,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_bits.h",
"chars": 4352,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_blendmode.h",
"chars": 9342,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_camera.h",
"chars": 21110,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_clipboard.h",
"chars": 12435,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_close_code.h",
"chars": 1567,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_copying.h",
"chars": 984,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_cpuinfo.h",
"chars": 11359,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_dialog.h",
"chars": 14538,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_dlopennote.h",
"chars": 8786,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_egl.h",
"chars": 108941,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_endian.h",
"chars": 20162,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_error.h",
"chars": 7095,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_events.h",
"chars": 71602,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_filesystem.h",
"chars": 22921,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_gamepad.h",
"chars": 59474,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_gpu.h",
"chars": 181772,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_guid.h",
"chars": 3430,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_haptic.h",
"chars": 45075,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_hidapi.h",
"chars": 22043,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_hints.h",
"chars": 167853,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_init.h",
"chars": 20850,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_intrin.h",
"chars": 13860,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_iostream.h",
"chars": 53548,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_joystick.h",
"chars": 51596,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_keyboard.h",
"chars": 21492,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_keycode.h",
"chars": 26697,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_loadso.h",
"chars": 5182,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_locale.h",
"chars": 4524,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_log.h",
"chars": 16982,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_main.h",
"chars": 27472,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_main_impl.h",
"chars": 5846,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_messagebox.h",
"chars": 8178,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_metal.h",
"chars": 3354,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_misc.h",
"chars": 2919,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_mouse.h",
"chars": 31719,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_mutex.h",
"chars": 36760,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_oldnames.h",
"chars": 80730,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_opengl.h",
"chars": 126683,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_opengl_glext.h",
"chars": 864070,
"preview": "/* SDL modified the include guard to be compatible with Mesa and Apple include guards:\n * - Mesa uses: __gl_glext_h_\n * "
},
{
"path": "deps/include/SDL3/SDL_opengles.h",
"chars": 1244,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_opengles2.h",
"chars": 1615,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_opengles2_gl2.h",
"chars": 42938,
"preview": "#ifndef __gles2_gl2_h_\n#define __gles2_gl2_h_ 1\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n** Copyright 2013-2020 The K"
},
{
"path": "deps/include/SDL3/SDL_opengles2_gl2ext.h",
"chars": 241221,
"preview": "#ifndef __gles2_gl2ext_h_\n#define __gles2_gl2ext_h_ 1\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n** Copyright 2013-2020"
},
{
"path": "deps/include/SDL3/SDL_opengles2_gl2platform.h",
"chars": 646,
"preview": "#ifndef __gl2platform_h_\n#define __gl2platform_h_\n\n/*\n** Copyright 2017-2020 The Khronos Group Inc.\n** SPDX-License-Iden"
},
{
"path": "deps/include/SDL3/SDL_opengles2_khrplatform.h",
"chars": 11131,
"preview": "#ifndef __khrplatform_h_\n#define __khrplatform_h_\n\n/*\n** Copyright (c) 2008-2018 The Khronos Group Inc.\n**\n** Permission"
},
{
"path": "deps/include/SDL3/SDL_pen.h",
"chars": 8289,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_pixels.h",
"chars": 59712,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_platform.h",
"chars": 1963,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_platform_defines.h",
"chars": 12169,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_power.h",
"chars": 4229,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_process.h",
"chars": 18490,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_properties.h",
"chars": 20371,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_rect.h",
"chars": 19081,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_render.h",
"chars": 127837,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_revision.h",
"chars": 1419,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided 'as-"
},
{
"path": "deps/include/SDL3/SDL_scancode.h",
"chars": 17246,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_sensor.h",
"chars": 10498,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_stdinc.h",
"chars": 205856,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_storage.h",
"chars": 25967,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_surface.h",
"chars": 70993,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_system.h",
"chars": 30121,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test.h",
"chars": 1954,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_assert.h",
"chars": 3196,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_common.h",
"chars": 8804,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_compare.h",
"chars": 2778,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_crc32.h",
"chars": 3614,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_font.h",
"chars": 5505,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_fuzzer.h",
"chars": 13205,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_harness.h",
"chars": 5374,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_log.h",
"chars": 2571,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_md5.h",
"chars": 4633,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_test_memory.h",
"chars": 1942,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_thread.h",
"chars": 23725,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_time.h",
"chars": 8739,
"preview": "/*\nSimple DirectMedia Layer\nCopyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\nThis software is provided 'as-is'"
},
{
"path": "deps/include/SDL3/SDL_timer.h",
"chars": 14681,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_touch.h",
"chars": 6353,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_tray.h",
"chars": 17471,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_version.h",
"chars": 5809,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_video.h",
"chars": 142151,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n\n This software is provided '"
},
{
"path": "deps/include/SDL3/SDL_vulkan.h",
"chars": 11897,
"preview": "/*\n Simple DirectMedia Layer\n Copyright (C) 2017, Mark Callow\n\n This software is provided 'as-is', without any expres"
},
{
"path": "deps/include/TinySoundFont/tml.h",
"chars": 19411,
"preview": "/* TinyMidiLoader - v0.7 - Minimalistic midi parsing library - https://github.com/schellingb/TinySoundFont\n "
},
{
"path": "deps/include/TinySoundFont/tsf.h",
"chars": 75909,
"preview": "/* TinySoundFont - v0.8 - SoundFont2 synthesizer - https://github.com/schellingb/TinySoundFont\r\n "
},
{
"path": "deps/include/TracyC.h",
"chars": 19802,
"preview": "#ifndef __TRACYC_HPP__\n#define __TRACYC_HPP__\n\n#include <stddef.h>\n#include <stdint.h>\n\n// Inlined from TracyApi.h\n// On"
},
{
"path": "deps/include/shl/array.h",
"chars": 2997,
"preview": "/*\n array.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Perm"
},
{
"path": "deps/include/shl/binary_heap.h",
"chars": 8278,
"preview": "/*\n binary_heap.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n "
},
{
"path": "deps/include/shl/flic.h",
"chars": 13519,
"preview": "/*\n flic.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Permi"
},
{
"path": "deps/include/shl/list.h",
"chars": 10434,
"preview": "/*\n list.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Permi"
},
{
"path": "deps/include/shl/map.h",
"chars": 11678,
"preview": "/*\n map.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Permis"
},
{
"path": "deps/include/shl/memory_buffer.h",
"chars": 15312,
"preview": "/*\n memory_buffer.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n"
},
{
"path": "deps/include/shl/memzone.h",
"chars": 27531,
"preview": "/*\n memzone.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Pe"
},
{
"path": "deps/include/shl/memzone_audit.h",
"chars": 28887,
"preview": "/*\n memzone_audit.h - companion header for memzone.h\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérre"
},
{
"path": "deps/include/shl/queue.h",
"chars": 5782,
"preview": "/*\n queue.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Perm"
},
{
"path": "deps/include/shl/set.h",
"chars": 9023,
"preview": "/*\n set.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Permis"
},
{
"path": "deps/include/shl/shl_internal.h",
"chars": 2887,
"preview": "/*\n shl_internal.h - shared internal helpers for SHL collection headers.\n This file is not part of the public API "
},
{
"path": "deps/include/shl/stack.h",
"chars": 5190,
"preview": "/*\n stack.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Perm"
},
{
"path": "deps/include/shl/wav.h",
"chars": 7458,
"preview": "/*\n wav.h - based on Wave_Writer by Shay Green\n\n MIT License\n\n Copyright (C) 2003-2005 Shay Green\n\n Permissi"
},
{
"path": "deps/include/shl/wstr.h",
"chars": 29237,
"preview": "/*\n wstr.h - acoto87 (acoto87@gmail.com)\n\n MIT License\n\n Copyright (c) 2018 Alejandro Coto Gutiérrez\n\n Permi"
},
{
"path": "deps/include/stb/stb_image.h",
"chars": 283010,
"preview": "/* stb_image - v2.30 - public domain image loader - http://nothings.org/stb\n no warrant"
},
{
"path": "deps/include/stb/stb_image_resize.h",
"chars": 115999,
"preview": "/* stb_image_resize - v0.95 - public domain image resizing\n by Jorge L Rodriguez (@VinoBS) - 2014\n http://github.com"
},
{
"path": "deps/include/stb/stb_image_write.h",
"chars": 66523,
"preview": "/* stb_image_write - v1.11 - public domain - http://nothings.org/stb/stb_image_write.h\n writes out PNG/BMP/TGA/JPEG/HD"
},
{
"path": "docs/ACTION_SYSTEM.md",
"chars": 22743,
"preview": "# War1-C Action System Documentation\n\n## Overview\n\nThe Action System is the core animation and behavior framework in War"
},
{
"path": "docs/ANIMATION_SYSTEM.md",
"chars": 22968,
"preview": "# War1-C Animation System Documentation\n\n## Overview\n\nThe Animation System is a sprite frame sequence engine for one-off"
},
{
"path": "docs/COMMANDS_SYSTEM.md",
"chars": 22091,
"preview": "# War1-C Commands System Documentation\n\n## Overview\n\nThe Commands System is the **interface between player input and gam"
},
{
"path": "docs/ENTITIES_SYSTEM.md",
"chars": 27327,
"preview": "# Entities Subsystem Documentation\n\n## Overview\n\nThe **Entities subsystem** implements a component-based entity manageme"
},
{
"path": "docs/INPUT_SYSTEM.md",
"chars": 14881,
"preview": "# Input Subsystem Documentation\n\n## Overview\n\nThe input subsystem is the engine's frame-synchronous translation layer be"
},
{
"path": "docs/SCENES_SYSTEM.md",
"chars": 21737,
"preview": "# Scenes Management Subsystem\n\n## Overview\n\nThe **Scenes subsystem** (`war_scenes.h`, `war_scenes.c`) is the central sta"
},
{
"path": "docs/STATE_MACHINE_SYSTEM.md",
"chars": 25472,
"preview": "# State Machine Subsystem\n\n**Module Prefix:** `wst_` \n**Primary Files:** `war_state_machine.h`, `war_state_machine.c`, "
},
{
"path": "docs/UI_SYSTEM.md",
"chars": 27609,
"preview": "# War1-C UI Subsystem Documentation\n\n## Overview\n\nThe UI subsystem (`war_ui.c`/`war_ui.h`) is a component-based entity s"
},
{
"path": "nob.c",
"chars": 18991,
"preview": "#ifndef _DEFAULT_SOURCE\n#define _DEFAULT_SOURCE\n#endif\n\n#ifndef _POSIX_C_SOURCE\n#define _POSIX_C_SOURCE 200809L\n#endif\n#"
},
{
"path": "nob.h",
"chars": 121383,
"preview": "/* nob - v3.8.2 - Public Domain - https://github.com/tsoding/nob.h\n\n This library is the next generation of the [NoBui"
},
{
"path": "src/common.h",
"chars": 960,
"preview": "#pragma once\n\n#include <stdio.h>\n#include <stdint.h>\n\ntypedef int8_t s8;\ntypedef int16_t s16;\ntypedef int32_t s32;\ntyped"
},
{
"path": "src/war.h",
"chars": 8923,
"preview": "#pragma once\n\n#include <stdbool.h>\n#include <stdlib.h>\n\n#include \"war_color.h\"\n#include \"war_math.h\"\n#include \"war_fwd.h"
},
{
"path": "src/war1.c",
"chars": 6871,
"preview": "#ifdef _MSC_VER\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#define _DEFAULT_SOURCE\n\n#include <stdio.h>\n#include <stdint.h>\n"
},
{
"path": "src/war_actions.c",
"chars": 47680,
"preview": "#include \"war_actions.h\"\n\n#include <assert.h>\n#include <stdlib.h>\n\n#include \"war.h\"\n#include \"war_units.h\"\n\n#define __fr"
},
{
"path": "src/war_actions.h",
"chars": 1292,
"preview": "#pragma once\n\n#include \"shl/list.h\"\n\n#include \"war_fwd.h\"\n#include \"war_math.h\"\n\nstruct _WarUnitActionStep\n{\n WarUnit"
},
{
"path": "src/war_ai.c",
"chars": 10671,
"preview": "#include \"war_ai.h\"\n\n#include <assert.h>\n\nbool wai_equalsAICommand(const WarAICommand* command1, const WarAICommand* co"
},
{
"path": "src/war_ai.h",
"chars": 1639,
"preview": "#pragma once\n\n#include \"shl/list.h\"\n#include \"shl/queue.h\"\n\n#include \"war_units.h\"\n\nstruct _WarAICommand\n{\n u32 id;\n "
},
{
"path": "src/war_alloc.c",
"chars": 5129,
"preview": "#include <assert.h>\n#include <stdint.h>\n#include <stdlib.h>\n\n#define SHL_MZ_IMPLEMENTATION\n#ifdef SHL_MZ_DEBUG\n# defin"
},
{
"path": "src/war_alloc.h",
"chars": 1184,
"preview": "#pragma once\n\n#include <stddef.h>\n#include <stdbool.h>\n\n// Forward declare memzone_t\ntypedef struct memzone_s memzone_t;"
},
{
"path": "src/war_animations.c",
"chars": 11806,
"preview": "#include \"shl/wstr.h\"\n\n#include <assert.h>\n\n#include \"war_animations.h\"\n#include \"war_sprites.h\"\n#include \"war_resource"
},
{
"path": "src/war_animations.h",
"chars": 2362,
"preview": "#pragma once\n\n#include \"shl/list.h\"\n\n#include \"common.h\"\n#include \"war_sprites.h\"\n\nstruct _WarSpriteAnimation\n{\n Str"
},
{
"path": "src/war_audio.c",
"chars": 39606,
"preview": "#include \"war_audio.h\"\n\n#include <assert.h>\n\n#include \"SDL3/SDL.h\"\n#include \"shl/memory_buffer.h\"\n#include \"shl/memzone."
},
{
"path": "src/war_audio.h",
"chars": 2402,
"preview": "#pragma once\n\n#include <stddef.h>\n\n#include \"war_math.h\"\n#include \"war_actions.h\"\n\ntypedef struct tsf tsf;\ntypedef stru"
},
{
"path": "src/war_campaigns.c",
"chars": 18943,
"preview": "#include \"war_campaigns.h\"\n\n#include <assert.h>\n\n#include \"shl/wstr.h\"\n\n#include \"war_entities.h\"\n#include \"war_units.h\""
},
{
"path": "src/war_campaigns.h",
"chars": 329,
"preview": "#pragma once\n\n#include \"war_audio.h\"\n\nstruct _WarCampaignMapData\n{\n WarCampaignMapType type;\n WarCheckObjectivesFu"
},
{
"path": "src/war_cheats.c",
"chars": 21697,
"preview": "#include \"war_cheats.h\"\n\n#include \"shl/wstr.h\"\n\n#include \"war_audio.h\"\n#include \"war_entities.h\"\n#include \"war_game.h\"\n"
},
{
"path": "src/war_cheats.h",
"chars": 3077,
"preview": "#pragma once\n\n#include \"war_math.h\"\n#include \"war_fwd.h\"\n\n#define STATUS_TEXT_MAX_LENGTH 40\n#define CHEAT_TEXT_MAX_LENG"
},
{
"path": "src/war_cheats_panel.c",
"chars": 7519,
"preview": "#include \"war_cheats.h\"\n\n#include <assert.h>\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"SDL3/SDL.h\"\n#include \"shl"
},
{
"path": "src/war_color.h",
"chars": 1402,
"preview": "#pragma once\n\n#include <stdint.h>\n\ntypedef union {\n uint32_t packed;\n uint8_t rgba[4];\n struct { uint8_t r, g, "
},
{
"path": "src/war_commands.c",
"chars": 62117,
"preview": "#include \"war_commands.h\"\n\n#include <assert.h>\n#include <stdlib.h>\n\n#include \"war_audio.h\"\n#include \"war_entities.h\"\n#in"
},
{
"path": "src/war_commands.h",
"chars": 5393,
"preview": "#pragma once\n\n#include \"common.h\"\n#include \"war_fwd.h\"\n#include \"war_units.h\"\n\nstruct _WarUnitCommand\n{\n WarUnitComma"
},
{
"path": "src/war_database.h",
"chars": 63109,
"preview": "#pragma once\n\n#include \"common.h\"\n#include \"war_fwd.h\"\n\ntypedef struct\n{\n s32 index;\n DatabaseEntryType type;\n "
},
{
"path": "src/war_entities.c",
"chars": 113203,
"preview": "#include <assert.h>\n#include <stdlib.h>\n\n#include \"shl/wstr.h\"\n\n#include \"war_entities.h\"\n\n#include \"war_animations.h\"\n#"
},
{
"path": "src/war_entities.h",
"chars": 28144,
"preview": "#pragma once\n\n#include \"shl/memzone.h\"\n#include \"shl/list.h\"\n#include \"shl/set.h\"\n#include \"shl/map.h\"\n\n#include \"commo"
},
{
"path": "src/war_enums.h",
"chars": 28953,
"preview": "#pragma once\n\n// NOTE: All the enums in the game are defined here\n// Cannot forward declare enums in C, as it's not allo"
},
{
"path": "src/war_file.c",
"chars": 5632,
"preview": "#include \"war_file.h\"\n\n#include \"war_log.h\"\n\nWarFile* wfile_loadWarFile(WarContext* context, StringView filePath)\n{\n "
},
{
"path": "src/war_file.h",
"chars": 151,
"preview": "#pragma once\n\n#include \"shl/wstr.h\"\n#include \"war.h\"\n#include \"war_resources.h\"\n\nWarFile* wfile_loadWarFile(WarContext* "
},
{
"path": "src/war_font.c",
"chars": 26137,
"preview": "#include \"war_font.h\"\n\n#include \"war_sprites.h\"\n#include \"shl/wstr.h\"\n\n// the fonts was created in a 64x64 (64x96 for t"
},
{
"path": "src/war_font.h",
"chars": 1484,
"preview": "#pragma once\n\n#include \"war_math.h\"\n#include \"war_color.h\"\n#include \"war_sprites.h\"\n\n#define FONT_NORMAL_COLOR_INIT WAR_"
},
{
"path": "src/war_fwd.h",
"chars": 6361,
"preview": "#pragma once\n\n#include <stdint.h>\n#include \"war_enums.h\"\n\nstruct _WarInput;\ntypedef struct _WarInput WarInput;\n\nstruct _"
},
{
"path": "src/war_game.c",
"chars": 20192,
"preview": "#include \"war_game.h\"\n\n#include <assert.h>\n#include <math.h>\n\n#if defined(_MSC_VER) && !defined(__clan_)\n#include <io.h"
},
{
"path": "src/war_game.h",
"chars": 1285,
"preview": "#pragma once\n\n#include \"SDL3/SDL_events.h\"\n\n#include \"common.h\"\n#include \"war_fwd.h\"\n\nbool wg_initGame(WarContext* conte"
},
{
"path": "src/war_imui.c",
"chars": 19189,
"preview": "#include \"war_imui.h\"\n\n#include <assert.h>\n#include <string.h>\n\n#include \"war_audio.h\"\n#include \"war_font.h\"\n#include \"w"
},
{
"path": "src/war_imui.h",
"chars": 3230,
"preview": "#pragma once\n\n#include \"war.h\"\n#include \"war_ui.h\"\n\n// -----------------------------------------------------------------"
},
{
"path": "src/war_log.c",
"chars": 775,
"preview": "#include \"war_log.h\"\n\n#include <stdarg.h>\n#include <stdio.h>\n\nvoid wlog_log(SDL_LogPriority priority, const char* file, "
},
{
"path": "src/war_log.h",
"chars": 599,
"preview": "#pragma once\n\n#include \"SDL3/SDL.h\"\n\nvoid wlog_log(SDL_LogPriority priority, const char* file, int line, const char* fmt"
},
{
"path": "src/war_map.c",
"chars": 99540,
"preview": "#include \"war_map.h\"\n\n#include <assert.h>\n\n#include \"shl/memzone.h\"\n#include \"shl/wstr.h\"\n\n#include \"war_actions.h\"\n#inc"
},
{
"path": "src/war_map.h",
"chars": 6970,
"preview": "#pragma once\n\n#include \"war_ai.h\"\n#include \"war_campaigns.h\"\n#include \"war_cheats.h\"\n#include \"war_entities.h\"\n#include "
},
{
"path": "src/war_map_menu.c",
"chars": 7286,
"preview": "#include \"war_map_menu.h\"\n\n#include \"SDL3/SDL.h\"\n#include \"shl/wstr.h\"\n\n#include \"war_campaigns.h\"\n#include \"war_game.h\""
},
{
"path": "src/war_map_menu.h",
"chars": 2033,
"preview": "#pragma once\n\n#include \"war.h\"\n\nvoid wmm_showOrHideGameOverMenu(WarContext* context, bool status);\nvoid wmm_showDemoEndM"
},
{
"path": "src/war_map_ui.c",
"chars": 50933,
"preview": "#include \"war_map_ui.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"shl/wstr.h\"\n\n#include \"wa"
},
{
"path": "src/war_map_ui.h",
"chars": 279,
"preview": "#pragma once\n\n#include \"war.h\"\n\nvoid wmui_createMapUI(WarContext* context);\n\nWarEntity* wmui_createUIMinimap(WarContext*"
},
{
"path": "src/war_math.c",
"chars": 6533,
"preview": "#pragma once\n\n#include \"war_math.h\"\n\nvec2 vec2f(f32 x, f32 y)\n{\n return (vec2){x, y};\n}\n\nvec2 vec2i(s32 x, s32 y)\n{\n "
},
{
"path": "src/war_math.h",
"chars": 3919,
"preview": "#pragma once\n\n#include <stdbool.h>\n\n#include \"shl/list.h\"\n#include \"shl/map.h\"\n\n#include \"common.h\"\n\n#define SIGN(x) ((x"
},
{
"path": "src/war_net.c",
"chars": 11779,
"preview": "#include \"war_net.h\"\n\n#include <errno.h>\n#include <stdlib.h>\n\n#include \"shl/wstr.h\"\n\n#include \"war_log.h\"\n\n#define WAR_R"
},
{
"path": "src/war_net.h",
"chars": 839,
"preview": "#pragma once\n\n#include <stdbool.h>\n\n#if _WIN32\n#include <winsock2.h>\n#include <ws2tcpip.h>\ntypedef SOCKET WarSocket;\n#el"
},
{
"path": "src/war_pathfinder.c",
"chars": 14480,
"preview": "#include <assert.h>\n\n#include \"war_pathfinder.h\"\n\nstatic s32 manhattanDistance(const WarMapNode node1, const WarMapNode "
},
{
"path": "src/war_pathfinder.h",
"chars": 3480,
"preview": "#pragma once\n\n#include \"shl/binary_heap.h\"\n#include \"shl/list.h\"\n#include \"shl/map.h\"\n\n#include \"common.h\"\n#include \"war"
},
{
"path": "src/war_projectiles.c",
"chars": 14234,
"preview": "#include \"war_projectiles.h\"\n\n#include <assert.h>\n\n#include \"war_animations.h\"\n#include \"war_audio.h\"\n#include \"war_ent"
},
{
"path": "src/war_projectiles.h",
"chars": 272,
"preview": "#pragma once\n\n#include \"common.h\"\n#include \"war.h\"\n#include \"war_math.h\"\n#include \"war_units.h\"\n\nWarEntity* wproj_create"
},
{
"path": "src/war_render.c",
"chars": 8895,
"preview": "#include \"war_render.h\"\n\n#include <assert.h>\n\n// ----------------------------------------------------------------------"
},
{
"path": "src/war_render.h",
"chars": 801,
"preview": "#pragma once\n\n#include \"SDL3/SDL.h\"\n\n#include \"war.h\"\n#include \"war_color.h\"\n#include \"war_math.h\"\n\nvoid wr_init(WarCon"
},
{
"path": "src/war_resources.c",
"chars": 36677,
"preview": "#include \"war_resources.h\"\n\n#include <assert.h>\n\n#ifdef SHL_MZ_DEBUG\n#include \"shl/memzone_audit.h\"\n#else\n#include \"shl"
},
{
"path": "src/war_resources.h",
"chars": 4355,
"preview": "#pragma once\n\n#include \"war_sprites.h\"\n#include \"war_units.h\"\n#include \"war_database.h\"\n\n#define WAR_BUILDING_DAMAGE_1_R"
},
{
"path": "src/war_roads.c",
"chars": 3732,
"preview": "#include \"war_entities.h\"\n\n#include <assert.h>\n\nbool we_hasRoadPieceAtPosition(WarContext* context, WarEntity* entity, "
},
{
"path": "src/war_ruins.c",
"chars": 3464,
"preview": "#include \"war_entities.h\"\n\n#include <assert.h>\n\nbool we_hasRuinPieceAtPosition(WarContext* context, WarEntity* ruins, s"
},
{
"path": "src/war_scene_blizzard.c",
"chars": 838,
"preview": "#include \"war_scene_blizzard.h\"\n\n#include \"war_audio.h\"\n#include \"war_imui.h\"\n#include \"war_scenes.h\"\n\nvoid wsc_enterSc"
},
{
"path": "src/war_scene_blizzard.h",
"chars": 185,
"preview": "#pragma once\n\n#include \"war.h\"\n\nvoid wsc_enterSceneBlizzard(WarContext* context);\nvoid wsc_updateSceneBlizzard(WarConte"
},
{
"path": "src/war_scene_briefing.c",
"chars": 5831,
"preview": "#include \"war_scene_briefing.h\"\n\n#include <assert.h>\n\n#include \"shl/wstr.h\"\n\n#include \"war_animations.h\"\n#include \"war_a"
},
{
"path": "src/war_scene_briefing.h",
"chars": 237,
"preview": "#pragma once\n\n#include \"war.h\"\n\nvoid wsc_enterSceneBriefing(WarContext* context);\nvoid wsc_updateSceneBriefing(WarContex"
},
{
"path": "src/war_scene_download.c",
"chars": 6378,
"preview": "#include \"war_scene_download.h\"\n\n#include \"SDL3/SDL.h\"\n\n#include \"shl/wstr.h\"\n\n#include \"war.h\"\n#include \"war_game.h\"\n#i"
},
{
"path": "src/war_scene_download.h",
"chars": 184,
"preview": "#pragma once\n\n#include \"war.h\"\n\nvoid wsc_enterSceneDownload(WarContext* context);\nvoid wsc_updateSceneDownload(WarContex"
},
{
"path": "src/war_scene_menu.c",
"chars": 17916,
"preview": "#include \"war_scene_menu.h\"\n\n#include \"SDL3/SDL.h\"\n#include \"shl/wstr.h\"\n\n#include \"war_audio.h\"\n#include \"war_game.h\"\n#"
},
{
"path": "src/war_scene_menu.h",
"chars": 1063,
"preview": "#pragma once\n\n#include \"war.h\"\n\nvoid wsc_enterSceneMainMenu(WarContext* context);\nvoid wsc_renderSceneMainMenu(WarContex"
},
{
"path": "src/war_scenes.c",
"chars": 4108,
"preview": "#include \"war_scenes.h\"\n\n#include \"war_animations.h\"\n#include \"war_cheats.h\"\n#include \"war_scene_blizzard.h\"\n#include \""
},
{
"path": "src/war_scenes.h",
"chars": 1400,
"preview": "#pragma once\n\n#include \"war_campaigns.h\"\n#include \"war_cheats.h\"\n#include \"war_entities.h\"\n\nstruct _WarScene\n{\n WarSc"
},
{
"path": "src/war_sprites.c",
"chars": 6454,
"preview": "#include \"war_sprites.h\"\n\n#include <assert.h>\n\n#include \"SDL3/SDL.h\"\n\n#include \"war_render.h\"\n#include \"war_resources.h"
},
{
"path": "src/war_sprites.h",
"chars": 2104,
"preview": "#pragma once\n\n#include \"SDL3/SDL.h\"\n\n#include \"common.h\"\n#include \"war.h\"\n#include \"war_math.h\"\n\nstruct _WarSpriteFrame\n"
},
{
"path": "src/war_state_machine.c",
"chars": 14887,
"preview": "#include \"war_state_machine.h\"\n\nWarStateDescriptor stateDescriptors[WAR_STATE_COUNT] =\n{\n { WAR_STATE_IDLE, wst"
},
{
"path": "src/war_state_machine.h",
"chars": 15557,
"preview": "#pragma once\n\n#include \"war_math.h\"\n#include \"war_units.h\"\n#include \"war_pathfinder.h\"\n\nstruct _WarState\n{\n WarStateT"
},
{
"path": "src/war_state_machine_attack.c",
"chars": 7302,
"preview": "#include \"war_state_machine.h\"\n\n#include \"war_map.h\"\n#include \"war_actions.h\"\n#include \"war_audio.h\"\n#include \"war_units"
},
{
"path": "src/war_state_machine_build.c",
"chars": 5462,
"preview": "#include \"war_state_machine.h\"\n\n#include \"war_map.h\"\n#include \"war_actions.h\"\n#include \"war_audio.h\"\n#include \"war_unit"
},
{
"path": "src/war_state_machine_cast.c",
"chars": 12909,
"preview": "#include \"war_state_machine.h\"\n\n#include \"war_actions.h\"\n#include \"war_animations.h\"\n#include \"war_audio.h\"\n#include \"w"
},
{
"path": "src/war_state_machine_chopping.c",
"chars": 4526,
"preview": "#include \"war_state_machine.h\"\r\n\r\n#include \"war_actions.h\"\r\n#include \"war_audio.h\"\r\n#include \"war_units.h\"\r\n#include \"wa"
},
{
"path": "src/war_state_machine_collapse.c",
"chars": 1806,
"preview": "#include \"war_state_machine.h\"\n\n#include \"shl/wstr.h\"\n\n#include \"war_animations.h\"\n\nWarState* wst_createCollapseState(W"
},
{
"path": "src/war_state_machine_death.c",
"chars": 2446,
"preview": "#include \"war_state_machine.h\"\n\n#include \"war_actions.h\"\n\nWarState* wst_createDeathState(WarContext* context, WarEntity"
},
{
"path": "src/war_state_machine_deliver.c",
"chars": 3515,
"preview": "#include \"war_state_machine.h\"\r\n\r\nWarState* wst_createDeliverState(WarContext* context, WarEntity* entity, WarEntityId t"
}
]
// ... and 30 more files (download for full content)
About this extraction
This page contains the full source code of the acoto87/war1 GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 230 files (60.9 MB), approximately 1.5M tokens, and a symbol index with 2852 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.