renamed media to assets in c++ layer

This commit is contained in:
Eric 2022-09-10 14:07:36 -07:00
parent 1cac234fc5
commit 7231ff2cfb
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
129 changed files with 1215 additions and 1207 deletions

View File

@ -3995,26 +3995,26 @@
"assets/src/ba_data/python/ba/_generated/__init__.py": "https://files.ballistica.net/cache/ba1/ee/e8/cad05aa531c7faf7ff7b96db7f6e",
"assets/src/ba_data/python/ba/_generated/enums.py": "https://files.ballistica.net/cache/ba1/b2/e5/0ee0561e16257a32830645239f34",
"ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a",
"build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/91/e4/e85f3feee6640ce65027660e5590",
"build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/dd/50/db8d4e087b3fe272e9575b95996b",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e8/2f/1c8653ee8f0bad9cded74ebf5100",
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/2e/86/b9fb1d80caf79d23b785327a0cc7",
"build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/0f/4e/67f2eea7fa848b12994d487893dc",
"build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/b2/c4/d9555b8a060d11e6b1346cd82d12",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/59/41/3aafb5bd7c6dddad37c89f304fb9",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cc/c1/a7cbdc71810ee752746eda33dd31",
"build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/36/67/6a8b809011b4023533712d2df7b6",
"build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/11/8c/172381e8a477cc11ee0e24460901",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/79/ab/05c53d0807929316235d6e7382cd",
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/18/c2/415efdababdd14553c3adbeaaf7b",
"build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/3a/2d/863cc304f4856e34c81093b59db1",
"build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/33/fd/00a992c1d496ff85a99d381c6498",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e4/58/ac07183ee59eedbb78dcf2f0e91f",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cf/cb/91d2181102f6045e4d19cc73a18d",
"build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/ce/f8/3e7a2452dae94b5cd857424e31fa",
"build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/04/f8/46d2bcc4f5d5b7c7d9bcc7b91418",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/3b/10/9c15dbfbca54c1260b146de3029b",
"build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/26/90/d2f4b8212b12508ed222609c7a7d",
"build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/33/fa/2b4dc04a7e94af821486c0baaadd",
"build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/39/c0/0a8c20d90b3bb0b605f56cf57cd6",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9d/9e/36bc9196a661b7ac730309363b25",
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/78/61/3ee51d8c85ac897cb48326059f4f",
"build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/41/24/ea579f7f46ee8764b99aa1f740e6",
"build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/d7/79/db7ba776fe53a432f501cc524f29",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/67/8c/fd54c4640fe9574c819eb93235de",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/d0/23/0ed4f59b045bd996e9e8c3adac25",
"build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/7b/7a/65e4a1a866aa716f339934316888",
"build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/4c/96/40086b7256c6b69500231234816f",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/25/4e/65658e3b1137e29c26e5a250cb7f",
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/a4/d3/9e94f9f4a3f326ab3fb4563605e8",
"build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/70/82/54ac546d3d6404259c025e4697a6",
"build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/8c/71/35e658ed48d1732ac1ace9a651d0",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cb/c1/66f115696b5694b203d2a3e3f3b6",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/76/7e/ef8ca6f4baae2d3540658a43238e",
"build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/e5/01/48f01b3bfb0e11dfa298809751d6",
"build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/4e/35/3e14be7308b3b8a4d7ee00223d02",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/2f/8d/5bf66b9999ac4a0b109ce6a93ee9",
"build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/6f/ba/6814ccb61a86032c381b59092b92",
"build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e0/b3/7ccccfd8721033582cabdfe11f73",
"build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/86/d2/d18cbc017a7d64001f96718cc5ed",
"build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/64/9b/78cdb9eda7b30611774769859caa",
@ -4031,14 +4031,14 @@
"build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c8/d2/5df66f66e26c1beb8a1e2b1f0613",
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7e/57/593e8ceeee37a65972f1fb30d2cd",
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/2f/fc/a2ac394899e6527f8def0cad4d8a",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/20/4e/9afc0e73bb26d63032c3525d9373",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/f2/ab/eac71319d5184a3dd6b2ad74cf92",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/ad/20/97feffa58fcbc8ac2ed2d9892326",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/0a/d8/6e58979b57cf74c0d675508b207f",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/79/c7/cb4590d0e233fa0455f9bd3158b0",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/2a/14/99b6932f7e20e988d67faa4327d9",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/b0/77/b85ef1b5a280aa2426a613e76ec5",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/b9/22/020a23ba4dba0b5871f78622bd67",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/b9/00/54be93a362cac005b111902cf725",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/cf/33/0aba47dbe0848b9a0fe65e3fe5ac",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/7f/a5/705f0b9b047d439d7b8805e684a1",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/e1/11/91da47c90faced11f80ce365e6ca",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/f0/47/fec8d08adc467bc46516ce39423a",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/c0/cb/36553e332fb3297e8f632387fdbb",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/a7/96/f19a4cc19386511d732533ead3d3",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/0c/23/5d5da73cd643d4fb344849768bf3",
"src/ballistica/generated/python_embedded/binding.inc": "https://files.ballistica.net/cache/ba1/7d/3e/229a581cb2454ed856f1d8b564a7",
"src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/98/12/571b2160d69d42580e8f31fa6a8d"
}

View File

@ -1,4 +1,4 @@
### 1.7.7 (build 20803, api 7, 2022-09-10)
### 1.7.7 (build 20806, api 7, 2022-09-10)
- Added `ba.app.meta.load_exported_classes()` for loading classes discovered by the meta subsystem cleanly in a background thread.
- Improved logging of missing playlist game types.
- Some ba.Lstr functionality can now be used in background threads.
@ -20,6 +20,8 @@
- There is now a `_bainternal.py` dummy-module alongside the existing `_ba.py` one. Be sure to exclude it from any script collections used by the game (the same as `_ba.py`).
- Added checks to make sure _ba or _bainternal arent used outside of ba. Any 'internal' functionality needed outside of ba should be exposed through ba.internal. _ba and _bainternal are internal implementation details.
- Removed C++ Module class and simplified Thread class. The Module class was an old relic of long ago before C++ had lambdas and its existence was pretty pointless and confusing these days.
- Renamed C++ App to AppFlavor and AppGlobals to App
- Renamed C++ Media to Assets
### 1.7.6 (build 20687, api 7, 2022-08-11)
- Cleaned up da MetaSubsystem code.

View File

@ -1 +1 @@
250920245305497630480226719424525454078
319717366410279141138094934973337011486

View File

@ -38,7 +38,7 @@ def bootstrap() -> None:
# Give a soft warning if we're being used with a different binary
# version than we expect.
expected_build = 20803
expected_build = 20806
running_build: int = env['build_number']
if running_build != expected_build:
print(

View File

@ -210,6 +210,40 @@ add_executable(ballisticacore
${BA_SRC_ROOT}/ballistica/app/app_flavor_vr.h
${BA_SRC_ROOT}/ballistica/app/stress_test.cc
${BA_SRC_ROOT}/ballistica/app/stress_test.h
${BA_SRC_ROOT}/ballistica/assets/assets.cc
${BA_SRC_ROOT}/ballistica/assets/assets.h
${BA_SRC_ROOT}/ballistica/assets/assets_server.cc
${BA_SRC_ROOT}/ballistica/assets/assets_server.h
${BA_SRC_ROOT}/ballistica/assets/component/asset_component.cc
${BA_SRC_ROOT}/ballistica/assets/component/asset_component.h
${BA_SRC_ROOT}/ballistica/assets/component/collide_model.cc
${BA_SRC_ROOT}/ballistica/assets/component/collide_model.h
${BA_SRC_ROOT}/ballistica/assets/component/cube_map_texture.cc
${BA_SRC_ROOT}/ballistica/assets/component/cube_map_texture.h
${BA_SRC_ROOT}/ballistica/assets/component/data.cc
${BA_SRC_ROOT}/ballistica/assets/component/data.h
${BA_SRC_ROOT}/ballistica/assets/component/model.cc
${BA_SRC_ROOT}/ballistica/assets/component/model.h
${BA_SRC_ROOT}/ballistica/assets/component/sound.cc
${BA_SRC_ROOT}/ballistica/assets/component/sound.h
${BA_SRC_ROOT}/ballistica/assets/component/texture.cc
${BA_SRC_ROOT}/ballistica/assets/component/texture.h
${BA_SRC_ROOT}/ballistica/assets/data/asset_component_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/asset_component_data.h
${BA_SRC_ROOT}/ballistica/assets/data/collide_model_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/collide_model_data.h
${BA_SRC_ROOT}/ballistica/assets/data/data_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/data_data.h
${BA_SRC_ROOT}/ballistica/assets/data/model_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/model_data.h
${BA_SRC_ROOT}/ballistica/assets/data/model_renderer_data.h
${BA_SRC_ROOT}/ballistica/assets/data/sound_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/sound_data.h
${BA_SRC_ROOT}/ballistica/assets/data/texture_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/texture_data.h
${BA_SRC_ROOT}/ballistica/assets/data/texture_preload_data.cc
${BA_SRC_ROOT}/ballistica/assets/data/texture_preload_data.h
${BA_SRC_ROOT}/ballistica/assets/data/texture_renderer_data.h
${BA_SRC_ROOT}/ballistica/audio/al_sys.cc
${BA_SRC_ROOT}/ballistica/audio/al_sys.h
${BA_SRC_ROOT}/ballistica/audio/audio.cc
@ -466,40 +500,6 @@ add_executable(ballisticacore
${BA_SRC_ROOT}/ballistica/math/vector3f.cc
${BA_SRC_ROOT}/ballistica/math/vector3f.h
${BA_SRC_ROOT}/ballistica/math/vector4f.h
${BA_SRC_ROOT}/ballistica/media/component/collide_model.cc
${BA_SRC_ROOT}/ballistica/media/component/collide_model.h
${BA_SRC_ROOT}/ballistica/media/component/cube_map_texture.cc
${BA_SRC_ROOT}/ballistica/media/component/cube_map_texture.h
${BA_SRC_ROOT}/ballistica/media/component/data.cc
${BA_SRC_ROOT}/ballistica/media/component/data.h
${BA_SRC_ROOT}/ballistica/media/component/media_component.cc
${BA_SRC_ROOT}/ballistica/media/component/media_component.h
${BA_SRC_ROOT}/ballistica/media/component/model.cc
${BA_SRC_ROOT}/ballistica/media/component/model.h
${BA_SRC_ROOT}/ballistica/media/component/sound.cc
${BA_SRC_ROOT}/ballistica/media/component/sound.h
${BA_SRC_ROOT}/ballistica/media/component/texture.cc
${BA_SRC_ROOT}/ballistica/media/component/texture.h
${BA_SRC_ROOT}/ballistica/media/data/collide_model_data.cc
${BA_SRC_ROOT}/ballistica/media/data/collide_model_data.h
${BA_SRC_ROOT}/ballistica/media/data/data_data.cc
${BA_SRC_ROOT}/ballistica/media/data/data_data.h
${BA_SRC_ROOT}/ballistica/media/data/media_component_data.cc
${BA_SRC_ROOT}/ballistica/media/data/media_component_data.h
${BA_SRC_ROOT}/ballistica/media/data/model_data.cc
${BA_SRC_ROOT}/ballistica/media/data/model_data.h
${BA_SRC_ROOT}/ballistica/media/data/model_renderer_data.h
${BA_SRC_ROOT}/ballistica/media/data/sound_data.cc
${BA_SRC_ROOT}/ballistica/media/data/sound_data.h
${BA_SRC_ROOT}/ballistica/media/data/texture_data.cc
${BA_SRC_ROOT}/ballistica/media/data/texture_data.h
${BA_SRC_ROOT}/ballistica/media/data/texture_preload_data.cc
${BA_SRC_ROOT}/ballistica/media/data/texture_preload_data.h
${BA_SRC_ROOT}/ballistica/media/data/texture_renderer_data.h
${BA_SRC_ROOT}/ballistica/media/media.cc
${BA_SRC_ROOT}/ballistica/media/media.h
${BA_SRC_ROOT}/ballistica/media/media_server.cc
${BA_SRC_ROOT}/ballistica/media/media_server.h
${BA_SRC_ROOT}/ballistica/networking/network_reader.cc
${BA_SRC_ROOT}/ballistica/networking/network_reader.h
${BA_SRC_ROOT}/ballistica/networking/network_writer.cc
@ -557,14 +557,14 @@ add_executable(ballisticacore
${BA_SRC_ROOT}/ballistica/python/class/python_class_widget.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_app.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_app.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_assets.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_assets.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_gameplay.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_gameplay.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_graphics.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_graphics.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_input.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_input.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_media.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_media.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_networking.cc
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_networking.h
${BA_SRC_ROOT}/ballistica/python/methods/python_methods_system.cc

View File

@ -201,6 +201,40 @@
<ClInclude Include="..\..\src\ballistica\app\app_flavor_vr.h" />
<ClCompile Include="..\..\src\ballistica\app\stress_test.cc" />
<ClInclude Include="..\..\src\ballistica\app\stress_test.h" />
<ClCompile Include="..\..\src\ballistica\assets\assets.cc" />
<ClInclude Include="..\..\src\ballistica\assets\assets.h" />
<ClCompile Include="..\..\src\ballistica\assets\assets_server.cc" />
<ClInclude Include="..\..\src\ballistica\assets\assets_server.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\asset_component.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\asset_component.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\collide_model.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\collide_model.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\cube_map_texture.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\cube_map_texture.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\data.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\model.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\model.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\sound.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\sound.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\texture.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\texture.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\asset_component_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\asset_component_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\collide_model_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\collide_model_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\data_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\data_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\model_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\model_data.h" />
<ClInclude Include="..\..\src\ballistica\assets\data\model_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\sound_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\sound_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\texture_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\texture_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\texture_preload_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\texture_preload_data.h" />
<ClInclude Include="..\..\src\ballistica\assets\data\texture_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\audio\al_sys.cc" />
<ClInclude Include="..\..\src\ballistica\audio\al_sys.h" />
<ClCompile Include="..\..\src\ballistica\audio\audio.cc" />
@ -457,40 +491,6 @@
<ClCompile Include="..\..\src\ballistica\math\vector3f.cc" />
<ClInclude Include="..\..\src\ballistica\math\vector3f.h" />
<ClInclude Include="..\..\src\ballistica\math\vector4f.h" />
<ClCompile Include="..\..\src\ballistica\media\component\collide_model.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\collide_model.h" />
<ClCompile Include="..\..\src\ballistica\media\component\cube_map_texture.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\cube_map_texture.h" />
<ClCompile Include="..\..\src\ballistica\media\component\data.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\data.h" />
<ClCompile Include="..\..\src\ballistica\media\component\media_component.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\media_component.h" />
<ClCompile Include="..\..\src\ballistica\media\component\model.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\model.h" />
<ClCompile Include="..\..\src\ballistica\media\component\sound.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\sound.h" />
<ClCompile Include="..\..\src\ballistica\media\component\texture.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\texture.h" />
<ClCompile Include="..\..\src\ballistica\media\data\collide_model_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\collide_model_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\data_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\data_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\media_component_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\media_component_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\model_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\model_data.h" />
<ClInclude Include="..\..\src\ballistica\media\data\model_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\sound_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\sound_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\texture_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\texture_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\texture_preload_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\texture_preload_data.h" />
<ClInclude Include="..\..\src\ballistica\media\data\texture_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\media\media.cc" />
<ClInclude Include="..\..\src\ballistica\media\media.h" />
<ClCompile Include="..\..\src\ballistica\media\media_server.cc" />
<ClInclude Include="..\..\src\ballistica\media\media_server.h" />
<ClCompile Include="..\..\src\ballistica\networking\network_reader.cc" />
<ClInclude Include="..\..\src\ballistica\networking\network_reader.h" />
<ClCompile Include="..\..\src\ballistica\networking\network_writer.cc" />
@ -548,14 +548,14 @@
<ClInclude Include="..\..\src\ballistica\python\class\python_class_widget.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_app.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_app.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_assets.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_assets.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_gameplay.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_gameplay.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_graphics.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_graphics.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_input.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_input.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_media.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_media.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_networking.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_networking.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_system.cc" />

View File

@ -37,6 +37,108 @@
<ClInclude Include="..\..\src\ballistica\app\stress_test.h">
<Filter>ballistica\app</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\assets.cc">
<Filter>ballistica\assets</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\assets.h">
<Filter>ballistica\assets</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\assets_server.cc">
<Filter>ballistica\assets</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\assets_server.h">
<Filter>ballistica\assets</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\asset_component.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\asset_component.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\collide_model.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\collide_model.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\cube_map_texture.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\cube_map_texture.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\data.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\data.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\model.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\model.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\sound.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\sound.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\texture.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\texture.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\asset_component_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\asset_component_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\collide_model_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\collide_model_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\data_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\data_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\model_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\model_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\assets\data\model_renderer_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\sound_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\sound_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\texture_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\texture_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\texture_preload_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\texture_preload_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\assets\data\texture_renderer_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\audio\al_sys.cc">
<Filter>ballistica\audio</Filter>
</ClCompile>
@ -805,108 +907,6 @@
<ClInclude Include="..\..\src\ballistica\math\vector4f.h">
<Filter>ballistica\math</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\collide_model.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\collide_model.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\cube_map_texture.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\cube_map_texture.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\data.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\data.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\media_component.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\media_component.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\model.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\model.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\sound.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\sound.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\texture.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\texture.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\collide_model_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\collide_model_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\data_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\data_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\media_component_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\media_component_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\model_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\model_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\media\data\model_renderer_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\sound_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\sound_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\texture_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\texture_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\texture_preload_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\texture_preload_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\media\data\texture_renderer_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\media.cc">
<Filter>ballistica\media</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\media.h">
<Filter>ballistica\media</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\media_server.cc">
<Filter>ballistica\media</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\media_server.h">
<Filter>ballistica\media</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\networking\network_reader.cc">
<Filter>ballistica\networking</Filter>
</ClCompile>
@ -1078,6 +1078,12 @@
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_app.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_assets.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_assets.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_gameplay.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
@ -1096,12 +1102,6 @@
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_input.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_media.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_media.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_networking.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
@ -1646,6 +1646,9 @@
<ItemGroup>
<Filter Include="ballistica" />
<Filter Include="ballistica\app" />
<Filter Include="ballistica\assets" />
<Filter Include="ballistica\assets\component" />
<Filter Include="ballistica\assets\data" />
<Filter Include="ballistica\audio" />
<Filter Include="ballistica\config" />
<Filter Include="ballistica\core" />
@ -1666,9 +1669,6 @@
<Filter Include="ballistica\input\device" />
<Filter Include="ballistica\internal" />
<Filter Include="ballistica\math" />
<Filter Include="ballistica\media" />
<Filter Include="ballistica\media\component" />
<Filter Include="ballistica\media\data" />
<Filter Include="ballistica\networking" />
<Filter Include="ballistica\platform" />
<Filter Include="ballistica\platform\apple" />

View File

@ -196,6 +196,40 @@
<ClInclude Include="..\..\src\ballistica\app\app_flavor_vr.h" />
<ClCompile Include="..\..\src\ballistica\app\stress_test.cc" />
<ClInclude Include="..\..\src\ballistica\app\stress_test.h" />
<ClCompile Include="..\..\src\ballistica\assets\assets.cc" />
<ClInclude Include="..\..\src\ballistica\assets\assets.h" />
<ClCompile Include="..\..\src\ballistica\assets\assets_server.cc" />
<ClInclude Include="..\..\src\ballistica\assets\assets_server.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\asset_component.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\asset_component.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\collide_model.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\collide_model.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\cube_map_texture.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\cube_map_texture.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\data.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\model.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\model.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\sound.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\sound.h" />
<ClCompile Include="..\..\src\ballistica\assets\component\texture.cc" />
<ClInclude Include="..\..\src\ballistica\assets\component\texture.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\asset_component_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\asset_component_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\collide_model_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\collide_model_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\data_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\data_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\model_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\model_data.h" />
<ClInclude Include="..\..\src\ballistica\assets\data\model_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\sound_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\sound_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\texture_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\texture_data.h" />
<ClCompile Include="..\..\src\ballistica\assets\data\texture_preload_data.cc" />
<ClInclude Include="..\..\src\ballistica\assets\data\texture_preload_data.h" />
<ClInclude Include="..\..\src\ballistica\assets\data\texture_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\audio\al_sys.cc" />
<ClInclude Include="..\..\src\ballistica\audio\al_sys.h" />
<ClCompile Include="..\..\src\ballistica\audio\audio.cc" />
@ -452,40 +486,6 @@
<ClCompile Include="..\..\src\ballistica\math\vector3f.cc" />
<ClInclude Include="..\..\src\ballistica\math\vector3f.h" />
<ClInclude Include="..\..\src\ballistica\math\vector4f.h" />
<ClCompile Include="..\..\src\ballistica\media\component\collide_model.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\collide_model.h" />
<ClCompile Include="..\..\src\ballistica\media\component\cube_map_texture.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\cube_map_texture.h" />
<ClCompile Include="..\..\src\ballistica\media\component\data.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\data.h" />
<ClCompile Include="..\..\src\ballistica\media\component\media_component.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\media_component.h" />
<ClCompile Include="..\..\src\ballistica\media\component\model.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\model.h" />
<ClCompile Include="..\..\src\ballistica\media\component\sound.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\sound.h" />
<ClCompile Include="..\..\src\ballistica\media\component\texture.cc" />
<ClInclude Include="..\..\src\ballistica\media\component\texture.h" />
<ClCompile Include="..\..\src\ballistica\media\data\collide_model_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\collide_model_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\data_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\data_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\media_component_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\media_component_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\model_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\model_data.h" />
<ClInclude Include="..\..\src\ballistica\media\data\model_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\sound_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\sound_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\texture_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\texture_data.h" />
<ClCompile Include="..\..\src\ballistica\media\data\texture_preload_data.cc" />
<ClInclude Include="..\..\src\ballistica\media\data\texture_preload_data.h" />
<ClInclude Include="..\..\src\ballistica\media\data\texture_renderer_data.h" />
<ClCompile Include="..\..\src\ballistica\media\media.cc" />
<ClInclude Include="..\..\src\ballistica\media\media.h" />
<ClCompile Include="..\..\src\ballistica\media\media_server.cc" />
<ClInclude Include="..\..\src\ballistica\media\media_server.h" />
<ClCompile Include="..\..\src\ballistica\networking\network_reader.cc" />
<ClInclude Include="..\..\src\ballistica\networking\network_reader.h" />
<ClCompile Include="..\..\src\ballistica\networking\network_writer.cc" />
@ -543,14 +543,14 @@
<ClInclude Include="..\..\src\ballistica\python\class\python_class_widget.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_app.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_app.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_assets.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_assets.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_gameplay.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_gameplay.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_graphics.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_graphics.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_input.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_input.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_media.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_media.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_networking.cc" />
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_networking.h" />
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_system.cc" />

View File

@ -37,6 +37,108 @@
<ClInclude Include="..\..\src\ballistica\app\stress_test.h">
<Filter>ballistica\app</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\assets.cc">
<Filter>ballistica\assets</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\assets.h">
<Filter>ballistica\assets</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\assets_server.cc">
<Filter>ballistica\assets</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\assets_server.h">
<Filter>ballistica\assets</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\asset_component.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\asset_component.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\collide_model.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\collide_model.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\cube_map_texture.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\cube_map_texture.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\data.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\data.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\model.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\model.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\sound.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\sound.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\component\texture.cc">
<Filter>ballistica\assets\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\component\texture.h">
<Filter>ballistica\assets\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\asset_component_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\asset_component_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\collide_model_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\collide_model_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\data_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\data_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\model_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\model_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\assets\data\model_renderer_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\sound_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\sound_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\texture_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\texture_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\assets\data\texture_preload_data.cc">
<Filter>ballistica\assets\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\assets\data\texture_preload_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\assets\data\texture_renderer_data.h">
<Filter>ballistica\assets\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\audio\al_sys.cc">
<Filter>ballistica\audio</Filter>
</ClCompile>
@ -805,108 +907,6 @@
<ClInclude Include="..\..\src\ballistica\math\vector4f.h">
<Filter>ballistica\math</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\collide_model.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\collide_model.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\cube_map_texture.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\cube_map_texture.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\data.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\data.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\media_component.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\media_component.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\model.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\model.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\sound.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\sound.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\component\texture.cc">
<Filter>ballistica\media\component</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\component\texture.h">
<Filter>ballistica\media\component</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\collide_model_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\collide_model_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\data_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\data_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\media_component_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\media_component_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\model_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\model_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\media\data\model_renderer_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\sound_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\sound_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\texture_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\texture_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\data\texture_preload_data.cc">
<Filter>ballistica\media\data</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\data\texture_preload_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ballistica\media\data\texture_renderer_data.h">
<Filter>ballistica\media\data</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\media.cc">
<Filter>ballistica\media</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\media.h">
<Filter>ballistica\media</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\media\media_server.cc">
<Filter>ballistica\media</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\media\media_server.h">
<Filter>ballistica\media</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\networking\network_reader.cc">
<Filter>ballistica\networking</Filter>
</ClCompile>
@ -1078,6 +1078,12 @@
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_app.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_assets.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_assets.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_gameplay.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
@ -1096,12 +1102,6 @@
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_input.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_media.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ballistica\python\methods\python_methods_media.h">
<Filter>ballistica\python\methods</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ballistica\python\methods\python_methods_networking.cc">
<Filter>ballistica\python\methods</Filter>
</ClCompile>
@ -1646,6 +1646,9 @@
<ItemGroup>
<Filter Include="ballistica" />
<Filter Include="ballistica\app" />
<Filter Include="ballistica\assets" />
<Filter Include="ballistica\assets\component" />
<Filter Include="ballistica\assets\data" />
<Filter Include="ballistica\audio" />
<Filter Include="ballistica\config" />
<Filter Include="ballistica\core" />
@ -1666,9 +1669,6 @@
<Filter Include="ballistica\input\device" />
<Filter Include="ballistica\internal" />
<Filter Include="ballistica\math" />
<Filter Include="ballistica\media" />
<Filter Include="ballistica\media\component" />
<Filter Include="ballistica\media\data" />
<Filter Include="ballistica\networking" />
<Filter Include="ballistica\platform" />
<Filter Include="ballistica\platform\apple" />

View File

@ -76,11 +76,11 @@ void StressTest::Update() {
uint32_t texture_count = 0;
uint32_t sound_count = 0;
uint32_t node_count = 0;
if (g_media) {
model_count = g_media->total_model_count();
collide_model_count = g_media->total_collide_model_count();
texture_count = g_media->total_texture_count();
sound_count = g_media->total_sound_count();
if (g_assets) {
model_count = g_assets->total_model_count();
collide_model_count = g_assets->total_collide_model_count();
texture_count = g_assets->total_texture_count();
sound_count = g_assets->total_sound_count();
}
assert(g_game);
std::string mem_usage = g_platform->GetMemUsageInfo();

View File

@ -1,23 +1,23 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/media.h"
#include "ballistica/assets/assets.h"
#if !BA_OSTYPE_WINDOWS
#include <sys/stat.h>
#endif
#include "ballistica/assets/assets_server.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/assets/data/sound_data.h"
#include "ballistica/audio/audio_server.h"
#include "ballistica/core/thread.h"
#include "ballistica/game/game.h"
#include "ballistica/generic/timer.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/text/text_packer.h"
#include "ballistica/media/component/collide_model.h"
#include "ballistica/media/component/data.h"
#include "ballistica/media/component/model.h"
#include "ballistica/media/component/texture.h"
#include "ballistica/media/data/sound_data.h"
#include "ballistica/media/media_server.h"
#include "ballistica/python/python_sys.h"
namespace ballistica {
@ -26,8 +26,8 @@ namespace ballistica {
#define BA_SHOW_LOADS_UNLOADS 0
#define SHOW_PRUNING_INFO 0
// Standard prune time for unused media: 10 minutes (1000ms * 60 * 10).
#define STANDARD_MEDIA_PRUNE_TIME 600000
// Standard prune time for unused assets: 10 minutes (1000ms * 60 * 10).
#define STANDARD_ASSET_PRUNE_TIME 600000
// More aggressive prune time for dynamically-generated text-textures: 10
// seconds.
@ -35,53 +35,53 @@ namespace ballistica {
#define QR_TEXTURE_PRUNE_TIME 10000
// How long we should spend loading media in each runPendingLoads() call.
// How long we should spend loading assets in each runPendingLoads() call.
#define PENDING_LOAD_PROCESS_TIME 5
Media::Media() {
media_paths_.emplace_back("ba_data");
Assets::Assets() {
asset_paths_.emplace_back("ba_data");
for (bool& have_pending_load : have_pending_loads_) {
have_pending_load = false;
}
}
void Media::LoadSystemTexture(SystemTextureID id, const char* name) {
assert(media_lists_locked_);
void Assets::LoadSystemTexture(SystemTextureID id, const char* name) {
assert(asset_lists_locked_);
system_textures_.push_back(GetTextureData(name));
assert(system_textures_.size() == static_cast<int>(id) + 1);
}
void Media::LoadSystemCubeMapTexture(SystemCubeMapTextureID id,
const char* name) {
assert(media_lists_locked_);
void Assets::LoadSystemCubeMapTexture(SystemCubeMapTextureID id,
const char* name) {
assert(asset_lists_locked_);
system_cube_map_textures_.push_back(GetCubeMapTextureData(name));
assert(system_cube_map_textures_.size() == static_cast<int>(id) + 1);
}
void Media::LoadSystemSound(SystemSoundID id, const char* name) {
void Assets::LoadSystemSound(SystemSoundID id, const char* name) {
system_sounds_.push_back(GetSoundData(name));
assert(system_sounds_.size() == static_cast<int>(id) + 1);
}
void Media::LoadSystemData(SystemDataID id, const char* name) {
void Assets::LoadSystemData(SystemDataID id, const char* name) {
system_datas_.push_back(GetDataData(name));
assert(system_datas_.size() == static_cast<int>(id) + 1);
}
void Media::LoadSystemModel(SystemModelID id, const char* name) {
void Assets::LoadSystemModel(SystemModelID id, const char* name) {
system_models_.push_back(GetModelData(name));
assert(system_models_.size() == static_cast<int>(id) + 1);
}
void Media::LoadSystemMedia() {
void Assets::LoadSystemAssets() {
assert(InLogicThread());
assert(g_audio_server && g_media_server && g_graphics_server);
assert(g_audio_server && g_assets_server && g_graphics_server);
assert(g_graphics_server
&& g_graphics_server->texture_compression_types_are_set());
assert(g_graphics && g_graphics_server->texture_quality_set());
// Just grab the lock once for all this stuff for efficiency.
MediaListsLock lock;
AssetListLock lock;
// System textures:
LoadSystemTexture(SystemTextureID::kUIAtlas, "uiAtlas");
@ -280,24 +280,24 @@ void Media::LoadSystemMedia() {
LoadSystemModel(SystemModelID::kWing, "wing");
// Hooray!
system_media_loaded_ = true;
system_assets_loaded_ = true;
}
void Media::PrintLoadInfo() {
void Assets::PrintLoadInfo() {
std::string s;
char buffer[256];
int num = 1;
// Need to lock lists while iterating over them.
MediaListsLock lock;
s = "Media load results: (all times in milliseconds):\n";
AssetListLock lock;
s = "Assets load results: (all times in milliseconds):\n";
snprintf(buffer, sizeof(buffer), " %-50s %10s %10s", "FILE",
"PRELOAD_TIME", "LOAD_TIME");
s += buffer;
Log(s, true, false);
millisecs_t total_preload_time = 0;
millisecs_t total_load_time = 0;
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto&& i : models_) {
millisecs_t preload_time = i.second->preload_time();
millisecs_t load_time = i.second->load_time();
@ -310,7 +310,7 @@ void Media::PrintLoadInfo() {
Log(buffer, true, false);
num++;
}
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto&& i : collide_models_) {
millisecs_t preload_time = i.second->preload_time();
millisecs_t load_time = i.second->load_time();
@ -323,7 +323,7 @@ void Media::PrintLoadInfo() {
Log(buffer, true, false);
num++;
}
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto&& i : sounds_) {
millisecs_t preload_time = i.second->preload_time();
millisecs_t load_time = i.second->load_time();
@ -336,7 +336,7 @@ void Media::PrintLoadInfo() {
Log(buffer, true, false);
num++;
}
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto&& i : datas_) {
millisecs_t preload_time = i.second->preload_time();
millisecs_t load_time = i.second->load_time();
@ -349,7 +349,7 @@ void Media::PrintLoadInfo() {
Log(buffer, true, false);
num++;
}
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto&& i : textures_) {
millisecs_t preload_time = i.second->preload_time();
millisecs_t load_time = i.second->load_time();
@ -370,96 +370,97 @@ void Media::PrintLoadInfo() {
Log(buffer, true, false);
}
void Media::MarkAllMediaForLoad() {
void Assets::MarkAllAssetsForLoad() {
assert(InLogicThread());
// Need to keep lists locked while iterating over them.
MediaListsLock m_lock;
AssetListLock m_lock;
for (auto&& i : textures_) {
if (!i.second->preloaded()) {
MediaComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(MediaType::kTexture)] = true;
AssetComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(AssetType::kTexture)] = true;
MarkComponentForLoad(i.second.get());
}
}
for (auto&& i : text_textures_) {
if (!i.second->preloaded()) {
MediaComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(MediaType::kTexture)] = true;
AssetComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(AssetType::kTexture)] = true;
MarkComponentForLoad(i.second.get());
}
}
for (auto&& i : qr_textures_) {
if (!i.second->preloaded()) {
MediaComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(MediaType::kTexture)] = true;
AssetComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(AssetType::kTexture)] = true;
MarkComponentForLoad(i.second.get());
}
}
for (auto&& i : models_) {
if (!i.second->preloaded()) {
MediaComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(MediaType::kModel)] = true;
AssetComponentData::LockGuard lock(i.second.get());
have_pending_loads_[static_cast<int>(AssetType::kModel)] = true;
MarkComponentForLoad(i.second.get());
}
}
}
// Call this from the graphics thread to immediately unload all
// media used by it. (for when GL context gets lost, etc).
void Media::UnloadRendererBits(bool do_textures, bool do_models) {
// assets used by it. (for when GL context gets lost, etc).
void Assets::UnloadRendererBits(bool do_textures, bool do_models) {
assert(InGraphicsThread());
// need to keep lists locked while iterating over them..
MediaListsLock m_lock;
AssetListLock m_lock;
if (do_textures) {
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto&& i : textures_) {
MediaComponentData::LockGuard lock(i.second.get());
AssetComponentData::LockGuard lock(i.second.get());
i.second->Unload(true);
}
for (auto&& i : text_textures_) {
MediaComponentData::LockGuard lock(i.second.get());
AssetComponentData::LockGuard lock(i.second.get());
i.second->Unload(true);
}
for (auto&& i : qr_textures_) {
MediaComponentData::LockGuard lock(i.second.get());
AssetComponentData::LockGuard lock(i.second.get());
i.second->Unload(true);
}
}
if (do_models) {
for (auto&& i : models_) {
MediaComponentData::LockGuard lock(i.second.get());
AssetComponentData::LockGuard lock(i.second.get());
i.second->Unload(true);
}
}
}
auto Media::GetModelData(const std::string& file_name)
auto Assets::GetModelData(const std::string& file_name)
-> Object::Ref<ModelData> {
return GetComponentData(file_name, &models_);
}
auto Media::GetSoundData(const std::string& file_name)
auto Assets::GetSoundData(const std::string& file_name)
-> Object::Ref<SoundData> {
return GetComponentData(file_name, &sounds_);
}
auto Media::GetDataData(const std::string& file_name) -> Object::Ref<DataData> {
auto Assets::GetDataData(const std::string& file_name)
-> Object::Ref<DataData> {
return GetComponentData(file_name, &datas_);
}
auto Media::GetCollideModelData(const std::string& file_name)
auto Assets::GetCollideModelData(const std::string& file_name)
-> Object::Ref<CollideModelData> {
return GetComponentData(file_name, &collide_models_);
}
template <class T>
auto Media::GetComponentData(
auto Assets::GetComponentData(
const std::string& file_name,
std::unordered_map<std::string, Object::Ref<T> >* c_list)
-> Object::Ref<T> {
assert(InLogicThread());
assert(media_lists_locked_);
assert(asset_lists_locked_);
auto i = c_list->find(file_name);
if (i != c_list->end()) {
return Object::Ref<T>(i->second.get());
@ -467,8 +468,8 @@ auto Media::GetComponentData(
auto d(Object::New<T>(file_name));
(*c_list)[file_name] = d;
{
MediaComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetMediaType())] = true;
AssetComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetAssetType())] = true;
MarkComponentForLoad(d.get());
}
d->set_last_used_time(GetRealTime());
@ -476,9 +477,9 @@ auto Media::GetComponentData(
}
}
auto Media::GetTextureData(TextPacker* packer) -> Object::Ref<TextureData> {
auto Assets::GetTextureData(TextPacker* packer) -> Object::Ref<TextureData> {
assert(InLogicThread());
assert(media_lists_locked_);
assert(asset_lists_locked_);
const std::string& hash(packer->hash());
auto i = text_textures_.find(hash);
if (i != text_textures_.end()) {
@ -487,8 +488,8 @@ auto Media::GetTextureData(TextPacker* packer) -> Object::Ref<TextureData> {
auto d(Object::New<TextureData>(packer));
text_textures_[hash] = d;
{
MediaComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetMediaType())] = true;
AssetComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetAssetType())] = true;
MarkComponentForLoad(d.get());
}
d->set_last_used_time(GetRealTime());
@ -496,10 +497,10 @@ auto Media::GetTextureData(TextPacker* packer) -> Object::Ref<TextureData> {
}
}
auto Media::GetTextureDataQRCode(const std::string& url)
auto Assets::GetTextureDataQRCode(const std::string& url)
-> Object::Ref<TextureData> {
assert(InLogicThread());
assert(media_lists_locked_);
assert(asset_lists_locked_);
auto i = qr_textures_.find(url);
if (i != qr_textures_.end()) {
return Object::Ref<TextureData>(i->second.get());
@ -507,8 +508,8 @@ auto Media::GetTextureDataQRCode(const std::string& url)
auto d(Object::New<TextureData>(url));
qr_textures_[url] = d;
{
MediaComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetMediaType())] = true;
AssetComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetAssetType())] = true;
MarkComponentForLoad(d.get());
}
d->set_last_used_time(GetRealTime());
@ -518,10 +519,10 @@ auto Media::GetTextureDataQRCode(const std::string& url)
// Eww can't recycle GetComponent here since we need extra stuff (tex-type arg)
// ..should fix.
auto Media::GetCubeMapTextureData(const std::string& file_name)
auto Assets::GetCubeMapTextureData(const std::string& file_name)
-> Object::Ref<TextureData> {
assert(InLogicThread());
assert(media_lists_locked_);
assert(asset_lists_locked_);
auto i = textures_.find(file_name);
if (i != textures_.end()) {
return Object::Ref<TextureData>(i->second.get());
@ -530,8 +531,8 @@ auto Media::GetCubeMapTextureData(const std::string& file_name)
TextureMinQuality::kLow));
textures_[file_name] = d;
{
MediaComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetMediaType())] = true;
AssetComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetAssetType())] = true;
MarkComponentForLoad(d.get());
}
d->set_last_used_time(GetRealTime());
@ -541,10 +542,10 @@ auto Media::GetCubeMapTextureData(const std::string& file_name)
// Eww; can't recycle GetComponent here since we need extra stuff (quality
// settings, etc). Should fix.
auto Media::GetTextureData(const std::string& file_name)
auto Assets::GetTextureData(const std::string& file_name)
-> Object::Ref<TextureData> {
assert(InLogicThread());
assert(media_lists_locked_);
assert(asset_lists_locked_);
auto i = textures_.find(file_name);
if (i != textures_.end()) {
return Object::Ref<TextureData>(i->second.get());
@ -586,8 +587,8 @@ auto Media::GetTextureData(const std::string& file_name)
auto d(Object::New<TextureData>(file_name, TextureType::k2D, min_quality));
textures_[file_name] = d;
{
MediaComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetMediaType())] = true;
AssetComponentData::LockGuard lock(d.get());
have_pending_loads_[static_cast<int>(d->GetAssetType())] = true;
MarkComponentForLoad(d.get());
}
d->set_last_used_time(GetRealTime());
@ -595,7 +596,7 @@ auto Media::GetTextureData(const std::string& file_name)
}
}
void Media::MarkComponentForLoad(MediaComponentData* c) {
void Assets::MarkComponentForLoad(AssetComponentData* c) {
assert(InLogicThread());
assert(c->locked());
@ -606,19 +607,19 @@ void Media::MarkComponentForLoad(MediaComponentData* c) {
// once it makes it back to us we can delete the ref (in
// ClearPendingLoadsDoneList)
auto media_ptr = new Object::Ref<MediaComponentData>(c);
auto asset_ptr = new Object::Ref<AssetComponentData>(c);
g_media_server->thread()->PushCall([media_ptr] {
assert(InMediaThread());
g_assets_server->thread()->PushCall([asset_ptr] {
assert(InAssetsThread());
// add our pointer to one of the preload lists and shake our preload thread
// to wake it up
if ((**media_ptr).GetMediaType() == MediaType::kSound) {
g_media_server->pending_preloads_audio_.push_back(media_ptr);
if ((**asset_ptr).GetAssetType() == AssetType::kSound) {
g_assets_server->pending_preloads_audio_.push_back(asset_ptr);
} else {
g_media_server->pending_preloads_.push_back(media_ptr);
g_assets_server->pending_preloads_.push_back(asset_ptr);
}
g_media_server->process_timer_->SetLength(0);
g_assets_server->process_timer_->SetLength(0);
});
}
@ -626,102 +627,102 @@ void Media::MarkComponentForLoad(MediaComponentData* c) {
#pragma ide diagnostic ignored "UnreachableCode"
#pragma ide diagnostic ignored "ConstantFunctionResult"
auto Media::GetModelPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(MediaType::kModel)]) {
auto Assets::GetModelPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(AssetType::kModel)]) {
return 0;
}
MediaListsLock lock;
int total = GetComponentPendingLoadCount(&models_, MediaType::kModel);
AssetListLock lock;
int total = GetComponentPendingLoadCount(&models_, AssetType::kModel);
if (total == 0) {
// When fully loaded, stop counting.
have_pending_loads_[static_cast<int>(MediaType::kModel)] = false;
have_pending_loads_[static_cast<int>(AssetType::kModel)] = false;
}
return total;
}
auto Media::GetTexturePendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(MediaType::kTexture)]) {
auto Assets::GetTexturePendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(AssetType::kTexture)]) {
return 0;
}
MediaListsLock lock;
AssetListLock lock;
int total =
(GetComponentPendingLoadCount(&textures_, MediaType::kTexture)
+ GetComponentPendingLoadCount(&text_textures_, MediaType::kTexture)
+ GetComponentPendingLoadCount(&qr_textures_, MediaType::kTexture));
(GetComponentPendingLoadCount(&textures_, AssetType::kTexture)
+ GetComponentPendingLoadCount(&text_textures_, AssetType::kTexture)
+ GetComponentPendingLoadCount(&qr_textures_, AssetType::kTexture));
if (total == 0) {
// When fully loaded, stop counting.
have_pending_loads_[static_cast<int>(MediaType::kTexture)] = false;
have_pending_loads_[static_cast<int>(AssetType::kTexture)] = false;
}
return total;
}
auto Media::GetSoundPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(MediaType::kSound)]) {
auto Assets::GetSoundPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(AssetType::kSound)]) {
return 0;
}
MediaListsLock lock;
int total = GetComponentPendingLoadCount(&sounds_, MediaType::kSound);
AssetListLock lock;
int total = GetComponentPendingLoadCount(&sounds_, AssetType::kSound);
if (total == 0) {
// When fully loaded, stop counting.
have_pending_loads_[static_cast<int>(MediaType::kSound)] = false;
have_pending_loads_[static_cast<int>(AssetType::kSound)] = false;
}
return total;
}
auto Media::GetDataPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(MediaType::kData)]) {
auto Assets::GetDataPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(AssetType::kData)]) {
return 0;
}
MediaListsLock lock;
int total = GetComponentPendingLoadCount(&datas_, MediaType::kData);
AssetListLock lock;
int total = GetComponentPendingLoadCount(&datas_, AssetType::kData);
if (total == 0) {
// When fully loaded, stop counting.
have_pending_loads_[static_cast<int>(MediaType::kData)] = false;
have_pending_loads_[static_cast<int>(AssetType::kData)] = false;
}
return total;
}
auto Media::GetCollideModelPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(MediaType::kCollideModel)]) {
auto Assets::GetCollideModelPendingLoadCount() -> int {
if (!have_pending_loads_[static_cast<int>(AssetType::kCollideModel)]) {
return 0;
}
MediaListsLock lock;
AssetListLock lock;
int total =
GetComponentPendingLoadCount(&collide_models_, MediaType::kCollideModel);
GetComponentPendingLoadCount(&collide_models_, AssetType::kCollideModel);
if (total == 0) {
// When fully loaded, stop counting.
have_pending_loads_[static_cast<int>(MediaType::kCollideModel)] = false;
have_pending_loads_[static_cast<int>(AssetType::kCollideModel)] = false;
}
return total;
}
#pragma clang diagnostic pop
auto Media::GetGraphicalPendingLoadCount() -> int {
// Each of these calls lock the media-lists so we don't.
auto Assets::GetGraphicalPendingLoadCount() -> int {
// Each of these calls lock the asset-lists so we don't.
return GetModelPendingLoadCount() + GetTexturePendingLoadCount();
}
auto Media::GetPendingLoadCount() -> int {
// Each of these calls lock the media-lists so we don't.
auto Assets::GetPendingLoadCount() -> int {
// Each of these calls lock the asset-lists so we don't.
return GetModelPendingLoadCount() + GetTexturePendingLoadCount()
+ GetDataPendingLoadCount() + GetSoundPendingLoadCount()
+ GetCollideModelPendingLoadCount();
}
template <class T>
auto Media::GetComponentPendingLoadCount(
std::unordered_map<std::string, Object::Ref<T> >* t_list, MediaType type)
auto Assets::GetComponentPendingLoadCount(
std::unordered_map<std::string, Object::Ref<T> >* t_list, AssetType type)
-> int {
assert(InLogicThread());
assert(media_lists_locked_);
assert(asset_lists_locked_);
int c = 0;
for (auto&& i : (*t_list)) {
if (i.second.exists()) {
if (i.second->TryLock()) {
MediaComponentData::LockGuard lock(
i.second.get(), MediaComponentData::LockGuard::Type::kInheritLock);
AssetComponentData::LockGuard lock(
i.second.get(), AssetComponentData::LockGuard::Type::kInheritLock);
if (!i.second->loaded()) {
c++;
}
@ -734,26 +735,26 @@ auto Media::GetComponentPendingLoadCount(
}
// Runs the pending loads that need to run from the audio thread.
auto Media::RunPendingAudioLoads() -> bool {
auto Assets::RunPendingAudioLoads() -> bool {
assert(InAudioThread());
return RunPendingLoadList(&pending_loads_sounds_);
}
// Runs the pending loads that need to run from the graphics thread.
auto Media::RunPendingGraphicsLoads() -> bool {
auto Assets::RunPendingGraphicsLoads() -> bool {
assert(InGraphicsThread());
return RunPendingLoadList(&pending_loads_graphics_);
}
// Runs the pending loads that run in the main thread. Also clears the list of
// done loads.
auto Media::RunPendingLoadsLogicThread() -> bool {
auto Assets::RunPendingLoadsLogicThread() -> bool {
assert(InLogicThread());
return RunPendingLoadList(&pending_loads_other_);
}
template <class T>
auto Media::RunPendingLoadList(std::vector<Object::Ref<T>*>* c_list) -> bool {
auto Assets::RunPendingLoadList(std::vector<Object::Ref<T>*>* c_list) -> bool {
bool flush = false;
millisecs_t starttime = GetRealTime();
@ -830,31 +831,31 @@ auto Media::RunPendingLoadList(std::vector<Object::Ref<T>*>* c_list) -> bool {
return (!l.empty());
}
void Media::Prune(int level) {
void Assets::Prune(int level) {
assert(InLogicThread());
millisecs_t current_time = GetRealTime();
// need lists locked while accessing/modifying them
MediaListsLock lock;
AssetListLock lock;
// we can specify level for more aggressive pruning (during memory warnings
// and whatnot)
millisecs_t standard_media_prune_time = STANDARD_MEDIA_PRUNE_TIME;
millisecs_t standard_asset_prune_time = STANDARD_ASSET_PRUNE_TIME;
millisecs_t text_texture_prune_time = TEXT_TEXTURE_PRUNE_TIME;
millisecs_t qr_texture_prune_time = QR_TEXTURE_PRUNE_TIME;
switch (level) {
case 1:
standard_media_prune_time = 120000; // 2 min
standard_asset_prune_time = 120000; // 2 min
text_texture_prune_time = 1000; // 1 sec
qr_texture_prune_time = 1000; // 1 sec
break;
case 2:
standard_media_prune_time = 30000; // 30 sec
standard_asset_prune_time = 30000; // 30 sec
text_texture_prune_time = 1000; // 1 sec
qr_texture_prune_time = 1000; // 1 sec
break;
case 3:
standard_media_prune_time = 5000; // 5 sec
standard_asset_prune_time = 5000; // 5 sec
text_texture_prune_time = 1000; // 1 sec
qr_texture_prune_time = 1000; // 1 sec
break;
@ -862,11 +863,11 @@ void Media::Prune(int level) {
break;
}
std::vector<Object::Ref<MediaComponentData>*> graphics_thread_unloads;
std::vector<Object::Ref<MediaComponentData>*> audio_thread_unloads;
std::vector<Object::Ref<AssetComponentData>*> graphics_thread_unloads;
std::vector<Object::Ref<AssetComponentData>*> audio_thread_unloads;
#if SHOW_PRUNING_INFO
assert(media_lists_locked_);
assert(asset_lists_locked_);
int old_texture_count = textures_.size();
int old_text_texture_count = text_textures_.size();
int old_qr_texture_count = qr_textures_.size();
@ -876,13 +877,13 @@ void Media::Prune(int level) {
#endif // SHOW_PRUNING_INFO
// prune textures..
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto i = textures_.begin(); i != textures_.end();) {
TextureData* texture_data = i->second.get();
// attempt to prune if there are no references remaining except our own and
// its been a while since it was used
if (current_time - texture_data->last_used_time()
> standard_media_prune_time
> standard_asset_prune_time
&& (texture_data->object_strong_ref_count() <= 1)) {
// if its preloaded/loaded we need to ask the graphics thread to unload it
// first
@ -890,7 +891,7 @@ void Media::Prune(int level) {
// allocate a reference to keep this texture_data alive while the unload
// is happening
graphics_thread_unloads.push_back(
new Object::Ref<MediaComponentData>(texture_data));
new Object::Ref<AssetComponentData>(texture_data));
auto i_next = i;
i_next++;
textures_.erase(i);
@ -904,7 +905,7 @@ void Media::Prune(int level) {
// prune text-textures more aggressively since we may generate lots of them
// FIXME - we may want to prune based on total number of these instead of
// time..
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto i = text_textures_.begin(); i != text_textures_.end();) {
TextureData* texture_data = i->second.get();
// attempt to prune if there are no references remaining except our own and
@ -917,7 +918,7 @@ void Media::Prune(int level) {
// allocate a reference to keep this texture_data alive while the unload
// is happening
graphics_thread_unloads.push_back(
new Object::Ref<MediaComponentData>(texture_data));
new Object::Ref<AssetComponentData>(texture_data));
auto i_next = i;
i_next++;
text_textures_.erase(i);
@ -929,7 +930,7 @@ void Media::Prune(int level) {
}
// prune textures
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto i = qr_textures_.begin(); i != qr_textures_.end();) {
TextureData* texture_data = i->second.get();
// attempt to prune if there are no references remaining except our own and
@ -942,7 +943,7 @@ void Media::Prune(int level) {
// allocate a reference to keep this texture_data alive while the unload
// is happening
graphics_thread_unloads.push_back(
new Object::Ref<MediaComponentData>(texture_data));
new Object::Ref<AssetComponentData>(texture_data));
auto i_next = i;
i_next++;
qr_textures_.erase(i);
@ -954,12 +955,12 @@ void Media::Prune(int level) {
}
// prune models..
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto i = models_.begin(); i != models_.end();) {
ModelData* model_data = i->second.get();
// attempt to prune if there are no references remaining except our own and
// its been a while since it was used
if (current_time - model_data->last_used_time() > standard_media_prune_time
if (current_time - model_data->last_used_time() > standard_asset_prune_time
&& (model_data->object_strong_ref_count() <= 1)) {
// if its preloaded/loaded we need to ask the graphics thread to unload it
// first
@ -967,7 +968,7 @@ void Media::Prune(int level) {
// allocate a reference to keep this model_data alive while the unload
// is happening
graphics_thread_unloads.push_back(
new Object::Ref<MediaComponentData>(model_data));
new Object::Ref<AssetComponentData>(model_data));
auto i_next = i;
i_next++;
models_.erase(i);
@ -979,14 +980,14 @@ void Media::Prune(int level) {
}
// Prune collide-models.
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto i = collide_models_.begin(); i != collide_models_.end();) {
CollideModelData* collide_model_data = i->second.get();
// attempt to prune if there are no references remaining except our own and
// its been a while since it was used (unlike other media we never prune
// its been a while since it was used (unlike other assets we never prune
// these if there's still references to them
if (current_time - collide_model_data->last_used_time()
> standard_media_prune_time
> standard_asset_prune_time
&& (collide_model_data->object_strong_ref_count() <= 1)) {
// we can unload it immediately since that happens in the game thread...
collide_model_data->Unload();
@ -1004,13 +1005,13 @@ void Media::Prune(int level) {
// sounds are still in active use by OpenAL and ensure references exist for
// them somewhere while that is the case
if (explicit_bool(false)) {
assert(media_lists_locked_);
assert(asset_lists_locked_);
for (auto i = sounds_.begin(); i != sounds_.end();) {
SoundData* sound_data = i->second.get();
// Attempt to prune if there are no references remaining except our own
// and its been a while since it was used.
if (current_time - sound_data->last_used_time()
> standard_media_prune_time
> standard_asset_prune_time
&& (sound_data->object_strong_ref_count() <= 1)) {
// If its preloaded/loaded we need to ask the graphics thread to unload
// it first.
@ -1018,7 +1019,7 @@ void Media::Prune(int level) {
// Allocate a reference to keep this sound_data alive while the unload
// is happening.
audio_thread_unloads.push_back(
new Object::Ref<MediaComponentData>(sound_data));
new Object::Ref<AssetComponentData>(sound_data));
auto i_next = i;
i_next++;
sounds_.erase(i);
@ -1038,7 +1039,7 @@ void Media::Prune(int level) {
}
#if SHOW_PRUNING_INFO
assert(media_lists_locked_);
assert(asset_lists_locked_);
if (textures_.size() != old_texture_count) {
Log("Textures pruned from " + std::to_string(old_texture_count) + " to "
+ std::to_string(textures_.size()));
@ -1066,7 +1067,7 @@ void Media::Prune(int level) {
#endif // SHOW_PRUNING_INFO
}
auto Media::FindMediaFile(FileType type, const std::string& name)
auto Assets::FindAssetFile(FileType type, const std::string& name)
-> std::string {
std::string file_out;
@ -1136,9 +1137,9 @@ auto Media::FindMediaFile(FileType type, const std::string& name)
break;
}
const std::vector<std::string>& media_paths_used = media_paths_;
const std::vector<std::string>& asset_paths_used = asset_paths_;
for (auto&& i : media_paths_used) {
for (auto&& i : asset_paths_used) {
struct BA_STAT stats {};
file_out = i + "/" + prefix + name + ext; // NOLINT
int result;
@ -1163,26 +1164,26 @@ auto Media::FindMediaFile(FileType type, const std::string& name)
// We wanna fail gracefully for some types.
if (type == FileType::kSound && name != "blank") {
Log("Unable to load audio: '" + name + "'; trying fallback...");
return FindMediaFile(type, "blank");
return FindAssetFile(type, "blank");
} else if (type == FileType::kTexture && name != "white") {
Log("Unable to load texture: '" + name + "'; trying fallback...");
return FindMediaFile(type, "white");
return FindAssetFile(type, "white");
}
throw Exception("Can't find media: \"" + name + "\"");
throw Exception("Can't find asset: \"" + name + "\"");
// return file_out;
}
void Media::AddPendingLoad(Object::Ref<MediaComponentData>* c) {
switch ((**c).GetMediaType()) {
case MediaType::kTexture:
case MediaType::kModel: {
void Assets::AddPendingLoad(Object::Ref<AssetComponentData>* c) {
switch ((**c).GetAssetType()) {
case AssetType::kTexture:
case AssetType::kModel: {
// Tell the graphics thread there's pending loads...
std::scoped_lock lock(pending_load_list_mutex_);
pending_loads_graphics_.push_back(c);
break;
}
case MediaType::kSound: {
case AssetType::kSound: {
// Tell the audio thread there's pending loads.
{
std::scoped_lock lock(pending_load_list_mutex_);
@ -1203,7 +1204,7 @@ void Media::AddPendingLoad(Object::Ref<MediaComponentData>* c) {
}
}
void Media::ClearPendingLoadsDoneList() {
void Assets::ClearPendingLoadsDoneList() {
assert(InLogicThread());
std::scoped_lock lock(pending_load_list_mutex_);
@ -1213,13 +1214,13 @@ void Media::ClearPendingLoadsDoneList() {
// We can now kill the reference knowing that it's safe for this component
// to die at any time (anyone needing it to be alive now should be holding a
// reference themselves).
for (Object::Ref<MediaComponentData>* i : pending_loads_done_) {
for (Object::Ref<AssetComponentData>* i : pending_loads_done_) {
delete i;
}
pending_loads_done_.clear();
}
void Media::AddPackage(const std::string& name, const std::string& path) {
void Assets::AddPackage(const std::string& name, const std::string& path) {
// we don't protect package-path access so make sure its always from here..
assert(InLogicThread());
#if BA_DEBUG_BUILD
@ -1230,18 +1231,18 @@ void Media::AddPackage(const std::string& name, const std::string& path) {
packages_[name] = path;
}
Media::MediaListsLock::MediaListsLock() {
Assets::AssetListLock::AssetListLock() {
BA_DEBUG_FUNCTION_TIMER_BEGIN();
g_media->media_lists_mutex_.lock();
assert(!g_media->media_lists_locked_);
g_media->media_lists_locked_ = true;
g_assets->asset_lists_mutex_.lock();
assert(!g_assets->asset_lists_locked_);
g_assets->asset_lists_locked_ = true;
BA_DEBUG_FUNCTION_TIMER_END_THREAD(20);
}
Media::MediaListsLock::~MediaListsLock() {
assert(g_media->media_lists_locked_);
g_media->media_lists_locked_ = false;
g_media->media_lists_mutex_.unlock();
Assets::AssetListLock::~AssetListLock() {
assert(g_assets->asset_lists_locked_);
g_assets->asset_lists_locked_ = false;
g_assets->asset_lists_mutex_.unlock();
}
} // namespace ballistica

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_MEDIA_H_
#define BALLISTICA_MEDIA_MEDIA_H_
#ifndef BALLISTICA_ASSETS_ASSETS_H_
#define BALLISTICA_ASSETS_ASSETS_H_
#include <mutex>
#include <string>
@ -12,15 +12,15 @@
namespace ballistica {
/// Global media wrangling class.
class Media {
/// Global assets wrangling class.
class Assets {
public:
Media();
Assets();
/// Handy function to try to return a bit of media from a std::unordered_map
/// Handy function to try to return an asset from a std::unordered_map
/// of weak-refs, loading/adding it if need be.
template <typename T>
static auto GetMedia(
static auto GetAsset(
std::unordered_map<std::string, Object::WeakRef<T> >* list,
const std::string& name, Scene* scene) -> Object::Ref<T> {
assert(InLogicThread());
@ -43,7 +43,7 @@ class Media {
auto AddPackage(const std::string& name, const std::string& path) -> void;
auto Prune(int level = 0) -> void;
/// Finish loading any media that has been preloaded but still needs to be
/// Finish loading any assets that have been preloaded but still need to be
/// loaded by the proper thread.
auto RunPendingLoadsLogicThread() -> bool;
@ -58,9 +58,9 @@ class Media {
/// This function takes a newly allocated pointer which
/// is deleted once the load is completed.
auto AddPendingLoad(Object::Ref<MediaComponentData>* c) -> void;
auto AddPendingLoad(Object::Ref<AssetComponentData>* c) -> void;
enum class FileType { kModel, kCollisionModel, kTexture, kSound, kData };
auto FindMediaFile(FileType fileType, const std::string& file_in)
auto FindAssetFile(FileType fileType, const std::string& file_in)
-> std::string;
/// Unload renderer-specific bits only (gl display lists, etc) - used when
@ -68,8 +68,8 @@ class Media {
auto UnloadRendererBits(bool textures, bool models) -> void;
/// Should be called from the game thread after UnloadRendererBits();
/// kicks off bg loads for all existing unloaded media.
auto MarkAllMediaForLoad() -> void;
/// kicks off bg loads for all existing unloaded assets.
auto MarkAllAssetsForLoad() -> void;
auto PrintLoadInfo() -> void;
auto GetModelPendingLoadCount() -> int;
@ -85,13 +85,13 @@ class Media {
auto GetPendingLoadCount() -> int;
/// You must hold one of these locks while calling Get*Data() below.
class MediaListsLock {
class AssetListLock {
public:
MediaListsLock();
~MediaListsLock();
AssetListLock();
~AssetListLock();
};
/// Load/cache media (make sure you hold a MediaListsLock).
/// Load/cache assets (make sure you hold a AssetListLock).
auto GetTextureData(const std::string& file_name) -> Object::Ref<TextureData>;
auto GetTextureData(TextPacker* packer) -> Object::Ref<TextureData>;
auto GetTextureDataQRCode(const std::string& file_name)
@ -106,32 +106,32 @@ class Media {
// Get system assets.
auto GetTexture(SystemTextureID id) -> TextureData* {
BA_PRECONDITION_FATAL(system_media_loaded_); // Revert to assert later.
BA_PRECONDITION_FATAL(system_assets_loaded_); // Revert to assert later.
assert(InLogicThread());
assert(static_cast<size_t>(id) < system_textures_.size());
return system_textures_[static_cast<int>(id)].get();
}
auto GetCubeMapTexture(SystemCubeMapTextureID id) -> TextureData* {
BA_PRECONDITION_FATAL(system_media_loaded_); // Revert to assert later.
BA_PRECONDITION_FATAL(system_assets_loaded_); // Revert to assert later.
assert(InLogicThread());
assert(static_cast<size_t>(id) < system_cube_map_textures_.size());
return system_cube_map_textures_[static_cast<int>(id)].get();
}
auto GetSound(SystemSoundID id) -> SoundData* {
BA_PRECONDITION_FATAL(system_media_loaded_); // Revert to assert later.
BA_PRECONDITION_FATAL(system_assets_loaded_); // Revert to assert later.
assert(InLogicThread());
assert(static_cast<size_t>(id) < system_sounds_.size());
return system_sounds_[static_cast<int>(id)].get();
}
auto GetModel(SystemModelID id) -> ModelData* {
BA_PRECONDITION_FATAL(system_media_loaded_); // Revert to assert later.
BA_PRECONDITION_FATAL(system_assets_loaded_); // Revert to assert later.
assert(InLogicThread());
assert(static_cast<size_t>(id) < system_models_.size());
return system_models_[static_cast<int>(id)].get();
}
/// Load up hard-coded media for interface, etc.
auto LoadSystemMedia() -> void;
/// Load up hard-coded assets for interface, etc.
auto LoadSystemAssets() -> void;
auto total_model_count() const -> uint32_t {
return static_cast<uint32_t>(models_.size());
@ -148,7 +148,7 @@ class Media {
}
private:
static auto MarkComponentForLoad(MediaComponentData* c) -> void;
static auto MarkComponentForLoad(AssetComponentData* c) -> void;
auto LoadSystemTexture(SystemTextureID id, const char* name) -> void;
auto LoadSystemCubeMapTexture(SystemCubeMapTextureID id, const char* name)
-> void;
@ -158,7 +158,7 @@ class Media {
template <class T>
auto GetComponentPendingLoadCount(
std::unordered_map<std::string, Object::Ref<T> >* t_list, MediaType type)
std::unordered_map<std::string, Object::Ref<T> >* t_list, AssetType type)
-> int;
template <class T>
@ -167,26 +167,26 @@ class Media {
std::unordered_map<std::string, Object::Ref<T> >* c_list)
-> Object::Ref<T>;
std::vector<std::string> media_paths_;
bool have_pending_loads_[static_cast<int>(MediaType::kLast)]{};
std::vector<std::string> asset_paths_;
bool have_pending_loads_[static_cast<int>(AssetType::kLast)]{};
std::unordered_map<std::string, std::string> packages_;
// For use by MediaListsLock; don't manually acquire
std::mutex media_lists_mutex_;
// For use by AssetListLock; don't manually acquire
std::mutex asset_lists_mutex_;
// Will be true while a MediaListsLock exists. Good to debug-verify this
// during any media list access.
bool media_lists_locked_{};
// Will be true while a AssetListLock exists. Good to debug-verify this
// during any asset list access.
bool asset_lists_locked_{};
// 'hard-wired' internal media
bool system_media_loaded_{};
// 'hard-wired' internal assets
bool system_assets_loaded_{};
std::vector<Object::Ref<TextureData> > system_textures_;
std::vector<Object::Ref<TextureData> > system_cube_map_textures_;
std::vector<Object::Ref<SoundData> > system_sounds_;
std::vector<Object::Ref<DataData> > system_datas_;
std::vector<Object::Ref<ModelData> > system_models_;
// All existing media by filename (including internal).
// All existing assets by filename (including internal).
std::unordered_map<std::string, Object::Ref<TextureData> > textures_;
std::unordered_map<std::string, Object::Ref<TextureData> > text_textures_;
std::unordered_map<std::string, Object::Ref<TextureData> > qr_textures_;
@ -198,13 +198,13 @@ class Media {
// Components that have been preloaded but need to be loaded.
std::mutex pending_load_list_mutex_;
std::vector<Object::Ref<MediaComponentData>*> pending_loads_graphics_;
std::vector<Object::Ref<MediaComponentData>*> pending_loads_sounds_;
std::vector<Object::Ref<MediaComponentData>*> pending_loads_datas_;
std::vector<Object::Ref<MediaComponentData>*> pending_loads_other_;
std::vector<Object::Ref<MediaComponentData>*> pending_loads_done_;
std::vector<Object::Ref<AssetComponentData>*> pending_loads_graphics_;
std::vector<Object::Ref<AssetComponentData>*> pending_loads_sounds_;
std::vector<Object::Ref<AssetComponentData>*> pending_loads_datas_;
std::vector<Object::Ref<AssetComponentData>*> pending_loads_other_;
std::vector<Object::Ref<AssetComponentData>*> pending_loads_done_;
};
} // namespace ballistica
#endif // BALLISTICA_MEDIA_MEDIA_H_
#endif // BALLISTICA_ASSETS_ASSETS_H_

View File

@ -1,34 +1,34 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/media_server.h"
#include "ballistica/assets/assets_server.h"
#include "ballistica/assets/assets.h"
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/core/thread.h"
#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"
namespace ballistica {
MediaServer::MediaServer(Thread* thread)
AssetsServer::AssetsServer(Thread* thread)
: thread_(thread),
writing_replay_(false),
replay_message_bytes_(0),
replays_broken_(false),
replay_out_file_(nullptr) {
assert(g_media_server == nullptr);
g_media_server = this;
assert(g_assets_server == nullptr);
g_assets_server = this;
// get our thread to give us periodic processing time...
process_timer_ = this->thread()->NewTimer(
1000, true, NewLambdaRunnable([this] { Process(); }));
}
MediaServer::~MediaServer() = default;
AssetsServer::~AssetsServer() = default;
void MediaServer::PushBeginWriteReplayCall() {
void AssetsServer::PushBeginWriteReplayCall() {
thread()->PushCall([this] {
if (replays_broken_) {
return;
@ -37,7 +37,7 @@ void MediaServer::PushBeginWriteReplayCall() {
// we only allow writing one replay at once; make sure that's actually the
// case
if (writing_replay_) {
Log("MediaServer got BeginWriteReplayCall while already writing");
Log("AssetsServer got BeginWriteReplayCall while already writing");
WriteReplayMessages();
if (replay_out_file_) {
fclose(replay_out_file_);
@ -75,11 +75,12 @@ void MediaServer::PushBeginWriteReplayCall() {
// trigger our process timer to go off immediately
// (we may need to wake it up)
g_media_server->process_timer_->SetLength(0);
g_assets_server->process_timer_->SetLength(0);
});
}
void MediaServer::PushAddMessageToReplayCall(const std::vector<uint8_t>& data) {
void AssetsServer::PushAddMessageToReplayCall(
const std::vector<uint8_t>& data) {
thread()->PushCall([this, data] {
if (replays_broken_) {
return;
@ -87,7 +88,7 @@ void MediaServer::PushAddMessageToReplayCall(const std::vector<uint8_t>& data) {
// sanity check..
if (!writing_replay_) {
Log("MediaServer got AddMessageToReplayCall while not writing replay");
Log("AssetsServer got AddMessageToReplayCall while not writing replay");
replays_broken_ = true;
return;
}
@ -110,7 +111,7 @@ void MediaServer::PushAddMessageToReplayCall(const std::vector<uint8_t>& data) {
});
}
void MediaServer::PushEndWriteReplayCall() {
void AssetsServer::PushEndWriteReplayCall() {
thread()->PushCall([this] {
if (replays_broken_) {
return;
@ -134,7 +135,7 @@ void MediaServer::PushEndWriteReplayCall() {
});
}
void MediaServer::WriteReplayMessages() {
void AssetsServer::WriteReplayMessages() {
if (replay_out_file_) {
for (auto&& i : replay_messages_) {
std::vector<uint8_t> data_compressed = g_utils->huffman()->compress(i);
@ -194,10 +195,10 @@ void MediaServer::WriteReplayMessages() {
}
}
void MediaServer::Process() {
void AssetsServer::Process() {
// make sure we don't do any loading until we know what kind/quality of
// textures we'll be loading
if (!g_media || !g_graphics_server
if (!g_assets || !g_graphics_server
|| !g_graphics_server->texture_compression_types_are_set() // NOLINT
|| !g_graphics_server->texture_quality_set()) {
return;
@ -209,12 +210,12 @@ void MediaServer::Process() {
if (!pending_preloads_.empty()) {
(**pending_preloads_.back()).Preload();
// pass the ref-pointer along to the load queue
g_media->AddPendingLoad(pending_preloads_.back());
g_assets->AddPendingLoad(pending_preloads_.back());
pending_preloads_.pop_back();
} else if (!pending_preloads_audio_.empty()) {
(**pending_preloads_audio_.back()).Preload();
// pass the ref-pointer along to the load queue
g_media->AddPendingLoad(pending_preloads_audio_.back());
g_assets->AddPendingLoad(pending_preloads_audio_.back());
pending_preloads_audio_.pop_back();
}

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_MEDIA_SERVER_H_
#define BALLISTICA_MEDIA_MEDIA_SERVER_H_
#ifndef BALLISTICA_ASSETS_ASSETS_SERVER_H_
#define BALLISTICA_ASSETS_ASSETS_SERVER_H_
#include <list>
#include <vector>
@ -10,10 +10,10 @@
namespace ballistica {
class MediaServer {
class AssetsServer {
public:
explicit MediaServer(Thread* thread);
~MediaServer();
explicit AssetsServer(Thread* thread);
~AssetsServer();
void PushBeginWriteReplayCall();
void PushEndWriteReplayCall();
void PushAddMessageToReplayCall(const std::vector<uint8_t>& data);
@ -30,12 +30,12 @@ class MediaServer {
std::list<std::vector<uint8_t> > replay_messages_;
size_t replay_message_bytes_{};
Timer* process_timer_{};
std::vector<Object::Ref<MediaComponentData>*> pending_preloads_;
std::vector<Object::Ref<MediaComponentData>*> pending_preloads_audio_;
std::vector<Object::Ref<AssetComponentData>*> pending_preloads_;
std::vector<Object::Ref<AssetComponentData>*> pending_preloads_audio_;
friend struct PreloadRunnable;
friend class Media;
friend class Assets;
};
} // namespace ballistica
#endif // BALLISTICA_MEDIA_MEDIA_SERVER_H_
#endif // BALLISTICA_ASSETS_ASSETS_SERVER_H_

View File

@ -1,16 +1,16 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/media_component.h"
#include "ballistica/assets/component/asset_component.h"
#include "ballistica/python/python_sys.h"
#include "ballistica/scene/scene.h"
namespace ballistica {
MediaComponent::MediaComponent(std::string name, Scene* scene)
AssetComponent::AssetComponent(std::string name, Scene* scene)
: name_(std::move(name)), scene_(scene) {}
auto MediaComponent::GetPyRef(bool new_ref) -> PyObject* {
auto AssetComponent::GetPyRef(bool new_ref) -> PyObject* {
if (!py_object_) {
// if we have no python object, create it
py_object_ = CreatePyObject();
@ -22,11 +22,11 @@ auto MediaComponent::GetPyRef(bool new_ref) -> PyObject* {
return py_object_;
}
auto MediaComponent::GetObjectDescription() const -> std::string {
return "<ballistica::" + GetMediaComponentTypeName() + " \"" + name() + "\">";
auto AssetComponent::GetObjectDescription() const -> std::string {
return "<ballistica::" + GetAssetComponentTypeName() + " \"" + name() + "\">";
}
void MediaComponent::ClearPyObject() {
void AssetComponent::ClearPyObject() {
assert(py_object_ != nullptr);
py_object_ = nullptr;
}

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_MEDIA_COMPONENT_H_
#define BALLISTICA_MEDIA_COMPONENT_MEDIA_COMPONENT_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_ASSET_COMPONENT_H_
#define BALLISTICA_ASSETS_COMPONENT_ASSET_COMPONENT_H_
#include <string>
@ -10,9 +10,9 @@
namespace ballistica {
class MediaComponent : public Object {
class AssetComponent : public Object {
public:
MediaComponent(std::string name, Scene* scene);
AssetComponent(std::string name, Scene* scene);
auto name() const -> std::string { return name_; }
// Returns true if this texture was created in the UI context.
@ -41,7 +41,7 @@ class MediaComponent : public Object {
}
protected:
virtual auto GetMediaComponentTypeName() const -> std::string = 0;
virtual auto GetAssetComponentTypeName() const -> std::string = 0;
// Create a python representation of this object.
virtual auto CreatePyObject() -> PyObject* = 0;
@ -60,4 +60,4 @@ class MediaComponent : public Object {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_MEDIA_COMPONENT_H_
#endif // BALLISTICA_ASSETS_COMPONENT_ASSET_COMPONENT_H_

View File

@ -1,6 +1,6 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/collide_model.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/python/class/python_class_collide_model.h"
@ -9,7 +9,7 @@
namespace ballistica {
CollideModel::CollideModel(const std::string& name, Scene* scene)
: MediaComponent(name, scene), dead_(false) {
: AssetComponent(name, scene), dead_(false) {
assert(InLogicThread());
if (scene) {
if (GameStream* os = scene->GetGameStream()) {
@ -17,8 +17,8 @@ CollideModel::CollideModel(const std::string& name, Scene* scene)
}
}
{
Media::MediaListsLock lock;
collide_model_data_ = g_media->GetCollideModelData(name);
Assets::AssetListLock lock;
collide_model_data_ = g_assets->GetCollideModelData(name);
}
assert(collide_model_data_.exists());
}

View File

@ -1,18 +1,18 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_COLLIDE_MODEL_H_
#define BALLISTICA_MEDIA_COMPONENT_COLLIDE_MODEL_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_COLLIDE_MODEL_H_
#define BALLISTICA_ASSETS_COMPONENT_COLLIDE_MODEL_H_
#include <string>
#include "ballistica/media/component/media_component.h"
#include "ballistica/media/data/collide_model_data.h"
#include "ballistica/media/media.h"
#include "ballistica/assets/assets.h"
#include "ballistica/assets/component/asset_component.h"
#include "ballistica/assets/data/collide_model_data.h"
namespace ballistica {
// user-facing collide_model class
class CollideModel : public MediaComponent {
class CollideModel : public AssetComponent {
public:
CollideModel(const std::string& name, Scene* scene);
~CollideModel() override;
@ -23,7 +23,7 @@ class CollideModel : public MediaComponent {
auto collide_model_data() const -> CollideModelData* {
return collide_model_data_.get();
}
auto GetMediaComponentTypeName() const -> std::string override {
auto GetAssetComponentTypeName() const -> std::string override {
return "CollideModel";
}
void MarkDead();
@ -38,4 +38,4 @@ class CollideModel : public MediaComponent {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_COLLIDE_MODEL_H_
#endif // BALLISTICA_ASSETS_COMPONENT_COLLIDE_MODEL_H_

View File

@ -1,19 +1,19 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/cube_map_texture.h"
#include "ballistica/assets/component/cube_map_texture.h"
#include "ballistica/media/media.h"
#include "ballistica/assets/assets.h"
namespace ballistica {
CubeMapTexture::CubeMapTexture(const std::string& name, Scene* scene)
: MediaComponent(name, scene) {
: AssetComponent(name, scene) {
assert(InLogicThread());
// cant currently add these to scenes so nothing to do here..
{
Media::MediaListsLock lock;
texture_data_ = g_media->GetCubeMapTextureData(name);
Assets::AssetListLock lock;
texture_data_ = g_assets->GetCubeMapTextureData(name);
}
assert(texture_data_.exists());
}

View File

@ -1,17 +1,17 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_CUBE_MAP_TEXTURE_H_
#define BALLISTICA_MEDIA_COMPONENT_CUBE_MAP_TEXTURE_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_CUBE_MAP_TEXTURE_H_
#define BALLISTICA_ASSETS_COMPONENT_CUBE_MAP_TEXTURE_H_
#include <string>
#include "ballistica/media/component/media_component.h"
#include "ballistica/media/data/texture_data.h"
#include "ballistica/assets/component/asset_component.h"
#include "ballistica/assets/data/texture_data.h"
namespace ballistica {
// user-facing texture class
class CubeMapTexture : public MediaComponent {
class CubeMapTexture : public AssetComponent {
public:
CubeMapTexture(const std::string& name, Scene* s);
@ -19,7 +19,7 @@ class CubeMapTexture : public MediaComponent {
// note that a texture's data can change over time as different
// versions are spooled in/out/etc
auto GetTextureData() const -> TextureData* { return texture_data_.get(); }
auto GetMediaComponentTypeName() const -> std::string override {
auto GetAssetComponentTypeName() const -> std::string override {
return "CubeMapTexture";
}
@ -29,4 +29,4 @@ class CubeMapTexture : public MediaComponent {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_CUBE_MAP_TEXTURE_H_
#endif // BALLISTICA_ASSETS_COMPONENT_CUBE_MAP_TEXTURE_H_

View File

@ -1,6 +1,6 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/data.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/python/class/python_class_data.h"
@ -9,7 +9,7 @@
namespace ballistica {
Data::Data(const std::string& name, Scene* scene)
: MediaComponent(name, scene), dead_(false) {
: AssetComponent(name, scene), dead_(false) {
assert(InLogicThread());
if (scene) {
@ -18,8 +18,8 @@ Data::Data(const std::string& name, Scene* scene)
}
}
{
Media::MediaListsLock lock;
data_data_ = g_media->GetDataData(name);
Assets::AssetListLock lock;
data_data_ = g_assets->GetDataData(name);
}
assert(data_data_.exists());
}

View File

@ -1,22 +1,22 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_DATA_H_
#define BALLISTICA_MEDIA_COMPONENT_DATA_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_DATA_H_
#define BALLISTICA_ASSETS_COMPONENT_DATA_H_
#include <string>
#include <vector>
#include "ballistica/assets/assets.h"
#include "ballistica/assets/component/asset_component.h"
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/assets/data/data_data.h"
#include "ballistica/ballistica.h"
#include "ballistica/core/object.h"
#include "ballistica/media/component/media_component.h"
#include "ballistica/media/data/data_data.h"
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/media/media.h"
namespace ballistica {
// user-facing data class
class Data : public MediaComponent {
class Data : public AssetComponent {
public:
Data(const std::string& name, Scene* scene);
~Data() override;
@ -25,7 +25,7 @@ class Data : public MediaComponent {
// note that a data's data can change over time as different
// versions are spooled in/out/etc.
auto data_data() const -> DataData* { return data_data_.get(); }
auto GetMediaComponentTypeName() const -> std::string override {
auto GetAssetComponentTypeName() const -> std::string override {
return "Data";
}
void MarkDead();
@ -40,4 +40,4 @@ class Data : public MediaComponent {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_DATA_H_
#endif // BALLISTICA_ASSETS_COMPONENT_DATA_H_

View File

@ -1,6 +1,6 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/model.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/python/class/python_class_model.h"
@ -9,7 +9,7 @@
namespace ballistica {
Model::Model(const std::string& name, Scene* scene)
: MediaComponent(name, scene), dead_(false) {
: AssetComponent(name, scene), dead_(false) {
assert(InLogicThread());
if (scene) {
@ -18,8 +18,8 @@ Model::Model(const std::string& name, Scene* scene)
}
}
{
Media::MediaListsLock lock;
model_data_ = g_media->GetModelData(name);
Assets::AssetListLock lock;
model_data_ = g_assets->GetModelData(name);
}
assert(model_data_.exists());
}

View File

@ -1,23 +1,23 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_MODEL_H_
#define BALLISTICA_MEDIA_COMPONENT_MODEL_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_MODEL_H_
#define BALLISTICA_ASSETS_COMPONENT_MODEL_H_
#include <string>
#include <vector>
#include "ballistica/assets/assets.h"
#include "ballistica/assets/component/asset_component.h"
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/assets/data/model_data.h"
#include "ballistica/assets/data/model_renderer_data.h"
#include "ballistica/ballistica.h"
#include "ballistica/core/object.h"
#include "ballistica/media/component/media_component.h"
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/media/data/model_data.h"
#include "ballistica/media/data/model_renderer_data.h"
#include "ballistica/media/media.h"
namespace ballistica {
// user-facing model class
class Model : public MediaComponent {
class Model : public AssetComponent {
public:
Model(const std::string& name, Scene* scene);
~Model() override;
@ -26,7 +26,7 @@ class Model : public MediaComponent {
// note that a model's data can change over time as different
// versions are spooled in/out/etc
auto model_data() const -> ModelData* { return model_data_.get(); }
auto GetMediaComponentTypeName() const -> std::string override {
auto GetAssetComponentTypeName() const -> std::string override {
return "Model";
}
void MarkDead();
@ -41,4 +41,4 @@ class Model : public MediaComponent {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_MODEL_H_
#endif // BALLISTICA_ASSETS_COMPONENT_MODEL_H_

View File

@ -1,17 +1,17 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/sound.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/assets/assets.h"
#include "ballistica/assets/data/sound_data.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/media/data/sound_data.h"
#include "ballistica/media/media.h"
#include "ballistica/python/class/python_class_sound.h"
#include "ballistica/scene/scene.h"
namespace ballistica {
Sound::Sound(const std::string& name, Scene* scene)
: MediaComponent(name, scene) {
: AssetComponent(name, scene) {
assert(InLogicThread());
if (scene) {
if (GameStream* os = scene->GetGameStream()) {
@ -19,8 +19,8 @@ Sound::Sound(const std::string& name, Scene* scene)
}
}
{
Media::MediaListsLock lock;
sound_data_ = g_media->GetSoundData(name);
Assets::AssetListLock lock;
sound_data_ = g_assets->GetSoundData(name);
}
assert(sound_data_.exists());
}

View File

@ -1,16 +1,16 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_SOUND_H_
#define BALLISTICA_MEDIA_COMPONENT_SOUND_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_SOUND_H_
#define BALLISTICA_ASSETS_COMPONENT_SOUND_H_
#include <string>
#include <vector>
#include "ballistica/media/component/media_component.h"
#include "ballistica/assets/component/asset_component.h"
namespace ballistica {
class Sound : public MediaComponent {
class Sound : public AssetComponent {
public:
Sound(const std::string& name, Scene* scene);
~Sound() override;
@ -19,7 +19,7 @@ class Sound : public MediaComponent {
// Note that a sound's data can change over time as different
// versions are spooled in/out/etc.
auto GetSoundData() const -> SoundData* { return sound_data_.get(); }
auto GetMediaComponentTypeName() const -> std::string override {
auto GetAssetComponentTypeName() const -> std::string override {
return "Sound";
}
void MarkDead();
@ -34,4 +34,4 @@ class Sound : public MediaComponent {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_SOUND_H_
#endif // BALLISTICA_ASSETS_COMPONENT_SOUND_H_

View File

@ -1,6 +1,6 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/component/texture.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/graphics/renderer.h"
@ -10,7 +10,7 @@
namespace ballistica {
Texture::Texture(const std::string& name, Scene* scene)
: MediaComponent(name, scene), dead_(false) {
: AssetComponent(name, scene), dead_(false) {
assert(InLogicThread());
// Add to the provided scene to get a numeric ID.
@ -20,18 +20,18 @@ Texture::Texture(const std::string& name, Scene* scene)
}
}
{
Media::MediaListsLock lock;
texture_data_ = g_media->GetTextureData(name);
Assets::AssetListLock lock;
texture_data_ = g_assets->GetTextureData(name);
}
assert(texture_data_.exists());
}
// qrcode version
Texture::Texture(const std::string& qr_url) : MediaComponent(qr_url, nullptr) {
Texture::Texture(const std::string& qr_url) : AssetComponent(qr_url, nullptr) {
assert(InLogicThread());
{
Media::MediaListsLock lock;
texture_data_ = g_media->GetTextureDataQRCode(qr_url);
Assets::AssetListLock lock;
texture_data_ = g_assets->GetTextureDataQRCode(qr_url);
}
assert(texture_data_.exists());
}

View File

@ -1,17 +1,17 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_COMPONENT_TEXTURE_H_
#define BALLISTICA_MEDIA_COMPONENT_TEXTURE_H_
#ifndef BALLISTICA_ASSETS_COMPONENT_TEXTURE_H_
#define BALLISTICA_ASSETS_COMPONENT_TEXTURE_H_
#include <string>
#include "ballistica/media/component/media_component.h"
#include "ballistica/media/data/texture_data.h"
#include "ballistica/assets/component/asset_component.h"
#include "ballistica/assets/data/texture_data.h"
namespace ballistica {
// User-facing texture class.
class Texture : public MediaComponent {
class Texture : public AssetComponent {
public:
Texture(const std::string& name, Scene* scene);
explicit Texture(const std::string& qr_url);
@ -21,7 +21,7 @@ class Texture : public MediaComponent {
// Note that a texture's data can change over time as different
// versions are spooled in/out/etc.
auto texture_data() const -> TextureData* { return texture_data_.get(); }
auto GetMediaComponentTypeName() const -> std::string override {
auto GetAssetComponentTypeName() const -> std::string override {
return "Texture";
}
void MarkDead();
@ -36,4 +36,4 @@ class Texture : public MediaComponent {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_COMPONENT_TEXTURE_H_
#endif // BALLISTICA_ASSETS_COMPONENT_TEXTURE_H_

View File

@ -1,25 +1,25 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/assets/data/asset_component_data.h"
namespace ballistica {
MediaComponentData::MediaComponentData() {
AssetComponentData::AssetComponentData() {
assert(InLogicThread());
assert(g_media);
assert(g_assets);
last_used_time_ = GetRealTime();
}
MediaComponentData::~MediaComponentData() {
AssetComponentData::~AssetComponentData() {
// at the moment whoever owns the last reference to us
// needs to make sure to unload us before we die..
// I feel like there should be a more elegant solution to that.
assert(g_media);
assert(g_assets);
assert(!locked());
assert(!loaded());
}
void MediaComponentData::Preload(bool already_locked) {
void AssetComponentData::Preload(bool already_locked) {
LockGuard lock(this, already_locked ? LockGuard::Type::kDontLock
: LockGuard::Type::kLock);
if (!preloaded_) {
@ -35,7 +35,7 @@ void MediaComponentData::Preload(bool already_locked) {
}
}
void MediaComponentData::Load(bool already_locked) {
void AssetComponentData::Load(bool already_locked) {
LockGuard lock(this, already_locked ? LockGuard::Type::kDontLock
: LockGuard::Type::kLock);
if (!preloaded_) {
@ -57,7 +57,7 @@ void MediaComponentData::Load(bool already_locked) {
}
}
void MediaComponentData::Unload(bool already_locked) {
void AssetComponentData::Unload(bool already_locked) {
LockGuard lock(this, already_locked ? LockGuard::Type::kDontLock
: LockGuard::Type::kLock);
@ -80,7 +80,7 @@ void MediaComponentData::Unload(bool already_locked) {
}
}
MediaComponentData::LockGuard::LockGuard(MediaComponentData* data, Type type)
AssetComponentData::LockGuard::LockGuard(AssetComponentData* data, Type type)
: data_(data) {
switch (type) {
case kLock: {
@ -100,7 +100,7 @@ MediaComponentData::LockGuard::LockGuard(MediaComponentData* data, Type type)
}
}
MediaComponentData::LockGuard::~LockGuard() {
AssetComponentData::LockGuard::~LockGuard() {
if (holds_lock_) {
data_->Unlock();
}

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_MEDIA_COMPONENT_DATA_H_
#define BALLISTICA_MEDIA_DATA_MEDIA_COMPONENT_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_ASSET_COMPONENT_DATA_H_
#define BALLISTICA_ASSETS_DATA_ASSET_COMPONENT_DATA_H_
#include <mutex>
#include <string>
@ -11,17 +11,17 @@
namespace ballistica {
/// Base class for loadable media components.
class MediaComponentData : public Object {
/// Base class for loadable asset components.
class AssetComponentData : public Object {
public:
MediaComponentData();
~MediaComponentData() override;
AssetComponentData();
~AssetComponentData() override;
void Preload(bool already_locked = false);
void Load(bool already_locked = false);
void Unload(bool already_locked = false);
auto preloaded() const -> bool { return preloaded_; }
auto loaded() const -> bool { return preloaded_ && loaded_; }
virtual auto GetMediaType() const -> MediaType = 0;
virtual auto GetAssetType() const -> AssetType = 0;
// Return name or another identifier. For debugging purposes.
virtual auto GetName() const -> std::string { return "invalid"; }
@ -35,14 +35,14 @@ class MediaComponentData : public Object {
class LockGuard {
public:
enum Type { kLock, kInheritLock, kDontLock };
explicit LockGuard(MediaComponentData* data, Type type = kLock);
explicit LockGuard(AssetComponentData* data, Type type = kLock);
~LockGuard();
// Does this guard hold a lock?
auto holds_lock() const -> bool { return holds_lock_; }
private:
MediaComponentData* data_ = nullptr;
AssetComponentData* data_ = nullptr;
bool holds_lock_ = false;
};
@ -128,9 +128,9 @@ class MediaComponentData : public Object {
bool preloaded_ = false;
bool loaded_ = false;
std::mutex mutex_;
BA_DISALLOW_CLASS_COPIES(MediaComponentData);
BA_DISALLOW_CLASS_COPIES(AssetComponentData);
};
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_MEDIA_COMPONENT_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_ASSET_COMPONENT_DATA_H_

View File

@ -1,15 +1,15 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/collide_model_data.h"
#include "ballistica/assets/data/collide_model_data.h"
#include "ballistica/media/media.h"
#include "ballistica/assets/assets.h"
namespace ballistica {
CollideModelData::CollideModelData(const std::string& file_name_in)
: file_name_(file_name_in) {
file_name_full_ =
g_media->FindMediaFile(Media::FileType::kCollisionModel, file_name_in);
g_assets->FindAssetFile(Assets::FileType::kCollisionModel, file_name_in);
valid_ = true;
}

View File

@ -1,26 +1,26 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_COLLIDE_MODEL_DATA_H_
#define BALLISTICA_MEDIA_DATA_COLLIDE_MODEL_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_COLLIDE_MODEL_DATA_H_
#define BALLISTICA_ASSETS_DATA_COLLIDE_MODEL_DATA_H_
#include <string>
#include <vector>
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/assets/data/asset_component_data.h"
#include "ode/ode.h"
namespace ballistica {
// Loadable model for collision detection.
class CollideModelData : public MediaComponentData {
class CollideModelData : public AssetComponentData {
public:
CollideModelData() = default;
explicit CollideModelData(const std::string& file_name_in);
void DoPreload() override;
void DoLoad() override;
void DoUnload() override;
auto GetMediaType() const -> MediaType override {
return MediaType::kCollideModel;
auto GetAssetType() const -> AssetType override {
return AssetType::kCollideModel;
}
auto GetName() const -> std::string override {
if (!file_name_full_.empty()) {
@ -44,4 +44,4 @@ class CollideModelData : public MediaComponentData {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_COLLIDE_MODEL_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_COLLIDE_MODEL_DATA_H_

View File

@ -1,8 +1,8 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/data_data.h"
#include "ballistica/assets/data/data_data.h"
#include "ballistica/media/media.h"
#include "ballistica/assets/assets.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_sys.h"
@ -10,7 +10,7 @@ namespace ballistica {
DataData::DataData(const std::string& file_name_in) : file_name_(file_name_in) {
file_name_full_ =
g_media->FindMediaFile(Media::FileType::kData, file_name_in);
g_assets->FindAssetFile(Assets::FileType::kData, file_name_in);
valid_ = true;
}

View File

@ -1,16 +1,16 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_DATA_DATA_H_
#define BALLISTICA_MEDIA_DATA_DATA_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_DATA_DATA_H_
#define BALLISTICA_ASSETS_DATA_DATA_DATA_H_
#include <string>
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/python/python_ref.h"
namespace ballistica {
class DataData : public MediaComponentData {
class DataData : public AssetComponentData {
public:
DataData() = default;
explicit DataData(const std::string& file_name_in);
@ -19,7 +19,7 @@ class DataData : public MediaComponentData {
void DoLoad() override;
void DoUnload() override;
auto GetMediaType() const -> MediaType override { return MediaType::kData; }
auto GetAssetType() const -> AssetType override { return AssetType::kData; }
auto GetName() const -> std::string override {
if (!file_name_full_.empty()) {
return file_name_full_;
@ -44,4 +44,4 @@ class DataData : public MediaComponentData {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_DATA_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_DATA_DATA_H_

View File

@ -1,6 +1,6 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/model_data.h"
#include "ballistica/assets/data/model_data.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/renderer.h"
@ -10,7 +10,7 @@ namespace ballistica {
ModelData::ModelData(const std::string& file_name_in)
: file_name_(file_name_in) {
file_name_full_ =
g_media->FindMediaFile(Media::FileType::kModel, file_name_in);
g_assets->FindAssetFile(Assets::FileType::kModel, file_name_in);
valid_ = true;
}

View File

@ -1,24 +1,24 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_MODEL_DATA_H_
#define BALLISTICA_MEDIA_DATA_MODEL_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_MODEL_DATA_H_
#define BALLISTICA_ASSETS_DATA_MODEL_DATA_H_
#include <string>
#include <vector>
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/media/data/model_renderer_data.h"
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/assets/data/model_renderer_data.h"
namespace ballistica {
class ModelData : public MediaComponentData {
class ModelData : public AssetComponentData {
public:
ModelData() = default;
explicit ModelData(const std::string& file_name_in);
void DoPreload() override;
void DoLoad() override;
void DoUnload() override;
auto GetMediaType() const -> MediaType override { return MediaType::kModel; }
auto GetAssetType() const -> AssetType override { return AssetType::kModel; }
auto GetName() const -> std::string override {
if (!file_name_full_.empty()) {
return file_name_full_;
@ -64,4 +64,4 @@ class ModelData : public MediaComponentData {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_MODEL_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_MODEL_DATA_H_

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_MODEL_RENDERER_DATA_H_
#define BALLISTICA_MEDIA_DATA_MODEL_RENDERER_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_MODEL_RENDERER_DATA_H_
#define BALLISTICA_ASSETS_DATA_MODEL_RENDERER_DATA_H_
#include "ballistica/core/object.h"
@ -18,4 +18,4 @@ class ModelRendererData : public Object {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_MODEL_RENDERER_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_MODEL_RENDERER_DATA_H_

View File

@ -1,6 +1,6 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/sound_data.h"
#include "ballistica/assets/data/sound_data.h"
#if BA_ENABLE_AUDIO
#if BA_USE_TREMOR_VORBIS
@ -10,8 +10,8 @@
#endif
#endif // BA_ENABLE_AUDIO
#include "ballistica/assets/assets.h"
#include "ballistica/audio/audio_server.h"
#include "ballistica/media/media.h"
#include "ballistica/python/python.h"
// Need to move away from OpenAL on Apple stuff.
@ -248,7 +248,7 @@ SoundData::SoundData(const std::string& file_name_in)
#endif // BA_ENABLE_AUDIO
last_play_time_(0) {
file_name_full_ =
g_media->FindMediaFile(Media::FileType::kSound, file_name_in);
g_assets->FindAssetFile(Assets::FileType::kSound, file_name_in);
valid_ = true;
}

View File

@ -1,17 +1,17 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_SOUND_DATA_H_
#define BALLISTICA_MEDIA_DATA_SOUND_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_SOUND_DATA_H_
#define BALLISTICA_ASSETS_DATA_SOUND_DATA_H_
#include <string>
#include <vector>
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/audio/al_sys.h"
#include "ballistica/media/data/media_component_data.h"
namespace ballistica {
class SoundData : public MediaComponentData {
class SoundData : public AssetComponentData {
public:
SoundData() = default;
explicit SoundData(const std::string& file_name_in);
@ -20,7 +20,7 @@ class SoundData : public MediaComponentData {
// FIXME: Should make sure the sound_data isn't in use before unloading it.
void DoUnload() override;
auto GetMediaType() const -> MediaType override { return MediaType::kSound; }
auto GetAssetType() const -> AssetType override { return AssetType::kSound; }
auto GetName() const -> std::string override {
if (!file_name_full_.empty())
return file_name_full_;
@ -55,4 +55,4 @@ class SoundData : public MediaComponentData {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_SOUND_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_SOUND_DATA_H_

View File

@ -1,7 +1,9 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/texture_data.h"
#include "ballistica/assets/data/texture_data.h"
#include "ballistica/assets/data/texture_preload_data.h"
#include "ballistica/assets/data/texture_renderer_data.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/renderer.h"
@ -9,8 +11,6 @@
#include "ballistica/graphics/texture/dds.h"
#include "ballistica/graphics/texture/ktx.h"
#include "ballistica/graphics/texture/pvr.h"
#include "ballistica/media/data/texture_preload_data.h"
#include "ballistica/media/data/texture_renderer_data.h"
#include "external/qr_code_generator/QrCode.hpp"
namespace ballistica {
@ -43,7 +43,8 @@ TextureData::TextureData() = default;
TextureData::TextureData(const std::string& file_in, TextureType type_in,
TextureMinQuality min_quality_in)
: file_name_(file_in), type_(type_in), min_quality_(min_quality_in) {
file_name_full_ = g_media->FindMediaFile(Media::FileType::kTexture, file_in);
file_name_full_ =
g_assets->FindAssetFile(Assets::FileType::kTexture, file_in);
valid_ = true;
}

View File

@ -1,17 +1,17 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_TEXTURE_DATA_H_
#define BALLISTICA_MEDIA_DATA_TEXTURE_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_TEXTURE_DATA_H_
#define BALLISTICA_ASSETS_DATA_TEXTURE_DATA_H_
#include <string>
#include <vector>
#include "ballistica/media/data/media_component_data.h"
#include "ballistica/assets/data/asset_component_data.h"
namespace ballistica {
// Loadable texture media component.
class TextureData : public MediaComponentData {
class TextureData : public AssetComponentData {
public:
TextureData();
~TextureData() override;
@ -28,8 +28,8 @@ class TextureData : public MediaComponentData {
auto GetNameFull() const -> std::string override { return file_name_full(); }
auto file_name() const -> const std::string& { return file_name_; }
auto file_name_full() const -> const std::string& { return file_name_full_; }
auto GetMediaType() const -> MediaType override {
return MediaType::kTexture;
auto GetAssetType() const -> AssetType override {
return AssetType::kTexture;
}
void DoPreload() override;
void DoLoad() override;
@ -59,4 +59,4 @@ class TextureData : public MediaComponentData {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_TEXTURE_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_TEXTURE_DATA_H_

View File

@ -1,13 +1,13 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/media/data/texture_preload_data.h"
#include "ballistica/assets/data/texture_preload_data.h"
#if BA_OSTYPE_LINUX
#include <cstring>
#endif
#include "ballistica/assets/component/texture.h"
#include "ballistica/graphics/texture/ktx.h"
#include "ballistica/media/component/texture.h"
namespace ballistica {

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_TEXTURE_PRELOAD_DATA_H_
#define BALLISTICA_MEDIA_DATA_TEXTURE_PRELOAD_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_TEXTURE_PRELOAD_DATA_H_
#define BALLISTICA_ASSETS_DATA_TEXTURE_PRELOAD_DATA_H_
#include "ballistica/ballistica.h"
@ -37,4 +37,4 @@ class TexturePreloadData {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_TEXTURE_PRELOAD_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_TEXTURE_PRELOAD_DATA_H_

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_MEDIA_DATA_TEXTURE_RENDERER_DATA_H_
#define BALLISTICA_MEDIA_DATA_TEXTURE_RENDERER_DATA_H_
#ifndef BALLISTICA_ASSETS_DATA_TEXTURE_RENDERER_DATA_H_
#define BALLISTICA_ASSETS_DATA_TEXTURE_RENDERER_DATA_H_
namespace ballistica {
@ -24,4 +24,4 @@ class TextureRendererData : public Object {
} // namespace ballistica
#endif // BALLISTICA_MEDIA_DATA_TEXTURE_RENDERER_DATA_H_
#endif // BALLISTICA_ASSETS_DATA_TEXTURE_RENDERER_DATA_H_

View File

@ -2,10 +2,10 @@
#include "ballistica/audio/audio.h"
#include "ballistica/assets/data/sound_data.h"
#include "ballistica/audio/audio_server.h"
#include "ballistica/audio/audio_source.h"
#include "ballistica/core/thread.h"
#include "ballistica/media/data/sound_data.h"
namespace ballistica {

View File

@ -3,6 +3,8 @@
#include "ballistica/audio/audio_server.h"
#include "ballistica/app/app.h"
#include "ballistica/assets/assets.h"
#include "ballistica/assets/data/sound_data.h"
#include "ballistica/audio/al_sys.h"
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_source.h"
@ -12,8 +14,6 @@
#include "ballistica/game/game.h"
#include "ballistica/generic/timer.h"
#include "ballistica/math/vector3f.h"
#include "ballistica/media/data/sound_data.h"
#include "ballistica/media/media.h"
// Need to move away from OpenAL on Apple stuff.
#if __clang__
@ -601,7 +601,7 @@ void AudioServer::Process() {
// If we're paused we don't do nothin'.
if (!paused_) {
// Do some loading...
have_pending_loads_ = g_media->RunPendingAudioLoads();
have_pending_loads_ = g_assets->RunPendingAudioLoads();
// Keep that available-sources list filled.
UpdateAvailableSources();
@ -666,7 +666,7 @@ void AudioServer::FadeSoundOut(uint32_t play_id, uint32_t time) {
std::make_pair(play_id, SoundFadeNode(play_id, time, true)));
}
void AudioServer::DeleteMediaComponent(MediaComponentData* c) {
void AudioServer::DeleteAssetComponent(AssetComponentData* c) {
assert(InAudioThread());
c->Unload();
delete c;
@ -1033,7 +1033,7 @@ void AudioServer::ThreadSource::Stop() {
// to free up...
// (we can't kill media-refs outside the main thread)
if (source_sound_) {
assert(g_media);
assert(g_assets);
g_audio_server->AddSoundRefDelete(source_sound_);
source_sound_ = nullptr;
}
@ -1094,7 +1094,7 @@ void AudioServer::PushSetPausedCall(bool pause) {
}
void AudioServer::PushComponentUnloadCall(
const std::vector<Object::Ref<MediaComponentData>*>& components) {
const std::vector<Object::Ref<AssetComponentData>*>& components) {
thread()->PushCall([this, components] {
// Unload all components we were passed...
for (auto&& i : components) {
@ -1102,7 +1102,7 @@ void AudioServer::PushComponentUnloadCall(
}
// ...and then ship these pointers back to the game thread, so it can free
// the references.
g_game->PushFreeMediaComponentRefsCall(components);
g_game->PushFreeAssetComponentRefsCall(components);
});
}

View File

@ -37,7 +37,7 @@ class AudioServer {
void PushResetCall();
void PushHavePendingLoadsCall();
void PushComponentUnloadCall(
const std::vector<Object::Ref<MediaComponentData>*>& components);
const std::vector<Object::Ref<AssetComponentData>*>& components);
/// For use by g_game_module().
void ClearSoundRefDeleteList();
@ -89,7 +89,7 @@ class AudioServer {
void Process();
/// Send a component to the audio thread to delete.
void DeleteMediaComponent(MediaComponentData* c);
void DeleteAssetComponent(AssetComponentData* c);
void UpdateTimerInterval();
void UpdateAvailableSources();

View File

@ -2,10 +2,10 @@
#include "ballistica/audio/audio_source.h"
#include "ballistica/assets/data/sound_data.h"
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_server.h"
#include "ballistica/math/vector3f.h"
#include "ballistica/media/data/sound_data.h"
namespace ballistica {

View File

@ -5,6 +5,8 @@
#include <map>
#include "ballistica/app/app_flavor.h"
#include "ballistica/assets/assets.h"
#include "ballistica/assets/assets_server.h"
#include "ballistica/audio/audio_server.h"
#include "ballistica/core/fatal_error.h"
#include "ballistica/core/logging.h"
@ -13,8 +15,6 @@
#include "ballistica/game/v1_account.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/internal/app_internal.h"
#include "ballistica/media/media.h"
#include "ballistica/media/media_server.h"
#include "ballistica/networking/network_writer.h"
#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
@ -23,7 +23,7 @@
namespace ballistica {
// These are set automatically via script; don't modify them here.
const int kAppBuildNumber = 20803;
const int kAppBuildNumber = 20806;
const char* kAppVersion = "1.7.7";
// Our standalone globals.
@ -45,8 +45,8 @@ Graphics* g_graphics{};
GraphicsServer* g_graphics_server{};
Input* g_input{};
Thread* g_main_thread{};
Media* g_media{};
MediaServer* g_media_server{};
Assets* g_assets{};
AssetsServer* g_assets_server{};
NetworkReader* g_network_reader{};
Networking* g_networking{};
NetworkWriteModule* g_network_writer{};
@ -65,12 +65,12 @@ Utils* g_utils{};
// This event kicks off an initial-screen-creation message sent to the
// graphics-server thread. Other systems are informed that bootstrapping
// is complete and that they are free to talk to each other. Initial
// input-devices are added, media loads can begin (at least ones not
// input-devices are added, asset loads can begin (at least ones not
// dependent on the screen/renderer), etc.
// 3: The initial screen is created on the graphics-server thread in response
// to the message sent from the game thread. A completion notice is sent
// back to the game thread when done.
// 4: Back on the game thread, any renderer-dependent media-loads/etc. can begin
// 4: Back on the game thread, any renderer-dependent asset-loads/etc. can begin
// and lastly the initial game session is kicked off.
auto BallisticaMain(int argc, char** argv) -> int {
@ -107,12 +107,12 @@ auto BallisticaMain(int argc, char** argv) -> int {
// Various other subsystems.
g_v1_account = new V1Account();
g_utils = new Utils();
g_media = new Media();
g_assets = new Assets();
Scene::Init();
// Spin up our other standard threads.
auto* media_thread{new Thread(ThreadIdentifier::kMedia)};
g_app->pausable_threads.push_back(media_thread);
auto* assets_thread{new Thread(ThreadIdentifier::kAssets)};
g_app->pausable_threads.push_back(assets_thread);
auto* audio_thread{new Thread(ThreadIdentifier::kAudio)};
g_app->pausable_threads.push_back(audio_thread);
auto* logic_thread{new Thread(ThreadIdentifier::kLogic)};
@ -126,8 +126,8 @@ auto BallisticaMain(int argc, char** argv) -> int {
network_write_thread->PushCallSynchronous([network_write_thread] {
new NetworkWriteModule(network_write_thread);
});
media_thread->PushCallSynchronous(
[media_thread] { new MediaServer(media_thread); });
assets_thread->PushCallSynchronous(
[assets_thread] { new AssetsServer(assets_thread); });
new GraphicsServer(g_main_thread);
audio_thread->PushCallSynchronous(
[audio_thread] { new AudioServer(audio_thread); });
@ -277,8 +277,8 @@ auto InBGDynamicsThread() -> bool {
return (g_bg_dynamics_server && g_bg_dynamics_server->thread()->IsCurrent());
}
auto InMediaThread() -> bool {
return (g_media_server && g_media_server->thread()->IsCurrent());
auto InAssetsThread() -> bool {
return (g_assets_server && g_assets_server->thread()->IsCurrent());
}
auto InNetworkWriteThread() -> bool {

View File

@ -118,8 +118,8 @@ extern Graphics* g_graphics;
extern GraphicsServer* g_graphics_server;
extern Input* g_input;
extern Thread* g_main_thread;
extern Media* g_media;
extern MediaServer* g_media_server;
extern Assets* g_assets;
extern AssetsServer* g_assets_server;
extern Networking* g_networking;
extern NetworkReader* g_network_reader;
extern NetworkWriteModule* g_network_writer;
@ -158,7 +158,7 @@ auto InGraphicsThread() -> bool; // (main and graphics are same currently)
auto InLogicThread() -> bool;
auto InAudioThread() -> bool;
auto InBGDynamicsThread() -> bool;
auto InMediaThread() -> bool;
auto InAssetsThread() -> bool;
auto InNetworkWriteThread() -> bool;
/// Return a human-readable name for the current thread.

View File

@ -150,8 +150,8 @@ static auto GetCurrentThreadIdentifier() -> ThreadIdentifier {
return ThreadIdentifier::kAudio;
} else if (InNetworkWriteThread()) {
return ThreadIdentifier::kNetworkWrite;
} else if (InMediaThread()) {
return ThreadIdentifier::kMedia;
} else if (InAssetsThread()) {
return ThreadIdentifier::kAssets;
} else if (InBGDynamicsThread()) {
return ThreadIdentifier::kBGDynamics;
} else {
@ -209,9 +209,9 @@ auto Object::ObjectThreadCheck() -> void {
DO_FAIL("NetworkWrite");
}
break;
case ThreadIdentifier::kMedia:
if (!InMediaThread()) {
DO_FAIL("Media");
case ThreadIdentifier::kAssets:
if (!InAssetsThread()) {
DO_FAIL("Assets");
}
break;
case ThreadIdentifier::kBGDynamics:

View File

@ -59,7 +59,7 @@ auto Thread::RunStdInputThread(void* data) -> int {
return static_cast<Thread*>(data)->ThreadMain();
}
auto Thread::RunMediaThread(void* data) -> int {
auto Thread::RunAssetsThread(void* data) -> int {
return static_cast<Thread*>(data)->ThreadMain();
}
@ -221,8 +221,8 @@ Thread::Thread(ThreadIdentifier identifier_in, ThreadType type_in)
case ThreadIdentifier::kLogic:
func = RunLogicThread;
break;
case ThreadIdentifier::kMedia:
func = RunMediaThread;
case ThreadIdentifier::kAssets:
func = RunAssetsThread;
break;
case ThreadIdentifier::kMain:
// Shouldn't happen; this thread gets wrapped; not launched.
@ -288,9 +288,9 @@ auto Thread::ThreadMain() -> int {
name = "stdin";
id_string = "ballistica stdin";
break;
case ThreadIdentifier::kMedia:
name = "media";
id_string = "ballistica media";
case ThreadIdentifier::kAssets:
name = "assets";
id_string = "ballistica assets";
break;
case ThreadIdentifier::kFileOut:
name = "fileout";

View File

@ -152,7 +152,7 @@ class Thread {
static auto RunBGDynamicThread(void* data) -> int;
static auto RunNetworkWriteThread(void* data) -> int;
static auto RunStdInputThread(void* data) -> int;
static auto RunMediaThread(void* data) -> int;
static auto RunAssetsThread(void* data) -> int;
auto ThreadMain() -> int;
auto GetThreadMessages(std::list<ThreadMessage>* messages) -> void;

View File

@ -39,6 +39,7 @@ class AppConfig;
class App;
class AppInternal;
class AreaOfInterest;
class Assets;
class Audio;
class AudioServer;
class AudioStreamer;
@ -102,9 +103,8 @@ class MaterialComponent;
class MaterialConditionNode;
class MaterialContext;
class Matrix44f;
class Media;
class MediaComponentData;
class MediaServer;
class AssetComponentData;
class AssetsServer;
class MeshBufferBase;
class MeshBufferVertexSprite;
class MeshBufferVertexSimpleFull;
@ -403,7 +403,7 @@ enum class SpecialChar {
kLast // Sentinel
};
enum class MediaType { kTexture, kCollideModel, kModel, kSound, kData, kLast };
enum class AssetType { kTexture, kCollideModel, kModel, kSound, kData, kLast };
/// Python exception types we can raise from our own exceptions.
enum class PyExcType {
@ -999,7 +999,7 @@ enum class ThreadType {
enum class ThreadIdentifier {
kInvalid,
kLogic,
kMedia,
kAssets,
kFileOut,
kMain,
kAudio,

View File

@ -2,6 +2,7 @@
#include "ballistica/dynamics/bg/bg_dynamics.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/core/thread.h"
#include "ballistica/dynamics/bg/bg_dynamics_draw_snapshot.h"
#include "ballistica/dynamics/bg/bg_dynamics_fuse_data.h"
@ -10,7 +11,6 @@
#include "ballistica/graphics/component/object_component.h"
#include "ballistica/graphics/component/smoke_component.h"
#include "ballistica/graphics/component/sprite_component.h"
#include "ballistica/media/component/collide_model.h"
namespace ballistica {
@ -188,7 +188,7 @@ void BGDynamics::Draw(FrameDef* frame_def) {
c.SetCameraAligned(true);
c.SetColor(2.0f, 2.0f, 2.0f, 1.0f);
c.SetOverlay(draw_in_overlay);
c.SetTexture(g_media->GetTexture(SystemTextureID::kSparks));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kSparks));
c.DrawMesh(sparks_mesh_.get(), kModelDrawFlagNoReflection);
c.Submit();
}
@ -203,7 +203,7 @@ void BGDynamics::Draw(FrameDef* frame_def) {
lights_mesh_->SetData(
Object::Ref<MeshBuffer<VertexSprite>>(ds->light_vertices));
SpriteComponent c(frame_def->light_shadow_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kLightSoft));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kLightSoft));
c.DrawMesh(lights_mesh_.get());
c.Submit();
}
@ -216,7 +216,7 @@ void BGDynamics::Draw(FrameDef* frame_def) {
shadows_mesh_->SetData(
Object::Ref<MeshBuffer<VertexSprite>>(ds->shadow_vertices));
SpriteComponent c(frame_def->light_shadow_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kLight));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kLight));
c.DrawMesh(shadows_mesh_.get());
c.Submit();
}
@ -268,7 +268,7 @@ void BGDynamics::Draw(FrameDef* frame_def) {
Object::Ref<MeshBuffer<VertexSimpleFull>>(ds->fuse_vertices));
{ // Draw!
ObjectComponent c(frame_def->beauty_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kFuse));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kFuse));
c.DrawMesh(fuses_mesh_.get(), kModelDrawFlagNoReflection);
c.Submit();
}
@ -286,16 +286,16 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
ModelData* model;
switch (chunk_type) {
case BGDynamicsChunkType::kFlagStand:
model = g_media->GetModel(SystemModelID::kFlagStand);
model = g_assets->GetModel(SystemModelID::kFlagStand);
break;
case BGDynamicsChunkType::kSplinter:
model = g_media->GetModel(SystemModelID::kShrapnelBoard);
model = g_assets->GetModel(SystemModelID::kShrapnelBoard);
break;
case BGDynamicsChunkType::kSlime:
model = g_media->GetModel(SystemModelID::kShrapnelSlime);
model = g_assets->GetModel(SystemModelID::kShrapnelSlime);
break;
default:
model = g_media->GetModel(SystemModelID::kShrapnel1);
model = g_assets->GetModel(SystemModelID::kShrapnel1);
break;
}
ObjectComponent c(frame_def->beauty_pass());
@ -303,20 +303,20 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
// Set up shading.
switch (chunk_type) {
case BGDynamicsChunkType::kRock: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kSoft);
c.SetReflectionScale(0.2f, 0.2f, 0.2f);
c.SetColor(0.6f, 0.6f, 0.5f);
break;
}
case BGDynamicsChunkType::kIce: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kSharp);
c.SetAddColor(0.5f, 0.5f, 0.9f);
break;
}
case BGDynamicsChunkType::kSlime: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kSharper);
c.SetReflectionScale(3.0f, 3.0f, 3.0f);
c.SetColor(0.0f, 0.0f, 0.0f);
@ -324,13 +324,13 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
break;
}
case BGDynamicsChunkType::kMetal: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kPowerup);
c.SetColor(0.5f, 0.5f, 0.55f);
break;
}
case BGDynamicsChunkType::kSpark: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kSharp);
c.SetColor(0.0f, 0.0f, 0.0f, 1.0f);
c.SetReflectionScale(4.0f, 3.0f, 2.0f);
@ -338,7 +338,7 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
break;
}
case BGDynamicsChunkType::kSplinter: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kSoft);
c.SetColor(1.0f, 0.8f, 0.5f);
break;
@ -347,7 +347,7 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
c.SetTransparent(true);
c.SetPremultiplied(true);
c.SetLightShadow(LightShadowType::kNone);
c.SetTexture(g_media->GetTexture(SystemTextureID::kShrapnel1));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kShrapnel1));
c.SetReflection(ReflectionType::kSharp);
c.SetReflectionScale(0.5f, 0.4f, 0.3f);
c.SetColor(0.2f, 0.15f, 0.15f, 0.07f);
@ -355,7 +355,7 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
break;
}
case BGDynamicsChunkType::kFlagStand: {
c.SetTexture(g_media->GetTexture(SystemTextureID::kFlagPole));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kFlagPole));
c.SetReflection(ReflectionType::kSharp);
c.SetColor(0.9f, 0.6f, 0.3f, 1.0f);
break;

View File

@ -2,6 +2,7 @@
#include "ballistica/dynamics/bg/bg_dynamics_server.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/core/thread.h"
#include "ballistica/dynamics/bg/bg_dynamics_draw_snapshot.h"
#include "ballistica/dynamics/bg/bg_dynamics_fuse_data.h"
@ -12,7 +13,6 @@
#include "ballistica/game/game.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/media/component/collide_model.h"
namespace ballistica {

View File

@ -36,7 +36,7 @@ void CollisionCache::Draw(FrameDef* frame_def) {
c.Scale(x_max_ - x_min_, 1, z_max_ - z_min_);
c.PushTransform();
c.Scale(1, 0.01f, 1);
c.DrawModel(g_media->GetModel(SystemModelID::kBox));
c.DrawModel(g_assets->GetModel(SystemModelID::kBox));
c.PopTransform();
c.Translate(-0.5f + 0.5f * cell_width, 0, -0.5f + 0.5f * cell_height);
for (int x = 0; x < grid_width_; x++) {
@ -53,7 +53,7 @@ void CollisionCache::Draw(FrameDef* frame_def) {
cells_[cell_index].height_confirmed_collide_,
static_cast<float>(z) / static_cast<float>(grid_height_));
c.Scale(0.95f * cell_width, 0.01f, 0.95f * cell_height);
c.DrawModel(g_media->GetModel(SystemModelID::kBox));
c.DrawModel(g_assets->GetModel(SystemModelID::kBox));
c.PopTransform();
if (glow_[cell_index]) {
c.SetColor(1, 1, 1, 0.2f);
@ -65,7 +65,7 @@ void CollisionCache::Draw(FrameDef* frame_def) {
cells_[cell_index].height_confirmed_empty_,
static_cast<float>(z) / static_cast<float>(grid_height_));
c.Scale(0.95f * cell_width, 0.01f, 0.95f * cell_height);
c.DrawModel(g_media->GetModel(SystemModelID::kBox));
c.DrawModel(g_assets->GetModel(SystemModelID::kBox));
c.PopTransform();
glow_[cell_index] = 0;
}
@ -84,7 +84,7 @@ void CollisionCache::Draw(FrameDef* frame_def) {
c2.Scale(x_max_ - x_min_, 1, z_max_ - z_min_);
c2.PushTransform();
c2.Scale(1, 0.01f, 1);
c2.DrawModel(g_media->GetModel(SystemModelID::kBox));
c2.DrawModel(g_assets->GetModel(SystemModelID::kBox));
c2.PopTransform();
c2.Translate(-0.5f + 0.5f * cell_width2, 0, -0.5f + 0.5f * cell_height2);
for (int x = 0; x < grid_width_; x++) {
@ -101,7 +101,7 @@ void CollisionCache::Draw(FrameDef* frame_def) {
cells_[cell_index].height_confirmed_empty_,
static_cast<float>(z) / static_cast<float>(grid_height_));
c2.Scale(0.95f * cell_width2, 0.01f, 0.95f * cell_height2);
c2.DrawModel(g_media->GetModel(SystemModelID::kBox));
c2.DrawModel(g_assets->GetModel(SystemModelID::kBox));
c2.PopTransform();
if (glow_[cell_index]) {
c2.SetColor(1, 1, 1, 0.2f);
@ -113,7 +113,7 @@ void CollisionCache::Draw(FrameDef* frame_def) {
cells_[cell_index].height_confirmed_collide_,
static_cast<float>(z) / static_cast<float>(grid_height_));
c2.Scale(0.95f * cell_width2, 0.01f, 0.95f * cell_height2);
c2.DrawModel(g_media->GetModel(SystemModelID::kBox));
c2.DrawModel(g_assets->GetModel(SystemModelID::kBox));
c2.PopTransform();
glow_[cell_index] = 0;

View File

@ -2,6 +2,7 @@
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/audio/audio.h"
#include "ballistica/audio/audio_source.h"
#include "ballistica/dynamics/collision.h"
@ -9,7 +10,6 @@
#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/dynamics/part.h"
#include "ballistica/graphics/renderer.h"
#include "ballistica/media/component/sound.h"
#include "ballistica/scene/scene.h"
#include "ode/ode_collision_kernel.h"
#include "ode/ode_collision_util.h"
@ -157,7 +157,7 @@ void Dynamics::Draw(FrameDef* frame_def) {
c.PushTransform();
c.Translate(i.x(), i.y(), i.z());
c.scaleUniform(0.05f);
c.DrawModel(g_media->GetModel(Media::BOX_MODEL));
c.DrawModel(g_assets->GetModel(Assets::BOX_MODEL));
c.PopTransform();
}
c.Submit();

View File

@ -5,9 +5,9 @@
#include <vector>
#include "ballistica/assets/component/sound.h"
#include "ballistica/ballistica.h"
#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/media/component/sound.h"
namespace ballistica {

View File

@ -2,10 +2,10 @@
#include "ballistica/dynamics/material/material_context.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/audio/audio.h"
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/media/component/sound.h"
#include "ballistica/scene/scene.h"
namespace ballistica {

View File

@ -2,13 +2,13 @@
#include "ballistica/dynamics/material/roll_sound_material_action.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/material/material_context.h"
#include "ballistica/game/game_stream.h"
#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 {

View File

@ -3,9 +3,9 @@
#ifndef BALLISTICA_DYNAMICS_MATERIAL_ROLL_SOUND_MATERIAL_ACTION_H_
#define BALLISTICA_DYNAMICS_MATERIAL_ROLL_SOUND_MATERIAL_ACTION_H_
#include "ballistica/assets/component/sound.h"
#include "ballistica/ballistica.h"
#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/media/component/sound.h"
namespace ballistica {

View File

@ -3,9 +3,9 @@
#ifndef BALLISTICA_DYNAMICS_MATERIAL_SKID_SOUND_MATERIAL_ACTION_H_
#define BALLISTICA_DYNAMICS_MATERIAL_SKID_SOUND_MATERIAL_ACTION_H_
#include "ballistica/assets/component/sound.h"
#include "ballistica/ballistica.h"
#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/media/component/sound.h"
namespace ballistica {

View File

@ -3,9 +3,9 @@
#ifndef BALLISTICA_DYNAMICS_MATERIAL_SOUND_MATERIAL_ACTION_H_
#define BALLISTICA_DYNAMICS_MATERIAL_SOUND_MATERIAL_ACTION_H_
#include "ballistica/assets/component/sound.h"
#include "ballistica/ballistica.h"
#include "ballistica/dynamics/material/material_action.h"
#include "ballistica/media/component/sound.h"
namespace ballistica {

View File

@ -2,11 +2,11 @@
#include "ballistica/dynamics/rigid_body.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/dynamics/dynamics.h"
#include "ballistica/dynamics/part.h"
#include "ballistica/generic/utils.h"
#include "ballistica/graphics/renderer.h"
#include "ballistica/media/component/collide_model.h"
#include "ballistica/scene/scene.h"
#include "ode/ode_collision_util.h"

View File

@ -2,6 +2,7 @@
#include "ballistica/game/connection/connection_to_client.h"
#include "ballistica/assets/assets.h"
#include "ballistica/audio/audio.h"
#include "ballistica/game/client_controller_interface.h"
#include "ballistica/game/connection/connection_set.h"
@ -11,7 +12,6 @@
#include "ballistica/generic/json.h"
#include "ballistica/input/device/client_input_device.h"
#include "ballistica/internal/app_internal.h"
#include "ballistica/media/media.h"
#include "ballistica/networking/networking.h"
#include "ballistica/python/python.h"
#include "ballistica/python/python_sys.h"
@ -73,7 +73,7 @@ ConnectionToClient::~ConnectionToClient() {
std::string s = g_game->GetResourceString("playerLeftPartyText");
Utils::StringReplaceOne(&s, "${NAME}", peer_spec().GetDisplayString());
ScreenMessage(s, {1, 0.5f, 0.0f});
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kCorkPop));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kCorkPop));
}
}
@ -215,7 +215,7 @@ void ConnectionToClient::HandleGamePacket(const std::vector<uint8_t>& data) {
Utils::StringReplaceOne(&s, "${NAME}",
peer_spec().GetDisplayString());
ScreenMessage(s, {0.5f, 1, 0.5f});
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kGunCock));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kGunCock));
}
// Also mark the time for flashing the 'someone just joined your

View File

@ -2,6 +2,7 @@
#include "ballistica/game/connection/connection_to_host.h"
#include "ballistica/assets/assets.h"
#include "ballistica/audio/audio.h"
#include "ballistica/game/game.h"
#include "ballistica/game/session/net_client_session.h"
@ -10,7 +11,6 @@
#include "ballistica/input/input.h"
#include "ballistica/internal/app_internal.h"
#include "ballistica/math/vector3f.h"
#include "ballistica/media/media.h"
#include "ballistica/networking/networking.h"
#include "ballistica/platform/platform.h"
#include "ballistica/python/python.h"
@ -39,7 +39,7 @@ ConnectionToHost::~ConnectionToHost() {
Utils::StringReplaceOne(&s, "${NAME}", peer_spec().GetDisplayString());
}
ScreenMessage(s, {1, 0.5f, 0.0f});
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kCorkPop));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kCorkPop));
} else {
ScreenMessage(g_game->GetResourceString("connectionRejectedText"),
{1, 0, 0});
@ -376,7 +376,7 @@ void ConnectionToHost::HandleMessagePacket(const std::vector<uint8_t>& buffer) {
Utils::StringReplaceOne(
&s, "${NAME}", PlayerSpec(str_buffer.data()).GetDisplayString());
ScreenMessage(s, {0.5f, 1.0f, 0.5f});
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kGunCock));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kGunCock));
}
break;
}
@ -391,7 +391,7 @@ void ConnectionToHost::HandleMessagePacket(const std::vector<uint8_t>& buffer) {
Utils::StringReplaceOne(
&s, "${NAME}", PlayerSpec(&(str_buffer[0])).GetDisplayString());
ScreenMessage(s, {1, 0.5f, 0.0f});
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kCorkPop));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kCorkPop));
}
break;
}
@ -486,7 +486,7 @@ void ConnectionToHost::HandleMessagePacket(const std::vector<uint8_t>& buffer) {
Utils::StringReplaceOne(&s, "${NAME}", peer_spec().GetDisplayString());
}
ScreenMessage(s, {0.5f, 1, 0.5f});
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kGunCock));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kGunCock));
printed_connect_message_ = true;
}

View File

@ -262,7 +262,7 @@ void Game::PushVRHandsState(const VRHandsState& state) {
void Game::PushMediaPruneCall(int level) {
thread()->PushCall([level] {
assert(InLogicThread());
g_media->Prune(level);
g_assets->Prune(level);
});
}
@ -288,7 +288,7 @@ void Game::InitialScreenCreated() {
// We can now let the media thread go to town pre-loading system media
// while we wait.
g_media->LoadSystemMedia();
g_assets->LoadSystemAssets();
// FIXME: ideally we should create this as part of bootstrapping, but
// we need it to be possible to load textures/etc. before the renderer
@ -315,7 +315,7 @@ void Game::InitialScreenCreated() {
RunAppLaunchCommands();
}
void Game::PruneMedia() { g_media->Prune(); }
void Game::PruneMedia() { g_assets->Prune(); }
// Launch into main menu or whatever else.
void Game::RunAppLaunchCommands() {
@ -1188,7 +1188,8 @@ void Game::ScoresToBeatResponse(bool success,
}
void Game::PushPlaySoundCall(SystemSoundID sound) {
thread()->PushCall([sound] { g_audio->PlaySound(g_media->GetSound(sound)); });
thread()->PushCall(
[sound] { g_audio->PlaySound(g_assets->GetSound(sound)); });
}
void Game::PushFriendScoreSetCall(const FriendScoreSet& score_set) {
@ -1214,7 +1215,7 @@ void Game::PushConfirmQuitCall() {
// this needs to be run in the UI context
ScopedSetContext cp(GetUIContextTarget());
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kSwish));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kSwish));
g_python->obj(Python::ObjID::kQuitWindowCall).Call();
// if we have a keyboard, give it UI ownership
@ -1443,8 +1444,8 @@ void Game::PushRemoveGraphicsServerRenderHoldCall() {
});
}
void Game::PushFreeMediaComponentRefsCall(
const std::vector<Object::Ref<MediaComponentData>*>& components) {
void Game::PushFreeAssetComponentRefsCall(
const std::vector<Object::Ref<AssetComponentData>*>& components) {
thread()->PushCall([components] {
for (auto&& i : components) {
delete i;
@ -1453,7 +1454,7 @@ void Game::PushFreeMediaComponentRefsCall(
}
void Game::PushHavePendingLoadsDoneCall() {
thread()->PushCall([] { g_media->ClearPendingLoadsDoneList(); });
thread()->PushCall([] { g_assets->ClearPendingLoadsDoneList(); });
}
void Game::ToggleConsole() {
@ -1548,7 +1549,7 @@ void Game::SetRealTimerLength(int timer_id, millisecs_t length) {
}
void Game::Process() {
have_pending_loads_ = g_media->RunPendingLoadsLogicThread();
have_pending_loads_ = g_assets->RunPendingLoadsLogicThread();
UpdateProcessTimer();
}
@ -1886,7 +1887,7 @@ void Game::LocalDisplayChatMessage(const std::vector<uint8_t>& buffer) {
g_python->HandleLocalChatMessage(final_message);
}
if (!chat_muted_) {
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kTap));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kTap));
}
}
}

View File

@ -61,8 +61,8 @@ class Game {
auto PushToggleDebugInfoDisplayCall() -> void;
auto PushToggleManualCameraCall() -> void;
auto PushHavePendingLoadsDoneCall() -> void;
auto PushFreeMediaComponentRefsCall(
const std::vector<Object::Ref<MediaComponentData>*>& components) -> void;
auto PushFreeAssetComponentRefsCall(
const std::vector<Object::Ref<AssetComponentData>*>& components) -> void;
auto PushHavePendingLoadsCall() -> void;
auto PushShutdownCall(bool soft) -> void;

View File

@ -3,6 +3,12 @@
#include "ballistica/game/game_stream.h"
#include "ballistica/app/app.h"
#include "ballistica/assets/assets_server.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/dynamics/bg/bg_dynamics.h"
#include "ballistica/dynamics/material/material.h"
#include "ballistica/dynamics/material/material_action.h"
@ -12,12 +18,6 @@
#include "ballistica/game/connection/connection_set.h"
#include "ballistica/game/connection/connection_to_client.h"
#include "ballistica/game/session/host_session.h"
#include "ballistica/media/component/collide_model.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/media/media_server.h"
#include "ballistica/networking/networking.h"
#include "ballistica/scene/node/node_attribute.h"
#include "ballistica/scene/node/node_type.h"
@ -37,8 +37,8 @@ GameStream::GameStream(HostSession* host_session, bool save_replay)
if (g_app->replay_open) {
Log("ERROR: g_replay_open true at replay start; shouldn't happen.");
}
assert(g_media_server);
g_media_server->PushBeginWriteReplayCall();
assert(g_assets_server);
g_assets_server->PushBeginWriteReplayCall();
writing_replay_ = true;
g_app->replay_open = true;
}
@ -60,8 +60,8 @@ GameStream::~GameStream() {
Log("ERROR: g_replay_open false at replay close; shouldn't happen.");
}
g_app->replay_open = false;
assert(g_media_server);
g_media_server->PushEndWriteReplayCall();
assert(g_assets_server);
g_assets_server->PushEndWriteReplayCall();
writing_replay_ = false;
}
@ -192,8 +192,8 @@ void GameStream::Fail() {
if (!g_app->replay_open) {
Log("ERROR: g_replay_open false at replay close; shouldn't happen.");
}
assert(g_media_server);
g_media_server->PushEndWriteReplayCall();
assert(g_assets_server);
g_assets_server->PushEndWriteReplayCall();
writing_replay_ = false;
g_app->replay_open = false;
}
@ -374,7 +374,7 @@ void GameStream::ShipSessionCommandsMessage() {
void GameStream::AddMessageToReplay(const std::vector<uint8_t>& message) {
assert(writing_replay_);
assert(g_media_server);
assert(g_assets_server);
assert(!message.empty());
if (g_buildconfig.debug_build()) {
@ -389,7 +389,7 @@ void GameStream::AddMessageToReplay(const std::vector<uint8_t>& message) {
}
}
g_media_server->PushAddMessageToReplayCall(message);
g_assets_server->PushAddMessageToReplayCall(message);
}
void GameStream::SendPhysicsCorrection(bool blend) {

View File

@ -2,6 +2,11 @@
#include "ballistica/game/host_activity.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/dynamics/material/material.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/game/player.h"
@ -9,11 +14,6 @@
#include "ballistica/generic/lambda_runnable.h"
#include "ballistica/generic/timer.h"
#include "ballistica/input/device/input_device.h"
#include "ballistica/media/component/collide_model.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/python/python_context_call.h"
#include "ballistica/python/python_sys.h"
@ -183,28 +183,28 @@ auto HostActivity::GetTexture(const std::string& name) -> Object::Ref<Texture> {
if (shutting_down_) {
throw Exception("can't load assets during activity shutdown");
}
return Media::GetMedia(&textures_, name, scene());
return Assets::GetAsset(&textures_, name, scene());
}
auto HostActivity::GetSound(const std::string& name) -> Object::Ref<Sound> {
if (shutting_down_) {
throw Exception("can't load assets during activity shutdown");
}
return Media::GetMedia(&sounds_, name, scene());
return Assets::GetAsset(&sounds_, name, scene());
}
auto HostActivity::GetData(const std::string& name) -> Object::Ref<Data> {
if (shutting_down_) {
throw Exception("can't load assets during activity shutdown");
}
return Media::GetMedia(&datas_, name, scene());
return Assets::GetAsset(&datas_, name, scene());
}
auto HostActivity::GetModel(const std::string& name) -> Object::Ref<Model> {
if (shutting_down_) {
throw Exception("can't load assets during activity shutdown");
}
return Media::GetMedia(&models_, name, scene());
return Assets::GetAsset(&models_, name, scene());
}
auto HostActivity::GetCollideModel(const std::string& name)
@ -212,7 +212,7 @@ auto HostActivity::GetCollideModel(const std::string& name)
if (shutting_down_) {
throw Exception("can't load assets during activity shutdown");
}
return Media::GetMedia(&collide_models_, name, scene());
return Assets::GetAsset(&collide_models_, name, scene());
}
void HostActivity::SetPaused(bool val) {

View File

@ -3,6 +3,10 @@
#include "ballistica/game/session/client_session.h"
#include "ballistica/app/app.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/audio/audio.h"
#include "ballistica/dynamics/bg/bg_dynamics.h"
#include "ballistica/dynamics/material/material.h"
@ -12,10 +16,6 @@
#include "ballistica/dynamics/rigid_body.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/graphics/graphics.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/networking/networking.h"
#include "ballistica/python/python.h"
#include "ballistica/scene/node/node_attribute.h"

View File

@ -2,6 +2,10 @@
#include "ballistica/game/session/host_session.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/game/game_stream.h"
#include "ballistica/game/host_activity.h"
#include "ballistica/game/player.h"
@ -9,10 +13,6 @@
#include "ballistica/generic/timer.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/input/device/input_device.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/python/python_command.h"
#include "ballistica/python/python_context_call.h"
@ -206,27 +206,27 @@ auto HostSession::GetSound(const std::string& name) -> Object::Ref<Sound> {
if (shutting_down_) {
throw Exception("can't load assets during session shutdown");
}
return Media::GetMedia(&sounds_, name, scene());
return Assets::GetAsset(&sounds_, name, scene());
}
auto HostSession::GetData(const std::string& name) -> Object::Ref<Data> {
if (shutting_down_) {
throw Exception("can't load assets during session shutdown");
}
return Media::GetMedia(&datas_, name, scene());
return Assets::GetAsset(&datas_, name, scene());
}
auto HostSession::GetTexture(const std::string& name) -> Object::Ref<Texture> {
if (shutting_down_) {
throw Exception("can't load assets during session shutdown");
}
return Media::GetMedia(&textures_, name, scene());
return Assets::GetAsset(&textures_, name, scene());
}
auto HostSession::GetModel(const std::string& name) -> Object::Ref<Model> {
if (shutting_down_) {
throw Exception("can't load media during session shutdown");
}
return Media::GetMedia(&models_, name, scene());
return Assets::GetAsset(&models_, name, scene());
}
auto HostSession::GetForegroundContext() -> Context {

View File

@ -3,10 +3,10 @@
#include "ballistica/game/session/net_client_session.h"
#include "ballistica/app/app.h"
#include "ballistica/assets/assets_server.h"
#include "ballistica/game/connection/connection_to_host.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/graphics/net_graph.h"
#include "ballistica/media/media_server.h"
namespace ballistica {
@ -15,8 +15,8 @@ NetClientSession::NetClientSession() {
if (g_app->replay_open) {
Log("ERROR: g_replay_open true at netclient start; shouldn't happen.");
}
assert(g_media_server);
g_media_server->PushBeginWriteReplayCall();
assert(g_assets_server);
g_assets_server->PushBeginWriteReplayCall();
writing_replay_ = true;
g_app->replay_open = true;
}
@ -28,8 +28,8 @@ NetClientSession::~NetClientSession() {
Log("ERROR: g_replay_open false at net-client close; shouldn't happen.");
}
g_app->replay_open = false;
assert(g_media_server);
g_media_server->PushEndWriteReplayCall();
assert(g_assets_server);
g_assets_server->PushEndWriteReplayCall();
writing_replay_ = false;
}
}
@ -192,8 +192,8 @@ void NetClientSession::HandleSessionMessage(
ClientSession::HandleSessionMessage(message);
if (writing_replay_) {
assert(g_media_server);
g_media_server->PushAddMessageToReplayCall(message);
assert(g_assets_server);
g_assets_server->PushAddMessageToReplayCall(message);
}
}

View File

@ -9,7 +9,7 @@ void ObjectComponent::WriteConfig() {
// This is not a common case and easier than forking all our shaders to
// create non-textured versions.
if (!texture_.exists()) {
texture_ = g_media->GetTexture(SystemTextureID::kWhite);
texture_ = g_assets->GetTexture(SystemTextureID::kWhite);
}
if (reflection_ == ReflectionType::kNone) {
assert(!double_sided_); // Unsupported combo.
@ -58,7 +58,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
} else {
ConfigForShading(ShadingType::kObjectReflectTransparent);
cmd_buffer_->PutInt(premultiplied_);
@ -68,7 +68,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
}
} else {
ConfigForShading(ShadingType::kObjectReflect);
@ -79,7 +79,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
}
} else {
// With add.
@ -100,7 +100,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(colorize_texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
} else {
ConfigForShading(ShadingType::kObjectReflectLightShadowColorized);
cmd_buffer_->PutInt(static_cast<int>(light_shadow_));
@ -112,7 +112,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(colorize_texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
}
} else {
if (double_sided_) {
@ -125,7 +125,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
} else {
ConfigForShading(ShadingType::kObjectReflectLightShadow);
cmd_buffer_->PutInt(static_cast<int>(light_shadow_));
@ -136,7 +136,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
}
}
} else {
@ -157,7 +157,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(colorize_texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
} else {
ConfigForShading(
ShadingType::kObjectReflectLightShadowAddColorized);
@ -171,7 +171,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(colorize_texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
}
} else {
ConfigForShading(ShadingType::kObjectReflectLightShadowAdd);
@ -183,7 +183,7 @@ void ObjectComponent::WriteConfig() {
cmd_buffer_->PutTexture(texture_);
SystemCubeMapTextureID r =
Graphics::CubeMapFromReflectionType(reflection_);
cmd_buffer_->PutCubeMapTexture(g_media->GetCubeMapTexture(r));
cmd_buffer_->PutCubeMapTexture(g_assets->GetCubeMapTexture(r));
}
}
}

View File

@ -132,7 +132,7 @@ void SimpleComponent::WriteConfig() {
colorize_color2_g_, colorize_color2_b_);
cmd_buffer_->PutTexture(texture_);
cmd_buffer_->PutTexture(
g_media->GetTexture(SystemTextureID::kBlack));
g_assets->GetTexture(SystemTextureID::kBlack));
cmd_buffer_->PutTexture(mask_texture_);
} else {
ConfigForShading(
@ -203,7 +203,8 @@ void SimpleComponent::WriteConfig() {
colorize_color_b_, colorize_color2_r_,
colorize_color2_g_, colorize_color2_b_);
cmd_buffer_->PutTexture(texture_);
cmd_buffer_->PutTexture(g_media->GetTexture(SystemTextureID::kBlack));
cmd_buffer_->PutTexture(
g_assets->GetTexture(SystemTextureID::kBlack));
cmd_buffer_->PutTexture(mask_texture_);
} else {
// if no color was provided we can do a super-cheap version

View File

@ -8,11 +8,11 @@ void SmokeComponent::WriteConfig() {
if (overlay_) {
ConfigForShading(ShadingType::kSmokeOverlay);
cmd_buffer_->PutFloats(color_r_, color_g_, color_b_, color_a_);
cmd_buffer_->PutTexture(g_media->GetTexture(SystemTextureID::kSmoke));
cmd_buffer_->PutTexture(g_assets->GetTexture(SystemTextureID::kSmoke));
} else {
ConfigForShading(ShadingType::kSmoke);
cmd_buffer_->PutFloats(color_r_, color_g_, color_b_, color_a_);
cmd_buffer_->PutTexture(g_media->GetTexture(SystemTextureID::kSmoke));
cmd_buffer_->PutTexture(g_assets->GetTexture(SystemTextureID::kSmoke));
}
}

View File

@ -9,7 +9,7 @@ void SpriteComponent::WriteConfig() {
// this is not a common case and easier than forking all our shaders
// to create non-textured versions.
if (!texture_.exists()) {
texture_ = g_media->GetTexture(SystemTextureID::kWhite);
texture_ = g_assets->GetTexture(SystemTextureID::kWhite);
}
if (exponent_ == 1) {
ConfigForShading(ShadingType::kSprite);

View File

@ -6,9 +6,9 @@
#include <memory>
#include <vector>
#include "ballistica/assets/data/asset_component_data.h"
#include "ballistica/math/matrix44f.h"
#include "ballistica/math/vector2f.h"
#include "ballistica/media/data/media_component_data.h"
namespace ballistica {
@ -101,7 +101,7 @@ class FrameDef {
auto has_depth_texture() const -> bool {
return (quality_ >= GraphicsQuality::kHigh);
}
void AddComponent(const Object::Ref<MediaComponentData>& component) {
void AddComponent(const Object::Ref<AssetComponentData>& component) {
// Add a reference to this component only if we havn't yet.
if (component->last_frame_def_num() != frame_number_) {
component->set_last_frame_def_num(frame_number_);
@ -156,7 +156,7 @@ class FrameDef {
return mesh_index_sizes_;
}
auto media_components() const
-> const std::vector<Object::Ref<MediaComponentData>>& {
-> const std::vector<Object::Ref<AssetComponentData>>& {
return media_components_;
}
@ -189,7 +189,7 @@ class FrameDef {
std::vector<Object::Ref<MeshDataClientHandle>> meshes_;
std::vector<Object::Ref<MeshBufferBase>> mesh_buffers_;
std::vector<int8_t> mesh_index_sizes_;
std::vector<Object::Ref<MediaComponentData>> media_components_;
std::vector<Object::Ref<AssetComponentData>> media_components_;
#if BA_DEBUG_BUILD
// Sanity checking: make sure components are completely submitted

View File

@ -3,11 +3,11 @@
#if BA_ENABLE_OPENGL
#include "ballistica/graphics/gl/renderer_gl.h"
#include "ballistica/assets/data/texture_preload_data.h"
#include "ballistica/assets/data/texture_renderer_data.h"
#include "ballistica/graphics/component/special_component.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/graphics/mesh/mesh_renderer_data.h"
#include "ballistica/media/data/texture_preload_data.h"
#include "ballistica/media/data/texture_renderer_data.h"
#if BA_OSTYPE_IOS_TVOS
#include "ballistica/platform/apple/apple_utils.h"

View File

@ -449,7 +449,7 @@ void Graphics::DrawMiscOverlays(RenderPass* pass) {
{
SimpleComponent c(pass);
c.SetTransparent(true);
c.SetTexture(g_media->GetTexture(SystemTextureID::kSoftRectVertical));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kSoftRectVertical));
float screen_width = g_graphics->screen_virtual_width();
@ -533,7 +533,7 @@ void Graphics::DrawMiscOverlays(RenderPass* pass) {
// Align our bottom with where we just scaled from.
c.Translate(0, 0.5f, 0);
}
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
v += scale * (36 + str_height);
@ -690,14 +690,14 @@ void Graphics::DrawMiscOverlays(RenderPass* pass) {
c2.SetColorizeColor(i->tint.x, i->tint.y, i->tint.z);
c2.SetColorizeColor2(i->tint2.x, i->tint2.y, i->tint2.z);
c2.SetMaskTexture(
g_media->GetTexture(SystemTextureID::kCharacterIconMask));
g_assets->GetTexture(SystemTextureID::kCharacterIconMask));
}
c2.SetColor(1, 1, 1, a);
c2.PushTransform();
c2.Translate(h - 14, v_base + 10 + i->v_smoothed,
kScreenMessageZDepth);
c2.Scale(22.0f * s_extra, 22.0f * s_extra);
c2.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c2.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c2.PopTransform();
c2.Submit();
}
@ -898,7 +898,7 @@ void Graphics::DrawLoadDot(RenderPass* pass) {
// Draw red if we've got graphics stuff loading. Green if only other stuff
// left.
if (g_media->GetGraphicalPendingLoadCount() > 0) {
if (g_assets->GetGraphicalPendingLoadCount() > 0) {
c.SetColor(0.2f, 0, 0, 1);
} else {
c.SetColor(0, 0.2f, 0, 1);
@ -1076,7 +1076,7 @@ void Graphics::BuildAndPushFrameDef() {
}
}
if (g_media->GetPendingLoadCount() > 0) {
if (g_assets->GetPendingLoadCount() > 0) {
DrawLoadDot(overlay_pass);
}
@ -1124,7 +1124,7 @@ void Graphics::DrawBoxingGlovesTest(FrameDef* frame_def) {
c.Translate(0, 7, -3.3f);
c.Scale(10, 10, 10);
c.Rotate(a, 0, 0, 1);
c.DrawModel(g_media->GetModel(SystemModelID::kBoxingGlove));
c.DrawModel(g_assets->GetModel(SystemModelID::kBoxingGlove));
c.PopTransform();
c.Submit();
}
@ -1132,14 +1132,14 @@ void Graphics::DrawBoxingGlovesTest(FrameDef* frame_def) {
// Beauty.
if (explicit_bool(false)) {
ObjectComponent c(frame_def->beauty_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kBoxingGlove));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kBoxingGlove));
c.SetReflection(ReflectionType::kSoft);
c.SetReflectionScale(0.4f, 0.4f, 0.4f);
c.PushTransform();
c.Translate(0.0f, 3.7f, -3.3f);
c.Scale(10.0f, 10.0f, 10.0f);
c.Rotate(a, 0.0f, 0.0f, 1.0f);
c.DrawModel(g_media->GetModel(SystemModelID::kBoxingGlove));
c.DrawModel(g_assets->GetModel(SystemModelID::kBoxingGlove));
c.PopTransform();
c.Submit();
}
@ -1153,7 +1153,7 @@ void Graphics::DrawBoxingGlovesTest(FrameDef* frame_def) {
c.Translate(0.0f, 3.7f, -3.3f);
c.Scale(10.0f, 10.0f, 10.0f);
c.Rotate(a, 0.0f, 0.0f, 1.0f);
c.DrawModel(g_media->GetModel(SystemModelID::kBoxingGlove));
c.DrawModel(g_assets->GetModel(SystemModelID::kBoxingGlove));
c.PopTransform();
c.Submit();
}
@ -1168,7 +1168,7 @@ void Graphics::DrawDebugBuffers(RenderPass* pass) {
c.PushTransform();
c.Translate(70, 400, kDebugImgZDepth);
c.Scale(csize, csize);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
c.Submit();
}
@ -1178,7 +1178,7 @@ void Graphics::DrawDebugBuffers(RenderPass* pass) {
c.PushTransform();
c.Translate(70, 250, kDebugImgZDepth);
c.Scale(csize, csize);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
c.Submit();
}
@ -1190,18 +1190,18 @@ void Graphics::UpdateAndDrawProgressBar(FrameDef* frame_def,
RenderPass* pass = frame_def->overlay_pass();
UpdateProgressBarProgress(
1.0f
- static_cast<float>(g_media->GetGraphicalPendingLoadCount())
- static_cast<float>(g_assets->GetGraphicalPendingLoadCount())
/ static_cast<float>(progress_bar_loads_));
DrawProgressBar(pass, 1.0f);
// If we were drawing a progress bar, see if everything is now loaded.. if
// so, start rendering normally next frame.
int count = g_media->GetGraphicalPendingLoadCount();
int count = g_assets->GetGraphicalPendingLoadCount();
if (count <= 0) {
progress_bar_ = false;
progress_bar_end_time_ = real_time;
}
if (g_media->GetPendingLoadCount() > 0) {
if (g_assets->GetPendingLoadCount() > 0) {
DrawLoadDot(pass);
}
}
@ -1294,7 +1294,7 @@ void Graphics::DrawFades(FrameDef* frame_def, millisecs_t real_time) {
float inv_a = 1.0f - a;
float s = 100.0f * inv_a + 5.0f * a;
c.Scale(s, s, s);
c.DrawModel(g_media->GetModel(SystemModelID::kVRFade));
c.DrawModel(g_assets->GetModel(SystemModelID::kVRFade));
c.PopTransform();
c.Submit();
#else // BA_VR_BUILD
@ -1347,7 +1347,7 @@ void Graphics::DrawCursor(RenderPass* pass, millisecs_t real_time) {
SimpleComponent c(pass);
c.SetTransparent(true);
float csize = 50.0f;
c.SetTexture(g_media->GetTexture(SystemTextureID::kCursor));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kCursor));
c.PushTransform();
// Note: we don't plug in known cursor position values here; we tell the
@ -1356,7 +1356,7 @@ void Graphics::DrawCursor(RenderPass* pass, millisecs_t real_time) {
c.CursorTranslate();
c.Translate(csize * 0.44f, csize * -0.44f, kCursorZDepth);
c.Scale(csize, csize);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
c.Submit();
}
@ -1372,7 +1372,7 @@ void Graphics::DrawBlotches(FrameDef* frame_def) {
this->shadow_blotch_mesh_->SetData(Object::New<MeshBuffer<VertexSprite>>(
this->blotch_verts_.size(), &this->blotch_verts_[0]));
SpriteComponent c(frame_def->light_shadow_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kLight));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kLight));
c.DrawMesh(this->shadow_blotch_mesh_.get());
c.Submit();
}
@ -1385,7 +1385,7 @@ void Graphics::DrawBlotches(FrameDef* frame_def) {
Object::New<MeshBuffer<VertexSprite>>(this->blotch_soft_verts_.size(),
&this->blotch_soft_verts_[0]));
SpriteComponent c(frame_def->light_shadow_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kLightSoft));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kLightSoft));
c.DrawMesh(this->shadow_blotch_soft_mesh_.get());
c.Submit();
}
@ -1401,7 +1401,7 @@ void Graphics::DrawBlotches(FrameDef* frame_def) {
this->blotch_soft_obj_verts_.size(),
&this->blotch_soft_obj_verts_[0]));
SpriteComponent c(frame_def->light_pass());
c.SetTexture(g_media->GetTexture(SystemTextureID::kLightSoft));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kLightSoft));
c.DrawMesh(this->shadow_blotch_soft_obj_mesh_.get());
c.Submit();
}
@ -1448,7 +1448,7 @@ void Graphics::AddMeshDataDestroy(MeshData* d) {
void Graphics::EnableProgressBar(bool fade_in) {
assert(InLogicThread());
progress_bar_loads_ = g_media->GetGraphicalPendingLoadCount();
progress_bar_loads_ = g_assets->GetGraphicalPendingLoadCount();
assert(progress_bar_loads_ >= 0);
if (progress_bar_loads_ > 0) {
progress_bar_ = true;

View File

@ -11,10 +11,10 @@
#include "ballistica/platform/sdl/sdl_app.h"
#else
#include "ballistica/app/app_flavor.h"
#include "ballistica/assets/assets.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
@ -75,7 +75,7 @@ auto GraphicsServer::GetRenderFrameDef() -> FrameDef* {
}
// Do some incremental loading every time we try to render.
g_media->RunPendingGraphicsLoads();
g_assets->RunPendingGraphicsLoads();
// Spin and wait for a short bit for a frame_def to appear. If it does, we
// grab it, render it, and also message the game thread to start generating
@ -185,7 +185,7 @@ void GraphicsServer::ReloadMedia() {
// Immediately unload all renderer data here in this thread.
if (renderer_) {
g_media->UnloadRendererBits(true, true);
g_assets->UnloadRendererBits(true, true);
}
// Set a render-hold so we ignore all frame_defs up until the point at which
@ -199,7 +199,7 @@ void GraphicsServer::ReloadMedia() {
// progress bar drawing, and then tell the graphics thread to stop ignoring
// frame-defs.
g_game->thread()->PushCall([this] {
g_media->MarkAllMediaForLoad();
g_assets->MarkAllAssetsForLoad();
g_graphics->EnableProgressBar(false);
PushRemoveRenderHoldCall();
});
@ -219,7 +219,7 @@ void GraphicsServer::RebuildLostContext() {
set_renderer_context_lost(true);
// Unload all texture and model data here in the render thread.
g_media->UnloadRendererBits(true, true);
g_assets->UnloadRendererBits(true, true);
// Also unload dynamic meshes.
for (auto&& i : mesh_datas_) {
@ -250,7 +250,7 @@ void GraphicsServer::RebuildLostContext() {
// Now tell the game thread to kick off loads for everything, flip on progress
// bar drawing, and then tell the graphics thread to stop ignoring frame-defs.
g_game->thread()->PushCall([this] {
g_media->MarkAllMediaForLoad();
g_assets->MarkAllAssetsForLoad();
g_graphics->EnableProgressBar(false);
PushRemoveRenderHoldCall();
});
@ -373,7 +373,7 @@ void GraphicsServer::HandleFullContextScreenRebuild(
if (renderer_) {
// Unload all textures and models.. these will be reloaded as-needed
// automatically for the new context..
g_media->UnloadRendererBits(true, true);
g_assets->UnloadRendererBits(true, true);
// Also unload all dynamic meshes.
for (auto&& i : mesh_datas_) {
@ -464,7 +464,7 @@ void GraphicsServer::HandleFullContextScreenRebuild(
// progress bar drawing, and then tell the graphics thread to stop ignoring
// frame-defs.
g_game->thread()->PushCall([this] {
g_media->MarkAllMediaForLoad();
g_assets->MarkAllAssetsForLoad();
g_graphics->set_internal_components_inited(false);
g_graphics->EnableProgressBar(false);
PushRemoveRenderHoldCall();
@ -768,7 +768,7 @@ void GraphicsServer::PushSetVSyncCall(bool sync, bool auto_sync) {
}
void GraphicsServer::PushComponentUnloadCall(
const std::vector<Object::Ref<MediaComponentData>*>& components) {
const std::vector<Object::Ref<AssetComponentData>*>& components) {
thread()->PushCall([this, components] {
// Unload all components we were passed.
for (auto&& i : components) {
@ -776,7 +776,7 @@ void GraphicsServer::PushComponentUnloadCall(
}
// ..and then ship these pointers back to the game thread so it can free the
// references.
g_game->PushFreeMediaComponentRefsCall(components);
g_game->PushFreeAssetComponentRefsCall(components);
});
}

View File

@ -29,7 +29,7 @@ class GraphicsServer {
auto PushReloadMediaCall() -> void;
auto PushRemoveRenderHoldCall() -> void;
auto PushComponentUnloadCall(
const std::vector<Object::Ref<MediaComponentData>*>& components) -> void;
const std::vector<Object::Ref<AssetComponentData>*>& components) -> void;
auto SetRenderHold() -> void;
// Used by the game thread to pass frame-defs to the graphics server

View File

@ -5,12 +5,12 @@
#include <vector>
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/ballistica.h"
#include "ballistica/graphics/frame_def.h"
#include "ballistica/graphics/mesh/mesh.h"
#include "ballistica/math/matrix44f.h"
#include "ballistica/media/component/model.h"
#include "ballistica/media/component/texture.h"
namespace ballistica {
@ -258,14 +258,14 @@ class RenderCommandBuffer {
void PutModel(ModelData* model) {
assert(frame_def_);
assert(!finalized_);
frame_def_->AddComponent(Object::Ref<MediaComponentData>(model));
frame_def_->AddComponent(Object::Ref<AssetComponentData>(model));
models_.push_back(model);
}
void PutTexture(TextureData* texture) {
assert(frame_def_);
assert(!finalized_);
frame_def_->AddComponent(Object::Ref<MediaComponentData>(texture));
frame_def_->AddComponent(Object::Ref<AssetComponentData>(texture));
textures_.push_back(texture);
}
@ -277,7 +277,7 @@ class RenderCommandBuffer {
void PutCubeMapTexture(TextureData* texture) {
assert(frame_def_);
assert(!finalized_);
frame_def_->AddComponent(Object::Ref<MediaComponentData>(texture));
frame_def_->AddComponent(Object::Ref<AssetComponentData>(texture));
textures_.push_back(texture);
}

View File

@ -650,7 +650,7 @@ void Renderer::UpdatePixelScaleAndBackingBuffer(FrameDef* frame_def) {
void Renderer::LoadMedia(FrameDef* frame_def) {
millisecs_t t = GetRealTime();
for (auto&& i : frame_def->media_components()) {
MediaComponentData* mc = i.get();
AssetComponentData* mc = i.get();
assert(mc);
mc->Load();

View File

@ -7,6 +7,9 @@
#include <string>
#include <vector>
#include "ballistica/assets/assets.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/assets/data/model_data.h"
#include "ballistica/core/object.h"
#include "ballistica/graphics/frame_def.h"
#include "ballistica/graphics/framebuffer.h"
@ -38,9 +41,6 @@
#include "ballistica/graphics/text/text_group.h"
#include "ballistica/math/matrix44f.h"
#include "ballistica/math/vector3f.h"
#include "ballistica/media/component/texture.h"
#include "ballistica/media/data/model_data.h"
#include "ballistica/media/media.h"
namespace ballistica {

View File

@ -33,7 +33,7 @@ void TextGroup::SetText(const std::string& text, TextMesh::HAlign alignment_h,
entry->max_flatness = 1.0f;
entry->mesh.SetText(text, alignment_h, alignment_v, true, 0, 65535,
TextMeshEntryType::kRegular, nullptr);
entry->tex = g_media->GetTexture(SystemTextureID::kFontBig);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontBig);
entries_.push_back(std::move(entry));
} else {
@ -109,8 +109,8 @@ void TextGroup::SetText(const std::string& text, TextMesh::HAlign alignment_h,
// There should only ever be one of these.
assert(!os_texture_.exists());
{
Media::MediaListsLock lock;
os_texture_ = g_media->GetTextureData(packer.get());
Assets::AssetListLock lock;
os_texture_ = g_assets->GetTextureData(packer.get());
}
// We also need to know what uv-scales to use for shadows/etc.
@ -122,43 +122,43 @@ void TextGroup::SetText(const std::string& text, TextMesh::HAlign alignment_h,
}
switch (*i) {
case 0:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall0);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall0);
break;
case 1:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall1);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall1);
break;
case 2:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall2);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall2);
break;
case 3:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall3);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall3);
break;
case 4:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall4);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall4);
break;
case 5:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall5);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall5);
break;
case 6:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall6);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall6);
break;
case 7:
entry->tex = g_media->GetTexture(SystemTextureID::kFontSmall7);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontSmall7);
break;
case static_cast<int>(TextGraphics::FontPage::kOSRendered):
entry->tex = os_texture_;
break;
case static_cast<int>(TextGraphics::FontPage::kExtras1):
entry->tex = g_media->GetTexture(SystemTextureID::kFontExtras);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontExtras);
break;
case static_cast<int>(TextGraphics::FontPage::kExtras2):
entry->tex = g_media->GetTexture(SystemTextureID::kFontExtras2);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontExtras2);
break;
case static_cast<int>(TextGraphics::FontPage::kExtras3):
entry->tex = g_media->GetTexture(SystemTextureID::kFontExtras3);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontExtras3);
break;
case static_cast<int>(TextGraphics::FontPage::kExtras4):
entry->tex = g_media->GetTexture(SystemTextureID::kFontExtras4);
entry->tex = g_assets->GetTexture(SystemTextureID::kFontExtras4);
break;
default:
throw Exception();

View File

@ -7,10 +7,10 @@
#include <string>
#include <vector>
#include "ballistica/assets/assets.h"
#include "ballistica/assets/data/texture_data.h"
#include "ballistica/core/object.h"
#include "ballistica/graphics/mesh/text_mesh.h"
#include "ballistica/media/data/texture_data.h"
#include "ballistica/media/media.h"
namespace ballistica {
@ -50,10 +50,10 @@ class TextGroup : public Object {
}
auto GetElementMaskUV2Texture(int index) const -> TextureData* {
assert(index < static_cast<int>(entries_.size()));
return g_media->GetTexture(entries_[index]->type
== TextMeshEntryType::kOSRendered
? SystemTextureID::kSoftRect2
: SystemTextureID::kSoftRect);
return g_assets->GetTexture(entries_[index]->type
== TextMeshEntryType::kOSRendered
? SystemTextureID::kSoftRect2
: SystemTextureID::kSoftRect);
}
void SetText(const std::string& text,
TextMesh::HAlign alignment_h = TextMesh::HAlign::kLeft,

View File

@ -241,7 +241,7 @@ void VRGraphics::DrawVROverlay(FrameDef* frame_def) {
c.Scale(kBaseVirtualResX * (1.0f + kVRBorder),
kBaseVirtualResY * (1.0f + kVRBorder),
kBaseVirtualResX * (1.0f + kVRBorder));
c.DrawModel(g_media->GetModel(SystemModelID::kVROverlay));
c.DrawModel(g_assets->GetModel(SystemModelID::kVROverlay));
c.PopTransform();
c.Submit();
}
@ -258,7 +258,7 @@ void VRGraphics::DrawOverlayBounds(RenderPass* pass) {
// Slight offset in z to reduce z fighting.
c.Translate(0.5f * width, 0.5f * height, 1.0f);
c.Scale(width, height, 100.0f);
c.DrawModel(g_media->GetModel(SystemModelID::kOverlayGuide));
c.DrawModel(g_assets->GetModel(SystemModelID::kOverlayGuide));
c.PopTransform();
c.Submit();
}
@ -277,14 +277,14 @@ void VRGraphics::DrawVRControllers(FrameDef* frame_def) {
if (false) {
ObjectComponent c(frame_def->beauty_pass());
c.SetColor(1, 0, 0);
c.SetTexture(g_media->GetTexture(SystemTextureID::kBoxingGlove));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kBoxingGlove));
c.SetReflection(ReflectionType::kSoft);
c.SetReflectionScale(0.4f, 0.4f, 0.4f);
c.PushTransform();
c.VRTransformToHead();
c.Translate(0, 0, 5);
c.Scale(2, 2, 2);
c.DrawModel(g_media->GetModel(SystemModelID::kBoxingGlove));
c.DrawModel(g_assets->GetModel(SystemModelID::kBoxingGlove));
c.PopTransform();
c.Submit();
}
@ -297,13 +297,13 @@ void VRGraphics::DrawVRControllers(FrameDef* frame_def) {
case VRHandType::kDaydreamRemote: {
ObjectComponent c(frame_def->beauty_pass());
c.SetColor(0, 1, 0);
c.SetTexture(g_media->GetTexture(SystemTextureID::kBoxingGlove));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kBoxingGlove));
c.SetReflection(ReflectionType::kSoft);
c.SetReflectionScale(0.4f, 0.4f, 0.4f);
c.PushTransform();
c.VRTransformToRightHand();
c.Scale(10, 10, 10);
c.DrawModel(g_media->GetModel(SystemModelID::kBoxingGlove));
c.DrawModel(g_assets->GetModel(SystemModelID::kBoxingGlove));
c.PopTransform();
c.Submit();
break;
@ -316,13 +316,13 @@ void VRGraphics::DrawVRControllers(FrameDef* frame_def) {
case VRHandType::kOculusTouchL: {
ObjectComponent c(frame_def->beauty_pass());
c.SetColor(0, 0, 1);
c.SetTexture(g_media->GetTexture(SystemTextureID::kBoxingGlove));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kBoxingGlove));
c.SetReflection(ReflectionType::kSoft);
c.SetReflectionScale(0.4f, 0.4f, 0.4f);
c.PushTransform();
c.VRTransformToLeftHand();
c.Scale(10, 10, 10);
c.DrawModel(g_media->GetModel(SystemModelID::kBoxingGlove));
c.DrawModel(g_assets->GetModel(SystemModelID::kBoxingGlove));
c.PopTransform();
c.Submit();
break;

View File

@ -429,7 +429,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
if (movement_control_type_ == MovementControlType::kSwipe) sc2 *= 0.6f;
if (movement_control_type_ == MovementControlType::kSwipe) {
c.SetTexture(g_media->GetTexture(SystemTextureID::kTouchArrows));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kTouchArrows));
if (editing_) {
float val = 1.5f + sinf(static_cast<float>(real_time) * 0.02f);
c.SetColor(val, val, 1.0f, 1.0f);
@ -442,7 +442,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
val = 0.35f;
}
c.SetColor(0.5f, 0.3f, 0.8f, val);
c.SetTexture(g_media->GetTexture(SystemTextureID::kCircle));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kCircle));
}
float x_offs =
@ -453,7 +453,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
c.PushTransform();
c.Translate(d_pad_base_x_ + x_offs, d_pad_base_y_ + y_offs, kDrawDepth);
c.Scale(sc2, sc2);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
if (movement_control_type_ == MovementControlType::kJoystick) {
@ -467,7 +467,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
c.PushTransform();
c.Translate(d_pad_x_ + x_offs, d_pad_y_ + y_offs, kDrawDepth);
c.Scale(sc_move * 0.5f, sc_move * 0.5f);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
}
}
@ -475,7 +475,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
if (!buttons_touch_ && action_control_type_ == ActionControlType::kSwipe
&& !swipe_controls_hidden_) {
float sc2{sc_actions * 0.6f};
c.SetTexture(g_media->GetTexture(SystemTextureID::kTouchArrowsActions));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kTouchArrowsActions));
if (editing_) {
float val = 1.5f + sinf(static_cast<float>(real_time) * 0.02f);
c.SetColor(val, val, 1.0f, 1.0f);
@ -489,7 +489,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
height * (-0.1f - buttons_default_frac_y_) * (1.0f - presence_);
c.Translate(buttons_x_ + x_offs, buttons_y_ + y_offs, kDrawDepth);
c.Scale(sc2, sc2);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
}
c.Submit();
@ -539,7 +539,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
base_fade = 0.25f;
} else {
base_fade = 0.8f;
c.SetTexture(g_media->GetTexture(SystemTextureID::kActionButtons));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kActionButtons));
}
float x_offs;
@ -632,7 +632,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
} else {
c.Scale(b_width, b_width);
}
c.DrawModel(g_media->GetModel(SystemModelID::kActionButtonRight));
c.DrawModel(g_assets->GetModel(SystemModelID::kActionButtonRight));
c.PopTransform();
}
@ -659,7 +659,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
} else {
c.Scale(b_width, b_width);
}
c.DrawModel(g_media->GetModel(SystemModelID::kActionButtonLeft));
c.DrawModel(g_assets->GetModel(SystemModelID::kActionButtonLeft));
c.PopTransform();
}
@ -685,7 +685,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
} else {
c.Scale(b_width, b_width);
}
c.DrawModel(g_media->GetModel(SystemModelID::kActionButtonBottom));
c.DrawModel(g_assets->GetModel(SystemModelID::kActionButtonBottom));
c.PopTransform();
}
@ -713,13 +713,13 @@ void TouchInput::Draw(FrameDef* frame_def) {
} else {
c.Scale(b_width, b_width);
}
c.DrawModel(g_media->GetModel(SystemModelID::kActionButtonTop));
c.DrawModel(g_assets->GetModel(SystemModelID::kActionButtonTop));
c.PopTransform();
}
// Center point.
if (buttons_touch_ && action_control_type_ == ActionControlType::kSwipe) {
c.SetTexture(g_media->GetTexture(SystemTextureID::kCircle));
c.SetTexture(g_assets->GetTexture(SystemTextureID::kCircle));
c.SetColor(1.0f, 1.0f, 0.0f, 0.8f);
c.PushTransform();
@ -744,7 +744,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
kDrawDepth);
}
c.Scale(b_width * 0.3f, b_width * 0.3f);
c.DrawModel(g_media->GetModel(SystemModelID::kImage1x1));
c.DrawModel(g_assets->GetModel(SystemModelID::kImage1x1));
c.PopTransform();
}
c.PopTransform();
@ -784,7 +784,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
dist = 0.05f;
}
c2.SetTexture(g_media->GetTexture(SystemTextureID::kArrow));
c2.SetTexture(g_assets->GetTexture(SystemTextureID::kArrow));
Matrix44f orient =
Matrix44fOrient(d_pad_draw_dir_, Vector3f(0.0f, 1.0f, 0.0f));
c2.PushTransform();
@ -816,13 +816,13 @@ void TouchInput::Draw(FrameDef* frame_def) {
c2.PushTransform();
c2.Translate(0.0f, dist * -0.5f, 0.0f);
c2.Scale(0.15f, dist, 0.2f);
c2.DrawModel(g_media->GetModel(SystemModelID::kArrowBack));
c2.DrawModel(g_assets->GetModel(SystemModelID::kArrowBack));
c2.PopTransform();
c2.PushTransform();
c2.Translate(0.0f, dist * -1.0f - 0.15f, 0.0f);
c2.Scale(0.45f, 0.3f, 0.3f);
c2.DrawModel(g_media->GetModel(SystemModelID::kArrowFront));
c2.DrawModel(g_assets->GetModel(SystemModelID::kArrowFront));
c2.PopTransform();
c2.PopTransform();

View File

@ -495,7 +495,7 @@ void Input::AnnounceConnects() {
newly_connected_controllers_.front());
ScreenMessage(s);
}
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kGunCock));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kGunCock));
}
newly_connected_controllers_.clear();
@ -515,7 +515,7 @@ void Input::AnnounceDisconnects() {
newly_disconnected_controllers_.front());
ScreenMessage(s);
}
g_audio->PlaySound(g_media->GetSound(SystemSoundID::kCorkPop));
g_audio->PlaySound(g_assets->GetSound(SystemSoundID::kCorkPop));
newly_disconnected_controllers_.clear();
}

View File

@ -10,11 +10,11 @@
#endif
#include "ballistica/app/app.h"
#include "ballistica/assets/assets.h"
#include "ballistica/game/game.h"
#include "ballistica/generic/utils.h"
#include "ballistica/input/input.h"
#include "ballistica/math/vector3f.h"
#include "ballistica/media/media.h"
#include "ballistica/networking/network_reader.h"
#include "ballistica/platform/min_sdl.h"
#include "ballistica/platform/platform.h"

View File

@ -2,9 +2,9 @@
#include "ballistica/python/class/python_class_collide_model.h"
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/core/thread.h"
#include "ballistica/game/game.h"
#include "ballistica/media/component/collide_model.h"
#include "ballistica/python/python.h"
namespace ballistica {

View File

@ -2,9 +2,9 @@
#include "ballistica/python/class/python_class_data.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/core/thread.h"
#include "ballistica/game/game.h"
#include "ballistica/media/component/data.h"
#include "ballistica/python/python.h"
namespace ballistica {

View File

@ -2,9 +2,9 @@
#include "ballistica/python/class/python_class_model.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/core/thread.h"
#include "ballistica/game/game.h"
#include "ballistica/media/component/model.h"
#include "ballistica/python/python.h"
namespace ballistica {

View File

@ -2,9 +2,9 @@
#include "ballistica/python/class/python_class_sound.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/core/thread.h"
#include "ballistica/game/game.h"
#include "ballistica/media/component/sound.h"
#include "ballistica/python/python.h"
namespace ballistica {

View File

@ -2,9 +2,9 @@
#include "ballistica/python/class/python_class_texture.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/core/thread.h"
#include "ballistica/game/game.h"
#include "ballistica/media/component/texture.h"
#include "ballistica/python/python.h"
namespace ballistica {

View File

@ -4,6 +4,7 @@
#include "ballistica/app/app.h"
#include "ballistica/app/app_flavor.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/core/logging.h"
#include "ballistica/game/connection/connection_set.h"
#include "ballistica/game/game_stream.h"
@ -11,7 +12,6 @@
#include "ballistica/game/session/host_session.h"
#include "ballistica/game/session/replay_client_session.h"
#include "ballistica/graphics/graphics.h"
#include "ballistica/media/component/texture.h"
#include "ballistica/python/class/python_class_activity_data.h"
#include "ballistica/python/class/python_class_session_data.h"
#include "ballistica/python/python.h"

View File

@ -1,19 +1,19 @@
// Released under the MIT License. See LICENSE for details.
#include "ballistica/python/methods/python_methods_media.h"
#include "ballistica/python/methods/python_methods_assets.h"
#include <list>
#if 0 // Cpplint errs w/o this, CLion errs with it. Hard to please everybody.
#include <string>
#endif
#include "ballistica/assets/component/collide_model.h"
#include "ballistica/assets/component/data.h"
#include "ballistica/assets/component/model.h"
#include "ballistica/assets/component/sound.h"
#include "ballistica/assets/component/texture.h"
#include "ballistica/game/host_activity.h"
#include "ballistica/graphics/graphics_server.h"
#include "ballistica/media/component/collide_model.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/python/python_sys.h"
#include "ballistica/ui/ui.h"

View File

@ -1,7 +1,7 @@
// Released under the MIT License. See LICENSE for details.
#ifndef BALLISTICA_PYTHON_METHODS_PYTHON_METHODS_MEDIA_H_
#define BALLISTICA_PYTHON_METHODS_PYTHON_METHODS_MEDIA_H_
#ifndef BALLISTICA_PYTHON_METHODS_PYTHON_METHODS_ASSETS_H_
#define BALLISTICA_PYTHON_METHODS_PYTHON_METHODS_ASSETS_H_
#include <vector>
@ -17,4 +17,4 @@ class PythonMethodsMedia {
} // namespace ballistica
#endif // BALLISTICA_PYTHON_METHODS_PYTHON_METHODS_MEDIA_H_
#endif // BALLISTICA_PYTHON_METHODS_PYTHON_METHODS_ASSETS_H_

Some files were not shown because too many files have changed in this diff Show More