diff --git a/.efrocachemap b/.efrocachemap
index 86fff2ec..2a79b63b 100644
--- a/.efrocachemap
+++ b/.efrocachemap
@@ -420,7 +420,7 @@
"assets/build/ba_data/audio/zoeOw.ogg": "https://files.ballistica.net/cache/ba1/a9/71/9286d55c45c37877f3267850f90b",
"assets/build/ba_data/audio/zoePickup01.ogg": "https://files.ballistica.net/cache/ba1/2f/09/36e691de67eb8f155449a7170861",
"assets/build/ba_data/audio/zoeScream01.ogg": "https://files.ballistica.net/cache/ba1/fd/a8/ad50785ce206e8dc3dcc7358b173",
- "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/75/7f/35866269426040695c86c95d241e",
+ "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/16/4d/53c97486d0669727b400beecefec",
"assets/build/ba_data/data/languages/arabic.json": "https://files.ballistica.net/cache/ba1/ac/3e/c50dc4e98df47f858c3a73ac4272",
"assets/build/ba_data/data/languages/belarussian.json": "https://files.ballistica.net/cache/ba1/44/ed/5b972fa848cffb73723533c2ccb7",
"assets/build/ba_data/data/languages/chinese.json": "https://files.ballistica.net/cache/ba1/9d/63/d360eeff63bc64e098427498880d",
@@ -443,7 +443,7 @@
"assets/build/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/c1/14/b013ec0a6557533f0ff49f27d000",
"assets/build/ba_data/data/languages/polish.json": "https://files.ballistica.net/cache/ba1/cd/c1/82bf70c3ee4894791506f4da1a15",
"assets/build/ba_data/data/languages/portuguese.json": "https://files.ballistica.net/cache/ba1/98/45/ddeb7e797c02fb967e0c8b0dff7d",
- "assets/build/ba_data/data/languages/romanian.json": "https://files.ballistica.net/cache/ba1/5d/42/50a37dbd9853ef6b8723be0e9c33",
+ "assets/build/ba_data/data/languages/romanian.json": "https://files.ballistica.net/cache/ba1/f3/e5/c6d8fab0509451976c776265f0d0",
"assets/build/ba_data/data/languages/russian.json": "https://files.ballistica.net/cache/ba1/71/db/e23447c97d40b8a0d83f185f4bba",
"assets/build/ba_data/data/languages/serbian.json": "https://files.ballistica.net/cache/ba1/e1/22/5471375791f8825a63e06371df29",
"assets/build/ba_data/data/languages/slovak.json": "https://files.ballistica.net/cache/ba1/15/01/cab2f74365e69216a7eeeef51f98",
@@ -3932,40 +3932,40 @@
"assets/build/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/b5/85/f8b6d0558ddb87267f34254b1450",
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
- "build/prefab/full/linux_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/f4/83/ff699ce7cf0b31d8637d8bf85fef",
- "build/prefab/full/linux_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/29/e6/b68cc3d7ef7c49375b8c346e15de",
- "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/0e/78/e4bcb5fb322a830d6e189e9ad628",
- "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/86/59/6a55d02dee1987827e1c50971481",
- "build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/2a/bc/2a576c81d0fae1a8c507aa7e8105",
- "build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/28/cc/761a37c028c55868ff82fbb36618",
- "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/a7/16/7cad87d75681d7e72f73118526a7",
- "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f2/14/4a6694e647afe38ac57975a574aa",
- "build/prefab/full/mac_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/f3/4d/16f6485c7f51f4e492b58a435561",
- "build/prefab/full/mac_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/64/43/306511242438b3f1980ff64ad7ff",
- "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/39/56/cafec8c98b057209b4e406df7d4a",
- "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9c/24/e3db3f3fe13cb95ccc09ddf76e0b",
- "build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/ed/64/24f2ec1c97e5b94f6250520f1570",
- "build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/3d/59/13c722da54e13e52795e18f534f0",
- "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3a/d2/bc5df85ef3627c616412722a200c",
- "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ef/74/7b7d1bd7ee0a767176e49eba8afc",
- "build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/88/bb/729e86d86f67873ff0427960ccec",
- "build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/8d/34/51731e5fca346e78d1473933f419",
- "build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/25/76/256bb784fa822b1731b350cea5ae",
- "build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/b1/f3/9aa561c568e293bf324f604f4000",
- "build/prefab/lib/linux_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/8c/39/85f77a12d141db9af737df376913",
- "build/prefab/lib/linux_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a1/a1/3b82daf3a84bfaf3d64d166cac3a",
- "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7a/fc/38e48816e9d9cd64baebbb30deb6",
- "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b7/2d/82d4dc9c175bbf68a88944ac2c78",
- "build/prefab/lib/linux_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a7/f5/c1e90eff3b8f02fa812f89bf66fe",
- "build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/02/49/3b28ad61d548c23e6780c4f88bed",
- "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/07/99/9f5c09f44372348c267fb39ddd05",
- "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/63/83/0ffe340483547e20baa8fd1293b9",
- "build/prefab/lib/mac_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/13/83/c6958810d3312e497e954e75ea13",
- "build/prefab/lib/mac_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/f8/14/fbddab145bda029befa17da9fa60",
- "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7c/a7/953db4d7c5156b2f78342d796c09",
- "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/49/24/e05ec9882f9307bb95aaf03c9249",
- "build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3a/bc/2421b4ea68a0e046005ca25a9eab",
- "build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/40/43/a45170f54993457ee2839af6ccde",
- "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/39/8b/dbcd78ec647af1787d95c5451c58",
- "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/bc/e0/228e9ca0bfac2c8c469dd7d08633"
+ "build/prefab/full/linux_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/6b/cb/19189b08a2e2fb1eb992ce9409c3",
+ "build/prefab/full/linux_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/f7/4d/1fa868632c30ebfacfc38c6b117d",
+ "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/7d/b8/49192d8bdbb04f541279f1be0e5b",
+ "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/4c/45/a35cc2aa7d366acf296ff8c1cc9d",
+ "build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/52/15/30ee7f43e310f28fc45d2cddf572",
+ "build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/96/0a/2f1783c6132c52b81f52deb32848",
+ "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cf/8b/1d445ffa286f7244aad7d1ce5e73",
+ "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/67/6d/3cc48fa4a8a782658f3bcb05896a",
+ "build/prefab/full/mac_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/f8/25/ba027f4b3cf7b71219da09c21c75",
+ "build/prefab/full/mac_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/3b/f1/de985e1c1353d1b08f32f9f3e3a8",
+ "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/50/e8/2dc9822aed07127c510475d4f84c",
+ "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/53/a4/7ccb111c3808cdfbc040e3d7ceb4",
+ "build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/2b/3d/c440f8c0ed420b764b7c8a919c28",
+ "build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/60/fc/87cfc12a101a1602a10d56590a1c",
+ "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/5e/53/031857aa1a70492d21941851c4a0",
+ "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3f/5e/b45d379238a9c0e8e37f46cf1f0d",
+ "build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/10/b1/b90ce616c5af2ddb545f56832994",
+ "build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/cb/fb/dfafe1bde1ad7f7331e1bfc4e63d",
+ "build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/db/13/bd6517c55cd8e129e17e7f9c2616",
+ "build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/ea/9d/70f2fe7e9c1101710410763d75bf",
+ "build/prefab/lib/linux_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/cb/ed/e47dfe8c0b1ed07fa6e14b15823e",
+ "build/prefab/lib/linux_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b0/f5/432df1b69d95c0be2c452109ec80",
+ "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/cb/33/49607104f1a4daeff9203ac70279",
+ "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/85/5a/95e462b25713e0984d086b9cc4dc",
+ "build/prefab/lib/linux_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1d/f6/f812e186bd658a393523e9dcfeab",
+ "build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/47/50/5cc79eccc31f272b22e535563f4f",
+ "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1e/bf/bf4842f01b740ca1430bacc5381e",
+ "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d5/92/dac101043f5b24e4e25424b0c471",
+ "build/prefab/lib/mac_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6c/52/3ccd81f47f7e02376a3e3ba91b54",
+ "build/prefab/lib/mac_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9d/30/9e0c9323ac0c070167595a4b3015",
+ "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4f/e6/e838ab1f57c90a2ab541b4524f5d",
+ "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d0/18/dbcc2d1e67a5d7887a8ff48759d0",
+ "build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c8/bb/32515f5226bb06103d2184058dce",
+ "build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/2b/83/ef8718694732f24d733be72286eb",
+ "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d9/4e/5706b74a4fc9879e22e7305c81bb",
+ "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d3/68/3e284f68dd2d1b9f69b0f6db86c9"
}
\ No newline at end of file
diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml
index 8f6aecff..5e3fce84 100644
--- a/.idea/dictionaries/ericf.xml
+++ b/.idea/dictionaries/ericf.xml
@@ -449,6 +449,7 @@
cspnf
cspre
cssclass
+ csspbt
cstr
csum
ctest
@@ -737,6 +738,7 @@
filterlines
filterpath
filterpaths
+ filterstr
filterval
finalhash
finalmaterials
diff --git a/.idea/inspectionProfiles/Default.xml b/.idea/inspectionProfiles/Default.xml
index 4601feea..5884173f 100644
--- a/.idea/inspectionProfiles/Default.xml
+++ b/.idea/inspectionProfiles/Default.xml
@@ -3,6 +3,7 @@
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4c51fec9..47695f2b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-### 1.6.0 (20326)
+### 1.6.0 (20333)
- Revamped netcode significantly. We still don't have client-prediction, but things should (hopefully) feel much lower latency now.
- Added network debug graphs accessible by hitting F8.
- Added private parties functionality (cloud hosted parties with associated codes making it easier to play with friends)
@@ -16,6 +16,7 @@
- Additional server-wrapper options such as disabling auto-restart and automatic restarts on config file changes.
- Running a `_ba.connect_to_party` command via the -exec arg should now do the right thing.
- Fixed possible crash due to buffer under/overruns in `Utils::precalc_rands_*`.
+- Fixed a potential crash-on-exit due to statically allocated colliders/caches in `ode_collision_trimesh.cpp` getting torn down while in use
### 1.5.29 (20246)
- Exposed ba method/class initing in public C++ layer.
diff --git a/ballisticacore-cmake/.idea/dictionaries/ericf.xml b/ballisticacore-cmake/.idea/dictionaries/ericf.xml
index 80232a58..99ecff36 100644
--- a/ballisticacore-cmake/.idea/dictionaries/ericf.xml
+++ b/ballisticacore-cmake/.idea/dictionaries/ericf.xml
@@ -194,6 +194,7 @@
csize
cspr
cspre
+ csspbt
cstdint
cstdlib
cstring
@@ -255,6 +256,7 @@
dstpath
dstr
dtest
+ dummyval
dummyvalid
dxgi
dynamicdata
@@ -319,6 +321,7 @@
fieldname
fieldpath
fifteenbits
+ filterstr
filterval
finishedptr
firstpartykey
diff --git a/ballisticacore-cmake/CMakeLists.txt b/ballisticacore-cmake/CMakeLists.txt
index aa5e87fe..c0cb8ad4 100644
--- a/ballisticacore-cmake/CMakeLists.txt
+++ b/ballisticacore-cmake/CMakeLists.txt
@@ -173,7 +173,7 @@ target_include_directories(ode PRIVATE ${ODE_SRC_ROOT})
# EWWW; GCC gives us bad mesh collisions with -O3 (and maybe -O2?)
# need to finally get to the bottom of this but limiting to -01 for now.
-# (-O2 might be safe??... or what about -Os? Should test again.)
+# (-O2 might be safe??... or what about -Os? ..or arm? Should test again.)
if (CMAKE_BUILD_TYPE MATCHES Release)
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
target_compile_options(ode PRIVATE -O1)
diff --git a/docs/ba_module.md b/docs/ba_module.md
index e8aa148d..ffb633f8 100644
--- a/docs/ba_module.md
+++ b/docs/ba_module.md
@@ -1,5 +1,5 @@
-
last updated on 2021-04-10 for Ballistica version 1.6.0 build 20329
+last updated on 2021-04-13 for Ballistica version 1.6.0 build 20332
This page documents the Python classes and functions in the 'ba' module,
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know . Happy modding!
diff --git a/src/ballistica/app/app_config.cc b/src/ballistica/app/app_config.cc
index 0868f75e..98ac6baf 100644
--- a/src/ballistica/app/app_config.cc
+++ b/src/ballistica/app/app_config.cc
@@ -2,8 +2,6 @@
#include "ballistica/app/app_config.h"
-#include
-
#include "ballistica/ballistica.h"
#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
diff --git a/src/ballistica/app/stress_test.cc b/src/ballistica/app/stress_test.cc
index 732645d0..0dbea11a 100644
--- a/src/ballistica/app/stress_test.cc
+++ b/src/ballistica/app/stress_test.cc
@@ -2,11 +2,9 @@
#include "ballistica/app/stress_test.h"
-#include "ballistica/ballistica.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/renderer.h"
#include "ballistica/input/input.h"
-#include "ballistica/platform/platform.h"
namespace ballistica {
diff --git a/src/ballistica/audio/audio_server.cc b/src/ballistica/audio/audio_server.cc
index ad35c8a7..974e0a18 100644
--- a/src/ballistica/audio/audio_server.cc
+++ b/src/ballistica/audio/audio_server.cc
@@ -2,12 +2,6 @@
#include "ballistica/audio/audio_server.h"
-#include
-#include
-#include
-#include
-#include
-
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/al_sys.h"
#include "ballistica/audio/audio.h"
diff --git a/src/ballistica/audio/audio_source.cc b/src/ballistica/audio/audio_source.cc
index fe2d1127..2f2dd2e8 100644
--- a/src/ballistica/audio/audio_source.cc
+++ b/src/ballistica/audio/audio_source.cc
@@ -2,8 +2,6 @@
#include "ballistica/audio/audio_source.h"
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_server.h"
#include "ballistica/math/vector3f.h"
diff --git a/src/ballistica/audio/ogg_stream.cc b/src/ballistica/audio/ogg_stream.cc
index 185a29a8..93286491 100644
--- a/src/ballistica/audio/ogg_stream.cc
+++ b/src/ballistica/audio/ogg_stream.cc
@@ -2,8 +2,6 @@
#include "ballistica/audio/ogg_stream.h"
-#include
-
#include "ballistica/platform/platform.h"
namespace ballistica {
diff --git a/src/ballistica/ballistica.cc b/src/ballistica/ballistica.cc
index ad03363a..02eabe15 100644
--- a/src/ballistica/ballistica.cc
+++ b/src/ballistica/ballistica.cc
@@ -21,7 +21,7 @@
namespace ballistica {
// These are set automatically via script; don't change here.
-const int kAppBuildNumber = 20329;
+const int kAppBuildNumber = 20333;
const char* kAppVersion = "1.6.0";
// Our standalone globals.
diff --git a/src/ballistica/config/config_cmake.h b/src/ballistica/config/config_cmake.h
index 710a41f5..4c1fdb94 100644
--- a/src/ballistica/config/config_cmake.h
+++ b/src/ballistica/config/config_cmake.h
@@ -77,6 +77,10 @@
#endif
#endif // !BA_DEBUG_BUILD
+// Include some stuff here for once we get precompiling going.
+#ifdef __cplusplus
+#endif // __cplusplus
+
// This must always be last.
#include "ballistica/config/config_common.h"
diff --git a/src/ballistica/core/context.cc b/src/ballistica/core/context.cc
index c6467102..e6116655 100644
--- a/src/ballistica/core/context.cc
+++ b/src/ballistica/core/context.cc
@@ -2,8 +2,6 @@
#include "ballistica/core/context.h"
-#include
-
#include "ballistica/game/host_activity.h"
#include "ballistica/generic/runnable.h"
#include "ballistica/ui/ui.h"
diff --git a/src/ballistica/core/exception.cc b/src/ballistica/core/exception.cc
index 5082b97a..73f6c10c 100644
--- a/src/ballistica/core/exception.cc
+++ b/src/ballistica/core/exception.cc
@@ -2,8 +2,6 @@
#include "ballistica/core/exception.h"
-#include
-
#include "ballistica/ballistica.h"
#include "ballistica/platform/platform.h"
diff --git a/src/ballistica/core/logging.cc b/src/ballistica/core/logging.cc
index 0484b9d0..b44bd122 100644
--- a/src/ballistica/core/logging.cc
+++ b/src/ballistica/core/logging.cc
@@ -5,9 +5,7 @@
#include
#include "ballistica/app/app_globals.h"
-#include "ballistica/ballistica.h"
#include "ballistica/game/game.h"
-#include "ballistica/networking/networking.h"
#include "ballistica/networking/telnet_server.h"
#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
diff --git a/src/ballistica/core/module.cc b/src/ballistica/core/module.cc
index 7743fcb6..053ddaec 100644
--- a/src/ballistica/core/module.cc
+++ b/src/ballistica/core/module.cc
@@ -2,8 +2,6 @@
#include "ballistica/core/module.h"
-#include
-
#include "ballistica/core/thread.h"
namespace ballistica {
diff --git a/src/ballistica/core/object.cc b/src/ballistica/core/object.cc
index d3dc69a2..bfba7dc3 100644
--- a/src/ballistica/core/object.cc
+++ b/src/ballistica/core/object.cc
@@ -2,15 +2,11 @@
#include "ballistica/core/object.h"
-#include
#include
-#include
#include
-#include
#include "ballistica/app/app_globals.h"
#include "ballistica/generic/utils.h"
-#include "ballistica/platform/min_sdl.h"
#include "ballistica/platform/platform.h"
namespace ballistica {
diff --git a/src/ballistica/core/thread.cc b/src/ballistica/core/thread.cc
index 7d0c75e2..eb687692 100644
--- a/src/ballistica/core/thread.cc
+++ b/src/ballistica/core/thread.cc
@@ -2,11 +2,8 @@
#include "ballistica/core/thread.h"
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/core/fatal_error.h"
-#include "ballistica/core/module.h"
#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
diff --git a/src/ballistica/dynamics/bg/bg_dynamics.cc b/src/ballistica/dynamics/bg/bg_dynamics.cc
index ade14fdf..2e296ea1 100644
--- a/src/ballistica/dynamics/bg/bg_dynamics.cc
+++ b/src/ballistica/dynamics/bg/bg_dynamics.cc
@@ -2,9 +2,6 @@
#include "ballistica/dynamics/bg/bg_dynamics.h"
-#include
-#include
-
#include "ballistica/core/thread.h"
#include "ballistica/dynamics/bg/bg_dynamics_draw_snapshot.h"
#include "ballistica/dynamics/bg/bg_dynamics_fuse_data.h"
@@ -13,7 +10,6 @@
#include "ballistica/graphics/component/object_component.h"
#include "ballistica/graphics/component/smoke_component.h"
#include "ballistica/graphics/component/sprite_component.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/media/component/collide_model.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/bg/bg_dynamics_height_cache.cc b/src/ballistica/dynamics/bg/bg_dynamics_height_cache.cc
index c0ccc083..397b2a19 100644
--- a/src/ballistica/dynamics/bg/bg_dynamics_height_cache.cc
+++ b/src/ballistica/dynamics/bg/bg_dynamics_height_cache.cc
@@ -2,8 +2,6 @@
#include "ballistica/dynamics/bg/bg_dynamics_height_cache.h"
-#include
-
namespace ballistica {
const int kBGDynamicsHeightCacheMaxContacts = 20;
diff --git a/src/ballistica/dynamics/bg/bg_dynamics_server.cc b/src/ballistica/dynamics/bg/bg_dynamics_server.cc
index ffc24276..60e9c891 100644
--- a/src/ballistica/dynamics/bg/bg_dynamics_server.cc
+++ b/src/ballistica/dynamics/bg/bg_dynamics_server.cc
@@ -2,11 +2,6 @@
#include "ballistica/dynamics/bg/bg_dynamics_server.h"
-#include
-#include
-#include
-#include
-
#include "ballistica/dynamics/bg/bg_dynamics_draw_snapshot.h"
#include "ballistica/dynamics/bg/bg_dynamics_fuse_data.h"
#include "ballistica/dynamics/bg/bg_dynamics_height_cache.h"
@@ -17,7 +12,6 @@
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/media/component/collide_model.h"
-#include "ballistica/platform/platform.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/collision_cache.cc b/src/ballistica/dynamics/collision_cache.cc
index 58e190bc..97b05b74 100644
--- a/src/ballistica/dynamics/collision_cache.cc
+++ b/src/ballistica/dynamics/collision_cache.cc
@@ -2,13 +2,9 @@
#include "ballistica/dynamics/collision_cache.h"
-#include
-
#include "ballistica/graphics/component/simple_component.h"
#include "ode/ode_collision_kernel.h"
#include "ode/ode_collision_space_internal.h"
-#include "ode/ode_collision_util.h"
-#include "ode/ode_objects_private.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/dynamics.cc b/src/ballistica/dynamics/dynamics.cc
index 463cf78f..813f1814 100644
--- a/src/ballistica/dynamics/dynamics.cc
+++ b/src/ballistica/dynamics/dynamics.cc
@@ -2,9 +2,6 @@
#include "ballistica/dynamics/dynamics.h"
-#include
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_source.h"
#include "ballistica/dynamics/collision.h"
diff --git a/src/ballistica/dynamics/material/impact_sound_material_action.cc b/src/ballistica/dynamics/material/impact_sound_material_action.cc
index 8e5f1b30..fa06c9ea 100644
--- a/src/ballistica/dynamics/material/impact_sound_material_action.cc
+++ b/src/ballistica/dynamics/material/impact_sound_material_action.cc
@@ -8,7 +8,6 @@
#include "ballistica/game/session/client_session.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics_server.h"
-#include "ballistica/media/component/sound.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/material/material.cc b/src/ballistica/dynamics/material/material.cc
index 4be741ee..397f295c 100644
--- a/src/ballistica/dynamics/material/material.cc
+++ b/src/ballistica/dynamics/material/material.cc
@@ -2,10 +2,7 @@
#include "ballistica/dynamics/material/material.h"
-#include
-#include
-
-#include "ballistica/dynamics/material/material_action.h"
+// #include "ballistica/dynamics/material/material_action.h"
#include "ballistica/dynamics/material/material_component.h"
#include "ballistica/dynamics/material/material_condition_node.h"
#include "ballistica/game/game_stream.h"
diff --git a/src/ballistica/dynamics/material/material.h b/src/ballistica/dynamics/material/material.h
index e1ea134b..85b5c7a4 100644
--- a/src/ballistica/dynamics/material/material.h
+++ b/src/ballistica/dynamics/material/material.h
@@ -6,8 +6,7 @@
#include
#include
-#include "ballistica/media/component/sound.h"
-#include "ballistica/python/python_ref.h"
+#include "ballistica/core/object.h"
namespace ballistica {
@@ -27,7 +26,6 @@ class Material : public Object {
/// Apply the material to a context.
void Apply(MaterialContext* s, const Part* src_part, const Part* dst_part);
auto label() const -> const std::string& { return label_; }
- auto hasPyObject() const -> bool { return (py_object_ != nullptr); }
auto NewPyRef() -> PyObject* { return GetPyRef(true); }
auto BorrowPyRef() -> PyObject* { return GetPyRef(false); }
void MarkDead();
@@ -43,13 +41,14 @@ class Material : public Object {
stream_id_ = -1;
}
void set_py_object(PyObject* obj) { py_object_ = obj; }
+ auto has_py_object() const -> bool { return (py_object_ != nullptr); }
auto py_object() const -> PyObject* { return py_object_; }
private:
- bool dead_ = false;
- int64_t stream_id_ = -1;
+ bool dead_{};
+ int64_t stream_id_{-1};
Object::WeakRef scene_;
- PyObject* py_object_ = nullptr;
+ PyObject* py_object_{};
auto GetPyRef(bool new_ref = true) -> PyObject*;
std::string label_;
std::vector > components_;
diff --git a/src/ballistica/dynamics/material/material_component.cc b/src/ballistica/dynamics/material/material_component.cc
index 3284d5ff..6e7fb561 100644
--- a/src/ballistica/dynamics/material/material_component.cc
+++ b/src/ballistica/dynamics/material/material_component.cc
@@ -4,22 +4,28 @@
#include "ballistica/dynamics/material/impact_sound_material_action.h"
#include "ballistica/dynamics/material/material.h"
-#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/dynamics/material/material_condition_node.h"
#include "ballistica/dynamics/material/material_context.h"
#include "ballistica/dynamics/material/node_message_material_action.h"
#include "ballistica/dynamics/material/node_mod_material_action.h"
#include "ballistica/dynamics/material/part_mod_material_action.h"
-#include "ballistica/dynamics/material/python_call_material_action.h"
#include "ballistica/dynamics/material/roll_sound_material_action.h"
#include "ballistica/dynamics/material/skid_sound_material_action.h"
#include "ballistica/dynamics/material/sound_material_action.h"
#include "ballistica/dynamics/part.h"
-#include "ballistica/generic/utils.h"
#include "ballistica/scene/node/node.h"
namespace ballistica {
+MaterialComponent::MaterialComponent() {}
+
+MaterialComponent::MaterialComponent(
+ const Object::Ref& conditions_in,
+ const std::vector >& actions_in)
+ : conditions(conditions_in), actions(actions_in) {}
+
+MaterialComponent::~MaterialComponent() {}
+
auto MaterialComponent::eval_conditions(
const Object::Ref& condition, const Material& c,
const Part* part, const Part* opposing_part, const MaterialContext& s)
diff --git a/src/ballistica/dynamics/material/material_component.h b/src/ballistica/dynamics/material/material_component.h
index fba0df8f..641c4efc 100644
--- a/src/ballistica/dynamics/material/material_component.h
+++ b/src/ballistica/dynamics/material/material_component.h
@@ -33,10 +33,11 @@ class MaterialComponent : public Object {
// Apply the component to a context.
void Apply(MaterialContext* c, const Part* src_part, const Part* dst_part);
- MaterialComponent() = default;
- MaterialComponent(const Object::Ref& conditions_in,
- std::vector > actions_in)
- : conditions(conditions_in), actions(std::move(actions_in)) {}
+ MaterialComponent();
+ MaterialComponent(
+ const Object::Ref& conditions_in,
+ const std::vector >& actions_in);
+ ~MaterialComponent();
};
} // namespace ballistica
diff --git a/src/ballistica/dynamics/material/material_context.cc b/src/ballistica/dynamics/material/material_context.cc
index 5c901ec0..9f26a4f9 100644
--- a/src/ballistica/dynamics/material/material_context.cc
+++ b/src/ballistica/dynamics/material/material_context.cc
@@ -22,6 +22,18 @@ MaterialContext::MaterialContext(Scene* scene)
physical(true),
complex_sound(false) {}
+MaterialContext::SoundEntry::SoundEntry(Sound* sound_in, float volume_in)
+ : sound(sound_in), volume(volume_in) {}
+
+MaterialContext::ImpactSoundEntry::ImpactSoundEntry(MaterialContext* context,
+ Sound* sound_in,
+ float target_impulse_in,
+ float volume_in)
+ : context(context),
+ sound(sound_in),
+ target_impulse(target_impulse_in),
+ volume(volume_in) {}
+
MaterialContext::SkidSoundEntry::SkidSoundEntry(
const MaterialContext::SkidSoundEntry& other) {
*this = other;
diff --git a/src/ballistica/dynamics/material/material_context.h b/src/ballistica/dynamics/material/material_context.h
index b25765b9..b1849337 100644
--- a/src/ballistica/dynamics/material/material_context.h
+++ b/src/ballistica/dynamics/material/material_context.h
@@ -31,8 +31,7 @@ class MaterialContext {
struct SoundEntry {
Object::Ref sound;
float volume;
- SoundEntry(Sound* sound_in, float volume_in)
- : sound(sound_in), volume(volume_in) {}
+ SoundEntry(Sound* sound_in, float volume_in);
};
class ImpactSoundEntry {
public:
@@ -41,11 +40,7 @@ class MaterialContext {
float volume;
float target_impulse;
ImpactSoundEntry(MaterialContext* context, Sound* sound_in,
- float target_impulse_in, float volume_in)
- : context(context),
- sound(sound_in),
- target_impulse(target_impulse_in),
- volume(volume_in) {}
+ float target_impulse_in, float volume_in);
};
class SkidSoundEntry {
public:
diff --git a/src/ballistica/dynamics/material/node_message_material_action.cc b/src/ballistica/dynamics/material/node_message_material_action.cc
index 3baf8190..cfad5692 100644
--- a/src/ballistica/dynamics/material/node_message_material_action.cc
+++ b/src/ballistica/dynamics/material/node_message_material_action.cc
@@ -4,7 +4,6 @@
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/material/material_context.h"
-#include "ballistica/media/component/sound.h"
#include "ballistica/scene/scene.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/material/node_mod_material_action.cc b/src/ballistica/dynamics/material/node_mod_material_action.cc
index f15a8c0b..9e799a45 100644
--- a/src/ballistica/dynamics/material/node_mod_material_action.cc
+++ b/src/ballistica/dynamics/material/node_mod_material_action.cc
@@ -4,7 +4,6 @@
#include "ballistica/dynamics/material/material_context.h"
#include "ballistica/generic/utils.h"
-#include "ballistica/media/component/sound.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/material/node_user_message_material_action.cc b/src/ballistica/dynamics/material/node_user_message_material_action.cc
index 01a1f044..a690dbe0 100644
--- a/src/ballistica/dynamics/material/node_user_message_material_action.cc
+++ b/src/ballistica/dynamics/material/node_user_message_material_action.cc
@@ -5,7 +5,6 @@
#include "ballistica/core/context.h"
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/material/material_context.h"
-#include "ballistica/media/component/sound.h"
#include "ballistica/scene/node/node.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/dynamics/material/part_mod_material_action.cc b/src/ballistica/dynamics/material/part_mod_material_action.cc
index e5bb02c6..95599bc4 100644
--- a/src/ballistica/dynamics/material/part_mod_material_action.cc
+++ b/src/ballistica/dynamics/material/part_mod_material_action.cc
@@ -4,7 +4,6 @@
#include "ballistica/dynamics/material/material_context.h"
#include "ballistica/generic/utils.h"
-#include "ballistica/media/component/sound.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/material/python_call_material_action.cc b/src/ballistica/dynamics/material/python_call_material_action.cc
index d711b516..89edb19d 100644
--- a/src/ballistica/dynamics/material/python_call_material_action.cc
+++ b/src/ballistica/dynamics/material/python_call_material_action.cc
@@ -4,9 +4,6 @@
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/material/material_context.h"
-#include "ballistica/dynamics/material/sound_material_action.h"
-#include "ballistica/media/component/sound.h"
-#include "ballistica/python/python_context_call.h"
#include "ballistica/scene/scene.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/material/skid_sound_material_action.cc b/src/ballistica/dynamics/material/skid_sound_material_action.cc
index 8cf6a3e3..b608355c 100644
--- a/src/ballistica/dynamics/material/skid_sound_material_action.cc
+++ b/src/ballistica/dynamics/material/skid_sound_material_action.cc
@@ -8,7 +8,6 @@
#include "ballistica/game/session/client_session.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics_server.h"
-#include "ballistica/media/component/sound.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/material/sound_material_action.cc b/src/ballistica/dynamics/material/sound_material_action.cc
index e8fefff9..db5bd6b7 100644
--- a/src/ballistica/dynamics/material/sound_material_action.cc
+++ b/src/ballistica/dynamics/material/sound_material_action.cc
@@ -6,7 +6,6 @@
#include "ballistica/game/game_stream.h"
#include "ballistica/game/session/client_session.h"
#include "ballistica/generic/utils.h"
-#include "ballistica/media/component/sound.h"
namespace ballistica {
diff --git a/src/ballistica/dynamics/rigid_body.cc b/src/ballistica/dynamics/rigid_body.cc
index c5f30f86..57b719d0 100644
--- a/src/ballistica/dynamics/rigid_body.cc
+++ b/src/ballistica/dynamics/rigid_body.cc
@@ -2,8 +2,6 @@
#include "ballistica/dynamics/rigid_body.h"
-#include
-
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/part.h"
#include "ballistica/generic/utils.h"
diff --git a/src/ballistica/game/game.cc b/src/ballistica/game/game.cc
index 31836a57..0cf37157 100644
--- a/src/ballistica/game/game.cc
+++ b/src/ballistica/game/game.cc
@@ -2,10 +2,6 @@
#include "ballistica/game/game.h"
-#include
-#include
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/app/app_config.h"
#include "ballistica/audio/audio.h"
@@ -31,9 +27,7 @@
#include "ballistica/input/device/client_input_device.h"
#include "ballistica/input/device/keyboard_input.h"
#include "ballistica/input/device/touch_input.h"
-#include "ballistica/math/vector3f.h"
#include "ballistica/networking/network_write_module.h"
-#include "ballistica/networking/networking.h"
#include "ballistica/networking/sockaddr.h"
#include "ballistica/networking/telnet_server.h"
#include "ballistica/python/python.h"
diff --git a/src/ballistica/game/player.cc b/src/ballistica/game/player.cc
index 1817b4d6..d3a5843c 100644
--- a/src/ballistica/game/player.cc
+++ b/src/ballistica/game/player.cc
@@ -2,8 +2,6 @@
#include "ballistica/game/player.h"
-#include
-
#include "ballistica/game/host_activity.h"
#include "ballistica/game/session/host_session.h"
#include "ballistica/generic/utils.h"
diff --git a/src/ballistica/game/player_spec.cc b/src/ballistica/game/player_spec.cc
index a894982e..4f849e10 100644
--- a/src/ballistica/game/player_spec.cc
+++ b/src/ballistica/game/player_spec.cc
@@ -2,8 +2,6 @@
#include "ballistica/game/player_spec.h"
-#include
-
#include "ballistica/app/app_globals.h"
#include "ballistica/game/account.h"
#include "ballistica/generic/json.h"
diff --git a/src/ballistica/generic/base64.cc b/src/ballistica/generic/base64.cc
index 19f5ed0f..959d14d0 100644
--- a/src/ballistica/generic/base64.cc
+++ b/src/ballistica/generic/base64.cc
@@ -29,8 +29,6 @@
*/
#include "ballistica/generic/base64.h"
-#include
-
namespace ballistica {
// NOLINTNEXTLINE(cert-err58-cpp)
diff --git a/src/ballistica/generic/huffman.cc b/src/ballistica/generic/huffman.cc
index f2d24348..6e35daba 100644
--- a/src/ballistica/generic/huffman.cc
+++ b/src/ballistica/generic/huffman.cc
@@ -2,9 +2,6 @@
#include "ballistica/generic/huffman.h"
-#include
-#include
-
#include "ballistica/networking/networking.h"
namespace ballistica {
diff --git a/src/ballistica/generic/json.cc b/src/ballistica/generic/json.cc
index 1f6ca367..315556f7 100644
--- a/src/ballistica/generic/json.cc
+++ b/src/ballistica/generic/json.cc
@@ -28,13 +28,12 @@
#include "ballistica/generic/json.h"
-#include
#include
+
+#if BA_OSTYPE_LINUX
#include
-#include
-#include
-#include
#include
+#endif
namespace ballistica {
diff --git a/src/ballistica/generic/utf8.cc b/src/ballistica/generic/utf8.cc
index b4f40f21..ad52c8a3 100644
--- a/src/ballistica/generic/utf8.cc
+++ b/src/ballistica/generic/utf8.cc
@@ -16,14 +16,12 @@
*/
#include "ballistica/generic/utf8.h"
-#include
-#include
-#include
-#include
#if _WIN32 || _WIN64
#include
-#else
-#include
+#endif
+
+#if BA_OSTYPE_LINUX
+#include
#endif
namespace ballistica {
diff --git a/src/ballistica/generic/utils.cc b/src/ballistica/generic/utils.cc
index aa293002..4ce06c07 100644
--- a/src/ballistica/generic/utils.cc
+++ b/src/ballistica/generic/utils.cc
@@ -2,15 +2,10 @@
#include "ballistica/generic/utils.h"
-#include
-#include
#include
-#include
#include
-#include
#include "ballistica/app/app_globals.h"
-#include "ballistica/generic/base64.h"
#include "ballistica/generic/huffman.h"
#include "ballistica/generic/json.h"
#include "ballistica/generic/utf8.h"
diff --git a/src/ballistica/graphics/area_of_interest.cc b/src/ballistica/graphics/area_of_interest.cc
index 9475c16d..58a682d1 100644
--- a/src/ballistica/graphics/area_of_interest.cc
+++ b/src/ballistica/graphics/area_of_interest.cc
@@ -2,8 +2,6 @@
#include "ballistica/graphics/area_of_interest.h"
-#include "ballistica/ballistica.h"
-
namespace ballistica {
AreaOfInterest::AreaOfInterest(bool in_focus) : in_focus_(in_focus) {}
diff --git a/src/ballistica/graphics/camera.cc b/src/ballistica/graphics/camera.cc
index fb5b3ac9..ee71892c 100644
--- a/src/ballistica/graphics/camera.cc
+++ b/src/ballistica/graphics/camera.cc
@@ -2,8 +2,6 @@
#include "ballistica/graphics/camera.h"
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/area_of_interest.h"
@@ -489,23 +487,24 @@ void Camera::UpdatePosition() {
// In vr mode we want or default area-of-interest to line up so that
// our fixed-overlay matrix and our regular overlay matrix come out
// the same.
-#if BA_VR_BUILD
- if (IsVRMode()) {
- // Only apply map's X offset if camera is locked.
- x_min = x_max = position_.x
- + (kCameraOffsetX
- + (lock_panning_ ? vr_offset_smooth_.x : 0.0f)
- + vr_extra_offset_.x);
- y_min = y_max =
- position_.y
- + (kCameraOffsetY + vr_offset_smooth_.y + vr_extra_offset_.y)
- + kVRFixedOverlayOffsetY;
- z_min = z_max =
- position_.z
- + (kCameraOffsetZ + vr_offset_smooth_.z + vr_extra_offset_.z)
- + kVRFixedOverlayOffsetZ;
+ if (g_buildconfig.vr_build()) {
+ if (IsVRMode()) {
+ // Only apply map's X offset if camera is locked.
+ x_min = x_max =
+ position_.x
+ + (kCameraOffsetX
+ + (lock_panning_ ? vr_offset_smooth_.x : 0.0f)
+ + vr_extra_offset_.x);
+ y_min = y_max = position_.y
+ + (kCameraOffsetY + vr_offset_smooth_.y
+ + vr_extra_offset_.y)
+ + kVRFixedOverlayOffsetY;
+ z_min = z_max = position_.z
+ + (kCameraOffsetZ + vr_offset_smooth_.z
+ + vr_extra_offset_.z)
+ + kVRFixedOverlayOffsetZ;
+ }
}
-#endif
}
field_of_view_x_ = 45.0f;
field_of_view_y_ = 30.0f;
@@ -895,9 +894,9 @@ void Camera::ApplyToFrameDef(FrameDef* frame_def) {
frame_def->set_camera_mode(mode_);
// FIXME - we should have some sort of support
- // for multiple cameras each with their own pass...
- // for now, though, there's just a single beauty pass
- // which is us
+ // for multiple cameras each with their own pass.
+ // for now, though, there's just a single beauty pass
+ // which is us.
RenderPass* passes[] = {
frame_def->beauty_pass(),
@@ -978,6 +977,7 @@ void Camera::ApplyToFrameDef(FrameDef* frame_def) {
position_.z + extra_pos_2_.z));
// If we're vr, apply current vr offsets.
+ // FIXME: should create a VRCamera subclass or whatnot.
if (IsVRMode()) {
if (mode_ == CameraMode::kFollow) {
Vector3f cam_original = frame_def->cam_original();
diff --git a/src/ballistica/graphics/component/object_component.cc b/src/ballistica/graphics/component/object_component.cc
index a0fda454..0058b61c 100644
--- a/src/ballistica/graphics/component/object_component.cc
+++ b/src/ballistica/graphics/component/object_component.cc
@@ -2,8 +2,6 @@
#include "ballistica/graphics/component/object_component.h"
-#include "ballistica/graphics/renderer.h"
-
namespace ballistica {
void ObjectComponent::WriteConfig() {
diff --git a/src/ballistica/graphics/component/render_component.cc b/src/ballistica/graphics/component/render_component.cc
index 533474ff..58406049 100644
--- a/src/ballistica/graphics/component/render_component.cc
+++ b/src/ballistica/graphics/component/render_component.cc
@@ -3,7 +3,6 @@
#include "ballistica/graphics/component/render_component.h"
#include "ballistica/dynamics/rigid_body.h"
-#include "ballistica/graphics/graphics_server.h"
namespace ballistica {
diff --git a/src/ballistica/graphics/gl/gl_sys.cc b/src/ballistica/graphics/gl/gl_sys.cc
index b2e66444..71a790df 100644
--- a/src/ballistica/graphics/gl/gl_sys.cc
+++ b/src/ballistica/graphics/gl/gl_sys.cc
@@ -3,9 +3,6 @@
#if BA_ENABLE_OPENGL
#include "ballistica/graphics/gl/gl_sys.h"
-#include
-
-#include "ballistica/ballistica.h"
#include "ballistica/platform/sdl/sdl_app.h"
#if BA_OSTYPE_ANDROID
diff --git a/src/ballistica/graphics/gl/renderer_gl.cc b/src/ballistica/graphics/gl/renderer_gl.cc
index 8da46450..b672be6a 100644
--- a/src/ballistica/graphics/gl/renderer_gl.cc
+++ b/src/ballistica/graphics/gl/renderer_gl.cc
@@ -3,19 +3,9 @@
#if BA_ENABLE_OPENGL
#include "ballistica/graphics/gl/renderer_gl.h"
-#include
-#include
-#include
-#include
-#include
-
#include "ballistica/graphics/component/special_component.h"
-#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/mesh/mesh_renderer_data.h"
-#include "ballistica/math/matrix44f.h"
-#include "ballistica/media/data/model_data.h"
-#include "ballistica/media/data/model_renderer_data.h"
#include "ballistica/media/data/texture_preload_data.h"
#include "ballistica/media/data/texture_renderer_data.h"
diff --git a/src/ballistica/graphics/graphics.cc b/src/ballistica/graphics/graphics.cc
index ebd9b92c..6d36b1fa 100644
--- a/src/ballistica/graphics/graphics.cc
+++ b/src/ballistica/graphics/graphics.cc
@@ -2,10 +2,6 @@
#include "ballistica/graphics/graphics.h"
-#include
-#include
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/app/app_globals.h"
#include "ballistica/dynamics/bg/bg_dynamics.h"
@@ -26,9 +22,9 @@
#include "ballistica/graphics/net_graph.h"
#include "ballistica/graphics/text/text_graphics.h"
#include "ballistica/input/input.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_context_call.h"
+#include "ballistica/scene/node/globals_node.h"
#include "ballistica/scene/scene.h"
#include "ballistica/ui/console.h"
#include "ballistica/ui/root_ui.h"
@@ -37,12 +33,12 @@
namespace ballistica {
-const float kScreenMessageZDepth = -0.06f;
-const float kScreenMeshZDepth = -0.05f;
-const float kProgressBarZDepth = 0.0f;
-const int kProgressBarFadeTime = 500;
-const float kDebugImgZDepth = -0.04f;
-const float kCursorZDepth = -0.1f;
+const float kScreenMessageZDepth{-0.06f};
+const float kScreenMeshZDepth{-0.05f};
+const float kProgressBarZDepth{0.0f};
+const int kProgressBarFadeTime{500};
+const float kDebugImgZDepth{-0.04f};
+const float kCursorZDepth{-0.1f};
auto Graphics::IsShaderTransparent(ShadingType c) -> bool {
switch (c) {
@@ -1885,4 +1881,27 @@ auto Graphics::ReflectionTypeFromString(const std::string& s)
return r;
}
+auto Graphics::ApplyGlobals(GlobalsNode* globals) -> void {
+ set_floor_reflection(globals->floor_reflection());
+ camera()->SetMode(globals->camera_mode());
+ camera()->set_vr_offset(Vector3f(globals->vr_camera_offset()));
+ camera()->set_happy_thoughts_mode(globals->happy_thoughts_mode());
+ set_shadow_scale(globals->shadow_scale()[0], globals->shadow_scale()[1]);
+ auto&& area_of_interest_bounds{globals->area_of_interest_bounds()};
+ camera()->set_area_of_interest_bounds(
+ area_of_interest_bounds[0], area_of_interest_bounds[1],
+ area_of_interest_bounds[2], area_of_interest_bounds[3],
+ area_of_interest_bounds[4], area_of_interest_bounds[5]);
+ auto&& shadow_range{globals->shadow_range()};
+ SetShadowRange(shadow_range[0], shadow_range[1], shadow_range[2],
+ shadow_range[3]);
+ set_shadow_offset(Vector3f(globals->shadow_offset()));
+ set_shadow_ortho(globals->shadow_ortho());
+ set_tint(Vector3f(globals->tint()));
+
+ set_ambient_color(Vector3f(globals->ambient_color()));
+ set_vignette_outer(Vector3f(globals->vignette_outer()));
+ set_vignette_inner(Vector3f(globals->vignette_inner()));
+}
+
} // namespace ballistica
diff --git a/src/ballistica/graphics/graphics.h b/src/ballistica/graphics/graphics.h
index 56f8d789..9efc3bde 100644
--- a/src/ballistica/graphics/graphics.h
+++ b/src/ballistica/graphics/graphics.h
@@ -64,6 +64,7 @@ class Graphics {
auto BuildAndPushFrameDef() -> void;
virtual auto ApplyCamera(FrameDef* frame_def) -> void;
+ virtual auto ApplyGlobals(GlobalsNode* globals) -> void;
// Called when the GraphicsServer's screen configuration changes.
auto ScreenResize(float virtual_width, float virtual_height,
diff --git a/src/ballistica/graphics/graphics_server.cc b/src/ballistica/graphics/graphics_server.cc
index 91ce188f..d3450199 100644
--- a/src/ballistica/graphics/graphics_server.cc
+++ b/src/ballistica/graphics/graphics_server.cc
@@ -2,14 +2,8 @@
#include "ballistica/graphics/graphics_server.h"
-#include
-#include
-
#include "ballistica/core/thread.h"
-#include "ballistica/generic/lambda_runnable.h"
#include "ballistica/graphics/gl/renderer_gl.h"
-#include "ballistica/graphics/renderer.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/scene/scene.h"
// FIXME: clear out this conditional stuff.
@@ -17,6 +11,11 @@
#include "ballistica/platform/sdl/sdl_app.h"
#else
#include "ballistica/app/app.h"
+#include "ballistica/graphics/frame_def.h"
+#include "ballistica/graphics/mesh/mesh_data.h"
+#include "ballistica/graphics/renderer.h"
+#include "ballistica/media/media.h"
+#include "ballistica/platform/platform.h"
#endif
namespace ballistica {
diff --git a/src/ballistica/graphics/mesh/text_mesh.cc b/src/ballistica/graphics/mesh/text_mesh.cc
index 895cf43b..25b0d19b 100644
--- a/src/ballistica/graphics/mesh/text_mesh.cc
+++ b/src/ballistica/graphics/mesh/text_mesh.cc
@@ -2,10 +2,6 @@
#include "ballistica/graphics/mesh/text_mesh.h"
-#include
-#include
-#include
-
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/text/text_graphics.h"
diff --git a/src/ballistica/graphics/net_graph.cc b/src/ballistica/graphics/net_graph.cc
index b9aa4d4f..7ad9997b 100644
--- a/src/ballistica/graphics/net_graph.cc
+++ b/src/ballistica/graphics/net_graph.cc
@@ -3,7 +3,6 @@
#include "ballistica/graphics/net_graph.h"
#include
-#include
#include "ballistica/graphics/component/simple_component.h"
diff --git a/src/ballistica/graphics/render_pass.cc b/src/ballistica/graphics/render_pass.cc
index 9b78edef..22e577ae 100644
--- a/src/ballistica/graphics/render_pass.cc
+++ b/src/ballistica/graphics/render_pass.cc
@@ -2,9 +2,6 @@
#include "ballistica/graphics/render_pass.h"
-#include
-#include
-
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/renderer.h"
diff --git a/src/ballistica/graphics/renderer.cc b/src/ballistica/graphics/renderer.cc
index 1e7a0059..f38d66e2 100644
--- a/src/ballistica/graphics/renderer.cc
+++ b/src/ballistica/graphics/renderer.cc
@@ -2,12 +2,7 @@
#include "ballistica/graphics/renderer.h"
-#include
-#include
-
#include "ballistica/graphics/graphics_server.h"
-#include "ballistica/graphics/text/text_packer.h"
-#include "ballistica/graphics/vr_graphics.h"
// FIXME: Clear out conditional stuff.
#if BA_OSTYPE_MACOS && BA_SDL_BUILD && !BA_SDL2_BUILD
@@ -16,6 +11,7 @@
#if BA_VR_BUILD
#include "ballistica/app/app_globals.h"
+#include "ballistica/graphics/vr_graphics.h"
#endif
namespace ballistica {
diff --git a/src/ballistica/graphics/text/text_graphics.cc b/src/ballistica/graphics/text/text_graphics.cc
index 43ebb9fb..b4de0aa2 100644
--- a/src/ballistica/graphics/text/text_graphics.cc
+++ b/src/ballistica/graphics/text/text_graphics.cc
@@ -2,10 +2,6 @@
#include "ballistica/graphics/text/text_graphics.h"
-#include
-#include
-
-#include "ballistica/ballistica.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/text/font_page_map_data.h"
#include "ballistica/platform/platform.h"
diff --git a/src/ballistica/graphics/text/text_group.cc b/src/ballistica/graphics/text/text_group.cc
index 239656db..43aee897 100644
--- a/src/ballistica/graphics/text/text_group.cc
+++ b/src/ballistica/graphics/text/text_group.cc
@@ -2,10 +2,6 @@
#include "ballistica/graphics/text/text_group.h"
-#include
-#include
-#include
-
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/text/text_graphics.h"
diff --git a/src/ballistica/graphics/text/text_packer.cc b/src/ballistica/graphics/text/text_packer.cc
index e769a9b6..1afcbb1f 100644
--- a/src/ballistica/graphics/text/text_packer.cc
+++ b/src/ballistica/graphics/text/text_packer.cc
@@ -2,8 +2,6 @@
#include "ballistica/graphics/text/text_packer.h"
-#include
-
namespace ballistica {
TextPacker::TextPacker(float resolution_scale)
diff --git a/src/ballistica/graphics/texture/dds.cc b/src/ballistica/graphics/texture/dds.cc
index 02f2c700..56ec6245 100644
--- a/src/ballistica/graphics/texture/dds.cc
+++ b/src/ballistica/graphics/texture/dds.cc
@@ -2,9 +2,6 @@
#include "ballistica/graphics/texture/dds.h"
-#include
-
-#include "ballistica/ballistica.h"
#include "ballistica/platform/platform.h"
#if BA_ENABLE_OPENGL
diff --git a/src/ballistica/graphics/texture/pvr.cc b/src/ballistica/graphics/texture/pvr.cc
index 1a0a9acf..bc52a418 100644
--- a/src/ballistica/graphics/texture/pvr.cc
+++ b/src/ballistica/graphics/texture/pvr.cc
@@ -2,11 +2,6 @@
#include "ballistica/graphics/texture/pvr.h"
-#include
-#include
-#include
-
-#include "ballistica/ballistica.h"
#include "ballistica/platform/platform.h"
namespace ballistica {
diff --git a/src/ballistica/graphics/vr_graphics.cc b/src/ballistica/graphics/vr_graphics.cc
index fd8d043c..643eed77 100644
--- a/src/ballistica/graphics/vr_graphics.cc
+++ b/src/ballistica/graphics/vr_graphics.cc
@@ -11,6 +11,7 @@
#include "ballistica/graphics/component/special_component.h"
#include "ballistica/graphics/frame_def.h"
#include "ballistica/graphics/render_pass.h"
+#include "ballistica/scene/node/globals_node.h"
namespace ballistica {
@@ -331,6 +332,16 @@ void VRGraphics::DrawVRControllers(FrameDef* frame_def) {
}
}
+auto VRGraphics::ApplyGlobals(GlobalsNode* globals) -> void {
+ Graphics::ApplyGlobals(globals);
+
+ if (IsVRMode()) {
+ set_vr_near_clip(globals->vr_near_clip());
+ set_vr_overlay_center(Vector3f(globals->vr_overlay_center()));
+ set_vr_overlay_center_enabled(globals->vr_overlay_center_enabled());
+ }
+}
+
} // namespace ballistica
#endif // BA_VR_BUILD
diff --git a/src/ballistica/graphics/vr_graphics.h b/src/ballistica/graphics/vr_graphics.h
index aad80eba..1f7c1c52 100644
--- a/src/ballistica/graphics/vr_graphics.h
+++ b/src/ballistica/graphics/vr_graphics.h
@@ -3,8 +3,6 @@
#ifndef BALLISTICA_GRAPHICS_VR_GRAPHICS_H_
#define BALLISTICA_GRAPHICS_VR_GRAPHICS_H_
-#if BA_VR_BUILD
-
#include
#include "ballistica/graphics/graphics.h"
@@ -15,6 +13,8 @@ const float kDefaultVRHeadScale = 18.0f;
const float kVRFixedOverlayOffsetY = -7.0f;
const float kVRFixedOverlayOffsetZ = -22.0f;
+#if BA_VR_BUILD
+
class VRGraphics : public Graphics {
public:
/// Return g_graphics as a VRGraphics. (assumes it actually is one).
@@ -24,7 +24,9 @@ class VRGraphics : public Graphics {
== static_cast(g_graphics));
return static_cast(g_graphics);
}
- void ApplyCamera(FrameDef* frame_def) override;
+ auto ApplyCamera(FrameDef* frame_def) -> void override;
+ auto ApplyGlobals(GlobalsNode* globals) -> void override;
+
void DrawWorld(Session* session, FrameDef* frame_def) override;
void DrawUI(FrameDef* frame_def) override;
@@ -78,9 +80,8 @@ class VRGraphics : public Graphics {
bool draw_overlay_bounds_{};
float vr_test_head_scale_{kDefaultVRHeadScale};
};
+#endif // BA_VR_BUILD
} // namespace ballistica
-#endif // BA_VR_BUILD
-
#endif // BALLISTICA_GRAPHICS_VR_GRAPHICS_H_
diff --git a/src/ballistica/input/device/client_input_device.cc b/src/ballistica/input/device/client_input_device.cc
index 7cd2f23b..6dbdd790 100644
--- a/src/ballistica/input/device/client_input_device.cc
+++ b/src/ballistica/input/device/client_input_device.cc
@@ -2,9 +2,6 @@
#include "ballistica/input/device/client_input_device.h"
-#include
-#include
-
#include "ballistica/game/connection/connection_to_client.h"
#include "ballistica/game/player.h"
#include "ballistica/networking/networking.h"
diff --git a/src/ballistica/input/device/input_device.cc b/src/ballistica/input/device/input_device.cc
index cf790475..7f26bb9c 100644
--- a/src/ballistica/input/device/input_device.cc
+++ b/src/ballistica/input/device/input_device.cc
@@ -2,7 +2,6 @@
#include "ballistica/input/device/input_device.h"
-#include
#include
#include
@@ -11,7 +10,6 @@
#include "ballistica/game/player.h"
#include "ballistica/game/session/host_session.h"
#include "ballistica/game/session/net_client_session.h"
-#include "ballistica/game/session/replay_client_session.h"
#include "ballistica/networking/networking.h"
#include "ballistica/python/class/python_class_input_device.h"
#include "ballistica/python/python.h"
diff --git a/src/ballistica/input/device/joystick.cc b/src/ballistica/input/device/joystick.cc
index e85466bd..0df029d6 100644
--- a/src/ballistica/input/device/joystick.cc
+++ b/src/ballistica/input/device/joystick.cc
@@ -2,9 +2,6 @@
#include "ballistica/input/device/joystick.h"
-#include
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/audio.h"
diff --git a/src/ballistica/input/device/test_input.cc b/src/ballistica/input/device/test_input.cc
index 782e661b..0f5bc977 100644
--- a/src/ballistica/input/device/test_input.cc
+++ b/src/ballistica/input/device/test_input.cc
@@ -2,8 +2,6 @@
#include "ballistica/input/device/test_input.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/input/device/joystick.h"
#include "ballistica/input/input.h"
diff --git a/src/ballistica/input/device/touch_input.cc b/src/ballistica/input/device/touch_input.cc
index 21fa7238..5cfef0f4 100644
--- a/src/ballistica/input/device/touch_input.cc
+++ b/src/ballistica/input/device/touch_input.cc
@@ -2,9 +2,6 @@
#include "ballistica/input/device/touch_input.h"
-#include
-#include
-
#include "ballistica/app/app_config.h"
#include "ballistica/app/app_globals.h"
#include "ballistica/game/host_activity.h"
@@ -12,7 +9,6 @@
#include "ballistica/graphics/camera.h"
#include "ballistica/graphics/component/simple_component.h"
#include "ballistica/python/python.h"
-#include "ballistica/python/python_command.h"
#include "ballistica/scene/node/player_node.h"
#include "ballistica/ui/ui.h"
diff --git a/src/ballistica/input/input.cc b/src/ballistica/input/input.cc
index d5468354..12f8007f 100644
--- a/src/ballistica/input/input.cc
+++ b/src/ballistica/input/input.cc
@@ -2,8 +2,6 @@
#include "ballistica/input/input.h"
-#include
-
#include "ballistica/app/app_config.h"
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/audio.h"
diff --git a/src/ballistica/input/remote_app.cc b/src/ballistica/input/remote_app.cc
index 4ee86c7d..ad8fcaa9 100644
--- a/src/ballistica/input/remote_app.cc
+++ b/src/ballistica/input/remote_app.cc
@@ -6,18 +6,10 @@
#include
#pragma comment(lib, "ws2_32.lib")
#else
-#include
-#include
-#include
-#include
#endif
-#include
-#include
-
#include "ballistica/app/app_globals.h"
-#include "ballistica/ballistica.h"
#include "ballistica/game/game.h"
#include "ballistica/generic/utils.h"
#include "ballistica/input/input.h"
diff --git a/src/ballistica/input/std_input_module.cc b/src/ballistica/input/std_input_module.cc
index 6b772bfc..b7fb37a5 100644
--- a/src/ballistica/input/std_input_module.cc
+++ b/src/ballistica/input/std_input_module.cc
@@ -2,8 +2,9 @@
#include "ballistica/input/std_input_module.h"
-#include
+#if BA_OSTYPE_LINUX
#include
+#endif
#include "ballistica/app/app_globals.h"
#include "ballistica/game/game.h"
diff --git a/src/ballistica/math/random.cc b/src/ballistica/math/random.cc
index 06bf143e..c0690ea1 100644
--- a/src/ballistica/math/random.cc
+++ b/src/ballistica/math/random.cc
@@ -3,7 +3,6 @@
#include "ballistica/math/random.h"
#include
-#include
#include
#include
diff --git a/src/ballistica/media/component/collide_model.cc b/src/ballistica/media/component/collide_model.cc
index 64633e36..8a4c4a69 100644
--- a/src/ballistica/media/component/collide_model.cc
+++ b/src/ballistica/media/component/collide_model.cc
@@ -2,8 +2,6 @@
#include "ballistica/media/component/collide_model.h"
-#include
-
#include "ballistica/game/game_stream.h"
#include "ballistica/python/class/python_class_collide_model.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/media/component/media_component.cc b/src/ballistica/media/component/media_component.cc
index cb99c240..049aedf9 100644
--- a/src/ballistica/media/component/media_component.cc
+++ b/src/ballistica/media/component/media_component.cc
@@ -2,9 +2,6 @@
#include "ballistica/media/component/media_component.h"
-#include
-#include
-
#include "ballistica/python/python_sys.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/media/component/texture.cc b/src/ballistica/media/component/texture.cc
index d5863c4d..552f8a53 100644
--- a/src/ballistica/media/component/texture.cc
+++ b/src/ballistica/media/component/texture.cc
@@ -2,8 +2,6 @@
#include "ballistica/media/component/texture.h"
-#include
-
#include "ballistica/game/game_stream.h"
#include "ballistica/graphics/renderer.h"
#include "ballistica/python/class/python_class_texture.h"
diff --git a/src/ballistica/media/data/collide_model_data.cc b/src/ballistica/media/data/collide_model_data.cc
index 2ee3cab4..d1e7c751 100644
--- a/src/ballistica/media/data/collide_model_data.cc
+++ b/src/ballistica/media/data/collide_model_data.cc
@@ -2,8 +2,6 @@
#include "ballistica/media/data/collide_model_data.h"
-#include
-
#include "ballistica/media/media.h"
namespace ballistica {
diff --git a/src/ballistica/media/data/model_data.cc b/src/ballistica/media/data/model_data.cc
index c977e3ae..637e4153 100644
--- a/src/ballistica/media/data/model_data.cc
+++ b/src/ballistica/media/data/model_data.cc
@@ -2,12 +2,8 @@
#include "ballistica/media/data/model_data.h"
-#include
-#include
-
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/renderer.h"
-#include "ballistica/media/media.h"
namespace ballistica {
diff --git a/src/ballistica/media/data/sound_data.cc b/src/ballistica/media/data/sound_data.cc
index 1eefa6a6..52d9e68f 100644
--- a/src/ballistica/media/data/sound_data.cc
+++ b/src/ballistica/media/data/sound_data.cc
@@ -2,10 +2,6 @@
#include "ballistica/media/data/sound_data.h"
-#include
-
-#include
-
#if BA_ENABLE_AUDIO
#if BA_USE_TREMOR_VORBIS
#include "ivorbisfile.h" // NOLINT
@@ -14,12 +10,8 @@
#endif
#endif // BA_ENABLE_AUDIO
-#include
-#include
-
#include "ballistica/audio/audio_server.h"
#include "ballistica/media/media.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
// Need to move away from OpenAL on Apple stuff.
diff --git a/src/ballistica/media/data/texture_data.cc b/src/ballistica/media/data/texture_data.cc
index 16e52ab6..d931abfd 100644
--- a/src/ballistica/media/data/texture_data.cc
+++ b/src/ballistica/media/data/texture_data.cc
@@ -2,11 +2,6 @@
#include "ballistica/media/data/texture_data.h"
-#include
-#include
-#include
-#include
-
#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/renderer.h"
@@ -16,7 +11,6 @@
#include "ballistica/graphics/texture/pvr.h"
#include "ballistica/media/data/texture_preload_data.h"
#include "ballistica/media/data/texture_renderer_data.h"
-#include "ballistica/media/media.h"
#include "external/qr_code_generator/QrCode.hpp"
namespace ballistica {
diff --git a/src/ballistica/media/data/texture_preload_data.cc b/src/ballistica/media/data/texture_preload_data.cc
index b39c79ff..3f54a7d4 100644
--- a/src/ballistica/media/data/texture_preload_data.cc
+++ b/src/ballistica/media/data/texture_preload_data.cc
@@ -2,8 +2,9 @@
#include "ballistica/media/data/texture_preload_data.h"
-#include
+#if BA_OSTYPE_LINUX
#include
+#endif
#include "ballistica/graphics/texture/ktx.h"
#include "ballistica/media/component/texture.h"
diff --git a/src/ballistica/media/media.cc b/src/ballistica/media/media.cc
index c7cc9c3b..36d13ca7 100644
--- a/src/ballistica/media/media.cc
+++ b/src/ballistica/media/media.cc
@@ -6,9 +6,6 @@
#include
#endif
-#include
-#include
-
#include "ballistica/audio/audio_server.h"
#include "ballistica/game/game.h"
#include "ballistica/generic/timer.h"
@@ -18,7 +15,6 @@
#include "ballistica/media/component/data.h"
#include "ballistica/media/component/model.h"
#include "ballistica/media/component/texture.h"
-#include "ballistica/media/data/data_data.h"
#include "ballistica/media/data/sound_data.h"
#include "ballistica/media/media_server.h"
#include "ballistica/python/python_sys.h"
diff --git a/src/ballistica/media/media_server.cc b/src/ballistica/media/media_server.cc
index ed927cd1..6785cdd0 100644
--- a/src/ballistica/media/media_server.cc
+++ b/src/ballistica/media/media_server.cc
@@ -2,16 +2,12 @@
#include "ballistica/media/media_server.h"
-#include
-#include
-
#include "ballistica/generic/huffman.h"
#include "ballistica/generic/timer.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/media/media.h"
-#include "ballistica/platform/platform.h"
namespace ballistica {
diff --git a/src/ballistica/networking/telnet_server.cc b/src/ballistica/networking/telnet_server.cc
index 69702fd6..c55ddaa0 100644
--- a/src/ballistica/networking/telnet_server.cc
+++ b/src/ballistica/networking/telnet_server.cc
@@ -2,10 +2,7 @@
#include "ballistica/networking/telnet_server.h"
-#include
-
#include "ballistica/app/app_globals.h"
-#include "ballistica/ballistica.h"
#include "ballistica/core/context.h"
#include "ballistica/game/game.h"
#include "ballistica/networking/networking.h"
diff --git a/src/ballistica/platform/platform.cc b/src/ballistica/platform/platform.cc
index 43f0d380..0457c381 100644
--- a/src/ballistica/platform/platform.cc
+++ b/src/ballistica/platform/platform.cc
@@ -14,19 +14,12 @@
#include
#endif
#include
-#include
-#include
#include
#endif
-#include
#include
-#include
-#include
#include "ballistica/app/app.h"
-#include "ballistica/app/headless_app.h"
-#include "ballistica/app/vr_app.h"
#include "ballistica/core/thread.h"
#include "ballistica/dynamics/bg/bg_dynamics_server.h"
#include "ballistica/game/friend_score_set.h"
@@ -43,6 +36,14 @@
#include "ballistica/platform/sdl/sdl_app.h"
#include "ballistica/python/python.h"
+#if BA_HEADLESS_BUILD
+#include "ballistica/app/headless_app.h"
+#endif
+
+#if BA_VR_BUILD
+#include "ballistica/app/vr_app.h"
+#endif
+
// ------------------------- PLATFORM SELECTION --------------------------------
// This ugly chunk of macros simply pulls in the correct platform class header
@@ -569,6 +570,15 @@ static void HandleArgs(int argc, char** argv) {
fflush(stdout);
exit(-1);
}
+ } else if (!strcmp(argv[i], "--crash")) {
+ int dummyval{};
+ int* invalid_ptr{&dummyval};
+
+ // A bit of obfuscation to try and keep linters quiet.
+ if (explicit_bool(true)) {
+ invalid_ptr = nullptr;
+ }
+ *invalid_ptr = 1;
} else if (!strcmp(argv[i], "-cfgdir")) {
if (i + 1 < argc) {
g_app_globals->user_config_dir = argv[i + 1];
diff --git a/src/ballistica/platform/sdl/sdl_app.cc b/src/ballistica/platform/sdl/sdl_app.cc
index 6cd2c6a9..69dea3b3 100644
--- a/src/ballistica/platform/sdl/sdl_app.cc
+++ b/src/ballistica/platform/sdl/sdl_app.cc
@@ -4,8 +4,6 @@
#include "ballistica/platform/sdl/sdl_app.h"
-#include
-
#include "ballistica/core/thread.h"
#include "ballistica/dynamics/bg/bg_dynamics.h"
#include "ballistica/game/game.h"
diff --git a/src/ballistica/python/class/python_class_activity_data.cc b/src/ballistica/python/class/python_class_activity_data.cc
index e4a28343..f24fcaa0 100644
--- a/src/ballistica/python/class/python_class_activity_data.cc
+++ b/src/ballistica/python/class/python_class_activity_data.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_activity_data.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/game/host_activity.h"
#include "ballistica/game/session/host_session.h"
diff --git a/src/ballistica/python/class/python_class_collide_model.cc b/src/ballistica/python/class/python_class_collide_model.cc
index cb1cb177..8ad2b8e0 100644
--- a/src/ballistica/python/class/python_class_collide_model.cc
+++ b/src/ballistica/python/class/python_class_collide_model.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_collide_model.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/media/component/collide_model.h"
diff --git a/src/ballistica/python/class/python_class_context.cc b/src/ballistica/python/class/python_class_context.cc
index 6379ba58..4c65011f 100644
--- a/src/ballistica/python/class/python_class_context.cc
+++ b/src/ballistica/python/class/python_class_context.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_context.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/game/host_activity.h"
#include "ballistica/game/session/host_session.h"
diff --git a/src/ballistica/python/class/python_class_context_call.cc b/src/ballistica/python/class/python_class_context_call.cc
index dd48845b..10273e2d 100644
--- a/src/ballistica/python/class/python_class_context_call.cc
+++ b/src/ballistica/python/class/python_class_context_call.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_context_call.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/python/python_context_call.h"
diff --git a/src/ballistica/python/class/python_class_data.cc b/src/ballistica/python/class/python_class_data.cc
index 2476aad5..f2f42d8b 100644
--- a/src/ballistica/python/class/python_class_data.cc
+++ b/src/ballistica/python/class/python_class_data.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_data.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/media/component/data.h"
diff --git a/src/ballistica/python/class/python_class_input_device.cc b/src/ballistica/python/class/python_class_input_device.cc
index 6bb50888..ec38cefc 100644
--- a/src/ballistica/python/class/python_class_input_device.cc
+++ b/src/ballistica/python/class/python_class_input_device.cc
@@ -2,11 +2,8 @@
#include "ballistica/python/class/python_class_input_device.h"
-#include
-
#include "ballistica/game/player.h"
#include "ballistica/input/device/input_device.h"
-#include "ballistica/input/device/keyboard_input.h"
#include "ballistica/python/python.h"
namespace ballistica {
diff --git a/src/ballistica/python/class/python_class_material.cc b/src/ballistica/python/class/python_class_material.cc
index adfc05ef..78e8f4a8 100644
--- a/src/ballistica/python/class/python_class_material.cc
+++ b/src/ballistica/python/class/python_class_material.cc
@@ -2,9 +2,6 @@
#include "ballistica/python/class/python_class_material.h"
-#include
-#include
-
#include "ballistica/dynamics/material/impact_sound_material_action.h"
#include "ballistica/dynamics/material/material.h"
#include "ballistica/dynamics/material/material_component.h"
diff --git a/src/ballistica/python/class/python_class_model.cc b/src/ballistica/python/class/python_class_model.cc
index 3480a59e..9a2a0fc8 100644
--- a/src/ballistica/python/class/python_class_model.cc
+++ b/src/ballistica/python/class/python_class_model.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_model.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/media/component/model.h"
diff --git a/src/ballistica/python/class/python_class_node.cc b/src/ballistica/python/class/python_class_node.cc
index 6f0543fb..f40fac28 100644
--- a/src/ballistica/python/class/python_class_node.cc
+++ b/src/ballistica/python/class/python_class_node.cc
@@ -3,7 +3,6 @@
#include "ballistica/python/class/python_class_node.h"
#include
-#include
#include "ballistica/game/game_stream.h"
#include "ballistica/python/python.h"
diff --git a/src/ballistica/python/class/python_class_session_data.cc b/src/ballistica/python/class/python_class_session_data.cc
index ad1ffacd..d0d46569 100644
--- a/src/ballistica/python/class/python_class_session_data.cc
+++ b/src/ballistica/python/class/python_class_session_data.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_session_data.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/game/session/session.h"
#include "ballistica/generic/utils.h"
diff --git a/src/ballistica/python/class/python_class_session_player.cc b/src/ballistica/python/class/python_class_session_player.cc
index 8b8026fc..6fea19b6 100644
--- a/src/ballistica/python/class/python_class_session_player.cc
+++ b/src/ballistica/python/class/python_class_session_player.cc
@@ -2,9 +2,6 @@
#include "ballistica/python/class/python_class_session_player.h"
-#include
-#include
-
#include "ballistica/game/host_activity.h"
#include "ballistica/game/player.h"
#include "ballistica/game/session/host_session.h"
diff --git a/src/ballistica/python/class/python_class_sound.cc b/src/ballistica/python/class/python_class_sound.cc
index c3062523..c349cacc 100644
--- a/src/ballistica/python/class/python_class_sound.cc
+++ b/src/ballistica/python/class/python_class_sound.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_sound.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/media/component/sound.h"
diff --git a/src/ballistica/python/class/python_class_texture.cc b/src/ballistica/python/class/python_class_texture.cc
index 066bac50..1a21273a 100644
--- a/src/ballistica/python/class/python_class_texture.cc
+++ b/src/ballistica/python/class/python_class_texture.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/class/python_class_texture.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/media/component/texture.h"
diff --git a/src/ballistica/python/class/python_class_timer.cc b/src/ballistica/python/class/python_class_timer.cc
index 9e730975..81ea7537 100644
--- a/src/ballistica/python/class/python_class_timer.cc
+++ b/src/ballistica/python/class/python_class_timer.cc
@@ -2,11 +2,7 @@
#include "ballistica/python/class/python_class_timer.h"
-#include
-
#include "ballistica/game/game.h"
-#include "ballistica/game/host_activity.h"
-#include "ballistica/game/session/host_session.h"
#include "ballistica/python/python_context_call_runnable.h"
namespace ballistica {
diff --git a/src/ballistica/python/class/python_class_vec3.cc b/src/ballistica/python/class/python_class_vec3.cc
index 01add733..3fbdfbf9 100644
--- a/src/ballistica/python/class/python_class_vec3.cc
+++ b/src/ballistica/python/class/python_class_vec3.cc
@@ -2,9 +2,6 @@
#include "ballistica/python/class/python_class_vec3.h"
-#include
-
-#include "ballistica/ballistica.h"
#include "ballistica/python/python.h"
// FIXME:
diff --git a/src/ballistica/python/class/python_class_widget.cc b/src/ballistica/python/class/python_class_widget.cc
index f7e18620..92c60bc1 100644
--- a/src/ballistica/python/class/python_class_widget.cc
+++ b/src/ballistica/python/class/python_class_widget.cc
@@ -2,13 +2,10 @@
#include "ballistica/python/class/python_class_widget.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/ui/widget/container_widget.h"
-#include "ballistica/ui/widget/widget.h"
namespace ballistica {
diff --git a/src/ballistica/python/methods/python_methods_app.cc b/src/ballistica/python/methods/python_methods_app.cc
index d9d73b29..02c58d89 100644
--- a/src/ballistica/python/methods/python_methods_app.cc
+++ b/src/ballistica/python/methods/python_methods_app.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/methods/python_methods_app.h"
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/app/app_globals.h"
#include "ballistica/core/logging.h"
@@ -18,7 +16,6 @@
#include "ballistica/python/class/python_class_session_data.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_context_call_runnable.h"
-#include "ballistica/python/python_sys.h"
#include "ballistica/scene/scene.h"
namespace ballistica {
diff --git a/src/ballistica/python/methods/python_methods_gameplay.cc b/src/ballistica/python/methods/python_methods_gameplay.cc
index dbe519ae..f0a008bc 100644
--- a/src/ballistica/python/methods/python_methods_gameplay.cc
+++ b/src/ballistica/python/methods/python_methods_gameplay.cc
@@ -3,7 +3,6 @@
#include "ballistica/python/methods/python_methods_gameplay.h"
#include
-#include
#include "ballistica/app/app.h"
#include "ballistica/dynamics/bg/bg_dynamics.h"
@@ -14,7 +13,6 @@
#include "ballistica/game/connection/connection_to_client.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/game/host_activity.h"
-#include "ballistica/game/player_spec.h"
#include "ballistica/generic/json.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/input/device/input_device.h"
diff --git a/src/ballistica/python/methods/python_methods_graphics.cc b/src/ballistica/python/methods/python_methods_graphics.cc
index f094c708..debe7a4c 100644
--- a/src/ballistica/python/methods/python_methods_graphics.cc
+++ b/src/ballistica/python/methods/python_methods_graphics.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/methods/python_methods_graphics.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/text/text_graphics.h"
diff --git a/src/ballistica/python/methods/python_methods_input.cc b/src/ballistica/python/methods/python_methods_input.cc
index c8648f94..18440a43 100644
--- a/src/ballistica/python/methods/python_methods_input.cc
+++ b/src/ballistica/python/methods/python_methods_input.cc
@@ -2,9 +2,6 @@
#include "ballistica/python/methods/python_methods_input.h"
-#include
-#include
-
#include "ballistica/app/app_globals.h"
#include "ballistica/game/game.h"
#include "ballistica/input/device/input_device.h"
diff --git a/src/ballistica/python/methods/python_methods_media.cc b/src/ballistica/python/methods/python_methods_media.cc
index db33b1c6..5c438ba0 100644
--- a/src/ballistica/python/methods/python_methods_media.cc
+++ b/src/ballistica/python/methods/python_methods_media.cc
@@ -8,7 +8,6 @@
#endif
#include "ballistica/game/host_activity.h"
-#include "ballistica/game/session/host_session.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/media/component/collide_model.h"
#include "ballistica/media/component/data.h"
diff --git a/src/ballistica/python/methods/python_methods_system.cc b/src/ballistica/python/methods/python_methods_system.cc
index 6d470294..2977e36e 100644
--- a/src/ballistica/python/methods/python_methods_system.cc
+++ b/src/ballistica/python/methods/python_methods_system.cc
@@ -2,9 +2,7 @@
#include "ballistica/python/methods/python_methods_system.h"
-#include
#include
-#include
#include
#include "ballistica/app/app.h"
@@ -19,7 +17,6 @@
#include "ballistica/input/input.h"
#include "ballistica/media/component/texture.h"
#include "ballistica/media/media.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_context_call_runnable.h"
#include "ballistica/python/python_sys.h"
diff --git a/src/ballistica/python/methods/python_methods_ui.cc b/src/ballistica/python/methods/python_methods_ui.cc
index 88c1062c..9308c4ca 100644
--- a/src/ballistica/python/methods/python_methods_ui.cc
+++ b/src/ballistica/python/methods/python_methods_ui.cc
@@ -2,9 +2,6 @@
#include "ballistica/python/methods/python_methods_ui.h"
-#include
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/app/app_globals.h"
#include "ballistica/game/account.h"
@@ -18,13 +15,11 @@
#include "ballistica/ui/widget/button_widget.h"
#include "ballistica/ui/widget/check_box_widget.h"
#include "ballistica/ui/widget/column_widget.h"
-#include "ballistica/ui/widget/container_widget.h"
#include "ballistica/ui/widget/h_scroll_widget.h"
#include "ballistica/ui/widget/image_widget.h"
#include "ballistica/ui/widget/root_widget.h"
#include "ballistica/ui/widget/row_widget.h"
#include "ballistica/ui/widget/scroll_widget.h"
-#include "ballistica/ui/widget/text_widget.h"
#if !BA_HEADLESS_BUILD
extern "C" void SDL_ericf_focus();
diff --git a/src/ballistica/python/python.cc b/src/ballistica/python/python.cc
index 0d794975..30477afe 100644
--- a/src/ballistica/python/python.cc
+++ b/src/ballistica/python/python.cc
@@ -2,11 +2,6 @@
#include "ballistica/python/python.h"
-#include
-#include
-#include
-#include
-
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/audio.h"
#include "ballistica/dynamics/material/material.h"
@@ -21,6 +16,7 @@
#include "ballistica/input/device/keyboard_input.h"
#include "ballistica/media/component/collide_model.h"
#include "ballistica/media/component/model.h"
+#include "ballistica/media/component/sound.h"
#include "ballistica/media/component/texture.h"
#include "ballistica/python/class/python_class_activity_data.h"
#include "ballistica/python/class/python_class_collide_model.h"
@@ -48,7 +44,6 @@
#include "ballistica/python/python_command.h"
#include "ballistica/python/python_context_call_runnable.h"
#include "ballistica/scene/node/node_attribute.h"
-#include "ballistica/scene/scene.h"
#include "ballistica/ui/ui.h"
#include "ballistica/ui/widget/text_widget.h"
diff --git a/src/ballistica/python/python_command.cc b/src/ballistica/python/python_command.cc
index a9f70b36..a84f8536 100644
--- a/src/ballistica/python/python_command.cc
+++ b/src/ballistica/python/python_command.cc
@@ -2,8 +2,6 @@
#include "ballistica/python/python_command.h"
-#include
-
#include "ballistica/python/python.h"
#include "ballistica/python/python_sys.h"
diff --git a/src/ballistica/scene/node/anim_curve_node.cc b/src/ballistica/scene/node/anim_curve_node.cc
index fb311f87..7531eb53 100644
--- a/src/ballistica/scene/node/anim_curve_node.cc
+++ b/src/ballistica/scene/node/anim_curve_node.cc
@@ -2,10 +2,6 @@
#include "ballistica/scene/node/anim_curve_node.h"
-#include
-#include
-#include
-
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/combine_node.cc b/src/ballistica/scene/node/combine_node.cc
index 9109a80b..e4948921 100644
--- a/src/ballistica/scene/node/combine_node.cc
+++ b/src/ballistica/scene/node/combine_node.cc
@@ -2,9 +2,6 @@
#include "ballistica/scene/node/combine_node.h"
-#include
-#include
-
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/explosion_node.cc b/src/ballistica/scene/node/explosion_node.cc
index 055ffbf2..60fbcb38 100644
--- a/src/ballistica/scene/node/explosion_node.cc
+++ b/src/ballistica/scene/node/explosion_node.cc
@@ -2,12 +2,9 @@
#include "ballistica/scene/node/explosion_node.h"
-#include "ballistica/dynamics/dynamics.h"
#include "ballistica/graphics/camera.h"
#include "ballistica/graphics/component/object_component.h"
#include "ballistica/graphics/component/post_process_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/scene/node/flag_node.cc b/src/ballistica/scene/node/flag_node.cc
index d3c39432..20c6b4cd 100644
--- a/src/ballistica/scene/node/flag_node.cc
+++ b/src/ballistica/scene/node/flag_node.cc
@@ -2,8 +2,6 @@
#include "ballistica/scene/node/flag_node.h"
-#include
-
#include "ballistica/dynamics/bg/bg_dynamics_shadow.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/area_of_interest.h"
diff --git a/src/ballistica/scene/node/flash_node.cc b/src/ballistica/scene/node/flash_node.cc
index c07230e2..326b4692 100644
--- a/src/ballistica/scene/node/flash_node.cc
+++ b/src/ballistica/scene/node/flash_node.cc
@@ -2,10 +2,7 @@
#include "ballistica/scene/node/flash_node.h"
-#include
-
#include "ballistica/graphics/component/object_component.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/globals_node.cc b/src/ballistica/scene/node/globals_node.cc
index 6d9e15c5..80a35b9f 100644
--- a/src/ballistica/scene/node/globals_node.cc
+++ b/src/ballistica/scene/node/globals_node.cc
@@ -7,12 +7,16 @@
#include "ballistica/game/host_activity.h"
#include "ballistica/graphics/camera.h"
#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/vr_graphics.h"
#include "ballistica/python/python.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
+// FIXME: should not need this here.
+#if BA_VR_BUILD
+#include "ballistica/graphics/vr_graphics.h"
+#endif
+
namespace ballistica {
class GlobalsNodeType : public NodeType {
@@ -133,37 +137,11 @@ GlobalsNode::~GlobalsNode() {
// values to the global state (since there can be multiple scenes in
// existence, there has to be a single "foreground" globals node in control).
void GlobalsNode::SetAsForeground() {
-#if !BA_HEADLESS_BUILD
- g_bg_dynamics->SetDebrisFriction(debris_friction_);
- g_bg_dynamics->SetDebrisKillHeight(debris_kill_height_);
-#endif
- g_graphics->set_floor_reflection(floor_reflection_);
- g_graphics->camera()->SetMode(camera_mode_);
- g_graphics->camera()->set_vr_offset(Vector3f(vr_camera_offset_));
- g_graphics->camera()->set_happy_thoughts_mode(happy_thoughts_mode_);
- g_graphics->set_shadow_scale(shadow_scale_[0], shadow_scale_[1]);
- g_graphics->camera()->set_area_of_interest_bounds(
- area_of_interest_bounds_[0], area_of_interest_bounds_[1],
- area_of_interest_bounds_[2], area_of_interest_bounds_[3],
- area_of_interest_bounds_[4], area_of_interest_bounds_[5]);
- g_graphics->SetShadowRange(shadow_range_[0], shadow_range_[1],
- shadow_range_[2], shadow_range_[3]);
- g_graphics->set_shadow_offset(Vector3f(shadow_offset_));
- g_graphics->set_shadow_ortho(shadow_ortho_);
- g_graphics->set_tint(Vector3f(tint_));
-
-#if BA_VR_BUILD
- if (IsVRMode()) {
- auto* vrgraphics = VRGraphics::get();
- vrgraphics->set_vr_near_clip(vr_near_clip_);
- vrgraphics->set_vr_overlay_center(Vector3f(vr_overlay_center_));
- vrgraphics->set_vr_overlay_center_enabled(vr_overlay_center_enabled_);
+ if (g_bg_dynamics != nullptr) {
+ g_bg_dynamics->SetDebrisFriction(debris_friction_);
+ g_bg_dynamics->SetDebrisKillHeight(debris_kill_height_);
}
-#endif
-
- g_graphics->set_ambient_color(Vector3f(ambient_color_));
- g_graphics->set_vignette_outer(Vector3f(vignette_outer_));
- g_graphics->set_vignette_inner(Vector3f(vignette_inner_));
+ g_graphics->ApplyGlobals(this);
g_audio->SetSoundPitch(slow_motion_ ? 0.4f : 1.0f);
@@ -191,9 +169,9 @@ auto GlobalsNode::GetStep() -> int64_t { return scene()->stepnum(); }
void GlobalsNode::SetDebrisFriction(float val) {
debris_friction_ = val;
if (IsCurrentGlobals()) {
-#if !BA_HEADLESS_BUILD
- g_bg_dynamics->SetDebrisFriction(debris_friction_);
-#endif // !BA_HEADLESS_BUILD
+ if (g_bg_dynamics != nullptr) {
+ g_bg_dynamics->SetDebrisFriction(debris_friction_);
+ }
}
}
@@ -218,9 +196,9 @@ void GlobalsNode::SetFloorReflection(bool val) {
void GlobalsNode::SetDebrisKillHeight(float val) {
debris_kill_height_ = val;
if (IsCurrentGlobals()) {
-#if !BA_HEADLESS_BUILD
- g_bg_dynamics->SetDebrisKillHeight(debris_kill_height_);
-#endif // !BA_HEADLESS_BUILD
+ if (g_bg_dynamics != nullptr) {
+ g_bg_dynamics->SetDebrisKillHeight(debris_kill_height_);
+ }
}
}
diff --git a/src/ballistica/scene/node/globals_node.h b/src/ballistica/scene/node/globals_node.h
index 4d73a74a..686871a4 100644
--- a/src/ballistica/scene/node/globals_node.h
+++ b/src/ballistica/scene/node/globals_node.h
@@ -96,7 +96,9 @@ class GlobalsNode : public Node {
auto music_count() const -> int { return music_count_; }
void SetMusicCount(int val);
- protected:
+ auto camera_mode() const { return camera_mode_; }
+
+ private:
CameraMode camera_mode_{CameraMode::kFollow};
float vr_near_clip_{4.0f};
float debris_friction_{1.0f};
diff --git a/src/ballistica/scene/node/image_node.cc b/src/ballistica/scene/node/image_node.cc
index 1f302c61..e4667da0 100644
--- a/src/ballistica/scene/node/image_node.cc
+++ b/src/ballistica/scene/node/image_node.cc
@@ -2,13 +2,7 @@
#include "ballistica/scene/node/image_node.h"
-#include
-#include
-
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/renderer.h"
-#include "ballistica/media/component/model.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/scene/node/light_node.cc b/src/ballistica/scene/node/light_node.cc
index cb9e6d86..0baed19e 100644
--- a/src/ballistica/scene/node/light_node.cc
+++ b/src/ballistica/scene/node/light_node.cc
@@ -2,8 +2,6 @@
#include "ballistica/scene/node/light_node.h"
-#include
-
#include "ballistica/dynamics/bg/bg_dynamics_volume_light.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/scene/node/node_attribute.h"
diff --git a/src/ballistica/scene/node/locator_node.cc b/src/ballistica/scene/node/locator_node.cc
index 4eddc655..c3b5bbd9 100644
--- a/src/ballistica/scene/node/locator_node.cc
+++ b/src/ballistica/scene/node/locator_node.cc
@@ -3,7 +3,6 @@
#include "ballistica/scene/node/locator_node.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/math_node.cc b/src/ballistica/scene/node/math_node.cc
index 016eb702..40dbccd0 100644
--- a/src/ballistica/scene/node/math_node.cc
+++ b/src/ballistica/scene/node/math_node.cc
@@ -2,9 +2,6 @@
#include "ballistica/scene/node/math_node.h"
-#include
-#include
-
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/node.cc b/src/ballistica/scene/node/node.cc
index b835d0cc..eb56c743 100644
--- a/src/ballistica/scene/node/node.cc
+++ b/src/ballistica/scene/node/node.cc
@@ -9,7 +9,6 @@
#include "ballistica/python/python_context_call.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_attribute_connection.h"
-#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
namespace ballistica {
diff --git a/src/ballistica/scene/node/node_attribute.cc b/src/ballistica/scene/node/node_attribute.cc
index a8bdd109..6175313d 100644
--- a/src/ballistica/scene/node/node_attribute.cc
+++ b/src/ballistica/scene/node/node_attribute.cc
@@ -2,8 +2,6 @@
#include "ballistica/scene/node/node_attribute.h"
-#include
-
#include "ballistica/scene/node/node.h"
#include "ballistica/scene/node/node_attribute_connection.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/node_attribute_connection.cc b/src/ballistica/scene/node/node_attribute_connection.cc
index c926e1fc..4b27fb32 100644
--- a/src/ballistica/scene/node/node_attribute_connection.cc
+++ b/src/ballistica/scene/node/node_attribute_connection.cc
@@ -2,8 +2,6 @@
#include "ballistica/scene/node/node_attribute_connection.h"
-#include
-
#include "ballistica/scene/node/node.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/null_node.cc b/src/ballistica/scene/node/null_node.cc
index e96f8cbd..10bb727e 100644
--- a/src/ballistica/scene/node/null_node.cc
+++ b/src/ballistica/scene/node/null_node.cc
@@ -2,7 +2,6 @@
#include "ballistica/scene/node/null_node.h"
-#include "ballistica/game/game.h"
#include "ballistica/scene/node/node_type.h"
namespace ballistica {
diff --git a/src/ballistica/scene/node/player_node.cc b/src/ballistica/scene/node/player_node.cc
index 1d146908..cf8f1ba4 100644
--- a/src/ballistica/scene/node/player_node.cc
+++ b/src/ballistica/scene/node/player_node.cc
@@ -2,8 +2,6 @@
#include "ballistica/scene/node/player_node.h"
-#include
-
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/scene/node/prop_node.cc b/src/ballistica/scene/node/prop_node.cc
index ef7f6419..be16c83d 100644
--- a/src/ballistica/scene/node/prop_node.cc
+++ b/src/ballistica/scene/node/prop_node.cc
@@ -2,18 +2,13 @@
#include "ballistica/scene/node/prop_node.h"
-#include
-
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/area_of_interest.h"
#include "ballistica/graphics/camera.h"
#include "ballistica/graphics/component/object_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/scene/scene.h"
-#include "ode/ode_joint.h"
namespace ballistica {
diff --git a/src/ballistica/scene/node/scorch_node.cc b/src/ballistica/scene/node/scorch_node.cc
index 608fccd6..2c468287 100644
--- a/src/ballistica/scene/node/scorch_node.cc
+++ b/src/ballistica/scene/node/scorch_node.cc
@@ -2,11 +2,8 @@
#include "ballistica/scene/node/scorch_node.h"
-#include
-
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
diff --git a/src/ballistica/scene/node/shield_node.cc b/src/ballistica/scene/node/shield_node.cc
index 0a4d0f06..c52f859d 100644
--- a/src/ballistica/scene/node/shield_node.cc
+++ b/src/ballistica/scene/node/shield_node.cc
@@ -2,17 +2,12 @@
#include "ballistica/scene/node/shield_node.h"
-#include
-#include
-
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/camera.h"
#include "ballistica/graphics/component/object_component.h"
#include "ballistica/graphics/component/post_process_component.h"
#include "ballistica/graphics/component/shield_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/renderer.h"
-#include "ballistica/math/matrix44f.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/scene/node/sound_node.cc b/src/ballistica/scene/node/sound_node.cc
index 7169cf4c..75cc6e8e 100644
--- a/src/ballistica/scene/node/sound_node.cc
+++ b/src/ballistica/scene/node/sound_node.cc
@@ -2,8 +2,6 @@
#include "ballistica/scene/node/sound_node.h"
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_source.h"
#include "ballistica/media/component/sound.h"
diff --git a/src/ballistica/scene/node/spaz_node.cc b/src/ballistica/scene/node/spaz_node.cc
index 63a5195d..3337c312 100644
--- a/src/ballistica/scene/node/spaz_node.cc
+++ b/src/ballistica/scene/node/spaz_node.cc
@@ -2,35 +2,26 @@
#include "ballistica/scene/node/spaz_node.h"
-#include
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_source.h"
#include "ballistica/dynamics/bg/bg_dynamics_shadow.h"
#include "ballistica/dynamics/collision.h"
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/material/material_action.h"
-#include "ballistica/game/player.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/area_of_interest.h"
#include "ballistica/graphics/camera.h"
#include "ballistica/graphics/component/object_component.h"
#include "ballistica/graphics/component/post_process_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/text/text_graphics.h"
#include "ballistica/input/device/input_device.h"
-#include "ballistica/math/matrix44f.h"
-#include "ballistica/media/component/model.h"
#include "ballistica/media/component/sound.h"
#include "ballistica/python/python.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
-#include "ballistica/scene/scene.h"
#include "ode/ode_collision_util.h"
-#include "ode/ode_joint.h"
namespace ballistica {
diff --git a/src/ballistica/scene/node/terrain_node.cc b/src/ballistica/scene/node/terrain_node.cc
index e4c29c57..338975f6 100644
--- a/src/ballistica/scene/node/terrain_node.cc
+++ b/src/ballistica/scene/node/terrain_node.cc
@@ -5,9 +5,7 @@
#include "ballistica/dynamics/bg/bg_dynamics.h"
#include "ballistica/dynamics/material/material.h"
#include "ballistica/graphics/component/object_component.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/media/component/collide_model.h"
-#include "ballistica/media/component/model.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/scene.h"
diff --git a/src/ballistica/scene/node/text_node.cc b/src/ballistica/scene/node/text_node.cc
index 964d6c9e..2fa616d4 100644
--- a/src/ballistica/scene/node/text_node.cc
+++ b/src/ballistica/scene/node/text_node.cc
@@ -2,11 +2,8 @@
#include "ballistica/scene/node/text_node.h"
-#include
-
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/text/text_graphics.h"
#include "ballistica/python/python.h"
#include "ballistica/scene/node/node_attribute.h"
diff --git a/src/ballistica/scene/node/time_display_node.cc b/src/ballistica/scene/node/time_display_node.cc
index 0c8d768f..2448f578 100644
--- a/src/ballistica/scene/node/time_display_node.cc
+++ b/src/ballistica/scene/node/time_display_node.cc
@@ -2,9 +2,6 @@
#include "ballistica/scene/node/time_display_node.h"
-#include
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/generic/utils.h"
#include "ballistica/scene/node/node_attribute.h"
diff --git a/src/ballistica/scene/scene.cc b/src/ballistica/scene/scene.cc
index d5a00989..15476a03 100644
--- a/src/ballistica/scene/scene.cc
+++ b/src/ballistica/scene/scene.cc
@@ -2,9 +2,6 @@
#include "ballistica/scene/scene.h"
-#include
-#include
-
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/audio.h"
#include "ballistica/dynamics/bg/bg_dynamics.h"
@@ -29,12 +26,9 @@
#include "ballistica/scene/node/light_node.h"
#include "ballistica/scene/node/locator_node.h"
#include "ballistica/scene/node/math_node.h"
-#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_attribute_connection.h"
-#include "ballistica/scene/node/node_type.h"
#include "ballistica/scene/node/null_node.h"
#include "ballistica/scene/node/player_node.h"
-#include "ballistica/scene/node/prop_node.h"
#include "ballistica/scene/node/region_node.h"
#include "ballistica/scene/node/scorch_node.h"
#include "ballistica/scene/node/session_globals_node.h"
diff --git a/src/ballistica/ui/console.cc b/src/ballistica/ui/console.cc
index 15422ac4..95320049 100644
--- a/src/ballistica/ui/console.cc
+++ b/src/ballistica/ui/console.cc
@@ -2,8 +2,6 @@
#include "ballistica/ui/console.h"
-#include
-
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/audio.h"
#include "ballistica/game/game.h"
diff --git a/src/ballistica/ui/root_ui.cc b/src/ballistica/ui/root_ui.cc
index b02e0204..01640ae1 100644
--- a/src/ballistica/ui/root_ui.cc
+++ b/src/ballistica/ui/root_ui.cc
@@ -2,14 +2,10 @@
#include "ballistica/ui/root_ui.h"
-#include
-#include
-
#include "ballistica/game/connection/connection_set.h"
#include "ballistica/game/game.h"
#include "ballistica/game/session/host_session.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
#include "ballistica/input/device/keyboard_input.h"
#include "ballistica/input/device/touch_input.h"
#include "ballistica/input/input.h"
diff --git a/src/ballistica/ui/ui.cc b/src/ballistica/ui/ui.cc
index d30de0fa..6917e5a9 100644
--- a/src/ballistica/ui/ui.cc
+++ b/src/ballistica/ui/ui.cc
@@ -4,15 +4,11 @@
#include "ballistica/app/app_globals.h"
#include "ballistica/audio/audio.h"
-#include "ballistica/generic/lambda_runnable.h"
#include "ballistica/graphics/component/empty_component.h"
-#include "ballistica/graphics/graphics.h"
#include "ballistica/input/device/input_device.h"
#include "ballistica/input/input.h"
#include "ballistica/media/component/data.h"
-#include "ballistica/media/component/model.h"
#include "ballistica/media/component/sound.h"
-#include "ballistica/media/component/texture.h"
#include "ballistica/python/python.h"
#include "ballistica/scene/scene.h"
#include "ballistica/ui/root_ui.h"
@@ -448,6 +444,10 @@ auto UI::Draw(FrameDef* frame_def) -> void {
}
}
-void UI::DrawExtras(FrameDef* frame_def) { root_ui_->Draw(frame_def); }
+// void UI::DrawExtras(FrameDef* frame_def) {
+// assert(frame_def != nullptr);
+// assert(root_ui_ != nullptr);
+// root_ui_->Draw(frame_def);
+// }
} // namespace ballistica
diff --git a/src/ballistica/ui/ui.h b/src/ballistica/ui/ui.h
index 1c32bbab..697cbb01 100644
--- a/src/ballistica/ui/ui.h
+++ b/src/ballistica/ui/ui.h
@@ -84,7 +84,7 @@ class UI : public ContextTarget {
// if a joystick of some form is present.
auto ShouldShowButtonShortcuts() const -> bool;
- void DrawExtras(FrameDef* frame_def);
+ // void DrawExtras(FrameDef* frame_def);
// Used to ensure widgets are not created or destroyed at certain times
// (while traversing widget hierarchy, etc).
diff --git a/src/ballistica/ui/widget/button_widget.cc b/src/ballistica/ui/widget/button_widget.cc
index bc5bd975..5ed3e2a7 100644
--- a/src/ballistica/ui/widget/button_widget.cc
+++ b/src/ballistica/ui/widget/button_widget.cc
@@ -2,9 +2,6 @@
#include "ballistica/ui/widget/button_widget.h"
-#include
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/generic/real_timer.h"
#include "ballistica/generic/utils.h"
@@ -12,7 +9,6 @@
#include "ballistica/graphics/component/simple_component.h"
#include "ballistica/input/device/input_device.h"
#include "ballistica/input/input.h"
-#include "ballistica/media/component/model.h"
#include "ballistica/python/python_context_call.h"
#include "ballistica/ui/ui.h"
@@ -171,7 +167,7 @@ void ButtonWidget::Draw(RenderPass* pass, bool draw_transparent) {
}
// Simple transition.
- float transition = (birth_time_ + transition_delay_) - current_time;
+ millisecs_t transition = (birth_time_ + transition_delay_) - current_time;
if (transition > 0) {
extra_offs_x -= transition * 4.0f;
}
diff --git a/src/ballistica/ui/widget/button_widget.h b/src/ballistica/ui/widget/button_widget.h
index ba170ee7..50981fce 100644
--- a/src/ballistica/ui/widget/button_widget.h
+++ b/src/ballistica/ui/widget/button_widget.h
@@ -68,7 +68,7 @@ class ButtonWidget : public Widget {
void set_enable_sound(bool enable) { sound_enabled_ = enable; }
void SetModelTransparent(Model* val);
void SetModelOpaque(Model* val);
- void set_transition_delay(float val) { transition_delay_ = val; }
+ void set_transition_delay(millisecs_t val) { transition_delay_ = val; }
void HandleRealTimerExpired(RealTimer* t);
void set_extra_touch_border_scale(float scale) {
extra_touch_border_scale_ = scale;
@@ -118,22 +118,22 @@ class ButtonWidget : public Widget {
Object::Ref mask_texture_;
Object::Ref model_transparent_;
Object::Ref model_opaque_;
- float icon_scale_ = 1.0f;
- millisecs_t last_activate_time_ = 0;
- millisecs_t birth_time_ = 0;
- float transition_delay_ = 0.0f;
- float opacity_ = 1.0f;
- float text_flatness_ = 0.5f;
- float text_color_r_ = 0.75f;
- float text_color_g_ = 1.0f;
- float text_color_b_ = 0.7f;
- float text_color_a_ = 1.0f;
- float tint_color_red_ = 1.0f;
- float tint_color_green_ = 1.0f;
- float tint_color_blue_ = 1.0f;
- float tint2_color_red_ = 1.0f;
- float tint2_color_green_ = 1.0f;
- float tint2_color_blue_ = 1.0f;
+ float icon_scale_{1.0f};
+ millisecs_t last_activate_time_{};
+ millisecs_t birth_time_{};
+ millisecs_t transition_delay_{};
+ float opacity_{1.0f};
+ float text_flatness_{0.5f};
+ float text_color_r_{0.75f};
+ float text_color_g_{1.0f};
+ float text_color_b_{0.7f};
+ float text_color_a_{1.0f};
+ float tint_color_red_{1.0f};
+ float tint_color_green_{1.0f};
+ float tint_color_blue_{1.0f};
+ float tint2_color_red_{1.0f};
+ float tint2_color_green_{1.0f};
+ float tint2_color_blue_{1.0f};
// Keep these at the bottom so they're torn down first.
Object::Ref text_;
diff --git a/src/ballistica/ui/widget/check_box_widget.cc b/src/ballistica/ui/widget/check_box_widget.cc
index 988ef58d..bfbe77dc 100644
--- a/src/ballistica/ui/widget/check_box_widget.cc
+++ b/src/ballistica/ui/widget/check_box_widget.cc
@@ -6,8 +6,6 @@
#include "ballistica/game/game.h"
#include "ballistica/graphics/component/empty_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/python/python_context_call.h"
#include "ballistica/python/python_sys.h"
#include "ballistica/ui/ui.h"
diff --git a/src/ballistica/ui/widget/container_widget.cc b/src/ballistica/ui/widget/container_widget.cc
index faa4632f..23659578 100644
--- a/src/ballistica/ui/widget/container_widget.cc
+++ b/src/ballistica/ui/widget/container_widget.cc
@@ -2,13 +2,10 @@
#include "ballistica/ui/widget/container_widget.h"
-#include
-
#include "ballistica/audio/audio.h"
#include "ballistica/game/game.h"
#include "ballistica/graphics/component/empty_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/input/input.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_context_call.h"
@@ -16,7 +13,6 @@
#include "ballistica/ui/widget/button_widget.h"
#include "ballistica/ui/widget/root_widget.h"
#include "ballistica/ui/widget/stack_widget.h"
-#include "ballistica/ui/widget/text_widget.h"
namespace ballistica {
diff --git a/src/ballistica/ui/widget/h_scroll_widget.cc b/src/ballistica/ui/widget/h_scroll_widget.cc
index ab620d1e..d23164db 100644
--- a/src/ballistica/ui/widget/h_scroll_widget.cc
+++ b/src/ballistica/ui/widget/h_scroll_widget.cc
@@ -2,14 +2,9 @@
#include "ballistica/ui/widget/h_scroll_widget.h"
-#include
-
#include "ballistica/generic/real_timer.h"
#include "ballistica/graphics/component/empty_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/renderer.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/ui/ui.h"
namespace ballistica {
diff --git a/src/ballistica/ui/widget/root_widget.cc b/src/ballistica/ui/widget/root_widget.cc
index e3f8698a..2797967a 100644
--- a/src/ballistica/ui/widget/root_widget.cc
+++ b/src/ballistica/ui/widget/root_widget.cc
@@ -2,8 +2,6 @@
#include "ballistica/ui/widget/root_widget.h"
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/game/session/host_session.h"
#include "ballistica/graphics/renderer.h"
@@ -11,7 +9,6 @@
#include "ballistica/python/python.h"
#include "ballistica/ui/ui.h"
#include "ballistica/ui/widget/button_widget.h"
-#include "ballistica/ui/widget/image_widget.h"
#include "ballistica/ui/widget/stack_widget.h"
namespace ballistica {
diff --git a/src/ballistica/ui/widget/row_widget.cc b/src/ballistica/ui/widget/row_widget.cc
index 71926048..870b7b4b 100644
--- a/src/ballistica/ui/widget/row_widget.cc
+++ b/src/ballistica/ui/widget/row_widget.cc
@@ -2,8 +2,6 @@
#include "ballistica/ui/widget/row_widget.h"
-#include
-
#include "ballistica/ui/ui.h"
namespace ballistica {
diff --git a/src/ballistica/ui/widget/scroll_widget.cc b/src/ballistica/ui/widget/scroll_widget.cc
index 58d12c13..d479ac94 100644
--- a/src/ballistica/ui/widget/scroll_widget.cc
+++ b/src/ballistica/ui/widget/scroll_widget.cc
@@ -2,14 +2,9 @@
#include "ballistica/ui/widget/scroll_widget.h"
-#include
-
#include "ballistica/generic/real_timer.h"
#include "ballistica/graphics/component/empty_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/renderer.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/ui/ui.h"
namespace ballistica {
diff --git a/src/ballistica/ui/widget/text_widget.cc b/src/ballistica/ui/widget/text_widget.cc
index a7a27a5a..deb1bda6 100644
--- a/src/ballistica/ui/widget/text_widget.cc
+++ b/src/ballistica/ui/widget/text_widget.cc
@@ -2,21 +2,15 @@
#include "ballistica/ui/widget/text_widget.h"
-#include
-#include
-
#include "ballistica/app/app.h"
#include "ballistica/audio/audio.h"
#include "ballistica/game/game.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/component/empty_component.h"
#include "ballistica/graphics/component/simple_component.h"
-#include "ballistica/graphics/graphics.h"
-#include "ballistica/graphics/renderer.h"
#include "ballistica/graphics/text/text_graphics.h"
#include "ballistica/input/device/keyboard_input.h"
#include "ballistica/input/input.h"
-#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_context_call.h"
#include "ballistica/ui/ui.h"
diff --git a/src/ballistica/ui/widget/widget.cc b/src/ballistica/ui/widget/widget.cc
index ee3869e1..ea5692c2 100644
--- a/src/ballistica/ui/widget/widget.cc
+++ b/src/ballistica/ui/widget/widget.cc
@@ -2,9 +2,6 @@
#include "ballistica/ui/widget/widget.h"
-#include
-#include
-
#include "ballistica/game/game.h"
#include "ballistica/python/class/python_class_widget.h"
#include "ballistica/python/python_context_call.h"
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_cylinder_trimesh.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_cylinder_trimesh.cpp
index 66775d4b..05d19eff 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_cylinder_trimesh.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_cylinder_trimesh.cpp
@@ -942,7 +942,7 @@ int dCollideCylinderTrimesh(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *con
_InitCylinderTrimeshData(cData);
- OBBCollider& Collider = cData.gTrimesh->_OBBCollider;
+ OBBCollider& Collider{cData.gTrimesh->_OBBCollider};
Point cCenter(cData.vCylinderPos[0],cData.vCylinderPos[1],cData.vCylinderPos[2]);
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh.cpp
index 161f3dac..7afef405 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh.cpp
@@ -253,45 +253,49 @@ void dGeomTriMeshDataBuildSimple(dTriMeshDataID g,
(const int*)NULL);
}
+// ERICF TWEAK: These were being allocated statically and thus could crash us
+// if collision processing while we were tearing down. Ideally we should allocate these
+// completely dynamically somewhere but for now at least switching to new() so that
+// they won't get deleted from under us.
// Trimesh
-PlanesCollider dxTriMesh::_PlanesCollider;
-SphereCollider dxTriMesh::_SphereCollider;
+PlanesCollider* dxTriMesh::_PlanesCollider = new PlanesCollider();
+SphereCollider* dxTriMesh::_SphereCollider = new SphereCollider();
//OBBCollider dxTriMesh::_OBBCollider;
-RayCollider dxTriMesh::_RayCollider;
-AABBTreeCollider dxTriMesh::_AABBTreeCollider;
-LSSCollider dxTriMesh::_LSSCollider;
+RayCollider* dxTriMesh::_RayCollider = new RayCollider();
+AABBTreeCollider* dxTriMesh::_AABBTreeCollider = new AABBTreeCollider();
+LSSCollider* dxTriMesh::_LSSCollider = new LSSCollider();
-SphereCache dxTriMesh::defaultSphereCache;
+SphereCache* dxTriMesh::defaultSphereCache = new SphereCache;
//OBBCache dxTriMesh::defaultBoxCache;
-LSSCache dxTriMesh::defaultCCylinderCache;
+LSSCache* dxTriMesh::defaultCCylinderCache = new LSSCache();
-CollisionFaces dxTriMesh::Faces;
+CollisionFaces* dxTriMesh::Faces = new CollisionFaces();
dxTriMesh::dxTriMesh(dSpaceID Space, dTriMeshDataID Data) : dxGeom(Space, 1){
type = dTriMeshClass;
this->Data = Data;
- _RayCollider.SetDestination(&Faces);
+ _RayCollider->SetDestination(Faces);
- _PlanesCollider.SetTemporalCoherence(true);
+ _PlanesCollider->SetTemporalCoherence(true);
- _SphereCollider.SetTemporalCoherence(true);
- _SphereCollider.SetPrimitiveTests(false);
+ _SphereCollider->SetTemporalCoherence(true);
+ _SphereCollider->SetPrimitiveTests(false);
_OBBCollider.SetTemporalCoherence(true);
// no first-contact test (i.e. return full contact info)
- _AABBTreeCollider.SetFirstContact( false );
+ _AABBTreeCollider->SetFirstContact( false );
// temporal coherence only works with "first conact" tests
- _AABBTreeCollider.SetTemporalCoherence(false);
+ _AABBTreeCollider->SetTemporalCoherence(false);
// Perform full BV-BV tests (true) or SAT-lite tests (false)
- _AABBTreeCollider.SetFullBoxBoxTest( true );
+ _AABBTreeCollider->SetFullBoxBoxTest( true );
// Perform full Primitive-BV tests (true) or SAT-lite tests (false)
- _AABBTreeCollider.SetFullPrimBoxTest( true );
- _LSSCollider.SetTemporalCoherence(false);
+ _AABBTreeCollider->SetFullPrimBoxTest( true );
+ _LSSCollider->SetTemporalCoherence(false);
/* TC has speed/space 'issues' that don't make it a clear
win by default on spheres/boxes. */
@@ -303,10 +307,10 @@ dxTriMesh::dxTriMesh(dSpaceID Space, dTriMeshDataID Data) : dxGeom(Space, 1){
this->forceNormalMode = false;
const char* msg;
- if ((msg =_AABBTreeCollider.ValidateSettings()))
+ if ((msg =_AABBTreeCollider->ValidateSettings()))
dDebug (d_ERR_UASSERT, msg, " (%s:%d)", __FILE__,__LINE__);
- _LSSCollider.SetPrimitiveTests(false);
- _LSSCollider.SetFirstContact(false);
+ _LSSCollider->SetPrimitiveTests(false);
+ _LSSCollider->SetFirstContact(false);
}
dxTriMesh::~dxTriMesh(){
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ccylinder.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ccylinder.cpp
index 8d99bff9..7c1e756e 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ccylinder.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ccylinder.cpp
@@ -913,7 +913,7 @@ int dCollideCCTL(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int s
vNormal[2] = REAL(0.0);
// Will it better to use LSS here? -> confirm Pierre.
- OBBCollider& Collider = TriMesh->_OBBCollider;
+ OBBCollider& Collider{TriMesh->_OBBCollider};
Point cCenter((float) vCapsulePosition[0],(float) vCapsulePosition[1],(float) vCapsulePosition[2]);
Point cExtents((float) vCapsuleRadius,(float) vCapsuleRadius,(float) fCapsuleSize/2);
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_internal.h b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_internal.h
index ba0ee380..dace9165 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_internal.h
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_internal.h
@@ -81,8 +81,8 @@ struct dxTriMesh : public dxGeom{
// Colliders
- static PlanesCollider _PlanesCollider;
- static SphereCollider _SphereCollider;
+ static PlanesCollider* _PlanesCollider;
+ static SphereCollider* _SphereCollider;
// ericf change.. keep one of these per mesh now for multithreading
@@ -91,19 +91,19 @@ struct dxTriMesh : public dxGeom{
OBBCollider _OBBCollider;
- static RayCollider _RayCollider;
- static AABBTreeCollider _AABBTreeCollider;
- static LSSCollider _LSSCollider;
+ static RayCollider* _RayCollider;
+ static AABBTreeCollider* _AABBTreeCollider;
+ static LSSCollider* _LSSCollider;
// Some constants
- static CollisionFaces Faces;
+ static CollisionFaces* Faces;
// Temporal coherence
struct SphereTC : public SphereCache{
dxGeom* Geom;
};
dArray SphereTCCache;
- static SphereCache defaultSphereCache;
+ static SphereCache* defaultSphereCache;
struct BoxTC : public OBBCache{
dxGeom* Geom;
@@ -119,7 +119,7 @@ struct dxTriMesh : public dxGeom{
dxGeom* Geom;
};
dArray CCylinderTCCache;
- static LSSCache defaultCCylinderCache;
+ static LSSCache* defaultCCylinderCache;
bool doSphereTC;
bool doBoxTC;
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_plane.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_plane.cpp
index 5ff9a9d4..5dc5584a 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_plane.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_plane.cpp
@@ -42,7 +42,7 @@ int dCollideTPL(dxGeom* gmesh, dxGeom* gplane, int Flags, dContactGeom* Contacts
if(!pTriMeshBody)
return ret;
- PlanesCollider &planeCollider = pTriMesh->_PlanesCollider;
+ PlanesCollider &planeCollider{*pTriMesh->_PlanesCollider};
dGeomPlaneGetParams(gplane, planeEq);
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ray.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ray.cpp
index d539c944..373e2da2 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ray.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_ray.cpp
@@ -45,7 +45,7 @@ int dCollideRTL(dxGeom* g1, dxGeom* RayGeom, int Flags, dContactGeom* Contacts,
const dVector3& TLPosition = *(const dVector3*)dGeomGetPosition(TriMesh);
const dMatrix3& TLRotation = *(const dMatrix3*)dGeomGetRotation(TriMesh);
- RayCollider& Collider = TriMesh->_RayCollider;
+ RayCollider& Collider{*TriMesh->_RayCollider};
dReal Length = dGeomRayGetLength(RayGeom);
@@ -74,14 +74,14 @@ int dCollideRTL(dxGeom* g1, dxGeom* RayGeom, int Flags, dContactGeom* Contacts,
Matrix4x4 amatrix;
int TriCount = 0;
if (Collider.Collide(WorldRay, TriMesh->Data->BVTree, &MakeMatrix(TLPosition, TLRotation, amatrix))) {
- TriCount = TriMesh->Faces.GetNbFaces();
+ TriCount = TriMesh->Faces->GetNbFaces();
}
if (TriCount == 0) {
return 0;
}
- const CollisionFace* Faces = TriMesh->Faces.GetFaces();
+ const CollisionFace* Faces = TriMesh->Faces->GetFaces();
int OutTriCount = 0;
for (int i = 0; i < TriCount; i++) {
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_sphere.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_sphere.cpp
index ed2bb560..681d5a09 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_sphere.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_sphere.cpp
@@ -281,7 +281,7 @@ int dCollideSTL(dxGeom* g1, dxGeom* SphereGeom, int Flags, dContactGeom* Contact
const dVector3& TLPosition = *(const dVector3*)dGeomGetPosition(TriMesh);
const dMatrix3& TLRotation = *(const dMatrix3*)dGeomGetRotation(TriMesh);
- SphereCollider& Collider = TriMesh->_SphereCollider;
+ SphereCollider& Collider{*TriMesh->_SphereCollider};
const dVector3& Position = *(const dVector3*)dGeomGetPosition(SphereGeom);
dReal Radius = dGeomSphereGetRadius(SphereGeom);
@@ -319,7 +319,7 @@ int dCollideSTL(dxGeom* g1, dxGeom* SphereGeom, int Flags, dContactGeom* Contact
}
else {
Collider.SetTemporalCoherence(false);
- Collider.Collide(dxTriMesh::defaultSphereCache, Sphere, TriMesh->Data->BVTree, null,
+ Collider.Collide(*dxTriMesh::defaultSphereCache, Sphere, TriMesh->Data->BVTree, null,
&MakeMatrix(TLPosition, TLRotation, amatrix));
}
diff --git a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_trimesh.cpp b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_trimesh.cpp
index 581baea2..69d63e7d 100644
--- a/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_trimesh.cpp
+++ b/src/external/open_dynamics_engine-ef/ode/ode_collision_trimesh_trimesh.cpp
@@ -169,7 +169,7 @@ dCollideTTL(dxGeom* g1, dxGeom* g2, int Flags, dContactGeom* Contacts, int Strid
// TLRotation2 = column-major order
const dMatrix3& TLRotation2 = *(const dMatrix3*) dGeomGetRotation(TriMesh2);
- AABBTreeCollider& Collider = TriMesh1->_AABBTreeCollider;
+ AABBTreeCollider& Collider{*TriMesh1->_AABBTreeCollider};
static BVTCache ColCache;
ColCache.Model0 = &TriMesh1->Data->BVTree;
diff --git a/tools/efrotools/code.py b/tools/efrotools/code.py
index ce0c1339..c0271414 100644
--- a/tools/efrotools/code.py
+++ b/tools/efrotools/code.py
@@ -64,8 +64,7 @@ def format_clang_format(projroot: Path, full: bool) -> None:
def check_cpplint(projroot: Path, full: bool) -> None:
"""Run cpplint on all our applicable code."""
- # pylint: disable=too-many-locals, too-many-statements
- import tempfile
+ # pylint: disable=too-many-locals
from concurrent.futures import ThreadPoolExecutor
from multiprocessing import cpu_count
from efrotools import getconfig, PYVER
@@ -100,62 +99,26 @@ def check_cpplint(projroot: Path, full: bool) -> None:
print(f'{Clr.BLU}CppLint checking'
f' {len(dirtyfiles)} file(s)...{Clr.RST}')
- # We want to do a few custom modifications to the cpplint module...
- try:
- import cpplint as cpplintmodule
- except Exception as exc:
- raise CleanError('Unable to import cpplint.') from exc
- with open(cpplintmodule.__file__) as infile:
- codelines = infile.read().splitlines()
- cheadersline = codelines.index('_C_HEADERS = frozenset([')
-
- # Extra headers we consider as valid C system headers.
- c_headers = [
- 'malloc.h', 'tchar.h', 'jni.h', 'android/log.h', 'EGL/egl.h',
- 'libgen.h', 'linux/netlink.h', 'linux/rtnetlink.h', 'android/bitmap.h',
- 'android/log.h', 'uuid/uuid.h', 'cxxabi.h', 'direct.h', 'shellapi.h',
- 'rpc.h', 'io.h'
+ disabled_filters: List[str] = [
+ 'build/include_what_you_use',
+ 'build/c++11',
+ 'readability/nolint',
+ 'legal/copyright',
]
- codelines.insert(cheadersline + 1, ''.join(f"'{h}'," for h in c_headers))
-
- # Skip unapproved C++ headers check (it flags , , etc.)
- headercheckline = codelines.index(
- " if include and include.group(1) in ('cfenv',")
- codelines[headercheckline] = (
- " if False and include and include.group(1) in ('cfenv',")
-
- # Skip copyright line check (our public repo code is MIT licensed
- # so not crucial to keep track of who wrote exactly what)
- copyrightline = codelines.index(
- ' """Logs an error if no Copyright'
- ' message appears at the top of the file."""')
- codelines[copyrightline] = ' return'
-
- # Don't complain about unknown NOLINT categories.
- # (we use them for clang-tidy)
- unknownlintline = codelines.index(
- ' elif category not in _LEGACY_ERROR_CATEGORIES:')
- codelines[unknownlintline] = ' elif False:'
+ filterstr = ','.join(f'-{x}' for x in disabled_filters)
def lint_file(filename: str) -> None:
- result = subprocess.call(
- [f'python{PYVER}', '-m', 'cpplint', '--root=src', filename],
- env=env)
+ result = subprocess.call([
+ f'python{PYVER}', '-m', 'cpplint', '--root=src',
+ f'--filter={filterstr}', filename
+ ])
if result != 0:
raise CleanError(
f'{Clr.RED}Cpplint failed for {filename}.{Clr.RST}')
- with tempfile.TemporaryDirectory() as tmpdir:
-
- # Write our replacement module, make it discoverable, then run.
- with open(tmpdir + '/cpplint.py', 'w') as outfile:
- outfile.write('\n'.join(codelines))
- env = os.environ.copy()
- env['PYTHONPATH'] = tmpdir
-
- with ThreadPoolExecutor(max_workers=cpu_count()) as executor:
- # Converting this to a list will propagate any errors.
- list(executor.map(lint_file, dirtyfiles))
+ with ThreadPoolExecutor(max_workers=cpu_count()) as executor:
+ # Converting this to a list will propagate any errors.
+ list(executor.map(lint_file, dirtyfiles))
if dirtyfiles:
cache.mark_clean(filenames)