From caaf0954abdc415bf21a03b928b590ba690ecbed Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sat, 7 Sep 2019 13:09:09 -0700 Subject: [PATCH] rename the main editor crate to game -- map editing is just a tiny piece ;) --- .gitignore | 2 +- Cargo.toml | 2 +- abstutil/src/lib.rs | 4 ++-- clickable_links.py | 2 +- docs/INSTRUCTIONS.md | 2 +- docs/articles/rust/article.md | 6 +++--- docs/articles/trafficsim/article.md | 2 +- docs/development.md | 17 +++++++++-------- docs/new_city.md | 2 +- docs/project/references.md | 2 +- {editor => game}/Cargo.toml | 2 +- {editor => game}/build.rs | 0 {editor => game}/compare_screencaps.sh | 0 {editor => game}/confirm_screencap.sh | 0 {editor => game}/src/abtest/mod.rs | 0 {editor => game}/src/abtest/score.rs | 0 {editor => game}/src/abtest/setup.rs | 0 {editor => game}/src/common/agent.rs | 0 {editor => game}/src/common/associated.rs | 0 {editor => game}/src/common/colors.rs | 0 {editor => game}/src/common/mod.rs | 0 {editor => game}/src/common/navigate.rs | 0 {editor => game}/src/common/route_explorer.rs | 0 {editor => game}/src/common/route_viewer.rs | 0 {editor => game}/src/common/shortcuts.rs | 0 {editor => game}/src/common/speed.rs | 0 {editor => game}/src/common/time.rs | 0 {editor => game}/src/common/trip_explorer.rs | 0 {editor => game}/src/common/turn_cycler.rs | 0 {editor => game}/src/common/warp.rs | 0 {editor => game}/src/debug/bus_explorer.rs | 0 {editor => game}/src/debug/chokepoints.rs | 0 {editor => game}/src/debug/color_picker.rs | 0 {editor => game}/src/debug/connected_roads.rs | 0 {editor => game}/src/debug/floodfill.rs | 0 {editor => game}/src/debug/mod.rs | 0 .../src/debug/neighborhood_summary.rs | 0 {editor => game}/src/debug/objects.rs | 0 {editor => game}/src/debug/polygons.rs | 0 {editor => game}/src/debug/routes.rs | 0 {editor => game}/src/edit/mod.rs | 0 {editor => game}/src/edit/stop_signs.rs | 0 {editor => game}/src/edit/traffic_signals.rs | 0 {editor => game}/src/game.rs | 4 ++-- {editor => game}/src/helpers.rs | 0 {editor => game}/src/main.rs | 0 {editor => game}/src/mission/all_trips.rs | 0 {editor => game}/src/mission/dataviz.rs | 0 {editor => game}/src/mission/individ_trips.rs | 0 {editor => game}/src/mission/mod.rs | 0 {editor => game}/src/mission/neighborhood.rs | 0 {editor => game}/src/mission/scenario.rs | 0 {editor => game}/src/render/area.rs | 0 {editor => game}/src/render/bike.rs | 0 {editor => game}/src/render/building.rs | 0 {editor => game}/src/render/bus_stop.rs | 0 {editor => game}/src/render/car.rs | 0 {editor => game}/src/render/extra_shape.rs | 0 {editor => game}/src/render/intersection.rs | 0 {editor => game}/src/render/lane.rs | 0 {editor => game}/src/render/map.rs | 0 {editor => game}/src/render/mod.rs | 0 {editor => game}/src/render/pedestrian.rs | 0 {editor => game}/src/render/road.rs | 0 {editor => game}/src/render/traffic_signal.rs | 0 {editor => game}/src/render/turn.rs | 0 {editor => game}/src/sandbox/mod.rs | 0 {editor => game}/src/sandbox/score.rs | 0 {editor => game}/src/sandbox/spawner.rs | 0 {editor => game}/src/sandbox/time_travel.rs | 0 {editor => game}/src/splash_screen.rs | 2 +- {editor => game}/src/tutorial.rs | 0 {editor => game}/src/ui.rs | 14 +++++++------- popdat/src/trips.rs | 2 +- release/linux_or_mac.sh | 6 +++--- release/play_abstreet.bat | 4 ++-- release/play_abstreet.sh | 4 ++-- release/windows.sh | 6 +++--- sim/src/render.rs | 2 +- 79 files changed, 44 insertions(+), 43 deletions(-) rename {editor => game}/Cargo.toml (97%) rename {editor => game}/build.rs (100%) rename {editor => game}/compare_screencaps.sh (100%) rename {editor => game}/confirm_screencap.sh (100%) rename {editor => game}/src/abtest/mod.rs (100%) rename {editor => game}/src/abtest/score.rs (100%) rename {editor => game}/src/abtest/setup.rs (100%) rename {editor => game}/src/common/agent.rs (100%) rename {editor => game}/src/common/associated.rs (100%) rename {editor => game}/src/common/colors.rs (100%) rename {editor => game}/src/common/mod.rs (100%) rename {editor => game}/src/common/navigate.rs (100%) rename {editor => game}/src/common/route_explorer.rs (100%) rename {editor => game}/src/common/route_viewer.rs (100%) rename {editor => game}/src/common/shortcuts.rs (100%) rename {editor => game}/src/common/speed.rs (100%) rename {editor => game}/src/common/time.rs (100%) rename {editor => game}/src/common/trip_explorer.rs (100%) rename {editor => game}/src/common/turn_cycler.rs (100%) rename {editor => game}/src/common/warp.rs (100%) rename {editor => game}/src/debug/bus_explorer.rs (100%) rename {editor => game}/src/debug/chokepoints.rs (100%) rename {editor => game}/src/debug/color_picker.rs (100%) rename {editor => game}/src/debug/connected_roads.rs (100%) rename {editor => game}/src/debug/floodfill.rs (100%) rename {editor => game}/src/debug/mod.rs (100%) rename {editor => game}/src/debug/neighborhood_summary.rs (100%) rename {editor => game}/src/debug/objects.rs (100%) rename {editor => game}/src/debug/polygons.rs (100%) rename {editor => game}/src/debug/routes.rs (100%) rename {editor => game}/src/edit/mod.rs (100%) rename {editor => game}/src/edit/stop_signs.rs (100%) rename {editor => game}/src/edit/traffic_signals.rs (100%) rename {editor => game}/src/game.rs (98%) rename {editor => game}/src/helpers.rs (100%) rename {editor => game}/src/main.rs (100%) rename {editor => game}/src/mission/all_trips.rs (100%) rename {editor => game}/src/mission/dataviz.rs (100%) rename {editor => game}/src/mission/individ_trips.rs (100%) rename {editor => game}/src/mission/mod.rs (100%) rename {editor => game}/src/mission/neighborhood.rs (100%) rename {editor => game}/src/mission/scenario.rs (100%) rename {editor => game}/src/render/area.rs (100%) rename {editor => game}/src/render/bike.rs (100%) rename {editor => game}/src/render/building.rs (100%) rename {editor => game}/src/render/bus_stop.rs (100%) rename {editor => game}/src/render/car.rs (100%) rename {editor => game}/src/render/extra_shape.rs (100%) rename {editor => game}/src/render/intersection.rs (100%) rename {editor => game}/src/render/lane.rs (100%) rename {editor => game}/src/render/map.rs (100%) rename {editor => game}/src/render/mod.rs (100%) rename {editor => game}/src/render/pedestrian.rs (100%) rename {editor => game}/src/render/road.rs (100%) rename {editor => game}/src/render/traffic_signal.rs (100%) rename {editor => game}/src/render/turn.rs (100%) rename {editor => game}/src/sandbox/mod.rs (100%) rename {editor => game}/src/sandbox/score.rs (100%) rename {editor => game}/src/sandbox/spawner.rs (100%) rename {editor => game}/src/sandbox/time_travel.rs (100%) rename {editor => game}/src/splash_screen.rs (99%) rename {editor => game}/src/tutorial.rs (100%) rename {editor => game}/src/ui.rs (98%) diff --git a/.gitignore b/.gitignore index 0db6a79c73..feb2d0a71a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ data/ab_test_saves/* data/ab_tests/* -data/editor_state/* +data/camera_state/* data/edits/* data/input/* data/maps/* diff --git a/Cargo.toml b/Cargo.toml index b589f5479a..19cbef07ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,9 +3,9 @@ members = [ "abstutil", "convert_osm", - "editor", "ezgui", "fix_map_geom", + "game", "geom", "gtfs", "headless", diff --git a/abstutil/src/lib.rs b/abstutil/src/lib.rs index 6f7eaca300..77c37ce37e 100644 --- a/abstutil/src/lib.rs +++ b/abstutil/src/lib.rs @@ -84,8 +84,8 @@ pub fn path_raw_map(map_name: &str) -> String { format!("../data/raw_maps/{}.bin", map_name) } -pub fn path_editor_state(map_name: &str) -> String { - format!("../data/editor_state/{}.json", map_name) +pub fn path_camera_state(map_name: &str) -> String { + format!("../data/camera_state/{}.json", map_name) } pub fn path_pending_screenshots(map_name: &str) -> String { diff --git a/clickable_links.py b/clickable_links.py index 76b4b5348a..30a0551686 100755 --- a/clickable_links.py +++ b/clickable_links.py @@ -15,6 +15,6 @@ if arg.startswith('http://most/'): if arg.startswith('http://tail/'): os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'tail -f ' + arg[len('http://tail/'):]]) elif arg.startswith('http://ui/'): - os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'cd ~/abstreet/editor; cargo run ' + arg[len('http://ui/'):]]) + os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'cd ~/abstreet/game; cargo run ' + arg[len('http://ui/'):]]) else: os.execvp('xdg-open', ['xdg-open', arg]) diff --git a/docs/INSTRUCTIONS.md b/docs/INSTRUCTIONS.md index 586b74bcd5..389f29a1ab 100644 --- a/docs/INSTRUCTIONS.md +++ b/docs/INSTRUCTIONS.md @@ -35,7 +35,7 @@ If you build from source, you won't have the convenient launcher scripts referenced below. Instead: ``` -cd editor +cd game cargo run --release ``` diff --git a/docs/articles/rust/article.md b/docs/articles/rust/article.md index 70eaa10d2b..e1ed170055 100644 --- a/docs/articles/rust/article.md +++ b/docs/articles/rust/article.md @@ -113,7 +113,7 @@ macro cleverness could avoid this. No surprises here: compile times suck. It's especially frustrating to add a few lines to `geom` for debugging (not affecting any of the crate's external APIs), -then wait for the dependent crates `map_model`, `sim`, and `editor` to recompile +then wait for the dependent crates `map_model`, `sim`, and `game` to recompile (or maybe just link again, but it sure is slow). It's also frustrating to recompile all dependencies from scratch when I switch between compiling for Linux and Windows. @@ -128,7 +128,7 @@ something awkwardly, but mostly it's forced me to avoid bad ideas. ## Appendix: Code organization If you're going to dig into the code, it helps to know what all the crates are. -The most interesting crates are `map_model`, `sim`, and `editor`. +The most interesting crates are `map_model`, `sim`, and `game`. Constructing the map: @@ -152,7 +152,7 @@ Traffic simulation: Graphics: -- `editor`: the GUI and main gameplay +- `game`: the GUI and main gameplay - `ezgui`: an immediate-mode GUI library Common utilities: diff --git a/docs/articles/trafficsim/article.md b/docs/articles/trafficsim/article.md index 495507140d..281b8ebc6c 100644 --- a/docs/articles/trafficsim/article.md +++ b/docs/articles/trafficsim/article.md @@ -164,7 +164,7 @@ do exactly this. A/B Street imports data from PSRC using the `popdat` crate (the canonically trendy rendering of "population data"). This is further processed in -`editor/src/mission/trips.rs`. +`game/src/mission/trips.rs`. ## Appendix: discrete-time simulation diff --git a/docs/development.md b/docs/development.md index d02bbaef2b..16be36da93 100644 --- a/docs/development.md +++ b/docs/development.md @@ -4,7 +4,8 @@ Find packages to upgrade: `cargo outdated -R` Deal with compile tile: `cargo bloat --time` -Find why two binary crates aren't sharing dependencies: https://old.reddit.com/r/rust/comments/cqceu4/common_crates_in_cargo_workspace_recompiled/ +Find why two binary crates aren't sharing dependencies: +https://old.reddit.com/r/rust/comments/cqceu4/common_crates_in_cargo_workspace_recompiled/ Where's a dependency coming from? `cargo tree -i -p syn` @@ -13,9 +14,9 @@ Diff screencaps: http://www.imagemagick.org/Usage/compare/#methods Debug OpenGL calls: ``` -apitrace trace --api gl ../target/debug/editor ../data/raw_maps/montlake.bin -qapitrace editor.trace -apitrace dump editor.trace +apitrace trace --api gl ../target/debug/game ../data/raw_maps/montlake.bin +qapitrace game.trace +apitrace dump game.trace ``` Understand XML: just use firefox @@ -26,10 +27,10 @@ Understand XML: just use firefox Follow Usage from https://crates.io/crates/cpuprofiler -Run editor or headless with `--enable_profiler` +Run game or headless with `--enable_profiler` ``` -google-pprof --no_strip_temp ../target/debug/editor profile +google-pprof --no_strip_temp ../target/debug/game profile google-pprof --no_strip_temp ../target/release/headless profile top30 --cum ``` @@ -49,8 +50,8 @@ Then: ``` sudo systemctl start docker -cross build --release --target x86_64-pc-windows-gnu --bin editor -wine target/x86_64-pc-windows-gnu/release/editor.exe data/maps/montlake.bin +cross build --release --target x86_64-pc-windows-gnu --bin game +wine target/x86_64-pc-windows-gnu/release/game.exe data/maps/montlake.bin ``` ## Markdown diff --git a/docs/new_city.md b/docs/new_city.md index f7e995fdd7..d101305ac7 100644 --- a/docs/new_city.md +++ b/docs/new_city.md @@ -20,7 +20,7 @@ cargo run --release -- ../data/raw_maps/your_city.bin ``` You should now be able to load the map using the option from the main game menu, -or by running `cd editor; cargo run --release ../data/maps/your_city.bin`. +or by running `cd game; cargo run --release ../data/maps/your_city.bin`. ## Future work diff --git a/docs/project/references.md b/docs/project/references.md index bd0c4b8cfb..f02614bd4b 100644 --- a/docs/project/references.md +++ b/docs/project/references.md @@ -32,7 +32,7 @@ - https://escience.washington.edu/dssg/ - josie kresner from transport foundry - https://www.citylab.com/transportation/2019/08/city-planning-transportation-oakland-community-engagement/596050/ - - tweeting small problems -> bug tracker + - tweeting small problems -> bug tracker - https://www.the74million.org/article/building-a-smarter-and-cheaper-school-bus-system-how-a-boston-mit-partnership-led-to-new-routes-that-are-20-more-efficient-use-400-fewer-buses-save-5-million/ ## Similar projects diff --git a/editor/Cargo.toml b/game/Cargo.toml similarity index 97% rename from editor/Cargo.toml rename to game/Cargo.toml index 37f64f9c42..2aa7ec4691 100644 --- a/editor/Cargo.toml +++ b/game/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "editor" +name = "game" version = "0.1.0" authors = ["Dustin Carlino "] edition = "2018" diff --git a/editor/build.rs b/game/build.rs similarity index 100% rename from editor/build.rs rename to game/build.rs diff --git a/editor/compare_screencaps.sh b/game/compare_screencaps.sh similarity index 100% rename from editor/compare_screencaps.sh rename to game/compare_screencaps.sh diff --git a/editor/confirm_screencap.sh b/game/confirm_screencap.sh similarity index 100% rename from editor/confirm_screencap.sh rename to game/confirm_screencap.sh diff --git a/editor/src/abtest/mod.rs b/game/src/abtest/mod.rs similarity index 100% rename from editor/src/abtest/mod.rs rename to game/src/abtest/mod.rs diff --git a/editor/src/abtest/score.rs b/game/src/abtest/score.rs similarity index 100% rename from editor/src/abtest/score.rs rename to game/src/abtest/score.rs diff --git a/editor/src/abtest/setup.rs b/game/src/abtest/setup.rs similarity index 100% rename from editor/src/abtest/setup.rs rename to game/src/abtest/setup.rs diff --git a/editor/src/common/agent.rs b/game/src/common/agent.rs similarity index 100% rename from editor/src/common/agent.rs rename to game/src/common/agent.rs diff --git a/editor/src/common/associated.rs b/game/src/common/associated.rs similarity index 100% rename from editor/src/common/associated.rs rename to game/src/common/associated.rs diff --git a/editor/src/common/colors.rs b/game/src/common/colors.rs similarity index 100% rename from editor/src/common/colors.rs rename to game/src/common/colors.rs diff --git a/editor/src/common/mod.rs b/game/src/common/mod.rs similarity index 100% rename from editor/src/common/mod.rs rename to game/src/common/mod.rs diff --git a/editor/src/common/navigate.rs b/game/src/common/navigate.rs similarity index 100% rename from editor/src/common/navigate.rs rename to game/src/common/navigate.rs diff --git a/editor/src/common/route_explorer.rs b/game/src/common/route_explorer.rs similarity index 100% rename from editor/src/common/route_explorer.rs rename to game/src/common/route_explorer.rs diff --git a/editor/src/common/route_viewer.rs b/game/src/common/route_viewer.rs similarity index 100% rename from editor/src/common/route_viewer.rs rename to game/src/common/route_viewer.rs diff --git a/editor/src/common/shortcuts.rs b/game/src/common/shortcuts.rs similarity index 100% rename from editor/src/common/shortcuts.rs rename to game/src/common/shortcuts.rs diff --git a/editor/src/common/speed.rs b/game/src/common/speed.rs similarity index 100% rename from editor/src/common/speed.rs rename to game/src/common/speed.rs diff --git a/editor/src/common/time.rs b/game/src/common/time.rs similarity index 100% rename from editor/src/common/time.rs rename to game/src/common/time.rs diff --git a/editor/src/common/trip_explorer.rs b/game/src/common/trip_explorer.rs similarity index 100% rename from editor/src/common/trip_explorer.rs rename to game/src/common/trip_explorer.rs diff --git a/editor/src/common/turn_cycler.rs b/game/src/common/turn_cycler.rs similarity index 100% rename from editor/src/common/turn_cycler.rs rename to game/src/common/turn_cycler.rs diff --git a/editor/src/common/warp.rs b/game/src/common/warp.rs similarity index 100% rename from editor/src/common/warp.rs rename to game/src/common/warp.rs diff --git a/editor/src/debug/bus_explorer.rs b/game/src/debug/bus_explorer.rs similarity index 100% rename from editor/src/debug/bus_explorer.rs rename to game/src/debug/bus_explorer.rs diff --git a/editor/src/debug/chokepoints.rs b/game/src/debug/chokepoints.rs similarity index 100% rename from editor/src/debug/chokepoints.rs rename to game/src/debug/chokepoints.rs diff --git a/editor/src/debug/color_picker.rs b/game/src/debug/color_picker.rs similarity index 100% rename from editor/src/debug/color_picker.rs rename to game/src/debug/color_picker.rs diff --git a/editor/src/debug/connected_roads.rs b/game/src/debug/connected_roads.rs similarity index 100% rename from editor/src/debug/connected_roads.rs rename to game/src/debug/connected_roads.rs diff --git a/editor/src/debug/floodfill.rs b/game/src/debug/floodfill.rs similarity index 100% rename from editor/src/debug/floodfill.rs rename to game/src/debug/floodfill.rs diff --git a/editor/src/debug/mod.rs b/game/src/debug/mod.rs similarity index 100% rename from editor/src/debug/mod.rs rename to game/src/debug/mod.rs diff --git a/editor/src/debug/neighborhood_summary.rs b/game/src/debug/neighborhood_summary.rs similarity index 100% rename from editor/src/debug/neighborhood_summary.rs rename to game/src/debug/neighborhood_summary.rs diff --git a/editor/src/debug/objects.rs b/game/src/debug/objects.rs similarity index 100% rename from editor/src/debug/objects.rs rename to game/src/debug/objects.rs diff --git a/editor/src/debug/polygons.rs b/game/src/debug/polygons.rs similarity index 100% rename from editor/src/debug/polygons.rs rename to game/src/debug/polygons.rs diff --git a/editor/src/debug/routes.rs b/game/src/debug/routes.rs similarity index 100% rename from editor/src/debug/routes.rs rename to game/src/debug/routes.rs diff --git a/editor/src/edit/mod.rs b/game/src/edit/mod.rs similarity index 100% rename from editor/src/edit/mod.rs rename to game/src/edit/mod.rs diff --git a/editor/src/edit/stop_signs.rs b/game/src/edit/stop_signs.rs similarity index 100% rename from editor/src/edit/stop_signs.rs rename to game/src/edit/stop_signs.rs diff --git a/editor/src/edit/traffic_signals.rs b/game/src/edit/traffic_signals.rs similarity index 100% rename from editor/src/edit/traffic_signals.rs rename to game/src/edit/traffic_signals.rs diff --git a/editor/src/game.rs b/game/src/game.rs similarity index 98% rename from editor/src/game.rs rename to game/src/game.rs index c933ccf19e..fefd4cbefa 100644 --- a/editor/src/game.rs +++ b/game/src/game.rs @@ -144,11 +144,11 @@ impl GUI for Game { println!("Secondary sim:"); s.sim.dump_before_abort(); } - self.ui.save_editor_state(canvas); + self.ui.save_camera_state(canvas); } fn before_quit(&self, canvas: &Canvas) { - self.ui.save_editor_state(canvas); + self.ui.save_camera_state(canvas); self.ui.cs.save(); println!("Saved data/color_scheme.json"); } diff --git a/editor/src/helpers.rs b/game/src/helpers.rs similarity index 100% rename from editor/src/helpers.rs rename to game/src/helpers.rs diff --git a/editor/src/main.rs b/game/src/main.rs similarity index 100% rename from editor/src/main.rs rename to game/src/main.rs diff --git a/editor/src/mission/all_trips.rs b/game/src/mission/all_trips.rs similarity index 100% rename from editor/src/mission/all_trips.rs rename to game/src/mission/all_trips.rs diff --git a/editor/src/mission/dataviz.rs b/game/src/mission/dataviz.rs similarity index 100% rename from editor/src/mission/dataviz.rs rename to game/src/mission/dataviz.rs diff --git a/editor/src/mission/individ_trips.rs b/game/src/mission/individ_trips.rs similarity index 100% rename from editor/src/mission/individ_trips.rs rename to game/src/mission/individ_trips.rs diff --git a/editor/src/mission/mod.rs b/game/src/mission/mod.rs similarity index 100% rename from editor/src/mission/mod.rs rename to game/src/mission/mod.rs diff --git a/editor/src/mission/neighborhood.rs b/game/src/mission/neighborhood.rs similarity index 100% rename from editor/src/mission/neighborhood.rs rename to game/src/mission/neighborhood.rs diff --git a/editor/src/mission/scenario.rs b/game/src/mission/scenario.rs similarity index 100% rename from editor/src/mission/scenario.rs rename to game/src/mission/scenario.rs diff --git a/editor/src/render/area.rs b/game/src/render/area.rs similarity index 100% rename from editor/src/render/area.rs rename to game/src/render/area.rs diff --git a/editor/src/render/bike.rs b/game/src/render/bike.rs similarity index 100% rename from editor/src/render/bike.rs rename to game/src/render/bike.rs diff --git a/editor/src/render/building.rs b/game/src/render/building.rs similarity index 100% rename from editor/src/render/building.rs rename to game/src/render/building.rs diff --git a/editor/src/render/bus_stop.rs b/game/src/render/bus_stop.rs similarity index 100% rename from editor/src/render/bus_stop.rs rename to game/src/render/bus_stop.rs diff --git a/editor/src/render/car.rs b/game/src/render/car.rs similarity index 100% rename from editor/src/render/car.rs rename to game/src/render/car.rs diff --git a/editor/src/render/extra_shape.rs b/game/src/render/extra_shape.rs similarity index 100% rename from editor/src/render/extra_shape.rs rename to game/src/render/extra_shape.rs diff --git a/editor/src/render/intersection.rs b/game/src/render/intersection.rs similarity index 100% rename from editor/src/render/intersection.rs rename to game/src/render/intersection.rs diff --git a/editor/src/render/lane.rs b/game/src/render/lane.rs similarity index 100% rename from editor/src/render/lane.rs rename to game/src/render/lane.rs diff --git a/editor/src/render/map.rs b/game/src/render/map.rs similarity index 100% rename from editor/src/render/map.rs rename to game/src/render/map.rs diff --git a/editor/src/render/mod.rs b/game/src/render/mod.rs similarity index 100% rename from editor/src/render/mod.rs rename to game/src/render/mod.rs diff --git a/editor/src/render/pedestrian.rs b/game/src/render/pedestrian.rs similarity index 100% rename from editor/src/render/pedestrian.rs rename to game/src/render/pedestrian.rs diff --git a/editor/src/render/road.rs b/game/src/render/road.rs similarity index 100% rename from editor/src/render/road.rs rename to game/src/render/road.rs diff --git a/editor/src/render/traffic_signal.rs b/game/src/render/traffic_signal.rs similarity index 100% rename from editor/src/render/traffic_signal.rs rename to game/src/render/traffic_signal.rs diff --git a/editor/src/render/turn.rs b/game/src/render/turn.rs similarity index 100% rename from editor/src/render/turn.rs rename to game/src/render/turn.rs diff --git a/editor/src/sandbox/mod.rs b/game/src/sandbox/mod.rs similarity index 100% rename from editor/src/sandbox/mod.rs rename to game/src/sandbox/mod.rs diff --git a/editor/src/sandbox/score.rs b/game/src/sandbox/score.rs similarity index 100% rename from editor/src/sandbox/score.rs rename to game/src/sandbox/score.rs diff --git a/editor/src/sandbox/spawner.rs b/game/src/sandbox/spawner.rs similarity index 100% rename from editor/src/sandbox/spawner.rs rename to game/src/sandbox/spawner.rs diff --git a/editor/src/sandbox/time_travel.rs b/game/src/sandbox/time_travel.rs similarity index 100% rename from editor/src/sandbox/time_travel.rs rename to game/src/sandbox/time_travel.rs diff --git a/editor/src/splash_screen.rs b/game/src/splash_screen.rs similarity index 99% rename from editor/src/splash_screen.rs rename to game/src/splash_screen.rs index c977580834..035aa544ca 100644 --- a/editor/src/splash_screen.rs +++ b/game/src/splash_screen.rs @@ -166,7 +166,7 @@ fn splash_screen( .filter(|n| n != current_map) .collect() }) { - ui.save_editor_state(ctx.canvas); + ui.save_camera_state(ctx.canvas); // This retains no state, but that's probably fine. let mut flags = ui.primary.current_flags.clone(); flags.sim_flags.load = PathBuf::from(abstutil::path_map(&name)); diff --git a/editor/src/tutorial.rs b/game/src/tutorial.rs similarity index 100% rename from editor/src/tutorial.rs rename to game/src/tutorial.rs diff --git a/editor/src/ui.rs b/game/src/ui.rs similarity index 98% rename from editor/src/ui.rs rename to game/src/ui.rs index 11a431d3ff..2a22996a27 100644 --- a/editor/src/ui.rs +++ b/game/src/ui.rs @@ -46,8 +46,8 @@ impl UI { if splash { ctx.canvas.center_on_map_pt(rand_focus_pt); } else { - let path = abstutil::path_editor_state(primary.map.get_name()); - match abstutil::read_json::(&path) { + let path = abstutil::path_camera_state(primary.map.get_name()); + match abstutil::read_json::(&path) { Ok(ref loaded) => { println!("Loaded {}", path); ctx.canvas.cam_x = loaded.cam_x; @@ -350,21 +350,21 @@ impl UI { borrows } - pub fn save_editor_state(&self, canvas: &Canvas) { - let state = EditorState { + pub fn save_camera_state(&self, canvas: &Canvas) { + let state = CameraState { map_name: self.primary.map.get_name().clone(), cam_x: canvas.cam_x, cam_y: canvas.cam_y, cam_zoom: canvas.cam_zoom, }; - let path = abstutil::path_editor_state(&state.map_name); + let path = abstutil::path_camera_state(&state.map_name); abstutil::write_json(&path, &state).unwrap(); println!("Saved {}", path); } } #[derive(Serialize, Deserialize, Debug)] -struct EditorState { +struct CameraState { pub map_name: String, pub cam_x: f64, pub cam_y: f64, @@ -423,7 +423,7 @@ impl ShowObject for ShowEverything { } #[derive(StructOpt, Debug, Clone)] -#[structopt(name = "editor")] +#[structopt(name = "game")] pub struct Flags { #[structopt(flatten)] pub sim_flags: SimFlags, diff --git a/popdat/src/trips.rs b/popdat/src/trips.rs index 92e0c477d3..50c671668a 100644 --- a/popdat/src/trips.rs +++ b/popdat/src/trips.rs @@ -345,7 +345,7 @@ pub fn trips_to_scenario(map: &Map, t1: Duration, t2: Duration, timer: &mut Time .flatten() .collect(); - // This is another variation of the 'recycle' algorithm in editor's ScenarioManager. + // This is another variation of the 'recycle' algorithm in game's ScenarioManager. let mut individ_parked_cars = BTreeMap::new(); let mut avail_per_bldg = BTreeMap::new(); for b in map.all_buildings() { diff --git a/release/linux_or_mac.sh b/release/linux_or_mac.sh index 841a2c72e6..eba2dd8f6a 100755 --- a/release/linux_or_mac.sh +++ b/release/linux_or_mac.sh @@ -13,9 +13,9 @@ common_release $OUT cp release/play_abstreet.sh $OUT -mkdir $OUT/editor -cargo build --release --bin editor -cp target/release/editor $OUT/editor +mkdir $OUT/game +cargo build --release --bin game +cp target/release/game $OUT/game zip -r $OUT $OUT rm -rf $OUT diff --git a/release/play_abstreet.bat b/release/play_abstreet.bat index a08e56ae91..1f8abedd9e 100755 --- a/release/play_abstreet.bat +++ b/release/play_abstreet.bat @@ -1,2 +1,2 @@ -cd editor -editor.exe > ..\\output.txt +cd game +game.exe > ..\\output.txt diff --git a/release/play_abstreet.sh b/release/play_abstreet.sh index 60456ba7bb..5304732482 100755 --- a/release/play_abstreet.sh +++ b/release/play_abstreet.sh @@ -1,4 +1,4 @@ #!/bin/bash -cd editor -./editor +cd game +./game diff --git a/release/windows.sh b/release/windows.sh index 0940fe4dd2..a7cd3f1a3f 100755 --- a/release/windows.sh +++ b/release/windows.sh @@ -10,9 +10,9 @@ common_release $OUT cp release/play_abstreet.bat $OUT -mkdir $OUT/editor -cross build --release --target x86_64-pc-windows-gnu --bin editor -cp target/x86_64-pc-windows-gnu/release/editor.exe $OUT/editor +mkdir $OUT/game +cross build --release --target x86_64-pc-windows-gnu --bin game +cp target/x86_64-pc-windows-gnu/release/game.exe $OUT/game zip -r $OUT $OUT rm -rf $OUT diff --git a/sim/src/render.rs b/sim/src/render.rs index 09d1ee57c2..0b10811847 100644 --- a/sim/src/render.rs +++ b/sim/src/render.rs @@ -2,7 +2,7 @@ use crate::{CarID, PedestrianID, VehicleType}; use geom::{Angle, Distance, Duration, PolyLine, Pt2D}; use map_model::{Map, Traversable, TurnID}; -// Intermediate structures so that sim and editor crates don't have a cyclic dependency. +// Intermediate structures so that sim and game crates don't have a cyclic dependency. #[derive(Clone)] pub struct DrawPedestrianInput { pub id: PedestrianID,