mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-03-23 02:35:49 +08:00
internal work
This commit is contained in:
parent
6196b9bd4e
commit
39ebaa76a0
@ -3932,40 +3932,40 @@
|
|||||||
"assets/build/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/b5/85/f8b6d0558ddb87267f34254b1450",
|
"assets/build/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/b5/85/f8b6d0558ddb87267f34254b1450",
|
||||||
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
|
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
|
||||||
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
|
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
|
||||||
"build/prefab/full/linux_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/6b/cb/19189b08a2e2fb1eb992ce9409c3",
|
"build/prefab/full/linux_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/cc/c6/de49df32988ff2af73ab9a4c6571",
|
||||||
"build/prefab/full/linux_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/f7/4d/1fa868632c30ebfacfc38c6b117d",
|
"build/prefab/full/linux_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/95/97/f6a1324ee16fbc9337914ca0bc97",
|
||||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/7d/b8/49192d8bdbb04f541279f1be0e5b",
|
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/bf/f5/1e86cc48dc80b6a45d3093307572",
|
||||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/4c/45/a35cc2aa7d366acf296ff8c1cc9d",
|
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/06/42/56e114de5a1cd3be38ced2a22e7c",
|
||||||
"build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/52/15/30ee7f43e310f28fc45d2cddf572",
|
"build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/03/9e/7b98f72572f805d9724cb2ac02a8",
|
||||||
"build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/96/0a/2f1783c6132c52b81f52deb32848",
|
"build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/9c/06/41db5f80a6128bbb92b2800579f6",
|
||||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cf/8b/1d445ffa286f7244aad7d1ce5e73",
|
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cb/d8/8f9d77f8ade2019501c8bcf706e0",
|
||||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/67/6d/3cc48fa4a8a782658f3bcb05896a",
|
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/df/bf/7a286415b507c22b6da1e97ab2b4",
|
||||||
"build/prefab/full/mac_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/f8/25/ba027f4b3cf7b71219da09c21c75",
|
"build/prefab/full/mac_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/01/77/52cdc3cc7821937f29cfc7603925",
|
||||||
"build/prefab/full/mac_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/3b/f1/de985e1c1353d1b08f32f9f3e3a8",
|
"build/prefab/full/mac_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/67/0a/e6f6c546ebcc558c5c8e053db473",
|
||||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/50/e8/2dc9822aed07127c510475d4f84c",
|
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/fa/84/9e94f985a3800e982cc951013103",
|
||||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/53/a4/7ccb111c3808cdfbc040e3d7ceb4",
|
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c1/e5/a292713721a27bc32e0cd358d0de",
|
||||||
"build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/2b/3d/c440f8c0ed420b764b7c8a919c28",
|
"build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/c1/e5/a858dc7ad170f604b92b3174c679",
|
||||||
"build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/60/fc/87cfc12a101a1602a10d56590a1c",
|
"build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/e5/5a/b566e513d303b2ada7d989e5e960",
|
||||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/5e/53/031857aa1a70492d21941851c4a0",
|
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c5/23/c0f694ccbdbb9f165fa5a1e2261a",
|
||||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3f/5e/b45d379238a9c0e8e37f46cf1f0d",
|
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/6b/c7/c3e9e67734aeebf6eea398709cdc",
|
||||||
"build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/10/b1/b90ce616c5af2ddb545f56832994",
|
"build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/89/c8/8b189db0198c5da280c40cd93478",
|
||||||
"build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/cb/fb/dfafe1bde1ad7f7331e1bfc4e63d",
|
"build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/d9/53/7aa5bc4721c5059e7e389e14881d",
|
||||||
"build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/db/13/bd6517c55cd8e129e17e7f9c2616",
|
"build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/79/33/5eaf44c0165e4b159ffc72c2b8db",
|
||||||
"build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/ea/9d/70f2fe7e9c1101710410763d75bf",
|
"build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/74/ff/4d34e2d4e06279628719eaee0d00",
|
||||||
"build/prefab/lib/linux_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/cb/ed/e47dfe8c0b1ed07fa6e14b15823e",
|
"build/prefab/lib/linux_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/77/82/a686d8e79268f3eedc6b9df19823",
|
||||||
"build/prefab/lib/linux_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b0/f5/432df1b69d95c0be2c452109ec80",
|
"build/prefab/lib/linux_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e7/87/02c66778dde288509a5277ba69a5",
|
||||||
"build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/cb/33/49607104f1a4daeff9203ac70279",
|
"build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/79/a5/46f07164fcdbe1b91717e243b892",
|
||||||
"build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/85/5a/95e462b25713e0984d086b9cc4dc",
|
"build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6d/fa/ec0729da657c4e32ad9b7003f35a",
|
||||||
"build/prefab/lib/linux_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1d/f6/f812e186bd658a393523e9dcfeab",
|
"build/prefab/lib/linux_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/41/84/e054c6fb551d59403c26041e1ee4",
|
||||||
"build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/47/50/5cc79eccc31f272b22e535563f4f",
|
"build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/63/ee/26d31df7b2bb9eb5e95370b3059a",
|
||||||
"build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1e/bf/bf4842f01b740ca1430bacc5381e",
|
"build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e4/74/49599bc0fea61ee417abc05998d5",
|
||||||
"build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d5/92/dac101043f5b24e4e25424b0c471",
|
"build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d2/42/8e9d71c5f5dd25c9f3373bb7f2ee",
|
||||||
"build/prefab/lib/mac_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6c/52/3ccd81f47f7e02376a3e3ba91b54",
|
"build/prefab/lib/mac_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/08/40/f4635ffe8782a392a3f45917aafd",
|
||||||
"build/prefab/lib/mac_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9d/30/9e0c9323ac0c070167595a4b3015",
|
"build/prefab/lib/mac_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c3/17/929233c7f1d476ac5701fe51585d",
|
||||||
"build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4f/e6/e838ab1f57c90a2ab541b4524f5d",
|
"build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/03/95/0c63acb4484b44f34608c43e9368",
|
||||||
"build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d0/18/dbcc2d1e67a5d7887a8ff48759d0",
|
"build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d8/ca/0194b8c635cba7d9ad4ae46b20b6",
|
||||||
"build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c8/bb/32515f5226bb06103d2184058dce",
|
"build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/69/e6/a11756db0dc21d359a3e2d2e588f",
|
||||||
"build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/2b/83/ef8718694732f24d733be72286eb",
|
"build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/62/85/e6361b234a737f31be4bfcc312a2",
|
||||||
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d9/4e/5706b74a4fc9879e22e7305c81bb",
|
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/f9/b6/b24a4ec933cde35037a7ca204dce",
|
||||||
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d3/68/3e284f68dd2d1b9f69b0f6db86c9"
|
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/91/de/59e991f26802c4d695b14777e5bd"
|
||||||
}
|
}
|
||||||
2
.idea/dictionaries/ericf.xml
generated
2
.idea/dictionaries/ericf.xml
generated
@ -617,6 +617,7 @@
|
|||||||
<w>eftools</w>
|
<w>eftools</w>
|
||||||
<w>efxjtp</w>
|
<w>efxjtp</w>
|
||||||
<w>eids</w>
|
<w>eids</w>
|
||||||
|
<w>elapsedf</w>
|
||||||
<w>elementtree</w>
|
<w>elementtree</w>
|
||||||
<w>elim</w>
|
<w>elim</w>
|
||||||
<w>emitfx</w>
|
<w>emitfx</w>
|
||||||
@ -1977,6 +1978,7 @@
|
|||||||
<w>sourceimages</w>
|
<w>sourceimages</w>
|
||||||
<w>sourcelines</w>
|
<w>sourcelines</w>
|
||||||
<w>sourcenode</w>
|
<w>sourcenode</w>
|
||||||
|
<w>spacecount</w>
|
||||||
<w>spacelen</w>
|
<w>spacelen</w>
|
||||||
<w>spacingstr</w>
|
<w>spacingstr</w>
|
||||||
<w>spammers</w>
|
<w>spammers</w>
|
||||||
|
|||||||
@ -38,6 +38,7 @@
|
|||||||
<w>alphapixels</w>
|
<w>alphapixels</w>
|
||||||
<w>alsa</w>
|
<w>alsa</w>
|
||||||
<w>alsoft</w>
|
<w>alsoft</w>
|
||||||
|
<w>anchorx</w>
|
||||||
<w>animcurve</w>
|
<w>animcurve</w>
|
||||||
<w>aniso</w>
|
<w>aniso</w>
|
||||||
<w>ansiwrap</w>
|
<w>ansiwrap</w>
|
||||||
@ -265,6 +266,7 @@
|
|||||||
<w>efro</w>
|
<w>efro</w>
|
||||||
<w>efrohack</w>
|
<w>efrohack</w>
|
||||||
<w>efrohome</w>
|
<w>efrohome</w>
|
||||||
|
<w>elapsedf</w>
|
||||||
<w>elems</w>
|
<w>elems</w>
|
||||||
<w>elevenbase</w>
|
<w>elevenbase</w>
|
||||||
<w>elevenbits</w>
|
<w>elevenbits</w>
|
||||||
@ -859,6 +861,7 @@
|
|||||||
<w>soffs</w>
|
<w>soffs</w>
|
||||||
<w>solaris</w>
|
<w>solaris</w>
|
||||||
<w>sourcenode</w>
|
<w>sourcenode</w>
|
||||||
|
<w>spacecount</w>
|
||||||
<w>spaz</w>
|
<w>spaz</w>
|
||||||
<w>spead</w>
|
<w>spead</w>
|
||||||
<w>sphrand</w>
|
<w>sphrand</w>
|
||||||
|
|||||||
@ -4,6 +4,9 @@
|
|||||||
<inspection_tool class="ArrayIssues" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="ArrayIssues" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="CannotResolve" enabled="false" level="ERROR" enabled_by_default="false" />
|
<inspection_tool class="CannotResolve" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||||
<inspection_tool class="ClangTidy" enabled="true" level="WARNING" enabled_by_default="true">
|
<inspection_tool class="ClangTidy" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<scope name="External" level="WARNING" enabled="false">
|
||||||
|
<option name="clangTidyChecks" value="-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-not-null-terminated-result,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignment,bugprone-string-literal-with-embedded-nul,bugprone-suspicious-enum-usage,bugprone-suspicious-include,bugprone-suspicious-memset-usage,bugprone-suspicious-missing-comma,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare,bugprone-swapped-arguments,bugprone-terminating-continue,bugprone-throw-keyword-missing,bugprone-too-small-loop-variable,bugprone-undefined-memory-manipulation,bugprone-undelegated-constructor,bugprone-unhandled-self-assignment,bugprone-unused-raii,bugprone-unused-return-value,bugprone-use-after-move,bugprone-virtual-near-miss,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err58-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-slicing,google-default-arguments,google-explicit-constructor,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,misc-misplaced-const,misc-new-delete-overloads,misc-no-recursion,misc-non-copyable-objects,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,misc-uniqueptr-reset-release,modernize-avoid-bind,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,portability-simd-intrinsics,readability-avoid-const-params-in-decls,readability-const-return-type,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-inconsistent-declaration-parameter-name,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-use-anyofallof,-misc-no-recursion" />
|
||||||
|
</scope>
|
||||||
<option name="clangTidyChecks" value="-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-not-null-terminated-result,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignment,bugprone-string-literal-with-embedded-nul,bugprone-suspicious-enum-usage,bugprone-suspicious-include,bugprone-suspicious-memset-usage,bugprone-suspicious-missing-comma,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare,bugprone-swapped-arguments,bugprone-terminating-continue,bugprone-throw-keyword-missing,bugprone-too-small-loop-variable,bugprone-undefined-memory-manipulation,bugprone-undelegated-constructor,bugprone-unhandled-self-assignment,bugprone-unused-raii,bugprone-unused-return-value,bugprone-use-after-move,bugprone-virtual-near-miss,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err58-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-slicing,google-default-arguments,google-explicit-constructor,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,misc-misplaced-const,misc-new-delete-overloads,misc-no-recursion,misc-non-copyable-objects,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,misc-uniqueptr-reset-release,modernize-avoid-bind,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,portability-simd-intrinsics,readability-avoid-const-params-in-decls,readability-const-return-type,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-inconsistent-declaration-parameter-name,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-use-anyofallof,-misc-no-recursion" />
|
<option name="clangTidyChecks" value="-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-not-null-terminated-result,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignment,bugprone-string-literal-with-embedded-nul,bugprone-suspicious-enum-usage,bugprone-suspicious-include,bugprone-suspicious-memset-usage,bugprone-suspicious-missing-comma,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare,bugprone-swapped-arguments,bugprone-terminating-continue,bugprone-throw-keyword-missing,bugprone-too-small-loop-variable,bugprone-undefined-memory-manipulation,bugprone-undelegated-constructor,bugprone-unhandled-self-assignment,bugprone-unused-raii,bugprone-unused-return-value,bugprone-use-after-move,bugprone-virtual-near-miss,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err58-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-slicing,google-default-arguments,google-explicit-constructor,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,misc-misplaced-const,misc-new-delete-overloads,misc-no-recursion,misc-non-copyable-objects,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,misc-uniqueptr-reset-release,modernize-avoid-bind,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,portability-simd-intrinsics,readability-avoid-const-params-in-decls,readability-const-return-type,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-inconsistent-declaration-parameter-name,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-use-anyofallof,-misc-no-recursion" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="ConstructionIsNotAllowed" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="ConstructionIsNotAllowed" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
|||||||
20
ballisticacore-cmake/.idea/misc.xml
generated
20
ballisticacore-cmake/.idea/misc.xml
generated
@ -1,8 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$">
|
||||||
|
<contentRoot DIR="$PROJECT_DIR$/.." />
|
||||||
|
</component>
|
||||||
<component name="CidrRootsConfiguration">
|
<component name="CidrRootsConfiguration">
|
||||||
<excludeRoots>
|
<excludeRoots>
|
||||||
|
<file path="$PROJECT_DIR$/../.assetcache" />
|
||||||
|
<file path="$PROJECT_DIR$/../.cache" />
|
||||||
|
<file path="$PROJECT_DIR$/../.mypy_cache" />
|
||||||
|
<file path="$PROJECT_DIR$/../.pytest_cache" />
|
||||||
|
<file path="$PROJECT_DIR$/../assets" />
|
||||||
|
<file path="$PROJECT_DIR$/../ballisticacore-android" />
|
||||||
<file path="$PROJECT_DIR$/.idea" />
|
<file path="$PROJECT_DIR$/.idea" />
|
||||||
<file path="$PROJECT_DIR$/build" />
|
<file path="$PROJECT_DIR$/build" />
|
||||||
<file path="$PROJECT_DIR$/build-server" />
|
<file path="$PROJECT_DIR$/build-server" />
|
||||||
@ -22,6 +30,16 @@
|
|||||||
<file path="$PROJECT_DIR$/src/external/windows" />
|
<file path="$PROJECT_DIR$/src/external/windows" />
|
||||||
<file path="$PROJECT_DIR$/src/generated" />
|
<file path="$PROJECT_DIR$/src/generated" />
|
||||||
<file path="$PROJECT_DIR$/src/generated_src" />
|
<file path="$PROJECT_DIR$/src/generated_src" />
|
||||||
|
<file path="$PROJECT_DIR$/../ballisticacore-ios.xcodeproj" />
|
||||||
|
<file path="$PROJECT_DIR$/../ballisticacore-mac.xcodeproj" />
|
||||||
|
<file path="$PROJECT_DIR$/../ballisticacore-windows" />
|
||||||
|
<file path="$PROJECT_DIR$/../ballisticacore-xcode" />
|
||||||
|
<file path="$PROJECT_DIR$/../build" />
|
||||||
|
<file path="$PROJECT_DIR$/../config" />
|
||||||
|
<file path="$PROJECT_DIR$/../docs" />
|
||||||
|
<file path="$PROJECT_DIR$/../resources" />
|
||||||
|
<file path="$PROJECT_DIR$/../tests" />
|
||||||
|
<file path="$PROJECT_DIR$/../tools" />
|
||||||
</excludeRoots>
|
</excludeRoots>
|
||||||
</component>
|
</component>
|
||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
|
|||||||
3
ballisticacore-cmake/.idea/scopes/External.xml
generated
Normal file
3
ballisticacore-cmake/.idea/scopes/External.xml
generated
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<component name="DependencyValidationManager">
|
||||||
|
<scope name="External" pattern="file[BallisticaCore]:src/external//*" />
|
||||||
|
</component>
|
||||||
@ -81,7 +81,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
|||||||
"${CMAKE_CXX_FLAGS} -Wno-psabi")
|
"${CMAKE_CXX_FLAGS} -Wno-psabi")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BA_SRC_ROOT src)
|
set(BA_SRC_ROOT ../src)
|
||||||
include_directories(${BA_SRC_ROOT})
|
include_directories(${BA_SRC_ROOT})
|
||||||
add_compile_options(-include ballistica/config/config_cmake.h)
|
add_compile_options(-include ballistica/config/config_cmake.h)
|
||||||
|
|
||||||
@ -642,7 +642,7 @@ target_include_directories(ballisticacore PRIVATE
|
|||||||
|
|
||||||
target_link_libraries(ballisticacore PRIVATE
|
target_link_libraries(ballisticacore PRIVATE
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/prefablib/libballisticacore_internal.a ode pthread ${Python_LIBRARIES}
|
${CMAKE_CURRENT_BINARY_DIR}/prefablib/libballisticacore_internal.a ode pthread ${Python_LIBRARIES}
|
||||||
${SDL2_LIBRARIES} ${EXTRA_LIBRARIES} dl)
|
${SDL2_LIBRARIES} ${EXTRA_LIBRARIES} dl z)
|
||||||
|
|
||||||
# Hack for building on rpi (might be due to my manually built Python 3.8)
|
# Hack for building on rpi (might be due to my manually built Python 3.8)
|
||||||
# Hopefully can remove later...
|
# Hopefully can remove later...
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
../src
|
|
||||||
@ -21,6 +21,7 @@
|
|||||||
"name": "BallisticaCore",
|
"name": "BallisticaCore",
|
||||||
"public": true,
|
"public": true,
|
||||||
"pylint_ignored_untracked_deps": [
|
"pylint_ignored_untracked_deps": [
|
||||||
|
"__main__",
|
||||||
"astroid.modutils",
|
"astroid.modutils",
|
||||||
"astroid",
|
"astroid",
|
||||||
"pylint.lint",
|
"pylint.lint",
|
||||||
|
|||||||
@ -30,7 +30,10 @@ ignore_missing_imports = True
|
|||||||
[mypy-xml.*]
|
[mypy-xml.*]
|
||||||
ignore_missing_imports = True
|
ignore_missing_imports = True
|
||||||
|
|
||||||
[mypy-vis_cleanup]
|
# We delete a bunch of stuff from _ba in here
|
||||||
|
# which our public stub module doesn't list,
|
||||||
|
# so we get complaints that they don't exist.
|
||||||
|
[mypy-ba_embedded_vis_cleanup]
|
||||||
ignore_errors = True
|
ignore_errors = True
|
||||||
|
|
||||||
[mypy-bastd.mapdata.*]
|
[mypy-bastd.mapdata.*]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
|
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
|
||||||
<h4><em>last updated on 2021-04-13 for Ballistica version 1.6.0 build 20332</em></h4>
|
<h4><em>last updated on 2021-04-14 for Ballistica version 1.6.0 build 20335</em></h4>
|
||||||
<p>This page documents the Python classes and functions in the 'ba' module,
|
<p>This page documents the Python classes and functions in the 'ba' module,
|
||||||
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
|
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@ -137,13 +137,13 @@ void App::RunEvents() {
|
|||||||
void App::UpdatePauseResume() {
|
void App::UpdatePauseResume() {
|
||||||
if (actually_paused_) {
|
if (actually_paused_) {
|
||||||
// Unpause if no one wants pause.
|
// Unpause if no one wants pause.
|
||||||
if (!sys_paused_app_ && !user_paused_app_) {
|
if (!sys_paused_app_) {
|
||||||
OnResume();
|
OnResume();
|
||||||
actually_paused_ = false;
|
actually_paused_ = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Pause if anyone wants.
|
// Pause if anyone wants.
|
||||||
if (sys_paused_app_ || user_paused_app_) {
|
if (sys_paused_app_) {
|
||||||
OnPause();
|
OnPause();
|
||||||
actually_paused_ = true;
|
actually_paused_ = true;
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ void App::PrimeEventPump() {
|
|||||||
void App::PushShowOnlineScoreUICall(const std::string& show,
|
void App::PushShowOnlineScoreUICall(const std::string& show,
|
||||||
const std::string& game,
|
const std::string& game,
|
||||||
const std::string& game_version) {
|
const std::string& game_version) {
|
||||||
PushCall([this, show, game, game_version] {
|
PushCall([show, game, game_version] {
|
||||||
assert(InMainThread());
|
assert(InMainThread());
|
||||||
g_platform->ShowOnlineScoreUI(show, game, game_version);
|
g_platform->ShowOnlineScoreUI(show, game, game_version);
|
||||||
});
|
});
|
||||||
@ -272,7 +272,7 @@ void App::PushShowOnlineScoreUICall(const std::string& show,
|
|||||||
|
|
||||||
void App::PushNetworkSetupCall(int port, int telnet_port, bool enable_telnet,
|
void App::PushNetworkSetupCall(int port, int telnet_port, bool enable_telnet,
|
||||||
const std::string& telnet_password) {
|
const std::string& telnet_password) {
|
||||||
PushCall([this, port, telnet_port, enable_telnet, telnet_password] {
|
PushCall([port, telnet_port, enable_telnet, telnet_password] {
|
||||||
assert(InMainThread());
|
assert(InMainThread());
|
||||||
// Kick these off if they don't exist.
|
// Kick these off if they don't exist.
|
||||||
// (do we want to support changing ports on existing ones?)
|
// (do we want to support changing ports on existing ones?)
|
||||||
@ -293,59 +293,58 @@ void App::PushNetworkSetupCall(int port, int telnet_port, bool enable_telnet,
|
|||||||
|
|
||||||
void App::PushPurchaseAckCall(const std::string& purchase,
|
void App::PushPurchaseAckCall(const std::string& purchase,
|
||||||
const std::string& order_id) {
|
const std::string& order_id) {
|
||||||
PushCall([this, purchase, order_id] {
|
PushCall(
|
||||||
g_platform->PurchaseAck(purchase, order_id);
|
[purchase, order_id] { g_platform->PurchaseAck(purchase, order_id); });
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushGetScoresToBeatCall(const std::string& level,
|
void App::PushGetScoresToBeatCall(const std::string& level,
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
void* py_callback) {
|
void* py_callback) {
|
||||||
PushCall([this, level, config, py_callback] {
|
PushCall([level, config, py_callback] {
|
||||||
assert(InMainThread());
|
assert(InMainThread());
|
||||||
g_platform->GetScoresToBeat(level, config, py_callback);
|
g_platform->GetScoresToBeat(level, config, py_callback);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushPurchaseCall(const std::string& item) {
|
void App::PushPurchaseCall(const std::string& item) {
|
||||||
PushCall([this, item] {
|
PushCall([item] {
|
||||||
assert(InMainThread());
|
assert(InMainThread());
|
||||||
g_platform->Purchase(item);
|
g_platform->Purchase(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushRestorePurchasesCall() {
|
void App::PushRestorePurchasesCall() {
|
||||||
PushCall([this] {
|
PushCall([] {
|
||||||
assert(InMainThread());
|
assert(InMainThread());
|
||||||
g_platform->RestorePurchases();
|
g_platform->RestorePurchases();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushOpenURLCall(const std::string& url) {
|
void App::PushOpenURLCall(const std::string& url) {
|
||||||
PushCall([this, url] { g_platform->OpenURL(url); });
|
PushCall([url] { g_platform->OpenURL(url); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushGetFriendScoresCall(const std::string& game,
|
void App::PushGetFriendScoresCall(const std::string& game,
|
||||||
const std::string& game_version, void* data) {
|
const std::string& game_version, void* data) {
|
||||||
PushCall([this, game, game_version, data] {
|
PushCall([game, game_version, data] {
|
||||||
g_platform->GetFriendScores(game, game_version, data);
|
g_platform->GetFriendScores(game, game_version, data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushSubmitScoreCall(const std::string& game,
|
void App::PushSubmitScoreCall(const std::string& game,
|
||||||
const std::string& game_version, int64_t score) {
|
const std::string& game_version, int64_t score) {
|
||||||
PushCall([this, game, game_version, score] {
|
PushCall([game, game_version, score] {
|
||||||
g_platform->SubmitScore(game, game_version, score);
|
g_platform->SubmitScore(game, game_version, score);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushAchievementReportCall(const std::string& achievement) {
|
void App::PushAchievementReportCall(const std::string& achievement) {
|
||||||
PushCall([this, achievement] { g_platform->ReportAchievement(achievement); });
|
PushCall([achievement] { g_platform->ReportAchievement(achievement); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::PushStringEditCall(const std::string& name, const std::string& value,
|
void App::PushStringEditCall(const std::string& name, const std::string& value,
|
||||||
int max_chars) {
|
int max_chars) {
|
||||||
PushCall([this, name, value, max_chars] {
|
PushCall([name, value, max_chars] {
|
||||||
static millisecs_t last_edit_time = 0;
|
static millisecs_t last_edit_time = 0;
|
||||||
millisecs_t t = GetRealTime();
|
millisecs_t t = GetRealTime();
|
||||||
|
|
||||||
@ -367,7 +366,7 @@ void App::PushSetStressTestingCall(bool enable, int player_count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void App::PushResetAchievementsCall() {
|
void App::PushResetAchievementsCall() {
|
||||||
PushCall([this] { g_platform->ResetAchievements(); });
|
PushCall([] { g_platform->ResetAchievements(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnBootstrapComplete() {
|
void App::OnBootstrapComplete() {
|
||||||
@ -390,7 +389,7 @@ void App::OnBootstrapComplete() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void App::PushCursorUpdate(bool vis) {
|
void App::PushCursorUpdate(bool vis) {
|
||||||
PushCall([this, vis] {
|
PushCall([vis] {
|
||||||
assert(InMainThread());
|
assert(InMainThread());
|
||||||
g_platform->SetHardwareCursorVisible(vis);
|
g_platform->SetHardwareCursorVisible(vis);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -133,7 +133,6 @@ class App : public Module {
|
|||||||
bool done_{};
|
bool done_{};
|
||||||
bool server_wrapper_managed_{};
|
bool server_wrapper_managed_{};
|
||||||
bool sys_paused_app_{};
|
bool sys_paused_app_{};
|
||||||
bool user_paused_app_{};
|
|
||||||
bool actually_paused_{};
|
bool actually_paused_{};
|
||||||
std::unique_ptr<StressTest> stress_test_;
|
std::unique_ptr<StressTest> stress_test_;
|
||||||
millisecs_t last_resize_draw_event_time_{};
|
millisecs_t last_resize_draw_event_time_{};
|
||||||
|
|||||||
@ -87,7 +87,7 @@ auto Audio::IsSoundPlaying(uint32_t play_id) -> bool {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Audio::SourceBeginExisting(uint32_t play_id, uint32_t debug_id)
|
auto Audio::SourceBeginExisting(uint32_t play_id, int debug_id)
|
||||||
-> AudioSource* {
|
-> AudioSource* {
|
||||||
BA_DEBUG_FUNCTION_TIMER_BEGIN();
|
BA_DEBUG_FUNCTION_TIMER_BEGIN();
|
||||||
uint32_t source_id = AudioServer::source_id_from_play_id(play_id);
|
uint32_t source_id = AudioServer::source_id_from_play_id(play_id);
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class Audio {
|
|||||||
|
|
||||||
// If a sound play id is playing, locks and returns its sound source.
|
// If a sound play id is playing, locks and returns its sound source.
|
||||||
// on success, you must unlock the source once done with it.
|
// on success, you must unlock the source once done with it.
|
||||||
auto SourceBeginExisting(uint32_t play_id, uint32_t debug_id) -> AudioSource*;
|
auto SourceBeginExisting(uint32_t play_id, int debug_id) -> AudioSource*;
|
||||||
|
|
||||||
// Return true if the sound id is currently valid. This is not guaranteed
|
// Return true if the sound id is currently valid. This is not guaranteed
|
||||||
// to be super accurate, but can be used to determine if a sound is still
|
// to be super accurate, but can be used to determine if a sound is still
|
||||||
|
|||||||
@ -37,8 +37,8 @@ const bool kShowInUseSounds = false;
|
|||||||
int AudioServer::al_source_count_ = 0;
|
int AudioServer::al_source_count_ = 0;
|
||||||
|
|
||||||
struct AudioServer::Impl {
|
struct AudioServer::Impl {
|
||||||
Impl() {}
|
Impl() = default;
|
||||||
~Impl() {}
|
~Impl() = default;
|
||||||
|
|
||||||
#if BA_ENABLE_AUDIO
|
#if BA_ENABLE_AUDIO
|
||||||
ALCcontext* alc_context_{};
|
ALCcontext* alc_context_{};
|
||||||
@ -417,7 +417,6 @@ AudioServer::AudioServer(Thread* thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AudioServer::~AudioServer() {
|
AudioServer::~AudioServer() {
|
||||||
delete impl_;
|
|
||||||
#if BA_ENABLE_AUDIO
|
#if BA_ENABLE_AUDIO
|
||||||
sound_source_refs_.clear();
|
sound_source_refs_.clear();
|
||||||
|
|
||||||
@ -434,6 +433,7 @@ AudioServer::~AudioServer() {
|
|||||||
assert(al_source_count_ == 0);
|
assert(al_source_count_ == 0);
|
||||||
|
|
||||||
#endif // BA_ENABLE_AUDIO
|
#endif // BA_ENABLE_AUDIO
|
||||||
|
delete impl_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioServer::UpdateAvailableSources() {
|
void AudioServer::UpdateAvailableSources() {
|
||||||
|
|||||||
@ -49,6 +49,11 @@ auto AudioStreamer::Play() -> bool {
|
|||||||
alSourcePlay(source_);
|
alSourcePlay(source_);
|
||||||
CHECK_AL_ERROR;
|
CHECK_AL_ERROR;
|
||||||
|
|
||||||
|
// Suppress 'always returns true' lint.
|
||||||
|
if (explicit_bool(false)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,11 +137,17 @@ auto AudioStreamer::Stream(ALuint buffer) -> bool {
|
|||||||
CHECK_AL_ERROR;
|
CHECK_AL_ERROR;
|
||||||
DoStream(pcm, &size, &rate);
|
DoStream(pcm, &size, &rate);
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
alBufferData(buffer, al_format(), pcm, size, rate);
|
alBufferData(buffer, al_format(), pcm, size, static_cast<ALsizei>(rate));
|
||||||
CHECK_AL_ERROR;
|
CHECK_AL_ERROR;
|
||||||
} else {
|
} else {
|
||||||
eof_ = true;
|
eof_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Suppress 'always returns true' lint.
|
||||||
|
if (explicit_bool(false)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
namespace ballistica {
|
namespace ballistica {
|
||||||
|
|
||||||
// These are set automatically via script; don't change here.
|
// These are set automatically via script; don't change here.
|
||||||
const int kAppBuildNumber = 20333;
|
const int kAppBuildNumber = 20336;
|
||||||
const char* kAppVersion = "1.6.0";
|
const char* kAppVersion = "1.6.0";
|
||||||
|
|
||||||
// Our standalone globals.
|
// Our standalone globals.
|
||||||
|
|||||||
@ -21,9 +21,9 @@ auto FatalError::ReportFatalError(const std::string& message,
|
|||||||
// blessed build. If we are, our main goal is to communicate as much info
|
// blessed build. If we are, our main goal is to communicate as much info
|
||||||
// about the error to the master server, and communicating to the user is
|
// about the error to the master server, and communicating to the user is
|
||||||
// a stretch goal.
|
// a stretch goal.
|
||||||
// If we are unblessed or modified, the main goals are communicating the error
|
// If we are unblessed or modified, the main goals are communicating the
|
||||||
// to the user and exiting the app cleanly (so we don't pollute our crash
|
// error to the user and exiting the app cleanly (so we don't pollute our
|
||||||
// records with results of user tinkering).
|
// crash records with results of user tinkering).
|
||||||
|
|
||||||
// Try to avoid crash reports if we're not a clean blessed build.
|
// Try to avoid crash reports if we're not a clean blessed build.
|
||||||
// bool exit_cleanly = !IsUnmodifiedBlessedBuild();
|
// bool exit_cleanly = !IsUnmodifiedBlessedBuild();
|
||||||
|
|||||||
@ -287,16 +287,6 @@ void Thread::GetThreadMessages(std::list<ThreadMessage>* messages) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thread::WriteToOwner(const void* data, uint32_t size) {
|
|
||||||
assert(std::this_thread::get_id() == thread_id());
|
|
||||||
{
|
|
||||||
std::unique_lock<std::mutex> lock(data_to_client_mutex_);
|
|
||||||
data_to_client_.emplace_back(size);
|
|
||||||
memcpy(&(data_to_client_.back()[0]), data, size);
|
|
||||||
}
|
|
||||||
data_to_client_cv_.notify_all();
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread::Thread(ThreadIdentifier identifier_in, ThreadType type_in)
|
Thread::Thread(ThreadIdentifier identifier_in, ThreadType type_in)
|
||||||
: type_(type_in), identifier_(identifier_in) {
|
: type_(type_in), identifier_(identifier_in) {
|
||||||
switch (type_) {
|
switch (type_) {
|
||||||
@ -419,6 +409,11 @@ auto Thread::ThreadMain() -> int {
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Silence some lint complaints about always returning 0.
|
||||||
|
if (explicit_bool(false)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -438,6 +433,9 @@ void Thread::Quit() {
|
|||||||
|
|
||||||
Thread::~Thread() = default;
|
Thread::~Thread() = default;
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
void Thread::LogThreadMessageTally() {
|
void Thread::LogThreadMessageTally() {
|
||||||
// Prevent recursion.
|
// Prevent recursion.
|
||||||
if (!writing_tally_) {
|
if (!writing_tally_) {
|
||||||
@ -498,6 +496,7 @@ void Thread::LogThreadMessageTally() {
|
|||||||
writing_tally_ = false;
|
writing_tally_ = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
void Thread::PushThreadMessage(const ThreadMessage& t) {
|
void Thread::PushThreadMessage(const ThreadMessage& t) {
|
||||||
{
|
{
|
||||||
@ -555,6 +554,19 @@ void Thread::PushThreadMessage(const ThreadMessage& t) {
|
|||||||
thread_message_cv_.notify_all();
|
thread_message_cv_.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantParameter"
|
||||||
|
|
||||||
|
void Thread::WriteToOwner(const void* data, uint32_t size) {
|
||||||
|
assert(std::this_thread::get_id() == thread_id());
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(data_to_client_mutex_);
|
||||||
|
data_to_client_.emplace_back(size);
|
||||||
|
memcpy(&(data_to_client_.back()[0]), data, size);
|
||||||
|
}
|
||||||
|
data_to_client_cv_.notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
void Thread::ReadFromThread(std::unique_lock<std::mutex>* lock, void* buffer,
|
void Thread::ReadFromThread(std::unique_lock<std::mutex>* lock, void* buffer,
|
||||||
uint32_t size) {
|
uint32_t size) {
|
||||||
// Threads cant read from themselves.. could load to lock-deadlock.
|
// Threads cant read from themselves.. could load to lock-deadlock.
|
||||||
@ -572,6 +584,8 @@ void Thread::ReadFromThread(std::unique_lock<std::mutex>* lock, void* buffer,
|
|||||||
data_to_client_.pop_front();
|
data_to_client_.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
void Thread::SetThreadsPaused(bool paused) {
|
void Thread::SetThreadsPaused(bool paused) {
|
||||||
threads_paused_ = paused;
|
threads_paused_ = paused;
|
||||||
for (auto&& i : g_app_globals->pausable_threads) {
|
for (auto&& i : g_app_globals->pausable_threads) {
|
||||||
|
|||||||
@ -362,8 +362,6 @@ void BGDynamics::DrawChunks(FrameDef* frame_def,
|
|||||||
c.SetColor(0.9f, 0.6f, 0.3f, 1.0f);
|
c.SetColor(0.9f, 0.6f, 0.3f, 1.0f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
throw Exception();
|
|
||||||
}
|
}
|
||||||
c.DrawModelInstanced(model, *draw_snapshot, kModelDrawFlagNoReflection);
|
c.DrawModelInstanced(model, *draw_snapshot, kModelDrawFlagNoReflection);
|
||||||
c.Submit();
|
c.Submit();
|
||||||
|
|||||||
@ -1689,7 +1689,8 @@ auto BGDynamicsServer::CreateDrawSnapshot() -> BGDynamicsDrawSnapshot* {
|
|||||||
float flicker = i->flicker_;
|
float flicker = i->flicker_;
|
||||||
float shadow_dist = i->shadow_dist_;
|
float shadow_dist = i->shadow_dist_;
|
||||||
float life = std::min(
|
float life = std::min(
|
||||||
1.0f, (static_cast<float>(time_) - i->birth_time_) / i->lifespan_);
|
1.0f, (static_cast<float>(time_) - static_cast<float>(i->birth_time_))
|
||||||
|
/ i->lifespan_);
|
||||||
|
|
||||||
// Shrink our matrix down over time.
|
// Shrink our matrix down over time.
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -2218,7 +2219,8 @@ void BGDynamicsServer::PushTooSlowCall() {
|
|||||||
if (chunk_count_ > 0 || tendril_count_thick_ > 0
|
if (chunk_count_ > 0 || tendril_count_thick_ > 0
|
||||||
|| tendril_count_thin_ > 0) {
|
|| tendril_count_thin_ > 0) {
|
||||||
// Ok lets kill a small percentage of our oldest chunks.
|
// Ok lets kill a small percentage of our oldest chunks.
|
||||||
int killcount = static_cast<int>(0.1f * chunks_.size());
|
int killcount =
|
||||||
|
static_cast<int>(0.1f * static_cast<float>(chunks_.size()));
|
||||||
int killed = 0;
|
int killed = 0;
|
||||||
auto i = chunks_.begin();
|
auto i = chunks_.begin();
|
||||||
while (i != chunks_.end()) {
|
while (i != chunks_.end()) {
|
||||||
@ -2236,7 +2238,7 @@ void BGDynamicsServer::PushTooSlowCall() {
|
|||||||
i = i_next;
|
i = i_next;
|
||||||
}
|
}
|
||||||
// ...and tendrils.
|
// ...and tendrils.
|
||||||
killcount = static_cast<int>(0.2f * tendrils_.size());
|
killcount = static_cast<int>(0.2f * static_cast<float>(tendrils_.size()));
|
||||||
for (int j = 0; j < killcount; j++) {
|
for (int j = 0; j < killcount; j++) {
|
||||||
Tendril* t = *tendrils_.begin();
|
Tendril* t = *tendrils_.begin();
|
||||||
if (t->type_ == BGDynamicsTendrilType::kThinSmoke) {
|
if (t->type_ == BGDynamicsTendrilType::kThinSmoke) {
|
||||||
|
|||||||
@ -75,8 +75,13 @@ void MaterialConditionNode::Restore(const char** buffer, ClientSession* cs) {
|
|||||||
val1 = Utils::ExtractInt32NBO(buffer);
|
val1 = Utils::ExtractInt32NBO(buffer);
|
||||||
val2 = Utils::ExtractInt32NBO(buffer);
|
val2 = Utils::ExtractInt32NBO(buffer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Currently not reachable, but guarding in case GetValueCount changes.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
default:
|
default:
|
||||||
throw Exception();
|
throw Exception();
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// not a leaf node - make ourself some children
|
// not a leaf node - make ourself some children
|
||||||
|
|||||||
@ -425,8 +425,6 @@ auto RigidBody::SetDimensions(float d1, float d2, float d3, float m1, float m2,
|
|||||||
case Shape::kTrimesh: // NOLINT(bugprone-branch-clone)
|
case Shape::kTrimesh: // NOLINT(bugprone-branch-clone)
|
||||||
// Trimesh bodies not supported yet.
|
// Trimesh bodies not supported yet.
|
||||||
throw Exception();
|
throw Exception();
|
||||||
default:
|
|
||||||
throw Exception();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to handle groups here.
|
// Need to handle groups here.
|
||||||
|
|||||||
@ -904,7 +904,7 @@ void Game::PushInGameConsoleScriptCommand(const std::string& command) {
|
|||||||
g_app_globals->user_ran_commands = true;
|
g_app_globals->user_ran_commands = true;
|
||||||
}
|
}
|
||||||
if (cmd.CanEval()) {
|
if (cmd.CanEval()) {
|
||||||
PyObject* obj = cmd.RunReturnObj(true);
|
PyObject* obj = cmd.RunReturnObj(true, nullptr);
|
||||||
if (obj && obj != Py_None) {
|
if (obj && obj != Py_None) {
|
||||||
PyObject* s = PyObject_Repr(obj);
|
PyObject* s = PyObject_Repr(obj);
|
||||||
if (s) {
|
if (s) {
|
||||||
@ -935,7 +935,7 @@ void Game::PushStdinScriptCommand(const std::string& command) {
|
|||||||
|
|
||||||
// Eval this if possible (so we can possibly print return value).
|
// Eval this if possible (so we can possibly print return value).
|
||||||
if (cmd.CanEval()) {
|
if (cmd.CanEval()) {
|
||||||
if (PyObject* obj = cmd.RunReturnObj(true)) {
|
if (PyObject* obj = cmd.RunReturnObj(true, nullptr)) {
|
||||||
// Print the value if we're running directly from a terminal
|
// Print the value if we're running directly from a terminal
|
||||||
// (or being run under the server-manager)
|
// (or being run under the server-manager)
|
||||||
if ((IsStdinATerminal() || g_app->server_wrapper_managed())
|
if ((IsStdinATerminal() || g_app->server_wrapper_managed())
|
||||||
|
|||||||
@ -15,7 +15,7 @@ namespace ballistica {
|
|||||||
// stream of messages that can be saved to file or sent over the network.
|
// stream of messages that can be saved to file or sent over the network.
|
||||||
class GameStream : public Object, public ClientControllerInterface {
|
class GameStream : public Object, public ClientControllerInterface {
|
||||||
public:
|
public:
|
||||||
GameStream(HostSession* host_session, bool saveReplay);
|
GameStream(HostSession* host_session, bool save_replay);
|
||||||
~GameStream() override;
|
~GameStream() override;
|
||||||
auto SetTime(millisecs_t t) -> void;
|
auto SetTime(millisecs_t t) -> void;
|
||||||
auto AddScene(Scene* s) -> void;
|
auto AddScene(Scene* s) -> void;
|
||||||
|
|||||||
@ -120,8 +120,8 @@ auto base64_decode(const std::string& encoded_string, bool urlsafe)
|
|||||||
in_++;
|
in_++;
|
||||||
if (i == 4) {
|
if (i == 4) {
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
char_array_4[i] =
|
char_array_4[i] = static_cast<unsigned char>(
|
||||||
static_cast<unsigned char>(base64_chars.find(char_array_4[i]));
|
base64_chars.find(static_cast<char>(char_array_4[i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
char_array_3[0] = static_cast<unsigned char>(
|
char_array_3[0] = static_cast<unsigned char>(
|
||||||
@ -131,7 +131,7 @@ auto base64_decode(const std::string& encoded_string, bool urlsafe)
|
|||||||
char_array_3[2] = static_cast<unsigned char>(
|
char_array_3[2] = static_cast<unsigned char>(
|
||||||
((char_array_4[2] & 0x3u) << 6u) + char_array_4[3]);
|
((char_array_4[2] & 0x3u) << 6u) + char_array_4[3]);
|
||||||
|
|
||||||
for (i = 0; (i < 3); i++) ret += char_array_3[i];
|
for (i = 0; (i < 3); i++) ret += static_cast<char>(char_array_3[i]);
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,8 +140,8 @@ auto base64_decode(const std::string& encoded_string, bool urlsafe)
|
|||||||
char_array_4[j] = 0;
|
char_array_4[j] = 0;
|
||||||
}
|
}
|
||||||
for (int j = 0; j < 4; j++) { // NOLINT(modernize-loop-convert)
|
for (int j = 0; j < 4; j++) { // NOLINT(modernize-loop-convert)
|
||||||
char_array_4[j] =
|
char_array_4[j] = static_cast<unsigned char>(
|
||||||
static_cast<unsigned char>(base64_chars.find(char_array_4[j]));
|
base64_chars.find(static_cast<char>(char_array_4[j])));
|
||||||
}
|
}
|
||||||
char_array_3[0] = static_cast<unsigned char>(
|
char_array_3[0] = static_cast<unsigned char>(
|
||||||
(char_array_4[0] << 2u) + ((char_array_4[1] & 0x30u) >> 4u));
|
(char_array_4[0] << 2u) + ((char_array_4[1] & 0x30u) >> 4u));
|
||||||
@ -150,7 +150,7 @@ auto base64_decode(const std::string& encoded_string, bool urlsafe)
|
|||||||
char_array_3[2] = static_cast<unsigned char>(
|
char_array_3[2] = static_cast<unsigned char>(
|
||||||
((char_array_4[2] & 0x3u) << 6u) + char_array_4[3]);
|
((char_array_4[2] & 0x3u) << 6u) + char_array_4[3]);
|
||||||
for (int j = 0; (j < i - 1); j++) {
|
for (int j = 0; (j < i - 1); j++) {
|
||||||
ret += char_array_3[j];
|
ret += static_cast<char>(char_array_3[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -865,6 +865,9 @@ auto cJSON_DetachItemFromArray(cJSON* array, int which) -> cJSON* {
|
|||||||
void cJSON_DeleteItemFromArray(cJSON* array, int which) {
|
void cJSON_DeleteItemFromArray(cJSON* array, int which) {
|
||||||
cJSON_Delete(cJSON_DetachItemFromArray(array, which));
|
cJSON_Delete(cJSON_DetachItemFromArray(array, which));
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantFunctionResult"
|
||||||
|
|
||||||
auto cJSON_DetachItemFromObject(cJSON* object, const char* string) -> cJSON* {
|
auto cJSON_DetachItemFromObject(cJSON* object, const char* string) -> cJSON* {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
cJSON* c = object->child;
|
cJSON* c = object->child;
|
||||||
@ -875,6 +878,9 @@ auto cJSON_DetachItemFromObject(cJSON* object, const char* string) -> cJSON* {
|
|||||||
if (c) return cJSON_DetachItemFromArray(object, i);
|
if (c) return cJSON_DetachItemFromArray(object, i);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
void cJSON_DeleteItemFromObject(cJSON* object, const char* string) {
|
void cJSON_DeleteItemFromObject(cJSON* object, const char* string) {
|
||||||
cJSON_Delete(cJSON_DetachItemFromObject(object, string));
|
cJSON_Delete(cJSON_DetachItemFromObject(object, string));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,7 +243,7 @@ auto Utils::GetValidUTF8(const char* str, const char* loc) -> std::string {
|
|||||||
for (i = 0; i < f_size; i++) {
|
for (i = 0; i < f_size; i++) {
|
||||||
c = (unsigned char)(str)[i];
|
c = (unsigned char)(str)[i];
|
||||||
if (c < 127) { // normal ASCII
|
if (c < 127) { // normal ASCII
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,19 +268,19 @@ auto Utils::GetValidUTF8(const char* str, const char* loc) -> std::string {
|
|||||||
c = (unsigned char)(str)[i];
|
c = (unsigned char)(str)[i];
|
||||||
if (c < 32) { // control char
|
if (c < 32) { // control char
|
||||||
if (c == 9 || c == 10 || c == 13) { // allow only \t \n \r
|
if (c == 9 || c == 10 || c == 13) { // allow only \t \n \r
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else if (c < 127) { // normal ASCII
|
} else if (c < 127) { // normal ASCII
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
continue;
|
continue;
|
||||||
} else if (c < 160) {
|
} else if (c < 160) {
|
||||||
// control char (nothing should be defined here either
|
// control char (nothing should be defined here either
|
||||||
// ASCI, ISO_8859-1 or UTF8, so skipping)
|
// ASCI, ISO_8859-1 or UTF8, so skipping)
|
||||||
if (c2 == 128) { // fix microsoft mess, add euro
|
if (c2 == 128) { // fix microsoft mess, add euro
|
||||||
to.append(1, (unsigned char)(226));
|
to.append(1, static_cast<char>((unsigned char)(226)));
|
||||||
to.append(1, (unsigned char)(130));
|
to.append(1, static_cast<char>((unsigned char)(130)));
|
||||||
to.append(1, (unsigned char)(172));
|
to.append(1, static_cast<char>((unsigned char)(172)));
|
||||||
}
|
}
|
||||||
if (c2 == 133) { // fix IBM mess, add NEL = \n\r
|
if (c2 == 133) { // fix IBM mess, add NEL = \n\r
|
||||||
to.append(1, 10);
|
to.append(1, 10);
|
||||||
@ -288,11 +288,11 @@ auto Utils::GetValidUTF8(const char* str, const char* loc) -> std::string {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else if (c < 192) { // invalid for UTF8, converting ASCII
|
} else if (c < 192) { // invalid for UTF8, converting ASCII
|
||||||
to.append(1, (unsigned char)194);
|
to.append(1, static_cast<char>((unsigned char)194));
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
continue;
|
continue;
|
||||||
} else if (c < 194) { // invalid for UTF8, converting ASCII
|
} else if (c < 194) { // invalid for UTF8, converting ASCII
|
||||||
to.append(1, (unsigned char)195);
|
to.append(1, static_cast<char>((unsigned char)195));
|
||||||
to.append(1, c - 64);
|
to.append(1, c - 64);
|
||||||
continue;
|
continue;
|
||||||
} else if (c < 224 && i + 1 < f_size) { // possibly 2byte UTF8
|
} else if (c < 224 && i + 1 < f_size) { // possibly 2byte UTF8
|
||||||
@ -300,8 +300,8 @@ auto Utils::GetValidUTF8(const char* str, const char* loc) -> std::string {
|
|||||||
if (c2 > 127 && c2 < 192) { // valid 2byte UTF8
|
if (c2 > 127 && c2 < 192) { // valid 2byte UTF8
|
||||||
if (c == 194 && c2 < 160) { // control char, skipping
|
if (c == 194 && c2 < 160) { // control char, skipping
|
||||||
} else {
|
} else {
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
to.append(1, c2);
|
to.append(1, static_cast<char>(c2));
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
@ -310,9 +310,9 @@ auto Utils::GetValidUTF8(const char* str, const char* loc) -> std::string {
|
|||||||
c2 = (unsigned char)(str)[i + 1];
|
c2 = (unsigned char)(str)[i + 1];
|
||||||
c3 = (unsigned char)(str)[i + 2];
|
c3 = (unsigned char)(str)[i + 2];
|
||||||
if (c2 > 127 && c2 < 192 && c3 > 127 && c3 < 192) { // valid 3byte UTF8
|
if (c2 > 127 && c2 < 192 && c3 > 127 && c3 < 192) { // valid 3byte UTF8
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
to.append(1, c2);
|
to.append(1, static_cast<char>(c2));
|
||||||
to.append(1, c3);
|
to.append(1, static_cast<char>(c3));
|
||||||
i += 2;
|
i += 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -323,17 +323,17 @@ auto Utils::GetValidUTF8(const char* str, const char* loc) -> std::string {
|
|||||||
if (c2 > 127 && c2 < 192 && c3 > 127 && c3 < 192 && c4 > 127
|
if (c2 > 127 && c2 < 192 && c3 > 127 && c3 < 192 && c4 > 127
|
||||||
&& c4 < 192) {
|
&& c4 < 192) {
|
||||||
// valid 4byte UTF8
|
// valid 4byte UTF8
|
||||||
to.append(1, c);
|
to.append(1, static_cast<char>(c));
|
||||||
to.append(1, c2);
|
to.append(1, static_cast<char>(c2));
|
||||||
to.append(1, c3);
|
to.append(1, static_cast<char>(c3));
|
||||||
to.append(1, c4);
|
to.append(1, static_cast<char>(c4));
|
||||||
i += 3;
|
i += 3;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// invalid UTF8, converting ASCII
|
// invalid UTF8, converting ASCII
|
||||||
// (c>245 || string too short for multi-byte))
|
// (c>245 || string too short for multi-byte))
|
||||||
to.append(1, (unsigned char)195);
|
to.append(1, static_cast<char>((unsigned char)195));
|
||||||
to.append(1, c - 64);
|
to.append(1, c - 64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -424,11 +424,16 @@ static std::list<std::string>* g_random_names_list = nullptr;
|
|||||||
|
|
||||||
auto Utils::GetRandomNameList() -> const std::list<std::string>& {
|
auto Utils::GetRandomNameList() -> const std::list<std::string>& {
|
||||||
assert(InGameThread());
|
assert(InGameThread());
|
||||||
if (!g_random_names_list) {
|
if (g_random_names_list == nullptr) {
|
||||||
// this will init the list with our default english names
|
// This will init the list with our default english names.
|
||||||
SetRandomNameList(std::list<std::string>(1, "DEFAULT_NAMES"));
|
SetRandomNameList(std::list<std::string>(1, "DEFAULT_NAMES"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clion incorrectly thinks this might be null.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "NullDereferences"
|
||||||
return *g_random_names_list;
|
return *g_random_names_list;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utils::SetRandomNameList(const std::list<std::string>& custom_names) {
|
void Utils::SetRandomNameList(const std::list<std::string>& custom_names) {
|
||||||
|
|||||||
@ -606,6 +606,7 @@ void Camera::Update(millisecs_t elapsed) {
|
|||||||
|
|
||||||
// Prevent camera "explosions" if we've been unable to update for a while.
|
// Prevent camera "explosions" if we've been unable to update for a while.
|
||||||
elapsed = std::min(millisecs_t{100}, elapsed);
|
elapsed = std::min(millisecs_t{100}, elapsed);
|
||||||
|
auto elapsedf{static_cast<float>(elapsed)};
|
||||||
|
|
||||||
// In normal mode we orbit; in vr mode we don't.
|
// In normal mode we orbit; in vr mode we don't.
|
||||||
if (IsVRMode()) {
|
if (IsVRMode()) {
|
||||||
@ -626,36 +627,36 @@ void Camera::Update(millisecs_t elapsed) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target_radius_smoothed_ +=
|
target_radius_smoothed_ +=
|
||||||
elapsed * (target_radius_ - target_radius_smoothed_) * zoom_speed;
|
elapsedf * (target_radius_ - target_radius_smoothed_) * zoom_speed;
|
||||||
|
|
||||||
float diff = field_of_view_x_ - field_of_view_x_smoothed_;
|
float diff = field_of_view_x_ - field_of_view_x_smoothed_;
|
||||||
field_of_view_x_smoothed_ +=
|
field_of_view_x_smoothed_ +=
|
||||||
elapsed * diff * (diff > 0.0f ? fov_speed_out : fov_speed_in);
|
elapsedf * diff * (diff > 0.0f ? fov_speed_out : fov_speed_in);
|
||||||
|
|
||||||
diff = field_of_view_y_ - field_of_view_y_smoothed_;
|
diff = field_of_view_y_ - field_of_view_y_smoothed_;
|
||||||
field_of_view_y_smoothed_ +=
|
field_of_view_y_smoothed_ +=
|
||||||
elapsed * diff * (diff > 0.0f ? fov_speed_out : fov_speed_in);
|
elapsedf * diff * (diff > 0.0f ? fov_speed_out : fov_speed_in);
|
||||||
|
|
||||||
if (x_constrained_) {
|
if (x_constrained_) {
|
||||||
xy_constrain_blend_ +=
|
xy_constrain_blend_ +=
|
||||||
elapsed * (1.0f - xy_constrain_blend_) * xy_blend_speed;
|
elapsedf * (1.0f - xy_constrain_blend_) * xy_blend_speed;
|
||||||
xy_constrain_blend_ = std::min(1.0f, xy_constrain_blend_);
|
xy_constrain_blend_ = std::min(1.0f, xy_constrain_blend_);
|
||||||
} else {
|
} else {
|
||||||
xy_constrain_blend_ +=
|
xy_constrain_blend_ +=
|
||||||
elapsed * (0.0f - xy_constrain_blend_) * xy_blend_speed * elapsed;
|
elapsedf * (0.0f - xy_constrain_blend_) * xy_blend_speed * elapsedf;
|
||||||
xy_constrain_blend_ = std::max(0.0f, xy_constrain_blend_);
|
xy_constrain_blend_ = std::max(0.0f, xy_constrain_blend_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsVRMode()) {
|
if (!IsVRMode()) {
|
||||||
smooth_speed_.x += elapsed * rand_component
|
smooth_speed_.x += elapsedf * rand_component
|
||||||
* (-0.5f
|
* (-0.5f
|
||||||
+ Utils::precalc_rand_1((real_time / rand_incr_1)
|
+ Utils::precalc_rand_1((real_time / rand_incr_1)
|
||||||
% kPrecalcRandsCount));
|
% kPrecalcRandsCount));
|
||||||
smooth_speed_.y += elapsed * rand_component
|
smooth_speed_.y += elapsedf * rand_component
|
||||||
* (-0.5f
|
* (-0.5f
|
||||||
+ Utils::precalc_rand_2((real_time / rand_incr_2)
|
+ Utils::precalc_rand_2((real_time / rand_incr_2)
|
||||||
% kPrecalcRandsCount));
|
% kPrecalcRandsCount));
|
||||||
smooth_speed_.z += elapsed * rand_component
|
smooth_speed_.z += elapsedf * rand_component
|
||||||
* (-0.5f
|
* (-0.5f
|
||||||
+ Utils::precalc_rand_3((real_time / rand_incr_3)
|
+ Utils::precalc_rand_3((real_time / rand_incr_3)
|
||||||
% kPrecalcRandsCount));
|
% kPrecalcRandsCount));
|
||||||
@ -663,11 +664,11 @@ void Camera::Update(millisecs_t elapsed) {
|
|||||||
|
|
||||||
if (RandomFloat() < 0.1f && !IsVRMode()) {
|
if (RandomFloat() < 0.1f && !IsVRMode()) {
|
||||||
smooth_speed_2_.x +=
|
smooth_speed_2_.x +=
|
||||||
elapsed * rand_component * 4.0f * (-0.5f + RandomFloat());
|
elapsedf * rand_component * 4.0f * (-0.5f + RandomFloat());
|
||||||
smooth_speed_2_.y +=
|
smooth_speed_2_.y +=
|
||||||
elapsed * rand_component * 4.0f * (-0.5f + RandomFloat());
|
elapsedf * rand_component * 4.0f * (-0.5f + RandomFloat());
|
||||||
smooth_speed_2_.z +=
|
smooth_speed_2_.z +=
|
||||||
elapsed * rand_component * 4.0f * (-0.5f + RandomFloat());
|
elapsedf * rand_component * 4.0f * (-0.5f + RandomFloat());
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have no important areas of interest, keep our camera from moving too
|
// If we have no important areas of interest, keep our camera from moving too
|
||||||
|
|||||||
@ -351,6 +351,10 @@ void GraphicsServer::SetScreen(bool fullscreen, int width, int height,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
#pragma ide diagnostic ignored "ConstantParameter"
|
||||||
|
|
||||||
void GraphicsServer::HandleFullContextScreenRebuild(
|
void GraphicsServer::HandleFullContextScreenRebuild(
|
||||||
bool need_full_context_rebuild, bool fullscreen, int width, int height,
|
bool need_full_context_rebuild, bool fullscreen, int width, int height,
|
||||||
GraphicsQuality graphics_quality_requested,
|
GraphicsQuality graphics_quality_requested,
|
||||||
@ -457,6 +461,8 @@ void GraphicsServer::HandleFullContextScreenRebuild(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
// Given physical res, calculate virtual res.
|
// Given physical res, calculate virtual res.
|
||||||
void GraphicsServer::CalcVirtualRes(float* x, float* y) {
|
void GraphicsServer::CalcVirtualRes(float* x, float* y) {
|
||||||
float x_in = (*x);
|
float x_in = (*x);
|
||||||
@ -523,6 +529,10 @@ void GraphicsServer::HandlePushAndroidRes(const std::string& android_res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
#pragma ide diagnostic ignored "ConstantParameter"
|
||||||
|
|
||||||
void GraphicsServer::HandleFullscreenToggling(bool do_set_existing_fs,
|
void GraphicsServer::HandleFullscreenToggling(bool do_set_existing_fs,
|
||||||
bool do_toggle_fs,
|
bool do_toggle_fs,
|
||||||
bool fullscreen) {
|
bool fullscreen) {
|
||||||
@ -560,6 +570,7 @@ void GraphicsServer::HandleFullscreenToggling(bool do_set_existing_fs,
|
|||||||
#endif // macos && xcode_build
|
#endif // macos && xcode_build
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
void GraphicsServer::SetTextureCompressionTypes(
|
void GraphicsServer::SetTextureCompressionTypes(
|
||||||
const std::list<TextureCompressionType>& types) {
|
const std::list<TextureCompressionType>& types) {
|
||||||
@ -645,6 +656,9 @@ void GraphicsServer::SetCamera(const Vector3f& eye, const Vector3f& target,
|
|||||||
cam_orient_matrix_dirty_ = true;
|
cam_orient_matrix_dirty_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
void GraphicsServer::UpdateCamOrientMatrix() {
|
void GraphicsServer::UpdateCamOrientMatrix() {
|
||||||
assert(InGraphicsThread());
|
assert(InGraphicsThread());
|
||||||
if (cam_orient_matrix_dirty_) {
|
if (cam_orient_matrix_dirty_) {
|
||||||
@ -672,6 +686,8 @@ void GraphicsServer::UpdateCamOrientMatrix() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#pragma mark PushCalls
|
#pragma mark PushCalls
|
||||||
|
|
||||||
void GraphicsServer::PushSetScreenCall(bool fullscreen, int width, int height,
|
void GraphicsServer::PushSetScreenCall(bool fullscreen, int width, int height,
|
||||||
|
|||||||
@ -2205,6 +2205,10 @@ void KTXUnpackETC(const GLubyte* srcETC, const GLenum srcFormat,
|
|||||||
|
|
||||||
if (alphaFormat != AF_NONE) setupAlphaTable();
|
if (alphaFormat != AF_NONE) setupAlphaTable();
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
|
||||||
// NOTE: none of the decompress functions actually use the <height> parameter
|
// NOTE: none of the decompress functions actually use the <height> parameter
|
||||||
if (alphaFormat == AF_11BIT) {
|
if (alphaFormat == AF_11BIT) {
|
||||||
throw Exception();
|
throw Exception();
|
||||||
@ -2249,6 +2253,8 @@ void KTXUnpackETC(const GLubyte* srcETC, const GLenum srcFormat,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
/* Ok, now write out the active pixels to the destination image.
|
/* Ok, now write out the active pixels to the destination image.
|
||||||
* (But only if the active pixels differ from the total pixels)
|
* (But only if the active pixels differ from the total pixels)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
namespace ballistica {
|
namespace ballistica {
|
||||||
|
|
||||||
KeyboardInput::KeyboardInput(KeyboardInput* parentKeyboardInputIn) {
|
KeyboardInput::KeyboardInput(KeyboardInput* parent_keyboard_input_in) {
|
||||||
if (parentKeyboardInputIn) {
|
if (parent_keyboard_input_in) {
|
||||||
parent_keyboard_input_ = parentKeyboardInputIn;
|
parent_keyboard_input_ = parent_keyboard_input_in;
|
||||||
assert(parent_keyboard_input_->child_keyboard_input_ == nullptr);
|
assert(parent_keyboard_input_->child_keyboard_input_ == nullptr);
|
||||||
|
|
||||||
// Currently we assume only 2 keyboard inputs.
|
// Currently we assume only 2 keyboard inputs.
|
||||||
@ -115,6 +115,9 @@ auto KeyboardInput::HandleKey(const SDL_Keysym* keysym, bool repeat, bool down)
|
|||||||
pass = true;
|
pass = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
// if we're keyboard 1 we always send at least a key press event
|
// if we're keyboard 1 we always send at least a key press event
|
||||||
// along..
|
// along..
|
||||||
if (!parent_keyboard_input_ && !pass) {
|
if (!parent_keyboard_input_ && !pass) {
|
||||||
@ -122,6 +125,8 @@ auto KeyboardInput::HandleKey(const SDL_Keysym* keysym, bool repeat, bool down)
|
|||||||
pass = true;
|
pass = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pass) {
|
if (pass) {
|
||||||
@ -138,6 +143,11 @@ auto KeyboardInput::HandleKey(const SDL_Keysym* keysym, bool repeat, bool down)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clion seems to think child_keyboard_input_ will never be set here (it will).
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
// At this point, if we have a child input, let it try to handle things.
|
// At this point, if we have a child input, let it try to handle things.
|
||||||
if (child_keyboard_input_ && enable_child_) {
|
if (child_keyboard_input_ && enable_child_) {
|
||||||
if (child_keyboard_input_->HandleKey(keysym, repeat, down)) {
|
if (child_keyboard_input_->HandleKey(keysym, repeat, down)) {
|
||||||
@ -145,6 +155,8 @@ auto KeyboardInput::HandleKey(const SDL_Keysym* keysym, bool repeat, bool down)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
if (!attached_to_player()) {
|
if (!attached_to_player()) {
|
||||||
if (down
|
if (down
|
||||||
&& ((keysym->sym == jump_key_) || (keysym->sym == punch_key_)
|
&& ((keysym->sym == jump_key_) || (keysym->sym == punch_key_)
|
||||||
|
|||||||
@ -431,13 +431,13 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
if (movement_control_type_ == MovementControlType::kSwipe) {
|
if (movement_control_type_ == MovementControlType::kSwipe) {
|
||||||
c.SetTexture(g_media->GetTexture(SystemTextureID::kTouchArrows));
|
c.SetTexture(g_media->GetTexture(SystemTextureID::kTouchArrows));
|
||||||
if (editing_) {
|
if (editing_) {
|
||||||
float val = 1.5f + sinf(real_time * 0.02f);
|
float val = 1.5f + sinf(static_cast<float>(real_time) * 0.02f);
|
||||||
c.SetColor(val, val, 1.0f, 1.0f);
|
c.SetColor(val, val, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float val;
|
float val;
|
||||||
if (editing_) {
|
if (editing_) {
|
||||||
val = 0.35f + 0.15f * sinf(real_time * 0.02f);
|
val = 0.35f + 0.15f * sinf(static_cast<float>(real_time) * 0.02f);
|
||||||
} else {
|
} else {
|
||||||
val = 0.35f;
|
val = 0.35f;
|
||||||
}
|
}
|
||||||
@ -459,7 +459,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
if (movement_control_type_ == MovementControlType::kJoystick) {
|
if (movement_control_type_ == MovementControlType::kJoystick) {
|
||||||
float val;
|
float val;
|
||||||
if (editing_) {
|
if (editing_) {
|
||||||
val = 0.35f + 0.15f * sinf(real_time * 0.02f);
|
val = 0.35f + 0.15f * sinf(static_cast<float>(real_time) * 0.02f);
|
||||||
} else {
|
} else {
|
||||||
val = 0.35f;
|
val = 0.35f;
|
||||||
}
|
}
|
||||||
@ -474,11 +474,10 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
|
|
||||||
if (!buttons_touch_ && action_control_type_ == ActionControlType::kSwipe
|
if (!buttons_touch_ && action_control_type_ == ActionControlType::kSwipe
|
||||||
&& !swipe_controls_hidden_) {
|
&& !swipe_controls_hidden_) {
|
||||||
float sc2 = sc_actions;
|
float sc2{sc_actions * 0.6f};
|
||||||
if (action_control_type_ == ActionControlType::kSwipe) sc2 *= 0.6f;
|
|
||||||
c.SetTexture(g_media->GetTexture(SystemTextureID::kTouchArrowsActions));
|
c.SetTexture(g_media->GetTexture(SystemTextureID::kTouchArrowsActions));
|
||||||
if (editing_) {
|
if (editing_) {
|
||||||
float val = 1.5f + sinf(real_time * 0.02f);
|
float val = 1.5f + sinf(static_cast<float>(real_time) * 0.02f);
|
||||||
c.SetColor(val, val, 1.0f, 1.0f);
|
c.SetColor(val, val, 1.0f, 1.0f);
|
||||||
} else {
|
} else {
|
||||||
c.SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
c.SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
@ -496,10 +495,10 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
c.Submit();
|
c.Submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool have_player_position = false;
|
bool have_player_position{false};
|
||||||
std::vector<float> player_position(3);
|
std::vector<float> player_position(3);
|
||||||
if (attached_to_player()) {
|
if (attached_to_player()) {
|
||||||
PlayerNode* player_node = nullptr;
|
PlayerNode* player_node{};
|
||||||
|
|
||||||
// Try to come up with whichever scene is in the foreground, and try
|
// Try to come up with whichever scene is in the foreground, and try
|
||||||
// to pull a node for the player we're attached to.
|
// to pull a node for the player we're attached to.
|
||||||
@ -523,7 +522,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
SimpleComponent c(frame_def->GetOverlayFlatPass());
|
SimpleComponent c(frame_def->GetOverlayFlatPass());
|
||||||
c.SetTransparent(true);
|
c.SetTransparent(true);
|
||||||
|
|
||||||
uint32_t residual_time = 130;
|
uint32_t residual_time{130};
|
||||||
|
|
||||||
// Draw buttons.
|
// Draw buttons.
|
||||||
bool do_draw;
|
bool do_draw;
|
||||||
@ -561,7 +560,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float s = 0.5f;
|
float s{0.5f};
|
||||||
|
|
||||||
// In buttons mode we draw based on our UI size. Otherwise we draw in the
|
// In buttons mode we draw based on our UI size. Otherwise we draw in the
|
||||||
// world at a constant scale.
|
// world at a constant scale.
|
||||||
@ -576,10 +575,10 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float b_width = 50.0f * s;
|
float b_width{50.0f * s};
|
||||||
float half_b_width = 0.0f;
|
float half_b_width{0.0f};
|
||||||
|
|
||||||
float button_spread_s = 0.0f * s;
|
float button_spread_s{0.0f * s};
|
||||||
|
|
||||||
if (action_control_type_ == ActionControlType::kSwipe) {
|
if (action_control_type_ == ActionControlType::kSwipe) {
|
||||||
button_spread_s *= 2.0f;
|
button_spread_s *= 2.0f;
|
||||||
@ -587,7 +586,7 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
|
|
||||||
bool was_held;
|
bool was_held;
|
||||||
float pop;
|
float pop;
|
||||||
float pop_time = 100.0f;
|
float pop_time{100.0f};
|
||||||
|
|
||||||
c.PushTransform();
|
c.PushTransform();
|
||||||
|
|
||||||
@ -604,11 +603,12 @@ void TouchInput::Draw(FrameDef* frame_def) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float squash = 1.3f;
|
float squash{1.3f};
|
||||||
float stretch = 1.3f;
|
float stretch{1.3f};
|
||||||
|
|
||||||
float s_extra = 1.0f;
|
float s_extra{1.0f};
|
||||||
if (editing_) s_extra = 0.7f + 0.3f * sinf(real_time * 0.02f);
|
if (editing_)
|
||||||
|
s_extra = 0.7f + 0.3f * sinf(static_cast<float>(real_time) * 0.02f);
|
||||||
|
|
||||||
// Bomb.
|
// Bomb.
|
||||||
was_held =
|
was_held =
|
||||||
|
|||||||
@ -241,11 +241,13 @@ void RemoteAppServer::HandleData(int socket, uint8_t* buffer, size_t amt,
|
|||||||
uint32_t h_raw_last = (last_state >> 8u) & 0xFFu;
|
uint32_t h_raw_last = (last_state >> 8u) & 0xFFu;
|
||||||
uint32_t v_raw_last = (last_state >> 16u) & 0xFFu;
|
uint32_t v_raw_last = (last_state >> 16u) & 0xFFu;
|
||||||
float dpad_h, dpad_v;
|
float dpad_h, dpad_v;
|
||||||
dpad_h = -1.0f + 2.0f * (h_raw / 255.0f);
|
dpad_h = -1.0f + 2.0f * (static_cast<float>(h_raw) / 255.0f);
|
||||||
dpad_v = -1.0f + 2.0f * (v_raw / 255.0f);
|
dpad_v = -1.0f + 2.0f * (static_cast<float>(v_raw) / 255.0f);
|
||||||
float last_dpad_h, last_dpad_v;
|
float last_dpad_h, last_dpad_v;
|
||||||
last_dpad_h = -1.0f + 2.0f * (h_raw_last / 255.0f);
|
last_dpad_h =
|
||||||
last_dpad_v = -1.0f + 2.0f * (v_raw_last / 255.0f);
|
-1.0f + 2.0f * (static_cast<float>(h_raw_last) / 255.0f);
|
||||||
|
last_dpad_v =
|
||||||
|
-1.0f + 2.0f * (static_cast<float>(v_raw_last) / 255.0f);
|
||||||
|
|
||||||
// Process this first since it can affect how other events are
|
// Process this first since it can affect how other events are
|
||||||
// handled.
|
// handled.
|
||||||
@ -434,11 +436,12 @@ auto RemoteAppServer::GetClient(int request_id, struct sockaddr* addr,
|
|||||||
|
|
||||||
void RemoteAppServer::HandleRemoteEvent(RemoteAppClient* client,
|
void RemoteAppServer::HandleRemoteEvent(RemoteAppClient* client,
|
||||||
RemoteEventType b) {
|
RemoteEventType b) {
|
||||||
|
bool send{true};
|
||||||
|
|
||||||
// Ok we got some data from the remote.
|
// Ok we got some data from the remote.
|
||||||
// All we have to do is translate it into an SDL event and feed it to our
|
// All we have to do is translate it into an SDL event and feed it to our
|
||||||
// manual joystick we made.
|
// manual joystick we made.
|
||||||
SDL_Event e{};
|
SDL_Event e{};
|
||||||
bool send = true;
|
|
||||||
switch (b) {
|
switch (b) {
|
||||||
case RemoteEventType::kBombPress:
|
case RemoteEventType::kBombPress:
|
||||||
e.type = SDL_JOYBUTTONDOWN;
|
e.type = SDL_JOYBUTTONDOWN;
|
||||||
@ -501,6 +504,9 @@ void RemoteAppServer::HandleRemoteEvent(RemoteAppClient* client,
|
|||||||
e.jbutton.button = 64;
|
e.jbutton.button = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
default:
|
default:
|
||||||
send = false;
|
send = false;
|
||||||
break;
|
break;
|
||||||
@ -509,6 +515,7 @@ void RemoteAppServer::HandleRemoteEvent(RemoteAppClient* client,
|
|||||||
assert(g_game);
|
assert(g_game);
|
||||||
g_input->PushJoystickEvent(e, client->joystick_);
|
g_input->PushJoystickEvent(e, client->joystick_);
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteAppServer::HandleRemoteFloatEvent(RemoteAppClient* client,
|
void RemoteAppServer::HandleRemoteFloatEvent(RemoteAppClient* client,
|
||||||
@ -526,6 +533,10 @@ void RemoteAppServer::HandleRemoteFloatEvent(RemoteAppClient* client,
|
|||||||
e.jaxis.axis = 1;
|
e.jaxis.axis = 1;
|
||||||
e.jaxis.value = static_cast<int16_t>(32767 * val);
|
e.jaxis.value = static_cast<int16_t>(32767 * val);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
default:
|
default:
|
||||||
send = false;
|
send = false;
|
||||||
break;
|
break;
|
||||||
@ -534,6 +545,7 @@ void RemoteAppServer::HandleRemoteFloatEvent(RemoteAppClient* client,
|
|||||||
assert(g_game);
|
assert(g_game);
|
||||||
g_input->PushJoystickEvent(e, client->joystick_);
|
g_input->PushJoystickEvent(e, client->joystick_);
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ballistica
|
} // namespace ballistica
|
||||||
|
|||||||
@ -617,6 +617,10 @@ void Media::MarkComponentForLoad(MediaComponentData* c) {
|
|||||||
g_media_server->PushRunnable(Object::NewDeferred<PreloadRunnable>(media_ptr));
|
g_media_server->PushRunnable(Object::NewDeferred<PreloadRunnable>(media_ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantFunctionResult"
|
||||||
|
|
||||||
auto Media::GetModelPendingLoadCount() -> int {
|
auto Media::GetModelPendingLoadCount() -> int {
|
||||||
if (!have_pending_loads_[static_cast<int>(MediaType::kModel)]) {
|
if (!have_pending_loads_[static_cast<int>(MediaType::kModel)]) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -686,6 +690,8 @@ auto Media::GetCollideModelPendingLoadCount() -> int {
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
auto Media::GetGraphicalPendingLoadCount() -> int {
|
auto Media::GetGraphicalPendingLoadCount() -> int {
|
||||||
// Each of these calls lock the media-lists so we don't.
|
// Each of these calls lock the media-lists so we don't.
|
||||||
return GetModelPendingLoadCount() + GetTexturePendingLoadCount();
|
return GetModelPendingLoadCount() + GetTexturePendingLoadCount();
|
||||||
|
|||||||
@ -53,6 +53,9 @@ void TelnetServer::Resume() {
|
|||||||
paused_cv_.notify_all();
|
paused_cv_.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantFunctionResult"
|
||||||
|
|
||||||
auto TelnetServer::RunThread() -> int {
|
auto TelnetServer::RunThread() -> int {
|
||||||
// Do this whole thing in a loop.
|
// Do this whole thing in a loop.
|
||||||
// If we get put to sleep we just start over.
|
// If we get put to sleep we just start over.
|
||||||
@ -66,14 +69,16 @@ auto TelnetServer::RunThread() -> int {
|
|||||||
sd_ = socket(AF_INET, SOCK_STREAM, 0);
|
sd_ = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if (sd_ < 0) {
|
if (sd_ < 0) {
|
||||||
Log("Error: Unable to open host socket; errno " + std::to_string(errno));
|
Log("Error: Unable to open host socket; errno " + std::to_string(errno));
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make it reusable.
|
// Make it reusable.
|
||||||
int on = 1;
|
int on = 1;
|
||||||
int status =
|
int status =
|
||||||
setsockopt(sd_, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
|
setsockopt(sd_, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
|
||||||
if (-1 == status) Log("Error setting SO_REUSEADDR on telnet server");
|
if (-1 == status) {
|
||||||
|
Log("Error setting SO_REUSEADDR on telnet server");
|
||||||
|
}
|
||||||
|
|
||||||
// Bind to local server port.
|
// Bind to local server port.
|
||||||
struct sockaddr_in serv_addr {};
|
struct sockaddr_in serv_addr {};
|
||||||
@ -83,7 +88,7 @@ auto TelnetServer::RunThread() -> int {
|
|||||||
serv_addr.sin_port = htons(port_); // NOLINT
|
serv_addr.sin_port = htons(port_); // NOLINT
|
||||||
result = ::bind(sd_, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
|
result = ::bind(sd_, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
char buffer[10000];
|
char buffer[10000];
|
||||||
const char* prompt = "ballisticacore> ";
|
const char* prompt = "ballisticacore> ";
|
||||||
@ -176,6 +181,8 @@ auto TelnetServer::RunThread() -> int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
void TelnetServer::PushTelnetScriptCommand(const std::string& command) {
|
void TelnetServer::PushTelnetScriptCommand(const std::string& command) {
|
||||||
assert(g_game);
|
assert(g_game);
|
||||||
if (g_game == nullptr) {
|
if (g_game == nullptr) {
|
||||||
@ -189,7 +196,7 @@ void TelnetServer::PushTelnetScriptCommand(const std::string& command) {
|
|||||||
}
|
}
|
||||||
PythonCommand cmd(command, "<telnet>");
|
PythonCommand cmd(command, "<telnet>");
|
||||||
if (cmd.CanEval()) {
|
if (cmd.CanEval()) {
|
||||||
PyObject* obj = cmd.RunReturnObj(true);
|
PyObject* obj = cmd.RunReturnObj(true, nullptr);
|
||||||
if (obj && obj != Py_None) {
|
if (obj && obj != Py_None) {
|
||||||
PyObject* s = PyObject_Repr(obj);
|
PyObject* s = PyObject_Repr(obj);
|
||||||
if (s) {
|
if (s) {
|
||||||
|
|||||||
@ -66,6 +66,11 @@ auto PythonClassCollideModel::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
+ " objects must only be created in the game thread (current is ("
|
+ " objects must only be created in the game thread (current is ("
|
||||||
+ GetCurrentThreadName() + ").");
|
+ GetCurrentThreadName() + ").");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Can't instantiate CollideModels directly; use "
|
"Can't instantiate CollideModels directly; use "
|
||||||
@ -73,6 +78,7 @@ auto PythonClassCollideModel::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
}
|
}
|
||||||
self->collide_model_ = new Object::Ref<CollideModel>();
|
self->collide_model_ = new Object::Ref<CollideModel>();
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,11 @@ auto PythonClassData::tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
|
|||||||
+ " objects must only be created in the game thread (current is ("
|
+ " objects must only be created in the game thread (current is ("
|
||||||
+ GetCurrentThreadName() + ").");
|
+ GetCurrentThreadName() + ").");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Can't instantiate Datas directly; use ba.getdata() to get "
|
"Can't instantiate Datas directly; use ba.getdata() to get "
|
||||||
@ -71,6 +76,7 @@ auto PythonClassData::tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
self->data_ = new Object::Ref<Data>();
|
self->data_ = new Object::Ref<Data>();
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -244,6 +244,10 @@ auto PythonClassInputDevice::tp_getattro(PythonClassInputDevice* self,
|
|||||||
BA_PYTHON_CATCH;
|
BA_PYTHON_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Yes Clion, we always return -1 here.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantFunctionResult"
|
||||||
|
|
||||||
auto PythonClassInputDevice::tp_setattro(PythonClassInputDevice* self,
|
auto PythonClassInputDevice::tp_setattro(PythonClassInputDevice* self,
|
||||||
PyObject* attr, PyObject* val) -> int {
|
PyObject* attr, PyObject* val) -> int {
|
||||||
BA_PYTHON_TRY;
|
BA_PYTHON_TRY;
|
||||||
@ -255,6 +259,8 @@ auto PythonClassInputDevice::tp_setattro(PythonClassInputDevice* self,
|
|||||||
BA_PYTHON_INT_CATCH;
|
BA_PYTHON_INT_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
auto PythonClassInputDevice::RemoveRemotePlayerFromGame(
|
auto PythonClassInputDevice::RemoveRemotePlayerFromGame(
|
||||||
PythonClassInputDevice* self) -> PyObject* {
|
PythonClassInputDevice* self) -> PyObject* {
|
||||||
BA_PYTHON_TRY;
|
BA_PYTHON_TRY;
|
||||||
|
|||||||
@ -97,6 +97,11 @@ auto PythonClassMaterial::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
PyObject* name_obj = Py_None;
|
PyObject* name_obj = Py_None;
|
||||||
std::string name;
|
std::string name;
|
||||||
Object::Ref<Material> m;
|
Object::Ref<Material> m;
|
||||||
|
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
static const char* kwlist[] = {"label", nullptr};
|
static const char* kwlist[] = {"label", nullptr};
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "|O",
|
if (!PyArg_ParseTupleAndKeywords(args, keywds, "|O",
|
||||||
@ -119,6 +124,7 @@ auto PythonClassMaterial::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
}
|
}
|
||||||
self->material_ = new Object::Ref<Material>(m);
|
self->material_ = new Object::Ref<Material>(m);
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
@ -181,6 +187,10 @@ auto PythonClassMaterial::tp_getattro(PythonClassMaterial* self, PyObject* attr)
|
|||||||
BA_PYTHON_CATCH;
|
BA_PYTHON_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Yes Clion, we always return -1 here.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantFunctionResult"
|
||||||
|
|
||||||
auto PythonClassMaterial::tp_setattro(PythonClassMaterial* self, PyObject* attr,
|
auto PythonClassMaterial::tp_setattro(PythonClassMaterial* self, PyObject* attr,
|
||||||
PyObject* val) -> int {
|
PyObject* val) -> int {
|
||||||
BA_PYTHON_TRY;
|
BA_PYTHON_TRY;
|
||||||
@ -195,6 +205,8 @@ auto PythonClassMaterial::tp_setattro(PythonClassMaterial* self, PyObject* attr,
|
|||||||
BA_PYTHON_INT_CATCH;
|
BA_PYTHON_INT_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
auto PythonClassMaterial::Dir(PythonClassMaterial* self) -> PyObject* {
|
auto PythonClassMaterial::Dir(PythonClassMaterial* self) -> PyObject* {
|
||||||
BA_PYTHON_TRY;
|
BA_PYTHON_TRY;
|
||||||
|
|
||||||
|
|||||||
@ -64,6 +64,10 @@ auto PythonClassModel::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
+ " objects must only be created in the game thread (current is ("
|
+ " objects must only be created in the game thread (current is ("
|
||||||
+ GetCurrentThreadName() + ").");
|
+ GetCurrentThreadName() + ").");
|
||||||
}
|
}
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Can't instantiate Models directly; use ba.getmodel() to get "
|
"Can't instantiate Models directly; use ba.getmodel() to get "
|
||||||
@ -71,6 +75,7 @@ auto PythonClassModel::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
}
|
}
|
||||||
self->model_ = new Object::Ref<Model>();
|
self->model_ = new Object::Ref<Model>();
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,6 +89,9 @@ auto PythonClassNode::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
+ " objects must only be created in the game thread (current is ("
|
+ " objects must only be created in the game thread (current is ("
|
||||||
+ GetCurrentThreadName() + ").");
|
+ GetCurrentThreadName() + ").");
|
||||||
}
|
}
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
if (!PyTuple_Check(args) || (PyTuple_GET_SIZE(args) != 1)
|
if (!PyTuple_Check(args) || (PyTuple_GET_SIZE(args) != 1)
|
||||||
|| (keywds != nullptr) || (PyTuple_GET_ITEM(args, 0) != Py_None)) {
|
|| (keywds != nullptr) || (PyTuple_GET_ITEM(args, 0) != Py_None)) {
|
||||||
@ -99,6 +102,7 @@ auto PythonClassNode::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
}
|
}
|
||||||
self->node_ = new Object::WeakRef<Node>();
|
self->node_ = new Object::WeakRef<Node>();
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,6 +163,10 @@ auto PythonClassSessionPlayer::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
|
|
||||||
// If the user is creating one, make sure they passed None to get an
|
// If the user is creating one, make sure they passed None to get an
|
||||||
// invalid ref.
|
// invalid ref.
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
if (!PyTuple_Check(args) || (PyTuple_GET_SIZE(args) != 1)
|
if (!PyTuple_Check(args) || (PyTuple_GET_SIZE(args) != 1)
|
||||||
|| (keywds != nullptr) || (PyTuple_GET_ITEM(args, 0) != Py_None))
|
|| (keywds != nullptr) || (PyTuple_GET_ITEM(args, 0) != Py_None))
|
||||||
@ -172,6 +176,7 @@ auto PythonClassSessionPlayer::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
}
|
}
|
||||||
self->player_ = new Object::WeakRef<Player>();
|
self->player_ = new Object::WeakRef<Player>();
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,6 +63,10 @@ auto PythonClassSound::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
+ " objects must only be created in the game thread (current is ("
|
+ " objects must only be created in the game thread (current is ("
|
||||||
+ GetCurrentThreadName() + ").");
|
+ GetCurrentThreadName() + ").");
|
||||||
}
|
}
|
||||||
|
// Clion incorrectly things s_create_empty will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (!s_create_empty_) {
|
if (!s_create_empty_) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Can't instantiate Sounds directly; use ba.getsound() to get "
|
"Can't instantiate Sounds directly; use ba.getsound() to get "
|
||||||
@ -70,6 +74,7 @@ auto PythonClassSound::tp_new(PyTypeObject* type, PyObject* args,
|
|||||||
}
|
}
|
||||||
self->sound_ = new Object::Ref<Sound>();
|
self->sound_ = new Object::Ref<Sound>();
|
||||||
BA_PYTHON_NEW_CATCH;
|
BA_PYTHON_NEW_CATCH;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
return reinterpret_cast<PyObject*>(self);
|
return reinterpret_cast<PyObject*>(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -605,6 +605,9 @@ auto PyQuit(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* {
|
|||||||
|
|
||||||
// A few types get handled specially on android.
|
// A few types get handled specially on android.
|
||||||
if (g_buildconfig.ostype_android()) {
|
if (g_buildconfig.ostype_android()) {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
|
||||||
if (!handled && back) {
|
if (!handled && back) {
|
||||||
// Back-quit simply synthesizes a back press.
|
// Back-quit simply synthesizes a back press.
|
||||||
// Note to self: I remember this behaved slightly differently than
|
// Note to self: I remember this behaved slightly differently than
|
||||||
@ -612,6 +615,9 @@ auto PyQuit(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* {
|
|||||||
g_platform->AndroidSynthesizeBackPress();
|
g_platform->AndroidSynthesizeBackPress();
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
if (!handled && soft) {
|
if (!handled && soft) {
|
||||||
// Soft-quit just kills our activity but doesn't run app shutdown.
|
// Soft-quit just kills our activity but doesn't run app shutdown.
|
||||||
// Thus we'll be able to spin back up (reset to the main menu)
|
// Thus we'll be able to spin back up (reset to the main menu)
|
||||||
@ -735,8 +741,6 @@ auto PyEnv(PyObject* self) -> PyObject* {
|
|||||||
is_test_build_obj = Py_False;
|
is_test_build_obj = Py_False;
|
||||||
#endif
|
#endif
|
||||||
bool demo_mode{g_buildconfig.demo_build()};
|
bool demo_mode{g_buildconfig.demo_build()};
|
||||||
bool arcade_mode{g_buildconfig.arcade_build()};
|
|
||||||
bool iircade_mode{g_buildconfig.arcade_build()};
|
|
||||||
|
|
||||||
const char* ui_scale;
|
const char* ui_scale;
|
||||||
switch (GetUIScale()) {
|
switch (GetUIScale()) {
|
||||||
|
|||||||
@ -709,6 +709,9 @@ auto PyAndroidMediaScanFile(PyObject* self, PyObject* args, PyObject* keywds)
|
|||||||
BA_PYTHON_CATCH;
|
BA_PYTHON_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantFunctionResult"
|
||||||
|
|
||||||
auto PyAndroidGetExternalStoragePath(PyObject* self, PyObject* args,
|
auto PyAndroidGetExternalStoragePath(PyObject* self, PyObject* args,
|
||||||
PyObject* keywds) -> PyObject* {
|
PyObject* keywds) -> PyObject* {
|
||||||
BA_PYTHON_TRY;
|
BA_PYTHON_TRY;
|
||||||
@ -732,6 +735,7 @@ auto PyAndroidGetExternalStoragePath(PyObject* self, PyObject* args,
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
BA_PYTHON_CATCH;
|
BA_PYTHON_CATCH;
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
auto PyAndroidShowWifiSettings(PyObject* self, PyObject* args, PyObject* keywds)
|
auto PyAndroidShowWifiSettings(PyObject* self, PyObject* args, PyObject* keywds)
|
||||||
-> PyObject* {
|
-> PyObject* {
|
||||||
|
|||||||
@ -316,7 +316,8 @@ auto PyButtonWidget(PyObject* self, PyObject* args, PyObject* keywds)
|
|||||||
#if BA_TEST_BUILD
|
#if BA_TEST_BUILD
|
||||||
g_python->TimeFormatCheck(TimeFormat::kSeconds, transition_delay_obj);
|
g_python->TimeFormatCheck(TimeFormat::kSeconds, transition_delay_obj);
|
||||||
#endif
|
#endif
|
||||||
b->set_transition_delay(1000.0f * Python::GetPyFloat(transition_delay_obj));
|
b->set_transition_delay(static_cast<millisecs_t>(
|
||||||
|
1000.0f * Python::GetPyFloat(transition_delay_obj)));
|
||||||
}
|
}
|
||||||
if (text_res_scale_obj != Py_None) {
|
if (text_res_scale_obj != Py_None) {
|
||||||
b->SetTextResScale(Python::GetPyFloat(text_res_scale_obj));
|
b->SetTextResScale(Python::GetPyFloat(text_res_scale_obj));
|
||||||
|
|||||||
@ -964,10 +964,10 @@ void Python::Reset(bool do_init) {
|
|||||||
throw std::logic_error(
|
throw std::logic_error(
|
||||||
"Error in ba Python bootstrapping. See log for details.");
|
"Error in ba Python bootstrapping. See log for details.");
|
||||||
}
|
}
|
||||||
PyObject* appstate =
|
PyObject* appstate = PythonCommand("app_state", "<AppStateFetch>")
|
||||||
PythonCommand("_app_state", "<AppStateFetch>").RunReturnObj();
|
.RunReturnObj(false, nullptr);
|
||||||
if (appstate == nullptr) {
|
if (appstate == nullptr) {
|
||||||
throw Exception("Unable to get value: '" + std::string("_app_state")
|
throw Exception("Unable to get value: '" + std::string("app_state")
|
||||||
+ "'.");
|
+ "'.");
|
||||||
}
|
}
|
||||||
SetObj(ObjID::kApp, appstate);
|
SetObj(ObjID::kApp, appstate);
|
||||||
@ -2375,16 +2375,18 @@ void Python::SetObjCallable(ObjID id, PyObject* pyobj, bool incref) {
|
|||||||
BA_PRECONDITION(obj(id).CallableCheck());
|
BA_PRECONDITION(obj(id).CallableCheck());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Python::SetObj(ObjID id, const char* expr) {
|
void Python::SetObj(ObjID id, const char* expr, PyObject* context) {
|
||||||
PyObject* obj = PythonCommand(expr, "<PyObj Set>").RunReturnObj();
|
PyObject* obj =
|
||||||
|
PythonCommand(expr, "<PyObj Set>").RunReturnObj(false, context);
|
||||||
if (obj == nullptr) {
|
if (obj == nullptr) {
|
||||||
throw Exception("Unable to get value: '" + std::string(expr) + "'.");
|
throw Exception("Unable to get value: '" + std::string(expr) + "'.");
|
||||||
}
|
}
|
||||||
SetObj(id, obj);
|
SetObj(id, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Python::SetObjCallable(ObjID id, const char* expr) {
|
void Python::SetObjCallable(ObjID id, const char* expr, PyObject* context) {
|
||||||
PyObject* obj = PythonCommand(expr, "<PyObj Set>").RunReturnObj();
|
PyObject* obj =
|
||||||
|
PythonCommand(expr, "<PyObj Set>").RunReturnObj(false, context);
|
||||||
if (obj == nullptr) {
|
if (obj == nullptr) {
|
||||||
throw Exception("Unable to get value: '" + std::string(expr) + "'.");
|
throw Exception("Unable to get value: '" + std::string(expr) + "'.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -402,11 +402,12 @@ class Python {
|
|||||||
void SetObjCallable(ObjID id, PyObject* pyobj, bool incref = false);
|
void SetObjCallable(ObjID id, PyObject* pyobj, bool incref = false);
|
||||||
|
|
||||||
/// Set the value for a named object to the result of a Python expression.
|
/// Set the value for a named object to the result of a Python expression.
|
||||||
void SetObj(ObjID id, const char* expression);
|
void SetObj(ObjID id, const char* expression, PyObject* context = nullptr);
|
||||||
|
|
||||||
/// Set the value for a named object to the result of a Python expression
|
/// Set the value for a named object to the result of a Python expression
|
||||||
/// and verify that it is callable.
|
/// and verify that it is callable.
|
||||||
void SetObjCallable(ObjID id, const char* expression);
|
void SetObjCallable(ObjID id, const char* expression,
|
||||||
|
PyObject* context = nullptr);
|
||||||
|
|
||||||
std::set<std::string> do_once_locations_;
|
std::set<std::string> do_once_locations_;
|
||||||
PythonRef objs_[static_cast<int>(ObjID::kLast)];
|
PythonRef objs_[static_cast<int>(ObjID::kLast)];
|
||||||
|
|||||||
@ -136,10 +136,16 @@ auto PythonCommand::CanEval() -> bool {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto PythonCommand::RunReturnObj(bool print_errors) -> PyObject* {
|
auto PythonCommand::RunReturnObj(bool print_errors, PyObject* context)
|
||||||
|
-> PyObject* {
|
||||||
assert(Python::HaveGIL());
|
assert(Python::HaveGIL());
|
||||||
assert(g_python);
|
assert(g_python);
|
||||||
assert(!dead_);
|
assert(!dead_);
|
||||||
|
if (context == nullptr) {
|
||||||
|
context = g_python->main_dict();
|
||||||
|
}
|
||||||
|
assert(PyDict_Check(context));
|
||||||
|
|
||||||
if (!eval_code_obj_.get()) {
|
if (!eval_code_obj_.get()) {
|
||||||
CompileForEval(print_errors);
|
CompileForEval(print_errors);
|
||||||
assert(!dead_);
|
assert(!dead_);
|
||||||
@ -164,8 +170,7 @@ auto PythonCommand::RunReturnObj(bool print_errors) -> PyObject* {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
PUSH_PYCOMMAND(this);
|
PUSH_PYCOMMAND(this);
|
||||||
PyObject* v = PyEval_EvalCode(eval_code_obj_.get(), g_python->main_dict(),
|
PyObject* v = PyEval_EvalCode(eval_code_obj_.get(), context, context);
|
||||||
g_python->main_dict());
|
|
||||||
POP_PYCOMMAND();
|
POP_PYCOMMAND();
|
||||||
assert(!dead_);
|
assert(!dead_);
|
||||||
if (v == nullptr) {
|
if (v == nullptr) {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class PythonCommand {
|
|||||||
/// Run thecommand and return the result as a new Python reference.
|
/// Run thecommand and return the result as a new Python reference.
|
||||||
/// Only works for eval-able commands.
|
/// Only works for eval-able commands.
|
||||||
/// Returns nullptr on errors, but Python error state will be cleared.
|
/// Returns nullptr on errors, but Python error state will be cleared.
|
||||||
auto RunReturnObj(bool print_errors = false) -> PyObject*;
|
auto RunReturnObj(bool print_errors, PyObject* context) -> PyObject*;
|
||||||
|
|
||||||
void LogContext();
|
void LogContext();
|
||||||
|
|
||||||
|
|||||||
@ -51,10 +51,10 @@ auto AnimCurveNode::GetOut() -> float {
|
|||||||
}
|
}
|
||||||
for (size_t i = 0; i < num; i++) {
|
for (size_t i = 0; i < num; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
input_start_ = times_[i];
|
input_start_ = static_cast<float>(times_[i]);
|
||||||
}
|
}
|
||||||
if (i == (num - 1)) {
|
if (i == (num - 1)) {
|
||||||
input_end_ = times_[i];
|
input_end_ = static_cast<float>(times_[i]);
|
||||||
}
|
}
|
||||||
keyframes_.emplace_back(times_[i], values_[i]);
|
keyframes_.emplace_back(times_[i], values_[i]);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,9 @@ auto AnimCurveNode::GetOut() -> float {
|
|||||||
bool got;
|
bool got;
|
||||||
if (loop_) {
|
if (loop_) {
|
||||||
in_val = fmodf(in_val, (input_end_ - input_start_));
|
in_val = fmodf(in_val, (input_end_ - input_start_));
|
||||||
if (in_val < 0) in_val += (input_end_ - input_start_);
|
if (in_val < 0) {
|
||||||
|
in_val += (input_end_ - input_start_);
|
||||||
|
}
|
||||||
got = false;
|
got = false;
|
||||||
} else {
|
} else {
|
||||||
if (in_val >= input_end_) {
|
if (in_val >= input_end_) {
|
||||||
@ -97,7 +99,7 @@ auto AnimCurveNode::GetOut() -> float {
|
|||||||
if (i == keyframes_.end()) {
|
if (i == keyframes_.end()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i->time < in_val) {
|
if (static_cast<float>(i->time) < in_val) {
|
||||||
i++;
|
i++;
|
||||||
i1 = i2;
|
i1 = i2;
|
||||||
i2 = i;
|
i2 = i;
|
||||||
@ -109,7 +111,7 @@ auto AnimCurveNode::GetOut() -> float {
|
|||||||
out_ = i1->value;
|
out_ = i1->value;
|
||||||
} else {
|
} else {
|
||||||
out_ = i1->value
|
out_ = i1->value
|
||||||
+ ((in_val - i1->time)
|
+ ((in_val - static_cast<float>(i1->time))
|
||||||
/ static_cast<float>(i2->time - i1->time))
|
/ static_cast<float>(i2->time - i1->time))
|
||||||
* (i2->value - i1->value);
|
* (i2->value - i1->value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,10 +53,9 @@ void BombNode::Step() {
|
|||||||
dVector3 fuse_tip_pos;
|
dVector3 fuse_tip_pos;
|
||||||
dGeomGetRelPointPos(body_->geom(), 0, (fuse_length_ + kFuseOffset), 0,
|
dGeomGetRelPointPos(body_->geom(), 0, (fuse_length_ + kFuseOffset), 0,
|
||||||
fuse_tip_pos);
|
fuse_tip_pos);
|
||||||
light_translate_ = fuse_tip_pos;
|
light_translate_.x = fuse_tip_pos[0] + body_->blend_offset().x;
|
||||||
light_translate_.x += body_->blend_offset().x;
|
light_translate_.y = fuse_tip_pos[1] + body_->blend_offset().y;
|
||||||
light_translate_.y += body_->blend_offset().y;
|
light_translate_.z = fuse_tip_pos[2] + body_->blend_offset().z;
|
||||||
light_translate_.z += body_->blend_offset().z;
|
|
||||||
#if !BA_HEADLESS_BUILD
|
#if !BA_HEADLESS_BUILD
|
||||||
fuse_.SetTransform(Matrix44fTranslate(0, kFuseOffset * model_scale_, 0)
|
fuse_.SetTransform(Matrix44fTranslate(0, kFuseOffset * model_scale_, 0)
|
||||||
* body_->GetTransform());
|
* body_->GetTransform());
|
||||||
|
|||||||
@ -351,10 +351,6 @@ auto GlobalsNode::GetCameraMode() const -> std::string {
|
|||||||
return "rotate";
|
return "rotate";
|
||||||
case CameraMode::kFollow:
|
case CameraMode::kFollow:
|
||||||
return "follow";
|
return "follow";
|
||||||
default:
|
|
||||||
Log("ERROR: Globals: Unrecognized camera_mode_: "
|
|
||||||
+ std::to_string(static_cast<int>(camera_mode_)));
|
|
||||||
return "unknown";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -93,9 +93,6 @@ auto ImageNode::GetAttach() const -> std::string {
|
|||||||
return "bottomLeft";
|
return "bottomLeft";
|
||||||
case Attach::CENTER_LEFT:
|
case Attach::CENTER_LEFT:
|
||||||
return "centerLeft";
|
return "centerLeft";
|
||||||
default:
|
|
||||||
throw Exception("Invalid attach val in ImageNode "
|
|
||||||
+ std::to_string(static_cast<int>(attach_)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,9 +53,6 @@ auto LocatorNode::getShape() const -> std::string {
|
|||||||
return "circleOutline";
|
return "circleOutline";
|
||||||
case Shape::kLocator:
|
case Shape::kLocator:
|
||||||
return "locator";
|
return "locator";
|
||||||
default:
|
|
||||||
throw Exception("Invalid shape val: "
|
|
||||||
+ std::to_string(static_cast<int>(shape_)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,13 +122,16 @@ void LocatorNode::Draw(FrameDef* frame_def) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool transparent = false;
|
bool transparent = false;
|
||||||
if (shape_ == Shape::kCircle || shape_ == Shape::kCircleOutline)
|
if (shape_ == Shape::kCircle || shape_ == Shape::kCircleOutline) {
|
||||||
transparent = true;
|
transparent = true;
|
||||||
|
}
|
||||||
|
|
||||||
// beauty
|
// beauty
|
||||||
if (draw_beauty_) {
|
if (draw_beauty_) {
|
||||||
SimpleComponent c(frame_def->beauty_pass());
|
SimpleComponent c(frame_def->beauty_pass());
|
||||||
if (transparent) c.SetTransparent(true);
|
if (transparent) {
|
||||||
|
c.SetTransparent(true);
|
||||||
|
}
|
||||||
c.SetColor(color_[0], color_[1], color_[2], opacity_);
|
c.SetColor(color_[0], color_[1], color_[2], opacity_);
|
||||||
c.SetTexture(g_media->GetTexture(texture));
|
c.SetTexture(g_media->GetTexture(texture));
|
||||||
c.PushTransform();
|
c.PushTransform();
|
||||||
@ -146,12 +146,11 @@ void LocatorNode::Draw(FrameDef* frame_def) {
|
|||||||
// colored shadow for circle
|
// colored shadow for circle
|
||||||
if (shape_ == Shape::kCircle || shape_ == Shape::kCircleOutline) {
|
if (shape_ == Shape::kCircle || shape_ == Shape::kCircleOutline) {
|
||||||
SimpleComponent c(frame_def->light_shadow_pass());
|
SimpleComponent c(frame_def->light_shadow_pass());
|
||||||
if (transparent) {
|
assert(transparent);
|
||||||
c.SetTransparent(true);
|
c.SetTransparent(true);
|
||||||
if (additive_) {
|
if (additive_) {
|
||||||
c.SetPremultiplied(true);
|
c.SetPremultiplied(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (additive_) {
|
if (additive_) {
|
||||||
c.SetColor(color_[0] * opacity_, color_[1] * opacity_,
|
c.SetColor(color_[0] * opacity_, color_[1] * opacity_,
|
||||||
color_[2] * opacity_, 0.0f);
|
color_[2] * opacity_, 0.0f);
|
||||||
|
|||||||
@ -46,9 +46,6 @@ auto MathNode::GetOperation() const -> std::string {
|
|||||||
return "divide";
|
return "divide";
|
||||||
case Operation::kSin:
|
case Operation::kSin:
|
||||||
return "sin";
|
return "sin";
|
||||||
default:
|
|
||||||
throw Exception("invalid operation: "
|
|
||||||
+ std::to_string(static_cast<int>(operation_)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,10 +99,6 @@ auto MathNode::GetOutput() -> std::vector<float> {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
BA_LOG_ONCE("Error: invalid math op in getOutput(): "
|
|
||||||
+ std::to_string(static_cast<int>(operation_)));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return outputs;
|
return outputs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,8 @@ void NodeAttributeUnbound::DisconnectIncoming(Node* node) {
|
|||||||
Object::WeakRef<NodeAttributeConnection> test_ref(a);
|
Object::WeakRef<NodeAttributeConnection> test_ref(a);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert(a && a->src_node.exists());
|
assert(a != nullptr);
|
||||||
|
assert(a->src_node.exists());
|
||||||
|
|
||||||
// Remove from src node's outgoing list.
|
// Remove from src node's outgoing list.
|
||||||
a->src_node->attribute_connections_.erase(a->src_iterator);
|
a->src_node->attribute_connections_.erase(a->src_iterator);
|
||||||
|
|||||||
@ -135,16 +135,13 @@ void TextNode::SetBig(bool val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto TextNode::GetHAlign() const -> std::string {
|
auto TextNode::GetHAlign() const -> std::string {
|
||||||
if (h_align_ == HAlign::kLeft) {
|
switch (h_align_) {
|
||||||
|
case HAlign::kLeft:
|
||||||
return "left";
|
return "left";
|
||||||
} else if (h_align_ == HAlign::kRight) {
|
case HAlign::kRight:
|
||||||
return "right";
|
return "right";
|
||||||
} else if (h_align_ == HAlign::kCenter) {
|
case HAlign::kCenter:
|
||||||
return "center";
|
return "center";
|
||||||
} else {
|
|
||||||
BA_LOG_ONCE("Error: Invalid h_align value in text-node: "
|
|
||||||
+ std::to_string(static_cast<int>(h_align_)));
|
|
||||||
return "<invalid>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,18 +159,15 @@ void TextNode::SetHAlign(const std::string& val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto TextNode::GetVAlign() const -> std::string {
|
auto TextNode::GetVAlign() const -> std::string {
|
||||||
if (v_align_ == VAlign::kTop) {
|
switch (v_align_) {
|
||||||
|
case VAlign::kTop:
|
||||||
return "top";
|
return "top";
|
||||||
} else if (v_align_ == VAlign::kBottom) {
|
case VAlign::kBottom:
|
||||||
return "bottom";
|
return "bottom";
|
||||||
} else if (v_align_ == VAlign::kCenter) {
|
case VAlign::kCenter:
|
||||||
return "center";
|
return "center";
|
||||||
} else if (v_align_ == VAlign::kNone) {
|
case VAlign::kNone:
|
||||||
return "none";
|
return "none";
|
||||||
} else {
|
|
||||||
BA_LOG_ONCE("Error: Invalid v_align value in text-node: "
|
|
||||||
+ std::to_string(static_cast<int>(v_align_)));
|
|
||||||
return "<invalid>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,16 +187,13 @@ void TextNode::SetVAlign(const std::string& val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto TextNode::GetHAttach() const -> std::string {
|
auto TextNode::GetHAttach() const -> std::string {
|
||||||
if (h_attach_ == HAttach::kLeft) {
|
switch (h_attach_) {
|
||||||
|
case HAttach::kLeft:
|
||||||
return "left";
|
return "left";
|
||||||
} else if (h_attach_ == HAttach::kRight) {
|
case HAttach::kRight:
|
||||||
return "right";
|
return "right";
|
||||||
} else if (h_attach_ == HAttach::kCenter) {
|
case HAttach::kCenter:
|
||||||
return "center";
|
return "center";
|
||||||
} else {
|
|
||||||
BA_LOG_ONCE("Error: Invalid h_attach value in text-node: "
|
|
||||||
+ std::to_string(static_cast<int>(h_attach_)));
|
|
||||||
return "<invalid>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,16 +211,13 @@ void TextNode::SetHAttach(const std::string& val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto TextNode::GetVAttach() const -> std::string {
|
auto TextNode::GetVAttach() const -> std::string {
|
||||||
if (v_attach_ == VAttach::kTop) {
|
switch (v_attach_) {
|
||||||
|
case VAttach::kTop:
|
||||||
return "top";
|
return "top";
|
||||||
} else if (v_attach_ == VAttach::kBottom) {
|
case VAttach::kBottom:
|
||||||
return "bottom";
|
return "bottom";
|
||||||
} else if (v_attach_ == VAttach::kCenter) {
|
case VAttach::kCenter:
|
||||||
return "center";
|
return "center";
|
||||||
} else {
|
|
||||||
BA_LOG_ONCE("Error: Invalid v_attach value in text-node: "
|
|
||||||
+ std::to_string(static_cast<int>(v_attach_)));
|
|
||||||
return "<invalid>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,23 +276,27 @@ void TextNode::Update() {
|
|||||||
offset_v = 0.0f;
|
offset_v = 0.0f;
|
||||||
} else {
|
} else {
|
||||||
// Screen space; apply alignment and stuff.
|
// Screen space; apply alignment and stuff.
|
||||||
if (h_attach_ == HAttach::kLeft) {
|
switch (h_attach_) {
|
||||||
|
case HAttach::kLeft:
|
||||||
offset_h = 0;
|
offset_h = 0;
|
||||||
} else if (h_attach_ == HAttach::kRight) {
|
break;
|
||||||
|
case HAttach::kRight:
|
||||||
offset_h = g_graphics->screen_virtual_width();
|
offset_h = g_graphics->screen_virtual_width();
|
||||||
} else if (h_attach_ == HAttach::kCenter) {
|
break;
|
||||||
|
case HAttach::kCenter:
|
||||||
offset_h = g_graphics->screen_virtual_width() / 2;
|
offset_h = g_graphics->screen_virtual_width() / 2;
|
||||||
} else {
|
break;
|
||||||
throw Exception("invalid h_attach");
|
|
||||||
}
|
}
|
||||||
if (v_attach_ == VAttach::kTop) {
|
switch (v_attach_) {
|
||||||
|
case VAttach::kTop:
|
||||||
offset_v = g_graphics->screen_virtual_height();
|
offset_v = g_graphics->screen_virtual_height();
|
||||||
} else if (v_attach_ == VAttach::kBottom) {
|
break;
|
||||||
|
case VAttach::kBottom:
|
||||||
offset_v = 0;
|
offset_v = 0;
|
||||||
} else if (v_attach_ == VAttach::kCenter) {
|
break;
|
||||||
|
case VAttach::kCenter:
|
||||||
offset_v = g_graphics->screen_virtual_height() / 2;
|
offset_v = g_graphics->screen_virtual_height() / 2;
|
||||||
} else {
|
break;
|
||||||
throw Exception("invalid v_attach");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
position_final_ = position_;
|
position_final_ = position_;
|
||||||
@ -377,8 +369,6 @@ void TextNode::Draw(FrameDef* frame_def) {
|
|||||||
case HAlign::kCenter:
|
case HAlign::kCenter:
|
||||||
h_align = TextMesh::HAlign::kCenter;
|
h_align = TextMesh::HAlign::kCenter;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
throw Exception();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextMesh::VAlign v_align;
|
TextMesh::VAlign v_align;
|
||||||
@ -395,8 +385,6 @@ void TextNode::Draw(FrameDef* frame_def) {
|
|||||||
case VAlign::kBottom:
|
case VAlign::kBottom:
|
||||||
v_align = TextMesh::VAlign::kBottom;
|
v_align = TextMesh::VAlign::kBottom;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
throw Exception();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update if need be
|
// update if need be
|
||||||
@ -552,8 +540,6 @@ void TextNode::Draw(FrameDef* frame_def) {
|
|||||||
case HAlign::kCenter:
|
case HAlign::kCenter:
|
||||||
h_align = TextMesh::HAlign::kCenter;
|
h_align = TextMesh::HAlign::kCenter;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
throw Exception();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextMesh::VAlign v_align;
|
TextMesh::VAlign v_align;
|
||||||
@ -570,8 +556,6 @@ void TextNode::Draw(FrameDef* frame_def) {
|
|||||||
case VAlign::kBottom:
|
case VAlign::kBottom:
|
||||||
v_align = TextMesh::VAlign::kBottom;
|
v_align = TextMesh::VAlign::kBottom;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
throw Exception();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update if need be.
|
// Update if need be.
|
||||||
|
|||||||
@ -261,12 +261,17 @@ void Scene::Step() {
|
|||||||
void Scene::DeleteNode(Node* node) {
|
void Scene::DeleteNode(Node* node) {
|
||||||
assert(node);
|
assert(node);
|
||||||
|
|
||||||
|
// Clion incorrectly things in_step_ will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (in_step_) {
|
if (in_step_) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Cannot delete nodes within a sim step."
|
"Cannot delete nodes within a sim step."
|
||||||
" Consider a deferred call or timer. Node="
|
" Consider a deferred call or timer. Node="
|
||||||
+ node->GetObjectDescription());
|
+ node->GetObjectDescription());
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
// Copy refs to its death-actions and dependent-nodes; we'll deal with these
|
// Copy refs to its death-actions and dependent-nodes; we'll deal with these
|
||||||
// after the node is dead so we're sure they don't muck with the node.
|
// after the node is dead so we're sure they don't muck with the node.
|
||||||
@ -341,11 +346,16 @@ auto Scene::NewNode(const std::string& type_string, const std::string& name,
|
|||||||
PyObject* delegate) -> Node* {
|
PyObject* delegate) -> Node* {
|
||||||
assert(InGameThread());
|
assert(InGameThread());
|
||||||
|
|
||||||
|
// Clion incorrectly things in_step_ will always be false.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
if (in_step_) {
|
if (in_step_) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Cannot create nodes within a sim step."
|
"Cannot create nodes within a sim step."
|
||||||
" Consider a deferred call or timer.");
|
" Consider a deferred call or timer.");
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
// Should never change the scene while we're stepping it.
|
// Should never change the scene while we're stepping it.
|
||||||
assert(!in_step_);
|
assert(!in_step_);
|
||||||
|
|||||||
@ -169,7 +169,7 @@ void ButtonWidget::Draw(RenderPass* pass, bool draw_transparent) {
|
|||||||
// Simple transition.
|
// Simple transition.
|
||||||
millisecs_t transition = (birth_time_ + transition_delay_) - current_time;
|
millisecs_t transition = (birth_time_ + transition_delay_) - current_time;
|
||||||
if (transition > 0) {
|
if (transition > 0) {
|
||||||
extra_offs_x -= transition * 4.0f;
|
extra_offs_x -= static_cast<float>(transition) * 4.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text_width_dirty_) {
|
if (text_width_dirty_) {
|
||||||
|
|||||||
@ -72,7 +72,7 @@ struct RootWidget::Button {
|
|||||||
float height{30.0f};
|
float height{30.0f};
|
||||||
float scale{1.0f};
|
float scale{1.0f};
|
||||||
bool selectable{true};
|
bool selectable{true};
|
||||||
int visibility_mask{};
|
uint32_t visibility_mask{};
|
||||||
};
|
};
|
||||||
|
|
||||||
// for adding text label decorations to buttons
|
// for adding text label decorations to buttons
|
||||||
@ -134,7 +134,7 @@ auto RootWidget::AddCover(float h_align, VAlign v_align, float x, float y,
|
|||||||
bd.call = Python::ObjID::kEmptyCall;
|
bd.call = Python::ObjID::kEmptyCall;
|
||||||
|
|
||||||
bd.visibility_mask =
|
bd.visibility_mask =
|
||||||
static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot);
|
static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot);
|
||||||
// when the user specifies no backing it means they intend to cover the screen
|
// when the user specifies no backing it means they intend to cover the screen
|
||||||
// with a flat-ish window texture.. however this only applies to phone-size;
|
// with a flat-ish window texture.. however this only applies to phone-size;
|
||||||
// for other sizes we always draw a backing.
|
// for other sizes we always draw a backing.
|
||||||
@ -147,6 +147,9 @@ auto RootWidget::AddCover(float h_align, VAlign v_align, float x, float y,
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "ConstantParameter"
|
||||||
|
|
||||||
void RootWidget::AddMeter(float h_align, float x, int type, float r, float g,
|
void RootWidget::AddMeter(float h_align, float x, int type, float r, float g,
|
||||||
float b, bool plus, const std::string& s) {
|
float b, bool plus, const std::string& s) {
|
||||||
float yoffs = (GetUIScale() == UIScale::kSmall) ? 0.0f : -7.0f;
|
float yoffs = (GetUIScale() == UIScale::kSmall) ? 0.0f : -7.0f;
|
||||||
@ -231,8 +234,12 @@ void RootWidget::AddMeter(float h_align, float x, int type, float r, float g,
|
|||||||
bd.img = "tickets";
|
bd.img = "tickets";
|
||||||
bd.call = Python::ObjID::kTicketIconPressCall;
|
bd.call = Python::ObjID::kTicketIconPressCall;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
bd.visibility_mask =
|
bd.visibility_mask =
|
||||||
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
@ -306,8 +313,12 @@ void RootWidget::AddMeter(float h_align, float x, int type, float r, float g,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
void RootWidget::Setup() {
|
void RootWidget::Setup() {
|
||||||
#if BA_TOOLBAR_TEST
|
if (!explicit_bool(BA_TOOLBAR_TEST)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// back button
|
// back button
|
||||||
{
|
{
|
||||||
@ -324,8 +335,8 @@ void RootWidget::Setup() {
|
|||||||
bd.img = "nub";
|
bd.img = "nub";
|
||||||
bd.call = Python::ObjID::kBackButtonPressCall;
|
bd.call = Python::ObjID::kBackButtonPressCall;
|
||||||
bd.visibility_mask =
|
bd.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuMinimal)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuMinimal)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFull));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull));
|
||||||
Button* b = back_button_ = AddButton(bd);
|
Button* b = back_button_ = AddButton(bd);
|
||||||
|
|
||||||
// clan
|
// clan
|
||||||
@ -353,11 +364,11 @@ void RootWidget::Setup() {
|
|||||||
// }
|
// }
|
||||||
// if (c) {
|
// if (c) {
|
||||||
// c->visibility_mask |=
|
// c->visibility_mask |=
|
||||||
// static_cast<int>(Widget::ToolbarVisibility::kMenuCurrency);
|
// static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuCurrency);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// top bar backing (currency only)
|
// top bar backing (currency only)
|
||||||
if (false) {
|
if (explicit_bool(false)) {
|
||||||
ButtonDef bd;
|
ButtonDef bd;
|
||||||
bd.h_align = 0.5f;
|
bd.h_align = 0.5f;
|
||||||
bd.v_align = VAlign::kTop;
|
bd.v_align = VAlign::kTop;
|
||||||
@ -392,16 +403,16 @@ void RootWidget::Setup() {
|
|||||||
bd.call = Python::ObjID::kEmptyCall;
|
bd.call = Python::ObjID::kEmptyCall;
|
||||||
|
|
||||||
// bd.visibility_mask =
|
// bd.visibility_mask =
|
||||||
// static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot);
|
// static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot);
|
||||||
// bd.visibility_mask |=
|
// bd.visibility_mask |=
|
||||||
// static_cast<int>(Widget::ToolbarVisibility::kMenuFull);
|
// static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull);
|
||||||
bd.visibility_mask |=
|
bd.visibility_mask |=
|
||||||
static_cast<int>(Widget::ToolbarVisibility::kMenuCurrency);
|
static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuCurrency);
|
||||||
AddButton(bd);
|
AddButton(bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// top bar backing
|
// top bar backing
|
||||||
if (false) {
|
if (explicit_bool(false)) {
|
||||||
ButtonDef bd;
|
ButtonDef bd;
|
||||||
bd.h_align = 0.5f;
|
bd.h_align = 0.5f;
|
||||||
bd.v_align = VAlign::kTop;
|
bd.v_align = VAlign::kTop;
|
||||||
@ -413,11 +424,7 @@ void RootWidget::Setup() {
|
|||||||
bd.x = 0.0f;
|
bd.x = 0.0f;
|
||||||
bd.y = -20.0f;
|
bd.y = -20.0f;
|
||||||
bd.img = "uiAtlas2";
|
bd.img = "uiAtlas2";
|
||||||
if (GetUIScale() != UIScale::kSmall) {
|
|
||||||
bd.model_transparent = "toolbarBackingTop2";
|
bd.model_transparent = "toolbarBackingTop2";
|
||||||
} else {
|
|
||||||
bd.model_transparent = "toolbarBackingTop2";
|
|
||||||
}
|
|
||||||
bd.selectable = false;
|
bd.selectable = false;
|
||||||
bd.color_r = 0.44f;
|
bd.color_r = 0.44f;
|
||||||
bd.color_g = 0.41f;
|
bd.color_g = 0.41f;
|
||||||
@ -435,11 +442,11 @@ void RootWidget::Setup() {
|
|||||||
// bd.call = "";
|
// bd.call = "";
|
||||||
bd.call = Python::ObjID::kEmptyCall;
|
bd.call = Python::ObjID::kEmptyCall;
|
||||||
bd.visibility_mask =
|
bd.visibility_mask =
|
||||||
static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot);
|
static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot);
|
||||||
bd.visibility_mask |=
|
bd.visibility_mask |=
|
||||||
static_cast<int>(Widget::ToolbarVisibility::kMenuFull);
|
static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull);
|
||||||
// bd.visibility_mask |=
|
// bd.visibility_mask |=
|
||||||
// static_cast<int>(Widget::ToolbarVisibility::kMenuCurrency);
|
// static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuCurrency);
|
||||||
AddButton(bd);
|
AddButton(bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,8 +473,8 @@ void RootWidget::Setup() {
|
|||||||
// bd.call = "";
|
// bd.call = "";
|
||||||
bd.call = Python::ObjID::kEmptyCall;
|
bd.call = Python::ObjID::kEmptyCall;
|
||||||
bd.visibility_mask =
|
bd.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
|
|
||||||
// on desktop, stick this in the top left corner
|
// on desktop, stick this in the top left corner
|
||||||
// if (GetUIScale() == UIScale::kLarge) {
|
// if (GetUIScale() == UIScale::kLarge) {
|
||||||
@ -527,12 +534,12 @@ void RootWidget::Setup() {
|
|||||||
b.img = "usersButton";
|
b.img = "usersButton";
|
||||||
b.call = Python::ObjID::kFriendsButtonPressCall;
|
b.call = Python::ObjID::kFriendsButtonPressCall;
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kInGame)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kInGame)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuMinimal)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuMinimal)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuMinimalNoBack)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuMinimalNoBack)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuCurrency)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuCurrency)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
party_button_ = AddButton(b);
|
party_button_ = AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,12 +558,12 @@ void RootWidget::Setup() {
|
|||||||
b.color_g = 0.5f;
|
b.color_g = 0.5f;
|
||||||
b.color_b = 0.2f;
|
b.color_b = 0.2f;
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kInGame)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kInGame)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuMinimal)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuMinimal)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuMinimalNoBack)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuMinimalNoBack)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuCurrency)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuCurrency)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
menu_button_ = AddButton(b);
|
menu_button_ = AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,8 +585,8 @@ void RootWidget::Setup() {
|
|||||||
b.color_b = BOT_LEFT_COLOR_B;
|
b.color_b = BOT_LEFT_COLOR_B;
|
||||||
b.img = "logIcon";
|
b.img = "logIcon";
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
AddButton(b);
|
AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -598,8 +605,8 @@ void RootWidget::Setup() {
|
|||||||
b.color_b = BOT_LEFT_COLOR_B;
|
b.color_b = BOT_LEFT_COLOR_B;
|
||||||
b.img = "achievementsIcon";
|
b.img = "achievementsIcon";
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
AddButton(b);
|
AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -618,8 +625,8 @@ void RootWidget::Setup() {
|
|||||||
b.color_b = BOT_LEFT_COLOR_B;
|
b.color_b = BOT_LEFT_COLOR_B;
|
||||||
b.img = "leaderboardsIcon";
|
b.img = "leaderboardsIcon";
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
AddButton(b);
|
AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -638,8 +645,8 @@ void RootWidget::Setup() {
|
|||||||
b.color_b = BOT_LEFT_COLOR_B;
|
b.color_b = BOT_LEFT_COLOR_B;
|
||||||
b.img = "settingsIcon";
|
b.img = "settingsIcon";
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
settings_button_ = AddButton(b);
|
settings_button_ = AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -682,11 +689,7 @@ void RootWidget::Setup() {
|
|||||||
bd.x = 0.0f;
|
bd.x = 0.0f;
|
||||||
bd.y = 41.0f;
|
bd.y = 41.0f;
|
||||||
bd.img = "uiAtlas2";
|
bd.img = "uiAtlas2";
|
||||||
if (GetUIScale() != UIScale::kSmall) {
|
|
||||||
bd.model_transparent = "toolbarBackingBottom2";
|
bd.model_transparent = "toolbarBackingBottom2";
|
||||||
} else {
|
|
||||||
bd.model_transparent = "toolbarBackingBottom2";
|
|
||||||
}
|
|
||||||
bd.selectable = false;
|
bd.selectable = false;
|
||||||
bd.color_r = backingR;
|
bd.color_r = backingR;
|
||||||
bd.color_g = backingG;
|
bd.color_g = backingG;
|
||||||
@ -697,9 +700,9 @@ void RootWidget::Setup() {
|
|||||||
// bd.call = "";
|
// bd.call = "";
|
||||||
bd.call = Python::ObjID::kEmptyCall;
|
bd.call = Python::ObjID::kEmptyCall;
|
||||||
bd.visibility_mask =
|
bd.visibility_mask =
|
||||||
static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot);
|
static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot);
|
||||||
bd.visibility_mask |=
|
bd.visibility_mask |=
|
||||||
static_cast<int>(Widget::ToolbarVisibility::kMenuFull);
|
static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull);
|
||||||
|
|
||||||
AddButton(bd);
|
AddButton(bd);
|
||||||
}
|
}
|
||||||
@ -713,8 +716,8 @@ void RootWidget::Setup() {
|
|||||||
b.img = "chestIcon";
|
b.img = "chestIcon";
|
||||||
b.depth_min = 0.3f;
|
b.depth_min = 0.3f;
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
float spacing = 110.0f;
|
float spacing = 110.0f;
|
||||||
b.x = -2.0f * spacing;
|
b.x = -2.0f * spacing;
|
||||||
AddButton(b);
|
AddButton(b);
|
||||||
@ -756,7 +759,7 @@ void RootWidget::Setup() {
|
|||||||
// b.y = b.height * 0.5f + 10;
|
// b.y = b.height * 0.5f + 10;
|
||||||
// b.img = "settingsIcon";
|
// b.img = "settingsIcon";
|
||||||
// b.visibility_mask =
|
// b.visibility_mask =
|
||||||
// (static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
// (static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
// |
|
// |
|
||||||
// static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
// static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
// AddButton(b);
|
// AddButton(b);
|
||||||
@ -772,8 +775,8 @@ void RootWidget::Setup() {
|
|||||||
b.y = b.height * 0.5f;
|
b.y = b.height * 0.5f;
|
||||||
b.img = "storeIcon";
|
b.img = "storeIcon";
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
AddButton(b);
|
AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -787,13 +790,11 @@ void RootWidget::Setup() {
|
|||||||
b.y = b.height * 0.45f;
|
b.y = b.height * 0.45f;
|
||||||
b.img = "inventoryIcon";
|
b.img = "inventoryIcon";
|
||||||
b.visibility_mask =
|
b.visibility_mask =
|
||||||
(static_cast<int>(Widget::ToolbarVisibility::kMenuFull)
|
(static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFull)
|
||||||
| static_cast<int>(Widget::ToolbarVisibility::kMenuFullRoot));
|
| static_cast<uint32_t>(Widget::ToolbarVisibility::kMenuFullRoot));
|
||||||
AddButton(b);
|
AddButton(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BA_TOOLBAR_TEST
|
|
||||||
|
|
||||||
UpdateForFocusedWindow(nullptr);
|
UpdateForFocusedWindow(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,8 +803,9 @@ void RootWidget::Draw(RenderPass* pass, bool transparent) {
|
|||||||
// motion.
|
// motion.
|
||||||
if (!transparent) {
|
if (!transparent) {
|
||||||
millisecs_t current_time = pass->frame_def()->base_time();
|
millisecs_t current_time = pass->frame_def()->base_time();
|
||||||
float time_diff = std::min(millisecs_t{100}, current_time - update_time_);
|
millisecs_t time_diff =
|
||||||
StepPositions(time_diff);
|
std::min(millisecs_t{100}, current_time - update_time_);
|
||||||
|
StepPositions(static_cast<float>(time_diff));
|
||||||
update_time_ = current_time;
|
update_time_ = current_time;
|
||||||
}
|
}
|
||||||
ContainerWidget::Draw(pass, transparent);
|
ContainerWidget::Draw(pass, transparent);
|
||||||
@ -1099,9 +1101,9 @@ void RootWidget::SetScreenWidget(StackWidget* w) {
|
|||||||
|
|
||||||
void RootWidget::SetOverlayWidget(StackWidget* w) {
|
void RootWidget::SetOverlayWidget(StackWidget* w) {
|
||||||
// this needs to happen after our buttons and things get added..
|
// this needs to happen after our buttons and things get added..
|
||||||
#if BA_TOOLBAR_TEST
|
if (explicit_bool(BA_TOOLBAR_TEST)) {
|
||||||
assert(!buttons_.empty());
|
assert(!buttons_.empty());
|
||||||
#endif // BA_TOOLBAR_TEST
|
}
|
||||||
AddWidget(w);
|
AddWidget(w);
|
||||||
overlay_stack_widget_ = w;
|
overlay_stack_widget_ = w;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,7 +141,7 @@ def _ballistica_bootstrap() -> object:
|
|||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
_app_state = _ballistica_bootstrap()
|
app_state = _ballistica_bootstrap()
|
||||||
|
|
||||||
# This code runs in the main namespace, so clean up after ourself.
|
# This code runs in the main namespace, so clean up after ourself.
|
||||||
del _ballistica_bootstrap, TYPE_CHECKING
|
del _ballistica_bootstrap, TYPE_CHECKING
|
||||||
|
|||||||
@ -80,7 +80,7 @@ def gen_binding_code(projroot: str, in_path: str, out_path: str) -> None:
|
|||||||
# Then it grabs the function that was defined and runs it.
|
# Then it grabs the function that was defined and runs it.
|
||||||
ccode += ('PyObject* bindvals = PythonCommand("get_binding_values()",'
|
ccode += ('PyObject* bindvals = PythonCommand("get_binding_values()",'
|
||||||
' "<get_binding_values>")'
|
' "<get_binding_values>")'
|
||||||
'.RunReturnObj(true);\n'
|
'.RunReturnObj(true, nullptr);\n'
|
||||||
'if (bindvals == nullptr) {\n'
|
'if (bindvals == nullptr) {\n'
|
||||||
' // Use a standard error to avoid a useless stack trace.\n'
|
' // Use a standard error to avoid a useless stack trace.\n'
|
||||||
' throw std::logic_error("Error binding required Python'
|
' throw std::logic_error("Error binding required Python'
|
||||||
|
|||||||
@ -811,7 +811,7 @@ def check_clioncode(projroot: Path, full: bool, verbose: bool) -> None:
|
|||||||
cachepath = Path('.cache/check_clioncode')
|
cachepath = Path('.cache/check_clioncode')
|
||||||
filenames = get_code_filenames(projroot)
|
filenames = get_code_filenames(projroot)
|
||||||
clionroot = Path('/Applications/CLion.app')
|
clionroot = Path('/Applications/CLion.app')
|
||||||
clionbin = Path(clionroot, 'Contents/MacOS/clion')
|
# clionbin = Path(clionroot, 'Contents/MacOS/clion')
|
||||||
inspect = Path(clionroot, 'Contents/bin/inspect.sh')
|
inspect = Path(clionroot, 'Contents/bin/inspect.sh')
|
||||||
|
|
||||||
# At the moment offline clion inspections seem a bit flaky.
|
# At the moment offline clion inspections seem a bit flaky.
|
||||||
@ -821,40 +821,56 @@ def check_clioncode(projroot: Path, full: bool, verbose: bool) -> None:
|
|||||||
# So for now let's try blowing away caches, launching the gui
|
# So for now let's try blowing away caches, launching the gui
|
||||||
# temporarily, and then kicking off inspections after that. Sigh.
|
# temporarily, and then kicking off inspections after that. Sigh.
|
||||||
print('Clearing CLion caches...', flush=True)
|
print('Clearing CLion caches...', flush=True)
|
||||||
subprocess.run('rm -rf ~/Library/Caches/CLion*', shell=True, check=True)
|
caches_root = os.environ['HOME'] + '/Library/Caches/JetBrains'
|
||||||
|
if not os.path.exists(caches_root):
|
||||||
|
raise RuntimeError(f'CLion caches root not found: {caches_root}')
|
||||||
|
subprocess.run('rm -rf ~/Library/Caches/JetBrains/CLion*',
|
||||||
|
shell=True,
|
||||||
|
check=True)
|
||||||
|
|
||||||
# UPDATE: seems this is unnecessary now; should double check.
|
# UPDATE: seems this is unnecessary now; should double check.
|
||||||
# Note: I'm assuming this project needs to be open when the GUI
|
# Note: I'm assuming this project needs to be open when the GUI
|
||||||
# comes up. Currently just have one project so can rely on auto-open
|
# comes up. Currently just have one project so can rely on auto-open
|
||||||
# but may need to get fancier later if that changes.
|
# but may need to get fancier later if that changes.
|
||||||
if bool(False):
|
if bool(True):
|
||||||
print('Launching GUI CLion to rebuild caches...', flush=True)
|
print('Launching GUI CLion to rebuild caches...', flush=True)
|
||||||
process = subprocess.Popen(str(clionbin))
|
# process = subprocess.Popen(str(clionbin))
|
||||||
|
subprocess.run(
|
||||||
|
['open', '-a', clionroot,
|
||||||
|
Path(projroot, 'ballisticacore-cmake')],
|
||||||
|
check=True)
|
||||||
|
|
||||||
# Wait a moment and ask it nicely to die.
|
# Wait a moment and ask it nicely to die.
|
||||||
waittime = 120
|
waittime = 60
|
||||||
while waittime > 0:
|
while waittime > 0:
|
||||||
print(f'Waiting for {waittime} more seconds.')
|
print(f'Waiting for {waittime} more seconds.', flush=True)
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
waittime -= 10
|
waittime -= 10
|
||||||
|
|
||||||
# Seems killing it via applescript is more likely to leave it
|
# For some reason this is giving a return-code 1 although
|
||||||
# in a working state for offline inspections than TERM signal..
|
# it appears to be working.
|
||||||
subprocess.run("osascript -e 'tell application \"CLion\" to quit'",
|
print('Waiting for GUI CLion to quit...', flush=True)
|
||||||
shell=True,
|
subprocess.run(
|
||||||
check=False)
|
[
|
||||||
|
'osascript', '-e', 'tell application "CLion" to quit\n'
|
||||||
|
'repeat until application "CLion" is not running\n'
|
||||||
|
' delay 1\n'
|
||||||
|
'end repeat'
|
||||||
|
],
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
# process.terminate()
|
# process.terminate()
|
||||||
print('Waiting for GUI CLion to quit...', flush=True)
|
# process.wait(timeout=60)
|
||||||
process.wait(timeout=60)
|
|
||||||
|
|
||||||
print('Launching Offline CLion to run inspections...', flush=True)
|
print('Launching Offline CLion to run inspections...', flush=True)
|
||||||
_run_idea_inspections_cached(
|
_run_idea_inspections_cached(cachepath=cachepath,
|
||||||
cachepath=cachepath,
|
|
||||||
filenames=filenames,
|
filenames=filenames,
|
||||||
full=full,
|
full=full,
|
||||||
projroot=Path(projroot, 'ballisticacore-cmake'),
|
projroot=Path(projroot,
|
||||||
inspectdir=Path(projroot, 'ballisticacore-cmake/src/ballistica'),
|
'ballisticacore-cmake'),
|
||||||
|
inspectdir=Path(projroot, 'src/ballistica'),
|
||||||
displayname='CLion',
|
displayname='CLion',
|
||||||
inspect=inspect,
|
inspect=inspect,
|
||||||
verbose=verbose)
|
verbose=verbose)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user