Get view-menu to play the interface sound

This commit is contained in:
2020-03-21 23:45:51 +00:00
parent 83aa1c4768
commit bcaf3d9b58
7 changed files with 151 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ installed on your system:
```
$ go version
go version go1.13 linux/amd64
go version go1.14 linux/amd64
```
In addition, you'll also need the following packages installed, at least in
@@ -27,13 +27,11 @@ Debian:
```
# apt install libx11-dev libxcursor-dev mesa-common-dev libxrandr-dev \
libxinerama-dev libgl1-mesa-dev libxi-dev mpv
libxinerama-dev libgl1-mesa-dev libxi-dev libasound2-dev mpv ffmpeg
```
You can then run `make all` in the source tree to get the binaries that are
present at hte moment.
They're not very interesting :D.
present at the moment.
Place your WH40K: Chaos Gate installation in `./orig` to benefit from automatic
path defaults. Otherwise, point to it with `-game-path`
@@ -42,14 +40,13 @@ The `view-map` binary attempts to render a map, and is the current focus of
effort. Once I can render a whole map, including pre-placed characters (cultist
scum), things can start to get more interesting.
Current status: map tiles are rendered at correct offsets. Static objects (four
per map coordinate: floor, centre, left, and right) are rendered mostly fine,
although objects at each Z level don't *quite* stack correctly on top of each
other yet.
Current status: almost pixel-perfect map rendering. Static objects (four per map
coordinate: floor, centre, left, and right) are rendered fine, and each Z level
looks good. There are a few minor artifacts here and there.
Characters and animations aren't touched at all yet. Rendering performance is
atrocious. No gameplay, no sound, no campaign logic. Interaction with the play
area is minimal and limited to pan, zoom, and click for basic console output.
poor. No gameplay, no campaign logic. Interaction with the play area is minimal
and limited to pan, zoom, and click for basic console output.
Still, I'm proud of myself.
@@ -57,7 +54,7 @@ To run:
```
$ make view-map
$ ./view-map -map orig/Maps/Chapter01.MAP -txt orig/Maps/Chapter01.TXT
$ ./view-map -map Chapter01
```
Looks like this:
@@ -72,12 +69,36 @@ Dependency management uses `go mod`, so ensure you have at least Go 1.11.
There is the **start** of the menu / campaign flow in a `wh40k` binary:
```
$ cp config.toml.example config.toml
$ make wh40k
$ ./wh40k
```
This plays the introductory video so far, and nothing else. I'm hopeful I can
render the main menu next.
This plays the introductory videos so far, and nothing else.
Menus are in the process of being rendered; you can use the `view-menu` binary
to inspect them:
```
make view-menu
./view-menu -menu ./orig/Menu/Main.mnu
```
This menu *displays* OK, including
## Sound
Sound is in the very early stages. Chaos Gate uses ADPCM WAV files, which are a
pain to play in Go, so for now, a preprocessing step that converts them to .ogg
is used instead. To create ./orig/Wav/*.wav.ogg, run:
```
# apt install ffmpeg
$ ./scripts/convert-wav ./orig/Wav
```
As with video playback, the ambition is to *eventually* remove this dependency
and operate on the unmodified files instead.
## Miscellany