2019-01-11 21:27:26 +03:00
|
|
|
# Development notes
|
|
|
|
|
|
|
|
Find packages to upgrade: `cargo outdated -R`
|
2019-01-14 22:29:06 +03:00
|
|
|
|
2019-08-22 22:53:30 +03:00
|
|
|
Deal with compile tile: `cargo bloat --time`
|
|
|
|
|
2019-09-07 23:09:09 +03:00
|
|
|
Find why two binary crates aren't sharing dependencies:
|
|
|
|
https://old.reddit.com/r/rust/comments/cqceu4/common_crates_in_cargo_workspace_recompiled/
|
2019-08-22 22:53:30 +03:00
|
|
|
|
|
|
|
Where's a dependency coming from? `cargo tree -i -p syn`
|
|
|
|
|
2019-01-14 22:29:06 +03:00
|
|
|
Diff screencaps: http://www.imagemagick.org/Usage/compare/#methods
|
2019-01-15 01:36:46 +03:00
|
|
|
|
2019-01-24 09:27:32 +03:00
|
|
|
Debug OpenGL calls:
|
2019-03-13 02:31:54 +03:00
|
|
|
|
|
|
|
```
|
2019-12-03 23:06:49 +03:00
|
|
|
apitrace trace --api gl ../target/debug/game ../data/input/raw_maps/montlake.bin
|
2019-09-07 23:09:09 +03:00
|
|
|
qapitrace game.trace
|
|
|
|
apitrace dump game.trace
|
2019-03-13 02:31:54 +03:00
|
|
|
```
|
2019-03-12 00:01:06 +03:00
|
|
|
|
2019-05-20 02:13:19 +03:00
|
|
|
Understand XML: just use firefox
|
|
|
|
|
2019-03-12 00:01:06 +03:00
|
|
|
## Profiling
|
|
|
|
|
2020-02-09 03:27:45 +03:00
|
|
|
Actually, https://github.com/flamegraph-rs/flamegraph is pretty cool too.
|
|
|
|
|
2019-03-13 02:31:54 +03:00
|
|
|
`apt-get install google-perftools libgoogle-perftools-dev`
|
2019-03-12 00:01:06 +03:00
|
|
|
|
|
|
|
Follow Usage from https://crates.io/crates/cpuprofiler
|
|
|
|
|
2020-02-07 04:52:18 +03:00
|
|
|
Modify `game/Cargo.toml` to include the `profiler` feature on `ezgui`. Then
|
2019-09-23 23:37:47 +03:00
|
|
|
run game or headless with `--enable_profiler`
|
2019-03-13 02:31:54 +03:00
|
|
|
|
|
|
|
```
|
2019-09-07 23:09:09 +03:00
|
|
|
google-pprof --no_strip_temp ../target/debug/game profile
|
2019-03-12 00:01:06 +03:00
|
|
|
google-pprof --no_strip_temp ../target/release/headless profile
|
|
|
|
top30 --cum
|
2019-03-13 02:31:54 +03:00
|
|
|
```
|
2019-03-12 02:23:39 +03:00
|
|
|
|
|
|
|
## Building releases
|
|
|
|
|
2019-03-16 01:14:31 +03:00
|
|
|
Cross-compilation notes: https://github.com/rust-embedded/cross Or use
|
|
|
|
https://github.com/japaric/trust
|
|
|
|
|
|
|
|
Initially have to:
|
|
|
|
|
|
|
|
```shell
|
2019-10-20 23:38:10 +03:00
|
|
|
cargo install cross
|
|
|
|
sudo apt-get install docker.io
|
|
|
|
sudo usermod -aG docker ${USER}
|
2019-03-16 01:14:31 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Then:
|
2019-03-12 02:23:39 +03:00
|
|
|
|
2019-03-13 02:31:54 +03:00
|
|
|
```
|
2019-04-10 20:55:53 +03:00
|
|
|
sudo systemctl start docker
|
2019-09-07 23:09:09 +03:00
|
|
|
cross build --release --target x86_64-pc-windows-gnu --bin game
|
2019-12-03 23:22:59 +03:00
|
|
|
wine target/x86_64-pc-windows-gnu/release/game.exe data/system/maps/montlake.bin
|
2019-03-13 02:31:54 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
## Markdown
|
|
|
|
|
|
|
|
For formatting:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt-get install npm
|
|
|
|
cd ~; mkdir npm; cd npm
|
|
|
|
npm init --yes
|
|
|
|
npm install prettier --save-dev --save-exact
|
|
|
|
```
|
|
|
|
|
|
|
|
Use https://github.com/joeyespo/grip to render. Doesn't seem to work with the
|
|
|
|
graphviz image.
|
2019-04-16 23:06:01 +03:00
|
|
|
|
2019-07-06 21:25:10 +03:00
|
|
|
https://github.com/ekalinin/github-markdown-toc for table of contents (stashed
|
|
|
|
in ~/Downloads/gh-md-toc)
|
2019-04-18 00:49:51 +03:00
|
|
|
|
2019-04-16 23:06:01 +03:00
|
|
|
## Videos
|
|
|
|
|
|
|
|
```
|
|
|
|
# Fullscreen
|
2020-01-14 05:52:44 +03:00
|
|
|
ffmpeg -f x11grab -r 25 -s 1920x960 -i :0.0+0,55 -vcodec huffyuv raw.avi
|
2019-04-16 23:06:01 +03:00
|
|
|
|
|
|
|
ffmpeg -ss 10.0 -t 5.0 -i raw.avi -f gif -filter_complex "[0:v] fps=12,scale=1024:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" screencast.gif
|
|
|
|
```
|
2019-10-16 04:49:06 +03:00
|
|
|
|
2019-11-08 03:16:04 +03:00
|
|
|
## Faster linking
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt-get install lld
|
|
|
|
```
|
|
|
|
|
|
|
|
Stick this in ~/.cargo/config:
|
|
|
|
|
|
|
|
```
|
|
|
|
[target.x86_64-unknown-linux-gnu]
|
|
|
|
rustflags = [
|
|
|
|
"-C", "link-arg=-fuse-ld=lld",
|
|
|
|
]
|
|
|
|
```
|
2020-03-17 20:35:37 +03:00
|
|
|
|
|
|
|
## git
|
|
|
|
|
|
|
|
Keep a fork up to date:
|
|
|
|
|
|
|
|
```
|
|
|
|
# Once
|
|
|
|
git remote add upstream https://github.com/rust-windowing/glutin/
|
|
|
|
|
|
|
|
git fetch upstream
|
|
|
|
git merge upstream/master
|
|
|
|
git diff upstream/master
|
|
|
|
```
|
2020-03-21 01:22:45 +03:00
|
|
|
|
|
|
|
## Refactoring
|
|
|
|
|
|
|
|
perl -pi -e 's/WrappedComposite::text_button\(ctx, (.+?), (.+?)\)/Btn::text_fg(\1).build_def\(ctx, \2\)/' `find|grep rs|xargs`
|
2020-04-13 01:54:46 +03:00
|
|
|
|
|
|
|
## Stack overflow
|
|
|
|
|
|
|
|
rust-gdb --args ../target/release/game --dev
|
2020-04-28 04:48:19 +03:00
|
|
|
|
|
|
|
## Drawing diagrams
|
|
|
|
|
|
|
|
draw.io
|
2020-05-24 21:07:29 +03:00
|
|
|
|
|
|
|
## Mapping
|
|
|
|
|
|
|
|
xodo on Android for annotating maps in the field
|
2020-05-29 18:00:59 +03:00
|
|
|
|
|
|
|
## OSM tools
|
|
|
|
|
|
|
|
osmcha.org for recent changes
|
|
|
|
|
|
|
|
To upload diffs:
|
|
|
|
|
|
|
|
```
|
|
|
|
java -jar ~/Downloads/josm-tested.jar ~/abstreet/map_editor/diff.osc
|
|
|
|
```
|
|
|
|
|
|
|
|
JOSM: Press (and release T), then click to pan. Download a relevant layer,
|
|
|
|
select the .osc, merge, then upload.
|