1:1 source port of the engine and game code; Windows build and system layer; docs. No game files or SDK headers.
This commit is contained in:
parent
c3b032a45a
commit
0ecb47e9cb
3871 changed files with 91080 additions and 1640063 deletions
18
.gitattributes
vendored
18
.gitattributes
vendored
|
|
@ -1,2 +1,16 @@
|
||||||
# Preserve scripts and fixtures byte for byte.
|
# LF for source and scripts; everything else is left byte for byte (original Lua, assets, manifests).
|
||||||
* -text
|
*.c text eol=lf
|
||||||
|
*.cpp text eol=lf
|
||||||
|
*.h text eol=lf
|
||||||
|
*.mm text eol=lf
|
||||||
|
*.java text eol=lf
|
||||||
|
*.py text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.cmake text eol=lf
|
||||||
|
CMakeLists.txt text eol=lf
|
||||||
|
Makefile text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
*.tsv text eol=lf
|
||||||
|
*.patch text eol=lf
|
||||||
|
*.sh eol=lf
|
||||||
|
choc3/lua_source/** -text
|
||||||
|
|
|
||||||
25
.gitignore
vendored
25
.gitignore
vendored
|
|
@ -1,5 +1,3 @@
|
||||||
/engine/build*/
|
|
||||||
/artifacts/
|
|
||||||
/.omc/
|
/.omc/
|
||||||
/.vs/
|
/.vs/
|
||||||
/.vscode/
|
/.vscode/
|
||||||
|
|
@ -20,7 +18,24 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
__pycache__/
|
__pycache__/
|
||||||
CMakeUserPresets.json
|
CMakeUserPresets.json
|
||||||
|
/parity-out/
|
||||||
|
|
||||||
# Local game data (copy from your own copy of the game; never commit)
|
# generated from the game binary (tools/port/gen_defaultfont.py, tools/port/gen_screeninit.py)
|
||||||
/game_choc3/assets/
|
/port/src/core/defaultfont.h
|
||||||
/choc3/
|
/port/src/core/screeninit.h
|
||||||
|
|
||||||
|
# generated from the game binary (tools/port/gen_animationscript.py)
|
||||||
|
/port/src/core/animationscript.h
|
||||||
|
|
||||||
|
# generated from the game binary (tools/port/gen_particles.py)
|
||||||
|
/port/src/core/particles.h
|
||||||
|
|
||||||
|
# generated from the game binary (tools/port/gen_flashhost.py)
|
||||||
|
/port/src/mac/flashhostswf.h
|
||||||
|
/port/build/
|
||||||
|
/port/build*/
|
||||||
|
|
||||||
|
# Windows build helpers / local logs
|
||||||
|
/port/build-win/
|
||||||
|
*.log
|
||||||
|
/port/mingw.path
|
||||||
|
|
|
||||||
58
README.md
58
README.md
|
|
@ -1,46 +1,34 @@
|
||||||
# Chocolatier 3 Reverse
|
# Chocolatier 3 Reverse
|
||||||
|
|
||||||

|
> **Work in progress.** The engine and game code are ported function by function and the port builds and runs on Windows, but the screens have not yet been matched pixel for pixel against the original. Expect rough edges.
|
||||||
|
|
||||||
> **Work in progress.** The engine builds and parts of the game run, but the screens have not yet been matched pixel for pixel against the original and the full campaign is not finished or verified. Expect missing features, rough edges and breaking changes.
|
A 1:1 C++ source port of the shipped macOS i386 build of **Chocolatier 3: Decadence by Design**, including the Playground engine it is built on. Every function is ported from a decompile of the shipped binary and carries its address in a comment (`// game @0x...`). Nothing is guessed: constants come from the binary, and where the shipped binary and a reference build differ the shipped binary wins.
|
||||||
|
|
||||||
A C++20 reimplementation of the Playground runtime for **Chocolatier 3: Decadence by Design**. It runs the game's original Lua scripts and assets on a modern SDL3 engine with wide-screen scaling.
|
**This repository contains no game files, no game scripts and no third-party SDK headers.** The original game and the PlayFirst Playground SDK are not ours to redistribute. To build, you need your own licensed copies: the game data (`Resources`), the original game headers and the Playground SDK headers, placed where `docs/port/PORTING.md` says. Without them the sources here do not compile.
|
||||||
|
|
||||||
This repository contains only the engine, the game adapter, tests, documentation and tools. **It does not include any game files.** You need your own copy of Chocolatier 3.
|
## Status
|
||||||
|
|
||||||
The current build implements menu, travel, market, factory, kitchen, shop, quest, save and casino paths; none of them is verified against the original yet. [Implementation status](docs/IMPLEMENTATION_STATUS.md) lists the remaining work.
|
| Layer | Ported | Total |
|
||||||
|
|---|---|---|
|
||||||
|
| Game code | 298 | 298 |
|
||||||
|
| Engine (Playground) | 2,221 | 2,221 |
|
||||||
|
| C functions (rest are STL/boost/libc instantiations) | 514 | 1,465 |
|
||||||
|
|
||||||
## Game data
|
- Builds and runs on Windows (32-bit llvm-mingw, CMake + Ninja, `bash port/winbuild.sh`): main menu, map, travel, market, shop, factory and coffee mini games, recipe designer, pause, save and reload work in manual play.
|
||||||
|
- Not yet done: pixel-by-pixel parity against the original under Wine, differential tests, the Flash intro movie, an occasional sound-thread race that was just fixed and still needs long-play confirmation.
|
||||||
|
- Windows system layer (`port/src/win/`, window, OpenGL context, input, files, HTTP, audio through OpenAL Soft) is new code and is **not** 1:1; it replaces the Carbon/AGL/QuickTime layer of the original. It is marked as such in every file.
|
||||||
|
|
||||||
Copy these from your own installation of the game:
|
## Layout
|
||||||
|
|
||||||
- `game_choc3/assets/`: `assets.pfp`, `strings.xml`, `settings.xml`, `credits.txt`, and the `cadi/` and `splash/` folders.
|
- `port/src`: engine port (`core`, `gl`, `mac`, `win`).
|
||||||
- `choc3/lua_source/`: the game's Lua scripts (`ui/`, `sim/`, `quests/`, ...).
|
- `port/game`: game code port.
|
||||||
|
- `port/external/openal`: port of the Apple OpenAL layer the original links statically (used on macOS; Windows uses OpenAL Soft).
|
||||||
|
- `tools/ghidra`, `tools/port`: decompile export scripts and the porting helpers (function lookup, manifest status, link and compile checks).
|
||||||
|
- `tools/parity`: harness that drives the original under Wine for screen comparison.
|
||||||
|
- `docs/port`: porting workflow, per-function manifest, link report, Windows notes.
|
||||||
|
|
||||||
Both folders are ignored by Git. Different locations can be passed with `-DCHOCO_GAME_ASSETS=...` and `-DCHOCO_LUA_SRC=...`. `choco-cli ls/cat` and `tools/pfp.py` can list and extract files from an `assets.pfp` archive.
|
## Rules
|
||||||
|
|
||||||
## Build
|
- 1:1 first: every ported function is cited by address. No behaviour is added to ported code.
|
||||||
|
- Platform layers are separate files and are marked as not 1:1.
|
||||||
Open an x64 MSVC Developer Command Prompt with CMake and Ninja on `PATH`, then run:
|
- Pixel parity with the original, then differential tests, before anything is called finished.
|
||||||
|
|
||||||
```bat
|
|
||||||
cd engine
|
|
||||||
build.bat Release
|
|
||||||
```
|
|
||||||
|
|
||||||
The executable is `engine/build/bin/choco3.exe`. When the game data is present, CMake copies it into `assets` and `lua` beside the executable. SDL, FreeType and Lua sources are vendored, so the build needs no network downloads.
|
|
||||||
|
|
||||||
Run `ctest --test-dir engine/build -C Release --output-on-failure` after building. Tests that need game data are skipped when it is missing. See [engine/README.md](engine/README.md) for the source layout and available probes. `tools/package-release.ps1` copies a verified Release build's runtime files to a Desktop `Chocolatier3-Release` folder.
|
|
||||||
|
|
||||||
## Source layout
|
|
||||||
|
|
||||||
- `engine/`: runtime, UI, simulation bridge, audio, graphics, mini-games, tests and vendored dependencies.
|
|
||||||
- `game_choc3/`: executable adapter (`main.cpp`); local game assets go in `game_choc3/assets/`.
|
|
||||||
- `docs/`: architecture, implementation status and source notes.
|
|
||||||
- `tools/`: Lua bytecode, PFP archive and packaging utilities.
|
|
||||||
|
|
||||||
The reusable runtime is also developed separately as [playground-sdk](https://git.crt.fyi/CRT/playground-sdk).
|
|
||||||
|
|
||||||
## Disclaimer
|
|
||||||
|
|
||||||
The header image above is the game's Steam store artwork and belongs to its owners. Chocolatier and its assets are the property of their respective owners. This is an unofficial fan project, not affiliated with or endorsed by them. The project does not run or modify the original game executable or installer.
|
|
||||||
|
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
# Chocolatier engine reimplementation — architecture
|
|
||||||
|
|
||||||
Decisions taken (2026-10-02): language **C++**; first target **Chocolatier 3 only**; wide screens via
|
|
||||||
**clean scaling + letterbox/pillarbox first**; unified 3-game campaign **out of scope for now, architecture left open**;
|
|
||||||
work style **plan first, then build**.
|
|
||||||
|
|
||||||
## 1. Goal
|
|
||||||
Play Chocolatier 3 on a modern PC: 3440x1440 and 3840x2160, borderless fullscreen, no mouse flicker,
|
|
||||||
stable frame pacing. Original Lua, headers and decompiled behavior guide implementation; playable campaign completion and the original UI appearance are the delivery priorities.
|
|
||||||
|
|
||||||
## 2. Principle
|
|
||||||
Replace the PlayFirst Playground *engine* (exe), keep the *game* (Lua scripts + assets).
|
|
||||||
Game assets and Lua sources are not part of this repository; each build uses data copied from the user's own copy of the game (see README.md). The separate `playground-sdk` repository contains the reusable runtime source, dependency notices, synthetic tests and newly authored examples.
|
|
||||||
|
|
||||||
## 3. What has to be written (from the reverse-engineering results)
|
|
||||||
| Layer | Source of truth | Size / notes |
|
|
||||||
|---|---|---|
|
|
||||||
| Lua 5.0.2 VM | `tools/luac502` patches | stock 5.0.2 + `AND/OR/SHL/SHR` opcodes (16–19, shifts later opcodes by 4) + `continue` keyword. Run original **bytecode** (Windows) or compile the plaintext sources with our luac. |
|
|
||||||
| Playground script API | `docs/playground_sdk_reference.txt` (Lua Reference, pp. 105–138) | 62 documented globals: `Bitmap, Window, Text, Group, Rectangle, Slider, TextEdit, DoModal, DisplayDialog, PostMessage, CreateParticles, SetStyle, GetString, GetScore/LogScore, user functions ...` |
|
|
||||||
| Game-specific bindings | `choc3/cpp_bindings/INDEX.md` | 60 globals (48 functions, 12 window types): `MapWindow, PortWindow, BSGWindow, CharWindow, GrabLedger, InitiateTravel, SoundEvent, SaveGameString, ...` |
|
|
||||||
| Game C++ modules | `choc3/cpp_src` (+57 original headers) | 53 modules, ~207k lines of raw Ghidra pseudo-C. Largest: settings, SignEditor, CoffeeGrid, CoffeeFactory, MapWindow, Transitions, BSGWindow, ChocolateFactory, PortWindow. These are the two factory mini-games, map, ports, ledger, fireworks, slot machine, etc. They must be rewritten from the pseudo-code against the original headers. |
|
|
||||||
| Asset loaders | `tools/pfp.py`, notes | `PFPK` archive (no crypto), `ZXML` (zlib XML), PNG/JPG, OGG, `MVC4` vector animation (`.mvec`), CADI sound banks, character/window animation XML. |
|
|
||||||
| Platform | new | SDL3 window/input/audio/timing; renderer through SDL GPU or a small D3D11/GL batch renderer. |
|
|
||||||
|
|
||||||
## 4. Proposed module layout
|
|
||||||
```
|
|
||||||
engine/
|
|
||||||
core/ file system (pfp + loose dirs), zlib, config, logging, timing
|
|
||||||
lua/ patched Lua 5.0.2 + binding helpers (member-function closures)
|
|
||||||
gfx/ sprite batch, text (styled markup: <br>, <tab pos>), blend modes, particles, vector (mvec), transitions
|
|
||||||
ui/ Window tree, events, modal stack, XML window loader (Playground "Window"/"Bitmap"/"Text" API)
|
|
||||||
audio/ OGG, SoundEvent groups, music
|
|
||||||
platform/ SDL3 glue: display modes, borderless, scaling, hardware cursor
|
|
||||||
game_choc3/ the 53 game modules re-implemented (factory, coffee, map, port, ledger ...)
|
|
||||||
tools/ pfp extractor, luac, compare, asset inspector
|
|
||||||
```
|
|
||||||
`game_choc3/` registers its bindings into `engine/lua` exactly like the original (`RegisterBSGLuaHelpers`,
|
|
||||||
`ChocoThreeMain`). A second game later = a second `game_*` folder, shared `engine/`. That is the only
|
|
||||||
"unified" hook we build now.
|
|
||||||
|
|
||||||
## 5. Display design
|
|
||||||
* Logical canvas is 800x600, matching the original Lua screen constants and art layouts.
|
|
||||||
* Render to an offscreen target, scale with integer or high-quality filtered scaling to the window,
|
|
||||||
letterbox/pillarbox for 21:9 and 16:9. Borderless fullscreen = desktop-resolution window.
|
|
||||||
* Mouse: use SDL's native OS cursor. The frame-bound software cursor lagged under VSync during this project's implementation; physical target-hardware verification remains pending.
|
|
||||||
* True ultrawide layouts (extend map/scenes) are a later, per-screen task.
|
|
||||||
|
|
||||||
## 6. Milestones (each ends with something runnable)
|
|
||||||
1. **M0 — Foundations:** pfp/ZXML readers, patched Lua VM runs `sim/*.lua` headless; load the Lua bytecode and the plaintext sources and compare results.
|
|
||||||
2. **M1 — Window + draw:** SDL3 window, sprite batch, PNG/JPG, text; draw the splash and main menu bitmaps.
|
|
||||||
3. **M2 — UI layer:** Window/Bitmap/Text/Rollover/Slider API, modal stack, `ui/mainmenu.lua` navigable.
|
|
||||||
4. **M3 — Sim headless:** run the full sim (port/market/quest/recipe) through Lua with stub UI; golden-test economy numbers against recorded values.
|
|
||||||
5. **M4 — Map/Port/Ledger/Shop screens**, transitions, SoundEvent + music.
|
|
||||||
6. **M5 — Chocolate factory mini-game**, then **M6 — Coffee factory**.
|
|
||||||
7. **M7 — Remaining:** slot machine, fireworks, hiscore (offline stub), options/credits, save/load (own format; optional importer for `*.choco3`).
|
|
||||||
8. **M8 — Display polish:** ultrawide/4K/borderless/mouse; settings UI.
|
|
||||||
|
|
||||||
## 7. Risks and open items
|
|
||||||
* **Mini-games are the bulk of the work** and exist only as raw pseudo-C; behaviour must be matched by playing the original. Keep an original install runnable as the reference.
|
|
||||||
* **Save format:** `prefs.dat` is encrypted with a config key — not needed; use our own save format.
|
|
||||||
* **Hiscore/online/DRM/cheat:** server submit stubbed; `--cheat` is a machine-bound licence code, not reproduced. A dev menu can be enabled by our own config flag, since `dev/*.lua` is plain source.
|
|
||||||
* **CADI characters:** format needs reverse-engineering (`CadiApi.dll` on Windows; symbols in Mac binary).
|
|
||||||
* **MVC4 vector animations:** format of `.mvec` still undocumented here (`swf2mvec` tool existed in the SDK).
|
|
||||||
* Lua 5.0 bit-op opcodes: confirm that the parser emits them (no Lua source in our set uses `<<`/`&` operators, so likely unneeded — verify).
|
|
||||||
* Chocolatier 1 and 2 binaries (Ghidra run in progress) will show how much of `game_choc3` is reusable.
|
|
||||||
|
|
||||||
## 8. Next step once approved
|
|
||||||
M0: repository skeleton (CMake, C++20), vendored Lua 5.0.2 with our patches, `pfp`/ZXML readers, a CLI that lists an installation's assets and runs a Lua file, plus tests comparing our VM to the recorded bytecode results.
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
# Casino UI source notes
|
|
||||||
|
|
||||||
`engine/ui/casino_ui.*` runs the original `ui/ui_slotselect.lua`,
|
|
||||||
`ui/ui_slotmachine.lua`, and `ui/ui_crates.lua` in GameSim's Lua VM. The
|
|
||||||
selection dialog computes three cash-relative bets and queues either game
|
|
||||||
dialog after closing. The adapter executes that queue after the mouse callback
|
|
||||||
returns, so the callback's own menu node remains alive until it finishes.
|
|
||||||
|
|
||||||
Slot machine payout rules come from `ui_slotmachine.lua`: a 20% even win,
|
|
||||||
20% 2.5× win, 10% 8× jackpot, and 50% loss before the source's `looseness`
|
|
||||||
adjustment. The Lua script debits the bet, chooses symbols and payout, and
|
|
||||||
calls `StartSlots`. The adapter waits 1.8 seconds, then calls the Lua node's
|
|
||||||
`onstopped` and `onpayout` callbacks once. `reels()` and `reelOptions()` expose
|
|
||||||
the chosen symbols for renderer animation.
|
|
||||||
|
|
||||||
Crates uses 21 selections, as in `BonusGame.h` and `BonusGame.cpp`. Decompiled
|
|
||||||
`TBonusGame::PrepareGame` independently rounds factor-based prizes to $100,
|
|
||||||
keeps positive prizes at least $100, shuffles them and returns their sum.
|
|
||||||
The private `_PrizeFactor` constant table is absent from the pseudo-source,
|
|
||||||
so the current factor array is an explicit approximation. The original
|
|
||||||
`ui_crates.lua` manages bets, winnings, cash-out, and the whammy through
|
|
||||||
`PrepareGame` and `SelectPrize` bindings. `crateValues()` and `crateOpened()`
|
|
||||||
expose state for renderer art. This is playable behavior, not exact original
|
|
||||||
casino odds.
|
|
||||||
|
|
||||||
`ui_crates.lua` uses `Mod(i-1,7)` to lay out a seven-column grid, while this
|
|
||||||
engine's restored `Mod` binding returns quotient. The adapter uses remainder
|
|
||||||
only while constructing that dialog, then restores `Mod`; without this,
|
|
||||||
seven crate buttons overlap at each position.
|
|
||||||
|
|
||||||
The adapter restores overwritten Lua globals on close and abandons registry
|
|
||||||
references when `GameSim::loadGame` replaces the VM. The focused test covers
|
|
||||||
selection, one slot payout, no second payout after another tick, crate bet,
|
|
||||||
selection/cash-out, pre-bet cancel without mutation, and stale-VM close.
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
# Chocolate factory remaining behavior
|
|
||||||
|
|
||||||
Source inspection, 2026-10-02. These findings describe the available decompile and headers; they have not been compared with a running original binary.
|
|
||||||
|
|
||||||
## Covered current implementation
|
|
||||||
|
|
||||||
`engine/minigame/chocolate.*` implements countdown, bounded timed play, moving trays, ingredient queue cooldown, projectile arrival, matching recipe slots, product completion, eight misses, pause and cancellation. GUI probes cover production commit and ingredient consumption.
|
|
||||||
|
|
||||||
## Missing source behaviors
|
|
||||||
|
|
||||||
- `choc3/lua_source/ui/chocolate_factory.lua` passes `colorcount`, `ringspeed`, `recycler`, `recyclertime`, `recyclerpath` and `rainbow`. Current `ChocolateConfig` does not carry these fields.
|
|
||||||
- `ChocolateTray.h` stores a tray color. Current simulation only stores ingredient names. Color must also travel with queue ingredients, shots and occupied slots before color matching can be represented.
|
|
||||||
- `ChocolateFactory::OnMessage` at source address `0x0000cce8` increments both bonus count and total score for event `0x3ee`; `0x3ef` increments total score. The header event order identifies these as bonus product and ordinary product count.
|
|
||||||
- Event `0x3f0` scales the tray task by the configured speed multiplier, capped by the configured maximum. The current simulation uses a fixed tray time.
|
|
||||||
- Event `0x3f1` initiates flying rings. `FlyingRing.h` identifies this as a color-match event from a specific tray, rather than a projectile collision obstacle.
|
|
||||||
- `ChocolateTray::AddIngredient` at `0x0000fa44` emits a color-match ring and immediate product message for a completed matching-color tray. Its group completion logic emits `ingredient_complete_full_bonus`, clears trays in the group and produces a product for each. The exact group formation and all color sentinels need a separate implementation pass.
|
|
||||||
- `Recycler.h` defines a moving bin with collision radius and ingredient acceptance. `Recycler::AddIngredient` at `0x0003404e` must be used to derive collection behavior before implementing the powerup.
|
|
||||||
|
|
||||||
## Delivery verification
|
|
||||||
|
|
||||||
Tests must distinguish ordinary completion, color-match completion, group bonus, recycler acceptance, speed cap, pause, timer expiry and cancellation. Normal GUI probes must demonstrate the same settings arrive from original Lua and display the associated original art. Current passing tests do not establish these behaviors.
|
|
||||||
|
|
||||||
## Core pass (2026-10-03)
|
|
||||||
|
|
||||||
`ChocolateConfig` now carries the original Lua fields `colorcount`, `rainbow`, `recycler`, `recyclertime`, `recyclerpath`, `ringspeed`, `speedup`, and `maxspeed`. Color follows queue ingredients, shots, and filled slots. `ChocolateView` exposes color, ring, recycler, recycled count, bonus count, and current tray speed. The `Recycler::AddIngredient` decompile at `0x0003404e` confirms accepting an ingredient removes it and increments `RecycleCount`. `ChocolateFactory::OnMessage` at `0x0000cce8` confirms capped tray scaling on `0x3f0`; `ChocolateTrayTask::Animate` at `0x0000f836` confirms the full-group trigger requires all trays filled. `ChocolateTray::AddIngredient` at `0x0000fa44` confirms completed colored trays start a ring.
|
|
||||||
|
|
||||||
The deterministic queue color sequence, recycler hit radius, straight-path ring lifetime/visual and single-tray handling are **project choices**, not verified original constants. The original queue uses `RandRange`, so this model cannot claim identical color draws. Rainbow color zero is modeled as a wildcard. `FlyingRingTask::Animate` at `0x0002288c` sends `0x3ee` after ring completion; the core now awards one additional score and bonus count on expiry. `ChocolateFactory::OnMessage` increments both fields for that event. `ChocolateTrayTask::Animate` at `0x0000f836` sends a product event for every tray when all are full; the core produces those trays immediately and cancels their pending ordinary products to avoid double counting. Exact ring geometry and timing remain approximations. GUI must pass the Lua category/product overrides and powerup flags, render the exposed ring/recycler states, and show score changes. This core pass by itself does not establish full game parity.
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
# Chocolatier 3 implementation status
|
|
||||||
|
|
||||||
The project target is a complete, independently buildable and playable Chocolatier 3 campaign. This document records verified coverage and remaining work; a passing build does not imply campaign completion.
|
|
||||||
|
|
||||||
## Working opening path
|
|
||||||
|
|
||||||
- Portable C++20 executable with patched Lua 5.0.2, SDL3 rendering, original game archive and Lua sources loaded from the user's local game data.
|
|
||||||
- Original menu art and Lua menu callbacks; 800×600 logical canvas scales to wide displays. The game uses SDL's native cursor after a frame-bound software cursor was found to lag behind the physical pointer under VSync; physical display verification is still pending.
|
|
||||||
- New player enters Zurich. Original Lua simulation loads ports, products, ingredients and quests.
|
|
||||||
- Zurich port, original Lua ledger and Pause window, map, market and purchase register draw original game art. The Market uses its source Lua buy/register/haggle callbacks and updates stock, cash and source price history. The ledger's Inventory, Recipes, Quest, Map/Port and Menu commands route to gameplay screens; the Pause window saves on open, resumes without advancing time and opens Options, Help and High Scores through their existing adapters.
|
|
||||||
- The map reads all 20 ports from Lua, hides undiscovered locations, shows locked ones, and uses original route cost and time rules. Lua travel updates cash, week and visited ports when a destination has been unlocked.
|
|
||||||
- The general English string table is read from the local `game_choc3/assets/strings.xml`; menu, market, register and map labels use its keys. Quest string overlays load into the same table.
|
|
||||||
- Original Lua quest offer/accept/complete methods drive the tutorial chain. Headless tests progress `tut_01` through `tut_11` using required character/building visits, chocolate production and sale, ingredient purchases, and the Douala unlock reward. The matching UI path remains in progress.
|
|
||||||
- Automated Release build, CTest, smoke, UI and simulation probes cover this opening path.
|
|
||||||
- Headless Lua simulation tests original tutorial progression through `tut_11`, market buy/sell, factory production, machinery purchase, custom recipe creation and the natural Rank 2 campaign. Its latest path reaches Rank 3 through San Francisco truffle production, twelve known truffles, five mentor visits, Havana shop ownership and Evan's promotion; the continuing Rank 3 route is still in development. A separate, explicitly controlled-state integration test supplies later source-defined recipes, encounters, shop ownership, story variables and item stocks through original Lua award/production functions. It verifies original Lua Rank 3 and 4 quest wiring, both final deliveries and delayed Rank 5/$10M reward, not natural campaign economics. These capabilities are not yet fully exposed in the GUI.
|
|
||||||
- The original ChocolateFactory and CoffeeFactory Lua screens are connected to live timed games: mouse shots produce a score, and a completed round commits production and advances one week; cancel does not advance time. Coffee Pause/Go buttons and timer freeze are covered by a GUI probe. A later-port probe enters owned San Francisco and Tokyo factories through port hotspots and verifies truffle, infusion and a custom user recipe through shots, score, ingredient consumption, weekly production and week advancement. Other categories, exact mini-game physics and some source hint/sound paths remain unverified or approximate.
|
|
||||||
- Recipes, quest offer, quest log/detail, inventory, ChocolateFactory, CoffeeFactory and Kitchen windows execute their original `ui/*.lua` definitions inside the GameSim VM. Shop and Market windows also execute original Lua through dedicated adapters, including item/ingredient cards, quantity dialogs and source haggle logic. Inventory rollover uses its original frame atlas. Character and telegram dialogs have initial Lua paths; full quest decision coverage and remaining gameplay windows still need routing and verification.
|
|
||||||
- Las Vegas and Havana Casino hotspots open the original Lua slot selection, slot machine and crates windows. A normal GUI probe pulls a slot reel, waits for it to stop, starts crates, opens one crate and checks the source bet changes cash. The slot/crate outcome tables are an explicit approximation where original private constants are unavailable. Casino source art, button text, portrait PNG fallback and fitted popup size have 800×600 captures.
|
|
||||||
|
|
||||||
## Required for a complete campaign
|
|
||||||
|
|
||||||
1. Broader campaign save/load compatibility and one authoritative simulation state across UI and gameplay. Controlled Rank 3 and Rank 5 snapshots now round-trip active/completed/delayed quests, custom recipe appearance and player fields; normal long-session UI behavior still needs verification.
|
|
||||||
2. Quest and character dialogs, rewards, rank progression, ledger details and localization strings.
|
|
||||||
3. Travel across all ports, time advancement, encounters, market selling, shops, inventory and recipes. Source-type building dispatch now opens representative market, factory, shop and kitchen buildings outside Zurich in a probe. Kitchen and Shop transaction screens still require full normal-path QA.
|
|
||||||
4. Chocolate and coffee production, custom recipes, factory equipment and production quests.
|
|
||||||
5. Remaining buildings and mini-games, CADI sound-bank event mapping, animated character XML/PNG rendering and presentation polish.
|
|
||||||
6. A natural campaign and normal GUI playthrough through the final Rank 5 quest (`quests/rank4.lua`). The source-defined finish is `final_quest` (83 known recipes, rank 4, `gameover == 5`; twelve custom recipe slots; 200 each of user1–user12 delivered in two stages), followed by delayed `final_questb` awarding rank 5 and `alex_thanks`. The controlled-state integration test reaches this finish; natural economy and full GUI completion remain unverified.
|
|
||||||
|
|
||||||
Original game/installers are not executed by these tests. Visual comparisons currently use original art and original Lua definitions; exact behavior outside the tested opening path remains unverified.
|
|
||||||
|
|
||||||
A versioned, bounded binary snapshot codec and atomic file writer exist in `engine/core/save_snapshot.*` with hostile-input tests.
|
|
||||||
|
|
||||||
`GameSim::saveGame/loadGame` now round-trip the player state and reject malformed snapshots without replacing the active VM. Save & Quit and profile resume are wired to the UI and covered by a probe; broader campaign save compatibility still needs testing.
|
|
||||||
|
|
||||||
The loose `.CAD` file is a CADI sound bank, not character art. Character frames are referenced through `characters/*.xml` with a PNG fallback. The sound engine decodes the game's OGG cues and maps 175 bank resources by the original XML index. GameSim queues original Lua SoundEvent names for buy, sell, travel and quest actions; GUI draining and dummy-driver playback probes pass. Physical audible playback and multi-clip arrangements remain unverified. Interactive ChocolateFactory and CoffeeFactory input/tick/score cores are connected to their original Lua windows and production result path. Original bonus/recycler rules and exact Coffee grid/hopper behavior remain in progress.
|
|
||||||
|
|
||||||
## SDK distribution
|
|
||||||
|
|
||||||
The reusable Playground SDK is maintained as a separate source project, `playground-sdk`. Its package includes runtime code, compatibility coverage, examples, synthetic fixtures and dependency notices. Feature completeness remains a delivery requirement.
|
|
||||||
|
|
||||||
Staged offline source verification: clean Release build and CTest in `engine/build-stage`, 35/35 passing. This verifies the covered behavior above, not a complete playable campaign.
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
# Factory mini-game source notes
|
|
||||||
|
|
||||||
The new `engine/minigame` classes are playable, deterministic gameplay cores. They are not exact restorations of the original task/physics systems.
|
|
||||||
|
|
||||||
## ChocolateFactory
|
|
||||||
|
|
||||||
Direct source-derived values: `ui/chocolate_factory.lua` supplies 3,000 ms countdown, 60,000 ms game, 10,000 ms warning, eight missed-ingredient divots, and product/category overrides for tray count/path/time, conveyor count/path/time, gun speed, and product time. `items/categories.lua` supplies the bar-category numeric values. `ChocolateFactory::OnMouseDown` fires the gun only during play; `ChocolateTray::CanAccept/AddIngredient` accepts a recipe ingredient into an empty matching slot; a complete tray queues a product; `ChocolateFactory::MissedIngredient` aborts after the divot count. `ui/ui_factory.lua` passes the numeric mini-game result to `Factory:SetProduction(product,count)` and advances one week.
|
|
||||||
|
|
||||||
`IngredientQueue::PopConveyor` only yields the front item when normalized progress reaches 1, then subtracts `1/conveyorCount`; its constructor sets this spacing. The current model now rejects repeated clicks until approximately `conveyorTimeMs/conveyorCount` has elapsed. The countdown is assumed long enough to place the first item at the gun; exact queue task timing remains unverified.
|
|
||||||
|
|
||||||
Current approximations: `hitRadius=34`, point-to-polyline interpolation for trays, cyclic deterministic conveyor ingredient order, product score of one per completed tray, direct shot targeting, 10 ms internal tick, 1,000 ms ending delay, and visual flight path. The original uses sprite/task collisions, `IngredientQueue` curve/pistons, `ChocolateGunTask`, `ChocolateProductQueueTask`, bonus/rainbow/ring/recycler behavior, and task-scale timing. Those are not yet reproduced. `missLimit=8` is sourced from the eight Lua `missed` points but the precise shutdown timing remains approximate. Category timings are sourced values; how each original task interprets interpolation is not yet verified. The test covers source-derived phase/order mechanics plus these explicit approximations, not pixel/physics equivalence.
|
|
||||||
|
|
||||||
Integration: build a `ChocolateConfig` from the selected product's `recipe` and its product-or-category overrides used by `ui/chocolate_factory.lua`; call `configure`, `start`, then `tick(deltaMs)`, `fire({mouseX,mouseY})`, `view()`. Mouse positions are 800×600 logical canvas coordinates. When phase reaches `Over`, pass `score()` to the same Lua `Factory:SetProduction(product,count)` + `TickSim(1)` path used by `ui/ui_factory.lua`. Do not advance a week if the user closes before starting. `Aborted`/`Over` results need explicit UI policy.
|
|
||||||
|
|
||||||
## CoffeeFactory
|
|
||||||
|
|
||||||
`ui/coffee_factory.lua` supplies 3,000 ms countdown, 60,000 ms game, 8,000 ms warning, 250 ms gun, 6/8 columns, 9 rows, grid origin/spacing, and category grid/conveyor speed and match bonus. `CoffeeGrid.h/.cpp` establishes row shifting, a slot grid, horizontal/vertical matches of at least three, and flood collection of adjacent equal ingredients. `CoffeeHopper.h/.cpp` stores per-recipe ingredient counts and releases one product when all required counts are available. `CoffeeFactory.cpp` adds product and match-bonus score.
|
|
||||||
|
|
||||||
The next fidelity pass confirms `CoffeeFactory::ResetGame` calls `CoffeeIngredientGrid::Reset`, which clears all slots; there is no direct initial fill in that call. `CoffeeIngredientGrid::ShiftRows` advances every row down and samples `RandRange(0, recipe.size()*2)` for every new top-row slot: roughly half remain empty and the rest contain recipe ingredients. `CoffeeIngredientSlot` starts `available=true`; `IsSlotEmpty` requires this flag and an empty content string. No ordinary path writing `available=false` was found. `HopperCollectionTask` sets its time field to 250 (float `0x437a0000`) and `Animate` moves matched ingredients to the hopper before calling `CoffeeHopper::Add`. Our model queues arrivals for 250 ms; the exact original flying path and duration interpretation remain unverified. `CoffeeHopper::Add` increments the least-filled matching recipe position and `Release` decrements every position only when all are stocked. `CoffeeFactory::OnMessage` indexes the match-bonus vector by collected group size (capped at the last element), which is not the same as the Lua comment's one-based table description. We now model these behaviors with a seedable deterministic PRNG; its sequence is not the original `RandRange` sequence.
|
|
||||||
|
|
||||||
On each collected match, `CoffeeFactory::OnMessage` multiplies the grid task's current scale by `speedup` and clamps it to `maxspeed`; `CoffeeFactory::Init` reads defaults 1.1 and 8.0, while beverage/blend category Lua overrides speedup with 1.2/1.15. The core now scales grid advancement by this factor and resets to 1 at a new game. Actual `TScalingTask` interpolation between row shifts remains approximate.
|
|
||||||
|
|
||||||
Current Coffee approximations: cyclic conveyor, click maps straight to a cell, shot flight is linear, collection travel is represented by a timer instead of the original curve, and one hopper release scores one. Original sprite collision, exact collection path, speedup/maxspeed, product spacing, bonus presentation, and failure timing remain to be restored. Tests verify a functional interaction loop, not full original equivalence.
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
# Implementation decision — 2026-10-02
|
|
||||||
|
|
||||||
The reference material was the original Chocolatier 3 Lua, 57 game headers, and a Ghidra decompilation of the unstripped Mac i386 game binary (none of it is distributed in this repository). These are valuable source materials, but the C++ decompilation is not a buildable source project.
|
|
||||||
|
|
||||||
The decompilation contains 53 `.cpp` files, 207,572 pseudo-source lines and 1,761 function markers. A read-only audit counted 7,634 `undefined` type occurrences and 2,703 raw object-offset accesses. About 20 original headers depend on missing PlayFirst `pf/` engine headers. Representative methods have types inconsistent with the original headers: `ChocolateFactory::OnMouseDown` is declared `bool` but decompiles as returning a `ChocolateFactory` object. The raw offsets and virtual calls also reflect a 32-bit Mac ABI rather than the target x64 Windows SDL runtime.
|
|
||||||
|
|
||||||
Restoring all pseudo-source would require reconstructing the missing Playground engine, types and ABI first, followed by extensive manual repair. The current route remains the patched original Lua VM plus a modern C++20/SDL engine. Use the Mac headers and decompilation as the specification for focused, clean ports of missing behavior, especially chocolate and coffee mini-games, character and sound systems, and native window adapters. Run original `ui/*.lua` in the game VM through a shared UI runtime rather than adding every screen as separate hardcoded C++ drawing.
|
|
||||||
|
|
||||||
This is a delivery choice, not a claim that the game is complete. Full campaign completion still requires all quest ranks, both mini-games, remaining UI/buildings, audio behavior, saves, visual and mouse validation, and an extracted-source offline build.
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
# Shop UI source notes
|
|
||||||
|
|
||||||
`engine/ui/shop_ui.*` runs the original `choc3/lua_source/ui/ui_shop.lua` and
|
|
||||||
`ui/ui_buysell.lua` in GameSim's Lua VM. The shop script filters player products
|
|
||||||
by inventory and `shop.buys[product machinery]` (shop Lua lines 31–41), sorts
|
|
||||||
them, and builds a product rollover for each available item (lines 70–168).
|
|
||||||
The product callback opens the quantity register and calls the original
|
|
||||||
`prod:Sell(n)` through its `onOk` closure (lines 74–76).
|
|
||||||
|
|
||||||
The adapter captures that nested `DisplayDialog` request and opens the register
|
|
||||||
after `Menu::mouseUp` returns. This prevents the Lua callback from destroying
|
|
||||||
its own menu node and registry command. On register close the shop script is
|
|
||||||
loaded again with the same building and keeper. A sale causes one `SubTickSim`
|
|
||||||
on final shop close, matching `ui_shop.lua:217–237`; the original close handler
|
|
||||||
still records last-seen and price-range data. Empty stock uses the source's
|
|
||||||
`shop_comeback` branch (lines 282–308). The adapter restores GameSim's original
|
|
||||||
`DisplayDialog` function when it closes.
|
|
||||||
|
|
||||||
The current fallback `Dollars` binding displays whole dollar values without
|
|
||||||
thousands separators because the native Playground formatter is not present in
|
|
||||||
GameSim. The shop's card layout, portraits, button styles, and price labels
|
|
||||||
otherwise come from the original Lua and art.
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
||||||
# Gameplay Lua UI runtime
|
|
||||||
|
|
||||||
`engine/ui/ui_runtime.h` attaches the existing `Menu` window parser to the
|
|
||||||
`GameSim` Lua state. The runtime executes original `ui/*.lua` scripts in the
|
|
||||||
same VM as the campaign objects, so a button callback can call an original
|
|
||||||
Quest method. It borrows that VM. Call `detach()` before `GameSim::loadGame`,
|
|
||||||
which replaces the VM, then attach again before opening another window.
|
|
||||||
|
|
||||||
The integrated windows are `ui/ui_recipes.lua`, `ui/ui_quest_offer.lua`,
|
|
||||||
`ui/inventory.lua`, `ui/ui_shop.lua`, `ui/ui_buysell.lua`, `ui/ui_kitchen.lua`,
|
|
||||||
`ui/ui_generic_yn.lua`, `ui/ui_questlog.lua`, `ui/chocolate_factory.lua`, and
|
|
||||||
`ui/coffee_factory.lua`.
|
|
||||||
Recipes handles category/product selection; a known recipe with equipped
|
|
||||||
machinery opens the matching Chocolate or Coffee minigame. The original Lua
|
|
||||||
factory windows supply the background, information dialog, and buttons. Their
|
|
||||||
native nodes are adapted to `ChocolateGame` or `CoffeeGame` using recipe,
|
|
||||||
path/grid, timing, and equipment
|
|
||||||
snapshot from the same `GameSim` VM. The SDL frame loop advances the timer,
|
|
||||||
accepts mouse shots, updates score/countdown labels, and writes the final
|
|
||||||
score to `Factory:SetProduction` followed by one simulation week. Cancel or
|
|
||||||
Escape aborts without advancing the week. The minigame cores are still a
|
|
||||||
documented approximation of the original native physics and effects.
|
|
||||||
Quest Offer calls the original Accept, Defer, or Reject method and returns the
|
|
||||||
clicked action to the game screen state. Character portraits use the original
|
|
||||||
`characters/*.xml` atlas and mask when available.
|
|
||||||
The local quest offer and telegram Lua files skip their direct quest mutation
|
|
||||||
when `gChocoQuestBridge` is set, so the input adapter calls the corresponding
|
|
||||||
`GameSim` action exactly once after the button callback.
|
|
||||||
Inventory lists real ingredient/product quantities; rollover content executes
|
|
||||||
the original item's Lua expression. Its tooltip uses the original
|
|
||||||
`controls/rollover.jpg` atlas border over a peach fill.
|
|
||||||
Port hotspots dispatch by the Lua building type across all loaded ports.
|
|
||||||
`ShopUi` uses the original product cards and register, then sells through the
|
|
||||||
selected shop. A cancelled quantity dialog does not change stock or money.
|
|
||||||
The Kitchen uses the original ingredient drawers, taste check, designer, and
|
|
||||||
confirmation dialog. Its confirmation runs asynchronously in a second runtime
|
|
||||||
on the same VM; Yes resumes the original recipe creation callback, while No
|
|
||||||
leaves the recipe uncreated. The resulting name, appearance, and custom slot
|
|
||||||
survive a save/load round trip. The local `ui_kitchen.lua` copy has a small
|
|
||||||
callback handoff for this asynchronous confirmation.
|
|
||||||
The local `ui_shop.lua` nameplate text is raised six pixels to keep the
|
|
||||||
script font clear of the panel border in the replacement renderer.
|
|
||||||
The Quest Log opens from its original ledger hotspot. It executes the source
|
|
||||||
list/detail callbacks, reads the active quest title and intro, and draws the
|
|
||||||
starter portrait from the character atlas at the source half scale.
|
|
||||||
Queued simulation dialogs now open the source character generic, telegram,
|
|
||||||
and quest telegram windows in the same Lua VM. The quest telegram's Accept
|
|
||||||
and Reject buttons call the corresponding GameSim quest operation once.
|
|
||||||
The local character generic Lua moves the name text six pixels upward to
|
|
||||||
keep it visible with the replacement font rasterizer. Other dialogs that require
|
|
||||||
a synchronous Yes/No return remain unbridged; showing a button after their
|
|
||||||
simulation caller has already continued would give a false result.
|
|
||||||
The original character Yes/No art is used for full Kitchen slots and factory
|
|
||||||
machinery purchases. No leaves money, machinery, recipe slots and week alone;
|
|
||||||
Yes enters the full Kitchen or buys the selected factory machinery. The local
|
|
||||||
Yes/No Lua also moves the character name six pixels up for the replacement
|
|
||||||
font rasterizer. Quest Defer uses the source four-week default.
|
|
||||||
Original Lua `SoundEvent` calls from Menu windows and GameSim are drained
|
|
||||||
in the normal frame loop and played through the CAD/audio engine. Missing
|
|
||||||
or multi-clip CAD events remain silent.
|
|
||||||
|
|
||||||
The parser keeps command callbacks as Lua registry references. It releases
|
|
||||||
them when a window tree or filled child list is replaced. It also clears
|
|
||||||
hover/press pointers before replacing nodes and finishes close operations
|
|
||||||
after input dispatch to avoid accessing destroyed nodes.
|
|
||||||
Nested runtimes restore the previous Lua globals when detached. A runtime
|
|
||||||
that sees `loadGame` replace its VM abandons its old registry references
|
|
||||||
without dereferencing the destroyed state. Destructors detach from a live VM;
|
|
||||||
the caller must keep `GameSim` alive while a runtime is attached.
|
|
||||||
|
|
||||||
Factory Make now reads the selected factory's current product from GameSim.
|
|
||||||
An unowned factory does not open its production UI, matching the source
|
|
||||||
`Factory:EnterBuilding` behavior. An empty configuration never silently picks
|
|
||||||
the Zurich bar recipe. San Francisco's t01 truffle and Tokyo's i01 infusion
|
|
||||||
enter ChocolateFactory with their respective source category snapshot and
|
|
||||||
factory identity. The later-factory probe fires the same ChocolateGame input
|
|
||||||
used by normal mouse clicks and runs the same score-to-production/week commit;
|
|
||||||
both recipes consume ingredients. It then creates a user bar recipe, selects
|
|
||||||
it in the original Recipes Lua window at the San Francisco factory, plays the
|
|
||||||
minigame, and verifies its production and ingredient consumption.
|
|
||||||
|
|
||||||
The Market uses the original `ui_market.lua`, `ui_buysell.lua`, and
|
|
||||||
`ui_haggle.lua` windows in the GameSim VM. Register and Haggle dialogs are
|
|
||||||
deferred until the current Lua callback returns; the source register callback
|
|
||||||
buys the selected ingredient once. The original Haggle choices call
|
|
||||||
`ComputeHaggle`; the adapter resumes the Market success/failure branch after
|
|
||||||
the choice closes. It preserves the keeper's mood when rebuilding the Market
|
|
||||||
window, records the source price history on OK, and advances the fractional
|
|
||||||
simulation tick once after a purchase. Port hotspot selection uses visual
|
|
||||||
layer order where rectangular building bounds overlap.
|
|
||||||
The original `ui/ledger.lua` now provides the normal Port/Map badge art and
|
|
||||||
button commands. The adapter updates money and rank from the live GameSim VM,
|
|
||||||
switches Map/Port button visibility and hides unowned factory counters beneath
|
|
||||||
their source covers. The native Date formatter remains unavailable, so the
|
|
||||||
source day field is blank. The original `ui/ui_pause.lua` opens from the
|
|
||||||
ledger Menu command or Escape; profile save occurs before opening it, and
|
|
||||||
Resume returns to the previous Port/Map screen without advancing a week.
|
|
||||||
Nested Options, Help and High Scores use the established Menu adapters.
|
|
||||||
|
|
||||||
Verification in `engine/build-gui`: the last full green run had 31 CTest cases
|
|
||||||
on 2026-10-02. The Pause/Ledger probe passes locally; a later concurrent
|
|
||||||
simulation/minigame edit has temporarily prevented a clean full-suite result.
|
|
||||||
`game_ui_recipes_lua` cycles categories, closes, saves, reloads, reattaches,
|
|
||||||
and closes again. `game_ui_quest_lua` accepts two tutorial offers and reopens
|
|
||||||
the next offer after save/load. `game_ui_inventory_lua` verifies real stock and
|
|
||||||
rollover. `game_ui_chocolate_play` fires a shot and verifies score 1, weekly
|
|
||||||
production 1, and week 1 to 2. `game_ui_coffee_lua` tests the original Coffee
|
|
||||||
window, scores 1, commits weekly production 1, and advances one week.
|
|
||||||
`game_ui_save` covers profile persistence.
|
|
||||||
`game_ui_building_dispatch` clicks the actual port hotspots at Zurich, Cape
|
|
||||||
Town, Reykjavik, and Tangiers. Cape Town Shop then opens its product/register,
|
|
||||||
cancels a sale, sells one item, and closes to Port. `game_ui_kitchen_lua`
|
|
||||||
clicks drawers and jars, tastes and designs a recipe, rejects the first
|
|
||||||
confirmation, accepts the second, rejects a duplicate name, and verifies
|
|
||||||
appearance plus save/load persistence. `shop_ui` also tests nested runtime
|
|
||||||
global restoration and active shop shutdown after VM replacement.
|
|
||||||
`game_ui_questlog_lua` opens the original log, selects the first active quest,
|
|
||||||
and closes it through the source button callback.
|
|
||||||
`game_ui_pending_dialog_lua` opens/closes a character dialog and a telegram,
|
|
||||||
then accepts the tutorial quest from a telegram. `game_ui_audio_events`
|
|
||||||
checks source buy/travel event queues and CAD decoding/playback with SDL's
|
|
||||||
dummy audio device.
|
|
||||||
`game_ui_choice_dialogs` clicks No and Yes in both source Yes/No windows,
|
|
||||||
checks cancel leaves simulation state alone, and checks machinery payment
|
|
||||||
and equip happen only after Yes.
|
|
||||||
`game_ui_later_factories` clicks San Francisco and Tokyo factory hotspots,
|
|
||||||
checks owned/default product, machinery and category, scores in each matching
|
|
||||||
source ChocolateFactory, and checks product, weekly production, week, and
|
|
||||||
ingredient consumption. It also covers a user-designed recipe in San Francisco.
|
|
||||||
`game_ui_market_lua` clicks Cape Town's Market hotspot, tests the rank gate,
|
|
||||||
register cancel without mutation, one purchase, Lua Haggle good/bad outcome
|
|
||||||
and price effect, close/history, then opens Zurich and Tokyo markets through
|
|
||||||
port hotspots. The Cape Town source window capture is
|
|
||||||
`engine/build-gui/cap_market_lua.bmp`.
|
|
||||||
|
|
||||||
`game_ui_casino_lua` enters the Las Vegas casino from its port hotspot,
|
|
||||||
uses `ui_slotselect.lua` to open the source slot machine and crates,
|
|
||||||
pulls and completes a reel spin, opens a crate, and repeats the building
|
|
||||||
entry in Havana. The `PortObject.kind` snapshot distinguishes the Lua Casino
|
|
||||||
subclass from its inherited `type="generic"`. Captures of the three source
|
|
||||||
screens are `engine/build-gui/casino_select_fit2.bmp`,
|
|
||||||
`casino_slots_review.bmp`, and `casino_crates_review.bmp`. Source `fit=true`
|
|
||||||
bitmaps use their intrinsic dimensions, and the PNG-only casino portrait
|
|
||||||
falls back to its bundled character image.
|
|
||||||
|
|
||||||
The shared runtime still lacks adapters for many native Playground window
|
|
||||||
types and input controls. Much of the remaining campaign UI is not integrated
|
|
||||||
yet. The Kitchen color picker and its tint controls are not connected, so its
|
|
||||||
default appearance colors are saved. The first-visit ingredient learning and
|
|
||||||
some non-Shop building interactions still need source behavior. Older C++
|
|
||||||
recipe/factory fallbacks still exist
|
|
||||||
for screens that fail Lua setup; they use an adapted production rule and are
|
|
||||||
not equivalent to the minigame.
|
|
||||||
32
docs/port/AGENT-BRIEF.md
Normal file
32
docs/port/AGENT-BRIEF.md
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# Brief for porting agents (Windows host, 2026-10-22)
|
||||||
|
|
||||||
|
Read `docs/port/HANDOFF.md` and `docs/port/PORTING.md` first; this file only lists the Windows differences and the rules
|
||||||
|
for parallel agents.
|
||||||
|
|
||||||
|
## Tools on this Windows PC
|
||||||
|
- Whole-tree check: `bash tools/port/check_all.sh [--mac]`.
|
||||||
|
- Decompile lookup: `export PATH=~/bin:$PATH; python tools/port/fn.py 'Class::Method'` (use `python`, not `python3`;
|
||||||
|
`~/bin/c++filt.exe` is installed). Data: `python tools/port/readdata.py SYMBOL N FMT`. `parity-out/` is already here.
|
||||||
|
- Compile check (step 5) runs on the MacBook because the headers need Apple frameworks:
|
||||||
|
`tools/port/check_mac.sh port/game/X.cpp [more files]` -> prints `CHECK-OK` or the first errors per file. It syncs
|
||||||
|
`port/` to `~/choc3-check` on `ssh mac` (one ssh connection per call, ~3 s). Never run anything else on the Mac.
|
||||||
|
- Generated headers (`defaultfont.h` etc.) are already in the tree and gitignored. Do not commit them.
|
||||||
|
- Reference headers: `choc3/cpp_src/<Class>.h` (shipped originals, copied to `port/game/`); ported engine headers in
|
||||||
|
`port/include/pf`; DWARF layouts in `docs/port/types/pflib_types.txt`.
|
||||||
|
|
||||||
|
## Rules (the owner's, strict)
|
||||||
|
- 1:1 port: every function from the GAME decompile (the shipped binary wins over the SDK debug build), cited
|
||||||
|
`// game @0x... sdk @0x...` (game-only classes: `game @` only). No guessed constants, no hand-placed coordinates,
|
||||||
|
no behaviour added, no cleanup that changes results. Read both decompiles branch by branch before and after writing.
|
||||||
|
- Do not mark anything "playable"/"ready". No emulator/Wine runs, no sound, no apps launched, no simulator.
|
||||||
|
- Own only the files of your package. Other agents run in parallel in the same checkout: never edit, reformat, stash,
|
||||||
|
reset, checkout or delete files that are not yours, never touch `docs/port/MANIFEST.tsv` (the lead recomputes it).
|
||||||
|
Shared headers (`port/include/pf/*`): a minimal fix needed by your class is allowed, but re-run
|
||||||
|
`tools/port/check_mac.sh` on the whole tree before committing it and mention it in your report.
|
||||||
|
- Commit locally only (never push), as you finish each class: `git add <your files>` then
|
||||||
|
`git commit -m "1:1 port: <classes>"` (identity is already `CRT <hi@crt.fyi>`; NO Co-Authored-By, no AI
|
||||||
|
attribution; if `.git/index.lock` exists wait 5 s and retry). Commit messages never mention game names beyond the
|
||||||
|
class names.
|
||||||
|
- Every check must pass `tools/port/check_mac.sh <your files>` = `CHECK-OK` before the commit.
|
||||||
|
- Report: classes finished, function counts, any decision or header fix, anything you could not port and why.
|
||||||
|
Keep the report under 300 words.
|
||||||
65
docs/port/HANDOFF.md
Normal file
65
docs/port/HANDOFF.md
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
# Handoff: 1:1 port of Chocolatier 3 + Playground SDK 4.0
|
||||||
|
|
||||||
|
State on 2026-10-22. Tasks 1-9 are done: the port builds, links (zero undefined symbols) and runs on Windows. Runtime bugs
|
||||||
|
are being fixed. Remaining: parity (task 10), modern engine (task 11), the owner's features. Nothing runs in the background.
|
||||||
|
Start with `README.md` (build, run, repo map), then `PORTING.md` (per-function workflow).
|
||||||
|
|
||||||
|
## Parts
|
||||||
|
| Part | What | Where | Build / run | State |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| 1. Decomp | Ghidra headless exports of the shipped Mac i386 binary and of the Playground SDK 4.0.22.1 debug objects (DWARF) | `parity-out/full/decomp` (game), `parity-out/sdk/decomp` (SDK), `tools/ghidra/*.java` | `python tools/port/fn.py 'Class::Method'` shows game + SDK side by side | done; `parity-out/` is gitignored (rebuild from the binary and the SDK dmg) |
|
||||||
|
| 2. 1:1 port | C++ of engine + game, every function cited `// game @0x...` | `port/src/core`, `gl`, `mac`; `port/game`; `port/external/openal` | `tools/port/check_all.sh`; Mac: `tools/port/link_mac.sh` | all game/SDK classes ported (see Progress) |
|
||||||
|
| 3. Windows layer | Carbon/AGL emulation on Win32 + WGL, OpenAL Soft, CMake build (not 1:1) | `port/src/win`, `port/CMakeLists.txt`, `port/winbuild.sh`, `docs/port/windows.md` | `bash port/winbuild.sh` -> `port/build-win/bin/choc3port.exe` | builds and runs windowed; runtime fixes in progress |
|
||||||
|
| 4. Mac layer | The ported Carbon/AGL platform code | `port/src/mac`, `port/Makefile` | `tools/port/link_mac.sh` (build node `ssh mac`) | links (task 8); a modern Mac system layer (replace Carbon/AGL/QuickTime) is open |
|
||||||
|
| 5. Parity harness | The original Windows build under Wine on the Mac, driven by injected helpers (host mouse untouched) | `tools/parity`, prefix `~/.wine-choc3` | `zsh tools/parity/start_orig.sh`, `orig_replay.py SCRIPT OUT`, `compare.py` | works for the original; a runner for the port comes with task 10 |
|
||||||
|
|
||||||
|
The earlier guessed reimplementation (`engine/`, `game_choc3/`) was rejected and removed from the tree on 2026-10-22; it
|
||||||
|
stays in git history and in the separate archived repos.
|
||||||
|
|
||||||
|
## Goal and rules
|
||||||
|
- A true 1:1 C++ port of the whole shipped binary: SDK engine ("pflib") and game code. Then a modern engine (`PLAN.md`).
|
||||||
|
- Every function is ported from the decompile and carries `// game @0x... sdk @0x...` (game code: `game @` only). The
|
||||||
|
shipped binary wins over the SDK debug build. No guessed constants, layouts or heuristics, no hand-placed coordinates.
|
||||||
|
- Never call the port "playable" or "ready" before every screen matches the original.
|
||||||
|
- Only `port/src/win`, the build files and tools are free (system layer); everything else stays 1:1.
|
||||||
|
- At most 2 heavy jobs at once. No sound, no simulators. Commits as `CRT <hi@crt.fyi>`, no AI attribution, never push
|
||||||
|
without the privacy scan. Tools contain no absolute home paths (use `~`).
|
||||||
|
|
||||||
|
## Where things are
|
||||||
|
| What | Where |
|
||||||
|
|---|---|
|
||||||
|
| Workflow, compile command, generators | `docs/port/PORTING.md` |
|
||||||
|
| Windows build and system layer | `docs/port/windows.md`; link report `docs/port/link-report.tsv` |
|
||||||
|
| Plan and modern-engine notes | `docs/port/PLAN.md` |
|
||||||
|
| Per-function status | `docs/port/MANIFEST.tsv`, recompute with `python tools/port/manifest_status.py` (also run by `check_all.sh`) |
|
||||||
|
| Review notes | `docs/port/review-2026-10-22.md` (second review pass: MapWindow, CoffeeFactory, ...) |
|
||||||
|
| Embedded Lua (LuaPlus 1084) | `docs/port/lua.md`; patch `tools/port/thirdparty/lua-5.0.2-luaplus.patch` |
|
||||||
|
| DWARF class layouts | `docs/port/types/pflib_types.txt` |
|
||||||
|
| Original headers, bindings, Lua | `choc3/cpp_src`, `choc3/cpp_bindings`, `choc3/lua_source` |
|
||||||
|
| Binary data | `python tools/port/readdata.py SYMBOL N FMT` |
|
||||||
|
| Third-party libs | Windows: `tools/port/prepare_thirdparty_win.sh` (run by winbuild.sh); Mac: `zsh tools/port/build_thirdparty.sh` |
|
||||||
|
| Generated data (gitignored) | `tools/port/gen_*.py` before compiling a fresh checkout |
|
||||||
|
| Agent rules (Windows host) | `docs/port/AGENT-BRIEF.md` |
|
||||||
|
|
||||||
|
## Progress
|
||||||
|
Per-function counts: run `python tools/port/manifest_status.py` and `python tools/port/engine_status.py` (numbers in older
|
||||||
|
notes went stale). Tasks 1-8 (all SDK and game classes, remaining C functions and unnamed functions, first link) are
|
||||||
|
done; the second review pass is recorded in `review-2026-10-22.md`.
|
||||||
|
|
||||||
|
## Task list
|
||||||
|
1-8. Done: WIP merge, SDK leftovers, game framework, game screens, factory mini games, remaining game code, remaining C
|
||||||
|
and unnamed functions, first link (Mac `port/Makefile`, Windows `port/CMakeLists.txt`).
|
||||||
|
9. Platform layer: Windows done as above (runs windowed). Mac: replace Carbon/AGL/QuickTime/URL Access with modern macOS
|
||||||
|
equivalents (legacy GL 2.1 context); OpenGL calls stay as shipped.
|
||||||
|
10. Parity: run the port against the original under Wine with `tools/parity` (input replay, frame diff, Lua state dumps)
|
||||||
|
until every screen matches, including text positions, hover popups and dialogs.
|
||||||
|
11. Modern engine phase (`PLAN.md`), including the Flash intro: SWF to FLA, then a native intro.
|
||||||
|
12. Owner's features on top of the clean base (README "Adding features": `port/ext/`, Lua/XML, new window types).
|
||||||
|
|
||||||
|
## Known pitfalls
|
||||||
|
- Static initializers: each object's `__static_initialization_and_destruction_0` comes before its `__GLOBAL__I` entry.
|
||||||
|
- The game build differs from the SDK debug build (no asserts, inlining, other layouts such as the 100-byte lua_State).
|
||||||
|
Always follow the game.
|
||||||
|
- Game classes are also listed under layer "pflib" in MANIFEST; a class with a header in `choc3/cpp_src` is game code.
|
||||||
|
- Agents share the scratchpad: give each one its own subfolder. Parallel agents share one checkout: stage only your files.
|
||||||
|
- Windows host: use `python`, `export PATH=~/bin:$PATH` (c++filt); the Apple-header compile check runs on the Mac.
|
||||||
5445
docs/port/MANIFEST.tsv
Normal file
5445
docs/port/MANIFEST.tsv
Normal file
File diff suppressed because it is too large
Load diff
40
docs/port/PLAN.md
Normal file
40
docs/port/PLAN.md
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
# 1:1 port plan
|
||||||
|
|
||||||
|
Goal: a C++ source tree that behaves exactly like the shipped Chocolatier 3 (Mac i386 build, symbols intact),
|
||||||
|
then a modern engine built on top of it. Nothing is guessed: every function is ported from its decompile and
|
||||||
|
carries the original address in a comment (`// @0x000842d0 TTextGraphic::RenderText`).
|
||||||
|
|
||||||
|
## Inventory (from `tools/ghidra/ExportAll.java`, list in `MANIFEST.tsv`)
|
||||||
|
|
||||||
|
| Layer | Functions | Bytes | How it is ported |
|
||||||
|
|---|---|---|---|
|
||||||
|
| game (BSG code: factories, port, map, ledger, mini games) | 298 | 122 KB | function by function from the decompile |
|
||||||
|
| pflib (Playground SDK 4.0: windows, text, sprites, renderer, sound, script, files) | 2221 | 548 KB | function by function from the decompile |
|
||||||
|
| C functions (pflib C helpers, libc glue, smaller libraries) | 1465 | 281 KB | classified further; own code ported, libraries replaced |
|
||||||
|
| third party (JasPer, libpng 1.2, libjpeg 6b, Ogg/Vorbis, zlib, Lua 5.0.2) | 896 | 398 KB | upstream sources of the same versions, plus the observed Lua patches; verified against the decompile |
|
||||||
|
| C++ runtime (boost, std) | 449 | 18 KB | boost/std headers |
|
||||||
|
| unnamed | 115 | 19 KB | identified by callers, then ported |
|
||||||
|
|
||||||
|
Mac system APIs (Carbon, AGL/OpenGL, CoreAudio, QuickTime, WebKit for the Flash intro) are the only layer that is
|
||||||
|
re-implemented: OpenGL calls are kept as they are (legacy GL context; WGL on Windows), audio goes to the same mixing
|
||||||
|
code, window/input events are translated 1:1.
|
||||||
|
|
||||||
|
## Order
|
||||||
|
1. Foundation: `str`, containers, `TFile`/`pf_*` file system and PFPK archive, `TPrefs`, `TPlatform`, timing.
|
||||||
|
2. Renderer: `TRenderer`, `TGLDisplayHandler`, `TTexture`/`TTextureData`/`TImage`, `TPfMiniVecDraw`, `TVertexSet`.
|
||||||
|
3. Script: `TScript`, `TLuaTable`, `LPCD` bindings, `TWindowScript`.
|
||||||
|
4. Windows: `TWindow`, `TWindowManager`, `TModalWindow`, `TText`/`TTextGraphic`/`TTextEdit`, `TButton`, `TSlider`, sprites.
|
||||||
|
5. Sound: `TSoundManager`, `TSound`, `TSoundStream`, `OAL*`, CADI.
|
||||||
|
6. Game classes: ledger, port, map, factories, mini games, characters, the rest.
|
||||||
|
7. Main loop and startup exactly as `main` / `TPlatform::Run`.
|
||||||
|
|
||||||
|
## Proof
|
||||||
|
- Every finished class: unit-level differential tests where possible (same inputs, same outputs as the decompile).
|
||||||
|
- Every screen: `tools/parity` input replay against the original under Wine; frame diff must be 0 % apart from
|
||||||
|
animated scenery at matching timestamps, and Lua state dumps must match.
|
||||||
|
- Status per function in `MANIFEST.tsv` (`todo` / `ported` / `verified`), progress reported as counts.
|
||||||
|
|
||||||
|
The earlier guessed reimplementation was rejected and removed from the tree (it stays in git history).
|
||||||
|
|
||||||
|
## After the 1:1 port (modern engine)
|
||||||
|
- Flash intro (TFlashHost): convert the SWF to FLA, then rebuild it as a native intro without a Flash runtime.
|
||||||
34
docs/port/PORTING.md
Normal file
34
docs/port/PORTING.md
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Porting workflow (every function)
|
||||||
|
|
||||||
|
Host notes: on the Windows PC use `python` (not `python3`) and `export PATH=~/bin:$PATH` first (`~/bin/c++filt.exe`).
|
||||||
|
The step 5 compile check needs Apple headers, so it runs on the MacBook: `tools/port/check_mac.sh [files]` prints
|
||||||
|
`CHECK-OK`. The whole-tree developer check is `bash tools/port/check_all.sh [--mac]`.
|
||||||
|
|
||||||
|
1. Look up both decompiles: `python tools/port/fn.py 'Class::Method'`
|
||||||
|
- GAME = shipped binary (authoritative behaviour, release build).
|
||||||
|
- SDK = Playground SDK 4.0 debug build with DWARF (real names, types, locals). Same source family, 83 % of the
|
||||||
|
shared functions are byte-identical in size; where they differ, the GAME version wins.
|
||||||
|
2. Types: `docs/port/types/pflib_types.txt` (DWARF layouts) and `port/include/pf` (SDK headers). When a header and the
|
||||||
|
binary disagree (field missing, inline helper different), fix the header to match the binary and note it.
|
||||||
|
3. Data: initial values of globals/tables from the binary with `python tools/port/readdata.py SYMBOL N FMT`.
|
||||||
|
4. Write the function in the matching file under `port/src/...` (same file layout as `pflib/src/...`), with a comment
|
||||||
|
`// game @0x... sdk @0x...`. No guessed constants, no added behaviour, no "cleanup" that changes results. Debug-only
|
||||||
|
assertions of the SDK build are left out (the game is a release build).
|
||||||
|
5. Review pass (no emulator runs, owner's decision 2026-10-15): read the finished function next to both decompiles
|
||||||
|
and check every branch, constant, loop bound, call and side effect one by one. The file must compile
|
||||||
|
(`clang++ -std=c++17 -DNDEBUG -DBOOST_NO_AUTO_PTR -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -DGL_SILENCE_DEPRECATION -fsyntax-only -Iport/include -Iport/src/core -Iport/src/gl -Iport/src/mac
|
||||||
|
-Iparity-out/thirdparty/build/lua-5.0.2/src -Iparity-out/thirdparty/src/libogg-1.0/include
|
||||||
|
-Iparity-out/thirdparty/src/libvorbis-1.0/include -Iparity-out/thirdparty/build/jpeg-6b
|
||||||
|
-Iparity-out/thirdparty/src/libpng-1.2.5 -Iparity-out/thirdparty/src/zlib-1.2.1
|
||||||
|
-Iparity-out/thirdparty/build/jasper-1.900.1/src/libjasper/include
|
||||||
|
-Iparity-out/thirdparty/src/libpng-1.2.5/contrib/visupng -Iport/external/openal`; the Lua directory is the patched Lua
|
||||||
|
core and the libogg/libvorbis/jpeg/png/zlib/jasper ones the upstream headers (jpeg and jasper from their patched
|
||||||
|
build trees), created by `tools/port/build_thirdparty.sh`;
|
||||||
|
port/external/openal holds the port of the SDK's statically linked Apple OpenAL implementation). Data copied from the game binary is generated, never committed:
|
||||||
|
`python tools/port/gen_defaultfont.py` writes `port/src/core/defaultfont.h`,
|
||||||
|
`python tools/port/gen_screeninit.py` writes `port/src/core/screeninit.h`; likewise gen_animationscript.py,
|
||||||
|
gen_particles.py and gen_flashhost.py (run all `tools/port/gen_*.py` before compiling).
|
||||||
|
Host differences that change results (LP64 `long`, libc behaviour, FP contraction) are handled explicitly
|
||||||
|
(`libc32.h`, `#pragma STDC FP_CONTRACT OFF`).
|
||||||
|
6. `docs/port/MANIFEST.tsv` is recomputed with `python tools/port/manifest_status.py` (every cited `game @` address
|
||||||
|
counts as ported). Areas verified earlier in the emulator stay listed in `docs/port/verified/`.
|
||||||
59
docs/port/link-report.tsv
Normal file
59
docs/port/link-report.tsv
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
symbol class referenced from resolution
|
||||||
|
_BeginFullScreen system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_EndFullScreen system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_CreateMouseTrackingRegion system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_ReleaseMouseTrackingRegion system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_DMRegisterExtendedNotifyProc system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_GetMouse system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_GetPort system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_SetPort system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_GetWindowPort system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_GetWindowRegion system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_QDGlobalToLocalPoint system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_SetItemCmd system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_SetPortWindowPort system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_WebInitForCarbon system-api (Carbon/QuickDraw/QuickTime/WebKit) platformdata.cpp / gldisplayhandler.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglChoosePixelFormat system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglCreateContext system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglDescribePixelFormat system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglDestroyContext system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglDestroyPixelFormat system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglErrorString system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglGetError system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglGetVirtualScreen system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglSetCurrentContext system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglSetDrawable system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglSetInteger system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglSwapBuffers system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_aglUpdateContext system-api (AGL) platformdata.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLAbort system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLDisposeReference system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLGetBuffer system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLGetCurrentState system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLIdle system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLNewReference system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLOpen system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLReleaseBuffer system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
_URLSetProperty system-api (URL Access) simplehttp.cpp stub in port/src/mac/link_stubs.cpp; task 9 replaces
|
||||||
|
operator==(AudioStreamBasicDescription const&, AudioStreamBasicDescription const&) not-yet-ported function oalSource.cpp ported: port/external/openal/CAStreamBasicDescription.cpp (game @0x00145ef2)
|
||||||
|
LoadAppearance(...) not-yet-ported function ChocolateFactory.cpp ported: port/game/CustomItems.cpp (game @0x0001fcd2, Internal @0x0001f9e4)
|
||||||
|
BuildItemAppearance(...) not-yet-ported function ChocolateFactory.cpp ported: port/game/CustomItems.cpp (game @0x0001fff4)
|
||||||
|
vtable for CoffeeGridTask porting bug (missing virtual) CoffeeFactory.cpp ported CoffeeGridTask::Reset game @0x00015e34 (tail call, had no export row) in CoffeeGrid.cpp
|
||||||
|
_main not-yet-ported function (entry) ported main() game @0x000294fa in port/game/main.cpp
|
||||||
|
TDisplayImpl::IsFullscreen() sdk-only, absent from game display.cpp display.cpp compiled but not linked (NOLINK in port/Makefile): game has no TDisplay symbol
|
||||||
|
TDisplayImpl::ExitFullscreen() sdk-only, absent from game display.cpp display.cpp compiled but not linked (NOLINK in port/Makefile): game has no TDisplay symbol
|
||||||
|
TDisplayImpl::EnterFullscreen(int, int) sdk-only, absent from game display.cpp display.cpp compiled but not linked (NOLINK in port/Makefile): game has no TDisplay symbol
|
||||||
|
TDisplayImpl::TDisplayImpl() sdk-only, absent from game display.cpp display.cpp compiled but not linked (NOLINK in port/Makefile): game has no TDisplay symbol
|
||||||
|
TFileMapHandler::Open(str) sdk-only, absent from game flatfilemap.cpp flatfilemap.cpp compiled but not linked (NOLINK): game has no TFlatFileMap symbol
|
||||||
|
TFileMapHandler::Close() sdk-only, absent from game flatfilemap.cpp flatfilemap.cpp compiled but not linked (NOLINK): game has no TFlatFileMap symbol
|
||||||
|
TFileMapHandler::GetBase() sdk-only, absent from game flatfilemap.cpp flatfilemap.cpp compiled but not linked (NOLINK): game has no TFlatFileMap symbol
|
||||||
|
TFileMapHandler::TFileMapHandler() sdk-only, absent from game flatfilemap.cpp flatfilemap.cpp compiled but not linked (NOLINK): game has no TFlatFileMap symbol
|
||||||
|
TFileMapHandler::~TFileMapHandler() sdk-only, absent from game flatfilemap.cpp flatfilemap.cpp compiled but not linked (NOLINK): game has no TFlatFileMap symbol
|
||||||
|
vtable for TFileMapHandler sdk-only, absent from game flatfilemap.cpp flatfilemap.cpp compiled but not linked (NOLINK): game has no TFlatFileMap symbol
|
||||||
|
TBonusGame::ClassId() not-yet-ported function (package E) chocothree.cpp / PortWindow.cpp resolved by package E (BonusGame, SlotMachine, Fireworks, CurveEditor); linked
|
||||||
|
SlotMachine::ClassId() not-yet-ported function (package E) chocothree.cpp / PortWindow.cpp resolved by package E (BonusGame, SlotMachine, Fireworks, CurveEditor); linked
|
||||||
|
TFireworksWindow::ClassId() not-yet-ported function (package E) chocothree.cpp / PortWindow.cpp resolved by package E (BonusGame, SlotMachine, Fireworks, CurveEditor); linked
|
||||||
|
TCurveEditor::ClassId() not-yet-ported function (package E) chocothree.cpp / PortWindow.cpp resolved by package E (BonusGame, SlotMachine, Fireworks, CurveEditor); linked
|
||||||
|
TCurveEditor::SetCurve(boost::shared_ptr<TCurve>) not-yet-ported function (package E) chocothree.cpp / PortWindow.cpp resolved by package E (BonusGame, SlotMachine, Fireworks, CurveEditor); linked
|
||||||
|
TPathSprite::SetScaling/Create/Update/SetCurve/SetSpeed not-yet-ported function (package E) PortWindow.cpp / ChocolateFactory.cpp / ... resolved by package E (present after re-sync)
|
||||||
|
TCurve::Create x2/GetEndPoint/GetStartPoint/GetPoint/GetLength not-yet-ported function (package E) PortWindow.cpp / ChocolateFactory.cpp / ... resolved by package E (present after re-sync)
|
||||||
|
195
docs/port/lua.md
Normal file
195
docs/port/lua.md
Normal file
|
|
@ -0,0 +1,195 @@
|
||||||
|
# Embedded Lua (LuaPlus build 1084 on Lua 5.0.2)
|
||||||
|
|
||||||
|
Survey of the game's Lua against upstream 5.0.2 and the SDK's LuaPlus objects (text checks: nm, otool, objdump,
|
||||||
|
decompiles, DWARF). The game build is optimised (no asserts, heavy inlining); the SDK objects are a debug build of the
|
||||||
|
same source. Where they differ, the game wins.
|
||||||
|
|
||||||
|
## Biggest differences for the port
|
||||||
|
- `^` is unsigned 32-bit XOR when both operands are numbers (otherwise `__pow`).
|
||||||
|
- Every type has a default metatable: indexing a number/boolean/function/thread/wstring returns nil instead of an
|
||||||
|
error, strings index the `string` table, and assignments write into the shared default metatable.
|
||||||
|
- Game `lua_State` is 100 bytes (SDK DWARF says 104: `allocName` is compiled out of the game).
|
||||||
|
|
||||||
|
## Opcodes (39)
|
||||||
|
Format unchanged (OP 6 bits @0, A 8 @24, B 9 @15, C 9 @6, RK constants from 250). `luaP_opmodes` game @0x1a8a20.
|
||||||
|
Four opcodes are inserted after DIV, so upstream POW..CLOSURE move up by 4. Dispatch: `cmpl $0x26` @0xb858f, jump
|
||||||
|
table @0xb85a4.
|
||||||
|
|
||||||
|
| # | Name | Mode | Game handler | Note |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| 0 | MOVE | 24 | b8640 | |
|
||||||
|
| 1 | LOADK | 61 | b8690 | |
|
||||||
|
| 2 | LOADBOOL | 20 | b86c5 | |
|
||||||
|
| 3 | LOADNIL | 24 | b86f1 | |
|
||||||
|
| 4 | GETUPVAL | 20 | b871f | |
|
||||||
|
| 5 | GETGLOBAL | 61 | b8755 | |
|
||||||
|
| 6 | GETTABLE | 34 | b87d6 | |
|
||||||
|
| 7 | SETGLOBAL | 41 | b8a24 | |
|
||||||
|
| 8 | SETUPVAL | 00 | b89eb | |
|
||||||
|
| 9 | SETTABLE | 18 | b8b29 | |
|
||||||
|
| 10 | NEWTABLE | 20 | b8835 | |
|
||||||
|
| 11 | SELF | 34 | b889d | |
|
||||||
|
| 12 | ADD | 38 | b8a69 | |
|
||||||
|
| 13 | SUB | 38 | b8ad3 | |
|
||||||
|
| 14 | MUL | 38 | b8b89 | |
|
||||||
|
| 15 | DIV | 38 | b8be2 | |
|
||||||
|
| 16 | BAND | 38 | b9457 | new, `&` |
|
||||||
|
| 17 | BOR | 38 | b95ab | new, `\|` |
|
||||||
|
| 18 | BSHL | 38 | b9159 → ba350 | new, `<<` |
|
||||||
|
| 19 | BSHR | 38 | b91c0 | new, `>>` (logical) |
|
||||||
|
| 20 | POW | 38 | b930e | numbers: XOR; else `Arith(TM_POW)` |
|
||||||
|
| 21 | UNM | 24 | b9367 | number, string or wstring |
|
||||||
|
| 22 | NOT | 24 | b90b4 | |
|
||||||
|
| 23 | CONCAT | 34 | b90f4 | mixes into wstrings |
|
||||||
|
| 24 | JMP | 02 | b96ff | |
|
||||||
|
| 25 | EQ | 98 | b9721 | |
|
||||||
|
| 26 | LT | 98 | b93f0 | |
|
||||||
|
| 27 | LE | 98 | b985e | |
|
||||||
|
| 28 | TEST | a4 | b978d | |
|
||||||
|
| 29 | CALL | 00 | b97e0 | |
|
||||||
|
| 30 | TAILCALL | 00 | b97e0 | |
|
||||||
|
| 31 | RETURN | 00 | b8c3b | |
|
||||||
|
| 32 | FORLOOP | 02 | b8cd9 | wstring numbers too |
|
||||||
|
| 33 | TFORLOOP | 80 | b8dca | |
|
||||||
|
| 34 | TFORPREP | 02 | b9086 | |
|
||||||
|
| 35 | SETLIST | 01 | b8eb9 | 32 per flush |
|
||||||
|
| 36 | SETLISTO | 01 | b8eb9 | |
|
||||||
|
| 37 | CLOSE | 00 | b906c | |
|
||||||
|
| 38 | CLOSURE | 21 | b8f7b | |
|
||||||
|
|
||||||
|
Bitwise ops (BAND/BOR/BSHL/BSHR and numeric POW): both operands must be numbers (tt 3), no coercion or metamethod,
|
||||||
|
else `luaG_aritherror(L, rb, rc)`. Each operand goes through gcc's SSE code for `(unsigned int)d`: minsd/maxsd clamp
|
||||||
|
to [0, 4294967295] (a NaN takes the upper bound), 2^31 subtracted when the unclamped value is >= 2^31, cvttpd2dq,
|
||||||
|
bit 31 restored. So <0 → 0, >4294967295 → 0xFFFFFFFF, **NaN → 0x80000000** (not 0xFFFFFFFF: cvttpd2dq of
|
||||||
|
4294967295.0 is the integer indefinite). Shift count mod 32 (x86). Result back to double (never negative). The same
|
||||||
|
conversion is used by `string.format` %o/%u/%x/%X and pack `I`/`L`.
|
||||||
|
|
||||||
|
## Lexer / parser
|
||||||
|
- `token2string` @0x21e000, 35 entries; new: `continue`, `*wstring`, `<<`, `>>`. NUM_RESERVED 22.
|
||||||
|
- Token codes: 0x101 and, 0x102 break, 0x103 continue … 0x116 while, 0x117 name, 0x118 `..`, 0x119 `...`, 0x11a `==`,
|
||||||
|
0x11b `>=`, 0x11c `<=`, 0x11d `~=`, 0x11e number, 0x11f string, 0x120 wstring, 0x121 `<<`, 0x122 `>>`, 0x123 eos.
|
||||||
|
- `luaX_lex` @0xf6a47: `<<`, `>>`, `L"..."` wide literals (`read_wstring` @0xf5c66), wide input streams read 2-byte
|
||||||
|
LE chars; `&` and `|` are single chars. No `!=`, no `//`, no unary `~`.
|
||||||
|
- BinOpr: ADD SUB MULT DIV BAND BOR BSHL BSHR POW CONCAT NE EQ LT LE GT GE AND OR.
|
||||||
|
- `priority[]` @0x1a89c0: {6,6}{6,6}{7,7}{7,7}{8,8}×4{10,9}{5,4}{3,3}×6{2,2}{1,1}; UNARY_PRIORITY 8.
|
||||||
|
- `luaK_posfix` @0x11fe20: `op <= OPR_POW → OP_ADD + op`.
|
||||||
|
- `break [N]` and `continue [N]` (inlined in `statement` @0xef5d2): an optional numeric literal N (1..100,
|
||||||
|
"loop block number must be integer" / "loop block number out of range") leaves / continues the N-th enclosing
|
||||||
|
loop. The number is read from the token information after the number token has been passed (it works because a
|
||||||
|
following keyword does not overwrite seminfo). `break` collects the upvalue flags of the non-loop blocks passed
|
||||||
|
and closes to the target loop's nactvar. `continue` only codes an OP_CLOSE from the flags collected before the
|
||||||
|
last loop was reached, down to the nactvar of the last loop passed, so a plain `continue` never closes upvalues.
|
||||||
|
The jump goes to `bl->continuelist`, patched in whilestat (before the condition), repeatstat (before `until`),
|
||||||
|
forbody @0xf11c3 (before FORLOOP/TFORLOOP). Both statements must be last in their block.
|
||||||
|
- Numerals (`read_numeral` @0xf3ab5): `0x` + up to 8 hex digits (the first character after `0x` is consumed even
|
||||||
|
if it is not a digit; value as unsigned 32-bit); a numeral that starts with `0` is otherwise saved as usual;
|
||||||
|
"malformed integer" for a failed numeral without `.`/exponent, "malformed number" otherwise.
|
||||||
|
- Character classes in the lexer are ASCII compares (isspace = 9..13 or ' ', isdigit, isalpha, '_'); a character
|
||||||
|
> 0xFE (wide) is "invalid wide char", controls (<0x20, 0x7F) "invalid control char". `L` followed by `"` starts
|
||||||
|
a wstring, otherwise `L` is the first letter of a name.
|
||||||
|
- Escapes: `read_string` @0xf4ea9 = upstream + `\x` with up to 2 hex digits (without a hex digit the `x` is kept).
|
||||||
|
`read_wstring` @0xf5c66 (resolved): the same escapes with 16-bit characters, `\x` up to 4 hex digits,
|
||||||
|
`\ddd` still limited to 255; its errors report token TK_STRING; only `"` delimits (`L'..'` is a name + string).
|
||||||
|
- `primaryexp` accepts a wstring as call-argument starter but `funcargs` rejects it ("function arguments
|
||||||
|
expected"); `simpleexp` codes wstring constants (luaK_wstringK).
|
||||||
|
- BlockCnt 24 bytes (continuelist at +8); Zio 24 (`isWide` +0x14); luaL_Buffer adds `isWide` at +8.
|
||||||
|
|
||||||
|
## Dump / undump
|
||||||
|
Header and function order upstream. Constant type 9 (wstring): int len+1, then (len+1)×2 bytes UTF-16.
|
||||||
|
`LoadFunction` @0xec0c1 accepts 3/4/9. `f_parser` @0xb0a63: BOM 0xFEFF → skip, `z->isWide = 1`.
|
||||||
|
|
||||||
|
## Types and state
|
||||||
|
- `LUA_TWSTRING 9`, `LUA_NTYPES 11`, `lua_WChar` = unsigned short; typenames add "wstring".
|
||||||
|
- `lua_Alloc(ud, ptr, osize, nsize, const char* allocName, unsigned flags)`; game passes NULL name.
|
||||||
|
- global_State 316 bytes: strt +0, realloc +0x0c, ud +0x10, rootgc +0x14 (upstream fields shifted by 8), _registry
|
||||||
|
+0x34, _defaultmeta +0x40, mainthread +0x4c, dummynode +0x50, tmname +0x6c, _defaultmetatypes[11] +0xa8,
|
||||||
|
fatalErrorFunc +0x12c, minimumstrings +0x130 (never read), globalUserData +0x134, userGCFunction +0x138.
|
||||||
|
- lua_State, game 0x64: upstream 0x5c + allocFlags +0x5c + stateUserData +0x60 (see Resolved questions).
|
||||||
|
- `lua_open` @0xb269f, `f_luaopen` @0xb219f: default meta tables (`_defaultmeta` is its own metatable;
|
||||||
|
`_defaultmetatypes[1..10]` have `_defaultmeta` as metatable), `defaultFatalErrorFunc` @0xb218b (exit(1)), initial
|
||||||
|
memory 0x1a0, `luaZ_openspace(lua_minimumauxspace)`. `l_alloc` @0xb2163 = realloc/free.
|
||||||
|
- No refcounting (`LUA_REFCOUNT 0`). `luaA_index` @0x5edfa: index < -40000 reads registry[-40000-idx].
|
||||||
|
|
||||||
|
## Libraries
|
||||||
|
- `TScript::LuaInit` @0x79e50 opens base, string, table only; `luaopen_math` only from
|
||||||
|
`TLuaParticleSystem::NewScript` @0x9a183. No io/debug/loadlib; lwstrlib not linked.
|
||||||
|
- `luaopen_base` @0xc2a67: upstream + `towstring`; sets registry["_boolean".."_wstring"] to default metatables.
|
||||||
|
- `luaopen_string` @0xc438c: strlib + `lualex`; `string` becomes the default metatable for strings; then pack/unpack.
|
||||||
|
- `lua_getn` @0x80a02 (LuaPlus): field "n" if number, else max(trailing array count, largest numeric hash key).
|
||||||
|
- `luaL_loadfile` @0xa5850 uses pf_open/pf_getc/... (0x400-byte chunks, no stdin).
|
||||||
|
|
||||||
|
## LuaPlus functions present in the game
|
||||||
|
luaL_addlwstring 0xa4ff9, luaL_checklwstring 0xa4f4b, luaL_wbuffinit 0xa47e0, luaB_towstring 0xc2167,
|
||||||
|
luaK_wstringK 0x11dc24, read_wstring 0xf5c66, luaO_wstr2d 0xb556d, luaS_newlwstr 0xb6251, str_lualex 0xc3b33,
|
||||||
|
str_format_helper 0xc4418, l_pack 0xc7426, l_unpack 0xc879e, luaH_getkey 0xb415c, luaT_getmetatable 0xb65b4,
|
||||||
|
luaZ_lookahead_2 0xba8fb, lua_getdefaultmetatable 0x8095c, lua_setdefaultmetatable 0x809c4, lua_getn 0x80a02,
|
||||||
|
lua_newuserdatabox 0x80af2, luaV_towstring 0x80b65, lua_pushwstring 0x80c3a, lua_pushlwstring 0x808ed,
|
||||||
|
lua_towstring 0x80cce.
|
||||||
|
|
||||||
|
## Metamethods on default metatables
|
||||||
|
`luaT_gettmbyobj` @0xb6574 returns the type's default metatable object for non-table/userdata values.
|
||||||
|
`luaV_gettable` @0xb82a7 falls back to indexing the metatable itself when the metamethod is nil; `luaV_settable`
|
||||||
|
@0xb6eb1 writes into it. Userdata without `__index` look up in their own metatable.
|
||||||
|
|
||||||
|
## Resolved questions (2026-10-16, from the game decompile/disassembly)
|
||||||
|
- `read_wstring` escapes: see Lexer above.
|
||||||
|
- `string.lualex(s, wide)` (`str_lualex` @0xc3b33): un-escapes a Lua string body into a narrow string: `\a \b \f
|
||||||
|
\n \r \t \v`, `\x` (2 hex digits, 4 when wide; the value is stored as 2 bytes low/high in both modes), `\ddd`
|
||||||
|
(up to 3 digits, byte), any other escaped character kept. Quirks kept in the port: after `\x..` and `\ddd` one more
|
||||||
|
source character is skipped; with `wide` != 0 every other stored character is followed by the source character
|
||||||
|
at the current index (not by a zero byte). Its only use would be the SDK; the game scripts are not known to call it.
|
||||||
|
- `allocFlags` (lua_State +0x5c): 0 in the main thread (lua_open), LUA_ALLOC_TEMP (1) while `luaZ_openspace`
|
||||||
|
@0xba82f reallocates a buffer (restored afterwards), never initialised for other threads (luaE_newthread leaves
|
||||||
|
it as allocated). It is passed as the last argument of every lua_Alloc call (luaM_realloc @0xebd50, growaux);
|
||||||
|
`l_alloc` ignores it.
|
||||||
|
- +0x60 is `stateUserData`: cleared by lua_open and luaE_newthread (preinit_state); no reader or writer in the
|
||||||
|
game (lua_get/setstateuserdata are dead-stripped and no SDK object references them).
|
||||||
|
|
||||||
|
## More differences found while porting (tools/port/thirdparty/lua-5.0.2-luaplus.patch)
|
||||||
|
- Allocation: `lua_open`/`f_luaopen`/`close_state` allocate/free the main thread and global state through a zeroed
|
||||||
|
stack lua_State whose global_State carries `luaHelper_defaultAlloc` (@0x1df360 = l_alloc) and its ud (@0x21f3a0);
|
||||||
|
`nblocks` starts at 0x1a0 (100 + 316). `luaM_realloc` always calls the allocator (also for size 0), with NULL name.
|
||||||
|
- `luaE_newthread`/`luaE_freethread` call the new/free thread handlers (statics @0x21f3ac/@0x21f3a8, setters dead).
|
||||||
|
- GC: markroot also marks `_defaultmetatypes[0..10]`; proto constants mark wstrings; weak-table clearing treats
|
||||||
|
wstrings as values; userGCFunction (+0x138, setter dead) is called after the roots and after each thread with the
|
||||||
|
GCState (6th member = thread). `freeobj` frees wstrings ((len+1)*2 data bytes).
|
||||||
|
- `luaS_newlstr` matches only tt 4 (wstrings share the string table, `luaS_newlwstr` @0xb6251 only tt 9).
|
||||||
|
- `luaS_newudata` @0xb5fa3 rounds the size up to even and uses `_defaultmetatypes[USERDATA]` as metatable;
|
||||||
|
`luaH_new` uses `_defaultmetatypes[TABLE]`; `lua_setmetatable(nil)` still sets `_defaultmeta`.
|
||||||
|
- `lua_getmetatable` @0x60bde returns `luaT_getmetatable` of any value (default metatables included; no test
|
||||||
|
against `_defaultmeta`; an unacceptable index is passed as NULL), so `getmetatable` returns a table for every value.
|
||||||
|
- `luaV_settable` @0xb6eb1: after a raw set of nil `luaH_getkey` (result unused); after a `__newindex` call on a
|
||||||
|
table the key is raw-set (creates its node) and looked up.
|
||||||
|
- `luaV_concat` @0xb70f5: the first string/wstring from the last operand down decides the pass; a wide pass
|
||||||
|
converts with `luaV_towstring` (numbers only), so string..wstring raises "attempt to concatenate a wstring value".
|
||||||
|
- `luaT_gettmbyobj` returns the type's default metatable for every event, so metamethod lookups on non-table
|
||||||
|
values find a table (not a function): e.g. order comparison of two wstrings/booleans calls that table ("attempt to
|
||||||
|
call a table value"), and the second operand's metamethod is never tried when the first is a non-table value.
|
||||||
|
- API pushes (`api_incr_top`) grow the stack when L->top reaches ci->top.
|
||||||
|
- `lua_towstring` @0x80cce: a number is converted in place and NULL returned; any other non-number value returns
|
||||||
|
its string payload pointer without a type test. `luaB_towstring` @0xc2167: number → nil (converted argument),
|
||||||
|
string → widened (sign-extended chars), table/function/userdata/thread → formatted but unused, result "" (the
|
||||||
|
table case passes the type number to `%.40s`, which crashes the game), boolean/light userdata → argument error.
|
||||||
|
`luaB_tostring` truncates wstring characters to 8 bits. `print` writes wstrings via `towstring` and fputws.
|
||||||
|
`tonumber(ws, base)` truncates to 8 bits (< 100 characters) before strtoul.
|
||||||
|
- `luaO_wstr2d` @0xb556d: no leading spaces; decimal `[+-]digits[.digits][e[+-]digits]` (exponent letter/sign
|
||||||
|
consumed without digits); hex `0x` digits, and only after `.` a binary `p` exponent.
|
||||||
|
- `string.format` (`str_format_helper` @0xc4418): + `%Q` (C-style quoting, wstrings as L"..." with \x%04x), `%B`
|
||||||
|
(boolean/nil → true/false), `%bX` raw bytes (bb, bw, bd, bf, bF). pack/unpack (@0xc7426/@0xc879e) = lpack +
|
||||||
|
`w` prefix (wstring operands for A z p P a), `B` boolean byte, `@N[:fill]` alignment (pack), count 0 → 1.
|
||||||
|
- `luaL_buffinit`/`luaL_wbuffinit` set isWide 0/1; a wide buffer is pushed as a wstring.
|
||||||
|
- Dump/undump: size fields are 4 bytes and the header says sizeof(size_t) = 4 (i386) on any host.
|
||||||
|
|
||||||
|
## Port notes
|
||||||
|
- Host (LP64) handling in the patch: Instruction is 4 bytes; double→int conversions use the i386 result
|
||||||
|
(0x80000000 when out of range: `lua_x86int`, `luaL_x86int` in lauxlib.h for luaL_checkint/optint and friends);
|
||||||
|
strtoul in `tonumber` is 32-bit; pointer hashing uses the low 32 bits. Struct sizes differ from the i386 game
|
||||||
|
(pointers are 8 bytes) but member order is the game's.
|
||||||
|
- Dead-stripped in the game and left as upstream in the library: luaL_ref/unref, luaL_newmetatable/getmetatable/
|
||||||
|
checkudata, luaL_findstring, lua_dofile, lua_atpanic, lua_cpcall, lua_equal, lua_version, lua_pushupvalues,
|
||||||
|
lua_get/setupvalue, lua_get/sethook*, lua_get/setlocal, lua_tocfunction, luaA_pushobject. LuaPlus-only and
|
||||||
|
dead-stripped, not provided: lua_wload, luaL_loadwbuffer, lua_dowbuffer, lua_dowstring, luaL_addwstring,
|
||||||
|
luaL_optlwstring, lua_iswstring, lua_getallocf, lua_pushthread, lua_get/setdefaultallocfunction,
|
||||||
|
lua_get/setglobaluserdata, lua_get/setstateuserdata, lua_setfatalerrorfunction, lua_setminimum*,
|
||||||
|
lua_setusergcfunction, luaX_get/set*threadhandler, luaT_setmetatable. Not linked by the game: io, os, debug,
|
||||||
|
loadlib libraries (not built).
|
||||||
63
docs/port/review-2026-10-22.md
Normal file
63
docs/port/review-2026-10-22.md
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
# Second review pass, 2026-10-22 (PORTING.md step 5)
|
||||||
|
|
||||||
|
Method: GAME decompile read next to the port, branch by branch; float/double constants and strings read from the game
|
||||||
|
binary (not from the decompile text); disassembly with llvm-objdump where the decompile was ambiguous. Verdicts:
|
||||||
|
ok = identical, fixed = real difference corrected in this pass, unsure = noted, no change made.
|
||||||
|
|
||||||
|
## MapWindow.cpp (never reviewed before)
|
||||||
|
- CollectPortData: fixed. The right-align threshold is 750.0f (@0x001ab73c), the port had 748.0f. Default popupX/popupY
|
||||||
|
use (int)x / (int)y of the float coordinates (game), not the double map values.
|
||||||
|
- All other MapWindow functions (ctor, dtor, Init, Draw, UpdateClouds, OnTaskAnimate, Pause/ResumeTravel,
|
||||||
|
WindowToggleForeground, ToggleForeground, InitiateTravel, PostChildrenInit): ok.
|
||||||
|
- TravelTask (ctor, SetMode, AddEvent, Animate) and TravelEvent::Trigger: ok (constants 180/360/0.5/12 checked).
|
||||||
|
|
||||||
|
## CoffeeFactory.cpp
|
||||||
|
- Init: ok (all default constants, call order, argument order of IngredientQueue/Hopper/Grid/GunTask checked).
|
||||||
|
- OnMessage: ok (message ids 0x3eb..0x3f2 match the enum).
|
||||||
|
- ResetGame, StartGame, ResumeGame, PauseGame, SetGameState, MissedIngredient, OnTaskAnimate, OnMouseMove/Down,
|
||||||
|
OnKeyDown, PostChildrenInit, ParseRecipe, Draw, ctor, dtor, ToggleForeground, CoffeeBonus ctor/Tick: ok.
|
||||||
|
|
||||||
|
## DookieDropper.cpp
|
||||||
|
- Draw: ok except the table. weeksPerColumn is indexed by the player rank (1..7); rank 7 reads the float after the
|
||||||
|
seven values. The binary holds 0.0f there (@0x00192b5c), so the table now has 8 entries (fixed; before it was an
|
||||||
|
out-of-bounds read).
|
||||||
|
- Draw text/PostChildrenInit defaults (itemx 18, itemy 86, ingredienty 58, barHeight 42, countx 57, county 86): ok.
|
||||||
|
- Update, Animate, ctor, DookieCollector::Process: ok. unsure (no effect): the game deletes the per-factory table in
|
||||||
|
LedgerWindow::UpdateLedger before/after Update; only a Lua reference release, order not observable.
|
||||||
|
|
||||||
|
## CoffeeGrid.cpp
|
||||||
|
- CountVertical, CountHorizontal, GetSlotIndex x2, GetRelativeSlotPosition, GetSlotPosition, SetTargetImage,
|
||||||
|
SetTargetPosition, ctor, Create, Reset, IsSlotEmpty, CanAccept, ShiftRows, RemoveIngredient, ClearGrid, ClearFrom,
|
||||||
|
AddIngredient, CoffeeGridTask ctor/Reset/Pause/Restart/Animate: ok. The game's CoffeeGridTask ctor leaves oldT
|
||||||
|
uninitialised, as the port does.
|
||||||
|
|
||||||
|
## CoffeeHopper.cpp
|
||||||
|
- UpdateMeter, Release, Add, Reset, ctor (layout constants -53/65/81/106/32/56.5/-6.5/-3.5/11 checked), Create,
|
||||||
|
HopperCollectionTask ctor/Reset/Animate/Add x2 (collectTime 250, target x - 75): ok.
|
||||||
|
|
||||||
|
## PortWindow.cpp
|
||||||
|
- ctor, dtor, Init, PostChildrenInit, DoAnimation, ChangeMusic, Draw, TintBackground, CancelBuildingHighlight,
|
||||||
|
FindBuilding, OnMouseMove/Up/Down, PausePortAnimations, WindowToggleForeground, CollectBuildingData,
|
||||||
|
CollectSpriteData (path/static branches, PathMode values 0/2/3, htile tiles, tints): ok.
|
||||||
|
|
||||||
|
## LedgerWindow.cpp
|
||||||
|
- ToggleForeground, UpdateMoney (thresholds 1e11/1e9/1e8), UpdateLedger (all branches), PrepareInstance,
|
||||||
|
SetQuestIndicator, Animate, TLedgerAnimTask::Animate, Grab, Release, AnimateProduction, dtor: ok.
|
||||||
|
- ctor: unsure (benign): the port sets pTask = NULL, the game leaves it uninitialised until Grab.
|
||||||
|
|
||||||
|
## RecipeDesigner.cpp
|
||||||
|
- SetLayer: ok. Disassembly @0x3343e..3344a confirms `(nImage + size) % size` is a signed idivl (cltd; idivl %ecx)
|
||||||
|
and the result is stored as the (signed) index.
|
||||||
|
- GetLayerImage, SetRecipeType, OnTaskAnimate (1001/1501/1801 thresholds, RandRange lower bounds 0/1/2/0), RandomDesign,
|
||||||
|
ctor/dtor: ok.
|
||||||
|
|
||||||
|
## Known deviations
|
||||||
|
- Character.cpp PostChildrenInit: fixed. The scaled width/height use the game's clamped double->uint32 conversion
|
||||||
|
(SseDoubleToUInt32, see sseconv.h) instead of a plain cast.
|
||||||
|
- BitmapTint.cpp: fixed. Draw converts the window width/height with an unsigned->double conversion (game), Init tests
|
||||||
|
`0 < (int)w && 0 < (int)h` through SseDoubleToInt32 (x87 fistp gives 0x80000000 out of range). TRectangle
|
||||||
|
(Rectangle.cpp) was already correct ((float)(uint32_t) of the size, as in the game).
|
||||||
|
- Curve.cpp `delete[]` on `new TVert[n]`: ok. TVert is trivially destructible, so `new[]` stores no cookie and
|
||||||
|
`delete[]` calls the same operator delete as the game's __ZdlPv. CurveEditor.cpp has no such array.
|
||||||
|
- Curve.cpp const_cast in GetLength/RenderCurve: ok. The game builds the divisions lazily through the const `this`;
|
||||||
|
the objects are never const-defined (held by shared_ptr<TCurve>), so the cast is well-defined and identical.
|
||||||
1147
docs/port/unknown-classified.tsv
Normal file
1147
docs/port/unknown-classified.tsv
Normal file
File diff suppressed because it is too large
Load diff
35
docs/port/verified/crypto.txt
Normal file
35
docs/port/verified/crypto.txt
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
000587f0
|
||||||
|
00058916
|
||||||
|
00058966
|
||||||
|
00058acc
|
||||||
|
00058ad4
|
||||||
|
0009e3ac
|
||||||
|
0009e620
|
||||||
|
0009e64c
|
||||||
|
0009e778
|
||||||
|
0009e786
|
||||||
|
0009e8a6
|
||||||
|
000a6d30
|
||||||
|
000a6d58
|
||||||
|
000a6efe
|
||||||
|
000a6f36
|
||||||
|
000a70b6
|
||||||
|
000a7110
|
||||||
|
000a7172
|
||||||
|
000a73c6
|
||||||
|
000a764e
|
||||||
|
000a766c
|
||||||
|
0015d5bc
|
||||||
|
00184d38
|
||||||
|
001a6180
|
||||||
|
001a61e0
|
||||||
|
001a65e0
|
||||||
|
001a69e0
|
||||||
|
001a6de0
|
||||||
|
001d82e0
|
||||||
|
001df2a0
|
||||||
|
001df320
|
||||||
|
001df324
|
||||||
|
001df32c
|
||||||
|
001df330
|
||||||
|
001df334
|
||||||
66
docs/port/verified/math.txt
Normal file
66
docs/port/verified/math.txt
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
0004033c
|
||||||
|
0004034c
|
||||||
|
00040362
|
||||||
|
0004037a
|
||||||
|
00040390
|
||||||
|
000403ac
|
||||||
|
000403d4
|
||||||
|
000403e8
|
||||||
|
00040402
|
||||||
|
0004041e
|
||||||
|
0004043a
|
||||||
|
0004045e
|
||||||
|
00040496
|
||||||
|
000404ac
|
||||||
|
000404ce
|
||||||
|
000404f2
|
||||||
|
00040514
|
||||||
|
00040556
|
||||||
|
00040572
|
||||||
|
000405ac
|
||||||
|
000405c4
|
||||||
|
00040606
|
||||||
|
00040632
|
||||||
|
0004065e
|
||||||
|
0004069a
|
||||||
|
000406d0
|
||||||
|
000406fc
|
||||||
|
0004072a
|
||||||
|
00040764
|
||||||
|
000407a0
|
||||||
|
000407c8
|
||||||
|
000407f4
|
||||||
|
0004081c
|
||||||
|
00040866
|
||||||
|
0006ef34
|
||||||
|
0006ef3c
|
||||||
|
0006ef9c
|
||||||
|
00078d8a
|
||||||
|
00078dac
|
||||||
|
00078e24
|
||||||
|
00078ebe
|
||||||
|
00078f40
|
||||||
|
00078f9e
|
||||||
|
000790c4
|
||||||
|
0007912e
|
||||||
|
0007917a
|
||||||
|
00079244
|
||||||
|
000792b2
|
||||||
|
00079310
|
||||||
|
0007933c
|
||||||
|
000793fa
|
||||||
|
000794a8
|
||||||
|
0007950c
|
||||||
|
000795b6
|
||||||
|
00079676
|
||||||
|
000796ee
|
||||||
|
00079834
|
||||||
|
000799fe
|
||||||
|
00079a50
|
||||||
|
00079af2
|
||||||
|
00193160
|
||||||
|
00193180
|
||||||
|
00193250
|
||||||
|
001ab6e4
|
||||||
|
001ab6e8
|
||||||
|
001ab6ec
|
||||||
21
docs/port/verified/memfile.txt
Normal file
21
docs/port/verified/memfile.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
000502d0
|
||||||
|
000a5a9c
|
||||||
|
000a5ab0
|
||||||
|
000a5ace
|
||||||
|
000a5be6
|
||||||
|
000a5c82
|
||||||
|
000a5cca
|
||||||
|
000a5cd6
|
||||||
|
000a5ce2
|
||||||
|
000a5d06
|
||||||
|
000a5d10
|
||||||
|
000a5d42
|
||||||
|
000a5d62
|
||||||
|
000d553c
|
||||||
|
000d5548
|
||||||
|
000d5554
|
||||||
|
000d5560
|
||||||
|
000d55d2
|
||||||
|
000d55e0
|
||||||
|
000d5676
|
||||||
|
0015d57c
|
||||||
28
docs/port/verified/str.txt
Normal file
28
docs/port/verified/str.txt
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
00050280
|
||||||
|
000502a4
|
||||||
|
000502b2
|
||||||
|
000502d0
|
||||||
|
00050338
|
||||||
|
0005041c
|
||||||
|
00050494
|
||||||
|
000504ca
|
||||||
|
0005053e
|
||||||
|
0005055e
|
||||||
|
00050580
|
||||||
|
0005071a
|
||||||
|
00050b6e
|
||||||
|
00050c4c
|
||||||
|
00050d92
|
||||||
|
00050eca
|
||||||
|
00050f0e
|
||||||
|
000511f4
|
||||||
|
0005127a
|
||||||
|
0005133a
|
||||||
|
00051440
|
||||||
|
000516de
|
||||||
|
000517da
|
||||||
|
00051c10
|
||||||
|
00051dd0
|
||||||
|
00051e9c
|
||||||
|
0005206e
|
||||||
|
000521be
|
||||||
51
docs/port/verified/xml.txt
Normal file
51
docs/port/verified/xml.txt
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
00048fc0
|
||||||
|
000490c2
|
||||||
|
00049404
|
||||||
|
00049a0c
|
||||||
|
00049b46
|
||||||
|
00049d22
|
||||||
|
00049d9c
|
||||||
|
00049dc0
|
||||||
|
00068a58
|
||||||
|
00068a6c
|
||||||
|
00068a94
|
||||||
|
00068a9a
|
||||||
|
00068b1c
|
||||||
|
00068cf2
|
||||||
|
00068d42
|
||||||
|
00068d98
|
||||||
|
00068da6
|
||||||
|
00068e00
|
||||||
|
00068ea0
|
||||||
|
00068eae
|
||||||
|
00068f58
|
||||||
|
0006918a
|
||||||
|
00069792
|
||||||
|
00069812
|
||||||
|
00069890
|
||||||
|
00069cb2
|
||||||
|
00069fd4
|
||||||
|
0006a0dc
|
||||||
|
0006a246
|
||||||
|
0006a2ba
|
||||||
|
0006a376
|
||||||
|
0006a5a8
|
||||||
|
0006a80c
|
||||||
|
0006a994
|
||||||
|
0006aa74
|
||||||
|
0006aaec
|
||||||
|
0006ab58
|
||||||
|
0012a2a2
|
||||||
|
001581bc
|
||||||
|
0016f47a
|
||||||
|
001807b0
|
||||||
|
001807e8
|
||||||
|
00180808
|
||||||
|
00180844
|
||||||
|
00180870
|
||||||
|
001808b0
|
||||||
|
001808dc
|
||||||
|
00180900
|
||||||
|
00180910
|
||||||
|
00180960
|
||||||
|
00193200
|
||||||
150
docs/port/windows.md
Normal file
150
docs/port/windows.md
Normal file
|
|
@ -0,0 +1,150 @@
|
||||||
|
# Windows build and system layer (HANDOFF task 9, Windows edition)
|
||||||
|
|
||||||
|
Owner's decision 2026-10-22: Windows is the first run target. State: `choc3port.exe` **builds and links with zero
|
||||||
|
undefined symbols and runs** (32-bit, llvm-mingw, CMake + Ninja; windowed, DPI-aware, resizable scaling is WIP). Runtime
|
||||||
|
bugs are fixed in `port/src`, `port/game`. Everything below `port/src/win/` is **Windows system layer (task 9), not 1:1**; the ported
|
||||||
|
engine and game files are unchanged except the two header edits listed under "Edits to ported files".
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```
|
||||||
|
bash port/winbuild.sh # prepares third-party trees, builds OpenAL Soft once, configures + builds (-j4)
|
||||||
|
port/build-win/bin/choc3port.exe + OpenAL32.dll
|
||||||
|
```
|
||||||
|
|
||||||
|
`winbuild.sh` needs: llvm-mingw (`winget install MartinStorsjo.LLVM-MinGW.UCRT`, auto-detected or
|
||||||
|
`$LLVM_MINGW_ROOT`), CMake + Ninja (found on PATH or in the Visual Studio install), bash/tar/unzip/patch/git (Git for
|
||||||
|
Windows). `tools/port/prepare_thirdparty_win.sh` is the Windows twin of the unpacking and patching half of
|
||||||
|
`build_thirdparty.sh` (same archives, same `tools/port/thirdparty/*.patch`, verified byte-identical to the Mac-made
|
||||||
|
`parity-out/thirdparty/build` trees); the libraries themselves are compiled by `port/CMakeLists.txt` (zlib, libpng,
|
||||||
|
libjpeg, JasPer, Lua 5.0.2/LuaPlus, libogg, libvorbis, libvorbisfile: same file lists and flags as the shell script).
|
||||||
|
`port/Makefile` stays the Mac build.
|
||||||
|
|
||||||
|
## Toolchain decision (tested)
|
||||||
|
|
||||||
|
| Candidate | Result |
|
||||||
|
|---|---|
|
||||||
|
| MSVC `cl` (VS 2022 / VS 18 installed) | Not used: the port is Apple-clang/libc++ flavoured (GNU extensions, `-include`d math.h for libpng, `std::auto_ptr` via libc++ switches, POSIX headers). Would need a wider source diff. |
|
||||||
|
| clang-cl / Swift toolchain clang | Same MSVC-STL issues; no gain. |
|
||||||
|
| **llvm-mingw 20261006 (clang 23, libc++, UCRT, winpthreads)** | **Chosen.** Same compiler family and the same libc++ as the Mac build; POSIX headers (`pthread.h`, `unistd.h`, `sys/time.h`) exist. |
|
||||||
|
| llvm-mingw **x86_64** | Tried first, rejected: `include/pf/pftypes.h` hard-codes `intptr_t = int` and the sources cast pointers to 32-bit ints (about 200 errors: typedef redefinition, pointer-to-smaller-int casts). |
|
||||||
|
| llvm-mingw **i686** | **Chosen target.** The shipped game is ILP32; `long`, pointers and `size_t` are 32-bit exactly like the original (LLP64 is not an issue on a 32-bit target), so `libc32.h` and the struct layouts keep their meaning. Flags: `-msse2 -mfpmath=sse -ffp-contract=off -mstackrealign` (scalar SSE single precision like the game; x87 would change float results). |
|
||||||
|
|
||||||
|
## Compile error classes found (and the answer to each)
|
||||||
|
|
||||||
|
| Class | Count (first survey, 145 files) | Answer |
|
||||||
|
|---|---|---|
|
||||||
|
| 64-bit pointer assumptions (`intptr_t` redefinition, pointer to 32-bit int casts) | ~200 | build 32-bit (i686) |
|
||||||
|
| `pf/pfconfig.h` takes the Windows-SDK branch under `_WIN32` (`dllimport` PFLIB_API, `wctype_t`, no `alloca`) | ~460 | `-DPF_WINDOWS_PORT` makes it take the Mac branch (static link, `MACINTOSH`, unistd/alloca) |
|
||||||
|
| Apple headers: `Carbon/Carbon.h`, `CoreFoundation`, `CoreServices`, `OpenGL/gl.h`, `OpenGL/glu.h`, `OpenAL/al.h`, `OpenAL/alc.h` | 16 files | shim headers in `port/src/win/include` (same include names; Carbon/CF types and calls declared there, GL enums added, OpenAL -> AL/ of OpenAL Soft) |
|
||||||
|
| Apple-only files: `AudioToolbox`, `CoreAudio`, `MacTypes.h`, `mach/*` (all of `port/external/openal`, 20 files) | all | not compiled on Windows: replaced by OpenAL Soft (decision below) |
|
||||||
|
| IOKit (`drm/HardwareFingerprint.cpp`), CoreFoundation/dirent `d_type` (`fileio.cpp`), WebKit/Objective-C (`flashhost.mm`) | 3 | replacement files in `port/src/win` |
|
||||||
|
| libc: `mkdir(path, mode)`, `vasprintf`, `alloca.h`, libogg's `<_G_config.h>` (Cygwin branch of `os_types.h`) | 5 | force-included `pfwin_compat.h` (inline `mkdir`/`vasprintf`, `system("open ...")` redirect), shim `alloca.h`, shim `_G_config.h` |
|
||||||
|
| pthreads | 11 link errors | `-lpthread` (winpthreads) |
|
||||||
|
| OpenAL Soft's bundled fmt lacks `<cstdlib>` with this libc++ | 1 | `-include cstdlib` for that build only |
|
||||||
|
|
||||||
|
After these the whole tree (engine, game, 8 third-party libs, `display.cpp`/`flatfilemap.cpp` as compiled-not-linked
|
||||||
|
objects like the Makefile) compiles with `-w` (as the Mac build) and links.
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
1. **OpenAL Soft replaces the ported Apple OpenAL classes on Windows.** The game's sound code (`port/src/mac/sound*.cpp`,
|
||||||
|
`soundmanager*.cpp`) only uses the plain OpenAL 1.1 C API (`alGenSources`, `alBufferData`, `alcOpenDevice`, ...), which
|
||||||
|
is exactly what OpenAL Soft provides. The statically linked Apple implementation in `port/external/openal`
|
||||||
|
(`oalImp`, `oalContext`, `oalSource`, CoreAudio utility classes, `mach_*`) is Apple-framework code and is **not built
|
||||||
|
on Windows**; it stays in the tree, 1:1, for the Mac. OpenAL Soft 1.24.3 is built from source as `OpenAL32.dll`
|
||||||
|
(LGPL: kept as a DLL next to the exe, not linked statically) by `winbuild.sh`; `OpenAL/al.h` and `OpenAL/alc.h` shim
|
||||||
|
headers forward to it.
|
||||||
|
2. **A Carbon compatibility layer instead of a rewritten TPlatformData.** `port/src/mac/platformdata.cpp` (1:1 port of
|
||||||
|
the game's window, Carbon event loop, AGL context and full-screen code) compiles and runs unchanged on top of
|
||||||
|
`port/src/win/carbon_compat.cpp`, which implements the Carbon / QuickDraw / Display Manager / QuickTime /
|
||||||
|
CoreGraphics / CoreFoundation / FSFindFolder / Thread Manager / URL Access Manager / AGL calls the game makes. It
|
||||||
|
replaces `link_stubs.cpp` (the 36 link-only stubs: every one of the symbols of `docs/port/link-report.tsv` class
|
||||||
|
`system-api` now has a working body, plus the Carbon calls the Mac SDK still declares). Event translation, the
|
||||||
|
Mac key/character codes the game decodes, global vs local mouse coordinates, `GetKeys` modifier bits, and the
|
||||||
|
double dispatch of events through `SendEventToEventTarget` follow the Carbon behaviour the 1:1 code expects.
|
||||||
|
`carbon_compat.cpp` never includes `<windows.h>` (Carbon names such as `ShowWindow`, `MoveWindow`,
|
||||||
|
`GetCurrentProcess` collide with Win32); it talks to `win32_bridge.cpp` through `win32_bridge.h`.
|
||||||
|
3. **Window and GL.** Win32 window (`CS_OWNDC`, no resize) + WGL legacy context on its DC: `aglChoosePixelFormat`
|
||||||
|
becomes `ChoosePixelFormat` (RGBA, double buffer, depth 32 falling back to 24/16, 2 aux buffers as the game asks);
|
||||||
|
`AGL_SWAP_INTERVAL` becomes `wglSwapIntervalEXT`. The game's GL calls are untouched: every call is OpenGL 1.1 (all in
|
||||||
|
`opengl32`/`glu32`); the GL 1.2/1.3 enums (`GL_BGRA`, `GL_CLAMP_TO_EDGE`, `GL_COMBINE`, ...) come from the
|
||||||
|
`OpenGL/gl.h` shim.
|
||||||
|
4. **Full screen** = `ChangeDisplaySettingsEx(CDS_FULLSCREEN)` to the requested size (restored on `EndFullScreen`) plus a
|
||||||
|
borderless topmost window. The Mac display fade calls succeed and do nothing. A Mac "hidden" window is a minimized
|
||||||
|
window; the `hide` command minimizes and raises `kEventAppHidden` / `kEventAppShown`.
|
||||||
|
5. **Input.** Win32 messages are normalized in the bridge (`W32Event`) and turned into Carbon events: raw keys with Mac
|
||||||
|
character code + virtual key code (F1..F4 keep the `0x10` + key code mapping the game uses for `p q r s`; arrows
|
||||||
|
`0x1c..0x1f`, Return `0x0d`, Esc `0x1b`, Delete `0x7f`), text input events (`WM_CHAR`), mouse down/up/move/drag/
|
||||||
|
enter/exit/wheel (right button = secondary, middle = tertiary), activate/deactivate, window close/collapse/expand/
|
||||||
|
bounds. Option = Alt, Control = Control (Alt+Enter toggles full screen as on the Mac).
|
||||||
|
6. **Files and folders.** `TPlatformData`'s bundle calls map to: resources = `<exe dir>\Resources` if it exists, else the
|
||||||
|
exe dir (the game does `chdir` there and `TFile::ScanForResources`); shared preferences = `%ProgramData%\PlayFirst\<name>`;
|
||||||
|
per-user preferences = `%APPDATA%\<name>`; desktop = the Desktop folder. `<name>` is `CFBundleName`, default
|
||||||
|
`Chocolatier3`, overridable with a `bundle.txt` next to the exe (`CFBundleName=`, `CFBundleVersion=`). **Open
|
||||||
|
question for the owner/lead:** the shipped Info.plist's real `CFBundleName` / `CFBundleVersion` (they become the window
|
||||||
|
title, the `gamename` config and the save folder; read them from the Steam app's `Info.plist` on the Mac).
|
||||||
|
7. **Process setup** (`win32_bridge.cpp`): default file mode is binary (`_set_fmode(_O_BINARY)`; the engine opens files with
|
||||||
|
`"r"/"w"/"a"` and no `b`, which would corrupt data in Windows text mode), DPI awareness (client area = requested pixel
|
||||||
|
size), 1 ms timer resolution.
|
||||||
|
8. **Threads and net.** The Thread Manager's cooperative threads (`NewThread`/`YieldToThread`/`YieldToAnyThread`/
|
||||||
|
`DisposeThread`) are Win32 fibers; the URL Access Manager (GET/POST, state machine, buffers) is WinINet on a worker
|
||||||
|
thread; `open "<url>"` (`OpenBrowser`) goes through `pfwin_system` -> `ShellExecute`.
|
||||||
|
9. **Flash host.** There is no Flash runtime: `win/flashhost_win.cpp` is a stub (`Start` returns false, never playing);
|
||||||
|
the intro/splash is the modern-engine phase (PLAN.md). The game treats a failed `Start` as "no movie".
|
||||||
|
10. **Hardware fingerprint** (DRM/computer id/GUID input) is the MAC of the first physical adapter
|
||||||
|
(`GetAdaptersAddresses`), same encoding as the Mac IOKit code (6 bytes, zero padded, little endian, or
|
||||||
|
`0xdeadbeefdeadbeef`).
|
||||||
|
|
||||||
|
## Files (all new, all "Windows system layer (task 9), not 1:1")
|
||||||
|
|
||||||
|
`port/CMakeLists.txt`, `port/cmake/llvm-mingw-i686.cmake`, `port/winbuild.sh`, `tools/port/prepare_thirdparty_win.sh`,
|
||||||
|
`port/src/win/carbon_compat.cpp`, `win32_bridge.cpp`/`.h`, `fileio_win.cpp`, `hardwarefingerprint_win.cpp`,
|
||||||
|
`flashhost_win.cpp`, and the shim headers `port/src/win/include/{Carbon,CoreFoundation,CoreServices,OpenGL,OpenAL}/*`,
|
||||||
|
`alloca.h`, `_G_config.h`, `pfwin_compat.h`.
|
||||||
|
Not built on Windows (Mac originals kept): `src/mac/link_stubs.cpp`, `src/mac/fileio.cpp`,
|
||||||
|
`src/mac/drm/HardwareFingerprint.cpp`, `src/mac/flashhost.mm`, all of `external/openal`.
|
||||||
|
|
||||||
|
## Edits to ported files (minimal portability edits, as allowed)
|
||||||
|
|
||||||
|
- `port/include/pf/pfconfig.h` line 77: the Mac configuration branch is also taken for `PF_WINDOWS_PORT`.
|
||||||
|
- `port/src/mac/urlaccess_decls.h` line 15: the URL Access prototypes are also declared for `PF_WINDOWS_PORT` (the guard was
|
||||||
|
`__LP64__`, "the SDK no longer declares them").
|
||||||
|
- `.gitignore`: `/port/build*/`.
|
||||||
|
|
||||||
|
## Needed changes in game files
|
||||||
|
|
||||||
|
None. All 40-odd `port/game/*.cpp` compile unchanged (checked with the build at HEAD `b08fb8e`).
|
||||||
|
|
||||||
|
## Known risks (found by reading; check against the running build)
|
||||||
|
|
||||||
|
- **Aux buffers.** The game draws render targets into `GL_AUX0` (`glDrawBuffer`) and asks for 2 aux buffers; current Windows
|
||||||
|
drivers (NVIDIA/AMD/Intel) usually expose none. If `glDrawBuffer(GL_AUX0)` fails the capture-texture/render-target paths
|
||||||
|
need a Windows-only fallback (FBO) in the platform layer; the game's GL calls cannot be changed.
|
||||||
|
- **Struct alignment.** Darwin i386 aligns `double`/`long long` struct members to 4 bytes; i686 Windows aligns them to 8. Port code
|
||||||
|
that reads raw file/network bytes into structs with 8-byte members must be checked (the arm64 Mac build already differs
|
||||||
|
the same way).
|
||||||
|
- `wchar_t` is 16 bit on Windows (32 on the Mac); the Lua wstring support uses its own 16-bit `lua_WChar`, the rest of the
|
||||||
|
engine mostly does not use `wchar_t`.
|
||||||
|
- GL context sharing, vsync and window activation timing are written but unproven; `ShowCursor` counting follows the
|
||||||
|
game's Hide/Show pairs.
|
||||||
|
- Game data is not in the repo: copy the game's `Resources` folder to `port/build-win/bin/Resources` and add `bundle.txt`
|
||||||
|
(`CFBundleName=`, `CFBundleVersion=`) next to the exe. There is no fetch script. Crash rvas: `tools/port/sym.sh`.
|
||||||
|
- One-command check: `bash tools/port/check_all.sh`.
|
||||||
|
- A Windows warning-free build was not attempted (`-w` like the Mac build); `-Wall` review is a later cleanup.
|
||||||
|
|
||||||
|
## Screens verified (scripted, `tools/port/smoke_win.ps1`, scenarios in `tools/port/smoke/`)
|
||||||
|
|
||||||
|
Run with `-Dev` (sets `CHOC3_DEV=1`, the game's own cheat menu) and `CHOC3_LUACMD` steps (`lua,<code>` through `DoLuaString`). Real mouse/keyboard input is blocked in test mode; the script posts window messages only. Readiness comes from `load <script>.lua` lines and `hb` heartbeat lines in `choc3port.log`.
|
||||||
|
|
||||||
|
| Screen | Verdict |
|
||||||
|
|---|---|
|
||||||
|
| Main menu, options, credits, high scores, change player, help | renders, closes |
|
||||||
|
| Map, travel Zurich -> Tangiers (date and money update), port views | renders, plays |
|
||||||
|
| Chocolate factory mini game (start, countdown, play, pause, game over) | renders, plays, ~80 fps |
|
||||||
|
| Coffee factory mini game (product c04) | renders, plays, pause works |
|
||||||
|
| Market, buy/sell dialog, shop | open and close |
|
||||||
|
| Inventory, medals, quest log, pause window, main menu from pause | open and close |
|
||||||
|
| Recipe designer (`ui_kitchen`), sign editor (`sign_basic`, needs `Player.sign`, which the shipped Lua never sets), slot select | render |
|
||||||
|
| Save and quit (exit code 0), reload (marker and money restored) | works |
|
||||||
|
| Haggle dialog, Flash intro | not reached / out of scope |
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 33 KiB |
1
engine/.gitignore
vendored
1
engine/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
build/
|
|
||||||
|
|
@ -1,245 +0,0 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
|
||||||
project(choco_engine C CXX)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
add_compile_options(/W3 /utf-8)
|
|
||||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ---- Lua 5.0.2 with Playground/Chocolatier patches ----
|
|
||||||
set(LUA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lua-5.0.2)
|
|
||||||
file(GLOB LUA_CORE_SRC ${LUA_DIR}/src/*.c)
|
|
||||||
list(FILTER LUA_CORE_SRC EXCLUDE REGEX "ltests\\.c$")
|
|
||||||
set(LUA_LIB_SRC ${LUA_DIR}/src/lib/lauxlib.c ${LUA_DIR}/src/lib/lbaselib.c
|
|
||||||
${LUA_DIR}/src/lib/ldblib.c ${LUA_DIR}/src/lib/liolib.c
|
|
||||||
${LUA_DIR}/src/lib/lmathlib.c ${LUA_DIR}/src/lib/lstrlib.c
|
|
||||||
${LUA_DIR}/src/lib/ltablib.c)
|
|
||||||
add_library(lua50 STATIC ${LUA_CORE_SRC} ${LUA_LIB_SRC})
|
|
||||||
target_compile_definitions(lua50 PRIVATE LUA_OPNAMES)
|
|
||||||
target_include_directories(lua50 PUBLIC ${LUA_DIR}/include PRIVATE ${LUA_DIR}/src)
|
|
||||||
if(MSVC)
|
|
||||||
target_compile_options(lua50 PRIVATE /wd4244 /wd4267 /wd4996 /wd4018 /wd4146)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_executable(luac50 ${LUA_DIR}/src/luac/luac.c ${LUA_DIR}/src/luac/print.c)
|
|
||||||
target_include_directories(luac50 PRIVATE ${LUA_DIR}/src ${LUA_DIR}/include)
|
|
||||||
target_link_libraries(luac50 PRIVATE lua50)
|
|
||||||
if(MSVC)
|
|
||||||
target_compile_options(luac50 PRIVATE /wd4244 /wd4267 /wd4996)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ---- core ----
|
|
||||||
add_library(core STATIC core/inflate.cpp core/pfp.cpp core/zxml.cpp core/vfs.cpp core/string_table.cpp core/save_snapshot.cpp)
|
|
||||||
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
||||||
# ---- CLI ----
|
|
||||||
add_executable(choco-cli cli/main.cpp)
|
|
||||||
target_link_libraries(choco-cli PRIVATE core lua50)
|
|
||||||
|
|
||||||
# ---- test inputs (always set before GUI test targets) ----
|
|
||||||
enable_testing()
|
|
||||||
set(CHOCO_REFERENCE_DIR "" CACHE PATH "Optional reference extraction dir (contains assets_out)")
|
|
||||||
# Game data is not part of this repository. Copy it from your own copy of the game (see README.md).
|
|
||||||
set(CHOCO_GAME_ASSETS "${CMAKE_CURRENT_SOURCE_DIR}/../game_choc3/assets" CACHE PATH "Chocolatier 3 asset directory (assets.pfp, strings.xml, cadi/)")
|
|
||||||
set(CHOCO_LUA_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../choc3/lua_source" CACHE PATH "plaintext choc3 lua sources")
|
|
||||||
set(CHOCO_BUNDLED_PFP "${CHOCO_GAME_ASSETS}/assets.pfp")
|
|
||||||
set(CHOCO_STRINGS_XML "${CHOCO_GAME_ASSETS}/strings.xml")
|
|
||||||
if(EXISTS "${CHOCO_BUNDLED_PFP}" AND EXISTS "${CHOCO_STRINGS_XML}" AND EXISTS "${CHOCO_LUA_SRC}/ui/mainmenu.lua")
|
|
||||||
set(CHOCO_HAVE_GAME_DATA ON)
|
|
||||||
else()
|
|
||||||
set(CHOCO_HAVE_GAME_DATA OFF)
|
|
||||||
message(STATUS "Chocolatier 3 game data not found; game-data tests and asset copying are skipped")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ---- M1 graphics preview and reusable 2D renderer ----
|
|
||||||
option(CHOCO_BUILD_GUI "Build SDL3 graphics layer and preview" ON)
|
|
||||||
option(CHOCO_USE_SYSTEM_SDL "Use installed SDL packages instead of bundled sources" OFF)
|
|
||||||
if(CHOCO_BUILD_GUI)
|
|
||||||
if(CHOCO_USE_SYSTEM_SDL)
|
|
||||||
find_package(SDL3 3.4.16 REQUIRED CONFIG)
|
|
||||||
find_package(SDL3_ttf 3.2.2 REQUIRED CONFIG)
|
|
||||||
find_package(SDL3_image 3.4.6 REQUIRED CONFIG)
|
|
||||||
else()
|
|
||||||
set(SDL_TEST_LIBRARY OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDL_TESTS OFF CACHE BOOL "" FORCE)
|
|
||||||
add_subdirectory(third_party/SDL3)
|
|
||||||
set(SDLTTF_VENDORED ON CACHE BOOL "" FORCE)
|
|
||||||
set(SDLTTF_HARFBUZZ OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLTTF_PLUTOSVG OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLTTF_SAMPLES OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLTTF_TESTS OFF CACHE BOOL "" FORCE)
|
|
||||||
add_subdirectory(third_party/SDL3_ttf)
|
|
||||||
set(SDLIMAGE_VENDORED OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_BACKEND_STB ON CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_BACKEND_WIC OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_PNG_LIBPNG OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_AVIF OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_WEBP OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_TIF OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_SAMPLES OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDLIMAGE_TESTS OFF CACHE BOOL "" FORCE)
|
|
||||||
add_subdirectory(third_party/SDL3_image)
|
|
||||||
endif()
|
|
||||||
add_library(choco_gfx STATIC platform/display.cpp gfx/draw.cpp gfx/character.cpp)
|
|
||||||
target_include_directories(choco_gfx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(choco_gfx PUBLIC core SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image)
|
|
||||||
add_library(choco_audio STATIC audio/audio.cpp audio/cadi_bank.cpp third_party/stb/stb_vorbis.c)
|
|
||||||
target_include_directories(choco_audio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_compile_definitions(choco_audio PRIVATE STB_VORBIS_NO_STDIO)
|
|
||||||
target_link_libraries(choco_audio PUBLIC core SDL3::SDL3)
|
|
||||||
add_executable(test_audio tests/test_audio.cpp)
|
|
||||||
target_link_libraries(test_audio PRIVATE choco_audio)
|
|
||||||
target_compile_definitions(test_audio PRIVATE CHOCO_PFP="${CHOCO_BUNDLED_PFP}"
|
|
||||||
CHOCO_ASSET_DIR="${CHOCO_GAME_ASSETS}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME audio COMMAND test_audio)
|
|
||||||
endif()
|
|
||||||
add_executable(test_cadi_bank tests/test_cadi_bank.cpp)
|
|
||||||
target_link_libraries(test_cadi_bank PRIVATE choco_audio)
|
|
||||||
target_compile_definitions(test_cadi_bank PRIVATE
|
|
||||||
CHOCO_CAD="${CHOCO_GAME_ASSETS}/cadi/CADI_Choc3_Adam FINAL.CAD")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME cadi_bank COMMAND test_cadi_bank)
|
|
||||||
endif()
|
|
||||||
add_executable(choco-preview demo/main.cpp)
|
|
||||||
target_link_libraries(choco-preview PRIVATE choco_gfx)
|
|
||||||
add_library(choco_ui STATIC ui/menu.cpp ui/controls.cpp ui/shop_ui.cpp ui/market_ui.cpp ui/casino_ui.cpp)
|
|
||||||
target_include_directories(choco_ui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(choco_ui PUBLIC lua50 core)
|
|
||||||
add_executable(choco3 ../game_choc3/main.cpp)
|
|
||||||
target_link_libraries(choco3 PRIVATE choco_ui choco_gfx choco_sim choco_audio)
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_custom_command(TARGET choco3 POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
||||||
"${CHOCO_GAME_ASSETS}" "$<TARGET_FILE_DIR:choco3>/assets"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
||||||
"${CHOCO_LUA_SRC}" "$<TARGET_FILE_DIR:choco3>/lua"
|
|
||||||
COMMENT "Copy local Chocolatier 3 assets and Lua next to choco3")
|
|
||||||
endif()
|
|
||||||
add_custom_command(TARGET choco3 POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:choco3>/fonts"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/fonts/LibreBaskerville.ttf"
|
|
||||||
"$<TARGET_FILE_DIR:choco3>/fonts/LibreBaskerville.ttf"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/fonts/OFL.txt"
|
|
||||||
"$<TARGET_FILE_DIR:choco3>/fonts/OFL.txt"
|
|
||||||
COMMENT "Copy fallback font next to choco3")
|
|
||||||
add_executable(test_gfx tests/test_gfx.cpp)
|
|
||||||
target_link_libraries(test_gfx PRIVATE choco_gfx)
|
|
||||||
target_compile_definitions(test_gfx PRIVATE CHOCO_PFP="${CHOCO_BUNDLED_PFP}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME gfx COMMAND test_gfx)
|
|
||||||
endif()
|
|
||||||
add_executable(test_shop_ui tests/test_shop_ui.cpp)
|
|
||||||
target_link_libraries(test_shop_ui PRIVATE choco_ui choco_sim)
|
|
||||||
target_compile_definitions(test_shop_ui PRIVATE CHOCO_PFP="${CHOCO_BUNDLED_PFP}"
|
|
||||||
CHOCO_LUA_SRC="${CHOCO_LUA_SRC}"
|
|
||||||
CHOCO_STRINGS="${CHOCO_STRINGS_XML}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME shop_ui COMMAND test_shop_ui)
|
|
||||||
endif()
|
|
||||||
add_executable(test_casino_ui tests/test_casino_ui.cpp)
|
|
||||||
target_link_libraries(test_casino_ui PRIVATE choco_ui choco_sim)
|
|
||||||
target_compile_definitions(test_casino_ui PRIVATE CHOCO_PFP="${CHOCO_BUNDLED_PFP}"
|
|
||||||
CHOCO_LUA_SRC="${CHOCO_LUA_SRC}"
|
|
||||||
CHOCO_STRINGS="${CHOCO_STRINGS_XML}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME casino_ui COMMAND test_casino_ui)
|
|
||||||
endif()
|
|
||||||
add_executable(test_character tests/test_character.cpp)
|
|
||||||
target_link_libraries(test_character PRIVATE choco_gfx)
|
|
||||||
target_compile_definitions(test_character PRIVATE CHOCO_PFP="${CHOCO_BUNDLED_PFP}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME character COMMAND test_character)
|
|
||||||
endif()
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME menu COMMAND choco3 --probe)
|
|
||||||
add_test(NAME game_ui COMMAND choco3 --probe-ui)
|
|
||||||
add_test(NAME game_ui_recipes_lua COMMAND choco3 --probe-recipes-lua)
|
|
||||||
add_test(NAME game_ui_quest_lua COMMAND choco3 --probe-quest-lua)
|
|
||||||
add_test(NAME game_ui_inventory_lua COMMAND choco3 --probe-inventory-lua)
|
|
||||||
add_test(NAME game_ui_chocolate_lua COMMAND choco3 --probe-chocolate-lua)
|
|
||||||
add_test(NAME game_ui_chocolate_play COMMAND choco3 --probe-chocolate-play)
|
|
||||||
add_test(NAME game_ui_coffee_lua COMMAND choco3 --probe-coffee-lua)
|
|
||||||
add_test(NAME game_ui_building_dispatch COMMAND choco3 --probe-building-dispatch)
|
|
||||||
add_test(NAME game_ui_kitchen_lua COMMAND choco3 --probe-kitchen-lua)
|
|
||||||
add_test(NAME game_ui_questlog_lua COMMAND choco3 --probe-questlog-lua)
|
|
||||||
add_test(NAME game_ui_pending_dialog_lua COMMAND choco3 --probe-pending-dialog-lua)
|
|
||||||
add_test(NAME game_ui_choice_dialogs COMMAND choco3 --probe-choice-dialogs)
|
|
||||||
add_test(NAME game_ui_later_factories COMMAND choco3 --probe-later-factories)
|
|
||||||
add_test(NAME game_ui_chocolate_effects COMMAND choco3 --probe-chocolate-effects)
|
|
||||||
add_test(NAME game_ui_market_lua COMMAND choco3 --probe-market-lua)
|
|
||||||
add_test(NAME game_ui_pause_lua COMMAND choco3 --probe-pause-lua)
|
|
||||||
add_test(NAME game_ui_casino_lua COMMAND choco3 --probe-casino-lua)
|
|
||||||
add_test(NAME game_ui_audio_events COMMAND choco3 --probe-audio-events)
|
|
||||||
add_test(NAME game_ui_save COMMAND choco3 --probe-save-ui)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ---- tests ----
|
|
||||||
add_library(choco_minigame STATIC minigame/chocolate.cpp minigame/coffee.cpp)
|
|
||||||
target_include_directories(choco_minigame PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
if(TARGET choco3)
|
|
||||||
target_link_libraries(choco3 PRIVATE choco_minigame)
|
|
||||||
endif()
|
|
||||||
add_executable(test_chocolate tests/test_chocolate.cpp)
|
|
||||||
target_link_libraries(test_chocolate PRIVATE choco_minigame)
|
|
||||||
add_test(NAME chocolate COMMAND test_chocolate)
|
|
||||||
add_executable(test_coffee tests/test_coffee.cpp)
|
|
||||||
target_link_libraries(test_coffee PRIVATE choco_minigame)
|
|
||||||
add_test(NAME coffee COMMAND test_coffee)
|
|
||||||
add_executable(test_controls tests/test_controls.cpp ui/controls.cpp)
|
|
||||||
target_include_directories(test_controls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
add_test(NAME controls COMMAND test_controls)
|
|
||||||
|
|
||||||
add_executable(test_core tests/test_core.cpp)
|
|
||||||
target_link_libraries(test_core PRIVATE core)
|
|
||||||
add_executable(test_strings tests/test_strings.cpp)
|
|
||||||
target_link_libraries(test_strings PRIVATE core)
|
|
||||||
target_compile_definitions(test_strings PRIVATE
|
|
||||||
CHOCO_STRINGS="${CHOCO_STRINGS_XML}"
|
|
||||||
CHOCO_PFP="${CHOCO_BUNDLED_PFP}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME strings COMMAND test_strings)
|
|
||||||
endif()
|
|
||||||
add_executable(test_save_snapshot tests/test_save_snapshot.cpp)
|
|
||||||
target_link_libraries(test_save_snapshot PRIVATE core)
|
|
||||||
add_test(NAME save_snapshot COMMAND test_save_snapshot)
|
|
||||||
add_executable(test_vm tests/test_vm.cpp)
|
|
||||||
target_link_libraries(test_vm PRIVATE core lua50)
|
|
||||||
add_library(choco_sim STATIC sim/game_sim.cpp)
|
|
||||||
target_include_directories(choco_sim PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(choco_sim PUBLIC core lua50)
|
|
||||||
add_executable(test_sim tests/test_sim.cpp)
|
|
||||||
target_link_libraries(test_sim PRIVATE choco_sim)
|
|
||||||
target_compile_definitions(test_sim PRIVATE CHOCO_PFP="${CHOCO_BUNDLED_PFP}" CHOCO_LUA_SRC="${CHOCO_LUA_SRC}"
|
|
||||||
CHOCO_STRINGS="${CHOCO_STRINGS_XML}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME sim COMMAND test_sim)
|
|
||||||
endif()
|
|
||||||
add_executable(test_campaign_controlled tests/test_sim.cpp)
|
|
||||||
target_link_libraries(test_campaign_controlled PRIVATE choco_sim)
|
|
||||||
target_compile_definitions(test_campaign_controlled PRIVATE CHOCO_CAMPAIGN_CONTROLLED
|
|
||||||
CHOCO_PFP="${CHOCO_BUNDLED_PFP}" CHOCO_LUA_SRC="${CHOCO_LUA_SRC}"
|
|
||||||
CHOCO_STRINGS="${CHOCO_STRINGS_XML}")
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME campaign_controlled COMMAND test_campaign_controlled)
|
|
||||||
endif()
|
|
||||||
foreach(t test_core test_vm)
|
|
||||||
target_compile_definitions(${t} PRIVATE
|
|
||||||
CHOCO_RE_DIR="${CHOCO_REFERENCE_DIR}" CHOCO_PFP="${CHOCO_BUNDLED_PFP}"
|
|
||||||
CHOCO_LUA_SRC="${CHOCO_LUA_SRC}"
|
|
||||||
CHOCO_TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests"
|
|
||||||
CHOCO_LUAC="$<TARGET_FILE:luac50>")
|
|
||||||
endforeach()
|
|
||||||
add_dependencies(test_vm luac50)
|
|
||||||
if(CHOCO_HAVE_GAME_DATA)
|
|
||||||
add_test(NAME core COMMAND test_core)
|
|
||||||
endif()
|
|
||||||
add_test(NAME vm COMMAND test_vm)
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
# choco engine (M0 foundations, M1 graphics, M2 menu, M3 opening slice)
|
|
||||||
|
|
||||||
C++20, x64, MSVC + CMake + Ninja. Lua 5.0.2, SDL3, SDL3_image, SDL3_ttf and FreeType source trees are bundled for an offline build.
|
|
||||||
|
|
||||||
## Layout
|
|
||||||
- `third_party/lua-5.0.2` - stock Lua 5.0.2 plus our patches (see below). Built as static lib `lua50`; also `luac50` (compiler).
|
|
||||||
- `core/` - static lib `core`: PFPK reader (`pfp`), loose-directory VFS (`vfs`, used for Mac builds), ZXML decoder (`zxml`), self-written zlib inflate (`inflate`, no zlib dependency).
|
|
||||||
- `cli/main.cpp` - `choco-cli`.
|
|
||||||
- `tests/` - ctest tests (plain asserts).
|
|
||||||
- `platform/`, `gfx/` - SDL3 window, logical 800x600 letterbox coordinates, SDL_image PNG/JPEG textures from VFS, and MVC4 `.mvec` font rendering.
|
|
||||||
- `demo/main.cpp` - stand-alone graphics preview of the Chocolatier 3 main-menu art.
|
|
||||||
- `sim/` - original Lua simulation loaded by `GameSim` for the opening Zurich market interaction.
|
|
||||||
|
|
||||||
## Build and test
|
|
||||||
build.bat (Release; run from an x64 MSVC Developer Prompt with CMake and Ninja on PATH)
|
|
||||||
build.bat Debug
|
|
||||||
build.bat Release noTest
|
|
||||||
|
|
||||||
Outputs in `build/bin`: `choco-cli.exe`, `luac50.exe`, `choco-preview.exe`, `choco3.exe`, and tests.
|
|
||||||
The default GUI build uses local SDL3 3.4.16, SDL3_image 3.4.6, SDL3_ttf 3.2.2 and FreeType 2.13.2 sources. Pass `-DCHOCO_USE_SYSTEM_SDL=ON` to use installed SDL packages, or `-DCHOCO_BUILD_GUI=OFF` for the CLI-only build.
|
|
||||||
Game data is not included. The build looks for `game_choc3/assets` (`assets.pfp`, `strings.xml`, `cadi/`) and `choc3/lua_source` in this workspace; override them with `-DCHOCO_GAME_ASSETS=...` and `-DCHOCO_LUA_SRC=...`. When they are present, CMake copies them with the font files into `build/bin` beside `choco3.exe` and enables the game-data tests; otherwise those tests are skipped. An optional extracted reference tree for the core comparison test can be supplied as `-DCHOCO_REFERENCE_DIR=...`.
|
|
||||||
|
|
||||||
## choco-cli
|
|
||||||
choco-cli ls <assets.pfp|dir>
|
|
||||||
choco-cli cat <assets.pfp|dir> <path> # ZXML auto-decoded, bytes to stdout
|
|
||||||
choco-cli lua <file.lua|file.luac> [args] # standard Lua 5.0 libs, no game API yet
|
|
||||||
|
|
||||||
## Graphics preview
|
|
||||||
build\bin\choco-preview.exe "..\game_choc3\assets\assets.pfp"
|
|
||||||
|
|
||||||
The preview draws the main-menu art. Escape closes the window.
|
|
||||||
|
|
||||||
## Lua patches (vs stock 5.0.2)
|
|
||||||
- Bytecode: size_t is 4 bytes on dump/undump (header `1b 4c 75 61 50 01 04 04 04 06 08 ...`), so x64 builds read the game's 32-bit-era files.
|
|
||||||
- Opcode table matches the game: `AND`=16, `OR`=17, `SHL`=18, `SHR`=19 inserted after `DIV`; `POW` and everything after shifted by +4.
|
|
||||||
Operands must be numbers (else arithmetic error), are clamped to uint32 (<0 -> 0, >=2^32 -> 0xFFFFFFFF), result is a double.
|
|
||||||
Shift counts >= 32 give 0 (assumption, original behaviour unverified).
|
|
||||||
- Our compiler emits these via new operators `&`, `|`, `<<`, `>>` (precedence like C: `|` < `&` < shifts < `..` < `+ -`, all above comparisons). Original sources do not use them.
|
|
||||||
- `continue` keyword (while/repeat/for), `lauxlib` opens files in binary mode.
|
|
||||||
- `ltable.c`: `computesizes` is compiled with optimisation off under MSVC (the 14.5x /O2 codegen crashes on x64).
|
|
||||||
|
|
||||||
## Main menu (M2)
|
|
||||||
|
|
||||||
build\bin\choco3.exe
|
|
||||||
|
|
||||||
`choco3` reads `assets/assets.pfp` and `lua/ui/mainmenu.lua` next to its executable, so launching it does not require Steam or a working directory. Optional asset and Lua paths remain available as command-line overrides for development. Mouse hover, press, and click drive the original button callbacks. The canvas remains 800×600 with letterboxing. Escape closes an open dialog.
|
|
||||||
|
|
||||||
The adapted new-game path uses `GameSim::newGame(name, error, startingCash)` with a configurable default of 1000. The original tutorial starts at zero and awards money through quests; this opening balance makes the early market interaction usable. The simulation implements the original `Mod(a,b)` binding as the integer quotient of `a/b`, as documented in `choc3/cpp_bindings/NOTES.md`.
|
|
||||||
|
|
||||||
Text uses each Lua node's font, size, color, outline, and alignment. The game's `fonts/fertigo.mvec` is rendered directly; a bundled Libre Baskerville font is the fallback for unsupported fonts. The original general string table is read from `assets/strings.xml`; `StringTable` parses it and quest overlays. UI bindings are being migrated from explicit English mappings to these strings.
|
|
||||||
|
|
||||||
The current Lua UI surface implements `MakeDialog` for nested window tables and `DoWindow` for adding a node at runtime. Constructors cover `Window`, `Bitmap`, `Text`, `Button`, `Rollover`, and `Slider`. `Rollover` uses shared hover/press/click state; `Slider` supports pointer dragging and stepped values. `--probe` exercises both constructors through `DoWindow` as well as menu callbacks. This is the M2 subset of Playground's larger UI API.
|
|
||||||
|
|
||||||
`--probe` checks the menu structure, modal navigation, player name input, and button callbacks without a window. `--smoke` loads key menu textures, renders two frames, and exits; it can run with SDL's dummy video driver.
|
|
||||||
|
|
||||||
Options, Help, High Scores, Enter Name, and Change Player load their original Lua window definitions and original popup art. Options sliders and fullscreen work in this session; audio playback and persistent settings await later milestones. Help text is adapted where the original localization is unavailable, and CADI character art is not rendered yet. High Scores has no game data yet. Player names can be created and renamed for the current session. Story Mode enters Zurich, can open the map and market, and can buy ingredients through the original Lua simulation. Sound hooks remain temporary stubs. These commands do not run the original executable or installer.
|
|
||||||
|
|
||||||
## Opening game slice (M3, in progress)
|
|
||||||
|
|
||||||
The first playable path is main menu → player name → Zurich port → market → purchase register → ingredient purchase → port/map. The simulation loads the original Lua data and game rules, including 60 ingredients, 72 products, 20 ports, and quest definitions. The Zurich market uses original window art, merchant portrait, ingredient icons, and ledger assets. `--probe-game` checks the Lua simulation and purchase state; `--probe-ui` checks the screen flow and purchase action. These checks do not establish that later travel, factory, quest, save, audio, or CADI character flows are complete.
|
|
||||||
|
|
||||||
See `../docs/IMPLEMENTATION_STATUS.md` for the full campaign gap list.
|
|
||||||
|
|
@ -1,147 +0,0 @@
|
||||||
#include "audio/audio.h"
|
|
||||||
#include "audio/cadi_bank.h"
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
extern "C" int stb_vorbis_decode_memory(const unsigned char* mem, int len,
|
|
||||||
int* channels, int* sample_rate, short** output);
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
bool fail(std::string* error, std::string message) {
|
|
||||||
if (error) *error = std::move(message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool decodeOgg(std::span<const uint8_t> bytes, DecodedSound& sound, std::string* error) {
|
|
||||||
constexpr size_t maxCompressed = 8 * 1024 * 1024;
|
|
||||||
constexpr size_t maxSamples = 32 * 1024 * 1024;
|
|
||||||
if (bytes.size() < 4 || !std::equal(bytes.begin(), bytes.begin()+4, "OggS"))
|
|
||||||
return fail(error, "not an Ogg stream");
|
|
||||||
if (bytes.size() > maxCompressed || bytes.size() > size_t(std::numeric_limits<int>::max()))
|
|
||||||
return fail(error, "Ogg stream exceeds size limit");
|
|
||||||
int channels = 0, rate = 0;
|
|
||||||
short* decoded = nullptr;
|
|
||||||
const int frames = stb_vorbis_decode_memory(bytes.data(), int(bytes.size()),
|
|
||||||
&channels, &rate, &decoded);
|
|
||||||
if (frames <= 0 || !decoded || channels < 1 || channels > 2 || rate < 8000 || rate > 192000 ||
|
|
||||||
size_t(frames) > maxSamples / size_t(std::max(channels, 1))) {
|
|
||||||
std::free(decoded);
|
|
||||||
return fail(error, "invalid or oversized Ogg Vorbis stream");
|
|
||||||
}
|
|
||||||
DecodedSound result;
|
|
||||||
result.channels = channels;
|
|
||||||
result.sampleRate = rate;
|
|
||||||
result.samples.assign(decoded, decoded + size_t(frames) * size_t(channels));
|
|
||||||
std::free(decoded);
|
|
||||||
sound = std::move(result);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Audio::~Audio() {
|
|
||||||
stop();
|
|
||||||
if (initialized_) SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::stop() {
|
|
||||||
stopLane(music_); stopLane(sfx_); stopLane(environment_);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Audio::active() const { return musicActive() || sfxActive() || environmentActive(); }
|
|
||||||
|
|
||||||
void Audio::stopLane(Lane& lane) {
|
|
||||||
if (lane.stream) { SDL_DestroyAudioStream(lane.stream); lane.stream=nullptr; }
|
|
||||||
lane.pcm.clear(); lane.loop=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::feedLoop(void* userdata, SDL_AudioStream* stream, int additional, int) {
|
|
||||||
auto& lane=*static_cast<Lane*>(userdata);
|
|
||||||
if (!lane.loop || lane.pcm.empty() || additional<=0) return;
|
|
||||||
const size_t bytes=lane.pcm.size()*sizeof(int16_t);
|
|
||||||
const auto* pcm=reinterpret_cast<const uint8_t*>(lane.pcm.data());
|
|
||||||
// SDL asks for a bounded amount; repeat the decoded clip without gaps.
|
|
||||||
size_t remaining=std::min<size_t>(size_t(additional),1024*1024);
|
|
||||||
while (remaining) {
|
|
||||||
const int chunk=int(std::min(remaining,bytes));
|
|
||||||
if (!SDL_PutAudioStreamData(stream,pcm,chunk)) break;
|
|
||||||
remaining-=size_t(chunk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Audio::playAsset(std::string_view path, std::string* error) {
|
|
||||||
Bytes bytes;
|
|
||||||
if (!assets_.read(std::string(path), bytes) &&
|
|
||||||
(!looseAssets_ || !looseAssets_->read(std::string(path), bytes)))
|
|
||||||
return fail(error, "sound asset missing: " + std::string(path));
|
|
||||||
return playEncoded(bytes, sfx_, false, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Audio::playEncoded(std::span<const uint8_t> bytes, Lane& lane, bool loop, std::string* error) {
|
|
||||||
DecodedSound decoded;
|
|
||||||
if (!decodeOgg(bytes, decoded, error)) return false;
|
|
||||||
if (!initialized_) {
|
|
||||||
if (!SDL_InitSubSystem(SDL_INIT_AUDIO)) return fail(error, SDL_GetError());
|
|
||||||
initialized_ = true;
|
|
||||||
}
|
|
||||||
const SDL_AudioSpec spec{SDL_AUDIO_S16, decoded.channels, decoded.sampleRate};
|
|
||||||
stopLane(lane);
|
|
||||||
lane.pcm=std::move(decoded.samples);
|
|
||||||
lane.loop=loop;
|
|
||||||
lane.stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec,
|
|
||||||
loop ? &Audio::feedLoop : nullptr,loop ? &lane : nullptr);
|
|
||||||
if (!lane.stream) { lane.pcm.clear(); return fail(error, SDL_GetError()); }
|
|
||||||
const auto byteCount = lane.pcm.size() * sizeof(int16_t);
|
|
||||||
if (byteCount > size_t(std::numeric_limits<int>::max()) ||
|
|
||||||
!SDL_PutAudioStreamData(lane.stream, lane.pcm.data(), int(byteCount)) ||
|
|
||||||
!SDL_ResumeAudioStreamDevice(lane.stream)) {
|
|
||||||
const std::string cause = SDL_GetError();
|
|
||||||
stopLane(lane);
|
|
||||||
return fail(error, cause);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Audio::playEvent(std::string_view event, std::string* error) {
|
|
||||||
if (event.empty() || event.find('/') != std::string_view::npos ||
|
|
||||||
event.find('\\') != std::string_view::npos || event.find("..") != std::string_view::npos)
|
|
||||||
return fail(error, "invalid sound event");
|
|
||||||
if (event=="Stop_Music") { stopLane(music_); return true; }
|
|
||||||
if (event=="Stop_Environments") { stopLane(environment_); return true; }
|
|
||||||
if (event=="Stop_Sfx") { stopLane(sfx_); return true; }
|
|
||||||
if (event=="Stop_travel_plane") {
|
|
||||||
// The source travel sequence stops this cue before the destination sting.
|
|
||||||
if (bank_) {
|
|
||||||
if (auto info=bank_->eventInfo("travel_plane")) {
|
|
||||||
stopLane(info->channel==CadiChannel::Music?music_:
|
|
||||||
info->channel==CadiChannel::Environment?environment_:sfx_);
|
|
||||||
}
|
|
||||||
} else stopLane(sfx_);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (event.starts_with("Stop_")) return fail(error,"unknown stop event");
|
|
||||||
const std::string path = event == "ui_click" ? "cadi/ui_click.ogg" :
|
|
||||||
"sfx/" + std::string(event) + ".ogg";
|
|
||||||
if (assets_.exists(path) || (looseAssets_ && looseAssets_->exists(path)))
|
|
||||||
return playAsset(path, error);
|
|
||||||
if (looseAssets_ && !bankAttempted_) {
|
|
||||||
bankAttempted_ = true;
|
|
||||||
Bytes data;
|
|
||||||
if (looseAssets_->read("cadi/CADI_Choc3_Adam FINAL.CAD", data)) {
|
|
||||||
auto candidate=std::make_unique<CadiBank>();
|
|
||||||
if (candidate->load(std::move(data))) bank_=std::move(candidate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bank_) {
|
|
||||||
if (auto info=bank_->eventInfo(event); info && info->clips.size()==1) {
|
|
||||||
Lane& lane=info->channel==CadiChannel::Music?music_:
|
|
||||||
info->channel==CadiChannel::Environment?environment_:sfx_;
|
|
||||||
return playEncoded(bank_->data(info->clips.front()),lane,info->loop,error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fail(error,"sound event unavailable: "+std::string(event));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "audio/cadi_bank.h"
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include <cstdint>
|
|
||||||
#include <memory>
|
|
||||||
#include <span>
|
|
||||||
#include <string>
|
|
||||||
#include <string_view>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
struct SDL_AudioStream;
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
struct DecodedSound {
|
|
||||||
int channels = 0;
|
|
||||||
int sampleRate = 0;
|
|
||||||
std::vector<int16_t> samples; // interleaved signed 16-bit PCM
|
|
||||||
};
|
|
||||||
|
|
||||||
// The bundled sound files are Ogg Vorbis. Decode without needing an audio device.
|
|
||||||
bool decodeOgg(std::span<const uint8_t> bytes, DecodedSound& sound,
|
|
||||||
std::string* error = nullptr);
|
|
||||||
|
|
||||||
// Independent playback lanes let music continue while sound effects play.
|
|
||||||
class Audio {
|
|
||||||
public:
|
|
||||||
explicit Audio(const Vfs& assets, const Vfs* looseAssets = nullptr)
|
|
||||||
: assets_(assets), looseAssets_(looseAssets) {}
|
|
||||||
~Audio();
|
|
||||||
Audio(const Audio&) = delete;
|
|
||||||
Audio& operator=(const Audio&) = delete;
|
|
||||||
|
|
||||||
bool playAsset(std::string_view path, std::string* error = nullptr);
|
|
||||||
bool playEvent(std::string_view event, std::string* error = nullptr);
|
|
||||||
void stop();
|
|
||||||
bool active() const;
|
|
||||||
bool musicActive() const { return music_.stream != nullptr; }
|
|
||||||
bool sfxActive() const { return sfx_.stream != nullptr; }
|
|
||||||
bool environmentActive() const { return environment_.stream != nullptr; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
struct Lane {
|
|
||||||
SDL_AudioStream* stream = nullptr;
|
|
||||||
std::vector<int16_t> pcm;
|
|
||||||
bool loop = false;
|
|
||||||
};
|
|
||||||
bool playEncoded(std::span<const uint8_t> bytes, Lane& lane, bool loop, std::string* error);
|
|
||||||
static void feedLoop(void* userdata, SDL_AudioStream* stream, int additional, int total);
|
|
||||||
static void stopLane(Lane& lane);
|
|
||||||
const Vfs& assets_;
|
|
||||||
const Vfs* looseAssets_ = nullptr;
|
|
||||||
std::unique_ptr<CadiBank> bank_;
|
|
||||||
bool bankAttempted_ = false;
|
|
||||||
Lane music_, sfx_, environment_;
|
|
||||||
bool initialized_ = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,232 +0,0 @@
|
||||||
#include "audio/cadi_bank.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <charconv>
|
|
||||||
#include <cstring>
|
|
||||||
#include <limits>
|
|
||||||
#include <unordered_set>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
uint32_t le32(const Bytes& bytes, size_t offset) {
|
|
||||||
return uint32_t(bytes[offset]) | (uint32_t(bytes[offset+1]) << 8) |
|
|
||||||
(uint32_t(bytes[offset+2]) << 16) | (uint32_t(bytes[offset+3]) << 24);
|
|
||||||
}
|
|
||||||
bool fail(std::string* error, const char* message) {
|
|
||||||
if (error) *error = message;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uint64_t le64(std::span<const uint8_t> bytes, size_t pos) {
|
|
||||||
uint64_t value=0;
|
|
||||||
for(int i=0;i<8;++i) value|=uint64_t(bytes[pos+i])<<(8*i);
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
std::optional<uint64_t> oggFrames(std::span<const uint8_t> bytes) {
|
|
||||||
size_t pos=0;uint64_t last=0;bool found=false;
|
|
||||||
while(pos<bytes.size()) {
|
|
||||||
if(bytes.size()-pos<27 || std::memcmp(bytes.data()+pos,"OggS",4)!=0 || bytes[pos+4]!=0)
|
|
||||||
return std::nullopt;
|
|
||||||
const size_t segments=bytes[pos+26];
|
|
||||||
if(bytes.size()-pos<27+segments)return std::nullopt;
|
|
||||||
size_t payload=0;
|
|
||||||
for(size_t i=0;i<segments;++i)payload+=bytes[pos+27+i];
|
|
||||||
if(payload>bytes.size()-pos-27-segments)return std::nullopt;
|
|
||||||
const uint64_t granule=le64(bytes,pos+6);
|
|
||||||
if(granule!=UINT64_MAX){last=granule;found=true;}
|
|
||||||
pos+=27+segments+payload;
|
|
||||||
}
|
|
||||||
return found?std::optional<uint64_t>(last):std::nullopt;
|
|
||||||
}
|
|
||||||
std::string_view firstTag(std::string_view xml,std::string_view name) {
|
|
||||||
const std::string open="<"+std::string(name)+">";
|
|
||||||
const std::string close="</"+std::string(name)+">";
|
|
||||||
const size_t start=xml.find(open);
|
|
||||||
if(start==std::string_view::npos)return {};
|
|
||||||
const size_t content=start+open.size(),end=xml.find(close,content);
|
|
||||||
return end==std::string_view::npos?std::string_view{}:xml.substr(content,end-content);
|
|
||||||
}
|
|
||||||
std::vector<std::string> allTags(std::string_view xml,std::string_view name,size_t limit=128) {
|
|
||||||
std::vector<std::string> values;
|
|
||||||
const std::string open="<"+std::string(name)+">";
|
|
||||||
const std::string close="</"+std::string(name)+">";
|
|
||||||
size_t pos=0;
|
|
||||||
while(values.size()<limit) {
|
|
||||||
const size_t start=xml.find(open,pos);
|
|
||||||
if(start==std::string_view::npos)break;
|
|
||||||
const size_t content=start+open.size(),end=xml.find(close,content);
|
|
||||||
if(end==std::string_view::npos)break;
|
|
||||||
values.emplace_back(xml.substr(content,end-content));pos=end+close.size();
|
|
||||||
}
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
struct GraphNode {
|
|
||||||
std::string type;
|
|
||||||
std::string parent;
|
|
||||||
bool loop = false;
|
|
||||||
std::vector<std::string> links;
|
|
||||||
std::optional<uint64_t> frames;
|
|
||||||
std::string url;
|
|
||||||
};
|
|
||||||
std::unordered_map<std::string,CadiEventInfo> mapEvents(const Bytes& bytes,
|
|
||||||
const std::vector<CadiRecord>& records) {
|
|
||||||
std::string_view project;
|
|
||||||
std::string_view resourceIndex;
|
|
||||||
size_t resourceIndexRecord=records.size();
|
|
||||||
for(size_t i=0;i<records.size();++i) {
|
|
||||||
const auto& r=records[i];
|
|
||||||
const std::span<const uint8_t> payload(bytes.data()+r.offset,r.size);
|
|
||||||
if(r.kind!=CadiKind::Xml)continue;
|
|
||||||
if(r.size>=5 && std::memcmp(payload.data(),"<?xml",5)==0) {
|
|
||||||
project={reinterpret_cast<const char*>(payload.data()),payload.size()};
|
|
||||||
} else if(r.size>=4 && std::memcmp(payload.data(),"\r\n<P",4)==0) {
|
|
||||||
resourceIndex={reinterpret_cast<const char*>(payload.data()),payload.size()};
|
|
||||||
resourceIndexRecord=i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const auto keys=allTags(resourceIndex,"Key",10000);
|
|
||||||
if(project.empty() || resourceIndexRecord==records.size() || keys.size()!=records.size()-1)return {};
|
|
||||||
std::unordered_map<std::string,size_t> byUrl;
|
|
||||||
size_t recordIndex=0;
|
|
||||||
for(const auto& key:keys) {
|
|
||||||
if(recordIndex==resourceIndexRecord)++recordIndex;
|
|
||||||
if(recordIndex>=records.size() || !byUrl.emplace(key,recordIndex).second)return {};
|
|
||||||
++recordIndex;
|
|
||||||
}
|
|
||||||
std::unordered_map<std::string,GraphNode> nodes;
|
|
||||||
size_t pos=0;
|
|
||||||
while(!project.empty() && nodes.size()<5000) {
|
|
||||||
const size_t start=project.find("<PropertySet>",pos);
|
|
||||||
if(start==std::string_view::npos)break;
|
|
||||||
const size_t end=project.find("</PropertySet>",start+13);
|
|
||||||
if(end==std::string_view::npos)break;
|
|
||||||
const auto block=project.substr(start,end+14-start);
|
|
||||||
const auto name=firstTag(block,"Name"),type=firstTag(block,"PlayerType");
|
|
||||||
if(!name.empty() && name.size()<=512 && !type.empty()) {
|
|
||||||
GraphNode node;
|
|
||||||
node.type=type;
|
|
||||||
node.parent=firstTag(block,"Parent");
|
|
||||||
node.loop=firstTag(block,"ResourceLoopEnabled")=="true";
|
|
||||||
node.links=allTags(block,"ChildName");
|
|
||||||
const auto soundList=firstTag(block,"SoundList");
|
|
||||||
auto soundLinks=allTags(soundList,"String");
|
|
||||||
node.links.insert(node.links.end(),soundLinks.begin(),soundLinks.end());
|
|
||||||
if(auto resource=firstTag(block,"ResourceName");!resource.empty())
|
|
||||||
node.links.emplace_back(resource);
|
|
||||||
if(auto url=firstTag(block,"Url");!url.empty())node.url=url;
|
|
||||||
if(auto duration=firstTag(block,"ResourceEndPosition");!duration.empty()) {
|
|
||||||
uint64_t value=0;
|
|
||||||
const auto parsed=std::from_chars(duration.data(),duration.data()+duration.size(),value);
|
|
||||||
if(parsed.ec==std::errc{} && parsed.ptr==duration.data()+duration.size())node.frames=value;
|
|
||||||
}
|
|
||||||
nodes.emplace(name,std::move(node));
|
|
||||||
}
|
|
||||||
pos=end+14;
|
|
||||||
}
|
|
||||||
size_t verified=0;
|
|
||||||
for(const auto& [name,node]:nodes) {
|
|
||||||
if(node.type!="SampleResource" || node.url.empty() || !node.frames)continue;
|
|
||||||
const auto found=byUrl.find(node.url);
|
|
||||||
if(found==byUrl.end())continue;
|
|
||||||
const size_t index=found->second;
|
|
||||||
if(records[index].kind!=CadiKind::OggVorbis)continue;
|
|
||||||
const auto& rec=records[index];
|
|
||||||
const auto frames=oggFrames({bytes.data()+rec.offset,rec.size});
|
|
||||||
if(!frames || *frames!=*node.frames)return {};
|
|
||||||
++verified;
|
|
||||||
}
|
|
||||||
if(verified!=175)return {};
|
|
||||||
std::unordered_map<std::string,CadiEventInfo> mapped;
|
|
||||||
for(const auto& [event,root]:nodes) {
|
|
||||||
if(root.type!="MixerChannel" && root.type!="ArrangementClip" && root.type!="EventClip")continue;
|
|
||||||
std::vector<std::string> pending{event};
|
|
||||||
std::unordered_set<std::string> visited;
|
|
||||||
std::unordered_set<size_t> clips;
|
|
||||||
bool ambiguous=false;
|
|
||||||
while(!pending.empty() && visited.size()<5000) {
|
|
||||||
auto name=std::move(pending.back());pending.pop_back();
|
|
||||||
if(!visited.insert(name).second)continue;
|
|
||||||
auto found=nodes.find(name);
|
|
||||||
if(found==nodes.end())continue;
|
|
||||||
const auto& node=found->second;
|
|
||||||
if(node.type=="SampleResource") {
|
|
||||||
const auto clip=byUrl.find(node.url);
|
|
||||||
if(clip==byUrl.end() || records[clip->second].kind!=CadiKind::OggVorbis)
|
|
||||||
ambiguous=true;
|
|
||||||
else clips.insert(clip->second);
|
|
||||||
} else pending.insert(pending.end(),node.links.begin(),node.links.end());
|
|
||||||
}
|
|
||||||
if(!ambiguous && !clips.empty()) {
|
|
||||||
std::vector<size_t> ordered(clips.begin(),clips.end());
|
|
||||||
std::sort(ordered.begin(),ordered.end());
|
|
||||||
CadiEventInfo info;
|
|
||||||
info.clips=std::move(ordered);
|
|
||||||
info.loop=root.loop;
|
|
||||||
info.channel=root.type=="ArrangementClip"?CadiChannel::Music:
|
|
||||||
root.parent=="New Mixer 3"?CadiChannel::Environment:CadiChannel::Sfx;
|
|
||||||
mapped.emplace(event,std::move(info));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mapped;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CadiBank::load(Bytes bytes, std::string* error) {
|
|
||||||
constexpr size_t maxBankBytes = 256 * 1024 * 1024;
|
|
||||||
if (bytes.size() < 32 || bytes.size() > maxBankBytes || le32(bytes, 8) != 0xddfefdc8u)
|
|
||||||
return fail(error, "invalid CADI bank header");
|
|
||||||
const uint32_t count = le32(bytes, 12);
|
|
||||||
if (count == 0 || count > 10000 || size_t(count) > (bytes.size()-32)/16)
|
|
||||||
return fail(error, "invalid CADI record count");
|
|
||||||
const size_t tableEnd = 32 + size_t(count) * 16;
|
|
||||||
size_t expectedOffset = tableEnd;
|
|
||||||
uint32_t previousToken = 0;
|
|
||||||
std::vector<CadiRecord> found;
|
|
||||||
found.reserve(count);
|
|
||||||
for (uint32_t i=0; i<count; ++i) {
|
|
||||||
const size_t pos = 32 + size_t(i)*16;
|
|
||||||
const uint32_t token = le32(bytes, pos);
|
|
||||||
const uint32_t reserved = le32(bytes, pos+4);
|
|
||||||
const uint32_t size = le32(bytes, pos+8);
|
|
||||||
const uint32_t offset = le32(bytes, pos+12);
|
|
||||||
if (reserved != 0 || token <= previousToken || size < 4 || offset != expectedOffset ||
|
|
||||||
size_t(size) > bytes.size()-expectedOffset)
|
|
||||||
return fail(error, "invalid CADI record bounds");
|
|
||||||
CadiKind kind;
|
|
||||||
if (std::memcmp(bytes.data()+offset, "OggS", 4) == 0) kind = CadiKind::OggVorbis;
|
|
||||||
else if (std::memcmp(bytes.data()+offset, "<?xm", 4) == 0 ||
|
|
||||||
std::memcmp(bytes.data()+offset, "\r\n<P", 4) == 0) kind = CadiKind::Xml;
|
|
||||||
else return fail(error, "unknown CADI record payload");
|
|
||||||
found.push_back({token,offset,size,kind});
|
|
||||||
expectedOffset += size;
|
|
||||||
previousToken = token;
|
|
||||||
}
|
|
||||||
if (expectedOffset != bytes.size()) return fail(error, "trailing CADI data");
|
|
||||||
auto eventClips=mapEvents(bytes,found);
|
|
||||||
bytes_ = std::move(bytes);
|
|
||||||
records_ = std::move(found);
|
|
||||||
eventClips_ = std::move(eventClips);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<size_t> CadiBank::clipForEvent(std::string_view event) const {
|
|
||||||
auto found=eventClips_.find(std::string(event));
|
|
||||||
return found==eventClips_.end() || found->second.clips.size()!=1 ? std::nullopt :
|
|
||||||
std::optional<size_t>(found->second.clips.front());
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<size_t> CadiBank::clipsForEvent(std::string_view event) const {
|
|
||||||
auto found=eventClips_.find(std::string(event));
|
|
||||||
return found==eventClips_.end()?std::vector<size_t>{}:found->second.clips;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<CadiEventInfo> CadiBank::eventInfo(std::string_view event) const {
|
|
||||||
auto found=eventClips_.find(std::string(event));
|
|
||||||
return found==eventClips_.end()?std::nullopt:std::optional<CadiEventInfo>(found->second);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::span<const uint8_t> CadiBank::data(size_t index) const {
|
|
||||||
if (index >= records_.size()) return {};
|
|
||||||
const auto& record = records_[index];
|
|
||||||
return {bytes_.data()+record.offset, record.size};
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "core/inflate.h"
|
|
||||||
#include <cstdint>
|
|
||||||
#include <span>
|
|
||||||
#include <string>
|
|
||||||
#include <string_view>
|
|
||||||
#include <optional>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
enum class CadiKind { OggVorbis, Xml };
|
|
||||||
enum class CadiChannel { Sfx, Music, Environment };
|
|
||||||
struct CadiEventInfo {
|
|
||||||
std::vector<size_t> clips;
|
|
||||||
CadiChannel channel = CadiChannel::Sfx;
|
|
||||||
bool loop = false;
|
|
||||||
};
|
|
||||||
struct CadiRecord {
|
|
||||||
uint32_t token = 0; // opaque bank index value; Project URL maps through resource index order
|
|
||||||
uint32_t offset = 0;
|
|
||||||
uint32_t size = 0;
|
|
||||||
CadiKind kind = CadiKind::OggVorbis;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Read-only parser for the bundled CADI audio bank; does not execute CadiApi.dll.
|
|
||||||
class CadiBank {
|
|
||||||
public:
|
|
||||||
bool load(Bytes bytes, std::string* error = nullptr);
|
|
||||||
const std::vector<CadiRecord>& records() const { return records_; }
|
|
||||||
std::span<const uint8_t> data(size_t index) const;
|
|
||||||
std::optional<size_t> clipForEvent(std::string_view event) const;
|
|
||||||
std::vector<size_t> clipsForEvent(std::string_view event) const;
|
|
||||||
std::optional<CadiEventInfo> eventInfo(std::string_view event) const;
|
|
||||||
size_t mappedEventCount() const { return eventClips_.size(); }
|
|
||||||
private:
|
|
||||||
Bytes bytes_;
|
|
||||||
std::vector<CadiRecord> records_;
|
|
||||||
std::unordered_map<std::string,CadiEventInfo> eventClips_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
@echo off
|
|
||||||
rem Configure, build and test with tools from an x64 MSVC Developer Prompt.
|
|
||||||
setlocal
|
|
||||||
where cl >nul 2>nul || (echo MSVC cl not found. Open an x64 Developer Command Prompt. & exit /b 1)
|
|
||||||
where cmake >nul 2>nul || (echo CMake not found on PATH. Install CMake or add it to PATH. & exit /b 1)
|
|
||||||
where ninja >nul 2>nul || (echo Ninja not found on PATH. Install Ninja or add it to PATH. & exit /b 1)
|
|
||||||
where ctest >nul 2>nul || (echo CTest not found on PATH. Add the CMake bin directory to PATH. & exit /b 1)
|
|
||||||
set "CFG=%~1"
|
|
||||||
if "%CFG%"=="" set "CFG=Release"
|
|
||||||
set "SRC=%~dp0"
|
|
||||||
set "BLD=%SRC%build"
|
|
||||||
cmake -S "%SRC%." -B "%BLD%" -G Ninja -DCMAKE_BUILD_TYPE=%CFG% -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl || exit /b 1
|
|
||||||
cmake --build "%BLD%" || exit /b 1
|
|
||||||
if /i "%~2"=="noTest" exit /b 0
|
|
||||||
ctest --test-dir "%BLD%" --output-on-failure
|
|
||||||
exit /b %errorlevel%
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
// choco-cli: inspect installations and run Lua scripts/bytecode in the patched VM.
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstring>
|
|
||||||
#include <string>
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include "core/zxml.h"
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <io.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace choco;
|
|
||||||
|
|
||||||
static int usage() {
|
|
||||||
std::fprintf(stderr,
|
|
||||||
"usage:\n"
|
|
||||||
" choco-cli ls <assets.pfp|dir>\n"
|
|
||||||
" choco-cli cat <assets.pfp|dir> <path> (ZXML is auto-decoded)\n"
|
|
||||||
" choco-cli lua <file.lua|file.luac> [args...]\n");
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cmdLs(const char* src) {
|
|
||||||
std::string err;
|
|
||||||
auto v = openVfs(src, &err);
|
|
||||||
if (!v) { std::fprintf(stderr, "error: %s\n", err.c_str()); return 1; }
|
|
||||||
for (auto& n : v->list()) std::printf("%s\n", n.c_str());
|
|
||||||
std::fprintf(stderr, "%zu entries\n", v->list().size());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cmdCat(const char* src, const char* path) {
|
|
||||||
std::string err;
|
|
||||||
auto v = openVfs(src, &err);
|
|
||||||
if (!v) { std::fprintf(stderr, "error: %s\n", err.c_str()); return 1; }
|
|
||||||
Bytes b;
|
|
||||||
if (!v->read(path, b)) { std::fprintf(stderr, "error: not found: %s\n", path); return 1; }
|
|
||||||
if (isZxml(b)) {
|
|
||||||
Bytes x;
|
|
||||||
if (!zxmlDecode(b, x, &err)) { std::fprintf(stderr, "error: %s\n", err.c_str()); return 1; }
|
|
||||||
b.swap(x);
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
|
||||||
_setmode(_fileno(stdout), _O_BINARY);
|
|
||||||
#endif
|
|
||||||
if (!b.empty()) std::fwrite(b.data(), 1, b.size(), stdout);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cmdLua(int argc, char** argv) {
|
|
||||||
lua_State* L = lua_open();
|
|
||||||
luaopen_base(L);
|
|
||||||
luaopen_table(L);
|
|
||||||
luaopen_io(L);
|
|
||||||
luaopen_string(L);
|
|
||||||
luaopen_math(L);
|
|
||||||
luaopen_debug(L);
|
|
||||||
lua_newtable(L);
|
|
||||||
for (int i = 0; i < argc; i++) {
|
|
||||||
lua_pushstring(L, argv[i]);
|
|
||||||
lua_rawseti(L, -2, i);
|
|
||||||
}
|
|
||||||
lua_setglobal(L, "arg");
|
|
||||||
int rc = luaL_loadfile(L, argv[0]);
|
|
||||||
if (rc == 0) rc = lua_pcall(L, 0, 0, 0);
|
|
||||||
if (rc != 0) {
|
|
||||||
std::fprintf(stderr, "lua error: %s\n", lua_tostring(L, -1));
|
|
||||||
lua_close(L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
lua_close(L);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
|
||||||
if (argc < 2) return usage();
|
|
||||||
std::string c = argv[1];
|
|
||||||
if (c == "ls" && argc == 3) return cmdLs(argv[2]);
|
|
||||||
if (c == "cat" && argc == 4) return cmdCat(argv[2], argv[3]);
|
|
||||||
if (c == "lua" && argc >= 3) return cmdLua(argc - 2, argv + 2);
|
|
||||||
return usage();
|
|
||||||
}
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
||||||
// Small self-contained inflate (RFC1951) + zlib wrapper; no external dependencies.
|
|
||||||
#include "core/inflate.h"
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct Huff {
|
|
||||||
uint16_t count[16]{};
|
|
||||||
uint16_t symbol[288]{};
|
|
||||||
};
|
|
||||||
|
|
||||||
struct State {
|
|
||||||
const uint8_t* in = nullptr;
|
|
||||||
size_t inLen = 0, inPos = 0;
|
|
||||||
uint32_t bitBuf = 0;
|
|
||||||
int bitCnt = 0;
|
|
||||||
Bytes* out = nullptr;
|
|
||||||
bool err = false;
|
|
||||||
|
|
||||||
int bits(int need) {
|
|
||||||
uint32_t v = bitBuf;
|
|
||||||
while (bitCnt < need) {
|
|
||||||
if (inPos >= inLen) { err = true; return 0; }
|
|
||||||
v |= uint32_t(in[inPos++]) << bitCnt;
|
|
||||||
bitCnt += 8;
|
|
||||||
}
|
|
||||||
bitBuf = v >> need;
|
|
||||||
bitCnt -= need;
|
|
||||||
return int(v & ((1u << need) - 1));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int decodeSym(State& s, const Huff& h) {
|
|
||||||
int code = 0, first = 0, index = 0;
|
|
||||||
for (int len = 1; len <= 15; len++) {
|
|
||||||
code |= s.bits(1);
|
|
||||||
if (s.err) return -1;
|
|
||||||
int count = h.count[len];
|
|
||||||
if (code - count < first) return h.symbol[index + (code - first)];
|
|
||||||
index += count;
|
|
||||||
first += count;
|
|
||||||
first <<= 1;
|
|
||||||
code <<= 1;
|
|
||||||
}
|
|
||||||
s.err = true;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool construct(Huff& h, const uint16_t* length, int n) {
|
|
||||||
for (int i = 0; i <= 15; i++) h.count[i] = 0;
|
|
||||||
for (int i = 0; i < n; i++) h.count[length[i]]++;
|
|
||||||
if (h.count[0] == n) return true;
|
|
||||||
int left = 1;
|
|
||||||
for (int len = 1; len <= 15; len++) {
|
|
||||||
left <<= 1;
|
|
||||||
left -= h.count[len];
|
|
||||||
if (left < 0) return false;
|
|
||||||
}
|
|
||||||
uint16_t offs[16];
|
|
||||||
offs[1] = 0;
|
|
||||||
for (int len = 1; len < 15; len++) offs[len + 1] = offs[len] + h.count[len];
|
|
||||||
for (int i = 0; i < n; i++)
|
|
||||||
if (length[i] != 0) h.symbol[offs[length[i]]++] = uint16_t(i);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint16_t kLBase[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
|
||||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
|
|
||||||
const uint16_t kLExt[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
|
|
||||||
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
|
|
||||||
const uint16_t kDBase[30] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129,
|
|
||||||
193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097,
|
|
||||||
6145, 8193, 12289, 16385, 24577};
|
|
||||||
const uint16_t kDExt[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6,
|
|
||||||
6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
|
|
||||||
|
|
||||||
bool codes(State& s, const Huff& lc, const Huff& dc) {
|
|
||||||
for (;;) {
|
|
||||||
int sym = decodeSym(s, lc);
|
|
||||||
if (s.err) return false;
|
|
||||||
if (sym < 256) {
|
|
||||||
s.out->push_back(uint8_t(sym));
|
|
||||||
} else if (sym == 256) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
sym -= 257;
|
|
||||||
if (sym >= 29) return false;
|
|
||||||
int len = kLBase[sym] + s.bits(kLExt[sym]);
|
|
||||||
int ds = decodeSym(s, dc);
|
|
||||||
if (s.err || ds < 0 || ds >= 30) return false;
|
|
||||||
size_t dist = size_t(kDBase[ds]) + size_t(s.bits(kDExt[ds]));
|
|
||||||
if (s.err || dist > s.out->size()) return false;
|
|
||||||
size_t from = s.out->size() - dist;
|
|
||||||
for (int i = 0; i < len; i++) s.out->push_back((*s.out)[from + i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool inflateRaw(State& s) {
|
|
||||||
int last;
|
|
||||||
do {
|
|
||||||
last = s.bits(1);
|
|
||||||
int type = s.bits(2);
|
|
||||||
if (s.err) return false;
|
|
||||||
if (type == 0) {
|
|
||||||
s.bitBuf = 0;
|
|
||||||
s.bitCnt = 0;
|
|
||||||
if (s.inPos + 4 > s.inLen) return false;
|
|
||||||
unsigned len = s.in[s.inPos] | (s.in[s.inPos + 1] << 8);
|
|
||||||
unsigned nlen = s.in[s.inPos + 2] | (s.in[s.inPos + 3] << 8);
|
|
||||||
s.inPos += 4;
|
|
||||||
if (len != (~nlen & 0xFFFF) || s.inPos + len > s.inLen) return false;
|
|
||||||
s.out->insert(s.out->end(), s.in + s.inPos, s.in + s.inPos + len);
|
|
||||||
s.inPos += len;
|
|
||||||
} else if (type == 1) {
|
|
||||||
Huff lc, dc;
|
|
||||||
uint16_t l[288];
|
|
||||||
int i = 0;
|
|
||||||
for (; i < 144; i++) l[i] = 8;
|
|
||||||
for (; i < 256; i++) l[i] = 9;
|
|
||||||
for (; i < 280; i++) l[i] = 7;
|
|
||||||
for (; i < 288; i++) l[i] = 8;
|
|
||||||
construct(lc, l, 288);
|
|
||||||
for (i = 0; i < 30; i++) l[i] = 5;
|
|
||||||
construct(dc, l, 30);
|
|
||||||
if (!codes(s, lc, dc)) return false;
|
|
||||||
} else if (type == 2) {
|
|
||||||
int nlen = s.bits(5) + 257, ndist = s.bits(5) + 1, ncode = s.bits(4) + 4;
|
|
||||||
if (s.err || nlen > 286 || ndist > 30) return false;
|
|
||||||
static const uint8_t order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
|
||||||
uint16_t lengths[320]{};
|
|
||||||
for (int i = 0; i < ncode; i++) lengths[order[i]] = uint16_t(s.bits(3));
|
|
||||||
Huff lencode;
|
|
||||||
if (!construct(lencode, lengths, 19)) return false;
|
|
||||||
int idx = 0;
|
|
||||||
uint16_t ll[320]{};
|
|
||||||
while (idx < nlen + ndist) {
|
|
||||||
int sym = decodeSym(s, lencode);
|
|
||||||
if (s.err) return false;
|
|
||||||
if (sym < 16) {
|
|
||||||
ll[idx++] = uint16_t(sym);
|
|
||||||
} else {
|
|
||||||
int len = 0, rep;
|
|
||||||
if (sym == 16) {
|
|
||||||
if (idx == 0) return false;
|
|
||||||
len = ll[idx - 1];
|
|
||||||
rep = 3 + s.bits(2);
|
|
||||||
} else if (sym == 17) {
|
|
||||||
rep = 3 + s.bits(3);
|
|
||||||
} else {
|
|
||||||
rep = 11 + s.bits(7);
|
|
||||||
}
|
|
||||||
if (idx + rep > nlen + ndist) return false;
|
|
||||||
while (rep--) ll[idx++] = uint16_t(len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Huff lc, dc;
|
|
||||||
if (!construct(lc, ll, nlen)) return false;
|
|
||||||
if (!construct(dc, ll + nlen, ndist)) return false;
|
|
||||||
if (!codes(s, lc, dc)) return false;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} while (!last);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
bool zlibInflate(const uint8_t* src, size_t n, Bytes& out, size_t expectedSize) {
|
|
||||||
out.clear();
|
|
||||||
if (n < 2) return false;
|
|
||||||
if ((src[0] & 0x0F) != 8 || ((src[0] << 8) | src[1]) % 31 != 0) return false;
|
|
||||||
if (src[1] & 0x20) return false; // preset dictionary unsupported
|
|
||||||
if (expectedSize) out.reserve(expectedSize);
|
|
||||||
State s;
|
|
||||||
s.in = src + 2;
|
|
||||||
s.inLen = n - 2;
|
|
||||||
s.out = &out;
|
|
||||||
if (!inflateRaw(s)) return false;
|
|
||||||
return expectedSize == 0 || out.size() == expectedSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
using Bytes = std::vector<uint8_t>;
|
|
||||||
// Decode a zlib (RFC1950) stream. Returns false on malformed input.
|
|
||||||
bool zlibInflate(const uint8_t* src, size_t n, Bytes& out, size_t expectedSize = 0);
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
#include "core/pfp.h"
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class PfpVfs : public Vfs {
|
|
||||||
public:
|
|
||||||
struct Entry { uint32_t off, size; };
|
|
||||||
Bytes data;
|
|
||||||
std::vector<std::string> names;
|
|
||||||
std::vector<Entry> entries;
|
|
||||||
const std::vector<std::string>& list() const override { return names; }
|
|
||||||
bool read(const std::string& path, Bytes& out) const override {
|
|
||||||
std::string key = normalizePath(path);
|
|
||||||
for (size_t i = 0; i < names.size(); i++) {
|
|
||||||
if (normalizePath(names[i]) == key) {
|
|
||||||
out.assign(data.begin() + entries[i].off, data.begin() + entries[i].off + entries[i].size);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
uint32_t rd32(const uint8_t* p) { return p[0] | (p[1] << 8) | (p[2] << 16) | (uint32_t(p[3]) << 24); }
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
std::unique_ptr<Vfs> openPfp(const std::string& file, std::string* err) {
|
|
||||||
auto v = std::make_unique<PfpVfs>();
|
|
||||||
if (!readFile(file, v->data)) { if (err) *err = "cannot read " + file; return nullptr; }
|
|
||||||
const Bytes& d = v->data;
|
|
||||||
if (d.size() < 8 || std::memcmp(d.data(), "PFPK", 4) != 0) { if (err) *err = "not a PFPK archive"; return nullptr; }
|
|
||||||
uint32_t n = rd32(d.data() + 4);
|
|
||||||
size_t p = 8;
|
|
||||||
for (uint32_t i = 0; i < n; i++) {
|
|
||||||
if (p >= d.size()) { if (err) *err = "PFPK table truncated"; return nullptr; }
|
|
||||||
size_t l = d[p++];
|
|
||||||
if (p + l + 8 > d.size()) { if (err) *err = "PFPK table truncated"; return nullptr; }
|
|
||||||
std::string name(reinterpret_cast<const char*>(&d[p]), l);
|
|
||||||
p += l;
|
|
||||||
PfpVfs::Entry e{rd32(&d[p]), rd32(&d[p + 4])};
|
|
||||||
p += 8;
|
|
||||||
if (size_t(e.off) + e.size > d.size()) { if (err) *err = "PFPK entry out of range: " + name; return nullptr; }
|
|
||||||
v->names.push_back(name);
|
|
||||||
v->entries.push_back(e);
|
|
||||||
}
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "core/vfs.h"
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
std::unique_ptr<Vfs> openPfp(const std::string& file, std::string* err = nullptr);
|
|
||||||
std::unique_ptr<Vfs> openDir(const std::string& dir, std::string* err = nullptr);
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,118 +0,0 @@
|
||||||
#include "core/save_snapshot.h"
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstring>
|
|
||||||
#include <fstream>
|
|
||||||
#include <limits>
|
|
||||||
#include <unordered_set>
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <windows.h>
|
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
constexpr std::string_view magic("CHSV\x01\x00\x00\x00", 8);
|
|
||||||
bool fail(std::string* error, const char* message) { if (error) *error = message; return false; }
|
|
||||||
struct Writer {
|
|
||||||
std::string& out; const SaveLimits& limits; std::string* error;
|
|
||||||
size_t entries = 0; std::unordered_set<const SaveTable*> active;
|
|
||||||
bool append(const void* p, size_t n) {
|
|
||||||
if (n > limits.maxBytes || out.size() > limits.maxBytes - n) return fail(error, "save exceeds byte limit");
|
|
||||||
out.append(static_cast<const char*>(p), n); return true;
|
|
||||||
}
|
|
||||||
bool byte(uint8_t n) { return append(&n, 1); }
|
|
||||||
bool u32(uint32_t n) { uint8_t b[4]; for (int i=0;i<4;++i) b[i]=uint8_t(n >> (8*i)); return append(b,4); }
|
|
||||||
bool value(const SaveValue& v, size_t depth) {
|
|
||||||
if (depth > limits.maxDepth) return fail(error, "save exceeds depth limit");
|
|
||||||
if (auto p=std::get_if<bool>(&v.data)) return byte(*p ? 2 : 1);
|
|
||||||
if (auto p=std::get_if<double>(&v.data)) {
|
|
||||||
if (!std::isfinite(*p)) return fail(error, "nonfinite save number");
|
|
||||||
uint64_t bits; std::memcpy(&bits,p,8); uint8_t b[8];
|
|
||||||
for (int i=0;i<8;++i) b[i]=uint8_t(bits >> (8*i));
|
|
||||||
return byte(3) && append(b,8);
|
|
||||||
}
|
|
||||||
if (auto p=std::get_if<std::string>(&v.data)) {
|
|
||||||
if (p->size()>limits.maxStringBytes || p->size()>UINT32_MAX) return fail(error,"save string too long");
|
|
||||||
return byte(4) && u32(uint32_t(p->size())) && append(p->data(),p->size());
|
|
||||||
}
|
|
||||||
auto p=std::get<SaveValue::Table>(v.data);
|
|
||||||
if (!p) return fail(error,"null save table");
|
|
||||||
if (!active.insert(p.get()).second) return fail(error,"cyclic save table");
|
|
||||||
if (p->entries.size()>UINT32_MAX || p->entries.size()>limits.maxEntries-entries) return fail(error,"too many save entries");
|
|
||||||
entries += p->entries.size();
|
|
||||||
if (!byte(5) || !u32(uint32_t(p->entries.size()))) return false;
|
|
||||||
for (const auto& e:p->entries) {
|
|
||||||
if (auto k=std::get_if<std::string>(&e.key.data)) { if (k->empty()) return fail(error,"empty save key"); }
|
|
||||||
else if (!std::holds_alternative<double>(e.key.data)) return fail(error,"invalid save key type");
|
|
||||||
if (!value(e.key,depth+1) || !value(e.value,depth+1)) return false;
|
|
||||||
}
|
|
||||||
active.erase(p.get()); return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
struct Reader {
|
|
||||||
std::string_view in; const SaveLimits& limits; std::string* error;
|
|
||||||
size_t at=0, entries=0;
|
|
||||||
bool take(void* p,size_t n) {
|
|
||||||
if (n>in.size()-at) return fail(error,"truncated save");
|
|
||||||
std::memcpy(p,in.data()+at,n); at+=n; return true;
|
|
||||||
}
|
|
||||||
bool byte(uint8_t& n) { return take(&n,1); }
|
|
||||||
bool u32(uint32_t& n) { uint8_t b[4]; if(!take(b,4))return false; n=0; for(int i=0;i<4;++i)n|=uint32_t(b[i])<<(8*i); return true; }
|
|
||||||
bool value(SaveValue& v,size_t depth) {
|
|
||||||
if(depth>limits.maxDepth)return fail(error,"save exceeds depth limit");
|
|
||||||
uint8_t tag; if(!byte(tag))return false;
|
|
||||||
if(tag==1 || tag==2){v=SaveValue(tag==2);return true;}
|
|
||||||
if(tag==3){uint8_t b[8];if(!take(b,8))return false;uint64_t bits=0;for(int i=0;i<8;++i)bits|=uint64_t(b[i])<<(8*i);double n;std::memcpy(&n,&bits,8);if(!std::isfinite(n))return fail(error,"nonfinite save number");v=SaveValue(n);return true;}
|
|
||||||
if(tag==4){uint32_t n;if(!u32(n))return false;if(n>limits.maxStringBytes || n>in.size()-at)return fail(error,"invalid save string length");v=SaveValue(std::string(in.substr(at,n)));at+=n;return true;}
|
|
||||||
if(tag!=5)return fail(error,"unknown save value type");
|
|
||||||
uint32_t count;if(!u32(count))return false;
|
|
||||||
if(count>limits.maxEntries-entries || count>(in.size()-at)/2)return fail(error,"invalid save entry count");
|
|
||||||
entries+=count;auto table=std::make_shared<SaveTable>();table->entries.reserve(count);
|
|
||||||
for(uint32_t i=0;i<count;++i){SaveEntry e;if(!value(e.key,depth+1))return false;
|
|
||||||
if(auto k=std::get_if<std::string>(&e.key.data)){if(k->empty())return fail(error,"empty save key");}
|
|
||||||
else if(!std::holds_alternative<double>(e.key.data))return fail(error,"invalid save key type");
|
|
||||||
if(!value(e.value,depth+1))return false;table->entries.push_back(std::move(e));}
|
|
||||||
v=SaveValue(table);return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
bool encodeSave(const SaveValue& root,std::string& bytes,std::string* error,const SaveLimits& limits){
|
|
||||||
std::string result;Writer w{result,limits,error};
|
|
||||||
if(!w.append(magic.data(),magic.size()) || !w.value(root,0))return false;
|
|
||||||
bytes=std::move(result);return true;
|
|
||||||
}
|
|
||||||
bool decodeSave(std::string_view bytes,SaveValue& root,std::string* error,const SaveLimits& limits){
|
|
||||||
if(bytes.size()>limits.maxBytes)return fail(error,"save exceeds byte limit");
|
|
||||||
if(bytes.size()<magic.size() || bytes.substr(0,magic.size())!=magic)return fail(error,"unsupported save version");
|
|
||||||
Reader r{bytes,limits,error};r.at=magic.size();SaveValue result;
|
|
||||||
if(!r.value(result,0))return false;
|
|
||||||
if(r.at!=bytes.size())return fail(error,"trailing save data");
|
|
||||||
root=std::move(result);return true;
|
|
||||||
}
|
|
||||||
bool writeSaveAtomic(const std::filesystem::path& path,std::string_view bytes,std::string* error){
|
|
||||||
if(path.empty())return fail(error,"empty save path");
|
|
||||||
auto temporary=path;temporary += ".tmp";
|
|
||||||
{std::ofstream out(temporary,std::ios::binary|std::ios::trunc);
|
|
||||||
if(!out)return fail(error,"cannot open temporary save");
|
|
||||||
out.write(bytes.data(),std::streamsize(bytes.size()));out.flush();
|
|
||||||
if(!out){out.close();std::error_code ec;std::filesystem::remove(temporary,ec);return fail(error,"cannot write temporary save");}}
|
|
||||||
#ifdef _WIN32
|
|
||||||
if(!MoveFileExW(temporary.c_str(),path.c_str(),MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)){
|
|
||||||
#else
|
|
||||||
std::error_code renameError;std::filesystem::rename(temporary,path,renameError);if(renameError){
|
|
||||||
#endif
|
|
||||||
std::error_code ec;std::filesystem::remove(temporary,ec);return fail(error,"cannot replace save");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
bool readSave(const std::filesystem::path& path,std::string& bytes,std::string* error,const SaveLimits& limits){
|
|
||||||
std::error_code ec;auto size=std::filesystem::file_size(path,ec);
|
|
||||||
if(ec)return fail(error,"cannot stat save");
|
|
||||||
if(size>limits.maxBytes)return fail(error,"save exceeds byte limit");
|
|
||||||
std::ifstream in(path,std::ios::binary);if(!in)return fail(error,"cannot open save");
|
|
||||||
std::string result(size,'\0');if(size && !in.read(result.data(),std::streamsize(size)))return fail(error,"cannot read save");
|
|
||||||
bytes=std::move(result);return true;
|
|
||||||
}
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <string_view>
|
|
||||||
#include <variant>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
struct SaveTable;
|
|
||||||
struct SaveValue {
|
|
||||||
using Table = std::shared_ptr<SaveTable>;
|
|
||||||
std::variant<bool, double, std::string, Table> data;
|
|
||||||
SaveValue() : data(false) {}
|
|
||||||
SaveValue(bool value) : data(value) {}
|
|
||||||
SaveValue(double value) : data(value) {}
|
|
||||||
SaveValue(std::string value) : data(std::move(value)) {}
|
|
||||||
SaveValue(const char* value) : data(std::string(value)) {}
|
|
||||||
SaveValue(Table value) : data(std::move(value)) {}
|
|
||||||
};
|
|
||||||
struct SaveEntry { SaveValue key; SaveValue value; };
|
|
||||||
struct SaveTable { std::vector<SaveEntry> entries; };
|
|
||||||
|
|
||||||
struct SaveLimits {
|
|
||||||
size_t maxBytes = 16 * 1024 * 1024;
|
|
||||||
size_t maxStringBytes = 1024 * 1024;
|
|
||||||
size_t maxEntries = 200000;
|
|
||||||
size_t maxDepth = 64;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Versioned binary snapshot. Keys must be finite numbers or nonempty strings.
|
|
||||||
bool encodeSave(const SaveValue& root, std::string& bytes, std::string* error = nullptr,
|
|
||||||
const SaveLimits& limits = {});
|
|
||||||
bool decodeSave(std::string_view bytes, SaveValue& root, std::string* error = nullptr,
|
|
||||||
const SaveLimits& limits = {});
|
|
||||||
bool writeSaveAtomic(const std::filesystem::path& path, std::string_view bytes,
|
|
||||||
std::string* error = nullptr);
|
|
||||||
bool readSave(const std::filesystem::path& path, std::string& bytes,
|
|
||||||
std::string* error = nullptr, const SaveLimits& limits = {});
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
||||||
#include "core/string_table.h"
|
|
||||||
#include <charconv>
|
|
||||||
#include <cctype>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
std::string_view local(std::string_view name) {
|
|
||||||
const auto colon = name.rfind(':');
|
|
||||||
return colon == std::string_view::npos ? name : name.substr(colon + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void utf8(std::string& out, unsigned int code) {
|
|
||||||
if (code <= 0x7f) out.push_back(static_cast<char>(code));
|
|
||||||
else if (code <= 0x7ff) {
|
|
||||||
out.push_back(static_cast<char>(0xc0 | (code >> 6)));
|
|
||||||
out.push_back(static_cast<char>(0x80 | (code & 0x3f)));
|
|
||||||
} else if (code <= 0xffff) {
|
|
||||||
out.push_back(static_cast<char>(0xe0 | (code >> 12)));
|
|
||||||
out.push_back(static_cast<char>(0x80 | ((code >> 6) & 0x3f)));
|
|
||||||
out.push_back(static_cast<char>(0x80 | (code & 0x3f)));
|
|
||||||
} else {
|
|
||||||
out.push_back(static_cast<char>(0xf0 | (code >> 18)));
|
|
||||||
out.push_back(static_cast<char>(0x80 | ((code >> 12) & 0x3f)));
|
|
||||||
out.push_back(static_cast<char>(0x80 | ((code >> 6) & 0x3f)));
|
|
||||||
out.push_back(static_cast<char>(0x80 | (code & 0x3f)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool decode(std::string_view in, std::string& out) {
|
|
||||||
for (size_t i = 0; i < in.size();) {
|
|
||||||
if (in[i] != '&') { out.push_back(in[i++]); continue; }
|
|
||||||
const auto end = in.find(';', i + 1);
|
|
||||||
if (end == std::string_view::npos) return false;
|
|
||||||
const auto entity = in.substr(i + 1, end - i - 1);
|
|
||||||
if (entity == "amp") out.push_back('&');
|
|
||||||
else if (entity == "lt") out.push_back('<');
|
|
||||||
else if (entity == "gt") out.push_back('>');
|
|
||||||
else if (entity == "quot") out.push_back('"');
|
|
||||||
else if (entity == "apos") out.push_back('\'');
|
|
||||||
else if (entity.size() > 1 && entity[0] == '#') {
|
|
||||||
unsigned int code = 0;
|
|
||||||
const bool hex = entity.size() > 2 && (entity[1] == 'x' || entity[1] == 'X');
|
|
||||||
const auto digits = entity.substr(hex ? 2 : 1);
|
|
||||||
const auto result = std::from_chars(digits.data(), digits.data() + digits.size(), code, hex ? 16 : 10);
|
|
||||||
if (digits.empty() || result.ec != std::errc{} || result.ptr != digits.data() + digits.size() ||
|
|
||||||
code == 0 || code > 0x10ffff || (code >= 0xd800 && code <= 0xdfff)) return false;
|
|
||||||
utf8(out, code);
|
|
||||||
} else return false;
|
|
||||||
i = end + 1;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string_view trim(std::string_view s) {
|
|
||||||
while (!s.empty() && std::isspace(static_cast<unsigned char>(s.front()))) s.remove_prefix(1);
|
|
||||||
while (!s.empty() && std::isspace(static_cast<unsigned char>(s.back()))) s.remove_suffix(1);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StringTable::loadXml(std::string_view xml, std::string* error) {
|
|
||||||
std::unordered_map<std::string, std::string> parsed;
|
|
||||||
std::string key, value;
|
|
||||||
std::vector<std::string_view> stack;
|
|
||||||
bool sawWorkbook = false, sawTable = false, inData = false;
|
|
||||||
int cell = 0;
|
|
||||||
size_t pos = 0;
|
|
||||||
auto fail = [&](const char* why) { if (error) *error = why; return false; };
|
|
||||||
while (pos < xml.size()) {
|
|
||||||
if (xml[pos] != '<') {
|
|
||||||
const auto end = xml.find('<', pos);
|
|
||||||
if (inData && !decode(xml.substr(pos, end == std::string_view::npos ? end : end - pos),
|
|
||||||
cell == 1 ? key : value)) return fail("invalid XML entity");
|
|
||||||
pos = end == std::string_view::npos ? xml.size() : end;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (xml.substr(pos, 4) == "<!--") {
|
|
||||||
const auto end = xml.find("-->", pos + 4);
|
|
||||||
if (end == std::string_view::npos) return fail("unterminated XML comment");
|
|
||||||
pos = end + 3; continue;
|
|
||||||
}
|
|
||||||
if (xml.substr(pos, 9) == "<![CDATA[") {
|
|
||||||
const auto end = xml.find("]]>", pos + 9);
|
|
||||||
if (end == std::string_view::npos) return fail("unterminated CDATA");
|
|
||||||
if (inData) (cell == 1 ? key : value).append(xml.substr(pos + 9, end - pos - 9));
|
|
||||||
pos = end + 3; continue;
|
|
||||||
}
|
|
||||||
const auto end = xml.find('>', pos + 1);
|
|
||||||
if (end == std::string_view::npos) return fail("unterminated XML tag");
|
|
||||||
auto tag = trim(xml.substr(pos + 1, end - pos - 1));
|
|
||||||
pos = end + 1;
|
|
||||||
if (tag.empty()) return fail("empty XML tag");
|
|
||||||
if (tag[0] == '?' || tag[0] == '!') continue;
|
|
||||||
const bool closing = tag[0] == '/';
|
|
||||||
const bool empty = !closing && tag.back() == '/';
|
|
||||||
if (closing) tag.remove_prefix(1);
|
|
||||||
if (empty) tag.remove_suffix(1);
|
|
||||||
tag = trim(tag);
|
|
||||||
const auto space = tag.find_first_of(" \t\r\n");
|
|
||||||
const auto name = local(tag.substr(0, space));
|
|
||||||
if (closing) {
|
|
||||||
if (stack.empty() || stack.back() != name) return fail("mismatched XML tag");
|
|
||||||
} else {
|
|
||||||
stack.push_back(name);
|
|
||||||
if (name == "Workbook") sawWorkbook = true;
|
|
||||||
if (name == "Table") sawTable = true;
|
|
||||||
if (name == "Row") { cell = 0; key.clear(); value.clear(); }
|
|
||||||
if (name == "Cell" && stack.size() >= 2 && stack[stack.size()-2] == "Row") ++cell;
|
|
||||||
if (name == "Data" && stack.size() >= 2 && stack[stack.size()-2] == "Cell") inData = true;
|
|
||||||
}
|
|
||||||
if (closing || empty) {
|
|
||||||
if (name == "Data") inData = false;
|
|
||||||
if (name == "Row" && !key.empty()) parsed[key] = value;
|
|
||||||
stack.pop_back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!stack.empty() || !sawWorkbook || !sawTable) return fail("incomplete XML Spreadsheet");
|
|
||||||
for (auto& [k, v] : parsed) values_[std::move(k)] = std::move(v);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string* StringTable::find(std::string_view key) const {
|
|
||||||
auto it = values_.find(std::string(key));
|
|
||||||
return it == values_.end() ? nullptr : &it->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringTable::get(std::string_view key) const {
|
|
||||||
if (!key.empty() && key.front() == '#') return std::string(key.substr(1));
|
|
||||||
const auto* value = find(key);
|
|
||||||
return value ? *value : "#####";
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringTable::format(std::string_view key, const std::vector<std::string>& args) const {
|
|
||||||
const auto source = get(key);
|
|
||||||
std::string out;
|
|
||||||
for (size_t i = 0; i < source.size();) {
|
|
||||||
if (source[i] != '%') { out.push_back(source[i++]); continue; }
|
|
||||||
if (i + 1 < source.size() && source[i+1] == '%') { out.push_back('%'); i += 2; continue; }
|
|
||||||
const auto end = source.find('%', i + 1);
|
|
||||||
if (end != std::string::npos) {
|
|
||||||
size_t number = 0;
|
|
||||||
const auto digits = std::string_view(source).substr(i + 1, end - i - 1);
|
|
||||||
const auto result = std::from_chars(digits.data(), digits.data() + digits.size(), number);
|
|
||||||
if (!digits.empty() && result.ec == std::errc{} && result.ptr == digits.data()+digits.size() &&
|
|
||||||
number >= 1 && number <= args.size()) {
|
|
||||||
out += args[number - 1]; i = end + 1; continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out.push_back(source[i++]);
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <string>
|
|
||||||
#include <string_view>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
// The game's Excel 2003 XML Spreadsheet string files. Later loads override keys.
|
|
||||||
class StringTable {
|
|
||||||
public:
|
|
||||||
bool loadXml(std::string_view xml, std::string* error = nullptr);
|
|
||||||
const std::string* find(std::string_view key) const;
|
|
||||||
std::string get(std::string_view key) const;
|
|
||||||
std::string format(std::string_view key, const std::vector<std::string>& args) const;
|
|
||||||
size_t size() const { return values_.size(); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::unordered_map<std::string, std::string> values_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
#include "core/vfs.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cctype>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <fstream>
|
|
||||||
#include "core/pfp.h"
|
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
std::string normalizePath(const std::string& p) {
|
|
||||||
std::string r = p;
|
|
||||||
for (char& c : r) c = (c == '\\') ? '/' : char(std::tolower(static_cast<unsigned char>(c)));
|
|
||||||
while (r.rfind("./", 0) == 0) r.erase(0, 2);
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::filesystem::path pathFromUtf8(const std::string& s) { return fs::path(std::u8string(s.begin(), s.end())); }
|
|
||||||
std::string pathToUtf8(const fs::path& p) { auto u = p.u8string(); return std::string(u.begin(), u.end()); }
|
|
||||||
|
|
||||||
bool Vfs::exists(const std::string& path) const {
|
|
||||||
std::string k = normalizePath(path);
|
|
||||||
for (auto& n : list()) if (normalizePath(n) == k) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool readFile(const std::string& path, Bytes& out) {
|
|
||||||
std::ifstream f(pathFromUtf8(path), std::ios::binary);
|
|
||||||
if (!f) return false;
|
|
||||||
f.seekg(0, std::ios::end);
|
|
||||||
auto sz = f.tellg();
|
|
||||||
f.seekg(0);
|
|
||||||
out.resize(size_t(sz));
|
|
||||||
if (sz > 0) f.read(reinterpret_cast<char*>(out.data()), sz);
|
|
||||||
return bool(f) || sz == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class DirVfs : public Vfs {
|
|
||||||
public:
|
|
||||||
fs::path root;
|
|
||||||
std::vector<std::string> names;
|
|
||||||
const std::vector<std::string>& list() const override { return names; }
|
|
||||||
bool read(const std::string& path, Bytes& out) const override {
|
|
||||||
std::string key = normalizePath(path);
|
|
||||||
for (auto& n : names)
|
|
||||||
if (normalizePath(n) == key) return readFile(pathToUtf8(root / pathFromUtf8(n)), out);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
std::unique_ptr<Vfs> openDir(const std::string& dir, std::string* err) {
|
|
||||||
std::error_code ec;
|
|
||||||
if (!fs::is_directory(pathFromUtf8(dir), ec)) { if (err) *err = "not a directory: " + dir; return nullptr; }
|
|
||||||
auto v = std::make_unique<DirVfs>();
|
|
||||||
v->root = pathFromUtf8(dir);
|
|
||||||
for (auto& e : fs::recursive_directory_iterator(v->root, ec))
|
|
||||||
if (e.is_regular_file()) v->names.push_back([&]{ auto u = fs::relative(e.path(), v->root).generic_u8string(); return std::string(u.begin(), u.end()); }());
|
|
||||||
std::sort(v->names.begin(), v->names.end());
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<Vfs> openVfs(const std::string& path, std::string* err) {
|
|
||||||
std::error_code ec;
|
|
||||||
if (fs::is_directory(pathFromUtf8(path), ec)) return openDir(path, err);
|
|
||||||
return openPfp(path, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <filesystem>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "core/inflate.h"
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
// Read-only virtual file system: a PFPK archive or a plain directory tree.
|
|
||||||
// Paths use '/' separators and are matched case-insensitively.
|
|
||||||
class Vfs {
|
|
||||||
public:
|
|
||||||
virtual ~Vfs() = default;
|
|
||||||
virtual const std::vector<std::string>& list() const = 0;
|
|
||||||
virtual bool read(const std::string& path, Bytes& out) const = 0;
|
|
||||||
bool exists(const std::string& path) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
std::filesystem::path pathFromUtf8(const std::string& s);
|
|
||||||
std::string pathToUtf8(const std::filesystem::path& p);
|
|
||||||
bool readFile(const std::string& path, Bytes& out);
|
|
||||||
std::string normalizePath(const std::string& p);
|
|
||||||
// Opens `path` as a PFPK archive (if it is a file) or loose directory. nullptr on failure.
|
|
||||||
std::unique_ptr<Vfs> openVfs(const std::string& path, std::string* err = nullptr);
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
#include "core/zxml.h"
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
bool isZxml(const Bytes& b) { return b.size() >= 12 && std::memcmp(b.data(), "ZXML", 4) == 0; }
|
|
||||||
|
|
||||||
static uint32_t rd32(const uint8_t* p) { return p[0] | (p[1] << 8) | (p[2] << 16) | (uint32_t(p[3]) << 24); }
|
|
||||||
|
|
||||||
bool zxmlDecode(const Bytes& in, Bytes& out, std::string* err) {
|
|
||||||
if (!isZxml(in)) { if (err) *err = "not ZXML"; return false; }
|
|
||||||
uint32_t comp = rd32(in.data() + 4), raw = rd32(in.data() + 8);
|
|
||||||
if (size_t(comp) + 12 > in.size()) { if (err) *err = "ZXML truncated"; return false; }
|
|
||||||
if (!zlibInflate(in.data() + 12, comp, out, raw)) { if (err) *err = "ZXML inflate failed"; return false; }
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <string>
|
|
||||||
#include "core/inflate.h"
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
// ZXML: 'ZXML', u32 compressedSize, u32 rawSize, zlib stream.
|
|
||||||
bool isZxml(const Bytes& b);
|
|
||||||
bool zxmlDecode(const Bytes& in, Bytes& out, std::string* err = nullptr);
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
#include "core/vfs.h"
|
|
||||||
#include "gfx/draw.h"
|
|
||||||
#include "platform/display.h"
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
|
||||||
if (argc != 2) {
|
|
||||||
std::cerr << "usage: choco-preview <assets.pfp|asset-directory>\n";
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
std::string error;
|
|
||||||
std::unique_ptr<choco::Vfs> assets = choco::openVfs(argv[1], &error);
|
|
||||||
if (!assets) { std::cerr << error << '\n'; return 1; }
|
|
||||||
|
|
||||||
choco::Display display;
|
|
||||||
if (!display.open("Chocolatier 3 - graphics preview", 800, 600, &error)) {
|
|
||||||
std::cerr << error << '\n'; return 1;
|
|
||||||
}
|
|
||||||
choco::Draw draw(display.renderer(), *assets);
|
|
||||||
const char* const buttons[] = {"story", "change", "help", "options", "scores", "quit"};
|
|
||||||
const float centers[][2] = {{400, 270}, {117, 417}, {250, 455}, {400, 475}, {550, 455}, {683, 417}};
|
|
||||||
bool running = true;
|
|
||||||
while (running) {
|
|
||||||
choco::Event event;
|
|
||||||
while (display.poll(event)) {
|
|
||||||
if (event.type == choco::Event::Type::Quit ||
|
|
||||||
(event.type == choco::Event::Type::KeyDown && event.key == SDLK_ESCAPE)) running = false;
|
|
||||||
}
|
|
||||||
display.beginFrame();
|
|
||||||
if (!draw.image("image/title_background.jpg", {0, 0, 800, 600})) {
|
|
||||||
std::cerr << "missing image/title_background.jpg\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 6; ++i) {
|
|
||||||
const std::string path = std::string("image/button_mm_") + buttons[i] + "_up.png";
|
|
||||||
SDL_Texture* image = draw.load(path);
|
|
||||||
if (image) draw.image(path, {centers[i][0] - image->w / 2.0f,
|
|
||||||
centers[i][1] - image->h / 2.0f,
|
|
||||||
static_cast<float>(image->w), static_cast<float>(image->h)});
|
|
||||||
}
|
|
||||||
display.endFrame();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,128 +0,0 @@
|
||||||
#include "gfx/character.h"
|
|
||||||
#include "core/zxml.h"
|
|
||||||
#include <SDL3_image/SDL_image.h>
|
|
||||||
#include <charconv>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
namespace {
|
|
||||||
bool fail(std::string* error,const char* message) {
|
|
||||||
if(error)*error=message;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool attribute(std::string_view tag,std::string_view key,int& value) {
|
|
||||||
const std::string needle=" "+std::string(key)+"=\"";
|
|
||||||
const auto start=tag.find(needle);
|
|
||||||
if(start==std::string_view::npos)return false;
|
|
||||||
const auto first=start+needle.size(),last=tag.find('"',first);
|
|
||||||
if(last==std::string_view::npos)return false;
|
|
||||||
const auto result=std::from_chars(tag.data()+first,tag.data()+last,value);
|
|
||||||
return result.ec==std::errc{} && result.ptr==tag.data()+last;
|
|
||||||
}
|
|
||||||
SDL_Surface* image(const Vfs& assets,const std::string& path) {
|
|
||||||
Bytes bytes;
|
|
||||||
if(!assets.read(path,bytes) || bytes.empty() || bytes.size()>16*1024*1024)return nullptr;
|
|
||||||
SDL_IOStream* io=SDL_IOFromConstMem(bytes.data(),bytes.size());
|
|
||||||
return io?IMG_Load_IO(io,true):nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool parseCharacterFrames(std::string_view xml,std::vector<CharacterFrame>& frames,
|
|
||||||
std::string* error) {
|
|
||||||
std::vector<CharacterFrame> parsed;
|
|
||||||
size_t pos=xml.find("<framelist>");
|
|
||||||
if(pos==std::string_view::npos)return fail(error,"character framelist missing");
|
|
||||||
const size_t end=xml.find("</framelist>",pos);
|
|
||||||
if(end==std::string_view::npos)return fail(error,"character framelist unclosed");
|
|
||||||
while((pos=xml.find("<frame ",pos))!=std::string_view::npos && pos<end) {
|
|
||||||
const size_t close=xml.find('>',pos);
|
|
||||||
if(close==std::string_view::npos || close>=end || parsed.size()>=32)
|
|
||||||
return fail(error,"invalid character frame tag");
|
|
||||||
const auto tag=xml.substr(pos,close-pos+1);
|
|
||||||
CharacterFrame frame;
|
|
||||||
if(!attribute(tag,"x",frame.x) || !attribute(tag,"y",frame.y) ||
|
|
||||||
!attribute(tag,"w",frame.w) || !attribute(tag,"h",frame.h) ||
|
|
||||||
!attribute(tag,"regx",frame.regx) || !attribute(tag,"regy",frame.regy) ||
|
|
||||||
frame.x<0 || frame.y<0 || frame.w<=0 || frame.h<=0 ||
|
|
||||||
frame.w>4096 || frame.h>4096 || frame.regx<0 || frame.regy<0 ||
|
|
||||||
frame.regx>4096 || frame.regy>4096)
|
|
||||||
return fail(error,"invalid character frame bounds");
|
|
||||||
parsed.push_back(frame);
|
|
||||||
pos=close+1;
|
|
||||||
}
|
|
||||||
if(parsed.empty())return fail(error,"character frames missing");
|
|
||||||
frames=std::move(parsed);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
CharacterAtlas::~CharacterAtlas(){if(texture_)SDL_DestroyTexture(texture_);}
|
|
||||||
|
|
||||||
bool CharacterAtlas::load(SDL_Renderer* renderer,const Vfs& assets,std::string_view name,
|
|
||||||
std::string* error) {
|
|
||||||
if(!renderer || name.empty() || name.size()>96 ||
|
|
||||||
name.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")!=std::string_view::npos)
|
|
||||||
return fail(error,"invalid character name");
|
|
||||||
const std::string stem="characters/"+std::string(name);
|
|
||||||
Bytes xmlBytes;
|
|
||||||
if(!assets.read(stem+".xml",xmlBytes))return fail(error,"character XML missing");
|
|
||||||
Bytes plain;
|
|
||||||
if(isZxml(xmlBytes)) {
|
|
||||||
if(!zxmlDecode(xmlBytes,plain,error))return false;
|
|
||||||
} else plain=std::move(xmlBytes);
|
|
||||||
if(plain.size()>128*1024)return fail(error,"character XML too large");
|
|
||||||
std::vector<CharacterFrame> frames;
|
|
||||||
if(!parseCharacterFrames({reinterpret_cast<const char*>(plain.data()),plain.size()},frames,error))return false;
|
|
||||||
SDL_Surface* photo=image(assets,stem+".jpg");
|
|
||||||
SDL_Surface* mask=image(assets,stem+".mask.png");
|
|
||||||
if(!photo || !mask) {
|
|
||||||
if(photo)SDL_DestroySurface(photo);
|
|
||||||
if(mask)SDL_DestroySurface(mask);
|
|
||||||
return fail(error,"character image or mask missing");
|
|
||||||
}
|
|
||||||
SDL_Surface* color=SDL_ConvertSurface(photo,SDL_PIXELFORMAT_RGBA32);
|
|
||||||
SDL_Surface* matte=SDL_ConvertSurface(mask,SDL_PIXELFORMAT_RGBA32);
|
|
||||||
SDL_DestroySurface(photo);SDL_DestroySurface(mask);
|
|
||||||
if(!color || !matte || color->w!=matte->w || color->h!=matte->h) {
|
|
||||||
if(color)SDL_DestroySurface(color);
|
|
||||||
if(matte)SDL_DestroySurface(matte);
|
|
||||||
return fail(error,"character image and mask dimensions differ");
|
|
||||||
}
|
|
||||||
for(const auto& frame:frames)
|
|
||||||
if(frame.x>color->w-frame.w || frame.y>color->h-frame.h) {
|
|
||||||
SDL_DestroySurface(color);SDL_DestroySurface(matte);
|
|
||||||
return fail(error,"character frame outside atlas");
|
|
||||||
}
|
|
||||||
if(!SDL_LockSurface(color)) {SDL_DestroySurface(color);SDL_DestroySurface(matte);return fail(error,"character image lock failed");}
|
|
||||||
if(!SDL_LockSurface(matte)) {SDL_UnlockSurface(color);SDL_DestroySurface(color);SDL_DestroySurface(matte);return fail(error,"character mask lock failed");}
|
|
||||||
for(int y=0;y<color->h;++y) for(int x=0;x<color->w;++x) {
|
|
||||||
auto* pixel=static_cast<Uint8*>(color->pixels)+y*color->pitch+x*4;
|
|
||||||
const auto* coverage=static_cast<const Uint8*>(matte->pixels)+y*matte->pitch+x*4;
|
|
||||||
pixel[3]=coverage[0];
|
|
||||||
}
|
|
||||||
SDL_UnlockSurface(matte);SDL_UnlockSurface(color);
|
|
||||||
SDL_Texture* texture=SDL_CreateTextureFromSurface(renderer,color);
|
|
||||||
SDL_DestroySurface(color);SDL_DestroySurface(matte);
|
|
||||||
if(!texture)return fail(error,"character texture creation failed");
|
|
||||||
SDL_SetTextureBlendMode(texture,SDL_BLENDMODE_BLEND);
|
|
||||||
if(texture_)SDL_DestroyTexture(texture_);
|
|
||||||
texture_=texture;
|
|
||||||
frames_=std::move(frames);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CharacterAtlas::draw(SDL_Renderer* renderer,float x,float y,size_t expression,Uint8 alpha) const {
|
|
||||||
if(!renderer || !texture_ || frames_.empty() || expression>=frames_.size())return false;
|
|
||||||
SDL_SetTextureAlphaMod(texture_,alpha);
|
|
||||||
const auto& base=frames_[0];
|
|
||||||
SDL_FRect src{float(base.x),float(base.y),float(base.w),float(base.h)};
|
|
||||||
SDL_FRect dst{x,y,float(base.w),float(base.h)};
|
|
||||||
if(!SDL_RenderTexture(renderer,texture_,&src,&dst))return false;
|
|
||||||
if(expression==0)return true;
|
|
||||||
const auto& mood=frames_[expression];
|
|
||||||
src={float(mood.x),float(mood.y),float(mood.w),float(mood.h)};
|
|
||||||
dst={x+float(base.regx-mood.regx),y+float(base.regy-mood.regy),
|
|
||||||
float(mood.w),float(mood.h)};
|
|
||||||
return SDL_RenderTexture(renderer,texture_,&src,&dst);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <string>
|
|
||||||
#include <string_view>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
struct CharacterFrame {
|
|
||||||
int x=0, y=0, w=0, h=0, regx=0, regy=0;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Frame 0 is the full portrait; later frames are expressions aligned by regx/regy.
|
|
||||||
bool parseCharacterFrames(std::string_view xml, std::vector<CharacterFrame>& frames,
|
|
||||||
std::string* error=nullptr);
|
|
||||||
|
|
||||||
class CharacterAtlas {
|
|
||||||
public:
|
|
||||||
CharacterAtlas()=default;
|
|
||||||
~CharacterAtlas();
|
|
||||||
CharacterAtlas(const CharacterAtlas&)=delete;
|
|
||||||
CharacterAtlas& operator=(const CharacterAtlas&)=delete;
|
|
||||||
bool load(SDL_Renderer* renderer,const Vfs& assets,std::string_view name,
|
|
||||||
std::string* error=nullptr);
|
|
||||||
bool draw(SDL_Renderer* renderer,float x,float y,size_t expression=0,
|
|
||||||
Uint8 alpha=255) const;
|
|
||||||
const std::vector<CharacterFrame>& frames() const { return frames_; }
|
|
||||||
SDL_Texture* texture() const { return texture_; }
|
|
||||||
private:
|
|
||||||
SDL_Texture* texture_=nullptr;
|
|
||||||
std::vector<CharacterFrame> frames_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,308 +0,0 @@
|
||||||
#include "gfx/draw.h"
|
|
||||||
#include <SDL3_image/SDL_image.h>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
struct Point { float x, y; };
|
|
||||||
struct Edge { Point a, b; };
|
|
||||||
struct Glyph { uint32_t code, offset; float minY, maxY, advance; };
|
|
||||||
|
|
||||||
uint16_t u16(const choco::Bytes& b, size_t p) {
|
|
||||||
return static_cast<uint16_t>(b[p] | (b[p + 1] << 8));
|
|
||||||
}
|
|
||||||
int16_t s16(const choco::Bytes& b, size_t p) { return static_cast<int16_t>(u16(b, p)); }
|
|
||||||
uint32_t u32(const choco::Bytes& b, size_t p) {
|
|
||||||
return static_cast<uint32_t>(b[p]) | (static_cast<uint32_t>(b[p+1]) << 8) |
|
|
||||||
(static_cast<uint32_t>(b[p+2]) << 16) | (static_cast<uint32_t>(b[p+3]) << 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<uint32_t> decodeUtf8(const std::string& text) {
|
|
||||||
std::vector<uint32_t> codes;
|
|
||||||
for (size_t i = 0; i < text.size();) {
|
|
||||||
const auto c = static_cast<unsigned char>(text[i++]);
|
|
||||||
if (c < 0x80) { codes.push_back(c); continue; }
|
|
||||||
const int count = c < 0xe0 ? 1 : c < 0xf0 ? 2 : 3;
|
|
||||||
uint32_t value = c & (count == 1 ? 0x1f : count == 2 ? 0x0f : 0x07);
|
|
||||||
if (i + count > text.size()) { codes.push_back('?'); break; }
|
|
||||||
for (int j = 0; j < count; ++j) value = (value << 6) | (static_cast<unsigned char>(text[i++]) & 0x3f);
|
|
||||||
codes.push_back(value);
|
|
||||||
}
|
|
||||||
return codes;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool mvecTable(const choco::Bytes& b, std::vector<Glyph>& glyphs, float& ascent, float& descent) {
|
|
||||||
if (b.size() < 12 || std::string(reinterpret_cast<const char*>(b.data()), 4) != "MVC4") return false;
|
|
||||||
const uint16_t count = u16(b, 4);
|
|
||||||
if (12 + static_cast<size_t>(count) * 18 > b.size()) return false;
|
|
||||||
ascent = 0; descent = 0;
|
|
||||||
glyphs.reserve(count);
|
|
||||||
for (size_t i = 0; i < count; ++i) {
|
|
||||||
const size_t p = 12 + i * 18;
|
|
||||||
Glyph g{u32(b,p), u32(b,p+14), s16(b,p+8)/128.0f, s16(b,p+10)/128.0f, s16(b,p+12)/128.0f};
|
|
||||||
if (g.offset >= b.size()) return false;
|
|
||||||
if (g.code == 'W') ascent = std::max(0.0f, -g.minY);
|
|
||||||
if (g.code < 128 && g.code != '_') descent = std::max(descent, g.maxY);
|
|
||||||
glyphs.push_back(g);
|
|
||||||
}
|
|
||||||
return ascent > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void glyphEdges(const choco::Bytes& b, uint32_t offset, float penX, float scale, float baseline,
|
|
||||||
std::vector<Edge>& edges) {
|
|
||||||
Point current{};
|
|
||||||
bool active = false;
|
|
||||||
for (size_t p = offset; p < b.size();) {
|
|
||||||
const auto command = b[p++];
|
|
||||||
if (command == 8) break;
|
|
||||||
if (command == 2) { if (p >= b.size()) break; ++p; continue; }
|
|
||||||
if (command != 4 && command != 5 && command != 6) break;
|
|
||||||
const size_t need = command == 6 ? 8 : 4;
|
|
||||||
if (p + need > b.size()) break;
|
|
||||||
auto at = [&](size_t q) -> Point {
|
|
||||||
return {penX + s16(b,q)/128.0f*scale, baseline + s16(b,q+2)/128.0f*scale};
|
|
||||||
};
|
|
||||||
const Point next = at(p + (command == 6 ? 4 : 0));
|
|
||||||
if (command == 4 || !active) { current = next; active = true; }
|
|
||||||
else if (command == 5) { edges.push_back({current,next}); current = next; }
|
|
||||||
else {
|
|
||||||
const Point control = at(p);
|
|
||||||
const float length = std::hypot(next.x-current.x,next.y-current.y) +
|
|
||||||
std::hypot(control.x-current.x,control.y-current.y);
|
|
||||||
const int steps = std::clamp(static_cast<int>(std::ceil(length/3.0f)), 4, 32);
|
|
||||||
Point from = current;
|
|
||||||
for (int i=1; i<=steps; ++i) {
|
|
||||||
const float t = static_cast<float>(i)/steps, a = 1-t;
|
|
||||||
const Point to{a*a*current.x+2*a*t*control.x+t*t*next.x,
|
|
||||||
a*a*current.y+2*a*t*control.y+t*t*next.y};
|
|
||||||
edges.push_back({from,to}); from=to;
|
|
||||||
}
|
|
||||||
current=next;
|
|
||||||
}
|
|
||||||
p += need;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Texture* rasterMvec(SDL_Renderer* renderer, const choco::Bytes& b, const std::string& text,
|
|
||||||
int lineHeight, SDL_Color ink, int outlineSize, SDL_Color outlineInk) {
|
|
||||||
std::vector<Glyph> glyphs;
|
|
||||||
float ascent=0, descent=0;
|
|
||||||
if (!mvecTable(b,glyphs,ascent,descent)) return nullptr;
|
|
||||||
const float scale = lineHeight * 0.8f / std::max(1.0f, ascent+descent);
|
|
||||||
const float baseline = lineHeight*0.15f + ascent*scale;
|
|
||||||
std::vector<Edge> edges;
|
|
||||||
float pen = static_cast<float>(outlineSize+2);
|
|
||||||
for (uint32_t code : decodeUtf8(text)) {
|
|
||||||
auto found = std::find_if(glyphs.begin(),glyphs.end(),[&](const Glyph& g){return g.code==code;});
|
|
||||||
if (found == glyphs.end()) found = std::find_if(glyphs.begin(),glyphs.end(),[](const Glyph& g){return g.code=='?';});
|
|
||||||
if (found == glyphs.end()) continue;
|
|
||||||
glyphEdges(b, found->offset, pen, scale, baseline+outlineSize, edges);
|
|
||||||
pen += found->advance*scale;
|
|
||||||
}
|
|
||||||
const int width = std::max(1, static_cast<int>(std::ceil(pen))+outlineSize+2);
|
|
||||||
const int height = std::max(1, lineHeight+outlineSize*2);
|
|
||||||
SDL_Surface* surface = SDL_CreateSurface(width,height,SDL_PIXELFORMAT_RGBA32);
|
|
||||||
if (!surface) return nullptr;
|
|
||||||
SDL_ClearSurface(surface,0,0,0,0);
|
|
||||||
// Resolve the thin MVEC strokes at subpixel precision. A binary 1x mask
|
|
||||||
// drops parts of Fertigo's smaller (16–20 px) glyphs.
|
|
||||||
constexpr int samples = 3;
|
|
||||||
const int highWidth = width * samples, highHeight = height * samples;
|
|
||||||
std::vector<uint8_t> mask(static_cast<size_t>(highWidth)*highHeight,0);
|
|
||||||
std::vector<Edge> highEdges;
|
|
||||||
highEdges.reserve(edges.size());
|
|
||||||
for (const auto& edge : edges)
|
|
||||||
highEdges.push_back({{edge.a.x*samples,edge.a.y*samples},
|
|
||||||
{edge.b.x*samples,edge.b.y*samples}});
|
|
||||||
for (int y=0; y<highHeight; ++y) {
|
|
||||||
std::vector<float> xs;
|
|
||||||
for (const auto& e : highEdges) {
|
|
||||||
const float scan = y+0.5f;
|
|
||||||
if ((e.a.y<=scan && e.b.y>scan) || (e.b.y<=scan && e.a.y>scan))
|
|
||||||
xs.push_back(e.a.x+(scan-e.a.y)*(e.b.x-e.a.x)/(e.b.y-e.a.y));
|
|
||||||
}
|
|
||||||
std::sort(xs.begin(),xs.end());
|
|
||||||
for (size_t i=0; i+1<xs.size(); i+=2) {
|
|
||||||
const int from=std::max(0,static_cast<int>(std::ceil(xs[i]-0.5f)));
|
|
||||||
const int to=std::min(highWidth,static_cast<int>(std::ceil(xs[i+1]-0.5f)));
|
|
||||||
for (int x=from;x<to;++x) mask[static_cast<size_t>(y)*highWidth+x]=1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::vector<uint8_t> borderMask;
|
|
||||||
if (outlineSize) {
|
|
||||||
borderMask.resize(mask.size(),0);
|
|
||||||
const int radius = outlineSize * samples;
|
|
||||||
for (int y=0; y<highHeight; ++y) for (int x=0; x<highWidth; ++x) {
|
|
||||||
if (mask[static_cast<size_t>(y)*highWidth+x]) continue;
|
|
||||||
bool border = false;
|
|
||||||
for (int dy=-radius;dy<=radius && !border;++dy)
|
|
||||||
for (int dx=-radius;dx<=radius;++dx) {
|
|
||||||
const int nx=x+dx,ny=y+dy;
|
|
||||||
if (dx*dx+dy*dy<=radius*radius && nx>=0 && nx<highWidth && ny>=0 && ny<highHeight &&
|
|
||||||
mask[static_cast<size_t>(ny)*highWidth+nx]) {border=true;break;}
|
|
||||||
}
|
|
||||||
borderMask[static_cast<size_t>(y)*highWidth+x]=border;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SDL_LockSurface(surface);
|
|
||||||
for (int y=0; y<height; ++y) {
|
|
||||||
auto* row = reinterpret_cast<uint32_t*>(static_cast<uint8_t*>(surface->pixels)+y*surface->pitch);
|
|
||||||
for (int x=0; x<width; ++x) {
|
|
||||||
int fillCount=0, borderCount=0;
|
|
||||||
for (int sy=0;sy<samples;++sy) for (int sx=0;sx<samples;++sx) {
|
|
||||||
const size_t at=static_cast<size_t>(y*samples+sy)*highWidth+x*samples+sx;
|
|
||||||
fillCount += mask[at] != 0;
|
|
||||||
if (outlineSize) borderCount += borderMask[at] != 0;
|
|
||||||
}
|
|
||||||
const int fillAlpha=fillCount*ink.a, borderAlpha=borderCount*outlineInk.a;
|
|
||||||
const int totalAlpha=fillAlpha+borderAlpha;
|
|
||||||
if (totalAlpha) {
|
|
||||||
row[x]=SDL_MapSurfaceRGBA(surface,
|
|
||||||
static_cast<uint8_t>((fillAlpha*ink.r+borderAlpha*outlineInk.r)/totalAlpha),
|
|
||||||
static_cast<uint8_t>((fillAlpha*ink.g+borderAlpha*outlineInk.g)/totalAlpha),
|
|
||||||
static_cast<uint8_t>((fillAlpha*ink.b+borderAlpha*outlineInk.b)/totalAlpha),
|
|
||||||
static_cast<uint8_t>(totalAlpha/(samples*samples)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SDL_UnlockSurface(surface);
|
|
||||||
SDL_Texture* texture=SDL_CreateTextureFromSurface(renderer,surface);
|
|
||||||
SDL_DestroySurface(surface);
|
|
||||||
return texture;
|
|
||||||
}
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
Draw::Draw(SDL_Renderer* renderer, const Vfs& assets) : renderer_(renderer), assets_(assets) {
|
|
||||||
ttfReady_ = TTF_Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
Draw::~Draw() {
|
|
||||||
clear();
|
|
||||||
for (auto& [_, font] : sizedFonts_) if (font) TTF_CloseFont(font);
|
|
||||||
if (ttfReady_) TTF_Quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Draw::clear() {
|
|
||||||
for (auto& [_, texture] : textures_) SDL_DestroyTexture(texture);
|
|
||||||
textures_.clear();
|
|
||||||
for (auto& [_, texture] : textTextures_) SDL_DestroyTexture(texture);
|
|
||||||
textTextures_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Texture* Draw::load(const std::string& path) {
|
|
||||||
const auto found = textures_.find(path);
|
|
||||||
if (found != textures_.end()) return found->second;
|
|
||||||
|
|
||||||
Bytes bytes;
|
|
||||||
if (!assets_.read(path, bytes) || bytes.empty()) return nullptr;
|
|
||||||
SDL_IOStream* stream = SDL_IOFromConstMem(bytes.data(), bytes.size());
|
|
||||||
if (!stream) return nullptr;
|
|
||||||
SDL_Surface* surface = IMG_Load_IO(stream, true);
|
|
||||||
if (!surface) return nullptr;
|
|
||||||
SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer_, surface);
|
|
||||||
SDL_DestroySurface(surface);
|
|
||||||
if (!texture) return nullptr;
|
|
||||||
SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_LINEAR);
|
|
||||||
textures_.emplace(path, texture);
|
|
||||||
return texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Draw::image(const std::string& path, const SDL_FRect& destination) {
|
|
||||||
return image(path, nullptr, destination);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Draw::image(const std::string& path, const SDL_FRect* source, const SDL_FRect& destination) {
|
|
||||||
SDL_Texture* texture = load(path);
|
|
||||||
return texture && SDL_RenderTexture(renderer_, texture, source, &destination);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Draw::text(const std::string& utf8, float x, float y, SDL_Color color,
|
|
||||||
int pointSize, float alignWidth, bool center,
|
|
||||||
const std::string& fontName, int outlineSize, SDL_Color outlineColor) {
|
|
||||||
if (utf8.empty()) return true;
|
|
||||||
if (pointSize < 1) pointSize = 1;
|
|
||||||
if (outlineSize < 0) outlineSize = 0;
|
|
||||||
if (fontName.ends_with(".mvec")) {
|
|
||||||
auto it = vectorFonts_.find(fontName);
|
|
||||||
if (it == vectorFonts_.end()) {
|
|
||||||
Bytes bytes;
|
|
||||||
assets_.read(fontName, bytes);
|
|
||||||
it = vectorFonts_.emplace(fontName, std::move(bytes)).first;
|
|
||||||
}
|
|
||||||
if (!it->second.empty()) {
|
|
||||||
std::string key = "mvec:" + fontName + ":" + std::to_string(pointSize) + ":" + utf8;
|
|
||||||
key.append({static_cast<char>(color.r),static_cast<char>(color.g),
|
|
||||||
static_cast<char>(color.b),static_cast<char>(color.a),
|
|
||||||
static_cast<char>(outlineSize),static_cast<char>(outlineColor.r),
|
|
||||||
static_cast<char>(outlineColor.g),static_cast<char>(outlineColor.b),
|
|
||||||
static_cast<char>(outlineColor.a)});
|
|
||||||
SDL_Texture* texture = nullptr;
|
|
||||||
if (auto cached = textTextures_.find(key); cached != textTextures_.end()) texture=cached->second;
|
|
||||||
else {
|
|
||||||
texture=rasterMvec(renderer_,it->second,utf8,pointSize,color,outlineSize,outlineColor);
|
|
||||||
if (texture) textTextures_.emplace(key,texture);
|
|
||||||
}
|
|
||||||
if (texture) {
|
|
||||||
const float left=x+(center?(alignWidth-static_cast<float>(texture->w))/2:0);
|
|
||||||
const SDL_FRect destination{left,y,static_cast<float>(texture->w),static_cast<float>(texture->h)};
|
|
||||||
return SDL_RenderTexture(renderer_,texture,nullptr,&destination);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (warnedVectorFonts_.insert(fontName).second)
|
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_RENDER,"MVC4 font %s failed; using LibreBaskerville fallback",fontName.c_str());
|
|
||||||
}
|
|
||||||
// Bundled OFL fallback for missing or invalid vector fonts.
|
|
||||||
const std::string face = "fonts/LibreBaskerville.ttf";
|
|
||||||
const std::string fontKey = face + ":" + std::to_string(pointSize);
|
|
||||||
TTF_Font* selected = nullptr;
|
|
||||||
if (ttfReady_) {
|
|
||||||
auto it = sizedFonts_.find(fontKey);
|
|
||||||
if (it == sizedFonts_.end()) {
|
|
||||||
const std::string path = std::string(SDL_GetBasePath()) + face;
|
|
||||||
selected = TTF_OpenFont(path.c_str(), static_cast<float>(pointSize));
|
|
||||||
sizedFonts_.emplace(fontKey, selected);
|
|
||||||
} else selected = it->second;
|
|
||||||
}
|
|
||||||
if (selected) {
|
|
||||||
std::string key = fontName + ":" + fontKey + ":" + utf8;
|
|
||||||
key.push_back('\0');
|
|
||||||
key.append({static_cast<char>(color.r), static_cast<char>(color.g),
|
|
||||||
static_cast<char>(color.b), static_cast<char>(color.a)});
|
|
||||||
const auto cachedText = [&](const std::string& cacheKey, SDL_Color ink, int outline) -> SDL_Texture* {
|
|
||||||
if (const auto found = textTextures_.find(cacheKey); found != textTextures_.end()) return found->second;
|
|
||||||
TTF_SetFontOutline(selected, outline);
|
|
||||||
SDL_Surface* surface = TTF_RenderText_Blended(selected, utf8.c_str(), utf8.size(), ink);
|
|
||||||
TTF_SetFontOutline(selected, 0);
|
|
||||||
if (!surface) return nullptr;
|
|
||||||
SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer_, surface);
|
|
||||||
SDL_DestroySurface(surface);
|
|
||||||
if (texture) textTextures_.emplace(cacheKey, texture);
|
|
||||||
return texture;
|
|
||||||
};
|
|
||||||
SDL_Texture* fill = cachedText(key, color, 0);
|
|
||||||
if (!fill) return false;
|
|
||||||
const float left = x + (center ? (alignWidth-static_cast<float>(fill->w))/2 : 0);
|
|
||||||
if (outlineSize > 0) {
|
|
||||||
std::string outlineKey = key + ":outline:" + std::to_string(outlineSize);
|
|
||||||
outlineKey.append({static_cast<char>(outlineColor.r), static_cast<char>(outlineColor.g),
|
|
||||||
static_cast<char>(outlineColor.b), static_cast<char>(outlineColor.a)});
|
|
||||||
SDL_Texture* outline = cachedText(outlineKey, outlineColor, outlineSize);
|
|
||||||
if (outline) {
|
|
||||||
const SDL_FRect border{left-static_cast<float>(outlineSize), y-static_cast<float>(outlineSize),
|
|
||||||
static_cast<float>(outline->w), static_cast<float>(outline->h)};
|
|
||||||
SDL_RenderTexture(renderer_, outline, nullptr, &border);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const SDL_FRect destination{left, y, static_cast<float>(fill->w), static_cast<float>(fill->h)};
|
|
||||||
return SDL_RenderTexture(renderer_, fill, nullptr, &destination);
|
|
||||||
}
|
|
||||||
// Visible fallback when the bundled TrueType font is unavailable.
|
|
||||||
SDL_SetRenderDrawColor(renderer_, color.r, color.g, color.b, color.a);
|
|
||||||
return SDL_RenderDebugText(renderer_, x, y, utf8.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <SDL3_ttf/SDL_ttf.h>
|
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <unordered_set>
|
|
||||||
#include "core/vfs.h"
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
// Image cache and ordered 2D draw calls in the fixed 800x600 coordinate space.
|
|
||||||
class Draw {
|
|
||||||
public:
|
|
||||||
Draw(SDL_Renderer* renderer, const Vfs& assets);
|
|
||||||
~Draw();
|
|
||||||
Draw(const Draw&) = delete;
|
|
||||||
Draw& operator=(const Draw&) = delete;
|
|
||||||
|
|
||||||
SDL_Texture* load(const std::string& path);
|
|
||||||
bool image(const std::string& path, const SDL_FRect& destination);
|
|
||||||
bool image(const std::string& path, const SDL_FRect* source, const SDL_FRect& destination);
|
|
||||||
bool text(const std::string& utf8, float x, float y, SDL_Color color,
|
|
||||||
int pointSize = 16, float alignWidth = 0, bool center = false,
|
|
||||||
const std::string& fontName = "", int outlineSize = 0,
|
|
||||||
SDL_Color outlineColor = {0, 0, 0, 255});
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
private:
|
|
||||||
SDL_Renderer* renderer_;
|
|
||||||
const Vfs& assets_;
|
|
||||||
std::unordered_map<std::string, SDL_Texture*> textures_;
|
|
||||||
std::unordered_map<std::string, SDL_Texture*> textTextures_;
|
|
||||||
std::unordered_map<std::string, Bytes> vectorFonts_;
|
|
||||||
std::unordered_map<std::string, TTF_Font*> sizedFonts_;
|
|
||||||
std::unordered_set<std::string> warnedVectorFonts_;
|
|
||||||
bool ttfReady_ = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,246 +0,0 @@
|
||||||
#include "minigame/chocolate.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cmath>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
namespace choco::minigame {
|
|
||||||
namespace {
|
|
||||||
bool fail(std::string* error,const char* message) {
|
|
||||||
if(error)*error=message;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
float distanceSquared(Point a,Point b) {
|
|
||||||
const float dx=a.x-b.x,dy=a.y-b.y;
|
|
||||||
return dx*dx+dy*dy;
|
|
||||||
}
|
|
||||||
Point pathAt(const std::vector<Point>& path,double phase) {
|
|
||||||
double length=0;
|
|
||||||
for(size_t i=1;i<path.size();++i)length+=std::sqrt(distanceSquared(path[i-1],path[i]));
|
|
||||||
if(length<=0)return path.front();
|
|
||||||
double offset=(phase-std::floor(phase))*length;
|
|
||||||
for(size_t i=1;i<path.size();++i) {
|
|
||||||
const double segment=std::sqrt(distanceSquared(path[i-1],path[i]));
|
|
||||||
if(offset<=segment || i+1==path.size()) {
|
|
||||||
const float t=segment>0?float(std::clamp(offset/segment,0.0,1.0)):0.f;
|
|
||||||
return {path[i-1].x+(path[i].x-path[i-1].x)*t,
|
|
||||||
path[i-1].y+(path[i].y-path[i-1].y)*t};
|
|
||||||
}
|
|
||||||
offset-=segment;
|
|
||||||
}
|
|
||||||
return path.back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ChocolateGame::configure(ChocolateConfig config,std::string* error) {
|
|
||||||
if(config.recipe.empty() || config.recipe.size()>6 ||
|
|
||||||
config.trayPath.size()<2 || config.trayPath.size()>64 ||
|
|
||||||
config.conveyorPath.size()<2 || config.conveyorPath.size()>64 ||
|
|
||||||
config.trayCount<1 || config.trayCount>16 ||
|
|
||||||
config.conveyorCount<1 || config.conveyorCount>32 ||
|
|
||||||
config.trayTimeMs<100 || config.trayTimeMs>300000 ||
|
|
||||||
config.conveyorTimeMs<10 || config.conveyorTimeMs>60000 ||
|
|
||||||
config.gunTimeMs<10 || config.gunTimeMs>10000 ||
|
|
||||||
config.productTimeMs<10 || config.productTimeMs>60000 ||
|
|
||||||
config.countdownMs>10000 || config.gameTimeMs<1000 || config.gameTimeMs>600000 ||
|
|
||||||
config.warningMs>config.gameTimeMs || config.endingMs>30000 ||
|
|
||||||
config.missLimit<1 || config.missLimit>64 ||
|
|
||||||
!std::isfinite(config.hitRadius) || config.hitRadius<1 || config.hitRadius>200 ||
|
|
||||||
config.colorCount<1 || config.colorCount>3 || config.ringTimeMs<1 ||
|
|
||||||
config.recyclerTimeMs<1 || !std::isfinite(config.speedup) ||
|
|
||||||
!std::isfinite(config.maxSpeed) || config.speedup<1 || config.maxSpeed<1 ||
|
|
||||||
config.maxSpeed>32 || (config.recycler && config.recyclerPath.size()<2))
|
|
||||||
return fail(error,"invalid chocolate game settings");
|
|
||||||
for(const auto& name:config.recipe)
|
|
||||||
if(name.empty() || name.size()>64) return fail(error,"invalid recipe ingredient");
|
|
||||||
for(const auto& path:{config.trayPath,config.conveyorPath,config.recyclerPath})
|
|
||||||
for(Point point:path)
|
|
||||||
if(!std::isfinite(point.x) || !std::isfinite(point.y) ||
|
|
||||||
point.x< -200 || point.x>1000 || point.y< -200 || point.y>800)
|
|
||||||
return fail(error,"invalid factory path");
|
|
||||||
config_=std::move(config);
|
|
||||||
configured_=true;phase_=FactoryPhase::Initial;
|
|
||||||
trays_.assign(config_.trayCount,Tray{});
|
|
||||||
for(auto& tray:trays_){tray.slots.assign(config_.recipe.size(),{});tray.colors.assign(config_.recipe.size(),-1);}
|
|
||||||
shots_.clear();products_.clear();conveyor_.clear();rings_.clear();
|
|
||||||
score_=misses_=recycled_=bonusCount_=0;traySpeed_=1;trayPhase_=0;playElapsed_=0;nextIngredient_=0;paused_=false;conveyorReadyMs_=0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChocolateGame::replenish() {
|
|
||||||
if(conveyor_.size()<config_.conveyorCount) {
|
|
||||||
const size_t batch=nextIngredient_/config_.recipe.size();
|
|
||||||
const int color=config_.colorCount==1?0:
|
|
||||||
((config_.rainbow && batch%(config_.colorCount+1)==0)?0:
|
|
||||||
1+int(batch%config_.colorCount));
|
|
||||||
conveyor_.push_back({config_.recipe[nextIngredient_%config_.recipe.size()],color});
|
|
||||||
++nextIngredient_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChocolateGame::start() {
|
|
||||||
if(!configured_)return;
|
|
||||||
score_=misses_=recycled_=bonusCount_=0;traySpeed_=1;trayPhase_=0;playElapsed_=0;nextIngredient_=0;conveyorClock_=0;conveyorReadyMs_=0;
|
|
||||||
countdown_=config_.countdownMs;remaining_=config_.gameTimeMs;ending_=config_.endingMs;
|
|
||||||
paused_=false;shots_.clear();products_.clear();conveyor_.clear();rings_.clear();
|
|
||||||
for(auto& tray:trays_){std::fill(tray.slots.begin(),tray.slots.end(),std::string{});std::fill(tray.colors.begin(),tray.colors.end(),-1);tray.color=-1;tray.full=false;}
|
|
||||||
for(uint32_t i=0;i<config_.conveyorCount;++i)replenish();
|
|
||||||
phase_=countdown_?FactoryPhase::Countdown:FactoryPhase::Playing;
|
|
||||||
}
|
|
||||||
void ChocolateGame::pause(bool paused) {
|
|
||||||
if(phase_==FactoryPhase::Countdown || phase_==FactoryPhase::Playing || phase_==FactoryPhase::Ending)
|
|
||||||
paused_=paused;
|
|
||||||
}
|
|
||||||
void ChocolateGame::abort() {
|
|
||||||
if(phase_!=FactoryPhase::Over && phase_!=FactoryPhase::Initial) {
|
|
||||||
phase_=FactoryPhase::Aborted;ending_=config_.endingMs;paused_=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Point ChocolateGame::trayPosition(size_t index) const {
|
|
||||||
const double phase=trayPhase_+
|
|
||||||
double(index)/config_.trayCount;
|
|
||||||
return pathAt(config_.trayPath,phase);
|
|
||||||
}
|
|
||||||
bool ChocolateGame::fire(Point target) {
|
|
||||||
if(phase_!=FactoryPhase::Playing || paused_ || conveyor_.empty() || conveyorReadyMs_ ||
|
|
||||||
!std::isfinite(target.x) || !std::isfinite(target.y) ||
|
|
||||||
target.x<0 || target.x>800 || target.y<0 || target.y>600)return false;
|
|
||||||
Shot shot;
|
|
||||||
shot.start=config_.conveyorPath.back();shot.target=target;
|
|
||||||
shot.ingredient=std::move(conveyor_.front().name);shot.color=conveyor_.front().color;conveyor_.pop_front();
|
|
||||||
shots_.push_back(std::move(shot));
|
|
||||||
// PopConveyor reduces normalized queue progress by 1/conveyorCount.
|
|
||||||
conveyorReadyMs_=(config_.conveyorTimeMs+config_.conveyorCount-1)/config_.conveyorCount;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
void ChocolateGame::miss() {
|
|
||||||
++misses_;
|
|
||||||
if(misses_>=config_.missLimit)abort();
|
|
||||||
}
|
|
||||||
void ChocolateGame::complete(size_t index,bool bonus) {
|
|
||||||
auto& tray=trays_[index];
|
|
||||||
tray.full=true;
|
|
||||||
products_.push_back({config_.productTimeMs,index});
|
|
||||||
traySpeed_=std::min(config_.maxSpeed,traySpeed_*config_.speedup);
|
|
||||||
if(bonus) {
|
|
||||||
rings_.push_back({trayPosition(index),tray.color,config_.ringTimeMs});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void ChocolateGame::resolveShot(const Shot& shot) {
|
|
||||||
if(config_.recycler) {
|
|
||||||
const Point recycler=pathAt(config_.recyclerPath,double(playElapsed_%config_.recyclerTimeMs)/config_.recyclerTimeMs);
|
|
||||||
if(distanceSquared(shot.target,recycler)<=config_.hitRadius*config_.hitRadius) {++recycled_;return;}
|
|
||||||
}
|
|
||||||
size_t best=trays_.size();
|
|
||||||
float bestDistance=config_.hitRadius*config_.hitRadius;
|
|
||||||
for(size_t i=0;i<trays_.size();++i) {
|
|
||||||
const float d=distanceSquared(shot.target,trayPosition(i));
|
|
||||||
if(d<=bestDistance) {bestDistance=d;best=i;}
|
|
||||||
}
|
|
||||||
if(best==trays_.size() || trays_[best].full){miss();return;}
|
|
||||||
auto& tray=trays_[best];
|
|
||||||
for(size_t i=0;i<config_.recipe.size();++i) {
|
|
||||||
if(config_.recipe[i]==shot.ingredient && tray.slots[i].empty()) {
|
|
||||||
tray.slots[i]=shot.ingredient;
|
|
||||||
tray.colors[i]=shot.color;
|
|
||||||
if(tray.color<0)tray.color=shot.color;
|
|
||||||
else if(shot.color && tray.color && tray.color!=shot.color)tray.color=4;
|
|
||||||
else if(!tray.color && shot.color)tray.color=shot.color;
|
|
||||||
if(std::all_of(tray.slots.begin(),tray.slots.end(),[](const auto& slot){return !slot.empty();})) {
|
|
||||||
const bool colorMatch=tray.color>0 && tray.color<4;
|
|
||||||
complete(best,colorMatch);
|
|
||||||
// ChocolateTrayTask::Animate grants the full bonus when every tray is filled.
|
|
||||||
if(trays_.size()>1 && std::all_of(trays_.begin(),trays_.end(),[](const Tray& t){return t.full;})) {
|
|
||||||
++bonusCount_;
|
|
||||||
score_+=uint32_t(trays_.size());
|
|
||||||
products_.clear(); // each full tray is produced once by the group event
|
|
||||||
for(auto& member:trays_) {
|
|
||||||
member.full=false;member.color=-1;
|
|
||||||
std::fill(member.slots.begin(),member.slots.end(),std::string{});
|
|
||||||
std::fill(member.colors.begin(),member.colors.end(),-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
miss();
|
|
||||||
}
|
|
||||||
void ChocolateGame::advancePlaying(uint32_t ms) {
|
|
||||||
playElapsed_+=ms;
|
|
||||||
trayPhase_+=double(ms)*traySpeed_/config_.trayTimeMs;
|
|
||||||
for(size_t i=0;i<rings_.size();) {
|
|
||||||
if(rings_[i].remainingMs<=ms) {
|
|
||||||
++score_;++bonusCount_; // FlyingRingTask emits 0x3ee on completion.
|
|
||||||
rings_.erase(rings_.begin()+i);
|
|
||||||
}
|
|
||||||
else {rings_[i].remainingMs-=ms;++i;}
|
|
||||||
}
|
|
||||||
conveyorReadyMs_=conveyorReadyMs_>ms?conveyorReadyMs_-ms:0;
|
|
||||||
if(phase_==FactoryPhase::Playing) {
|
|
||||||
conveyorClock_+=ms;
|
|
||||||
while(conveyorClock_>=config_.conveyorTimeMs) {
|
|
||||||
conveyorClock_-=config_.conveyorTimeMs;replenish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(size_t i=0;i<shots_.size();) {
|
|
||||||
shots_[i].age+=ms;
|
|
||||||
if(shots_[i].age>=config_.gunTimeMs) {
|
|
||||||
Shot shot=std::move(shots_[i]);shots_.erase(shots_.begin()+i);
|
|
||||||
resolveShot(shot);
|
|
||||||
} else ++i;
|
|
||||||
}
|
|
||||||
for(size_t i=0;i<products_.size();) {
|
|
||||||
if(products_[i].remaining<=ms) {
|
|
||||||
const size_t tray=products_[i].tray;
|
|
||||||
++score_;
|
|
||||||
trays_[tray].full=false;
|
|
||||||
std::fill(trays_[tray].slots.begin(),trays_[tray].slots.end(),std::string{});
|
|
||||||
std::fill(trays_[tray].colors.begin(),trays_[tray].colors.end(),-1);
|
|
||||||
trays_[tray].color=-1;
|
|
||||||
products_.erase(products_.begin()+i);
|
|
||||||
} else {products_[i].remaining-=ms;++i;}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void ChocolateGame::tick(uint32_t elapsedMs) {
|
|
||||||
if(paused_ || !configured_)return;
|
|
||||||
while(elapsedMs) {
|
|
||||||
if(phase_==FactoryPhase::Countdown) {
|
|
||||||
const uint32_t step=std::min(elapsedMs,countdown_);
|
|
||||||
countdown_-=step;elapsedMs-=step;
|
|
||||||
if(!countdown_)phase_=FactoryPhase::Playing;
|
|
||||||
} else if(phase_==FactoryPhase::Playing) {
|
|
||||||
const uint32_t step=std::min({elapsedMs,remaining_,uint32_t(10)});
|
|
||||||
advancePlaying(step);remaining_-=step;elapsedMs-=step;
|
|
||||||
if(phase_==FactoryPhase::Aborted)continue;
|
|
||||||
if(!remaining_)phase_=FactoryPhase::Ending;
|
|
||||||
} else if(phase_==FactoryPhase::Ending) {
|
|
||||||
const uint32_t step=std::min(elapsedMs,uint32_t(10));
|
|
||||||
advancePlaying(step);elapsedMs-=step;
|
|
||||||
ending_=ending_>step?ending_-step:0;
|
|
||||||
if(!ending_ && shots_.empty() && products_.empty() && rings_.empty())phase_=FactoryPhase::Over;
|
|
||||||
} else if(phase_==FactoryPhase::Aborted) {
|
|
||||||
const uint32_t step=std::min(elapsedMs,ending_);
|
|
||||||
ending_-=step;elapsedMs-=step;
|
|
||||||
if(!ending_)phase_=FactoryPhase::Over;
|
|
||||||
} else return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ChocolateView ChocolateGame::view() const {
|
|
||||||
ChocolateView view;
|
|
||||||
view.phase=phase_;view.countdownRemainingMs=countdown_;view.playRemainingMs=remaining_;
|
|
||||||
view.warning=phase_==FactoryPhase::Playing && remaining_<=config_.warningMs;
|
|
||||||
view.score=score_;view.misses=misses_;view.recycled=recycled_;view.bonusCount=bonusCount_;view.traySpeed=traySpeed_;
|
|
||||||
for(const auto& ingredient:conveyor_) {view.conveyor.push_back(ingredient.name);view.conveyorColors.push_back(ingredient.color);}
|
|
||||||
for(size_t i=0;i<trays_.size();++i)view.trays.push_back({trayPosition(i),trays_[i].slots,trays_[i].full,trays_[i].color,trays_[i].colors});
|
|
||||||
view.rings=rings_;
|
|
||||||
view.recyclerActive=config_.recycler && phase_==FactoryPhase::Playing;
|
|
||||||
if(view.recyclerActive)view.recyclerPosition=pathAt(config_.recyclerPath,double(playElapsed_%config_.recyclerTimeMs)/config_.recyclerTimeMs);
|
|
||||||
for(const auto& shot:shots_) {
|
|
||||||
const float t=std::min(1.f,float(shot.age)/config_.gunTimeMs);
|
|
||||||
view.shots.push_back({shot.start,shot.target,
|
|
||||||
{shot.start.x+(shot.target.x-shot.start.x)*t,
|
|
||||||
shot.start.y+(shot.target.y-shot.start.y)*t},shot.ingredient,shot.color});
|
|
||||||
}
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
} // namespace choco::minigame
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
#include <deque>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco::minigame {
|
|
||||||
|
|
||||||
struct Point { float x=0,y=0; };
|
|
||||||
enum class FactoryPhase { Initial, Countdown, Playing, Ending, Aborted, Over };
|
|
||||||
|
|
||||||
// Snapshot of original Lua product/category fields. The caller resolves product overrides.
|
|
||||||
struct ChocolateConfig {
|
|
||||||
std::vector<std::string> recipe;
|
|
||||||
std::vector<Point> trayPath;
|
|
||||||
std::vector<Point> conveyorPath;
|
|
||||||
uint32_t trayCount=7;
|
|
||||||
uint32_t conveyorCount=5;
|
|
||||||
uint32_t trayTimeMs=30000;
|
|
||||||
uint32_t conveyorTimeMs=1200;
|
|
||||||
uint32_t gunTimeMs=250;
|
|
||||||
uint32_t productTimeMs=3000;
|
|
||||||
uint32_t countdownMs=3000;
|
|
||||||
uint32_t gameTimeMs=60000;
|
|
||||||
uint32_t warningMs=10000;
|
|
||||||
uint32_t endingMs=1000;
|
|
||||||
uint32_t missLimit=8;
|
|
||||||
float hitRadius=34;
|
|
||||||
uint32_t colorCount=1,ringTimeMs=500,recyclerTimeMs=5000;
|
|
||||||
bool rainbow=false,recycler=false;
|
|
||||||
std::vector<Point> recyclerPath;
|
|
||||||
float speedup=1.1f,maxSpeed=8.f;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TrayView {
|
|
||||||
Point position;
|
|
||||||
std::vector<std::string> slots; // empty string means unfilled
|
|
||||||
bool full=false;
|
|
||||||
int color=-1;
|
|
||||||
std::vector<int> slotColors;
|
|
||||||
};
|
|
||||||
struct ShotView { Point start,target,current; std::string ingredient; int color=-1; };
|
|
||||||
struct RingView { Point position; int color=-1; uint32_t remainingMs=0; };
|
|
||||||
struct ChocolateView {
|
|
||||||
FactoryPhase phase=FactoryPhase::Initial;
|
|
||||||
uint32_t countdownRemainingMs=0,playRemainingMs=0;
|
|
||||||
bool warning=false;
|
|
||||||
uint32_t score=0,misses=0;
|
|
||||||
std::vector<std::string> conveyor;
|
|
||||||
std::vector<int> conveyorColors;
|
|
||||||
std::vector<TrayView> trays;
|
|
||||||
std::vector<ShotView> shots;
|
|
||||||
std::vector<RingView> rings;
|
|
||||||
bool recyclerActive=false;
|
|
||||||
Point recyclerPosition;
|
|
||||||
uint32_t recycled=0,bonusCount=0;
|
|
||||||
float traySpeed=1.f;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Deterministic fixed-input simulation; future CoffeeGrid uses the same tick/fire boundary.
|
|
||||||
class ChocolateGame {
|
|
||||||
public:
|
|
||||||
bool configure(ChocolateConfig config,std::string* error=nullptr);
|
|
||||||
void start();
|
|
||||||
void pause(bool paused);
|
|
||||||
void abort();
|
|
||||||
void tick(uint32_t elapsedMs);
|
|
||||||
bool fire(Point target);
|
|
||||||
ChocolateView view() const;
|
|
||||||
FactoryPhase phase() const { return phase_; }
|
|
||||||
uint32_t score() const { return score_; }
|
|
||||||
uint32_t misses() const { return misses_; }
|
|
||||||
bool paused() const { return paused_; }
|
|
||||||
private:
|
|
||||||
struct Tray { std::vector<std::string> slots; std::vector<int> colors; int color=-1; bool full=false; };
|
|
||||||
struct Ingredient { std::string name; int color=0; };
|
|
||||||
struct Shot { Point start,target; std::string ingredient; int color=0; uint32_t age=0; };
|
|
||||||
struct Product { uint32_t remaining=0; size_t tray=0; };
|
|
||||||
void advancePlaying(uint32_t ms);
|
|
||||||
void resolveShot(const Shot& shot);
|
|
||||||
void miss();
|
|
||||||
Point trayPosition(size_t index) const;
|
|
||||||
void replenish();
|
|
||||||
void complete(size_t tray,bool bonus);
|
|
||||||
ChocolateConfig config_;
|
|
||||||
FactoryPhase phase_=FactoryPhase::Initial;
|
|
||||||
bool configured_=false,paused_=false;
|
|
||||||
uint32_t countdown_=0,remaining_=0,ending_=0,conveyorClock_=0;
|
|
||||||
uint32_t conveyorReadyMs_=0;
|
|
||||||
uint64_t playElapsed_=0;
|
|
||||||
uint32_t score_=0,misses_=0;
|
|
||||||
uint32_t recycled_=0,bonusCount_=0;
|
|
||||||
float traySpeed_=1.f;
|
|
||||||
double trayPhase_=0;
|
|
||||||
size_t nextIngredient_=0;
|
|
||||||
std::deque<Ingredient> conveyor_;
|
|
||||||
std::vector<Tray> trays_;
|
|
||||||
std::vector<Shot> shots_;
|
|
||||||
std::vector<Product> products_;
|
|
||||||
std::vector<RingView> rings_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco::minigame
|
|
||||||
|
|
@ -1,141 +0,0 @@
|
||||||
#include "minigame/coffee.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cmath>
|
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
namespace choco::minigame {
|
|
||||||
namespace { bool fail(std::string* error,const char* message){if(error)*error=message;return false;} }
|
|
||||||
bool CoffeeGame::configure(CoffeeConfig config,std::string* error) {
|
|
||||||
if(config.recipe.empty() || config.recipe.size()>6 || config.columns<1 || config.columns>8 ||
|
|
||||||
config.rows<3 || config.rows>12 || config.gridSpeedMs<100 || config.gridSpeedMs>60000 ||
|
|
||||||
config.conveyorCount<1 || config.conveyorCount>32 || config.conveyorTimeMs<10 ||
|
|
||||||
config.conveyorTimeMs>60000 || config.gunTimeMs<10 || config.gunTimeMs>10000 ||
|
|
||||||
config.countdownMs>10000 || config.gameTimeMs<1000 || config.gameTimeMs>600000 ||
|
|
||||||
config.warningMs>config.gameTimeMs || config.endingMs>30000 ||
|
|
||||||
config.missLimit<1 || config.missLimit>64 || config.collectionTimeMs<10 || config.collectionTimeMs>10000 ||
|
|
||||||
!std::isfinite(config.gridX) || !std::isfinite(config.gridY) ||
|
|
||||||
!std::isfinite(config.cellX) || !std::isfinite(config.cellY) ||
|
|
||||||
config.cellX<1 || config.cellY<1 || !std::isfinite(config.speedup) ||
|
|
||||||
!std::isfinite(config.maxSpeed) || config.speedup<1 || config.speedup>8 ||
|
|
||||||
config.maxSpeed<1 || config.maxSpeed>32) return fail(error,"invalid coffee game settings");
|
|
||||||
for(const auto& item:config.recipe)if(item.empty() || item.size()>64)return fail(error,"invalid recipe ingredient");
|
|
||||||
if(config.matchBonus.empty()) config.matchBonus={0,0,0,1,2,2,3,3,4,5};
|
|
||||||
config_=std::move(config);configured_=true;phase_=CoffeePhase::Initial;
|
|
||||||
grid_.assign(config_.columns*config_.rows,{});slotAvailable_.assign(grid_.size(),true);
|
|
||||||
hopper_.assign(config_.recipe.size(),0);
|
|
||||||
shots_.clear();collecting_.clear();conveyor_.clear();score_=misses_=0;return true;
|
|
||||||
}
|
|
||||||
void CoffeeGame::replenish(){if(conveyor_.size()<config_.conveyorCount){conveyor_.push_back(config_.recipe[nextIngredient_%config_.recipe.size()]);++nextIngredient_;}}
|
|
||||||
void CoffeeGame::start(){
|
|
||||||
if(!configured_)return;
|
|
||||||
std::fill(grid_.begin(),grid_.end(),std::string{});std::fill(hopper_.begin(),hopper_.end(),0);
|
|
||||||
shots_.clear();collecting_.clear();conveyor_.clear();score_=misses_=0;nextIngredient_=0;
|
|
||||||
gridClock_=0;conveyorClock_=0;gridScale_=1.f;
|
|
||||||
countdown_=config_.countdownMs;remaining_=config_.gameTimeMs;ending_=config_.endingMs;paused_=false;
|
|
||||||
randomState_=config_.randomSeed?config_.randomSeed:0xC0FFEEu;
|
|
||||||
for(uint32_t i=0;i<config_.conveyorCount;++i)replenish();
|
|
||||||
phase_=countdown_?CoffeePhase::Countdown:CoffeePhase::Playing;
|
|
||||||
}
|
|
||||||
void CoffeeGame::pause(bool value){if(phase_==CoffeePhase::Countdown || phase_==CoffeePhase::Playing || phase_==CoffeePhase::Ending)paused_=value;}
|
|
||||||
void CoffeeGame::abort(){if(phase_!=CoffeePhase::Initial && phase_!=CoffeePhase::Over){phase_=CoffeePhase::Aborted;ending_=config_.endingMs;paused_=false;}}
|
|
||||||
bool CoffeeGame::fire(Point target){
|
|
||||||
if(phase_!=CoffeePhase::Playing || paused_ || conveyor_.empty() ||
|
|
||||||
!std::isfinite(target.x) || !std::isfinite(target.y) || target.x<0 || target.x>800 || target.y<0 || target.y>600)return false;
|
|
||||||
shots_.push_back({target,std::move(conveyor_.front()),0});conveyor_.pop_front();return true;
|
|
||||||
}
|
|
||||||
void CoffeeGame::collect(size_t index){
|
|
||||||
const std::string type=grid_[index];std::queue<size_t> pending;pending.push(index);
|
|
||||||
std::vector<bool> seen(grid_.size(),false);seen[index]=true;std::vector<size_t> group;
|
|
||||||
while(!pending.empty()){
|
|
||||||
const size_t at=pending.front();pending.pop();group.push_back(at);
|
|
||||||
const size_t x=at%config_.columns,y=at/config_.columns;
|
|
||||||
const auto visit=[&](size_t other){if(!seen[other] && grid_[other]==type){seen[other]=true;pending.push(other);}};
|
|
||||||
if(x)visit(at-1);if(x+1<config_.columns)visit(at+1);
|
|
||||||
if(y)visit(at-config_.columns);if(y+1<config_.rows)visit(at+config_.columns);
|
|
||||||
}
|
|
||||||
if(group.size()<3)return;
|
|
||||||
gridScale_=std::min(config_.maxSpeed,gridScale_*config_.speedup);
|
|
||||||
for(size_t at:group){grid_[at].clear();collecting_.push_back({type,config_.collectionTimeMs});}
|
|
||||||
// The original CoffeeFactory::OnMessage indexes its vector by the number collected.
|
|
||||||
const size_t bonusIndex=std::min(group.size(),config_.matchBonus.size()-1);
|
|
||||||
score_+=config_.matchBonus[bonusIndex];
|
|
||||||
}
|
|
||||||
void CoffeeGame::arrive(const std::string& type){
|
|
||||||
// CoffeeHopper::Add selects the least-filled matching recipe position.
|
|
||||||
size_t best=config_.recipe.size();
|
|
||||||
for(size_t i=0;i<config_.recipe.size();++i)
|
|
||||||
if(config_.recipe[i]==type && (best==config_.recipe.size() || hopper_[i]<=hopper_[best]))best=i;
|
|
||||||
if(best<config_.recipe.size())++hopper_[best];
|
|
||||||
while(std::all_of(hopper_.begin(),hopper_.end(),[](uint32_t n){return n>0;})){
|
|
||||||
for(auto& n:hopper_)--n;
|
|
||||||
++score_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void CoffeeGame::resolve(const Shot& shot){
|
|
||||||
const int x=int(std::floor((shot.target.x-config_.gridX)/config_.cellX));
|
|
||||||
const int y=int(std::floor((shot.target.y-config_.gridY)/config_.cellY));
|
|
||||||
if(x<0 || y<0 || x>=int(config_.columns) || y>=int(config_.rows)){
|
|
||||||
if(++misses_>=config_.missLimit)abort();return;
|
|
||||||
}
|
|
||||||
const size_t at=size_t(y)*config_.columns+size_t(x);
|
|
||||||
if(!slotAvailable_[at] || !grid_[at].empty()) {if(++misses_>=config_.missLimit)abort();return;}
|
|
||||||
grid_[at]=shot.ingredient;
|
|
||||||
size_t horizontal=1,vertical=1;
|
|
||||||
for(int xx=x-1;xx>=0 && grid_[size_t(y)*config_.columns+size_t(xx)]==shot.ingredient;--xx)++horizontal;
|
|
||||||
for(uint32_t xx=uint32_t(x)+1;xx<config_.columns && grid_[size_t(y)*config_.columns+xx]==shot.ingredient;++xx)++horizontal;
|
|
||||||
for(int yy=y-1;yy>=0 && grid_[size_t(yy)*config_.columns+size_t(x)]==shot.ingredient;--yy)++vertical;
|
|
||||||
for(uint32_t yy=uint32_t(y)+1;yy<config_.rows && grid_[size_t(yy)*config_.columns+size_t(x)]==shot.ingredient;++yy)++vertical;
|
|
||||||
if(horizontal>=3 || vertical>=3)collect(at);
|
|
||||||
}
|
|
||||||
uint32_t CoffeeGame::nextRandom(){
|
|
||||||
randomState_^=randomState_<<13;randomState_^=randomState_>>17;randomState_^=randomState_<<5;
|
|
||||||
return randomState_;
|
|
||||||
}
|
|
||||||
void CoffeeGame::shift(){
|
|
||||||
for(uint32_t y=config_.rows-1;y>0;--y)
|
|
||||||
for(uint32_t x=0;x<config_.columns;++x)grid_[size_t(y)*config_.columns+x]=std::move(grid_[size_t(y-1)*config_.columns+x]);
|
|
||||||
// CoffeeIngredientGrid::ShiftRows samples RandRange(0, recipe.size()*2):
|
|
||||||
// half of new top-row slots are empty; the rest contain a recipe ingredient.
|
|
||||||
for(uint32_t x=0;x<config_.columns;++x){
|
|
||||||
const size_t pick=nextRandom()%(config_.recipe.size()*2);
|
|
||||||
grid_[x]=pick<config_.recipe.size()?config_.recipe[pick]:std::string{};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void CoffeeGame::advance(uint32_t elapsedMs){
|
|
||||||
for(size_t i=0;i<collecting_.size();){
|
|
||||||
if(collecting_[i].remaining<=elapsedMs){
|
|
||||||
std::string ingredient=std::move(collecting_[i].ingredient);
|
|
||||||
collecting_.erase(collecting_.begin()+i);arrive(ingredient);
|
|
||||||
}else{collecting_[i].remaining-=elapsedMs;++i;}
|
|
||||||
}
|
|
||||||
if(phase_==CoffeePhase::Playing){
|
|
||||||
gridClock_+=double(elapsedMs)*gridScale_;
|
|
||||||
while(gridClock_>=config_.gridSpeedMs){gridClock_-=config_.gridSpeedMs;shift();}
|
|
||||||
conveyorClock_+=elapsedMs;while(conveyorClock_>=config_.conveyorTimeMs){conveyorClock_-=config_.conveyorTimeMs;replenish();}
|
|
||||||
}
|
|
||||||
for(size_t i=0;i<shots_.size();){shots_[i].age+=elapsedMs;if(shots_[i].age>=config_.gunTimeMs){
|
|
||||||
Shot shot=std::move(shots_[i]);shots_.erase(shots_.begin()+i);resolve(shot);
|
|
||||||
}else ++i;}
|
|
||||||
}
|
|
||||||
void CoffeeGame::tick(uint32_t elapsedMs){
|
|
||||||
if(!configured_ || paused_)return;
|
|
||||||
while(elapsedMs){
|
|
||||||
if(phase_==CoffeePhase::Countdown){const uint32_t step=std::min(elapsedMs,countdown_);countdown_-=step;elapsedMs-=step;if(!countdown_)phase_=CoffeePhase::Playing;}
|
|
||||||
else if(phase_==CoffeePhase::Playing){const uint32_t step=std::min({elapsedMs,remaining_,uint32_t(10)});advance(step);remaining_-=step;elapsedMs-=step;if(phase_==CoffeePhase::Aborted)continue;if(!remaining_)phase_=CoffeePhase::Ending;}
|
|
||||||
else if(phase_==CoffeePhase::Ending){const uint32_t step=std::min(elapsedMs,uint32_t(10));advance(step);elapsedMs-=step;ending_=ending_>step?ending_-step:0;if(!ending_ && shots_.empty() && collecting_.empty())phase_=CoffeePhase::Over;}
|
|
||||||
else if(phase_==CoffeePhase::Aborted){const uint32_t step=std::min(elapsedMs,ending_);ending_-=step;elapsedMs-=step;if(!ending_)phase_=CoffeePhase::Over;}
|
|
||||||
else return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CoffeeView CoffeeGame::view() const{
|
|
||||||
CoffeeView result;result.phase=phase_;result.countdownRemainingMs=countdown_;result.playRemainingMs=remaining_;
|
|
||||||
result.warning=phase_==CoffeePhase::Playing && remaining_<=config_.warningMs;
|
|
||||||
result.score=score_;result.misses=misses_;result.grid=grid_;result.slotAvailable=slotAvailable_;
|
|
||||||
result.hopper=hopper_;result.collecting=collecting_.size();result.gridScale=gridScale_;
|
|
||||||
result.conveyor.assign(conveyor_.begin(),conveyor_.end());
|
|
||||||
for(const auto& shot:shots_){const float t=std::min(1.f,float(shot.age)/config_.gunTimeMs);
|
|
||||||
const Point start{283,540};result.shots.push_back({start,shot.target,
|
|
||||||
{start.x+(shot.target.x-start.x)*t,start.y+(shot.target.y-start.y)*t},shot.ingredient});}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "minigame/chocolate.h"
|
|
||||||
#include <cstdint>
|
|
||||||
#include <deque>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace choco::minigame {
|
|
||||||
|
|
||||||
enum class CoffeePhase { Initial, Countdown, Playing, Ending, Aborted, Over };
|
|
||||||
struct CoffeeConfig {
|
|
||||||
std::vector<std::string> recipe;
|
|
||||||
std::vector<uint32_t> matchBonus;
|
|
||||||
uint32_t columns=6,rows=9,gridSpeedMs=5000;
|
|
||||||
uint32_t conveyorCount=5,conveyorTimeMs=1200,gunTimeMs=250;
|
|
||||||
uint32_t countdownMs=3000,gameTimeMs=60000,warningMs=8000,endingMs=1000,missLimit=8;
|
|
||||||
uint32_t collectionTimeMs=250;
|
|
||||||
uint32_t randomSeed=0xC0FFEEu;
|
|
||||||
float speedup=1.1f,maxSpeed=8.f;
|
|
||||||
float gridX=146,gridY=15,cellX=45,cellY=45;
|
|
||||||
};
|
|
||||||
struct CoffeeShot { Point start,target,current;std::string ingredient; };
|
|
||||||
struct CoffeeView {
|
|
||||||
CoffeePhase phase=CoffeePhase::Initial;
|
|
||||||
uint32_t countdownRemainingMs=0,playRemainingMs=0,score=0,misses=0;
|
|
||||||
bool warning=false;
|
|
||||||
std::vector<std::string> grid,conveyor;
|
|
||||||
std::vector<bool> slotAvailable;
|
|
||||||
std::vector<uint32_t> hopper;
|
|
||||||
size_t collecting=0;
|
|
||||||
float gridScale=1.f;
|
|
||||||
std::vector<CoffeeShot> shots;
|
|
||||||
};
|
|
||||||
class CoffeeGame {
|
|
||||||
public:
|
|
||||||
bool configure(CoffeeConfig config,std::string* error=nullptr);
|
|
||||||
void start();
|
|
||||||
void tick(uint32_t elapsedMs);
|
|
||||||
bool fire(Point target);
|
|
||||||
void pause(bool value);
|
|
||||||
void abort();
|
|
||||||
CoffeeView view() const;
|
|
||||||
CoffeePhase phase() const{return phase_;}
|
|
||||||
uint32_t score() const{return score_;}
|
|
||||||
uint32_t misses() const{return misses_;}
|
|
||||||
private:
|
|
||||||
struct Shot {Point target;std::string ingredient;uint32_t age=0;};
|
|
||||||
struct Collection {std::string ingredient;uint32_t remaining=0;};
|
|
||||||
void advance(uint32_t elapsedMs);
|
|
||||||
void resolve(const Shot& shot);
|
|
||||||
void collect(size_t index);
|
|
||||||
void arrive(const std::string& ingredient);
|
|
||||||
void replenish();
|
|
||||||
void shift();
|
|
||||||
uint32_t nextRandom();
|
|
||||||
CoffeeConfig config_;
|
|
||||||
CoffeePhase phase_=CoffeePhase::Initial;
|
|
||||||
bool configured_=false,paused_=false;
|
|
||||||
uint32_t countdown_=0,remaining_=0,ending_=0,conveyorClock_=0;
|
|
||||||
double gridClock_=0;
|
|
||||||
float gridScale_=1.f;
|
|
||||||
uint32_t score_=0,misses_=0;
|
|
||||||
size_t nextIngredient_=0;
|
|
||||||
uint32_t randomState_=0;
|
|
||||||
std::vector<std::string> grid_;
|
|
||||||
std::vector<bool> slotAvailable_;
|
|
||||||
std::vector<uint32_t> hopper_;
|
|
||||||
std::deque<std::string> conveyor_;
|
|
||||||
std::vector<Shot> shots_;
|
|
||||||
std::vector<Collection> collecting_;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
#include "platform/display.h"
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
Display::~Display() {
|
|
||||||
if (renderer_) SDL_DestroyRenderer(renderer_);
|
|
||||||
if (window_) SDL_DestroyWindow(window_);
|
|
||||||
if (videoReady_) SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Display::open(const char* title, int width, int height, std::string* error) {
|
|
||||||
if (!SDL_InitSubSystem(SDL_INIT_VIDEO)) {
|
|
||||||
if (error) *error = SDL_GetError();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
videoReady_ = true;
|
|
||||||
window_ = SDL_CreateWindow(title, width, height, SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY);
|
|
||||||
if (window_) renderer_ = SDL_CreateRenderer(window_, nullptr);
|
|
||||||
if (!renderer_ || !SDL_SetRenderLogicalPresentation(renderer_, 800, 600,
|
|
||||||
SDL_LOGICAL_PRESENTATION_LETTERBOX)) {
|
|
||||||
if (error) *error = SDL_GetError();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
SDL_SetRenderVSync(renderer_, 1);
|
|
||||||
// Keep the cursor independent of the VSync-bound render loop. Drawing it
|
|
||||||
// into each frame makes it visibly lag the physical pointer at low FPS.
|
|
||||||
if (!SDL_ShowCursor()) {
|
|
||||||
if (error) *error = SDL_GetError();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Display::poll(Event& out) {
|
|
||||||
SDL_Event event;
|
|
||||||
while (SDL_PollEvent(&event)) {
|
|
||||||
switch (event.type) {
|
|
||||||
case SDL_EVENT_QUIT: out.type = Event::Type::Quit; return true;
|
|
||||||
case SDL_EVENT_MOUSE_MOTION:
|
|
||||||
SDL_ConvertEventToRenderCoordinates(renderer_, &event);
|
|
||||||
out = {Event::Type::MouseMove, event.motion.x, event.motion.y}; return true;
|
|
||||||
case SDL_EVENT_MOUSE_BUTTON_DOWN:
|
|
||||||
case SDL_EVENT_MOUSE_BUTTON_UP:
|
|
||||||
SDL_ConvertEventToRenderCoordinates(renderer_, &event);
|
|
||||||
out = {event.type == SDL_EVENT_MOUSE_BUTTON_DOWN ? Event::Type::MouseDown : Event::Type::MouseUp,
|
|
||||||
event.button.x, event.button.y, event.button.button}; return true;
|
|
||||||
case SDL_EVENT_KEY_DOWN:
|
|
||||||
case SDL_EVENT_KEY_UP:
|
|
||||||
out = {event.type == SDL_EVENT_KEY_DOWN ? Event::Type::KeyDown : Event::Type::KeyUp};
|
|
||||||
out.key = event.key.key; return true;
|
|
||||||
case SDL_EVENT_TEXT_INPUT:
|
|
||||||
out = {Event::Type::TextInput};
|
|
||||||
out.text = event.text.text;
|
|
||||||
return true;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Display::beginFrame() {
|
|
||||||
SDL_SetRenderDrawColor(renderer_, 0, 0, 0, 255);
|
|
||||||
SDL_RenderClear(renderer_);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Display::endFrame() {
|
|
||||||
SDL_RenderPresent(renderer_);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
|
|
||||||
struct Event {
|
|
||||||
enum class Type { Quit, MouseMove, MouseDown, MouseUp, KeyDown, KeyUp, TextInput } type;
|
|
||||||
float x = 0;
|
|
||||||
float y = 0;
|
|
||||||
Uint8 button = 0;
|
|
||||||
SDL_Keycode key = SDLK_UNKNOWN;
|
|
||||||
std::string text;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Display {
|
|
||||||
public:
|
|
||||||
Display() = default;
|
|
||||||
~Display();
|
|
||||||
Display(const Display&) = delete;
|
|
||||||
Display& operator=(const Display&) = delete;
|
|
||||||
|
|
||||||
bool open(const char* title, int width = 800, int height = 600,
|
|
||||||
std::string* error = nullptr);
|
|
||||||
bool poll(Event& out);
|
|
||||||
void beginFrame();
|
|
||||||
void endFrame();
|
|
||||||
SDL_Renderer* renderer() const { return renderer_; }
|
|
||||||
SDL_Window* window() const { return window_; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
SDL_Window* window_ = nullptr;
|
|
||||||
SDL_Renderer* renderer_ = nullptr;
|
|
||||||
bool videoReady_ = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,240 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include "core/string_table.h"
|
|
||||||
#include "minigame/chocolate.h"
|
|
||||||
#include "minigame/coffee.h"
|
|
||||||
|
|
||||||
struct lua_State;
|
|
||||||
|
|
||||||
namespace choco {
|
|
||||||
struct SaveValue;
|
|
||||||
|
|
||||||
struct SimState {
|
|
||||||
std::string name;
|
|
||||||
std::string portName;
|
|
||||||
int time = 0;
|
|
||||||
double money = 0;
|
|
||||||
int portCount = 0;
|
|
||||||
int ingredientCount = 0;
|
|
||||||
int productCount = 0;
|
|
||||||
int questCount = 0;
|
|
||||||
int visitedPortCount = 0;
|
|
||||||
float mapX = 0;
|
|
||||||
float mapY = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PortObject {
|
|
||||||
std::string name;
|
|
||||||
std::string type;
|
|
||||||
std::string kind; // resolved Lua class when type is inherited as generic
|
|
||||||
std::string image;
|
|
||||||
std::string displayCharacter;
|
|
||||||
float x = 0;
|
|
||||||
float y = 0;
|
|
||||||
float layer = 0;
|
|
||||||
std::vector<std::string> inventory;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TravelPort {
|
|
||||||
std::string name;
|
|
||||||
std::string availability;
|
|
||||||
float mapX = 0;
|
|
||||||
float mapY = 0;
|
|
||||||
int weeks = 0;
|
|
||||||
double cost = 0;
|
|
||||||
};
|
|
||||||
struct QuestOffer {
|
|
||||||
std::string name;
|
|
||||||
std::string character;
|
|
||||||
std::string building;
|
|
||||||
std::string accept;
|
|
||||||
std::string defer;
|
|
||||||
std::string reject;
|
|
||||||
};
|
|
||||||
struct PendingDialog {
|
|
||||||
std::string script;
|
|
||||||
std::string character;
|
|
||||||
std::string text;
|
|
||||||
std::string quest;
|
|
||||||
std::string building;
|
|
||||||
bool requiresResponse = false;
|
|
||||||
};
|
|
||||||
struct BuildingQuestEvent {
|
|
||||||
std::string offered;
|
|
||||||
std::vector<std::string> completed;
|
|
||||||
};
|
|
||||||
struct InventoryItem {
|
|
||||||
std::string code;
|
|
||||||
int count = 0;
|
|
||||||
bool isProduct = false;
|
|
||||||
std::string image;
|
|
||||||
};
|
|
||||||
struct FactoryProduction {
|
|
||||||
std::string productCode;
|
|
||||||
int weeklyCount = 0;
|
|
||||||
};
|
|
||||||
struct DeliveryDetails {
|
|
||||||
std::string productCode;
|
|
||||||
int count = 0;
|
|
||||||
double price = 0;
|
|
||||||
std::string endBuilding;
|
|
||||||
std::string endPort;
|
|
||||||
int expires = 0;
|
|
||||||
};
|
|
||||||
struct RecipeIngredient {
|
|
||||||
std::string code;
|
|
||||||
int count = 0;
|
|
||||||
};
|
|
||||||
struct RecipeInfo {
|
|
||||||
std::string code;
|
|
||||||
std::string category;
|
|
||||||
std::string name;
|
|
||||||
std::string description;
|
|
||||||
std::string machinery;
|
|
||||||
bool known = false;
|
|
||||||
std::vector<RecipeIngredient> ingredients;
|
|
||||||
};
|
|
||||||
struct RecipeBookCategory {
|
|
||||||
std::string name;
|
|
||||||
std::vector<RecipeInfo> products;
|
|
||||||
};
|
|
||||||
struct ChocolateFactorySetup {
|
|
||||||
std::string factory;
|
|
||||||
std::string port;
|
|
||||||
std::string productCode;
|
|
||||||
std::string machineImage;
|
|
||||||
int colorCount = 1;
|
|
||||||
bool recycler = false;
|
|
||||||
bool rainbow = false;
|
|
||||||
minigame::ChocolateConfig game;
|
|
||||||
};
|
|
||||||
struct CoffeeFactorySetup {
|
|
||||||
std::string factory;
|
|
||||||
std::string port;
|
|
||||||
std::string productCode;
|
|
||||||
minigame::CoffeeConfig game;
|
|
||||||
std::vector<minigame::Point> conveyorPath;
|
|
||||||
uint32_t productTimeMs = 3000;
|
|
||||||
uint32_t productSpacingMs = 1500;
|
|
||||||
};
|
|
||||||
struct ShopProduct {
|
|
||||||
std::string code;
|
|
||||||
std::string category;
|
|
||||||
int count = 0;
|
|
||||||
double price = 0;
|
|
||||||
};
|
|
||||||
struct KitchenIngredient {
|
|
||||||
std::string code;
|
|
||||||
std::string category;
|
|
||||||
};
|
|
||||||
struct KitchenState {
|
|
||||||
int customSlots = 0;
|
|
||||||
int usedSlots = 0;
|
|
||||||
std::vector<std::string> unlockedCategories;
|
|
||||||
std::vector<KitchenIngredient> ingredients;
|
|
||||||
};
|
|
||||||
struct CustomRecipeLayer {
|
|
||||||
std::string image;
|
|
||||||
int red = 255;
|
|
||||||
int green = 255;
|
|
||||||
int blue = 255;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Headless bridge to the game's Lua simulation and installed data files.
|
|
||||||
class GameSim {
|
|
||||||
public:
|
|
||||||
GameSim() = default;
|
|
||||||
~GameSim();
|
|
||||||
GameSim(const GameSim&) = delete;
|
|
||||||
GameSim& operator=(const GameSim&) = delete;
|
|
||||||
|
|
||||||
bool load(const std::filesystem::path& luaRoot, const Vfs& assets, std::string& error);
|
|
||||||
void setStringTable(const StringTable& strings) { strings_ = strings; }
|
|
||||||
// Adapted opening balance; the original tutorial starts at zero and awards money later.
|
|
||||||
bool newGame(const std::string& name, std::string& error, double startingCash = 1000);
|
|
||||||
bool run(const std::string& source, std::string& error);
|
|
||||||
bool buyIngredient(const std::string& name, int quantity, std::string& error);
|
|
||||||
int ingredientInventory(const std::string& name) const;
|
|
||||||
double ingredientPrice(const std::string& name) const;
|
|
||||||
std::vector<TravelPort> ports() const;
|
|
||||||
bool travelTo(const std::string& destination, std::string& error);
|
|
||||||
bool travelEncounterPending() const;
|
|
||||||
bool offerQuest(const std::string& name, std::string& error);
|
|
||||||
bool acceptQuest(const std::string& name, std::string& error);
|
|
||||||
bool deferQuest(const std::string& name, int weeks, std::string& error);
|
|
||||||
bool rejectQuest(const std::string& name, std::string& error);
|
|
||||||
bool questEligible(const std::string& name) const;
|
|
||||||
bool interactBuilding(const std::string& building, BuildingQuestEvent& event, std::string& error);
|
|
||||||
std::vector<InventoryItem> inventoryItems() const;
|
|
||||||
std::vector<ShopProduct> shopProducts(const std::string& shopName) const;
|
|
||||||
KitchenState kitchenState() const;
|
|
||||||
FactoryProduction factoryProduction(const std::string& factory) const;
|
|
||||||
DeliveryDetails deliveryDetails(const std::string& name) const;
|
|
||||||
std::vector<RecipeBookCategory> recipes() const;
|
|
||||||
bool chocolateFactorySetup(const std::string& factory, const std::string& productCode,
|
|
||||||
ChocolateFactorySetup& setup, std::string& error) const;
|
|
||||||
bool coffeeFactorySetup(const std::string& factory, const std::string& productCode,
|
|
||||||
CoffeeFactorySetup& setup, std::string& error) const;
|
|
||||||
QuestOffer questOffer() const { return questOffer_; }
|
|
||||||
std::vector<PendingDialog> takePendingDialogs();
|
|
||||||
std::vector<std::string> takeSoundEvents();
|
|
||||||
bool completeQuest(const std::string& name, std::string& error);
|
|
||||||
bool completeQuestAt(const std::string& name, const std::string& building, std::string& error);
|
|
||||||
bool setFactoryProduction(const std::string& factory, const std::string& product, int weeklyCount, std::string& error);
|
|
||||||
int productInventory(const std::string& code) const;
|
|
||||||
bool sellProduct(const std::string& code, int quantity, std::string& error);
|
|
||||||
bool sellProduct(const std::string& shopName, const std::string& code, int quantity, std::string& error);
|
|
||||||
bool isRecipeKnown(const std::string& code) const;
|
|
||||||
double machineryCost(const std::string& productCode) const;
|
|
||||||
bool isMachineryEquipped(const std::string& factory, const std::string& productCode) const;
|
|
||||||
bool purchaseMachinery(const std::string& factory, const std::string& productCode, std::string& error);
|
|
||||||
bool createCustomRecipe(const std::string& name, const std::string& description,
|
|
||||||
const std::string& category, const std::vector<std::string>& ingredients,
|
|
||||||
std::string& productCode, std::string& error);
|
|
||||||
bool createCustomRecipe(const std::string& name, const std::string& description,
|
|
||||||
const std::string& category, const std::vector<std::string>& ingredients,
|
|
||||||
const std::vector<CustomRecipeLayer>& appearance,
|
|
||||||
std::string& productCode, std::string& error);
|
|
||||||
bool advanceWeek(std::string& error);
|
|
||||||
bool saveGame(const std::filesystem::path& path, std::string& error);
|
|
||||||
bool loadGame(const std::filesystem::path& path, std::string& error);
|
|
||||||
std::string questStatus(const std::string& name) const;
|
|
||||||
std::string questIntro(const std::string& name) const;
|
|
||||||
const std::string& offeredQuest() const { return offeredQuest_; }
|
|
||||||
SimState state() const;
|
|
||||||
std::vector<PortObject> buildings() const;
|
|
||||||
// Read-only building snapshot for a named port; does not travel or mutate Player.
|
|
||||||
std::vector<PortObject> portBuildings(const std::string& portName) const;
|
|
||||||
std::vector<PortObject> sprites() const;
|
|
||||||
// Borrowed VM for the UI runtime; invalidated by loadGame or destruction.
|
|
||||||
lua_State* luaState() const { return L_; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
static int localizedString(lua_State* L);
|
|
||||||
static int requireFile(lua_State* L);
|
|
||||||
static int displayDialog(lua_State* L);
|
|
||||||
static int soundEvent(lua_State* L);
|
|
||||||
bool file(const std::string& relative, std::string& error);
|
|
||||||
bool data(const Vfs& assets, const std::string& fileName,
|
|
||||||
const std::string& element, const std::string& constructor,
|
|
||||||
std::string& error);
|
|
||||||
lua_State* L_ = nullptr;
|
|
||||||
const Vfs* assets_ = nullptr;
|
|
||||||
std::filesystem::path luaRoot_;
|
|
||||||
std::string offeredQuest_;
|
|
||||||
QuestOffer questOffer_;
|
|
||||||
std::vector<PendingDialog> pendingDialogs_;
|
|
||||||
std::vector<std::string> soundEvents_;
|
|
||||||
StringTable strings_;
|
|
||||||
std::vector<PortObject> portObjects(const std::string& portName, const char* field) const;
|
|
||||||
bool questMethod(const std::string& name, const char* method, std::string& error);
|
|
||||||
bool questBool(const std::string& name, const char* method, std::string& error) const;
|
|
||||||
bool applyPlayerSave(const SaveValue& player, std::string& error);
|
|
||||||
void bindContext();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace choco
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
#include "audio/audio.h"
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x); std::exit(1); } } while(0)
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::string error;
|
|
||||||
auto assets = choco::openVfs(CHOCO_PFP, &error);
|
|
||||||
CHECK(assets != nullptr);
|
|
||||||
auto looseAssets = choco::openVfs(CHOCO_ASSET_DIR, &error);
|
|
||||||
CHECK(looseAssets != nullptr);
|
|
||||||
choco::Bytes bytes;
|
|
||||||
int decodedAssets = 0;
|
|
||||||
for (const auto& path : assets->list()) {
|
|
||||||
if (!path.ends_with(".ogg")) continue;
|
|
||||||
choco::Bytes candidate;
|
|
||||||
choco::DecodedSound decodedCandidate;
|
|
||||||
CHECK(assets->read(path, candidate));
|
|
||||||
CHECK(choco::decodeOgg(candidate, decodedCandidate, &error));
|
|
||||||
CHECK(!decodedCandidate.samples.empty());
|
|
||||||
++decodedAssets;
|
|
||||||
}
|
|
||||||
CHECK(decodedAssets == 12);
|
|
||||||
choco::Bytes clickBytes;
|
|
||||||
CHECK(looseAssets->read("cadi/ui_click.ogg", clickBytes));
|
|
||||||
choco::DecodedSound click;
|
|
||||||
CHECK(choco::decodeOgg(clickBytes, click, &error));
|
|
||||||
CHECK(assets->read("sfx/main_rollover.ogg", bytes));
|
|
||||||
CHECK(bytes.size() > 100);
|
|
||||||
choco::DecodedSound sound;
|
|
||||||
CHECK(choco::decodeOgg(bytes, sound, &error));
|
|
||||||
CHECK(sound.sampleRate >= 8000 && sound.sampleRate <= 192000);
|
|
||||||
CHECK(sound.channels == 1 || sound.channels == 2);
|
|
||||||
CHECK(sound.samples.size() > 1000);
|
|
||||||
choco::DecodedSound unchanged = sound;
|
|
||||||
const uint8_t invalid[] = {'O','g','g','S',0,1,2,3};
|
|
||||||
CHECK(!choco::decodeOgg(invalid, sound, &error));
|
|
||||||
CHECK(sound.samples == unchanged.samples);
|
|
||||||
CHECK(!choco::decodeOgg(std::span<const uint8_t>(bytes.data(), bytes.size()/4), sound, &error));
|
|
||||||
CHECK(sound.samples == unchanged.samples);
|
|
||||||
CHECK(SDL_SetHint(SDL_HINT_AUDIO_DRIVER, "dummy"));
|
|
||||||
choco::Audio audio(*assets, looseAssets.get());
|
|
||||||
CHECK(audio.playEvent("main_rollover", &error));
|
|
||||||
CHECK(audio.active());
|
|
||||||
CHECK(audio.playEvent("ui_click", &error));
|
|
||||||
CHECK(audio.active());
|
|
||||||
CHECK(audio.playEvent("Stop_Music", &error));
|
|
||||||
CHECK(audio.sfxActive());
|
|
||||||
CHECK(!audio.playEvent("../bad", &error));
|
|
||||||
CHECK(audio.playEvent("buy", &error)); // resolved through the CADI bank
|
|
||||||
CHECK(audio.sfxActive());
|
|
||||||
CHECK(audio.playEvent("main_menu", &error)); // single-clip CADI arrangement
|
|
||||||
CHECK(audio.musicActive() && audio.sfxActive());
|
|
||||||
CHECK(audio.playEvent("Stop_Environments", &error));
|
|
||||||
CHECK(audio.musicActive() && audio.sfxActive());
|
|
||||||
CHECK(audio.playEvent("Stop_Music", &error));
|
|
||||||
CHECK(!audio.musicActive() && audio.sfxActive());
|
|
||||||
CHECK(!audio.playEvent("zurich_sting", &error)); // layered arrangement unresolved
|
|
||||||
CHECK(audio.playEvent("travel_plane", &error));
|
|
||||||
CHECK(audio.sfxActive());
|
|
||||||
CHECK(audio.playEvent("Stop_travel_plane", &error));
|
|
||||||
CHECK(!audio.sfxActive());
|
|
||||||
audio.stop();
|
|
||||||
CHECK(!audio.active());
|
|
||||||
std::puts("audio: Ogg Vorbis decode and SDL dummy playback passed");
|
|
||||||
}
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
#include "audio/cadi_bank.h"
|
|
||||||
#include "audio/audio.h"
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x); std::exit(1); } } while(0)
|
|
||||||
static void put32(choco::Bytes& data,size_t at,uint32_t value) {
|
|
||||||
for (int i=0;i<4;++i) data[at+i]=uint8_t(value >> (8*i));
|
|
||||||
}
|
|
||||||
int main() {
|
|
||||||
// Small synthetic fixture exercises the index and both payload kinds.
|
|
||||||
choco::Bytes fixture(74,0);
|
|
||||||
put32(fixture,8,0xddfefdc8u);put32(fixture,12,2);
|
|
||||||
put32(fixture,32,1);put32(fixture,40,4);put32(fixture,44,64);
|
|
||||||
put32(fixture,48,2);put32(fixture,56,6);put32(fixture,60,68);
|
|
||||||
std::memcpy(fixture.data()+64,"OggS",4);
|
|
||||||
std::memcpy(fixture.data()+68,"<?xml ",6);
|
|
||||||
choco::CadiBank bank;std::string error;
|
|
||||||
CHECK(bank.load(fixture,&error));
|
|
||||||
CHECK(bank.records().size()==2);
|
|
||||||
CHECK(bank.records()[0].kind==choco::CadiKind::OggVorbis);
|
|
||||||
CHECK(bank.records()[1].kind==choco::CadiKind::Xml);
|
|
||||||
CHECK(bank.data(0).size()==4 && bank.data(2).empty());
|
|
||||||
auto bad=fixture;put32(bad,60,69);
|
|
||||||
CHECK(!bank.load(bad,&error));CHECK(bank.records().size()==2);
|
|
||||||
bad=fixture;put32(bad,12,10001);CHECK(!bank.load(bad,&error));
|
|
||||||
bad=fixture;bad[64]='X';CHECK(!bank.load(bad,&error));
|
|
||||||
bad=fixture;bad.pop_back();CHECK(!bank.load(bad,&error));
|
|
||||||
|
|
||||||
choco::Bytes real;
|
|
||||||
CHECK(choco::readFile(CHOCO_CAD,real));
|
|
||||||
CHECK(bank.load(std::move(real),&error));
|
|
||||||
CHECK(bank.records().size()==177);
|
|
||||||
int ogg=0,xml=0;
|
|
||||||
for(size_t i=0;i<bank.records().size();++i) {
|
|
||||||
if(bank.records()[i].kind==choco::CadiKind::Xml) {++xml;continue;}
|
|
||||||
++ogg;
|
|
||||||
if(i==0 || i==bank.records().size()-1) {
|
|
||||||
choco::DecodedSound sound;
|
|
||||||
CHECK(choco::decodeOgg(bank.data(i),sound,&error));
|
|
||||||
CHECK(!sound.samples.empty());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CHECK(ogg==175 && xml==2);
|
|
||||||
CHECK(bank.mappedEventCount()>=175);
|
|
||||||
CHECK(bank.clipForEvent("buy")==157);
|
|
||||||
CHECK(bank.clipForEvent("sell")==158);
|
|
||||||
CHECK(bank.clipForEvent("quest_complete")==123);
|
|
||||||
CHECK(bank.clipForEvent("travel_plane")==148);
|
|
||||||
CHECK(bank.clipForEvent("main_menu")==117); // arrangement SoundList -> TrackPlayer -> Ogg
|
|
||||||
CHECK(bank.eventInfo("main_menu")->channel==choco::CadiChannel::Music);
|
|
||||||
CHECK(bank.eventInfo("main_menu")->loop);
|
|
||||||
CHECK(bank.eventInfo("buy")->channel==choco::CadiChannel::Sfx);
|
|
||||||
CHECK(bank.eventInfo("zurich")->channel==choco::CadiChannel::Environment);
|
|
||||||
CHECK(!bank.clipForEvent("zurich_sting")); // layered arrangement needs a mixer
|
|
||||||
CHECK(bank.clipsForEvent("zurich_sting").size()==4);
|
|
||||||
CHECK(bank.clipsForEvent("map_screen").size()==2);
|
|
||||||
CHECK(bank.clipsForEvent("zurich").size()==6);
|
|
||||||
std::printf("CADI: 177 records, 175 Ogg, 2 XML, %zu mapped event nodes\n",
|
|
||||||
bank.mappedEventCount());
|
|
||||||
}
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
#include "ui/casino_ui.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
struct Hit {float x=0,y=0;bool found=false;};
|
|
||||||
Hit find(const choco::MenuNode& node,const std::string& type,const std::string& needle,
|
|
||||||
float ox=0,float oy=0) {
|
|
||||||
const float x=ox+node.x,y=oy+node.y;
|
|
||||||
bool match=node.name.find(needle)!=std::string::npos || node.label.find(needle)!=std::string::npos;
|
|
||||||
for(const auto& graphic:node.graphics) match|=graphic.find(needle)!=std::string::npos;
|
|
||||||
if(node.type==type && match) return {x+(node.w>0?node.w*.5f:25.f),
|
|
||||||
y+(node.h>0?node.h*.5f:20.f),true};
|
|
||||||
for(const auto& child:node.children)
|
|
||||||
if(auto hit=find(child,type,needle,x,y);hit.found) return hit;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
bool click(choco::CasinoUi& casino,const std::string& type,const std::string& needle) {
|
|
||||||
auto hit=find(casino.menu().dialogRoot(),type,needle);
|
|
||||||
if(!hit.found) return false;
|
|
||||||
casino.mouseMove(hit.x,hit.y);casino.mouseDown(hit.x,hit.y);casino.mouseUp(hit.x,hit.y);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::string error;
|
|
||||||
auto assets=choco::openVfs(CHOCO_PFP,&error);
|
|
||||||
choco::Bytes bytes;
|
|
||||||
if(!assets || !choco::readFile(CHOCO_STRINGS,bytes)) return 1;
|
|
||||||
choco::StringTable strings;
|
|
||||||
if(!strings.loadXml(std::string_view(reinterpret_cast<const char*>(bytes.data()),bytes.size()),&error)) return 1;
|
|
||||||
choco::GameSim sim;
|
|
||||||
sim.setStringTable(strings);
|
|
||||||
const auto luaRoot=choco::pathFromUtf8(CHOCO_LUA_SRC);
|
|
||||||
if(!sim.load(luaRoot,*assets,error) || !sim.newGame("Casino Test",error)) {
|
|
||||||
std::fprintf(stderr,"sim: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
choco::CasinoUi casino(*assets,strings);
|
|
||||||
if(!sim.run("SlotMachine=function(t) return t end; __casinoPaidOut='prior'",error)) return 1;
|
|
||||||
if(!casino.open(sim,luaRoot,"hav_casino",error)) {
|
|
||||||
std::fprintf(stderr,"casino open: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
const double before=sim.state().money;
|
|
||||||
if(!find(casino.menu().dialogRoot(),"Window","slotselect").found ||
|
|
||||||
!click(casino,"Button","$") ||
|
|
||||||
!find(casino.menu().dialogRoot(),"Bitmap","slotmachine").found ||
|
|
||||||
!click(casino,"Button","pull") || !casino.spinning() ||
|
|
||||||
sim.state().money>=before) {
|
|
||||||
std::fprintf(stderr,"slot machine route/spin: %s money=%g\n",casino.menu().status().c_str(),sim.state().money);return 1;
|
|
||||||
}
|
|
||||||
casino.tick(1800);
|
|
||||||
const double afterSpin=sim.state().money;
|
|
||||||
casino.tick(3000);
|
|
||||||
if(sim.state().money!=afterSpin) {std::fprintf(stderr,"double slot payout\n");return 1;}
|
|
||||||
if(casino.spinning() || !click(casino,"Button","ok") || casino.active()) {
|
|
||||||
std::fprintf(stderr,"slot payout/close: %s\n",casino.menu().status().c_str());return 1;
|
|
||||||
}
|
|
||||||
if(!sim.run("assert(type(SlotMachine)=='function' and __casinoPaidOut=='prior' and CratesGame==nil and __casinoAllStopped==nil and __casinoReelOptions==nil)",error)) {
|
|
||||||
std::fprintf(stderr,"casino globals were not restored: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
if(!sim.run("Player:AddMoney(100000)",error) ||
|
|
||||||
!casino.open(sim,luaRoot,"hav_casino",error) ||
|
|
||||||
!click(casino,"Button","image/box_closed") ||
|
|
||||||
!find(casino.menu().dialogRoot(),"Window","ui_crates").found) {
|
|
||||||
std::fprintf(stderr,"crates route: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
const double beforeCrates=sim.state().money;
|
|
||||||
if(!click(casino,"Button","start") || sim.state().money>=beforeCrates) {
|
|
||||||
std::fprintf(stderr,"crates bet: %s\n",casino.menu().status().c_str());return 1;
|
|
||||||
}
|
|
||||||
int winner=-1;
|
|
||||||
for(int i=0;i<21;++i) if(casino.crateValues()[i]>0) {winner=i;break;}
|
|
||||||
if(winner<0) return 1;
|
|
||||||
const int prize=casino.crateValues()[winner];
|
|
||||||
const std::string button="select_"+std::to_string(winner+1);
|
|
||||||
const double afterBet=sim.state().money;
|
|
||||||
const bool picked=click(casino,"Button",button);
|
|
||||||
const bool revealed=casino.crateOpened()[winner];
|
|
||||||
const bool finished=click(casino,"Button","done");
|
|
||||||
const bool cashed=click(casino,"Button","close");
|
|
||||||
if(!picked || !revealed || !finished || !cashed || casino.active() ||
|
|
||||||
sim.state().money!=afterBet+prize) {
|
|
||||||
std::fprintf(stderr,"crates prize/finish: %s picked=%d revealed=%d finished=%d cashed=%d active=%d money=%g expected=%g\n",
|
|
||||||
casino.menu().status().c_str(),picked,revealed,finished,cashed,casino.active(),sim.state().money,afterBet+prize);return 1;
|
|
||||||
}
|
|
||||||
const double afterCashout=sim.state().money;
|
|
||||||
casino.mouseUp(0,0);
|
|
||||||
if(sim.state().money!=afterCashout) {std::fprintf(stderr,"double crate payout\n");return 1;}
|
|
||||||
if(!casino.open(sim,luaRoot,"hav_casino",error) ||
|
|
||||||
!click(casino,"Button","image/box_closed")) return 1;
|
|
||||||
const double beforeCancel=sim.state().money;
|
|
||||||
if(!click(casino,"Button","done") || casino.active() || sim.state().money!=beforeCancel) {
|
|
||||||
std::fprintf(stderr,"crate pre-bet cancel mutated balance\n");return 1;
|
|
||||||
}
|
|
||||||
if(!casino.open(sim,luaRoot,"hav_casino",error)) return 1;
|
|
||||||
const auto save=std::filesystem::temp_directory_path()/"choco3-casino-ui-test.save";
|
|
||||||
if(!sim.saveGame(save,error) || !sim.loadGame(save,error)) {
|
|
||||||
std::fprintf(stderr,"VM swap setup: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
casino.mouseUp(0,0); // stale VM must be abandoned without dereference.
|
|
||||||
if(casino.active()) {std::fprintf(stderr,"stale casino VM retained\n");return 1;}
|
|
||||||
std::error_code removeError;
|
|
||||||
std::filesystem::remove(save,removeError);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
#include "gfx/character.h"
|
|
||||||
#include "platform/display.h"
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
#define CHECK(x) do { if(!(x)) {std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x);std::exit(1);} } while(0)
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::string error;
|
|
||||||
std::vector<choco::CharacterFrame> frames;
|
|
||||||
const char* fixture="<sequence><framelist><frame x=\"0\" y=\"0\" w=\"172\" h=\"229\" regx=\"86\" regy=\"114\"/>"
|
|
||||||
"<frame x=\"173\" y=\"0\" w=\"79\" h=\"96\" regx=\"43\" regy=\"81\"/></framelist></sequence>";
|
|
||||||
CHECK(choco::parseCharacterFrames(fixture,frames,&error));
|
|
||||||
CHECK(frames.size()==2 && frames[0].w==172 && frames[1].x==173);
|
|
||||||
CHECK(!choco::parseCharacterFrames("<framelist><frame x=\"-1\"/></framelist>",frames,&error));
|
|
||||||
CHECK(frames.size()==2);
|
|
||||||
auto assets=choco::openVfs(CHOCO_PFP,&error);
|
|
||||||
CHECK(assets);
|
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_DRIVER,"dummy");
|
|
||||||
choco::Display display;
|
|
||||||
CHECK(display.open("character test",400,300,&error));
|
|
||||||
choco::CharacterAtlas portrait;
|
|
||||||
CHECK(portrait.load(display.renderer(),*assets,"zur_factorykeep",&error));
|
|
||||||
CHECK(portrait.frames().size()==4);
|
|
||||||
CHECK(portrait.frames()[0].w==172 && portrait.frames()[0].h==229);
|
|
||||||
CHECK(portrait.frames()[1].x==173 && portrait.frames()[2].x==253);
|
|
||||||
CHECK(portrait.frames()[3].x==333);
|
|
||||||
choco::CharacterAtlas alex;
|
|
||||||
CHECK(alex.load(display.renderer(),*assets,"main_alex",&error));
|
|
||||||
CHECK(alex.frames().size()==4 && alex.frames()[1].regy==85 && alex.frames()[1].h==61);
|
|
||||||
CHECK(!portrait.load(display.renderer(),*assets,"../bad",&error));
|
|
||||||
CHECK(portrait.frames().size()==4);
|
|
||||||
display.beginFrame();
|
|
||||||
CHECK(portrait.draw(display.renderer(),20,20,0));
|
|
||||||
SDL_Surface* neutral=SDL_RenderReadPixels(display.renderer(),nullptr);
|
|
||||||
CHECK(neutral);
|
|
||||||
display.endFrame();
|
|
||||||
display.beginFrame();
|
|
||||||
CHECK(portrait.draw(display.renderer(),20,20,2));
|
|
||||||
CHECK(!portrait.draw(display.renderer(),20,20,99));
|
|
||||||
SDL_Surface* captured=SDL_RenderReadPixels(display.renderer(),nullptr);
|
|
||||||
CHECK(captured);
|
|
||||||
int visible=0,different=0;
|
|
||||||
for(int y=20;y<249;++y)for(int x=20;x<192;++x) {
|
|
||||||
Uint8 r,g,b,a,r0,g0,b0,a0;
|
|
||||||
if(SDL_ReadSurfacePixel(captured,x,y,&r,&g,&b,&a) && (r||g||b))++visible;
|
|
||||||
if(SDL_ReadSurfacePixel(neutral,x,y,&r0,&g0,&b0,&a0) &&
|
|
||||||
(r!=r0 || g!=g0 || b!=b0))++different;
|
|
||||||
}
|
|
||||||
const auto path=std::filesystem::temp_directory_path()/"choco3-character-zurich.bmp";
|
|
||||||
CHECK(SDL_SaveBMP(captured,choco::pathToUtf8(path).c_str()));
|
|
||||||
std::printf("Character screenshot: %s, visible=%d, expression difference=%d\n",
|
|
||||||
choco::pathToUtf8(path).c_str(),visible,different);
|
|
||||||
CHECK(visible>3000 && different>100);
|
|
||||||
SDL_DestroySurface(neutral);
|
|
||||||
SDL_DestroySurface(captured);
|
|
||||||
display.endFrame();
|
|
||||||
}
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
#include "minigame/chocolate.h"
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#define CHECK(x) do {if(!(x)){std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x);std::exit(1);}}while(0)
|
|
||||||
|
|
||||||
static choco::minigame::ChocolateConfig barConfig() {
|
|
||||||
using choco::minigame::Point;
|
|
||||||
choco::minigame::ChocolateConfig c;
|
|
||||||
// b01 and the bar category's Lua values in items/categories.lua:6-24.
|
|
||||||
c.recipe={"sugar","cacao"};
|
|
||||||
c.trayCount=7;c.trayTimeMs=30000;
|
|
||||||
c.trayPath={{515,300},{515,225},{515,155},{515,80},{375,80},{230,80},{80,80},
|
|
||||||
{80,220},{80,360},{80,500},{230,500},{375,500},{515,500},
|
|
||||||
{515,430},{515,370},{515,300}};
|
|
||||||
c.conveyorCount=5;c.conveyorTimeMs=1200;
|
|
||||||
c.conveyorPath={{0,570},{20,570},{280,570},{295,570},{295,550},{295,320},{295,300}};
|
|
||||||
c.gunTimeMs=250;c.productTimeMs=3000;
|
|
||||||
c.countdownMs=3000;c.gameTimeMs=60000;c.warningMs=10000;c.missLimit=8;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
int main() {
|
|
||||||
using namespace choco::minigame;
|
|
||||||
std::string error;
|
|
||||||
ChocolateGame game;
|
|
||||||
auto bad=barConfig();bad.trayTimeMs=0;
|
|
||||||
CHECK(!game.configure(bad,&error));
|
|
||||||
auto config=barConfig();
|
|
||||||
CHECK(game.configure(config,&error));
|
|
||||||
game.start();
|
|
||||||
CHECK(game.phase()==FactoryPhase::Countdown);
|
|
||||||
CHECK(!game.fire({515,300}));
|
|
||||||
game.tick(2999);CHECK(game.view().countdownRemainingMs==1);
|
|
||||||
game.tick(1);CHECK(game.phase()==FactoryPhase::Playing);
|
|
||||||
CHECK(game.view().conveyor.size()==5);
|
|
||||||
Point aim=game.view().trays[0].position;
|
|
||||||
CHECK(game.fire(aim));
|
|
||||||
CHECK(!game.fire(aim)); // PopConveyor must wait for the next piston to reach the gun.
|
|
||||||
CHECK(game.view().shots.size()==1 && game.view().conveyor.size()==4);
|
|
||||||
game.tick(250);
|
|
||||||
CHECK(game.view().shots.empty() && game.view().trays[0].slots[0]=="sugar");
|
|
||||||
aim=game.view().trays[0].position;
|
|
||||||
CHECK(game.fire(aim));game.tick(250);
|
|
||||||
CHECK(game.view().trays[0].full && game.score()==0);
|
|
||||||
game.tick(3000);
|
|
||||||
CHECK(game.score()==1 && !game.view().trays[0].full);
|
|
||||||
CHECK(game.fire({700,200}));game.tick(250);
|
|
||||||
CHECK(game.misses()==1);
|
|
||||||
game.pause(true);
|
|
||||||
const auto frozen=game.view();game.tick(10000);
|
|
||||||
CHECK(game.view().playRemainingMs==frozen.playRemainingMs && game.view().trays[0].position.x==frozen.trays[0].position.x);
|
|
||||||
CHECK(!game.fire({515,300}));
|
|
||||||
game.pause(false);
|
|
||||||
game.tick(game.view().playRemainingMs-10000);
|
|
||||||
CHECK(game.view().warning && game.view().playRemainingMs==10000);
|
|
||||||
game.tick(10000);CHECK(game.phase()==FactoryPhase::Ending);
|
|
||||||
game.tick(1000);CHECK(game.phase()==FactoryPhase::Over && game.score()==1);
|
|
||||||
game.start();game.tick(3000);
|
|
||||||
CHECK(game.phase()==FactoryPhase::Playing && game.score()==0 && game.misses()==0);
|
|
||||||
for(int i=0;i<8;++i) {
|
|
||||||
CHECK(game.fire({700,200}));game.tick(1200);
|
|
||||||
}
|
|
||||||
CHECK(game.misses()==8 && (game.phase()==FactoryPhase::Aborted || game.phase()==FactoryPhase::Over));
|
|
||||||
game.tick(1000);CHECK(game.phase()==FactoryPhase::Over);
|
|
||||||
ChocolateGame singleTick,splitTicks;
|
|
||||||
CHECK(singleTick.configure(config,&error) && splitTicks.configure(config,&error));
|
|
||||||
singleTick.start();splitTicks.start();
|
|
||||||
singleTick.tick(3850);
|
|
||||||
splitTicks.tick(3000);splitTicks.tick(200);splitTicks.tick(650);
|
|
||||||
CHECK(singleTick.phase()==splitTicks.phase());
|
|
||||||
CHECK(singleTick.view().playRemainingMs==splitTicks.view().playRemainingMs);
|
|
||||||
CHECK(singleTick.view().conveyor==splitTicks.view().conveyor);
|
|
||||||
CHECK(std::abs(singleTick.view().trays[0].position.y-splitTicks.view().trays[0].position.y)<0.001f);
|
|
||||||
// Color matching and speed cap use a single stationary tray to isolate scoring.
|
|
||||||
auto colored=barConfig();
|
|
||||||
colored.recipe={"sugar"};colored.trayCount=1;colored.colorCount=2;
|
|
||||||
colored.trayPath={{200,200},{200,200}};colored.conveyorPath={{20,20},{20,20}};
|
|
||||||
colored.speedup=2;colored.maxSpeed=4;colored.productTimeMs=10;
|
|
||||||
ChocolateGame colors;CHECK(colors.configure(colored,&error));colors.start();colors.tick(3000);
|
|
||||||
CHECK(colors.view().conveyorColors[0]>0);
|
|
||||||
for(int i=0;i<4;++i) {
|
|
||||||
CHECK(colors.fire({200,200}));colors.tick(250);colors.tick(10);
|
|
||||||
CHECK(colors.score()>=uint32_t(i+1));
|
|
||||||
}
|
|
||||||
CHECK(colors.view().traySpeed==4);
|
|
||||||
CHECK(colors.view().rings.size()>0);
|
|
||||||
colors.tick(500);
|
|
||||||
CHECK(colors.score()==8 && colors.view().bonusCount==4); // four normal + four ring products
|
|
||||||
auto mixed=colored;mixed.recipe={"sugar","cacao"};mixed.trayCount=1;mixed.productTimeMs=3000;
|
|
||||||
ChocolateGame ordinary;CHECK(ordinary.configure(mixed,&error));ordinary.start();ordinary.tick(3000);
|
|
||||||
CHECK(ordinary.fire({200,200}));ordinary.tick(250);
|
|
||||||
CHECK(ordinary.fire({200,200}));ordinary.tick(250);
|
|
||||||
CHECK(ordinary.view().trays[0].full);
|
|
||||||
// The first batch has the same color; completion creates a colored ring.
|
|
||||||
CHECK(ordinary.view().bonusCount==0 && ordinary.view().rings.size()==1);
|
|
||||||
ordinary.tick(500);CHECK(ordinary.score()==1 && ordinary.view().bonusCount==1);
|
|
||||||
ChocolateGame mismatch;CHECK(mismatch.configure(mixed,&error));mismatch.start();mismatch.tick(3000);
|
|
||||||
CHECK(mismatch.fire({200,200}));mismatch.tick(250); // sugar, color 1
|
|
||||||
CHECK(mismatch.fire({700,200}));mismatch.tick(250); // cacao, color 1, missed
|
|
||||||
CHECK(mismatch.fire({700,200}));mismatch.tick(250); // sugar, color 2, missed
|
|
||||||
CHECK(mismatch.fire({200,200}));mismatch.tick(250); // cacao, color 2
|
|
||||||
CHECK(mismatch.view().trays[0].full && mismatch.view().trays[0].color==4);
|
|
||||||
CHECK(mismatch.view().rings.empty() && mismatch.view().bonusCount==0);
|
|
||||||
auto group=colored;group.trayCount=2;group.trayTimeMs=300000;group.productTimeMs=3000;group.trayPath={{200,200},{400,200}};
|
|
||||||
ChocolateGame grouped;CHECK(grouped.configure(group,&error));grouped.start();grouped.tick(3000);
|
|
||||||
auto first=grouped.view().trays[0].position;
|
|
||||||
CHECK(grouped.fire(first));grouped.tick(250);
|
|
||||||
auto second=grouped.view().trays[1].position;
|
|
||||||
CHECK(grouped.fire(second));grouped.tick(250);
|
|
||||||
CHECK(grouped.score()==2 && grouped.view().bonusCount==1); // group makes both products immediately
|
|
||||||
grouped.tick(3000);
|
|
||||||
CHECK(grouped.score()==4 && grouped.view().bonusCount==3); // two rings, no duplicate normal products
|
|
||||||
auto recycling=colored;recycling.recycler=true;recycling.recyclerTimeMs=1000;
|
|
||||||
recycling.recyclerPath={{400,200},{400,200}};
|
|
||||||
ChocolateGame recycle;CHECK(recycle.configure(recycling,&error));recycle.start();recycle.tick(3000);
|
|
||||||
CHECK(recycle.view().recyclerActive && recycle.view().recyclerPosition.x==400);
|
|
||||||
CHECK(recycle.fire({400,200}));recycle.tick(250);
|
|
||||||
CHECK(recycle.view().recycled==1 && recycle.misses()==0 && recycle.score()==0);
|
|
||||||
recycle.pause(true);auto still=recycle.view();recycle.tick(1000);
|
|
||||||
CHECK(recycle.view().recycled==still.recycled && recycle.view().playRemainingMs==still.playRemainingMs);
|
|
||||||
recycle.abort();CHECK(recycle.phase()==FactoryPhase::Aborted);
|
|
||||||
recycle.tick(1000);CHECK(recycle.phase()==FactoryPhase::Over);
|
|
||||||
auto late=colored;late.gameTimeMs=1000;late.warningMs=0;late.endingMs=0;late.ringTimeMs=1500;
|
|
||||||
ChocolateGame lateRing;CHECK(lateRing.configure(late,&error));lateRing.start();lateRing.tick(3000);
|
|
||||||
CHECK(lateRing.fire({200,200}));lateRing.tick(250);
|
|
||||||
CHECK(lateRing.score()==1 && !lateRing.view().rings.empty());
|
|
||||||
lateRing.tick(750);CHECK(lateRing.phase()==FactoryPhase::Ending);
|
|
||||||
lateRing.tick(1);CHECK(lateRing.phase()==FactoryPhase::Ending);
|
|
||||||
lateRing.tick(1000);CHECK(lateRing.phase()==FactoryPhase::Over && lateRing.score()==2);
|
|
||||||
std::puts("chocolate: countdown, moving tray fill, product score, miss, pause, warning, timeout and abort passed");
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
#include "minigame/coffee.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cmath>
|
|
||||||
#define CHECK(x) do {if(!(x)){std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x);std::exit(1);}}while(0)
|
|
||||||
|
|
||||||
int main(){
|
|
||||||
using namespace choco::minigame;
|
|
||||||
CoffeeConfig c;
|
|
||||||
// Beverage category values: items/categories.lua:26-43; grid layout: ui/coffee_factory.lua:30-105.
|
|
||||||
c.recipe={"kon_coffee"};c.matchBonus={0,0,0,1,2,2,3,3,4,5};
|
|
||||||
c.gridSpeedMs=5000;c.conveyorCount=5;c.conveyorTimeMs=1200;c.gunTimeMs=250;
|
|
||||||
c.speedup=1.2f;c.maxSpeed=8.f;
|
|
||||||
c.columns=6;c.rows=9;c.gridX=146;c.gridY=15;c.cellX=c.cellY=45;
|
|
||||||
CoffeeGame game;std::string error;
|
|
||||||
auto bad=c;bad.columns=0;CHECK(!game.configure(bad,&error));
|
|
||||||
CHECK(game.configure(c,&error));game.start();CHECK(game.phase()==CoffeePhase::Countdown);
|
|
||||||
CHECK(!game.fire({168,37}));game.tick(3000);CHECK(game.phase()==CoffeePhase::Playing);
|
|
||||||
CHECK(game.view().conveyor.size()==5);
|
|
||||||
CHECK(game.view().grid==std::vector<std::string>(54)); // ResetGame starts with empty slots.
|
|
||||||
CHECK(game.view().slotAvailable==std::vector<bool>(54,true));
|
|
||||||
for(int x=0;x<3;++x){CHECK(game.fire({168.f+45.f*x,37.f}));game.tick(250);}
|
|
||||||
CHECK(game.view().grid[0].empty() && game.view().grid[1].empty() && game.view().grid[2].empty());
|
|
||||||
CHECK(game.view().collecting==3 && game.score()==1); // match bonus first; ingredients fly to hopper.
|
|
||||||
CHECK(std::abs(game.view().gridScale-1.2f)<0.001f);
|
|
||||||
game.tick(250);
|
|
||||||
CHECK(game.view().collecting==0 && game.view().hopper[0]==0 && game.score()==4);
|
|
||||||
CHECK(game.fire({168,37}));game.tick(250);CHECK(game.view().grid[0]=="kon_coffee");
|
|
||||||
game.tick(3000);CHECK(game.view().grid[0]=="kon_coffee");
|
|
||||||
game.tick(50);CHECK(game.view().grid[6]=="kon_coffee");
|
|
||||||
CHECK(game.fire({780,590}));game.tick(250);CHECK(game.misses()==1);
|
|
||||||
game.pause(true);const auto frozen=game.view();game.tick(10000);
|
|
||||||
CHECK(game.view().playRemainingMs==frozen.playRemainingMs);game.pause(false);
|
|
||||||
game.tick(game.view().playRemainingMs-8000);CHECK(game.view().warning);
|
|
||||||
game.tick(8000);CHECK(game.phase()==CoffeePhase::Ending);
|
|
||||||
game.tick(1000);CHECK(game.phase()==CoffeePhase::Over);
|
|
||||||
game.start();game.tick(3000);CHECK(game.score()==0 && game.misses()==0);
|
|
||||||
CHECK(game.view().gridScale==1.f);
|
|
||||||
for(int i=0;i<8;++i){CHECK(game.fire({780,590}));game.tick(1200);}
|
|
||||||
CHECK(game.misses()==8);game.tick(1000);CHECK(game.phase()==CoffeePhase::Over);
|
|
||||||
CoffeeGame a,b;CHECK(a.configure(c,&error) && b.configure(c,&error));a.start();b.start();
|
|
||||||
a.tick(8500);b.tick(3000);b.tick(5500);
|
|
||||||
CHECK(a.view().grid==b.view().grid && a.view().conveyor==b.view().conveyor &&
|
|
||||||
a.view().playRemainingMs==b.view().playRemainingMs);
|
|
||||||
CoffeeConfig duplicate=c;duplicate.recipe={"kon_coffee","kon_coffee"};
|
|
||||||
CoffeeGame hopper;CHECK(hopper.configure(duplicate,&error));hopper.start();hopper.tick(3000);
|
|
||||||
for(int x=0;x<3;++x){CHECK(hopper.fire({168.f+45.f*x,37.f}));hopper.tick(250);}
|
|
||||||
CHECK(hopper.score()==1 && hopper.view().collecting==3);
|
|
||||||
hopper.tick(250);
|
|
||||||
CHECK(hopper.score()==2 && hopper.view().hopper[0]==0 && hopper.view().hopper[1]==1);
|
|
||||||
CoffeeConfig capped=c;capped.maxSpeed=1.1f;
|
|
||||||
CoffeeGame speedCap;CHECK(speedCap.configure(capped,&error));speedCap.start();speedCap.tick(3000);
|
|
||||||
for(int x=0;x<3;++x){CHECK(speedCap.fire({168.f+45.f*x,37.f}));speedCap.tick(250);}
|
|
||||||
CHECK(std::abs(speedCap.view().gridScale-1.1f)<0.001f);
|
|
||||||
std::puts("coffee: countdown, gun, three-match, hopper, grid shift, miss, pause, warning and abort passed");
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
#include "ui/controls.h"
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
choco::Rollover button({10, 20, 100, 40});
|
|
||||||
button.move(50, 40); assert(button.hovered());
|
|
||||||
assert(button.down(50, 40)); assert(button.pressed());
|
|
||||||
button.move(200, 40); assert(!button.hovered());
|
|
||||||
assert(!button.up(200, 40)); assert(!button.pressed());
|
|
||||||
assert(button.down(10, 20));
|
|
||||||
assert(button.up(109, 59));
|
|
||||||
assert(!button.down(110, 60));
|
|
||||||
button.cancel(); assert(!button.hovered() && !button.pressed());
|
|
||||||
|
|
||||||
choco::Slider volume({100, 10, 200, 20}, 0, 100, 25, 5);
|
|
||||||
assert(volume.value() == 25 && volume.fraction() == .25f);
|
|
||||||
assert(!volume.down(50, 20)); assert(!volume.dragging());
|
|
||||||
assert(volume.down(200, 20)); assert(volume.dragging() && volume.value() == 50);
|
|
||||||
assert(volume.move(400, 500)); assert(volume.value() == 100);
|
|
||||||
volume.up(); assert(!volume.dragging());
|
|
||||||
assert(!volume.move(100, 20)); assert(volume.value() == 100);
|
|
||||||
volume.setValue(-50); assert(volume.value() == 0);
|
|
||||||
volume.setValue(73); assert(volume.value() == 75);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
// M0 tests (a) PFP reader, (b) ZXML decode. Plain asserts.
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
|
||||||
#include "core/pfp.h"
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include "core/zxml.h"
|
|
||||||
|
|
||||||
using namespace choco;
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
#define CHECK(c) do { if (!(c)) { std::fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #c); std::exit(1); } } while (0)
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
fs::path pfpPath = pathFromUtf8(CHOCO_PFP);
|
|
||||||
fs::path ref = pathFromUtf8(CHOCO_RE_DIR) / "assets_out";
|
|
||||||
CHECK(fs::exists(pfpPath));
|
|
||||||
std::string err;
|
|
||||||
auto v = openPfp(CHOCO_PFP, &err);
|
|
||||||
CHECK(v != nullptr);
|
|
||||||
CHECK(v->list().size() == 1509);
|
|
||||||
Bytes first;
|
|
||||||
CHECK(v->read(v->list()[0], first));
|
|
||||||
CHECK(!first.empty());
|
|
||||||
|
|
||||||
// (a) bytes equal the already-extracted files
|
|
||||||
size_t compared = 0, zxmlChecked = 0;
|
|
||||||
if (fs::exists(ref)) for (auto& name : v->list()) {
|
|
||||||
fs::path f = ref / pathFromUtf8(name);
|
|
||||||
Bytes got, want;
|
|
||||||
CHECK(v->read(name, got));
|
|
||||||
if (!fs::exists(f)) continue;
|
|
||||||
CHECK(readFile(pathToUtf8(f), want));
|
|
||||||
if (got != want) { std::fprintf(stderr, "mismatch: %s\n", name.c_str()); CHECK(false); }
|
|
||||||
compared++;
|
|
||||||
|
|
||||||
// (b) ZXML decode equals *.xml.dec
|
|
||||||
fs::path dec = f;
|
|
||||||
dec += ".dec";
|
|
||||||
if (isZxml(got) && fs::exists(dec)) {
|
|
||||||
Bytes out, wantDec;
|
|
||||||
CHECK(zxmlDecode(got, out, &err));
|
|
||||||
CHECK(readFile(pathToUtf8(dec), wantDec));
|
|
||||||
if (out != wantDec) { std::fprintf(stderr, "zxml mismatch: %s\n", name.c_str()); CHECK(false); }
|
|
||||||
zxmlChecked++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::printf("pfp: %zu entries, %zu compared equal; zxml: %zu decoded equal\n", v->list().size(), compared, zxmlChecked);
|
|
||||||
if (fs::exists(ref)) {
|
|
||||||
CHECK(compared >= 1500);
|
|
||||||
CHECK(zxmlChecked >= 90);
|
|
||||||
}
|
|
||||||
|
|
||||||
// case-insensitive / backslash lookup
|
|
||||||
Bytes b;
|
|
||||||
CHECK(v->read("SIM\\" + std::string("x"), b) == false);
|
|
||||||
CHECK(!v->list().empty() && v->exists(v->list()[0]));
|
|
||||||
|
|
||||||
// loose-directory fallback: same lookup on the extracted tree
|
|
||||||
if (fs::exists(ref)) {
|
|
||||||
auto d = openDir(pathToUtf8(ref), &err);
|
|
||||||
CHECK(d != nullptr);
|
|
||||||
CHECK(d->exists(v->list()[0]));
|
|
||||||
}
|
|
||||||
std::printf("core tests passed\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
#include "core/vfs.h"
|
|
||||||
#include "gfx/draw.h"
|
|
||||||
#include "platform/display.h"
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_DRIVER, "dummy");
|
|
||||||
const std::filesystem::path pfp = CHOCO_PFP;
|
|
||||||
if (!std::filesystem::exists(pfp)) {
|
|
||||||
std::cout << "skip: no installed assets\n";
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
auto assets = choco::openVfs(choco::pathToUtf8(pfp));
|
|
||||||
if (!assets) { std::cerr << "cannot open asset archive\n"; return 1; }
|
|
||||||
choco::Display display;
|
|
||||||
std::string error;
|
|
||||||
if (!display.open("gfx test", 800, 600, &error)) {
|
|
||||||
std::cerr << error << '\n';
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (!SDL_CursorVisible()) {
|
|
||||||
std::cerr << "native cursor hidden after opening display\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
choco::Draw draw(display.renderer(), *assets);
|
|
||||||
SDL_Texture* background = draw.load("image/title_background.jpg");
|
|
||||||
SDL_Texture* button = draw.load("image/button_mm_story_up.png");
|
|
||||||
if (!background || background->w <= 0 || background->h <= 0) {
|
|
||||||
std::cerr << "JPEG decode failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
if (!button || button->w <= 0 || button->h <= 0) {
|
|
||||||
std::cerr << "PNG decode failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
display.beginFrame();
|
|
||||||
if (!draw.image("image/title_background.jpg", {0, 0, 800, 600})) {
|
|
||||||
std::cerr << "JPEG draw failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
if (!draw.image("image/button_mm_story_up.png", {250, 200, 300, 100})) {
|
|
||||||
std::cerr << "PNG draw failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
if (!draw.text("Chocolatier 3", 20, 20, {255, 255, 255, 255})) {
|
|
||||||
std::cerr << "text draw failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
display.endFrame();
|
|
||||||
choco::Bytes vectorFont;
|
|
||||||
if (!assets->read("fonts/fertigo.mvec", vectorFont) || vectorFont.size() < 12 ||
|
|
||||||
std::string(reinterpret_cast<const char*>(vectorFont.data()), 4) != "MVC4") {
|
|
||||||
std::cerr << "original vector font missing or malformed\n"; return 1;
|
|
||||||
}
|
|
||||||
display.beginFrame();
|
|
||||||
if (!draw.text("Story Mode", 100, 100, {255, 255, 255, 255},
|
|
||||||
40, 300, true, "fonts/fertigo.mvec", 2)) {
|
|
||||||
std::cerr << "MVEC text draw failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
if (!draw.text("Çikolata", 100, 180, {255, 255, 255, 255},
|
|
||||||
40, 300, false, "fonts/fertigo.mvec", 2, {255, 0, 0, 255})) {
|
|
||||||
std::cerr << "MVEC UTF-8/outline draw failed: " << SDL_GetError() << '\n'; return 1;
|
|
||||||
}
|
|
||||||
SDL_Surface* captured = SDL_RenderReadPixels(display.renderer(), nullptr);
|
|
||||||
if (!captured) { std::cerr << "MVEC capture failed: " << SDL_GetError() << '\n'; return 1; }
|
|
||||||
const auto screenshot = std::filesystem::temp_directory_path() / "choco3-mvec-qa.bmp";
|
|
||||||
SDL_SaveBMP(captured, choco::pathToUtf8(screenshot).c_str());
|
|
||||||
int litPixels = 0;
|
|
||||||
int outlinePixels = 0;
|
|
||||||
for (int y = 100; y < 170; ++y)
|
|
||||||
for (int x = 100; x < 400; ++x) {
|
|
||||||
Uint8 r, g, b, a;
|
|
||||||
if (SDL_ReadSurfacePixel(captured, x, y, &r, &g, &b, &a) && r > 180 && g > 180 && b > 180)
|
|
||||||
++litPixels;
|
|
||||||
}
|
|
||||||
for (int y = 180; y < 250; ++y)
|
|
||||||
for (int x = 100; x < 400; ++x) {
|
|
||||||
Uint8 r, g, b, a;
|
|
||||||
if (SDL_ReadSurfacePixel(captured, x, y, &r, &g, &b, &a) && r > 180 && g < 80 && b < 80)
|
|
||||||
++outlinePixels;
|
|
||||||
}
|
|
||||||
SDL_DestroySurface(captured);
|
|
||||||
if (litPixels < 100) { std::cerr << "MVEC glyphs were not rasterized\n"; return 1; }
|
|
||||||
if (outlinePixels < 30) { std::cerr << "MVEC outline was not rasterized\n"; return 1; }
|
|
||||||
std::cout << "MVEC screenshot: " << choco::pathToUtf8(screenshot) << " ("
|
|
||||||
<< litPixels << " glyph pixels, " << outlinePixels << " outline pixels)\n";
|
|
||||||
display.endFrame();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
#include "core/save_snapshot.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cmath>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
|
||||||
using namespace choco;
|
|
||||||
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x); std::exit(1); } } while(0)
|
|
||||||
int main(){
|
|
||||||
auto nested=std::make_shared<SaveTable>();
|
|
||||||
nested->entries={{SaveValue(3.0),SaveValue("sparse")},{SaveValue("true"),SaveValue(true)}};
|
|
||||||
auto rootTable=std::make_shared<SaveTable>();
|
|
||||||
rootTable->entries={{SaveValue("name"),SaveValue("Çikolata\n\"\\")},
|
|
||||||
{SaveValue(1.0),SaveValue(nested)},
|
|
||||||
{SaveValue("money"),SaveValue(123.25)},
|
|
||||||
{SaveValue("false"),SaveValue(false)}};
|
|
||||||
SaveValue root(rootTable),decoded;std::string encoded,error;
|
|
||||||
CHECK(encodeSave(root,encoded,&error));
|
|
||||||
CHECK(decodeSave(encoded,decoded,&error));
|
|
||||||
std::string again;CHECK(encodeSave(decoded,again,&error));CHECK(again==encoded);
|
|
||||||
auto path=std::filesystem::temp_directory_path()/"choco-save-snapshot-test.bin";
|
|
||||||
CHECK(writeSaveAtomic(path,encoded,&error));std::string loaded;
|
|
||||||
CHECK(readSave(path,loaded,&error));CHECK(loaded==encoded);
|
|
||||||
CHECK(writeSaveAtomic(path,"replacement",&error));CHECK(readSave(path,loaded,&error));CHECK(loaded=="replacement");
|
|
||||||
std::filesystem::remove(path);
|
|
||||||
SaveValue untouched("sentinel");
|
|
||||||
for(size_t i=0;i<encoded.size();++i){
|
|
||||||
auto truncated=encoded.substr(0,i);
|
|
||||||
CHECK(!decodeSave(truncated,untouched,&error));
|
|
||||||
CHECK(std::get<std::string>(untouched.data)=="sentinel");
|
|
||||||
}
|
|
||||||
auto bad=encoded;bad[0]='X';CHECK(!decodeSave(bad,untouched,&error));
|
|
||||||
bad=encoded;bad.push_back('x');CHECK(!decodeSave(bad,untouched,&error));
|
|
||||||
bad=encoded;bad[8]=99;CHECK(!decodeSave(bad,untouched,&error));
|
|
||||||
SaveLimits small;small.maxBytes=encoded.size()-1;
|
|
||||||
CHECK(!decodeSave(encoded,untouched,&error,small));
|
|
||||||
small=SaveLimits{};small.maxDepth=1;CHECK(!decodeSave(encoded,untouched,&error,small));
|
|
||||||
small=SaveLimits{};small.maxEntries=1;CHECK(!decodeSave(encoded,untouched,&error,small));
|
|
||||||
auto invalid=std::make_shared<SaveTable>();invalid->entries={{SaveValue(true),SaveValue(1.0)}};
|
|
||||||
std::string unchanged="old";CHECK(!encodeSave(SaveValue(invalid),unchanged,&error));CHECK(unchanged=="old");
|
|
||||||
invalid->entries={{SaveValue("nan"),SaveValue(std::nan(""))}};
|
|
||||||
CHECK(!encodeSave(SaveValue(invalid),unchanged,&error));
|
|
||||||
invalid->entries={{SaveValue("cycle"),SaveValue(invalid)}};
|
|
||||||
CHECK(!encodeSave(SaveValue(invalid),unchanged,&error));
|
|
||||||
}
|
|
||||||
|
|
@ -1,114 +0,0 @@
|
||||||
#include "ui/shop_ui.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
struct Hit {float x=0,y=0;bool found=false;};
|
|
||||||
Hit find(const choco::MenuNode& node,const std::string& type,const std::string& text,
|
|
||||||
float ox=0,float oy=0) {
|
|
||||||
const float x=ox+node.x,y=oy+node.y;
|
|
||||||
if(node.type==type && (node.name.find(text)!=std::string::npos ||
|
|
||||||
node.label.find(text)!=std::string::npos ||
|
|
||||||
node.contents.find(text)!=std::string::npos))
|
|
||||||
return {x+(node.w>0?node.w*0.5f:25),y+(node.h>0?node.h*0.5f:25),true};
|
|
||||||
for(const auto& child:node.children)
|
|
||||||
if(auto hit=find(child,type,text,x,y);hit.found) return hit;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
bool click(choco::ShopUi& ui,const std::string& type,const std::string& text) {
|
|
||||||
const auto hit=find(ui.menu().dialogRoot(),type,text);
|
|
||||||
if(!hit.found) return false;
|
|
||||||
ui.mouseMove(hit.x,hit.y);ui.mouseDown(hit.x,hit.y);ui.mouseUp(hit.x,hit.y);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::string error;
|
|
||||||
auto assets=choco::openVfs(CHOCO_PFP,&error);
|
|
||||||
if(!assets) {std::fprintf(stderr,"assets: %s\n",error.c_str());return 1;}
|
|
||||||
choco::Bytes bytes;
|
|
||||||
if(!choco::readFile(CHOCO_STRINGS,bytes)) return 1;
|
|
||||||
choco::StringTable strings;
|
|
||||||
if(!strings.loadXml(std::string_view(reinterpret_cast<const char*>(bytes.data()),bytes.size()),&error)) return 1;
|
|
||||||
choco::GameSim sim;
|
|
||||||
sim.setStringTable(strings);
|
|
||||||
const auto luaRoot=choco::pathFromUtf8(CHOCO_LUA_SRC);
|
|
||||||
if(!sim.load(luaRoot,*assets,error) || !sim.newGame("Shop UI Test",error)) {
|
|
||||||
std::fprintf(stderr,"sim: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
choco::UiRuntime prior(*assets,strings);
|
|
||||||
if(!prior.attach(sim,luaRoot,error) || !prior.show("ui/inventory.lua",error)) {
|
|
||||||
std::fprintf(stderr,"prior UI: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
choco::ShopUi shop(*assets,strings);
|
|
||||||
if(!shop.open(sim,luaRoot,"zur_shop",error)) {
|
|
||||||
std::fprintf(stderr,"empty shop: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
if(!find(shop.menu().dialogRoot(),"Text","shop_comeback").found ||
|
|
||||||
!click(shop,"Button","ok") || shop.takeResult()!="ok" || shop.active()) {
|
|
||||||
std::fprintf(stderr,"empty shop layout/close failed: %s\n",shop.menu().status().c_str());return 1;
|
|
||||||
}
|
|
||||||
if(!sim.run("_AllProducts.b01:AdjustInventory(3); zur_shop.buys.bar=true",error)) {
|
|
||||||
std::fprintf(stderr,"seed: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
const auto before=sim.state();
|
|
||||||
if(!shop.open(sim,luaRoot,"zur_shop",error)) {
|
|
||||||
std::fprintf(stderr,"stocked shop: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
if(!find(shop.menu().dialogRoot(),"Rollover","b01").found ||
|
|
||||||
!click(shop,"Rollover","b01") ||
|
|
||||||
!find(shop.menu().dialogRoot(),"TextEdit","count").found) {
|
|
||||||
std::fprintf(stderr,"product/register route failed: %s\n",shop.menu().status().c_str());return 1;
|
|
||||||
}
|
|
||||||
shop.textInput("1");
|
|
||||||
if(!click(shop,"Button","sell") || sim.productInventory("b01")!=2 ||
|
|
||||||
sim.state().money<=before.money ||
|
|
||||||
!find(shop.menu().dialogRoot(),"Rollover","b01").found) {
|
|
||||||
std::fprintf(stderr,"quantity sale failed: %s, stock=%d\n",shop.menu().status().c_str(),sim.productInventory("b01"));return 1;
|
|
||||||
}
|
|
||||||
if(!click(shop,"Button","ok") || shop.takeResult()!="ok") {
|
|
||||||
std::fprintf(stderr,"shop final close failed: %s\n",shop.menu().status().c_str());return 1;
|
|
||||||
}
|
|
||||||
if(!prior.menu().run("SetLabel('ok','#Restored')",error) ||
|
|
||||||
!find(prior.menu().dialogRoot(),"Button","#Restored").found) {
|
|
||||||
std::fprintf(stderr,"nested Menu global restoration failed: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
prior.detach();
|
|
||||||
if(!sim.run("assert(SetLabel == nil)",error)) {
|
|
||||||
std::fprintf(stderr,"Menu global leaked after detach: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
choco::UiRuntime swapped(*assets,strings);
|
|
||||||
const auto save=std::filesystem::temp_directory_path()/"choco-shop-ui-vm-swap.chsv";
|
|
||||||
if(!swapped.attach(sim,luaRoot,error) || !swapped.show("ui/inventory.lua",error) ||
|
|
||||||
!sim.saveGame(save,error) || !sim.loadGame(save,error) ||
|
|
||||||
!swapped.attach(sim,luaRoot,error) || !swapped.show("ui/inventory.lua",error)) {
|
|
||||||
std::fprintf(stderr,"VM replacement UI reattach failed: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
swapped.detach();
|
|
||||||
std::filesystem::remove(save);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
choco::UiRuntime transient(*assets,strings);
|
|
||||||
if(!transient.attach(sim,luaRoot,error) || !transient.show("ui/inventory.lua",error)) return 1;
|
|
||||||
}
|
|
||||||
if(!sim.run("assert(SetLabel == nil)",error)) {
|
|
||||||
std::fprintf(stderr,"attached Menu destructor left stale callback: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
choco::ShopUi swappingShop(*assets,strings);
|
|
||||||
const auto save=std::filesystem::temp_directory_path()/"choco-shop-ui-active-swap.chsv";
|
|
||||||
if(!swappingShop.open(sim,luaRoot,"zur_shop",error) ||
|
|
||||||
!sim.saveGame(save,error) || !sim.loadGame(save,error)) {
|
|
||||||
std::fprintf(stderr,"active shop VM replacement setup failed: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
swappingShop.close();
|
|
||||||
std::filesystem::remove(save);
|
|
||||||
if(!sim.run("assert(SetLabel == nil)",error)) {
|
|
||||||
std::fprintf(stderr,"active shop VM replacement leaked globals: %s\n",error.c_str());return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,42 +0,0 @@
|
||||||
#include "core/string_table.h"
|
|
||||||
#include "core/vfs.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace choco;
|
|
||||||
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr,"FAIL %s:%d: %s\n",__FILE__,__LINE__,#x); std::exit(1); } } while(0)
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Bytes bytes;
|
|
||||||
CHECK(readFile(CHOCO_STRINGS, bytes));
|
|
||||||
StringTable strings;
|
|
||||||
std::string error;
|
|
||||||
CHECK(strings.loadXml(std::string_view(reinterpret_cast<const char*>(bytes.data()),bytes.size()),&error));
|
|
||||||
CHECK(strings.size() >= 1000);
|
|
||||||
CHECK(strings.get("story_mode") == "Start Game");
|
|
||||||
CHECK(strings.get("month_1") == "January");
|
|
||||||
CHECK(strings.format("welcome", {"Max"}) == "Welcome Back, Max!");
|
|
||||||
CHECK(strings.format("date_format", {"January","2","1946"}) == "January 2, 1946");
|
|
||||||
CHECK(strings.get("#literal") == "literal");
|
|
||||||
CHECK(strings.get("absent-test-key") == "#####");
|
|
||||||
|
|
||||||
auto assets = openVfs(CHOCO_PFP, &error);
|
|
||||||
CHECK(assets != nullptr);
|
|
||||||
CHECK(assets->read("quests/tutorial_strings.xml", bytes));
|
|
||||||
CHECK(strings.loadXml(std::string_view(reinterpret_cast<const char*>(bytes.data()),bytes.size()),&error));
|
|
||||||
CHECK(strings.size() > 1000);
|
|
||||||
CHECK(strings.get("story_mode") == "Start Game");
|
|
||||||
|
|
||||||
StringTable sample;
|
|
||||||
CHECK(sample.loadXml("<Workbook><Worksheet><Table><Row><Cell><Data>a</Data></Cell>"
|
|
||||||
"<Cell><Data>&<>"'©🍫</Data></Cell>"
|
|
||||||
"</Row><Row><Cell><Data>b</Data></Cell><Cell><Data>%1% %% %2%</Data>"
|
|
||||||
"</Cell></Row></Table></Worksheet></Workbook>", &error));
|
|
||||||
CHECK(sample.get("a") == "&<>\"'\xc2\xa9\xf0\x9f\x8d\xab");
|
|
||||||
CHECK(sample.format("b", {"one","two"}) == "one % two");
|
|
||||||
CHECK(!sample.loadXml("<Workbook><Table><Row>", &error));
|
|
||||||
CHECK(sample.get("a") == "&<>\"'\xc2\xa9\xf0\x9f\x8d\xab");
|
|
||||||
std::printf("strings: %zu keys, base + quest overlay + entities + formatting passed\n", strings.size());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,111 +0,0 @@
|
||||||
// M0 tests (c) load all game bytecode, (d) opcode/continue script, (e) plaintext sources compile.
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstring>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
|
||||||
#include "core/pfp.h"
|
|
||||||
#include "core/vfs.h"
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace choco;
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
#define CHECK(c) do { if (!(c)) { std::fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #c); std::exit(1); } } while (0)
|
|
||||||
|
|
||||||
static lua_State* newState() {
|
|
||||||
lua_State* L = lua_open();
|
|
||||||
luaopen_base(L);
|
|
||||||
luaopen_table(L);
|
|
||||||
luaopen_io(L);
|
|
||||||
luaopen_string(L);
|
|
||||||
luaopen_math(L);
|
|
||||||
luaopen_debug(L);
|
|
||||||
return L;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dumpWriter(lua_State*, const void* p, size_t sz, void* ud) {
|
|
||||||
auto* out = static_cast<Bytes*>(ud);
|
|
||||||
out->insert(out->end(), static_cast<const uint8_t*>(p), static_cast<const uint8_t*>(p) + sz);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
// (d) script compiled with our luac, run in our VM; also run directly from source
|
|
||||||
{
|
|
||||||
fs::path script = fs::path(CHOCO_TEST_DIR) / "vm_ops.lua";
|
|
||||||
fs::path out = fs::temp_directory_path() / "choco_vm_ops.luac";
|
|
||||||
std::string cmd = std::string("\"\"") + CHOCO_LUAC + "\" -o \"" + out.string() + "\" \"" + script.string() + "\"\"";
|
|
||||||
CHECK(std::system(cmd.c_str()) == 0);
|
|
||||||
Bytes bc;
|
|
||||||
CHECK(readFile(out.string(), bc));
|
|
||||||
CHECK(bc.size() > 12 && bc[0] == 0x1b && bc[6] == 4 && bc[7] == 4 && bc[8] == 4); // int, size_t, Instruction == 4
|
|
||||||
for (const std::string& f : {out.string(), script.string()}) {
|
|
||||||
lua_State* L = newState();
|
|
||||||
int rc = luaL_loadfile(L, f.c_str());
|
|
||||||
if (rc == 0) rc = lua_pcall(L, 0, 0, 0);
|
|
||||||
if (rc != 0) std::fprintf(stderr, "vm_ops error (%s): %s\n", f.c_str(), lua_tostring(L, -1));
|
|
||||||
CHECK(rc == 0);
|
|
||||||
lua_close(L);
|
|
||||||
}
|
|
||||||
std::printf("(d) opcode/continue script passed (compiled + source)\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// (e) every plaintext choc3 source compiles with our compiler, round-trips through dump/undump
|
|
||||||
if (fs::exists(pathFromUtf8(CHOCO_LUA_SRC))) {
|
|
||||||
int n = 0;
|
|
||||||
for (auto& e : fs::recursive_directory_iterator(pathFromUtf8(CHOCO_LUA_SRC))) {
|
|
||||||
if (!e.is_regular_file() || e.path().extension() != ".lua") continue;
|
|
||||||
lua_State* L = newState();
|
|
||||||
int rc = luaL_loadfile(L, e.path().string().c_str());
|
|
||||||
if (rc != 0) std::fprintf(stderr, "compile error %s: %s\n", e.path().string().c_str(), lua_tostring(L, -1));
|
|
||||||
CHECK(rc == 0);
|
|
||||||
Bytes bc;
|
|
||||||
CHECK(lua_dump(L, dumpWriter, &bc) == 1);
|
|
||||||
lua_pop(L, 1);
|
|
||||||
CHECK(luaL_loadbuffer(L, reinterpret_cast<const char*>(bc.data()), bc.size(), "rt") == 0);
|
|
||||||
lua_close(L);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
std::printf("(e) %d plaintext sources compile and reload\n", n);
|
|
||||||
CHECK(n >= 100);
|
|
||||||
} else {
|
|
||||||
std::printf("(e) SKIP: no lua_source dir\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// (c) all game bytecode files load; re-dumping reproduces the original bytes
|
|
||||||
if (fs::exists(pathFromUtf8(CHOCO_PFP))) {
|
|
||||||
std::string err;
|
|
||||||
auto v = openPfp(CHOCO_PFP, &err);
|
|
||||||
CHECK(v != nullptr);
|
|
||||||
int n = 0, identical = 0;
|
|
||||||
for (auto& name : v->list()) {
|
|
||||||
if (name.size() < 4 || name.compare(name.size() - 4, 4, ".lua") != 0) continue;
|
|
||||||
Bytes b;
|
|
||||||
CHECK(v->read(name, b));
|
|
||||||
CHECK(b.size() > 4 && std::memcmp(b.data(), "\x1b" "Lua", 4) == 0);
|
|
||||||
lua_State* L = newState();
|
|
||||||
int rc = luaL_loadbuffer(L, reinterpret_cast<const char*>(b.data()), b.size(), name.c_str());
|
|
||||||
if (rc != 0) std::fprintf(stderr, "load error %s: %s\n", name.c_str(), lua_tostring(L, -1));
|
|
||||||
CHECK(rc == 0);
|
|
||||||
Bytes re;
|
|
||||||
CHECK(lua_dump(L, dumpWriter, &re) == 1);
|
|
||||||
if (re == b) identical++;
|
|
||||||
else std::fprintf(stderr, "note: redump differs for %s (%zu vs %zu bytes)\n", name.c_str(), re.size(), b.size());
|
|
||||||
lua_close(L);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
std::printf("(c) %d game bytecode files loaded (%d re-dump byte-identical)\n", n, identical);
|
|
||||||
CHECK(n == 122);
|
|
||||||
CHECK(identical == n);
|
|
||||||
} else {
|
|
||||||
std::printf("(c) SKIP: no assets.pfp\n");
|
|
||||||
}
|
|
||||||
std::printf("vm tests passed\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
-- bit ops (game opcode table: AND/OR/SHL/SHR, uint32 clamp)
|
|
||||||
assert(12 & 10 == 8)
|
|
||||||
assert(12 | 3 == 15)
|
|
||||||
assert(1 << 4 == 16)
|
|
||||||
assert(256 >> 4 == 16)
|
|
||||||
assert(1 << 31 == 2147483648)
|
|
||||||
assert(1 << 32 == 0)
|
|
||||||
assert(-5 & 3 == 0) -- negative clamps to 0
|
|
||||||
assert(2^40 & 1 == 1) -- too big clamps to 0xFFFFFFFF
|
|
||||||
assert(255 & 15 | 256 == 271)
|
|
||||||
local a, b = 6, 3
|
|
||||||
assert(a & b == 2 and a | b == 7 and a << b == 48 and a >> 1 == 3)
|
|
||||||
assert(not pcall(function() return "x" & 1 end))
|
|
||||||
assert(not pcall(function() return {} | 1 end))
|
|
||||||
|
|
||||||
-- POW (opcode shifted by +4)
|
|
||||||
assert(2^10 == 1024)
|
|
||||||
assert(2^3^2 == 512)
|
|
||||||
assert(-2^2 == -4)
|
|
||||||
assert(2 * 3^2 == 18)
|
|
||||||
local p = 5
|
|
||||||
assert(p^2 == 25)
|
|
||||||
|
|
||||||
-- arithmetic around the shifted opcodes
|
|
||||||
assert(7 / 2 == 3.5 and 7 - 2 == 5 and 7 * 2 == 14 and 7 + 2 == 9)
|
|
||||||
assert(-p == -5 and (not nil) == true and "a" .. "b" == "ab")
|
|
||||||
|
|
||||||
-- continue
|
|
||||||
local s = 0
|
|
||||||
for i = 1, 10 do
|
|
||||||
if math.mod(i, 2) == 0 then continue end
|
|
||||||
s = s + i
|
|
||||||
end
|
|
||||||
assert(s == 25)
|
|
||||||
|
|
||||||
local n, t = 0, 0
|
|
||||||
while n < 10 do
|
|
||||||
n = n + 1
|
|
||||||
if n < 5 then continue end
|
|
||||||
t = t + n
|
|
||||||
end
|
|
||||||
assert(t == 45)
|
|
||||||
|
|
||||||
local r, k = 0, 0
|
|
||||||
repeat
|
|
||||||
k = k + 1
|
|
||||||
if k == 3 then continue end
|
|
||||||
r = r + k
|
|
||||||
until k >= 5
|
|
||||||
assert(r == 12)
|
|
||||||
|
|
||||||
-- continue inside a loop whose body creates closures (upvalue close)
|
|
||||||
local fns = {}
|
|
||||||
for i = 1, 5 do
|
|
||||||
local v = i * 10
|
|
||||||
if i == 3 then continue end
|
|
||||||
fns[table.getn(fns) + 1] = function() return v end
|
|
||||||
end
|
|
||||||
assert(table.getn(fns) == 4 and fns[3]() == 40)
|
|
||||||
|
|
||||||
print("vm_ops ok")
|
|
||||||
91
engine/third_party/SDL3/.clang-format
vendored
91
engine/third_party/SDL3/.clang-format
vendored
|
|
@ -1,91 +0,0 @@
|
||||||
---
|
|
||||||
AlignConsecutiveMacros: Consecutive
|
|
||||||
AlignConsecutiveAssignments: None
|
|
||||||
AlignConsecutiveBitFields: None
|
|
||||||
AlignConsecutiveDeclarations: None
|
|
||||||
AlignEscapedNewlines: Right
|
|
||||||
AlignOperands: Align
|
|
||||||
AlignTrailingComments: true
|
|
||||||
|
|
||||||
AllowAllArgumentsOnNextLine: true
|
|
||||||
AllowAllParametersOfDeclarationOnNextLine: true
|
|
||||||
AllowShortEnumsOnASingleLine: true
|
|
||||||
AllowShortBlocksOnASingleLine: Never
|
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
|
||||||
AllowShortFunctionsOnASingleLine: All
|
|
||||||
AllowShortIfStatementsOnASingleLine: Never
|
|
||||||
AllowShortLoopsOnASingleLine: false
|
|
||||||
|
|
||||||
AlwaysBreakAfterDefinitionReturnType: None
|
|
||||||
AlwaysBreakAfterReturnType: None
|
|
||||||
AlwaysBreakBeforeMultilineStrings: false
|
|
||||||
AlwaysBreakTemplateDeclarations: MultiLine
|
|
||||||
|
|
||||||
# Custom brace breaking
|
|
||||||
BreakBeforeBraces: Custom
|
|
||||||
BraceWrapping:
|
|
||||||
AfterCaseLabel: true
|
|
||||||
AfterClass: true
|
|
||||||
AfterControlStatement: Never
|
|
||||||
AfterEnum: true
|
|
||||||
AfterFunction: true
|
|
||||||
AfterNamespace: true
|
|
||||||
AfterObjCDeclaration: true
|
|
||||||
AfterStruct: true
|
|
||||||
AfterUnion: true
|
|
||||||
AfterExternBlock: false
|
|
||||||
BeforeElse: false
|
|
||||||
BeforeWhile: false
|
|
||||||
IndentBraces: false
|
|
||||||
SplitEmptyFunction: true
|
|
||||||
SplitEmptyRecord: true
|
|
||||||
|
|
||||||
# Make the closing brace of container literals go to a new line
|
|
||||||
Cpp11BracedListStyle: false
|
|
||||||
|
|
||||||
# Never format includes
|
|
||||||
IncludeBlocks: Preserve
|
|
||||||
# clang-format version 4.0 through 12.0:
|
|
||||||
#SortIncludes: false
|
|
||||||
# clang-format version 13.0+:
|
|
||||||
#SortIncludes: Never
|
|
||||||
|
|
||||||
# No length limit, in case it breaks macros, you can
|
|
||||||
# disable it with /* clang-format off/on */ comments
|
|
||||||
ColumnLimit: 0
|
|
||||||
|
|
||||||
IndentWidth: 4
|
|
||||||
ContinuationIndentWidth: 4
|
|
||||||
IndentCaseLabels: false
|
|
||||||
IndentCaseBlocks: false
|
|
||||||
IndentGotoLabels: true
|
|
||||||
IndentPPDirectives: None
|
|
||||||
IndentExternBlock: NoIndent
|
|
||||||
|
|
||||||
PointerAlignment: Right
|
|
||||||
SpaceAfterCStyleCast: false
|
|
||||||
SpacesInCStyleCastParentheses: false
|
|
||||||
SpacesInConditionalStatement: false
|
|
||||||
SpacesInContainerLiterals: true
|
|
||||||
SpaceBeforeAssignmentOperators: true
|
|
||||||
SpaceBeforeCaseColon: false
|
|
||||||
SpaceBeforeParens: ControlStatements
|
|
||||||
SpaceAroundPointerQualifiers: Default
|
|
||||||
SpaceInEmptyBlock: false
|
|
||||||
SpaceInEmptyParentheses: false
|
|
||||||
|
|
||||||
UseCRLF: false
|
|
||||||
UseTab: Never
|
|
||||||
|
|
||||||
ForEachMacros:
|
|
||||||
[
|
|
||||||
"spa_list_for_each",
|
|
||||||
"spa_list_for_each_safe",
|
|
||||||
"wl_list_for_each",
|
|
||||||
"wl_list_for_each_safe",
|
|
||||||
"wl_array_for_each",
|
|
||||||
"udev_list_entry_foreach",
|
|
||||||
]
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
59
engine/third_party/SDL3/.clang-tidy
vendored
59
engine/third_party/SDL3/.clang-tidy
vendored
|
|
@ -1,59 +0,0 @@
|
||||||
---
|
|
||||||
Checks: >
|
|
||||||
-*,
|
|
||||||
bugprone-assert-side-effect,
|
|
||||||
bugprone-assignment-in-if-condition,
|
|
||||||
bugprone-bool-pointer-implicit-conversion,
|
|
||||||
bugprone-dangling-handle,
|
|
||||||
bugprone-dynamic-static-initializers,
|
|
||||||
bugprone-infinite-loop,
|
|
||||||
bugprone-integer-division,
|
|
||||||
bugprone-macro-repeated-side-effects,
|
|
||||||
bugprone-misplaced-operator-in-strlen-in-alloc,
|
|
||||||
bugprone-misplaced-pointer-arithmetic-in-alloc,
|
|
||||||
bugprone-misplaced-widening-cast,
|
|
||||||
bugprone-not-null-terminated-result,
|
|
||||||
bugprone-posix-return,
|
|
||||||
bugprone-redundant-branch-condition,
|
|
||||||
bugprone-string-literal-with-embedded-nul,
|
|
||||||
bugprone-suspicious-memset-usage,
|
|
||||||
bugprone-suspicious-semicolon,
|
|
||||||
bugprone-suspicious-string-compare,
|
|
||||||
bugprone-too-small-loop-variable,
|
|
||||||
bugprone-unused-return-value,
|
|
||||||
cert-err33-c,
|
|
||||||
clang-analyzer-core.*,
|
|
||||||
clang-analyzer-valist.*,
|
|
||||||
clang-analyzer-unix.Malloc,
|
|
||||||
clang-diagnostic-*,
|
|
||||||
google-readability-casting,
|
|
||||||
misc-misleading-bidirectional,
|
|
||||||
misc-misleading-identifier,
|
|
||||||
misc-misplaced-const,
|
|
||||||
misc-redundant-expression,
|
|
||||||
objc-*,
|
|
||||||
performance-type-promotion-in-math-fn,
|
|
||||||
readability-avoid-const-params-in-decls,
|
|
||||||
readability-braces-around-statements,
|
|
||||||
readability-const-return-type,
|
|
||||||
readability-duplicate-include,
|
|
||||||
readability-inconsistent-declaration-parameter-name,
|
|
||||||
readability-misplaced-array-index,
|
|
||||||
readability-non-const-parameter,
|
|
||||||
readability-redundant-control-flow,
|
|
||||||
readability-redundant-declaration,
|
|
||||||
readability-redundant-function-ptr-dereference,
|
|
||||||
readability-redundant-preprocessor,
|
|
||||||
readability-simplify-boolean-expr
|
|
||||||
|
|
||||||
CheckOptions:
|
|
||||||
- key: bugprone-assert-side-effect.AssertMacros
|
|
||||||
value: "SDL_assert, SDL_assert_release, SDL_assert_paranoid, SDL_assert_always, SDL_COMPILE_TIME_ASSERT"
|
|
||||||
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
|
|
||||||
value: true
|
|
||||||
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
|
|
||||||
value: false # Do not recommend _s functions
|
|
||||||
|
|
||||||
FormatStyle: "file"
|
|
||||||
HeaderFilterRegex: "*.h$"
|
|
||||||
WarningsAsErrors: ""
|
|
||||||
69
engine/third_party/SDL3/.editorconfig
vendored
69
engine/third_party/SDL3/.editorconfig
vendored
|
|
@ -1,69 +0,0 @@
|
||||||
# For format see editorconfig.org
|
|
||||||
# Copyright 2022 Collabora Ltd.
|
|
||||||
# SPDX-License-Identifier: Zlib
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*.{c,cc,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
|
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
trim_tailing_whitespace = true
|
|
||||||
|
|
||||||
[*.xml]
|
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
|
|
||||||
[{CMakeLists.txt,cmake/*.cmake}]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[{cmake/cmake_uninstall.cmake.in,test/CMakeLists.txt,cmake/SDL3Config.cmake.in}]
|
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[{Makefile.*,*.mk,*.sln,*.pbxproj,*.plist}]
|
|
||||||
indent_size = 8
|
|
||||||
indent_style = tab
|
|
||||||
tab_width = 8
|
|
||||||
|
|
||||||
[src/joystick/controller_type.*]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[src/joystick/hidapi/steam/*.h]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[src/libm/*.c]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[src/test/SDL_test_{crc32,md5,random}.c]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
|
|
||||||
[src/video/yuv2rgb/*.{c,h}]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[wayland-protocols/*.xml]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
|
|
||||||
[*.{markdown,md}]
|
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
# Markdown syntax treats tabs as 4 spaces
|
|
||||||
tab_width = 4
|
|
||||||
|
|
||||||
[{*.bat,*.rc}]
|
|
||||||
end_of_line = crlf
|
|
||||||
|
|
||||||
[*.cocci]
|
|
||||||
insert_final_newline = true
|
|
||||||
173
engine/third_party/SDL3/.gitignore
vendored
173
engine/third_party/SDL3/.gitignore
vendored
|
|
@ -1,173 +0,0 @@
|
||||||
build/
|
|
||||||
build-*/
|
|
||||||
!build-scripts/
|
|
||||||
buildbot/
|
|
||||||
/VERSION.txt
|
|
||||||
__pycache__
|
|
||||||
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
*.dll
|
|
||||||
*.exe
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
*.res
|
|
||||||
*.lib
|
|
||||||
*.a
|
|
||||||
*.la
|
|
||||||
*.dSYM
|
|
||||||
*,e1f
|
|
||||||
*,ff8
|
|
||||||
*.lnk
|
|
||||||
*.err
|
|
||||||
*.exp
|
|
||||||
*.map
|
|
||||||
*.orig
|
|
||||||
*~
|
|
||||||
*.swp
|
|
||||||
*.tmp
|
|
||||||
*.rej
|
|
||||||
|
|
||||||
# for CMake
|
|
||||||
.cmake
|
|
||||||
CMakeFiles/
|
|
||||||
CMakeCache.txt
|
|
||||||
cmake_install.cmake
|
|
||||||
cmake_uninstall.cmake
|
|
||||||
install_manifest.txt
|
|
||||||
*Targets.cmake
|
|
||||||
*Config.cmake
|
|
||||||
*ConfigVersion.cmake
|
|
||||||
CTestTestfile.cmake
|
|
||||||
Testing
|
|
||||||
compile_commands.json
|
|
||||||
.cache/
|
|
||||||
/include-config-*
|
|
||||||
/include-revision
|
|
||||||
/Makefile
|
|
||||||
.ninja_*
|
|
||||||
*.ninja
|
|
||||||
*.pc
|
|
||||||
test/*.test
|
|
||||||
wayland-generated-protocols
|
|
||||||
CMakeSettings.json
|
|
||||||
|
|
||||||
# for CLion
|
|
||||||
.idea
|
|
||||||
cmake-build-*
|
|
||||||
|
|
||||||
# for Xcode
|
|
||||||
*.mode1*
|
|
||||||
*.perspective*
|
|
||||||
*.pbxuser
|
|
||||||
(^|/)build($|/)
|
|
||||||
.DS_Store
|
|
||||||
xcuserdata
|
|
||||||
*.xcworkspace
|
|
||||||
Xcode/build.xcconfig
|
|
||||||
|
|
||||||
# for Visual Studio Code
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# for Visual C++
|
|
||||||
.vs
|
|
||||||
Debug
|
|
||||||
Release
|
|
||||||
*.user
|
|
||||||
*.ncb
|
|
||||||
*.suo
|
|
||||||
*.sdf
|
|
||||||
VisualC/tests/loopwave/sample.wav
|
|
||||||
VisualC/tests/testautomation/*.bmp
|
|
||||||
VisualC/tests/testautomation/*.png
|
|
||||||
VisualC/tests/testcontroller/*.png
|
|
||||||
VisualC/tests/testoverlay/moose.dat
|
|
||||||
VisualC/tests/testrendertarget/icon.png
|
|
||||||
VisualC/tests/testrendertarget/sample.png
|
|
||||||
VisualC/tests/testscale/icon.png
|
|
||||||
VisualC/tests/testscale/sample.png
|
|
||||||
VisualC/tests/testsprite/icon.png
|
|
||||||
VisualC/tests/testyuv/testyuv.png
|
|
||||||
VisualC-GDK/**/Layout
|
|
||||||
src/render/direct3d12/D3D12_*_One.h
|
|
||||||
src/render/direct3d12/D3D12_*_Series.h
|
|
||||||
src/gpu/d3d12/D3D12_*_One.h
|
|
||||||
src/gpu/d3d12/D3D12_*_Series.h
|
|
||||||
out/
|
|
||||||
|
|
||||||
# for Android
|
|
||||||
android-project/local.properties
|
|
||||||
android-project/.gradle/
|
|
||||||
|
|
||||||
test/checkkeys
|
|
||||||
test/checkkeysthreads
|
|
||||||
test/gamepadmap
|
|
||||||
test/loopwave
|
|
||||||
test/loopwavequeue
|
|
||||||
test/testatomic
|
|
||||||
test/testaudiorecording
|
|
||||||
test/testaudiohotplug
|
|
||||||
test/testaudioinfo
|
|
||||||
test/testautomation
|
|
||||||
test/testbounds
|
|
||||||
test/testcustomcursor
|
|
||||||
test/testdisplayinfo
|
|
||||||
test/testdraw
|
|
||||||
test/testdrawchessboard
|
|
||||||
test/testdropfile
|
|
||||||
test/testerror
|
|
||||||
test/testevdev
|
|
||||||
test/testfile
|
|
||||||
test/testfilesystem
|
|
||||||
test/testgamepad
|
|
||||||
test/testgeometry
|
|
||||||
test/testgesture
|
|
||||||
test/testgl
|
|
||||||
test/testgles
|
|
||||||
test/testgles2
|
|
||||||
test/testhaptic
|
|
||||||
test/testhittesting
|
|
||||||
test/testhotplug
|
|
||||||
test/testiconv
|
|
||||||
test/testime
|
|
||||||
test/testintersections
|
|
||||||
test/testjoystick
|
|
||||||
test/testkeys
|
|
||||||
test/testloadso
|
|
||||||
test/testlocale
|
|
||||||
test/testlock
|
|
||||||
test/testmessage
|
|
||||||
test/testmouse
|
|
||||||
test/testmultiaudio
|
|
||||||
test/testnative
|
|
||||||
test/testoverlay
|
|
||||||
test/testplatform
|
|
||||||
test/testpower
|
|
||||||
test/testqsort
|
|
||||||
test/testrelative
|
|
||||||
test/testrendercopyex
|
|
||||||
test/testrendertarget
|
|
||||||
test/testresample
|
|
||||||
test/testrumble
|
|
||||||
test/testscale
|
|
||||||
test/testsem
|
|
||||||
test/testsensor
|
|
||||||
test/testshader
|
|
||||||
test/testshape
|
|
||||||
test/testsprite
|
|
||||||
test/testspriteminimal
|
|
||||||
test/testsurround
|
|
||||||
test/testthread
|
|
||||||
test/testtimer
|
|
||||||
test/testurl
|
|
||||||
test/testver
|
|
||||||
test/testviewport
|
|
||||||
test/testvulkan
|
|
||||||
test/testwm
|
|
||||||
test/testyuv
|
|
||||||
test/torturethread
|
|
||||||
|
|
||||||
# for Doxygen
|
|
||||||
docs/output
|
|
||||||
SDL.tag
|
|
||||||
doxygen_warn.txt
|
|
||||||
41
engine/third_party/SDL3/.wikiheaders-options
vendored
41
engine/third_party/SDL3/.wikiheaders-options
vendored
|
|
@ -1,41 +0,0 @@
|
||||||
projectfullname = Simple Directmedia Layer
|
|
||||||
projectshortname = SDL
|
|
||||||
incsubdir = include/SDL3
|
|
||||||
wikisubdir =
|
|
||||||
readmesubdir = docs
|
|
||||||
apiprefixregex = (SDL_|SDLK_|[US]int\d+)
|
|
||||||
mainincludefname = SDL3/SDL.h
|
|
||||||
versionfname = include/SDL3/SDL_version.h
|
|
||||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
|
||||||
versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
|
|
||||||
versionmicroregex = \A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z
|
|
||||||
apipropertyregex = \A\s*\#\s*define\s+SDL_PROP_
|
|
||||||
selectheaderregex = \ASDL.*?\.h\Z
|
|
||||||
projecturl = https://libsdl.org/
|
|
||||||
wikiurl = https://wiki.libsdl.org
|
|
||||||
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
|
||||||
warn_about_missing = 0
|
|
||||||
#wikipreamble = (This is the documentation for SDL3, which is the current stable version. [SDL2](https://wiki.libsdl.org/SDL2/) was the previous version!)
|
|
||||||
wikiheaderfiletext = Defined in [<SDL3/%fname%>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/%fname%)
|
|
||||||
|
|
||||||
manpageheaderfiletext = Defined in SDL3/%fname%
|
|
||||||
manpagesymbolfilterregex = \A[US]int\d+\Z
|
|
||||||
|
|
||||||
# All SDL_test_* headers become undefined categories, everything else just converts like SDL_audio.h -> Audio
|
|
||||||
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
|
|
||||||
headercategoryeval = s/\ASDL_test_?.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
|
||||||
|
|
||||||
quickrefenabled = 1
|
|
||||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Clipboard,Dialog,Tray,Messagebox,GPU,Vulkan,Metal,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
|
|
||||||
quickreftitle = SDL3 API Quick Reference
|
|
||||||
quickrefurl = https://libsdl.org/
|
|
||||||
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
|
|
||||||
quickrefmacroregex = \A(SDL_PLATFORM_.*|SDL_.*_INTRINSICS|SDL_Atomic...Ref|SDL_assert.*?|SDL_COMPILE_TIME_ASSERT|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast)\Z
|
|
||||||
|
|
||||||
envvarenabled = 1
|
|
||||||
envvartitle = SDL3 Environment Variables
|
|
||||||
envvardesc = SDL3 can be controlled by the user, externally, with environment variables. They are all operate exactly like the [hints you can get and set programmatically](CategoryHints), but named without the `_HINT` part (so `"SDL_HINT_A"` would be environment variable `"SDL_A"`).\n\nThis list matches the latest in SDL3's revision control.
|
|
||||||
envvarsymregex = \ASDL_HINT_(.*)\Z
|
|
||||||
envvarsymreplace = SDL_$1
|
|
||||||
|
|
||||||
|
|
||||||
11
engine/third_party/SDL3/AGENTS.md
vendored
11
engine/third_party/SDL3/AGENTS.md
vendored
|
|
@ -1,11 +0,0 @@
|
||||||
Generative AI, including large language models (LLMs), should not be used in
|
|
||||||
any way when contributing to SDL.
|
|
||||||
|
|
||||||
We want our code to be art. We want to interact with real humans. Please don't
|
|
||||||
submit AI-generated comments or code in bug reports or pull requests. We
|
|
||||||
understand some people consider AI to be a useful tool, but we want to connect
|
|
||||||
with you, not your computer.
|
|
||||||
|
|
||||||
Any pull request to this project will ask you to confirm that you are the
|
|
||||||
author and that you are contributing your changes under the zlib license.
|
|
||||||
|
|
||||||
145
engine/third_party/SDL3/Android.mk
vendored
145
engine/third_party/SDL3/Android.mk
vendored
|
|
@ -1,145 +0,0 @@
|
||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
###########################
|
|
||||||
#
|
|
||||||
# SDL shared library
|
|
||||||
#
|
|
||||||
###########################
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_MODULE := SDL3
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/include/build_config $(LOCAL_PATH)/src
|
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
$(subst $(LOCAL_PATH)/,, \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/audio/aaudio/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
|
|
||||||
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
|
|
||||||
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/camera/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/camera/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/camera/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/core/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
|
|
||||||
$(LOCAL_PATH)/src/dialog/SDL_dialog.c \
|
|
||||||
$(LOCAL_PATH)/src/dialog/SDL_dialog_utils.c \
|
|
||||||
$(LOCAL_PATH)/src/dialog/android/SDL_androiddialog.c \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/io/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/io/generic/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/gpu/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/gpu/vulkan/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/haptic/hidapi/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/hidapi/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/steam/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/locale/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/locale/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/main/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/main/generic/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/misc/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/misc/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/process/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/process/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/filesystem/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/filesystem/posix/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/sensor/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/storage/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/storage/generic/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/time/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/time/unix/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/tray/dummy/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/tray/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c))
|
|
||||||
|
|
||||||
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
|
|
||||||
LOCAL_CFLAGS += \
|
|
||||||
-Wall -Wextra \
|
|
||||||
-Wmissing-prototypes \
|
|
||||||
-Wunreachable-code-break \
|
|
||||||
-Wunneeded-internal-declaration \
|
|
||||||
-Wmissing-variable-declarations \
|
|
||||||
-Wfloat-conversion \
|
|
||||||
-Wshorten-64-to-32 \
|
|
||||||
-Wunreachable-code-return \
|
|
||||||
-Wshift-sign-overflow \
|
|
||||||
-Wstrict-prototypes \
|
|
||||||
-Wkeyword-macro \
|
|
||||||
|
|
||||||
# Warnings we haven't fixed (yet)
|
|
||||||
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
|
|
||||||
|
|
||||||
LOCAL_CXXFLAGS += -std=gnu++11
|
|
||||||
|
|
||||||
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
|
|
||||||
|
|
||||||
LOCAL_LDFLAGS := -Wl,--no-undefined -Wl,--no-undefined-version -Wl,--version-script=$(LOCAL_PATH)/src/dynapi/SDL_dynapi.sym
|
|
||||||
|
|
||||||
ifeq ($(NDK_DEBUG),1)
|
|
||||||
cmd-strip :=
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
|
|
||||||
###########################
|
|
||||||
#
|
|
||||||
# SDL_test static library
|
|
||||||
#
|
|
||||||
###########################
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src
|
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
|
||||||
|
|
||||||
LOCAL_MODULE := SDL3_test
|
|
||||||
|
|
||||||
LOCAL_MODULE_FILENAME := libSDL3_test
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
$(subst $(LOCAL_PATH)/,, \
|
|
||||||
$(wildcard $(LOCAL_PATH)/src/test/*.c))
|
|
||||||
|
|
||||||
LOCAL_LDLIBS :=
|
|
||||||
|
|
||||||
LOCAL_LDFLAGS :=
|
|
||||||
|
|
||||||
LOCAL_EXPORT_LDLIBS :=
|
|
||||||
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
|
||||||
|
|
||||||
19
engine/third_party/SDL3/BUGS.txt
vendored
19
engine/third_party/SDL3/BUGS.txt
vendored
|
|
@ -1,19 +0,0 @@
|
||||||
|
|
||||||
Bugs are now managed in the SDL issue tracker, here:
|
|
||||||
|
|
||||||
https://github.com/libsdl-org/SDL/issues
|
|
||||||
|
|
||||||
You may report bugs there, and search to see if a given issue has already
|
|
||||||
been reported, discussed, and maybe even fixed.
|
|
||||||
|
|
||||||
|
|
||||||
You may also find help at the SDL forums/mailing list:
|
|
||||||
|
|
||||||
https://discourse.libsdl.org/
|
|
||||||
|
|
||||||
or on Discord:
|
|
||||||
|
|
||||||
https://discord.com/invite/BwpFGBWsv8
|
|
||||||
|
|
||||||
Bug reports are welcome here, but we really appreciate if you use the issue tracker, as bugs discussed on the mailing list or Discord may be forgotten or missed.
|
|
||||||
|
|
||||||
11
engine/third_party/SDL3/CLAUDE.md
vendored
11
engine/third_party/SDL3/CLAUDE.md
vendored
|
|
@ -1,11 +0,0 @@
|
||||||
Generative AI, including large language models (LLMs), should not be used in
|
|
||||||
any way when contributing to SDL.
|
|
||||||
|
|
||||||
We want our code to be art. We want to interact with real humans. Please don't
|
|
||||||
submit AI-generated comments or code in bug reports or pull requests. We
|
|
||||||
understand some people consider AI to be a useful tool, but we want to connect
|
|
||||||
with you, not your computer.
|
|
||||||
|
|
||||||
Any pull request to this project will ask you to confirm that you are the
|
|
||||||
author and that you are contributing your changes under the zlib license.
|
|
||||||
|
|
||||||
4377
engine/third_party/SDL3/CMakeLists.txt
vendored
4377
engine/third_party/SDL3/CMakeLists.txt
vendored
File diff suppressed because it is too large
Load diff
38
engine/third_party/SDL3/CREDITS.md
vendored
38
engine/third_party/SDL3/CREDITS.md
vendored
|
|
@ -1,38 +0,0 @@
|
||||||
# Simple DirectMedia Layer CREDITS
|
|
||||||
|
|
||||||
Thanks to everyone who made this possible, including:
|
|
||||||
|
|
||||||
- Cliff Matthews, for giving me a reason to start this project. :) -- Executor rocks! *grin*
|
|
||||||
- Ryan Gordon for helping everybody out and keeping the dream alive. :)
|
|
||||||
- Frank Praznik for his Wayland support and general windowing development.
|
|
||||||
- Ozkan Sezer for sanity checks and make sure the i's are dotted and t's are crossed.
|
|
||||||
- Anonymous Maarten for CMake support and build system development.
|
|
||||||
- Evan Hemsley, Caleb Cornett, and Ethan Lee for SDL GPU development.
|
|
||||||
- Gabriel Jacobo for his work on the Android port and generally helping out all around.
|
|
||||||
- Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
|
|
||||||
- Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
|
|
||||||
- Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
|
|
||||||
- Alfred Reynolds for the game controller API and general (in)sanity
|
|
||||||
- Jørgen Tjernø¸ for numerous magical macOS fixes.
|
|
||||||
- Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
|
|
||||||
- Julian Winter for the SDL 2.0 website.
|
|
||||||
- Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
|
|
||||||
- Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
|
|
||||||
- Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
|
|
||||||
- Jim Grandpre for his work on multi-touch and gesture recognition during
|
|
||||||
the Google Summer of Code 2010.
|
|
||||||
- Edgar "bobbens" Simo for his force feedback API development during the
|
|
||||||
Google Summer of Code 2008.
|
|
||||||
- Aaron Wishnick for his work on audio resampling and pitch shifting during
|
|
||||||
the Google Summer of Code 2008.
|
|
||||||
- Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
|
|
||||||
Google Summer of Code 2008.
|
|
||||||
- Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
|
|
||||||
- Everybody at Loki Software, Inc. and Valve Corporation for their great contributions!
|
|
||||||
|
|
||||||
And a big hand to everyone else who has contributed over the years.
|
|
||||||
|
|
||||||
THANKS! :)
|
|
||||||
|
|
||||||
-- Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
48
engine/third_party/SDL3/INSTALL.md
vendored
48
engine/third_party/SDL3/INSTALL.md
vendored
|
|
@ -1,48 +0,0 @@
|
||||||
# To build and use SDL:
|
|
||||||
|
|
||||||
SDL supports a number of development environments:
|
|
||||||
- [CMake](docs/INTRO-cmake.md)
|
|
||||||
- [Visual Studio on Windows](docs/INTRO-visualstudio.md)
|
|
||||||
- [gcc on Windows](docs/INTRO-mingw.md)
|
|
||||||
- [Xcode on Apple platforms](docs/INTRO-xcode.md)
|
|
||||||
- [Android Studio](docs/INTRO-androidstudio.md)
|
|
||||||
- [Emscripten for web](docs/INTRO-emscripten.md)
|
|
||||||
|
|
||||||
SDL is also usable in other environments. The basic steps are to use CMake to build the library and then use the headers and library that you built in your project. You can search online to see if anyone has specific steps for your setup.
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
An API reference, tutorials, and additional documentation is available at:
|
|
||||||
|
|
||||||
https://wiki.libsdl.org/SDL3
|
|
||||||
|
|
||||||
# Example code
|
|
||||||
|
|
||||||
There are simple example programs in the examples directory, and you can view them online at:
|
|
||||||
|
|
||||||
https://examples.libsdl.org/SDL3
|
|
||||||
|
|
||||||
More in-depth test programs are available in the tests directory and can be built by adding `-DSDL_TESTS=ON` to the CMake command line when building SDL.
|
|
||||||
|
|
||||||
# Discussions
|
|
||||||
|
|
||||||
## Discord
|
|
||||||
|
|
||||||
You can join the official Discord server at:
|
|
||||||
|
|
||||||
https://discord.com/invite/BwpFGBWsv8
|
|
||||||
|
|
||||||
## Forums/mailing lists
|
|
||||||
|
|
||||||
You can join SDL development discussions at:
|
|
||||||
|
|
||||||
https://discourse.libsdl.org/
|
|
||||||
|
|
||||||
Once you sign up, you can use the forum through the website or as a mailing list from your email client.
|
|
||||||
|
|
||||||
## Announcement list
|
|
||||||
|
|
||||||
You can sign up for the low traffic announcement list at:
|
|
||||||
|
|
||||||
https://www.libsdl.org/mailing-list.php
|
|
||||||
|
|
||||||
18
engine/third_party/SDL3/LICENSE.txt
vendored
18
engine/third_party/SDL3/LICENSE.txt
vendored
|
|
@ -1,18 +0,0 @@
|
||||||
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.
|
|
||||||
|
|
||||||
17
engine/third_party/SDL3/README.md
vendored
17
engine/third_party/SDL3/README.md
vendored
|
|
@ -1,17 +0,0 @@
|
||||||
|
|
||||||
Simple DirectMedia Layer (SDL for short) is a cross-platform library
|
|
||||||
designed to make it easy to write multi-media software, such as games
|
|
||||||
and emulators.
|
|
||||||
|
|
||||||
You can find the latest release and additional information at:
|
|
||||||
https://www.libsdl.org/
|
|
||||||
|
|
||||||
Installation instructions and a quick introduction is available in
|
|
||||||
[INSTALL.md](INSTALL.md)
|
|
||||||
|
|
||||||
This library is distributed under the terms of the zlib license,
|
|
||||||
available in [LICENSE.txt](LICENSE.txt).
|
|
||||||
|
|
||||||
Enjoy!
|
|
||||||
|
|
||||||
Sam Lantinga (slouken@libsdl.org)
|
|
||||||
120
engine/third_party/SDL3/VisualC-GDK/SDL.sln
vendored
120
engine/third_party/SDL3/VisualC-GDK/SDL.sln
vendored
|
|
@ -1,120 +0,0 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.1.32414.318
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite", "tests\testsprite\testsprite.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcontroller", "tests\testcontroller\testcontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgdk", "tests\testgdk\testgdk.vcxproj", "{1C9A3F71-35A5-4C56-B292-F4375B3C3649}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Gaming.Desktop.x64 = Debug|Gaming.Desktop.x64
|
|
||||||
Debug|Gaming.Xbox.Scarlett.x64 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
Debug|Gaming.Xbox.XboxOne.x64 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
Release|Gaming.Desktop.x64 = Release|Gaming.Desktop.x64
|
|
||||||
Release|Gaming.Xbox.Scarlett.x64 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
Release|Gaming.Xbox.XboxOne.x64 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Xbox.Scarlett.x64.Deploy.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Xbox.XboxOne.x64.Deploy.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Desktop.x64.Deploy.0 = Release|Gaming.Desktop.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Xbox.Scarlett.x64.Deploy.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Xbox.XboxOne.x64.Deploy.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Xbox.Scarlett.x64.Deploy.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Xbox.XboxOne.x64.Deploy.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Desktop.x64.Deploy.0 = Release|Gaming.Desktop.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Xbox.Scarlett.x64.Deploy.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Xbox.XboxOne.x64.Deploy.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Xbox.Scarlett.x64.Deploy.0 = Debug|Gaming.Xbox.Scarlett.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Xbox.XboxOne.x64.Deploy.0 = Debug|Gaming.Xbox.XboxOne.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Desktop.x64.Deploy.0 = Release|Gaming.Desktop.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Xbox.Scarlett.x64.Deploy.0 = Release|Gaming.Xbox.Scarlett.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Xbox.XboxOne.x64.Deploy.0 = Release|Gaming.Xbox.XboxOne.x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
|
||||||
{55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
|
||||||
{1C9A3F71-35A5-4C56-B292-F4375B3C3649} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {C320C9F2-1A8F-41D7-B02B-6338F872BCAD}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
938
engine/third_party/SDL3/VisualC-GDK/SDL/SDL.vcxproj
vendored
938
engine/third_party/SDL3/VisualC-GDK/SDL/SDL.vcxproj
vendored
|
|
@ -1,938 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Gaming.Desktop.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Gaming.Xbox.Scarlett.x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Gaming.Xbox.XboxOne.x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Gaming.Desktop.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Gaming.Xbox.Scarlett.x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Gaming.Xbox.XboxOne.x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectName>SDL3</ProjectName>
|
|
||||||
<ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
|
|
||||||
<RootNamespace>SDL</RootNamespace>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
|
|
||||||
<IncludePath>$(ProjectDir)../../src;$(IncludePath)</IncludePath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
|
|
||||||
<IncludePath>$(ProjectDir)../../src;$(IncludePath)</IncludePath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
|
|
||||||
<Midl>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;vcruntimed.lib;msvcrtd.lib;ucrtd.lib;msvcprtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
|
|
||||||
<Midl>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;d3d12_xs.lib;uuid.lib;vcruntimed.lib;msvcrtd.lib;ucrtd.lib;msvcprtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Command>
|
|
||||||
call "$(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
|
|
||||||
call "$(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Message>Building shader blobs (Xbox Series)</Message>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
|
|
||||||
<Midl>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;d3d12_x.lib;uuid.lib;vcruntimed.lib;msvcrtd.lib;ucrtd.lib;msvcprtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Command>
|
|
||||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
|
||||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Message>Building shader blobs (Xbox One)</Message>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
|
|
||||||
<Midl>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;vcruntime.lib;msvcrt.lib;ucrt.lib;msvcprt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
|
|
||||||
<Midl>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;d3d12_xs.lib;uuid.lib;vcruntime.lib;msvcrt.lib;ucrt.lib;msvcprt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Command>
|
|
||||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
|
||||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Message>Building shader blobs (Xbox Series)</Message>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
|
|
||||||
<Midl>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;d3d12_x.lib;uuid.lib;vcruntime.lib;msvcrt.lib;ucrt.lib;msvcprt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Command>
|
|
||||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
|
||||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Message>Building shader blobs (Xbox One)</Message>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
|
|
||||||
<ClCompile>
|
|
||||||
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_assert.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_atomic.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_audio.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_bits.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_blendmode.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_camera.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_clipboard.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_close_code.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_copying.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_cpuinfo.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_dialog.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_dlopennote.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_egl.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_endian.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_error.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_gpu.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_init.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_intrin.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_iostream.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_keyboard.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_keycode.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_loadso.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_locale.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_log.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_main.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_main_impl.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_messagebox.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_metal.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_misc.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_mouse.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_mutex.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_oldnames.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengl.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengl_glext.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2ext.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2platform.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_pen.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_process.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_properties.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_render.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_revision.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_scancode.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_surface.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_system.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_assert.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_common.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_compare.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_crc32.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_font.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_fuzzer.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_md5.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_memory.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_thread.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_timer.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_touch.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_tray.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_version.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_video.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_vulkan.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audioqueue.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audioresample.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
|
|
||||||
<ClInclude Include="..\..\src\camera\SDL_camera_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\camera\SDL_syscamera.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\gdk\SDL_gdk.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\SDL_core_unsupported.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_gameinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_hid.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_immdevice.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\cpuinfo\SDL_cpuinfo_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
|
|
||||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
|
|
||||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\blank_cursor.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\default_cursor.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\scancodes_windows.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_categories_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_eventwatch_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_keymap_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
|
|
||||||
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
|
|
||||||
<ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\SDL_hidapihaptic.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\hidapi\hidapi\hidapi.h" />
|
|
||||||
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\controller_type.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\hidapi\SDL_report_descriptor.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\libm\math_libm.h" />
|
|
||||||
<ClInclude Include="..\..\src\libm\math_private.h" />
|
|
||||||
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
|
|
||||||
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
|
|
||||||
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
|
|
||||||
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d\SDL_shaders_d3d.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengl\SDL_glfuncs.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\SDL_sysrender.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_draw.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_triangle.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_assert_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_error_c.h" />
|
|
||||||
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp">
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\core\windows\pch.c">
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Create</PrecompiledHeader>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp">
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp">
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxone.cpp">
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxseries.cpp">
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
|
|
||||||
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\SDL_asyncio.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
|
|
||||||
<ClCompile Include="..\..\src\main\gdk\SDL_sysmain_runapp.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
|
||||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
|
||||||
<ClCompile Include="..\..\src\main\SDL_runapp.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_guid.c" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_hashtable.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_hints_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_internal.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_list.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_log_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_properties_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\windows\SDL_windowssensor.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\generic\SDL_sysrwlock_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\generic\SDL_syscond_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\windows\SDL_sysmutex_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\gdk\SDL_gdktextinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_icd.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_layer.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_sdk_platform.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_android.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_beta.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_core.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_directfb.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_fuchsia.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_ggp.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_ios.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_macos.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_metal.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_vi.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_wayland.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_win32.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xcb.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_clipboard_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_egl_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_rotate.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_stb_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_surface_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_video_unsupported.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsgameinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsrawinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_internal.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx_func.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
|
|
||||||
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
|
|
||||||
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audio.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audioqueue.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audioresample.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_gameinput.cpp"/>
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c">
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\dummy\SDL_dummydialog.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\dialog\windows\SDL_windowsdialog.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c">
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">NotUsing</PrecompiledHeader>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_categories.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_events.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_keymap.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_pen.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_quit.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_touch.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\SDL_iostream.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c">
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c" />
|
|
||||||
<ClCompile Include="..\..\src\hidapi\SDL_hidapi.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\controller_type.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_8bitdo.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_flydigi.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_combined.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gip.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps3.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_triton.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_zuiki.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_report_descriptor.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c">
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c">
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\libm\s_modf.c" />
|
|
||||||
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
|
|
||||||
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
|
|
||||||
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
|
|
||||||
<ClCompile Include="..\..\src\misc\SDL_libusb.c" />
|
|
||||||
<ClCompile Include="..\..\src\misc\SDL_url.c" />
|
|
||||||
<ClCompile Include="..\..\src\misc\windows\SDL_sysurl.c" />
|
|
||||||
<ClCompile Include="..\..\src\power\SDL_power.c" />
|
|
||||||
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
|
|
||||||
<ClCompile Include="..\..\src\process\SDL_process.c" />
|
|
||||||
<ClCompile Include="..\..\src\process\dummy\SDL_dummyprocess.c" />
|
|
||||||
<ClCompile Include="..\..\src\process\windows\SDL_windowsprocess.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12.c">
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_triangle.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_assert.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_list.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_error.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_hashtable.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_hints.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_log.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_properties.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
|
|
||||||
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
|
|
||||||
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_crc16.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_crc32.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_memmove.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
|
|
||||||
<MASM Condition="'$(Platform)'=='x64'" Include="..\..\src\stdlib\SDL_mslibc_x64.masm">
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
</MASM>
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_murmur3.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_random.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
|
|
||||||
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
|
|
||||||
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\generic\SDL_sysrwlock.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_syscond_cv.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_sysrwlock_srw.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
|
|
||||||
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
|
|
||||||
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
|
|
||||||
<ClCompile Include="..\..\src\time\SDL_time.c" />
|
|
||||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
|
|
||||||
<ClCompile Include="..\..\src\tray\dummy\SDL_tray.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\gdk\SDL_gdktextinput.cpp">
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_bmp.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_clipboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_egl.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_fillrect.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_rect.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_rotate.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_stb.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_surface.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_video.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsrawinput.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
|
|
||||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c">
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
|
||||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,512 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\pch.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxone.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxseries.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
|
||||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
|
||||||
<ClCompile Include="..\..\src\main\gdk\SDL_sysmain_runapp.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\main\SDL_runapp.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_guid.c" />
|
|
||||||
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
|
|
||||||
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audio.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audioqueue.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_audioresample.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
|
||||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_gameinput.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
|
|
||||||
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c" />
|
|
||||||
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
|
|
||||||
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_categories.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_events.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_keymap.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_pen.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_quit.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_touch.c" />
|
|
||||||
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\SDL_iostream.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
|
|
||||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic.c" />
|
|
||||||
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c" />
|
|
||||||
<ClCompile Include="..\..\src\hidapi\SDL_hidapi.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\controller_type.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_8bitdo.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_flydigi.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_combined.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gip.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps3.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_triton.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_zuiki.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_report_descriptor.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
|
|
||||||
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
|
|
||||||
<ClCompile Include="..\..\src\libm\s_modf.c" />
|
|
||||||
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
|
|
||||||
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
|
|
||||||
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
|
|
||||||
<ClCompile Include="..\..\src\misc\SDL_libusb.c" />
|
|
||||||
<ClCompile Include="..\..\src\misc\SDL_url.c" />
|
|
||||||
<ClCompile Include="..\..\src\misc\windows\SDL_sysurl.c" />
|
|
||||||
<ClCompile Include="..\..\src\power\SDL_power.c" />
|
|
||||||
<ClCompile Include="..\..\src\process\SDL_process.c" />
|
|
||||||
<ClCompile Include="..\..\src\process\dummy\SDL_dummyprocess.c" />
|
|
||||||
<ClCompile Include="..\..\src\process\windows\SDL_windowsprocess.c" />
|
|
||||||
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\software\SDL_triangle.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_assert.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_list.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_error.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_hashtable.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_hints.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_log.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_properties.c" />
|
|
||||||
<ClCompile Include="..\..\src\SDL_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
|
|
||||||
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
|
|
||||||
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_crc16.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_crc32.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_memmove.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_murmur3.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_random.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
|
|
||||||
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\generic\SDL_sysrwlock.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_syscond_cv.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_sysrwlock_srw.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
|
|
||||||
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
|
|
||||||
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
|
|
||||||
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\gdk\SDL_gdktextinput.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_bmp.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_clipboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_egl.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_fillrect.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_rect.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_rotate.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_stb.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_surface.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_video.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsrawinput.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
|
|
||||||
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
|
|
||||||
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
|
|
||||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\SDL_asyncio.c" />
|
|
||||||
<ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\dummy\SDL_dummydialog.c" />
|
|
||||||
<ClCompile Include="..\..\src\dialog\windows\SDL_windowsdialog.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c" />
|
|
||||||
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
|
|
||||||
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
|
|
||||||
<ClCompile Include="..\..\src\time\SDL_time.c" />
|
|
||||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
|
|
||||||
<ClCompile Include="..\..\src\tray\dummy\SDL_tray.c" />
|
|
||||||
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c" />
|
|
||||||
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
|
|
||||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_assert.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_atomic.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_audio.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_bits.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_blendmode.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_camera.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_clipboard.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_close_code.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_copying.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_cpuinfo.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_dialog.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_dlopennote.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_egl.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_endian.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_error.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_gpu.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_init.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_intrin.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_iostream.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_keyboard.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_keycode.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_loadso.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_locale.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_log.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_main.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_main_impl.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_messagebox.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_metal.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_misc.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_mouse.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_mutex.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_oldnames.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengl.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengl_glext.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2ext.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2platform.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_pen.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_process.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_properties.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_render.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_revision.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_scancode.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_surface.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_system.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_assert.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_common.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_compare.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_crc32.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_font.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_fuzzer.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_md5.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_test_memory.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_thread.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_timer.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_touch.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_tray.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_version.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_video.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_vulkan.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audioqueue.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_audioresample.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
|
|
||||||
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\gdk\SDL_gdk.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_gameinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_hid.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_immdevice.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\core\SDL_core_unsupported.h" />
|
|
||||||
<ClInclude Include="..\..\src\cpuinfo\SDL_cpuinfo_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
|
|
||||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
|
|
||||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\blank_cursor.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\default_cursor.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\scancodes_windows.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_categories_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_eventwatch_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_keymap_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\SDL_hidapihaptic.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\hidapi\hidapi\hidapi.h" />
|
|
||||||
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\controller_type.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\hidapi\SDL_report_descriptor.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\libm\math_libm.h" />
|
|
||||||
<ClInclude Include="..\..\src\libm\math_private.h" />
|
|
||||||
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
|
|
||||||
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
|
|
||||||
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
|
|
||||||
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\direct3d\SDL_shaders_d3d.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengl\SDL_glfuncs.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\SDL_sysrender.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_draw.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\render\software\SDL_triangle.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_assert_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_error_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_hashtable.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_hints_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_internal.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_list.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_log_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\SDL_properties_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
|
|
||||||
<ClInclude Include="..\..\src\sensor\windows\SDL_windowssensor.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\generic\SDL_sysrwlock_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\generic\SDL_syscond_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\windows\SDL_sysmutex_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\gdk\SDL_gdktextinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_icd.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_layer.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_sdk_platform.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_android.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_beta.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_core.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_directfb.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_fuchsia.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_ggp.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_ios.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_macos.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_metal.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_vi.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_wayland.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_win32.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xcb.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_clipboard_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_egl_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_rotate.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_stb_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_surface_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_video_unsupported.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsgameinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsrawinput.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_camera.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
|
|
||||||
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
|
|
||||||
<ClInclude Include="..\..\src\camera\SDL_camera_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\camera\SDL_syscamera.h" />
|
|
||||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
|
|
||||||
<ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
|
|
||||||
<ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_internal.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx_func.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.h" />
|
|
||||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,216 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Gaming.Desktop.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Gaming.Xbox.Scarlett.x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Gaming.Xbox.XboxOne.x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Gaming.Desktop.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Gaming.Xbox.Scarlett.x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Gaming.Xbox.XboxOne.x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectName>SDL3_test</ProjectName>
|
|
||||||
<ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
|
|
||||||
<RootNamespace>SDL_test</RootNamespace>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
|
|
||||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
|
|
||||||
<Midl />
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<StringPooling>true</StringPooling>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
|
|
||||||
<Midl />
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<StringPooling>true</StringPooling>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
|
|
||||||
<Midl />
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<StringPooling>true</StringPooling>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
|
|
||||||
<Midl />
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
|
|
||||||
<Midl />
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
|
|
||||||
<Midl />
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
|
|
||||||
<ClCompile>
|
|
||||||
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_internal.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_assert.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_common.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_compare.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_crc32.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
|
|
||||||
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
7
engine/third_party/SDL3/VisualC-GDK/clean.sh
vendored
7
engine/third_party/SDL3/VisualC-GDK/clean.sh
vendored
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
find . -type f \( -name '*.user' -o -name '*.sdf' -o -name '*.ncb' -o -name '*.suo' \) -print -delete
|
|
||||||
find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -delete
|
|
||||||
find . -depth -type d \( -name Gaming.Desktop.x64 \) -exec rm -rv {} \;
|
|
||||||
find . -depth -type d \( -name Gaming.Xbox.Scarlett.x64 \) -exec rm -rv {} \;
|
|
||||||
find . -depth -type d \( -name Gaming.Xbox.XboxOne.x64 \) -exec rm -rv {} \;
|
|
||||||
rm shaders/*.h
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.4 KiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue